@chainrails/react 0.2.19 → 0.2.21
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/PaymentModal/index.d.ts.map +1 -1
- package/dist/chainrails-sdk.es.js +113 -111
- package/dist/chainrails-sdk.es.mjs +113 -111
- package/dist/chainrails-sdk.umd.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PaymentModal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAC;AAE1D,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PaymentModal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAC;AAE1D,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA6FpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,UAAU,CAAC;KACxB;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as U, useRef as re, useEffect as k, useMemo as ye, useSyncExternalStore as Rt, useCallback as At, useLayoutEffect as vt, useDebugValue as Pt } from "react";
|
|
2
2
|
import { jsxs as we, jsx as B } from "react/jsx-runtime";
|
|
3
3
|
import './index.css';class G extends Error {
|
|
4
4
|
response;
|
|
@@ -164,9 +164,9 @@ const Dt = (e) => new Le(e), Ot = {
|
|
|
164
164
|
duplex: "half",
|
|
165
165
|
body: je(e.body, n, t)
|
|
166
166
|
});
|
|
167
|
-
},
|
|
167
|
+
}, I = (e) => e !== null && typeof e == "object", $ = (...e) => {
|
|
168
168
|
for (const t of e)
|
|
169
|
-
if ((!
|
|
169
|
+
if ((!I(t) || Array.isArray(t)) && t !== void 0)
|
|
170
170
|
throw new TypeError("The `options` argument must be an object");
|
|
171
171
|
return oe({}, ...e);
|
|
172
172
|
}, _e = (e = {}, t = {}) => {
|
|
@@ -196,7 +196,7 @@ const qe = (e = {}, t = {}) => ({
|
|
|
196
196
|
throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");
|
|
197
197
|
s.append(String(r[0]), String(r[1]));
|
|
198
198
|
}
|
|
199
|
-
else if (
|
|
199
|
+
else if (I(n))
|
|
200
200
|
for (const [r, i] of Object.entries(n))
|
|
201
201
|
i !== void 0 && s.append(r, String(i));
|
|
202
202
|
else {
|
|
@@ -211,14 +211,14 @@ const qe = (e = {}, t = {}) => ({
|
|
|
211
211
|
for (const o of e)
|
|
212
212
|
if (Array.isArray(o))
|
|
213
213
|
Array.isArray(t) || (t = []), t = [...t, ...o];
|
|
214
|
-
else if (
|
|
214
|
+
else if (I(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 && (!I(c) || Array.isArray(c)))
|
|
222
222
|
throw new TypeError("The `context` option must be an object");
|
|
223
223
|
t = {
|
|
224
224
|
...t,
|
|
@@ -230,9 +230,9 @@ const qe = (e = {}, t = {}) => ({
|
|
|
230
230
|
c == null ? r = void 0 : r = r === void 0 ? c : Lt(r, c);
|
|
231
231
|
continue;
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
I(c) && a in t && (c = oe(t[a], c)), t = { ...t, [a]: c };
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
I(o.hooks) && (n = qe(n, o.hooks), t.hooks = n), I(o.headers) && (s = _e(s, o.headers), t.headers = s);
|
|
236
236
|
}
|
|
237
237
|
return r !== void 0 && (t.searchParams = r), i.length > 0 && (i.length === 1 ? t.signal = i[0] : Be ? t.signal = AbortSignal.any(i) : t.signal = i.at(-1)), t.context === void 0 && (t.context = {}), t;
|
|
238
238
|
}, jt = (e) => $e.includes(e) ? e.toUpperCase() : e, _t = ["get", "put", "head", "delete", "options", "trace"], qt = [408, 413, 429, 500, 502, 503, 504], Ft = [413, 429, 503], Ee = {
|
|
@@ -816,12 +816,12 @@ function Ss(e) {
|
|
|
816
816
|
const t = (n) => e().update(ot(n)).digest(), s = e();
|
|
817
817
|
return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
|
|
818
818
|
}
|
|
819
|
-
const Ts = BigInt(0),
|
|
820
|
-
for (let e = 0, t =
|
|
819
|
+
const Ts = BigInt(0), x = BigInt(1), Rs = BigInt(2), As = BigInt(7), vs = BigInt(256), Ps = BigInt(113), it = [], at = [], ct = [];
|
|
820
|
+
for (let e = 0, t = x, s = 1, n = 0; e < 24; e++) {
|
|
821
821
|
[s, n] = [n, (2 * s + 3 * n) % 5], it.push(2 * (5 * n + s)), at.push((e + 1) * (e + 2) / 2 % 64);
|
|
822
822
|
let r = Ts;
|
|
823
823
|
for (let i = 0; i < 7; i++)
|
|
824
|
-
t = (t <<
|
|
824
|
+
t = (t << x ^ (t >> As) * Ps) % vs, t & Rs && (r ^= x << (x << /* @__PURE__ */ BigInt(i)) - x);
|
|
825
825
|
ct.push(r);
|
|
826
826
|
}
|
|
827
827
|
const ut = cs(ct, !0), Is = ut[0], Us = ut[1], Ie = (e, t, s) => s > 32 ? fs(e, t, s) : us(e, t, s), Ue = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s);
|
|
@@ -831,9 +831,9 @@ function Cs(e, t = 24) {
|
|
|
831
831
|
for (let o = 0; o < 10; o++)
|
|
832
832
|
s[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
|
|
833
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 = Ie(u, l, 1) ^ s[a],
|
|
834
|
+
const a = (o + 8) % 10, c = (o + 2) % 10, u = s[c], l = s[c + 1], w = Ie(u, l, 1) ^ s[a], p = Ue(u, l, 1) ^ s[a + 1];
|
|
835
835
|
for (let y = 0; y < 50; y += 10)
|
|
836
|
-
e[o + y] ^= w, e[o + y + 1] ^=
|
|
836
|
+
e[o + y] ^= w, e[o + y + 1] ^= p;
|
|
837
837
|
}
|
|
838
838
|
let r = e[2], i = e[3];
|
|
839
839
|
for (let o = 0; o < 24; o++) {
|
|
@@ -1132,37 +1132,37 @@ function Vs(e, t) {
|
|
|
1132
1132
|
return Ws(e)?.tokens[t]?.address;
|
|
1133
1133
|
}
|
|
1134
1134
|
var ue = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e))(ue || {});
|
|
1135
|
-
class
|
|
1135
|
+
class h {
|
|
1136
1136
|
constructor({ api_key: t, env: s, seesion_token: n }) {
|
|
1137
1137
|
this.api_key = t || "", this.sessionToken = n || "", this.env = s ?? ue.PRODUCTION;
|
|
1138
1138
|
}
|
|
1139
1139
|
static async config(t) {
|
|
1140
|
-
if (!
|
|
1140
|
+
if (!h.app) {
|
|
1141
1141
|
if (!t)
|
|
1142
1142
|
throw new Error("Please provide an api_key");
|
|
1143
|
-
|
|
1143
|
+
h.app = new h(t);
|
|
1144
1144
|
}
|
|
1145
|
-
return t && (t.api_key !== void 0 && (
|
|
1145
|
+
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;
|
|
1146
1146
|
}
|
|
1147
1147
|
static getApiKey() {
|
|
1148
|
-
if (!
|
|
1148
|
+
if (!h.app)
|
|
1149
1149
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1150
|
-
return
|
|
1150
|
+
return h.app.api_key;
|
|
1151
1151
|
}
|
|
1152
1152
|
static getSessionToken() {
|
|
1153
|
-
if (!
|
|
1153
|
+
if (!h.app)
|
|
1154
1154
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1155
|
-
return
|
|
1155
|
+
return h.app.sessionToken;
|
|
1156
1156
|
}
|
|
1157
1157
|
static getEnv() {
|
|
1158
|
-
if (!
|
|
1158
|
+
if (!h.app)
|
|
1159
1159
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1160
|
-
return
|
|
1160
|
+
return h.app.env === "internal" ? "staging" : h.app.env;
|
|
1161
1161
|
}
|
|
1162
1162
|
static getBaseUrl() {
|
|
1163
|
-
if (!
|
|
1163
|
+
if (!h.app)
|
|
1164
1164
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1165
|
-
switch (
|
|
1165
|
+
switch (h.app.env) {
|
|
1166
1166
|
case "production":
|
|
1167
1167
|
return "https://api.chainrails.io/api/v1";
|
|
1168
1168
|
case "staging":
|
|
@@ -1174,23 +1174,23 @@ class f {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
1176
|
static getPayModalUrl(t) {
|
|
1177
|
-
if (!
|
|
1177
|
+
if (!h.app)
|
|
1178
1178
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1179
|
-
const s =
|
|
1179
|
+
const s = h.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(t), r = t && !isNaN(Number(t)) && n > 0 ? "/pay/" : "/deposit/", i = `${t && !isNaN(Number(t)) && n > 0 ? n * 100 : ""}`;
|
|
1180
1180
|
return s + r + i;
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
1183
|
let te = null;
|
|
1184
1184
|
function Ys() {
|
|
1185
1185
|
te = Gt.create({
|
|
1186
|
-
prefixUrl:
|
|
1186
|
+
prefixUrl: h.getBaseUrl(),
|
|
1187
1187
|
headers: {
|
|
1188
1188
|
"Content-Type": "application/json"
|
|
1189
1189
|
},
|
|
1190
1190
|
hooks: {
|
|
1191
1191
|
beforeRequest: [
|
|
1192
1192
|
(e) => {
|
|
1193
|
-
const t =
|
|
1193
|
+
const t = h.getSessionToken() || h.getApiKey();
|
|
1194
1194
|
e.headers.set("Authorization", `Bearer ${t}`);
|
|
1195
1195
|
}
|
|
1196
1196
|
],
|
|
@@ -1327,34 +1327,36 @@ function Pn(e) {
|
|
|
1327
1327
|
onSuccess: c,
|
|
1328
1328
|
session_url: u,
|
|
1329
1329
|
sessionToken: l
|
|
1330
|
-
} = e, [w,
|
|
1331
|
-
|
|
1330
|
+
} = e, [w, p] = U(0), [y, b] = U(""), P = re(null);
|
|
1331
|
+
h.config({
|
|
1332
1332
|
api_key: "",
|
|
1333
1333
|
// @ts-expect-error
|
|
1334
1334
|
env: e.env === "internal" ? "internal" : "production"
|
|
1335
|
-
}),
|
|
1336
|
-
|
|
1337
|
-
|
|
1335
|
+
}), k(() => {
|
|
1336
|
+
b(h.getPayModalUrl(t));
|
|
1337
|
+
}, [t]), k(() => {
|
|
1338
|
+
const f = document.body.style.overflow;
|
|
1339
|
+
n ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = f || "";
|
|
1338
1340
|
const g = (E) => {
|
|
1339
1341
|
E.data === "closed" && (o(), a?.()), E.data === "completed" && (window.setTimeout(o, 2e3), c?.());
|
|
1340
1342
|
};
|
|
1341
1343
|
return window.addEventListener("message", g), () => {
|
|
1342
|
-
document.body.style.overflow =
|
|
1344
|
+
document.body.style.overflow = f || "", window.removeEventListener("message", g);
|
|
1343
1345
|
};
|
|
1344
|
-
}, [n, a, c]),
|
|
1346
|
+
}, [n, a, c]), k(() => {
|
|
1345
1347
|
if (!l) return;
|
|
1346
|
-
const
|
|
1348
|
+
const f = {
|
|
1347
1349
|
type: "session",
|
|
1348
1350
|
session_token: l,
|
|
1349
|
-
environment:
|
|
1351
|
+
environment: h.getEnv() || ue.PRODUCTION,
|
|
1350
1352
|
styles: s
|
|
1351
1353
|
};
|
|
1352
|
-
window.setTimeout(() => {
|
|
1353
|
-
|
|
1354
|
-
},
|
|
1354
|
+
P.current?.contentWindow?.postMessage(f, "https://app.chainrails.io"), P.current?.contentWindow?.postMessage(f, "https://chainrails-frontend-git-staging-horus-labs.vercel.app"), window.setTimeout(() => {
|
|
1355
|
+
P.current?.contentWindow?.postMessage(f, "https://app.chainrails.io"), P.current?.contentWindow?.postMessage(f, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
|
|
1356
|
+
}, 200);
|
|
1355
1357
|
}, [l, w, n, s]);
|
|
1356
|
-
function
|
|
1357
|
-
|
|
1358
|
+
function d() {
|
|
1359
|
+
p(Math.random());
|
|
1358
1360
|
}
|
|
1359
1361
|
return /* @__PURE__ */ we("div", {
|
|
1360
1362
|
className: tn("payment-modal-wrapper", w === 0 || r ? "loading" : "not-loading", n ? "open" : "closed"),
|
|
@@ -1377,15 +1379,15 @@ function Pn(e) {
|
|
|
1377
1379
|
})
|
|
1378
1380
|
}), /* @__PURE__ */ B("iframe", {
|
|
1379
1381
|
allow: "clipboard-read *; clipboard-write *",
|
|
1380
|
-
src:
|
|
1381
|
-
onLoad:
|
|
1382
|
+
src: y || void 0,
|
|
1383
|
+
onLoad: d,
|
|
1382
1384
|
className: `payment-modal ${w === 0 || r ? "invisible" : "visible"}`,
|
|
1383
1385
|
"data-id": t,
|
|
1384
|
-
ref:
|
|
1385
|
-
},
|
|
1386
|
+
ref: P
|
|
1387
|
+
}, t)]
|
|
1386
1388
|
});
|
|
1387
1389
|
}
|
|
1388
|
-
const sn = Symbol(), le = Symbol(),
|
|
1390
|
+
const sn = Symbol(), le = Symbol(), D = "a", pt = "f", ke = "p", gt = "c", mt = "t", fe = "h", O = "w", he = "o", de = "k";
|
|
1389
1391
|
let nn = (e, t) => new Proxy(e, t);
|
|
1390
1392
|
const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (ne.has(e) ? ne.get(e) : se(e) === Object.prototype || se(e) === Array.prototype), _ = (e) => typeof e == "object" && e !== null, rn = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), on = (e) => {
|
|
1391
1393
|
if (Array.isArray(e))
|
|
@@ -1401,19 +1403,19 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1401
1403
|
let n = !1;
|
|
1402
1404
|
const r = (a, c) => {
|
|
1403
1405
|
if (!n) {
|
|
1404
|
-
let u = s[
|
|
1405
|
-
if (u || (u = {}, s[
|
|
1406
|
-
u[
|
|
1406
|
+
let u = s[D].get(e);
|
|
1407
|
+
if (u || (u = {}, s[D].set(e, u)), a === O)
|
|
1408
|
+
u[O] = !0;
|
|
1407
1409
|
else {
|
|
1408
1410
|
let l = u[a];
|
|
1409
1411
|
l || (l = /* @__PURE__ */ new Set(), u[a] = l), l.add(c);
|
|
1410
1412
|
}
|
|
1411
1413
|
}
|
|
1412
1414
|
}, i = () => {
|
|
1413
|
-
n = !0, s[
|
|
1415
|
+
n = !0, s[D].delete(e);
|
|
1414
1416
|
}, o = {
|
|
1415
1417
|
get(a, c) {
|
|
1416
|
-
return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[
|
|
1418
|
+
return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[D], s[gt], s[mt]));
|
|
1417
1419
|
},
|
|
1418
1420
|
has(a, c) {
|
|
1419
1421
|
return c === sn ? (i(), !0) : (r(fe, c), Reflect.has(a, c));
|
|
@@ -1422,7 +1424,7 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1422
1424
|
return r(he, c), Reflect.getOwnPropertyDescriptor(a, c);
|
|
1423
1425
|
},
|
|
1424
1426
|
ownKeys(a) {
|
|
1425
|
-
return r(
|
|
1427
|
+
return r(O), Reflect.ownKeys(a);
|
|
1426
1428
|
}
|
|
1427
1429
|
};
|
|
1428
1430
|
return t && (o.set = o.deleteProperty = () => !1), [o, s];
|
|
@@ -1440,7 +1442,7 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1440
1442
|
}
|
|
1441
1443
|
const [i, o] = r;
|
|
1442
1444
|
let a = s && s.get(i);
|
|
1443
|
-
return (!a || a[1][pt] !== !!o) && (a = an(i, !!o), a[1][ke] = nn(o || i, a[0]), s && s.set(i, a)), a[1][
|
|
1445
|
+
return (!a || a[1][pt] !== !!o) && (a = an(i, !!o), a[1][ke] = nn(o || i, a[0]), s && s.set(i, a)), a[1][D] = t, a[1][gt] = s, a[1][mt] = n, a[1][ke];
|
|
1444
1446
|
}, cn = (e, t) => {
|
|
1445
1447
|
const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
|
|
1446
1448
|
return s.length !== n.length || s.some((r, i) => r !== n[i]);
|
|
@@ -1461,7 +1463,7 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1461
1463
|
for (const a of i[fe] || [])
|
|
1462
1464
|
if (o = Reflect.has(e, a) !== Reflect.has(t, a), o)
|
|
1463
1465
|
return o;
|
|
1464
|
-
if (i[
|
|
1466
|
+
if (i[O] === !0) {
|
|
1465
1467
|
if (o = cn(e, t), o)
|
|
1466
1468
|
return o;
|
|
1467
1469
|
} else
|
|
@@ -1486,19 +1488,19 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1486
1488
|
_(o) && r.add(o);
|
|
1487
1489
|
const w = _(o) && t.get(pe(o));
|
|
1488
1490
|
if (w) {
|
|
1489
|
-
if ((c = w[fe]) === null || c === void 0 || c.forEach((
|
|
1490
|
-
const y = `:has(${String(
|
|
1491
|
+
if ((c = w[fe]) === null || c === void 0 || c.forEach((p) => {
|
|
1492
|
+
const y = `:has(${String(p)})`;
|
|
1491
1493
|
n.push(a ? [...a, y] : [y]);
|
|
1492
|
-
}), w[
|
|
1493
|
-
const
|
|
1494
|
-
n.push(a ? [...a,
|
|
1494
|
+
}), w[O] === !0) {
|
|
1495
|
+
const p = ":ownKeys";
|
|
1496
|
+
n.push(a ? [...a, p] : [p]);
|
|
1495
1497
|
} else
|
|
1496
|
-
(u = w[he]) === null || u === void 0 || u.forEach((
|
|
1497
|
-
const y = `:hasOwn(${String(
|
|
1498
|
+
(u = w[he]) === null || u === void 0 || u.forEach((p) => {
|
|
1499
|
+
const y = `:hasOwn(${String(p)})`;
|
|
1498
1500
|
n.push(a ? [...a, y] : [y]);
|
|
1499
1501
|
});
|
|
1500
|
-
(l = w[de]) === null || l === void 0 || l.forEach((
|
|
1501
|
-
"value" in (Object.getOwnPropertyDescriptor(o,
|
|
1502
|
+
(l = w[de]) === null || l === void 0 || l.forEach((p) => {
|
|
1503
|
+
"value" in (Object.getOwnPropertyDescriptor(o, p) || {}) && i(o[p], a ? [...a, p] : [p]);
|
|
1502
1504
|
});
|
|
1503
1505
|
} else a && n.push(a);
|
|
1504
1506
|
};
|
|
@@ -1523,8 +1525,8 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1523
1525
|
};
|
|
1524
1526
|
if (me.has(i))
|
|
1525
1527
|
xe(i, !1);
|
|
1526
|
-
else if (
|
|
1527
|
-
const [c, u] =
|
|
1528
|
+
else if (C.has(i)) {
|
|
1529
|
+
const [c, u] = C.get(
|
|
1528
1530
|
i
|
|
1529
1531
|
);
|
|
1530
1532
|
a.value = Et(c, u());
|
|
@@ -1543,10 +1545,10 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1543
1545
|
if (c && (Oe(u, o) || F.has(o) && Oe(u, F.get(o))))
|
|
1544
1546
|
return !0;
|
|
1545
1547
|
s(i), ge(o) && (o = un(o) || o);
|
|
1546
|
-
const l = !
|
|
1548
|
+
const l = !C.has(o) && pn(o) ? St(o) : o;
|
|
1547
1549
|
return t(i, l), Reflect.set(r, i, l, a), n(["set", [i], o, u]), !0;
|
|
1548
1550
|
}
|
|
1549
|
-
}),
|
|
1551
|
+
}), C = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakMap(), J = [1], F = /* @__PURE__ */ new WeakMap();
|
|
1550
1552
|
let Oe = Object.is, dn = (e, t) => new Proxy(e, t), pn = fn, gn = Et, mn = hn;
|
|
1551
1553
|
function St(e = {}) {
|
|
1552
1554
|
if (!ge(e))
|
|
@@ -1555,60 +1557,60 @@ function St(e = {}) {
|
|
|
1555
1557
|
if (t)
|
|
1556
1558
|
return t;
|
|
1557
1559
|
let s = J[0];
|
|
1558
|
-
const n = /* @__PURE__ */ new Set(), r = (
|
|
1559
|
-
s !==
|
|
1560
|
+
const n = /* @__PURE__ */ new Set(), r = (d, f = ++J[0]) => {
|
|
1561
|
+
s !== f && (i = s = f, n.forEach((g) => g(d, f)));
|
|
1560
1562
|
};
|
|
1561
1563
|
let i = s;
|
|
1562
|
-
const o = (
|
|
1563
|
-
const g =
|
|
1564
|
+
const o = (d = J[0]) => (i !== d && (i = d, c.forEach(([f]) => {
|
|
1565
|
+
const g = f[1](d);
|
|
1564
1566
|
g > s && (s = g);
|
|
1565
|
-
})), s), a = (
|
|
1566
|
-
const E = [...
|
|
1567
|
-
E[1] = [
|
|
1568
|
-
}, c = /* @__PURE__ */ new Map(), u = (
|
|
1569
|
-
const g = !me.has(
|
|
1567
|
+
})), s), a = (d) => (f, g) => {
|
|
1568
|
+
const E = [...f];
|
|
1569
|
+
E[1] = [d, ...E[1]], r(E, g);
|
|
1570
|
+
}, c = /* @__PURE__ */ new Map(), u = (d, f) => {
|
|
1571
|
+
const g = !me.has(f) && C.get(f);
|
|
1570
1572
|
if (g) {
|
|
1571
|
-
if ((q ? "production" : void 0) !== "production" && c.has(
|
|
1573
|
+
if ((q ? "production" : void 0) !== "production" && c.has(d))
|
|
1572
1574
|
throw new Error("prop listener already exists");
|
|
1573
1575
|
if (n.size) {
|
|
1574
|
-
const E = g[2](a(
|
|
1575
|
-
c.set(
|
|
1576
|
+
const E = g[2](a(d));
|
|
1577
|
+
c.set(d, [g, E]);
|
|
1576
1578
|
} else
|
|
1577
|
-
c.set(
|
|
1579
|
+
c.set(d, [g]);
|
|
1578
1580
|
}
|
|
1579
|
-
}, l = (
|
|
1580
|
-
var
|
|
1581
|
-
const g = c.get(
|
|
1582
|
-
g && (c.delete(
|
|
1583
|
-
}, w = (
|
|
1581
|
+
}, l = (d) => {
|
|
1582
|
+
var f;
|
|
1583
|
+
const g = c.get(d);
|
|
1584
|
+
g && (c.delete(d), (f = g[1]) == null || f.call(g));
|
|
1585
|
+
}, w = (d) => (n.add(d), n.size === 1 && c.forEach(([g, E], M) => {
|
|
1584
1586
|
if ((q ? "production" : void 0) !== "production" && E)
|
|
1585
1587
|
throw new Error("remove already exists");
|
|
1586
1588
|
const Tt = g[2](a(M));
|
|
1587
1589
|
c.set(M, [g, Tt]);
|
|
1588
1590
|
}), () => {
|
|
1589
|
-
n.delete(
|
|
1591
|
+
n.delete(d), n.size === 0 && c.forEach(([g, E], M) => {
|
|
1590
1592
|
E && (E(), c.set(M, [g]));
|
|
1591
1593
|
});
|
|
1592
1594
|
});
|
|
1593
|
-
let
|
|
1595
|
+
let p = !0;
|
|
1594
1596
|
const y = mn(
|
|
1595
|
-
() =>
|
|
1597
|
+
() => p,
|
|
1596
1598
|
u,
|
|
1597
1599
|
l,
|
|
1598
1600
|
r
|
|
1599
1601
|
), b = dn(e, y);
|
|
1600
1602
|
F.set(e, b);
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
1603
|
-
const
|
|
1603
|
+
const P = [e, o, w];
|
|
1604
|
+
return C.set(b, P), Reflect.ownKeys(e).forEach((d) => {
|
|
1605
|
+
const f = Object.getOwnPropertyDescriptor(
|
|
1604
1606
|
e,
|
|
1605
|
-
|
|
1607
|
+
d
|
|
1606
1608
|
);
|
|
1607
|
-
"value" in
|
|
1608
|
-
}),
|
|
1609
|
+
"value" in f && f.writable && (b[d] = e[d]);
|
|
1610
|
+
}), p = !1, b;
|
|
1609
1611
|
}
|
|
1610
1612
|
function yn(e, t, s) {
|
|
1611
|
-
const n =
|
|
1613
|
+
const n = C.get(e);
|
|
1612
1614
|
(q ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
|
|
1613
1615
|
let r;
|
|
1614
1616
|
const i = [], o = n[2];
|
|
@@ -1623,14 +1625,14 @@ function yn(e, t, s) {
|
|
|
1623
1625
|
};
|
|
1624
1626
|
}
|
|
1625
1627
|
function Ne(e) {
|
|
1626
|
-
const t =
|
|
1628
|
+
const t = C.get(e);
|
|
1627
1629
|
(q ? "production" : void 0) !== "production" && !t && console.warn("Please use proxy object");
|
|
1628
1630
|
const [s, n] = t;
|
|
1629
1631
|
return gn(s, n());
|
|
1630
1632
|
}
|
|
1631
1633
|
const wn = {}, bn = (e, t) => {
|
|
1632
1634
|
const s = re(void 0);
|
|
1633
|
-
|
|
1635
|
+
k(() => {
|
|
1634
1636
|
s.current = ln(e, t);
|
|
1635
1637
|
}), Pt(s.current);
|
|
1636
1638
|
}, En = bn, Sn = /* @__PURE__ */ new WeakMap();
|
|
@@ -1680,16 +1682,16 @@ function In({
|
|
|
1680
1682
|
onCancel: t,
|
|
1681
1683
|
onSuccess: s
|
|
1682
1684
|
}) {
|
|
1683
|
-
const n = Tn(A), [r, i] =
|
|
1685
|
+
const n = Tn(A), [r, i] = U(!1), [o, a] = U(Date.now()), c = n?.data?.sessionToken, u = n?.data?.amount;
|
|
1684
1686
|
function l() {
|
|
1685
1687
|
c || window.setTimeout(() => {
|
|
1686
1688
|
c && i(!0);
|
|
1687
|
-
},
|
|
1689
|
+
}, 200), i(!0);
|
|
1688
1690
|
}
|
|
1689
1691
|
function w() {
|
|
1690
1692
|
i(!1);
|
|
1691
1693
|
}
|
|
1692
|
-
const
|
|
1694
|
+
const p = () => {
|
|
1693
1695
|
const y = Date.now();
|
|
1694
1696
|
A.isPending = !0, A.error = null, A.data = null, fetch(e, {
|
|
1695
1697
|
headers: {
|
|
@@ -1701,8 +1703,8 @@ function In({
|
|
|
1701
1703
|
y < o || (A.error = b?.toString(), A.isPending = !1, a(y));
|
|
1702
1704
|
});
|
|
1703
1705
|
};
|
|
1704
|
-
return
|
|
1705
|
-
|
|
1706
|
+
return k(() => {
|
|
1707
|
+
p();
|
|
1706
1708
|
}, [e]), {
|
|
1707
1709
|
sessionToken: c,
|
|
1708
1710
|
amount: u,
|
|
@@ -1710,7 +1712,7 @@ function In({
|
|
|
1710
1712
|
session_url: e,
|
|
1711
1713
|
open: l,
|
|
1712
1714
|
close: w,
|
|
1713
|
-
refetch:
|
|
1715
|
+
refetch: p,
|
|
1714
1716
|
onSuccess: s,
|
|
1715
1717
|
onCancel: t
|
|
1716
1718
|
};
|
|
@@ -1721,22 +1723,22 @@ function Un({
|
|
|
1721
1723
|
onCancel: s,
|
|
1722
1724
|
onSuccess: n
|
|
1723
1725
|
}) {
|
|
1724
|
-
const [r, i] =
|
|
1726
|
+
const [r, i] = U(!1), [o, a] = U(e), [c, u] = U(t);
|
|
1725
1727
|
function l({
|
|
1726
1728
|
sessionToken: y,
|
|
1727
1729
|
amount: b
|
|
1728
1730
|
}) {
|
|
1729
1731
|
a(y), u(b);
|
|
1730
1732
|
}
|
|
1731
|
-
|
|
1733
|
+
k(() => {
|
|
1732
1734
|
a(e);
|
|
1733
1735
|
}, [e]);
|
|
1734
1736
|
function w() {
|
|
1735
1737
|
o || window.setTimeout(() => {
|
|
1736
1738
|
o && i(!0);
|
|
1737
|
-
},
|
|
1739
|
+
}, 200), i(!0);
|
|
1738
1740
|
}
|
|
1739
|
-
function
|
|
1741
|
+
function p() {
|
|
1740
1742
|
i(!1);
|
|
1741
1743
|
}
|
|
1742
1744
|
return {
|
|
@@ -1745,13 +1747,13 @@ function Un({
|
|
|
1745
1747
|
amount: c,
|
|
1746
1748
|
isOpen: r,
|
|
1747
1749
|
open: w,
|
|
1748
|
-
close:
|
|
1750
|
+
close: p,
|
|
1749
1751
|
onSuccess: n,
|
|
1750
1752
|
onCancel: s
|
|
1751
1753
|
};
|
|
1752
1754
|
}
|
|
1753
1755
|
export {
|
|
1754
|
-
|
|
1756
|
+
h as Chainrails,
|
|
1755
1757
|
Pn as PaymentModal,
|
|
1756
1758
|
ee as chains,
|
|
1757
1759
|
vn as crapi,
|