@cedros/pay-react 1.1.20 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{AISettingsSection-f5K0nUoQ.js → AISettingsSection-BtOxEweU.js} +1 -1
- package/dist/{AISettingsSection-BH-RXvk1.mjs → AISettingsSection-p3iikbSw.mjs} +2 -2
- package/dist/{AutosaveIndicator-CpTVtJIz.js → AutosaveIndicator-C-CH-obR.js} +1 -1
- package/dist/{AutosaveIndicator-DTOaopUP.mjs → AutosaveIndicator-CWbb-VXf.mjs} +1 -1
- package/dist/{FAQSection-CVJ5w6cB.js → FAQSection-DQpF7hVx.js} +1 -1
- package/dist/{FAQSection-BO7ZfQMN.mjs → FAQSection-byh7zfqI.mjs} +1 -1
- package/dist/MessagingSection-B6EHvjDw.js +1 -0
- package/dist/{MessagingSection-CmFYFdaw.mjs → MessagingSection-CK208brx.mjs} +143 -96
- package/dist/{PaymentSettingsSection-VDcgpOkp.mjs → PaymentSettingsSection-B9H253x1.mjs} +1 -1
- package/dist/{PaymentSettingsSection-BKDiep-C.js → PaymentSettingsSection-Cmmuhmd4.js} +1 -1
- package/dist/{SettingsSection-B0TpaIOG.mjs → SettingsSection-DDLMaEPo.mjs} +1 -1
- package/dist/{SettingsSection-DSlW47o4.js → SettingsSection-DrzGdvHH.js} +1 -1
- package/dist/{SingleCategorySettings-Cwlehl0u.mjs → SingleCategorySettings-BU98SRFV.mjs} +19 -15
- package/dist/SingleCategorySettings-DqcXe-q4.js +3 -0
- package/dist/{StorefrontSection-DfN5yxkV.js → StorefrontSection-DTpZ_GgO.js} +1 -1
- package/dist/{StorefrontSection-BAY9V1j6.mjs → StorefrontSection-Dr2ciBVg.mjs} +2 -2
- package/dist/{SubscriptionsSection-D_RKCILr.mjs → SubscriptionsSection-CU3Ce8r9.mjs} +1 -1
- package/dist/{SubscriptionsSection-BboudRYv.js → SubscriptionsSection-CYJpArJ8.js} +1 -1
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +133 -130
- package/dist/{index-75RhiLDq.mjs → index-CufXF9Yd.mjs} +3116 -3099
- package/dist/{index-B5ck27xb.js → index-IZ4WcMd7.js} +10 -10
- package/dist/index.js +1 -1
- package/dist/index.mjs +51 -48
- package/dist/sections-Bc6ARlND.mjs +8 -0
- package/dist/{sections-BCdzdqlG.js → sections-CR7NRsjq.js} +1 -1
- package/dist/src/admin/index.d.ts +2 -0
- package/dist/src/admin/index.d.ts.map +1 -1
- package/dist/src/admin/sectionIds.d.ts +43 -0
- package/dist/src/admin/sectionIds.d.ts.map +1 -0
- package/dist/src/components/admin/MessagingSection.d.ts.map +1 -1
- package/dist/src/components/admin/configApi.d.ts.map +1 -1
- package/dist/src/components/admin/emailProviders.d.ts +18 -0
- package/dist/src/components/admin/emailProviders.d.ts.map +1 -0
- package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/MessagingSection-CRFtSoE8.js +0 -1
- package/dist/SingleCategorySettings-BTXR7zex.js +0 -3
- package/dist/sections-BIBMX6KS.mjs +0 -8
package/dist/crypto-only.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { O as
|
|
2
|
-
import { v as Ue, t as
|
|
3
|
-
import { u as H, m as
|
|
4
|
-
import { f as
|
|
5
|
-
import {
|
|
6
|
-
import { C as
|
|
7
|
-
import { jsxs as
|
|
8
|
-
import { useState as
|
|
1
|
+
import { O as ke, B as ve, D as fe, y as Ie, A as me, w as Be, x as ye, z as V, V as _e, W as We } from "./styles--eKKnfdj.mjs";
|
|
2
|
+
import { v as Ue, t as Ye, C as Ve, a as He, f as Je, d as Xe, b as Ze, c as et, P as tt, R as rt, I as nt, S as at, e as st, g as ot, n as it, M as ct, J as lt, r as ut, m as dt, o as pt, q as ft, L as mt, N as yt, F as gt, E as bt, K as St, H as wt, p as ht, s as Ct, h as xt, k as Pt, Q as Et, i as Rt, u as Tt, j as kt, l as vt, G as It } from "./styles--eKKnfdj.mjs";
|
|
3
|
+
import { u as H, m as z, a as qe, i as y } from "./CedrosContext-BE6P5PQ0.mjs";
|
|
4
|
+
import { f as _t, C as Wt, e as qt, d as Mt, E as Lt, K as At, L as Dt, h as Ot, R as Nt, g as zt, b as Kt, j as Qt, c as $t, r as Ft, v as Gt, n as jt } from "./CedrosContext-BE6P5PQ0.mjs";
|
|
5
|
+
import { d as Yt, a as Vt, b as Ht, C as Jt, c as Xt, i as Zt } from "./index-CufXF9Yd.mjs";
|
|
6
|
+
import { C as tr, u as rr } from "./CryptoButton-CksMkZjL.mjs";
|
|
7
|
+
import { jsxs as K, jsx as x } from "react/jsx-runtime";
|
|
8
|
+
import { useState as I, useRef as N, useCallback as h, useMemo as G, useEffect as Q } from "react";
|
|
9
9
|
import { useWallet as J } from "@solana/wallet-adapter-react";
|
|
10
10
|
import { WalletReadyState as ge } from "@solana/wallet-adapter-base";
|
|
11
11
|
import { WalletIcon as Me } from "@solana/wallet-adapter-react-ui";
|
|
12
|
-
import { WalletPool as
|
|
12
|
+
import { WalletPool as ar, createWalletPool as sr } from "./walletPool-DShNjCQ6.mjs";
|
|
13
13
|
function Le() {
|
|
14
|
-
const { subscriptionManager: r, x402Manager: c, walletManager: f } = H(), { publicKey: i, signTransaction: R } = J(), [
|
|
14
|
+
const { subscriptionManager: r, x402Manager: c, walletManager: f } = H(), { publicKey: i, signTransaction: R } = J(), [S, p] = I({
|
|
15
15
|
status: "idle",
|
|
16
16
|
error: null,
|
|
17
17
|
sessionId: null,
|
|
18
18
|
subscriptionStatus: null,
|
|
19
19
|
expiresAt: null
|
|
20
|
-
}), [
|
|
20
|
+
}), [T, P] = I(null), E = N(!1), C = h(() => {
|
|
21
21
|
if (!i) {
|
|
22
22
|
const s = "Wallet not connected";
|
|
23
23
|
return p((t) => ({ ...t, status: "error", error: s })), { valid: !1, error: s };
|
|
@@ -27,7 +27,7 @@ function Le() {
|
|
|
27
27
|
return p((t) => ({ ...t, status: "error", error: s })), { valid: !1, error: s };
|
|
28
28
|
}
|
|
29
29
|
return { valid: !0 };
|
|
30
|
-
}, [i, R]),
|
|
30
|
+
}, [i, R]), k = h(
|
|
31
31
|
async (s) => {
|
|
32
32
|
if (!i)
|
|
33
33
|
return p((t) => ({
|
|
@@ -52,7 +52,7 @@ function Le() {
|
|
|
52
52
|
expiresAt: t.expiresAt || t.currentPeriodEnd || null
|
|
53
53
|
})), t;
|
|
54
54
|
} catch (t) {
|
|
55
|
-
const n =
|
|
55
|
+
const n = z(t, "Failed to check subscription status");
|
|
56
56
|
return p((l) => ({
|
|
57
57
|
...l,
|
|
58
58
|
status: "error",
|
|
@@ -61,7 +61,7 @@ function Le() {
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
[i, r]
|
|
64
|
-
),
|
|
64
|
+
), W = h(
|
|
65
65
|
async (s, t, n) => {
|
|
66
66
|
p((l) => ({
|
|
67
67
|
...l,
|
|
@@ -79,7 +79,7 @@ function Le() {
|
|
|
79
79
|
status: "idle"
|
|
80
80
|
})), l;
|
|
81
81
|
} catch (l) {
|
|
82
|
-
const a =
|
|
82
|
+
const a = z(l, "Failed to get subscription quote");
|
|
83
83
|
return p((o) => ({
|
|
84
84
|
...o,
|
|
85
85
|
status: "error",
|
|
@@ -113,15 +113,15 @@ function Le() {
|
|
|
113
113
|
const b = !!o.extra?.feePayer;
|
|
114
114
|
let m;
|
|
115
115
|
if (b) {
|
|
116
|
-
const { transaction:
|
|
116
|
+
const { transaction: w, blockhash: q } = await c.buildGaslessTransaction({
|
|
117
117
|
resourceId: s,
|
|
118
118
|
userWallet: i.toString(),
|
|
119
119
|
feePayer: o.extra.feePayer,
|
|
120
120
|
couponCode: n?.couponCode
|
|
121
|
-
}), M = f.deserializeTransaction(
|
|
121
|
+
}), M = f.deserializeTransaction(w), L = await f.partiallySignTransaction({
|
|
122
122
|
transaction: M,
|
|
123
123
|
signTransaction: R,
|
|
124
|
-
blockhash:
|
|
124
|
+
blockhash: q
|
|
125
125
|
});
|
|
126
126
|
m = await c.submitGaslessTransaction({
|
|
127
127
|
resource: s,
|
|
@@ -131,15 +131,15 @@ function Le() {
|
|
|
131
131
|
requirement: o
|
|
132
132
|
});
|
|
133
133
|
} else {
|
|
134
|
-
const
|
|
134
|
+
const w = await f.buildTransaction({
|
|
135
135
|
requirement: o,
|
|
136
136
|
payerPublicKey: i
|
|
137
|
-
}),
|
|
138
|
-
transaction:
|
|
137
|
+
}), q = await f.signTransaction({
|
|
138
|
+
transaction: w,
|
|
139
139
|
signTransaction: R
|
|
140
140
|
}), M = f.buildPaymentPayload({
|
|
141
141
|
requirement: o,
|
|
142
|
-
signedTx:
|
|
142
|
+
signedTx: q,
|
|
143
143
|
payerPublicKey: i
|
|
144
144
|
});
|
|
145
145
|
m = await c.submitPayment({
|
|
@@ -150,7 +150,7 @@ function Le() {
|
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
if (m.success) {
|
|
153
|
-
const
|
|
153
|
+
const w = await r.checkSubscriptionStatus({
|
|
154
154
|
resource: s,
|
|
155
155
|
userId: i.toString()
|
|
156
156
|
});
|
|
@@ -158,18 +158,18 @@ function Le() {
|
|
|
158
158
|
status: "success",
|
|
159
159
|
error: null,
|
|
160
160
|
sessionId: m.transactionId || null,
|
|
161
|
-
subscriptionStatus:
|
|
162
|
-
expiresAt:
|
|
161
|
+
subscriptionStatus: w.status,
|
|
162
|
+
expiresAt: w.expiresAt || w.currentPeriodEnd || null
|
|
163
163
|
});
|
|
164
164
|
} else
|
|
165
|
-
p((
|
|
166
|
-
...
|
|
165
|
+
p((w) => ({
|
|
166
|
+
...w,
|
|
167
167
|
status: "error",
|
|
168
168
|
error: m.error || "Subscription payment failed"
|
|
169
169
|
}));
|
|
170
170
|
return m;
|
|
171
171
|
} catch (a) {
|
|
172
|
-
const o =
|
|
172
|
+
const o = z(a, "Subscription payment failed");
|
|
173
173
|
return p((b) => ({
|
|
174
174
|
...b,
|
|
175
175
|
status: "error",
|
|
@@ -187,7 +187,7 @@ function Le() {
|
|
|
187
187
|
i,
|
|
188
188
|
R
|
|
189
189
|
]
|
|
190
|
-
),
|
|
190
|
+
), B = h(() => {
|
|
191
191
|
p({
|
|
192
192
|
status: "idle",
|
|
193
193
|
error: null,
|
|
@@ -197,12 +197,12 @@ function Le() {
|
|
|
197
197
|
}), P(null);
|
|
198
198
|
}, []);
|
|
199
199
|
return {
|
|
200
|
-
...
|
|
201
|
-
quote:
|
|
202
|
-
checkStatus:
|
|
203
|
-
requestQuote:
|
|
200
|
+
...S,
|
|
201
|
+
quote: T,
|
|
202
|
+
checkStatus: k,
|
|
203
|
+
requestQuote: W,
|
|
204
204
|
processPayment: g,
|
|
205
|
-
reset:
|
|
205
|
+
reset: B
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
208
|
function $e({
|
|
@@ -211,18 +211,18 @@ function $e({
|
|
|
211
211
|
intervalDays: f,
|
|
212
212
|
couponCode: i,
|
|
213
213
|
label: R,
|
|
214
|
-
disabled:
|
|
214
|
+
disabled: S = !1,
|
|
215
215
|
onAttempt: p,
|
|
216
|
-
onSuccess:
|
|
216
|
+
onSuccess: T,
|
|
217
217
|
onError: P,
|
|
218
218
|
className: E = "",
|
|
219
219
|
testPageUrl: C,
|
|
220
|
-
hideMessages:
|
|
221
|
-
autoCheckStatus:
|
|
220
|
+
hideMessages: k = !1,
|
|
221
|
+
autoCheckStatus: W = !0
|
|
222
222
|
}) {
|
|
223
223
|
const {
|
|
224
224
|
connected: g,
|
|
225
|
-
connecting:
|
|
225
|
+
connecting: B,
|
|
226
226
|
connect: s,
|
|
227
227
|
disconnect: t,
|
|
228
228
|
select: n,
|
|
@@ -232,17 +232,17 @@ function $e({
|
|
|
232
232
|
} = J(), {
|
|
233
233
|
status: b,
|
|
234
234
|
error: m,
|
|
235
|
-
subscriptionStatus:
|
|
236
|
-
expiresAt:
|
|
235
|
+
subscriptionStatus: w,
|
|
236
|
+
expiresAt: q,
|
|
237
237
|
checkStatus: M,
|
|
238
238
|
processPayment: L
|
|
239
|
-
} = Le(), u =
|
|
240
|
-
Z.current =
|
|
241
|
-
const
|
|
239
|
+
} = Le(), u = qe(), { solanaError: _ } = H(), { t: v, translations: X } = ke(), be = R || v("ui.subscribe_with_crypto"), Z = N(T), ee = N(P), te = N(L), re = N(M);
|
|
240
|
+
Z.current = T, ee.current = P, te.current = L, re.current = M;
|
|
241
|
+
const Se = m && typeof m != "string" ? m?.code ?? null : null, we = _ && typeof _ != "string" ? _?.code ?? null : null, ne = (e) => {
|
|
242
242
|
if (!e || !X) return "";
|
|
243
243
|
const d = X.errors[e];
|
|
244
244
|
return d ? d.action ? `${d.message} ${d.action}` : d.message : "";
|
|
245
|
-
}, ae = m ? typeof m == "string" ? m : ne(
|
|
245
|
+
}, ae = m ? typeof m == "string" ? m : ne(Se) : null, se = _ ? typeof _ == "string" ? _ : ne(we) : null, he = G(
|
|
246
246
|
() => l.map((e) => `${e.adapter.name}-${e.readyState}`).join(","),
|
|
247
247
|
[l]
|
|
248
248
|
), j = G(
|
|
@@ -253,36 +253,36 @@ function $e({
|
|
|
253
253
|
[he]
|
|
254
254
|
);
|
|
255
255
|
Q(() => {
|
|
256
|
-
|
|
257
|
-
}, [
|
|
258
|
-
b === "success" &&
|
|
259
|
-
}, [b,
|
|
256
|
+
W && g && o && (y().debug("[CryptoSubscribeButton] Auto-checking subscription status"), re.current(r));
|
|
257
|
+
}, [W, g, o, r]), Q(() => {
|
|
258
|
+
b === "success" && w === "active" && (ve("crypto", "subscription-active", r), Z.current?.("subscription-active"));
|
|
259
|
+
}, [b, w, r]), Q(() => {
|
|
260
260
|
b === "error" && m && (fe("crypto", m, r), ee.current?.(m));
|
|
261
261
|
}, [b, m, r]);
|
|
262
|
-
const oe = typeof window < "u" && window.top !== window.self, [ie, A] =
|
|
262
|
+
const oe = typeof window < "u" && window.top !== window.self, [ie, A] = I(!1), [ce, U] = I(!1), [le, D] = I(!1), O = _;
|
|
263
263
|
Q(() => {
|
|
264
264
|
let e = !1;
|
|
265
265
|
return e || (async () => {
|
|
266
|
-
if (ce && a && !g && !
|
|
266
|
+
if (ce && a && !g && !B) {
|
|
267
267
|
y().debug(
|
|
268
268
|
"[CryptoSubscribeButton] Wallet detected, attempting auto-connect:",
|
|
269
269
|
a.adapter.name
|
|
270
270
|
), U(!1), ye(a.adapter.name);
|
|
271
271
|
try {
|
|
272
272
|
await s(), e || y().debug("[CryptoSubscribeButton] Auto-connect successful");
|
|
273
|
-
} catch (
|
|
273
|
+
} catch (Y) {
|
|
274
274
|
if (!e) {
|
|
275
|
-
y().error("[CryptoSubscribeButton] Auto-connect failed:",
|
|
276
|
-
const
|
|
277
|
-
|
|
275
|
+
y().error("[CryptoSubscribeButton] Auto-connect failed:", Y);
|
|
276
|
+
const Te = Y instanceof Error ? Y.message : "Failed to connect wallet";
|
|
277
|
+
V(Te, a.adapter.name), D(!1);
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
})(), () => {
|
|
282
282
|
e = !0;
|
|
283
283
|
};
|
|
284
|
-
}, [a, ce, g,
|
|
285
|
-
g && le && o && a && (
|
|
284
|
+
}, [a, ce, g, B, s]), Q(() => {
|
|
285
|
+
g && le && o && a && (Ie(a.adapter.name, o.toString()), y().debug("[CryptoSubscribeButton] Processing pending subscription payment"), D(!1), A(!1), me("crypto", r), te.current(r, c, { couponCode: i, intervalDays: f }));
|
|
286
286
|
}, [g, le, o, a, r, c, i, f]);
|
|
287
287
|
const ue = h(async () => {
|
|
288
288
|
if (y().debug("[CryptoSubscribeButton] executeSubscriptionFlow called", {
|
|
@@ -290,8 +290,8 @@ function $e({
|
|
|
290
290
|
wallet: a?.adapter.name,
|
|
291
291
|
resource: r,
|
|
292
292
|
interval: c
|
|
293
|
-
}),
|
|
294
|
-
y().error("[CryptoSubscribeButton] Solana dependencies missing:",
|
|
293
|
+
}), Be("crypto", r), p && p("crypto"), O) {
|
|
294
|
+
y().error("[CryptoSubscribeButton] Solana dependencies missing:", O), fe("crypto", O, r), P && P(O);
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
297
|
if (oe) {
|
|
@@ -308,7 +308,7 @@ function $e({
|
|
|
308
308
|
if (g)
|
|
309
309
|
me("crypto", r), await L(r, c, { couponCode: i, intervalDays: f });
|
|
310
310
|
else {
|
|
311
|
-
|
|
311
|
+
D(!0);
|
|
312
312
|
try {
|
|
313
313
|
if (a)
|
|
314
314
|
y().debug(
|
|
@@ -317,16 +317,16 @@ function $e({
|
|
|
317
317
|
), ye(a.adapter.name), await s();
|
|
318
318
|
else {
|
|
319
319
|
if (y().debug("[CryptoSubscribeButton] No wallet selected, showing selector"), j.length === 0) {
|
|
320
|
-
|
|
320
|
+
D(!1);
|
|
321
321
|
const e = "No wallets available";
|
|
322
|
-
throw
|
|
322
|
+
throw V(e), new Error(e);
|
|
323
323
|
}
|
|
324
324
|
A(!0);
|
|
325
325
|
}
|
|
326
326
|
} catch (e) {
|
|
327
|
-
|
|
327
|
+
D(!1);
|
|
328
328
|
const d = e instanceof Error ? e.message : "Failed to connect wallet";
|
|
329
|
-
y().error("[CryptoSubscribeButton] Connection error:", d),
|
|
329
|
+
y().error("[CryptoSubscribeButton] Connection error:", d), V(d, a?.adapter.name);
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
}, [
|
|
@@ -341,21 +341,21 @@ function $e({
|
|
|
341
341
|
j,
|
|
342
342
|
s,
|
|
343
343
|
L,
|
|
344
|
-
|
|
344
|
+
O,
|
|
345
345
|
p,
|
|
346
346
|
P
|
|
347
347
|
]), de = G(() => `crypto-subscribe-${r}-${c}`, [r, c]), Ce = G(
|
|
348
|
-
() =>
|
|
348
|
+
() => _e(de, ue, {
|
|
349
349
|
cooldownMs: 200,
|
|
350
350
|
deduplicationWindowMs: 0
|
|
351
351
|
}),
|
|
352
352
|
[de, ue]
|
|
353
|
-
), pe = b === "loading" || b === "checking", $ =
|
|
353
|
+
), pe = b === "loading" || b === "checking", $ = w === "active" || w === "trialing", xe = S || pe || B || !!O || $;
|
|
354
354
|
let F = be;
|
|
355
355
|
if (pe)
|
|
356
356
|
F = v("ui.processing");
|
|
357
|
-
else if ($ &&
|
|
358
|
-
const e = new Date(
|
|
357
|
+
else if ($ && q) {
|
|
358
|
+
const e = new Date(q).toLocaleDateString();
|
|
359
359
|
F = `${v("ui.subscribed_until")} ${e}`;
|
|
360
360
|
} else $ && (F = v("ui.subscribed"));
|
|
361
361
|
const Pe = h(async () => {
|
|
@@ -371,7 +371,7 @@ function $e({
|
|
|
371
371
|
[n]
|
|
372
372
|
), Re = h(async () => {
|
|
373
373
|
try {
|
|
374
|
-
if (await t(),
|
|
374
|
+
if (await t(), D(!1), typeof window < "u" && window.localStorage)
|
|
375
375
|
try {
|
|
376
376
|
window.localStorage.removeItem("walletName");
|
|
377
377
|
} catch (e) {
|
|
@@ -381,7 +381,7 @@ function $e({
|
|
|
381
381
|
y().error("Failed to disconnect wallet:", e);
|
|
382
382
|
}
|
|
383
383
|
}, [t]);
|
|
384
|
-
return /* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ K(
|
|
385
385
|
"div",
|
|
386
386
|
{
|
|
387
387
|
className: u.unstyled ? E : `${u.className} cedros-theme__crypto-button ${E || ""}`,
|
|
@@ -397,7 +397,7 @@ function $e({
|
|
|
397
397
|
children: F
|
|
398
398
|
}
|
|
399
399
|
),
|
|
400
|
-
ie && !
|
|
400
|
+
ie && !k && /* @__PURE__ */ x(
|
|
401
401
|
"div",
|
|
402
402
|
{
|
|
403
403
|
className: "cedros-modal-overlay",
|
|
@@ -415,7 +415,7 @@ function $e({
|
|
|
415
415
|
padding: "1rem"
|
|
416
416
|
},
|
|
417
417
|
onClick: () => A(!1),
|
|
418
|
-
children: /* @__PURE__ */
|
|
418
|
+
children: /* @__PURE__ */ K(
|
|
419
419
|
"div",
|
|
420
420
|
{
|
|
421
421
|
className: "cedros-modal-content",
|
|
@@ -430,7 +430,7 @@ function $e({
|
|
|
430
430
|
},
|
|
431
431
|
onClick: (e) => e.stopPropagation(),
|
|
432
432
|
children: [
|
|
433
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ K(
|
|
434
434
|
"div",
|
|
435
435
|
{
|
|
436
436
|
style: {
|
|
@@ -456,7 +456,7 @@ function $e({
|
|
|
456
456
|
"button",
|
|
457
457
|
{
|
|
458
458
|
onClick: () => A(!1),
|
|
459
|
-
style:
|
|
459
|
+
style: We(u.tokens.surfaceText),
|
|
460
460
|
"aria-label": "Close modal",
|
|
461
461
|
type: "button",
|
|
462
462
|
children: "×"
|
|
@@ -465,7 +465,7 @@ function $e({
|
|
|
465
465
|
]
|
|
466
466
|
}
|
|
467
467
|
),
|
|
468
|
-
/* @__PURE__ */ x("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: j.map((e) => /* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ x("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: j.map((e) => /* @__PURE__ */ K(
|
|
469
469
|
"button",
|
|
470
470
|
{
|
|
471
471
|
onClick: () => Ee(e.adapter.name),
|
|
@@ -503,7 +503,7 @@ function $e({
|
|
|
503
503
|
)
|
|
504
504
|
}
|
|
505
505
|
),
|
|
506
|
-
g && !
|
|
506
|
+
g && !k && !ie && /* @__PURE__ */ K(
|
|
507
507
|
"div",
|
|
508
508
|
{
|
|
509
509
|
style: {
|
|
@@ -552,29 +552,29 @@ function $e({
|
|
|
552
552
|
]
|
|
553
553
|
}
|
|
554
554
|
),
|
|
555
|
-
!
|
|
556
|
-
!
|
|
557
|
-
!
|
|
555
|
+
!k && se && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__error", children: se }),
|
|
556
|
+
!k && ae && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__error", children: ae }),
|
|
557
|
+
!k && $ && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__success", children: v("ui.subscription_active") })
|
|
558
558
|
]
|
|
559
559
|
}
|
|
560
560
|
);
|
|
561
561
|
}
|
|
562
562
|
function Fe() {
|
|
563
|
-
const { x402Manager: r, walletManager: c } = H(), { publicKey: f, signTransaction: i } = J(), [R,
|
|
563
|
+
const { x402Manager: r, walletManager: c } = H(), { publicKey: f, signTransaction: i } = J(), [R, S] = I({
|
|
564
564
|
status: "idle",
|
|
565
565
|
error: null,
|
|
566
566
|
transactionId: null
|
|
567
|
-
}), [p,
|
|
567
|
+
}), [p, T] = I(null), [P, E] = I(null), C = N(!1), k = h(
|
|
568
568
|
async (s) => {
|
|
569
569
|
try {
|
|
570
|
-
|
|
570
|
+
S((n) => ({ ...n, status: "loading" }));
|
|
571
571
|
const t = await r.requestQuote({ resource: s });
|
|
572
572
|
if (!r.validateRequirement(t))
|
|
573
573
|
throw new Error("Invalid refund requirement received from server");
|
|
574
|
-
return
|
|
574
|
+
return T(t), S((n) => ({ ...n, status: "idle" })), t;
|
|
575
575
|
} catch (t) {
|
|
576
|
-
const n =
|
|
577
|
-
throw
|
|
576
|
+
const n = z(t, "Failed to fetch refund requirement");
|
|
577
|
+
throw S({
|
|
578
578
|
status: "error",
|
|
579
579
|
error: n,
|
|
580
580
|
transactionId: null
|
|
@@ -582,7 +582,7 @@ function Fe() {
|
|
|
582
582
|
}
|
|
583
583
|
},
|
|
584
584
|
[r]
|
|
585
|
-
),
|
|
585
|
+
), W = h(
|
|
586
586
|
async (s, t) => {
|
|
587
587
|
if (C.current)
|
|
588
588
|
throw new Error("Refund already in progress");
|
|
@@ -590,7 +590,7 @@ function Fe() {
|
|
|
590
590
|
throw new Error("Wallet not connected");
|
|
591
591
|
C.current = !0;
|
|
592
592
|
try {
|
|
593
|
-
|
|
593
|
+
S({
|
|
594
594
|
status: "loading",
|
|
595
595
|
error: null,
|
|
596
596
|
transactionId: null
|
|
@@ -598,7 +598,7 @@ function Fe() {
|
|
|
598
598
|
const n = await r.requestQuote({ resource: s, couponCode: t });
|
|
599
599
|
if (!r.validateRequirement(n))
|
|
600
600
|
throw new Error("Invalid refund requirement received");
|
|
601
|
-
|
|
601
|
+
T(n);
|
|
602
602
|
const l = await c.buildTransaction({
|
|
603
603
|
requirement: n,
|
|
604
604
|
payerPublicKey: f
|
|
@@ -617,14 +617,14 @@ function Fe() {
|
|
|
617
617
|
// no metadata for refunds
|
|
618
618
|
resourceType: "refund"
|
|
619
619
|
});
|
|
620
|
-
return b.settlement && E(b.settlement),
|
|
620
|
+
return b.settlement && E(b.settlement), S({
|
|
621
621
|
status: "success",
|
|
622
622
|
error: null,
|
|
623
623
|
transactionId: b.transactionId || a.signature
|
|
624
624
|
}), b;
|
|
625
625
|
} catch (n) {
|
|
626
|
-
const l =
|
|
627
|
-
throw
|
|
626
|
+
const l = z(n, "Refund payment failed");
|
|
627
|
+
throw S({
|
|
628
628
|
status: "error",
|
|
629
629
|
error: l,
|
|
630
630
|
transactionId: null
|
|
@@ -642,7 +642,7 @@ function Fe() {
|
|
|
642
642
|
throw new Error("Wallet not connected");
|
|
643
643
|
C.current = !0;
|
|
644
644
|
try {
|
|
645
|
-
|
|
645
|
+
S({
|
|
646
646
|
status: "loading",
|
|
647
647
|
error: null,
|
|
648
648
|
transactionId: null
|
|
@@ -650,7 +650,7 @@ function Fe() {
|
|
|
650
650
|
const t = await r.requestQuote({ resource: s });
|
|
651
651
|
if (!r.validateRequirement(t))
|
|
652
652
|
throw new Error("Invalid refund requirement received");
|
|
653
|
-
|
|
653
|
+
T(t);
|
|
654
654
|
const { transaction: n } = await r.buildGaslessTransaction({
|
|
655
655
|
resourceId: s,
|
|
656
656
|
userWallet: f.toString(),
|
|
@@ -668,14 +668,14 @@ function Fe() {
|
|
|
668
668
|
resourceType: "refund",
|
|
669
669
|
requirement: t
|
|
670
670
|
});
|
|
671
|
-
return o.settlement && E(o.settlement),
|
|
671
|
+
return o.settlement && E(o.settlement), S({
|
|
672
672
|
status: "success",
|
|
673
673
|
error: null,
|
|
674
674
|
transactionId: o.transactionId || "gasless-refund-tx"
|
|
675
675
|
}), o;
|
|
676
676
|
} catch (t) {
|
|
677
|
-
const n =
|
|
678
|
-
throw
|
|
677
|
+
const n = z(t, "Gasless refund payment failed");
|
|
678
|
+
throw S({
|
|
679
679
|
status: "error",
|
|
680
680
|
error: n,
|
|
681
681
|
transactionId: null
|
|
@@ -685,68 +685,71 @@ function Fe() {
|
|
|
685
685
|
}
|
|
686
686
|
},
|
|
687
687
|
[f, i, r, c]
|
|
688
|
-
),
|
|
689
|
-
|
|
688
|
+
), B = h(() => {
|
|
689
|
+
S({
|
|
690
690
|
status: "idle",
|
|
691
691
|
error: null,
|
|
692
692
|
transactionId: null
|
|
693
|
-
}),
|
|
693
|
+
}), T(null), E(null);
|
|
694
694
|
}, []);
|
|
695
695
|
return {
|
|
696
696
|
state: R,
|
|
697
697
|
requirement: p,
|
|
698
698
|
settlement: P,
|
|
699
|
-
fetchRefundQuote:
|
|
700
|
-
processRefund:
|
|
699
|
+
fetchRefundQuote: k,
|
|
700
|
+
processRefund: W,
|
|
701
701
|
processGaslessRefund: g,
|
|
702
|
-
reset:
|
|
702
|
+
reset: B
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
705
|
export {
|
|
706
706
|
Ue as CEDROS_EVENTS,
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
707
|
+
Yt as CEDROS_PAY_GROUPS,
|
|
708
|
+
Vt as CEDROS_PAY_SECTIONS,
|
|
709
|
+
Ht as CEDROS_PAY_SECTION_IDS,
|
|
710
|
+
_t as CIRCUIT_BREAKER_PRESETS,
|
|
711
|
+
Ye as CSP_PRESETS,
|
|
712
|
+
Ve as CedrosPay,
|
|
713
|
+
Jt as CedrosPayAdminDashboard,
|
|
714
|
+
Wt as CedrosProvider,
|
|
715
|
+
qt as CircuitBreakerOpenError,
|
|
713
716
|
Mt as CircuitState,
|
|
714
717
|
He as CreditsButton,
|
|
715
718
|
Je as CreditsSubscribeButton,
|
|
716
|
-
|
|
719
|
+
tr as CryptoButton,
|
|
717
720
|
$e as CryptoSubscribeButton,
|
|
718
721
|
Lt as ERROR_CATEGORIES,
|
|
719
722
|
At as KNOWN_STABLECOINS,
|
|
720
|
-
|
|
721
|
-
|
|
723
|
+
Dt as LogLevel,
|
|
724
|
+
Ot as Logger,
|
|
722
725
|
Xe as PaymentMethodBadge,
|
|
723
726
|
Ze as PaymentModal,
|
|
724
727
|
et as ProductPrice,
|
|
725
728
|
tt as PurchaseButton,
|
|
726
|
-
|
|
727
|
-
|
|
729
|
+
Nt as RATE_LIMITER_PRESETS,
|
|
730
|
+
zt as RETRY_PRESETS,
|
|
728
731
|
rt as RPC_PROVIDERS,
|
|
729
732
|
nt as SECURITY_RECOMMENDATIONS,
|
|
730
733
|
at as StripeButton,
|
|
731
734
|
st as SubscribeButton,
|
|
732
735
|
ot as SubscriptionManagementPanel,
|
|
733
|
-
|
|
736
|
+
ar as WalletPool,
|
|
734
737
|
it as calculateDiscountPercentage,
|
|
735
|
-
|
|
736
|
-
|
|
738
|
+
Xt as cedrosPayPlugin,
|
|
739
|
+
Kt as createCircuitBreaker,
|
|
737
740
|
Qt as createLogger,
|
|
738
741
|
$t as createRateLimiter,
|
|
739
742
|
ct as createTranslator,
|
|
740
|
-
|
|
743
|
+
sr as createWalletPool,
|
|
741
744
|
lt as detectLocale,
|
|
742
|
-
|
|
745
|
+
Zt as ecommerce,
|
|
743
746
|
fe as emitPaymentError,
|
|
744
747
|
me as emitPaymentProcessing,
|
|
745
|
-
|
|
748
|
+
Be as emitPaymentStart,
|
|
746
749
|
ve as emitPaymentSuccess,
|
|
747
750
|
ye as emitWalletConnect,
|
|
748
|
-
|
|
749
|
-
|
|
751
|
+
Ie as emitWalletConnected,
|
|
752
|
+
V as emitWalletError,
|
|
750
753
|
ut as formatCSP,
|
|
751
754
|
dt as formatCouponCodes,
|
|
752
755
|
pt as generateCSP,
|
|
@@ -756,25 +759,25 @@ export {
|
|
|
756
759
|
y as getLogger,
|
|
757
760
|
gt as getUserErrorMessage,
|
|
758
761
|
bt as isRetryableError,
|
|
759
|
-
|
|
760
|
-
|
|
762
|
+
St as loadLocale,
|
|
763
|
+
wt as logSecurityReport,
|
|
761
764
|
ht as parseCouponCodes,
|
|
762
765
|
Ft as retryWithBackoff,
|
|
763
766
|
Ct as stackCheckoutCoupons,
|
|
764
767
|
H as useCedrosContext,
|
|
765
|
-
|
|
768
|
+
qe as useCedrosTheme,
|
|
766
769
|
xt as useCreditsPayment,
|
|
767
770
|
Pt as useCreditsSubscription,
|
|
768
771
|
Le as useCryptoSubscription,
|
|
769
772
|
Et as useLocalizedError,
|
|
770
773
|
Rt as usePaymentMode,
|
|
771
774
|
Fe as useRefundVerification,
|
|
772
|
-
|
|
773
|
-
|
|
775
|
+
Tt as useStripeCheckout,
|
|
776
|
+
kt as useSubscription,
|
|
774
777
|
vt as useSubscriptionManagement,
|
|
775
|
-
|
|
776
|
-
|
|
778
|
+
ke as useTranslation,
|
|
779
|
+
rr as useX402Payment,
|
|
777
780
|
Gt as validateConfig,
|
|
778
|
-
|
|
781
|
+
It as validateSecurity,
|
|
779
782
|
jt as validateTokenMint
|
|
780
783
|
};
|