@spot-flow/checkout-inline-js 0.1.37 → 0.1.38-dev.1

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.
@@ -138,7 +138,7 @@ const Oe = (n, e, i) => {
138
138
  } catch (s) {
139
139
  throw s instanceof X ? console.error(`FetchError: ${s.message} (status: ${s.status})`) : s instanceof De ? console.error(`AuthorizationError: ${s.message}`) : console.error(`UnexpectedError: ${s}`), s;
140
140
  }
141
- }, un = async (n, e, i, t, s) => {
141
+ }, cn = async (n, e, i, t, s) => {
142
142
  try {
143
143
  const o = Oe(n, t), a = await fetch(
144
144
  `${fe(Ue, s)}/payments/verify?reference=${e}`,
@@ -631,9 +631,9 @@ const Yt = [
631
631
  Discover: [16],
632
632
  UnionPay: [16],
633
633
  Verve: [16, 17, 18, 19]
634
- }, rn = class rn {
634
+ }, ln = class ln {
635
635
  };
636
- h(rn, "createToast", (e, i) => {
636
+ h(ln, "createToast", (e, i) => {
637
637
  const t = document.createElement("div");
638
638
  t.classList.add("toast", i, "grid", "grid-cols-[1fr_auto]");
639
639
  const s = document.createElement("span");
@@ -651,20 +651,20 @@ h(rn, "createToast", (e, i) => {
651
651
  </svg>
652
652
  <span id="custom-toast-msg">${e}</span>` : e, t.appendChild(s);
653
653
  const o = document.createElement("span");
654
- return o.textContent = "×", o.classList.add("close-btn", "opacity-0"), o.onclick = () => rn.removeToast(t), t.appendChild(o), t;
655
- }), h(rn, "showToast", (e, i, t = 3e3) => {
654
+ return o.textContent = "×", o.classList.add("close-btn", "opacity-0"), o.onclick = () => ln.removeToast(t), t.appendChild(o), t;
655
+ }), h(ln, "showToast", (e, i, t = 3e3) => {
656
656
  const s = document.getElementById("toast-container");
657
657
  if (s) {
658
- const o = rn.createToast(e, i);
659
- s.appendChild(o), o.offsetHeight, o.classList.add("show"), setTimeout(() => rn.removeToast(o), t);
658
+ const o = ln.createToast(e, i);
659
+ s.appendChild(o), o.offsetHeight, o.classList.add("show"), setTimeout(() => ln.removeToast(o), t);
660
660
  }
661
661
  }), // Function to remove a toast
662
- h(rn, "removeToast", (e) => {
662
+ h(ln, "removeToast", (e) => {
663
663
  e.classList.remove("show"), e.addEventListener("transitionend", () => {
664
664
  e.parentElement && e.parentElement.removeChild(e);
665
665
  });
666
666
  });
667
- let ki = rn;
667
+ let ki = ln;
668
668
  class Qt {
669
669
  constructor(e) {
670
670
  h(this, "container");
@@ -23729,7 +23729,7 @@ class Fr {
23729
23729
  return Gr;
23730
23730
  }
23731
23731
  }
23732
- function cn(n, e, i) {
23732
+ function nn(n, e, i) {
23733
23733
  const s = e.get("spf-redirect-url") || i;
23734
23734
  s && setTimeout(() => {
23735
23735
  const o = new URL(s);
@@ -23781,7 +23781,7 @@ class Ri {
23781
23781
  this.container.innerHTML = this.renderSuccessComponent();
23782
23782
  const s = document.querySelector("#go-back-merchant");
23783
23783
  s && s.addEventListener("click", () => {
23784
- cn(
23784
+ nn(
23785
23785
  this.paymentResponse,
23786
23786
  this.paymentResponseHeaders,
23787
23787
  this.callbackUrl
@@ -23791,7 +23791,7 @@ class Ri {
23791
23791
  this.container.innerHTML = this.renderErrorComponent();
23792
23792
  const s = document.querySelector("#go-back-merchant");
23793
23793
  s && s.addEventListener("click", () => {
23794
- cn(
23794
+ nn(
23795
23795
  this.paymentResponse,
23796
23796
  this.paymentResponseHeaders,
23797
23797
  this.callbackUrl
@@ -25305,7 +25305,7 @@ function Li(n) {
25305
25305
  }
25306
25306
  return i(n, e);
25307
25307
  }
25308
- function an(n, e, i) {
25308
+ function rn(n, e, i) {
25309
25309
  let t, s;
25310
25310
  return n ? (n.ownerNode ? t = e.getId(n.ownerNode) : s = i.getId(n), {
25311
25311
  styleId: s,
@@ -25319,7 +25319,7 @@ function Bl({ styleSheetRuleCb: n, mirror: e, stylesheetManager: i }, { win: t }
25319
25319
  const s = t.CSSStyleSheet.prototype.insertRule;
25320
25320
  t.CSSStyleSheet.prototype.insertRule = new Proxy(s, {
25321
25321
  apply: z((v, g, f) => {
25322
- const [y, k] = f, { id: C, styleId: w } = an(g, e, i.styleMirror);
25322
+ const [y, k] = f, { id: C, styleId: w } = rn(g, e, i.styleMirror);
25323
25323
  return (C && C !== -1 || w && w !== -1) && n({
25324
25324
  id: C,
25325
25325
  styleId: w,
@@ -25330,7 +25330,7 @@ function Bl({ styleSheetRuleCb: n, mirror: e, stylesheetManager: i }, { win: t }
25330
25330
  const o = t.CSSStyleSheet.prototype.deleteRule;
25331
25331
  t.CSSStyleSheet.prototype.deleteRule = new Proxy(o, {
25332
25332
  apply: z((v, g, f) => {
25333
- const [y] = f, { id: k, styleId: C } = an(g, e, i.styleMirror);
25333
+ const [y] = f, { id: k, styleId: C } = rn(g, e, i.styleMirror);
25334
25334
  return (k && k !== -1 || C && C !== -1) && n({
25335
25335
  id: k,
25336
25336
  styleId: C,
@@ -25341,7 +25341,7 @@ function Bl({ styleSheetRuleCb: n, mirror: e, stylesheetManager: i }, { win: t }
25341
25341
  let a;
25342
25342
  t.CSSStyleSheet.prototype.replace && (a = t.CSSStyleSheet.prototype.replace, t.CSSStyleSheet.prototype.replace = new Proxy(a, {
25343
25343
  apply: z((v, g, f) => {
25344
- const [y] = f, { id: k, styleId: C } = an(g, e, i.styleMirror);
25344
+ const [y] = f, { id: k, styleId: C } = rn(g, e, i.styleMirror);
25345
25345
  return (k && k !== -1 || C && C !== -1) && n({
25346
25346
  id: k,
25347
25347
  styleId: C,
@@ -25352,7 +25352,7 @@ function Bl({ styleSheetRuleCb: n, mirror: e, stylesheetManager: i }, { win: t }
25352
25352
  let l;
25353
25353
  t.CSSStyleSheet.prototype.replaceSync && (l = t.CSSStyleSheet.prototype.replaceSync, t.CSSStyleSheet.prototype.replaceSync = new Proxy(l, {
25354
25354
  apply: z((v, g, f) => {
25355
- const [y] = f, { id: k, styleId: C } = an(g, e, i.styleMirror);
25355
+ const [y] = f, { id: k, styleId: C } = rn(g, e, i.styleMirror);
25356
25356
  return (k && k !== -1 || C && C !== -1) && n({
25357
25357
  id: k,
25358
25358
  styleId: C,
@@ -25369,7 +25369,7 @@ function Bl({ styleSheetRuleCb: n, mirror: e, stylesheetManager: i }, { win: t }
25369
25369
  deleteRule: g.prototype.deleteRule
25370
25370
  }, g.prototype.insertRule = new Proxy(b[v].insertRule, {
25371
25371
  apply: z((f, y, k) => {
25372
- const [C, w] = k, { id: M, styleId: A } = an(y.parentStyleSheet, e, i.styleMirror);
25372
+ const [C, w] = k, { id: M, styleId: A } = rn(y.parentStyleSheet, e, i.styleMirror);
25373
25373
  return (M && M !== -1 || A && A !== -1) && n({
25374
25374
  id: M,
25375
25375
  styleId: A,
@@ -25386,7 +25386,7 @@ function Bl({ styleSheetRuleCb: n, mirror: e, stylesheetManager: i }, { win: t }
25386
25386
  })
25387
25387
  }), g.prototype.deleteRule = new Proxy(b[v].deleteRule, {
25388
25388
  apply: z((f, y, k) => {
25389
- const [C] = k, { id: w, styleId: M } = an(y.parentStyleSheet, e, i.styleMirror);
25389
+ const [C] = k, { id: w, styleId: M } = rn(y.parentStyleSheet, e, i.styleMirror);
25390
25390
  return (w && w !== -1 || M && M !== -1) && n({
25391
25391
  id: w,
25392
25392
  styleId: M,
@@ -25442,7 +25442,7 @@ function Dl({ styleDeclarationCb: n, mirror: e, ignoreCSSAttributes: i, styleshe
25442
25442
  const [g, f, y] = b;
25443
25443
  if (i.has(g))
25444
25444
  return o.apply(d, [g, f, y]);
25445
- const { id: k, styleId: C } = an((v = d.parentRule) === null || v === void 0 ? void 0 : v.parentStyleSheet, e, t.styleMirror);
25445
+ const { id: k, styleId: C } = rn((v = d.parentRule) === null || v === void 0 ? void 0 : v.parentStyleSheet, e, t.styleMirror);
25446
25446
  return (k && k !== -1 || C && C !== -1) && n({
25447
25447
  id: k,
25448
25448
  styleId: C,
@@ -25462,7 +25462,7 @@ function Dl({ styleDeclarationCb: n, mirror: e, ignoreCSSAttributes: i, styleshe
25462
25462
  const [g] = b;
25463
25463
  if (i.has(g))
25464
25464
  return a.apply(d, [g]);
25465
- const { id: f, styleId: y } = an((v = d.parentRule) === null || v === void 0 ? void 0 : v.parentStyleSheet, e, t.styleMirror);
25465
+ const { id: f, styleId: y } = rn((v = d.parentRule) === null || v === void 0 ? void 0 : v.parentStyleSheet, e, t.styleMirror);
25466
25466
  return (f && f !== -1 || y && y !== -1) && n({
25467
25467
  id: f,
25468
25468
  styleId: y,
@@ -26432,7 +26432,7 @@ function ti(n = {}) {
26432
26432
  if (we && !e)
26433
26433
  throw new Error("emit function is required");
26434
26434
  T !== void 0 && A.mousemove === void 0 && (A.mousemove = T), Re.reset();
26435
- const tn = g === !0 ? {
26435
+ const sn = g === !0 ? {
26436
26436
  color: !0,
26437
26437
  date: !0,
26438
26438
  "datetime-local": !0,
@@ -26462,7 +26462,7 @@ function ti(n = {}) {
26462
26462
  headMetaDescKeywords: y === "all"
26463
26463
  } : y || {};
26464
26464
  Sl();
26465
- let pn, sn = 0;
26465
+ let pn, on = 0;
26466
26466
  const Te = (B) => {
26467
26467
  for (const de of V || [])
26468
26468
  de.eventProcessor && (B = de.eventProcessor(B));
@@ -26482,12 +26482,12 @@ function ti(n = {}) {
26482
26482
  window.parent.postMessage(ue, "*");
26483
26483
  }
26484
26484
  if (B.type === W.FullSnapshot)
26485
- pn = B, sn = 0;
26485
+ pn = B, on = 0;
26486
26486
  else if (B.type === W.IncrementalSnapshot) {
26487
26487
  if (B.data.source === q.Mutation && B.data.isAttachIframe)
26488
26488
  return;
26489
- sn++;
26490
- const ue = t && sn >= t, Pe = i && B.timestamp - pn.timestamp > i;
26489
+ on++;
26490
+ const ue = t && on >= t, Pe = i && B.timestamp - pn.timestamp > i;
26491
26491
  (ue || Pe) && Ci(!0);
26492
26492
  }
26493
26493
  };
@@ -26541,7 +26541,7 @@ function ti(n = {}) {
26541
26541
  maskTextClass: d,
26542
26542
  maskTextSelector: b,
26543
26543
  inlineStylesheet: v,
26544
- maskInputOptions: tn,
26544
+ maskInputOptions: sn,
26545
26545
  dataURLOptions: _,
26546
26546
  maskTextFn: C,
26547
26547
  maskInputFn: k,
@@ -26575,7 +26575,7 @@ function ti(n = {}) {
26575
26575
  maskTextClass: d,
26576
26576
  maskTextSelector: b,
26577
26577
  inlineStylesheet: v,
26578
- maskAllInputs: tn,
26578
+ maskAllInputs: sn,
26579
26579
  maskTextFn: C,
26580
26580
  slimDOM: We,
26581
26581
  dataURLOptions: _,
@@ -26607,10 +26607,10 @@ function ti(n = {}) {
26607
26607
  var Pe;
26608
26608
  return z(Kl)({
26609
26609
  mutationCb: Ze,
26610
- mousemoveCb: (J, on) => re(me({
26610
+ mousemoveCb: (J, an) => re(me({
26611
26611
  type: W.IncrementalSnapshot,
26612
26612
  data: {
26613
- source: on,
26613
+ source: an,
26614
26614
  positions: J
26615
26615
  }
26616
26616
  })),
@@ -26661,7 +26661,7 @@ function ti(n = {}) {
26661
26661
  ignoreSelector: l,
26662
26662
  maskTextClass: d,
26663
26663
  maskTextSelector: b,
26664
- maskInputOptions: tn,
26664
+ maskInputOptions: sn,
26665
26665
  inlineStylesheet: v,
26666
26666
  sampling: A,
26667
26667
  recordDOM: I,
@@ -26686,11 +26686,11 @@ function ti(n = {}) {
26686
26686
  plugins: ((Pe = V == null ? void 0 : V.filter((J) => J.observer)) === null || Pe === void 0 ? void 0 : Pe.map((J) => ({
26687
26687
  observer: J.observer,
26688
26688
  options: J.options,
26689
- callback: (on) => re(me({
26689
+ callback: (an) => re(me({
26690
26690
  type: W.Plugin,
26691
26691
  data: {
26692
26692
  plugin: J.name,
26693
- payload: on
26693
+ payload: an
26694
26694
  }
26695
26695
  }))
26696
26696
  }))) || []
@@ -26762,7 +26762,7 @@ if (typeof window > "u") {
26762
26762
  };
26763
26763
  } else
26764
26764
  R = window;
26765
- var Zn = 24 * 60 * 60 * 1e3, tt = 8 * 1e3, Oi = Array.prototype, od = Function.prototype, io = Object.prototype, ln = Oi.slice, si = io.toString, Ui = io.hasOwnProperty, he = R.console, dn = R.navigator, ee = R.document, pi = R.opera, Ti = R.screen, Fe = dn.userAgent, st = od.bind, hs = Oi.forEach, ms = Oi.indexOf, vs = Oi.map, ad = Array.isArray, ct = {}, m = {
26765
+ var Zn = 24 * 60 * 60 * 1e3, tt = 8 * 1e3, Oi = Array.prototype, od = Function.prototype, io = Object.prototype, dn = Oi.slice, si = io.toString, Ui = io.hasOwnProperty, he = R.console, un = R.navigator, ee = R.document, pi = R.opera, Ti = R.screen, Fe = un.userAgent, st = od.bind, hs = Oi.forEach, ms = Oi.indexOf, vs = Oi.map, ad = Array.isArray, ct = {}, m = {
26766
26766
  trim: function(n) {
26767
26767
  return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
26768
26768
  }
@@ -26831,17 +26831,17 @@ var Zn = 24 * 60 * 60 * 1e3, tt = 8 * 1e3, Oi = Array.prototype, od = Function.p
26831
26831
  m.bind = function(n, e) {
26832
26832
  var i, t;
26833
26833
  if (st && n.bind === st)
26834
- return st.apply(n, ln.call(arguments, 1));
26834
+ return st.apply(n, dn.call(arguments, 1));
26835
26835
  if (!m.isFunction(n))
26836
26836
  throw new TypeError();
26837
- return i = ln.call(arguments, 2), t = function() {
26837
+ return i = dn.call(arguments, 2), t = function() {
26838
26838
  if (!(this instanceof t))
26839
- return n.apply(e, i.concat(ln.call(arguments)));
26839
+ return n.apply(e, i.concat(dn.call(arguments)));
26840
26840
  var s = {};
26841
26841
  s.prototype = n.prototype;
26842
26842
  var o = new s();
26843
26843
  s.prototype = null;
26844
- var a = n.apply(o, i.concat(ln.call(arguments)));
26844
+ var a = n.apply(o, i.concat(dn.call(arguments)));
26845
26845
  return Object(a) === a ? a : o;
26846
26846
  }, t;
26847
26847
  };
@@ -26860,7 +26860,7 @@ m.each = function(n, e, i) {
26860
26860
  }
26861
26861
  };
26862
26862
  m.extend = function(n) {
26863
- return m.each(ln.call(arguments, 1), function(e) {
26863
+ return m.each(dn.call(arguments, 1), function(e) {
26864
26864
  for (var i in e)
26865
26865
  e[i] !== void 0 && (n[i] = e[i]);
26866
26866
  }), n;
@@ -26879,7 +26879,7 @@ m.isArguments = function(n) {
26879
26879
  return !!(n && Ui.call(n, "callee"));
26880
26880
  };
26881
26881
  m.toArray = function(n) {
26882
- return n ? n.toArray ? n.toArray() : m.isArray(n) || m.isArguments(n) ? ln.call(n) : m.values(n) : [];
26882
+ return n ? n.toArray ? n.toArray() : m.isArray(n) || m.isArguments(n) ? dn.call(n) : m.values(n) : [];
26883
26883
  };
26884
26884
  m.map = function(n, e, i) {
26885
26885
  if (vs && n.map === vs)
@@ -27545,13 +27545,13 @@ m.info = {
27545
27545
  properties: function(n) {
27546
27546
  return typeof n != "object" && (n = {}), m.extend(m.strip_empty_properties({
27547
27547
  $os: m.info.os(),
27548
- $browser: m.info.browser(Fe, dn.vendor, pi),
27548
+ $browser: m.info.browser(Fe, un.vendor, pi),
27549
27549
  $referrer: ee.referrer,
27550
27550
  $referring_domain: m.info.referringDomain(ee.referrer),
27551
27551
  $device: m.info.device(Fe)
27552
27552
  }), {
27553
27553
  $current_url: m.info.currentUrl(),
27554
- $browser_version: m.info.browserVersion(Fe, dn.vendor, pi),
27554
+ $browser_version: m.info.browserVersion(Fe, un.vendor, pi),
27555
27555
  $screen_height: Ti.height,
27556
27556
  $screen_width: Ti.width,
27557
27557
  mp_lib: "web",
@@ -27564,9 +27564,9 @@ m.info = {
27564
27564
  people_properties: function() {
27565
27565
  return m.extend(m.strip_empty_properties({
27566
27566
  $os: m.info.os(),
27567
- $browser: m.info.browser(Fe, dn.vendor, pi)
27567
+ $browser: m.info.browser(Fe, un.vendor, pi)
27568
27568
  }), {
27569
- $browser_version: m.info.browserVersion(Fe, dn.vendor, pi)
27569
+ $browser_version: m.info.browserVersion(Fe, un.vendor, pi)
27570
27570
  });
27571
27571
  },
27572
27572
  mpPageViewProperties: function() {
@@ -28142,18 +28142,18 @@ Ke.prototype.reportError = function(n, e) {
28142
28142
  }
28143
28143
  };
28144
28144
  R.__mp_recorder = Ke;
28145
- var nn = function() {
28145
+ var tn = function() {
28146
28146
  };
28147
- nn.prototype.create_properties = function() {
28147
+ tn.prototype.create_properties = function() {
28148
28148
  };
28149
- nn.prototype.event_handler = function() {
28149
+ tn.prototype.event_handler = function() {
28150
28150
  };
28151
- nn.prototype.after_track_handler = function() {
28151
+ tn.prototype.after_track_handler = function() {
28152
28152
  };
28153
- nn.prototype.init = function(n) {
28153
+ tn.prototype.init = function(n) {
28154
28154
  return this.mp = n, this;
28155
28155
  };
28156
- nn.prototype.track = function(n, e, i, t) {
28156
+ tn.prototype.track = function(n, e, i, t) {
28157
28157
  var s = this, o = m.dom_query(n);
28158
28158
  if (o.length === 0) {
28159
28159
  $.error("The DOM query (" + n + ") returned 0 elements");
@@ -28166,21 +28166,21 @@ nn.prototype.track = function(n, e, i, t) {
28166
28166
  });
28167
28167
  }, this), !0;
28168
28168
  };
28169
- nn.prototype.track_callback = function(n, e, i, t) {
28169
+ tn.prototype.track_callback = function(n, e, i, t) {
28170
28170
  t = t || !1;
28171
28171
  var s = this;
28172
28172
  return function() {
28173
28173
  i.callback_fired || (i.callback_fired = !0, !(n && n(t, e) === !1) && s.after_track_handler(e, i, t));
28174
28174
  };
28175
28175
  };
28176
- nn.prototype.create_properties = function(n, e) {
28176
+ tn.prototype.create_properties = function(n, e) {
28177
28177
  var i;
28178
28178
  return typeof n == "function" ? i = n(e) : i = m.extend({}, n), i;
28179
28179
  };
28180
28180
  var Hn = function() {
28181
28181
  this.override_event = "click";
28182
28182
  };
28183
- m.inherit(Hn, nn);
28183
+ m.inherit(Hn, tn);
28184
28184
  Hn.prototype.create_properties = function(n, e) {
28185
28185
  var i = Hn.superclass.create_properties.apply(this, arguments);
28186
28186
  return e.href && (i.url = e.href), i;
@@ -28196,7 +28196,7 @@ Hn.prototype.after_track_handler = function(n, e) {
28196
28196
  var Ki = function() {
28197
28197
  this.override_event = "submit";
28198
28198
  };
28199
- m.inherit(Ki, nn);
28199
+ m.inherit(Ki, tn);
28200
28200
  Ki.prototype.event_handler = function(n, e, i) {
28201
28201
  i.element = e, n.preventDefault();
28202
28202
  };
@@ -28593,8 +28593,8 @@ var Lt, uo = function(n, e) {
28593
28593
  return n;
28594
28594
  }, ei = function() {
28595
28595
  }, Ne = "mixpanel", ho = "base64", xd = "json", xt = "$device:", Dn = R.XMLHttpRequest && "withCredentials" in new XMLHttpRequest(), mo = !Dn && Fe.indexOf("MSIE") === -1 && Fe.indexOf("Mozilla") === -1, Bi = null;
28596
- dn.sendBeacon && (Bi = function() {
28597
- return dn.sendBeacon.apply(dn, arguments);
28596
+ un.sendBeacon && (Bi = function() {
28597
+ return un.sendBeacon.apply(un, arguments);
28598
28598
  });
28599
28599
  var vo = {
28600
28600
  track: "track/",
@@ -29178,7 +29178,7 @@ L.prototype.get_config = function(n) {
29178
29178
  return this.config[n];
29179
29179
  };
29180
29180
  L.prototype._run_hook = function(n) {
29181
- var e = (this.config.hooks[n] || Ld).apply(this, ln.call(arguments, 1));
29181
+ var e = (this.config.hooks[n] || Ld).apply(this, dn.call(arguments, 1));
29182
29182
  return typeof e > "u" && (this.report_error(n + " hook did not return a value"), e = null), e;
29183
29183
  };
29184
29184
  L.prototype.get_property = function(n) {
@@ -29394,7 +29394,7 @@ class fo {
29394
29394
  "#goback-to-merchant"
29395
29395
  );
29396
29396
  e && e.addEventListener("click", () => {
29397
- cn(
29397
+ nn(
29398
29398
  this.paymentResponse,
29399
29399
  this.paymentResponseHeaders,
29400
29400
  this.callBackUrl
@@ -29484,7 +29484,7 @@ class Rd {
29484
29484
  }
29485
29485
  o += 1;
29486
29486
  try {
29487
- const v = await un(
29487
+ const v = await cn(
29488
29488
  e,
29489
29489
  this.ref,
29490
29490
  d,
@@ -29965,7 +29965,7 @@ class Hd {
29965
29965
  }
29966
29966
  async verifyPayment(e, i) {
29967
29967
  try {
29968
- const t = await un(
29968
+ const t = await cn(
29969
29969
  this.token,
29970
29970
  this.activeRef,
29971
29971
  void 0,
@@ -29983,7 +29983,7 @@ class Hd {
29983
29983
  }
29984
29984
  async verifyPaymentProcess() {
29985
29985
  try {
29986
- const e = await un(
29986
+ const e = await cn(
29987
29987
  this.token,
29988
29988
  this.reference,
29989
29989
  void 0,
@@ -30704,7 +30704,7 @@ var go = { exports: {} };
30704
30704
  }, ze = window.btoa || function(c) {
30705
30705
  return c.replace(/[\s\S]{1,3}/g, we);
30706
30706
  };
30707
- class tn {
30707
+ class sn {
30708
30708
  constructor(r, u, p, S) {
30709
30709
  this.clear = u, this.timer = r(() => {
30710
30710
  this.timer && (this.timer = S(this.timer));
@@ -30717,11 +30717,11 @@ var go = { exports: {} };
30717
30717
  this.timer && (this.clear(this.timer), this.timer = null);
30718
30718
  }
30719
30719
  }
30720
- var We = tn;
30720
+ var We = sn;
30721
30721
  function pn(c) {
30722
30722
  window.clearTimeout(c);
30723
30723
  }
30724
- function sn(c) {
30724
+ function on(c) {
30725
30725
  window.clearInterval(c);
30726
30726
  }
30727
30727
  class Te extends We {
@@ -30733,7 +30733,7 @@ var go = { exports: {} };
30733
30733
  }
30734
30734
  class Ze extends We {
30735
30735
  constructor(r, u) {
30736
- super(setInterval, sn, r, function(p) {
30736
+ super(setInterval, on, r, function(p) {
30737
30737
  return u(), p;
30738
30738
  });
30739
30739
  }
@@ -30821,7 +30821,7 @@ var go = { exports: {} };
30821
30821
  (r && r(p, S, c, u) || p) && (u[S] = p);
30822
30822
  }), u;
30823
30823
  }
30824
- function on(c) {
30824
+ function an(c) {
30825
30825
  var r = [];
30826
30826
  return Ce(c, function(u, p) {
30827
30827
  r.push([p, u]);
@@ -30847,7 +30847,7 @@ var go = { exports: {} };
30847
30847
  function ri(c) {
30848
30848
  var r = J(c, function(p) {
30849
30849
  return p !== void 0;
30850
- }), u = Y(on(ai(r)), ae.method("join", "=")).join("&");
30850
+ }), u = Y(an(ai(r)), ae.method("join", "=")).join("&");
30851
30851
  return u;
30852
30852
  }
30853
30853
  function li(c) {
@@ -33155,15 +33155,12 @@ class Gd {
33155
33155
  this.abortController && (l = this.abortController.signal);
33156
33156
  const d = async () => {
33157
33157
  if (this.timeLeft <= 0) {
33158
- a = !1, this.onAction(8), P.track("verify_payment", {
33159
- payment_method: "Transfer",
33160
- verification_status: "In Progress"
33161
- });
33158
+ a = !1, this.onAction(8);
33162
33159
  return;
33163
33160
  }
33164
33161
  s += 1;
33165
33162
  try {
33166
- const b = await un(
33163
+ const b = await cn(
33167
33164
  e,
33168
33165
  this.ref,
33169
33166
  l,
@@ -33314,9 +33311,7 @@ class zd {
33314
33311
  h(this, "isMobile", !1);
33315
33312
  this.currency = l, this.container = s, this.contents = this.container.querySelector(
33316
33313
  "#payment-content-view"
33317
- ), this.closeModal = t, this.token = a, this.email = o, this.amount = e, this.totalAmount = i, this.rdtCode = d, this.url = b, this.reference = v, this._currentStep = 1, this.callBackUrl = g, this.metadata = f, this.localCurrency = y, this.disablePaymentMethods = k, this.paymentResponse = {}, this.paymentResponseHeaders = {}, this.restartTransactionProcess = C, this.hidePaymentMethods = w, this.retryingPayment = M, this.isMaxRetriesReached = !1, this.renderTransferContent(), this.paymentResponse = {}, this.activeRef = "", this.timerId = null, this.mainLoader = new Be(this.contents), P.track("transfer_opens", {
33318
- payment_method: "Transfer"
33319
- }), this.mainLoader.mountLoader("25dvh"), this.currentStep === 1 && (this.abortController = new AbortController(), this.createTransfer()), this.isMobile = window.matchMedia("(max-width: 767px)").matches;
33314
+ ), this.closeModal = t, this.token = a, this.email = o, this.amount = e, this.totalAmount = i, this.rdtCode = d, this.url = b, this.reference = v, this._currentStep = 1, this.callBackUrl = g, this.metadata = f, this.localCurrency = y, this.disablePaymentMethods = k, this.paymentResponse = {}, this.paymentResponseHeaders = {}, this.restartTransactionProcess = C, this.hidePaymentMethods = w, this.retryingPayment = M, this.isMaxRetriesReached = !1, this.renderTransferContent(), this.paymentResponse = {}, this.activeRef = "", this.timerId = null, this.mainLoader = new Be(this.contents), this.mainLoader.mountLoader("25dvh"), this.currentStep === 1 && (this.abortController = new AbortController(), this.createTransfer()), this.isMobile = window.matchMedia("(max-width: 767px)").matches;
33320
33315
  }
33321
33316
  get currentStep() {
33322
33317
  return this._currentStep;
@@ -33341,7 +33336,7 @@ class zd {
33341
33336
  }
33342
33337
  async verifyTransfer() {
33343
33338
  try {
33344
- const e = await un(
33339
+ const e = await cn(
33345
33340
  this.token,
33346
33341
  this.reference,
33347
33342
  void 0,
@@ -33356,7 +33351,7 @@ class zd {
33356
33351
  async createTransfer() {
33357
33352
  requestAnimationFrame(() => {
33358
33353
  const e = this.container.querySelector("#loader"), i = this.container.querySelector("#details-content");
33359
- i && (this.mainLoader = new Be(this.contents), this.mainLoader.mountLoader("25dvh"), i.classList.add("hidden")), P.track("start_transferProcess", {
33354
+ i && (this.mainLoader = new Be(this.contents), this.mainLoader.mountLoader("25dvh"), i.classList.add("hidden")), P.track("start_payment", {
33360
33355
  payment_method: "Transfer"
33361
33356
  }), (() => {
33362
33357
  var s, o;
@@ -33425,7 +33420,7 @@ class zd {
33425
33420
  });
33426
33421
  }
33427
33422
  goBackToMerchant() {
33428
- cn(
33423
+ nn(
33429
33424
  this.paymentResponse,
33430
33425
  this.paymentResponseHeaders,
33431
33426
  this.callBackUrl
@@ -34122,10 +34117,7 @@ class Co {
34122
34117
  validate() {
34123
34118
  let e;
34124
34119
  if (this.abortController ? e = this.abortController.signal : (this.abortController = new AbortController(), e = this.abortController.signal), this._retry_count <= 0) {
34125
- clearInterval(this.intervalPayment), this.currentStep = 3, P.track("verify_payment", {
34126
- payment_method: "USSD",
34127
- verification_status: "In Progress"
34128
- });
34120
+ clearInterval(this.intervalPayment), this.currentStep = 3;
34129
34121
  return;
34130
34122
  }
34131
34123
  this.paymentService.verifyPayment(this.activeRef, e || this.abortController.signal).then(({ data: i, headers: t }) => {
@@ -34431,7 +34423,7 @@ class su {
34431
34423
  });
34432
34424
  }
34433
34425
  renderComponent() {
34434
- var F, U, j, te, ge, V, ke, le, xe, we, ze, tn, We, pn, sn, Te, Ze, fn, ae, be, Ie, Ee, Ce, je, B, de, Y, ue, Pe, J, on, Kn, oi, ai, ri, li, gn;
34426
+ var F, U, j, te, ge, V, ke, le, xe, we, ze, sn, We, pn, on, Te, Ze, fn, ae, be, Ie, Ee, Ce, je, B, de, Y, ue, Pe, J, an, Kn, oi, ai, ri, li, gn;
34435
34427
  this.container.innerHTML = this.render(), this.amount = this.amount;
34436
34428
  const e = this.container.querySelector(
34437
34429
  "#merchant-logo-container"
@@ -34468,18 +34460,18 @@ class su {
34468
34460
  const jn = ((ze = (we = this.merchantDetail) == null ? void 0 : we.plan) == null ? void 0 : ze.title) || "";
34469
34461
  a.textContent = fi(jn);
34470
34462
  }
34471
- (tn = this.metadata) != null && tn.productName && (a.textContent = fi(
34463
+ (sn = this.metadata) != null && sn.productName && (a.textContent = fi(
34472
34464
  this.metadata.productName
34473
34465
  ));
34474
34466
  }
34475
- d && (this.currency === "USD" ? v && (v.innerHTML = `1 ${((pn = (We = this.merchantDetail) == null ? void 0 : We.rate) == null ? void 0 : pn.to) || "-"} = ${((Te = (sn = this.merchantDetail) == null ? void 0 : sn.rate) == null ? void 0 : Te.from) || "-"} ${Le(
34467
+ d && (this.currency === "USD" ? v && (v.innerHTML = `1 ${((pn = (We = this.merchantDetail) == null ? void 0 : We.rate) == null ? void 0 : pn.to) || "-"} = ${((Te = (on = this.merchantDetail) == null ? void 0 : on.rate) == null ? void 0 : Te.from) || "-"} ${Le(
34476
34468
  ((Ze = this.merchantDetail.rate) == null ? void 0 : Ze.rate) || 1,
34477
34469
  2
34478
34470
  )} `) : d.innerHTML = ""), b && (this.currency === "USD" ? g && (g.innerHTML = `1 ${((ae = (fn = this.merchantDetail) == null ? void 0 : fn.rate) == null ? void 0 : ae.to) || "-"} = ${((Ie = (be = this.merchantDetail) == null ? void 0 : be.rate) == null ? void 0 : Ie.from) || "-"} ${Le(
34479
34471
  ((Ee = this.merchantDetail.rate) == null ? void 0 : Ee.rate) || 1,
34480
34472
  2
34481
34473
  )} `) : b.innerHTML = ""), (je = (Ce = this.merchantDetail) == null ? void 0 : Ce.plan) != null && je.title || (B = this.metadata) != null && B.productName ? f && (f.innerHTML = `${this.currency} ${Le(this.amount, 2)}`) : (k && (k.innerHTML = `<span> ${this.currency} ${Le(this.amount, 2)} </span>`), o && a && (o.remove(), a == null || a.remove()), this.localCurrency ? f == null || f.remove() : l && l.remove()), y && (y.innerHTML = `${this.currency} ${Le(this.amount, 2)}`), C && (this.localCurrency && this.localCurrency !== this.currency ? C.children[1].innerHTML = `${this.localCurrency} ${Le(this.amount * (((Y = (de = this.merchantDetail) == null ? void 0 : de.rate) == null ? void 0 : Y.rate) || 1), 2)}` : C.remove()), w && (this.localCurrency && this.localCurrency !== this.currency ? w.children[1].innerHTML = `${this.localCurrency} ${Le(this.amount * (((Pe = (ue = this.merchantDetail) == null ? void 0 : ue.rate) == null ? void 0 : Pe.rate) || 1), 2)}` : w.remove());
34482
- const I = this.localCurrency !== this.currency ? this.amount * (((on = (J = this.merchantDetail) == null ? void 0 : J.rate) == null ? void 0 : on.rate) || 1) : this.amount;
34474
+ const I = this.localCurrency !== this.currency ? this.amount * (((an = (J = this.merchantDetail) == null ? void 0 : J.rate) == null ? void 0 : an.rate) || 1) : this.amount;
34483
34475
  M && (Kn = this.merchantDetail) != null && Kn.taxQuoteId && (oi = this.merchantDetail) != null && oi.totalAmount && (M.classList.remove("hidden"), M.children[1].innerHTML = `${this.localCurrency !== this.currency ? this.localCurrency : this.currency} ${Le(((ai = this.merchantDetail) == null ? void 0 : ai.totalAmount) - I, 2)}`), A && (ri = this.merchantDetail) != null && ri.taxQuoteId && (li = this.merchantDetail) != null && li.totalAmount && (A.classList.remove("hidden"), A.children[1].innerHTML = `${this.localCurrency !== this.currency ? this.localCurrency : this.currency} ${Le(((gn = this.merchantDetail) == null ? void 0 : gn.totalAmount) - I, 2)}`);
34484
34476
  const K = eu[this.localCurrency];
34485
34477
  _ && this.localCurrency && (_.innerHTML = K ? `${K} (${this.localCurrency})` : this.localCurrency), T && this.localCurrency && (T.innerHTML = K ? `${K} (${this.localCurrency})` : this.localCurrency), this.renderPaymentOptions(this.container), this.attachListeners();
@@ -34560,7 +34552,7 @@ class su {
34560
34552
  const ou = `<div class="flex items-center justify-center md:justify-between w-full text-xxs mt-5">
34561
34553
  <div class="text-tone-60"><span>Powered by</span> <span class="font-bold">Spotflow</span></div>
34562
34554
  <div class="align-center text-tone-60 hidden md:flex gap-4">
34563
- <!-- <span id="test-cards-link" class="hover:font-bold">Test Cards</span> -->
34555
+ <span id="test-cards-link" class="hover:font-bold">Test Cards</span>
34564
34556
  <a href="https://ribbon-scowl-35f.notion.site/Terms-Conditions-940742f0a1b144498ffc1786c5bc6a08?pvs=4" target="_blank" class="hover:font-bold">Terms</a>
34565
34557
  <a href="https://ribbon-scowl-35f.notion.site/Privacy-Policy-Spotflow-3997ee8d923d4cd39a3dc43b7249b713" target="_blank" class="hover:font-bold">Privacy</a>
34566
34558
  <a href="mailto:hello@spotflow.one" class="hover:font-bold">Contact</a>
@@ -35046,7 +35038,7 @@ class du {
35046
35038
  }
35047
35039
  o += 1;
35048
35040
  try {
35049
- const v = await un(
35041
+ const v = await cn(
35050
35042
  e,
35051
35043
  this.ref,
35052
35044
  d,
@@ -35056,10 +35048,7 @@ class du {
35056
35048
  v.data.status === "failed" && (l = !1, clearTimeout(this.timer), clearInterval(this.timerId || void 0), this.setPaymentResponses(v.data, v.headers), P.track("verify_payment", {
35057
35049
  payment_method: "Mobile Money",
35058
35050
  verification_status: "Failed"
35059
- }), s(v)), v.data.status === "inProgress" && (l && (a = i * (o + 1), this.timer = setTimeout(b, a)), this.setPaymentResponses(v.data, v.headers), P.track("verify_payment", {
35060
- payment_method: "Mobile Money",
35061
- verification_status: "In Progress"
35062
- })), (v.data.status === "success" || v.data.status === "successful") && (this.setPaymentResponses(v.data, v.headers), l = !1, clearTimeout(this.timer), clearInterval(this.timerId || void 0), P.track("verify_payment", {
35051
+ }), s(v)), v.data.status === "inProgress" && (l && (a = i * (o + 1), this.timer = setTimeout(b, a)), this.setPaymentResponses(v.data, v.headers)), (v.data.status === "success" || v.data.status === "successful") && (this.setPaymentResponses(v.data, v.headers), l = !1, clearTimeout(this.timer), clearInterval(this.timerId || void 0), P.track("verify_payment", {
35063
35052
  payment_method: "Mobile Money",
35064
35053
  verification_status: "Success"
35065
35054
  }), t(v));
@@ -35371,7 +35360,7 @@ class vu {
35371
35360
  ".details-form-button"
35372
35361
  );
35373
35362
  e && e.addEventListener("click", () => {
35374
- cn(
35363
+ nn(
35375
35364
  this.paymentResponse,
35376
35365
  this.paymentResponseHeaders,
35377
35366
  this.callBackUrl
@@ -35520,6 +35509,12 @@ class bu {
35520
35509
  verification_status: "Failed"
35521
35510
  });
35522
35511
  return;
35512
+ } else if (a.status === "success" || a.status === "successful") {
35513
+ this.currentStep = 4, P.track("start_payment", {
35514
+ payment_method: "Mobile Money",
35515
+ verification_status: "Success"
35516
+ }), nn(a, l, a == null ? void 0 : a.callBackUrl);
35517
+ return;
35523
35518
  } else if (((d = a == null ? void 0 : a.authorization) == null ? void 0 : d.mode) === "otp") {
35524
35519
  this.activeRef = a.reference, this.currentStep = 6;
35525
35520
  return;
@@ -35568,14 +35563,18 @@ class bu {
35568
35563
  authentication_type: "OTP"
35569
35564
  });
35570
35565
  const d = this.container.querySelector("#otp-error");
35571
- l.code === "invalid_otp" ? d && (d.innerHTML = l.message) : this.currentStep = 3;
35566
+ l.code === "invalid_otp" ? (d && (d.innerHTML = l.message), P.track("verify_payment", {
35567
+ payment_method: "Mobile Money",
35568
+ verification_status: "Failed",
35569
+ authentication_type: "OTP"
35570
+ })) : this.currentStep = 3;
35572
35571
  }).finally(() => {
35573
35572
  t && s && (t.classList.add("hidden"), s.classList.remove("hidden"));
35574
35573
  });
35575
35574
  }
35576
35575
  async verifyPaymentProcess() {
35577
35576
  try {
35578
- const e = await un(
35577
+ const e = await cn(
35579
35578
  this.token,
35580
35579
  this.reference,
35581
35580
  void 0,
@@ -35588,7 +35587,7 @@ class bu {
35588
35587
  }
35589
35588
  }
35590
35589
  goBackToMerchant() {
35591
- cn(
35590
+ nn(
35592
35591
  this.paymentResponse,
35593
35592
  this.paymentResponseHeaders,
35594
35593
  this.callBackUrl
@@ -35840,7 +35839,7 @@ class fu {
35840
35839
  i && (i.textContent = e);
35841
35840
  }
35842
35841
  goBackToMerchant() {
35843
- cn(
35842
+ nn(
35844
35843
  this.paymentResponse,
35845
35844
  this.paymentResponseHeaders,
35846
35845
  this.callBackUrl
@@ -35925,7 +35924,7 @@ class fu {
35925
35924
  }
35926
35925
  async verifyPaymentProcess() {
35927
35926
  try {
35928
- const e = await un(
35927
+ const e = await cn(
35929
35928
  this.token,
35930
35929
  this.reference,
35931
35930
  void 0,
@@ -35937,7 +35936,7 @@ class fu {
35937
35936
  i === "successful" ? (this.currentStep = 2, P.track("verify_payment", {
35938
35937
  payment_method: "EFT",
35939
35938
  verification_status: "Success"
35940
- }), cn(
35939
+ }), nn(
35941
35940
  this.paymentResponse,
35942
35941
  this.paymentResponseHeaders,
35943
35942
  "success"