@busha/ramp-web-sdk 0.1.2 → 0.1.4

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/index.es.js CHANGED
@@ -1,95 +1,95 @@
1
- var $e = Object.defineProperty;
2
- var Se = (n, e, t) => e in n ? $e(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var z = (n, e, t) => Se(n, typeof e != "symbol" ? e + "" : e, t);
4
- const q = "busha-ramp-container", G = "busha-ramp-loader", X = "busha-ramp-styles", ee = "busha-ramp-close-btn", L = "busha-ramp-iframe", Oe = "busha-ramp-form";
1
+ var Fe = Object.defineProperty;
2
+ var $e = (r, e, t) => e in r ? Fe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var R = (r, e, t) => $e(r, typeof e != "symbol" ? e + "" : e, t);
4
+ const q = "busha-ramp-container", X = "busha-ramp-loader", K = "busha-ramp-styles", ee = "busha-ramp-close-btn", z = "busha-ramp-iframe", Oe = "busha-ramp-form";
5
5
  const Te = "INITIALIZED", oe = "CANCELLED", ke = "COMPLETED";
6
- function Ce(n) {
7
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
6
+ function Ce(r) {
7
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
8
8
  }
9
9
  var J, le;
10
10
  function De() {
11
11
  if (le) return J;
12
12
  le = 1;
13
- function n(c) {
13
+ function r(c) {
14
14
  this._maxSize = c, this.clear();
15
15
  }
16
- n.prototype.clear = function() {
16
+ r.prototype.clear = function() {
17
17
  this._size = 0, this._values = /* @__PURE__ */ Object.create(null);
18
- }, n.prototype.get = function(c) {
18
+ }, r.prototype.get = function(c) {
19
19
  return this._values[c];
20
- }, n.prototype.set = function(c, p) {
21
- return this._size >= this._maxSize && this.clear(), c in this._values || this._size++, this._values[c] = p;
20
+ }, r.prototype.set = function(c, m) {
21
+ return this._size >= this._maxSize && this.clear(), c in this._values || this._size++, this._values[c] = m;
22
22
  };
23
- var e = /[^.^\]^[]+|(?=\[\]|\.\.)/g, t = /^\d+$/, r = /^\d/, s = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, i = /^\s*(['"]?)(.*?)(\1)\s*$/, a = 512, u = new n(a), o = new n(a), d = new n(a);
23
+ var e = /[^.^\]^[]+|(?=\[\]|\.\.)/g, t = /^\d+$/, n = /^\d/, s = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, a = /^\s*(['"]?)(.*?)(\1)\s*$/, i = 512, u = new r(i), o = new r(i), d = new r(i);
24
24
  J = {
25
- Cache: n,
25
+ Cache: r,
26
26
  split: f,
27
27
  normalizePath: l,
28
28
  setter: function(c) {
29
- var p = l(c);
30
- return o.get(c) || o.set(c, function(O, y) {
31
- for (var g = 0, T = p.length, C = O; g < T - 1; ) {
32
- var D = p[g];
29
+ var m = l(c);
30
+ return o.get(c) || o.set(c, function(O, x) {
31
+ for (var _ = 0, T = m.length, C = O; _ < T - 1; ) {
32
+ var D = m[_];
33
33
  if (D === "__proto__" || D === "constructor" || D === "prototype")
34
34
  return O;
35
- C = C[p[g++]];
35
+ C = C[m[_++]];
36
36
  }
37
- C[p[g]] = y;
37
+ C[m[_]] = x;
38
38
  });
39
39
  },
40
- getter: function(c, p) {
40
+ getter: function(c, m) {
41
41
  var w = l(c);
42
- return d.get(c) || d.set(c, function(y) {
43
- for (var g = 0, T = w.length; g < T; )
44
- if (y != null || !p) y = y[w[g++]];
42
+ return d.get(c) || d.set(c, function(x) {
43
+ for (var _ = 0, T = w.length; _ < T; )
44
+ if (x != null || !m) x = x[w[_++]];
45
45
  else return;
46
- return y;
46
+ return x;
47
47
  });
48
48
  },
49
49
  join: function(c) {
50
- return c.reduce(function(p, w) {
51
- return p + (m(w) || t.test(w) ? "[" + w + "]" : (p ? "." : "") + w);
50
+ return c.reduce(function(m, w) {
51
+ return m + (p(w) || t.test(w) ? "[" + w + "]" : (m ? "." : "") + w);
52
52
  }, "");
53
53
  },
54
- forEach: function(c, p, w) {
55
- h(Array.isArray(c) ? c : f(c), p, w);
54
+ forEach: function(c, m, w) {
55
+ h(Array.isArray(c) ? c : f(c), m, w);
56
56
  }
57
57
  };
58
58
  function l(c) {
59
59
  return u.get(c) || u.set(
60
60
  c,
61
- f(c).map(function(p) {
62
- return p.replace(i, "$2");
61
+ f(c).map(function(m) {
62
+ return m.replace(a, "$2");
63
63
  })
64
64
  );
65
65
  }
66
66
  function f(c) {
67
67
  return c.match(e) || [""];
68
68
  }
69
- function h(c, p, w) {
70
- var O = c.length, y, g, T, C;
71
- for (g = 0; g < O; g++)
72
- y = c[g], y && (v(y) && (y = '"' + y + '"'), C = m(y), T = !C && /^\d+$/.test(y), p.call(w, y, C, T, g, c));
69
+ function h(c, m, w) {
70
+ var O = c.length, x, _, T, C;
71
+ for (_ = 0; _ < O; _++)
72
+ x = c[_], x && (E(x) && (x = '"' + x + '"'), C = p(x), T = !C && /^\d+$/.test(x), m.call(w, x, C, T, _, c));
73
73
  }
74
- function m(c) {
74
+ function p(c) {
75
75
  return typeof c == "string" && c && ["'", '"'].indexOf(c.charAt(0)) !== -1;
76
76
  }
77
- function E(c) {
78
- return c.match(r) && !c.match(t);
77
+ function y(c) {
78
+ return c.match(n) && !c.match(t);
79
79
  }
80
- function x(c) {
80
+ function b(c) {
81
81
  return s.test(c);
82
82
  }
83
- function v(c) {
84
- return !m(c) && (E(c) || x(c));
83
+ function E(c) {
84
+ return !p(c) && (y(c) || b(c));
85
85
  }
86
86
  return J;
87
87
  }
88
- var U = De(), Q, ce;
88
+ var N = De(), Q, ce;
89
89
  function Ae() {
90
90
  if (ce) return Q;
91
91
  ce = 1;
92
- const n = /[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g, e = (l) => l.match(n) || [], t = (l) => l[0].toUpperCase() + l.slice(1), r = (l, f) => e(l).join(f).toLowerCase(), s = (l) => e(l).reduce(
92
+ const r = /[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g, e = (l) => l.match(r) || [], t = (l) => l[0].toUpperCase() + l.slice(1), n = (l, f) => e(l).join(f).toLowerCase(), s = (l) => e(l).reduce(
93
93
  (f, h) => `${f}${f ? h[0].toUpperCase() + h.slice(1).toLowerCase() : h.toLowerCase()}`,
94
94
  ""
95
95
  );
@@ -98,9 +98,9 @@ function Ae() {
98
98
  upperFirst: t,
99
99
  camelCase: s,
100
100
  pascalCase: (l) => t(s(l)),
101
- snakeCase: (l) => r(l, "_"),
102
- kebabCase: (l) => r(l, "-"),
103
- sentenceCase: (l) => t(r(l, " ")),
101
+ snakeCase: (l) => n(l, "_"),
102
+ kebabCase: (l) => n(l, "-"),
103
+ sentenceCase: (l) => t(n(l, " ")),
104
104
  titleCase: (l) => e(l).map(t).join(" ")
105
105
  }, Q;
106
106
  }
@@ -108,127 +108,127 @@ var W = Ae(), V = { exports: {} }, fe;
108
108
  function Ie() {
109
109
  if (fe) return V.exports;
110
110
  fe = 1, V.exports = function(s) {
111
- return n(e(s), s);
112
- }, V.exports.array = n;
113
- function n(s, i) {
114
- var a = s.length, u = new Array(a), o = {}, d = a, l = t(i), f = r(s);
115
- for (i.forEach(function(m) {
116
- if (!f.has(m[0]) || !f.has(m[1]))
111
+ return r(e(s), s);
112
+ }, V.exports.array = r;
113
+ function r(s, a) {
114
+ var i = s.length, u = new Array(i), o = {}, d = i, l = t(a), f = n(s);
115
+ for (a.forEach(function(p) {
116
+ if (!f.has(p[0]) || !f.has(p[1]))
117
117
  throw new Error("Unknown node. There is an unknown node in the supplied edges.");
118
118
  }); d--; )
119
119
  o[d] || h(s[d], d, /* @__PURE__ */ new Set());
120
120
  return u;
121
- function h(m, E, x) {
122
- if (x.has(m)) {
123
- var v;
121
+ function h(p, y, b) {
122
+ if (b.has(p)) {
123
+ var E;
124
124
  try {
125
- v = ", node was:" + JSON.stringify(m);
125
+ E = ", node was:" + JSON.stringify(p);
126
126
  } catch {
127
- v = "";
127
+ E = "";
128
128
  }
129
- throw new Error("Cyclic dependency" + v);
129
+ throw new Error("Cyclic dependency" + E);
130
130
  }
131
- if (!f.has(m))
132
- throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(m));
133
- if (!o[E]) {
134
- o[E] = !0;
135
- var c = l.get(m) || /* @__PURE__ */ new Set();
136
- if (c = Array.from(c), E = c.length) {
137
- x.add(m);
131
+ if (!f.has(p))
132
+ throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(p));
133
+ if (!o[y]) {
134
+ o[y] = !0;
135
+ var c = l.get(p) || /* @__PURE__ */ new Set();
136
+ if (c = Array.from(c), y = c.length) {
137
+ b.add(p);
138
138
  do {
139
- var p = c[--E];
140
- h(p, f.get(p), x);
141
- } while (E);
142
- x.delete(m);
139
+ var m = c[--y];
140
+ h(m, f.get(m), b);
141
+ } while (y);
142
+ b.delete(p);
143
143
  }
144
- u[--a] = m;
144
+ u[--i] = p;
145
145
  }
146
146
  }
147
147
  }
148
148
  function e(s) {
149
- for (var i = /* @__PURE__ */ new Set(), a = 0, u = s.length; a < u; a++) {
150
- var o = s[a];
151
- i.add(o[0]), i.add(o[1]);
149
+ for (var a = /* @__PURE__ */ new Set(), i = 0, u = s.length; i < u; i++) {
150
+ var o = s[i];
151
+ a.add(o[0]), a.add(o[1]);
152
152
  }
153
- return Array.from(i);
153
+ return Array.from(a);
154
154
  }
155
155
  function t(s) {
156
- for (var i = /* @__PURE__ */ new Map(), a = 0, u = s.length; a < u; a++) {
157
- var o = s[a];
158
- i.has(o[0]) || i.set(o[0], /* @__PURE__ */ new Set()), i.has(o[1]) || i.set(o[1], /* @__PURE__ */ new Set()), i.get(o[0]).add(o[1]);
156
+ for (var a = /* @__PURE__ */ new Map(), i = 0, u = s.length; i < u; i++) {
157
+ var o = s[i];
158
+ a.has(o[0]) || a.set(o[0], /* @__PURE__ */ new Set()), a.has(o[1]) || a.set(o[1], /* @__PURE__ */ new Set()), a.get(o[0]).add(o[1]);
159
159
  }
160
- return i;
160
+ return a;
161
161
  }
162
- function r(s) {
163
- for (var i = /* @__PURE__ */ new Map(), a = 0, u = s.length; a < u; a++)
164
- i.set(s[a], a);
165
- return i;
162
+ function n(s) {
163
+ for (var a = /* @__PURE__ */ new Map(), i = 0, u = s.length; i < u; i++)
164
+ a.set(s[i], i);
165
+ return a;
166
166
  }
167
167
  return V.exports;
168
168
  }
169
- var je = Ie();
170
- const Ne = /* @__PURE__ */ Ce(je), Ue = Object.prototype.toString, Pe = Error.prototype.toString, Me = RegExp.prototype.toString, Re = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", ze = /^Symbol\((.*)\)(.*)$/;
171
- function Le(n) {
172
- return n != +n ? "NaN" : n === 0 && 1 / n < 0 ? "-0" : "" + n;
169
+ var Ue = Ie();
170
+ const je = /* @__PURE__ */ Ce(Ue), Ne = Object.prototype.toString, Le = Error.prototype.toString, Me = RegExp.prototype.toString, Pe = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", Re = /^Symbol\((.*)\)(.*)$/;
171
+ function ze(r) {
172
+ return r != +r ? "NaN" : r === 0 && 1 / r < 0 ? "-0" : "" + r;
173
173
  }
174
- function de(n, e = !1) {
175
- if (n == null || n === !0 || n === !1) return "" + n;
176
- const t = typeof n;
177
- if (t === "number") return Le(n);
178
- if (t === "string") return e ? `"${n}"` : n;
179
- if (t === "function") return "[Function " + (n.name || "anonymous") + "]";
180
- if (t === "symbol") return Re.call(n).replace(ze, "Symbol($1)");
181
- const r = Ue.call(n).slice(8, -1);
182
- return r === "Date" ? isNaN(n.getTime()) ? "" + n : n.toISOString(n) : r === "Error" || n instanceof Error ? "[" + Pe.call(n) + "]" : r === "RegExp" ? Me.call(n) : null;
174
+ function de(r, e = !1) {
175
+ if (r == null || r === !0 || r === !1) return "" + r;
176
+ const t = typeof r;
177
+ if (t === "number") return ze(r);
178
+ if (t === "string") return e ? `"${r}"` : r;
179
+ if (t === "function") return "[Function " + (r.name || "anonymous") + "]";
180
+ if (t === "symbol") return Pe.call(r).replace(Re, "Symbol($1)");
181
+ const n = Ne.call(r).slice(8, -1);
182
+ return n === "Date" ? isNaN(r.getTime()) ? "" + r : r.toISOString(r) : n === "Error" || r instanceof Error ? "[" + Le.call(r) + "]" : n === "RegExp" ? Me.call(r) : null;
183
183
  }
184
- function I(n, e) {
185
- let t = de(n, e);
186
- return t !== null ? t : JSON.stringify(n, function(r, s) {
187
- let i = de(this[r], e);
188
- return i !== null ? i : s;
184
+ function I(r, e) {
185
+ let t = de(r, e);
186
+ return t !== null ? t : JSON.stringify(r, function(n, s) {
187
+ let a = de(this[n], e);
188
+ return a !== null ? a : s;
189
189
  }, 2);
190
190
  }
191
- function be(n) {
192
- return n == null ? [] : [].concat(n);
191
+ function be(r) {
192
+ return r == null ? [] : [].concat(r);
193
193
  }
194
194
  let xe, ge, Ee, qe = /\$\{\s*(\w+)\s*\}/g;
195
195
  xe = Symbol.toStringTag;
196
196
  class he {
197
- constructor(e, t, r, s) {
198
- this.name = void 0, this.message = void 0, this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = void 0, this.inner = void 0, this[xe] = "Error", this.name = "ValidationError", this.value = t, this.path = r, this.type = s, this.errors = [], this.inner = [], be(e).forEach((i) => {
199
- if (F.isError(i)) {
200
- this.errors.push(...i.errors);
201
- const a = i.inner.length ? i.inner : [i];
202
- this.inner.push(...a);
197
+ constructor(e, t, n, s) {
198
+ this.name = void 0, this.message = void 0, this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = void 0, this.inner = void 0, this[xe] = "Error", this.name = "ValidationError", this.value = t, this.path = n, this.type = s, this.errors = [], this.inner = [], be(e).forEach((a) => {
199
+ if (S.isError(a)) {
200
+ this.errors.push(...a.errors);
201
+ const i = a.inner.length ? a.inner : [a];
202
+ this.inner.push(...i);
203
203
  } else
204
- this.errors.push(i);
204
+ this.errors.push(a);
205
205
  }), this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];
206
206
  }
207
207
  }
208
208
  ge = Symbol.hasInstance;
209
209
  Ee = Symbol.toStringTag;
210
- class F extends Error {
210
+ class S extends Error {
211
211
  static formatError(e, t) {
212
- const r = t.label || t.path || "this";
212
+ const n = t.label || t.path || "this";
213
213
  return t = Object.assign({}, t, {
214
- path: r,
214
+ path: n,
215
215
  originalPath: t.path
216
- }), typeof e == "string" ? e.replace(qe, (s, i) => I(t[i])) : typeof e == "function" ? e(t) : e;
216
+ }), typeof e == "string" ? e.replace(qe, (s, a) => I(t[a])) : typeof e == "function" ? e(t) : e;
217
217
  }
218
218
  static isError(e) {
219
219
  return e && e.name === "ValidationError";
220
220
  }
221
- constructor(e, t, r, s, i) {
222
- const a = new he(e, t, r, s);
223
- if (i)
224
- return a;
225
- super(), this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = [], this.inner = [], this[Ee] = "Error", this.name = a.name, this.message = a.message, this.type = a.type, this.value = a.value, this.path = a.path, this.errors = a.errors, this.inner = a.inner, Error.captureStackTrace && Error.captureStackTrace(this, F);
221
+ constructor(e, t, n, s, a) {
222
+ const i = new he(e, t, n, s);
223
+ if (a)
224
+ return i;
225
+ super(), this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = [], this.inner = [], this[Ee] = "Error", this.name = i.name, this.message = i.message, this.type = i.type, this.value = i.value, this.path = i.path, this.errors = i.errors, this.inner = i.inner, Error.captureStackTrace && Error.captureStackTrace(this, S);
226
226
  }
227
227
  static [ge](e) {
228
228
  return he[Symbol.hasInstance](e) || super[Symbol.hasInstance](e);
229
229
  }
230
230
  }
231
- let $ = {
231
+ let F = {
232
232
  default: "${path} is invalid",
233
233
  required: "${path} is a required field",
234
234
  defined: "${path} must be defined",
@@ -236,15 +236,15 @@ let $ = {
236
236
  oneOf: "${path} must be one of the following values: ${values}",
237
237
  notOneOf: "${path} must not be one of the following values: ${values}",
238
238
  notType: ({
239
- path: n,
239
+ path: r,
240
240
  type: e,
241
241
  value: t,
242
- originalValue: r
242
+ originalValue: n
243
243
  }) => {
244
- const s = r != null && r !== t ? ` (cast from the value \`${I(r, !0)}\`).` : ".";
245
- return e !== "mixed" ? `${n} must be a \`${e}\` type, but the final value was: \`${I(t, !0)}\`` + s : `${n} must match the configured type. The validated value was: \`${I(t, !0)}\`` + s;
244
+ const s = n != null && n !== t ? ` (cast from the value \`${I(n, !0)}\`).` : ".";
245
+ return e !== "mixed" ? `${r} must be a \`${e}\` type, but the final value was: \`${I(t, !0)}\`` + s : `${r} must match the configured type. The validated value was: \`${I(t, !0)}\`` + s;
246
246
  }
247
- }, _ = {
247
+ }, v = {
248
248
  length: "${path} must be exactly ${length} characters",
249
249
  min: "${path} must be at least ${min} characters",
250
250
  max: "${path} must be at most ${max} characters",
@@ -279,22 +279,22 @@ let $ = {
279
279
  max: "${path} field must have less than or equal to ${max} items",
280
280
  length: "${path} must have ${length} items"
281
281
  }, Ye = {
282
- notType: (n) => {
282
+ notType: (r) => {
283
283
  const {
284
284
  path: e,
285
285
  value: t,
286
- spec: r
287
- } = n, s = r.types.length;
286
+ spec: n
287
+ } = r, s = n.types.length;
288
288
  if (Array.isArray(t)) {
289
289
  if (t.length < s) return `${e} tuple value has too few items, expected a length of ${s} but got ${t.length} for value: \`${I(t, !0)}\``;
290
290
  if (t.length > s) return `${e} tuple value has too many items, expected a length of ${s} but got ${t.length} for value: \`${I(t, !0)}\``;
291
291
  }
292
- return F.formatError($.notType, n);
292
+ return S.formatError(F.notType, r);
293
293
  }
294
294
  };
295
295
  Object.assign(/* @__PURE__ */ Object.create(null), {
296
- mixed: $,
297
- string: _,
296
+ mixed: F,
297
+ string: v,
298
298
  number: Ve,
299
299
  date: te,
300
300
  object: B,
@@ -302,18 +302,18 @@ Object.assign(/* @__PURE__ */ Object.create(null), {
302
302
  boolean: Ze,
303
303
  tuple: Ye
304
304
  });
305
- const ne = (n) => n && n.__isYupSchema__;
306
- class H {
305
+ const re = (r) => r && r.__isYupSchema__;
306
+ class G {
307
307
  static fromOptions(e, t) {
308
308
  if (!t.then && !t.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
309
309
  let {
310
- is: r,
310
+ is: n,
311
311
  then: s,
312
- otherwise: i
313
- } = t, a = typeof r == "function" ? r : (...u) => u.every((o) => o === r);
314
- return new H(e, (u, o) => {
312
+ otherwise: a
313
+ } = t, i = typeof n == "function" ? n : (...u) => u.every((o) => o === n);
314
+ return new G(e, (u, o) => {
315
315
  var d;
316
- let l = a(...u) ? s : i;
316
+ let l = i(...u) ? s : a;
317
317
  return (d = l == null ? void 0 : l(o)) != null ? d : o;
318
318
  });
319
319
  }
@@ -321,14 +321,14 @@ class H {
321
321
  this.fn = void 0, this.refs = e, this.refs = e, this.fn = t;
322
322
  }
323
323
  resolve(e, t) {
324
- let r = this.refs.map((i) => (
324
+ let n = this.refs.map((a) => (
325
325
  // TODO: ? operator here?
326
- i.getValue(t == null ? void 0 : t.value, t == null ? void 0 : t.parent, t == null ? void 0 : t.context)
327
- )), s = this.fn(r, e, t);
326
+ a.getValue(t == null ? void 0 : t.value, t == null ? void 0 : t.parent, t == null ? void 0 : t.context)
327
+ )), s = this.fn(n, e, t);
328
328
  if (s === void 0 || // @ts-ignore this can be base
329
329
  s === e)
330
330
  return e;
331
- if (!ne(s)) throw new TypeError("conditions must return a schema object");
331
+ if (!re(s)) throw new TypeError("conditions must return a schema object");
332
332
  return s.resolve(t);
333
333
  }
334
334
  }
@@ -336,16 +336,16 @@ const Z = {
336
336
  context: "$",
337
337
  value: "."
338
338
  };
339
- class P {
339
+ class L {
340
340
  constructor(e, t = {}) {
341
341
  if (this.key = void 0, this.isContext = void 0, this.isValue = void 0, this.isSibling = void 0, this.path = void 0, this.getter = void 0, this.map = void 0, typeof e != "string") throw new TypeError("ref must be a string, got: " + e);
342
342
  if (this.key = e.trim(), e === "") throw new TypeError("ref must be a non-empty string");
343
343
  this.isContext = this.key[0] === Z.context, this.isValue = this.key[0] === Z.value, this.isSibling = !this.isContext && !this.isValue;
344
- let r = this.isContext ? Z.context : this.isValue ? Z.value : "";
345
- this.path = this.key.slice(r.length), this.getter = this.path && U.getter(this.path, !0), this.map = t.map;
344
+ let n = this.isContext ? Z.context : this.isValue ? Z.value : "";
345
+ this.path = this.key.slice(n.length), this.getter = this.path && N.getter(this.path, !0), this.map = t.map;
346
346
  }
347
- getValue(e, t, r) {
348
- let s = this.isContext ? r : this.isValue ? e : t;
347
+ getValue(e, t, n) {
348
+ let s = this.isContext ? n : this.isValue ? e : t;
349
349
  return this.getter && (s = this.getter(s || {})), this.map && (s = this.map(s)), s;
350
350
  }
351
351
  /**
@@ -374,160 +374,160 @@ class P {
374
374
  return e && e.__isYupRef;
375
375
  }
376
376
  }
377
- P.prototype.__isYupRef = !0;
378
- const N = (n) => n == null;
379
- function M(n) {
377
+ L.prototype.__isYupRef = !0;
378
+ const j = (r) => r == null;
379
+ function M(r) {
380
380
  function e({
381
381
  value: t,
382
- path: r = "",
382
+ path: n = "",
383
383
  options: s,
384
- originalValue: i,
385
- schema: a
384
+ originalValue: a,
385
+ schema: i
386
386
  }, u, o) {
387
387
  const {
388
388
  name: d,
389
389
  test: l,
390
390
  params: f,
391
391
  message: h,
392
- skipAbsent: m
393
- } = n;
392
+ skipAbsent: p
393
+ } = r;
394
394
  let {
395
- parent: E,
396
- context: x,
397
- abortEarly: v = a.spec.abortEarly,
398
- disableStackTrace: c = a.spec.disableStackTrace
395
+ parent: y,
396
+ context: b,
397
+ abortEarly: E = i.spec.abortEarly,
398
+ disableStackTrace: c = i.spec.disableStackTrace
399
399
  } = s;
400
- function p(b) {
401
- return P.isRef(b) ? b.getValue(t, E, x) : b;
400
+ function m(g) {
401
+ return L.isRef(g) ? g.getValue(t, y, b) : g;
402
402
  }
403
- function w(b = {}) {
404
- const j = Object.assign({
403
+ function w(g = {}) {
404
+ const U = Object.assign({
405
405
  value: t,
406
- originalValue: i,
407
- label: a.spec.label,
408
- path: b.path || r,
409
- spec: a.spec,
410
- disableStackTrace: b.disableStackTrace || c
411
- }, f, b.params);
412
- for (const ue of Object.keys(j)) j[ue] = p(j[ue]);
413
- const ae = new F(F.formatError(b.message || h, j), t, j.path, b.type || d, j.disableStackTrace);
414
- return ae.params = j, ae;
406
+ originalValue: a,
407
+ label: i.spec.label,
408
+ path: g.path || n,
409
+ spec: i.spec,
410
+ disableStackTrace: g.disableStackTrace || c
411
+ }, f, g.params);
412
+ for (const ue of Object.keys(U)) U[ue] = m(U[ue]);
413
+ const ae = new S(S.formatError(g.message || h, U), t, U.path, g.type || d, U.disableStackTrace);
414
+ return ae.params = U, ae;
415
415
  }
416
- const O = v ? u : o;
417
- let y = {
418
- path: r,
419
- parent: E,
416
+ const O = E ? u : o;
417
+ let x = {
418
+ path: n,
419
+ parent: y,
420
420
  type: d,
421
421
  from: s.from,
422
422
  createError: w,
423
- resolve: p,
423
+ resolve: m,
424
424
  options: s,
425
- originalValue: i,
426
- schema: a
425
+ originalValue: a,
426
+ schema: i
427
427
  };
428
- const g = (b) => {
429
- F.isError(b) ? O(b) : b ? o(null) : O(w());
430
- }, T = (b) => {
431
- F.isError(b) ? O(b) : u(b);
428
+ const _ = (g) => {
429
+ S.isError(g) ? O(g) : g ? o(null) : O(w());
430
+ }, T = (g) => {
431
+ S.isError(g) ? O(g) : u(g);
432
432
  };
433
- if (m && N(t))
434
- return g(!0);
433
+ if (p && j(t))
434
+ return _(!0);
435
435
  let D;
436
436
  try {
437
437
  var ie;
438
- if (D = l.call(y, t, y), typeof ((ie = D) == null ? void 0 : ie.then) == "function") {
438
+ if (D = l.call(x, t, x), typeof ((ie = D) == null ? void 0 : ie.then) == "function") {
439
439
  if (s.sync)
440
- throw new Error(`Validation test of type: "${y.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
441
- return Promise.resolve(D).then(g, T);
440
+ throw new Error(`Validation test of type: "${x.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
441
+ return Promise.resolve(D).then(_, T);
442
442
  }
443
- } catch (b) {
444
- T(b);
443
+ } catch (g) {
444
+ T(g);
445
445
  return;
446
446
  }
447
- g(D);
447
+ _(D);
448
448
  }
449
- return e.OPTIONS = n, e;
449
+ return e.OPTIONS = r, e;
450
450
  }
451
- function Ge(n, e, t, r = t) {
452
- let s, i, a;
453
- return e ? (U.forEach(e, (u, o, d) => {
451
+ function Xe(r, e, t, n = t) {
452
+ let s, a, i;
453
+ return e ? (N.forEach(e, (u, o, d) => {
454
454
  let l = o ? u.slice(1, u.length - 1) : u;
455
- n = n.resolve({
456
- context: r,
455
+ r = r.resolve({
456
+ context: n,
457
457
  parent: s,
458
458
  value: t
459
459
  });
460
- let f = n.type === "tuple", h = d ? parseInt(l, 10) : 0;
461
- if (n.innerType || f) {
462
- if (f && !d) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);
460
+ let f = r.type === "tuple", h = d ? parseInt(l, 10) : 0;
461
+ if (r.innerType || f) {
462
+ if (f && !d) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${i}" must contain an index to the tuple element, e.g. "${i}[0]"`);
463
463
  if (t && h >= t.length)
464
464
  throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${e}. because there is no value at that index. `);
465
- s = t, t = t && t[h], n = f ? n.spec.types[h] : n.innerType;
465
+ s = t, t = t && t[h], r = f ? r.spec.types[h] : r.innerType;
466
466
  }
467
467
  if (!d) {
468
- if (!n.fields || !n.fields[l]) throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${n.type}")`);
469
- s = t, t = t && t[l], n = n.fields[l];
468
+ if (!r.fields || !r.fields[l]) throw new Error(`The schema does not contain the path: ${e}. (failed at: ${i} which is a type: "${r.type}")`);
469
+ s = t, t = t && t[l], r = r.fields[l];
470
470
  }
471
- i = l, a = o ? "[" + u + "]" : "." + u;
471
+ a = l, i = o ? "[" + u + "]" : "." + u;
472
472
  }), {
473
- schema: n,
473
+ schema: r,
474
474
  parent: s,
475
- parentPath: i
475
+ parentPath: a
476
476
  }) : {
477
477
  parent: s,
478
478
  parentPath: e,
479
- schema: n
479
+ schema: r
480
480
  };
481
481
  }
482
- class K extends Set {
482
+ class H extends Set {
483
483
  describe() {
484
484
  const e = [];
485
485
  for (const t of this.values())
486
- e.push(P.isRef(t) ? t.describe() : t);
486
+ e.push(L.isRef(t) ? t.describe() : t);
487
487
  return e;
488
488
  }
489
489
  resolveAll(e) {
490
490
  let t = [];
491
- for (const r of this.values())
492
- t.push(e(r));
491
+ for (const n of this.values())
492
+ t.push(e(n));
493
493
  return t;
494
494
  }
495
495
  clone() {
496
- return new K(this.values());
496
+ return new H(this.values());
497
497
  }
498
498
  merge(e, t) {
499
- const r = this.clone();
500
- return e.forEach((s) => r.add(s)), t.forEach((s) => r.delete(s)), r;
499
+ const n = this.clone();
500
+ return e.forEach((s) => n.add(s)), t.forEach((s) => n.delete(s)), n;
501
501
  }
502
502
  }
503
- function R(n, e = /* @__PURE__ */ new Map()) {
504
- if (ne(n) || !n || typeof n != "object") return n;
505
- if (e.has(n)) return e.get(n);
503
+ function P(r, e = /* @__PURE__ */ new Map()) {
504
+ if (re(r) || !r || typeof r != "object") return r;
505
+ if (e.has(r)) return e.get(r);
506
506
  let t;
507
- if (n instanceof Date)
508
- t = new Date(n.getTime()), e.set(n, t);
509
- else if (n instanceof RegExp)
510
- t = new RegExp(n), e.set(n, t);
511
- else if (Array.isArray(n)) {
512
- t = new Array(n.length), e.set(n, t);
513
- for (let r = 0; r < n.length; r++) t[r] = R(n[r], e);
514
- } else if (n instanceof Map) {
515
- t = /* @__PURE__ */ new Map(), e.set(n, t);
516
- for (const [r, s] of n.entries()) t.set(r, R(s, e));
517
- } else if (n instanceof Set) {
518
- t = /* @__PURE__ */ new Set(), e.set(n, t);
519
- for (const r of n) t.add(R(r, e));
520
- } else if (n instanceof Object) {
521
- t = {}, e.set(n, t);
522
- for (const [r, s] of Object.entries(n)) t[r] = R(s, e);
507
+ if (r instanceof Date)
508
+ t = new Date(r.getTime()), e.set(r, t);
509
+ else if (r instanceof RegExp)
510
+ t = new RegExp(r), e.set(r, t);
511
+ else if (Array.isArray(r)) {
512
+ t = new Array(r.length), e.set(r, t);
513
+ for (let n = 0; n < r.length; n++) t[n] = P(r[n], e);
514
+ } else if (r instanceof Map) {
515
+ t = /* @__PURE__ */ new Map(), e.set(r, t);
516
+ for (const [n, s] of r.entries()) t.set(n, P(s, e));
517
+ } else if (r instanceof Set) {
518
+ t = /* @__PURE__ */ new Set(), e.set(r, t);
519
+ for (const n of r) t.add(P(n, e));
520
+ } else if (r instanceof Object) {
521
+ t = {}, e.set(r, t);
522
+ for (const [n, s] of Object.entries(r)) t[n] = P(s, e);
523
523
  } else
524
- throw Error(`Unable to clone ${n}`);
524
+ throw Error(`Unable to clone ${r}`);
525
525
  return t;
526
526
  }
527
- class S {
527
+ class $ {
528
528
  constructor(e) {
529
- this.type = void 0, this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this.internalTests = {}, this._whitelist = new K(), this._blacklist = new K(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this._typeCheck = void 0, this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
530
- this.typeError($.notType);
529
+ this.type = void 0, this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this.internalTests = {}, this._whitelist = new H(), this._blacklist = new H(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this._typeCheck = void 0, this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
530
+ this.typeError(F.notType);
531
531
  }), this.type = e.type, this._typeCheck = e.check, this.spec = Object.assign({
532
532
  strip: !1,
533
533
  strict: !1,
@@ -549,7 +549,7 @@ class S {
549
549
  if (this._mutate)
550
550
  return e && Object.assign(this.spec, e), this;
551
551
  const t = Object.create(Object.getPrototypeOf(this));
552
- return t.type = this.type, t._typeCheck = this._typeCheck, t._whitelist = this._whitelist.clone(), t._blacklist = this._blacklist.clone(), t.internalTests = Object.assign({}, this.internalTests), t.exclusiveTests = Object.assign({}, this.exclusiveTests), t.deps = [...this.deps], t.conditions = [...this.conditions], t.tests = [...this.tests], t.transforms = [...this.transforms], t.spec = R(Object.assign({}, this.spec, e)), t;
552
+ return t.type = this.type, t._typeCheck = this._typeCheck, t._whitelist = this._whitelist.clone(), t._blacklist = this._blacklist.clone(), t.internalTests = Object.assign({}, this.internalTests), t.exclusiveTests = Object.assign({}, this.exclusiveTests), t.deps = [...this.deps], t.conditions = [...this.conditions], t.tests = [...this.tests], t.transforms = [...this.transforms], t.spec = P(Object.assign({}, this.spec, e)), t;
553
553
  }
554
554
  label(e) {
555
555
  let t = this.clone();
@@ -563,19 +563,19 @@ class S {
563
563
  withMutation(e) {
564
564
  let t = this._mutate;
565
565
  this._mutate = !0;
566
- let r = e(this);
567
- return this._mutate = t, r;
566
+ let n = e(this);
567
+ return this._mutate = t, n;
568
568
  }
569
569
  concat(e) {
570
570
  if (!e || e === this) return this;
571
571
  if (e.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);
572
- let t = this, r = e.clone();
573
- const s = Object.assign({}, t.spec, r.spec);
574
- return r.spec = s, r.internalTests = Object.assign({}, t.internalTests, r.internalTests), r._whitelist = t._whitelist.merge(e._whitelist, e._blacklist), r._blacklist = t._blacklist.merge(e._blacklist, e._whitelist), r.tests = t.tests, r.exclusiveTests = t.exclusiveTests, r.withMutation((i) => {
575
- e.tests.forEach((a) => {
576
- i.test(a.OPTIONS);
572
+ let t = this, n = e.clone();
573
+ const s = Object.assign({}, t.spec, n.spec);
574
+ return n.spec = s, n.internalTests = Object.assign({}, t.internalTests, n.internalTests), n._whitelist = t._whitelist.merge(e._whitelist, e._blacklist), n._blacklist = t._blacklist.merge(e._blacklist, e._whitelist), n.tests = t.tests, n.exclusiveTests = t.exclusiveTests, n.withMutation((a) => {
575
+ e.tests.forEach((i) => {
576
+ a.test(i.OPTIONS);
577
577
  });
578
- }), r.transforms = [...t.transforms, ...r.transforms], r;
578
+ }), n.transforms = [...t.transforms, ...n.transforms], n;
579
579
  }
580
580
  isType(e) {
581
581
  return e == null ? !!(this.spec.nullable && e === null || this.spec.optional && e === void 0) : this._typeCheck(e);
@@ -583,47 +583,47 @@ class S {
583
583
  resolve(e) {
584
584
  let t = this;
585
585
  if (t.conditions.length) {
586
- let r = t.conditions;
587
- t = t.clone(), t.conditions = [], t = r.reduce((s, i) => i.resolve(s, e), t), t = t.resolve(e);
586
+ let n = t.conditions;
587
+ t = t.clone(), t.conditions = [], t = n.reduce((s, a) => a.resolve(s, e), t), t = t.resolve(e);
588
588
  }
589
589
  return t;
590
590
  }
591
591
  resolveOptions(e) {
592
- var t, r, s, i;
592
+ var t, n, s, a;
593
593
  return Object.assign({}, e, {
594
594
  from: e.from || [],
595
595
  strict: (t = e.strict) != null ? t : this.spec.strict,
596
- abortEarly: (r = e.abortEarly) != null ? r : this.spec.abortEarly,
596
+ abortEarly: (n = e.abortEarly) != null ? n : this.spec.abortEarly,
597
597
  recursive: (s = e.recursive) != null ? s : this.spec.recursive,
598
- disableStackTrace: (i = e.disableStackTrace) != null ? i : this.spec.disableStackTrace
598
+ disableStackTrace: (a = e.disableStackTrace) != null ? a : this.spec.disableStackTrace
599
599
  });
600
600
  }
601
601
  /**
602
602
  * Run the configured transform pipeline over an input value.
603
603
  */
604
604
  cast(e, t = {}) {
605
- let r = this.resolve(Object.assign({
605
+ let n = this.resolve(Object.assign({
606
606
  value: e
607
- }, t)), s = t.assert === "ignore-optionality", i = r._cast(e, t);
608
- if (t.assert !== !1 && !r.isType(i)) {
609
- if (s && N(i))
610
- return i;
611
- let a = I(e), u = I(i);
612
- throw new TypeError(`The value of ${t.path || "field"} could not be cast to a value that satisfies the schema type: "${r.type}".
607
+ }, t)), s = t.assert === "ignore-optionality", a = n._cast(e, t);
608
+ if (t.assert !== !1 && !n.isType(a)) {
609
+ if (s && j(a))
610
+ return a;
611
+ let i = I(e), u = I(a);
612
+ throw new TypeError(`The value of ${t.path || "field"} could not be cast to a value that satisfies the schema type: "${n.type}".
613
613
 
614
- attempted value: ${a}
615
- ` + (u !== a ? `result of cast: ${u}` : ""));
614
+ attempted value: ${i}
615
+ ` + (u !== i ? `result of cast: ${u}` : ""));
616
616
  }
617
- return i;
617
+ return a;
618
618
  }
619
619
  _cast(e, t) {
620
- let r = e === void 0 ? e : this.transforms.reduce((s, i) => i.call(this, s, e, this), e);
621
- return r === void 0 && (r = this.getDefault(t)), r;
620
+ let n = e === void 0 ? e : this.transforms.reduce((s, a) => a.call(this, s, e, this), e);
621
+ return n === void 0 && (n = this.getDefault(t)), n;
622
622
  }
623
- _validate(e, t = {}, r, s) {
623
+ _validate(e, t = {}, n, s) {
624
624
  let {
625
- path: i,
626
- originalValue: a = e,
625
+ path: a,
626
+ originalValue: i = e,
627
627
  strict: u = this.spec.strict
628
628
  } = t, o = e;
629
629
  u || (o = this._cast(o, Object.assign({
@@ -633,75 +633,75 @@ attempted value: ${a}
633
633
  for (let l of Object.values(this.internalTests))
634
634
  l && d.push(l);
635
635
  this.runTests({
636
- path: i,
636
+ path: a,
637
637
  value: o,
638
- originalValue: a,
638
+ originalValue: i,
639
639
  options: t,
640
640
  tests: d
641
- }, r, (l) => {
641
+ }, n, (l) => {
642
642
  if (l.length)
643
643
  return s(l, o);
644
644
  this.runTests({
645
- path: i,
645
+ path: a,
646
646
  value: o,
647
- originalValue: a,
647
+ originalValue: i,
648
648
  options: t,
649
649
  tests: this.tests
650
- }, r, s);
650
+ }, n, s);
651
651
  });
652
652
  }
653
653
  /**
654
654
  * Executes a set of validations, either schema, produced Tests or a nested
655
655
  * schema validate result.
656
656
  */
657
- runTests(e, t, r) {
657
+ runTests(e, t, n) {
658
658
  let s = !1, {
659
- tests: i,
660
- value: a,
659
+ tests: a,
660
+ value: i,
661
661
  originalValue: u,
662
662
  path: o,
663
663
  options: d
664
- } = e, l = (x) => {
665
- s || (s = !0, t(x, a));
666
- }, f = (x) => {
667
- s || (s = !0, r(x, a));
668
- }, h = i.length, m = [];
664
+ } = e, l = (b) => {
665
+ s || (s = !0, t(b, i));
666
+ }, f = (b) => {
667
+ s || (s = !0, n(b, i));
668
+ }, h = a.length, p = [];
669
669
  if (!h) return f([]);
670
- let E = {
671
- value: a,
670
+ let y = {
671
+ value: i,
672
672
  originalValue: u,
673
673
  path: o,
674
674
  options: d,
675
675
  schema: this
676
676
  };
677
- for (let x = 0; x < i.length; x++) {
678
- const v = i[x];
679
- v(E, l, function(p) {
680
- p && (Array.isArray(p) ? m.push(...p) : m.push(p)), --h <= 0 && f(m);
677
+ for (let b = 0; b < a.length; b++) {
678
+ const E = a[b];
679
+ E(y, l, function(m) {
680
+ m && (Array.isArray(m) ? p.push(...m) : p.push(m)), --h <= 0 && f(p);
681
681
  });
682
682
  }
683
683
  }
684
684
  asNestedTest({
685
685
  key: e,
686
686
  index: t,
687
- parent: r,
687
+ parent: n,
688
688
  parentPath: s,
689
- originalParent: i,
690
- options: a
689
+ originalParent: a,
690
+ options: i
691
691
  }) {
692
692
  const u = e ?? t;
693
693
  if (u == null)
694
694
  throw TypeError("Must include `key` or `index` for nested validations");
695
695
  const o = typeof u == "number";
696
- let d = r[u];
697
- const l = Object.assign({}, a, {
696
+ let d = n[u];
697
+ const l = Object.assign({}, i, {
698
698
  // Nested validations fields are always strict:
699
699
  // 1. parent isn't strict so the casting will also have cast inner values
700
700
  // 2. parent is strict in which case the nested values weren't cast either
701
701
  strict: !0,
702
- parent: r,
702
+ parent: n,
703
703
  value: d,
704
- originalValue: i[u],
704
+ originalValue: a[u],
705
705
  // FIXME: tests depend on `index` being passed around deeply,
706
706
  // we should not let the options.key/index bleed through
707
707
  key: void 0,
@@ -709,50 +709,50 @@ attempted value: ${a}
709
709
  [o ? "index" : "key"]: u,
710
710
  path: o || u.includes(".") ? `${s || ""}[${o ? u : `"${u}"`}]` : (s ? `${s}.` : "") + e
711
711
  });
712
- return (f, h, m) => this.resolve(l)._validate(d, l, h, m);
712
+ return (f, h, p) => this.resolve(l)._validate(d, l, h, p);
713
713
  }
714
714
  validate(e, t) {
715
- var r;
715
+ var n;
716
716
  let s = this.resolve(Object.assign({}, t, {
717
717
  value: e
718
- })), i = (r = t == null ? void 0 : t.disableStackTrace) != null ? r : s.spec.disableStackTrace;
719
- return new Promise((a, u) => s._validate(e, t, (o, d) => {
720
- F.isError(o) && (o.value = d), u(o);
718
+ })), a = (n = t == null ? void 0 : t.disableStackTrace) != null ? n : s.spec.disableStackTrace;
719
+ return new Promise((i, u) => s._validate(e, t, (o, d) => {
720
+ S.isError(o) && (o.value = d), u(o);
721
721
  }, (o, d) => {
722
- o.length ? u(new F(o, d, void 0, void 0, i)) : a(d);
722
+ o.length ? u(new S(o, d, void 0, void 0, a)) : i(d);
723
723
  }));
724
724
  }
725
725
  validateSync(e, t) {
726
- var r;
726
+ var n;
727
727
  let s = this.resolve(Object.assign({}, t, {
728
728
  value: e
729
- })), i, a = (r = t == null ? void 0 : t.disableStackTrace) != null ? r : s.spec.disableStackTrace;
729
+ })), a, i = (n = t == null ? void 0 : t.disableStackTrace) != null ? n : s.spec.disableStackTrace;
730
730
  return s._validate(e, Object.assign({}, t, {
731
731
  sync: !0
732
732
  }), (u, o) => {
733
- throw F.isError(u) && (u.value = o), u;
733
+ throw S.isError(u) && (u.value = o), u;
734
734
  }, (u, o) => {
735
- if (u.length) throw new F(u, e, void 0, void 0, a);
736
- i = o;
737
- }), i;
735
+ if (u.length) throw new S(u, e, void 0, void 0, i);
736
+ a = o;
737
+ }), a;
738
738
  }
739
739
  isValid(e, t) {
740
- return this.validate(e, t).then(() => !0, (r) => {
741
- if (F.isError(r)) return !1;
742
- throw r;
740
+ return this.validate(e, t).then(() => !0, (n) => {
741
+ if (S.isError(n)) return !1;
742
+ throw n;
743
743
  });
744
744
  }
745
745
  isValidSync(e, t) {
746
746
  try {
747
747
  return this.validateSync(e, t), !0;
748
- } catch (r) {
749
- if (F.isError(r)) return !1;
750
- throw r;
748
+ } catch (n) {
749
+ if (S.isError(n)) return !1;
750
+ throw n;
751
751
  }
752
752
  }
753
753
  _getDefault(e) {
754
754
  let t = this.spec.default;
755
- return t == null ? t : typeof t == "function" ? t.call(this, e) : R(t);
755
+ return t == null ? t : typeof t == "function" ? t.call(this, e) : P(t);
756
756
  }
757
757
  getDefault(e) {
758
758
  return this.resolve(e || {})._getDefault(e);
@@ -768,42 +768,42 @@ attempted value: ${a}
768
768
  });
769
769
  }
770
770
  nullability(e, t) {
771
- const r = this.clone({
771
+ const n = this.clone({
772
772
  nullable: e
773
773
  });
774
- return r.internalTests.nullable = M({
774
+ return n.internalTests.nullable = M({
775
775
  message: t,
776
776
  name: "nullable",
777
777
  test(s) {
778
778
  return s === null ? this.schema.spec.nullable : !0;
779
779
  }
780
- }), r;
780
+ }), n;
781
781
  }
782
782
  optionality(e, t) {
783
- const r = this.clone({
783
+ const n = this.clone({
784
784
  optional: e
785
785
  });
786
- return r.internalTests.optionality = M({
786
+ return n.internalTests.optionality = M({
787
787
  message: t,
788
788
  name: "optionality",
789
789
  test(s) {
790
790
  return s === void 0 ? this.schema.spec.optional : !0;
791
791
  }
792
- }), r;
792
+ }), n;
793
793
  }
794
794
  optional() {
795
795
  return this.optionality(!0);
796
796
  }
797
- defined(e = $.defined) {
797
+ defined(e = F.defined) {
798
798
  return this.optionality(!1, e);
799
799
  }
800
800
  nullable() {
801
801
  return this.nullability(!0);
802
802
  }
803
- nonNullable(e = $.notNull) {
803
+ nonNullable(e = F.notNull) {
804
804
  return this.nullability(!1, e);
805
805
  }
806
- required(e = $.required) {
806
+ required(e = F.required) {
807
807
  return this.clone().withMutation((t) => t.nonNullable(e).defined(e));
808
808
  }
809
809
  notRequired() {
@@ -837,18 +837,18 @@ attempted value: ${a}
837
837
  name: e[0],
838
838
  message: e[1],
839
839
  test: e[2]
840
- }, t.message === void 0 && (t.message = $.default), typeof t.test != "function") throw new TypeError("`test` is a required parameters");
841
- let r = this.clone(), s = M(t), i = t.exclusive || t.name && r.exclusiveTests[t.name] === !0;
840
+ }, t.message === void 0 && (t.message = F.default), typeof t.test != "function") throw new TypeError("`test` is a required parameters");
841
+ let n = this.clone(), s = M(t), a = t.exclusive || t.name && n.exclusiveTests[t.name] === !0;
842
842
  if (t.exclusive && !t.name)
843
843
  throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");
844
- return t.name && (r.exclusiveTests[t.name] = !!t.exclusive), r.tests = r.tests.filter((a) => !(a.OPTIONS.name === t.name && (i || a.OPTIONS.test === s.OPTIONS.test))), r.tests.push(s), r;
844
+ return t.name && (n.exclusiveTests[t.name] = !!t.exclusive), n.tests = n.tests.filter((i) => !(i.OPTIONS.name === t.name && (a || i.OPTIONS.test === s.OPTIONS.test))), n.tests.push(s), n;
845
845
  }
846
846
  when(e, t) {
847
847
  !Array.isArray(e) && typeof e != "string" && (t = e, e = ".");
848
- let r = this.clone(), s = be(e).map((i) => new P(i));
849
- return s.forEach((i) => {
850
- i.isSibling && r.deps.push(i.key);
851
- }), r.conditions.push(typeof t == "function" ? new H(s, t) : H.fromOptions(s, t)), r;
848
+ let n = this.clone(), s = be(e).map((a) => new L(a));
849
+ return s.forEach((a) => {
850
+ a.isSibling && n.deps.push(a.key);
851
+ }), n.conditions.push(typeof t == "function" ? new G(s, t) : G.fromOptions(s, t)), n;
852
852
  }
853
853
  typeError(e) {
854
854
  let t = this.clone();
@@ -856,8 +856,8 @@ attempted value: ${a}
856
856
  message: e,
857
857
  name: "typeError",
858
858
  skipAbsent: !0,
859
- test(r) {
860
- return this.schema._typeCheck(r) ? !0 : this.createError({
859
+ test(n) {
860
+ return this.schema._typeCheck(n) ? !0 : this.createError({
861
861
  params: {
862
862
  type: this.schema.type
863
863
  }
@@ -865,42 +865,42 @@ attempted value: ${a}
865
865
  }
866
866
  }), t;
867
867
  }
868
- oneOf(e, t = $.oneOf) {
869
- let r = this.clone();
868
+ oneOf(e, t = F.oneOf) {
869
+ let n = this.clone();
870
870
  return e.forEach((s) => {
871
- r._whitelist.add(s), r._blacklist.delete(s);
872
- }), r.internalTests.whiteList = M({
871
+ n._whitelist.add(s), n._blacklist.delete(s);
872
+ }), n.internalTests.whiteList = M({
873
873
  message: t,
874
874
  name: "oneOf",
875
875
  skipAbsent: !0,
876
876
  test(s) {
877
- let i = this.schema._whitelist, a = i.resolveAll(this.resolve);
878
- return a.includes(s) ? !0 : this.createError({
877
+ let a = this.schema._whitelist, i = a.resolveAll(this.resolve);
878
+ return i.includes(s) ? !0 : this.createError({
879
879
  params: {
880
- values: Array.from(i).join(", "),
881
- resolved: a
880
+ values: Array.from(a).join(", "),
881
+ resolved: i
882
882
  }
883
883
  });
884
884
  }
885
- }), r;
885
+ }), n;
886
886
  }
887
- notOneOf(e, t = $.notOneOf) {
888
- let r = this.clone();
887
+ notOneOf(e, t = F.notOneOf) {
888
+ let n = this.clone();
889
889
  return e.forEach((s) => {
890
- r._blacklist.add(s), r._whitelist.delete(s);
891
- }), r.internalTests.blacklist = M({
890
+ n._blacklist.add(s), n._whitelist.delete(s);
891
+ }), n.internalTests.blacklist = M({
892
892
  message: t,
893
893
  name: "notOneOf",
894
894
  test(s) {
895
- let i = this.schema._blacklist, a = i.resolveAll(this.resolve);
896
- return a.includes(s) ? this.createError({
895
+ let a = this.schema._blacklist, i = a.resolveAll(this.resolve);
896
+ return i.includes(s) ? this.createError({
897
897
  params: {
898
- values: Array.from(i).join(", "),
899
- resolved: a
898
+ values: Array.from(a).join(", "),
899
+ resolved: i
900
900
  }
901
901
  }) : !0;
902
902
  }
903
- }), r;
903
+ }), n;
904
904
  }
905
905
  strip(e = !0) {
906
906
  let t = this.clone();
@@ -913,16 +913,16 @@ attempted value: ${a}
913
913
  */
914
914
  describe(e) {
915
915
  const t = (e ? this.resolve(e) : this).clone(), {
916
- label: r,
916
+ label: n,
917
917
  meta: s,
918
- optional: i,
919
- nullable: a
918
+ optional: a,
919
+ nullable: i
920
920
  } = t.spec;
921
921
  return {
922
922
  meta: s,
923
- label: r,
924
- optional: i,
925
- nullable: a,
923
+ label: n,
924
+ optional: a,
925
+ nullable: i,
926
926
  default: t.getDefault(e),
927
927
  type: t.type,
928
928
  oneOf: t._whitelist.describe(),
@@ -934,64 +934,64 @@ attempted value: ${a}
934
934
  };
935
935
  }
936
936
  }
937
- S.prototype.__isYupSchema__ = !0;
938
- for (const n of ["validate", "validateSync"]) S.prototype[`${n}At`] = function(e, t, r = {}) {
937
+ $.prototype.__isYupSchema__ = !0;
938
+ for (const r of ["validate", "validateSync"]) $.prototype[`${r}At`] = function(e, t, n = {}) {
939
939
  const {
940
940
  parent: s,
941
- parentPath: i,
942
- schema: a
943
- } = Ge(this, e, t, r.context);
944
- return a[n](s && s[i], Object.assign({}, r, {
941
+ parentPath: a,
942
+ schema: i
943
+ } = Xe(this, e, t, n.context);
944
+ return i[r](s && s[a], Object.assign({}, n, {
945
945
  parent: s,
946
946
  path: e
947
947
  }));
948
948
  };
949
- for (const n of ["equals", "is"]) S.prototype[n] = S.prototype.oneOf;
950
- for (const n of ["not", "nope"]) S.prototype[n] = S.prototype.notOneOf;
951
- const He = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
952
- function Ke(n) {
953
- const e = re(n);
954
- if (!e) return Date.parse ? Date.parse(n) : Number.NaN;
949
+ for (const r of ["equals", "is"]) $.prototype[r] = $.prototype.oneOf;
950
+ for (const r of ["not", "nope"]) $.prototype[r] = $.prototype.notOneOf;
951
+ const Ge = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
952
+ function He(r) {
953
+ const e = ne(r);
954
+ if (!e) return Date.parse ? Date.parse(r) : Number.NaN;
955
955
  if (e.z === void 0 && e.plusMinus === void 0)
956
956
  return new Date(e.year, e.month, e.day, e.hour, e.minute, e.second, e.millisecond).valueOf();
957
957
  let t = 0;
958
958
  return e.z !== "Z" && e.plusMinus !== void 0 && (t = e.hourOffset * 60 + e.minuteOffset, e.plusMinus === "+" && (t = 0 - t)), Date.UTC(e.year, e.month, e.day, e.hour, e.minute + t, e.second, e.millisecond);
959
959
  }
960
- function re(n) {
960
+ function ne(r) {
961
961
  var e, t;
962
- const r = He.exec(n);
963
- return r ? {
964
- year: k(r[1]),
965
- month: k(r[2], 1) - 1,
966
- day: k(r[3], 1),
967
- hour: k(r[4]),
968
- minute: k(r[5]),
969
- second: k(r[6]),
970
- millisecond: r[7] ? (
962
+ const n = Ge.exec(r);
963
+ return n ? {
964
+ year: k(n[1]),
965
+ month: k(n[2], 1) - 1,
966
+ day: k(n[3], 1),
967
+ hour: k(n[4]),
968
+ minute: k(n[5]),
969
+ second: k(n[6]),
970
+ millisecond: n[7] ? (
971
971
  // allow arbitrary sub-second precision beyond milliseconds
972
- k(r[7].substring(0, 3))
972
+ k(n[7].substring(0, 3))
973
973
  ) : 0,
974
- precision: (e = (t = r[7]) == null ? void 0 : t.length) != null ? e : void 0,
975
- z: r[8] || void 0,
976
- plusMinus: r[9] || void 0,
977
- hourOffset: k(r[10]),
978
- minuteOffset: k(r[11])
974
+ precision: (e = (t = n[7]) == null ? void 0 : t.length) != null ? e : void 0,
975
+ z: n[8] || void 0,
976
+ plusMinus: n[9] || void 0,
977
+ hourOffset: k(n[10]),
978
+ minuteOffset: k(n[11])
979
979
  } : null;
980
980
  }
981
- function k(n, e = 0) {
982
- return Number(n) || e;
981
+ function k(r, e = 0) {
982
+ return Number(r) || e;
983
983
  }
984
- let Xe = (
984
+ let Ke = (
985
985
  // eslint-disable-next-line
986
986
  /^[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])?)*$/
987
987
  ), Je = (
988
988
  // eslint-disable-next-line
989
989
  /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
990
- ), Qe = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, We = "^\\d{4}-\\d{2}-\\d{2}", et = "\\d{2}:\\d{2}:\\d{2}", tt = "(([+-]\\d{2}(:?\\d{2})?)|Z)", rt = new RegExp(`${We}T${et}(\\.\\d+)?${tt}$`), nt = (n) => N(n) || n === n.trim(), st = {}.toString();
990
+ ), Qe = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, We = "^\\d{4}-\\d{2}-\\d{2}", et = "\\d{2}:\\d{2}:\\d{2}", tt = "(([+-]\\d{2}(:?\\d{2})?)|Z)", nt = new RegExp(`${We}T${et}(\\.\\d+)?${tt}$`), rt = (r) => j(r) || r === r.trim(), st = {}.toString();
991
991
  function A() {
992
- return new we();
992
+ return new _e();
993
993
  }
994
- class we extends S {
994
+ class _e extends $ {
995
995
  constructor() {
996
996
  super({
997
997
  type: "string",
@@ -999,8 +999,8 @@ class we extends S {
999
999
  return e instanceof String && (e = e.valueOf()), typeof e == "string";
1000
1000
  }
1001
1001
  }), this.withMutation(() => {
1002
- this.transform((e, t, r) => {
1003
- if (!r.spec.coerce || r.isType(e) || Array.isArray(e)) return e;
1002
+ this.transform((e, t, n) => {
1003
+ if (!n.spec.coerce || n.isType(e) || Array.isArray(e)) return e;
1004
1004
  const s = e != null && e.toString ? e.toString() : e;
1005
1005
  return s === st ? e : s;
1006
1006
  });
@@ -1008,16 +1008,16 @@ class we extends S {
1008
1008
  }
1009
1009
  required(e) {
1010
1010
  return super.required(e).withMutation((t) => t.test({
1011
- message: e || $.required,
1011
+ message: e || F.required,
1012
1012
  name: "required",
1013
1013
  skipAbsent: !0,
1014
- test: (r) => !!r.length
1014
+ test: (n) => !!n.length
1015
1015
  }));
1016
1016
  }
1017
1017
  notRequired() {
1018
1018
  return super.notRequired().withMutation((e) => (e.tests = e.tests.filter((t) => t.OPTIONS.name !== "required"), e));
1019
1019
  }
1020
- length(e, t = _.length) {
1020
+ length(e, t = v.length) {
1021
1021
  return this.test({
1022
1022
  message: t,
1023
1023
  name: "length",
@@ -1026,12 +1026,12 @@ class we extends S {
1026
1026
  length: e
1027
1027
  },
1028
1028
  skipAbsent: !0,
1029
- test(r) {
1030
- return r.length === this.resolve(e);
1029
+ test(n) {
1030
+ return n.length === this.resolve(e);
1031
1031
  }
1032
1032
  });
1033
1033
  }
1034
- min(e, t = _.min) {
1034
+ min(e, t = v.min) {
1035
1035
  return this.test({
1036
1036
  message: t,
1037
1037
  name: "min",
@@ -1040,12 +1040,12 @@ class we extends S {
1040
1040
  min: e
1041
1041
  },
1042
1042
  skipAbsent: !0,
1043
- test(r) {
1044
- return r.length >= this.resolve(e);
1043
+ test(n) {
1044
+ return n.length >= this.resolve(e);
1045
1045
  }
1046
1046
  });
1047
1047
  }
1048
- max(e, t = _.max) {
1048
+ max(e, t = v.max) {
1049
1049
  return this.test({
1050
1050
  name: "max",
1051
1051
  exclusive: !0,
@@ -1054,42 +1054,42 @@ class we extends S {
1054
1054
  max: e
1055
1055
  },
1056
1056
  skipAbsent: !0,
1057
- test(r) {
1058
- return r.length <= this.resolve(e);
1057
+ test(n) {
1058
+ return n.length <= this.resolve(e);
1059
1059
  }
1060
1060
  });
1061
1061
  }
1062
1062
  matches(e, t) {
1063
- let r = !1, s, i;
1063
+ let n = !1, s, a;
1064
1064
  return t && (typeof t == "object" ? {
1065
- excludeEmptyString: r = !1,
1065
+ excludeEmptyString: n = !1,
1066
1066
  message: s,
1067
- name: i
1067
+ name: a
1068
1068
  } = t : s = t), this.test({
1069
- name: i || "matches",
1070
- message: s || _.matches,
1069
+ name: a || "matches",
1070
+ message: s || v.matches,
1071
1071
  params: {
1072
1072
  regex: e
1073
1073
  },
1074
1074
  skipAbsent: !0,
1075
- test: (a) => a === "" && r || a.search(e) !== -1
1075
+ test: (i) => i === "" && n || i.search(e) !== -1
1076
1076
  });
1077
1077
  }
1078
- email(e = _.email) {
1079
- return this.matches(Xe, {
1078
+ email(e = v.email) {
1079
+ return this.matches(Ke, {
1080
1080
  name: "email",
1081
1081
  message: e,
1082
1082
  excludeEmptyString: !0
1083
1083
  });
1084
1084
  }
1085
- url(e = _.url) {
1085
+ url(e = v.url) {
1086
1086
  return this.matches(Je, {
1087
1087
  name: "url",
1088
1088
  message: e,
1089
1089
  excludeEmptyString: !0
1090
1090
  });
1091
1091
  }
1092
- uuid(e = _.uuid) {
1092
+ uuid(e = v.uuid) {
1093
1093
  return this.matches(Qe, {
1094
1094
  name: "uuid",
1095
1095
  message: e,
@@ -1097,38 +1097,38 @@ class we extends S {
1097
1097
  });
1098
1098
  }
1099
1099
  datetime(e) {
1100
- let t = "", r, s;
1100
+ let t = "", n, s;
1101
1101
  return e && (typeof e == "object" ? {
1102
1102
  message: t = "",
1103
- allowOffset: r = !1,
1103
+ allowOffset: n = !1,
1104
1104
  precision: s = void 0
1105
- } = e : t = e), this.matches(rt, {
1105
+ } = e : t = e), this.matches(nt, {
1106
1106
  name: "datetime",
1107
- message: t || _.datetime,
1107
+ message: t || v.datetime,
1108
1108
  excludeEmptyString: !0
1109
1109
  }).test({
1110
1110
  name: "datetime_offset",
1111
- message: t || _.datetime_offset,
1111
+ message: t || v.datetime_offset,
1112
1112
  params: {
1113
- allowOffset: r
1113
+ allowOffset: n
1114
1114
  },
1115
1115
  skipAbsent: !0,
1116
- test: (i) => {
1117
- if (!i || r) return !0;
1118
- const a = re(i);
1119
- return a ? !!a.z : !1;
1116
+ test: (a) => {
1117
+ if (!a || n) return !0;
1118
+ const i = ne(a);
1119
+ return i ? !!i.z : !1;
1120
1120
  }
1121
1121
  }).test({
1122
1122
  name: "datetime_precision",
1123
- message: t || _.datetime_precision,
1123
+ message: t || v.datetime_precision,
1124
1124
  params: {
1125
1125
  precision: s
1126
1126
  },
1127
1127
  skipAbsent: !0,
1128
- test: (i) => {
1129
- if (!i || s == null) return !0;
1130
- const a = re(i);
1131
- return a ? a.precision === s : !1;
1128
+ test: (a) => {
1129
+ if (!a || s == null) return !0;
1130
+ const i = ne(a);
1131
+ return i ? i.precision === s : !1;
1132
1132
  }
1133
1133
  });
1134
1134
  }
@@ -1136,35 +1136,35 @@ class we extends S {
1136
1136
  ensure() {
1137
1137
  return this.default("").transform((e) => e === null ? "" : e);
1138
1138
  }
1139
- trim(e = _.trim) {
1139
+ trim(e = v.trim) {
1140
1140
  return this.transform((t) => t != null ? t.trim() : t).test({
1141
1141
  message: e,
1142
1142
  name: "trim",
1143
- test: nt
1143
+ test: rt
1144
1144
  });
1145
1145
  }
1146
- lowercase(e = _.lowercase) {
1147
- return this.transform((t) => N(t) ? t : t.toLowerCase()).test({
1146
+ lowercase(e = v.lowercase) {
1147
+ return this.transform((t) => j(t) ? t : t.toLowerCase()).test({
1148
1148
  message: e,
1149
1149
  name: "string_case",
1150
1150
  exclusive: !0,
1151
1151
  skipAbsent: !0,
1152
- test: (t) => N(t) || t === t.toLowerCase()
1152
+ test: (t) => j(t) || t === t.toLowerCase()
1153
1153
  });
1154
1154
  }
1155
- uppercase(e = _.uppercase) {
1156
- return this.transform((t) => N(t) ? t : t.toUpperCase()).test({
1155
+ uppercase(e = v.uppercase) {
1156
+ return this.transform((t) => j(t) ? t : t.toUpperCase()).test({
1157
1157
  message: e,
1158
1158
  name: "string_case",
1159
1159
  exclusive: !0,
1160
1160
  skipAbsent: !0,
1161
- test: (t) => N(t) || t === t.toUpperCase()
1161
+ test: (t) => j(t) || t === t.toUpperCase()
1162
1162
  });
1163
1163
  }
1164
1164
  }
1165
- A.prototype = we.prototype;
1166
- let it = /* @__PURE__ */ new Date(""), at = (n) => Object.prototype.toString.call(n) === "[object Date]";
1167
- class se extends S {
1165
+ A.prototype = _e.prototype;
1166
+ let it = /* @__PURE__ */ new Date(""), at = (r) => Object.prototype.toString.call(r) === "[object Date]";
1167
+ class se extends $ {
1168
1168
  constructor() {
1169
1169
  super({
1170
1170
  type: "date",
@@ -1172,22 +1172,22 @@ class se extends S {
1172
1172
  return at(e) && !isNaN(e.getTime());
1173
1173
  }
1174
1174
  }), this.withMutation(() => {
1175
- this.transform((e, t, r) => !r.spec.coerce || r.isType(e) || e === null ? e : (e = Ke(e), isNaN(e) ? se.INVALID_DATE : new Date(e)));
1175
+ this.transform((e, t, n) => !n.spec.coerce || n.isType(e) || e === null ? e : (e = He(e), isNaN(e) ? se.INVALID_DATE : new Date(e)));
1176
1176
  });
1177
1177
  }
1178
1178
  prepareParam(e, t) {
1179
- let r;
1180
- if (P.isRef(e))
1181
- r = e;
1179
+ let n;
1180
+ if (L.isRef(e))
1181
+ n = e;
1182
1182
  else {
1183
1183
  let s = this.cast(e);
1184
1184
  if (!this._typeCheck(s)) throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);
1185
- r = s;
1185
+ n = s;
1186
1186
  }
1187
- return r;
1187
+ return n;
1188
1188
  }
1189
1189
  min(e, t = te.min) {
1190
- let r = this.prepareParam(e, "min");
1190
+ let n = this.prepareParam(e, "min");
1191
1191
  return this.test({
1192
1192
  message: t,
1193
1193
  name: "min",
@@ -1197,12 +1197,12 @@ class se extends S {
1197
1197
  },
1198
1198
  skipAbsent: !0,
1199
1199
  test(s) {
1200
- return s >= this.resolve(r);
1200
+ return s >= this.resolve(n);
1201
1201
  }
1202
1202
  });
1203
1203
  }
1204
1204
  max(e, t = te.max) {
1205
- let r = this.prepareParam(e, "max");
1205
+ let n = this.prepareParam(e, "max");
1206
1206
  return this.test({
1207
1207
  message: t,
1208
1208
  name: "max",
@@ -1212,76 +1212,76 @@ class se extends S {
1212
1212
  },
1213
1213
  skipAbsent: !0,
1214
1214
  test(s) {
1215
- return s <= this.resolve(r);
1215
+ return s <= this.resolve(n);
1216
1216
  }
1217
1217
  });
1218
1218
  }
1219
1219
  }
1220
1220
  se.INVALID_DATE = it;
1221
- function ut(n, e = []) {
1222
- let t = [], r = /* @__PURE__ */ new Set(), s = new Set(e.map(([a, u]) => `${a}-${u}`));
1223
- function i(a, u) {
1224
- let o = U.split(a)[0];
1225
- r.add(o), s.has(`${u}-${o}`) || t.push([u, o]);
1221
+ function ut(r, e = []) {
1222
+ let t = [], n = /* @__PURE__ */ new Set(), s = new Set(e.map(([i, u]) => `${i}-${u}`));
1223
+ function a(i, u) {
1224
+ let o = N.split(i)[0];
1225
+ n.add(o), s.has(`${u}-${o}`) || t.push([u, o]);
1226
1226
  }
1227
- for (const a of Object.keys(n)) {
1228
- let u = n[a];
1229
- r.add(a), P.isRef(u) && u.isSibling ? i(u.path, a) : ne(u) && "deps" in u && u.deps.forEach((o) => i(o, a));
1227
+ for (const i of Object.keys(r)) {
1228
+ let u = r[i];
1229
+ n.add(i), L.isRef(u) && u.isSibling ? a(u.path, i) : re(u) && "deps" in u && u.deps.forEach((o) => a(o, i));
1230
1230
  }
1231
- return Ne.array(Array.from(r), t).reverse();
1231
+ return je.array(Array.from(n), t).reverse();
1232
1232
  }
1233
- function pe(n, e) {
1233
+ function pe(r, e) {
1234
1234
  let t = 1 / 0;
1235
- return n.some((r, s) => {
1236
- var i;
1237
- if ((i = e.path) != null && i.includes(r))
1235
+ return r.some((n, s) => {
1236
+ var a;
1237
+ if ((a = e.path) != null && a.includes(n))
1238
1238
  return t = s, !0;
1239
1239
  }), t;
1240
1240
  }
1241
- function ve(n) {
1242
- return (e, t) => pe(n, e) - pe(n, t);
1241
+ function we(r) {
1242
+ return (e, t) => pe(r, e) - pe(r, t);
1243
1243
  }
1244
- const ot = (n, e, t) => {
1245
- if (typeof n != "string")
1246
- return n;
1247
- let r = n;
1244
+ const ot = (r, e, t) => {
1245
+ if (typeof r != "string")
1246
+ return r;
1247
+ let n = r;
1248
1248
  try {
1249
- r = JSON.parse(n);
1249
+ n = JSON.parse(r);
1250
1250
  } catch {
1251
1251
  }
1252
- return t.isType(r) ? r : n;
1252
+ return t.isType(n) ? n : r;
1253
1253
  };
1254
- function Y(n) {
1255
- if ("fields" in n) {
1254
+ function Y(r) {
1255
+ if ("fields" in r) {
1256
1256
  const e = {};
1257
- for (const [t, r] of Object.entries(n.fields))
1258
- e[t] = Y(r);
1259
- return n.setFields(e);
1257
+ for (const [t, n] of Object.entries(r.fields))
1258
+ e[t] = Y(n);
1259
+ return r.setFields(e);
1260
1260
  }
1261
- if (n.type === "array") {
1262
- const e = n.optional();
1261
+ if (r.type === "array") {
1262
+ const e = r.optional();
1263
1263
  return e.innerType && (e.innerType = Y(e.innerType)), e;
1264
1264
  }
1265
- return n.type === "tuple" ? n.optional().clone({
1266
- types: n.spec.types.map(Y)
1267
- }) : "optional" in n ? n.optional() : n;
1265
+ return r.type === "tuple" ? r.optional().clone({
1266
+ types: r.spec.types.map(Y)
1267
+ }) : "optional" in r ? r.optional() : r;
1268
1268
  }
1269
- const lt = (n, e) => {
1270
- const t = [...U.normalizePath(e)];
1271
- if (t.length === 1) return t[0] in n;
1272
- let r = t.pop(), s = U.getter(U.join(t), !0)(n);
1273
- return !!(s && r in s);
1269
+ const lt = (r, e) => {
1270
+ const t = [...N.normalizePath(e)];
1271
+ if (t.length === 1) return t[0] in r;
1272
+ let n = t.pop(), s = N.getter(N.join(t), !0)(r);
1273
+ return !!(s && n in s);
1274
1274
  };
1275
- let me = (n) => Object.prototype.toString.call(n) === "[object Object]";
1276
- function ye(n, e) {
1277
- let t = Object.keys(n.fields);
1278
- return Object.keys(e).filter((r) => t.indexOf(r) === -1);
1275
+ let me = (r) => Object.prototype.toString.call(r) === "[object Object]";
1276
+ function ye(r, e) {
1277
+ let t = Object.keys(r.fields);
1278
+ return Object.keys(e).filter((n) => t.indexOf(n) === -1);
1279
1279
  }
1280
- const ct = ve([]);
1281
- function _e(n) {
1282
- return new Fe(n);
1280
+ const ct = we([]);
1281
+ function ve(r) {
1282
+ return new Se(r);
1283
1283
  }
1284
- class Fe extends S {
1284
+ class Se extends $ {
1285
1285
  constructor(e) {
1286
1286
  super({
1287
1287
  type: "object",
@@ -1293,69 +1293,69 @@ class Fe extends S {
1293
1293
  });
1294
1294
  }
1295
1295
  _cast(e, t = {}) {
1296
- var r;
1296
+ var n;
1297
1297
  let s = super._cast(e, t);
1298
1298
  if (s === void 0) return this.getDefault(t);
1299
1299
  if (!this._typeCheck(s)) return s;
1300
- let i = this.fields, a = (r = t.stripUnknown) != null ? r : this.spec.noUnknown, u = [].concat(this._nodes, Object.keys(s).filter((f) => !this._nodes.includes(f))), o = {}, d = Object.assign({}, t, {
1300
+ let a = this.fields, i = (n = t.stripUnknown) != null ? n : this.spec.noUnknown, u = [].concat(this._nodes, Object.keys(s).filter((f) => !this._nodes.includes(f))), o = {}, d = Object.assign({}, t, {
1301
1301
  parent: o,
1302
1302
  __validating: t.__validating || !1
1303
1303
  }), l = !1;
1304
1304
  for (const f of u) {
1305
- let h = i[f], m = f in s;
1305
+ let h = a[f], p = f in s;
1306
1306
  if (h) {
1307
- let E, x = s[f];
1307
+ let y, b = s[f];
1308
1308
  d.path = (t.path ? `${t.path}.` : "") + f, h = h.resolve({
1309
- value: x,
1309
+ value: b,
1310
1310
  context: t.context,
1311
1311
  parent: o
1312
1312
  });
1313
- let v = h instanceof S ? h.spec : void 0, c = v == null ? void 0 : v.strict;
1314
- if (v != null && v.strip) {
1313
+ let E = h instanceof $ ? h.spec : void 0, c = E == null ? void 0 : E.strict;
1314
+ if (E != null && E.strip) {
1315
1315
  l = l || f in s;
1316
1316
  continue;
1317
1317
  }
1318
- E = !t.__validating || !c ? (
1318
+ y = !t.__validating || !c ? (
1319
1319
  // TODO: use _cast, this is double resolving
1320
1320
  h.cast(s[f], d)
1321
- ) : s[f], E !== void 0 && (o[f] = E);
1322
- } else m && !a && (o[f] = s[f]);
1323
- (m !== f in o || o[f] !== s[f]) && (l = !0);
1321
+ ) : s[f], y !== void 0 && (o[f] = y);
1322
+ } else p && !i && (o[f] = s[f]);
1323
+ (p !== f in o || o[f] !== s[f]) && (l = !0);
1324
1324
  }
1325
1325
  return l ? o : s;
1326
1326
  }
1327
- _validate(e, t = {}, r, s) {
1327
+ _validate(e, t = {}, n, s) {
1328
1328
  let {
1329
- from: i = [],
1330
- originalValue: a = e,
1329
+ from: a = [],
1330
+ originalValue: i = e,
1331
1331
  recursive: u = this.spec.recursive
1332
1332
  } = t;
1333
1333
  t.from = [{
1334
1334
  schema: this,
1335
- value: a
1336
- }, ...i], t.__validating = !0, t.originalValue = a, super._validate(e, t, r, (o, d) => {
1335
+ value: i
1336
+ }, ...a], t.__validating = !0, t.originalValue = i, super._validate(e, t, n, (o, d) => {
1337
1337
  if (!u || !me(d)) {
1338
1338
  s(o, d);
1339
1339
  return;
1340
1340
  }
1341
- a = a || d;
1341
+ i = i || d;
1342
1342
  let l = [];
1343
1343
  for (let f of this._nodes) {
1344
1344
  let h = this.fields[f];
1345
- !h || P.isRef(h) || l.push(h.asNestedTest({
1345
+ !h || L.isRef(h) || l.push(h.asNestedTest({
1346
1346
  options: t,
1347
1347
  key: f,
1348
1348
  parent: d,
1349
1349
  parentPath: t.path,
1350
- originalParent: a
1350
+ originalParent: i
1351
1351
  }));
1352
1352
  }
1353
1353
  this.runTests({
1354
1354
  tests: l,
1355
1355
  value: d,
1356
- originalValue: a,
1356
+ originalValue: i,
1357
1357
  options: t
1358
- }, r, (f) => {
1358
+ }, n, (f) => {
1359
1359
  s(f.sort(this._sortErrors).concat(o), d);
1360
1360
  });
1361
1361
  });
@@ -1365,14 +1365,14 @@ class Fe extends S {
1365
1365
  return t.fields = Object.assign({}, this.fields), t._nodes = this._nodes, t._excludedEdges = this._excludedEdges, t._sortErrors = this._sortErrors, t;
1366
1366
  }
1367
1367
  concat(e) {
1368
- let t = super.concat(e), r = t.fields;
1369
- for (let [s, i] of Object.entries(this.fields)) {
1370
- const a = r[s];
1371
- r[s] = a === void 0 ? i : a;
1368
+ let t = super.concat(e), n = t.fields;
1369
+ for (let [s, a] of Object.entries(this.fields)) {
1370
+ const i = n[s];
1371
+ n[s] = i === void 0 ? a : i;
1372
1372
  }
1373
1373
  return t.withMutation((s) => (
1374
1374
  // XXX: excludes here is wrong
1375
- s.setFields(r, [...this._excludedEdges, ...e._excludedEdges])
1375
+ s.setFields(n, [...this._excludedEdges, ...e._excludedEdges])
1376
1376
  ));
1377
1377
  }
1378
1378
  _getDefault(e) {
@@ -1381,30 +1381,30 @@ class Fe extends S {
1381
1381
  if (!this._nodes.length)
1382
1382
  return;
1383
1383
  let t = {};
1384
- return this._nodes.forEach((r) => {
1384
+ return this._nodes.forEach((n) => {
1385
1385
  var s;
1386
- const i = this.fields[r];
1387
- let a = e;
1388
- (s = a) != null && s.value && (a = Object.assign({}, a, {
1389
- parent: a.value,
1390
- value: a.value[r]
1391
- })), t[r] = i && "getDefault" in i ? i.getDefault(a) : void 0;
1386
+ const a = this.fields[n];
1387
+ let i = e;
1388
+ (s = i) != null && s.value && (i = Object.assign({}, i, {
1389
+ parent: i.value,
1390
+ value: i.value[n]
1391
+ })), t[n] = a && "getDefault" in a ? a.getDefault(i) : void 0;
1392
1392
  }), t;
1393
1393
  }
1394
1394
  setFields(e, t) {
1395
- let r = this.clone();
1396
- return r.fields = e, r._nodes = ut(e, t), r._sortErrors = ve(Object.keys(e)), t && (r._excludedEdges = t), r;
1395
+ let n = this.clone();
1396
+ return n.fields = e, n._nodes = ut(e, t), n._sortErrors = we(Object.keys(e)), t && (n._excludedEdges = t), n;
1397
1397
  }
1398
1398
  shape(e, t = []) {
1399
- return this.clone().withMutation((r) => {
1400
- let s = r._excludedEdges;
1401
- return t.length && (Array.isArray(t[0]) || (t = [t]), s = [...r._excludedEdges, ...t]), r.setFields(Object.assign(r.fields, e), s);
1399
+ return this.clone().withMutation((n) => {
1400
+ let s = n._excludedEdges;
1401
+ return t.length && (Array.isArray(t[0]) || (t = [t]), s = [...n._excludedEdges, ...t]), n.setFields(Object.assign(n.fields, e), s);
1402
1402
  });
1403
1403
  }
1404
1404
  partial() {
1405
1405
  const e = {};
1406
- for (const [t, r] of Object.entries(this.fields))
1407
- e[t] = "optional" in r && r.optional instanceof Function ? r.optional() : r;
1406
+ for (const [t, n] of Object.entries(this.fields))
1407
+ e[t] = "optional" in n && n.optional instanceof Function ? n.optional() : n;
1408
1408
  return this.setFields(e);
1409
1409
  }
1410
1410
  deepPartial() {
@@ -1412,22 +1412,22 @@ class Fe extends S {
1412
1412
  }
1413
1413
  pick(e) {
1414
1414
  const t = {};
1415
- for (const r of e)
1416
- this.fields[r] && (t[r] = this.fields[r]);
1417
- return this.setFields(t, this._excludedEdges.filter(([r, s]) => e.includes(r) && e.includes(s)));
1415
+ for (const n of e)
1416
+ this.fields[n] && (t[n] = this.fields[n]);
1417
+ return this.setFields(t, this._excludedEdges.filter(([n, s]) => e.includes(n) && e.includes(s)));
1418
1418
  }
1419
1419
  omit(e) {
1420
1420
  const t = [];
1421
- for (const r of Object.keys(this.fields))
1422
- e.includes(r) || t.push(r);
1421
+ for (const n of Object.keys(this.fields))
1422
+ e.includes(n) || t.push(n);
1423
1423
  return this.pick(t);
1424
1424
  }
1425
- from(e, t, r) {
1426
- let s = U.getter(e, !0);
1427
- return this.transform((i) => {
1428
- if (!i) return i;
1429
- let a = i;
1430
- return lt(i, e) && (a = Object.assign({}, i), r || delete a[e], a[t] = s(i)), a;
1425
+ from(e, t, n) {
1426
+ let s = N.getter(e, !0);
1427
+ return this.transform((a) => {
1428
+ if (!a) return a;
1429
+ let i = a;
1430
+ return lt(a, e) && (i = Object.assign({}, a), n || delete i[e], i[t] = s(a)), i;
1431
1431
  });
1432
1432
  }
1433
1433
  /** Parse an input JSON string to an object */
@@ -1444,10 +1444,10 @@ class Fe extends S {
1444
1444
  message: e || B.exact,
1445
1445
  test(t) {
1446
1446
  if (t == null) return !0;
1447
- const r = ye(this.schema, t);
1448
- return r.length === 0 || this.createError({
1447
+ const n = ye(this.schema, t);
1448
+ return n.length === 0 || this.createError({
1449
1449
  params: {
1450
- properties: r.join(", ")
1450
+ properties: n.join(", ")
1451
1451
  }
1452
1452
  });
1453
1453
  }
@@ -1460,21 +1460,21 @@ class Fe extends S {
1460
1460
  }
1461
1461
  noUnknown(e = !0, t = B.noUnknown) {
1462
1462
  typeof e != "boolean" && (t = e, e = !0);
1463
- let r = this.test({
1463
+ let n = this.test({
1464
1464
  name: "noUnknown",
1465
1465
  exclusive: !0,
1466
1466
  message: t,
1467
1467
  test(s) {
1468
1468
  if (s == null) return !0;
1469
- const i = ye(this.schema, s);
1470
- return !e || i.length === 0 || this.createError({
1469
+ const a = ye(this.schema, s);
1470
+ return !e || a.length === 0 || this.createError({
1471
1471
  params: {
1472
- unknown: i.join(", ")
1472
+ unknown: a.join(", ")
1473
1473
  }
1474
1474
  });
1475
1475
  }
1476
1476
  });
1477
- return r.spec.noUnknown = e, r;
1477
+ return n.spec.noUnknown = e, n;
1478
1478
  }
1479
1479
  unknown(e = !0, t = B.noUnknown) {
1480
1480
  return this.noUnknown(!e, t);
@@ -1482,9 +1482,9 @@ class Fe extends S {
1482
1482
  transformKeys(e) {
1483
1483
  return this.transform((t) => {
1484
1484
  if (!t) return t;
1485
- const r = {};
1486
- for (const s of Object.keys(t)) r[e(s)] = t[s];
1487
- return r;
1485
+ const n = {};
1486
+ for (const s of Object.keys(t)) n[e(s)] = t[s];
1487
+ return n;
1488
1488
  });
1489
1489
  }
1490
1490
  camelCase() {
@@ -1497,25 +1497,25 @@ class Fe extends S {
1497
1497
  return this.transformKeys((e) => W.snakeCase(e).toUpperCase());
1498
1498
  }
1499
1499
  describe(e) {
1500
- const t = (e ? this.resolve(e) : this).clone(), r = super.describe(e);
1501
- r.fields = {};
1502
- for (const [i, a] of Object.entries(t.fields)) {
1500
+ const t = (e ? this.resolve(e) : this).clone(), n = super.describe(e);
1501
+ n.fields = {};
1502
+ for (const [a, i] of Object.entries(t.fields)) {
1503
1503
  var s;
1504
1504
  let u = e;
1505
1505
  (s = u) != null && s.value && (u = Object.assign({}, u, {
1506
1506
  parent: u.value,
1507
- value: u.value[i]
1508
- })), r.fields[i] = a.describe(u);
1507
+ value: u.value[a]
1508
+ })), n.fields[a] = i.describe(u);
1509
1509
  }
1510
- return r;
1510
+ return n;
1511
1511
  }
1512
1512
  }
1513
- _e.prototype = Fe.prototype;
1513
+ ve.prototype = Se.prototype;
1514
1514
  const ft = "#000639", dt = '<svg width="40" height="41" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 10.5C0 4.977 4.477.5 10 .5h20c5.523 0 10 4.477 10 10v20c0 5.523-4.477 10-10 10H10c-5.523 0-10-4.477-10-10v-20Z" fill="#F1F1F1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M25.927 15.78a.75.75 0 1 0-1.06-1.06l-4.793 4.793-4.793-4.793a.75.75 0 0 0-1.061 1.06l4.793 4.793-4.793 4.793a.75.75 0 1 0 1.06 1.061l4.794-4.793 4.793 4.793a.75.75 0 0 0 1.06-1.06l-4.793-4.794 4.793-4.793Z" fill="#000639"/></svg>';
1515
1515
  function ht() {
1516
- if (document.head.querySelector(`#${X}`)) return;
1516
+ if (document.head.querySelector(`#${K}`)) return;
1517
1517
  const e = document.createElement("style");
1518
- e.id = X, e.dataset.testid = X, document.head.appendChild(e), e.textContent = `
1518
+ e.id = K, e.dataset.testid = K, document.head.appendChild(e), e.textContent = `
1519
1519
 
1520
1520
  #${q}, #${q} * {
1521
1521
  margin: 0;
@@ -1523,14 +1523,14 @@ function ht() {
1523
1523
  box-sizing: border-box;
1524
1524
  }
1525
1525
 
1526
- #${G} {
1526
+ #${X} {
1527
1527
  position: absolute;
1528
1528
  top: 50%;
1529
1529
  left: 50%;
1530
1530
  transform: translate(-50%, -50%);
1531
1531
  }
1532
1532
 
1533
- #${L} {
1533
+ #${z} {
1534
1534
  position: absolute;
1535
1535
  top: 50%;
1536
1536
  left: 50%;
@@ -1548,8 +1548,8 @@ function ht() {
1548
1548
  }
1549
1549
  `;
1550
1550
  }
1551
- function pt(n) {
1552
- _e({
1551
+ function pt(r) {
1552
+ ve({
1553
1553
  fiatAmount: A().optional(),
1554
1554
  fiatCurrency: A().optional(),
1555
1555
  cryptoAmount: A().optional(),
@@ -1557,64 +1557,64 @@ function pt(n) {
1557
1557
  publicKey: A().required("Public key is required"),
1558
1558
  redirectUrl: A().optional(),
1559
1559
  side: A().oneOf(["buy", "sell"]).required()
1560
- }).validateSync(n, { abortEarly: !1 });
1560
+ }).validateSync(r, { abortEarly: !1 });
1561
1561
  }
1562
1562
  function mt() {
1563
- const n = document.createElement("div");
1564
- return n.id = q, n.dataset.testid = q, n.style.position = "fixed", n.style.top = "0px", n.style.left = "0px", n.style.width = "100%", n.style.height = "100%", n.style.zIndex = "999999999", n.style.backgroundColor = "rgba(0, 0, 0, 0.4)", n;
1563
+ const r = document.createElement("div");
1564
+ return r.id = q, r.dataset.testid = q, r.style.position = "fixed", r.style.top = "0px", r.style.left = "0px", r.style.width = "100%", r.style.height = "100%", r.style.zIndex = "999999999", r.style.backgroundColor = "rgba(0, 0, 0, 0.4)", r;
1565
1565
  }
1566
1566
  function yt() {
1567
- const n = document.createElement("button");
1568
- return n.id = ee, n.dataset.testid = ee, n.setAttribute("type", "button"), n.style.width = "40px", n.style.height = "40px", n.style.position = "absolute", n.style.right = "0", n.style.zIndex = "40", n.style.backgroundColor = "transparent", n.style.border = "none", n.innerHTML = dt, n;
1567
+ const r = document.createElement("button");
1568
+ return r.id = ee, r.dataset.testid = ee, r.setAttribute("type", "button"), r.style.width = "40px", r.style.height = "40px", r.style.position = "absolute", r.style.right = "0", r.style.zIndex = "40", r.style.backgroundColor = "transparent", r.style.border = "none", r.innerHTML = dt, r;
1569
1569
  }
1570
1570
  function bt() {
1571
- const n = document.createElement("div");
1572
- return n.id = G, n.dataset.testid = G, n.style.width = "40px", n.style.height = "40px", n.style.backgroundColor = "transparent", n.style.border = `2px solid ${ft}`, n.style.borderLeftColor = "transparent", n.style.borderBottomColor = "transparent", n.style.borderRadius = "100%", n.animate && n.animate(
1571
+ const r = document.createElement("div");
1572
+ return r.id = X, r.dataset.testid = X, r.style.width = "40px", r.style.height = "40px", r.style.backgroundColor = "transparent", r.style.border = `2px solid ${ft}`, r.style.borderLeftColor = "transparent", r.style.borderBottomColor = "transparent", r.style.borderRadius = "100%", r.animate && r.animate(
1573
1573
  [{ transform: "rotate(0)" }, { transform: "rotate(360deg)" }],
1574
1574
  {
1575
1575
  duration: 300,
1576
1576
  iterations: 1 / 0
1577
1577
  }
1578
- ), n;
1578
+ ), r;
1579
1579
  }
1580
1580
  function xt() {
1581
- const n = document.createElement("iframe");
1582
- return n.dataset.testid = L, n.name = L, n.id = L, n.allow = "clipboard-write self undefined", n;
1581
+ const r = document.createElement("iframe");
1582
+ return r.dataset.testid = z, r.name = z, r.id = z, r.allow = "clipboard-write self undefined", r;
1583
1583
  }
1584
- function gt(n) {
1585
- const e = (n.side === "buy", void 0), t = document.createElement("form");
1586
- t.target = L, t.dataset.testid = Oe, t.action = e ?? "", t.method = "GET", t.style.display = "none", ((u) => {
1587
- const o = process.env.NODE_ENV === "production", d = ["onSuccess", "onClose"];
1588
- o && d.push("side");
1589
- for (const l in u) {
1590
- if (!Object.prototype.hasOwnProperty.call(u, l) || d.includes(l)) continue;
1591
- const f = u[l], h = document.createElement("input");
1592
- h.name = l, h.value = String(f), t.appendChild(h);
1584
+ function gt({ sandbox: r, ...e }) {
1585
+ const t = r ?? !1, a = e.side === "buy" ? void 0 : void 0, i = document.createElement("form");
1586
+ i.target = z, i.dataset.testid = Oe, i.action = a ?? "", i.method = "GET", i.style.display = "none", ((f) => {
1587
+ const h = process.env.NODE_ENV === "production", p = ["onSuccess", "onClose"];
1588
+ h && p.push("side");
1589
+ for (const y in f) {
1590
+ if (!Object.prototype.hasOwnProperty.call(f, y) || p.includes(y)) continue;
1591
+ const b = f[y], E = document.createElement("input");
1592
+ E.name = y, E.value = String(b), i.appendChild(E);
1593
1593
  }
1594
- })(n);
1595
- const s = "POPUP", i = document.createElement("input");
1596
- i.name = "displayMode", i.value = s;
1597
- const a = document.createElement("input");
1598
- return a.name = "parentOrigin", a.value = window.location.origin, t.appendChild(i), t.appendChild(a), t;
1594
+ })(e);
1595
+ const o = "POPUP", d = document.createElement("input");
1596
+ d.name = "displayMode", d.value = o;
1597
+ const l = document.createElement("input");
1598
+ return l.name = "parentOrigin", l.value = window.location.origin, i.appendChild(d), i.appendChild(l), i;
1599
1599
  }
1600
- class wt {
1600
+ class _t {
1601
1601
  constructor(e) {
1602
- z(this, "payload");
1603
- z(this, "container", null);
1604
- z(this, "boundClose");
1605
- z(this, "onMessage", (e) => {
1606
- const t = process.env.NODE_ENV === "test", r = (this.payload.side === "buy", void 0);
1602
+ R(this, "payload");
1603
+ R(this, "container", null);
1604
+ R(this, "boundClose");
1605
+ R(this, "onMessage", (e) => {
1606
+ const t = process.env.NODE_ENV === "test", n = this.payload.sandboxMode ?? !1, i = this.payload.side === "buy" ? void 0 : void 0;
1607
1607
  if (t) {
1608
1608
  if (e.source !== window) return;
1609
1609
  } else {
1610
- if (!r) return;
1611
- const s = new URL(r);
1612
- if (e.origin !== s.origin) return;
1610
+ if (!i) return;
1611
+ const u = new URL(i);
1612
+ if (e.origin !== u.origin) return;
1613
1613
  }
1614
1614
  if (this.payload) {
1615
1615
  if (e.data.status === Te) {
1616
- const s = document.getElementById(G);
1617
- s && s.remove();
1616
+ const u = document.getElementById(X);
1617
+ u && u.remove();
1618
1618
  }
1619
1619
  e.data.status === oe && (this.payload.onClose && this.payload.onClose(e.data), this.cleanup()), e.data.status === ke && (this.payload.onSuccess && this.payload.onSuccess(e.data), this.cleanup());
1620
1620
  }
@@ -1625,8 +1625,8 @@ class wt {
1625
1625
  this.container = mt();
1626
1626
  const e = bt(), t = yt();
1627
1627
  t.addEventListener("click", this.boundClose), this.container.appendChild(e), this.container.appendChild(t);
1628
- const r = xt();
1629
- this.container.appendChild(r), document.body.appendChild(this.container);
1628
+ const n = xt();
1629
+ this.container.appendChild(n), document.body.appendChild(this.container);
1630
1630
  const s = gt(this.payload);
1631
1631
  this.container.appendChild(s), s.submit(), window.addEventListener("message", this.onMessage);
1632
1632
  }
@@ -1642,5 +1642,5 @@ class wt {
1642
1642
  }
1643
1643
  }
1644
1644
  export {
1645
- wt as BushaRampWidget
1645
+ _t as BushaRampWidget
1646
1646
  };