@remotion/vercel 4.0.533 → 4.0.535

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.
@@ -115,6 +115,81 @@ import { statSync } from "fs";
115
115
  import { RenderInternals } from "@remotion/renderer";
116
116
 
117
117
  // ../core/dist/esm/no-react.mjs
118
+ var evaluateSourceNumericValue = (expression, config) => {
119
+ if (typeof expression === "number") {
120
+ return expression;
121
+ }
122
+ if (expression.type === "literal") {
123
+ return expression.value;
124
+ }
125
+ if (expression.type === "binary") {
126
+ const left = evaluateSourceNumericValue(expression.left, config);
127
+ const right = evaluateSourceNumericValue(expression.right, config);
128
+ switch (expression.operator) {
129
+ case "+":
130
+ return left + right;
131
+ case "-":
132
+ return left - right;
133
+ case "*":
134
+ return left * right;
135
+ case "/":
136
+ return left / right;
137
+ default:
138
+ throw new Error("Unknown source expression operator");
139
+ }
140
+ }
141
+ const value = expression.binding.type === "constant" ? expression.binding.value : config?.[expression.binding.field] ?? NaN;
142
+ if (expression.type === "video-config-multiplication") {
143
+ return value * expression.multiplier;
144
+ }
145
+ if (expression.type === "video-config-subtraction") {
146
+ return value - expression.subtrahend;
147
+ }
148
+ return value;
149
+ };
150
+ var evaluatedProps = new WeakMap;
151
+ var evaluateSourcePropStatuses = (props, config) => {
152
+ const configKey = config === null ? "" : \`\${config.durationInFrames}:\${config.fps}:\${config.width}:\${config.height}\`;
153
+ const cached = evaluatedProps.get(props) ?? new Map;
154
+ const existing = cached.get(configKey);
155
+ if (existing)
156
+ return existing;
157
+ const result = Object.fromEntries(Object.entries(props).map(([key, status]) => {
158
+ if (status.status === "computed") {
159
+ return [key, status];
160
+ }
161
+ const adjustment = status.keyframeDisplayOffsetAdjustment === null ? null : evaluateSourceNumericValue(status.keyframeDisplayOffsetAdjustment, config);
162
+ const rate = evaluateSourceNumericValue(status.keyframePlaybackRateAdjustment ?? 1, config);
163
+ if (adjustment !== null && !Number.isFinite(adjustment) || !Number.isFinite(rate) || rate <= 0) {
164
+ return [key, { status: "computed" }];
165
+ }
166
+ const timing = {
167
+ keyframeDisplayOffsetAdjustment: adjustment,
168
+ ...status.keyframePlaybackRateAdjustment === undefined ? {} : { keyframePlaybackRateAdjustment: rate }
169
+ };
170
+ if (status.status === "static") {
171
+ const value = status.numericExpression === undefined ? status.codeValue : evaluateSourceNumericValue(status.numericExpression, config);
172
+ return [
173
+ key,
174
+ status.numericExpression !== undefined && !Number.isFinite(value) ? { status: "computed" } : { ...status, ...timing, codeValue: value }
175
+ ];
176
+ }
177
+ const keyframes = status.keyframes.map((keyframe) => ({
178
+ ...keyframe,
179
+ frame: evaluateSourceNumericValue(keyframe.frame, config)
180
+ }));
181
+ if (keyframes.some((keyframe, index) => !Number.isFinite(keyframe.frame) || index > 0 && keyframe.frame <= keyframes[index - 1].frame)) {
182
+ return [key, { status: "computed" }];
183
+ }
184
+ return [key, { ...status, ...timing, keyframes }];
185
+ }));
186
+ cached.set(configKey, result);
187
+ if (cached.size > 8)
188
+ cached.delete(cached.keys().next().value);
189
+ evaluatedProps.set(props, cached);
190
+ return result;
191
+ };
192
+ var DEFAULT_SEQUENCE_ACTIVITY_LIMIT = 20;
118
193
  var NEWTON_ITERATIONS = 4;
119
194
  var NEWTON_MIN_SLOPE = 0.001;
120
195
  var SUBDIVISION_PRECISION = 0.0000001;
@@ -296,7 +371,7 @@ function advance({
296
371
  if (config.damping <= 0) {
297
372
  throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");
298
373
  }
299
- const c2 = config.damping;
374
+ const c = config.damping;
300
375
  const m = config.mass;
301
376
  const k = config.stiffness;
302
377
  const cacheKey = [
@@ -304,7 +379,7 @@ function advance({
304
379
  lastTimestamp,
305
380
  current,
306
381
  velocity,
307
- c2,
382
+ c,
308
383
  m,
309
384
  k,
310
385
  now
@@ -314,7 +389,7 @@ function advance({
314
389
  }
315
390
  const v0 = -velocity;
316
391
  const x0 = toValue - current;
317
- const zeta = c2 / (2 * Math.sqrt(k * m));
392
+ const zeta = c / (2 * Math.sqrt(k * m));
318
393
  const omega0 = Math.sqrt(k / m);
319
394
  const omega1 = omega0 * Math.sqrt(1 - zeta ** 2);
320
395
  const t = deltaTime / 1000;
@@ -1444,6 +1519,14 @@ function interpolate(input, inputRange, outputRange, options) {
1444
1519
  checkInfiniteRange("outputRange", outputRange);
1445
1520
  return interpolateNumber({ input, inputRange, outputRange, options });
1446
1521
  }
1522
+ var ENABLE_V5_BREAKING_CHANGES = false;
1523
+ var DEFAULT_PREMOUNT_IN_SECONDS = ENABLE_V5_BREAKING_CHANGES ? 2 : 0;
1524
+ var DEFAULT_STUDIO_PREMOUNT_IN_SECONDS = 2;
1525
+ var validateDefaultPremountInSeconds = (value) => {
1526
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
1527
+ throw new TypeError(\`defaultPremountInSeconds must be a finite, non-negative number, but got \${String(value)}.\`);
1528
+ }
1529
+ };
1447
1530
  var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
1448
1531
  var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
1449
1532
  var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
@@ -1820,6 +1903,26 @@ var trimBeforeField = {
1820
1903
  step: 1,
1821
1904
  hiddenFromList: true
1822
1905
  };
1906
+ var sequenceTimingSchema = {
1907
+ from: {
1908
+ ...fromField,
1909
+ description: "From",
1910
+ hiddenFromList: false,
1911
+ keyframable: false
1912
+ },
1913
+ durationInFrames: {
1914
+ ...durationInFramesField,
1915
+ description: "Duration",
1916
+ hiddenFromList: false,
1917
+ keyframable: false
1918
+ },
1919
+ trimBefore: {
1920
+ ...trimBeforeField,
1921
+ description: "Trim before",
1922
+ hiddenFromList: false,
1923
+ keyframable: false
1924
+ }
1925
+ };
1823
1926
  var freezeField = {
1824
1927
  type: "number",
1825
1928
  default: null,
@@ -1943,8 +2046,8 @@ function hslToRgb(h, s, l) {
1943
2046
  const p = 2 * l - q;
1944
2047
  const r = hue2rgb(p, q, h + 1 / 3);
1945
2048
  const g = hue2rgb(p, q, h);
1946
- const b2 = hue2rgb(p, q, h - 1 / 3);
1947
- return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b2 * 255) << 8;
2049
+ const b = hue2rgb(p, q, h - 1 / 3);
2050
+ return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
1948
2051
  }
1949
2052
  function parse255(str) {
1950
2053
  const int = Number.parseInt(str, 10);
@@ -2008,25 +2111,25 @@ function parseModernAlpha(str) {
2008
2111
  }
2009
2112
  return Math.max(0, Math.min(1, Number.parseFloat(str)));
2010
2113
  }
2011
- function linearToSrgb(c2) {
2012
- if (c2 <= 0.0031308)
2013
- return 12.92 * c2;
2014
- return 1.055 * c2 ** (1 / 2.4) - 0.055;
2114
+ function linearToSrgb(c) {
2115
+ if (c <= 0.0031308)
2116
+ return 12.92 * c;
2117
+ return 1.055 * c ** (1 / 2.4) - 0.055;
2015
2118
  }
2016
2119
  function clamp01(v) {
2017
2120
  return Math.max(0, Math.min(1, v));
2018
2121
  }
2019
- function rgbFloatToInt(r, g, b2, alpha) {
2122
+ function rgbFloatToInt(r, g, b, alpha) {
2020
2123
  const ri = Math.round(clamp01(r) * 255);
2021
2124
  const gi = Math.round(clamp01(g) * 255);
2022
- const bi = Math.round(clamp01(b2) * 255);
2125
+ const bi = Math.round(clamp01(b) * 255);
2023
2126
  const ai = Math.round(clamp01(alpha) * 255);
2024
2127
  return (ri << 24 | gi << 16 | bi << 8 | ai) >>> 0;
2025
2128
  }
2026
- function oklabToSrgb(L, a2, b2) {
2027
- const l_ = L + 0.3963377774 * a2 + 0.2158037573 * b2;
2028
- const m_ = L - 0.1055613458 * a2 - 0.0638541728 * b2;
2029
- const s_ = L - 0.0894841775 * a2 - 1.291485548 * b2;
2129
+ function oklabToSrgb(L, a, b) {
2130
+ const l_ = L + 0.3963377774 * a + 0.2158037573 * b;
2131
+ const m_ = L - 0.1055613458 * a - 0.0638541728 * b;
2132
+ const s_ = L - 0.0894841775 * a - 1.291485548 * b;
2030
2133
  const l = l_ * l_ * l_;
2031
2134
  const m = m_ * m_ * m_;
2032
2135
  const s = s_ * s_ * s_;
@@ -2035,15 +2138,15 @@ function oklabToSrgb(L, a2, b2) {
2035
2138
  const bLin = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
2036
2139
  return [linearToSrgb(rLin), linearToSrgb(gLin), linearToSrgb(bLin)];
2037
2140
  }
2038
- function labToSrgb(L, a2, b2) {
2141
+ function labToSrgb(L, a, b) {
2039
2142
  const epsilon = 216 / 24389;
2040
2143
  const kappa = 24389 / 27;
2041
2144
  const Xn = 0.95047;
2042
2145
  const Yn = 1;
2043
2146
  const Zn = 1.08883;
2044
2147
  const fy = (L + 16) / 116;
2045
- const fx = a2 / 500 + fy;
2046
- const fz = fy - b2 / 200;
2148
+ const fx = a / 500 + fy;
2149
+ const fz = fy - b / 200;
2047
2150
  const fx3 = fx * fx * fx;
2048
2151
  const fz3 = fz * fz * fz;
2049
2152
  const xr = fx3 > epsilon ? fx3 : (116 * fx - 16) / kappa;
@@ -2275,27 +2378,27 @@ function normalizeColor(color) {
2275
2378
  const H = parseHueAngle(match[3]);
2276
2379
  const alpha = parseModernAlpha(match[4]);
2277
2380
  const hRad = H * Math.PI / 180;
2278
- const [r, g, b2] = oklabToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
2279
- return rgbFloatToInt(r, g, b2, alpha);
2381
+ const [r, g, b] = oklabToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
2382
+ return rgbFloatToInt(r, g, b, alpha);
2280
2383
  }
2281
2384
  }
2282
2385
  if (matchers.oklab) {
2283
2386
  if (match = matchers.oklab.exec(color)) {
2284
2387
  const L = parseModernComponent(match[1], 1);
2285
- const a2 = parseModernComponent(match[2], 0.4);
2286
- const b2 = parseModernComponent(match[3], 0.4);
2388
+ const a = parseModernComponent(match[2], 0.4);
2389
+ const b = parseModernComponent(match[3], 0.4);
2287
2390
  const alpha = parseModernAlpha(match[4]);
2288
- const [r, g, bl] = oklabToSrgb(L, a2, b2);
2391
+ const [r, g, bl] = oklabToSrgb(L, a, b);
2289
2392
  return rgbFloatToInt(r, g, bl, alpha);
2290
2393
  }
2291
2394
  }
2292
2395
  if (matchers.lab) {
2293
2396
  if (match = matchers.lab.exec(color)) {
2294
2397
  const L = parseModernComponent(match[1], 100);
2295
- const a2 = parseModernComponent(match[2], 125);
2296
- const b2 = parseModernComponent(match[3], 125);
2398
+ const a = parseModernComponent(match[2], 125);
2399
+ const b = parseModernComponent(match[3], 125);
2297
2400
  const alpha = parseModernAlpha(match[4]);
2298
- const [r, g, bl] = labToSrgb(L, a2, b2);
2401
+ const [r, g, bl] = labToSrgb(L, a, b);
2299
2402
  return rgbFloatToInt(r, g, bl, alpha);
2300
2403
  }
2301
2404
  }
@@ -2376,7 +2479,6 @@ var serializeScaleValue = ([x, y, z]) => {
2376
2479
  function truthy(value) {
2377
2480
  return Boolean(value);
2378
2481
  }
2379
- var ENABLE_V5_BREAKING_CHANGES = false;
2380
2482
  var validCodecs = [
2381
2483
  "h264",
2382
2484
  "h265",
@@ -2473,6 +2575,12 @@ var getOffthreadVideoSource = ({
2473
2575
  return \`http://localhost:\${window.remotion_proxyPort}/proxy?src=\${encodeURIComponent(getAbsoluteSrc(src))}&time=\${encodeURIComponent(Math.max(0, currentTime))}&transparent=\${String(transparent)}&toneMapped=\${String(toneMapped)}\`;
2474
2576
  };
2475
2577
  var NoReactInternals = {
2578
+ DEFAULT_PREMOUNT_IN_SECONDS,
2579
+ DEFAULT_STUDIO_PREMOUNT_IN_SECONDS,
2580
+ DEFAULT_SEQUENCE_ACTIVITY_LIMIT,
2581
+ validateDefaultPremountInSeconds,
2582
+ evaluateSourceNumericValue,
2583
+ evaluateSourcePropStatuses,
2476
2584
  processColor,
2477
2585
  truthy,
2478
2586
  validateFps,
@@ -2620,6 +2728,81 @@ import { RenderInternals } from "@remotion/renderer";
2620
2728
  import { put } from "@vercel/blob";
2621
2729
 
2622
2730
  // ../core/dist/esm/no-react.mjs
2731
+ var evaluateSourceNumericValue = (expression, config) => {
2732
+ if (typeof expression === "number") {
2733
+ return expression;
2734
+ }
2735
+ if (expression.type === "literal") {
2736
+ return expression.value;
2737
+ }
2738
+ if (expression.type === "binary") {
2739
+ const left = evaluateSourceNumericValue(expression.left, config);
2740
+ const right = evaluateSourceNumericValue(expression.right, config);
2741
+ switch (expression.operator) {
2742
+ case "+":
2743
+ return left + right;
2744
+ case "-":
2745
+ return left - right;
2746
+ case "*":
2747
+ return left * right;
2748
+ case "/":
2749
+ return left / right;
2750
+ default:
2751
+ throw new Error("Unknown source expression operator");
2752
+ }
2753
+ }
2754
+ const value = expression.binding.type === "constant" ? expression.binding.value : config?.[expression.binding.field] ?? NaN;
2755
+ if (expression.type === "video-config-multiplication") {
2756
+ return value * expression.multiplier;
2757
+ }
2758
+ if (expression.type === "video-config-subtraction") {
2759
+ return value - expression.subtrahend;
2760
+ }
2761
+ return value;
2762
+ };
2763
+ var evaluatedProps = new WeakMap;
2764
+ var evaluateSourcePropStatuses = (props, config) => {
2765
+ const configKey = config === null ? "" : \`\${config.durationInFrames}:\${config.fps}:\${config.width}:\${config.height}\`;
2766
+ const cached = evaluatedProps.get(props) ?? new Map;
2767
+ const existing = cached.get(configKey);
2768
+ if (existing)
2769
+ return existing;
2770
+ const result = Object.fromEntries(Object.entries(props).map(([key, status]) => {
2771
+ if (status.status === "computed") {
2772
+ return [key, status];
2773
+ }
2774
+ const adjustment = status.keyframeDisplayOffsetAdjustment === null ? null : evaluateSourceNumericValue(status.keyframeDisplayOffsetAdjustment, config);
2775
+ const rate = evaluateSourceNumericValue(status.keyframePlaybackRateAdjustment ?? 1, config);
2776
+ if (adjustment !== null && !Number.isFinite(adjustment) || !Number.isFinite(rate) || rate <= 0) {
2777
+ return [key, { status: "computed" }];
2778
+ }
2779
+ const timing = {
2780
+ keyframeDisplayOffsetAdjustment: adjustment,
2781
+ ...status.keyframePlaybackRateAdjustment === undefined ? {} : { keyframePlaybackRateAdjustment: rate }
2782
+ };
2783
+ if (status.status === "static") {
2784
+ const value = status.numericExpression === undefined ? status.codeValue : evaluateSourceNumericValue(status.numericExpression, config);
2785
+ return [
2786
+ key,
2787
+ status.numericExpression !== undefined && !Number.isFinite(value) ? { status: "computed" } : { ...status, ...timing, codeValue: value }
2788
+ ];
2789
+ }
2790
+ const keyframes = status.keyframes.map((keyframe) => ({
2791
+ ...keyframe,
2792
+ frame: evaluateSourceNumericValue(keyframe.frame, config)
2793
+ }));
2794
+ if (keyframes.some((keyframe, index) => !Number.isFinite(keyframe.frame) || index > 0 && keyframe.frame <= keyframes[index - 1].frame)) {
2795
+ return [key, { status: "computed" }];
2796
+ }
2797
+ return [key, { ...status, ...timing, keyframes }];
2798
+ }));
2799
+ cached.set(configKey, result);
2800
+ if (cached.size > 8)
2801
+ cached.delete(cached.keys().next().value);
2802
+ evaluatedProps.set(props, cached);
2803
+ return result;
2804
+ };
2805
+ var DEFAULT_SEQUENCE_ACTIVITY_LIMIT = 20;
2623
2806
  var NEWTON_ITERATIONS = 4;
2624
2807
  var NEWTON_MIN_SLOPE = 0.001;
2625
2808
  var SUBDIVISION_PRECISION = 0.0000001;
@@ -2801,7 +2984,7 @@ function advance({
2801
2984
  if (config.damping <= 0) {
2802
2985
  throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");
2803
2986
  }
2804
- const c2 = config.damping;
2987
+ const c = config.damping;
2805
2988
  const m = config.mass;
2806
2989
  const k = config.stiffness;
2807
2990
  const cacheKey = [
@@ -2809,7 +2992,7 @@ function advance({
2809
2992
  lastTimestamp,
2810
2993
  current,
2811
2994
  velocity,
2812
- c2,
2995
+ c,
2813
2996
  m,
2814
2997
  k,
2815
2998
  now
@@ -2819,7 +3002,7 @@ function advance({
2819
3002
  }
2820
3003
  const v0 = -velocity;
2821
3004
  const x0 = toValue - current;
2822
- const zeta = c2 / (2 * Math.sqrt(k * m));
3005
+ const zeta = c / (2 * Math.sqrt(k * m));
2823
3006
  const omega0 = Math.sqrt(k / m);
2824
3007
  const omega1 = omega0 * Math.sqrt(1 - zeta ** 2);
2825
3008
  const t = deltaTime / 1000;
@@ -3949,6 +4132,14 @@ function interpolate(input, inputRange, outputRange, options) {
3949
4132
  checkInfiniteRange("outputRange", outputRange);
3950
4133
  return interpolateNumber({ input, inputRange, outputRange, options });
3951
4134
  }
4135
+ var ENABLE_V5_BREAKING_CHANGES = false;
4136
+ var DEFAULT_PREMOUNT_IN_SECONDS = ENABLE_V5_BREAKING_CHANGES ? 2 : 0;
4137
+ var DEFAULT_STUDIO_PREMOUNT_IN_SECONDS = 2;
4138
+ var validateDefaultPremountInSeconds = (value) => {
4139
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
4140
+ throw new TypeError(\`defaultPremountInSeconds must be a finite, non-negative number, but got \${String(value)}.\`);
4141
+ }
4142
+ };
3952
4143
  var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
3953
4144
  var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
3954
4145
  var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
@@ -4325,6 +4516,26 @@ var trimBeforeField = {
4325
4516
  step: 1,
4326
4517
  hiddenFromList: true
4327
4518
  };
4519
+ var sequenceTimingSchema = {
4520
+ from: {
4521
+ ...fromField,
4522
+ description: "From",
4523
+ hiddenFromList: false,
4524
+ keyframable: false
4525
+ },
4526
+ durationInFrames: {
4527
+ ...durationInFramesField,
4528
+ description: "Duration",
4529
+ hiddenFromList: false,
4530
+ keyframable: false
4531
+ },
4532
+ trimBefore: {
4533
+ ...trimBeforeField,
4534
+ description: "Trim before",
4535
+ hiddenFromList: false,
4536
+ keyframable: false
4537
+ }
4538
+ };
4328
4539
  var freezeField = {
4329
4540
  type: "number",
4330
4541
  default: null,
@@ -4448,8 +4659,8 @@ function hslToRgb(h, s, l) {
4448
4659
  const p = 2 * l - q;
4449
4660
  const r = hue2rgb(p, q, h + 1 / 3);
4450
4661
  const g = hue2rgb(p, q, h);
4451
- const b2 = hue2rgb(p, q, h - 1 / 3);
4452
- return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b2 * 255) << 8;
4662
+ const b = hue2rgb(p, q, h - 1 / 3);
4663
+ return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
4453
4664
  }
4454
4665
  function parse255(str) {
4455
4666
  const int = Number.parseInt(str, 10);
@@ -4513,25 +4724,25 @@ function parseModernAlpha(str) {
4513
4724
  }
4514
4725
  return Math.max(0, Math.min(1, Number.parseFloat(str)));
4515
4726
  }
4516
- function linearToSrgb(c2) {
4517
- if (c2 <= 0.0031308)
4518
- return 12.92 * c2;
4519
- return 1.055 * c2 ** (1 / 2.4) - 0.055;
4727
+ function linearToSrgb(c) {
4728
+ if (c <= 0.0031308)
4729
+ return 12.92 * c;
4730
+ return 1.055 * c ** (1 / 2.4) - 0.055;
4520
4731
  }
4521
4732
  function clamp01(v) {
4522
4733
  return Math.max(0, Math.min(1, v));
4523
4734
  }
4524
- function rgbFloatToInt(r, g, b2, alpha) {
4735
+ function rgbFloatToInt(r, g, b, alpha) {
4525
4736
  const ri = Math.round(clamp01(r) * 255);
4526
4737
  const gi = Math.round(clamp01(g) * 255);
4527
- const bi = Math.round(clamp01(b2) * 255);
4738
+ const bi = Math.round(clamp01(b) * 255);
4528
4739
  const ai = Math.round(clamp01(alpha) * 255);
4529
4740
  return (ri << 24 | gi << 16 | bi << 8 | ai) >>> 0;
4530
4741
  }
4531
- function oklabToSrgb(L, a2, b2) {
4532
- const l_ = L + 0.3963377774 * a2 + 0.2158037573 * b2;
4533
- const m_ = L - 0.1055613458 * a2 - 0.0638541728 * b2;
4534
- const s_ = L - 0.0894841775 * a2 - 1.291485548 * b2;
4742
+ function oklabToSrgb(L, a, b) {
4743
+ const l_ = L + 0.3963377774 * a + 0.2158037573 * b;
4744
+ const m_ = L - 0.1055613458 * a - 0.0638541728 * b;
4745
+ const s_ = L - 0.0894841775 * a - 1.291485548 * b;
4535
4746
  const l = l_ * l_ * l_;
4536
4747
  const m = m_ * m_ * m_;
4537
4748
  const s = s_ * s_ * s_;
@@ -4540,15 +4751,15 @@ function oklabToSrgb(L, a2, b2) {
4540
4751
  const bLin = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
4541
4752
  return [linearToSrgb(rLin), linearToSrgb(gLin), linearToSrgb(bLin)];
4542
4753
  }
4543
- function labToSrgb(L, a2, b2) {
4754
+ function labToSrgb(L, a, b) {
4544
4755
  const epsilon = 216 / 24389;
4545
4756
  const kappa = 24389 / 27;
4546
4757
  const Xn = 0.95047;
4547
4758
  const Yn = 1;
4548
4759
  const Zn = 1.08883;
4549
4760
  const fy = (L + 16) / 116;
4550
- const fx = a2 / 500 + fy;
4551
- const fz = fy - b2 / 200;
4761
+ const fx = a / 500 + fy;
4762
+ const fz = fy - b / 200;
4552
4763
  const fx3 = fx * fx * fx;
4553
4764
  const fz3 = fz * fz * fz;
4554
4765
  const xr = fx3 > epsilon ? fx3 : (116 * fx - 16) / kappa;
@@ -4780,27 +4991,27 @@ function normalizeColor(color) {
4780
4991
  const H = parseHueAngle(match[3]);
4781
4992
  const alpha = parseModernAlpha(match[4]);
4782
4993
  const hRad = H * Math.PI / 180;
4783
- const [r, g, b2] = oklabToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
4784
- return rgbFloatToInt(r, g, b2, alpha);
4994
+ const [r, g, b] = oklabToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
4995
+ return rgbFloatToInt(r, g, b, alpha);
4785
4996
  }
4786
4997
  }
4787
4998
  if (matchers.oklab) {
4788
4999
  if (match = matchers.oklab.exec(color)) {
4789
5000
  const L = parseModernComponent(match[1], 1);
4790
- const a2 = parseModernComponent(match[2], 0.4);
4791
- const b2 = parseModernComponent(match[3], 0.4);
5001
+ const a = parseModernComponent(match[2], 0.4);
5002
+ const b = parseModernComponent(match[3], 0.4);
4792
5003
  const alpha = parseModernAlpha(match[4]);
4793
- const [r, g, bl] = oklabToSrgb(L, a2, b2);
5004
+ const [r, g, bl] = oklabToSrgb(L, a, b);
4794
5005
  return rgbFloatToInt(r, g, bl, alpha);
4795
5006
  }
4796
5007
  }
4797
5008
  if (matchers.lab) {
4798
5009
  if (match = matchers.lab.exec(color)) {
4799
5010
  const L = parseModernComponent(match[1], 100);
4800
- const a2 = parseModernComponent(match[2], 125);
4801
- const b2 = parseModernComponent(match[3], 125);
5011
+ const a = parseModernComponent(match[2], 125);
5012
+ const b = parseModernComponent(match[3], 125);
4802
5013
  const alpha = parseModernAlpha(match[4]);
4803
- const [r, g, bl] = labToSrgb(L, a2, b2);
5014
+ const [r, g, bl] = labToSrgb(L, a, b);
4804
5015
  return rgbFloatToInt(r, g, bl, alpha);
4805
5016
  }
4806
5017
  }
@@ -4881,7 +5092,6 @@ var serializeScaleValue = ([x, y, z]) => {
4881
5092
  function truthy(value) {
4882
5093
  return Boolean(value);
4883
5094
  }
4884
- var ENABLE_V5_BREAKING_CHANGES = false;
4885
5095
  var validCodecs = [
4886
5096
  "h264",
4887
5097
  "h265",
@@ -4978,6 +5188,12 @@ var getOffthreadVideoSource = ({
4978
5188
  return \`http://localhost:\${window.remotion_proxyPort}/proxy?src=\${encodeURIComponent(getAbsoluteSrc(src))}&time=\${encodeURIComponent(Math.max(0, currentTime))}&transparent=\${String(transparent)}&toneMapped=\${String(toneMapped)}\`;
4979
5189
  };
4980
5190
  var NoReactInternals = {
5191
+ DEFAULT_PREMOUNT_IN_SECONDS,
5192
+ DEFAULT_STUDIO_PREMOUNT_IN_SECONDS,
5193
+ DEFAULT_SEQUENCE_ACTIVITY_LIMIT,
5194
+ validateDefaultPremountInSeconds,
5195
+ evaluateSourceNumericValue,
5196
+ evaluateSourcePropStatuses,
4981
5197
  processColor,
4982
5198
  truthy,
4983
5199
  validateFps,
@@ -5132,6 +5348,7 @@ try {
5132
5348
  preferLossless: config.preferLossless,
5133
5349
  enforceAudioTrack: config.enforceAudioTrack,
5134
5350
  disallowParallelEncoding: config.disallowParallelEncoding,
5351
+ disableSharedMemoryCapture: config.disableSharedMemoryCapture,
5135
5352
  concurrency: config.concurrency,
5136
5353
  binariesDirectory: config.binariesDirectory,
5137
5354
  metadata: config.metadata,
@@ -5392,7 +5609,7 @@ var FALLBACK_URL = "https://remotion.media/libc6_2.35-0ubuntu3.1_amd64.deb";
5392
5609
  async function patchCompositor({
5393
5610
  sandbox
5394
5611
  }) {
5395
- const script5 = `
5612
+ const script = `
5396
5613
  set -euo pipefail
5397
5614
 
5398
5615
  echo "[patch-compositor] Listing node_modules/@remotion/:"
@@ -5461,7 +5678,7 @@ echo "[patch-compositor] Compositor patched successfully"
5461
5678
  `;
5462
5679
  const cmd = await sandbox.runCommand({
5463
5680
  cmd: "bash",
5464
- args: ["-c", script5],
5681
+ args: ["-c", script],
5465
5682
  detached: true
5466
5683
  });
5467
5684
  for await (const _log of cmd.logs()) {}
@@ -5625,6 +5842,7 @@ var internalRenderMediaOnVercel = async (options) => {
5625
5842
  preferLossless = false,
5626
5843
  enforceAudioTrack = false,
5627
5844
  disallowParallelEncoding = false,
5845
+ disableSharedMemoryCapture = false,
5628
5846
  concurrency,
5629
5847
  metadata,
5630
5848
  licenseKey,
@@ -5674,6 +5892,7 @@ var internalRenderMediaOnVercel = async (options) => {
5674
5892
  preferLossless,
5675
5893
  enforceAudioTrack,
5676
5894
  disallowParallelEncoding,
5895
+ disableSharedMemoryCapture,
5677
5896
  concurrency: concurrency ?? null,
5678
5897
  metadata: metadata ?? null,
5679
5898
  licenseKey: licenseKey ?? null,
@@ -5870,10 +6089,10 @@ async function uploadToVercelBlob({
5870
6089
  return result;
5871
6090
  }
5872
6091
  export {
5873
- uploadToVercelBlob,
5874
- renderStillOnVercel,
5875
- renderMediaOnVercel,
5876
- getRenderProgress,
6092
+ addBundleToSandbox,
5877
6093
  createSandbox,
5878
- addBundleToSandbox
6094
+ getRenderProgress,
6095
+ renderMediaOnVercel,
6096
+ renderStillOnVercel,
6097
+ uploadToVercelBlob
5879
6098
  };
@@ -19,6 +19,7 @@ type RenderMediaOnVercelBaseOptions = {
19
19
  preferLossless?: boolean;
20
20
  enforceAudioTrack?: boolean;
21
21
  disallowParallelEncoding?: boolean;
22
+ disableSharedMemoryCapture?: boolean;
22
23
  concurrency?: number | string | null;
23
24
  metadata?: Record<string, string> | null;
24
25
  licenseKey?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/vercel",
3
- "version": "4.0.533",
3
+ "version": "4.0.535",
4
4
  "description": "Render Remotion videos on Vercel Sandbox",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "format": "oxfmt src",
15
15
  "lint": "eslint src",
16
16
  "watch": "tsgo -w",
17
- "make": "bun --env-file=../.env.bundle bundle.ts && tsgo && tsgo -p tsconfig.scripts.json"
17
+ "make": "bun --env-file=../.env.bundle bundle.ts && tsgo && bun check -p tsconfig.scripts.json"
18
18
  },
19
19
  "author": "Jonny Burger <jonny@remotion.dev>",
20
20
  "contributors": [],
@@ -23,8 +23,8 @@
23
23
  "url": "https://github.com/remotion-dev/remotion/issues"
24
24
  },
25
25
  "dependencies": {
26
- "@remotion/renderer": "4.0.533",
27
- "remotion": "4.0.533"
26
+ "@remotion/renderer": "4.0.535",
27
+ "remotion": "4.0.535"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@vercel/sandbox": ">=1.0.0"
@@ -38,7 +38,7 @@
38
38
  "./package.json": "./package.json"
39
39
  },
40
40
  "devDependencies": {
41
- "@remotion/eslint-config-internal": "4.0.533",
41
+ "@remotion/eslint-config-internal": "4.0.535",
42
42
  "@vercel/blob": "2.3.0",
43
43
  "@vercel/sandbox": "1.6.0",
44
44
  "eslint": "9.19.0",