@shotstack/shotstack-studio 1.0.0 → 1.1.0

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.
@@ -1,8 +1,9 @@
1
1
  import * as w from "pixi.js";
2
- import { Filter as Kt, deprecation as Ht, GpuProgram as $t, GlProgram as jt, Color as Vt } from "pixi.js";
3
- import * as ft from "opentype.js";
4
- import * as Ut from "howler";
5
- class Et {
2
+ import { Filter as Zt, deprecation as Kt, GpuProgram as Ht, GlProgram as Bt, Color as Vt } from "pixi.js";
3
+ import * as dt from "opentype.js";
4
+ import * as $t from "howler";
5
+ import { FFmpeg as jt } from "@ffmpeg/ffmpeg";
6
+ class At {
6
7
  events;
7
8
  constructor() {
8
9
  this.events = {};
@@ -22,16 +23,16 @@ class Et {
22
23
  i(t);
23
24
  }
24
25
  }
25
- class Wt extends Et {
26
+ class Ut extends At {
26
27
  registry;
27
28
  constructor() {
28
29
  super(), this.registry = {};
29
30
  }
30
31
  }
31
- class Xt {
32
+ class Wt {
32
33
  loadTracker;
33
34
  constructor() {
34
- this.loadTracker = new Wt();
35
+ this.loadTracker = new Ut();
35
36
  }
36
37
  async load(e, t) {
37
38
  this.updateAssetLoadMetadata(e, "pending", 0);
@@ -54,14 +55,14 @@ class Xt {
54
55
  this.loadTracker.emit("onAssetLoadInfoUpdated", { registry: s });
55
56
  }
56
57
  }
57
- class Be {
58
+ class Ze {
58
59
  static Name = "FontLoadParser";
59
60
  name;
60
61
  extension;
61
62
  validFontExtensions;
62
63
  woff2Decompressor;
63
64
  constructor() {
64
- this.name = Be.Name, this.extension = {
65
+ this.name = Ze.Name, this.extension = {
65
66
  type: [w.ExtensionType.LoadParser],
66
67
  priority: w.LoaderParserPriority.High,
67
68
  ref: null
@@ -74,12 +75,12 @@ class Be {
74
75
  async load(e, t, i) {
75
76
  const s = e.split("?")[0]?.split(".").pop()?.toLowerCase() ?? "", n = await fetch(e).then((p) => p.arrayBuffer());
76
77
  if (s !== "woff2") {
77
- const p = ft.parse(new Uint8Array(n).buffer), k = p.names.fontFamily.en || p.names.fontFamily[Object.keys(p.names.fontFamily)[0]], R = new FontFace(k, `url(${e})`);
78
- return await R.load(), document.fonts.add(R), R;
78
+ const p = dt.parse(new Uint8Array(n).buffer), k = p.names.fontFamily.en || p.names.fontFamily[Object.keys(p.names.fontFamily)[0]], A = new FontFace(k, `url(${e})`);
79
+ return await A.load(), document.fonts.add(A), A;
79
80
  }
80
81
  if (await this.loadWoff2Decompressor(), !this.woff2Decompressor)
81
82
  throw new Error("Cannot initialize Woff2 decompressor.");
82
- const r = this.woff2Decompressor.decompress(n), o = ft.parse(new Uint8Array(r).buffer), h = o.names.fontFamily.en || o.names.fontFamily[Object.keys(o.names.fontFamily)[0]], c = new Blob([r], { type: "font/ttf" }), l = URL.createObjectURL(c), g = new FontFace(h, `url(${l})`);
83
+ const r = this.woff2Decompressor.decompress(n), o = dt.parse(new Uint8Array(r).buffer), h = o.names.fontFamily.en || o.names.fontFamily[Object.keys(o.names.fontFamily)[0]], c = new Blob([r], { type: "font/ttf" }), l = URL.createObjectURL(c), g = new FontFace(h, `url(${l})`);
83
84
  return await g.load(), document.fonts.add(g), g;
84
85
  }
85
86
  async loadWoff2Decompressor() {
@@ -130,14 +131,14 @@ var C;
130
131
  }
131
132
  a.joinValues = i, a.jsonStringifyReplacer = (s, n) => typeof n == "bigint" ? n.toString() : n;
132
133
  })(C || (C = {}));
133
- var pt;
134
+ var ft;
134
135
  (function(a) {
135
136
  a.mergeShapes = (e, t) => ({
136
137
  ...e,
137
138
  ...t
138
139
  // second overwrites first
139
140
  });
140
- })(pt || (pt = {}));
141
+ })(ft || (ft = {}));
141
142
  const f = C.arrayToEnum([
142
143
  "string",
143
144
  "nan",
@@ -198,7 +199,7 @@ const f = C.arrayToEnum([
198
199
  "not_multiple_of",
199
200
  "not_finite"
200
201
  ]);
201
- class M extends Error {
202
+ class F extends Error {
202
203
  get errors() {
203
204
  return this.issues;
204
205
  }
@@ -235,7 +236,7 @@ class M extends Error {
235
236
  return s(this), i;
236
237
  }
237
238
  static assert(e) {
238
- if (!(e instanceof M))
239
+ if (!(e instanceof F))
239
240
  throw new Error(`Not a ZodError: ${e}`);
240
241
  }
241
242
  toString() {
@@ -257,8 +258,8 @@ class M extends Error {
257
258
  return this.flatten();
258
259
  }
259
260
  }
260
- M.create = (a) => new M(a);
261
- const be = (a, e) => {
261
+ F.create = (a) => new F(a);
262
+ const ke = (a, e) => {
262
263
  let t;
263
264
  switch (a.code) {
264
265
  case u.invalid_type:
@@ -314,11 +315,11 @@ const be = (a, e) => {
314
315
  }
315
316
  return { message: t };
316
317
  };
317
- let Yt = be;
318
+ let Yt = ke;
318
319
  function Ye() {
319
320
  return Yt;
320
321
  }
321
- const Ge = (a) => {
322
+ const Xe = (a) => {
322
323
  const { data: e, path: t, errorMaps: i, issueData: s } = a, n = [...t, ...s.path || []], r = {
323
324
  ...s,
324
325
  path: n
@@ -340,7 +341,7 @@ const Ge = (a) => {
340
341
  };
341
342
  };
342
343
  function d(a, e) {
343
- const t = Ye(), i = Ge({
344
+ const t = Ye(), i = Xe({
344
345
  issueData: e,
345
346
  data: a.data,
346
347
  path: a.path,
@@ -351,13 +352,13 @@ function d(a, e) {
351
352
  // then schema-bound map if available
352
353
  t,
353
354
  // then global override map
354
- t === be ? void 0 : be
355
+ t === ke ? void 0 : ke
355
356
  // then global default map
356
357
  ].filter((s) => !!s)
357
358
  });
358
359
  a.common.issues.push(i);
359
360
  }
360
- class L {
361
+ class I {
361
362
  constructor() {
362
363
  this.value = "valid";
363
364
  }
@@ -385,7 +386,7 @@ class L {
385
386
  value: r
386
387
  });
387
388
  }
388
- return L.mergeObjectSync(e, i);
389
+ return I.mergeObjectSync(e, i);
389
390
  }
390
391
  static mergeObjectSync(e, t) {
391
392
  const i = {};
@@ -400,8 +401,8 @@ class L {
400
401
  }
401
402
  const x = Object.freeze({
402
403
  status: "aborted"
403
- }), ve = (a) => ({ status: "dirty", value: a }), N = (a) => ({ status: "valid", value: a }), mt = (a) => a.status === "aborted", gt = (a) => a.status === "dirty", pe = (a) => a.status === "valid", Te = (a) => typeof Promise < "u" && a instanceof Promise;
404
- function Ae(a, e, t, i) {
404
+ }), ye = (a) => ({ status: "dirty", value: a }), M = (a) => ({ status: "valid", value: a }), pt = (a) => a.status === "aborted", mt = (a) => a.status === "dirty", fe = (a) => a.status === "valid", Te = (a) => typeof Promise < "u" && a instanceof Promise;
405
+ function Oe(a, e, t, i) {
405
406
  if (typeof e == "function" ? a !== e || !0 : !e.has(a)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
406
407
  return e.get(a);
407
408
  }
@@ -413,7 +414,7 @@ var m;
413
414
  (function(a) {
414
415
  a.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, a.toString = (e) => typeof e == "string" ? e : e?.message;
415
416
  })(m || (m = {}));
416
- var xe, we;
417
+ var ve, xe;
417
418
  class K {
418
419
  constructor(e, t, i, s) {
419
420
  this._cachedPath = [], this.parent = e, this.data = t, this._path = i, this._key = s;
@@ -422,8 +423,8 @@ class K {
422
423
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
423
424
  }
424
425
  }
425
- const yt = (a, e) => {
426
- if (pe(e))
426
+ const gt = (a, e) => {
427
+ if (fe(e))
427
428
  return { success: !0, data: e.value };
428
429
  if (!a.common.issues.length)
429
430
  throw new Error("Validation failed but no issues detected.");
@@ -432,7 +433,7 @@ const yt = (a, e) => {
432
433
  get error() {
433
434
  if (this._error)
434
435
  return this._error;
435
- const t = new M(a.common.issues);
436
+ const t = new F(a.common.issues);
436
437
  return this._error = t, this._error;
437
438
  }
438
439
  };
@@ -468,7 +469,7 @@ class b {
468
469
  }
469
470
  _processInputParams(e) {
470
471
  return {
471
- status: new L(),
472
+ status: new I(),
472
473
  ctx: {
473
474
  common: e.parent.common,
474
475
  data: e.data,
@@ -509,7 +510,7 @@ class b {
509
510
  data: e,
510
511
  parsedType: q(e)
511
512
  }, n = this._parseSync({ data: e, path: s.path, parent: s });
512
- return yt(s, n);
513
+ return gt(s, n);
513
514
  }
514
515
  "~validate"(e) {
515
516
  var t, i;
@@ -527,7 +528,7 @@ class b {
527
528
  if (!this["~standard"].async)
528
529
  try {
529
530
  const n = this._parseSync({ data: e, path: [], parent: s });
530
- return pe(n) ? {
531
+ return fe(n) ? {
531
532
  value: n.value
532
533
  } : {
533
534
  issues: s.common.issues
@@ -538,7 +539,7 @@ class b {
538
539
  async: !0
539
540
  };
540
541
  }
541
- return this._parseAsync({ data: e, path: [], parent: s }).then((n) => pe(n) ? {
542
+ return this._parseAsync({ data: e, path: [], parent: s }).then((n) => fe(n) ? {
542
543
  value: n.value
543
544
  } : {
544
545
  issues: s.common.issues
@@ -563,7 +564,7 @@ class b {
563
564
  data: e,
564
565
  parsedType: q(e)
565
566
  }, s = this._parse({ data: e, path: i.path, parent: i }), n = await (Te(s) ? s : Promise.resolve(s));
566
- return yt(i, n);
567
+ return gt(i, n);
567
568
  }
568
569
  refine(e, t) {
569
570
  const i = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
@@ -596,25 +597,25 @@ class b {
596
597
  };
597
598
  }
598
599
  optional() {
599
- return W.create(this, this._def);
600
+ return U.create(this, this._def);
600
601
  }
601
602
  nullable() {
602
- return ne.create(this, this._def);
603
+ return se.create(this, this._def);
603
604
  }
604
605
  nullish() {
605
606
  return this.nullable().optional();
606
607
  }
607
608
  array() {
608
- return B.create(this);
609
+ return Z.create(this);
609
610
  }
610
611
  promise() {
611
- return Se.create(this, this._def);
612
+ return Ce.create(this, this._def);
612
613
  }
613
614
  or(e) {
614
- return Pe.create([this, e], this._def);
615
+ return Re.create([this, e], this._def);
615
616
  }
616
617
  and(e) {
617
- return Ie.create(this, e, this._def);
618
+ return ze.create(this, e, this._def);
618
619
  }
619
620
  transform(e) {
620
621
  return new Y({
@@ -626,7 +627,7 @@ class b {
626
627
  }
627
628
  default(e) {
628
629
  const t = typeof e == "function" ? e : () => e;
629
- return new Me({
630
+ return new Fe({
630
631
  ..._(this._def),
631
632
  innerType: this,
632
633
  defaultValue: t,
@@ -634,7 +635,7 @@ class b {
634
635
  });
635
636
  }
636
637
  brand() {
637
- return new Dt({
638
+ return new Lt({
638
639
  typeName: v.ZodBranded,
639
640
  type: this,
640
641
  ..._(this._def)
@@ -642,7 +643,7 @@ class b {
642
643
  }
643
644
  catch(e) {
644
645
  const t = typeof e == "function" ? e : () => e;
645
- return new Fe({
646
+ return new Ne({
646
647
  ..._(this._def),
647
648
  innerType: this,
648
649
  catchValue: t,
@@ -660,7 +661,7 @@ class b {
660
661
  return Ke.create(this, e);
661
662
  }
662
663
  readonly() {
663
- return Ze.create(this);
664
+ return De.create(this);
664
665
  }
665
666
  isOptional() {
666
667
  return this.safeParse(void 0).success;
@@ -669,26 +670,26 @@ class b {
669
670
  return this.safeParse(null).success;
670
671
  }
671
672
  }
672
- const Gt = /^c[^\s-]{8,}$/i, qt = /^[0-9a-z]+$/, Qt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Jt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ei = /^[a-z0-9_-]{21}$/i, ti = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ii = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, si = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ni = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
673
- let Xe;
674
- const ai = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ri = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, oi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ci = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, li = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, hi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, It = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ui = new RegExp(`^${It}$`);
675
- function Lt(a) {
673
+ const Xt = /^c[^\s-]{8,}$/i, qt = /^[0-9a-z]+$/, Gt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Qt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Jt = /^[a-z0-9_-]{21}$/i, ei = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ti = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ii = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, si = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
674
+ let We;
675
+ const ni = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ai = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ri = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, oi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ci = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, li = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Rt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", hi = new RegExp(`^${Rt}$`);
676
+ function zt(a) {
676
677
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
677
678
  return a.precision ? e = `${e}\\.\\d{${a.precision}}` : a.precision == null && (e = `${e}(\\.\\d+)?`), e;
678
679
  }
679
- function di(a) {
680
- return new RegExp(`^${Lt(a)}$`);
680
+ function ui(a) {
681
+ return new RegExp(`^${zt(a)}$`);
681
682
  }
682
- function fi(a) {
683
- let e = `${It}T${Lt(a)}`;
683
+ function di(a) {
684
+ let e = `${Rt}T${zt(a)}`;
684
685
  const t = [];
685
686
  return t.push(a.local ? "Z?" : "Z"), a.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
686
687
  }
687
- function pi(a, e) {
688
- return !!((e === "v4" || !e) && ai.test(a) || (e === "v6" || !e) && oi.test(a));
688
+ function fi(a, e) {
689
+ return !!((e === "v4" || !e) && ni.test(a) || (e === "v6" || !e) && ri.test(a));
689
690
  }
690
- function mi(a, e) {
691
- if (!ti.test(a))
691
+ function pi(a, e) {
692
+ if (!ei.test(a))
692
693
  return !1;
693
694
  try {
694
695
  const [t] = a.split("."), i = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(i));
@@ -697,10 +698,10 @@ function mi(a, e) {
697
698
  return !1;
698
699
  }
699
700
  }
700
- function gi(a, e) {
701
- return !!((e === "v4" || !e) && ri.test(a) || (e === "v6" || !e) && ci.test(a));
701
+ function mi(a, e) {
702
+ return !!((e === "v4" || !e) && ai.test(a) || (e === "v6" || !e) && oi.test(a));
702
703
  }
703
- class U extends b {
704
+ class j extends b {
704
705
  _parse(e) {
705
706
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
706
707
  const n = this._getOrReturnCtx(e);
@@ -710,7 +711,7 @@ class U extends b {
710
711
  received: n.parsedType
711
712
  }), x;
712
713
  }
713
- const i = new L();
714
+ const i = new I();
714
715
  let s;
715
716
  for (const n of this._def.checks)
716
717
  if (n.kind === "min")
@@ -749,31 +750,31 @@ class U extends b {
749
750
  message: n.message
750
751
  }), i.dirty());
751
752
  } else if (n.kind === "email")
752
- si.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
753
+ ii.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
753
754
  validation: "email",
754
755
  code: u.invalid_string,
755
756
  message: n.message
756
757
  }), i.dirty());
757
758
  else if (n.kind === "emoji")
758
- Xe || (Xe = new RegExp(ni, "u")), Xe.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
759
+ We || (We = new RegExp(si, "u")), We.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
759
760
  validation: "emoji",
760
761
  code: u.invalid_string,
761
762
  message: n.message
762
763
  }), i.dirty());
763
764
  else if (n.kind === "uuid")
764
- Jt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
765
+ Qt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
765
766
  validation: "uuid",
766
767
  code: u.invalid_string,
767
768
  message: n.message
768
769
  }), i.dirty());
769
770
  else if (n.kind === "nanoid")
770
- ei.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
771
+ Jt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
771
772
  validation: "nanoid",
772
773
  code: u.invalid_string,
773
774
  message: n.message
774
775
  }), i.dirty());
775
776
  else if (n.kind === "cuid")
776
- Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
777
+ Xt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
777
778
  validation: "cuid",
778
779
  code: u.invalid_string,
779
780
  message: n.message
@@ -785,7 +786,7 @@ class U extends b {
785
786
  message: n.message
786
787
  }), i.dirty());
787
788
  else if (n.kind === "ulid")
788
- Qt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
789
+ Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
789
790
  validation: "ulid",
790
791
  code: u.invalid_string,
791
792
  message: n.message
@@ -816,39 +817,39 @@ class U extends b {
816
817
  code: u.invalid_string,
817
818
  validation: { endsWith: n.value },
818
819
  message: n.message
819
- }), i.dirty()) : n.kind === "datetime" ? fi(n).test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
820
+ }), i.dirty()) : n.kind === "datetime" ? di(n).test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
820
821
  code: u.invalid_string,
821
822
  validation: "datetime",
822
823
  message: n.message
823
- }), i.dirty()) : n.kind === "date" ? ui.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
824
+ }), i.dirty()) : n.kind === "date" ? hi.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
824
825
  code: u.invalid_string,
825
826
  validation: "date",
826
827
  message: n.message
827
- }), i.dirty()) : n.kind === "time" ? di(n).test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
828
+ }), i.dirty()) : n.kind === "time" ? ui(n).test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
828
829
  code: u.invalid_string,
829
830
  validation: "time",
830
831
  message: n.message
831
- }), i.dirty()) : n.kind === "duration" ? ii.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
832
+ }), i.dirty()) : n.kind === "duration" ? ti.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
832
833
  validation: "duration",
833
834
  code: u.invalid_string,
834
835
  message: n.message
835
- }), i.dirty()) : n.kind === "ip" ? pi(e.data, n.version) || (s = this._getOrReturnCtx(e, s), d(s, {
836
+ }), i.dirty()) : n.kind === "ip" ? fi(e.data, n.version) || (s = this._getOrReturnCtx(e, s), d(s, {
836
837
  validation: "ip",
837
838
  code: u.invalid_string,
838
839
  message: n.message
839
- }), i.dirty()) : n.kind === "jwt" ? mi(e.data, n.alg) || (s = this._getOrReturnCtx(e, s), d(s, {
840
+ }), i.dirty()) : n.kind === "jwt" ? pi(e.data, n.alg) || (s = this._getOrReturnCtx(e, s), d(s, {
840
841
  validation: "jwt",
841
842
  code: u.invalid_string,
842
843
  message: n.message
843
- }), i.dirty()) : n.kind === "cidr" ? gi(e.data, n.version) || (s = this._getOrReturnCtx(e, s), d(s, {
844
+ }), i.dirty()) : n.kind === "cidr" ? mi(e.data, n.version) || (s = this._getOrReturnCtx(e, s), d(s, {
844
845
  validation: "cidr",
845
846
  code: u.invalid_string,
846
847
  message: n.message
847
- }), i.dirty()) : n.kind === "base64" ? li.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
848
+ }), i.dirty()) : n.kind === "base64" ? ci.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
848
849
  validation: "base64",
849
850
  code: u.invalid_string,
850
851
  message: n.message
851
- }), i.dirty()) : n.kind === "base64url" ? hi.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
852
+ }), i.dirty()) : n.kind === "base64url" ? li.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
852
853
  validation: "base64url",
853
854
  code: u.invalid_string,
854
855
  message: n.message
@@ -863,7 +864,7 @@ class U extends b {
863
864
  });
864
865
  }
865
866
  _addCheck(e) {
866
- return new U({
867
+ return new j({
867
868
  ...this._def,
868
869
  checks: [...this._def.checks, e]
869
870
  });
@@ -1000,19 +1001,19 @@ class U extends b {
1000
1001
  return this.min(1, m.errToObj(e));
1001
1002
  }
1002
1003
  trim() {
1003
- return new U({
1004
+ return new j({
1004
1005
  ...this._def,
1005
1006
  checks: [...this._def.checks, { kind: "trim" }]
1006
1007
  });
1007
1008
  }
1008
1009
  toLowerCase() {
1009
- return new U({
1010
+ return new j({
1010
1011
  ...this._def,
1011
1012
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1012
1013
  });
1013
1014
  }
1014
1015
  toUpperCase() {
1015
- return new U({
1016
+ return new j({
1016
1017
  ...this._def,
1017
1018
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1018
1019
  });
@@ -1078,20 +1079,20 @@ class U extends b {
1078
1079
  return e;
1079
1080
  }
1080
1081
  }
1081
- U.create = (a) => {
1082
+ j.create = (a) => {
1082
1083
  var e;
1083
- return new U({
1084
+ return new j({
1084
1085
  checks: [],
1085
1086
  typeName: v.ZodString,
1086
1087
  coerce: (e = a?.coerce) !== null && e !== void 0 ? e : !1,
1087
1088
  ..._(a)
1088
1089
  });
1089
1090
  };
1090
- function yi(a, e) {
1091
+ function gi(a, e) {
1091
1092
  const t = (a.toString().split(".")[1] || "").length, i = (e.toString().split(".")[1] || "").length, s = t > i ? t : i, n = parseInt(a.toFixed(s).replace(".", "")), r = parseInt(e.toFixed(s).replace(".", ""));
1092
1093
  return n % r / Math.pow(10, s);
1093
1094
  }
1094
- class me extends b {
1095
+ class pe extends b {
1095
1096
  constructor() {
1096
1097
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1097
1098
  }
@@ -1105,7 +1106,7 @@ class me extends b {
1105
1106
  }), x;
1106
1107
  }
1107
1108
  let i;
1108
- const s = new L();
1109
+ const s = new I();
1109
1110
  for (const n of this._def.checks)
1110
1111
  n.kind === "int" ? C.isInteger(e.data) || (i = this._getOrReturnCtx(e, i), d(i, {
1111
1112
  code: u.invalid_type,
@@ -1126,7 +1127,7 @@ class me extends b {
1126
1127
  inclusive: n.inclusive,
1127
1128
  exact: !1,
1128
1129
  message: n.message
1129
- }), s.dirty()) : n.kind === "multipleOf" ? yi(e.data, n.value) !== 0 && (i = this._getOrReturnCtx(e, i), d(i, {
1130
+ }), s.dirty()) : n.kind === "multipleOf" ? gi(e.data, n.value) !== 0 && (i = this._getOrReturnCtx(e, i), d(i, {
1130
1131
  code: u.not_multiple_of,
1131
1132
  multipleOf: n.value,
1132
1133
  message: n.message
@@ -1149,7 +1150,7 @@ class me extends b {
1149
1150
  return this.setLimit("max", e, !1, m.toString(t));
1150
1151
  }
1151
1152
  setLimit(e, t, i, s) {
1152
- return new me({
1153
+ return new pe({
1153
1154
  ...this._def,
1154
1155
  checks: [
1155
1156
  ...this._def.checks,
@@ -1163,7 +1164,7 @@ class me extends b {
1163
1164
  });
1164
1165
  }
1165
1166
  _addCheck(e) {
1166
- return new me({
1167
+ return new pe({
1167
1168
  ...this._def,
1168
1169
  checks: [...this._def.checks, e]
1169
1170
  });
@@ -1257,13 +1258,13 @@ class me extends b {
1257
1258
  return Number.isFinite(t) && Number.isFinite(e);
1258
1259
  }
1259
1260
  }
1260
- me.create = (a) => new me({
1261
+ pe.create = (a) => new pe({
1261
1262
  checks: [],
1262
1263
  typeName: v.ZodNumber,
1263
1264
  coerce: a?.coerce || !1,
1264
1265
  ..._(a)
1265
1266
  });
1266
- class ge extends b {
1267
+ class me extends b {
1267
1268
  constructor() {
1268
1269
  super(...arguments), this.min = this.gte, this.max = this.lte;
1269
1270
  }
@@ -1277,7 +1278,7 @@ class ge extends b {
1277
1278
  if (this._getType(e) !== f.bigint)
1278
1279
  return this._getInvalidInput(e);
1279
1280
  let i;
1280
- const s = new L();
1281
+ const s = new I();
1281
1282
  for (const n of this._def.checks)
1282
1283
  n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (i = this._getOrReturnCtx(e, i), d(i, {
1283
1284
  code: u.too_small,
@@ -1319,7 +1320,7 @@ class ge extends b {
1319
1320
  return this.setLimit("max", e, !1, m.toString(t));
1320
1321
  }
1321
1322
  setLimit(e, t, i, s) {
1322
- return new ge({
1323
+ return new me({
1323
1324
  ...this._def,
1324
1325
  checks: [
1325
1326
  ...this._def.checks,
@@ -1333,7 +1334,7 @@ class ge extends b {
1333
1334
  });
1334
1335
  }
1335
1336
  _addCheck(e) {
1336
- return new ge({
1337
+ return new me({
1337
1338
  ...this._def,
1338
1339
  checks: [...this._def.checks, e]
1339
1340
  });
@@ -1390,9 +1391,9 @@ class ge extends b {
1390
1391
  return e;
1391
1392
  }
1392
1393
  }
1393
- ge.create = (a) => {
1394
+ me.create = (a) => {
1394
1395
  var e;
1395
- return new ge({
1396
+ return new me({
1396
1397
  checks: [],
1397
1398
  typeName: v.ZodBigInt,
1398
1399
  coerce: (e = a?.coerce) !== null && e !== void 0 ? e : !1,
@@ -1409,7 +1410,7 @@ class qe extends b {
1409
1410
  received: i.parsedType
1410
1411
  }), x;
1411
1412
  }
1412
- return N(e.data);
1413
+ return M(e.data);
1413
1414
  }
1414
1415
  }
1415
1416
  qe.create = (a) => new qe({
@@ -1417,7 +1418,7 @@ qe.create = (a) => new qe({
1417
1418
  coerce: a?.coerce || !1,
1418
1419
  ..._(a)
1419
1420
  });
1420
- class Ce extends b {
1421
+ class be extends b {
1421
1422
  _parse(e) {
1422
1423
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1423
1424
  const n = this._getOrReturnCtx(e);
@@ -1433,7 +1434,7 @@ class Ce extends b {
1433
1434
  code: u.invalid_date
1434
1435
  }), x;
1435
1436
  }
1436
- const i = new L();
1437
+ const i = new I();
1437
1438
  let s;
1438
1439
  for (const n of this._def.checks)
1439
1440
  n.kind === "min" ? e.data.getTime() < n.value && (s = this._getOrReturnCtx(e, s), d(s, {
@@ -1457,7 +1458,7 @@ class Ce extends b {
1457
1458
  };
1458
1459
  }
1459
1460
  _addCheck(e) {
1460
- return new Ce({
1461
+ return new be({
1461
1462
  ...this._def,
1462
1463
  checks: [...this._def.checks, e]
1463
1464
  });
@@ -1489,13 +1490,13 @@ class Ce extends b {
1489
1490
  return e != null ? new Date(e) : null;
1490
1491
  }
1491
1492
  }
1492
- Ce.create = (a) => new Ce({
1493
+ be.create = (a) => new be({
1493
1494
  checks: [],
1494
1495
  coerce: a?.coerce || !1,
1495
1496
  typeName: v.ZodDate,
1496
1497
  ..._(a)
1497
1498
  });
1498
- class Qe extends b {
1499
+ class Ge extends b {
1499
1500
  _parse(e) {
1500
1501
  if (this._getType(e) !== f.symbol) {
1501
1502
  const i = this._getOrReturnCtx(e);
@@ -1505,14 +1506,14 @@ class Qe extends b {
1505
1506
  received: i.parsedType
1506
1507
  }), x;
1507
1508
  }
1508
- return N(e.data);
1509
+ return M(e.data);
1509
1510
  }
1510
1511
  }
1511
- Qe.create = (a) => new Qe({
1512
+ Ge.create = (a) => new Ge({
1512
1513
  typeName: v.ZodSymbol,
1513
1514
  ..._(a)
1514
1515
  });
1515
- class Re extends b {
1516
+ class Ae extends b {
1516
1517
  _parse(e) {
1517
1518
  if (this._getType(e) !== f.undefined) {
1518
1519
  const i = this._getOrReturnCtx(e);
@@ -1522,14 +1523,14 @@ class Re extends b {
1522
1523
  received: i.parsedType
1523
1524
  }), x;
1524
1525
  }
1525
- return N(e.data);
1526
+ return M(e.data);
1526
1527
  }
1527
1528
  }
1528
- Re.create = (a) => new Re({
1529
+ Ae.create = (a) => new Ae({
1529
1530
  typeName: v.ZodUndefined,
1530
1531
  ..._(a)
1531
1532
  });
1532
- class Ee extends b {
1533
+ class Pe extends b {
1533
1534
  _parse(e) {
1534
1535
  if (this._getType(e) !== f.null) {
1535
1536
  const i = this._getOrReturnCtx(e);
@@ -1539,38 +1540,38 @@ class Ee extends b {
1539
1540
  received: i.parsedType
1540
1541
  }), x;
1541
1542
  }
1542
- return N(e.data);
1543
+ return M(e.data);
1543
1544
  }
1544
1545
  }
1545
- Ee.create = (a) => new Ee({
1546
+ Pe.create = (a) => new Pe({
1546
1547
  typeName: v.ZodNull,
1547
1548
  ..._(a)
1548
1549
  });
1549
- class Je extends b {
1550
+ class Qe extends b {
1550
1551
  constructor() {
1551
1552
  super(...arguments), this._any = !0;
1552
1553
  }
1553
1554
  _parse(e) {
1554
- return N(e.data);
1555
+ return M(e.data);
1555
1556
  }
1556
1557
  }
1557
- Je.create = (a) => new Je({
1558
+ Qe.create = (a) => new Qe({
1558
1559
  typeName: v.ZodAny,
1559
1560
  ..._(a)
1560
1561
  });
1561
- class de extends b {
1562
+ class ue extends b {
1562
1563
  constructor() {
1563
1564
  super(...arguments), this._unknown = !0;
1564
1565
  }
1565
1566
  _parse(e) {
1566
- return N(e.data);
1567
+ return M(e.data);
1567
1568
  }
1568
1569
  }
1569
- de.create = (a) => new de({
1570
+ ue.create = (a) => new ue({
1570
1571
  typeName: v.ZodUnknown,
1571
1572
  ..._(a)
1572
1573
  });
1573
- class Q extends b {
1574
+ class G extends b {
1574
1575
  _parse(e) {
1575
1576
  const t = this._getOrReturnCtx(e);
1576
1577
  return d(t, {
@@ -1580,11 +1581,11 @@ class Q extends b {
1580
1581
  }), x;
1581
1582
  }
1582
1583
  }
1583
- Q.create = (a) => new Q({
1584
+ G.create = (a) => new G({
1584
1585
  typeName: v.ZodNever,
1585
1586
  ..._(a)
1586
1587
  });
1587
- class et extends b {
1588
+ class Je extends b {
1588
1589
  _parse(e) {
1589
1590
  if (this._getType(e) !== f.undefined) {
1590
1591
  const i = this._getOrReturnCtx(e);
@@ -1594,14 +1595,14 @@ class et extends b {
1594
1595
  received: i.parsedType
1595
1596
  }), x;
1596
1597
  }
1597
- return N(e.data);
1598
+ return M(e.data);
1598
1599
  }
1599
1600
  }
1600
- et.create = (a) => new et({
1601
+ Je.create = (a) => new Je({
1601
1602
  typeName: v.ZodVoid,
1602
1603
  ..._(a)
1603
1604
  });
1604
- class B extends b {
1605
+ class Z extends b {
1605
1606
  _parse(e) {
1606
1607
  const { ctx: t, status: i } = this._processInputParams(e), s = this._def;
1607
1608
  if (t.parsedType !== f.array)
@@ -1637,27 +1638,27 @@ class B extends b {
1637
1638
  exact: !1,
1638
1639
  message: s.maxLength.message
1639
1640
  }), i.dirty()), t.common.async)
1640
- return Promise.all([...t.data].map((r, o) => s.type._parseAsync(new K(t, r, t.path, o)))).then((r) => L.mergeArray(i, r));
1641
+ return Promise.all([...t.data].map((r, o) => s.type._parseAsync(new K(t, r, t.path, o)))).then((r) => I.mergeArray(i, r));
1641
1642
  const n = [...t.data].map((r, o) => s.type._parseSync(new K(t, r, t.path, o)));
1642
- return L.mergeArray(i, n);
1643
+ return I.mergeArray(i, n);
1643
1644
  }
1644
1645
  get element() {
1645
1646
  return this._def.type;
1646
1647
  }
1647
1648
  min(e, t) {
1648
- return new B({
1649
+ return new Z({
1649
1650
  ...this._def,
1650
1651
  minLength: { value: e, message: m.toString(t) }
1651
1652
  });
1652
1653
  }
1653
1654
  max(e, t) {
1654
- return new B({
1655
+ return new Z({
1655
1656
  ...this._def,
1656
1657
  maxLength: { value: e, message: m.toString(t) }
1657
1658
  });
1658
1659
  }
1659
1660
  length(e, t) {
1660
- return new B({
1661
+ return new Z({
1661
1662
  ...this._def,
1662
1663
  exactLength: { value: e, message: m.toString(t) }
1663
1664
  });
@@ -1666,7 +1667,7 @@ class B extends b {
1666
1667
  return this.min(1, e);
1667
1668
  }
1668
1669
  }
1669
- B.create = (a, e) => new B({
1670
+ Z.create = (a, e) => new Z({
1670
1671
  type: a,
1671
1672
  minLength: null,
1672
1673
  maxLength: null,
@@ -1674,23 +1675,23 @@ B.create = (a, e) => new B({
1674
1675
  typeName: v.ZodArray,
1675
1676
  ..._(e)
1676
1677
  });
1677
- function le(a) {
1678
- if (a instanceof E) {
1678
+ function ce(a) {
1679
+ if (a instanceof P) {
1679
1680
  const e = {};
1680
1681
  for (const t in a.shape) {
1681
1682
  const i = a.shape[t];
1682
- e[t] = W.create(le(i));
1683
+ e[t] = U.create(ce(i));
1683
1684
  }
1684
- return new E({
1685
+ return new P({
1685
1686
  ...a._def,
1686
1687
  shape: () => e
1687
1688
  });
1688
- } else return a instanceof B ? new B({
1689
+ } else return a instanceof Z ? new Z({
1689
1690
  ...a._def,
1690
- type: le(a.element)
1691
- }) : a instanceof W ? W.create(le(a.unwrap())) : a instanceof ne ? ne.create(le(a.unwrap())) : a instanceof X ? X.create(a.items.map((e) => le(e))) : a;
1691
+ type: ce(a.element)
1692
+ }) : a instanceof U ? U.create(ce(a.unwrap())) : a instanceof se ? se.create(ce(a.unwrap())) : a instanceof W ? W.create(a.items.map((e) => ce(e))) : a;
1692
1693
  }
1693
- class E extends b {
1694
+ class P extends b {
1694
1695
  constructor() {
1695
1696
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1696
1697
  }
@@ -1710,7 +1711,7 @@ class E extends b {
1710
1711
  }), x;
1711
1712
  }
1712
1713
  const { status: i, ctx: s } = this._processInputParams(e), { shape: n, keys: r } = this._getCached(), o = [];
1713
- if (!(this._def.catchall instanceof Q && this._def.unknownKeys === "strip"))
1714
+ if (!(this._def.catchall instanceof G && this._def.unknownKeys === "strip"))
1714
1715
  for (const c in s.data)
1715
1716
  r.includes(c) || o.push(c);
1716
1717
  const h = [];
@@ -1722,7 +1723,7 @@ class E extends b {
1722
1723
  alwaysSet: c in s.data
1723
1724
  });
1724
1725
  }
1725
- if (this._def.catchall instanceof Q) {
1726
+ if (this._def.catchall instanceof G) {
1726
1727
  const c = this._def.unknownKeys;
1727
1728
  if (c === "passthrough")
1728
1729
  for (const l of o)
@@ -1761,13 +1762,13 @@ class E extends b {
1761
1762
  });
1762
1763
  }
1763
1764
  return c;
1764
- }).then((c) => L.mergeObjectSync(i, c)) : L.mergeObjectSync(i, h);
1765
+ }).then((c) => I.mergeObjectSync(i, c)) : I.mergeObjectSync(i, h);
1765
1766
  }
1766
1767
  get shape() {
1767
1768
  return this._def.shape();
1768
1769
  }
1769
1770
  strict(e) {
1770
- return m.errToObj, new E({
1771
+ return m.errToObj, new P({
1771
1772
  ...this._def,
1772
1773
  unknownKeys: "strict",
1773
1774
  ...e !== void 0 ? {
@@ -1784,13 +1785,13 @@ class E extends b {
1784
1785
  });
1785
1786
  }
1786
1787
  strip() {
1787
- return new E({
1788
+ return new P({
1788
1789
  ...this._def,
1789
1790
  unknownKeys: "strip"
1790
1791
  });
1791
1792
  }
1792
1793
  passthrough() {
1793
- return new E({
1794
+ return new P({
1794
1795
  ...this._def,
1795
1796
  unknownKeys: "passthrough"
1796
1797
  });
@@ -1813,7 +1814,7 @@ class E extends b {
1813
1814
  // }) as any;
1814
1815
  // };
1815
1816
  extend(e) {
1816
- return new E({
1817
+ return new P({
1817
1818
  ...this._def,
1818
1819
  shape: () => ({
1819
1820
  ...this._def.shape(),
@@ -1827,7 +1828,7 @@ class E extends b {
1827
1828
  * upgrade if you are experiencing issues.
1828
1829
  */
1829
1830
  merge(e) {
1830
- return new E({
1831
+ return new P({
1831
1832
  unknownKeys: e._def.unknownKeys,
1832
1833
  catchall: e._def.catchall,
1833
1834
  shape: () => ({
@@ -1897,7 +1898,7 @@ class E extends b {
1897
1898
  // return merged;
1898
1899
  // }
1899
1900
  catchall(e) {
1900
- return new E({
1901
+ return new P({
1901
1902
  ...this._def,
1902
1903
  catchall: e
1903
1904
  });
@@ -1906,7 +1907,7 @@ class E extends b {
1906
1907
  const t = {};
1907
1908
  return C.objectKeys(e).forEach((i) => {
1908
1909
  e[i] && this.shape[i] && (t[i] = this.shape[i]);
1909
- }), new E({
1910
+ }), new P({
1910
1911
  ...this._def,
1911
1912
  shape: () => t
1912
1913
  });
@@ -1915,7 +1916,7 @@ class E extends b {
1915
1916
  const t = {};
1916
1917
  return C.objectKeys(this.shape).forEach((i) => {
1917
1918
  e[i] || (t[i] = this.shape[i]);
1918
- }), new E({
1919
+ }), new P({
1919
1920
  ...this._def,
1920
1921
  shape: () => t
1921
1922
  });
@@ -1924,14 +1925,14 @@ class E extends b {
1924
1925
  * @deprecated
1925
1926
  */
1926
1927
  deepPartial() {
1927
- return le(this);
1928
+ return ce(this);
1928
1929
  }
1929
1930
  partial(e) {
1930
1931
  const t = {};
1931
1932
  return C.objectKeys(this.shape).forEach((i) => {
1932
1933
  const s = this.shape[i];
1933
1934
  e && !e[i] ? t[i] = s : t[i] = s.optional();
1934
- }), new E({
1935
+ }), new P({
1935
1936
  ...this._def,
1936
1937
  shape: () => t
1937
1938
  });
@@ -1943,41 +1944,41 @@ class E extends b {
1943
1944
  t[i] = this.shape[i];
1944
1945
  else {
1945
1946
  let n = this.shape[i];
1946
- for (; n instanceof W; )
1947
+ for (; n instanceof U; )
1947
1948
  n = n._def.innerType;
1948
1949
  t[i] = n;
1949
1950
  }
1950
- }), new E({
1951
+ }), new P({
1951
1952
  ...this._def,
1952
1953
  shape: () => t
1953
1954
  });
1954
1955
  }
1955
1956
  keyof() {
1956
- return zt(C.objectKeys(this.shape));
1957
+ return It(C.objectKeys(this.shape));
1957
1958
  }
1958
1959
  }
1959
- E.create = (a, e) => new E({
1960
+ P.create = (a, e) => new P({
1960
1961
  shape: () => a,
1961
1962
  unknownKeys: "strip",
1962
- catchall: Q.create(),
1963
+ catchall: G.create(),
1963
1964
  typeName: v.ZodObject,
1964
1965
  ..._(e)
1965
1966
  });
1966
- E.strictCreate = (a, e) => new E({
1967
+ P.strictCreate = (a, e) => new P({
1967
1968
  shape: () => a,
1968
1969
  unknownKeys: "strict",
1969
- catchall: Q.create(),
1970
+ catchall: G.create(),
1970
1971
  typeName: v.ZodObject,
1971
1972
  ..._(e)
1972
1973
  });
1973
- E.lazycreate = (a, e) => new E({
1974
+ P.lazycreate = (a, e) => new P({
1974
1975
  shape: a,
1975
1976
  unknownKeys: "strip",
1976
- catchall: Q.create(),
1977
+ catchall: G.create(),
1977
1978
  typeName: v.ZodObject,
1978
1979
  ..._(e)
1979
1980
  });
1980
- class Pe extends b {
1981
+ class Re extends b {
1981
1982
  _parse(e) {
1982
1983
  const { ctx: t } = this._processInputParams(e), i = this._def.options;
1983
1984
  function s(n) {
@@ -1987,7 +1988,7 @@ class Pe extends b {
1987
1988
  for (const o of n)
1988
1989
  if (o.result.status === "dirty")
1989
1990
  return t.common.issues.push(...o.ctx.common.issues), o.result;
1990
- const r = n.map((o) => new M(o.ctx.common.issues));
1991
+ const r = n.map((o) => new F(o.ctx.common.issues));
1991
1992
  return d(t, {
1992
1993
  code: u.invalid_union,
1993
1994
  unionErrors: r
@@ -2034,7 +2035,7 @@ class Pe extends b {
2034
2035
  }
2035
2036
  if (n)
2036
2037
  return t.common.issues.push(...n.ctx.common.issues), n.result;
2037
- const o = r.map((h) => new M(h));
2038
+ const o = r.map((h) => new F(h));
2038
2039
  return d(t, {
2039
2040
  code: u.invalid_union,
2040
2041
  unionErrors: o
@@ -2045,13 +2046,13 @@ class Pe extends b {
2045
2046
  return this._def.options;
2046
2047
  }
2047
2048
  }
2048
- Pe.create = (a, e) => new Pe({
2049
+ Re.create = (a, e) => new Re({
2049
2050
  options: a,
2050
2051
  typeName: v.ZodUnion,
2051
2052
  ..._(e)
2052
2053
  });
2053
- const V = (a) => a instanceof ze ? V(a.schema) : a instanceof Y ? V(a.innerType()) : a instanceof De ? [a.value] : a instanceof se ? a.options : a instanceof Ne ? C.objectValues(a.enum) : a instanceof Me ? V(a._def.innerType) : a instanceof Re ? [void 0] : a instanceof Ee ? [null] : a instanceof W ? [void 0, ...V(a.unwrap())] : a instanceof ne ? [null, ...V(a.unwrap())] : a instanceof Dt || a instanceof Ze ? V(a.unwrap()) : a instanceof Fe ? V(a._def.innerType) : [];
2054
- class at extends b {
2054
+ const $ = (a) => a instanceof Le ? $(a.schema) : a instanceof Y ? $(a.innerType()) : a instanceof Ee ? [a.value] : a instanceof ie ? a.options : a instanceof Me ? C.objectValues(a.enum) : a instanceof Fe ? $(a._def.innerType) : a instanceof Ae ? [void 0] : a instanceof Pe ? [null] : a instanceof U ? [void 0, ...$(a.unwrap())] : a instanceof se ? [null, ...$(a.unwrap())] : a instanceof Lt || a instanceof De ? $(a.unwrap()) : a instanceof Ne ? $(a._def.innerType) : [];
2055
+ class nt extends b {
2055
2056
  _parse(e) {
2056
2057
  const { ctx: t } = this._processInputParams(e);
2057
2058
  if (t.parsedType !== f.object)
@@ -2095,7 +2096,7 @@ class at extends b {
2095
2096
  static create(e, t, i) {
2096
2097
  const s = /* @__PURE__ */ new Map();
2097
2098
  for (const n of t) {
2098
- const r = V(n.shape[e]);
2099
+ const r = $(n.shape[e]);
2099
2100
  if (!r.length)
2100
2101
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2101
2102
  for (const o of r) {
@@ -2104,7 +2105,7 @@ class at extends b {
2104
2105
  s.set(o, n);
2105
2106
  }
2106
2107
  }
2107
- return new at({
2108
+ return new nt({
2108
2109
  typeName: v.ZodDiscriminatedUnion,
2109
2110
  discriminator: e,
2110
2111
  options: t,
@@ -2113,14 +2114,14 @@ class at extends b {
2113
2114
  });
2114
2115
  }
2115
2116
  }
2116
- function tt(a, e) {
2117
+ function et(a, e) {
2117
2118
  const t = q(a), i = q(e);
2118
2119
  if (a === e)
2119
2120
  return { valid: !0, data: a };
2120
2121
  if (t === f.object && i === f.object) {
2121
2122
  const s = C.objectKeys(e), n = C.objectKeys(a).filter((o) => s.indexOf(o) !== -1), r = { ...a, ...e };
2122
2123
  for (const o of n) {
2123
- const h = tt(a[o], e[o]);
2124
+ const h = et(a[o], e[o]);
2124
2125
  if (!h.valid)
2125
2126
  return { valid: !1 };
2126
2127
  r[o] = h.data;
@@ -2131,7 +2132,7 @@ function tt(a, e) {
2131
2132
  return { valid: !1 };
2132
2133
  const s = [];
2133
2134
  for (let n = 0; n < a.length; n++) {
2134
- const r = a[n], o = e[n], h = tt(r, o);
2135
+ const r = a[n], o = e[n], h = et(r, o);
2135
2136
  if (!h.valid)
2136
2137
  return { valid: !1 };
2137
2138
  s.push(h.data);
@@ -2139,13 +2140,13 @@ function tt(a, e) {
2139
2140
  return { valid: !0, data: s };
2140
2141
  } else return t === f.date && i === f.date && +a == +e ? { valid: !0, data: a } : { valid: !1 };
2141
2142
  }
2142
- class Ie extends b {
2143
+ class ze extends b {
2143
2144
  _parse(e) {
2144
2145
  const { status: t, ctx: i } = this._processInputParams(e), s = (n, r) => {
2145
- if (mt(n) || mt(r))
2146
+ if (pt(n) || pt(r))
2146
2147
  return x;
2147
- const o = tt(n.value, r.value);
2148
- return o.valid ? ((gt(n) || gt(r)) && t.dirty(), { status: t.value, value: o.data }) : (d(i, {
2148
+ const o = et(n.value, r.value);
2149
+ return o.valid ? ((mt(n) || mt(r)) && t.dirty(), { status: t.value, value: o.data }) : (d(i, {
2149
2150
  code: u.invalid_intersection_types
2150
2151
  }), x);
2151
2152
  };
@@ -2171,13 +2172,13 @@ class Ie extends b {
2171
2172
  }));
2172
2173
  }
2173
2174
  }
2174
- Ie.create = (a, e, t) => new Ie({
2175
+ ze.create = (a, e, t) => new ze({
2175
2176
  left: a,
2176
2177
  right: e,
2177
2178
  typeName: v.ZodIntersection,
2178
2179
  ..._(t)
2179
2180
  });
2180
- class X extends b {
2181
+ class W extends b {
2181
2182
  _parse(e) {
2182
2183
  const { status: t, ctx: i } = this._processInputParams(e);
2183
2184
  if (i.parsedType !== f.array)
@@ -2205,29 +2206,29 @@ class X extends b {
2205
2206
  const h = this._def.items[o] || this._def.rest;
2206
2207
  return h ? h._parse(new K(i, r, i.path, o)) : null;
2207
2208
  }).filter((r) => !!r);
2208
- return i.common.async ? Promise.all(n).then((r) => L.mergeArray(t, r)) : L.mergeArray(t, n);
2209
+ return i.common.async ? Promise.all(n).then((r) => I.mergeArray(t, r)) : I.mergeArray(t, n);
2209
2210
  }
2210
2211
  get items() {
2211
2212
  return this._def.items;
2212
2213
  }
2213
2214
  rest(e) {
2214
- return new X({
2215
+ return new W({
2215
2216
  ...this._def,
2216
2217
  rest: e
2217
2218
  });
2218
2219
  }
2219
2220
  }
2220
- X.create = (a, e) => {
2221
+ W.create = (a, e) => {
2221
2222
  if (!Array.isArray(a))
2222
2223
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2223
- return new X({
2224
+ return new W({
2224
2225
  items: a,
2225
2226
  typeName: v.ZodTuple,
2226
2227
  rest: null,
2227
2228
  ..._(e)
2228
2229
  });
2229
2230
  };
2230
- class Le extends b {
2231
+ class Ie extends b {
2231
2232
  get keySchema() {
2232
2233
  return this._def.keyType;
2233
2234
  }
@@ -2249,26 +2250,26 @@ class Le extends b {
2249
2250
  value: r._parse(new K(i, i.data[o], i.path, o)),
2250
2251
  alwaysSet: o in i.data
2251
2252
  });
2252
- return i.common.async ? L.mergeObjectAsync(t, s) : L.mergeObjectSync(t, s);
2253
+ return i.common.async ? I.mergeObjectAsync(t, s) : I.mergeObjectSync(t, s);
2253
2254
  }
2254
2255
  get element() {
2255
2256
  return this._def.valueType;
2256
2257
  }
2257
2258
  static create(e, t, i) {
2258
- return t instanceof b ? new Le({
2259
+ return t instanceof b ? new Ie({
2259
2260
  keyType: e,
2260
2261
  valueType: t,
2261
2262
  typeName: v.ZodRecord,
2262
2263
  ..._(i)
2263
- }) : new Le({
2264
- keyType: U.create(),
2264
+ }) : new Ie({
2265
+ keyType: j.create(),
2265
2266
  valueType: e,
2266
2267
  typeName: v.ZodRecord,
2267
2268
  ..._(t)
2268
2269
  });
2269
2270
  }
2270
2271
  }
2271
- class it extends b {
2272
+ class tt extends b {
2272
2273
  get keySchema() {
2273
2274
  return this._def.keyType;
2274
2275
  }
@@ -2310,13 +2311,13 @@ class it extends b {
2310
2311
  }
2311
2312
  }
2312
2313
  }
2313
- it.create = (a, e, t) => new it({
2314
+ tt.create = (a, e, t) => new tt({
2314
2315
  valueType: e,
2315
2316
  keyType: a,
2316
2317
  typeName: v.ZodMap,
2317
2318
  ..._(t)
2318
2319
  });
2319
- class ye extends b {
2320
+ class ge extends b {
2320
2321
  _parse(e) {
2321
2322
  const { status: t, ctx: i } = this._processInputParams(e);
2322
2323
  if (i.parsedType !== f.set)
@@ -2355,13 +2356,13 @@ class ye extends b {
2355
2356
  return i.common.async ? Promise.all(o).then((h) => r(h)) : r(o);
2356
2357
  }
2357
2358
  min(e, t) {
2358
- return new ye({
2359
+ return new ge({
2359
2360
  ...this._def,
2360
2361
  minSize: { value: e, message: m.toString(t) }
2361
2362
  });
2362
2363
  }
2363
2364
  max(e, t) {
2364
- return new ye({
2365
+ return new ge({
2365
2366
  ...this._def,
2366
2367
  maxSize: { value: e, message: m.toString(t) }
2367
2368
  });
@@ -2373,14 +2374,14 @@ class ye extends b {
2373
2374
  return this.min(1, e);
2374
2375
  }
2375
2376
  }
2376
- ye.create = (a, e) => new ye({
2377
+ ge.create = (a, e) => new ge({
2377
2378
  valueType: a,
2378
2379
  minSize: null,
2379
2380
  maxSize: null,
2380
2381
  typeName: v.ZodSet,
2381
2382
  ..._(e)
2382
2383
  });
2383
- class _e extends b {
2384
+ class we extends b {
2384
2385
  constructor() {
2385
2386
  super(...arguments), this.validate = this.implement;
2386
2387
  }
@@ -2393,14 +2394,14 @@ class _e extends b {
2393
2394
  received: t.parsedType
2394
2395
  }), x;
2395
2396
  function i(o, h) {
2396
- return Ge({
2397
+ return Xe({
2397
2398
  data: o,
2398
2399
  path: t.path,
2399
2400
  errorMaps: [
2400
2401
  t.common.contextualErrorMap,
2401
2402
  t.schemaErrorMap,
2402
2403
  Ye(),
2403
- be
2404
+ ke
2404
2405
  ].filter((c) => !!c),
2405
2406
  issueData: {
2406
2407
  code: u.invalid_arguments,
@@ -2409,14 +2410,14 @@ class _e extends b {
2409
2410
  });
2410
2411
  }
2411
2412
  function s(o, h) {
2412
- return Ge({
2413
+ return Xe({
2413
2414
  data: o,
2414
2415
  path: t.path,
2415
2416
  errorMaps: [
2416
2417
  t.common.contextualErrorMap,
2417
2418
  t.schemaErrorMap,
2418
2419
  Ye(),
2419
- be
2420
+ ke
2420
2421
  ].filter((c) => !!c),
2421
2422
  issueData: {
2422
2423
  code: u.invalid_return_type,
@@ -2425,10 +2426,10 @@ class _e extends b {
2425
2426
  });
2426
2427
  }
2427
2428
  const n = { errorMap: t.common.contextualErrorMap }, r = t.data;
2428
- if (this._def.returns instanceof Se) {
2429
+ if (this._def.returns instanceof Ce) {
2429
2430
  const o = this;
2430
- return N(async function(...h) {
2431
- const c = new M([]), l = await o._def.args.parseAsync(h, n).catch((k) => {
2431
+ return M(async function(...h) {
2432
+ const c = new F([]), l = await o._def.args.parseAsync(h, n).catch((k) => {
2432
2433
  throw c.addIssue(i(h, k)), c;
2433
2434
  }), g = await Reflect.apply(r, this, l);
2434
2435
  return await o._def.returns._def.type.parseAsync(g, n).catch((k) => {
@@ -2437,13 +2438,13 @@ class _e extends b {
2437
2438
  });
2438
2439
  } else {
2439
2440
  const o = this;
2440
- return N(function(...h) {
2441
+ return M(function(...h) {
2441
2442
  const c = o._def.args.safeParse(h, n);
2442
2443
  if (!c.success)
2443
- throw new M([i(h, c.error)]);
2444
+ throw new F([i(h, c.error)]);
2444
2445
  const l = Reflect.apply(r, this, c.data), g = o._def.returns.safeParse(l, n);
2445
2446
  if (!g.success)
2446
- throw new M([s(l, g.error)]);
2447
+ throw new F([s(l, g.error)]);
2447
2448
  return g.data;
2448
2449
  });
2449
2450
  }
@@ -2455,13 +2456,13 @@ class _e extends b {
2455
2456
  return this._def.returns;
2456
2457
  }
2457
2458
  args(...e) {
2458
- return new _e({
2459
+ return new we({
2459
2460
  ...this._def,
2460
- args: X.create(e).rest(de.create())
2461
+ args: W.create(e).rest(ue.create())
2461
2462
  });
2462
2463
  }
2463
2464
  returns(e) {
2464
- return new _e({
2465
+ return new we({
2465
2466
  ...this._def,
2466
2467
  returns: e
2467
2468
  });
@@ -2473,15 +2474,15 @@ class _e extends b {
2473
2474
  return this.parse(e);
2474
2475
  }
2475
2476
  static create(e, t, i) {
2476
- return new _e({
2477
- args: e || X.create([]).rest(de.create()),
2478
- returns: t || de.create(),
2477
+ return new we({
2478
+ args: e || W.create([]).rest(ue.create()),
2479
+ returns: t || ue.create(),
2479
2480
  typeName: v.ZodFunction,
2480
2481
  ..._(i)
2481
2482
  });
2482
2483
  }
2483
2484
  }
2484
- class ze extends b {
2485
+ class Le extends b {
2485
2486
  get schema() {
2486
2487
  return this._def.getter();
2487
2488
  }
@@ -2490,12 +2491,12 @@ class ze extends b {
2490
2491
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2491
2492
  }
2492
2493
  }
2493
- ze.create = (a, e) => new ze({
2494
+ Le.create = (a, e) => new Le({
2494
2495
  getter: a,
2495
2496
  typeName: v.ZodLazy,
2496
2497
  ..._(e)
2497
2498
  });
2498
- class De extends b {
2499
+ class Ee extends b {
2499
2500
  _parse(e) {
2500
2501
  if (e.data !== this._def.value) {
2501
2502
  const t = this._getOrReturnCtx(e);
@@ -2511,21 +2512,21 @@ class De extends b {
2511
2512
  return this._def.value;
2512
2513
  }
2513
2514
  }
2514
- De.create = (a, e) => new De({
2515
+ Ee.create = (a, e) => new Ee({
2515
2516
  value: a,
2516
2517
  typeName: v.ZodLiteral,
2517
2518
  ..._(e)
2518
2519
  });
2519
- function zt(a, e) {
2520
- return new se({
2520
+ function It(a, e) {
2521
+ return new ie({
2521
2522
  values: a,
2522
2523
  typeName: v.ZodEnum,
2523
2524
  ..._(e)
2524
2525
  });
2525
2526
  }
2526
- class se extends b {
2527
+ class ie extends b {
2527
2528
  constructor() {
2528
- super(...arguments), xe.set(this, void 0);
2529
+ super(...arguments), ve.set(this, void 0);
2529
2530
  }
2530
2531
  _parse(e) {
2531
2532
  if (typeof e.data != "string") {
@@ -2536,7 +2537,7 @@ class se extends b {
2536
2537
  code: u.invalid_type
2537
2538
  }), x;
2538
2539
  }
2539
- if (Ae(this, xe) || Pt(this, xe, new Set(this._def.values)), !Ae(this, xe).has(e.data)) {
2540
+ if (Oe(this, ve) || Pt(this, ve, new Set(this._def.values)), !Oe(this, ve).has(e.data)) {
2540
2541
  const t = this._getOrReturnCtx(e), i = this._def.values;
2541
2542
  return d(t, {
2542
2543
  received: t.data,
@@ -2544,7 +2545,7 @@ class se extends b {
2544
2545
  options: i
2545
2546
  }), x;
2546
2547
  }
2547
- return N(e.data);
2548
+ return M(e.data);
2548
2549
  }
2549
2550
  get options() {
2550
2551
  return this._def.values;
@@ -2568,23 +2569,23 @@ class se extends b {
2568
2569
  return e;
2569
2570
  }
2570
2571
  extract(e, t = this._def) {
2571
- return se.create(e, {
2572
+ return ie.create(e, {
2572
2573
  ...this._def,
2573
2574
  ...t
2574
2575
  });
2575
2576
  }
2576
2577
  exclude(e, t = this._def) {
2577
- return se.create(this.options.filter((i) => !e.includes(i)), {
2578
+ return ie.create(this.options.filter((i) => !e.includes(i)), {
2578
2579
  ...this._def,
2579
2580
  ...t
2580
2581
  });
2581
2582
  }
2582
2583
  }
2583
- xe = /* @__PURE__ */ new WeakMap();
2584
- se.create = zt;
2585
- class Ne extends b {
2584
+ ve = /* @__PURE__ */ new WeakMap();
2585
+ ie.create = It;
2586
+ class Me extends b {
2586
2587
  constructor() {
2587
- super(...arguments), we.set(this, void 0);
2588
+ super(...arguments), xe.set(this, void 0);
2588
2589
  }
2589
2590
  _parse(e) {
2590
2591
  const t = C.getValidEnumValues(this._def.values), i = this._getOrReturnCtx(e);
@@ -2596,7 +2597,7 @@ class Ne extends b {
2596
2597
  code: u.invalid_type
2597
2598
  }), x;
2598
2599
  }
2599
- if (Ae(this, we) || Pt(this, we, new Set(C.getValidEnumValues(this._def.values))), !Ae(this, we).has(e.data)) {
2600
+ if (Oe(this, xe) || Pt(this, xe, new Set(C.getValidEnumValues(this._def.values))), !Oe(this, xe).has(e.data)) {
2600
2601
  const s = C.objectValues(t);
2601
2602
  return d(i, {
2602
2603
  received: i.data,
@@ -2604,19 +2605,19 @@ class Ne extends b {
2604
2605
  options: s
2605
2606
  }), x;
2606
2607
  }
2607
- return N(e.data);
2608
+ return M(e.data);
2608
2609
  }
2609
2610
  get enum() {
2610
2611
  return this._def.values;
2611
2612
  }
2612
2613
  }
2613
- we = /* @__PURE__ */ new WeakMap();
2614
- Ne.create = (a, e) => new Ne({
2614
+ xe = /* @__PURE__ */ new WeakMap();
2615
+ Me.create = (a, e) => new Me({
2615
2616
  values: a,
2616
2617
  typeName: v.ZodNativeEnum,
2617
2618
  ..._(e)
2618
2619
  });
2619
- class Se extends b {
2620
+ class Ce extends b {
2620
2621
  unwrap() {
2621
2622
  return this._def.type;
2622
2623
  }
@@ -2629,13 +2630,13 @@ class Se extends b {
2629
2630
  received: t.parsedType
2630
2631
  }), x;
2631
2632
  const i = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
2632
- return N(i.then((s) => this._def.type.parseAsync(s, {
2633
+ return M(i.then((s) => this._def.type.parseAsync(s, {
2633
2634
  path: t.path,
2634
2635
  errorMap: t.common.contextualErrorMap
2635
2636
  })));
2636
2637
  }
2637
2638
  }
2638
- Se.create = (a, e) => new Se({
2639
+ Ce.create = (a, e) => new Ce({
2639
2640
  type: a,
2640
2641
  typeName: v.ZodPromise,
2641
2642
  ..._(e)
@@ -2667,7 +2668,7 @@ class Y extends b {
2667
2668
  path: i.path,
2668
2669
  parent: i
2669
2670
  });
2670
- return h.status === "aborted" ? x : h.status === "dirty" || t.value === "dirty" ? ve(h.value) : h;
2671
+ return h.status === "aborted" ? x : h.status === "dirty" || t.value === "dirty" ? ye(h.value) : h;
2671
2672
  });
2672
2673
  {
2673
2674
  if (t.value === "aborted")
@@ -2677,7 +2678,7 @@ class Y extends b {
2677
2678
  path: i.path,
2678
2679
  parent: i
2679
2680
  });
2680
- return o.status === "aborted" ? x : o.status === "dirty" || t.value === "dirty" ? ve(o.value) : o;
2681
+ return o.status === "aborted" ? x : o.status === "dirty" || t.value === "dirty" ? ye(o.value) : o;
2681
2682
  }
2682
2683
  }
2683
2684
  if (s.type === "refinement") {
@@ -2706,14 +2707,14 @@ class Y extends b {
2706
2707
  path: i.path,
2707
2708
  parent: i
2708
2709
  });
2709
- if (!pe(r))
2710
+ if (!fe(r))
2710
2711
  return r;
2711
2712
  const o = s.transform(r.value, n);
2712
2713
  if (o instanceof Promise)
2713
2714
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2714
2715
  return { status: t.value, value: o };
2715
2716
  } else
2716
- return this._def.schema._parseAsync({ data: i.data, path: i.path, parent: i }).then((r) => pe(r) ? Promise.resolve(s.transform(r.value, n)).then((o) => ({ status: t.value, value: o })) : r);
2717
+ return this._def.schema._parseAsync({ data: i.data, path: i.path, parent: i }).then((r) => fe(r) ? Promise.resolve(s.transform(r.value, n)).then((o) => ({ status: t.value, value: o })) : r);
2717
2718
  C.assertNever(s);
2718
2719
  }
2719
2720
  }
@@ -2729,33 +2730,33 @@ Y.createWithPreprocess = (a, e, t) => new Y({
2729
2730
  typeName: v.ZodEffects,
2730
2731
  ..._(t)
2731
2732
  });
2732
- class W extends b {
2733
+ class U extends b {
2733
2734
  _parse(e) {
2734
- return this._getType(e) === f.undefined ? N(void 0) : this._def.innerType._parse(e);
2735
+ return this._getType(e) === f.undefined ? M(void 0) : this._def.innerType._parse(e);
2735
2736
  }
2736
2737
  unwrap() {
2737
2738
  return this._def.innerType;
2738
2739
  }
2739
2740
  }
2740
- W.create = (a, e) => new W({
2741
+ U.create = (a, e) => new U({
2741
2742
  innerType: a,
2742
2743
  typeName: v.ZodOptional,
2743
2744
  ..._(e)
2744
2745
  });
2745
- class ne extends b {
2746
+ class se extends b {
2746
2747
  _parse(e) {
2747
- return this._getType(e) === f.null ? N(null) : this._def.innerType._parse(e);
2748
+ return this._getType(e) === f.null ? M(null) : this._def.innerType._parse(e);
2748
2749
  }
2749
2750
  unwrap() {
2750
2751
  return this._def.innerType;
2751
2752
  }
2752
2753
  }
2753
- ne.create = (a, e) => new ne({
2754
+ se.create = (a, e) => new se({
2754
2755
  innerType: a,
2755
2756
  typeName: v.ZodNullable,
2756
2757
  ..._(e)
2757
2758
  });
2758
- class Me extends b {
2759
+ class Fe extends b {
2759
2760
  _parse(e) {
2760
2761
  const { ctx: t } = this._processInputParams(e);
2761
2762
  let i = t.data;
@@ -2769,13 +2770,13 @@ class Me extends b {
2769
2770
  return this._def.innerType;
2770
2771
  }
2771
2772
  }
2772
- Me.create = (a, e) => new Me({
2773
+ Fe.create = (a, e) => new Fe({
2773
2774
  innerType: a,
2774
2775
  typeName: v.ZodDefault,
2775
2776
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2776
2777
  ..._(e)
2777
2778
  });
2778
- class Fe extends b {
2779
+ class Ne extends b {
2779
2780
  _parse(e) {
2780
2781
  const { ctx: t } = this._processInputParams(e), i = {
2781
2782
  ...t,
@@ -2794,7 +2795,7 @@ class Fe extends b {
2794
2795
  status: "valid",
2795
2796
  value: n.status === "valid" ? n.value : this._def.catchValue({
2796
2797
  get error() {
2797
- return new M(i.common.issues);
2798
+ return new F(i.common.issues);
2798
2799
  },
2799
2800
  input: i.data
2800
2801
  })
@@ -2802,7 +2803,7 @@ class Fe extends b {
2802
2803
  status: "valid",
2803
2804
  value: s.status === "valid" ? s.value : this._def.catchValue({
2804
2805
  get error() {
2805
- return new M(i.common.issues);
2806
+ return new F(i.common.issues);
2806
2807
  },
2807
2808
  input: i.data
2808
2809
  })
@@ -2812,13 +2813,13 @@ class Fe extends b {
2812
2813
  return this._def.innerType;
2813
2814
  }
2814
2815
  }
2815
- Fe.create = (a, e) => new Fe({
2816
+ Ne.create = (a, e) => new Ne({
2816
2817
  innerType: a,
2817
2818
  typeName: v.ZodCatch,
2818
2819
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2819
2820
  ..._(e)
2820
2821
  });
2821
- class st extends b {
2822
+ class it extends b {
2822
2823
  _parse(e) {
2823
2824
  if (this._getType(e) !== f.nan) {
2824
2825
  const i = this._getOrReturnCtx(e);
@@ -2831,11 +2832,11 @@ class st extends b {
2831
2832
  return { status: "valid", value: e.data };
2832
2833
  }
2833
2834
  }
2834
- st.create = (a) => new st({
2835
+ it.create = (a) => new it({
2835
2836
  typeName: v.ZodNaN,
2836
2837
  ..._(a)
2837
2838
  });
2838
- class Dt extends b {
2839
+ class Lt extends b {
2839
2840
  _parse(e) {
2840
2841
  const { ctx: t } = this._processInputParams(e), i = t.data;
2841
2842
  return this._def.type._parse({
@@ -2858,7 +2859,7 @@ class Ke extends b {
2858
2859
  path: i.path,
2859
2860
  parent: i
2860
2861
  });
2861
- return n.status === "aborted" ? x : n.status === "dirty" ? (t.dirty(), ve(n.value)) : this._def.out._parseAsync({
2862
+ return n.status === "aborted" ? x : n.status === "dirty" ? (t.dirty(), ye(n.value)) : this._def.out._parseAsync({
2862
2863
  data: n.value,
2863
2864
  path: i.path,
2864
2865
  parent: i
@@ -2888,58 +2889,58 @@ class Ke extends b {
2888
2889
  });
2889
2890
  }
2890
2891
  }
2891
- class Ze extends b {
2892
+ class De extends b {
2892
2893
  _parse(e) {
2893
- const t = this._def.innerType._parse(e), i = (s) => (pe(s) && (s.value = Object.freeze(s.value)), s);
2894
+ const t = this._def.innerType._parse(e), i = (s) => (fe(s) && (s.value = Object.freeze(s.value)), s);
2894
2895
  return Te(t) ? t.then((s) => i(s)) : i(t);
2895
2896
  }
2896
2897
  unwrap() {
2897
2898
  return this._def.innerType;
2898
2899
  }
2899
2900
  }
2900
- Ze.create = (a, e) => new Ze({
2901
+ De.create = (a, e) => new De({
2901
2902
  innerType: a,
2902
2903
  typeName: v.ZodReadonly,
2903
2904
  ..._(e)
2904
2905
  });
2905
- E.lazycreate;
2906
+ P.lazycreate;
2906
2907
  var v;
2907
2908
  (function(a) {
2908
2909
  a.ZodString = "ZodString", a.ZodNumber = "ZodNumber", a.ZodNaN = "ZodNaN", a.ZodBigInt = "ZodBigInt", a.ZodBoolean = "ZodBoolean", a.ZodDate = "ZodDate", a.ZodSymbol = "ZodSymbol", a.ZodUndefined = "ZodUndefined", a.ZodNull = "ZodNull", a.ZodAny = "ZodAny", a.ZodUnknown = "ZodUnknown", a.ZodNever = "ZodNever", a.ZodVoid = "ZodVoid", a.ZodArray = "ZodArray", a.ZodObject = "ZodObject", a.ZodUnion = "ZodUnion", a.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", a.ZodIntersection = "ZodIntersection", a.ZodTuple = "ZodTuple", a.ZodRecord = "ZodRecord", a.ZodMap = "ZodMap", a.ZodSet = "ZodSet", a.ZodFunction = "ZodFunction", a.ZodLazy = "ZodLazy", a.ZodLiteral = "ZodLiteral", a.ZodEnum = "ZodEnum", a.ZodEffects = "ZodEffects", a.ZodNativeEnum = "ZodNativeEnum", a.ZodOptional = "ZodOptional", a.ZodNullable = "ZodNullable", a.ZodDefault = "ZodDefault", a.ZodCatch = "ZodCatch", a.ZodPromise = "ZodPromise", a.ZodBranded = "ZodBranded", a.ZodPipeline = "ZodPipeline", a.ZodReadonly = "ZodReadonly";
2909
2910
  })(v || (v = {}));
2910
- const z = U.create, y = me.create;
2911
- st.create;
2912
- ge.create;
2911
+ const L = j.create, y = pe.create;
2912
+ it.create;
2913
+ me.create;
2913
2914
  qe.create;
2914
- Ce.create;
2915
+ be.create;
2916
+ Ge.create;
2917
+ Ae.create;
2918
+ Pe.create;
2915
2919
  Qe.create;
2916
- Re.create;
2917
- Ee.create;
2920
+ ue.create;
2921
+ G.create;
2918
2922
  Je.create;
2919
- de.create;
2920
- Q.create;
2921
- et.create;
2922
- B.create;
2923
- const T = E.create;
2924
- E.strictCreate;
2925
- const vi = Pe.create;
2926
- at.create;
2923
+ Z.create;
2924
+ const O = P.create;
2925
+ P.strictCreate;
2926
+ const yi = Re.create;
2927
+ nt.create;
2928
+ ze.create;
2929
+ W.create;
2927
2930
  Ie.create;
2928
- X.create;
2931
+ tt.create;
2932
+ ge.create;
2933
+ we.create;
2929
2934
  Le.create;
2930
- it.create;
2931
- ye.create;
2932
- _e.create;
2933
- ze.create;
2934
- const ae = De.create, J = se.create;
2935
- Ne.create;
2936
- Se.create;
2935
+ const ne = Ee.create, Q = ie.create;
2936
+ Me.create;
2937
+ Ce.create;
2937
2938
  Y.create;
2938
- W.create;
2939
- ne.create;
2939
+ U.create;
2940
+ se.create;
2940
2941
  Y.createWithPreprocess;
2941
2942
  Ke.create;
2942
- const xi = J(["linear", "bezier", "constant"]), wi = J([
2943
+ const vi = Q(["linear", "bezier", "constant"]), xi = Q([
2943
2944
  "ease",
2944
2945
  "easeIn",
2945
2946
  "easeOut",
@@ -2968,159 +2969,159 @@ const xi = J(["linear", "bezier", "constant"]), wi = J([
2968
2969
  "easeInOutExpo",
2969
2970
  "easeInOutCirc",
2970
2971
  "easeInOutBack"
2971
- ]), re = T({
2972
+ ]), ae = O({
2972
2973
  from: y(),
2973
2974
  to: y(),
2974
2975
  start: y().min(0),
2975
2976
  length: y().positive(),
2976
- interpolation: xi.optional(),
2977
- easing: wi.optional()
2978
- }), _i = z().url("Invalid audio url format."), ki = re.extend({
2977
+ interpolation: vi.optional(),
2978
+ easing: xi.optional()
2979
+ }), wi = L().url("Invalid audio url format."), _i = ae.extend({
2979
2980
  from: y().min(0).max(1),
2980
2981
  to: y().min(0).max(1)
2981
- }).array().or(y().min(0).max(1)), vt = T({
2982
- type: ae("audio"),
2983
- src: _i,
2982
+ }).array().or(y().min(0).max(1)), yt = O({
2983
+ type: ne("audio"),
2984
+ src: wi,
2984
2985
  trim: y().optional(),
2985
- volume: ki.optional()
2986
- }), bi = J(["top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "topLeft", "center"]), xt = T({
2987
- type: ae("html"),
2988
- html: z(),
2989
- css: z(),
2986
+ volume: _i.optional()
2987
+ }), ki = Q(["top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "topLeft", "center"]), vt = O({
2988
+ type: ne("html"),
2989
+ html: L(),
2990
+ css: L(),
2990
2991
  width: y().positive().optional(),
2991
2992
  height: y().positive().optional(),
2992
- position: bi.optional()
2993
- }), Ci = z().url("Invalid image url format."), Si = T({
2993
+ position: ki.optional()
2994
+ }), bi = L().url("Invalid image url format."), Ci = O({
2994
2995
  top: y().min(0).optional(),
2995
2996
  right: y().min(0).optional(),
2996
2997
  bottom: y().min(0).optional(),
2997
2998
  left: y().min(0).optional()
2998
- }), wt = T({
2999
- type: ae("image"),
3000
- src: Ci,
3001
- crop: Si.optional()
3002
- }), Oi = z().url("Invalid luma url format."), _t = T({
3003
- type: ae("luma"),
3004
- src: Oi
3005
- }), Nt = z().regex(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})|transparent$/, "Invalid color format."), kt = T({
2999
+ }), xt = O({
3000
+ type: ne("image"),
3001
+ src: bi,
3002
+ crop: Ci.optional()
3003
+ }), Si = L().url("Invalid luma url format."), wt = O({
3004
+ type: ne("luma"),
3005
+ src: Si
3006
+ }), Et = L().regex(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})|transparent$/, "Invalid color format."), _t = O({
3006
3007
  width: y().positive(),
3007
3008
  height: y().positive()
3008
- }), bt = T({
3009
+ }), kt = O({
3009
3010
  radius: y().positive()
3010
- }), Ct = T({
3011
+ }), bt = O({
3011
3012
  length: y().positive(),
3012
3013
  thickness: y().positive()
3013
- }), Ti = T({
3014
- color: Nt,
3014
+ }), Ti = O({
3015
+ color: Et,
3015
3016
  opacity: y().min(0).max(1)
3016
- }), Ai = T({
3017
- color: Nt,
3017
+ }), Oi = O({
3018
+ color: Et,
3018
3019
  width: y().positive()
3019
- }), St = T({
3020
- type: ae("shape"),
3020
+ }), Ct = O({
3021
+ type: ne("shape"),
3021
3022
  width: y().positive().optional(),
3022
3023
  height: y().positive().optional(),
3023
- shape: J(["rectangle", "circle", "line"]),
3024
+ shape: Q(["rectangle", "circle", "line"]),
3024
3025
  fill: Ti.optional(),
3025
- stroke: Ai.optional(),
3026
- rectangle: kt.optional(),
3027
- circle: bt.optional(),
3028
- line: Ct.optional()
3029
- }).refine((a) => a.shape === "rectangle" ? kt.safeParse(a.rectangle) : a.shape === "circle" ? bt.safeParse(a.circle) : a.shape === "line" ? Ct.safeParse(a.line) : !1), rt = z().regex(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})|transparent$/, "Invalid color format."), Ri = T({
3030
- color: rt.optional(),
3031
- family: z().optional(),
3026
+ stroke: Oi.optional(),
3027
+ rectangle: _t.optional(),
3028
+ circle: kt.optional(),
3029
+ line: bt.optional()
3030
+ }).refine((a) => a.shape === "rectangle" ? _t.safeParse(a.rectangle) : a.shape === "circle" ? kt.safeParse(a.circle) : a.shape === "line" ? bt.safeParse(a.line) : !1), at = L().regex(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})|transparent$/, "Invalid color format."), Ai = O({
3031
+ color: at.optional(),
3032
+ family: L().optional(),
3032
3033
  size: y().positive().optional(),
3033
3034
  weight: y().optional(),
3034
3035
  lineHeight: y().optional()
3035
- }), Ei = T({
3036
- horizontal: J(["left", "center", "right"]).optional(),
3037
- vertical: J(["top", "center", "bottom"]).optional()
3038
- }), Pi = T({
3039
- color: rt,
3036
+ }), Pi = O({
3037
+ horizontal: Q(["left", "center", "right"]).optional(),
3038
+ vertical: Q(["top", "center", "bottom"]).optional()
3039
+ }), Ri = O({
3040
+ color: at,
3040
3041
  opacity: y().min(0).max(1)
3041
- }), Ii = T({
3042
+ }), zi = O({
3042
3043
  width: y().positive(),
3043
- color: rt
3044
- }), Ot = T({
3045
- type: ae("text"),
3046
- text: z(),
3044
+ color: at
3045
+ }), St = O({
3046
+ type: ne("text"),
3047
+ text: L(),
3047
3048
  width: y().positive().optional(),
3048
3049
  height: y().positive().optional(),
3049
- font: Ri.optional(),
3050
- alignment: Ei.optional(),
3051
- background: Pi.optional(),
3052
- stroke: Ii.optional()
3053
- }), Li = z().url("Invalid video url format."), zi = T({
3050
+ font: Ai.optional(),
3051
+ alignment: Pi.optional(),
3052
+ background: Ri.optional(),
3053
+ stroke: zi.optional()
3054
+ }), Ii = L().url("Invalid video url format."), Li = O({
3054
3055
  top: y().min(0).optional(),
3055
3056
  right: y().min(0).optional(),
3056
3057
  bottom: y().min(0).optional(),
3057
3058
  left: y().min(0).optional()
3058
- }), Di = re.extend({
3059
+ }), Ei = ae.extend({
3059
3060
  from: y().min(0).max(1),
3060
3061
  to: y().min(0).max(1)
3061
- }).array().or(y().min(0).max(1)), Tt = T({
3062
- type: ae("video"),
3063
- src: Li,
3062
+ }).array().or(y().min(0).max(1)), Tt = O({
3063
+ type: ne("video"),
3064
+ src: Ii,
3064
3065
  trim: y().optional(),
3065
- crop: zi.optional(),
3066
- volume: Di.optional()
3067
- }), Ni = vi([Ot, St, xt, wt, Tt, _t, vt]).refine((a) => a.type === "text" ? Ot.safeParse(a) : a.type === "shape" ? St.safeParse(a) : a.type === "html" ? xt.safeParse(a) : a.type === "image" ? wt.safeParse(a) : a.type === "video" ? Tt.safeParse(a) : a.type === "luma" ? _t.safeParse(a) : a.type === "audio" ? vt.safeParse(a) : !1), Mi = J(["topLeft", "top", "topRight", "left", "center", "right", "bottomLeft", "bottom", "bottomRight"]), Fi = J(["crop", "cover", "contain", "none"]), fe = y().min(-10).max(10).default(0), Zi = re.extend({
3068
- from: fe,
3069
- to: fe
3070
- }).array().or(fe), Bi = re.extend({
3071
- from: fe,
3072
- to: fe
3073
- }).array().or(fe), Ki = T({
3074
- x: Zi.default(0),
3075
- y: Bi.default(0)
3076
- }), Hi = re.extend({
3066
+ crop: Li.optional(),
3067
+ volume: Ei.optional()
3068
+ }), Mi = yi([St, Ct, vt, xt, Tt, wt, yt]).refine((a) => a.type === "text" ? St.safeParse(a) : a.type === "shape" ? Ct.safeParse(a) : a.type === "html" ? vt.safeParse(a) : a.type === "image" ? xt.safeParse(a) : a.type === "video" ? Tt.safeParse(a) : a.type === "luma" ? wt.safeParse(a) : a.type === "audio" ? yt.safeParse(a) : !1), Fi = Q(["topLeft", "top", "topRight", "left", "center", "right", "bottomLeft", "bottom", "bottomRight"]), Ni = Q(["crop", "cover", "contain", "none"]), de = y().min(-10).max(10).default(0), Di = ae.extend({
3069
+ from: de,
3070
+ to: de
3071
+ }).array().or(de), Zi = ae.extend({
3072
+ from: de,
3073
+ to: de
3074
+ }).array().or(de), Ki = O({
3075
+ x: Di.default(0),
3076
+ y: Zi.default(0)
3077
+ }), Hi = ae.extend({
3077
3078
  from: y().min(0).max(1),
3078
3079
  to: y().min(0).max(1)
3079
- }).array().or(y().min(0).max(1)), $i = re.extend({
3080
+ }).array().or(y().min(0).max(1)), Bi = ae.extend({
3080
3081
  from: y().min(0),
3081
3082
  to: y().min(0)
3082
- }).array().or(y().min(0)), ji = T({
3083
- angle: re.extend({
3083
+ }).array().or(y().min(0)), Vi = O({
3084
+ angle: ae.extend({
3084
3085
  from: y(),
3085
3086
  to: y()
3086
3087
  }).array().or(y())
3087
- }), Vi = z(), At = z(), Ui = T({
3088
- in: At.optional(),
3089
- out: At.optional()
3090
- }), Wi = T({
3091
- rotate: ji.default({ angle: 0 })
3092
- }), Mt = T({
3093
- asset: Ni,
3088
+ }), $i = L(), Ot = L(), ji = O({
3089
+ in: Ot.optional(),
3090
+ out: Ot.optional()
3091
+ }), Ui = O({
3092
+ rotate: Vi.default({ angle: 0 })
3093
+ }), Mt = O({
3094
+ asset: Mi,
3094
3095
  start: y().min(0),
3095
3096
  length: y().positive(),
3096
- position: Mi.default("center").optional(),
3097
- fit: Fi.default("crop").optional(),
3097
+ position: Fi.default("center").optional(),
3098
+ fit: Ni.default("crop").optional(),
3098
3099
  offset: Ki.default({ x: 0, y: 0 }).optional(),
3099
3100
  opacity: Hi.default(1).optional(),
3100
- scale: $i.default(1).optional(),
3101
- transform: Wi.default({ rotate: { angle: 0 } }).optional(),
3102
- effect: Vi.optional(),
3103
- transition: Ui.optional()
3104
- }), Xi = T({
3101
+ scale: Bi.default(1).optional(),
3102
+ transform: Ui.default({ rotate: { angle: 0 } }).optional(),
3103
+ effect: $i.optional(),
3104
+ transition: ji.optional()
3105
+ }), Wi = O({
3105
3106
  clips: Mt.array()
3106
- }), Yi = z().url("Invalid image url format."), Gi = T({
3107
+ }), Yi = L().url("Invalid image url format."), Xi = O({
3107
3108
  src: Yi
3108
- }), qi = T({
3109
- background: z().optional(),
3110
- fonts: Gi.array().optional(),
3111
- tracks: Xi.array()
3112
- }), Qi = T({
3113
- size: T({
3109
+ }), qi = O({
3110
+ background: L().optional(),
3111
+ fonts: Xi.array().optional(),
3112
+ tracks: Wi.array()
3113
+ }), Gi = O({
3114
+ size: O({
3114
3115
  width: y().positive(),
3115
3116
  height: y().positive()
3116
3117
  }),
3117
3118
  fps: y().positive().optional(),
3118
- format: z()
3119
- }), Ji = T({
3119
+ format: L()
3120
+ }), Qi = O({
3120
3121
  timeline: qi,
3121
- output: Qi
3122
+ output: Gi
3122
3123
  });
3123
- class es {
3124
+ class Ji {
3124
3125
  curves = {};
3125
3126
  constructor() {
3126
3127
  this.initializeCurves();
@@ -3242,16 +3243,16 @@ class es {
3242
3243
  };
3243
3244
  }
3244
3245
  getValue(e, t, i, s) {
3245
- const n = this.curves[s ?? ""] ?? this.curves.ease, [[r, o], [h, c]] = n, l = i + (3 * r - 3 * h + 1) * i * (1 - i), g = e, p = e + (t - e) * o, k = e + (t - e) * c, R = t, S = l, F = 1 - S;
3246
- return F ** 3 * g + 3 * F ** 2 * S * p + 3 * F * S ** 2 * k + S ** 3 * R;
3246
+ const n = this.curves[s ?? ""] ?? this.curves.ease, [[r, o], [h, c]] = n, l = i + (3 * r - 3 * h + 1) * i * (1 - i), g = e, p = e + (t - e) * o, k = e + (t - e) * c, A = t, S = l, N = 1 - S;
3247
+ return N ** 3 * g + 3 * N ** 2 * S * p + 3 * N * S ** 2 * k + S ** 3 * A;
3247
3248
  }
3248
3249
  }
3249
- class P {
3250
+ class R {
3250
3251
  property;
3251
3252
  length;
3252
3253
  cubicBuilder;
3253
3254
  constructor(e, t, i = 0) {
3254
- this.property = this.createKeyframes(e, t, i), this.length = t, this.cubicBuilder = new es();
3255
+ this.property = this.createKeyframes(e, t, i), this.length = t, this.cubicBuilder = new Ji();
3255
3256
  }
3256
3257
  getValue(e) {
3257
3258
  const t = this.property.find((s) => e >= s.start && e < s.start + s.length);
@@ -3350,7 +3351,7 @@ class He {
3350
3351
  e?.unload();
3351
3352
  }
3352
3353
  }
3353
- class ts {
3354
+ class es {
3354
3355
  clipConfiguration;
3355
3356
  constructor(e) {
3356
3357
  this.clipConfiguration = e;
@@ -3362,56 +3363,56 @@ class ts {
3362
3363
  const l = 0;
3363
3364
  switch (this.getPresetName()) {
3364
3365
  case "zoomIn": {
3365
- const p = this.getZoomSpeed(), k = 1 * this.clipConfiguration.scale, R = p * this.clipConfiguration.scale;
3366
- r.push({ from: k, to: R, start: l, length: c, interpolation: "linear" });
3366
+ const p = this.getZoomSpeed(), k = 1 * this.clipConfiguration.scale, A = p * this.clipConfiguration.scale;
3367
+ r.push({ from: k, to: A, start: l, length: c, interpolation: "linear" });
3367
3368
  break;
3368
3369
  }
3369
3370
  case "zoomOut": {
3370
- const k = this.getZoomSpeed() * this.clipConfiguration.scale, R = 1 * this.clipConfiguration.scale;
3371
- r.push({ from: k, to: R, start: l, length: c, interpolation: "linear" });
3371
+ const k = this.getZoomSpeed() * this.clipConfiguration.scale, A = 1 * this.clipConfiguration.scale;
3372
+ r.push({ from: k, to: A, start: l, length: c, interpolation: "linear" });
3372
3373
  break;
3373
3374
  }
3374
3375
  case "slideLeft": {
3375
3376
  let p = this.getSlideStart();
3376
- const k = e.width + e.width * p * 2, R = t.height / t.width * e.height;
3377
- if (R < k) {
3377
+ const k = e.width + e.width * p * 2, A = t.height / t.width * e.height;
3378
+ if (A < k) {
3378
3379
  const S = Math.abs(k / e.width);
3379
3380
  r.push({ from: S, to: S, start: l, length: c, interpolation: "linear" });
3380
3381
  } else
3381
- p = (R - e.width) / 2 / e.width;
3382
+ p = (A - e.width) / 2 / e.width;
3382
3383
  i.push({ from: p, to: -p, start: l, length: c });
3383
3384
  break;
3384
3385
  }
3385
3386
  case "slideRight": {
3386
3387
  let p = this.getSlideStart();
3387
- const k = e.width + e.width * p * 2, R = t.height / t.width * e.height;
3388
- if (R < k) {
3388
+ const k = e.width + e.width * p * 2, A = t.height / t.width * e.height;
3389
+ if (A < k) {
3389
3390
  const S = Math.abs(k / e.width);
3390
3391
  r.push({ from: S, to: S, start: l, length: c, interpolation: "linear" });
3391
3392
  } else
3392
- p = (R - e.width) / 2 / e.width;
3393
+ p = (A - e.width) / 2 / e.width;
3393
3394
  i.push({ from: -p, to: p, start: l, length: c });
3394
3395
  break;
3395
3396
  }
3396
3397
  case "slideUp": {
3397
3398
  let p = this.getSlideStart();
3398
- const k = e.height + e.height * p * 2, R = t.height / t.width * e.width;
3399
- if (R < k) {
3399
+ const k = e.height + e.height * p * 2, A = t.height / t.width * e.width;
3400
+ if (A < k) {
3400
3401
  const S = Math.abs(k / e.height);
3401
3402
  r.push({ from: S, to: S, start: l, length: c, interpolation: "linear" });
3402
3403
  } else
3403
- p = (R - e.height) / 2 / e.height;
3404
+ p = (A - e.height) / 2 / e.height;
3404
3405
  s.push({ from: p, to: -p, start: l, length: c });
3405
3406
  break;
3406
3407
  }
3407
3408
  case "slideDown": {
3408
3409
  let p = this.getSlideStart();
3409
- const k = e.height + e.height * p * 2, R = t.height / t.width * e.width;
3410
- if (R < k) {
3410
+ const k = e.height + e.height * p * 2, A = t.height / t.width * e.width;
3411
+ if (A < k) {
3411
3412
  const S = Math.abs(k / e.height);
3412
3413
  r.push({ from: S, to: S, start: l, length: c, interpolation: "linear" });
3413
3414
  } else
3414
- p = (R - e.height) / 2 / e.height;
3415
+ p = (A - e.height) / 2 / e.height;
3415
3416
  s.push({ from: -p, to: p, start: l, length: c });
3416
3417
  break;
3417
3418
  }
@@ -3449,7 +3450,7 @@ class ts {
3449
3450
  return 0;
3450
3451
  }
3451
3452
  }
3452
- class is {
3453
+ class ts {
3453
3454
  clipConfiguration;
3454
3455
  constructor(e) {
3455
3456
  this.clipConfiguration = e;
@@ -3603,11 +3604,11 @@ class is {
3603
3604
  }
3604
3605
  }
3605
3606
  }
3606
- class ss {
3607
+ class is {
3607
3608
  static ButtonLeftClick = 0;
3608
3609
  static ButtonRightClick = 3;
3609
3610
  }
3610
- class ns {
3611
+ class ss {
3611
3612
  containerSize;
3612
3613
  constructor(e) {
3613
3614
  this.containerSize = e;
@@ -3713,7 +3714,7 @@ class ns {
3713
3714
  }
3714
3715
  }
3715
3716
  }
3716
- class ot {
3717
+ class rt {
3717
3718
  container;
3718
3719
  constructor() {
3719
3720
  this.container = new w.Container();
@@ -3723,7 +3724,7 @@ class ot {
3723
3724
  return this.container;
3724
3725
  }
3725
3726
  }
3726
- class I extends ot {
3727
+ class z extends rt {
3727
3728
  static SnapThreshold = 20;
3728
3729
  static DiscardedFrameCount = Math.ceil(1 / 30 * 1e3);
3729
3730
  static ScaleHandleRadius = 10;
@@ -3758,15 +3759,15 @@ class I extends ot {
3758
3759
  rotationStart;
3759
3760
  rotationOffset;
3760
3761
  constructor(e, t) {
3761
- super(), this.edit = e, this.layer = 0, this.shouldDispose = !1, this.clipConfiguration = t, this.positionBuilder = new ns(e.size), this.outline = null, this.topLeftScaleHandle = null, this.topRightScaleHandle = null, this.bottomRightScaleHandle = null, this.bottomLeftScaleHandle = null, this.rotationHandle = null, this.isHovering = !1, this.isDragging = !1, this.dragOffset = { x: 0, y: 0 }, this.scaleDirection = null, this.scaleStart = null, this.scaleOffset = { x: 0, y: 0 }, this.isRotating = !1, this.rotationStart = null, this.rotationOffset = { x: 0, y: 0 };
3762
+ super(), this.edit = e, this.layer = 0, this.shouldDispose = !1, this.clipConfiguration = t, this.positionBuilder = new ss(e.size), this.outline = null, this.topLeftScaleHandle = null, this.topRightScaleHandle = null, this.bottomRightScaleHandle = null, this.bottomLeftScaleHandle = null, this.rotationHandle = null, this.isHovering = !1, this.isDragging = !1, this.dragOffset = { x: 0, y: 0 }, this.scaleDirection = null, this.scaleStart = null, this.scaleOffset = { x: 0, y: 0 }, this.isRotating = !1, this.rotationStart = null, this.rotationOffset = { x: 0, y: 0 };
3762
3763
  }
3763
3764
  configureKeyframes() {
3764
- if (this.offsetXKeyframeBuilder = new P(this.clipConfiguration.offset?.x ?? 0, this.getLength()), this.offsetYKeyframeBuilder = new P(this.clipConfiguration.offset?.y ?? 0, this.getLength()), this.scaleKeyframeBuilder = new P(this.clipConfiguration.scale ?? 1, this.getLength(), 1), this.opacityKeyframeBuilder = new P(this.clipConfiguration.opacity ?? 1, this.getLength(), 1), this.rotationKeyframeBuilder = new P(this.clipConfiguration.transform?.rotate?.angle ?? 0, this.getLength()), this.clipHasKeyframes())
3765
+ if (this.offsetXKeyframeBuilder = new R(this.clipConfiguration.offset?.x ?? 0, this.getLength()), this.offsetYKeyframeBuilder = new R(this.clipConfiguration.offset?.y ?? 0, this.getLength()), this.scaleKeyframeBuilder = new R(this.clipConfiguration.scale ?? 1, this.getLength(), 1), this.opacityKeyframeBuilder = new R(this.clipConfiguration.opacity ?? 1, this.getLength(), 1), this.rotationKeyframeBuilder = new R(this.clipConfiguration.transform?.rotate?.angle ?? 0, this.getLength()), this.clipHasKeyframes())
3765
3766
  return;
3766
- const e = [], t = [], i = [], s = [], n = [], r = new ts(this.clipConfiguration).build(this.edit.size, this.getSize());
3767
+ const e = [], t = [], i = [], s = [], n = [], r = new es(this.clipConfiguration).build(this.edit.size, this.getSize());
3767
3768
  e.push(...r.offsetXKeyframes), t.push(...r.offsetYKeyframes), i.push(...r.opacityKeyframes), s.push(...r.scaleKeyframes), n.push(...r.rotationKeyframes);
3768
- const o = new is(this.clipConfiguration).build();
3769
- e.push(...o.offsetXKeyframes), t.push(...o.offsetYKeyframes), i.push(...o.opacityKeyframes), s.push(...o.scaleKeyframes), n.push(...o.rotationKeyframes), e.length && (this.offsetXKeyframeBuilder = new P(e, this.getLength())), t.length && (this.offsetYKeyframeBuilder = new P(t, this.getLength())), i.length && (this.opacityKeyframeBuilder = new P(i, this.getLength(), 1)), s.length && (this.scaleKeyframeBuilder = new P(s, this.getLength(), 1)), n.length && (this.rotationKeyframeBuilder = new P(n, this.getLength()));
3769
+ const o = new ts(this.clipConfiguration).build();
3770
+ e.push(...o.offsetXKeyframes), t.push(...o.offsetYKeyframes), i.push(...o.opacityKeyframes), s.push(...o.scaleKeyframes), n.push(...o.rotationKeyframes), e.length && (this.offsetXKeyframeBuilder = new R(e, this.getLength())), t.length && (this.offsetYKeyframeBuilder = new R(t, this.getLength())), i.length && (this.opacityKeyframeBuilder = new R(i, this.getLength(), 1)), s.length && (this.scaleKeyframeBuilder = new R(s, this.getLength(), 1)), n.length && (this.rotationKeyframeBuilder = new R(n, this.getLength()));
3770
3771
  }
3771
3772
  async load() {
3772
3773
  this.outline = new w.Graphics(), this.getContainer().addChild(this.outline), this.topLeftScaleHandle = new w.Graphics(), this.topRightScaleHandle = new w.Graphics(), this.bottomRightScaleHandle = new w.Graphics(), this.bottomLeftScaleHandle = new w.Graphics(), this.getContainer().addChild(this.topLeftScaleHandle), this.getContainer().addChild(this.topRightScaleHandle), this.getContainer().addChild(this.bottomRightScaleHandle), this.getContainer().addChild(this.bottomLeftScaleHandle), this.rotationHandle = new w.Graphics(), this.getContainer().addChild(this.rotationHandle), this.getContainer().cursor = "pointer", this.getContainer().eventMode = "static", this.getContainer().on("pointerdown", this.onPointerStart.bind(this)), this.getContainer().on("pointermove", this.onPointerMove.bind(this)), this.getContainer().on("globalpointermove", this.onPointerMove.bind(this)), this.getContainer().on("pointerup", this.onPointerUp.bind(this)), this.getContainer().on("pointerupoutside", this.onPointerUp.bind(this)), this.getContainer().on("pointerover", this.onPointerOver.bind(this)), this.getContainer().on("pointerout", this.onPointerOut.bind(this));
@@ -3787,14 +3788,14 @@ class I extends ot {
3787
3788
  return;
3788
3789
  }
3789
3790
  const e = this.isHovering || this.isDragging ? 65535 : 16777215, t = this.getSize(), i = this.getScale();
3790
- if (this.outline.clear(), this.outline.strokeStyle = { width: I.OutlineWidth / i, color: e }, this.outline.rect(0, 0, t.width, t.height), this.outline.stroke(), !this.topLeftScaleHandle || !this.topRightScaleHandle || !this.bottomRightScaleHandle || !this.bottomLeftScaleHandle || !this.isActive() || this.edit.getSelectedClip() !== this)
3791
+ if (this.outline.clear(), this.outline.strokeStyle = { width: z.OutlineWidth / i, color: e }, this.outline.rect(0, 0, t.width, t.height), this.outline.stroke(), !this.topLeftScaleHandle || !this.topRightScaleHandle || !this.bottomRightScaleHandle || !this.bottomLeftScaleHandle || !this.isActive() || this.edit.getSelectedClip() !== this)
3791
3792
  return;
3792
3793
  this.topLeftScaleHandle.fillStyle = { color: e }, this.topLeftScaleHandle.clear();
3793
- const s = I.ScaleHandleRadius * 2 / i;
3794
+ const s = z.ScaleHandleRadius * 2 / i;
3794
3795
  if (this.topLeftScaleHandle.rect(-s / 2, -s / 2, s, s), this.topLeftScaleHandle.fill(), this.topRightScaleHandle.fillStyle = { color: e }, this.topRightScaleHandle.clear(), this.topRightScaleHandle.rect(t.width - s / 2, -s / 2, s, s), this.topRightScaleHandle.fill(), this.bottomRightScaleHandle.fillStyle = { color: e }, this.bottomRightScaleHandle.clear(), this.bottomRightScaleHandle.rect(t.width - s / 2, t.height - s / 2, s, s), this.bottomRightScaleHandle.fill(), this.bottomLeftScaleHandle.fillStyle = { color: e }, this.bottomLeftScaleHandle.clear(), this.bottomLeftScaleHandle.rect(-s / 2, t.height - s / 2, s, s), this.bottomLeftScaleHandle.fill(), !this.rotationHandle)
3795
3796
  return;
3796
3797
  const n = t.width / 2, r = -50 / i;
3797
- this.rotationHandle.clear(), this.rotationHandle.fillStyle = { color: e }, this.rotationHandle.circle(n, r, I.RotationHandleRadius / i), this.rotationHandle.fill(), this.outline.strokeStyle = { width: I.OutlineWidth / i, color: e }, this.outline.moveTo(n, 0), this.outline.lineTo(n, r), this.outline.stroke();
3798
+ this.rotationHandle.clear(), this.rotationHandle.fillStyle = { color: e }, this.rotationHandle.circle(n, r, z.RotationHandleRadius / i), this.rotationHandle.fill(), this.outline.strokeStyle = { width: z.OutlineWidth / i, color: e }, this.outline.moveTo(n, 0), this.outline.lineTo(n, r), this.outline.stroke();
3798
3799
  }
3799
3800
  dispose() {
3800
3801
  this.outline?.destroy(), this.outline = null, this.topLeftScaleHandle?.destroy(), this.topLeftScaleHandle = null, this.topRightScaleHandle?.destroy(), this.topRightScaleHandle = null, this.bottomLeftScaleHandle?.destroy(), this.bottomLeftScaleHandle = null, this.bottomRightScaleHandle?.destroy(), this.bottomRightScaleHandle = null, this.rotationHandle?.destroy(), this.rotationHandle = null;
@@ -3849,10 +3850,10 @@ class I extends ot {
3849
3850
  return this.edit.playbackTime >= this.getStart() && this.edit.playbackTime < this.getEnd();
3850
3851
  }
3851
3852
  shouldDiscardFrame() {
3852
- return this.getPlaybackTime() < I.DiscardedFrameCount;
3853
+ return this.getPlaybackTime() < z.DiscardedFrameCount;
3853
3854
  }
3854
3855
  onPointerStart(e) {
3855
- if (e.button !== ss.ButtonLeftClick || this.clipHasKeyframes())
3856
+ if (e.button !== is.ButtonLeftClick || this.clipHasKeyframes())
3856
3857
  return;
3857
3858
  if (this.scaleDirection = null, this.topLeftScaleHandle?.getBounds().containsPoint(e.globalX, e.globalY) && (this.scaleDirection = "topLeft"), this.topRightScaleHandle?.getBounds().containsPoint(e.globalX, e.globalY) && (this.scaleDirection = "topRight"), this.bottomRightScaleHandle?.getBounds().containsPoint(e.globalX, e.globalY) && (this.scaleDirection = "bottomRight"), this.bottomLeftScaleHandle?.getBounds().containsPoint(e.globalX, e.globalY) && (this.scaleDirection = "bottomLeft"), this.scaleDirection !== null) {
3858
3859
  this.scaleStart = this.getScale() / this.getFitScale();
@@ -3876,14 +3877,14 @@ class I extends ot {
3876
3877
  onPointerMove(e) {
3877
3878
  if (this.scaleDirection !== null && this.scaleStart !== null) {
3878
3879
  const t = e.getLocalPosition(this.edit.getContainer()), i = this.getPosition(), s = this.getPivot(), n = { x: i.x + s.x, y: i.y + s.y }, r = Math.sqrt((this.scaleOffset.x - n.x) ** 2 + (this.scaleOffset.y - n.y) ** 2), h = Math.sqrt((t.x - n.x) ** 2 + (t.y - n.y) ** 2) / r, c = this.scaleStart * h;
3879
- this.clipConfiguration.scale = Math.max(I.MinScale, Math.min(c, I.MaxScale)), this.scaleKeyframeBuilder = new P(this.clipConfiguration.scale, this.getLength(), 1);
3880
+ this.clipConfiguration.scale = Math.max(z.MinScale, Math.min(c, z.MaxScale)), this.scaleKeyframeBuilder = new R(this.clipConfiguration.scale, this.getLength(), 1);
3880
3881
  return;
3881
3882
  }
3882
3883
  if (this.isRotating && this.rotationStart !== null) {
3883
3884
  const t = e.getLocalPosition(this.edit.getContainer()), i = this.getPosition(), s = this.getPivot(), n = { x: i.x + s.x, y: i.y + s.y }, r = Math.atan2(this.rotationOffset.y - n.y, this.rotationOffset.x - n.x), h = (Math.atan2(t.y - n.y, t.x - n.x) - r) * (180 / Math.PI);
3884
3885
  let c = this.rotationStart + h;
3885
3886
  const l = 45, g = c % l, p = 2;
3886
- Math.abs(g) < p ? c = Math.floor(c / l) * l : Math.abs(g - l) < p && (c = Math.ceil(c / l) * l), this.clipConfiguration.transform || (this.clipConfiguration.transform = { rotate: { angle: 0 } }), this.clipConfiguration.transform.rotate || (this.clipConfiguration.transform.rotate = { angle: 0 }), this.clipConfiguration.transform.rotate.angle = c, this.rotationKeyframeBuilder = new P(this.clipConfiguration.transform.rotate.angle, this.getLength());
3887
+ Math.abs(g) < p ? c = Math.floor(c / l) * l : Math.abs(g - l) < p && (c = Math.ceil(c / l) * l), this.clipConfiguration.transform || (this.clipConfiguration.transform = { rotate: { angle: 0 } }), this.clipConfiguration.transform.rotate || (this.clipConfiguration.transform.rotate = { angle: 0 }), this.clipConfiguration.transform.rotate.angle = c, this.rotationKeyframeBuilder = new R(this.clipConfiguration.transform.rotate.angle, this.getLength());
3887
3888
  return;
3888
3889
  }
3889
3890
  if (this.isDragging) {
@@ -3898,21 +3899,21 @@ class I extends ot {
3898
3899
  { x: n.x, y: n.y + this.getSize().height },
3899
3900
  { x: n.x + this.getSize().width, y: n.y + this.getSize().height }
3900
3901
  ], l = { x: n.x + this.getSize().width / 2, y: n.y + this.getSize().height / 2 }, g = [...c, l];
3901
- let p = I.SnapThreshold, k = I.SnapThreshold, R = null, S = null;
3902
- for (const ee of g)
3903
- for (const oe of h) {
3904
- const H = Math.abs(ee.x - oe.x);
3905
- H < p && (p = H, R = n.x + (oe.x - ee.x));
3906
- const ce = Math.abs(ee.y - oe.y);
3907
- ce < k && (k = ce, S = n.y + (oe.y - ee.y));
3902
+ let p = z.SnapThreshold, k = z.SnapThreshold, A = null, S = null;
3903
+ for (const J of g)
3904
+ for (const re of h) {
3905
+ const H = Math.abs(J.x - re.x);
3906
+ H < p && (p = H, A = n.x + (re.x - J.x));
3907
+ const oe = Math.abs(J.y - re.y);
3908
+ oe < k && (k = oe, S = n.y + (re.y - J.y));
3908
3909
  }
3909
- R !== null && (n.x = R), S !== null && (n.y = S);
3910
- const F = this.positionBuilder.absoluteToRelative(
3910
+ A !== null && (n.x = A), S !== null && (n.y = S);
3911
+ const N = this.positionBuilder.absoluteToRelative(
3911
3912
  this.getSize(),
3912
3913
  this.clipConfiguration.position ?? "center",
3913
3914
  n
3914
3915
  );
3915
- this.clipConfiguration.offset || (this.clipConfiguration.offset = { x: 0, y: 0 }), this.clipConfiguration.offset.x = F.x, this.clipConfiguration.offset.y = F.y, this.offsetXKeyframeBuilder = new P(this.clipConfiguration.offset.x, this.getLength()), this.offsetYKeyframeBuilder = new P(this.clipConfiguration.offset.y, this.getLength());
3916
+ this.clipConfiguration.offset || (this.clipConfiguration.offset = { x: 0, y: 0 }), this.clipConfiguration.offset.x = N.x, this.clipConfiguration.offset.y = N.y, this.offsetXKeyframeBuilder = new R(this.clipConfiguration.offset.x, this.getLength()), this.offsetYKeyframeBuilder = new R(this.clipConfiguration.offset.y, this.getLength());
3916
3917
  }
3917
3918
  }
3918
3919
  onPointerUp() {
@@ -3936,7 +3937,7 @@ class I extends ot {
3936
3937
  ].some((e) => e && typeof e != "number");
3937
3938
  }
3938
3939
  }
3939
- class nt extends I {
3940
+ class st extends z {
3940
3941
  audioResource;
3941
3942
  isPlaying;
3942
3943
  volumeKeyframeBuilder;
@@ -3944,12 +3945,12 @@ class nt extends I {
3944
3945
  constructor(e, t) {
3945
3946
  super(e, t), this.audioResource = null, this.isPlaying = !1;
3946
3947
  const i = t.asset;
3947
- this.volumeKeyframeBuilder = new P(i.volume ?? 1, this.getLength()), this.syncTimer = 0;
3948
+ this.volumeKeyframeBuilder = new R(i.volume ?? 1, this.getLength()), this.syncTimer = 0;
3948
3949
  }
3949
3950
  async load() {
3950
3951
  await super.load();
3951
3952
  const e = this.clipConfiguration.asset, t = e.src, i = { src: t, loadParser: He.Name }, s = await this.edit.assetLoader.load(t, i);
3952
- if (!(s instanceof Ut.Howl))
3953
+ if (!(s instanceof $t.Howl))
3953
3954
  throw new Error(`Invalid audio source '${e.src}'.`);
3954
3955
  this.audioResource = s, this.configureKeyframes();
3955
3956
  }
@@ -3976,7 +3977,7 @@ class nt extends I {
3976
3977
  return this.volumeKeyframeBuilder.getValue(this.getPlaybackTime());
3977
3978
  }
3978
3979
  }
3979
- var as = `in vec2 aPosition;
3980
+ var ns = `in vec2 aPosition;
3980
3981
  out vec2 vTextureCoord;
3981
3982
 
3982
3983
  uniform vec4 uInputSize;
@@ -4003,7 +4004,7 @@ void main(void)
4003
4004
  gl_Position = filterVertexPosition();
4004
4005
  vTextureCoord = filterTextureCoord();
4005
4006
  }
4006
- `, rs = `struct GlobalFilterUniforms {
4007
+ `, as = `struct GlobalFilterUniforms {
4007
4008
  uInputSize:vec4<f32>,
4008
4009
  uInputPixel:vec4<f32>,
4009
4010
  uInputClamp:vec4<f32>,
@@ -4052,7 +4053,7 @@ fn mainVertex(
4052
4053
  filterVertexPosition(aPosition),
4053
4054
  filterTextureCoord(aPosition)
4054
4055
  );
4055
- }`, os = `precision highp float;
4056
+ }`, rs = `precision highp float;
4056
4057
  in vec2 vTextureCoord;
4057
4058
  out vec4 finalColor;
4058
4059
 
@@ -4093,7 +4094,7 @@ void main(void) {
4093
4094
  vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);
4094
4095
  finalColor = contentColor + outlineColor;
4095
4096
  }
4096
- `, cs = `struct OutlineUniforms {
4097
+ `, os = `struct OutlineUniforms {
4097
4098
  uThickness:vec2<f32>,
4098
4099
  uColor:vec3<f32>,
4099
4100
  uAlpha:f32,
@@ -4157,24 +4158,24 @@ fn outlineMaxAlphaAtPos(uv: vec2<f32>) -> f32 {
4157
4158
  return maxAlpha;
4158
4159
  }
4159
4160
 
4160
- const DOUBLE_PI: f32 = 3.14159265358979323846264 * 2.;`, ls = Object.defineProperty, hs = (a, e, t) => e in a ? ls(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t, ie = (a, e, t) => (hs(a, typeof e != "symbol" ? e + "" : e, t), t);
4161
- const $e = class te extends Kt {
4161
+ const DOUBLE_PI: f32 = 3.14159265358979323846264 * 2.;`, cs = Object.defineProperty, ls = (a, e, t) => e in a ? cs(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t, te = (a, e, t) => (ls(a, typeof e != "symbol" ? e + "" : e, t), t);
4162
+ const Be = class ee extends Zt {
4162
4163
  /** @ignore */
4163
4164
  constructor(...e) {
4164
4165
  let t = e[0] ?? {};
4165
- typeof t == "number" && (Ht("6.0.0", "OutlineFilter constructor params are now options object. See params: { thickness, color, quality, alpha, knockout }"), t = { thickness: t }, e[1] !== void 0 && (t.color = e[1]), e[2] !== void 0 && (t.quality = e[2]), e[3] !== void 0 && (t.alpha = e[3]), e[4] !== void 0 && (t.knockout = e[4])), t = { ...te.DEFAULT_OPTIONS, ...t };
4166
- const i = t.quality ?? 0.1, s = $t.from({
4166
+ typeof t == "number" && (Kt("6.0.0", "OutlineFilter constructor params are now options object. See params: { thickness, color, quality, alpha, knockout }"), t = { thickness: t }, e[1] !== void 0 && (t.color = e[1]), e[2] !== void 0 && (t.quality = e[2]), e[3] !== void 0 && (t.alpha = e[3]), e[4] !== void 0 && (t.knockout = e[4])), t = { ...ee.DEFAULT_OPTIONS, ...t };
4167
+ const i = t.quality ?? 0.1, s = Ht.from({
4167
4168
  vertex: {
4168
- source: rs,
4169
+ source: as,
4169
4170
  entryPoint: "mainVertex"
4170
4171
  },
4171
4172
  fragment: {
4172
- source: cs,
4173
+ source: os,
4173
4174
  entryPoint: "mainFragment"
4174
4175
  }
4175
- }), n = jt.from({
4176
- vertex: as,
4177
- fragment: os.replace(/\$\{ANGLE_STEP\}/, te.getAngleStep(i).toFixed(7)),
4176
+ }), n = Bt.from({
4177
+ vertex: ns,
4178
+ fragment: rs.replace(/\$\{ANGLE_STEP\}/, ee.getAngleStep(i).toFixed(7)),
4178
4179
  name: "outline-filter"
4179
4180
  });
4180
4181
  super({
@@ -4189,7 +4190,7 @@ const $e = class te extends Kt {
4189
4190
  uKnockout: { value: t.knockout ? 1 : 0, type: "f32" }
4190
4191
  }
4191
4192
  }
4192
- }), ie(this, "uniforms"), ie(this, "_thickness"), ie(this, "_quality"), ie(this, "_color"), this.uniforms = this.resources.outlineUniforms.uniforms, this.uniforms.uAngleStep = te.getAngleStep(i), this._color = new Vt(), this.color = t.color ?? 0, Object.assign(this, t);
4193
+ }), te(this, "uniforms"), te(this, "_thickness"), te(this, "_quality"), te(this, "_color"), this.uniforms = this.resources.outlineUniforms.uniforms, this.uniforms.uAngleStep = ee.getAngleStep(i), this._color = new Vt(), this.color = t.color ?? 0, Object.assign(this, t);
4193
4194
  }
4194
4195
  /**
4195
4196
  * Override existing apply method in `Filter`
@@ -4205,8 +4206,8 @@ const $e = class te extends Kt {
4205
4206
  */
4206
4207
  static getAngleStep(e) {
4207
4208
  return parseFloat((Math.PI * 2 / Math.max(
4208
- e * te.MAX_SAMPLES,
4209
- te.MIN_SAMPLES
4209
+ e * ee.MAX_SAMPLES,
4210
+ ee.MIN_SAMPLES
4210
4211
  )).toFixed(7));
4211
4212
  }
4212
4213
  /**
@@ -4251,7 +4252,7 @@ const $e = class te extends Kt {
4251
4252
  return this._quality;
4252
4253
  }
4253
4254
  set quality(e) {
4254
- this._quality = e, this.uniforms.uAngleStep = te.getAngleStep(e);
4255
+ this._quality = e, this.uniforms.uAngleStep = ee.getAngleStep(e);
4255
4256
  }
4256
4257
  /**
4257
4258
  * Whether to only render outline, not the contents.
@@ -4264,17 +4265,17 @@ const $e = class te extends Kt {
4264
4265
  this.uniforms.uKnockout = e ? 1 : 0;
4265
4266
  }
4266
4267
  };
4267
- ie($e, "DEFAULT_OPTIONS", {
4268
+ te(Be, "DEFAULT_OPTIONS", {
4268
4269
  thickness: 1,
4269
4270
  color: 0,
4270
4271
  alpha: 1,
4271
4272
  quality: 0.1,
4272
4273
  knockout: !1
4273
4274
  });
4274
- ie($e, "MIN_SAMPLES", 1);
4275
- ie($e, "MAX_SAMPLES", 100);
4276
- let ct = $e;
4277
- class us extends I {
4275
+ te(Be, "MIN_SAMPLES", 1);
4276
+ te(Be, "MAX_SAMPLES", 100);
4277
+ let ot = Be;
4278
+ class hs extends z {
4278
4279
  background;
4279
4280
  text;
4280
4281
  constructor(e, t) {
@@ -4308,7 +4309,7 @@ class us extends I {
4308
4309
  x: o,
4309
4310
  y: h
4310
4311
  }, t.stroke.color && t.stroke.width) {
4311
- const c = new ct({
4312
+ const c = new ot({
4312
4313
  thickness: t.stroke.width,
4313
4314
  color: t.stroke.color
4314
4315
  });
@@ -4383,7 +4384,7 @@ class us extends I {
4383
4384
  }
4384
4385
  }
4385
4386
  }
4386
- class ds extends I {
4387
+ class us extends z {
4387
4388
  texture;
4388
4389
  sprite;
4389
4390
  constructor(e, t) {
@@ -4420,7 +4421,7 @@ class ds extends I {
4420
4421
  return new w.Texture({ source: e.source, frame: k });
4421
4422
  }
4422
4423
  }
4423
- class fs extends I {
4424
+ class ds extends z {
4424
4425
  shape;
4425
4426
  shapeBackground;
4426
4427
  constructor(e, t) {
@@ -4455,7 +4456,7 @@ class fs extends I {
4455
4456
  color: e.fill?.color ?? "#ffffff",
4456
4457
  alpha: e.fill?.opacity ?? 1
4457
4458
  }, n.fill(), e.stroke) {
4458
- const r = new ct({
4459
+ const r = new ot({
4459
4460
  thickness: e.stroke.width,
4460
4461
  color: e.stroke.color
4461
4462
  });
@@ -4483,7 +4484,7 @@ class fs extends I {
4483
4484
  return 1;
4484
4485
  }
4485
4486
  }
4486
- class ps extends I {
4487
+ class fs extends z {
4487
4488
  background;
4488
4489
  text;
4489
4490
  constructor(e, t) {
@@ -4514,7 +4515,7 @@ class ps extends I {
4514
4515
  x: r,
4515
4516
  y: o
4516
4517
  }, e.stroke) {
4517
- const h = new ct({
4518
+ const h = new ot({
4518
4519
  thickness: e.stroke.width,
4519
4520
  color: e.stroke.color
4520
4521
  });
@@ -4542,7 +4543,7 @@ class ps extends I {
4542
4543
  return 1;
4543
4544
  }
4544
4545
  }
4545
- class ms extends I {
4546
+ class ps extends z {
4546
4547
  texture;
4547
4548
  sprite;
4548
4549
  isPlaying;
@@ -4551,7 +4552,7 @@ class ms extends I {
4551
4552
  constructor(e, t) {
4552
4553
  super(e, t), this.texture = null, this.sprite = null, this.isPlaying = !1;
4553
4554
  const i = this.clipConfiguration.asset;
4554
- this.volumeKeyframeBuilder = new P(i.volume ?? 1, this.getLength()), this.syncTimer = 0;
4555
+ this.volumeKeyframeBuilder = new R(i.volume ?? 1, this.getLength()), this.syncTimer = 0;
4555
4556
  }
4556
4557
  /**
4557
4558
  * TODO: Add support for .mov and .webm files
@@ -4596,7 +4597,7 @@ class ms extends I {
4596
4597
  return new w.Texture({ source: e.source, frame: k });
4597
4598
  }
4598
4599
  }
4599
- class he extends ot {
4600
+ class le extends rt {
4600
4601
  static ZIndexPadding = 100;
4601
4602
  assetLoader;
4602
4603
  events;
@@ -4615,7 +4616,7 @@ class he extends ot {
4615
4616
  /** @internal */
4616
4617
  selectedClip;
4617
4618
  constructor(e, t = "#ffffff") {
4618
- super(), this.assetLoader = new Xt(), this.edit = null, this.tracks = [], this.clipsToDispose = [], this.clips = [], this.events = new Et(), this.size = e, this.playbackTime = 0, this.totalDuration = 0, this.isPlaying = !1, this.selectedClip = null, this.backgroundColor = t;
4619
+ super(), this.assetLoader = new Wt(), this.edit = null, this.tracks = [], this.clipsToDispose = [], this.clips = [], this.events = new At(), this.size = e, this.playbackTime = 0, this.totalDuration = 0, this.isPlaying = !1, this.selectedClip = null, this.backgroundColor = t;
4619
4620
  }
4620
4621
  async load() {
4621
4622
  const e = new w.Graphics();
@@ -4651,9 +4652,9 @@ class he extends ot {
4651
4652
  this.seek(0);
4652
4653
  }
4653
4654
  async loadEdit(e) {
4654
- this.edit = Ji.parse(e), this.backgroundColor = this.edit.timeline.background || "#000000", await Promise.all(
4655
+ this.edit = Qi.parse(e), this.backgroundColor = this.edit.timeline.background || "#000000", await Promise.all(
4655
4656
  (this.edit.timeline.fonts ?? []).map(async (t) => {
4656
- const i = t.src, s = { src: i, loadParser: Be.Name };
4657
+ const i = t.src, s = { src: i, loadParser: Ze.Name };
4657
4658
  return this.assetLoader.load(i, s);
4658
4659
  })
4659
4660
  );
@@ -4697,13 +4698,13 @@ class he extends ot {
4697
4698
  this.tracks.splice(e, 0, []);
4698
4699
  const i = this.clips.map((s, n) => ({ clip: s, index: n })).filter(({ clip: s }) => s.layer >= e + 1);
4699
4700
  i.forEach(({ clip: s }) => {
4700
- const r = `shotstack-track-${1e5 - s.layer * he.ZIndexPadding}`;
4701
+ const r = `shotstack-track-${1e5 - s.layer * le.ZIndexPadding}`;
4701
4702
  this.getContainer().getChildByLabel(r, !1)?.removeChild(s.getContainer());
4702
4703
  });
4703
4704
  for (const { index: s } of i)
4704
4705
  this.clips[s].layer += 1;
4705
4706
  i.forEach(({ clip: s }) => {
4706
- const n = 1e5 - s.layer * he.ZIndexPadding, r = `shotstack-track-${n}`;
4707
+ const n = 1e5 - s.layer * le.ZIndexPadding, r = `shotstack-track-${n}`;
4707
4708
  let o = this.getContainer().getChildByLabel(r, !1);
4708
4709
  o || (o = new w.Container({
4709
4710
  label: r,
@@ -4724,13 +4725,13 @@ class he extends ot {
4724
4725
  this.disposeClips(), this.tracks.splice(e, 1);
4725
4726
  const i = this.clips.map((s, n) => ({ clip: s, index: n })).filter(({ clip: s }) => s.layer > e + 1);
4726
4727
  i.forEach(({ clip: s }) => {
4727
- const r = `shotstack-track-${1e5 - s.layer * he.ZIndexPadding}`;
4728
+ const r = `shotstack-track-${1e5 - s.layer * le.ZIndexPadding}`;
4728
4729
  this.getContainer().getChildByLabel(r, !1)?.removeChild(s.getContainer());
4729
4730
  });
4730
4731
  for (const { index: s } of i)
4731
4732
  this.clips[s].layer -= 1;
4732
4733
  i.forEach(({ clip: s }) => {
4733
- const n = 1e5 - s.layer * he.ZIndexPadding, r = `shotstack-track-${n}`;
4734
+ const n = 1e5 - s.layer * le.ZIndexPadding, r = `shotstack-track-${n}`;
4734
4735
  let o = this.getContainer().getChildByLabel(r, !1);
4735
4736
  o || (o = new w.Container({
4736
4737
  label: r,
@@ -4810,27 +4811,27 @@ class he extends ot {
4810
4811
  let t;
4811
4812
  switch (e.asset.type) {
4812
4813
  case "text": {
4813
- t = new ps(this, e);
4814
+ t = new fs(this, e);
4814
4815
  break;
4815
4816
  }
4816
4817
  case "shape": {
4817
- t = new fs(this, e);
4818
+ t = new ds(this, e);
4818
4819
  break;
4819
4820
  }
4820
4821
  case "html": {
4821
- t = new us(this, e);
4822
+ t = new hs(this, e);
4822
4823
  break;
4823
4824
  }
4824
4825
  case "image": {
4825
- t = new ds(this, e);
4826
+ t = new us(this, e);
4826
4827
  break;
4827
4828
  }
4828
4829
  case "video": {
4829
- t = new ms(this, e);
4830
+ t = new ps(this, e);
4830
4831
  break;
4831
4832
  }
4832
4833
  case "audio": {
4833
- t = new nt(this, e);
4834
+ t = new st(this, e);
4834
4835
  break;
4835
4836
  }
4836
4837
  default:
@@ -4842,12 +4843,12 @@ class he extends ot {
4842
4843
  for (; this.tracks.length <= e; )
4843
4844
  this.tracks.push([]);
4844
4845
  this.tracks[e].push(t), this.clips.push(t);
4845
- const i = 1e5 - (e + 1) * he.ZIndexPadding, s = `shotstack-track-${i}`;
4846
+ const i = 1e5 - (e + 1) * le.ZIndexPadding, s = `shotstack-track-${i}`;
4846
4847
  let n = this.getContainer().getChildByLabel(s, !1);
4847
4848
  n || (n = new w.Container({ label: s, zIndex: i }), this.getContainer().addChild(n)), n.addChild(t.getContainer()), await t.load(), this.updateTotalDuration();
4848
4849
  }
4849
4850
  }
4850
- class ke extends ot {
4851
+ class _e extends rt {
4851
4852
  static Width = 250;
4852
4853
  static Height = 100;
4853
4854
  fps;
@@ -4861,14 +4862,14 @@ class ke extends ot {
4861
4862
  }
4862
4863
  async load() {
4863
4864
  const e = new w.Graphics();
4864
- e.fillStyle = { color: "#424242", alpha: 0.5 }, e.rect(0, 0, ke.Width, ke.Height), e.fill(), this.getContainer().addChild(e), this.background = e;
4865
+ e.fillStyle = { color: "#424242", alpha: 0.5 }, e.rect(0, 0, _e.Width, _e.Height), e.fill(), this.getContainer().addChild(e), this.background = e;
4865
4866
  const t = new w.Text();
4866
4867
  t.text = "", t.style = {
4867
4868
  fontFamily: "monospace",
4868
4869
  fontSize: 14,
4869
4870
  fill: "#ffffff",
4870
4871
  wordWrap: !0,
4871
- wordWrapWidth: ke.Width
4872
+ wordWrapWidth: _e.Width
4872
4873
  }, this.getContainer().addChild(t), this.text = t;
4873
4874
  }
4874
4875
  update(e, t) {
@@ -4898,7 +4899,7 @@ class ke extends ot {
4898
4899
  return Math.round(e / 1024 / 1024);
4899
4900
  }
4900
4901
  }
4901
- class ue {
4902
+ class he {
4902
4903
  /** @internal */
4903
4904
  static CanvasSelector = "[data-shotstack-studio]";
4904
4905
  static extensionsRegistered = !1;
@@ -4913,12 +4914,12 @@ class ue {
4913
4914
  maxZoom = 4;
4914
4915
  currentZoom = 0.8;
4915
4916
  constructor(e, t) {
4916
- this.size = e, this.application = new w.Application(), this.edit = t, this.inspector = new ke();
4917
+ this.size = e, this.application = new w.Application(), this.edit = t, this.inspector = new _e();
4917
4918
  }
4918
4919
  async load() {
4919
- const e = document.querySelector(ue.CanvasSelector);
4920
+ const e = document.querySelector(he.CanvasSelector);
4920
4921
  if (!e)
4921
- throw new Error(`Shotstack canvas root element '${ue.CanvasSelector}' not found.`);
4922
+ throw new Error(`Shotstack canvas root element '${he.CanvasSelector}' not found.`);
4922
4923
  this.registerExtensions(), this.container = new w.Container(), this.background = new w.Graphics(), this.background.fillStyle = { color: "#424242" }, this.background.rect(0, 0, this.size.width, this.size.height), this.background.fill(), await this.configureApplication(), this.configureStage(), this.setupTouchHandling(e), this.edit.getContainer().scale = this.currentZoom, e.appendChild(this.application.canvas);
4923
4924
  }
4924
4925
  setupTouchHandling(e) {
@@ -4968,7 +4969,7 @@ class ue {
4968
4969
  t.scale.x = this.currentZoom, t.scale.y = this.currentZoom;
4969
4970
  }
4970
4971
  registerExtensions() {
4971
- ue.extensionsRegistered || (w.extensions.add(new He()), w.extensions.add(new Be()), ue.extensionsRegistered = !0);
4972
+ he.extensionsRegistered || (w.extensions.add(new He()), w.extensions.add(new Ze()), he.extensionsRegistered = !0);
4972
4973
  }
4973
4974
  async configureApplication() {
4974
4975
  const e = {
@@ -4995,11 +4996,11 @@ class ue {
4995
4996
  }
4996
4997
  /** @internal */
4997
4998
  dispose() {
4998
- const e = document.querySelector(ue.CanvasSelector);
4999
+ const e = document.querySelector(he.CanvasSelector);
4999
5000
  e && e.contains(this.application.canvas) && e.removeChild(this.application.canvas), this.application.ticker.remove(this.onTick, this), this.application.stage.off("click", this.onClick, this), this.background?.destroy(), this.container?.destroy(), this.inspector.dispose(), this.application.destroy(!0, { children: !0, texture: !0 });
5000
5001
  }
5001
5002
  }
5002
- class _s {
5003
+ class ys {
5003
5004
  edit;
5004
5005
  seekDistance = 50;
5005
5006
  seekDistanceLarge = 500;
@@ -5070,261 +5071,13 @@ class _s {
5070
5071
  }
5071
5072
  };
5072
5073
  }
5073
- var A;
5074
- (function(a) {
5075
- a.LOAD = "LOAD", a.EXEC = "EXEC", a.FFPROBE = "FFPROBE", a.WRITE_FILE = "WRITE_FILE", a.READ_FILE = "READ_FILE", a.DELETE_FILE = "DELETE_FILE", a.RENAME = "RENAME", a.CREATE_DIR = "CREATE_DIR", a.LIST_DIR = "LIST_DIR", a.DELETE_DIR = "DELETE_DIR", a.ERROR = "ERROR", a.DOWNLOAD = "DOWNLOAD", a.PROGRESS = "PROGRESS", a.LOG = "LOG", a.MOUNT = "MOUNT", a.UNMOUNT = "UNMOUNT";
5076
- })(A || (A = {}));
5077
- const gs = /* @__PURE__ */ (() => {
5078
- let a = 0;
5079
- return () => a++;
5080
- })(), ys = new Error("ffmpeg is not loaded, call `await ffmpeg.load()` first"), vs = new Error("called FFmpeg.terminate()");
5081
- class xs {
5082
- #t = null;
5083
- /**
5084
- * #resolves and #rejects tracks Promise resolves and rejects to
5085
- * be called when we receive message from web worker.
5086
- */
5087
- #s = {};
5088
- #i = {};
5089
- #n = [];
5090
- #a = [];
5091
- loaded = !1;
5092
- /**
5093
- * register worker message event handlers.
5094
- */
5095
- #r = () => {
5096
- this.#t && (this.#t.onmessage = ({ data: { id: e, type: t, data: i } }) => {
5097
- switch (t) {
5098
- case A.LOAD:
5099
- this.loaded = !0, this.#s[e](i);
5100
- break;
5101
- case A.MOUNT:
5102
- case A.UNMOUNT:
5103
- case A.EXEC:
5104
- case A.FFPROBE:
5105
- case A.WRITE_FILE:
5106
- case A.READ_FILE:
5107
- case A.DELETE_FILE:
5108
- case A.RENAME:
5109
- case A.CREATE_DIR:
5110
- case A.LIST_DIR:
5111
- case A.DELETE_DIR:
5112
- this.#s[e](i);
5113
- break;
5114
- case A.LOG:
5115
- this.#n.forEach((s) => s(i));
5116
- break;
5117
- case A.PROGRESS:
5118
- this.#a.forEach((s) => s(i));
5119
- break;
5120
- case A.ERROR:
5121
- this.#i[e](i);
5122
- break;
5123
- }
5124
- delete this.#s[e], delete this.#i[e];
5125
- });
5126
- };
5127
- /**
5128
- * Generic function to send messages to web worker.
5129
- */
5130
- #e = ({ type: e, data: t }, i = [], s) => this.#t ? new Promise((n, r) => {
5131
- const o = gs();
5132
- this.#t && this.#t.postMessage({ id: o, type: e, data: t }, i), this.#s[o] = n, this.#i[o] = r, s?.addEventListener("abort", () => {
5133
- r(new DOMException(`Message # ${o} was aborted`, "AbortError"));
5134
- }, { once: !0 });
5135
- }) : Promise.reject(ys);
5136
- on(e, t) {
5137
- e === "log" ? this.#n.push(t) : e === "progress" && this.#a.push(t);
5138
- }
5139
- off(e, t) {
5140
- e === "log" ? this.#n = this.#n.filter((i) => i !== t) : e === "progress" && (this.#a = this.#a.filter((i) => i !== t));
5141
- }
5142
- /**
5143
- * Loads ffmpeg-core inside web worker. It is required to call this method first
5144
- * as it initializes WebAssembly and other essential variables.
5145
- *
5146
- * @category FFmpeg
5147
- * @returns `true` if ffmpeg core is loaded for the first time.
5148
- */
5149
- load = ({ classWorkerURL: e, ...t } = {}, { signal: i } = {}) => (this.#t || (this.#t = e ? new Worker(new URL(e, import.meta.url), {
5150
- type: "module"
5151
- }) : (
5152
- // We need to duplicated the code here to enable webpack
5153
- // to bundle worekr.js here.
5154
- new Worker(new URL(
5155
- /* @vite-ignore */
5156
- "/assets/worker-BAOIWoxA.js",
5157
- import.meta.url
5158
- ), {
5159
- type: "module"
5160
- })
5161
- ), this.#r()), this.#e({
5162
- type: A.LOAD,
5163
- data: t
5164
- }, void 0, i));
5165
- /**
5166
- * Execute ffmpeg command.
5167
- *
5168
- * @remarks
5169
- * To avoid common I/O issues, ["-nostdin", "-y"] are prepended to the args
5170
- * by default.
5171
- *
5172
- * @example
5173
- * ```ts
5174
- * const ffmpeg = new FFmpeg();
5175
- * await ffmpeg.load();
5176
- * await ffmpeg.writeFile("video.avi", ...);
5177
- * // ffmpeg -i video.avi video.mp4
5178
- * await ffmpeg.exec(["-i", "video.avi", "video.mp4"]);
5179
- * const data = ffmpeg.readFile("video.mp4");
5180
- * ```
5181
- *
5182
- * @returns `0` if no error, `!= 0` if timeout (1) or error.
5183
- * @category FFmpeg
5184
- */
5185
- exec = (e, t = -1, { signal: i } = {}) => this.#e({
5186
- type: A.EXEC,
5187
- data: { args: e, timeout: t }
5188
- }, void 0, i);
5189
- /**
5190
- * Execute ffprobe command.
5191
- *
5192
- * @example
5193
- * ```ts
5194
- * const ffmpeg = new FFmpeg();
5195
- * await ffmpeg.load();
5196
- * await ffmpeg.writeFile("video.avi", ...);
5197
- * // Getting duration of a video in seconds: ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 video.avi -o output.txt
5198
- * await ffmpeg.ffprobe(["-v", "error", "-show_entries", "format=duration", "-of", "default=noprint_wrappers=1:nokey=1", "video.avi", "-o", "output.txt"]);
5199
- * const data = ffmpeg.readFile("output.txt");
5200
- * ```
5201
- *
5202
- * @returns `0` if no error, `!= 0` if timeout (1) or error.
5203
- * @category FFmpeg
5204
- */
5205
- ffprobe = (e, t = -1, { signal: i } = {}) => this.#e({
5206
- type: A.FFPROBE,
5207
- data: { args: e, timeout: t }
5208
- }, void 0, i);
5209
- /**
5210
- * Terminate all ongoing API calls and terminate web worker.
5211
- * `FFmpeg.load()` must be called again before calling any other APIs.
5212
- *
5213
- * @category FFmpeg
5214
- */
5215
- terminate = () => {
5216
- const e = Object.keys(this.#i);
5217
- for (const t of e)
5218
- this.#i[t](vs), delete this.#i[t], delete this.#s[t];
5219
- this.#t && (this.#t.terminate(), this.#t = null, this.loaded = !1);
5220
- };
5221
- /**
5222
- * Write data to ffmpeg.wasm.
5223
- *
5224
- * @example
5225
- * ```ts
5226
- * const ffmpeg = new FFmpeg();
5227
- * await ffmpeg.load();
5228
- * await ffmpeg.writeFile("video.avi", await fetchFile("../video.avi"));
5229
- * await ffmpeg.writeFile("text.txt", "hello world");
5230
- * ```
5231
- *
5232
- * @category File System
5233
- */
5234
- writeFile = (e, t, { signal: i } = {}) => {
5235
- const s = [];
5236
- return t instanceof Uint8Array && s.push(t.buffer), this.#e({
5237
- type: A.WRITE_FILE,
5238
- data: { path: e, data: t }
5239
- }, s, i);
5240
- };
5241
- mount = (e, t, i) => {
5242
- const s = [];
5243
- return this.#e({
5244
- type: A.MOUNT,
5245
- data: { fsType: e, options: t, mountPoint: i }
5246
- }, s);
5247
- };
5248
- unmount = (e) => {
5249
- const t = [];
5250
- return this.#e({
5251
- type: A.UNMOUNT,
5252
- data: { mountPoint: e }
5253
- }, t);
5254
- };
5255
- /**
5256
- * Read data from ffmpeg.wasm.
5257
- *
5258
- * @example
5259
- * ```ts
5260
- * const ffmpeg = new FFmpeg();
5261
- * await ffmpeg.load();
5262
- * const data = await ffmpeg.readFile("video.mp4");
5263
- * ```
5264
- *
5265
- * @category File System
5266
- */
5267
- readFile = (e, t = "binary", { signal: i } = {}) => this.#e({
5268
- type: A.READ_FILE,
5269
- data: { path: e, encoding: t }
5270
- }, void 0, i);
5271
- /**
5272
- * Delete a file.
5273
- *
5274
- * @category File System
5275
- */
5276
- deleteFile = (e, { signal: t } = {}) => this.#e({
5277
- type: A.DELETE_FILE,
5278
- data: { path: e }
5279
- }, void 0, t);
5280
- /**
5281
- * Rename a file or directory.
5282
- *
5283
- * @category File System
5284
- */
5285
- rename = (e, t, { signal: i } = {}) => this.#e({
5286
- type: A.RENAME,
5287
- data: { oldPath: e, newPath: t }
5288
- }, void 0, i);
5289
- /**
5290
- * Create a directory.
5291
- *
5292
- * @category File System
5293
- */
5294
- createDir = (e, { signal: t } = {}) => this.#e({
5295
- type: A.CREATE_DIR,
5296
- data: { path: e }
5297
- }, void 0, t);
5298
- /**
5299
- * List directory contents.
5300
- *
5301
- * @category File System
5302
- */
5303
- listDir = (e, { signal: t } = {}) => this.#e({
5304
- type: A.LIST_DIR,
5305
- data: { path: e }
5306
- }, void 0, t);
5307
- /**
5308
- * Delete an empty directory.
5309
- *
5310
- * @category File System
5311
- */
5312
- deleteDir = (e, { signal: t } = {}) => this.#e({
5313
- type: A.DELETE_DIR,
5314
- data: { path: e }
5315
- }, void 0, t);
5316
- }
5317
- var Rt;
5318
- (function(a) {
5319
- a.MEMFS = "MEMFS", a.NODEFS = "NODEFS", a.NODERAWFS = "NODERAWFS", a.IDBFS = "IDBFS", a.WORKERFS = "WORKERFS", a.PROXYFS = "PROXYFS";
5320
- })(Rt || (Rt = {}));
5321
- class ks {
5074
+ class vs {
5322
5075
  ffmpeg;
5323
5076
  isReady = !1;
5324
5077
  edit;
5325
5078
  application;
5326
5079
  constructor(e, t) {
5327
- this.edit = e, this.application = t.application, this.ffmpeg = new xs();
5080
+ this.edit = e, this.application = t.application, this.ffmpeg = new jt();
5328
5081
  }
5329
5082
  async init() {
5330
5083
  if (!this.isReady)
@@ -5342,50 +5095,50 @@ class ks {
5342
5095
  n.visible = !1;
5343
5096
  const g = this.createProgressOverlay();
5344
5097
  try {
5345
- const p = this.edit.getSize ? this.edit.getSize() : { width: 1920, height: 1080 }, k = Math.ceil(this.edit.totalDuration * t / 1e3), R = 1e3 / t, S = 100, F = 50, ee = 50, oe = (O) => Math.round(O / k * F);
5098
+ const p = this.edit.getSize ? this.edit.getSize() : { width: 1920, height: 1080 }, k = Math.ceil(this.edit.totalDuration * t / 1e3), A = 1e3 / t, S = 100, N = 50, J = 50, re = (T) => Math.round(T / k * N);
5346
5099
  this.updateProgressOverlay(g, 0, S);
5347
5100
  const H = document.createElement("canvas");
5348
5101
  H.width = p.width, H.height = p.height;
5349
- const ce = H.getContext("2d");
5350
- if (!ce)
5102
+ const oe = H.getContext("2d");
5103
+ if (!oe)
5351
5104
  throw new Error("Could not get 2D context for canvas");
5352
- const je = this.findAudioPlayers();
5105
+ const Ve = this.findAudioPlayers();
5353
5106
  this.updateProgressOverlay(g, 2, S);
5354
- const $ = [];
5355
- if (je.length > 0) {
5107
+ const B = [];
5108
+ if (Ve.length > 0) {
5356
5109
  this.updateProgressOverlay(g, 3, S);
5357
- for (let O = 0; O < je.length; O += 1) {
5358
- const Z = await this.processAudioTrack(je[O], O);
5359
- Z && $.push(Z), this.updateProgressOverlay(g, 4 + O, S);
5110
+ for (let T = 0; T < Ve.length; T += 1) {
5111
+ const D = await this.processAudioTrack(Ve[T], T);
5112
+ D && B.push(D), this.updateProgressOverlay(g, 4 + T, S);
5360
5113
  }
5361
5114
  }
5362
5115
  n.position.x = 0, n.position.y = 0, n.scale.x = 1, n.scale.y = 1;
5363
- for (let O = 0; O < k; O += 1) {
5364
- this.edit.seek(O * R), this.edit.tick ? this.edit.tick(0, 0) : (this.edit.update?.(0, 0), this.edit.draw?.());
5116
+ for (let T = 0; T < k; T += 1) {
5117
+ this.edit.seek(T * A), this.edit.tick ? this.edit.tick(0, 0) : (this.edit.update?.(0, 0), this.edit.draw?.());
5365
5118
  try {
5366
- const { extract: Z } = this.application.renderer, D = Z.canvas(n);
5367
- ce.clearRect(0, 0, H.width, H.height), ce.drawImage(D, 0, 0);
5368
- const j = H.toDataURL("image/png"), Oe = await (await fetch(j)).arrayBuffer(), Bt = `frame_${O.toString().padStart(6, "0")}.png`;
5369
- await this.ffmpeg.writeFile(Bt, new Uint8Array(Oe));
5370
- } catch (Z) {
5371
- console.error(`Error capturing frame ${O}:`, Z);
5119
+ const { extract: D } = this.application.renderer, E = D.canvas(n);
5120
+ oe.clearRect(0, 0, H.width, H.height), oe.drawImage(E, 0, 0);
5121
+ const V = H.toDataURL("image/png"), Se = await (await fetch(V)).arrayBuffer(), Dt = `frame_${T.toString().padStart(6, "0")}.png`;
5122
+ await this.ffmpeg.writeFile(Dt, new Uint8Array(Se));
5123
+ } catch (D) {
5124
+ console.error(`Error capturing frame ${T}:`, D);
5372
5125
  }
5373
- this.updateProgressOverlay(g, oe(O + 1), S);
5126
+ this.updateProgressOverlay(g, re(T + 1), S);
5374
5127
  }
5375
- this.updateProgressOverlay(g, F, S);
5376
- let G = ["-framerate", t.toString(), "-i", "frame_%06d.png"];
5377
- for (const O of $)
5378
- G = G.concat(["-i", O.filename]);
5379
- if (G = G.concat(["-c:v", "libx264", "-pix_fmt", "yuv420p", "-crf", "23"]), $.length > 0) {
5380
- let O = "";
5381
- for (let D = 0; D < $.length; D += 1) {
5382
- const j = $[D], dt = D + 1, Oe = Math.max(0, j.start);
5383
- O += `[${dt}:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo,apad,afade=t=in:st=0:d=0.05,atrim=start=0:end=${j.duration / 1e3 + 0.1},adelay=${Oe}|${Oe},volume=${j.volume}[a${D}];`;
5128
+ this.updateProgressOverlay(g, N, S);
5129
+ let X = ["-framerate", t.toString(), "-i", "frame_%06d.png"];
5130
+ for (const T of B)
5131
+ X = X.concat(["-i", T.filename]);
5132
+ if (X = X.concat(["-c:v", "libx264", "-pix_fmt", "yuv420p", "-crf", "23"]), B.length > 0) {
5133
+ let T = "";
5134
+ for (let E = 0; E < B.length; E += 1) {
5135
+ const V = B[E], ut = E + 1, Se = Math.max(0, V.start);
5136
+ T += `[${ut}:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo,apad,afade=t=in:st=0:d=0.05,atrim=start=0:end=${V.duration / 1e3 + 0.1},adelay=${Se}|${Se},volume=${V.volume}[a${E}];`;
5384
5137
  }
5385
- const Z = $.length > 1 ? `${$.map((D, j) => `[a${j}]`).join("")}amix=inputs=${$.length}:duration=longest:dropout_transition=0.5:normalize=0[aout]` : "[a0]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[aout]";
5386
- O += Z, G = G.concat([
5138
+ const D = B.length > 1 ? `${B.map((E, V) => `[a${V}]`).join("")}amix=inputs=${B.length}:duration=longest:dropout_transition=0.5:normalize=0[aout]` : "[a0]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[aout]";
5139
+ T += D, X = X.concat([
5387
5140
  "-filter_complex",
5388
- O,
5141
+ T,
5389
5142
  "-map",
5390
5143
  "0:v",
5391
5144
  "-map",
@@ -5397,33 +5150,33 @@ class ks {
5397
5150
  "-shortest"
5398
5151
  ]);
5399
5152
  }
5400
- const Ve = "output.mp4";
5401
- G.push(Ve);
5402
- let lt = 0;
5403
- const ht = ({ message: O }) => {
5404
- const Z = O.includes("frame=") && O.includes("fps=") ? O.match(/frame=\s*(\d+)/) : null;
5405
- if (Z?.[1]) {
5406
- const D = parseInt(Z[1], 10);
5407
- if (!Number.isNaN(D) && D > lt && (lt = D, D <= k)) {
5408
- const j = Math.round(D / k * ee);
5409
- this.updateProgressOverlay(g, F + j, S);
5153
+ const $e = "output.mp4";
5154
+ X.push($e);
5155
+ let ct = 0;
5156
+ const lt = ({ message: T }) => {
5157
+ const D = T.includes("frame=") && T.includes("fps=") ? T.match(/frame=\s*(\d+)/) : null;
5158
+ if (D?.[1]) {
5159
+ const E = parseInt(D[1], 10);
5160
+ if (!Number.isNaN(E) && E > ct && (ct = E, E <= k)) {
5161
+ const V = Math.round(E / k * J);
5162
+ this.updateProgressOverlay(g, N + V, S);
5410
5163
  }
5411
5164
  }
5412
5165
  };
5413
- this.ffmpeg.on("log", ht), await this.ffmpeg.exec(G), this.ffmpeg.off("log", ht), this.updateProgressOverlay(g, F + ee, S);
5414
- const Ue = await this.ffmpeg.readFile(Ve), Ft = Ue instanceof Uint8Array ? Ue : new TextEncoder().encode(Ue.toString()), Zt = new Blob([Ft], { type: "video/mp4" }), ut = URL.createObjectURL(Zt), We = document.createElement("a");
5415
- We.href = ut, We.download = e, We.click(), URL.revokeObjectURL(ut);
5416
- for (let O = 0; O < k; O += 1)
5166
+ this.ffmpeg.on("log", lt), await this.ffmpeg.exec(X), this.ffmpeg.off("log", lt), this.updateProgressOverlay(g, N + J, S);
5167
+ const je = await this.ffmpeg.readFile($e), Ft = je instanceof Uint8Array ? je : new TextEncoder().encode(je.toString()), Nt = new Blob([Ft], { type: "video/mp4" }), ht = URL.createObjectURL(Nt), Ue = document.createElement("a");
5168
+ Ue.href = ht, Ue.download = e, Ue.click(), URL.revokeObjectURL(ht);
5169
+ for (let T = 0; T < k; T += 1)
5417
5170
  try {
5418
- await this.ffmpeg.deleteFile(`frame_${O.toString().padStart(6, "0")}.png`);
5171
+ await this.ffmpeg.deleteFile(`frame_${T.toString().padStart(6, "0")}.png`);
5419
5172
  } catch {
5420
5173
  }
5421
- for (const O of $)
5174
+ for (const T of B)
5422
5175
  try {
5423
- await this.ffmpeg.deleteFile(O.filename);
5176
+ await this.ffmpeg.deleteFile(T.filename);
5424
5177
  } catch {
5425
5178
  }
5426
- await this.ffmpeg.deleteFile(Ve), this.updateProgressOverlay(g, S, S);
5179
+ await this.ffmpeg.deleteFile($e), this.updateProgressOverlay(g, S, S);
5427
5180
  } catch (p) {
5428
5181
  throw console.error("Error during export:", p), p;
5429
5182
  } finally {
@@ -5438,7 +5191,7 @@ class ks {
5438
5191
  if (Array.isArray(s))
5439
5192
  for (let n = 0; n < s.length; n += 1) {
5440
5193
  const r = s[n];
5441
- (r instanceof nt || r.constructor.name === "AudioPlayer" || r.clipConfiguration?.asset?.type === "audio") && (e.includes(r) || e.push(r));
5194
+ (r instanceof st || r.constructor.name === "AudioPlayer" || r.clipConfiguration?.asset?.type === "audio") && (e.includes(r) || e.push(r));
5442
5195
  }
5443
5196
  }
5444
5197
  return this.searchContainerForPlayers(this.edit.getContainer(), e), e;
@@ -5453,7 +5206,7 @@ class ks {
5453
5206
  const r = n, o = ["player", "clip", "audioPlayer", "entity"];
5454
5207
  for (const h of o) {
5455
5208
  const c = r[h];
5456
- c instanceof nt && !t.includes(c) && t.push(c);
5209
+ c instanceof st && !t.includes(c) && t.push(c);
5457
5210
  }
5458
5211
  }
5459
5212
  }
@@ -5539,8 +5292,8 @@ class ks {
5539
5292
  }
5540
5293
  }
5541
5294
  export {
5542
- ue as Canvas,
5543
- _s as Controls,
5544
- he as Edit,
5545
- ks as VideoExporter
5295
+ he as Canvas,
5296
+ ys as Controls,
5297
+ le as Edit,
5298
+ vs as VideoExporter
5546
5299
  };