@remotion/renderer 4.0.256 → 4.0.257

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.
@@ -18,8 +18,24 @@ var __toESM = (mod, isNodeMode, target) => {
18
18
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
19
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
20
 
21
- // /Users/jonathanburger/remotion/node_modules/.pnpm/debug@4.3.4/node_modules/ms/index.js
21
+ // ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
22
22
  var require_ms = __commonJS((exports, module) => {
23
+ var s = 1000;
24
+ var m = s * 60;
25
+ var h = m * 60;
26
+ var d = h * 24;
27
+ var w = d * 7;
28
+ var y = d * 365.25;
29
+ module.exports = function(val, options) {
30
+ options = options || {};
31
+ var type = typeof val;
32
+ if (type === "string" && val.length > 0) {
33
+ return parse(val);
34
+ } else if (type === "number" && isFinite(val)) {
35
+ return options.long ? fmtLong(val) : fmtShort(val);
36
+ }
37
+ throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
38
+ };
23
39
  function parse(str) {
24
40
  str = String(str);
25
41
  if (str.length > 100) {
@@ -110,22 +126,6 @@ var require_ms = __commonJS((exports, module) => {
110
126
  var isPlural = msAbs >= n * 1.5;
111
127
  return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
112
128
  }
113
- var s = 1000;
114
- var m = s * 60;
115
- var h = m * 60;
116
- var d = h * 24;
117
- var w = d * 7;
118
- var y = d * 365.25;
119
- module.exports = function(val, options) {
120
- options = options || {};
121
- var type = typeof val;
122
- if (type === "string" && val.length > 0) {
123
- return parse(val);
124
- } else if (type === "number" && isFinite(val)) {
125
- return options.long ? fmtLong(val) : fmtShort(val);
126
- }
127
- throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
128
- };
129
129
  });
130
130
 
131
131
  // ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js
@@ -291,62 +291,6 @@ var require_common = __commonJS((exports, module) => {
291
291
 
292
292
  // ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
293
293
  var require_browser = __commonJS((exports, module) => {
294
- function useColors() {
295
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
296
- return true;
297
- }
298
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
299
- return false;
300
- }
301
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
302
- }
303
- function formatArgs(args) {
304
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
305
- if (!this.useColors) {
306
- return;
307
- }
308
- const c = "color: " + this.color;
309
- args.splice(1, 0, c, "color: inherit");
310
- let index = 0;
311
- let lastC = 0;
312
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
313
- if (match === "%%") {
314
- return;
315
- }
316
- index++;
317
- if (match === "%c") {
318
- lastC = index;
319
- }
320
- });
321
- args.splice(lastC, 0, c);
322
- }
323
- function save(namespaces) {
324
- try {
325
- if (namespaces) {
326
- exports.storage.setItem("debug", namespaces);
327
- } else {
328
- exports.storage.removeItem("debug");
329
- }
330
- } catch (error) {
331
- }
332
- }
333
- function load() {
334
- let r;
335
- try {
336
- r = exports.storage.getItem("debug");
337
- } catch (error) {
338
- }
339
- if (!r && typeof process !== "undefined" && "env" in process) {
340
- r = process.env.DEBUG;
341
- }
342
- return r;
343
- }
344
- function localstorage() {
345
- try {
346
- return localStorage;
347
- } catch (error) {
348
- }
349
- }
350
294
  exports.formatArgs = formatArgs;
351
295
  exports.save = save;
352
296
  exports.load = load;
@@ -439,8 +383,64 @@ var require_browser = __commonJS((exports, module) => {
439
383
  "#FFCC00",
440
384
  "#FFCC33"
441
385
  ];
386
+ function useColors() {
387
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
388
+ return true;
389
+ }
390
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
391
+ return false;
392
+ }
393
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
394
+ }
395
+ function formatArgs(args) {
396
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
397
+ if (!this.useColors) {
398
+ return;
399
+ }
400
+ const c = "color: " + this.color;
401
+ args.splice(1, 0, c, "color: inherit");
402
+ let index = 0;
403
+ let lastC = 0;
404
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
405
+ if (match === "%%") {
406
+ return;
407
+ }
408
+ index++;
409
+ if (match === "%c") {
410
+ lastC = index;
411
+ }
412
+ });
413
+ args.splice(lastC, 0, c);
414
+ }
442
415
  exports.log = console.debug || console.log || (() => {
443
416
  });
417
+ function save(namespaces) {
418
+ try {
419
+ if (namespaces) {
420
+ exports.storage.setItem("debug", namespaces);
421
+ } else {
422
+ exports.storage.removeItem("debug");
423
+ }
424
+ } catch (error) {
425
+ }
426
+ }
427
+ function load() {
428
+ let r;
429
+ try {
430
+ r = exports.storage.getItem("debug");
431
+ } catch (error) {
432
+ }
433
+ if (!r && typeof process !== "undefined" && "env" in process) {
434
+ r = process.env.DEBUG;
435
+ }
436
+ return r;
437
+ }
438
+ function localstorage() {
439
+ try {
440
+ return localStorage;
441
+ } catch (error) {
442
+ }
443
+ }
444
444
  module.exports = require_common()(exports);
445
445
  var { formatters } = module.exports;
446
446
  formatters.j = function(v) {
@@ -452,7 +452,7 @@ var require_browser = __commonJS((exports, module) => {
452
452
  };
453
453
  });
454
454
 
455
- // /Users/jonathanburger/remotion/node_modules/.pnpm/supports-color@7.2.0/node_modules/has-flag/index.js
455
+ // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
456
456
  var require_has_flag = __commonJS((exports, module) => {
457
457
  module.exports = (flag, argv = process.argv) => {
458
458
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -462,8 +462,27 @@ var require_has_flag = __commonJS((exports, module) => {
462
462
  };
463
463
  });
464
464
 
465
- // /Users/jonathanburger/remotion/node_modules/.pnpm/node_modules/supports-color/index.js
465
+ // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
466
466
  var require_supports_color = __commonJS((exports, module) => {
467
+ var os = __require("os");
468
+ var tty = __require("tty");
469
+ var hasFlag = require_has_flag();
470
+ var { env } = process;
471
+ var forceColor;
472
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
473
+ forceColor = 0;
474
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
475
+ forceColor = 1;
476
+ }
477
+ if ("FORCE_COLOR" in env) {
478
+ if (env.FORCE_COLOR === "true") {
479
+ forceColor = 1;
480
+ } else if (env.FORCE_COLOR === "false") {
481
+ forceColor = 0;
482
+ } else {
483
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
484
+ }
485
+ }
467
486
  function translateLevel(level) {
468
487
  if (level === 0) {
469
488
  return false;
@@ -535,25 +554,6 @@ var require_supports_color = __commonJS((exports, module) => {
535
554
  const level = supportsColor(stream, stream && stream.isTTY);
536
555
  return translateLevel(level);
537
556
  }
538
- var os = __require("os");
539
- var tty = __require("tty");
540
- var hasFlag = require_has_flag();
541
- var { env } = process;
542
- var forceColor;
543
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
544
- forceColor = 0;
545
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
546
- forceColor = 1;
547
- }
548
- if ("FORCE_COLOR" in env) {
549
- if (env.FORCE_COLOR === "true") {
550
- forceColor = 1;
551
- } else if (env.FORCE_COLOR === "false") {
552
- forceColor = 0;
553
- } else {
554
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
555
- }
556
- }
557
557
  module.exports = {
558
558
  supportsColor: getSupportLevel,
559
559
  stdout: translateLevel(supportsColor(true, tty.isatty(1))),
@@ -563,47 +563,6 @@ var require_supports_color = __commonJS((exports, module) => {
563
563
 
564
564
  // ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js
565
565
  var require_node = __commonJS((exports, module) => {
566
- function useColors() {
567
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
568
- }
569
- function formatArgs(args) {
570
- const { namespace: name, useColors: useColors2 } = this;
571
- if (useColors2) {
572
- const c = this.color;
573
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
574
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
575
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
576
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
577
- } else {
578
- args[0] = getDate() + name + " " + args[0];
579
- }
580
- }
581
- function getDate() {
582
- if (exports.inspectOpts.hideDate) {
583
- return "";
584
- }
585
- return new Date().toISOString() + " ";
586
- }
587
- function log(...args) {
588
- return process.stderr.write(util.format(...args) + "\n");
589
- }
590
- function save(namespaces) {
591
- if (namespaces) {
592
- process.env.DEBUG = namespaces;
593
- } else {
594
- delete process.env.DEBUG;
595
- }
596
- }
597
- function load() {
598
- return process.env.DEBUG;
599
- }
600
- function init(debug) {
601
- debug.inspectOpts = {};
602
- const keys = Object.keys(exports.inspectOpts);
603
- for (let i = 0;i < keys.length; i++) {
604
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
605
- }
606
- }
607
566
  var tty = __require("tty");
608
567
  var util = __require("util");
609
568
  exports.init = init;
@@ -718,11 +677,56 @@ var require_node = __commonJS((exports, module) => {
718
677
  obj[prop] = val;
719
678
  return obj;
720
679
  }, {});
680
+ function useColors() {
681
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
682
+ }
683
+ function formatArgs(args) {
684
+ const { namespace: name, useColors: useColors2 } = this;
685
+ if (useColors2) {
686
+ const c = this.color;
687
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
688
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
689
+ args[0] = prefix + args[0].split(`
690
+ `).join(`
691
+ ` + prefix);
692
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
693
+ } else {
694
+ args[0] = getDate() + name + " " + args[0];
695
+ }
696
+ }
697
+ function getDate() {
698
+ if (exports.inspectOpts.hideDate) {
699
+ return "";
700
+ }
701
+ return new Date().toISOString() + " ";
702
+ }
703
+ function log(...args) {
704
+ return process.stderr.write(util.format(...args) + `
705
+ `);
706
+ }
707
+ function save(namespaces) {
708
+ if (namespaces) {
709
+ process.env.DEBUG = namespaces;
710
+ } else {
711
+ delete process.env.DEBUG;
712
+ }
713
+ }
714
+ function load() {
715
+ return process.env.DEBUG;
716
+ }
717
+ function init(debug) {
718
+ debug.inspectOpts = {};
719
+ const keys = Object.keys(exports.inspectOpts);
720
+ for (let i = 0;i < keys.length; i++) {
721
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
722
+ }
723
+ }
721
724
  module.exports = require_common()(exports);
722
725
  var { formatters } = module.exports;
723
726
  formatters.o = function(v) {
724
727
  this.inspectOpts.colors = this.useColors;
725
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
728
+ return util.inspect(v, this.inspectOpts).split(`
729
+ `).map((str) => str.trim()).join(" ");
726
730
  };
727
731
  formatters.O = function(v) {
728
732
  this.inspectOpts.colors = this.useColors;
@@ -730,7 +734,7 @@ var require_node = __commonJS((exports, module) => {
730
734
  };
731
735
  });
732
736
 
733
- // /Users/jonathanburger/remotion/node_modules/.pnpm/extract-zip@2.0.1/node_modules/debug/src/index.js
737
+ // ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js
734
738
  var require_src = __commonJS((exports, module) => {
735
739
  if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
736
740
  module.exports = require_browser();
@@ -739,8 +743,9 @@ var require_src = __commonJS((exports, module) => {
739
743
  }
740
744
  });
741
745
 
742
- // /Users/jonathanburger/remotion/node_modules/.pnpm/once@1.4.0/node_modules/wrappy/wrappy.js
746
+ // ../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
743
747
  var require_wrappy = __commonJS((exports, module) => {
748
+ module.exports = wrappy;
744
749
  function wrappy(fn, cb) {
745
750
  if (fn && cb)
746
751
  return wrappy(fn)(cb);
@@ -765,11 +770,27 @@ var require_wrappy = __commonJS((exports, module) => {
765
770
  return ret;
766
771
  }
767
772
  }
768
- module.exports = wrappy;
769
773
  });
770
774
 
771
- // /Users/jonathanburger/remotion/node_modules/.pnpm/pump@3.0.0/node_modules/once/once.js
775
+ // ../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
772
776
  var require_once = __commonJS((exports, module) => {
777
+ var wrappy = require_wrappy();
778
+ module.exports = wrappy(once);
779
+ module.exports.strict = wrappy(onceStrict);
780
+ once.proto = once(function() {
781
+ Object.defineProperty(Function.prototype, "once", {
782
+ value: function() {
783
+ return once(this);
784
+ },
785
+ configurable: true
786
+ });
787
+ Object.defineProperty(Function.prototype, "onceStrict", {
788
+ value: function() {
789
+ return onceStrict(this);
790
+ },
791
+ configurable: true
792
+ });
793
+ });
773
794
  function once(fn) {
774
795
  var f = function() {
775
796
  if (f.called)
@@ -792,26 +813,9 @@ var require_once = __commonJS((exports, module) => {
792
813
  f.called = false;
793
814
  return f;
794
815
  }
795
- var wrappy = require_wrappy();
796
- module.exports = wrappy(once);
797
- module.exports.strict = wrappy(onceStrict);
798
- once.proto = once(function() {
799
- Object.defineProperty(Function.prototype, "once", {
800
- value: function() {
801
- return once(this);
802
- },
803
- configurable: true
804
- });
805
- Object.defineProperty(Function.prototype, "onceStrict", {
806
- value: function() {
807
- return onceStrict(this);
808
- },
809
- configurable: true
810
- });
811
- });
812
816
  });
813
817
 
814
- // /Users/jonathanburger/remotion/node_modules/.pnpm/pump@3.0.0/node_modules/end-of-stream/index.js
818
+ // ../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
815
819
  var require_end_of_stream = __commonJS((exports, module) => {
816
820
  var once = require_once();
817
821
  var noop = function() {
@@ -904,7 +908,7 @@ var require_end_of_stream = __commonJS((exports, module) => {
904
908
  module.exports = eos;
905
909
  });
906
910
 
907
- // /Users/jonathanburger/remotion/node_modules/.pnpm/get-stream@5.2.0/node_modules/pump/index.js
911
+ // ../../node_modules/.pnpm/pump@3.0.0/node_modules/pump/index.js
908
912
  var require_pump = __commonJS((exports, module) => {
909
913
  var once = require_once();
910
914
  var eos = require_end_of_stream();
@@ -1028,8 +1032,18 @@ var require_buffer_stream = __commonJS((exports, module) => {
1028
1032
  };
1029
1033
  });
1030
1034
 
1031
- // /Users/jonathanburger/remotion/node_modules/.pnpm/extract-zip@2.0.1/node_modules/get-stream/index.js
1035
+ // ../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/index.js
1032
1036
  var require_get_stream = __commonJS((exports, module) => {
1037
+ var { constants: BufferConstants } = __require("buffer");
1038
+ var pump = require_pump();
1039
+ var bufferStream = require_buffer_stream();
1040
+
1041
+ class MaxBufferError extends Error {
1042
+ constructor() {
1043
+ super("maxBuffer exceeded");
1044
+ this.name = "MaxBufferError";
1045
+ }
1046
+ }
1033
1047
  async function getStream(inputStream, options) {
1034
1048
  if (!inputStream) {
1035
1049
  return Promise.reject(new Error("Expected a stream"));
@@ -1062,16 +1076,6 @@ var require_get_stream = __commonJS((exports, module) => {
1062
1076
  });
1063
1077
  return stream.getBufferedValue();
1064
1078
  }
1065
- var { constants: BufferConstants } = __require("buffer");
1066
- var pump = require_pump();
1067
- var bufferStream = require_buffer_stream();
1068
-
1069
- class MaxBufferError extends Error {
1070
- constructor() {
1071
- super("maxBuffer exceeded");
1072
- this.name = "MaxBufferError";
1073
- }
1074
- }
1075
1079
  module.exports = getStream;
1076
1080
  module.exports.default = getStream;
1077
1081
  module.exports.buffer = (stream, options) => getStream(stream, { ...options, encoding: "buffer" });
@@ -1079,8 +1083,9 @@ var require_get_stream = __commonJS((exports, module) => {
1079
1083
  module.exports.MaxBufferError = MaxBufferError;
1080
1084
  });
1081
1085
 
1082
- // /Users/jonathanburger/remotion/node_modules/.pnpm/fd-slicer@1.1.0/node_modules/pend/index.js
1086
+ // ../../node_modules/.pnpm/pend@1.2.0/node_modules/pend/index.js
1083
1087
  var require_pend = __commonJS((exports, module) => {
1088
+ module.exports = Pend;
1084
1089
  function Pend() {
1085
1090
  this.pending = 0;
1086
1091
  this.max = Infinity;
@@ -1088,6 +1093,23 @@ var require_pend = __commonJS((exports, module) => {
1088
1093
  this.waiting = [];
1089
1094
  this.error = null;
1090
1095
  }
1096
+ Pend.prototype.go = function(fn) {
1097
+ if (this.pending < this.max) {
1098
+ pendGo(this, fn);
1099
+ } else {
1100
+ this.waiting.push(fn);
1101
+ }
1102
+ };
1103
+ Pend.prototype.wait = function(cb) {
1104
+ if (this.pending === 0) {
1105
+ cb(this.error);
1106
+ } else {
1107
+ this.listeners.push(cb);
1108
+ }
1109
+ };
1110
+ Pend.prototype.hold = function() {
1111
+ return pendHold(this);
1112
+ };
1091
1113
  function pendHold(self) {
1092
1114
  self.pending += 1;
1093
1115
  var called = false;
@@ -1113,72 +1135,10 @@ var require_pend = __commonJS((exports, module) => {
1113
1135
  function pendGo(self, fn) {
1114
1136
  fn(pendHold(self));
1115
1137
  }
1116
- module.exports = Pend;
1117
- Pend.prototype.go = function(fn) {
1118
- if (this.pending < this.max) {
1119
- pendGo(this, fn);
1120
- } else {
1121
- this.waiting.push(fn);
1122
- }
1123
- };
1124
- Pend.prototype.wait = function(cb) {
1125
- if (this.pending === 0) {
1126
- cb(this.error);
1127
- } else {
1128
- this.listeners.push(cb);
1129
- }
1130
- };
1131
- Pend.prototype.hold = function() {
1132
- return pendHold(this);
1133
- };
1134
1138
  });
1135
1139
 
1136
- // /Users/jonathanburger/remotion/node_modules/.pnpm/yauzl@2.10.0/node_modules/fd-slicer/index.js
1140
+ // ../../node_modules/.pnpm/fd-slicer@1.1.0/node_modules/fd-slicer/index.js
1137
1141
  var require_fd_slicer = __commonJS((exports) => {
1138
- function FdSlicer(fd, options) {
1139
- options = options || {};
1140
- EventEmitter.call(this);
1141
- this.fd = fd;
1142
- this.pend = new Pend;
1143
- this.pend.max = 1;
1144
- this.refCount = 0;
1145
- this.autoClose = !!options.autoClose;
1146
- }
1147
- function ReadStream(context, options) {
1148
- options = options || {};
1149
- Readable.call(this, options);
1150
- this.context = context;
1151
- this.context.ref();
1152
- this.start = options.start || 0;
1153
- this.endOffset = options.end;
1154
- this.pos = this.start;
1155
- this.destroyed = false;
1156
- }
1157
- function WriteStream(context, options) {
1158
- options = options || {};
1159
- Writable.call(this, options);
1160
- this.context = context;
1161
- this.context.ref();
1162
- this.start = options.start || 0;
1163
- this.endOffset = options.end == null ? Infinity : +options.end;
1164
- this.bytesWritten = 0;
1165
- this.pos = this.start;
1166
- this.destroyed = false;
1167
- this.on("finish", this.destroy.bind(this));
1168
- }
1169
- function BufferSlicer(buffer, options) {
1170
- EventEmitter.call(this);
1171
- options = options || {};
1172
- this.refCount = 0;
1173
- this.buffer = buffer;
1174
- this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER;
1175
- }
1176
- function createFromBuffer(buffer, options) {
1177
- return new BufferSlicer(buffer, options);
1178
- }
1179
- function createFromFd(fd, options) {
1180
- return new FdSlicer(fd, options);
1181
- }
1182
1142
  var fs = __require("fs");
1183
1143
  var util = __require("util");
1184
1144
  var stream = __require("stream");
@@ -1192,6 +1152,15 @@ var require_fd_slicer = __commonJS((exports) => {
1192
1152
  exports.BufferSlicer = BufferSlicer;
1193
1153
  exports.FdSlicer = FdSlicer;
1194
1154
  util.inherits(FdSlicer, EventEmitter);
1155
+ function FdSlicer(fd, options) {
1156
+ options = options || {};
1157
+ EventEmitter.call(this);
1158
+ this.fd = fd;
1159
+ this.pend = new Pend;
1160
+ this.pend.max = 1;
1161
+ this.refCount = 0;
1162
+ this.autoClose = !!options.autoClose;
1163
+ }
1195
1164
  FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
1196
1165
  var self = this;
1197
1166
  self.pend.go(function(cb) {
@@ -1238,6 +1207,16 @@ var require_fd_slicer = __commonJS((exports) => {
1238
1207
  }
1239
1208
  };
1240
1209
  util.inherits(ReadStream, Readable);
1210
+ function ReadStream(context, options) {
1211
+ options = options || {};
1212
+ Readable.call(this, options);
1213
+ this.context = context;
1214
+ this.context.ref();
1215
+ this.start = options.start || 0;
1216
+ this.endOffset = options.end;
1217
+ this.pos = this.start;
1218
+ this.destroyed = false;
1219
+ }
1241
1220
  ReadStream.prototype._read = function(n) {
1242
1221
  var self = this;
1243
1222
  if (self.destroyed)
@@ -1280,6 +1259,18 @@ var require_fd_slicer = __commonJS((exports) => {
1280
1259
  this.context.unref();
1281
1260
  };
1282
1261
  util.inherits(WriteStream, Writable);
1262
+ function WriteStream(context, options) {
1263
+ options = options || {};
1264
+ Writable.call(this, options);
1265
+ this.context = context;
1266
+ this.context.ref();
1267
+ this.start = options.start || 0;
1268
+ this.endOffset = options.end == null ? Infinity : +options.end;
1269
+ this.bytesWritten = 0;
1270
+ this.pos = this.start;
1271
+ this.destroyed = false;
1272
+ this.on("finish", this.destroy.bind(this));
1273
+ }
1283
1274
  WriteStream.prototype._write = function(buffer, encoding, callback) {
1284
1275
  var self = this;
1285
1276
  if (self.destroyed)
@@ -1316,6 +1307,13 @@ var require_fd_slicer = __commonJS((exports) => {
1316
1307
  this.context.unref();
1317
1308
  };
1318
1309
  util.inherits(BufferSlicer, EventEmitter);
1310
+ function BufferSlicer(buffer, options) {
1311
+ EventEmitter.call(this);
1312
+ options = options || {};
1313
+ this.refCount = 0;
1314
+ this.buffer = buffer;
1315
+ this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER;
1316
+ }
1319
1317
  BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {
1320
1318
  var end = position + length;
1321
1319
  var delta = end - this.buffer.length;
@@ -1397,42 +1395,16 @@ var require_fd_slicer = __commonJS((exports) => {
1397
1395
  throw new Error("invalid unref");
1398
1396
  }
1399
1397
  };
1398
+ function createFromBuffer(buffer, options) {
1399
+ return new BufferSlicer(buffer, options);
1400
+ }
1401
+ function createFromFd(fd, options) {
1402
+ return new FdSlicer(fd, options);
1403
+ }
1400
1404
  });
1401
1405
 
1402
- // /Users/jonathanburger/remotion/node_modules/.pnpm/yauzl@2.10.0/node_modules/buffer-crc32/index.js
1406
+ // ../../node_modules/.pnpm/buffer-crc32@0.2.13/node_modules/buffer-crc32/index.js
1403
1407
  var require_buffer_crc32 = __commonJS((exports, module) => {
1404
- function ensureBuffer(input) {
1405
- if (Buffer2.isBuffer(input)) {
1406
- return input;
1407
- }
1408
- var hasNewBufferAPI = typeof Buffer2.alloc === "function" && typeof Buffer2.from === "function";
1409
- if (typeof input === "number") {
1410
- return hasNewBufferAPI ? Buffer2.alloc(input) : new Buffer2(input);
1411
- } else if (typeof input === "string") {
1412
- return hasNewBufferAPI ? Buffer2.from(input) : new Buffer2(input);
1413
- } else {
1414
- throw new Error("input must be buffer, number, or string, received " + typeof input);
1415
- }
1416
- }
1417
- function bufferizeInt(num) {
1418
- var tmp = ensureBuffer(4);
1419
- tmp.writeInt32BE(num, 0);
1420
- return tmp;
1421
- }
1422
- function _crc32(buf, previous) {
1423
- buf = ensureBuffer(buf);
1424
- if (Buffer2.isBuffer(previous)) {
1425
- previous = previous.readUInt32BE(0);
1426
- }
1427
- var crc = ~~previous ^ -1;
1428
- for (var n = 0;n < buf.length; n++) {
1429
- crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
1430
- }
1431
- return crc ^ -1;
1432
- }
1433
- function crc32() {
1434
- return bufferizeInt(_crc32.apply(null, arguments));
1435
- }
1436
1408
  var Buffer2 = __require("buffer").Buffer;
1437
1409
  var CRC_TABLE = [
1438
1410
  0,
@@ -1695,6 +1667,38 @@ var require_buffer_crc32 = __commonJS((exports, module) => {
1695
1667
  if (typeof Int32Array !== "undefined") {
1696
1668
  CRC_TABLE = new Int32Array(CRC_TABLE);
1697
1669
  }
1670
+ function ensureBuffer(input) {
1671
+ if (Buffer2.isBuffer(input)) {
1672
+ return input;
1673
+ }
1674
+ var hasNewBufferAPI = typeof Buffer2.alloc === "function" && typeof Buffer2.from === "function";
1675
+ if (typeof input === "number") {
1676
+ return hasNewBufferAPI ? Buffer2.alloc(input) : new Buffer2(input);
1677
+ } else if (typeof input === "string") {
1678
+ return hasNewBufferAPI ? Buffer2.from(input) : new Buffer2(input);
1679
+ } else {
1680
+ throw new Error("input must be buffer, number, or string, received " + typeof input);
1681
+ }
1682
+ }
1683
+ function bufferizeInt(num) {
1684
+ var tmp = ensureBuffer(4);
1685
+ tmp.writeInt32BE(num, 0);
1686
+ return tmp;
1687
+ }
1688
+ function _crc32(buf, previous) {
1689
+ buf = ensureBuffer(buf);
1690
+ if (Buffer2.isBuffer(previous)) {
1691
+ previous = previous.readUInt32BE(0);
1692
+ }
1693
+ var crc = ~~previous ^ -1;
1694
+ for (var n = 0;n < buf.length; n++) {
1695
+ crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
1696
+ }
1697
+ return crc ^ -1;
1698
+ }
1699
+ function crc32() {
1700
+ return bufferizeInt(_crc32.apply(null, arguments));
1701
+ }
1698
1702
  crc32.signed = function() {
1699
1703
  return _crc32.apply(null, arguments);
1700
1704
  };
@@ -1704,8 +1708,26 @@ var require_buffer_crc32 = __commonJS((exports, module) => {
1704
1708
  module.exports = crc32;
1705
1709
  });
1706
1710
 
1707
- // /Users/jonathanburger/remotion/node_modules/.pnpm/extract-zip@2.0.1/node_modules/yauzl/index.js
1711
+ // ../../node_modules/.pnpm/yauzl@2.10.0/node_modules/yauzl/index.js
1708
1712
  var require_yauzl = __commonJS((exports) => {
1713
+ var fs = __require("fs");
1714
+ var zlib = __require("zlib");
1715
+ var fd_slicer = require_fd_slicer();
1716
+ var crc32 = require_buffer_crc32();
1717
+ var util = __require("util");
1718
+ var EventEmitter = __require("events").EventEmitter;
1719
+ var Transform = __require("stream").Transform;
1720
+ var PassThrough = __require("stream").PassThrough;
1721
+ var Writable = __require("stream").Writable;
1722
+ exports.open = open;
1723
+ exports.fromFd = fromFd;
1724
+ exports.fromBuffer = fromBuffer;
1725
+ exports.fromRandomAccessReader = fromRandomAccessReader;
1726
+ exports.dosDateTimeToDate = dosDateTimeToDate;
1727
+ exports.validateFileName = validateFileName;
1728
+ exports.ZipFile = ZipFile;
1729
+ exports.Entry = Entry;
1730
+ exports.RandomAccessReader = RandomAccessReader;
1709
1731
  function open(path, options, callback) {
1710
1732
  if (typeof options === "function") {
1711
1733
  callback = options;
@@ -1859,6 +1881,7 @@ var require_yauzl = __commonJS((exports) => {
1859
1881
  callback(new Error("end of central directory record signature not found"));
1860
1882
  });
1861
1883
  }
1884
+ util.inherits(ZipFile, EventEmitter);
1862
1885
  function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
1863
1886
  var self = this;
1864
1887
  EventEmitter.call(self);
@@ -1884,6 +1907,12 @@ var require_yauzl = __commonJS((exports) => {
1884
1907
  if (!self.lazyEntries)
1885
1908
  self._readEntry();
1886
1909
  }
1910
+ ZipFile.prototype.close = function() {
1911
+ if (!this.isOpen)
1912
+ return;
1913
+ this.isOpen = false;
1914
+ this.reader.unref();
1915
+ };
1887
1916
  function emitErrorAndAutoClose(self, err) {
1888
1917
  if (self.autoClose)
1889
1918
  self.close();
@@ -1895,105 +1924,6 @@ var require_yauzl = __commonJS((exports) => {
1895
1924
  self.emittedError = true;
1896
1925
  self.emit("error", err);
1897
1926
  }
1898
- function Entry() {
1899
- }
1900
- function dosDateTimeToDate(date, time) {
1901
- var day = date & 31;
1902
- var month = (date >> 5 & 15) - 1;
1903
- var year = (date >> 9 & 127) + 1980;
1904
- var millisecond = 0;
1905
- var second = (time & 31) * 2;
1906
- var minute = time >> 5 & 63;
1907
- var hour = time >> 11 & 31;
1908
- return new Date(year, month, day, hour, minute, second, millisecond);
1909
- }
1910
- function validateFileName(fileName) {
1911
- if (fileName.indexOf("\\") !== -1) {
1912
- return "invalid characters in fileName: " + fileName;
1913
- }
1914
- if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
1915
- return "absolute path: " + fileName;
1916
- }
1917
- if (fileName.split("/").indexOf("..") !== -1) {
1918
- return "invalid relative path: " + fileName;
1919
- }
1920
- return null;
1921
- }
1922
- function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
1923
- if (length === 0) {
1924
- return setImmediate(function() {
1925
- callback(null, newBuffer(0));
1926
- });
1927
- }
1928
- reader.read(buffer, offset, length, position, function(err, bytesRead) {
1929
- if (err)
1930
- return callback(err);
1931
- if (bytesRead < length) {
1932
- return callback(new Error("unexpected EOF"));
1933
- }
1934
- callback();
1935
- });
1936
- }
1937
- function AssertByteCountStream(byteCount) {
1938
- Transform.call(this);
1939
- this.actualByteCount = 0;
1940
- this.expectedByteCount = byteCount;
1941
- }
1942
- function RandomAccessReader() {
1943
- EventEmitter.call(this);
1944
- this.refCount = 0;
1945
- }
1946
- function RefUnrefFilter(context) {
1947
- PassThrough.call(this);
1948
- this.context = context;
1949
- this.context.ref();
1950
- this.unreffedYet = false;
1951
- }
1952
- function decodeBuffer(buffer, start, end, isUtf8) {
1953
- if (isUtf8) {
1954
- return buffer.toString("utf8", start, end);
1955
- } else {
1956
- var result = "";
1957
- for (var i = start;i < end; i++) {
1958
- result += cp437[buffer[i]];
1959
- }
1960
- return result;
1961
- }
1962
- }
1963
- function readUInt64LE(buffer, offset) {
1964
- var lower32 = buffer.readUInt32LE(offset);
1965
- var upper32 = buffer.readUInt32LE(offset + 4);
1966
- return upper32 * 4294967296 + lower32;
1967
- }
1968
- function defaultCallback(err) {
1969
- if (err)
1970
- throw err;
1971
- }
1972
- var fs = __require("fs");
1973
- var zlib = __require("zlib");
1974
- var fd_slicer = require_fd_slicer();
1975
- var crc32 = require_buffer_crc32();
1976
- var util = __require("util");
1977
- var EventEmitter = __require("events").EventEmitter;
1978
- var Transform = __require("stream").Transform;
1979
- var PassThrough = __require("stream").PassThrough;
1980
- var Writable = __require("stream").Writable;
1981
- exports.open = open;
1982
- exports.fromFd = fromFd;
1983
- exports.fromBuffer = fromBuffer;
1984
- exports.fromRandomAccessReader = fromRandomAccessReader;
1985
- exports.dosDateTimeToDate = dosDateTimeToDate;
1986
- exports.validateFileName = validateFileName;
1987
- exports.ZipFile = ZipFile;
1988
- exports.Entry = Entry;
1989
- exports.RandomAccessReader = RandomAccessReader;
1990
- util.inherits(ZipFile, EventEmitter);
1991
- ZipFile.prototype.close = function() {
1992
- if (!this.isOpen)
1993
- return;
1994
- this.isOpen = false;
1995
- this.reader.unref();
1996
- };
1997
1927
  ZipFile.prototype.readEntry = function() {
1998
1928
  if (!this.lazyEntries)
1999
1929
  throw new Error("readEntry() called without lazyEntries:true");
@@ -2277,6 +2207,8 @@ var require_yauzl = __commonJS((exports) => {
2277
2207
  }
2278
2208
  });
2279
2209
  };
2210
+ function Entry() {
2211
+ }
2280
2212
  Entry.prototype.getLastModDate = function() {
2281
2213
  return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
2282
2214
  };
@@ -2286,7 +2218,49 @@ var require_yauzl = __commonJS((exports) => {
2286
2218
  Entry.prototype.isCompressed = function() {
2287
2219
  return this.compressionMethod === 8;
2288
2220
  };
2221
+ function dosDateTimeToDate(date, time) {
2222
+ var day = date & 31;
2223
+ var month = (date >> 5 & 15) - 1;
2224
+ var year = (date >> 9 & 127) + 1980;
2225
+ var millisecond = 0;
2226
+ var second = (time & 31) * 2;
2227
+ var minute = time >> 5 & 63;
2228
+ var hour = time >> 11 & 31;
2229
+ return new Date(year, month, day, hour, minute, second, millisecond);
2230
+ }
2231
+ function validateFileName(fileName) {
2232
+ if (fileName.indexOf("\\") !== -1) {
2233
+ return "invalid characters in fileName: " + fileName;
2234
+ }
2235
+ if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
2236
+ return "absolute path: " + fileName;
2237
+ }
2238
+ if (fileName.split("/").indexOf("..") !== -1) {
2239
+ return "invalid relative path: " + fileName;
2240
+ }
2241
+ return null;
2242
+ }
2243
+ function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
2244
+ if (length === 0) {
2245
+ return setImmediate(function() {
2246
+ callback(null, newBuffer(0));
2247
+ });
2248
+ }
2249
+ reader.read(buffer, offset, length, position, function(err, bytesRead) {
2250
+ if (err)
2251
+ return callback(err);
2252
+ if (bytesRead < length) {
2253
+ return callback(new Error("unexpected EOF"));
2254
+ }
2255
+ callback();
2256
+ });
2257
+ }
2289
2258
  util.inherits(AssertByteCountStream, Transform);
2259
+ function AssertByteCountStream(byteCount) {
2260
+ Transform.call(this);
2261
+ this.actualByteCount = 0;
2262
+ this.expectedByteCount = byteCount;
2263
+ }
2290
2264
  AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
2291
2265
  this.actualByteCount += chunk.length;
2292
2266
  if (this.actualByteCount > this.expectedByteCount) {
@@ -2303,6 +2277,10 @@ var require_yauzl = __commonJS((exports) => {
2303
2277
  cb();
2304
2278
  };
2305
2279
  util.inherits(RandomAccessReader, EventEmitter);
2280
+ function RandomAccessReader() {
2281
+ EventEmitter.call(this);
2282
+ this.refCount = 0;
2283
+ }
2306
2284
  RandomAccessReader.prototype.ref = function() {
2307
2285
  this.refCount += 1;
2308
2286
  };
@@ -2380,6 +2358,12 @@ var require_yauzl = __commonJS((exports) => {
2380
2358
  setImmediate(callback);
2381
2359
  };
2382
2360
  util.inherits(RefUnrefFilter, PassThrough);
2361
+ function RefUnrefFilter(context) {
2362
+ PassThrough.call(this);
2363
+ this.context = context;
2364
+ this.context.ref();
2365
+ this.unreffedYet = false;
2366
+ }
2383
2367
  RefUnrefFilter.prototype._flush = function(cb) {
2384
2368
  this.unref();
2385
2369
  cb();
@@ -2390,7 +2374,23 @@ var require_yauzl = __commonJS((exports) => {
2390
2374
  this.unreffedYet = true;
2391
2375
  this.context.unref();
2392
2376
  };
2393
- var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
2377
+ var cp437 = "\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";
2378
+ function decodeBuffer(buffer, start, end, isUtf8) {
2379
+ if (isUtf8) {
2380
+ return buffer.toString("utf8", start, end);
2381
+ } else {
2382
+ var result = "";
2383
+ for (var i = start;i < end; i++) {
2384
+ result += cp437[buffer[i]];
2385
+ }
2386
+ return result;
2387
+ }
2388
+ }
2389
+ function readUInt64LE(buffer, offset) {
2390
+ var lower32 = buffer.readUInt32LE(offset);
2391
+ var upper32 = buffer.readUInt32LE(offset + 4);
2392
+ return upper32 * 4294967296 + lower32;
2393
+ }
2394
2394
  var newBuffer;
2395
2395
  if (typeof Buffer.allocUnsafe === "function") {
2396
2396
  newBuffer = function(len) {
@@ -2401,9 +2401,13 @@ var require_yauzl = __commonJS((exports) => {
2401
2401
  return new Buffer(len);
2402
2402
  };
2403
2403
  }
2404
+ function defaultCallback(err) {
2405
+ if (err)
2406
+ throw err;
2407
+ }
2404
2408
  });
2405
2409
 
2406
- // /Users/jonathanburger/remotion/packages/renderer/node_modules/extract-zip/index.js
2410
+ // ../../node_modules/.pnpm/extract-zip@2.0.1/node_modules/extract-zip/index.js
2407
2411
  var require_extract_zip = __commonJS((exports, module) => {
2408
2412
  var debug = require_src()("extract-zip");
2409
2413
  var { createWriteStream, promises: fs } = __require("fs");
@@ -2541,7 +2545,7 @@ var require_extract_zip = __commonJS((exports, module) => {
2541
2545
  });
2542
2546
 
2543
2547
  // src/ensure-browser.ts
2544
- import fs5 from "fs";
2548
+ import fs4 from "fs";
2545
2549
 
2546
2550
  // src/browser/BrowserFetcher.ts
2547
2551
  var import_extract_zip = __toESM(require_extract_zip(), 1);
@@ -2599,7 +2603,7 @@ var chalk = (() => {
2599
2603
  if (input.includes(close))
2600
2604
  input = input.replace(regex, close + open);
2601
2605
  const output = open + input + close;
2602
- return newline ? output.replace(/\r*\n/g, `${close}\$&${open}`) : output;
2606
+ return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output;
2603
2607
  };
2604
2608
  return st;
2605
2609
  };
@@ -2614,7 +2618,8 @@ var chalk = (() => {
2614
2618
  if (colors.visible === false)
2615
2619
  return "";
2616
2620
  let str = String(input);
2617
- const nl = str.includes("\n");
2621
+ const nl = str.includes(`
2622
+ `);
2618
2623
  let n = stack.length;
2619
2624
  while (n-- > 0)
2620
2625
  str = wrap(colors.styles[stack[n]], str, nl);
@@ -2705,7 +2710,7 @@ var chalk = (() => {
2705
2710
  })();
2706
2711
 
2707
2712
  // src/log-level.ts
2708
- var logLevels = ["verbose", "info", "warn", "error"];
2713
+ var logLevels = ["trace", "verbose", "info", "warn", "error"];
2709
2714
  var getNumberForLogLevel = (level) => {
2710
2715
  return logLevels.indexOf(level);
2711
2716
  };
@@ -2735,14 +2740,31 @@ function truthy(value) {
2735
2740
  }
2736
2741
 
2737
2742
  // src/logger.ts
2738
- var INDENT_TOKEN = chalk.gray("\u2502");
2743
+ var INDENT_TOKEN = chalk.gray("");
2739
2744
  var verboseTag = (str) => {
2740
2745
  return isColorSupported() ? chalk.bgBlack(` ${str} `) : `[${str}]`;
2741
2746
  };
2742
2747
  var Log = {
2748
+ trace: (options, ...args) => {
2749
+ writeInRepro("trace", ...args);
2750
+ if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
2751
+ if (args.length === 0) {
2752
+ return process.stdout.write(`
2753
+ `);
2754
+ }
2755
+ return console.log(...[
2756
+ options.indent ? INDENT_TOKEN : null,
2757
+ options.tag ? verboseTag(options.tag) : null
2758
+ ].filter(truthy).concat(args.map((a) => chalk.gray(a))));
2759
+ }
2760
+ },
2743
2761
  verbose: (options, ...args) => {
2744
2762
  writeInRepro("verbose", ...args);
2745
2763
  if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
2764
+ if (args.length === 0) {
2765
+ return process.stdout.write(`
2766
+ `);
2767
+ }
2746
2768
  return console.log(...[
2747
2769
  options.indent ? INDENT_TOKEN : null,
2748
2770
  options.tag ? verboseTag(options.tag) : null
@@ -2752,18 +2774,30 @@ var Log = {
2752
2774
  info: (options, ...args) => {
2753
2775
  writeInRepro("info", ...args);
2754
2776
  if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
2755
- return console.log(...[options.indent ? INDENT_TOKEN : null].filter(truthy).concat(args));
2777
+ if (args.length === 0) {
2778
+ return process.stdout.write(`
2779
+ `);
2780
+ }
2781
+ return console.log(...[options.indent ? INDENT_TOKEN : null].filter(truthy).concat(args ?? []));
2756
2782
  }
2757
2783
  },
2758
2784
  warn: (options, ...args) => {
2759
2785
  writeInRepro("warn", ...args);
2760
2786
  if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
2787
+ if (args.length === 0) {
2788
+ return process.stdout.write(`
2789
+ `);
2790
+ }
2761
2791
  return console.warn(...[options.indent ? chalk.yellow(INDENT_TOKEN) : null].filter(truthy).concat(args.map((a) => chalk.yellow(a))));
2762
2792
  }
2763
2793
  },
2764
2794
  error: (options, ...args) => {
2765
2795
  writeInRepro("error", ...args);
2766
2796
  if (isEqualOrBelowLogLevel(options.logLevel, "error")) {
2797
+ if (args.length === 0) {
2798
+ return process.stdout.write(`
2799
+ `);
2800
+ }
2767
2801
  return console.error(...[
2768
2802
  options.indent ? INDENT_TOKEN : null,
2769
2803
  options.tag ? verboseTag(options.tag) : null
@@ -2824,7 +2858,8 @@ var readFile = async (url, redirectsSoFar = 0) => {
2824
2858
  body ? `---` : null,
2825
2859
  body ? body : null,
2826
2860
  body ? `---` : null
2827
- ].filter(truthy).join("\n"));
2861
+ ].filter(truthy).join(`
2862
+ `));
2828
2863
  }
2829
2864
  return file;
2830
2865
  };
@@ -3029,15 +3064,26 @@ var getDownloadsCacheDir = () => {
3029
3064
  };
3030
3065
 
3031
3066
  // src/browser/BrowserFetcher.ts
3067
+ var TESTED_VERSION = "123.0.6312.86";
3068
+ var PLAYWRIGHT_VERSION = "1105";
3032
3069
  function getChromeDownloadUrl({
3033
3070
  platform: platform2,
3034
- version
3071
+ version,
3072
+ chromeMode
3035
3073
  }) {
3036
3074
  if (platform2 === "linux-arm64") {
3075
+ if (chromeMode === "chrome-for-testing") {
3076
+ throw new Error(`chromeMode: 'chrome-for-testing' is not supported on platform linux-arm64`);
3077
+ }
3037
3078
  return `https://playwright.azureedge.net/builds/chromium/${version ?? PLAYWRIGHT_VERSION}/chromium-linux-arm64.zip`;
3038
3079
  }
3039
- return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/chrome-headless-shell-${platform2}.zip`;
3080
+ if (chromeMode === "headless-shell") {
3081
+ return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/chrome-headless-shell-${platform2}.zip`;
3082
+ }
3083
+ return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/chrome-${platform2}.zip`;
3040
3084
  }
3085
+ var mkdirAsync = fs3.promises.mkdir;
3086
+ var unlinkAsync = promisify(fs3.unlink.bind(fs3));
3041
3087
  function existsAsync(filePath) {
3042
3088
  return new Promise((resolve2) => {
3043
3089
  fs3.access(filePath, (err) => {
@@ -3045,10 +3091,6 @@ function existsAsync(filePath) {
3045
3091
  });
3046
3092
  });
3047
3093
  }
3048
- var TESTED_VERSION = "123.0.6312.86";
3049
- var PLAYWRIGHT_VERSION = "1105";
3050
- var mkdirAsync = fs3.promises.mkdir;
3051
- var unlinkAsync = promisify(fs3.unlink.bind(fs3));
3052
3094
  var getPlatform = () => {
3053
3095
  const platform2 = os.platform();
3054
3096
  switch (platform2) {
@@ -3062,27 +3104,28 @@ var getPlatform = () => {
3062
3104
  throw new Error("Unsupported platform: " + platform2);
3063
3105
  }
3064
3106
  };
3065
- var destination = "chrome-headless-shell";
3066
- var getDownloadsFolder = () => {
3107
+ var getDownloadsFolder = (chromeMode) => {
3108
+ const destination = chromeMode === "headless-shell" ? "chrome-headless-shell" : "chrome-for-testing";
3067
3109
  return path3.join(getDownloadsCacheDir(), destination);
3068
3110
  };
3069
3111
  var downloadBrowser = async ({
3070
3112
  logLevel,
3071
3113
  indent,
3072
3114
  onProgress,
3073
- version
3115
+ version,
3116
+ chromeMode
3074
3117
  }) => {
3075
3118
  const platform2 = getPlatform();
3076
- const downloadURL = getChromeDownloadUrl({ platform: platform2, version });
3119
+ const downloadURL = getChromeDownloadUrl({ platform: platform2, version, chromeMode });
3077
3120
  const fileName = downloadURL.split("/").pop();
3078
3121
  if (!fileName) {
3079
3122
  throw new Error(`A malformed download URL was found: ${downloadURL}.`);
3080
3123
  }
3081
- const downloadsFolder = getDownloadsFolder();
3124
+ const downloadsFolder = getDownloadsFolder(chromeMode);
3082
3125
  const archivePath = path3.join(downloadsFolder, fileName);
3083
3126
  const outputPath = getFolderPath(downloadsFolder, platform2);
3084
3127
  if (await existsAsync(outputPath)) {
3085
- return getRevisionInfo();
3128
+ return getRevisionInfo(chromeMode);
3086
3129
  }
3087
3130
  if (!await existsAsync(downloadsFolder)) {
3088
3131
  await mkdirAsync(downloadsFolder, {
@@ -3092,7 +3135,8 @@ var downloadBrowser = async ({
3092
3135
  if (os.platform() !== "darwin" && os.platform() !== "linux" && os.arch() === "arm64") {
3093
3136
  throw new Error([
3094
3137
  "Chrome Headless Shell is not available for Windows for arm64 architecture."
3095
- ].join("\n"));
3138
+ ].join(`
3139
+ `));
3096
3140
  }
3097
3141
  try {
3098
3142
  await downloadFile({
@@ -3121,30 +3165,47 @@ var downloadBrowser = async ({
3121
3165
  if (fs3.existsSync(chromeLinuxFolder)) {
3122
3166
  fs3.renameSync(chromeLinuxFolder, path3.join(outputPath, "chrome-headless-shell-linux-arm64"));
3123
3167
  }
3168
+ } catch (err) {
3169
+ return Promise.reject(err);
3124
3170
  } finally {
3125
3171
  if (await existsAsync(archivePath)) {
3126
3172
  await unlinkAsync(archivePath);
3127
3173
  }
3128
3174
  }
3129
- const revisionInfo = getRevisionInfo();
3175
+ const revisionInfo = getRevisionInfo(chromeMode);
3130
3176
  makeFileExecutableIfItIsNot(revisionInfo.executablePath);
3131
3177
  return revisionInfo;
3132
3178
  };
3133
3179
  var getFolderPath = (downloadsFolder, platform2) => {
3134
3180
  return path3.resolve(downloadsFolder, platform2);
3135
3181
  };
3136
- var getExecutablePath = () => {
3137
- const downloadsFolder = getDownloadsFolder();
3182
+ var getExecutablePath = (chromeMode) => {
3183
+ const downloadsFolder = getDownloadsFolder(chromeMode);
3138
3184
  const platform2 = getPlatform();
3139
3185
  const folderPath = getFolderPath(downloadsFolder, platform2);
3140
- return path3.join(folderPath, `chrome-headless-shell-${platform2}`, platform2 === "win64" ? "chrome-headless-shell.exe" : "chrome-headless-shell");
3186
+ if (chromeMode === "chrome-for-testing") {
3187
+ if (platform2 === "mac-arm64" || platform2 === "mac-x64") {
3188
+ return path3.join(folderPath, `chrome-${platform2}`, "Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing");
3189
+ }
3190
+ if (platform2 === "win64") {
3191
+ return path3.join(folderPath, "chrome-win64", "chrome.exe");
3192
+ }
3193
+ if (platform2 === "linux64" || platform2 === "linux-arm64") {
3194
+ return path3.join(folderPath, "chrome-linux64", "chrome");
3195
+ }
3196
+ throw new Error("unsupported platform" + platform2);
3197
+ }
3198
+ if (chromeMode === "headless-shell") {
3199
+ return path3.join(folderPath, `chrome-headless-shell-${platform2}`, platform2 === "win64" ? "chrome-headless-shell.exe" : "chrome-headless-shell");
3200
+ }
3201
+ throw new Error("unsupported chrome mode" + chromeMode);
3141
3202
  };
3142
- var getRevisionInfo = () => {
3143
- const executablePath = getExecutablePath();
3144
- const downloadsFolder = getDownloadsFolder();
3203
+ var getRevisionInfo = (chromeMode) => {
3204
+ const executablePath = getExecutablePath(chromeMode);
3205
+ const downloadsFolder = getDownloadsFolder(chromeMode);
3145
3206
  const platform2 = getPlatform();
3146
3207
  const folderPath = getFolderPath(downloadsFolder, platform2);
3147
- const url = getChromeDownloadUrl({ platform: platform2, version: null });
3208
+ const url = getChromeDownloadUrl({ platform: platform2, version: null, chromeMode });
3148
3209
  const local = fs3.existsSync(folderPath);
3149
3210
  return {
3150
3211
  executablePath,
@@ -3165,68 +3226,62 @@ var defaultBrowserDownloadProgress = ({
3165
3226
  indent,
3166
3227
  logLevel,
3167
3228
  api
3168
- }) => () => {
3169
- Log.info({ indent, logLevel }, "Downloading Chrome Headless Shell https://www.remotion.dev/docs/miscellaneous/chrome-headless-shell");
3229
+ }) => ({ chromeMode }) => {
3230
+ if (chromeMode === "chrome-for-testing") {
3231
+ Log.info({ indent, logLevel }, "Downloading Chrome for Testing https://www.remotion.dev/chrome-for-testing");
3232
+ } else {
3233
+ Log.info({ indent, logLevel }, "Downloading Chrome Headless Shell https://www.remotion.dev/chrome-headless-shell");
3234
+ }
3170
3235
  Log.info({ indent, logLevel }, `Customize this behavior by adding a onBrowserDownload function to ${api}.`);
3171
3236
  let lastProgress = 0;
3172
3237
  return {
3173
3238
  onProgress: (progress) => {
3174
3239
  if (progress.downloadedBytes > lastProgress + 1e7 || progress.percent === 1) {
3175
3240
  lastProgress = progress.downloadedBytes;
3176
- Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3241
+ if (chromeMode === "chrome-for-testing") {
3242
+ Log.info({ indent, logLevel }, `Downloading Chrome for Testing - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3243
+ } else {
3244
+ Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3245
+ }
3177
3246
  }
3178
3247
  },
3179
3248
  version: null
3180
3249
  };
3181
3250
  };
3182
3251
 
3183
- // src/get-local-browser.ts
3184
- import fs4 from "fs";
3185
- var getSearchPathsForProduct = () => {
3186
- return [];
3187
- };
3188
- var getLocalBrowser = () => {
3189
- for (const p of getSearchPathsForProduct()) {
3190
- if (fs4.existsSync(p)) {
3191
- return p;
3192
- }
3193
- }
3194
- return null;
3195
- };
3196
-
3197
3252
  // src/ensure-browser.ts
3198
3253
  var currentEnsureBrowserOperation = Promise.resolve();
3199
3254
  var internalEnsureBrowserUncapped = async ({
3200
3255
  indent,
3201
3256
  logLevel,
3202
3257
  browserExecutable,
3203
- onBrowserDownload
3258
+ onBrowserDownload,
3259
+ chromeMode
3204
3260
  }) => {
3205
- const status = getBrowserStatus(browserExecutable);
3261
+ const status = getBrowserStatus({ browserExecutable, chromeMode });
3206
3262
  if (status.type === "no-browser") {
3207
- const { onProgress, version } = onBrowserDownload();
3208
- await downloadBrowser({ indent, logLevel, onProgress, version });
3263
+ const { onProgress, version } = onBrowserDownload({ chromeMode });
3264
+ await downloadBrowser({ indent, logLevel, onProgress, version, chromeMode });
3209
3265
  }
3210
- const newStatus = getBrowserStatus(browserExecutable);
3266
+ const newStatus = getBrowserStatus({ browserExecutable, chromeMode });
3211
3267
  return newStatus;
3212
3268
  };
3213
3269
  var internalEnsureBrowser = (options) => {
3214
3270
  currentEnsureBrowserOperation = currentEnsureBrowserOperation.then(() => internalEnsureBrowserUncapped(options));
3215
3271
  return currentEnsureBrowserOperation;
3216
3272
  };
3217
- var getBrowserStatus = (browserExecutable) => {
3273
+ var getBrowserStatus = ({
3274
+ browserExecutable,
3275
+ chromeMode
3276
+ }) => {
3218
3277
  if (browserExecutable) {
3219
- if (!fs5.existsSync(browserExecutable)) {
3278
+ if (!fs4.existsSync(browserExecutable)) {
3220
3279
  throw new Error(`"browserExecutable" was specified as '${browserExecutable}' but the path doesn't exist. Pass "null" for "browserExecutable" to download a browser automatically.`);
3221
3280
  }
3222
3281
  return { path: browserExecutable, type: "user-defined-path" };
3223
3282
  }
3224
- const localBrowser = getLocalBrowser();
3225
- if (localBrowser !== null) {
3226
- return { path: localBrowser, type: "local-browser" };
3227
- }
3228
- const revision = getRevisionInfo();
3229
- if (revision.local && fs5.existsSync(revision.executablePath)) {
3283
+ const revision = getRevisionInfo(chromeMode);
3284
+ if (revision.local && fs4.existsSync(revision.executablePath)) {
3230
3285
  return { path: revision.executablePath, type: "local-puppeteer-browser" };
3231
3286
  }
3232
3287
  return { type: "no-browser" };
@@ -3242,7 +3297,8 @@ var ensureBrowser = (options) => {
3242
3297
  api: "ensureBrowser()",
3243
3298
  indent: false,
3244
3299
  logLevel
3245
- })
3300
+ }),
3301
+ chromeMode: options?.chromeMode ?? "headless-shell"
3246
3302
  });
3247
3303
  };
3248
3304
  export {