@reffy/infinite-canvas 0.1.0 → 0.1.2

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.
@@ -2,8 +2,8 @@ var Zo = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
4
  var Fo = (t, e, r) => e.has(t) || Zo("Cannot " + r);
5
- var v = (t, e, r) => (Fo(t, e, "read from private field"), r ? r.call(t) : e.get(t)), V = (t, e, r) => e.has(t) ? Zo("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Z = (t, e, r, i) => (Fo(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
6
- import { makeObservable as Oa, computed as ot, action as A, observable as ee, reaction as Xh } from "mobx";
5
+ var v = (t, e, r) => (Fo(t, e, "read from private field"), r ? r.call(t) : e.get(t)), V = (t, e, r) => e.has(t) ? Zo("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), F = (t, e, r, i) => (Fo(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
6
+ import { makeObservable as Oa, computed as at, action as M, observable as ee, reaction as Xh } from "mobx";
7
7
  import { css as Jh, LitElement as Vh } from "lit";
8
8
  import Oe from "dexie";
9
9
  import { v4 as Yh } from "uuid";
@@ -17,7 +17,7 @@ const Nt = ["TOP", "BOTTOM", "LEFT", "RIGHT"], yn = ["TOPLEFT", "TOPRIGHT", "BOT
17
17
  function Wo(t) {
18
18
  return Bo[t] ? Bo[t] : t;
19
19
  }
20
- const Ea = 8, Yr = 2, L = {
20
+ const Ea = 8, Yr = 2, Z = {
21
21
  identity: function() {
22
22
  return [1, 0, 0, 0, 1, 0, 0, 0, 1];
23
23
  },
@@ -32,7 +32,7 @@ const Ea = 8, Yr = 2, L = {
32
32
  return [t, 0, 0, 0, e, 0, 0, 0, 1];
33
33
  },
34
34
  multiply: function(t, e) {
35
- var r = t[0], i = t[1], n = t[2], o = t[3], a = t[4], s = t[5], u = t[6], c = t[7], l = t[8], d = e[0], m = e[1], f = e[2], $ = e[3], w = e[4], P = e[5], R = e[6], C = e[7], E = e[8];
35
+ var r = t[0], i = t[1], n = t[2], o = t[3], a = t[4], s = t[5], u = t[6], c = t[7], l = t[8], d = e[0], m = e[1], f = e[2], $ = e[3], w = e[4], P = e[5], L = e[6], A = e[7], E = e[8];
36
36
  return [
37
37
  d * r + m * o + f * u,
38
38
  d * i + m * a + f * c,
@@ -40,9 +40,9 @@ const Ea = 8, Yr = 2, L = {
40
40
  $ * r + w * o + P * u,
41
41
  $ * i + w * a + P * c,
42
42
  $ * n + w * s + P * l,
43
- R * r + C * o + E * u,
44
- R * i + C * a + E * c,
45
- R * n + C * s + E * l
43
+ L * r + A * o + E * u,
44
+ L * i + A * a + E * c,
45
+ L * n + A * s + E * l
46
46
  ];
47
47
  },
48
48
  inverse(t) {
@@ -76,10 +76,10 @@ function Go(t, e, r) {
76
76
  throw t.deleteShader(i), new Error("Shader was not created.");
77
77
  }
78
78
  function Kh(t, e, r, i, n, o) {
79
- const a = n.getBoundingClientRect(), s = window.devicePixelRatio || 1, u = (t - a.left) * s, c = (e - a.top) * s, l = u / r * 2 - 1, d = c / i * -2 + 1, m = L.projection(r, i), f = L.multiply(m, o), $ = L.inverse(f), [w, P] = L.transformPoint($, [l, d]);
79
+ const a = n.getBoundingClientRect(), s = window.devicePixelRatio || 1, u = (t - a.left) * s, c = (e - a.top) * s, l = u / r * 2 - 1, d = c / i * -2 + 1, m = Z.projection(r, i), f = Z.multiply(m, o), $ = Z.inverse(f), [w, P] = Z.transformPoint($, [l, d]);
80
80
  return [w, P];
81
81
  }
82
- function Fe(t, e, r) {
82
+ function Be(t, e, r) {
83
83
  const { gl: i, canvas: n } = r;
84
84
  return Kh(
85
85
  t,
@@ -103,7 +103,7 @@ function qh(t) {
103
103
  function Qh(t) {
104
104
  return Math.hypot(t[3], t[4]);
105
105
  }
106
- function Je(t) {
106
+ function Ve(t) {
107
107
  return [qh(t), Qh(t)];
108
108
  }
109
109
  function Xo(t) {
@@ -179,7 +179,7 @@ function Ta(t, e = 1) {
179
179
  }, n.onerror = i, n.src = t;
180
180
  });
181
181
  }
182
- const at = [0.33, 0.6, 0.95, 1], hn = [
182
+ const st = [0.33, 0.6, 0.95, 1], hn = [
183
183
  0.33,
184
184
  0.6,
185
185
  0.95,
@@ -280,7 +280,7 @@ function h(t, e, r) {
280
280
  }), Object.defineProperty(a, "name", { value: t }), a;
281
281
  }
282
282
  const Ua = Symbol("zod_brand");
283
- class Ve extends Error {
283
+ class Ye extends Error {
284
284
  constructor() {
285
285
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
286
286
  }
@@ -327,7 +327,7 @@ function Zt(t) {
327
327
  }
328
328
  };
329
329
  }
330
- function Qe(t) {
330
+ function et(t) {
331
331
  return t == null;
332
332
  }
333
333
  function Zn(t) {
@@ -410,7 +410,7 @@ function Ca(t) {
410
410
  }
411
411
  const qr = "captureStackTrace" in Error ? Error.captureStackTrace : (...t) => {
412
412
  };
413
- function lt(t) {
413
+ function dt(t) {
414
414
  return typeof t == "object" && t !== null && !Array.isArray(t);
415
415
  }
416
416
  const Da = Zt(() => {
@@ -423,17 +423,17 @@ const Da = Zt(() => {
423
423
  return !1;
424
424
  }
425
425
  });
426
- function Ye(t) {
427
- if (lt(t) === !1)
426
+ function He(t) {
427
+ if (dt(t) === !1)
428
428
  return !1;
429
429
  const e = t.constructor;
430
430
  if (e === void 0 || typeof e != "function")
431
431
  return !0;
432
432
  const r = e.prototype;
433
- return !(lt(r) === !1 || Object.prototype.hasOwnProperty.call(r, "isPrototypeOf") === !1);
433
+ return !(dt(r) === !1 || Object.prototype.hasOwnProperty.call(r, "isPrototypeOf") === !1);
434
434
  }
435
435
  function Fn(t) {
436
- return Ye(t) ? { ...t } : Array.isArray(t) ? [...t] : t;
436
+ return He(t) ? { ...t } : Array.isArray(t) ? [...t] : t;
437
437
  }
438
438
  function ym(t) {
439
439
  let e = 0;
@@ -557,7 +557,7 @@ function Fa(t, e) {
557
557
  return ae(t, i);
558
558
  }
559
559
  function Ba(t, e) {
560
- if (!Ye(e))
560
+ if (!He(e))
561
561
  throw new Error("Invalid input to extend: expected a plain object");
562
562
  const r = t._zod.def.checks;
563
563
  if (r && r.length > 0)
@@ -572,7 +572,7 @@ function Ba(t, e) {
572
572
  return ae(t, n);
573
573
  }
574
574
  function Wa(t, e) {
575
- if (!Ye(e))
575
+ if (!He(e))
576
576
  throw new Error("Invalid input to safeExtend: expected a plain object");
577
577
  const r = {
578
578
  ...t._zod.def,
@@ -648,7 +648,7 @@ function Ja(t, e, r) {
648
648
  });
649
649
  return ae(e, i);
650
650
  }
651
- function Be(t, e = 0) {
651
+ function We(t, e = 0) {
652
652
  if (t.aborted === !0)
653
653
  return !0;
654
654
  for (let r = e; r < t.issues.length; r++)
@@ -679,7 +679,7 @@ function Bn(t) {
679
679
  function Wn(t) {
680
680
  return Array.isArray(t) ? "array" : typeof t == "string" ? "string" : "unknown";
681
681
  }
682
- function dt(...t) {
682
+ function ht(...t) {
683
683
  const [e, r, i] = t;
684
684
  return typeof e == "string" ? {
685
685
  message: e,
@@ -731,7 +731,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
731
731
  BIGINT_FORMAT_RANGES: La,
732
732
  Class: km,
733
733
  NUMBER_FORMAT_RANGES: Ra,
734
- aborted: Be,
734
+ aborted: We,
735
735
  allowsEval: Da,
736
736
  assert: hm,
737
737
  assertEqual: cm,
@@ -760,15 +760,15 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
760
760
  getParsedType: bm,
761
761
  getSizableOrigin: Bn,
762
762
  hexToUint8Array: xm,
763
- isObject: lt,
764
- isPlainObject: Ye,
765
- issue: dt,
763
+ isObject: dt,
764
+ isPlainObject: He,
765
+ issue: ht,
766
766
  joinValues: y,
767
767
  jsonStringifyReplacer: Tn,
768
768
  merge: Ga,
769
769
  mergeDefs: Te,
770
770
  normalizeParams: p,
771
- nullish: Qe,
771
+ nullish: et,
772
772
  numKeys: ym,
773
773
  objectClone: mm,
774
774
  omit: Fa,
@@ -869,7 +869,7 @@ function es(t) {
869
869
  const Ft = (t) => (e, r, i, n) => {
870
870
  const o = i ? Object.assign(i, { async: !1 }) : { async: !1 }, a = e._zod.run({ value: r, issues: [] }, o);
871
871
  if (a instanceof Promise)
872
- throw new Ve();
872
+ throw new Ye();
873
873
  if (a.issues.length) {
874
874
  const s = new (n?.Err ?? t)(a.issues.map((u) => oe(u, o, H())));
875
875
  throw qr(s, n?.callee), s;
@@ -886,7 +886,7 @@ const Ft = (t) => (e, r, i, n) => {
886
886
  }, Fr = /* @__PURE__ */ Bt(ne), Wt = (t) => (e, r, i) => {
887
887
  const n = i ? { ...i, async: !1 } : { async: !1 }, o = e._zod.run({ value: r, issues: [] }, n);
888
888
  if (o instanceof Promise)
889
- throw new Ve();
889
+ throw new Ye();
890
890
  return o.issues.length ? {
891
891
  success: !1,
892
892
  error: new (t ?? Qr)(o.issues.map((a) => oe(a, n, H())))
@@ -910,7 +910,7 @@ const Ft = (t) => (e, r, i, n) => {
910
910
  }, Pm = /* @__PURE__ */ ai(ne), si = (t) => (e, r, i) => Wt(t)(e, r, i), jm = /* @__PURE__ */ si(ne), ci = (t) => async (e, r, i) => {
911
911
  const n = i ? Object.assign(i, { direction: "backward" }) : { direction: "backward" };
912
912
  return Gt(t)(e, r, n);
913
- }, Um = /* @__PURE__ */ ci(ne), ui = (t) => async (e, r, i) => Gt(t)(e, r, i), Nm = /* @__PURE__ */ ui(ne), rs = /^[cC][^\s-]{8,}$/, is = /^[0-9a-z]+$/, os = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, as = /^[0-9a-vA-V]{20}$/, ss = /^[A-Za-z0-9]{27}$/, cs = /^[a-zA-Z0-9_-]{21}$/, us = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Cm = /^[-+]?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)?)??$/, ls = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, ht = (t) => t ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Dm = /* @__PURE__ */ ht(4), Am = /* @__PURE__ */ ht(6), Mm = /* @__PURE__ */ ht(7), ds = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Rm = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, Lm = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, hs = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u, Zm = hs, Fm = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, Bm = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
913
+ }, Um = /* @__PURE__ */ ci(ne), ui = (t) => async (e, r, i) => Gt(t)(e, r, i), Nm = /* @__PURE__ */ ui(ne), rs = /^[cC][^\s-]{8,}$/, is = /^[0-9a-z]+$/, os = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, as = /^[0-9a-vA-V]{20}$/, ss = /^[A-Za-z0-9]{27}$/, cs = /^[a-zA-Z0-9_-]{21}$/, us = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Cm = /^[-+]?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)?)??$/, ls = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, mt = (t) => t ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Dm = /* @__PURE__ */ mt(4), Am = /* @__PURE__ */ mt(6), Mm = /* @__PURE__ */ mt(7), ds = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Rm = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, Lm = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, hs = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u, Zm = hs, Fm = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, Bm = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
914
914
  function ms() {
915
915
  return new RegExp(Bm, "u");
916
916
  }
@@ -996,12 +996,12 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
996
996
  undefined: Ns,
997
997
  unicodeEmail: hs,
998
998
  uppercase: Ds,
999
- uuid: ht,
999
+ uuid: mt,
1000
1000
  uuid4: Dm,
1001
1001
  uuid6: Am,
1002
1002
  uuid7: Mm,
1003
1003
  xid: as
1004
- }, Symbol.toStringTag, { value: "Module" })), M = /* @__PURE__ */ h("$ZodCheck", (t, e) => {
1004
+ }, Symbol.toStringTag, { value: "Module" })), R = /* @__PURE__ */ h("$ZodCheck", (t, e) => {
1005
1005
  var r;
1006
1006
  t._zod ?? (t._zod = {}), t._zod.def = e, (r = t._zod).onattach ?? (r.onattach = []);
1007
1007
  }), Ms = {
@@ -1009,7 +1009,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1009
1009
  bigint: "bigint",
1010
1010
  object: "date"
1011
1011
  }, hi = /* @__PURE__ */ h("$ZodCheckLessThan", (t, e) => {
1012
- M.init(t, e);
1012
+ R.init(t, e);
1013
1013
  const r = Ms[typeof e.value];
1014
1014
  t._zod.onattach.push((i) => {
1015
1015
  const n = i._zod.bag, o = (e.inclusive ? n.maximum : n.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
@@ -1026,7 +1026,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1026
1026
  });
1027
1027
  };
1028
1028
  }), mi = /* @__PURE__ */ h("$ZodCheckGreaterThan", (t, e) => {
1029
- M.init(t, e);
1029
+ R.init(t, e);
1030
1030
  const r = Ms[typeof e.value];
1031
1031
  t._zod.onattach.push((i) => {
1032
1032
  const n = i._zod.bag, o = (e.inclusive ? n.minimum : n.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
@@ -1043,7 +1043,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1043
1043
  });
1044
1044
  };
1045
1045
  }), Rs = /* @__PURE__ */ h("$ZodCheckMultipleOf", (t, e) => {
1046
- M.init(t, e), t._zod.onattach.push((r) => {
1046
+ R.init(t, e), t._zod.onattach.push((r) => {
1047
1047
  var i;
1048
1048
  (i = r._zod.bag).multipleOf ?? (i.multipleOf = e.value);
1049
1049
  }), t._zod.check = (r) => {
@@ -1059,7 +1059,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1059
1059
  });
1060
1060
  };
1061
1061
  }), Ls = /* @__PURE__ */ h("$ZodCheckNumberFormat", (t, e) => {
1062
- M.init(t, e), e.format = e.format || "float64";
1062
+ R.init(t, e), e.format = e.format || "float64";
1063
1063
  const r = e.format?.includes("int"), i = r ? "int" : "number", [n, o] = Ra[e.format];
1064
1064
  t._zod.onattach.push((a) => {
1065
1065
  const s = a._zod.bag;
@@ -1116,7 +1116,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1116
1116
  });
1117
1117
  };
1118
1118
  }), Zs = /* @__PURE__ */ h("$ZodCheckBigIntFormat", (t, e) => {
1119
- M.init(t, e);
1119
+ R.init(t, e);
1120
1120
  const [r, i] = La[e.format];
1121
1121
  t._zod.onattach.push((n) => {
1122
1122
  const o = n._zod.bag;
@@ -1141,9 +1141,9 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1141
1141
  };
1142
1142
  }), Fs = /* @__PURE__ */ h("$ZodCheckMaxSize", (t, e) => {
1143
1143
  var r;
1144
- M.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1144
+ R.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1145
1145
  const n = i.value;
1146
- return !Qe(n) && n.size !== void 0;
1146
+ return !et(n) && n.size !== void 0;
1147
1147
  }), t._zod.onattach.push((i) => {
1148
1148
  const n = i._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1149
1149
  e.maximum < n && (i._zod.bag.maximum = e.maximum);
@@ -1161,9 +1161,9 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1161
1161
  };
1162
1162
  }), Bs = /* @__PURE__ */ h("$ZodCheckMinSize", (t, e) => {
1163
1163
  var r;
1164
- M.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1164
+ R.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1165
1165
  const n = i.value;
1166
- return !Qe(n) && n.size !== void 0;
1166
+ return !et(n) && n.size !== void 0;
1167
1167
  }), t._zod.onattach.push((i) => {
1168
1168
  const n = i._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1169
1169
  e.minimum > n && (i._zod.bag.minimum = e.minimum);
@@ -1181,9 +1181,9 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1181
1181
  };
1182
1182
  }), Ws = /* @__PURE__ */ h("$ZodCheckSizeEquals", (t, e) => {
1183
1183
  var r;
1184
- M.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1184
+ R.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1185
1185
  const n = i.value;
1186
- return !Qe(n) && n.size !== void 0;
1186
+ return !et(n) && n.size !== void 0;
1187
1187
  }), t._zod.onattach.push((i) => {
1188
1188
  const n = i._zod.bag;
1189
1189
  n.minimum = e.size, n.maximum = e.size, n.size = e.size;
@@ -1204,9 +1204,9 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1204
1204
  };
1205
1205
  }), Gs = /* @__PURE__ */ h("$ZodCheckMaxLength", (t, e) => {
1206
1206
  var r;
1207
- M.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1207
+ R.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1208
1208
  const n = i.value;
1209
- return !Qe(n) && n.length !== void 0;
1209
+ return !et(n) && n.length !== void 0;
1210
1210
  }), t._zod.onattach.push((i) => {
1211
1211
  const n = i._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1212
1212
  e.maximum < n && (i._zod.bag.maximum = e.maximum);
@@ -1227,9 +1227,9 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1227
1227
  };
1228
1228
  }), Xs = /* @__PURE__ */ h("$ZodCheckMinLength", (t, e) => {
1229
1229
  var r;
1230
- M.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1230
+ R.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1231
1231
  const n = i.value;
1232
- return !Qe(n) && n.length !== void 0;
1232
+ return !et(n) && n.length !== void 0;
1233
1233
  }), t._zod.onattach.push((i) => {
1234
1234
  const n = i._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1235
1235
  e.minimum > n && (i._zod.bag.minimum = e.minimum);
@@ -1250,9 +1250,9 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1250
1250
  };
1251
1251
  }), Js = /* @__PURE__ */ h("$ZodCheckLengthEquals", (t, e) => {
1252
1252
  var r;
1253
- M.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1253
+ R.init(t, e), (r = t._zod.def).when ?? (r.when = (i) => {
1254
1254
  const n = i.value;
1255
- return !Qe(n) && n.length !== void 0;
1255
+ return !et(n) && n.length !== void 0;
1256
1256
  }), t._zod.onattach.push((i) => {
1257
1257
  const n = i._zod.bag;
1258
1258
  n.minimum = e.length, n.maximum = e.length, n.length = e.length;
@@ -1273,7 +1273,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1273
1273
  };
1274
1274
  }), Vt = /* @__PURE__ */ h("$ZodCheckStringFormat", (t, e) => {
1275
1275
  var r, i;
1276
- M.init(t, e), t._zod.onattach.push((n) => {
1276
+ R.init(t, e), t._zod.onattach.push((n) => {
1277
1277
  const o = n._zod.bag;
1278
1278
  o.format = e.format, e.pattern && (o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(e.pattern));
1279
1279
  }), e.pattern ? (r = t._zod).check ?? (r.check = (n) => {
@@ -1305,7 +1305,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1305
1305
  }), Hs = /* @__PURE__ */ h("$ZodCheckUpperCase", (t, e) => {
1306
1306
  e.pattern ?? (e.pattern = Ds), Vt.init(t, e);
1307
1307
  }), Ks = /* @__PURE__ */ h("$ZodCheckIncludes", (t, e) => {
1308
- M.init(t, e);
1308
+ R.init(t, e);
1309
1309
  const r = Ee(e.includes), i = new RegExp(typeof e.position == "number" ? `^.{${e.position}}${r}` : r);
1310
1310
  e.pattern = i, t._zod.onattach.push((n) => {
1311
1311
  const o = n._zod.bag;
@@ -1322,7 +1322,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1322
1322
  });
1323
1323
  };
1324
1324
  }), qs = /* @__PURE__ */ h("$ZodCheckStartsWith", (t, e) => {
1325
- M.init(t, e);
1325
+ R.init(t, e);
1326
1326
  const r = new RegExp(`^${Ee(e.prefix)}.*`);
1327
1327
  e.pattern ?? (e.pattern = r), t._zod.onattach.push((i) => {
1328
1328
  const n = i._zod.bag;
@@ -1339,7 +1339,7 @@ const Wm = /^[0-9a-fA-F]{32}$/, Gm = /* @__PURE__ */ Xt(22, "=="), Xm = /* @__PU
1339
1339
  });
1340
1340
  };
1341
1341
  }), Qs = /* @__PURE__ */ h("$ZodCheckEndsWith", (t, e) => {
1342
- M.init(t, e);
1342
+ R.init(t, e);
1343
1343
  const r = new RegExp(`.*${Ee(e.suffix)}$`);
1344
1344
  e.pattern ?? (e.pattern = r), t._zod.onattach.push((i) => {
1345
1345
  const n = i._zod.bag;
@@ -1360,7 +1360,7 @@ function Vo(t, e, r) {
1360
1360
  t.issues.length && e.issues.push(...de(r, t.issues));
1361
1361
  }
1362
1362
  const ec = /* @__PURE__ */ h("$ZodCheckProperty", (t, e) => {
1363
- M.init(t, e), t._zod.check = (r) => {
1363
+ R.init(t, e), t._zod.check = (r) => {
1364
1364
  const i = e.schema._zod.run({
1365
1365
  value: r.value[e.property],
1366
1366
  issues: []
@@ -1370,7 +1370,7 @@ const ec = /* @__PURE__ */ h("$ZodCheckProperty", (t, e) => {
1370
1370
  Vo(i, r, e.property);
1371
1371
  };
1372
1372
  }), tc = /* @__PURE__ */ h("$ZodCheckMimeType", (t, e) => {
1373
- M.init(t, e);
1373
+ R.init(t, e);
1374
1374
  const r = new Set(e.mime);
1375
1375
  t._zod.onattach.push((i) => {
1376
1376
  i._zod.bag.mime = e.mime;
@@ -1384,7 +1384,7 @@ const ec = /* @__PURE__ */ h("$ZodCheckProperty", (t, e) => {
1384
1384
  });
1385
1385
  };
1386
1386
  }), nc = /* @__PURE__ */ h("$ZodCheckOverwrite", (t, e) => {
1387
- M.init(t, e), t._zod.check = (r) => {
1387
+ R.init(t, e), t._zod.check = (r) => {
1388
1388
  r.value = e.tx(r.value);
1389
1389
  };
1390
1390
  });
@@ -1429,7 +1429,7 @@ const ic = {
1429
1429
  });
1430
1430
  else {
1431
1431
  const n = (a, s, u) => {
1432
- let c = Be(a), l;
1432
+ let c = We(a), l;
1433
1433
  for (const d of s) {
1434
1434
  if (d._zod.def.when) {
1435
1435
  if (!d._zod.def.when(a))
@@ -1438,25 +1438,25 @@ const ic = {
1438
1438
  continue;
1439
1439
  const m = a.issues.length, f = d._zod.check(a);
1440
1440
  if (f instanceof Promise && u?.async === !1)
1441
- throw new Ve();
1441
+ throw new Ye();
1442
1442
  if (l || f instanceof Promise)
1443
1443
  l = (l ?? Promise.resolve()).then(async () => {
1444
- await f, a.issues.length !== m && (c || (c = Be(a, m)));
1444
+ await f, a.issues.length !== m && (c || (c = We(a, m)));
1445
1445
  });
1446
1446
  else {
1447
1447
  if (a.issues.length === m)
1448
1448
  continue;
1449
- c || (c = Be(a, m));
1449
+ c || (c = We(a, m));
1450
1450
  }
1451
1451
  }
1452
1452
  return l ? l.then(() => a) : a;
1453
1453
  }, o = (a, s, u) => {
1454
- if (Be(a))
1454
+ if (We(a))
1455
1455
  return a.aborted = !0, a;
1456
1456
  const c = n(s, i, u);
1457
1457
  if (c instanceof Promise) {
1458
1458
  if (u.async === !1)
1459
- throw new Ve();
1459
+ throw new Ye();
1460
1460
  return c.then((l) => t._zod.parse(l, u));
1461
1461
  }
1462
1462
  return t._zod.parse(c, u);
@@ -1471,7 +1471,7 @@ const ic = {
1471
1471
  const u = t._zod.parse(a, s);
1472
1472
  if (u instanceof Promise) {
1473
1473
  if (s.async === !1)
1474
- throw new Ve();
1474
+ throw new Ye();
1475
1475
  return u.then((c) => n(c, i, s));
1476
1476
  }
1477
1477
  return n(u, i, s);
@@ -1521,9 +1521,9 @@ const ic = {
1521
1521
  }[e.version];
1522
1522
  if (i === void 0)
1523
1523
  throw new Error(`Invalid UUID version: "${e.version}"`);
1524
- e.pattern ?? (e.pattern = ht(i));
1524
+ e.pattern ?? (e.pattern = mt(i));
1525
1525
  } else
1526
- e.pattern ?? (e.pattern = ht());
1526
+ e.pattern ?? (e.pattern = mt());
1527
1527
  U.init(t, e);
1528
1528
  }), sc = /* @__PURE__ */ h("$ZodEmail", (t, e) => {
1529
1529
  e.pattern ?? (e.pattern = ds), U.init(t, e);
@@ -1908,7 +1908,7 @@ const Gc = /* @__PURE__ */ h("$ZodObject", (t, e) => {
1908
1908
  }
1909
1909
  return u;
1910
1910
  });
1911
- const n = lt, o = e.catchall;
1911
+ const n = dt, o = e.catchall;
1912
1912
  let a;
1913
1913
  t._zod.parse = (s, u) => {
1914
1914
  a ?? (a = i.value);
@@ -1937,9 +1937,9 @@ const Gc = /* @__PURE__ */ h("$ZodObject", (t, e) => {
1937
1937
  };
1938
1938
  f.write("const input = payload.value;");
1939
1939
  const P = /* @__PURE__ */ Object.create(null);
1940
- let R = 0;
1940
+ let L = 0;
1941
1941
  for (const E of $.keys)
1942
- P[E] = `key_${R++}`;
1942
+ P[E] = `key_${L++}`;
1943
1943
  f.write("const newResult = {};");
1944
1944
  for (const E of $.keys) {
1945
1945
  const S = P[E], se = Lr(E);
@@ -1963,11 +1963,11 @@ const Gc = /* @__PURE__ */ h("$ZodObject", (t, e) => {
1963
1963
  `);
1964
1964
  }
1965
1965
  f.write("payload.value = newResult;"), f.write("return payload;");
1966
- const C = f.compile();
1967
- return (E, S) => C(m, E, S);
1966
+ const A = f.compile();
1967
+ return (E, S) => A(m, E, S);
1968
1968
  };
1969
1969
  let o;
1970
- const a = lt, s = !En.jitless, c = s && Da.value, l = e.catchall;
1970
+ const a = dt, s = !En.jitless, c = s && Da.value, l = e.catchall;
1971
1971
  let d;
1972
1972
  t._zod.parse = (m, f) => {
1973
1973
  d ?? (d = i.value);
@@ -1984,7 +1984,7 @@ function Ho(t, e, r, i) {
1984
1984
  for (const o of t)
1985
1985
  if (o.issues.length === 0)
1986
1986
  return e.value = o.value, e;
1987
- const n = t.filter((o) => !Be(o));
1987
+ const n = t.filter((o) => !We(o));
1988
1988
  return n.length === 1 ? (e.value = n[0].value, n[0]) : (e.issues.push({
1989
1989
  code: "invalid_union",
1990
1990
  input: e.value,
@@ -2089,7 +2089,7 @@ const Jc = /* @__PURE__ */ h("$ZodXor", (t, e) => {
2089
2089
  });
2090
2090
  t._zod.parse = (n, o) => {
2091
2091
  const a = n.value;
2092
- if (!lt(a))
2092
+ if (!dt(a))
2093
2093
  return n.issues.push({
2094
2094
  code: "invalid_type",
2095
2095
  expected: "object",
@@ -2118,7 +2118,7 @@ function Br(t, e) {
2118
2118
  return { valid: !0, data: t };
2119
2119
  if (t instanceof Date && e instanceof Date && +t == +e)
2120
2120
  return { valid: !0, data: t };
2121
- if (Ye(t) && Ye(e)) {
2121
+ if (He(t) && He(e)) {
2122
2122
  const r = Object.keys(e), i = Object.keys(t).filter((o) => r.indexOf(o) !== -1), n = { ...t, ...e };
2123
2123
  for (const o of i) {
2124
2124
  const a = Br(t[o], e[o]);
@@ -2149,7 +2149,7 @@ function Br(t, e) {
2149
2149
  return { valid: !1, mergeErrorPath: [] };
2150
2150
  }
2151
2151
  function qo(t, e, r) {
2152
- if (e.issues.length && t.issues.push(...e.issues), r.issues.length && t.issues.push(...r.issues), Be(t))
2152
+ if (e.issues.length && t.issues.push(...e.issues), r.issues.length && t.issues.push(...r.issues), We(t))
2153
2153
  return t;
2154
2154
  const i = Br(e.value, r.value);
2155
2155
  if (!i.valid)
@@ -2210,7 +2210,7 @@ function mn(t, e, r) {
2210
2210
  const Hc = /* @__PURE__ */ h("$ZodRecord", (t, e) => {
2211
2211
  I.init(t, e), t._zod.parse = (r, i) => {
2212
2212
  const n = r.value;
2213
- if (!Ye(n))
2213
+ if (!He(n))
2214
2214
  return r.issues.push({
2215
2215
  expected: "record",
2216
2216
  code: "invalid_type",
@@ -2367,7 +2367,7 @@ const Qc = /* @__PURE__ */ h("$ZodEnum", (t, e) => {
2367
2367
  if (i.async)
2368
2368
  return (n instanceof Promise ? n : Promise.resolve(n)).then((a) => (r.value = a, r));
2369
2369
  if (n instanceof Promise)
2370
- throw new Ve();
2370
+ throw new Ye();
2371
2371
  return r.value = n, r;
2372
2372
  };
2373
2373
  });
@@ -2578,7 +2578,7 @@ const mu = /* @__PURE__ */ h("$ZodTemplateLiteral", (t, e) => {
2578
2578
  }), pu = /* @__PURE__ */ h("$ZodLazy", (t, e) => {
2579
2579
  I.init(t, e), O(t._zod, "innerType", () => e.getter()), O(t._zod, "pattern", () => t._zod.innerType?._zod?.pattern), O(t._zod, "propValues", () => t._zod.innerType?._zod?.propValues), O(t._zod, "optin", () => t._zod.innerType?._zod?.optin ?? void 0), O(t._zod, "optout", () => t._zod.innerType?._zod?.optout ?? void 0), t._zod.parse = (r, i) => t._zod.innerType._zod.run(r, i);
2580
2580
  }), vu = /* @__PURE__ */ h("$ZodCustom", (t, e) => {
2581
- M.init(t, e), I.init(t, e), t._zod.parse = (r, i) => r, t._zod.check = (r) => {
2581
+ R.init(t, e), I.init(t, e), t._zod.parse = (r, i) => r, t._zod.check = (r) => {
2582
2582
  const i = r.value, n = e.fn(i);
2583
2583
  if (n instanceof Promise)
2584
2584
  return n.then((o) => oa(o, r, i, t));
@@ -2597,7 +2597,7 @@ function oa(t, e, r, i) {
2597
2597
  continue: !i._zod.def.abort
2598
2598
  // params: inst._zod.def.params,
2599
2599
  };
2600
- i._zod.def.params && (n.params = i._zod.def.params), e.issues.push(dt(n));
2600
+ i._zod.def.params && (n.params = i._zod.def.params), e.issues.push(ht(n));
2601
2601
  }
2602
2602
  }
2603
2603
  const af = () => {
@@ -5026,7 +5026,7 @@ const ig = (t) => Ot(typeof t, t), Ot = (t, e = void 0) => {
5026
5026
  return "nulinė reikšmė";
5027
5027
  }
5028
5028
  return t;
5029
- }, St = (t) => t.charAt(0).toUpperCase() + t.slice(1);
5029
+ }, xt = (t) => t.charAt(0).toUpperCase() + t.slice(1);
5030
5030
  function sa(t) {
5031
5031
  const e = Math.abs(t), r = e % 10, i = e % 100;
5032
5032
  return i >= 11 && i <= 19 || r === 0 ? "many" : r === 1 ? "one" : "few";
@@ -5148,16 +5148,16 @@ const og = () => {
5148
5148
  case "too_big": {
5149
5149
  const n = Ot(i.origin), o = e(i.origin, sa(Number(i.maximum)), i.inclusive ?? !1, "smaller");
5150
5150
  if (o?.verb)
5151
- return `${St(n ?? i.origin ?? "reikšmė")} ${o.verb} ${i.maximum.toString()} ${o.unit ?? "elementų"}`;
5151
+ return `${xt(n ?? i.origin ?? "reikšmė")} ${o.verb} ${i.maximum.toString()} ${o.unit ?? "elementų"}`;
5152
5152
  const a = i.inclusive ? "ne didesnis kaip" : "mažesnis kaip";
5153
- return `${St(n ?? i.origin ?? "reikšmė")} turi būti ${a} ${i.maximum.toString()} ${o?.unit}`;
5153
+ return `${xt(n ?? i.origin ?? "reikšmė")} turi būti ${a} ${i.maximum.toString()} ${o?.unit}`;
5154
5154
  }
5155
5155
  case "too_small": {
5156
5156
  const n = Ot(i.origin), o = e(i.origin, sa(Number(i.minimum)), i.inclusive ?? !1, "bigger");
5157
5157
  if (o?.verb)
5158
- return `${St(n ?? i.origin ?? "reikšmė")} ${o.verb} ${i.minimum.toString()} ${o.unit ?? "elementų"}`;
5158
+ return `${xt(n ?? i.origin ?? "reikšmė")} ${o.verb} ${i.minimum.toString()} ${o.unit ?? "elementų"}`;
5159
5159
  const a = i.inclusive ? "ne mažesnis kaip" : "didesnis kaip";
5160
- return `${St(n ?? i.origin ?? "reikšmė")} turi būti ${a} ${i.minimum.toString()} ${o?.unit}`;
5160
+ return `${xt(n ?? i.origin ?? "reikšmė")} turi būti ${a} ${i.minimum.toString()} ${o?.unit}`;
5161
5161
  }
5162
5162
  case "invalid_format": {
5163
5163
  const n = i;
@@ -5173,7 +5173,7 @@ const og = () => {
5173
5173
  return "Klaidinga įvestis";
5174
5174
  case "invalid_element": {
5175
5175
  const n = Ot(i.origin);
5176
- return `${St(n ?? i.origin ?? "reikšmė")} turi klaidingą įvestį`;
5176
+ return `${xt(n ?? i.origin ?? "reikšmė")} turi klaidingą įvestį`;
5177
5177
  }
5178
5178
  default:
5179
5179
  return "Klaidinga įvestis";
@@ -7655,7 +7655,7 @@ function Bi(t) {
7655
7655
  function Wi(t) {
7656
7656
  return te(0, t);
7657
7657
  }
7658
- function mt(t, e) {
7658
+ function ft(t, e) {
7659
7659
  return new Rs({
7660
7660
  check: "multiple_of",
7661
7661
  ...p(e),
@@ -7669,7 +7669,7 @@ function Ht(t, e) {
7669
7669
  maximum: t
7670
7670
  });
7671
7671
  }
7672
- function ft(t, e) {
7672
+ function gt(t, e) {
7673
7673
  return new Bs({
7674
7674
  check: "min_size",
7675
7675
  ...p(e),
@@ -7690,7 +7690,7 @@ function Kt(t, e) {
7690
7690
  maximum: t
7691
7691
  });
7692
7692
  }
7693
- function He(t, e) {
7693
+ function Ke(t, e) {
7694
7694
  return new Xs({
7695
7695
  check: "min_length",
7696
7696
  ...p(e),
@@ -7985,23 +7985,23 @@ function ol(t, e, r) {
7985
7985
  function al(t) {
7986
7986
  const e = sl((r) => (r.addIssue = (i) => {
7987
7987
  if (typeof i == "string")
7988
- r.issues.push(dt(i, r.value, e._zod.def));
7988
+ r.issues.push(ht(i, r.value, e._zod.def));
7989
7989
  else {
7990
7990
  const n = i;
7991
- n.fatal && (n.continue = !1), n.code ?? (n.code = "custom"), n.input ?? (n.input = r.value), n.inst ?? (n.inst = e), n.continue ?? (n.continue = !e._zod.def.abort), r.issues.push(dt(n));
7991
+ n.fatal && (n.continue = !1), n.code ?? (n.code = "custom"), n.input ?? (n.input = r.value), n.inst ?? (n.inst = e), n.continue ?? (n.continue = !e._zod.def.abort), r.issues.push(ht(n));
7992
7992
  }
7993
7993
  }, t(r.value, r)));
7994
7994
  return e;
7995
7995
  }
7996
7996
  function sl(t, e) {
7997
- const r = new M({
7997
+ const r = new R({
7998
7998
  check: "custom",
7999
7999
  ...p(e)
8000
8000
  });
8001
8001
  return r._zod.check = t, r;
8002
8002
  }
8003
8003
  function cl(t) {
8004
- const e = new M({ check: "describe" });
8004
+ const e = new R({ check: "describe" });
8005
8005
  return e._zod.onattach = [
8006
8006
  (r) => {
8007
8007
  const i = he.get(r) ?? {};
@@ -8011,7 +8011,7 @@ function cl(t) {
8011
8011
  }, e;
8012
8012
  }
8013
8013
  function ul(t) {
8014
- const e = new M({ check: "meta" });
8014
+ const e = new R({ check: "meta" });
8015
8015
  return e._zod.onattach = [
8016
8016
  (r) => {
8017
8017
  const i = he.get(r) ?? {};
@@ -8055,7 +8055,7 @@ function Qt(t, e, r, i = {}) {
8055
8055
  };
8056
8056
  return r instanceof RegExp && (o.pattern = r), new t(o);
8057
8057
  }
8058
- function gt(t) {
8058
+ function pt(t) {
8059
8059
  let e = t?.target ?? "draft-2020-12";
8060
8060
  return e === "draft-4" && (e = "draft-04"), e === "draft-7" && (e = "draft-07"), {
8061
8061
  processors: t.processors ?? {},
@@ -8102,7 +8102,7 @@ function j(t, e, r = { path: [], schemaPath: [] }) {
8102
8102
  const u = e.metadataRegistry.get(t);
8103
8103
  return u && Object.assign(a.schema, u), e.io === "input" && q(t) && (delete a.schema.examples, delete a.schema.default), e.io === "input" && a.schema._prefault && ((i = a.schema).default ?? (i.default = a.schema._prefault)), delete a.schema._prefault, e.seen.get(t).schema;
8104
8104
  }
8105
- function pt(t, e) {
8105
+ function vt(t, e) {
8106
8106
  const r = t.seen.get(e);
8107
8107
  if (!r)
8108
8108
  throw new Error("Unprocessed schema. This is a bug in Zod.");
@@ -8164,7 +8164,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8164
8164
  }
8165
8165
  }
8166
8166
  }
8167
- function vt(t, e) {
8167
+ function yt(t, e) {
8168
8168
  const r = t.seen.get(e);
8169
8169
  if (!r)
8170
8170
  throw new Error("Unprocessed schema. This is a bug in Zod.");
@@ -8260,11 +8260,11 @@ function q(t, e) {
8260
8260
  return !1;
8261
8261
  }
8262
8262
  const dl = (t, e = {}) => (r) => {
8263
- const i = gt({ ...r, processors: e });
8264
- return j(t, i), pt(i, t), vt(i, t);
8263
+ const i = pt({ ...r, processors: e });
8264
+ return j(t, i), vt(i, t), yt(i, t);
8265
8265
  }, Dt = (t, e) => (r) => {
8266
- const { libraryOptions: i, target: n } = r ?? {}, o = gt({ ...i ?? {}, target: n, io: e, processors: {} });
8267
- return j(t, o), pt(o, t), vt(o, t);
8266
+ const { libraryOptions: i, target: n } = r ?? {}, o = pt({ ...i ?? {}, target: n, io: e, processors: {} });
8267
+ return j(t, o), vt(o, t), yt(o, t);
8268
8268
  }, vp = {
8269
8269
  guid: "uuid",
8270
8270
  url: "uri",
@@ -8523,7 +8523,7 @@ const dl = (t, e = {}) => (r) => {
8523
8523
  };
8524
8524
  function Hl(t, e) {
8525
8525
  if ("_idmap" in t) {
8526
- const i = t, n = gt({ ...e, processors: Wr }), o = {};
8526
+ const i = t, n = pt({ ...e, processors: Wr }), o = {};
8527
8527
  for (const u of i._idmap.entries()) {
8528
8528
  const [c, l] = u;
8529
8529
  j(l, n);
@@ -8536,7 +8536,7 @@ function Hl(t, e) {
8536
8536
  n.external = s;
8537
8537
  for (const u of i._idmap.entries()) {
8538
8538
  const [c, l] = u;
8539
- pt(n, l), a[c] = vt(n, l);
8539
+ vt(n, l), a[c] = yt(n, l);
8540
8540
  }
8541
8541
  if (Object.keys(o).length > 0) {
8542
8542
  const u = n.target === "draft-2020-12" ? "$defs" : "definitions";
@@ -8546,8 +8546,8 @@ function Hl(t, e) {
8546
8546
  }
8547
8547
  return { schemas: a };
8548
8548
  }
8549
- const r = gt({ ...e, processors: Wr });
8550
- return j(t, r), pt(r, t), vt(r, t);
8549
+ const r = pt({ ...e, processors: Wr });
8550
+ return j(t, r), vt(r, t), yt(r, t);
8551
8551
  }
8552
8552
  class yp {
8553
8553
  /** @deprecated Access via ctx instead */
@@ -8583,7 +8583,7 @@ class yp {
8583
8583
  }
8584
8584
  constructor(e) {
8585
8585
  let r = e?.target ?? "draft-2020-12";
8586
- r === "draft-4" && (r = "draft-04"), r === "draft-7" && (r = "draft-07"), this.ctx = gt({
8586
+ r === "draft-4" && (r = "draft-04"), r === "draft-7" && (r = "draft-07"), this.ctx = pt({
8587
8587
  processors: Wr,
8588
8588
  target: r,
8589
8589
  ...e?.metadata && { metadata: e.metadata },
@@ -8604,8 +8604,8 @@ class yp {
8604
8604
  * Must call process() first.
8605
8605
  */
8606
8606
  emit(e, r) {
8607
- r && (r.cycles && (this.ctx.cycles = r.cycles), r.reused && (this.ctx.reused = r.reused), r.external && (this.ctx.external = r.external)), pt(this.ctx, e);
8608
- const i = vt(this.ctx, e), { "~standard": n, ...o } = i;
8607
+ r && (r.cycles && (this.ctx.cycles = r.cycles), r.reused && (this.ctx.reused = r.reused), r.external && (this.ctx.external = r.external)), vt(this.ctx, e);
8608
+ const i = yt(this.ctx, e), { "~standard": n, ...o } = i;
8609
8609
  return o;
8610
8610
  }
8611
8611
  }
@@ -8615,7 +8615,7 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8615
8615
  __proto__: null,
8616
8616
  $ZodAny: Ac,
8617
8617
  $ZodArray: Fc,
8618
- $ZodAsyncError: Ve,
8618
+ $ZodAsyncError: Ye,
8619
8619
  $ZodBase64: Ic,
8620
8620
  $ZodBase64URL: zc,
8621
8621
  $ZodBigInt: vi,
@@ -8626,7 +8626,7 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8626
8626
  $ZodCUID: dc,
8627
8627
  $ZodCUID2: hc,
8628
8628
  $ZodCatch: uu,
8629
- $ZodCheck: M,
8629
+ $ZodCheck: R,
8630
8630
  $ZodCheckBigIntFormat: Zs,
8631
8631
  $ZodCheckEndsWith: Qs,
8632
8632
  $ZodCheckGreaterThan: mi,
@@ -8783,9 +8783,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8783
8783
  _maxSize: Ht,
8784
8784
  _mime: er,
8785
8785
  _min: te,
8786
- _minLength: He,
8787
- _minSize: ft,
8788
- _multipleOf: mt,
8786
+ _minLength: Ke,
8787
+ _minSize: gt,
8788
+ _multipleOf: ft,
8789
8789
  _nan: tl,
8790
8790
  _nanoid: zi,
8791
8791
  _nativeEnum: rp,
@@ -8856,13 +8856,13 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8856
8856
  describe: cl,
8857
8857
  encode: zm,
8858
8858
  encodeAsync: Em,
8859
- extractDefs: pt,
8860
- finalize: vt,
8859
+ extractDefs: vt,
8860
+ finalize: yt,
8861
8861
  flattenError: ei,
8862
8862
  formatError: ti,
8863
8863
  globalConfig: En,
8864
8864
  globalRegistry: he,
8865
- initializeContext: gt,
8865
+ initializeContext: pt,
8866
8866
  isValidBase64: fi,
8867
8867
  isValidBase64URL: kc,
8868
8868
  isValidJWT: Ec,
@@ -8898,9 +8898,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8898
8898
  maxLength: Kt,
8899
8899
  maxSize: Ht,
8900
8900
  mime: er,
8901
- minLength: He,
8902
- minSize: ft,
8903
- multipleOf: mt,
8901
+ minLength: Ke,
8902
+ minSize: gt,
8903
+ multipleOf: ft,
8904
8904
  negative: Fi,
8905
8905
  nonnegative: Wi,
8906
8906
  nonpositive: Bi,
@@ -8991,7 +8991,7 @@ const td = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8991
8991
  ...e.checks ?? [],
8992
8992
  ...r.map((i) => typeof i == "function" ? { _zod: { check: i, def: { check: "custom" }, onattach: [] } } : i)
8993
8993
  ]
8994
- })), t.clone = (r, i) => ae(t, r, i), t.brand = () => t, t.register = ((r, i) => (r.add(t, i), t)), t.parse = (r, i) => rd(t, r, i, { callee: t.parse }), t.safeParse = (r, i) => od(t, r, i), t.parseAsync = async (r, i) => id(t, r, i, { callee: t.parseAsync }), t.safeParseAsync = async (r, i) => ad(t, r, i), t.spa = t.safeParseAsync, t.encode = (r, i) => sd(t, r, i), t.decode = (r, i) => cd(t, r, i), t.encodeAsync = async (r, i) => ud(t, r, i), t.decodeAsync = async (r, i) => ld(t, r, i), t.safeEncode = (r, i) => dd(t, r, i), t.safeDecode = (r, i) => hd(t, r, i), t.safeEncodeAsync = async (r, i) => md(t, r, i), t.safeDecodeAsync = async (r, i) => fd(t, r, i), t.refine = (r, i) => t.check(Ao(r, i)), t.superRefine = (r) => t.check(Mo(r)), t.overwrite = (r) => t.check(Pe(r)), t.optional = () => Mt(t), t.nullable = () => Rt(t), t.nullish = () => Mt(Rt(t)), t.nonoptional = (r) => ko(t, r), t.array = () => ve(t), t.or = (r) => $t([t, r]), t.and = (r) => mo(t, r), t.transform = (r) => Lt(t, Or(r)), t.default = (r) => So(t, r), t.prefault = (r) => Io(t, r), t.catch = (r) => Eo(t, r), t.pipe = (r) => Lt(t, r), t.readonly = () => jo(t), t.describe = (r) => {
8994
+ })), t.clone = (r, i) => ae(t, r, i), t.brand = () => t, t.register = ((r, i) => (r.add(t, i), t)), t.parse = (r, i) => rd(t, r, i, { callee: t.parse }), t.safeParse = (r, i) => od(t, r, i), t.parseAsync = async (r, i) => id(t, r, i, { callee: t.parseAsync }), t.safeParseAsync = async (r, i) => ad(t, r, i), t.spa = t.safeParseAsync, t.encode = (r, i) => sd(t, r, i), t.decode = (r, i) => cd(t, r, i), t.encodeAsync = async (r, i) => ud(t, r, i), t.decodeAsync = async (r, i) => ld(t, r, i), t.safeEncode = (r, i) => dd(t, r, i), t.safeDecode = (r, i) => hd(t, r, i), t.safeEncodeAsync = async (r, i) => md(t, r, i), t.safeDecodeAsync = async (r, i) => fd(t, r, i), t.refine = (r, i) => t.check(Ao(r, i)), t.superRefine = (r) => t.check(Mo(r)), t.overwrite = (r) => t.check(Pe(r)), t.optional = () => Mt(t), t.nullable = () => Rt(t), t.nullish = () => Mt(Rt(t)), t.nonoptional = (r) => ko(t, r), t.array = () => ve(t), t.or = (r) => wt([t, r]), t.and = (r) => mo(t, r), t.transform = (r) => Lt(t, Or(r)), t.default = (r) => So(t, r), t.prefault = (r) => Io(t, r), t.catch = (r) => Eo(t, r), t.pipe = (r) => Lt(t, r), t.readonly = () => jo(t), t.describe = (r) => {
8995
8995
  const i = t.clone();
8996
8996
  return he.add(i, { description: r }), i;
8997
8997
  }, Object.defineProperty(t, "description", {
@@ -9007,7 +9007,7 @@ const td = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9007
9007
  }, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), ar = /* @__PURE__ */ h("_ZodString", (t, e) => {
9008
9008
  Yt.init(t, e), k.init(t, e), t._zod.processJSONSchema = (i, n, o) => hl(t, i, n);
9009
9009
  const r = t._zod.bag;
9010
- t.format = r.format ?? null, t.minLength = r.minimum ?? null, t.maxLength = r.maximum ?? null, t.regex = (...i) => t.check(Vn(...i)), t.includes = (...i) => t.check(Kn(...i)), t.startsWith = (...i) => t.check(qn(...i)), t.endsWith = (...i) => t.check(Qn(...i)), t.min = (...i) => t.check(He(...i)), t.max = (...i) => t.check(Kt(...i)), t.length = (...i) => t.check(qt(...i)), t.nonempty = (...i) => t.check(He(1, ...i)), t.lowercase = (i) => t.check(Yn(i)), t.uppercase = (i) => t.check(Hn(i)), t.trim = () => t.check(nr()), t.normalize = (...i) => t.check(tr(...i)), t.toLowerCase = () => t.check(rr()), t.toUpperCase = () => t.check(ir()), t.slugify = () => t.check(or());
9010
+ t.format = r.format ?? null, t.minLength = r.minimum ?? null, t.maxLength = r.maximum ?? null, t.regex = (...i) => t.check(Vn(...i)), t.includes = (...i) => t.check(Kn(...i)), t.startsWith = (...i) => t.check(qn(...i)), t.endsWith = (...i) => t.check(Qn(...i)), t.min = (...i) => t.check(Ke(...i)), t.max = (...i) => t.check(Kt(...i)), t.length = (...i) => t.check(qt(...i)), t.nonempty = (...i) => t.check(Ke(1, ...i)), t.lowercase = (i) => t.check(Yn(i)), t.uppercase = (i) => t.check(Hn(i)), t.trim = () => t.check(nr()), t.normalize = (...i) => t.check(tr(...i)), t.toLowerCase = () => t.check(rr()), t.toUpperCase = () => t.check(ir()), t.slugify = () => t.check(or());
9011
9011
  }), en = /* @__PURE__ */ h("ZodString", (t, e) => {
9012
9012
  Yt.init(t, e), ar.init(t, e), t.email = (r) => t.check($i(sr, r)), t.url = (r) => t.check(Xn(tn, r)), t.jwt = (r) => t.check(Li(wr, r)), t.emoji = (r) => t.check(ki(cr, r)), t.guid = (r) => t.check(Un(At, r)), t.uuid = (r) => t.check(wi(pe, r)), t.uuidv4 = (r) => t.check(Si(pe, r)), t.uuidv6 = (r) => t.check(xi(pe, r)), t.uuidv7 = (r) => t.check(Ii(pe, r)), t.nanoid = (r) => t.check(zi(ur, r)), t.guid = (r) => t.check(Un(At, r)), t.cuid = (r) => t.check(Oi(lr, r)), t.cuid2 = (r) => t.check(Ei(dr, r)), t.ulid = (r) => t.check(Ti(hr, r)), t.base64 = (r) => t.check(Ai(br, r)), t.base64url = (r) => t.check(Mi(_r, r)), t.xid = (r) => t.check(Pi(mr, r)), t.ksuid = (r) => t.check(ji(fr, r)), t.ipv4 = (r) => t.check(Ui(gr, r)), t.ipv6 = (r) => t.check(Ni(pr, r)), t.cidrv4 = (r) => t.check(Ci(vr, r)), t.cidrv6 = (r) => t.check(Di(yr, r)), t.e164 = (r) => t.check(Ri($r, r)), t.datetime = (r) => t.check(Kl(r)), t.date = (r) => t.check(ql(r)), t.time = (r) => t.check(Ql(r)), t.duration = (r) => t.check(ed(r));
9013
9013
  });
@@ -9152,49 +9152,49 @@ const wr = /* @__PURE__ */ h("ZodJWT", (t, e) => {
9152
9152
  function Md(t) {
9153
9153
  return Li(wr, t);
9154
9154
  }
9155
- const _t = /* @__PURE__ */ h("ZodCustomStringFormat", (t, e) => {
9155
+ const $t = /* @__PURE__ */ h("ZodCustomStringFormat", (t, e) => {
9156
9156
  Pc.init(t, e), N.init(t, e);
9157
9157
  });
9158
9158
  function Rd(t, e, r = {}) {
9159
- return Qt(_t, t, e, r);
9159
+ return Qt($t, t, e, r);
9160
9160
  }
9161
9161
  function Ld(t) {
9162
- return Qt(_t, "hostname", _s, t);
9162
+ return Qt($t, "hostname", _s, t);
9163
9163
  }
9164
9164
  function Zd(t) {
9165
- return Qt(_t, "hex", As, t);
9165
+ return Qt($t, "hex", As, t);
9166
9166
  }
9167
9167
  function Fd(t, e) {
9168
9168
  const r = e?.enc ?? "hex", i = `${t}_${r}`, n = di[i];
9169
9169
  if (!n)
9170
9170
  throw new Error(`Unrecognized hash format: ${i}`);
9171
- return Qt(_t, i, n, e);
9171
+ return Qt($t, i, n, e);
9172
9172
  }
9173
9173
  const nn = /* @__PURE__ */ h("ZodNumber", (t, e) => {
9174
- gi.init(t, e), k.init(t, e), t._zod.processJSONSchema = (i, n, o) => ml(t, i, n), t.gt = (i, n) => t.check(Re(i, n)), t.gte = (i, n) => t.check(te(i, n)), t.min = (i, n) => t.check(te(i, n)), t.lt = (i, n) => t.check(Me(i, n)), t.lte = (i, n) => t.check(ie(i, n)), t.max = (i, n) => t.check(ie(i, n)), t.int = (i) => t.check(Nn(i)), t.safe = (i) => t.check(Nn(i)), t.positive = (i) => t.check(Re(0, i)), t.nonnegative = (i) => t.check(te(0, i)), t.negative = (i) => t.check(Me(0, i)), t.nonpositive = (i) => t.check(ie(0, i)), t.multipleOf = (i, n) => t.check(mt(i, n)), t.step = (i, n) => t.check(mt(i, n)), t.finite = () => t;
9174
+ gi.init(t, e), k.init(t, e), t._zod.processJSONSchema = (i, n, o) => ml(t, i, n), t.gt = (i, n) => t.check(Re(i, n)), t.gte = (i, n) => t.check(te(i, n)), t.min = (i, n) => t.check(te(i, n)), t.lt = (i, n) => t.check(Me(i, n)), t.lte = (i, n) => t.check(ie(i, n)), t.max = (i, n) => t.check(ie(i, n)), t.int = (i) => t.check(Nn(i)), t.safe = (i) => t.check(Nn(i)), t.positive = (i) => t.check(Re(0, i)), t.nonnegative = (i) => t.check(te(0, i)), t.negative = (i) => t.check(Me(0, i)), t.nonpositive = (i) => t.check(ie(0, i)), t.multipleOf = (i, n) => t.check(ft(i, n)), t.step = (i, n) => t.check(ft(i, n)), t.finite = () => t;
9175
9175
  const r = t._zod.bag;
9176
9176
  t.minValue = Math.max(r.minimum ?? Number.NEGATIVE_INFINITY, r.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, t.maxValue = Math.min(r.maximum ?? Number.POSITIVE_INFINITY, r.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, t.isInt = (r.format ?? "").includes("int") || Number.isSafeInteger(r.multipleOf ?? 0.5), t.isFinite = !0, t.format = r.format ?? null;
9177
9177
  });
9178
9178
  function z(t) {
9179
9179
  return Uu(nn, t);
9180
9180
  }
9181
- const et = /* @__PURE__ */ h("ZodNumberFormat", (t, e) => {
9181
+ const tt = /* @__PURE__ */ h("ZodNumberFormat", (t, e) => {
9182
9182
  jc.init(t, e), nn.init(t, e);
9183
9183
  });
9184
9184
  function Nn(t) {
9185
- return Cu(et, t);
9185
+ return Cu(tt, t);
9186
9186
  }
9187
9187
  function Bd(t) {
9188
- return Du(et, t);
9188
+ return Du(tt, t);
9189
9189
  }
9190
9190
  function Wd(t) {
9191
- return Au(et, t);
9191
+ return Au(tt, t);
9192
9192
  }
9193
9193
  function Gd(t) {
9194
- return Mu(et, t);
9194
+ return Mu(tt, t);
9195
9195
  }
9196
9196
  function Xd(t) {
9197
- return Ru(et, t);
9197
+ return Ru(tt, t);
9198
9198
  }
9199
9199
  const rn = /* @__PURE__ */ h("ZodBoolean", (t, e) => {
9200
9200
  pi.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => fl(t, r, i);
@@ -9203,7 +9203,7 @@ function qi(t) {
9203
9203
  return Lu(rn, t);
9204
9204
  }
9205
9205
  const on = /* @__PURE__ */ h("ZodBigInt", (t, e) => {
9206
- vi.init(t, e), k.init(t, e), t._zod.processJSONSchema = (i, n, o) => gl(t, i), t.gte = (i, n) => t.check(te(i, n)), t.min = (i, n) => t.check(te(i, n)), t.gt = (i, n) => t.check(Re(i, n)), t.gte = (i, n) => t.check(te(i, n)), t.min = (i, n) => t.check(te(i, n)), t.lt = (i, n) => t.check(Me(i, n)), t.lte = (i, n) => t.check(ie(i, n)), t.max = (i, n) => t.check(ie(i, n)), t.positive = (i) => t.check(Re(BigInt(0), i)), t.negative = (i) => t.check(Me(BigInt(0), i)), t.nonpositive = (i) => t.check(ie(BigInt(0), i)), t.nonnegative = (i) => t.check(te(BigInt(0), i)), t.multipleOf = (i, n) => t.check(mt(i, n));
9206
+ vi.init(t, e), k.init(t, e), t._zod.processJSONSchema = (i, n, o) => gl(t, i), t.gte = (i, n) => t.check(te(i, n)), t.min = (i, n) => t.check(te(i, n)), t.gt = (i, n) => t.check(Re(i, n)), t.gte = (i, n) => t.check(te(i, n)), t.min = (i, n) => t.check(te(i, n)), t.lt = (i, n) => t.check(Me(i, n)), t.lte = (i, n) => t.check(ie(i, n)), t.max = (i, n) => t.check(ie(i, n)), t.positive = (i) => t.check(Re(BigInt(0), i)), t.negative = (i) => t.check(Me(BigInt(0), i)), t.nonpositive = (i) => t.check(ie(BigInt(0), i)), t.nonnegative = (i) => t.check(te(BigInt(0), i)), t.multipleOf = (i, n) => t.check(ft(i, n));
9207
9207
  const r = t._zod.bag;
9208
9208
  t.minValue = r.minimum ?? null, t.maxValue = r.maximum ?? null, t.format = r.format ?? null;
9209
9209
  });
@@ -9246,7 +9246,7 @@ function qd() {
9246
9246
  const io = /* @__PURE__ */ h("ZodUnknown", (t, e) => {
9247
9247
  Mc.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => wl();
9248
9248
  });
9249
- function Ke() {
9249
+ function qe() {
9250
9250
  return Hu(io);
9251
9251
  }
9252
9252
  const oo = /* @__PURE__ */ h("ZodNever", (t, e) => {
@@ -9270,7 +9270,7 @@ function eh(t) {
9270
9270
  return Qu(Ir, t);
9271
9271
  }
9272
9272
  const so = /* @__PURE__ */ h("ZodArray", (t, e) => {
9273
- Fc.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Cl(t, r, i, n), t.element = e.element, t.min = (r, i) => t.check(He(r, i)), t.nonempty = (r) => t.check(He(1, r)), t.max = (r, i) => t.check(Kt(r, i)), t.length = (r, i) => t.check(qt(r, i)), t.unwrap = () => t.element;
9273
+ Fc.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Cl(t, r, i, n), t.element = e.element, t.min = (r, i) => t.check(Ke(r, i)), t.nonempty = (r) => t.check(Ke(1, r)), t.max = (r, i) => t.check(Kt(r, i)), t.length = (r, i) => t.check(qt(r, i)), t.unwrap = () => t.element;
9274
9274
  });
9275
9275
  function ve(t, e) {
9276
9276
  return nl(so, t, e);
@@ -9280,7 +9280,7 @@ function th(t) {
9280
9280
  return zr(Object.keys(e));
9281
9281
  }
9282
9282
  const an = /* @__PURE__ */ h("ZodObject", (t, e) => {
9283
- Xc.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Dl(t, r, i, n), O(t, "shape", () => e.shape), t.keyof = () => zr(Object.keys(t._zod.def.shape)), t.catchall = (r) => t.clone({ ...t._zod.def, catchall: r }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: Ke() }), t.loose = () => t.clone({ ...t._zod.def, catchall: Ke() }), t.strict = () => t.clone({ ...t._zod.def, catchall: xr() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (r) => Ba(t, r), t.safeExtend = (r) => Wa(t, r), t.merge = (r) => Ga(t, r), t.pick = (r) => Za(t, r), t.omit = (r) => Fa(t, r), t.partial = (...r) => Xa(Er, t, r[0]), t.required = (...r) => Ja(Tr, t, r[0]);
9283
+ Xc.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Dl(t, r, i, n), O(t, "shape", () => e.shape), t.keyof = () => zr(Object.keys(t._zod.def.shape)), t.catchall = (r) => t.clone({ ...t._zod.def, catchall: r }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: qe() }), t.loose = () => t.clone({ ...t._zod.def, catchall: qe() }), t.strict = () => t.clone({ ...t._zod.def, catchall: xr() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (r) => Ba(t, r), t.safeExtend = (r) => Wa(t, r), t.merge = (r) => Ga(t, r), t.pick = (r) => Za(t, r), t.omit = (r) => Fa(t, r), t.partial = (...r) => Xa(Er, t, r[0]), t.required = (...r) => Ja(Tr, t, r[0]);
9284
9284
  });
9285
9285
  function me(t, e) {
9286
9286
  const r = {
@@ -9302,14 +9302,14 @@ function rh(t, e) {
9302
9302
  return new an({
9303
9303
  type: "object",
9304
9304
  shape: t,
9305
- catchall: Ke(),
9305
+ catchall: qe(),
9306
9306
  ...p(e)
9307
9307
  });
9308
9308
  }
9309
9309
  const sn = /* @__PURE__ */ h("ZodUnion", (t, e) => {
9310
9310
  Gn.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Xi(t, r, i, n), t.options = e.options;
9311
9311
  });
9312
- function $t(t, e) {
9312
+ function wt(t, e) {
9313
9313
  return new sn({
9314
9314
  type: "union",
9315
9315
  options: t,
@@ -9404,7 +9404,7 @@ function sh(t, e, r) {
9404
9404
  });
9405
9405
  }
9406
9406
  const vo = /* @__PURE__ */ h("ZodSet", (t, e) => {
9407
- qc.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Nl(t, r), t.min = (...r) => t.check(ft(...r)), t.nonempty = (r) => t.check(ft(1, r)), t.max = (...r) => t.check(Ht(...r)), t.size = (...r) => t.check(Jn(...r));
9407
+ qc.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Nl(t, r), t.min = (...r) => t.check(gt(...r)), t.nonempty = (r) => t.check(gt(1, r)), t.max = (...r) => t.check(Ht(...r)), t.size = (...r) => t.check(Jn(...r));
9408
9408
  });
9409
9409
  function ch(t, e) {
9410
9410
  return new vo({
@@ -9413,7 +9413,7 @@ function ch(t, e) {
9413
9413
  ...p(e)
9414
9414
  });
9415
9415
  }
9416
- const yt = /* @__PURE__ */ h("ZodEnum", (t, e) => {
9416
+ const bt = /* @__PURE__ */ h("ZodEnum", (t, e) => {
9417
9417
  Qc.init(t, e), k.init(t, e), t._zod.processJSONSchema = (i, n, o) => xl(t, i, n), t.enum = e.entries, t.options = Object.values(e.entries);
9418
9418
  const r = new Set(Object.keys(e.entries));
9419
9419
  t.extract = (i, n) => {
@@ -9423,7 +9423,7 @@ const yt = /* @__PURE__ */ h("ZodEnum", (t, e) => {
9423
9423
  o[a] = e.entries[a];
9424
9424
  else
9425
9425
  throw new Error(`Key ${a} not found in enum`);
9426
- return new yt({
9426
+ return new bt({
9427
9427
  ...e,
9428
9428
  checks: [],
9429
9429
  ...p(n),
@@ -9436,7 +9436,7 @@ const yt = /* @__PURE__ */ h("ZodEnum", (t, e) => {
9436
9436
  delete o[a];
9437
9437
  else
9438
9438
  throw new Error(`Key ${a} not found in enum`);
9439
- return new yt({
9439
+ return new bt({
9440
9440
  ...e,
9441
9441
  checks: [],
9442
9442
  ...p(n),
@@ -9446,14 +9446,14 @@ const yt = /* @__PURE__ */ h("ZodEnum", (t, e) => {
9446
9446
  });
9447
9447
  function zr(t, e) {
9448
9448
  const r = Array.isArray(t) ? Object.fromEntries(t.map((i) => [i, i])) : t;
9449
- return new yt({
9449
+ return new bt({
9450
9450
  type: "enum",
9451
9451
  entries: r,
9452
9452
  ...p(e)
9453
9453
  });
9454
9454
  }
9455
9455
  function uh(t, e) {
9456
- return new yt({
9456
+ return new bt({
9457
9457
  type: "enum",
9458
9458
  entries: t,
9459
9459
  ...p(e)
@@ -9468,7 +9468,7 @@ const yo = /* @__PURE__ */ h("ZodLiteral", (t, e) => {
9468
9468
  }
9469
9469
  });
9470
9470
  });
9471
- function We(t, e) {
9471
+ function Ge(t, e) {
9472
9472
  return new yo({
9473
9473
  type: "literal",
9474
9474
  values: Array.isArray(t) ? t : [t],
@@ -9476,7 +9476,7 @@ function We(t, e) {
9476
9476
  });
9477
9477
  }
9478
9478
  const bo = /* @__PURE__ */ h("ZodFile", (t, e) => {
9479
- tu.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Ol(t, r, i), t.min = (r, i) => t.check(ft(r, i)), t.max = (r, i) => t.check(Ht(r, i)), t.mime = (r, i) => t.check(er(Array.isArray(r) ? r : [r], i));
9479
+ tu.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Ol(t, r, i), t.min = (r, i) => t.check(gt(r, i)), t.max = (r, i) => t.check(Ht(r, i)), t.mime = (r, i) => t.check(er(Array.isArray(r) ? r : [r], i));
9480
9480
  });
9481
9481
  function lh(t) {
9482
9482
  return rl(bo, t);
@@ -9487,10 +9487,10 @@ const _o = /* @__PURE__ */ h("ZodTransform", (t, e) => {
9487
9487
  throw new Ln(t.constructor.name);
9488
9488
  r.addIssue = (o) => {
9489
9489
  if (typeof o == "string")
9490
- r.issues.push(dt(o, r.value, e));
9490
+ r.issues.push(ht(o, r.value, e));
9491
9491
  else {
9492
9492
  const a = o;
9493
- a.fatal && (a.continue = !1), a.code ?? (a.code = "custom"), a.input ?? (a.input = r.value), a.inst ?? (a.inst = t), r.issues.push(dt(a));
9493
+ a.fatal && (a.continue = !1), a.code ?? (a.code = "custom"), a.input ?? (a.input = r.value), a.inst ?? (a.inst = t), r.issues.push(ht(a));
9494
9494
  }
9495
9495
  };
9496
9496
  const n = e.transform(r.value, r);
@@ -9649,15 +9649,15 @@ const Do = /* @__PURE__ */ h("ZodFunction", (t, e) => {
9649
9649
  function Cn(t) {
9650
9650
  return new Do({
9651
9651
  type: "function",
9652
- input: Array.isArray(t?.input) ? kr(t?.input) : t?.input ?? ve(Ke()),
9653
- output: t?.output ?? Ke()
9652
+ input: Array.isArray(t?.input) ? kr(t?.input) : t?.input ?? ve(qe()),
9653
+ output: t?.output ?? qe()
9654
9654
  });
9655
9655
  }
9656
9656
  const un = /* @__PURE__ */ h("ZodCustom", (t, e) => {
9657
9657
  vu.init(t, e), k.init(t, e), t._zod.processJSONSchema = (r, i, n) => Tl(t, r);
9658
9658
  });
9659
9659
  function vh(t) {
9660
- const e = new M({
9660
+ const e = new R({
9661
9661
  check: "custom"
9662
9662
  // ...util.normalizeParams(params),
9663
9663
  });
@@ -9691,7 +9691,7 @@ const wh = (...t) => ll({
9691
9691
  String: en
9692
9692
  }, ...t);
9693
9693
  function Sh(t) {
9694
- const e = Ur(() => $t([De(t), z(), qi(), no(), ve(e), go(De(), e)]));
9694
+ const e = Ur(() => wt([De(t), z(), qi(), no(), ve(e), go(De(), e)]));
9695
9695
  return e;
9696
9696
  }
9697
9697
  function xh(t, e) {
@@ -9713,14 +9713,14 @@ const Sp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9713
9713
  ZodCatch: Oo,
9714
9714
  ZodCodec: jr,
9715
9715
  ZodCustom: un,
9716
- ZodCustomStringFormat: _t,
9716
+ ZodCustomStringFormat: $t,
9717
9717
  ZodDate: Ir,
9718
9718
  ZodDefault: wo,
9719
9719
  ZodDiscriminatedUnion: uo,
9720
9720
  ZodE164: $r,
9721
9721
  ZodEmail: sr,
9722
9722
  ZodEmoji: cr,
9723
- ZodEnum: yt,
9723
+ ZodEnum: bt,
9724
9724
  ZodFile: bo,
9725
9725
  ZodFunction: Do,
9726
9726
  ZodGUID: At,
@@ -9740,7 +9740,7 @@ const Sp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9740
9740
  ZodNull: to,
9741
9741
  ZodNullable: $o,
9742
9742
  ZodNumber: nn,
9743
- ZodNumberFormat: et,
9743
+ ZodNumberFormat: tt,
9744
9744
  ZodObject: an,
9745
9745
  ZodOptional: Er,
9746
9746
  ZodPipe: Pr,
@@ -9811,7 +9811,7 @@ const Sp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9811
9811
  keyof: th,
9812
9812
  ksuid: Ed,
9813
9813
  lazy: Ur,
9814
- literal: We,
9814
+ literal: Ge,
9815
9815
  looseObject: rh,
9816
9816
  looseRecord: ah,
9817
9817
  mac: Pd,
@@ -9851,8 +9851,8 @@ const Sp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9851
9851
  uint64: Yd,
9852
9852
  ulid: zd,
9853
9853
  undefined: Kd,
9854
- union: $t,
9855
- unknown: Ke,
9854
+ union: wt,
9855
+ unknown: qe,
9856
9856
  url: $d,
9857
9857
  uuid: vd,
9858
9858
  uuidv4: yd,
@@ -10128,14 +10128,14 @@ const we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10128
10128
  ZodCatch: Oo,
10129
10129
  ZodCodec: jr,
10130
10130
  ZodCustom: un,
10131
- ZodCustomStringFormat: _t,
10131
+ ZodCustomStringFormat: $t,
10132
10132
  ZodDate: Ir,
10133
10133
  ZodDefault: wo,
10134
10134
  ZodDiscriminatedUnion: uo,
10135
10135
  ZodE164: $r,
10136
10136
  ZodEmail: sr,
10137
10137
  ZodEmoji: cr,
10138
- ZodEnum: yt,
10138
+ ZodEnum: bt,
10139
10139
  ZodError: wp,
10140
10140
  ZodFile: bo,
10141
10141
  get ZodFirstPartyTypeKind() {
@@ -10164,7 +10164,7 @@ const we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10164
10164
  ZodNull: to,
10165
10165
  ZodNullable: $o,
10166
10166
  ZodNumber: nn,
10167
- ZodNumberFormat: et,
10167
+ ZodNumberFormat: tt,
10168
10168
  ZodObject: an,
10169
10169
  ZodOptional: Er,
10170
10170
  ZodPipe: Pr,
@@ -10255,7 +10255,7 @@ const we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10255
10255
  ksuid: Ed,
10256
10256
  lazy: Ur,
10257
10257
  length: qt,
10258
- literal: We,
10258
+ literal: Ge,
10259
10259
  locales: $u,
10260
10260
  looseObject: rh,
10261
10261
  looseRecord: ah,
@@ -10268,9 +10268,9 @@ const we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10268
10268
  maxSize: Ht,
10269
10269
  meta: _h,
10270
10270
  mime: er,
10271
- minLength: He,
10272
- minSize: ft,
10273
- multipleOf: mt,
10271
+ minLength: Ke,
10272
+ minSize: gt,
10273
+ multipleOf: ft,
10274
10274
  nan: mh,
10275
10275
  nanoid: xd,
10276
10276
  nativeEnum: uh,
@@ -10333,8 +10333,8 @@ const we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10333
10333
  uint64: Yd,
10334
10334
  ulid: zd,
10335
10335
  undefined: Kd,
10336
- union: $t,
10337
- unknown: Ke,
10336
+ union: wt,
10337
+ unknown: qe,
10338
10338
  uppercase: Hn,
10339
10339
  url: $d,
10340
10340
  util: Ha,
@@ -10396,7 +10396,7 @@ function Lp(t) {
10396
10396
  return r.remove(), n;
10397
10397
  }
10398
10398
  async function zh(t, e, r, i, n = !0) {
10399
- const o = await navigator.clipboard.read(), a = o[0].types, [s, u] = n ? [t, e] : Fe(t, e, r);
10399
+ const o = await navigator.clipboard.read(), a = o[0].types, [s, u] = n ? [t, e] : Be(t, e, r);
10400
10400
  for (const c of a) {
10401
10401
  if (!Mp.find(
10402
10402
  (f) => f.endsWith("/") ? c.startsWith(f) : c === f
@@ -10418,15 +10418,15 @@ async function zh(t, e, r, i, n = !0) {
10418
10418
  }
10419
10419
  const P = w.data;
10420
10420
  if (P.elements.length === 0) return;
10421
- let R = 1 / 0, C = 1 / 0;
10421
+ let L = 1 / 0, A = 1 / 0;
10422
10422
  for (const S of P.elements)
10423
- S.x < R && (R = S.x), S.y < C && (C = S.y);
10423
+ S.x < L && (L = S.x), S.y < A && (A = S.y);
10424
10424
  const E = await Promise.all(
10425
10425
  P.elements.map(
10426
10426
  (S) => r.addImageToCanvas(
10427
10427
  S.src,
10428
- s + S.x - R,
10429
- u + S.y - C,
10428
+ s + S.x - L,
10429
+ u + S.y - A,
10430
10430
  S.sx,
10431
10431
  S.sy
10432
10432
  )
@@ -10476,10 +10476,10 @@ const ke = {
10476
10476
  }, ze = {
10477
10477
  Save: "save",
10478
10478
  Change: "statechange"
10479
- }, nt = {
10479
+ }, rt = {
10480
10480
  start: "startloading",
10481
10481
  done: "completeloading"
10482
- }, rt = {
10482
+ }, it = {
10483
10483
  Save: "save",
10484
10484
  SaveCompleted: "savecompleted",
10485
10485
  SaveFailed: "savefailed"
@@ -10646,7 +10646,7 @@ class la {
10646
10646
  this.width = (n - i) / this.target.sx * e, this.height = (a - o) / this.target.sy * r;
10647
10647
  }
10648
10648
  getSidesInScreenSpace(e, r) {
10649
- const [i, n] = r ? Je(r) : [1, 1], { width: o, height: a, borderSize: s } = this, [u, c] = le(r), [l, d] = kt(r);
10649
+ const [i, n] = r ? Ve(r) : [1, 1], { width: o, height: a, borderSize: s } = this, [u, c] = le(r), [l, d] = kt(r);
10650
10650
  return {
10651
10651
  TOP: {
10652
10652
  x: l > 0 ? u : u - o * i,
@@ -10675,7 +10675,7 @@ class la {
10675
10675
  }[e];
10676
10676
  }
10677
10677
  getCornersInScreenSpace(e, r) {
10678
- const [i, n] = r ? Je(r) : [1, 1], { width: o, height: a, boxSize: s } = this, [u, c] = le(r), [l, d] = kt(r);
10678
+ const [i, n] = r ? Ve(r) : [1, 1], { width: o, height: a, boxSize: s } = this, [u, c] = le(r), [l, d] = kt(r);
10679
10679
  return {
10680
10680
  TOPLEFT: {
10681
10681
  x: u - s,
@@ -10717,7 +10717,7 @@ class la {
10717
10717
  */
10718
10718
  hitTest(e, r, i) {
10719
10719
  if (this.mode === ce.PASSIVE) return;
10720
- const [n, o] = Je(this.target.worldMatrix), [a, s] = kt(this.target.worldMatrix), [u, c] = le(i, e, r), l = 4;
10720
+ const [n, o] = Ve(this.target.worldMatrix), [a, s] = kt(this.target.worldMatrix), [u, c] = le(i, e, r), l = 4;
10721
10721
  for (const E of yn) {
10722
10722
  const S = this.getCornersInScreenSpace(
10723
10723
  E,
@@ -10731,8 +10731,8 @@ class la {
10731
10731
  if (u >= S.x - l && u <= S.x + S.width + l && c >= S.y - l && c <= S.y + S.height + l)
10732
10732
  return E;
10733
10733
  }
10734
- const [d, m] = le(this.target.worldMatrix), f = this.width * n * a, $ = this.height * o * s, w = Math.min(d, d + f), P = Math.max(d, d + f), R = Math.min(m, m + $), C = Math.max(m, m + $);
10735
- if (u >= w && u <= P && c >= R && c <= C)
10734
+ const [d, m] = le(this.target.worldMatrix), f = this.width * n * a, $ = this.height * o * s, w = Math.min(d, d + f), P = Math.max(d, d + f), L = Math.min(m, m + $), A = Math.max(m, m + $);
10735
+ if (u >= w && u <= P && c >= L && c <= A)
10736
10736
  return "CENTER";
10737
10737
  }
10738
10738
  update() {
@@ -10758,20 +10758,20 @@ class la {
10758
10758
  if (this.target instanceof Ae) {
10759
10759
  const n = Math.abs(this.width), o = Math.abs(this.height), a = n / o, s = this.target.sx, u = this.target.sy, c = 1e-6, l = Math.abs(n * s) < c ? c * kn(n * s || 1, c) : n * s, d = Math.abs(o * u) < c ? c * kn(o * u || 1, c) : o * u, m = e / l, f = r / d, $ = c, w = i === "LEFT" || i === "BOTTOMLEFT" || i === "TOPLEFT" ? 1 - m : i === "RIGHT" || i === "BOTTOMRIGHT" || i === "TOPRIGHT" ? 1 + m : i === "TOP" ? 1 - f : 1 + f;
10760
10760
  if (zn(s, w, $) || zn(u, w, $)) return;
10761
- const P = n * s * w, R = o * u * w;
10762
- if (Math.abs(P) < $ || Math.abs(R) < $) return;
10761
+ const P = n * s * w, L = o * u * w;
10762
+ if (Math.abs(P) < $ || Math.abs(L) < $) return;
10763
10763
  if (this.target.updateScale(w, w), i === "LEFT") {
10764
- const C = o * u, E = o * this.target.sy;
10765
- this.target.updateTranslation(e, (C - E) / 2);
10764
+ const A = o * u, E = o * this.target.sy;
10765
+ this.target.updateTranslation(e, (A - E) / 2);
10766
10766
  } else if (i === "RIGHT") {
10767
- const C = o * u, E = o * this.target.sy;
10768
- this.target.updateTranslation(0, (C - E) / 2);
10767
+ const A = o * u, E = o * this.target.sy;
10768
+ this.target.updateTranslation(0, (A - E) / 2);
10769
10769
  } else if (i === "TOP") {
10770
- const C = n * s, E = n * this.target.sx;
10771
- this.target.updateTranslation((C - E) / 2, r);
10770
+ const A = n * s, E = n * this.target.sx;
10771
+ this.target.updateTranslation((A - E) / 2, r);
10772
10772
  } else if (i === "BOTTOM") {
10773
- const C = n * s, E = n * this.target.sx;
10774
- this.target.updateTranslation((C - E) / 2, 0);
10773
+ const A = n * s, E = n * this.target.sx;
10774
+ this.target.updateTranslation((A - E) / 2, 0);
10775
10775
  } else i === "BOTTOMLEFT" ? this.target.updateTranslation(e, 0) : i === "TOPLEFT" ? this.target.updateTranslation(
10776
10776
  e,
10777
10777
  e / a * Math.sign(this.target.sx)
@@ -10803,7 +10803,7 @@ class la {
10803
10803
  const r = new Ae(
10804
10804
  this.getCornersInScreenSpace(e, this.target.worldMatrix)
10805
10805
  );
10806
- r.color = this.mode === ce.ACTIVE ? at : hn, this.corners.set(e, r);
10806
+ r.color = this.mode === ce.ACTIVE ? st : hn, this.corners.set(e, r);
10807
10807
  }
10808
10808
  }
10809
10809
  removeCorners() {
@@ -10815,7 +10815,7 @@ class la {
10815
10815
  e,
10816
10816
  this.target.worldMatrix
10817
10817
  ), i = this.corners.get(e);
10818
- i && (i.setTranslation(r.x, r.y), i.width = r.width, i.height = r.height, i.color = this.mode === ce.ACTIVE ? at : hn);
10818
+ i && (i.setTranslation(r.x, r.y), i.width = r.width, i.height = r.height, i.color = this.mode === ce.ACTIVE ? st : hn);
10819
10819
  }
10820
10820
  }
10821
10821
  addSides() {
@@ -10823,13 +10823,13 @@ class la {
10823
10823
  const r = new Ae(
10824
10824
  this.getSidesInScreenSpace(e, this.target.worldMatrix)
10825
10825
  );
10826
- r.color = this.mode === ce.ACTIVE ? at : hn, this.sides.set(e, r);
10826
+ r.color = this.mode === ce.ACTIVE ? st : hn, this.sides.set(e, r);
10827
10827
  }
10828
10828
  }
10829
10829
  updateSides() {
10830
10830
  for (const e of Nt) {
10831
10831
  const r = this.getSidesInScreenSpace(e, this.target.worldMatrix), i = this.sides.get(e);
10832
- i && (i.setTranslation(r.x, r.y), i.width = r.width, i.height = r.height, i.color = this.mode === ce.ACTIVE ? at : hn);
10832
+ i && (i.setTranslation(r.x, r.y), i.width = r.width, i.height = r.height, i.color = this.mode === ce.ACTIVE ? st : hn);
10833
10833
  }
10834
10834
  }
10835
10835
  }
@@ -10866,18 +10866,18 @@ class Jp {
10866
10866
  }
10867
10867
  // dx and dy are in world units
10868
10868
  resize(e, r, i, n) {
10869
- const o = this.width, a = this.height, s = i.includes("TOP"), u = i.includes("BOTTOM"), c = i.includes("LEFT"), l = i.includes("RIGHT"), d = c ? this.x + o : l ? this.x : this.x + o / 2, m = s ? this.y + a : u ? this.y : this.y + a / 2, f = 1e-6, $ = Math.abs(o) < f ? o < 0 ? -f : f : o, w = Math.abs(a) < f ? a < 0 ? -f : f : a, [P, R] = Je(n), C = e * P / $, E = r * R / w, S = i.includes("LEFT") ? 1 - C : i.includes("RIGHT") ? 1 + C : i === "TOP" ? 1 - E : 1 + E;
10869
+ const o = this.width, a = this.height, s = i.includes("TOP"), u = i.includes("BOTTOM"), c = i.includes("LEFT"), l = i.includes("RIGHT"), d = c ? this.x + o : l ? this.x : this.x + o / 2, m = s ? this.y + a : u ? this.y : this.y + a / 2, f = 1e-6, $ = Math.abs(o) < f ? o < 0 ? -f : f : o, w = Math.abs(a) < f ? a < 0 ? -f : f : a, [P, L] = Ve(n), A = e * P / $, E = r * L / w, S = i.includes("LEFT") ? 1 - A : i.includes("RIGHT") ? 1 + A : i === "TOP" ? 1 - E : 1 + E;
10870
10870
  if (zn(this.scale[0], S, f) || zn(this.scale[1], S, f))
10871
10871
  return;
10872
- const se = o * S, wt = a * S;
10873
- if (!(Math.abs(se) < f || Math.abs(wt) < f))
10872
+ const se = o * S, St = a * S;
10873
+ if (!(Math.abs(se) < f || Math.abs(St) < f))
10874
10874
  for (const J of this.targets) {
10875
- const je = J.x, Ze = J.y, [ln, dn] = le(n, je, Ze), tt = d + (ln - d) * S, Rh = m + (dn - m) * S, Lh = tt - ln, Zh = Rh - dn, Fh = Math.abs(P) < f ? P < 0 ? -f : f : P, Bh = Math.abs(R) < f ? R < 0 ? -f : f : R, Wh = Lh / Fh, Gh = Zh / Bh;
10875
+ const je = J.x, Ze = J.y, [ln, dn] = le(n, je, Ze), nt = d + (ln - d) * S, Rh = m + (dn - m) * S, Lh = nt - ln, Zh = Rh - dn, Fh = Math.abs(P) < f ? P < 0 ? -f : f : P, Bh = Math.abs(L) < f ? L < 0 ? -f : f : L, Wh = Lh / Fh, Gh = Zh / Bh;
10876
10876
  J.updateScale(S, S), J.updateTranslation(Wh, Gh);
10877
10877
  }
10878
10878
  }
10879
10879
  flip(e, r, i) {
10880
- Je(e);
10880
+ Ve(e);
10881
10881
  const n = [], [o, a] = i(this.x, this.y), [s, u] = i(
10882
10882
  this.x + this.width,
10883
10883
  this.y + this.height
@@ -11020,7 +11020,7 @@ class Jp {
11020
11020
  addHandles() {
11021
11021
  for (const e of Ar) {
11022
11022
  const r = this.getHandleConfig(e), i = new Ae(r);
11023
- i.color = at, this.handles.set(e, i);
11023
+ i.color = st, this.handles.set(e, i);
11024
11024
  }
11025
11025
  }
11026
11026
  updateHandles() {
@@ -11083,7 +11083,7 @@ class Jp {
11083
11083
  }[e];
11084
11084
  }
11085
11085
  }
11086
- class qe {
11086
+ class Qe {
11087
11087
  // matrix: number[];
11088
11088
  constructor(e, r, i, n) {
11089
11089
  this.minX = e, this.minY = r, this.maxX = i, this.maxY = n;
@@ -11155,16 +11155,16 @@ class Vp {
11155
11155
  */
11156
11156
  getBoundingBox(e) {
11157
11157
  const [r, i] = e(this.x, this.y), [n, o] = e(this.x + this.width, this.y + this.height), a = Math.min(r, n), s = Math.max(r, n), u = Math.min(i, o), c = Math.max(i, o);
11158
- return new qe(a, u, s, c);
11158
+ return new Qe(a, u, s, c);
11159
11159
  }
11160
11160
  resize(e, r, i) {
11161
- const [n, o] = Je(i);
11161
+ const [n, o] = Ve(i);
11162
11162
  this.width += e * n, this.height += r * o;
11163
11163
  }
11164
11164
  addRects() {
11165
11165
  for (const e of da) {
11166
11166
  const r = this.getRectConfig(e), i = new Ae(r);
11167
- i.color = at, this.rects.set(e, i);
11167
+ i.color = st, this.rects.set(e, i);
11168
11168
  }
11169
11169
  }
11170
11170
  updateRects() {
@@ -11191,16 +11191,16 @@ class Yp {
11191
11191
  height: ee,
11192
11192
  rotation: ee,
11193
11193
  zoom: ee,
11194
- setX: A,
11195
- setY: A,
11196
- setPosition: A,
11197
- incrementPosition: A,
11198
- setWidth: A,
11199
- setHeight: A,
11200
- setSize: A,
11201
- setZoom: A,
11202
- setRotation: A,
11203
- stateVector: ot
11194
+ setX: M,
11195
+ setY: M,
11196
+ setPosition: M,
11197
+ incrementPosition: M,
11198
+ setWidth: M,
11199
+ setHeight: M,
11200
+ setSize: M,
11201
+ setZoom: M,
11202
+ setRotation: M,
11203
+ stateVector: at
11204
11204
  });
11205
11205
  }
11206
11206
  // Actions
@@ -11241,20 +11241,20 @@ class Yp {
11241
11241
  return [this.x, this.y, this.width, this.height, this.rotation, this.zoom];
11242
11242
  }
11243
11243
  get translationMatrix() {
11244
- return L.translation(this.x, this.y);
11244
+ return Z.translation(this.x, this.y);
11245
11245
  }
11246
11246
  get rotationMatrix() {
11247
- return L.rotation(this.rotation);
11247
+ return Z.rotation(this.rotation);
11248
11248
  }
11249
11249
  get scaleMatrix() {
11250
- return L.scaling(this.zoom, this.zoom);
11250
+ return Z.scaling(this.zoom, this.zoom);
11251
11251
  }
11252
11252
  get cameraMatrix() {
11253
- const e = L.multiply(this.translationMatrix, this.rotationMatrix);
11254
- return L.multiply(e, this.scaleMatrix);
11253
+ const e = Z.multiply(this.translationMatrix, this.rotationMatrix);
11254
+ return Z.multiply(e, this.scaleMatrix);
11255
11255
  }
11256
11256
  get canvasMatrix() {
11257
- return L.inverse(this.cameraMatrix);
11257
+ return Z.inverse(this.cameraMatrix);
11258
11258
  }
11259
11259
  }
11260
11260
  function ha(t, e) {
@@ -11470,7 +11470,7 @@ class Hp {
11470
11470
  const c = this.getCanvasChildren(), l = this.marqueeBox.getBoundingBox(this.getMarqueeCoords);
11471
11471
  for (const d of c) {
11472
11472
  const m = d.getBoundingBox();
11473
- qe.isColliding(m, l) && !this.#n.has(d) ? this.add([d]) : !qe.isColliding(m, l) && this.#n.has(d) && this.remove([d]);
11473
+ Qe.isColliding(m, l) && !this.#n.has(d) ? this.add([d]) : !Qe.isColliding(m, l) && this.#n.has(d) && this.remove([d]);
11474
11474
  }
11475
11475
  } else
11476
11476
  this.move(i, n);
@@ -11606,7 +11606,7 @@ class qp {
11606
11606
  const i = this.getChildren();
11607
11607
  for (let n = i.length - 1; n >= 0; n--) {
11608
11608
  const o = i[n];
11609
- if (o instanceof bt && o.hitTest && o.hitTest(e, r))
11609
+ if (o instanceof _t && o.hitTest && o.hitTest(e, r))
11610
11610
  return o;
11611
11611
  }
11612
11612
  return null;
@@ -11719,7 +11719,7 @@ class nv {
11719
11719
  class rv {
11720
11720
  // reduces constant work to re-render if there are no changes
11721
11721
  constructor() {
11722
- this.translation = [0, 0], this.angleRadians = 0, this.scale = [1, 1], this.localMatrix = L.identity(), this.worldMatrix = L.identity(), this.children = [], this.parent = null, this.renderDirtyFlag = !0, Oa(this, {
11722
+ this.translation = [0, 0], this.angleRadians = 0, this.scale = [1, 1], this.localMatrix = Z.identity(), this.worldMatrix = Z.identity(), this.children = [], this.parent = null, this.renderDirtyFlag = !0, Oa(this, {
11723
11723
  translation: ee.struct,
11724
11724
  angleRadians: ee,
11725
11725
  scale: ee.struct,
@@ -11728,26 +11728,26 @@ class rv {
11728
11728
  children: ee.shallow,
11729
11729
  parent: ee.ref,
11730
11730
  renderDirtyFlag: ee,
11731
- x: ot,
11732
- y: ot,
11733
- scaleX: ot,
11734
- scaleY: ot,
11735
- dirty: ot,
11736
- setTranslation: A,
11737
- setScale: A,
11738
- flipVertical: A,
11739
- setAngle: A,
11740
- getChild: A,
11741
- appendChild: A,
11742
- appendChildren: A,
11743
- removeChild: A,
11744
- clearChildren: A,
11745
- setParent: A,
11746
- markDirty: A,
11747
- clearDirty: A,
11748
- updateLocalMatrix: A,
11749
- updateWorldMatrix: A,
11750
- setWorldMatrix: A
11731
+ x: at,
11732
+ y: at,
11733
+ scaleX: at,
11734
+ scaleY: at,
11735
+ dirty: at,
11736
+ setTranslation: M,
11737
+ setScale: M,
11738
+ flipVertical: M,
11739
+ setAngle: M,
11740
+ getChild: M,
11741
+ appendChild: M,
11742
+ appendChildren: M,
11743
+ removeChild: M,
11744
+ clearChildren: M,
11745
+ setParent: M,
11746
+ markDirty: M,
11747
+ clearDirty: M,
11748
+ updateLocalMatrix: M,
11749
+ updateWorldMatrix: M,
11750
+ setWorldMatrix: M
11751
11751
  }), this.updateLocalMatrix(), this.updateWorldMatrix();
11752
11752
  }
11753
11753
  // Computed
@@ -11825,11 +11825,11 @@ class rv {
11825
11825
  this.renderDirtyFlag && (this.renderDirtyFlag = !1, this.updateLocalMatrix());
11826
11826
  }
11827
11827
  updateLocalMatrix() {
11828
- const e = L.translation(this.translation[0], this.translation[1]), r = L.rotation(this.angleRadians), i = L.scaling(this.scale[0], this.scale[1]);
11829
- this.localMatrix = L.multiply(L.multiply(e, r), i);
11828
+ const e = Z.translation(this.translation[0], this.translation[1]), r = Z.rotation(this.angleRadians), i = Z.scaling(this.scale[0], this.scale[1]);
11829
+ this.localMatrix = Z.multiply(Z.multiply(e, r), i);
11830
11830
  }
11831
11831
  updateWorldMatrix(e) {
11832
- this.worldMatrix = e ? L.multiply(e, this.localMatrix) : this.localMatrix.slice();
11832
+ this.worldMatrix = e ? Z.multiply(e, this.localMatrix) : this.localMatrix.slice();
11833
11833
  const r = this.worldMatrix;
11834
11834
  this.children.forEach((i) => {
11835
11835
  i.updateWorldMatrix(r);
@@ -11995,8 +11995,8 @@ const Mn = class Mn extends Eh {
11995
11995
  }
11996
11996
  };
11997
11997
  Mn._seqCounter = 0;
11998
- let bt = Mn;
11999
- class Ae extends bt {
11998
+ let _t = Mn;
11999
+ class Ae extends _t {
12000
12000
  constructor(e) {
12001
12001
  super(e.x, e.y, e.sx, e.sy), this._width = e.width ?? 100, this._height = e.height ?? 100;
12002
12002
  }
@@ -12044,7 +12044,7 @@ class Ae extends bt {
12044
12044
  */
12045
12045
  getBoundingBox() {
12046
12046
  const e = this.state.translation[0], r = e + this.width * this.state.scaleX, i = this.state.translation[1], n = i + this.height * this.state.scaleY, o = Math.min(e, r), a = Math.max(e, r), s = Math.min(i, n), u = Math.max(i, n);
12047
- return this.AABB = new qe(o, s, a, u), this.AABB;
12047
+ return this.AABB = new Qe(o, s, a, u), this.AABB;
12048
12048
  }
12049
12049
  /**
12050
12050
  * edges are unaffected by world zoom factor
@@ -12060,7 +12060,7 @@ class Ae extends bt {
12060
12060
  };
12061
12061
  }
12062
12062
  hitTest(e, r) {
12063
- const [i, n] = Je(this.worldMatrix), [o, a] = kt(this.worldMatrix), [s, u] = le(this.parent.worldMatrix, e, r), [c, l] = le(this.worldMatrix), d = this.width * i * o, m = this.height * n * a, f = Math.min(c, c + d), $ = Math.max(c, c + d), w = Math.min(l, l + m), P = Math.max(l, l + m);
12063
+ const [i, n] = Ve(this.worldMatrix), [o, a] = kt(this.worldMatrix), [s, u] = le(this.parent.worldMatrix, e, r), [c, l] = le(this.worldMatrix), d = this.width * i * o, m = this.height * n * a, f = Math.min(c, c + d), $ = Math.max(c, c + d), w = Math.min(l, l + m), P = Math.max(l, l + m);
12064
12064
  return s >= f && s <= $ && u >= w && u <= P;
12065
12065
  }
12066
12066
  }
@@ -12300,7 +12300,7 @@ class Th extends Eh {
12300
12300
  this.vertexCount = c.length / 2, e.bindBuffer(e.ARRAY_BUFFER, this.buffer), e.bufferData(e.ARRAY_BUFFER, c, e.STATIC_DRAW);
12301
12301
  }
12302
12302
  this.initialized || (this.setUpVertexData(e, r), this.setUpUniforms(e, r), this.initialized = !0);
12303
- const i = e.drawingBufferWidth, n = e.drawingBufferHeight, o = L.inverse(L.projection(i, n)), a = L.inverse(this.worldMatrix), s = L.multiply(a, o);
12303
+ const i = e.drawingBufferWidth, n = e.drawingBufferHeight, o = Z.inverse(Z.projection(i, n)), a = Z.inverse(this.worldMatrix), s = Z.multiply(a, o);
12304
12304
  this.viewProjectionInvLocation && e.uniformMatrix3fv(
12305
12305
  this.viewProjectionInvLocation,
12306
12306
  !1,
@@ -12350,7 +12350,7 @@ class av {
12350
12350
  this.state.width + this.viewportX,
12351
12351
  this.state.height + this.viewportY
12352
12352
  );
12353
- return new qe(e, r, i, n);
12353
+ return new Qe(e, r, i, n);
12354
12354
  }
12355
12355
  onWheel(e) {
12356
12356
  e.preventDefault();
@@ -12382,7 +12382,7 @@ class av {
12382
12382
  this.updateReaction && (this.updateReaction(), this.updateReaction = void 0);
12383
12383
  }
12384
12384
  }
12385
- const pa = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjYjNiM2IzIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjUgNmEyLjI1IDIuMjUgMCAwIDEgMi4yNS0yLjI1aDE2LjVBMi4yNSAyLjI1IDAgMCAxIDIyLjUgNnYxMmEyLjI1IDIuMjUgMCAwIDEtMi4yNSAyLjI1SDMuNzVBMi4yNSAyLjI1IDAgMCAxIDEuNSAxOHpNMyAxNi4wNlYxOGMwIC40MTQuMzM2Ljc1Ljc1Ljc1aDE2LjVBLjc1Ljc1IDAgMCAwIDIxIDE4di0xLjk0bC0yLjY5LTIuNjg5YTEuNSAxLjUgMCAwIDAtMi4xMiAwbC0uODguODc5bC45Ny45N2EuNzUuNzUgMCAxIDEtMS4wNiAxLjA2bC01LjE2LTUuMTU5YTEuNSAxLjUgMCAwIDAtMi4xMiAwem0xMC4xMjUtNy44MWExLjEyNSAxLjEyNSAwIDEgMSAyLjI1IDBhMS4xMjUgMS4xMjUgMCAwIDEtMi4yNSAwIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=", it = 240;
12385
+ const pa = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjYjNiM2IzIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjUgNmEyLjI1IDIuMjUgMCAwIDEgMi4yNS0yLjI1aDE2LjVBMi4yNSAyLjI1IDAgMCAxIDIyLjUgNnYxMmEyLjI1IDIuMjUgMCAwIDEtMi4yNSAyLjI1SDMuNzVBMi4yNSAyLjI1IDAgMCAxIDEuNSAxOHpNMyAxNi4wNlYxOGMwIC40MTQuMzM2Ljc1Ljc1Ljc1aDE2LjVBLjc1Ljc1IDAgMCAwIDIxIDE4di0xLjk0bC0yLjY5LTIuNjg5YTEuNSAxLjUgMCAwIDAtMi4xMiAwbC0uODguODc5bC45Ny45N2EuNzUuNzUgMCAxIDEtMS4wNiAxLjA2bC01LjE2LTUuMTU5YTEuNSAxLjUgMCAwIDAtMi4xMiAwem0xMC4xMjUtNy44MWExLjEyNSAxLjEyNSAwIDEgMSAyLjI1IDBhMS4xMjUgMS4xMjUgMCAwIDEtMi4yNSAwIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=", ot = 240;
12386
12386
  function va(t) {
12387
12387
  return {
12388
12388
  x: t.x ?? 0,
@@ -12456,9 +12456,19 @@ async function ya(t, e, r, i) {
12456
12456
  case "Img":
12457
12457
  let u;
12458
12458
  try {
12459
- u = t.files && Array.isArray(t.files) ? t.files.find(
12460
- (f) => f.id === o.fileId
12461
- )?.dataURL ?? pa : pa;
12459
+ u = (() => {
12460
+ if (t.files && Array.isArray(t.files)) {
12461
+ const m = t.files.find(
12462
+ (f) => f.id === o.fileId
12463
+ );
12464
+ return r(o.fileId).then((f) => {
12465
+ f || i(m.dataURL);
12466
+ }).catch(
12467
+ (f) => console.error("Image not written to database", f)
12468
+ ), m?.dataURL ?? pa;
12469
+ }
12470
+ return pa;
12471
+ })();
12462
12472
  const c = o.width, l = o.height, d = await cv(
12463
12473
  u,
12464
12474
  c * o.transform.sx,
@@ -12509,7 +12519,7 @@ async function cv(t, e, r, i = "#d6d6d6ff") {
12509
12519
  a = await sv(o);
12510
12520
  } catch {
12511
12521
  }
12512
- const s = e && e > 0 ? e : a?.naturalWidth ?? it, u = r && r > 0 ? r : a?.naturalHeight ?? it, c = document.createElement("canvas");
12522
+ const s = e && e > 0 ? e : a?.naturalWidth ?? ot, u = r && r > 0 ? r : a?.naturalHeight ?? ot, c = document.createElement("canvas");
12513
12523
  c.width = s, c.height = u;
12514
12524
  const l = c.getContext("2d");
12515
12525
  if (l.fillStyle = i, l.fillRect(0, 0, s, u), a) {
@@ -12517,9 +12527,9 @@ async function cv(t, e, r, i = "#d6d6d6ff") {
12517
12527
  s / a.naturalWidth,
12518
12528
  u / a.naturalHeight
12519
12529
  ), m = a.naturalHeight * d, f = a.naturalWidth * d;
12520
- let $ = it, w = it;
12521
- (it > m || it > f) && ($ = f, w = m);
12522
- const P = Math.round((s - $) / 2), R = Math.round((u - w) / 2);
12530
+ let $ = ot, w = ot;
12531
+ (ot > m || ot > f) && ($ = f, w = m);
12532
+ const P = Math.round((s - $) / 2), L = Math.round((u - w) / 2);
12523
12533
  l.drawImage(
12524
12534
  a,
12525
12535
  0,
@@ -12527,7 +12537,7 @@ async function cv(t, e, r, i = "#d6d6d6ff") {
12527
12537
  a.naturalWidth,
12528
12538
  a.naturalHeight,
12529
12539
  P,
12530
- R,
12540
+ L,
12531
12541
  $,
12532
12542
  w
12533
12543
  );
@@ -12543,7 +12553,7 @@ const Rr = me({
12543
12553
  sx: z(),
12544
12554
  sy: z()
12545
12555
  }).strict(), uv = me({
12546
- id: $t([De(), z()]),
12556
+ id: wt([De(), z()]),
12547
12557
  dataURL: De().regex(
12548
12558
  /^data:image\/[a-z0-9.+-]+;base64,[A-Za-z0-9+/=\s]+$/,
12549
12559
  "Invalid image data URL"
@@ -12554,7 +12564,7 @@ const Rr = me({
12554
12564
  }).strict(), Tt = Ur(
12555
12565
  () => lo("type", [
12556
12566
  me({
12557
- type: We("Rect"),
12567
+ type: Ge("Rect"),
12558
12568
  id: z().int().optional(),
12559
12569
  transform: Rr,
12560
12570
  children: ve(Tt).optional(),
@@ -12565,7 +12575,7 @@ const Rr = me({
12565
12575
  color: kr([z(), z(), z(), z()])
12566
12576
  }).strict(),
12567
12577
  me({
12568
- type: We("Img"),
12578
+ type: Ge("Img"),
12569
12579
  id: z().int().optional(),
12570
12580
  transform: Rr,
12571
12581
  children: ve(Tt).optional(),
@@ -12573,16 +12583,16 @@ const Rr = me({
12573
12583
  renderOrder: z().int().optional(),
12574
12584
  width: z().positive(),
12575
12585
  height: z().positive(),
12576
- fileId: $t([De(), z()]).optional()
12586
+ fileId: wt([De(), z()]).optional()
12577
12587
  }).strict(),
12578
12588
  me({
12579
- type: We("Grid"),
12589
+ type: Ge("Grid"),
12580
12590
  id: z().int().optional(),
12581
12591
  style: z().int().optional(),
12582
12592
  children: ve(Tt).optional()
12583
12593
  }).strict(),
12584
12594
  me({
12585
- type: We("Renderable"),
12595
+ type: Ge("Renderable"),
12586
12596
  id: z().int().optional(),
12587
12597
  transform: Rr.optional(),
12588
12598
  children: ve(Tt).optional(),
@@ -12595,7 +12605,7 @@ const Rr = me({
12595
12605
  x: z(),
12596
12606
  y: z()
12597
12607
  }).strict(), dv = me({
12598
- version: We(1),
12608
+ version: Ge(1),
12599
12609
  canvas: me({
12600
12610
  width: z().positive(),
12601
12611
  height: z().positive(),
@@ -12612,35 +12622,35 @@ function ba(t) {
12612
12622
  throw new Error(`Invalid canvas data: ${e.error.message}`);
12613
12623
  return e.data;
12614
12624
  }
12615
- var fe, Se, Ge, ge, T, xe, st, Xe, Ie, Q, Ce, X, ct, Rn, ut;
12616
- const B = class B extends Oh {
12625
+ var fe, Se, Xe, ge, T, xe, ct, Je, Ie, Q, Ce, X, ut, Rn, lt;
12626
+ const W = class W extends Oh {
12617
12627
  constructor(r, i, n, o, a, s) {
12618
12628
  super();
12619
12629
  V(this, fe);
12620
12630
  V(this, Se);
12621
- V(this, Ge);
12631
+ V(this, Xe);
12622
12632
  V(this, ge);
12623
12633
  V(this, T);
12624
12634
  V(this, xe);
12625
- V(this, st);
12626
- V(this, Xe);
12635
+ V(this, ct);
12636
+ V(this, Je);
12627
12637
  V(this, Ie);
12628
12638
  V(this, Q);
12629
12639
  V(this, Ce);
12630
12640
  V(this, X);
12631
- V(this, ct);
12632
- V(this, Rn);
12633
12641
  V(this, ut);
12634
- Z(this, Q, null), Z(this, Ce, !0), this.orderDirty = !0, this.renderList = [], Z(this, fe, r), Z(this, Se, n), Z(this, Ge, i), Z(this, Ie, new Th()), Z(this, T, r.getContext("webgl", {
12642
+ V(this, Rn);
12643
+ V(this, lt);
12644
+ F(this, Q, null), F(this, Ce, !0), this.orderDirty = !0, this.renderList = [], F(this, fe, r), F(this, Se, n), F(this, Xe, i), F(this, Ie, new Th()), F(this, T, r.getContext("webgl", {
12635
12645
  alpha: !0,
12636
12646
  premultipliedAlpha: !1
12637
- })), v(this, T).enable(v(this, T).BLEND), v(this, T).blendFunc(v(this, T).SRC_ALPHA, v(this, T).ONE_MINUS_SRC_ALPHA), v(this, T).getExtension("OES_standard_derivatives"), v(this, T).enable(v(this, T).DEPTH_TEST), v(this, T).depthFunc(v(this, T).LEQUAL), Z(this, xe, Dr(v(this, T), Zp, Fp)), Z(this, st, Dr(v(this, T), Gp, Xp)), Z(this, Xe, Dr(v(this, T), Bp, Wp)), this.writeToStorage = o, this.saveImgFileToStorage = a, this.getContainerDimension = s, this.engine = this.engine.bind(this), this.getBoundingClientRect = this.getBoundingClientRect.bind(this), this.appendChild = this.appendChild.bind(this), this.addImageToCanvas = this.addImageToCanvas.bind(this), this.setShapeZOrder = this.setShapeZOrder.bind(this), this.toggleGrid = this.toggleGrid.bind(this), this.changeMode = this.changeMode.bind(this), this.getSelected = this.getSelected.bind(this), this.updateZoomByFixedAmount = this.updateZoomByFixedAmount.bind(this), this.getCenterPoint = this.getCenterPoint.bind(this), this.assignEventListener = this.assignEventListener.bind(this), this.getWorldsCoordsFromCanvas = (m, f) => Fe(m, f, this);
12638
- const u = (m, f) => Fe(
12647
+ })), v(this, T).enable(v(this, T).BLEND), v(this, T).blendFunc(v(this, T).SRC_ALPHA, v(this, T).ONE_MINUS_SRC_ALPHA), v(this, T).getExtension("OES_standard_derivatives"), v(this, T).enable(v(this, T).DEPTH_TEST), v(this, T).depthFunc(v(this, T).LEQUAL), F(this, xe, Dr(v(this, T), Zp, Fp)), F(this, ct, Dr(v(this, T), Gp, Xp)), F(this, Je, Dr(v(this, T), Bp, Wp)), this.writeToStorage = o, this.saveImgFileToStorage = a, this.getContainerDimension = s, this.engine = this.engine.bind(this), this.getBoundingClientRect = this.getBoundingClientRect.bind(this), this.appendChild = this.appendChild.bind(this), this.addImageToCanvas = this.addImageToCanvas.bind(this), this.setShapeZOrder = this.setShapeZOrder.bind(this), this.toggleGrid = this.toggleGrid.bind(this), this.changeMode = this.changeMode.bind(this), this.getSelected = this.getSelected.bind(this), this.updateZoomByFixedAmount = this.updateZoomByFixedAmount.bind(this), this.getCenterPoint = this.getCenterPoint.bind(this), this.assignEventListener = this.assignEventListener.bind(this), this.getWorldsCoordsFromCanvas = (m, f) => Be(m, f, this);
12648
+ const u = (m, f) => Be(
12639
12649
  m + this.camera.viewportX,
12640
12650
  f + this.camera.viewportY,
12641
12651
  this
12642
12652
  );
12643
- this.exportState = this.exportState.bind(this), this.clearChildren = this.clearChildren.bind(this), Z(this, X, new Hp(
12653
+ this.exportState = this.exportState.bind(this), this.clearChildren = this.clearChildren.bind(this), F(this, X, new Hp(
12644
12654
  i,
12645
12655
  n,
12646
12656
  this.gl,
@@ -12651,17 +12661,17 @@ const B = class B extends Oh {
12651
12661
  u
12652
12662
  ));
12653
12663
  const c = new Yp({});
12654
- Z(this, ge, new av(
12664
+ F(this, ge, new av(
12655
12665
  c,
12656
12666
  this.setWorldMatrix,
12657
12667
  this.updateWorldMatrix,
12658
12668
  this.getWorldsCoordsFromCanvas
12659
- )), Z(this, Rn, new Qp(
12669
+ )), F(this, Rn, new Qp(
12660
12670
  i,
12661
12671
  n,
12662
12672
  () => this.selectionManager.deleteSelected(this),
12663
12673
  this.assignEventListener
12664
- )), Z(this, ut, new ev(
12674
+ )), F(this, lt, new ev(
12665
12675
  n,
12666
12676
  this.selectionManager.isMultiBoundingBoxHit,
12667
12677
  this.selectionManager.isBoundingBoxHit,
@@ -12672,7 +12682,7 @@ const B = class B extends Oh {
12672
12682
  history: i,
12673
12683
  eventHub: n,
12674
12684
  state: l,
12675
- isContextMenuActive: () => v(this, ut).isActive,
12685
+ isContextMenuActive: () => v(this, lt).isActive,
12676
12686
  getSelected: () => v(this, X).selected,
12677
12687
  getChildren: () => this.children,
12678
12688
  getWorldMatrix: () => this.worldMatrix,
@@ -12702,7 +12712,7 @@ const B = class B extends Oh {
12702
12712
  isSelection: this.selectionManager.isRectSelected,
12703
12713
  hitTestAdjustedCorner: this.selectionManager.hitTestAdjustedCorner
12704
12714
  };
12705
- Z(this, ct, new qp(d)), v(this, Se).on("save", this.writeToStorage);
12715
+ F(this, ut, new qp(d)), v(this, Se).on("save", this.writeToStorage);
12706
12716
  }
12707
12717
  // Call this whenever children/layers/z-order change
12708
12718
  markOrderDirty() {
@@ -12715,19 +12725,19 @@ const B = class B extends Oh {
12715
12725
  return v(this, Ie);
12716
12726
  }
12717
12727
  get history() {
12718
- return v(this, Ge);
12728
+ return v(this, Xe);
12719
12729
  }
12720
12730
  get eventHub() {
12721
12731
  return v(this, Se);
12722
12732
  }
12723
12733
  get pointerEventManager() {
12724
- return v(this, ct);
12734
+ return v(this, ut);
12725
12735
  }
12726
12736
  get selectionManager() {
12727
12737
  return v(this, X);
12728
12738
  }
12729
12739
  get contextMenuManager() {
12730
- return v(this, ut);
12740
+ return v(this, lt);
12731
12741
  }
12732
12742
  get canvas() {
12733
12743
  return v(this, fe);
@@ -12739,7 +12749,7 @@ const B = class B extends Oh {
12739
12749
  return v(this, Ce);
12740
12750
  }
12741
12751
  set isGlobalClick(r) {
12742
- Z(this, Ce, r);
12752
+ F(this, Ce, r);
12743
12753
  }
12744
12754
  get basicShapeProgram() {
12745
12755
  return v(this, xe);
@@ -12754,7 +12764,7 @@ const B = class B extends Oh {
12754
12764
  return this.renderList.length;
12755
12765
  }
12756
12766
  appendChild(r) {
12757
- if (super.appendChild(r), r instanceof bt) {
12767
+ if (super.appendChild(r), r instanceof _t) {
12758
12768
  const i = this.children.map((o) => o.renderOrder), n = i.length ? Math.max(...i) : 0;
12759
12769
  r.renderOrder = n + 1;
12760
12770
  }
@@ -12789,18 +12799,18 @@ const B = class B extends Oh {
12789
12799
  c.height
12790
12800
  );
12791
12801
  }
12792
- v(this, T).useProgram(v(this, Xe));
12793
- const r = v(this, T).getUniformLocation(v(this, Xe), "u_z");
12794
- v(this, T).uniform1f(r, 0), v(this, Ie).render(v(this, T), v(this, Xe));
12802
+ v(this, T).useProgram(v(this, Je));
12803
+ const r = v(this, T).getUniformLocation(v(this, Je), "u_z");
12804
+ v(this, T).uniform1f(r, 0), v(this, Ie).render(v(this, T), v(this, Je));
12795
12805
  const i = this.camera.getBoundingBox();
12796
12806
  this.renderList = [];
12797
12807
  for (const c of this.children)
12798
- !v(this, Q) && !qe.isColliding(i, c.getBoundingBox()) ? c.culled = !0 : (this.renderList.push(c), c.culled = !1);
12799
- const [n, o] = Fe(0, 0, this), [a, s] = Fe(
12808
+ !v(this, Q) && !Qe.isColliding(i, c.getBoundingBox()) ? c.culled = !0 : (this.renderList.push(c), c.culled = !1);
12809
+ const [n, o] = Be(0, 0, this), [a, s] = Be(
12800
12810
  window.screen.width,
12801
12811
  window.screen.height,
12802
12812
  this
12803
- ), u = new qe(n, o, a, s);
12813
+ ), u = new Qe(n, o, a, s);
12804
12814
  this.renderList.forEach((c) => {
12805
12815
  if (c instanceof Ne) {
12806
12816
  const l = c.determineIfLowRes(
@@ -12815,14 +12825,14 @@ const B = class B extends Oh {
12815
12825
  });
12816
12826
  for (const c of this.renderList) {
12817
12827
  let l;
12818
- c instanceof Ne ? l = v(this, st) : c instanceof bt && (l = v(this, xe)), v(this, T).useProgram(l);
12828
+ c instanceof Ne ? l = v(this, ct) : c instanceof _t && (l = v(this, xe)), v(this, T).useProgram(l);
12819
12829
  const d = v(this, T).getUniformLocation(l, "u_z");
12820
12830
  v(this, T).uniform1f(d, c.getZ()), c.render(v(this, T), l);
12821
12831
  }
12822
12832
  v(this, X).render(v(this, xe));
12823
12833
  }
12824
12834
  destroy() {
12825
- v(this, T).deleteProgram(v(this, xe)), v(this, T).deleteProgram(v(this, st)), this.children.forEach((r) => {
12835
+ v(this, T).deleteProgram(v(this, xe)), v(this, T).deleteProgram(v(this, ct)), this.children.forEach((r) => {
12826
12836
  "destroy" in r && r.destroy();
12827
12837
  }), this.clearChildren();
12828
12838
  }
@@ -12833,7 +12843,7 @@ const B = class B extends Oh {
12833
12843
  v(this, fe).addEventListener(r, i, n);
12834
12844
  }
12835
12845
  hitTest(r, i) {
12836
- return Z(this, Ce, !0), v(this, Ce);
12846
+ return F(this, Ce, !0), v(this, Ce);
12837
12847
  }
12838
12848
  async addImageToCanvas(r, i, n, o = 1, a = 1, s = !1) {
12839
12849
  const u = new Ne({ x: i, y: n, src: r, sx: o, sy: a });
@@ -12850,7 +12860,7 @@ const B = class B extends Oh {
12850
12860
  return Jr(this);
12851
12861
  }
12852
12862
  clearChildren() {
12853
- this.selectionManager.clear(), this.state.clearChildren(), v(this, Ge).clear();
12863
+ this.selectionManager.clear(), this.state.clearChildren(), v(this, Xe).clear();
12854
12864
  }
12855
12865
  toggleGrid() {
12856
12866
  v(this, Ie).changeGridType(
@@ -12874,10 +12884,10 @@ const B = class B extends Oh {
12874
12884
  const a = Math.max(...o), s = Math.min(...o);
12875
12885
  i.renderOrder = r ? a + 1 : s - 1, n.end = {
12876
12886
  renderOrder: i.renderOrder
12877
- }, this.markOrderDirty(), v(this, Ge).push(tv([n])), v(this, Se).emit(ze.Change);
12887
+ }, this.markOrderDirty(), v(this, Xe).push(tv([n])), v(this, Se).emit(ze.Change);
12878
12888
  }
12879
12889
  changeMode() {
12880
- v(this, ct).changeMode(), v(this, X).clear();
12890
+ v(this, ut).changeMode(), v(this, X).clear();
12881
12891
  }
12882
12892
  updateZoomByFixedAmount(r = 1) {
12883
12893
  v(this, ge).updateZoom(
@@ -12947,14 +12957,14 @@ const B = class B extends Oh {
12947
12957
  return i.bindFramebuffer(i.FRAMEBUFFER, null), i.deleteTexture(s), i.deleteFramebuffer(a), this.getViewportThumbnail(n, o);
12948
12958
  const { scale: l, canvasHeight: d, canvasWidth: m, contentHeight: f, contentWidth: $ } = this.calculateScaleForThumbnail(c, n, o), w = Math.max(1e-4, l);
12949
12959
  this.camera.state.setZoom(w);
12950
- const P = this.getCenterPoint(), R = P[0] - this.canvas.width * w / 2, C = P[1] - this.canvas.height * w / 2;
12951
- v(this, ge).setCameraPos(R, C), Z(this, Q, {
12960
+ const P = this.getCenterPoint(), L = P[0] - this.canvas.width * w / 2, A = P[1] - this.canvas.height * w / 2;
12961
+ v(this, ge).setCameraPos(L, A), F(this, Q, {
12952
12962
  x: (n - m) / 2,
12953
12963
  y: (o - d) / 2,
12954
12964
  // ensure that the image stays proportioned - the passed in values of height and width must match the AR of the canvas you're using
12955
12965
  height: d,
12956
12966
  width: m
12957
- }), this.grid.gridType = 0, this.render(), Z(this, Q, null);
12967
+ }), this.grid.gridType = 0, this.render(), F(this, Q, null);
12958
12968
  const E = new Uint8Array(n * o * 4);
12959
12969
  i.readPixels(0, 0, n, o, i.RGBA, i.UNSIGNED_BYTE, E);
12960
12970
  const S = n * 4, se = new Uint8ClampedArray(E.length);
@@ -12963,17 +12973,17 @@ const B = class B extends Oh {
12963
12973
  se.set(E.subarray(je, je + S), Ze);
12964
12974
  }
12965
12975
  this.camera.state.setZoom(u.zoom), this.camera.setCameraPos(u.x, u.y), this.grid.gridType = u.gridType, this.selectionManager.selected = u.selected, i.bindFramebuffer(i.FRAMEBUFFER, null), i.viewport(0, 0, i.canvas.width, i.canvas.height), i.deleteTexture(s), i.deleteFramebuffer(a);
12966
- const wt = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(n, o) : null;
12967
- if (wt) {
12968
- const J = wt.getContext("2d"), je = new ImageData(se, n, o);
12976
+ const St = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(n, o) : null;
12977
+ if (St) {
12978
+ const J = St.getContext("2d"), je = new ImageData(se, n, o);
12969
12979
  J.putImageData(je, 0, 0);
12970
- const Ze = await wt.convertToBlob({
12980
+ const Ze = await St.convertToBlob({
12971
12981
  type: "image/jpeg",
12972
12982
  quality: 0.92
12973
12983
  });
12974
12984
  return await new Promise((ln, dn) => {
12975
- const tt = new FileReader();
12976
- tt.onloadend = () => ln(tt.result), tt.onerror = dn, tt.readAsDataURL(Ze);
12985
+ const nt = new FileReader();
12986
+ nt.onloadend = () => ln(nt.result), nt.onerror = dn, nt.readAsDataURL(Ze);
12977
12987
  });
12978
12988
  } else {
12979
12989
  const J = document.createElement("canvas");
@@ -13022,25 +13032,25 @@ const B = class B extends Oh {
13022
13032
  }
13023
13033
  wrapWebGLContext(r) {
13024
13034
  const i = r.createTexture.bind(r);
13025
- r.createTexture = () => (B.webglStats.texturesCreated++, console.log(`Textures created: ${B.webglStats.texturesCreated}`), i());
13035
+ r.createTexture = () => (W.webglStats.texturesCreated++, console.log(`Textures created: ${W.webglStats.texturesCreated}`), i());
13026
13036
  const n = r.deleteTexture.bind(r);
13027
- r.deleteTexture = (s) => (s && (B.webglStats.texturesDeleted++, console.log(`Textures deleted: ${B.webglStats.texturesDeleted}`)), n(s));
13037
+ r.deleteTexture = (s) => (s && (W.webglStats.texturesDeleted++, console.log(`Textures deleted: ${W.webglStats.texturesDeleted}`)), n(s));
13028
13038
  const o = r.createShader.bind(r);
13029
- r.createShader = (s) => (B.webglStats.shadersCreated++, console.log(`Shaders created: ${B.webglStats.shadersCreated}`), o(s));
13039
+ r.createShader = (s) => (W.webglStats.shadersCreated++, console.log(`Shaders created: ${W.webglStats.shadersCreated}`), o(s));
13030
13040
  const a = r.deleteShader.bind(r);
13031
- return r.deleteShader = (s) => (s && (B.webglStats.shadersDeleted++, console.log(`Shaders deleted: ${B.webglStats.shadersDeleted}`)), a(s)), r;
13041
+ return r.deleteShader = (s) => (s && (W.webglStats.shadersDeleted++, console.log(`Shaders deleted: ${W.webglStats.shadersDeleted}`)), a(s)), r;
13032
13042
  }
13033
13043
  static getWebGLStats() {
13034
13044
  return {
13035
- ...B.webglStats,
13036
- buffersLeaked: B.webglStats.buffersCreated - B.webglStats.buffersDeleted,
13037
- programsLeaked: B.webglStats.programsCreated - B.webglStats.programsDeleted,
13038
- texturesLeaked: B.webglStats.texturesCreated - B.webglStats.texturesDeleted,
13039
- shadersLeaked: B.webglStats.shadersCreated - B.webglStats.shadersDeleted
13045
+ ...W.webglStats,
13046
+ buffersLeaked: W.webglStats.buffersCreated - W.webglStats.buffersDeleted,
13047
+ programsLeaked: W.webglStats.programsCreated - W.webglStats.programsDeleted,
13048
+ texturesLeaked: W.webglStats.texturesCreated - W.webglStats.texturesDeleted,
13049
+ shadersLeaked: W.webglStats.shadersCreated - W.webglStats.shadersDeleted
13040
13050
  };
13041
13051
  }
13042
13052
  };
13043
- fe = new WeakMap(), Se = new WeakMap(), Ge = new WeakMap(), ge = new WeakMap(), T = new WeakMap(), xe = new WeakMap(), st = new WeakMap(), Xe = new WeakMap(), Ie = new WeakMap(), Q = new WeakMap(), Ce = new WeakMap(), X = new WeakMap(), ct = new WeakMap(), Rn = new WeakMap(), ut = new WeakMap(), B.webglStats = {
13053
+ fe = new WeakMap(), Se = new WeakMap(), Xe = new WeakMap(), ge = new WeakMap(), T = new WeakMap(), xe = new WeakMap(), ct = new WeakMap(), Je = new WeakMap(), Ie = new WeakMap(), Q = new WeakMap(), Ce = new WeakMap(), X = new WeakMap(), ut = new WeakMap(), Rn = new WeakMap(), lt = new WeakMap(), W.webglStats = {
13044
13054
  buffersCreated: 0,
13045
13055
  buffersDeleted: 0,
13046
13056
  programsCreated: 0,
@@ -13050,7 +13060,7 @@ fe = new WeakMap(), Se = new WeakMap(), Ge = new WeakMap(), ge = new WeakMap(),
13050
13060
  shadersCreated: 0,
13051
13061
  shadersDeleted: 0
13052
13062
  };
13053
- let Dn = B;
13063
+ let Dn = W;
13054
13064
  const _a = 25;
13055
13065
  class hv {
13056
13066
  constructor() {
@@ -13173,7 +13183,7 @@ const { is: vv, defineProperty: yv, getOwnPropertyDescriptor: bv, getOwnProperty
13173
13183
  return r;
13174
13184
  } }, Uh = (t, e) => !vv(t, e), xa = { attribute: !0, type: String, converter: Vr, reflect: !1, useDefault: !1, hasChanged: Uh };
13175
13185
  Symbol.metadata ??= Symbol("metadata"), Nr.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
13176
- class xt extends HTMLElement {
13186
+ class It extends HTMLElement {
13177
13187
  static addInitializer(e) {
13178
13188
  this._$Ei(), (this.l ??= []).push(e);
13179
13189
  }
@@ -13354,7 +13364,7 @@ class xt extends HTMLElement {
13354
13364
  firstUpdated(e) {
13355
13365
  }
13356
13366
  }
13357
- xt.elementStyles = [], xt.shadowRootOptions = { mode: "open" }, xt[Ct("elementProperties")] = /* @__PURE__ */ new Map(), xt[Ct("finalized")] = /* @__PURE__ */ new Map(), xv?.({ ReactiveElement: xt }), (Nr.reactiveElementVersions ??= []).push("2.1.1");
13367
+ It.elementStyles = [], It.shadowRootOptions = { mode: "open" }, It[Ct("elementProperties")] = /* @__PURE__ */ new Map(), It[Ct("finalized")] = /* @__PURE__ */ new Map(), xv?.({ ReactiveElement: It }), (Nr.reactiveElementVersions ??= []).push("2.1.1");
13358
13368
  class Nh {
13359
13369
  constructor(e, r) {
13360
13370
  this.options = [], this.rootNode = r, this._el = document.createElement("div"), this._el.classList.add("context-menu"), e.options.forEach((i, n) => {
@@ -13749,7 +13759,7 @@ const Lv = {
13749
13759
  }, Ia = {
13750
13760
  MAX_IMAGE_ENTRIES: 1e3
13751
13761
  };
13752
- class It extends Cv {
13762
+ class Fe extends Cv {
13753
13763
  constructor() {
13754
13764
  super(), this.dbQueue = new za(), this.cache = /* @__PURE__ */ new Map(), this.CACHE_LIMIT = 500, this.dbQueue = new za(), this.dbPromise = this.initDb();
13755
13765
  }
@@ -14031,10 +14041,10 @@ var Jv = Object.getOwnPropertyDescriptor, Dh = (t) => {
14031
14041
  for (var n = i > 1 ? void 0 : i ? Jv(e, r) : e, o = t.length - 1, a; o >= 0; o--)
14032
14042
  (a = t[o]) && (n = a(n) || n);
14033
14043
  return n;
14034
- }, Ah = (t, e, r) => e.has(t) || Dh("Cannot " + r), g = (t, e, r) => (Ah(t, e, "read from private field"), r ? r.call(t) : e.get(t)), K = (t, e, r) => e.has(t) ? Dh("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), D = (t, e, r, i) => (Ah(t, e, "write to private field"), e.set(t, r), r), _, F, $n, be, W, G, Pt, wn, jt, Ut, _e, Ue, Sn, xn, In;
14044
+ }, Ah = (t, e, r) => e.has(t) || Dh("Cannot " + r), g = (t, e, r) => (Ah(t, e, "read from private field"), r ? r.call(t) : e.get(t)), K = (t, e, r) => e.has(t) ? Dh("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), C = (t, e, r, i) => (Ah(t, e, "write to private field"), e.set(t, r), r), _, B, $n, be, D, G, Pt, wn, jt, Ut, _e, Ue, Sn, xn, In;
14035
14045
  let An = class extends Vh {
14036
14046
  constructor() {
14037
- super(...arguments), this.name = "Reffy", this.displayMode = "fullscreen", K(this, _), K(this, F), K(this, $n), K(this, be), K(this, W), K(this, G), K(this, Pt, 3e5), K(this, wn), K(this, jt), K(this, Ut), K(this, _e), K(this, Ue, /* @__PURE__ */ new Set()), K(this, Sn), K(this, xn), K(this, In), this.handleGlobalPointerDown = (t) => {
14047
+ super(...arguments), this.name = "Reffy", this.displayMode = "fullscreen", K(this, _), K(this, B), K(this, $n), K(this, be), K(this, D), K(this, G), K(this, Pt, 3e5), K(this, wn), K(this, jt), K(this, Ut), K(this, _e), K(this, Ue, /* @__PURE__ */ new Set()), K(this, Sn), K(this, xn), K(this, In), this.handleGlobalPointerDown = (t) => {
14038
14048
  !this.contains(t.target) && !this.renderRoot.contains(t.target) && this.clearContextMenu();
14039
14049
  };
14040
14050
  }
@@ -14065,7 +14075,7 @@ let An = class extends Vh {
14065
14075
  g(this, Ue).delete(t);
14066
14076
  }
14067
14077
  get eventHub() {
14068
- return g(this, F);
14078
+ return g(this, B);
14069
14079
  }
14070
14080
  get rootDiv() {
14071
14081
  return g(this, _e);
@@ -14083,7 +14093,7 @@ let An = class extends Vh {
14083
14093
  "pointerdown",
14084
14094
  this.handleGlobalPointerDown,
14085
14095
  !0
14086
- ), window.removeEventListener("resize", g(this, Ut)), g(this, $n)?.disconnect(), D(this, $n, void 0), g(this, _).destroy(), super.disconnectedCallback();
14096
+ ), window.removeEventListener("resize", g(this, Ut)), g(this, $n)?.disconnect(), C(this, $n, void 0), g(this, _).destroy(), super.disconnectedCallback();
14087
14097
  }
14088
14098
  firstUpdated(t) {
14089
14099
  try {
@@ -14100,14 +14110,14 @@ let An = class extends Vh {
14100
14110
  r && i && this.resizeCanvas(r, i);
14101
14111
  }
14102
14112
  async initCanvas() {
14103
- await this.warmUpStorage(), D(this, be, new hv()), D(this, F, new Hh());
14113
+ await this.warmUpStorage(), C(this, be, new hv()), C(this, B, new Hh());
14104
14114
  const t = document.createElement("div");
14105
- t.style.overflow = "hidden", this.renderRoot.appendChild(t), D(this, _e, t);
14115
+ t.style.overflow = "hidden", this.renderRoot.appendChild(t), C(this, _e, t);
14106
14116
  const e = document.createElement("canvas");
14107
- this.assignFileStorage = this.assignFileStorage.bind(this), this.getImageFileMetadata = this.getImageFileMetadata.bind(this), this.getAllImageFileMetdata = this.getAllImageFileMetdata.bind(this), this.saveImageFileMetadata = this.saveImageFileMetadata.bind(this), this.restoreStateFromCanvasStorage = this.restoreStateFromCanvasStorage.bind(this), this.assignCanvasStorage = this.assignCanvasStorage.bind(this), this.saveToCanvasStorage = this.saveToCanvasStorage.bind(this), this.debounceSaveToCanvasStorage = this.debounceSaveToCanvasStorage.bind(this), this.importCanvas = this.importCanvas.bind(this), this.exportCanvas = this.exportCanvas.bind(this), this.addContextMenu = Ov.bind(this), this.clearContextMenu = Ev.bind(this), this.isContextMenuActive = Tv.bind(this), this.getContainerSize = this.getContainerSize.bind(this), t.contains(e) || t.appendChild(e), this.registerSignal(), D(this, _, new Dn(
14117
+ this.assignFileStorage = this.assignFileStorage.bind(this), this.getImageFileMetadata = this.getImageFileMetadata.bind(this), this.getAllImageFileMetdata = this.getAllImageFileMetdata.bind(this), this.saveImageFileMetadata = this.saveImageFileMetadata.bind(this), this.restoreStateFromCanvasStorage = this.restoreStateFromCanvasStorage.bind(this), this.assignCanvasStorage = this.assignCanvasStorage.bind(this), this.saveToCanvasStorage = this.saveToCanvasStorage.bind(this), this.debounceSaveToCanvasStorage = this.debounceSaveToCanvasStorage.bind(this), this.importCanvas = this.importCanvas.bind(this), this.exportCanvas = this.exportCanvas.bind(this), this.addContextMenu = Ov.bind(this), this.clearContextMenu = Ev.bind(this), this.isContextMenuActive = Tv.bind(this), this.getContainerSize = this.getContainerSize.bind(this), t.contains(e) || t.appendChild(e), this.registerSignal(), C(this, _, new Dn(
14108
14118
  e,
14109
14119
  g(this, be),
14110
- g(this, F),
14120
+ g(this, B),
14111
14121
  this.debounceSaveToCanvasStorage,
14112
14122
  this.saveImageFileMetadata,
14113
14123
  this.getContainerSize
@@ -14117,11 +14127,11 @@ let An = class extends Vh {
14117
14127
  } catch {
14118
14128
  console.error("Failed to restore canvas");
14119
14129
  }
14120
- this.resizeCanvas(t, e), D(this, Ut, () => this.resizeCanvas(t, e)), window.addEventListener("resize", g(this, Ut));
14130
+ this.resizeCanvas(t, e), C(this, Ut, () => this.resizeCanvas(t, e)), window.addEventListener("resize", g(this, Ut));
14121
14131
  const r = Pv.bind(this)();
14122
- D(this, Sn, jv.bind(this)(
14132
+ C(this, Sn, jv.bind(this)(
14123
14133
  r.options
14124
- )), D(this, In, Nv.bind(this)()), D(this, xn, Uv.bind(this)(
14134
+ )), C(this, In, Nv.bind(this)()), C(this, xn, Uv.bind(this)(
14125
14135
  r.options
14126
14136
  )), this.dispatchEvent(new Event("load"));
14127
14137
  const i = async () => {
@@ -14143,24 +14153,24 @@ let An = class extends Vh {
14143
14153
  }
14144
14154
  // Register signal
14145
14155
  registerSignal() {
14146
- g(this, F).on(nt.start, Gv.bind(this), "spinner"), g(this, F).on(nt.done, Xv.bind(this)), g(this, F).on(ke.Open, this.addContextMenu), g(this, F).on(ke.Close, this.clearContextMenu), g(this, F).on(ze.Change, () => {
14156
+ g(this, B).on(rt.start, Gv.bind(this), "spinner"), g(this, B).on(rt.done, Xv.bind(this)), g(this, B).on(ke.Open, this.addContextMenu), g(this, B).on(ke.Close, this.clearContextMenu), g(this, B).on(ze.Change, () => {
14147
14157
  for (const t of g(this, Ue))
14148
14158
  try {
14149
14159
  t();
14150
14160
  } catch (e) {
14151
14161
  console.error("onCanvasChange handler failed", e);
14152
14162
  }
14153
- }), g(this, F).on(rt.Save, this.saveToCanvasStorage), g(this, F).on(rt.SaveCompleted, () => {
14154
- }), g(this, F).on(
14155
- rt.SaveFailed,
14163
+ }), g(this, B).on(it.Save, this.saveToCanvasStorage), g(this, B).on(it.SaveCompleted, () => {
14164
+ }), g(this, B).on(
14165
+ it.SaveFailed,
14156
14166
  () => console.error("Failed to Save!")
14157
14167
  );
14158
14168
  }
14159
14169
  // need to check if this is good practice
14160
14170
  async warmUpStorage() {
14161
- g(this, W) || D(this, W, new It());
14171
+ g(this, D) || C(this, D, new Fe());
14162
14172
  try {
14163
- await g(this, W).readAll();
14173
+ await g(this, D).readAll();
14164
14174
  } catch (t) {
14165
14175
  console.error("Storage warm-up failed", t);
14166
14176
  }
@@ -14182,7 +14192,7 @@ let An = class extends Vh {
14182
14192
  * @param saveFrequency How often should auto save execute
14183
14193
  */
14184
14194
  assignCanvasStorage(t, e = g(this, Pt)) {
14185
- D(this, G, t), D(this, Pt, e), g(this, jt) && clearInterval(g(this, jt)), D(this, jt, setInterval(
14195
+ C(this, G, t), C(this, Pt, e), g(this, jt) && clearInterval(g(this, jt)), C(this, jt, setInterval(
14186
14196
  this.saveToCanvasStorage,
14187
14197
  g(this, Pt)
14188
14198
  ));
@@ -14191,7 +14201,7 @@ let An = class extends Vh {
14191
14201
  * @param storage File storage captures the information about the image data that has previously been added. Made more efficient by using SHA of the image data for storage.
14192
14202
  */
14193
14203
  assignFileStorage(t) {
14194
- D(this, W, t);
14204
+ C(this, D, t);
14195
14205
  }
14196
14206
  /**
14197
14207
  * Duplicate images will not be written to the database
@@ -14199,10 +14209,10 @@ let An = class extends Vh {
14199
14209
  * @returns The unique ID that the image has been logged with. This is a hashed version of the image data URL
14200
14210
  */
14201
14211
  async saveImageFileMetadata(t) {
14202
- g(this, W) || D(this, W, new It());
14212
+ g(this, D) || C(this, D, new Fe());
14203
14213
  try {
14204
14214
  const e = await Hr(t);
14205
- return await g(this, W).checkIfImageStored(e) ? e : await g(this, W).write(t);
14215
+ return await g(this, D).checkIfImageStored(e) ? e : await g(this, D).write(t);
14206
14216
  } catch (e) {
14207
14217
  console.error(e);
14208
14218
  }
@@ -14212,9 +14222,9 @@ let An = class extends Vh {
14212
14222
  * @returns
14213
14223
  */
14214
14224
  async getImageFileMetadata(t) {
14215
- g(this, W) || D(this, W, new It());
14225
+ g(this, D) || C(this, D, new Fe());
14216
14226
  try {
14217
- return await g(this, W).read(t);
14227
+ return await g(this, D).read(t);
14218
14228
  } catch (e) {
14219
14229
  console.error(e);
14220
14230
  }
@@ -14223,17 +14233,17 @@ let An = class extends Vh {
14223
14233
  * @returns All file metadata saved in connected storage
14224
14234
  */
14225
14235
  async getAllImageFileMetdata() {
14226
- g(this, W) || D(this, W, new It());
14236
+ g(this, D) || C(this, D, new Fe());
14227
14237
  try {
14228
- return await g(this, W).readAll();
14238
+ return await g(this, D).readAll();
14229
14239
  } catch (t) {
14230
14240
  console.error(t);
14231
14241
  }
14232
14242
  }
14233
14243
  async deleteAllImageFileMetadata() {
14234
- g(this, W) || D(this, W, new It());
14244
+ g(this, D) || C(this, D, new Fe());
14235
14245
  try {
14236
- await g(this, W).deleteAll();
14246
+ await g(this, D).deleteAll();
14237
14247
  } catch (t) {
14238
14248
  console.error(t);
14239
14249
  }
@@ -14254,13 +14264,13 @@ let An = class extends Vh {
14254
14264
  * Schedule the auto save to the canvas storage based on timer
14255
14265
  */
14256
14266
  debounceSaveToCanvasStorage(t = 1e3) {
14257
- g(this, G) || D(this, G, new $e(this.name)), clearTimeout(g(this, wn)), D(this, wn, setTimeout(this.saveToCanvasStorage, t));
14267
+ g(this, G) || C(this, G, new $e(this.name)), clearTimeout(g(this, wn)), C(this, wn, setTimeout(this.saveToCanvasStorage, t));
14258
14268
  }
14259
14269
  async saveToCanvasStorage() {
14260
- g(this, G) || D(this, G, new $e(this.name)), g(this, G).write(Jr(g(this, _))).then(() => g(this, F).emit(rt.SaveCompleted)).catch(() => g(this, F).emit(rt.SaveFailed));
14270
+ g(this, G) || C(this, G, new $e(this.name)), g(this, G).write(Jr(g(this, _))).then(() => g(this, B).emit(it.SaveCompleted)).catch(() => g(this, B).emit(it.SaveFailed));
14261
14271
  }
14262
14272
  async restoreStateFromCanvasStorage() {
14263
- g(this, G) || D(this, G, new $e(this.name));
14273
+ g(this, G) || C(this, G, new $e(this.name)), g(this, D) || C(this, D, new Fe());
14264
14274
  const t = await g(this, G).read();
14265
14275
  if (!t) {
14266
14276
  const r = localStorage.getItem(this.name);
@@ -14282,13 +14292,18 @@ let An = class extends Vh {
14282
14292
  }
14283
14293
  try {
14284
14294
  const r = ba(e);
14285
- await ya(r, g(this, _), this.getImageFileMetadata);
14295
+ await ya(
14296
+ r,
14297
+ g(this, _),
14298
+ this.getImageFileMetadata,
14299
+ g(this, D).write
14300
+ );
14286
14301
  } catch (r) {
14287
14302
  console.warn("Saved canvas failed schema validation; ignoring.", r);
14288
14303
  }
14289
14304
  }
14290
14305
  async deleteStateFromCanvasStorage() {
14291
- g(this, G) || D(this, G, new $e(this.name));
14306
+ g(this, G) || C(this, G, new $e(this.name));
14292
14307
  try {
14293
14308
  g(this, G).delete();
14294
14309
  } catch (t) {
@@ -14296,7 +14311,7 @@ let An = class extends Vh {
14296
14311
  }
14297
14312
  }
14298
14313
  async renameCanvasInStorage(t) {
14299
- g(this, G) || D(this, G, new $e(this.name));
14314
+ g(this, G) || C(this, G, new $e(this.name));
14300
14315
  try {
14301
14316
  g(this, G).changeCanvasKey(this.name, t);
14302
14317
  } catch (e) {
@@ -14321,7 +14336,7 @@ let An = class extends Vh {
14321
14336
  }
14322
14337
  async addImages(t) {
14323
14338
  if (!g(this, _)) return;
14324
- const e = g(this, _e).getBoundingClientRect(), r = e.left + e.width / 2, i = e.top + e.height / 2, [n, o] = Fe(r, i, g(this, _)), a = await im(
14339
+ const e = g(this, _e).getBoundingClientRect(), r = e.left + e.width / 2, i = e.top + e.height / 2, [n, o] = Be(r, i, g(this, _)), a = await im(
14325
14340
  t,
14326
14341
  (s) => g(this, _).addImageToCanvas(s, n, o, 1, 1, !0)
14327
14342
  );
@@ -14345,7 +14360,7 @@ let An = class extends Vh {
14345
14360
  */
14346
14361
  async addImageFromUrl(t) {
14347
14362
  if (!g(this, _)) return;
14348
- const e = g(this, _e).getBoundingClientRect(), r = e.left + e.width / 2, i = e.top + e.height / 2, [n, o] = Fe(r, i, g(this, _)), a = await g(this, _).addImageToCanvas(t, n, o, 1, 1, !0);
14363
+ const e = g(this, _e).getBoundingClientRect(), r = e.left + e.width / 2, i = e.top + e.height / 2, [n, o] = Be(r, i, g(this, _)), a = await g(this, _).addImageToCanvas(t, n, o, 1, 1, !0);
14349
14364
  g(this, be).push(On(g(this, _), [a]));
14350
14365
  }
14351
14366
  async copyImage() {
@@ -14379,12 +14394,12 @@ let An = class extends Vh {
14379
14394
  }
14380
14395
  async exportCanvas(t = "infinite-canvas.json") {
14381
14396
  if (!g(this, _)) return;
14382
- g(this, F).emit(nt.start, "spinner");
14397
+ g(this, B).emit(rt.start, "spinner");
14383
14398
  const e = await this.getAllImageFileMetdata(), r = Jr(g(this, _), e);
14384
- om(t, r), g(this, F).emit(nt.done);
14399
+ om(t, r), g(this, B).emit(rt.done);
14385
14400
  }
14386
14401
  async importCanvas(t) {
14387
- if (g(this, F).emit(nt.start, "spinner"), !g(this, _) || !t || t.length !== 1) return;
14402
+ if (g(this, D) || C(this, D, new Fe()), g(this, B).emit(rt.start, "spinner"), !g(this, _) || !t || t.length !== 1) return;
14388
14403
  const e = t[0];
14389
14404
  if (!e.type || !e.type.includes("json") && !e.name.toLowerCase().endsWith(".json"))
14390
14405
  return;
@@ -14398,11 +14413,16 @@ let An = class extends Vh {
14398
14413
  }
14399
14414
  try {
14400
14415
  const n = ba(i);
14401
- g(this, _).selectionManager.clear(), await ya(n, g(this, _), this.getImageFileMetadata), g(this, F).emit(rt.Save);
14416
+ g(this, _).selectionManager.clear(), await ya(
14417
+ n,
14418
+ g(this, _),
14419
+ this.getImageFileMetadata,
14420
+ g(this, D).write
14421
+ ), g(this, B).emit(it.Save);
14402
14422
  } catch (n) {
14403
14423
  console.warn("Saved canvas failed schema validation; ignoring.", n);
14404
14424
  } finally {
14405
- g(this, F).emit(nt.done);
14425
+ g(this, B).emit(rt.done);
14406
14426
  }
14407
14427
  }
14408
14428
  clearCanvas() {
@@ -14424,10 +14444,10 @@ let An = class extends Vh {
14424
14444
  }
14425
14445
  };
14426
14446
  _ = /* @__PURE__ */ new WeakMap();
14427
- F = /* @__PURE__ */ new WeakMap();
14447
+ B = /* @__PURE__ */ new WeakMap();
14428
14448
  $n = /* @__PURE__ */ new WeakMap();
14429
14449
  be = /* @__PURE__ */ new WeakMap();
14430
- W = /* @__PURE__ */ new WeakMap();
14450
+ D = /* @__PURE__ */ new WeakMap();
14431
14451
  G = /* @__PURE__ */ new WeakMap();
14432
14452
  Pt = /* @__PURE__ */ new WeakMap();
14433
14453
  wn = /* @__PURE__ */ new WeakMap();
@@ -14660,4 +14680,4 @@ export {
14660
14680
  ov as ZOOM_MAX,
14661
14681
  iv as ZOOM_MIN
14662
14682
  };
14663
- //# sourceMappingURL=index.js.js.map
14683
+ //# sourceMappingURL=index.js.map