@w3payments/react 1.1.0 → 1.1.2

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/index.mjs CHANGED
@@ -1,17 +1,17 @@
1
- import './assets/main.css';var Pe = Object.defineProperty, Re = Object.defineProperties;
2
- var Oe = Object.getOwnPropertyDescriptors;
3
- var ve = Object.getOwnPropertySymbols;
4
- var Le = Object.prototype.hasOwnProperty, Be = Object.prototype.propertyIsEnumerable;
5
- var ie = (n, e, o) => e in n ? Pe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, y = (n, e) => {
1
+ import './assets/main.css';var Re = Object.defineProperty, Oe = Object.defineProperties;
2
+ var Le = Object.getOwnPropertyDescriptors;
3
+ var ye = Object.getOwnPropertySymbols;
4
+ var Be = Object.prototype.hasOwnProperty, je = Object.prototype.propertyIsEnumerable;
5
+ var re = (n, e, o) => e in n ? Re(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, y = (n, e) => {
6
6
  for (var o in e || (e = {}))
7
- Le.call(e, o) && ie(n, o, e[o]);
8
- if (ve)
9
- for (var o of ve(e))
10
- Be.call(e, o) && ie(n, o, e[o]);
7
+ Be.call(e, o) && re(n, o, e[o]);
8
+ if (ye)
9
+ for (var o of ye(e))
10
+ je.call(e, o) && re(n, o, e[o]);
11
11
  return n;
12
- }, P = (n, e) => Re(n, Oe(e));
13
- var g = (n, e, o) => ie(n, typeof e != "symbol" ? e + "" : e, o);
14
- var w = (n, e, o) => new Promise((t, r) => {
12
+ }, P = (n, e) => Oe(n, Le(e));
13
+ var g = (n, e, o) => re(n, typeof e != "symbol" ? e + "" : e, o);
14
+ var S = (n, e, o) => new Promise((t, r) => {
15
15
  var i = (d) => {
16
16
  try {
17
17
  l(o.next(d));
@@ -27,12 +27,12 @@ var w = (n, e, o) => new Promise((t, r) => {
27
27
  }, l = (d) => d.done ? t(d.value) : Promise.resolve(d.value).then(i, a);
28
28
  l((o = o.apply(n, e)).next());
29
29
  });
30
- import je, { createContext as He, useMemo as de, useEffect as Xe, useContext as Ve, useState as J, Children as Ge, isValidElement as re } from "react";
31
- var K = { exports: {} }, Z = {};
32
- var ye;
33
- function We() {
34
- if (ye) return Z;
35
- ye = 1;
30
+ import He, { createContext as Xe, useMemo as me, useEffect as Ve, useContext as Ge, useState as ee, Children as We, isValidElement as ae } from "react";
31
+ var q = { exports: {} }, _ = {};
32
+ var Te;
33
+ function Ze() {
34
+ if (Te) return _;
35
+ Te = 1;
36
36
  var n = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
37
37
  function o(t, r, i) {
38
38
  var a = null;
@@ -49,47 +49,47 @@ function We() {
49
49
  props: i
50
50
  };
51
51
  }
52
- return Z.Fragment = e, Z.jsx = o, Z.jsxs = o, Z;
52
+ return _.Fragment = e, _.jsx = o, _.jsxs = o, _;
53
53
  }
54
- var F = {};
55
- var Te;
54
+ var $ = {};
55
+ var De;
56
56
  function ze() {
57
- return Te || (Te = 1, process.env.NODE_ENV !== "production" && (function() {
57
+ return De || (De = 1, process.env.NODE_ENV !== "production" && (function() {
58
58
  function n(s) {
59
59
  if (s == null) return null;
60
60
  if (typeof s == "function")
61
- return s.$$typeof === ne ? null : s.displayName || s.name || null;
61
+ return s.$$typeof === N ? null : s.displayName || s.name || null;
62
62
  if (typeof s == "string") return s;
63
63
  switch (s) {
64
- case I:
64
+ case T:
65
65
  return "Fragment";
66
- case X:
66
+ case ne:
67
67
  return "Profiler";
68
- case ee:
68
+ case I:
69
69
  return "StrictMode";
70
- case O:
70
+ case D:
71
71
  return "Suspense";
72
- case oe:
72
+ case L:
73
73
  return "SuspenseList";
74
- case N:
74
+ case A:
75
75
  return "Activity";
76
76
  }
77
77
  if (typeof s == "object")
78
78
  switch (typeof s.tag == "number" && console.error(
79
79
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
80
80
  ), s.$$typeof) {
81
- case A:
81
+ case R:
82
82
  return "Portal";
83
- case _:
83
+ case M:
84
84
  return s.displayName || "Context";
85
- case x:
85
+ case G:
86
86
  return (s._context.displayName || "Context") + ".Consumer";
87
- case k:
87
+ case K:
88
88
  var p = s.render;
89
89
  return s = s.displayName, s || (s = p.displayName || p.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
90
- case z:
90
+ case te:
91
91
  return p = s.displayName || null, p !== null ? p : n(s.type) || "Memo";
92
- case E:
92
+ case B:
93
93
  p = s._payload, s = s._init;
94
94
  try {
95
95
  return n(s(p));
@@ -105,7 +105,7 @@ function ze() {
105
105
  try {
106
106
  e(s);
107
107
  var p = !1;
108
- } catch (Q) {
108
+ } catch (J) {
109
109
  p = !0;
110
110
  }
111
111
  if (p) {
@@ -119,8 +119,8 @@ function ze() {
119
119
  }
120
120
  }
121
121
  function t(s) {
122
- if (s === I) return "<>";
123
- if (typeof s == "object" && s !== null && s.$$typeof === E)
122
+ if (s === T) return "<>";
123
+ if (typeof s == "object" && s !== null && s.$$typeof === B)
124
124
  return "<...>";
125
125
  try {
126
126
  var p = n(s);
@@ -130,14 +130,14 @@ function ze() {
130
130
  }
131
131
  }
132
132
  function r() {
133
- var s = V.A;
133
+ var s = Z.A;
134
134
  return s === null ? null : s.getOwner();
135
135
  }
136
136
  function i() {
137
137
  return Error("react-stack-top-frame");
138
138
  }
139
139
  function a(s) {
140
- if ($.call(s, "key")) {
140
+ if (z.call(s, "key")) {
141
141
  var p = Object.getOwnPropertyDescriptor(s, "key").get;
142
142
  if (p && p.isReactWarning) return !1;
143
143
  }
@@ -145,7 +145,7 @@ function ze() {
145
145
  }
146
146
  function l(s, p) {
147
147
  function h() {
148
- m || (m = !0, console.error(
148
+ Y || (Y = !0, console.error(
149
149
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
150
150
  p
151
151
  ));
@@ -157,14 +157,14 @@ function ze() {
157
157
  }
158
158
  function d() {
159
159
  var s = n(this.type);
160
- return b[s] || (b[s] = !0, console.error(
160
+ return m[s] || (m[s] = !0, console.error(
161
161
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
162
162
  )), s = this.props.ref, s !== void 0 ? s : null;
163
163
  }
164
- function u(s, p, h, f, Q, se) {
164
+ function u(s, p, h, f, J, ce) {
165
165
  var v = h.ref;
166
166
  return s = {
167
- $$typeof: C,
167
+ $$typeof: x,
168
168
  type: s,
169
169
  key: p,
170
170
  props: h,
@@ -186,33 +186,33 @@ function ze() {
186
186
  configurable: !1,
187
187
  enumerable: !1,
188
188
  writable: !0,
189
- value: Q
189
+ value: J
190
190
  }), Object.defineProperty(s, "_debugTask", {
191
191
  configurable: !1,
192
192
  enumerable: !1,
193
193
  writable: !0,
194
- value: se
194
+ value: ce
195
195
  }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
196
196
  }
197
- function T(s, p, h, f, Q, se) {
197
+ function U(s, p, h, f, J, ce) {
198
198
  var v = p.children;
199
199
  if (v !== void 0)
200
200
  if (f)
201
- if (te(v)) {
201
+ if (se(v)) {
202
202
  for (f = 0; f < v.length; f++)
203
- M(v[f]);
203
+ w(v[f]);
204
204
  Object.freeze && Object.freeze(v);
205
205
  } else
206
206
  console.error(
207
207
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
208
208
  );
209
- else M(v);
210
- if ($.call(p, "key")) {
209
+ else w(v);
210
+ if (z.call(p, "key")) {
211
211
  v = n(s);
212
- var W = Object.keys(p).filter(function(Ne) {
213
- return Ne !== "key";
212
+ var W = Object.keys(p).filter(function(Pe) {
213
+ return Pe !== "key";
214
214
  });
215
- f = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", fe[v + f] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
215
+ f = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", ve[v + f] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
216
216
  `A props object containing a "key" prop is being spread into JSX:
217
217
  let props = %s;
218
218
  <%s {...props} />
@@ -223,12 +223,12 @@ React keys must be passed directly to JSX without using spread:
223
223
  v,
224
224
  W,
225
225
  v
226
- ), fe[v + f] = !0);
226
+ ), ve[v + f] = !0);
227
227
  }
228
228
  if (v = null, h !== void 0 && (o(h), v = "" + h), a(p) && (o(p.key), v = "" + p.key), "key" in p) {
229
229
  h = {};
230
- for (var ce in p)
231
- ce !== "key" && (h[ce] = p[ce]);
230
+ for (var ie in p)
231
+ ie !== "key" && (h[ie] = p[ie]);
232
232
  } else h = p;
233
233
  return v && l(
234
234
  h,
@@ -238,62 +238,62 @@ React keys must be passed directly to JSX without using spread:
238
238
  v,
239
239
  h,
240
240
  r(),
241
- Q,
242
- se
241
+ J,
242
+ ce
243
243
  );
244
244
  }
245
- function M(s) {
246
- U(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === E && (s._payload.status === "fulfilled" ? U(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
245
+ function w(s) {
246
+ C(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === B && (s._payload.status === "fulfilled" ? C(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
247
247
  }
248
- function U(s) {
249
- return typeof s == "object" && s !== null && s.$$typeof === C;
248
+ function C(s) {
249
+ return typeof s == "object" && s !== null && s.$$typeof === x;
250
250
  }
251
- var D = je, C = Symbol.for("react.transitional.element"), A = Symbol.for("react.portal"), I = Symbol.for("react.fragment"), ee = Symbol.for("react.strict_mode"), X = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), ne = Symbol.for("react.client.reference"), V = D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, te = Array.isArray, G = console.createTask ? console.createTask : function() {
251
+ var E = He, x = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), I = Symbol.for("react.strict_mode"), ne = Symbol.for("react.profiler"), G = Symbol.for("react.consumer"), M = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), N = Symbol.for("react.client.reference"), Z = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, se = Array.isArray, F = console.createTask ? console.createTask : function() {
252
252
  return null;
253
253
  };
254
- D = {
254
+ E = {
255
255
  react_stack_bottom_frame: function(s) {
256
256
  return s();
257
257
  }
258
258
  };
259
- var m, b = {}, S = D.react_stack_bottom_frame.bind(
260
- D,
259
+ var Y, m = {}, b = E.react_stack_bottom_frame.bind(
260
+ E,
261
261
  i
262
- )(), he = G(t(i)), fe = {};
263
- F.Fragment = I, F.jsx = function(s, p, h) {
264
- var f = 1e4 > V.recentlyCreatedOwnerStacks++;
265
- return T(
262
+ )(), k = F(t(i)), ve = {};
263
+ $.Fragment = T, $.jsx = function(s, p, h) {
264
+ var f = 1e4 > Z.recentlyCreatedOwnerStacks++;
265
+ return U(
266
266
  s,
267
267
  p,
268
268
  h,
269
269
  !1,
270
- f ? Error("react-stack-top-frame") : S,
271
- f ? G(t(s)) : he
270
+ f ? Error("react-stack-top-frame") : b,
271
+ f ? F(t(s)) : k
272
272
  );
273
- }, F.jsxs = function(s, p, h) {
274
- var f = 1e4 > V.recentlyCreatedOwnerStacks++;
275
- return T(
273
+ }, $.jsxs = function(s, p, h) {
274
+ var f = 1e4 > Z.recentlyCreatedOwnerStacks++;
275
+ return U(
276
276
  s,
277
277
  p,
278
278
  h,
279
279
  !0,
280
- f ? Error("react-stack-top-frame") : S,
281
- f ? G(t(s)) : he
280
+ f ? Error("react-stack-top-frame") : b,
281
+ f ? F(t(s)) : k
282
282
  );
283
283
  };
284
- })()), F;
284
+ })()), $;
285
285
  }
286
- var De;
287
- function Ze() {
288
- return De || (De = 1, process.env.NODE_ENV === "production" ? K.exports = We() : K.exports = ze()), K.exports;
286
+ var ke;
287
+ function Fe() {
288
+ return ke || (ke = 1, process.env.NODE_ENV === "production" ? q.exports = Ze() : q.exports = ze()), q.exports;
289
289
  }
290
- var c = Ze();
291
- const B = class B {
290
+ var c = Fe();
291
+ const H = class H {
292
292
  constructor() {
293
293
  g(this, "paymentMethods", /* @__PURE__ */ new Map());
294
294
  }
295
295
  static getInstance() {
296
- return B.instance || (B.instance = new B()), B.instance;
296
+ return H.instance || (H.instance = new H()), H.instance;
297
297
  }
298
298
  /**
299
299
  * Register a new payment method
@@ -431,17 +431,13 @@ const B = class B {
431
431
  const o = this.getCryptoPaymentMethods().filter(
432
432
  (r) => r.method === "wallet"
433
433
  );
434
- if (console.log("getWalletMethods: All wallet methods:", o.length), console.log("getWalletMethods: Filters:", e), !e) return o;
435
- const t = o.filter((r) => {
434
+ return e ? o.filter((r) => {
436
435
  var d;
437
436
  const i = !((d = e.currencies) != null && d.length) || e.currencies.some(
438
437
  (u) => r.currency.toLowerCase() === u.toLowerCase()
439
- ), a = (!e.targetCurrency || r.currency.toLowerCase() === e.targetCurrency.toLowerCase()) && (!e.targetNetwork || r.network.toLowerCase() === e.targetNetwork.toLowerCase()), l = i && a;
440
- return console.log(
441
- `getWalletMethods: Method ${r.currency}/${r.network} - currencyMatches: ${i}, targetMatches: ${a}, overall: ${l}`
442
- ), l;
443
- });
444
- return console.log("getWalletMethods: Filtered result:", t.length), t;
438
+ ), a = (!e.targetCurrency || r.currency.toLowerCase() === e.targetCurrency.toLowerCase()) && (!e.targetNetwork || r.network.toLowerCase() === e.targetNetwork.toLowerCase());
439
+ return i && a;
440
+ }) : o;
445
441
  }
446
442
  /**
447
443
  * Get exchange payment methods with optional exchange and target filters
@@ -476,23 +472,16 @@ const B = class B {
476
472
  getDisplayOptions(e) {
477
473
  var t, r, i;
478
474
  const o = [];
479
- return console.log(
480
- "getDisplayOptions: Processing walletFilter:",
481
- e == null ? void 0 : e.walletFilter
482
- ), (t = e == null ? void 0 : e.walletFilter) == null || t.forEach((a) => {
483
- console.log(`getDisplayOptions: Processing wallet currency: ${a}`);
484
- const l = this.getWalletMethods({
475
+ return (t = e == null ? void 0 : e.walletFilter) == null || t.forEach((a) => {
476
+ this.getWalletMethods({
485
477
  currencies: [a],
486
478
  targetCurrency: e.targetCurrency,
487
479
  targetNetwork: e.targetNetwork
488
- });
489
- console.log(
490
- `getDisplayOptions: Found ${l.length} wallet methods for ${a}`
491
- ), l.length > 0 && (o.push({
480
+ }).length > 0 && o.push({
492
481
  id: `wallet-${a.toLowerCase()}`,
493
482
  displayName: a,
494
483
  method: "wallet"
495
- }), console.log(`getDisplayOptions: Added wallet option for ${a}`));
484
+ });
496
485
  }), (r = e == null ? void 0 : e.exchangeFilter) == null || r.forEach((a) => {
497
486
  this.getExchangeMethods({
498
487
  exchanges: [a],
@@ -519,9 +508,9 @@ const B = class B {
519
508
  this.paymentMethods.clear();
520
509
  }
521
510
  };
522
- g(B, "instance");
523
- let pe = B;
524
- const ke = pe.getInstance(), j = class j {
511
+ g(H, "instance");
512
+ let be = H;
513
+ const Se = be.getInstance(), X = class X {
525
514
  constructor() {
526
515
  g(this, "currencies", /* @__PURE__ */ new Map());
527
516
  g(this, "supportedCurrencies", {
@@ -530,7 +519,7 @@ const ke = pe.getInstance(), j = class j {
530
519
  });
531
520
  }
532
521
  static getInstance() {
533
- return j.instance || (j.instance = new j()), j.instance;
522
+ return X.instance || (X.instance = new X()), X.instance;
534
523
  }
535
524
  /**
536
525
  * Register a new currency
@@ -633,14 +622,14 @@ const ke = pe.getInstance(), j = class j {
633
622
  this.currencies.clear(), this.supportedCurrencies.sandbox.clear(), this.supportedCurrencies.production.clear();
634
623
  }
635
624
  };
636
- g(j, "instance");
637
- let me = j;
638
- const Se = me.getInstance(), H = class H {
625
+ g(X, "instance");
626
+ let ge = X;
627
+ const Ue = ge.getInstance(), V = class V {
639
628
  constructor() {
640
629
  g(this, "networks", /* @__PURE__ */ new Map());
641
630
  }
642
631
  static getInstance() {
643
- return H.instance || (H.instance = new H()), H.instance;
632
+ return V.instance || (V.instance = new V()), V.instance;
644
633
  }
645
634
  /**
646
635
  * Register a new network
@@ -691,9 +680,96 @@ const Se = me.getInstance(), H = class H {
691
680
  this.networks.clear();
692
681
  }
693
682
  };
694
- g(H, "instance");
695
- let be = H;
696
- const we = be.getInstance(), Fe = {
683
+ g(V, "instance");
684
+ let ue = V;
685
+ const we = ue.getInstance(), le = /* @__PURE__ */ new Map();
686
+ function Ye(n, e = !1) {
687
+ const o = `${n}-${e}`;
688
+ return le.has(o) || le.set(
689
+ o,
690
+ new Intl.NumberFormat("en-US", {
691
+ minimumFractionDigits: n,
692
+ maximumFractionDigits: n,
693
+ useGrouping: e
694
+ })
695
+ ), le.get(o);
696
+ }
697
+ function _e(n, e) {
698
+ const o = n;
699
+ return isNaN(o) ? "" : Ye(e, !1).format(o);
700
+ }
701
+ function $e(n, e) {
702
+ const o = n.split(".");
703
+ return o.length <= 1 ? !0 : o[1].length <= e.decimals;
704
+ }
705
+ function Qe(n, e) {
706
+ const o = n.split(".");
707
+ if (o.length <= 1) return n;
708
+ const t = o[1].substring(0, e.decimals);
709
+ return t.length > 0 ? `${o[0]}.${t}` : o[0];
710
+ }
711
+ function Ee(n) {
712
+ return n.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
713
+ }
714
+ function Ke() {
715
+ return {
716
+ colorPrimary: "#6366f1",
717
+ colorPrimaryHover: "#4f46e5",
718
+ colorPrimaryLight: "#e0e7ff",
719
+ colorBackground: "#ffffff",
720
+ colorText: "#1f2937",
721
+ colorTextMuted: "#6b7280",
722
+ colorBorder: "#e5e7eb",
723
+ colorBorderLight: "#f3f4f6",
724
+ colorDanger: "#ef4444",
725
+ colorSuccess: "#10b981",
726
+ fontFamily: "system-ui, -apple-system, sans-serif",
727
+ fontSize: "1rem",
728
+ borderRadius: "0.5rem",
729
+ spacing: "1rem"
730
+ };
731
+ }
732
+ function Je(n) {
733
+ const e = Ke();
734
+ switch (n) {
735
+ case "dark":
736
+ return P(y({}, e), {
737
+ colorPrimary: "#6366f1",
738
+ colorPrimaryHover: "#7c3aed",
739
+ colorPrimaryLight: "#1e1b4b",
740
+ colorBackground: "#111827",
741
+ colorText: "#f9fafb",
742
+ colorTextMuted: "#9ca3af",
743
+ colorBorder: "#374151",
744
+ colorBorderLight: "#4b5563"
745
+ });
746
+ case "light":
747
+ default:
748
+ return e;
749
+ }
750
+ }
751
+ function qe(n, e) {
752
+ var i;
753
+ const o = typeof n == "string" ? { theme: n } : n, t = Je((i = o.theme) != null ? i : "light"), r = y(y({}, t), o.variables);
754
+ Object.entries(r).forEach(([a, l]) => {
755
+ if (l !== void 0) {
756
+ const d = `--${Ee(a)}`;
757
+ e.style.setProperty(d, l);
758
+ }
759
+ }), o.theme && e.setAttribute("data-theme", o.theme), o.rules && eo(o.rules);
760
+ }
761
+ function eo(n) {
762
+ const e = "w3-theme-rules";
763
+ let o = document.getElementById(e);
764
+ o || (o = document.createElement("style"), o.id = e, document.head.appendChild(o));
765
+ const t = Object.entries(n).map(([r, i]) => {
766
+ const a = Object.entries(i).map(([l, d]) => `${Ee(l)}: ${d};`).join(" ");
767
+ return `.w3-widget ${r} { ${a} }`;
768
+ }).join(`
769
+ `);
770
+ o.textContent = t;
771
+ }
772
+ const oo = {
697
773
  USD: {
698
774
  code: "USD",
699
775
  name: "US Dollar",
@@ -723,7 +799,7 @@ const we = be.getInstance(), Fe = {
723
799
  isStablecoin: !1,
724
800
  iconUrl: "https://cdn.jsdelivr.net/gh/atomiclabs/cryptocurrency-icons@1a63530be6e374711a8554f31b17e4cb92c25fa5/svg/icon/eth.svg"
725
801
  }
726
- }, Ye = {
802
+ }, no = {
727
803
  bitcoin: {
728
804
  id: "bitcoin",
729
805
  name: "Bitcoin",
@@ -735,7 +811,7 @@ const we = be.getInstance(), Fe = {
735
811
  symbol: "ETH",
736
812
  chainId: 1
737
813
  }
738
- }, _e = {
814
+ }, to = {
739
815
  // Major Cryptocurrencies
740
816
  BTC: "https://cryptologos.cc/logos/bitcoin-btc-logo.svg",
741
817
  ETH: "https://cryptologos.cc/logos/ethereum-eth-logo.svg",
@@ -760,10 +836,10 @@ const we = be.getInstance(), Fe = {
760
836
  ADA: "https://cryptologos.cc/logos/cardano-ada-logo.svg",
761
837
  DOT: "https://cryptologos.cc/logos/polkadot-new-dot-logo.svg"
762
838
  };
763
- function Ce(n) {
764
- return _e[n.toUpperCase()];
839
+ function Me(n) {
840
+ return to[n.toUpperCase()];
765
841
  }
766
- const $e = {
842
+ const so = {
767
843
  // Major Exchanges
768
844
  coinbase: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiIGZpbGw9IiMwMDUyRkYiLz4KPHJlY3QgeD0iOSIgeT0iOSIgd2lkdGg9IjYiIGhlaWdodD0iNiIgcng9IjEiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPg==",
769
845
  kraken: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiIGZpbGw9IiM1NzQxOUEiLz4KPHBhdGggZD0iTTggN0wxNiA5VjE3TDggMTVWN1oiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPg==",
@@ -779,10 +855,10 @@ const $e = {
779
855
  "coinbase-pro": "https://assets.coincap.io/assets/icons/256/coinbase.png",
780
856
  "binance-us": "https://assets.coincap.io/assets/icons/256/binance.png"
781
857
  };
782
- function Ee(n) {
783
- return $e[n.toLowerCase()];
858
+ function xe(n) {
859
+ return so[n.toLowerCase()];
784
860
  }
785
- const Qe = {
861
+ const co = {
786
862
  // Bank Transfer Methods
787
863
  ach: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMgN1YxN0gyMVY3SDNaTTQgOEgyMFYxNkg0VjhaTTYgMTBWMTRIOVYxMEg2Wk0xMCAxMFYxMUgxOFYxMEgxMFpNMTAgMTJWMTNIMTVWMTJIMTBaIiBmaWxsPSJjdXJyZW50Q29sb3IiLz4KPC9zdmc+",
788
864
  wire: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMTMuMDkgOC4yNkwyMCA5TDEzLjA5IDE1Ljc0TDEyIDIyTDEwLjkxIDE1Ljc0TDQgOUwxMC45MSA4LjI2TDEyIDJaIiBmaWxsPSJjdXJyZW50Q29sb3IiLz4KPC9zdmc+",
@@ -798,10 +874,10 @@ const Qe = {
798
874
  bank: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMgN1YxN0gyMVY3SDNaTTQgOEgyMFYxNkg0VjhaTTYgMTBWMTRIOVYxMEg2Wk0xMCAxMFYxMUgxOFYxMEgxMFpNMTAgMTJWMTNIMTVWMTJIMTBaIiBmaWxsPSJjdXJyZW50Q29sb3IiLz4KPC9zdmc+",
799
875
  other: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDhDMTMuMSA4IDE0IDcuMSAxNCA2UzEzLjEgNCAxMiA0IDEwIDQuOSAxMCA2UzEwLjkgOCAxMiA4Wk0xMiAxMEMxMC45IDEwIDEwIDEwLjkgMTAgMTJTMTAuOSAxNCAxMiAxNFMxNCAxMy4xIDE0IDEyUzEzLjEgMTAgMTIgMTBaTTEyIDE2QzEwLjkgMTYgMTAgMTYuOSAxMCAxOFMxMC45IDIwIDEyIDIwUzE0IDE5LjEgMTQgMThTMTMuMSAxNiAxMiAxNloiIGZpbGw9ImN1cnJlbnRDb2xvciIvPgo8L3N2Zz4K"
800
876
  };
801
- function Me(n) {
802
- return Qe[n.toLowerCase()];
877
+ function Ne(n) {
878
+ return co[n.toLowerCase()];
803
879
  }
804
- var Ke = {
880
+ var io = {
805
881
  content: {
806
882
  integrations: [
807
883
  {
@@ -2941,7 +3017,7 @@ var Ke = {
2941
3017
  message: "",
2942
3018
  errorHash: "41f47591",
2943
3019
  errorType: ""
2944
- }, Je = {
3020
+ }, ro = {
2945
3021
  content: {
2946
3022
  networks: [
2947
3023
  {
@@ -4205,7 +4281,7 @@ var Ke = {
4205
4281
  message: "",
4206
4282
  errorHash: "41f47591",
4207
4283
  errorType: ""
4208
- }, qe = {
4284
+ }, ao = {
4209
4285
  krakenDirect: "kraken",
4210
4286
  coinbase: "coinbase",
4211
4287
  binanceConnect: "binance",
@@ -4219,10 +4295,10 @@ var Ke = {
4219
4295
  robinhood: "robinhood",
4220
4296
  uphold: "uphold"
4221
4297
  };
4222
- function eo(n) {
4223
- return qe[n] || null;
4298
+ function lo(n) {
4299
+ return ao[n] || null;
4224
4300
  }
4225
- var oo = {
4301
+ var po = {
4226
4302
  Ethereum: "ethereum",
4227
4303
  Bitcoin: "bitcoin",
4228
4304
  Solana: "solana",
@@ -4240,10 +4316,10 @@ var oo = {
4240
4316
  Injective: "injective",
4241
4317
  Moonbeam: "moonbeam"
4242
4318
  };
4243
- function Ue(n) {
4244
- return oo[n] || n.toLowerCase();
4319
+ function Ie(n) {
4320
+ return po[n] || n.toLowerCase();
4245
4321
  }
4246
- var no = {
4322
+ var mo = {
4247
4323
  // Most currencies are already normalized, but add special cases here
4248
4324
  WETH: "ETH",
4249
4325
  // Wrapped ETH maps to ETH
@@ -4252,9 +4328,9 @@ var no = {
4252
4328
  // Add other wrapped/special tokens as needed
4253
4329
  };
4254
4330
  function Ae(n) {
4255
- return no[n] || n;
4331
+ return mo[n] || n;
4256
4332
  }
4257
- var to = class {
4333
+ var bo = class {
4258
4334
  constructor(n = "sandbox") {
4259
4335
  g(this, "id", "meshpay");
4260
4336
  g(this, "name", "MeshPay");
@@ -4264,7 +4340,7 @@ var to = class {
4264
4340
  this.environment = n;
4265
4341
  }
4266
4342
  initialize(n) {
4267
- return w(this, null, function* () {
4343
+ return S(this, null, function* () {
4268
4344
  const e = n[this.id];
4269
4345
  if (!(e != null && e.clientId) || !(e != null && e.clientSecret))
4270
4346
  throw new Error(
@@ -4289,7 +4365,7 @@ var to = class {
4289
4365
  mapExchanges() {
4290
4366
  const n = this.getIntegrationsData().content.integrations, e = [];
4291
4367
  return n.forEach((o) => {
4292
- const t = eo(o.type);
4368
+ const t = lo(o.type);
4293
4369
  if (!t) {
4294
4370
  console.warn(
4295
4371
  `Skipping unknown MeshPay integration type: ${o.type}`
@@ -4297,7 +4373,7 @@ var to = class {
4297
4373
  return;
4298
4374
  }
4299
4375
  o.networks.forEach((r) => {
4300
- const i = Ue(r.name);
4376
+ const i = Ie(r.name);
4301
4377
  r.supportedTokens.forEach((a) => {
4302
4378
  const l = Ae(a);
4303
4379
  e.push({
@@ -4328,7 +4404,7 @@ var to = class {
4328
4404
  mapWallets() {
4329
4405
  const n = this.getNetworksData().content.networks, e = [];
4330
4406
  return n.forEach((o) => {
4331
- const t = Ue(o.name);
4407
+ const t = Ie(o.name);
4332
4408
  o.supportedTokens.forEach((r) => {
4333
4409
  const i = Ae(r);
4334
4410
  e.push({
@@ -4357,16 +4433,16 @@ var to = class {
4357
4433
  }
4358
4434
  getIntegrationsData() {
4359
4435
  if (this.environment === "sandbox")
4360
- return Ke;
4436
+ return io;
4361
4437
  throw new Error("Production integrations data loading not implemented");
4362
4438
  }
4363
4439
  getNetworksData() {
4364
4440
  if (this.environment === "sandbox")
4365
- return Je;
4441
+ return ro;
4366
4442
  throw new Error("Production networks data loading not implemented");
4367
4443
  }
4368
4444
  createCheckoutSession(n) {
4369
- return w(this, null, function* () {
4445
+ return S(this, null, function* () {
4370
4446
  if (!this.initialized)
4371
4447
  throw new Error("MeshPay adapter not initialized");
4372
4448
  try {
@@ -4409,7 +4485,7 @@ var to = class {
4409
4485
  return o.id;
4410
4486
  }
4411
4487
  generateLinkToken(n) {
4412
- return w(this, null, function* () {
4488
+ return S(this, null, function* () {
4413
4489
  if (!this.config)
4414
4490
  throw new Error("Adapter not initialized");
4415
4491
  const e = {
@@ -4457,7 +4533,7 @@ var to = class {
4457
4533
  * Open MeshPay checkout using their Web Link SDK
4458
4534
  */
4459
4535
  openCheckout(n) {
4460
- return w(this, null, function* () {
4536
+ return S(this, null, function* () {
4461
4537
  if (!n.metadata || !n.metadata.linkToken)
4462
4538
  throw new Error("Missing linkToken in checkout session metadata");
4463
4539
  if (!n.metadata.clientId)
@@ -4505,19 +4581,19 @@ var to = class {
4505
4581
  });
4506
4582
  }
4507
4583
  getPaymentStatus(n) {
4508
- return w(this, null, function* () {
4584
+ return S(this, null, function* () {
4509
4585
  throw new Error(
4510
4586
  "getPaymentStatus not implemented - MeshPay uses webhooks for status updates"
4511
4587
  );
4512
4588
  });
4513
4589
  }
4514
4590
  };
4515
- class q extends Error {
4591
+ class oe extends Error {
4516
4592
  constructor(o, t = "PAYMENT_ERROR", r) {
4517
4593
  super(o);
4518
4594
  g(this, "code");
4519
4595
  g(this, "context");
4520
- this.name = "PaymentError", this.code = t, this.context = r, Error.captureStackTrace && Error.captureStackTrace(this, q);
4596
+ this.name = "PaymentError", this.code = t, this.context = r, Error.captureStackTrace && Error.captureStackTrace(this, oe);
4521
4597
  }
4522
4598
  toJSON() {
4523
4599
  return {
@@ -4529,23 +4605,23 @@ class q extends Error {
4529
4605
  };
4530
4606
  }
4531
4607
  }
4532
- class R extends q {
4608
+ class O extends oe {
4533
4609
  constructor(e, o) {
4534
4610
  super(e, "PAYMENT_VALIDATION_ERROR", o), this.name = "PaymentValidationError";
4535
4611
  }
4536
4612
  }
4537
- class L extends q {
4613
+ class j extends oe {
4538
4614
  constructor(e, o) {
4539
4615
  super(e, "PAYMENT_EXECUTION_ERROR", o), this.name = "PaymentExecutionError";
4540
4616
  }
4541
4617
  }
4542
- class Y extends Error {
4618
+ class Q extends Error {
4543
4619
  constructor(o, t = "ADAPTER_ERROR", r, i) {
4544
4620
  super(o);
4545
4621
  g(this, "code");
4546
4622
  g(this, "vendorId");
4547
4623
  g(this, "context");
4548
- this.name = "AdapterError", this.code = t, this.vendorId = r, this.context = i, Error.captureStackTrace && Error.captureStackTrace(this, Y);
4624
+ this.name = "AdapterError", this.code = t, this.vendorId = r, this.context = i, Error.captureStackTrace && Error.captureStackTrace(this, Q);
4549
4625
  }
4550
4626
  toJSON() {
4551
4627
  return {
@@ -4558,7 +4634,7 @@ class Y extends Error {
4558
4634
  };
4559
4635
  }
4560
4636
  }
4561
- class so extends Y {
4637
+ class go extends Q {
4562
4638
  constructor(e, o) {
4563
4639
  super(
4564
4640
  `Payment adapter for vendor "${e}" not found`,
@@ -4568,7 +4644,7 @@ class so extends Y {
4568
4644
  ), this.name = "AdapterNotFoundError";
4569
4645
  }
4570
4646
  }
4571
- class co extends Y {
4647
+ class uo extends Q {
4572
4648
  constructor(e, o, t) {
4573
4649
  super(
4574
4650
  `Failed to initialize adapter for vendor "${e}": ${o}`,
@@ -4578,7 +4654,7 @@ class co extends Y {
4578
4654
  ), this.name = "AdapterInitializationError";
4579
4655
  }
4580
4656
  }
4581
- class io extends Y {
4657
+ class ho extends Q {
4582
4658
  constructor(e, o, t) {
4583
4659
  super(
4584
4660
  `Configuration error for adapter "${e}": ${o}`,
@@ -4588,7 +4664,7 @@ class io extends Y {
4588
4664
  ), this.name = "AdapterConfigurationError";
4589
4665
  }
4590
4666
  }
4591
- class Ie {
4667
+ class Ce {
4592
4668
  constructor() {
4593
4669
  g(this, "adapters", /* @__PURE__ */ new Map());
4594
4670
  g(this, "initialized", !1);
@@ -4598,7 +4674,7 @@ class Ie {
4598
4674
  */
4599
4675
  register(e) {
4600
4676
  if (this.adapters.has(e.id))
4601
- throw new io(
4677
+ throw new ho(
4602
4678
  e.id,
4603
4679
  "Adapter already registered"
4604
4680
  );
@@ -4610,7 +4686,7 @@ class Ie {
4610
4686
  get(e) {
4611
4687
  const o = this.adapters.get(e);
4612
4688
  if (!o)
4613
- throw new so(e);
4689
+ throw new go(e);
4614
4690
  return o;
4615
4691
  }
4616
4692
  /**
@@ -4635,15 +4711,15 @@ class Ie {
4635
4711
  * Initialize all registered adapters
4636
4712
  */
4637
4713
  initialize(e) {
4638
- return w(this, null, function* () {
4714
+ return S(this, null, function* () {
4639
4715
  if (this.initialized)
4640
4716
  return;
4641
4717
  const o = Array.from(this.adapters.entries()).map(
4642
- (i) => w(this, [i], function* ([t, r]) {
4718
+ (i) => S(this, [i], function* ([t, r]) {
4643
4719
  try {
4644
4720
  yield r.initialize(e);
4645
4721
  } catch (a) {
4646
- throw new co(
4722
+ throw new uo(
4647
4723
  t,
4648
4724
  a instanceof Error ? a.message : "Unknown error",
4649
4725
  { originalError: a }
@@ -4674,12 +4750,12 @@ class Ie {
4674
4750
  return o && this.adapters.size === 0 && (this.initialized = !1), o;
4675
4751
  }
4676
4752
  }
4677
- class ge {
4753
+ class he {
4678
4754
  constructor(e) {
4679
4755
  g(this, "registry");
4680
- g(this, "currencyService", Se);
4756
+ g(this, "currencyService", Ue);
4681
4757
  g(this, "networkService", we);
4682
- g(this, "paymentMethodService", ke);
4758
+ g(this, "paymentMethodService", Se);
4683
4759
  g(this, "options");
4684
4760
  g(this, "clientMode", !1);
4685
4761
  /**
@@ -4690,20 +4766,20 @@ class ge {
4690
4766
  * Create a payment intent and checkout session
4691
4767
  * Automatically selects the best vendor
4692
4768
  */
4693
- create: (e) => w(this, null, function* () {
4769
+ create: (e) => S(this, null, function* () {
4694
4770
  var r;
4695
4771
  if (!this.isInitialized())
4696
- throw new L("W3Payments client not initialized");
4772
+ throw new j("W3Payments client not initialized");
4697
4773
  if (!e.amount || e.amount <= 0)
4698
- throw new R("Amount must be greater than 0");
4774
+ throw new O("Amount must be greater than 0");
4699
4775
  if (!e.currency)
4700
- throw new R("Currency is required");
4776
+ throw new O("Currency is required");
4701
4777
  if (!e.id)
4702
- throw new R("Payment ID is required");
4778
+ throw new O("Payment ID is required");
4703
4779
  if (!e.customerId)
4704
- throw new R("Customer ID is required");
4780
+ throw new O("Customer ID is required");
4705
4781
  if (!e.destinations || e.destinations.length === 0)
4706
- throw new R(
4782
+ throw new O(
4707
4783
  "At least one destination is required"
4708
4784
  );
4709
4785
  const o = this.selectBestVendor(e), t = {
@@ -4724,7 +4800,7 @@ class ge {
4724
4800
  selectedVendor: ((r = a.metadata) == null ? void 0 : r.selectedVendor) || o
4725
4801
  });
4726
4802
  } catch (i) {
4727
- throw new L(
4803
+ throw new j(
4728
4804
  `Payment creation failed: ${i instanceof Error ? i.message : "Unknown error"}`,
4729
4805
  { intent: t, selectedVendor: o, originalError: i }
4730
4806
  );
@@ -4733,32 +4809,32 @@ class ge {
4733
4809
  /**
4734
4810
  * Get payment status
4735
4811
  */
4736
- retrieve: (e, o) => w(this, null, function* () {
4812
+ retrieve: (e, o) => S(this, null, function* () {
4737
4813
  if (!this.isInitialized())
4738
- throw new L("W3Payments client not initialized");
4814
+ throw new j("W3Payments client not initialized");
4739
4815
  if (!e)
4740
- throw new R("Session ID is required");
4816
+ throw new O("Session ID is required");
4741
4817
  if (!o)
4742
- throw new R("Vendor ID is required");
4818
+ throw new O("Vendor ID is required");
4743
4819
  try {
4744
4820
  return yield this.registry.get(o).getPaymentStatus(e);
4745
4821
  } catch (t) {
4746
- throw new L(
4822
+ throw new j(
4747
4823
  `Payment status retrieval failed: ${t instanceof Error ? t.message : "Unknown error"}`,
4748
4824
  { sessionId: e, vendorId: o, originalError: t }
4749
4825
  );
4750
4826
  }
4751
4827
  })
4752
4828
  });
4753
- this.options = e, this.registry = new Ie(), this.configureCurrencies(), this.configureNetworks(), this.registerAdapters();
4829
+ this.options = e, this.registry = new Ce(), this.configureCurrencies(), this.configureNetworks(), this.registerAdapters();
4754
4830
  }
4755
4831
  /**
4756
4832
  * Create a client-only instance for data access (no vendor secrets needed)
4757
4833
  * Only initializes currencies, networks, and registers adapters without API initialization
4758
4834
  */
4759
4835
  static createClient(e = "sandbox") {
4760
- const o = Object.create(ge.prototype);
4761
- return o.currencyService = Se, o.networkService = we, o.paymentMethodService = ke, o.registry = new Ie(), o.clientMode = !0, o.options = {
4836
+ const o = Object.create(he.prototype);
4837
+ return o.currencyService = Ue, o.networkService = we, o.paymentMethodService = Se, o.registry = new Ce(), o.clientMode = !0, o.options = {
4762
4838
  config: {
4763
4839
  environment: e
4764
4840
  }
@@ -4768,13 +4844,13 @@ class ge {
4768
4844
  * Configure currencies from CURRENCIES data
4769
4845
  */
4770
4846
  configureCurrencies() {
4771
- this.currencyService.registerMany(Object.values(Fe));
4847
+ this.currencyService.registerMany(Object.values(oo));
4772
4848
  }
4773
4849
  /**
4774
4850
  * Configure networks from NETWORKS data
4775
4851
  */
4776
4852
  configureNetworks() {
4777
- this.networkService.registerMany(Object.values(Ye));
4853
+ this.networkService.registerMany(Object.values(no));
4778
4854
  }
4779
4855
  /**
4780
4856
  * Register all available adapters
@@ -4782,13 +4858,13 @@ class ge {
4782
4858
  */
4783
4859
  registerAdapters() {
4784
4860
  const e = this.options.config.environment || "sandbox";
4785
- this.registry.register(new to(e));
4861
+ this.registry.register(new bo(e));
4786
4862
  }
4787
4863
  /**
4788
4864
  * Initialize the W3Payments client and all adapters
4789
4865
  */
4790
4866
  initialize() {
4791
- return w(this, null, function* () {
4867
+ return S(this, null, function* () {
4792
4868
  const e = P(y({}, this.options.config), {
4793
4869
  environment: this.options.environment || this.options.config.environment
4794
4870
  });
@@ -4844,22 +4920,22 @@ class ge {
4844
4920
  * Uses the complete CheckoutSession returned from payment creation
4845
4921
  */
4846
4922
  openCheckout(e) {
4847
- return w(this, null, function* () {
4923
+ return S(this, null, function* () {
4848
4924
  var t, r;
4849
4925
  const o = ((t = e.metadata) == null ? void 0 : t.selectedVendor) || ((r = e.metadata) == null ? void 0 : r.vendorId);
4850
4926
  if (!o)
4851
- throw new R(
4927
+ throw new O(
4852
4928
  "Vendor ID not found in session metadata"
4853
4929
  );
4854
4930
  try {
4855
4931
  const i = this.registry.get(o);
4856
4932
  if (!i.openCheckout)
4857
- throw new L(
4933
+ throw new j(
4858
4934
  `Vendor ${o} does not support client-side checkout opening`
4859
4935
  );
4860
4936
  return yield i.openCheckout(e);
4861
4937
  } catch (i) {
4862
- throw new L(
4938
+ throw new j(
4863
4939
  `Checkout opening failed: ${i instanceof Error ? i.message : "Unknown error"}`,
4864
4940
  { sessionId: e.id, vendorId: o, originalError: i }
4865
4941
  );
@@ -4873,78 +4949,17 @@ class ge {
4873
4949
  selectBestVendor(e) {
4874
4950
  const o = this.getAvailableVendors();
4875
4951
  if (o.length === 0)
4876
- throw new L("No payment vendors available");
4952
+ throw new j("No payment vendors available");
4877
4953
  return e.preferredVendor && this.hasVendor(e.preferredVendor) ? e.preferredVendor : o[0];
4878
4954
  }
4879
4955
  }
4880
- function xe(n) {
4881
- return n.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
4882
- }
4883
- function ro() {
4884
- return {
4885
- colorPrimary: "#6366f1",
4886
- colorPrimaryHover: "#4f46e5",
4887
- colorPrimaryLight: "#e0e7ff",
4888
- colorBackground: "#ffffff",
4889
- colorText: "#1f2937",
4890
- colorTextMuted: "#6b7280",
4891
- colorBorder: "#e5e7eb",
4892
- colorBorderLight: "#f3f4f6",
4893
- colorDanger: "#ef4444",
4894
- colorSuccess: "#10b981",
4895
- fontFamily: "system-ui, -apple-system, sans-serif",
4896
- fontSize: "1rem",
4897
- borderRadius: "0.5rem",
4898
- spacing: "1rem"
4899
- };
4900
- }
4901
- function ao(n) {
4902
- const e = ro();
4903
- switch (n) {
4904
- case "dark":
4905
- return P(y({}, e), {
4906
- colorPrimary: "#6366f1",
4907
- colorPrimaryHover: "#7c3aed",
4908
- colorPrimaryLight: "#1e1b4b",
4909
- colorBackground: "#111827",
4910
- colorText: "#f9fafb",
4911
- colorTextMuted: "#9ca3af",
4912
- colorBorder: "#374151",
4913
- colorBorderLight: "#4b5563"
4914
- });
4915
- case "light":
4916
- default:
4917
- return e;
4918
- }
4919
- }
4920
- function lo(n, e) {
4921
- var i;
4922
- const o = typeof n == "string" ? { theme: n } : n, t = ao((i = o.theme) != null ? i : "light"), r = y(y({}, t), o.variables);
4923
- Object.entries(r).forEach(([a, l]) => {
4924
- if (l !== void 0) {
4925
- const d = `--${xe(a)}`;
4926
- e.style.setProperty(d, l);
4927
- }
4928
- }), o.theme && e.setAttribute("data-theme", o.theme), o.rules && po(o.rules);
4929
- }
4930
- function po(n) {
4931
- const e = "w3-theme-rules";
4932
- let o = document.getElementById(e);
4933
- o || (o = document.createElement("style"), o.id = e, document.head.appendChild(o));
4934
- const t = Object.entries(n).map(([r, i]) => {
4935
- const a = Object.entries(i).map(([l, d]) => `${xe(l)}: ${d};`).join(" ");
4936
- return `.w3-widget ${r} { ${a} }`;
4937
- }).join(`
4938
- `);
4939
- o.textContent = t;
4940
- }
4941
- class mo {
4956
+ class fo {
4942
4957
  constructor(e) {
4943
4958
  g(this, "config");
4944
4959
  this.config = e;
4945
4960
  }
4946
4961
  makeRequest(t) {
4947
- return w(this, arguments, function* (e, o = {}) {
4962
+ return S(this, arguments, function* (e, o = {}) {
4948
4963
  const r = yield globalThis.fetch(`${this.config.endpoint}${e}`, y({
4949
4964
  headers: y(y({
4950
4965
  "Content-Type": "application/json"
@@ -4956,7 +4971,7 @@ class mo {
4956
4971
  });
4957
4972
  }
4958
4973
  createPayment(e) {
4959
- return w(this, null, function* () {
4974
+ return S(this, null, function* () {
4960
4975
  return this.makeRequest("/payment/create", {
4961
4976
  method: "POST",
4962
4977
  body: JSON.stringify(e)
@@ -4964,7 +4979,7 @@ class mo {
4964
4979
  });
4965
4980
  }
4966
4981
  getPaymentStatus(e, o) {
4967
- return w(this, null, function* () {
4982
+ return S(this, null, function* () {
4968
4983
  return this.makeRequest(`/payment/${e}?vendorId=${o}`, {
4969
4984
  method: "GET"
4970
4985
  });
@@ -4974,41 +4989,41 @@ class mo {
4974
4989
  return !!this.config.endpoint;
4975
4990
  }
4976
4991
  }
4977
- const ue = He(
4992
+ const fe = Xe(
4978
4993
  null
4979
4994
  );
4980
- ue.displayName = "W3PaymentsContext";
4981
- const So = ({
4995
+ fe.displayName = "W3PaymentsContext";
4996
+ const Co = ({
4982
4997
  endpoint: n,
4983
4998
  environment: e = "sandbox",
4984
4999
  theme: o,
4985
5000
  children: t
4986
5001
  }) => {
4987
- const { w3payments: r, httpClient: i, isInitialized: a, initError: l } = de(() => {
5002
+ const { w3payments: r, httpClient: i, isInitialized: a, initError: l } = me(() => {
4988
5003
  try {
4989
5004
  console.debug("W3PaymentsProvider: Initializing clients...");
4990
- const u = ge.createClient(e), T = new mo({ endpoint: n });
5005
+ const u = he.createClient(e), U = new fo({ endpoint: n });
4991
5006
  return console.debug(
4992
5007
  "W3PaymentsProvider: Both clients initialized successfully"
4993
5008
  ), {
4994
5009
  w3payments: u,
4995
- httpClient: T,
5010
+ httpClient: U,
4996
5011
  isInitialized: !0,
4997
5012
  initError: null
4998
5013
  };
4999
5014
  } catch (u) {
5000
- const T = u instanceof Error ? u.message : "Failed to initialize W3Payments clients";
5015
+ const U = u instanceof Error ? u.message : "Failed to initialize W3Payments clients";
5001
5016
  return console.error("W3PaymentsProvider initialization error:", u), {
5002
5017
  w3payments: null,
5003
5018
  httpClient: null,
5004
5019
  isInitialized: !1,
5005
- initError: T
5020
+ initError: U
5006
5021
  };
5007
5022
  }
5008
5023
  }, [n, e]);
5009
- Xe(() => {
5010
- o && document.querySelectorAll(".w3-widget").forEach((T) => {
5011
- lo(o, T);
5024
+ Ve(() => {
5025
+ o && document.querySelectorAll(".w3-widget").forEach((U) => {
5026
+ qe(o, U);
5012
5027
  });
5013
5028
  }, [o]);
5014
5029
  const d = {
@@ -5035,7 +5050,7 @@ const So = ({
5035
5050
  /* @__PURE__ */ c.jsx("p", { style: { margin: "8px 0 0 0" }, children: l })
5036
5051
  ]
5037
5052
  }
5038
- ) : a ? /* @__PURE__ */ c.jsx(ue.Provider, { value: d, children: t }) : /* @__PURE__ */ c.jsx(
5053
+ ) : a ? /* @__PURE__ */ c.jsx(fe.Provider, { value: d, children: t }) : /* @__PURE__ */ c.jsx(
5039
5054
  "div",
5040
5055
  {
5041
5056
  className: "w3-loading-container",
@@ -5048,14 +5063,14 @@ const So = ({
5048
5063
  children: "Initializing W3Payments..."
5049
5064
  }
5050
5065
  );
5051
- }, bo = () => {
5052
- const n = Ve(ue);
5066
+ }, vo = () => {
5067
+ const n = Ge(fe);
5053
5068
  if (!n)
5054
5069
  throw new Error(
5055
5070
  "useW3Payments must be used within W3PaymentsProvider. Make sure your component is wrapped with <W3PaymentsProvider>."
5056
5071
  );
5057
5072
  return n;
5058
- }, go = ({
5073
+ }, yo = ({
5059
5074
  title: n,
5060
5075
  logo: e
5061
5076
  }) => /* @__PURE__ */ c.jsx(
@@ -5081,21 +5096,25 @@ const So = ({
5081
5096
  )
5082
5097
  ] })
5083
5098
  }
5084
- ), uo = ({
5099
+ ), To = ({
5085
5100
  title: n,
5086
5101
  subtext: e,
5087
5102
  amount: o,
5088
5103
  currency: t,
5089
5104
  editable: r = !0,
5090
- usdConversion: i,
5091
- onAmountChange: a,
5092
- className: l = ""
5105
+ onAmountChange: i,
5106
+ className: a = ""
5093
5107
  }) => {
5094
- const [d, u] = J(null), T = (U) => {
5095
- const D = U.target.value;
5096
- a == null || a(D);
5097
- }, M = (U, D) => !D || !U || isNaN(Number(U)) ? "" : `≈ $${(Number(U) * D).toFixed(2)} USD`;
5098
- return /* @__PURE__ */ c.jsxs("div", { className: `${l}`, children: [
5108
+ const [l, d] = ee(null), u = (U) => {
5109
+ const w = U.target.value;
5110
+ if (w && !$e(w, t)) {
5111
+ const C = Qe(w, t);
5112
+ i == null || i(C);
5113
+ return;
5114
+ }
5115
+ i == null || i(w);
5116
+ };
5117
+ return /* @__PURE__ */ c.jsxs("div", { className: `${a}`, children: [
5099
5118
  n && /* @__PURE__ */ c.jsx(
5100
5119
  "h3",
5101
5120
  {
@@ -5121,7 +5140,7 @@ const So = ({
5121
5140
  children: e
5122
5141
  }
5123
5142
  ),
5124
- /* @__PURE__ */ c.jsxs(
5143
+ /* @__PURE__ */ c.jsx(
5125
5144
  "div",
5126
5145
  {
5127
5146
  style: {
@@ -5129,86 +5148,73 @@ const So = ({
5129
5148
  flexDirection: "column",
5130
5149
  gap: "calc(var(--spacing) * 0.5)"
5131
5150
  },
5132
- children: [
5133
- /* @__PURE__ */ c.jsxs(
5134
- "div",
5135
- {
5136
- style: {
5137
- position: "relative",
5138
- display: "flex",
5139
- alignItems: "center"
5140
- },
5141
- children: [
5142
- /* @__PURE__ */ c.jsx(
5143
- "input",
5144
- {
5145
- type: "text",
5146
- inputMode: "decimal",
5147
- style: {
5148
- width: "100%",
5149
- padding: "calc(var(--spacing) * 0.75) calc(var(--spacing) * 3.5) calc(var(--spacing) * 0.75) var(--spacing)",
5150
- fontSize: "var(--font-size-base)",
5151
- fontWeight: 500,
5152
- border: `1px solid ${d === "amount" ? "var(--color-primary)" : "var(--color-border)"}`,
5153
- borderRadius: "var(--border-radius)",
5154
- backgroundColor: r ? "var(--color-background)" : "var(--color-border-light)",
5155
- color: "var(--color-text)",
5156
- outline: "none",
5157
- transition: "all 0.2s",
5158
- boxShadow: d === "amount" ? "0 0 0 2px var(--primary-alpha-20)" : "none",
5159
- cursor: r ? "text" : "not-allowed"
5160
- },
5161
- value: o,
5162
- onChange: T,
5163
- onFocus: () => u("amount"),
5164
- onBlur: () => u(null),
5165
- disabled: !r,
5166
- placeholder: "0.00",
5167
- "aria-label": "Payment amount"
5168
- }
5169
- ),
5170
- /* @__PURE__ */ c.jsx(
5171
- "div",
5172
- {
5173
- style: {
5174
- position: "absolute",
5175
- right: "var(--spacing)",
5176
- top: "50%",
5177
- transform: "translateY(-50%)",
5178
- pointerEvents: "none"
5179
- },
5180
- children: /* @__PURE__ */ c.jsx(
5181
- "span",
5182
- {
5183
- style: {
5184
- fontSize: "var(--font-size-base)",
5185
- fontWeight: 500,
5186
- color: "var(--color-text-muted)"
5187
- },
5188
- children: typeof t == "string" ? t : t.code
5189
- }
5190
- )
5191
- }
5192
- )
5193
- ]
5194
- }
5195
- ),
5196
- i && o && (typeof t == "string" ? t : t.code) !== "USD" && /* @__PURE__ */ c.jsx(
5197
- "div",
5198
- {
5199
- style: {
5200
- fontSize: "var(--font-size-sm)",
5201
- color: "var(--text-secondary)",
5202
- textAlign: "right"
5203
- },
5204
- children: M(o, i)
5205
- }
5206
- )
5207
- ]
5151
+ children: /* @__PURE__ */ c.jsxs(
5152
+ "div",
5153
+ {
5154
+ style: {
5155
+ position: "relative",
5156
+ display: "flex",
5157
+ alignItems: "center"
5158
+ },
5159
+ children: [
5160
+ /* @__PURE__ */ c.jsx(
5161
+ "input",
5162
+ {
5163
+ type: "text",
5164
+ inputMode: "decimal",
5165
+ style: {
5166
+ width: "100%",
5167
+ padding: "calc(var(--spacing) * 0.75) calc(var(--spacing) * 3.5) calc(var(--spacing) * 0.75) var(--spacing)",
5168
+ fontSize: "var(--font-size-base)",
5169
+ fontWeight: 500,
5170
+ border: `1px solid ${l === "amount" ? "var(--color-primary)" : "var(--color-border)"}`,
5171
+ borderRadius: "var(--border-radius)",
5172
+ backgroundColor: r ? "var(--color-background)" : "var(--color-border-light)",
5173
+ color: "var(--color-text)",
5174
+ outline: "none",
5175
+ transition: "all 0.2s",
5176
+ boxShadow: l === "amount" ? "0 0 0 2px var(--primary-alpha-20)" : "none",
5177
+ cursor: r ? "text" : "not-allowed"
5178
+ },
5179
+ value: o,
5180
+ onChange: u,
5181
+ onFocus: () => d("amount"),
5182
+ onBlur: () => d(null),
5183
+ disabled: !r,
5184
+ placeholder: _e(0, t.decimals),
5185
+ "aria-label": "Payment amount"
5186
+ }
5187
+ ),
5188
+ /* @__PURE__ */ c.jsx(
5189
+ "div",
5190
+ {
5191
+ style: {
5192
+ position: "absolute",
5193
+ right: "var(--spacing)",
5194
+ top: "50%",
5195
+ transform: "translateY(-50%)",
5196
+ pointerEvents: "none"
5197
+ },
5198
+ children: /* @__PURE__ */ c.jsx(
5199
+ "span",
5200
+ {
5201
+ style: {
5202
+ fontSize: "var(--font-size-base)",
5203
+ fontWeight: 500,
5204
+ color: "var(--color-text-muted)"
5205
+ },
5206
+ children: typeof t == "string" ? t : t.code
5207
+ }
5208
+ )
5209
+ }
5210
+ )
5211
+ ]
5212
+ }
5213
+ )
5208
5214
  }
5209
5215
  )
5210
5216
  ] });
5211
- }, ho = ({
5217
+ }, Do = ({
5212
5218
  children: n,
5213
5219
  title: e = "Select Payment Method"
5214
5220
  }) => /* @__PURE__ */ c.jsxs(
@@ -5232,19 +5238,19 @@ const So = ({
5232
5238
  /* @__PURE__ */ c.jsx("div", { className: "space-y-0", children: n })
5233
5239
  ]
5234
5240
  }
5235
- ), ae = ({
5241
+ ), de = ({
5236
5242
  label: n,
5237
5243
  description: e,
5238
5244
  children: o,
5239
5245
  showDisabled: t = !0
5240
5246
  }) => {
5241
- const r = Ge.toArray(o).filter((i) => {
5247
+ const r = We.toArray(o).filter((i) => {
5242
5248
  var a, l, d;
5243
- return !t && re(i) && (d = (l = (a = i.props) == null ? void 0 : a.method) == null ? void 0 : l.enabled) != null ? d : !0;
5249
+ return !t && ae(i) && (d = (l = (a = i.props) == null ? void 0 : a.method) == null ? void 0 : l.enabled) != null ? d : !0;
5244
5250
  }).sort((i, a) => {
5245
- var u, T, M, U, D, C;
5246
- if (!re(i) || !re(a)) return 0;
5247
- const l = (M = (T = (u = i.props) == null ? void 0 : u.method) == null ? void 0 : T.enabled) != null ? M : !0, d = (C = (D = (U = a.props) == null ? void 0 : U.method) == null ? void 0 : D.enabled) != null ? C : !0;
5251
+ var u, U, w, C, E, x;
5252
+ if (!ae(i) || !ae(a)) return 0;
5253
+ const l = (w = (U = (u = i.props) == null ? void 0 : u.method) == null ? void 0 : U.enabled) != null ? w : !0, d = (x = (E = (C = a.props) == null ? void 0 : C.method) == null ? void 0 : E.enabled) != null ? x : !0;
5248
5254
  return l && !d ? -1 : !l && d ? 1 : 0;
5249
5255
  });
5250
5256
  return /* @__PURE__ */ c.jsxs(
@@ -5282,15 +5288,15 @@ const So = ({
5282
5288
  ]
5283
5289
  }
5284
5290
  );
5285
- }, le = ({
5291
+ }, pe = ({
5286
5292
  data: n,
5287
5293
  selected: e = !1,
5288
5294
  onClick: o
5289
5295
  }) => {
5290
5296
  const t = n.enabled === !1, i = ((a) => {
5291
5297
  const l = a.toLowerCase();
5292
- let d = Ce(a);
5293
- if (d || (d = Ee(l), d) || (d = Me(l), d)) return d;
5298
+ let d = Me(a);
5299
+ if (d || (d = xe(l), d) || (d = Ne(l), d)) return d;
5294
5300
  })(n.displayName);
5295
5301
  return /* @__PURE__ */ c.jsxs("div", { className: "relative", children: [
5296
5302
  /* @__PURE__ */ c.jsxs(
@@ -5324,7 +5330,7 @@ const So = ({
5324
5330
  ),
5325
5331
  t && /* @__PURE__ */ c.jsx("div", { className: "absolute inset-0 bg-white/50 flex items-center justify-center pointer-events-none rounded-[var(--border-radius)]", children: /* @__PURE__ */ c.jsx("span", { className: "text-[0.5rem] font-semibold text-[var(--color-text-muted)] text-center", children: n.disabledMessage || "Not Available" }) })
5326
5332
  ] });
5327
- }, fo = ({
5333
+ }, ko = ({
5328
5334
  selectedMethod: n,
5329
5335
  processingFee: e = 1.5,
5330
5336
  // @TODO: Make this dynamic based on payment method
@@ -5335,8 +5341,8 @@ const So = ({
5335
5341
  return null;
5336
5342
  const r = ((i) => {
5337
5343
  const a = i.toLowerCase();
5338
- let l = Ce(i);
5339
- if (l || (l = Ee(a), l) || (l = Me(a), l)) return l;
5344
+ let l = Me(i);
5345
+ if (l || (l = xe(a), l) || (l = Ne(a), l)) return l;
5340
5346
  })(n.displayName);
5341
5347
  return /* @__PURE__ */ c.jsx(
5342
5348
  "div",
@@ -5409,7 +5415,7 @@ const So = ({
5409
5415
  ] })
5410
5416
  }
5411
5417
  );
5412
- }, vo = ({
5418
+ }, So = ({
5413
5419
  amount: n,
5414
5420
  currencySymbol: e = "$",
5415
5421
  disabled: o = !1,
@@ -5494,7 +5500,7 @@ const So = ({
5494
5500
  ] })
5495
5501
  }
5496
5502
  );
5497
- }, yo = ({
5503
+ }, Uo = ({
5498
5504
  brandingText: n = "Payments",
5499
5505
  showSecured: e = !0
5500
5506
  }) => /* @__PURE__ */ c.jsx(
@@ -5581,68 +5587,69 @@ const So = ({
5581
5587
  }
5582
5588
  )
5583
5589
  }
5584
- ), wo = ({
5590
+ ), Eo = ({
5585
5591
  title: n = "W3 Payments",
5586
5592
  logo: e,
5587
5593
  userId: o,
5588
5594
  transactionId: t,
5589
- editable: r = !0,
5590
- currency: i = "USD",
5591
- usdConversion: a = 1,
5592
- targetCurrency: l,
5593
- targetNetwork: d,
5594
- destinations: u,
5595
- walletFilter: T,
5596
- exchangeFilter: M,
5597
- fiatFilter: U,
5598
- onInitiate: D,
5599
- onComplete: C,
5600
- onError: A
5595
+ amount: r = "",
5596
+ editable: i = !0,
5597
+ amountTitle: a = "Enter payment amount",
5598
+ currency: l = "USD",
5599
+ targetCurrency: d,
5600
+ targetNetwork: u,
5601
+ destinations: U,
5602
+ walletFilter: w,
5603
+ exchangeFilter: C,
5604
+ fiatFilter: E,
5605
+ onInitiate: x,
5606
+ onComplete: R,
5607
+ onError: T
5601
5608
  }) => {
5602
- var G;
5603
- const { w3payments: I, httpClient: ee, isInitialized: X } = bo(), [x, _] = J(""), [k, O] = J(), [oe, z] = J(!1), E = de(() => I ? I.getCurrency(i) : null, [I, i]), N = de(() => !X || !I ? [] : I.paymentMethodService.getDisplayOptions({
5604
- walletFilter: T,
5605
- exchangeFilter: M,
5606
- fiatFilter: U,
5607
- targetCurrency: l,
5608
- targetNetwork: d
5609
+ var Y;
5610
+ const { w3payments: I, httpClient: ne, isInitialized: G } = vo(), [M, K] = ee(r), [D, L] = ee(), [te, B] = ee(!1), A = me(() => I ? I.getCurrency(l) : null, [I, l]), N = me(() => !G || !I ? [] : I.paymentMethodService.getDisplayOptions({
5611
+ walletFilter: w,
5612
+ exchangeFilter: C,
5613
+ fiatFilter: E,
5614
+ targetCurrency: d,
5615
+ targetNetwork: u
5609
5616
  }), [
5610
- X,
5617
+ G,
5611
5618
  I,
5612
- T,
5613
- M,
5614
- U,
5615
- l,
5616
- d
5617
- ]), ne = (m) => N.find((b) => b.id === m), V = () => !!(x && k && E && I && X), $ = () => {
5618
- _(""), O(void 0), z(!1);
5619
- }, te = () => w(null, null, function* () {
5619
+ w,
5620
+ C,
5621
+ E,
5622
+ d,
5623
+ u
5624
+ ]), Z = (m) => N.find((b) => b.id === m), z = () => !!(M && D && A && I && G), se = () => {
5625
+ K(""), L(void 0), B(!1);
5626
+ }, F = () => S(null, null, function* () {
5620
5627
  var m;
5621
- if (!(!V() || !I || !E)) {
5622
- z(!0);
5628
+ if (!(!z() || !I || !A)) {
5629
+ B(!0);
5623
5630
  try {
5624
- yield D == null ? void 0 : D(y({
5625
- amount: x,
5626
- currency: E.code,
5627
- paymentMethodId: k
5631
+ yield x == null ? void 0 : x(y({
5632
+ amount: M,
5633
+ currency: A.code,
5634
+ paymentMethodId: D
5628
5635
  }, o && { userId: o })), console.log("Initiating payment with:", {
5629
- amount: x,
5630
- currency: E.code,
5631
- paymentMethodId: k
5636
+ amount: M,
5637
+ currency: A.code,
5638
+ paymentMethodId: D
5632
5639
  });
5633
- const b = yield ee.createPayment({
5640
+ const b = yield ne.createPayment({
5634
5641
  id: t || `payment_${Date.now()}`,
5635
- amount: parseFloat(x),
5636
- currency: E.code,
5642
+ amount: parseFloat(M),
5643
+ currency: A.code,
5637
5644
  customerId: o || "anonymous",
5638
- destinations: u,
5645
+ destinations: U,
5639
5646
  metadata: {
5640
- paymentMethodId: k
5647
+ paymentMethodId: D
5641
5648
  }
5642
5649
  });
5643
5650
  if (console.log("Payment session created successfully:", b), I && b)
5644
5651
  try {
5645
- const S = yield I.openCheckout({
5652
+ const k = yield I.openCheckout({
5646
5653
  id: b.id,
5647
5654
  url: b.url,
5648
5655
  expiresAt: b.expiresAt,
@@ -5651,62 +5658,62 @@ const So = ({
5651
5658
  vendorId: b.selectedVendor
5652
5659
  })
5653
5660
  });
5654
- if (console.log("Checkout result:", S), S.status === "cancelled") {
5655
- console.log("Payment cancelled by user"), A == null || A({
5661
+ if (console.log("Checkout result:", k), k.status === "cancelled") {
5662
+ console.log("Payment cancelled by user"), T == null || T({
5656
5663
  message: "Payment cancelled by user",
5657
5664
  transactionId: b.id,
5658
5665
  userId: o || "anonymous",
5659
5666
  code: "PAYMENT_CANCELLED"
5660
5667
  });
5661
5668
  return;
5662
- } else if (S.status === "failed") {
5663
- A == null || A({
5664
- message: ((m = S.data) == null ? void 0 : m.message) || "Payment failed",
5669
+ } else if (k.status === "failed") {
5670
+ T == null || T({
5671
+ message: ((m = k.data) == null ? void 0 : m.message) || "Payment failed",
5665
5672
  transactionId: b.id,
5666
5673
  userId: o || "anonymous",
5667
- details: S.data
5674
+ details: k.data
5668
5675
  });
5669
5676
  return;
5670
5677
  } else
5671
- C == null || C(P(y({
5672
- amount: x,
5673
- currency: E.code,
5674
- paymentMethodId: k,
5675
- transactionId: S.id,
5678
+ R == null || R(P(y({
5679
+ amount: M,
5680
+ currency: A.code,
5681
+ paymentMethodId: D,
5682
+ transactionId: k.id,
5676
5683
  vendorId: b.selectedVendor || "unknown",
5677
- status: S.status
5684
+ status: k.status
5678
5685
  }, o && { userId: o }), {
5679
- checkoutData: S.data
5680
- })), $();
5681
- } catch (S) {
5682
- console.error("Checkout failed:", S), A == null || A({
5683
- message: `Checkout failed: ${S instanceof Error ? S.message : "Unknown error"}`,
5686
+ checkoutData: k.data
5687
+ })), se();
5688
+ } catch (k) {
5689
+ console.error("Checkout failed:", k), T == null || T({
5690
+ message: `Checkout failed: ${k instanceof Error ? k.message : "Unknown error"}`,
5684
5691
  transactionId: b.id,
5685
5692
  userId: o || "anonymous",
5686
- details: S
5693
+ details: k
5687
5694
  });
5688
5695
  }
5689
5696
  else
5690
- C == null || C(y({
5691
- amount: x,
5692
- currency: E.code,
5693
- paymentMethodId: k,
5697
+ R == null || R(y({
5698
+ amount: M,
5699
+ currency: A.code,
5700
+ paymentMethodId: D,
5694
5701
  transactionId: b.id,
5695
5702
  vendorId: b.selectedVendor || "unknown",
5696
5703
  status: "pending"
5697
5704
  }, o && { userId: o }));
5698
5705
  } catch (b) {
5699
- console.error("Payment failed:", b), A == null || A(P(y(y({
5706
+ console.error("Payment failed:", b), T == null || T(P(y(y({
5700
5707
  message: b instanceof Error ? b.message : "Payment failed"
5701
5708
  }, t && { transactionId: t }), o && { userId: o }), {
5702
5709
  details: b
5703
5710
  }));
5704
5711
  } finally {
5705
- z(!1);
5712
+ B(!1);
5706
5713
  }
5707
5714
  }
5708
5715
  });
5709
- return X ? /* @__PURE__ */ c.jsxs(
5716
+ return G ? /* @__PURE__ */ c.jsxs(
5710
5717
  "div",
5711
5718
  {
5712
5719
  className: `
@@ -5722,56 +5729,55 @@ const So = ({
5722
5729
  `,
5723
5730
  children: [
5724
5731
  /* @__PURE__ */ c.jsxs("div", { className: "flex flex-col gap-0.5 flex-1 overflow-y-auto pb-1", children: [
5725
- /* @__PURE__ */ c.jsx(go, y({ title: n }, e && { logo: e })),
5726
- E && /* @__PURE__ */ c.jsx("div", { className: "px-[var(--spacing)]", children: /* @__PURE__ */ c.jsx(
5727
- uo,
5732
+ /* @__PURE__ */ c.jsx(yo, y({ title: n }, e && { logo: e })),
5733
+ A && /* @__PURE__ */ c.jsx("div", { className: "px-[var(--spacing)]", children: /* @__PURE__ */ c.jsx(
5734
+ To,
5728
5735
  {
5729
- title: "Enter payment amount",
5730
- amount: x,
5731
- currency: E,
5732
- editable: r,
5733
- usdConversion: a,
5734
- onAmountChange: _
5736
+ title: a,
5737
+ amount: M,
5738
+ currency: A,
5739
+ editable: i,
5740
+ onAmountChange: K
5735
5741
  }
5736
5742
  ) }),
5737
5743
  /* @__PURE__ */ c.jsxs(
5738
- ho,
5739
- P(y({}, k && { selectedMethodId: k }), {
5740
- onMethodSelect: O,
5744
+ Do,
5745
+ P(y({}, D && { selectedMethodId: D }), {
5746
+ onMethodSelect: L,
5741
5747
  children: [
5742
- N.filter((m) => m.method === "wallet").length > 0 && /* @__PURE__ */ c.jsx(ae, { label: "Crypto Wallets", children: N.filter((m) => m.method === "wallet").map((m, b) => /* @__PURE__ */ c.jsx(
5743
- le,
5748
+ N.filter((m) => m.method === "wallet").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Crypto Wallets", children: N.filter((m) => m.method === "wallet").map((m, b) => /* @__PURE__ */ c.jsx(
5749
+ pe,
5744
5750
  {
5745
5751
  data: {
5746
5752
  id: m.id,
5747
5753
  displayName: m.displayName
5748
5754
  },
5749
- selected: k === m.id,
5750
- onClick: () => O(m.id)
5755
+ selected: D === m.id,
5756
+ onClick: () => L(m.id)
5751
5757
  },
5752
5758
  b
5753
5759
  )) }),
5754
- N.filter((m) => m.method === "exchange").length > 0 && /* @__PURE__ */ c.jsx(ae, { label: "Exchanges", children: N.filter((m) => m.method === "exchange").map((m, b) => /* @__PURE__ */ c.jsx(
5755
- le,
5760
+ N.filter((m) => m.method === "exchange").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Exchanges", children: N.filter((m) => m.method === "exchange").map((m, b) => /* @__PURE__ */ c.jsx(
5761
+ pe,
5756
5762
  {
5757
5763
  data: {
5758
5764
  id: m.id,
5759
5765
  displayName: m.displayName
5760
5766
  },
5761
- selected: k === m.id,
5762
- onClick: () => O(m.id)
5767
+ selected: D === m.id,
5768
+ onClick: () => L(m.id)
5763
5769
  },
5764
5770
  b
5765
5771
  )) }),
5766
- N.filter((m) => m.method === "fiat").length > 0 && /* @__PURE__ */ c.jsx(ae, { label: "Traditional Payment", children: N.filter((m) => m.method === "fiat").map((m, b) => /* @__PURE__ */ c.jsx(
5767
- le,
5772
+ N.filter((m) => m.method === "fiat").length > 0 && /* @__PURE__ */ c.jsx(de, { label: "Traditional Payment", children: N.filter((m) => m.method === "fiat").map((m, b) => /* @__PURE__ */ c.jsx(
5773
+ pe,
5768
5774
  {
5769
5775
  data: {
5770
5776
  id: m.id,
5771
5777
  displayName: m.displayName
5772
5778
  },
5773
- selected: k === m.id,
5774
- onClick: () => O(m.id)
5779
+ selected: D === m.id,
5780
+ onClick: () => L(m.id)
5775
5781
  },
5776
5782
  b
5777
5783
  )) })
@@ -5780,36 +5786,36 @@ const So = ({
5780
5786
  )
5781
5787
  ] }),
5782
5788
  /* @__PURE__ */ c.jsxs("div", { className: "bg-white border-t border-gray-100", children: [
5783
- k && /* @__PURE__ */ c.jsx("div", { className: "px-[var(--spacing)] pt-[calc(var(--spacing)*0.75)]", children: /* @__PURE__ */ c.jsx(
5784
- fo,
5789
+ D && /* @__PURE__ */ c.jsx("div", { className: "px-[var(--spacing)] pt-[calc(var(--spacing)*0.75)]", children: /* @__PURE__ */ c.jsx(
5790
+ ko,
5785
5791
  {
5786
5792
  selectedMethod: {
5787
- id: k,
5788
- displayName: ((G = ne(k)) == null ? void 0 : G.displayName) || ""
5793
+ id: D,
5794
+ displayName: ((Y = Z(D)) == null ? void 0 : Y.displayName) || ""
5789
5795
  }
5790
5796
  }
5791
5797
  ) }),
5792
5798
  /* @__PURE__ */ c.jsx("div", { className: "px-[var(--spacing)] py-[var(--spacing)]", children: /* @__PURE__ */ c.jsx(
5793
- vo,
5799
+ So,
5794
5800
  {
5795
- amount: x || "0.00",
5796
- disabled: !V(),
5797
- loading: oe,
5798
- onClick: te
5801
+ amount: M || "0.00",
5802
+ disabled: !z(),
5803
+ loading: te,
5804
+ onClick: F
5799
5805
  }
5800
5806
  ) })
5801
5807
  ] }),
5802
- /* @__PURE__ */ c.jsx(yo, {})
5808
+ /* @__PURE__ */ c.jsx(Uo, {})
5803
5809
  ]
5804
5810
  }
5805
5811
  ) : /* @__PURE__ */ c.jsx("div", { children: "Loading payment widget..." });
5806
- }, To = "1.0.0", Uo = {
5807
- W3_PAYMENTS_REACT_VERSION: To
5812
+ }, wo = "1.0.0", Mo = {
5813
+ W3_PAYMENTS_REACT_VERSION: wo
5808
5814
  };
5809
5815
  export {
5810
- wo as W3PaymentWidget,
5811
- So as W3PaymentsProvider,
5812
- To as W3_PAYMENTS_REACT_VERSION,
5813
- Uo as default,
5814
- bo as useW3Payments
5816
+ Eo as W3PaymentWidget,
5817
+ Co as W3PaymentsProvider,
5818
+ wo as W3_PAYMENTS_REACT_VERSION,
5819
+ Mo as default,
5820
+ vo as useW3Payments
5815
5821
  };