@remotion/promo-pages 4.0.461 → 4.0.462

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
@@ -941,7 +941,7 @@ import * as React6 from "react";
941
941
  import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
942
942
  import { useContext as useContext8, useMemo as useMemo7 } from "react";
943
943
  import { jsx as jsx7 } from "react/jsx-runtime";
944
- import { useEffect as useEffect4, useMemo as useMemo11, useState as useState3 } from "react";
944
+ import { useEffect as useEffect4, useMemo as useMemo12, useState as useState4 } from "react";
945
945
  import { useContext as useContext11 } from "react";
946
946
  import { createContext as createContext12 } from "react";
947
947
  import { useContext as useContext10, useMemo as useMemo9 } from "react";
@@ -954,24 +954,24 @@ 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
+ import { useContext as useContext12, useRef as useRef6 } from "react";
958
+ import { createContext as createContext14 } from "react";
959
+ import React10, { useCallback as useCallback5, useMemo as useMemo11, useRef as useRef5, useState as useState3 } from "react";
958
960
  import { jsx as jsx9 } from "react/jsx-runtime";
961
+ import { jsx as jsx10 } from "react/jsx-runtime";
959
962
  import {
960
963
  forwardRef as forwardRef3,
961
- useContext as useContext16,
964
+ useContext as useContext17,
962
965
  useEffect as useEffect5,
963
966
  useMemo as useMemo16,
964
967
  useState as useState6
965
968
  } from "react";
966
- import { useContext as useContext14, useMemo as useMemo13 } from "react";
967
- import { useContext as useContext13 } from "react";
968
- import { useContext as useContext12, useMemo as useMemo12 } from "react";
969
- import { jsx as jsx10 } from "react/jsx-runtime";
970
- import { createContext as createContext14 } from "react";
971
- import React12, { useCallback as useCallback5, useMemo as useMemo14, useRef as useRef6, useState as useState4 } from "react";
969
+ import { useContext as useContext15, useMemo as useMemo14 } from "react";
970
+ import { useContext as useContext14 } from "react";
971
+ import { useContext as useContext13, useMemo as useMemo13 } from "react";
972
972
  import { jsx as jsx11 } from "react/jsx-runtime";
973
- import React13, { forwardRef as forwardRef2, useState as useState5, useContext as useContext15, useMemo as useMemo15 } from "react";
974
973
  import { createContext as createContext15 } from "react";
974
+ import React13, { forwardRef as forwardRef2, useState as useState5, useContext as useContext16, useMemo as useMemo15 } from "react";
975
975
  import { jsx as jsx12 } from "react/jsx-runtime";
976
976
  import {
977
977
  forwardRef as forwardRef4,
@@ -988,14 +988,14 @@ import {
988
988
  createContext as createContext16,
989
989
  forwardRef as forwardRef5,
990
990
  useCallback as useCallback7,
991
- useContext as useContext17,
991
+ useContext as useContext18,
992
992
  useLayoutEffect as useLayoutEffect3,
993
993
  useMemo as useMemo17,
994
994
  useRef as useRef9,
995
995
  useState as useState8
996
996
  } from "react";
997
997
  import { jsx as jsx15 } from "react/jsx-runtime";
998
- import { useContext as useContext18, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
998
+ import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
999
999
  import {
1000
1000
  createContext as createContext17,
1001
1001
  useCallback as useCallback8,
@@ -1006,29 +1006,29 @@ import {
1006
1006
  useState as useState9
1007
1007
  } from "react";
1008
1008
  import { jsx as jsx16 } from "react/jsx-runtime";
1009
- import { forwardRef as forwardRef8, useCallback as useCallback13, useContext as useContext30 } from "react";
1009
+ import { forwardRef as forwardRef8, useCallback as useCallback13, useContext as useContext31 } from "react";
1010
1010
  import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
1011
1011
  import { jsx as jsx17 } from "react/jsx-runtime";
1012
- import { useContext as useContext19 } from "react";
1012
+ import { useContext as useContext20 } from "react";
1013
1013
  import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
1014
1014
  import { jsx as jsx18 } from "react/jsx-runtime";
1015
1015
  import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
1016
1016
  import { jsx as jsx19 } from "react/jsx-runtime";
1017
1017
  import React23, {
1018
1018
  forwardRef as forwardRef6,
1019
- useContext as useContext28,
1019
+ useContext as useContext29,
1020
1020
  useEffect as useEffect14,
1021
1021
  useImperativeHandle as useImperativeHandle4,
1022
1022
  useMemo as useMemo28,
1023
1023
  useRef as useRef18,
1024
1024
  useState as useState16
1025
1025
  } from "react";
1026
- import { useContext as useContext21, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
1026
+ import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
1027
1027
  import React20, {
1028
1028
  createContext as createContext21,
1029
1029
  createRef as createRef2,
1030
1030
  useCallback as useCallback9,
1031
- useContext as useContext20,
1031
+ useContext as useContext21,
1032
1032
  useMemo as useMemo22,
1033
1033
  useRef as useRef11,
1034
1034
  useState as useState12
@@ -1036,20 +1036,20 @@ import React20, {
1036
1036
  import { useMemo as useMemo21 } from "react";
1037
1037
  import { jsx as jsx20, jsxs as jsxs22 } from "react/jsx-runtime";
1038
1038
  import { useRef as useRef12 } from "react";
1039
- import { useContext as useContext23, useEffect as useEffect8, useMemo as useMemo23, useState as useState13 } from "react";
1040
- import { useContext as useContext22 } from "react";
1039
+ import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState13 } from "react";
1040
+ import { useContext as useContext23 } from "react";
1041
1041
  import {
1042
1042
  useCallback as useCallback12,
1043
- useContext as useContext26,
1043
+ useContext as useContext27,
1044
1044
  useEffect as useEffect12,
1045
1045
  useLayoutEffect as useLayoutEffect8,
1046
1046
  useRef as useRef17
1047
1047
  } from "react";
1048
1048
  import { useCallback as useCallback11, useMemo as useMemo26, useRef as useRef15 } from "react";
1049
- import { useContext as useContext25, useMemo as useMemo25 } from "react";
1049
+ import { useContext as useContext26, useMemo as useMemo25 } from "react";
1050
1050
  import React21, {
1051
1051
  useCallback as useCallback10,
1052
- useContext as useContext24,
1052
+ useContext as useContext25,
1053
1053
  useEffect as useEffect9,
1054
1054
  useLayoutEffect as useLayoutEffect7,
1055
1055
  useMemo as useMemo24,
@@ -1061,11 +1061,11 @@ import React22 from "react";
1061
1061
  import { useEffect as useEffect10, useState as useState15 } from "react";
1062
1062
  import { useEffect as useEffect11, useRef as useRef16 } from "react";
1063
1063
  import { useEffect as useEffect13 } from "react";
1064
- import { createContext as createContext22, useContext as useContext27, useMemo as useMemo27 } from "react";
1064
+ import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
1065
1065
  import { jsx as jsx222 } from "react/jsx-runtime";
1066
1066
  import {
1067
1067
  forwardRef as forwardRef7,
1068
- useContext as useContext29,
1068
+ useContext as useContext30,
1069
1069
  useEffect as useEffect15,
1070
1070
  useImperativeHandle as useImperativeHandle5,
1071
1071
  useLayoutEffect as useLayoutEffect9,
@@ -1078,7 +1078,7 @@ import { forwardRef as forwardRef9, useCallback as useCallback14, useState as us
1078
1078
  import { jsx as jsx25 } from "react/jsx-runtime";
1079
1079
  import {
1080
1080
  useCallback as useCallback15,
1081
- useContext as useContext31,
1081
+ useContext as useContext32,
1082
1082
  useImperativeHandle as useImperativeHandle6,
1083
1083
  useLayoutEffect as useLayoutEffect10,
1084
1084
  useRef as useRef20,
@@ -1097,7 +1097,7 @@ import {
1097
1097
  import { jsx as jsx27 } from "react/jsx-runtime";
1098
1098
  import React29 from "react";
1099
1099
  import { useMemo as useMemo32 } from "react";
1100
- import { createContext as createContext23, useContext as useContext32, useMemo as useMemo31 } from "react";
1100
+ import { createContext as createContext23, useContext as useContext33, useMemo as useMemo31 } from "react";
1101
1101
  import { jsx as jsx28 } from "react/jsx-runtime";
1102
1102
  import { jsx as jsx29 } from "react/jsx-runtime";
1103
1103
  import React31 from "react";
@@ -1105,7 +1105,7 @@ 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 useContext33,
1108
+ useContext as useContext34,
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 useContext34,
1117
+ useContext as useContext35,
1118
1118
  useEffect as useEffect18,
1119
1119
  useImperativeHandle as useImperativeHandle8,
1120
1120
  useMemo as useMemo34,
@@ -1132,10 +1132,10 @@ 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 useContext36 } from "react";
1135
+ import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as useContext37 } from "react";
1136
1136
  import {
1137
1137
  forwardRef as forwardRef12,
1138
- useContext as useContext35,
1138
+ useContext as useContext36,
1139
1139
  useEffect as useEffect19,
1140
1140
  useImperativeHandle as useImperativeHandle9,
1141
1141
  useLayoutEffect as useLayoutEffect12,
@@ -2416,39 +2416,6 @@ 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
- };
2452
2419
 
2453
2420
  class CanvasPool {
2454
2421
  width;
@@ -2522,6 +2489,26 @@ class CanvasPool {
2522
2489
  }
2523
2490
  }
2524
2491
  }
2492
+ var groupByBackend = (effects) => {
2493
+ const runs = [];
2494
+ let current = [];
2495
+ let currentBackend = null;
2496
+ for (const eff of effects) {
2497
+ const { backend } = eff.definition;
2498
+ if (currentBackend === null || backend === currentBackend) {
2499
+ current.push(eff);
2500
+ currentBackend = backend;
2501
+ } else {
2502
+ runs.push({ backend: currentBackend, effects: current });
2503
+ current = [eff];
2504
+ currentBackend = backend;
2505
+ }
2506
+ }
2507
+ if (currentBackend !== null && current.length > 0) {
2508
+ runs.push({ backend: currentBackend, effects: current });
2509
+ }
2510
+ return runs;
2511
+ };
2525
2512
  var devicePromise = null;
2526
2513
  var getGpuDevice = () => {
2527
2514
  if (devicePromise) {
@@ -2667,18 +2654,318 @@ var useEffectChainState = () => {
2667
2654
  }
2668
2655
  }), []);
2669
2656
  };
2670
- var useMemoizedEffects = (effects) => {
2671
- const previousRef = useRef5(null);
2657
+ var OverrideIdsToNodePathsGettersContext = createContext14({
2658
+ overrideIdToNodePathMappings: {}
2659
+ });
2660
+ var OverrideIdsToNodePathsSettersContext = createContext14({
2661
+ setOverrideIdToNodePath: () => {
2662
+ throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
2663
+ }
2664
+ });
2665
+ var SequenceManager = React10.createContext({
2666
+ registerSequence: () => {
2667
+ throw new Error("SequenceManagerContext not initialized");
2668
+ },
2669
+ unregisterSequence: () => {
2670
+ throw new Error("SequenceManagerContext not initialized");
2671
+ },
2672
+ sequences: []
2673
+ });
2674
+ var SequenceVisibilityToggleContext = React10.createContext({
2675
+ hidden: {},
2676
+ setHidden: () => {
2677
+ throw new Error("SequenceVisibilityToggle not initialized");
2678
+ }
2679
+ });
2680
+ var makeSequencePropsSubscriptionKey = (key) => {
2681
+ return `${key.nodePath.join(".")}.${key.sequenceKeys.join(".")}.${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
2682
+ };
2683
+ var VisualModeCodeValuesContext = React10.createContext({
2684
+ codeValues: {}
2685
+ });
2686
+ var VisualModeDragOverridesContext = React10.createContext({
2687
+ getDragOverrides: () => {
2688
+ throw new Error("VisualModeDragOverridesContext not initialized");
2689
+ },
2690
+ getEffectDragOverrides: () => {
2691
+ throw new Error("VisualModeDragOverridesContext not initialized");
2692
+ }
2693
+ });
2694
+ var VisualModeSettersContext = React10.createContext({
2695
+ setDragOverrides: () => {
2696
+ throw new Error("VisualModeSettersContext not initialized");
2697
+ },
2698
+ clearDragOverrides: () => {
2699
+ throw new Error("VisualModeSettersContext not initialized");
2700
+ },
2701
+ setEffectDragOverrides: () => {
2702
+ throw new Error("VisualModeSettersContext not initialized");
2703
+ },
2704
+ clearEffectDragOverrides: () => {
2705
+ throw new Error("VisualModeSettersContext not initialized");
2706
+ },
2707
+ setCodeValues: () => {
2708
+ throw new Error("VisualModeSettersContext not initialized");
2709
+ }
2710
+ });
2711
+ var effectDragOverridesKey = (nodePath, effectIndex) => `${makeSequencePropsSubscriptionKey(nodePath)}.effects.${effectIndex}`;
2712
+ var SequenceManagerProvider = ({ children }) => {
2713
+ const [sequences, setSequences] = useState3([]);
2714
+ const [hidden, setHidden] = useState3({});
2715
+ const [dragOverrides, setControlOverrides] = useState3({});
2716
+ const controlOverridesRef = useRef5(dragOverrides);
2717
+ controlOverridesRef.current = dragOverrides;
2718
+ const [effectDragOverridesState, setEffectDragOverridesState] = useState3({});
2719
+ const [codeValues, setCodeValuesMapState] = useState3({});
2720
+ const setDragOverrides = useCallback5((nodePath, key, value) => {
2721
+ setControlOverrides((prev) => ({
2722
+ ...prev,
2723
+ [makeSequencePropsSubscriptionKey(nodePath)]: {
2724
+ ...prev[makeSequencePropsSubscriptionKey(nodePath)],
2725
+ [key]: value
2726
+ }
2727
+ }));
2728
+ }, []);
2729
+ const clearDragOverrides = useCallback5((nodePath) => {
2730
+ setControlOverrides((prev) => {
2731
+ const key = makeSequencePropsSubscriptionKey(nodePath);
2732
+ if (!prev[key]) {
2733
+ return prev;
2734
+ }
2735
+ const next = { ...prev };
2736
+ delete next[key];
2737
+ return next;
2738
+ });
2739
+ }, []);
2740
+ const setEffectDragOverrides = useCallback5((nodePath, effectIndex, key, value) => {
2741
+ setEffectDragOverridesState((prev) => {
2742
+ const mapKey = effectDragOverridesKey(nodePath, effectIndex);
2743
+ return {
2744
+ ...prev,
2745
+ [mapKey]: {
2746
+ ...prev[mapKey],
2747
+ [key]: value
2748
+ }
2749
+ };
2750
+ });
2751
+ }, []);
2752
+ const clearEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
2753
+ setEffectDragOverridesState((prev) => {
2754
+ const mapKey = effectDragOverridesKey(nodePath, effectIndex);
2755
+ if (!prev[mapKey]) {
2756
+ return prev;
2757
+ }
2758
+ const next = { ...prev };
2759
+ delete next[mapKey];
2760
+ return next;
2761
+ });
2762
+ }, []);
2763
+ const setCodeValues = useCallback5((nodePath, values) => {
2764
+ setCodeValuesMapState((prev) => {
2765
+ const key = makeSequencePropsSubscriptionKey(nodePath);
2766
+ const prevKey = prev[key];
2767
+ const newKey = values(prevKey);
2768
+ if (prevKey === newKey) {
2769
+ return prev;
2770
+ }
2771
+ return { ...prev, [key]: newKey };
2772
+ });
2773
+ }, []);
2774
+ const registerSequence = useCallback5((seq) => {
2775
+ setSequences((seqs) => {
2776
+ return [...seqs, seq];
2777
+ });
2778
+ }, []);
2779
+ const unregisterSequence = useCallback5((seq) => {
2780
+ setSequences((seqs) => seqs.filter((s) => s.id !== seq));
2781
+ }, []);
2782
+ const sequenceContext = useMemo11(() => {
2783
+ return {
2784
+ registerSequence,
2785
+ sequences,
2786
+ unregisterSequence
2787
+ };
2788
+ }, [registerSequence, sequences, unregisterSequence]);
2789
+ const hiddenContext = useMemo11(() => {
2790
+ return {
2791
+ hidden,
2792
+ setHidden
2793
+ };
2794
+ }, [hidden]);
2795
+ const getDragOverrides = useCallback5((nodePath) => {
2796
+ return dragOverrides[makeSequencePropsSubscriptionKey(nodePath)] ?? {};
2797
+ }, [dragOverrides]);
2798
+ const getEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
2799
+ return effectDragOverridesState[effectDragOverridesKey(nodePath, effectIndex)] ?? {};
2800
+ }, [effectDragOverridesState]);
2801
+ const codeValuesContext = useMemo11(() => {
2802
+ return {
2803
+ codeValues
2804
+ };
2805
+ }, [codeValues]);
2806
+ const dragOverridesContext = useMemo11(() => {
2807
+ return {
2808
+ getDragOverrides,
2809
+ getEffectDragOverrides
2810
+ };
2811
+ }, [getDragOverrides, getEffectDragOverrides]);
2812
+ const settersContext = useMemo11(() => {
2813
+ return {
2814
+ setDragOverrides,
2815
+ clearDragOverrides,
2816
+ setEffectDragOverrides,
2817
+ clearEffectDragOverrides,
2818
+ setCodeValues
2819
+ };
2820
+ }, [
2821
+ setDragOverrides,
2822
+ clearDragOverrides,
2823
+ setEffectDragOverrides,
2824
+ clearEffectDragOverrides,
2825
+ setCodeValues
2826
+ ]);
2827
+ return /* @__PURE__ */ jsx9(SequenceManager.Provider, {
2828
+ value: sequenceContext,
2829
+ children: /* @__PURE__ */ jsx9(SequenceVisibilityToggleContext.Provider, {
2830
+ value: hiddenContext,
2831
+ children: /* @__PURE__ */ jsx9(VisualModeCodeValuesContext.Provider, {
2832
+ value: codeValuesContext,
2833
+ children: /* @__PURE__ */ jsx9(VisualModeDragOverridesContext.Provider, {
2834
+ value: dragOverridesContext,
2835
+ children: /* @__PURE__ */ jsx9(VisualModeSettersContext.Provider, {
2836
+ value: settersContext,
2837
+ children
2838
+ })
2839
+ })
2840
+ })
2841
+ })
2842
+ });
2843
+ };
2844
+ var mergeOverrides = ({
2845
+ descriptor,
2846
+ codeOverrides,
2847
+ dragOverrides
2848
+ }) => {
2849
+ if (!codeOverrides && !dragOverrides) {
2850
+ return { params: descriptor.params, effectKey: descriptor.effectKey };
2851
+ }
2852
+ const merged = {
2853
+ ...descriptor.params
2854
+ };
2855
+ if (codeOverrides) {
2856
+ for (const [key, value] of Object.entries(codeOverrides)) {
2857
+ if (value !== undefined) {
2858
+ merged[key] = value;
2859
+ }
2860
+ }
2861
+ }
2862
+ if (dragOverrides) {
2863
+ for (const [key, value] of Object.entries(dragOverrides)) {
2864
+ merged[key] = value;
2865
+ }
2866
+ }
2867
+ return {
2868
+ params: merged,
2869
+ effectKey: descriptor.definition.calculateKey(merged)
2870
+ };
2871
+ };
2872
+ var extractCodeOverrides = (propStatus) => {
2873
+ if (!propStatus) {
2874
+ return null;
2875
+ }
2876
+ const out = {};
2877
+ let hasAny = false;
2878
+ for (const [key, status] of Object.entries(propStatus)) {
2879
+ if (status.canUpdate) {
2880
+ out[key] = status.codeValue;
2881
+ hasAny = true;
2882
+ }
2883
+ }
2884
+ return hasAny ? out : null;
2885
+ };
2886
+ var useMemoizedEffectDefinitions = (effects) => {
2887
+ const previousRef = useRef6(null);
2888
+ const definitions = effects.map((descriptor) => descriptor.definition);
2672
2889
  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);
2890
+ const isSame = previous !== null && previous.length === definitions.length && previous.every((def, i) => def === definitions[i]);
2674
2891
  if (isSame) {
2675
2892
  return previous;
2676
2893
  }
2677
- const next = effects.map((e) => ({
2678
- definition: e.definition,
2679
- stack: e.stack,
2680
- effectKey: e.effectKey,
2681
- params: e.params,
2894
+ previousRef.current = definitions;
2895
+ return definitions;
2896
+ };
2897
+ var getEffectCodeValuesCtx = ({
2898
+ codeValues,
2899
+ nodePath,
2900
+ effectIndex
2901
+ }) => {
2902
+ const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
2903
+ if (!status) {
2904
+ return { type: "cannot-update-sequence", reason: "not-found" };
2905
+ }
2906
+ if (!status.canUpdate) {
2907
+ return { type: "cannot-update-sequence", reason: status.reason };
2908
+ }
2909
+ const effect = status.effects.find((e) => e.effectIndex === effectIndex);
2910
+ if (!effect) {
2911
+ return { type: "cannot-update-effect", reason: "not-found" };
2912
+ }
2913
+ if (!effect.canUpdate) {
2914
+ return { type: "cannot-update-effect", reason: effect.reason };
2915
+ }
2916
+ return { type: "can-update-effect", props: effect.props };
2917
+ };
2918
+ var getCodeValuesCtx = (codeValues, nodePath) => {
2919
+ const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
2920
+ if (!status) {
2921
+ return;
2922
+ }
2923
+ if (!status.canUpdate) {
2924
+ return;
2925
+ }
2926
+ return status.props;
2927
+ };
2928
+ var useMemoizedEffects = ({
2929
+ effects,
2930
+ overrideId
2931
+ }) => {
2932
+ const previousRef = useRef6(null);
2933
+ const { codeValues } = useContext12(VisualModeCodeValuesContext);
2934
+ const { getEffectDragOverrides } = useContext12(VisualModeDragOverridesContext);
2935
+ const { overrideIdToNodePathMappings } = useContext12(OverrideIdsToNodePathsGettersContext);
2936
+ const previous = previousRef.current;
2937
+ const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
2938
+ const resolved = effects.map((descriptor, index) => {
2939
+ if (nodePath === null) {
2940
+ return {
2941
+ descriptor,
2942
+ params: descriptor.params,
2943
+ effectKey: descriptor.effectKey
2944
+ };
2945
+ }
2946
+ const effectStatus = getEffectCodeValuesCtx({
2947
+ codeValues,
2948
+ nodePath,
2949
+ effectIndex: index
2950
+ });
2951
+ const codeOverrides = effectStatus.type === "can-update-effect" ? extractCodeOverrides(effectStatus.props) : null;
2952
+ const dragOverridesMap = getEffectDragOverrides(nodePath, index);
2953
+ const dragOverrides = Object.keys(dragOverridesMap).length === 0 ? null : dragOverridesMap;
2954
+ const { params, effectKey } = mergeOverrides({
2955
+ descriptor,
2956
+ codeOverrides,
2957
+ dragOverrides
2958
+ });
2959
+ return { descriptor, params, effectKey };
2960
+ });
2961
+ const isSame = previous !== null && previous.length === resolved.length && previous.every((p, i) => p.definition === resolved[i].descriptor.definition && p.effectKey === resolved[i].effectKey);
2962
+ if (isSame) {
2963
+ return previous;
2964
+ }
2965
+ const next = resolved.map(({ descriptor, params, effectKey }) => ({
2966
+ definition: descriptor.definition,
2967
+ effectKey,
2968
+ params,
2682
2969
  memoized: true
2683
2970
  }));
2684
2971
  previousRef.current = next;
@@ -2689,7 +2976,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
2689
2976
  var addSequenceStackTraces = (component) => {
2690
2977
  componentsToAddStacksTo.push(component);
2691
2978
  };
2692
- var VERSION = "4.0.461";
2979
+ var VERSION = "4.0.462";
2693
2980
  var checkMultipleRemotionVersions = () => {
2694
2981
  if (typeof globalThis === "undefined") {
2695
2982
  return;
@@ -2718,12 +3005,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
2718
3005
  set();
2719
3006
  };
2720
3007
  var useUnsafeVideoConfig = () => {
2721
- const context = useContext12(SequenceContext);
3008
+ const context = useContext13(SequenceContext);
2722
3009
  const ctxWidth = context?.width ?? null;
2723
3010
  const ctxHeight = context?.height ?? null;
2724
3011
  const ctxDuration = context?.durationInFrames ?? null;
2725
3012
  const video = useVideo();
2726
- return useMemo12(() => {
3013
+ return useMemo13(() => {
2727
3014
  if (!video) {
2728
3015
  return null;
2729
3016
  }
@@ -2761,7 +3048,7 @@ var useUnsafeVideoConfig = () => {
2761
3048
  };
2762
3049
  var useVideoConfig = () => {
2763
3050
  const videoConfig = useUnsafeVideoConfig();
2764
- const context = useContext13(CanUseRemotionHooks);
3051
+ const context = useContext14(CanUseRemotionHooks);
2765
3052
  const isPlayer = useIsPlayer();
2766
3053
  if (!videoConfig) {
2767
3054
  if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
@@ -2797,7 +3084,7 @@ var Freeze = ({
2797
3084
  if (!Number.isFinite(frameToFreeze)) {
2798
3085
  throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`);
2799
3086
  }
2800
- const isActive = useMemo13(() => {
3087
+ const isActive = useMemo14(() => {
2801
3088
  if (typeof active === "boolean") {
2802
3089
  return active;
2803
3090
  }
@@ -2806,9 +3093,9 @@ var Freeze = ({
2806
3093
  }
2807
3094
  }, [active, frame]);
2808
3095
  const timelineContext = useTimelineContext();
2809
- const sequenceContext = useContext14(SequenceContext);
3096
+ const sequenceContext = useContext15(SequenceContext);
2810
3097
  const relativeFrom = sequenceContext?.relativeFrom ?? 0;
2811
- const timelineValue = useMemo13(() => {
3098
+ const timelineValue = useMemo14(() => {
2812
3099
  if (!isActive) {
2813
3100
  return timelineContext;
2814
3101
  }
@@ -2823,7 +3110,7 @@ var Freeze = ({
2823
3110
  }
2824
3111
  };
2825
3112
  }, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
2826
- const newSequenceContext = useMemo13(() => {
3113
+ const newSequenceContext = useMemo14(() => {
2827
3114
  if (!sequenceContext) {
2828
3115
  return null;
2829
3116
  }
@@ -2835,15 +3122,15 @@ var Freeze = ({
2835
3122
  cumulatedFrom: 0
2836
3123
  };
2837
3124
  }, [sequenceContext, isActive]);
2838
- return /* @__PURE__ */ jsx10(TimelineContext.Provider, {
3125
+ return /* @__PURE__ */ jsx11(TimelineContext.Provider, {
2839
3126
  value: timelineValue,
2840
- children: /* @__PURE__ */ jsx10(SequenceContext.Provider, {
3127
+ children: /* @__PURE__ */ jsx11(SequenceContext.Provider, {
2841
3128
  value: newSequenceContext,
2842
3129
  children
2843
3130
  })
2844
3131
  });
2845
3132
  };
2846
- var PremountContext = createContext14({
3133
+ var PremountContext = createContext15({
2847
3134
  premountFramesRemaining: 0
2848
3135
  });
2849
3136
  var sequenceStyleSchema = {
@@ -2910,154 +3197,6 @@ var sequenceSchemaDefaultLayoutNone = {
2910
3197
  default: "none"
2911
3198
  }
2912
3199
  };
2913
- var nodePathToString = (nodePath) => {
2914
- return nodePath.join(".");
2915
- };
2916
- var SequenceManager = React12.createContext({
2917
- registerSequence: () => {
2918
- throw new Error("SequenceManagerContext not initialized");
2919
- },
2920
- unregisterSequence: () => {
2921
- throw new Error("SequenceManagerContext not initialized");
2922
- },
2923
- sequences: []
2924
- });
2925
- var SequenceVisibilityToggleContext = React12.createContext({
2926
- hidden: {},
2927
- setHidden: () => {
2928
- throw new Error("SequenceVisibilityToggle not initialized");
2929
- }
2930
- });
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({
2952
- setDragOverrides: () => {
2953
- throw new Error("VisualModeSettersContext not initialized");
2954
- },
2955
- clearDragOverrides: () => {
2956
- throw new Error("VisualModeSettersContext not initialized");
2957
- },
2958
- setCodeValues: () => {
2959
- throw new Error("VisualModeSettersContext not initialized");
2960
- }
2961
- });
2962
- var SequenceManagerProvider = ({ children }) => {
2963
- const [sequences, setSequences] = useState4([]);
2964
- const [hidden, setHidden] = useState4({});
2965
- const [dragOverrides, setControlOverrides] = useState4({});
2966
- const controlOverridesRef = useRef6(dragOverrides);
2967
- controlOverridesRef.current = dragOverrides;
2968
- const [codeValues, setCodeValuesMapState] = useState4({});
2969
- const setDragOverrides = useCallback5((nodePath, key, value) => {
2970
- setControlOverrides((prev) => ({
2971
- ...prev,
2972
- [nodePathToString(nodePath)]: {
2973
- ...prev[nodePathToString(nodePath)],
2974
- [key]: value
2975
- }
2976
- }));
2977
- }, []);
2978
- const clearDragOverrides = useCallback5((nodePath) => {
2979
- setControlOverrides((prev) => {
2980
- const key = nodePathToString(nodePath);
2981
- if (!prev[key]) {
2982
- return prev;
2983
- }
2984
- const next = { ...prev };
2985
- delete next[key];
2986
- return next;
2987
- });
2988
- }, []);
2989
- const setCodeValues = useCallback5((nodePath, values) => {
2990
- setCodeValuesMapState((prev) => {
2991
- const key = nodePathToString(nodePath);
2992
- const prevKey = prev[key];
2993
- const newKey = values(prevKey);
2994
- if (prevKey === newKey) {
2995
- return prev;
2996
- }
2997
- return { ...prev, [key]: newKey };
2998
- });
2999
- }, []);
3000
- const registerSequence = useCallback5((seq) => {
3001
- setSequences((seqs) => {
3002
- return [...seqs, seq];
3003
- });
3004
- }, []);
3005
- const unregisterSequence = useCallback5((seq) => {
3006
- setSequences((seqs) => seqs.filter((s) => s.id !== seq));
3007
- }, []);
3008
- const sequenceContext = useMemo14(() => {
3009
- return {
3010
- registerSequence,
3011
- sequences,
3012
- unregisterSequence
3013
- };
3014
- }, [registerSequence, sequences, unregisterSequence]);
3015
- const hiddenContext = useMemo14(() => {
3016
- return {
3017
- hidden,
3018
- setHidden
3019
- };
3020
- }, [hidden]);
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(() => {
3038
- return {
3039
- setDragOverrides,
3040
- clearDragOverrides,
3041
- setCodeValues
3042
- };
3043
- }, [setDragOverrides, clearDragOverrides, setCodeValues]);
3044
- return /* @__PURE__ */ jsx11(SequenceManager.Provider, {
3045
- value: sequenceContext,
3046
- children: /* @__PURE__ */ jsx11(SequenceVisibilityToggleContext.Provider, {
3047
- value: hiddenContext,
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
- })
3057
- })
3058
- })
3059
- });
3060
- };
3061
3200
  var ENABLE_V5_BREAKING_CHANGES = false;
3062
3201
  var deleteNestedKey = (obj, keysToRemove) => {
3063
3202
  for (const key of keysToRemove) {
@@ -3131,14 +3270,6 @@ var getFlatSchemaWithAllKeys = (schema) => {
3131
3270
  }
3132
3271
  return out;
3133
3272
  };
3134
- var OverrideIdsToNodePathsGettersContext = createContext15({
3135
- overrideIdToNodePathMappings: {}
3136
- });
3137
- var OverrideIdsToNodePathsSettersContext = createContext15({
3138
- setOverrideIdToNodePath: () => {
3139
- throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
3140
- }
3141
- });
3142
3273
  var findPropsToDelete = ({
3143
3274
  schema,
3144
3275
  key,
@@ -3171,7 +3302,6 @@ var findPropsToDelete = ({
3171
3302
  };
3172
3303
  var getEffectiveVisualModeValue = ({
3173
3304
  codeValue,
3174
- runtimeValue,
3175
3305
  dragOverrideValue,
3176
3306
  defaultValue,
3177
3307
  shouldResortToDefaultValueIfUndefined = false
@@ -3179,12 +3309,6 @@ var getEffectiveVisualModeValue = ({
3179
3309
  if (dragOverrideValue !== undefined) {
3180
3310
  return dragOverrideValue;
3181
3311
  }
3182
- if (!codeValue) {
3183
- return runtimeValue;
3184
- }
3185
- if (!codeValue.canUpdate) {
3186
- return runtimeValue;
3187
- }
3188
3312
  if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
3189
3313
  return defaultValue;
3190
3314
  }
@@ -3221,9 +3345,8 @@ var computeEffectiveSchemaValuesDotNotation = ({
3221
3345
  if (field?.type === "hidden") {
3222
3346
  continue;
3223
3347
  }
3224
- const value = getEffectiveVisualModeValue({
3348
+ const value = codeValueStatus === null || codeValueStatus.canUpdate === false ? currentValue[key] : getEffectiveVisualModeValue({
3225
3349
  codeValue: codeValueStatus,
3226
- runtimeValue: currentValue[key],
3227
3350
  dragOverrideValue: overrideValues[key],
3228
3351
  defaultValue: field?.default,
3229
3352
  shouldResortToDefaultValueIfUndefined: false
@@ -3309,9 +3432,9 @@ var wrapInSchema = (Component, schema) => {
3309
3432
  ref
3310
3433
  });
3311
3434
  }
3312
- const { getCodeValues } = useContext15(VisualModeCodeValuesContext);
3313
- const { getDragOverrides } = useContext15(VisualModeDragOverridesContext);
3314
- const nodePathMapping = useContext15(OverrideIdsToNodePathsGettersContext);
3435
+ const { codeValues } = useContext16(VisualModeCodeValuesContext);
3436
+ const { getDragOverrides } = useContext16(VisualModeDragOverridesContext);
3437
+ const nodePathMapping = useContext16(OverrideIdsToNodePathsGettersContext);
3315
3438
  if (props._experimentalControls) {
3316
3439
  return React13.createElement(Component, {
3317
3440
  ...props,
@@ -3346,13 +3469,13 @@ var wrapInSchema = (Component, schema) => {
3346
3469
  schema,
3347
3470
  currentValue: currentRuntimeValueDotNotation,
3348
3471
  overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
3349
- propStatus: nodePath === null ? undefined : getCodeValues(nodePath)
3472
+ propStatus: nodePath === null ? undefined : getCodeValuesCtx(codeValues, nodePath)
3350
3473
  });
3351
3474
  }, [
3352
3475
  currentRuntimeValueDotNotation,
3353
3476
  getDragOverrides,
3354
3477
  nodePath,
3355
- getCodeValues
3478
+ codeValues
3356
3479
  ]);
3357
3480
  const activeKeys = selectActiveKeys(schema, valuesDotNotation);
3358
3481
  const mergedProps = mergeValues({
@@ -3389,7 +3512,7 @@ var RegularSequenceRefForwardingFunction = ({
3389
3512
  }, ref) => {
3390
3513
  const { layout = "absolute-fill" } = other;
3391
3514
  const [id] = useState6(() => String(Math.random()));
3392
- const parentSequence = useContext16(SequenceContext);
3515
+ const parentSequence = useContext17(SequenceContext);
3393
3516
  const { rootId } = useTimelineContext();
3394
3517
  const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
3395
3518
  const nonce = useNonce();
@@ -3415,8 +3538,8 @@ var RegularSequenceRefForwardingFunction = ({
3415
3538
  const videoConfig = useVideoConfig();
3416
3539
  const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
3417
3540
  const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
3418
- const { registerSequence, unregisterSequence } = useContext16(SequenceManager);
3419
- const { hidden } = useContext16(SequenceVisibilityToggleContext);
3541
+ const { registerSequence, unregisterSequence } = useContext17(SequenceManager);
3542
+ const { hidden } = useContext17(SequenceVisibilityToggleContext);
3420
3543
  const premounting = useMemo16(() => {
3421
3544
  return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
3422
3545
  }, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
@@ -3559,7 +3682,7 @@ var RegularSequenceRefForwardingFunction = ({
3559
3682
  };
3560
3683
  var RegularSequence = forwardRef3(RegularSequenceRefForwardingFunction);
3561
3684
  var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
3562
- const parentPremountContext = useContext16(PremountContext);
3685
+ const parentPremountContext = useContext17(PremountContext);
3563
3686
  const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
3564
3687
  if (props.layout === "none") {
3565
3688
  throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
@@ -3993,6 +4116,7 @@ var isHtmlInCanvasSupported = () => {
3993
4116
  cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function";
3994
4117
  return cachedSupport;
3995
4118
  };
4119
+ var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";
3996
4120
  function assertHtmlInCanvasDimensions(width, height) {
3997
4121
  if (typeof width !== "number" || typeof height !== "number") {
3998
4122
  throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(width)}, height=${String(height)}.`);
@@ -4030,11 +4154,11 @@ var HtmlInCanvasInner = forwardRef5(({
4030
4154
  durationInFrames,
4031
4155
  ...sequenceProps
4032
4156
  }, ref) => {
4033
- const isInsideAncestorHtmlInCanvas = useContext17(HtmlInCanvasAncestorContext);
4157
+ const isInsideAncestorHtmlInCanvas = useContext18(HtmlInCanvasAncestorContext);
4034
4158
  assertHtmlInCanvasDimensions(width, height);
4035
4159
  const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
4036
4160
  if (!isHtmlInCanvasSupported()) {
4037
- cancelRender2(new Error("HTML in Canvas is not supported. Open this page in Chrome Canary with chrome://flags/#canvas-draw-element enabled."));
4161
+ cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
4038
4162
  }
4039
4163
  const { durationInFrames: videoDuration } = useVideoConfig();
4040
4164
  const resolvedDuration = durationInFrames ?? videoDuration;
@@ -4051,7 +4175,11 @@ var HtmlInCanvasInner = forwardRef5(({
4051
4175
  }, [ref]);
4052
4176
  const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
4053
4177
  const chainState = useEffectChainState();
4054
- const memoizedEffects = useMemoizedEffects(flattenEffects(effects));
4178
+ const memoizedEffects = useMemoizedEffects({
4179
+ effects,
4180
+ overrideId: controls?.overrideId ?? null
4181
+ });
4182
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
4055
4183
  const effectsRef = useRef9(memoizedEffects);
4056
4184
  effectsRef.current = memoizedEffects;
4057
4185
  const frameRef = useRef9(frame);
@@ -4180,7 +4308,7 @@ var HtmlInCanvasInner = forwardRef5(({
4180
4308
  durationInFrames: resolvedDuration,
4181
4309
  name: "<HtmlInCanvas>",
4182
4310
  _experimentalControls: controls,
4183
- _experimentalEffects: memoizedEffects,
4311
+ _experimentalEffects: memoizedEffectDefinitions,
4184
4312
  layout: "none",
4185
4313
  ...sequenceProps,
4186
4314
  children: /* @__PURE__ */ jsx15(HtmlInCanvasAncestorContext.Provider, {
@@ -4292,7 +4420,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
4292
4420
  };
4293
4421
  var ArtifactThumbnail = Symbol("Thumbnail");
4294
4422
  var Artifact = ({ filename, content, downloadBehavior }) => {
4295
- const { registerRenderAsset, unregisterRenderAsset } = useContext18(RenderAssetManager);
4423
+ const { registerRenderAsset, unregisterRenderAsset } = useContext19(RenderAssetManager);
4296
4424
  const env = useRemotionEnvironment();
4297
4425
  const frame = useCurrentFrame();
4298
4426
  const [id] = useState10(() => {
@@ -4482,7 +4610,7 @@ var getSrcWithoutHash = (src) => {
4482
4610
  return src.slice(0, hashIndex);
4483
4611
  };
4484
4612
  var usePreload = (src) => {
4485
- const preloads2 = useContext19(PreloadContext);
4613
+ const preloads2 = useContext20(PreloadContext);
4486
4614
  const hashFragmentIndex = removeAndGetHashFragment(src);
4487
4615
  const withoutHashFragment = getSrcWithoutHash(src);
4488
4616
  if (!preloads2[withoutHashFragment]) {
@@ -5133,7 +5261,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
5133
5261
  const logLevel = useLogLevel();
5134
5262
  const mountTime = useMountTime();
5135
5263
  const env = useRemotionEnvironment();
5136
- const audioCtx = useContext20(SharedAudioContext);
5264
+ const audioCtx = useContext21(SharedAudioContext);
5137
5265
  const audioContext = audioCtx?.audioContext ?? null;
5138
5266
  const resume = audioCtx?.resume;
5139
5267
  const refs = useMemo22(() => {
@@ -5308,8 +5436,8 @@ var useSharedAudio = ({
5308
5436
  premounting,
5309
5437
  postmounting
5310
5438
  }) => {
5311
- const audioCtx = useContext20(SharedAudioContext);
5312
- const tagsCtx = useContext20(SharedAudioTagsContext);
5439
+ const audioCtx = useContext21(SharedAudioContext);
5440
+ const tagsCtx = useContext21(SharedAudioTagsContext);
5313
5441
  const [elem] = useState12(() => {
5314
5442
  if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
5315
5443
  return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
@@ -5488,7 +5616,7 @@ var useVolume = ({
5488
5616
  const audioStuffRef = useRef13(null);
5489
5617
  const currentVolumeRef = useRef13(volume);
5490
5618
  currentVolumeRef.current = volume;
5491
- const sharedAudioContext = useContext21(SharedAudioContext);
5619
+ const sharedAudioContext = useContext22(SharedAudioContext);
5492
5620
  if (!sharedAudioContext) {
5493
5621
  throw new Error("useAmplification must be used within a SharedAudioContext");
5494
5622
  }
@@ -5553,7 +5681,7 @@ var useVolume = ({
5553
5681
  return audioStuffRef;
5554
5682
  };
5555
5683
  var useMediaStartsAt = () => {
5556
- const parentSequence = useContext22(SequenceContext);
5684
+ const parentSequence = useContext23(SequenceContext);
5557
5685
  const startsAt = Math.min(0, parentSequence?.relativeFrom ?? 0);
5558
5686
  return startsAt;
5559
5687
  };
@@ -5642,7 +5770,7 @@ var useBasicMediaInTimeline = ({
5642
5770
  if (!src) {
5643
5771
  throw new Error("No src passed");
5644
5772
  }
5645
- const parentSequence = useContext23(SequenceContext);
5773
+ const parentSequence = useContext24(SequenceContext);
5646
5774
  const [initialVolume] = useState13(() => volume);
5647
5775
  const duration = getTimelineDuration({
5648
5776
  compositionDurationInFrames: sequenceDurationInFrames,
@@ -5709,8 +5837,8 @@ var useImageInTimeline = ({
5709
5837
  loopDisplay,
5710
5838
  controls
5711
5839
  }) => {
5712
- const parentSequence = useContext23(SequenceContext);
5713
- const { registerSequence, unregisterSequence } = useContext23(SequenceManager);
5840
+ const parentSequence = useContext24(SequenceContext);
5841
+ const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
5714
5842
  const { durationInFrames } = useVideoConfig();
5715
5843
  const mediaStartsAt = useMediaStartsAt();
5716
5844
  const { duration, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
@@ -5791,9 +5919,9 @@ var useMediaInTimeline = ({
5791
5919
  postmountDisplay,
5792
5920
  loopDisplay
5793
5921
  }) => {
5794
- const parentSequence = useContext23(SequenceContext);
5922
+ const parentSequence = useContext24(SequenceContext);
5795
5923
  const startsAt = useMediaStartsAt();
5796
- const { registerSequence, unregisterSequence } = useContext23(SequenceManager);
5924
+ const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
5797
5925
  const { durationInFrames } = useVideoConfig();
5798
5926
  const mediaStartsAt = useMediaStartsAt();
5799
5927
  const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
@@ -5953,7 +6081,7 @@ var useBufferManager = (logLevel, mountTime) => {
5953
6081
  };
5954
6082
  var BufferingContextReact = React21.createContext(null);
5955
6083
  var BufferingProvider = ({ children }) => {
5956
- const { logLevel, mountTime } = useContext24(LogLevelContext);
6084
+ const { logLevel, mountTime } = useContext25(LogLevelContext);
5957
6085
  const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
5958
6086
  return /* @__PURE__ */ jsx21(BufferingContextReact.Provider, {
5959
6087
  value: bufferManager,
@@ -5983,7 +6111,7 @@ var useIsPlayerBuffering = (bufferManager) => {
5983
6111
  return isBuffering;
5984
6112
  };
5985
6113
  var useBufferState = () => {
5986
- const buffer = useContext25(BufferingContextReact);
6114
+ const buffer = useContext26(BufferingContextReact);
5987
6115
  const logLevel = useLogLevel();
5988
6116
  const addBlock = buffer ? buffer.addBlock : null;
5989
6117
  return useMemo25(() => ({
@@ -6394,6 +6522,23 @@ function checkInfiniteRange(name, arr) {
6394
6522
  }
6395
6523
  }
6396
6524
  }
6525
+ function assertValidInterpolateEasingOption(easing, inputRangeLength) {
6526
+ if (easing === undefined) {
6527
+ return;
6528
+ }
6529
+ if (typeof easing === "function") {
6530
+ return;
6531
+ }
6532
+ const expectedLength = inputRangeLength - 1;
6533
+ if (easing.length !== expectedLength) {
6534
+ throw new Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${expectedLength}), but got length ${easing.length}`);
6535
+ }
6536
+ for (let i = 0;i < easing.length; i++) {
6537
+ if (typeof easing[i] !== "function") {
6538
+ throw new Error(`easing[${i}] must be a function`);
6539
+ }
6540
+ }
6541
+ }
6397
6542
  function interpolate(input, inputRange, outputRange, options) {
6398
6543
  if (typeof input === "undefined") {
6399
6544
  throw new Error("input can not be undefined");
@@ -6410,7 +6555,18 @@ function interpolate(input, inputRange, outputRange, options) {
6410
6555
  checkInfiniteRange("inputRange", inputRange);
6411
6556
  checkInfiniteRange("outputRange", outputRange);
6412
6557
  checkValidInputRange(inputRange);
6413
- const easing = options?.easing ?? ((num) => num);
6558
+ assertValidInterpolateEasingOption(options?.easing, inputRange.length);
6559
+ const easingOption = options?.easing;
6560
+ const defaultEasing = (num) => num;
6561
+ const resolveEasingForSegment = (segmentIndex) => {
6562
+ if (easingOption === undefined) {
6563
+ return defaultEasing;
6564
+ }
6565
+ if (typeof easingOption === "function") {
6566
+ return easingOption;
6567
+ }
6568
+ return easingOption[segmentIndex];
6569
+ };
6414
6570
  let extrapolateLeft = "extend";
6415
6571
  if (options?.extrapolateLeft !== undefined) {
6416
6572
  extrapolateLeft = options.extrapolateLeft;
@@ -6424,7 +6580,7 @@ function interpolate(input, inputRange, outputRange, options) {
6424
6580
  }
6425
6581
  const range = findRange(input, inputRange);
6426
6582
  return interpolateFunction(input, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
6427
- easing,
6583
+ easing: resolveEasingForSegment(range),
6428
6584
  extrapolateLeft,
6429
6585
  extrapolateRight
6430
6586
  });
@@ -6500,7 +6656,7 @@ var useMediaPlayback = ({
6500
6656
  const frame = useCurrentFrame();
6501
6657
  const absoluteFrame = useTimelinePosition();
6502
6658
  const [playing] = usePlayingState();
6503
- const buffering = useContext26(BufferingContextReact);
6659
+ const buffering = useContext27(BufferingContextReact);
6504
6660
  const { fps } = useVideoConfig();
6505
6661
  const mediaStartsAt = useMediaStartsAt();
6506
6662
  const lastSeekDueToShift = useRef17(null);
@@ -6788,15 +6944,15 @@ var SetMediaVolumeContext = createContext22({
6788
6944
  }
6789
6945
  });
6790
6946
  var useMediaVolumeState = () => {
6791
- const { mediaVolume } = useContext27(MediaVolumeContext);
6792
- const { setMediaVolume } = useContext27(SetMediaVolumeContext);
6947
+ const { mediaVolume } = useContext28(MediaVolumeContext);
6948
+ const { setMediaVolume } = useContext28(SetMediaVolumeContext);
6793
6949
  return useMemo27(() => {
6794
6950
  return [mediaVolume, setMediaVolume];
6795
6951
  }, [mediaVolume, setMediaVolume]);
6796
6952
  };
6797
6953
  var useMediaMutedState = () => {
6798
- const { mediaMuted } = useContext27(MediaVolumeContext);
6799
- const { setMediaMuted } = useContext27(SetMediaVolumeContext);
6954
+ const { mediaMuted } = useContext28(MediaVolumeContext);
6955
+ const { setMediaMuted } = useContext28(SetMediaVolumeContext);
6800
6956
  return useMemo27(() => {
6801
6957
  return [mediaMuted, setMediaMuted];
6802
6958
  }, [mediaMuted, setMediaMuted]);
@@ -6846,12 +7002,12 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
6846
7002
  const [mediaVolume] = useMediaVolumeState();
6847
7003
  const [mediaMuted] = useMediaMutedState();
6848
7004
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
6849
- const { hidden } = useContext28(SequenceVisibilityToggleContext);
7005
+ const { hidden } = useContext29(SequenceVisibilityToggleContext);
6850
7006
  if (!src) {
6851
7007
  throw new TypeError("No 'src' was passed to <Html5Audio>.");
6852
7008
  }
6853
7009
  const preloadedSrc = usePreload(src);
6854
- const sequenceContext = useContext28(SequenceContext);
7010
+ const sequenceContext = useContext29(SequenceContext);
6855
7011
  const [timelineId] = useState16(() => String(Math.random()));
6856
7012
  const isSequenceHidden = hidden[timelineId] ?? false;
6857
7013
  const userPreferredVolume = evaluateVolume({
@@ -7006,8 +7162,8 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
7006
7162
  const absoluteFrame = useTimelinePosition();
7007
7163
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
7008
7164
  const frame = useCurrentFrame();
7009
- const sequenceContext = useContext29(SequenceContext);
7010
- const { registerRenderAsset, unregisterRenderAsset } = useContext29(RenderAssetManager);
7165
+ const sequenceContext = useContext30(SequenceContext);
7166
+ const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
7011
7167
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
7012
7168
  const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
7013
7169
  props.src,
@@ -7116,7 +7272,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
7116
7272
  };
7117
7273
  var AudioForRendering = forwardRef7(AudioForRenderingRefForwardingFunction);
7118
7274
  var AudioRefForwardingFunction = (props, ref) => {
7119
- const audioTagsContext = useContext30(SharedAudioTagsContext);
7275
+ const audioTagsContext = useContext31(SharedAudioTagsContext);
7120
7276
  const {
7121
7277
  startFrom,
7122
7278
  endAt,
@@ -7135,7 +7291,7 @@ var AudioRefForwardingFunction = (props, ref) => {
7135
7291
  if (environment.isClientSideRendering) {
7136
7292
  throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
7137
7293
  }
7138
- const { durations, setDurations } = useContext30(DurationsContext);
7294
+ const { durations, setDurations } = useContext31(DurationsContext);
7139
7295
  if (typeof props.src !== "string") {
7140
7296
  throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
7141
7297
  }
@@ -7293,7 +7449,7 @@ var ImgInner = ({
7293
7449
  const imageRef = useRef20(null);
7294
7450
  const errors = useRef20({});
7295
7451
  const { delayPlayback } = useBufferState();
7296
- const sequenceContext = useContext31(SequenceContext);
7452
+ const sequenceContext = useContext32(SequenceContext);
7297
7453
  const [timelineId] = useState18(() => String(Math.random()));
7298
7454
  if (!src) {
7299
7455
  throw new Error('No "src" prop was passed to <Img>.');
@@ -7583,16 +7739,15 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
7583
7739
  }
7584
7740
  `;
7585
7741
  };
7586
- var defineEffect = (definition) => definition;
7587
- var createDescriptor = (definition, params) => {
7742
+ var createEffect = (definition) => {
7588
7743
  const widened = definition;
7589
- return {
7744
+ const factory = (params = {}) => ({
7590
7745
  definition: widened,
7591
7746
  params,
7592
- stack: new Error().stack,
7593
7747
  effectKey: widened.calculateKey(params),
7594
7748
  memoized: false
7595
- };
7749
+ });
7750
+ return factory;
7596
7751
  };
7597
7752
  var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
7598
7753
  var getPreviewDomElement = () => {
@@ -7618,7 +7773,7 @@ var waitForRoot = (fn) => {
7618
7773
  };
7619
7774
  var MediaEnabledContext = createContext23(null);
7620
7775
  var useVideoEnabled = () => {
7621
- const context = useContext32(MediaEnabledContext);
7776
+ const context = useContext33(MediaEnabledContext);
7622
7777
  if (!context) {
7623
7778
  return window.remotion_videoEnabled;
7624
7779
  }
@@ -7628,7 +7783,7 @@ var useVideoEnabled = () => {
7628
7783
  return context.videoEnabled;
7629
7784
  };
7630
7785
  var useAudioEnabled = () => {
7631
- const context = useContext32(MediaEnabledContext);
7786
+ const context = useContext33(MediaEnabledContext);
7632
7787
  if (!context) {
7633
7788
  return window.remotion_audioEnabled;
7634
7789
  }
@@ -7950,9 +8105,9 @@ var OffthreadVideoForRendering = ({
7950
8105
  const frame = useCurrentFrame();
7951
8106
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
7952
8107
  const videoConfig = useUnsafeVideoConfig();
7953
- const sequenceContext = useContext33(SequenceContext);
8108
+ const sequenceContext = useContext34(SequenceContext);
7954
8109
  const mediaStartsAt = useMediaStartsAt();
7955
- const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
8110
+ const { registerRenderAsset, unregisterRenderAsset } = useContext34(RenderAssetManager);
7956
8111
  if (!src) {
7957
8112
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
7958
8113
  }
@@ -8164,7 +8319,7 @@ class MediaPlaybackError extends Error {
8164
8319
  }
8165
8320
  }
8166
8321
  var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
8167
- const context = useContext34(SharedAudioContext);
8322
+ const context = useContext35(SharedAudioContext);
8168
8323
  if (!context) {
8169
8324
  throw new Error("SharedAudioContext not found");
8170
8325
  }
@@ -8220,8 +8375,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
8220
8375
  }
8221
8376
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
8222
8377
  const { fps, durationInFrames } = useVideoConfig();
8223
- const parentSequence = useContext34(SequenceContext);
8224
- const { hidden } = useContext34(SequenceVisibilityToggleContext);
8378
+ const parentSequence = useContext35(SequenceContext);
8379
+ const { hidden } = useContext35(SequenceVisibilityToggleContext);
8225
8380
  const logLevel = useLogLevel();
8226
8381
  const mountTime = useMountTime();
8227
8382
  const [timelineId] = useState21(() => String(Math.random()));
@@ -8746,13 +8901,15 @@ var Internals = {
8746
8901
  useEffectChainState,
8747
8902
  runEffectChain,
8748
8903
  useMemoizedEffects,
8749
- defineEffect,
8750
- createDescriptor,
8904
+ useMemoizedEffectDefinitions,
8905
+ createEffect,
8751
8906
  computeEffectiveSchemaValuesDotNotation,
8752
8907
  OverrideIdsToNodePathsGettersContext,
8753
8908
  OverrideIdsToNodePathsSettersContext,
8754
8909
  findPropsToDelete,
8755
- flattenEffects
8910
+ makeSequencePropsSubscriptionKey,
8911
+ getCodeValuesCtx,
8912
+ getEffectCodeValuesCtx
8756
8913
  };
8757
8914
  var NUMBER = "[-+]?\\d*\\.?\\d+";
8758
8915
  var PERCENTAGE = NUMBER + "%";
@@ -9347,13 +9504,13 @@ var VideoForRenderingForwardFunction = ({
9347
9504
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
9348
9505
  const videoConfig = useUnsafeVideoConfig();
9349
9506
  const videoRef = useRef23(null);
9350
- const sequenceContext = useContext35(SequenceContext);
9507
+ const sequenceContext = useContext36(SequenceContext);
9351
9508
  const mediaStartsAt = useMediaStartsAt();
9352
9509
  const environment = useRemotionEnvironment();
9353
9510
  const logLevel = useLogLevel();
9354
9511
  const mountTime = useMountTime();
9355
9512
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
9356
- const { registerRenderAsset, unregisterRenderAsset } = useContext35(RenderAssetManager);
9513
+ const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
9357
9514
  const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
9358
9515
  props2.src,
9359
9516
  sequenceContext?.cumulatedFrom,
@@ -9563,7 +9720,7 @@ var VideoForwardingFunction = (props2, ref) => {
9563
9720
  if (environment.isClientSideRendering) {
9564
9721
  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");
9565
9722
  }
9566
- const { durations, setDurations } = useContext36(DurationsContext);
9723
+ const { durations, setDurations } = useContext37(DurationsContext);
9567
9724
  if (typeof ref === "string") {
9568
9725
  throw new Error("string refs are not supported");
9569
9726
  }
@@ -15814,10 +15971,10 @@ import React11 from "react";
15814
15971
  import * as React82 from "react";
15815
15972
  import { jsx as jsx132 } from "react/jsx-runtime";
15816
15973
  import * as React9 from "react";
15817
- import * as React10 from "react";
15974
+ import * as React102 from "react";
15818
15975
  import { Fragment as Fragment5, jsx as jsx142 } from "react/jsx-runtime";
15819
15976
  import { jsx as jsx152 } from "react/jsx-runtime";
15820
- import * as React122 from "react";
15977
+ import * as React12 from "react";
15821
15978
  import { jsx as jsx162 } from "react/jsx-runtime";
15822
15979
  import * as React16 from "react";
15823
15980
  import * as React132 from "react";
@@ -16712,43 +16869,43 @@ function composeRefs2(...refs) {
16712
16869
  function useComposedRefs2(...refs) {
16713
16870
  return React9.useCallback(composeRefs2(...refs), refs);
16714
16871
  }
16715
- var Slot2 = React10.forwardRef((props, forwardedRef) => {
16872
+ var Slot2 = React102.forwardRef((props, forwardedRef) => {
16716
16873
  const { children, ...slotProps } = props;
16717
- const childrenArray = React10.Children.toArray(children);
16874
+ const childrenArray = React102.Children.toArray(children);
16718
16875
  const slottable = childrenArray.find(isSlottable2);
16719
16876
  if (slottable) {
16720
16877
  const newElement = slottable.props.children;
16721
16878
  const newChildren = childrenArray.map((child) => {
16722
16879
  if (child === slottable) {
16723
- if (React10.Children.count(newElement) > 1)
16724
- return React10.Children.only(null);
16725
- return React10.isValidElement(newElement) ? newElement.props.children : null;
16880
+ if (React102.Children.count(newElement) > 1)
16881
+ return React102.Children.only(null);
16882
+ return React102.isValidElement(newElement) ? newElement.props.children : null;
16726
16883
  } else {
16727
16884
  return child;
16728
16885
  }
16729
16886
  });
16730
- return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children: React10.isValidElement(newElement) ? React10.cloneElement(newElement, undefined, newChildren) : null });
16887
+ return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children: React102.isValidElement(newElement) ? React102.cloneElement(newElement, undefined, newChildren) : null });
16731
16888
  }
16732
16889
  return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children });
16733
16890
  });
16734
16891
  Slot2.displayName = "Slot";
16735
- var SlotClone = React10.forwardRef((props, forwardedRef) => {
16892
+ var SlotClone = React102.forwardRef((props, forwardedRef) => {
16736
16893
  const { children, ...slotProps } = props;
16737
- if (React10.isValidElement(children)) {
16894
+ if (React102.isValidElement(children)) {
16738
16895
  const childrenRef = getElementRef2(children);
16739
- return React10.cloneElement(children, {
16896
+ return React102.cloneElement(children, {
16740
16897
  ...mergeProps2(slotProps, children.props),
16741
16898
  ref: forwardedRef ? composeRefs2(forwardedRef, childrenRef) : childrenRef
16742
16899
  });
16743
16900
  }
16744
- return React10.Children.count(children) > 1 ? React10.Children.only(null) : null;
16901
+ return React102.Children.count(children) > 1 ? React102.Children.only(null) : null;
16745
16902
  });
16746
16903
  SlotClone.displayName = "SlotClone";
16747
16904
  var Slottable2 = ({ children }) => {
16748
16905
  return /* @__PURE__ */ jsx142(Fragment5, { children });
16749
16906
  };
16750
16907
  function isSlottable2(child) {
16751
- return React10.isValidElement(child) && child.type === Slottable2;
16908
+ return React102.isValidElement(child) && child.type === Slottable2;
16752
16909
  }
16753
16910
  function mergeProps2(slotProps, childProps) {
16754
16911
  const overrideProps = { ...childProps };
@@ -16838,9 +16995,9 @@ function createCollection(name) {
16838
16995
  createCollectionScope
16839
16996
  ];
16840
16997
  }
16841
- var DirectionContext = React122.createContext(undefined);
16998
+ var DirectionContext = React12.createContext(undefined);
16842
16999
  function useDirection(localDir) {
16843
- const globalDir = React122.useContext(DirectionContext);
17000
+ const globalDir = React12.useContext(DirectionContext);
16844
17001
  return localDir || globalDir || "ltr";
16845
17002
  }
16846
17003
  var NODES = [
@@ -24863,17 +25020,18 @@ var CommunityStats = () => /* @__PURE__ */ jsxs12("div", {
24863
25020
  var CommunityStats_default = CommunityStats;
24864
25021
 
24865
25022
  // ../player/dist/esm/index.mjs
25023
+ import { createContext as createContext32 } from "react";
24866
25024
  import { jsx as jsx56, jsxs as jsxs13 } from "react/jsx-runtime";
24867
25025
  import { jsx as jsx214, jsxs as jsxs24, Fragment as Fragment11 } from "react/jsx-runtime";
24868
25026
  import React56 from "react";
24869
25027
  import { useContext as useContext210, useEffect as useEffect42, useState as useState40 } from "react";
24870
- import { useContext as useContext43, useLayoutEffect as useLayoutEffect17 } from "react";
25028
+ import { useContext as useContext44, useLayoutEffect as useLayoutEffect17 } from "react";
24871
25029
  import { jsx as jsx313 } from "react/jsx-runtime";
24872
25030
  import { useEffect as useEffect24, useState as useState24 } from "react";
24873
25031
  import { useLayoutEffect as useLayoutEffect23 } from "react";
24874
- import { useContext as useContext44, useEffect as useEffect52, useRef as useRef42 } from "react";
25032
+ import { useContext as useContext45, useEffect as useEffect52, useRef as useRef42 } from "react";
24875
25033
  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";
25034
+ import { useCallback as useCallback34, useContext as useContext39, useMemo as useMemo51, useRef as useRef43, useState as useState310 } from "react";
24877
25035
  import { useEffect as useEffect43, useRef as useRef310 } from "react";
24878
25036
  import { useCallback as useCallback24, useEffect as useEffect62, useMemo as useMemo212, useState as useState42 } from "react";
24879
25037
  import {
@@ -24885,7 +25043,7 @@ import {
24885
25043
  useRef as useRef112,
24886
25044
  useState as useState132
24887
25045
  } from "react";
24888
- import React102, {
25046
+ import React103, {
24889
25047
  Suspense as Suspense2,
24890
25048
  forwardRef as forwardRef33,
24891
25049
  useCallback as useCallback102,
@@ -24986,6 +25144,23 @@ function checkInfiniteRange2(name, arr) {
24986
25144
  }
24987
25145
  }
24988
25146
  }
25147
+ function assertValidInterpolateEasingOption2(easing, inputRangeLength) {
25148
+ if (easing === undefined) {
25149
+ return;
25150
+ }
25151
+ if (typeof easing === "function") {
25152
+ return;
25153
+ }
25154
+ const expectedLength = inputRangeLength - 1;
25155
+ if (easing.length !== expectedLength) {
25156
+ throw new Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${expectedLength}), but got length ${easing.length}`);
25157
+ }
25158
+ for (let i = 0;i < easing.length; i++) {
25159
+ if (typeof easing[i] !== "function") {
25160
+ throw new Error(`easing[${i}] must be a function`);
25161
+ }
25162
+ }
25163
+ }
24989
25164
  function interpolate3(input, inputRange, outputRange, options2) {
24990
25165
  if (typeof input === "undefined") {
24991
25166
  throw new Error("input can not be undefined");
@@ -25002,7 +25177,18 @@ function interpolate3(input, inputRange, outputRange, options2) {
25002
25177
  checkInfiniteRange2("inputRange", inputRange);
25003
25178
  checkInfiniteRange2("outputRange", outputRange);
25004
25179
  checkValidInputRange2(inputRange);
25005
- const easing = options2?.easing ?? ((num) => num);
25180
+ assertValidInterpolateEasingOption2(options2?.easing, inputRange.length);
25181
+ const easingOption = options2?.easing;
25182
+ const defaultEasing = (num) => num;
25183
+ const resolveEasingForSegment = (segmentIndex) => {
25184
+ if (easingOption === undefined) {
25185
+ return defaultEasing;
25186
+ }
25187
+ if (typeof easingOption === "function") {
25188
+ return easingOption;
25189
+ }
25190
+ return easingOption[segmentIndex];
25191
+ };
25006
25192
  let extrapolateLeft = "extend";
25007
25193
  if (options2?.extrapolateLeft !== undefined) {
25008
25194
  extrapolateLeft = options2.extrapolateLeft;
@@ -25016,7 +25202,7 @@ function interpolate3(input, inputRange, outputRange, options2) {
25016
25202
  }
25017
25203
  const range = findRange2(input, inputRange);
25018
25204
  return interpolateFunction2(input, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
25019
- easing,
25205
+ easing: resolveEasingForSegment(range),
25020
25206
  extrapolateLeft,
25021
25207
  extrapolateRight
25022
25208
  });
@@ -25570,6 +25756,70 @@ var proResProfileOptions = [
25570
25756
  "light",
25571
25757
  "proxy"
25572
25758
  ];
25759
+ var sequenceStyleSchema2 = {
25760
+ "style.translate": {
25761
+ type: "translate",
25762
+ step: 1,
25763
+ default: "0px 0px",
25764
+ description: "Offset"
25765
+ },
25766
+ "style.scale": {
25767
+ type: "number",
25768
+ min: 0.05,
25769
+ max: 100,
25770
+ step: 0.01,
25771
+ default: 1,
25772
+ description: "Scale"
25773
+ },
25774
+ "style.rotate": {
25775
+ type: "rotation",
25776
+ step: 1,
25777
+ default: "0deg",
25778
+ description: "Rotation"
25779
+ },
25780
+ "style.opacity": {
25781
+ type: "number",
25782
+ min: 0,
25783
+ max: 1,
25784
+ step: 0.01,
25785
+ default: 1,
25786
+ description: "Opacity"
25787
+ },
25788
+ premountFor: {
25789
+ type: "number",
25790
+ default: 0,
25791
+ description: "Premount For",
25792
+ min: 0,
25793
+ step: 1
25794
+ },
25795
+ postmountFor: {
25796
+ type: "hidden"
25797
+ },
25798
+ styleWhilePremounted: {
25799
+ type: "hidden"
25800
+ },
25801
+ styleWhilePostmounted: {
25802
+ type: "hidden"
25803
+ }
25804
+ };
25805
+ var sequenceSchema2 = {
25806
+ layout: {
25807
+ type: "enum",
25808
+ default: "absolute-fill",
25809
+ description: "Layout",
25810
+ variants: {
25811
+ "absolute-fill": sequenceStyleSchema2,
25812
+ none: {}
25813
+ }
25814
+ }
25815
+ };
25816
+ var sequenceSchemaDefaultLayoutNone2 = {
25817
+ ...sequenceSchema2,
25818
+ layout: {
25819
+ ...sequenceSchema2.layout,
25820
+ default: "none"
25821
+ }
25822
+ };
25573
25823
  var ENABLE_V5_BREAKING_CHANGES2 = false;
25574
25824
  var validateFrame2 = ({
25575
25825
  allowFloats,
@@ -25733,7 +25983,8 @@ var NoReactInternals = {
25733
25983
  FILE_TOKEN: FILE_TOKEN2,
25734
25984
  validateCodec: validateCodec2,
25735
25985
  proResProfileOptions,
25736
- findPropsToDelete: findPropsToDelete2
25986
+ findPropsToDelete: findPropsToDelete2,
25987
+ sequenceSchema: sequenceSchema2
25737
25988
  };
25738
25989
 
25739
25990
  // ../player/dist/esm/index.mjs
@@ -25758,6 +26009,21 @@ import { useContext as useContext62, useMemo as useMemo152 } from "react";
25758
26009
  import { jsx as jsx153 } from "react/jsx-runtime";
25759
26010
  import { jsx as jsx163 } from "react/jsx-runtime";
25760
26011
  "use client";
26012
+ if (typeof createContext32 !== "function") {
26013
+ const err = [
26014
+ 'Remotion requires React.createContext, but it is "undefined".',
26015
+ 'If you are in a React Server Component, turn it into a client component by adding "use client" at the top of the file.',
26016
+ "",
26017
+ "Before:",
26018
+ ' import {Player} from "@remotion/player";',
26019
+ "",
26020
+ "After:",
26021
+ ' "use client";',
26022
+ ' import {Player} from "@remotion/player";'
26023
+ ];
26024
+ throw new Error(err.join(`
26025
+ `));
26026
+ }
25761
26027
  var ICON_SIZE2 = 25;
25762
26028
  var fullscreenIconSize = 16;
25763
26029
  var PlayIcon = () => {
@@ -26190,7 +26456,7 @@ class ThumbnailEmitter {
26190
26456
  };
26191
26457
  }
26192
26458
  var useBufferStateEmitter = (emitter) => {
26193
- const bufferManager = useContext43(Internals.BufferingContextReact);
26459
+ const bufferManager = useContext44(Internals.BufferingContextReact);
26194
26460
  if (!bufferManager) {
26195
26461
  throw new Error("BufferingContextReact not found");
26196
26462
  }
@@ -26273,21 +26539,21 @@ var usePlayer = () => {
26273
26539
  const playStart = useRef43(frame);
26274
26540
  const setFrame = Internals.Timeline.useTimelineSetFrame();
26275
26541
  const setTimelinePosition = Internals.Timeline.useTimelineSetFrame();
26276
- const audioContext = useContext38(Internals.SharedAudioContext);
26277
- const audioTagsContext = useContext38(Internals.SharedAudioTagsContext);
26542
+ const audioContext = useContext39(Internals.SharedAudioContext);
26543
+ const audioTagsContext = useContext39(Internals.SharedAudioTagsContext);
26278
26544
  const { audioAndVideoTags } = Internals.useTimelineContext();
26279
26545
  const frameRef = useRef43(frame);
26280
26546
  frameRef.current = frame;
26281
26547
  const video = Internals.useVideo();
26282
26548
  const config = Internals.useUnsafeVideoConfig();
26283
- const emitter = useContext38(PlayerEventEmitterContext);
26549
+ const emitter = useContext39(PlayerEventEmitterContext);
26284
26550
  const lastFrame = (config?.durationInFrames ?? 1) - 1;
26285
26551
  const isLastFrame = frame === lastFrame;
26286
26552
  const isFirstFrame = frame === 0;
26287
26553
  if (!emitter) {
26288
26554
  throw new TypeError("Expected Player event emitter context");
26289
26555
  }
26290
- const bufferingContext = useContext38(Internals.BufferingContextReact);
26556
+ const bufferingContext = useContext39(Internals.BufferingContextReact);
26291
26557
  if (!bufferingContext) {
26292
26558
  throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
26293
26559
  }
@@ -26635,11 +26901,11 @@ var usePlayback = ({
26635
26901
  const frame = Internals.Timeline.useTimelinePosition();
26636
26902
  const { playing, pause, emitter, isPlaying } = usePlayer();
26637
26903
  const setFrame = Internals.Timeline.useTimelineSetFrame();
26638
- const sharedAudioContext = useContext44(Internals.SharedAudioContext);
26904
+ const sharedAudioContext = useContext45(Internals.SharedAudioContext);
26639
26905
  const logLevel = Internals.useLogLevel();
26640
26906
  const isBackgroundedRef = useIsBackgrounded();
26641
26907
  const lastTimeUpdateTimestamp = useRef42(0);
26642
- const context = useContext44(Internals.BufferingContextReact);
26908
+ const context = useContext45(Internals.BufferingContextReact);
26643
26909
  if (!context) {
26644
26910
  throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
26645
26911
  }
@@ -28082,7 +28348,7 @@ var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFull
28082
28348
  }, [doubleClickToFullscreen, handleDoubleClick, handlePointerDown, onClick]);
28083
28349
  return returnValue;
28084
28350
  };
28085
- var reactVersion = React102.version.split(".")[0];
28351
+ var reactVersion = React103.version.split(".")[0];
28086
28352
  if (reactVersion === "0") {
28087
28353
  throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
28088
28354
  }
@@ -30057,7 +30323,7 @@ var UNDERLAY_RED = curriedTransparentize$1(0.9, RED);
30057
30323
  var BLUE_TEXT = curriedDarken$1(0.3, "#42e9f5");
30058
30324
 
30059
30325
  // src/components/homepage/layout/use-color-mode.tsx
30060
- import React57, { useContext as useContext45, useMemo as useMemo53 } from "react";
30326
+ import React57, { useContext as useContext46, useMemo as useMemo53 } from "react";
30061
30327
  import { jsx as jsx57 } from "react/jsx-runtime";
30062
30328
  var Context = React57.createContext(undefined);
30063
30329
  var ColorModeProvider = ({
@@ -30074,7 +30340,7 @@ var ColorModeProvider = ({
30074
30340
  });
30075
30341
  };
30076
30342
  function useColorMode() {
30077
- const context = useContext45(Context);
30343
+ const context = useContext46(Context);
30078
30344
  if (context === null || context === undefined) {
30079
30345
  throw new Error("ColorModeProvider");
30080
30346
  }
@@ -30088,9 +30354,9 @@ import { useContext as useContext212, useEffect as useEffect44, useMemo as useMe
30088
30354
  import { ALL_FORMATS, Input as Input2, UrlSource } from "mediabunny";
30089
30355
  import { AudioBufferSink, InputDisposedError } from "mediabunny";
30090
30356
  import { CanvasSink } from "mediabunny";
30091
- import { useContext as useContext47, useLayoutEffect as useLayoutEffect18 } from "react";
30357
+ import { useContext as useContext48, useLayoutEffect as useLayoutEffect18 } from "react";
30092
30358
  import { jsx as jsx58 } from "react/jsx-runtime";
30093
- import { useContext as useContext310, useLayoutEffect as useLayoutEffect24, useMemo as useMemo213, useState as useState210 } from "react";
30359
+ import { useContext as useContext311, useLayoutEffect as useLayoutEffect24, useMemo as useMemo213, useState as useState210 } from "react";
30094
30360
  import React211 from "react";
30095
30361
  import {
30096
30362
  ALL_FORMATS as ALL_FORMATS2,
@@ -30106,7 +30372,7 @@ import { jsx as jsx216 } from "react/jsx-runtime";
30106
30372
  import { jsx as jsx315 } from "react/jsx-runtime";
30107
30373
  import { useMemo as useMemo63, useState as useState63 } from "react";
30108
30374
  import {
30109
- useContext as useContext46,
30375
+ useContext as useContext47,
30110
30376
  useEffect as useEffect210,
30111
30377
  useLayoutEffect as useLayoutEffect34,
30112
30378
  useMemo as useMemo412,
@@ -31873,7 +32139,7 @@ var useCommonEffects = ({
31873
32139
  logLevel,
31874
32140
  label: label3
31875
32141
  }) => {
31876
- const sharedAudioContext = useContext47(Internals.SharedAudioContext);
32142
+ const sharedAudioContext = useContext48(Internals.SharedAudioContext);
31877
32143
  useLayoutEffect18(() => {
31878
32144
  const mediaPlayer = mediaPlayerRef.current;
31879
32145
  if (!mediaPlayer)
@@ -34149,7 +34415,7 @@ var AudioForRendering2 = ({
34149
34415
  const frame = useCurrentFrame();
34150
34416
  const absoluteFrame = Internals.useTimelinePosition();
34151
34417
  const videoConfig = Internals.useUnsafeVideoConfig();
34152
- const { registerRenderAsset, unregisterRenderAsset } = useContext310(Internals.RenderAssetManager);
34418
+ const { registerRenderAsset, unregisterRenderAsset } = useContext311(Internals.RenderAssetManager);
34153
34419
  const startsAt = Internals.useMediaStartsAt();
34154
34420
  const environment = useRemotionEnvironment();
34155
34421
  if (!videoConfig) {
@@ -34161,7 +34427,7 @@ var AudioForRendering2 = ({
34161
34427
  const { fps } = videoConfig;
34162
34428
  const { delayRender: delayRender2, continueRender } = useDelayRender();
34163
34429
  const [replaceWithHtml5Audio, setReplaceWithHtml5Audio] = useState210(false);
34164
- const sequenceContext = useContext310(Internals.SequenceContext);
34430
+ const sequenceContext = useContext311(Internals.SequenceContext);
34165
34431
  const id = useMemo213(() => `media-audio-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
34166
34432
  src,
34167
34433
  sequenceContext?.cumulatedFrom,
@@ -34514,7 +34780,7 @@ var VideoForPreviewAssertedShowing = ({
34514
34780
  const [shouldFallbackToNativeVideo, setShouldFallbackToNativeVideo] = useState43(false);
34515
34781
  const [playing] = Timeline2.usePlayingState();
34516
34782
  const { playbackRate: globalPlaybackRate } = Internals.usePlaybackRate();
34517
- const sharedAudioContext = useContext46(SharedAudioContext22);
34783
+ const sharedAudioContext = useContext47(SharedAudioContext22);
34518
34784
  const buffer = useBufferState();
34519
34785
  const [mediaMuted] = useMediaMutedState22();
34520
34786
  const [mediaVolume] = useMediaVolumeState22();
@@ -34535,7 +34801,7 @@ var VideoForPreviewAssertedShowing = ({
34535
34801
  effectChainStateRef.current = effectChainState;
34536
34802
  const frameRef = useRef210(frame);
34537
34803
  frameRef.current = frame;
34538
- const parentSequence = useContext46(SequenceContext22);
34804
+ const parentSequence = useContext47(SequenceContext22);
34539
34805
  const isPremounting = Boolean(parentSequence?.premounting);
34540
34806
  const isPostmounting = Boolean(parentSequence?.postmounting);
34541
34807
  const sequenceOffset = ((parentSequence?.cumulatedFrom ?? 0) + (parentSequence?.relativeFrom ?? 0)) / videoConfig.fps;
@@ -34543,7 +34809,7 @@ var VideoForPreviewAssertedShowing = ({
34543
34809
  const currentTimeRef = useRef210(currentTime);
34544
34810
  currentTimeRef.current = currentTime;
34545
34811
  const preloadedSrc = usePreload22(src);
34546
- const buffering = useContext46(Internals.BufferingContextReact);
34812
+ const buffering = useContext47(Internals.BufferingContextReact);
34547
34813
  if (!buffering) {
34548
34814
  throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
34549
34815
  }
@@ -35335,7 +35601,11 @@ var VideoInner = ({
35335
35601
  type: "video",
35336
35602
  data: basicInfo
35337
35603
  }), [basicInfo]);
35338
- const memoizedEffects = Internals.useMemoizedEffects(Internals.flattenEffects(_experimentalEffects ?? []));
35604
+ const memoizedEffects = Internals.useMemoizedEffects({
35605
+ effects: _experimentalEffects ?? [],
35606
+ overrideId: controls?.overrideId ?? null
35607
+ });
35608
+ const memoizedEffectDefinitions = Internals.useMemoizedEffectDefinitions(_experimentalEffects ?? []);
35339
35609
  if (sequenceDurationInFrames === 0) {
35340
35610
  return null;
35341
35611
  }
@@ -35348,7 +35618,7 @@ var VideoInner = ({
35348
35618
  name: name ?? "<Video>",
35349
35619
  _experimentalControls: controls,
35350
35620
  _remotionInternalLoopDisplay: loopDisplay,
35351
- _experimentalEffects: memoizedEffects,
35621
+ _experimentalEffects: memoizedEffectDefinitions,
35352
35622
  showInTimeline: showInTimeline ?? true,
35353
35623
  children: /* @__PURE__ */ jsx65(InnerVideo, {
35354
35624
  audioStreamIndex: audioStreamIndex ?? 0,
@@ -36687,7 +36957,7 @@ import {
36687
36957
  import { BufferTarget, StreamTarget } from "mediabunny";
36688
36958
 
36689
36959
  // ../core/dist/esm/version.mjs
36690
- var VERSION2 = "4.0.461";
36960
+ var VERSION2 = "4.0.462";
36691
36961
 
36692
36962
  // ../web-renderer/dist/esm/index.mjs
36693
36963
  import { AudioSample, VideoSample } from "mediabunny";
@@ -43669,6 +43939,7 @@ var listOfRemotionPackages = [
43669
43939
  "@remotion/serverless",
43670
43940
  "@remotion/serverless-client",
43671
43941
  "@remotion/skills",
43942
+ "@remotion/skills-evals",
43672
43943
  "@remotion/studio-server",
43673
43944
  "@remotion/studio-shared",
43674
43945
  "@remotion/studio",