@invoice-sdk/widget 1.127.0 → 1.127.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-DIqFZUIm.js → index-8dVnc__Y.js} +728 -726
- package/dist/{index-BI9WQkMW.js → index-hdQ5KKW7.js} +2 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +20 -20
- package/dist/{loading-BR5rNYi6.js → loading-DHlkjOxo.js} +2 -2
- package/dist/{widget-BaJrubVV.js → widget-BgR9a3fb.js} +364 -358
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as l, g as mh, a as Tt, s as Mt, c as Nt, b as Xh, d as Bh, e as ih, f as Nh, h as zt, o as Eh, m as Hh, i as
|
|
2
|
-
import { c as wt, a as Kt, g as Jt, b as vh, f as vn, d as Qh, e as Yt, h as Lh, i as Ih, j as bh, k as Sh, l as Vh, m as Mh, n as Jh } from "./loading-
|
|
1
|
+
import { t as l, g as mh, a as Tt, s as Mt, c as Nt, b as Xh, d as Bh, e as ih, f as Nh, h as zt, o as Eh, m as Hh, i as yh, j as Ph, v as kh } from "./index-8dVnc__Y.js";
|
|
2
|
+
import { c as wt, a as Kt, g as Jt, b as vh, f as vn, d as Qh, e as Yt, h as Lh, i as Ih, j as bh, k as Sh, l as Vh, m as Mh, n as Jh } from "./loading-DHlkjOxo.js";
|
|
3
3
|
import { g as sh } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
4
4
|
function X0({ steps: n = [], currentStep: t = 1 } = {}) {
|
|
5
5
|
const e = document.createElement("div");
|
|
@@ -278,7 +278,7 @@ function Kh({
|
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Mn({
|
|
282
282
|
name: n,
|
|
283
283
|
value: t = "",
|
|
284
284
|
type: e = "text",
|
|
@@ -861,10 +861,10 @@ const zh = ({
|
|
|
861
861
|
}), Q.appendChild(B), r.append(Q);
|
|
862
862
|
const Y = document.createElement("div");
|
|
863
863
|
Y.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
864
|
-
const
|
|
865
|
-
|
|
864
|
+
const $ = document.createElement("span");
|
|
865
|
+
$.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", $.textContent = l("formDifferentiationCode");
|
|
866
866
|
const g = document.createElement("span");
|
|
867
|
-
g.className = "wgt:text-red-500 wgt:ml-1", g.innerText = "*",
|
|
867
|
+
g.className = "wgt:text-red-500 wgt:ml-1", g.innerText = "*", $.appendChild(g), Y.appendChild($);
|
|
868
868
|
const s = document.createElement("input");
|
|
869
869
|
s.type = "text", s.maxLength = 2, s.placeholder = "AB", s.defaultValue = "YY", s.className = `${m} wgt:@max-2xl:w-full wgt:w-16`, s.title = l("customLettersTooltip"), Y.appendChild(s), r.append(Y), e && [
|
|
870
870
|
L,
|
|
@@ -1089,15 +1089,15 @@ function Zh() {
|
|
|
1089
1089
|
f.push('<th scope="col"><abbr title="' + X(g, s) + '">' + X(g, s, !0) + "</abbr></th>");
|
|
1090
1090
|
return "<thead><tr>" + (g.isRTL ? f.reverse() : f).join("") + "</tr></thead>";
|
|
1091
1091
|
}, K = function(g, s, f, v, J, y) {
|
|
1092
|
-
var D, F, U, Z = g._o, W = f === Z.minYear, G = f === Z.maxYear, O = '<div id="' + y + '" class="pika-title" role="heading" aria-live="assertive">',
|
|
1092
|
+
var D, F, U, Z = g._o, W = f === Z.minYear, G = f === Z.maxYear, O = '<div id="' + y + '" class="pika-title" role="heading" aria-live="assertive">', nn, cn, Jn = !0, In = !0;
|
|
1093
1093
|
for (U = [], D = 0; D < 12; D++)
|
|
1094
1094
|
U.push('<option value="' + (f === J ? D - s : 12 + D - s) + '"' + (D === v ? ' selected="selected"' : "") + (W && D < Z.minMonth || G && D > Z.maxMonth ? ' disabled="disabled"' : "") + ">" + Z.i18n.months[D] + "</option>");
|
|
1095
|
-
for (
|
|
1095
|
+
for (nn = '<div class="pika-label">' + Z.i18n.months[v] + '<select class="pika-select pika-select-month" tabindex="-1">' + U.join("") + "</select></div>", m(Z.yearRange) ? (D = Z.yearRange[0], F = Z.yearRange[1] + 1) : (D = f - Z.yearRange, F = 1 + f + Z.yearRange), U = []; D < F && D <= Z.maxYear; D++)
|
|
1096
1096
|
D >= Z.minYear && U.push('<option value="' + D + '"' + (D === f ? ' selected="selected"' : "") + ">" + D + "</option>");
|
|
1097
|
-
return
|
|
1097
|
+
return cn = '<div class="pika-label">' + f + Z.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + U.join("") + "</select></div>", Z.showMonthAfterYear ? O += cn + nn : O += nn + cn, W && (v === 0 || Z.minMonth >= v) && (Jn = !1), G && (v === 11 || Z.maxMonth <= v) && (In = !1), s === 0 && (O += '<button class="pika-prev' + (Jn ? "" : " is-disabled") + '" type="button">' + Z.i18n.previousMonth + "</button>"), s === g._o.numberOfMonths - 1 && (O += '<button class="pika-next' + (In ? "" : " is-disabled") + '" type="button">' + Z.i18n.nextMonth + "</button>"), O += "</div>";
|
|
1098
1098
|
}, Y = function(g, s, f) {
|
|
1099
1099
|
return '<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="' + f + '">' + B(g) + E(s) + "</table>";
|
|
1100
|
-
},
|
|
1100
|
+
}, $ = function(g) {
|
|
1101
1101
|
var s = this, f = s.config(g);
|
|
1102
1102
|
s._onMouseDown = function(J) {
|
|
1103
1103
|
if (s._v) {
|
|
@@ -1180,7 +1180,7 @@ function Zh() {
|
|
|
1180
1180
|
var v = f.defaultDate;
|
|
1181
1181
|
w(v) ? f.setDefaultDate ? s.setDate(v, !0) : s.gotoDate(v) : s.gotoDate(/* @__PURE__ */ new Date()), f.bound ? (this.hide(), s.el.className += " is-bound", u(f.trigger, "click", s._onInputClick), u(f.trigger, "focus", s._onInputFocus), u(f.trigger, "blur", s._onInputBlur)) : this.show();
|
|
1182
1182
|
};
|
|
1183
|
-
return
|
|
1183
|
+
return $.prototype = {
|
|
1184
1184
|
/**
|
|
1185
1185
|
* configure functionality
|
|
1186
1186
|
*/
|
|
@@ -1336,28 +1336,28 @@ function Zh() {
|
|
|
1336
1336
|
render: function(g, s, f) {
|
|
1337
1337
|
var v = this._o, J = /* @__PURE__ */ new Date(), y = L(g, s), D = new Date(g, s, 1).getDay(), F = [], U = [];
|
|
1338
1338
|
S(J), v.firstDay > 0 && (D -= v.firstDay, D < 0 && (D += 7));
|
|
1339
|
-
for (var Z = s === 0 ? 11 : s - 1, W = s === 11 ? 0 : s + 1, G = s === 0 ? g - 1 : g, O = s === 11 ? g + 1 : g,
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
for (var In = !1,
|
|
1343
|
-
var Hn = new Date(g, s, 1 + (
|
|
1344
|
-
et && (
|
|
1339
|
+
for (var Z = s === 0 ? 11 : s - 1, W = s === 11 ? 0 : s + 1, G = s === 0 ? g - 1 : g, O = s === 11 ? g + 1 : g, nn = L(G, Z), cn = y + D, Jn = cn; Jn > 7; )
|
|
1340
|
+
Jn -= 7;
|
|
1341
|
+
cn += 7 - Jn;
|
|
1342
|
+
for (var In = !1, Dn = 0, _n = 0; Dn < cn; Dn++) {
|
|
1343
|
+
var Hn = new Date(g, s, 1 + (Dn - D)), yn = w(this._d) ? p(Hn, this._d) : !1, $n = p(Hn, J), nt = v.events.indexOf(Hn.toDateString()) !== -1, et = Dn < D || Dn >= y + D, pn = 1 + (Dn - D), Fn = s, Rn = g, Kn = v.startRange && p(v.startRange, Hn), On = v.endRange && p(v.endRange, Hn), Gn = v.startRange && v.endRange && v.startRange < Hn && Hn < v.endRange, Zn = v.minDate && Hn < v.minDate || v.maxDate && Hn > v.maxDate || v.disableWeekends && x(Hn) || v.disableDayFn && v.disableDayFn(Hn);
|
|
1344
|
+
et && (Dn < D ? (pn = nn + pn, Fn = Z, Rn = G) : (pn = pn - y, Fn = W, Rn = O));
|
|
1345
1345
|
var At = {
|
|
1346
1346
|
day: pn,
|
|
1347
1347
|
month: Fn,
|
|
1348
1348
|
year: Rn,
|
|
1349
1349
|
hasEvent: nt,
|
|
1350
|
-
isSelected:
|
|
1350
|
+
isSelected: yn,
|
|
1351
1351
|
isToday: $n,
|
|
1352
1352
|
isDisabled: Zn,
|
|
1353
1353
|
isEmpty: et,
|
|
1354
|
-
isStartRange:
|
|
1355
|
-
isEndRange:
|
|
1354
|
+
isStartRange: Kn,
|
|
1355
|
+
isEndRange: On,
|
|
1356
1356
|
isInRange: Gn,
|
|
1357
1357
|
showDaysInNextAndPreviousMonths: v.showDaysInNextAndPreviousMonths,
|
|
1358
1358
|
enableSelectionDaysInNextAndPreviousMonths: v.enableSelectionDaysInNextAndPreviousMonths
|
|
1359
1359
|
};
|
|
1360
|
-
v.pickWholeWeek &&
|
|
1360
|
+
v.pickWholeWeek && yn && (In = !0), U.push(k(At)), ++_n === 7 && (v.showWeekNumber && U.unshift(Q(Dn - D, s, g, v.firstWeekOfYearMinDays)), F.push(I(U, v.isRTL, v.pickWholeWeek, In)), U = [], _n = 0, In = !1);
|
|
1361
1361
|
}
|
|
1362
1362
|
return Y(v, F, f);
|
|
1363
1363
|
},
|
|
@@ -1378,7 +1378,7 @@ function Zh() {
|
|
|
1378
1378
|
var g = this._o;
|
|
1379
1379
|
this.hide(), o(this.el, "mousedown", this._onMouseDown, !0), o(this.el, "touchend", this._onMouseDown, !0), o(this.el, "change", this._onChange), g.keyboardInput && o(c, "keydown", this._onKeyChange), g.field && (o(g.field, "change", this._onInputChange), g.bound && (o(g.trigger, "click", this._onInputClick), o(g.trigger, "focus", this._onInputFocus), o(g.trigger, "blur", this._onInputBlur))), this.el.parentNode && this.el.parentNode.removeChild(this.el);
|
|
1380
1380
|
}
|
|
1381
|
-
},
|
|
1381
|
+
}, $;
|
|
1382
1382
|
});
|
|
1383
1383
|
}(Dt)), Dt.exports;
|
|
1384
1384
|
}
|
|
@@ -1903,7 +1903,7 @@ const Ca = () => typeof window < "u" && typeof window.umami < "u", Qn = (n, t =
|
|
|
1903
1903
|
STEP3_PAYMENT_SUCCESS: "einv_payment_success",
|
|
1904
1904
|
STEP3_PAYMENT_FAILED: "einv_payment_failed",
|
|
1905
1905
|
STEP3_PAYMENT_WRONG_AMOUNT: "einv_payment_wrong_amount"
|
|
1906
|
-
},
|
|
1906
|
+
}, yt = {
|
|
1907
1907
|
success(n) {
|
|
1908
1908
|
Qn(Ln.STEP3_PAYMENT_SUCCESS, {
|
|
1909
1909
|
orderId: n.orderId,
|
|
@@ -1959,7 +1959,7 @@ const Ca = () => typeof window < "u" && typeof window.umami < "u", Qn = (n, t =
|
|
|
1959
1959
|
theme: n.theme
|
|
1960
1960
|
});
|
|
1961
1961
|
}
|
|
1962
|
-
},
|
|
1962
|
+
}, y0 = {
|
|
1963
1963
|
success(n) {
|
|
1964
1964
|
Qn(Ln.STEP3_QR_GENERATION_SUCCESS, {
|
|
1965
1965
|
orderId: n.orderId,
|
|
@@ -1982,7 +1982,7 @@ const Ca = () => typeof window < "u" && typeof window.umami < "u", Qn = (n, t =
|
|
|
1982
1982
|
retryCount: n.retryCount || 0
|
|
1983
1983
|
});
|
|
1984
1984
|
}
|
|
1985
|
-
},
|
|
1985
|
+
}, P0 = {
|
|
1986
1986
|
stopped(n) {
|
|
1987
1987
|
Qn(Ln.STEP3_POLLING_STOPPED, {
|
|
1988
1988
|
orderId: n.orderId,
|
|
@@ -2034,9 +2034,9 @@ async function Xa({
|
|
|
2034
2034
|
M.className = "wgt:text-sm wgt:leading-relaxed", M.style.color = "#FF8447", M.innerHTML = l("register_note", {
|
|
2035
2035
|
defaultValue: "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.",
|
|
2036
2036
|
provider: m
|
|
2037
|
-
}), x.appendChild(M),
|
|
2037
|
+
}), x.appendChild(M), yn && yn.firstChild && (yn.insertBefore(
|
|
2038
2038
|
x,
|
|
2039
|
-
|
|
2039
|
+
yn.firstChild
|
|
2040
2040
|
), setTimeout(() => {
|
|
2041
2041
|
x.style.opacity = "1";
|
|
2042
2042
|
}, 50));
|
|
@@ -2061,9 +2061,9 @@ async function Xa({
|
|
|
2061
2061
|
const M = fn();
|
|
2062
2062
|
typeof n == "function" && n(M);
|
|
2063
2063
|
}), d.appendChild(N);
|
|
2064
|
-
let H, C, X, k, b, Q, I, E, B, K, Y,
|
|
2065
|
-
const
|
|
2066
|
-
H =
|
|
2064
|
+
let H, C, X, k, b, Q, I, E, B, K, Y, $, g, s, f, v, J, y, D, F, U, Z, W, G, O, nn = t?.eInvoiceRegistration?.organization?.wardTaxAuthority || "";
|
|
2065
|
+
const cn = document.createElement("button");
|
|
2066
|
+
H = Mn({
|
|
2067
2067
|
name: "taxCode",
|
|
2068
2068
|
label: l("taxCode"),
|
|
2069
2069
|
required: !0,
|
|
@@ -2081,16 +2081,16 @@ async function Xa({
|
|
|
2081
2081
|
_ !== M && (V.target.value = _);
|
|
2082
2082
|
const gn = _.trim();
|
|
2083
2083
|
if (t._userHasEditedTaxCode = !0, S(), gn.length === 0) {
|
|
2084
|
-
H.setError(l("errorRequired", "Mã số thuế bắt buộc")),
|
|
2084
|
+
H.setError(l("errorRequired", "Mã số thuế bắt buộc")), un();
|
|
2085
2085
|
return;
|
|
2086
2086
|
}
|
|
2087
2087
|
if (!k0(gn)) {
|
|
2088
|
-
H.setError(l("errorInvalidTaxCode", "Mã số thuế không hợp lệ")),
|
|
2088
|
+
H.setError(l("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), un();
|
|
2089
2089
|
return;
|
|
2090
2090
|
}
|
|
2091
|
-
H.setError(null), Hn(gn),
|
|
2091
|
+
H.setError(null), Hn(gn), un();
|
|
2092
2092
|
}
|
|
2093
|
-
}), C =
|
|
2093
|
+
}), C = Mn({
|
|
2094
2094
|
name: "companyName",
|
|
2095
2095
|
label: l("companyName"),
|
|
2096
2096
|
required: !0,
|
|
@@ -2100,7 +2100,7 @@ async function Xa({
|
|
|
2100
2100
|
value: t?.eInvoiceRegistration?.organization?.name || "",
|
|
2101
2101
|
readOnly: !1,
|
|
2102
2102
|
horizontal: !0
|
|
2103
|
-
}), X =
|
|
2103
|
+
}), X = Mn({
|
|
2104
2104
|
name: "companyAddressDetail",
|
|
2105
2105
|
label: l("address"),
|
|
2106
2106
|
required: !0,
|
|
@@ -2111,8 +2111,8 @@ async function Xa({
|
|
|
2111
2111
|
readOnly: !1,
|
|
2112
2112
|
horizontal: !0
|
|
2113
2113
|
});
|
|
2114
|
-
const
|
|
2115
|
-
value:
|
|
2114
|
+
const Jn = _h.map((V) => ({
|
|
2115
|
+
value: V["cqt quản lý"],
|
|
2116
2116
|
label: V["tên cqt"],
|
|
2117
2117
|
id: V["ma xa"]
|
|
2118
2118
|
}));
|
|
@@ -2120,33 +2120,33 @@ async function Xa({
|
|
|
2120
2120
|
name: "companyTaxManagement",
|
|
2121
2121
|
label: l("taxAuthority"),
|
|
2122
2122
|
value: t?.eInvoiceRegistration?.organization?.taxAuthority || "",
|
|
2123
|
-
options:
|
|
2123
|
+
options: Jn,
|
|
2124
2124
|
required: !0,
|
|
2125
2125
|
error: null,
|
|
2126
2126
|
horizontal: !0,
|
|
2127
2127
|
searchable: !0,
|
|
2128
2128
|
onChange: (V) => {
|
|
2129
|
-
V.target.id && c(V.target.id),
|
|
2129
|
+
V.target.id && (c(V.target.id), nn = V.target.id), un();
|
|
2130
2130
|
}
|
|
2131
2131
|
}), h) {
|
|
2132
|
-
const V =
|
|
2132
|
+
const V = Jn.find(
|
|
2133
2133
|
(M) => M.id === h
|
|
2134
2134
|
);
|
|
2135
|
-
V && k.setValue && k.setValue(
|
|
2135
|
+
V && (k.setValue && k.setValue(
|
|
2136
2136
|
V.value,
|
|
2137
2137
|
V.label,
|
|
2138
2138
|
V.id
|
|
2139
|
-
);
|
|
2139
|
+
), nn = V.id);
|
|
2140
2140
|
}
|
|
2141
2141
|
Z = B0({
|
|
2142
2142
|
label: l("uploadLogo", "Tải logo lên"),
|
|
2143
2143
|
required: !1,
|
|
2144
2144
|
file: t?.logo || null,
|
|
2145
2145
|
onFileChange: (V) => {
|
|
2146
|
-
|
|
2146
|
+
un();
|
|
2147
2147
|
},
|
|
2148
2148
|
error: null
|
|
2149
|
-
}), B =
|
|
2149
|
+
}), B = Mn({
|
|
2150
2150
|
name: "repName",
|
|
2151
2151
|
label: l("fullName"),
|
|
2152
2152
|
required: !0,
|
|
@@ -2162,7 +2162,7 @@ async function Xa({
|
|
|
2162
2162
|
}
|
|
2163
2163
|
bt(M) ? B.setError(null) : B.setError(l("errorInvalidName"));
|
|
2164
2164
|
}
|
|
2165
|
-
}), K =
|
|
2165
|
+
}), K = Mn({
|
|
2166
2166
|
name: "repDob",
|
|
2167
2167
|
label: l("dateOfBirth"),
|
|
2168
2168
|
required: !0,
|
|
@@ -2180,10 +2180,10 @@ async function Xa({
|
|
|
2180
2180
|
return `${_}/${M}/${gn}`;
|
|
2181
2181
|
},
|
|
2182
2182
|
onSelect: (V) => {
|
|
2183
|
-
K.setError(null),
|
|
2183
|
+
K.setError(null), un();
|
|
2184
2184
|
},
|
|
2185
2185
|
onClose: () => {
|
|
2186
|
-
K.inputEl.value ? K.setError(null) : K.setError(l("errorRequired")),
|
|
2186
|
+
K.inputEl.value ? K.setError(null) : K.setError(l("errorRequired")), un();
|
|
2187
2187
|
},
|
|
2188
2188
|
maxDate: /* @__PURE__ */ new Date(),
|
|
2189
2189
|
showMonthDropdown: !0,
|
|
@@ -2204,7 +2204,7 @@ async function Xa({
|
|
|
2204
2204
|
onChange: (V) => {
|
|
2205
2205
|
V.target.value;
|
|
2206
2206
|
}
|
|
2207
|
-
}), g =
|
|
2207
|
+
}), g = Mn({
|
|
2208
2208
|
name: "repIdCardField",
|
|
2209
2209
|
label: l("idNumber"),
|
|
2210
2210
|
required: !0,
|
|
@@ -2223,7 +2223,7 @@ async function Xa({
|
|
|
2223
2223
|
l("errorInvalidIdCard", "Số CCCD phải có 12 chữ số")
|
|
2224
2224
|
);
|
|
2225
2225
|
}
|
|
2226
|
-
}), s =
|
|
2226
|
+
}), s = Mn({
|
|
2227
2227
|
name: "repPassportNumberField",
|
|
2228
2228
|
label: l("passport", "Hộ chiếu"),
|
|
2229
2229
|
required: !1,
|
|
@@ -2231,7 +2231,7 @@ async function Xa({
|
|
|
2231
2231
|
placeholder: l("enterPassport", "Nhập số hộ chiếu"),
|
|
2232
2232
|
type: "text",
|
|
2233
2233
|
value: t?.eInvoiceRegistration?.legalRepresentative?.passportNumber || ""
|
|
2234
|
-
}),
|
|
2234
|
+
}), $ = Mn({
|
|
2235
2235
|
name: "repPhone",
|
|
2236
2236
|
label: l("phone"),
|
|
2237
2237
|
required: !0,
|
|
@@ -2243,10 +2243,10 @@ async function Xa({
|
|
|
2243
2243
|
let M = V.target.value;
|
|
2244
2244
|
const _ = M.replace(/[^\d+().\-\s]/g, ""), gn = _.replace(/[\s.\-()]/g, "");
|
|
2245
2245
|
if (_ !== M && (V.target.value = _, M = _), gn.trim() === "") {
|
|
2246
|
-
|
|
2246
|
+
$.setError(l("errorRequired", "Số điện thoại bắt buộc"));
|
|
2247
2247
|
return;
|
|
2248
2248
|
}
|
|
2249
|
-
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(gn) ?
|
|
2249
|
+
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(gn) ? $.setError(null) : $.setError(
|
|
2250
2250
|
l("errorInvalidPhone", "Số điện thoại không hợp lệ.")
|
|
2251
2251
|
);
|
|
2252
2252
|
}
|
|
@@ -2260,7 +2260,7 @@ async function Xa({
|
|
|
2260
2260
|
onChange: (V) => {
|
|
2261
2261
|
V.target.value;
|
|
2262
2262
|
}
|
|
2263
|
-
}), v =
|
|
2263
|
+
}), v = Mn({
|
|
2264
2264
|
name: "contactAddressDetail",
|
|
2265
2265
|
label: l("permanentAddress"),
|
|
2266
2266
|
required: !0,
|
|
@@ -2286,11 +2286,11 @@ async function Xa({
|
|
|
2286
2286
|
required: !0,
|
|
2287
2287
|
file: t?.license || null,
|
|
2288
2288
|
onFileChange: (V) => {
|
|
2289
|
-
|
|
2289
|
+
un();
|
|
2290
2290
|
},
|
|
2291
2291
|
error: null,
|
|
2292
2292
|
accept: "image/png, image/jpeg, image/jpg, .pdf"
|
|
2293
|
-
}), b =
|
|
2293
|
+
}), b = Mn({
|
|
2294
2294
|
name: "name",
|
|
2295
2295
|
label: l("fullName"),
|
|
2296
2296
|
required: !0,
|
|
@@ -2308,7 +2308,7 @@ async function Xa({
|
|
|
2308
2308
|
l("errorInvalidName", "Họ và tên không hợp lệ.")
|
|
2309
2309
|
);
|
|
2310
2310
|
}
|
|
2311
|
-
}), Q =
|
|
2311
|
+
}), Q = Mn({
|
|
2312
2312
|
name: "email",
|
|
2313
2313
|
label: l("email"),
|
|
2314
2314
|
required: !0,
|
|
@@ -2339,7 +2339,7 @@ async function Xa({
|
|
|
2339
2339
|
l("errorInvalidEmail", "Email không hợp lệ")
|
|
2340
2340
|
);
|
|
2341
2341
|
}
|
|
2342
|
-
}), I =
|
|
2342
|
+
}), I = Mn({
|
|
2343
2343
|
name: "phone",
|
|
2344
2344
|
label: l("phone"),
|
|
2345
2345
|
required: !0,
|
|
@@ -2360,7 +2360,7 @@ async function Xa({
|
|
|
2360
2360
|
l("errorInvalidPhone", "Số điện thoại Việt Nam không hợp lệ.")
|
|
2361
2361
|
);
|
|
2362
2362
|
}
|
|
2363
|
-
}), E =
|
|
2363
|
+
}), E = Mn({
|
|
2364
2364
|
name: "contactAddressDetail",
|
|
2365
2365
|
label: l("permanentAddress"),
|
|
2366
2366
|
required: !0,
|
|
@@ -2382,7 +2382,7 @@ async function Xa({
|
|
|
2382
2382
|
) : E.setError(null);
|
|
2383
2383
|
}
|
|
2384
2384
|
});
|
|
2385
|
-
const
|
|
2385
|
+
const Dn = Mn({
|
|
2386
2386
|
name: "invoiceSymbol",
|
|
2387
2387
|
label: l("invoiceSymbol", "Ký hiệu hóa đơn"),
|
|
2388
2388
|
required: !0,
|
|
@@ -2398,13 +2398,13 @@ async function Xa({
|
|
|
2398
2398
|
isRenewal: r,
|
|
2399
2399
|
initialValue: T || t?.eInvoiceRegistration?.invoiceSymbol || "1C26MYY",
|
|
2400
2400
|
onChange: (V) => {
|
|
2401
|
-
|
|
2401
|
+
Dn.inputEl.value = V, un();
|
|
2402
2402
|
}
|
|
2403
2403
|
}), y = document.createElement("input"), y.type = "checkbox", y.name = "hasUsedEInvoiceCB", y.className = "wgt:cursor-pointer", y.checked = t?.eInvoiceRegistration?.hasUsedEInvoice, y.addEventListener("change", (V) => {
|
|
2404
|
-
V.target.checked ? (
|
|
2404
|
+
V.target.checked ? (sn.appendChild(j), sn.appendChild(on)) : (D.checked = !1, U.inputEl.value = "", U.setError(null), F && (F.inputEl.value = "", F.setError(null), on.contains(F.container) && on.removeChild(F.container)), sn.removeChild(j), sn.removeChild(on));
|
|
2405
2405
|
}), D = document.createElement("input"), D.type = "checkbox", D.name = "hasUsedEInvoiceBeforeCB", D.className = "wgt:cursor-pointer", D.checked = t?.eInvoiceRegistration?.isUsedEInvoiceBefore, D.addEventListener("change", (V) => {
|
|
2406
|
-
V.target.checked ?
|
|
2407
|
-
}), F =
|
|
2406
|
+
V.target.checked ? on.appendChild(F.container) : (F.inputEl.value = "", F.setError(null), on.contains(F.container) && on.removeChild(F.container));
|
|
2407
|
+
}), F = Mn({
|
|
2408
2408
|
name: "previousOtherProviderNameField",
|
|
2409
2409
|
label: l("providerName", "Tên NCC"),
|
|
2410
2410
|
required: !0,
|
|
@@ -2428,7 +2428,7 @@ async function Xa({
|
|
|
2428
2428
|
)
|
|
2429
2429
|
);
|
|
2430
2430
|
}
|
|
2431
|
-
}), U =
|
|
2431
|
+
}), U = Mn({
|
|
2432
2432
|
name: "previousIssuedByTaxCodeField",
|
|
2433
2433
|
label: l("taxAuthorityCode", "Mã CQT đã phát hành hóa đơn"),
|
|
2434
2434
|
required: !0,
|
|
@@ -2472,6 +2472,7 @@ async function Xa({
|
|
|
2472
2472
|
name: "",
|
|
2473
2473
|
address: "",
|
|
2474
2474
|
taxAuthority: "",
|
|
2475
|
+
wardTaxAuthority: "",
|
|
2475
2476
|
taxCode: V,
|
|
2476
2477
|
businessType: gn?.businessType
|
|
2477
2478
|
};
|
|
@@ -2485,22 +2486,22 @@ async function Xa({
|
|
|
2485
2486
|
/(phường|xã|quận|huyện|thị xã|thành phố|chi cục thuế|cục thuế|khu vực)\s+/gi,
|
|
2486
2487
|
""
|
|
2487
2488
|
).replace(/\s+/g, " ").trim() : "", kn = Sn(ln), Wn = Sn(_.dia_chi);
|
|
2488
|
-
let
|
|
2489
|
-
|
|
2489
|
+
let Vn = null, lt = -1;
|
|
2490
|
+
Jn.forEach((zn) => {
|
|
2490
2491
|
const gt = Sn(zn.label);
|
|
2491
2492
|
let Un = 0;
|
|
2492
|
-
|
|
2493
|
+
_.cqthue_ql && zn.id === _.cqthue_ql && (Un += 100), kn && (gt.includes(kn) || kn.includes(gt)) && (Un += 10);
|
|
2493
2494
|
const Xt = zn.label.split("-");
|
|
2494
2495
|
if (Xt.length > 0) {
|
|
2495
2496
|
const It = Sn(Xt[0]);
|
|
2496
2497
|
It && Wn.includes(It) && (Un += 5);
|
|
2497
2498
|
}
|
|
2498
|
-
Un > lt && (lt = Un,
|
|
2499
|
-
}),
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
), Tn.taxAuthority =
|
|
2499
|
+
Un > lt && (lt = Un, Vn = zn);
|
|
2500
|
+
}), Vn && lt > 0 && (k.setValue && k.setValue(
|
|
2501
|
+
Vn.value,
|
|
2502
|
+
Vn.label,
|
|
2503
|
+
Vn.id
|
|
2504
|
+
), nn = Vn.id || "", Tn.taxAuthority = Vn.value || "", Tn.wardTaxAuthority = Vn.id || "", k.setDisabled(!1));
|
|
2504
2505
|
} else
|
|
2505
2506
|
k.setValue && k.setValue("", "", ""), k.setDisabled(!1);
|
|
2506
2507
|
return Tn.name = _.ten_cty || "", Tn.address = _.dia_chi || "", Tn.taxCode = V, H.setError(null), Tn;
|
|
@@ -2517,17 +2518,17 @@ async function Xa({
|
|
|
2517
2518
|
l("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế.")
|
|
2518
2519
|
));
|
|
2519
2520
|
} finally {
|
|
2520
|
-
M === _n &&
|
|
2521
|
+
M === _n && un();
|
|
2521
2522
|
}
|
|
2522
2523
|
}
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2524
|
+
const yn = document.createElement("div");
|
|
2525
|
+
yn.className = "wgt:space-y-3";
|
|
2525
2526
|
const $n = document.createElement("h3");
|
|
2526
|
-
$n.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", $n.innerText = l("unitInfo", "1. Thông tin đơn vị"),
|
|
2527
|
+
$n.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", $n.innerText = l("unitInfo", "1. Thông tin đơn vị"), yn.appendChild($n), setTimeout(() => L(), 50);
|
|
2527
2528
|
const nt = document.createElement("div");
|
|
2528
|
-
nt.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",
|
|
2529
|
+
nt.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", yn.appendChild(nt), nt.appendChild(H.container), nt.appendChild(C.container), nt.appendChild(X.container), nt.appendChild(k.container);
|
|
2529
2530
|
const et = document.createElement("div");
|
|
2530
|
-
et.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4",
|
|
2531
|
+
et.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", yn.appendChild(et), et.appendChild(Z.container), N.appendChild(yn);
|
|
2531
2532
|
const pn = document.createElement("div");
|
|
2532
2533
|
pn.className = "wgt:space-y-4";
|
|
2533
2534
|
const Fn = document.createElement("h3");
|
|
@@ -2537,20 +2538,20 @@ async function Xa({
|
|
|
2537
2538
|
), pn.appendChild(Fn);
|
|
2538
2539
|
const Rn = document.createElement("div");
|
|
2539
2540
|
Rn.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4 wgt:space-y-2";
|
|
2540
|
-
let
|
|
2541
|
+
let Kn = !1, On = !1;
|
|
2541
2542
|
const Gn = document.createElement("div");
|
|
2542
2543
|
function Zn() {
|
|
2543
|
-
Gn.className = "wgt:text-yellow-500 wgt:text-sm wgt:font-medium wgt:text-center",
|
|
2544
|
+
Gn.className = "wgt:text-yellow-500 wgt:text-sm wgt:font-medium wgt:text-center", Kn ? Gn.innerText = l(
|
|
2544
2545
|
"warningIdCard",
|
|
2545
2546
|
"Vui lòng tải lên ảnh CMND/CCCD hợp lệ"
|
|
2546
|
-
) :
|
|
2547
|
+
) : On ? Gn.innerText = l(
|
|
2547
2548
|
"warningIdCardSuccess",
|
|
2548
2549
|
"Vui lòng kiểm tra thông tin trước khi chuyển sang bước tiếp theo"
|
|
2549
2550
|
) : Gn.innerText = "", Lt.appendChild(Gn);
|
|
2550
2551
|
}
|
|
2551
2552
|
function At(V) {
|
|
2552
2553
|
return new Promise((M) => {
|
|
2553
|
-
|
|
2554
|
+
Kn = !1, On = !1, Zn();
|
|
2554
2555
|
const _ = () => {
|
|
2555
2556
|
g.inputEl.value = "", B.inputEl.value = "", K.inputEl.value = "", v.inputEl.value = "", Y.selectEl.value = "", f.selectEl.value = "", g.setError(null), B.setError(null), K.setError(null), v.setError(null), Y.setError(null), f.setError(null), A && typeof A.setDate == "function" && A.setDate(null);
|
|
2556
2557
|
}, gn = (ln) => {
|
|
@@ -2559,25 +2560,25 @@ async function Xa({
|
|
|
2559
2560
|
const Un = ln.slice(0, 2), Xt = ln.slice(2, 4), It = ln.slice(4, 8);
|
|
2560
2561
|
return `${Un}/${Xt}/${It}`;
|
|
2561
2562
|
}
|
|
2562
|
-
const [Sn, kn, Wn] = ln.split("/"),
|
|
2563
|
-
if (isNaN(
|
|
2564
|
-
const lt = String(
|
|
2563
|
+
const [Sn, kn, Wn] = ln.split("/"), Vn = new Date(+Wn, +kn - 1, +Sn);
|
|
2564
|
+
if (isNaN(Vn)) return "";
|
|
2565
|
+
const lt = String(Vn.getDate()).padStart(2, "0"), zn = String(Vn.getMonth() + 1).padStart(2, "0"), gt = Vn.getFullYear();
|
|
2565
2566
|
return `${lt}/${zn}/${gt}`;
|
|
2566
2567
|
}, Tn = new Image();
|
|
2567
2568
|
Tn.src = URL.createObjectURL(V), Tn.onload = async () => {
|
|
2568
2569
|
try {
|
|
2569
2570
|
typeof w == "function" && await w();
|
|
2570
|
-
const ln = await fa(Tn).then((Sn) => JSON.parse(Sn).status !== "success" ? (
|
|
2571
|
+
const ln = await fa(Tn).then((Sn) => JSON.parse(Sn).status !== "success" ? (Kn = !0, On = !1, _(), Zn(), null) : JSON.parse(Sn).data);
|
|
2571
2572
|
if (ln || M({ success: !1, reason: "No data detected" }), ln) {
|
|
2572
|
-
|
|
2573
|
+
Kn = !1, On = !0, Zn();
|
|
2573
2574
|
const kn = Object.values(ln).every((Un) => !Un);
|
|
2574
2575
|
_(), kn && (qt(
|
|
2575
2576
|
l("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
2576
2577
|
), _(), M({ success: !1, reason: "Invalid card data" }));
|
|
2577
|
-
const { address: Wn, date_of_birth:
|
|
2578
|
+
const { address: Wn, date_of_birth: Vn, full_name: lt, id_number: zn, sex: gt } = ln;
|
|
2578
2579
|
if (!zn || !/^\d{12}$/.test(zn) ? (qt(
|
|
2579
2580
|
l("errorInvalidCard", "Số CCCD phải có 12 chữ số")
|
|
2580
|
-
), g.inputEl.value = "") : (g.inputEl.value = zn, g.setError(null)), B.inputEl.value = lt || "", K.inputEl.value = gn(
|
|
2581
|
+
), g.inputEl.value = "") : (g.inputEl.value = zn, g.setError(null)), B.inputEl.value = lt || "", K.inputEl.value = gn(Vn), v.inputEl.value = Wn || "", gt) {
|
|
2581
2582
|
const Un = E0.find(
|
|
2582
2583
|
(Xt) => Xt.label.toLowerCase() === gt.toLowerCase()
|
|
2583
2584
|
);
|
|
@@ -2588,7 +2589,7 @@ async function Xa({
|
|
|
2588
2589
|
} catch (ln) {
|
|
2589
2590
|
console.error("readIdentityCard failed", ln);
|
|
2590
2591
|
} finally {
|
|
2591
|
-
|
|
2592
|
+
un();
|
|
2592
2593
|
}
|
|
2593
2594
|
};
|
|
2594
2595
|
});
|
|
@@ -2622,30 +2623,30 @@ async function Xa({
|
|
|
2622
2623
|
backFile: t?.idCardBack,
|
|
2623
2624
|
onFrontChange: async (V) => {
|
|
2624
2625
|
if (G = V, !(await Qt(V, !0, !1)).success) {
|
|
2625
|
-
|
|
2626
|
+
Kn = !1, On = !1, Zn(), un();
|
|
2626
2627
|
return;
|
|
2627
2628
|
}
|
|
2628
2629
|
if (st()) {
|
|
2629
|
-
|
|
2630
|
+
Kn = !1, On = !1, Zn(), un();
|
|
2630
2631
|
return;
|
|
2631
2632
|
}
|
|
2632
2633
|
if (t?.eInvoiceRegistration?.legalRepresentative?.idCard) {
|
|
2633
|
-
|
|
2634
|
+
un();
|
|
2634
2635
|
return;
|
|
2635
2636
|
}
|
|
2636
2637
|
At(V);
|
|
2637
2638
|
},
|
|
2638
2639
|
onBackChange: async (V) => {
|
|
2639
2640
|
if (O = V, !(await Qt(V, !1, !0)).success) {
|
|
2640
|
-
|
|
2641
|
+
Kn = !1, On = !1, Zn(), un();
|
|
2641
2642
|
return;
|
|
2642
2643
|
}
|
|
2643
2644
|
if (Ht()) {
|
|
2644
|
-
|
|
2645
|
+
Kn = !1, On = !1, Zn(), un();
|
|
2645
2646
|
return;
|
|
2646
2647
|
}
|
|
2647
2648
|
if (t?.eInvoiceRegistration?.legalRepresentative?.idCard) {
|
|
2648
|
-
|
|
2649
|
+
un();
|
|
2649
2650
|
return;
|
|
2650
2651
|
}
|
|
2651
2652
|
const gn = Wt();
|
|
@@ -2659,7 +2660,7 @@ async function Xa({
|
|
|
2659
2660
|
const ct = document.createElement("div");
|
|
2660
2661
|
ct.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4", at.appendChild(ct), ct.appendChild(K.container), ct.appendChild(Y.container), Rn.appendChild(at);
|
|
2661
2662
|
const bn = document.createElement("div");
|
|
2662
|
-
bn.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-4 wgt:gap-4 wgt:items-start", bn.appendChild(g.container), bn.appendChild(s.container), bn.appendChild(
|
|
2663
|
+
bn.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-4 wgt:gap-4 wgt:items-start", bn.appendChild(g.container), bn.appendChild(s.container), bn.appendChild($.container), bn.appendChild(f.container), pn.appendChild(Rn), pn.appendChild(bn), pn.appendChild(v.container), pn.appendChild(W.container);
|
|
2663
2664
|
const ot = document.createElement("ul");
|
|
2664
2665
|
ot.className = "wgt:list-inside wgt:list-disc wgt:-mt-2";
|
|
2665
2666
|
const Ct = document.createElement("li");
|
|
@@ -2669,25 +2670,25 @@ async function Xa({
|
|
|
2669
2670
|
), ot.appendChild(Ct), pn.appendChild(ot), N.appendChild(pn);
|
|
2670
2671
|
const jn = document.createElement("div");
|
|
2671
2672
|
jn.className = "wgt:space-y-4";
|
|
2672
|
-
const
|
|
2673
|
-
|
|
2673
|
+
const Pn = document.createElement("h3");
|
|
2674
|
+
Pn.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", Pn.innerText = l("contactInfo", "3. Thông tin người liên hệ:"), jn.appendChild(Pn);
|
|
2674
2675
|
const z = document.createElement("div");
|
|
2675
2676
|
z.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4 wgt:items-start", z.appendChild(b.container), z.appendChild(Q.container), z.appendChild(I.container), z.appendChild(E.container), jn.appendChild(z), N.appendChild(jn);
|
|
2676
2677
|
const an = document.createElement("div");
|
|
2677
2678
|
an.className = "wgt:space-y-4";
|
|
2678
|
-
const
|
|
2679
|
-
|
|
2679
|
+
const mn = document.createElement("h3");
|
|
2680
|
+
mn.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", mn.innerText = l("invoiceUsageInfo", "4. THÔNG TIN SỬ DỤNG HDDT:"), an.appendChild(mn), N.appendChild(an);
|
|
2680
2681
|
const tn = document.createElement("div");
|
|
2681
|
-
tn.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-row wgt:@max-4xl:flex-col", tn.appendChild(J.container), tn.appendChild(
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2684
|
-
const
|
|
2685
|
-
|
|
2686
|
-
const
|
|
2687
|
-
|
|
2682
|
+
tn.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-row wgt:@max-4xl:flex-col", tn.appendChild(J.container), tn.appendChild(Dn.container), an.appendChild(tn);
|
|
2683
|
+
const sn = document.createElement("div");
|
|
2684
|
+
sn.className = "wgt:flex wgt:flex-col wgt:space-y-4 wgt:border wgt:border-soft-200 wgt:px-6 wgt:py-4 wgt:rounded-xl", r || N.appendChild(sn);
|
|
2685
|
+
const en = document.createElement("div");
|
|
2686
|
+
en.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", en.appendChild(y);
|
|
2687
|
+
const An = document.createElement("h4");
|
|
2688
|
+
An.className = "wgt:font-semibold wgt:italic", An.innerText = l(
|
|
2688
2689
|
"hasUsedEInvoice",
|
|
2689
2690
|
"Bạn đã sử dụng hoá đơn điện tử?"
|
|
2690
|
-
),
|
|
2691
|
+
), en.appendChild(An), r || sn.appendChild(en), y.checked = r, y.disabled = r;
|
|
2691
2692
|
const j = document.createElement("div");
|
|
2692
2693
|
if (j.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", !r) {
|
|
2693
2694
|
j.appendChild(D);
|
|
@@ -2697,8 +2698,8 @@ async function Xa({
|
|
|
2697
2698
|
provider: m
|
|
2698
2699
|
}), j.appendChild(V);
|
|
2699
2700
|
}
|
|
2700
|
-
const
|
|
2701
|
-
|
|
2701
|
+
const on = document.createElement("div");
|
|
2702
|
+
on.className = "wgt:w-full wgt:flex wgt:flex-row-reverse wgt:space-x-4 wgt:gap-4 wgt:items-start wgt:justify-start wgt:@max-2xl:flex-col wgt:@max-2xl:flex-col-reverse", on.appendChild(U.container);
|
|
2702
2703
|
const rn = document.createElement("div");
|
|
2703
2704
|
rn.className = "wgt:flex wgt:items-center wgt:space-x-2 wgt:mt-4";
|
|
2704
2705
|
let Cn = !0;
|
|
@@ -2737,10 +2738,10 @@ async function Xa({
|
|
|
2737
2738
|
En.appendChild(
|
|
2738
2739
|
xn(l("termsAndUsagePolicy", "Điều khoản và Chính sách sử dụng"))
|
|
2739
2740
|
), En.appendChild(document.createTextNode(` ${l("of", "của")} ${Xn}.`)), rn.appendChild(Nn), rn.appendChild(En), N.appendChild(rn), Nn.addEventListener("click", () => {
|
|
2740
|
-
Cn = !Cn, Cn ? (Nn.classList.add("wgt:bg-primary"), hn.classList.remove("wgt:hidden")) : (Nn.classList.remove("wgt:bg-primary"), hn.classList.add("wgt:hidden")),
|
|
2741
|
+
Cn = !Cn, Cn ? (Nn.classList.add("wgt:bg-primary"), hn.classList.remove("wgt:hidden")) : (Nn.classList.remove("wgt:bg-primary"), hn.classList.add("wgt:hidden")), un();
|
|
2741
2742
|
});
|
|
2742
2743
|
const dn = document.createElement("div");
|
|
2743
|
-
dn.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ",
|
|
2744
|
+
dn.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", cn.type = "submit", cn.innerText = l("next"), cn.className = [
|
|
2744
2745
|
"wgt:bg-primary",
|
|
2745
2746
|
"wgt:hover:bg-primary-dark",
|
|
2746
2747
|
"wgt:text-text-primary",
|
|
@@ -2751,7 +2752,7 @@ async function Xa({
|
|
|
2751
2752
|
"wgt:disabled:cursor-not-allowed",
|
|
2752
2753
|
"wgt:cursor-pointer",
|
|
2753
2754
|
"wgt:hover:text-primary-hover-text"
|
|
2754
|
-
].join(" "), dn.appendChild(
|
|
2755
|
+
].join(" "), dn.appendChild(cn), d.appendChild(dn);
|
|
2755
2756
|
function wn() {
|
|
2756
2757
|
const V = fn(), M = V.eInvoiceRegistration, _ = (M.organization.taxCode || "").trim();
|
|
2757
2758
|
if (!M.contactPerson.address || !M.organization.name || !M.organization.address || !_ || !M.organization.taxAuthority || !M.contactPerson.name || !M.contactPerson.email || !M.contactPerson.phone || !M.legalRepresentative.name || !M.legalRepresentative.dob || !M.legalRepresentative.gender || !M.legalRepresentative.phone || !M.legalRepresentative.idCard || !M.legalRepresentative.permanentAddress || !M.invoiceSymbol || !r && M.hasUsedEInvoice && !M.taxAuthorityCode || M.isUsedEInvoiceBefore && !M.previousEInvoiceProvider || !bt(M.contactPerson.name) || !bt(M.legalRepresentative.name) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(M.contactPerson.address) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(
|
|
@@ -2767,9 +2768,9 @@ async function Xa({
|
|
|
2767
2768
|
), kn = M.legalRepresentative.phone.replace(/[^\d+().\-\s]/g, "").replace(/[\s.\-()]/g, ""), Wn = /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/;
|
|
2768
2769
|
return !(!Wn.test(ln) || !Wn.test(kn) || !/^\d{12}$/.test(M.legalRepresentative.idCard) || !/^(?!\.)(?!.*\.\.)[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(M.contactPerson.email) || !/^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(M.invoiceSymbol) || !V.license || !V.idCard || !V.idCardBack);
|
|
2769
2770
|
}
|
|
2770
|
-
function
|
|
2771
|
+
function un() {
|
|
2771
2772
|
const V = e === "bvb" && !r && o === !1 && !t._userHasEditedTaxCode;
|
|
2772
|
-
|
|
2773
|
+
cn.disabled = !wn() || !Cn || Ht() || st() || Z.getError() || W.getError() || V;
|
|
2773
2774
|
}
|
|
2774
2775
|
function fn() {
|
|
2775
2776
|
return {
|
|
@@ -2780,7 +2781,8 @@ async function Xa({
|
|
|
2780
2781
|
name: C?.getValue(),
|
|
2781
2782
|
address: X?.getValue(),
|
|
2782
2783
|
taxCode: H?.getValue(),
|
|
2783
|
-
taxAuthority: k?.getValue()
|
|
2784
|
+
taxAuthority: k?.getValue(),
|
|
2785
|
+
wardTaxAuthority: nn
|
|
2784
2786
|
},
|
|
2785
2787
|
contactPerson: {
|
|
2786
2788
|
name: b?.getValue(),
|
|
@@ -2792,7 +2794,7 @@ async function Xa({
|
|
|
2792
2794
|
name: B?.getValue(),
|
|
2793
2795
|
dob: K?.getValue(),
|
|
2794
2796
|
gender: Y?.getValue(),
|
|
2795
|
-
phone:
|
|
2797
|
+
phone: $?.getValue(),
|
|
2796
2798
|
idCard: g?.getValue(),
|
|
2797
2799
|
passportNumber: s?.getValue(),
|
|
2798
2800
|
nationality: f?.getValue(),
|
|
@@ -2818,18 +2820,18 @@ async function Xa({
|
|
|
2818
2820
|
E,
|
|
2819
2821
|
B,
|
|
2820
2822
|
K,
|
|
2821
|
-
|
|
2823
|
+
$,
|
|
2822
2824
|
g,
|
|
2823
2825
|
v,
|
|
2824
2826
|
U,
|
|
2825
2827
|
F
|
|
2826
2828
|
].forEach((V) => {
|
|
2827
|
-
V.inputEl.addEventListener("input",
|
|
2829
|
+
V.inputEl.addEventListener("input", un);
|
|
2828
2830
|
}), [Y, k].forEach((V) => {
|
|
2829
|
-
V.selectEl.addEventListener("change",
|
|
2831
|
+
V.selectEl.addEventListener("change", un);
|
|
2830
2832
|
}), [y, D].forEach((V) => {
|
|
2831
|
-
V.addEventListener("change",
|
|
2832
|
-
}),
|
|
2833
|
+
V.addEventListener("change", un);
|
|
2834
|
+
}), cn.addEventListener("click", async (V) => {
|
|
2833
2835
|
if (V.preventDefault(), !wn()) return;
|
|
2834
2836
|
const M = H.getValue().trim();
|
|
2835
2837
|
if (!k0(M)) {
|
|
@@ -2852,12 +2854,12 @@ async function Xa({
|
|
|
2852
2854
|
}), n(fn());
|
|
2853
2855
|
return;
|
|
2854
2856
|
}
|
|
2855
|
-
|
|
2857
|
+
cn.disabled = !0;
|
|
2856
2858
|
let _ = null, gn = !1;
|
|
2857
2859
|
try {
|
|
2858
2860
|
const Tn = t?.provider || "m-invoice";
|
|
2859
2861
|
console.log("Current theme:", e), console.log("Provider being used:", Tn);
|
|
2860
|
-
const ln = J?.getValue?.() ||
|
|
2862
|
+
const ln = J?.getValue?.() || Dn?.inputEl?.value || "", Sn = P(ln);
|
|
2861
2863
|
if (_ = (await Kt(Tn, M, Sn)).isNewCustomer, _)
|
|
2862
2864
|
S();
|
|
2863
2865
|
else {
|
|
@@ -2879,7 +2881,7 @@ async function Xa({
|
|
|
2879
2881
|
} catch (Tn) {
|
|
2880
2882
|
gn = !0, console.error("Error checking customer:", Tn);
|
|
2881
2883
|
} finally {
|
|
2882
|
-
|
|
2884
|
+
cn.disabled = !1, cn.innerText = l("next");
|
|
2883
2885
|
}
|
|
2884
2886
|
gn || _ === !1 || _ === !0 && (Qn(Ln.STEP1_COMPLETED, {
|
|
2885
2887
|
theme: e,
|
|
@@ -2888,8 +2890,8 @@ async function Xa({
|
|
|
2888
2890
|
taxCode: M
|
|
2889
2891
|
}), n(fn()));
|
|
2890
2892
|
});
|
|
2891
|
-
const
|
|
2892
|
-
return
|
|
2893
|
+
const Yn = (t?.eInvoiceRegistration?.organization?.taxCode || "").trim();
|
|
2894
|
+
return Yn.length >= 10 && Hn(Yn), t?.idCard && (G = t?.idCard), un(), {
|
|
2893
2895
|
container: d,
|
|
2894
2896
|
getValues: fn
|
|
2895
2897
|
};
|
|
@@ -3052,7 +3054,7 @@ function v0({
|
|
|
3052
3054
|
return;
|
|
3053
3055
|
}
|
|
3054
3056
|
P.forEach((B) => {
|
|
3055
|
-
const K = B._id === S, Y = L.includes(B.code), { container:
|
|
3057
|
+
const K = B._id === S, Y = L.includes(B.code), { container: $ } = Na({
|
|
3056
3058
|
pkg: B,
|
|
3057
3059
|
type: n,
|
|
3058
3060
|
isDiscounted: Y,
|
|
@@ -3063,7 +3065,7 @@ function v0({
|
|
|
3063
3065
|
A((c || u) && K ? "" : B._id);
|
|
3064
3066
|
}
|
|
3065
3067
|
});
|
|
3066
|
-
|
|
3068
|
+
$.classList.add("wgt:snap-start"), T.appendChild($);
|
|
3067
3069
|
}), requestAnimationFrame(() => {
|
|
3068
3070
|
d(), C();
|
|
3069
3071
|
});
|
|
@@ -3208,7 +3210,7 @@ function Ha({
|
|
|
3208
3210
|
"expiredDate"
|
|
3209
3211
|
)} ${n.expiredAt.split("T")[0]}`, A.appendChild(r), h.appendChild(c), h.appendChild(A), { container: h };
|
|
3210
3212
|
}
|
|
3211
|
-
function
|
|
3213
|
+
function ya({
|
|
3212
3214
|
value: n = "",
|
|
3213
3215
|
placeholder: t = "",
|
|
3214
3216
|
onInputChange: e = void 0
|
|
@@ -3220,7 +3222,7 @@ function Pa({
|
|
|
3220
3222
|
const A = document.createElement("input");
|
|
3221
3223
|
return A.type = "text", A.inputMode = "numeric", A.value = n, A.placeholder = a, A.className = "wgt:flex-1 wgt:px-4 wgt:py-2 wgt:text-text-sub-600 wgt:placeholder-gray-400 wgt:bg-white wgt:focus:outline-none", typeof e == "function" && A.addEventListener("input", e), c.appendChild(A), { container: h };
|
|
3222
3224
|
}
|
|
3223
|
-
function
|
|
3225
|
+
function Pa({
|
|
3224
3226
|
theme: n,
|
|
3225
3227
|
debounceTimer: t,
|
|
3226
3228
|
typedUnits: e,
|
|
@@ -3254,7 +3256,7 @@ function ya({
|
|
|
3254
3256
|
}
|
|
3255
3257
|
}, 500) : (A = c, a && a());
|
|
3256
3258
|
}
|
|
3257
|
-
const r =
|
|
3259
|
+
const r = ya({
|
|
3258
3260
|
value: "",
|
|
3259
3261
|
placeholder: l("searchUnits"),
|
|
3260
3262
|
onInputChange: (p) => {
|
|
@@ -3408,7 +3410,7 @@ async function Ia({
|
|
|
3408
3410
|
isRenewal: N
|
|
3409
3411
|
}) {
|
|
3410
3412
|
const H = w?.eInvoiceRegistration?.invoiceSymbol || "", C = H?.[4] === "M";
|
|
3411
|
-
let X = [], k = "", b = a ? a._id : null, Q = h ? h._id : null, I = m ? m.map((z) => z) : [], E = [], B = [], K = [], Y = [],
|
|
3413
|
+
let X = [], k = "", b = a ? a._id : null, Q = h ? h._id : null, I = m ? m.map((z) => z) : [], E = [], B = [], K = [], Y = [], $ = null, g = p?.qtyRegFee || 1, s = p?.qtyInvoicePkg || 1, f = p?.qtySignaturePkg || 1;
|
|
3412
3414
|
function v() {
|
|
3413
3415
|
d && d({
|
|
3414
3416
|
qtyRegFee: g,
|
|
@@ -3435,26 +3437,26 @@ async function Ia({
|
|
|
3435
3437
|
const {
|
|
3436
3438
|
container: G,
|
|
3437
3439
|
invoiceSelectorWrapper: O,
|
|
3438
|
-
setInvoicePackages:
|
|
3439
|
-
getInvoicePackages:
|
|
3440
|
-
getFilteredInvoiceOptions:
|
|
3440
|
+
setInvoicePackages: nn,
|
|
3441
|
+
getInvoicePackages: cn,
|
|
3442
|
+
getFilteredInvoiceOptions: Jn,
|
|
3441
3443
|
setFilteredInvoiceOptions: In,
|
|
3442
|
-
findInvoiceById:
|
|
3444
|
+
findInvoiceById: Dn,
|
|
3443
3445
|
removeLoading: _n
|
|
3444
|
-
} =
|
|
3446
|
+
} = Pa({
|
|
3445
3447
|
theme: T,
|
|
3446
|
-
debounceTimer:
|
|
3448
|
+
debounceTimer: $,
|
|
3447
3449
|
typedUnits: k,
|
|
3448
3450
|
onSearchComplete: () => {
|
|
3449
|
-
qt(),
|
|
3451
|
+
qt(), Pn();
|
|
3450
3452
|
},
|
|
3451
3453
|
selectedProvider: r
|
|
3452
3454
|
});
|
|
3453
3455
|
W.appendChild(G);
|
|
3454
|
-
let Hn = null,
|
|
3456
|
+
let Hn = null, yn = null;
|
|
3455
3457
|
if (!N) {
|
|
3456
3458
|
const z = ka(N);
|
|
3457
|
-
|
|
3459
|
+
yn = z.container, Hn = z.signatureSelectorWrapper, W.appendChild(yn);
|
|
3458
3460
|
}
|
|
3459
3461
|
const $n = document.createElement("div");
|
|
3460
3462
|
$n.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-4", $n.innerHTML = `
|
|
@@ -3467,44 +3469,44 @@ async function Ia({
|
|
|
3467
3469
|
Fn.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";
|
|
3468
3470
|
const Rn = document.createElement("span");
|
|
3469
3471
|
Rn.className = "wgt:text-lg wgt:font-bold wgt:text-strong-950", Rn.innerText = l("total"), Fn.appendChild(Rn);
|
|
3470
|
-
const
|
|
3471
|
-
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3472
|
+
const Kn = document.createElement("span");
|
|
3473
|
+
Kn.className = "wgt:text-xl wgt:font-bold wgt:text-primary", Kn.innerText = "0 VND", Fn.appendChild(Kn);
|
|
3474
|
+
const On = document.createElement("div");
|
|
3475
|
+
On.className = "wgt:flex wgt:justify-between wgt:gap-2", D.appendChild(On);
|
|
3474
3476
|
const Gn = document.createElement("button");
|
|
3475
|
-
Gn.type = "button", Gn.innerText = l("back"), Gn.className = "wgt:bg-transparent wgt:text-primary wgt:hover:text-primary-dark wgt:hover:bg-transparent wgt:underline", Gn.addEventListener("click", t),
|
|
3476
|
-
const Zn = async (z, an,
|
|
3477
|
+
Gn.type = "button", Gn.innerText = l("back"), Gn.className = "wgt:bg-transparent wgt:text-primary wgt:hover:text-primary-dark wgt:hover:bg-transparent wgt:underline", Gn.addEventListener("click", t), On.appendChild(Gn);
|
|
3478
|
+
const Zn = async (z, an, mn, tn) => {
|
|
3477
3479
|
U();
|
|
3478
|
-
const { isUsedEInvoiceBefore:
|
|
3479
|
-
let
|
|
3480
|
+
const { isUsedEInvoiceBefore: sn, ...en } = w.eInvoiceRegistration;
|
|
3481
|
+
let An = [
|
|
3480
3482
|
{
|
|
3481
3483
|
code: an.code,
|
|
3482
3484
|
quantity: an.quantity,
|
|
3483
3485
|
isCashRegister: C
|
|
3484
3486
|
}
|
|
3485
3487
|
];
|
|
3486
|
-
|
|
3487
|
-
code:
|
|
3488
|
-
quantity:
|
|
3488
|
+
mn && An.push({
|
|
3489
|
+
code: mn.code,
|
|
3490
|
+
quantity: mn.quantity,
|
|
3489
3491
|
isCashRegister: C
|
|
3490
|
-
}), z &&
|
|
3492
|
+
}), z && An.push({
|
|
3491
3493
|
code: z.code,
|
|
3492
3494
|
quantity: z.quantity,
|
|
3493
3495
|
isCashRegister: C
|
|
3494
3496
|
}), tn.length > 0 && tn.forEach((j) => {
|
|
3495
|
-
const
|
|
3496
|
-
|
|
3497
|
-
|
|
3497
|
+
const on = K[j];
|
|
3498
|
+
on.reward.packageCodes.length > 0 && on.reward.packageCodes.forEach((rn) => {
|
|
3499
|
+
An.push({
|
|
3498
3500
|
code: rn,
|
|
3499
3501
|
quantity: 1,
|
|
3500
3502
|
isCashRegister: C
|
|
3501
3503
|
});
|
|
3502
3504
|
});
|
|
3503
|
-
}), P(
|
|
3505
|
+
}), P(An), L(tn);
|
|
3504
3506
|
try {
|
|
3505
3507
|
const j = await Lh({
|
|
3506
3508
|
eInvoiceRegistration: {
|
|
3507
|
-
...
|
|
3509
|
+
...en
|
|
3508
3510
|
},
|
|
3509
3511
|
bank: w.bank,
|
|
3510
3512
|
provider: r.route,
|
|
@@ -3514,12 +3516,12 @@ async function Ia({
|
|
|
3514
3516
|
w.idCard,
|
|
3515
3517
|
w.idCardBack
|
|
3516
3518
|
],
|
|
3517
|
-
packages:
|
|
3519
|
+
packages: An,
|
|
3518
3520
|
promotionCodes: tn,
|
|
3519
3521
|
isRenew: N,
|
|
3520
3522
|
isCashRegister: C
|
|
3521
|
-
}),
|
|
3522
|
-
o(
|
|
3523
|
+
}), on = j.orderId, rn = j.amount || 0;
|
|
3524
|
+
o(on), q ? q(rn) : console.warn("setOrderAmount is not defined!"), await new Promise((Cn) => setTimeout(Cn, 100)), Z(), n();
|
|
3523
3525
|
} catch {
|
|
3524
3526
|
Mt(l("errorCreatingOrder") || "Failed to create order"), Z();
|
|
3525
3527
|
return;
|
|
@@ -3529,34 +3531,34 @@ async function Ia({
|
|
|
3529
3531
|
title: l("next"),
|
|
3530
3532
|
className: "wgt:text-text-primary wgt:bg-primary",
|
|
3531
3533
|
handleClick: async () => {
|
|
3532
|
-
const z =
|
|
3533
|
-
(
|
|
3534
|
+
const z = cn().find(
|
|
3535
|
+
(en) => en._id === b
|
|
3534
3536
|
), an = E.find(
|
|
3535
|
-
(
|
|
3537
|
+
(en) => en._id === Q
|
|
3536
3538
|
);
|
|
3537
|
-
let
|
|
3538
|
-
!N && !z?.withoutInitialFee ? (
|
|
3539
|
+
let mn = null;
|
|
3540
|
+
!N && !z?.withoutInitialFee ? (mn = {
|
|
3539
3541
|
...B[0],
|
|
3540
3542
|
quantity: g
|
|
3541
|
-
}, c(
|
|
3542
|
-
let tn = { ...z, quantity: s },
|
|
3543
|
-
if (!N && r?.route === "m-invoice" && !
|
|
3543
|
+
}, c(mn)) : c(null);
|
|
3544
|
+
let tn = { ...z, quantity: s }, sn = an ? { ...an, quantity: f } : null;
|
|
3545
|
+
if (!N && r?.route === "m-invoice" && !sn) {
|
|
3544
3546
|
dt.error(l("errorSignatureRequired") || "Vui lòng chọn chứng thư số");
|
|
3545
3547
|
return;
|
|
3546
3548
|
}
|
|
3547
|
-
A(tn), u(
|
|
3549
|
+
A(tn), u(sn), x(I), v(), d && d({
|
|
3548
3550
|
qtyRegFee: g,
|
|
3549
3551
|
qtyInvoicePkg: s,
|
|
3550
3552
|
qtySignaturePkg: f
|
|
3551
3553
|
}), await Zn(
|
|
3552
|
-
on,
|
|
3553
|
-
tn,
|
|
3554
3554
|
mn,
|
|
3555
|
+
tn,
|
|
3556
|
+
sn,
|
|
3555
3557
|
I
|
|
3556
3558
|
);
|
|
3557
3559
|
}
|
|
3558
3560
|
});
|
|
3559
|
-
|
|
3561
|
+
On.appendChild(At);
|
|
3560
3562
|
async function Qt() {
|
|
3561
3563
|
w?.eInvoiceRegistration?.businessType;
|
|
3562
3564
|
const z = "ENTERPRISE", an = {
|
|
@@ -3568,10 +3570,10 @@ async function Ia({
|
|
|
3568
3570
|
};
|
|
3569
3571
|
try {
|
|
3570
3572
|
const [
|
|
3571
|
-
on,
|
|
3572
|
-
tn,
|
|
3573
3573
|
mn,
|
|
3574
|
-
|
|
3574
|
+
tn,
|
|
3575
|
+
sn,
|
|
3576
|
+
en
|
|
3575
3577
|
] = await Promise.allSettled([
|
|
3576
3578
|
Ih({
|
|
3577
3579
|
isRenewable: N === !0,
|
|
@@ -3590,53 +3592,53 @@ async function Ia({
|
|
|
3590
3592
|
tn.reason
|
|
3591
3593
|
), dt.error(
|
|
3592
3594
|
l("errorLoadingInitPackages") || "Failed to load registration packages"
|
|
3593
|
-
), B = []),
|
|
3594
|
-
|
|
3595
|
-
id:
|
|
3596
|
-
name:
|
|
3597
|
-
nameEn:
|
|
3598
|
-
appliedPackages:
|
|
3599
|
-
code:
|
|
3600
|
-
limit:
|
|
3601
|
-
used:
|
|
3602
|
-
bank:
|
|
3603
|
-
isActive:
|
|
3604
|
-
type:
|
|
3605
|
-
expiredAt:
|
|
3595
|
+
), B = []), mn.status === "fulfilled" ? (mn?.value?.length > 0 && mn.value.forEach((An) => {
|
|
3596
|
+
An.codes.length > 0 && (K[An.codes[0].code] = {
|
|
3597
|
+
id: An.id,
|
|
3598
|
+
name: An.name,
|
|
3599
|
+
nameEn: An.nameEn,
|
|
3600
|
+
appliedPackages: An.condition.packageCodes,
|
|
3601
|
+
code: An.codes[0].code,
|
|
3602
|
+
limit: An.codes[0].limit,
|
|
3603
|
+
used: An.codes[0].used,
|
|
3604
|
+
bank: An.campaign.bank,
|
|
3605
|
+
isActive: An.isActive,
|
|
3606
|
+
type: An.type,
|
|
3607
|
+
expiredAt: An.toDate,
|
|
3606
3608
|
// isDisabled: false,
|
|
3607
3609
|
isHidden: !1,
|
|
3608
|
-
reward:
|
|
3610
|
+
reward: An.reward
|
|
3609
3611
|
});
|
|
3610
|
-
}), Object.keys(K).length > 0 && (I = m ? [...m] : [], Ct())) : console.error("Failed to load promotions:",
|
|
3611
|
-
X = (N ?
|
|
3612
|
+
}), Object.keys(K).length > 0 && (I = m ? [...m] : [], Ct())) : console.error("Failed to load promotions:", mn.reason), sn.status === "fulfilled") {
|
|
3613
|
+
X = (N ? sn.value.filter((on) => on.renewPrice !== 0) : sn.value) || [];
|
|
3612
3614
|
const j = X || [];
|
|
3613
|
-
if (
|
|
3614
|
-
const
|
|
3615
|
-
a && j.find((Cn) => Cn._id === a._id) ? b = a._id :
|
|
3615
|
+
if (nn(j), In(j), sn.value.length > 0) {
|
|
3616
|
+
const on = J(j);
|
|
3617
|
+
a && j.find((Cn) => Cn._id === a._id) ? b = a._id : on ? b = on._id : b = j?.[0]._id, In(j);
|
|
3616
3618
|
}
|
|
3617
3619
|
_n();
|
|
3618
3620
|
} else
|
|
3619
3621
|
console.error(
|
|
3620
3622
|
"Failed to load invoice packages:",
|
|
3621
|
-
|
|
3623
|
+
sn.reason
|
|
3622
3624
|
), dt.error(
|
|
3623
3625
|
l("errorLoadingInvoicePackages") || "Failed to load invoice packages"
|
|
3624
|
-
),
|
|
3625
|
-
if (
|
|
3626
|
-
if (E =
|
|
3627
|
-
const
|
|
3626
|
+
), nn([]), X = [], _n();
|
|
3627
|
+
if (en.status === "fulfilled")
|
|
3628
|
+
if (E = en.value || [], E.length > 0) {
|
|
3629
|
+
const An = E.find(
|
|
3628
3630
|
(j) => Y.includes(j.code)
|
|
3629
3631
|
);
|
|
3630
3632
|
N ? Q = h && E.find(
|
|
3631
|
-
(
|
|
3633
|
+
(on) => on._id === h._id
|
|
3632
3634
|
) ? h._id : null : Q = h && E.find(
|
|
3633
|
-
(
|
|
3634
|
-
) ? h._id :
|
|
3635
|
+
(on) => on._id === h._id
|
|
3636
|
+
) ? h._id : An ? An._id : r?.route === "m-invoice" ? E?.[0]?._id : null;
|
|
3635
3637
|
} else
|
|
3636
3638
|
E = [];
|
|
3637
3639
|
Lt();
|
|
3638
|
-
} catch (
|
|
3639
|
-
console.error("Unexpected error during data loading:",
|
|
3640
|
+
} catch (mn) {
|
|
3641
|
+
console.error("Unexpected error during data loading:", mn), dt.error(l("errorLoadingData") || "Failed to load data", {
|
|
3640
3642
|
autoClose: 5e3,
|
|
3641
3643
|
closeButton: !0,
|
|
3642
3644
|
icon: !0
|
|
@@ -3644,45 +3646,45 @@ async function Ia({
|
|
|
3644
3646
|
}
|
|
3645
3647
|
}
|
|
3646
3648
|
function Lt() {
|
|
3647
|
-
ot(), qt(), N || Wt(), ct(), jn(),
|
|
3649
|
+
ot(), qt(), N || Wt(), ct(), jn(), Pn();
|
|
3648
3650
|
}
|
|
3649
|
-
function Ht(z, an,
|
|
3651
|
+
function Ht(z, an, mn) {
|
|
3650
3652
|
const tn = Object.values(K).find(
|
|
3651
3653
|
(j) => j.bank === T && j.appliedPackages.includes(z)
|
|
3652
|
-
),
|
|
3654
|
+
), sn = Y.includes(z) || tn && !tn.isHidden && !(tn.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && tn.limit !== tn.used, en = Object.values(K).find(
|
|
3653
3655
|
(j) => j.bank === T && j.appliedPackages.includes(an)
|
|
3654
|
-
),
|
|
3655
|
-
if (
|
|
3656
|
-
const { container: j, open:
|
|
3656
|
+
), An = Y.includes(an) || en && !en.isHidden && !(en.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && en.limit !== en.used && en.isActive;
|
|
3657
|
+
if (sn && !An) {
|
|
3658
|
+
const { container: j, open: on } = Nt({
|
|
3657
3659
|
message: l("errorDiscountPackage"),
|
|
3658
3660
|
description: l("errorDiscountPackageDes"),
|
|
3659
3661
|
okLabel: l("ok"),
|
|
3660
3662
|
cancelLabel: l("cancel"),
|
|
3661
|
-
onClose:
|
|
3663
|
+
onClose: mn,
|
|
3662
3664
|
isWarning: !0,
|
|
3663
3665
|
isSuccess: !1,
|
|
3664
3666
|
theme: T
|
|
3665
3667
|
});
|
|
3666
|
-
D.appendChild(j),
|
|
3668
|
+
D.appendChild(j), on();
|
|
3667
3669
|
} else
|
|
3668
|
-
|
|
3670
|
+
mn();
|
|
3669
3671
|
}
|
|
3670
3672
|
let st = null;
|
|
3671
3673
|
function qt() {
|
|
3672
|
-
if (O.innerHTML = "",
|
|
3674
|
+
if (O.innerHTML = "", Jn().length > 0)
|
|
3673
3675
|
st = v0({
|
|
3674
3676
|
type: "service",
|
|
3675
|
-
packageOptions:
|
|
3677
|
+
packageOptions: Jn(),
|
|
3676
3678
|
disCountedPackages: Y,
|
|
3677
3679
|
promotion: l("discount"),
|
|
3678
3680
|
selectedPackageId: b,
|
|
3679
3681
|
isRenew: N,
|
|
3680
3682
|
handlePackageSelect: (z) => {
|
|
3681
|
-
let an =
|
|
3683
|
+
let an = cn().find(
|
|
3682
3684
|
(tn) => tn._id === b
|
|
3683
|
-
)?.code,
|
|
3684
|
-
Ht(an,
|
|
3685
|
-
b = z, st.setSelectedPackageId(z), ot(), ct(), jn(),
|
|
3685
|
+
)?.code, mn = cn().find((tn) => tn._id === z)?.code;
|
|
3686
|
+
Ht(an, mn, () => {
|
|
3687
|
+
b = z, st.setSelectedPackageId(z), ot(), ct(), jn(), Pn();
|
|
3686
3688
|
});
|
|
3687
3689
|
}
|
|
3688
3690
|
}), O.appendChild(st.container);
|
|
@@ -3703,22 +3705,22 @@ async function Ia({
|
|
|
3703
3705
|
handlePackageSelect: (z) => {
|
|
3704
3706
|
let an = E.find(
|
|
3705
3707
|
(tn) => tn._id === Q
|
|
3706
|
-
)?.code,
|
|
3708
|
+
)?.code, mn = E.find((tn) => tn._id === z)?.code;
|
|
3707
3709
|
if (N && Q === z) {
|
|
3708
|
-
Q = null, ut.setSelectedPackageId(null), ot(), ct(), jn(),
|
|
3710
|
+
Q = null, ut.setSelectedPackageId(null), ot(), ct(), jn(), Pn();
|
|
3709
3711
|
return;
|
|
3710
3712
|
}
|
|
3711
|
-
Ht(an,
|
|
3712
|
-
Q = z, ut.setSelectedPackageId(z), In(
|
|
3713
|
+
Ht(an, mn, () => {
|
|
3714
|
+
Q = z, ut.setSelectedPackageId(z), In(cn()), ot(), ct(), jn(), Pn();
|
|
3713
3715
|
});
|
|
3714
3716
|
}
|
|
3715
|
-
}), Hn.appendChild(ut.container)) : (ut = null,
|
|
3717
|
+
}), Hn.appendChild(ut.container)) : (ut = null, yn && (yn.style.display = "none")));
|
|
3716
3718
|
}
|
|
3717
3719
|
const at = document.createElement("div");
|
|
3718
3720
|
at.className = "wgt:w-full", W.appendChild(at);
|
|
3719
3721
|
function ct() {
|
|
3720
3722
|
if ($n.remove(), at.innerHTML = "", N) return;
|
|
3721
|
-
const z =
|
|
3723
|
+
const z = cn().find(
|
|
3722
3724
|
(an) => an._id === b
|
|
3723
3725
|
);
|
|
3724
3726
|
if (B.length > 0) {
|
|
@@ -3738,24 +3740,24 @@ async function Ia({
|
|
|
3738
3740
|
const bn = document.createElement("div");
|
|
3739
3741
|
bn.className = "promotion-wrapper wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
3740
3742
|
function ot() {
|
|
3741
|
-
const z =
|
|
3742
|
-
(
|
|
3743
|
+
const z = cn().find(
|
|
3744
|
+
(sn) => sn._id === b
|
|
3743
3745
|
), an = E.find(
|
|
3744
|
-
(
|
|
3745
|
-
),
|
|
3746
|
-
z?.code && tn.push(z.code), an?.code && tn.push(an.code),
|
|
3747
|
-
const
|
|
3748
|
-
if (
|
|
3749
|
-
|
|
3750
|
-
(Nn) => Nn !==
|
|
3746
|
+
(sn) => sn._id === Q
|
|
3747
|
+
), mn = !N && B?.length > 0 && !z?.withoutInitialFee, tn = [];
|
|
3748
|
+
z?.code && tn.push(z.code), an?.code && tn.push(an.code), mn && tn.push("INITIAL_FEE"), Object.keys(K).forEach((sn) => {
|
|
3749
|
+
const en = K[sn];
|
|
3750
|
+
if (en.bank !== T) {
|
|
3751
|
+
en.isHidden = !0, I = I.filter(
|
|
3752
|
+
(Nn) => Nn !== en.code
|
|
3751
3753
|
);
|
|
3752
3754
|
return;
|
|
3753
3755
|
}
|
|
3754
|
-
const
|
|
3756
|
+
const An = en.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), j = en.limit <= en.used, on = !en.isActive, Cn = en.appliedPackages?.some(
|
|
3755
3757
|
(Nn) => tn.includes(Nn)
|
|
3756
|
-
) && !
|
|
3757
|
-
|
|
3758
|
-
(Nn) => Nn !==
|
|
3758
|
+
) && !An && !j && !on;
|
|
3759
|
+
en.isHidden = !Cn, Cn ? I.includes(en.code) || I.push(en.code) : I = I.filter(
|
|
3760
|
+
(Nn) => Nn !== en.code
|
|
3759
3761
|
);
|
|
3760
3762
|
}), Ct();
|
|
3761
3763
|
}
|
|
@@ -3778,24 +3780,24 @@ async function Ia({
|
|
|
3778
3780
|
bn.innerHTML = "";
|
|
3779
3781
|
const an = document.createElement("h3");
|
|
3780
3782
|
an.className = "wgt:text-xl wgt:font-bold wgt:text-strong-950", an.innerText = l("applyPromotion"), bn.appendChild(an), W.appendChild(bn);
|
|
3781
|
-
const
|
|
3782
|
-
|
|
3783
|
+
const mn = document.createElement("div");
|
|
3784
|
+
mn.className = "wgt:w-full wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3783
3785
|
const tn = document.createElement("div");
|
|
3784
|
-
tn.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",
|
|
3786
|
+
tn.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", mn.appendChild(tn), I && I.length > 0 && I.filter((on) => {
|
|
3785
3787
|
const rn = Object.values(K).find(
|
|
3786
|
-
(Cn) => Cn.code ===
|
|
3788
|
+
(Cn) => Cn.code === on
|
|
3787
3789
|
);
|
|
3788
3790
|
return rn && rn.bank === T;
|
|
3789
|
-
}).forEach((
|
|
3791
|
+
}).forEach((on) => {
|
|
3790
3792
|
const rn = document.createElement("div");
|
|
3791
|
-
rn.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", rn.innerText =
|
|
3793
|
+
rn.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", rn.innerText = on;
|
|
3792
3794
|
const Cn = wt({
|
|
3793
3795
|
type: "button",
|
|
3794
3796
|
title: "x",
|
|
3795
3797
|
handleClick: () => {
|
|
3796
3798
|
I = I.filter(
|
|
3797
|
-
(Nn) => Nn !==
|
|
3798
|
-
), jn(),
|
|
3799
|
+
(Nn) => Nn !== on
|
|
3800
|
+
), jn(), Pn();
|
|
3799
3801
|
}
|
|
3800
3802
|
});
|
|
3801
3803
|
Cn.className = "wgt:w-fit wgt:h-fit wgt:p-0 wgt:bg-transparent wgt:cursor-pointer", Cn.innerHTML = `<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -3804,21 +3806,21 @@ async function Ia({
|
|
|
3804
3806
|
</svg>
|
|
3805
3807
|
`, rn.appendChild(Cn), tn.appendChild(rn);
|
|
3806
3808
|
});
|
|
3807
|
-
const
|
|
3809
|
+
const sn = wt({
|
|
3808
3810
|
type: "button",
|
|
3809
3811
|
title: l("apply"),
|
|
3810
3812
|
className: "wgt:text-white wgt:bg-primary",
|
|
3811
3813
|
handleClick: () => {
|
|
3812
3814
|
}
|
|
3813
3815
|
});
|
|
3814
|
-
|
|
3815
|
-
const
|
|
3816
|
-
|
|
3817
|
-
const
|
|
3818
|
-
if (
|
|
3819
|
-
|
|
3816
|
+
mn.appendChild(sn), bn.appendChild(mn);
|
|
3817
|
+
const en = document.createElement("div");
|
|
3818
|
+
en.className = "wgt:w-full wgt:grid wgt:grid-cols-3 wgt:gap-4 wgt:@max-2xl:flex wgt:@max-2xl:flex-col", bn.appendChild(en);
|
|
3819
|
+
const An = Object.values(K).filter((j) => j.bank === T).filter((j) => !j.isHidden);
|
|
3820
|
+
if (An.length > 0)
|
|
3821
|
+
An.forEach((j) => {
|
|
3820
3822
|
I.includes(j.code);
|
|
3821
|
-
const { container:
|
|
3823
|
+
const { container: on } = Ha({
|
|
3822
3824
|
promotion: {
|
|
3823
3825
|
...j,
|
|
3824
3826
|
isSelected: I.includes(j.code)
|
|
@@ -3827,20 +3829,20 @@ async function Ia({
|
|
|
3827
3829
|
onSelect: (rn, Cn) => {
|
|
3828
3830
|
Cn ? I.includes(rn) || I.push(rn) : I = I.filter(
|
|
3829
3831
|
(Nn) => Nn !== rn
|
|
3830
|
-
), jn(),
|
|
3832
|
+
), jn(), Pn();
|
|
3831
3833
|
},
|
|
3832
3834
|
isHidden: !1,
|
|
3833
3835
|
isSelectable: !0
|
|
3834
3836
|
});
|
|
3835
|
-
|
|
3837
|
+
en.appendChild(on);
|
|
3836
3838
|
});
|
|
3837
3839
|
else {
|
|
3838
3840
|
const j = document.createElement("span");
|
|
3839
3841
|
j.className = "wgt:text-text-sub-600", j.innerText = l("noPromotionFound"), bn.appendChild(j);
|
|
3840
3842
|
}
|
|
3841
3843
|
}
|
|
3842
|
-
function
|
|
3843
|
-
if (v(), pn.innerHTML = "", W.appendChild(et), W.appendChild(Fn), W.appendChild(nt),
|
|
3844
|
+
function Pn() {
|
|
3845
|
+
if (v(), pn.innerHTML = "", W.appendChild(et), W.appendChild(Fn), W.appendChild(nt), cn().length === 0 && E.length === 0) {
|
|
3844
3846
|
const R = document.createElement("tr");
|
|
3845
3847
|
R.innerHTML = `
|
|
3846
3848
|
<td colspan="5" class="wgt:px-3 wgt:py-8 wgt:text-center wgt:text-text-sub-600 wgt:@max-2xl:col-span-5">
|
|
@@ -3849,7 +3851,7 @@ async function Ia({
|
|
|
3849
3851
|
`, pn.appendChild(R), i(0);
|
|
3850
3852
|
return;
|
|
3851
3853
|
}
|
|
3852
|
-
const z =
|
|
3854
|
+
const z = cn().find(
|
|
3853
3855
|
(R) => R._id === b
|
|
3854
3856
|
);
|
|
3855
3857
|
if (!N && B?.length > 0 && !z?.withoutInitialFee) {
|
|
@@ -3865,20 +3867,20 @@ async function Ia({
|
|
|
3865
3867
|
xn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
|
|
3866
3868
|
const Xn = document.createElement("button");
|
|
3867
3869
|
Xn.type = "button", Xn.ariaLabel = l("decrease"), Xn.disabled = !0, Xn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", Xn.innerText = "–", Xn.addEventListener("click", () => {
|
|
3868
|
-
g > 1 && (g -= 1,
|
|
3870
|
+
g > 1 && (g -= 1, Pn());
|
|
3869
3871
|
}), xn.appendChild(Xn);
|
|
3870
3872
|
const dn = document.createElement("span");
|
|
3871
3873
|
dn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", dn.innerText = g, xn.appendChild(dn);
|
|
3872
3874
|
const wn = document.createElement("button");
|
|
3873
3875
|
wn.type = "button", wn.ariaLabel = l("increase"), wn.disabled = !0, wn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", wn.innerText = "+", wn.addEventListener("click", () => {
|
|
3874
|
-
g += 1,
|
|
3876
|
+
g += 1, Pn();
|
|
3875
3877
|
}), xn.appendChild(wn), En.appendChild(xn), R.appendChild(En);
|
|
3876
|
-
const
|
|
3877
|
-
|
|
3878
|
+
const un = document.createElement("td");
|
|
3879
|
+
un.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", un.innerText = vn(B[0]?.price) + " VND", R.appendChild(un);
|
|
3878
3880
|
const fn = document.createElement("td");
|
|
3879
3881
|
fn.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", fn.innerText = vn(B[0]?.price * g) + " VND", R.appendChild(fn);
|
|
3880
|
-
const
|
|
3881
|
-
|
|
3882
|
+
const Yn = document.createElement("div");
|
|
3883
|
+
Yn.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", Yn.innerHTML = `
|
|
3882
3884
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
3883
3885
|
<span>${l("unitPrice")}:</span>
|
|
3884
3886
|
<span class="wgt:font-medium">${vn(
|
|
@@ -3891,10 +3893,10 @@ async function Ia({
|
|
|
3891
3893
|
B[0]?.price * g
|
|
3892
3894
|
)} VND</span>
|
|
3893
3895
|
</div>
|
|
3894
|
-
`, hn.appendChild(
|
|
3896
|
+
`, hn.appendChild(Yn), pn.appendChild(R);
|
|
3895
3897
|
}
|
|
3896
3898
|
{
|
|
3897
|
-
const R =
|
|
3899
|
+
const R = Dn(b);
|
|
3898
3900
|
if (R) {
|
|
3899
3901
|
const hn = document.createElement("tr");
|
|
3900
3902
|
hn.className = "wgt:@max-2xl:block wgt:@max-2xl:mb-4 wgt:@max-2xl:p-4 wgt:@max-2xl:bg-white wgt:@max-2xl:rounded-lg wgt:@max-2xl:border wgt:@max-2xl:border-soft-200 wgt:@max-2xl:shadow-sm";
|
|
@@ -3910,16 +3912,16 @@ async function Ia({
|
|
|
3910
3912
|
dn.type = "button", dn.ariaLabel = l("decrease");
|
|
3911
3913
|
const wn = S ? R?.price ?? 0 : R?.renewPrice ?? 0;
|
|
3912
3914
|
dn.disabled = s <= 1 || wn === 0, dn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", dn.innerText = "–", dn.addEventListener("click", () => {
|
|
3913
|
-
s > 1 && (s -= 1,
|
|
3915
|
+
s > 1 && (s -= 1, Pn());
|
|
3914
3916
|
}), Xn.appendChild(dn);
|
|
3915
|
-
const
|
|
3916
|
-
|
|
3917
|
+
const un = document.createElement("span");
|
|
3918
|
+
un.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", un.innerText = wn === 0 ? 1 : s, Xn.appendChild(un);
|
|
3917
3919
|
const fn = document.createElement("button");
|
|
3918
3920
|
fn.type = "button", fn.ariaLabel = l("increase"), fn.disabled = R?.price === 0, fn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", fn.innerText = "+", fn.addEventListener("click", () => {
|
|
3919
|
-
wn !== 0 && (s += 1,
|
|
3921
|
+
wn !== 0 && (s += 1, Pn());
|
|
3920
3922
|
}), Xn.appendChild(fn), xn.appendChild(Xn), hn.appendChild(xn);
|
|
3921
|
-
const
|
|
3922
|
-
|
|
3923
|
+
const Yn = document.createElement("td");
|
|
3924
|
+
Yn.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", Yn.innerText = vn(wn * R?.limit) + " VND", hn.appendChild(Yn);
|
|
3923
3925
|
const V = document.createElement("td");
|
|
3924
3926
|
V.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", V.innerText = vn(wn * R?.limit * s) + " VND", hn.appendChild(V);
|
|
3925
3927
|
const M = document.createElement("div");
|
|
@@ -3955,18 +3957,18 @@ async function Ia({
|
|
|
3955
3957
|
Xn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
|
|
3956
3958
|
const dn = document.createElement("button");
|
|
3957
3959
|
dn.type = "button", dn.ariaLabel = l("decrease"), dn.disabled = f <= 1, dn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold" + (f <= 1 ? " wgt:cursor-not-allowed wgt:opacity-50" : ""), dn.innerText = "–", dn.addEventListener("click", () => {
|
|
3958
|
-
f > 1 && (f -= 1,
|
|
3960
|
+
f > 1 && (f -= 1, Pn());
|
|
3959
3961
|
}), Xn.appendChild(dn);
|
|
3960
3962
|
const wn = document.createElement("span");
|
|
3961
3963
|
wn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", wn.innerText = f, Xn.appendChild(wn);
|
|
3962
|
-
const
|
|
3963
|
-
|
|
3964
|
-
f += 1,
|
|
3965
|
-
}), Xn.appendChild(
|
|
3964
|
+
const un = document.createElement("button");
|
|
3965
|
+
un.type = "button", un.ariaLabel = l("increase"), un.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", un.innerText = "+", un.addEventListener("click", () => {
|
|
3966
|
+
f += 1, Pn();
|
|
3967
|
+
}), Xn.appendChild(un), xn.appendChild(Xn), hn.appendChild(xn);
|
|
3966
3968
|
const fn = document.createElement("td");
|
|
3967
3969
|
fn.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", fn.innerText = vn(R?.limit * R?.price) + " VND", hn.appendChild(fn);
|
|
3968
|
-
const
|
|
3969
|
-
|
|
3970
|
+
const Yn = document.createElement("td");
|
|
3971
|
+
Yn.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", Yn.innerText = vn(R?.limit * R?.price * f) + " VND", hn.appendChild(Yn);
|
|
3970
3972
|
const V = document.createElement("div");
|
|
3971
3973
|
V.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", V.innerHTML = `
|
|
3972
3974
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
@@ -3989,7 +3991,7 @@ async function Ia({
|
|
|
3989
3991
|
(hn) => hn.code === R && hn.bank === T
|
|
3990
3992
|
)
|
|
3991
3993
|
).filter((R) => R !== void 0);
|
|
3992
|
-
let
|
|
3994
|
+
let mn = 0;
|
|
3993
3995
|
an.length > 0 && an.forEach((R) => {
|
|
3994
3996
|
const hn = document.createElement("tr");
|
|
3995
3997
|
hn.className = "wgt:@max-2xl:block wgt:@max-2xl:mb-3 wgt:@max-2xl:p-3 wgt:@max-2xl:bg-weak-50 wgt:@max-2xl:rounded-lg wgt:@max-2xl:border wgt:@max-2xl:border-soft-200";
|
|
@@ -4005,11 +4007,11 @@ async function Ia({
|
|
|
4005
4007
|
const xn = document.createElement("td");
|
|
4006
4008
|
xn.className = "wgt:px-3 wgt:py-2 wgt:text-sm wgt:font-semibold wgt:@max-2xl:text-base wgt:@max-2xl:font-bold wgt:@max-2xl:p-0", R.type === "discount" ? (xn.innerText = `-${vn(
|
|
4007
4009
|
R?.reward?.discountAmount
|
|
4008
|
-
)} VND`, xn.style.color = "#F04438",
|
|
4010
|
+
)} VND`, xn.style.color = "#F04438", mn += R?.reward?.discountAmount) : R?.type === "free_item" ? (xn.innerText = `+${R?.reward?.packageCodes?.length} ${l(
|
|
4009
4011
|
"package"
|
|
4010
4012
|
)} ${R?.reward?.packageCodes?.join(", ")}`, xn.style.color = "#12B76A") : xn.innerText = "", hn.appendChild(xn), pn.appendChild(hn);
|
|
4011
4013
|
});
|
|
4012
|
-
const tn = !N && B.length > 0 && !z?.withoutInitialFee ? B[0]?.price * g : 0,
|
|
4014
|
+
const tn = !N && B.length > 0 && !z?.withoutInitialFee ? B[0]?.price * g : 0, sn = Dn(b), en = sn ? N ? sn.renewPrice ?? 0 : sn.price ?? 0 : 0, An = sn ? en * sn.limit * s : 0, j = y(Q), on = j ? j.price * j.limit * f : 0, rn = tn + An + on, Cn = Math.min(mn, rn), Nn = Math.max(rn - Cn, 0);
|
|
4013
4015
|
i(Nn);
|
|
4014
4016
|
{
|
|
4015
4017
|
const R = document.createElement("tr");
|
|
@@ -4019,7 +4021,7 @@ async function Ia({
|
|
|
4019
4021
|
const qn = document.createElement("td");
|
|
4020
4022
|
qn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", qn.innerText = vn(Nn) + " VND", R.appendChild(qn), pn.appendChild(R);
|
|
4021
4023
|
}
|
|
4022
|
-
|
|
4024
|
+
Kn.innerText = vn(Nn) + " VND";
|
|
4023
4025
|
}
|
|
4024
4026
|
return Qt(), { container: D };
|
|
4025
4027
|
}
|
|
@@ -4080,8 +4082,8 @@ function ba({
|
|
|
4080
4082
|
K.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
|
|
4081
4083
|
const Y = document.createElement("span");
|
|
4082
4084
|
Y.className = "wgt:text-white wgt:text-sm wgt:font-semibold", Y.innerText = String(I + 1), K.appendChild(Y), B.appendChild(K);
|
|
4083
|
-
const
|
|
4084
|
-
|
|
4085
|
+
const $ = document.createElement("p");
|
|
4086
|
+
$.className = "wgt:ml-3 wgt:text-text-sub-600", $.innerText = Q, E.appendChild(B), E.appendChild($), X.appendChild(E);
|
|
4085
4087
|
}), H.appendChild(X), N.appendChild(H);
|
|
4086
4088
|
const k = document.createElement("div");
|
|
4087
4089
|
k.className = "wgt:h-[300px] wgt:flex wgt:justify-center";
|
|
@@ -4103,8 +4105,8 @@ function ba({
|
|
|
4103
4105
|
K.className = "wgt:flex-shrink-0 wgt:mt-0.5";
|
|
4104
4106
|
const Y = document.createElement("div");
|
|
4105
4107
|
Y.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
|
|
4106
|
-
const
|
|
4107
|
-
|
|
4108
|
+
const $ = document.createElement("span");
|
|
4109
|
+
$.className = "wgt:text-white wgt:text-sm wgt:font-semibold", $.innerText = String(E + 1), Y.appendChild($), K.appendChild(Y);
|
|
4108
4110
|
const g = document.createElement("p");
|
|
4109
4111
|
g.className = "wgt:ml-3 wgt:text-text-sub-600", g.innerText = I, B.appendChild(K), B.appendChild(g), X.appendChild(B);
|
|
4110
4112
|
})), Q.illustrationSrc != null && (b.src = Q.illustrationSrc);
|
|
@@ -4151,8 +4153,8 @@ function Ja({
|
|
|
4151
4153
|
const q = ((O) => {
|
|
4152
4154
|
if (typeof O == "number") return O;
|
|
4153
4155
|
if (!O) return 0;
|
|
4154
|
-
const
|
|
4155
|
-
return parseFloat(
|
|
4156
|
+
const nn = String(O).replace(/[^0-9.-]+/g, "");
|
|
4157
|
+
return parseFloat(nn) || 0;
|
|
4156
4158
|
})(h) === 0, T = document.createElement("div");
|
|
4157
4159
|
T.className = [
|
|
4158
4160
|
q ? "wgt:w-[540px]" : "wgt:w-[440px]",
|
|
@@ -4170,8 +4172,8 @@ function Ja({
|
|
|
4170
4172
|
const x = document.createElement("p");
|
|
4171
4173
|
x.className = "wgt:text-base wgt:font-medium wgt:leading-6 wgt:text-primary";
|
|
4172
4174
|
const P = (O) => {
|
|
4173
|
-
const
|
|
4174
|
-
return `${
|
|
4175
|
+
const nn = Math.floor(O / 60).toString().padStart(2, "0"), cn = (O % 60).toString().padStart(2, "0");
|
|
4176
|
+
return `${nn}:${cn}`;
|
|
4175
4177
|
}, L = () => {
|
|
4176
4178
|
x.innerHTML = `${l(
|
|
4177
4179
|
"completePaymentIn"
|
|
@@ -4206,21 +4208,21 @@ function Ja({
|
|
|
4206
4208
|
if (I.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", I.innerText = t?.code ? String(t.code) : "", b.appendChild(Q), b.appendChild(I), N.appendChild(b), !o) {
|
|
4207
4209
|
const O = document.createElement("div");
|
|
4208
4210
|
O.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4209
|
-
const
|
|
4210
|
-
|
|
4211
|
-
const
|
|
4212
|
-
|
|
4211
|
+
const nn = document.createElement("h4");
|
|
4212
|
+
nn.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", nn.innerText = l("digitalSignaturePackage");
|
|
4213
|
+
const cn = document.createElement("span");
|
|
4214
|
+
cn.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", cn.innerText = e?.code ? String(e.code) : l("notUsed", "Không sử dụng"), O.appendChild(nn), O.appendChild(cn), N.appendChild(O);
|
|
4213
4215
|
}
|
|
4214
4216
|
if (c && c.length > 0) {
|
|
4215
4217
|
const O = document.createElement("div");
|
|
4216
4218
|
O.className = "wgt:w-full wgt:flex wgt:items-start wgt:justify-between wgt:gap-[0.5rem]";
|
|
4217
|
-
const
|
|
4218
|
-
|
|
4219
|
-
const
|
|
4220
|
-
|
|
4219
|
+
const nn = document.createElement("h4");
|
|
4220
|
+
nn.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", nn.innerText = l("promotion");
|
|
4221
|
+
const cn = document.createElement("div");
|
|
4222
|
+
cn.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", c.forEach((Jn) => {
|
|
4221
4223
|
const In = document.createElement("div");
|
|
4222
|
-
In.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", In.innerText =
|
|
4223
|
-
}), O.appendChild(
|
|
4224
|
+
In.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", In.innerText = Jn, cn.appendChild(In);
|
|
4225
|
+
}), O.appendChild(nn), O.appendChild(cn), N.appendChild(O);
|
|
4224
4226
|
}
|
|
4225
4227
|
const E = document.createElement("hr");
|
|
4226
4228
|
N.appendChild(E);
|
|
@@ -4230,8 +4232,8 @@ function Ja({
|
|
|
4230
4232
|
K.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", K.innerText = l("paymentAmount");
|
|
4231
4233
|
const Y = document.createElement("span");
|
|
4232
4234
|
Y.className = "wgt:text-2xl wgt:font-bold wgt:leading-6 wgt:text-[#ED1C24]", Y.innerText = typeof h == "number" ? h.toLocaleString("vi-VN") + " VND" : h, B.appendChild(K), B.appendChild(Y), N.appendChild(B);
|
|
4233
|
-
const
|
|
4234
|
-
|
|
4235
|
+
const $ = document.createElement("div");
|
|
4236
|
+
$.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2 wgt:p-4 wgt:rounded-lg wgt:mt-8", $.style.backgroundColor = "#47c2ff29";
|
|
4235
4237
|
const g = document.createElement("div");
|
|
4236
4238
|
g.className = "wgt:flex wgt:items-start wgt:gap-2";
|
|
4237
4239
|
const s = document.createElement("img");
|
|
@@ -4240,7 +4242,7 @@ function Ja({
|
|
|
4240
4242
|
f.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#344054]", f.innerText = l(
|
|
4241
4243
|
"check_transaction",
|
|
4242
4244
|
"Vui lòng kiểm tra giao dịch trước khi thanh toán để đảm bảo giao dịch được thực hiện chính xác"
|
|
4243
|
-
), g.appendChild(s), g.appendChild(f),
|
|
4245
|
+
), g.appendChild(s), g.appendChild(f), $.appendChild(g);
|
|
4244
4246
|
const v = document.createElement("div");
|
|
4245
4247
|
v.className = "wgt:flex wgt:items-start wgt:gap-2";
|
|
4246
4248
|
const J = document.createElement("img");
|
|
@@ -4249,7 +4251,7 @@ function Ja({
|
|
|
4249
4251
|
if (y.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#344054]", y.innerHTML = l(
|
|
4250
4252
|
"contact_info",
|
|
4251
4253
|
'Thông tin liên hệ: <a href="mailto:hotro247@atomsolution.vn" class="wgt:font-semibold wgt:underline">hotro247@atomsolution.vn</a>'
|
|
4252
|
-
), v.appendChild(J), v.appendChild(y),
|
|
4254
|
+
), v.appendChild(J), v.appendChild(y), $.appendChild(v), N.appendChild($), q) {
|
|
4253
4255
|
const O = document.createElement("p");
|
|
4254
4256
|
O.className = "wgt:text-sm wgt:italic wgt:text-[#335CFF] wgt:mt-6 wgt:text-center", O.textContent = l("freeOrderDescription") || "Bạn không cần thanh toán cho đơn hàng này", N.appendChild(O);
|
|
4255
4257
|
}
|
|
@@ -4274,7 +4276,7 @@ function Ja({
|
|
|
4274
4276
|
/bg-primary|bg-\[\#0066cc\]/g,
|
|
4275
4277
|
"bg-green-500"
|
|
4276
4278
|
), W.textContent = l("confirmed") || "Đã xác nhận";
|
|
4277
|
-
const
|
|
4279
|
+
const nn = Nt({
|
|
4278
4280
|
message: l("freeOrderSuccess") || "Thông tin đăng ký đã được ghi nhận thành công!",
|
|
4279
4281
|
okLabel: l("next") || "Tiếp tục",
|
|
4280
4282
|
theme: "bvb",
|
|
@@ -4284,15 +4286,15 @@ function Ja({
|
|
|
4284
4286
|
clearInterval(m), u(), Z();
|
|
4285
4287
|
}
|
|
4286
4288
|
});
|
|
4287
|
-
T.appendChild(
|
|
4289
|
+
T.appendChild(nn.container), nn.open();
|
|
4288
4290
|
} catch {
|
|
4289
4291
|
W.disabled = !1, W.textContent = O;
|
|
4290
|
-
const
|
|
4292
|
+
const cn = Nt({
|
|
4291
4293
|
message: "Xác nhận đơn hàng thất bại. Vui lòng thử lại.",
|
|
4292
4294
|
okLabel: "OK",
|
|
4293
4295
|
isSuccess: !1
|
|
4294
4296
|
});
|
|
4295
|
-
T.appendChild(
|
|
4297
|
+
T.appendChild(cn.container), cn.open(), Z();
|
|
4296
4298
|
}
|
|
4297
4299
|
} : () => {
|
|
4298
4300
|
m && clearInterval(m);
|
|
@@ -4333,28 +4335,28 @@ function Ja({
|
|
|
4333
4335
|
},
|
|
4334
4336
|
setTotalAmountText(O) {
|
|
4335
4337
|
h = O;
|
|
4336
|
-
const
|
|
4337
|
-
|
|
4338
|
+
const nn = T.querySelector(".wgt:text-2xl.wgt:font-bold");
|
|
4339
|
+
nn && (nn.innerText = typeof O == "number" ? O.toLocaleString("vi-VN") + " VND" : O);
|
|
4338
4340
|
},
|
|
4339
4341
|
setSelectedProvider(O) {
|
|
4340
4342
|
n = O;
|
|
4341
|
-
const
|
|
4342
|
-
|
|
4343
|
+
const nn = T.querySelector("img");
|
|
4344
|
+
nn && O?.logoUrl && (nn.src = O.logoUrl, nn.alt = O.name || "");
|
|
4343
4345
|
},
|
|
4344
4346
|
setSelectedInvoicePackage(O) {
|
|
4345
4347
|
t = O;
|
|
4346
|
-
const
|
|
4348
|
+
const nn = T.querySelectorAll(
|
|
4347
4349
|
".wgt:text-base.wgt:font-semibold.wgt:leading-6.wgt:text-text-black"
|
|
4348
4350
|
)[0];
|
|
4349
|
-
|
|
4351
|
+
nn && (nn.innerText = O?.code ? String(O.code) : "");
|
|
4350
4352
|
},
|
|
4351
4353
|
setSelectedSignaturePackage(O) {
|
|
4352
4354
|
if (o) return;
|
|
4353
4355
|
e = O;
|
|
4354
|
-
const
|
|
4356
|
+
const nn = T.querySelectorAll(
|
|
4355
4357
|
".wgt:text-base.wgt:font-semibold.wgt:leading-6.wgt:text-text-black"
|
|
4356
4358
|
);
|
|
4357
|
-
|
|
4359
|
+
nn[1] && (nn[1].innerText = O?.code ? String(O.code) : l("notUsed", "Không sử dụng"));
|
|
4358
4360
|
}
|
|
4359
4361
|
};
|
|
4360
4362
|
}
|
|
@@ -5009,9 +5011,9 @@ function xh() {
|
|
|
5009
5011
|
}
|
|
5010
5012
|
}, Vt;
|
|
5011
5013
|
}
|
|
5012
|
-
var a0 = {},
|
|
5014
|
+
var a0 = {}, Pt = {}, K0;
|
|
5013
5015
|
function za() {
|
|
5014
|
-
if (K0) return
|
|
5016
|
+
if (K0) return Pt;
|
|
5015
5017
|
K0 = 1;
|
|
5016
5018
|
const n = new Uint8Array(512), t = new Uint8Array(256);
|
|
5017
5019
|
return function() {
|
|
@@ -5020,14 +5022,14 @@ function za() {
|
|
|
5020
5022
|
n[h] = a, t[a] = h, a <<= 1, a & 256 && (a ^= 285);
|
|
5021
5023
|
for (let h = 255; h < 512; h++)
|
|
5022
5024
|
n[h] = n[h - 255];
|
|
5023
|
-
}(),
|
|
5025
|
+
}(), Pt.log = function(a) {
|
|
5024
5026
|
if (a < 1) throw new Error("log(" + a + ")");
|
|
5025
5027
|
return t[a];
|
|
5026
|
-
},
|
|
5028
|
+
}, Pt.exp = function(a) {
|
|
5027
5029
|
return n[a];
|
|
5028
|
-
},
|
|
5030
|
+
}, Pt.mul = function(a, h) {
|
|
5029
5031
|
return a === 0 || h === 0 ? 0 : n[t[a] + t[h]];
|
|
5030
|
-
},
|
|
5032
|
+
}, Pt;
|
|
5031
5033
|
}
|
|
5032
5034
|
var O0;
|
|
5033
5035
|
function Fa() {
|
|
@@ -5664,13 +5666,13 @@ function ac() {
|
|
|
5664
5666
|
return d(k, H, C);
|
|
5665
5667
|
}
|
|
5666
5668
|
function d(H, C, X) {
|
|
5667
|
-
const k = n.getSymbolTotalCodewords(C), b = u.getTotalCodewordsCount(C, X), Q = k - b, I = u.getBlocksCount(C, X), E = k % I, B = I - E, K = Math.floor(k / I), Y = Math.floor(Q / I),
|
|
5669
|
+
const k = n.getSymbolTotalCodewords(C), b = u.getTotalCodewordsCount(C, X), Q = k - b, I = u.getBlocksCount(C, X), E = k % I, B = I - E, K = Math.floor(k / I), Y = Math.floor(Q / I), $ = Y + 1, g = K - Y, s = new o(g);
|
|
5668
5670
|
let f = 0;
|
|
5669
5671
|
const v = new Array(I), J = new Array(I);
|
|
5670
5672
|
let y = 0;
|
|
5671
5673
|
const D = new Uint8Array(H.buffer);
|
|
5672
5674
|
for (let G = 0; G < I; G++) {
|
|
5673
|
-
const O = G < B ? Y :
|
|
5675
|
+
const O = G < B ? Y : $;
|
|
5674
5676
|
v[G] = D.slice(f, f + O), J[G] = s.encode(v[G]), f += O, y = Math.max(y, O);
|
|
5675
5677
|
}
|
|
5676
5678
|
const F = new Uint8Array(k);
|
|
@@ -6139,7 +6141,7 @@ async function gc({
|
|
|
6139
6141
|
},
|
|
6140
6142
|
onFreeOrderConfirmed: () => {
|
|
6141
6143
|
try {
|
|
6142
|
-
|
|
6144
|
+
yt.freeOrderConfirmed({
|
|
6143
6145
|
orderId: q,
|
|
6144
6146
|
totalAmount: w,
|
|
6145
6147
|
orderAmount: w,
|
|
@@ -6181,7 +6183,7 @@ async function gc({
|
|
|
6181
6183
|
isFreeOrder: m
|
|
6182
6184
|
}), t && (clearInterval(i), i = null, t());
|
|
6183
6185
|
}), K.appendChild(Y), N.appendChild(K);
|
|
6184
|
-
async function
|
|
6186
|
+
async function $() {
|
|
6185
6187
|
const f = h?.totalAmountText || 0;
|
|
6186
6188
|
if (w = vt(f), m = w === 0, Qn(Ln.STEP3_VIEWED, {
|
|
6187
6189
|
orderId: q,
|
|
@@ -6190,7 +6192,7 @@ async function gc({
|
|
|
6190
6192
|
theme: A
|
|
6191
6193
|
}), m)
|
|
6192
6194
|
try {
|
|
6193
|
-
|
|
6195
|
+
yt.freeOrderDetected({
|
|
6194
6196
|
orderId: q,
|
|
6195
6197
|
totalAmount: w,
|
|
6196
6198
|
orderAmount: w,
|
|
@@ -6220,7 +6222,7 @@ async function gc({
|
|
|
6220
6222
|
margin: 1,
|
|
6221
6223
|
width: 200,
|
|
6222
6224
|
color: { dark: "#000000", light: "#ffffff" }
|
|
6223
|
-
}),
|
|
6225
|
+
}), y0.success({
|
|
6224
6226
|
orderId: f ?? h?.orderId,
|
|
6225
6227
|
amount: w,
|
|
6226
6228
|
qrUrl: "dataurl",
|
|
@@ -6236,7 +6238,7 @@ async function gc({
|
|
|
6236
6238
|
}), s();
|
|
6237
6239
|
} catch (v) {
|
|
6238
6240
|
if (v.response?.data?.error_code === "BILL_ID_EXISTED") {
|
|
6239
|
-
if (r++,
|
|
6241
|
+
if (r++, y0.failed({
|
|
6240
6242
|
orderId: f ?? h?.orderId,
|
|
6241
6243
|
amount: w,
|
|
6242
6244
|
errorCode: "BILL_ID_EXISTED",
|
|
@@ -6274,7 +6276,7 @@ async function gc({
|
|
|
6274
6276
|
const f = await Jh(q);
|
|
6275
6277
|
if (f.paymentStatus === "pending") return;
|
|
6276
6278
|
if (f.paymentStatus === "wrong_amount") {
|
|
6277
|
-
clearInterval(i), i = null,
|
|
6279
|
+
clearInterval(i), i = null, yt.wrongAmount({
|
|
6278
6280
|
orderId: q,
|
|
6279
6281
|
expectedAmount: w,
|
|
6280
6282
|
receivedAmount: f?.receivedAmount ?? f?.amount ?? null,
|
|
@@ -6282,7 +6284,7 @@ async function gc({
|
|
|
6282
6284
|
paymentMethod: P,
|
|
6283
6285
|
provider: x,
|
|
6284
6286
|
theme: A
|
|
6285
|
-
}),
|
|
6287
|
+
}), P0.stopped({
|
|
6286
6288
|
orderId: q,
|
|
6287
6289
|
reason: "wrong_amount",
|
|
6288
6290
|
duration: p ? Math.round((Date.now() - p) / 1e3) : null,
|
|
@@ -6298,7 +6300,7 @@ async function gc({
|
|
|
6298
6300
|
}
|
|
6299
6301
|
clearInterval(i), i = null;
|
|
6300
6302
|
const v = S ? Math.round((Date.now() - S) / 1e3) : null;
|
|
6301
|
-
f.paymentStatus === "paid" ?
|
|
6303
|
+
f.paymentStatus === "paid" ? yt.success({
|
|
6302
6304
|
orderId: q,
|
|
6303
6305
|
amount: w,
|
|
6304
6306
|
transactionId: f?.transactionId || f?.transaction_id,
|
|
@@ -6306,7 +6308,7 @@ async function gc({
|
|
|
6306
6308
|
provider: x,
|
|
6307
6309
|
theme: A,
|
|
6308
6310
|
duration: v
|
|
6309
|
-
}) :
|
|
6311
|
+
}) : yt.failed({
|
|
6310
6312
|
orderId: q,
|
|
6311
6313
|
amount: w,
|
|
6312
6314
|
errorCode: f?.errorCode || f?.error_code,
|
|
@@ -6315,7 +6317,7 @@ async function gc({
|
|
|
6315
6317
|
provider: x,
|
|
6316
6318
|
theme: A,
|
|
6317
6319
|
failureReason: f.paymentStatus
|
|
6318
|
-
}),
|
|
6320
|
+
}), P0.stopped({
|
|
6319
6321
|
orderId: q,
|
|
6320
6322
|
reason: f.paymentStatus,
|
|
6321
6323
|
duration: p ? Math.round((Date.now() - p) / 1e3) : null,
|
|
@@ -6337,7 +6339,7 @@ async function gc({
|
|
|
6337
6339
|
}
|
|
6338
6340
|
}, 5e3));
|
|
6339
6341
|
}
|
|
6340
|
-
return await
|
|
6342
|
+
return await $(), window.addEventListener("beforeunload", () => {
|
|
6341
6343
|
i && clearInterval(i);
|
|
6342
6344
|
}), { container: N };
|
|
6343
6345
|
}
|
|
@@ -6454,8 +6456,8 @@ function rc({
|
|
|
6454
6456
|
<path d="M3.55534 9.25979C3.21016 9.26076 2.87232 9.35944 2.58089 9.5444C2.28945 9.72937 2.05634 9.99306 1.90853 10.305C1.76071 10.6169 1.70422 10.9643 1.74561 11.307C1.78699 11.6497 1.92455 11.9736 2.14238 12.2414L6.78584 17.9296C6.9514 18.1352 7.16362 18.2983 7.40488 18.4054C7.64614 18.5125 7.90947 18.5605 8.17299 18.5454C8.73661 18.5151 9.24545 18.2136 9.56988 17.7179L19.2155 2.18356C19.2171 2.18099 19.2188 2.17841 19.2205 2.17587C19.311 2.03691 19.2816 1.76152 19.0948 1.58852C19.0435 1.54102 18.983 1.50452 18.917 1.48127C18.8511 1.45803 18.7811 1.44854 18.7113 1.45338C18.6415 1.45822 18.5735 1.47729 18.5114 1.50941C18.4493 1.54154 18.3944 1.58604 18.3501 1.64018C18.3466 1.64444 18.3431 1.64863 18.3394 1.65276L8.61164 12.6437C8.57463 12.6855 8.52967 12.7196 8.47939 12.7439C8.4291 12.7682 8.37448 12.7822 8.31871 12.7852C8.26294 12.7883 8.20713 12.7802 8.15451 12.7614C8.1019 12.7427 8.05353 12.7137 8.01222 12.6761L4.78376 9.73818C4.44846 9.43081 4.01021 9.26014 3.55534 9.25979Z" fill="${a === "ocb" ? "#008c44" : "#1e2a7b"}"
|
|
6455
6457
|
</svg>
|
|
6456
6458
|
`;
|
|
6457
|
-
const
|
|
6458
|
-
|
|
6459
|
+
const $ = document.createElement("label");
|
|
6460
|
+
$.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 wgt:leading-tight", $.appendChild(document.createTextNode(l("informationSent"))), K.appendChild(Y), K.appendChild($);
|
|
6459
6461
|
const g = document.createElement("div");
|
|
6460
6462
|
g.className = "wgt:w-full wgt:flex wgt:justify-center", u.appendChild(g);
|
|
6461
6463
|
const s = wt({
|
|
@@ -6744,7 +6746,7 @@ function Hc() {
|
|
|
6744
6746
|
const t = document.body.className;
|
|
6745
6747
|
return t.includes("bvb") ? "bvb" : t.includes("shb") ? "shb" : t.includes("agr") ? "agr" : t.includes("nama") ? "nama" : "bvb";
|
|
6746
6748
|
}
|
|
6747
|
-
function
|
|
6749
|
+
function yc(n) {
|
|
6748
6750
|
return {
|
|
6749
6751
|
ocb: "#008c44",
|
|
6750
6752
|
bvb: "#1e2a7b",
|
|
@@ -6753,7 +6755,7 @@ function Pc(n) {
|
|
|
6753
6755
|
nama: "#ffdd00"
|
|
6754
6756
|
}[n];
|
|
6755
6757
|
}
|
|
6756
|
-
function
|
|
6758
|
+
function Pc({
|
|
6757
6759
|
onConfirm: n,
|
|
6758
6760
|
onCancel: t,
|
|
6759
6761
|
showCloseButton: e = !0,
|
|
@@ -6768,7 +6770,7 @@ function yc({
|
|
|
6768
6770
|
} catch {
|
|
6769
6771
|
}
|
|
6770
6772
|
});
|
|
6771
|
-
const q = Hc(), T =
|
|
6773
|
+
const q = Hc(), T = yc(q);
|
|
6772
6774
|
document.documentElement.style.setProperty("--primary", T), q === "nama" && document.documentElement.style.setProperty(
|
|
6773
6775
|
"--primary-bg",
|
|
6774
6776
|
"linear-gradient(180deg, #FFEC72 0%, #FD0 100%)"
|
|
@@ -6970,7 +6972,7 @@ async function d0(n, t, e, a = !1, h = "ocb", c = "", A = null, u = "M-Invoice")
|
|
|
6970
6972
|
return;
|
|
6971
6973
|
}
|
|
6972
6974
|
if (!o.isNewCustomer) {
|
|
6973
|
-
i = await Jt(n, t), await e(o.isNewCustomer, i), await new Promise((T) => setTimeout(T, 1e3)), (i?.organization?.name || i?.organization?.taxCode) &&
|
|
6975
|
+
i = await Jt(n, t), await e(o.isNewCustomer, i), await new Promise((T) => setTimeout(T, 1e3)), (i?.organization?.name || i?.organization?.taxCode) && Pc({
|
|
6974
6976
|
settingUrl: c,
|
|
6975
6977
|
onCancel: () => {
|
|
6976
6978
|
},
|
|
@@ -6993,8 +6995,8 @@ async function bc(n, t, e, a, h, c) {
|
|
|
6993
6995
|
const u = [
|
|
6994
6996
|
{ name: "1Invoice", route: "one-invoice", logoUrl: Eh },
|
|
6995
6997
|
{ name: "M-Invoice", route: "m-invoice", logoUrl: Hh },
|
|
6996
|
-
{ name: "Misa", route: "misa", logoUrl:
|
|
6997
|
-
{ name: "FPT", route: "fpt", logoUrl:
|
|
6998
|
+
{ name: "Misa", route: "misa", logoUrl: yh },
|
|
6999
|
+
{ name: "FPT", route: "fpt", logoUrl: Ph },
|
|
6998
7000
|
{ name: "Viettel", route: "viettel", logoUrl: kh }
|
|
6999
7001
|
].filter((y) => y.route === "m-invoice" || y.route === "one-invoice");
|
|
7000
7002
|
function o(y = !1) {
|
|
@@ -7021,7 +7023,8 @@ async function bc(n, t, e, a, h, c) {
|
|
|
7021
7023
|
name: "",
|
|
7022
7024
|
address: "",
|
|
7023
7025
|
taxCode: a?.taxCode || "",
|
|
7024
|
-
taxAuthority: ""
|
|
7026
|
+
taxAuthority: "",
|
|
7027
|
+
wardTaxAuthority: ""
|
|
7025
7028
|
},
|
|
7026
7029
|
contactPerson: {
|
|
7027
7030
|
name: "",
|
|
@@ -7067,7 +7070,8 @@ async function bc(n, t, e, a, h, c) {
|
|
|
7067
7070
|
name: "",
|
|
7068
7071
|
address: "",
|
|
7069
7072
|
taxCode: a?.taxCode || "",
|
|
7070
|
-
taxAuthority: ""
|
|
7073
|
+
taxAuthority: "",
|
|
7074
|
+
wardTaxAuthority: ""
|
|
7071
7075
|
},
|
|
7072
7076
|
contactPerson: {
|
|
7073
7077
|
name: "",
|
|
@@ -7107,7 +7111,8 @@ async function bc(n, t, e, a, h, c) {
|
|
|
7107
7111
|
name: "",
|
|
7108
7112
|
address: "",
|
|
7109
7113
|
taxCode: a?.taxCode || "",
|
|
7110
|
-
taxAuthority: ""
|
|
7114
|
+
taxAuthority: "",
|
|
7115
|
+
wardTaxAuthority: ""
|
|
7111
7116
|
}), P = {
|
|
7112
7117
|
...P,
|
|
7113
7118
|
eInvoiceRegistration: {
|
|
@@ -7115,7 +7120,8 @@ async function bc(n, t, e, a, h, c) {
|
|
|
7115
7120
|
name: y?.name || "",
|
|
7116
7121
|
address: y?.address || "",
|
|
7117
7122
|
taxCode: y?.taxCode || "",
|
|
7118
|
-
taxAuthority: y?.taxAuthority || ""
|
|
7123
|
+
taxAuthority: y?.taxAuthority || "",
|
|
7124
|
+
wardTaxAuthority: y?.wardTaxAuthority || ""
|
|
7119
7125
|
},
|
|
7120
7126
|
contactPerson: {
|
|
7121
7127
|
name: "",
|
|
@@ -7156,7 +7162,7 @@ async function bc(n, t, e, a, h, c) {
|
|
|
7156
7162
|
behavior: "smooth"
|
|
7157
7163
|
});
|
|
7158
7164
|
}
|
|
7159
|
-
async function
|
|
7165
|
+
async function $(y, D) {
|
|
7160
7166
|
if (y) {
|
|
7161
7167
|
if (y === P) return;
|
|
7162
7168
|
P = {
|
|
@@ -7202,8 +7208,8 @@ async function bc(n, t, e, a, h, c) {
|
|
|
7202
7208
|
x = G, localStorage.setItem("activeProvider", G.route), localStorage.setItem("activeProviderName", G.name), await d0(
|
|
7203
7209
|
G.route,
|
|
7204
7210
|
P?.eInvoiceRegistration?.organization?.taxCode,
|
|
7205
|
-
(O,
|
|
7206
|
-
S = O, nn
|
|
7211
|
+
(O, nn) => {
|
|
7212
|
+
S = O, $(nn);
|
|
7207
7213
|
},
|
|
7208
7214
|
c,
|
|
7209
7215
|
h,
|
|
@@ -7217,7 +7223,7 @@ async function bc(n, t, e, a, h, c) {
|
|
|
7217
7223
|
isNewCustomer: S,
|
|
7218
7224
|
isRenewal: c,
|
|
7219
7225
|
handleCheckNewCustomer: d0,
|
|
7220
|
-
updateRegistrationData:
|
|
7226
|
+
updateRegistrationData: $,
|
|
7221
7227
|
serial: Z.test(a?.serial || "") ? a.serial : U,
|
|
7222
7228
|
onSubmit: (G) => {
|
|
7223
7229
|
P.eInvoiceRegistration = {
|
|
@@ -7362,7 +7368,7 @@ async function bc(n, t, e, a, h, c) {
|
|
|
7362
7368
|
x.route,
|
|
7363
7369
|
P?.eInvoiceRegistration?.organization?.taxCode,
|
|
7364
7370
|
async (y, D) => {
|
|
7365
|
-
L = !1, S = y,
|
|
7371
|
+
L = !1, S = y, $(D), i.updateTitle(
|
|
7366
7372
|
c ? l("eInvoiceRenewal") : l("eInvoiceRegister")
|
|
7367
7373
|
);
|
|
7368
7374
|
},
|