@remotion/promo-pages 4.0.459 → 4.0.461

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
@@ -954,6 +954,7 @@ import {
954
954
  } from "react";
955
955
  import { jsx as jsx8 } from "react/jsx-runtime";
956
956
  import { useEffect as useEffect3, useMemo as useMemo10, useRef as useRef4 } from "react";
957
+ import { useRef as useRef5 } from "react";
957
958
  import { jsx as jsx9 } from "react/jsx-runtime";
958
959
  import {
959
960
  forwardRef as forwardRef3,
@@ -962,7 +963,6 @@ import {
962
963
  useMemo as useMemo16,
963
964
  useState as useState6
964
965
  } from "react";
965
- import { useRef as useRef5 } from "react";
966
966
  import { useContext as useContext14, useMemo as useMemo13 } from "react";
967
967
  import { useContext as useContext13 } from "react";
968
968
  import { useContext as useContext12, useMemo as useMemo12 } from "react";
@@ -971,6 +971,7 @@ import { createContext as createContext14 } from "react";
971
971
  import React12, { useCallback as useCallback5, useMemo as useMemo14, useRef as useRef6, useState as useState4 } from "react";
972
972
  import { jsx as jsx11 } from "react/jsx-runtime";
973
973
  import React13, { forwardRef as forwardRef2, useState as useState5, useContext as useContext15, useMemo as useMemo15 } from "react";
974
+ import { createContext as createContext15 } from "react";
974
975
  import { jsx as jsx12 } from "react/jsx-runtime";
975
976
  import {
976
977
  forwardRef as forwardRef4,
@@ -984,7 +985,7 @@ import React15, { useCallback as useCallback6, useImperativeHandle, useRef as us
984
985
  import { jsx as jsx13 } from "react/jsx-runtime";
985
986
  import { jsx as jsx14 } from "react/jsx-runtime";
986
987
  import {
987
- createContext as createContext15,
988
+ createContext as createContext16,
988
989
  forwardRef as forwardRef5,
989
990
  useCallback as useCallback7,
990
991
  useContext as useContext17,
@@ -996,7 +997,7 @@ import {
996
997
  import { jsx as jsx15 } from "react/jsx-runtime";
997
998
  import { useContext as useContext18, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
998
999
  import {
999
- createContext as createContext16,
1000
+ createContext as createContext17,
1000
1001
  useCallback as useCallback8,
1001
1002
  useImperativeHandle as useImperativeHandle3,
1002
1003
  useLayoutEffect as useLayoutEffect4,
@@ -1006,12 +1007,12 @@ import {
1006
1007
  } from "react";
1007
1008
  import { jsx as jsx16 } from "react/jsx-runtime";
1008
1009
  import { forwardRef as forwardRef8, useCallback as useCallback13, useContext as useContext30 } from "react";
1009
- import React17, { createContext as createContext17, useMemo as useMemo19 } from "react";
1010
+ import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
1010
1011
  import { jsx as jsx17 } from "react/jsx-runtime";
1011
1012
  import { useContext as useContext19 } from "react";
1012
- import { createContext as createContext18, useEffect as useEffect7, useState as useState11 } from "react";
1013
+ import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
1013
1014
  import { jsx as jsx18 } from "react/jsx-runtime";
1014
- import { createContext as createContext19, useMemo as useMemo20, useReducer } from "react";
1015
+ import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
1015
1016
  import { jsx as jsx19 } from "react/jsx-runtime";
1016
1017
  import React23, {
1017
1018
  forwardRef as forwardRef6,
@@ -1024,7 +1025,7 @@ import React23, {
1024
1025
  } from "react";
1025
1026
  import { useContext as useContext21, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
1026
1027
  import React20, {
1027
- createContext as createContext20,
1028
+ createContext as createContext21,
1028
1029
  createRef as createRef2,
1029
1030
  useCallback as useCallback9,
1030
1031
  useContext as useContext20,
@@ -1060,7 +1061,7 @@ import React22 from "react";
1060
1061
  import { useEffect as useEffect10, useState as useState15 } from "react";
1061
1062
  import { useEffect as useEffect11, useRef as useRef16 } from "react";
1062
1063
  import { useEffect as useEffect13 } from "react";
1063
- import { createContext as createContext21, useContext as useContext27, useMemo as useMemo27 } from "react";
1064
+ import { createContext as createContext22, useContext as useContext27, useMemo as useMemo27 } from "react";
1064
1065
  import { jsx as jsx222 } from "react/jsx-runtime";
1065
1066
  import {
1066
1067
  forwardRef as forwardRef7,
@@ -1096,16 +1097,15 @@ import {
1096
1097
  import { jsx as jsx27 } from "react/jsx-runtime";
1097
1098
  import React29 from "react";
1098
1099
  import { useMemo as useMemo32 } from "react";
1099
- import { createContext as createContext22, useContext as useContext32, useMemo as useMemo31 } from "react";
1100
+ import { createContext as createContext23, useContext as useContext32, useMemo as useMemo31 } from "react";
1100
1101
  import { jsx as jsx28 } from "react/jsx-runtime";
1101
1102
  import { jsx as jsx29 } from "react/jsx-runtime";
1102
1103
  import React31 from "react";
1103
- import React32, { createContext as createContext23 } from "react";
1104
- import { useContext as useContext33 } from "react";
1104
+ import React32, { createContext as createContext24 } from "react";
1105
1105
  import { useCallback as useCallback18 } from "react";
1106
1106
  import {
1107
1107
  useCallback as useCallback17,
1108
- useContext as useContext34,
1108
+ useContext as useContext33,
1109
1109
  useEffect as useEffect16,
1110
1110
  useLayoutEffect as useLayoutEffect11,
1111
1111
  useMemo as useMemo33,
@@ -1114,7 +1114,7 @@ import {
1114
1114
  import { jsx as jsx30 } from "react/jsx-runtime";
1115
1115
  import React34, {
1116
1116
  forwardRef as forwardRef10,
1117
- useContext as useContext35,
1117
+ useContext as useContext34,
1118
1118
  useEffect as useEffect18,
1119
1119
  useImperativeHandle as useImperativeHandle8,
1120
1120
  useMemo as useMemo34,
@@ -1128,14 +1128,14 @@ import React36, { useMemo as useMemo35 } from "react";
1128
1128
  import { jsx as jsx33 } from "react/jsx-runtime";
1129
1129
  import { Children, forwardRef as forwardRef11, useMemo as useMemo36 } from "react";
1130
1130
  import React37 from "react";
1131
- import React38, { createContext as createContext24 } from "react";
1131
+ import React38, { createContext as createContext25 } from "react";
1132
1132
  import { jsx as jsx34 } from "react/jsx-runtime";
1133
1133
  import { jsx as jsx35 } from "react/jsx-runtime";
1134
1134
  import React40 from "react";
1135
- import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as useContext37 } from "react";
1135
+ import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as useContext36 } from "react";
1136
1136
  import {
1137
1137
  forwardRef as forwardRef12,
1138
- useContext as useContext36,
1138
+ useContext as useContext35,
1139
1139
  useEffect as useEffect19,
1140
1140
  useImperativeHandle as useImperativeHandle9,
1141
1141
  useLayoutEffect as useLayoutEffect12,
@@ -2416,6 +2416,39 @@ var useCurrentFrame = () => {
2416
2416
  const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
2417
2417
  return frame - contextOffset;
2418
2418
  };
2419
+ var flattenEffects = (effects) => {
2420
+ const out = [];
2421
+ for (const item of effects) {
2422
+ if (Array.isArray(item)) {
2423
+ for (const inner of item) {
2424
+ out.push(inner);
2425
+ }
2426
+ } else {
2427
+ out.push(item);
2428
+ }
2429
+ }
2430
+ return out;
2431
+ };
2432
+ var groupByBackend = (effects) => {
2433
+ const runs = [];
2434
+ let current = [];
2435
+ let currentBackend = null;
2436
+ for (const eff of effects) {
2437
+ const { backend } = eff.definition;
2438
+ if (currentBackend === null || backend === currentBackend) {
2439
+ current.push(eff);
2440
+ currentBackend = backend;
2441
+ } else {
2442
+ runs.push({ backend: currentBackend, effects: current });
2443
+ current = [eff];
2444
+ currentBackend = backend;
2445
+ }
2446
+ }
2447
+ if (currentBackend !== null && current.length > 0) {
2448
+ runs.push({ backend: currentBackend, effects: current });
2449
+ }
2450
+ return runs;
2451
+ };
2419
2452
 
2420
2453
  class CanvasPool {
2421
2454
  width;
@@ -2489,39 +2522,6 @@ class CanvasPool {
2489
2522
  }
2490
2523
  }
2491
2524
  }
2492
- var flattenEffects = (effects) => {
2493
- const out = [];
2494
- for (const item of effects) {
2495
- if (Array.isArray(item)) {
2496
- for (const inner of item) {
2497
- out.push(inner);
2498
- }
2499
- } else {
2500
- out.push(item);
2501
- }
2502
- }
2503
- return out;
2504
- };
2505
- var groupByBackend = (effects) => {
2506
- const runs = [];
2507
- let current = [];
2508
- let currentBackend = null;
2509
- for (const eff of effects) {
2510
- const { backend } = eff.definition;
2511
- if (currentBackend === null || backend === currentBackend) {
2512
- current.push(eff);
2513
- currentBackend = backend;
2514
- } else {
2515
- runs.push({ backend: currentBackend, effects: current });
2516
- current = [eff];
2517
- currentBackend = backend;
2518
- }
2519
- }
2520
- if (currentBackend !== null && current.length > 0) {
2521
- runs.push({ backend: currentBackend, effects: current });
2522
- }
2523
- return runs;
2524
- };
2525
2525
  var devicePromise = null;
2526
2526
  var getGpuDevice = () => {
2527
2527
  if (devicePromise) {
@@ -2573,8 +2573,7 @@ var runEffectChain = async ({
2573
2573
  }) => {
2574
2574
  const runId = ++state.currentRunId;
2575
2575
  const isCancelled = () => state.currentRunId !== runId;
2576
- const flattened = flattenEffects(effects);
2577
- const runs = groupByBackend(flattened);
2576
+ const runs = groupByBackend(effects);
2578
2577
  let currentImage = source;
2579
2578
  let lastTarget = null;
2580
2579
  if (runs.length === 0) {
@@ -2668,12 +2667,29 @@ var useEffectChainState = () => {
2668
2667
  }
2669
2668
  }), []);
2670
2669
  };
2670
+ var useMemoizedEffects = (effects) => {
2671
+ const previousRef = useRef5(null);
2672
+ const previous = previousRef.current;
2673
+ const isSame = previous !== null && previous.length === effects.length && previous.every((p, i) => p.definition === effects[i].definition && p.effectKey === effects[i].effectKey);
2674
+ if (isSame) {
2675
+ return previous;
2676
+ }
2677
+ const next = effects.map((e) => ({
2678
+ definition: e.definition,
2679
+ stack: e.stack,
2680
+ effectKey: e.effectKey,
2681
+ params: e.params,
2682
+ memoized: true
2683
+ }));
2684
+ previousRef.current = next;
2685
+ return next;
2686
+ };
2671
2687
  var componentsToAddStacksTo = [];
2672
2688
  var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
2673
2689
  var addSequenceStackTraces = (component) => {
2674
2690
  componentsToAddStacksTo.push(component);
2675
2691
  };
2676
- var VERSION = "4.0.459";
2692
+ var VERSION = "4.0.461";
2677
2693
  var checkMultipleRemotionVersions = () => {
2678
2694
  if (typeof globalThis === "undefined") {
2679
2695
  return;
@@ -2701,20 +2717,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
2701
2717
  }
2702
2718
  set();
2703
2719
  };
2704
- var useMemoizedEffects = (effects) => {
2705
- const previousRef = useRef5(null);
2706
- const previous = previousRef.current;
2707
- const isSame = previous !== null && previous.length === effects.length && previous.every((p, i) => p.definition === effects[i].definition && p.stack === effects[i].stack);
2708
- if (isSame) {
2709
- return previous;
2710
- }
2711
- const next = effects.map((e) => ({
2712
- definition: e.definition,
2713
- stack: e.stack
2714
- }));
2715
- previousRef.current = next;
2716
- return next;
2717
- };
2718
2720
  var useUnsafeVideoConfig = () => {
2719
2721
  const context = useContext12(SequenceContext);
2720
2722
  const ctxWidth = context?.width ?? null;
@@ -2872,6 +2874,22 @@ var sequenceStyleSchema = {
2872
2874
  step: 0.01,
2873
2875
  default: 1,
2874
2876
  description: "Opacity"
2877
+ },
2878
+ premountFor: {
2879
+ type: "number",
2880
+ default: 0,
2881
+ description: "Premount For",
2882
+ min: 0,
2883
+ step: 1
2884
+ },
2885
+ postmountFor: {
2886
+ type: "hidden"
2887
+ },
2888
+ styleWhilePremounted: {
2889
+ type: "hidden"
2890
+ },
2891
+ styleWhilePostmounted: {
2892
+ type: "hidden"
2875
2893
  }
2876
2894
  };
2877
2895
  var sequenceSchema = {
@@ -2892,6 +2910,9 @@ var sequenceSchemaDefaultLayoutNone = {
2892
2910
  default: "none"
2893
2911
  }
2894
2912
  };
2913
+ var nodePathToString = (nodePath) => {
2914
+ return nodePath.join(".");
2915
+ };
2895
2916
  var SequenceManager = React12.createContext({
2896
2917
  registerSequence: () => {
2897
2918
  throw new Error("SequenceManagerContext not initialized");
@@ -2907,60 +2928,73 @@ var SequenceVisibilityToggleContext = React12.createContext({
2907
2928
  throw new Error("SequenceVisibilityToggle not initialized");
2908
2929
  }
2909
2930
  });
2910
- var VisualModeOverridesContext = React12.createContext({
2911
- dragOverrides: {},
2931
+ var getCodeValuesCtx = (codeValues, nodePath) => {
2932
+ const status = codeValues[nodePathToString(nodePath)];
2933
+ if (!status) {
2934
+ return;
2935
+ }
2936
+ if (!status.canUpdate) {
2937
+ return;
2938
+ }
2939
+ return status.props;
2940
+ };
2941
+ var VisualModeCodeValuesContext = React12.createContext({
2942
+ getCodeValues: () => {
2943
+ throw new Error("VisualModeCodeValuesContext not initialized");
2944
+ }
2945
+ });
2946
+ var VisualModeDragOverridesContext = React12.createContext({
2947
+ getDragOverrides: () => {
2948
+ throw new Error("VisualModeDragOverridesContext not initialized");
2949
+ }
2950
+ });
2951
+ var VisualModeSettersContext = React12.createContext({
2912
2952
  setDragOverrides: () => {
2913
- throw new Error("VisualModeOverridesContext not initialized");
2953
+ throw new Error("VisualModeSettersContext not initialized");
2914
2954
  },
2915
2955
  clearDragOverrides: () => {
2916
- throw new Error("VisualModeOverridesContext not initialized");
2956
+ throw new Error("VisualModeSettersContext not initialized");
2917
2957
  },
2918
- codeValues: {},
2919
2958
  setCodeValues: () => {
2920
- throw new Error("VisualModeOverridesContext not initialized");
2921
- },
2922
- visualModeEnabled: false
2959
+ throw new Error("VisualModeSettersContext not initialized");
2960
+ }
2923
2961
  });
2924
- var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
2962
+ var SequenceManagerProvider = ({ children }) => {
2925
2963
  const [sequences, setSequences] = useState4([]);
2926
2964
  const [hidden, setHidden] = useState4({});
2927
2965
  const [dragOverrides, setControlOverrides] = useState4({});
2928
2966
  const controlOverridesRef = useRef6(dragOverrides);
2929
2967
  controlOverridesRef.current = dragOverrides;
2930
2968
  const [codeValues, setCodeValuesMapState] = useState4({});
2931
- const setDragOverrides = useCallback5((sequenceId, key, value) => {
2969
+ const setDragOverrides = useCallback5((nodePath, key, value) => {
2932
2970
  setControlOverrides((prev) => ({
2933
2971
  ...prev,
2934
- [sequenceId]: {
2935
- ...prev[sequenceId],
2972
+ [nodePathToString(nodePath)]: {
2973
+ ...prev[nodePathToString(nodePath)],
2936
2974
  [key]: value
2937
2975
  }
2938
2976
  }));
2939
2977
  }, []);
2940
- const clearDragOverrides = useCallback5((sequenceId) => {
2978
+ const clearDragOverrides = useCallback5((nodePath) => {
2941
2979
  setControlOverrides((prev) => {
2942
- if (!prev[sequenceId]) {
2980
+ const key = nodePathToString(nodePath);
2981
+ if (!prev[key]) {
2943
2982
  return prev;
2944
2983
  }
2945
2984
  const next = { ...prev };
2946
- delete next[sequenceId];
2985
+ delete next[key];
2947
2986
  return next;
2948
2987
  });
2949
2988
  }, []);
2950
- const setCodeValues = useCallback5((sequenceId, values) => {
2989
+ const setCodeValues = useCallback5((nodePath, values) => {
2951
2990
  setCodeValuesMapState((prev) => {
2952
- if (prev[sequenceId] === values) {
2991
+ const key = nodePathToString(nodePath);
2992
+ const prevKey = prev[key];
2993
+ const newKey = values(prevKey);
2994
+ if (prevKey === newKey) {
2953
2995
  return prev;
2954
2996
  }
2955
- if (values === null) {
2956
- if (!(sequenceId in prev)) {
2957
- return prev;
2958
- }
2959
- const next = { ...prev };
2960
- delete next[sequenceId];
2961
- return next;
2962
- }
2963
- return { ...prev, [sequenceId]: values };
2997
+ return { ...prev, [key]: newKey };
2964
2998
  });
2965
2999
  }, []);
2966
3000
  const registerSequence = useCallback5((seq) => {
@@ -2984,40 +3018,85 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
2984
3018
  setHidden
2985
3019
  };
2986
3020
  }, [hidden]);
2987
- const overrideContext = useMemo14(() => {
3021
+ const getDragOverrides = useCallback5((nodePath) => {
3022
+ return dragOverrides[nodePathToString(nodePath)] ?? {};
3023
+ }, [dragOverrides]);
3024
+ const getCodeValues = useCallback5((nodePath) => {
3025
+ return getCodeValuesCtx(codeValues, nodePath);
3026
+ }, [codeValues]);
3027
+ const codeValuesContext = useMemo14(() => {
3028
+ return {
3029
+ getCodeValues
3030
+ };
3031
+ }, [getCodeValues]);
3032
+ const dragOverridesContext = useMemo14(() => {
3033
+ return {
3034
+ getDragOverrides
3035
+ };
3036
+ }, [getDragOverrides]);
3037
+ const settersContext = useMemo14(() => {
2988
3038
  return {
2989
- visualModeEnabled,
2990
- dragOverrides,
2991
3039
  setDragOverrides,
2992
3040
  clearDragOverrides,
2993
- codeValues,
2994
3041
  setCodeValues
2995
3042
  };
2996
- }, [
2997
- visualModeEnabled,
2998
- dragOverrides,
2999
- setDragOverrides,
3000
- clearDragOverrides,
3001
- codeValues,
3002
- setCodeValues
3003
- ]);
3043
+ }, [setDragOverrides, clearDragOverrides, setCodeValues]);
3004
3044
  return /* @__PURE__ */ jsx11(SequenceManager.Provider, {
3005
3045
  value: sequenceContext,
3006
3046
  children: /* @__PURE__ */ jsx11(SequenceVisibilityToggleContext.Provider, {
3007
3047
  value: hiddenContext,
3008
- children: /* @__PURE__ */ jsx11(VisualModeOverridesContext.Provider, {
3009
- value: overrideContext,
3010
- children
3048
+ children: /* @__PURE__ */ jsx11(VisualModeCodeValuesContext.Provider, {
3049
+ value: codeValuesContext,
3050
+ children: /* @__PURE__ */ jsx11(VisualModeDragOverridesContext.Provider, {
3051
+ value: dragOverridesContext,
3052
+ children: /* @__PURE__ */ jsx11(VisualModeSettersContext.Provider, {
3053
+ value: settersContext,
3054
+ children
3055
+ })
3056
+ })
3011
3057
  })
3012
3058
  })
3013
3059
  });
3014
3060
  };
3015
3061
  var ENABLE_V5_BREAKING_CHANGES = false;
3062
+ var deleteNestedKey = (obj, keysToRemove) => {
3063
+ for (const key of keysToRemove) {
3064
+ const parts = key.split(".");
3065
+ const parents = [obj];
3066
+ let current = obj;
3067
+ for (let i = 0;i < parts.length - 1; i++) {
3068
+ const part = parts[i];
3069
+ const next = current[part];
3070
+ if (next === undefined || next === null) {
3071
+ current = null;
3072
+ break;
3073
+ }
3074
+ current = next;
3075
+ parents.push(current);
3076
+ }
3077
+ if (current === null) {
3078
+ continue;
3079
+ }
3080
+ delete current[parts[parts.length - 1]];
3081
+ for (let i = parents.length - 1;i > 0; i--) {
3082
+ const parent = parents[i];
3083
+ if (Object.keys(parent).length === 0) {
3084
+ const parentKey = parts[i - 1];
3085
+ delete parents[i - 1][parentKey];
3086
+ } else {
3087
+ break;
3088
+ }
3089
+ }
3090
+ }
3091
+ return obj;
3092
+ };
3016
3093
  var flattenActiveSchema = (schema, resolve) => {
3017
3094
  const out = {};
3018
3095
  for (const key of Object.keys(schema)) {
3019
3096
  const field = schema[key];
3020
- if (field.type === "enum") {
3097
+ if (field.type === "hidden") {
3098
+ continue;
3099
+ } else if (field.type === "enum") {
3021
3100
  out[key] = field;
3022
3101
  const current = resolve(key) ?? field.default;
3023
3102
  const variant = field.variants[current];
@@ -3052,6 +3131,44 @@ var getFlatSchemaWithAllKeys = (schema) => {
3052
3131
  }
3053
3132
  return out;
3054
3133
  };
3134
+ var OverrideIdsToNodePathsGettersContext = createContext15({
3135
+ overrideIdToNodePathMappings: {}
3136
+ });
3137
+ var OverrideIdsToNodePathsSettersContext = createContext15({
3138
+ setOverrideIdToNodePath: () => {
3139
+ throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
3140
+ }
3141
+ });
3142
+ var findPropsToDelete = ({
3143
+ schema,
3144
+ key,
3145
+ value
3146
+ }) => {
3147
+ const fieldSchema = schema[key];
3148
+ if (!fieldSchema) {
3149
+ throw new Error("Key " + JSON.stringify(key) + " not found in schema");
3150
+ }
3151
+ if (typeof value !== "string") {
3152
+ throw new Error("Value must be a string, but is " + JSON.stringify(value));
3153
+ }
3154
+ if (fieldSchema.type !== "enum") {
3155
+ throw new Error("Key " + JSON.stringify(key) + " is not an enum");
3156
+ }
3157
+ const currentVariant = fieldSchema.variants[value];
3158
+ if (!currentVariant) {
3159
+ throw new Error("Value for " + JSON.stringify(key) + " must be one of " + Object.keys(fieldSchema.variants).map((v) => JSON.stringify(v)).join(", ") + ", got " + JSON.stringify(value));
3160
+ }
3161
+ const otherVariants = Object.keys(fieldSchema.variants).filter((v) => v !== value);
3162
+ const otherKeys = new Set;
3163
+ for (const variant of otherVariants) {
3164
+ const otherVariant = fieldSchema.variants[variant];
3165
+ const keys = Object.keys(otherVariant);
3166
+ for (const k of keys) {
3167
+ otherKeys.add(k);
3168
+ }
3169
+ }
3170
+ return [...otherKeys];
3171
+ };
3055
3172
  var getEffectiveVisualModeValue = ({
3056
3173
  codeValue,
3057
3174
  runtimeValue,
@@ -3097,17 +3214,38 @@ var computeEffectiveSchemaValuesDotNotation = ({
3097
3214
  propStatus
3098
3215
  }) => {
3099
3216
  const merged = {};
3217
+ const propsToDelete = new Set;
3100
3218
  for (const key of Object.keys(currentValue)) {
3101
3219
  const codeValueStatus = propStatus?.[key] ?? null;
3102
- merged[key] = getEffectiveVisualModeValue({
3220
+ const field = findFieldInSchema(schema, key);
3221
+ if (field?.type === "hidden") {
3222
+ continue;
3223
+ }
3224
+ const value = getEffectiveVisualModeValue({
3103
3225
  codeValue: codeValueStatus,
3104
3226
  runtimeValue: currentValue[key],
3105
3227
  dragOverrideValue: overrideValues[key],
3106
- defaultValue: findFieldInSchema(schema, key)?.default,
3228
+ defaultValue: field?.default,
3107
3229
  shouldResortToDefaultValueIfUndefined: false
3108
3230
  });
3231
+ if (value === undefined) {
3232
+ propsToDelete.add(key);
3233
+ }
3234
+ merged[key] = value;
3109
3235
  }
3110
- return merged;
3236
+ for (const key of Object.keys(overrideValues)) {
3237
+ if (schema[key]?.type === "enum") {
3238
+ const propsToDeleteForKey = findPropsToDelete({
3239
+ schema,
3240
+ key,
3241
+ value: merged[key]
3242
+ });
3243
+ for (const propToDelete of propsToDeleteForKey) {
3244
+ propsToDelete.add(propToDelete);
3245
+ }
3246
+ }
3247
+ }
3248
+ return { merged, propsToDelete };
3111
3249
  };
3112
3250
  var getNestedValue = (obj, key) => {
3113
3251
  const parts = key.split(".");
@@ -3132,7 +3270,8 @@ var selectActiveKeys = (schema, values) => {
3132
3270
  var mergeValues = ({
3133
3271
  props,
3134
3272
  valuesDotNotation,
3135
- schemaKeys
3273
+ schemaKeys,
3274
+ propsToDelete
3136
3275
  }) => {
3137
3276
  const merged = { ...props };
3138
3277
  for (const key of schemaKeys) {
@@ -3154,31 +3293,45 @@ var mergeValues = ({
3154
3293
  }
3155
3294
  current[parts[parts.length - 1]] = value;
3156
3295
  }
3296
+ deleteNestedKey(merged, propsToDelete);
3157
3297
  return merged;
3158
3298
  };
3299
+ var stackToOverrideMap = {};
3159
3300
  var wrapInSchema = (Component, schema) => {
3160
- if (typeof process === "undefined" || !process.env?.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
3161
- return Component;
3162
- }
3163
3301
  const flatSchema = getFlatSchemaWithAllKeys(schema);
3164
3302
  const flatKeys = Object.keys(flatSchema);
3165
3303
  const Wrapped = forwardRef2((props, ref) => {
3166
3304
  const env = useRemotionEnvironment();
3167
- const { visualModeEnabled, dragOverrides, codeValues } = useContext15(VisualModeOverridesContext);
3168
- if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !visualModeEnabled) {
3305
+ if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
3169
3306
  return React13.createElement(Component, {
3170
3307
  ...props,
3171
3308
  _experimentalControls: null,
3172
3309
  ref
3173
3310
  });
3174
3311
  }
3312
+ const { getCodeValues } = useContext15(VisualModeCodeValuesContext);
3313
+ const { getDragOverrides } = useContext15(VisualModeDragOverridesContext);
3314
+ const nodePathMapping = useContext15(OverrideIdsToNodePathsGettersContext);
3175
3315
  if (props._experimentalControls) {
3176
3316
  return React13.createElement(Component, {
3177
3317
  ...props,
3178
3318
  ref
3179
3319
  });
3180
3320
  }
3181
- const [overrideId] = useState5(() => String(Math.random()));
3321
+ const [overrideId] = useState5(() => {
3322
+ const { stack } = props;
3323
+ if (!stack) {
3324
+ return String(Math.random());
3325
+ }
3326
+ const existingOverrideId = stackToOverrideMap[stack];
3327
+ if (existingOverrideId) {
3328
+ return existingOverrideId;
3329
+ }
3330
+ const newOverrideId = String(Math.random());
3331
+ stackToOverrideMap[stack] = newOverrideId;
3332
+ return newOverrideId;
3333
+ });
3334
+ const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
3182
3335
  const runtimeValues = flatKeys.map((k) => getNestedValue(props, k));
3183
3336
  const currentRuntimeValueDotNotation = useMemo15(() => readValuesFromProps(props, flatKeys), runtimeValues);
3184
3337
  const controls = useMemo15(() => {
@@ -3188,19 +3341,25 @@ var wrapInSchema = (Component, schema) => {
3188
3341
  overrideId
3189
3342
  };
3190
3343
  }, [currentRuntimeValueDotNotation, overrideId]);
3191
- const valuesDotNotation = useMemo15(() => {
3344
+ const { merged: valuesDotNotation, propsToDelete } = useMemo15(() => {
3192
3345
  return computeEffectiveSchemaValuesDotNotation({
3193
3346
  schema,
3194
3347
  currentValue: currentRuntimeValueDotNotation,
3195
- overrideValues: dragOverrides[overrideId] ?? {},
3196
- propStatus: codeValues[overrideId]
3348
+ overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
3349
+ propStatus: nodePath === null ? undefined : getCodeValues(nodePath)
3197
3350
  });
3198
- }, [currentRuntimeValueDotNotation, dragOverrides, overrideId, codeValues]);
3351
+ }, [
3352
+ currentRuntimeValueDotNotation,
3353
+ getDragOverrides,
3354
+ nodePath,
3355
+ getCodeValues
3356
+ ]);
3199
3357
  const activeKeys = selectActiveKeys(schema, valuesDotNotation);
3200
3358
  const mergedProps = mergeValues({
3201
3359
  props,
3202
3360
  valuesDotNotation,
3203
- schemaKeys: activeKeys
3361
+ schemaKeys: activeKeys,
3362
+ propsToDelete
3204
3363
  });
3205
3364
  return React13.createElement(Component, {
3206
3365
  ...mergedProps,
@@ -3296,7 +3455,6 @@ var RegularSequenceRefForwardingFunction = ({
3296
3455
  }, [name]);
3297
3456
  const env = useRemotionEnvironment();
3298
3457
  const inheritedStack = other?.stack ?? null;
3299
- const memoizedEffects = useMemoizedEffects(flattenEffects(_experimentalEffects ?? []));
3300
3458
  useEffect5(() => {
3301
3459
  if (!env.isStudio) {
3302
3460
  return;
@@ -3305,7 +3463,7 @@ var RegularSequenceRefForwardingFunction = ({
3305
3463
  registerSequence({
3306
3464
  type: isMedia.type,
3307
3465
  controls: controls ?? null,
3308
- effects: memoizedEffects,
3466
+ effects: _experimentalEffects ?? [],
3309
3467
  displayName: timelineClipName,
3310
3468
  doesVolumeChange: isMedia.data.doesVolumeChange,
3311
3469
  duration: actualDurationInFrames,
@@ -3343,7 +3501,7 @@ var RegularSequenceRefForwardingFunction = ({
3343
3501
  premountDisplay: premountDisplay ?? null,
3344
3502
  postmountDisplay: postmountDisplay ?? null,
3345
3503
  controls: controls ?? null,
3346
- effects: memoizedEffects
3504
+ effects: _experimentalEffects ?? []
3347
3505
  });
3348
3506
  return () => {
3349
3507
  unregisterSequence(id);
@@ -3368,7 +3526,7 @@ var RegularSequenceRefForwardingFunction = ({
3368
3526
  env.isStudio,
3369
3527
  inheritedStack,
3370
3528
  controls,
3371
- memoizedEffects,
3529
+ _experimentalEffects,
3372
3530
  isMedia
3373
3531
  ]);
3374
3532
  const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
@@ -3859,7 +4017,7 @@ var defaultOnPaint = ({
3859
4017
  const transform = ctx.drawElementImage(elementImage, 0, 0);
3860
4018
  element.style.transform = transform.toString();
3861
4019
  };
3862
- var HtmlInCanvasAncestorContext = createContext15(false);
4020
+ var HtmlInCanvasAncestorContext = createContext16(false);
3863
4021
  var HtmlInCanvasInner = forwardRef5(({
3864
4022
  width,
3865
4023
  height,
@@ -3893,8 +4051,9 @@ var HtmlInCanvasInner = forwardRef5(({
3893
4051
  }, [ref]);
3894
4052
  const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
3895
4053
  const chainState = useEffectChainState();
3896
- const effectsRef = useRef9(effects);
3897
- effectsRef.current = effects;
4054
+ const memoizedEffects = useMemoizedEffects(flattenEffects(effects));
4055
+ const effectsRef = useRef9(memoizedEffects);
4056
+ effectsRef.current = memoizedEffects;
3898
4057
  const frameRef = useRef9(frame);
3899
4058
  frameRef.current = frame;
3900
4059
  const onPaintRef = useRef9(onPaint);
@@ -3994,7 +4153,7 @@ var HtmlInCanvasInner = forwardRef5(({
3994
4153
  return;
3995
4154
  }
3996
4155
  canvas.requestPaint?.();
3997
- }, [onPaint]);
4156
+ }, [onPaint, memoizedEffects]);
3998
4157
  useLayoutEffect3(() => {
3999
4158
  const canvas = canvas2dRef.current;
4000
4159
  if (!canvas) {
@@ -4021,7 +4180,7 @@ var HtmlInCanvasInner = forwardRef5(({
4021
4180
  durationInFrames: resolvedDuration,
4022
4181
  name: "<HtmlInCanvas>",
4023
4182
  _experimentalControls: controls,
4024
- _experimentalEffects: effects,
4183
+ _experimentalEffects: memoizedEffects,
4025
4184
  layout: "none",
4026
4185
  ...sequenceProps,
4027
4186
  children: /* @__PURE__ */ jsx15(HtmlInCanvasAncestorContext.Provider, {
@@ -4076,7 +4235,7 @@ var validateRenderAsset = (artifact) => {
4076
4235
  }
4077
4236
  validateContent(artifact.content);
4078
4237
  };
4079
- var RenderAssetManager = createContext16({
4238
+ var RenderAssetManager = createContext17({
4080
4239
  registerRenderAsset: () => {
4081
4240
  return;
4082
4241
  },
@@ -4214,7 +4373,7 @@ var calculateMediaDuration = ({
4214
4373
  const actualDuration = duration / playbackRate;
4215
4374
  return Math.floor(actualDuration);
4216
4375
  };
4217
- var LoopContext = createContext17(null);
4376
+ var LoopContext = createContext18(null);
4218
4377
  var useLoop = () => {
4219
4378
  return React17.useContext(LoopContext);
4220
4379
  };
@@ -4285,7 +4444,7 @@ var playbackLogging = ({
4285
4444
  const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
4286
4445
  Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
4287
4446
  };
4288
- var PreloadContext = createContext18({});
4447
+ var PreloadContext = createContext19({});
4289
4448
  var preloads = {};
4290
4449
  var updaters = [];
4291
4450
  var setPreloads = (updater) => {
@@ -4606,7 +4765,7 @@ var durationReducer = (state, action) => {
4606
4765
  return state;
4607
4766
  }
4608
4767
  };
4609
- var DurationsContext = createContext19({
4768
+ var DurationsContext = createContext20({
4610
4769
  durations: {},
4611
4770
  setDurations: () => {
4612
4771
  throw new Error("context missing");
@@ -4820,8 +4979,8 @@ var didPropChange = (key, newProp, prevProp) => {
4820
4979
  }
4821
4980
  return true;
4822
4981
  };
4823
- var SharedAudioContext = createContext20(null);
4824
- var SharedAudioTagsContext = createContext20(null);
4982
+ var SharedAudioContext = createContext21(null);
4983
+ var SharedAudioTagsContext = createContext21(null);
4825
4984
  var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled }) => {
4826
4985
  const logLevel = useLogLevel();
4827
4986
  const ctxAndGain = useSingletonAudioContext({
@@ -4866,8 +5025,9 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
4866
5025
  if (!ctxAndGain) {
4867
5026
  throw new Error("Audio context not found");
4868
5027
  }
5028
+ const saveForLater = ctxAndGain.audioContext.state === "suspended" && !isResuming.current;
4869
5029
  if (duration > 0) {
4870
- if (ctxAndGain.audioContext.state === "suspended") {
5030
+ if (saveForLater) {
4871
5031
  nodesToResume.current.set(node, {
4872
5032
  scheduledTime,
4873
5033
  offset,
@@ -4885,7 +5045,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
4885
5045
  const prev = prevEndTimes.current;
4886
5046
  const scheduledMismatch = prev.scheduledEndTime !== null && Math.abs(scheduledTime - prev.scheduledEndTime) > 0.001;
4887
5047
  const mediaMismatch = prev.mediaEndTime !== null && Math.abs(mediaTime - prev.mediaEndTime) > 0.001;
4888
- Log.verbose({ logLevel, tag: "audio-scheduling" }, "scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s", scheduledMismatch ? "color: red; font-weight: bold" : "", scheduledTime.toFixed(4), "", scheduledEndTime.toFixed(4), mediaMismatch ? "color: red; font-weight: bold" : "", mediaTime.toFixed(4), "", mediaEndTime.toFixed(4), duration < 0 ? "color: red; font-weight: bold" : timeDiff < 0 ? "color: red; font-weight: bold" : "color: blue; font-weight: bold", duration < 0 ? "missed " + Math.abs(offset).toFixed(2) + "s" : Math.abs(timeDiff).toFixed(2) + (timeDiff < 0 ? " delay" : " ahead"), "", "current=" + currentTime.toFixed(4), "offset=" + offset.toFixed(4), "latency=" + latency.toFixed(4), "state=" + ctxAndGain.audioContext.state, originalUnloopedMediaTimestamp !== mediaTime ? "original_ts=" + originalUnloopedMediaTimestamp.toFixed(4) : "");
5048
+ Log.verbose({ logLevel, tag: "audio-scheduling" }, "scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s %s %s", scheduledMismatch ? "color: red; font-weight: bold" : "", scheduledTime.toFixed(4), "", scheduledEndTime.toFixed(4), mediaMismatch ? "color: red; font-weight: bold" : "", mediaTime.toFixed(4), "", mediaEndTime.toFixed(4), duration < 0 ? "color: red; font-weight: bold" : timeDiff < 0 ? "color: red; font-weight: bold" : "color: blue; font-weight: bold", duration < 0 ? "missed " + Math.abs(offset).toFixed(2) + "s" : Math.abs(timeDiff).toFixed(2) + (timeDiff < 0 ? " delay" : " ahead"), "", "current=" + currentTime.toFixed(4), "actualcurrent=" + ctxAndGain.audioContext.currentTime.toFixed(4), "offset=" + offset.toFixed(4), "latency=" + latency.toFixed(4), "state=" + ctxAndGain.audioContext.state, originalUnloopedMediaTimestamp !== mediaTime ? "original_ts=" + originalUnloopedMediaTimestamp.toFixed(4) : "", "action=" + (saveForLater ? "schedule" : "start"), "");
4889
5049
  prev.scheduledEndTime = scheduledEndTime;
4890
5050
  prev.mediaEndTime = mediaEndTime;
4891
5051
  return duration > 0 ? {
@@ -4905,6 +5065,13 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
4905
5065
  return Promise.resolve();
4906
5066
  }
4907
5067
  audioContextIsPlayingEventually.current = true;
5068
+ ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
5069
+ ctxAndGain.gainNode.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
5070
+ ctxAndGain.gainNode.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
5071
+ nodesToResume.current.forEach((r, node) => {
5072
+ node.start(r.scheduledTime, r.offset, r.duration);
5073
+ });
5074
+ nodesToResume.current.clear();
4908
5075
  const resumePromise = ctxAndGain.audioContext.resume();
4909
5076
  isResuming.current = new Promise((resolve) => {
4910
5077
  waitUntilActuallyResumed(ctxAndGain.audioContext, logLevel).then(resolve);
@@ -4915,11 +5082,6 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
4915
5082
  }).finally(() => {
4916
5083
  isResuming.current = null;
4917
5084
  });
4918
- ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
4919
- ctxAndGain.gainNode.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
4920
- ctxAndGain.gainNode.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
4921
- nodesToResume.current.forEach((r, node) => node.start(r.scheduledTime, r.offset, r.duration));
4922
- nodesToResume.current.clear();
4923
5085
  return resumePromise.catch(() => {});
4924
5086
  }, [ctxAndGain, logLevel]);
4925
5087
  const getIsResumingAudioContext = useCallback9(() => {
@@ -5721,9 +5883,14 @@ var useBufferManager = (logLevel, mountTime) => {
5721
5883
  }
5722
5884
  };
5723
5885
  }
5886
+ let unblocked = false;
5724
5887
  setBlocks((b) => [...b, block]);
5725
5888
  return {
5726
5889
  unblock: () => {
5890
+ if (unblocked) {
5891
+ return;
5892
+ }
5893
+ unblocked = true;
5727
5894
  setBlocks((b) => {
5728
5895
  const newArr = b.filter((bx) => bx !== block);
5729
5896
  if (newArr.length === b.length) {
@@ -5817,18 +5984,30 @@ var useIsPlayerBuffering = (bufferManager) => {
5817
5984
  };
5818
5985
  var useBufferState = () => {
5819
5986
  const buffer = useContext25(BufferingContextReact);
5987
+ const logLevel = useLogLevel();
5820
5988
  const addBlock = buffer ? buffer.addBlock : null;
5821
5989
  return useMemo25(() => ({
5822
5990
  delayPlayback: () => {
5823
5991
  if (!addBlock) {
5824
5992
  throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
5825
5993
  }
5994
+ Log.trace({ logLevel, tag: "[buffer-state]" }, "Adding buffer handle", new Error().stack);
5826
5995
  const { unblock } = addBlock({
5827
5996
  id: String(Math.random())
5828
5997
  });
5829
- return { unblock };
5998
+ let unblocked = false;
5999
+ return {
6000
+ unblock: () => {
6001
+ if (unblocked) {
6002
+ return;
6003
+ }
6004
+ unblocked = true;
6005
+ Log.trace({ logLevel, tag: "[buffer-state]" }, "Removing buffer handle");
6006
+ unblock();
6007
+ }
6008
+ };
5830
6009
  }
5831
- }), [addBlock]);
6010
+ }), [addBlock, logLevel]);
5832
6011
  };
5833
6012
  var isSafariWebkit = () => {
5834
6013
  const isSafari2 = /^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);
@@ -6596,11 +6775,11 @@ var useMediaTag = ({
6596
6775
  env.isPlayer
6597
6776
  ]);
6598
6777
  };
6599
- var MediaVolumeContext = createContext21({
6778
+ var MediaVolumeContext = createContext22({
6600
6779
  mediaMuted: false,
6601
6780
  mediaVolume: 1
6602
6781
  });
6603
- var SetMediaVolumeContext = createContext21({
6782
+ var SetMediaVolumeContext = createContext22({
6604
6783
  setMediaMuted: () => {
6605
6784
  throw new Error("default");
6606
6785
  },
@@ -7406,10 +7585,13 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
7406
7585
  };
7407
7586
  var defineEffect = (definition) => definition;
7408
7587
  var createDescriptor = (definition, params) => {
7588
+ const widened = definition;
7409
7589
  return {
7410
- definition,
7590
+ definition: widened,
7411
7591
  params,
7412
- stack: new Error().stack
7592
+ stack: new Error().stack,
7593
+ effectKey: widened.calculateKey(params),
7594
+ memoized: false
7413
7595
  };
7414
7596
  };
7415
7597
  var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
@@ -7434,7 +7616,7 @@ var waitForRoot = (fn) => {
7434
7616
  listeners = listeners.filter((l) => l !== fn);
7435
7617
  };
7436
7618
  };
7437
- var MediaEnabledContext = createContext22(null);
7619
+ var MediaEnabledContext = createContext23(null);
7438
7620
  var useVideoEnabled = () => {
7439
7621
  const context = useContext32(MediaEnabledContext);
7440
7622
  if (!context) {
@@ -7473,8 +7655,7 @@ var RemotionRootContexts = ({
7473
7655
  audioLatencyHint,
7474
7656
  videoEnabled,
7475
7657
  audioEnabled,
7476
- frameState,
7477
- visualModeEnabled
7658
+ frameState
7478
7659
  }) => {
7479
7660
  const nonceContext = useMemo32(() => {
7480
7661
  let counter = 0;
@@ -7497,7 +7678,6 @@ var RemotionRootContexts = ({
7497
7678
  children: /* @__PURE__ */ jsx29(EditorPropsProvider, {
7498
7679
  children: /* @__PURE__ */ jsx29(PrefetchProvider, {
7499
7680
  children: /* @__PURE__ */ jsx29(SequenceManagerProvider, {
7500
- visualModeEnabled,
7501
7681
  children: /* @__PURE__ */ jsx29(DurationsContextProvider, {
7502
7682
  children: /* @__PURE__ */ jsx29(BufferingProvider, {
7503
7683
  children: /* @__PURE__ */ jsx29(SharedAudioContextProvider, {
@@ -7716,7 +7896,7 @@ var setupEnvVariables = () => {
7716
7896
  });
7717
7897
  };
7718
7898
  var CurrentScaleContext = React32.createContext(null);
7719
- var PreviewSizeContext = createContext23({
7899
+ var PreviewSizeContext = createContext24({
7720
7900
  setSize: () => {
7721
7901
  return;
7722
7902
  },
@@ -7739,14 +7919,6 @@ var calculateScale = ({
7739
7919
  }
7740
7920
  return Number(previewSize);
7741
7921
  };
7742
- var useSequenceControlOverride = (key) => {
7743
- const seqContext = useContext33(SequenceContext);
7744
- const { dragOverrides: overrides } = useContext33(VisualModeOverridesContext);
7745
- if (!seqContext) {
7746
- return;
7747
- }
7748
- return overrides[seqContext.id]?.[key];
7749
- };
7750
7922
  var getOffthreadVideoSource = ({
7751
7923
  src,
7752
7924
  transparent,
@@ -7778,9 +7950,9 @@ var OffthreadVideoForRendering = ({
7778
7950
  const frame = useCurrentFrame();
7779
7951
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
7780
7952
  const videoConfig = useUnsafeVideoConfig();
7781
- const sequenceContext = useContext34(SequenceContext);
7953
+ const sequenceContext = useContext33(SequenceContext);
7782
7954
  const mediaStartsAt = useMediaStartsAt();
7783
- const { registerRenderAsset, unregisterRenderAsset } = useContext34(RenderAssetManager);
7955
+ const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
7784
7956
  if (!src) {
7785
7957
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
7786
7958
  }
@@ -7992,7 +8164,7 @@ class MediaPlaybackError extends Error {
7992
8164
  }
7993
8165
  }
7994
8166
  var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
7995
- const context = useContext35(SharedAudioContext);
8167
+ const context = useContext34(SharedAudioContext);
7996
8168
  if (!context) {
7997
8169
  throw new Error("SharedAudioContext not found");
7998
8170
  }
@@ -8048,8 +8220,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
8048
8220
  }
8049
8221
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
8050
8222
  const { fps, durationInFrames } = useVideoConfig();
8051
- const parentSequence = useContext35(SequenceContext);
8052
- const { hidden } = useContext35(SequenceVisibilityToggleContext);
8223
+ const parentSequence = useContext34(SequenceContext);
8224
+ const { hidden } = useContext34(SequenceVisibilityToggleContext);
8053
8225
  const logLevel = useLogLevel();
8054
8226
  const mountTime = useMountTime();
8055
8227
  const [timelineId] = useState21(() => String(Math.random()));
@@ -8473,7 +8645,9 @@ var Internals = {
8473
8645
  VideoForPreview,
8474
8646
  CompositionManager,
8475
8647
  CompositionSetters,
8476
- VisualModeOverridesContext,
8648
+ VisualModeCodeValuesContext,
8649
+ VisualModeDragOverridesContext,
8650
+ VisualModeSettersContext,
8477
8651
  SequenceManager,
8478
8652
  SequenceStackTracesUpdateContext,
8479
8653
  SequenceVisibilityToggleContext,
@@ -8482,7 +8656,6 @@ var Internals = {
8482
8656
  sequenceStyleSchema,
8483
8657
  flattenActiveSchema,
8484
8658
  getFlatSchemaWithAllKeys,
8485
- useSequenceControlOverride,
8486
8659
  RemotionRootContexts,
8487
8660
  CompositionManagerProvider,
8488
8661
  useVideo,
@@ -8575,7 +8748,11 @@ var Internals = {
8575
8748
  useMemoizedEffects,
8576
8749
  defineEffect,
8577
8750
  createDescriptor,
8578
- computeEffectiveSchemaValuesDotNotation
8751
+ computeEffectiveSchemaValuesDotNotation,
8752
+ OverrideIdsToNodePathsGettersContext,
8753
+ OverrideIdsToNodePathsSettersContext,
8754
+ findPropsToDelete,
8755
+ flattenEffects
8579
8756
  };
8580
8757
  var NUMBER = "[-+]?\\d*\\.?\\d+";
8581
8758
  var PERCENTAGE = NUMBER + "%";
@@ -8613,7 +8790,7 @@ var flattenChildren = (children) => {
8613
8790
  return flatChildren;
8614
8791
  }, []);
8615
8792
  };
8616
- var IsInsideSeriesContext = createContext24(false);
8793
+ var IsInsideSeriesContext = createContext25(false);
8617
8794
  var IsInsideSeriesContainer = ({ children }) => {
8618
8795
  return /* @__PURE__ */ jsx34(IsInsideSeriesContext.Provider, {
8619
8796
  value: true,
@@ -8655,9 +8832,6 @@ var SeriesInner = (props2) => {
8655
8832
  throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`);
8656
8833
  }
8657
8834
  const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
8658
- if (!castedChild?.props.children) {
8659
- throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
8660
- }
8661
8835
  const durationInFramesProp = castedChild.props.durationInFrames;
8662
8836
  const {
8663
8837
  durationInFrames,
@@ -9173,13 +9347,13 @@ var VideoForRenderingForwardFunction = ({
9173
9347
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
9174
9348
  const videoConfig = useUnsafeVideoConfig();
9175
9349
  const videoRef = useRef23(null);
9176
- const sequenceContext = useContext36(SequenceContext);
9350
+ const sequenceContext = useContext35(SequenceContext);
9177
9351
  const mediaStartsAt = useMediaStartsAt();
9178
9352
  const environment = useRemotionEnvironment();
9179
9353
  const logLevel = useLogLevel();
9180
9354
  const mountTime = useMountTime();
9181
9355
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
9182
- const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
9356
+ const { registerRenderAsset, unregisterRenderAsset } = useContext35(RenderAssetManager);
9183
9357
  const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
9184
9358
  props2.src,
9185
9359
  sequenceContext?.cumulatedFrom,
@@ -9389,7 +9563,7 @@ var VideoForwardingFunction = (props2, ref) => {
9389
9563
  if (environment.isClientSideRendering) {
9390
9564
  throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
9391
9565
  }
9392
- const { durations, setDurations } = useContext37(DurationsContext);
9566
+ const { durations, setDurations } = useContext36(DurationsContext);
9393
9567
  if (typeof ref === "string") {
9394
9568
  throw new Error("string refs are not supported");
9395
9569
  }
@@ -24392,7 +24566,7 @@ var InstallsPerMonth = () => {
24392
24566
  },
24393
24567
  children: [
24394
24568
  /* @__PURE__ */ jsx50(StatItemContent, {
24395
- content: "1.4M",
24569
+ content: "3M",
24396
24570
  width: "100px",
24397
24571
  fontSize: "2.5rem",
24398
24572
  fontWeight: "bold"
@@ -24414,7 +24588,7 @@ var InstallsPerMonth = () => {
24414
24588
  ]
24415
24589
  }),
24416
24590
  /* @__PURE__ */ jsx50(StatItemContent, {
24417
- content: "installs per month",
24591
+ content: "installs",
24418
24592
  width: "75%",
24419
24593
  fontSize: "1.0rem",
24420
24594
  fontWeight: "bold"
@@ -24500,7 +24674,7 @@ var GitHubStars = () => {
24500
24674
  width: "45px"
24501
24675
  }),
24502
24676
  /* @__PURE__ */ jsx50(StatItemContent, {
24503
- content: "45k",
24677
+ content: "46k",
24504
24678
  width: "80px",
24505
24679
  fontSize: "2.5rem",
24506
24680
  fontWeight: "bold"
@@ -24693,59 +24867,58 @@ import { jsx as jsx56, jsxs as jsxs13 } from "react/jsx-runtime";
24693
24867
  import { jsx as jsx214, jsxs as jsxs24, Fragment as Fragment11 } from "react/jsx-runtime";
24694
24868
  import React56 from "react";
24695
24869
  import { useContext as useContext210, useEffect as useEffect42, useState as useState40 } from "react";
24696
- import { useContext as useContext44, useLayoutEffect as useLayoutEffect17 } from "react";
24870
+ import { useContext as useContext43, useLayoutEffect as useLayoutEffect17 } from "react";
24697
24871
  import { jsx as jsx313 } from "react/jsx-runtime";
24698
- import { useCallback as useCallback34, useRef as useRef42 } from "react";
24699
24872
  import { useEffect as useEffect24, useState as useState24 } from "react";
24700
24873
  import { useLayoutEffect as useLayoutEffect23 } from "react";
24701
- import { useContext as useContext45, useEffect as useEffect52, useRef as useRef52 } from "react";
24702
- import { useEffect as useEffect310, useRef as useRef310 } from "react";
24703
- import { useCallback as useCallback24, useContext as useContext39, useMemo as useMemo51, useRef as useRef26, useState as useState310 } from "react";
24704
- import { useEffect as useEffect43, useRef as useRef43 } from "react";
24705
- import { useCallback as useCallback35, useEffect as useEffect62, useMemo as useMemo212, useState as useState42 } from "react";
24874
+ import { useContext as useContext44, useEffect as useEffect52, useRef as useRef42 } from "react";
24875
+ import { useEffect as useEffect310, useRef as useRef26 } from "react";
24876
+ import { useCallback as useCallback34, useContext as useContext38, useMemo as useMemo51, useRef as useRef43, useState as useState310 } from "react";
24877
+ import { useEffect as useEffect43, useRef as useRef310 } from "react";
24878
+ import { useCallback as useCallback24, useEffect as useEffect62, useMemo as useMemo212, useState as useState42 } from "react";
24706
24879
  import {
24707
24880
  forwardRef as forwardRef210,
24708
24881
  useEffect as useEffect132,
24709
24882
  useImperativeHandle as useImperativeHandle22,
24710
24883
  useLayoutEffect as useLayoutEffect33,
24711
24884
  useMemo as useMemo142,
24712
- useRef as useRef122,
24885
+ useRef as useRef112,
24713
24886
  useState as useState132
24714
24887
  } from "react";
24715
24888
  import React102, {
24716
24889
  Suspense as Suspense2,
24717
24890
  forwardRef as forwardRef33,
24718
- useCallback as useCallback112,
24891
+ useCallback as useCallback102,
24719
24892
  useContext as useContext52,
24720
24893
  useEffect as useEffect122,
24721
24894
  useImperativeHandle as useImperativeHandle10,
24722
24895
  useMemo as useMemo122,
24723
- useRef as useRef112,
24896
+ useRef as useRef102,
24724
24897
  useState as useState113
24725
24898
  } from "react";
24726
24899
  import React310 from "react";
24727
24900
  import { jsx as jsx410 } from "react/jsx-runtime";
24728
24901
  import React410, { useEffect as useEffect72 } from "react";
24729
24902
  import { jsx as jsx55 } from "react/jsx-runtime";
24730
- import { useCallback as useCallback82, useEffect as useEffect112, useMemo as useMemo92, useRef as useRef92, useState as useState102 } from "react";
24903
+ import { useCallback as useCallback72, useEffect as useEffect112, useMemo as useMemo92, useRef as useRef82, useState as useState102 } from "react";
24731
24904
  import { jsx as jsx64 } from "react/jsx-runtime";
24732
- import { useCallback as useCallback52, useMemo as useMemo410, useRef as useRef62, useState as useState62 } from "react";
24733
- import React54, { useCallback as useCallback42, useMemo as useMemo39, useState as useState52 } from "react";
24905
+ import { useCallback as useCallback42, useMemo as useMemo410, useRef as useRef52, useState as useState62 } from "react";
24906
+ import React54, { useCallback as useCallback35, useMemo as useMemo39, useState as useState52 } from "react";
24734
24907
  import { jsx as jsx74, jsxs as jsxs33 } from "react/jsx-runtime";
24735
24908
  import { jsx as jsx84, jsxs as jsxs43 } from "react/jsx-runtime";
24736
- import { useCallback as useCallback62, useEffect as useEffect92, useMemo as useMemo52, useState as useState82 } from "react";
24737
- import { useEffect as useEffect83, useRef as useRef72, useState as useState72 } from "react";
24909
+ import { useCallback as useCallback52, useEffect as useEffect92, useMemo as useMemo52, useState as useState82 } from "react";
24910
+ import { useEffect as useEffect83, useRef as useRef62, useState as useState72 } from "react";
24738
24911
  import { jsx as jsx94, jsxs as jsxs53 } from "react/jsx-runtime";
24739
- import { useCallback as useCallback72, useEffect as useEffect102, useMemo as useMemo62, useRef as useRef82, useState as useState92 } from "react";
24912
+ import { useCallback as useCallback62, useEffect as useEffect102, useMemo as useMemo62, useRef as useRef72, useState as useState92 } from "react";
24740
24913
  import { jsx as jsx104, jsxs as jsxs62 } from "react/jsx-runtime";
24741
24914
  import { useMemo as useMemo72 } from "react";
24742
24915
  import { jsxs as jsxs72 } from "react/jsx-runtime";
24743
24916
  import { useMemo as useMemo82 } from "react";
24744
24917
  import { jsx as jsx113, jsxs as jsxs82, Fragment as Fragment23 } from "react/jsx-runtime";
24745
- import { useCallback as useCallback102, useMemo as useMemo112 } from "react";
24746
- import { useCallback as useCallback92, useMemo as useMemo102, useRef as useRef102 } from "react";
24918
+ import { useCallback as useCallback92, useMemo as useMemo112 } from "react";
24919
+ import { useCallback as useCallback82, useMemo as useMemo102, useRef as useRef92 } from "react";
24747
24920
  import { jsx as jsx123, jsxs as jsxs92, Fragment as Fragment32 } from "react/jsx-runtime";
24748
- import { useCallback as useCallback122, useMemo as useMemo132, useState as useState122 } from "react";
24921
+ import { useCallback as useCallback112, useMemo as useMemo132, useState as useState122 } from "react";
24749
24922
  import { jsx as jsx133 } from "react/jsx-runtime";
24750
24923
 
24751
24924
  // ../core/dist/esm/no-react.mjs
@@ -24862,6 +25035,36 @@ var DELAY_RENDER_CALLSTACK_TOKEN2 = "The delayRender was called:";
24862
25035
  var DELAY_RENDER_RETRIES_LEFT2 = "Retries left: ";
24863
25036
  var DELAY_RENDER_RETRY_TOKEN2 = "- Rendering the frame will be retried.";
24864
25037
  var DELAY_RENDER_CLEAR_TOKEN2 = "handle was cleared after";
25038
+ var findPropsToDelete2 = ({
25039
+ schema,
25040
+ key,
25041
+ value
25042
+ }) => {
25043
+ const fieldSchema = schema[key];
25044
+ if (!fieldSchema) {
25045
+ throw new Error("Key " + JSON.stringify(key) + " not found in schema");
25046
+ }
25047
+ if (typeof value !== "string") {
25048
+ throw new Error("Value must be a string, but is " + JSON.stringify(value));
25049
+ }
25050
+ if (fieldSchema.type !== "enum") {
25051
+ throw new Error("Key " + JSON.stringify(key) + " is not an enum");
25052
+ }
25053
+ const currentVariant = fieldSchema.variants[value];
25054
+ if (!currentVariant) {
25055
+ throw new Error("Value for " + JSON.stringify(key) + " must be one of " + Object.keys(fieldSchema.variants).map((v) => JSON.stringify(v)).join(", ") + ", got " + JSON.stringify(value));
25056
+ }
25057
+ const otherVariants = Object.keys(fieldSchema.variants).filter((v) => v !== value);
25058
+ const otherKeys = new Set;
25059
+ for (const variant of otherVariants) {
25060
+ const otherVariant = fieldSchema.variants[variant];
25061
+ const keys = Object.keys(otherVariant);
25062
+ for (const k of keys) {
25063
+ otherKeys.add(k);
25064
+ }
25065
+ }
25066
+ return [...otherKeys];
25067
+ };
24865
25068
  var DATE_TOKEN2 = "remotion-date:";
24866
25069
  var FILE_TOKEN2 = "remotion-file:";
24867
25070
  var serializeJSONWithSpecialTypes2 = ({
@@ -25529,7 +25732,8 @@ var NoReactInternals = {
25529
25732
  DATE_TOKEN: DATE_TOKEN2,
25530
25733
  FILE_TOKEN: FILE_TOKEN2,
25531
25734
  validateCodec: validateCodec2,
25532
- proResProfileOptions
25735
+ proResProfileOptions,
25736
+ findPropsToDelete: findPropsToDelete2
25533
25737
  };
25534
25738
 
25535
25739
  // ../player/dist/esm/index.mjs
@@ -25539,16 +25743,16 @@ import {
25539
25743
  useImperativeHandle as useImperativeHandle42,
25540
25744
  useLayoutEffect as useLayoutEffect42,
25541
25745
  useMemo as useMemo172,
25542
- useRef as useRef142,
25746
+ useRef as useRef132,
25543
25747
  useState as useState142
25544
25748
  } from "react";
25545
25749
  import React133, {
25546
25750
  forwardRef as forwardRef34,
25547
25751
  Suspense as Suspense22,
25548
- useCallback as useCallback132,
25752
+ useCallback as useCallback122,
25549
25753
  useImperativeHandle as useImperativeHandle32,
25550
25754
  useMemo as useMemo162,
25551
- useRef as useRef132
25755
+ useRef as useRef122
25552
25756
  } from "react";
25553
25757
  import { useContext as useContext62, useMemo as useMemo152 } from "react";
25554
25758
  import { jsx as jsx153 } from "react/jsx-runtime";
@@ -25986,7 +26190,7 @@ class ThumbnailEmitter {
25986
26190
  };
25987
26191
  }
25988
26192
  var useBufferStateEmitter = (emitter) => {
25989
- const bufferManager = useContext44(Internals.BufferingContextReact);
26193
+ const bufferManager = useContext43(Internals.BufferingContextReact);
25990
26194
  if (!bufferManager) {
25991
26195
  throw new Error("BufferingContextReact not found");
25992
26196
  }
@@ -26066,36 +26270,36 @@ var usePlayer = () => {
26066
26270
  const [playing, setPlaying, imperativePlaying] = Internals.Timeline.usePlayingState();
26067
26271
  const [hasPlayed, setHasPlayed] = useState310(false);
26068
26272
  const frame = Internals.Timeline.useTimelinePosition();
26069
- const playStart = useRef26(frame);
26273
+ const playStart = useRef43(frame);
26070
26274
  const setFrame = Internals.Timeline.useTimelineSetFrame();
26071
26275
  const setTimelinePosition = Internals.Timeline.useTimelineSetFrame();
26072
- const audioContext = useContext39(Internals.SharedAudioContext);
26073
- const audioTagsContext = useContext39(Internals.SharedAudioTagsContext);
26276
+ const audioContext = useContext38(Internals.SharedAudioContext);
26277
+ const audioTagsContext = useContext38(Internals.SharedAudioTagsContext);
26074
26278
  const { audioAndVideoTags } = Internals.useTimelineContext();
26075
- const frameRef = useRef26(frame);
26279
+ const frameRef = useRef43(frame);
26076
26280
  frameRef.current = frame;
26077
26281
  const video = Internals.useVideo();
26078
26282
  const config = Internals.useUnsafeVideoConfig();
26079
- const emitter = useContext39(PlayerEventEmitterContext);
26283
+ const emitter = useContext38(PlayerEventEmitterContext);
26080
26284
  const lastFrame = (config?.durationInFrames ?? 1) - 1;
26081
26285
  const isLastFrame = frame === lastFrame;
26082
26286
  const isFirstFrame = frame === 0;
26083
26287
  if (!emitter) {
26084
26288
  throw new TypeError("Expected Player event emitter context");
26085
26289
  }
26086
- const bufferingContext = useContext39(Internals.BufferingContextReact);
26290
+ const bufferingContext = useContext38(Internals.BufferingContextReact);
26087
26291
  if (!bufferingContext) {
26088
26292
  throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
26089
26293
  }
26090
26294
  const { buffering } = bufferingContext;
26091
- const seek2 = useCallback24((newFrame) => {
26295
+ const seek2 = useCallback34((newFrame) => {
26092
26296
  if (video?.id) {
26093
26297
  setTimelinePosition((c) => ({ ...c, [video.id]: newFrame }));
26094
26298
  }
26095
26299
  frameRef.current = newFrame;
26096
26300
  emitter.dispatchSeek(newFrame);
26097
26301
  }, [emitter, setTimelinePosition, video?.id]);
26098
- const play = useCallback24((e) => {
26302
+ const play = useCallback34((e) => {
26099
26303
  if (imperativePlaying.current) {
26100
26304
  return;
26101
26305
  }
@@ -26122,7 +26326,7 @@ var usePlayer = () => {
26122
26326
  seek2,
26123
26327
  audioAndVideoTags
26124
26328
  ]);
26125
- const pause = useCallback24(() => {
26329
+ const pause = useCallback34(() => {
26126
26330
  if (imperativePlaying.current) {
26127
26331
  imperativePlaying.current = false;
26128
26332
  setPlaying(false);
@@ -26130,7 +26334,7 @@ var usePlayer = () => {
26130
26334
  audioContext?.suspend();
26131
26335
  }
26132
26336
  }, [emitter, imperativePlaying, setPlaying, audioContext]);
26133
- const pauseAndReturnToPlayStart = useCallback24(() => {
26337
+ const pauseAndReturnToPlayStart = useCallback34(() => {
26134
26338
  if (imperativePlaying.current) {
26135
26339
  imperativePlaying.current = false;
26136
26340
  frameRef.current = playStart.current;
@@ -26145,7 +26349,7 @@ var usePlayer = () => {
26145
26349
  }
26146
26350
  }, [config, emitter, imperativePlaying, setPlaying, setTimelinePosition]);
26147
26351
  const videoId = video?.id;
26148
- const frameBack = useCallback24((frames) => {
26352
+ const frameBack = useCallback34((frames) => {
26149
26353
  if (!videoId) {
26150
26354
  return null;
26151
26355
  }
@@ -26164,7 +26368,7 @@ var usePlayer = () => {
26164
26368
  };
26165
26369
  });
26166
26370
  }, [imperativePlaying, setFrame, videoId]);
26167
- const frameForward = useCallback24((frames) => {
26371
+ const frameForward = useCallback34((frames) => {
26168
26372
  if (!videoId) {
26169
26373
  return null;
26170
26374
  }
@@ -26183,20 +26387,20 @@ var usePlayer = () => {
26183
26387
  };
26184
26388
  });
26185
26389
  }, [videoId, imperativePlaying, lastFrame, setFrame]);
26186
- const toggle = useCallback24((e) => {
26390
+ const toggle = useCallback34((e) => {
26187
26391
  if (imperativePlaying.current) {
26188
26392
  pause();
26189
26393
  } else {
26190
26394
  play(e);
26191
26395
  }
26192
26396
  }, [imperativePlaying, pause, play]);
26193
- const isPlaying = useCallback24(() => {
26397
+ const isPlaying = useCallback34(() => {
26194
26398
  return imperativePlaying.current;
26195
26399
  }, [imperativePlaying]);
26196
- const getCurrentFrame = useCallback24(() => {
26400
+ const getCurrentFrame = useCallback34(() => {
26197
26401
  return frameRef.current;
26198
26402
  }, [frameRef]);
26199
- const isBuffering = useCallback24(() => {
26403
+ const isBuffering = useCallback34(() => {
26200
26404
  return buffering.current;
26201
26405
  }, [buffering]);
26202
26406
  const returnValue = useMemo51(() => {
@@ -26242,7 +26446,7 @@ var useBrowserMediaSession = ({
26242
26446
  playbackRate
26243
26447
  }) => {
26244
26448
  const { playing, pause, play, emitter, getCurrentFrame, seek: seek2 } = usePlayer();
26245
- const hasEverPlayed = useRef310(false);
26449
+ const hasEverPlayed = useRef26(false);
26246
26450
  useEffect310(() => {
26247
26451
  if (playing) {
26248
26452
  hasEverPlayed.current = true;
@@ -26384,7 +26588,7 @@ var getIsBackgrounded = () => {
26384
26588
  return document.visibilityState === "hidden";
26385
26589
  };
26386
26590
  var useIsBackgrounded = () => {
26387
- const isBackgrounded = useRef43(getIsBackgrounded());
26591
+ const isBackgrounded = useRef310(getIsBackgrounded());
26388
26592
  useEffect43(() => {
26389
26593
  const onVisibilityChange = () => {
26390
26594
  isBackgrounded.current = getIsBackgrounded();
@@ -26402,17 +26606,18 @@ var setGlobalTimeAnchor = ({
26402
26606
  audioSyncAnchor,
26403
26607
  absoluteTimeInSeconds,
26404
26608
  globalPlaybackRate,
26405
- logLevel
26609
+ logLevel,
26610
+ force
26406
26611
  }) => {
26407
26612
  const newAnchor = audioContext.currentTime - absoluteTimeInSeconds / globalPlaybackRate;
26408
26613
  const shift4 = (newAnchor - audioSyncAnchor.value) * globalPlaybackRate;
26409
26614
  const { outputLatency } = audioContext;
26410
26615
  const safeOutputLatency = outputLatency === 0 ? 0.3 : outputLatency;
26411
26616
  const latency = audioContext.baseLatency + safeOutputLatency;
26412
- if (Math.abs(shift4) < ALLOWED_GLOBAL_TIME_ANCHOR_SHIFT + latency) {
26617
+ if (Math.abs(shift4) < ALLOWED_GLOBAL_TIME_ANCHOR_SHIFT + latency && !force) {
26413
26618
  return false;
26414
26619
  }
26415
- Internals.Log.verbose({ logLevel, tag: "audio-scheduling" }, "Anchor changed from %s to %s with shift %s", audioSyncAnchor.value, newAnchor, shift4);
26620
+ Internals.Log.verbose({ logLevel, tag: "audio-scheduling" }, "Anchor " + (force ? "forcibly " : "") + "changed from %s to %s with shift %s", audioSyncAnchor.value, newAnchor, shift4);
26416
26621
  audioSyncAnchor.value = newAnchor;
26417
26622
  return true;
26418
26623
  };
@@ -26430,11 +26635,11 @@ var usePlayback = ({
26430
26635
  const frame = Internals.Timeline.useTimelinePosition();
26431
26636
  const { playing, pause, emitter, isPlaying } = usePlayer();
26432
26637
  const setFrame = Internals.Timeline.useTimelineSetFrame();
26433
- const sharedAudioContext = useContext45(Internals.SharedAudioContext);
26638
+ const sharedAudioContext = useContext44(Internals.SharedAudioContext);
26434
26639
  const logLevel = Internals.useLogLevel();
26435
26640
  const isBackgroundedRef = useIsBackgrounded();
26436
- const lastTimeUpdateTimestamp = useRef52(0);
26437
- const context = useContext45(Internals.BufferingContextReact);
26641
+ const lastTimeUpdateTimestamp = useRef42(0);
26642
+ const context = useContext44(Internals.BufferingContextReact);
26438
26643
  if (!context) {
26439
26644
  throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
26440
26645
  }
@@ -26453,17 +26658,56 @@ var usePlayback = ({
26453
26658
  if (!config) {
26454
26659
  return;
26455
26660
  }
26661
+ if (muted) {
26662
+ return;
26663
+ }
26456
26664
  const changed = setGlobalTimeAnchor({
26457
26665
  audioContext: sharedAudioContext.audioContext,
26458
26666
  audioSyncAnchor: sharedAudioContext.audioSyncAnchor,
26459
26667
  absoluteTimeInSeconds: frame / config.fps,
26460
26668
  globalPlaybackRate: playbackRate,
26461
- logLevel
26669
+ logLevel,
26670
+ force: false
26462
26671
  });
26463
26672
  if (changed) {
26464
26673
  sharedAudioContext.audioSyncAnchorEmitter.dispatch("changed");
26465
26674
  }
26466
- }, [config, frame, logLevel, playbackRate, sharedAudioContext]);
26675
+ }, [config, frame, logLevel, playbackRate, sharedAudioContext, muted]);
26676
+ useLayoutEffect23(() => {
26677
+ const audioContext = sharedAudioContext?.audioContext;
26678
+ if (!audioContext) {
26679
+ return;
26680
+ }
26681
+ if (!config) {
26682
+ return;
26683
+ }
26684
+ if (muted) {
26685
+ return;
26686
+ }
26687
+ const callback = () => {
26688
+ if (audioContext.state !== "running") {
26689
+ setGlobalTimeAnchor({
26690
+ audioContext,
26691
+ audioSyncAnchor: sharedAudioContext.audioSyncAnchor,
26692
+ absoluteTimeInSeconds: getCurrentFrame() / config.fps,
26693
+ globalPlaybackRate: playbackRate,
26694
+ logLevel,
26695
+ force: true
26696
+ });
26697
+ }
26698
+ };
26699
+ audioContext?.addEventListener("statechange", callback);
26700
+ return () => {
26701
+ audioContext?.removeEventListener("statechange", callback);
26702
+ };
26703
+ }, [
26704
+ config,
26705
+ getCurrentFrame,
26706
+ logLevel,
26707
+ muted,
26708
+ playbackRate,
26709
+ sharedAudioContext
26710
+ ]);
26467
26711
  useEffect52(() => {
26468
26712
  if (!config) {
26469
26713
  return;
@@ -26497,7 +26741,7 @@ var usePlayback = ({
26497
26741
  sharedAudioContext?.suspend?.();
26498
26742
  return;
26499
26743
  }
26500
- if (!muted) {
26744
+ if (!muted && !context.buffering.current) {
26501
26745
  sharedAudioContext?.resume?.();
26502
26746
  }
26503
26747
  const time = performance.now() - startedTime;
@@ -26515,7 +26759,7 @@ var usePlayback = ({
26515
26759
  shouldLoop: loop
26516
26760
  });
26517
26761
  framesAdvanced += framesToAdvance;
26518
- if (nextFrame !== getCurrentFrame() && (!hasEnded || moveToBeginningWhenEnded)) {
26762
+ if (nextFrame !== getCurrentFrame() && (!hasEnded || moveToBeginningWhenEnded) && !context.buffering.current) {
26519
26763
  setFrame((c) => ({ ...c, [config.id]: nextFrame }));
26520
26764
  }
26521
26765
  if (hasEnded) {
@@ -26530,27 +26774,16 @@ var usePlayback = ({
26530
26774
  const getIsResumingAudioContext = sharedAudioContext?.getIsResumingAudioContext?.() ?? null;
26531
26775
  if (getIsResumingAudioContext !== null && !muted) {
26532
26776
  getIsResumingAudioContext.then(() => {
26533
- if (!sharedAudioContext?.audioContext) {
26534
- return;
26535
- }
26536
- if (!sharedAudioContext.audioSyncAnchor) {
26537
- return;
26538
- }
26539
- setGlobalTimeAnchor({
26540
- audioContext: sharedAudioContext.audioContext,
26541
- audioSyncAnchor: sharedAudioContext.audioSyncAnchor,
26542
- absoluteTimeInSeconds: getCurrentFrame() / config.fps,
26543
- globalPlaybackRate: playbackRate,
26544
- logLevel
26545
- });
26546
26777
  startedTime = performance.now();
26547
26778
  framesAdvanced = 0;
26548
26779
  queueNextFrame();
26549
26780
  });
26550
26781
  return;
26551
26782
  }
26552
- if (context.buffering.current && !muted) {
26553
- sharedAudioContext?.suspend?.();
26783
+ if (context.buffering.current) {
26784
+ if (!muted) {
26785
+ sharedAudioContext?.suspend?.();
26786
+ }
26554
26787
  const stopListening = context.listenForResume(() => {
26555
26788
  stopListening.remove();
26556
26789
  startedTime = performance.now();
@@ -26672,7 +26905,7 @@ var useElementSize = (ref, options2) => {
26672
26905
  });
26673
26906
  });
26674
26907
  }, [options2.shouldApplyCssTransforms]);
26675
- const updateSize = useCallback35(() => {
26908
+ const updateSize = useCallback24(() => {
26676
26909
  if (!ref.current) {
26677
26910
  return;
26678
26911
  }
@@ -26893,7 +27126,7 @@ var DefaultVolumeSlider = ({
26893
27126
  }, [isVertical]);
26894
27127
  const randomId = typeof React54.useId === "undefined" ? "volume-slider" : React54.useId();
26895
27128
  const [randomClass] = useState52(() => `__remotion-volume-slider-${random(randomId)}`.replace(".", ""));
26896
- const onVolumeChange = useCallback42((e) => {
27129
+ const onVolumeChange = useCallback35((e) => {
26897
27130
  setVolume(parseFloat(e.target.value));
26898
27131
  }, [setVolume]);
26899
27132
  const inputStyle = useMemo39(() => {
@@ -26970,10 +27203,10 @@ var MediaVolumeSlider = ({ displayVerticalVolumeSlider, renderMuteButton, render
26970
27203
  const [mediaMuted, setMediaMuted] = Internals.useMediaMutedState();
26971
27204
  const [mediaVolume, setMediaVolume] = Internals.useMediaVolumeState();
26972
27205
  const [focused, setFocused] = useState62(false);
26973
- const parentDivRef = useRef62(null);
26974
- const inputRef = useRef62(null);
27206
+ const parentDivRef = useRef52(null);
27207
+ const inputRef = useRef52(null);
26975
27208
  const hover = useHoverState(parentDivRef, false);
26976
- const onBlur = useCallback52(() => {
27209
+ const onBlur = useCallback42(() => {
26977
27210
  setTimeout(() => {
26978
27211
  if (inputRef.current && document.activeElement !== inputRef.current) {
26979
27212
  setFocused(false);
@@ -26981,7 +27214,7 @@ var MediaVolumeSlider = ({ displayVerticalVolumeSlider, renderMuteButton, render
26981
27214
  }, 10);
26982
27215
  }, []);
26983
27216
  const isVolume0 = mediaVolume === 0;
26984
- const onClick = useCallback52(() => {
27217
+ const onClick = useCallback42(() => {
26985
27218
  if (isVolume0) {
26986
27219
  setMediaVolume(1);
26987
27220
  setMediaMuted(false);
@@ -27012,7 +27245,7 @@ var MediaVolumeSlider = ({ displayVerticalVolumeSlider, renderMuteButton, render
27012
27245
  padding: 0
27013
27246
  };
27014
27247
  }, []);
27015
- const renderDefaultMuteButton = useCallback52(({ muted, volume }) => {
27248
+ const renderDefaultMuteButton = useCallback42(({ muted, volume }) => {
27016
27249
  const isMutedOrZero = muted || volume === 0;
27017
27250
  return /* @__PURE__ */ jsx84("button", {
27018
27251
  "aria-label": isMutedOrZero ? "Unmute sound" : "Mute sound",
@@ -27056,7 +27289,7 @@ var MediaVolumeSlider = ({ displayVerticalVolumeSlider, renderMuteButton, render
27056
27289
  };
27057
27290
  function useComponentVisible(initialIsVisible) {
27058
27291
  const [isComponentVisible, setIsComponentVisible] = useState72(initialIsVisible);
27059
- const ref = useRef72(null);
27292
+ const ref = useRef62(null);
27060
27293
  useEffect83(() => {
27061
27294
  const handleClickOutside = (event) => {
27062
27295
  if (ref.current && !ref.current.contains(event.target)) {
@@ -27103,16 +27336,16 @@ var formatPlaybackRate = (rate) => {
27103
27336
  return str.includes(".") ? str : str + ".0";
27104
27337
  };
27105
27338
  var PlaybackrateOption = ({ rate, onSelect, selectedRate, keyboardSelectedRate }) => {
27106
- const onClick = useCallback62((e) => {
27339
+ const onClick = useCallback52((e) => {
27107
27340
  e.stopPropagation();
27108
27341
  e.preventDefault();
27109
27342
  onSelect(rate);
27110
27343
  }, [onSelect, rate]);
27111
27344
  const [hovered, setHovered] = useState82(false);
27112
- const onMouseEnter = useCallback62(() => {
27345
+ const onMouseEnter = useCallback52(() => {
27113
27346
  setHovered(true);
27114
27347
  }, []);
27115
- const onMouseLeave = useCallback62(() => {
27348
+ const onMouseLeave = useCallback52(() => {
27116
27349
  setHovered(false);
27117
27350
  }, []);
27118
27351
  const isFocused = keyboardSelectedRate === rate;
@@ -27179,7 +27412,7 @@ var PlaybackPopup = ({ setIsComponentVisible, playbackRates, canvasSize }) => {
27179
27412
  setPlaybackRate,
27180
27413
  setIsComponentVisible
27181
27414
  ]);
27182
- const onSelect = useCallback62((rate) => {
27415
+ const onSelect = useCallback52((rate) => {
27183
27416
  setPlaybackRate(rate);
27184
27417
  setIsComponentVisible(false);
27185
27418
  }, [setIsComponentVisible, setPlaybackRate]);
@@ -27242,7 +27475,7 @@ var button = {
27242
27475
  var PlaybackrateControl = ({ playbackRates, canvasSize }) => {
27243
27476
  const { ref, isComponentVisible, setIsComponentVisible } = useComponentVisible(false);
27244
27477
  const { playbackRate } = Internals.usePlaybackRate();
27245
- const onClick = useCallback62((e) => {
27478
+ const onClick = useCallback52((e) => {
27246
27479
  e.stopPropagation();
27247
27480
  e.preventDefault();
27248
27481
  setIsComponentVisible((prevIsComponentVisible) => !prevIsComponentVisible);
@@ -27306,7 +27539,7 @@ var findBodyInWhichDivIsLocated = (div) => {
27306
27539
  return current;
27307
27540
  };
27308
27541
  var PlayerSeekBar = ({ durationInFrames, onSeekEnd, onSeekStart, inFrame, outFrame }) => {
27309
- const containerRef = useRef82(null);
27542
+ const containerRef = useRef72(null);
27310
27543
  const barHovered = useHoverState(containerRef, false);
27311
27544
  const size4 = useElementSize(containerRef, {
27312
27545
  triggerOnWindowResize: true,
@@ -27318,7 +27551,7 @@ var PlayerSeekBar = ({ durationInFrames, onSeekEnd, onSeekStart, inFrame, outFra
27318
27551
  dragging: false
27319
27552
  });
27320
27553
  const width = size4?.width ?? 0;
27321
- const onPointerDown = useCallback72((e) => {
27554
+ const onPointerDown = useCallback62((e) => {
27322
27555
  if (e.button !== 0) {
27323
27556
  return;
27324
27557
  }
@@ -27332,7 +27565,7 @@ var PlayerSeekBar = ({ durationInFrames, onSeekEnd, onSeekStart, inFrame, outFra
27332
27565
  });
27333
27566
  onSeekStart();
27334
27567
  }, [durationInFrames, width, pause, seek2, playing, onSeekStart]);
27335
- const onPointerMove = useCallback72((e) => {
27568
+ const onPointerMove = useCallback62((e) => {
27336
27569
  if (!size4) {
27337
27570
  throw new Error("Player has no size");
27338
27571
  }
@@ -27343,7 +27576,7 @@ var PlayerSeekBar = ({ durationInFrames, onSeekEnd, onSeekStart, inFrame, outFra
27343
27576
  const _frame = getFrameFromX(e.clientX - posLeft, durationInFrames, size4.width);
27344
27577
  seek2(_frame);
27345
27578
  }, [dragging.dragging, durationInFrames, seek2, size4]);
27346
- const onPointerUp = useCallback72(() => {
27579
+ const onPointerUp = useCallback62(() => {
27347
27580
  setDragging({
27348
27581
  dragging: false
27349
27582
  });
@@ -27583,7 +27816,7 @@ var Controls = ({
27583
27816
  toggle,
27584
27817
  renderCustomControls
27585
27818
  }) => {
27586
- const playButtonRef = useRef92(null);
27819
+ const playButtonRef = useRef82(null);
27587
27820
  const [supportsFullscreen, setSupportsFullscreen] = useState102(false);
27588
27821
  const hovered = useHoverState(containerRef, hideControlsWhenPointerDoesntMove);
27589
27822
  const { maxTimeLabelWidth, displayVerticalVolumeSlider } = useVideoControlsResize({
@@ -27658,14 +27891,14 @@ var Controls = ({
27658
27891
  return null;
27659
27892
  }, [showPlaybackRateControl]);
27660
27893
  const customControlsElement = renderCustomControls ? renderCustomControls() : null;
27661
- const ref = useRef92(null);
27662
- const flexRef = useRef92(null);
27663
- const onPointerDownIfContainer = useCallback82((e) => {
27894
+ const ref = useRef82(null);
27895
+ const flexRef = useRef82(null);
27896
+ const onPointerDownIfContainer = useCallback72((e) => {
27664
27897
  if (e.target === ref.current || e.target === flexRef.current) {
27665
27898
  onPointerDown?.(e);
27666
27899
  }
27667
27900
  }, [onPointerDown]);
27668
- const onDoubleClickIfContainer = useCallback82((e) => {
27901
+ const onDoubleClickIfContainer = useCallback72((e) => {
27669
27902
  if (e.target === ref.current || e.target === flexRef.current) {
27670
27903
  onDoubleClick?.(e);
27671
27904
  }
@@ -27791,14 +28024,14 @@ var cancellablePromise = (promise) => {
27791
28024
  };
27792
28025
  var delay = (n) => new Promise((resolve) => setTimeout(resolve, n));
27793
28026
  var useCancellablePromises = () => {
27794
- const pendingPromises = useRef102([]);
27795
- const appendPendingPromise = useCallback92((promise) => {
28027
+ const pendingPromises = useRef92([]);
28028
+ const appendPendingPromise = useCallback82((promise) => {
27796
28029
  pendingPromises.current = [...pendingPromises.current, promise];
27797
28030
  }, []);
27798
- const removePendingPromise = useCallback92((promise) => {
28031
+ const removePendingPromise = useCallback82((promise) => {
27799
28032
  pendingPromises.current = pendingPromises.current.filter((p) => p !== promise);
27800
28033
  }, []);
27801
- const clearPendingPromises = useCallback92(() => pendingPromises.current.map((p) => p.cancel()), []);
28034
+ const clearPendingPromises = useCallback82(() => pendingPromises.current.map((p) => p.cancel()), []);
27802
28035
  const api = useMemo102(() => ({
27803
28036
  appendPendingPromise,
27804
28037
  removePendingPromise,
@@ -27808,7 +28041,7 @@ var useCancellablePromises = () => {
27808
28041
  };
27809
28042
  var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFullscreen) => {
27810
28043
  const api = useCancellablePromises();
27811
- const handleClick = useCallback102(async (e) => {
28044
+ const handleClick = useCallback92(async (e) => {
27812
28045
  if (e instanceof PointerEvent ? e.pointerType === "touch" : e.nativeEvent.pointerType === "touch") {
27813
28046
  onClick(e);
27814
28047
  return;
@@ -27828,14 +28061,14 @@ var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFull
27828
28061
  }
27829
28062
  }
27830
28063
  }, [api, onClick]);
27831
- const handlePointerDown = useCallback102(() => {
28064
+ const handlePointerDown = useCallback92(() => {
27832
28065
  document.addEventListener("pointerup", (newEvt) => {
27833
28066
  handleClick(newEvt);
27834
28067
  }, {
27835
28068
  once: true
27836
28069
  });
27837
28070
  }, [handleClick]);
27838
- const handleDoubleClick = useCallback102(() => {
28071
+ const handleDoubleClick = useCallback92(() => {
27839
28072
  api.clearPendingPromises();
27840
28073
  onDoubleClick();
27841
28074
  }, [api, onDoubleClick]);
@@ -27896,7 +28129,7 @@ var PlayerUI = ({
27896
28129
  }, ref) => {
27897
28130
  const config = Internals.useUnsafeVideoConfig();
27898
28131
  const video = Internals.useVideo();
27899
- const container4 = useRef112(null);
28132
+ const container4 = useRef102(null);
27900
28133
  const canvasSize = useElementSize(container4, {
27901
28134
  triggerOnWindowResize: false,
27902
28135
  shouldApplyCssTransforms: false
@@ -27955,10 +28188,10 @@ var PlayerUI = ({
27955
28188
  document.removeEventListener("webkitfullscreenchange", onFullscreenChange);
27956
28189
  };
27957
28190
  }, []);
27958
- const toggle = useCallback112((e) => {
28191
+ const toggle = useCallback102((e) => {
27959
28192
  playerToggle(e);
27960
28193
  }, [playerToggle]);
27961
- const requestFullscreen = useCallback112(() => {
28194
+ const requestFullscreen = useCallback102(() => {
27962
28195
  if (!allowFullscreen) {
27963
28196
  throw new Error("allowFullscreen is false");
27964
28197
  }
@@ -27974,7 +28207,7 @@ var PlayerUI = ({
27974
28207
  container4.current.requestFullscreen();
27975
28208
  }
27976
28209
  }, [allowFullscreen, supportsFullScreen]);
27977
- const exitFullscreen = useCallback112(() => {
28210
+ const exitFullscreen = useCallback102(() => {
27978
28211
  if (document.webkitExitFullscreen) {
27979
28212
  document.webkitExitFullscreen();
27980
28213
  } else {
@@ -28018,7 +28251,7 @@ var PlayerUI = ({
28018
28251
  });
28019
28252
  }, [canvasSize, config]);
28020
28253
  const scale = layout?.scale ?? 1;
28021
- const initialScaleIgnored = useRef112(false);
28254
+ const initialScaleIgnored = useRef102(false);
28022
28255
  useEffect122(() => {
28023
28256
  if (!initialScaleIgnored.current) {
28024
28257
  initialScaleIgnored.current = true;
@@ -28167,32 +28400,32 @@ var PlayerUI = ({
28167
28400
  }, [config, layout, overflowVisible, scale]);
28168
28401
  const playerPause = player.pause;
28169
28402
  const playerDispatchError = player.emitter.dispatchError;
28170
- const onError = useCallback112((error2) => {
28403
+ const onError = useCallback102((error2) => {
28171
28404
  playerPause();
28172
28405
  playerDispatchError(error2);
28173
28406
  }, [playerDispatchError, playerPause]);
28174
- const onFullscreenButtonClick = useCallback112((e) => {
28407
+ const onFullscreenButtonClick = useCallback102((e) => {
28175
28408
  e.stopPropagation();
28176
28409
  requestFullscreen();
28177
28410
  }, [requestFullscreen]);
28178
- const onExitFullscreenButtonClick = useCallback112((e) => {
28411
+ const onExitFullscreenButtonClick = useCallback102((e) => {
28179
28412
  e.stopPropagation();
28180
28413
  exitFullscreen();
28181
28414
  }, [exitFullscreen]);
28182
- const onSingleClick = useCallback112((e) => {
28415
+ const onSingleClick = useCallback102((e) => {
28183
28416
  const rightClick = e instanceof MouseEvent ? e.button === 2 : e.nativeEvent.button;
28184
28417
  if (rightClick) {
28185
28418
  return;
28186
28419
  }
28187
28420
  toggle(e);
28188
28421
  }, [toggle]);
28189
- const onSeekStart = useCallback112(() => {
28422
+ const onSeekStart = useCallback102(() => {
28190
28423
  setSeeking(true);
28191
28424
  }, []);
28192
- const onSeekEnd = useCallback112(() => {
28425
+ const onSeekEnd = useCallback102(() => {
28193
28426
  setSeeking(false);
28194
28427
  }, []);
28195
- const onDoubleClick = useCallback112(() => {
28428
+ const onDoubleClick = useCallback102(() => {
28196
28429
  if (isFullscreen) {
28197
28430
  exitFullscreen();
28198
28431
  } else {
@@ -28425,7 +28658,7 @@ var SharedPlayerContexts = ({
28425
28658
  mediaVolume
28426
28659
  };
28427
28660
  }, [mediaMuted, mediaVolume]);
28428
- const setMediaVolumeAndPersist = useCallback122((vol) => {
28661
+ const setMediaVolumeAndPersist = useCallback112((vol) => {
28429
28662
  setMediaVolume(vol);
28430
28663
  if (persistVolumeToStorage) {
28431
28664
  persistVolume(vol, logLevel, volumePersistenceKey ?? null);
@@ -28676,9 +28909,9 @@ var PlayerFn = ({
28676
28909
  }));
28677
28910
  const [playing, setPlaying] = useState132(false);
28678
28911
  const [rootId] = useState132("player-comp");
28679
- const rootRef = useRef122(null);
28680
- const audioAndVideoTags = useRef122([]);
28681
- const imperativePlaying = useRef122(false);
28912
+ const rootRef = useRef112(null);
28913
+ const audioAndVideoTags = useRef112([]);
28914
+ const imperativePlaying = useRef112(false);
28682
28915
  const [currentPlaybackRate, setCurrentPlaybackRate] = useState132(playbackRate);
28683
28916
  if (typeof compositionHeight !== "number") {
28684
28917
  throw new TypeError(`'compositionHeight' must be a number but got '${typeof compositionHeight}' instead`);
@@ -28875,7 +29108,7 @@ var ThumbnailUI = ({
28875
29108
  }, ref) => {
28876
29109
  const config = Internals.useUnsafeVideoConfig();
28877
29110
  const video = Internals.useVideo();
28878
- const container4 = useRef132(null);
29111
+ const container4 = useRef122(null);
28879
29112
  const canvasSize = useElementSize(container4, {
28880
29113
  triggerOnWindowResize: false,
28881
29114
  shouldApplyCssTransforms: false
@@ -28922,7 +29155,7 @@ var ThumbnailUI = ({
28922
29155
  overflowVisible
28923
29156
  });
28924
29157
  }, [config, layout, overflowVisible, scale]);
28925
- const onError = useCallback132((error2) => {
29158
+ const onError = useCallback122((error2) => {
28926
29159
  thumbnail.emitter.dispatchError(error2);
28927
29160
  }, [thumbnail.emitter]);
28928
29161
  const loadingMarkup = useMemo162(() => {
@@ -29001,7 +29234,7 @@ var ThumbnailFn = ({
29001
29234
  }, []);
29002
29235
  }
29003
29236
  const [thumbnailId] = useState142(() => String(random(null)));
29004
- const rootRef = useRef142(null);
29237
+ const rootRef = useRef132(null);
29005
29238
  const timelineState = useMemo172(() => {
29006
29239
  const value = {
29007
29240
  playing: false,
@@ -29824,7 +30057,7 @@ var UNDERLAY_RED = curriedTransparentize$1(0.9, RED);
29824
30057
  var BLUE_TEXT = curriedDarken$1(0.3, "#42e9f5");
29825
30058
 
29826
30059
  // src/components/homepage/layout/use-color-mode.tsx
29827
- import React57, { useContext as useContext46, useMemo as useMemo53 } from "react";
30060
+ import React57, { useContext as useContext45, useMemo as useMemo53 } from "react";
29828
30061
  import { jsx as jsx57 } from "react/jsx-runtime";
29829
30062
  var Context = React57.createContext(undefined);
29830
30063
  var ColorModeProvider = ({
@@ -29841,7 +30074,7 @@ var ColorModeProvider = ({
29841
30074
  });
29842
30075
  };
29843
30076
  function useColorMode() {
29844
- const context = useContext46(Context);
30077
+ const context = useContext45(Context);
29845
30078
  if (context === null || context === undefined) {
29846
30079
  throw new Error("ColorModeProvider");
29847
30080
  }
@@ -29851,13 +30084,13 @@ function useColorMode() {
29851
30084
  // ../media/dist/esm/index.mjs
29852
30085
  import { useState as useState312 } from "react";
29853
30086
  import { useMemo as useMemo311 } from "react";
29854
- import { useContext as useContext212, useEffect as useEffect44, useMemo as useMemo55, useRef as useRef44, useState as useState41 } from "react";
30087
+ import { useContext as useContext212, useEffect as useEffect44, useMemo as useMemo55, useRef as useRef45, useState as useState41 } from "react";
29855
30088
  import { ALL_FORMATS, Input as Input2, UrlSource } from "mediabunny";
29856
30089
  import { AudioBufferSink, InputDisposedError } from "mediabunny";
29857
30090
  import { CanvasSink } from "mediabunny";
29858
- import { useContext as useContext48, useLayoutEffect as useLayoutEffect18 } from "react";
30091
+ import { useContext as useContext47, useLayoutEffect as useLayoutEffect18 } from "react";
29859
30092
  import { jsx as jsx58 } from "react/jsx-runtime";
29860
- import { useContext as useContext311, useLayoutEffect as useLayoutEffect24, useMemo as useMemo213, useState as useState210 } from "react";
30093
+ import { useContext as useContext310, useLayoutEffect as useLayoutEffect24, useMemo as useMemo213, useState as useState210 } from "react";
29861
30094
  import React211 from "react";
29862
30095
  import {
29863
30096
  ALL_FORMATS as ALL_FORMATS2,
@@ -29873,7 +30106,7 @@ import { jsx as jsx216 } from "react/jsx-runtime";
29873
30106
  import { jsx as jsx315 } from "react/jsx-runtime";
29874
30107
  import { useMemo as useMemo63, useState as useState63 } from "react";
29875
30108
  import {
29876
- useContext as useContext47,
30109
+ useContext as useContext46,
29877
30110
  useEffect as useEffect210,
29878
30111
  useLayoutEffect as useLayoutEffect34,
29879
30112
  useMemo as useMemo412,
@@ -30295,6 +30528,12 @@ var audioIteratorManager = ({
30295
30528
  let audioIteratorsCreated = 0;
30296
30529
  let totalAudioScheduledInSeconds = 0;
30297
30530
  let currentDelayHandle = null;
30531
+ const unblockCurrentDelayHandle = () => {
30532
+ if (currentDelayHandle) {
30533
+ currentDelayHandle.unblock();
30534
+ currentDelayHandle = null;
30535
+ }
30536
+ };
30298
30537
  const pendingScheduleWaiters = [];
30299
30538
  const notifyNodeScheduled = () => {
30300
30539
  for (let i = pendingScheduleWaiters.length - 1;i >= 0; i--) {
@@ -30395,6 +30634,7 @@ var audioIteratorManager = ({
30395
30634
  waitForTurn({
30396
30635
  getPriority: () => {
30397
30636
  if (iterator.isDestroyed()) {
30637
+ onDestroyed();
30398
30638
  return null;
30399
30639
  }
30400
30640
  const guessedNextTimestamp = iterator.guessNextTimestamp();
@@ -30447,9 +30687,11 @@ var audioIteratorManager = ({
30447
30687
  },
30448
30688
  onError: (e) => {
30449
30689
  if (e instanceof InputDisposedError) {
30690
+ onDestroyed();
30450
30691
  return;
30451
30692
  }
30452
30693
  if (e instanceof StaleWaiterError) {
30694
+ onDestroyed();
30453
30695
  return;
30454
30696
  }
30455
30697
  throw e;
@@ -30475,6 +30717,7 @@ var audioIteratorManager = ({
30475
30717
  return;
30476
30718
  }
30477
30719
  audioBufferIterator?.destroy();
30720
+ unblockCurrentDelayHandle();
30478
30721
  const delayHandle = delayPlaybackHandleIfNotPremounting();
30479
30722
  currentDelayHandle = delayHandle;
30480
30723
  const iterator = makeAudioIterator({
@@ -30489,6 +30732,7 @@ var audioIteratorManager = ({
30489
30732
  });
30490
30733
  audioIteratorsCreated++;
30491
30734
  audioBufferIterator = iterator;
30735
+ let chunksScheduled = 0;
30492
30736
  proceedScheduling({
30493
30737
  iterator,
30494
30738
  nonce,
@@ -30496,7 +30740,10 @@ var audioIteratorManager = ({
30496
30740
  playbackRate,
30497
30741
  scheduleAudioNode,
30498
30742
  onScheduled: () => {
30499
- delayHandle.unblock();
30743
+ chunksScheduled++;
30744
+ if (chunksScheduled === 6) {
30745
+ delayHandle.unblock();
30746
+ }
30500
30747
  },
30501
30748
  onDestroyed: () => {
30502
30749
  delayHandle.unblock();
@@ -30524,6 +30771,9 @@ var audioIteratorManager = ({
30524
30771
  fps,
30525
30772
  getAudioContextCurrentTimeMockedInTest
30526
30773
  }) => {
30774
+ if (nonce.isStale()) {
30775
+ return;
30776
+ }
30527
30777
  if (currentSeek.time === newTime && currentSeek.playbackRate === playbackRate && currentSeek.trimBefore === trimBefore && currentSeek.trimAfter === trimAfter && currentSeek.sequenceOffset === sequenceOffset && currentSeek.sequenceDurationInFrames === sequenceDurationInFrames && currentSeek.loop === loop && currentSeek.fps === fps) {
30528
30778
  return;
30529
30779
  }
@@ -30575,10 +30825,7 @@ var audioIteratorManager = ({
30575
30825
  destroyIterator: () => {
30576
30826
  audioBufferIterator?.destroy();
30577
30827
  audioBufferIterator = null;
30578
- if (currentDelayHandle) {
30579
- currentDelayHandle.unblock();
30580
- currentDelayHandle = null;
30581
- }
30828
+ unblockCurrentDelayHandle();
30582
30829
  },
30583
30830
  seek: seek2,
30584
30831
  getAudioIteratorsCreated: () => audioIteratorsCreated,
@@ -31626,7 +31873,7 @@ var useCommonEffects = ({
31626
31873
  logLevel,
31627
31874
  label: label3
31628
31875
  }) => {
31629
- const sharedAudioContext = useContext48(Internals.SharedAudioContext);
31876
+ const sharedAudioContext = useContext47(Internals.SharedAudioContext);
31630
31877
  useLayoutEffect18(() => {
31631
31878
  const mediaPlayer = mediaPlayerRef.current;
31632
31879
  if (!mediaPlayer)
@@ -31782,9 +32029,9 @@ var AudioForPreviewAssertedShowing = ({
31782
32029
  }) => {
31783
32030
  const videoConfig = useUnsafeVideoConfig2();
31784
32031
  const frame = useCurrentFrame();
31785
- const mediaPlayerRef = useRef44(null);
31786
- const initialTrimBeforeRef = useRef44(trimBefore);
31787
- const initialTrimAfterRef = useRef44(trimAfter);
32032
+ const mediaPlayerRef = useRef45(null);
32033
+ const initialTrimBeforeRef = useRef45(trimBefore);
32034
+ const initialTrimAfterRef = useRef45(trimAfter);
31788
32035
  const [mediaPlayerReady, setMediaPlayerReady] = useState41(false);
31789
32036
  const [shouldFallbackToNativeAudio, setShouldFallbackToNativeAudio] = useState41(false);
31790
32037
  const [playing] = Timeline.usePlayingState();
@@ -31807,7 +32054,7 @@ var AudioForPreviewAssertedShowing = ({
31807
32054
  throw new TypeError("No `src` was passed to <NewAudioForPreview>.");
31808
32055
  }
31809
32056
  const currentTime = frame / videoConfig.fps;
31810
- const currentTimeRef = useRef44(currentTime);
32057
+ const currentTimeRef = useRef45(currentTime);
31811
32058
  currentTimeRef.current = currentTime;
31812
32059
  const preloadedSrc = usePreload2(src);
31813
32060
  const parentSequence = useContext212(SequenceContext2);
@@ -31820,14 +32067,14 @@ var AudioForPreviewAssertedShowing = ({
31820
32067
  }
31821
32068
  const effectiveMuted = muted || mediaMuted || userPreferredVolume <= 0;
31822
32069
  const isPlayerBuffering = Internals.useIsPlayerBuffering(bufferingContext);
31823
- const initialPlaying = useRef44(playing && !isPlayerBuffering);
31824
- const initialIsPremounting = useRef44(isPremounting);
31825
- const initialIsPostmounting = useRef44(isPostmounting);
31826
- const initialGlobalPlaybackRate = useRef44(globalPlaybackRate);
31827
- const initialPlaybackRate = useRef44(playbackRate);
31828
- const initialMuted = useRef44(effectiveMuted);
31829
- const initialDurationInFrames = useRef44(videoConfig.durationInFrames);
31830
- const initialSequenceOffset = useRef44(sequenceOffset);
32070
+ const initialPlaying = useRef45(playing && !isPlayerBuffering);
32071
+ const initialIsPremounting = useRef45(isPremounting);
32072
+ const initialIsPostmounting = useRef45(isPostmounting);
32073
+ const initialGlobalPlaybackRate = useRef45(globalPlaybackRate);
32074
+ const initialPlaybackRate = useRef45(playbackRate);
32075
+ const initialMuted = useRef45(effectiveMuted);
32076
+ const initialDurationInFrames = useRef45(videoConfig.durationInFrames);
32077
+ const initialSequenceOffset = useRef45(sequenceOffset);
31831
32078
  useCommonEffects({
31832
32079
  mediaPlayerRef,
31833
32080
  mediaPlayerReady,
@@ -33902,7 +34149,7 @@ var AudioForRendering2 = ({
33902
34149
  const frame = useCurrentFrame();
33903
34150
  const absoluteFrame = Internals.useTimelinePosition();
33904
34151
  const videoConfig = Internals.useUnsafeVideoConfig();
33905
- const { registerRenderAsset, unregisterRenderAsset } = useContext311(Internals.RenderAssetManager);
34152
+ const { registerRenderAsset, unregisterRenderAsset } = useContext310(Internals.RenderAssetManager);
33906
34153
  const startsAt = Internals.useMediaStartsAt();
33907
34154
  const environment = useRemotionEnvironment();
33908
34155
  if (!videoConfig) {
@@ -33914,7 +34161,7 @@ var AudioForRendering2 = ({
33914
34161
  const { fps } = videoConfig;
33915
34162
  const { delayRender: delayRender2, continueRender } = useDelayRender();
33916
34163
  const [replaceWithHtml5Audio, setReplaceWithHtml5Audio] = useState210(false);
33917
- const sequenceContext = useContext311(Internals.SequenceContext);
34164
+ const sequenceContext = useContext310(Internals.SequenceContext);
33918
34165
  const id = useMemo213(() => `media-audio-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
33919
34166
  src,
33920
34167
  sequenceContext?.cumulatedFrom,
@@ -34267,7 +34514,7 @@ var VideoForPreviewAssertedShowing = ({
34267
34514
  const [shouldFallbackToNativeVideo, setShouldFallbackToNativeVideo] = useState43(false);
34268
34515
  const [playing] = Timeline2.usePlayingState();
34269
34516
  const { playbackRate: globalPlaybackRate } = Internals.usePlaybackRate();
34270
- const sharedAudioContext = useContext47(SharedAudioContext22);
34517
+ const sharedAudioContext = useContext46(SharedAudioContext22);
34271
34518
  const buffer = useBufferState();
34272
34519
  const [mediaMuted] = useMediaMutedState22();
34273
34520
  const [mediaVolume] = useMediaVolumeState22();
@@ -34288,7 +34535,7 @@ var VideoForPreviewAssertedShowing = ({
34288
34535
  effectChainStateRef.current = effectChainState;
34289
34536
  const frameRef = useRef210(frame);
34290
34537
  frameRef.current = frame;
34291
- const parentSequence = useContext47(SequenceContext22);
34538
+ const parentSequence = useContext46(SequenceContext22);
34292
34539
  const isPremounting = Boolean(parentSequence?.premounting);
34293
34540
  const isPostmounting = Boolean(parentSequence?.postmounting);
34294
34541
  const sequenceOffset = ((parentSequence?.cumulatedFrom ?? 0) + (parentSequence?.relativeFrom ?? 0)) / videoConfig.fps;
@@ -34296,7 +34543,7 @@ var VideoForPreviewAssertedShowing = ({
34296
34543
  const currentTimeRef = useRef210(currentTime);
34297
34544
  currentTimeRef.current = currentTime;
34298
34545
  const preloadedSrc = usePreload22(src);
34299
- const buffering = useContext47(Internals.BufferingContextReact);
34546
+ const buffering = useContext46(Internals.BufferingContextReact);
34300
34547
  if (!buffering) {
34301
34548
  throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
34302
34549
  }
@@ -35088,6 +35335,7 @@ var VideoInner = ({
35088
35335
  type: "video",
35089
35336
  data: basicInfo
35090
35337
  }), [basicInfo]);
35338
+ const memoizedEffects = Internals.useMemoizedEffects(Internals.flattenEffects(_experimentalEffects ?? []));
35091
35339
  if (sequenceDurationInFrames === 0) {
35092
35340
  return null;
35093
35341
  }
@@ -35100,6 +35348,7 @@ var VideoInner = ({
35100
35348
  name: name ?? "<Video>",
35101
35349
  _experimentalControls: controls,
35102
35350
  _remotionInternalLoopDisplay: loopDisplay,
35351
+ _experimentalEffects: memoizedEffects,
35103
35352
  showInTimeline: showInTimeline ?? true,
35104
35353
  children: /* @__PURE__ */ jsx65(InnerVideo, {
35105
35354
  audioStreamIndex: audioStreamIndex ?? 0,
@@ -35129,7 +35378,7 @@ var VideoInner = ({
35129
35378
  _experimentalControls: controls,
35130
35379
  objectFit: objectFit ?? "contain",
35131
35380
  _experimentalInitiallyDrawCachedFrame: _experimentalInitiallyDrawCachedFrame ?? false,
35132
- _experimentalEffects: _experimentalEffects ?? [],
35381
+ _experimentalEffects: memoizedEffects,
35133
35382
  setMediaDurationInSeconds
35134
35383
  })
35135
35384
  });
@@ -36438,7 +36687,7 @@ import {
36438
36687
  import { BufferTarget, StreamTarget } from "mediabunny";
36439
36688
 
36440
36689
  // ../core/dist/esm/version.mjs
36441
- var VERSION2 = "4.0.459";
36690
+ var VERSION2 = "4.0.461";
36442
36691
 
36443
36692
  // ../web-renderer/dist/esm/index.mjs
36444
36693
  import { AudioSample, VideoSample } from "mediabunny";
@@ -37086,7 +37335,6 @@ var UpdateTime = ({
37086
37335
  }
37087
37336
  }));
37088
37337
  return /* @__PURE__ */ jsx88(Internals.RemotionRootContexts, {
37089
- visualModeEnabled: false,
37090
37338
  audioEnabled,
37091
37339
  videoEnabled,
37092
37340
  logLevel,
@@ -40127,7 +40375,7 @@ var applyTextTransform = (text, transform) => {
40127
40375
  return text.toLowerCase();
40128
40376
  }
40129
40377
  if (transform === "capitalize") {
40130
- return text.replace(/\b\w/g, (char) => char.toUpperCase());
40378
+ return text.replace(/\b(?<!['\u2019])\w/g, (char) => char.toUpperCase());
40131
40379
  }
40132
40380
  return text;
40133
40381
  };
@@ -43426,6 +43674,7 @@ var listOfRemotionPackages = [
43426
43674
  "@remotion/studio",
43427
43675
  "@remotion/tailwind",
43428
43676
  "@remotion/tailwind-v4",
43677
+ "@remotion/timeline-utils",
43429
43678
  "@remotion/test-utils",
43430
43679
  "@remotion/three",
43431
43680
  "@remotion/transitions",
@@ -44702,7 +44951,7 @@ var GithubButton = () => {
44702
44951
  " ",
44703
44952
  /* @__PURE__ */ jsx164("div", {
44704
44953
  className: "text-xs inline-block ml-2 leading-none mt-[3px] self-center",
44705
- children: "45k"
44954
+ children: "46k"
44706
44955
  })
44707
44956
  ]
44708
44957
  });