@cedros/pay-react 1.1.20 → 1.1.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.
Files changed (42) hide show
  1. package/README.md +2 -0
  2. package/dist/{AISettingsSection-BH-RXvk1.mjs → AISettingsSection-8eDaxYp8.mjs} +2 -2
  3. package/dist/{AISettingsSection-f5K0nUoQ.js → AISettingsSection-BXWZcMQT.js} +1 -1
  4. package/dist/{AutosaveIndicator-DTOaopUP.mjs → AutosaveIndicator-3S7EvXip.mjs} +1 -1
  5. package/dist/{AutosaveIndicator-CpTVtJIz.js → AutosaveIndicator-DW4IPbZ5.js} +1 -1
  6. package/dist/{FAQSection-BO7ZfQMN.mjs → FAQSection-Dg-I7Z-N.mjs} +1 -1
  7. package/dist/{FAQSection-CVJ5w6cB.js → FAQSection-r6eKjfdO.js} +1 -1
  8. package/dist/MessagingSection-Cld5Q7ZM.js +1 -0
  9. package/dist/{MessagingSection-CmFYFdaw.mjs → MessagingSection-D39EuOLN.mjs} +143 -96
  10. package/dist/{PaymentSettingsSection-BKDiep-C.js → PaymentSettingsSection-B-MRsh1K.js} +1 -1
  11. package/dist/{PaymentSettingsSection-VDcgpOkp.mjs → PaymentSettingsSection-CEGHN6VI.mjs} +1 -1
  12. package/dist/{SettingsSection-B0TpaIOG.mjs → SettingsSection-CPFOuoZG.mjs} +1 -1
  13. package/dist/{SettingsSection-DSlW47o4.js → SettingsSection-ZrzfLBlS.js} +1 -1
  14. package/dist/{SingleCategorySettings-Cwlehl0u.mjs → SingleCategorySettings-DhHGIGwB.mjs} +50 -46
  15. package/dist/SingleCategorySettings-DxjCafCk.js +3 -0
  16. package/dist/{StorefrontSection-DfN5yxkV.js → StorefrontSection-DGVcJu1T.js} +1 -1
  17. package/dist/{StorefrontSection-BAY9V1j6.mjs → StorefrontSection-f54ySA6i.mjs} +2 -2
  18. package/dist/{SubscriptionsSection-D_RKCILr.mjs → SubscriptionsSection-F2IiU2jv.mjs} +1 -1
  19. package/dist/{SubscriptionsSection-BboudRYv.js → SubscriptionsSection-fzbL5DGC.js} +1 -1
  20. package/dist/crypto-only.js +1 -1
  21. package/dist/crypto-only.mjs +133 -130
  22. package/dist/{index-B5ck27xb.js → index-7YUxR4u5.js} +10 -10
  23. package/dist/{index-75RhiLDq.mjs → index-bqhsxBTY.mjs} +3116 -3099
  24. package/dist/index.js +1 -1
  25. package/dist/index.mjs +51 -48
  26. package/dist/sections-CiAMjlPd.mjs +8 -0
  27. package/dist/{sections-BCdzdqlG.js → sections-Dh0qFSUW.js} +1 -1
  28. package/dist/src/admin/index.d.ts +2 -0
  29. package/dist/src/admin/index.d.ts.map +1 -1
  30. package/dist/src/admin/sectionIds.d.ts +43 -0
  31. package/dist/src/admin/sectionIds.d.ts.map +1 -0
  32. package/dist/src/components/admin/MessagingSection.d.ts.map +1 -1
  33. package/dist/src/components/admin/configApi.d.ts.map +1 -1
  34. package/dist/src/components/admin/emailProviders.d.ts +18 -0
  35. package/dist/src/components/admin/emailProviders.d.ts.map +1 -0
  36. package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -1
  37. package/dist/src/index.d.ts +1 -1
  38. package/dist/src/index.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/MessagingSection-CRFtSoE8.js +0 -1
  41. package/dist/SingleCategorySettings-BTXR7zex.js +0 -3
  42. package/dist/sections-BIBMX6KS.mjs +0 -8
@@ -1,23 +1,23 @@
1
- import { O as Te, B as ve, D as fe, y as Be, A as me, w as Ie, x as ye, z as Y, V as We, W as qe } from "./styles--eKKnfdj.mjs";
2
- import { v as Ue, t as Ve, C as Ye, 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 wt, H as St, p as ht, s as Ct, h as xt, k as Pt, Q as Et, i as Rt, u as kt, j as Tt, l as vt, G as Bt } from "./styles--eKKnfdj.mjs";
3
- import { u as H, m as K, a as _e, i as y } from "./CedrosContext-BE6P5PQ0.mjs";
4
- import { f as Wt, C as qt, e as _t, d as Mt, E as Lt, K as At, L as Nt, h as Dt, R as zt, g as Kt, b as Ot, j as Qt, c as $t, r as Ft, v as Gt, n as jt } from "./CedrosContext-BE6P5PQ0.mjs";
5
- import { C as Vt, c as Yt, i as Ht } from "./index-75RhiLDq.mjs";
6
- import { C as Xt, u as Zt } from "./CryptoButton-CksMkZjL.mjs";
7
- import { jsxs as O, jsx as x } from "react/jsx-runtime";
8
- import { useState as B, useRef as z, useCallback as h, useMemo as G, useEffect as Q } from "react";
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-bqhsxBTY.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 tr, createWalletPool as rr } from "./walletPool-DShNjCQ6.mjs";
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(), [w, p] = B({
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
- }), [k, P] = B(null), E = z(!1), C = h(() => {
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]), T = h(
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 = K(t, "Failed to check subscription status");
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
- ), q = h(
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 = K(l, "Failed to get subscription quote");
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: S, blockhash: _ } = await c.buildGaslessTransaction({
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(S), L = await f.partiallySignTransaction({
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 S = await f.buildTransaction({
134
+ const w = await f.buildTransaction({
135
135
  requirement: o,
136
136
  payerPublicKey: i
137
- }), _ = await f.signTransaction({
138
- transaction: S,
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 S = await r.checkSubscriptionStatus({
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: S.status,
162
- expiresAt: S.expiresAt || S.currentPeriodEnd || null
161
+ subscriptionStatus: w.status,
162
+ expiresAt: w.expiresAt || w.currentPeriodEnd || null
163
163
  });
164
164
  } else
165
- p((S) => ({
166
- ...S,
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 = K(a, "Subscription payment failed");
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
- ), I = h(() => {
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
- ...w,
201
- quote: k,
202
- checkStatus: T,
203
- requestQuote: q,
200
+ ...S,
201
+ quote: T,
202
+ checkStatus: k,
203
+ requestQuote: W,
204
204
  processPayment: g,
205
- reset: I
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: w = !1,
214
+ disabled: S = !1,
215
215
  onAttempt: p,
216
- onSuccess: k,
216
+ onSuccess: T,
217
217
  onError: P,
218
218
  className: E = "",
219
219
  testPageUrl: C,
220
- hideMessages: T = !1,
221
- autoCheckStatus: q = !0
220
+ hideMessages: k = !1,
221
+ autoCheckStatus: W = !0
222
222
  }) {
223
223
  const {
224
224
  connected: g,
225
- connecting: I,
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: S,
236
- expiresAt: _,
235
+ subscriptionStatus: w,
236
+ expiresAt: q,
237
237
  checkStatus: M,
238
238
  processPayment: L
239
- } = Le(), u = _e(), { solanaError: W } = H(), { t: v, translations: X } = Te(), be = R || v("ui.subscribe_with_crypto"), Z = z(k), ee = z(P), te = z(L), re = z(M);
240
- Z.current = k, ee.current = P, te.current = L, re.current = M;
241
- const we = m && typeof m != "string" ? m?.code ?? null : null, Se = W && typeof W != "string" ? W?.code ?? null : null, ne = (e) => {
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(we) : null, se = W ? typeof W == "string" ? W : ne(Se) : null, he = G(
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
- q && g && o && (y().debug("[CryptoSubscribeButton] Auto-checking subscription status"), re.current(r));
257
- }, [q, g, o, r]), Q(() => {
258
- b === "success" && S === "active" && (ve("crypto", "subscription-active", r), Z.current?.("subscription-active"));
259
- }, [b, S, r]), Q(() => {
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] = B(!1), [ce, U] = B(!1), [le, N] = B(!1), D = W;
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 && !I) {
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 (V) {
273
+ } catch (Y) {
274
274
  if (!e) {
275
- y().error("[CryptoSubscribeButton] Auto-connect failed:", V);
276
- const ke = V instanceof Error ? V.message : "Failed to connect wallet";
277
- Y(ke, a.adapter.name), N(!1);
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, I, s]), Q(() => {
285
- g && le && o && a && (Be(a.adapter.name, o.toString()), y().debug("[CryptoSubscribeButton] Processing pending subscription payment"), N(!1), A(!1), me("crypto", r), te.current(r, c, { couponCode: i, intervalDays: f }));
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
- }), Ie("crypto", r), p && p("crypto"), D) {
294
- y().error("[CryptoSubscribeButton] Solana dependencies missing:", D), fe("crypto", D, r), P && P(D);
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
- N(!0);
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
- N(!1);
320
+ D(!1);
321
321
  const e = "No wallets available";
322
- throw Y(e), new Error(e);
322
+ throw V(e), new Error(e);
323
323
  }
324
324
  A(!0);
325
325
  }
326
326
  } catch (e) {
327
- N(!1);
327
+ D(!1);
328
328
  const d = e instanceof Error ? e.message : "Failed to connect wallet";
329
- y().error("[CryptoSubscribeButton] Connection error:", d), Y(d, a?.adapter.name);
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
- D,
344
+ O,
345
345
  p,
346
346
  P
347
347
  ]), de = G(() => `crypto-subscribe-${r}-${c}`, [r, c]), Ce = G(
348
- () => We(de, ue, {
348
+ () => _e(de, ue, {
349
349
  cooldownMs: 200,
350
350
  deduplicationWindowMs: 0
351
351
  }),
352
352
  [de, ue]
353
- ), pe = b === "loading" || b === "checking", $ = S === "active" || S === "trialing", xe = w || pe || I || !!D || $;
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(_).toLocaleDateString();
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(), N(!1), typeof window < "u" && window.localStorage)
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__ */ O(
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 && !T && /* @__PURE__ */ x(
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__ */ O(
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__ */ O(
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: qe(u.tokens.surfaceText),
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__ */ O(
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 && !T && !ie && /* @__PURE__ */ O(
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
- !T && se && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__error", children: se }),
556
- !T && ae && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__error", children: ae }),
557
- !T && $ && /* @__PURE__ */ x("div", { className: u.unstyled ? "" : "cedros-theme__success", children: v("ui.subscription_active") })
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, w] = B({
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, k] = B(null), [P, E] = B(null), C = z(!1), T = h(
567
+ }), [p, T] = I(null), [P, E] = I(null), C = N(!1), k = h(
568
568
  async (s) => {
569
569
  try {
570
- w((n) => ({ ...n, status: "loading" }));
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 k(t), w((n) => ({ ...n, status: "idle" })), t;
574
+ return T(t), S((n) => ({ ...n, status: "idle" })), t;
575
575
  } catch (t) {
576
- const n = K(t, "Failed to fetch refund requirement");
577
- throw w({
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
- ), q = h(
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
- w({
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
- k(n);
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), w({
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 = K(n, "Refund payment failed");
627
- throw w({
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
- w({
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
- k(t);
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), w({
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 = K(t, "Gasless refund payment failed");
678
- throw w({
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
- ), I = h(() => {
689
- w({
688
+ ), B = h(() => {
689
+ S({
690
690
  status: "idle",
691
691
  error: null,
692
692
  transactionId: null
693
- }), k(null), E(null);
693
+ }), T(null), E(null);
694
694
  }, []);
695
695
  return {
696
696
  state: R,
697
697
  requirement: p,
698
698
  settlement: P,
699
- fetchRefundQuote: T,
700
- processRefund: q,
699
+ fetchRefundQuote: k,
700
+ processRefund: W,
701
701
  processGaslessRefund: g,
702
- reset: I
702
+ reset: B
703
703
  };
704
704
  }
705
705
  export {
706
706
  Ue as CEDROS_EVENTS,
707
- Wt as CIRCUIT_BREAKER_PRESETS,
708
- Ve as CSP_PRESETS,
709
- Ye as CedrosPay,
710
- Vt as CedrosPayAdminDashboard,
711
- qt as CedrosProvider,
712
- _t as CircuitBreakerOpenError,
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
- Xt as CryptoButton,
719
+ tr as CryptoButton,
717
720
  $e as CryptoSubscribeButton,
718
721
  Lt as ERROR_CATEGORIES,
719
722
  At as KNOWN_STABLECOINS,
720
- Nt as LogLevel,
721
- Dt as Logger,
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
- zt as RATE_LIMITER_PRESETS,
727
- Kt as RETRY_PRESETS,
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
- tr as WalletPool,
736
+ ar as WalletPool,
734
737
  it as calculateDiscountPercentage,
735
- Yt as cedrosPayPlugin,
736
- Ot as createCircuitBreaker,
738
+ Xt as cedrosPayPlugin,
739
+ Kt as createCircuitBreaker,
737
740
  Qt as createLogger,
738
741
  $t as createRateLimiter,
739
742
  ct as createTranslator,
740
- rr as createWalletPool,
743
+ sr as createWalletPool,
741
744
  lt as detectLocale,
742
- Ht as ecommerce,
745
+ Zt as ecommerce,
743
746
  fe as emitPaymentError,
744
747
  me as emitPaymentProcessing,
745
- Ie as emitPaymentStart,
748
+ Be as emitPaymentStart,
746
749
  ve as emitPaymentSuccess,
747
750
  ye as emitWalletConnect,
748
- Be as emitWalletConnected,
749
- Y as emitWalletError,
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
- wt as loadLocale,
760
- St as logSecurityReport,
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
- _e as useCedrosTheme,
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
- kt as useStripeCheckout,
773
- Tt as useSubscription,
775
+ Tt as useStripeCheckout,
776
+ kt as useSubscription,
774
777
  vt as useSubscriptionManagement,
775
- Te as useTranslation,
776
- Zt as useX402Payment,
778
+ ke as useTranslation,
779
+ rr as useX402Payment,
777
780
  Gt as validateConfig,
778
- Bt as validateSecurity,
781
+ It as validateSecurity,
779
782
  jt as validateTokenMint
780
783
  };