@fundly.ai/payment-sdk 1.4.0-beta.4 → 1.4.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -12,12 +12,12 @@ var nf = (l, e, t, i) => ({
12
12
  }
13
13
  });
14
14
  import { jsxs as b, Fragment as ei, jsx as h } from "react/jsx-runtime";
15
- import Ki, { useRef as Bt, useEffect as Ve, createContext as Ro, useState as K, useMemo as ji, useContext as zo, useCallback as xi, useReducer as Rg, forwardRef as zg, useImperativeHandle as Ug, useLayoutEffect as Hg } from "react";
15
+ import Ki, { useRef as Bt, useEffect as Ge, createContext as Ro, useState as K, useMemo as ji, useContext as zo, useCallback as xi, useReducer as Rg, forwardRef as zg, useImperativeHandle as Ug, useLayoutEffect as Hg } from "react";
16
16
  import { DotLottieReact as Yg } from "@lottiefiles/dotlottie-react";
17
17
  import { createPortal as Qg } from "react-dom";
18
18
  const en = ({ open: l, onClose: e, children: t }) => {
19
19
  const i = Bt(null);
20
- Ve(() => {
20
+ Ge(() => {
21
21
  const s = (r) => {
22
22
  r.key === "Escape" && l && e();
23
23
  };
@@ -76,7 +76,7 @@ const en = ({ open: l, onClose: e, children: t }) => {
76
76
  )
77
77
  ] }) : null;
78
78
  }, _i = ({ open: l, onClose: e, title: t, children: i, actions: n }) => {
79
- Ve(() => {
79
+ Ge(() => {
80
80
  const r = (o) => {
81
81
  o.key === "Escape" && l && e();
82
82
  };
@@ -318,7 +318,7 @@ function Kg() {
318
318
  return "".concat(r, "//").concat(this.finalTargetDomain, "/e?r=1");
319
319
  }
320
320
  }
321
- const S = new RegExp(`^\\s+|\\.|:|\\$|'|"|\\\\|\\s+$`, "g"), C = new RegExp(`^\\s+|'|"|\\\\|\\s+$`, "g"), L = new RegExp("'", "g"), N = "clear", j = "Charged ID", z = "WZRK_CHARGED_ID", F = "WZRK_G", H = "WZRK_K", Q = "WZRK_CAMP", V = "WZRK_CAMP_G", _ = "WZRK_S", q = 1200, $ = "WZRK_EV", se = "WZRK_META", de = "WZRK_PR", fe = "WZRK_ACCOUNT_ID", ue = "WZRK_ARP", ce = "WZRK_L", le = "global", ee = "display", me = "WZRK_WPR", we = "optOut", ke = "ct_optout", ye = ":OO", De = "useIP", Be = "WZRK_X", ze = 100, We = "isOUL", be = "push", he = "ping", Ee = 86400 * 365, Ge = 200, dt = 120 * 1e3, Re = 300 * 1e3, Ne = "2", Pe = "cUsY", Oe = "wzrk_", je = "wzrk_id", Ue = "Notification Viewed", re = "Notification Clicked", pe = "WZRK_FPU", He = "WZRK_PSD", Ye = "$incr", tt = "$decr", yt = "$set", nt = "$add", St = "$remove", mt = "$delete", ft = "WZRK_INBOX_CONFIG", jt = "WZRK_INBOX", ct = 15, Qe = "WZRK_PE", bt = 1e3, Et = 1e3 * 60 * 10, Pt = "wzrk_fetch", Tt = "WZRK_PUSH_CONFIG", Ct = "WZRK_APPLICATION_SERVER_KEY_RECIEVED", st = "WZRK_WEB_PUSH_CONFIG_RECEIVED", Ie = "WZRK_NOTIFICATION_PUSH_DEFERRED", Ze = "vapid_migration_prompt_shown", qe = "notif_last_time", vt = 300, Ot = "wzrk_wrapper", Jt = "pnWrapper", bn = "WZRK_POPUP_LOADING", pn = "ctCustomHtmlPreview", Fi = "ctWebPopupPreview", Zn = "WZRK_QC", ai = "_w_", Xt = "WZRK_BLOCK", jn = "WZRK_ISOLATE_SD", Ft = {
321
+ const S = new RegExp(`^\\s+|\\.|:|\\$|'|"|\\\\|\\s+$`, "g"), C = new RegExp(`^\\s+|'|"|\\\\|\\s+$`, "g"), L = new RegExp("'", "g"), N = "clear", j = "Charged ID", z = "WZRK_CHARGED_ID", F = "WZRK_G", H = "WZRK_K", Q = "WZRK_CAMP", V = "WZRK_CAMP_G", _ = "WZRK_S", q = 1200, $ = "WZRK_EV", se = "WZRK_META", de = "WZRK_PR", fe = "WZRK_ACCOUNT_ID", ue = "WZRK_ARP", ce = "WZRK_L", le = "global", ee = "display", me = "WZRK_WPR", we = "optOut", ke = "ct_optout", ye = ":OO", De = "useIP", Be = "WZRK_X", ze = 100, We = "isOUL", be = "push", he = "ping", Ee = 86400 * 365, Ve = 200, dt = 120 * 1e3, Re = 300 * 1e3, Ne = "2", Pe = "cUsY", Oe = "wzrk_", je = "wzrk_id", Ue = "Notification Viewed", re = "Notification Clicked", pe = "WZRK_FPU", He = "WZRK_PSD", Ye = "$incr", tt = "$decr", yt = "$set", nt = "$add", St = "$remove", mt = "$delete", ft = "WZRK_INBOX_CONFIG", jt = "WZRK_INBOX", ct = 15, Qe = "WZRK_PE", bt = 1e3, Et = 1e3 * 60 * 10, Pt = "wzrk_fetch", Tt = "WZRK_PUSH_CONFIG", Ct = "WZRK_APPLICATION_SERVER_KEY_RECIEVED", st = "WZRK_WEB_PUSH_CONFIG_RECEIVED", Ie = "WZRK_NOTIFICATION_PUSH_DEFERRED", Ze = "vapid_migration_prompt_shown", qe = "notif_last_time", vt = 300, Ot = "wzrk_wrapper", Jt = "pnWrapper", bn = "WZRK_POPUP_LOADING", pn = "ctCustomHtmlPreview", Fi = "ctWebPopupPreview", Zn = "WZRK_QC", ai = "_w_", Xt = "WZRK_BLOCK", jn = "WZRK_ISOLATE_SD", Ft = {
322
322
  KV_PAIR: 1,
323
323
  BANNER: 2,
324
324
  CAROUSEL: 3,
@@ -4365,7 +4365,7 @@ function Kg() {
4365
4365
  !gi(this.device.gcookie) && Z.globalCache.RESP_N < Z.globalCache.REQ_N - 1 && setTimeout(() => {
4366
4366
  this.logger.debug("retrying fire request for url: ".concat(a, ", tries: ").concat(this.networkRetryCount)), n(this, Ts)[Ts](a, void 0, f, A);
4367
4367
  }, this.getDelayFrequency());
4368
- else if (!gi(this.device.gcookie) && Z.globalCache.RESP_N < Z.globalCache.REQ_N - 1 && c < Ge) {
4368
+ else if (!gi(this.device.gcookie) && Z.globalCache.RESP_N < Z.globalCache.REQ_N - 1 && c < Ve) {
4369
4369
  setTimeout(() => {
4370
4370
  this.logger.debug("retrying fire request for url: ".concat(a, ", tries: ").concat(c)), n(this, Ts)[Ts](a, c + 1, f, A);
4371
4371
  }, 50);
@@ -9716,7 +9716,7 @@ class eA {
9716
9716
  transactionDate: e.transactionDate || "",
9717
9717
  transactionDateFormatted: e.transactionDateFormatted || "",
9718
9718
  UserType: "Salesman"
9719
- }), e.uuid && (e.chemistName || e.leadId) && this.trackEventViaAPI(
9719
+ }), e.uuid && this.trackEventViaAPI(
9720
9720
  e.uuid,
9721
9721
  "Payment_Initiated",
9722
9722
  {
@@ -9892,7 +9892,7 @@ class eA {
9892
9892
  distributorName: e.distributorName || "",
9893
9893
  partyCode: e.partyCode || "",
9894
9894
  UserType: "Salesman"
9895
- }), e.uuid && (e.chemistName || e.leadId) && this.trackEventViaAPI(
9895
+ }), e.uuid && this.trackEventViaAPI(
9896
9896
  e.uuid,
9897
9897
  "Payment_Link_Generated",
9898
9898
  {
@@ -9964,7 +9964,7 @@ class eA {
9964
9964
  distributorName: e.distributorName || "",
9965
9965
  partyCode: e.partyCode || "",
9966
9966
  UserType: "Salesman"
9967
- }), e.uuid && (e.chemistName || e.leadId) && this.trackEventViaAPI(
9967
+ }), e.uuid && this.trackEventViaAPI(
9968
9968
  e.uuid,
9969
9969
  "Payment_QR_Generated",
9970
9970
  {
@@ -10040,7 +10040,7 @@ class eA {
10040
10040
  partyCode: e.partyCode || "",
10041
10041
  upiTxnRefNo: e.upiTxnRefNo || "",
10042
10042
  UserType: "Salesman"
10043
- }), e.uuid && (e.chemistName || e.leadId) && this.trackEventViaAPI(
10043
+ }), e.uuid && this.trackEventViaAPI(
10044
10044
  e.uuid,
10045
10045
  "Payment_Success",
10046
10046
  {
@@ -10119,7 +10119,7 @@ class eA {
10119
10119
  partyCode: e.partyCode || "",
10120
10120
  upiTxnRefNo: e.upiTxnRefNo || "",
10121
10121
  UserType: "Salesman"
10122
- }), e.uuid && (e.chemistName || e.leadId) && this.trackEventViaAPI(
10122
+ }), e.uuid && this.trackEventViaAPI(
10123
10123
  e.uuid,
10124
10124
  "Payment_Failed",
10125
10125
  {
@@ -10746,7 +10746,7 @@ function iA({ children: l, initialValues: e }) {
10746
10746
  e?.redirectionUrl || null
10747
10747
  ), [be, he] = K(
10748
10748
  e?.transactionId || null
10749
- ), [Ee, Ge] = K(
10749
+ ), [Ee, Ve] = K(
10750
10750
  e?.showResultOnly || !1
10751
10751
  ), [dt, Re] = K(
10752
10752
  e?.successButtonText || "Home"
@@ -10763,7 +10763,7 @@ function iA({ children: l, initialValues: e }) {
10763
10763
  ), [yt, nt] = K(
10764
10764
  e?.erpId || null
10765
10765
  ), [St, mt] = K(null);
10766
- if (Ve(() => {
10766
+ if (Ge(() => {
10767
10767
  const Qe = pl(), bt = ml();
10768
10768
  Qe && hn.configure({
10769
10769
  enabled: !0,
@@ -10772,13 +10772,13 @@ function iA({ children: l, initialValues: e }) {
10772
10772
  region: bt
10773
10773
  }
10774
10774
  });
10775
- }, []), Ve(() => {
10775
+ }, []), Ge(() => {
10776
10776
  const Qe = e?.source || w;
10777
10777
  Ut.setSource(Qe), Ut.setChannel(e?.channel || "FUNDLY"), Ut.setErpHeaders(
10778
10778
  e?.erpCode || null,
10779
10779
  e?.partnerSecretKey || null
10780
10780
  );
10781
- }, [w, e?.source, e?.channel, e?.erpCode, e?.partnerSecretKey]), Ve(() => {
10781
+ }, [w, e?.source, e?.channel, e?.erpCode, e?.partnerSecretKey]), Ge(() => {
10782
10782
  t && qf(t);
10783
10783
  }, [t]), (() => {
10784
10784
  const Qe = [];
@@ -10856,7 +10856,7 @@ function iA({ children: l, initialValues: e }) {
10856
10856
  transactionId: be,
10857
10857
  setTransactionId: he,
10858
10858
  showResultOnly: Ee,
10859
- setShowResultOnly: Ge,
10859
+ setShowResultOnly: Ve,
10860
10860
  successButtonText: dt,
10861
10861
  setSuccessButtonText: Re,
10862
10862
  failureButtonText: Ne,
@@ -12980,7 +12980,7 @@ const au = ({
12980
12980
  return _($), null;
12981
12981
  }
12982
12982
  }, [V, _] = K("");
12983
- return Ve(() => {
12983
+ return Ge(() => {
12984
12984
  l || (C(!1), N("Submit"), y(!1));
12985
12985
  }, [l]), /* @__PURE__ */ b(en, { open: l, onClose: g, children: [
12986
12986
  /* @__PURE__ */ b(
@@ -13228,7 +13228,7 @@ const au = ({
13228
13228
  className: u
13229
13229
  }) => {
13230
13230
  const [m, g] = K("");
13231
- Ve(() => {
13231
+ Ge(() => {
13232
13232
  if (l) {
13233
13233
  const L = l.getFullYear(), N = String(l.getMonth() + 1).padStart(2, "0"), j = String(l.getDate()).padStart(2, "0");
13234
13234
  g(`${L}-${N}-${j}`);
@@ -13406,7 +13406,7 @@ const au = ({
13406
13406
  }
13407
13407
  }, re.trim() ? 300 : 0);
13408
13408
  }, []);
13409
- Ve(() => {
13409
+ Ge(() => {
13410
13410
  const re = (pe) => {
13411
13411
  Be.current && !Be.current.contains(pe.target) && ke(!1);
13412
13412
  };
@@ -13481,7 +13481,7 @@ const au = ({
13481
13481
  } finally {
13482
13482
  de(!1);
13483
13483
  }
13484
- }, [Ge, dt] = K(!1), [Re, Ne] = K(""), [Pe, Oe] = K(""), [je, Ue] = K(null);
13484
+ }, [Ve, dt] = K(!1), [Re, Ne] = K(""), [Pe, Oe] = K(""), [je, Ue] = K(null);
13485
13485
  return Ki.useEffect(() => {
13486
13486
  l || (y(null), C(null), j(""), ue(""), le(""), me([]), ke(!1), F(!1), Q(!1), _(!1), $("Submit"), dt(!1), Ne(""), Oe(""), de(!1));
13487
13487
  }, [l]), Ki.useEffect(() => {
@@ -13970,7 +13970,7 @@ const au = ({
13970
13970
  /* @__PURE__ */ b(
13971
13971
  _i,
13972
13972
  {
13973
- open: Ge,
13973
+ open: Ve,
13974
13974
  onClose: () => dt(!1),
13975
13975
  children: [
13976
13976
  /* @__PURE__ */ h($i, { children: /* @__PURE__ */ b("div", { className: "fp:w-full fp:flex fp:flex-col fp:justify-center fp:items-center fp:space-y-1", children: [
@@ -20183,8 +20183,8 @@ class qc {
20183
20183
  _ && (Q = u), q && (V = m);
20184
20184
  const ke = this.getSizeAndScale(Q, this.ctx.canvas.width, F), ye = this.getSizeAndScale(V, this.ctx.canvas.height, H), De = ke.size, Be = ye.size, ze = e.cachedCanvases.getCanvas("pattern-workaround", De, Be), We = ze.context, be = _ ? Math.floor(C / u) : 0, he = q ? Math.floor(L / m) : 0;
20185
20185
  for (let Ee = 0; Ee <= be; Ee++)
20186
- for (let Ge = 0; Ge <= he; Ge++)
20187
- We.drawImage(we, De * Ee, Be * Ge, De, Be, 0, 0, De, Be);
20186
+ for (let Ve = 0; Ve <= he; Ve++)
20187
+ We.drawImage(we, De * Ee, Be * Ve, De, Be, 0, 0, De, Be);
20188
20188
  return {
20189
20189
  canvas: ze.canvas,
20190
20190
  scaleX: ke.scale,
@@ -23185,7 +23185,7 @@ function Zc(l = {}) {
23185
23185
  standardFontDataUrl: N,
23186
23186
  wasmUrl: z
23187
23187
  }
23188
- }, Ge = {
23188
+ }, Ve = {
23189
23189
  ownerDocument: ue,
23190
23190
  pdfBug: me,
23191
23191
  styleElement: be,
@@ -23225,7 +23225,7 @@ function Zc(l = {}) {
23225
23225
  throw new Error("Loading aborted");
23226
23226
  if (m.destroyed)
23227
23227
  throw new Error("Worker was destroyed");
23228
- const Pe = new Mo(t, Ne, m.port), Oe = new w2(Pe, e, Re, Ge, he, ye);
23228
+ const Pe = new Mo(t, Ne, m.port), Oe = new w2(Pe, e, Re, Ve, he, ye);
23229
23229
  e._transport = Oe, Pe.send("Ready", null);
23230
23230
  });
23231
23231
  }).catch(e._capability.reject), e;
@@ -31741,7 +31741,7 @@ const Mw = zg(function({ children: e, className: t, error: i = "Failed to load P
31741
31741
  function Be() {
31742
31742
  q({ type: "RESET" });
31743
31743
  }
31744
- Ve(Be, [r, q]);
31744
+ Ge(Be, [r, q]);
31745
31745
  const ze = xi(async () => {
31746
31746
  if (!r)
31747
31747
  return null;
@@ -31762,7 +31762,7 @@ const Mw = zg(function({ children: e, className: t, error: i = "Failed to load P
31762
31762
  }
31763
31763
  return r;
31764
31764
  }, [r]);
31765
- Ve(() => {
31765
+ Ge(() => {
31766
31766
  const Pe = qo(ze());
31767
31767
  return Pe.promise.then((Oe) => {
31768
31768
  q({ type: "RESOLVE", value: Oe });
@@ -31771,7 +31771,7 @@ const Mw = zg(function({ children: e, className: t, error: i = "Failed to load P
31771
31771
  }), () => {
31772
31772
  nr(Pe);
31773
31773
  };
31774
- }, [ze, q]), Ve(() => {
31774
+ }, [ze, q]), Ge(() => {
31775
31775
  if (!(typeof $ > "u")) {
31776
31776
  if ($ === !1) {
31777
31777
  De();
@@ -31786,9 +31786,9 @@ const Mw = zg(function({ children: e, className: t, error: i = "Failed to load P
31786
31786
  function be() {
31787
31787
  ce && (Oi(!1, ce.toString()), w && w(ce));
31788
31788
  }
31789
- Ve(function() {
31789
+ Ge(function() {
31790
31790
  fe({ type: "RESET" });
31791
- }, [fe, $]), Ve(function() {
31791
+ }, [fe, $]), Ge(function() {
31792
31792
  if (!$)
31793
31793
  return;
31794
31794
  const Oe = j ? { ...$, ...j } : $, je = Zc(Oe);
@@ -31801,7 +31801,7 @@ const Mw = zg(function({ children: e, className: t, error: i = "Failed to load P
31801
31801
  }), () => {
31802
31802
  Ue.destroy();
31803
31803
  };
31804
- }, [j, fe, $]), Ve(() => {
31804
+ }, [j, fe, $]), Ge(() => {
31805
31805
  if (!(typeof ue > "u")) {
31806
31806
  if (ue === !1) {
31807
31807
  be();
@@ -31809,14 +31809,14 @@ const Mw = zg(function({ children: e, className: t, error: i = "Failed to load P
31809
31809
  }
31810
31810
  We();
31811
31811
  }
31812
- }, [ue]), Ve(function() {
31812
+ }, [ue]), Ge(function() {
31813
31813
  le.current.setViewer(ke.current), le.current.setExternalLinkRel(n), le.current.setExternalLinkTarget(s);
31814
31814
  }, [n, s]);
31815
31815
  const he = xi((Pe, Oe) => {
31816
31816
  ee.current[Pe] = Oe;
31817
31817
  }, []), Ee = xi((Pe) => {
31818
31818
  delete ee.current[Pe];
31819
- }, []), Ge = ji(() => ({
31819
+ }, []), Ve = ji(() => ({
31820
31820
  imageResourcesPath: d,
31821
31821
  linkService: le.current,
31822
31822
  onItemClick: g,
@@ -31835,10 +31835,10 @@ const Mw = zg(function({ children: e, className: t, error: i = "Failed to load P
31835
31835
  function Pe(je) {
31836
31836
  return !!je?.pdf;
31837
31837
  }
31838
- if (!Pe(Ge))
31838
+ if (!Pe(Ve))
31839
31839
  throw new Error("pdf is undefined");
31840
- const Oe = typeof e == "function" ? e(Ge) : e;
31841
- return h(qu.Provider, { value: Ge, children: Oe });
31840
+ const Oe = typeof e == "function" ? e(Ve) : e;
31841
+ return h(qu.Provider, { value: Ve, children: Oe });
31842
31842
  }
31843
31843
  function Ne() {
31844
31844
  return r ? ue == null ? h(Nr, { type: "loading", children: typeof u == "function" ? u() : u }) : ue === !1 ? h(Nr, { type: "error", children: typeof i == "function" ? i() : i }) : Re() : h(Nr, { type: "no-data", children: typeof m == "function" ? m() : m });
@@ -31886,9 +31886,9 @@ function Sw() {
31886
31886
  function H() {
31887
31887
  j && (Oi(!1, j.toString()), r && r(j));
31888
31888
  }
31889
- Ve(function() {
31889
+ Ge(function() {
31890
31890
  L({ type: "RESET" });
31891
- }, [L, m]), Ve(function() {
31891
+ }, [L, m]), Ge(function() {
31892
31892
  if (!m)
31893
31893
  return;
31894
31894
  const $ = qo(m.getAnnotations()), se = $;
@@ -31899,7 +31899,7 @@ function Sw() {
31899
31899
  }), () => {
31900
31900
  nr(se);
31901
31901
  };
31902
- }, [L, m]), Ve(() => {
31902
+ }, [L, m]), Ge(() => {
31903
31903
  if (N !== void 0) {
31904
31904
  if (N === !1) {
31905
31905
  H();
@@ -31915,7 +31915,7 @@ function Sw() {
31915
31915
  Oi(!1, `${q}`), d && d(q);
31916
31916
  }
31917
31917
  const _ = ji(() => m.getViewport({ scale: S, rotation: y }), [m, y, S]);
31918
- return Ve(function() {
31918
+ return Ge(function() {
31919
31919
  if (!g || !m || !s || !N)
31920
31920
  return;
31921
31921
  const { current: $ } = z;
@@ -32086,9 +32086,9 @@ function Tw() {
32086
32086
  function m() {
32087
32087
  r && (Oi(!1, r.toString()), e && e(r));
32088
32088
  }
32089
- return Ve(function() {
32089
+ return Ge(function() {
32090
32090
  n({ type: "RESET" });
32091
- }, [n, d]), Ve(function() {
32091
+ }, [n, d]), Ge(function() {
32092
32092
  if (o || !d)
32093
32093
  return;
32094
32094
  const w = qo(d.getStructTree()), y = w;
@@ -32097,7 +32097,7 @@ function Tw() {
32097
32097
  }).catch((S) => {
32098
32098
  n({ type: "REJECT", error: S });
32099
32099
  }), () => nr(y);
32100
- }, [o, d, n]), Ve(() => {
32100
+ }, [o, d, n]), Ge(() => {
32101
32101
  if (s !== void 0) {
32102
32102
  if (s === !1) {
32103
32103
  m();
@@ -32121,7 +32121,7 @@ function Bw(l) {
32121
32121
  _u(H) || (Oi(!1, H.toString()), r && r(H));
32122
32122
  }
32123
32123
  const j = ji(() => d.getViewport({ scale: y * s, rotation: w }), [s, d, w, y]), z = ji(() => d.getViewport({ scale: y, rotation: w }), [d, w, y]);
32124
- Ve(function() {
32124
+ Ge(function() {
32125
32125
  if (!d)
32126
32126
  return;
32127
32127
  d.cleanup();
@@ -32146,7 +32146,7 @@ function Bw(l) {
32146
32146
  const { current: H } = C;
32147
32147
  H && (H.width = 0, H.height = 0);
32148
32148
  }, []);
32149
- return Ve(() => F, [F]), h("canvas", { className: `${i}__canvas`, dir: "ltr", ref: ep(S, C), style: {
32149
+ return Ge(() => F, [F]), h("canvas", { className: `${i}__canvas`, dir: "ltr", ref: ep(S, C), style: {
32150
32150
  display: "block",
32151
32151
  userSelect: "none"
32152
32152
  }, children: m ? h(Tw, {}) : null });
@@ -32216,9 +32216,9 @@ function Yw() {
32216
32216
  function N() {
32217
32217
  S && (Oi(!1, S.toString()), t && t(S));
32218
32218
  }
32219
- Ve(function() {
32219
+ Ge(function() {
32220
32220
  w({ type: "RESET" });
32221
- }, [r, w]), Ve(function() {
32221
+ }, [r, w]), Ge(function() {
32222
32222
  if (!r)
32223
32223
  return;
32224
32224
  const _ = qo(r.getTextContent()), q = _;
@@ -32227,7 +32227,7 @@ function Yw() {
32227
32227
  }).catch(($) => {
32228
32228
  w({ type: "REJECT", error: $ });
32229
32229
  }), () => nr(q);
32230
- }, [r, w]), Ve(() => {
32230
+ }, [r, w]), Ge(() => {
32231
32231
  if (y !== void 0) {
32232
32232
  if (y === !1) {
32233
32233
  N();
@@ -32299,7 +32299,7 @@ function Yw() {
32299
32299
  }
32300
32300
  const Wf = 1;
32301
32301
  function Qw(l) {
32302
- const t = { ...$u(), ...l }, { _className: i = "react-pdf__Page", _enableRegisterUnregisterPage: n = !0, canvasBackground: s, canvasRef: r, children: o, className: d, customRenderer: u, customTextRenderer: m, devicePixelRatio: g, error: w = "Failed to load the page.", filterAnnotations: y, height: S, inputRef: C, loading: L = "Loading page…", noData: N = "No page specified.", onGetAnnotationsError: j, onGetAnnotationsSuccess: z, onGetStructTreeError: F, onGetStructTreeSuccess: H, onGetTextError: Q, onGetTextSuccess: V, onLoadError: _, onLoadSuccess: q, onRenderAnnotationLayerError: $, onRenderAnnotationLayerSuccess: se, onRenderError: de, onRenderSuccess: fe, onRenderTextLayerError: ue, onRenderTextLayerSuccess: ce, pageColors: le, pageIndex: ee, pageNumber: me, pdf: we, registerPage: ke, renderAnnotationLayer: ye = !0, renderForms: De = !1, renderMode: Be = "canvas", renderTextLayer: ze = !0, rotate: We, scale: be = Wf, unregisterPage: he, width: Ee, ...Ge } = t, [dt, Re] = jr(), { value: Ne, error: Pe } = dt, Oe = Bt(null);
32302
+ const t = { ...$u(), ...l }, { _className: i = "react-pdf__Page", _enableRegisterUnregisterPage: n = !0, canvasBackground: s, canvasRef: r, children: o, className: d, customRenderer: u, customTextRenderer: m, devicePixelRatio: g, error: w = "Failed to load the page.", filterAnnotations: y, height: S, inputRef: C, loading: L = "Loading page…", noData: N = "No page specified.", onGetAnnotationsError: j, onGetAnnotationsSuccess: z, onGetStructTreeError: F, onGetStructTreeSuccess: H, onGetTextError: Q, onGetTextSuccess: V, onLoadError: _, onLoadSuccess: q, onRenderAnnotationLayerError: $, onRenderAnnotationLayerSuccess: se, onRenderError: de, onRenderSuccess: fe, onRenderTextLayerError: ue, onRenderTextLayerSuccess: ce, pageColors: le, pageIndex: ee, pageNumber: me, pdf: we, registerPage: ke, renderAnnotationLayer: ye = !0, renderForms: De = !1, renderMode: Be = "canvas", renderTextLayer: ze = !0, rotate: We, scale: be = Wf, unregisterPage: he, width: Ee, ...Ve } = t, [dt, Re] = jr(), { value: Ne, error: Pe } = dt, Oe = Bt(null);
32303
32303
  Zt(we, "Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");
32304
32304
  const je = Vs(me) ? me - 1 : ee ?? null, Ue = me ?? (Vs(ee) ? ee + 1 : null), re = We ?? (Ne ? Ne.rotate : null), pe = ji(() => {
32305
32305
  if (!Ne)
@@ -32312,7 +32312,7 @@ function Qw(l) {
32312
32312
  }
32313
32313
  return bt * Qe;
32314
32314
  }, [S, Ne, re, be, Ee]);
32315
- Ve(function() {
32315
+ Ge(function() {
32316
32316
  return () => {
32317
32317
  Vs(je) && n && he && he(je);
32318
32318
  };
@@ -32332,9 +32332,9 @@ function Qw(l) {
32332
32332
  function Ye() {
32333
32333
  Pe && (Oi(!1, Pe.toString()), _ && _(Pe));
32334
32334
  }
32335
- Ve(function() {
32335
+ Ge(function() {
32336
32336
  Re({ type: "RESET" });
32337
- }, [Re, we, je]), Ve(function() {
32337
+ }, [Re, we, je]), Ge(function() {
32338
32338
  if (!we || !Ue)
32339
32339
  return;
32340
32340
  const bt = qo(we.getPage(Ue)), Et = bt;
@@ -32343,7 +32343,7 @@ function Qw(l) {
32343
32343
  }).catch((Pt) => {
32344
32344
  Re({ type: "REJECT", error: Pt });
32345
32345
  }), () => nr(Et);
32346
- }, [Re, we, Ue]), Ve(() => {
32346
+ }, [Re, we, Ue]), Ge(() => {
32347
32347
  if (Ne !== void 0) {
32348
32348
  if (Ne === !1) {
32349
32349
  Ye();
@@ -32408,9 +32408,9 @@ function Qw(l) {
32408
32408
  re,
32409
32409
  pe
32410
32410
  ]), yt = ji(
32411
- () => Vu(Ge, () => Ne && (pe ? jc(Ne, pe) : void 0)),
32411
+ () => Vu(Ve, () => Ne && (pe ? jc(Ne, pe) : void 0)),
32412
32412
  // biome-ignore lint/correctness/useExhaustiveDependencies: FIXME
32413
- [Ge, Ne, pe]
32413
+ [Ve, Ne, pe]
32414
32414
  ), nt = `${je}@${pe}/${re}`;
32415
32415
  function St() {
32416
32416
  switch (Be) {
@@ -32500,14 +32500,14 @@ const Ww = ({
32500
32500
  } = Xi(), _ = s.length > 0 ? s : d, [q, $] = K(-1), [se, de] = K(
32501
32501
  i
32502
32502
  );
32503
- Ve(() => {
32503
+ Ge(() => {
32504
32504
  i !== -1 && de(i);
32505
32505
  }, [i]);
32506
32506
  const [fe, ue] = K(!1), ce = () => {
32507
32507
  e();
32508
32508
  }, le = n || C, ee = le === "TRILLIONLOAN", me = /* @__PURE__ */ new Date();
32509
32509
  me.setDate(me.getDate() + 1);
32510
- const [we, ke] = K(ee ? /* @__PURE__ */ new Date() : me), [ye, De] = K(["", "", "", "", "", ""]), Be = Ki.useRef([]), [ze, We] = K(0), [be, he] = K("idle"), [Ee, Ge] = K(!1), [dt, Re] = K(!1), [Ne, Pe] = K(""), [Oe, je] = K(""), [Ue, re] = K(
32510
+ const [we, ke] = K(ee ? /* @__PURE__ */ new Date() : me), [ye, De] = K(["", "", "", "", "", ""]), Be = Ki.useRef([]), [ze, We] = K(0), [be, he] = K("idle"), [Ee, Ve] = K(!1), [dt, Re] = K(!1), [Ne, Pe] = K(""), [Oe, je] = K(""), [Ue, re] = K(
32511
32511
  L === "FUNDLY_COLLECT_APP" || L === "FUNDLY_QR_COLLECT_APP" || L === "FUNDLY_QR_WEB" ? "Collect" : "Pay Now"
32512
32512
  ), [pe, He] = K(!1), [Ye, tt] = K(null), [yt, nt] = K(null), [St, mt] = K(!1), [ft, jt] = K(null), [ct, Qe] = K([]), [bt, Et] = K(!1), [Pt, Tt] = K(0), Ct = xi((Fe) => {
32513
32513
  const at = Fe.getFullYear(), Rt = String(Fe.getMonth() + 1).padStart(2, "0"), Yt = String(Fe.getDate()).padStart(2, "0");
@@ -32610,7 +32610,7 @@ const Ww = ({
32610
32610
  }, [y, ct]), qe = xi(() => {
32611
32611
  Ye && Et(!0);
32612
32612
  }, [Ye]), vt = Ki.useMemo(() => Ye ? Ye.kfsDocumentBytes ? `data:application/pdf;base64,${Ye.kfsDocumentBytes}` : Ye.kfsDocumentUrl || Ye.documentUrl || null : null, [Ye]), Ot = Bt(null);
32613
- Ve(() => {
32613
+ Ge(() => {
32614
32614
  const Fe = Ot.current;
32615
32615
  if (!Fe) return;
32616
32616
  const at = (Rt) => {
@@ -32633,8 +32633,8 @@ const Ww = ({
32633
32633
  return;
32634
32634
  }
32635
32635
  if (Re(!1), Ee) return;
32636
- if (Ge(!0), !we) {
32637
- console.error("[Fundly Pay] Payment date is required"), Ge(!1);
32636
+ if (Ve(!0), !we) {
32637
+ console.error("[Fundly Pay] Payment date is required"), Ve(!1);
32638
32638
  return;
32639
32639
  }
32640
32640
  const Fe = we.toISOString(), at = Fe.split("T")[0], Rt = n || C, Yt = {
@@ -32670,7 +32670,7 @@ const Ww = ({
32670
32670
  const Dt = Gt?.response?.data?.errorMessage || Gt?.response?.data?.errorDesc || Gt?.response?.data?.message || Gt?.message || "Payment failed. Please try again.";
32671
32671
  Pe(Dt);
32672
32672
  } finally {
32673
- Ge(!1);
32673
+ Ve(!1);
32674
32674
  }
32675
32675
  }, pn = (Fe, at) => {
32676
32676
  if (!/^[0-9]?$/.test(Fe)) return;
@@ -32681,7 +32681,7 @@ const Ww = ({
32681
32681
  }, Zn = () => {
32682
32682
  he("countdown"), We(30), Jt();
32683
32683
  };
32684
- Ve(() => {
32684
+ Ge(() => {
32685
32685
  if (be === "countdown" && ze > 0) {
32686
32686
  const Fe = setInterval(() => {
32687
32687
  We((at) => at - 1);
@@ -32729,14 +32729,14 @@ const Ww = ({
32729
32729
  Cn(!1);
32730
32730
  }
32731
32731
  };
32732
- return Ve(() => {
32732
+ return Ge(() => {
32733
32733
  let Fe;
32734
32734
  return l && q !== -1 && se !== -1 && (Fe = window.setTimeout(() => {
32735
32735
  Fn();
32736
32736
  }, 1e3)), () => {
32737
32737
  clearTimeout(Fe);
32738
32738
  };
32739
- }, [q, se, we]), Ve(() => {
32739
+ }, [q, se, we]), Ge(() => {
32740
32740
  if (l) {
32741
32741
  if ($(0), ee)
32742
32742
  ke(/* @__PURE__ */ new Date()), mt(!1);
@@ -32746,13 +32746,13 @@ const Ww = ({
32746
32746
  }
32747
32747
  Ie();
32748
32748
  }
32749
- }, [l, Ie]), Ve(() => {
32749
+ }, [l, Ie]), Ge(() => {
32750
32750
  if (!l || le !== "TRILLIONLOAN") return;
32751
32751
  const Fe = window.setTimeout(() => {
32752
32752
  st();
32753
32753
  }, 400);
32754
32754
  return () => clearTimeout(Fe);
32755
- }, [q, we, st]), Ve(() => {
32755
+ }, [q, we, st]), Ge(() => {
32756
32756
  const Fe = () => {
32757
32757
  l && q !== -1 && (Fn(), st());
32758
32758
  };
@@ -33149,7 +33149,7 @@ const Ww = ({
33149
33149
  }, [L, N] = K(""), [j, z] = K(!1), [F, H] = K(""), [Q, V] = K(!1), [_, q] = K(5), [$, se] = K(""), de = Bt(null), fe = Bt(
33150
33150
  null
33151
33151
  );
33152
- Ve(() => {
33152
+ Ge(() => {
33153
33153
  l || (N(""), H(""), V(!1), q(5), de.current && clearTimeout(de.current), fe.current && clearInterval(fe.current));
33154
33154
  }, [l]);
33155
33155
  const ue = () => {
@@ -33437,7 +33437,7 @@ Fundly Team`;
33437
33437
  j((ye) => ye <= 1 ? (clearInterval(se.current), ce.current = !0, fe.current && (clearTimeout(fe.current), fe.current = null), _(!0), 0) : ye - 1);
33438
33438
  }, 1e3);
33439
33439
  };
33440
- return Ve(() => (l && (F(""), _(!1), $(""), ue.current = !1, ce.current = !1, ee()), () => {
33440
+ return Ge(() => (l && (F(""), _(!1), $(""), ue.current = !1, ce.current = !1, ee()), () => {
33441
33441
  se.current && clearInterval(se.current), de.current && clearTimeout(de.current), fe.current && clearTimeout(fe.current), j(120), F(""), $(""), ue.current = !1, ce.current = !1;
33442
33442
  }), [l]), /* @__PURE__ */ b(ei, { children: [
33443
33443
  /* @__PURE__ */ h(en, { open: l, onClose: le, children: /* @__PURE__ */ b("div", { className: "fp:w-full fp:px-4 fp:pt-6 fp:mb-12", children: [
@@ -33706,7 +33706,7 @@ Fundly Team`;
33706
33706
  sessionId: H,
33707
33707
  erpId: Q
33708
33708
  } = Xi(), [V, _] = K(!1), [q, $] = K("INITIATED"), [se, de] = K(null), [fe, ue] = K(0), [ce, le] = K(null), ee = Bt(null), me = Bt(!1), we = Bt({ amount: 0, invoiceCount: 0 });
33709
- Ve(() => {
33709
+ Ge(() => {
33710
33710
  l || (ee.current && (clearTimeout(ee.current), ee.current = null), me.current = !1, ze.current = !1, $("INITIATED"), de(null), le(null), sessionStorage.removeItem("fundly_payment_initiated"), sessionStorage.removeItem("fundly_last_transaction_id"));
33711
33711
  }, [l]);
33712
33712
  const ke = (he) => {
@@ -33732,7 +33732,7 @@ Fundly Team`;
33732
33732
  const Ee = he.toLowerCase();
33733
33733
  return Ee.includes("cancel") || Ee.includes("abort") || Ee.includes("declined by user") ? "user_abort" : Ee.includes("bank") || Ee.includes("insufficient") ? "bank" : "gateway";
33734
33734
  }, ze = Ki.useRef(!1);
33735
- Ve(() => {
33735
+ Ge(() => {
33736
33736
  if (!l || ze.current)
33737
33737
  return;
33738
33738
  const he = new URLSearchParams(window.location.search), Ee = he.get("transactionId") || he.get("orderId");
@@ -34539,7 +34539,7 @@ Fundly Team`;
34539
34539
  sessionId: H,
34540
34540
  erpId: Q
34541
34541
  } = Xi(), [V, _] = K(!1), [q, $] = K("INITIATED"), [se, de] = K(null), [fe, ue] = K(null), ce = Bt(null), le = Bt(!1), ee = Bt({ amount: 0, invoiceCount: 0 });
34542
- Ve(() => {
34542
+ Ge(() => {
34543
34543
  l || (ce.current && (clearTimeout(ce.current), ce.current = null), le.current = !1, De.current = !1, $("INITIATED"), de(null), ue(null), sessionStorage.removeItem("fundly_netbanking_payment_initiated"), sessionStorage.removeItem("fundly_netbanking_last_transaction_id"));
34544
34544
  }, [l]);
34545
34545
  const me = (We) => {
@@ -34565,13 +34565,13 @@ Fundly Team`;
34565
34565
  const be = We.toLowerCase();
34566
34566
  return be.includes("cancel") || be.includes("abort") || be.includes("declined by user") ? "user_abort" : be.includes("bank") || be.includes("insufficient") ? "bank" : "gateway";
34567
34567
  }, De = Ki.useRef(!1);
34568
- Ve(() => {
34568
+ Ge(() => {
34569
34569
  if (!l || De.current)
34570
34570
  return;
34571
34571
  const We = new URLSearchParams(window.location.search), be = We.get("transactionId") || We.get("orderId");
34572
34572
  if (F) {
34573
- const Ge = z || be;
34574
- if (!Ge) {
34573
+ const Ve = z || be;
34574
+ if (!Ve) {
34575
34575
  de("Transaction ID not found. Unable to fetch payment status.");
34576
34576
  return;
34577
34577
  }
@@ -34580,7 +34580,7 @@ Fundly Team`;
34580
34580
  if (!le.current)
34581
34581
  try {
34582
34582
  const Re = await Ht.get(
34583
- `${qn()}/transactions/${Ge}`,
34583
+ `${qn()}/transactions/${Ve}`,
34584
34584
  {
34585
34585
  headers: {
34586
34586
  Authorization: it() ? `Bearer ${it()}` : void 0,
@@ -34611,7 +34611,7 @@ Fundly Team`;
34611
34611
  if (ee.current.amount === 0 && Pe && (ee.current = {
34612
34612
  amount: Number(Pe),
34613
34613
  invoiceCount: Oe?.length || s?.length || r?.length || 0,
34614
- transactionId: Ge,
34614
+ transactionId: Ve,
34615
34615
  initiatedAt: ee.current.initiatedAt
34616
34616
  }), Ne && $(Ne), Ne === "SUCCESS" || Ne === "COMPLETED") {
34617
34617
  le.current = !0, ce.current && (clearTimeout(ce.current), ce.current = null);
@@ -34642,7 +34642,7 @@ Fundly Team`;
34642
34642
  Ue || "NETBANKING",
34643
34643
  ee.current.amount,
34644
34644
  ee.current.invoiceCount,
34645
- Ge,
34645
+ Ve,
34646
34646
  u || void 0,
34647
34647
  m?.trim() || void 0,
34648
34648
  Pt,
@@ -34653,7 +34653,7 @@ Fundly Team`;
34653
34653
  // Pass invoice numbers
34654
34654
  ), Vn({
34655
34655
  orderId: ke(),
34656
- transactionId: Ge || "",
34656
+ transactionId: Ve || "",
34657
34657
  status: "success",
34658
34658
  amount: ee.current.amount,
34659
34659
  paymentMode: Ue || "NETBANKING",
@@ -34706,14 +34706,14 @@ Fundly Team`;
34706
34706
  ee.current.amount,
34707
34707
  ee.current.invoiceCount,
34708
34708
  Ne,
34709
- Ge,
34709
+ Ve,
34710
34710
  u || void 0,
34711
34711
  m?.trim() || void 0,
34712
34712
  Pt,
34713
34713
  Ct
34714
34714
  ), Vn({
34715
34715
  orderId: ke(),
34716
- transactionId: Ge || "",
34716
+ transactionId: Ve || "",
34717
34717
  status: "failed",
34718
34718
  amount: ee.current.amount,
34719
34719
  paymentMode: Ue || "NETBANKING",
@@ -34753,7 +34753,7 @@ Fundly Team`;
34753
34753
  }
34754
34754
  if (be) {
34755
34755
  De.current = !0, _(!1), $("PROCESSING");
34756
- const Ge = async () => {
34756
+ const Ve = async () => {
34757
34757
  if (!le.current)
34758
34758
  try {
34759
34759
  const dt = await Ht.get(
@@ -34915,15 +34915,15 @@ Fundly Team`;
34915
34915
  return;
34916
34916
  }
34917
34917
  le.current || (ce.current = setTimeout(() => {
34918
- Ge();
34918
+ Ve();
34919
34919
  }, 3e3));
34920
34920
  } catch {
34921
34921
  le.current || (ce.current = setTimeout(() => {
34922
- Ge();
34922
+ Ve();
34923
34923
  }, 5e3));
34924
34924
  }
34925
34925
  };
34926
- Ge();
34926
+ Ve();
34927
34927
  return;
34928
34928
  }
34929
34929
  if (sessionStorage.getItem(
@@ -34934,7 +34934,7 @@ Fundly Team`;
34934
34934
  }
34935
34935
  (async () => {
34936
34936
  _(!0), le.current = !1, sessionStorage.setItem("fundly_netbanking_payment_initiated", "true");
34937
- const Ge = {
34937
+ const Ve = {
34938
34938
  paymentMode: "NETBANKING",
34939
34939
  paymentDate: (/* @__PURE__ */ new Date()).toISOString(),
34940
34940
  paymentType: n,
@@ -34952,9 +34952,9 @@ Fundly Team`;
34952
34952
  mobileNumber: L || void 0,
34953
34953
  payerMobileNumber: L || void 0
34954
34954
  };
34955
- S && S.trim() !== "" ? Ge.chemistBusinessId = S : C && C.trim() !== "" && (Ge.leadId = C), n === "INVOICE_COLLECT" ? Ge.paymentInvoice = s : n === "DIRECT_COLLECT" && (Ge.invoiceIds = r);
34955
+ S && S.trim() !== "" ? Ve.chemistBusinessId = S : C && C.trim() !== "" && (Ve.leadId = C), n === "INVOICE_COLLECT" ? Ve.paymentInvoice = s : n === "DIRECT_COLLECT" && (Ve.invoiceIds = r);
34956
34956
  try {
34957
- const dt = await gs(Ge), { link: Re, transactionId: Ne } = dt.data || dt;
34957
+ const dt = await gs(Ve), { link: Re, transactionId: Ne } = dt.data || dt;
34958
34958
  if (Re && Ne) {
34959
34959
  const Pe = typeof o == "string" ? parseFloat(o) : Number(o);
34960
34960
  ee.current = {
@@ -35334,12 +35334,12 @@ Fundly Team`;
35334
35334
  chemistName: o,
35335
35335
  payerUuid: d,
35336
35336
  payerMobileNumber: u
35337
- } = Xi(), [m, g] = K(null), [w, y] = K(""), [S, C] = K(""), [L, N] = K(!1), [j, z] = K(""), [F, H] = K(""), [Q, V] = K([]), [_, q] = K(!1), [$, se] = K(!1), [de, fe] = K(""), [ue, ce] = K(null), [le, ee] = K(!1), [me, we] = K(!1), [ke, ye] = K("Submit"), [De, Be] = K(!1), [ze, We] = K(""), be = Bt(null), he = Bt(null), Ee = Bt(null), Ge = Bt(null), dt = () => {
35337
+ } = Xi(), [m, g] = K(null), [w, y] = K(""), [S, C] = K(""), [L, N] = K(!1), [j, z] = K(""), [F, H] = K(""), [Q, V] = K([]), [_, q] = K(!1), [$, se] = K(!1), [de, fe] = K(""), [ue, ce] = K(null), [le, ee] = K(!1), [me, we] = K(!1), [ke, ye] = K("Submit"), [De, Be] = K(!1), [ze, We] = K(""), be = Bt(null), he = Bt(null), Ee = Bt(null), Ve = Bt(null), dt = () => {
35338
35338
  e(), Re();
35339
35339
  }, Re = () => {
35340
35340
  g(null), y(""), C(""), N(!1), z(""), H(""), V([]), q(!1), fe(""), ce(null), ee(!1), we(!1), ye("Submit"), We(""), Be(!1);
35341
35341
  };
35342
- Ve(() => {
35342
+ Ge(() => {
35343
35343
  l || Re();
35344
35344
  }, [l]);
35345
35345
  const Ne = xi(async (re) => {
@@ -35355,7 +35355,7 @@ Fundly Team`;
35355
35355
  }
35356
35356
  }, re.trim() ? 300 : 0);
35357
35357
  }, []);
35358
- Ve(() => {
35358
+ Ge(() => {
35359
35359
  const re = (pe) => {
35360
35360
  be.current && !be.current.contains(pe.target) && q(!1), he.current && !he.current.contains(pe.target) && N(!1);
35361
35361
  };
@@ -35503,7 +35503,7 @@ Fundly Team`;
35503
35503
  /* @__PURE__ */ h(
35504
35504
  "input",
35505
35505
  {
35506
- ref: Ge,
35506
+ ref: Ve,
35507
35507
  type: "file",
35508
35508
  accept: "image/*,application/pdf",
35509
35509
  hidden: !0,
@@ -35862,7 +35862,7 @@ Fundly Team`;
35862
35862
  "div",
35863
35863
  {
35864
35864
  className: "fp:w-full fp:flex fp:items-center fp:justify-between fp:border-1 fp:border-dashed fp:border-[#cccccc] fp:rounded-lg fp:py-3 fp:px-8 fp:cursor-pointer fp:mt-2",
35865
- onClick: () => Ge.current?.click(),
35865
+ onClick: () => Ve.current?.click(),
35866
35866
  children: [
35867
35867
  /* @__PURE__ */ b("div", { className: "fp:flex fp:flex-col fp:items-center", children: [
35868
35868
  /* @__PURE__ */ h("span", { className: "fp:text-[#aaa]", children: "Upload Proof (Optional)" }),
@@ -36243,7 +36243,7 @@ Fundly Team`;
36243
36243
  chemistId: g,
36244
36244
  leadId: w
36245
36245
  } = Xi(), y = Bt(!1);
36246
- Ve(() => {
36246
+ Ge(() => {
36247
36247
  const S = (N) => {
36248
36248
  if (typeof N.data != "object" || N.data === null || N.source !== window || N.data?.source === "react-devtools-content-script" || N.source !== window || N.data?.source?.includes("react-devtools") || N.origin !== window.origin)
36249
36249
  return;
@@ -36280,7 +36280,7 @@ Fundly Team`;
36280
36280
  setCreditLimitData: C,
36281
36281
  setPayerUuid: L
36282
36282
  } = Xi(), [N, j] = K([]), [z, F] = K(null), [H, Q] = K(null), [V, _] = K(null), [q, $] = K(null), [se, de] = K(!0);
36283
- return Ve(() => {
36283
+ return Ge(() => {
36284
36284
  l && (async () => {
36285
36285
  const ue = {
36286
36286
  distributorBusinessId: e,
@@ -36398,7 +36398,7 @@ const n1 = ({
36398
36398
  typeOfApp: be,
36399
36399
  transactionId: he,
36400
36400
  showResultOnly: Ee,
36401
- successButtonText: Ge,
36401
+ successButtonText: Ve,
36402
36402
  failureButtonText: dt,
36403
36403
  creditLimitData: Re,
36404
36404
  paymentType: Ne,
@@ -36443,7 +36443,7 @@ const n1 = ({
36443
36443
  fundlyPayReason: Pt,
36444
36444
  loading: Tt
36445
36445
  } = i1(mt);
36446
- Ve(() => {
36446
+ Ge(() => {
36447
36447
  if (!Ee && !he) {
36448
36448
  const Ie = new URLSearchParams(window.location.search);
36449
36449
  if ((Ie.has("orderId") || Ie.has("transactionId")) && !mt) {
@@ -36451,17 +36451,17 @@ const n1 = ({
36451
36451
  qe.searchParams.delete("orderId"), qe.searchParams.delete("transactionId"), window.history.replaceState({}, "", qe.toString());
36452
36452
  }
36453
36453
  }
36454
- }, [Ee, mt, he]), Ve(() => {
36454
+ }, [Ee, mt, he]), Ge(() => {
36455
36455
  if (d || ft) {
36456
36456
  const Ie = setTimeout(async () => {
36457
36457
  await Ut.navigateHome();
36458
36458
  }, 1e4);
36459
36459
  return () => clearTimeout(Ie);
36460
36460
  }
36461
- }, [d, ft]), Ve(() => {
36461
+ }, [d, ft]), Ge(() => {
36462
36462
  const Ie = new URLSearchParams(window.location.search);
36463
36463
  (Ie.get("orderId") || Ie.get("transactionId")) && mt && !Ee && g("UPI");
36464
- }, [mt, Ee, g]), Ve(() => {
36464
+ }, [mt, Ee, g]), Ge(() => {
36465
36465
  !Ee || !he || !mt || !_ && !q && !L && g("UPI");
36466
36466
  }, [
36467
36467
  Ee,
@@ -36471,7 +36471,9 @@ const n1 = ({
36471
36471
  q,
36472
36472
  L,
36473
36473
  g
36474
- ]), Ve(() => {
36474
+ ]), Ge(() => {
36475
+ pe && hn.setUserIdentity(pe);
36476
+ }, [pe]), Ge(() => {
36475
36477
  if (Ee || Tt || !mt || De.current || ct.length === 0)
36476
36478
  return;
36477
36479
  De.current = !0;
@@ -36506,13 +36508,13 @@ const n1 = ({
36506
36508
  error_code: null,
36507
36509
  error_description: null,
36508
36510
  failure_stage: null,
36509
- sdk_version: "1.4.0-beta.4",
36511
+ sdk_version: "1.4.0-beta.5",
36510
36512
  app_context: qe(),
36511
- app_version: "1.4.0-beta.4",
36513
+ app_version: "1.4.0-beta.5",
36512
36514
  mobile_number: re || null,
36513
36515
  uuid: pe || null
36514
36516
  };
36515
- pe && hn.setUserIdentity(pe), hn.trackPaymentSDKLaunched(pn);
36517
+ hn.trackPaymentSDKLaunched(pn);
36516
36518
  }, [
36517
36519
  Tt,
36518
36520
  mt,
@@ -36594,7 +36596,7 @@ const n1 = ({
36594
36596
  );
36595
36597
  },
36596
36598
  paymentData: m,
36597
- buttonText: Ge
36599
+ buttonText: Ve
36598
36600
  }
36599
36601
  ),
36600
36602
  /* @__PURE__ */ h(
@@ -37225,7 +37227,7 @@ const n1 = ({
37225
37227
  open: _,
37226
37228
  onClose: () => w(),
37227
37229
  paymentData: m,
37228
- buttonText: Ge
37230
+ buttonText: Ve
37229
37231
  }
37230
37232
  ),
37231
37233
  /* @__PURE__ */ h(
@@ -37273,7 +37275,7 @@ function s1({ children: l, initialValues: e }) {
37273
37275
  ), [de, fe] = K(
37274
37276
  e?.erpId || null
37275
37277
  );
37276
- Ve(() => {
37278
+ Ge(() => {
37277
37279
  const ce = pl(), le = ml();
37278
37280
  ce && hn.configure({
37279
37281
  enabled: !0,
@@ -37341,7 +37343,7 @@ function fp({ children: l, initialValues: e }) {
37341
37343
  ), [$, se] = K(
37342
37344
  e?.erpId || null
37343
37345
  );
37344
- Ve(() => {
37346
+ Ge(() => {
37345
37347
  const fe = pl(), ue = ml();
37346
37348
  fe && hn.configure({
37347
37349
  enabled: !0,
@@ -37420,7 +37422,7 @@ const et = ({ className: l = "" }) => /* @__PURE__ */ h("div", { className: `fp:
37420
37422
  onApply: i
37421
37423
  }) => {
37422
37424
  const [n, s] = K(["all"]), [r, o] = K(null), [d, u] = K(null), [m, g] = K(null), [w, y] = K(["all"]);
37423
- Ve(() => {
37425
+ Ge(() => {
37424
37426
  if (l) {
37425
37427
  const F = t.statuses;
37426
37428
  s(F && F.length > 0 ? F : ["all"]);
@@ -37579,7 +37581,7 @@ const et = ({ className: l = "" }) => /* @__PURE__ */ h("div", { className: `fp:
37579
37581
  onViewTransaction: e
37580
37582
  }) => {
37581
37583
  const { businessId: t } = r1(), [i, n] = K([]), [s, r] = K(!0), [o, d] = K(null), [u, m] = K(0), [g, w] = K(!1), [y, S] = K(0), [C, L] = K({}), [N, j] = K(!1);
37582
- Ve(() => {
37584
+ Ge(() => {
37583
37585
  t && z();
37584
37586
  }, [t, u, C]);
37585
37587
  const z = async () => {
@@ -37728,14 +37730,14 @@ const et = ({ className: l = "" }) => /* @__PURE__ */ h("div", { className: `fp:
37728
37730
  transaction: t
37729
37731
  }) => {
37730
37732
  const i = Ki.useRef(null), [n, s] = K(null), [r, o] = K(!1), [d, u] = K(null), [m, g] = K([]), [w, y] = K(!1), [S, C] = K(!1), [L, N] = K(""), j = async (he) => {
37731
- const Ee = he.documentIds.flat().map((Ge) => Ge.documentId);
37733
+ const Ee = he.documentIds.flat().map((Ve) => Ve.documentId);
37732
37734
  if (Ee.length !== 0) {
37733
37735
  C(!0), N(he.invoiceNumber), y(!0);
37734
37736
  try {
37735
- const Ge = await XA(Ee);
37736
- g(Array.isArray(Ge) ? Ge : []);
37737
- } catch (Ge) {
37738
- console.error("Error fetching documents:", Ge), g([]);
37737
+ const Ve = await XA(Ee);
37738
+ g(Array.isArray(Ve) ? Ve : []);
37739
+ } catch (Ve) {
37740
+ console.error("Error fetching documents:", Ve), g([]);
37739
37741
  } finally {
37740
37742
  C(!1);
37741
37743
  }
@@ -37743,7 +37745,7 @@ const et = ({ className: l = "" }) => /* @__PURE__ */ h("div", { className: `fp:
37743
37745
  }, z = () => {
37744
37746
  y(!1), g([]), N("");
37745
37747
  };
37746
- Ve(() => {
37748
+ Ge(() => {
37747
37749
  l && t && F(), l || (s(null), u(null));
37748
37750
  }, [l, t?.transactionId]);
37749
37751
  const F = async () => {
@@ -37763,8 +37765,8 @@ const et = ({ className: l = "" }) => /* @__PURE__ */ h("div", { className: `fp:
37763
37765
  };
37764
37766
  if (!t) return null;
37765
37767
  const H = (he) => {
37766
- const Ee = new Date(he), Ge = Ee.getDate(), dt = Ee.toLocaleDateString("en-IN", { month: "short" }), Re = Ee.getFullYear(), Ne = Ee.getHours(), Pe = Ee.getMinutes().toString().padStart(2, "0"), Oe = Ne >= 12 ? "PM" : "AM", je = Ne % 12 || 12;
37767
- return `${Ge} ${dt} ${Re}, ${je}:${Pe} ${Oe}`;
37768
+ const Ee = new Date(he), Ve = Ee.getDate(), dt = Ee.toLocaleDateString("en-IN", { month: "short" }), Re = Ee.getFullYear(), Ne = Ee.getHours(), Pe = Ee.getMinutes().toString().padStart(2, "0"), Oe = Ne >= 12 ? "PM" : "AM", je = Ne % 12 || 12;
37769
+ return `${Ve} ${dt} ${Re}, ${je}:${Pe} ${Oe}`;
37768
37770
  }, Q = (he) => {
37769
37771
  switch (he.toUpperCase()) {
37770
37772
  case "SUCCESS":
@@ -37811,8 +37813,8 @@ Invoice No: ${ye}`);
37811
37813
  try {
37812
37814
  let Ee = "";
37813
37815
  if (i.current) {
37814
- const { default: Ge } = await import("./html2canvas.esm-Dmi1NfiH.js");
37815
- Ee = (await Ge(i.current, {
37816
+ const { default: Ve } = await import("./html2canvas.esm-Dmi1NfiH.js");
37817
+ Ee = (await Ve(i.current, {
37816
37818
  backgroundColor: "#fff",
37817
37819
  scale: 2
37818
37820
  })).toDataURL("image/png");
@@ -37941,16 +37943,16 @@ Invoice No: ${ye}`);
37941
37943
  Be.length > 0 && /* @__PURE__ */ b("div", { className: "fp:mt-3 fp:bg-white fp:rounded-[12px] fp:px-3 fp:pb-4", children: [
37942
37944
  /* @__PURE__ */ h("p", { className: "fp:text-[12px] fp:font-medium fp:text-[#16558B] fp:leading-6 fp:mb-3", children: "Uploaded Invoices" }),
37943
37945
  /* @__PURE__ */ h("div", { className: "fp:overflow-y-auto", style: { maxHeight: "133px" }, children: /* @__PURE__ */ h("div", { className: "fp:flex fp:flex-col fp:gap-3", children: Be.map((he, Ee) => {
37944
- const Ge = he.documentIds.flat().length;
37946
+ const Ve = he.documentIds.flat().length;
37945
37947
  return /* @__PURE__ */ b("div", { className: "fp:flex fp:flex-col fp:gap-[10px]", children: [
37946
37948
  Ee > 0 && /* @__PURE__ */ h("div", { style: { borderTop: "0.5px dashed #D0D0D0" } }),
37947
37949
  /* @__PURE__ */ b("div", { className: "fp:flex fp:items-center fp:justify-between", children: [
37948
37950
  /* @__PURE__ */ b("div", { className: "fp:flex fp:flex-col fp:gap-[6px]", children: [
37949
37951
  /* @__PURE__ */ h("div", { className: "fp:flex fp:items-center fp:gap-[3px]", children: /* @__PURE__ */ h("span", { className: "fp:text-[10px] fp:font-medium fp:leading-[12px] fp:text-[#222222] fp:uppercase", children: he.invoiceNumber }) }),
37950
- Ge > 0 && /* @__PURE__ */ b("span", { className: "fp:text-[10px] fp:font-normal fp:leading-normal fp:text-[#6D6D6D]", children: [
37951
- Ge,
37952
+ Ve > 0 && /* @__PURE__ */ b("span", { className: "fp:text-[10px] fp:font-normal fp:leading-normal fp:text-[#6D6D6D]", children: [
37953
+ Ve,
37952
37954
  " Page",
37953
- Ge !== 1 ? "s" : ""
37955
+ Ve !== 1 ? "s" : ""
37954
37956
  ] })
37955
37957
  ] }),
37956
37958
  /* @__PURE__ */ h(
@@ -38113,7 +38115,7 @@ Invoice No: ${ye}`);
38113
38115
  onNavigateToTransactions: t
38114
38116
  }) => {
38115
38117
  const { businessId: i, setLenderList: n } = Zo(), [s, r] = K([]), [o, d] = K(!0), [u, m] = K(null), g = s.reduce((N, j) => N + j.creditLimit, 0), w = s.reduce((N, j) => N + j.outstandingAmount, 0), y = g - w, S = g > 0 ? y / g * 100 : 0;
38116
- Ve(() => {
38118
+ Ge(() => {
38117
38119
  i && C();
38118
38120
  }, [i]);
38119
38121
  const C = async () => {
@@ -38286,7 +38288,7 @@ const Xf = () => ul() === "production" ? "production" : "sandbox", A1 = () => gr
38286
38288
  onViewLoanDetails: t
38287
38289
  }) => {
38288
38290
  const { businessId: i, selectedLender: n, setLoanList: s } = Zo(), [r, o] = K([]), [d, u] = K(/* @__PURE__ */ new Set()), [m, g] = K(!0), [w, y] = K(null), [S, C] = K(""), [L, N] = K(!1), [j, z] = K(null);
38289
- Ve(() => {
38291
+ Ge(() => {
38290
38292
  i && n && F();
38291
38293
  }, [i, n]);
38292
38294
  const F = async () => {
@@ -38467,7 +38469,7 @@ const Xf = () => ul() === "production" ? "production" : "sandbox", A1 = () => gr
38467
38469
  onNavigateBack: e
38468
38470
  }) => {
38469
38471
  const { businessId: t } = Zo(), [i, n] = K(!0), [s, r] = K(!1), [o, d] = K([]), [u, m] = K(null);
38470
- Ve(() => {
38472
+ Ge(() => {
38471
38473
  (async () => {
38472
38474
  n(!0), await Promise.allSettled([
38473
38475
  KA(l.loanId).then(m).catch(() => m(null)),
@@ -38966,7 +38968,7 @@ const Xf = () => ul() === "production" ? "production" : "sandbox", A1 = () => gr
38966
38968
  onPaymentComplete: t
38967
38969
  }) => {
38968
38970
  const [i, n] = K("loading"), [s, r] = K(0), [o, d] = K(null), [u, m] = K(null), g = Bt(0), w = Bt(null);
38969
- Ve(() => (y(), () => {
38971
+ Ge(() => (y(), () => {
38970
38972
  w.current && clearTimeout(w.current);
38971
38973
  }), [l]);
38972
38974
  const y = async () => {
@@ -39041,7 +39043,7 @@ const Xf = () => ul() === "production" ? "production" : "sandbox", A1 = () => gr
39041
39043
  environment: t
39042
39044
  }) => {
39043
39045
  const { setSelectedLender: i, setSelectedLoans: n, businessId: s } = Zo(), [r, o] = K("lenderList"), [d, u] = K([]), [m, g] = K(null), [w, y] = K(null);
39044
- Ve(() => {
39046
+ Ge(() => {
39045
39047
  const V = new URLSearchParams(window.location.search), _ = V.get("order_id") || V.get("orderId") || V.get("cf_order_id"), q = _ || sessionStorage.getItem("fundly_repayment_order_id");
39046
39048
  _ && q && (sessionStorage.removeItem("fundly_repayment_order_id"), y(q), o("result"));
39047
39049
  }, []);