moyasar-payment-form 2.2.7 → 2.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/moyasar.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: moyasar-payment-form
3
- * version: v2.2.7
3
+ * version: v2.2.9
4
4
  * description: Moyasar payment form utilities
5
5
  * author: Jan Jagieła - Railwaymen Team
6
6
  * homepage: https://docs.moyasar.com
@@ -9,14 +9,14 @@ var Se = Object.defineProperty, Pe = Object.defineProperties;
9
9
  var Xe = Object.getOwnPropertyDescriptors;
10
10
  var DA = Object.getOwnPropertySymbols;
11
11
  var ft = Object.prototype.hasOwnProperty, dt = Object.prototype.propertyIsEnumerable;
12
- var mt = Math.pow, pt = (A, t, e) => t in A ? Se(A, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : A[t] = e, S = (A, t) => {
12
+ var mt = Math.pow, pt = (A, t, e) => t in A ? Se(A, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : A[t] = e, k = (A, t) => {
13
13
  for (var e in t || (t = {}))
14
14
  ft.call(t, e) && pt(A, e, t[e]);
15
15
  if (DA)
16
16
  for (var e of DA(t))
17
17
  dt.call(t, e) && pt(A, e, t[e]);
18
18
  return A;
19
- }, X = (A, t) => Pe(A, Xe(t));
19
+ }, Q = (A, t) => Pe(A, Xe(t));
20
20
  var MA = (A, t) => {
21
21
  var e = {};
22
22
  for (var n in A)
@@ -163,15 +163,15 @@ function ht(A) {
163
163
  };
164
164
  }
165
165
  function at(A, t, e, n, r, a, o, l, i, s) {
166
- var u, c, m, f, w, y, v, d, g, D, b, h, C, P, O, L, k, Q = t.type;
166
+ var u, c, m, f, w, y, v, d, g, C, b, h, D, S, O, L, P, X = t.type;
167
167
  if (t.constructor != null) return null;
168
168
  128 & e.__u && (i = !!(32 & e.__u), a = [l = t.__e = e.__e]), (u = B.__b) && u(t);
169
- A: if (typeof Q == "function") try {
170
- if (d = t.props, g = "prototype" in Q && Q.prototype.render, D = (u = Q.contextType) && n[u.__c], b = u ? D ? D.props.value : u.__ : n, e.__c ? v = (c = t.__c = e.__c).__ = c.__E : (g ? t.__c = c = new Q(d, b) : (t.__c = c = new F(d, b), c.constructor = Q, c.render = Ie), D && D.sub(c), c.props = d, c.state || (c.state = {}), c.context = b, c.__n = n, m = c.__d = !0, c.__h = [], c._sb = []), g && c.__s == null && (c.__s = c.state), g && Q.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = tA({}, c.__s)), tA(c.__s, Q.getDerivedStateFromProps(d, c.__s))), f = c.props, w = c.state, c.__v = t, m) g && Q.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), g && c.componentDidMount != null && c.__h.push(c.componentDidMount);
169
+ A: if (typeof X == "function") try {
170
+ if (d = t.props, g = "prototype" in X && X.prototype.render, C = (u = X.contextType) && n[u.__c], b = u ? C ? C.props.value : u.__ : n, e.__c ? v = (c = t.__c = e.__c).__ = c.__E : (g ? t.__c = c = new X(d, b) : (t.__c = c = new F(d, b), c.constructor = X, c.render = Ie), C && C.sub(c), c.props = d, c.state || (c.state = {}), c.context = b, c.__n = n, m = c.__d = !0, c.__h = [], c._sb = []), g && c.__s == null && (c.__s = c.state), g && X.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = tA({}, c.__s)), tA(c.__s, X.getDerivedStateFromProps(d, c.__s))), f = c.props, w = c.state, c.__v = t, m) g && X.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), g && c.componentDidMount != null && c.__h.push(c.componentDidMount);
171
171
  else {
172
- if (g && Q.getDerivedStateFromProps == null && d !== f && c.componentWillReceiveProps != null && c.componentWillReceiveProps(d, b), !c.__e && c.shouldComponentUpdate != null && c.shouldComponentUpdate(d, c.__s, b) === !1 || t.__v == e.__v) {
173
- for (t.__v != e.__v && (c.props = d, c.state = c.__s, c.__d = !1), t.__e = e.__e, t.__k = e.__k, t.__k.some(function(J) {
174
- J && (J.__ = t);
172
+ if (g && X.getDerivedStateFromProps == null && d !== f && c.componentWillReceiveProps != null && c.componentWillReceiveProps(d, b), !c.__e && c.shouldComponentUpdate != null && c.shouldComponentUpdate(d, c.__s, b) === !1 || t.__v == e.__v) {
173
+ for (t.__v != e.__v && (c.props = d, c.state = c.__s, c.__d = !1), t.__e = e.__e, t.__k = e.__k, t.__k.some(function(U) {
174
+ U && (U.__ = t);
175
175
  }), h = 0; h < c._sb.length; h++) c.__h.push(c._sb[h]);
176
176
  c._sb = [], c.__h.length && o.push(c);
177
177
  break A;
@@ -180,20 +180,20 @@ function at(A, t, e, n, r, a, o, l, i, s) {
180
180
  c.componentDidUpdate(f, w, y);
181
181
  });
182
182
  }
183
- if (c.context = b, c.props = d, c.__P = A, c.__e = !1, C = B.__r, P = 0, g) {
184
- for (c.state = c.__s, c.__d = !1, C && C(t), u = c.render(c.props, c.state, c.context), O = 0; O < c._sb.length; O++) c.__h.push(c._sb[O]);
183
+ if (c.context = b, c.props = d, c.__P = A, c.__e = !1, D = B.__r, S = 0, g) {
184
+ for (c.state = c.__s, c.__d = !1, D && D(t), u = c.render(c.props, c.state, c.context), O = 0; O < c._sb.length; O++) c.__h.push(c._sb[O]);
185
185
  c._sb = [];
186
186
  } else do
187
- c.__d = !1, C && C(t), u = c.render(c.props, c.state, c.context), c.state = c.__s;
188
- while (c.__d && ++P < 25);
187
+ c.__d = !1, D && D(t), u = c.render(c.props, c.state, c.context), c.state = c.__s;
188
+ while (c.__d && ++S < 25);
189
189
  c.state = c.__s, c.getChildContext != null && (n = tA(tA({}, n), c.getChildContext())), g && !m && c.getSnapshotBeforeUpdate != null && (y = c.getSnapshotBeforeUpdate(f, w)), L = u, u != null && u.type === $ && u.key == null && (L = ee(u.props.children)), l = $t(A, yA(L) ? L : [L], t, e, n, r, a, o, l, i, s), c.base = t.__e, t.__u &= -161, c.__h.length && o.push(c), v && (c.__E = c.__ = null);
190
- } catch (J) {
191
- if (t.__v = null, i || a != null) if (J.then) {
190
+ } catch (U) {
191
+ if (t.__v = null, i || a != null) if (U.then) {
192
192
  for (t.__u |= i ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
193
193
  a[a.indexOf(l)] = null, t.__e = l;
194
- } else for (k = a.length; k--; ) rt(a[k]);
194
+ } else for (P = a.length; P--; ) rt(a[P]);
195
195
  else t.__e = e.__e, t.__k = e.__k;
196
- B.__e(J, t, e);
196
+ B.__e(U, t, e);
197
197
  }
198
198
  else a == null && t.__v == e.__v ? (t.__k = e.__k, t.__e = e.__e) : l = t.__e = Ne(e.__e, t, e, n, r, a, o, i, s);
199
199
  return (u = B.diffed) && u(t), 128 & t.__u ? void 0 : l;
@@ -319,10 +319,10 @@ function p(A, t, e, n, r, a) {
319
319
  if (typeof A == "function" && (o = A.defaultProps)) for (l in o) i[l] === void 0 && (i[l] = o[l]);
320
320
  return B.vnode && B.vnode(s), s;
321
321
  }
322
- const st = "2.2.7", x = lt({});
323
- var cA, I, WA, wt, hA = 0, re = [], z = B, bt = z.__b, Ct = z.__r, Dt = z.diffed, Mt = z.__c, kt = z.unmount, Bt = z.__;
322
+ const st = "2.2.9", x = lt({});
323
+ var cA, I, WA, wt, hA = 0, re = [], G = B, bt = G.__b, Ct = G.__r, Dt = G.diffed, Mt = G.__c, kt = G.unmount, Bt = G.__;
324
324
  function _A(A, t) {
325
- z.__h && z.__h(I, A, hA || t), hA = 0;
325
+ G.__h && G.__h(I, A, hA || t), hA = 0;
326
326
  var e = I.__H || (I.__H = { __: [], __h: [] });
327
327
  return A >= e.__.length && e.__.push({}), e.__[A];
328
328
  }
@@ -365,7 +365,7 @@ function Ue(A, t, e) {
365
365
  }
366
366
  function V(A, t) {
367
367
  var e = _A(cA++, 3);
368
- !z.__s && oe(e.__H, t) && (e.__ = A, e.u = t, I.__H.__h.push(e));
368
+ !G.__s && oe(e.__H, t) && (e.__ = A, e.u = t, I.__H.__h.push(e));
369
369
  }
370
370
  function j(A) {
371
371
  return hA = 5, oA(function() {
@@ -381,7 +381,7 @@ function ae(A, t) {
381
381
  return A;
382
382
  }, t);
383
383
  }
384
- function U(A) {
384
+ function _(A) {
385
385
  var t = I.context[A.__c], e = _A(cA++, 9);
386
386
  return e.c = A, t ? (e.__ == null && (e.__ = !0, t.sub(I)), t.props.value) : A.__;
387
387
  }
@@ -389,26 +389,26 @@ function _e() {
389
389
  for (var A; A = re.shift(); ) if (A.__P && A.__H) try {
390
390
  A.__H.__h.forEach(QA), A.__H.__h.forEach(KA), A.__H.__h = [];
391
391
  } catch (t) {
392
- A.__H.__h = [], z.__e(t, A.__v);
392
+ A.__H.__h = [], G.__e(t, A.__v);
393
393
  }
394
394
  }
395
- z.__b = function(A) {
395
+ G.__b = function(A) {
396
396
  I = null, bt && bt(A);
397
- }, z.__ = function(A, t) {
397
+ }, G.__ = function(A, t) {
398
398
  A && t.__k && t.__k.__m && (A.__m = t.__k.__m), Bt && Bt(A, t);
399
- }, z.__r = function(A) {
399
+ }, G.__r = function(A) {
400
400
  Ct && Ct(A), cA = 0;
401
401
  var t = (I = A.__c).__H;
402
402
  t && (WA === I ? (t.__h = [], I.__h = [], t.__.forEach(function(e) {
403
403
  e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
404
404
  })) : (t.__h.forEach(QA), t.__h.forEach(KA), t.__h = [], cA = 0)), WA = I;
405
- }, z.diffed = function(A) {
405
+ }, G.diffed = function(A) {
406
406
  Dt && Dt(A);
407
407
  var t = A.__c;
408
- t && t.__H && (t.__H.__h.length && (re.push(t) !== 1 && wt === z.requestAnimationFrame || ((wt = z.requestAnimationFrame) || ze)(_e)), t.__H.__.forEach(function(e) {
408
+ t && t.__H && (t.__H.__h.length && (re.push(t) !== 1 && wt === G.requestAnimationFrame || ((wt = G.requestAnimationFrame) || ze)(_e)), t.__H.__.forEach(function(e) {
409
409
  e.u && (e.__H = e.u), e.u = void 0;
410
410
  })), WA = I = null;
411
- }, z.__c = function(A, t) {
411
+ }, G.__c = function(A, t) {
412
412
  t.some(function(e) {
413
413
  try {
414
414
  e.__h.forEach(QA), e.__h = e.__h.filter(function(n) {
@@ -417,10 +417,10 @@ z.__b = function(A) {
417
417
  } catch (n) {
418
418
  t.some(function(r) {
419
419
  r.__h && (r.__h = []);
420
- }), t = [], z.__e(n, e.__v);
420
+ }), t = [], G.__e(n, e.__v);
421
421
  }
422
422
  }), Mt && Mt(A, t);
423
- }, z.unmount = function(A) {
423
+ }, G.unmount = function(A) {
424
424
  kt && kt(A);
425
425
  var t, e = A.__c;
426
426
  e && e.__H && (e.__H.__.forEach(function(n) {
@@ -429,7 +429,7 @@ z.__b = function(A) {
429
429
  } catch (r) {
430
430
  t = r;
431
431
  }
432
- }), e.__H = void 0, t && z.__e(t, e.__v));
432
+ }), e.__H = void 0, t && G.__e(t, e.__v));
433
433
  };
434
434
  var St = typeof requestAnimationFrame == "function";
435
435
  function ze(A) {
@@ -455,7 +455,7 @@ function le(A, t) {
455
455
  return typeof t == "function" ? t(A) : t;
456
456
  }
457
457
  function Y() {
458
- const { language: A, translations: t } = U(x);
458
+ const { language: A, translations: t } = _(x);
459
459
  function e(n) {
460
460
  if (!t)
461
461
  return n;
@@ -558,7 +558,7 @@ function Ge() {
558
558
  );
559
559
  }
560
560
  const Ee = () => {
561
- const { t: A } = Y(), { isTestMode: t, show_footer: e } = U(x);
561
+ const { t: A } = Y(), { isTestMode: t, show_footer: e } = _(x);
562
562
  return /* @__PURE__ */ p("div", { className: "mt-2 flex w-full flex-col items-center justify-center gap-5 text-xs", children: [
563
563
  /* @__PURE__ */ p("a", { href: `https://moyasar.com/?ref=payment-form-v${st}`, children: e && /* @__PURE__ */ p(Ge, {}) }),
564
564
  t && /* @__PURE__ */ p("span", { class: "text-red-600", children: A("common.test_mode_disclaimer") })
@@ -738,7 +738,7 @@ const nA = (...A) => Ve(A), HA = (A) => {
738
738
  "busy",
739
739
  "fail",
740
740
  "success"
741
- ]), { isProcessing: u } = U(x), c = {
741
+ ]), { isProcessing: u } = _(x), c = {
742
742
  primary: "bg-primary text-white",
743
743
  stc: "bg-stc text-white",
744
744
  error: "bg-error text-white pointer-events-none",
@@ -749,7 +749,7 @@ const nA = (...A) => Ve(A), HA = (A) => {
749
749
  }
750
750
  return /* @__PURE__ */ p(
751
751
  "button",
752
- X(S({}, s), {
752
+ Q(k({}, s), {
753
753
  type: e,
754
754
  disabled: u || a,
755
755
  onClick: r,
@@ -854,10 +854,10 @@ const nA = (...A) => Ve(A), HA = (A) => {
854
854
  /* @__PURE__ */ p(Ke, { currency: A }),
855
855
  /* @__PURE__ */ p("span", { children: t })
856
856
  ] }), pA = (A) => {
857
- const i = A, { name: t, placeholder: e, type: n = "text", onBlur: r, disabled: a } = i, o = MA(i, ["name", "placeholder", "type", "onBlur", "disabled"]), { isProcessing: l } = U(x);
857
+ const i = A, { name: t, placeholder: e, type: n = "text", onBlur: r, disabled: a } = i, o = MA(i, ["name", "placeholder", "type", "onBlur", "disabled"]), { isProcessing: l } = _(x);
858
858
  return /* @__PURE__ */ p(
859
859
  "input",
860
- X(S({}, o), {
860
+ Q(k({}, o), {
861
861
  dir: "ltr",
862
862
  id: t,
863
863
  name: t,
@@ -1045,50 +1045,50 @@ function fA(A, t, e, n) {
1045
1045
  var w = typeof window != "undefined", y = !t && t !== 0 && w;
1046
1046
  if (typeof A != "function") throw new TypeError("Expected a function");
1047
1047
  t = +t || 0;
1048
- var v = !!(e = e || {}).leading, d = !("trailing" in e) || !!e.trailing, g = "maxWait" in e, D = "debounceOnServer" in e && !!e.debounceOnServer, b = g ? Math.max(+e.maxWait || 0, t) : null;
1048
+ var v = !!(e = e || {}).leading, d = !("trailing" in e) || !!e.trailing, g = "maxWait" in e, C = "debounceOnServer" in e && !!e.debounceOnServer, b = g ? Math.max(+e.maxWait || 0, t) : null;
1049
1049
  V(function() {
1050
1050
  return f.current = !0, function() {
1051
1051
  f.current = !1;
1052
1052
  };
1053
1053
  }, []);
1054
1054
  var h = oA(function() {
1055
- var C = function(_) {
1056
- var G = s.current, AA = u.current;
1057
- return s.current = u.current = null, o.current = _, l.current = l.current || _, c.current = m.current.apply(AA, G);
1058
- }, P = function(_, G) {
1059
- y && cancelAnimationFrame(i.current), i.current = y ? requestAnimationFrame(_) : setTimeout(_, G);
1060
- }, O = function(_) {
1055
+ var D = function(z) {
1056
+ var E = s.current, AA = u.current;
1057
+ return s.current = u.current = null, o.current = z, l.current = l.current || z, c.current = m.current.apply(AA, E);
1058
+ }, S = function(z, E) {
1059
+ y && cancelAnimationFrame(i.current), i.current = y ? requestAnimationFrame(z) : setTimeout(z, E);
1060
+ }, O = function(z) {
1061
1061
  if (!f.current) return !1;
1062
- var G = _ - a.current;
1063
- return !a.current || G >= t || G < 0 || g && _ - o.current >= b;
1064
- }, L = function(_) {
1065
- return i.current = null, d && s.current ? C(_) : (s.current = u.current = null, c.current);
1066
- }, k = function _() {
1067
- var G = Date.now();
1068
- if (v && l.current === o.current && Q(), O(G)) return L(G);
1062
+ var E = z - a.current;
1063
+ return !a.current || E >= t || E < 0 || g && z - o.current >= b;
1064
+ }, L = function(z) {
1065
+ return i.current = null, d && s.current ? D(z) : (s.current = u.current = null, c.current);
1066
+ }, P = function z() {
1067
+ var E = Date.now();
1068
+ if (v && l.current === o.current && X(), O(E)) return L(E);
1069
1069
  if (f.current) {
1070
- var AA = t - (G - a.current), lA = g ? Math.min(AA, b - (G - o.current)) : AA;
1071
- P(_, lA);
1070
+ var AA = t - (E - a.current), lA = g ? Math.min(AA, b - (E - o.current)) : AA;
1071
+ S(z, lA);
1072
1072
  }
1073
- }, Q = function() {
1074
- }, J = function() {
1075
- if (w || D) {
1076
- var _ = Date.now(), G = O(_);
1077
- if (s.current = [].slice.call(arguments), u.current = r, a.current = _, G) {
1078
- if (!i.current && f.current) return o.current = a.current, P(k, t), v ? C(a.current) : c.current;
1079
- if (g) return P(k, t), C(a.current);
1073
+ }, X = function() {
1074
+ }, U = function() {
1075
+ if (w || C) {
1076
+ var z = Date.now(), E = O(z);
1077
+ if (s.current = [].slice.call(arguments), u.current = r, a.current = z, E) {
1078
+ if (!i.current && f.current) return o.current = a.current, S(P, t), v ? D(a.current) : c.current;
1079
+ if (g) return S(P, t), D(a.current);
1080
1080
  }
1081
- return i.current || P(k, t), c.current;
1081
+ return i.current || S(P, t), c.current;
1082
1082
  }
1083
1083
  };
1084
- return J.cancel = function() {
1084
+ return U.cancel = function() {
1085
1085
  i.current && (y ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), o.current = 0, s.current = a.current = u.current = i.current = null;
1086
- }, J.isPending = function() {
1086
+ }, U.isPending = function() {
1087
1087
  return !!i.current;
1088
- }, J.flush = function() {
1088
+ }, U.flush = function() {
1089
1089
  return i.current ? L(Date.now()) : c.current;
1090
- }, J;
1091
- }, [v, g, t, b, d, y, w, D, n]);
1090
+ }, U;
1091
+ }, [v, g, t, b, d, y, w, C, n]);
1092
1092
  return h;
1093
1093
  }
1094
1094
  var ln = Object.defineProperty, sn = (A, t, e) => t in A ? ln(A, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : A[t] = e, vA = (A, t, e) => sn(A, typeof t != "symbol" ? t + "" : t, e);
@@ -1109,12 +1109,12 @@ const _t = {
1109
1109
  var n, r, a, o;
1110
1110
  const l = ((n = e.number) == null ? void 0 : n.unsigned) !== !0 && A.startsWith("-") ? "-" : "", i = (v = (r = e.number) == null ? void 0 : r.fraction) != null ? v : 0;
1111
1111
  let s = Gt(0, i, e);
1112
- const u = s.formatToParts(1000.12), c = (d = (a = u.find((D) => D.type === "group")) == null ? void 0 : a.value) != null ? d : " ", m = (g = (o = u.find((D) => D.type === "decimal")) == null ? void 0 : o.value) != null ? g : ".", f = zt(A, c, m);
1112
+ const u = s.formatToParts(1000.12), c = (d = (a = u.find((C) => C.type === "group")) == null ? void 0 : a.value) != null ? d : " ", m = (g = (o = u.find((C) => C.type === "decimal")) == null ? void 0 : o.value) != null ? g : ".", f = zt(A, c, m);
1113
1113
  if (Number.isNaN(parseFloat(f))) return l;
1114
1114
  const w = f.split(".");
1115
1115
  if (w[1] != null && w[1].length >= 1) {
1116
- const D = w[1].length <= i ? w[1].length : i;
1117
- s = Gt(D, i, e);
1116
+ const C = w[1].length <= i ? w[1].length : i;
1117
+ s = Gt(C, i, e);
1118
1118
  }
1119
1119
  let y = s.format(parseFloat(f));
1120
1120
  return t ? i > 0 && f.endsWith(".") && !f.slice(0, -1).includes(".") && (y += m) : y = zt(y, c, m), l + y;
@@ -1123,9 +1123,9 @@ class un {
1123
1123
  constructor(t = {}) {
1124
1124
  var n;
1125
1125
  vA(this, "opts", {}), vA(this, "memo", /* @__PURE__ */ new Map());
1126
- const e = S({}, t);
1126
+ const e = k({}, t);
1127
1127
  if (e.tokens != null) {
1128
- e.tokens = e.tokensReplace ? S({}, e.tokens) : S(S({}, _t), e.tokens);
1128
+ e.tokens = e.tokensReplace ? k({}, e.tokens) : k(k({}, _t), e.tokens);
1129
1129
  for (const r of Object.values(e.tokens))
1130
1130
  typeof r.pattern == "string" && (r.pattern = new RegExp(r.pattern));
1131
1131
  } else
@@ -1173,11 +1173,11 @@ class un {
1173
1173
  if (e == null) return t;
1174
1174
  const r = `v=${t},mr=${e},m=${n ? 1 : 0}`;
1175
1175
  if (this.memo.has(r)) return this.memo.get(r);
1176
- const { mask: a, escaped: o } = this.escapeMask(e), l = [], i = this.opts.tokens != null ? this.opts.tokens : {}, s = this.isReversed() ? -1 : 1, u = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : a.length - 1, m = this.isReversed() ? () => v > -1 && d > -1 : () => v < a.length && d < t.length, f = (D) => !this.isReversed() && D <= c || this.isReversed() && D >= c;
1176
+ const { mask: a, escaped: o } = this.escapeMask(e), l = [], i = this.opts.tokens != null ? this.opts.tokens : {}, s = this.isReversed() ? -1 : 1, u = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : a.length - 1, m = this.isReversed() ? () => v > -1 && d > -1 : () => v < a.length && d < t.length, f = (C) => !this.isReversed() && C <= c || this.isReversed() && C >= c;
1177
1177
  let w, y = -1, v = this.isReversed() ? a.length - 1 : 0, d = this.isReversed() ? t.length - 1 : 0, g = !1;
1178
1178
  for (; m(); ) {
1179
- const D = a.charAt(v), b = i[D], h = (b == null ? void 0 : b.transform) != null ? b.transform(t.charAt(d)) : t.charAt(d);
1180
- if (!o.includes(v) && b != null ? (h.match(b.pattern) != null ? (l[u](h), b.repeated ? (y === -1 ? y = v : v === c && v !== y && (v = y - s), c === y && (v -= s)) : b.multiple && (g = !0, v -= s), v += s) : b.multiple ? g && (v += s, d -= s, g = !1) : h === w ? w = void 0 : b.optional && (v += s, d -= s), d += s) : (n && !this.isEager() && l[u](D), h === D && !this.isEager() ? d += s : w = D, this.isEager() || (v += s)), this.isEager())
1179
+ const C = a.charAt(v), b = i[C], h = (b == null ? void 0 : b.transform) != null ? b.transform(t.charAt(d)) : t.charAt(d);
1180
+ if (!o.includes(v) && b != null ? (h.match(b.pattern) != null ? (l[u](h), b.repeated ? (y === -1 ? y = v : v === c && v !== y && (v = y - s), c === y && (v -= s)) : b.multiple && (g = !0, v -= s), v += s) : b.multiple ? g && (v += s, d -= s, g = !1) : h === w ? w = void 0 : b.optional && (v += s, d -= s), d += s) : (n && !this.isEager() && l[u](C), h === C && !this.isEager() ? d += s : w = C, this.isEager() || (v += s)), this.isEager())
1181
1181
  for (; f(v) && (i[a.charAt(v)] == null || o.includes(v)); ) {
1182
1182
  if (n) {
1183
1183
  if (l[u](a.charAt(v)), t.charAt(d) === a.charAt(v)) {
@@ -1192,7 +1192,7 @@ class un {
1192
1192
  }
1193
1193
  }
1194
1194
  const fe = (A) => JSON.parse(A.replaceAll("'", '"')), pn = (A, t = {}) => {
1195
- const e = S({}, t);
1195
+ const e = k({}, t);
1196
1196
  A.dataset.maska != null && A.dataset.maska !== "" && (e.mask = fn(A.dataset.maska)), A.dataset.maskaEager != null && (e.eager = SA(A.dataset.maskaEager)), A.dataset.maskaReversed != null && (e.reversed = SA(A.dataset.maskaReversed)), A.dataset.maskaTokensReplace != null && (e.tokensReplace = SA(A.dataset.maskaTokensReplace)), A.dataset.maskaTokens != null && (e.tokens = dn(A.dataset.maskaTokens));
1197
1197
  const n = {};
1198
1198
  return A.dataset.maskaNumberLocale != null && (n.locale = A.dataset.maskaNumberLocale), A.dataset.maskaNumberFraction != null && (n.fraction = parseInt(A.dataset.maskaNumberFraction)), A.dataset.maskaNumberUnsigned != null && (n.unsigned = SA(A.dataset.maskaNumberUnsigned)), (A.dataset.maskaNumber != null || Object.values(n).length > 0) && (e.number = n), e;
@@ -1222,7 +1222,7 @@ class zA {
1222
1222
  }), this.options = e, this.eventAbortController = new AbortController(), this.init(this.getInputs(t));
1223
1223
  }
1224
1224
  update(t = {}) {
1225
- this.options = S({}, t), this.init(Array.from(this.items.keys()));
1225
+ this.options = k({}, t), this.init(Array.from(this.items.keys()));
1226
1226
  }
1227
1227
  updateValue(t) {
1228
1228
  var e;
@@ -1276,7 +1276,7 @@ class zA {
1276
1276
  }
1277
1277
  }
1278
1278
  const mn = ({ showOtp: A, value: t, setValue: e }) => {
1279
- const { t: n } = Y(), { handleBlur: r, err: a } = U(it), o = "### ### ####", l = (s) => {
1279
+ const { t: n } = Y(), { handleBlur: r, err: a } = _(it), o = "### ### ####", l = (s) => {
1280
1280
  const u = s.target, { value: c } = u;
1281
1281
  e(c);
1282
1282
  }, i = fA(r, 1e3);
@@ -1307,7 +1307,7 @@ const mn = ({ showOtp: A, value: t, setValue: e }) => {
1307
1307
  }
1308
1308
  );
1309
1309
  }, vn = ({ showPhone: A, value: t, setValue: e }) => {
1310
- const { t: n } = Y(), { handleBlur: r, err: a } = U(it), o = (i) => {
1310
+ const { t: n } = Y(), { handleBlur: r, err: a } = _(it), o = (i) => {
1311
1311
  const s = i.target, { value: u } = s;
1312
1312
  e(u);
1313
1313
  }, l = fA(r, 1e3);
@@ -1379,8 +1379,8 @@ const yn = () => {
1379
1379
  splits: f,
1380
1380
  on_failure: w,
1381
1381
  setFormSettings: y
1382
- } = U(x), v = (h) => {
1383
- y && (e(h), y((C) => X(S({}, C), {
1382
+ } = _(x), v = (h) => {
1383
+ y && (e(h), y((D) => Q(k({}, D), {
1384
1384
  isProcessing: h
1385
1385
  })));
1386
1386
  }, d = {
@@ -1391,66 +1391,66 @@ const yn = () => {
1391
1391
  };
1392
1392
  n && (d.given_id = n), i && Object.keys(i).length > 0 && (d.metadata = i), s && (d.invoice_id = s.toLowerCase()), m !== void 0 && (d.apply_coupon = m), f && (d.splits = f);
1393
1393
  const g = (h) => K(void 0, null, function* () {
1394
- if (y && (y((C) => X(S({}, C), {
1394
+ if (y && (y((D) => Q(k({}, D), {
1395
1395
  apiError: `${A("error." + h.type)}, ${h.message}`
1396
1396
  })), w))
1397
1397
  try {
1398
1398
  yield w(h);
1399
- } catch (C) {
1400
- console.error("An error happened when firing failure callback"), console.error(C);
1399
+ } catch (D) {
1400
+ console.error("An error happened when firing failure callback"), console.error(D);
1401
1401
  }
1402
- }), D = () => {
1403
- y && y((h) => X(S({}, h), { apiError: "" }));
1402
+ }), C = () => {
1403
+ y && y((h) => Q(k({}, h), { apiError: "" }));
1404
1404
  };
1405
1405
  return {
1406
1406
  processing: t,
1407
1407
  postData: (O) => K(void 0, [O], function* ({
1408
1408
  updatedPaymentConfig: h,
1409
- data: C,
1410
- path: P
1409
+ data: D,
1410
+ path: S
1411
1411
  }) {
1412
- v(!0), D();
1413
- const L = P || `${c}/v1/payments`;
1412
+ v(!0), C();
1413
+ const L = S || `${c}/v1/payments`;
1414
1414
  try {
1415
- const k = yield fetch(L, {
1415
+ const P = yield fetch(L, {
1416
1416
  method: "POST",
1417
1417
  headers: {
1418
1418
  "Content-Type": "application/json",
1419
1419
  "X-Moyasar-Form-Version": u
1420
1420
  },
1421
- body: JSON.stringify(S(S(S({}, d), C), h))
1421
+ body: JSON.stringify(k(k(k({}, d), D), h))
1422
1422
  });
1423
- if (!k.ok) {
1424
- if (typeof k == "object") {
1425
- const Q = yield k.json();
1426
- if (console.error("fetch error:", Q), !de(Q)) {
1423
+ if (!P.ok) {
1424
+ if (typeof P == "object") {
1425
+ const X = yield P.json();
1426
+ if (console.error("fetch error:", X), !de(X)) {
1427
1427
  yield g({
1428
1428
  type: "api_error",
1429
- message: `Error code: ${k.status}`,
1429
+ message: `Error code: ${P.status}`,
1430
1430
  errors: null
1431
1431
  });
1432
1432
  return;
1433
1433
  }
1434
- return yield g(Q), Q;
1434
+ return yield g(X), X;
1435
1435
  }
1436
- return yield Promise.reject(k);
1436
+ return yield Promise.reject(P);
1437
1437
  }
1438
- return yield k.json();
1439
- } catch (k) {
1438
+ return yield P.json();
1439
+ } catch (P) {
1440
1440
  if (w)
1441
1441
  try {
1442
- yield w(k);
1443
- } catch (Q) {
1444
- console.error("An error happened when firing failure callback"), console.error(Q);
1442
+ yield w(P);
1443
+ } catch (X) {
1444
+ console.error("An error happened when firing failure callback"), console.error(X);
1445
1445
  }
1446
- console.error(k);
1446
+ console.error(P);
1447
1447
  } finally {
1448
1448
  v(!1);
1449
1449
  }
1450
1450
  })
1451
1451
  };
1452
1452
  }, wn = () => {
1453
- const { apiError: A } = U(x), [t, e] = N(!1);
1453
+ const { apiError: A } = _(x), [t, e] = N(!1);
1454
1454
  return V(() => {
1455
1455
  e(!!A);
1456
1456
  }, [A]), V(() => {
@@ -1492,7 +1492,7 @@ const yn = () => {
1492
1492
  if (typeof a == "boolean")
1493
1493
  return a;
1494
1494
  if (typeof a == "object")
1495
- return r(a), a;
1495
+ return r(a), e && a !== null && Object.keys(a).length > 0 && e((o) => k(k({}, o), a)), a;
1496
1496
  throw new Error(`Invalid on_initiating handler result: ${a}`);
1497
1497
  }), Et = (A, t, e) => K(void 0, null, function* () {
1498
1498
  var r;
@@ -1514,28 +1514,28 @@ const yn = () => {
1514
1514
  }), wA = ({
1515
1515
  defaultError: A
1516
1516
  }) => {
1517
- const { callback_url: t, on_initiating: e, on_redirect: n, on_completed: r, setFormSettings: a } = U(x), [o, l] = N(A), { processing: i, postData: s } = yn(), [u, c] = N(!1), [m, f] = N(!1), { fail: w } = wn();
1517
+ const { callback_url: t, on_initiating: e, on_redirect: n, on_completed: r, setFormSettings: a } = _(x), [o, l] = N(A), { processing: i, postData: s } = yn(), [u, c] = N(!1), [m, f] = N(!1), { fail: w } = wn();
1518
1518
  function y(O, L) {
1519
- return K(this, arguments, function* ({ data: g, path: D, onSuccess: b, onFailed: h, initPayment: C }, P) {
1520
- const k = yield s({
1521
- updatedPaymentConfig: P,
1519
+ return K(this, arguments, function* ({ data: g, path: C, onSuccess: b, onFailed: h, initPayment: D }, S) {
1520
+ const P = yield s({
1521
+ updatedPaymentConfig: S,
1522
1522
  data: g,
1523
- path: D
1524
- });
1525
- if (de(k)) {
1523
+ path: C
1524
+ }), X = typeof S == "object" && S !== null && "callback_url" in S && typeof S.callback_url == "string" ? S.callback_url : t;
1525
+ if (de(P)) {
1526
1526
  c(!1);
1527
1527
  return;
1528
1528
  }
1529
- k && (r && C && (yield Cn({
1530
- payment: k,
1529
+ P && (r && D && (yield Cn({
1530
+ payment: P,
1531
1531
  on_completed: r
1532
- }).catch((Q) => {
1533
- console.error(Q);
1534
- })), b && k.status !== "failed" && b(k), ["paid", "authorized"].includes(k.status) && (f(!0), setTimeout(() => {
1535
- Et(t, k, n).catch(() => {
1532
+ }).catch((U) => {
1533
+ console.error(U);
1534
+ })), b && P.status !== "failed" && b(P), ["paid", "authorized"].includes(P.status) && (f(!0), setTimeout(() => {
1535
+ Et(X, P, n).catch(() => {
1536
1536
  });
1537
- }, 100)), k.status === "failed" && (h && h(k), setTimeout(() => {
1538
- Et(t, k, n).catch(() => {
1537
+ }, 100)), P.status === "failed" && (h && h(P), setTimeout(() => {
1538
+ Et(X, P, n).catch(() => {
1539
1539
  });
1540
1540
  }, 100))), c(!1);
1541
1541
  });
@@ -1543,14 +1543,14 @@ const yn = () => {
1543
1543
  function v(g) {
1544
1544
  return K(this, null, function* () {
1545
1545
  if (c(!0), g.initPayment) {
1546
- let D = g.data.source;
1546
+ let C = g.data.source;
1547
1547
  try {
1548
- (D == null ? void 0 : D.type) === "creditcard" && typeof D.number == "string" && (D = {
1548
+ (C == null ? void 0 : C.type) === "creditcard" && typeof C.number == "string" && (C = {
1549
1549
  type: "creditcard",
1550
- bin: D.number.substring(0, 8)
1550
+ bin: C.number.substring(0, 8)
1551
1551
  });
1552
1552
  const b = yield bn({
1553
- source: D,
1553
+ source: C,
1554
1554
  on_initiating: e,
1555
1555
  setFormSettings: a
1556
1556
  });
@@ -1580,10 +1580,10 @@ const yn = () => {
1580
1580
  setError: l
1581
1581
  };
1582
1582
  }, me = ({ inForm: A = !1 }) => {
1583
- const { apiError: t, showForm: e } = U(x);
1583
+ const { apiError: t, showForm: e } = _(x);
1584
1584
  return e && !A ? null : /* @__PURE__ */ p("p", { class: "flex flex-col gap-2 rounded-md border border-error bg-red-100 px-4 py-2 text-xs font-medium text-error empty:hidden", children: t });
1585
1585
  }, Dn = () => {
1586
- const { t: A } = Y(), { formattedAmount: t, currency: e, isRtl: n, fixed_width: r, setFormSettings: a, showForm: o } = U(x), [l, i] = N(null), [s, u] = N(!1), c = {
1586
+ const { t: A } = Y(), { formattedAmount: t, currency: e, isRtl: n, fixed_width: r, setFormSettings: a, showForm: o } = _(x), [l, i] = N(null), [s, u] = N(!1), c = {
1587
1587
  phone: "",
1588
1588
  otp: ""
1589
1589
  }, {
@@ -1594,26 +1594,26 @@ const yn = () => {
1594
1594
  loading: v,
1595
1595
  error: d,
1596
1596
  setError: g
1597
- } = wA({ defaultError: c }), [D, b] = N(""), [h, C] = N(""), [P, O] = N(""), L = (E) => {
1598
- const T = /^05[503649187][0-9]{7}$/.test(q(E));
1599
- return g((Z) => X(S({}, Z), {
1597
+ } = wA({ defaultError: c }), [C, b] = N(""), [h, D] = N(""), [S, O] = N(""), L = (J) => {
1598
+ const T = /^05[503649187][0-9]{7}$/.test(q(J));
1599
+ return g((Z) => Q(k({}, Z), {
1600
1600
  phone: T ? "" : "error.invalid_mobile"
1601
1601
  })), T;
1602
- }, k = (E) => {
1603
- const T = /^[0-9]{4,}$/.test(q(E));
1604
- return g((Z) => X(S({}, Z), {
1602
+ }, P = (J) => {
1603
+ const T = /^[0-9]{4,}$/.test(q(J));
1604
+ return g((Z) => Q(k({}, Z), {
1605
1605
  otp: T ? "" : "error.invalid_otp"
1606
1606
  })), T;
1607
- }, Q = (E) => {
1608
- const { value: T, name: Z } = E.target, eA = T.trim();
1607
+ }, X = (J) => {
1608
+ const { value: T, name: Z } = J.target, eA = T.trim();
1609
1609
  if (u(!1), !eA) {
1610
1610
  u(!eA);
1611
1611
  return;
1612
1612
  }
1613
- Z === "mysr-stc-mobile" && L(eA), Z === "mysr-stc-otp" && k(eA);
1614
- }, J = () => {
1615
- if (!L(D)) return;
1616
- function E(T) {
1613
+ Z === "mysr-stc-mobile" && L(eA), Z === "mysr-stc-otp" && P(eA);
1614
+ }, U = () => {
1615
+ if (!L(C)) return;
1616
+ function J(T) {
1617
1617
  const { transaction_url: Z } = T.source;
1618
1618
  O(Z), i((/* @__PURE__ */ new Date()).getTime() + 5 * 60 * 1e3);
1619
1619
  }
@@ -1621,45 +1621,45 @@ const yn = () => {
1621
1621
  data: {
1622
1622
  source: {
1623
1623
  type: "stcpay",
1624
- mobile: q(D)
1624
+ mobile: q(C)
1625
1625
  }
1626
1626
  },
1627
- onSuccess: E,
1627
+ onSuccess: J,
1628
1628
  initPayment: !0
1629
1629
  }).catch((T) => {
1630
1630
  console.error(T);
1631
1631
  });
1632
- }, _ = () => {
1633
- if (!l || !k(h)) return;
1634
- function E(T) {
1632
+ }, z = () => {
1633
+ if (!l || !P(h)) return;
1634
+ function J(T) {
1635
1635
  var Z;
1636
- T.status === "failed" && ((Z = T.source) == null ? void 0 : Z.message) === "Invalid OTP" && (g((eA) => X(S({}, eA), {
1636
+ T.status === "failed" && ((Z = T.source) == null ? void 0 : Z.message) === "Invalid OTP" && (g((eA) => Q(k({}, eA), {
1637
1637
  otp: "error.invalid_otp"
1638
- })), C(""), i(null));
1638
+ })), D(""), i(null));
1639
1639
  }
1640
1640
  m({
1641
1641
  data: {
1642
1642
  otp_value: q(h)
1643
1643
  },
1644
- path: P,
1645
- onFailed: E
1644
+ path: S,
1645
+ onFailed: J
1646
1646
  }).catch((T) => {
1647
1647
  console.error(T);
1648
1648
  });
1649
- }, G = (E) => {
1650
- if (E.preventDefault(), g(c), !l) {
1651
- J();
1649
+ }, E = (J) => {
1650
+ if (J.preventDefault(), g(c), !l) {
1651
+ U();
1652
1652
  return;
1653
1653
  }
1654
- _();
1655
- }, AA = (E) => {
1656
- E > 0 || (g((T) => X(S({}, T), {
1654
+ z();
1655
+ }, AA = (J) => {
1656
+ J > 0 || (g((T) => Q(k({}, T), {
1657
1657
  otp: "error.otp_time_out"
1658
- })), C(""), i(null));
1659
- }, lA = oA(() => d.phone || l && d.otp && d.otp !== "error.otp_time_out" ? !0 : s || v, [d, s, v]), dA = (E) => a((T) => X(S({}, T), { showForm: E })), [sA, mA] = N(!1), CA = () => {
1658
+ })), D(""), i(null));
1659
+ }, lA = oA(() => d.phone || l && d.otp && d.otp !== "error.otp_time_out" ? !0 : s || v, [d, s, v]), dA = (J) => a((T) => Q(k({}, T), { showForm: J })), [sA, mA] = N(!1), CA = () => {
1660
1660
  mA(!0);
1661
1661
  }, JA = () => {
1662
- sA && (b(""), C(""), g(c), dA(!1), mA(!1), u(!1));
1662
+ sA && (b(""), D(""), g(c), dA(!1), mA(!1), u(!1));
1663
1663
  };
1664
1664
  return /* @__PURE__ */ p(
1665
1665
  it.Provider,
@@ -1667,7 +1667,7 @@ const yn = () => {
1667
1667
  value: {
1668
1668
  err: d,
1669
1669
  setErr: g,
1670
- handleBlur: Q
1670
+ handleBlur: X
1671
1671
  },
1672
1672
  children: /* @__PURE__ */ p($, { children: [
1673
1673
  /* @__PURE__ */ p(HA, { variant: "stc", onClick: () => dA(!0), children: /* @__PURE__ */ p(
@@ -1705,7 +1705,7 @@ const yn = () => {
1705
1705
  /* @__PURE__ */ p("img", { alt: "", src: hn, class: "h-5" }),
1706
1706
  /* @__PURE__ */ p("button", { onClick: CA, class: "ms-auto", children: "Cancel" })
1707
1707
  ] }),
1708
- /* @__PURE__ */ p("form", { class: "flex flex-col gap-4", onSubmit: G, children: [
1708
+ /* @__PURE__ */ p("form", { class: "flex flex-col gap-4", onSubmit: E, children: [
1709
1709
  /* @__PURE__ */ p("div", { class: "space-y-2", children: [
1710
1710
  /* @__PURE__ */ p("div", { class: "flex items-end justify-between text-xs font-medium", children: [
1711
1711
  l ? /* @__PURE__ */ p("label", { for: "mysr-stc-mobile", children: A("form.otp") }) : /* @__PURE__ */ p("label", { for: "mysr-stc-otp", children: A("form.mobile") }),
@@ -1714,7 +1714,7 @@ const yn = () => {
1714
1714
  /* @__PURE__ */ p(
1715
1715
  mn,
1716
1716
  {
1717
- value: D,
1717
+ value: C,
1718
1718
  setValue: b,
1719
1719
  showOtp: !l && typeof l != "number"
1720
1720
  }
@@ -1723,7 +1723,7 @@ const yn = () => {
1723
1723
  vn,
1724
1724
  {
1725
1725
  value: h,
1726
- setValue: C,
1726
+ setValue: D,
1727
1727
  showPhone: !l && typeof l != "number"
1728
1728
  }
1729
1729
  )
@@ -1746,7 +1746,7 @@ const yn = () => {
1746
1746
  }
1747
1747
  )
1748
1748
  ] }),
1749
- /* @__PURE__ */ p("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(d).map(([E, T]) => /* @__PURE__ */ p("span", { class: "empty:hidden", children: A(T) }, E)) })
1749
+ /* @__PURE__ */ p("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(d).map(([J, T]) => /* @__PURE__ */ p("span", { class: "empty:hidden", children: A(T) }, J)) })
1750
1750
  ]
1751
1751
  }
1752
1752
  ) })
@@ -1766,7 +1766,7 @@ const yn = () => {
1766
1766
  statement_descriptor: i,
1767
1767
  setFormSettings: s,
1768
1768
  on_failure: u
1769
- } = U(x), { makePayment: c } = wA({ defaultError: {} });
1769
+ } = _(x), { makePayment: c } = wA({ defaultError: {} });
1770
1770
  function m() {
1771
1771
  if (!ApplePaySession)
1772
1772
  return;
@@ -1788,8 +1788,8 @@ const yn = () => {
1788
1788
  display_name: f,
1789
1789
  domain_name: window.location.hostname,
1790
1790
  publishable_api_key: e
1791
- }, D = n.validate_merchant_url || `${t}/v1/applepay/initiate`;
1792
- fetch(D, {
1791
+ }, C = n.validate_merchant_url || `${t}/v1/applepay/initiate`;
1792
+ fetch(C, {
1793
1793
  method: "POST",
1794
1794
  headers: {
1795
1795
  "Content-Type": "application/json"
@@ -1798,7 +1798,7 @@ const yn = () => {
1798
1798
  }).then((b) => b.ok ? b : Promise.reject(b)).then((b) => b.json()).then((b) => {
1799
1799
  v.completeMerchantValidation(b);
1800
1800
  }).catch((b) => {
1801
- if (console.error("Apple Pay error:", b), s((h) => X(S({}, h), {
1801
+ if (console.error("Apple Pay error:", b), s((h) => Q(k({}, h), {
1802
1802
  apiError: A("error.applePay")
1803
1803
  })), u)
1804
1804
  try {
@@ -1818,7 +1818,7 @@ const yn = () => {
1818
1818
  }
1819
1819
  };
1820
1820
  i && (g.source.statement_descriptor = i);
1821
- function D(h) {
1821
+ function C(h) {
1822
1822
  v.completePayment({
1823
1823
  status: ApplePaySession.STATUS_FAILURE
1824
1824
  });
@@ -1830,7 +1830,7 @@ const yn = () => {
1830
1830
  }
1831
1831
  c({
1832
1832
  data: g,
1833
- onFailed: D,
1833
+ onFailed: C,
1834
1834
  onSuccess: b,
1835
1835
  initPayment: !0
1836
1836
  }).catch((h) => {
@@ -1849,7 +1849,7 @@ const yn = () => {
1849
1849
  supported_networks: n,
1850
1850
  currency: r,
1851
1851
  decimalAmount: a
1852
- } = U(x), [o, l] = N(!1), [i, s] = N(!1), { makePayment: u } = wA({ defaultError: {} }), { t: c } = Y(), m = j(null);
1852
+ } = _(x), [o, l] = N(!1), [i, s] = N(!1), { makePayment: u } = wA({ defaultError: {} }), { t: c } = Y(), m = j(null);
1853
1853
  V(() => {
1854
1854
  let y = null;
1855
1855
  return o || (y = setInterval(() => {
@@ -1865,19 +1865,19 @@ const yn = () => {
1865
1865
  if (V(() => K(void 0, null, function* () {
1866
1866
  if (!f || !t)
1867
1867
  return;
1868
- const y = n == null ? void 0 : n.map((d) => d.toLowerCase()), v = {
1868
+ const y = ["visa", "mastercard", "amex", "mada"], v = n == null ? void 0 : n.filter((g) => y.includes(g.toLowerCase())).map((g) => g.toLowerCase()), d = {
1869
1869
  version: t.version.toString(),
1870
1870
  serviceId: t.service_id,
1871
1871
  protocol: "PROTOCOL_3DS",
1872
- allowedBrands: y
1872
+ allowedBrands: v
1873
1873
  };
1874
1874
  m.current = () => K(void 0, null, function* () {
1875
- const { order_number: d, id: g, country: D, label: b } = t, h = b || (e == null ? void 0 : e.label), C = D || (e == null ? void 0 : e.country), P = {
1876
- orderNumber: d,
1875
+ const { order_number: g, id: C, country: b, label: h } = t, D = h || (e == null ? void 0 : e.label), S = b || (e == null ? void 0 : e.country), O = {
1876
+ orderNumber: g,
1877
1877
  merchant: {
1878
- name: h,
1879
- id: g,
1880
- countryCode: C,
1878
+ name: D,
1879
+ id: C,
1880
+ countryCode: S,
1881
1881
  url: window.location.hostname
1882
1882
  },
1883
1883
  amount: {
@@ -1885,57 +1885,57 @@ const yn = () => {
1885
1885
  currency: r,
1886
1886
  total: a
1887
1887
  }
1888
- }, O = () => {
1888
+ }, L = () => {
1889
1889
  f.notify({
1890
1890
  status: "CHARGED",
1891
1891
  provider: "Moyasar"
1892
1892
  });
1893
- }, L = (k) => {
1893
+ }, P = (X) => {
1894
1894
  f.notify({
1895
1895
  status: "REJECTED",
1896
1896
  provider: "Moyasar"
1897
1897
  });
1898
1898
  };
1899
1899
  try {
1900
- const k = yield f.loadPaymentSheet(
1901
- v,
1902
- P
1900
+ const X = yield f.loadPaymentSheet(
1901
+ d,
1902
+ O
1903
1903
  );
1904
1904
  yield u({
1905
1905
  initPayment: !0,
1906
1906
  data: {
1907
1907
  source: {
1908
1908
  type: "samsungpay",
1909
- token: k["3DS"].data,
1909
+ token: X["3DS"].data,
1910
1910
  manual: !!(t != null && t.manual),
1911
1911
  save_card: !!(t != null && t.save_card)
1912
1912
  }
1913
1913
  },
1914
- onFailed: L,
1915
- onSuccess: O
1914
+ onFailed: P,
1915
+ onSuccess: L
1916
1916
  });
1917
- } catch (k) {
1917
+ } catch (X) {
1918
1918
  try {
1919
1919
  f.notify({
1920
1920
  status: "ERRED",
1921
1921
  provider: "Moyasar"
1922
1922
  });
1923
- } catch (Q) {
1923
+ } catch (U) {
1924
1924
  }
1925
- console.error("Samsung Pay error: ", k);
1925
+ console.error("Samsung Pay error: ", X);
1926
1926
  }
1927
1927
  });
1928
1928
  try {
1929
- (yield f.isReadyToPay(v)).result ? s(!0) : console.error("Cannot initialize Samsung Pay");
1930
- } catch (d) {
1929
+ (yield f.isReadyToPay(d)).result ? s(!0) : console.error("Cannot initialize Samsung Pay");
1930
+ } catch (g) {
1931
1931
  try {
1932
1932
  f.notify({
1933
1933
  status: "ERRED",
1934
1934
  provider: "Moyasar"
1935
1935
  });
1936
- } catch (g) {
1936
+ } catch (C) {
1937
1937
  }
1938
- console.error("Samsung Pay Error: ", d);
1938
+ console.error("Samsung Pay Error: ", g);
1939
1939
  }
1940
1940
  }), [f, t]), !o || !i)
1941
1941
  return null;
@@ -1962,7 +1962,7 @@ const yn = () => {
1962
1962
  currency: a,
1963
1963
  decimalAmount: o,
1964
1964
  setFormSettings: l
1965
- } = U(x), [i, s] = N(!1), { makePayment: u } = wA({ defaultError: {} });
1965
+ } = _(x), [i, s] = N(!1), { makePayment: u } = wA({ defaultError: {} });
1966
1966
  V(() => {
1967
1967
  let m = null;
1968
1968
  return i || (m = setInterval(() => {
@@ -1983,7 +1983,7 @@ const yn = () => {
1983
1983
  if (!c || !e || (m == null ? void 0 : m.children.length) >= 1)
1984
1984
  return;
1985
1985
  e.merchant_id;
1986
- const f = r == null ? void 0 : r.filter((C) => C !== "mada").map((C) => C.toUpperCase()), w = e.auth_methods, y = {
1986
+ const f = r == null ? void 0 : r.filter((D) => D !== "mada").map((D) => D.toUpperCase()), w = e.auth_methods, y = {
1987
1987
  apiVersion: 2,
1988
1988
  apiVersionMinor: 0
1989
1989
  }, v = {
@@ -1995,35 +1995,35 @@ const yn = () => {
1995
1995
  }, d = Object.assign({}, y);
1996
1996
  d.allowedPaymentMethods = [v];
1997
1997
  const g = () => K(void 0, null, function* () {
1998
- const { country: C, label: P, merchant_id: O } = e, L = P || (n == null ? void 0 : n.label), k = C || (n == null ? void 0 : n.country), Q = X(S({}, y), {
1998
+ const { country: D, label: S, merchant_id: O } = e, L = S || (n == null ? void 0 : n.label), P = D || (n == null ? void 0 : n.country), X = Q(k({}, y), {
1999
1999
  allowedPaymentMethods: [h],
2000
2000
  merchantInfo: {
2001
2001
  merchantId: O,
2002
2002
  merchantName: L
2003
2003
  },
2004
2004
  transactionInfo: {
2005
- countryCode: k,
2005
+ countryCode: P,
2006
2006
  currencyCode: a,
2007
2007
  totalPriceStatus: "FINAL",
2008
2008
  totalPrice: o
2009
2009
  }
2010
2010
  });
2011
2011
  try {
2012
- const J = yield c.loadPaymentData(Q);
2012
+ const U = yield c.loadPaymentData(X);
2013
2013
  u({
2014
2014
  initPayment: !0,
2015
2015
  data: {
2016
2016
  source: {
2017
2017
  type: "googlepay",
2018
- token: J.paymentMethodData.tokenizationData.token
2018
+ token: U.paymentMethodData.tokenizationData.token
2019
2019
  }
2020
2020
  }
2021
2021
  });
2022
- } catch (J) {
2023
- console.error(J);
2022
+ } catch (U) {
2023
+ console.error(U);
2024
2024
  }
2025
- }), D = () => {
2026
- const C = c.createButton({
2025
+ }), C = () => {
2026
+ const D = c.createButton({
2027
2027
  onClick: g,
2028
2028
  buttonLocale: A,
2029
2029
  buttonColor: "black",
@@ -2031,7 +2031,7 @@ const yn = () => {
2031
2031
  buttonRadius: 6,
2032
2032
  buttonSizeMode: "fill"
2033
2033
  });
2034
- m.appendChild(C);
2034
+ m.appendChild(D);
2035
2035
  }, b = {
2036
2036
  type: "PAYMENT_GATEWAY",
2037
2037
  parameters: {
@@ -2042,13 +2042,13 @@ const yn = () => {
2042
2042
  tokenizationSpecification: b
2043
2043
  });
2044
2044
  try {
2045
- (yield c.isReadyToPay(d)).result ? D() : l((P) => X(S({}, P), {
2045
+ (yield c.isReadyToPay(d)).result ? C() : l((S) => Q(k({}, S), {
2046
2046
  apiError: "Cannot initialize Google Pay"
2047
2047
  }));
2048
- } catch (C) {
2049
- l((P) => X(S({}, P), {
2048
+ } catch (D) {
2049
+ l((S) => Q(k({}, S), {
2050
2050
  apiError: "Cannot initialize Google Pay"
2051
- })), console.error("Google Pay Error: ", C);
2051
+ })), console.error("Google Pay Error: ", D);
2052
2052
  }
2053
2053
  }), [c, e]), i ? /* @__PURE__ */ p(
2054
2054
  "div",
@@ -2058,7 +2058,7 @@ const yn = () => {
2058
2058
  }
2059
2059
  ) : null;
2060
2060
  }, Pn = () => {
2061
- const { t: A } = Y(), { methods: t, apple_pay: e, samsung_pay: n, google_pay: r } = U(x), a = t.includes("stcpay"), o = t.includes("creditcard"), l = location.protocol === "https:" && t.includes("applepay") && typeof window.ApplePaySession != "undefined" && ApplePaySession.canMakePayments() && (e == null ? void 0 : e.version) && ApplePaySession.supportsVersion(e == null ? void 0 : e.version), i = !!(n != null && n.service_id), s = !!(r != null && r.merchant_id);
2061
+ const { t: A } = Y(), { methods: t, apple_pay: e, samsung_pay: n, google_pay: r } = _(x), a = t.includes("stcpay"), o = t.includes("creditcard"), l = location.protocol === "https:" && t.includes("applepay") && typeof window.ApplePaySession != "undefined" && ApplePaySession.canMakePayments() && (e == null ? void 0 : e.version) && ApplePaySession.supportsVersion(e == null ? void 0 : e.version), i = !!(n != null && n.service_id), s = !!(r != null && r.merchant_id);
2062
2062
  return !l && !a && !i && !s ? null : /* @__PURE__ */ p("div", { class: "flex w-full flex-col gap-4", role: "main", children: [
2063
2063
  a && /* @__PURE__ */ p(Dn, {}),
2064
2064
  l && /* @__PURE__ */ p(Mn, {}),
@@ -2300,14 +2300,14 @@ const yn = () => {
2300
2300
  return;
2301
2301
  }
2302
2302
  if (!f) {
2303
- n((y) => X(S({}, y), { name: "validation.should_be_english_letters_only" }));
2303
+ n((y) => Q(k({}, y), { name: "validation.should_be_english_letters_only" }));
2304
2304
  return;
2305
2305
  }
2306
2306
  if (!w) {
2307
- n((y) => X(S({}, y), { name: "validation.first_and_last_name_required" }));
2307
+ n((y) => Q(k({}, y), { name: "validation.first_and_last_name_required" }));
2308
2308
  return;
2309
2309
  }
2310
- o(!1), n((y) => X(S({}, y), { name: "" }));
2310
+ o(!1), n((y) => Q(k({}, y), { name: "" }));
2311
2311
  }, i = (u) => {
2312
2312
  const c = u.target, { value: m } = c;
2313
2313
  t(m);
@@ -2342,7 +2342,7 @@ const yn = () => {
2342
2342
  msg: e ? "" : "error.invalid_csc"
2343
2343
  };
2344
2344
  }, GA = lt({}), Nn = ({ setValue: A }) => {
2345
- const { t } = Y(), { handleBlur: e, err: n } = U(GA), r = "** / **", a = (l) => {
2345
+ const { t } = Y(), { handleBlur: e, err: n } = _(GA), r = "** / **", a = (l) => {
2346
2346
  const i = l.target, { value: s } = i;
2347
2347
  A(s);
2348
2348
  }, o = fA(e, 1e3);
@@ -2368,7 +2368,7 @@ const yn = () => {
2368
2368
  }
2369
2369
  );
2370
2370
  }, In = ({ value: A, setValue: t }) => {
2371
- const { t: e } = Y(), { handleBlur: n, err: r, config: a } = U(GA), o = (i) => {
2371
+ const { t: e } = Y(), { handleBlur: n, err: r, config: a } = _(GA), o = (i) => {
2372
2372
  const s = i.target, { value: u } = s;
2373
2373
  t(u);
2374
2374
  }, l = fA(n, 1e3);
@@ -2397,7 +2397,7 @@ const yn = () => {
2397
2397
  return !0;
2398
2398
  return !1;
2399
2399
  }, ct = () => {
2400
- const { supported_networks: A } = U(x);
2400
+ const { supported_networks: A } = _(x);
2401
2401
  function t(e) {
2402
2402
  let n = "";
2403
2403
  return On(e) && (n = "visa"), Un(e) && (n = "mastercard"), he(e) && (n = "amex"), ye(e) && (n = "unionpay"), we(e) && (n = "mada"), n === "" || !A.includes(n) ? "" : n;
@@ -2406,7 +2406,7 @@ const yn = () => {
2406
2406
  getCardSchema: t
2407
2407
  };
2408
2408
  }, _n = ({ value: A, setValue: t }) => {
2409
- const { t: e } = Y(), { handleBlur: n, err: r, setType: a } = U(GA), { getCardSchema: o } = ct(), l = (s) => {
2409
+ const { t: e } = Y(), { handleBlur: n, err: r, setType: a } = _(GA), { getCardSchema: o } = ct(), l = (s) => {
2410
2410
  const u = s.target, { value: c } = u;
2411
2411
  t(c), a(o(c));
2412
2412
  }, i = fA(n, 1e3);
@@ -2433,7 +2433,7 @@ const yn = () => {
2433
2433
  }
2434
2434
  );
2435
2435
  }, zn = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cclipPath%20id='_clip1'%3e%3crect%20x='7.179'%20y='18.832'%20width='81.642'%20height='26.336'/%3e%3c/clipPath%3e%3cg%20clip-path='url(%23_clip1)'%3e%3cg%3e%3cpath%20d='M47.418,19.387l-5.431,25.384l-6.567,0l5.432,-25.384l6.566,0Zm27.627,16.39l3.457,-9.532l1.989,9.532l-5.446,0Zm7.326,8.994l6.074,0l-5.3,-25.384l-5.607,0c-1.259,0%20-2.323,0.733%20-2.795,1.863l-9.852,23.521l6.895,0l1.37,-3.79l8.424,-0l0.791,3.79Zm-17.137,-8.287c0.028,-6.701%20-9.267,-7.069%20-9.201,-10.062c0.019,-0.912%200.887,-1.879%202.784,-2.127c0.943,-0.123%203.534,-0.218%206.476,1.136l1.152,-5.383c-1.58,-0.574%20-3.614,-1.125%20-6.143,-1.125c-6.49,-0%20-11.059,3.451%20-11.097,8.391c-0.041,3.655%203.261,5.693%205.75,6.908c2.557,1.245%203.417,2.041%203.406,3.154c-0.017,1.704%20-2.041,2.455%20-3.929,2.485c-3.302,0.052%20-5.218,-0.892%20-6.745,-1.603l-1.19,5.562c1.534,0.705%204.365,1.317%207.303,1.348c6.898,0%2011.411,-3.408%2011.434,-8.684Zm-27.2,-17.097l-10.639,25.384l-6.942,0l-5.235,-20.258c-0.318,-1.248%20-0.595,-1.705%20-1.562,-2.23c-1.576,-0.857%20-4.183,-1.66%20-6.477,-2.158l0.157,-0.738l11.173,0c1.423,0%202.705,0.948%203.028,2.588l2.765,14.69l6.833,-17.278l6.899,0Z'%20style='fill:%230d357f;fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Gn = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,7.094c0,-3.363%20-2.731,-6.094%20-6.094,-6.094l-81.812,0c-3.363,0%20-6.094,2.731%20-6.094,6.094l-0,49.812c-0,3.363%202.731,6.094%206.094,6.094l81.812,0c3.363,0%206.094,-2.731%206.094,-6.094l0,-49.812Z'%20style='fill:%23fff;stroke:%23b1b1b1;stroke-width:0.5px;'/%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%20opacity='0'%3e%3crect%20x='14.04'%20y='9.539'%20width='67.919'%20height='44.921'%20style='fill:%23fff;'/%3e%3c/g%3e%3crect%20x='39.044'%20y='17.366'%20width='17.917'%20height='29.263'%20style='fill:%23ff5f00;'/%3e%3cpath%20d='M40.89,32c-0.005,-5.706%202.619,-11.106%207.107,-14.629c-3.278,-2.576%20-7.329,-3.978%20-11.498,-3.978c-10.209,0%20-18.61,8.401%20-18.61,18.61c0,10.208%208.401,18.609%2018.61,18.609c4.169,-0%208.22,-1.401%2011.498,-3.978c-4.489,-3.524%20-7.113,-8.927%20-7.107,-14.634Z'%20style='fill:%23eb001b;fill-rule:nonzero;'/%3e%3cpath%20d='M76.33,43.533l0,-0.6l0.259,0l-0,-0.124l-0.615,-0l-0,0.124l0.242,0l0,0.6l0.114,-0Zm1.194,-0l0,-0.724l-0.186,-0l-0.217,0.517l-0.217,-0.517l-0.186,-0l-0,0.724l0.134,-0l0,-0.548l0.202,0.47l0.139,0l0.202,-0.47l0,0.548l0.129,-0Z'%20style='fill:%23f79e1b;fill-rule:nonzero;'/%3e%3cpath%20d='M78.108,32c0,10.209%20-8.4,18.609%20-18.609,18.609c-4.171,-0%20-8.223,-1.402%20-11.502,-3.98c4.487,-3.526%207.111,-8.926%207.111,-14.632c-0,-5.705%20-2.624,-11.106%20-7.111,-14.631c3.279,-2.578%207.331,-3.98%2011.502,-3.98c10.209,-0%2018.609,8.4%2018.609,18.609l0,0.005Z'%20style='fill:%23f79e1b;fill-rule:nonzero;'/%3e%3c/svg%3e", En = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,7.053c0,-3.341%20-2.712,-6.053%20-6.053,-6.053l-81.894,-0c-3.341,-0%20-6.053,2.712%20-6.053,6.053l0,49.894c0,3.341%202.712,6.053%206.053,6.053l81.894,0c3.341,0%206.053,-2.712%206.053,-6.053l0,-49.894Z'%20style='fill:%23006fcf;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%3e%3cpath%20d='M54.459,9.71l-10.404,23.609l8.342,0l0,21.172l26.31,0l4.061,-4.51l4.063,4.534l7.933,0l0,-2.672l-6.538,0l-5.395,-5.867l-5.44,5.88l-22.088,0l0,-18.444l22.202,0l5.408,5.938l5.476,-5.963l6.352,-0l0,-2.626l-4.935,-0l-0,-12.769l-4.686,12.699l-4.45,0l-4.823,-12.608l0,12.647l-10.546,0l-1.49,-3.637l-8.559,0l-1.457,3.589l-5.544,0l8.116,-18.39l6.498,-0l8.058,18.438l-0,-18.443l7.875,-0l4.161,11.351l4.127,-11.364l7.714,0.003l0,-2.656l-9.767,-0l-2.048,5.839l-2.2,-5.8l-12.552,-0l-0.077,7.83l-3.474,-7.76l-10.223,-0.02Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M59.526,16.941l-2.53,5.961l5.011,0l-2.481,-5.961Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M60.312,37.605l10.641,-0l0,-4.147l8.738,9.184l-8.621,9.204l-0.101,0l0,-4.221l-10.669,-0l-0,-2.905l10.397,0l-0,-4.077l-10.397,0l0.012,-3.038Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M94.723,47.865l0,3.969l-8.581,-9.23l8.59,-9.225l-0,3.95l-4.946,5.265l4.937,5.271Z'%20style='fill:%23fff;'/%3e%3c/g%3e%3c/svg%3e", Jn = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%3e%3crect%20x='5.311'%20y='34.182'%20width='36.116'%20height='12.031'%20style='fill:%2384b740;'/%3e%3crect%20x='5.311'%20y='17.765'%20width='36.116'%20height='12.042'%20style='fill:%23259bd6;'/%3e%3cpath%20d='M77.542,43.769l-0.161,0.032c-0.557,0.107%20-0.761,0.15%20-1.168,0.15c-0.944,-0%20-2.059,-0.483%20-2.059,-2.756c-0,-1.169%200.193,-2.724%201.951,-2.724l0.011,0c0.3,0.022%200.644,0.054%201.287,0.247l0.139,0.043l0,5.008Zm0.29,-11.335l-0.29,0.054l0,4.203l-0.257,-0.075l-0.075,-0.021c-0.29,-0.086%20-0.954,-0.279%20-1.598,-0.279c-3.517,0%20-4.257,2.659%20-4.257,4.89c0,3.056%201.716,4.815%204.708,4.815c1.265,-0%202.198,-0.129%203.141,-0.44c0.869,-0.279%201.18,-0.676%201.18,-1.523l-0,-12.063c-0.836,0.15%20-1.705,0.3%20-2.552,0.439'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M87.997,43.844l-0.15,0.043l-0.536,0.139c-0.504,0.129%20-0.954,0.204%20-1.297,0.204c-0.826,-0%20-1.319,-0.408%20-1.319,-1.105c-0,-0.45%200.203,-1.211%201.555,-1.211l1.747,-0l0,1.93Zm-1.233,-7.582c-1.083,0%20-2.198,0.193%20-3.581,0.622l-0.901,0.268l0.3,2.038l0.88,-0.29c0.922,-0.3%202.069,-0.493%202.927,-0.493c0.386,0%201.566,0%201.566,1.276l-0,0.558l-1.641,-0c-2.992,-0%20-4.375,0.954%20-4.375,3.002c-0,1.748%201.276,2.799%203.421,2.799c0.664,-0%201.587,-0.129%202.38,-0.322l0.043,-0.01l0.043,0.01l0.268,0.043c0.836,0.15%201.705,0.3%202.552,0.461l0,-6.691c0,-2.166%20-1.308,-3.271%20-3.882,-3.271'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M67.162,43.844l-0.15,0.043l-0.536,0.139c-0.504,0.129%20-0.944,0.204%20-1.297,0.204c-0.826,-0%20-1.319,-0.408%20-1.319,-1.105c-0,-0.45%200.203,-1.211%201.544,-1.211l1.748,-0l0.01,1.93Zm-1.222,-7.582c-1.094,0%20-2.198,0.193%20-3.582,0.622l-0.9,0.268l0.3,2.038l0.879,-0.29c0.922,-0.3%202.07,-0.493%202.928,-0.493c0.386,0%201.565,0%201.565,1.276l0,0.558l-1.641,-0c-2.991,-0%20-4.385,0.954%20-4.385,3.002c-0,1.748%201.276,2.799%203.431,2.799c0.665,-0%201.587,-0.129%202.381,-0.322l0.043,-0.01l0.042,0.01l0.258,0.043c0.847,0.15%201.705,0.3%202.552,0.472l-0,-6.691c0.011,-2.188%20-1.298,-3.282%20-3.871,-3.282'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M55.871,36.284c-1.362,-0%20-2.488,0.45%20-2.906,0.643l-0.107,0.054l-0.097,-0.075c-0.579,-0.418%20-1.426,-0.633%20-2.606,-0.633c-1.04,0%20-2.016,0.15%20-3.077,0.461c-0.912,0.279%20-1.266,0.719%20-1.266,1.544l0,7.646l2.853,0l-0,-7.067l0.139,-0.042c0.579,-0.193%200.922,-0.226%201.255,-0.226c0.826,0%201.244,0.44%201.244,1.298l-0,6.048l2.809,-0l0,-6.166c0,-0.365%20-0.075,-0.579%20-0.086,-0.622l-0.096,-0.182l0.193,-0.086c0.429,-0.193%200.901,-0.29%201.394,-0.29c0.568,0%201.244,0.226%201.244,1.298l-0,6.048l2.799,-0l-0,-6.327c-0,-2.241%20-1.201,-3.324%20-3.689,-3.324'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M85.896,25.614c-0.419,0%20-1.116,-0.043%20-1.662,-0.15l-0.161,-0.032l-0,-4.128c-0,-0.344%20-0.065,-0.558%20-0.075,-0.59l-0.086,-0.172l0.182,-0.075c0.043,-0.021%200.086,-0.032%200.14,-0.053l0.032,-0.022c0.064,-0.021%200.128,-0.043%200.193,-0.064c0.032,-0.011%200.053,-0.022%200.075,-0.022c0.633,-0.171%201.212,-0.15%201.469,-0.171l0.011,-0c1.748,-0%201.951,1.555%201.951,2.723c-0.01,2.274%20-1.136,2.756%20-2.069,2.756m-0.011,-7.849l-0.075,-0c-1.641,-0%20-3.324,0.45%20-3.925,1.33c-0.321,0.429%20-0.504,0.965%20-0.514,1.597l-0,4.258c-0,0.364%20-0.076,0.504%20-0.086,0.536l-0.097,0.182l-5.179,-0l-0,-2.96l-0.011,0c-0.064,-3.12%20-1.909,-4.836%20-4.579,-4.836l-2.605,0c-0.108,0.762%20-0.193,1.298%20-0.301,2.059l2.595,0c1.362,0%202.081,1.158%202.081,2.938l-0,2.981l-0.183,-0.096c-0.032,-0.011%20-0.257,-0.086%20-0.611,-0.086l-4.482,-0c-0.086,0.568%20-0.193,1.308%20-0.311,2.048l13.779,0c0.472,-0.096%201.019,-0.182%201.491,-0.257c0.697,0.343%201.994,0.525%202.884,0.525c2.992,0%204.933,-2.005%204.933,-5.093c-0.011,-3.056%20-1.887,-5.062%20-4.804,-5.126'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M57.78,28.971l4.074,-0c2.992,-0%204.386,-0.987%204.386,-3.421c0,-1.748%20-1.276,-3.142%20-3.421,-3.142l-2.755,0c-0.826,0%20-1.319,-0.472%20-1.319,-1.265c-0,-0.536%200.203,-1.201%201.554,-1.201l6.027,-0c0.129,-0.783%200.193,-1.276%200.311,-2.059l-6.262,-0c-2.917,-0%20-4.386,1.222%20-4.386,3.26c-0,2.016%201.276,3.067%203.42,3.067l2.756,-0c0.826,-0%201.319,0.654%201.319,1.34c0,0.45%20-0.203,1.383%20-1.544,1.383l-0.461,0l-8.825,-0.021l-1.609,-0c-1.361,-0%20-2.316,-0.772%20-2.316,-2.563l0,-1.233c0,-1.866%200.74,-3.024%202.316,-3.024l2.617,-0c0.118,-0.794%200.193,-1.298%200.3,-2.048l-3.571,-0c-2.67,-0%20-4.514,1.791%20-4.579,4.911l0,1.394c0.065,3.12%201.909,4.611%204.579,4.611l2.606,-0l4.783,0.011Z'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3c/g%3e%3c/svg%3e", Wn = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20450.53%20281.82'%3e%3cdefs%3e%3cstyle%3e.a{fill:%23e21836;}.b{fill:%2300447c;}.c{fill:%23007b84;}.d{fill:%23fefefe;}%3c/style%3e%3c/defs%3e%3ctitle%3eunionpay%3c/title%3e%3cpath%20class='a'%20d='M88.23,0H200.68c15.7,0,25.46,12.79,21.8,28.54L170.13,253.32c-3.7,15.69-19.42,28.5-35.12,28.5H22.57c-15.68,0-25.46-12.81-21.8-28.5L53.14,28.54C56.81,12.79,72.51,0,88.23,0'/%3e%3cpath%20class='b'%20d='M191.32,0H320.64c15.69,0,8.62,12.79,4.92,28.54L273.22,253.32c-3.67,15.69-2.53,28.5-18.26,28.5H125.65c-15.73,0-25.46-12.81-21.77-28.5L156.23,28.54C159.94,12.79,175.62,0,191.32,0'/%3e%3cpath%20class='c'%20d='M315.51,0H428c15.72,0,25.48,12.79,21.79,28.54L397.41,253.32c-3.7,15.69-19.43,28.5-35.14,28.5H249.87c-15.73,0-25.48-12.81-21.8-28.5L280.42,28.54C284.09,12.79,299.78,0,315.51,0'/%3e%3cpath%20class='d'%20d='M117.6,72c-11.57.12-15,0-16.07-.25-.42,2-8.22,38-8.25,38-1.68,7.28-2.9,12.47-7,15.82a12.57,12.57,0,0,1-8.3,2.89c-5.13,0-8.12-2.55-8.62-7.38l-.09-1.65s1.56-9.76,1.56-9.81S79,76.86,80.43,72.53a3,3,0,0,0,.12-.5c-15.94.14-18.76,0-19-.25-.11.35-.5,2.38-.5,2.38l-8.36,37L52,114.27l-1.39,10.26a15.07,15.07,0,0,0,1.79,7.62c3.81,6.66,14.67,7.66,20.82,7.66,7.92,0,15.35-1.68,20.37-4.76,8.72-5.15,11-13.2,13-20.35l1-3.67S116,77,117.45,72.53A1.35,1.35,0,0,1,117.6,72Zm28.7,27.49a22.25,22.25,0,0,0-9.09,2.13c-1.21.62-2.35,1.34-3.56,2l1.09-3.94-.6-.66c-7.08,1.43-8.66,1.63-15.2,2.55l-.55.36a192.72,192.72,0,0,1-4.25,23.41c-1.07,4.56-2.18,9.16-3.3,13.71l.3.58c6.7-.35,8.74-.35,14.56-.26l.47-.51c.74-3.79.84-4.68,2.48-12.36.77-3.64,2.38-11.63,3.17-14.48a10.74,10.74,0,0,1,4.26-1.34c3.26,0,2.87,2.85,2.74,4-.14,1.91-1.33,8.13-2.55,13.47l-.81,3.45c-.57,2.55-1.19,5-1.76,7.55l.25.5c6.6-.35,8.62-.35,14.26-.26l.66-.51c1-5.92,1.32-7.5,3.13-16.12l.91-4c1.77-7.76,2.65-11.69,1.32-14.89C152.81,100.38,149.42,99.52,146.3,99.52Zm32.07,8.11c-3.51.68-5.75,1.13-8,1.42s-4.35.67-7.75,1.14l-.27.25-.24.19c-.36,2.53-.6,4.71-1.07,7.28s-1,5.68-2,10a39.64,39.64,0,0,1-1.6,5.65,48.24,48.24,0,0,0-1.77,5.56l.21.3.17.28c3.17-.15,5.24-.26,7.37-.28s4.34,0,7.76,0l.29-.24.32-.27c.5-2.94.57-3.74.87-5.17s.82-3.67,2.08-9.37c.6-2.68,1.26-5.34,1.88-8.07s1.32-5.4,2-8.07l-.09-.33Zm.07-10.94c-3.19-1.88-8.79-1.28-12.55,1.32s-4.19,6.16-1,8.07,8.76,1.29,12.49-1.34S181.59,98.56,178.44,96.69Zm19.3,43.61c6.45,0,13.07-1.78,18-7.06,3.83-4.28,5.59-10.65,6.2-13.27,2-8.7.44-12.75-1.5-15.23-3-3.77-8.15-5-13.54-5-3.25,0-11,.32-17,5.88-4.33,4-6.34,9.47-7.55,14.69s-2.62,14.91,6.19,18.47A25.77,25.77,0,0,0,197.74,140.3Zm-.51-19.56c1.49-6.58,3.25-12.11,7.73-12.11,3.52,0,3.77,4.11,2.21,10.72-.28,1.46-1.56,6.91-3.3,9.24-1.21,1.71-2.64,2.75-4.23,2.75-.47,0-3.27,0-3.32-4.17A28.6,28.6,0,0,1,197.23,120.74Zm40.89,18.71.51-.51c.71-3.79.83-4.68,2.41-12.35.8-3.64,2.44-11.64,3.21-14.49a10.63,10.63,0,0,1,4.28-1.34c3.24,0,2.85,2.85,2.72,4a130.37,130.37,0,0,1-2.55,13.47l-.77,3.45c-.59,2.55-1.23,5-1.8,7.55l.25.5c6.63-.35,8.56-.35,14.24-.26l.68-.51c1-5.92,1.27-7.51,3.13-16.12l.89-4c1.77-7.75,2.67-11.68,1.36-14.88-1.46-3.58-4.87-4.45-7.95-4.45a22.18,22.18,0,0,0-9.09,2.13c-1.18.62-2.37,1.34-3.54,2l1-3.93-.55-.67c-7.08,1.44-8.69,1.63-15.23,2.55l-.5.36a199,199,0,0,1-4.25,23.41c-1.07,4.56-2.18,9.16-3.3,13.71l.3.58C230.31,139.36,232.31,139.36,238.12,139.45Zm48.7.26c.41-2,2.89-14.09,2.91-14.09s2.11-8.84,2.24-9.16a5.31,5.31,0,0,1,1.32-1.29h1c9.21,0,19.6,0,27.75-6a29.57,29.57,0,0,0,11-17.56,26.55,26.55,0,0,0,.76-6.12,12.83,12.83,0,0,0-2.21-7.8c-4.15-5.82-12.43-5.92-22-6l-4.71,0c-12.23.15-17.13.1-19.14-.14-.17.89-.49,2.47-.49,2.47s-4.38,20.3-4.38,20.33-10.49,43.16-11,45.2C280.6,139.51,285,139.51,286.82,139.71Zm8.11-36.06,4.64-20.18.15-1,.06-.79,1.86.19,9.83.85c3.79,1.46,5.36,5.24,4.27,10.18A14.81,14.81,0,0,1,308.06,103c-3.1,1.55-6.89,1.68-10.79,1.68h-2.53Zm29,17.46c-1.23,5.25-2.65,14.83,6.12,18.25a17.1,17.1,0,0,0,7.85,1.41,12.87,12.87,0,0,0,7.48-3.43c-.2.79-.41,1.59-.62,2.39l.4.52c6.3-.27,8.26-.27,15.09-.22l.62-.47c1-5.87,1.94-11.56,4.53-22.78,1.27-5.38,2.53-10.7,3.83-16l-.21-.59c-7,1.31-8.94,1.58-15.72,2.55l-.52.42q-.11.81-.21,1.59a9.66,9.66,0,0,0-4.94-4.07c-3-1.19-10.11.34-16.2,5.89C327.15,110.48,325.09,115.91,323.93,121.11Zm14.81.32c1.51-6.46,3.25-11.93,7.74-11.93,2.85,0,4.34,2.62,4,7.09-.24,1.12-.5,2.3-.81,3.62-.45,1.93-.94,3.83-1.41,5.74a14.12,14.12,0,0,1-1.67,3.35,7.74,7.74,0,0,1-5.49,2.66c-.45,0-3.22,0-3.32-4.09A28.47,28.47,0,0,1,338.74,121.43Zm77.38-21.34-.54-.63c-7,1.42-8.25,1.64-14.66,2.51l-.47.47c0,.08-.05.19-.08.3l0-.11c-4.78,11-4.64,8.64-8.52,17.32,0-.4,0-.65-.05-1.06l-1-18.8-.61-.63c-7.31,1.42-7.49,1.64-14.24,2.51l-.53.47a5,5,0,0,0-.11.74l0,.1a96.43,96.43,0,0,1,1.49,10.16c.39,3.34.92,6.7,1.31,10,.67,5.52,1,8.24,1.86,16.67-4.56,7.52-5.64,10.37-10,17l0,.06-3.1,4.89a2.29,2.29,0,0,1-1.12,1,4.56,4.56,0,0,1-2,.29h-1.71l-2.54,8.47,8.73.15c5.13,0,8.35-2.42,10.09-5.64l5.49-9.41h-.09l.58-.67C388,148.3,416.12,100.09,416.12,100.09ZM323.93,211.32h-3.71L333.94,166h4.55l1.44-4.67.14,5.2c-.17,3.21,2.36,6.06,9,5.59h7.67l2.65-8.74H356.5c-1.66,0-2.43-.42-2.34-1.32l-.14-5.29H339.8v0c-4.59.1-18.32.44-21.1,1.18a25,25,0,0,0-6.91,3.42l1.4-4.68h-13.3L297.12,166,283.22,212h-2.7l-2.64,8.67h26.48l-.88,2.9h13l.86-2.9h3.67Zm-10.87-36.15a59.15,59.15,0,0,0-6.09,2.38l3.52-11.6h10.57l-2.55,8.45A34.06,34.06,0,0,0,313.06,175.17Zm.2,16.56s-3.32.42-5.5.91a55.49,55.49,0,0,0-6.19,2.71l3.64-12.06h10.62Zm-5.92,19.69h-10.6l3.07-10.18h10.57Zm25.53-28.13h15.27L346,190.4H330.47l-2.33,7.77h13.55l-10.26,14.44a4.24,4.24,0,0,1-2.08,1.74,6.11,6.11,0,0,1-2.75.79h-3.75l-2.59,8.51h9.83a12,12,0,0,0,10.36-5.37l7-9.63,1.51,9.78a4.57,4.57,0,0,0,2.53,3.31,9,9,0,0,0,3.43,1.47c1.55.07,2.66.12,3.4.12h4.83l2.9-9.53h-1.91c-1.09,0-3-.18-3.29-.53a4.88,4.88,0,0,1-.5-2l-1.53-9.79h-6.27l2.75-3.28h15.45l2.37-7.77h-14.3l2.23-7.11h14.26l2.64-8.77H335.47Zm-129,30.11,3.57-11.86h14.65l2.68-8.82H210.06l2.24-7.3h14.33l2.66-8.55H193.42l-2.6,8.55H199l-2.17,7.3h-8.17l-2.71,9h8.14l-4.75,15.7c-.64,2.07.3,2.87.9,3.83a4,4,0,0,0,2.62,1.92,15.85,15.85,0,0,0,3.76.51h16.52l2.95-9.77-7.33,1C207.32,214.88,203.4,214.71,203.83,213.4Zm1.68-56.78-3.71,6.71a7.63,7.63,0,0,1-2.16,2.79,7,7,0,0,1-3.32.51h-1.93l-2.6,8.58h6.44a14.58,14.58,0,0,0,6.61-1.7c1.22-.65,1.54-.28,2.48-1.19l2.17-1.88h20.1l2.67-8.94H217.55l2.56-4.88Zm29.67,57c-.34-.5-.1-1.37.43-3.17l5.49-18.18h19.54c2.85,0,4.9-.08,6.24-.17a12.94,12.94,0,0,0,4.7-1.59,8.74,8.74,0,0,0,3.42-3.15,27,27,0,0,0,3.37-7.64l6.9-23-20.27.12a64,64,0,0,0-9,1.94,36.54,36.54,0,0,0-6.73,4.3l1.83-6.31H238.57L221,214.88a35.71,35.71,0,0,0-1.14,4.88c0,1.06,1.34,2.11,2.23,2.91,1.05.79,2.6.66,4.09.79s3.79.19,6.86.19h9.63l2.95-10-8.62.82A2.28,2.28,0,0,1,235.18,213.58ZM244.64,180h20.53L263.86,184a13.42,13.42,0,0,0-2.71,0H243.38Zm4.11-13.72h20.7L268,171.16s-9.75-.1-11.31.19a23.07,23.07,0,0,0-10.89,4.86Zm15.57,31.5a2.21,2.21,0,0,1-.81,1.26,4,4,0,0,1-2.1.37h-2.92l.17-5H246.5l-.5,24.35c0,1.75.15,2.77,1.44,3.58,1.28,1,5.24,1.15,10.58,1.15h7.62l2.75-9.11-6.64.36-2.2.13a2.57,2.57,0,0,1-.91-.57c-.28-.28-.75-.11-.68-1.86l.06-6.24,7-.29a9,9,0,0,0,6.74-2.39,7.47,7.47,0,0,0,2.23-4.13l1.16-5.53h-9.56Z'/%3e%3c/svg%3e", qn = ({ type: A }) => {
2436
- const { supported_networks: t } = U(x), e = "h-4 sm:h-5 w-auto object-contain object-center";
2436
+ const { supported_networks: t } = _(x), e = "h-4 sm:h-5 w-auto object-contain object-center";
2437
2437
  return /* @__PURE__ */ p("div", { class: "absolute right-2 top-1/4 z-[2] flex -translate-y-1/2 items-center gap-1", children: [
2438
2438
  {
2439
2439
  alt: "AMEX",
@@ -2525,27 +2525,27 @@ const yn = () => {
2525
2525
  };
2526
2526
  }, Vn = ({ cc: A, setCc: t, cvc: e, setCvc: n, exp: r, setExp: a, err: o, setErr: l }) => {
2527
2527
  const { t: i } = Y(), [s, u] = N(!1), [c, m] = N(""), { isValidCc: f } = De(), w = ae(() => be(c), [c]), y = (v) => {
2528
- const { value: d, name: g } = v.target, D = q(d.trim());
2529
- if (!D) {
2530
- u(!D);
2528
+ const { value: d, name: g } = v.target, C = q(d.trim());
2529
+ if (!C) {
2530
+ u(!C);
2531
2531
  return;
2532
2532
  }
2533
2533
  if (g === "mysr-cc-csc") {
2534
- const { msg: b } = ge(D, c);
2535
- l((h) => X(S({}, h), {
2534
+ const { msg: b } = ge(C, c);
2535
+ l((h) => Q(k({}, h), {
2536
2536
  csc: b
2537
2537
  }));
2538
2538
  }
2539
2539
  if (g === "mysr-cc-exp") {
2540
- const { isValidExpFormat: b, isValidYear: h, inValidMonth: C } = Ce(D);
2541
- l((P) => X(S({}, P), {
2542
- exp_month: C ? "" : "error.invalid_month",
2540
+ const { isValidExpFormat: b, isValidYear: h, inValidMonth: D } = Ce(C);
2541
+ l((S) => Q(k({}, S), {
2542
+ exp_month: D ? "" : "error.invalid_month",
2543
2543
  exp_year: h ? "" : "error.invalid_year",
2544
2544
  exp: b ? "" : "error.invalid_date"
2545
2545
  }));
2546
2546
  }
2547
- g === "mysr-cc-number" && l((b) => X(S({}, b), {
2548
- cc: c === "" ? "error.unsupported_cc_type" : f(D) ? "" : "error.invalid_cc_number"
2547
+ g === "mysr-cc-number" && l((b) => Q(k({}, b), {
2548
+ cc: c === "" ? "error.unsupported_cc_type" : f(C) ? "" : "error.invalid_cc_number"
2549
2549
  }));
2550
2550
  };
2551
2551
  return V(() => {
@@ -2585,7 +2585,7 @@ const yn = () => {
2585
2585
  callback_url: a,
2586
2586
  payment_button_type: o,
2587
2587
  currency: l
2588
- } = U(x), [i, s] = N(""), [u, c] = N(""), [m, f] = N(""), [w, y] = N(""), { getCardSchema: v } = ct(), { isValidCc: d } = De(), g = {
2588
+ } = _(x), [i, s] = N(""), [u, c] = N(""), [m, f] = N(""), [w, y] = N(""), { getCardSchema: v } = ct(), { isValidCc: d } = De(), g = {
2589
2589
  name: "",
2590
2590
  csc: "",
2591
2591
  cc: "",
@@ -2593,28 +2593,28 @@ const yn = () => {
2593
2593
  exp_month: "",
2594
2594
  exp_year: ""
2595
2595
  }, {
2596
- makePayment: D,
2596
+ makePayment: C,
2597
2597
  busy: b,
2598
2598
  fail: h,
2599
- success: C,
2600
- loading: P,
2599
+ success: D,
2600
+ loading: S,
2601
2601
  error: O,
2602
2602
  setError: L
2603
2603
  } = wA({ defaultError: g });
2604
- return /* @__PURE__ */ p("form", { class: "space-y-6", onSubmit: (J) => {
2605
- J.preventDefault();
2606
- const { isValid: _ } = ve(i), G = q(u), AA = q(w), lA = q(m), dA = v(G), sA = d(G, dA), { isValid: mA } = ge(lA, dA), { isValid: CA } = Ce(AA);
2607
- if (!_ || !sA || !mA || !CA) {
2608
- const R = S({}, g);
2609
- _ || (R.name = A("error.invalid_name")), sA || (R.cc = A("error.invalid_cc_number")), mA || (R.csc = A("error.invalid_csc")), CA || (R.exp = A("error.invalid_date")), L(R);
2604
+ return /* @__PURE__ */ p("form", { class: "space-y-6", onSubmit: (U) => {
2605
+ U.preventDefault();
2606
+ const { isValid: z } = ve(i), E = q(u), AA = q(w), lA = q(m), dA = v(E), sA = d(E, dA), { isValid: mA } = ge(lA, dA), { isValid: CA } = Ce(AA);
2607
+ if (!z || !sA || !mA || !CA) {
2608
+ const R = k({}, g);
2609
+ z || (R.name = A("error.invalid_name")), sA || (R.cc = A("error.invalid_cc_number")), mA || (R.csc = A("error.invalid_csc")), CA || (R.exp = A("error.invalid_date")), L(R);
2610
2610
  return;
2611
2611
  }
2612
- const [JA, E] = AA.split("/"), T = {
2612
+ const [JA, J] = AA.split("/"), T = {
2613
2613
  type: "creditcard",
2614
2614
  name: i,
2615
- number: G,
2615
+ number: E,
2616
2616
  month: JA,
2617
- year: E,
2617
+ year: J,
2618
2618
  cvc: lA
2619
2619
  };
2620
2620
  n != null && n.manual && (T.manual = !0), n != null && n.save_card && (T.save_card = !0), r && (T.statement_descriptor = r);
@@ -2625,7 +2625,7 @@ const yn = () => {
2625
2625
  function eA(R) {
2626
2626
  console.error(R);
2627
2627
  }
2628
- D({
2628
+ C({
2629
2629
  data: {
2630
2630
  callback_url: a,
2631
2631
  source: T
@@ -2651,7 +2651,7 @@ const yn = () => {
2651
2651
  setErr: L
2652
2652
  }
2653
2653
  ),
2654
- /* @__PURE__ */ p(HA, { type: "submit", disabled: P, success: C, fail: h, busy: b, children: /* @__PURE__ */ p($, { children: [
2654
+ /* @__PURE__ */ p(HA, { type: "submit", disabled: S, success: D, fail: h, busy: b, children: /* @__PURE__ */ p($, { children: [
2655
2655
  (o !== "plain" || !e) && A(`button.${o}`),
2656
2656
  " ",
2657
2657
  /* @__PURE__ */ p("span", { class: "currency-amount", children: /* @__PURE__ */ p(ie, { currency: l, formattedAmount: t }) })
@@ -3374,7 +3374,7 @@ function xt(A, t) {
3374
3374
  return ["SAR", "AED"].includes(t) && (r = r.replace(t, "").trim()), r;
3375
3375
  }
3376
3376
  function dr({ config: A }) {
3377
- const { amount: t, currency: e, language: n, translations: r, publishable_api_key: a } = A, o = document.documentElement.dir === "rtl" || n === "ar", l = uA[e] || uA.default, i = et(t, e), s = xt(t, e), [u, c] = N(X(S({
3377
+ const { amount: t, currency: e, language: n, translations: r, publishable_api_key: a } = A, o = document.documentElement.dir === "rtl" || n === "ar", l = uA[e] || uA.default, i = et(t, e), s = xt(t, e), [u, c] = N(Q(k({
3378
3378
  version: st
3379
3379
  }, A), {
3380
3380
  translations: qe(r),
@@ -3386,7 +3386,7 @@ function dr({ config: A }) {
3386
3386
  isTestMode: (a == null ? void 0 : a.startsWith("pk_test")) || location.protocol === "http:"
3387
3387
  }));
3388
3388
  pr(c), V(() => {
3389
- c((w) => X(S({}, w), {
3389
+ c((w) => Q(k({}, w), {
3390
3390
  amount: u.amount,
3391
3391
  formattedAmount: xt(u.amount, u.currency),
3392
3392
  decimalAmount: et(u.amount, u.currency).toFixed(l).toString()
@@ -3409,18 +3409,18 @@ function dr({ config: A }) {
3409
3409
  };
3410
3410
  !window.SamsungPay && A.samsung_pay && w(
3411
3411
  "https://img.mpay.samsung.com/gsmpi/sdk/samsungpay_web_sdk.js",
3412
- () => f((d) => X(S({}, d), { samsung: !0 }))
3412
+ () => f((d) => Q(k({}, d), { samsung: !0 }))
3413
3413
  ), !((v = (y = window.google) == null ? void 0 : y.payments) != null && v.api) && A.google_pay && w(
3414
3414
  "https://pay.google.com/gp/p/js/pay.js",
3415
- () => f((d) => X(S({}, d), { google: !0 }))
3415
+ () => f((d) => Q(k({}, d), { google: !0 }))
3416
3416
  ), A.apple_pay && w(
3417
3417
  "https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",
3418
- () => f((d) => X(S({}, d), { apple: !0 }))
3418
+ () => f((d) => Q(k({}, d), { apple: !0 }))
3419
3419
  );
3420
3420
  }, []), /* @__PURE__ */ p(
3421
3421
  x.Provider,
3422
3422
  {
3423
- value: X(S({}, u), {
3423
+ value: Q(k({}, u), {
3424
3424
  setFormSettings: c,
3425
3425
  scriptsLoaded: m
3426
3426
  }),
@@ -3481,24 +3481,24 @@ const gr = (A) => {
3481
3481
  'Invalid format for the statement descriptor [length between 1 and 64 characters, allowed alphanumeric characters, white-spaces, "/", "-" and "~" symbols] '
3482
3482
  )), A.fixed_width && typeof A.fixed_width != "boolean" && M("Fixed width expects boolean value"), A.apply_coupon && typeof A.apply_coupon != "boolean" && M("apply_coupon should be a boolean"), A.splits && !Array.isArray(A.splits) && M("splits must be an array"), A.splits && A.splits.length == 0 && M("splits must be an array that contains split details"), A.splits && A.splits.length > 0 && vr(A.splits), !0;
3483
3483
  }, Vt = (A, t) => A.every((e) => t.includes(e)), hr = (A) => {
3484
- var t, e, n, r, a, o, l, i, s, u, c, m, f, w, y, v, d, g, D, b;
3484
+ var t, e, n, r, a, o, l, i, s, u, c, m, f, w, y, v, d, g, C, b;
3485
3485
  if (A.methods && !Array.isArray(A.methods) && M("Methods must be an array"), A.methods.includes("creditcard") && ((t = A.credit_card) != null && t.manual && typeof A.credit_card.manual != "boolean" && M("Credit Card manual option must be a boolean"), (e = A.credit_card) != null && e.save_card && typeof A.credit_card.save_card != "boolean" && M("Credit Card save card option must be a boolean")), A.methods.includes("applepay") && (A.apple_pay || W("Apple Pay configuration"), A.apple_pay)) {
3486
- const h = A.apple_pay.country || ((n = A.payment_options) == null ? void 0 : n.country), C = A.apple_pay.label || ((r = A.payment_options) == null ? void 0 : r.label), P = /^[\x20-\x7E]+$/;
3487
- h || W("Apple Pay country or Payment Options country"), (h == null ? void 0 : h.trim().length) !== 2 && M("Country must be two-letter ISO 3166 country code"), C || W("Apple Pay label or Payment Options label"), (C == null ? void 0 : C.trim().length) === 0 && M("Apple Pay label or Payment Options label can't be empty"), typeof C == "string" && !P.test(C) && M("Apple Pay label or Payment Options label should be English characters only"), (a = A.apple_pay) != null && a.manual && typeof ((o = A.apple_pay) == null ? void 0 : o.manual) != "boolean" && M("Apple Pay manual option must be a boolean"), (l = A.apple_pay) != null && l.save_card && typeof ((i = A.apple_pay) == null ? void 0 : i.save_card) != "boolean" && M("Apple Pay save card option must be a boolean"), (s = A.samsung_pay) != null && s.manual && typeof ((u = A.samsung_pay) == null ? void 0 : u.manual) != "boolean" && M("Samsung Pay manual option must be a boolean"), (c = A.samsung_pay) != null && c.save_card && typeof ((m = A.samsung_pay) == null ? void 0 : m.save_card) != "boolean" && M("Samsung Pay save card option must be a boolean"), A.apple_pay.validate_merchant_url && !Be(A.apple_pay.validate_merchant_url) && aA("Apple Pay Validate Merchant URL"), (f = A.apple_pay) != null && f.merchant_capabilities && (Vt(A.apple_pay.merchant_capabilities, jA) || M(`Apple Pay merchant capabilities supports only ${jA.join(", ")}`)), (w = A.apple_pay) != null && w.supported_countries && !Array.isArray(A.apple_pay.supported_countries) && M("Apple Pay Supported Countries must be an array of country codes");
3486
+ const h = A.apple_pay.country || ((n = A.payment_options) == null ? void 0 : n.country), D = A.apple_pay.label || ((r = A.payment_options) == null ? void 0 : r.label), S = /^[\x20-\x7E]+$/;
3487
+ h || W("Apple Pay country or Payment Options country"), (h == null ? void 0 : h.trim().length) !== 2 && M("Country must be two-letter ISO 3166 country code"), D || W("Apple Pay label or Payment Options label"), (D == null ? void 0 : D.trim().length) === 0 && M("Apple Pay label or Payment Options label can't be empty"), typeof D == "string" && !S.test(D) && M("Apple Pay label or Payment Options label should be English characters only"), (a = A.apple_pay) != null && a.manual && typeof ((o = A.apple_pay) == null ? void 0 : o.manual) != "boolean" && M("Apple Pay manual option must be a boolean"), (l = A.apple_pay) != null && l.save_card && typeof ((i = A.apple_pay) == null ? void 0 : i.save_card) != "boolean" && M("Apple Pay save card option must be a boolean"), (s = A.samsung_pay) != null && s.manual && typeof ((u = A.samsung_pay) == null ? void 0 : u.manual) != "boolean" && M("Samsung Pay manual option must be a boolean"), (c = A.samsung_pay) != null && c.save_card && typeof ((m = A.samsung_pay) == null ? void 0 : m.save_card) != "boolean" && M("Samsung Pay save card option must be a boolean"), A.apple_pay.validate_merchant_url && !Be(A.apple_pay.validate_merchant_url) && aA("Apple Pay Validate Merchant URL"), (f = A.apple_pay) != null && f.merchant_capabilities && (Vt(A.apple_pay.merchant_capabilities, jA) || M(`Apple Pay merchant capabilities supports only ${jA.join(", ")}`)), (w = A.apple_pay) != null && w.supported_countries && !Array.isArray(A.apple_pay.supported_countries) && M("Apple Pay Supported Countries must be an array of country codes");
3488
3488
  }
3489
3489
  if (A.samsung_pay) {
3490
- const h = A.samsung_pay.country || ((y = A.payment_options) == null ? void 0 : y.country), C = A.samsung_pay.label || ((v = A.payment_options) == null ? void 0 : v.label), P = A.samsung_pay.order_number, O = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:";
3490
+ const h = A.samsung_pay.country || ((y = A.payment_options) == null ? void 0 : y.country), D = A.samsung_pay.label || ((v = A.payment_options) == null ? void 0 : v.label), S = A.samsung_pay.order_number, O = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:";
3491
3491
  !window.SamsungPay && O && console.warn(
3492
3492
  "To speed up loading of Samsung Pay button you can include the Samsung Pay Web SDK JavaScript file in your website front-end directly. If there will be no Samsung Pay available on form initialization it will be loaded automatically"
3493
- ), A.samsung_pay.service_id || W("Samsung Pay service_id"), A.samsung_pay.service_id.trim().length === 0 && M("Samsung Pay service_id can't be empty"), P || W("Samsung Pay order_number or Payment Options order_number"), (P == null ? void 0 : P.trim().length) === 0 && M("Order number can't be empty"), h || W("Samsung Pay country or Payment Options country"), (h == null ? void 0 : h.trim().length) !== 2 && M("Country must be two-letter ISO 3166 country code"), C || W("Samsung Pay label or Payment Options label"), (C == null ? void 0 : C.trim().length) === 0 && M("Samsung Pay label or Payment Options label can't be empty");
3493
+ ), A.samsung_pay.service_id || W("Samsung Pay service_id"), A.samsung_pay.service_id.trim().length === 0 && M("Samsung Pay service_id can't be empty"), S || W("Samsung Pay order_number or Payment Options order_number"), (S == null ? void 0 : S.trim().length) === 0 && M("Order number can't be empty"), h || W("Samsung Pay country or Payment Options country"), (h == null ? void 0 : h.trim().length) !== 2 && M("Country must be two-letter ISO 3166 country code"), D || W("Samsung Pay label or Payment Options label"), (D == null ? void 0 : D.trim().length) === 0 && M("Samsung Pay label or Payment Options label can't be empty");
3494
3494
  }
3495
3495
  if (A.google_pay) {
3496
- const h = A.google_pay.country || ((d = A.payment_options) == null ? void 0 : d.country), C = A.google_pay.label || ((g = A.payment_options) == null ? void 0 : g.label), P = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:", O = A.google_pay.environment;
3497
- !((b = (D = window.google) == null ? void 0 : D.payments) != null && b.api) && P && console.warn(
3496
+ const h = A.google_pay.country || ((d = A.payment_options) == null ? void 0 : d.country), D = A.google_pay.label || ((g = A.payment_options) == null ? void 0 : g.label), S = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:", O = A.google_pay.environment;
3497
+ !((b = (C = window.google) == null ? void 0 : C.payments) != null && b.api) && S && console.warn(
3498
3498
  "To speed up loading of Google Pay button you can include the Google Pay Web SDK JavaScript file in your website front-end directly. If there will be no Google Pay available on form initialization it will be loaded automatically"
3499
- ), A.google_pay.merchant_id || W("Google Pay service_id"), A.google_pay.merchant_id.trim().length === 0 && M("Google Pay service_id can't be empty"), h || W("Google Pay country or Payment Options country"), (h == null ? void 0 : h.trim().length) !== 2 && M("Country must be two-letter ISO 3166 country code"), C || W("Google Pay label or Payment Options label"), (C == null ? void 0 : C.trim().length) === 0 && M("Google Pay label or Payment Options label can't be empty"), O && !["PRODUCTION", "TEST"].includes(O) && M("Google Pay environment can be set to `TEST` or `PRODUCTION`");
3499
+ ), A.google_pay.merchant_id || W("Google Pay service_id"), A.google_pay.merchant_id.trim().length === 0 && M("Google Pay service_id can't be empty"), h || W("Google Pay country or Payment Options country"), (h == null ? void 0 : h.trim().length) !== 2 && M("Country must be two-letter ISO 3166 country code"), D || W("Google Pay label or Payment Options label"), (D == null ? void 0 : D.trim().length) === 0 && M("Google Pay label or Payment Options label can't be empty"), O && !["PRODUCTION", "TEST"].includes(O) && M("Google Pay environment can be set to `TEST` or `PRODUCTION`");
3500
3500
  const { auth_methods: L } = A.google_pay;
3501
- L && !Array.isArray(L) && M("Google Pay auth_methods must be an array"), L && !L.every((k) => k === "PAN_ONLY" || k === "CRYPTOGRAM_3DS") && M("Google Pay auth_methods must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'");
3501
+ L && !Array.isArray(L) && M("Google Pay auth_methods must be an array"), L && !L.every((P) => P === "PAN_ONLY" || P === "CRYPTOGRAM_3DS") && M("Google Pay auth_methods must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'");
3502
3502
  }
3503
3503
  return A.supported_networks && (Vt(A.supported_networks, RA) || M(`Moyasar form supports only ${RA.join(", ")} networks`)), !0;
3504
3504
  }, yr = (A) => (A.element || W("element"), typeof A.element != "string" && !(A.element instanceof Element) && aA("Element"), typeof A.element == "string" && !document.querySelector(A.element) && M(`Selector ${A.element} does't exist id DOM`), A.publishable_api_key.trim() || W("publishable_api_key"), A.publishable_api_key && (/^pk_(test|live)_/.test(A.publishable_api_key) || aA("Publishable API Key"), location.protocol.toLowerCase() === "http:" && A.publishable_api_key.startsWith("pk_live") && M(
@@ -3535,7 +3535,7 @@ let Dr = (A = 21) => {
3535
3535
  return t;
3536
3536
  };
3537
3537
  const Mr = (A) => {
3538
- const t = S({}, A);
3538
+ const t = k({}, A);
3539
3539
  return "show_footer" in A || (t.show_footer = !0), A.base_url || (t.base_url = "https://api.moyasar.com"), A.payment_button_type || (t.payment_button_type = "pay"), A.language || (t.language = document.documentElement.lang || "en"), A.methods || (t.methods = Xn), A.supported_networks || (t.supported_networks = RA.filter((e) => e !== "amex")), !A.fixed_width && A.fixed_width !== !1 && (t.fixed_width = !0), A.apple_pay && (A.apple_pay.version || (t.apple_pay.version = 6), A.apple_pay.merchant_capabilities || (t.apple_pay.merchant_capabilities = jA.filter(
3540
3540
  (e) => e !== "supportsEMV"
3541
3541
  )), A.apple_pay.supported_countries || (t.apple_pay.supported_countries = ["SA"])), A.samsung_pay && (A.samsung_pay.version || (t.samsung_pay.version = 2), A.samsung_pay.environment || (t.samsung_pay.environment = "PRODUCTION")), A.google_pay && (A.google_pay.environment || (t.google_pay.environment = "PRODUCTION"), A.google_pay.auth_methods || (t.google_pay.auth_methods = ["PAN_ONLY", "CRYPTOGRAM_3DS"]), A.google_pay.gateway_merchant_id || (t.google_pay.gateway_merchant_id = Dr(36))), t;
@@ -3546,7 +3546,7 @@ class Br {
3546
3546
  br(e);
3547
3547
  }
3548
3548
  static setAmount(t) {
3549
- tt ? tt((e) => X(S({}, e), { amount: t })) : console.warn("Form not yet initialized.");
3549
+ tt ? tt((e) => Q(k({}, e), { amount: t })) : console.warn("Form not yet initialized.");
3550
3550
  }
3551
3551
  }
3552
3552
  export {