@remotion/promo-pages 4.0.463 → 4.0.464

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/team.js CHANGED
@@ -1,15 +1,26 @@
1
+ var __create = Object.create;
2
+ var __getProtoOf = Object.getPrototypeOf;
1
3
  var __defProp = Object.defineProperty;
2
- var __returnValue = (v) => v;
3
- function __exportSetter(name, newValue) {
4
- this[name] = __returnValue.bind(null, newValue);
5
- }
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __toESM = (mod, isNodeMode, target) => {
7
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
8
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
9
+ for (let key of __getOwnPropNames(mod))
10
+ if (!__hasOwnProp.call(to, key))
11
+ __defProp(to, key, {
12
+ get: () => mod[key],
13
+ enumerable: true
14
+ });
15
+ return to;
16
+ };
6
17
  var __export = (target, all) => {
7
18
  for (var name in all)
8
19
  __defProp(target, name, {
9
20
  get: all[name],
10
21
  enumerable: true,
11
22
  configurable: true,
12
- set: __exportSetter.bind(all, name)
23
+ set: (newValue) => all[name] = () => newValue
13
24
  });
14
25
  };
15
26
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -206,7 +217,7 @@ var TitleTeamCards = () => {
206
217
  import * as React24 from "react";
207
218
  import * as React3 from "react";
208
219
  import { Fragment as Fragment2, jsx as jsx38 } from "react/jsx-runtime";
209
- import React52, { useCallback as useCallback22, useRef as useRef24, useState as useState22 } from "react";
220
+ import React52, { useCallback as useCallback24, useRef as useRef25, useState as useState22 } from "react";
210
221
 
211
222
  // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
212
223
  function r(e) {
@@ -1548,7 +1559,7 @@ var getDefaultConfig = () => {
1548
1559
  var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
1549
1560
 
1550
1561
  // ../design/dist/esm/index.mjs
1551
- import React33, { useEffect as useEffect20, useMemo as useMemo38, useState as useState23 } from "react";
1562
+ import React33, { useEffect as useEffect20, useMemo as useMemo39, useState as useState21 } from "react";
1552
1563
 
1553
1564
  // ../paths/dist/esm/index.mjs
1554
1565
  var cutLInstruction = ({
@@ -5913,13 +5924,6 @@ import * as React6 from "react";
5913
5924
  import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
5914
5925
  import { useContext as useContext8, useMemo as useMemo7 } from "react";
5915
5926
  import { jsx as jsx72 } from "react/jsx-runtime";
5916
- import {
5917
- forwardRef as forwardRef4,
5918
- useCallback as useCallback6,
5919
- useEffect as useEffect5,
5920
- useMemo as useMemo16,
5921
- useState as useState6
5922
- } from "react";
5923
5927
  import {
5924
5928
  forwardRef as forwardRef3,
5925
5929
  useContext as useContext17,
@@ -5927,6 +5931,7 @@ import {
5927
5931
  useMemo as useMemo14,
5928
5932
  useState as useState5
5929
5933
  } from "react";
5934
+ import { useRef as useRef6 } from "react";
5930
5935
  import { useContext as useContext14, useMemo as useMemo11 } from "react";
5931
5936
  import { createContext as createContext12 } from "react";
5932
5937
  import { useContext as useContext10, useMemo as useMemo9 } from "react";
@@ -5949,18 +5954,25 @@ import React12, { forwardRef as forwardRef2, useState as useState4, useContext a
5949
5954
  import { useContext as useContext15, useRef as useRef5 } from "react";
5950
5955
  import { createContext as createContext15 } from "react";
5951
5956
  import { jsx as jsx112 } from "react/jsx-runtime";
5952
- import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef6 } from "react";
5957
+ import {
5958
+ forwardRef as forwardRef4,
5959
+ useEffect as useEffect5,
5960
+ useImperativeHandle as useImperativeHandle2,
5961
+ useLayoutEffect as useLayoutEffect2,
5962
+ useRef as useRef9,
5963
+ useState as useState6
5964
+ } from "react";
5965
+ import React14, { useCallback as useCallback6, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
5966
+ import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef7 } from "react";
5953
5967
  import { jsx as jsx12 } from "react/jsx-runtime";
5968
+ import { jsx as jsx13 } from "react/jsx-runtime";
5954
5969
  import {
5955
5970
  forwardRef as forwardRef5,
5971
+ useCallback as useCallback7,
5956
5972
  useEffect as useEffect6,
5957
- useImperativeHandle as useImperativeHandle2,
5958
- useLayoutEffect as useLayoutEffect2,
5959
- useRef as useRef8,
5973
+ useMemo as useMemo17,
5960
5974
  useState as useState7
5961
5975
  } from "react";
5962
- import React15, { useCallback as useCallback7, useImperativeHandle, useRef as useRef7 } from "react";
5963
- import { jsx as jsx13 } from "react/jsx-runtime";
5964
5976
  import { jsx as jsx14 } from "react/jsx-runtime";
5965
5977
  import {
5966
5978
  createContext as createContext16,
@@ -5968,78 +5980,78 @@ import {
5968
5980
  useCallback as useCallback8,
5969
5981
  useContext as useContext18,
5970
5982
  useLayoutEffect as useLayoutEffect3,
5971
- useMemo as useMemo17,
5972
- useRef as useRef9,
5973
- useState as useState8
5983
+ useMemo as useMemo18,
5984
+ useRef as useRef10
5974
5985
  } from "react";
5975
5986
  import { jsx as jsx15 } from "react/jsx-runtime";
5976
- import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
5987
+ import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState9 } from "react";
5977
5988
  import {
5978
5989
  createContext as createContext17,
5979
5990
  useCallback as useCallback9,
5980
5991
  useImperativeHandle as useImperativeHandle3,
5981
5992
  useLayoutEffect as useLayoutEffect4,
5982
- useMemo as useMemo18,
5983
- useRef as useRef10,
5984
- useState as useState9
5993
+ useMemo as useMemo19,
5994
+ useRef as useRef11,
5995
+ useState as useState8
5985
5996
  } from "react";
5986
5997
  import { jsx as jsx16 } from "react/jsx-runtime";
5987
- import { forwardRef as forwardRef9, useCallback as useCallback14, useContext as useContext31 } from "react";
5988
- import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
5998
+ import { forwardRef as forwardRef9, useCallback as useCallback15, useContext as useContext31 } from "react";
5999
+ import React17, { createContext as createContext18, useMemo as useMemo20 } from "react";
5989
6000
  import { jsx as jsx17 } from "react/jsx-runtime";
5990
6001
  import { useContext as useContext20 } from "react";
5991
- import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
6002
+ import { createContext as createContext19, useEffect as useEffect7, useState as useState10 } from "react";
5992
6003
  import { jsx as jsx18 } from "react/jsx-runtime";
5993
- import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
6004
+ import { createContext as createContext20, useMemo as useMemo21, useReducer } from "react";
5994
6005
  import { jsx as jsx19 } from "react/jsx-runtime";
6006
+ import { useCallback as useCallback14 } from "react";
5995
6007
  import React23, {
5996
6008
  forwardRef as forwardRef7,
5997
6009
  useContext as useContext29,
5998
6010
  useEffect as useEffect14,
5999
6011
  useImperativeHandle as useImperativeHandle4,
6000
- useMemo as useMemo28,
6001
- useRef as useRef18,
6002
- useState as useState16
6012
+ useMemo as useMemo29,
6013
+ useRef as useRef19,
6014
+ useState as useState15
6003
6015
  } from "react";
6004
- import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
6016
+ import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef14 } from "react";
6005
6017
  import React20, {
6006
6018
  createContext as createContext21,
6007
6019
  createRef as createRef2,
6008
6020
  useCallback as useCallback10,
6009
6021
  useContext as useContext21,
6010
- useMemo as useMemo22,
6011
- useRef as useRef11,
6012
- useState as useState12
6022
+ useMemo as useMemo23,
6023
+ useRef as useRef12,
6024
+ useState as useState11
6013
6025
  } from "react";
6014
- import { useMemo as useMemo21 } from "react";
6026
+ import { useMemo as useMemo22 } from "react";
6015
6027
  import { jsx as jsx20, jsxs as jsxs22 } from "react/jsx-runtime";
6016
- import { useRef as useRef12 } from "react";
6017
- import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState13 } from "react";
6028
+ import { useRef as useRef13 } from "react";
6029
+ import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo24, useState as useState12 } from "react";
6018
6030
  import { useContext as useContext23 } from "react";
6019
6031
  import {
6020
6032
  useCallback as useCallback13,
6021
6033
  useContext as useContext27,
6022
6034
  useEffect as useEffect12,
6023
6035
  useLayoutEffect as useLayoutEffect8,
6024
- useRef as useRef17
6036
+ useRef as useRef18
6025
6037
  } from "react";
6026
- import { useCallback as useCallback12, useMemo as useMemo26, useRef as useRef15 } from "react";
6027
- import { useContext as useContext26, useMemo as useMemo25 } from "react";
6038
+ import { useCallback as useCallback12, useMemo as useMemo27, useRef as useRef16 } from "react";
6039
+ import { useContext as useContext26, useMemo as useMemo26 } from "react";
6028
6040
  import React21, {
6029
6041
  useCallback as useCallback11,
6030
6042
  useContext as useContext25,
6031
6043
  useEffect as useEffect9,
6032
6044
  useLayoutEffect as useLayoutEffect7,
6033
- useMemo as useMemo24,
6034
- useRef as useRef14,
6035
- useState as useState14
6045
+ useMemo as useMemo25,
6046
+ useRef as useRef15,
6047
+ useState as useState13
6036
6048
  } from "react";
6037
6049
  import { jsx as jsx21 } from "react/jsx-runtime";
6038
6050
  import React22 from "react";
6039
- import { useEffect as useEffect10, useState as useState15 } from "react";
6040
- import { useEffect as useEffect11, useRef as useRef16 } from "react";
6051
+ import { useEffect as useEffect10, useState as useState14 } from "react";
6052
+ import { useEffect as useEffect11, useRef as useRef17 } from "react";
6041
6053
  import { useEffect as useEffect13 } from "react";
6042
- import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
6054
+ import { createContext as createContext22, useContext as useContext28, useMemo as useMemo28 } from "react";
6043
6055
  import { jsx as jsx222 } from "react/jsx-runtime";
6044
6056
  import {
6045
6057
  forwardRef as forwardRef8,
@@ -6047,47 +6059,47 @@ import {
6047
6059
  useEffect as useEffect15,
6048
6060
  useImperativeHandle as useImperativeHandle5,
6049
6061
  useLayoutEffect as useLayoutEffect9,
6050
- useMemo as useMemo29,
6051
- useRef as useRef19
6062
+ useMemo as useMemo30,
6063
+ useRef as useRef20
6052
6064
  } from "react";
6053
6065
  import { jsx as jsx232 } from "react/jsx-runtime";
6054
6066
  import { jsx as jsx24 } from "react/jsx-runtime";
6055
- import { forwardRef as forwardRef10, useCallback as useCallback15, useState as useState17 } from "react";
6067
+ import { forwardRef as forwardRef10, useCallback as useCallback16, useState as useState16 } from "react";
6056
6068
  import { jsx as jsx25 } from "react/jsx-runtime";
6057
6069
  import {
6058
- useCallback as useCallback16,
6070
+ useCallback as useCallback17,
6059
6071
  useContext as useContext32,
6060
6072
  useImperativeHandle as useImperativeHandle6,
6061
6073
  useLayoutEffect as useLayoutEffect10,
6062
- useRef as useRef20,
6063
- useState as useState18
6074
+ useRef as useRef21,
6075
+ useState as useState17
6064
6076
  } from "react";
6065
6077
  import { jsx as jsx26 } from "react/jsx-runtime";
6066
6078
  import { createRef as createRef3 } from "react";
6067
6079
  import React28 from "react";
6068
6080
  import {
6069
- useCallback as useCallback17,
6081
+ useCallback as useCallback18,
6070
6082
  useImperativeHandle as useImperativeHandle7,
6071
- useMemo as useMemo30,
6072
- useRef as useRef21,
6073
- useState as useState19
6083
+ useMemo as useMemo31,
6084
+ useRef as useRef22,
6085
+ useState as useState18
6074
6086
  } from "react";
6075
6087
  import { jsx as jsx27 } from "react/jsx-runtime";
6076
6088
  import React29 from "react";
6077
- import { useMemo as useMemo322 } from "react";
6078
- import { createContext as createContext23, useContext as useContext33, useMemo as useMemo31 } from "react";
6089
+ import { useMemo as useMemo33 } from "react";
6090
+ import { createContext as createContext23, useContext as useContext33, useMemo as useMemo322 } from "react";
6079
6091
  import { jsx as jsx28 } from "react/jsx-runtime";
6080
6092
  import { jsx as jsx29 } from "react/jsx-runtime";
6081
6093
  import React31 from "react";
6082
6094
  import React32, { createContext as createContext24 } from "react";
6083
- import { useCallback as useCallback19 } from "react";
6095
+ import { useCallback as useCallback21 } from "react";
6084
6096
  import {
6085
- useCallback as useCallback18,
6097
+ useCallback as useCallback19,
6086
6098
  useContext as useContext34,
6087
6099
  useEffect as useEffect16,
6088
6100
  useLayoutEffect as useLayoutEffect11,
6089
- useMemo as useMemo33,
6090
- useState as useState20
6101
+ useMemo as useMemo34,
6102
+ useState as useState19
6091
6103
  } from "react";
6092
6104
  import { jsx as jsx30 } from "react/jsx-runtime";
6093
6105
  import React34, {
@@ -6095,45 +6107,42 @@ import React34, {
6095
6107
  useContext as useContext35,
6096
6108
  useEffect as useEffect18,
6097
6109
  useImperativeHandle as useImperativeHandle8,
6098
- useMemo as useMemo34,
6099
- useRef as useRef22,
6100
- useState as useState21
6110
+ useMemo as useMemo35,
6111
+ useRef as useRef23,
6112
+ useState as useState20,
6113
+ useCallback as useCallback20
6101
6114
  } from "react";
6102
6115
  import { useEffect as useEffect17 } from "react";
6103
6116
  import { jsx as jsx31 } from "react/jsx-runtime";
6104
6117
  import { jsx as jsx322 } from "react/jsx-runtime";
6105
- import React36, { useMemo as useMemo35 } from "react";
6118
+ import React36, { useMemo as useMemo36 } from "react";
6106
6119
  import { jsx as jsx332 } from "react/jsx-runtime";
6107
- import { Children, forwardRef as forwardRef12, useMemo as useMemo36 } from "react";
6120
+ import { Children, forwardRef as forwardRef12, useMemo as useMemo37 } from "react";
6108
6121
  import React37 from "react";
6109
6122
  import React38, { createContext as createContext25 } from "react";
6110
6123
  import { jsx as jsx34 } from "react/jsx-runtime";
6111
6124
  import { jsx as jsx35 } from "react/jsx-runtime";
6112
6125
  import React40 from "react";
6113
- import { forwardRef as forwardRef14, useCallback as useCallback20, useContext as useContext37 } from "react";
6126
+ import { forwardRef as forwardRef14, useCallback as useCallback22, useContext as useContext37 } from "react";
6114
6127
  import {
6115
6128
  forwardRef as forwardRef13,
6116
6129
  useContext as useContext36,
6117
6130
  useEffect as useEffect19,
6118
6131
  useImperativeHandle as useImperativeHandle9,
6119
6132
  useLayoutEffect as useLayoutEffect12,
6120
- useMemo as useMemo37,
6121
- useRef as useRef23
6133
+ useMemo as useMemo38,
6134
+ useRef as useRef24
6122
6135
  } from "react";
6123
6136
  import { jsx as jsx36 } from "react/jsx-runtime";
6124
6137
  import { jsx as jsx37 } from "react/jsx-runtime";
6125
6138
  var __defProp2 = Object.defineProperty;
6126
- var __returnValue2 = (v) => v;
6127
- function __exportSetter2(name, newValue) {
6128
- this[name] = __returnValue2.bind(null, newValue);
6129
- }
6130
6139
  var __export2 = (target, all) => {
6131
6140
  for (var name in all)
6132
6141
  __defProp2(target, name, {
6133
6142
  get: all[name],
6134
6143
  enumerable: true,
6135
6144
  configurable: true,
6136
- set: __exportSetter2.bind(all, name)
6145
+ set: (newValue) => all[name] = () => newValue
6137
6146
  });
6138
6147
  };
6139
6148
  if (typeof createContext !== "function") {
@@ -7198,75 +7207,33 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
7198
7207
  var addSequenceStackTraces = (component) => {
7199
7208
  componentsToAddStacksTo.push(component);
7200
7209
  };
7201
- var sequenceStyleSchema = {
7202
- "style.translate": {
7203
- type: "translate",
7204
- step: 1,
7205
- default: "0px 0px",
7206
- description: "Offset"
7207
- },
7208
- "style.scale": {
7209
- type: "number",
7210
- min: 0.05,
7211
- max: 100,
7212
- step: 0.01,
7213
- default: 1,
7214
- description: "Scale"
7215
- },
7216
- "style.rotate": {
7217
- type: "rotation",
7218
- step: 1,
7219
- default: "0deg",
7220
- description: "Rotation"
7221
- },
7222
- "style.opacity": {
7223
- type: "number",
7224
- min: 0,
7225
- max: 1,
7226
- step: 0.01,
7227
- default: 1,
7228
- description: "Opacity"
7229
- },
7230
- premountFor: {
7231
- type: "number",
7232
- default: 0,
7233
- description: "Premount For",
7234
- min: 0,
7235
- step: 1
7236
- },
7237
- postmountFor: {
7238
- type: "hidden"
7239
- },
7240
- styleWhilePremounted: {
7241
- type: "hidden"
7242
- },
7243
- styleWhilePostmounted: {
7244
- type: "hidden"
7210
+ var VERSION = "4.0.464";
7211
+ var checkMultipleRemotionVersions = () => {
7212
+ if (typeof globalThis === "undefined") {
7213
+ return;
7245
7214
  }
7246
- };
7247
- var hiddenField = {
7248
- type: "boolean",
7249
- default: false,
7250
- description: "Hidden"
7251
- };
7252
- var sequenceSchema = {
7253
- hidden: hiddenField,
7254
- layout: {
7255
- type: "enum",
7256
- default: "absolute-fill",
7257
- description: "Layout",
7258
- variants: {
7259
- "absolute-fill": sequenceStyleSchema,
7260
- none: {}
7215
+ const set = () => {
7216
+ globalThis.remotion_imported = VERSION;
7217
+ if (typeof window !== "undefined") {
7218
+ window.remotion_imported = VERSION;
7261
7219
  }
7220
+ };
7221
+ const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
7222
+ if (alreadyImported) {
7223
+ if (alreadyImported === VERSION) {
7224
+ return;
7225
+ }
7226
+ if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
7227
+ set();
7228
+ return;
7229
+ }
7230
+ throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
7231
+ VERSION,
7232
+ typeof alreadyImported === "string" ? alreadyImported : "an older version"
7233
+ ].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
7234
+ Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
7262
7235
  }
7263
- };
7264
- var sequenceSchemaDefaultLayoutNone = {
7265
- ...sequenceSchema,
7266
- layout: {
7267
- ...sequenceSchema.layout,
7268
- default: "none"
7269
- }
7236
+ set();
7270
7237
  };
7271
7238
  var SequenceContext = createContext12(null);
7272
7239
  var exports_timeline_position_state = {};
@@ -7602,6 +7569,82 @@ var Freeze = ({
7602
7569
  var PremountContext = createContext14({
7603
7570
  premountFramesRemaining: 0
7604
7571
  });
7572
+ var sequenceVisualStyleSchema = {
7573
+ "style.translate": {
7574
+ type: "translate",
7575
+ step: 1,
7576
+ default: "0px 0px",
7577
+ description: "Offset"
7578
+ },
7579
+ "style.scale": {
7580
+ type: "number",
7581
+ min: 0.05,
7582
+ max: 100,
7583
+ step: 0.01,
7584
+ default: 1,
7585
+ description: "Scale"
7586
+ },
7587
+ "style.rotate": {
7588
+ type: "rotation",
7589
+ step: 1,
7590
+ default: "0deg",
7591
+ description: "Rotation"
7592
+ },
7593
+ "style.opacity": {
7594
+ type: "number",
7595
+ min: 0,
7596
+ max: 1,
7597
+ step: 0.01,
7598
+ default: 1,
7599
+ description: "Opacity"
7600
+ }
7601
+ };
7602
+ var sequencePremountSchema = {
7603
+ premountFor: {
7604
+ type: "number",
7605
+ default: 0,
7606
+ description: "Premount For",
7607
+ min: 0,
7608
+ step: 1
7609
+ },
7610
+ postmountFor: {
7611
+ type: "hidden"
7612
+ },
7613
+ styleWhilePremounted: {
7614
+ type: "hidden"
7615
+ },
7616
+ styleWhilePostmounted: {
7617
+ type: "hidden"
7618
+ }
7619
+ };
7620
+ var sequenceStyleSchema = {
7621
+ ...sequenceVisualStyleSchema,
7622
+ ...sequencePremountSchema
7623
+ };
7624
+ var hiddenField = {
7625
+ type: "boolean",
7626
+ default: false,
7627
+ description: "Hidden"
7628
+ };
7629
+ var sequenceSchema = {
7630
+ hidden: hiddenField,
7631
+ layout: {
7632
+ type: "enum",
7633
+ default: "absolute-fill",
7634
+ description: "Layout",
7635
+ variants: {
7636
+ "absolute-fill": sequenceStyleSchema,
7637
+ none: {}
7638
+ }
7639
+ }
7640
+ };
7641
+ var sequenceSchemaDefaultLayoutNone = {
7642
+ ...sequenceSchema,
7643
+ layout: {
7644
+ ...sequenceSchema.layout,
7645
+ default: "none"
7646
+ }
7647
+ };
7605
7648
  var SequenceManager = React11.createContext({
7606
7649
  registerSequence: () => {
7607
7650
  throw new Error("SequenceManagerContext not initialized");
@@ -8284,7 +8327,8 @@ var RegularSequenceRefForwardingFunction = ({
8284
8327
  }, [name]);
8285
8328
  const env = useRemotionEnvironment();
8286
8329
  const inheritedStack = other?.stack ?? null;
8287
- const [stackDoesntChange] = useState5(() => stack ?? inheritedStack);
8330
+ const stackRef = useRef6(null);
8331
+ stackRef.current = stack ?? inheritedStack;
8288
8332
  useEffect3(() => {
8289
8333
  if (!env.isStudio) {
8290
8334
  return;
@@ -8308,7 +8352,7 @@ var RegularSequenceRefForwardingFunction = ({
8308
8352
  rootId,
8309
8353
  showInTimeline,
8310
8354
  src: isMedia.data.src,
8311
- stack: stackDoesntChange,
8355
+ getStack: () => stackRef.current,
8312
8356
  startMediaFrom: isMedia.data.startMediaFrom,
8313
8357
  volume: isMedia.data.volumes
8314
8358
  });
@@ -8327,7 +8371,7 @@ var RegularSequenceRefForwardingFunction = ({
8327
8371
  showInTimeline,
8328
8372
  nonce: nonce.get(),
8329
8373
  loopDisplay,
8330
- stack: stackDoesntChange,
8374
+ getStack: () => stackRef.current,
8331
8375
  premountDisplay: premountDisplay ?? null,
8332
8376
  postmountDisplay: postmountDisplay ?? null,
8333
8377
  controls: controls ?? null,
@@ -8350,7 +8394,6 @@ var RegularSequenceRefForwardingFunction = ({
8350
8394
  showInTimeline,
8351
8395
  nonce,
8352
8396
  loopDisplay,
8353
- stackDoesntChange,
8354
8397
  premountDisplay,
8355
8398
  postmountDisplay,
8356
8399
  env.isStudio,
@@ -8459,6 +8502,10 @@ var SequenceRefForwardingFunction = (props, ref) => {
8459
8502
  };
8460
8503
  var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
8461
8504
  var Sequence = wrapInSchema(SequenceInner, sequenceSchema);
8505
+ var WEBGL_CONTEXT_DOCS_URL = "https://remotion.dev/docs/troubleshooting/webgl2-context";
8506
+ var webGlContextErrorMessage = (versionLabel, effectName) => `Failed to acquire ${versionLabel} context for ${effectName}. ` + 'Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, ' + 'or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. ' + `See ${WEBGL_CONTEXT_DOCS_URL}`;
8507
+ var createWebGLContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL", effectName));
8508
+ var createWebGL2ContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL2", effectName));
8462
8509
 
8463
8510
  class CanvasPool {
8464
8511
  width;
@@ -8507,7 +8554,7 @@ class CanvasPool {
8507
8554
  preserveDrawingBuffer: true
8508
8555
  });
8509
8556
  if (!ctx) {
8510
- throw new Error("Failed to acquire WebGL2 context for canvas effect");
8557
+ throw createWebGL2ContextError("canvas effect");
8511
8558
  }
8512
8559
  canvas.addEventListener("webglcontextlost", (e) => {
8513
8560
  e.preventDefault();
@@ -8665,216 +8712,36 @@ var runEffectChain = async ({
8665
8712
  if (!lastTarget) {
8666
8713
  return true;
8667
8714
  }
8668
- const outCtx = output.getContext("2d");
8669
- if (!outCtx) {
8670
- throw new Error("Failed to acquire 2D context for output canvas");
8671
- }
8672
- outCtx.clearRect(0, 0, width, height);
8673
- outCtx.drawImage(lastTarget, 0, 0, width, height);
8674
- return true;
8675
- };
8676
- var useEffectChainState = () => {
8677
- const chainStateRef = useRef6(null);
8678
- const sizeRef = useRef6(null);
8679
- useEffect4(() => {
8680
- return () => {
8681
- if (chainStateRef.current) {
8682
- cleanupEffectChainState(chainStateRef.current);
8683
- }
8684
- };
8685
- }, []);
8686
- return useMemo15(() => ({
8687
- get: (width, height) => {
8688
- if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
8689
- if (chainStateRef.current) {
8690
- cleanupEffectChainState(chainStateRef.current);
8691
- }
8692
- chainStateRef.current = createEffectChainState(width, height);
8693
- sizeRef.current = { width, height };
8694
- }
8695
- return chainStateRef.current;
8696
- }
8697
- }), []);
8698
- };
8699
- var solidSchema = {
8700
- color: {
8701
- type: "color",
8702
- default: "#ffffff",
8703
- description: "Color"
8704
- },
8705
- width: {
8706
- type: "number",
8707
- min: 1,
8708
- step: 1,
8709
- default: 1920,
8710
- description: "Width"
8711
- },
8712
- height: {
8713
- type: "number",
8714
- min: 1,
8715
- step: 1,
8716
- default: 1080,
8717
- description: "Height"
8718
- },
8719
- ...sequenceStyleSchema
8720
- };
8721
- var SolidInner = ({
8722
- color,
8723
- width,
8724
- height,
8725
- _experimentalEffects: experimentalEffects = [],
8726
- className,
8727
- style,
8728
- overrideId,
8729
- ref
8730
- }) => {
8731
- const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
8732
- const [outputCanvas, setOutputCanvas] = useState6(null);
8733
- const memoizedEffects = useMemoizedEffects({
8734
- effects: experimentalEffects,
8735
- overrideId: overrideId ?? null
8736
- });
8737
- const sourceCanvas = useMemo16(() => {
8738
- if (typeof document === "undefined") {
8739
- return null;
8740
- }
8741
- const canvas = document.createElement("canvas");
8742
- canvas.width = 1;
8743
- canvas.height = 1;
8744
- return canvas;
8745
- }, []);
8746
- const chainState = useEffectChainState();
8747
- const canvasRef = useCallback6((canvas) => {
8748
- setOutputCanvas(canvas);
8749
- if (typeof ref === "function") {
8750
- ref(canvas);
8751
- } else if (ref) {
8752
- ref.current = canvas;
8753
- }
8754
- }, [ref]);
8755
- useEffect5(() => {
8756
- if (!outputCanvas || !sourceCanvas) {
8757
- return;
8758
- }
8759
- const handle = delayRender2("Solid effect chain");
8760
- if (!chainState) {
8761
- continueRender2(handle);
8762
- return () => {
8763
- continueRender2(handle);
8764
- };
8765
- }
8766
- const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
8767
- if (!ctx) {
8768
- cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
8769
- return;
8770
- }
8771
- ctx.fillStyle = color;
8772
- ctx.fillRect(0, 0, 1, 1);
8773
- runEffectChain({
8774
- state: chainState.get(width, height),
8775
- source: sourceCanvas,
8776
- effects: memoizedEffects,
8777
- output: outputCanvas,
8778
- width,
8779
- height
8780
- }).then((completed) => {
8781
- if (completed) {
8782
- continueRender2(handle);
8783
- }
8784
- }).catch((err) => {
8785
- cancelRender2(err);
8786
- });
8787
- return () => {
8788
- continueRender2(handle);
8789
- };
8790
- }, [
8791
- color,
8792
- outputCanvas,
8793
- sourceCanvas,
8794
- chainState,
8795
- width,
8796
- height,
8797
- delayRender2,
8798
- continueRender2,
8799
- cancelRender2,
8800
- memoizedEffects
8801
- ]);
8802
- return /* @__PURE__ */ jsx12("canvas", {
8803
- ref: canvasRef,
8804
- width,
8805
- height,
8806
- className,
8807
- style
8808
- });
8809
- };
8810
- var SolidOuter = forwardRef4(({
8811
- _experimentalEffects = [],
8812
- _experimentalControls: controls,
8813
- color,
8814
- height,
8815
- width,
8816
- className,
8817
- durationInFrames,
8818
- style,
8819
- name,
8820
- from,
8821
- hidden,
8822
- showInTimeline,
8823
- ...props
8824
- }, ref) => {
8825
- const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
8826
- return /* @__PURE__ */ jsx12(Sequence, {
8827
- layout: "none",
8828
- from,
8829
- hidden,
8830
- showInTimeline,
8831
- _experimentalControls: controls,
8832
- _experimentalEffects: memoizedEffectDefinitions,
8833
- durationInFrames,
8834
- name: name ?? "<Solid>",
8835
- ...props,
8836
- children: /* @__PURE__ */ jsx12(SolidInner, {
8837
- ref,
8838
- overrideId: controls?.overrideId ?? null,
8839
- color,
8840
- height,
8841
- width,
8842
- className,
8843
- style,
8844
- _experimentalEffects
8845
- })
8846
- });
8847
- });
8848
- var Solid = wrapInSchema(SolidOuter, solidSchema);
8849
- Solid.displayName = "Solid";
8850
- addSequenceStackTraces(Solid);
8851
- var VERSION = "4.0.463";
8852
- var checkMultipleRemotionVersions = () => {
8853
- if (typeof globalThis === "undefined") {
8854
- return;
8855
- }
8856
- const set = () => {
8857
- globalThis.remotion_imported = VERSION;
8858
- if (typeof window !== "undefined") {
8859
- window.remotion_imported = VERSION;
8860
- }
8861
- };
8862
- const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
8863
- if (alreadyImported) {
8864
- if (alreadyImported === VERSION) {
8865
- return;
8866
- }
8867
- if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
8868
- set();
8869
- return;
8870
- }
8871
- throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
8872
- VERSION,
8873
- typeof alreadyImported === "string" ? alreadyImported : "an older version"
8874
- ].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
8875
- Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
8715
+ const outCtx = output.getContext("2d");
8716
+ if (!outCtx) {
8717
+ throw new Error("Failed to acquire 2D context for output canvas");
8876
8718
  }
8877
- set();
8719
+ outCtx.clearRect(0, 0, width, height);
8720
+ outCtx.drawImage(lastTarget, 0, 0, width, height);
8721
+ return true;
8722
+ };
8723
+ var useEffectChainState = () => {
8724
+ const chainStateRef = useRef7(null);
8725
+ const sizeRef = useRef7(null);
8726
+ useEffect4(() => {
8727
+ return () => {
8728
+ if (chainStateRef.current) {
8729
+ cleanupEffectChainState(chainStateRef.current);
8730
+ }
8731
+ };
8732
+ }, []);
8733
+ return useMemo15(() => ({
8734
+ get: (width, height) => {
8735
+ if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
8736
+ if (chainStateRef.current) {
8737
+ cleanupEffectChainState(chainStateRef.current);
8738
+ }
8739
+ chainStateRef.current = createEffectChainState(width, height);
8740
+ sizeRef.current = { width, height };
8741
+ }
8742
+ return chainStateRef.current;
8743
+ }
8744
+ }), []);
8878
8745
  };
8879
8746
  var calcArgs = (fit, frameSize, canvasSize) => {
8880
8747
  switch (fit) {
@@ -8924,29 +8791,49 @@ var calcArgs = (fit, frameSize, canvasSize) => {
8924
8791
  throw new Error("Unknown fit: " + fit);
8925
8792
  }
8926
8793
  };
8927
- var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
8928
- const canvasRef = useRef7(null);
8929
- const draw = useCallback7((imageData) => {
8794
+ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects }, ref) => {
8795
+ const canvasRef = useRef8(null);
8796
+ const chainState = useEffectChainState();
8797
+ const sourceCanvas = useMemo16(() => {
8798
+ if (typeof document === "undefined") {
8799
+ return null;
8800
+ }
8801
+ return document.createElement("canvas");
8802
+ }, []);
8803
+ const draw = useCallback6(async (imageData) => {
8930
8804
  const canvas = canvasRef.current;
8931
8805
  const canvasWidth = width ?? imageData.displayWidth;
8932
8806
  const canvasHeight = height ?? imageData.displayHeight;
8933
8807
  if (!canvas) {
8934
8808
  throw new Error("Canvas ref is not set");
8935
8809
  }
8936
- const ctx = canvasRef.current?.getContext("2d");
8937
- if (!ctx) {
8938
- throw new Error("Could not get 2d context");
8810
+ if (!sourceCanvas) {
8811
+ throw new Error("Source canvas is not available");
8939
8812
  }
8940
- canvas.width = canvasWidth;
8941
- canvas.height = canvasHeight;
8942
- ctx.drawImage(imageData, ...calcArgs(fit, {
8813
+ sourceCanvas.width = canvasWidth;
8814
+ sourceCanvas.height = canvasHeight;
8815
+ const sourceCtx = sourceCanvas.getContext("2d");
8816
+ if (!sourceCtx) {
8817
+ throw new Error("Could not get 2d context for source canvas");
8818
+ }
8819
+ sourceCtx.drawImage(imageData, ...calcArgs(fit, {
8943
8820
  height: imageData.displayHeight,
8944
8821
  width: imageData.displayWidth
8945
8822
  }, {
8946
8823
  width: canvasWidth,
8947
8824
  height: canvasHeight
8948
8825
  }));
8949
- }, [fit, height, width]);
8826
+ canvas.width = canvasWidth;
8827
+ canvas.height = canvasHeight;
8828
+ return runEffectChain({
8829
+ state: chainState.get(canvasWidth, canvasHeight),
8830
+ source: sourceCanvas,
8831
+ effects,
8832
+ output: canvas,
8833
+ width: canvasWidth,
8834
+ height: canvasHeight
8835
+ });
8836
+ }, [chainState, effects, fit, height, sourceCanvas, width]);
8950
8837
  useImperativeHandle(ref, () => {
8951
8838
  return {
8952
8839
  draw,
@@ -8965,13 +8852,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
8965
8852
  }
8966
8853
  };
8967
8854
  }, [draw]);
8968
- return /* @__PURE__ */ jsx13("canvas", {
8855
+ return /* @__PURE__ */ jsx12("canvas", {
8969
8856
  ref: canvasRef,
8970
8857
  className,
8971
8858
  style
8972
8859
  });
8973
8860
  };
8974
- var Canvas = React15.forwardRef(CanvasRefForwardingFunction);
8861
+ var Canvas = React14.forwardRef(CanvasRefForwardingFunction);
8975
8862
  var CACHE_SIZE = 5;
8976
8863
  var getActualTime = ({
8977
8864
  loopBehavior,
@@ -9127,10 +9014,10 @@ var animatedImageSchema = {
9127
9014
  default: 1,
9128
9015
  description: "Playback Rate"
9129
9016
  },
9130
- ...sequenceStyleSchema,
9017
+ ...sequenceVisualStyleSchema,
9131
9018
  hidden: hiddenField
9132
9019
  };
9133
- var AnimatedImageContent = forwardRef5(({
9020
+ var AnimatedImageContent = forwardRef4(({
9134
9021
  src,
9135
9022
  width,
9136
9023
  height,
@@ -9138,26 +9025,24 @@ var AnimatedImageContent = forwardRef5(({
9138
9025
  loopBehavior = "loop",
9139
9026
  playbackRate = 1,
9140
9027
  fit = "fill",
9028
+ effects,
9029
+ controls,
9141
9030
  ...props
9142
9031
  }, canvasRef) => {
9143
- const mountState = useRef8({ isMounted: true });
9144
- useEffect6(() => {
9145
- const { current } = mountState;
9146
- current.isMounted = true;
9147
- return () => {
9148
- current.isMounted = false;
9149
- };
9150
- }, []);
9151
9032
  const resolvedSrc = resolveAnimatedImageSource(src);
9152
- const [imageDecoder, setImageDecoder] = useState7(null);
9033
+ const [imageDecoder, setImageDecoder] = useState6(null);
9153
9034
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
9154
- const [decodeHandle] = useState7(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
9035
+ const [decodeHandle] = useState6(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
9155
9036
  const frame = useCurrentFrame();
9156
9037
  const { fps } = useVideoConfig();
9157
9038
  const currentTime = frame / playbackRate / fps;
9158
- const currentTimeRef = useRef8(currentTime);
9039
+ const currentTimeRef = useRef9(currentTime);
9159
9040
  currentTimeRef.current = currentTime;
9160
- const ref = useRef8(null);
9041
+ const ref = useRef9(null);
9042
+ const memoizedEffects = useMemoizedEffects({
9043
+ effects,
9044
+ overrideId: controls?.overrideId ?? null
9045
+ });
9161
9046
  useImperativeHandle2(canvasRef, () => {
9162
9047
  const c = ref.current?.getCanvas();
9163
9048
  if (!c) {
@@ -9165,8 +9050,8 @@ var AnimatedImageContent = forwardRef5(({
9165
9050
  }
9166
9051
  return c;
9167
9052
  }, []);
9168
- const [initialLoopBehavior] = useState7(() => loopBehavior);
9169
- useEffect6(() => {
9053
+ const [initialLoopBehavior] = useState6(() => loopBehavior);
9054
+ useEffect5(() => {
9170
9055
  const controller = new AbortController;
9171
9056
  decodeImage({
9172
9057
  resolvedSrc,
@@ -9203,16 +9088,24 @@ var AnimatedImageContent = forwardRef5(({
9203
9088
  return;
9204
9089
  }
9205
9090
  const delay = delayRender2(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
9206
- imageDecoder.getFrame(currentTime, loopBehavior).then((videoFrame) => {
9207
- if (mountState.current.isMounted) {
9208
- if (videoFrame === null) {
9209
- ref.current?.clear();
9210
- } else {
9211
- ref.current?.draw(videoFrame.frame);
9212
- }
9091
+ let cancelled = false;
9092
+ imageDecoder.getFrame(currentTime, loopBehavior).then(async (videoFrame) => {
9093
+ if (cancelled) {
9094
+ return;
9095
+ }
9096
+ if (videoFrame === null) {
9097
+ ref.current?.clear();
9098
+ continueRender2(delay);
9099
+ return;
9100
+ }
9101
+ const completed = await ref.current?.draw(videoFrame.frame);
9102
+ if (completed && !cancelled) {
9103
+ continueRender2(delay);
9213
9104
  }
9214
- continueRender2(delay);
9215
9105
  }).catch((err) => {
9106
+ if (cancelled) {
9107
+ return;
9108
+ }
9216
9109
  if (onError) {
9217
9110
  onError(err);
9218
9111
  continueRender2(delay);
@@ -9220,6 +9113,10 @@ var AnimatedImageContent = forwardRef5(({
9220
9113
  cancelRender(err);
9221
9114
  }
9222
9115
  });
9116
+ return () => {
9117
+ cancelled = true;
9118
+ continueRender2(delay);
9119
+ };
9223
9120
  }, [
9224
9121
  currentTime,
9225
9122
  imageDecoder,
@@ -9227,13 +9124,18 @@ var AnimatedImageContent = forwardRef5(({
9227
9124
  onError,
9228
9125
  src,
9229
9126
  continueRender2,
9230
- delayRender2
9127
+ delayRender2,
9128
+ memoizedEffects,
9129
+ fit,
9130
+ width,
9131
+ height
9231
9132
  ]);
9232
- return /* @__PURE__ */ jsx14(Canvas, {
9133
+ return /* @__PURE__ */ jsx13(Canvas, {
9233
9134
  ref,
9234
9135
  width,
9235
9136
  height,
9236
9137
  fit,
9138
+ effects: memoizedEffects,
9237
9139
  ...props
9238
9140
  });
9239
9141
  });
@@ -9250,12 +9152,14 @@ var AnimatedImageInner = ({
9250
9152
  className,
9251
9153
  style,
9252
9154
  durationInFrames,
9155
+ _experimentalEffects: effects = [],
9253
9156
  _experimentalControls: controls,
9254
9157
  ref,
9255
9158
  ...sequenceProps
9256
9159
  }) => {
9257
9160
  const { durationInFrames: videoDuration } = useVideoConfig();
9258
9161
  const resolvedDuration = durationInFrames ?? videoDuration;
9162
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
9259
9163
  const animatedImageProps = {
9260
9164
  src,
9261
9165
  width,
@@ -9268,21 +9172,179 @@ var AnimatedImageInner = ({
9268
9172
  className,
9269
9173
  style
9270
9174
  };
9271
- return /* @__PURE__ */ jsx14(Sequence, {
9175
+ return /* @__PURE__ */ jsx13(Sequence, {
9272
9176
  layout: "none",
9273
9177
  durationInFrames: resolvedDuration,
9274
9178
  name: "<AnimatedImage>",
9275
9179
  _experimentalControls: controls,
9180
+ _experimentalEffects: memoizedEffectDefinitions,
9276
9181
  ...sequenceProps,
9277
- children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
9182
+ children: /* @__PURE__ */ jsx13(AnimatedImageContent, {
9278
9183
  ...animatedImageProps,
9279
- ref
9184
+ ref,
9185
+ effects,
9186
+ controls
9280
9187
  })
9281
9188
  });
9282
9189
  };
9283
9190
  var AnimatedImage = wrapInSchema(AnimatedImageInner, animatedImageSchema);
9284
9191
  AnimatedImage.displayName = "AnimatedImage";
9285
9192
  addSequenceStackTraces(AnimatedImage);
9193
+ var solidSchema = {
9194
+ color: {
9195
+ type: "color",
9196
+ default: "transparent",
9197
+ description: "Color"
9198
+ },
9199
+ width: {
9200
+ type: "number",
9201
+ min: 1,
9202
+ step: 1,
9203
+ default: 1920,
9204
+ description: "Width"
9205
+ },
9206
+ height: {
9207
+ type: "number",
9208
+ min: 1,
9209
+ step: 1,
9210
+ default: 1080,
9211
+ description: "Height"
9212
+ },
9213
+ ...sequenceVisualStyleSchema
9214
+ };
9215
+ var SolidInner = ({
9216
+ color,
9217
+ width,
9218
+ height,
9219
+ _experimentalEffects: experimentalEffects = [],
9220
+ className,
9221
+ style,
9222
+ overrideId,
9223
+ ref
9224
+ }) => {
9225
+ const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
9226
+ const [outputCanvas, setOutputCanvas] = useState7(null);
9227
+ const memoizedEffects = useMemoizedEffects({
9228
+ effects: experimentalEffects,
9229
+ overrideId: overrideId ?? null
9230
+ });
9231
+ const sourceCanvas = useMemo17(() => {
9232
+ if (typeof document === "undefined") {
9233
+ return null;
9234
+ }
9235
+ const canvas = document.createElement("canvas");
9236
+ canvas.width = 1;
9237
+ canvas.height = 1;
9238
+ return canvas;
9239
+ }, []);
9240
+ const chainState = useEffectChainState();
9241
+ const canvasRef = useCallback7((canvas) => {
9242
+ setOutputCanvas(canvas);
9243
+ if (typeof ref === "function") {
9244
+ ref(canvas);
9245
+ } else if (ref) {
9246
+ ref.current = canvas;
9247
+ }
9248
+ }, [ref]);
9249
+ useEffect6(() => {
9250
+ if (!outputCanvas || !sourceCanvas) {
9251
+ return;
9252
+ }
9253
+ const handle = delayRender2("Solid effect chain");
9254
+ if (!chainState) {
9255
+ continueRender2(handle);
9256
+ return () => {
9257
+ continueRender2(handle);
9258
+ };
9259
+ }
9260
+ const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
9261
+ if (!ctx) {
9262
+ cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
9263
+ return;
9264
+ }
9265
+ ctx.clearRect(0, 0, 1, 1);
9266
+ if (color !== undefined) {
9267
+ ctx.fillStyle = color;
9268
+ ctx.fillRect(0, 0, 1, 1);
9269
+ }
9270
+ runEffectChain({
9271
+ state: chainState.get(width, height),
9272
+ source: sourceCanvas,
9273
+ effects: memoizedEffects,
9274
+ output: outputCanvas,
9275
+ width,
9276
+ height
9277
+ }).then((completed) => {
9278
+ if (completed) {
9279
+ continueRender2(handle);
9280
+ }
9281
+ }).catch((err) => {
9282
+ cancelRender2(err);
9283
+ });
9284
+ return () => {
9285
+ continueRender2(handle);
9286
+ };
9287
+ }, [
9288
+ color,
9289
+ outputCanvas,
9290
+ sourceCanvas,
9291
+ chainState,
9292
+ width,
9293
+ height,
9294
+ delayRender2,
9295
+ continueRender2,
9296
+ cancelRender2,
9297
+ memoizedEffects
9298
+ ]);
9299
+ return /* @__PURE__ */ jsx14("canvas", {
9300
+ ref: canvasRef,
9301
+ width,
9302
+ height,
9303
+ className,
9304
+ style
9305
+ });
9306
+ };
9307
+ var SolidOuter = forwardRef5(({
9308
+ _experimentalEffects = [],
9309
+ _experimentalControls: controls,
9310
+ color,
9311
+ height,
9312
+ width,
9313
+ className,
9314
+ durationInFrames,
9315
+ style,
9316
+ name,
9317
+ from,
9318
+ hidden,
9319
+ showInTimeline,
9320
+ ...props
9321
+ }, ref) => {
9322
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
9323
+ return /* @__PURE__ */ jsx14(Sequence, {
9324
+ layout: "none",
9325
+ from,
9326
+ hidden,
9327
+ showInTimeline,
9328
+ _experimentalControls: controls,
9329
+ _experimentalEffects: memoizedEffectDefinitions,
9330
+ durationInFrames,
9331
+ name: name ?? "<Solid>",
9332
+ ...props,
9333
+ children: /* @__PURE__ */ jsx14(SolidInner, {
9334
+ ref,
9335
+ overrideId: controls?.overrideId ?? null,
9336
+ color,
9337
+ height,
9338
+ width,
9339
+ className,
9340
+ style,
9341
+ _experimentalEffects
9342
+ })
9343
+ });
9344
+ });
9345
+ var Solid = wrapInSchema(SolidOuter, solidSchema);
9346
+ Solid.displayName = "Solid";
9347
+ addSequenceStackTraces(Solid);
9286
9348
  var cachedSupport = null;
9287
9349
  var isHtmlInCanvasSupported = () => {
9288
9350
  if (cachedSupport !== null) {
@@ -9293,7 +9355,7 @@ var isHtmlInCanvasSupported = () => {
9293
9355
  }
9294
9356
  const canvas = document.createElement("canvas");
9295
9357
  const ctx = canvas.getContext("2d");
9296
- cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function";
9358
+ cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function" && "transferControlToOffscreen" in HTMLCanvasElement.prototype;
9297
9359
  return cachedSupport;
9298
9360
  };
9299
9361
  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).";
@@ -9329,8 +9391,10 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9329
9391
  if (!isHtmlInCanvasSupported()) {
9330
9392
  cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
9331
9393
  }
9332
- const canvas2dRef = useRef9(null);
9333
- const divRef = useRef9(null);
9394
+ const canvas2dRef = useRef10(null);
9395
+ const offscreenRef = useRef10(null);
9396
+ const divRef = useRef10(null);
9397
+ const canvasSizeKey = `${width}x${height}`;
9334
9398
  const setLayoutCanvasRef = useCallback8((node) => {
9335
9399
  canvas2dRef.current = node;
9336
9400
  if (typeof ref === "function") {
@@ -9339,45 +9403,48 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9339
9403
  ref.current = node;
9340
9404
  }
9341
9405
  }, [ref]);
9342
- const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
9343
9406
  const chainState = useEffectChainState();
9344
9407
  const memoizedEffects = useMemoizedEffects({
9345
9408
  effects,
9346
9409
  overrideId: controls?.overrideId ?? null
9347
9410
  });
9348
- const effectsRef = useRef9(memoizedEffects);
9411
+ const effectsRef = useRef10(memoizedEffects);
9349
9412
  effectsRef.current = memoizedEffects;
9350
- const onPaintRef = useRef9(onPaint);
9413
+ const onPaintRef = useRef10(onPaint);
9351
9414
  onPaintRef.current = onPaint;
9352
- const onInitRef = useRef9(onInit);
9415
+ const onInitRef = useRef10(onInit);
9353
9416
  onInitRef.current = onInit;
9354
- const initializedRef = useRef9(false);
9355
- const onInitCleanupRef = useRef9(null);
9356
- const unmountedRef = useRef9(false);
9417
+ const initializedRef = useRef10(false);
9418
+ const onInitCleanupRef = useRef10(null);
9419
+ const unmountedRef = useRef10(false);
9357
9420
  const onPaintCb = useCallback8(async () => {
9358
9421
  const element = divRef.current;
9359
9422
  if (!element) {
9360
9423
  throw new Error("Canvas or scene element not found");
9361
9424
  }
9362
- offscreenCanvas.width = width;
9363
- offscreenCanvas.height = height;
9425
+ const offscreen = offscreenRef.current;
9426
+ if (!offscreen) {
9427
+ throw new Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");
9428
+ }
9429
+ offscreen.width = width;
9430
+ offscreen.height = height;
9364
9431
  try {
9365
- const layoutCanvas = canvas2dRef.current;
9366
- if (!layoutCanvas) {
9432
+ const placeholderCanvas = canvas2dRef.current;
9433
+ if (!placeholderCanvas) {
9367
9434
  throw new Error("Canvas not found");
9368
9435
  }
9369
- const layout2d = layoutCanvas.getContext("2d");
9370
- if (!layout2d) {
9371
- throw new Error("Failed to acquire 2D context for <HtmlInCanvas> layout canvas");
9436
+ const offscreen2d = offscreen.getContext("2d");
9437
+ if (!offscreen2d) {
9438
+ throw new Error("Failed to acquire 2D context for <HtmlInCanvas> offscreen canvas");
9372
9439
  }
9373
9440
  const handle = delayRender("onPaint");
9374
9441
  if (!initializedRef.current) {
9375
9442
  initializedRef.current = true;
9376
- const initImage = layoutCanvas.captureElementImage(element);
9443
+ const initImage = placeholderCanvas.captureElementImage(element);
9377
9444
  const currentOnInit = onInitRef.current;
9378
9445
  if (currentOnInit) {
9379
9446
  const cleanup = await currentOnInit({
9380
- canvas: offscreenCanvas,
9447
+ canvas: offscreen,
9381
9448
  element,
9382
9449
  elementImage: initImage
9383
9450
  });
@@ -9392,17 +9459,17 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9392
9459
  }
9393
9460
  }
9394
9461
  const handler = onPaintRef.current ?? defaultOnPaint;
9395
- const elImage = layoutCanvas.captureElementImage(element);
9462
+ const elImage = placeholderCanvas.captureElementImage(element);
9396
9463
  await handler({
9397
- canvas: offscreenCanvas,
9464
+ canvas: offscreen,
9398
9465
  element,
9399
9466
  elementImage: elImage
9400
9467
  });
9401
9468
  await runEffectChain({
9402
9469
  state: chainState.get(width, height),
9403
- source: offscreenCanvas,
9470
+ source: offscreen,
9404
9471
  effects: effectsRef.current,
9405
- output: canvas2dRef.current,
9472
+ output: offscreen,
9406
9473
  width,
9407
9474
  height
9408
9475
  });
@@ -9410,29 +9477,30 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9410
9477
  } catch (error2) {
9411
9478
  cancelRender2(error2);
9412
9479
  }
9413
- }, [
9414
- chainState,
9415
- continueRender2,
9416
- cancelRender2,
9417
- width,
9418
- height,
9419
- offscreenCanvas
9420
- ]);
9480
+ }, [chainState, continueRender2, cancelRender2, width, height]);
9421
9481
  useLayoutEffect3(() => {
9422
- const canvas = canvas2dRef.current;
9423
- if (!canvas) {
9482
+ const placeholder = canvas2dRef.current;
9483
+ if (!placeholder) {
9424
9484
  throw new Error("Canvas not found");
9425
9485
  }
9426
- canvas.layoutSubtree = true;
9427
- canvas.addEventListener("paint", onPaintCb);
9486
+ placeholder.layoutSubtree = true;
9487
+ const offscreen = placeholder.transferControlToOffscreen();
9488
+ offscreenRef.current = offscreen;
9489
+ offscreen.width = width;
9490
+ offscreen.height = height;
9491
+ initializedRef.current = false;
9492
+ unmountedRef.current = false;
9493
+ placeholder.addEventListener("paint", onPaintCb);
9428
9494
  return () => {
9429
- canvas.removeEventListener("paint", onPaintCb);
9495
+ placeholder.removeEventListener("paint", onPaintCb);
9496
+ offscreenRef.current = null;
9497
+ initializedRef.current = false;
9430
9498
  unmountedRef.current = true;
9431
9499
  onInitCleanupRef.current?.();
9432
9500
  onInitCleanupRef.current = null;
9433
9501
  };
9434
- }, [onPaintCb, cancelRender2]);
9435
- const onPaintChangedRef = useRef9(false);
9502
+ }, [onPaintCb, cancelRender2, width, height]);
9503
+ const onPaintChangedRef = useRef10(false);
9436
9504
  useLayoutEffect3(() => {
9437
9505
  if (!onPaintChangedRef.current) {
9438
9506
  onPaintChangedRef.current = true;
@@ -9456,8 +9524,8 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9456
9524
  return () => {
9457
9525
  continueRender2(handle);
9458
9526
  };
9459
- }, [width, height, continueRender2]);
9460
- const innerStyle = useMemo17(() => {
9527
+ }, [width, height, continueRender2, canvasSizeKey]);
9528
+ const innerStyle = useMemo18(() => {
9461
9529
  return {
9462
9530
  width,
9463
9531
  height
@@ -9478,7 +9546,7 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9478
9546
  style: innerStyle,
9479
9547
  children
9480
9548
  })
9481
- })
9549
+ }, canvasSizeKey)
9482
9550
  });
9483
9551
  });
9484
9552
  HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
@@ -9520,7 +9588,7 @@ var HtmlInCanvasInner = forwardRef6(({
9520
9588
  });
9521
9589
  HtmlInCanvasInner.displayName = "HtmlInCanvas";
9522
9590
  var htmlInCanvasSchema = {
9523
- ...sequenceStyleSchema,
9591
+ ...sequenceVisualStyleSchema,
9524
9592
  hidden: hiddenField
9525
9593
  };
9526
9594
  var HtmlInCanvasWrapped = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);
@@ -9568,8 +9636,8 @@ var RenderAssetManager = createContext17({
9568
9636
  renderAssets: []
9569
9637
  });
9570
9638
  var RenderAssetManagerProvider = ({ children, collectAssets }) => {
9571
- const [renderAssets, setRenderAssets] = useState9([]);
9572
- const renderAssetsRef = useRef10([]);
9639
+ const [renderAssets, setRenderAssets] = useState8([]);
9640
+ const renderAssetsRef = useRef11([]);
9573
9641
  const registerRenderAsset = useCallback9((renderAsset) => {
9574
9642
  validateRenderAsset(renderAsset);
9575
9643
  renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
@@ -9601,7 +9669,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
9601
9669
  };
9602
9670
  }
9603
9671
  }, []);
9604
- const contextValue = useMemo18(() => {
9672
+ const contextValue = useMemo19(() => {
9605
9673
  return {
9606
9674
  registerRenderAsset,
9607
9675
  unregisterRenderAsset,
@@ -9618,7 +9686,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
9618
9686
  const { registerRenderAsset, unregisterRenderAsset } = useContext19(RenderAssetManager);
9619
9687
  const env = useRemotionEnvironment();
9620
9688
  const frame = useCurrentFrame();
9621
- const [id] = useState10(() => {
9689
+ const [id] = useState9(() => {
9622
9690
  return String(Math.random());
9623
9691
  });
9624
9692
  useLayoutEffect5(() => {
@@ -9730,14 +9798,14 @@ var Loop = ({
9730
9798
  const iteration = Math.floor(currentFrame / durationInFrames);
9731
9799
  const start = iteration * durationInFrames;
9732
9800
  const from = Math.min(start, maxFrame);
9733
- const loopDisplay = useMemo19(() => {
9801
+ const loopDisplay = useMemo20(() => {
9734
9802
  return {
9735
9803
  numberOfTimes: Math.min(compDuration / durationInFrames, times),
9736
9804
  startOffset: -from,
9737
9805
  durationInFrames
9738
9806
  };
9739
9807
  }, [compDuration, durationInFrames, from, times]);
9740
- const loopContext = useMemo19(() => {
9808
+ const loopContext = useMemo20(() => {
9741
9809
  return {
9742
9810
  iteration: Math.floor(currentFrame / durationInFrames),
9743
9811
  durationInFrames
@@ -9775,7 +9843,7 @@ var setPreloads = (updater) => {
9775
9843
  updaters.forEach((u) => u());
9776
9844
  };
9777
9845
  var PrefetchProvider = ({ children }) => {
9778
- const [_preloads, _setPreloads] = useState11(() => preloads);
9846
+ const [_preloads, _setPreloads] = useState10(() => preloads);
9779
9847
  useEffect7(() => {
9780
9848
  const updaterFunction = () => {
9781
9849
  _setPreloads(preloads);
@@ -10099,7 +10167,7 @@ var DurationsContext = createContext20({
10099
10167
  });
10100
10168
  var DurationsContextProvider = ({ children }) => {
10101
10169
  const [durations, setDurations] = useReducer(durationReducer, {});
10102
- const value = useMemo20(() => {
10170
+ const value = useMemo21(() => {
10103
10171
  return {
10104
10172
  durations,
10105
10173
  setDurations
@@ -10233,7 +10301,7 @@ var useSingletonAudioContext = ({
10233
10301
  audioEnabled
10234
10302
  }) => {
10235
10303
  const env = useRemotionEnvironment();
10236
- const context = useMemo21(() => {
10304
+ const context = useMemo22(() => {
10237
10305
  if (env.isRendering) {
10238
10306
  return null;
10239
10307
  }
@@ -10314,11 +10382,11 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
10314
10382
  latencyHint: audioLatencyHint,
10315
10383
  audioEnabled
10316
10384
  });
10317
- const audioContextIsPlayingEventually = useRef11(false);
10318
- const isResuming = useRef11(null);
10319
- const audioSyncAnchor = useMemo22(() => ({ value: 0 }), []);
10320
- const audioSyncAnchorListeners = useRef11([]);
10321
- const audioSyncAnchorEmitter = useMemo22(() => {
10385
+ const audioContextIsPlayingEventually = useRef12(false);
10386
+ const isResuming = useRef12(null);
10387
+ const audioSyncAnchor = useMemo23(() => ({ value: 0 }), []);
10388
+ const audioSyncAnchorListeners = useRef12([]);
10389
+ const audioSyncAnchorEmitter = useMemo23(() => {
10322
10390
  return {
10323
10391
  dispatch: (event) => {
10324
10392
  audioSyncAnchorListeners.current.forEach((l) => l(event));
@@ -10333,12 +10401,12 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
10333
10401
  }
10334
10402
  };
10335
10403
  }, []);
10336
- const prevEndTimes = useRef11({ scheduledEndTime: null, mediaEndTime: null });
10337
- const nodesToResume = useRef11(new Map);
10404
+ const prevEndTimes = useRef12({ scheduledEndTime: null, mediaEndTime: null });
10405
+ const nodesToResume = useRef12(new Map);
10338
10406
  const unscheduleAudioNode = useCallback10((node) => {
10339
10407
  nodesToResume.current.delete(node);
10340
10408
  }, []);
10341
- const scheduleAudioNode = useMemo22(() => {
10409
+ const scheduleAudioNode = useMemo23(() => {
10342
10410
  return ({
10343
10411
  node,
10344
10412
  mediaTimestamp,
@@ -10423,7 +10491,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
10423
10491
  audioContextIsPlayingEventually.current = false;
10424
10492
  ctxAndGain.audioContext.suspend();
10425
10493
  }, [ctxAndGain]);
10426
- const audioContextValue = useMemo22(() => {
10494
+ const audioContextValue = useMemo23(() => {
10427
10495
  return {
10428
10496
  audioContext: ctxAndGain?.audioContext ?? null,
10429
10497
  gainNode: ctxAndGain?.gainNode ?? null,
@@ -10451,8 +10519,8 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
10451
10519
  });
10452
10520
  };
10453
10521
  var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10454
- const audios = useRef11([]);
10455
- const [initialNumberOfAudioTags] = useState12(numberOfAudioTags);
10522
+ const audios = useRef12([]);
10523
+ const [initialNumberOfAudioTags] = useState11(numberOfAudioTags);
10456
10524
  if (numberOfAudioTags !== initialNumberOfAudioTags) {
10457
10525
  throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
10458
10526
  }
@@ -10462,7 +10530,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10462
10530
  const audioCtx = useContext21(SharedAudioContext);
10463
10531
  const audioContext = audioCtx?.audioContext ?? null;
10464
10532
  const resume = audioCtx?.resume;
10465
- const refs = useMemo22(() => {
10533
+ const refs = useMemo23(() => {
10466
10534
  return new Array(numberOfAudioTags).fill(true).map(() => {
10467
10535
  const ref = createRef2();
10468
10536
  return {
@@ -10485,7 +10553,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10485
10553
  });
10486
10554
  };
10487
10555
  }, [refs]);
10488
- const takenAudios = useRef11(new Array(numberOfAudioTags).fill(false));
10556
+ const takenAudios = useRef12(new Array(numberOfAudioTags).fill(false));
10489
10557
  const rerenderAudios = useCallback10(() => {
10490
10558
  refs.forEach(({ ref, id }) => {
10491
10559
  const data = audios.current?.find((a) => a.id === id);
@@ -10599,7 +10667,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10599
10667
  });
10600
10668
  resume?.();
10601
10669
  }, [logLevel, mountTime, refs, env.isPlayer, resume]);
10602
- const audioTagsValue = useMemo22(() => {
10670
+ const audioTagsValue = useMemo23(() => {
10603
10671
  return {
10604
10672
  registerAudio,
10605
10673
  unregisterAudio,
@@ -10636,7 +10704,7 @@ var useSharedAudio = ({
10636
10704
  }) => {
10637
10705
  const audioCtx = useContext21(SharedAudioContext);
10638
10706
  const tagsCtx = useContext21(SharedAudioTagsContext);
10639
- const [elem] = useState12(() => {
10707
+ const [elem] = useState11(() => {
10640
10708
  if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
10641
10709
  return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
10642
10710
  }
@@ -10772,9 +10840,9 @@ var useAppendVideoFragment = ({
10772
10840
  duration: initialDuration,
10773
10841
  fps
10774
10842
  }) => {
10775
- const actualFromRef = useRef12(initialActualFrom);
10776
- const actualDuration = useRef12(initialDuration);
10777
- const actualSrc = useRef12(initialActualSrc);
10843
+ const actualFromRef = useRef13(initialActualFrom);
10844
+ const actualDuration = useRef13(initialDuration);
10845
+ const actualSrc = useRef13(initialActualSrc);
10778
10846
  if (!isSubsetOfDuration({
10779
10847
  prevStartFrom: actualFromRef.current,
10780
10848
  newStartFrom: initialActualFrom,
@@ -10811,8 +10879,8 @@ var useVolume = ({
10811
10879
  source,
10812
10880
  shouldUseWebAudioApi
10813
10881
  }) => {
10814
- const audioStuffRef = useRef13(null);
10815
- const currentVolumeRef = useRef13(volume);
10882
+ const audioStuffRef = useRef14(null);
10883
+ const currentVolumeRef = useRef14(volume);
10816
10884
  currentVolumeRef.current = volume;
10817
10885
  const sharedAudioContext = useContext22(SharedAudioContext);
10818
10886
  if (!sharedAudioContext) {
@@ -10969,7 +11037,7 @@ var useBasicMediaInTimeline = ({
10969
11037
  throw new Error("No src passed");
10970
11038
  }
10971
11039
  const parentSequence = useContext24(SequenceContext);
10972
- const [initialVolume] = useState13(() => volume);
11040
+ const [initialVolume] = useState12(() => volume);
10973
11041
  const duration = getTimelineDuration({
10974
11042
  compositionDurationInFrames: sequenceDurationInFrames,
10975
11043
  playbackRate,
@@ -10978,7 +11046,7 @@ var useBasicMediaInTimeline = ({
10978
11046
  parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
10979
11047
  loop
10980
11048
  });
10981
- const volumes = useMemo23(() => {
11049
+ const volumes = useMemo24(() => {
10982
11050
  if (typeof volume === "number") {
10983
11051
  return volume;
10984
11052
  }
@@ -10999,7 +11067,7 @@ var useBasicMediaInTimeline = ({
10999
11067
  const nonce = useNonce();
11000
11068
  const { rootId } = useTimelineContext();
11001
11069
  const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
11002
- const memoizedResult = useMemo23(() => {
11070
+ const memoizedResult = useMemo24(() => {
11003
11071
  return {
11004
11072
  volumes,
11005
11073
  duration,
@@ -11028,7 +11096,7 @@ var useImageInTimeline = ({
11028
11096
  src,
11029
11097
  displayName,
11030
11098
  id,
11031
- stack,
11099
+ getStack,
11032
11100
  showInTimeline,
11033
11101
  premountDisplay,
11034
11102
  postmountDisplay,
@@ -11075,7 +11143,7 @@ var useImageInTimeline = ({
11075
11143
  showInTimeline: true,
11076
11144
  nonce: nonce.get(),
11077
11145
  loopDisplay,
11078
- stack,
11146
+ getStack,
11079
11147
  premountDisplay,
11080
11148
  postmountDisplay,
11081
11149
  controls,
@@ -11092,7 +11160,7 @@ var useImageInTimeline = ({
11092
11160
  registerSequence,
11093
11161
  unregisterSequence,
11094
11162
  nonce,
11095
- stack,
11163
+ getStack,
11096
11164
  showInTimeline,
11097
11165
  premountDisplay,
11098
11166
  postmountDisplay,
@@ -11111,7 +11179,7 @@ var useMediaInTimeline = ({
11111
11179
  playbackRate,
11112
11180
  displayName,
11113
11181
  id,
11114
- stack,
11182
+ getStack,
11115
11183
  showInTimeline,
11116
11184
  premountDisplay,
11117
11185
  postmountDisplay,
@@ -11162,7 +11230,7 @@ var useMediaInTimeline = ({
11162
11230
  doesVolumeChange,
11163
11231
  loopDisplay,
11164
11232
  playbackRate,
11165
- stack,
11233
+ getStack,
11166
11234
  premountDisplay,
11167
11235
  postmountDisplay,
11168
11236
  controls: null,
@@ -11184,7 +11252,7 @@ var useMediaInTimeline = ({
11184
11252
  mediaType,
11185
11253
  startsAt,
11186
11254
  playbackRate,
11187
- stack,
11255
+ getStack,
11188
11256
  showInTimeline,
11189
11257
  premountDisplay,
11190
11258
  postmountDisplay,
@@ -11195,12 +11263,12 @@ var useMediaInTimeline = ({
11195
11263
  ]);
11196
11264
  };
11197
11265
  var useBufferManager = (logLevel, mountTime) => {
11198
- const [blocks, setBlocks] = useState14([]);
11199
- const [onBufferingCallbacks, setOnBufferingCallbacks] = useState14([]);
11200
- const [onResumeCallbacks, setOnResumeCallbacks] = useState14([]);
11266
+ const [blocks, setBlocks] = useState13([]);
11267
+ const [onBufferingCallbacks, setOnBufferingCallbacks] = useState13([]);
11268
+ const [onResumeCallbacks, setOnResumeCallbacks] = useState13([]);
11201
11269
  const env = useRemotionEnvironment();
11202
11270
  const rendering = env.isRendering;
11203
- const buffering = useRef14(false);
11271
+ const buffering = useRef15(false);
11204
11272
  const addBlock = useCallback11((block) => {
11205
11273
  if (rendering) {
11206
11274
  return {
@@ -11273,7 +11341,7 @@ var useBufferManager = (logLevel, mountTime) => {
11273
11341
  }
11274
11342
  }, [blocks]);
11275
11343
  }
11276
- return useMemo24(() => {
11344
+ return useMemo25(() => {
11277
11345
  return { addBlock, listenForBuffering, listenForResume, buffering };
11278
11346
  }, [addBlock, buffering, listenForBuffering, listenForResume]);
11279
11347
  };
@@ -11287,7 +11355,7 @@ var BufferingProvider = ({ children }) => {
11287
11355
  });
11288
11356
  };
11289
11357
  var useIsPlayerBuffering = (bufferManager) => {
11290
- const [isBuffering, setIsBuffering] = useState14(bufferManager.buffering.current);
11358
+ const [isBuffering, setIsBuffering] = useState13(bufferManager.buffering.current);
11291
11359
  useEffect9(() => {
11292
11360
  const onBuffer = () => {
11293
11361
  setIsBuffering(true);
@@ -11312,7 +11380,7 @@ var useBufferState = () => {
11312
11380
  const buffer = useContext26(BufferingContextReact);
11313
11381
  const logLevel = useLogLevel();
11314
11382
  const addBlock = buffer ? buffer.addBlock : null;
11315
- return useMemo25(() => ({
11383
+ return useMemo26(() => ({
11316
11384
  delayPlayback: () => {
11317
11385
  if (!addBlock) {
11318
11386
  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");
@@ -11347,7 +11415,7 @@ var useBufferUntilFirstFrame = ({
11347
11415
  logLevel,
11348
11416
  mountTime
11349
11417
  }) => {
11350
- const bufferingRef = useRef15(false);
11418
+ const bufferingRef = useRef16(false);
11351
11419
  const { delayPlayback } = useBufferState();
11352
11420
  const bufferUntilFirstFrame = useCallback12((requestedTime) => {
11353
11421
  if (mediaType !== "video") {
@@ -11420,7 +11488,7 @@ var useBufferUntilFirstFrame = ({
11420
11488
  onVariableFpsVideoDetected,
11421
11489
  pauseWhenBuffering
11422
11490
  ]);
11423
- return useMemo26(() => {
11491
+ return useMemo27(() => {
11424
11492
  return {
11425
11493
  isBuffering: () => bufferingRef.current,
11426
11494
  bufferUntilFirstFrame
@@ -11468,7 +11536,7 @@ var useMediaBuffering = ({
11468
11536
  src
11469
11537
  }) => {
11470
11538
  const buffer = useBufferState();
11471
- const [isBuffering, setIsBuffering] = useState15(false);
11539
+ const [isBuffering, setIsBuffering] = useState14(false);
11472
11540
  useEffect10(() => {
11473
11541
  let cleanupFns = [];
11474
11542
  const { current } = element;
@@ -11601,7 +11669,7 @@ var useRequestVideoCallbackTime = ({
11601
11669
  lastSeek,
11602
11670
  onVariableFpsVideoDetected
11603
11671
  }) => {
11604
- const currentTime = useRef16(null);
11672
+ const currentTime = useRef17(null);
11605
11673
  useEffect11(() => {
11606
11674
  const { current } = mediaRef;
11607
11675
  if (current) {
@@ -11858,14 +11926,14 @@ var useMediaPlayback = ({
11858
11926
  const buffering = useContext27(BufferingContextReact);
11859
11927
  const { fps } = useVideoConfig();
11860
11928
  const mediaStartsAt = useMediaStartsAt();
11861
- const lastSeekDueToShift = useRef17(null);
11862
- const lastSeek = useRef17(null);
11929
+ const lastSeekDueToShift = useRef18(null);
11930
+ const lastSeek = useRef18(null);
11863
11931
  const logLevel = useLogLevel();
11864
11932
  const mountTime = useMountTime();
11865
11933
  if (!buffering) {
11866
11934
  throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
11867
11935
  }
11868
- const isVariableFpsVideoMap = useRef17({});
11936
+ const isVariableFpsVideoMap = useRef18({});
11869
11937
  const onVariableFpsVideoDetected = useCallback13(() => {
11870
11938
  if (!src) {
11871
11939
  return;
@@ -12148,14 +12216,14 @@ var SetMediaVolumeContext = createContext22({
12148
12216
  var useMediaVolumeState = () => {
12149
12217
  const { mediaVolume } = useContext28(MediaVolumeContext);
12150
12218
  const { setMediaVolume } = useContext28(SetMediaVolumeContext);
12151
- return useMemo27(() => {
12219
+ return useMemo28(() => {
12152
12220
  return [mediaVolume, setMediaVolume];
12153
12221
  }, [mediaVolume, setMediaVolume]);
12154
12222
  };
12155
12223
  var useMediaMutedState = () => {
12156
12224
  const { mediaMuted } = useContext28(MediaVolumeContext);
12157
12225
  const { setMediaMuted } = useContext28(SetMediaVolumeContext);
12158
- return useMemo27(() => {
12226
+ return useMemo28(() => {
12159
12227
  return [mediaMuted, setMediaMuted];
12160
12228
  }, [mediaMuted, setMediaMuted]);
12161
12229
  };
@@ -12165,7 +12233,7 @@ var warnAboutTooHighVolume = (volume) => {
12165
12233
  }
12166
12234
  };
12167
12235
  var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12168
- const [initialShouldPreMountAudioElements] = useState16(props.shouldPreMountAudioTags);
12236
+ const [initialShouldPreMountAudioElements] = useState15(props.shouldPreMountAudioTags);
12169
12237
  if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
12170
12238
  throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
12171
12239
  }
@@ -12210,7 +12278,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12210
12278
  }
12211
12279
  const preloadedSrc = usePreload(src);
12212
12280
  const sequenceContext = useContext29(SequenceContext);
12213
- const [timelineId] = useState16(() => String(Math.random()));
12281
+ const [timelineId] = useState15(() => String(Math.random()));
12214
12282
  const userPreferredVolume = evaluateVolume({
12215
12283
  frame: volumePropFrame,
12216
12284
  volume,
@@ -12222,7 +12290,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12222
12290
  requestsVideoFrame: false,
12223
12291
  isClientSideRendering: false
12224
12292
  });
12225
- const propsToPass = useMemo28(() => {
12293
+ const propsToPass = useMemo29(() => {
12226
12294
  return {
12227
12295
  muted: muted || mediaMuted || userPreferredVolume <= 0,
12228
12296
  src: preloadedSrc,
@@ -12239,7 +12307,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12239
12307
  userPreferredVolume,
12240
12308
  crossOriginValue
12241
12309
  ]);
12242
- const id = useMemo28(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
12310
+ const id = useMemo29(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
12243
12311
  src,
12244
12312
  sequenceContext?.relativeFrom,
12245
12313
  sequenceContext?.cumulatedFrom,
@@ -12257,6 +12325,9 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12257
12325
  premounting: Boolean(sequenceContext?.premounting),
12258
12326
  postmounting: Boolean(sequenceContext?.postmounting)
12259
12327
  });
12328
+ const getStack = useCallback14(() => {
12329
+ return _remotionInternalStack ?? null;
12330
+ }, [_remotionInternalStack]);
12260
12331
  useMediaInTimeline({
12261
12332
  volume,
12262
12333
  mediaVolume,
@@ -12265,7 +12336,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12265
12336
  playbackRate: playbackRate ?? 1,
12266
12337
  displayName: name ?? null,
12267
12338
  id: timelineId,
12268
- stack: _remotionInternalStack,
12339
+ getStack,
12269
12340
  showInTimeline,
12270
12341
  premountDisplay: sequenceContext?.premountDisplay ?? null,
12271
12342
  postmountDisplay: sequenceContext?.postmountDisplay ?? null,
@@ -12310,7 +12381,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12310
12381
  useImperativeHandle4(ref, () => {
12311
12382
  return audioRef.current;
12312
12383
  }, [audioRef]);
12313
- const currentOnDurationCallback = useRef18(onDuration);
12384
+ const currentOnDurationCallback = useRef19(onDuration);
12314
12385
  currentOnDurationCallback.current = onDuration;
12315
12386
  useEffect14(() => {
12316
12387
  const { current } = audioRef;
@@ -12341,7 +12412,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12341
12412
  };
12342
12413
  var AudioForPreview = forwardRef7(AudioForDevelopmentForwardRefFunction);
12343
12414
  var AudioForRenderingRefForwardingFunction = (props, ref) => {
12344
- const audioRef = useRef19(null);
12415
+ const audioRef = useRef20(null);
12345
12416
  const {
12346
12417
  volume: volumeProp,
12347
12418
  playbackRate,
@@ -12367,7 +12438,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
12367
12438
  const sequenceContext = useContext30(SequenceContext);
12368
12439
  const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
12369
12440
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
12370
- const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
12441
+ const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
12371
12442
  props.src,
12372
12443
  sequenceContext?.relativeFrom,
12373
12444
  sequenceContext?.cumulatedFrom,
@@ -12498,7 +12569,7 @@ var AudioRefForwardingFunction = (props, ref) => {
12498
12569
  throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
12499
12570
  }
12500
12571
  const preloadedSrc = usePreload(props.src);
12501
- const onError = useCallback14((e) => {
12572
+ const onError = useCallback15((e) => {
12502
12573
  console.log(e.currentTarget.error);
12503
12574
  const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
12504
12575
  if (loop) {
@@ -12512,7 +12583,7 @@ var AudioRefForwardingFunction = (props, ref) => {
12512
12583
  console.warn(errMessage);
12513
12584
  }
12514
12585
  }, [loop, onRemotionError, preloadedSrc]);
12515
- const onDuration = useCallback14((src, durationInSeconds) => {
12586
+ const onDuration = useCallback15((src, durationInSeconds) => {
12516
12587
  setDurations({ type: "got-duration", durationInSeconds, src });
12517
12588
  }, [setDurations]);
12518
12589
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
@@ -12602,15 +12673,15 @@ var IFrameRefForwarding = ({
12602
12673
  ...props2
12603
12674
  }, ref) => {
12604
12675
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
12605
- const [handle] = useState17(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
12676
+ const [handle] = useState16(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
12606
12677
  retries: delayRenderRetries ?? undefined,
12607
12678
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
12608
12679
  }));
12609
- const didLoad = useCallback15((e) => {
12680
+ const didLoad = useCallback16((e) => {
12610
12681
  continueRender2(handle);
12611
12682
  onLoad?.(e);
12612
12683
  }, [handle, onLoad, continueRender2]);
12613
- const didGetError = useCallback15((e) => {
12684
+ const didGetError = useCallback16((e) => {
12614
12685
  continueRender2(handle);
12615
12686
  if (onError) {
12616
12687
  onError(e);
@@ -12648,8 +12719,8 @@ var ImgContent = ({
12648
12719
  ref,
12649
12720
  ...props2
12650
12721
  }) => {
12651
- const imageRef = useRef20(null);
12652
- const errors = useRef20({});
12722
+ const imageRef = useRef21(null);
12723
+ const errors = useRef21({});
12653
12724
  const { delayPlayback } = useBufferState();
12654
12725
  const sequenceContext = useContext32(SequenceContext);
12655
12726
  const _propsValid = true;
@@ -12660,7 +12731,7 @@ var ImgContent = ({
12660
12731
  return imageRef.current;
12661
12732
  }, []);
12662
12733
  const actualSrc = usePreload(src);
12663
- const retryIn = useCallback16((timeout) => {
12734
+ const retryIn = useCallback17((timeout) => {
12664
12735
  if (!imageRef.current) {
12665
12736
  return;
12666
12737
  }
@@ -12678,7 +12749,7 @@ var ImgContent = ({
12678
12749
  }, timeout);
12679
12750
  }, []);
12680
12751
  const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
12681
- const didGetError = useCallback16((e) => {
12752
+ const didGetError = useCallback17((e) => {
12682
12753
  if (!errors.current) {
12683
12754
  return;
12684
12755
  }
@@ -12790,15 +12861,18 @@ var ImgInner = ({
12790
12861
  ...props2
12791
12862
  }) => {
12792
12863
  const sequenceContext = useContext32(SequenceContext);
12793
- const [timelineId] = useState18(() => String(Math.random()));
12864
+ const [timelineId] = useState17(() => String(Math.random()));
12794
12865
  if (!src) {
12795
12866
  throw new Error('No "src" prop was passed to <Img>.');
12796
12867
  }
12868
+ const stackRef = useRef21(null);
12869
+ stackRef.current = stack ?? null;
12870
+ const getStack = useCallback17(() => stackRef.current, []);
12797
12871
  useImageInTimeline({
12798
12872
  src,
12799
12873
  displayName: name ?? null,
12800
12874
  id: timelineId,
12801
- stack: stack ?? null,
12875
+ getStack,
12802
12876
  showInTimeline: showInTimeline ?? true,
12803
12877
  premountDisplay: sequenceContext?.premountDisplay ?? null,
12804
12878
  postmountDisplay: sequenceContext?.postmountDisplay ?? null,
@@ -12814,7 +12888,7 @@ var ImgInner = ({
12814
12888
  });
12815
12889
  };
12816
12890
  var imgSchema = {
12817
- ...sequenceStyleSchema,
12891
+ ...sequenceVisualStyleSchema,
12818
12892
  hidden: hiddenField
12819
12893
  };
12820
12894
  var Img = wrapInSchema(ImgInner, imgSchema);
@@ -12827,18 +12901,18 @@ var CompositionManagerProvider = ({
12827
12901
  initialCompositions,
12828
12902
  initialCanvasContent
12829
12903
  }) => {
12830
- const [folders, setFolders] = useState19([]);
12831
- const [canvasContent, setCanvasContent] = useState19(initialCanvasContent);
12832
- const [compositions, setCompositions] = useState19(initialCompositions);
12833
- const currentcompositionsRef = useRef21(compositions);
12834
- const updateCompositions = useCallback17((updateComps) => {
12904
+ const [folders, setFolders] = useState18([]);
12905
+ const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
12906
+ const [compositions, setCompositions] = useState18(initialCompositions);
12907
+ const currentcompositionsRef = useRef22(compositions);
12908
+ const updateCompositions = useCallback18((updateComps) => {
12835
12909
  setCompositions((comps) => {
12836
12910
  const updated = updateComps(comps);
12837
12911
  currentcompositionsRef.current = updated;
12838
12912
  return updated;
12839
12913
  });
12840
12914
  }, []);
12841
- const registerComposition = useCallback17((comp) => {
12915
+ const registerComposition = useCallback18((comp) => {
12842
12916
  updateCompositions((comps) => {
12843
12917
  if (comps.find((c2) => c2.id === comp.id)) {
12844
12918
  throw new Error(`Multiple composition with id ${comp.id} are registered.`);
@@ -12846,12 +12920,12 @@ var CompositionManagerProvider = ({
12846
12920
  return [...comps, comp];
12847
12921
  });
12848
12922
  }, [updateCompositions]);
12849
- const unregisterComposition = useCallback17((id) => {
12923
+ const unregisterComposition = useCallback18((id) => {
12850
12924
  setCompositions((comps) => {
12851
12925
  return comps.filter((c2) => c2.id !== id);
12852
12926
  });
12853
12927
  }, []);
12854
- const registerFolder = useCallback17((name, parent, nonce) => {
12928
+ const registerFolder = useCallback18((name, parent, nonce) => {
12855
12929
  setFolders((prevFolders) => {
12856
12930
  return [
12857
12931
  ...prevFolders,
@@ -12863,7 +12937,7 @@ var CompositionManagerProvider = ({
12863
12937
  ];
12864
12938
  });
12865
12939
  }, []);
12866
- const unregisterFolder = useCallback17((name, parent) => {
12940
+ const unregisterFolder = useCallback18((name, parent) => {
12867
12941
  setFolders((prevFolders) => {
12868
12942
  return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
12869
12943
  });
@@ -12873,7 +12947,7 @@ var CompositionManagerProvider = ({
12873
12947
  getCompositions: () => currentcompositionsRef.current
12874
12948
  };
12875
12949
  }, []);
12876
- const compositionManagerSetters = useMemo30(() => {
12950
+ const compositionManagerSetters = useMemo31(() => {
12877
12951
  return {
12878
12952
  registerComposition,
12879
12953
  unregisterComposition,
@@ -12889,7 +12963,7 @@ var CompositionManagerProvider = ({
12889
12963
  unregisterFolder,
12890
12964
  onlyRenderComposition
12891
12965
  ]);
12892
- const compositionManagerContextValue = useMemo30(() => {
12966
+ const compositionManagerContextValue = useMemo31(() => {
12893
12967
  return {
12894
12968
  compositions,
12895
12969
  folders,
@@ -12969,7 +13043,7 @@ var disabledEffectField = {
12969
13043
  description: "Disabled"
12970
13044
  };
12971
13045
  var createEffect = (definition) => {
12972
- const userCalculateKey = definition.calculateKey;
13046
+ const { calculateKey: userCalculateKey, validateParams } = definition;
12973
13047
  const widened = {
12974
13048
  ...definition,
12975
13049
  calculateKey: (params) => {
@@ -12981,12 +13055,15 @@ var createEffect = (definition) => {
12981
13055
  ...definition.schema
12982
13056
  }
12983
13057
  };
12984
- const factory = (params = {}) => ({
12985
- definition: widened,
12986
- params,
12987
- effectKey: widened.calculateKey(params),
12988
- memoized: false
12989
- });
13058
+ const factory = (params = {}) => {
13059
+ validateParams(params);
13060
+ return {
13061
+ definition: widened,
13062
+ params,
13063
+ effectKey: widened.calculateKey(params),
13064
+ memoized: false
13065
+ };
13066
+ };
12990
13067
  return factory;
12991
13068
  };
12992
13069
  var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
@@ -13037,7 +13114,7 @@ var MediaEnabledProvider = ({
13037
13114
  videoEnabled,
13038
13115
  audioEnabled
13039
13116
  }) => {
13040
- const value = useMemo31(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
13117
+ const value = useMemo322(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
13041
13118
  return /* @__PURE__ */ jsx28(MediaEnabledContext.Provider, {
13042
13119
  value,
13043
13120
  children
@@ -13052,13 +13129,13 @@ var RemotionRootContexts = ({
13052
13129
  audioEnabled,
13053
13130
  frameState
13054
13131
  }) => {
13055
- const nonceContext = useMemo322(() => {
13132
+ const nonceContext = useMemo33(() => {
13056
13133
  let counter = 0;
13057
13134
  return {
13058
13135
  getNonce: () => counter++
13059
13136
  };
13060
13137
  }, []);
13061
- const logging = useMemo322(() => {
13138
+ const logging = useMemo33(() => {
13062
13139
  return { logLevel, mountTime: Date.now() };
13063
13140
  }, [logLevel]);
13064
13141
  return /* @__PURE__ */ jsx29(LogLevelContext.Provider, {
@@ -13352,7 +13429,7 @@ var OffthreadVideoForRendering = ({
13352
13429
  if (!src) {
13353
13430
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
13354
13431
  }
13355
- const id = useMemo33(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
13432
+ const id = useMemo34(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
13356
13433
  src,
13357
13434
  sequenceContext?.cumulatedFrom,
13358
13435
  sequenceContext?.relativeFrom,
@@ -13407,14 +13484,14 @@ var OffthreadVideoForRendering = ({
13407
13484
  sequenceContext?.relativeFrom,
13408
13485
  audioStreamIndex
13409
13486
  ]);
13410
- const currentTime = useMemo33(() => {
13487
+ const currentTime = useMemo34(() => {
13411
13488
  return getExpectedMediaFrameUncorrected({
13412
13489
  frame,
13413
13490
  playbackRate: playbackRate || 1,
13414
13491
  startFrom: -mediaStartsAt
13415
13492
  }) / videoConfig.fps;
13416
13493
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
13417
- const actualSrc = useMemo33(() => {
13494
+ const actualSrc = useMemo34(() => {
13418
13495
  return getOffthreadVideoSource({
13419
13496
  src,
13420
13497
  currentTime,
@@ -13422,7 +13499,7 @@ var OffthreadVideoForRendering = ({
13422
13499
  toneMapped
13423
13500
  });
13424
13501
  }, [toneMapped, currentTime, src, transparent]);
13425
- const [imageSrc, setImageSrc] = useState20(null);
13502
+ const [imageSrc, setImageSrc] = useState19(null);
13426
13503
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
13427
13504
  useLayoutEffect11(() => {
13428
13505
  if (!window.remotion_videoEnabled) {
@@ -13495,17 +13572,17 @@ var OffthreadVideoForRendering = ({
13495
13572
  continueRender2,
13496
13573
  delayRender2
13497
13574
  ]);
13498
- const onErr = useCallback18(() => {
13575
+ const onErr = useCallback19(() => {
13499
13576
  if (onError) {
13500
13577
  onError?.(new Error("Failed to load image with src " + imageSrc));
13501
13578
  } else {
13502
13579
  cancelRender("Failed to load image with src " + imageSrc);
13503
13580
  }
13504
13581
  }, [imageSrc, onError]);
13505
- const className = useMemo33(() => {
13582
+ const className = useMemo34(() => {
13506
13583
  return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy2).join(" ");
13507
13584
  }, [props2.className]);
13508
- const onImageFrame = useCallback18((img) => {
13585
+ const onImageFrame = useCallback19((img) => {
13509
13586
  if (onVideoFrame) {
13510
13587
  onVideoFrame(img);
13511
13588
  }
@@ -13564,8 +13641,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13564
13641
  if (!context) {
13565
13642
  throw new Error("SharedAudioContext not found");
13566
13643
  }
13567
- const videoRef = useRef22(null);
13568
- const sharedSource = useMemo34(() => {
13644
+ const videoRef = useRef23(null);
13645
+ const sharedSource = useMemo35(() => {
13569
13646
  if (!context.audioContext) {
13570
13647
  return null;
13571
13648
  }
@@ -13620,7 +13697,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13620
13697
  const parentSequence = useContext35(SequenceContext);
13621
13698
  const logLevel = useLogLevel();
13622
13699
  const mountTime = useMountTime();
13623
- const [timelineId] = useState21(() => String(Math.random()));
13700
+ const [timelineId] = useState20(() => String(Math.random()));
13624
13701
  if (typeof acceptableTimeShift !== "undefined") {
13625
13702
  throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
13626
13703
  }
@@ -13632,6 +13709,9 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13632
13709
  mediaVolume
13633
13710
  });
13634
13711
  warnAboutTooHighVolume(userPreferredVolume);
13712
+ const getStack = useCallback20(() => {
13713
+ return _remotionInternalStack ?? null;
13714
+ }, [_remotionInternalStack]);
13635
13715
  useMediaInTimeline({
13636
13716
  volume,
13637
13717
  mediaVolume,
@@ -13640,7 +13720,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13640
13720
  playbackRate: props2.playbackRate ?? 1,
13641
13721
  displayName: name ?? null,
13642
13722
  id: timelineId,
13643
- stack: _remotionInternalStack,
13723
+ getStack,
13644
13724
  showInTimeline,
13645
13725
  premountDisplay: parentSequence?.premountDisplay ?? null,
13646
13726
  postmountDisplay: parentSequence?.postmountDisplay ?? null,
@@ -13686,7 +13766,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13686
13766
  useImperativeHandle8(ref, () => {
13687
13767
  return videoRef.current;
13688
13768
  }, []);
13689
- useState21(() => playbackLogging({
13769
+ useState20(() => playbackLogging({
13690
13770
  logLevel,
13691
13771
  message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
13692
13772
  tag: "video",
@@ -13732,7 +13812,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13732
13812
  current.removeEventListener("error", errorHandler);
13733
13813
  };
13734
13814
  }, [onError, src]);
13735
- const currentOnDurationCallback = useRef22(onDuration);
13815
+ const currentOnDurationCallback = useRef23(onDuration);
13736
13816
  currentOnDurationCallback.current = onDuration;
13737
13817
  useEmitVideoFrame({ ref: videoRef, onVideoFrame });
13738
13818
  useEffect18(() => {
@@ -13763,7 +13843,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13763
13843
  current.preload = "auto";
13764
13844
  }
13765
13845
  }, []);
13766
- const actualStyle = useMemo34(() => {
13846
+ const actualStyle = useMemo35(() => {
13767
13847
  return {
13768
13848
  ...style
13769
13849
  };
@@ -13802,7 +13882,7 @@ var InnerOffthreadVideo = (props2) => {
13802
13882
  if (environment.isClientSideRendering) {
13803
13883
  throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
13804
13884
  }
13805
- const onDuration = useCallback19(() => {
13885
+ const onDuration = useCallback21(() => {
13806
13886
  return;
13807
13887
  }, []);
13808
13888
  if (typeof props2.src !== "string") {
@@ -13958,7 +14038,7 @@ function useRemotionContexts() {
13958
14038
  const sequenceManagerContext = React36.useContext(SequenceManager);
13959
14039
  const bufferManagerContext = React36.useContext(BufferingContextReact);
13960
14040
  const logLevelContext = React36.useContext(LogLevelContext);
13961
- return useMemo35(() => ({
14041
+ return useMemo36(() => ({
13962
14042
  compositionManagerCtx,
13963
14043
  timelineContext,
13964
14044
  setTimelineContext,
@@ -14050,6 +14130,8 @@ var Internals = {
14050
14130
  wrapInSchema,
14051
14131
  sequenceSchema,
14052
14132
  sequenceStyleSchema,
14133
+ sequenceVisualStyleSchema,
14134
+ sequencePremountSchema,
14053
14135
  flattenActiveSchema,
14054
14136
  getFlatSchemaWithAllKeys,
14055
14137
  RemotionRootContexts,
@@ -14144,6 +14226,8 @@ var Internals = {
14144
14226
  useMemoizedEffects,
14145
14227
  useMemoizedEffectDefinitions,
14146
14228
  createEffect,
14229
+ createWebGLContextError,
14230
+ createWebGL2ContextError,
14147
14231
  computeEffectiveSchemaValuesDotNotation,
14148
14232
  OverrideIdsToNodePathsGettersContext,
14149
14233
  OverrideIdsToNodePathsSettersContext,
@@ -14216,7 +14300,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
14216
14300
  };
14217
14301
  var SeriesSequence = forwardRef12(SeriesSequenceRefForwardingFunction);
14218
14302
  var SeriesInner = (props2) => {
14219
- const childrenValue = useMemo36(() => {
14303
+ const childrenValue = useMemo37(() => {
14220
14304
  let startFrame = 0;
14221
14305
  const flattenedChildren = flattenChildren(props2.children);
14222
14306
  return Children.map(flattenedChildren, (child, i) => {
@@ -14746,7 +14830,7 @@ var VideoForRenderingForwardFunction = ({
14746
14830
  const frame = useCurrentFrame();
14747
14831
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
14748
14832
  const videoConfig = useUnsafeVideoConfig();
14749
- const videoRef = useRef23(null);
14833
+ const videoRef = useRef24(null);
14750
14834
  const sequenceContext = useContext36(SequenceContext);
14751
14835
  const mediaStartsAt = useMediaStartsAt();
14752
14836
  const environment = useRemotionEnvironment();
@@ -14754,7 +14838,7 @@ var VideoForRenderingForwardFunction = ({
14754
14838
  const mountTime = useMountTime();
14755
14839
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
14756
14840
  const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
14757
- const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
14841
+ const id = useMemo38(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
14758
14842
  props2.src,
14759
14843
  sequenceContext?.cumulatedFrom,
14760
14844
  sequenceContext?.relativeFrom,
@@ -14971,10 +15055,10 @@ var VideoForwardingFunction = (props2, ref) => {
14971
15055
  throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
14972
15056
  }
14973
15057
  const preloadedSrc = usePreload(props2.src);
14974
- const onDuration = useCallback20((src, durationInSeconds) => {
15058
+ const onDuration = useCallback22((src, durationInSeconds) => {
14975
15059
  setDurations({ type: "got-duration", durationInSeconds, src });
14976
15060
  }, [setDurations]);
14977
- const onVideoFrame = useCallback20(() => {}, []);
15061
+ const onVideoFrame = useCallback22(() => {}, []);
14978
15062
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
14979
15063
  validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
14980
15064
  const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
@@ -15082,7 +15166,7 @@ addSequenceStackTraces(Composition);
15082
15166
  // ../design/dist/esm/index.mjs
15083
15167
  import { jsx as jsx210, Fragment as Fragment3 } from "react/jsx-runtime";
15084
15168
  import { jsx as jsx39, jsxs as jsxs5 } from "react/jsx-runtime";
15085
- import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef25 } from "react";
15169
+ import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef26 } from "react";
15086
15170
  import { jsx as jsx44 } from "react/jsx-runtime";
15087
15171
  import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
15088
15172
  import React62 from "react";
@@ -15109,8 +15193,8 @@ import * as React16 from "react";
15109
15193
  import * as React13 from "react";
15110
15194
  import * as ReactDOM from "react-dom";
15111
15195
  import { jsx as jsx172 } from "react/jsx-runtime";
15112
- import * as React14 from "react";
15113
- import * as React152 from "react";
15196
+ import * as React142 from "react";
15197
+ import * as React15 from "react";
15114
15198
  import { jsx as jsx182 } from "react/jsx-runtime";
15115
15199
  import * as React172 from "react";
15116
15200
  import * as React18 from "react";
@@ -15134,8 +15218,8 @@ import * as React282 from "react";
15134
15218
  import { jsx as jsx233 } from "react/jsx-runtime";
15135
15219
  import * as React35 from "react";
15136
15220
  import * as React312 from "react";
15137
- import * as React292 from "react";
15138
15221
  import { useState as useState112 } from "react";
15222
+ import * as React292 from "react";
15139
15223
  import * as React30 from "react";
15140
15224
  import * as React342 from "react";
15141
15225
  import * as React332 from "react";
@@ -15336,7 +15420,7 @@ var useHoverTransforms = (ref, disabled) => {
15336
15420
  progress: 0,
15337
15421
  isActive: false
15338
15422
  });
15339
- const eventTarget = useMemo38(() => new EventTarget, []);
15423
+ const eventTarget = useMemo39(() => new EventTarget, []);
15340
15424
  useEffect20(() => {
15341
15425
  if (disabled) {
15342
15426
  eventTarget.dispatchEvent(new Event("disabled"));
@@ -15483,7 +15567,7 @@ var getAngle = (ref, coordinates) => {
15483
15567
  };
15484
15568
  var lastCoordinates = null;
15485
15569
  var useMousePosition = (ref) => {
15486
- const [angle, setAngle] = useState23(getAngle(ref.current, lastCoordinates));
15570
+ const [angle, setAngle] = useState21(getAngle(ref.current, lastCoordinates));
15487
15571
  useEffect20(() => {
15488
15572
  const element = ref.current;
15489
15573
  if (!element) {
@@ -15604,7 +15688,7 @@ var Spinner = ({ size, duration }) => {
15604
15688
  height: size
15605
15689
  };
15606
15690
  }, [size]);
15607
- const pathsRef = useRef25([]);
15691
+ const pathsRef = useRef26([]);
15608
15692
  useEffect22(() => {
15609
15693
  const animate = () => {
15610
15694
  const now = performance.now();
@@ -15650,9 +15734,9 @@ var Button = ({
15650
15734
  ...rest
15651
15735
  }) => {
15652
15736
  const [dimensions, setDimensions] = useState22(null);
15653
- const ref = useRef24(null);
15737
+ const ref = useRef25(null);
15654
15738
  const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
15655
- const onPointerEnter = useCallback22((e) => {
15739
+ const onPointerEnter = useCallback24((e) => {
15656
15740
  if (e.pointerType !== "mouse") {
15657
15741
  return;
15658
15742
  }
@@ -15689,7 +15773,7 @@ var Button = ({
15689
15773
  const isDisabled = disabled || loading;
15690
15774
  const isAnchor = !asChild && "href" in rest && rest.href !== undefined;
15691
15775
  const sharedClasses = cn("text-text", "inline-flex", "justify-center", "bg-button-bg", "items-center", "font-brand", "border-solid", "text-[1em]", "rounded-lg", "border-black", "border-2", "border-b-4", "cursor-pointer", "px-4", "h-12", "flex-row", "items-center", "relative", "overflow-hidden", isDisabled && "cursor-default opacity-50", className);
15692
- const preventInteraction = useCallback22((e) => {
15776
+ const preventInteraction = useCallback24((e) => {
15693
15777
  e.preventDefault();
15694
15778
  e.stopPropagation();
15695
15779
  }, []);
@@ -16164,15 +16248,15 @@ function dispatchDiscreteCustomEvent(target, event) {
16164
16248
  ReactDOM.flushSync(() => target.dispatchEvent(event));
16165
16249
  }
16166
16250
  function useCallbackRef(callback) {
16167
- const callbackRef = React14.useRef(callback);
16168
- React14.useEffect(() => {
16251
+ const callbackRef = React142.useRef(callback);
16252
+ React142.useEffect(() => {
16169
16253
  callbackRef.current = callback;
16170
16254
  });
16171
- return React14.useMemo(() => (...args) => callbackRef.current?.(...args), []);
16255
+ return React142.useMemo(() => (...args) => callbackRef.current?.(...args), []);
16172
16256
  }
16173
16257
  function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
16174
16258
  const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
16175
- React152.useEffect(() => {
16259
+ React15.useEffect(() => {
16176
16260
  const handleKeyDown = (event) => {
16177
16261
  if (event.key === "Escape") {
16178
16262
  onEscapeKeyDown(event);
@@ -18890,7 +18974,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
18890
18974
  return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
18891
18975
  };
18892
18976
  var __assign = function() {
18893
- __assign = Object.assign || function __assign2(t) {
18977
+ __assign = Object.assign || function __assign(t) {
18894
18978
  for (var s, i = 1, n = arguments.length;i < n; i++) {
18895
18979
  s = arguments[i];
18896
18980
  for (var p in s)
@@ -20677,17 +20761,17 @@ function createContextScope2(scopeName, createContextScopeDeps = []) {
20677
20761
  let defaultContexts = [];
20678
20762
  function createContext32(rootComponentName, defaultContext) {
20679
20763
  const BaseContext = React382.createContext(defaultContext);
20680
- const index3 = defaultContexts.length;
20764
+ const index2 = defaultContexts.length;
20681
20765
  defaultContexts = [...defaultContexts, defaultContext];
20682
20766
  const Provider = (props) => {
20683
20767
  const { scope, children, ...context } = props;
20684
- const Context = scope?.[scopeName]?.[index3] || BaseContext;
20768
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
20685
20769
  const value = React382.useMemo(() => context, Object.values(context));
20686
20770
  return /* @__PURE__ */ jsx272(Context.Provider, { value, children });
20687
20771
  };
20688
20772
  Provider.displayName = rootComponentName + "Provider";
20689
20773
  function useContext222(consumerName, scope) {
20690
- const Context = scope?.[scopeName]?.[index3] || BaseContext;
20774
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
20691
20775
  const context = React382.useContext(Context);
20692
20776
  if (context)
20693
20777
  return context;
@@ -20884,10 +20968,10 @@ var OrderedDict = class _OrderedDict extends Map {
20884
20968
  super.set(key, value);
20885
20969
  return this;
20886
20970
  }
20887
- insert(index3, key, value) {
20971
+ insert(index2, key, value) {
20888
20972
  const has = this.has(key);
20889
20973
  const length2 = this.#keys.length;
20890
- const relativeIndex = toSafeInteger(index3);
20974
+ const relativeIndex = toSafeInteger(index2);
20891
20975
  let actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
20892
20976
  const safeIndex = actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
20893
20977
  if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {
@@ -20925,39 +21009,39 @@ var OrderedDict = class _OrderedDict extends Map {
20925
21009
  }
20926
21010
  return this;
20927
21011
  }
20928
- with(index3, key, value) {
21012
+ with(index2, key, value) {
20929
21013
  const copy = new _OrderedDict(this);
20930
- copy.insert(index3, key, value);
21014
+ copy.insert(index2, key, value);
20931
21015
  return copy;
20932
21016
  }
20933
21017
  before(key) {
20934
- const index3 = this.#keys.indexOf(key) - 1;
20935
- if (index3 < 0) {
21018
+ const index2 = this.#keys.indexOf(key) - 1;
21019
+ if (index2 < 0) {
20936
21020
  return;
20937
21021
  }
20938
- return this.entryAt(index3);
21022
+ return this.entryAt(index2);
20939
21023
  }
20940
21024
  setBefore(key, newKey, value) {
20941
- const index3 = this.#keys.indexOf(key);
20942
- if (index3 === -1) {
21025
+ const index2 = this.#keys.indexOf(key);
21026
+ if (index2 === -1) {
20943
21027
  return this;
20944
21028
  }
20945
- return this.insert(index3, newKey, value);
21029
+ return this.insert(index2, newKey, value);
20946
21030
  }
20947
21031
  after(key) {
20948
- let index3 = this.#keys.indexOf(key);
20949
- index3 = index3 === -1 || index3 === this.size - 1 ? -1 : index3 + 1;
20950
- if (index3 === -1) {
21032
+ let index2 = this.#keys.indexOf(key);
21033
+ index2 = index2 === -1 || index2 === this.size - 1 ? -1 : index2 + 1;
21034
+ if (index2 === -1) {
20951
21035
  return;
20952
21036
  }
20953
- return this.entryAt(index3);
21037
+ return this.entryAt(index2);
20954
21038
  }
20955
21039
  setAfter(key, newKey, value) {
20956
- const index3 = this.#keys.indexOf(key);
20957
- if (index3 === -1) {
21040
+ const index2 = this.#keys.indexOf(key);
21041
+ if (index2 === -1) {
20958
21042
  return this;
20959
21043
  }
20960
- return this.insert(index3 + 1, newKey, value);
21044
+ return this.insert(index2 + 1, newKey, value);
20961
21045
  }
20962
21046
  first() {
20963
21047
  return this.entryAt(0);
@@ -20976,21 +21060,21 @@ var OrderedDict = class _OrderedDict extends Map {
20976
21060
  }
20977
21061
  return deleted;
20978
21062
  }
20979
- deleteAt(index3) {
20980
- const key = this.keyAt(index3);
21063
+ deleteAt(index2) {
21064
+ const key = this.keyAt(index2);
20981
21065
  if (key !== undefined) {
20982
21066
  return this.delete(key);
20983
21067
  }
20984
21068
  return false;
20985
21069
  }
20986
- at(index3) {
20987
- const key = at(this.#keys, index3);
21070
+ at(index2) {
21071
+ const key = at(this.#keys, index2);
20988
21072
  if (key !== undefined) {
20989
21073
  return this.get(key);
20990
21074
  }
20991
21075
  }
20992
- entryAt(index3) {
20993
- const key = at(this.#keys, index3);
21076
+ entryAt(index2) {
21077
+ const key = at(this.#keys, index2);
20994
21078
  if (key !== undefined) {
20995
21079
  return [key, this.get(key)];
20996
21080
  }
@@ -20998,15 +21082,15 @@ var OrderedDict = class _OrderedDict extends Map {
20998
21082
  indexOf(key) {
20999
21083
  return this.#keys.indexOf(key);
21000
21084
  }
21001
- keyAt(index3) {
21002
- return at(this.#keys, index3);
21085
+ keyAt(index2) {
21086
+ return at(this.#keys, index2);
21003
21087
  }
21004
21088
  from(key, offset4) {
21005
- const index3 = this.indexOf(key);
21006
- if (index3 === -1) {
21089
+ const index2 = this.indexOf(key);
21090
+ if (index2 === -1) {
21007
21091
  return;
21008
21092
  }
21009
- let dest = index3 + offset4;
21093
+ let dest = index2 + offset4;
21010
21094
  if (dest < 0)
21011
21095
  dest = 0;
21012
21096
  if (dest >= this.size)
@@ -21014,11 +21098,11 @@ var OrderedDict = class _OrderedDict extends Map {
21014
21098
  return this.at(dest);
21015
21099
  }
21016
21100
  keyFrom(key, offset4) {
21017
- const index3 = this.indexOf(key);
21018
- if (index3 === -1) {
21101
+ const index2 = this.indexOf(key);
21102
+ if (index2 === -1) {
21019
21103
  return;
21020
21104
  }
21021
- let dest = index3 + offset4;
21105
+ let dest = index2 + offset4;
21022
21106
  if (dest < 0)
21023
21107
  dest = 0;
21024
21108
  if (dest >= this.size)
@@ -21026,68 +21110,68 @@ var OrderedDict = class _OrderedDict extends Map {
21026
21110
  return this.keyAt(dest);
21027
21111
  }
21028
21112
  find(predicate, thisArg) {
21029
- let index3 = 0;
21113
+ let index2 = 0;
21030
21114
  for (const entry of this) {
21031
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
21115
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
21032
21116
  return entry;
21033
21117
  }
21034
- index3++;
21118
+ index2++;
21035
21119
  }
21036
21120
  return;
21037
21121
  }
21038
21122
  findIndex(predicate, thisArg) {
21039
- let index3 = 0;
21123
+ let index2 = 0;
21040
21124
  for (const entry of this) {
21041
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
21042
- return index3;
21125
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
21126
+ return index2;
21043
21127
  }
21044
- index3++;
21128
+ index2++;
21045
21129
  }
21046
21130
  return -1;
21047
21131
  }
21048
21132
  filter(predicate, thisArg) {
21049
21133
  const entries = [];
21050
- let index3 = 0;
21134
+ let index2 = 0;
21051
21135
  for (const entry of this) {
21052
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
21136
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
21053
21137
  entries.push(entry);
21054
21138
  }
21055
- index3++;
21139
+ index2++;
21056
21140
  }
21057
21141
  return new _OrderedDict(entries);
21058
21142
  }
21059
21143
  map(callbackfn, thisArg) {
21060
21144
  const entries = [];
21061
- let index3 = 0;
21145
+ let index2 = 0;
21062
21146
  for (const entry of this) {
21063
- entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index3, this])]);
21064
- index3++;
21147
+ entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index2, this])]);
21148
+ index2++;
21065
21149
  }
21066
21150
  return new _OrderedDict(entries);
21067
21151
  }
21068
21152
  reduce(...args) {
21069
21153
  const [callbackfn, initialValue] = args;
21070
- let index3 = 0;
21154
+ let index2 = 0;
21071
21155
  let accumulator = initialValue ?? this.at(0);
21072
21156
  for (const entry of this) {
21073
- if (index3 === 0 && args.length === 1) {
21157
+ if (index2 === 0 && args.length === 1) {
21074
21158
  accumulator = entry;
21075
21159
  } else {
21076
- accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index3, this]);
21160
+ accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
21077
21161
  }
21078
- index3++;
21162
+ index2++;
21079
21163
  }
21080
21164
  return accumulator;
21081
21165
  }
21082
21166
  reduceRight(...args) {
21083
21167
  const [callbackfn, initialValue] = args;
21084
21168
  let accumulator = initialValue ?? this.at(-1);
21085
- for (let index3 = this.size - 1;index3 >= 0; index3--) {
21086
- const entry = this.at(index3);
21087
- if (index3 === this.size - 1 && args.length === 1) {
21169
+ for (let index2 = this.size - 1;index2 >= 0; index2--) {
21170
+ const entry = this.at(index2);
21171
+ if (index2 === this.size - 1 && args.length === 1) {
21088
21172
  accumulator = entry;
21089
21173
  } else {
21090
- accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index3, this]);
21174
+ accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
21091
21175
  }
21092
21176
  }
21093
21177
  return accumulator;
@@ -21098,8 +21182,8 @@ var OrderedDict = class _OrderedDict extends Map {
21098
21182
  }
21099
21183
  toReversed() {
21100
21184
  const reversed = new _OrderedDict;
21101
- for (let index3 = this.size - 1;index3 >= 0; index3--) {
21102
- const key = this.keyAt(index3);
21185
+ for (let index2 = this.size - 1;index2 >= 0; index2--) {
21186
+ const key = this.keyAt(index2);
21103
21187
  const element = this.get(key);
21104
21188
  reversed.set(key, element);
21105
21189
  }
@@ -21122,44 +21206,44 @@ var OrderedDict = class _OrderedDict extends Map {
21122
21206
  if (end !== undefined && end > 0) {
21123
21207
  stop = end - 1;
21124
21208
  }
21125
- for (let index3 = start;index3 <= stop; index3++) {
21126
- const key = this.keyAt(index3);
21209
+ for (let index2 = start;index2 <= stop; index2++) {
21210
+ const key = this.keyAt(index2);
21127
21211
  const element = this.get(key);
21128
21212
  result.set(key, element);
21129
21213
  }
21130
21214
  return result;
21131
21215
  }
21132
21216
  every(predicate, thisArg) {
21133
- let index3 = 0;
21217
+ let index2 = 0;
21134
21218
  for (const entry of this) {
21135
- if (!Reflect.apply(predicate, thisArg, [entry, index3, this])) {
21219
+ if (!Reflect.apply(predicate, thisArg, [entry, index2, this])) {
21136
21220
  return false;
21137
21221
  }
21138
- index3++;
21222
+ index2++;
21139
21223
  }
21140
21224
  return true;
21141
21225
  }
21142
21226
  some(predicate, thisArg) {
21143
- let index3 = 0;
21227
+ let index2 = 0;
21144
21228
  for (const entry of this) {
21145
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
21229
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
21146
21230
  return true;
21147
21231
  }
21148
- index3++;
21232
+ index2++;
21149
21233
  }
21150
21234
  return false;
21151
21235
  }
21152
21236
  };
21153
- function at(array, index3) {
21237
+ function at(array, index2) {
21154
21238
  if ("at" in Array.prototype) {
21155
- return Array.prototype.at.call(array, index3);
21239
+ return Array.prototype.at.call(array, index2);
21156
21240
  }
21157
- const actualIndex = toSafeIndex(array, index3);
21241
+ const actualIndex = toSafeIndex(array, index2);
21158
21242
  return actualIndex === -1 ? undefined : array[actualIndex];
21159
21243
  }
21160
- function toSafeIndex(array, index3) {
21244
+ function toSafeIndex(array, index2) {
21161
21245
  const length2 = array.length;
21162
- const relativeIndex = toSafeInteger(index3);
21246
+ const relativeIndex = toSafeInteger(index2);
21163
21247
  const actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
21164
21248
  return actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
21165
21249
  }
@@ -21211,7 +21295,7 @@ var Primitive2 = NODES2.reduce((primitive, node) => {
21211
21295
  Node2.displayName = `Primitive.${node}`;
21212
21296
  return { ...primitive, [node]: Node2 };
21213
21297
  }, {});
21214
- function useCallbackRef4(callback) {
21298
+ function useCallbackRef3(callback) {
21215
21299
  const callbackRef = React44.useRef(callback);
21216
21300
  React44.useEffect(() => {
21217
21301
  callbackRef.current = callback;
@@ -21315,7 +21399,7 @@ var RovingFocusGroupImpl = React47.forwardRef((props, forwardedRef) => {
21315
21399
  caller: GROUP_NAME2
21316
21400
  });
21317
21401
  const [isTabbingBackOut, setIsTabbingBackOut] = React47.useState(false);
21318
- const handleEntryFocus = useCallbackRef4(onEntryFocus);
21402
+ const handleEntryFocus = useCallbackRef3(onEntryFocus);
21319
21403
  const getItems = useCollection2(__scopeRovingFocusGroup);
21320
21404
  const isClickFocusRef = React47.useRef(false);
21321
21405
  const [focusableItemsCount, setFocusableItemsCount] = React47.useState(0);
@@ -21468,7 +21552,7 @@ function focusFirst2(candidates, preventScroll = false) {
21468
21552
  }
21469
21553
  }
21470
21554
  function wrapArray2(array, startIndex) {
21471
- return array.map((_, index3) => array[(startIndex + index3) % array.length]);
21555
+ return array.map((_, index2) => array[(startIndex + index2) % array.length]);
21472
21556
  }
21473
21557
  var Root3 = RovingFocusGroup;
21474
21558
  var Item2 = RovingFocusGroupItem;