@invoice-sdk/widget 1.115.5 → 1.115.7
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-C9FKdqPq.js → index-D49c2XoX.js} +2 -2
- package/dist/{index-C-62FO8g.js → index-DUTxhky5.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +19 -19
- package/dist/{invoice-CHFiEOk7.js → invoice-DUiIiOd_.js} +2 -2
- package/dist/{widget-CHPpGsNJ.js → widget-C-3zhC6p.js} +219 -217
- package/dist/widget.css +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ var Ah = (t, n, e) => n in t ? lc(t, n, { enumerable: !0, configurable: !0, writ
|
|
|
9
9
|
for (var e of zt(n))
|
|
10
10
|
oh.call(n, e) && Ah(t, e, n[e]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
12
|
+
}, Yn = (t, n) => ic(t, gc(n));
|
|
13
13
|
var mh = (t, n) => {
|
|
14
14
|
var e = {};
|
|
15
15
|
for (var c in t)
|
|
@@ -19,7 +19,7 @@ var mh = (t, n) => {
|
|
|
19
19
|
n.indexOf(c) < 0 && oh.call(t, c) && (e[c] = t[c]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var ln = (t, n, e) => new Promise((c, h) => {
|
|
23
23
|
var a = (A) => {
|
|
24
24
|
try {
|
|
25
25
|
o(e.next(A));
|
|
@@ -35,8 +35,8 @@ var sn = (t, n, e) => new Promise((c, h) => {
|
|
|
35
35
|
}, o = (A) => A.done ? c(A.value) : Promise.resolve(A.value).then(a, u);
|
|
36
36
|
o((e = e.apply(t, n)).next());
|
|
37
37
|
});
|
|
38
|
-
import { t as g, g as jh, a as Uh, b as Et, s as Ut, c as It, d as rc, e as Tc, f as xc, m as dc, h as wc, i as pc, v as Cc } from "./index-
|
|
39
|
-
import { c as yt, a as _h, g as _t, b as fc, f as Sn, d as Xc, e as Bc, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc } from "./invoice-
|
|
38
|
+
import { t as g, g as jh, a as Uh, b as Et, s as Ut, c as It, d as rc, e as Tc, f as xc, m as dc, h as wc, i as pc, v as Cc } from "./index-DUTxhky5.js";
|
|
39
|
+
import { c as yt, a as _h, g as _t, b as fc, f as Sn, d as Xc, e as Bc, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc } from "./invoice-DUiIiOd_.js";
|
|
40
40
|
import { g as $h } from "./_commonjsHelpers-bAxELxBV.js";
|
|
41
41
|
function qh({ steps: t = [], currentStep: n = 1 } = {}) {
|
|
42
42
|
const e = document.createElement("div");
|
|
@@ -335,7 +335,7 @@ function Lc({
|
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Kn({
|
|
339
339
|
name: t,
|
|
340
340
|
value: n = "",
|
|
341
341
|
type: e = "text",
|
|
@@ -1381,9 +1381,9 @@ function Dc() {
|
|
|
1381
1381
|
for (var U = m === 0 ? 11 : m - 1, cn = m === 11 ? 0 : m + 1, Y = m === 0 ? T - 1 : T, rn = m === 11 ? T + 1 : T, Z = k(Y, U), An = M + D, Tn = An; Tn > 7; )
|
|
1382
1382
|
Tn -= 7;
|
|
1383
1383
|
An += 7 - Tn;
|
|
1384
|
-
for (var Mn = !1,
|
|
1385
|
-
var Xn = new Date(T, m, 1 + (
|
|
1386
|
-
nt && (
|
|
1384
|
+
for (var Mn = !1, sn = 0, mt = 0; sn < An; sn++) {
|
|
1385
|
+
var Xn = new Date(T, m, 1 + (sn - D)), qt = x(this._d) ? w(Xn, this._d) : !1, zn = w(Xn, v), Un = E.events.indexOf(Xn.toDateString()) !== -1, nt = sn < D || sn >= M + D, Qn = 1 + (sn - D), Rn = m, _n = T, On = E.startRange && w(E.startRange, Xn), tt = E.endRange && w(E.endRange, Xn), dt = E.startRange && E.endRange && E.startRange < Xn && Xn < E.endRange, st = E.minDate && Xn < E.minDate || E.maxDate && Xn > E.maxDate || E.disableWeekends && d(Xn) || E.disableDayFn && E.disableDayFn(Xn);
|
|
1386
|
+
nt && (sn < D ? (Qn = Z + Qn, Rn = U, _n = Y) : (Qn = Qn - M, Rn = cn, _n = rn));
|
|
1387
1387
|
var ht = {
|
|
1388
1388
|
day: Qn,
|
|
1389
1389
|
month: Rn,
|
|
@@ -1393,13 +1393,13 @@ function Dc() {
|
|
|
1393
1393
|
isToday: zn,
|
|
1394
1394
|
isDisabled: st,
|
|
1395
1395
|
isEmpty: nt,
|
|
1396
|
-
isStartRange:
|
|
1396
|
+
isStartRange: On,
|
|
1397
1397
|
isEndRange: tt,
|
|
1398
1398
|
isInRange: dt,
|
|
1399
1399
|
showDaysInNextAndPreviousMonths: E.showDaysInNextAndPreviousMonths,
|
|
1400
1400
|
enableSelectionDaysInNextAndPreviousMonths: E.enableSelectionDaysInNextAndPreviousMonths
|
|
1401
1401
|
};
|
|
1402
|
-
E.pickWholeWeek && qt && (Mn = !0), O.push(y(ht)), ++mt === 7 && (E.showWeekNumber && O.unshift(V(
|
|
1402
|
+
E.pickWholeWeek && qt && (Mn = !0), O.push(y(ht)), ++mt === 7 && (E.showWeekNumber && O.unshift(V(sn - D, m, T, E.firstWeekOfYearMinDays)), j.push(L(O, E.isRTL, E.pickWholeWeek, Mn)), O = [], mt = 0, Mn = !1);
|
|
1403
1403
|
}
|
|
1404
1404
|
return G(E, j, P);
|
|
1405
1405
|
},
|
|
@@ -1547,10 +1547,10 @@ function Fc() {
|
|
|
1547
1547
|
tc(), Pn && Pn.parentNode && Pn.parentNode.removeChild(Pn), Ht && window.removeEventListener("resize", Ht), Pn = null, Ht = null, Ct = [];
|
|
1548
1548
|
}
|
|
1549
1549
|
const pt = {
|
|
1550
|
-
info: (t, n = {}) => Rt(t,
|
|
1551
|
-
success: (t, n = {}) => Rt(t,
|
|
1552
|
-
warning: (t, n = {}) => Rt(t,
|
|
1553
|
-
error: (t, n = {}) => Rt(t,
|
|
1550
|
+
info: (t, n = {}) => Rt(t, Yn(yn({}, n), { type: "info" })),
|
|
1551
|
+
success: (t, n = {}) => Rt(t, Yn(yn({}, n), { type: "success" })),
|
|
1552
|
+
warning: (t, n = {}) => Rt(t, Yn(yn({}, n), { type: "warning" })),
|
|
1553
|
+
error: (t, n = {}) => Rt(t, Yn(yn({}, n), { type: "error" })),
|
|
1554
1554
|
clear: tc,
|
|
1555
1555
|
destroy: Fc
|
|
1556
1556
|
};
|
|
@@ -1898,7 +1898,7 @@ function l1(t, n = "sourceCanvas") {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
});
|
|
1900
1900
|
}
|
|
1901
|
-
const i1 = () => typeof window != "undefined" && typeof window.umami != "undefined",
|
|
1901
|
+
const i1 = () => typeof window != "undefined" && typeof window.umami != "undefined", Gn = (t, n = {}) => {
|
|
1902
1902
|
if (!i1())
|
|
1903
1903
|
if (console.warn("[Analytics] Umami not loaded, using PostMessage fallback"), typeof window != "undefined" && window.parent && window.parent !== window)
|
|
1904
1904
|
try {
|
|
@@ -1906,7 +1906,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1906
1906
|
type: "UMAMI_TRACK",
|
|
1907
1907
|
payload: {
|
|
1908
1908
|
eventName: t,
|
|
1909
|
-
eventData:
|
|
1909
|
+
eventData: Yn(yn({}, n), {
|
|
1910
1910
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1911
1911
|
source: "sdk-widget"
|
|
1912
1912
|
})
|
|
@@ -1919,7 +1919,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1919
1919
|
else
|
|
1920
1920
|
return console.error("❌ [Analytics] Not in iframe, cannot send PostMessage"), !1;
|
|
1921
1921
|
try {
|
|
1922
|
-
return window.umami.track(t,
|
|
1922
|
+
return window.umami.track(t, Yn(yn({}, n), {
|
|
1923
1923
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1924
1924
|
source: "sdk-widget"
|
|
1925
1925
|
})), !0;
|
|
@@ -1929,7 +1929,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1929
1929
|
e
|
|
1930
1930
|
), !1;
|
|
1931
1931
|
}
|
|
1932
|
-
},
|
|
1932
|
+
}, Wn = {
|
|
1933
1933
|
// ==================== STEP 1: Registration ====================
|
|
1934
1934
|
STEP1_VIEWED: "einv_view_registration_form",
|
|
1935
1935
|
STEP1_COMPLETED: "einv_button_click_register",
|
|
@@ -1945,7 +1945,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1945
1945
|
STEP3_PAYMENT_WRONG_AMOUNT: "einv_payment_wrong_amount"
|
|
1946
1946
|
}, Zt = {
|
|
1947
1947
|
success(t) {
|
|
1948
|
-
|
|
1948
|
+
Gn(Wn.STEP3_PAYMENT_SUCCESS, {
|
|
1949
1949
|
orderId: t.orderId,
|
|
1950
1950
|
amount: t.amount,
|
|
1951
1951
|
transactionId: t.transactionId,
|
|
@@ -1956,7 +1956,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1956
1956
|
});
|
|
1957
1957
|
},
|
|
1958
1958
|
failed(t) {
|
|
1959
|
-
|
|
1959
|
+
Gn(Wn.STEP3_PAYMENT_FAILED, {
|
|
1960
1960
|
orderId: t.orderId,
|
|
1961
1961
|
amount: t.amount,
|
|
1962
1962
|
errorCode: t.errorCode,
|
|
@@ -1968,7 +1968,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1968
1968
|
});
|
|
1969
1969
|
},
|
|
1970
1970
|
wrongAmount(t) {
|
|
1971
|
-
|
|
1971
|
+
Gn(Wn.STEP3_PAYMENT_WRONG_AMOUNT, {
|
|
1972
1972
|
orderId: t.orderId,
|
|
1973
1973
|
expectedAmount: t.expectedAmount,
|
|
1974
1974
|
receivedAmount: t.receivedAmount,
|
|
@@ -1991,7 +1991,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1991
1991
|
// });
|
|
1992
1992
|
// },
|
|
1993
1993
|
freeOrderConfirmed(t) {
|
|
1994
|
-
|
|
1994
|
+
Gn(Wn.STEP3_FREE_ORDER_CONFIRMED, {
|
|
1995
1995
|
orderId: t.orderId,
|
|
1996
1996
|
totalAmount: t.totalAmount,
|
|
1997
1997
|
orderAmount: t.orderAmount,
|
|
@@ -2001,7 +2001,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
2001
2001
|
}
|
|
2002
2002
|
}, rh = {
|
|
2003
2003
|
success(t) {
|
|
2004
|
-
|
|
2004
|
+
Gn(Wn.STEP3_QR_GENERATION_SUCCESS, {
|
|
2005
2005
|
orderId: t.orderId,
|
|
2006
2006
|
amount: t.amount,
|
|
2007
2007
|
qrUrl: t.qrUrl,
|
|
@@ -2012,7 +2012,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
2012
2012
|
});
|
|
2013
2013
|
},
|
|
2014
2014
|
failed(t) {
|
|
2015
|
-
|
|
2015
|
+
Gn(Wn.STEP3_QR_GENERATION_FAILED, {
|
|
2016
2016
|
orderId: t.orderId,
|
|
2017
2017
|
amount: t.amount,
|
|
2018
2018
|
errorCode: t.errorCode,
|
|
@@ -2024,7 +2024,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
2024
2024
|
}
|
|
2025
2025
|
}, Th = {
|
|
2026
2026
|
stopped(t) {
|
|
2027
|
-
|
|
2027
|
+
Gn(Wn.STEP3_POLLING_STOPPED, {
|
|
2028
2028
|
orderId: t.orderId,
|
|
2029
2029
|
reason: t.reason,
|
|
2030
2030
|
duration: t.duration,
|
|
@@ -2042,7 +2042,7 @@ function xh(t) {
|
|
|
2042
2042
|
return e > 1 ? !1 : e === 1 ? /^\d{10}-\d{3}$/.test(n) : /^(\d{10}|\d{12}|\d{13})$/.test(n);
|
|
2043
2043
|
}
|
|
2044
2044
|
function g1(l) {
|
|
2045
|
-
return
|
|
2045
|
+
return ln(this, arguments, function* ({
|
|
2046
2046
|
onSubmit: t,
|
|
2047
2047
|
registrationData: n,
|
|
2048
2048
|
theme: e = "ocb",
|
|
@@ -2059,7 +2059,7 @@ function g1(l) {
|
|
|
2059
2059
|
isRenewal: i = !1
|
|
2060
2060
|
}) {
|
|
2061
2061
|
var et, Mt, Jt, Dt, K, un, dn, bn, fn, wn, pn, Cn, kn, Hn, Vn, At, Lt, S0, M0, J0, D0, K0, O0, Y0, G0, W0, z0, F0, R0, Z0, j0, U0, _0, $0, nh, th, hh, ch, ah, eh;
|
|
2062
|
-
|
|
2062
|
+
Gn(Wn.STEP1_VIEWED, {
|
|
2063
2063
|
theme: e,
|
|
2064
2064
|
isRenewal: i
|
|
2065
2065
|
});
|
|
@@ -2074,9 +2074,9 @@ function g1(l) {
|
|
|
2074
2074
|
S.className = "wgt:text-sm wgt:leading-relaxed", S.style.color = "#FF8447", S.innerHTML = g(
|
|
2075
2075
|
"register_note",
|
|
2076
2076
|
"Mã số thuế này đã được đăng ký trên M-Invoice, vì vậy bạn không thể tạo mới với thông tin này."
|
|
2077
|
-
), x.appendChild(S),
|
|
2077
|
+
), x.appendChild(S), sn && sn.firstChild && (sn.insertBefore(
|
|
2078
2078
|
x,
|
|
2079
|
-
|
|
2079
|
+
sn.firstChild
|
|
2080
2080
|
), setTimeout(() => {
|
|
2081
2081
|
x.style.opacity = "1";
|
|
2082
2082
|
}, 50));
|
|
@@ -2097,13 +2097,13 @@ function g1(l) {
|
|
|
2097
2097
|
b.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
|
|
2098
2098
|
const w = document.createElement("form");
|
|
2099
2099
|
w.className = "wgt:w-full wgt:max-w-[1072px] wgt:mx-auto wgt:space-y-4", w.addEventListener("submit", (J) => {
|
|
2100
|
-
if (J.preventDefault(), !
|
|
2100
|
+
if (J.preventDefault(), !Dn()) return;
|
|
2101
2101
|
const S = Fn();
|
|
2102
2102
|
typeof t == "function" && t(S);
|
|
2103
2103
|
}), b.appendChild(w);
|
|
2104
2104
|
let p, H, N, C, X, y, Q, V, L, f, B, z, G, R, T, m, P, E, v, M, D, j, O, U, cn;
|
|
2105
2105
|
const Y = document.createElement("button");
|
|
2106
|
-
p =
|
|
2106
|
+
p = Kn({
|
|
2107
2107
|
name: "taxCode",
|
|
2108
2108
|
label: g("taxCode"),
|
|
2109
2109
|
required: !0,
|
|
@@ -2118,18 +2118,18 @@ function g1(l) {
|
|
|
2118
2118
|
onInput: (J) => {
|
|
2119
2119
|
const S = J.target.value, hn = S.replace(/[^\d-]/g, "");
|
|
2120
2120
|
hn !== S && (J.target.value = hn);
|
|
2121
|
-
const
|
|
2122
|
-
if (n._userHasEditedTaxCode = !0, I(),
|
|
2123
|
-
p.setError(g("errorRequired", "Mã số thuế bắt buộc")),
|
|
2121
|
+
const mn = hn.trim();
|
|
2122
|
+
if (n._userHasEditedTaxCode = !0, I(), mn.length === 0) {
|
|
2123
|
+
p.setError(g("errorRequired", "Mã số thuế bắt buộc")), on();
|
|
2124
2124
|
return;
|
|
2125
2125
|
}
|
|
2126
|
-
if (!xh(
|
|
2127
|
-
p.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")),
|
|
2126
|
+
if (!xh(mn)) {
|
|
2127
|
+
p.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), on();
|
|
2128
2128
|
return;
|
|
2129
2129
|
}
|
|
2130
|
-
p.setError(null), Mn(
|
|
2130
|
+
p.setError(null), Mn(mn), on();
|
|
2131
2131
|
}
|
|
2132
|
-
}), H =
|
|
2132
|
+
}), H = Kn({
|
|
2133
2133
|
name: "companyName",
|
|
2134
2134
|
label: g("companyName"),
|
|
2135
2135
|
required: !0,
|
|
@@ -2139,7 +2139,7 @@ function g1(l) {
|
|
|
2139
2139
|
value: ((Dt = (Jt = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : Jt.organization) == null ? void 0 : Dt.name) || "",
|
|
2140
2140
|
readOnly: !1,
|
|
2141
2141
|
horizontal: !0
|
|
2142
|
-
}), N =
|
|
2142
|
+
}), N = Kn({
|
|
2143
2143
|
name: "companyAddressDetail",
|
|
2144
2144
|
label: g("address"),
|
|
2145
2145
|
required: !0,
|
|
@@ -2165,7 +2165,7 @@ function g1(l) {
|
|
|
2165
2165
|
horizontal: !0,
|
|
2166
2166
|
searchable: !0,
|
|
2167
2167
|
onChange: (J) => {
|
|
2168
|
-
J.target.id && a(J.target.id),
|
|
2168
|
+
J.target.id && a(J.target.id), on();
|
|
2169
2169
|
}
|
|
2170
2170
|
}), h) {
|
|
2171
2171
|
const J = rn.find(
|
|
@@ -2182,10 +2182,10 @@ function g1(l) {
|
|
|
2182
2182
|
required: !1,
|
|
2183
2183
|
file: (n == null ? void 0 : n.logo) || null,
|
|
2184
2184
|
onFileChange: (J) => {
|
|
2185
|
-
|
|
2185
|
+
on();
|
|
2186
2186
|
},
|
|
2187
2187
|
error: null
|
|
2188
|
-
}), L =
|
|
2188
|
+
}), L = Kn({
|
|
2189
2189
|
name: "repName",
|
|
2190
2190
|
label: g("fullName"),
|
|
2191
2191
|
required: !0,
|
|
@@ -2201,7 +2201,7 @@ function g1(l) {
|
|
|
2201
2201
|
}
|
|
2202
2202
|
Ft(S) ? L.setError(null) : L.setError(g("errorInvalidName"));
|
|
2203
2203
|
}
|
|
2204
|
-
}), f =
|
|
2204
|
+
}), f = Kn({
|
|
2205
2205
|
name: "repDob",
|
|
2206
2206
|
label: g("dateOfBirth"),
|
|
2207
2207
|
required: !0,
|
|
@@ -2215,14 +2215,14 @@ function g1(l) {
|
|
|
2215
2215
|
field: f.inputEl,
|
|
2216
2216
|
format: "DD/MM/YYYY",
|
|
2217
2217
|
toString(J) {
|
|
2218
|
-
const S = String(J.getMonth() + 1).padStart(2, "0"), hn = String(J.getDate()).padStart(2, "0"),
|
|
2219
|
-
return `${hn}/${S}/${
|
|
2218
|
+
const S = String(J.getMonth() + 1).padStart(2, "0"), hn = String(J.getDate()).padStart(2, "0"), mn = J.getFullYear();
|
|
2219
|
+
return `${hn}/${S}/${mn}`;
|
|
2220
2220
|
},
|
|
2221
2221
|
onSelect: (J) => {
|
|
2222
|
-
f.setError(null),
|
|
2222
|
+
f.setError(null), on();
|
|
2223
2223
|
},
|
|
2224
2224
|
onClose: () => {
|
|
2225
|
-
f.inputEl.value ? f.setError(null) : f.setError(g("errorRequired")),
|
|
2225
|
+
f.inputEl.value ? f.setError(null) : f.setError(g("errorRequired")), on();
|
|
2226
2226
|
},
|
|
2227
2227
|
maxDate: /* @__PURE__ */ new Date(),
|
|
2228
2228
|
showMonthDropdown: !0,
|
|
@@ -2243,7 +2243,7 @@ function g1(l) {
|
|
|
2243
2243
|
onChange: (J) => {
|
|
2244
2244
|
J.target.value;
|
|
2245
2245
|
}
|
|
2246
|
-
}), G =
|
|
2246
|
+
}), G = Kn({
|
|
2247
2247
|
name: "repIdCardField",
|
|
2248
2248
|
label: g("idNumber"),
|
|
2249
2249
|
required: !0,
|
|
@@ -2262,7 +2262,7 @@ function g1(l) {
|
|
|
2262
2262
|
g("errorInvalidIdCard", "Số CCCD phải có 12 chữ số")
|
|
2263
2263
|
);
|
|
2264
2264
|
}
|
|
2265
|
-
}), R =
|
|
2265
|
+
}), R = Kn({
|
|
2266
2266
|
name: "repPassportNumberField",
|
|
2267
2267
|
label: g("passport", "Hộ chiếu"),
|
|
2268
2268
|
required: !1,
|
|
@@ -2270,7 +2270,7 @@ function g1(l) {
|
|
|
2270
2270
|
placeholder: g("enterPassport", "Nhập số hộ chiếu"),
|
|
2271
2271
|
type: "text",
|
|
2272
2272
|
value: ((S0 = (Lt = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : Lt.legalRepresentative) == null ? void 0 : S0.passportNumber) || ""
|
|
2273
|
-
}), z =
|
|
2273
|
+
}), z = Kn({
|
|
2274
2274
|
name: "repPhone",
|
|
2275
2275
|
label: g("phone"),
|
|
2276
2276
|
required: !0,
|
|
@@ -2280,12 +2280,12 @@ function g1(l) {
|
|
|
2280
2280
|
value: ((J0 = (M0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : M0.legalRepresentative) == null ? void 0 : J0.phone) || "",
|
|
2281
2281
|
onInput: (J) => {
|
|
2282
2282
|
let S = J.target.value;
|
|
2283
|
-
const hn = S.replace(/[^\d+().\-\s]/g, ""),
|
|
2284
|
-
if (hn !== S && (J.target.value = hn, S = hn),
|
|
2283
|
+
const hn = S.replace(/[^\d+().\-\s]/g, ""), mn = hn.replace(/[\s.\-()]/g, "");
|
|
2284
|
+
if (hn !== S && (J.target.value = hn, S = hn), mn.trim() === "") {
|
|
2285
2285
|
z.setError(g("errorRequired", "Số điện thoại bắt buộc"));
|
|
2286
2286
|
return;
|
|
2287
2287
|
}
|
|
2288
|
-
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(
|
|
2288
|
+
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(mn) ? z.setError(null) : z.setError(
|
|
2289
2289
|
g("errorInvalidPhone", "Số điện thoại không hợp lệ.")
|
|
2290
2290
|
);
|
|
2291
2291
|
}
|
|
@@ -2299,7 +2299,7 @@ function g1(l) {
|
|
|
2299
2299
|
onChange: (J) => {
|
|
2300
2300
|
J.target.value;
|
|
2301
2301
|
}
|
|
2302
|
-
}), m =
|
|
2302
|
+
}), m = Kn({
|
|
2303
2303
|
name: "contactAddressDetail",
|
|
2304
2304
|
label: g("permanentAddress"),
|
|
2305
2305
|
required: !0,
|
|
@@ -2325,11 +2325,11 @@ function g1(l) {
|
|
|
2325
2325
|
required: !0,
|
|
2326
2326
|
file: (n == null ? void 0 : n.license) || null,
|
|
2327
2327
|
onFileChange: (J) => {
|
|
2328
|
-
|
|
2328
|
+
on();
|
|
2329
2329
|
},
|
|
2330
2330
|
error: null,
|
|
2331
2331
|
accept: "image/png, image/jpeg, image/jpg, .pdf"
|
|
2332
|
-
}), X =
|
|
2332
|
+
}), X = Kn({
|
|
2333
2333
|
name: "name",
|
|
2334
2334
|
label: g("fullName"),
|
|
2335
2335
|
required: !0,
|
|
@@ -2347,7 +2347,7 @@ function g1(l) {
|
|
|
2347
2347
|
g("errorInvalidName", "Họ và tên không hợp lệ.")
|
|
2348
2348
|
);
|
|
2349
2349
|
}
|
|
2350
|
-
}), y =
|
|
2350
|
+
}), y = Kn({
|
|
2351
2351
|
name: "email",
|
|
2352
2352
|
label: g("email"),
|
|
2353
2353
|
required: !0,
|
|
@@ -2378,7 +2378,7 @@ function g1(l) {
|
|
|
2378
2378
|
g("errorInvalidEmail", "Email không hợp lệ")
|
|
2379
2379
|
);
|
|
2380
2380
|
}
|
|
2381
|
-
}), Q =
|
|
2381
|
+
}), Q = Kn({
|
|
2382
2382
|
name: "phone",
|
|
2383
2383
|
label: g("phone"),
|
|
2384
2384
|
required: !0,
|
|
@@ -2388,18 +2388,18 @@ function g1(l) {
|
|
|
2388
2388
|
value: ((Z0 = (R0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : R0.contactPerson) == null ? void 0 : Z0.phone) || "",
|
|
2389
2389
|
onInput: (J) => {
|
|
2390
2390
|
let S = J.target.value;
|
|
2391
|
-
const hn = S.replace(/[^\d+().\-\s]/g, ""),
|
|
2392
|
-
if (hn !== S && (J.target.value = hn, S = hn),
|
|
2391
|
+
const hn = S.replace(/[^\d+().\-\s]/g, ""), mn = hn.replace(/[\s.\-()]/g, "");
|
|
2392
|
+
if (hn !== S && (J.target.value = hn, S = hn), mn.trim() === "") {
|
|
2393
2393
|
Q.setError(
|
|
2394
2394
|
g("errorRequired", "Số điện thoại bắt buộc")
|
|
2395
2395
|
);
|
|
2396
2396
|
return;
|
|
2397
2397
|
}
|
|
2398
|
-
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(
|
|
2398
|
+
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(mn) ? Q.setError(null) : Q.setError(
|
|
2399
2399
|
g("errorInvalidPhone", "Số điện thoại Việt Nam không hợp lệ.")
|
|
2400
2400
|
);
|
|
2401
2401
|
}
|
|
2402
|
-
}), V =
|
|
2402
|
+
}), V = Kn({
|
|
2403
2403
|
name: "contactAddressDetail",
|
|
2404
2404
|
label: g("permanentAddress"),
|
|
2405
2405
|
required: !0,
|
|
@@ -2421,7 +2421,7 @@ function g1(l) {
|
|
|
2421
2421
|
) : V.setError(null);
|
|
2422
2422
|
}
|
|
2423
2423
|
});
|
|
2424
|
-
const An =
|
|
2424
|
+
const An = Kn({
|
|
2425
2425
|
name: "invoiceSymbol",
|
|
2426
2426
|
label: g("invoiceSymbol", "Ký hiệu hóa đơn"),
|
|
2427
2427
|
required: !0,
|
|
@@ -2437,13 +2437,13 @@ function g1(l) {
|
|
|
2437
2437
|
isRenewal: i,
|
|
2438
2438
|
initialValue: r || (($0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : $0.invoiceSymbol) || "1C26TYY",
|
|
2439
2439
|
onChange: (J) => {
|
|
2440
|
-
An.inputEl.value = J,
|
|
2440
|
+
An.inputEl.value = J, on();
|
|
2441
2441
|
}
|
|
2442
2442
|
}), E = document.createElement("input"), E.type = "checkbox", E.name = "hasUsedEInvoiceCB", E.className = "wgt:cursor-pointer", E.checked = (nh = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : nh.hasUsedEInvoice, E.addEventListener("change", (J) => {
|
|
2443
2443
|
J.target.checked ? (Nn.appendChild(tn), Nn.appendChild(F)) : (v.checked = !1, D.inputEl.value = "", D.setError(null), M && (M.inputEl.value = "", M.setError(null), F.contains(M.container) && F.removeChild(M.container)), Nn.removeChild(tn), Nn.removeChild(F));
|
|
2444
2444
|
}), v = document.createElement("input"), v.type = "checkbox", v.name = "hasUsedEInvoiceBeforeCB", v.className = "wgt:cursor-pointer", v.checked = (th = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : th.isUsedEInvoiceBefore, v.addEventListener("change", (J) => {
|
|
2445
2445
|
J.target.checked ? F.appendChild(M.container) : (M.inputEl.value = "", M.setError(null), F.contains(M.container) && F.removeChild(M.container));
|
|
2446
|
-
}), M =
|
|
2446
|
+
}), M = Kn({
|
|
2447
2447
|
name: "previousOtherProviderNameField",
|
|
2448
2448
|
label: g("providerName", "Tên NCC"),
|
|
2449
2449
|
required: !0,
|
|
@@ -2467,7 +2467,7 @@ function g1(l) {
|
|
|
2467
2467
|
)
|
|
2468
2468
|
);
|
|
2469
2469
|
}
|
|
2470
|
-
}), D =
|
|
2470
|
+
}), D = Kn({
|
|
2471
2471
|
name: "previousIssuedByTaxCodeField",
|
|
2472
2472
|
label: g("taxAuthorityCode", "Mã CQT đã phát hành hóa đơn"),
|
|
2473
2473
|
required: !0,
|
|
@@ -2494,12 +2494,12 @@ function g1(l) {
|
|
|
2494
2494
|
});
|
|
2495
2495
|
let Tn = 0;
|
|
2496
2496
|
function Mn(J) {
|
|
2497
|
-
return
|
|
2497
|
+
return ln(this, null, function* () {
|
|
2498
2498
|
const S = ++Tn;
|
|
2499
2499
|
p.setError(null);
|
|
2500
2500
|
try {
|
|
2501
2501
|
const hn = yield fc(J.trim());
|
|
2502
|
-
let
|
|
2502
|
+
let mn = {
|
|
2503
2503
|
name: "",
|
|
2504
2504
|
address: "",
|
|
2505
2505
|
taxAuthority: "",
|
|
@@ -2516,10 +2516,10 @@ function g1(l) {
|
|
|
2516
2516
|
Ln.value,
|
|
2517
2517
|
Ln.label,
|
|
2518
2518
|
Ln.id
|
|
2519
|
-
),
|
|
2519
|
+
), mn.taxAuthority = Ln.id || "", C.setDisabled(!1));
|
|
2520
2520
|
} else
|
|
2521
2521
|
C.setValue && C.setValue("", "", ""), C.setDisabled(!1);
|
|
2522
|
-
return
|
|
2522
|
+
return mn.name = hn.ten_cty || "", mn.address = hn.dia_chi || "", mn.taxCode = J, p.setError(null), mn;
|
|
2523
2523
|
} catch (hn) {
|
|
2524
2524
|
S === Tn && (pt.error(
|
|
2525
2525
|
g("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế."),
|
|
@@ -2532,18 +2532,18 @@ function g1(l) {
|
|
|
2532
2532
|
g("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế.")
|
|
2533
2533
|
));
|
|
2534
2534
|
} finally {
|
|
2535
|
-
S === Tn &&
|
|
2535
|
+
S === Tn && on();
|
|
2536
2536
|
}
|
|
2537
2537
|
});
|
|
2538
2538
|
}
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2539
|
+
const sn = document.createElement("div");
|
|
2540
|
+
sn.className = "wgt:space-y-3";
|
|
2541
2541
|
const mt = document.createElement("h3");
|
|
2542
|
-
mt.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", mt.innerText = g("unitInfo", "1. Thông tin đơn vị"),
|
|
2542
|
+
mt.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", mt.innerText = g("unitInfo", "1. Thông tin đơn vị"), sn.appendChild(mt), setTimeout(() => d(), 50);
|
|
2543
2543
|
const Xn = document.createElement("div");
|
|
2544
|
-
Xn.className = "wgt:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-y-3 wgt:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50",
|
|
2544
|
+
Xn.className = "wgt:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-y-3 wgt:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50", sn.appendChild(Xn), Xn.appendChild(p.container), Xn.appendChild(H.container), Xn.appendChild(N.container), Xn.appendChild(C.container);
|
|
2545
2545
|
const qt = document.createElement("div");
|
|
2546
|
-
qt.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4",
|
|
2546
|
+
qt.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", sn.appendChild(qt), qt.appendChild(j.container), w.appendChild(sn);
|
|
2547
2547
|
const zn = document.createElement("div");
|
|
2548
2548
|
zn.className = "wgt:space-y-4";
|
|
2549
2549
|
const Un = document.createElement("h3");
|
|
@@ -2555,7 +2555,7 @@ function g1(l) {
|
|
|
2555
2555
|
nt.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4 wgt:space-y-2";
|
|
2556
2556
|
let Qn = !1, Rn = !1;
|
|
2557
2557
|
const _n = document.createElement("div");
|
|
2558
|
-
function
|
|
2558
|
+
function On() {
|
|
2559
2559
|
_n.className = "wgt:text-yellow-500 wgt:text-sm wgt:font-medium wgt:text-center", Qn ? _n.innerText = g(
|
|
2560
2560
|
"warningIdCard",
|
|
2561
2561
|
"Vui lòng tải lên ảnh CMND/CCCD hợp lệ"
|
|
@@ -2566,10 +2566,10 @@ function g1(l) {
|
|
|
2566
2566
|
}
|
|
2567
2567
|
function tt(J) {
|
|
2568
2568
|
return new Promise((S) => {
|
|
2569
|
-
Qn = !1, Rn = !1,
|
|
2569
|
+
Qn = !1, Rn = !1, On();
|
|
2570
2570
|
const hn = () => {
|
|
2571
2571
|
G.inputEl.value = "", L.inputEl.value = "", f.inputEl.value = "", m.inputEl.value = "", B.selectEl.value = "", T.selectEl.value = "", G.setError(null), L.setError(null), f.setError(null), m.setError(null), B.setError(null), T.setError(null), u && typeof u.setDate == "function" && u.setDate(null);
|
|
2572
|
-
},
|
|
2572
|
+
}, mn = (xn) => {
|
|
2573
2573
|
if (!xn) return "";
|
|
2574
2574
|
if (/^\d{8}$/.test(xn)) {
|
|
2575
2575
|
const Nt = xn.slice(0, 2), A0 = xn.slice(2, 4), sc = xn.slice(4, 8);
|
|
@@ -2580,11 +2580,11 @@ function g1(l) {
|
|
|
2580
2580
|
const e0 = String(Bt.getDate()).padStart(2, "0"), Kt = String(Bt.getMonth() + 1).padStart(2, "0"), Wt = Bt.getFullYear();
|
|
2581
2581
|
return `${e0}/${Kt}/${Wt}`;
|
|
2582
2582
|
}, vn = new Image();
|
|
2583
|
-
vn.src = URL.createObjectURL(J), vn.onload = () =>
|
|
2583
|
+
vn.src = URL.createObjectURL(J), vn.onload = () => ln(null, null, function* () {
|
|
2584
2584
|
try {
|
|
2585
|
-
const xn = yield l1(vn).then((Ln) => JSON.parse(Ln).status !== "success" ? (Qn = !0, Rn = !1, hn(),
|
|
2585
|
+
const xn = yield l1(vn).then((Ln) => JSON.parse(Ln).status !== "success" ? (Qn = !0, Rn = !1, hn(), On(), null) : JSON.parse(Ln).data);
|
|
2586
2586
|
if (xn || S({ success: !1, reason: "No data detected" }), xn) {
|
|
2587
|
-
Qn = !1, Rn = !0,
|
|
2587
|
+
Qn = !1, Rn = !0, On();
|
|
2588
2588
|
const jn = Object.values(xn).every((Nt) => !Nt);
|
|
2589
2589
|
hn(), jn && (Vt(
|
|
2590
2590
|
g("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
@@ -2592,7 +2592,7 @@ function g1(l) {
|
|
|
2592
2592
|
const { address: xt, date_of_birth: Bt, full_name: e0, id_number: Kt, sex: Wt } = xn;
|
|
2593
2593
|
if (!Kt || !/^\d{12}$/.test(Kt) ? (Vt(
|
|
2594
2594
|
g("errorInvalidCard", "Số CCCD phải có 12 chữ số")
|
|
2595
|
-
), G.inputEl.value = "") : (G.inputEl.value = Kt, G.setError(null)), L.inputEl.value = e0 || "", f.inputEl.value =
|
|
2595
|
+
), G.inputEl.value = "") : (G.inputEl.value = Kt, G.setError(null)), L.inputEl.value = e0 || "", f.inputEl.value = mn(Bt), m.inputEl.value = xt || "", Wt) {
|
|
2596
2596
|
const Nt = ih.find(
|
|
2597
2597
|
(A0) => A0.label.toLowerCase() === Wt.toLowerCase()
|
|
2598
2598
|
);
|
|
@@ -2603,15 +2603,15 @@ function g1(l) {
|
|
|
2603
2603
|
} catch (xn) {
|
|
2604
2604
|
console.error("readIdentityCard failed", xn);
|
|
2605
2605
|
} finally {
|
|
2606
|
-
|
|
2606
|
+
on();
|
|
2607
2607
|
}
|
|
2608
2608
|
});
|
|
2609
2609
|
});
|
|
2610
2610
|
}
|
|
2611
2611
|
function dt(J, S, hn) {
|
|
2612
|
-
const
|
|
2613
|
-
|
|
2614
|
-
yield A1(
|
|
2612
|
+
const mn = new Image();
|
|
2613
|
+
mn.src = URL.createObjectURL(J), mn.onload = () => ln(null, null, function* () {
|
|
2614
|
+
yield A1(mn).then((vn) => {
|
|
2615
2615
|
var Ln, jn;
|
|
2616
2616
|
const xn = JSON.parse(vn);
|
|
2617
2617
|
S && !((Ln = xn == null ? void 0 : xn.data) != null && Ln.isFront) ? Vt(
|
|
@@ -2633,26 +2633,26 @@ function g1(l) {
|
|
|
2633
2633
|
} = Vc({
|
|
2634
2634
|
frontFile: n == null ? void 0 : n.idCard,
|
|
2635
2635
|
backFile: n == null ? void 0 : n.idCardBack,
|
|
2636
|
-
onFrontChange: (J) =>
|
|
2637
|
-
var hn,
|
|
2636
|
+
onFrontChange: (J) => ln(null, null, function* () {
|
|
2637
|
+
var hn, mn;
|
|
2638
2638
|
if (U = J, dt(J, !0, !1), ht() || lt() || !a0()) {
|
|
2639
|
-
Qn = !1, Rn = !1,
|
|
2639
|
+
Qn = !1, Rn = !1, On(), on();
|
|
2640
2640
|
return;
|
|
2641
2641
|
}
|
|
2642
|
-
if ((
|
|
2643
|
-
|
|
2642
|
+
if ((mn = (hn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : hn.legalRepresentative) == null ? void 0 : mn.idCard) {
|
|
2643
|
+
on();
|
|
2644
2644
|
return;
|
|
2645
2645
|
}
|
|
2646
2646
|
tt(J);
|
|
2647
2647
|
}),
|
|
2648
|
-
onBackChange: (J) =>
|
|
2649
|
-
var
|
|
2648
|
+
onBackChange: (J) => ln(null, null, function* () {
|
|
2649
|
+
var mn, vn;
|
|
2650
2650
|
if (cn = J, dt(J, !1, !0), ht() || lt() || !Gt()) {
|
|
2651
|
-
Qn = !1, Rn = !1,
|
|
2651
|
+
Qn = !1, Rn = !1, On(), on();
|
|
2652
2652
|
return;
|
|
2653
2653
|
}
|
|
2654
|
-
if ((vn = (
|
|
2655
|
-
|
|
2654
|
+
if ((vn = (mn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : mn.legalRepresentative) == null ? void 0 : vn.idCardBack) {
|
|
2655
|
+
on();
|
|
2656
2656
|
return;
|
|
2657
2657
|
}
|
|
2658
2658
|
(yield tt(Gt())).success || tt(J);
|
|
@@ -2725,13 +2725,13 @@ function g1(l) {
|
|
|
2725
2725
|
].join(" ");
|
|
2726
2726
|
const en = "http://www.w3.org/2000/svg", _ = document.createElementNS(en, "svg");
|
|
2727
2727
|
_.setAttribute("viewBox", "0 0 24 24"), _.setAttribute("class", "wgt:w-4 wgt:h-4 wgt:text-white");
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2728
|
+
const qn = document.createElementNS(en, "path");
|
|
2729
|
+
qn.setAttribute("fill-rule", "evenodd"), qn.setAttribute("clip-rule", "evenodd"), qn.setAttribute(
|
|
2730
2730
|
"d",
|
|
2731
2731
|
"M5.23 12.03a.75.75 0 011.06.02L10 15.94l7.71-7.71a.75.75 0 111.06 1.06l-8.24 8.24a.75.75 0 01-1.06 0L5.21 13.09a.75.75 0 01.02-1.06z"
|
|
2732
|
-
),
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2732
|
+
), qn.setAttribute("fill", "white"), _.appendChild(qn), $.appendChild(_);
|
|
2733
|
+
const gn = document.createElement("label");
|
|
2734
|
+
gn.className = "wgt:text-sm wgt:text-strong-950 wgt:leading-tight", gn.appendChild(
|
|
2735
2735
|
document.createTextNode(g("agreeWith", "Tôi đồng ý với ") + " ")
|
|
2736
2736
|
);
|
|
2737
2737
|
const Bn = (J) => {
|
|
@@ -2740,10 +2740,10 @@ function g1(l) {
|
|
|
2740
2740
|
hn.preventDefault(), typeof c == "function" && c();
|
|
2741
2741
|
}, S;
|
|
2742
2742
|
}, In = Ic(e);
|
|
2743
|
-
|
|
2743
|
+
gn.appendChild(
|
|
2744
2744
|
Bn(g("termsAndUsagePolicy", "Điều khoản và Chính sách sử dụng"))
|
|
2745
|
-
),
|
|
2746
|
-
an = !an, an ? ($.classList.add("wgt:bg-primary"), _.classList.remove("wgt:hidden")) : ($.classList.remove("wgt:bg-primary"), _.classList.add("wgt:hidden")),
|
|
2745
|
+
), gn.appendChild(document.createTextNode(` ${g("of", "của")} ${In}.`)), nn.appendChild($), nn.appendChild(gn), w.appendChild(nn), $.addEventListener("click", () => {
|
|
2746
|
+
an = !an, an ? ($.classList.add("wgt:bg-primary"), _.classList.remove("wgt:hidden")) : ($.classList.remove("wgt:bg-primary"), _.classList.add("wgt:hidden")), on();
|
|
2747
2747
|
});
|
|
2748
2748
|
const En = document.createElement("div");
|
|
2749
2749
|
En.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", Y.type = "submit", Y.innerText = g("next"), Y.className = [
|
|
@@ -2758,7 +2758,7 @@ function g1(l) {
|
|
|
2758
2758
|
"wgt:cursor-pointer",
|
|
2759
2759
|
"wgt:hover:text-primary-hover-text"
|
|
2760
2760
|
].join(" "), En.appendChild(Y), b.appendChild(En);
|
|
2761
|
-
function
|
|
2761
|
+
function Dn() {
|
|
2762
2762
|
const J = Fn(), S = J.eInvoiceRegistration, hn = (S.organization.taxCode || "").trim();
|
|
2763
2763
|
if (!S.contactPerson.address || !S.organization.name || !S.organization.address || !hn || !S.organization.taxAuthority || !S.contactPerson.name || !S.contactPerson.email || !S.contactPerson.phone || !S.legalRepresentative.name || !S.legalRepresentative.dob || !S.legalRepresentative.gender || !S.legalRepresentative.phone || !S.legalRepresentative.idCard || !S.legalRepresentative.permanentAddress || !S.invoiceSymbol || !i && S.hasUsedEInvoice && !S.taxAuthorityCode || S.isUsedEInvoiceBefore && !S.previousEInvoiceProvider || !Ft(S.contactPerson.name) || !Ft(S.legalRepresentative.name) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(S.contactPerson.address) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(
|
|
2764
2764
|
S.legalRepresentative.permanentAddress
|
|
@@ -2773,9 +2773,9 @@ function g1(l) {
|
|
|
2773
2773
|
), jn = S.legalRepresentative.phone.replace(/[^\d+().\-\s]/g, "").replace(/[\s.\-()]/g, ""), xt = /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/;
|
|
2774
2774
|
return !(!xt.test(xn) || !xt.test(jn) || !/^\d{12}$/.test(S.legalRepresentative.idCard) || !new RegExp("^(?!\\.)(?!.*\\.\\.)[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}(?<!\\.)@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z0-9-]{2,63}$").test(S.contactPerson.email) || !/^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(S.invoiceSymbol) || !J.license || !J.idCard || !J.idCardBack);
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2776
|
+
function on() {
|
|
2777
2777
|
const J = e === "bvb" && !i && A === !1 && !n._userHasEditedTaxCode;
|
|
2778
|
-
Y.disabled = !
|
|
2778
|
+
Y.disabled = !Dn() || !an || ht() || lt() || j.getError() || O.getError() || J;
|
|
2779
2779
|
}
|
|
2780
2780
|
function Fn() {
|
|
2781
2781
|
var J, S;
|
|
@@ -2831,20 +2831,20 @@ function g1(l) {
|
|
|
2831
2831
|
D,
|
|
2832
2832
|
M
|
|
2833
2833
|
].forEach((J) => {
|
|
2834
|
-
J.inputEl.addEventListener("input",
|
|
2834
|
+
J.inputEl.addEventListener("input", on);
|
|
2835
2835
|
}), [B, C].forEach((J) => {
|
|
2836
|
-
J.selectEl.addEventListener("change",
|
|
2836
|
+
J.selectEl.addEventListener("change", on);
|
|
2837
2837
|
}), [E, v].forEach((J) => {
|
|
2838
|
-
J.addEventListener("change",
|
|
2839
|
-
}), Y.addEventListener("click", (J) =>
|
|
2840
|
-
if (J.preventDefault(), !
|
|
2838
|
+
J.addEventListener("change", on);
|
|
2839
|
+
}), Y.addEventListener("click", (J) => ln(null, null, function* () {
|
|
2840
|
+
if (J.preventDefault(), !Dn()) return;
|
|
2841
2841
|
const S = p.getValue().trim();
|
|
2842
2842
|
if (!xh(S)) {
|
|
2843
2843
|
p.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), pt.error(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), k();
|
|
2844
2844
|
return;
|
|
2845
2845
|
}
|
|
2846
2846
|
if (i) {
|
|
2847
|
-
|
|
2847
|
+
Gn(Wn.STEP1_COMPLETED, {
|
|
2848
2848
|
theme: e,
|
|
2849
2849
|
isRenewal: !0,
|
|
2850
2850
|
taxCode: S
|
|
@@ -2852,7 +2852,7 @@ function g1(l) {
|
|
|
2852
2852
|
return;
|
|
2853
2853
|
}
|
|
2854
2854
|
if (e !== "bvb") {
|
|
2855
|
-
|
|
2855
|
+
Gn(Wn.STEP1_COMPLETED, {
|
|
2856
2856
|
theme: e,
|
|
2857
2857
|
isRenewal: !1,
|
|
2858
2858
|
taxCode: S
|
|
@@ -2860,7 +2860,7 @@ function g1(l) {
|
|
|
2860
2860
|
return;
|
|
2861
2861
|
}
|
|
2862
2862
|
Y.disabled = !0;
|
|
2863
|
-
let hn = null,
|
|
2863
|
+
let hn = null, mn = !1;
|
|
2864
2864
|
try {
|
|
2865
2865
|
const vn = (n == null ? void 0 : n.provider) || "m-invoice";
|
|
2866
2866
|
if (console.log("Current theme:", e), console.log("Provider being used:", vn), hn = (yield _h(vn, S, "HDTT")).isNewCustomer, hn)
|
|
@@ -2882,11 +2882,11 @@ function g1(l) {
|
|
|
2882
2882
|
});
|
|
2883
2883
|
}
|
|
2884
2884
|
} catch (vn) {
|
|
2885
|
-
|
|
2885
|
+
mn = !0, console.error("Error checking customer:", vn);
|
|
2886
2886
|
} finally {
|
|
2887
2887
|
Y.disabled = !1, Y.innerText = g("next");
|
|
2888
2888
|
}
|
|
2889
|
-
|
|
2889
|
+
mn || hn === !1 || hn === !0 && (Gn(Wn.STEP1_COMPLETED, {
|
|
2890
2890
|
theme: e,
|
|
2891
2891
|
isRenewal: !1,
|
|
2892
2892
|
isNewCustomer: !0,
|
|
@@ -2894,14 +2894,14 @@ function g1(l) {
|
|
|
2894
2894
|
}), t(Fn()));
|
|
2895
2895
|
}));
|
|
2896
2896
|
const $n = (((eh = (ah = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : ah.organization) == null ? void 0 : eh.taxCode) || "").trim();
|
|
2897
|
-
return $n.length >= 10 && Mn($n), cc(Uh(), jh().invoiceHubBaseUrl), n != null && n.idCard && (U = n == null ? void 0 : n.idCard),
|
|
2897
|
+
return $n.length >= 10 && Mn($n), cc(Uh(), jh().invoiceHubBaseUrl), n != null && n.idCard && (U = n == null ? void 0 : n.idCard), on(), {
|
|
2898
2898
|
container: b,
|
|
2899
2899
|
getValues: Fn
|
|
2900
2900
|
};
|
|
2901
2901
|
});
|
|
2902
2902
|
}
|
|
2903
2903
|
function r1(h) {
|
|
2904
|
-
return
|
|
2904
|
+
return ln(this, arguments, function* ({
|
|
2905
2905
|
providerProps: t,
|
|
2906
2906
|
formProps: n,
|
|
2907
2907
|
isRenewal: e,
|
|
@@ -3256,8 +3256,8 @@ function p1({
|
|
|
3256
3256
|
const q = document.createElement("span");
|
|
3257
3257
|
q.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", q.innerText = "*", A.appendChild(q), o.appendChild(A);
|
|
3258
3258
|
function s() {
|
|
3259
|
-
return
|
|
3260
|
-
n && clearTimeout(n), e !== "" ? n = setTimeout(() =>
|
|
3259
|
+
return ln(this, null, function* () {
|
|
3260
|
+
n && clearTimeout(n), e !== "" ? n = setTimeout(() => ln(null, null, function* () {
|
|
3261
3261
|
try {
|
|
3262
3262
|
const b = e.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g, "."), w = yield Xc({ search: b, bank: t });
|
|
3263
3263
|
w && (a = w), c && c();
|
|
@@ -3405,7 +3405,7 @@ function X1() {
|
|
|
3405
3405
|
}
|
|
3406
3406
|
const B1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFmSURBVHgBjVJLUsJAEH2dTAzu4gmEG+gNYKFxGU9gbqAuLaEqVVDllhuAJyDuQBfEE1CeADiBcaESyWTsJCKfIOXbzPT3db9qAkN5VQvG3iUUVUEoYxcUJlDJC+TcIy8IReY0zA4STKHp15gnYeYTKuCGLiQXrEJnAmK/MHts1Uh5jgXxMab648EaUcv2EUduyrJ1kJb9yvGKgDmzEFMhieoDB7vxBpQsDVEphMYdm/Y402LB0Dxpr9ob7Ff8HKZ/jTw/pNtBBaSeeS93OYLmpAyF4uapw0KmgtfI60/EWjShrftu4IgTH6jxFKSGyEQ0PkdI1BTJzF9SqS4QFRtqwkciezxJCPnVJnV3VkashtTgNf6JrEaqEYt/nItIqrhry+78JSLd9Cf5bxbST/KQH74weQ8Z50Fh8iFJ99dewDAsKO2Cqyp8O04uYrx/Dv3d4wU9LiwvqfQuhL5OnyhuSAFk5KbmN7eYmgg1dFx4AAAAAElFTkSuQmCC";
|
|
3407
3407
|
function N1(N) {
|
|
3408
|
-
return
|
|
3408
|
+
return ln(this, arguments, function* ({
|
|
3409
3409
|
onNext: t,
|
|
3410
3410
|
onPrev: n,
|
|
3411
3411
|
selectedInitPackage: e,
|
|
@@ -3458,28 +3458,30 @@ function N1(N) {
|
|
|
3458
3458
|
an.className = "wgt:text-sm wgt:font-medium wgt:text-black", an.innerHTML = `${g("businessRegistrationType") || "Hình thức đăng ký kinh doanh"} <span class="wgt:text-red-500">*</span>`, nn.appendChild(an);
|
|
3459
3459
|
const $ = document.createElement("div");
|
|
3460
3460
|
$.className = "wgt:inline-flex wgt:items-center wgt:rounded-xl wgt:bg-white wgt:border wgt:border-soft-200 wgt:p-1 wgt:gap-1", nn.appendChild($);
|
|
3461
|
-
function en(En,
|
|
3462
|
-
const
|
|
3463
|
-
|
|
3461
|
+
function en(En, Dn) {
|
|
3462
|
+
const on = document.createElement("button");
|
|
3463
|
+
on.type = "button", on.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:px-4 wgt:py-2 wgt:rounded-lg wgt:text-sm wgt:font-medium wgt:transition wgt:hover:bg-weak-50";
|
|
3464
3464
|
const Fn = document.createElement("span");
|
|
3465
|
-
Fn.className = "wgt:h-4 wgt:w-4 wgt:rounded-full wgt:border wgt:
|
|
3465
|
+
Fn.className = "wgt:h-4 wgt:w-4 wgt:rounded-full wgt:border wgt:flex wgt:items-center wgt:justify-center";
|
|
3466
3466
|
const $n = document.createElement("span");
|
|
3467
|
-
$n.className = "wgt:h-2 wgt:w-2 wgt:rounded-full", $n.style.backgroundColor = "#1e2a7b", $n.style.opacity = "0", Fn.appendChild($n);
|
|
3467
|
+
$n.className = "wgt:h-2 wgt:w-2 wgt:rounded-full ", $n.style.backgroundColor = "#1e2a7b", $n.style.opacity = "0", Fn.appendChild($n);
|
|
3468
3468
|
const et = document.createElement("span");
|
|
3469
|
-
return et.className = "wgt:text-sm wgt:font-semibold", et.innerText = En,
|
|
3470
|
-
F =
|
|
3471
|
-
}), { btn:
|
|
3469
|
+
return et.className = "wgt:text-sm wgt:font-semibold", et.innerText = En, on.appendChild(Fn), on.appendChild(et), on.addEventListener("click", () => {
|
|
3470
|
+
F = Dn, Bn(), W != null && W.eInvoiceRegistration && (W.eInvoiceRegistration.businessType = F), tn == null || tn(F);
|
|
3471
|
+
}), { btn: on, inner: $n, textSpan: et, value: Dn };
|
|
3472
3472
|
}
|
|
3473
|
-
const _ = en(g("company") || "Doanh nghiệp", "company"),
|
|
3473
|
+
const _ = en(g("company") || "Doanh nghiệp", "company"), qn = en(
|
|
3474
3474
|
g("householdBusiness") || "Hộ kinh doanh",
|
|
3475
3475
|
"household"
|
|
3476
3476
|
);
|
|
3477
|
-
$.appendChild(_.btn), $.appendChild(
|
|
3478
|
-
function
|
|
3479
|
-
En.btn.classList.toggle("wgt:bg-weak-50",
|
|
3477
|
+
$.appendChild(_.btn), $.appendChild(qn.btn);
|
|
3478
|
+
function gn(En, Dn) {
|
|
3479
|
+
En.btn.classList.toggle("wgt:bg-weak-50", Dn), En.inner.style.opacity = Dn ? "1" : "0";
|
|
3480
|
+
const on = En.inner.parentElement;
|
|
3481
|
+
on.classList.toggle("wgt:border-[#1e2a7b]", Dn), on.classList.toggle("wgt:border-[#D0D5DD]", !Dn), En.textSpan.style.color = Dn ? "#1e2a7b" : "", En.textSpan.classList.toggle("wgt:text-text-sub-600", !Dn);
|
|
3480
3482
|
}
|
|
3481
3483
|
function Bn() {
|
|
3482
|
-
|
|
3484
|
+
gn(_, F === "company"), gn(qn, F === "household");
|
|
3483
3485
|
}
|
|
3484
3486
|
return Bn(), {
|
|
3485
3487
|
container: nn,
|
|
@@ -3519,7 +3521,7 @@ function N1(N) {
|
|
|
3519
3521
|
container: An,
|
|
3520
3522
|
invoiceSelectorWrapper: Tn,
|
|
3521
3523
|
setInvoicePackages: Mn,
|
|
3522
|
-
getInvoicePackages:
|
|
3524
|
+
getInvoicePackages: sn,
|
|
3523
3525
|
getFilteredInvoiceOptions: mt,
|
|
3524
3526
|
setFilteredInvoiceOptions: Xn,
|
|
3525
3527
|
findInvoiceById: qt,
|
|
@@ -3545,7 +3547,7 @@ function N1(N) {
|
|
|
3545
3547
|
<span class="wgt:text-sm wgt:text-text-sub-600">${g("loading")}...</span>
|
|
3546
3548
|
</div>
|
|
3547
3549
|
`, Z.appendChild(Qn);
|
|
3548
|
-
const { container: Rn } = f1(), { container: _n, tbody:
|
|
3550
|
+
const { container: Rn } = f1(), { container: _n, tbody: On } = X1(), tt = document.createElement("div");
|
|
3549
3551
|
tt.className = "wgt:hidden wgt:@max-2xl:flex wgt:items-center wgt:justify-between wgt:w-full wgt:bg-white wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:px-6 wgt:py-5 wgt:shadow-lg";
|
|
3550
3552
|
const dt = document.createElement("span");
|
|
3551
3553
|
dt.className = "wgt:text-lg wgt:font-bold wgt:text-strong-950", dt.innerText = g("total"), tt.appendChild(dt);
|
|
@@ -3555,7 +3557,7 @@ function N1(N) {
|
|
|
3555
3557
|
ht.className = "wgt:flex wgt:justify-between wgt:gap-2", O.appendChild(ht);
|
|
3556
3558
|
const lt = document.createElement("button");
|
|
3557
3559
|
lt.type = "button", lt.innerText = g("back"), lt.className = "wgt:bg-transparent wgt:text-primary wgt:hover:text-primary-dark wgt:hover:bg-transparent wgt:underline", lt.addEventListener("click", n), ht.appendChild(lt);
|
|
3558
|
-
const Vt = (W, tn, F, nn) =>
|
|
3560
|
+
const Vt = (W, tn, F, nn) => ln(null, null, function* () {
|
|
3559
3561
|
cn();
|
|
3560
3562
|
const _ = x.eInvoiceRegistration, { isUsedEInvoiceBefore: an } = _, $ = mh(_, ["isUsedEInvoiceBefore"]);
|
|
3561
3563
|
let en = [
|
|
@@ -3573,9 +3575,9 @@ function N1(N) {
|
|
|
3573
3575
|
code: W.code,
|
|
3574
3576
|
quantity: W.quantity,
|
|
3575
3577
|
isCashRegister: X
|
|
3576
|
-
}), nn.length > 0 && nn.forEach((
|
|
3577
|
-
const
|
|
3578
|
-
|
|
3578
|
+
}), nn.length > 0 && nn.forEach((qn) => {
|
|
3579
|
+
const gn = R[qn];
|
|
3580
|
+
gn.reward.packageCodes.length > 0 && gn.reward.packageCodes.forEach((Bn) => {
|
|
3579
3581
|
en.push({
|
|
3580
3582
|
code: Bn,
|
|
3581
3583
|
quantity: 1,
|
|
@@ -3584,7 +3586,7 @@ function N1(N) {
|
|
|
3584
3586
|
});
|
|
3585
3587
|
}), I(en), k(nn);
|
|
3586
3588
|
try {
|
|
3587
|
-
const
|
|
3589
|
+
const qn = yield Bc({
|
|
3588
3590
|
eInvoiceRegistration: yn({}, $),
|
|
3589
3591
|
bank: x.bank,
|
|
3590
3592
|
provider: i.route,
|
|
@@ -3598,9 +3600,9 @@ function N1(N) {
|
|
|
3598
3600
|
promotionCodes: nn,
|
|
3599
3601
|
isRenew: H,
|
|
3600
3602
|
isCashRegister: X
|
|
3601
|
-
}),
|
|
3602
|
-
A(
|
|
3603
|
-
} catch (
|
|
3603
|
+
}), gn = qn.orderId, Bn = qn.amount || 0;
|
|
3604
|
+
A(gn), s ? s(Bn) : console.warn("setOrderAmount is not defined!"), yield new Promise((In) => setTimeout(In, 100)), Y(), t();
|
|
3605
|
+
} catch (qn) {
|
|
3604
3606
|
Ut(g("errorCreatingOrder") || "Failed to create order"), Y();
|
|
3605
3607
|
return;
|
|
3606
3608
|
}
|
|
@@ -3608,8 +3610,8 @@ function N1(N) {
|
|
|
3608
3610
|
type: "button",
|
|
3609
3611
|
title: g("next"),
|
|
3610
3612
|
className: "wgt:text-text-primary wgt:bg-primary",
|
|
3611
|
-
handleClick: () =>
|
|
3612
|
-
const W =
|
|
3613
|
+
handleClick: () => ln(null, null, function* () {
|
|
3614
|
+
const W = sn().find(
|
|
3613
3615
|
($) => $._id === L
|
|
3614
3616
|
), tn = z.find(
|
|
3615
3617
|
($) => $._id === f
|
|
@@ -3619,10 +3621,10 @@ function N1(N) {
|
|
|
3619
3621
|
return;
|
|
3620
3622
|
}
|
|
3621
3623
|
let F = null;
|
|
3622
|
-
!H && !(W != null && W.withoutInitialFee) ? (F =
|
|
3624
|
+
!H && !(W != null && W.withoutInitialFee) ? (F = Yn(yn({}, G[0]), {
|
|
3623
3625
|
quantity: P
|
|
3624
3626
|
}), a(F)) : a(null);
|
|
3625
|
-
let nn =
|
|
3627
|
+
let nn = Yn(yn({}, W), { quantity: E }), an = tn ? Yn(yn({}, tn), { quantity: v }) : null;
|
|
3626
3628
|
u(nn), o(an), d(B), M(), p && p({
|
|
3627
3629
|
qtyRegFee: P,
|
|
3628
3630
|
qtyInvoicePkg: E,
|
|
@@ -3637,7 +3639,7 @@ function N1(N) {
|
|
|
3637
3639
|
});
|
|
3638
3640
|
ht.appendChild(c0);
|
|
3639
3641
|
function Gt() {
|
|
3640
|
-
return
|
|
3642
|
+
return ln(this, null, function* () {
|
|
3641
3643
|
var W, tn;
|
|
3642
3644
|
try {
|
|
3643
3645
|
const [
|
|
@@ -3677,16 +3679,16 @@ function N1(N) {
|
|
|
3677
3679
|
reward: en.reward
|
|
3678
3680
|
});
|
|
3679
3681
|
}), Object.keys(R).length > 0 && (B = l ? [...l] : [], vt())) : console.error("Failed to load promotions:", F.reason), an.status === "fulfilled") {
|
|
3680
|
-
y = (H ? an.value.filter((
|
|
3682
|
+
y = (H ? an.value.filter((qn) => qn.renewPrice !== 0) : an.value) || [];
|
|
3681
3683
|
const _ = X ? Q(
|
|
3682
3684
|
y,
|
|
3683
3685
|
rn.getValue()
|
|
3684
3686
|
) : y;
|
|
3685
3687
|
if (Mn(_ || []), Xn(_ || []), Mn(_ || []), an.value.length > 0) {
|
|
3686
|
-
const
|
|
3687
|
-
(
|
|
3688
|
+
const qn = _.find(
|
|
3689
|
+
(gn) => T.includes(gn.code)
|
|
3688
3690
|
);
|
|
3689
|
-
L = c ? c._id :
|
|
3691
|
+
L = c ? c._id : qn ? qn._id : _ == null ? void 0 : _[0]._id, Xn(_);
|
|
3690
3692
|
}
|
|
3691
3693
|
zn();
|
|
3692
3694
|
} else
|
|
@@ -3734,7 +3736,7 @@ function N1(N) {
|
|
|
3734
3736
|
(_) => _.bank === r && _.appliedPackages.includes(tn)
|
|
3735
3737
|
), en = $ && !$.isDisabled && !($.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && $.limit !== $.used;
|
|
3736
3738
|
if (an && !en) {
|
|
3737
|
-
const { container: _, open:
|
|
3739
|
+
const { container: _, open: qn } = It({
|
|
3738
3740
|
message: g("errorDiscountPackage"),
|
|
3739
3741
|
description: g("errorDiscountPackageDes"),
|
|
3740
3742
|
okLabel: g("ok"),
|
|
@@ -3744,7 +3746,7 @@ function N1(N) {
|
|
|
3744
3746
|
isSuccess: !1,
|
|
3745
3747
|
theme: r
|
|
3746
3748
|
});
|
|
3747
|
-
O.appendChild(_),
|
|
3749
|
+
O.appendChild(_), qn();
|
|
3748
3750
|
} else
|
|
3749
3751
|
F();
|
|
3750
3752
|
}
|
|
@@ -3761,9 +3763,9 @@ function N1(N) {
|
|
|
3761
3763
|
isRenew: H,
|
|
3762
3764
|
handlePackageSelect: (W) => {
|
|
3763
3765
|
var nn, an;
|
|
3764
|
-
let tn = (nn =
|
|
3766
|
+
let tn = (nn = sn().find(
|
|
3765
3767
|
($) => $._id === L
|
|
3766
|
-
)) == null ? void 0 : nn.code, F = (an =
|
|
3768
|
+
)) == null ? void 0 : nn.code, F = (an = sn().find(($) => $._id === W)) == null ? void 0 : an.code;
|
|
3767
3769
|
ft(tn, F, () => {
|
|
3768
3770
|
L = W, it.setSelectedPackageId(W), at(), Tt(), Zn(), Nn();
|
|
3769
3771
|
});
|
|
@@ -3796,7 +3798,7 @@ function N1(N) {
|
|
|
3796
3798
|
return;
|
|
3797
3799
|
}
|
|
3798
3800
|
ft(tn, F, () => {
|
|
3799
|
-
f = W, gt.setSelectedPackageId(W), Xn(
|
|
3801
|
+
f = W, gt.setSelectedPackageId(W), Xn(sn()), at(), Tt(), Zn(), Nn();
|
|
3800
3802
|
});
|
|
3801
3803
|
}
|
|
3802
3804
|
}), Un.appendChild(gt.container);
|
|
@@ -3809,7 +3811,7 @@ function N1(N) {
|
|
|
3809
3811
|
rt.className = "wgt:w-full", Z.appendChild(rt);
|
|
3810
3812
|
function Tt() {
|
|
3811
3813
|
Qn.remove(), rt.innerHTML = "";
|
|
3812
|
-
const W =
|
|
3814
|
+
const W = sn().find(
|
|
3813
3815
|
(tn) => tn._id === L
|
|
3814
3816
|
);
|
|
3815
3817
|
if (G.length > 0) {
|
|
@@ -3833,7 +3835,7 @@ function N1(N) {
|
|
|
3833
3835
|
const Jn = document.createElement("div");
|
|
3834
3836
|
Jn.className = "promotion-wrapper wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
3835
3837
|
function at() {
|
|
3836
|
-
const W =
|
|
3838
|
+
const W = sn().find(
|
|
3837
3839
|
(an) => an._id === L
|
|
3838
3840
|
), tn = z.find(
|
|
3839
3841
|
(an) => an._id === f
|
|
@@ -3847,9 +3849,9 @@ function N1(N) {
|
|
|
3847
3849
|
);
|
|
3848
3850
|
return;
|
|
3849
3851
|
}
|
|
3850
|
-
const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), _ = $.limit <= $.used,
|
|
3852
|
+
const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), _ = $.limit <= $.used, qn = !$.isActive, Bn = ((In = $.appliedPackages) == null ? void 0 : In.some(
|
|
3851
3853
|
(En) => nn.includes(En)
|
|
3852
|
-
)) && !en && !_ && !
|
|
3854
|
+
)) && !en && !_ && !qn;
|
|
3853
3855
|
$.isDisabled = !Bn, Bn ? Bn && !B.includes($.code) && B.push($.code) : B = B.filter(
|
|
3854
3856
|
(En) => En !== $.code
|
|
3855
3857
|
);
|
|
@@ -3877,20 +3879,20 @@ function N1(N) {
|
|
|
3877
3879
|
const F = document.createElement("div");
|
|
3878
3880
|
F.className = "wgt:w-full wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3879
3881
|
const nn = document.createElement("div");
|
|
3880
|
-
nn.className = "wgt:flex wgt:min-w-[500px] wgt:h-11 wgt:items-center wgt:gap-3 wgt:px-3 wgt:py-2 wgt:rounded-lg wgt:bg-white wgt:border wgt:border-[#E4E7EC] wgt:@max-2xl:min-w-full wgt:@max-2xl:flex-wrap wgt:@max-2xl:h-fit", F.appendChild(nn), B && B.length > 0 && B.filter((
|
|
3881
|
-
const
|
|
3882
|
-
(Bn) => Bn.code ===
|
|
3882
|
+
nn.className = "wgt:flex wgt:min-w-[500px] wgt:h-11 wgt:items-center wgt:gap-3 wgt:px-3 wgt:py-2 wgt:rounded-lg wgt:bg-white wgt:border wgt:border-[#E4E7EC] wgt:@max-2xl:min-w-full wgt:@max-2xl:flex-wrap wgt:@max-2xl:h-fit", F.appendChild(nn), B && B.length > 0 && B.filter((qn) => {
|
|
3883
|
+
const gn = Object.values(R).find(
|
|
3884
|
+
(Bn) => Bn.code === qn
|
|
3883
3885
|
);
|
|
3884
|
-
return
|
|
3885
|
-
}).forEach((
|
|
3886
|
-
const
|
|
3887
|
-
|
|
3886
|
+
return gn && gn.bank === r;
|
|
3887
|
+
}).forEach((qn) => {
|
|
3888
|
+
const gn = document.createElement("div");
|
|
3889
|
+
gn.className = "wgt:flex wgt:w-fit wgt:h-fit wgt:items-center wgt:gap-2 wgt:px-2 wgt:py-1.5 wgt:rounded-md wgt:bg-primary/10 wgt:border wgt:border-primary wgt:text-sm wgt:font-medium wgt:text-primary", gn.innerText = qn;
|
|
3888
3890
|
const Bn = yt({
|
|
3889
3891
|
type: "button",
|
|
3890
3892
|
title: "x",
|
|
3891
3893
|
handleClick: () => {
|
|
3892
3894
|
B = B.filter(
|
|
3893
|
-
(In) => In !==
|
|
3895
|
+
(In) => In !== qn
|
|
3894
3896
|
), Zn(), Nn();
|
|
3895
3897
|
}
|
|
3896
3898
|
});
|
|
@@ -3898,7 +3900,7 @@ function N1(N) {
|
|
|
3898
3900
|
<path d="M1.17157 1.17163L6.82842 6.82848" stroke="#0E121B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3899
3901
|
<path d="M1.17158 6.82849L6.82843 1.17163" stroke="#0E121B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3900
3902
|
</svg>
|
|
3901
|
-
`,
|
|
3903
|
+
`, gn.appendChild(Bn), nn.appendChild(gn);
|
|
3902
3904
|
});
|
|
3903
3905
|
const an = yt({
|
|
3904
3906
|
type: "button",
|
|
@@ -3916,18 +3918,18 @@ function N1(N) {
|
|
|
3916
3918
|
);
|
|
3917
3919
|
if (en.length > 0)
|
|
3918
3920
|
en.forEach((_) => {
|
|
3919
|
-
const { container:
|
|
3920
|
-
promotion:
|
|
3921
|
+
const { container: qn } = w1({
|
|
3922
|
+
promotion: Yn(yn({}, _), {
|
|
3921
3923
|
isSelected: B.includes(_.code)
|
|
3922
3924
|
}),
|
|
3923
|
-
onSelect: (
|
|
3924
|
-
Bn ? B.push(
|
|
3925
|
-
(In) => In !==
|
|
3925
|
+
onSelect: (gn, Bn) => {
|
|
3926
|
+
Bn ? B.push(gn) : B = B.filter(
|
|
3927
|
+
(In) => In !== gn
|
|
3926
3928
|
), Zn(), Nn();
|
|
3927
3929
|
},
|
|
3928
3930
|
isDisabled: _.isDisabled || _.expiredAt < (/* @__PURE__ */ new Date()).toISOString() || _.limit === _.used
|
|
3929
3931
|
});
|
|
3930
|
-
$.appendChild(
|
|
3932
|
+
$.appendChild(qn);
|
|
3931
3933
|
});
|
|
3932
3934
|
else {
|
|
3933
3935
|
const _ = document.createElement("span");
|
|
@@ -3935,17 +3937,17 @@ function N1(N) {
|
|
|
3935
3937
|
}
|
|
3936
3938
|
}
|
|
3937
3939
|
function Nn() {
|
|
3938
|
-
var En,
|
|
3939
|
-
if (M(),
|
|
3940
|
+
var En, Dn, on, Fn, $n, et, Mt, Jt, Dt;
|
|
3941
|
+
if (M(), On.innerHTML = "", Z.appendChild(_n), Z.appendChild(tt), Z.appendChild(Rn), sn().length === 0 && z.length === 0) {
|
|
3940
3942
|
const K = document.createElement("tr");
|
|
3941
3943
|
K.innerHTML = `
|
|
3942
3944
|
<td colspan="5" class="wgt:px-3 wgt:py-8 wgt:text-center wgt:text-text-sub-600 wgt:@max-2xl:col-span-5">
|
|
3943
3945
|
${g("noDataAvailable") || "No data available"}
|
|
3944
3946
|
</td>
|
|
3945
|
-
`,
|
|
3947
|
+
`, On.appendChild(K), q(0);
|
|
3946
3948
|
return;
|
|
3947
3949
|
}
|
|
3948
|
-
const W =
|
|
3950
|
+
const W = sn().find(
|
|
3949
3951
|
(K) => K._id === L
|
|
3950
3952
|
);
|
|
3951
3953
|
if (!H && (G == null ? void 0 : G.length) > 0 && !(W != null && W.withoutInitialFee)) {
|
|
@@ -3972,13 +3974,13 @@ function N1(N) {
|
|
|
3972
3974
|
const kn = document.createElement("td");
|
|
3973
3975
|
kn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", kn.innerText = Sn((En = G[0]) == null ? void 0 : En.price) + " VND", K.appendChild(kn);
|
|
3974
3976
|
const Hn = document.createElement("td");
|
|
3975
|
-
Hn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:min-w-[16rem] wgt:@max-2xl:hidden", Hn.innerText = Sn(((
|
|
3977
|
+
Hn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:min-w-[16rem] wgt:@max-2xl:hidden", Hn.innerText = Sn(((Dn = G[0]) == null ? void 0 : Dn.price) * P) + " VND", K.appendChild(Hn);
|
|
3976
3978
|
const Vn = document.createElement("div");
|
|
3977
3979
|
Vn.className = "wgt:hidden wgt:@max-2xl:flex wgt:flex-col wgt:gap-1 wgt:mt-2 wgt:pt-2 wgt:border-t wgt:border-soft-200", Vn.innerHTML = `
|
|
3978
3980
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
3979
3981
|
<span>${g("unitPrice")}:</span>
|
|
3980
3982
|
<span class="wgt:font-medium">${Sn(
|
|
3981
|
-
(
|
|
3983
|
+
(on = G[0]) == null ? void 0 : on.price
|
|
3982
3984
|
)} VND</span>
|
|
3983
3985
|
</div>
|
|
3984
3986
|
<div class="wgt:flex wgt:justify-between wgt:text-base wgt:font-semibold wgt:text-strong-950">
|
|
@@ -3987,7 +3989,7 @@ function N1(N) {
|
|
|
3987
3989
|
((Fn = G[0]) == null ? void 0 : Fn.price) * P
|
|
3988
3990
|
)} VND</span>
|
|
3989
3991
|
</div>
|
|
3990
|
-
`, un.appendChild(Vn),
|
|
3992
|
+
`, un.appendChild(Vn), On.appendChild(K);
|
|
3991
3993
|
}
|
|
3992
3994
|
{
|
|
3993
3995
|
const K = qt(L);
|
|
@@ -4032,7 +4034,7 @@ function N1(N) {
|
|
|
4032
4034
|
Cn * (K == null ? void 0 : K.limit) * E
|
|
4033
4035
|
)} VND</span>
|
|
4034
4036
|
</div>
|
|
4035
|
-
`, dn.appendChild(Lt),
|
|
4037
|
+
`, dn.appendChild(Lt), On.appendChild(un);
|
|
4036
4038
|
}
|
|
4037
4039
|
}
|
|
4038
4040
|
{
|
|
@@ -4077,7 +4079,7 @@ function N1(N) {
|
|
|
4077
4079
|
(K == null ? void 0 : K.limit) * (K == null ? void 0 : K.price) * v
|
|
4078
4080
|
)} VND</span>
|
|
4079
4081
|
</div>
|
|
4080
|
-
`, dn.appendChild(At),
|
|
4082
|
+
`, dn.appendChild(At), On.appendChild(un);
|
|
4081
4083
|
}
|
|
4082
4084
|
}
|
|
4083
4085
|
const tn = B.map(
|
|
@@ -4104,9 +4106,9 @@ function N1(N) {
|
|
|
4104
4106
|
(wn = K == null ? void 0 : K.reward) == null ? void 0 : wn.discountAmount
|
|
4105
4107
|
)} VND`, fn.style.color = "#F04438", F += (pn = K == null ? void 0 : K.reward) == null ? void 0 : pn.discountAmount) : (K == null ? void 0 : K.type) === "free_item" ? (fn.innerText = `+${(kn = (Cn = K == null ? void 0 : K.reward) == null ? void 0 : Cn.packageCodes) == null ? void 0 : kn.length} ${g(
|
|
4106
4108
|
"package"
|
|
4107
|
-
)} ${(Vn = (Hn = K == null ? void 0 : K.reward) == null ? void 0 : Hn.packageCodes) == null ? void 0 : Vn.join(", ")}`, fn.style.color = "#12B76A") : fn.innerText = "", un.appendChild(fn),
|
|
4109
|
+
)} ${(Vn = (Hn = K == null ? void 0 : K.reward) == null ? void 0 : Hn.packageCodes) == null ? void 0 : Vn.join(", ")}`, fn.style.color = "#12B76A") : fn.innerText = "", un.appendChild(fn), On.appendChild(un);
|
|
4108
4110
|
});
|
|
4109
|
-
const nn = !H && G.length > 0 && !(W != null && W.withoutInitialFee) ? ((Mt = G[0]) == null ? void 0 : Mt.price) * P : 0, an = qt(L), $ = an ? H ? (Dt = an.renewPrice) != null ? Dt : 0 : (Jt = an.price) != null ? Jt : 0 : 0, en = an ? $ * an.limit * E : 0, _ = j(f),
|
|
4111
|
+
const nn = !H && G.length > 0 && !(W != null && W.withoutInitialFee) ? ((Mt = G[0]) == null ? void 0 : Mt.price) * P : 0, an = qt(L), $ = an ? H ? (Dt = an.renewPrice) != null ? Dt : 0 : (Jt = an.price) != null ? Jt : 0 : 0, en = an ? $ * an.limit * E : 0, _ = j(f), qn = _ ? _.price * _.limit * v : 0, gn = nn + en + qn, Bn = Math.min(F, gn), In = Math.max(gn - Bn, 0);
|
|
4110
4112
|
q(In);
|
|
4111
4113
|
{
|
|
4112
4114
|
const K = document.createElement("tr");
|
|
@@ -4114,7 +4116,7 @@ function N1(N) {
|
|
|
4114
4116
|
const un = document.createElement("td");
|
|
4115
4117
|
un.colSpan = 4, un.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950 wgt:col-span-4", un.innerText = g("total"), K.appendChild(un);
|
|
4116
4118
|
const dn = document.createElement("td");
|
|
4117
|
-
dn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", dn.innerText = Sn(In) + " VND", K.appendChild(dn),
|
|
4119
|
+
dn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", dn.innerText = Sn(In) + " VND", K.appendChild(dn), On.appendChild(K);
|
|
4118
4120
|
}
|
|
4119
4121
|
st.innerText = Sn(In) + " VND";
|
|
4120
4122
|
}
|
|
@@ -4308,8 +4310,8 @@ function k1({
|
|
|
4308
4310
|
An.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", An.innerText = g("promotion");
|
|
4309
4311
|
const Tn = document.createElement("div");
|
|
4310
4312
|
Tn.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", a.forEach((Mn) => {
|
|
4311
|
-
const
|
|
4312
|
-
|
|
4313
|
+
const sn = document.createElement("div");
|
|
4314
|
+
sn.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", sn.innerText = Mn, Tn.appendChild(sn);
|
|
4313
4315
|
}), Z.appendChild(An), Z.appendChild(Tn), w.appendChild(Z);
|
|
4314
4316
|
}
|
|
4315
4317
|
const B = document.createElement("hr");
|
|
@@ -4355,7 +4357,7 @@ function k1({
|
|
|
4355
4357
|
const Y = yt({
|
|
4356
4358
|
title: A ? g("confirmFreeOrder") || "Xác nhận đơn hàng" : g("cancelTransaction") || "Hủy giao dịch",
|
|
4357
4359
|
className: A ? "wgt:flex-1 wgt:py-3 wgt:rounded-lg wgt:bg-primary wgt:text-white hover:wgt:bg-primary-dark" : "wgt:w-full wgt:py-3 wgt:rounded-lg wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary hover:wgt:bg-transparent",
|
|
4358
|
-
handleClick: A ? () =>
|
|
4360
|
+
handleClick: A ? () => ln(null, null, function* () {
|
|
4359
4361
|
Y.disabled = !0;
|
|
4360
4362
|
const Z = Y.textContent;
|
|
4361
4363
|
Y.textContent = g("processing") || "Đang xử lý...", U();
|
|
@@ -6189,7 +6191,7 @@ function ca({
|
|
|
6189
6191
|
}
|
|
6190
6192
|
const aa = 5;
|
|
6191
6193
|
function ea(o) {
|
|
6192
|
-
return
|
|
6194
|
+
return ln(this, arguments, function* ({
|
|
6193
6195
|
onNext: t,
|
|
6194
6196
|
onPrev: n,
|
|
6195
6197
|
step: e,
|
|
@@ -6215,7 +6217,7 @@ function ea(o) {
|
|
|
6215
6217
|
const V = document.createElement("div");
|
|
6216
6218
|
V.className = "wgt:flex-1 wgt:@max-2xl:w-full";
|
|
6217
6219
|
let L, f;
|
|
6218
|
-
const { container: B } = k1(
|
|
6220
|
+
const { container: B } = k1(Yn(yn({}, h), {
|
|
6219
6221
|
selectedPromotions: (h == null ? void 0 : h.selectedPromotions) || [],
|
|
6220
6222
|
onResetToStep1: () => {
|
|
6221
6223
|
s && (clearInterval(s), s = null), h != null && h.onResetToStep1 && h.onResetToStep1();
|
|
@@ -6235,7 +6237,7 @@ function ea(o) {
|
|
|
6235
6237
|
Q.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-center wgt:min-h-[400px]", Q.appendChild(B);
|
|
6236
6238
|
else {
|
|
6237
6239
|
Q.className = "wgt:w-full wgt:flex wgt:items-start wgt:gap-6 wgt:@max-2xl:flex-col-reverse";
|
|
6238
|
-
const M = H1(
|
|
6240
|
+
const M = H1(Yn(yn({
|
|
6239
6241
|
qrSrc: "",
|
|
6240
6242
|
accountName: "",
|
|
6241
6243
|
accountNumber: "",
|
|
@@ -6252,7 +6254,7 @@ function ea(o) {
|
|
|
6252
6254
|
G.className = "wgt:flex wgt:items-center wgt:justify-between wgt:gap-2";
|
|
6253
6255
|
const R = document.createElement("button");
|
|
6254
6256
|
R.type = "button", R.className = "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline", R.textContent = g("back"), R.addEventListener("click", () => {
|
|
6255
|
-
|
|
6257
|
+
Gn(Wn.STEP3_BACK_CLICKED, {
|
|
6256
6258
|
orderId: r,
|
|
6257
6259
|
provider: I,
|
|
6258
6260
|
theme: u,
|
|
@@ -6260,9 +6262,9 @@ function ea(o) {
|
|
|
6260
6262
|
}), n && (clearInterval(s), s = null, n());
|
|
6261
6263
|
}), G.appendChild(R), N.appendChild(G);
|
|
6262
6264
|
function T() {
|
|
6263
|
-
return
|
|
6265
|
+
return ln(this, null, function* () {
|
|
6264
6266
|
const M = (h == null ? void 0 : h.totalAmountText) || 0;
|
|
6265
|
-
d = M, x = M === 0,
|
|
6267
|
+
d = M, x = M === 0, Gn(Wn.STEP3_VIEWED, {
|
|
6266
6268
|
orderId: r,
|
|
6267
6269
|
amount: d,
|
|
6268
6270
|
provider: I,
|
|
@@ -6272,7 +6274,7 @@ function ea(o) {
|
|
|
6272
6274
|
});
|
|
6273
6275
|
}
|
|
6274
6276
|
function m(M) {
|
|
6275
|
-
return
|
|
6277
|
+
return ln(this, null, function* () {
|
|
6276
6278
|
var D, j, O, U;
|
|
6277
6279
|
if (!(i || x)) {
|
|
6278
6280
|
i = !0, X();
|
|
@@ -6338,7 +6340,7 @@ function ea(o) {
|
|
|
6338
6340
|
});
|
|
6339
6341
|
}
|
|
6340
6342
|
function P() {
|
|
6341
|
-
x || s || (s = setInterval(() =>
|
|
6343
|
+
x || s || (s = setInterval(() => ln(null, null, function* () {
|
|
6342
6344
|
var M, D, j, O, U, cn;
|
|
6343
6345
|
try {
|
|
6344
6346
|
const Y = yield kc(r);
|
|
@@ -6604,7 +6606,7 @@ function ga() {
|
|
|
6604
6606
|
};
|
|
6605
6607
|
}
|
|
6606
6608
|
function Rh(c) {
|
|
6607
|
-
return
|
|
6609
|
+
return ln(this, arguments, function* ({
|
|
6608
6610
|
orderId: t,
|
|
6609
6611
|
callbackUrl: n,
|
|
6610
6612
|
onCompleteSignature: e
|
|
@@ -6872,7 +6874,7 @@ function da({
|
|
|
6872
6874
|
return { container: i, open: V, close: L };
|
|
6873
6875
|
}
|
|
6874
6876
|
function L0(t, n, e, c = !1, h = "ocb", a = "") {
|
|
6875
|
-
return
|
|
6877
|
+
return ln(this, null, function* () {
|
|
6876
6878
|
var u, o;
|
|
6877
6879
|
try {
|
|
6878
6880
|
if (h !== "bvb") {
|
|
@@ -6893,7 +6895,7 @@ function L0(t, n, e, c = !1, h = "ocb", a = "") {
|
|
|
6893
6895
|
// },
|
|
6894
6896
|
onCancel: () => {
|
|
6895
6897
|
},
|
|
6896
|
-
onConfirm: () =>
|
|
6898
|
+
onConfirm: () => ln(null, null, function* () {
|
|
6897
6899
|
const i = yield _t(t, n);
|
|
6898
6900
|
e(!1, i);
|
|
6899
6901
|
}),
|
|
@@ -6909,7 +6911,7 @@ function L0(t, n, e, c = !1, h = "ocb", a = "") {
|
|
|
6909
6911
|
});
|
|
6910
6912
|
}
|
|
6911
6913
|
function Xa(t, n, e, c, h, a) {
|
|
6912
|
-
return
|
|
6914
|
+
return ln(this, null, function* () {
|
|
6913
6915
|
var v, M;
|
|
6914
6916
|
const o = [
|
|
6915
6917
|
{ name: "M-Invoice", route: "m-invoice", logoUrl: dc },
|
|
@@ -7022,7 +7024,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7022
7024
|
address: "",
|
|
7023
7025
|
taxCode: (c == null ? void 0 : c.taxCode) || "",
|
|
7024
7026
|
taxAuthority: ""
|
|
7025
|
-
}), d =
|
|
7027
|
+
}), d = Yn(yn({}, d), {
|
|
7026
7028
|
eInvoiceRegistration: {
|
|
7027
7029
|
organization: {
|
|
7028
7030
|
name: (D == null ? void 0 : D.name) || "",
|
|
@@ -7069,8 +7071,8 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7069
7071
|
});
|
|
7070
7072
|
}
|
|
7071
7073
|
function G(D, j) {
|
|
7072
|
-
return
|
|
7073
|
-
D ? d =
|
|
7074
|
+
return ln(this, null, function* () {
|
|
7075
|
+
D ? d = Yn(yn({}, d), {
|
|
7074
7076
|
eInvoiceRegistration: {
|
|
7075
7077
|
organization: yn({}, D.organization),
|
|
7076
7078
|
contactPerson: a ? yn({}, D.contactPerson) : d.eInvoiceRegistration.contactPerson,
|
|
@@ -7083,7 +7085,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7083
7085
|
});
|
|
7084
7086
|
}
|
|
7085
7087
|
function R(D) {
|
|
7086
|
-
return
|
|
7088
|
+
return ln(this, null, function* () {
|
|
7087
7089
|
if (D === 1) {
|
|
7088
7090
|
const { container: j } = yield r1({
|
|
7089
7091
|
isNewCustomer: k,
|
|
@@ -7091,7 +7093,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7091
7093
|
providerProps: {
|
|
7092
7094
|
providers: o,
|
|
7093
7095
|
selectedRoute: x.route,
|
|
7094
|
-
onProviderChange: (O) =>
|
|
7096
|
+
onProviderChange: (O) => ln(null, null, function* () {
|
|
7095
7097
|
var U, cn;
|
|
7096
7098
|
x = O, yield L0(
|
|
7097
7099
|
O.route,
|
|
@@ -7146,15 +7148,15 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7146
7148
|
});
|
|
7147
7149
|
i(j);
|
|
7148
7150
|
} else if (D === 2) {
|
|
7149
|
-
|
|
7151
|
+
Gn(Wn.STEP2_VIEWED, {
|
|
7150
7152
|
theme: h,
|
|
7151
7153
|
isRenewal: a,
|
|
7152
7154
|
provider: x == null ? void 0 : x.route,
|
|
7153
7155
|
isNewCustomer: k
|
|
7154
7156
|
});
|
|
7155
7157
|
const { container: j } = yield N1({
|
|
7156
|
-
onNext: () =>
|
|
7157
|
-
|
|
7158
|
+
onNext: () => ln(null, null, function* () {
|
|
7159
|
+
Gn(Wn.STEP2_COMPLETED, {
|
|
7158
7160
|
theme: h,
|
|
7159
7161
|
provider: x == null ? void 0 : x.route,
|
|
7160
7162
|
totalAmount: N,
|
|
@@ -7267,7 +7269,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7267
7269
|
I && (i(T), m()), yield L0(
|
|
7268
7270
|
x.route,
|
|
7269
7271
|
(M = (v = d == null ? void 0 : d.eInvoiceRegistration) == null ? void 0 : v.organization) == null ? void 0 : M.taxCode,
|
|
7270
|
-
(D, j) =>
|
|
7272
|
+
(D, j) => ln(null, null, function* () {
|
|
7271
7273
|
I = !1, k = D, G(j), q.updateTitle(
|
|
7272
7274
|
a ? g("eInvoiceRenewal") : g("eInvoiceRegister")
|
|
7273
7275
|
);
|
|
@@ -7288,12 +7290,12 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7288
7290
|
});
|
|
7289
7291
|
}
|
|
7290
7292
|
function Ba(t, n, e, c) {
|
|
7291
|
-
return
|
|
7293
|
+
return ln(this, null, function* () {
|
|
7292
7294
|
const { container: h, setContent: a } = ga(), u = e == null ? void 0 : e.orderId, o = (e == null ? void 0 : e.callbackUrl) || `${window.location.origin}/dashboard`, { container: A } = yield Rh({
|
|
7293
7295
|
orderId: u,
|
|
7294
7296
|
callbackUrl: o,
|
|
7295
7297
|
// onCompleteSignature,
|
|
7296
|
-
onCompleteSignature: (...i) =>
|
|
7298
|
+
onCompleteSignature: (...i) => ln(null, null, function* () {
|
|
7297
7299
|
c && (yield c(...i)), r();
|
|
7298
7300
|
})
|
|
7299
7301
|
});
|