@chainrails/react 0.0.36 → 0.0.38
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/chainrails-sdk.es.js +1270 -610
- package/dist/chainrails-sdk.es.mjs +1270 -610
- package/dist/chainrails-sdk.umd.js +3 -2
- package/dist/hooks/usePaymentSession.d.ts +1 -1
- package/dist/hooks/usePaymentSession.d.ts.map +1 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import './index.css';class
|
|
1
|
+
import { useState as Fe, useRef as he, useEffect as de, useMemo as ve, useSyncExternalStore as Ot, useCallback as Dt, useLayoutEffect as Nt, useDebugValue as Mt } from "react";
|
|
2
|
+
import { jsx as U, Fragment as Bt, jsxs as Pe } from "react/jsx-runtime";
|
|
3
|
+
import './index.css';class X extends Error {
|
|
4
4
|
response;
|
|
5
5
|
request;
|
|
6
6
|
options;
|
|
7
|
-
constructor(
|
|
8
|
-
const
|
|
9
|
-
super(`Request failed with ${a}: ${s.method} ${s.url}`), this.name = "HTTPError", this.response =
|
|
7
|
+
constructor(t, s, n) {
|
|
8
|
+
const r = t.status || t.status === 0 ? t.status : "", i = t.statusText ?? "", o = `${r} ${i}`.trim(), a = o ? `status code ${o}` : "an unknown error";
|
|
9
|
+
super(`Request failed with ${a}: ${s.method} ${s.url}`), this.name = "HTTPError", this.response = t, this.request = s, this.options = n;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class He extends Error {
|
|
13
13
|
name = "NonError";
|
|
14
14
|
value;
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(t) {
|
|
16
16
|
let s = "Non-error value was thrown";
|
|
17
17
|
try {
|
|
18
|
-
typeof
|
|
18
|
+
typeof t == "string" ? s = t : t && typeof t == "object" && "message" in t && typeof t.message == "string" && (s = t.message);
|
|
19
19
|
} catch {
|
|
20
20
|
}
|
|
21
|
-
super(s), this.value =
|
|
21
|
+
super(s), this.value = t;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class F extends Error {
|
|
25
25
|
name = "ForceRetryError";
|
|
26
26
|
customDelay;
|
|
27
27
|
code;
|
|
28
28
|
customRequest;
|
|
29
|
-
constructor(
|
|
30
|
-
const s =
|
|
31
|
-
super(
|
|
29
|
+
constructor(t) {
|
|
30
|
+
const s = t?.cause ? t.cause instanceof Error ? t.cause : new He(t.cause) : void 0;
|
|
31
|
+
super(t?.code ? `Forced retry: ${t.code}` : "Forced retry", s ? { cause: s } : void 0), this.customDelay = t?.delay, this.code = t?.code, this.customRequest = t?.request;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
let
|
|
36
|
-
const s = typeof globalThis.ReadableStream == "function",
|
|
37
|
-
if (s &&
|
|
34
|
+
const Ue = (() => {
|
|
35
|
+
let e = !1, t = !1;
|
|
36
|
+
const s = typeof globalThis.ReadableStream == "function", n = typeof globalThis.Request == "function";
|
|
37
|
+
if (s && n)
|
|
38
38
|
try {
|
|
39
|
-
|
|
39
|
+
t = new globalThis.Request("https://empty.invalid", {
|
|
40
40
|
body: new globalThis.ReadableStream(),
|
|
41
41
|
method: "POST",
|
|
42
42
|
// @ts-expect-error - Types are outdated.
|
|
43
43
|
get duplex() {
|
|
44
|
-
return
|
|
44
|
+
return e = !0, "half";
|
|
45
45
|
}
|
|
46
46
|
}).headers.has("Content-Type");
|
|
47
|
-
} catch (
|
|
48
|
-
if (
|
|
47
|
+
} catch (r) {
|
|
48
|
+
if (r instanceof Error && r.message === "unsupported BodyInit type")
|
|
49
49
|
return !1;
|
|
50
|
-
throw
|
|
50
|
+
throw r;
|
|
51
51
|
}
|
|
52
|
-
return
|
|
53
|
-
})(),
|
|
52
|
+
return e && !t;
|
|
53
|
+
})(), $t = typeof globalThis.AbortController == "function", Ke = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", _t = typeof globalThis.ReadableStream == "function", Lt = typeof globalThis.FormData == "function", We = ["get", "post", "put", "patch", "head", "delete"], zt = {
|
|
54
54
|
json: "application/json",
|
|
55
55
|
text: "text/*",
|
|
56
56
|
formData: "multipart/form-data",
|
|
@@ -59,14 +59,14 @@ const re = (() => {
|
|
|
59
59
|
// Supported in modern Fetch implementations (for example, browsers and recent Node.js/undici).
|
|
60
60
|
// We still feature-check at runtime before exposing the shortcut.
|
|
61
61
|
bytes: "*/*"
|
|
62
|
-
},
|
|
63
|
-
class
|
|
62
|
+
}, H = 2147483647, jt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, Ve = Symbol("stop");
|
|
63
|
+
class Ye {
|
|
64
64
|
options;
|
|
65
|
-
constructor(
|
|
66
|
-
this.options =
|
|
65
|
+
constructor(t) {
|
|
66
|
+
this.options = t;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const qt = (e) => new Ye(e), Ft = {
|
|
70
70
|
json: !0,
|
|
71
71
|
parseJson: !0,
|
|
72
72
|
stringifyJson: !0,
|
|
@@ -80,10 +80,10 @@ const Ie = (t) => new ye(t), Be = {
|
|
|
80
80
|
onUploadProgress: !0,
|
|
81
81
|
fetch: !0,
|
|
82
82
|
context: !0
|
|
83
|
-
},
|
|
83
|
+
}, Ht = {
|
|
84
84
|
next: !0
|
|
85
85
|
// Next.js cache revalidation (revalidate, tags)
|
|
86
|
-
},
|
|
86
|
+
}, Kt = {
|
|
87
87
|
method: !0,
|
|
88
88
|
headers: !0,
|
|
89
89
|
body: !0,
|
|
@@ -98,243 +98,243 @@ const Ie = (t) => new ye(t), Be = {
|
|
|
98
98
|
signal: !0,
|
|
99
99
|
window: !0,
|
|
100
100
|
duplex: !0
|
|
101
|
-
},
|
|
102
|
-
if (!
|
|
101
|
+
}, Wt = (e) => {
|
|
102
|
+
if (!e)
|
|
103
103
|
return 0;
|
|
104
|
-
if (
|
|
105
|
-
let
|
|
106
|
-
for (const [s,
|
|
107
|
-
|
|
108
|
-
return
|
|
104
|
+
if (e instanceof FormData) {
|
|
105
|
+
let t = 0;
|
|
106
|
+
for (const [s, n] of e)
|
|
107
|
+
t += jt, t += new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length, t += typeof n == "string" ? new TextEncoder().encode(n).length : n.size;
|
|
108
|
+
return t;
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
111
|
-
return
|
|
112
|
-
if (
|
|
113
|
-
return
|
|
114
|
-
if (typeof
|
|
115
|
-
return new TextEncoder().encode(
|
|
116
|
-
if (
|
|
117
|
-
return new TextEncoder().encode(
|
|
118
|
-
if ("byteLength" in
|
|
119
|
-
return
|
|
120
|
-
if (typeof
|
|
110
|
+
if (e instanceof Blob)
|
|
111
|
+
return e.size;
|
|
112
|
+
if (e instanceof ArrayBuffer)
|
|
113
|
+
return e.byteLength;
|
|
114
|
+
if (typeof e == "string")
|
|
115
|
+
return new TextEncoder().encode(e).length;
|
|
116
|
+
if (e instanceof URLSearchParams)
|
|
117
|
+
return new TextEncoder().encode(e.toString()).length;
|
|
118
|
+
if ("byteLength" in e)
|
|
119
|
+
return e.byteLength;
|
|
120
|
+
if (typeof e == "object" && e !== null)
|
|
121
121
|
try {
|
|
122
|
-
const
|
|
123
|
-
return new TextEncoder().encode(
|
|
122
|
+
const t = JSON.stringify(e);
|
|
123
|
+
return new TextEncoder().encode(t).length;
|
|
124
124
|
} catch {
|
|
125
125
|
return 0;
|
|
126
126
|
}
|
|
127
127
|
return 0;
|
|
128
|
-
},
|
|
129
|
-
let
|
|
130
|
-
return
|
|
128
|
+
}, Xe = (e, t, s) => {
|
|
129
|
+
let n, r = 0;
|
|
130
|
+
return e.pipeThrough(new TransformStream({
|
|
131
131
|
transform(i, o) {
|
|
132
|
-
if (o.enqueue(i),
|
|
133
|
-
|
|
134
|
-
let a =
|
|
135
|
-
a >= 1 && (a = 1 - Number.EPSILON), s?.({ percent: a, totalBytes: Math.max(
|
|
132
|
+
if (o.enqueue(i), n) {
|
|
133
|
+
r += n.byteLength;
|
|
134
|
+
let a = t === 0 ? 0 : r / t;
|
|
135
|
+
a >= 1 && (a = 1 - Number.EPSILON), s?.({ percent: a, totalBytes: Math.max(t, r), transferredBytes: r }, n);
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
n = i;
|
|
138
138
|
},
|
|
139
139
|
flush() {
|
|
140
|
-
|
|
140
|
+
n && (r += n.byteLength, s?.({ percent: 1, totalBytes: Math.max(t, r), transferredBytes: r }, n));
|
|
141
141
|
}
|
|
142
142
|
}));
|
|
143
|
-
},
|
|
144
|
-
if (!
|
|
145
|
-
return
|
|
146
|
-
if (
|
|
143
|
+
}, Vt = (e, t) => {
|
|
144
|
+
if (!e.body)
|
|
145
|
+
return e;
|
|
146
|
+
if (e.status === 204)
|
|
147
147
|
return new Response(null, {
|
|
148
|
-
status:
|
|
149
|
-
statusText:
|
|
150
|
-
headers:
|
|
148
|
+
status: e.status,
|
|
149
|
+
statusText: e.statusText,
|
|
150
|
+
headers: e.headers
|
|
151
151
|
});
|
|
152
|
-
const s = Math.max(0, Number(
|
|
153
|
-
return new Response(
|
|
154
|
-
status:
|
|
155
|
-
statusText:
|
|
156
|
-
headers:
|
|
152
|
+
const s = Math.max(0, Number(e.headers.get("content-length")) || 0);
|
|
153
|
+
return new Response(Xe(e.body, s, t), {
|
|
154
|
+
status: e.status,
|
|
155
|
+
statusText: e.statusText,
|
|
156
|
+
headers: e.headers
|
|
157
157
|
});
|
|
158
|
-
},
|
|
159
|
-
if (!
|
|
160
|
-
return
|
|
161
|
-
const
|
|
162
|
-
return new Request(
|
|
158
|
+
}, Yt = (e, t, s) => {
|
|
159
|
+
if (!e.body)
|
|
160
|
+
return e;
|
|
161
|
+
const n = Wt(s ?? e.body);
|
|
162
|
+
return new Request(e, {
|
|
163
163
|
// @ts-expect-error - Types are outdated.
|
|
164
164
|
duplex: "half",
|
|
165
|
-
body:
|
|
165
|
+
body: Xe(e.body, n, t)
|
|
166
166
|
});
|
|
167
|
-
},
|
|
168
|
-
for (const
|
|
169
|
-
if ((!
|
|
167
|
+
}, v = (e) => e !== null && typeof e == "object", N = (...e) => {
|
|
168
|
+
for (const t of e)
|
|
169
|
+
if ((!v(t) || Array.isArray(t)) && t !== void 0)
|
|
170
170
|
throw new TypeError("The `options` argument must be an object");
|
|
171
|
-
return
|
|
172
|
-
},
|
|
173
|
-
const s = new globalThis.Headers(
|
|
174
|
-
for (const [i, o] of
|
|
175
|
-
|
|
171
|
+
return pe({}, ...e);
|
|
172
|
+
}, Je = (e = {}, t = {}) => {
|
|
173
|
+
const s = new globalThis.Headers(e), n = t instanceof globalThis.Headers, r = new globalThis.Headers(t);
|
|
174
|
+
for (const [i, o] of r.entries())
|
|
175
|
+
n && o === "undefined" || o === void 0 ? s.delete(i) : s.set(i, o);
|
|
176
176
|
return s;
|
|
177
177
|
};
|
|
178
|
-
function
|
|
179
|
-
return Object.hasOwn(
|
|
180
|
-
}
|
|
181
|
-
const
|
|
182
|
-
beforeRequest:
|
|
183
|
-
beforeRetry:
|
|
184
|
-
afterResponse:
|
|
185
|
-
beforeError:
|
|
186
|
-
}),
|
|
178
|
+
function M(e, t, s) {
|
|
179
|
+
return Object.hasOwn(t, s) && t[s] === void 0 ? [] : pe(e[s] ?? [], t[s] ?? []);
|
|
180
|
+
}
|
|
181
|
+
const Ge = (e = {}, t = {}) => ({
|
|
182
|
+
beforeRequest: M(e, t, "beforeRequest"),
|
|
183
|
+
beforeRetry: M(e, t, "beforeRetry"),
|
|
184
|
+
afterResponse: M(e, t, "afterResponse"),
|
|
185
|
+
beforeError: M(e, t, "beforeError")
|
|
186
|
+
}), Xt = (e, t) => {
|
|
187
187
|
const s = new URLSearchParams();
|
|
188
|
-
for (const
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
for (const [
|
|
192
|
-
s.append(
|
|
193
|
-
else if (Array.isArray(
|
|
194
|
-
for (const
|
|
195
|
-
if (!Array.isArray(
|
|
188
|
+
for (const n of [e, t])
|
|
189
|
+
if (n !== void 0)
|
|
190
|
+
if (n instanceof URLSearchParams)
|
|
191
|
+
for (const [r, i] of n.entries())
|
|
192
|
+
s.append(r, i);
|
|
193
|
+
else if (Array.isArray(n))
|
|
194
|
+
for (const r of n) {
|
|
195
|
+
if (!Array.isArray(r) || r.length !== 2)
|
|
196
196
|
throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");
|
|
197
|
-
s.append(String(
|
|
197
|
+
s.append(String(r[0]), String(r[1]));
|
|
198
198
|
}
|
|
199
|
-
else if (
|
|
200
|
-
for (const [
|
|
201
|
-
i !== void 0 && s.append(
|
|
199
|
+
else if (v(n))
|
|
200
|
+
for (const [r, i] of Object.entries(n))
|
|
201
|
+
i !== void 0 && s.append(r, String(i));
|
|
202
202
|
else {
|
|
203
|
-
const
|
|
204
|
-
for (const [i, o] of
|
|
203
|
+
const r = new URLSearchParams(n);
|
|
204
|
+
for (const [i, o] of r.entries())
|
|
205
205
|
s.append(i, o);
|
|
206
206
|
}
|
|
207
207
|
return s;
|
|
208
|
-
},
|
|
209
|
-
let
|
|
208
|
+
}, pe = (...e) => {
|
|
209
|
+
let t = {}, s = {}, n = {}, r;
|
|
210
210
|
const i = [];
|
|
211
|
-
for (const o of
|
|
211
|
+
for (const o of e)
|
|
212
212
|
if (Array.isArray(o))
|
|
213
|
-
Array.isArray(
|
|
214
|
-
else if (
|
|
213
|
+
Array.isArray(t) || (t = []), t = [...t, ...o];
|
|
214
|
+
else if (v(o)) {
|
|
215
215
|
for (let [a, c] of Object.entries(o)) {
|
|
216
216
|
if (a === "signal" && c instanceof globalThis.AbortSignal) {
|
|
217
217
|
i.push(c);
|
|
218
218
|
continue;
|
|
219
219
|
}
|
|
220
220
|
if (a === "context") {
|
|
221
|
-
if (c != null && (!
|
|
221
|
+
if (c != null && (!v(c) || Array.isArray(c)))
|
|
222
222
|
throw new TypeError("The `context` option must be an object");
|
|
223
|
-
|
|
224
|
-
...
|
|
225
|
-
context: c == null ? {} : { ...
|
|
223
|
+
t = {
|
|
224
|
+
...t,
|
|
225
|
+
context: c == null ? {} : { ...t.context, ...c }
|
|
226
226
|
};
|
|
227
227
|
continue;
|
|
228
228
|
}
|
|
229
229
|
if (a === "searchParams") {
|
|
230
|
-
c == null ?
|
|
230
|
+
c == null ? r = void 0 : r = r === void 0 ? c : Xt(r, c);
|
|
231
231
|
continue;
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
v(c) && a in t && (c = pe(t[a], c)), t = { ...t, [a]: c };
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
v(o.hooks) && (n = Ge(n, o.hooks), t.hooks = n), v(o.headers) && (s = Je(s, o.headers), t.headers = s);
|
|
236
236
|
}
|
|
237
|
-
return
|
|
238
|
-
},
|
|
237
|
+
return r !== void 0 && (t.searchParams = r), i.length > 0 && (i.length === 1 ? t.signal = i[0] : Ke ? t.signal = AbortSignal.any(i) : t.signal = i.at(-1)), t.context === void 0 && (t.context = {}), t;
|
|
238
|
+
}, Jt = (e) => We.includes(e) ? e.toUpperCase() : e, Gt = ["get", "put", "head", "delete", "options", "trace"], Zt = [408, 413, 429, 500, 502, 503, 504], Qt = [413, 429, 503], Ce = {
|
|
239
239
|
limit: 2,
|
|
240
|
-
methods:
|
|
241
|
-
statusCodes:
|
|
242
|
-
afterStatusCodes:
|
|
240
|
+
methods: Gt,
|
|
241
|
+
statusCodes: Zt,
|
|
242
|
+
afterStatusCodes: Qt,
|
|
243
243
|
maxRetryAfter: Number.POSITIVE_INFINITY,
|
|
244
244
|
backoffLimit: Number.POSITIVE_INFINITY,
|
|
245
|
-
delay: (
|
|
245
|
+
delay: (e) => 0.3 * 2 ** (e - 1) * 1e3,
|
|
246
246
|
jitter: void 0,
|
|
247
247
|
retryOnTimeout: !1
|
|
248
|
-
},
|
|
249
|
-
if (typeof
|
|
248
|
+
}, es = (e = {}) => {
|
|
249
|
+
if (typeof e == "number")
|
|
250
250
|
return {
|
|
251
|
-
...
|
|
252
|
-
limit:
|
|
251
|
+
...Ce,
|
|
252
|
+
limit: e
|
|
253
253
|
};
|
|
254
|
-
if (
|
|
254
|
+
if (e.methods && !Array.isArray(e.methods))
|
|
255
255
|
throw new Error("retry.methods must be an array");
|
|
256
|
-
if (
|
|
256
|
+
if (e.statusCodes && !Array.isArray(e.statusCodes))
|
|
257
257
|
throw new Error("retry.statusCodes must be an array");
|
|
258
258
|
return {
|
|
259
|
-
...
|
|
260
|
-
...
|
|
259
|
+
...Ce,
|
|
260
|
+
...e
|
|
261
261
|
};
|
|
262
262
|
};
|
|
263
|
-
class
|
|
263
|
+
class J extends Error {
|
|
264
264
|
request;
|
|
265
|
-
constructor(
|
|
266
|
-
super(`Request timed out: ${
|
|
265
|
+
constructor(t) {
|
|
266
|
+
super(`Request timed out: ${t.method} ${t.url}`), this.name = "TimeoutError", this.request = t;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
270
|
-
return new Promise((
|
|
269
|
+
async function ts(e, t, s, n) {
|
|
270
|
+
return new Promise((r, i) => {
|
|
271
271
|
const o = setTimeout(() => {
|
|
272
|
-
s && s.abort(), i(new
|
|
273
|
-
},
|
|
274
|
-
|
|
272
|
+
s && s.abort(), i(new J(e));
|
|
273
|
+
}, n.timeout);
|
|
274
|
+
n.fetch(e, t).then(r).catch(i).then(() => {
|
|
275
275
|
clearTimeout(o);
|
|
276
276
|
});
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
async function
|
|
280
|
-
return new Promise((s,
|
|
281
|
-
|
|
282
|
-
function
|
|
283
|
-
clearTimeout(i),
|
|
279
|
+
async function ss(e, { signal: t }) {
|
|
280
|
+
return new Promise((s, n) => {
|
|
281
|
+
t && (t.throwIfAborted(), t.addEventListener("abort", r, { once: !0 }));
|
|
282
|
+
function r() {
|
|
283
|
+
clearTimeout(i), n(t.reason);
|
|
284
284
|
}
|
|
285
285
|
const i = setTimeout(() => {
|
|
286
|
-
|
|
287
|
-
},
|
|
286
|
+
t?.removeEventListener("abort", r), s();
|
|
287
|
+
}, e);
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
|
-
const
|
|
290
|
+
const ns = (e, t) => {
|
|
291
291
|
const s = {};
|
|
292
|
-
for (const
|
|
293
|
-
Object.hasOwn(
|
|
292
|
+
for (const n in t)
|
|
293
|
+
Object.hasOwn(t, n) && !(n in Kt) && !(n in Ft) && (!(n in e) || n in Ht) && (s[n] = t[n]);
|
|
294
294
|
return s;
|
|
295
|
-
},
|
|
296
|
-
function
|
|
297
|
-
return
|
|
295
|
+
}, rs = (e) => e === void 0 ? !1 : Array.isArray(e) ? e.length > 0 : e instanceof URLSearchParams ? e.size > 0 : typeof e == "object" ? Object.keys(e).length > 0 : typeof e == "string" ? e.trim().length > 0 : !!e;
|
|
296
|
+
function os(e) {
|
|
297
|
+
return e instanceof X || e?.name === X.name;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
return
|
|
299
|
+
function is(e) {
|
|
300
|
+
return e instanceof J || e?.name === J.name;
|
|
301
301
|
}
|
|
302
302
|
class O {
|
|
303
|
-
static create(
|
|
304
|
-
const
|
|
305
|
-
if (typeof
|
|
306
|
-
throw new RangeError(`The \`timeout\` option cannot be greater than ${
|
|
303
|
+
static create(t, s) {
|
|
304
|
+
const n = new O(t, s), r = async () => {
|
|
305
|
+
if (typeof n.#e.timeout == "number" && n.#e.timeout > H)
|
|
306
|
+
throw new RangeError(`The \`timeout\` option cannot be greater than ${H}`);
|
|
307
307
|
await Promise.resolve();
|
|
308
|
-
let o = await
|
|
309
|
-
for (const a of
|
|
310
|
-
const c =
|
|
311
|
-
if (u instanceof globalThis.Response && (o = u), u instanceof
|
|
308
|
+
let o = await n.#g();
|
|
309
|
+
for (const a of n.#e.hooks.afterResponse) {
|
|
310
|
+
const c = n.#l(o.clone()), u = await a(n.request, n.#a(), c, { retryCount: n.#s });
|
|
311
|
+
if (u instanceof globalThis.Response && (o = u), u instanceof Ye)
|
|
312
312
|
throw await Promise.all([
|
|
313
313
|
c.body?.cancel(),
|
|
314
314
|
o.body?.cancel()
|
|
315
|
-
]), new
|
|
315
|
+
]), new F(u.options);
|
|
316
316
|
}
|
|
317
|
-
if (
|
|
318
|
-
let a = new
|
|
319
|
-
for (const c of
|
|
320
|
-
a = await c(a, { retryCount:
|
|
317
|
+
if (n.#l(o), !o.ok && (typeof n.#e.throwHttpErrors == "function" ? n.#e.throwHttpErrors(o.status) : n.#e.throwHttpErrors)) {
|
|
318
|
+
let a = new X(o, n.request, n.#a());
|
|
319
|
+
for (const c of n.#e.hooks.beforeError)
|
|
320
|
+
a = await c(a, { retryCount: n.#s });
|
|
321
321
|
throw a;
|
|
322
322
|
}
|
|
323
|
-
if (
|
|
324
|
-
if (typeof
|
|
323
|
+
if (n.#e.onDownloadProgress) {
|
|
324
|
+
if (typeof n.#e.onDownloadProgress != "function")
|
|
325
325
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
326
|
-
if (!
|
|
326
|
+
if (!_t)
|
|
327
327
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
328
|
-
return
|
|
328
|
+
return Vt(o.clone(), n.#e.onDownloadProgress);
|
|
329
329
|
}
|
|
330
330
|
return o;
|
|
331
|
-
}, i =
|
|
332
|
-
const o =
|
|
333
|
-
o && !o.bodyUsed && a.push(o.body?.cancel()),
|
|
331
|
+
}, i = n.#f(r).finally(async () => {
|
|
332
|
+
const o = n.#o, a = [];
|
|
333
|
+
o && !o.bodyUsed && a.push(o.body?.cancel()), n.request.bodyUsed || a.push(n.request.body?.cancel()), await Promise.all(a);
|
|
334
334
|
});
|
|
335
|
-
for (const [o, a] of Object.entries(
|
|
335
|
+
for (const [o, a] of Object.entries(zt))
|
|
336
336
|
o === "bytes" && typeof globalThis.Response?.prototype?.bytes != "function" || (i[o] = async () => {
|
|
337
|
-
|
|
337
|
+
n.request.headers.set("accept", n.request.headers.get("accept") || a);
|
|
338
338
|
const c = await i;
|
|
339
339
|
if (o === "json") {
|
|
340
340
|
if (c.status === 204)
|
|
@@ -347,33 +347,33 @@ class O {
|
|
|
347
347
|
return i;
|
|
348
348
|
}
|
|
349
349
|
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
350
|
-
static #d(
|
|
351
|
-
return
|
|
350
|
+
static #d(t) {
|
|
351
|
+
return t && typeof t == "object" && !Array.isArray(t) && !(t instanceof URLSearchParams) ? Object.fromEntries(Object.entries(t).filter(([, s]) => s !== void 0)) : t;
|
|
352
352
|
}
|
|
353
353
|
request;
|
|
354
|
-
#
|
|
354
|
+
#n;
|
|
355
355
|
#s = 0;
|
|
356
356
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly -- False positive: #input is reassigned on line 202
|
|
357
357
|
#t;
|
|
358
358
|
#e;
|
|
359
359
|
#o;
|
|
360
|
-
#
|
|
360
|
+
#r;
|
|
361
361
|
#i;
|
|
362
362
|
// eslint-disable-next-line complexity
|
|
363
|
-
constructor(
|
|
364
|
-
if (this.#t =
|
|
363
|
+
constructor(t, s = {}) {
|
|
364
|
+
if (this.#t = t, this.#e = {
|
|
365
365
|
...s,
|
|
366
|
-
headers:
|
|
367
|
-
hooks:
|
|
366
|
+
headers: Je(this.#t.headers, s.headers),
|
|
367
|
+
hooks: Ge({
|
|
368
368
|
beforeRequest: [],
|
|
369
369
|
beforeRetry: [],
|
|
370
370
|
beforeError: [],
|
|
371
371
|
afterResponse: []
|
|
372
372
|
}, s.hooks),
|
|
373
|
-
method:
|
|
373
|
+
method: Jt(s.method ?? this.#t.method ?? "GET"),
|
|
374
374
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
375
375
|
prefixUrl: String(s.prefixUrl || ""),
|
|
376
|
-
retry:
|
|
376
|
+
retry: es(s.retry),
|
|
377
377
|
throwHttpErrors: s.throwHttpErrors ?? !0,
|
|
378
378
|
timeout: s.timeout ?? 1e4,
|
|
379
379
|
fetch: s.fetch ?? globalThis.fetch.bind(globalThis),
|
|
@@ -385,73 +385,73 @@ class O {
|
|
|
385
385
|
throw new Error("`input` must not begin with a slash when using `prefixUrl`");
|
|
386
386
|
this.#e.prefixUrl.endsWith("/") || (this.#e.prefixUrl += "/"), this.#t = this.#e.prefixUrl + this.#t;
|
|
387
387
|
}
|
|
388
|
-
|
|
389
|
-
const
|
|
390
|
-
if (this.#t instanceof globalThis.Request && (
|
|
388
|
+
$t && Ke && (this.#r = this.#e.signal ?? this.#t.signal, this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal), Ue && (this.#e.duplex = "half"), this.#e.json !== void 0 && (this.#e.body = this.#e.stringifyJson?.(this.#e.json) ?? JSON.stringify(this.#e.json), this.#e.headers.set("content-type", this.#e.headers.get("content-type") ?? "application/json"));
|
|
389
|
+
const n = s.headers && new globalThis.Headers(s.headers).has("content-type");
|
|
390
|
+
if (this.#t instanceof globalThis.Request && (Lt && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), rs(this.#e.searchParams)) {
|
|
391
391
|
const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(O.#d(this.#e.searchParams)).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
|
|
392
392
|
this.request = new globalThis.Request(o, this.#e);
|
|
393
393
|
}
|
|
394
394
|
if (this.#e.onUploadProgress) {
|
|
395
395
|
if (typeof this.#e.onUploadProgress != "function")
|
|
396
396
|
throw new TypeError("The `onUploadProgress` option must be a function");
|
|
397
|
-
if (!
|
|
397
|
+
if (!Ue)
|
|
398
398
|
throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");
|
|
399
399
|
this.request = this.#h(this.request, this.#e.body ?? void 0);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
#c() {
|
|
403
|
-
const
|
|
404
|
-
let s =
|
|
405
|
-
return this.#e.retry.jitter === !0 ? s = Math.random() *
|
|
403
|
+
const t = this.#e.retry.delay(this.#s);
|
|
404
|
+
let s = t;
|
|
405
|
+
return this.#e.retry.jitter === !0 ? s = Math.random() * t : typeof this.#e.retry.jitter == "function" && (s = this.#e.retry.jitter(t), (!Number.isFinite(s) || s < 0) && (s = t)), Math.min(this.#e.retry.backoffLimit, s);
|
|
406
406
|
}
|
|
407
|
-
async #p(
|
|
407
|
+
async #p(t) {
|
|
408
408
|
if (this.#s++, this.#s > this.#e.retry.limit)
|
|
409
|
-
throw
|
|
410
|
-
const s =
|
|
411
|
-
if (s instanceof
|
|
409
|
+
throw t;
|
|
410
|
+
const s = t instanceof Error ? t : new He(t);
|
|
411
|
+
if (s instanceof F)
|
|
412
412
|
return s.customDelay ?? this.#c();
|
|
413
413
|
if (!this.#e.retry.methods.includes(this.request.method.toLowerCase()))
|
|
414
|
-
throw
|
|
414
|
+
throw t;
|
|
415
415
|
if (this.#e.retry.shouldRetry !== void 0) {
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
418
|
-
throw
|
|
419
|
-
if (
|
|
416
|
+
const n = await this.#e.retry.shouldRetry({ error: s, retryCount: this.#s });
|
|
417
|
+
if (n === !1)
|
|
418
|
+
throw t;
|
|
419
|
+
if (n === !0)
|
|
420
420
|
return this.#c();
|
|
421
421
|
}
|
|
422
|
-
if (
|
|
423
|
-
throw
|
|
424
|
-
if (
|
|
425
|
-
if (!this.#e.retry.statusCodes.includes(
|
|
426
|
-
throw
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
let
|
|
430
|
-
Number.isNaN(
|
|
431
|
-
const i = this.#e.retry.maxRetryAfter ??
|
|
432
|
-
return
|
|
422
|
+
if (is(t) && !this.#e.retry.retryOnTimeout)
|
|
423
|
+
throw t;
|
|
424
|
+
if (os(t)) {
|
|
425
|
+
if (!this.#e.retry.statusCodes.includes(t.response.status))
|
|
426
|
+
throw t;
|
|
427
|
+
const n = t.response.headers.get("Retry-After") ?? t.response.headers.get("RateLimit-Reset") ?? t.response.headers.get("X-RateLimit-Retry-After") ?? t.response.headers.get("X-RateLimit-Reset") ?? t.response.headers.get("X-Rate-Limit-Reset");
|
|
428
|
+
if (n && this.#e.retry.afterStatusCodes.includes(t.response.status)) {
|
|
429
|
+
let r = Number(n) * 1e3;
|
|
430
|
+
Number.isNaN(r) ? r = Date.parse(n) - Date.now() : r >= Date.parse("2024-01-01") && (r -= Date.now());
|
|
431
|
+
const i = this.#e.retry.maxRetryAfter ?? r;
|
|
432
|
+
return r < i ? r : i;
|
|
433
433
|
}
|
|
434
|
-
if (
|
|
435
|
-
throw
|
|
434
|
+
if (t.response.status === 413)
|
|
435
|
+
throw t;
|
|
436
436
|
}
|
|
437
437
|
return this.#c();
|
|
438
438
|
}
|
|
439
|
-
#l(
|
|
440
|
-
return this.#e.parseJson && (
|
|
439
|
+
#l(t) {
|
|
440
|
+
return this.#e.parseJson && (t.json = async () => this.#e.parseJson(await t.text())), t;
|
|
441
441
|
}
|
|
442
|
-
async #f(
|
|
442
|
+
async #f(t) {
|
|
443
443
|
try {
|
|
444
|
-
return await
|
|
444
|
+
return await t();
|
|
445
445
|
} catch (s) {
|
|
446
|
-
const
|
|
446
|
+
const n = Math.min(await this.#p(s), H);
|
|
447
447
|
if (this.#s < 1)
|
|
448
448
|
throw s;
|
|
449
|
-
if (await
|
|
450
|
-
const
|
|
451
|
-
this.#u(
|
|
449
|
+
if (await ss(n, this.#r ? { signal: this.#r } : {}), s instanceof F && s.customRequest) {
|
|
450
|
+
const r = this.#e.signal ? new globalThis.Request(s.customRequest, { signal: this.#e.signal }) : new globalThis.Request(s.customRequest);
|
|
451
|
+
this.#u(r);
|
|
452
452
|
}
|
|
453
|
-
for (const
|
|
454
|
-
const i = await
|
|
453
|
+
for (const r of this.#e.hooks.beforeRetry) {
|
|
454
|
+
const i = await r({
|
|
455
455
|
request: this.request,
|
|
456
456
|
options: this.#a(),
|
|
457
457
|
error: s,
|
|
@@ -463,92 +463,719 @@ class O {
|
|
|
463
463
|
}
|
|
464
464
|
if (i instanceof globalThis.Response)
|
|
465
465
|
return i;
|
|
466
|
-
if (i ===
|
|
466
|
+
if (i === Ve)
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
|
-
return this.#f(
|
|
469
|
+
return this.#f(t);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
async #
|
|
473
|
-
this.#
|
|
472
|
+
async #g() {
|
|
473
|
+
this.#n?.signal.aborted && (this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal, this.request = new globalThis.Request(this.request, { signal: this.#e.signal }));
|
|
474
474
|
for (const s of this.#e.hooks.beforeRequest) {
|
|
475
|
-
const
|
|
476
|
-
if (
|
|
477
|
-
return
|
|
478
|
-
if (
|
|
479
|
-
this.#u(
|
|
475
|
+
const n = await s(this.request, this.#a(), { retryCount: this.#s });
|
|
476
|
+
if (n instanceof Response)
|
|
477
|
+
return n;
|
|
478
|
+
if (n instanceof globalThis.Request) {
|
|
479
|
+
this.#u(n);
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
const
|
|
484
|
-
return this.#o = this.request, this.request = this.#o.clone(), this.#e.timeout === !1 ? this.#e.fetch(this.#o,
|
|
483
|
+
const t = ns(this.request, this.#e);
|
|
484
|
+
return this.#o = this.request, this.request = this.#o.clone(), this.#e.timeout === !1 ? this.#e.fetch(this.#o, t) : ts(this.#o, t, this.#n, this.#e);
|
|
485
485
|
}
|
|
486
486
|
#a() {
|
|
487
487
|
if (!this.#i) {
|
|
488
|
-
const { hooks:
|
|
488
|
+
const { hooks: t, ...s } = this.#e;
|
|
489
489
|
this.#i = Object.freeze(s);
|
|
490
490
|
}
|
|
491
491
|
return this.#i;
|
|
492
492
|
}
|
|
493
|
-
#u(
|
|
494
|
-
this.#i = void 0, this.request = this.#h(
|
|
493
|
+
#u(t) {
|
|
494
|
+
this.#i = void 0, this.request = this.#h(t);
|
|
495
495
|
}
|
|
496
|
-
#h(
|
|
497
|
-
return !this.#e.onUploadProgress || !
|
|
496
|
+
#h(t, s) {
|
|
497
|
+
return !this.#e.onUploadProgress || !t.body ? t : Yt(t, this.#e.onUploadProgress, s ?? this.#e.body ?? void 0);
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
/*! MIT License © Sindre Sorhus */
|
|
501
|
-
const
|
|
502
|
-
const
|
|
503
|
-
for (const s of
|
|
504
|
-
|
|
505
|
-
return
|
|
506
|
-
},
|
|
507
|
-
var
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
501
|
+
const G = (e) => {
|
|
502
|
+
const t = (s, n) => O.create(s, N(e, n));
|
|
503
|
+
for (const s of We)
|
|
504
|
+
t[s] = (n, r) => O.create(n, N(e, r, { method: s }));
|
|
505
|
+
return t.create = (s) => G(N(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), G(N(e, s))), t.stop = Ve, t.retry = qt, t;
|
|
506
|
+
}, as = G();
|
|
507
|
+
var E = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(E || {});
|
|
508
|
+
const Ze = {
|
|
509
|
+
type: "evm",
|
|
510
|
+
chainId: 42161,
|
|
511
|
+
name: "Arbitrum",
|
|
512
|
+
cctpDomain: 3,
|
|
513
|
+
logoURI: "/images/chains/arbitrum.svg"
|
|
514
|
+
}, Qe = {
|
|
515
|
+
type: "evm",
|
|
516
|
+
chainId: 421614,
|
|
517
|
+
name: "Arbitrum Sepolia",
|
|
518
|
+
cctpDomain: 3,
|
|
519
|
+
logoURI: "/images/chains/arbitrum.svg"
|
|
520
|
+
}, et = {
|
|
521
|
+
type: "evm",
|
|
522
|
+
chainId: 8453,
|
|
523
|
+
name: "Base",
|
|
524
|
+
cctpDomain: 6,
|
|
525
|
+
logoURI: "/images/chains/base.webp"
|
|
526
|
+
}, tt = {
|
|
527
|
+
type: "evm",
|
|
528
|
+
chainId: 84532,
|
|
529
|
+
name: "Base Sepolia",
|
|
530
|
+
cctpDomain: 6,
|
|
531
|
+
logoURI: "/images/chains/base.webp"
|
|
532
|
+
}, st = {
|
|
533
|
+
type: "evm",
|
|
534
|
+
chainId: 56,
|
|
535
|
+
name: "BNB Chain",
|
|
536
|
+
cctpDomain: null,
|
|
537
|
+
logoURI: "/images/chains/bsc.webp"
|
|
538
|
+
}, nt = {
|
|
539
|
+
type: "evm",
|
|
540
|
+
chainId: 1,
|
|
541
|
+
name: "Ethereum",
|
|
542
|
+
cctpDomain: 0,
|
|
543
|
+
logoURI: "/images/chains/ethereum.svg"
|
|
544
|
+
}, rt = {
|
|
545
|
+
type: "evm",
|
|
546
|
+
chainId: 11155111,
|
|
547
|
+
name: "Ethereum Sepolia",
|
|
548
|
+
cctpDomain: 0,
|
|
549
|
+
logoURI: "/images/chains/ethereum.svg"
|
|
550
|
+
}, ot = {
|
|
551
|
+
type: "evm",
|
|
552
|
+
chainId: 43114,
|
|
553
|
+
name: "Avalanche",
|
|
554
|
+
cctpDomain: 1,
|
|
555
|
+
logoURI: "/images/chains/avalanche.svg"
|
|
556
|
+
}, it = {
|
|
557
|
+
type: "evm",
|
|
558
|
+
chainId: 43113,
|
|
559
|
+
name: "Avalanche Fuji",
|
|
560
|
+
cctpDomain: 1,
|
|
561
|
+
logoURI: "/images/chains/avalanche.svg"
|
|
562
|
+
}, at = {
|
|
563
|
+
type: "starknet",
|
|
564
|
+
chainId: "0x534e5f4d41494e",
|
|
565
|
+
// SN_MAIN
|
|
566
|
+
name: "Starknet",
|
|
567
|
+
cctpDomain: null,
|
|
568
|
+
logoURI: "/images/chains/starknet.svg"
|
|
569
|
+
};
|
|
570
|
+
function ge(e, { strict: t = !0 } = {}) {
|
|
571
|
+
return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
|
|
572
|
+
}
|
|
573
|
+
function xe(e) {
|
|
574
|
+
return ge(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
|
|
575
|
+
}
|
|
576
|
+
const ct = "2.43.4";
|
|
577
|
+
let K = {
|
|
578
|
+
getDocsUrl: ({ docsBaseUrl: e, docsPath: t = "", docsSlug: s }) => t ? `${e ?? "https://viem.sh"}${t}${s ? `#${s}` : ""}` : void 0,
|
|
579
|
+
version: `viem@${ct}`
|
|
580
|
+
};
|
|
581
|
+
class A extends Error {
|
|
582
|
+
constructor(t, s = {}) {
|
|
583
|
+
const n = s.cause instanceof A ? s.cause.details : s.cause?.message ? s.cause.message : s.details, r = s.cause instanceof A && s.cause.docsPath || s.docsPath, i = K.getDocsUrl?.({ ...s, docsPath: r }), o = [
|
|
584
|
+
t || "An error occurred.",
|
|
585
|
+
"",
|
|
586
|
+
...s.metaMessages ? [...s.metaMessages, ""] : [],
|
|
587
|
+
...i ? [`Docs: ${i}`] : [],
|
|
588
|
+
...n ? [`Details: ${n}`] : [],
|
|
589
|
+
...K.version ? [`Version: ${K.version}`] : []
|
|
590
|
+
].join(`
|
|
591
|
+
`);
|
|
592
|
+
super(o, s.cause ? { cause: s.cause } : void 0), Object.defineProperty(this, "details", {
|
|
593
|
+
enumerable: !0,
|
|
594
|
+
configurable: !0,
|
|
595
|
+
writable: !0,
|
|
596
|
+
value: void 0
|
|
597
|
+
}), Object.defineProperty(this, "docsPath", {
|
|
598
|
+
enumerable: !0,
|
|
599
|
+
configurable: !0,
|
|
600
|
+
writable: !0,
|
|
601
|
+
value: void 0
|
|
602
|
+
}), Object.defineProperty(this, "metaMessages", {
|
|
603
|
+
enumerable: !0,
|
|
604
|
+
configurable: !0,
|
|
605
|
+
writable: !0,
|
|
606
|
+
value: void 0
|
|
607
|
+
}), Object.defineProperty(this, "shortMessage", {
|
|
608
|
+
enumerable: !0,
|
|
609
|
+
configurable: !0,
|
|
610
|
+
writable: !0,
|
|
611
|
+
value: void 0
|
|
612
|
+
}), Object.defineProperty(this, "version", {
|
|
613
|
+
enumerable: !0,
|
|
614
|
+
configurable: !0,
|
|
615
|
+
writable: !0,
|
|
616
|
+
value: void 0
|
|
617
|
+
}), Object.defineProperty(this, "name", {
|
|
618
|
+
enumerable: !0,
|
|
619
|
+
configurable: !0,
|
|
620
|
+
writable: !0,
|
|
621
|
+
value: "BaseError"
|
|
622
|
+
}), this.details = n, this.docsPath = r, this.metaMessages = s.metaMessages, this.name = s.name ?? this.name, this.shortMessage = t, this.version = ct;
|
|
623
|
+
}
|
|
624
|
+
walk(t) {
|
|
625
|
+
return ut(this, t);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
function ut(e, t) {
|
|
629
|
+
return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? ut(e.cause, t) : t ? null : e;
|
|
630
|
+
}
|
|
631
|
+
class lt extends A {
|
|
632
|
+
constructor({ size: t, targetSize: s, type: n }) {
|
|
633
|
+
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function j(e, { dir: t, size: s = 32 } = {}) {
|
|
637
|
+
return typeof e == "string" ? cs(e, { dir: t, size: s }) : us(e, { dir: t, size: s });
|
|
638
|
+
}
|
|
639
|
+
function cs(e, { dir: t, size: s = 32 } = {}) {
|
|
640
|
+
if (s === null)
|
|
641
|
+
return e;
|
|
642
|
+
const n = e.replace("0x", "");
|
|
643
|
+
if (n.length > s * 2)
|
|
644
|
+
throw new lt({
|
|
645
|
+
size: Math.ceil(n.length / 2),
|
|
646
|
+
targetSize: s,
|
|
647
|
+
type: "hex"
|
|
648
|
+
});
|
|
649
|
+
return `0x${n[t === "right" ? "padEnd" : "padStart"](s * 2, "0")}`;
|
|
650
|
+
}
|
|
651
|
+
function us(e, { dir: t, size: s = 32 } = {}) {
|
|
652
|
+
if (s === null)
|
|
653
|
+
return e;
|
|
654
|
+
if (e.length > s)
|
|
655
|
+
throw new lt({
|
|
656
|
+
size: e.length,
|
|
657
|
+
targetSize: s,
|
|
658
|
+
type: "bytes"
|
|
659
|
+
});
|
|
660
|
+
const n = new Uint8Array(s);
|
|
661
|
+
for (let r = 0; r < s; r++) {
|
|
662
|
+
const i = t === "right";
|
|
663
|
+
n[i ? r : s - r - 1] = e[i ? r : e.length - r - 1];
|
|
664
|
+
}
|
|
665
|
+
return n;
|
|
666
|
+
}
|
|
667
|
+
class ls extends A {
|
|
668
|
+
constructor({ max: t, min: s, signed: n, size: r, value: i }) {
|
|
669
|
+
super(`Number "${i}" is not in safe ${r ? `${r * 8}-bit ${n ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${s} to ${t})` : `(above ${s})`}`, { name: "IntegerOutOfRangeError" });
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
class fs extends A {
|
|
673
|
+
constructor({ givenSize: t, maxSize: s }) {
|
|
674
|
+
super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function me(e, { size: t }) {
|
|
678
|
+
if (xe(e) > t)
|
|
679
|
+
throw new fs({
|
|
680
|
+
givenSize: xe(e),
|
|
681
|
+
maxSize: t
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
function hs(e, t = {}) {
|
|
685
|
+
const { signed: s, size: n } = t, r = BigInt(e);
|
|
686
|
+
let i;
|
|
687
|
+
n ? s ? i = (1n << BigInt(n) * 8n - 1n) - 1n : i = 2n ** (BigInt(n) * 8n) - 1n : typeof e == "number" && (i = BigInt(Number.MAX_SAFE_INTEGER));
|
|
688
|
+
const o = typeof i == "bigint" && s ? -i - 1n : 0;
|
|
689
|
+
if (i && r > i || r < o) {
|
|
690
|
+
const c = typeof e == "bigint" ? "n" : "";
|
|
691
|
+
throw new ls({
|
|
692
|
+
max: i ? `${i}${c}` : void 0,
|
|
693
|
+
min: `${o}${c}`,
|
|
694
|
+
signed: s,
|
|
695
|
+
size: n,
|
|
696
|
+
value: `${e}${c}`
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
const a = `0x${(s && r < 0 ? (1n << BigInt(n * 8)) + BigInt(r) : r).toString(16)}`;
|
|
700
|
+
return n ? j(a, { size: n }) : a;
|
|
701
|
+
}
|
|
702
|
+
const ds = /* @__PURE__ */ new TextEncoder();
|
|
703
|
+
function ps(e, t = {}) {
|
|
704
|
+
return typeof e == "number" || typeof e == "bigint" ? ms(e, t) : typeof e == "boolean" ? gs(e, t) : ge(e) ? ft(e, t) : ht(e, t);
|
|
705
|
+
}
|
|
706
|
+
function gs(e, t = {}) {
|
|
707
|
+
const s = new Uint8Array(1);
|
|
708
|
+
return s[0] = Number(e), typeof t.size == "number" ? (me(s, { size: t.size }), j(s, { size: t.size })) : s;
|
|
709
|
+
}
|
|
710
|
+
const S = {
|
|
711
|
+
zero: 48,
|
|
712
|
+
nine: 57,
|
|
713
|
+
A: 65,
|
|
714
|
+
F: 70,
|
|
715
|
+
a: 97,
|
|
716
|
+
f: 102
|
|
717
|
+
};
|
|
718
|
+
function ke(e) {
|
|
719
|
+
if (e >= S.zero && e <= S.nine)
|
|
720
|
+
return e - S.zero;
|
|
721
|
+
if (e >= S.A && e <= S.F)
|
|
722
|
+
return e - (S.A - 10);
|
|
723
|
+
if (e >= S.a && e <= S.f)
|
|
724
|
+
return e - (S.a - 10);
|
|
725
|
+
}
|
|
726
|
+
function ft(e, t = {}) {
|
|
727
|
+
let s = e;
|
|
728
|
+
t.size && (me(s, { size: t.size }), s = j(s, { dir: "right", size: t.size }));
|
|
729
|
+
let n = s.slice(2);
|
|
730
|
+
n.length % 2 && (n = `0${n}`);
|
|
731
|
+
const r = n.length / 2, i = new Uint8Array(r);
|
|
732
|
+
for (let o = 0, a = 0; o < r; o++) {
|
|
733
|
+
const c = ke(n.charCodeAt(a++)), u = ke(n.charCodeAt(a++));
|
|
734
|
+
if (c === void 0 || u === void 0)
|
|
735
|
+
throw new A(`Invalid byte sequence ("${n[a - 2]}${n[a - 1]}" in "${n}").`);
|
|
736
|
+
i[o] = c * 16 + u;
|
|
737
|
+
}
|
|
738
|
+
return i;
|
|
739
|
+
}
|
|
740
|
+
function ms(e, t) {
|
|
741
|
+
const s = hs(e, t);
|
|
742
|
+
return ft(s);
|
|
743
|
+
}
|
|
744
|
+
function ht(e, t = {}) {
|
|
745
|
+
const s = ds.encode(e);
|
|
746
|
+
return typeof t.size == "number" ? (me(s, { size: t.size }), j(s, { dir: "right", size: t.size })) : s;
|
|
747
|
+
}
|
|
748
|
+
const B = /* @__PURE__ */ BigInt(2 ** 32 - 1), Oe = /* @__PURE__ */ BigInt(32);
|
|
749
|
+
function ys(e, t = !1) {
|
|
750
|
+
return t ? { h: Number(e & B), l: Number(e >> Oe & B) } : { h: Number(e >> Oe & B) | 0, l: Number(e & B) | 0 };
|
|
751
|
+
}
|
|
752
|
+
function ws(e, t = !1) {
|
|
753
|
+
const s = e.length;
|
|
754
|
+
let n = new Uint32Array(s), r = new Uint32Array(s);
|
|
755
|
+
for (let i = 0; i < s; i++) {
|
|
756
|
+
const { h: o, l: a } = ys(e[i], t);
|
|
757
|
+
[n[i], r[i]] = [o, a];
|
|
758
|
+
}
|
|
759
|
+
return [n, r];
|
|
760
|
+
}
|
|
761
|
+
const bs = (e, t, s) => e << s | t >>> 32 - s, Es = (e, t, s) => t << s | e >>> 32 - s, Ss = (e, t, s) => t << s - 32 | e >>> 64 - s, Rs = (e, t, s) => e << s - 32 | t >>> 64 - s;
|
|
762
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
763
|
+
function Ts(e) {
|
|
764
|
+
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
765
|
+
}
|
|
766
|
+
function De(e) {
|
|
767
|
+
if (!Number.isSafeInteger(e) || e < 0)
|
|
768
|
+
throw new Error("positive integer expected, got " + e);
|
|
769
|
+
}
|
|
770
|
+
function $(e, ...t) {
|
|
771
|
+
if (!Ts(e))
|
|
772
|
+
throw new Error("Uint8Array expected");
|
|
773
|
+
if (t.length > 0 && !t.includes(e.length))
|
|
774
|
+
throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
|
|
775
|
+
}
|
|
776
|
+
function Ne(e, t = !0) {
|
|
777
|
+
if (e.destroyed)
|
|
778
|
+
throw new Error("Hash instance has been destroyed");
|
|
779
|
+
if (t && e.finished)
|
|
780
|
+
throw new Error("Hash#digest() has already been called");
|
|
781
|
+
}
|
|
782
|
+
function As(e, t) {
|
|
783
|
+
$(e);
|
|
784
|
+
const s = t.outputLen;
|
|
785
|
+
if (e.length < s)
|
|
786
|
+
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
787
|
+
}
|
|
788
|
+
function Is(e) {
|
|
789
|
+
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
790
|
+
}
|
|
791
|
+
function dt(...e) {
|
|
792
|
+
for (let t = 0; t < e.length; t++)
|
|
793
|
+
e[t].fill(0);
|
|
794
|
+
}
|
|
795
|
+
const vs = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
796
|
+
function Ps(e) {
|
|
797
|
+
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
798
|
+
}
|
|
799
|
+
function Us(e) {
|
|
800
|
+
for (let t = 0; t < e.length; t++)
|
|
801
|
+
e[t] = Ps(e[t]);
|
|
802
|
+
return e;
|
|
803
|
+
}
|
|
804
|
+
const Me = vs ? (e) => e : Us;
|
|
805
|
+
function Cs(e) {
|
|
806
|
+
if (typeof e != "string")
|
|
807
|
+
throw new Error("string expected");
|
|
808
|
+
return new Uint8Array(new TextEncoder().encode(e));
|
|
809
|
+
}
|
|
810
|
+
function pt(e) {
|
|
811
|
+
return typeof e == "string" && (e = Cs(e)), $(e), e;
|
|
812
|
+
}
|
|
813
|
+
class xs {
|
|
814
|
+
}
|
|
815
|
+
function ks(e) {
|
|
816
|
+
const t = (n) => e().update(pt(n)).digest(), s = e();
|
|
817
|
+
return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
|
|
818
|
+
}
|
|
819
|
+
const Os = BigInt(0), C = BigInt(1), Ds = BigInt(2), Ns = BigInt(7), Ms = BigInt(256), Bs = BigInt(113), gt = [], mt = [], yt = [];
|
|
820
|
+
for (let e = 0, t = C, s = 1, n = 0; e < 24; e++) {
|
|
821
|
+
[s, n] = [n, (2 * s + 3 * n) % 5], gt.push(2 * (5 * n + s)), mt.push((e + 1) * (e + 2) / 2 % 64);
|
|
822
|
+
let r = Os;
|
|
823
|
+
for (let i = 0; i < 7; i++)
|
|
824
|
+
t = (t << C ^ (t >> Ns) * Bs) % Ms, t & Ds && (r ^= C << (C << /* @__PURE__ */ BigInt(i)) - C);
|
|
825
|
+
yt.push(r);
|
|
826
|
+
}
|
|
827
|
+
const wt = ws(yt, !0), $s = wt[0], _s = wt[1], Be = (e, t, s) => s > 32 ? Ss(e, t, s) : bs(e, t, s), $e = (e, t, s) => s > 32 ? Rs(e, t, s) : Es(e, t, s);
|
|
828
|
+
function Ls(e, t = 24) {
|
|
829
|
+
const s = new Uint32Array(10);
|
|
830
|
+
for (let n = 24 - t; n < 24; n++) {
|
|
831
|
+
for (let o = 0; o < 10; o++)
|
|
832
|
+
s[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
|
|
833
|
+
for (let o = 0; o < 10; o += 2) {
|
|
834
|
+
const a = (o + 8) % 10, c = (o + 2) % 10, u = s[c], l = s[c + 1], w = Be(u, l, 1) ^ s[a], d = $e(u, l, 1) ^ s[a + 1];
|
|
835
|
+
for (let y = 0; y < 50; y += 10)
|
|
836
|
+
e[o + y] ^= w, e[o + y + 1] ^= d;
|
|
837
|
+
}
|
|
838
|
+
let r = e[2], i = e[3];
|
|
839
|
+
for (let o = 0; o < 24; o++) {
|
|
840
|
+
const a = mt[o], c = Be(r, i, a), u = $e(r, i, a), l = gt[o];
|
|
841
|
+
r = e[l], i = e[l + 1], e[l] = c, e[l + 1] = u;
|
|
842
|
+
}
|
|
843
|
+
for (let o = 0; o < 50; o += 10) {
|
|
844
|
+
for (let a = 0; a < 10; a++)
|
|
845
|
+
s[a] = e[o + a];
|
|
846
|
+
for (let a = 0; a < 10; a++)
|
|
847
|
+
e[o + a] ^= ~s[(a + 2) % 10] & s[(a + 4) % 10];
|
|
517
848
|
}
|
|
518
|
-
|
|
849
|
+
e[0] ^= $s[n], e[1] ^= _s[n];
|
|
519
850
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
851
|
+
dt(s);
|
|
852
|
+
}
|
|
853
|
+
class ye extends xs {
|
|
854
|
+
// NOTE: we accept arguments in bytes instead of bits here.
|
|
855
|
+
constructor(t, s, n, r = !1, i = 24) {
|
|
856
|
+
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = n, this.enableXOF = r, this.rounds = i, De(n), !(0 < t && t < 200))
|
|
857
|
+
throw new Error("only keccak-f1600 function is supported");
|
|
858
|
+
this.state = new Uint8Array(200), this.state32 = Is(this.state);
|
|
859
|
+
}
|
|
860
|
+
clone() {
|
|
861
|
+
return this._cloneInto();
|
|
862
|
+
}
|
|
863
|
+
keccak() {
|
|
864
|
+
Me(this.state32), Ls(this.state32, this.rounds), Me(this.state32), this.posOut = 0, this.pos = 0;
|
|
865
|
+
}
|
|
866
|
+
update(t) {
|
|
867
|
+
Ne(this), t = pt(t), $(t);
|
|
868
|
+
const { blockLen: s, state: n } = this, r = t.length;
|
|
869
|
+
for (let i = 0; i < r; ) {
|
|
870
|
+
const o = Math.min(s - this.pos, r - i);
|
|
871
|
+
for (let a = 0; a < o; a++)
|
|
872
|
+
n[this.pos++] ^= t[i++];
|
|
873
|
+
this.pos === s && this.keccak();
|
|
874
|
+
}
|
|
875
|
+
return this;
|
|
876
|
+
}
|
|
877
|
+
finish() {
|
|
878
|
+
if (this.finished)
|
|
879
|
+
return;
|
|
880
|
+
this.finished = !0;
|
|
881
|
+
const { state: t, suffix: s, pos: n, blockLen: r } = this;
|
|
882
|
+
t[n] ^= s, (s & 128) !== 0 && n === r - 1 && this.keccak(), t[r - 1] ^= 128, this.keccak();
|
|
883
|
+
}
|
|
884
|
+
writeInto(t) {
|
|
885
|
+
Ne(this, !1), $(t), this.finish();
|
|
886
|
+
const s = this.state, { blockLen: n } = this;
|
|
887
|
+
for (let r = 0, i = t.length; r < i; ) {
|
|
888
|
+
this.posOut >= n && this.keccak();
|
|
889
|
+
const o = Math.min(n - this.posOut, i - r);
|
|
890
|
+
t.set(s.subarray(this.posOut, this.posOut + o), r), this.posOut += o, r += o;
|
|
891
|
+
}
|
|
892
|
+
return t;
|
|
893
|
+
}
|
|
894
|
+
xofInto(t) {
|
|
895
|
+
if (!this.enableXOF)
|
|
896
|
+
throw new Error("XOF is not possible for this instance");
|
|
897
|
+
return this.writeInto(t);
|
|
898
|
+
}
|
|
899
|
+
xof(t) {
|
|
900
|
+
return De(t), this.xofInto(new Uint8Array(t));
|
|
901
|
+
}
|
|
902
|
+
digestInto(t) {
|
|
903
|
+
if (As(t, this), this.finished)
|
|
904
|
+
throw new Error("digest() was already called");
|
|
905
|
+
return this.writeInto(t), this.destroy(), t;
|
|
906
|
+
}
|
|
907
|
+
digest() {
|
|
908
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
909
|
+
}
|
|
910
|
+
destroy() {
|
|
911
|
+
this.destroyed = !0, dt(this.state);
|
|
912
|
+
}
|
|
913
|
+
_cloneInto(t) {
|
|
914
|
+
const { blockLen: s, suffix: n, outputLen: r, rounds: i, enableXOF: o } = this;
|
|
915
|
+
return t || (t = new ye(s, n, r, o, i)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = i, t.suffix = n, t.outputLen = r, t.enableXOF = o, t.destroyed = this.destroyed, t;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
const zs = (e, t, s) => ks(() => new ye(t, e, s)), js = zs(1, 136, 256 / 8);
|
|
919
|
+
function qs(e, t) {
|
|
920
|
+
return js(ge(e, { strict: !1 }) ? ps(e) : e);
|
|
921
|
+
}
|
|
922
|
+
class Fs extends A {
|
|
923
|
+
constructor({ address: t }) {
|
|
924
|
+
super(`Address "${t}" is invalid.`, {
|
|
925
|
+
metaMessages: [
|
|
926
|
+
"- Address must be a hex value of 20 bytes (40 hex characters).",
|
|
927
|
+
"- Address must match its checksum counterpart."
|
|
928
|
+
],
|
|
929
|
+
name: "InvalidAddressError"
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
class bt extends Map {
|
|
934
|
+
constructor(t) {
|
|
935
|
+
super(), Object.defineProperty(this, "maxSize", {
|
|
936
|
+
enumerable: !0,
|
|
937
|
+
configurable: !0,
|
|
938
|
+
writable: !0,
|
|
939
|
+
value: void 0
|
|
940
|
+
}), this.maxSize = t;
|
|
941
|
+
}
|
|
942
|
+
get(t) {
|
|
943
|
+
const s = super.get(t);
|
|
944
|
+
return super.has(t) && s !== void 0 && (this.delete(t), super.set(t, s)), s;
|
|
945
|
+
}
|
|
946
|
+
set(t, s) {
|
|
947
|
+
if (super.set(t, s), this.maxSize && this.size > this.maxSize) {
|
|
948
|
+
const n = this.keys().next().value;
|
|
949
|
+
n && this.delete(n);
|
|
950
|
+
}
|
|
951
|
+
return this;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
const W = /* @__PURE__ */ new bt(8192);
|
|
955
|
+
function Et(e, t) {
|
|
956
|
+
if (W.has(`${e}.${t}`))
|
|
957
|
+
return W.get(`${e}.${t}`);
|
|
958
|
+
const s = e.substring(2).toLowerCase(), n = qs(ht(s)), r = s.split("");
|
|
959
|
+
for (let o = 0; o < 40; o += 2)
|
|
960
|
+
n[o >> 1] >> 4 >= 8 && r[o] && (r[o] = r[o].toUpperCase()), (n[o >> 1] & 15) >= 8 && r[o + 1] && (r[o + 1] = r[o + 1].toUpperCase());
|
|
961
|
+
const i = `0x${r.join("")}`;
|
|
962
|
+
return W.set(`${e}.${t}`, i), i;
|
|
963
|
+
}
|
|
964
|
+
function R(e, t) {
|
|
965
|
+
if (!Ks(e, { strict: !1 }))
|
|
966
|
+
throw new Fs({ address: e });
|
|
967
|
+
return Et(e, t);
|
|
968
|
+
}
|
|
969
|
+
const Hs = /^0x[a-fA-F0-9]{40}$/, V = /* @__PURE__ */ new bt(8192);
|
|
970
|
+
function Ks(e, t) {
|
|
971
|
+
const { strict: s = !0 } = t ?? {}, n = `${e}.${s}`;
|
|
972
|
+
if (V.has(n))
|
|
973
|
+
return V.get(n);
|
|
974
|
+
const r = Hs.test(e) ? e.toLowerCase() === e ? !0 : s ? Et(e) === e : !0 : !1;
|
|
975
|
+
return V.set(n, r), r;
|
|
976
|
+
}
|
|
977
|
+
const Z = {
|
|
978
|
+
chainId: Qe.chainId,
|
|
979
|
+
address: R("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
|
|
980
|
+
symbol: "USDC",
|
|
981
|
+
fiatISO: "USD",
|
|
982
|
+
decimals: 6,
|
|
983
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
984
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
985
|
+
}, Q = {
|
|
986
|
+
chainId: Ze.chainId,
|
|
987
|
+
address: R("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
|
|
988
|
+
symbol: "USDC",
|
|
989
|
+
name: "USD Coin",
|
|
990
|
+
decimals: 6,
|
|
991
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
992
|
+
/* USDC */
|
|
993
|
+
}, ee = {
|
|
994
|
+
chainId: it.chainId,
|
|
995
|
+
address: R("0x5425890298aed601595a70ab815c96711a31bc65"),
|
|
996
|
+
symbol: "USDC",
|
|
997
|
+
fiatISO: "USD",
|
|
998
|
+
decimals: 6,
|
|
999
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1000
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1001
|
+
}, te = {
|
|
1002
|
+
chainId: ot.chainId,
|
|
1003
|
+
address: R("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
|
|
1004
|
+
symbol: "USDC",
|
|
1005
|
+
fiatISO: "USD",
|
|
1006
|
+
decimals: 6,
|
|
1007
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1008
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1009
|
+
}, se = {
|
|
1010
|
+
chainId: tt.chainId,
|
|
1011
|
+
address: R("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
|
|
1012
|
+
symbol: "USDC",
|
|
1013
|
+
fiatISO: "USD",
|
|
1014
|
+
decimals: 6,
|
|
1015
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1016
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1017
|
+
}, ne = {
|
|
1018
|
+
chainId: et.chainId,
|
|
1019
|
+
address: R("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
1020
|
+
symbol: "USDC",
|
|
1021
|
+
fiatISO: "USD",
|
|
1022
|
+
decimals: 6,
|
|
1023
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1024
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1025
|
+
}, re = {
|
|
1026
|
+
chainId: st.chainId,
|
|
1027
|
+
address: R("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
|
|
1028
|
+
symbol: "USDC",
|
|
1029
|
+
decimals: 18,
|
|
1030
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1031
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1032
|
+
}, oe = {
|
|
1033
|
+
chainId: rt.chainId,
|
|
1034
|
+
address: R("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
|
|
1035
|
+
symbol: "USDC",
|
|
1036
|
+
decimals: 6,
|
|
1037
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1038
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1039
|
+
}, ie = {
|
|
1040
|
+
chainId: nt.chainId,
|
|
1041
|
+
address: R("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
|
|
1042
|
+
symbol: "USDC",
|
|
1043
|
+
decimals: 6,
|
|
1044
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1045
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1046
|
+
}, Ws = {
|
|
1047
|
+
chainId: at.chainId,
|
|
1048
|
+
address: "0x053C91253BC9682c04929cA02ED00b3E423f6710D2ee7e0D5EBB06F3eCF368A8",
|
|
1049
|
+
symbol: "USDC",
|
|
1050
|
+
decimals: 6,
|
|
1051
|
+
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1052
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1053
|
+
}, Vs = {
|
|
1054
|
+
[Z.chainId]: Z,
|
|
1055
|
+
[Q.chainId]: Q,
|
|
1056
|
+
[ee.chainId]: ee,
|
|
1057
|
+
[te.chainId]: te,
|
|
1058
|
+
[se.chainId]: se,
|
|
1059
|
+
[ne.chainId]: ne,
|
|
1060
|
+
[oe.chainId]: oe,
|
|
1061
|
+
[ie.chainId]: ie,
|
|
1062
|
+
[re.chainId]: re
|
|
1063
|
+
}, ae = {
|
|
1064
|
+
ARBITRUM_MAINNET: {
|
|
1065
|
+
...Ze,
|
|
1066
|
+
tokens: {
|
|
1067
|
+
[E.USDC]: Q
|
|
1068
|
+
},
|
|
1069
|
+
explorer: "https://arbiscan.io"
|
|
1070
|
+
},
|
|
1071
|
+
ARBITRUM_TESTNET: {
|
|
1072
|
+
...Qe,
|
|
1073
|
+
explorer: "https://sepolia.arbiscan.io",
|
|
1074
|
+
tokens: {
|
|
1075
|
+
[E.USDC]: Z
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
AVALANCHE_MAINNET: {
|
|
1079
|
+
...ot,
|
|
1080
|
+
tokens: {
|
|
1081
|
+
[E.USDC]: te
|
|
1082
|
+
},
|
|
1083
|
+
explorer: "https://snowtrace.io"
|
|
1084
|
+
},
|
|
1085
|
+
AVALANCHE_TESTNET: {
|
|
1086
|
+
...it,
|
|
1087
|
+
tokens: {
|
|
1088
|
+
[E.USDC]: ee
|
|
1089
|
+
},
|
|
1090
|
+
explorer: "https://testnet.snowtrace.io"
|
|
1091
|
+
},
|
|
1092
|
+
BASE_MAINNET: {
|
|
1093
|
+
...et,
|
|
1094
|
+
tokens: {
|
|
1095
|
+
[E.USDC]: ne
|
|
1096
|
+
},
|
|
1097
|
+
explorer: "https://basescan.org"
|
|
1098
|
+
},
|
|
1099
|
+
BASE_TESTNET: {
|
|
1100
|
+
...tt,
|
|
1101
|
+
tokens: {
|
|
1102
|
+
[E.USDC]: se
|
|
1103
|
+
},
|
|
1104
|
+
explorer: "https://sepolia.basescan.org"
|
|
1105
|
+
},
|
|
1106
|
+
BSC_MAINNET: {
|
|
1107
|
+
...st,
|
|
1108
|
+
tokens: {
|
|
1109
|
+
[E.USDC]: re
|
|
1110
|
+
},
|
|
1111
|
+
explorer: "https://bscscan.com"
|
|
1112
|
+
},
|
|
1113
|
+
ETHEREUM_MAINNET: {
|
|
1114
|
+
...nt,
|
|
1115
|
+
tokens: {
|
|
1116
|
+
[E.USDC]: ie
|
|
1117
|
+
},
|
|
1118
|
+
explorer: "https://etherscan.io"
|
|
1119
|
+
},
|
|
1120
|
+
ETHEREUM_TESTNET: {
|
|
1121
|
+
...rt,
|
|
1122
|
+
tokens: {
|
|
1123
|
+
[E.USDC]: oe
|
|
1124
|
+
},
|
|
1125
|
+
explorer: "https://sepolia.etherscan.io"
|
|
1126
|
+
},
|
|
1127
|
+
STARKNET_MAINNET: {
|
|
1128
|
+
...at,
|
|
1129
|
+
tokens: {
|
|
1130
|
+
[E.USDC]: Ws
|
|
1131
|
+
},
|
|
1132
|
+
explorer: ""
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
var ce = /* @__PURE__ */ ((e) => (e.ARBITRUM = "ARBITRUM_MAINNET", e.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", e.AVALANCHE = "AVALANCHE_MAINNET", e.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", e.BASE = "BASE_MAINNET", e.BASE_TESTNET = "BASE_TESTNET", e.BSC = "BSC_MAINNET", e.ETHEREUM = "ETHEREUM_MAINNET", e.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", e.STARKNET = "STARKNET_MAINNET", e))(ce || {}), St = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(St || {});
|
|
1136
|
+
function Ys(e) {
|
|
1137
|
+
return Vs[ae[e || ""].chainId]?.decimals || 6;
|
|
1138
|
+
}
|
|
1139
|
+
const Xs = (e) => {
|
|
1140
|
+
const t = e?.trim().toUpperCase();
|
|
1141
|
+
if (ae[t])
|
|
1142
|
+
return ae[t];
|
|
1143
|
+
};
|
|
1144
|
+
function Js(e, t) {
|
|
1145
|
+
return Xs(e)?.tokens[t]?.address;
|
|
1146
|
+
}
|
|
1147
|
+
var we = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e))(we || {});
|
|
1148
|
+
class h {
|
|
1149
|
+
constructor({ api_key: t, env: s, seesion_token: n }) {
|
|
1150
|
+
this.api_key = t || "", this.sessionToken = n || "", this.env = s ?? we.PRODUCTION;
|
|
1151
|
+
}
|
|
1152
|
+
static async config(t) {
|
|
1153
|
+
if (!h.app) {
|
|
1154
|
+
if (!t)
|
|
1155
|
+
throw new Error("Please provide an api_key");
|
|
1156
|
+
h.app = new h(t);
|
|
533
1157
|
}
|
|
1158
|
+
return t && (t.api_key !== void 0 && (h.app.api_key = t.api_key), t.seesion_token !== void 0 && (h.app.sessionToken = t.seesion_token), t.env !== void 0 && (h.app.env = t.env)), h.app;
|
|
534
1159
|
}
|
|
535
1160
|
static getApiKey() {
|
|
536
|
-
if (!
|
|
1161
|
+
if (!h.app)
|
|
537
1162
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
538
|
-
return
|
|
1163
|
+
return h.app.api_key;
|
|
539
1164
|
}
|
|
540
|
-
static
|
|
541
|
-
|
|
1165
|
+
static getSessionToken() {
|
|
1166
|
+
if (!h.app)
|
|
1167
|
+
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1168
|
+
return h.app.sessionToken;
|
|
542
1169
|
}
|
|
543
1170
|
static getEnv() {
|
|
544
|
-
if (!
|
|
1171
|
+
if (!h.app)
|
|
545
1172
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
546
|
-
return
|
|
1173
|
+
return h.app.env === "internal" ? "staging" : h.app.env;
|
|
547
1174
|
}
|
|
548
1175
|
static getBaseUrl() {
|
|
549
|
-
if (!
|
|
1176
|
+
if (!h.app)
|
|
550
1177
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
551
|
-
switch (
|
|
1178
|
+
switch (h.app.env) {
|
|
552
1179
|
case "production":
|
|
553
1180
|
return "https://api.chainrails.io/api/v1";
|
|
554
1181
|
case "staging":
|
|
@@ -559,313 +1186,346 @@ class d {
|
|
|
559
1186
|
return "https://api.chainrails.io/api/v1";
|
|
560
1187
|
}
|
|
561
1188
|
}
|
|
562
|
-
static getPayModalUrl(
|
|
563
|
-
if (!
|
|
1189
|
+
static getPayModalUrl(t, s, n, r) {
|
|
1190
|
+
if (!h.app)
|
|
564
1191
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
565
|
-
const i =
|
|
1192
|
+
const i = h.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", o = r && r > 0 ? "/pay/" : "/deposit/", a = `_chain_/${t}/_token_/${s}/_to_/${n}${r ? "/_amount_/" + r * 100 : ""}`;
|
|
566
1193
|
return i + o + a;
|
|
567
1194
|
}
|
|
568
1195
|
}
|
|
569
|
-
let
|
|
570
|
-
function
|
|
571
|
-
|
|
572
|
-
prefixUrl:
|
|
1196
|
+
let ue = null;
|
|
1197
|
+
function Gs() {
|
|
1198
|
+
ue = as.create({
|
|
1199
|
+
prefixUrl: h.getBaseUrl(),
|
|
573
1200
|
headers: {
|
|
574
1201
|
"Content-Type": "application/json"
|
|
575
1202
|
},
|
|
576
1203
|
hooks: {
|
|
577
1204
|
beforeRequest: [
|
|
578
|
-
(
|
|
579
|
-
const
|
|
580
|
-
|
|
1205
|
+
(e) => {
|
|
1206
|
+
const t = h.getSessionToken() || h.getApiKey();
|
|
1207
|
+
e.headers.set("Authorization", `Bearer ${t}`);
|
|
581
1208
|
}
|
|
582
1209
|
],
|
|
583
|
-
afterResponse: [(
|
|
1210
|
+
afterResponse: [(e, t, s) => s]
|
|
584
1211
|
},
|
|
585
1212
|
retry: {
|
|
586
1213
|
limit: 2
|
|
587
1214
|
}
|
|
588
1215
|
});
|
|
589
1216
|
}
|
|
590
|
-
function
|
|
591
|
-
return
|
|
1217
|
+
function m() {
|
|
1218
|
+
return ue || Gs(), ue;
|
|
592
1219
|
}
|
|
593
|
-
class
|
|
594
|
-
async getById(
|
|
595
|
-
return await
|
|
1220
|
+
class Zs {
|
|
1221
|
+
async getById(t) {
|
|
1222
|
+
return await m().get("intents/" + t).json();
|
|
1223
|
+
}
|
|
1224
|
+
async getForSender(t) {
|
|
1225
|
+
return await m().get("intents/user/" + t).json();
|
|
1226
|
+
}
|
|
1227
|
+
async getForAddress(t) {
|
|
1228
|
+
return await m().get("intents/address/" + t).json();
|
|
596
1229
|
}
|
|
597
|
-
async
|
|
598
|
-
return await
|
|
1230
|
+
async getForSession(t) {
|
|
1231
|
+
return await m().get("modal/sessions/intents/" + t).json();
|
|
599
1232
|
}
|
|
600
|
-
async
|
|
601
|
-
return await
|
|
1233
|
+
async getAll(t) {
|
|
1234
|
+
return await m().get("intents", { searchParams: t }).json();
|
|
602
1235
|
}
|
|
603
|
-
async
|
|
604
|
-
return await
|
|
1236
|
+
async create(t) {
|
|
1237
|
+
return await m().post("intents", { json: t }).json();
|
|
605
1238
|
}
|
|
606
|
-
async
|
|
607
|
-
return await
|
|
1239
|
+
async createForSession(t) {
|
|
1240
|
+
return await m().post("modal/sessions/intents", { json: t }).json();
|
|
608
1241
|
}
|
|
609
|
-
async update(
|
|
610
|
-
return await
|
|
1242
|
+
async update(t, s) {
|
|
1243
|
+
return await m().post("intents", { json: s }).json();
|
|
611
1244
|
}
|
|
612
|
-
async triggerProcessing(
|
|
613
|
-
return await
|
|
1245
|
+
async triggerProcessing(t) {
|
|
1246
|
+
return await m().post(`intents/${t}/trigger-processing`).json();
|
|
1247
|
+
}
|
|
1248
|
+
async triggerProcessingForSession(t) {
|
|
1249
|
+
return await m().post(`modal/sessions/intents/${t}/process`).json();
|
|
614
1250
|
}
|
|
615
1251
|
}
|
|
616
|
-
class
|
|
617
|
-
async getFromSpecificBridge(
|
|
618
|
-
return await
|
|
1252
|
+
class Qs {
|
|
1253
|
+
async getFromSpecificBridge(t) {
|
|
1254
|
+
return await m().get("quotes/single", { searchParams: t }).json();
|
|
1255
|
+
}
|
|
1256
|
+
async getFromAllBridges(t) {
|
|
1257
|
+
return await m().get("quotes/multiple", { searchParams: t }).json();
|
|
619
1258
|
}
|
|
620
|
-
async
|
|
621
|
-
return await
|
|
1259
|
+
async getBestAcrossBridges(t) {
|
|
1260
|
+
return await m().get("quotes/best", { searchParams: t }).json();
|
|
622
1261
|
}
|
|
623
|
-
async
|
|
624
|
-
return await
|
|
1262
|
+
async getAll(t) {
|
|
1263
|
+
return await m().get("quotes/multi-source", { searchParams: t }).json();
|
|
625
1264
|
}
|
|
626
|
-
async
|
|
627
|
-
return await
|
|
1265
|
+
async getAllForSession(t) {
|
|
1266
|
+
return await m().get("modal/sessions/quotes", { searchParams: t }).json();
|
|
628
1267
|
}
|
|
629
1268
|
}
|
|
630
|
-
class
|
|
631
|
-
async getOptimalRoutes(
|
|
632
|
-
return await
|
|
1269
|
+
class en {
|
|
1270
|
+
async getOptimalRoutes(t) {
|
|
1271
|
+
return await m().get("router/optimal-route", { searchParams: t }).json();
|
|
633
1272
|
}
|
|
634
1273
|
async getAllSupportedBridges() {
|
|
635
|
-
return await
|
|
1274
|
+
return await m().get("router/supported-bridges/all").json();
|
|
636
1275
|
}
|
|
637
|
-
async getSupportedBridges(
|
|
638
|
-
return await
|
|
1276
|
+
async getSupportedBridges(t) {
|
|
1277
|
+
return await m().get("router/supported-bridges/route", { searchParams: t }).json();
|
|
639
1278
|
}
|
|
640
|
-
async getSupportedRoutes(
|
|
641
|
-
return await
|
|
1279
|
+
async getSupportedRoutes(t, s) {
|
|
1280
|
+
return await m().get("router/supported-bridges/bridge/" + t, { searchParams: s }).json();
|
|
642
1281
|
}
|
|
643
1282
|
}
|
|
644
|
-
class
|
|
645
|
-
async getSupported(
|
|
646
|
-
return await
|
|
1283
|
+
class tn {
|
|
1284
|
+
async getSupported(t) {
|
|
1285
|
+
return await m().get("chains", { searchParams: t }).json();
|
|
647
1286
|
}
|
|
648
1287
|
}
|
|
649
|
-
class
|
|
1288
|
+
class sn {
|
|
650
1289
|
async getClientInfo() {
|
|
651
|
-
return await
|
|
1290
|
+
return await m().get("client/auth/client-info").json();
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
class nn {
|
|
1294
|
+
getSessionToken(t) {
|
|
1295
|
+
const s = {
|
|
1296
|
+
recipient: t.recipient,
|
|
1297
|
+
tokenOut: Js(
|
|
1298
|
+
ce[t.destinationChain],
|
|
1299
|
+
St[t.token]
|
|
1300
|
+
),
|
|
1301
|
+
destinationChain: ce[t.destinationChain],
|
|
1302
|
+
amount: t.amount
|
|
1303
|
+
};
|
|
1304
|
+
return m().post("modal/sessions", { json: s }).json();
|
|
652
1305
|
}
|
|
653
1306
|
}
|
|
654
|
-
const
|
|
655
|
-
router: new
|
|
656
|
-
quotes: new
|
|
657
|
-
intents: new
|
|
658
|
-
chains: new
|
|
659
|
-
client: new
|
|
1307
|
+
const xn = {
|
|
1308
|
+
router: new en(),
|
|
1309
|
+
quotes: new Qs(),
|
|
1310
|
+
intents: new Zs(),
|
|
1311
|
+
chains: new tn(),
|
|
1312
|
+
client: new sn(),
|
|
1313
|
+
auth: new nn()
|
|
660
1314
|
};
|
|
661
|
-
function
|
|
662
|
-
var
|
|
663
|
-
if (typeof
|
|
664
|
-
else if (typeof
|
|
665
|
-
var
|
|
666
|
-
for (
|
|
667
|
-
} else for (s in
|
|
668
|
-
return
|
|
669
|
-
}
|
|
670
|
-
function
|
|
671
|
-
for (var
|
|
672
|
-
return
|
|
673
|
-
}
|
|
674
|
-
function
|
|
1315
|
+
function Rt(e) {
|
|
1316
|
+
var t, s, n = "";
|
|
1317
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
1318
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1319
|
+
var r = e.length;
|
|
1320
|
+
for (t = 0; t < r; t++) e[t] && (s = Rt(e[t])) && (n && (n += " "), n += s);
|
|
1321
|
+
} else for (s in e) e[s] && (n && (n += " "), n += s);
|
|
1322
|
+
return n;
|
|
1323
|
+
}
|
|
1324
|
+
function rn() {
|
|
1325
|
+
for (var e, t, s = 0, n = "", r = arguments.length; s < r; s++) (e = arguments[s]) && (t = Rt(e)) && (n && (n += " "), n += t);
|
|
1326
|
+
return n;
|
|
1327
|
+
}
|
|
1328
|
+
function kn(e) {
|
|
675
1329
|
const {
|
|
676
|
-
to:
|
|
1330
|
+
to: t,
|
|
677
1331
|
token: s,
|
|
678
|
-
chain:
|
|
679
|
-
amount:
|
|
1332
|
+
chain: n,
|
|
1333
|
+
amount: r,
|
|
680
1334
|
isOpen: i,
|
|
681
1335
|
isPending: o,
|
|
682
1336
|
open: a,
|
|
683
1337
|
close: c,
|
|
684
1338
|
onCancel: u,
|
|
685
|
-
onSuccess:
|
|
1339
|
+
onSuccess: l,
|
|
686
1340
|
data: w
|
|
687
|
-
} =
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
const
|
|
691
|
-
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow =
|
|
692
|
-
const
|
|
693
|
-
|
|
1341
|
+
} = e, [d, y] = Fe(!0), T = he(null);
|
|
1342
|
+
de(() => {
|
|
1343
|
+
f();
|
|
1344
|
+
const p = document.body.style.overflow;
|
|
1345
|
+
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = p || "";
|
|
1346
|
+
const g = (b) => {
|
|
1347
|
+
b.data === "closed" && (c(), u?.()), b.data === "completed" && (window.setTimeout(c, 2e3), l?.());
|
|
694
1348
|
};
|
|
695
|
-
return window.addEventListener("message",
|
|
696
|
-
document.body.style.overflow =
|
|
1349
|
+
return window.addEventListener("message", g), () => {
|
|
1350
|
+
document.body.style.overflow = p || "", window.removeEventListener("message", g);
|
|
697
1351
|
};
|
|
698
|
-
}, [i, u,
|
|
699
|
-
function
|
|
700
|
-
|
|
1352
|
+
}, [i, u, l]);
|
|
1353
|
+
function q() {
|
|
1354
|
+
y(!1), f();
|
|
701
1355
|
}
|
|
702
|
-
function
|
|
1356
|
+
function f() {
|
|
703
1357
|
if (!w?.sessionToken) return;
|
|
704
|
-
const
|
|
1358
|
+
const p = {
|
|
705
1359
|
type: "session",
|
|
706
1360
|
session_token: w.sessionToken,
|
|
707
|
-
environment:
|
|
1361
|
+
environment: h.getEnv() || we.PRODUCTION
|
|
708
1362
|
};
|
|
709
|
-
|
|
1363
|
+
T.current?.contentWindow?.postMessage(p, "https://app.chainrails.io"), T.current?.contentWindow?.postMessage(p, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
|
|
710
1364
|
}
|
|
711
|
-
return w?.sessionToken ? /* @__PURE__ */
|
|
712
|
-
className:
|
|
713
|
-
children: [(
|
|
1365
|
+
return w?.sessionToken ? /* @__PURE__ */ Pe("div", {
|
|
1366
|
+
className: rn("payment-modal-wrapper", d || o ? "loading" : "not-loading", i ? "open" : "closed"),
|
|
1367
|
+
children: [(d || o) && /* @__PURE__ */ U("div", {
|
|
714
1368
|
role: "status",
|
|
715
1369
|
className: "payment-modal-loader",
|
|
716
|
-
children: /* @__PURE__ */
|
|
1370
|
+
children: /* @__PURE__ */ Pe("svg", {
|
|
717
1371
|
"aria-hidden": "true",
|
|
718
1372
|
className: "icon",
|
|
719
1373
|
viewBox: "0 0 100 101",
|
|
720
1374
|
fill: "none",
|
|
721
1375
|
xmlns: "http://www.w3.org/2000/svg",
|
|
722
|
-
children: [/* @__PURE__ */
|
|
1376
|
+
children: [/* @__PURE__ */ U("path", {
|
|
723
1377
|
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
724
1378
|
fill: "currentColor"
|
|
725
|
-
}), /* @__PURE__ */
|
|
1379
|
+
}), /* @__PURE__ */ U("path", {
|
|
726
1380
|
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
727
1381
|
fill: "currentFill"
|
|
728
1382
|
})]
|
|
729
1383
|
})
|
|
730
|
-
}), /* @__PURE__ */
|
|
1384
|
+
}), /* @__PURE__ */ U("iframe", {
|
|
731
1385
|
allow: "clipboard-read *; clipboard-write *",
|
|
732
|
-
src:
|
|
733
|
-
onLoad:
|
|
734
|
-
className: `payment-modal ${
|
|
735
|
-
"data-id":
|
|
736
|
-
ref:
|
|
1386
|
+
src: h.getPayModalUrl(n, s, t, r),
|
|
1387
|
+
onLoad: q,
|
|
1388
|
+
className: `payment-modal ${d || o ? "invisible" : "visible"}`,
|
|
1389
|
+
"data-id": r,
|
|
1390
|
+
ref: T
|
|
737
1391
|
})]
|
|
738
|
-
}) : /* @__PURE__ */
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
1392
|
+
}) : /* @__PURE__ */ U(Bt, {});
|
|
1393
|
+
}
|
|
1394
|
+
function on(e) {
|
|
1395
|
+
return BigInt(e).toString();
|
|
1396
|
+
}
|
|
1397
|
+
function an(e, t) {
|
|
1398
|
+
return Number(e) * Math.pow(10, t);
|
|
1399
|
+
}
|
|
1400
|
+
const cn = Symbol(), be = Symbol(), x = "a", Tt = "f", _e = "p", At = "c", It = "t", Ee = "h", k = "w", Se = "o", Re = "k";
|
|
1401
|
+
let un = (e, t) => new Proxy(e, t);
|
|
1402
|
+
const le = Object.getPrototypeOf, fe = /* @__PURE__ */ new WeakMap(), vt = (e) => e && (fe.has(e) ? fe.get(e) : le(e) === Object.prototype || le(e) === Array.prototype), _ = (e) => typeof e == "object" && e !== null, ln = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), fn = (e) => {
|
|
1403
|
+
if (Array.isArray(e))
|
|
1404
|
+
return Array.from(e);
|
|
1405
|
+
const t = Object.getOwnPropertyDescriptors(e);
|
|
1406
|
+
return Object.values(t).forEach((s) => {
|
|
747
1407
|
s.configurable = !0;
|
|
748
|
-
}), Object.create(
|
|
749
|
-
},
|
|
1408
|
+
}), Object.create(le(e), t);
|
|
1409
|
+
}, hn = (e, t) => {
|
|
750
1410
|
const s = {
|
|
751
|
-
[
|
|
1411
|
+
[Tt]: t
|
|
752
1412
|
};
|
|
753
|
-
let
|
|
754
|
-
const
|
|
755
|
-
if (!
|
|
756
|
-
let u = s[
|
|
757
|
-
if (u || (u = {}, s[
|
|
758
|
-
u[
|
|
1413
|
+
let n = !1;
|
|
1414
|
+
const r = (a, c) => {
|
|
1415
|
+
if (!n) {
|
|
1416
|
+
let u = s[x].get(e);
|
|
1417
|
+
if (u || (u = {}, s[x].set(e, u)), a === k)
|
|
1418
|
+
u[k] = !0;
|
|
759
1419
|
else {
|
|
760
|
-
let
|
|
761
|
-
|
|
1420
|
+
let l = u[a];
|
|
1421
|
+
l || (l = /* @__PURE__ */ new Set(), u[a] = l), l.add(c);
|
|
762
1422
|
}
|
|
763
1423
|
}
|
|
764
1424
|
}, i = () => {
|
|
765
|
-
|
|
1425
|
+
n = !0, s[x].delete(e);
|
|
766
1426
|
}, o = {
|
|
767
1427
|
get(a, c) {
|
|
768
|
-
return c ===
|
|
1428
|
+
return c === be ? e : (r(Re, c), Pt(Reflect.get(a, c), s[x], s[At], s[It]));
|
|
769
1429
|
},
|
|
770
1430
|
has(a, c) {
|
|
771
|
-
return c ===
|
|
1431
|
+
return c === cn ? (i(), !0) : (r(Ee, c), Reflect.has(a, c));
|
|
772
1432
|
},
|
|
773
1433
|
getOwnPropertyDescriptor(a, c) {
|
|
774
|
-
return
|
|
1434
|
+
return r(Se, c), Reflect.getOwnPropertyDescriptor(a, c);
|
|
775
1435
|
},
|
|
776
1436
|
ownKeys(a) {
|
|
777
|
-
return
|
|
1437
|
+
return r(k), Reflect.ownKeys(a);
|
|
778
1438
|
}
|
|
779
1439
|
};
|
|
780
|
-
return
|
|
781
|
-
},
|
|
1440
|
+
return t && (o.set = o.deleteProperty = () => !1), [o, s];
|
|
1441
|
+
}, Te = (e) => (
|
|
782
1442
|
// unwrap proxy
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
),
|
|
786
|
-
if (!
|
|
787
|
-
return
|
|
788
|
-
let
|
|
789
|
-
if (!
|
|
790
|
-
const c =
|
|
791
|
-
|
|
1443
|
+
e[be] || // otherwise
|
|
1444
|
+
e
|
|
1445
|
+
), Pt = (e, t, s, n) => {
|
|
1446
|
+
if (!vt(e))
|
|
1447
|
+
return e;
|
|
1448
|
+
let r = n && n.get(e);
|
|
1449
|
+
if (!r) {
|
|
1450
|
+
const c = Te(e);
|
|
1451
|
+
ln(c) ? r = [c, fn(c)] : r = [c], n?.set(e, r);
|
|
792
1452
|
}
|
|
793
|
-
const [i, o] =
|
|
1453
|
+
const [i, o] = r;
|
|
794
1454
|
let a = s && s.get(i);
|
|
795
|
-
return (!a || a[1][
|
|
796
|
-
},
|
|
797
|
-
const s = Reflect.ownKeys(
|
|
798
|
-
return s.length !==
|
|
799
|
-
},
|
|
800
|
-
if (
|
|
1455
|
+
return (!a || a[1][Tt] !== !!o) && (a = hn(i, !!o), a[1][_e] = un(o || i, a[0]), s && s.set(i, a)), a[1][x] = t, a[1][At] = s, a[1][It] = n, a[1][_e];
|
|
1456
|
+
}, dn = (e, t) => {
|
|
1457
|
+
const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
|
|
1458
|
+
return s.length !== n.length || s.some((r, i) => r !== n[i]);
|
|
1459
|
+
}, Ut = (e, t, s, n, r = Object.is) => {
|
|
1460
|
+
if (r(e, t))
|
|
801
1461
|
return !1;
|
|
802
|
-
if (!
|
|
1462
|
+
if (!_(e) || !_(t))
|
|
803
1463
|
return !0;
|
|
804
|
-
const i = s.get(
|
|
1464
|
+
const i = s.get(Te(e));
|
|
805
1465
|
if (!i)
|
|
806
1466
|
return !0;
|
|
807
|
-
if (
|
|
808
|
-
if (
|
|
1467
|
+
if (n) {
|
|
1468
|
+
if (n.get(e) === t)
|
|
809
1469
|
return !1;
|
|
810
|
-
|
|
1470
|
+
n.set(e, t);
|
|
811
1471
|
}
|
|
812
1472
|
let o = null;
|
|
813
|
-
for (const a of i[
|
|
814
|
-
if (o = Reflect.has(
|
|
1473
|
+
for (const a of i[Ee] || [])
|
|
1474
|
+
if (o = Reflect.has(e, a) !== Reflect.has(t, a), o)
|
|
815
1475
|
return o;
|
|
816
|
-
if (i[
|
|
817
|
-
if (o =
|
|
1476
|
+
if (i[k] === !0) {
|
|
1477
|
+
if (o = dn(e, t), o)
|
|
818
1478
|
return o;
|
|
819
1479
|
} else
|
|
820
|
-
for (const a of i[
|
|
821
|
-
const c = !!Reflect.getOwnPropertyDescriptor(
|
|
1480
|
+
for (const a of i[Se] || []) {
|
|
1481
|
+
const c = !!Reflect.getOwnPropertyDescriptor(e, a), u = !!Reflect.getOwnPropertyDescriptor(t, a);
|
|
822
1482
|
if (o = c !== u, o)
|
|
823
1483
|
return o;
|
|
824
1484
|
}
|
|
825
|
-
for (const a of i[
|
|
826
|
-
if (o =
|
|
1485
|
+
for (const a of i[Re] || [])
|
|
1486
|
+
if (o = Ut(e[a], t[a], s, n, r), o)
|
|
827
1487
|
return o;
|
|
828
1488
|
if (o === null)
|
|
829
1489
|
throw new Error("invalid used");
|
|
830
1490
|
return o;
|
|
831
|
-
},
|
|
832
|
-
|
|
833
|
-
},
|
|
834
|
-
const
|
|
835
|
-
var c, u,
|
|
836
|
-
if (
|
|
1491
|
+
}, pn = (e) => vt(e) && e[be] || null, Le = (e, t = !0) => {
|
|
1492
|
+
fe.set(e, t);
|
|
1493
|
+
}, gn = (e, t, s) => {
|
|
1494
|
+
const n = [], r = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
|
|
1495
|
+
var c, u, l;
|
|
1496
|
+
if (r.has(o))
|
|
837
1497
|
return;
|
|
838
|
-
|
|
839
|
-
const w =
|
|
1498
|
+
_(o) && r.add(o);
|
|
1499
|
+
const w = _(o) && t.get(Te(o));
|
|
840
1500
|
if (w) {
|
|
841
|
-
if ((c = w[
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
}), w[
|
|
845
|
-
const
|
|
846
|
-
|
|
1501
|
+
if ((c = w[Ee]) === null || c === void 0 || c.forEach((d) => {
|
|
1502
|
+
const y = `:has(${String(d)})`;
|
|
1503
|
+
n.push(a ? [...a, y] : [y]);
|
|
1504
|
+
}), w[k] === !0) {
|
|
1505
|
+
const d = ":ownKeys";
|
|
1506
|
+
n.push(a ? [...a, d] : [d]);
|
|
847
1507
|
} else
|
|
848
|
-
(u = w[
|
|
849
|
-
const
|
|
850
|
-
|
|
1508
|
+
(u = w[Se]) === null || u === void 0 || u.forEach((d) => {
|
|
1509
|
+
const y = `:hasOwn(${String(d)})`;
|
|
1510
|
+
n.push(a ? [...a, y] : [y]);
|
|
851
1511
|
});
|
|
852
|
-
(
|
|
853
|
-
"value" in (Object.getOwnPropertyDescriptor(o,
|
|
1512
|
+
(l = w[Re]) === null || l === void 0 || l.forEach((d) => {
|
|
1513
|
+
"value" in (Object.getOwnPropertyDescriptor(o, d) || {}) && i(o[d], a ? [...a, d] : [d]);
|
|
854
1514
|
});
|
|
855
|
-
} else a &&
|
|
1515
|
+
} else a && n.push(a);
|
|
856
1516
|
};
|
|
857
|
-
return i(
|
|
858
|
-
},
|
|
859
|
-
const s =
|
|
860
|
-
if (s?.[0] ===
|
|
1517
|
+
return i(e), n;
|
|
1518
|
+
}, L = {}, Ae = (e) => typeof e == "object" && e !== null, mn = (e) => Ae(e) && !Ie.has(e) && (Array.isArray(e) || !(Symbol.iterator in e)) && !(e instanceof WeakMap) && !(e instanceof WeakSet) && !(e instanceof Error) && !(e instanceof Number) && !(e instanceof Date) && !(e instanceof String) && !(e instanceof RegExp) && !(e instanceof ArrayBuffer) && !(e instanceof Promise), Ct = (e, t) => {
|
|
1519
|
+
const s = ze.get(e);
|
|
1520
|
+
if (s?.[0] === t)
|
|
861
1521
|
return s[1];
|
|
862
|
-
const
|
|
863
|
-
return
|
|
864
|
-
if (Object.getOwnPropertyDescriptor(
|
|
1522
|
+
const n = Array.isArray(e) ? [] : Object.create(Object.getPrototypeOf(e));
|
|
1523
|
+
return Le(n, !0), ze.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
|
|
1524
|
+
if (Object.getOwnPropertyDescriptor(n, r))
|
|
865
1525
|
return;
|
|
866
|
-
const i = Reflect.get(
|
|
867
|
-
|
|
868
|
-
|
|
1526
|
+
const i = Reflect.get(e, r), { enumerable: o } = Reflect.getOwnPropertyDescriptor(
|
|
1527
|
+
e,
|
|
1528
|
+
r
|
|
869
1529
|
), a = {
|
|
870
1530
|
value: i,
|
|
871
1531
|
enumerable: o,
|
|
@@ -873,216 +1533,216 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
873
1533
|
// It's still non-writable, so it avoids assigning a value.
|
|
874
1534
|
configurable: !0
|
|
875
1535
|
};
|
|
876
|
-
if (
|
|
877
|
-
|
|
1536
|
+
if (Ie.has(i))
|
|
1537
|
+
Le(i, !1);
|
|
878
1538
|
else if (P.has(i)) {
|
|
879
1539
|
const [c, u] = P.get(
|
|
880
1540
|
i
|
|
881
1541
|
);
|
|
882
|
-
a.value =
|
|
1542
|
+
a.value = Ct(c, u());
|
|
883
1543
|
}
|
|
884
|
-
Object.defineProperty(
|
|
885
|
-
}), Object.preventExtensions(
|
|
886
|
-
},
|
|
887
|
-
deleteProperty(
|
|
888
|
-
const o = Reflect.get(
|
|
1544
|
+
Object.defineProperty(n, r, a);
|
|
1545
|
+
}), Object.preventExtensions(n);
|
|
1546
|
+
}, yn = (e, t, s, n) => ({
|
|
1547
|
+
deleteProperty(r, i) {
|
|
1548
|
+
const o = Reflect.get(r, i);
|
|
889
1549
|
s(i);
|
|
890
|
-
const a = Reflect.deleteProperty(
|
|
891
|
-
return a &&
|
|
1550
|
+
const a = Reflect.deleteProperty(r, i);
|
|
1551
|
+
return a && n(["delete", [i], o]), a;
|
|
892
1552
|
},
|
|
893
|
-
set(
|
|
894
|
-
const c = !
|
|
895
|
-
if (c && (
|
|
1553
|
+
set(r, i, o, a) {
|
|
1554
|
+
const c = !e() && Reflect.has(r, i), u = Reflect.get(r, i, a);
|
|
1555
|
+
if (c && (je(u, o) || z.has(o) && je(u, z.get(o))))
|
|
896
1556
|
return !0;
|
|
897
|
-
s(i),
|
|
898
|
-
const
|
|
899
|
-
return
|
|
900
|
-
}
|
|
901
|
-
}), P = /* @__PURE__ */ new WeakMap(),
|
|
902
|
-
let
|
|
903
|
-
function
|
|
904
|
-
if (!
|
|
1557
|
+
s(i), Ae(o) && (o = pn(o) || o);
|
|
1558
|
+
const l = !P.has(o) && bn(o) ? xt(o) : o;
|
|
1559
|
+
return t(i, l), Reflect.set(r, i, l, a), n(["set", [i], o, u]), !0;
|
|
1560
|
+
}
|
|
1561
|
+
}), P = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakSet(), ze = /* @__PURE__ */ new WeakMap(), Y = [1], z = /* @__PURE__ */ new WeakMap();
|
|
1562
|
+
let je = Object.is, wn = (e, t) => new Proxy(e, t), bn = mn, En = Ct, Sn = yn;
|
|
1563
|
+
function xt(e = {}) {
|
|
1564
|
+
if (!Ae(e))
|
|
905
1565
|
throw new Error("object required");
|
|
906
|
-
const
|
|
907
|
-
if (
|
|
908
|
-
return
|
|
909
|
-
let s =
|
|
910
|
-
const
|
|
911
|
-
s !==
|
|
1566
|
+
const t = z.get(e);
|
|
1567
|
+
if (t)
|
|
1568
|
+
return t;
|
|
1569
|
+
let s = Y[0];
|
|
1570
|
+
const n = /* @__PURE__ */ new Set(), r = (f, p = ++Y[0]) => {
|
|
1571
|
+
s !== p && (i = s = p, n.forEach((g) => g(f, p)));
|
|
912
1572
|
};
|
|
913
1573
|
let i = s;
|
|
914
|
-
const o = (
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
})), s), a = (
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
}, c = /* @__PURE__ */ new Map(), u = (
|
|
921
|
-
const
|
|
922
|
-
if (
|
|
923
|
-
if ((
|
|
1574
|
+
const o = (f = Y[0]) => (i !== f && (i = f, c.forEach(([p]) => {
|
|
1575
|
+
const g = p[1](f);
|
|
1576
|
+
g > s && (s = g);
|
|
1577
|
+
})), s), a = (f) => (p, g) => {
|
|
1578
|
+
const b = [...p];
|
|
1579
|
+
b[1] = [f, ...b[1]], r(b, g);
|
|
1580
|
+
}, c = /* @__PURE__ */ new Map(), u = (f, p) => {
|
|
1581
|
+
const g = !Ie.has(p) && P.get(p);
|
|
1582
|
+
if (g) {
|
|
1583
|
+
if ((L ? "production" : void 0) !== "production" && c.has(f))
|
|
924
1584
|
throw new Error("prop listener already exists");
|
|
925
|
-
if (
|
|
926
|
-
const
|
|
927
|
-
c.set(
|
|
1585
|
+
if (n.size) {
|
|
1586
|
+
const b = g[2](a(f));
|
|
1587
|
+
c.set(f, [g, b]);
|
|
928
1588
|
} else
|
|
929
|
-
c.set(
|
|
1589
|
+
c.set(f, [g]);
|
|
930
1590
|
}
|
|
931
|
-
},
|
|
932
|
-
var
|
|
933
|
-
const
|
|
934
|
-
|
|
935
|
-
}, w = (
|
|
936
|
-
if ((
|
|
1591
|
+
}, l = (f) => {
|
|
1592
|
+
var p;
|
|
1593
|
+
const g = c.get(f);
|
|
1594
|
+
g && (c.delete(f), (p = g[1]) == null || p.call(g));
|
|
1595
|
+
}, w = (f) => (n.add(f), n.size === 1 && c.forEach(([g, b], D) => {
|
|
1596
|
+
if ((L ? "production" : void 0) !== "production" && b)
|
|
937
1597
|
throw new Error("remove already exists");
|
|
938
|
-
const
|
|
939
|
-
c.set(
|
|
1598
|
+
const kt = g[2](a(D));
|
|
1599
|
+
c.set(D, [g, kt]);
|
|
940
1600
|
}), () => {
|
|
941
|
-
|
|
942
|
-
|
|
1601
|
+
n.delete(f), n.size === 0 && c.forEach(([g, b], D) => {
|
|
1602
|
+
b && (b(), c.set(D, [g]));
|
|
943
1603
|
});
|
|
944
1604
|
});
|
|
945
|
-
let
|
|
946
|
-
const
|
|
947
|
-
() =>
|
|
1605
|
+
let d = !0;
|
|
1606
|
+
const y = Sn(
|
|
1607
|
+
() => d,
|
|
948
1608
|
u,
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
),
|
|
952
|
-
|
|
953
|
-
const
|
|
954
|
-
return P.set(
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
|
|
1609
|
+
l,
|
|
1610
|
+
r
|
|
1611
|
+
), T = wn(e, y);
|
|
1612
|
+
z.set(e, T);
|
|
1613
|
+
const q = [e, o, w];
|
|
1614
|
+
return P.set(T, q), Reflect.ownKeys(e).forEach((f) => {
|
|
1615
|
+
const p = Object.getOwnPropertyDescriptor(
|
|
1616
|
+
e,
|
|
1617
|
+
f
|
|
958
1618
|
);
|
|
959
|
-
"value" in
|
|
960
|
-
}),
|
|
961
|
-
}
|
|
962
|
-
function
|
|
963
|
-
const
|
|
964
|
-
(
|
|
965
|
-
let
|
|
966
|
-
const i = [], o =
|
|
1619
|
+
"value" in p && p.writable && (T[f] = e[f]);
|
|
1620
|
+
}), d = !1, T;
|
|
1621
|
+
}
|
|
1622
|
+
function Rn(e, t, s) {
|
|
1623
|
+
const n = P.get(e);
|
|
1624
|
+
(L ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
|
|
1625
|
+
let r;
|
|
1626
|
+
const i = [], o = n[2];
|
|
967
1627
|
let a = !1;
|
|
968
|
-
const u = o((
|
|
969
|
-
i.push(
|
|
970
|
-
|
|
1628
|
+
const u = o((l) => {
|
|
1629
|
+
i.push(l), r || (r = Promise.resolve().then(() => {
|
|
1630
|
+
r = void 0, a && t(i.splice(0));
|
|
971
1631
|
}));
|
|
972
1632
|
});
|
|
973
1633
|
return a = !0, () => {
|
|
974
1634
|
a = !1, u();
|
|
975
1635
|
};
|
|
976
1636
|
}
|
|
977
|
-
function
|
|
978
|
-
const
|
|
979
|
-
(
|
|
980
|
-
const [s,
|
|
981
|
-
return
|
|
982
|
-
}
|
|
983
|
-
const
|
|
984
|
-
const s =
|
|
985
|
-
|
|
986
|
-
s.current =
|
|
987
|
-
}),
|
|
988
|
-
},
|
|
989
|
-
function
|
|
990
|
-
const
|
|
991
|
-
() =>
|
|
992
|
-
[
|
|
993
|
-
),
|
|
1637
|
+
function qe(e) {
|
|
1638
|
+
const t = P.get(e);
|
|
1639
|
+
(L ? "production" : void 0) !== "production" && !t && console.warn("Please use proxy object");
|
|
1640
|
+
const [s, n] = t;
|
|
1641
|
+
return En(s, n());
|
|
1642
|
+
}
|
|
1643
|
+
const Tn = {}, An = (e, t) => {
|
|
1644
|
+
const s = he(void 0);
|
|
1645
|
+
de(() => {
|
|
1646
|
+
s.current = gn(e, t);
|
|
1647
|
+
}), Mt(s.current);
|
|
1648
|
+
}, In = An, vn = /* @__PURE__ */ new WeakMap();
|
|
1649
|
+
function Pn(e, t) {
|
|
1650
|
+
const n = ve(
|
|
1651
|
+
() => e && /* @__PURE__ */ new WeakMap(),
|
|
1652
|
+
[e]
|
|
1653
|
+
), r = he(void 0);
|
|
994
1654
|
let i = !0;
|
|
995
|
-
const o =
|
|
996
|
-
|
|
1655
|
+
const o = Ot(
|
|
1656
|
+
Dt(
|
|
997
1657
|
(c) => {
|
|
998
|
-
const u =
|
|
1658
|
+
const u = Rn(e, c);
|
|
999
1659
|
return c(), u;
|
|
1000
1660
|
},
|
|
1001
|
-
[
|
|
1661
|
+
[e, void 0]
|
|
1002
1662
|
),
|
|
1003
1663
|
() => {
|
|
1004
|
-
const c =
|
|
1664
|
+
const c = qe(e);
|
|
1005
1665
|
try {
|
|
1006
|
-
if (!i &&
|
|
1007
|
-
|
|
1666
|
+
if (!i && r.current && !Ut(
|
|
1667
|
+
r.current,
|
|
1008
1668
|
c,
|
|
1009
|
-
|
|
1669
|
+
n,
|
|
1010
1670
|
/* @__PURE__ */ new WeakMap()
|
|
1011
1671
|
))
|
|
1012
|
-
return
|
|
1672
|
+
return r.current;
|
|
1013
1673
|
} catch {
|
|
1014
1674
|
}
|
|
1015
1675
|
return c;
|
|
1016
1676
|
},
|
|
1017
|
-
() =>
|
|
1677
|
+
() => qe(e)
|
|
1018
1678
|
);
|
|
1019
|
-
i = !1,
|
|
1020
|
-
|
|
1021
|
-
}), (
|
|
1022
|
-
const a =
|
|
1023
|
-
return
|
|
1679
|
+
i = !1, Nt(() => {
|
|
1680
|
+
r.current = o;
|
|
1681
|
+
}), (Tn ? "production" : void 0) !== "production" && In(o, n);
|
|
1682
|
+
const a = ve(() => /* @__PURE__ */ new WeakMap(), []);
|
|
1683
|
+
return Pt(o, n, a, vn);
|
|
1024
1684
|
}
|
|
1025
|
-
const
|
|
1685
|
+
const I = xt({
|
|
1026
1686
|
data: null,
|
|
1027
1687
|
isPending: !1,
|
|
1028
1688
|
error: null
|
|
1029
1689
|
});
|
|
1030
|
-
function
|
|
1031
|
-
auth_url:
|
|
1032
|
-
chain:
|
|
1690
|
+
function On({
|
|
1691
|
+
auth_url: e,
|
|
1692
|
+
chain: t,
|
|
1033
1693
|
token: s,
|
|
1034
|
-
amount:
|
|
1035
|
-
to:
|
|
1694
|
+
amount: n,
|
|
1695
|
+
to: r,
|
|
1036
1696
|
onCancel: i,
|
|
1037
1697
|
onSuccess: o
|
|
1038
1698
|
}) {
|
|
1039
|
-
const a =
|
|
1040
|
-
function
|
|
1699
|
+
const a = Pn(I), [c, u] = Fe(!1);
|
|
1700
|
+
function l() {
|
|
1041
1701
|
u(!0);
|
|
1042
1702
|
}
|
|
1043
1703
|
function w() {
|
|
1044
1704
|
u(!1);
|
|
1045
1705
|
}
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1706
|
+
const d = () => {
|
|
1707
|
+
I.isPending = !0, I.error = null, fetch(e, {
|
|
1048
1708
|
method: "POST",
|
|
1049
1709
|
headers: {
|
|
1050
1710
|
"Content-Type": "application/json"
|
|
1051
1711
|
},
|
|
1052
1712
|
body: JSON.stringify({
|
|
1053
|
-
chain:
|
|
1713
|
+
chain: t,
|
|
1054
1714
|
token: s,
|
|
1055
|
-
amount:
|
|
1056
|
-
to:
|
|
1715
|
+
amount: n ? on(an(n, Ys(t))) : "0",
|
|
1716
|
+
to: r
|
|
1057
1717
|
})
|
|
1058
|
-
}).then((
|
|
1059
|
-
|
|
1060
|
-
api_key:
|
|
1061
|
-
}),
|
|
1062
|
-
}).catch((
|
|
1063
|
-
|
|
1718
|
+
}).then((y) => y.json()).then((y) => {
|
|
1719
|
+
I.data = y, h.config({
|
|
1720
|
+
api_key: y.sessionToken
|
|
1721
|
+
}), I.isPending = !1;
|
|
1722
|
+
}).catch((y) => {
|
|
1723
|
+
I.error = y?.toString(), I.isPending = !1;
|
|
1064
1724
|
});
|
|
1065
1725
|
};
|
|
1066
|
-
return
|
|
1067
|
-
|
|
1068
|
-
}, [
|
|
1726
|
+
return de(() => {
|
|
1727
|
+
d();
|
|
1728
|
+
}, [t, s, n, r]), {
|
|
1069
1729
|
...a,
|
|
1070
|
-
chain:
|
|
1730
|
+
chain: t,
|
|
1071
1731
|
token: s,
|
|
1072
|
-
to:
|
|
1732
|
+
to: r,
|
|
1073
1733
|
isOpen: c,
|
|
1074
|
-
open:
|
|
1734
|
+
open: l,
|
|
1075
1735
|
close: w,
|
|
1076
|
-
refetch:
|
|
1736
|
+
refetch: d,
|
|
1077
1737
|
onSuccess: o,
|
|
1078
1738
|
onCancel: i
|
|
1079
1739
|
};
|
|
1080
1740
|
}
|
|
1081
1741
|
export {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1742
|
+
h as Chainrails,
|
|
1743
|
+
kn as PaymentModal,
|
|
1744
|
+
ce as chains,
|
|
1745
|
+
xn as crapi,
|
|
1746
|
+
St as tokens,
|
|
1747
|
+
On as usePaymentSession
|
|
1088
1748
|
};
|