@jsdev_ninja/core 0.10.4 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.es.js CHANGED
@@ -9,28 +9,28 @@ var b;
9
9
  }
10
10
  r.assertNever = t, r.arrayToEnum = (s) => {
11
11
  const a = {};
12
- for (const i of s)
13
- a[i] = i;
12
+ for (const o of s)
13
+ a[o] = o;
14
14
  return a;
15
15
  }, r.getValidEnumValues = (s) => {
16
- const a = r.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), i = {};
17
- for (const o of a)
18
- i[o] = s[o];
19
- return r.objectValues(i);
16
+ const a = r.objectKeys(s).filter((d) => typeof s[s[d]] != "number"), o = {};
17
+ for (const d of a)
18
+ o[d] = s[d];
19
+ return r.objectValues(o);
20
20
  }, r.objectValues = (s) => r.objectKeys(s).map(function(a) {
21
21
  return s[a];
22
22
  }), r.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
23
23
  const a = [];
24
- for (const i in s)
25
- Object.prototype.hasOwnProperty.call(s, i) && a.push(i);
24
+ for (const o in s)
25
+ Object.prototype.hasOwnProperty.call(s, o) && a.push(o);
26
26
  return a;
27
27
  }, r.find = (s, a) => {
28
- for (const i of s)
29
- if (a(i))
30
- return i;
28
+ for (const o of s)
29
+ if (a(o))
30
+ return o;
31
31
  }, r.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && isFinite(s) && Math.floor(s) === s;
32
32
  function n(s, a = " | ") {
33
- return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
33
+ return s.map((o) => typeof o == "string" ? `'${o}'` : o).join(a);
34
34
  }
35
35
  r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
36
36
  })(b || (b = {}));
@@ -101,8 +101,8 @@ const h = b.arrayToEnum([
101
101
  "invalid_intersection_types",
102
102
  "not_multiple_of",
103
103
  "not_finite"
104
- ]), Je = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
105
- class S extends Error {
104
+ ]), Ye = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
105
+ class Z extends Error {
106
106
  get errors() {
107
107
  return this.issues;
108
108
  }
@@ -119,27 +119,27 @@ class S extends Error {
119
119
  const t = e || function(a) {
120
120
  return a.message;
121
121
  }, n = { _errors: [] }, s = (a) => {
122
- for (const i of a.issues)
123
- if (i.code === "invalid_union")
124
- i.unionErrors.map(s);
125
- else if (i.code === "invalid_return_type")
126
- s(i.returnTypeError);
127
- else if (i.code === "invalid_arguments")
128
- s(i.argumentsError);
129
- else if (i.path.length === 0)
130
- n._errors.push(t(i));
122
+ for (const o of a.issues)
123
+ if (o.code === "invalid_union")
124
+ o.unionErrors.map(s);
125
+ else if (o.code === "invalid_return_type")
126
+ s(o.returnTypeError);
127
+ else if (o.code === "invalid_arguments")
128
+ s(o.argumentsError);
129
+ else if (o.path.length === 0)
130
+ n._errors.push(t(o));
131
131
  else {
132
- let o = n, f = 0;
133
- for (; f < i.path.length; ) {
134
- const u = i.path[f];
135
- f === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], f++;
132
+ let d = n, f = 0;
133
+ for (; f < o.path.length; ) {
134
+ const u = o.path[f];
135
+ f === o.path.length - 1 ? (d[u] = d[u] || { _errors: [] }, d[u]._errors.push(t(o))) : d[u] = d[u] || { _errors: [] }, d = d[u], f++;
136
136
  }
137
137
  }
138
138
  };
139
139
  return s(this), n;
140
140
  }
141
141
  static assert(e) {
142
- if (!(e instanceof S))
142
+ if (!(e instanceof Z))
143
143
  throw new Error(`Not a ZodError: ${e}`);
144
144
  }
145
145
  toString() {
@@ -161,8 +161,8 @@ class S extends Error {
161
161
  return this.flatten();
162
162
  }
163
163
  }
164
- S.create = (r) => new S(r);
165
- const J = (r, e) => {
164
+ Z.create = (r) => new Z(r);
165
+ const Y = (r, e) => {
166
166
  let t;
167
167
  switch (r.code) {
168
168
  case c.invalid_type:
@@ -218,15 +218,15 @@ const J = (r, e) => {
218
218
  }
219
219
  return { message: t };
220
220
  };
221
- let Pe = J;
222
- function Ye(r) {
223
- Pe = r;
221
+ let $e = Y;
222
+ function He(r) {
223
+ $e = r;
224
224
  }
225
225
  function pe() {
226
- return Pe;
226
+ return $e;
227
227
  }
228
228
  const ye = (r) => {
229
- const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], i = {
229
+ const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], o = {
230
230
  ...s,
231
231
  path: a
232
232
  };
@@ -236,16 +236,16 @@ const ye = (r) => {
236
236
  path: a,
237
237
  message: s.message
238
238
  };
239
- let o = "";
239
+ let d = "";
240
240
  const f = n.filter((u) => !!u).slice().reverse();
241
241
  for (const u of f)
242
- o = u(i, { data: e, defaultError: o }).message;
242
+ d = u(o, { data: e, defaultError: d }).message;
243
243
  return {
244
244
  ...s,
245
245
  path: a,
246
- message: o
246
+ message: d
247
247
  };
248
- }, He = [];
248
+ }, Ge = [];
249
249
  function l(r, e) {
250
250
  const t = pe(), n = ye({
251
251
  issueData: e,
@@ -258,7 +258,7 @@ function l(r, e) {
258
258
  // then schema-bound map if available
259
259
  t,
260
260
  // then global override map
261
- t === J ? void 0 : J
261
+ t === Y ? void 0 : Y
262
262
  // then global default map
263
263
  ].filter((s) => !!s)
264
264
  });
@@ -286,10 +286,10 @@ class w {
286
286
  static async mergeObjectAsync(e, t) {
287
287
  const n = [];
288
288
  for (const s of t) {
289
- const a = await s.key, i = await s.value;
289
+ const a = await s.key, o = await s.value;
290
290
  n.push({
291
291
  key: a,
292
- value: i
292
+ value: o
293
293
  });
294
294
  }
295
295
  return w.mergeObjectSync(e, n);
@@ -297,22 +297,22 @@ class w {
297
297
  static mergeObjectSync(e, t) {
298
298
  const n = {};
299
299
  for (const s of t) {
300
- const { key: a, value: i } = s;
301
- if (a.status === "aborted" || i.status === "aborted")
300
+ const { key: a, value: o } = s;
301
+ if (a.status === "aborted" || o.status === "aborted")
302
302
  return g;
303
- a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (n[a.value] = i.value);
303
+ a.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof o.value < "u" || s.alwaysSet) && (n[a.value] = o.value);
304
304
  }
305
305
  return { status: e.value, value: n };
306
306
  }
307
307
  }
308
308
  const g = Object.freeze({
309
309
  status: "aborted"
310
- }), W = (r) => ({ status: "dirty", value: r }), Z = (r) => ({ status: "valid", value: r }), Se = (r) => r.status === "aborted", Ce = (r) => r.status === "dirty", z = (r) => r.status === "valid", ee = (r) => typeof Promise < "u" && r instanceof Promise;
310
+ }), W = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Ce = (r) => r.status === "aborted", Ie = (r) => r.status === "dirty", z = (r) => r.status === "valid", ee = (r) => typeof Promise < "u" && r instanceof Promise;
311
311
  function ge(r, e, t, n) {
312
312
  if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
313
313
  return e.get(r);
314
314
  }
315
- function $e(r, e, t, n, s) {
315
+ function Me(r, e, t, n, s) {
316
316
  if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
317
317
  return e.set(r, t), t;
318
318
  }
@@ -320,7 +320,7 @@ var m;
320
320
  (function(r) {
321
321
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
322
322
  })(m || (m = {}));
323
- var Q, X;
323
+ var X, K;
324
324
  class O {
325
325
  constructor(e, t, n, s) {
326
326
  this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
@@ -329,7 +329,7 @@ class O {
329
329
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
330
330
  }
331
331
  }
332
- const je = (r, e) => {
332
+ const Ee = (r, e) => {
333
333
  if (z(e))
334
334
  return { success: !0, data: e.value };
335
335
  if (!r.common.issues.length)
@@ -339,7 +339,7 @@ const je = (r, e) => {
339
339
  get error() {
340
340
  if (this._error)
341
341
  return this._error;
342
- const t = new S(r.common.issues);
342
+ const t = new Z(r.common.issues);
343
343
  return this._error = t, this._error;
344
344
  }
345
345
  };
@@ -350,10 +350,10 @@ function v(r) {
350
350
  const { errorMap: e, invalid_type_error: t, required_error: n, description: s } = r;
351
351
  if (e && (t || n))
352
352
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
353
- return e ? { errorMap: e, description: s } : { errorMap: (i, o) => {
353
+ return e ? { errorMap: e, description: s } : { errorMap: (o, d) => {
354
354
  var f, u;
355
355
  const { message: p } = r;
356
- return i.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (f = p ?? n) !== null && f !== void 0 ? f : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = p ?? t) !== null && u !== void 0 ? u : o.defaultError };
356
+ return o.code === "invalid_enum_value" ? { message: p ?? d.defaultError } : typeof d.data > "u" ? { message: (f = p ?? n) !== null && f !== void 0 ? f : d.defaultError } : o.code !== "invalid_type" ? { message: d.defaultError } : { message: (u = p ?? t) !== null && u !== void 0 ? u : d.defaultError };
357
357
  }, description: s };
358
358
  }
359
359
  class _ {
@@ -416,7 +416,7 @@ class _ {
416
416
  data: e,
417
417
  parsedType: R(e)
418
418
  }, a = this._parseSync({ data: e, path: s.path, parent: s });
419
- return je(s, a);
419
+ return Ee(s, a);
420
420
  }
421
421
  "~validate"(e) {
422
422
  var t, n;
@@ -470,23 +470,23 @@ class _ {
470
470
  data: e,
471
471
  parsedType: R(e)
472
472
  }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (ee(s) ? s : Promise.resolve(s));
473
- return je(n, a);
473
+ return Ee(n, a);
474
474
  }
475
475
  refine(e, t) {
476
476
  const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
477
477
  return this._refinement((s, a) => {
478
- const i = e(s), o = () => a.addIssue({
478
+ const o = e(s), d = () => a.addIssue({
479
479
  code: c.custom,
480
480
  ...n(s)
481
481
  });
482
- return typeof Promise < "u" && i instanceof Promise ? i.then((f) => f ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
482
+ return typeof Promise < "u" && o instanceof Promise ? o.then((f) => f ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
483
483
  });
484
484
  }
485
485
  refinement(e, t) {
486
486
  return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
487
487
  }
488
488
  _refinement(e) {
489
- return new I({
489
+ return new A({
490
490
  schema: this,
491
491
  typeName: y.ZodEffects,
492
492
  effect: { type: "refinement", refinement: e }
@@ -512,10 +512,10 @@ class _ {
512
512
  return this.nullable().optional();
513
513
  }
514
514
  array() {
515
- return A.create(this);
515
+ return I.create(this);
516
516
  }
517
517
  promise() {
518
- return H.create(this, this._def);
518
+ return G.create(this, this._def);
519
519
  }
520
520
  or(e) {
521
521
  return se.create([this, e], this._def);
@@ -524,7 +524,7 @@ class _ {
524
524
  return ae.create(this, e, this._def);
525
525
  }
526
526
  transform(e) {
527
- return new I({
527
+ return new A({
528
528
  ...v(this._def),
529
529
  schema: this,
530
530
  typeName: y.ZodEffects,
@@ -541,7 +541,7 @@ class _ {
541
541
  });
542
542
  }
543
543
  brand() {
544
- return new Ie({
544
+ return new Ne({
545
545
  typeName: y.ZodBranded,
546
546
  type: this,
547
547
  ...v(this._def)
@@ -576,26 +576,26 @@ class _ {
576
576
  return this.safeParse(null).success;
577
577
  }
578
578
  }
579
- const Ge = /^c[^\s-]{8,}$/i, Qe = /^[0-9a-z]+$/, Xe = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ke = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, et = /^[a-z0-9_-]{21}$/i, tt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, rt = /^[-+]?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)?)??$/, nt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, st = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
579
+ const Qe = /^c[^\s-]{8,}$/i, Xe = /^[0-9a-z]+$/, Ke = /^[0-9A-HJKMNP-TV-Z]{26}$/i, et = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, tt = /^[a-z0-9_-]{21}$/i, rt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, nt = /^[-+]?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)?)??$/, st = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, at = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
580
580
  let Te;
581
- const at = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, it = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ot = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, dt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ct = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ut = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Me = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", lt = new RegExp(`^${Me}$`);
582
- function Ve(r) {
581
+ const it = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ot = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, dt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ct = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ut = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, lt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ve = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ft = new RegExp(`^${Ve}$`);
582
+ function De(r) {
583
583
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
584
584
  return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
585
585
  }
586
- function ft(r) {
587
- return new RegExp(`^${Ve(r)}$`);
586
+ function ht(r) {
587
+ return new RegExp(`^${De(r)}$`);
588
588
  }
589
- function De(r) {
590
- let e = `${Me}T${Ve(r)}`;
589
+ function Le(r) {
590
+ let e = `${Ve}T${De(r)}`;
591
591
  const t = [];
592
592
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
593
593
  }
594
- function ht(r, e) {
595
- return !!((e === "v4" || !e) && at.test(r) || (e === "v6" || !e) && ot.test(r));
596
- }
597
594
  function mt(r, e) {
598
- if (!tt.test(r))
595
+ return !!((e === "v4" || !e) && it.test(r) || (e === "v6" || !e) && dt.test(r));
596
+ }
597
+ function pt(r, e) {
598
+ if (!rt.test(r))
599
599
  return !1;
600
600
  try {
601
601
  const [t] = r.split("."), n = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(n));
@@ -604,8 +604,8 @@ function mt(r, e) {
604
604
  return !1;
605
605
  }
606
606
  }
607
- function pt(r, e) {
608
- return !!((e === "v4" || !e) && it.test(r) || (e === "v6" || !e) && dt.test(r));
607
+ function yt(r, e) {
608
+ return !!((e === "v4" || !e) && ot.test(r) || (e === "v6" || !e) && ct.test(r));
609
609
  }
610
610
  class C extends _ {
611
611
  _parse(e) {
@@ -639,15 +639,15 @@ class C extends _ {
639
639
  message: a.message
640
640
  }), n.dirty());
641
641
  else if (a.kind === "length") {
642
- const i = e.data.length > a.value, o = e.data.length < a.value;
643
- (i || o) && (s = this._getOrReturnCtx(e, s), i ? l(s, {
642
+ const o = e.data.length > a.value, d = e.data.length < a.value;
643
+ (o || d) && (s = this._getOrReturnCtx(e, s), o ? l(s, {
644
644
  code: c.too_big,
645
645
  maximum: a.value,
646
646
  type: "string",
647
647
  inclusive: !0,
648
648
  exact: !0,
649
649
  message: a.message
650
- }) : o && l(s, {
650
+ }) : d && l(s, {
651
651
  code: c.too_small,
652
652
  minimum: a.value,
653
653
  type: "string",
@@ -656,43 +656,43 @@ class C extends _ {
656
656
  message: a.message
657
657
  }), n.dirty());
658
658
  } else if (a.kind === "email")
659
- nt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
659
+ st.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
660
660
  validation: "email",
661
661
  code: c.invalid_string,
662
662
  message: a.message
663
663
  }), n.dirty());
664
664
  else if (a.kind === "emoji")
665
- Te || (Te = new RegExp(st, "u")), Te.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
665
+ Te || (Te = new RegExp(at, "u")), Te.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
666
666
  validation: "emoji",
667
667
  code: c.invalid_string,
668
668
  message: a.message
669
669
  }), n.dirty());
670
670
  else if (a.kind === "uuid")
671
- Ke.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
671
+ et.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
672
672
  validation: "uuid",
673
673
  code: c.invalid_string,
674
674
  message: a.message
675
675
  }), n.dirty());
676
676
  else if (a.kind === "nanoid")
677
- et.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
677
+ tt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
678
678
  validation: "nanoid",
679
679
  code: c.invalid_string,
680
680
  message: a.message
681
681
  }), n.dirty());
682
682
  else if (a.kind === "cuid")
683
- Ge.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
683
+ Qe.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
684
684
  validation: "cuid",
685
685
  code: c.invalid_string,
686
686
  message: a.message
687
687
  }), n.dirty());
688
688
  else if (a.kind === "cuid2")
689
- Qe.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
689
+ Xe.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
690
690
  validation: "cuid2",
691
691
  code: c.invalid_string,
692
692
  message: a.message
693
693
  }), n.dirty());
694
694
  else if (a.kind === "ulid")
695
- Xe.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
695
+ Ke.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
696
696
  validation: "ulid",
697
697
  code: c.invalid_string,
698
698
  message: a.message
@@ -723,39 +723,39 @@ class C extends _ {
723
723
  code: c.invalid_string,
724
724
  validation: { endsWith: a.value },
725
725
  message: a.message
726
- }), n.dirty()) : a.kind === "datetime" ? De(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
726
+ }), n.dirty()) : a.kind === "datetime" ? Le(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
727
727
  code: c.invalid_string,
728
728
  validation: "datetime",
729
729
  message: a.message
730
- }), n.dirty()) : a.kind === "date" ? lt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
730
+ }), n.dirty()) : a.kind === "date" ? ft.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
731
731
  code: c.invalid_string,
732
732
  validation: "date",
733
733
  message: a.message
734
- }), n.dirty()) : a.kind === "time" ? ft(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
734
+ }), n.dirty()) : a.kind === "time" ? ht(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
735
735
  code: c.invalid_string,
736
736
  validation: "time",
737
737
  message: a.message
738
- }), n.dirty()) : a.kind === "duration" ? rt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
738
+ }), n.dirty()) : a.kind === "duration" ? nt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
739
739
  validation: "duration",
740
740
  code: c.invalid_string,
741
741
  message: a.message
742
- }), n.dirty()) : a.kind === "ip" ? ht(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
742
+ }), n.dirty()) : a.kind === "ip" ? mt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
743
743
  validation: "ip",
744
744
  code: c.invalid_string,
745
745
  message: a.message
746
- }), n.dirty()) : a.kind === "jwt" ? mt(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), l(s, {
746
+ }), n.dirty()) : a.kind === "jwt" ? pt(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), l(s, {
747
747
  validation: "jwt",
748
748
  code: c.invalid_string,
749
749
  message: a.message
750
- }), n.dirty()) : a.kind === "cidr" ? pt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
750
+ }), n.dirty()) : a.kind === "cidr" ? yt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
751
751
  validation: "cidr",
752
752
  code: c.invalid_string,
753
753
  message: a.message
754
- }), n.dirty()) : a.kind === "base64" ? ct.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
754
+ }), n.dirty()) : a.kind === "base64" ? ut.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
755
755
  validation: "base64",
756
756
  code: c.invalid_string,
757
757
  message: a.message
758
- }), n.dirty()) : a.kind === "base64url" ? ut.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
758
+ }), n.dirty()) : a.kind === "base64url" ? lt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
759
759
  validation: "base64url",
760
760
  code: c.invalid_string,
761
761
  message: a.message
@@ -994,9 +994,9 @@ C.create = (r) => {
994
994
  ...v(r)
995
995
  });
996
996
  };
997
- function yt(r, e) {
998
- const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
999
- return a % i / Math.pow(10, s);
997
+ function gt(r, e) {
998
+ const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), o = parseInt(e.toFixed(s).replace(".", ""));
999
+ return a % o / Math.pow(10, s);
1000
1000
  }
1001
1001
  class $ extends _ {
1002
1002
  constructor() {
@@ -1033,7 +1033,7 @@ class $ extends _ {
1033
1033
  inclusive: a.inclusive,
1034
1034
  exact: !1,
1035
1035
  message: a.message
1036
- }), s.dirty()) : a.kind === "multipleOf" ? yt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1036
+ }), s.dirty()) : a.kind === "multipleOf" ? gt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1037
1037
  code: c.not_multiple_of,
1038
1038
  multipleOf: a.value,
1039
1039
  message: a.message
@@ -1316,7 +1316,7 @@ class te extends _ {
1316
1316
  received: n.parsedType
1317
1317
  }), g;
1318
1318
  }
1319
- return Z(e.data);
1319
+ return S(e.data);
1320
1320
  }
1321
1321
  }
1322
1322
  te.create = (r) => new te({
@@ -1412,7 +1412,7 @@ class ve extends _ {
1412
1412
  received: n.parsedType
1413
1413
  }), g;
1414
1414
  }
1415
- return Z(e.data);
1415
+ return S(e.data);
1416
1416
  }
1417
1417
  }
1418
1418
  ve.create = (r) => new ve({
@@ -1429,7 +1429,7 @@ class re extends _ {
1429
1429
  received: n.parsedType
1430
1430
  }), g;
1431
1431
  }
1432
- return Z(e.data);
1432
+ return S(e.data);
1433
1433
  }
1434
1434
  }
1435
1435
  re.create = (r) => new re({
@@ -1446,22 +1446,22 @@ class ne extends _ {
1446
1446
  received: n.parsedType
1447
1447
  }), g;
1448
1448
  }
1449
- return Z(e.data);
1449
+ return S(e.data);
1450
1450
  }
1451
1451
  }
1452
1452
  ne.create = (r) => new ne({
1453
1453
  typeName: y.ZodNull,
1454
1454
  ...v(r)
1455
1455
  });
1456
- class Y extends _ {
1456
+ class H extends _ {
1457
1457
  constructor() {
1458
1458
  super(...arguments), this._any = !0;
1459
1459
  }
1460
1460
  _parse(e) {
1461
- return Z(e.data);
1461
+ return S(e.data);
1462
1462
  }
1463
1463
  }
1464
- Y.create = (r) => new Y({
1464
+ H.create = (r) => new H({
1465
1465
  typeName: y.ZodAny,
1466
1466
  ...v(r)
1467
1467
  });
@@ -1470,7 +1470,7 @@ class L extends _ {
1470
1470
  super(...arguments), this._unknown = !0;
1471
1471
  }
1472
1472
  _parse(e) {
1473
- return Z(e.data);
1473
+ return S(e.data);
1474
1474
  }
1475
1475
  }
1476
1476
  L.create = (r) => new L({
@@ -1501,14 +1501,14 @@ class _e extends _ {
1501
1501
  received: n.parsedType
1502
1502
  }), g;
1503
1503
  }
1504
- return Z(e.data);
1504
+ return S(e.data);
1505
1505
  }
1506
1506
  }
1507
1507
  _e.create = (r) => new _e({
1508
1508
  typeName: y.ZodVoid,
1509
1509
  ...v(r)
1510
1510
  });
1511
- class A extends _ {
1511
+ class I extends _ {
1512
1512
  _parse(e) {
1513
1513
  const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
1514
1514
  if (t.parsedType !== h.array)
@@ -1518,11 +1518,11 @@ class A extends _ {
1518
1518
  received: t.parsedType
1519
1519
  }), g;
1520
1520
  if (s.exactLength !== null) {
1521
- const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
1522
- (i || o) && (l(t, {
1523
- code: i ? c.too_big : c.too_small,
1524
- minimum: o ? s.exactLength.value : void 0,
1525
- maximum: i ? s.exactLength.value : void 0,
1521
+ const o = t.data.length > s.exactLength.value, d = t.data.length < s.exactLength.value;
1522
+ (o || d) && (l(t, {
1523
+ code: o ? c.too_big : c.too_small,
1524
+ minimum: d ? s.exactLength.value : void 0,
1525
+ maximum: o ? s.exactLength.value : void 0,
1526
1526
  type: "array",
1527
1527
  inclusive: !0,
1528
1528
  exact: !0,
@@ -1544,27 +1544,27 @@ class A extends _ {
1544
1544
  exact: !1,
1545
1545
  message: s.maxLength.message
1546
1546
  }), n.dirty()), t.common.async)
1547
- return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new O(t, i, t.path, o)))).then((i) => w.mergeArray(n, i));
1548
- const a = [...t.data].map((i, o) => s.type._parseSync(new O(t, i, t.path, o)));
1547
+ return Promise.all([...t.data].map((o, d) => s.type._parseAsync(new O(t, o, t.path, d)))).then((o) => w.mergeArray(n, o));
1548
+ const a = [...t.data].map((o, d) => s.type._parseSync(new O(t, o, t.path, d)));
1549
1549
  return w.mergeArray(n, a);
1550
1550
  }
1551
1551
  get element() {
1552
1552
  return this._def.type;
1553
1553
  }
1554
1554
  min(e, t) {
1555
- return new A({
1555
+ return new I({
1556
1556
  ...this._def,
1557
1557
  minLength: { value: e, message: m.toString(t) }
1558
1558
  });
1559
1559
  }
1560
1560
  max(e, t) {
1561
- return new A({
1561
+ return new I({
1562
1562
  ...this._def,
1563
1563
  maxLength: { value: e, message: m.toString(t) }
1564
1564
  });
1565
1565
  }
1566
1566
  length(e, t) {
1567
- return new A({
1567
+ return new I({
1568
1568
  ...this._def,
1569
1569
  exactLength: { value: e, message: m.toString(t) }
1570
1570
  });
@@ -1573,7 +1573,7 @@ class A extends _ {
1573
1573
  return this.min(1, e);
1574
1574
  }
1575
1575
  }
1576
- A.create = (r, e) => new A({
1576
+ I.create = (r, e) => new I({
1577
1577
  type: r,
1578
1578
  minLength: null,
1579
1579
  maxLength: null,
@@ -1592,7 +1592,7 @@ function B(r) {
1592
1592
  ...r._def,
1593
1593
  shape: () => e
1594
1594
  });
1595
- } else return r instanceof A ? new A({
1595
+ } else return r instanceof I ? new I({
1596
1596
  ...r._def,
1597
1597
  type: B(r.element)
1598
1598
  }) : r instanceof N ? N.create(B(r.unwrap())) : r instanceof D ? D.create(B(r.unwrap())) : r instanceof j ? j.create(r.items.map((e) => B(e))) : r;
@@ -1616,12 +1616,12 @@ class x extends _ {
1616
1616
  received: u.parsedType
1617
1617
  }), g;
1618
1618
  }
1619
- const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1619
+ const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), d = [];
1620
1620
  if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip"))
1621
1621
  for (const u in s.data)
1622
- i.includes(u) || o.push(u);
1622
+ o.includes(u) || d.push(u);
1623
1623
  const f = [];
1624
- for (const u of i) {
1624
+ for (const u of o) {
1625
1625
  const p = a[u], T = s.data[u];
1626
1626
  f.push({
1627
1627
  key: { status: "valid", value: u },
@@ -1632,20 +1632,20 @@ class x extends _ {
1632
1632
  if (this._def.catchall instanceof P) {
1633
1633
  const u = this._def.unknownKeys;
1634
1634
  if (u === "passthrough")
1635
- for (const p of o)
1635
+ for (const p of d)
1636
1636
  f.push({
1637
1637
  key: { status: "valid", value: p },
1638
1638
  value: { status: "valid", value: s.data[p] }
1639
1639
  });
1640
1640
  else if (u === "strict")
1641
- o.length > 0 && (l(s, {
1641
+ d.length > 0 && (l(s, {
1642
1642
  code: c.unrecognized_keys,
1643
- keys: o
1643
+ keys: d
1644
1644
  }), n.dirty());
1645
1645
  else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1646
1646
  } else {
1647
1647
  const u = this._def.catchall;
1648
- for (const p of o) {
1648
+ for (const p of d) {
1649
1649
  const T = s.data[p];
1650
1650
  f.push({
1651
1651
  key: { status: "valid", value: p },
@@ -1679,10 +1679,10 @@ class x extends _ {
1679
1679
  unknownKeys: "strict",
1680
1680
  ...e !== void 0 ? {
1681
1681
  errorMap: (t, n) => {
1682
- var s, a, i, o;
1683
- const f = (i = (a = (s = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(s, t, n).message) !== null && i !== void 0 ? i : n.defaultError;
1682
+ var s, a, o, d;
1683
+ const f = (o = (a = (s = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(s, t, n).message) !== null && o !== void 0 ? o : n.defaultError;
1684
1684
  return t.code === "unrecognized_keys" ? {
1685
- message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : f
1685
+ message: (d = m.errToObj(e).message) !== null && d !== void 0 ? d : f
1686
1686
  } : {
1687
1687
  message: f
1688
1688
  };
@@ -1860,7 +1860,7 @@ class x extends _ {
1860
1860
  });
1861
1861
  }
1862
1862
  keyof() {
1863
- return Le(b.objectKeys(this.shape));
1863
+ return ze(b.objectKeys(this.shape));
1864
1864
  }
1865
1865
  }
1866
1866
  x.create = (r, e) => new x({
@@ -1888,21 +1888,21 @@ class se extends _ {
1888
1888
  _parse(e) {
1889
1889
  const { ctx: t } = this._processInputParams(e), n = this._def.options;
1890
1890
  function s(a) {
1891
- for (const o of a)
1892
- if (o.result.status === "valid")
1893
- return o.result;
1894
- for (const o of a)
1895
- if (o.result.status === "dirty")
1896
- return t.common.issues.push(...o.ctx.common.issues), o.result;
1897
- const i = a.map((o) => new S(o.ctx.common.issues));
1891
+ for (const d of a)
1892
+ if (d.result.status === "valid")
1893
+ return d.result;
1894
+ for (const d of a)
1895
+ if (d.result.status === "dirty")
1896
+ return t.common.issues.push(...d.ctx.common.issues), d.result;
1897
+ const o = a.map((d) => new Z(d.ctx.common.issues));
1898
1898
  return l(t, {
1899
1899
  code: c.invalid_union,
1900
- unionErrors: i
1900
+ unionErrors: o
1901
1901
  }), g;
1902
1902
  }
1903
1903
  if (t.common.async)
1904
1904
  return Promise.all(n.map(async (a) => {
1905
- const i = {
1905
+ const o = {
1906
1906
  ...t,
1907
1907
  common: {
1908
1908
  ...t.common,
@@ -1914,14 +1914,14 @@ class se extends _ {
1914
1914
  result: await a._parseAsync({
1915
1915
  data: t.data,
1916
1916
  path: t.path,
1917
- parent: i
1917
+ parent: o
1918
1918
  }),
1919
- ctx: i
1919
+ ctx: o
1920
1920
  };
1921
1921
  })).then(s);
1922
1922
  {
1923
1923
  let a;
1924
- const i = [];
1924
+ const o = [];
1925
1925
  for (const f of n) {
1926
1926
  const u = {
1927
1927
  ...t,
@@ -1937,14 +1937,14 @@ class se extends _ {
1937
1937
  });
1938
1938
  if (p.status === "valid")
1939
1939
  return p;
1940
- p.status === "dirty" && !a && (a = { result: p, ctx: u }), u.common.issues.length && i.push(u.common.issues);
1940
+ p.status === "dirty" && !a && (a = { result: p, ctx: u }), u.common.issues.length && o.push(u.common.issues);
1941
1941
  }
1942
1942
  if (a)
1943
1943
  return t.common.issues.push(...a.ctx.common.issues), a.result;
1944
- const o = i.map((f) => new S(f));
1944
+ const d = o.map((f) => new Z(f));
1945
1945
  return l(t, {
1946
1946
  code: c.invalid_union,
1947
- unionErrors: o
1947
+ unionErrors: d
1948
1948
  }), g;
1949
1949
  }
1950
1950
  }
@@ -1957,7 +1957,7 @@ se.create = (r, e) => new se({
1957
1957
  typeName: y.ZodUnion,
1958
1958
  ...v(e)
1959
1959
  });
1960
- const E = (r) => r instanceof oe ? E(r.schema) : r instanceof I ? E(r.innerType()) : r instanceof de ? [r.value] : r instanceof V ? r.options : r instanceof ce ? b.objectValues(r.enum) : r instanceof ue ? E(r._def.innerType) : r instanceof re ? [void 0] : r instanceof ne ? [null] : r instanceof N ? [void 0, ...E(r.unwrap())] : r instanceof D ? [null, ...E(r.unwrap())] : r instanceof Ie || r instanceof fe ? E(r.unwrap()) : r instanceof le ? E(r._def.innerType) : [];
1960
+ const E = (r) => r instanceof oe ? E(r.schema) : r instanceof A ? E(r.innerType()) : r instanceof de ? [r.value] : r instanceof V ? r.options : r instanceof ce ? b.objectValues(r.enum) : r instanceof ue ? E(r._def.innerType) : r instanceof re ? [void 0] : r instanceof ne ? [null] : r instanceof N ? [void 0, ...E(r.unwrap())] : r instanceof D ? [null, ...E(r.unwrap())] : r instanceof Ne || r instanceof fe ? E(r.unwrap()) : r instanceof le ? E(r._def.innerType) : [];
1961
1961
  class ke extends _ {
1962
1962
  _parse(e) {
1963
1963
  const { ctx: t } = this._processInputParams(e);
@@ -2002,13 +2002,13 @@ class ke extends _ {
2002
2002
  static create(e, t, n) {
2003
2003
  const s = /* @__PURE__ */ new Map();
2004
2004
  for (const a of t) {
2005
- const i = E(a.shape[e]);
2006
- if (!i.length)
2005
+ const o = E(a.shape[e]);
2006
+ if (!o.length)
2007
2007
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2008
- for (const o of i) {
2009
- if (s.has(o))
2010
- throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
2011
- s.set(o, a);
2008
+ for (const d of o) {
2009
+ if (s.has(d))
2010
+ throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);
2011
+ s.set(d, a);
2012
2012
  }
2013
2013
  }
2014
2014
  return new ke({
@@ -2025,20 +2025,20 @@ function Ae(r, e) {
2025
2025
  if (r === e)
2026
2026
  return { valid: !0, data: r };
2027
2027
  if (t === h.object && n === h.object) {
2028
- const s = b.objectKeys(e), a = b.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
2029
- for (const o of a) {
2030
- const f = Ae(r[o], e[o]);
2028
+ const s = b.objectKeys(e), a = b.objectKeys(r).filter((d) => s.indexOf(d) !== -1), o = { ...r, ...e };
2029
+ for (const d of a) {
2030
+ const f = Ae(r[d], e[d]);
2031
2031
  if (!f.valid)
2032
2032
  return { valid: !1 };
2033
- i[o] = f.data;
2033
+ o[d] = f.data;
2034
2034
  }
2035
- return { valid: !0, data: i };
2035
+ return { valid: !0, data: o };
2036
2036
  } else if (t === h.array && n === h.array) {
2037
2037
  if (r.length !== e.length)
2038
2038
  return { valid: !1 };
2039
2039
  const s = [];
2040
2040
  for (let a = 0; a < r.length; a++) {
2041
- const i = r[a], o = e[a], f = Ae(i, o);
2041
+ const o = r[a], d = e[a], f = Ae(o, d);
2042
2042
  if (!f.valid)
2043
2043
  return { valid: !1 };
2044
2044
  s.push(f.data);
@@ -2048,11 +2048,11 @@ function Ae(r, e) {
2048
2048
  }
2049
2049
  class ae extends _ {
2050
2050
  _parse(e) {
2051
- const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
2052
- if (Se(a) || Se(i))
2051
+ const { status: t, ctx: n } = this._processInputParams(e), s = (a, o) => {
2052
+ if (Ce(a) || Ce(o))
2053
2053
  return g;
2054
- const o = Ae(a.value, i.value);
2055
- return o.valid ? ((Ce(a) || Ce(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
2054
+ const d = Ae(a.value, o.value);
2055
+ return d.valid ? ((Ie(a) || Ie(o)) && t.dirty(), { status: t.value, value: d.data }) : (l(n, {
2056
2056
  code: c.invalid_intersection_types
2057
2057
  }), g);
2058
2058
  };
@@ -2067,7 +2067,7 @@ class ae extends _ {
2067
2067
  path: n.path,
2068
2068
  parent: n
2069
2069
  })
2070
- ]).then(([a, i]) => s(a, i)) : s(this._def.left._parseSync({
2070
+ ]).then(([a, o]) => s(a, o)) : s(this._def.left._parseSync({
2071
2071
  data: n.data,
2072
2072
  path: n.path,
2073
2073
  parent: n
@@ -2108,11 +2108,11 @@ class j extends _ {
2108
2108
  exact: !1,
2109
2109
  type: "array"
2110
2110
  }), t.dirty());
2111
- const a = [...n.data].map((i, o) => {
2112
- const f = this._def.items[o] || this._def.rest;
2113
- return f ? f._parse(new O(n, i, n.path, o)) : null;
2114
- }).filter((i) => !!i);
2115
- return n.common.async ? Promise.all(a).then((i) => w.mergeArray(t, i)) : w.mergeArray(t, a);
2111
+ const a = [...n.data].map((o, d) => {
2112
+ const f = this._def.items[d] || this._def.rest;
2113
+ return f ? f._parse(new O(n, o, n.path, d)) : null;
2114
+ }).filter((o) => !!o);
2115
+ return n.common.async ? Promise.all(a).then((o) => w.mergeArray(t, o)) : w.mergeArray(t, a);
2116
2116
  }
2117
2117
  get items() {
2118
2118
  return this._def.items;
@@ -2149,12 +2149,12 @@ class ie extends _ {
2149
2149
  expected: h.object,
2150
2150
  received: n.parsedType
2151
2151
  }), g;
2152
- const s = [], a = this._def.keyType, i = this._def.valueType;
2153
- for (const o in n.data)
2152
+ const s = [], a = this._def.keyType, o = this._def.valueType;
2153
+ for (const d in n.data)
2154
2154
  s.push({
2155
- key: a._parse(new O(n, o, n.path, o)),
2156
- value: i._parse(new O(n, n.data[o], n.path, o)),
2157
- alwaysSet: o in n.data
2155
+ key: a._parse(new O(n, d, n.path, d)),
2156
+ value: o._parse(new O(n, n.data[d], n.path, d)),
2157
+ alwaysSet: d in n.data
2158
2158
  });
2159
2159
  return n.common.async ? w.mergeObjectAsync(t, s) : w.mergeObjectSync(t, s);
2160
2160
  }
@@ -2190,30 +2190,30 @@ class be extends _ {
2190
2190
  expected: h.map,
2191
2191
  received: n.parsedType
2192
2192
  }), g;
2193
- const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, f], u) => ({
2194
- key: s._parse(new O(n, o, n.path, [u, "key"])),
2193
+ const s = this._def.keyType, a = this._def.valueType, o = [...n.data.entries()].map(([d, f], u) => ({
2194
+ key: s._parse(new O(n, d, n.path, [u, "key"])),
2195
2195
  value: a._parse(new O(n, f, n.path, [u, "value"]))
2196
2196
  }));
2197
2197
  if (n.common.async) {
2198
- const o = /* @__PURE__ */ new Map();
2198
+ const d = /* @__PURE__ */ new Map();
2199
2199
  return Promise.resolve().then(async () => {
2200
- for (const f of i) {
2200
+ for (const f of o) {
2201
2201
  const u = await f.key, p = await f.value;
2202
2202
  if (u.status === "aborted" || p.status === "aborted")
2203
2203
  return g;
2204
- (u.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(u.value, p.value);
2204
+ (u.status === "dirty" || p.status === "dirty") && t.dirty(), d.set(u.value, p.value);
2205
2205
  }
2206
- return { status: t.value, value: o };
2206
+ return { status: t.value, value: d };
2207
2207
  });
2208
2208
  } else {
2209
- const o = /* @__PURE__ */ new Map();
2210
- for (const f of i) {
2209
+ const d = /* @__PURE__ */ new Map();
2210
+ for (const f of o) {
2211
2211
  const u = f.key, p = f.value;
2212
2212
  if (u.status === "aborted" || p.status === "aborted")
2213
2213
  return g;
2214
- (u.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(u.value, p.value);
2214
+ (u.status === "dirty" || p.status === "dirty") && t.dirty(), d.set(u.value, p.value);
2215
2215
  }
2216
- return { status: t.value, value: o };
2216
+ return { status: t.value, value: d };
2217
2217
  }
2218
2218
  }
2219
2219
  }
@@ -2249,7 +2249,7 @@ class F extends _ {
2249
2249
  message: s.maxSize.message
2250
2250
  }), t.dirty());
2251
2251
  const a = this._def.valueType;
2252
- function i(f) {
2252
+ function o(f) {
2253
2253
  const u = /* @__PURE__ */ new Set();
2254
2254
  for (const p of f) {
2255
2255
  if (p.status === "aborted")
@@ -2258,8 +2258,8 @@ class F extends _ {
2258
2258
  }
2259
2259
  return { status: t.value, value: u };
2260
2260
  }
2261
- const o = [...n.data.values()].map((f, u) => a._parse(new O(n, f, n.path, u)));
2262
- return n.common.async ? Promise.all(o).then((f) => i(f)) : i(o);
2261
+ const d = [...n.data.values()].map((f, u) => a._parse(new O(n, f, n.path, u)));
2262
+ return n.common.async ? Promise.all(d).then((f) => o(f)) : o(d);
2263
2263
  }
2264
2264
  min(e, t) {
2265
2265
  return new F({
@@ -2299,15 +2299,15 @@ class q extends _ {
2299
2299
  expected: h.function,
2300
2300
  received: t.parsedType
2301
2301
  }), g;
2302
- function n(o, f) {
2302
+ function n(d, f) {
2303
2303
  return ye({
2304
- data: o,
2304
+ data: d,
2305
2305
  path: t.path,
2306
2306
  errorMaps: [
2307
2307
  t.common.contextualErrorMap,
2308
2308
  t.schemaErrorMap,
2309
2309
  pe(),
2310
- J
2310
+ Y
2311
2311
  ].filter((u) => !!u),
2312
2312
  issueData: {
2313
2313
  code: c.invalid_arguments,
@@ -2315,15 +2315,15 @@ class q extends _ {
2315
2315
  }
2316
2316
  });
2317
2317
  }
2318
- function s(o, f) {
2318
+ function s(d, f) {
2319
2319
  return ye({
2320
- data: o,
2320
+ data: d,
2321
2321
  path: t.path,
2322
2322
  errorMaps: [
2323
2323
  t.common.contextualErrorMap,
2324
2324
  t.schemaErrorMap,
2325
2325
  pe(),
2326
- J
2326
+ Y
2327
2327
  ].filter((u) => !!u),
2328
2328
  issueData: {
2329
2329
  code: c.invalid_return_type,
@@ -2331,26 +2331,26 @@ class q extends _ {
2331
2331
  }
2332
2332
  });
2333
2333
  }
2334
- const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2335
- if (this._def.returns instanceof H) {
2336
- const o = this;
2337
- return Z(async function(...f) {
2338
- const u = new S([]), p = await o._def.args.parseAsync(f, a).catch((we) => {
2334
+ const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
2335
+ if (this._def.returns instanceof G) {
2336
+ const d = this;
2337
+ return S(async function(...f) {
2338
+ const u = new Z([]), p = await d._def.args.parseAsync(f, a).catch((we) => {
2339
2339
  throw u.addIssue(n(f, we)), u;
2340
- }), T = await Reflect.apply(i, this, p);
2341
- return await o._def.returns._def.type.parseAsync(T, a).catch((we) => {
2340
+ }), T = await Reflect.apply(o, this, p);
2341
+ return await d._def.returns._def.type.parseAsync(T, a).catch((we) => {
2342
2342
  throw u.addIssue(s(T, we)), u;
2343
2343
  });
2344
2344
  });
2345
2345
  } else {
2346
- const o = this;
2347
- return Z(function(...f) {
2348
- const u = o._def.args.safeParse(f, a);
2346
+ const d = this;
2347
+ return S(function(...f) {
2348
+ const u = d._def.args.safeParse(f, a);
2349
2349
  if (!u.success)
2350
- throw new S([n(f, u.error)]);
2351
- const p = Reflect.apply(i, this, u.data), T = o._def.returns.safeParse(p, a);
2350
+ throw new Z([n(f, u.error)]);
2351
+ const p = Reflect.apply(o, this, u.data), T = d._def.returns.safeParse(p, a);
2352
2352
  if (!T.success)
2353
- throw new S([s(p, T.error)]);
2353
+ throw new Z([s(p, T.error)]);
2354
2354
  return T.data;
2355
2355
  });
2356
2356
  }
@@ -2423,7 +2423,7 @@ de.create = (r, e) => new de({
2423
2423
  typeName: y.ZodLiteral,
2424
2424
  ...v(e)
2425
2425
  });
2426
- function Le(r, e) {
2426
+ function ze(r, e) {
2427
2427
  return new V({
2428
2428
  values: r,
2429
2429
  typeName: y.ZodEnum,
@@ -2432,7 +2432,7 @@ function Le(r, e) {
2432
2432
  }
2433
2433
  class V extends _ {
2434
2434
  constructor() {
2435
- super(...arguments), Q.set(this, void 0);
2435
+ super(...arguments), X.set(this, void 0);
2436
2436
  }
2437
2437
  _parse(e) {
2438
2438
  if (typeof e.data != "string") {
@@ -2443,7 +2443,7 @@ class V extends _ {
2443
2443
  code: c.invalid_type
2444
2444
  }), g;
2445
2445
  }
2446
- if (ge(this, Q) || $e(this, Q, new Set(this._def.values)), !ge(this, Q).has(e.data)) {
2446
+ if (ge(this, X) || Me(this, X, new Set(this._def.values)), !ge(this, X).has(e.data)) {
2447
2447
  const t = this._getOrReturnCtx(e), n = this._def.values;
2448
2448
  return l(t, {
2449
2449
  received: t.data,
@@ -2451,7 +2451,7 @@ class V extends _ {
2451
2451
  options: n
2452
2452
  }), g;
2453
2453
  }
2454
- return Z(e.data);
2454
+ return S(e.data);
2455
2455
  }
2456
2456
  get options() {
2457
2457
  return this._def.values;
@@ -2487,11 +2487,11 @@ class V extends _ {
2487
2487
  });
2488
2488
  }
2489
2489
  }
2490
- Q = /* @__PURE__ */ new WeakMap();
2491
- V.create = Le;
2490
+ X = /* @__PURE__ */ new WeakMap();
2491
+ V.create = ze;
2492
2492
  class ce extends _ {
2493
2493
  constructor() {
2494
- super(...arguments), X.set(this, void 0);
2494
+ super(...arguments), K.set(this, void 0);
2495
2495
  }
2496
2496
  _parse(e) {
2497
2497
  const t = b.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
@@ -2503,7 +2503,7 @@ class ce extends _ {
2503
2503
  code: c.invalid_type
2504
2504
  }), g;
2505
2505
  }
2506
- if (ge(this, X) || $e(this, X, new Set(b.getValidEnumValues(this._def.values))), !ge(this, X).has(e.data)) {
2506
+ if (ge(this, K) || Me(this, K, new Set(b.getValidEnumValues(this._def.values))), !ge(this, K).has(e.data)) {
2507
2507
  const s = b.objectValues(t);
2508
2508
  return l(n, {
2509
2509
  received: n.data,
@@ -2511,19 +2511,19 @@ class ce extends _ {
2511
2511
  options: s
2512
2512
  }), g;
2513
2513
  }
2514
- return Z(e.data);
2514
+ return S(e.data);
2515
2515
  }
2516
2516
  get enum() {
2517
2517
  return this._def.values;
2518
2518
  }
2519
2519
  }
2520
- X = /* @__PURE__ */ new WeakMap();
2520
+ K = /* @__PURE__ */ new WeakMap();
2521
2521
  ce.create = (r, e) => new ce({
2522
2522
  values: r,
2523
2523
  typeName: y.ZodNativeEnum,
2524
2524
  ...v(e)
2525
2525
  });
2526
- class H extends _ {
2526
+ class G extends _ {
2527
2527
  unwrap() {
2528
2528
  return this._def.type;
2529
2529
  }
@@ -2536,18 +2536,18 @@ class H extends _ {
2536
2536
  received: t.parsedType
2537
2537
  }), g;
2538
2538
  const n = t.parsedType === h.promise ? t.data : Promise.resolve(t.data);
2539
- return Z(n.then((s) => this._def.type.parseAsync(s, {
2539
+ return S(n.then((s) => this._def.type.parseAsync(s, {
2540
2540
  path: t.path,
2541
2541
  errorMap: t.common.contextualErrorMap
2542
2542
  })));
2543
2543
  }
2544
2544
  }
2545
- H.create = (r, e) => new H({
2545
+ G.create = (r, e) => new G({
2546
2546
  type: r,
2547
2547
  typeName: y.ZodPromise,
2548
2548
  ...v(e)
2549
2549
  });
2550
- class I extends _ {
2550
+ class A extends _ {
2551
2551
  innerType() {
2552
2552
  return this._def.schema;
2553
2553
  }
@@ -2556,21 +2556,21 @@ class I extends _ {
2556
2556
  }
2557
2557
  _parse(e) {
2558
2558
  const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
2559
- addIssue: (i) => {
2560
- l(n, i), i.fatal ? t.abort() : t.dirty();
2559
+ addIssue: (o) => {
2560
+ l(n, o), o.fatal ? t.abort() : t.dirty();
2561
2561
  },
2562
2562
  get path() {
2563
2563
  return n.path;
2564
2564
  }
2565
2565
  };
2566
2566
  if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
2567
- const i = s.transform(n.data, a);
2567
+ const o = s.transform(n.data, a);
2568
2568
  if (n.common.async)
2569
- return Promise.resolve(i).then(async (o) => {
2569
+ return Promise.resolve(o).then(async (d) => {
2570
2570
  if (t.value === "aborted")
2571
2571
  return g;
2572
2572
  const f = await this._def.schema._parseAsync({
2573
- data: o,
2573
+ data: d,
2574
2574
  path: n.path,
2575
2575
  parent: n
2576
2576
  });
@@ -2579,58 +2579,58 @@ class I extends _ {
2579
2579
  {
2580
2580
  if (t.value === "aborted")
2581
2581
  return g;
2582
- const o = this._def.schema._parseSync({
2583
- data: i,
2582
+ const d = this._def.schema._parseSync({
2583
+ data: o,
2584
2584
  path: n.path,
2585
2585
  parent: n
2586
2586
  });
2587
- return o.status === "aborted" ? g : o.status === "dirty" || t.value === "dirty" ? W(o.value) : o;
2587
+ return d.status === "aborted" ? g : d.status === "dirty" || t.value === "dirty" ? W(d.value) : d;
2588
2588
  }
2589
2589
  }
2590
2590
  if (s.type === "refinement") {
2591
- const i = (o) => {
2592
- const f = s.refinement(o, a);
2591
+ const o = (d) => {
2592
+ const f = s.refinement(d, a);
2593
2593
  if (n.common.async)
2594
2594
  return Promise.resolve(f);
2595
2595
  if (f instanceof Promise)
2596
2596
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2597
- return o;
2597
+ return d;
2598
2598
  };
2599
2599
  if (n.common.async === !1) {
2600
- const o = this._def.schema._parseSync({
2600
+ const d = this._def.schema._parseSync({
2601
2601
  data: n.data,
2602
2602
  path: n.path,
2603
2603
  parent: n
2604
2604
  });
2605
- return o.status === "aborted" ? g : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2605
+ return d.status === "aborted" ? g : (d.status === "dirty" && t.dirty(), o(d.value), { status: t.value, value: d.value });
2606
2606
  } else
2607
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? g : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2607
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((d) => d.status === "aborted" ? g : (d.status === "dirty" && t.dirty(), o(d.value).then(() => ({ status: t.value, value: d.value }))));
2608
2608
  }
2609
2609
  if (s.type === "transform")
2610
2610
  if (n.common.async === !1) {
2611
- const i = this._def.schema._parseSync({
2611
+ const o = this._def.schema._parseSync({
2612
2612
  data: n.data,
2613
2613
  path: n.path,
2614
2614
  parent: n
2615
2615
  });
2616
- if (!z(i))
2617
- return i;
2618
- const o = s.transform(i.value, a);
2619
- if (o instanceof Promise)
2616
+ if (!z(o))
2617
+ return o;
2618
+ const d = s.transform(o.value, a);
2619
+ if (d instanceof Promise)
2620
2620
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2621
- return { status: t.value, value: o };
2621
+ return { status: t.value, value: d };
2622
2622
  } else
2623
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => z(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
2623
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => z(o) ? Promise.resolve(s.transform(o.value, a)).then((d) => ({ status: t.value, value: d })) : o);
2624
2624
  b.assertNever(s);
2625
2625
  }
2626
2626
  }
2627
- I.create = (r, e, t) => new I({
2627
+ A.create = (r, e, t) => new A({
2628
2628
  schema: r,
2629
2629
  typeName: y.ZodEffects,
2630
2630
  effect: e,
2631
2631
  ...v(t)
2632
2632
  });
2633
- I.createWithPreprocess = (r, e, t) => new I({
2633
+ A.createWithPreprocess = (r, e, t) => new A({
2634
2634
  schema: e,
2635
2635
  effect: { type: "preprocess", transform: r },
2636
2636
  typeName: y.ZodEffects,
@@ -2638,7 +2638,7 @@ I.createWithPreprocess = (r, e, t) => new I({
2638
2638
  });
2639
2639
  class N extends _ {
2640
2640
  _parse(e) {
2641
- return this._getType(e) === h.undefined ? Z(void 0) : this._def.innerType._parse(e);
2641
+ return this._getType(e) === h.undefined ? S(void 0) : this._def.innerType._parse(e);
2642
2642
  }
2643
2643
  unwrap() {
2644
2644
  return this._def.innerType;
@@ -2651,7 +2651,7 @@ N.create = (r, e) => new N({
2651
2651
  });
2652
2652
  class D extends _ {
2653
2653
  _parse(e) {
2654
- return this._getType(e) === h.null ? Z(null) : this._def.innerType._parse(e);
2654
+ return this._getType(e) === h.null ? S(null) : this._def.innerType._parse(e);
2655
2655
  }
2656
2656
  unwrap() {
2657
2657
  return this._def.innerType;
@@ -2701,7 +2701,7 @@ class le extends _ {
2701
2701
  status: "valid",
2702
2702
  value: a.status === "valid" ? a.value : this._def.catchValue({
2703
2703
  get error() {
2704
- return new S(n.common.issues);
2704
+ return new Z(n.common.issues);
2705
2705
  },
2706
2706
  input: n.data
2707
2707
  })
@@ -2709,7 +2709,7 @@ class le extends _ {
2709
2709
  status: "valid",
2710
2710
  value: s.status === "valid" ? s.value : this._def.catchValue({
2711
2711
  get error() {
2712
- return new S(n.common.issues);
2712
+ return new Z(n.common.issues);
2713
2713
  },
2714
2714
  input: n.data
2715
2715
  })
@@ -2742,8 +2742,8 @@ xe.create = (r) => new xe({
2742
2742
  typeName: y.ZodNaN,
2743
2743
  ...v(r)
2744
2744
  });
2745
- const gt = Symbol("zod_brand");
2746
- class Ie extends _ {
2745
+ const vt = Symbol("zod_brand");
2746
+ class Ne extends _ {
2747
2747
  _parse(e) {
2748
2748
  const { ctx: t } = this._processInputParams(e), n = t.data;
2749
2749
  return this._def.type._parse({
@@ -2810,38 +2810,38 @@ fe.create = (r, e) => new fe({
2810
2810
  typeName: y.ZodReadonly,
2811
2811
  ...v(e)
2812
2812
  });
2813
- function Ee(r, e) {
2813
+ function Re(r, e) {
2814
2814
  const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
2815
2815
  return typeof t == "string" ? { message: t } : t;
2816
2816
  }
2817
- function ze(r, e = {}, t) {
2818
- return r ? Y.create().superRefine((n, s) => {
2819
- var a, i;
2820
- const o = r(n);
2821
- if (o instanceof Promise)
2822
- return o.then((f) => {
2817
+ function Ue(r, e = {}, t) {
2818
+ return r ? H.create().superRefine((n, s) => {
2819
+ var a, o;
2820
+ const d = r(n);
2821
+ if (d instanceof Promise)
2822
+ return d.then((f) => {
2823
2823
  var u, p;
2824
2824
  if (!f) {
2825
- const T = Ee(e, n), me = (p = (u = T.fatal) !== null && u !== void 0 ? u : t) !== null && p !== void 0 ? p : !0;
2825
+ const T = Re(e, n), me = (p = (u = T.fatal) !== null && u !== void 0 ? u : t) !== null && p !== void 0 ? p : !0;
2826
2826
  s.addIssue({ code: "custom", ...T, fatal: me });
2827
2827
  }
2828
2828
  });
2829
- if (!o) {
2830
- const f = Ee(e, n), u = (i = (a = f.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
2829
+ if (!d) {
2830
+ const f = Re(e, n), u = (o = (a = f.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0;
2831
2831
  s.addIssue({ code: "custom", ...f, fatal: u });
2832
2832
  }
2833
- }) : Y.create();
2833
+ }) : H.create();
2834
2834
  }
2835
- const vt = {
2835
+ const _t = {
2836
2836
  object: x.lazycreate
2837
2837
  };
2838
2838
  var y;
2839
2839
  (function(r) {
2840
2840
  r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2841
2841
  })(y || (y = {}));
2842
- const _t = (r, e = {
2842
+ const bt = (r, e = {
2843
2843
  message: `Input not instance of ${r.name}`
2844
- }) => ze((t) => t instanceof r, e), Ue = C.create, Fe = $.create, bt = xe.create, xt = M.create, Be = te.create, kt = U.create, wt = ve.create, Tt = re.create, Zt = ne.create, St = Y.create, Ct = L.create, At = P.create, It = _e.create, Nt = A.create, Ot = x.create, jt = x.strictCreate, Et = se.create, Rt = ke.create, Pt = ae.create, $t = j.create, Mt = ie.create, Vt = be.create, Dt = F.create, Lt = q.create, zt = oe.create, Ut = de.create, Ft = V.create, Bt = ce.create, Wt = H.create, Re = I.create, qt = N.create, Jt = D.create, Yt = I.createWithPreprocess, Ht = he.create, Gt = () => Ue().optional(), Qt = () => Fe().optional(), Xt = () => Be().optional(), Kt = {
2844
+ }) => Ue((t) => t instanceof r, e), Fe = C.create, Be = $.create, xt = xe.create, kt = M.create, We = te.create, wt = U.create, Tt = ve.create, St = re.create, Zt = ne.create, Ct = H.create, It = L.create, At = P.create, Nt = _e.create, Ot = I.create, jt = x.create, Et = x.strictCreate, Rt = se.create, Pt = ke.create, $t = ae.create, Mt = j.create, Vt = ie.create, Dt = be.create, Lt = F.create, zt = q.create, Ut = oe.create, Ft = de.create, Bt = V.create, Wt = ce.create, qt = G.create, Pe = A.create, Jt = N.create, Yt = D.create, Ht = A.createWithPreprocess, Gt = he.create, Qt = () => Fe().optional(), Xt = () => Be().optional(), Kt = () => We().optional(), er = {
2845
2845
  string: (r) => C.create({ ...r, coerce: !0 }),
2846
2846
  number: (r) => $.create({ ...r, coerce: !0 }),
2847
2847
  boolean: (r) => te.create({
@@ -2850,21 +2850,21 @@ const _t = (r, e = {
2850
2850
  }),
2851
2851
  bigint: (r) => M.create({ ...r, coerce: !0 }),
2852
2852
  date: (r) => U.create({ ...r, coerce: !0 })
2853
- }, er = g;
2854
- var d = /* @__PURE__ */ Object.freeze({
2853
+ }, tr = g;
2854
+ var i = /* @__PURE__ */ Object.freeze({
2855
2855
  __proto__: null,
2856
- defaultErrorMap: J,
2857
- setErrorMap: Ye,
2856
+ defaultErrorMap: Y,
2857
+ setErrorMap: He,
2858
2858
  getErrorMap: pe,
2859
2859
  makeIssue: ye,
2860
- EMPTY_PATH: He,
2860
+ EMPTY_PATH: Ge,
2861
2861
  addIssueToContext: l,
2862
2862
  ParseStatus: w,
2863
2863
  INVALID: g,
2864
2864
  DIRTY: W,
2865
- OK: Z,
2866
- isAborted: Se,
2867
- isDirty: Ce,
2865
+ OK: S,
2866
+ isAborted: Ce,
2867
+ isDirty: Ie,
2868
2868
  isValid: z,
2869
2869
  isAsync: ee,
2870
2870
  get util() {
@@ -2876,7 +2876,7 @@ var d = /* @__PURE__ */ Object.freeze({
2876
2876
  ZodParsedType: h,
2877
2877
  getParsedType: R,
2878
2878
  ZodType: _,
2879
- datetimeRegex: De,
2879
+ datetimeRegex: Le,
2880
2880
  ZodString: C,
2881
2881
  ZodNumber: $,
2882
2882
  ZodBigInt: M,
@@ -2885,11 +2885,11 @@ var d = /* @__PURE__ */ Object.freeze({
2885
2885
  ZodSymbol: ve,
2886
2886
  ZodUndefined: re,
2887
2887
  ZodNull: ne,
2888
- ZodAny: Y,
2888
+ ZodAny: H,
2889
2889
  ZodUnknown: L,
2890
2890
  ZodNever: P,
2891
2891
  ZodVoid: _e,
2892
- ZodArray: A,
2892
+ ZodArray: I,
2893
2893
  ZodObject: x,
2894
2894
  ZodUnion: se,
2895
2895
  ZodDiscriminatedUnion: ke,
@@ -2903,71 +2903,71 @@ var d = /* @__PURE__ */ Object.freeze({
2903
2903
  ZodLiteral: de,
2904
2904
  ZodEnum: V,
2905
2905
  ZodNativeEnum: ce,
2906
- ZodPromise: H,
2907
- ZodEffects: I,
2908
- ZodTransformer: I,
2906
+ ZodPromise: G,
2907
+ ZodEffects: A,
2908
+ ZodTransformer: A,
2909
2909
  ZodOptional: N,
2910
2910
  ZodNullable: D,
2911
2911
  ZodDefault: ue,
2912
2912
  ZodCatch: le,
2913
2913
  ZodNaN: xe,
2914
- BRAND: gt,
2915
- ZodBranded: Ie,
2914
+ BRAND: vt,
2915
+ ZodBranded: Ne,
2916
2916
  ZodPipeline: he,
2917
2917
  ZodReadonly: fe,
2918
- custom: ze,
2918
+ custom: Ue,
2919
2919
  Schema: _,
2920
2920
  ZodSchema: _,
2921
- late: vt,
2921
+ late: _t,
2922
2922
  get ZodFirstPartyTypeKind() {
2923
2923
  return y;
2924
2924
  },
2925
- coerce: Kt,
2926
- any: St,
2927
- array: Nt,
2928
- bigint: xt,
2929
- boolean: Be,
2930
- date: kt,
2931
- discriminatedUnion: Rt,
2932
- effect: Re,
2933
- enum: Ft,
2934
- function: Lt,
2935
- instanceof: _t,
2936
- intersection: Pt,
2937
- lazy: zt,
2938
- literal: Ut,
2939
- map: Vt,
2940
- nan: bt,
2941
- nativeEnum: Bt,
2925
+ coerce: er,
2926
+ any: Ct,
2927
+ array: Ot,
2928
+ bigint: kt,
2929
+ boolean: We,
2930
+ date: wt,
2931
+ discriminatedUnion: Pt,
2932
+ effect: Pe,
2933
+ enum: Bt,
2934
+ function: zt,
2935
+ instanceof: bt,
2936
+ intersection: $t,
2937
+ lazy: Ut,
2938
+ literal: Ft,
2939
+ map: Dt,
2940
+ nan: xt,
2941
+ nativeEnum: Wt,
2942
2942
  never: At,
2943
2943
  null: Zt,
2944
- nullable: Jt,
2945
- number: Fe,
2946
- object: Ot,
2947
- oboolean: Xt,
2948
- onumber: Qt,
2949
- optional: qt,
2950
- ostring: Gt,
2951
- pipeline: Ht,
2952
- preprocess: Yt,
2953
- promise: Wt,
2954
- record: Mt,
2955
- set: Dt,
2956
- strictObject: jt,
2957
- string: Ue,
2958
- symbol: wt,
2959
- transformer: Re,
2960
- tuple: $t,
2961
- undefined: Tt,
2962
- union: Et,
2963
- unknown: Ct,
2964
- void: It,
2965
- NEVER: er,
2944
+ nullable: Yt,
2945
+ number: Be,
2946
+ object: jt,
2947
+ oboolean: Kt,
2948
+ onumber: Xt,
2949
+ optional: Jt,
2950
+ ostring: Qt,
2951
+ pipeline: Gt,
2952
+ preprocess: Ht,
2953
+ promise: qt,
2954
+ record: Vt,
2955
+ set: Lt,
2956
+ strictObject: Et,
2957
+ string: Fe,
2958
+ symbol: Tt,
2959
+ transformer: Pe,
2960
+ tuple: Mt,
2961
+ undefined: St,
2962
+ union: Rt,
2963
+ unknown: It,
2964
+ void: Nt,
2965
+ NEVER: tr,
2966
2966
  ZodIssueCode: c,
2967
- quotelessJson: Je,
2968
- ZodError: S
2967
+ quotelessJson: Ye,
2968
+ ZodError: Z
2969
2969
  });
2970
- const k = d.string().min(1, { message: "שדה חובה" }), ir = d.string().regex(/^\d+$/, "Must be a numeric string"), tr = d.object({
2970
+ const k = i.string().min(1, { message: "שדה חובה" }), or = i.string().regex(/^\d+$/, "Must be a numeric string"), rr = i.object({
2971
2971
  country: k,
2972
2972
  city: k,
2973
2973
  street: k,
@@ -2975,119 +2975,119 @@ const k = d.string().min(1, { message: "שדה חובה" }), ir = d.string().reg
2975
2975
  floor: k,
2976
2976
  apartmentEnterNumber: k,
2977
2977
  apartmentNumber: k
2978
- }), K = d.object({
2979
- lang: d.enum(["he"]),
2980
- value: d.string()
2981
- }), or = d.array(K), We = d.object({
2982
- id: d.string().min(1),
2983
- companyId: d.string().min(1),
2984
- storeId: d.string().min(1),
2985
- parentId: d.string().nullish(),
2986
- tag: d.string().min(1),
2987
- locales: d.array(K),
2988
- depth: d.number()
2989
- }), Ne = We.extend({
2990
- children: d.lazy(() => Ne.array())
2991
- }), dr = We.extend({
2992
- index: d.number(),
2993
- depth: d.number(),
2994
- collapsed: d.boolean().optional(),
2995
- children: d.array(Ne)
2996
- }), G = d.string().min(1), Oe = d.object({
2997
- type: d.literal("Product"),
2998
- storeId: G,
2999
- companyId: G,
3000
- id: G,
3001
- objectID: G,
3002
- sku: G,
3003
- name: d.array(K),
3004
- description: d.array(K),
3005
- isPublished: d.boolean(),
3006
- vat: d.boolean(),
3007
- priceType: d.object({
3008
- type: d.enum(["unit", "kg", "gram", "liter", "ml"]),
3009
- value: d.number()
2978
+ }), J = i.object({
2979
+ lang: i.enum(["he"]),
2980
+ value: i.string()
2981
+ }), dr = i.array(J), qe = i.object({
2982
+ id: i.string().min(1),
2983
+ companyId: i.string().min(1),
2984
+ storeId: i.string().min(1),
2985
+ parentId: i.string().nullish(),
2986
+ tag: i.string().min(1),
2987
+ locales: i.array(J),
2988
+ depth: i.number()
2989
+ }), Oe = qe.extend({
2990
+ children: i.lazy(() => Oe.array())
2991
+ }), cr = qe.extend({
2992
+ index: i.number(),
2993
+ depth: i.number(),
2994
+ collapsed: i.boolean().optional(),
2995
+ children: i.array(Oe)
2996
+ }), Q = i.string().min(1), je = i.object({
2997
+ type: i.literal("Product"),
2998
+ storeId: Q,
2999
+ companyId: Q,
3000
+ id: Q,
3001
+ objectID: Q,
3002
+ sku: Q,
3003
+ name: i.array(J),
3004
+ description: i.array(J),
3005
+ isPublished: i.boolean(),
3006
+ vat: i.boolean(),
3007
+ priceType: i.object({
3008
+ type: i.enum(["unit", "kg", "gram", "liter", "ml"]),
3009
+ value: i.number()
3010
3010
  }),
3011
- price: d.number().positive(),
3012
- purchasePrice: d.number().optional(),
3013
- profitPercentage: d.number().optional(),
3014
- currency: d.literal("ILS"),
3015
- discount: d.object({
3016
- type: d.enum(["number", "percent", "none"]),
3017
- value: d.number()
3011
+ price: i.number().positive(),
3012
+ purchasePrice: i.number().optional(),
3013
+ profitPercentage: i.number().optional(),
3014
+ currency: i.literal("ILS"),
3015
+ discount: i.object({
3016
+ type: i.enum(["number", "percent", "none"]),
3017
+ value: i.number()
3018
3018
  }),
3019
- weight: d.object({
3020
- value: d.number(),
3021
- unit: d.enum(["kg", "gram", "none"])
3019
+ weight: i.object({
3020
+ value: i.number(),
3021
+ unit: i.enum(["kg", "gram", "none"])
3022
3022
  }),
3023
- volume: d.object({
3024
- value: d.number(),
3025
- unit: d.enum(["liter", "ml", "none"])
3023
+ volume: i.object({
3024
+ value: i.number(),
3025
+ unit: i.enum(["liter", "ml", "none"])
3026
3026
  }),
3027
- images: d.array(d.object({ url: d.string().url(), id: d.string() })),
3028
- manufacturer: d.string(),
3029
- brand: d.string(),
3030
- importer: d.string(),
3031
- supplier: d.string(),
3032
- ingredients: d.array(K),
3033
- created_at: d.number(),
3034
- updated_at: d.number(),
3035
- categoryIds: d.array(d.string().nonempty()),
3027
+ images: i.array(i.object({ url: i.string().url(), id: i.string() })),
3028
+ manufacturer: i.string(),
3029
+ brand: i.string(),
3030
+ importer: i.string(),
3031
+ supplier: i.string(),
3032
+ ingredients: i.array(J),
3033
+ created_at: i.number(),
3034
+ updated_at: i.number(),
3035
+ categoryIds: i.array(i.string().nonempty()),
3036
3036
  // @deprecated
3037
- categoryList: d.array(Ne),
3037
+ categoryList: i.array(Oe),
3038
3038
  // @deprecated
3039
- categories: d.object({
3040
- lvl0: d.array(d.string()),
3041
- lvl1: d.array(d.string()),
3042
- lvl2: d.array(d.string()),
3043
- lvl3: d.array(d.string()),
3044
- lvl4: d.array(d.string())
3039
+ categories: i.object({
3040
+ lvl0: i.array(i.string()),
3041
+ lvl1: i.array(i.string()),
3042
+ lvl2: i.array(i.string()),
3043
+ lvl3: i.array(i.string()),
3044
+ lvl4: i.array(i.string())
3045
3045
  }),
3046
3046
  // @deprecated
3047
- categoryNames: d.array(d.string())
3048
- }), cr = Oe.extend({
3049
- image: d.instanceof(File).optional()
3050
- }), ur = d.object({
3051
- type: d.literal("Cart"),
3052
- id: d.string().uuid(),
3053
- companyId: d.string().uuid(),
3054
- storeId: d.string().uuid(),
3055
- userId: d.string().uuid(),
3056
- status: d.enum(["active", "draft", "completed"]),
3057
- items: d.array(
3058
- d.object({
3059
- product: Oe,
3060
- amount: d.number().int().positive({ message: "Quantity must be a positive integer." })
3047
+ categoryNames: i.array(i.string())
3048
+ }), ur = je.extend({
3049
+ image: i.instanceof(File).optional()
3050
+ }), lr = i.object({
3051
+ type: i.literal("Cart"),
3052
+ id: i.string().uuid(),
3053
+ companyId: i.string().uuid(),
3054
+ storeId: i.string().uuid(),
3055
+ userId: i.string().uuid(),
3056
+ status: i.enum(["active", "draft", "completed"]),
3057
+ items: i.array(
3058
+ i.object({
3059
+ product: je,
3060
+ amount: i.number().int().positive({ message: "Quantity must be a positive integer." })
3061
3061
  })
3062
3062
  )
3063
- }), lr = d.object({
3064
- id: d.string(),
3065
- name: d.string(),
3066
- websiteDomains: d.array(d.string())
3067
- }), fr = d.object({
3068
- type: d.literal("FavoriteProduct"),
3069
- id: d.string().uuid(),
3070
- companyId: d.string().uuid(),
3071
- storeId: d.string().uuid(),
3072
- userId: d.string().uuid(),
3073
- productId: d.string().uuid()
3074
- }), qe = d.enum(["default", "delayed"]), rr = d.object({
3075
- type: d.literal("Profile"),
3063
+ }), fr = i.object({
3064
+ id: i.string(),
3065
+ name: i.string(),
3066
+ websiteDomains: i.array(i.string())
3067
+ }), hr = i.object({
3068
+ type: i.literal("FavoriteProduct"),
3069
+ id: i.string().uuid(),
3070
+ companyId: i.string().uuid(),
3071
+ storeId: i.string().uuid(),
3072
+ userId: i.string().uuid(),
3073
+ productId: i.string().uuid()
3074
+ }), Je = i.enum(["default", "delayed"]), nr = i.object({
3075
+ type: i.literal("Profile"),
3076
3076
  id: k,
3077
3077
  companyId: k,
3078
3078
  storeId: k,
3079
3079
  tenantId: k,
3080
- clientType: d.enum(["user", "company"]),
3080
+ clientType: i.enum(["user", "company"]),
3081
3081
  displayName: k,
3082
- email: d.string().email(),
3082
+ email: i.string().email(),
3083
3083
  phoneNumber: k.optional(),
3084
- address: tr.optional(),
3085
- isAnonymous: d.boolean(),
3086
- createdDate: d.number(),
3087
- lastActivityDate: d.number(),
3088
- paymentType: qe
3084
+ address: rr.optional(),
3085
+ isAnonymous: i.boolean(),
3086
+ createdDate: i.number(),
3087
+ lastActivityDate: i.number(),
3088
+ paymentType: Je
3089
3089
  });
3090
- function hr() {
3090
+ function mr() {
3091
3091
  return {
3092
3092
  type: "Profile",
3093
3093
  id: "",
@@ -3110,16 +3110,16 @@ function hr() {
3110
3110
  createdDate: 0,
3111
3111
  lastActivityDate: 0,
3112
3112
  isAnonymous: !0,
3113
- paymentType: qe.Values.default
3113
+ paymentType: Je.Values.default
3114
3114
  };
3115
3115
  }
3116
- const mr = d.object({
3117
- type: d.literal("Order"),
3116
+ const pr = i.object({
3117
+ type: i.literal("Order"),
3118
3118
  id: k,
3119
3119
  companyId: k,
3120
3120
  storeId: k,
3121
3121
  userId: k,
3122
- status: d.enum([
3122
+ status: i.enum([
3123
3123
  "draft",
3124
3124
  // before payment
3125
3125
  "pending",
@@ -3133,39 +3133,55 @@ const mr = d.object({
3133
3133
  "completed",
3134
3134
  "refunded"
3135
3135
  ]),
3136
- paymentStatus: d.enum(["pending", "pending_j5", "completed", "failed", "refunded"]),
3136
+ paymentStatus: i.enum(["pending", "pending_j5", "completed", "failed", "refunded"]),
3137
3137
  //todo check if hyp support partial refund
3138
- cart: d.object({
3139
- id: d.string(),
3140
- items: d.array(d.object({ product: Oe, amount: d.number() })),
3141
- cartDiscount: d.number(),
3142
- cartTotal: d.number(),
3143
- cartVat: d.number()
3138
+ cart: i.object({
3139
+ id: i.string(),
3140
+ items: i.array(i.object({ product: je, amount: i.number() })),
3141
+ cartDiscount: i.number(),
3142
+ cartTotal: i.number(),
3143
+ cartVat: i.number()
3144
3144
  }),
3145
- originalAmount: d.number().positive().optional(),
3145
+ originalAmount: i.number().positive().optional(),
3146
3146
  // what client pay
3147
- actualAmount: d.number().positive().optional(),
3147
+ actualAmount: i.number().positive().optional(),
3148
3148
  // what store charge
3149
- date: d.number(),
3150
- deliveryDate: d.number().optional(),
3151
- createdAt: d.number().optional(),
3152
- client: rr.required({})
3149
+ date: i.number(),
3150
+ deliveryDate: i.number().optional(),
3151
+ createdAt: i.number().optional(),
3152
+ client: nr.required({})
3153
3153
  });
3154
- d.object({
3155
- id: d.string(),
3156
- companyId: d.string(),
3157
- name: d.string(),
3158
- urls: d.array(d.string()),
3159
- logoUrl: d.string(),
3160
- tenantId: d.string(),
3154
+ i.object({
3155
+ id: i.string(),
3156
+ companyId: i.string(),
3157
+ name: i.string(),
3158
+ urls: i.array(i.string()),
3159
+ logoUrl: i.string(),
3160
+ tenantId: i.string(),
3161
3161
  // firebase auth tenantId
3162
- paymentType: d.enum(["external", "j5"]),
3163
- allowAnonymousClients: d.boolean()
3162
+ paymentType: i.enum(["external", "j5"]),
3163
+ allowAnonymousClients: i.boolean(),
3164
+ isVatIncludedInPrice: i.boolean()
3164
3165
  });
3165
- const nr = {
3166
+ const Se = i.string().min(1), yr = i.object({
3167
+ type: i.literal("Discount"),
3168
+ storeId: Se,
3169
+ companyId: Se,
3170
+ id: Se,
3171
+ name: i.array(J),
3172
+ active: i.boolean(),
3173
+ variant: i.discriminatedUnion("variantType", [
3174
+ i.object({
3175
+ variantType: i.literal("bundle"),
3176
+ productsId: i.array(i.string()).min(1),
3177
+ requiredQuantity: i.number().positive(),
3178
+ discountPrice: i.number().positive()
3179
+ })
3180
+ ])
3181
+ }), sr = {
3166
3182
  stores: "STORES",
3167
3183
  companies: "COMPANIES"
3168
- }, sr = {
3184
+ }, ar = {
3169
3185
  products: "products",
3170
3186
  profiles: "profiles",
3171
3187
  cart: "cart",
@@ -3174,10 +3190,11 @@ const nr = {
3174
3190
  categories: "categories",
3175
3191
  favorites: "favorites",
3176
3192
  payments: "payments",
3177
- settings: "settings"
3178
- }, ar = {
3179
- systemCollections: nr,
3180
- storeCollections: sr,
3193
+ settings: "settings",
3194
+ discounts: "discounts"
3195
+ }, ir = {
3196
+ systemCollections: sr,
3197
+ storeCollections: ar,
3181
3198
  // for client
3182
3199
  getPath: ({
3183
3200
  companyId: r,
@@ -3187,27 +3204,28 @@ const nr = {
3187
3204
  }) => `${r}/${e}/${t}${n ? `/${n}` : ""}`,
3188
3205
  // for backend
3189
3206
  getDocPath: (r) => `{companyId}/{storeId}/${r}/{id}`
3190
- }, pr = {
3191
- firestore: ar
3207
+ }, gr = {
3208
+ firestore: ir
3192
3209
  };
3193
3210
  export {
3194
- tr as AddressSchema,
3195
- We as BaseCategorySchema,
3196
- ur as CartSchema,
3197
- Ne as CategorySchema,
3198
- lr as CompanySchema,
3199
- fr as FavoriteProductSchema,
3200
- pr as FirebaseAPI,
3201
- K as LocaleSchema,
3202
- or as LocaleValueSchema,
3203
- cr as NewProductSchema,
3204
- mr as OrderSchema,
3205
- Oe as ProductSchema,
3206
- qe as ProfilePaymentTypeSchema,
3207
- rr as ProfileSchema,
3208
- dr as TFlattenCategorySchema,
3209
- hr as createEmptyProfile,
3211
+ rr as AddressSchema,
3212
+ qe as BaseCategorySchema,
3213
+ lr as CartSchema,
3214
+ Oe as CategorySchema,
3215
+ fr as CompanySchema,
3216
+ yr as DiscountSchema,
3217
+ hr as FavoriteProductSchema,
3218
+ gr as FirebaseAPI,
3219
+ J as LocaleSchema,
3220
+ dr as LocaleValueSchema,
3221
+ ur as NewProductSchema,
3222
+ pr as OrderSchema,
3223
+ je as ProductSchema,
3224
+ Je as ProfilePaymentTypeSchema,
3225
+ nr as ProfileSchema,
3226
+ cr as TFlattenCategorySchema,
3227
+ mr as createEmptyProfile,
3210
3228
  k as notEmptyTextSchema,
3211
- ir as numericTextSchema
3229
+ or as numericTextSchema
3212
3230
  };
3213
3231
  //# sourceMappingURL=core.es.js.map