coinley-checkout 0.1.1 → 0.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.
@@ -1,5 +1,5 @@
1
- import Ze, { createContext as Be, useContext as $e, useState as O, useEffect as $, forwardRef as wr, useImperativeHandle as Nr } from "react";
2
- var Te = { exports: {} }, oe = {};
1
+ import We, { createContext as Be, useContext as Ze, useState as O, useEffect as X, forwardRef as pt, useImperativeHandle as vt } from "react";
2
+ var De = { exports: {} }, le = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.min.js
@@ -9,25 +9,25 @@ var Te = { exports: {} }, oe = {};
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
- var Ge;
13
- function vr() {
14
- if (Ge)
15
- return oe;
16
- Ge = 1;
17
- var a = Ze, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, x = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function j(A, o, S) {
19
- var y, T = {}, P = null, N = null;
20
- S !== void 0 && (P = "" + S), o.key !== void 0 && (P = "" + o.key), o.ref !== void 0 && (N = o.ref);
21
- for (y in o)
22
- l.call(o, y) && !f.hasOwnProperty(y) && (T[y] = o[y]);
23
- if (A && A.defaultProps)
24
- for (y in o = A.defaultProps, o)
25
- T[y] === void 0 && (T[y] = o[y]);
26
- return { $$typeof: n, type: A, key: P, ref: N, props: T, _owner: x.current };
12
+ var Qe;
13
+ function Nt() {
14
+ if (Qe)
15
+ return le;
16
+ Qe = 1;
17
+ var a = We, n = Symbol.for("react.element"), l = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, u = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function s(y, i, N) {
19
+ var x, T = {}, $ = null, L = null;
20
+ N !== void 0 && ($ = "" + N), i.key !== void 0 && ($ = "" + i.key), i.ref !== void 0 && (L = i.ref);
21
+ for (x in i)
22
+ c.call(i, x) && !f.hasOwnProperty(x) && (T[x] = i[x]);
23
+ if (y && y.defaultProps)
24
+ for (x in i = y.defaultProps, i)
25
+ T[x] === void 0 && (T[x] = i[x]);
26
+ return { $$typeof: n, type: y, key: $, ref: L, props: T, _owner: u.current };
27
27
  }
28
- return oe.Fragment = i, oe.jsx = j, oe.jsxs = j, oe;
28
+ return le.Fragment = l, le.jsx = s, le.jsxs = s, le;
29
29
  }
30
- var ie = {};
30
+ var ue = {};
31
31
  /**
32
32
  * @license React
33
33
  * react-jsx-runtime.development.js
@@ -37,54 +37,54 @@ var ie = {};
37
37
  * This source code is licensed under the MIT license found in the
38
38
  * LICENSE file in the root directory of this source tree.
39
39
  */
40
- var We;
41
- function br() {
42
- return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
43
- var a = Ze, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), A = Symbol.for("react.context"), o = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), R = Symbol.iterator, z = "@@iterator";
40
+ var Ge;
41
+ function bt() {
42
+ return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var a = We, n = Symbol.for("react.element"), l = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), y = Symbol.for("react.context"), i = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), z = Symbol.iterator, U = "@@iterator";
44
44
  function G(e) {
45
45
  if (e === null || typeof e != "object")
46
46
  return null;
47
- var t = R && e[R] || e[z];
48
- return typeof t == "function" ? t : null;
47
+ var r = z && e[z] || e[U];
48
+ return typeof r == "function" ? r : null;
49
49
  }
50
50
  var D = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
51
  function v(e) {
52
52
  {
53
- for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), c = 1; c < t; c++)
54
- s[c - 1] = arguments[c];
55
- K("error", e, s);
53
+ for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), d = 1; d < r; d++)
54
+ o[d - 1] = arguments[d];
55
+ se("error", e, o);
56
56
  }
57
57
  }
58
- function K(e, t, s) {
58
+ function se(e, r, o) {
59
59
  {
60
- var c = D.ReactDebugCurrentFrame, M = c.getStackAddendum();
61
- M !== "" && (t += "%s", s = s.concat([M]));
62
- var m = s.map(function(g) {
63
- return String(g);
60
+ var d = D.ReactDebugCurrentFrame, j = d.getStackAddendum();
61
+ j !== "" && (r += "%s", o = o.concat([j]));
62
+ var w = o.map(function(M) {
63
+ return String(M);
64
64
  });
65
- m.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, m);
65
+ w.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, w);
66
66
  }
67
67
  }
68
- var U = !1, H = !1, ee = !1, re = !1, Y = !1, V;
69
- V = Symbol.for("react.module.reference");
70
- function Z(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === l || e === f || Y || e === x || e === S || e === y || re || e === N || U || H || ee || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === T || e.$$typeof === j || e.$$typeof === A || e.$$typeof === o || // This needs to include all possible module reference object
68
+ var F = !1, W = !1, J = !1, oe = !1, Y = !1, K;
69
+ K = Symbol.for("react.module.reference");
70
+ function B(e) {
71
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === f || Y || e === u || e === N || e === x || oe || e === L || F || W || J || typeof e == "object" && e !== null && (e.$$typeof === $ || e.$$typeof === T || e.$$typeof === s || e.$$typeof === y || e.$$typeof === i || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
75
- e.$$typeof === V || e.getModuleId !== void 0));
75
+ e.$$typeof === K || e.getModuleId !== void 0));
76
76
  }
77
- function W(e, t, s) {
78
- var c = e.displayName;
79
- if (c)
80
- return c;
81
- var M = t.displayName || t.name || "";
82
- return M !== "" ? s + "(" + M + ")" : s;
77
+ function ee(e, r, o) {
78
+ var d = e.displayName;
79
+ if (d)
80
+ return d;
81
+ var j = r.displayName || r.name || "";
82
+ return j !== "" ? o + "(" + j + ")" : o;
83
83
  }
84
- function F(e) {
84
+ function _(e) {
85
85
  return e.displayName || "Context";
86
86
  }
87
- function h(e) {
87
+ function I(e) {
88
88
  if (e == null)
89
89
  return null;
90
90
  if (typeof e.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
@@ -92,36 +92,36 @@ function br() {
92
92
  if (typeof e == "string")
93
93
  return e;
94
94
  switch (e) {
95
- case l:
95
+ case c:
96
96
  return "Fragment";
97
- case i:
97
+ case l:
98
98
  return "Portal";
99
99
  case f:
100
100
  return "Profiler";
101
- case x:
101
+ case u:
102
102
  return "StrictMode";
103
- case S:
103
+ case N:
104
104
  return "Suspense";
105
- case y:
105
+ case x:
106
106
  return "SuspenseList";
107
107
  }
108
108
  if (typeof e == "object")
109
109
  switch (e.$$typeof) {
110
- case A:
111
- var t = e;
112
- return F(t) + ".Consumer";
113
- case j:
114
- var s = e;
115
- return F(s._context) + ".Provider";
116
- case o:
117
- return W(e, e.render, "ForwardRef");
110
+ case y:
111
+ var r = e;
112
+ return _(r) + ".Consumer";
113
+ case s:
114
+ var o = e;
115
+ return _(o._context) + ".Provider";
116
+ case i:
117
+ return ee(e, e.render, "ForwardRef");
118
118
  case T:
119
- var c = e.displayName || null;
120
- return c !== null ? c : h(e.type) || "Memo";
121
- case P: {
122
- var M = e, m = M._payload, g = M._init;
119
+ var d = e.displayName || null;
120
+ return d !== null ? d : I(e.type) || "Memo";
121
+ case $: {
122
+ var j = e, w = j._payload, M = j._init;
123
123
  try {
124
- return h(g(m));
124
+ return I(M(w));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,18 +129,18 @@ function br() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var _ = Object.assign, p = 0, ce, te, le, ae, ue, u, b;
133
- function de() {
132
+ var E = Object.assign, p = 0, H, Z, q, C, de, m, h;
133
+ function fe() {
134
134
  }
135
- de.__reactDisabledLog = !0;
136
- function xe() {
135
+ fe.__reactDisabledLog = !0;
136
+ function me() {
137
137
  {
138
138
  if (p === 0) {
139
- ce = console.log, te = console.info, le = console.warn, ae = console.error, ue = console.group, u = console.groupCollapsed, b = console.groupEnd;
139
+ H = console.log, Z = console.info, q = console.warn, C = console.error, de = console.group, m = console.groupCollapsed, h = console.groupEnd;
140
140
  var e = {
141
141
  configurable: !0,
142
142
  enumerable: !0,
143
- value: de,
143
+ value: fe,
144
144
  writable: !0
145
145
  };
146
146
  Object.defineProperties(console, {
@@ -156,7 +156,7 @@ function br() {
156
156
  p++;
157
157
  }
158
158
  }
159
- function fe() {
159
+ function he() {
160
160
  {
161
161
  if (p--, p === 0) {
162
162
  var e = {
@@ -165,312 +165,312 @@ function br() {
165
165
  writable: !0
166
166
  };
167
167
  Object.defineProperties(console, {
168
- log: _({}, e, {
169
- value: ce
168
+ log: E({}, e, {
169
+ value: H
170
170
  }),
171
- info: _({}, e, {
172
- value: te
171
+ info: E({}, e, {
172
+ value: Z
173
173
  }),
174
- warn: _({}, e, {
175
- value: le
174
+ warn: E({}, e, {
175
+ value: q
176
176
  }),
177
- error: _({}, e, {
178
- value: ae
177
+ error: E({}, e, {
178
+ value: C
179
179
  }),
180
- group: _({}, e, {
181
- value: ue
180
+ group: E({}, e, {
181
+ value: de
182
182
  }),
183
- groupCollapsed: _({}, e, {
184
- value: u
183
+ groupCollapsed: E({}, e, {
184
+ value: m
185
185
  }),
186
- groupEnd: _({}, e, {
187
- value: b
186
+ groupEnd: E({}, e, {
187
+ value: h
188
188
  })
189
189
  });
190
190
  }
191
191
  p < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
192
  }
193
193
  }
194
- var he = D.ReactCurrentDispatcher, je;
195
- function ge(e, t, s) {
194
+ var te = D.ReactCurrentDispatcher, je;
195
+ function ge(e, r, o) {
196
196
  {
197
197
  if (je === void 0)
198
198
  try {
199
199
  throw Error();
200
- } catch (M) {
201
- var c = M.stack.trim().match(/\n( *(at )?)/);
202
- je = c && c[1] || "";
200
+ } catch (j) {
201
+ var d = j.stack.trim().match(/\n( *(at )?)/);
202
+ je = d && d[1] || "";
203
203
  }
204
204
  return `
205
205
  ` + je + e;
206
206
  }
207
207
  }
208
- var pe = !1, Me;
208
+ var we = !1, ye;
209
209
  {
210
- var qe = typeof WeakMap == "function" ? WeakMap : Map;
211
- Me = new qe();
210
+ var Ve = typeof WeakMap == "function" ? WeakMap : Map;
211
+ ye = new Ve();
212
212
  }
213
- function De(e, t) {
214
- if (!e || pe)
213
+ function Ce(e, r) {
214
+ if (!e || we)
215
215
  return "";
216
216
  {
217
- var s = Me.get(e);
218
- if (s !== void 0)
219
- return s;
217
+ var o = ye.get(e);
218
+ if (o !== void 0)
219
+ return o;
220
220
  }
221
- var c;
222
- pe = !0;
223
- var M = Error.prepareStackTrace;
221
+ var d;
222
+ we = !0;
223
+ var j = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
- var m;
226
- m = he.current, he.current = null, xe();
225
+ var w;
226
+ w = te.current, te.current = null, me();
227
227
  try {
228
- if (t) {
229
- var g = function() {
228
+ if (r) {
229
+ var M = function() {
230
230
  throw Error();
231
231
  };
232
- if (Object.defineProperty(g.prototype, "props", {
232
+ if (Object.defineProperty(M.prototype, "props", {
233
233
  set: function() {
234
234
  throw Error();
235
235
  }
236
236
  }), typeof Reflect == "object" && Reflect.construct) {
237
237
  try {
238
- Reflect.construct(g, []);
239
- } catch (I) {
240
- c = I;
238
+ Reflect.construct(M, []);
239
+ } catch (k) {
240
+ d = k;
241
241
  }
242
- Reflect.construct(e, [], g);
242
+ Reflect.construct(e, [], M);
243
243
  } else {
244
244
  try {
245
- g.call();
246
- } catch (I) {
247
- c = I;
245
+ M.call();
246
+ } catch (k) {
247
+ d = k;
248
248
  }
249
- e.call(g.prototype);
249
+ e.call(M.prototype);
250
250
  }
251
251
  } else {
252
252
  try {
253
253
  throw Error();
254
- } catch (I) {
255
- c = I;
254
+ } catch (k) {
255
+ d = k;
256
256
  }
257
257
  e();
258
258
  }
259
- } catch (I) {
260
- if (I && c && typeof I.stack == "string") {
261
- for (var d = I.stack.split(`
262
- `), C = c.stack.split(`
263
- `), w = d.length - 1, L = C.length - 1; w >= 1 && L >= 0 && d[w] !== C[L]; )
264
- L--;
265
- for (; w >= 1 && L >= 0; w--, L--)
266
- if (d[w] !== C[L]) {
267
- if (w !== 1 || L !== 1)
259
+ } catch (k) {
260
+ if (k && d && typeof k.stack == "string") {
261
+ for (var g = k.stack.split(`
262
+ `), A = d.stack.split(`
263
+ `), b = g.length - 1, S = A.length - 1; b >= 1 && S >= 0 && g[b] !== A[S]; )
264
+ S--;
265
+ for (; b >= 1 && S >= 0; b--, S--)
266
+ if (g[b] !== A[S]) {
267
+ if (b !== 1 || S !== 1)
268
268
  do
269
- if (w--, L--, L < 0 || d[w] !== C[L]) {
270
- var k = `
271
- ` + d[w].replace(" at new ", " at ");
272
- return e.displayName && k.includes("<anonymous>") && (k = k.replace("<anonymous>", e.displayName)), typeof e == "function" && Me.set(e, k), k;
269
+ if (b--, S--, S < 0 || g[b] !== A[S]) {
270
+ var R = `
271
+ ` + g[b].replace(" at new ", " at ");
272
+ return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && ye.set(e, R), R;
273
273
  }
274
- while (w >= 1 && L >= 0);
274
+ while (b >= 1 && S >= 0);
275
275
  break;
276
276
  }
277
277
  }
278
278
  } finally {
279
- pe = !1, he.current = m, fe(), Error.prepareStackTrace = M;
279
+ we = !1, te.current = w, he(), Error.prepareStackTrace = j;
280
280
  }
281
- var X = e ? e.displayName || e.name : "", B = X ? ge(X) : "";
282
- return typeof e == "function" && Me.set(e, B), B;
281
+ var ae = e ? e.displayName || e.name : "", V = ae ? ge(ae) : "";
282
+ return typeof e == "function" && ye.set(e, V), V;
283
283
  }
284
- function Xe(e, t, s) {
285
- return De(e, !1);
284
+ function Xe(e, r, o) {
285
+ return Ce(e, !1);
286
286
  }
287
287
  function Je(e) {
288
- var t = e.prototype;
289
- return !!(t && t.isReactComponent);
288
+ var r = e.prototype;
289
+ return !!(r && r.isReactComponent);
290
290
  }
291
- function ye(e, t, s) {
291
+ function Me(e, r, o) {
292
292
  if (e == null)
293
293
  return "";
294
294
  if (typeof e == "function")
295
- return De(e, Je(e));
295
+ return Ce(e, Je(e));
296
296
  if (typeof e == "string")
297
297
  return ge(e);
298
298
  switch (e) {
299
- case S:
299
+ case N:
300
300
  return ge("Suspense");
301
- case y:
301
+ case x:
302
302
  return ge("SuspenseList");
303
303
  }
304
304
  if (typeof e == "object")
305
305
  switch (e.$$typeof) {
306
- case o:
306
+ case i:
307
307
  return Xe(e.render);
308
308
  case T:
309
- return ye(e.type, t, s);
310
- case P: {
311
- var c = e, M = c._payload, m = c._init;
309
+ return Me(e.type, r, o);
310
+ case $: {
311
+ var d = e, j = d._payload, w = d._init;
312
312
  try {
313
- return ye(m(M), t, s);
313
+ return Me(w(j), r, o);
314
314
  } catch {
315
315
  }
316
316
  }
317
317
  }
318
318
  return "";
319
319
  }
320
- var ne = Object.prototype.hasOwnProperty, Ce = {}, Ie = D.ReactDebugCurrentFrame;
321
- function me(e) {
320
+ var ie = Object.prototype.hasOwnProperty, Ae = {}, Ie = D.ReactDebugCurrentFrame;
321
+ function xe(e) {
322
322
  if (e) {
323
- var t = e._owner, s = ye(e.type, e._source, t ? t.type : null);
324
- Ie.setExtraStackFrame(s);
323
+ var r = e._owner, o = Me(e.type, e._source, r ? r.type : null);
324
+ Ie.setExtraStackFrame(o);
325
325
  } else
326
326
  Ie.setExtraStackFrame(null);
327
327
  }
328
- function Ke(e, t, s, c, M) {
328
+ function Ke(e, r, o, d, j) {
329
329
  {
330
- var m = Function.call.bind(ne);
331
- for (var g in e)
332
- if (m(e, g)) {
333
- var d = void 0;
330
+ var w = Function.call.bind(ie);
331
+ for (var M in e)
332
+ if (w(e, M)) {
333
+ var g = void 0;
334
334
  try {
335
- if (typeof e[g] != "function") {
336
- var C = Error((c || "React class") + ": " + s + " type `" + g + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[g] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
- throw C.name = "Invariant Violation", C;
335
+ if (typeof e[M] != "function") {
336
+ var A = Error((d || "React class") + ": " + o + " type `" + M + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[M] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw A.name = "Invariant Violation", A;
338
338
  }
339
- d = e[g](t, g, c, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (w) {
341
- d = w;
339
+ g = e[M](r, M, d, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (b) {
341
+ g = b;
342
342
  }
343
- d && !(d instanceof Error) && (me(M), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", s, g, typeof d), me(null)), d instanceof Error && !(d.message in Ce) && (Ce[d.message] = !0, me(M), v("Failed %s type: %s", s, d.message), me(null));
343
+ g && !(g instanceof Error) && (xe(j), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class", o, M, typeof g), xe(null)), g instanceof Error && !(g.message in Ae) && (Ae[g.message] = !0, xe(j), v("Failed %s type: %s", o, g.message), xe(null));
344
344
  }
345
345
  }
346
346
  }
347
- var er = Array.isArray;
348
- function we(e) {
349
- return er(e);
347
+ var et = Array.isArray;
348
+ function pe(e) {
349
+ return et(e);
350
350
  }
351
- function rr(e) {
351
+ function tt(e) {
352
352
  {
353
- var t = typeof Symbol == "function" && Symbol.toStringTag, s = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
- return s;
353
+ var r = typeof Symbol == "function" && Symbol.toStringTag, o = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
+ return o;
355
355
  }
356
356
  }
357
- function tr(e) {
357
+ function rt(e) {
358
358
  try {
359
- return Ee(e), !1;
359
+ return ke(e), !1;
360
360
  } catch {
361
361
  return !0;
362
362
  }
363
363
  }
364
- function Ee(e) {
364
+ function ke(e) {
365
365
  return "" + e;
366
366
  }
367
- function ke(e) {
368
- if (tr(e))
369
- return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rr(e)), Ee(e);
367
+ function Ee(e) {
368
+ if (rt(e))
369
+ return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tt(e)), ke(e);
370
370
  }
371
- var se = D.ReactCurrentOwner, ar = {
371
+ var ce = D.ReactCurrentOwner, at = {
372
372
  key: !0,
373
373
  ref: !0,
374
374
  __self: !0,
375
375
  __source: !0
376
- }, Oe, Pe, Ne;
377
- Ne = {};
378
- function nr(e) {
379
- if (ne.call(e, "ref")) {
380
- var t = Object.getOwnPropertyDescriptor(e, "ref").get;
381
- if (t && t.isReactWarning)
376
+ }, Oe, Pe, ve;
377
+ ve = {};
378
+ function nt(e) {
379
+ if (ie.call(e, "ref")) {
380
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
381
+ if (r && r.isReactWarning)
382
382
  return !1;
383
383
  }
384
384
  return e.ref !== void 0;
385
385
  }
386
- function sr(e) {
387
- if (ne.call(e, "key")) {
388
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
389
- if (t && t.isReactWarning)
386
+ function st(e) {
387
+ if (ie.call(e, "key")) {
388
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
389
+ if (r && r.isReactWarning)
390
390
  return !1;
391
391
  }
392
392
  return e.key !== void 0;
393
393
  }
394
- function or(e, t) {
395
- if (typeof e.ref == "string" && se.current && t && se.current.stateNode !== t) {
396
- var s = h(se.current.type);
397
- Ne[s] || (v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', h(se.current.type), e.ref), Ne[s] = !0);
394
+ function ot(e, r) {
395
+ if (typeof e.ref == "string" && ce.current && r && ce.current.stateNode !== r) {
396
+ var o = I(ce.current.type);
397
+ ve[o] || (v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', I(ce.current.type), e.ref), ve[o] = !0);
398
398
  }
399
399
  }
400
- function ir(e, t) {
400
+ function it(e, r) {
401
401
  {
402
- var s = function() {
403
- Oe || (Oe = !0, v("%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://reactjs.org/link/special-props)", t));
402
+ var o = function() {
403
+ Oe || (Oe = !0, v("%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://reactjs.org/link/special-props)", r));
404
404
  };
405
- s.isReactWarning = !0, Object.defineProperty(e, "key", {
406
- get: s,
405
+ o.isReactWarning = !0, Object.defineProperty(e, "key", {
406
+ get: o,
407
407
  configurable: !0
408
408
  });
409
409
  }
410
410
  }
411
- function cr(e, t) {
411
+ function ct(e, r) {
412
412
  {
413
- var s = function() {
414
- Pe || (Pe = !0, v("%s: `ref` 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://reactjs.org/link/special-props)", t));
413
+ var o = function() {
414
+ Pe || (Pe = !0, v("%s: `ref` 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://reactjs.org/link/special-props)", r));
415
415
  };
416
- s.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
- get: s,
416
+ o.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
+ get: o,
418
418
  configurable: !0
419
419
  });
420
420
  }
421
421
  }
422
- var lr = function(e, t, s, c, M, m, g) {
423
- var d = {
422
+ var lt = function(e, r, o, d, j, w, M) {
423
+ var g = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
425
  $$typeof: n,
426
426
  // Built-in properties that belong on the element
427
427
  type: e,
428
- key: t,
429
- ref: s,
430
- props: g,
428
+ key: r,
429
+ ref: o,
430
+ props: M,
431
431
  // Record the component responsible for creating this element.
432
- _owner: m
432
+ _owner: w
433
433
  };
434
- return d._store = {}, Object.defineProperty(d._store, "validated", {
434
+ return g._store = {}, Object.defineProperty(g._store, "validated", {
435
435
  configurable: !1,
436
436
  enumerable: !1,
437
437
  writable: !0,
438
438
  value: !1
439
- }), Object.defineProperty(d, "_self", {
439
+ }), Object.defineProperty(g, "_self", {
440
440
  configurable: !1,
441
441
  enumerable: !1,
442
442
  writable: !1,
443
- value: c
444
- }), Object.defineProperty(d, "_source", {
443
+ value: d
444
+ }), Object.defineProperty(g, "_source", {
445
445
  configurable: !1,
446
446
  enumerable: !1,
447
447
  writable: !1,
448
- value: M
449
- }), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
448
+ value: j
449
+ }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
450
450
  };
451
- function ur(e, t, s, c, M) {
451
+ function ut(e, r, o, d, j) {
452
452
  {
453
- var m, g = {}, d = null, C = null;
454
- s !== void 0 && (ke(s), d = "" + s), sr(t) && (ke(t.key), d = "" + t.key), nr(t) && (C = t.ref, or(t, M));
455
- for (m in t)
456
- ne.call(t, m) && !ar.hasOwnProperty(m) && (g[m] = t[m]);
453
+ var w, M = {}, g = null, A = null;
454
+ o !== void 0 && (Ee(o), g = "" + o), st(r) && (Ee(r.key), g = "" + r.key), nt(r) && (A = r.ref, ot(r, j));
455
+ for (w in r)
456
+ ie.call(r, w) && !at.hasOwnProperty(w) && (M[w] = r[w]);
457
457
  if (e && e.defaultProps) {
458
- var w = e.defaultProps;
459
- for (m in w)
460
- g[m] === void 0 && (g[m] = w[m]);
458
+ var b = e.defaultProps;
459
+ for (w in b)
460
+ M[w] === void 0 && (M[w] = b[w]);
461
461
  }
462
- if (d || C) {
463
- var L = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
- d && ir(g, L), C && cr(g, L);
462
+ if (g || A) {
463
+ var S = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
+ g && it(M, S), A && ct(M, S);
465
465
  }
466
- return lr(e, d, C, M, c, se.current, g);
466
+ return lt(e, g, A, j, d, ce.current, M);
467
467
  }
468
468
  }
469
- var ve = D.ReactCurrentOwner, Re = D.ReactDebugCurrentFrame;
470
- function q(e) {
469
+ var Ne = D.ReactCurrentOwner, Re = D.ReactDebugCurrentFrame;
470
+ function re(e) {
471
471
  if (e) {
472
- var t = e._owner, s = ye(e.type, e._source, t ? t.type : null);
473
- Re.setExtraStackFrame(s);
472
+ var r = e._owner, o = Me(e.type, e._source, r ? r.type : null);
473
+ Re.setExtraStackFrame(o);
474
474
  } else
475
475
  Re.setExtraStackFrame(null);
476
476
  }
@@ -479,10 +479,10 @@ function br() {
479
479
  function Le(e) {
480
480
  return typeof e == "object" && e !== null && e.$$typeof === n;
481
481
  }
482
- function ze() {
482
+ function $e() {
483
483
  {
484
- if (ve.current) {
485
- var e = h(ve.current.type);
484
+ if (Ne.current) {
485
+ var e = I(Ne.current.type);
486
486
  if (e)
487
487
  return `
488
488
 
@@ -491,246 +491,246 @@ Check the render method of \`` + e + "`.";
491
491
  return "";
492
492
  }
493
493
  }
494
- function dr(e) {
494
+ function dt(e) {
495
495
  {
496
496
  if (e !== void 0) {
497
- var t = e.fileName.replace(/^.*[\\\/]/, ""), s = e.lineNumber;
497
+ var r = e.fileName.replace(/^.*[\\\/]/, ""), o = e.lineNumber;
498
498
  return `
499
499
 
500
- Check your code at ` + t + ":" + s + ".";
500
+ Check your code at ` + r + ":" + o + ".";
501
501
  }
502
502
  return "";
503
503
  }
504
504
  }
505
- var Ue = {};
506
- function fr(e) {
505
+ var ze = {};
506
+ function ft(e) {
507
507
  {
508
- var t = ze();
509
- if (!t) {
510
- var s = typeof e == "string" ? e : e.displayName || e.name;
511
- s && (t = `
508
+ var r = $e();
509
+ if (!r) {
510
+ var o = typeof e == "string" ? e : e.displayName || e.name;
511
+ o && (r = `
512
512
 
513
- Check the top-level render call using <` + s + ">.");
513
+ Check the top-level render call using <` + o + ">.");
514
514
  }
515
- return t;
515
+ return r;
516
516
  }
517
517
  }
518
- function Ye(e, t) {
518
+ function Ue(e, r) {
519
519
  {
520
520
  if (!e._store || e._store.validated || e.key != null)
521
521
  return;
522
522
  e._store.validated = !0;
523
- var s = fr(t);
524
- if (Ue[s])
523
+ var o = ft(r);
524
+ if (ze[o])
525
525
  return;
526
- Ue[s] = !0;
527
- var c = "";
528
- e && e._owner && e._owner !== ve.current && (c = " It was passed a child from " + h(e._owner.type) + "."), q(e), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, c), q(null);
526
+ ze[o] = !0;
527
+ var d = "";
528
+ e && e._owner && e._owner !== Ne.current && (d = " It was passed a child from " + I(e._owner.type) + "."), re(e), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, d), re(null);
529
529
  }
530
530
  }
531
- function Fe(e, t) {
531
+ function Ye(e, r) {
532
532
  {
533
533
  if (typeof e != "object")
534
534
  return;
535
- if (we(e))
536
- for (var s = 0; s < e.length; s++) {
537
- var c = e[s];
538
- Le(c) && Ye(c, t);
535
+ if (pe(e))
536
+ for (var o = 0; o < e.length; o++) {
537
+ var d = e[o];
538
+ Le(d) && Ue(d, r);
539
539
  }
540
540
  else if (Le(e))
541
541
  e._store && (e._store.validated = !0);
542
542
  else if (e) {
543
- var M = G(e);
544
- if (typeof M == "function" && M !== e.entries)
545
- for (var m = M.call(e), g; !(g = m.next()).done; )
546
- Le(g.value) && Ye(g.value, t);
543
+ var j = G(e);
544
+ if (typeof j == "function" && j !== e.entries)
545
+ for (var w = j.call(e), M; !(M = w.next()).done; )
546
+ Le(M.value) && Ue(M.value, r);
547
547
  }
548
548
  }
549
549
  }
550
- function gr(e) {
550
+ function gt(e) {
551
551
  {
552
- var t = e.type;
553
- if (t == null || typeof t == "string")
552
+ var r = e.type;
553
+ if (r == null || typeof r == "string")
554
554
  return;
555
- var s;
556
- if (typeof t == "function")
557
- s = t.propTypes;
558
- else if (typeof t == "object" && (t.$$typeof === o || // Note: Memo only checks outer props here.
555
+ var o;
556
+ if (typeof r == "function")
557
+ o = r.propTypes;
558
+ else if (typeof r == "object" && (r.$$typeof === i || // Note: Memo only checks outer props here.
559
559
  // Inner props are checked in the reconciler.
560
- t.$$typeof === T))
561
- s = t.propTypes;
560
+ r.$$typeof === T))
561
+ o = r.propTypes;
562
562
  else
563
563
  return;
564
- if (s) {
565
- var c = h(t);
566
- Ke(s, e.props, "prop", c, e);
567
- } else if (t.PropTypes !== void 0 && !be) {
564
+ if (o) {
565
+ var d = I(r);
566
+ Ke(o, e.props, "prop", d, e);
567
+ } else if (r.PropTypes !== void 0 && !be) {
568
568
  be = !0;
569
- var M = h(t);
570
- v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
569
+ var j = I(r);
570
+ v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
571
571
  }
572
- typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
572
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
573
  }
574
574
  }
575
- function Mr(e) {
575
+ function yt(e) {
576
576
  {
577
- for (var t = Object.keys(e.props), s = 0; s < t.length; s++) {
578
- var c = t[s];
579
- if (c !== "children" && c !== "key") {
580
- q(e), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), q(null);
577
+ for (var r = Object.keys(e.props), o = 0; o < r.length; o++) {
578
+ var d = r[o];
579
+ if (d !== "children" && d !== "key") {
580
+ re(e), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), re(null);
581
581
  break;
582
582
  }
583
583
  }
584
- e.ref !== null && (q(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
584
+ e.ref !== null && (re(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
585
585
  }
586
586
  }
587
- var _e = {};
588
- function Qe(e, t, s, c, M, m) {
587
+ var Fe = {};
588
+ function _e(e, r, o, d, j, w) {
589
589
  {
590
- var g = Z(e);
591
- if (!g) {
592
- var d = "";
593
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (d += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
- var C = dr(M);
595
- C ? d += C : d += ze();
596
- var w;
597
- e === null ? w = "null" : we(e) ? w = "array" : e !== void 0 && e.$$typeof === n ? (w = "<" + (h(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : w = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", w, d);
590
+ var M = B(e);
591
+ if (!M) {
592
+ var g = "";
593
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
+ var A = dt(j);
595
+ A ? g += A : g += $e();
596
+ var b;
597
+ e === null ? b = "null" : pe(e) ? b = "array" : e !== void 0 && e.$$typeof === n ? (b = "<" + (I(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, g);
598
598
  }
599
- var L = ur(e, t, s, M, m);
600
- if (L == null)
601
- return L;
602
- if (g) {
603
- var k = t.children;
604
- if (k !== void 0)
605
- if (c)
606
- if (we(k)) {
607
- for (var X = 0; X < k.length; X++)
608
- Fe(k[X], e);
609
- Object.freeze && Object.freeze(k);
599
+ var S = ut(e, r, o, j, w);
600
+ if (S == null)
601
+ return S;
602
+ if (M) {
603
+ var R = r.children;
604
+ if (R !== void 0)
605
+ if (d)
606
+ if (pe(R)) {
607
+ for (var ae = 0; ae < R.length; ae++)
608
+ Ye(R[ae], e);
609
+ Object.freeze && Object.freeze(R);
610
610
  } else
611
611
  v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
612
  else
613
- Fe(k, e);
613
+ Ye(R, e);
614
614
  }
615
- if (ne.call(t, "key")) {
616
- var B = h(e), I = Object.keys(t).filter(function(pr) {
617
- return pr !== "key";
618
- }), Ae = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
619
- if (!_e[B + Ae]) {
620
- var jr = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
615
+ if (ie.call(r, "key")) {
616
+ var V = I(e), k = Object.keys(r).filter(function(wt) {
617
+ return wt !== "key";
618
+ }), Se = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
619
+ if (!Fe[V + Se]) {
620
+ var jt = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
621
621
  v(`A props object containing a "key" prop is being spread into JSX:
622
622
  let props = %s;
623
623
  <%s {...props} />
624
624
  React keys must be passed directly to JSX without using spread:
625
625
  let props = %s;
626
- <%s key={someKey} {...props} />`, Ae, B, jr, B), _e[B + Ae] = !0;
626
+ <%s key={someKey} {...props} />`, Se, V, jt, V), Fe[V + Se] = !0;
627
627
  }
628
628
  }
629
- return e === l ? Mr(L) : gr(L), L;
629
+ return e === c ? yt(S) : gt(S), S;
630
630
  }
631
631
  }
632
- function yr(e, t, s) {
633
- return Qe(e, t, s, !0);
632
+ function Mt(e, r, o) {
633
+ return _e(e, r, o, !0);
634
634
  }
635
- function mr(e, t, s) {
636
- return Qe(e, t, s, !1);
635
+ function xt(e, r, o) {
636
+ return _e(e, r, o, !1);
637
637
  }
638
- var xr = mr, hr = yr;
639
- ie.Fragment = l, ie.jsx = xr, ie.jsxs = hr;
640
- }()), ie;
638
+ var mt = xt, ht = Mt;
639
+ ue.Fragment = c, ue.jsx = mt, ue.jsxs = ht;
640
+ }()), ue;
641
641
  }
642
- process.env.NODE_ENV === "production" ? Te.exports = vr() : Te.exports = br();
643
- var r = Te.exports;
644
- const He = Be(), Lr = () => $e(He), Ur = ({ initialTheme: a = "light", children: n }) => {
645
- const [i, l] = O(a), x = () => {
646
- l((f) => f === "light" ? "dark" : "light");
642
+ process.env.NODE_ENV === "production" ? De.exports = Nt() : De.exports = bt();
643
+ var t = De.exports;
644
+ const He = Be(), Lt = () => Ze(He), Ut = ({ initialTheme: a = "light", children: n }) => {
645
+ const [l, c] = O(a), u = () => {
646
+ c((f) => f === "light" ? "dark" : "light");
647
647
  };
648
- return $(() => {
649
- document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(i);
650
- }, [i]), /* @__PURE__ */ r.jsx(He.Provider, { value: { theme: i, setTheme: l, toggleTheme: x }, children: n });
648
+ return X(() => {
649
+ document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(l);
650
+ }, [l]), /* @__PURE__ */ t.jsx(He.Provider, { value: { theme: l, setTheme: c, toggleTheme: u }, children: n });
651
651
  };
652
- let E = {
652
+ let P = {
653
653
  apiKey: null,
654
654
  apiSecret: null,
655
655
  apiUrl: "https://coinleyserver-production.up.railway.app"
656
656
  };
657
- const Ar = (a) => {
658
- E = { ...E, ...a }, console.log("API initialized with:", E);
659
- }, J = () => ({
657
+ const St = (a) => {
658
+ P = { ...P, ...a }, console.log("API initialized with:", P);
659
+ }, ne = () => ({
660
660
  "Content-Type": "application/json",
661
- "x-api-key": E.apiKey,
662
- "x-api-secret": E.apiSecret
663
- }), Sr = async (a) => {
661
+ "x-api-key": P.apiKey,
662
+ "x-api-secret": P.apiSecret
663
+ }), Tt = async (a) => {
664
664
  try {
665
- console.log("Creating payment with data:", a), console.log("API URL:", `${E.apiUrl}/api/payments/create`);
666
- const n = await fetch(`${E.apiUrl}/api/payments/create`, {
665
+ console.log("Creating payment with data:", a), console.log("API URL:", `${P.apiUrl}/api/payments/create`);
666
+ const n = await fetch(`${P.apiUrl}/api/payments/create`, {
667
667
  method: "POST",
668
- headers: J(),
668
+ headers: ne(),
669
669
  body: JSON.stringify(a)
670
670
  });
671
671
  if (console.log("Create payment response status:", n.status), !n.ok) {
672
- const l = await n.json();
673
- throw console.error("Error creating payment:", l), new Error(l.error || `Failed to create payment: ${n.status}`);
672
+ const c = await n.json();
673
+ throw console.error("Error creating payment:", c), new Error(c.error || `Failed to create payment: ${n.status}`);
674
674
  }
675
- const i = await n.json();
676
- return console.log("Create payment response data:", i), i;
675
+ const l = await n.json();
676
+ return console.log("Create payment response data:", l), l;
677
677
  } catch (n) {
678
678
  throw console.error("Create payment error:", n), n;
679
679
  }
680
- }, Yr = async (a) => {
680
+ }, Yt = async (a) => {
681
681
  try {
682
682
  console.log("Getting payment:", a);
683
- const n = await fetch(`${E.apiUrl}/api/payments/${a}`, {
683
+ const n = await fetch(`${P.apiUrl}/api/payments/${a}`, {
684
684
  method: "GET",
685
- headers: J()
685
+ headers: ne()
686
686
  });
687
687
  if (!n.ok) {
688
- const l = await n.json();
689
- throw console.error("Error getting payment:", l), new Error(l.error || `Failed to get payment: ${n.status}`);
688
+ const c = await n.json();
689
+ throw console.error("Error getting payment:", c), new Error(c.error || `Failed to get payment: ${n.status}`);
690
690
  }
691
- const i = await n.json();
692
- return console.log("Get payment response:", i), i;
691
+ const l = await n.json();
692
+ return console.log("Get payment response:", l), l;
693
693
  } catch (n) {
694
694
  throw console.error("Get payment error:", n), n;
695
695
  }
696
- }, Tr = async (a) => {
696
+ }, Dt = async (a) => {
697
697
  try {
698
- console.log("Processing payment with data:", a), console.log("API URL:", `${E.apiUrl}/api/payments/process`);
699
- const n = await fetch(`${E.apiUrl}/api/payments/process`, {
698
+ console.log("Processing payment with data:", a), console.log("API URL:", `${P.apiUrl}/api/payments/process`);
699
+ const n = await fetch(`${P.apiUrl}/api/payments/process`, {
700
700
  method: "POST",
701
- headers: J(),
701
+ headers: ne(),
702
702
  body: JSON.stringify(a)
703
703
  });
704
704
  if (console.log("Process payment response status:", n.status), !n.ok) {
705
- const l = await n.json();
706
- throw console.error("Error processing payment:", l), new Error(l.error || `Failed to process payment: ${n.status}`);
705
+ const c = await n.json();
706
+ throw console.error("Error processing payment:", c), new Error(c.error || `Failed to process payment: ${n.status}`);
707
707
  }
708
- const i = await n.json();
709
- return console.log("Process payment response data:", i), i;
708
+ const l = await n.json();
709
+ return console.log("Process payment response data:", l), l;
710
710
  } catch (n) {
711
711
  throw console.error("Process payment error:", n), n;
712
712
  }
713
- }, Fr = async (a = {}) => {
713
+ }, Ft = async (a = {}) => {
714
714
  try {
715
- const { page: n = 1, limit: i = 10, status: l, currency: x, startDate: f, endDate: j, search: A } = a, o = new URLSearchParams();
716
- o.append("page", n), o.append("limit", i), l && o.append("status", l), x && o.append("currency", x), f && o.append("startDate", f), j && o.append("endDate", j), A && o.append("search", A);
717
- const S = `${E.apiUrl}/api/payments/merchant/list?${o.toString()}`, y = await fetch(S, {
715
+ const { page: n = 1, limit: l = 10, status: c, currency: u, startDate: f, endDate: s, search: y } = a, i = new URLSearchParams();
716
+ i.append("page", n), i.append("limit", l), c && i.append("status", c), u && i.append("currency", u), f && i.append("startDate", f), s && i.append("endDate", s), y && i.append("search", y);
717
+ const N = `${P.apiUrl}/api/payments/merchant/list?${i.toString()}`, x = await fetch(N, {
718
718
  method: "GET",
719
- headers: J()
719
+ headers: ne()
720
720
  });
721
- if (!y.ok) {
722
- const T = await y.json();
723
- throw new Error(T.error || `Failed to get payments: ${y.status}`);
721
+ if (!x.ok) {
722
+ const T = await x.json();
723
+ throw new Error(T.error || `Failed to get payments: ${x.status}`);
724
724
  }
725
- return await y.json();
725
+ return await x.json();
726
726
  } catch (n) {
727
727
  throw console.error("Get merchant payments error:", n), n;
728
728
  }
729
- }, _r = async () => {
729
+ }, _t = async () => {
730
730
  try {
731
- const a = await fetch(`${E.apiUrl}/api/payments/merchant/stats`, {
731
+ const a = await fetch(`${P.apiUrl}/api/payments/merchant/stats`, {
732
732
  method: "GET",
733
- headers: J()
733
+ headers: ne()
734
734
  });
735
735
  if (!a.ok) {
736
736
  const n = await a.json();
@@ -740,11 +740,11 @@ const Ar = (a) => {
740
740
  } catch (a) {
741
741
  throw console.error("Get merchant payment stats error:", a), a;
742
742
  }
743
- }, Qr = async () => {
743
+ }, Qt = async () => {
744
744
  try {
745
- const a = await fetch(`${E.apiUrl}/api/payments/currencies`, {
745
+ const a = await fetch(`${P.apiUrl}/api/payments/currencies`, {
746
746
  method: "GET",
747
- headers: J()
747
+ headers: ne()
748
748
  });
749
749
  if (!a.ok) {
750
750
  const n = await a.json();
@@ -762,37 +762,37 @@ const Ar = (a) => {
762
762
  ]
763
763
  };
764
764
  }
765
- }, Ve = Be(), Dr = () => $e(Ve), Gr = ({
765
+ }, qe = Be(), Ct = () => Ze(qe), Gt = ({
766
766
  apiKey: a,
767
767
  apiSecret: n,
768
- apiUrl: i = "https://coinleyserver-production.up.railway.app",
769
- debug: l = !1,
770
- children: x
768
+ apiUrl: l = "https://coinleyserver-production.up.railway.app",
769
+ debug: c = !1,
770
+ children: u
771
771
  }) => {
772
- const [f, j] = O(!1), [A, o] = O(null);
773
- $(() => {
772
+ const [f, s] = O(!1), [y, i] = O(null);
773
+ X(() => {
774
774
  if (!a || !n) {
775
- o("API key and secret are required");
775
+ i("API key and secret are required");
776
776
  return;
777
777
  }
778
778
  try {
779
- Ar({ apiKey: a, apiSecret: n, apiUrl: i }), j(!0), l && console.log("Coinley SDK initialized with:", { apiKey: a, apiUrl: i });
780
- } catch (y) {
781
- o(y.message), l && console.error("Coinley SDK initialization error:", y);
779
+ St({ apiKey: a, apiSecret: n, apiUrl: l }), s(!0), c && console.log("Coinley SDK initialized with:", { apiKey: a, apiUrl: l });
780
+ } catch (x) {
781
+ i(x.message), c && console.error("Coinley SDK initialization error:", x);
782
782
  }
783
- }, [a, n, i, l]);
784
- const S = {
783
+ }, [a, n, l, c]);
784
+ const N = {
785
785
  apiKey: a,
786
786
  apiSecret: n,
787
- apiUrl: i,
787
+ apiUrl: l,
788
788
  isInitialized: f,
789
- error: A,
790
- debug: l
789
+ error: y,
790
+ debug: c
791
791
  };
792
- return /* @__PURE__ */ r.jsx(Ve.Provider, { value: S, children: x });
793
- }, Cr = ({ onSelect: a, selected: n, theme: i = "light" }) => {
792
+ return /* @__PURE__ */ t.jsx(qe.Provider, { value: N, children: u });
793
+ }, At = ({ onSelect: a, selected: n, theme: l = "light" }) => {
794
794
  console.log("PaymentMethods render:", { selected: n });
795
- const l = [
795
+ const c = [
796
796
  {
797
797
  id: "USDT",
798
798
  name: "USDT",
@@ -823,30 +823,30 @@ const Ar = (a) => {
823
823
  description: "USD Coin on Solana",
824
824
  logo: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzJCNzVFRCIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0yMS4yMDkgOS43MzlsLTIuOTQxIDIuOTQxYTMuMTMyIDMuMTMyIDAgMDAtNC41MzYgMGwtMi45NDItMi45NDFhNy42MjMgNy42MjMgMCAwMTEwLjQxOSAwek0xMC43OTEgMjIuMjYxbDIuOTQxLTIuOTQxYTMuMTMyIDMuMTMyIDAgMDA0LjUzNiAwbDIuOTQyIDIuOTQxYTcuNjIzIDcuNjIzIDAgMDEtMTAuNDE5IDB6bTExLjU3NS00LjI2MWgtNC4xNTNhMy4xMzMgMy4xMzMgMCAwMDAtNC41MzdoNC4xNTNhNy42MjEgNy42MjEgMCAwMTAgNC41Mzd6bS0xMy43OTMtNC41MzdoNC4xNTNhMy4xMzMgMy4xMzMgMCAwMDAgNC41MzdIOS42ODZhNy42MjEgNy42MjEgMCAwMTAtNC41Mzd6Ii8+PC9nPjwvc3ZnPg=="
825
825
  }
826
- ], x = (f) => {
826
+ ], u = (f) => {
827
827
  console.log("Method selected:", f), a(f);
828
828
  };
829
- return /* @__PURE__ */ r.jsxs("div", { children: [
830
- /* @__PURE__ */ r.jsx("h3", { className: `text-lg font-medium mb-3 ${i === "dark" ? "text-white" : "text-gray-800"}`, children: "Select Payment Method" }),
831
- /* @__PURE__ */ r.jsx("div", { className: "space-y-2", children: l.map((f) => /* @__PURE__ */ r.jsxs(
829
+ return /* @__PURE__ */ t.jsxs("div", { children: [
830
+ /* @__PURE__ */ t.jsx("h3", { className: `text-lg font-medium mb-3 ${l === "dark" ? "text-white" : "text-gray-800"}`, children: "Select Payment Method" }),
831
+ /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: c.map((f) => /* @__PURE__ */ t.jsxs(
832
832
  "button",
833
833
  {
834
- onClick: () => x(f.id),
835
- className: `w-full flex items-center p-3 rounded-lg transition-colors ${n === f.id ? i === "dark" ? "bg-blue-900/30 border border-blue-500" : "bg-blue-50 border border-blue-500" : i === "dark" ? "bg-gray-700 hover:bg-gray-600 border border-gray-700" : "bg-white hover:bg-gray-50 border border-gray-200"}`,
834
+ onClick: () => u(f.id),
835
+ className: `w-full flex items-center p-3 rounded-lg transition-colors ${n === f.id ? l === "dark" ? "bg-blue-900/30 border border-blue-500" : "bg-blue-50 border border-blue-500" : l === "dark" ? "bg-gray-700 hover:bg-gray-600 border border-gray-700" : "bg-white hover:bg-gray-50 border border-gray-200"}`,
836
836
  children: [
837
- /* @__PURE__ */ r.jsx("div", { className: "flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3", children: /* @__PURE__ */ r.jsx("img", { src: f.logo, alt: f.name, className: "h-6 w-6" }) }),
838
- /* @__PURE__ */ r.jsxs("div", { className: "flex-1 text-left", children: [
839
- /* @__PURE__ */ r.jsx("h4", { className: `font-medium ${i === "dark" ? "text-white" : "text-gray-900"}`, children: f.name }),
840
- /* @__PURE__ */ r.jsx("p", { className: `text-sm ${i === "dark" ? "text-gray-300" : "text-gray-500"}`, children: f.description })
837
+ /* @__PURE__ */ t.jsx("div", { className: "flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3", children: /* @__PURE__ */ t.jsx("img", { src: f.logo, alt: f.name, className: "h-6 w-6" }) }),
838
+ /* @__PURE__ */ t.jsxs("div", { className: "flex-1 text-left", children: [
839
+ /* @__PURE__ */ t.jsx("h4", { className: `font-medium ${l === "dark" ? "text-white" : "text-gray-900"}`, children: f.name }),
840
+ /* @__PURE__ */ t.jsx("p", { className: `text-sm ${l === "dark" ? "text-gray-300" : "text-gray-500"}`, children: f.description })
841
841
  ] }),
842
- n === f.id && /* @__PURE__ */ r.jsx(
842
+ n === f.id && /* @__PURE__ */ t.jsx(
843
843
  "svg",
844
844
  {
845
845
  xmlns: "http://www.w3.org/2000/svg",
846
846
  className: "h-5 w-5 text-blue-500",
847
847
  viewBox: "0 0 20 20",
848
848
  fill: "currentColor",
849
- children: /* @__PURE__ */ r.jsx(
849
+ children: /* @__PURE__ */ t.jsx(
850
850
  "path",
851
851
  {
852
852
  fillRule: "evenodd",
@@ -861,14 +861,14 @@ const Ar = (a) => {
861
861
  f.id
862
862
  )) })
863
863
  ] });
864
- }, Se = ({ status: a, theme: n = "light", message: i }) => {
865
- console.log("PaymentStatus render:", { status: a, message: i });
866
- const l = () => {
864
+ }, Te = ({ status: a, theme: n = "light", message: l }) => {
865
+ console.log("PaymentStatus render:", { status: a, message: l });
866
+ const c = () => {
867
867
  switch (a) {
868
868
  case "processing":
869
- return /* @__PURE__ */ r.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20" });
869
+ return /* @__PURE__ */ t.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20" });
870
870
  case "success":
871
- return /* @__PURE__ */ r.jsx("div", { className: "rounded-full h-12 w-12 bg-green-100 flex items-center justify-center", children: /* @__PURE__ */ r.jsx(
871
+ return /* @__PURE__ */ t.jsx("div", { className: "rounded-full h-12 w-12 bg-green-100 flex items-center justify-center", children: /* @__PURE__ */ t.jsx(
872
872
  "svg",
873
873
  {
874
874
  xmlns: "http://www.w3.org/2000/svg",
@@ -877,11 +877,11 @@ const Ar = (a) => {
877
877
  viewBox: "0 0 24 24",
878
878
  stroke: "currentColor",
879
879
  strokeWidth: 2,
880
- children: /* @__PURE__ */ r.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
880
+ children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
881
881
  }
882
882
  ) });
883
883
  case "error":
884
- return /* @__PURE__ */ r.jsx("div", { className: "rounded-full h-12 w-12 bg-red-100 flex items-center justify-center", children: /* @__PURE__ */ r.jsx(
884
+ return /* @__PURE__ */ t.jsx("div", { className: "rounded-full h-12 w-12 bg-red-100 flex items-center justify-center", children: /* @__PURE__ */ t.jsx(
885
885
  "svg",
886
886
  {
887
887
  xmlns: "http://www.w3.org/2000/svg",
@@ -890,13 +890,13 @@ const Ar = (a) => {
890
890
  viewBox: "0 0 24 24",
891
891
  stroke: "currentColor",
892
892
  strokeWidth: 2,
893
- children: /* @__PURE__ */ r.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
893
+ children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
894
894
  }
895
895
  ) });
896
896
  default:
897
897
  return null;
898
898
  }
899
- }, x = () => {
899
+ }, u = () => {
900
900
  switch (a) {
901
901
  case "processing":
902
902
  return "Processing Payment";
@@ -919,14 +919,66 @@ const Ar = (a) => {
919
919
  return n === "dark" ? "text-gray-300" : "text-gray-600";
920
920
  }
921
921
  };
922
- return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
923
- /* @__PURE__ */ r.jsx("div", { className: "mb-4", children: l() }),
924
- /* @__PURE__ */ r.jsx("h3", { className: `text-xl font-bold mb-2 ${n === "dark" ? "text-white" : "text-gray-900"}`, children: x() }),
925
- /* @__PURE__ */ r.jsx("p", { className: `text-center ${f()}`, children: i }),
926
- a === "processing" && /* @__PURE__ */ r.jsx("div", { className: `mt-4 text-xs ${n === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "This may take a few moments. Please do not close this window." }),
927
- a === "success" && /* @__PURE__ */ r.jsx("div", { className: `mt-4 p-2 rounded ${n === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: /* @__PURE__ */ r.jsx("p", { className: `text-xs ${n === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Your payment has been successfully processed. You will receive a confirmation shortly." }) })
922
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
923
+ /* @__PURE__ */ t.jsx("div", { className: "mb-4", children: c() }),
924
+ /* @__PURE__ */ t.jsx("h3", { className: `text-xl font-bold mb-2 ${n === "dark" ? "text-white" : "text-gray-900"}`, children: u() }),
925
+ /* @__PURE__ */ t.jsx("p", { className: `text-center ${f()}`, children: l }),
926
+ a === "processing" && /* @__PURE__ */ t.jsx("div", { className: `mt-4 text-xs ${n === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "This may take a few moments. Please do not close this window." }),
927
+ a === "success" && /* @__PURE__ */ t.jsx("div", { className: `mt-4 p-2 rounded ${n === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: /* @__PURE__ */ t.jsx("p", { className: `text-xs ${n === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Your payment has been successfully processed. You will receive a confirmation shortly." }) })
928
+ ] });
929
+ }, It = ({
930
+ walletAddress: a,
931
+ amount: n,
932
+ currency: l,
933
+ theme: c = "light",
934
+ size: u = 200
935
+ }) => {
936
+ const f = () => {
937
+ const s = Math.floor(u / 10);
938
+ let y = `<svg xmlns="http://www.w3.org/2000/svg" width="${u}" height="${u}" viewBox="0 0 ${u} ${u}">`;
939
+ y += `<rect width="${u}" height="${u}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<rect x="${s}" y="${s}" width="${s * 3}" height="${s * 3}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${s * 1.5}" y="${s * 1.5}" width="${s * 2}" height="${s * 2}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<rect x="${s * 2}" y="${s * 2}" width="${s}" height="${s}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${u - s * 4}" y="${s}" width="${s * 3}" height="${s * 3}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${u - s * 3.5}" y="${s * 1.5}" width="${s * 2}" height="${s * 2}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<rect x="${u - s * 3}" y="${s * 2}" width="${s}" height="${s}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${s}" y="${u - s * 4}" width="${s * 3}" height="${s * 3}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${s * 1.5}" y="${u - s * 3.5}" width="${s * 2}" height="${s * 2}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<rect x="${s * 2}" y="${u - s * 3}" width="${s}" height="${s}" fill="${c === "dark" ? "white" : "black"}"/>`, l.length + ((a == null ? void 0 : a.length) || 0);
940
+ for (let i = 0; i < 50; i++) {
941
+ const N = s * (1 + Math.floor(Math.random() * 8)), x = s * (1 + Math.floor(Math.random() * 8));
942
+ N < s * 4 && x < s * 4 || N > u - s * 5 && x < s * 4 || N < s * 4 && x > u - s * 5 || (y += `<rect x="${N}" y="${x}" width="${s}" height="${s}" fill="${c === "dark" ? "white" : "black"}"/>`);
943
+ }
944
+ return y += `<rect x="${u / 2 - s * 3}" y="${u / 2 - s * 1.5}" width="${s * 6}" height="${s * 3}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<text x="${u / 2}" y="${u / 2 + s / 2}" font-family="Arial" font-size="${s * 2}" font-weight="bold" text-anchor="middle" fill="${c === "dark" ? "white" : "black"}">${l}</text>`, y += "</svg>", y;
945
+ };
946
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center", children: [
947
+ /* @__PURE__ */ t.jsx(
948
+ "div",
949
+ {
950
+ className: `p-4 rounded-lg ${c === "dark" ? "bg-gray-700" : "bg-white"} mb-3`,
951
+ dangerouslySetInnerHTML: { __html: f() }
952
+ }
953
+ ),
954
+ /* @__PURE__ */ t.jsx("div", { className: `text-center text-sm ${c === "dark" ? "text-gray-300" : "text-gray-700"}`, children: "Scan with your wallet app to pay" }),
955
+ a && /* @__PURE__ */ t.jsxs("div", { className: "mt-3 w-full", children: [
956
+ /* @__PURE__ */ t.jsxs("p", { className: `text-xs ${c === "dark" ? "text-gray-400" : "text-gray-500"} mb-1`, children: [
957
+ "Send ",
958
+ n,
959
+ " ",
960
+ l,
961
+ " to:"
962
+ ] }),
963
+ /* @__PURE__ */ t.jsx("div", { className: `text-xs font-mono p-2 rounded overflow-auto break-all ${c === "dark" ? "bg-gray-800 text-gray-300" : "bg-gray-100 text-gray-700"}`, children: a })
964
+ ] }),
965
+ /* @__PURE__ */ t.jsx("div", { className: "mt-4 w-full", children: /* @__PURE__ */ t.jsxs("div", { className: `p-3 rounded ${c === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
966
+ /* @__PURE__ */ t.jsx("h4", { className: `text-sm font-medium mb-2 ${c === "dark" ? "text-white" : "text-gray-800"}`, children: "Payment Instructions" }),
967
+ /* @__PURE__ */ t.jsxs("ol", { className: `text-xs space-y-2 ${c === "dark" ? "text-gray-300" : "text-gray-600"}`, children: [
968
+ /* @__PURE__ */ t.jsx("li", { children: "1. Open your crypto wallet app" }),
969
+ /* @__PURE__ */ t.jsx("li", { children: "2. Scan the QR code above" }),
970
+ /* @__PURE__ */ t.jsxs("li", { children: [
971
+ "3. Confirm the payment amount (",
972
+ n,
973
+ " ",
974
+ l,
975
+ ")"
976
+ ] }),
977
+ /* @__PURE__ */ t.jsx("li", { children: '4. Click "Pay Now" button below after sending the payment' })
978
+ ] })
979
+ ] }) })
928
980
  ] });
929
- }, Q = () => typeof window < "u" && typeof window.ethereum < "u", Ir = async () => {
981
+ }, Q = () => typeof window < "u" && typeof window.ethereum < "u", kt = async () => {
930
982
  if (!Q())
931
983
  throw new Error("MetaMask is not installed");
932
984
  try {
@@ -934,7 +986,7 @@ const Ar = (a) => {
934
986
  } catch (a) {
935
987
  throw console.error("Error connecting to wallet:", a), a;
936
988
  }
937
- }, Er = async () => {
989
+ }, Et = async () => {
938
990
  if (!Q())
939
991
  throw new Error("MetaMask is not installed");
940
992
  try {
@@ -942,7 +994,7 @@ const Ar = (a) => {
942
994
  } catch (a) {
943
995
  throw console.error("Error getting accounts:", a), a;
944
996
  }
945
- }, Wr = async () => {
997
+ }, Wt = async () => {
946
998
  if (!Q())
947
999
  throw new Error("MetaMask is not installed");
948
1000
  try {
@@ -950,7 +1002,7 @@ const Ar = (a) => {
950
1002
  } catch (a) {
951
1003
  throw console.error("Error getting chain ID:", a), a;
952
1004
  }
953
- }, kr = async (a) => {
1005
+ }, Ot = async (a) => {
954
1006
  if (!Q())
955
1007
  throw new Error("MetaMask is not installed");
956
1008
  try {
@@ -961,29 +1013,29 @@ const Ar = (a) => {
961
1013
  } catch (n) {
962
1014
  throw console.error("Error sending transaction:", n), n;
963
1015
  }
964
- }, Zr = async (a, n, i) => {
1016
+ }, Bt = async (a, n, l) => {
965
1017
  if (!Q())
966
1018
  throw new Error("MetaMask is not installed");
967
1019
  try {
968
- const x = (await window.ethereum.request({ method: "eth_requestAccounts" }))[0], f = "0xa9059cbb", j = n.slice(2).padStart(64, "0"), A = i.toString(16).padStart(64, "0"), o = `${f}${j}${A}`, S = {
969
- from: x,
1020
+ const u = (await window.ethereum.request({ method: "eth_requestAccounts" }))[0], f = "0xa9059cbb", s = n.slice(2).padStart(64, "0"), y = l.toString(16).padStart(64, "0"), i = `${f}${s}${y}`, N = {
1021
+ from: u,
970
1022
  to: a,
971
- data: o
1023
+ data: i
972
1024
  };
973
1025
  return await window.ethereum.request({
974
1026
  method: "eth_sendTransaction",
975
- params: [S]
1027
+ params: [N]
976
1028
  });
977
- } catch (l) {
978
- throw console.error("Error sending token:", l), l;
1029
+ } catch (c) {
1030
+ throw console.error("Error sending token:", c), c;
979
1031
  }
980
- }, Br = async () => {
1032
+ }, Zt = async () => {
981
1033
  try {
982
- return (await Er()).length > 0;
1034
+ return (await Et()).length > 0;
983
1035
  } catch {
984
1036
  return !1;
985
1037
  }
986
- }, $r = (a) => ({
1038
+ }, Ht = (a) => ({
987
1039
  "0x1": "Ethereum Mainnet",
988
1040
  "0x3": "Ropsten Testnet",
989
1041
  "0x4": "Rinkeby Testnet",
@@ -992,132 +1044,163 @@ const Ar = (a) => {
992
1044
  "0x38": "Binance Smart Chain",
993
1045
  "0x89": "Polygon",
994
1046
  "0xa86a": "Avalanche"
995
- })[a] || `Unknown Network (${a})`, Hr = async (a, n) => {
1047
+ })[a] || `Unknown Network (${a})`, qt = async (a, n) => {
996
1048
  if (!Q())
997
1049
  throw new Error("MetaMask is not installed");
998
1050
  try {
999
- const i = "0x70a08231", l = n.slice(2).padStart(64, "0"), x = `${i}${l}`, f = await window.ethereum.request({
1051
+ const l = "0x70a08231", c = n.slice(2).padStart(64, "0"), u = `${l}${c}`, f = await window.ethereum.request({
1000
1052
  method: "eth_call",
1001
1053
  params: [
1002
1054
  {
1003
1055
  to: a,
1004
- data: x
1056
+ data: u
1005
1057
  },
1006
1058
  "latest"
1007
1059
  ]
1008
1060
  });
1009
1061
  return parseInt(f, 16).toString();
1010
- } catch (i) {
1011
- throw console.error("Error getting token balance:", i), i;
1062
+ } catch (l) {
1063
+ throw console.error("Error getting token balance:", l), l;
1012
1064
  }
1013
- }, Vr = {
1065
+ }, Vt = {
1014
1066
  USDT: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1015
1067
  USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
1016
1068
  DAI: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
1017
1069
  WETH: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
1018
1070
  WBTC: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
1019
- }, Or = "data:image/png;base64,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", Pr = ({
1071
+ }, Pt = "data:image/png;base64,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", Rt = ({
1020
1072
  isOpen: a,
1021
1073
  onClose: n,
1022
- payment: i,
1023
- paymentStatus: l,
1024
- selectedCurrency: x,
1074
+ payment: l,
1075
+ paymentStatus: c,
1076
+ selectedCurrency: u,
1025
1077
  onCurrencySelect: f,
1026
- onPayment: j,
1027
- error: A,
1028
- theme: o = "light",
1029
- merchantName: S,
1030
- transactionHash: y,
1078
+ onPayment: s,
1079
+ error: y,
1080
+ theme: i = "light",
1081
+ merchantName: N,
1082
+ transactionHash: x,
1031
1083
  walletConnected: T,
1032
- onConnectWallet: P,
1033
- testMode: N = !1
1084
+ onConnectWallet: $,
1085
+ testMode: L = !1
1034
1086
  }) => {
1035
- const [R, z] = O("select-currency"), [G, D] = O(!1);
1036
- $(() => {
1037
- D(Q());
1038
- }, []), $(() => {
1039
- l === "loading" ? z("processing") : l === "success" ? z("success") : l === "error" ? z("error") : l === "idle" && i && z("select-currency");
1040
- }, [l, i]);
1041
- const v = (h) => {
1042
- f(h), z("confirm");
1043
- }, K = () => {
1044
- j();
1045
- }, U = () => {
1046
- R === "confirm" && z("select-currency");
1047
- }, H = () => {
1087
+ const [z, U] = O("select-currency"), [G, D] = O(!1), [v, se] = O("wallet");
1088
+ X(() => {
1089
+ typeof window < "u" && D(Q());
1090
+ }, []), X(() => {
1091
+ c === "loading" ? U("processing") : c === "success" ? U("success") : c === "error" ? U("error") : c === "idle" && l && U("select-currency");
1092
+ }, [c, l]);
1093
+ const F = (C) => {
1094
+ f(C), U("confirm");
1095
+ }, W = () => {
1096
+ s(v === "qrcode");
1097
+ }, J = () => {
1098
+ z === "confirm" && U("select-currency");
1099
+ }, oe = () => {
1048
1100
  n();
1049
- }, ee = (h) => parseFloat(h).toFixed(2), re = (h) => h ? h.length <= 14 ? h : `${h.slice(0, 8)}...${h.slice(-6)}` : "", Y = `fixed inset-0 z-50 overflow-y-auto ${o === "dark" ? "bg-gray-900/75" : "bg-black/50"}`, V = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${o === "dark" ? "bg-gray-800 text-white" : "bg-white text-gray-800"}`, Z = `text-xl font-bold mb-4 ${o === "dark" ? "text-white" : "text-gray-900"}`, W = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${o === "dark" ? "bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500" : "bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500"}`, F = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${o === "dark" ? "bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500" : "bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500"}`;
1050
- return a ? /* @__PURE__ */ r.jsx("div", { className: Y, children: /* @__PURE__ */ r.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ r.jsxs("div", { className: V, children: [
1051
- /* @__PURE__ */ r.jsxs("div", { className: "flex justify-between items-center mb-6", children: [
1052
- /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
1053
- /* @__PURE__ */ r.jsx("img", { src: Or }),
1054
- /* @__PURE__ */ r.jsx("h2", { className: Z, children: "Coinley Pay" })
1101
+ }, Y = (C) => parseFloat(C).toFixed(2), K = (C) => C ? C.length <= 14 ? C : `${C.slice(0, 8)}...${C.slice(-6)}` : "", B = (C) => {
1102
+ se(C);
1103
+ }, ee = `fixed inset-0 z-50 overflow-y-auto ${i === "dark" ? "bg-gray-900/75" : "bg-black/50"}`, _ = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${i === "dark" ? "bg-gray-800 text-white" : "bg-white text-gray-800"}`, I = `text-xl font-bold mb-4 ${i === "dark" ? "text-white" : "text-gray-900"}`, E = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${i === "dark" ? "bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500" : "bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500"}`, p = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${i === "dark" ? "bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500" : "bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500"}`, H = "py-2 px-4 text-sm font-medium focus:outline-none transition-colors", Z = `${i === "dark" ? "bg-gray-700 text-white" : "bg-gray-100 text-gray-800"} rounded-t-md`, q = `${i === "dark" ? "text-gray-400 hover:text-gray-300" : "text-gray-500 hover:text-gray-700"}`;
1104
+ return a ? /* @__PURE__ */ t.jsx("div", { className: ee, children: /* @__PURE__ */ t.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ t.jsxs("div", { className: _, children: [
1105
+ /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center mb-6", children: [
1106
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1107
+ /* @__PURE__ */ t.jsx("img", { src: Pt, alt: "Coinley Logo", className: "h-8 mr-2" }),
1108
+ /* @__PURE__ */ t.jsx("h2", { className: I, children: "Coinley Pay" })
1055
1109
  ] }),
1056
- /* @__PURE__ */ r.jsx(
1110
+ /* @__PURE__ */ t.jsx(
1057
1111
  "button",
1058
1112
  {
1059
- onClick: H,
1060
- className: `text-gray-500 hover:text-gray-700 focus:outline-none ${o === "dark" ? "text-gray-400 hover:text-gray-300" : ""}`,
1061
- children: /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ r.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
1113
+ onClick: oe,
1114
+ className: `text-gray-500 hover:text-gray-700 focus:outline-none ${i === "dark" ? "text-gray-400 hover:text-gray-300" : ""}`,
1115
+ children: /* @__PURE__ */ t.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
1062
1116
  }
1063
1117
  )
1064
1118
  ] }),
1065
- /* @__PURE__ */ r.jsxs("div", { className: "mb-6", children: [
1066
- i && /* @__PURE__ */ r.jsxs("div", { className: `mb-6 p-4 rounded-lg ${o === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
1067
- /* @__PURE__ */ r.jsx("p", { className: `text-sm ${o === "dark" ? "text-gray-300" : "text-gray-600"}`, children: S }),
1068
- /* @__PURE__ */ r.jsxs("div", { className: "flex justify-between items-center mt-2", children: [
1069
- /* @__PURE__ */ r.jsx("span", { className: `font-medium ${o === "dark" ? "text-gray-300" : "text-gray-700"}`, children: "Amount:" }),
1070
- /* @__PURE__ */ r.jsxs("span", { className: "font-bold text-xl", children: [
1119
+ /* @__PURE__ */ t.jsxs("div", { className: "mb-6", children: [
1120
+ l && /* @__PURE__ */ t.jsxs("div", { className: `mb-6 p-4 rounded-lg ${i === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
1121
+ /* @__PURE__ */ t.jsx("p", { className: `text-sm ${i === "dark" ? "text-gray-300" : "text-gray-600"}`, children: N }),
1122
+ /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center mt-2", children: [
1123
+ /* @__PURE__ */ t.jsx("span", { className: `font-medium ${i === "dark" ? "text-gray-300" : "text-gray-700"}`, children: "Amount:" }),
1124
+ /* @__PURE__ */ t.jsxs("span", { className: "font-bold text-xl", children: [
1071
1125
  "$",
1072
- ee(i.totalAmount || i.amount)
1126
+ Y(l.totalAmount || l.amount)
1073
1127
  ] })
1074
1128
  ] }),
1075
- /* @__PURE__ */ r.jsx("div", { className: "text-xs mt-1 text-right", children: /* @__PURE__ */ r.jsxs("span", { className: `${o === "dark" ? "text-gray-400" : "text-gray-500"}`, children: [
1129
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs mt-1 text-right", children: /* @__PURE__ */ t.jsxs("span", { className: `${i === "dark" ? "text-gray-400" : "text-gray-500"}`, children: [
1076
1130
  "Payment ID: ",
1077
- i.id.slice(0, 8),
1131
+ l.id.slice(0, 8),
1078
1132
  "..."
1079
1133
  ] }) })
1080
1134
  ] }),
1081
- R === "select-currency" && /* @__PURE__ */ r.jsx(
1082
- Cr,
1135
+ z === "select-currency" && /* @__PURE__ */ t.jsx(
1136
+ At,
1083
1137
  {
1084
- onSelect: v,
1085
- selected: x,
1086
- theme: o
1138
+ onSelect: F,
1139
+ selected: u,
1140
+ theme: i
1087
1141
  }
1088
1142
  ),
1089
- R === "confirm" && i && /* @__PURE__ */ r.jsxs("div", { children: [
1090
- /* @__PURE__ */ r.jsxs("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
1091
- /* @__PURE__ */ r.jsx("h3", { className: `text-lg font-medium mb-2 ${o === "dark" ? "text-white" : "text-gray-800"}`, children: "Payment Details" }),
1092
- /* @__PURE__ */ r.jsxs("div", { className: "space-y-2", children: [
1093
- /* @__PURE__ */ r.jsxs("div", { className: "flex justify-between", children: [
1094
- /* @__PURE__ */ r.jsx("span", { className: o === "dark" ? "text-gray-300" : "text-gray-600", children: "Currency:" }),
1095
- /* @__PURE__ */ r.jsx("span", { className: "font-medium", children: x })
1143
+ z === "confirm" && l && /* @__PURE__ */ t.jsxs("div", { children: [
1144
+ /* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${i === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
1145
+ /* @__PURE__ */ t.jsx("h3", { className: `text-lg font-medium mb-2 ${i === "dark" ? "text-white" : "text-gray-800"}`, children: "Payment Details" }),
1146
+ /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1147
+ /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between", children: [
1148
+ /* @__PURE__ */ t.jsx("span", { className: i === "dark" ? "text-gray-300" : "text-gray-600", children: "Currency:" }),
1149
+ /* @__PURE__ */ t.jsx("span", { className: "font-medium", children: u })
1096
1150
  ] }),
1097
- /* @__PURE__ */ r.jsxs("div", { className: "flex justify-between", children: [
1098
- /* @__PURE__ */ r.jsx("span", { className: o === "dark" ? "text-gray-300" : "text-gray-600", children: "Network:" }),
1099
- /* @__PURE__ */ r.jsx("span", { className: "font-medium", children: x === "SOL" || x === "USDC_SOL" ? "Solana" : "Ethereum" })
1151
+ /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between", children: [
1152
+ /* @__PURE__ */ t.jsx("span", { className: i === "dark" ? "text-gray-300" : "text-gray-600", children: "Network:" }),
1153
+ /* @__PURE__ */ t.jsx("span", { className: "font-medium", children: u === "SOL" || u === "USDC_SOL" ? "Solana" : "Ethereum" })
1100
1154
  ] }),
1101
- /* @__PURE__ */ r.jsxs("div", { className: "flex justify-between", children: [
1102
- /* @__PURE__ */ r.jsx("span", { className: o === "dark" ? "text-gray-300" : "text-gray-600", children: "Fee:" }),
1103
- /* @__PURE__ */ r.jsx("span", { className: "font-medium", children: "1.75%" })
1155
+ /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between", children: [
1156
+ /* @__PURE__ */ t.jsx("span", { className: i === "dark" ? "text-gray-300" : "text-gray-600", children: "Fee:" }),
1157
+ /* @__PURE__ */ t.jsx("span", { className: "font-medium", children: "1.75%" })
1104
1158
  ] })
1105
1159
  ] })
1106
1160
  ] }),
1107
- N ? (
1161
+ /* @__PURE__ */ t.jsx("div", { className: "mb-4", children: /* @__PURE__ */ t.jsxs("div", { className: "flex border-b border-gray-200", children: [
1162
+ /* @__PURE__ */ t.jsx(
1163
+ "button",
1164
+ {
1165
+ onClick: () => B("wallet"),
1166
+ className: `${H} ${v === "wallet" ? Z : q}`,
1167
+ children: "Connect Wallet"
1168
+ }
1169
+ ),
1170
+ /* @__PURE__ */ t.jsx(
1171
+ "button",
1172
+ {
1173
+ onClick: () => B("qrcode"),
1174
+ className: `${H} ${v === "qrcode" ? Z : q}`,
1175
+ children: "QR Code"
1176
+ }
1177
+ )
1178
+ ] }) }),
1179
+ L ? (
1108
1180
  // Test mode payment option
1109
- /* @__PURE__ */ r.jsx("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-blue-900/20" : "bg-blue-50"}`, children: /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
1110
- /* @__PURE__ */ r.jsx("div", { className: "bg-blue-500 rounded-full p-2 mr-3", children: /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ r.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) }),
1111
- /* @__PURE__ */ r.jsxs("div", { children: [
1112
- /* @__PURE__ */ r.jsx("h3", { className: `font-medium ${o === "dark" ? "text-white" : "text-gray-800"}`, children: "Test Mode Payment" }),
1113
- /* @__PURE__ */ r.jsx("p", { className: `text-sm ${o === "dark" ? "text-gray-300" : "text-gray-600"}`, children: 'Click "Pay Now" to simulate a successful payment' })
1181
+ /* @__PURE__ */ t.jsx("div", { className: `p-4 rounded-lg mb-4 ${i === "dark" ? "bg-blue-900/20" : "bg-blue-50"}`, children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1182
+ /* @__PURE__ */ t.jsx("div", { className: "bg-blue-500 rounded-full p-2 mr-3", children: /* @__PURE__ */ t.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) }),
1183
+ /* @__PURE__ */ t.jsxs("div", { children: [
1184
+ /* @__PURE__ */ t.jsx("h3", { className: `font-medium ${i === "dark" ? "text-white" : "text-gray-800"}`, children: "Test Mode Payment" }),
1185
+ /* @__PURE__ */ t.jsx("p", { className: `text-sm ${i === "dark" ? "text-gray-300" : "text-gray-600"}`, children: 'Click "Pay Now" to simulate a successful payment' })
1114
1186
  ] })
1115
1187
  ] }) })
1188
+ ) : v === "qrcode" ? (
1189
+ // QR Code payment option
1190
+ /* @__PURE__ */ t.jsx("div", { className: `p-4 rounded-lg mb-4 ${i === "dark" ? "bg-blue-900/20" : "bg-blue-50"}`, children: /* @__PURE__ */ t.jsx(
1191
+ It,
1192
+ {
1193
+ walletAddress: l.walletAddress || "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
1194
+ amount: l.totalAmount || l.amount,
1195
+ currency: u,
1196
+ theme: i
1197
+ }
1198
+ ) })
1116
1199
  ) : G ? (
1117
1200
  // MetaMask available option
1118
- /* @__PURE__ */ r.jsxs("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-blue-900/20" : "bg-blue-50"}`, children: [
1119
- /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
1120
- /* @__PURE__ */ r.jsx(
1201
+ /* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${i === "dark" ? "bg-blue-900/20" : "bg-blue-50"}`, children: [
1202
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1203
+ /* @__PURE__ */ t.jsx(
1121
1204
  "img",
1122
1205
  {
1123
1206
  src: "https://metamask.io/images/metamask-fox.svg",
@@ -1125,286 +1208,290 @@ const Ar = (a) => {
1125
1208
  className: "w-8 h-8 mr-2"
1126
1209
  }
1127
1210
  ),
1128
- /* @__PURE__ */ r.jsxs("div", { children: [
1129
- /* @__PURE__ */ r.jsx("h3", { className: `font-medium ${o === "dark" ? "text-white" : "text-gray-800"}`, children: "Pay with MetaMask" }),
1130
- /* @__PURE__ */ r.jsx("p", { className: `text-sm ${o === "dark" ? "text-gray-300" : "text-gray-600"}`, children: T ? "Your wallet is connected. Click 'Pay Now' to proceed." : "Click 'Connect Wallet' to proceed with payment." })
1211
+ /* @__PURE__ */ t.jsxs("div", { children: [
1212
+ /* @__PURE__ */ t.jsx("h3", { className: `font-medium ${i === "dark" ? "text-white" : "text-gray-800"}`, children: "Pay with MetaMask" }),
1213
+ /* @__PURE__ */ t.jsx("p", { className: `text-sm ${i === "dark" ? "text-gray-300" : "text-gray-600"}`, children: T ? "Your wallet is connected. Click 'Pay Now' to proceed." : "Click 'Connect Wallet' to proceed with payment." })
1131
1214
  ] })
1132
1215
  ] }),
1133
- !T && /* @__PURE__ */ r.jsx(
1216
+ !T && /* @__PURE__ */ t.jsx(
1134
1217
  "button",
1135
1218
  {
1136
- onClick: P,
1137
- className: `mt-3 ${W}`,
1219
+ onClick: $,
1220
+ className: `mt-3 ${E}`,
1138
1221
  children: "Connect Wallet"
1139
1222
  }
1140
1223
  )
1141
1224
  ] })
1142
1225
  ) : (
1143
1226
  // MetaMask not available warning
1144
- /* @__PURE__ */ r.jsxs("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-yellow-900/20" : "bg-yellow-50"}`, children: [
1145
- /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
1146
- /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-yellow-500 mr-2", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ r.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
1147
- /* @__PURE__ */ r.jsxs("div", { children: [
1148
- /* @__PURE__ */ r.jsx("h3", { className: `font-medium ${o === "dark" ? "text-white" : "text-gray-800"}`, children: "MetaMask Not Detected" }),
1149
- /* @__PURE__ */ r.jsx("p", { className: `text-sm ${o === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Please install MetaMask extension to make payments" })
1227
+ /* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${i === "dark" ? "bg-yellow-900/20" : "bg-yellow-50"}`, children: [
1228
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1229
+ /* @__PURE__ */ t.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-yellow-500 mr-2", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
1230
+ /* @__PURE__ */ t.jsxs("div", { children: [
1231
+ /* @__PURE__ */ t.jsx("h3", { className: `font-medium ${i === "dark" ? "text-white" : "text-gray-800"}`, children: "MetaMask Not Detected" }),
1232
+ /* @__PURE__ */ t.jsx("p", { className: `text-sm ${i === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Please install MetaMask extension to make payments" })
1150
1233
  ] })
1151
1234
  ] }),
1152
- /* @__PURE__ */ r.jsx(
1235
+ /* @__PURE__ */ t.jsx(
1153
1236
  "a",
1154
1237
  {
1155
1238
  href: "https://metamask.io/download/",
1156
1239
  target: "_blank",
1157
1240
  rel: "noopener noreferrer",
1158
- className: `block mt-3 text-center ${W}`,
1241
+ className: `block mt-3 text-center ${E}`,
1159
1242
  children: "Install MetaMask"
1160
1243
  }
1161
1244
  )
1162
1245
  ] })
1163
1246
  ),
1164
- /* @__PURE__ */ r.jsxs("div", { className: "mt-6 grid grid-cols-2 gap-3", children: [
1165
- /* @__PURE__ */ r.jsx(
1247
+ /* @__PURE__ */ t.jsxs("div", { className: "mt-6 grid grid-cols-2 gap-3", children: [
1248
+ /* @__PURE__ */ t.jsx(
1166
1249
  "button",
1167
1250
  {
1168
1251
  type: "button",
1169
- onClick: U,
1170
- className: F,
1252
+ onClick: J,
1253
+ className: p,
1171
1254
  children: "Back"
1172
1255
  }
1173
1256
  ),
1174
- /* @__PURE__ */ r.jsx(
1257
+ /* @__PURE__ */ t.jsx(
1175
1258
  "button",
1176
1259
  {
1177
1260
  type: "button",
1178
- onClick: K,
1179
- className: W,
1180
- disabled: !N && G && !T,
1261
+ onClick: W,
1262
+ className: E,
1263
+ disabled: !L && v === "wallet" && G && !T,
1181
1264
  children: "Pay Now"
1182
1265
  }
1183
1266
  )
1184
1267
  ] })
1185
1268
  ] }),
1186
- R === "processing" && /* @__PURE__ */ r.jsx(
1187
- Se,
1269
+ z === "processing" && /* @__PURE__ */ t.jsx(
1270
+ Te,
1188
1271
  {
1189
1272
  status: "processing",
1190
- theme: o,
1273
+ theme: i,
1191
1274
  message: "Processing your payment..."
1192
1275
  }
1193
1276
  ),
1194
- R === "success" && /* @__PURE__ */ r.jsxs("div", { children: [
1195
- /* @__PURE__ */ r.jsx(
1196
- Se,
1277
+ z === "success" && /* @__PURE__ */ t.jsxs("div", { children: [
1278
+ /* @__PURE__ */ t.jsx(
1279
+ Te,
1197
1280
  {
1198
1281
  status: "success",
1199
- theme: o,
1282
+ theme: i,
1200
1283
  message: "Payment successful!"
1201
1284
  }
1202
1285
  ),
1203
- y && /* @__PURE__ */ r.jsxs("div", { className: `mt-4 p-3 rounded-lg ${o === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
1204
- /* @__PURE__ */ r.jsx("p", { className: `text-xs ${o === "dark" ? "text-gray-300" : "text-gray-600"} mb-1`, children: "Transaction Hash:" }),
1205
- /* @__PURE__ */ r.jsx("p", { className: `text-sm font-mono break-all ${o === "dark" ? "text-white" : "text-gray-800"}`, children: re(y) }),
1206
- /* @__PURE__ */ r.jsx(
1286
+ x && /* @__PURE__ */ t.jsxs("div", { className: `mt-4 p-3 rounded-lg ${i === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
1287
+ /* @__PURE__ */ t.jsx("p", { className: `text-xs ${i === "dark" ? "text-gray-300" : "text-gray-600"} mb-1`, children: "Transaction Hash:" }),
1288
+ /* @__PURE__ */ t.jsx("p", { className: `text-sm font-mono break-all ${i === "dark" ? "text-white" : "text-gray-800"}`, children: K(x) }),
1289
+ /* @__PURE__ */ t.jsx(
1207
1290
  "a",
1208
1291
  {
1209
- href: `https://etherscan.io/tx/${y}`,
1292
+ href: `https://etherscan.io/tx/${x}`,
1210
1293
  target: "_blank",
1211
1294
  rel: "noopener noreferrer",
1212
- className: `text-xs ${o === "dark" ? "text-blue-400" : "text-blue-600"} mt-2 inline-block`,
1295
+ className: `text-xs ${i === "dark" ? "text-blue-400" : "text-blue-600"} mt-2 inline-block`,
1213
1296
  children: "View on Etherscan →"
1214
1297
  }
1215
1298
  )
1216
1299
  ] })
1217
1300
  ] }),
1218
- R === "error" && /* @__PURE__ */ r.jsxs("div", { children: [
1219
- /* @__PURE__ */ r.jsx(
1220
- Se,
1301
+ z === "error" && /* @__PURE__ */ t.jsxs("div", { children: [
1302
+ /* @__PURE__ */ t.jsx(
1303
+ Te,
1221
1304
  {
1222
1305
  status: "error",
1223
- theme: o,
1224
- message: A || "An error occurred while processing your payment."
1306
+ theme: i,
1307
+ message: y || "An error occurred while processing your payment."
1225
1308
  }
1226
1309
  ),
1227
- /* @__PURE__ */ r.jsx(
1310
+ /* @__PURE__ */ t.jsx(
1228
1311
  "button",
1229
1312
  {
1230
1313
  type: "button",
1231
- onClick: U,
1232
- className: `mt-4 ${F}`,
1314
+ onClick: J,
1315
+ className: `mt-4 ${p}`,
1233
1316
  children: "Try Again"
1234
1317
  }
1235
1318
  )
1236
1319
  ] })
1237
1320
  ] }),
1238
- /* @__PURE__ */ r.jsx("div", { className: `text-center text-xs ${o === "dark" ? "text-gray-400" : "text-gray-500"}`, children: /* @__PURE__ */ r.jsx("p", { children: "Powered by Coinley - Secure Cryptocurrency Payments" }) })
1321
+ /* @__PURE__ */ t.jsx("div", { className: `text-center text-xs ${i === "dark" ? "text-gray-400" : "text-gray-500"}`, children: /* @__PURE__ */ t.jsx("p", { children: "Powered by Coinley - Secure Cryptocurrency Payments" }) })
1239
1322
  ] }) }) }) : null;
1240
- }, Rr = wr(({
1323
+ }, $t = pt(({
1241
1324
  apiKey: a,
1242
1325
  apiSecret: n,
1243
- apiUrl: i,
1244
- customerEmail: l,
1245
- merchantName: x = "Merchant",
1326
+ apiUrl: l,
1327
+ customerEmail: c,
1328
+ merchantName: u = "Merchant",
1246
1329
  onSuccess: f,
1247
- onError: j,
1248
- onClose: A,
1249
- theme: o,
1250
- autoOpen: S = !1,
1251
- debug: y = !1,
1330
+ onError: s,
1331
+ onClose: y,
1332
+ theme: i,
1333
+ autoOpen: N = !1,
1334
+ debug: x = !1,
1252
1335
  testMode: T = !1
1253
- // Add testMode flag for development
1254
- }, P) => {
1255
- const N = Dr(), { theme: R } = Lr(), [z, G] = O(S), [D, v] = O(null), [K, U] = O("idle"), [H, ee] = O("USDT"), [re, Y] = O(null), [V, Z] = O(null), [W, F] = O(!1);
1256
- a || (N == null || N.apiKey), n || (N == null || N.apiSecret), i || (N == null || N.apiUrl);
1257
- const h = o || R, _ = y || (N == null ? void 0 : N.debug);
1258
- Nr(P, () => ({
1259
- open: (u) => {
1260
- ce(u);
1336
+ }, $) => {
1337
+ const L = Ct(), { theme: z } = Lt(), [U, G] = O(N), [D, v] = O(null), [se, F] = O("idle"), [W, J] = O("USDT"), [oe, Y] = O(null), [K, B] = O(null), [ee, _] = O(!1);
1338
+ a || (L == null || L.apiKey), n || (L == null || L.apiSecret), l || (L == null || L.apiUrl);
1339
+ const I = i || z, E = x || (L == null ? void 0 : L.debug);
1340
+ vt($, () => ({
1341
+ open: (m) => {
1342
+ H(m);
1261
1343
  },
1262
1344
  close: () => {
1263
- te();
1345
+ Z();
1264
1346
  },
1265
1347
  getPayment: () => D
1266
1348
  }));
1267
- const p = (u, b) => {
1268
- _ && console.log(`[Coinley SDK] ${u}`, b);
1349
+ const p = (m, h) => {
1350
+ E && console.log(`[Coinley SDK] ${m}`, h);
1269
1351
  };
1270
- $(() => {
1352
+ X(() => {
1271
1353
  (async () => {
1272
1354
  if (Q())
1273
1355
  try {
1274
- const b = await window.ethereum.request({ method: "eth_accounts" });
1275
- F(b && b.length > 0);
1276
- } catch (b) {
1277
- p("Error checking wallet connection:", b), F(!1);
1356
+ const h = await window.ethereum.request({ method: "eth_accounts" });
1357
+ _(h && h.length > 0);
1358
+ } catch (h) {
1359
+ p("Error checking wallet connection:", h), _(!1);
1278
1360
  }
1279
1361
  else
1280
- F(!1);
1362
+ _(!1);
1281
1363
  })();
1282
- }, []), $(() => {
1283
- const u = (b) => {
1284
- F(b.length > 0);
1364
+ }, []), X(() => {
1365
+ const m = (h) => {
1366
+ _(h.length > 0);
1285
1367
  };
1286
- return window.ethereum && window.ethereum.on("accountsChanged", u), () => {
1287
- window.ethereum && window.ethereum.removeListener("accountsChanged", u);
1368
+ return typeof window < "u" && window.ethereum && window.ethereum.on("accountsChanged", m), () => {
1369
+ typeof window < "u" && window.ethereum && window.ethereum.removeListener("accountsChanged", m);
1288
1370
  };
1289
1371
  }, []);
1290
- const ce = async (u) => {
1291
- if (!u || !u.amount) {
1292
- Y("Payment amount is required"), j && j(new Error("Payment amount is required"));
1372
+ const H = async (m) => {
1373
+ if (!m || !m.amount) {
1374
+ Y("Payment amount is required"), s && s(new Error("Payment amount is required"));
1293
1375
  return;
1294
1376
  }
1295
- U("loading"), G(!0);
1377
+ F("loading"), G(!0);
1296
1378
  try {
1297
- p("Creating payment with details:", u);
1298
- const b = await Sr({
1299
- amount: u.amount,
1300
- currency: u.currency || "USDT",
1301
- customerEmail: u.customerEmail || l,
1302
- callbackUrl: u.callbackUrl,
1303
- metadata: u.metadata || {}
1379
+ p("Creating payment with details:", m);
1380
+ const h = await Tt({
1381
+ amount: m.amount,
1382
+ currency: m.currency || "USDT",
1383
+ customerEmail: m.customerEmail || c,
1384
+ callbackUrl: m.callbackUrl,
1385
+ metadata: m.metadata || {}
1386
+ });
1387
+ p("Payment created:", h), v(h.payment), F("idle"), Y(null), p("Payment created and state updated:", {
1388
+ payment: h.payment,
1389
+ status: "idle"
1304
1390
  });
1305
- p("Payment created:", b), v(b.payment), U("idle"), Y(null);
1306
- } catch (b) {
1307
- p("Error creating payment:", b), Y(b.message || "Failed to create payment"), U("error"), j && j(b);
1391
+ } catch (h) {
1392
+ p("Error creating payment:", h), Y(h.message || "Failed to create payment"), F("error"), s && s(h);
1308
1393
  }
1309
- }, te = () => {
1310
- G(!1), Z(null), A && A();
1311
- }, le = (u) => {
1312
- p("Currency selected:", u), ee(u);
1313
- }, ae = async () => {
1394
+ }, Z = () => {
1395
+ G(!1), B(null), y && y();
1396
+ }, q = (m) => {
1397
+ p("Currency selected:", m), J(m);
1398
+ }, C = async () => {
1314
1399
  if (!Q())
1315
1400
  return Y("MetaMask is not installed. Please install MetaMask to make payments."), !1;
1316
1401
  try {
1317
- const u = await Ir();
1318
- return F(u.length > 0), u.length > 0;
1319
- } catch (u) {
1320
- return p("Error connecting to wallet:", u), Y(u.message || "Failed to connect to wallet"), !1;
1402
+ const m = await kt();
1403
+ return _(m.length > 0), m.length > 0;
1404
+ } catch (m) {
1405
+ return p("Error connecting to wallet:", m), Y(m.message || "Failed to connect to wallet"), !1;
1321
1406
  }
1322
- }, ue = async () => {
1407
+ }, de = async (m = !1) => {
1323
1408
  if (!D) {
1324
1409
  Y("No active payment to process");
1325
1410
  return;
1326
1411
  }
1327
- p("Starting payment process..."), U("loading"), Z(null);
1412
+ p("Starting payment process...", { isQrCodeMode: m }), F("loading"), B(null);
1328
1413
  try {
1329
- p("Processing payment:", { paymentId: D.id, currency: H });
1330
- let u;
1414
+ p("Processing payment:", { paymentId: D.id, currency: W, isQrCodeMode: m });
1415
+ let h;
1331
1416
  if (T)
1332
- p("Test mode: Generating mock transaction..."), u = `0x${Array.from({ length: 64 }, () => Math.floor(Math.random() * 16).toString(16)).join("")}`;
1417
+ p("Test mode: Generating mock transaction..."), h = `0x${Array.from({ length: 64 }, () => Math.floor(Math.random() * 16).toString(16)).join("")}`;
1418
+ else if (m)
1419
+ p("QR code payment: User confirms payment was sent"), h = `qrcode_${Date.now().toString(16)}_${Math.random().toString(16).substring(2, 10)}`;
1333
1420
  else {
1334
- if (!W && !await ae())
1421
+ if (!ee && !await C())
1335
1422
  throw new Error("Please connect your wallet to proceed with payment");
1336
- const de = D.merchantAddress || "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", xe = {
1337
- from: await window.ethereum.request({ method: "eth_requestAccounts" }).then((fe) => fe[0]),
1338
- to: de,
1423
+ const me = D.walletAddress || "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", he = {
1424
+ from: await window.ethereum.request({ method: "eth_requestAccounts" }).then((te) => te[0]),
1425
+ to: me,
1339
1426
  value: "0x0",
1340
1427
  // For ERC-20 tokens, value is 0
1341
1428
  data: "0x"
1342
1429
  // Would include token transfer data for ERC-20
1343
1430
  };
1344
- p("Sending transaction to wallet for approval..."), u = await kr(xe);
1431
+ p("Sending transaction to wallet for approval..."), h = await Ot(he);
1345
1432
  }
1346
- p("Transaction hash:", u), Z(u), p("Sending process payment request to API...");
1347
- const b = await Tr({
1433
+ p("Transaction hash:", h), B(h), p("Sending process payment request to API...");
1434
+ const fe = await Dt({
1348
1435
  paymentId: D.id,
1349
- transactionHash: u,
1350
- network: "ethereum"
1351
- // Or determine based on selected currency
1436
+ transactionHash: h,
1437
+ network: W === "SOL" || W === "USDC_SOL" ? "solana" : "ethereum"
1352
1438
  });
1353
- p("Payment processed successfully:", b), U("success"), f && (p("Calling onSuccess callback..."), f(D.id, u));
1354
- } catch (u) {
1355
- p("Payment error:", u), Y(u.message || "Failed to process payment"), U("error"), j && j(u);
1439
+ p("Payment processed successfully:", fe), F("success"), f && (p("Calling onSuccess callback..."), f(D.id, h));
1440
+ } catch (h) {
1441
+ p("Payment error:", h), Y(h.message || "Failed to process payment"), F("error"), s && s(h);
1356
1442
  }
1357
1443
  };
1358
- return $(() => {
1359
- S && D && G(!0);
1360
- }, [S, D]), /* @__PURE__ */ r.jsx(r.Fragment, { children: z && /* @__PURE__ */ r.jsx(
1361
- Pr,
1444
+ return X(() => {
1445
+ N && D && G(!0);
1446
+ }, [N, D]), /* @__PURE__ */ t.jsx(t.Fragment, { children: U && /* @__PURE__ */ t.jsx(
1447
+ Rt,
1362
1448
  {
1363
- isOpen: z,
1364
- onClose: te,
1449
+ isOpen: U,
1450
+ onClose: Z,
1365
1451
  payment: D,
1366
- paymentStatus: K,
1367
- selectedCurrency: H,
1368
- onCurrencySelect: le,
1369
- onPayment: ue,
1370
- error: re,
1371
- theme: h,
1372
- merchantName: x,
1373
- transactionHash: V,
1374
- walletConnected: W,
1375
- onConnectWallet: ae,
1452
+ paymentStatus: se,
1453
+ selectedCurrency: W,
1454
+ onCurrencySelect: q,
1455
+ onPayment: de,
1456
+ error: oe,
1457
+ theme: I,
1458
+ merchantName: u,
1459
+ transactionHash: K,
1460
+ walletConnected: ee,
1461
+ onConnectWallet: C,
1376
1462
  testMode: T
1377
1463
  }
1378
1464
  ) });
1379
1465
  });
1380
- Rr.displayName = "CoinleyCheckout";
1381
- const qr = {
1382
- apiUrl: 'https://coinleyserver-production.up.railway.app"',
1466
+ $t.displayName = "CoinleyCheckout";
1467
+ const Xt = {
1468
+ apiUrl: "https://coinleyserver-production.up.railway.app",
1383
1469
  debug: !1,
1384
1470
  testMode: !1,
1385
1471
  theme: "light"
1386
- }, Xr = "1.0.0";
1472
+ }, Jt = "1.0.2";
1387
1473
  export {
1388
- Rr as CoinleyCheckout,
1389
- Pr as CoinleyModal,
1390
- Gr as CoinleyProvider,
1391
- qr as DEFAULT_CONFIG,
1392
- Vr as TOKEN_ADDRESSES,
1393
- Ur as ThemeProvider,
1394
- Xr as VERSION,
1395
- Ir as connectWallet,
1396
- Sr as createPayment,
1397
- Er as getAccounts,
1398
- Wr as getChainId,
1399
- _r as getMerchantPaymentStats,
1400
- Fr as getMerchantPayments,
1401
- $r as getNetworkName,
1402
- Yr as getPayment,
1403
- Qr as getSupportedCurrencies,
1404
- Hr as getTokenBalance,
1474
+ $t as CoinleyCheckout,
1475
+ Rt as CoinleyModal,
1476
+ Gt as CoinleyProvider,
1477
+ Xt as DEFAULT_CONFIG,
1478
+ It as QRCode,
1479
+ Vt as TOKEN_ADDRESSES,
1480
+ Ut as ThemeProvider,
1481
+ Jt as VERSION,
1482
+ kt as connectWallet,
1483
+ Tt as createPayment,
1484
+ Et as getAccounts,
1485
+ Wt as getChainId,
1486
+ _t as getMerchantPaymentStats,
1487
+ Ft as getMerchantPayments,
1488
+ Ht as getNetworkName,
1489
+ Yt as getPayment,
1490
+ Qt as getSupportedCurrencies,
1491
+ qt as getTokenBalance,
1405
1492
  Q as isMetaMaskInstalled,
1406
- Br as isWalletConnected,
1407
- Tr as processPayment,
1408
- Zr as sendToken,
1409
- kr as sendTransaction
1493
+ Zt as isWalletConnected,
1494
+ Dt as processPayment,
1495
+ Bt as sendToken,
1496
+ Ot as sendTransaction
1410
1497
  };