@busha/ramp-web-sdk 0.1.13 → 0.1.14
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/README.md +1 -1
- package/dist/index.es.js +25 -25
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -141,7 +141,7 @@ function App() {
|
|
|
141
141
|
| `onError` | `function` | ❌ | Callback when an error occurs |
|
|
142
142
|
| `amount` | `number` | ❌ | Pre-filled amount |
|
|
143
143
|
| `currency` | `string` | ❌ | Default currency (e.g., 'USD') |
|
|
144
|
-
| `
|
|
144
|
+
| `cryptoAsset` | `string` | ❌ | Default crypto currency (e.g., 'BTC') |
|
|
145
145
|
| `sandboxMode` | `boolean` | ❌ | Sandbox mode, defaults to false |
|
|
146
146
|
|
|
147
147
|
### Methods
|
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var ke = Object.defineProperty;
|
|
2
2
|
var Ce = (r, e, t) => e in r ? ke(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var z = (r, e, t) => Ce(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
const V = "busha-ramp-container", G = "busha-ramp-loader",
|
|
4
|
+
const V = "busha-ramp-container", G = "busha-ramp-loader", J = "busha-ramp-styles", H = "busha-ramp-close-btn", L = "busha-ramp-iframe", De = "busha-ramp-form", re = "https://buy.busha.co", xe = "https://sell.busha.co", ge = "https://sandbox.buy.busha.co", Ee = "https://sandbox.sell.busha.co", Ae = "INITIALIZED", le = "CANCELLED", Ie = "COMPLETED";
|
|
5
5
|
function je(r) {
|
|
6
6
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
7
7
|
}
|
|
8
|
-
var
|
|
8
|
+
var Q, ce;
|
|
9
9
|
function Ne() {
|
|
10
|
-
if (ce) return
|
|
10
|
+
if (ce) return Q;
|
|
11
11
|
ce = 1;
|
|
12
12
|
function r(c) {
|
|
13
13
|
this._maxSize = c, this.clear();
|
|
@@ -20,7 +20,7 @@ function Ne() {
|
|
|
20
20
|
return this._size >= this._maxSize && this.clear(), c in this._values || this._size++, this._values[c] = m;
|
|
21
21
|
};
|
|
22
22
|
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);
|
|
23
|
-
|
|
23
|
+
Q = {
|
|
24
24
|
Cache: r,
|
|
25
25
|
split: f,
|
|
26
26
|
normalizePath: l,
|
|
@@ -82,17 +82,17 @@ function Ne() {
|
|
|
82
82
|
function E(c) {
|
|
83
83
|
return !p(c) && (y(c) || b(c));
|
|
84
84
|
}
|
|
85
|
-
return
|
|
85
|
+
return Q;
|
|
86
86
|
}
|
|
87
|
-
var M = Ne(),
|
|
87
|
+
var M = Ne(), W, fe;
|
|
88
88
|
function Me() {
|
|
89
|
-
if (fe) return
|
|
89
|
+
if (fe) return W;
|
|
90
90
|
fe = 1;
|
|
91
91
|
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(
|
|
92
92
|
(f, h) => `${f}${f ? h[0].toUpperCase() + h.slice(1).toLowerCase() : h.toLowerCase()}`,
|
|
93
93
|
""
|
|
94
94
|
);
|
|
95
|
-
return
|
|
95
|
+
return W = {
|
|
96
96
|
words: e,
|
|
97
97
|
upperFirst: t,
|
|
98
98
|
camelCase: s,
|
|
@@ -101,9 +101,9 @@ function Me() {
|
|
|
101
101
|
kebabCase: (l) => n(l, "-"),
|
|
102
102
|
sentenceCase: (l) => t(n(l, " ")),
|
|
103
103
|
titleCase: (l) => e(l).map(t).join(" ")
|
|
104
|
-
},
|
|
104
|
+
}, W;
|
|
105
105
|
}
|
|
106
|
-
var
|
|
106
|
+
var ee = Me(), q = { exports: {} }, de;
|
|
107
107
|
function Ue() {
|
|
108
108
|
if (de) return q.exports;
|
|
109
109
|
de = 1, q.exports = function(s) {
|
|
@@ -302,7 +302,7 @@ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
|
302
302
|
tuple: Xe
|
|
303
303
|
});
|
|
304
304
|
const se = (r) => r && r.__isYupSchema__;
|
|
305
|
-
class
|
|
305
|
+
class K {
|
|
306
306
|
static fromOptions(e, t) {
|
|
307
307
|
if (!t.then && !t.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
|
|
308
308
|
let {
|
|
@@ -310,7 +310,7 @@ class H {
|
|
|
310
310
|
then: s,
|
|
311
311
|
otherwise: a
|
|
312
312
|
} = t, i = typeof n == "function" ? n : (...u) => u.every((o) => o === n);
|
|
313
|
-
return new
|
|
313
|
+
return new K(e, (u, o) => {
|
|
314
314
|
var d;
|
|
315
315
|
let l = i(...u) ? s : a;
|
|
316
316
|
return (d = l == null ? void 0 : l(o)) != null ? d : o;
|
|
@@ -478,7 +478,7 @@ function Je(r, e, t, n = t) {
|
|
|
478
478
|
schema: r
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
|
-
class
|
|
481
|
+
class X extends Set {
|
|
482
482
|
describe() {
|
|
483
483
|
const e = [];
|
|
484
484
|
for (const t of this.values())
|
|
@@ -492,7 +492,7 @@ class K extends Set {
|
|
|
492
492
|
return t;
|
|
493
493
|
}
|
|
494
494
|
clone() {
|
|
495
|
-
return new
|
|
495
|
+
return new X(this.values());
|
|
496
496
|
}
|
|
497
497
|
merge(e, t) {
|
|
498
498
|
const n = this.clone();
|
|
@@ -525,7 +525,7 @@ function R(r, e = /* @__PURE__ */ new Map()) {
|
|
|
525
525
|
}
|
|
526
526
|
class S {
|
|
527
527
|
constructor(e) {
|
|
528
|
-
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
|
|
528
|
+
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 X(), this._blacklist = new X(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this._typeCheck = void 0, this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
|
|
529
529
|
this.typeError($.notType);
|
|
530
530
|
}), this.type = e.type, this._typeCheck = e.check, this.spec = Object.assign({
|
|
531
531
|
strip: !1,
|
|
@@ -847,7 +847,7 @@ attempted value: ${i}
|
|
|
847
847
|
let n = this.clone(), s = we(e).map((a) => new U(a));
|
|
848
848
|
return s.forEach((a) => {
|
|
849
849
|
a.isSibling && n.deps.push(a.key);
|
|
850
|
-
}), n.conditions.push(typeof t == "function" ? new
|
|
850
|
+
}), n.conditions.push(typeof t == "function" ? new K(s, t) : K.fromOptions(s, t)), n;
|
|
851
851
|
}
|
|
852
852
|
typeError(e) {
|
|
853
853
|
let t = this.clone();
|
|
@@ -1487,13 +1487,13 @@ class Te extends S {
|
|
|
1487
1487
|
});
|
|
1488
1488
|
}
|
|
1489
1489
|
camelCase() {
|
|
1490
|
-
return this.transformKeys(
|
|
1490
|
+
return this.transformKeys(ee.camelCase);
|
|
1491
1491
|
}
|
|
1492
1492
|
snakeCase() {
|
|
1493
|
-
return this.transformKeys(
|
|
1493
|
+
return this.transformKeys(ee.snakeCase);
|
|
1494
1494
|
}
|
|
1495
1495
|
constantCase() {
|
|
1496
|
-
return this.transformKeys((e) =>
|
|
1496
|
+
return this.transformKeys((e) => ee.snakeCase(e).toUpperCase());
|
|
1497
1497
|
}
|
|
1498
1498
|
describe(e) {
|
|
1499
1499
|
const t = (e ? this.resolve(e) : this).clone(), n = super.describe(e);
|
|
@@ -1512,9 +1512,9 @@ class Te extends S {
|
|
|
1512
1512
|
Oe.prototype = Te.prototype;
|
|
1513
1513
|
const mt = "#000639", yt = '<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>';
|
|
1514
1514
|
function bt() {
|
|
1515
|
-
if (document.head.querySelector(`#${
|
|
1515
|
+
if (document.head.querySelector(`#${J}`)) return;
|
|
1516
1516
|
const e = document.createElement("style");
|
|
1517
|
-
e.id =
|
|
1517
|
+
e.id = J, e.dataset.testid = J, document.head.appendChild(e), e.textContent = `
|
|
1518
1518
|
|
|
1519
1519
|
#${V}, #${V} * {
|
|
1520
1520
|
margin: 0;
|
|
@@ -1564,7 +1564,7 @@ function gt() {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
function Et() {
|
|
1566
1566
|
const r = document.createElement("button");
|
|
1567
|
-
return r.id =
|
|
1567
|
+
return r.id = H, r.dataset.testid = H, 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 = yt, r;
|
|
1568
1568
|
}
|
|
1569
1569
|
function wt() {
|
|
1570
1570
|
const r = document.createElement("div");
|
|
@@ -1612,8 +1612,8 @@ class $t {
|
|
|
1612
1612
|
}
|
|
1613
1613
|
if (this.payload) {
|
|
1614
1614
|
if (e.data.status === Ae) {
|
|
1615
|
-
const u = document.getElementById(G);
|
|
1616
|
-
u && u.remove();
|
|
1615
|
+
const u = document.getElementById(G), o = document.getElementById(H);
|
|
1616
|
+
u && u.remove(), o && o.remove();
|
|
1617
1617
|
}
|
|
1618
1618
|
e.data.status === le && (this.payload.onClose && this.payload.onClose(e.data), this.cleanup()), e.data.status === Ie && (this.payload.onSuccess && this.payload.onSuccess(e.data), this.cleanup());
|
|
1619
1619
|
}
|
|
@@ -1636,7 +1636,7 @@ class $t {
|
|
|
1636
1636
|
}), this.cleanup();
|
|
1637
1637
|
}
|
|
1638
1638
|
cleanup() {
|
|
1639
|
-
const e = document.getElementById(V), t = document.getElementById(
|
|
1639
|
+
const e = document.getElementById(V), t = document.getElementById(H);
|
|
1640
1640
|
t && t.removeEventListener("click", this.boundClose), window.removeEventListener("message", this.onMessage), e && document.body.removeChild(e);
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function($,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):($=typeof globalThis<"u"?globalThis:$||self,w($.BushaRampWidget={}))})(this,function($){"use strict";var vt=Object.defineProperty;var _t=($,w,k)=>w in $?vt($,w,{enumerable:!0,configurable:!0,writable:!0,value:k}):$[w]=k;var Z=($,w,k)=>_t($,typeof w!="symbol"?w+"":w,k);const w="busha-ramp-container",k="busha-ramp-loader",J="busha-ramp-styles",W="busha-ramp-close-btn",q="busha-ramp-iframe",Ce="busha-ramp-form",Q="https://buy.busha.co",ue="https://sell.busha.co",oe="https://sandbox.buy.busha.co",le="https://sandbox.sell.busha.co",De="INITIALIZED",ce="CANCELLED",Ae="COMPLETED";function Ie(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ee,fe;function je(){if(fe)return ee;fe=1;function r(c){this._maxSize=c,this.clear()}r.prototype.clear=function(){this._size=0,this._values=Object.create(null)},r.prototype.get=function(c){return this._values[c]},r.prototype.set=function(c,m){return this._size>=this._maxSize&&this.clear(),c in this._values||this._size++,this._values[c]=m};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);ee={Cache:r,split:f,normalizePath:l,setter:function(c){var m=l(c);return o.get(c)||o.set(c,function(D,x){for(var v=0,A=m.length,N=D;v<A-1;){var M=m[v];if(M==="__proto__"||M==="constructor"||M==="prototype")return D;N=N[m[v++]]}N[m[v]]=x})},getter:function(c,m){var _=l(c);return d.get(c)||d.set(c,function(x){for(var v=0,A=_.length;v<A;)if(x!=null||!m)x=x[_[v++]];else return;return x})},join:function(c){return c.reduce(function(m,_){return m+(p(_)||t.test(_)?"["+_+"]":(m?".":"")+_)},"")},forEach:function(c,m,_){h(Array.isArray(c)?c:f(c),m,_)}};function l(c){return u.get(c)||u.set(c,f(c).map(function(m){return m.replace(a,"$2")}))}function f(c){return c.match(e)||[""]}function h(c,m,_){var D=c.length,x,v,A,N;for(v=0;v<D;v++)x=c[v],x&&(E(x)&&(x='"'+x+'"'),N=p(x),A=!N&&/^\d+$/.test(x),m.call(_,x,N,A,v,c))}function p(c){return typeof c=="string"&&c&&["'",'"'].indexOf(c.charAt(0))!==-1}function y(c){return c.match(n)&&!c.match(t)}function b(c){return s.test(c)}function E(c){return!p(c)&&(y(c)||b(c))}return ee}var P=je(),te,de;function Ne(){if(de)return te;de=1;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((f,h)=>`${f}${f?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return te={words:e,upperFirst:t,camelCase:s,pascalCase:l=>t(s(l)),snakeCase:l=>n(l,"_"),kebabCase:l=>n(l,"-"),sentenceCase:l=>t(n(l," ")),titleCase:l=>e(l).map(t).join(" ")},te}var ne=Ne(),B={exports:{}},he;function Me(){if(he)return B.exports;he=1,B.exports=function(s){return r(e(s),s)},B.exports.array=r;function r(s,a){var i=s.length,u=new Array(i),o={},d=i,l=t(a),f=n(s);for(a.forEach(function(p){if(!f.has(p[0])||!f.has(p[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)o[d]||h(s[d],d,new Set);return u;function h(p,y,b){if(b.has(p)){var E;try{E=", node was:"+JSON.stringify(p)}catch{E=""}throw new Error("Cyclic dependency"+E)}if(!f.has(p))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(p));if(!o[y]){o[y]=!0;var c=l.get(p)||new Set;if(c=Array.from(c),y=c.length){b.add(p);do{var m=c[--y];h(m,f.get(m),b)}while(y);b.delete(p)}u[--i]=p}}}function e(s){for(var a=new Set,i=0,u=s.length;i<u;i++){var o=s[i];a.add(o[0]),a.add(o[1])}return Array.from(a)}function t(s){for(var a=new Map,i=0,u=s.length;i<u;i++){var o=s[i];a.has(o[0])||a.set(o[0],new Set),a.has(o[1])||a.set(o[1],new Set),a.get(o[0]).add(o[1])}return a}function n(s){for(var a=new Map,i=0,u=s.length;i<u;i++)a.set(s[i],i);return a}return B.exports}var Pe=Me();const Ue=Ie(Pe),Re=Object.prototype.toString,ze=Error.prototype.toString,Le=RegExp.prototype.toString,Ve=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",qe=/^Symbol\((.*)\)(.*)$/;function Ze(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function pe(r,e=!1){if(r==null||r===!0||r===!1)return""+r;const t=typeof r;if(t==="number")return Ze(r);if(t==="string")return e?`"${r}"`:r;if(t==="function")return"[Function "+(r.name||"anonymous")+"]";if(t==="symbol")return Ve.call(r).replace(qe,"Symbol($1)");const n=Re.call(r).slice(8,-1);return n==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):n==="Error"||r instanceof Error?"["+ze.call(r)+"]":n==="RegExp"?Le.call(r):null}function I(r,e){let t=pe(r,e);return t!==null?t:JSON.stringify(r,function(n,s){let a=pe(this[n],e);return a!==null?a:s},2)}function me(r){return r==null?[]:[].concat(r)}let ye,be,xe,Be=/\$\{\s*(\w+)\s*\}/g;ye=Symbol.toStringTag;class ge{constructor(e,t,n,s){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[ye]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=s,this.errors=[],this.inner=[],me(e).forEach(a=>{if(F.isError(a)){this.errors.push(...a.errors);const i=a.inner.length?a.inner:[a];this.inner.push(...i)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}be=Symbol.hasInstance,xe=Symbol.toStringTag;class F extends Error{static formatError(e,t){const n=t.label||t.path||"this";return t=Object.assign({},t,{path:n,originalPath:t.path}),typeof e=="string"?e.replace(Be,(s,a)=>I(t[a])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,n,s,a){const i=new ge(e,t,n,s);if(a)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[xe]="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,F)}static[be](e){return ge[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let O={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:t,originalValue:n})=>{const s=n!=null&&n!==t?` (cast from the value \`${I(n,!0)}\`).`:".";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}},S={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ye={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},re={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ge={isValue:"${path} field must be ${value}"},Y={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:O,string:S,number:Ye,date:re,object:Y,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Ge,tuple:{notType:r=>{const{path:e,value:t,spec:n}=r,s=n.types.length;if(Array.isArray(t)){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)}\``;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)}\``}return F.formatError(O.notType,r)}}});const se=r=>r&&r.__isYupSchema__;class G{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:s,otherwise:a}=t,i=typeof n=="function"?n:(...u)=>u.every(o=>o===n);return new G(e,(u,o)=>{var d;let l=i(...u)?s:a;return(d=l==null?void 0:l(o))!=null?d:o})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let n=this.refs.map(a=>a.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),s=this.fn(n,e,t);if(s===void 0||s===e)return e;if(!se(s))throw new TypeError("conditions must return a schema object");return s.resolve(t)}}const H={context:"$",value:"."};class U{constructor(e,t={}){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);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===H.context,this.isValue=this.key[0]===H.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?H.context:this.isValue?H.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&P.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let s=this.isContext?n:this.isValue?e:t;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}U.prototype.__isYupRef=!0;const R=r=>r==null;function L(r){function e({value:t,path:n="",options:s,originalValue:a,schema:i},u,o){const{name:d,test:l,params:f,message:h,skipAbsent:p}=r;let{parent:y,context:b,abortEarly:E=i.spec.abortEarly,disableStackTrace:c=i.spec.disableStackTrace}=s;function m(g){return U.isRef(g)?g.getValue(t,y,b):g}function _(g={}){const z=Object.assign({value:t,originalValue:a,label:i.spec.label,path:g.path||n,spec:i.spec,disableStackTrace:g.disableStackTrace||c},f,g.params);for(const ke of Object.keys(z))z[ke]=m(z[ke]);const Te=new F(F.formatError(g.message||h,z),t,z.path,g.type||d,z.disableStackTrace);return Te.params=z,Te}const D=E?u:o;let x={path:n,parent:y,type:d,from:s.from,createError:_,resolve:m,options:s,originalValue:a,schema:i};const v=g=>{F.isError(g)?D(g):g?o(null):D(_())},A=g=>{F.isError(g)?D(g):u(g)};if(p&&R(t))return v(!0);let M;try{var Oe;if(M=l.call(x,t,x),typeof((Oe=M)==null?void 0:Oe.then)=="function"){if(s.sync)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`);return Promise.resolve(M).then(v,A)}}catch(g){A(g);return}v(M)}return e.OPTIONS=r,e}function He(r,e,t,n=t){let s,a,i;return e?(P.forEach(e,(u,o,d)=>{let l=o?u.slice(1,u.length-1):u;r=r.resolve({context:n,parent:s,value:t});let f=r.type==="tuple",h=d?parseInt(l,10):0;if(r.innerType||f){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]"`);if(t&&h>=t.length)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. `);s=t,t=t&&t[h],r=f?r.spec.types[h]:r.innerType}if(!d){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}")`);s=t,t=t&&t[l],r=r.fields[l]}a=l,i=o?"["+u+"]":"."+u}),{schema:r,parent:s,parentPath:a}):{parent:s,parentPath:e,schema:r}}class K extends Set{describe(){const e=[];for(const t of this.values())e.push(U.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const n of this.values())t.push(e(n));return t}clone(){return new K(this.values())}merge(e,t){const n=this.clone();return e.forEach(s=>n.add(s)),t.forEach(s=>n.delete(s)),n}}function V(r,e=new Map){if(se(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let t;if(r instanceof Date)t=new Date(r.getTime()),e.set(r,t);else if(r instanceof RegExp)t=new RegExp(r),e.set(r,t);else if(Array.isArray(r)){t=new Array(r.length),e.set(r,t);for(let n=0;n<r.length;n++)t[n]=V(r[n],e)}else if(r instanceof Map){t=new Map,e.set(r,t);for(const[n,s]of r.entries())t.set(n,V(s,e))}else if(r instanceof Set){t=new Set,e.set(r,t);for(const n of r)t.add(V(n,e))}else if(r instanceof Object){t={},e.set(r,t);for(const[n,s]of Object.entries(r))t[n]=V(s,e)}else throw Error(`Unable to clone ${r}`);return t}class T{constructor(e){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=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(O.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));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=V(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const s=Object.assign({},t.spec,n.spec);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=>{e.tests.forEach(i=>{a.test(i.OPTIONS)})}),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce((s,a)=>a.resolve(s,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,n,s,a;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(n=e.abortEarly)!=null?n:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(a=e.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(e,t={}){let n=this.resolve(Object.assign({value:e},t)),s=t.assert==="ignore-optionality",a=n._cast(e,t);if(t.assert!==!1&&!n.isType(a)){if(s&&R(a))return a;let i=I(e),u=I(a);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
|
|
1
|
+
(function($,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):($=typeof globalThis<"u"?globalThis:$||self,w($.BushaRampWidget={}))})(this,function($){"use strict";var vt=Object.defineProperty;var _t=($,w,k)=>w in $?vt($,w,{enumerable:!0,configurable:!0,writable:!0,value:k}):$[w]=k;var Z=($,w,k)=>_t($,typeof w!="symbol"?w+"":w,k);const w="busha-ramp-container",k="busha-ramp-loader",W="busha-ramp-styles",B="busha-ramp-close-btn",q="busha-ramp-iframe",Ce="busha-ramp-form",Q="https://buy.busha.co",ue="https://sell.busha.co",oe="https://sandbox.buy.busha.co",le="https://sandbox.sell.busha.co",De="INITIALIZED",ce="CANCELLED",Ae="COMPLETED";function Ie(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ee,fe;function je(){if(fe)return ee;fe=1;function r(c){this._maxSize=c,this.clear()}r.prototype.clear=function(){this._size=0,this._values=Object.create(null)},r.prototype.get=function(c){return this._values[c]},r.prototype.set=function(c,m){return this._size>=this._maxSize&&this.clear(),c in this._values||this._size++,this._values[c]=m};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);ee={Cache:r,split:f,normalizePath:l,setter:function(c){var m=l(c);return o.get(c)||o.set(c,function(D,x){for(var v=0,A=m.length,N=D;v<A-1;){var M=m[v];if(M==="__proto__"||M==="constructor"||M==="prototype")return D;N=N[m[v++]]}N[m[v]]=x})},getter:function(c,m){var _=l(c);return d.get(c)||d.set(c,function(x){for(var v=0,A=_.length;v<A;)if(x!=null||!m)x=x[_[v++]];else return;return x})},join:function(c){return c.reduce(function(m,_){return m+(p(_)||t.test(_)?"["+_+"]":(m?".":"")+_)},"")},forEach:function(c,m,_){h(Array.isArray(c)?c:f(c),m,_)}};function l(c){return u.get(c)||u.set(c,f(c).map(function(m){return m.replace(a,"$2")}))}function f(c){return c.match(e)||[""]}function h(c,m,_){var D=c.length,x,v,A,N;for(v=0;v<D;v++)x=c[v],x&&(E(x)&&(x='"'+x+'"'),N=p(x),A=!N&&/^\d+$/.test(x),m.call(_,x,N,A,v,c))}function p(c){return typeof c=="string"&&c&&["'",'"'].indexOf(c.charAt(0))!==-1}function y(c){return c.match(n)&&!c.match(t)}function b(c){return s.test(c)}function E(c){return!p(c)&&(y(c)||b(c))}return ee}var P=je(),te,de;function Ne(){if(de)return te;de=1;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((f,h)=>`${f}${f?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return te={words:e,upperFirst:t,camelCase:s,pascalCase:l=>t(s(l)),snakeCase:l=>n(l,"_"),kebabCase:l=>n(l,"-"),sentenceCase:l=>t(n(l," ")),titleCase:l=>e(l).map(t).join(" ")},te}var ne=Ne(),Y={exports:{}},he;function Me(){if(he)return Y.exports;he=1,Y.exports=function(s){return r(e(s),s)},Y.exports.array=r;function r(s,a){var i=s.length,u=new Array(i),o={},d=i,l=t(a),f=n(s);for(a.forEach(function(p){if(!f.has(p[0])||!f.has(p[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)o[d]||h(s[d],d,new Set);return u;function h(p,y,b){if(b.has(p)){var E;try{E=", node was:"+JSON.stringify(p)}catch{E=""}throw new Error("Cyclic dependency"+E)}if(!f.has(p))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(p));if(!o[y]){o[y]=!0;var c=l.get(p)||new Set;if(c=Array.from(c),y=c.length){b.add(p);do{var m=c[--y];h(m,f.get(m),b)}while(y);b.delete(p)}u[--i]=p}}}function e(s){for(var a=new Set,i=0,u=s.length;i<u;i++){var o=s[i];a.add(o[0]),a.add(o[1])}return Array.from(a)}function t(s){for(var a=new Map,i=0,u=s.length;i<u;i++){var o=s[i];a.has(o[0])||a.set(o[0],new Set),a.has(o[1])||a.set(o[1],new Set),a.get(o[0]).add(o[1])}return a}function n(s){for(var a=new Map,i=0,u=s.length;i<u;i++)a.set(s[i],i);return a}return Y.exports}var Pe=Me();const Ue=Ie(Pe),Re=Object.prototype.toString,ze=Error.prototype.toString,Le=RegExp.prototype.toString,Ve=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",qe=/^Symbol\((.*)\)(.*)$/;function Ze(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function pe(r,e=!1){if(r==null||r===!0||r===!1)return""+r;const t=typeof r;if(t==="number")return Ze(r);if(t==="string")return e?`"${r}"`:r;if(t==="function")return"[Function "+(r.name||"anonymous")+"]";if(t==="symbol")return Ve.call(r).replace(qe,"Symbol($1)");const n=Re.call(r).slice(8,-1);return n==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):n==="Error"||r instanceof Error?"["+ze.call(r)+"]":n==="RegExp"?Le.call(r):null}function I(r,e){let t=pe(r,e);return t!==null?t:JSON.stringify(r,function(n,s){let a=pe(this[n],e);return a!==null?a:s},2)}function me(r){return r==null?[]:[].concat(r)}let ye,be,xe,Be=/\$\{\s*(\w+)\s*\}/g;ye=Symbol.toStringTag;class ge{constructor(e,t,n,s){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[ye]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=s,this.errors=[],this.inner=[],me(e).forEach(a=>{if(F.isError(a)){this.errors.push(...a.errors);const i=a.inner.length?a.inner:[a];this.inner.push(...i)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}be=Symbol.hasInstance,xe=Symbol.toStringTag;class F extends Error{static formatError(e,t){const n=t.label||t.path||"this";return t=Object.assign({},t,{path:n,originalPath:t.path}),typeof e=="string"?e.replace(Be,(s,a)=>I(t[a])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,n,s,a){const i=new ge(e,t,n,s);if(a)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[xe]="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,F)}static[be](e){return ge[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let O={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:t,originalValue:n})=>{const s=n!=null&&n!==t?` (cast from the value \`${I(n,!0)}\`).`:".";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}},S={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ye={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},re={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ge={isValue:"${path} field must be ${value}"},G={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:O,string:S,number:Ye,date:re,object:G,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Ge,tuple:{notType:r=>{const{path:e,value:t,spec:n}=r,s=n.types.length;if(Array.isArray(t)){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)}\``;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)}\``}return F.formatError(O.notType,r)}}});const se=r=>r&&r.__isYupSchema__;class H{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:s,otherwise:a}=t,i=typeof n=="function"?n:(...u)=>u.every(o=>o===n);return new H(e,(u,o)=>{var d;let l=i(...u)?s:a;return(d=l==null?void 0:l(o))!=null?d:o})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let n=this.refs.map(a=>a.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),s=this.fn(n,e,t);if(s===void 0||s===e)return e;if(!se(s))throw new TypeError("conditions must return a schema object");return s.resolve(t)}}const K={context:"$",value:"."};class U{constructor(e,t={}){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);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===K.context,this.isValue=this.key[0]===K.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?K.context:this.isValue?K.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&P.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let s=this.isContext?n:this.isValue?e:t;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}U.prototype.__isYupRef=!0;const R=r=>r==null;function L(r){function e({value:t,path:n="",options:s,originalValue:a,schema:i},u,o){const{name:d,test:l,params:f,message:h,skipAbsent:p}=r;let{parent:y,context:b,abortEarly:E=i.spec.abortEarly,disableStackTrace:c=i.spec.disableStackTrace}=s;function m(g){return U.isRef(g)?g.getValue(t,y,b):g}function _(g={}){const z=Object.assign({value:t,originalValue:a,label:i.spec.label,path:g.path||n,spec:i.spec,disableStackTrace:g.disableStackTrace||c},f,g.params);for(const ke of Object.keys(z))z[ke]=m(z[ke]);const Te=new F(F.formatError(g.message||h,z),t,z.path,g.type||d,z.disableStackTrace);return Te.params=z,Te}const D=E?u:o;let x={path:n,parent:y,type:d,from:s.from,createError:_,resolve:m,options:s,originalValue:a,schema:i};const v=g=>{F.isError(g)?D(g):g?o(null):D(_())},A=g=>{F.isError(g)?D(g):u(g)};if(p&&R(t))return v(!0);let M;try{var Oe;if(M=l.call(x,t,x),typeof((Oe=M)==null?void 0:Oe.then)=="function"){if(s.sync)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`);return Promise.resolve(M).then(v,A)}}catch(g){A(g);return}v(M)}return e.OPTIONS=r,e}function He(r,e,t,n=t){let s,a,i;return e?(P.forEach(e,(u,o,d)=>{let l=o?u.slice(1,u.length-1):u;r=r.resolve({context:n,parent:s,value:t});let f=r.type==="tuple",h=d?parseInt(l,10):0;if(r.innerType||f){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]"`);if(t&&h>=t.length)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. `);s=t,t=t&&t[h],r=f?r.spec.types[h]:r.innerType}if(!d){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}")`);s=t,t=t&&t[l],r=r.fields[l]}a=l,i=o?"["+u+"]":"."+u}),{schema:r,parent:s,parentPath:a}):{parent:s,parentPath:e,schema:r}}class X extends Set{describe(){const e=[];for(const t of this.values())e.push(U.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const n of this.values())t.push(e(n));return t}clone(){return new X(this.values())}merge(e,t){const n=this.clone();return e.forEach(s=>n.add(s)),t.forEach(s=>n.delete(s)),n}}function V(r,e=new Map){if(se(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let t;if(r instanceof Date)t=new Date(r.getTime()),e.set(r,t);else if(r instanceof RegExp)t=new RegExp(r),e.set(r,t);else if(Array.isArray(r)){t=new Array(r.length),e.set(r,t);for(let n=0;n<r.length;n++)t[n]=V(r[n],e)}else if(r instanceof Map){t=new Map,e.set(r,t);for(const[n,s]of r.entries())t.set(n,V(s,e))}else if(r instanceof Set){t=new Set,e.set(r,t);for(const n of r)t.add(V(n,e))}else if(r instanceof Object){t={},e.set(r,t);for(const[n,s]of Object.entries(r))t[n]=V(s,e)}else throw Error(`Unable to clone ${r}`);return t}class T{constructor(e){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 X,this._blacklist=new X,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(O.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));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=V(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const s=Object.assign({},t.spec,n.spec);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=>{e.tests.forEach(i=>{a.test(i.OPTIONS)})}),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce((s,a)=>a.resolve(s,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,n,s,a;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(n=e.abortEarly)!=null?n:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(a=e.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(e,t={}){let n=this.resolve(Object.assign({value:e},t)),s=t.assert==="ignore-optionality",a=n._cast(e,t);if(t.assert!==!1&&!n.isType(a)){if(s&&R(a))return a;let i=I(e),u=I(a);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
|
|
2
2
|
|
|
3
3
|
attempted value: ${i}
|
|
4
|
-
`+(u!==i?`result of cast: ${u}`:""))}return a}_cast(e,t){let n=e===void 0?e:this.transforms.reduce((s,a)=>a.call(this,s,e,this),e);return n===void 0&&(n=this.getDefault(t)),n}_validate(e,t={},n,s){let{path:a,originalValue:i=e,strict:u=this.spec.strict}=t,o=e;u||(o=this._cast(o,Object.assign({assert:!1},t)));let d=[];for(let l of Object.values(this.internalTests))l&&d.push(l);this.runTests({path:a,value:o,originalValue:i,options:t,tests:d},n,l=>{if(l.length)return s(l,o);this.runTests({path:a,value:o,originalValue:i,options:t,tests:this.tests},n,s)})}runTests(e,t,n){let s=!1,{tests:a,value:i,originalValue:u,path:o,options:d}=e,l=b=>{s||(s=!0,t(b,i))},f=b=>{s||(s=!0,n(b,i))},h=a.length,p=[];if(!h)return f([]);let y={value:i,originalValue:u,path:o,options:d,schema:this};for(let b=0;b<a.length;b++){const E=a[b];E(y,l,function(m){m&&(Array.isArray(m)?p.push(...m):p.push(m)),--h<=0&&f(p)})}}asNestedTest({key:e,index:t,parent:n,parentPath:s,originalParent:a,options:i}){const u=e??t;if(u==null)throw TypeError("Must include `key` or `index` for nested validations");const o=typeof u=="number";let d=n[u];const l=Object.assign({},i,{strict:!0,parent:n,value:d,originalValue:a[u],key:void 0,[o?"index":"key"]:u,path:o||u.includes(".")?`${s||""}[${o?u:`"${u}"`}]`:(s?`${s}.`:"")+e});return(f,h,p)=>this.resolve(l)._validate(d,l,h,p)}validate(e,t){var n;let s=this.resolve(Object.assign({},t,{value:e})),a=(n=t==null?void 0:t.disableStackTrace)!=null?n:s.spec.disableStackTrace;return new Promise((i,u)=>s._validate(e,t,(o,d)=>{F.isError(o)&&(o.value=d),u(o)},(o,d)=>{o.length?u(new F(o,d,void 0,void 0,a)):i(d)}))}validateSync(e,t){var n;let s=this.resolve(Object.assign({},t,{value:e})),a,i=(n=t==null?void 0:t.disableStackTrace)!=null?n:s.spec.disableStackTrace;return s._validate(e,Object.assign({},t,{sync:!0}),(u,o)=>{throw F.isError(u)&&(u.value=o),u},(u,o)=>{if(u.length)throw new F(u,e,void 0,void 0,i);a=o}),a}isValid(e,t){return this.validate(e,t).then(()=>!0,n=>{if(F.isError(n))return!1;throw n})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(n){if(F.isError(n))return!1;throw n}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):V(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const n=this.clone({nullable:e});return n.internalTests.nullable=L({message:t,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),n}optionality(e,t){const n=this.clone({optional:e});return n.internalTests.optionality=L({message:t,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(e=O.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=O.notNull){return this.nullability(!1,e)}required(e=O.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=O.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),s=L(t),a=t.exclusive||t.name&&n.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");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}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let n=this.clone(),s=me(e).map(a=>new U(a));return s.forEach(a=>{a.isSibling&&n.deps.push(a.key)}),n.conditions.push(typeof t=="function"?new G(s,t):G.fromOptions(s,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=L({message:e,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=O.oneOf){let n=this.clone();return e.forEach(s=>{n._whitelist.add(s),n._blacklist.delete(s)}),n.internalTests.whiteList=L({message:t,name:"oneOf",skipAbsent:!0,test(s){let a=this.schema._whitelist,i=a.resolveAll(this.resolve);return i.includes(s)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:i}})}}),n}notOneOf(e,t=O.notOneOf){let n=this.clone();return e.forEach(s=>{n._blacklist.add(s),n._whitelist.delete(s)}),n.internalTests.blacklist=L({message:t,name:"notOneOf",test(s){let a=this.schema._blacklist,i=a.resolveAll(this.resolve);return i.includes(s)?this.createError({params:{values:Array.from(a).join(", "),resolved:i}}):!0}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:n,meta:s,optional:a,nullable:i}=t.spec;return{meta:s,label:n,optional:a,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(o=>({name:o.OPTIONS.name,params:o.OPTIONS.params})).filter((o,d,l)=>l.findIndex(f=>f.name===o.name)===d)}}}T.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])T.prototype[`${r}At`]=function(e,t,n={}){const{parent:s,parentPath:a,schema:i}=He(this,e,t,n.context);return i[r](s&&s[a],Object.assign({},n,{parent:s,path:e}))};for(const r of["equals","is"])T.prototype[r]=T.prototype.oneOf;for(const r of["not","nope"])T.prototype[r]=T.prototype.notOneOf;const Ke=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Xe(r){const e=ie(r);if(!e)return Date.parse?Date.parse(r):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;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)}function ie(r){var e,t;const n=Ke.exec(r);return n?{year:C(n[1]),month:C(n[2],1)-1,day:C(n[3],1),hour:C(n[4]),minute:C(n[5]),second:C(n[6]),millisecond:n[7]?C(n[7].substring(0,3)):0,precision:(e=(t=n[7])==null?void 0:t.length)!=null?e:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:C(n[10]),minuteOffset:C(n[11])}:null}function C(r,e=0){return Number(r)||e}let Je=/^[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])?)*$/,We=/^((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,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,et="^\\d{4}-\\d{2}-\\d{2}",tt="\\d{2}:\\d{2}:\\d{2}",nt="(([+-]\\d{2}(:?\\d{2})?)|Z)",rt=new RegExp(`${et}T${tt}(\\.\\d+)?${nt}$`),st=r=>R(r)||r===r.trim(),it={}.toString();function j(){return new Ee}class Ee extends T{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,n)=>{if(!n.spec.coerce||n.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===it?e:s})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||O.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=S.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,t=S.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,t=S.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}matches(e,t){let n=!1,s,a;return t&&(typeof t=="object"?{excludeEmptyString:n=!1,message:s,name:a}=t:s=t),this.test({name:a||"matches",message:s||S.matches,params:{regex:e},skipAbsent:!0,test:i=>i===""&&n||i.search(e)!==-1})}email(e=S.email){return this.matches(Je,{name:"email",message:e,excludeEmptyString:!0})}url(e=S.url){return this.matches(We,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=S.uuid){return this.matches(Qe,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",n,s;return e&&(typeof e=="object"?{message:t="",allowOffset:n=!1,precision:s=void 0}=e:t=e),this.matches(rt,{name:"datetime",message:t||S.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||S.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:a=>{if(!a||n)return!0;const i=ie(a);return i?!!i.z:!1}}).test({name:"datetime_precision",message:t||S.datetime_precision,params:{precision:s},skipAbsent:!0,test:a=>{if(!a||s==null)return!0;const i=ie(a);return i?i.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=S.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:st})}lowercase(e=S.lowercase){return this.transform(t=>R(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>R(t)||t===t.toLowerCase()})}uppercase(e=S.uppercase){return this.transform(t=>R(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>R(t)||t===t.toUpperCase()})}}j.prototype=Ee.prototype;let at=new Date(""),ut=r=>Object.prototype.toString.call(r)==="[object Date]";class ae extends T{constructor(){super({type:"date",check(e){return ut(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,n)=>!n.spec.coerce||n.isType(e)||e===null?e:(e=Xe(e),isNaN(e)?ae.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let n;if(U.isRef(e))n=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=s}return n}min(e,t=re.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(n)}})}max(e,t=re.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(n)}})}}ae.INVALID_DATE=at;function ot(r,e=[]){let t=[],n=new Set,s=new Set(e.map(([i,u])=>`${i}-${u}`));function a(i,u){let o=P.split(i)[0];n.add(o),s.has(`${u}-${o}`)||t.push([u,o])}for(const i of Object.keys(r)){let u=r[i];n.add(i),U.isRef(u)&&u.isSibling?a(u.path,i):se(u)&&"deps"in u&&u.deps.forEach(o=>a(o,i))}return Ue.array(Array.from(n),t).reverse()}function we(r,e){let t=1/0;return r.some((n,s)=>{var a;if((a=e.path)!=null&&a.includes(n))return t=s,!0}),t}function ve(r){return(e,t)=>we(r,e)-we(r,t)}const lt=(r,e,t)=>{if(typeof r!="string")return r;let n=r;try{n=JSON.parse(r)}catch{}return t.isType(n)?n:r};function X(r){if("fields"in r){const e={};for(const[t,n]of Object.entries(r.fields))e[t]=X(n);return r.setFields(e)}if(r.type==="array"){const e=r.optional();return e.innerType&&(e.innerType=X(e.innerType)),e}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(X)}):"optional"in r?r.optional():r}const ct=(r,e)=>{const t=[...P.normalizePath(e)];if(t.length===1)return t[0]in r;let n=t.pop(),s=P.getter(P.join(t),!0)(r);return!!(s&&n in s)};let _e=r=>Object.prototype.toString.call(r)==="[object Object]";function Fe(r,e){let t=Object.keys(r.fields);return Object.keys(e).filter(n=>t.indexOf(n)===-1)}const ft=ve([]);function Se(r){return new $e(r)}class $e extends T{constructor(e){super({type:"object",check(t){return _e(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=ft,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var n;let s=super._cast(e,t);if(s===void 0)return this.getDefault(t);if(!this._typeCheck(s))return s;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,{parent:o,__validating:t.__validating||!1}),l=!1;for(const f of u){let h=a[f],p=f in s;if(h){let y,b=s[f];d.path=(t.path?`${t.path}.`:"")+f,h=h.resolve({value:b,context:t.context,parent:o});let E=h instanceof T?h.spec:void 0,c=E==null?void 0:E.strict;if(E!=null&&E.strip){l=l||f in s;continue}y=!t.__validating||!c?h.cast(s[f],d):s[f],y!==void 0&&(o[f]=y)}else p&&!i&&(o[f]=s[f]);(p!==f in o||o[f]!==s[f])&&(l=!0)}return l?o:s}_validate(e,t={},n,s){let{from:a=[],originalValue:i=e,recursive:u=this.spec.recursive}=t;t.from=[{schema:this,value:i},...a],t.__validating=!0,t.originalValue=i,super._validate(e,t,n,(o,d)=>{if(!u||!_e(d)){s(o,d);return}i=i||d;let l=[];for(let f of this._nodes){let h=this.fields[f];!h||U.isRef(h)||l.push(h.asNestedTest({options:t,key:f,parent:d,parentPath:t.path,originalParent:i}))}this.runTests({tests:l,value:d,originalValue:i,options:t},n,f=>{s(f.sort(this._sortErrors).concat(o),d)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[s,a]of Object.entries(this.fields)){const i=n[s];n[s]=i===void 0?a:i}return t.withMutation(s=>s.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{var s;const a=this.fields[n];let i=e;(s=i)!=null&&s.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[n]})),t[n]=a&&"getDefault"in a?a.getDefault(i):void 0}),t}setFields(e,t){let n=this.clone();return n.fields=e,n._nodes=ot(e,t),n._sortErrors=ve(Object.keys(e)),t&&(n._excludedEdges=t),n}shape(e,t=[]){return this.clone().withMutation(n=>{let s=n._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),s=[...n._excludedEdges,...t]),n.setFields(Object.assign(n.fields,e),s)})}partial(){const e={};for(const[t,n]of Object.entries(this.fields))e[t]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return X(this)}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.setFields(t,this._excludedEdges.filter(([n,s])=>e.includes(n)&&e.includes(s)))}omit(e){const t=[];for(const n of Object.keys(this.fields))e.includes(n)||t.push(n);return this.pick(t)}from(e,t,n){let s=P.getter(e,!0);return this.transform(a=>{if(!a)return a;let i=a;return ct(a,e)&&(i=Object.assign({},a),n||delete i[e],i[t]=s(a)),i})}json(){return this.transform(lt)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Y.exact,test(t){if(t==null)return!0;const n=Fe(this.schema,t);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Y.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(s){if(s==null)return!0;const a=Fe(this.schema,s);return!e||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=Y.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const n={};for(const s of Object.keys(t))n[e(s)]=t[s];return n})}camelCase(){return this.transformKeys(ne.camelCase)}snakeCase(){return this.transformKeys(ne.snakeCase)}constantCase(){return this.transformKeys(e=>ne.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(const[a,i]of Object.entries(t.fields)){var s;let u=e;(s=u)!=null&&s.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[a]})),n.fields[a]=i.describe(u)}return n}}Se.prototype=$e.prototype;const dt="#000639",ht='<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>';function pt(){if(document.head.querySelector(`#${J}`))return;const e=document.createElement("style");e.id=J,e.dataset.testid=J,document.head.appendChild(e),e.textContent=`
|
|
4
|
+
`+(u!==i?`result of cast: ${u}`:""))}return a}_cast(e,t){let n=e===void 0?e:this.transforms.reduce((s,a)=>a.call(this,s,e,this),e);return n===void 0&&(n=this.getDefault(t)),n}_validate(e,t={},n,s){let{path:a,originalValue:i=e,strict:u=this.spec.strict}=t,o=e;u||(o=this._cast(o,Object.assign({assert:!1},t)));let d=[];for(let l of Object.values(this.internalTests))l&&d.push(l);this.runTests({path:a,value:o,originalValue:i,options:t,tests:d},n,l=>{if(l.length)return s(l,o);this.runTests({path:a,value:o,originalValue:i,options:t,tests:this.tests},n,s)})}runTests(e,t,n){let s=!1,{tests:a,value:i,originalValue:u,path:o,options:d}=e,l=b=>{s||(s=!0,t(b,i))},f=b=>{s||(s=!0,n(b,i))},h=a.length,p=[];if(!h)return f([]);let y={value:i,originalValue:u,path:o,options:d,schema:this};for(let b=0;b<a.length;b++){const E=a[b];E(y,l,function(m){m&&(Array.isArray(m)?p.push(...m):p.push(m)),--h<=0&&f(p)})}}asNestedTest({key:e,index:t,parent:n,parentPath:s,originalParent:a,options:i}){const u=e??t;if(u==null)throw TypeError("Must include `key` or `index` for nested validations");const o=typeof u=="number";let d=n[u];const l=Object.assign({},i,{strict:!0,parent:n,value:d,originalValue:a[u],key:void 0,[o?"index":"key"]:u,path:o||u.includes(".")?`${s||""}[${o?u:`"${u}"`}]`:(s?`${s}.`:"")+e});return(f,h,p)=>this.resolve(l)._validate(d,l,h,p)}validate(e,t){var n;let s=this.resolve(Object.assign({},t,{value:e})),a=(n=t==null?void 0:t.disableStackTrace)!=null?n:s.spec.disableStackTrace;return new Promise((i,u)=>s._validate(e,t,(o,d)=>{F.isError(o)&&(o.value=d),u(o)},(o,d)=>{o.length?u(new F(o,d,void 0,void 0,a)):i(d)}))}validateSync(e,t){var n;let s=this.resolve(Object.assign({},t,{value:e})),a,i=(n=t==null?void 0:t.disableStackTrace)!=null?n:s.spec.disableStackTrace;return s._validate(e,Object.assign({},t,{sync:!0}),(u,o)=>{throw F.isError(u)&&(u.value=o),u},(u,o)=>{if(u.length)throw new F(u,e,void 0,void 0,i);a=o}),a}isValid(e,t){return this.validate(e,t).then(()=>!0,n=>{if(F.isError(n))return!1;throw n})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(n){if(F.isError(n))return!1;throw n}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):V(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const n=this.clone({nullable:e});return n.internalTests.nullable=L({message:t,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),n}optionality(e,t){const n=this.clone({optional:e});return n.internalTests.optionality=L({message:t,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(e=O.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=O.notNull){return this.nullability(!1,e)}required(e=O.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=O.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),s=L(t),a=t.exclusive||t.name&&n.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");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}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let n=this.clone(),s=me(e).map(a=>new U(a));return s.forEach(a=>{a.isSibling&&n.deps.push(a.key)}),n.conditions.push(typeof t=="function"?new H(s,t):H.fromOptions(s,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=L({message:e,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=O.oneOf){let n=this.clone();return e.forEach(s=>{n._whitelist.add(s),n._blacklist.delete(s)}),n.internalTests.whiteList=L({message:t,name:"oneOf",skipAbsent:!0,test(s){let a=this.schema._whitelist,i=a.resolveAll(this.resolve);return i.includes(s)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:i}})}}),n}notOneOf(e,t=O.notOneOf){let n=this.clone();return e.forEach(s=>{n._blacklist.add(s),n._whitelist.delete(s)}),n.internalTests.blacklist=L({message:t,name:"notOneOf",test(s){let a=this.schema._blacklist,i=a.resolveAll(this.resolve);return i.includes(s)?this.createError({params:{values:Array.from(a).join(", "),resolved:i}}):!0}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:n,meta:s,optional:a,nullable:i}=t.spec;return{meta:s,label:n,optional:a,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(o=>({name:o.OPTIONS.name,params:o.OPTIONS.params})).filter((o,d,l)=>l.findIndex(f=>f.name===o.name)===d)}}}T.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])T.prototype[`${r}At`]=function(e,t,n={}){const{parent:s,parentPath:a,schema:i}=He(this,e,t,n.context);return i[r](s&&s[a],Object.assign({},n,{parent:s,path:e}))};for(const r of["equals","is"])T.prototype[r]=T.prototype.oneOf;for(const r of["not","nope"])T.prototype[r]=T.prototype.notOneOf;const Ke=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Xe(r){const e=ie(r);if(!e)return Date.parse?Date.parse(r):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;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)}function ie(r){var e,t;const n=Ke.exec(r);return n?{year:C(n[1]),month:C(n[2],1)-1,day:C(n[3],1),hour:C(n[4]),minute:C(n[5]),second:C(n[6]),millisecond:n[7]?C(n[7].substring(0,3)):0,precision:(e=(t=n[7])==null?void 0:t.length)!=null?e:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:C(n[10]),minuteOffset:C(n[11])}:null}function C(r,e=0){return Number(r)||e}let Je=/^[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])?)*$/,We=/^((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,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,et="^\\d{4}-\\d{2}-\\d{2}",tt="\\d{2}:\\d{2}:\\d{2}",nt="(([+-]\\d{2}(:?\\d{2})?)|Z)",rt=new RegExp(`${et}T${tt}(\\.\\d+)?${nt}$`),st=r=>R(r)||r===r.trim(),it={}.toString();function j(){return new Ee}class Ee extends T{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,n)=>{if(!n.spec.coerce||n.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===it?e:s})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||O.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=S.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,t=S.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,t=S.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}matches(e,t){let n=!1,s,a;return t&&(typeof t=="object"?{excludeEmptyString:n=!1,message:s,name:a}=t:s=t),this.test({name:a||"matches",message:s||S.matches,params:{regex:e},skipAbsent:!0,test:i=>i===""&&n||i.search(e)!==-1})}email(e=S.email){return this.matches(Je,{name:"email",message:e,excludeEmptyString:!0})}url(e=S.url){return this.matches(We,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=S.uuid){return this.matches(Qe,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",n,s;return e&&(typeof e=="object"?{message:t="",allowOffset:n=!1,precision:s=void 0}=e:t=e),this.matches(rt,{name:"datetime",message:t||S.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||S.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:a=>{if(!a||n)return!0;const i=ie(a);return i?!!i.z:!1}}).test({name:"datetime_precision",message:t||S.datetime_precision,params:{precision:s},skipAbsent:!0,test:a=>{if(!a||s==null)return!0;const i=ie(a);return i?i.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=S.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:st})}lowercase(e=S.lowercase){return this.transform(t=>R(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>R(t)||t===t.toLowerCase()})}uppercase(e=S.uppercase){return this.transform(t=>R(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>R(t)||t===t.toUpperCase()})}}j.prototype=Ee.prototype;let at=new Date(""),ut=r=>Object.prototype.toString.call(r)==="[object Date]";class ae extends T{constructor(){super({type:"date",check(e){return ut(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,n)=>!n.spec.coerce||n.isType(e)||e===null?e:(e=Xe(e),isNaN(e)?ae.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let n;if(U.isRef(e))n=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=s}return n}min(e,t=re.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(n)}})}max(e,t=re.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(n)}})}}ae.INVALID_DATE=at;function ot(r,e=[]){let t=[],n=new Set,s=new Set(e.map(([i,u])=>`${i}-${u}`));function a(i,u){let o=P.split(i)[0];n.add(o),s.has(`${u}-${o}`)||t.push([u,o])}for(const i of Object.keys(r)){let u=r[i];n.add(i),U.isRef(u)&&u.isSibling?a(u.path,i):se(u)&&"deps"in u&&u.deps.forEach(o=>a(o,i))}return Ue.array(Array.from(n),t).reverse()}function we(r,e){let t=1/0;return r.some((n,s)=>{var a;if((a=e.path)!=null&&a.includes(n))return t=s,!0}),t}function ve(r){return(e,t)=>we(r,e)-we(r,t)}const lt=(r,e,t)=>{if(typeof r!="string")return r;let n=r;try{n=JSON.parse(r)}catch{}return t.isType(n)?n:r};function J(r){if("fields"in r){const e={};for(const[t,n]of Object.entries(r.fields))e[t]=J(n);return r.setFields(e)}if(r.type==="array"){const e=r.optional();return e.innerType&&(e.innerType=J(e.innerType)),e}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(J)}):"optional"in r?r.optional():r}const ct=(r,e)=>{const t=[...P.normalizePath(e)];if(t.length===1)return t[0]in r;let n=t.pop(),s=P.getter(P.join(t),!0)(r);return!!(s&&n in s)};let _e=r=>Object.prototype.toString.call(r)==="[object Object]";function Fe(r,e){let t=Object.keys(r.fields);return Object.keys(e).filter(n=>t.indexOf(n)===-1)}const ft=ve([]);function Se(r){return new $e(r)}class $e extends T{constructor(e){super({type:"object",check(t){return _e(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=ft,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var n;let s=super._cast(e,t);if(s===void 0)return this.getDefault(t);if(!this._typeCheck(s))return s;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,{parent:o,__validating:t.__validating||!1}),l=!1;for(const f of u){let h=a[f],p=f in s;if(h){let y,b=s[f];d.path=(t.path?`${t.path}.`:"")+f,h=h.resolve({value:b,context:t.context,parent:o});let E=h instanceof T?h.spec:void 0,c=E==null?void 0:E.strict;if(E!=null&&E.strip){l=l||f in s;continue}y=!t.__validating||!c?h.cast(s[f],d):s[f],y!==void 0&&(o[f]=y)}else p&&!i&&(o[f]=s[f]);(p!==f in o||o[f]!==s[f])&&(l=!0)}return l?o:s}_validate(e,t={},n,s){let{from:a=[],originalValue:i=e,recursive:u=this.spec.recursive}=t;t.from=[{schema:this,value:i},...a],t.__validating=!0,t.originalValue=i,super._validate(e,t,n,(o,d)=>{if(!u||!_e(d)){s(o,d);return}i=i||d;let l=[];for(let f of this._nodes){let h=this.fields[f];!h||U.isRef(h)||l.push(h.asNestedTest({options:t,key:f,parent:d,parentPath:t.path,originalParent:i}))}this.runTests({tests:l,value:d,originalValue:i,options:t},n,f=>{s(f.sort(this._sortErrors).concat(o),d)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[s,a]of Object.entries(this.fields)){const i=n[s];n[s]=i===void 0?a:i}return t.withMutation(s=>s.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{var s;const a=this.fields[n];let i=e;(s=i)!=null&&s.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[n]})),t[n]=a&&"getDefault"in a?a.getDefault(i):void 0}),t}setFields(e,t){let n=this.clone();return n.fields=e,n._nodes=ot(e,t),n._sortErrors=ve(Object.keys(e)),t&&(n._excludedEdges=t),n}shape(e,t=[]){return this.clone().withMutation(n=>{let s=n._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),s=[...n._excludedEdges,...t]),n.setFields(Object.assign(n.fields,e),s)})}partial(){const e={};for(const[t,n]of Object.entries(this.fields))e[t]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return J(this)}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.setFields(t,this._excludedEdges.filter(([n,s])=>e.includes(n)&&e.includes(s)))}omit(e){const t=[];for(const n of Object.keys(this.fields))e.includes(n)||t.push(n);return this.pick(t)}from(e,t,n){let s=P.getter(e,!0);return this.transform(a=>{if(!a)return a;let i=a;return ct(a,e)&&(i=Object.assign({},a),n||delete i[e],i[t]=s(a)),i})}json(){return this.transform(lt)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||G.exact,test(t){if(t==null)return!0;const n=Fe(this.schema,t);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=G.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(s){if(s==null)return!0;const a=Fe(this.schema,s);return!e||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=G.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const n={};for(const s of Object.keys(t))n[e(s)]=t[s];return n})}camelCase(){return this.transformKeys(ne.camelCase)}snakeCase(){return this.transformKeys(ne.snakeCase)}constantCase(){return this.transformKeys(e=>ne.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(const[a,i]of Object.entries(t.fields)){var s;let u=e;(s=u)!=null&&s.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[a]})),n.fields[a]=i.describe(u)}return n}}Se.prototype=$e.prototype;const dt="#000639",ht='<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>';function pt(){if(document.head.querySelector(`#${W}`))return;const e=document.createElement("style");e.id=W,e.dataset.testid=W,document.head.appendChild(e),e.textContent=`
|
|
5
5
|
|
|
6
6
|
#${w}, #${w} * {
|
|
7
7
|
margin: 0;
|
|
@@ -32,4 +32,4 @@ attempted value: ${i}
|
|
|
32
32
|
border-radius: 24px;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
`}function mt(r){Se({fiatAmount:j().optional(),fiatCurrency:j().optional(),cryptoAmount:j().optional(),cryptoCurrency:j().optional(),publicKey:j().optional(),redirectUrl:j().optional(),side:j().oneOf(["buy","sell"]).required()}).validateSync(r,{abortEarly:!1})}function yt(){const r=document.createElement("div");return r.id=w,r.dataset.testid=w,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}function bt(){const r=document.createElement("button");return r.id=
|
|
35
|
+
`}function mt(r){Se({fiatAmount:j().optional(),fiatCurrency:j().optional(),cryptoAmount:j().optional(),cryptoCurrency:j().optional(),publicKey:j().optional(),redirectUrl:j().optional(),side:j().oneOf(["buy","sell"]).required()}).validateSync(r,{abortEarly:!1})}function yt(){const r=document.createElement("div");return r.id=w,r.dataset.testid=w,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}function bt(){const r=document.createElement("button");return r.id=B,r.dataset.testid=B,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=ht,r}function xt(){const r=document.createElement("div");return r.id=k,r.dataset.testid=k,r.style.width="40px",r.style.height="40px",r.style.backgroundColor="transparent",r.style.border=`2px solid ${dt}`,r.style.borderLeftColor="transparent",r.style.borderBottomColor="transparent",r.style.borderRadius="100%",r.animate&&r.animate([{transform:"rotate(0)"},{transform:"rotate(360deg)"}],{duration:300,iterations:1/0}),r}function gt(){const r=document.createElement("iframe");return r.dataset.testid=q,r.name=q,r.id=q,r.allow=`clipboard-write self ${Q}`,r}function Et({sandboxMode:r,...e}){const t=r??!1,n=t?oe:Q,s=t?le:ue,a=e.side==="buy"?n:s,i=document.createElement("form");i.target=q,i.dataset.testid=Ce,i.action=a??"",i.method="GET",i.style.display="none",(f=>{const h=process.env.NODE_ENV==="production",p=["onSuccess","onClose"];h&&p.push("side");for(const y in f){if(!Object.prototype.hasOwnProperty.call(f,y)||p.includes(y))continue;const b=f[y],E=document.createElement("input");E.name=y,E.value=String(b),i.appendChild(E)}})(e);const o="POPUP",d=document.createElement("input");d.name="displayMode",d.value=o;const l=document.createElement("input");return l.name="parentOrigin",l.value=window.location.origin,i.appendChild(d),i.appendChild(l),i}class wt{constructor(e){Z(this,"payload");Z(this,"container",null);Z(this,"boundClose");Z(this,"onMessage",e=>{const t=process.env.NODE_ENV==="test",n=this.payload.sandboxMode??!1,s=n?oe:Q,a=n?le:ue,i=this.payload.side==="buy"?s:a;if(t){if(e.source!==window)return}else{if(!i)return;const u=new URL(i);if(e.origin!==u.origin)return}if(this.payload){if(e.data.status===De){const u=document.getElementById(k),o=document.getElementById(B);u&&u.remove(),o&&o.remove()}e.data.status===ce&&(this.payload.onClose&&this.payload.onClose(e.data),this.cleanup()),e.data.status===Ae&&(this.payload.onSuccess&&this.payload.onSuccess(e.data),this.cleanup())}});pt(),mt(e),this.payload=e,this.boundClose=this.close.bind(this)}show(){this.container=yt();const e=xt(),t=bt();t.addEventListener("click",this.boundClose),this.container.appendChild(e),this.container.appendChild(t);const n=gt();this.container.appendChild(n),document.body.appendChild(this.container);const s=Et(this.payload);this.container.appendChild(s),s.submit(),window.addEventListener("message",this.onMessage)}close(){this.payload.onClose&&this.payload.onClose({status:ce,data:{reference:""}}),this.cleanup()}cleanup(){const e=document.getElementById(w),t=document.getElementById(B);t&&t.removeEventListener("click",this.boundClose),window.removeEventListener("message",this.onMessage),e&&document.body.removeChild(e)}}$.BushaRampWidget=wt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED