@everymatrix/cashier-page 1.94.36 → 1.94.37

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.
Files changed (70) hide show
  1. package/components/CashierCarousel-CWqhxf1D.cjs +1 -0
  2. package/components/{CashierCarousel-Ju7cQ53J.js → CashierCarousel-DFK922WR.js} +214 -178
  3. package/components/{CashierCarousel-B4jAzsnI.js → CashierCarousel-k7Y3Z9n1.js} +214 -178
  4. package/components/CashierError-C1W-9X8J.cjs +1 -0
  5. package/components/CashierError-C9gnnAyr.js +814 -0
  6. package/components/CashierError-WkiOBVs-.js +798 -0
  7. package/components/CashierHeader-BK500Xjw.cjs +1 -0
  8. package/components/{CashierHeader-BGpZFT0g.js → CashierHeader-Byz_chFz.js} +53 -32
  9. package/components/{CashierHeader-CP6ffv1-.js → CashierHeader-COwiXVNs.js} +53 -32
  10. package/components/CashierIframeRedirect-BDGjUNum.cjs +1 -0
  11. package/components/{CashierIframeRedirect-BhGJdt1S.js → CashierIframeRedirect-BoyUKotK.js} +69 -60
  12. package/components/{CashierIframeRedirect-Bf0iNUJc.js → CashierIframeRedirect-rUhN76X2.js} +69 -60
  13. package/components/{CashierMethodDetails-BJYlZyTr.js → CashierMethodDetails-CGdI_qop.js} +2488 -2194
  14. package/components/{CashierMethodDetails-DF2piOnQ.js → CashierMethodDetails-UYwG3pD4.js} +2389 -2095
  15. package/components/CashierMethodDetails-rXDr1XNZ.cjs +85 -0
  16. package/components/{CashierMethodsList-i6RsCq8_.js → CashierMethodsList-BJOLHbcD.js} +169 -133
  17. package/components/{CashierMethodsList-CceoUQus.js → CashierMethodsList-BL0sUyuY.js} +182 -146
  18. package/components/CashierMethodsList-CZV52Zob.cjs +1 -0
  19. package/components/{CashierModal-B_CMXPj2.js → CashierModal-B_7Q4iwq.js} +2 -2
  20. package/components/{CashierModal-Dd14V9-9.cjs → CashierModal-BxI26VGr.cjs} +1 -1
  21. package/components/{CashierModal-CvAq_Ya6.js → CashierModal-Dl0z5NVU.js} +2 -2
  22. package/components/{CashierNotifications-CGOL4Hgi.js → CashierNotifications-0c5qC2wE.js} +1 -1
  23. package/components/{CashierNotifications-B2ACV2Wj.js → CashierNotifications-BELBGieS.js} +1 -1
  24. package/components/{CashierNotifications-DiuiOKKG.cjs → CashierNotifications-IlgXqW4M.cjs} +1 -1
  25. package/components/CashierPage-56J3O0u0.cjs +23 -0
  26. package/components/{CashierPage-C78qNR_6.js → CashierPage-D9p8Vv64.js} +1159 -1018
  27. package/components/{CashierPage-9QGvgJdD.js → CashierPage-f3Bp0yQu.js} +1058 -917
  28. package/components/{CashierReceiptPage-BO_YWEks.cjs → CashierReceiptPage-CiR_vfro.cjs} +2 -2
  29. package/components/{CashierReceiptPage-C5xtHwlF.js → CashierReceiptPage-D2QaqABB.js} +800 -524
  30. package/components/{CashierReceiptPage-BN3nEO9S.js → CashierReceiptPage-HHsf22Go.js} +759 -483
  31. package/components/CashierSessionExpirationModal-BGSdk_Mj.cjs +2 -0
  32. package/components/{CashierSessionExpirationModal-BAxa-peO.js → CashierSessionExpirationModal-BgA16ICX.js} +366 -342
  33. package/components/{CashierSessionExpirationModal-BmDU66u_.js → CashierSessionExpirationModal-YD2SyMu-.js} +342 -318
  34. package/components/{CashierSpinner-78TTHLfL.js → CashierSpinner-B1exigYR.js} +2 -2
  35. package/components/{CashierSpinner-Cxrxu50U.js → CashierSpinner-WMxJlzPU.js} +2 -2
  36. package/components/{CashierSpinner-4oFy3A9w.cjs → CashierSpinner-xDUg2Ia3.cjs} +1 -1
  37. package/components/CashierStepUp-BJcULKh3.cjs +1 -0
  38. package/components/CashierStepUp-BX4oMHdc.js +1200 -0
  39. package/components/CashierStepUp-C_ptl1y7.js +1161 -0
  40. package/components/{CashierTransactionHistory-D4QXPykp.js → CashierTransactionHistory-CHZesJO5.js} +563 -488
  41. package/components/{CashierTransactionHistory-Cp1_tsYu.js → CashierTransactionHistory-CrflKpwN.js} +550 -475
  42. package/components/CashierTransactionHistory-TDbLeWcJ.cjs +1 -0
  43. package/components/{CashierVerifications-DCt6vl4P.js → CashierVerifications-BDZn88UR.js} +310 -249
  44. package/components/{CashierVerifications-DIXTooXo.js → CashierVerifications-CoqfO6l6.js} +309 -256
  45. package/components/CashierVerifications-QKE-9H4t.cjs +1 -0
  46. package/components/{TxnStatusIcon-BohNSp8i.cjs → TxnStatusIcon-BOdjGqDN.cjs} +1 -1
  47. package/components/{TxnStatusIcon-DxkpWqST.js → TxnStatusIcon-CXbH_076.js} +1 -1
  48. package/components/{TxnStatusIcon-BYUMew_B.js → TxnStatusIcon-Cvq52nxs.js} +1 -1
  49. package/components/{TxnTypeIcons-BNIyiw8U.js → TxnTypeIcons-BZnwBNqe.js} +1 -1
  50. package/components/{TxnTypeIcons-C3j3WSxa.js → TxnTypeIcons-D-qWVgkw.js} +1 -1
  51. package/components/{TxnTypeIcons-BUklfomB.cjs → TxnTypeIcons-DuRqxFjm.cjs} +1 -1
  52. package/es2015/cashier-page.cjs +1 -1
  53. package/es2015/cashier-page.js +1 -1
  54. package/esnext/cashier-page.js +1 -1
  55. package/package.json +1 -1
  56. package/components/CashierCarousel-BcDm5UC1.cjs +0 -1
  57. package/components/CashierError-DiBxWuzE.js +0 -642
  58. package/components/CashierError-DuQCc57p.js +0 -658
  59. package/components/CashierError-qOoBUKKi.cjs +0 -1
  60. package/components/CashierHeader-DJMhpwtG.cjs +0 -1
  61. package/components/CashierIframeRedirect-Cnzm6DaQ.cjs +0 -1
  62. package/components/CashierMethodDetails-BWunEzWc.cjs +0 -85
  63. package/components/CashierMethodsList-Usolzb6T.cjs +0 -1
  64. package/components/CashierPage-CWUHd9kH.cjs +0 -23
  65. package/components/CashierSessionExpirationModal-BaxvOINh.cjs +0 -2
  66. package/components/CashierStepUp-BRMl9Byl.js +0 -1092
  67. package/components/CashierStepUp-BsfyLsnN.cjs +0 -1
  68. package/components/CashierStepUp-CbqhLfIu.js +0 -1131
  69. package/components/CashierTransactionHistory-DS0DSRSZ.cjs +0 -1
  70. package/components/CashierVerifications-BHJ7Twd4.cjs +0 -1
@@ -1,1092 +0,0 @@
1
- import { a as Ke, $ as Ge, S as Ye, b as Je, s as Qe, f as oe, d as Ze, z as ye, g as O, l as S, n as v, p as r, q as $e, r as et, y as Oe, w as P, m as d, A as ee, Q as Y, o as R, x as L, F as xe, L as J, v as tt, D as Se, E as nt, c as it, B as ot } from "./CashierPage-9QGvgJdD.js";
2
- import { s as lt, a as rt, b as st } from "./CashierHeader-CP6ffv1-.js";
3
- function Me(n, t) {
4
- Ke(n, t);
5
- }
6
- function at(n) {
7
- Ge.set(n);
8
- }
9
- const Te = {
10
- en: {
11
- otpTitle: "Code verification is required",
12
- popupMessage: "Please enter the security code received on your SMS/email address to perform the update.",
13
- popupMessageLastWarning: "If the next validation attempt is failed, your transaction will fail and you will be returned back to payment method.",
14
- minutes: "minutes",
15
- errorHeader: "Error",
16
- configError: "Unable to load OTP data. Please try again later.",
17
- otpHeading: "Enter OTP",
18
- resendOtp: "Resent OTP",
19
- submit: "Submit",
20
- close: "Close",
21
- invalidOtp: "The code you've sent is not valid. Please try again.",
22
- accountBlocked: "Too many attempts for OTP. Your account has been blocked for one hour.",
23
- submissionError: "Something went wrong. Please try again.",
24
- otpExpiredMessage: "Validation code has expired, please request a new one to continue.",
25
- timeRemaining: "Code expires in:",
26
- selectChannelTitle: "Select verification method",
27
- selectChannelMessage: "Choose how you would like to receive your verification code",
28
- channelSMS: "SMS",
29
- channelEmail: "Email",
30
- sendCode: "Send code",
31
- waitSeconds: "Please wait for before resending:"
32
- },
33
- tr: {
34
- otpTitle: "Kod doğrulaması gereklidir",
35
- popupMessage: "Güncellemeyi gerçekleştirmek için SMS/e-posta adresinize gönderilen güvenlik kodunu girin.",
36
- popupMessageLastWarning: "Bir sonraki doğrulama denemesi başarısız olursa, işleminiz başarısız olacak ve ödeme yöntemine geri döndürüleceksiniz.",
37
- minutes: "dakika",
38
- errorHeader: "Hata",
39
- configError: "OTP verileri yüklenemedi. Lütfen daha sonra tekrar deneyin.",
40
- otpHeading: "OTP Girin",
41
- resendOtp: "OTP'yi Yeniden Gönder",
42
- submit: "Gönder",
43
- close: "Kapat",
44
- invalidOtp: "Gönderdiğiniz kod geçerli değil. Lütfen tekrar deneyin.",
45
- accountBlocked: "OTP için çok fazla deneme yapıldı. Hesabınız bir saat süreyle engellenmiştir.",
46
- submissionError: "Bir şeyler ters gitti. Lütfen tekrar deneyin.",
47
- otpExpiredMessage: "Doğrulama kodunun süresi doldu, devam etmek için lütfen yeni bir kod isteyin.",
48
- timeRemaining: "Kodun süresi doluyor:",
49
- selectChannelTitle: "Doğrulama yöntemi seçin",
50
- selectChannelMessage: "Doğrulama kodunuzu nasıl almak istediğinizi seçin",
51
- channelSMS: "SMS kodu",
52
- channelEmail: "E-posta kodu",
53
- sendCode: "Kodu gönder",
54
- waitSeconds: "Tekrar göndermeden önce lütfen bekleyin:"
55
- },
56
- fr: {
57
- otpTitle: "La vérification par code est requise",
58
- popupMessage: "Veuillez saisir le code de sécurité reçu par SMS ou par e-mail afin d’effectuer la mise à jour.",
59
- popupMessageLastWarning: "Si la prochaine tentative de validation échoue, votre transaction échouera et vous serez redirigé vers le moyen de paiement.",
60
- minutes: "minutes",
61
- errorHeader: "Erreur",
62
- configError: "Impossible de charger les données OTP. Veuillez réessayer plus tard.",
63
- otpHeading: "Saisir le code OTP",
64
- resendOtp: "Renvoyer le code OTP",
65
- submit: "Valider",
66
- close: "Fermer",
67
- invalidOtp: "Le code que vous avez saisi n’est pas valide. Veuillez réessayer.",
68
- accountBlocked: "Trop de tentatives de code OTP. Votre compte a été bloqué pendant une heure.",
69
- submissionError: "Une erreur s’est produite. Veuillez réessayer.",
70
- otpExpiredMessage: "Le code de validation a expiré. Veuillez en demander un nouveau pour continuer.",
71
- timeRemaining: "Le code expire dans :",
72
- selectChannelTitle: "Sélectionner la méthode de vérification",
73
- selectChannelMessage: "Choisissez comment vous souhaitez recevoir votre code de vérification",
74
- channelSMS: "SMS",
75
- channelEmail: "E-mail",
76
- sendCode: "Envoyer le code",
77
- waitSeconds: "Veuillez patienter avant de renvoyer le code :"
78
- }
79
- };
80
- function ct(n) {
81
- Ze(n, "svelte-gpy3mu", '*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}.RadioIndicator{width:20px;height:20px;border-radius:50%;border:2px solid var(--emw--color-typography, #fff);position:relative;flex-shrink:0;margin-right:8px;transition:all 0.2s ease;opacity:0.7}.RadioIndicator.checked::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:10px;height:10px;border-radius:50%;opacity:1;background:var(--emw--color-primary, #fff)}.RadioIndicator.checked{border:2px solid var(--emw--color-primary, #fff)}.ModalCloseIcon{padding:0px;position:absolute;right:0;top:0;margin:15px 20px;z-index:20;transition:all 0.3s ease}.ModalCloseIcon svg{width:11px;height:11px;fill:var(--emw--color-primary, red);cursor:pointer}.ModalCloseIcon:hover{transform:rotate(90deg)}.OtpContent{width:100%;display:flex;flex-direction:column;gap:var(--emw--spacing-large, 20px)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpButton{text-transform:uppercase;font-weight:var(--emw--font-weight-medium, 500);color:var(--emw--color-typography-button, #000000);text-align:center;font-size:var(--emw--font-size-medium, 16px);font-style:normal;font-family:inherit;height:46px;line-height:normal;border:none;background:var(--emw--color-primary, #f9c408);border-radius:10px;width:100%;margin:var(--emw--spacing-small, 12px) 0;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:var(--emw--spacing-2x-small-plus, 5px);transition:all 0.2s linear}.OtpButton:active{box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-active, #fecd1c)}.OtpButton[disabled],.OtpButton.disabled{filter:saturate(50%);opacity:0.5;cursor:not-allowed;pointer-events:none}.OtpButton:hover:not([disabled]):not(.disabled){box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-hover, #dbac03)}@container (max-width: 500px){.OtpDescription{font-size:var(--emw--font-size-small, 12px)}.OtpDescription .Title{font-size:var(--emw--font-size-big, 20px)}}.OtpDescription{display:flex;color:var(--emw--color-typography, #fff);flex-direction:column;gap:12px;font-size:var(--emw--font-size-small, 12px)}.OtpDescription .Title{font-size:var(--emw--font-medium, 16px);font-weight:var(--emw--font-weight-medium, 600)}.OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px;align-items:center}.OtpError h2{margin:0;color:var(--emw--color-typography, #fff)}.OtpError p{color:var(--emw--color-typography, #fff);text-align:center;font-size:var(--emw--font-size-small, 12px)}.OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.ChannelSelection{display:flex;flex-direction:row;justify-content:space-between}.ChannelCheckbox{display:flex;align-items:center;padding:var(--emw--spacing-medium, 16px);cursor:pointer;transition:all 0.2s ease}.ChannelCheckbox input[type=radio]{display:none}.ChannelCheckbox .ChannelContent{display:flex;align-items:center;gap:3px;width:100%;color:var(--emw--color-typography, #fff);font-size:var(--emw--font-size-medium, 16px);font-weight:var(--emw--font-weight-medium, 500)}.ChannelCheckbox .ChannelContent svg{flex-shrink:0;opacity:0.7;width:20px;height:20px}.ChannelCheckbox .ChannelContent span{text-transform:uppercase}.ChannelCheckbox.selected .ChannelContent{color:var(--emw--color-primary, #000000)}.ChannelCheckbox.selected .ChannelContent svg{stroke:var(--emw--color-primary, #000000);opacity:1}.ChannelCheckbox:hover:not(.selected){color:var(--emw--color-active, #fff)}.OtpField{display:flex;justify-content:space-between;margin:10px}.OtpField input{width:45px;font-size:32px;padding:5px;text-align:center;border-radius:5px;margin:6px;font-weight:bold;outline:none;background:var(--emw--color-background);border:0;transition:all 0.1s;box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.3);color:var(--emw--color-typography, #fff)}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{box-shadow:0 0 1px 1px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between;gap:40px}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpNoticeMessage{color:var(--emw--color-primary, #f9c408);font-weight:bold}.LastWarningMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;display:flex;justify-content:center;align-items:center;padding:20px 0}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.OtpTimer{color:var(--emw--color-typography, #fff);font-size:var(--emw--font-size-small, 12px);opacity:0.8}@container (max-width: 500px){.OtpContent{padding:var(--emw--spacing-small, 10px)}.OtpField input{width:40px;font-size:28px;margin:4px}}');
82
- }
83
- function Le(n, t, e) {
84
- const i = n.slice();
85
- return i[69] = t[e], i[70] = t, i[71] = e, i;
86
- }
87
- function pt(n) {
88
- let t, e, i, o, a, p, s, u, f, _, w, T, M, b, m, y, C, A = (
89
- /*$_*/
90
- n[19]("channelSMS") + ""
91
- ), X, F, j, I, te, W, Q, le, Z, E, z, N, re, se, ae = (
92
- /*$_*/
93
- n[19]("channelEmail") + ""
94
- ), q, de, U, B, G, ce, pe;
95
- function ue(c, k) {
96
- return (
97
- /*showResendOtp*/
98
- c[9] ? mt : (
99
- /*showOtpInput*/
100
- c[12] ? dt : ft
101
- )
102
- );
103
- }
104
- let $ = ue(n), K = $(n), V = (
105
- /*selectedChannel*/
106
- n[0] && Ae(n)
107
- );
108
- function fe(c, k) {
109
- if (
110
- /*isLoading*/
111
- c[3] && /*showOtpInput*/
112
- c[12]
113
- )
114
- return yt;
115
- if (
116
- /*showOtpInput*/
117
- c[12] && /*config*/
118
- c[4]
119
- )
120
- return _t;
121
- }
122
- let ne = fe(n), D = ne && ne(n);
123
- function me(c, k) {
124
- if (
125
- /*showResendOtp*/
126
- c[9]
127
- )
128
- return kt;
129
- if (
130
- /*showOtpInput*/
131
- c[12] && /*config*/
132
- c[4]
133
- )
134
- return vt;
135
- }
136
- let ie = me(n), x = ie && ie(n);
137
- return {
138
- c() {
139
- t = v("div"), K.c(), e = R(), i = v("div"), o = v("label"), a = v("div"), p = R(), s = v("input"), f = R(), _ = v("div"), w = Y("svg"), T = Y("path"), M = Y("circle"), b = Y("circle"), m = Y("circle"), y = R(), C = v("span"), X = L(A), F = R(), j = v("label"), I = v("div"), te = R(), W = v("input"), le = R(), Z = v("div"), E = Y("svg"), z = Y("rect"), N = Y("path"), re = R(), se = v("span"), q = L(ae), de = R(), V && V.c(), U = R(), D && D.c(), B = R(), G = v("div"), x && x.c(), r(t, "class", "OtpDescription"), r(a, "class", "RadioIndicator"), J(
140
- a,
141
- "checked",
142
- /*selectedChannel*/
143
- n[0] === /*channels*/
144
- n[20].SMS
145
- ), r(s, "type", "radio"), r(s, "name", "channel"), s.value = /*channels*/
146
- n[20].SMS, s.checked = u = /*selectedChannel*/
147
- n[0] === /*channels*/
148
- n[20].SMS, r(T, "d", "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"), r(M, "cx", "9"), r(M, "cy", "11"), r(M, "r", "0.5"), r(M, "fill", "currentColor"), r(b, "cx", "12"), r(b, "cy", "11"), r(b, "r", "0.5"), r(b, "fill", "currentColor"), r(m, "cx", "15"), r(m, "cy", "11"), r(m, "r", "0.5"), r(m, "fill", "currentColor"), r(w, "xmlns", "http://www.w3.org/2000/svg"), r(w, "width", "24"), r(w, "height", "24"), r(w, "viewBox", "0 0 24 24"), r(w, "fill", "none"), r(w, "stroke", "currentColor"), r(w, "stroke-width", "2"), r(w, "stroke-linecap", "round"), r(w, "stroke-linejoin", "round"), r(_, "class", "ChannelContent"), r(o, "class", "ChannelCheckbox"), J(
149
- o,
150
- "selected",
151
- /*selectedChannel*/
152
- n[0] === /*channels*/
153
- n[20].SMS
154
- ), r(I, "class", "RadioIndicator"), J(
155
- I,
156
- "checked",
157
- /*selectedChannel*/
158
- n[0] === /*channels*/
159
- n[20].EMAIL
160
- ), r(W, "type", "radio"), r(W, "name", "channel"), W.value = /*channels*/
161
- n[20].EMAIL, W.checked = Q = /*selectedChannel*/
162
- n[0] === /*channels*/
163
- n[20].EMAIL, r(z, "x", "2"), r(z, "y", "4"), r(z, "width", "20"), r(z, "height", "16"), r(z, "rx", "2"), r(N, "d", "m2 7 10 6 10-6"), r(E, "xmlns", "http://www.w3.org/2000/svg"), r(E, "width", "24"), r(E, "height", "24"), r(E, "viewBox", "0 0 24 24"), r(E, "fill", "none"), r(E, "stroke", "currentColor"), r(E, "stroke-width", "2"), r(E, "stroke-linecap", "round"), r(E, "stroke-linejoin", "round"), r(Z, "class", "ChannelContent"), r(j, "class", "ChannelCheckbox"), J(
164
- j,
165
- "selected",
166
- /*selectedChannel*/
167
- n[0] === /*channels*/
168
- n[20].EMAIL
169
- ), r(i, "class", "ChannelSelection"), r(G, "class", "OtpActionButtons");
170
- },
171
- m(c, k) {
172
- S(c, t, k), K.m(t, null), S(c, e, k), S(c, i, k), d(i, o), d(o, a), d(o, p), d(o, s), d(o, f), d(o, _), d(_, w), d(w, T), d(w, M), d(w, b), d(w, m), d(_, y), d(_, C), d(C, X), d(i, F), d(i, j), d(j, I), d(j, te), d(j, W), d(j, le), d(j, Z), d(Z, E), d(E, z), d(E, N), d(Z, re), d(Z, se), d(se, q), S(c, de, k), V && V.m(c, k), S(c, U, k), D && D.m(c, k), S(c, B, k), S(c, G, k), x && x.m(G, null), ce || (pe = [
173
- ee(
174
- s,
175
- "change",
176
- /*change_handler*/
177
- n[39]
178
- ),
179
- ee(
180
- W,
181
- "change",
182
- /*change_handler_1*/
183
- n[40]
184
- )
185
- ], ce = !0);
186
- },
187
- p(c, k) {
188
- $ === ($ = ue(c)) && K ? K.p(c, k) : (K.d(1), K = $(c), K && (K.c(), K.m(t, null))), k[0] & /*selectedChannel, channels*/
189
- 1048577 && J(
190
- a,
191
- "checked",
192
- /*selectedChannel*/
193
- c[0] === /*channels*/
194
- c[20].SMS
195
- ), k[0] & /*selectedChannel*/
196
- 1 && u !== (u = /*selectedChannel*/
197
- c[0] === /*channels*/
198
- c[20].SMS) && (s.checked = u), k[0] & /*$_*/
199
- 524288 && A !== (A = /*$_*/
200
- c[19]("channelSMS") + "") && P(X, A), k[0] & /*selectedChannel, channels*/
201
- 1048577 && J(
202
- o,
203
- "selected",
204
- /*selectedChannel*/
205
- c[0] === /*channels*/
206
- c[20].SMS
207
- ), k[0] & /*selectedChannel, channels*/
208
- 1048577 && J(
209
- I,
210
- "checked",
211
- /*selectedChannel*/
212
- c[0] === /*channels*/
213
- c[20].EMAIL
214
- ), k[0] & /*selectedChannel*/
215
- 1 && Q !== (Q = /*selectedChannel*/
216
- c[0] === /*channels*/
217
- c[20].EMAIL) && (W.checked = Q), k[0] & /*$_*/
218
- 524288 && ae !== (ae = /*$_*/
219
- c[19]("channelEmail") + "") && P(q, ae), k[0] & /*selectedChannel, channels*/
220
- 1048577 && J(
221
- j,
222
- "selected",
223
- /*selectedChannel*/
224
- c[0] === /*channels*/
225
- c[20].EMAIL
226
- ), /*selectedChannel*/
227
- c[0] ? V ? V.p(c, k) : (V = Ae(c), V.c(), V.m(U.parentNode, U)) : V && (V.d(1), V = null), ne === (ne = fe(c)) && D ? D.p(c, k) : (D && D.d(1), D = ne && ne(c), D && (D.c(), D.m(B.parentNode, B))), ie === (ie = me(c)) && x ? x.p(c, k) : (x && x.d(1), x = ie && ie(c), x && (x.c(), x.m(G, null)));
228
- },
229
- d(c) {
230
- c && (O(t), O(e), O(i), O(de), O(U), O(B), O(G)), K.d(), V && V.d(c), D && D.d(c), x && x.d(), ce = !1, xe(pe);
231
- }
232
- };
233
- }
234
- function ut(n) {
235
- let t, e, i, o, a, p, s = (
236
- /*$_*/
237
- n[19]("errorHeader") + ""
238
- ), u, f, _, w, T, M, b = (
239
- /*$_*/
240
- n[19]("close") + ""
241
- ), m, y, C;
242
- return {
243
- c() {
244
- t = v("div"), e = v("div"), i = Y("svg"), o = Y("path"), a = R(), p = v("h2"), u = L(s), f = R(), _ = v("p"), w = L(
245
- /*errorMessage*/
246
- n[8]
247
- ), T = R(), M = v("button"), m = L(b), r(o, "d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"), r(i, "xmlns", "http://www.w3.org/2000/svg"), r(i, "viewBox", "0 0 512 512"), r(e, "class", "OtpErrorHeader"), r(M, "class", "OtpButton error"), r(t, "class", "OtpError");
248
- },
249
- m(A, X) {
250
- S(A, t, X), d(t, e), d(e, i), d(i, o), d(e, a), d(e, p), d(p, u), d(t, f), d(t, _), d(_, w), d(t, T), d(t, M), d(M, m), y || (C = ee(
251
- M,
252
- "click",
253
- /*manualClosePopup*/
254
- n[28]
255
- ), y = !0);
256
- },
257
- p(A, X) {
258
- X[0] & /*$_*/
259
- 524288 && s !== (s = /*$_*/
260
- A[19]("errorHeader") + "") && P(u, s), X[0] & /*errorMessage*/
261
- 256 && P(
262
- w,
263
- /*errorMessage*/
264
- A[8]
265
- ), X[0] & /*$_*/
266
- 524288 && b !== (b = /*$_*/
267
- A[19]("close") + "") && P(m, b);
268
- },
269
- d(A) {
270
- A && O(t), y = !1, C();
271
- }
272
- };
273
- }
274
- function dt(n) {
275
- let t, e, i, o;
276
- function a(f, _) {
277
- return (
278
- /*isLastWarning*/
279
- f[10] ? gt : ht
280
- );
281
- }
282
- let p = a(n), s = p(n), u = (
283
- /*hasErrors*/
284
- n[6] && ze(n)
285
- );
286
- return {
287
- c() {
288
- t = v("p"), s.c(), i = R(), u && u.c(), o = tt(), r(t, "class", e = /*isLastWarning*/
289
- n[10] ? "LastWarningMessage" : "");
290
- },
291
- m(f, _) {
292
- S(f, t, _), s.m(t, null), S(f, i, _), u && u.m(f, _), S(f, o, _);
293
- },
294
- p(f, _) {
295
- p === (p = a(f)) && s ? s.p(f, _) : (s.d(1), s = p(f), s && (s.c(), s.m(t, null))), _[0] & /*isLastWarning*/
296
- 1024 && e !== (e = /*isLastWarning*/
297
- f[10] ? "LastWarningMessage" : "") && r(t, "class", e), /*hasErrors*/
298
- f[6] ? u ? u.p(f, _) : (u = ze(f), u.c(), u.m(o.parentNode, o)) : u && (u.d(1), u = null);
299
- },
300
- d(f) {
301
- f && (O(t), O(i), O(o)), s.d(), u && u.d(f);
302
- }
303
- };
304
- }
305
- function ft(n) {
306
- let t, e = (
307
- /*$_*/
308
- (n[19]("selectChannelMessage") || "Selectează metoda prin care vrei să primești codul OTP") + ""
309
- ), i;
310
- return {
311
- c() {
312
- t = v("p"), i = L(e);
313
- },
314
- m(o, a) {
315
- S(o, t, a), d(t, i);
316
- },
317
- p(o, a) {
318
- a[0] & /*$_*/
319
- 524288 && e !== (e = /*$_*/
320
- (o[19]("selectChannelMessage") || "Selectează metoda prin care vrei să primești codul OTP") + "") && P(i, e);
321
- },
322
- d(o) {
323
- o && O(t);
324
- }
325
- };
326
- }
327
- function mt(n) {
328
- let t, e = (
329
- /*$_*/
330
- n[19]("otpExpiredMessage") + ""
331
- ), i;
332
- return {
333
- c() {
334
- t = v("p"), i = L(e), r(t, "class", "OtpNoticeMessage"), r(t, "role", "alert");
335
- },
336
- m(o, a) {
337
- S(o, t, a), d(t, i);
338
- },
339
- p(o, a) {
340
- a[0] & /*$_*/
341
- 524288 && e !== (e = /*$_*/
342
- o[19]("otpExpiredMessage") + "") && P(i, e);
343
- },
344
- d(o) {
345
- o && O(t);
346
- }
347
- };
348
- }
349
- function ht(n) {
350
- let t = (
351
- /*$_*/
352
- n[19]("popupMessage") + ""
353
- ), e;
354
- return {
355
- c() {
356
- e = L(t);
357
- },
358
- m(i, o) {
359
- S(i, e, o);
360
- },
361
- p(i, o) {
362
- o[0] & /*$_*/
363
- 524288 && t !== (t = /*$_*/
364
- i[19]("popupMessage") + "") && P(e, t);
365
- },
366
- d(i) {
367
- i && O(e);
368
- }
369
- };
370
- }
371
- function gt(n) {
372
- let t = (
373
- /*$_*/
374
- n[19]("popupMessageLastWarning") + ""
375
- ), e;
376
- return {
377
- c() {
378
- e = L(t);
379
- },
380
- m(i, o) {
381
- S(i, e, o);
382
- },
383
- p(i, o) {
384
- o[0] & /*$_*/
385
- 524288 && t !== (t = /*$_*/
386
- i[19]("popupMessageLastWarning") + "") && P(e, t);
387
- },
388
- d(i) {
389
- i && O(e);
390
- }
391
- };
392
- }
393
- function ze(n) {
394
- let t, e;
395
- return {
396
- c() {
397
- t = v("p"), e = L(
398
- /*errorMessage*/
399
- n[8]
400
- ), r(t, "class", "OtpErrorMessage"), r(t, "role", "alert");
401
- },
402
- m(i, o) {
403
- S(i, t, o), d(t, e);
404
- },
405
- p(i, o) {
406
- o[0] & /*errorMessage*/
407
- 256 && P(
408
- e,
409
- /*errorMessage*/
410
- i[8]
411
- );
412
- },
413
- d(i) {
414
- i && O(t);
415
- }
416
- };
417
- }
418
- function Ae(n) {
419
- let t, e, i, o;
420
- function a(u, f) {
421
- return (
422
- /*currentChannelTimer*/
423
- u[17] > 0 ? wt : bt
424
- );
425
- }
426
- let p = a(n), s = p(n);
427
- return {
428
- c() {
429
- t = v("button"), s.c(), r(t, "class", "OtpButton"), t.disabled = e = !/*canSubmitChannel*/
430
- n[18], J(t, "disabled", !/*canSubmitChannel*/
431
- n[18] || /*waitingForConfig*/
432
- n[16]);
433
- },
434
- m(u, f) {
435
- S(u, t, f), s.m(t, null), i || (o = ee(
436
- t,
437
- "click",
438
- /*handleChannelSubmit*/
439
- n[22]
440
- ), i = !0);
441
- },
442
- p(u, f) {
443
- p === (p = a(u)) && s ? s.p(u, f) : (s.d(1), s = p(u), s && (s.c(), s.m(t, null))), f[0] & /*canSubmitChannel*/
444
- 262144 && e !== (e = !/*canSubmitChannel*/
445
- u[18]) && (t.disabled = e), f[0] & /*canSubmitChannel, waitingForConfig*/
446
- 327680 && J(t, "disabled", !/*canSubmitChannel*/
447
- u[18] || /*waitingForConfig*/
448
- u[16]);
449
- },
450
- d(u) {
451
- u && O(t), s.d(), i = !1, o();
452
- }
453
- };
454
- }
455
- function bt(n) {
456
- let t = (
457
- /*$_*/
458
- n[19]("sendCode") + ""
459
- ), e;
460
- return {
461
- c() {
462
- e = L(t);
463
- },
464
- m(i, o) {
465
- S(i, e, o);
466
- },
467
- p(i, o) {
468
- o[0] & /*$_*/
469
- 524288 && t !== (t = /*$_*/
470
- i[19]("sendCode") + "") && P(e, t);
471
- },
472
- d(i) {
473
- i && O(e);
474
- }
475
- };
476
- }
477
- function wt(n) {
478
- let t = (
479
- /*$_*/
480
- n[19]("waitSeconds") + ""
481
- ), e, i, o, a;
482
- return {
483
- c() {
484
- e = L(t), i = L(" ("), o = L(
485
- /*currentChannelTimer*/
486
- n[17]
487
- ), a = L("s)");
488
- },
489
- m(p, s) {
490
- S(p, e, s), S(p, i, s), S(p, o, s), S(p, a, s);
491
- },
492
- p(p, s) {
493
- s[0] & /*$_*/
494
- 524288 && t !== (t = /*$_*/
495
- p[19]("waitSeconds") + "") && P(e, t), s[0] & /*currentChannelTimer*/
496
- 131072 && P(
497
- o,
498
- /*currentChannelTimer*/
499
- p[17]
500
- );
501
- },
502
- d(p) {
503
- p && (O(e), O(i), O(o), O(a));
504
- }
505
- };
506
- }
507
- function _t(n) {
508
- let t, e, i = (
509
- /*$_*/
510
- n[19]("timeRemaining") + ""
511
- ), o, a, p = (
512
- /*formatTime*/
513
- n[23](
514
- /*timeLeft*/
515
- n[5]
516
- ) + ""
517
- ), s, u, f = (
518
- /*$_*/
519
- n[19]("minutes") + ""
520
- ), _, w, T, M = Se(
521
- /*otp*/
522
- n[2]
523
- ), b = [];
524
- for (let m = 0; m < M.length; m += 1)
525
- b[m] = Ie(Le(n, M, m));
526
- return {
527
- c() {
528
- t = v("div"), e = v("div"), o = L(i), a = R(), s = L(p), u = R(), _ = L(f), w = R(), T = v("div");
529
- for (let m = 0; m < b.length; m += 1)
530
- b[m].c();
531
- r(e, "class", "OtpTimer"), r(T, "class", "OtpField"), r(t, "class", "OtpFieldWrapper");
532
- },
533
- m(m, y) {
534
- S(m, t, y), d(t, e), d(e, o), d(e, a), d(e, s), d(e, u), d(e, _), d(t, w), d(t, T);
535
- for (let C = 0; C < b.length; C += 1)
536
- b[C] && b[C].m(T, null);
537
- },
538
- p(m, y) {
539
- if (y[0] & /*$_*/
540
- 524288 && i !== (i = /*$_*/
541
- m[19]("timeRemaining") + "") && P(o, i), y[0] & /*timeLeft*/
542
- 32 && p !== (p = /*formatTime*/
543
- m[23](
544
- /*timeLeft*/
545
- m[5]
546
- ) + "") && P(s, p), y[0] & /*$_*/
547
- 524288 && f !== (f = /*$_*/
548
- m[19]("minutes") + "") && P(_, f), y[0] & /*config, otp, inputDisabled, otpInputs, handleOtpInput, handleKeyDown, handleOnPasteOtp*/
549
- 117458964) {
550
- M = Se(
551
- /*otp*/
552
- m[2]
553
- );
554
- let C;
555
- for (C = 0; C < M.length; C += 1) {
556
- const A = Le(m, M, C);
557
- b[C] ? b[C].p(A, y) : (b[C] = Ie(A), b[C].c(), b[C].m(T, null));
558
- }
559
- for (; C < b.length; C += 1)
560
- b[C].d(1);
561
- b.length = M.length;
562
- }
563
- },
564
- d(m) {
565
- m && O(t), nt(b, m);
566
- }
567
- };
568
- }
569
- function yt(n) {
570
- let t;
571
- return {
572
- c() {
573
- t = v("div"), t.innerHTML = '<span class="OtpLoader"></span>', r(t, "class", "OtpLoaderContainer");
574
- },
575
- m(e, i) {
576
- S(e, t, i);
577
- },
578
- p: ye,
579
- d(e) {
580
- e && O(t);
581
- }
582
- };
583
- }
584
- function Ie(n) {
585
- let t, e, i, o = (
586
- /*index*/
587
- n[71]
588
- ), a, p;
589
- const s = () => (
590
- /*input_binding*/
591
- n[41](t, o)
592
- ), u = () => (
593
- /*input_binding*/
594
- n[41](null, o)
595
- );
596
- function f(...w) {
597
- return (
598
- /*input_handler*/
599
- n[42](
600
- /*index*/
601
- n[71],
602
- ...w
603
- )
604
- );
605
- }
606
- function _(...w) {
607
- return (
608
- /*keydown_handler*/
609
- n[43](
610
- /*index*/
611
- n[71],
612
- ...w
613
- )
614
- );
615
- }
616
- return {
617
- c() {
618
- t = v("input"), r(t, "id", `otp-input-${/*index*/
619
- n[71]}`), r(t, "type", "text"), r(t, "class", e = `otp-box ${/*config*/
620
- n[4].inputLength % 2 === 0 && /*index*/
621
- n[71] === /*config*/
622
- n[4].inputLength / 2 - 1 ? "space" : ""}`), r(t, "maxlength", 1), t.value = i = /*char*/
623
- n[69], r(t, "inputmode", "numeric"), t.disabled = /*inputDisabled*/
624
- n[11], r(t, "autocomplete", "off");
625
- },
626
- m(w, T) {
627
- S(w, t, T), s(), a || (p = [
628
- ee(t, "input", f),
629
- ee(t, "keydown", _),
630
- ee(
631
- t,
632
- "paste",
633
- /*handleOnPasteOtp*/
634
- n[24]
635
- )
636
- ], a = !0);
637
- },
638
- p(w, T) {
639
- n = w, T[0] & /*config*/
640
- 16 && e !== (e = `otp-box ${/*config*/
641
- n[4].inputLength % 2 === 0 && /*index*/
642
- n[71] === /*config*/
643
- n[4].inputLength / 2 - 1 ? "space" : ""}`) && r(t, "class", e), T[0] & /*otp*/
644
- 4 && i !== (i = /*char*/
645
- n[69]) && t.value !== i && (t.value = i), T[0] & /*inputDisabled*/
646
- 2048 && (t.disabled = /*inputDisabled*/
647
- n[11]), o !== /*index*/
648
- n[71] && (u(), o = /*index*/
649
- n[71], s());
650
- },
651
- d(w) {
652
- w && O(t), u(), a = !1, xe(p);
653
- }
654
- };
655
- }
656
- function vt(n) {
657
- let t, e = (
658
- /*$_*/
659
- n[19]("submit") + ""
660
- ), i, o, a, p;
661
- return {
662
- c() {
663
- t = v("button"), i = L(e), r(t, "class", "OtpButton"), t.disabled = o = /*otp*/
664
- n[2].join("").length !== /*config*/
665
- n[4].inputLength || /*isSubmitting*/
666
- n[13] || /*maxAttempts*/
667
- n[15];
668
- },
669
- m(s, u) {
670
- S(s, t, u), d(t, i), a || (p = ee(
671
- t,
672
- "click",
673
- /*submitOtp*/
674
- n[29]
675
- ), a = !0);
676
- },
677
- p(s, u) {
678
- u[0] & /*$_*/
679
- 524288 && e !== (e = /*$_*/
680
- s[19]("submit") + "") && P(i, e), u[0] & /*otp, config, isSubmitting, maxAttempts*/
681
- 40980 && o !== (o = /*otp*/
682
- s[2].join("").length !== /*config*/
683
- s[4].inputLength || /*isSubmitting*/
684
- s[13] || /*maxAttempts*/
685
- s[15]) && (t.disabled = o);
686
- },
687
- d(s) {
688
- s && O(t), a = !1, p();
689
- }
690
- };
691
- }
692
- function kt(n) {
693
- let t, e = (
694
- /*$_*/
695
- n[19]("resendOtp") + ""
696
- ), i, o, a;
697
- return {
698
- c() {
699
- t = v("button"), i = L(e), r(t, "class", "OtpButton");
700
- },
701
- m(p, s) {
702
- S(p, t, s), d(t, i), o || (a = ee(
703
- t,
704
- "click",
705
- /*handleResendOtp*/
706
- n[27]
707
- ), o = !0);
708
- },
709
- p(p, s) {
710
- s[0] & /*$_*/
711
- 524288 && e !== (e = /*$_*/
712
- p[19]("resendOtp") + "") && P(i, e);
713
- },
714
- d(p) {
715
- p && O(t), o = !1, a();
716
- }
717
- };
718
- }
719
- function Ct(n) {
720
- let t;
721
- function e(a, p) {
722
- return (
723
- /*hasConfigErrors*/
724
- a[7] ? ut : pt
725
- );
726
- }
727
- let i = e(n), o = i(n);
728
- return {
729
- c() {
730
- t = v("div"), o.c(), r(t, "class", "OtpContent");
731
- },
732
- m(a, p) {
733
- S(a, t, p), o.m(t, null), n[44](t);
734
- },
735
- p(a, p) {
736
- i === (i = e(a)) && o ? o.p(a, p) : (o.d(1), o = i(a), o && (o.c(), o.m(t, null)));
737
- },
738
- i: ye,
739
- o: ye,
740
- d(a) {
741
- a && O(t), o.d(), n[44](null);
742
- }
743
- };
744
- }
745
- function Et(n, t, e) {
746
- let i, o, a;
747
- $e(n, ot, (l) => e(19, a = l));
748
- let { clientstyling: p = "" } = t, { clientstylingurl: s = "" } = t, { mbsource: u } = t, { lang: f = "en" } = t, { endpoint: _ } = t, { session: w } = t, { translationurl: T } = t, { templateid: M } = t, b = [], m = !0, y = null, C = 0, A = "", X = "", F = !1, j = !1, I = "", te = "", W = "", Q = !1, le = !1, Z = !1, E = "", z = {}, N = null, re = !1, se = !1, ae = "", q, de, U = [], B = null, G = 0, ce = !1, pe = !1;
749
- const ue = { SMS: "sms", EMAIL: "email" }, $ = {
750
- MAX_ATTEMPTS_EXCEEDED: "gm.twofa.token_max_attempts_exceeded",
751
- INTERNAL_SERVER_ERROR: "gm.multifactorauthentication.internal_server_error",
752
- MAX_INVALIDATE: "gm.multifactorauthentication.challenge_internal_server_error"
753
- };
754
- Object.keys(Te).forEach((l) => {
755
- Me(l, Te[l]);
756
- });
757
- const K = () => {
758
- at(f);
759
- }, V = () => {
760
- fetch(T).then((l) => l.json()).then((l) => {
761
- Object.keys(l).forEach((h) => {
762
- Me(h, l[h]);
763
- });
764
- }).catch((l) => {
765
- console.log(l);
766
- });
767
- }, fe = async (l) => {
768
- if (l.detail?.["x-step-up-required"]) {
769
- if (e(7, j = !1), e(6, F = !1), e(8, I = ""), te = l.detail["x-step-up-token"], W = l.detail.flow, !te || !W) {
770
- e(3, m = !1), e(7, j = !0), e(8, I = a("configError"));
771
- return;
772
- }
773
- e(12, re = !1), e(3, m = !1);
774
- }
775
- }, ne = () => {
776
- B && (clearInterval(B), B = null), N && (clearInterval(N), N = null), e(6, F = !1), e(7, j = !1), e(8, I = ""), e(10, le = !1), e(2, b = []), e(4, y = null), e(3, m = !0), e(0, E = ""), e(12, re = !1), e(38, z = {});
777
- }, D = () => {
778
- ne();
779
- }, me = () => new Promise((l, h) => {
780
- const g = new URL(`${_}/api/pam/v1/mfa/challenge/${te}`), H = new Headers();
781
- H.append("accept", "application/json"), H.append("Content-Type", "application/json"), H.append("X-SessionId", `${w}`), e(16, pe = !0);
782
- const _e = {
783
- method: "PATCH",
784
- headers: H,
785
- body: JSON.stringify({
786
- channel: E,
787
- templateId: M
788
- })
789
- };
790
- fetch(g, _e).then((Ee) => Ee.json()).then(() => {
791
- e(15, ce = !1), k(), ge(), l();
792
- }).catch((Ee) => {
793
- h();
794
- });
795
- }), ie = () => {
796
- N && clearInterval(N), N = setInterval(
797
- () => {
798
- const l = { ...z };
799
- let h = !1;
800
- Object.keys(l).forEach((g) => {
801
- l[g] > 0 && (l[g]--, h = !0);
802
- }), e(38, z = l), !h && N && (clearInterval(N), N = null);
803
- },
804
- 1e3
805
- );
806
- }, x = (l) => {
807
- e(0, E = l);
808
- }, c = async () => {
809
- if (!(!E || z[E] && z[E] > 0)) {
810
- e(3, m = !0), M && M.startsWith("2fa-") && e(30, M = `2fa-${E}`);
811
- try {
812
- await me(), await we(), e(38, z = {
813
- ...z,
814
- [E]: 30
815
- }), ie(), e(12, re = !0), k(), ge();
816
- } catch (l) {
817
- console.error("Error submitting channel:", l), e(6, F = !0), e(8, I = a("submissionError"));
818
- } finally {
819
- e(3, m = !1);
820
- }
821
- }
822
- }, k = () => {
823
- const l = new Date(A), h = new Date(X), g = /* @__PURE__ */ new Date(), H = h.getTime() - g.getTime();
824
- G = l.getTime() - H;
825
- const he = Date.now(), _e = Math.max(0, Math.floor((G - he) / 1e3));
826
- e(5, C = _e);
827
- }, ge = () => {
828
- B && clearInterval(B), B = setInterval(
829
- () => {
830
- const l = Date.now(), h = Math.max(0, Math.floor((G - l) / 1e3));
831
- e(5, C = h), e(11, Z = h <= 0), h <= 0 && (clearInterval(B), B = null, e(9, Q = !0), e(6, F = !1), e(10, le = !1));
832
- },
833
- 1e3
834
- );
835
- }, Re = (l) => {
836
- const h = Math.floor(l / 60), g = l % 60;
837
- return `${h.toString().padStart(2, "0")}:${g.toString().padStart(2, "0")}`;
838
- }, be = (l, h) => {
839
- const g = [...b];
840
- g[l] = h.toUpperCase(), e(2, b = g), g.join("") !== ae && e(13, se = !1);
841
- }, Pe = (l) => {
842
- l.preventDefault();
843
- const g = (l.clipboardData?.getData("text")?.trim() || "").slice(0, y.inputLength).split("");
844
- e(2, b = [...g, ...Array(y.inputLength - g.length).fill("")]), U[g.length]?.focus(), g.length === y.inputLength && Ce();
845
- }, ve = (l, h) => {
846
- const g = l.target, H = g.value;
847
- /^[a-z0-9]$/i.test(H) && (be(h, H), U[h + 1]?.focus()), g.value = "";
848
- }, ke = (l, h) => {
849
- const g = l.key, H = l.ctrlKey || l.metaKey;
850
- if (/^[a-z0-9]$/i.test(g)) {
851
- if (H && g.toLowerCase() === "v")
852
- return;
853
- l.preventDefault(), be(h, g), U[h + 1]?.focus();
854
- } else
855
- g === "Backspace" && (l.preventDefault(), b[h] !== "" && be(h, ""), U[h - 1]?.focus());
856
- }, De = () => {
857
- W == "stateful" && (me(), e(9, Q = !1));
858
- const l = new CustomEvent("otpResendRequested");
859
- window.dispatchEvent(l);
860
- }, je = (l) => {
861
- window.dispatchEvent(new CustomEvent(
862
- "otpSubmitted",
863
- {
864
- detail: {
865
- code: l,
866
- maxAttempts: y.maxValidationAttempts,
867
- validatedAttempts: y.numberOfValidateAttempts
868
- }
869
- }
870
- ));
871
- }, Be = async (l) => {
872
- const h = new URL(`/api/nwa/api/v1/mfa/challenge/${te}/validate`, _);
873
- h.searchParams.append("input", l);
874
- try {
875
- const g = await fetch(h.href, { method: "POST" });
876
- if (g.status === 200) {
877
- Ve();
878
- return;
879
- }
880
- const H = await g.json();
881
- throw new Error(H.message);
882
- } catch (g) {
883
- if (await we(), g.message === $.INTERNAL_SERVER_ERROR) {
884
- if (y.numberOfValidateAttempts === y.maxValidationAttempts - 1) {
885
- window.dispatchEvent(new CustomEvent("otpSetTimeout")), window.postMessage(
886
- {
887
- type: "WidgetNotification",
888
- data: {
889
- type: "error",
890
- message: a("accountBlocked")
891
- }
892
- },
893
- window.location.href
894
- ), window.dispatchEvent(new CustomEvent("manualClosePopup"));
895
- return;
896
- }
897
- e(6, F = !0), e(8, I = a("invalidOtp")), we();
898
- return;
899
- }
900
- g.message === $.MAX_INVALIDATE && (e(6, F = !0), e(8, I = a("invalidOtp"))), g.details === $.MAX_ATTEMPTS_EXCEEDED && e(15, ce = !0), console.error("OTP submission failed:", g), e(6, F = !0), e(8, I = a("submissionError"));
901
- } finally {
902
- e(3, m = !1);
903
- }
904
- }, Ve = () => {
905
- window.dispatchEvent(new CustomEvent(
906
- "otpSuccess",
907
- {
908
- detail: {
909
- message: "User successfully authenticated"
910
- }
911
- }
912
- ));
913
- }, He = () => {
914
- window.dispatchEvent(new CustomEvent("manualClosePopup"));
915
- }, Ce = async () => {
916
- if (b.join("").length !== y.inputLength) {
917
- e(6, F = !0), e(8, I = a("invalidOtp"));
918
- return;
919
- }
920
- const l = b.join("");
921
- e(13, se = !0), ae = l, e(3, m = !0), e(6, F = !1), e(8, I = ""), W === "stateless" && je(l), W === "stateful" && await Be(l);
922
- }, we = async () => {
923
- if (_)
924
- try {
925
- e(3, m = !0);
926
- const l = new URL(`/api/nwa/api/v1/mfa/challenge/${te}/config`, _), h = await fetch(l.href), g = await h.json();
927
- if (h.ok)
928
- e(4, y = g), e(2, b = Array(y.inputLength).fill("")), e(9, Q = !1), A = y.expirationTime, X = y.serverTime, y.numberOfValidateAttempts !== 0 && (e(6, F = !0), e(8, I = a("invalidOtp"))), y.numberOfValidateAttempts === y.maxValidationAttempts - 1 && e(10, le = !0), e(3, m = !1), k(), ge(), e(16, pe = !1);
929
- else if (g && g.details === $.MAX_ATTEMPTS_EXCEEDED)
930
- window.dispatchEvent(new CustomEvent("manualClosePopup"));
931
- else {
932
- const H = g && g.message || `Failed to load config. Status: ${h.status}`;
933
- throw new Error(H);
934
- }
935
- } catch (l) {
936
- e(3, m = !1), e(7, j = !0), e(8, I = a("configError")), window.dispatchEvent(new CustomEvent("2fa-loading", { detail: { isLoading: !1 } })), console.error("Error loading 2FA config:", l);
937
- }
938
- };
939
- et(() => (window.addEventListener("stepUpAuthRequired", fe, !1), window.addEventListener("closePopup", D, !1), () => {
940
- window.removeEventListener("stepUpAuthRequired", fe), window.removeEventListener("closePopup", D, !1), B && clearInterval(B), N && clearInterval(N);
941
- }));
942
- const Ne = () => x(ue.SMS), Fe = () => x(ue.EMAIL);
943
- function We(l, h) {
944
- Oe[l ? "unshift" : "push"](() => {
945
- U[h] = l, e(14, U);
946
- });
947
- }
948
- const qe = (l, h) => ve(h, l), Ue = (l, h) => ke(h, l);
949
- function Xe(l) {
950
- Oe[l ? "unshift" : "push"](() => {
951
- q = l, e(1, q);
952
- });
953
- }
954
- return n.$$set = (l) => {
955
- "clientstyling" in l && e(31, p = l.clientstyling), "clientstylingurl" in l && e(32, s = l.clientstylingurl), "mbsource" in l && e(33, u = l.mbsource), "lang" in l && e(34, f = l.lang), "endpoint" in l && e(35, _ = l.endpoint), "session" in l && e(36, w = l.session), "translationurl" in l && e(37, T = l.translationurl), "templateid" in l && e(30, M = l.templateid);
956
- }, n.$$.update = () => {
957
- n.$$.dirty[0] & /*customStylingContainer*/
958
- 2 | n.$$.dirty[1] & /*clientstyling*/
959
- 1 && p && q && lt(q, p), n.$$.dirty[0] & /*customStylingContainer*/
960
- 2 | n.$$.dirty[1] & /*clientstylingurl*/
961
- 2 && s && q && rt(q, s), n.$$.dirty[0] & /*customStylingContainer*/
962
- 2 | n.$$.dirty[1] & /*mbsource*/
963
- 4 && u && q && st(q, `${u}.Style`, de), n.$$.dirty[1] & /*lang*/
964
- 8 && f && K(), n.$$.dirty[1] & /*lang, translationurl*/
965
- 72 && f && T && V(), n.$$.dirty[0] & /*selectedChannel*/
966
- 1 | n.$$.dirty[1] & /*channelSubmitTimers*/
967
- 128 && e(18, i = E && (!z[E] || z[E] === 0)), n.$$.dirty[0] & /*selectedChannel*/
968
- 1 | n.$$.dirty[1] & /*channelSubmitTimers*/
969
- 128 && e(17, o = E && z[E] || 0);
970
- }, [
971
- E,
972
- q,
973
- b,
974
- m,
975
- y,
976
- C,
977
- F,
978
- j,
979
- I,
980
- Q,
981
- le,
982
- Z,
983
- re,
984
- se,
985
- U,
986
- ce,
987
- pe,
988
- o,
989
- i,
990
- a,
991
- ue,
992
- x,
993
- c,
994
- Re,
995
- Pe,
996
- ve,
997
- ke,
998
- De,
999
- He,
1000
- Ce,
1001
- M,
1002
- p,
1003
- s,
1004
- u,
1005
- f,
1006
- _,
1007
- w,
1008
- T,
1009
- z,
1010
- Ne,
1011
- Fe,
1012
- We,
1013
- qe,
1014
- Ue,
1015
- Xe
1016
- ];
1017
- }
1018
- class Ot extends Ye {
1019
- constructor(t) {
1020
- super(), Je(
1021
- this,
1022
- t,
1023
- Et,
1024
- Ct,
1025
- Qe,
1026
- {
1027
- clientstyling: 31,
1028
- clientstylingurl: 32,
1029
- mbsource: 33,
1030
- lang: 34,
1031
- endpoint: 35,
1032
- session: 36,
1033
- translationurl: 37,
1034
- templateid: 30
1035
- },
1036
- ct,
1037
- [-1, -1, -1]
1038
- );
1039
- }
1040
- get clientstyling() {
1041
- return this.$$.ctx[31];
1042
- }
1043
- set clientstyling(t) {
1044
- this.$$set({ clientstyling: t }), oe();
1045
- }
1046
- get clientstylingurl() {
1047
- return this.$$.ctx[32];
1048
- }
1049
- set clientstylingurl(t) {
1050
- this.$$set({ clientstylingurl: t }), oe();
1051
- }
1052
- get mbsource() {
1053
- return this.$$.ctx[33];
1054
- }
1055
- set mbsource(t) {
1056
- this.$$set({ mbsource: t }), oe();
1057
- }
1058
- get lang() {
1059
- return this.$$.ctx[34];
1060
- }
1061
- set lang(t) {
1062
- this.$$set({ lang: t }), oe();
1063
- }
1064
- get endpoint() {
1065
- return this.$$.ctx[35];
1066
- }
1067
- set endpoint(t) {
1068
- this.$$set({ endpoint: t }), oe();
1069
- }
1070
- get session() {
1071
- return this.$$.ctx[36];
1072
- }
1073
- set session(t) {
1074
- this.$$set({ session: t }), oe();
1075
- }
1076
- get translationurl() {
1077
- return this.$$.ctx[37];
1078
- }
1079
- set translationurl(t) {
1080
- this.$$set({ translationurl: t }), oe();
1081
- }
1082
- get templateid() {
1083
- return this.$$.ctx[30];
1084
- }
1085
- set templateid(t) {
1086
- this.$$set({ templateid: t }), oe();
1087
- }
1088
- }
1089
- it(Ot, { clientstyling: {}, clientstylingurl: {}, mbsource: {}, lang: {}, endpoint: {}, session: {}, translationurl: {}, templateid: {} }, [], [], !0);
1090
- export {
1091
- Ot as default
1092
- };