@invoice-sdk/widget 1.97.1 → 1.97.2
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-CefS8fi4.js → index-D4WgVrRp.js} +685 -684
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +48 -55
- package/dist/{widget-CypNKvAh.js → widget-DxwfypOQ.js} +516 -514
- package/dist/widget.css +1 -1
- package/package.json +1 -1
|
@@ -23,19 +23,19 @@ var W = (g, A, E) => new Promise((B, C) => {
|
|
|
23
23
|
var Q = (I) => {
|
|
24
24
|
try {
|
|
25
25
|
n(E.next(I));
|
|
26
|
-
} catch (
|
|
27
|
-
C(
|
|
26
|
+
} catch (c) {
|
|
27
|
+
C(c);
|
|
28
28
|
}
|
|
29
29
|
}, t = (I) => {
|
|
30
30
|
try {
|
|
31
31
|
n(E.throw(I));
|
|
32
|
-
} catch (
|
|
33
|
-
C(
|
|
32
|
+
} catch (c) {
|
|
33
|
+
C(c);
|
|
34
34
|
}
|
|
35
35
|
}, n = (I) => I.done ? B(I.value) : Promise.resolve(I.value).then(Q, t);
|
|
36
36
|
n((E = E.apply(g, A)).next());
|
|
37
37
|
});
|
|
38
|
-
import { t as a, g as mB, a as cQ, b as wQ, C as eQ, G as oQ, c as aQ, d as rB, e as ag, f as DQ, h as uQ, i as zg, O as SC, s as og, j as PB, k as iQ, l as sQ, m as fQ, n as mQ, o as rQ, p as PQ, v as qQ } from "./index-
|
|
38
|
+
import { t as a, g as mB, a as cQ, b as wQ, C as eQ, G as oQ, c as aQ, d as rB, e as ag, f as DQ, h as uQ, i as zg, O as SC, s as og, j as PB, k as iQ, l as sQ, m as fQ, n as mQ, o as rQ, p as PQ, v as qQ } from "./index-D4WgVrRp.js";
|
|
39
39
|
import { g as pC } from "./_commonjsHelpers-bAxELxBV.js";
|
|
40
40
|
function tC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
41
41
|
const E = document.createElement("div");
|
|
@@ -61,11 +61,11 @@ function tC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
61
61
|
C.className = "wgt:relative wgt:flex wgt:w-full wgt:z-10 wgt:@max-2xl:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:overflow-hidden";
|
|
62
62
|
const Q = [];
|
|
63
63
|
function t(I) {
|
|
64
|
-
g.forEach((
|
|
65
|
-
const
|
|
64
|
+
g.forEach((c, w) => {
|
|
65
|
+
const s = w + 1, D = I === g.length + 1 ? s < g.length : I !== s, o = document.createElement("div");
|
|
66
66
|
o.setAttribute("role", "listitem"), o.setAttribute(
|
|
67
67
|
"aria-label",
|
|
68
|
-
`Step ${
|
|
68
|
+
`Step ${s} of ${g.length}: ${c.label}`
|
|
69
69
|
), o.className = [
|
|
70
70
|
"wgt:flex-1",
|
|
71
71
|
"wgt:flex",
|
|
@@ -73,7 +73,7 @@ function tC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
73
73
|
"wgt:justify-center",
|
|
74
74
|
"wgt:py-5",
|
|
75
75
|
"wgt:px-4",
|
|
76
|
-
|
|
76
|
+
w < g.length - 1 ? "wgt:pr-9 wgt:@max-2xl:pr-0" : "",
|
|
77
77
|
D ? "wgt:@max-2xl:hidden" : "wgt:@max-2xl:bg-primary/15"
|
|
78
78
|
].filter(Boolean).join(" ");
|
|
79
79
|
const i = document.createElement("div");
|
|
@@ -87,16 +87,16 @@ function tC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
87
87
|
"wgt:mr-4"
|
|
88
88
|
].join(" ");
|
|
89
89
|
const u = document.createElement("span");
|
|
90
|
-
u.innerText = String(
|
|
90
|
+
u.innerText = String(s), u.className = "wgt:text-white wgt:font-medium", i.appendChild(u);
|
|
91
91
|
const R = document.createElement("span");
|
|
92
|
-
R.innerText =
|
|
92
|
+
R.innerText = c.label, R.className = "wgt:font-medium wgt:whitespace-nowrap", o.append(i, R), C.append(o), Q.push({ wrap: o, circle: i, label: R });
|
|
93
93
|
}), E.append(B, C);
|
|
94
94
|
}
|
|
95
95
|
t(A);
|
|
96
96
|
function n(I) {
|
|
97
|
-
const
|
|
98
|
-
B.style.width = `${
|
|
99
|
-
i + 1 <=
|
|
97
|
+
const c = g.length, w = Math.max(0, Math.min(I, c)), s = w / c * 100;
|
|
98
|
+
B.style.width = `${s}%`, w === c ? (B.style.clipPath = "none", B.style.borderTopRightRadius = "10px", B.style.borderBottomRightRadius = "10px") : (B.style.clipPath = "polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)", B.style.borderTopRightRadius = "0", B.style.borderBottomRightRadius = "0"), Q.forEach(({ circle: D, label: o }, i) => {
|
|
99
|
+
i + 1 <= w ? (D.classList.add("wgt:bg-icon-primary"), D.classList.remove("wgt:bg-icon-soft-400"), o.classList.add("wgt:text-primary-dark"), o.classList.remove("wgt:text-soft-400")) : (D.classList.add("wgt:bg-icon-soft-400"), D.classList.remove("wgt:bg-icon-primary"), o.classList.add("wgt:text-soft-400"), o.classList.remove("wgt:text-primary-dark"));
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
return n(A), {
|
|
@@ -148,18 +148,18 @@ function vQ({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
148
148
|
"wgt:@max-2xl:shadow-none"
|
|
149
149
|
].join(" ");
|
|
150
150
|
let Q = tC({
|
|
151
|
-
steps: g.map((
|
|
151
|
+
steps: g.map((c) => ({ label: c })),
|
|
152
152
|
currentStep: A
|
|
153
153
|
});
|
|
154
154
|
C.appendChild(Q.container);
|
|
155
155
|
const t = document.createElement("div");
|
|
156
156
|
t.className = "wgt:flex-1", C.appendChild(t), E.appendChild(B), E.appendChild(C);
|
|
157
|
-
function n(
|
|
158
|
-
B.innerText =
|
|
157
|
+
function n(c) {
|
|
158
|
+
B.innerText = c;
|
|
159
159
|
}
|
|
160
|
-
function I(
|
|
160
|
+
function I(c) {
|
|
161
161
|
Q.container.remove(), Q = tC({
|
|
162
|
-
steps:
|
|
162
|
+
steps: c.map((w) => ({ label: w })),
|
|
163
163
|
currentStep: A
|
|
164
164
|
}), C.insertBefore(Q.container, t);
|
|
165
165
|
}
|
|
@@ -168,15 +168,15 @@ function vQ({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
168
168
|
/**
|
|
169
169
|
* change which step is active (1‐based index):
|
|
170
170
|
*/
|
|
171
|
-
setStep(
|
|
172
|
-
A =
|
|
171
|
+
setStep(c, w) {
|
|
172
|
+
A = c, I(w), Q.update(c);
|
|
173
173
|
},
|
|
174
174
|
/**
|
|
175
175
|
* replace whatever content is inside the "children" area:
|
|
176
176
|
* @param {HTMLElement} domNode
|
|
177
177
|
*/
|
|
178
|
-
setContent(
|
|
179
|
-
t.replaceChildren(
|
|
178
|
+
setContent(c) {
|
|
179
|
+
t.replaceChildren(c);
|
|
180
180
|
},
|
|
181
181
|
updateSteps: I,
|
|
182
182
|
updateTitle: n
|
|
@@ -193,8 +193,8 @@ function Ng({
|
|
|
193
193
|
}) {
|
|
194
194
|
const n = document.createElement("div");
|
|
195
195
|
if (n.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:cursor-pointer", t) {
|
|
196
|
-
let
|
|
197
|
-
D ? (
|
|
196
|
+
let s = function(D) {
|
|
197
|
+
D ? (c.classList.add("wgt:bg-primary", "wgt:border-primary"), c.classList.remove("wgt:border-weak-50")) : (c.classList.remove("wgt:bg-primary", "wgt:border-primary"), c.classList.add("wgt:border-weak-50")), w.innerHTML = D ? `<svg width="10" height="8" viewBox="0 0 10 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
198
198
|
<mask id="path-1-inside-1_14170_92697" fill="white">
|
|
199
199
|
<path d="M3.58055 7.58156C3.38055 7.58156 3.19055 7.50156 3.05055 7.36156L0.220552 4.53156C-0.0694482 4.24156 -0.0694482 3.76156 0.220552 3.47156C0.510552 3.18156 0.990552 3.18156 1.28055 3.47156L3.58055 5.77156L8.72055 0.631563C9.01055 0.341563 9.49055 0.341563 9.78055 0.631563C10.0706 0.921563 10.0706 1.40156 9.78055 1.69156L4.11055 7.36156C3.97055 7.50156 3.78055 7.58156 3.58055 7.58156Z"/>
|
|
200
200
|
</mask>
|
|
@@ -215,8 +215,8 @@ function Ng({
|
|
|
215
215
|
</svg>
|
|
216
216
|
`;
|
|
217
217
|
}, I = B;
|
|
218
|
-
const
|
|
219
|
-
|
|
218
|
+
const c = document.createElement("div");
|
|
219
|
+
c.className = [
|
|
220
220
|
"wgt:w-7",
|
|
221
221
|
"wgt:h-7",
|
|
222
222
|
"wgt:border-2",
|
|
@@ -227,24 +227,24 @@ function Ng({
|
|
|
227
227
|
"wgt:transition-colors",
|
|
228
228
|
Q ? "wgt:cursor-not-allowed" : "wgt:cursor-pointer"
|
|
229
229
|
].join(" ");
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
D.stopPropagation(), !Q && (I = !I,
|
|
233
|
-
}), n.append(
|
|
230
|
+
const w = document.createElement("div");
|
|
231
|
+
s(B), c.appendChild(w), c.addEventListener("click", (D) => {
|
|
232
|
+
D.stopPropagation(), !Q && (I = !I, s(I), C(I));
|
|
233
|
+
}), n.append(c);
|
|
234
234
|
} else {
|
|
235
235
|
const I = document.createElement("div");
|
|
236
236
|
I.className = "wgt:relative wgt:flex wgt:items-center wgt:justify-center wgt:h-6 wgt:w-6 wgt:cursor-pointer wgt:rounded-full wgt:transition-colors wgt:duration-200";
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
|
|
237
|
+
const c = document.createElement("input");
|
|
238
|
+
c.type = "radio", g && (c.name = g), A && (c.value = A), c.checked = B, c.disabled = Q, c.className = "wgt:invisible wgt:h-6 wgt:w-6";
|
|
239
|
+
const w = document.createElement("div");
|
|
240
|
+
w.className = `wgt:absolute wgt:w-5 wgt:h-5 wgt:rounded-full wgt:border wgt:border-white wgt:border-3 wgt:transition-all wgt:duration-200 wgt:ring-2
|
|
241
241
|
|
|
242
242
|
${B ? "wgt:ring-primary wgt:bg-primary" : "wgt:ring-grey-6 wgt:bg-grey-6"}`;
|
|
243
|
-
const
|
|
244
|
-
|
|
243
|
+
const s = document.createElement("span");
|
|
244
|
+
s.innerText = E, c.addEventListener("change", (D) => {
|
|
245
245
|
const o = D.target.checked;
|
|
246
|
-
typeof C == "function" && C(o),
|
|
247
|
-
}), I.append(
|
|
246
|
+
typeof C == "function" && C(o), c.checked = !1;
|
|
247
|
+
}), I.append(c, s), I.append(w), n.append(I);
|
|
248
248
|
}
|
|
249
249
|
return {
|
|
250
250
|
container: n
|
|
@@ -275,9 +275,9 @@ function MQ({
|
|
|
275
275
|
"wgt:select-none"
|
|
276
276
|
].join(" "), Q.style.scrollSnapType = "x mandatory", Q.style.overflowX = "auto", Q.style.scrollBehavior = "smooth", Q.style.scrollbarWidth = "none", Q.style.msOverflowStyle = "none", Q.style.WebkitOverflowScrolling = "touch", Q.style.overflowY = "hidden", B.appendChild(Q);
|
|
277
277
|
function t() {
|
|
278
|
-
Q.innerHTML = "", g.forEach((
|
|
279
|
-
const
|
|
280
|
-
D.dataset.checked =
|
|
278
|
+
Q.innerHTML = "", g.forEach((w) => {
|
|
279
|
+
const s = w.route === A, D = document.createElement("div");
|
|
280
|
+
D.dataset.checked = s ? "true" : "false", D.className = [
|
|
281
281
|
"wgt:flex",
|
|
282
282
|
"wgt:items-center",
|
|
283
283
|
"wgt:justify-between",
|
|
@@ -290,22 +290,22 @@ function MQ({
|
|
|
290
290
|
"wgt:cursor-pointer",
|
|
291
291
|
"wgt:transition-colors",
|
|
292
292
|
"wgt:duration-200",
|
|
293
|
-
|
|
293
|
+
s ? "wgt:border-primary" : ""
|
|
294
294
|
].filter(Boolean).join(" "), D.addEventListener("click", () => {
|
|
295
|
-
A =
|
|
295
|
+
A = w.route, typeof E == "function" && E(w), t();
|
|
296
296
|
});
|
|
297
297
|
const o = document.createElement("div");
|
|
298
298
|
o.className = "wgt:flex wgt:items-center wgt:gap-3";
|
|
299
299
|
const i = document.createElement("img");
|
|
300
|
-
i.src =
|
|
300
|
+
i.src = w.logoUrl, i.alt = w.name, i.className = "wgt:h-8 wgt:object-contain";
|
|
301
301
|
const u = document.createElement("div");
|
|
302
302
|
u.className = "wgt:w-[1px] wgt:h-8 wgt:bg-border-light";
|
|
303
303
|
const R = document.createElement("label");
|
|
304
|
-
R.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase", R.innerText =
|
|
304
|
+
R.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase", R.innerText = w.name, o.appendChild(i), o.appendChild(u), o.appendChild(R);
|
|
305
305
|
const { container: M } = Ng({
|
|
306
|
-
checked:
|
|
306
|
+
checked: s,
|
|
307
307
|
onChange: (d) => {
|
|
308
|
-
d && (A =
|
|
308
|
+
d && (A = w.route, typeof E == "function" && E(w), t());
|
|
309
309
|
},
|
|
310
310
|
disabled: !1
|
|
311
311
|
});
|
|
@@ -313,24 +313,24 @@ function MQ({
|
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
315
|
t();
|
|
316
|
-
let n = !1, I,
|
|
317
|
-
return Q.addEventListener("mousedown", (
|
|
318
|
-
n = !0, Q.classList.replace("wgt:cursor-grab", "wgt:cursor-grabbing"), I =
|
|
316
|
+
let n = !1, I, c;
|
|
317
|
+
return Q.addEventListener("mousedown", (w) => {
|
|
318
|
+
n = !0, Q.classList.replace("wgt:cursor-grab", "wgt:cursor-grabbing"), I = w.pageX - Q.offsetLeft, c = Q.scrollLeft;
|
|
319
319
|
}), document.addEventListener("mouseup", () => {
|
|
320
320
|
n = !1, Q.classList.replace("wgt:cursor-grabbing", "wgt:cursor-grab");
|
|
321
321
|
}), Q.addEventListener("mouseleave", () => {
|
|
322
322
|
n = !1, Q.classList.replace("wgt:cursor-grabbing", "wgt:cursor-grab");
|
|
323
|
-
}), Q.addEventListener("mousemove", (
|
|
323
|
+
}), Q.addEventListener("mousemove", (w) => {
|
|
324
324
|
if (!n) return;
|
|
325
|
-
|
|
326
|
-
const D = (
|
|
327
|
-
Q.scrollLeft =
|
|
328
|
-
}), Q.addEventListener("wheel", (
|
|
329
|
-
|
|
325
|
+
w.preventDefault();
|
|
326
|
+
const D = (w.pageX - Q.offsetLeft - I) * 1.5;
|
|
327
|
+
Q.scrollLeft = c - D;
|
|
328
|
+
}), Q.addEventListener("wheel", (w) => {
|
|
329
|
+
w.preventDefault(), Q.scrollLeft += w.deltaY;
|
|
330
330
|
}), {
|
|
331
331
|
container: B,
|
|
332
|
-
setSelectedRoute(
|
|
333
|
-
A =
|
|
332
|
+
setSelectedRoute(w) {
|
|
333
|
+
A = w, t();
|
|
334
334
|
}
|
|
335
335
|
};
|
|
336
336
|
}
|
|
@@ -344,20 +344,20 @@ function HA({
|
|
|
344
344
|
error: t = null,
|
|
345
345
|
onInput: n = null,
|
|
346
346
|
readOnly: I = !1,
|
|
347
|
-
horizontal:
|
|
348
|
-
note:
|
|
347
|
+
horizontal: c = !1,
|
|
348
|
+
note: w = null
|
|
349
349
|
}) {
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
350
|
+
const s = document.createElement("div");
|
|
351
|
+
if (s.className = "wgt:w-full " + (c ? "wgt:@max-5xl:flex wgt:@max-5xl:flex-col wgt:@max-5xl:items-start wgt:@max-5xl:gap-1 wgt:grid wgt:grid-cols-6 wgt:items-start wgt:gap-2" : "wgt:flex wgt:flex-col wgt:gap-2"), C) {
|
|
352
352
|
const u = document.createElement("label");
|
|
353
353
|
if (u.htmlFor = g, u.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal", u.innerText = C, Q) {
|
|
354
354
|
const R = document.createElement("span");
|
|
355
355
|
R.className = "wgt:text-red-500 wgt:ml-1", R.innerText = "*", u.appendChild(R);
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
s.appendChild(u);
|
|
358
358
|
}
|
|
359
359
|
const D = document.createElement("div");
|
|
360
|
-
D.className = "wgt:relative wgt:w-full wgt:col-span-4 wgt:flex wgt:flex-col wgt:gap-2",
|
|
360
|
+
D.className = "wgt:relative wgt:w-full wgt:col-span-4 wgt:flex wgt:flex-col wgt:gap-2", s.appendChild(D);
|
|
361
361
|
const o = document.createElement("input");
|
|
362
362
|
o.type = E, o.name = g, o.id = g, o.value = A, o.placeholder = B, o.readOnly = I, o.autocomplete = "off", o.autocapitalize = "off", o.spellcheck = !1, o.className = [
|
|
363
363
|
"wgt:col-span-4",
|
|
@@ -373,14 +373,14 @@ function HA({
|
|
|
373
373
|
u.preventDefault();
|
|
374
374
|
}, { passive: !1 });
|
|
375
375
|
const i = document.createElement("span");
|
|
376
|
-
if (i.className = "wgt:w-fit wgt:text-red-500 wgt:text-sm wgt:whitespace-nowrap", i.innerText = t || "", t || (i.style.display = "none"), D.appendChild(o),
|
|
376
|
+
if (i.className = "wgt:w-fit wgt:text-red-500 wgt:text-sm wgt:whitespace-nowrap", i.innerText = t || "", t || (i.style.display = "none"), D.appendChild(o), w) {
|
|
377
377
|
const u = document.createElement("ul");
|
|
378
378
|
u.className = "wgt:list-outside wgt:@max-5xl:list-inside wgt:list-disc wgt:text-sm wgt:text-[#8C8C8C] wgt:italic";
|
|
379
379
|
const R = document.createElement("li");
|
|
380
|
-
R.className = "wgt:text-sm wgt:text-[#8C8C8C] wgt:italic wgt:whitespace-nowrap wgt:@max-2xl:whitespace-normal", R.innerText =
|
|
380
|
+
R.className = "wgt:text-sm wgt:text-[#8C8C8C] wgt:italic wgt:whitespace-nowrap wgt:@max-2xl:whitespace-normal", R.innerText = w, u.appendChild(R), D.appendChild(u);
|
|
381
381
|
}
|
|
382
382
|
return D.appendChild(i), {
|
|
383
|
-
container:
|
|
383
|
+
container: s,
|
|
384
384
|
inputEl: o,
|
|
385
385
|
setError(u) {
|
|
386
386
|
u ? (i.innerText = u, i.style.display = "block", o.classList.remove("wgt:border-gray-300", "wgt:focus:border-primary"), o.classList.add("wgt:border-red-500", "wgt:focus:border-red-500")) : (i.innerText = "", i.style.display = "none", o.classList.remove("wgt:border-red-500", "wgt:focus:border-red-500"), o.classList.add("wgt:border-gray-300", "wgt:focus:border-primary"));
|
|
@@ -400,16 +400,16 @@ function Kg({
|
|
|
400
400
|
onChange: t = null,
|
|
401
401
|
required: n = !1,
|
|
402
402
|
horizontal: I = !1,
|
|
403
|
-
searchable:
|
|
403
|
+
searchable: c = !1
|
|
404
404
|
}) {
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
if (
|
|
405
|
+
const w = document.createElement("div");
|
|
406
|
+
w.className = "wgt:w-full " + (I ? "wgt:@max-5xl:flex wgt:@max-5xl:flex-col wgt:@max-5xl:items-start wgt:@max-5xl:gap-2 wgt:grid wgt:grid-cols-6 wgt:items-start wgt:gap-2" : "wgt:flex wgt:flex-col wgt:gap-2");
|
|
407
|
+
const s = document.createElement("label");
|
|
408
|
+
if (s.htmlFor = g, s.className = "wgt:font-medium wgt:text-text-sub-600 wgt:whitespace-nowrap wgt:col-span-2", s.innerText = B, w.appendChild(s), n) {
|
|
409
409
|
const D = document.createElement("span");
|
|
410
|
-
D.className = "wgt:text-red-500 wgt:ml-1", D.innerText = "*",
|
|
410
|
+
D.className = "wgt:text-red-500 wgt:ml-1", D.innerText = "*", s.appendChild(D);
|
|
411
411
|
}
|
|
412
|
-
if (
|
|
412
|
+
if (c) {
|
|
413
413
|
const D = document.createElement("div");
|
|
414
414
|
D.className = "wgt:col-span-4 wgt:relative wgt:w-full";
|
|
415
415
|
const o = document.createElement("input");
|
|
@@ -434,17 +434,17 @@ function Kg({
|
|
|
434
434
|
u.className = "wgt:divide-y wgt:divide-gray-200";
|
|
435
435
|
let R = A, M = null, d = [...E];
|
|
436
436
|
const r = () => {
|
|
437
|
-
const m = E.find((
|
|
437
|
+
const m = E.find((f) => f.id ? f.id === M : f.value === R);
|
|
438
438
|
return m ? m.label : "";
|
|
439
439
|
};
|
|
440
440
|
o.value = r();
|
|
441
441
|
const P = (m = d) => {
|
|
442
442
|
if (u.innerHTML = "", m.length === 0) {
|
|
443
|
-
const
|
|
444
|
-
|
|
443
|
+
const f = document.createElement("div");
|
|
444
|
+
f.className = "wgt:px-3 wgt:py-2 wgt:text-gray-500 wgt:text-sm", f.innerText = `${a("noResults", "Không tìm thấy kết quả")}`, u.appendChild(f);
|
|
445
445
|
return;
|
|
446
446
|
}
|
|
447
|
-
m.forEach((
|
|
447
|
+
m.forEach((f) => {
|
|
448
448
|
const v = document.createElement("div");
|
|
449
449
|
v.className = [
|
|
450
450
|
"wgt:px-3",
|
|
@@ -452,19 +452,19 @@ function Kg({
|
|
|
452
452
|
"wgt:cursor-pointer",
|
|
453
453
|
"wgt:hover:bg-gray-100",
|
|
454
454
|
"wgt:text-sm",
|
|
455
|
-
|
|
456
|
-
].filter(Boolean).join(" "), v.innerText =
|
|
457
|
-
if (
|
|
458
|
-
const k = { target: { value:
|
|
459
|
-
|
|
455
|
+
f.id ? M === f.id ? "wgt:bg-blue-50 wgt:text-blue-700" : "" : R === f.value ? "wgt:bg-blue-50 wgt:text-blue-700" : ""
|
|
456
|
+
].filter(Boolean).join(" "), v.innerText = f.label, v.dataset.value = f.value, v.addEventListener("click", () => {
|
|
457
|
+
if (f.id && (M = f.id), R = f.value, o.value = f.label, i.classList.add("wgt:hidden"), typeof t == "function") {
|
|
458
|
+
const k = { target: { value: f.value } };
|
|
459
|
+
f.id && (k.target.id = f.id), t(k);
|
|
460
460
|
}
|
|
461
461
|
}), u.appendChild(v);
|
|
462
462
|
});
|
|
463
463
|
};
|
|
464
464
|
o.addEventListener("input", (m) => {
|
|
465
|
-
const
|
|
465
|
+
const f = m.target.value.toLowerCase();
|
|
466
466
|
d = E.filter(
|
|
467
|
-
(v) => v.label.toLowerCase().includes(
|
|
467
|
+
(v) => v.label.toLowerCase().includes(f)
|
|
468
468
|
), P(d), i.classList.contains("wgt:hidden") || i.classList.remove("wgt:hidden");
|
|
469
469
|
}), o.addEventListener("focus", () => {
|
|
470
470
|
i.classList.remove("wgt:hidden"), P();
|
|
@@ -475,12 +475,12 @@ function Kg({
|
|
|
475
475
|
}), i.appendChild(u), D.appendChild(o), D.appendChild(i), P();
|
|
476
476
|
const Y = document.createElement("select");
|
|
477
477
|
Y.style.display = "none", Y.name = g, Y.id = g, E.forEach((m) => {
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
}),
|
|
478
|
+
const f = document.createElement("option");
|
|
479
|
+
f.value = m.value, f.innerText = m.label, m.value === A && (f.selected = !0), Y.appendChild(f);
|
|
480
|
+
}), w.appendChild(D), w.appendChild(Y);
|
|
481
481
|
const T = document.createElement("span");
|
|
482
|
-
return T.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", T.innerText = Q || "", Q || (T.style.display = "none"),
|
|
483
|
-
container:
|
|
482
|
+
return T.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", T.innerText = Q || "", Q || (T.style.display = "none"), w.appendChild(T), {
|
|
483
|
+
container: w,
|
|
484
484
|
selectEl: Y,
|
|
485
485
|
setError(m) {
|
|
486
486
|
m ? (T.innerText = m, T.style.display = "block", o.classList.remove("wgt:border-gray-300"), o.classList.add("wgt:border-red-500")) : (T.innerText = "", T.style.display = "none", o.classList.remove("wgt:border-red-500"), o.classList.add("wgt:border-gray-300"));
|
|
@@ -488,17 +488,17 @@ function Kg({
|
|
|
488
488
|
getValue() {
|
|
489
489
|
return R;
|
|
490
490
|
},
|
|
491
|
-
setValue(m,
|
|
491
|
+
setValue(m, f, v) {
|
|
492
492
|
M = v || null, R = m || "";
|
|
493
493
|
const k = E.find((H) => H.id ? H.id === v : H.value === m);
|
|
494
|
-
k ? (o.value = k.label, Y.value = m, P()) : (o.value =
|
|
494
|
+
k ? (o.value = k.label, Y.value = m, P()) : (o.value = f || "", Y.value = m || "", P());
|
|
495
495
|
},
|
|
496
496
|
setOptions(m) {
|
|
497
497
|
for (E.splice(0, E.length, ...m), d = [...m]; Y.options.length > 0; )
|
|
498
498
|
Y.remove(0);
|
|
499
|
-
m.forEach((
|
|
499
|
+
m.forEach((f) => {
|
|
500
500
|
const v = document.createElement("option");
|
|
501
|
-
v.value =
|
|
501
|
+
v.value = f.value, v.innerText = f.label, Y.appendChild(v);
|
|
502
502
|
}), P();
|
|
503
503
|
},
|
|
504
504
|
setDisabled(m) {
|
|
@@ -527,10 +527,10 @@ function Kg({
|
|
|
527
527
|
)} ${B.toLowerCase()} --`, D.appendChild(o), E.forEach((u) => {
|
|
528
528
|
const R = document.createElement("option");
|
|
529
529
|
R.value = u.value, R.innerText = u.label, u.value === A && (R.selected = !0), D.appendChild(R);
|
|
530
|
-
}), typeof t == "function" && D.addEventListener("change", t),
|
|
530
|
+
}), typeof t == "function" && D.addEventListener("change", t), w.appendChild(D);
|
|
531
531
|
const i = document.createElement("span");
|
|
532
|
-
return i.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", i.innerText = Q || "", Q || (i.style.display = "none"),
|
|
533
|
-
container:
|
|
532
|
+
return i.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", i.innerText = Q || "", Q || (i.style.display = "none"), w.appendChild(i), {
|
|
533
|
+
container: w,
|
|
534
534
|
selectEl: D,
|
|
535
535
|
setError(u) {
|
|
536
536
|
u ? (i.innerText = u, i.style.display = "block", D.classList.remove("wgt:border-gray-300"), D.classList.add("wgt:border-red-500")) : (i.innerText = "", i.style.display = "none", D.classList.remove("wgt:border-red-500"), D.classList.add("wgt:border-gray-300"));
|
|
@@ -600,8 +600,8 @@ function hC({
|
|
|
600
600
|
}
|
|
601
601
|
const I = Q ? Q.split(",").map((r) => r.trim().startsWith("image/") ? r.replace("image/", "").toUpperCase() : r.trim().startsWith(".") ? r.replace(".", "").toUpperCase() : r.toUpperCase().replace("/*", "")).filter(Boolean).join(", ") : `JPG, PNG ${a("or")} JPEG`;
|
|
602
602
|
n.innerHTML += ` <span class="wgt:text-xs wgt:font-normal wgt:leading-4 wgt:text-soft-400">(${a("fileFormat")} ${I}. ${a("maxFileSize")})</span>`, t.appendChild(n);
|
|
603
|
-
const
|
|
604
|
-
|
|
603
|
+
const c = document.createElement("div");
|
|
604
|
+
c.className = [
|
|
605
605
|
"wgt:h-fit",
|
|
606
606
|
"wgt:w-full",
|
|
607
607
|
"wgt:rounded",
|
|
@@ -612,10 +612,10 @@ function hC({
|
|
|
612
612
|
"wgt:justify-start",
|
|
613
613
|
"wgt:gap-2"
|
|
614
614
|
].join(" ");
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
const
|
|
618
|
-
|
|
615
|
+
const w = document.createElement("input");
|
|
616
|
+
w.accept = Q || "image/png, image/jpeg, .jpg, .jpeg, .png", w.id = "upload", w.type = "file", w.className = "wgt:hidden";
|
|
617
|
+
const s = document.createElement("div");
|
|
618
|
+
s.className = "wgt:w-full wgt:flex wgt:gap-1 wgt:items-start wgt:justify-start";
|
|
619
619
|
const D = document.createElement("span");
|
|
620
620
|
D.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", D.innerText = C || "", C || (D.style.display = "none");
|
|
621
621
|
let o = null;
|
|
@@ -626,24 +626,24 @@ function hC({
|
|
|
626
626
|
title: a("uploadFile"),
|
|
627
627
|
className: "wgt:bg-primary wgt:hover:bg-primary-dark wgt:text-white wgt:px-6 wgt:py-1 wgt:rounded-md wgt:cursor-pointer",
|
|
628
628
|
handleClick: (r) => {
|
|
629
|
-
r.stopPropagation(),
|
|
629
|
+
r.stopPropagation(), w.click();
|
|
630
630
|
}
|
|
631
631
|
});
|
|
632
632
|
function R(r, P = 2) {
|
|
633
633
|
if (r === 0) return "0 Bytes";
|
|
634
|
-
const Y = 1024, T = Math.max(0, P), m = ["Bytes", "KB", "MB", "GB", "TB"],
|
|
635
|
-
return parseFloat((r / Math.pow(Y,
|
|
634
|
+
const Y = 1024, T = Math.max(0, P), m = ["Bytes", "KB", "MB", "GB", "TB"], f = Math.floor(Math.log(r) / Math.log(Y));
|
|
635
|
+
return parseFloat((r / Math.pow(Y, f)).toFixed(T)) + " " + m[f];
|
|
636
636
|
}
|
|
637
637
|
function M(r) {
|
|
638
638
|
const P = r.type.toLowerCase(), Y = "." + r.name.split(".").pop().toLowerCase();
|
|
639
|
-
return
|
|
639
|
+
return w.accept.split(",").map((m) => m.trim().toLowerCase()).filter(Boolean).some((m) => m.startsWith(".") ? m === Y : m.endsWith("/*") ? P.startsWith(m.replace("/*", "")) : P === m);
|
|
640
640
|
}
|
|
641
641
|
function d(r) {
|
|
642
|
-
if (
|
|
643
|
-
M(r) || i(`File không hợp lệ. Chỉ chấp nhận: ${
|
|
642
|
+
if (s.innerHTML = "", i(null), r) {
|
|
643
|
+
M(r) || i(`File không hợp lệ. Chỉ chấp nhận: ${w.accept}`), r.size <= 500 * 1024 || i("Dung lượng file vượt quá 500KB.");
|
|
644
644
|
const Y = document.createElement("div");
|
|
645
645
|
if (Y.className = "wgt:flex wgt:items-center wgt:gap-4", Y.addEventListener("click", () => {
|
|
646
|
-
|
|
646
|
+
w.click();
|
|
647
647
|
}), r.type.startsWith("image/")) {
|
|
648
648
|
const v = document.createElement("img");
|
|
649
649
|
v.src = URL.createObjectURL(r), v.alt = "Preview", v.className = "wgt:h-20 wgt:w-20 wgt:rounded wgt:object-contain wgt:rounded", Y.appendChild(v);
|
|
@@ -652,17 +652,17 @@ function hC({
|
|
|
652
652
|
T.className = "wgt:flex wgt:flex-col";
|
|
653
653
|
const m = document.createElement("p");
|
|
654
654
|
m.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", m.innerText = r.name;
|
|
655
|
-
const
|
|
656
|
-
|
|
655
|
+
const f = document.createElement("p");
|
|
656
|
+
f.className = "wgt:text-sm wgt:text-gray-500", f.innerText = R(r.size), T.appendChild(m), T.appendChild(f), Y.appendChild(T), s.appendChild(Y), E = r, typeof B == "function" && B(r);
|
|
657
657
|
} else {
|
|
658
658
|
const P = document.createElement("div");
|
|
659
|
-
P.className = "wgt:flex wgt:items-center", P.appendChild(u),
|
|
659
|
+
P.className = "wgt:flex wgt:items-center", P.appendChild(u), s.appendChild(P);
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
return
|
|
662
|
+
return w.addEventListener("change", (r) => {
|
|
663
663
|
const P = r.target.files && r.target.files[0] ? r.target.files[0] : null;
|
|
664
664
|
P && (d(P), typeof B == "function" && B(P));
|
|
665
|
-
}), d(E),
|
|
665
|
+
}), d(E), c.appendChild(s), c.appendChild(w), t.appendChild(c), t.appendChild(D), {
|
|
666
666
|
container: t,
|
|
667
667
|
getValues() {
|
|
668
668
|
return E;
|
|
@@ -712,8 +712,8 @@ function Xg(g) {
|
|
|
712
712
|
const C = String.raw`\p{Lu}(?:\p{Ll}+|[’']\p{Lu}\p{Ll}+)(?:[’'-]\p{Lu}\p{Ll}+)*`, Q = String.raw`\p{Lu}`, t = String.raw`(?:${Q}|${C})`;
|
|
713
713
|
B = new RegExp(`^${t}(?: ${t})+$`, "u");
|
|
714
714
|
} else {
|
|
715
|
-
const C = "AĂÂBCDĐEÊGHIKLMNOÔƠPQRSTUƯVXYÀÁẢÃẠẰẮẲẴẶẦẤẨẪẬÈÉẺẼẸỀẾỂỄỆÌÍỈĨỊÒÓỎÕỌỒỐỔỖỘỜỚỞỠỢÙÚỦŨỤỪỨỬỮỰỲÝỶỸỴ", Q = "aăâbcdđeêghiklmnxoôơpqrstưuvxyàáảãạằắẳẵặầấẩẫậèéẻẽẹềếểễệìíỉĩịòóỏõọồốổỗộờớởỡợùúủũụừứửữựỳýỷỹỵ", t = `[${C}]`, n = `[${Q}]`, I = `${t}(?:${n}+|[’']${t}${n}+)(?:[’'-]${t}${n}+)*`,
|
|
716
|
-
B = new RegExp(`^${
|
|
715
|
+
const C = "AĂÂBCDĐEÊGHIKLMNOÔƠPQRSTUƯVXYÀÁẢÃẠẰẮẲẴẶẦẤẨẪẬÈÉẺẼẸỀẾỂỄỆÌÍỈĨỊÒÓỎÕỌỒỐỔỖỘỜỚỞỠỢÙÚỦŨỤỪỨỬỮỰỲÝỶỸỴ", Q = "aăâbcdđeêghiklmnxoôơpqrstưuvxyàáảãạằắẳẵặầấẩẫậèéẻẽẹềếểễệìíỉĩịòóỏõọồốổỗộờớởỡợùúủũụừứửữựỳýỷỹỵ", t = `[${C}]`, n = `[${Q}]`, I = `${t}(?:${n}+|[’']${t}${n}+)(?:[’'-]${t}${n}+)*`, w = `(?:${`${t}`}|${I})`;
|
|
716
|
+
B = new RegExp(`^${w}(?: ${w})+$`);
|
|
717
717
|
}
|
|
718
718
|
return B.test(A);
|
|
719
719
|
}
|
|
@@ -749,17 +749,17 @@ function cC({
|
|
|
749
749
|
].join(" "), t.append(n);
|
|
750
750
|
const I = document.createElement("input");
|
|
751
751
|
I.type = "file", I.accept = "image/png, image/jpeg, image/jpg", I.className = "wgt:hidden", n.append(I);
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
const
|
|
755
|
-
|
|
752
|
+
const c = document.createElement("div");
|
|
753
|
+
c.className = "wgt:w-10 wgt:h-10 wgt:rounded-full wgt:bg-primary/16 wgt:flex wgt:items-center wgt:justify-center";
|
|
754
|
+
const w = dQ(Q);
|
|
755
|
+
c.innerHTML = `
|
|
756
756
|
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
757
|
-
<path d="M8.83184 0.96875H10.3485C10.4833 0.96875 10.5507 1.03316 10.5507 1.16199V18.1668C10.5507 18.2956 10.4833 18.3601 10.3485 18.3601H8.83184C8.69702 18.3601 8.62962 18.2956 8.62962 18.1668V1.16199C8.62962 1.03316 8.69702 0.96875 8.83184 0.96875Z" fill="${
|
|
758
|
-
<path d="M1.09676 8.74653H18.0836C18.2184 8.74653 18.2858 8.81094 18.2858 8.93976V10.389C18.2858 10.5179 18.2184 10.5823 18.0836 10.5823H1.09676C0.961939 10.5823 0.894531 10.5179 0.894531 10.389V8.93976C0.894531 8.81094 0.961939 8.74653 1.09676 8.74653Z" fill="${
|
|
757
|
+
<path d="M8.83184 0.96875H10.3485C10.4833 0.96875 10.5507 1.03316 10.5507 1.16199V18.1668C10.5507 18.2956 10.4833 18.3601 10.3485 18.3601H8.83184C8.69702 18.3601 8.62962 18.2956 8.62962 18.1668V1.16199C8.62962 1.03316 8.69702 0.96875 8.83184 0.96875Z" fill="${w}"/>
|
|
758
|
+
<path d="M1.09676 8.74653H18.0836C18.2184 8.74653 18.2858 8.81094 18.2858 8.93976V10.389C18.2858 10.5179 18.2184 10.5823 18.0836 10.5823H1.09676C0.961939 10.5823 0.894531 10.5179 0.894531 10.389V8.93976C0.894531 8.81094 0.961939 8.74653 1.09676 8.74653Z" fill="${w}"/>
|
|
759
759
|
</svg>
|
|
760
760
|
`;
|
|
761
|
-
const
|
|
762
|
-
|
|
761
|
+
const s = document.createElement("div");
|
|
762
|
+
s.className = "wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", s.innerText = A, n.append(c, s);
|
|
763
763
|
const D = document.createElement("div");
|
|
764
764
|
D.className = "wgt:text-sm wgt:font-medium wgt:text-soft-400", D.innerText = E, t.append(D);
|
|
765
765
|
const o = document.createElement("span");
|
|
@@ -771,8 +771,8 @@ function cC({
|
|
|
771
771
|
let R = g || null;
|
|
772
772
|
function M(P, Y = 2) {
|
|
773
773
|
if (P === 0) return "0 Bytes";
|
|
774
|
-
const T = 1024, m = Math.max(0, Y),
|
|
775
|
-
return parseFloat((P / Math.pow(T, v)).toFixed(m)) + " " +
|
|
774
|
+
const T = 1024, m = Math.max(0, Y), f = ["Bytes", "KB", "MB", "GB", "TB"], v = Math.floor(Math.log(P) / Math.log(T));
|
|
775
|
+
return parseFloat((P / Math.pow(T, v)).toFixed(m)) + " " + f[v];
|
|
776
776
|
}
|
|
777
777
|
function d(P) {
|
|
778
778
|
n.innerHTML = "", u(null);
|
|
@@ -785,17 +785,17 @@ function cC({
|
|
|
785
785
|
} else {
|
|
786
786
|
const m = document.createElement("div");
|
|
787
787
|
m.className = "wgt:flex wgt:items-center wgt:gap-4";
|
|
788
|
-
const
|
|
789
|
-
|
|
788
|
+
const f = document.createElement("div");
|
|
789
|
+
f.className = "wgt:flex wgt:flex-col";
|
|
790
790
|
const v = document.createElement("p");
|
|
791
791
|
v.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", v.innerText = P.name;
|
|
792
792
|
const k = document.createElement("p");
|
|
793
|
-
k.className = "wgt:text-sm wgt:text-gray-500", k.innerText = M(P.size),
|
|
793
|
+
k.className = "wgt:text-sm wgt:text-gray-500", k.innerText = M(P.size), f.appendChild(v), f.appendChild(k), m.appendChild(f), n.appendChild(m), typeof B == "function" && B(null, P);
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
function r(P) {
|
|
797
797
|
const Y = P.type.toLowerCase(), T = "." + P.name.split(".").pop().toLowerCase();
|
|
798
|
-
return I.accept.split(",").map((
|
|
798
|
+
return I.accept.split(",").map((f) => f.trim().toLowerCase()).filter(Boolean).some((f) => f.startsWith(".") ? f === T : f.endsWith("/*") ? Y.startsWith(f.replace("/*", "")) : Y === f);
|
|
799
799
|
}
|
|
800
800
|
return I.addEventListener("change", () => {
|
|
801
801
|
var Y;
|
|
@@ -817,27 +817,27 @@ function xQ({ frontFile: g, backFile: A, onFrontChange: E, onBackChange: B, them
|
|
|
817
817
|
n.className = "wgt:text-red-500 wgt:ml-1", n.innerText = "*", t.appendChild(n), Q.append(t);
|
|
818
818
|
const I = document.createElement("div");
|
|
819
819
|
I.className = "wgt:w-full wgt:grid wgt:grid-cols-2 wgt:gap-4", Q.append(I);
|
|
820
|
-
const
|
|
820
|
+
const c = cC({
|
|
821
821
|
file: g,
|
|
822
822
|
placeholder: a("uploadFrontId"),
|
|
823
823
|
caption: a("frontIdCard"),
|
|
824
824
|
onFileSelected: E,
|
|
825
825
|
theme: C
|
|
826
|
-
}),
|
|
826
|
+
}), w = cC({
|
|
827
827
|
file: A,
|
|
828
828
|
placeholder: a("uploadBackId"),
|
|
829
829
|
caption: a("backIdCard"),
|
|
830
830
|
onFileSelected: B,
|
|
831
831
|
theme: C
|
|
832
832
|
});
|
|
833
|
-
return I.append(
|
|
833
|
+
return I.append(c.container, w.container), {
|
|
834
834
|
container: Q,
|
|
835
|
-
getFrontFile: () =>
|
|
836
|
-
getBackFile: () =>
|
|
837
|
-
getFrontFileError: () =>
|
|
838
|
-
getBackFileError: () =>
|
|
839
|
-
setFrontFileError:
|
|
840
|
-
setBackFileError:
|
|
835
|
+
getFrontFile: () => c.getFile(),
|
|
836
|
+
getBackFile: () => w.getFile(),
|
|
837
|
+
getFrontFileError: () => c.getError(),
|
|
838
|
+
getBackFileError: () => w.getError(),
|
|
839
|
+
setFrontFileError: c.setError,
|
|
840
|
+
setBackFileError: w.setError
|
|
841
841
|
};
|
|
842
842
|
}
|
|
843
843
|
const HQ = ({
|
|
@@ -855,10 +855,10 @@ const HQ = ({
|
|
|
855
855
|
n.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
856
856
|
const I = document.createElement("span");
|
|
857
857
|
I.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal", I.textContent = a("invoiceTemplate");
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
|
|
858
|
+
const c = document.createElement("span");
|
|
859
|
+
c.className = "wgt:text-red-500 wgt:ml-1", c.innerText = "*", I.appendChild(c), n.append(I);
|
|
860
|
+
const w = document.createElement("div");
|
|
861
|
+
w.className = [
|
|
862
862
|
"wgt:w-full",
|
|
863
863
|
"wgt:flex",
|
|
864
864
|
"wgt:@max-2xl:flex-col",
|
|
@@ -870,15 +870,15 @@ const HQ = ({
|
|
|
870
870
|
"wgt:select-none",
|
|
871
871
|
"wgt:@max-2xl:p-2",
|
|
872
872
|
"wgt:@max-2xl:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-3 wgt:@max-2xl:space-y-2 wgt:@max-2xl:rounded-xl wgt:@max-2xl:bg-weak-50"
|
|
873
|
-
].join(" "),
|
|
874
|
-
const
|
|
873
|
+
].join(" "), w.style.scrollSnapType = "x mandatory", w.style.overflowX = "auto", w.style.scrollBehavior = "smooth", w.style.scrollbarWidth = "none", w.style.msOverflowStyle = "none", w.style.WebkitOverflowScrolling = "touch", w.style.overflowY = "hidden", n.append(w);
|
|
874
|
+
const s = "wgt:border wgt:border-gray-300 wgt:bg-white wgt:rounded-lg wgt:px-3 wgt:py-2 wgt:text-start wgt:cursor-pointer wgt:outline-none", D = document.createElement("div");
|
|
875
875
|
D.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
876
876
|
const o = document.createElement("span");
|
|
877
877
|
o.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", o.textContent = a("sampleNumber");
|
|
878
878
|
const i = document.createElement("span");
|
|
879
879
|
i.className = "wgt:text-red-500 wgt:ml-1", i.innerText = "*", o.appendChild(i), D.appendChild(o);
|
|
880
880
|
const u = document.createElement("select");
|
|
881
|
-
u.className = `${
|
|
881
|
+
u.className = `${s} wgt:@max-2xl:w-full wgt:w-48`, u.title = a("sampleNumberTooltip", "Mẫu số hóa đơn (1-9)");
|
|
882
882
|
const R = {
|
|
883
883
|
1: a("invoiceTemplateTypes.1"),
|
|
884
884
|
2: a("invoiceTemplateTypes.2"),
|
|
@@ -892,7 +892,7 @@ const HQ = ({
|
|
|
892
892
|
};
|
|
893
893
|
C.forEach((q) => {
|
|
894
894
|
u.append(new Option(R[q], q));
|
|
895
|
-
}), D.appendChild(u),
|
|
895
|
+
}), D.appendChild(u), w.append(D);
|
|
896
896
|
const M = document.createElement("div");
|
|
897
897
|
M.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
898
898
|
const d = document.createElement("span");
|
|
@@ -900,18 +900,18 @@ const HQ = ({
|
|
|
900
900
|
const r = document.createElement("span");
|
|
901
901
|
r.className = "wgt:text-red-500 wgt:ml-1", r.innerText = "*", d.appendChild(r), M.appendChild(d);
|
|
902
902
|
const P = document.createElement("select");
|
|
903
|
-
P.className = `${
|
|
903
|
+
P.className = `${s} wgt:@max-2xl:w-full wgt:w-40`, P.title = a("codeTypeTooltip", "C: Có mã CQT, K: Không mã"), Q.forEach((q) => {
|
|
904
904
|
const l = q === "C" ? a("codeTypeC", "C (Có mã CQT)") : a("codeTypeK", "K (Không mã)");
|
|
905
905
|
P.append(new Option(l, q));
|
|
906
|
-
}), M.appendChild(P),
|
|
906
|
+
}), M.appendChild(P), w.append(M);
|
|
907
907
|
const Y = document.createElement("div");
|
|
908
908
|
Y.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
909
909
|
const T = document.createElement("span");
|
|
910
910
|
T.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", T.textContent = a("invoiceIssuanceYear");
|
|
911
911
|
const m = document.createElement("span");
|
|
912
912
|
m.className = "wgt:text-red-500 wgt:ml-1", m.innerText = "*", T.appendChild(m), Y.appendChild(T);
|
|
913
|
-
const
|
|
914
|
-
|
|
913
|
+
const f = document.createElement("select");
|
|
914
|
+
f.className = `${s} wgt:@max-2xl:w-full wgt:w-16`, f.title = a("yearTooltip", "Năm phát hành (2 chữ số cuối)"), B.forEach((q) => f.append(new Option(q, q))), f.value = String(E).slice(-2), Y.appendChild(f), w.append(Y);
|
|
915
915
|
const v = document.createElement("div");
|
|
916
916
|
v.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
917
917
|
const k = document.createElement("span");
|
|
@@ -919,7 +919,7 @@ const HQ = ({
|
|
|
919
919
|
const H = document.createElement("span");
|
|
920
920
|
H.className = "wgt:text-red-500 wgt:ml-1", H.innerText = "*", k.appendChild(H), v.appendChild(k);
|
|
921
921
|
const F = document.createElement("select");
|
|
922
|
-
F.className = `${
|
|
922
|
+
F.className = `${s} wgt:@max-2xl:w-full wgt:w-40`, F.title = a("invoiceTypeTooltip", "Loại hóa đơn");
|
|
923
923
|
const x = {
|
|
924
924
|
T: a("invoiceTypeT", "T (Đăng ký)"),
|
|
925
925
|
D: a("invoiceTypeD", "D (Tài sản)"),
|
|
@@ -933,7 +933,7 @@ const HQ = ({
|
|
|
933
933
|
};
|
|
934
934
|
t.forEach((q) => {
|
|
935
935
|
F.append(new Option(x[q], q));
|
|
936
|
-
}), v.appendChild(F),
|
|
936
|
+
}), v.appendChild(F), w.append(v);
|
|
937
937
|
const X = document.createElement("div");
|
|
938
938
|
X.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
939
939
|
const U = document.createElement("span");
|
|
@@ -941,20 +941,20 @@ const HQ = ({
|
|
|
941
941
|
const j = document.createElement("span");
|
|
942
942
|
j.className = "wgt:text-red-500 wgt:ml-1", j.innerText = "*", U.appendChild(j), X.appendChild(U);
|
|
943
943
|
const O = document.createElement("input");
|
|
944
|
-
O.type = "text", O.maxLength = 2, O.placeholder = "AB", O.defaultValue = "YY", O.className = `${
|
|
944
|
+
O.type = "text", O.maxLength = 2, O.placeholder = "AB", O.defaultValue = "YY", O.className = `${s} wgt:@max-2xl:w-full wgt:w-16`, O.title = a("customLettersTooltip"), X.appendChild(O), w.append(X);
|
|
945
945
|
function e() {
|
|
946
|
-
return u.value + P.value +
|
|
946
|
+
return u.value + P.value + f.value + F.value + O.value.toUpperCase();
|
|
947
947
|
}
|
|
948
948
|
function h() {
|
|
949
949
|
O.value = O.value.toUpperCase().replace(/[^A-Z]/g, "").slice(0, 2), typeof g == "function" && g(e());
|
|
950
950
|
}
|
|
951
|
-
return [u, P,
|
|
951
|
+
return [u, P, f, F].forEach(
|
|
952
952
|
(q) => q.addEventListener("change", h)
|
|
953
|
-
), O.addEventListener("input", h), O.addEventListener("blur", h), /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(A) ? (u.value = A[0], P.value = A[1],
|
|
953
|
+
), O.addEventListener("input", h), O.addEventListener("blur", h), /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(A) ? (u.value = A[0], P.value = A[1], f.value = A.slice(2, 4), F.value = A[4], O.value = A.slice(5, 7)) : (u.value = "1", P.value = "C", F.value = "T", O.value = "YY"), h(), {
|
|
954
954
|
container: n,
|
|
955
955
|
getValue: e,
|
|
956
956
|
setValue: (q) => {
|
|
957
|
-
typeof q != "string" || q.length !== 7 || /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(q) && (u.value = q[0], P.value = q[1],
|
|
957
|
+
typeof q != "string" || q.length !== 7 || /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(q) && (u.value = q[0], P.value = q[1], f.value = q.slice(2, 4), F.value = q[4], O.value = q.slice(5, 7), h());
|
|
958
958
|
}
|
|
959
959
|
};
|
|
960
960
|
}, LA = cQ.create({
|
|
@@ -1040,14 +1040,14 @@ function FQ() {
|
|
|
1040
1040
|
C ? e.addEventListener(h, q, !!l) : e.attachEvent("on" + h, q);
|
|
1041
1041
|
}, I = function(e, h, q, l) {
|
|
1042
1042
|
C ? e.removeEventListener(h, q, !!l) : e.detachEvent("on" + h, q);
|
|
1043
|
-
},
|
|
1043
|
+
}, c = function(e) {
|
|
1044
1044
|
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
|
|
1045
|
-
},
|
|
1045
|
+
}, w = function(e, h) {
|
|
1046
1046
|
return (" " + e.className + " ").indexOf(" " + h + " ") !== -1;
|
|
1047
|
-
},
|
|
1048
|
-
|
|
1047
|
+
}, s = function(e, h) {
|
|
1048
|
+
w(e, h) || (e.className = e.className === "" ? h : e.className + " " + h);
|
|
1049
1049
|
}, D = function(e, h) {
|
|
1050
|
-
e.className =
|
|
1050
|
+
e.className = c((" " + e.className + " ").replace(" " + h + " ", " "));
|
|
1051
1051
|
}, o = function(e) {
|
|
1052
1052
|
return /Array/.test(Object.prototype.toString.call(e));
|
|
1053
1053
|
}, i = function(e) {
|
|
@@ -1157,7 +1157,7 @@ function FQ() {
|
|
|
1157
1157
|
onDraw: null,
|
|
1158
1158
|
// Enable keyboard input
|
|
1159
1159
|
keyboardInput: !0
|
|
1160
|
-
},
|
|
1160
|
+
}, f = function(e, h, q) {
|
|
1161
1161
|
for (h += e.firstDay; h >= 7; )
|
|
1162
1162
|
h -= 7;
|
|
1163
1163
|
return q ? e.i18n.weekdaysShort[h] : e.i18n.weekdays[h];
|
|
@@ -1187,7 +1187,7 @@ function FQ() {
|
|
|
1187
1187
|
}, X = function(e) {
|
|
1188
1188
|
var h, q = [];
|
|
1189
1189
|
for (e.showWeekNumber && q.push("<th></th>"), h = 0; h < 7; h++)
|
|
1190
|
-
q.push('<th scope="col"><abbr title="' +
|
|
1190
|
+
q.push('<th scope="col"><abbr title="' + f(e, h) + '">' + f(e, h, !0) + "</abbr></th>");
|
|
1191
1191
|
return "<thead><tr>" + (e.isRTL ? q.reverse() : q).join("") + "</tr></thead>";
|
|
1192
1192
|
}, U = function(e, h, q, l, N, L) {
|
|
1193
1193
|
var b, y, AA, S = e._o, IA = q === S.minYear, nA = q === S.maxYear, uA = '<div id="' + L + '" class="pika-title" role="heading" aria-live="assertive">', zA, dA, kA = !0, mA = !0;
|
|
@@ -1205,9 +1205,9 @@ function FQ() {
|
|
|
1205
1205
|
N = N || window.event;
|
|
1206
1206
|
var L = N.target || N.srcElement;
|
|
1207
1207
|
if (L)
|
|
1208
|
-
if (
|
|
1208
|
+
if (w(L, "is-disabled") || (w(L, "pika-button") && !w(L, "is-empty") && !w(L.parentNode, "is-disabled") ? (h.setDate(new Date(L.getAttribute("data-pika-year"), L.getAttribute("data-pika-month"), L.getAttribute("data-pika-day"))), q.bound && t(function() {
|
|
1209
1209
|
h.hide(), q.blurFieldOnSelect && q.field && q.field.blur();
|
|
1210
|
-
}, 100)) :
|
|
1210
|
+
}, 100)) : w(L, "pika-prev") ? h.prevMonth() : w(L, "pika-next") && h.nextMonth()), w(L, "pika-select"))
|
|
1211
1211
|
h._c = !0;
|
|
1212
1212
|
else if (N.preventDefault)
|
|
1213
1213
|
N.preventDefault();
|
|
@@ -1217,7 +1217,7 @@ function FQ() {
|
|
|
1217
1217
|
}, h._onChange = function(N) {
|
|
1218
1218
|
N = N || window.event;
|
|
1219
1219
|
var L = N.target || N.srcElement;
|
|
1220
|
-
L && (
|
|
1220
|
+
L && (w(L, "pika-select-month") ? h.gotoMonth(L.value) : w(L, "pika-select-year") && h.gotoYear(L.value));
|
|
1221
1221
|
}, h._onKeyChange = function(N) {
|
|
1222
1222
|
if (N = N || window.event, h.isVisible())
|
|
1223
1223
|
switch (N.keyCode) {
|
|
@@ -1260,7 +1260,7 @@ function FQ() {
|
|
|
1260
1260
|
}, h._onInputBlur = function() {
|
|
1261
1261
|
var N = Q.activeElement;
|
|
1262
1262
|
do
|
|
1263
|
-
if (
|
|
1263
|
+
if (w(N, "pika-single"))
|
|
1264
1264
|
return;
|
|
1265
1265
|
while (N = N.parentNode);
|
|
1266
1266
|
h._c || (h._b = t(function() {
|
|
@@ -1270,9 +1270,9 @@ function FQ() {
|
|
|
1270
1270
|
N = N || window.event;
|
|
1271
1271
|
var L = N.target || N.srcElement, b = L;
|
|
1272
1272
|
if (L) {
|
|
1273
|
-
!C &&
|
|
1273
|
+
!C && w(L, "pika-select") && (L.onchange || (L.setAttribute("onchange", "return;"), n(L, "change", h._onChange)));
|
|
1274
1274
|
do
|
|
1275
|
-
if (
|
|
1275
|
+
if (w(b, "pika-single") || b === q.trigger)
|
|
1276
1276
|
return;
|
|
1277
1277
|
while (b = b.parentNode);
|
|
1278
1278
|
h._v && L !== q.trigger && b !== q.trigger && h.hide();
|
|
@@ -1428,7 +1428,7 @@ function FQ() {
|
|
|
1428
1428
|
else
|
|
1429
1429
|
for (y = h.offsetLeft, AA = h.offsetTop + h.offsetHeight; h = h.offsetParent; )
|
|
1430
1430
|
y += h.offsetLeft, AA += h.offsetTop;
|
|
1431
|
-
(this._o.reposition && y + q > N || this._o.position.indexOf("right") > -1 && y - q + e.offsetWidth > 0) && (y = y - q + e.offsetWidth, IA = !1), (this._o.reposition && AA + l > L + b || this._o.position.indexOf("top") > -1 && AA - l - e.offsetHeight > 0) && (AA = AA - l - e.offsetHeight, nA = !1), this.el.style.left = y + "px", this.el.style.top = AA + "px",
|
|
1431
|
+
(this._o.reposition && y + q > N || this._o.position.indexOf("right") > -1 && y - q + e.offsetWidth > 0) && (y = y - q + e.offsetWidth, IA = !1), (this._o.reposition && AA + l > L + b || this._o.position.indexOf("top") > -1 && AA - l - e.offsetHeight > 0) && (AA = AA - l - e.offsetHeight, nA = !1), this.el.style.left = y + "px", this.el.style.top = AA + "px", s(this.el, IA ? "left-aligned" : "right-aligned"), s(this.el, nA ? "bottom-aligned" : "top-aligned"), D(this.el, IA ? "right-aligned" : "left-aligned"), D(this.el, nA ? "top-aligned" : "bottom-aligned");
|
|
1432
1432
|
}
|
|
1433
1433
|
},
|
|
1434
1434
|
/**
|
|
@@ -1470,7 +1470,7 @@ function FQ() {
|
|
|
1470
1470
|
},
|
|
1471
1471
|
hide: function() {
|
|
1472
1472
|
var e = this._v;
|
|
1473
|
-
e !== !1 && (this._o.bound && I(Q, "click", this._onClick), this._o.container || (this.el.style.position = "static", this.el.style.left = "auto", this.el.style.top = "auto"),
|
|
1473
|
+
e !== !1 && (this._o.bound && I(Q, "click", this._onClick), this._o.container || (this.el.style.position = "static", this.el.style.left = "auto", this.el.style.top = "auto"), s(this.el, "is-hidden"), this._v = !1, e !== void 0 && typeof this._o.onClose == "function" && this._o.onClose.call(this));
|
|
1474
1474
|
},
|
|
1475
1475
|
/**
|
|
1476
1476
|
* GAME OVER
|
|
@@ -1550,7 +1550,7 @@ function bQ(g, A, E) {
|
|
|
1550
1550
|
"wgt:relative",
|
|
1551
1551
|
"wgt:overflow-hidden"
|
|
1552
1552
|
].join(" ");
|
|
1553
|
-
const
|
|
1553
|
+
const c = {
|
|
1554
1554
|
info: "#40A9FF",
|
|
1555
1555
|
// Blue
|
|
1556
1556
|
success: "#52C41A",
|
|
@@ -1560,25 +1560,25 @@ function bQ(g, A, E) {
|
|
|
1560
1560
|
error: "#FF4D4F"
|
|
1561
1561
|
// Red
|
|
1562
1562
|
};
|
|
1563
|
-
I.style.borderLeft = `4px solid ${
|
|
1564
|
-
const
|
|
1565
|
-
if (
|
|
1563
|
+
I.style.borderLeft = `4px solid ${c[t] || c.info}`, I.style.zIndex = "99999";
|
|
1564
|
+
const w = document.createElement("div");
|
|
1565
|
+
if (w.className = "wgt:flex wgt:items-start wgt:gap-3", Q) {
|
|
1566
1566
|
const D = document.createElement("div"), o = {
|
|
1567
1567
|
info: "wgt:bg-blue-500",
|
|
1568
1568
|
success: "wgt:bg-green-500",
|
|
1569
1569
|
warning: "wgt:bg-orange-500",
|
|
1570
1570
|
error: "wgt:bg-red-500"
|
|
1571
1571
|
};
|
|
1572
|
-
D.className = `wgt:flex-shrink-0 wgt:w-5 wgt:h-5 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center wgt:mt-0.5 ${o[t] || o.info}`, D.innerHTML = '<span class="wgt:text-white wgt:text-xs wgt:font-bold">!</span>',
|
|
1572
|
+
D.className = `wgt:flex-shrink-0 wgt:w-5 wgt:h-5 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center wgt:mt-0.5 ${o[t] || o.info}`, D.innerHTML = '<span class="wgt:text-white wgt:text-xs wgt:font-bold">!</span>', w.appendChild(D);
|
|
1573
1573
|
}
|
|
1574
|
-
const
|
|
1575
|
-
if (
|
|
1574
|
+
const s = document.createElement("div");
|
|
1575
|
+
if (s.className = "wgt:text-sm wgt:font-medium wgt:text-gray-700 wgt:leading-5 wgt:flex-1", s.innerText = A, w.appendChild(s), C) {
|
|
1576
1576
|
const D = document.createElement("button");
|
|
1577
1577
|
D.className = "wgt:flex-shrink-0 wgt:ml-2 wgt:text-gray-400 wgt:hover:text-gray-600 wgt:text-lg wgt:leading-none", D.innerHTML = "×", D.addEventListener("click", () => {
|
|
1578
1578
|
Lg(g);
|
|
1579
|
-
}),
|
|
1579
|
+
}), w.appendChild(D);
|
|
1580
1580
|
}
|
|
1581
|
-
if (I.appendChild(
|
|
1581
|
+
if (I.appendChild(w), !B && n > 0) {
|
|
1582
1582
|
const D = document.createElement("div"), o = {
|
|
1583
1583
|
info: "wgt:bg-blue-500",
|
|
1584
1584
|
success: "wgt:bg-green-500",
|
|
@@ -1617,14 +1617,14 @@ var lg = (g, A, E) => new Promise((B, C) => {
|
|
|
1617
1617
|
var Q = (I) => {
|
|
1618
1618
|
try {
|
|
1619
1619
|
n(E.next(I));
|
|
1620
|
-
} catch (
|
|
1621
|
-
C(
|
|
1620
|
+
} catch (c) {
|
|
1621
|
+
C(c);
|
|
1622
1622
|
}
|
|
1623
1623
|
}, t = (I) => {
|
|
1624
1624
|
try {
|
|
1625
1625
|
n(E.throw(I));
|
|
1626
|
-
} catch (
|
|
1627
|
-
C(
|
|
1626
|
+
} catch (c) {
|
|
1627
|
+
C(c);
|
|
1628
1628
|
}
|
|
1629
1629
|
}, n = (I) => I.done ? B(I.value) : Promise.resolve(I.value).then(Q, t);
|
|
1630
1630
|
n((E = E.apply(g, A)).next());
|
|
@@ -1721,15 +1721,15 @@ function WQ(g, A = 640) {
|
|
|
1721
1721
|
return B.imageSmoothingEnabled = !1, B.drawImage(g, n, I, Q, t), B.getImageData(0, 0, A, A);
|
|
1722
1722
|
}
|
|
1723
1723
|
function _Q(g, A, E) {
|
|
1724
|
-
const [B, C] = A, [Q, t] = E, n = Math.min(t / C, Q / B), I = (t - C * n) / 2,
|
|
1724
|
+
const [B, C] = A, [Q, t] = E, n = Math.min(t / C, Q / B), I = (t - C * n) / 2, c = (Q - B * n) / 2, w = JSON.parse(JSON.stringify(g));
|
|
1725
1725
|
if (Array.isArray(g[0]))
|
|
1726
|
-
for (let
|
|
1727
|
-
|
|
1726
|
+
for (let s = 0; s < g.length; s++)
|
|
1727
|
+
w[s][0] = (g[s][0] - I) / n, w[s][1] = (g[s][1] - c) / n;
|
|
1728
1728
|
else if (g.length === 4)
|
|
1729
|
-
|
|
1729
|
+
w[0] = (g[0] - I) / n, w[1] = (g[1] - c) / n, w[2] = (g[2] - I) / n, w[3] = (g[3] - c) / n;
|
|
1730
1730
|
else
|
|
1731
1731
|
throw new Error("Invalid region format");
|
|
1732
|
-
return
|
|
1732
|
+
return w;
|
|
1733
1733
|
}
|
|
1734
1734
|
function $C(g, A = 640) {
|
|
1735
1735
|
const E = WQ(g, A).data, B = new Float32Array(A * A * 3);
|
|
@@ -1760,7 +1760,7 @@ function $Q(g, A, E = 200) {
|
|
|
1760
1760
|
const o = AE();
|
|
1761
1761
|
t.setTransform(...o), t.drawImage(B, 0, 0), t.setTransform(1, 0, 0, 1, 0, 0);
|
|
1762
1762
|
} else if (A.length === 4) {
|
|
1763
|
-
const [o, i, u, R] = A, M = u - o, d = R - i, r = M * 0.05, P = d * 0.05, Y = Math.max(0, o - r), T = Math.max(0, i - P), m = Math.min(B.width, u + r),
|
|
1763
|
+
const [o, i, u, R] = A, M = u - o, d = R - i, r = M * 0.05, P = d * 0.05, Y = Math.max(0, o - r), T = Math.max(0, i - P), m = Math.min(B.width, u + r), f = Math.min(B.height, R + P), v = m - Y, k = f - T;
|
|
1764
1764
|
t.drawImage(
|
|
1765
1765
|
B,
|
|
1766
1766
|
Y,
|
|
@@ -1779,16 +1779,16 @@ function $Q(g, A, E = 200) {
|
|
|
1779
1779
|
0,
|
|
1780
1780
|
E,
|
|
1781
1781
|
E
|
|
1782
|
-
), I = new ImageData(E, E),
|
|
1783
|
-
for (let o = 0; o <
|
|
1784
|
-
const i =
|
|
1785
|
-
|
|
1782
|
+
), I = new ImageData(E, E), c = n.data, w = I.data;
|
|
1783
|
+
for (let o = 0; o < c.length; o += 4) {
|
|
1784
|
+
const i = c[o], u = c[o + 1], R = c[o + 2], M = 0.2989 * i + 0.587 * u + 0.114 * R;
|
|
1785
|
+
w[o] = w[o + 1] = w[o + 2] = M, w[o + 3] = 255;
|
|
1786
1786
|
}
|
|
1787
|
-
const
|
|
1788
|
-
return
|
|
1787
|
+
const s = new ImageData(E, E), D = gE(w, E, E, 10);
|
|
1788
|
+
return s.data.set(D), {
|
|
1789
1789
|
original: n,
|
|
1790
1790
|
grayscale: I,
|
|
1791
|
-
threshold:
|
|
1791
|
+
threshold: s
|
|
1792
1792
|
};
|
|
1793
1793
|
}
|
|
1794
1794
|
function AE(g, A) {
|
|
@@ -1798,14 +1798,14 @@ function gE(g, A, E, B) {
|
|
|
1798
1798
|
const C = new Uint8ClampedArray(g.length), Q = new Uint32Array(A * E);
|
|
1799
1799
|
for (let n = 0; n < E; n++)
|
|
1800
1800
|
for (let I = 0; I < A; I++) {
|
|
1801
|
-
const
|
|
1802
|
-
Q[
|
|
1801
|
+
const c = (n * A + I) * 4, w = g[c], s = n * A + I;
|
|
1802
|
+
Q[s] = w + (I > 0 ? Q[s - 1] : 0) + (n > 0 ? Q[s - A] : 0) - (I > 0 && n > 0 ? Q[s - A - 1] : 0);
|
|
1803
1803
|
}
|
|
1804
1804
|
const t = Math.floor(B / 2);
|
|
1805
1805
|
for (let n = 0; n < E; n++)
|
|
1806
1806
|
for (let I = 0; I < A; I++) {
|
|
1807
|
-
const
|
|
1808
|
-
C[
|
|
1807
|
+
const c = (n * A + I) * 4, w = Math.max(I - t, 0), s = Math.max(n - t, 0), D = Math.min(I + t, A - 1), o = Math.min(n + t, E - 1), i = (D - w + 1) * (o - s + 1), u = (Q[o * A + D] - (w > 0 ? Q[o * A + w - 1] : 0) - (s > 0 ? Q[(s - 1) * A + D] : 0) + (w > 0 && s > 0 ? Q[(s - 1) * A + w - 1] : 0)) / i * 0.9, R = g[c] > u ? 255 : 0;
|
|
1808
|
+
C[c] = C[c + 1] = C[c + 2] = R, C[c + 3] = 255;
|
|
1809
1809
|
}
|
|
1810
1810
|
return C;
|
|
1811
1811
|
}
|
|
@@ -1818,8 +1818,8 @@ function BE(g) {
|
|
|
1818
1818
|
E.width = g.width, E.height = g.height, E.getContext("2d").drawImage(g, 0, 0);
|
|
1819
1819
|
const B = $C(g, 224), C = yield A.run({ images: B }), Q = C[Object.keys(C)[0]].data;
|
|
1820
1820
|
let t = 0, n = -1 / 0;
|
|
1821
|
-
return Q.forEach((I,
|
|
1822
|
-
I > n && (n = I, t =
|
|
1821
|
+
return Q.forEach((I, c) => {
|
|
1822
|
+
I > n && (n = I, t = c);
|
|
1823
1823
|
}), JSON.stringify({
|
|
1824
1824
|
status: "success",
|
|
1825
1825
|
data: {
|
|
@@ -1844,7 +1844,7 @@ function QE(g, A, E, B, C = 0.5) {
|
|
|
1844
1844
|
for (let n = 0; n < t; n++) {
|
|
1845
1845
|
const I = g.data[n * 37 + 4];
|
|
1846
1846
|
if (I < C) continue;
|
|
1847
|
-
const
|
|
1847
|
+
const c = g.data[n * 37], w = g.data[n * 37 + 1], s = g.data[n * 37 + 2], D = g.data[n * 37 + 3], o = 1, i = 1, u = [c, w, s, D], R = g.data.slice(n * 37 + 5, n * 37 + 37), M = new Float32Array(25600);
|
|
1848
1848
|
for (let x = 0; x < 160; x++)
|
|
1849
1849
|
for (let X = 0; X < 160; X++) {
|
|
1850
1850
|
let U = 0;
|
|
@@ -1855,9 +1855,9 @@ function QE(g, A, E, B, C = 0.5) {
|
|
|
1855
1855
|
const d = CE();
|
|
1856
1856
|
let r = d.length > 0 ? d[0] : [], P = r.length >= 4 ? r.slice(0, 4) : u;
|
|
1857
1857
|
P = P.map((x) => [x[0] * o, x[1] * i]);
|
|
1858
|
-
const Y = 0.1, T = Math.min(...P.map((x) => x[0])), m = Math.max(...P.map((x) => x[0])),
|
|
1858
|
+
const Y = 0.1, T = Math.min(...P.map((x) => x[0])), m = Math.max(...P.map((x) => x[0])), f = Math.min(...P.map((x) => x[1])), v = Math.max(...P.map((x) => x[1])), k = m - T, H = v - f, F = P.map((x) => [
|
|
1859
1859
|
x[0] + (x[0] < (T + m) / 2 ? -Y * k : Y * k),
|
|
1860
|
-
x[1] + (x[1] < (
|
|
1860
|
+
x[1] + (x[1] < (f + v) / 2 ? -Y * H : Y * H)
|
|
1861
1861
|
]);
|
|
1862
1862
|
Q.push({
|
|
1863
1863
|
bbox_xyxy: u,
|
|
@@ -1934,9 +1934,9 @@ function tE(g, A = "sourceCanvas") {
|
|
|
1934
1934
|
g.width,
|
|
1935
1935
|
g.height
|
|
1936
1936
|
);
|
|
1937
|
-
for (const
|
|
1938
|
-
const { _:
|
|
1939
|
-
|
|
1937
|
+
for (const c of I) {
|
|
1938
|
+
const { _: w, bbox_xyxy: s } = c, D = _Q(
|
|
1939
|
+
s,
|
|
1940
1940
|
[g.height, g.width],
|
|
1941
1941
|
[640, 640]
|
|
1942
1942
|
), o = $Q(B, D), i = yield IE(o);
|
|
@@ -1976,9 +1976,9 @@ function cE(D) {
|
|
|
1976
1976
|
dobPicker: t,
|
|
1977
1977
|
setDobPicker: n,
|
|
1978
1978
|
isNewCustomer: I,
|
|
1979
|
-
handleCheckNewCustomer:
|
|
1980
|
-
updateRegistrationData:
|
|
1981
|
-
serial:
|
|
1979
|
+
handleCheckNewCustomer: c,
|
|
1980
|
+
updateRegistrationData: w,
|
|
1981
|
+
serial: s
|
|
1982
1982
|
}) {
|
|
1983
1983
|
var MA, oA, cA, wA, eA, rA, sA, TA, SA, Mg, MB, TB, lB, dB, xB, HB, kB, RB, YB, JB, XB, FB, OB, GB, LB, zB, NB, bB, jB, yB, KB, UB, SB, pB, ZB, VB, WB, _B, $B, AC, gC, BC, CC, QC;
|
|
1984
1984
|
const o = document.createElement("div");
|
|
@@ -1989,7 +1989,7 @@ function cE(D) {
|
|
|
1989
1989
|
const G = BA();
|
|
1990
1990
|
typeof g == "function" && g(G);
|
|
1991
1991
|
}), o.appendChild(i);
|
|
1992
|
-
let u, R, M, d, r, P, Y, T, m,
|
|
1992
|
+
let u, R, M, d, r, P, Y, T, m, f, v, k, H, F, x, X, U, j, O, e, h, q, l, N, L;
|
|
1993
1993
|
const b = document.createElement("button");
|
|
1994
1994
|
u = HA({
|
|
1995
1995
|
name: "taxCode",
|
|
@@ -2008,15 +2008,15 @@ function cE(D) {
|
|
|
2008
2008
|
const G = z.target.value.trim();
|
|
2009
2009
|
if (G.length >= 10)
|
|
2010
2010
|
try {
|
|
2011
|
-
yield
|
|
2011
|
+
yield c(
|
|
2012
2012
|
A == null ? void 0 : A.provider,
|
|
2013
2013
|
G,
|
|
2014
2014
|
($, EA) => W(null, null, function* () {
|
|
2015
2015
|
if ($) {
|
|
2016
2016
|
const DA = yield nA(G);
|
|
2017
|
-
|
|
2017
|
+
w(EA, DA);
|
|
2018
2018
|
} else
|
|
2019
|
-
|
|
2019
|
+
w(EA);
|
|
2020
2020
|
}),
|
|
2021
2021
|
!I
|
|
2022
2022
|
);
|
|
@@ -2099,7 +2099,7 @@ function cE(D) {
|
|
|
2099
2099
|
}
|
|
2100
2100
|
Xg(G) ? m.setError(null) : m.setError(a("errorInvalidName"));
|
|
2101
2101
|
}
|
|
2102
|
-
}),
|
|
2102
|
+
}), f = HA({
|
|
2103
2103
|
name: "repDob",
|
|
2104
2104
|
label: a("dateOfBirth"),
|
|
2105
2105
|
required: !0,
|
|
@@ -2110,17 +2110,17 @@ function cE(D) {
|
|
|
2110
2110
|
value: ((TB = (MB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : MB.legalRepresentative) == null ? void 0 : TB.dob) || ""
|
|
2111
2111
|
});
|
|
2112
2112
|
let AA = new GQ({
|
|
2113
|
-
field:
|
|
2113
|
+
field: f.inputEl,
|
|
2114
2114
|
format: "DD/MM/YYYY",
|
|
2115
2115
|
toString(z) {
|
|
2116
2116
|
const G = String(z.getMonth() + 1).padStart(2, "0"), $ = String(z.getDate()).padStart(2, "0"), EA = z.getFullYear();
|
|
2117
2117
|
return `${$}/${G}/${EA}`;
|
|
2118
2118
|
},
|
|
2119
2119
|
onSelect: (z) => {
|
|
2120
|
-
|
|
2120
|
+
f.setError(null), J();
|
|
2121
2121
|
},
|
|
2122
2122
|
onClose: () => {
|
|
2123
|
-
|
|
2123
|
+
f.inputEl.value ? f.setError(null) : f.setError(a("errorRequired")), J();
|
|
2124
2124
|
},
|
|
2125
2125
|
maxDate: /* @__PURE__ */ new Date(),
|
|
2126
2126
|
showMonthDropdown: !0,
|
|
@@ -2334,7 +2334,7 @@ function cE(D) {
|
|
|
2334
2334
|
U = HQ({
|
|
2335
2335
|
// initialValue:
|
|
2336
2336
|
// registrationData?.eInvoiceRegistration?.invoiceSymbol || "1C25TYY",
|
|
2337
|
-
initialValue:
|
|
2337
|
+
initialValue: s || ((pB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : pB.invoiceSymbol) || "1C25TYY",
|
|
2338
2338
|
onChange: (z) => {
|
|
2339
2339
|
S.inputEl.value = z, J();
|
|
2340
2340
|
}
|
|
@@ -2468,7 +2468,7 @@ function cE(D) {
|
|
|
2468
2468
|
function yA(z) {
|
|
2469
2469
|
tA = !1, YA = !1, NA();
|
|
2470
2470
|
const G = () => {
|
|
2471
|
-
H.inputEl.value = "", m.inputEl.value = "",
|
|
2471
|
+
H.inputEl.value = "", m.inputEl.value = "", f.inputEl.value = "", X.inputEl.value = "", v.selectEl.value = "", x.selectEl.value = "", H.setError(null), m.setError(null), f.setError(null), X.setError(null), v.setError(null), x.setError(null), t && typeof t.setDate == "function" && t.setDate(null);
|
|
2472
2472
|
}, $ = (DA) => {
|
|
2473
2473
|
if (!DA) return "";
|
|
2474
2474
|
if (/^\d{8}$/.test(DA)) {
|
|
@@ -2495,7 +2495,7 @@ function cE(D) {
|
|
|
2495
2495
|
const { address: OA, date_of_birth: pA, full_name: bg, id_number: dg, sex: Yg } = DA;
|
|
2496
2496
|
if (!dg || !/^\d{12}$/.test(dg) ? (cg(
|
|
2497
2497
|
a("errorInvalidCard", "Số CCCD phải có 12 chữ số")
|
|
2498
|
-
), H.inputEl.value = "") : (H.inputEl.value = dg, H.setError(null)), m.inputEl.value = bg || "",
|
|
2498
|
+
), H.inputEl.value = "") : (H.inputEl.value = dg, H.setError(null)), m.inputEl.value = bg || "", f.inputEl.value = $(pA), X.inputEl.value = OA || "", Yg) {
|
|
2499
2499
|
const eg = wC.find(
|
|
2500
2500
|
(jg) => jg.label.toLowerCase() === Yg.toLowerCase()
|
|
2501
2501
|
);
|
|
@@ -2564,7 +2564,7 @@ function cE(D) {
|
|
|
2564
2564
|
const UA = document.createElement("div");
|
|
2565
2565
|
UA.className = "wgt:space-y-4", UA.appendChild(m.container);
|
|
2566
2566
|
const rg = document.createElement("div");
|
|
2567
|
-
rg.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4", UA.appendChild(rg), rg.appendChild(
|
|
2567
|
+
rg.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4", UA.appendChild(rg), rg.appendChild(f.container), rg.appendChild(v.container), WA.appendChild(UA);
|
|
2568
2568
|
const jA = document.createElement("div");
|
|
2569
2569
|
jA.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-4 wgt:gap-4 wgt:items-start", jA.appendChild(H.container), jA.appendChild(F.container), jA.appendChild(k.container), jA.appendChild(x.container), mA.appendChild(WA), mA.appendChild(jA), mA.appendChild(X.container), mA.appendChild(l.container);
|
|
2570
2570
|
const Bg = document.createElement("ul");
|
|
@@ -2694,7 +2694,7 @@ function cE(D) {
|
|
|
2694
2694
|
},
|
|
2695
2695
|
legalRepresentative: {
|
|
2696
2696
|
name: m == null ? void 0 : m.getValue(),
|
|
2697
|
-
dob:
|
|
2697
|
+
dob: f == null ? void 0 : f.getValue(),
|
|
2698
2698
|
gender: v == null ? void 0 : v.getValue(),
|
|
2699
2699
|
phone: k == null ? void 0 : k.getValue(),
|
|
2700
2700
|
idCard: H == null ? void 0 : H.getValue(),
|
|
@@ -2721,7 +2721,7 @@ function cE(D) {
|
|
|
2721
2721
|
Y,
|
|
2722
2722
|
T,
|
|
2723
2723
|
m,
|
|
2724
|
-
|
|
2724
|
+
f,
|
|
2725
2725
|
k,
|
|
2726
2726
|
H,
|
|
2727
2727
|
X,
|
|
@@ -2794,26 +2794,26 @@ function oE({
|
|
|
2794
2794
|
].filter(Boolean).join(" "), n.onclick = Q;
|
|
2795
2795
|
const I = document.createElement("div");
|
|
2796
2796
|
I.className = "wgt:w-full", n.appendChild(I);
|
|
2797
|
-
const w = document.createElement("div");
|
|
2798
|
-
w.className = "wgt:w-full wgt:flex wgt:justify-between wgt:items-center";
|
|
2799
2797
|
const c = document.createElement("div");
|
|
2800
|
-
c.className = "wgt:flex wgt:
|
|
2801
|
-
const
|
|
2802
|
-
|
|
2798
|
+
c.className = "wgt:w-full wgt:flex wgt:justify-between wgt:items-center";
|
|
2799
|
+
const w = document.createElement("div");
|
|
2800
|
+
w.className = "wgt:flex wgt:items-center wgt:gap-2";
|
|
2801
|
+
const s = document.createElement("span");
|
|
2802
|
+
if (s.className = [
|
|
2803
2803
|
"wgt:text-base",
|
|
2804
2804
|
"wgt:font-semibold",
|
|
2805
2805
|
C ? "wgt:text-primary" : "wgt:text-text-sub-600"
|
|
2806
|
-
].join(" "),
|
|
2806
|
+
].join(" "), s.innerText = g.code, w.appendChild(s), E) {
|
|
2807
2807
|
const T = document.createElement("div");
|
|
2808
|
-
T.className = "wgt:w-fit wgt:px-2 wgt:py-0.5 wgt:rounded wgt:bg-primary wgt:text-white wgt:bg-gradient-to-r wgt:from-[#FF8447] wgt:to-[#F6B51E] wgt:text-sm wgt:font-semibold", T.innerText = B,
|
|
2808
|
+
T.className = "wgt:w-fit wgt:px-2 wgt:py-0.5 wgt:rounded wgt:bg-primary wgt:text-white wgt:bg-gradient-to-r wgt:from-[#FF8447] wgt:to-[#F6B51E] wgt:text-sm wgt:font-semibold", T.innerText = B, w.appendChild(T);
|
|
2809
2809
|
}
|
|
2810
|
-
|
|
2810
|
+
c.appendChild(w);
|
|
2811
2811
|
const { container: D } = Ng({
|
|
2812
2812
|
checked: C,
|
|
2813
2813
|
onChange: (T) => {
|
|
2814
2814
|
}
|
|
2815
2815
|
});
|
|
2816
|
-
|
|
2816
|
+
c.appendChild(D), I.appendChild(c);
|
|
2817
2817
|
const o = document.createElement("div");
|
|
2818
2818
|
o.className = "wgt:flex wgt:items-center wgt:text-gray-600 wgt:mt-2";
|
|
2819
2819
|
const i = document.createElement("div");
|
|
@@ -2823,8 +2823,8 @@ function oE({
|
|
|
2823
2823
|
`, o.appendChild(i);
|
|
2824
2824
|
const u = document.createElement("span");
|
|
2825
2825
|
if (u.className = "wgt:ml-2 wgt:text-sm", A === "signature") {
|
|
2826
|
-
const T = ag(), m = a(g.duration.unit),
|
|
2827
|
-
u.innerText = `${a("duration")}: ${g.duration.value} ${
|
|
2826
|
+
const T = ag(), m = a(g.duration.unit), f = T === "en" && g.duration.value > 1 ? m + "s" : m;
|
|
2827
|
+
u.innerText = `${a("duration")}: ${g.duration.value} ${f} `;
|
|
2828
2828
|
} else typeof (g == null ? void 0 : g.limit) == "number" ? u.innerText = `${g == null ? void 0 : g.limit.toLocaleString(
|
|
2829
2829
|
"vi-VN"
|
|
2830
2830
|
)} ${a("searchUnits")}` : u.innerText = "";
|
|
@@ -2856,8 +2856,8 @@ function oC({
|
|
|
2856
2856
|
} = {}) {
|
|
2857
2857
|
const I = document.createElement("div");
|
|
2858
2858
|
I.className = "wgt:space-y-6";
|
|
2859
|
-
const
|
|
2860
|
-
|
|
2859
|
+
const c = document.createElement("div");
|
|
2860
|
+
c.className = [
|
|
2861
2861
|
"wgt:w-full",
|
|
2862
2862
|
"wgt:grid",
|
|
2863
2863
|
"wgt:grid-flow-col",
|
|
@@ -2869,9 +2869,9 @@ function oC({
|
|
|
2869
2869
|
"wgt:snap-mandatory",
|
|
2870
2870
|
"wgt:cursor-grab",
|
|
2871
2871
|
"wgt:select-none"
|
|
2872
|
-
].join(" "),
|
|
2873
|
-
function
|
|
2874
|
-
|
|
2872
|
+
].join(" "), c.style.scrollSnapType = "x mandatory", c.style.overflowX = "auto", c.style.scrollBehavior = "smooth", c.style.scrollbarWidth = "none", c.style.msOverflowStyle = "none", c.style.WebkitOverflowScrolling = "touch", c.style.scrollbarWidth = "none", c.style.overflowY = "hidden", I.appendChild(c);
|
|
2873
|
+
function w() {
|
|
2874
|
+
c.innerHTML = "", A.forEach((i) => {
|
|
2875
2875
|
const u = i._id === C, R = E.includes(i.code), { container: M } = oE({
|
|
2876
2876
|
pkg: i,
|
|
2877
2877
|
type: g,
|
|
@@ -2883,32 +2883,32 @@ function oC({
|
|
|
2883
2883
|
typeof t == "function" && t((Q || n) && u ? "" : i._id);
|
|
2884
2884
|
}
|
|
2885
2885
|
});
|
|
2886
|
-
|
|
2886
|
+
c.appendChild(M);
|
|
2887
2887
|
});
|
|
2888
2888
|
}
|
|
2889
|
-
|
|
2890
|
-
let
|
|
2891
|
-
return
|
|
2892
|
-
|
|
2889
|
+
w();
|
|
2890
|
+
let s = !1, D, o;
|
|
2891
|
+
return c.addEventListener("mousedown", (i) => {
|
|
2892
|
+
s = !0, c.classList.replace("wgt:cursor-grab", "wgt:cursor-grabbing"), D = i.pageX - c.offsetLeft, o = c.scrollLeft;
|
|
2893
2893
|
}), document.addEventListener("mouseup", () => {
|
|
2894
|
-
|
|
2895
|
-
}),
|
|
2896
|
-
|
|
2897
|
-
}),
|
|
2898
|
-
if (!
|
|
2894
|
+
s = !1, c.classList.replace("wgt:cursor-grabbing", "wgt:cursor-grab");
|
|
2895
|
+
}), c.addEventListener("mouseleave", () => {
|
|
2896
|
+
s = !1, c.classList.replace("wgt:cursor-grabbing", "wgt:cursor-grab");
|
|
2897
|
+
}), c.addEventListener("mousemove", (i) => {
|
|
2898
|
+
if (!s) return;
|
|
2899
2899
|
i.preventDefault();
|
|
2900
|
-
const R = (i.pageX -
|
|
2901
|
-
|
|
2902
|
-
}),
|
|
2903
|
-
i.preventDefault(),
|
|
2900
|
+
const R = (i.pageX - c.offsetLeft - D) * 1.5;
|
|
2901
|
+
c.scrollLeft = o - R;
|
|
2902
|
+
}), c.addEventListener("wheel", (i) => {
|
|
2903
|
+
i.preventDefault(), c.scrollLeft += i.deltaY;
|
|
2904
2904
|
}), {
|
|
2905
2905
|
container: I,
|
|
2906
2906
|
setSelectedPackageId(i) {
|
|
2907
|
-
C = i,
|
|
2907
|
+
C = i, w();
|
|
2908
2908
|
}
|
|
2909
2909
|
};
|
|
2910
2910
|
}
|
|
2911
|
-
const aE = "1.97.
|
|
2911
|
+
const aE = "1.97.2";
|
|
2912
2912
|
function DE(E) {
|
|
2913
2913
|
return W(this, arguments, function* ({ search: g, bank: A }) {
|
|
2914
2914
|
return (yield LA.get(`${zg}`, {
|
|
@@ -3014,10 +3014,10 @@ function rE({ name: g, value: A, feeLabel: E, required: B, description: C, isChe
|
|
|
3014
3014
|
t.appendChild(n.container);
|
|
3015
3015
|
const I = document.createElement("div");
|
|
3016
3016
|
I.className = "wgt:flex wgt:flex-col wgt:gap-1";
|
|
3017
|
-
const
|
|
3018
|
-
|
|
3019
|
-
const
|
|
3020
|
-
|
|
3017
|
+
const c = document.createElement("div");
|
|
3018
|
+
c.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3019
|
+
const w = document.createElement("span");
|
|
3020
|
+
w.className = "wgt:text-base wgt:font-semibold wgt:text-text-sub-600", w.textContent = E, c.appendChild(w);
|
|
3021
3021
|
{
|
|
3022
3022
|
const D = document.createElement("span");
|
|
3023
3023
|
D.className = [
|
|
@@ -3028,11 +3028,11 @@ function rE({ name: g, value: A, feeLabel: E, required: B, description: C, isChe
|
|
|
3028
3028
|
"wgt:px-1.5",
|
|
3029
3029
|
"wgt:py-1",
|
|
3030
3030
|
"wgt:rounded-sm"
|
|
3031
|
-
].join(" "), D.textContent = a("required"),
|
|
3031
|
+
].join(" "), D.textContent = a("required"), c.appendChild(D);
|
|
3032
3032
|
}
|
|
3033
|
-
I.appendChild(
|
|
3034
|
-
const
|
|
3035
|
-
return
|
|
3033
|
+
I.appendChild(c);
|
|
3034
|
+
const s = document.createElement("p");
|
|
3035
|
+
return s.className = "wgt:text-text-soft-400 wgt:text-sm", s.textContent = C, I.appendChild(s), t.appendChild(I), { container: t };
|
|
3036
3036
|
}
|
|
3037
3037
|
function qB() {
|
|
3038
3038
|
const g = document.createElement("div");
|
|
@@ -3080,9 +3080,9 @@ function PE({
|
|
|
3080
3080
|
"wgt:text-text-sub-600",
|
|
3081
3081
|
"wgt:mb-2"
|
|
3082
3082
|
].join(" ");
|
|
3083
|
-
const
|
|
3084
|
-
I.textContent = g[
|
|
3085
|
-
const { container:
|
|
3083
|
+
const c = Hg(ag());
|
|
3084
|
+
I.textContent = g[c], t.appendChild(I);
|
|
3085
|
+
const { container: w } = Ng({
|
|
3086
3086
|
checked: g.isSelected,
|
|
3087
3087
|
onChange: () => {
|
|
3088
3088
|
let D = !g.isSelected;
|
|
@@ -3091,15 +3091,15 @@ function PE({
|
|
|
3091
3091
|
isIconCheckbox: !0,
|
|
3092
3092
|
disabled: E || g.isSelected
|
|
3093
3093
|
});
|
|
3094
|
-
|
|
3095
|
-
const
|
|
3096
|
-
return
|
|
3094
|
+
w.className = "wgt:absolute wgt:top-0 wgt:right-0", t.appendChild(w), Q.appendChild(t);
|
|
3095
|
+
const s = document.createElement("p");
|
|
3096
|
+
return s.className = [
|
|
3097
3097
|
"wgt:text-xs",
|
|
3098
3098
|
"wgt:font-normal",
|
|
3099
3099
|
"wgt:text-right",
|
|
3100
3100
|
"wgt:text-[#335CFF]",
|
|
3101
3101
|
"wgt:italic"
|
|
3102
|
-
].join(" "),
|
|
3102
|
+
].join(" "), s.textContent = `${a("validityPeriod")}: ${a("expiredDate")} ${g.expiredAt.split("T")[0]}`, Q.appendChild(s), B.appendChild(C), B.appendChild(Q), { container: B };
|
|
3103
3103
|
}
|
|
3104
3104
|
function qE({
|
|
3105
3105
|
theme: g,
|
|
@@ -3114,9 +3114,9 @@ function qE({
|
|
|
3114
3114
|
n.className = "wgt:flex wgt:flex-col wgt:gap-4", t.appendChild(n);
|
|
3115
3115
|
const I = document.createElement("h2");
|
|
3116
3116
|
I.className = "wgt:text-xl wgt:font-bold wgt:text-text-black", I.innerText = a("selectInvoicePackage");
|
|
3117
|
-
const
|
|
3118
|
-
|
|
3119
|
-
function
|
|
3117
|
+
const c = document.createElement("span");
|
|
3118
|
+
c.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", c.innerText = "*", I.appendChild(c), n.appendChild(I);
|
|
3119
|
+
function w() {
|
|
3120
3120
|
return W(this, null, function* () {
|
|
3121
3121
|
A && clearTimeout(A), E !== "" ? A = setTimeout(() => W(null, null, function* () {
|
|
3122
3122
|
try {
|
|
@@ -3132,14 +3132,14 @@ function qE({
|
|
|
3132
3132
|
}), 500) : (Q = C, B && B());
|
|
3133
3133
|
});
|
|
3134
3134
|
}
|
|
3135
|
-
const
|
|
3135
|
+
const s = eE({
|
|
3136
3136
|
value: "",
|
|
3137
3137
|
placeholder: a("searchUnits"),
|
|
3138
3138
|
onInputChange: (d) => {
|
|
3139
|
-
E = d.target.value.replace(/\D/g, ""),
|
|
3139
|
+
E = d.target.value.replace(/\D/g, ""), w();
|
|
3140
3140
|
}
|
|
3141
3141
|
});
|
|
3142
|
-
n.appendChild(
|
|
3142
|
+
n.appendChild(s.container);
|
|
3143
3143
|
const D = document.createElement("div");
|
|
3144
3144
|
D.className = "wgt:flex wgt:flex-col wgt:gap-2", t.appendChild(D);
|
|
3145
3145
|
const o = document.createElement("h3");
|
|
@@ -3276,9 +3276,9 @@ function lE(P) {
|
|
|
3276
3276
|
setSelectedInvoiceOtp: t,
|
|
3277
3277
|
setSelectedSignatureOtp: n,
|
|
3278
3278
|
setOrderId: I,
|
|
3279
|
-
setTotalAmount:
|
|
3280
|
-
theme:
|
|
3281
|
-
selectedProvider:
|
|
3279
|
+
setTotalAmount: c,
|
|
3280
|
+
theme: w,
|
|
3281
|
+
selectedProvider: s,
|
|
3282
3282
|
selectedPromotions: D,
|
|
3283
3283
|
registrationData: o,
|
|
3284
3284
|
setSelectedPromotions: i,
|
|
@@ -3288,7 +3288,7 @@ function lE(P) {
|
|
|
3288
3288
|
savedQuantities: d,
|
|
3289
3289
|
setSavedQuantities: r
|
|
3290
3290
|
}) {
|
|
3291
|
-
let Y = "", T = B ? B._id : null, m = C ? C._id : null,
|
|
3291
|
+
let Y = "", T = B ? B._id : null, m = C ? C._id : null, f = D ? D.map((K) => K) : [], v = [], k = [], H = [], F = [], x = null, X = (d == null ? void 0 : d.qtyRegFee) || 1, U = (d == null ? void 0 : d.qtyInvoicePkg) || 1, j = (d == null ? void 0 : d.qtySignaturePkg) || 1;
|
|
3292
3292
|
function O() {
|
|
3293
3293
|
r && r({
|
|
3294
3294
|
qtyRegFee: X,
|
|
@@ -3319,7 +3319,7 @@ function lE(P) {
|
|
|
3319
3319
|
findInvoiceById: uA,
|
|
3320
3320
|
removeLoading: zA
|
|
3321
3321
|
} = qE({
|
|
3322
|
-
theme:
|
|
3322
|
+
theme: w,
|
|
3323
3323
|
debounceTimer: x,
|
|
3324
3324
|
typedUnits: Y,
|
|
3325
3325
|
onSearchComplete: () => {
|
|
@@ -3379,7 +3379,7 @@ function lE(P) {
|
|
|
3379
3379
|
const aA = yield AQ({
|
|
3380
3380
|
eInvoiceRegistration: PA({}, gA),
|
|
3381
3381
|
bank: o.bank,
|
|
3382
|
-
provider:
|
|
3382
|
+
provider: s.route,
|
|
3383
3383
|
logo: o.logo,
|
|
3384
3384
|
organizationRegistrationCert: o.license,
|
|
3385
3385
|
legalRepresentativeIdCard: [
|
|
@@ -3414,7 +3414,7 @@ function lE(P) {
|
|
|
3414
3414
|
quantity: X
|
|
3415
3415
|
}), Q(Z)) : Q(null);
|
|
3416
3416
|
let _ = GA(PA({}, K), { quantity: U }), QA = CA ? GA(PA({}, CA), { quantity: j }) : null;
|
|
3417
|
-
t(_), n(QA), i(
|
|
3417
|
+
t(_), n(QA), i(f), O(), r && r({
|
|
3418
3418
|
qtyRegFee: X,
|
|
3419
3419
|
qtyInvoicePkg: U,
|
|
3420
3420
|
qtySignaturePkg: j
|
|
@@ -3422,7 +3422,7 @@ function lE(P) {
|
|
|
3422
3422
|
Z,
|
|
3423
3423
|
_,
|
|
3424
3424
|
QA,
|
|
3425
|
-
|
|
3425
|
+
f
|
|
3426
3426
|
);
|
|
3427
3427
|
})
|
|
3428
3428
|
});
|
|
@@ -3438,9 +3438,9 @@ function lE(P) {
|
|
|
3438
3438
|
gA
|
|
3439
3439
|
] = yield Promise.allSettled([
|
|
3440
3440
|
mE(),
|
|
3441
|
-
uE({ bank:
|
|
3442
|
-
iE({ bank:
|
|
3443
|
-
sE({ bank:
|
|
3441
|
+
uE({ bank: w }),
|
|
3442
|
+
iE({ bank: w, hasRenew: !M }),
|
|
3443
|
+
sE({ bank: w })
|
|
3444
3444
|
]);
|
|
3445
3445
|
if (_.status === "fulfilled" ? k = _.value || [] : (console.error(
|
|
3446
3446
|
"Failed to load init packages:",
|
|
@@ -3463,8 +3463,8 @@ function lE(P) {
|
|
|
3463
3463
|
isDisabled: !1,
|
|
3464
3464
|
reward: V.reward
|
|
3465
3465
|
});
|
|
3466
|
-
}), Object.keys(H).length > 0 && (
|
|
3467
|
-
(V) => H[V].bank ===
|
|
3466
|
+
}), Object.keys(H).length > 0 && (f = D || Object.keys(H).filter(
|
|
3467
|
+
(V) => H[V].bank === w && H[V].expiredAt >= (/* @__PURE__ */ new Date()).toISOString() && H[V].limit > H[V].used
|
|
3468
3468
|
), Pg())) : console.error("Failed to load promotions:", Z.reason), QA.status === "fulfilled") {
|
|
3469
3469
|
const V = M ? QA.value : QA.value.filter((p) => p.renewPrice !== 0);
|
|
3470
3470
|
if (AA(V || []), QA.value.length > 0) {
|
|
@@ -3514,9 +3514,9 @@ function lE(P) {
|
|
|
3514
3514
|
}
|
|
3515
3515
|
function fg(K, CA, Z) {
|
|
3516
3516
|
const _ = Object.values(H).find(
|
|
3517
|
-
(p) => p.bank ===
|
|
3517
|
+
(p) => p.bank === w && p.appliedPackages.includes(K)
|
|
3518
3518
|
), QA = _ && !_.isDisabled && !(_.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && _.limit !== _.used, gA = Object.values(H).find(
|
|
3519
|
-
(p) => p.bank ===
|
|
3519
|
+
(p) => p.bank === w && p.appliedPackages.includes(CA)
|
|
3520
3520
|
), V = gA && !gA.isDisabled && !(gA.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && gA.limit !== gA.used;
|
|
3521
3521
|
if (QA && !V) {
|
|
3522
3522
|
const { container: p, open: aA } = PB({
|
|
@@ -3618,7 +3618,7 @@ function lE(P) {
|
|
|
3618
3618
|
);
|
|
3619
3619
|
Object.keys(H).forEach((Z) => {
|
|
3620
3620
|
const _ = H[Z];
|
|
3621
|
-
if (_.bank !==
|
|
3621
|
+
if (_.bank !== w)
|
|
3622
3622
|
return;
|
|
3623
3623
|
let QA = !1;
|
|
3624
3624
|
if (_.code === "INITFEE-KM-500")
|
|
@@ -3627,17 +3627,17 @@ function lE(P) {
|
|
|
3627
3627
|
const gA = K == null ? void 0 : K.code, V = CA == null ? void 0 : CA.code;
|
|
3628
3628
|
QA = _.appliedPackages.includes(gA) || _.appliedPackages.includes(V);
|
|
3629
3629
|
}
|
|
3630
|
-
_.isDisabled = !QA, !QA &&
|
|
3630
|
+
_.isDisabled = !QA, !QA && f.includes(_.code) ? f = f.filter(
|
|
3631
3631
|
(gA) => gA !== _.code
|
|
3632
|
-
) : QA && !
|
|
3632
|
+
) : QA && !f.includes(_.code) && f.push(_.code);
|
|
3633
3633
|
}), Pg();
|
|
3634
3634
|
}
|
|
3635
3635
|
function Pg() {
|
|
3636
|
-
F = Object.values(H).filter((K) => K.bank ===
|
|
3636
|
+
F = Object.values(H).filter((K) => K.bank === w).map((K) => K.appliedPackages[0]);
|
|
3637
3637
|
}
|
|
3638
3638
|
function FA() {
|
|
3639
3639
|
if (Object.values(H).filter(
|
|
3640
|
-
(p) => p.bank ===
|
|
3640
|
+
(p) => p.bank === w
|
|
3641
3641
|
).length === 0) {
|
|
3642
3642
|
L.contains(XA) && L.removeChild(XA);
|
|
3643
3643
|
return;
|
|
@@ -3648,11 +3648,11 @@ function lE(P) {
|
|
|
3648
3648
|
const Z = document.createElement("div");
|
|
3649
3649
|
Z.className = "wgt:w-full wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3650
3650
|
const _ = document.createElement("div");
|
|
3651
|
-
_.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", Z.appendChild(_),
|
|
3651
|
+
_.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", Z.appendChild(_), f && f.length > 0 && f.filter((aA) => {
|
|
3652
3652
|
const iA = Object.values(H).find(
|
|
3653
3653
|
(qA) => qA.code === aA
|
|
3654
3654
|
);
|
|
3655
|
-
return iA && iA.bank ===
|
|
3655
|
+
return iA && iA.bank === w;
|
|
3656
3656
|
}).forEach((aA) => {
|
|
3657
3657
|
const iA = document.createElement("div");
|
|
3658
3658
|
iA.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", iA.innerText = aA;
|
|
@@ -3660,7 +3660,7 @@ function lE(P) {
|
|
|
3660
3660
|
type: "button",
|
|
3661
3661
|
title: "x",
|
|
3662
3662
|
handleClick: () => {
|
|
3663
|
-
|
|
3663
|
+
f = f.filter(
|
|
3664
3664
|
(wg) => wg !== aA
|
|
3665
3665
|
), FA(), vA();
|
|
3666
3666
|
}
|
|
@@ -3683,16 +3683,16 @@ function lE(P) {
|
|
|
3683
3683
|
const gA = document.createElement("div");
|
|
3684
3684
|
gA.className = "wgt:w-full wgt:grid wgt:grid-cols-3 wgt:gap-4 wgt:@max-2xl:flex wgt:@max-2xl:flex-col", XA.appendChild(gA);
|
|
3685
3685
|
const V = Object.values(H).filter(
|
|
3686
|
-
(p) => p.bank ===
|
|
3686
|
+
(p) => p.bank === w
|
|
3687
3687
|
);
|
|
3688
3688
|
if (V.length > 0)
|
|
3689
3689
|
V.forEach((p) => {
|
|
3690
3690
|
const { container: aA } = PE({
|
|
3691
3691
|
promotion: GA(PA({}, p), {
|
|
3692
|
-
isSelected:
|
|
3692
|
+
isSelected: f.includes(p.code)
|
|
3693
3693
|
}),
|
|
3694
3694
|
onSelect: (iA, qA) => {
|
|
3695
|
-
qA &&
|
|
3695
|
+
qA && f.push(iA), FA(), vA();
|
|
3696
3696
|
},
|
|
3697
3697
|
isDisabled: p.isDisabled || p.expiredAt < (/* @__PURE__ */ new Date()).toISOString() || p.limit === p.used
|
|
3698
3698
|
});
|
|
@@ -3711,7 +3711,7 @@ function lE(P) {
|
|
|
3711
3711
|
<td colspan="5" class="wgt:px-3 wgt:py-8 wgt:text-center wgt:text-text-sub-600 wgt:@max-2xl:col-span-5">
|
|
3712
3712
|
${a("noDataAvailable") || "No data available"}
|
|
3713
3713
|
</td>
|
|
3714
|
-
`, tA.appendChild(J),
|
|
3714
|
+
`, tA.appendChild(J), c(0);
|
|
3715
3715
|
return;
|
|
3716
3716
|
}
|
|
3717
3717
|
const K = S().find(
|
|
@@ -3850,9 +3850,9 @@ function lE(P) {
|
|
|
3850
3850
|
`, hA.appendChild(SA), tA.appendChild(BA);
|
|
3851
3851
|
}
|
|
3852
3852
|
}
|
|
3853
|
-
const CA =
|
|
3853
|
+
const CA = f.map(
|
|
3854
3854
|
(J) => Object.values(H).find(
|
|
3855
|
-
(BA) => BA.code === J && BA.bank ===
|
|
3855
|
+
(BA) => BA.code === J && BA.bank === w
|
|
3856
3856
|
)
|
|
3857
3857
|
).filter((J) => J !== void 0);
|
|
3858
3858
|
let Z = 0;
|
|
@@ -3877,7 +3877,7 @@ function lE(P) {
|
|
|
3877
3877
|
)} ${(TA = (sA = J == null ? void 0 : J.reward) == null ? void 0 : sA.packageCodes) == null ? void 0 : TA.join(", ")}`, oA.style.color = "#12B76A") : oA.innerText = "", BA.appendChild(oA), tA.appendChild(BA);
|
|
3878
3878
|
});
|
|
3879
3879
|
const _ = M && k.length > 0 && !(K != null && K.withoutInitialFee) ? ((Rg = k[0]) == null ? void 0 : Rg.price) * X : 0, QA = uA(T), gA = QA ? M ? (qg = QA.price) != null ? qg : 0 : (vg = QA.renewPrice) != null ? vg : 0 : 0, V = QA ? gA * QA.limit * U : 0, p = e(m), aA = p ? p.price * p.limit * j : 0, iA = _ + V + aA - Z;
|
|
3880
|
-
|
|
3880
|
+
c(iA);
|
|
3881
3881
|
{
|
|
3882
3882
|
const J = document.createElement("tr");
|
|
3883
3883
|
J.className = "wgt:@max-2xl:hidden";
|
|
@@ -3902,10 +3902,10 @@ function dE({
|
|
|
3902
3902
|
illustrationSrc: n = "",
|
|
3903
3903
|
theme: I = "ocb"
|
|
3904
3904
|
} = {}) {
|
|
3905
|
-
const
|
|
3906
|
-
|
|
3907
|
-
const
|
|
3908
|
-
|
|
3905
|
+
const c = document.createElement("div");
|
|
3906
|
+
c.className = "wgt:flex wgt:flex-col wgt:@min-2xl:flex-row wgt:gap-6 wgt:p-6 wgt:bg-gray-50 wgt:rounded-xl";
|
|
3907
|
+
const w = document.createElement("div"), s = document.createElement("h3");
|
|
3908
|
+
s.className = "wgt:text-sm wgt:font-bold wgt:text-text-black wgt:mb-4 wgt:text-center", s.innerText = a("qrPaymentTitle"), w.appendChild(s);
|
|
3909
3909
|
const D = document.createElement("div");
|
|
3910
3910
|
D.className = "wgt:bg-white wgt:rounded-md wgt:p-6 wgt:flex wgt:flex-col wgt:gap-3 wgt:border wgt:border-[#E4E7EC]";
|
|
3911
3911
|
const o = document.createElement("div");
|
|
@@ -3933,13 +3933,13 @@ function dE({
|
|
|
3933
3933
|
const P = document.createElement("p");
|
|
3934
3934
|
P.className = "wgt:text-sm wgt:text-grey-8", P.innerHTML = `${a(
|
|
3935
3935
|
"beneficiaryBank"
|
|
3936
|
-
)}: <span class="wgt:font-medium">${Q}</span>`, M.appendChild(P), D.appendChild(M),
|
|
3936
|
+
)}: <span class="wgt:font-medium">${Q}</span>`, M.appendChild(P), D.appendChild(M), w.appendChild(D), c.appendChild(w);
|
|
3937
3937
|
const Y = document.createElement("div");
|
|
3938
3938
|
Y.className = "wgt:flex wgt:flex-col wgt:justify-between wgt:@min-2xl:w-1/2";
|
|
3939
3939
|
const T = document.createElement("div"), m = document.createElement("h3");
|
|
3940
3940
|
m.className = "wgt:text-lg wgt:font-semibold wgt:text-gray-800 wgt:mb-4", m.innerText = a("paymentInstructionsTitle"), T.appendChild(m);
|
|
3941
|
-
const
|
|
3942
|
-
|
|
3941
|
+
const f = document.createElement("ol");
|
|
3942
|
+
f.className = "wgt:space-y-4", t.forEach((H, F) => {
|
|
3943
3943
|
const x = document.createElement("li");
|
|
3944
3944
|
x.className = "wgt:flex wgt:items-start";
|
|
3945
3945
|
const X = document.createElement("div");
|
|
@@ -3949,13 +3949,13 @@ function dE({
|
|
|
3949
3949
|
const j = document.createElement("span");
|
|
3950
3950
|
j.className = "wgt:text-white wgt:text-sm wgt:font-semibold", j.innerText = String(F + 1), U.appendChild(j), X.appendChild(U);
|
|
3951
3951
|
const O = document.createElement("p");
|
|
3952
|
-
O.className = "wgt:ml-3 wgt:text-text-sub-600", O.innerText = H, x.appendChild(X), x.appendChild(O),
|
|
3953
|
-
}), T.appendChild(
|
|
3952
|
+
O.className = "wgt:ml-3 wgt:text-text-sub-600", O.innerText = H, x.appendChild(X), x.appendChild(O), f.appendChild(x);
|
|
3953
|
+
}), T.appendChild(f), Y.appendChild(T);
|
|
3954
3954
|
const v = document.createElement("div");
|
|
3955
3955
|
v.className = "wgt:h-[300px] wgt:flex wgt:justify-center";
|
|
3956
3956
|
const k = document.createElement("img");
|
|
3957
|
-
return k.src = n, k.alt = "QR payment illustration", k.className = "wgt:h-full wgt:object-contain", v.appendChild(k), Y.appendChild(v),
|
|
3958
|
-
container:
|
|
3957
|
+
return k.src = n, k.alt = "QR payment illustration", k.className = "wgt:h-full wgt:object-contain", v.appendChild(k), Y.appendChild(v), c.appendChild(Y), {
|
|
3958
|
+
container: c,
|
|
3959
3959
|
update(H = {}) {
|
|
3960
3960
|
H.qrSrc != null && (u.src = H.qrSrc), H.logos && (R.innerHTML = "", H.logos.forEach((F) => {
|
|
3961
3961
|
const x = document.createElement("img");
|
|
@@ -3964,7 +3964,7 @@ function dE({
|
|
|
3964
3964
|
"accountNumber"
|
|
3965
3965
|
)}: <span class="wgt:font-medium">${H.accountNumber}</span>`), H.bankName != null && (P.innerHTML = `${a(
|
|
3966
3966
|
"beneficiaryBank"
|
|
3967
|
-
)}: <span class="wgt:font-medium">${H.bankName}</span>`), H.instructions && (
|
|
3967
|
+
)}: <span class="wgt:font-medium">${H.bankName}</span>`), H.instructions && (f.innerHTML = "", H.instructions.forEach((F, x) => {
|
|
3968
3968
|
const X = document.createElement("li");
|
|
3969
3969
|
X.className = "wgt:flex wgt:items-start";
|
|
3970
3970
|
const U = document.createElement("div");
|
|
@@ -3974,7 +3974,7 @@ function dE({
|
|
|
3974
3974
|
const O = document.createElement("span");
|
|
3975
3975
|
O.className = "wgt:text-white wgt:text-sm wgt:font-semibold", O.innerText = String(x + 1), j.appendChild(O), U.appendChild(j);
|
|
3976
3976
|
const e = document.createElement("p");
|
|
3977
|
-
e.className = "wgt:ml-3 wgt:text-text-sub-600", e.innerText = F, X.appendChild(U), X.appendChild(e),
|
|
3977
|
+
e.className = "wgt:ml-3 wgt:text-text-sub-600", e.innerText = F, X.appendChild(U), X.appendChild(e), f.appendChild(X);
|
|
3978
3978
|
})), H.illustrationSrc != null && (k.src = H.illustrationSrc);
|
|
3979
3979
|
}
|
|
3980
3980
|
};
|
|
@@ -3990,7 +3990,7 @@ function xE({
|
|
|
3990
3990
|
illustrationSrc: n,
|
|
3991
3991
|
theme: I
|
|
3992
3992
|
} = {}) {
|
|
3993
|
-
const { container:
|
|
3993
|
+
const { container: c, update: w } = dE({
|
|
3994
3994
|
qrSrc: g,
|
|
3995
3995
|
logos: A,
|
|
3996
3996
|
logosAbove: E,
|
|
@@ -4001,7 +4001,7 @@ function xE({
|
|
|
4001
4001
|
illustrationSrc: n,
|
|
4002
4002
|
theme: I
|
|
4003
4003
|
});
|
|
4004
|
-
return { container:
|
|
4004
|
+
return { container: c, update: w };
|
|
4005
4005
|
}
|
|
4006
4006
|
function HE({
|
|
4007
4007
|
selectedProvider: g = null,
|
|
@@ -4023,26 +4023,26 @@ function HE({
|
|
|
4023
4023
|
"wgt:border-soft-200",
|
|
4024
4024
|
"wgt:overflow-hidden"
|
|
4025
4025
|
].join(" ");
|
|
4026
|
-
let I = 3600,
|
|
4027
|
-
const
|
|
4028
|
-
|
|
4029
|
-
const
|
|
4030
|
-
|
|
4026
|
+
let I = 3600, c = null;
|
|
4027
|
+
const w = document.createElement("div");
|
|
4028
|
+
w.className = "wgt:p-4 wgt:w-full wgt:flex wgt:items-center wgt:justify-center wgt:gap-2 wgt:bg-primary/10";
|
|
4029
|
+
const s = document.createElement("p");
|
|
4030
|
+
s.className = "wgt:text-base wgt:font-medium wgt:leading-6 wgt:text-primary";
|
|
4031
4031
|
const D = (O) => {
|
|
4032
4032
|
const e = Math.floor(O / 60), h = O % 60;
|
|
4033
4033
|
return `${e.toString().padStart(2, "0")}:${h.toString().padStart(2, "0")}`;
|
|
4034
4034
|
}, o = () => {
|
|
4035
|
-
|
|
4035
|
+
s.innerHTML = `${a(
|
|
4036
4036
|
"completePaymentIn"
|
|
4037
4037
|
)} <span class="wgt:font-bold">${D(I)}</span>`;
|
|
4038
4038
|
};
|
|
4039
4039
|
o();
|
|
4040
4040
|
const i = () => {
|
|
4041
|
-
|
|
4042
|
-
I = Math.max(0, I - 1), o(), I <= 0 && (
|
|
4041
|
+
c && (clearInterval(c), c = null), c = setInterval(() => {
|
|
4042
|
+
I = Math.max(0, I - 1), o(), I <= 0 && (c = null);
|
|
4043
4043
|
}, 1e3);
|
|
4044
4044
|
};
|
|
4045
|
-
i(),
|
|
4045
|
+
i(), w.appendChild(s);
|
|
4046
4046
|
const u = document.createElement("svg");
|
|
4047
4047
|
u.setAttribute("width", "24"), u.setAttribute("height", "24"), u.setAttribute("viewBox", "0 0 24 24"), u.setAttribute("fill", "none"), u.setAttribute("xmlns", "http://www.w3.org/2000/svg"), u.innerHTML = `
|
|
4048
4048
|
<path
|
|
@@ -4055,7 +4055,7 @@ function HE({
|
|
|
4055
4055
|
d="M16.0945 14.9672L12.7523 12.5508V6.75C12.7523 6.64687 12.668 6.5625 12.5648 6.5625H11.4375C11.3344 6.5625 11.25 6.64687 11.25 6.75V13.2047C11.25 13.2656 11.2781 13.3219 11.3273 13.357L15.2039 16.1836C15.2883 16.2445 15.4055 16.2258 15.4664 16.1437L16.1367 15.2297C16.1976 15.1429 16.1789 15.0258 16.0945 14.9672Z"
|
|
4056
4056
|
fill="#1D963E"
|
|
4057
4057
|
/>
|
|
4058
|
-
`,
|
|
4058
|
+
`, w.appendChild(u), n.appendChild(w);
|
|
4059
4059
|
const R = document.createElement("div");
|
|
4060
4060
|
R.className = [
|
|
4061
4061
|
"wgt:p-6",
|
|
@@ -4079,8 +4079,8 @@ function HE({
|
|
|
4079
4079
|
T.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4080
4080
|
const m = document.createElement("h4");
|
|
4081
4081
|
m.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", m.innerText = a("subscriptionPackage");
|
|
4082
|
-
const
|
|
4083
|
-
|
|
4082
|
+
const f = document.createElement("span");
|
|
4083
|
+
f.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", f.innerText = A ? `${String(A == null ? void 0 : A.code)}` : "", T.appendChild(m), T.appendChild(f), M.appendChild(T);
|
|
4084
4084
|
const v = document.createElement("div");
|
|
4085
4085
|
v.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4086
4086
|
const k = document.createElement("h4");
|
|
@@ -4109,12 +4109,12 @@ function HE({
|
|
|
4109
4109
|
title: a("cancelTransaction"),
|
|
4110
4110
|
className: "wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary wgt:hover:bg-transparent",
|
|
4111
4111
|
handleClick: () => {
|
|
4112
|
-
|
|
4112
|
+
c && (clearInterval(c), c = null);
|
|
4113
4113
|
const O = PB({
|
|
4114
4114
|
message: a("transactionCanceled"),
|
|
4115
4115
|
okLabel: a("ok"),
|
|
4116
4116
|
onClose: () => W(null, null, function* () {
|
|
4117
|
-
I = 3600,
|
|
4117
|
+
I = 3600, c && (clearInterval(c), c = null), yield aC(B), typeof t == "function" && (yield t());
|
|
4118
4118
|
}),
|
|
4119
4119
|
preventClose: !0
|
|
4120
4120
|
});
|
|
@@ -4122,7 +4122,7 @@ function HE({
|
|
|
4122
4122
|
}
|
|
4123
4123
|
});
|
|
4124
4124
|
return R.appendChild(j), n.appendChild(R), window.addEventListener("beforeunload", () => W(null, null, function* () {
|
|
4125
|
-
|
|
4125
|
+
c && (clearInterval(c), c = null), yield aC(B);
|
|
4126
4126
|
})), {
|
|
4127
4127
|
container: n,
|
|
4128
4128
|
setSelectedProvider(O) {
|
|
@@ -4157,10 +4157,10 @@ function HE({
|
|
|
4157
4157
|
e && (e.innerText = typeof O == "number" ? O.toLocaleString("vi-VN") + " VND" : O);
|
|
4158
4158
|
},
|
|
4159
4159
|
resetCountdown() {
|
|
4160
|
-
|
|
4160
|
+
c && (clearInterval(c), c = null), I = 3600, o(), i();
|
|
4161
4161
|
},
|
|
4162
4162
|
clearCountdown() {
|
|
4163
|
-
|
|
4163
|
+
c && (clearInterval(c), c = null);
|
|
4164
4164
|
}
|
|
4165
4165
|
};
|
|
4166
4166
|
}
|
|
@@ -4385,12 +4385,12 @@ function FE() {
|
|
|
4385
4385
|
return g.isValid(C) ? parseInt(C, 10) : void 0;
|
|
4386
4386
|
}, g.getPenaltyN1 = function(C) {
|
|
4387
4387
|
const Q = C.size;
|
|
4388
|
-
let t = 0, n = 0, I = 0,
|
|
4389
|
-
for (let
|
|
4390
|
-
n = I = 0,
|
|
4388
|
+
let t = 0, n = 0, I = 0, c = null, w = null;
|
|
4389
|
+
for (let s = 0; s < Q; s++) {
|
|
4390
|
+
n = I = 0, c = w = null;
|
|
4391
4391
|
for (let D = 0; D < Q; D++) {
|
|
4392
|
-
let o = C.get(
|
|
4393
|
-
o ===
|
|
4392
|
+
let o = C.get(s, D);
|
|
4393
|
+
o === c ? n++ : (n >= 5 && (t += A.N1 + (n - 5)), c = o, n = 1), o = C.get(D, s), o === w ? I++ : (I >= 5 && (t += A.N1 + (I - 5)), w = o, I = 1);
|
|
4394
4394
|
}
|
|
4395
4395
|
n >= 5 && (t += A.N1 + (n - 5)), I >= 5 && (t += A.N1 + (I - 5));
|
|
4396
4396
|
}
|
|
@@ -4400,17 +4400,17 @@ function FE() {
|
|
|
4400
4400
|
let t = 0;
|
|
4401
4401
|
for (let n = 0; n < Q - 1; n++)
|
|
4402
4402
|
for (let I = 0; I < Q - 1; I++) {
|
|
4403
|
-
const
|
|
4404
|
-
(
|
|
4403
|
+
const c = C.get(n, I) + C.get(n, I + 1) + C.get(n + 1, I) + C.get(n + 1, I + 1);
|
|
4404
|
+
(c === 4 || c === 0) && t++;
|
|
4405
4405
|
}
|
|
4406
4406
|
return t * A.N2;
|
|
4407
4407
|
}, g.getPenaltyN3 = function(C) {
|
|
4408
4408
|
const Q = C.size;
|
|
4409
4409
|
let t = 0, n = 0, I = 0;
|
|
4410
|
-
for (let
|
|
4410
|
+
for (let c = 0; c < Q; c++) {
|
|
4411
4411
|
n = I = 0;
|
|
4412
|
-
for (let
|
|
4413
|
-
n = n << 1 & 2047 | C.get(
|
|
4412
|
+
for (let w = 0; w < Q; w++)
|
|
4413
|
+
n = n << 1 & 2047 | C.get(c, w), w >= 10 && (n === 1488 || n === 93) && t++, I = I << 1 & 2047 | C.get(w, c), w >= 10 && (I === 1488 || I === 93) && t++;
|
|
4414
4414
|
}
|
|
4415
4415
|
return t * A.N3;
|
|
4416
4416
|
}, g.getPenaltyN4 = function(C) {
|
|
@@ -4449,10 +4449,10 @@ function FE() {
|
|
|
4449
4449
|
}, g.getBestMask = function(C, Q) {
|
|
4450
4450
|
const t = Object.keys(g.Patterns).length;
|
|
4451
4451
|
let n = 0, I = 1 / 0;
|
|
4452
|
-
for (let
|
|
4453
|
-
Q(
|
|
4454
|
-
const
|
|
4455
|
-
g.applyMask(
|
|
4452
|
+
for (let c = 0; c < t; c++) {
|
|
4453
|
+
Q(c), g.applyMask(c, C);
|
|
4454
|
+
const w = g.getPenaltyN1(C) + g.getPenaltyN2(C) + g.getPenaltyN3(C) + g.getPenaltyN4(C);
|
|
4455
|
+
g.applyMask(c, C), w < I && (I = w, n = c);
|
|
4456
4456
|
}
|
|
4457
4457
|
return n;
|
|
4458
4458
|
};
|
|
@@ -4983,19 +4983,19 @@ function zE() {
|
|
|
4983
4983
|
if (o <= g.getCapacity(u, i, D))
|
|
4984
4984
|
return u;
|
|
4985
4985
|
}
|
|
4986
|
-
function
|
|
4986
|
+
function c(D, o) {
|
|
4987
4987
|
return C.getCharCountIndicator(D, o) + 4;
|
|
4988
4988
|
}
|
|
4989
|
-
function
|
|
4989
|
+
function w(D, o) {
|
|
4990
4990
|
let i = 0;
|
|
4991
4991
|
return D.forEach(function(u) {
|
|
4992
|
-
const R =
|
|
4992
|
+
const R = c(u.mode, o);
|
|
4993
4993
|
i += R + u.getBitsLength();
|
|
4994
4994
|
}), i;
|
|
4995
4995
|
}
|
|
4996
|
-
function
|
|
4996
|
+
function s(D, o) {
|
|
4997
4997
|
for (let i = 1; i <= 40; i++)
|
|
4998
|
-
if (
|
|
4998
|
+
if (w(D, i) <= g.getCapacity(i, o, C.MIXED))
|
|
4999
4999
|
return i;
|
|
5000
5000
|
}
|
|
5001
5001
|
g.from = function(o, i) {
|
|
@@ -5006,7 +5006,7 @@ function zE() {
|
|
|
5006
5006
|
typeof u == "undefined" && (u = C.BYTE);
|
|
5007
5007
|
const R = A.getSymbolTotalCodewords(o), M = E.getTotalCodewordsCount(o, i), d = (R - M) * 8;
|
|
5008
5008
|
if (u === C.MIXED) return d;
|
|
5009
|
-
const r = d -
|
|
5009
|
+
const r = d - c(u, o);
|
|
5010
5010
|
switch (u) {
|
|
5011
5011
|
case C.NUMERIC:
|
|
5012
5012
|
return Math.floor(r / 10 * 3);
|
|
@@ -5023,7 +5023,7 @@ function zE() {
|
|
|
5023
5023
|
const R = B.from(i, B.M);
|
|
5024
5024
|
if (Array.isArray(o)) {
|
|
5025
5025
|
if (o.length > 1)
|
|
5026
|
-
return
|
|
5026
|
+
return s(o, R);
|
|
5027
5027
|
if (o.length === 0)
|
|
5028
5028
|
return 1;
|
|
5029
5029
|
u = o[0];
|
|
@@ -5203,10 +5203,10 @@ function UE() {
|
|
|
5203
5203
|
t[B] = 0;
|
|
5204
5204
|
var n = A.PriorityQueue.make();
|
|
5205
5205
|
n.push(B, 0);
|
|
5206
|
-
for (var I,
|
|
5207
|
-
I = n.pop(),
|
|
5208
|
-
for (
|
|
5209
|
-
D.hasOwnProperty(
|
|
5206
|
+
for (var I, c, w, s, D, o, i, u, R; !n.empty(); ) {
|
|
5207
|
+
I = n.pop(), c = I.value, s = I.cost, D = E[c] || {};
|
|
5208
|
+
for (w in D)
|
|
5209
|
+
D.hasOwnProperty(w) && (o = D[w], i = s + o, u = t[w], R = typeof t[w] == "undefined", (R || u > i) && (t[w] = i, n.push(w, i), Q[w] = c));
|
|
5210
5210
|
}
|
|
5211
5211
|
if (typeof C != "undefined" && typeof t[C] == "undefined") {
|
|
5212
5212
|
var M = ["Could not find a path from ", B, " to ", C, "."].join("");
|
|
@@ -5266,10 +5266,10 @@ var GC;
|
|
|
5266
5266
|
function SE() {
|
|
5267
5267
|
return GC || (GC = 1, function(g) {
|
|
5268
5268
|
const A = sg(), E = bE(), B = jE(), C = yE(), Q = KE(), t = CQ(), n = ig(), I = UE();
|
|
5269
|
-
function
|
|
5269
|
+
function c(M) {
|
|
5270
5270
|
return unescape(encodeURIComponent(M)).length;
|
|
5271
5271
|
}
|
|
5272
|
-
function
|
|
5272
|
+
function w(M, d, r) {
|
|
5273
5273
|
const P = [];
|
|
5274
5274
|
let Y;
|
|
5275
5275
|
for (; (Y = M.exec(r)) !== null; )
|
|
@@ -5281,11 +5281,11 @@ function SE() {
|
|
|
5281
5281
|
});
|
|
5282
5282
|
return P;
|
|
5283
5283
|
}
|
|
5284
|
-
function
|
|
5285
|
-
const d =
|
|
5284
|
+
function s(M) {
|
|
5285
|
+
const d = w(t.NUMERIC, A.NUMERIC, M), r = w(t.ALPHANUMERIC, A.ALPHANUMERIC, M);
|
|
5286
5286
|
let P, Y;
|
|
5287
|
-
return n.isKanjiModeEnabled() ? (P =
|
|
5288
|
-
return m.index -
|
|
5287
|
+
return n.isKanjiModeEnabled() ? (P = w(t.BYTE, A.BYTE, M), Y = w(t.KANJI, A.KANJI, M)) : (P = w(t.BYTE_KANJI, A.BYTE, M), Y = []), d.concat(r, P, Y).sort(function(m, f) {
|
|
5288
|
+
return m.index - f.index;
|
|
5289
5289
|
}).map(function(m) {
|
|
5290
5290
|
return {
|
|
5291
5291
|
data: m.data,
|
|
@@ -5333,12 +5333,12 @@ function SE() {
|
|
|
5333
5333
|
case A.KANJI:
|
|
5334
5334
|
d.push([
|
|
5335
5335
|
P,
|
|
5336
|
-
{ data: P.data, mode: A.BYTE, length:
|
|
5336
|
+
{ data: P.data, mode: A.BYTE, length: c(P.data) }
|
|
5337
5337
|
]);
|
|
5338
5338
|
break;
|
|
5339
5339
|
case A.BYTE:
|
|
5340
5340
|
d.push([
|
|
5341
|
-
{ data: P.data, mode: A.BYTE, length:
|
|
5341
|
+
{ data: P.data, mode: A.BYTE, length: c(P.data) }
|
|
5342
5342
|
]);
|
|
5343
5343
|
}
|
|
5344
5344
|
}
|
|
@@ -5348,16 +5348,16 @@ function SE() {
|
|
|
5348
5348
|
const r = {}, P = { start: {} };
|
|
5349
5349
|
let Y = ["start"];
|
|
5350
5350
|
for (let T = 0; T < M.length; T++) {
|
|
5351
|
-
const m = M[T],
|
|
5351
|
+
const m = M[T], f = [];
|
|
5352
5352
|
for (let v = 0; v < m.length; v++) {
|
|
5353
5353
|
const k = m[v], H = "" + T + v;
|
|
5354
|
-
|
|
5354
|
+
f.push(H), r[H] = { node: k, lastCount: 0 }, P[H] = {};
|
|
5355
5355
|
for (let F = 0; F < Y.length; F++) {
|
|
5356
5356
|
const x = Y[F];
|
|
5357
5357
|
r[x] && r[x].node.mode === k.mode ? (P[x][H] = D(r[x].lastCount + k.length, k.mode) - D(r[x].lastCount, k.mode), r[x].lastCount += k.length) : (r[x] && (r[x].lastCount = k.length), P[x][H] = D(k.length, k.mode) + 4 + A.getCharCountIndicator(k.mode, d));
|
|
5358
5358
|
}
|
|
5359
5359
|
}
|
|
5360
|
-
Y =
|
|
5360
|
+
Y = f;
|
|
5361
5361
|
}
|
|
5362
5362
|
for (let T = 0; T < Y.length; T++)
|
|
5363
5363
|
P[Y[T]].end = 0;
|
|
@@ -5385,13 +5385,13 @@ function SE() {
|
|
|
5385
5385
|
return typeof P == "string" ? r.push(R(P, null)) : P.data && r.push(R(P.data, P.mode)), r;
|
|
5386
5386
|
}, []);
|
|
5387
5387
|
}, g.fromString = function(d, r) {
|
|
5388
|
-
const P =
|
|
5388
|
+
const P = s(d, n.isKanjiModeEnabled()), Y = i(P), T = u(Y, r), m = I.find_path(T.map, "start", "end"), f = [];
|
|
5389
5389
|
for (let v = 1; v < m.length - 1; v++)
|
|
5390
|
-
|
|
5391
|
-
return g.fromArray(o(
|
|
5390
|
+
f.push(T.table[m[v]].node);
|
|
5391
|
+
return g.fromArray(o(f));
|
|
5392
5392
|
}, g.rawSplit = function(d) {
|
|
5393
5393
|
return g.fromArray(
|
|
5394
|
-
|
|
5394
|
+
s(d, n.isKanjiModeEnabled())
|
|
5395
5395
|
);
|
|
5396
5396
|
};
|
|
5397
5397
|
}(nB)), nB;
|
|
@@ -5400,66 +5400,66 @@ var LC;
|
|
|
5400
5400
|
function pE() {
|
|
5401
5401
|
if (LC) return pg;
|
|
5402
5402
|
LC = 1;
|
|
5403
|
-
const g = ig(), A = vB(), E = RE(), B = YE(), C = JE(), Q = XE(), t = FE(), n = gQ(), I = LE(),
|
|
5403
|
+
const g = ig(), A = vB(), E = RE(), B = YE(), C = JE(), Q = XE(), t = FE(), n = gQ(), I = LE(), c = zE(), w = NE(), s = sg(), D = SE();
|
|
5404
5404
|
function o(T, m) {
|
|
5405
|
-
const
|
|
5405
|
+
const f = T.size, v = Q.getPositions(m);
|
|
5406
5406
|
for (let k = 0; k < v.length; k++) {
|
|
5407
5407
|
const H = v[k][0], F = v[k][1];
|
|
5408
5408
|
for (let x = -1; x <= 7; x++)
|
|
5409
|
-
if (!(H + x <= -1 ||
|
|
5409
|
+
if (!(H + x <= -1 || f <= H + x))
|
|
5410
5410
|
for (let X = -1; X <= 7; X++)
|
|
5411
|
-
F + X <= -1 ||
|
|
5411
|
+
F + X <= -1 || f <= F + X || (x >= 0 && x <= 6 && (X === 0 || X === 6) || X >= 0 && X <= 6 && (x === 0 || x === 6) || x >= 2 && x <= 4 && X >= 2 && X <= 4 ? T.set(H + x, F + X, !0, !0) : T.set(H + x, F + X, !1, !0));
|
|
5412
5412
|
}
|
|
5413
5413
|
}
|
|
5414
5414
|
function i(T) {
|
|
5415
5415
|
const m = T.size;
|
|
5416
|
-
for (let
|
|
5417
|
-
const v =
|
|
5418
|
-
T.set(
|
|
5416
|
+
for (let f = 8; f < m - 8; f++) {
|
|
5417
|
+
const v = f % 2 === 0;
|
|
5418
|
+
T.set(f, 6, v, !0), T.set(6, f, v, !0);
|
|
5419
5419
|
}
|
|
5420
5420
|
}
|
|
5421
5421
|
function u(T, m) {
|
|
5422
|
-
const
|
|
5423
|
-
for (let v = 0; v <
|
|
5424
|
-
const k =
|
|
5422
|
+
const f = C.getPositions(m);
|
|
5423
|
+
for (let v = 0; v < f.length; v++) {
|
|
5424
|
+
const k = f[v][0], H = f[v][1];
|
|
5425
5425
|
for (let F = -2; F <= 2; F++)
|
|
5426
5426
|
for (let x = -2; x <= 2; x++)
|
|
5427
5427
|
F === -2 || F === 2 || x === -2 || x === 2 || F === 0 && x === 0 ? T.set(k + F, H + x, !0, !0) : T.set(k + F, H + x, !1, !0);
|
|
5428
5428
|
}
|
|
5429
5429
|
}
|
|
5430
5430
|
function R(T, m) {
|
|
5431
|
-
const
|
|
5431
|
+
const f = T.size, v = c.getEncodedBits(m);
|
|
5432
5432
|
let k, H, F;
|
|
5433
5433
|
for (let x = 0; x < 18; x++)
|
|
5434
|
-
k = Math.floor(x / 3), H = x % 3 +
|
|
5434
|
+
k = Math.floor(x / 3), H = x % 3 + f - 8 - 3, F = (v >> x & 1) === 1, T.set(k, H, F, !0), T.set(H, k, F, !0);
|
|
5435
5435
|
}
|
|
5436
|
-
function M(T, m,
|
|
5437
|
-
const v = T.size, k =
|
|
5436
|
+
function M(T, m, f) {
|
|
5437
|
+
const v = T.size, k = w.getEncodedBits(m, f);
|
|
5438
5438
|
let H, F;
|
|
5439
5439
|
for (H = 0; H < 15; H++)
|
|
5440
5440
|
F = (k >> H & 1) === 1, H < 6 ? T.set(H, 8, F, !0) : H < 8 ? T.set(H + 1, 8, F, !0) : T.set(v - 15 + H, 8, F, !0), H < 8 ? T.set(8, v - H - 1, F, !0) : H < 9 ? T.set(8, 15 - H - 1 + 1, F, !0) : T.set(8, 15 - H - 1, F, !0);
|
|
5441
5441
|
T.set(v - 8, 8, 1, !0);
|
|
5442
5442
|
}
|
|
5443
5443
|
function d(T, m) {
|
|
5444
|
-
const
|
|
5445
|
-
let v = -1, k =
|
|
5446
|
-
for (let x =
|
|
5444
|
+
const f = T.size;
|
|
5445
|
+
let v = -1, k = f - 1, H = 7, F = 0;
|
|
5446
|
+
for (let x = f - 1; x > 0; x -= 2)
|
|
5447
5447
|
for (x === 6 && x--; ; ) {
|
|
5448
5448
|
for (let X = 0; X < 2; X++)
|
|
5449
5449
|
if (!T.isReserved(k, x - X)) {
|
|
5450
5450
|
let U = !1;
|
|
5451
5451
|
F < m.length && (U = (m[F] >>> H & 1) === 1), T.set(k, x - X, U), H--, H === -1 && (F++, H = 7);
|
|
5452
5452
|
}
|
|
5453
|
-
if (k += v, k < 0 ||
|
|
5453
|
+
if (k += v, k < 0 || f <= k) {
|
|
5454
5454
|
k -= v, v = -v;
|
|
5455
5455
|
break;
|
|
5456
5456
|
}
|
|
5457
5457
|
}
|
|
5458
5458
|
}
|
|
5459
|
-
function r(T, m,
|
|
5459
|
+
function r(T, m, f) {
|
|
5460
5460
|
const v = new E();
|
|
5461
|
-
|
|
5462
|
-
v.put(X.mode.bit, 4), v.put(X.getLength(),
|
|
5461
|
+
f.forEach(function(X) {
|
|
5462
|
+
v.put(X.mode.bit, 4), v.put(X.getLength(), s.getCharCountIndicator(X.mode, T)), X.write(v);
|
|
5463
5463
|
});
|
|
5464
5464
|
const k = g.getSymbolTotalCodewords(T), H = n.getTotalCodewordsCount(T, m), F = (k - H) * 8;
|
|
5465
5465
|
for (v.getLengthInBits() + 4 <= F && v.put(0, 4); v.getLengthInBits() % 8 !== 0; )
|
|
@@ -5469,8 +5469,8 @@ function pE() {
|
|
|
5469
5469
|
v.put(X % 2 ? 17 : 236, 8);
|
|
5470
5470
|
return P(v, T, m);
|
|
5471
5471
|
}
|
|
5472
|
-
function P(T, m,
|
|
5473
|
-
const v = g.getSymbolTotalCodewords(m), k = n.getTotalCodewordsCount(m,
|
|
5472
|
+
function P(T, m, f) {
|
|
5473
|
+
const v = g.getSymbolTotalCodewords(m), k = n.getTotalCodewordsCount(m, f), H = v - k, F = n.getBlocksCount(m, f), x = v % F, X = F - x, U = Math.floor(v / F), j = Math.floor(H / F), O = j + 1, e = U - j, h = new I(e);
|
|
5474
5474
|
let q = 0;
|
|
5475
5475
|
const l = new Array(F), N = new Array(F);
|
|
5476
5476
|
let L = 0;
|
|
@@ -5489,7 +5489,7 @@ function pE() {
|
|
|
5489
5489
|
y[AA++] = N[IA][S];
|
|
5490
5490
|
return y;
|
|
5491
5491
|
}
|
|
5492
|
-
function Y(T, m,
|
|
5492
|
+
function Y(T, m, f, v) {
|
|
5493
5493
|
let k;
|
|
5494
5494
|
if (Array.isArray(T))
|
|
5495
5495
|
k = D.fromArray(T);
|
|
@@ -5497,12 +5497,12 @@ function pE() {
|
|
|
5497
5497
|
let U = m;
|
|
5498
5498
|
if (!U) {
|
|
5499
5499
|
const j = D.rawSplit(T);
|
|
5500
|
-
U =
|
|
5500
|
+
U = c.getBestVersionForData(j, f);
|
|
5501
5501
|
}
|
|
5502
5502
|
k = D.fromString(T, U || 40);
|
|
5503
5503
|
} else
|
|
5504
5504
|
throw new Error("Invalid data");
|
|
5505
|
-
const H =
|
|
5505
|
+
const H = c.getBestVersionForData(k, f);
|
|
5506
5506
|
if (!H)
|
|
5507
5507
|
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
5508
5508
|
if (!m)
|
|
@@ -5514,23 +5514,23 @@ The chosen QR Code version cannot contain this amount of data.
|
|
|
5514
5514
|
Minimum version required to store current data is: ` + H + `.
|
|
5515
5515
|
`
|
|
5516
5516
|
);
|
|
5517
|
-
const F = r(m,
|
|
5518
|
-
return o(X, m), i(X), u(X, m), M(X,
|
|
5517
|
+
const F = r(m, f, k), x = g.getSymbolSize(m), X = new B(x);
|
|
5518
|
+
return o(X, m), i(X), u(X, m), M(X, f, 0), m >= 7 && R(X, m), d(X, F), isNaN(v) && (v = t.getBestMask(
|
|
5519
5519
|
X,
|
|
5520
|
-
M.bind(null, X,
|
|
5521
|
-
)), t.applyMask(v, X), M(X,
|
|
5520
|
+
M.bind(null, X, f)
|
|
5521
|
+
)), t.applyMask(v, X), M(X, f, v), {
|
|
5522
5522
|
modules: X,
|
|
5523
5523
|
version: m,
|
|
5524
|
-
errorCorrectionLevel:
|
|
5524
|
+
errorCorrectionLevel: f,
|
|
5525
5525
|
maskPattern: v,
|
|
5526
5526
|
segments: k
|
|
5527
5527
|
};
|
|
5528
5528
|
}
|
|
5529
|
-
return pg.create = function(m,
|
|
5529
|
+
return pg.create = function(m, f) {
|
|
5530
5530
|
if (typeof m == "undefined" || m === "")
|
|
5531
5531
|
throw new Error("No input text");
|
|
5532
5532
|
let v = A.M, k, H;
|
|
5533
|
-
return typeof
|
|
5533
|
+
return typeof f != "undefined" && (v = A.from(f.errorCorrectionLevel, A.M), k = c.from(f.version), H = t.from(f.maskPattern), f.toSJISFunc && g.setToSJISFunction(f.toSJISFunc)), Y(m, k, v, H);
|
|
5534
5534
|
}, pg;
|
|
5535
5535
|
}
|
|
5536
5536
|
var oB = {}, aB = {}, zC;
|
|
@@ -5574,13 +5574,13 @@ function QQ() {
|
|
|
5574
5574
|
const Q = g.getScale(B, C);
|
|
5575
5575
|
return Math.floor((B + C.margin * 2) * Q);
|
|
5576
5576
|
}, g.qrToImageData = function(B, C, Q) {
|
|
5577
|
-
const t = C.modules.size, n = C.modules.data, I = g.getScale(t, Q),
|
|
5578
|
-
for (let D = 0; D <
|
|
5579
|
-
for (let o = 0; o <
|
|
5580
|
-
let i = (D *
|
|
5581
|
-
if (D >=
|
|
5582
|
-
const R = Math.floor((D -
|
|
5583
|
-
u =
|
|
5577
|
+
const t = C.modules.size, n = C.modules.data, I = g.getScale(t, Q), c = Math.floor((t + Q.margin * 2) * I), w = Q.margin * I, s = [Q.color.light, Q.color.dark];
|
|
5578
|
+
for (let D = 0; D < c; D++)
|
|
5579
|
+
for (let o = 0; o < c; o++) {
|
|
5580
|
+
let i = (D * c + o) * 4, u = Q.color.light;
|
|
5581
|
+
if (D >= w && o >= w && D < c - w && o < c - w) {
|
|
5582
|
+
const R = Math.floor((D - w) / I), M = Math.floor((o - w) / I);
|
|
5583
|
+
u = s[n[R * t + M] ? 1 : 0];
|
|
5584
5584
|
}
|
|
5585
5585
|
B[i++] = u.r, B[i++] = u.g, B[i++] = u.b, B[i] = u.a;
|
|
5586
5586
|
}
|
|
@@ -5602,15 +5602,15 @@ function ZE() {
|
|
|
5602
5602
|
}
|
|
5603
5603
|
}
|
|
5604
5604
|
g.render = function(Q, t, n) {
|
|
5605
|
-
let I = n,
|
|
5606
|
-
typeof I == "undefined" && (!t || !t.getContext) && (I = t, t = void 0), t || (
|
|
5607
|
-
const
|
|
5608
|
-
return A.qrToImageData(D.data, Q, I), E(
|
|
5605
|
+
let I = n, c = t;
|
|
5606
|
+
typeof I == "undefined" && (!t || !t.getContext) && (I = t, t = void 0), t || (c = B()), I = A.getOptions(I);
|
|
5607
|
+
const w = A.getImageWidth(Q.modules.size, I), s = c.getContext("2d"), D = s.createImageData(w, w);
|
|
5608
|
+
return A.qrToImageData(D.data, Q, I), E(s, c, w), s.putImageData(D, 0, 0), c;
|
|
5609
5609
|
}, g.renderToDataURL = function(Q, t, n) {
|
|
5610
5610
|
let I = n;
|
|
5611
5611
|
typeof I == "undefined" && (!t || !t.getContext) && (I = t, t = void 0), I || (I = {});
|
|
5612
|
-
const
|
|
5613
|
-
return
|
|
5612
|
+
const c = g.render(Q, t, I), w = I.type || "image/png", s = I.rendererOpts || {};
|
|
5613
|
+
return c.toDataURL(w, s.quality);
|
|
5614
5614
|
};
|
|
5615
5615
|
}(oB)), oB;
|
|
5616
5616
|
}
|
|
@@ -5628,15 +5628,15 @@ function VE() {
|
|
|
5628
5628
|
return typeof t != "undefined" && (n += " " + t), n;
|
|
5629
5629
|
}
|
|
5630
5630
|
function B(C, Q, t) {
|
|
5631
|
-
let n = "", I = 0,
|
|
5632
|
-
for (let
|
|
5633
|
-
const D = Math.floor(
|
|
5634
|
-
!D && !
|
|
5631
|
+
let n = "", I = 0, c = !1, w = 0;
|
|
5632
|
+
for (let s = 0; s < C.length; s++) {
|
|
5633
|
+
const D = Math.floor(s % Q), o = Math.floor(s / Q);
|
|
5634
|
+
!D && !c && (c = !0), C[s] ? (w++, s > 0 && D > 0 && C[s - 1] || (n += c ? E("M", D + t, 0.5 + o + t) : E("m", I, 0), I = 0, c = !1), D + 1 < Q && C[s + 1] || (n += E("h", w), w = 0)) : I++;
|
|
5635
5635
|
}
|
|
5636
5636
|
return n;
|
|
5637
5637
|
}
|
|
5638
5638
|
return DB.render = function(Q, t, n) {
|
|
5639
|
-
const I = g.getOptions(t),
|
|
5639
|
+
const I = g.getOptions(t), c = Q.modules.size, w = Q.modules.data, s = c + I.margin * 2, D = I.color.light.a ? "<path " + A(I.color.light, "fill") + ' d="M0 0h' + s + "v" + s + 'H0z"/>' : "", o = "<path " + A(I.color.dark, "stroke") + ' d="' + B(w, c, I.margin) + '"/>', i = 'viewBox="0 0 ' + s + " " + s + '"', R = '<svg xmlns="http://www.w3.org/2000/svg" ' + (I.width ? 'width="' + I.width + '" height="' + I.width + '" ' : "") + i + ' shape-rendering="crispEdges">' + D + o + `</svg>
|
|
5640
5640
|
`;
|
|
5641
5641
|
return typeof n == "function" && n(null, R), R;
|
|
5642
5642
|
}, DB;
|
|
@@ -5646,18 +5646,18 @@ function WE() {
|
|
|
5646
5646
|
if (jC) return Tg;
|
|
5647
5647
|
jC = 1;
|
|
5648
5648
|
const g = kE(), A = pE(), E = ZE(), B = VE();
|
|
5649
|
-
function C(Q, t, n, I,
|
|
5650
|
-
const
|
|
5649
|
+
function C(Q, t, n, I, c) {
|
|
5650
|
+
const w = [].slice.call(arguments, 1), s = w.length, D = typeof w[s - 1] == "function";
|
|
5651
5651
|
if (!D && !g())
|
|
5652
5652
|
throw new Error("Callback required as last argument");
|
|
5653
5653
|
if (D) {
|
|
5654
|
-
if (
|
|
5654
|
+
if (s < 2)
|
|
5655
5655
|
throw new Error("Too few arguments provided");
|
|
5656
|
-
|
|
5656
|
+
s === 2 ? (c = n, n = t, t = I = void 0) : s === 3 && (t.getContext && typeof c == "undefined" ? (c = I, I = void 0) : (c = I, I = n, n = t, t = void 0));
|
|
5657
5657
|
} else {
|
|
5658
|
-
if (
|
|
5658
|
+
if (s < 1)
|
|
5659
5659
|
throw new Error("Too few arguments provided");
|
|
5660
|
-
return
|
|
5660
|
+
return s === 1 ? (n = t, t = I = void 0) : s === 2 && !t.getContext && (I = n, n = t, t = void 0), new Promise(function(o, i) {
|
|
5661
5661
|
try {
|
|
5662
5662
|
const u = A.create(n, I);
|
|
5663
5663
|
o(Q(u, t, I));
|
|
@@ -5668,9 +5668,9 @@ function WE() {
|
|
|
5668
5668
|
}
|
|
5669
5669
|
try {
|
|
5670
5670
|
const o = A.create(n, I);
|
|
5671
|
-
|
|
5671
|
+
c(null, Q(o, t, I));
|
|
5672
5672
|
} catch (o) {
|
|
5673
|
-
|
|
5673
|
+
c(o);
|
|
5674
5674
|
}
|
|
5675
5675
|
}
|
|
5676
5676
|
return Tg.create = A.create, Tg.toCanvas = C.bind(null, E.render), Tg.toDataURL = C.bind(null, E.renderToDataURL), Tg.toString = C.bind(null, function(Q, t, n) {
|
|
@@ -5689,7 +5689,7 @@ function gI(n) {
|
|
|
5689
5689
|
setOrderId: Q,
|
|
5690
5690
|
theme: t = "ocb"
|
|
5691
5691
|
}) {
|
|
5692
|
-
let I = null,
|
|
5692
|
+
let I = null, c = "", w = null, s = (C == null ? void 0 : C.orderId) || null, D = !1, o = 0;
|
|
5693
5693
|
const i = document.createElement("div");
|
|
5694
5694
|
i.className = "wgt:flex wgt:flex-col wgt:gap-6 wgt:relative";
|
|
5695
5695
|
const {
|
|
@@ -5712,13 +5712,13 @@ function gI(n) {
|
|
|
5712
5712
|
theme: t
|
|
5713
5713
|
}));
|
|
5714
5714
|
r.appendChild(T), d.appendChild(r);
|
|
5715
|
-
const { container:
|
|
5715
|
+
const { container: f, resetCountdown: v } = HE(GA(PA({}, C), {
|
|
5716
5716
|
selectedPromotions: (C == null ? void 0 : C.selectedPromotions) || [],
|
|
5717
5717
|
onResetToStep1: () => {
|
|
5718
|
-
|
|
5718
|
+
w && (clearInterval(w), w = null), C != null && C.onResetToStep1 && C.onResetToStep1();
|
|
5719
5719
|
}
|
|
5720
5720
|
}));
|
|
5721
|
-
d.appendChild(
|
|
5721
|
+
d.appendChild(f), i.appendChild(d);
|
|
5722
5722
|
const k = document.createElement("div");
|
|
5723
5723
|
k.className = "wgt:flex wgt:items-center wgt:justify-between wgt:gap-2";
|
|
5724
5724
|
const H = ng({
|
|
@@ -5726,7 +5726,7 @@ function gI(n) {
|
|
|
5726
5726
|
title: a("back"),
|
|
5727
5727
|
className: "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline",
|
|
5728
5728
|
handleClick: () => {
|
|
5729
|
-
A && (clearInterval(
|
|
5729
|
+
A && (clearInterval(w), w = null, A());
|
|
5730
5730
|
}
|
|
5731
5731
|
});
|
|
5732
5732
|
k.appendChild(H), i.appendChild(k);
|
|
@@ -5747,7 +5747,7 @@ function gI(n) {
|
|
|
5747
5747
|
packages: O.packages,
|
|
5748
5748
|
promotionCodes: O.promotionCodes
|
|
5749
5749
|
})).orderId;
|
|
5750
|
-
N !==
|
|
5750
|
+
N !== s && (s = N, Q(N), yield x(N), v());
|
|
5751
5751
|
} catch (l) {
|
|
5752
5752
|
console.error("Error creating order:", l), og(a("errorCreatingOrder") || "Failed to create order");
|
|
5753
5753
|
return;
|
|
@@ -5771,7 +5771,7 @@ function gI(n) {
|
|
|
5771
5771
|
baseURL: TQ(t)
|
|
5772
5772
|
}), !(I != null && I.qr_string))
|
|
5773
5773
|
throw new Error("QR string is empty or undefined");
|
|
5774
|
-
|
|
5774
|
+
c = yield $E.toDataURL(I.qr_string, {
|
|
5775
5775
|
errorCorrectionLevel: "H",
|
|
5776
5776
|
margin: 1,
|
|
5777
5777
|
width: 200,
|
|
@@ -5782,7 +5782,7 @@ function gI(n) {
|
|
|
5782
5782
|
// Background color
|
|
5783
5783
|
}
|
|
5784
5784
|
}), m && m({
|
|
5785
|
-
qrSrc:
|
|
5785
|
+
qrSrc: c,
|
|
5786
5786
|
accountName: (I == null ? void 0 : I.merchant_name) || "",
|
|
5787
5787
|
accountNumber: (I == null ? void 0 : I.va_account_no) || "",
|
|
5788
5788
|
bankName: (I == null ? void 0 : I.bank_code) || ""
|
|
@@ -5821,24 +5821,25 @@ function gI(n) {
|
|
|
5821
5821
|
}
|
|
5822
5822
|
});
|
|
5823
5823
|
}
|
|
5824
|
-
|
|
5824
|
+
s && (yield x(s));
|
|
5825
5825
|
let X = !1;
|
|
5826
5826
|
function U() {
|
|
5827
5827
|
X = !navigator.onLine, console.log("Network status changed:", X ? "offline" : "online");
|
|
5828
5828
|
}
|
|
5829
5829
|
function j() {
|
|
5830
|
-
|
|
5830
|
+
w && (clearInterval(w), w = null), w = setInterval(() => W(null, null, function* () {
|
|
5831
5831
|
var O, e;
|
|
5832
5832
|
try {
|
|
5833
|
-
const h = yield fE(
|
|
5833
|
+
const h = yield fE(s);
|
|
5834
5834
|
if (h.paymentStatus === "pending")
|
|
5835
5835
|
return;
|
|
5836
5836
|
const q = h.paymentStatus === "paid" ? a("paymentSuccess") : a("paymentFailed"), l = PB({
|
|
5837
5837
|
message: q,
|
|
5838
5838
|
okLabel: "OK",
|
|
5839
|
+
theme: t,
|
|
5839
5840
|
isSuccess: h.paymentStatus === "paid",
|
|
5840
5841
|
onClose: function() {
|
|
5841
|
-
clearInterval(
|
|
5842
|
+
clearInterval(w), w = null, g();
|
|
5842
5843
|
},
|
|
5843
5844
|
preventClose: !0
|
|
5844
5845
|
});
|
|
@@ -5855,14 +5856,14 @@ function gI(n) {
|
|
|
5855
5856
|
okLabel: a("tryAgain"),
|
|
5856
5857
|
onClose: function() {
|
|
5857
5858
|
return W(this, null, function* () {
|
|
5858
|
-
clearInterval(
|
|
5859
|
+
clearInterval(w), w = null, yield F();
|
|
5859
5860
|
});
|
|
5860
5861
|
}
|
|
5861
5862
|
}) : ((e = h.response) == null ? void 0 : e.status) === 410 ? og(a("paymentTimeoutMessage"), {
|
|
5862
5863
|
okLabel: a("tryAgain"),
|
|
5863
5864
|
onClose: function() {
|
|
5864
5865
|
return W(this, null, function* () {
|
|
5865
|
-
clearInterval(
|
|
5866
|
+
clearInterval(w), w = null, yield F();
|
|
5866
5867
|
});
|
|
5867
5868
|
}
|
|
5868
5869
|
}) : j();
|
|
@@ -5870,7 +5871,7 @@ function gI(n) {
|
|
|
5870
5871
|
}), 5e3);
|
|
5871
5872
|
}
|
|
5872
5873
|
return window.addEventListener("online", U), window.addEventListener("offline", U), window.addEventListener("beforeunload", function() {
|
|
5873
|
-
|
|
5874
|
+
w && (clearInterval(w), w = null);
|
|
5874
5875
|
}), { container: i };
|
|
5875
5876
|
});
|
|
5876
5877
|
}
|
|
@@ -5892,12 +5893,12 @@ function BI({
|
|
|
5892
5893
|
n.className = "wgt:w-full wgt:max-w-3xl wgt:space-y-4 wgt:rounded-xl wgt:bg-white", t.appendChild(n);
|
|
5893
5894
|
const I = document.createElement("h3");
|
|
5894
5895
|
I.className = "wgt:text-sm wgt:font-semibold wgt:text-text-black", I.innerText = a("confirmationTitle"), n.appendChild(I);
|
|
5895
|
-
const w = document.createElement("div");
|
|
5896
|
-
w.className = "wgt:flex wgt:items-center wgt:gap-4", n.appendChild(w);
|
|
5897
5896
|
const c = document.createElement("div");
|
|
5898
|
-
c.className = "wgt:flex wgt:
|
|
5899
|
-
const
|
|
5900
|
-
|
|
5897
|
+
c.className = "wgt:flex wgt:items-center wgt:gap-4", n.appendChild(c);
|
|
5898
|
+
const w = document.createElement("div");
|
|
5899
|
+
w.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:shrink-0 wgt:items-center wgt:justify-center wgt:rounded-full wgt:bg-primary wgt:text-xs wgt:font-semibold wgt:text-white", w.innerText = "1", c.appendChild(w);
|
|
5900
|
+
const s = document.createElement("p");
|
|
5901
|
+
s.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", s.innerText = a("notice1"), c.appendChild(s);
|
|
5901
5902
|
const D = document.createElement("div");
|
|
5902
5903
|
D.className = "wgt:flex wgt:items-start wgt:gap-4", n.appendChild(D);
|
|
5903
5904
|
const o = document.createElement("div");
|
|
@@ -5954,8 +5955,8 @@ function BI({
|
|
|
5954
5955
|
`, Y.appendChild(T);
|
|
5955
5956
|
const m = document.createElement("span");
|
|
5956
5957
|
m.innerHTML = `${a("email")}: <b>${(r == null ? void 0 : r.email) || ""}</b>`, Y.appendChild(m);
|
|
5957
|
-
const
|
|
5958
|
-
|
|
5958
|
+
const f = document.createElement("div");
|
|
5959
|
+
f.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", R.appendChild(f);
|
|
5959
5960
|
const v = document.createElement("div");
|
|
5960
5961
|
v.innerHTML = `
|
|
5961
5962
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -5968,9 +5969,9 @@ function BI({
|
|
|
5968
5969
|
</clipPath>
|
|
5969
5970
|
</defs>
|
|
5970
5971
|
</svg>
|
|
5971
|
-
`,
|
|
5972
|
+
`, f.appendChild(v), f.appendChild(document.createTextNode(a("website") + ": "));
|
|
5972
5973
|
const k = document.createElement("a");
|
|
5973
|
-
k.className = "wgt:text-strong-950 wgt:hover:underline wgt:cursor-pointer", k.innerHTML = `<b>${(r == null ? void 0 : r.link) || ""}</b>`, k.href = (r == null ? void 0 : r.link) || "#", k.target = "_blank",
|
|
5974
|
+
k.className = "wgt:text-strong-950 wgt:hover:underline wgt:cursor-pointer", k.innerHTML = `<b>${(r == null ? void 0 : r.link) || ""}</b>`, k.href = (r == null ? void 0 : r.link) || "#", k.target = "_blank", f.appendChild(k);
|
|
5974
5975
|
const H = document.createElement("div");
|
|
5975
5976
|
H.className = "wgt:flex wgt:items-center wgt:gap-4", n.appendChild(H);
|
|
5976
5977
|
const F = document.createElement("div");
|
|
@@ -6072,10 +6073,10 @@ function KC(B) {
|
|
|
6072
6073
|
C.style.display = "flex", C.style.flexDirection = "column", C.style.gap = "0", C.style.width = "100%", C.style.height = "100%", C.style.minHeight = "0", window.matchMedia("(min-width: 640px)").matches && (C.style.gap = "1rem");
|
|
6073
6074
|
let Q = "";
|
|
6074
6075
|
try {
|
|
6075
|
-
const
|
|
6076
|
-
Q =
|
|
6077
|
-
} catch (
|
|
6078
|
-
return console.error("Failed to fetch wireframe URL:",
|
|
6076
|
+
const c = yield fQ({ orderId: g });
|
|
6077
|
+
Q = c && c.url ? c.url : "";
|
|
6078
|
+
} catch (c) {
|
|
6079
|
+
return console.error("Failed to fetch wireframe URL:", c), C.innerHTML = `
|
|
6079
6080
|
<div style="display: flex; align-items: center; justify-content: center; height: 100%; padding: 1rem;">
|
|
6080
6081
|
<p style="color: #ef4444; text-align: center; font-size: 0.875rem;">
|
|
6081
6082
|
Không thể tải hợp đồng.
|
|
@@ -6088,8 +6089,8 @@ function KC(B) {
|
|
|
6088
6089
|
const n = document.createElement("iframe");
|
|
6089
6090
|
return n.src = Q, n.style.position = "absolute", n.style.top = "0", n.style.left = "0", n.style.width = "100%", n.style.height = "100%", n.style.borderRadius = "0", n.style.border = "0", window.matchMedia("(min-width: 640px)").matches && (n.style.borderRadius = "0.375rem"), n.loading = "lazy", n.allowFullscreen = !0, n.setAttribute("scrolling", "auto"), n.setAttribute("frameBorder", "0"), t.appendChild(n), C.appendChild(t), { container: C, cleanup: () => {
|
|
6090
6091
|
document.body.classList.remove("no-scroll"), n.classList.remove("block-interaction");
|
|
6091
|
-
const
|
|
6092
|
-
|
|
6092
|
+
const c = document.getElementById("signature-popup-backdrop");
|
|
6093
|
+
c && c.remove();
|
|
6093
6094
|
} };
|
|
6094
6095
|
});
|
|
6095
6096
|
}
|
|
@@ -6099,8 +6100,8 @@ function EQ(g, A) {
|
|
|
6099
6100
|
function Q() {
|
|
6100
6101
|
const I = UC(E);
|
|
6101
6102
|
if (I !== C) {
|
|
6102
|
-
const
|
|
6103
|
-
C = I, g(I,
|
|
6103
|
+
const c = C;
|
|
6104
|
+
C = I, g(I, c);
|
|
6104
6105
|
}
|
|
6105
6106
|
}
|
|
6106
6107
|
window.addEventListener("popstate", Q), E && window.addEventListener("hashchange", Q);
|
|
@@ -6172,7 +6173,7 @@ function DI({
|
|
|
6172
6173
|
} catch (X) {
|
|
6173
6174
|
}
|
|
6174
6175
|
});
|
|
6175
|
-
const
|
|
6176
|
+
const c = oI(), w = aI(c), s = `Bạn có thể vào <strong style="color: ${w} !important;">Thiết lập</strong> để sử dụng dịch vụ, <br> hoặc chọn <strong style="color: ${w} !important;">Tiếp tục</strong> để đăng ký mới (có thể phát sinh phí).`, D = document.createElement("div");
|
|
6176
6177
|
D.style.cssText = `
|
|
6177
6178
|
position: fixed;
|
|
6178
6179
|
inset: 0;
|
|
@@ -6182,7 +6183,7 @@ function DI({
|
|
|
6182
6183
|
justify-content: center;
|
|
6183
6184
|
background-color: rgba(0, 0, 0, 0.5);
|
|
6184
6185
|
backdrop-filter: blur(4px);
|
|
6185
|
-
`, D.setAttribute("role", "dialog"), D.setAttribute("aria-modal", "true"), D.setAttribute("data-wgt-warning-popup", "true"), D.setAttribute("data-theme",
|
|
6186
|
+
`, D.setAttribute("role", "dialog"), D.setAttribute("aria-modal", "true"), D.setAttribute("data-wgt-warning-popup", "true"), D.setAttribute("data-theme", c);
|
|
6186
6187
|
const o = document.createElement("div");
|
|
6187
6188
|
if (o.style.cssText = `
|
|
6188
6189
|
position: relative;
|
|
@@ -6250,7 +6251,7 @@ function DI({
|
|
|
6250
6251
|
font-size: 0.9rem;
|
|
6251
6252
|
color: #4b5563;
|
|
6252
6253
|
line-height: 1.6;
|
|
6253
|
-
`, M.innerHTML =
|
|
6254
|
+
`, M.innerHTML = s, o.appendChild(M);
|
|
6254
6255
|
const d = document.createElement("div");
|
|
6255
6256
|
d.style.cssText = `
|
|
6256
6257
|
display: flex;
|
|
@@ -6268,7 +6269,7 @@ function DI({
|
|
|
6268
6269
|
border: none;
|
|
6269
6270
|
font-size: 1rem;
|
|
6270
6271
|
font-weight: 500;
|
|
6271
|
-
background-color: ${
|
|
6272
|
+
background-color: ${w};
|
|
6272
6273
|
transition: opacity 0.2s ease;
|
|
6273
6274
|
`, r.addEventListener(
|
|
6274
6275
|
"mouseenter",
|
|
@@ -6294,21 +6295,21 @@ function DI({
|
|
|
6294
6295
|
background-color: white;
|
|
6295
6296
|
transition: background-color 0.2s ease, color 0.2s ease;
|
|
6296
6297
|
`, P.addEventListener("mouseenter", () => {
|
|
6297
|
-
P.style.backgroundColor = `${
|
|
6298
|
+
P.style.backgroundColor = `${w}10`;
|
|
6298
6299
|
}), P.addEventListener("mouseleave", () => {
|
|
6299
6300
|
P.style.backgroundColor = "white";
|
|
6300
6301
|
}), P.addEventListener("focus", () => P.style.outline = "none"), d.appendChild(P);
|
|
6301
6302
|
let Y = !1, T = !1;
|
|
6302
6303
|
const m = (x) => {
|
|
6303
6304
|
x.target === D && !B && F(!1);
|
|
6304
|
-
},
|
|
6305
|
+
}, f = (x) => {
|
|
6305
6306
|
x.key === "Escape" && !B && F(!1);
|
|
6306
6307
|
};
|
|
6307
6308
|
function v() {
|
|
6308
|
-
D.addEventListener("click", m), window.addEventListener("keydown",
|
|
6309
|
+
D.addEventListener("click", m), window.addEventListener("keydown", f), r.addEventListener("click", () => F(!0)), P.addEventListener("click", () => F(!1));
|
|
6309
6310
|
}
|
|
6310
6311
|
function k() {
|
|
6311
|
-
D.removeEventListener("click", m), window.removeEventListener("keydown",
|
|
6312
|
+
D.removeEventListener("click", m), window.removeEventListener("keydown", f);
|
|
6312
6313
|
}
|
|
6313
6314
|
function H() {
|
|
6314
6315
|
Y || (Y = !0, document.body.appendChild(D), D.style.display = "flex", setTimeout(() => r.focus(), 0), v());
|
|
@@ -6327,19 +6328,20 @@ function DI({
|
|
|
6327
6328
|
}
|
|
6328
6329
|
function uB(g, A, E, B = !1, C = "ocb", Q = "") {
|
|
6329
6330
|
return W(this, null, function* () {
|
|
6331
|
+
var t, n;
|
|
6330
6332
|
try {
|
|
6331
6333
|
if (C !== "bvb") {
|
|
6332
6334
|
E(!0, null);
|
|
6333
6335
|
return;
|
|
6334
6336
|
}
|
|
6335
|
-
const
|
|
6336
|
-
let
|
|
6337
|
+
const I = yield RQ(g, A, "HDTT");
|
|
6338
|
+
let c = null;
|
|
6337
6339
|
if (B) {
|
|
6338
|
-
E(
|
|
6340
|
+
E(I.isNewCustomer, null);
|
|
6339
6341
|
return;
|
|
6340
6342
|
}
|
|
6341
|
-
if (!
|
|
6342
|
-
|
|
6343
|
+
if (!I.isNewCustomer) {
|
|
6344
|
+
c = yield YQ(g, A), yield E(I.isNewCustomer, c), yield new Promise((s) => setTimeout(s, 1e3)), (((t = c == null ? void 0 : c.organization) == null ? void 0 : t.name) || ((n = c == null ? void 0 : c.organization) == null ? void 0 : n.taxCode)) && DI({
|
|
6343
6345
|
settingUrl: Q,
|
|
6344
6346
|
onCancel: () => {
|
|
6345
6347
|
E(!0, null);
|
|
@@ -6350,8 +6352,8 @@ function uB(g, A, E, B = !1, C = "ocb", Q = "") {
|
|
|
6350
6352
|
return;
|
|
6351
6353
|
}
|
|
6352
6354
|
E(!0, null);
|
|
6353
|
-
} catch (
|
|
6354
|
-
console.error("Error checking new customer:",
|
|
6355
|
+
} catch (I) {
|
|
6356
|
+
console.error("Error checking new customer:", I), E(!0, null);
|
|
6355
6357
|
}
|
|
6356
6358
|
});
|
|
6357
6359
|
}
|
|
@@ -6369,11 +6371,11 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6369
6371
|
function I() {
|
|
6370
6372
|
return [a("stepInfo"), a("stepPlan"), a("stepPayment")];
|
|
6371
6373
|
}
|
|
6372
|
-
let
|
|
6374
|
+
let c = vQ({
|
|
6373
6375
|
steps: I(),
|
|
6374
6376
|
currentStep: 1
|
|
6375
|
-
}), { container:
|
|
6376
|
-
g.dataset.theme = C || "default", g.classList.add("wgt:mx-auto", "wgt:@container"), g.appendChild(
|
|
6377
|
+
}), { container: w, setStep: s, setContent: D } = c;
|
|
6378
|
+
g.dataset.theme = C || "default", g.classList.add("wgt:mx-auto", "wgt:@container"), g.appendChild(w);
|
|
6377
6379
|
let o = 1, i = n[0], u = {
|
|
6378
6380
|
eInvoiceRegistration: {
|
|
6379
6381
|
taxAuthorityCode: "",
|
|
@@ -6412,7 +6414,7 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6412
6414
|
idCardBack: null,
|
|
6413
6415
|
packages: [],
|
|
6414
6416
|
promotionCodes: []
|
|
6415
|
-
}, R = !0, M = !Q, d = null, r = null, P = null, Y = null, T = 0, m = null,
|
|
6417
|
+
}, R = !0, M = !Q, d = null, r = null, P = null, Y = null, T = 0, m = null, f = null, v = null, k = {
|
|
6416
6418
|
qtyRegFee: 1,
|
|
6417
6419
|
qtyInvoicePkg: 1,
|
|
6418
6420
|
qtySignaturePkg: 1
|
|
@@ -6506,7 +6508,7 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6506
6508
|
});
|
|
6507
6509
|
}
|
|
6508
6510
|
function x() {
|
|
6509
|
-
H(), o = 1,
|
|
6511
|
+
H(), o = 1, s(o, I()), j(o);
|
|
6510
6512
|
}
|
|
6511
6513
|
function X() {
|
|
6512
6514
|
typeof window != "undefined" && window.scrollTo({
|
|
@@ -6571,7 +6573,7 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6571
6573
|
updateRegistrationData: U,
|
|
6572
6574
|
serial: (B == null ? void 0 : B.serial) || "",
|
|
6573
6575
|
onSubmit: (y) => {
|
|
6574
|
-
u.eInvoiceRegistration = PA(PA({}, u.eInvoiceRegistration), y.eInvoiceRegistration), u.logo = y.logo || null, u.license = y.license || null, u.idCard = y.idCard || null, u.idCardBack = y.idCardBack || null, u.provider = i.route, o = 2,
|
|
6576
|
+
u.eInvoiceRegistration = PA(PA({}, u.eInvoiceRegistration), y.eInvoiceRegistration), u.logo = y.logo || null, u.license = y.license || null, u.idCard = y.idCard || null, u.idCardBack = y.idCardBack || null, u.provider = i.route, o = 2, s(o, I()), j(o), X();
|
|
6575
6577
|
},
|
|
6576
6578
|
registrationData: u,
|
|
6577
6579
|
theme: C || "default",
|
|
@@ -6591,10 +6593,10 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6591
6593
|
} else if (L === 2) {
|
|
6592
6594
|
const { container: b } = yield lE({
|
|
6593
6595
|
onNext: () => W(null, null, function* () {
|
|
6594
|
-
o = 3,
|
|
6596
|
+
o = 3, s(o, I()), j(o), X();
|
|
6595
6597
|
}),
|
|
6596
6598
|
onPrev: () => {
|
|
6597
|
-
o = 1,
|
|
6599
|
+
o = 1, s(o, I()), j(o), X();
|
|
6598
6600
|
},
|
|
6599
6601
|
setSelectedInitPackage: (y) => {
|
|
6600
6602
|
r = y;
|
|
@@ -6612,7 +6614,7 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6612
6614
|
T = y;
|
|
6613
6615
|
},
|
|
6614
6616
|
setSelectedPromotions: (y) => {
|
|
6615
|
-
|
|
6617
|
+
f = y;
|
|
6616
6618
|
},
|
|
6617
6619
|
setPackages: (y) => {
|
|
6618
6620
|
u.packages = y;
|
|
@@ -6623,7 +6625,7 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6623
6625
|
selectedInitPackage: r,
|
|
6624
6626
|
selectedInvoiceOtp: P,
|
|
6625
6627
|
selectedSignatureOtp: Y,
|
|
6626
|
-
selectedPromotions:
|
|
6628
|
+
selectedPromotions: f,
|
|
6627
6629
|
theme: C,
|
|
6628
6630
|
selectedProvider: i,
|
|
6629
6631
|
registrationData: u,
|
|
@@ -6637,10 +6639,10 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6637
6639
|
} else if (L === 3) {
|
|
6638
6640
|
const { container: b } = yield gI({
|
|
6639
6641
|
onNext: () => {
|
|
6640
|
-
o = 4,
|
|
6642
|
+
o = 4, s(o, I()), j(o), X();
|
|
6641
6643
|
},
|
|
6642
6644
|
onPrev: () => {
|
|
6643
|
-
o = 2,
|
|
6645
|
+
o = 2, s(o, I()), j(o), X();
|
|
6644
6646
|
},
|
|
6645
6647
|
step: 3,
|
|
6646
6648
|
checkoutProps: {
|
|
@@ -6655,10 +6657,10 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6655
6657
|
selectedProvider: i || { name: "", logo: "" },
|
|
6656
6658
|
selectedInvoiceOtp: P || { unitsPerMonth: 0 },
|
|
6657
6659
|
selectedSignatureOtp: Y || { durationYears: 0 },
|
|
6658
|
-
selectedPromotions:
|
|
6660
|
+
selectedPromotions: f,
|
|
6659
6661
|
totalAmountText: T,
|
|
6660
6662
|
onCancel: () => {
|
|
6661
|
-
o = 2,
|
|
6663
|
+
o = 2, s(o, I()), j(o), X();
|
|
6662
6664
|
},
|
|
6663
6665
|
onResetToStep1: x
|
|
6664
6666
|
},
|
|
@@ -6671,7 +6673,7 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6671
6673
|
const { container: b } = BI({
|
|
6672
6674
|
orderId: d || "",
|
|
6673
6675
|
onPrev: () => {
|
|
6674
|
-
o = 3,
|
|
6676
|
+
o = 3, s(o, I()), j(o), X();
|
|
6675
6677
|
},
|
|
6676
6678
|
onReturnHome: A || (() => {
|
|
6677
6679
|
}),
|
|
@@ -6684,7 +6686,7 @@ function fI(g, A, E, B, C, Q) {
|
|
|
6684
6686
|
}
|
|
6685
6687
|
});
|
|
6686
6688
|
}
|
|
6687
|
-
|
|
6689
|
+
c.updateTitle(
|
|
6688
6690
|
M ? a("eInvoiceRegister") : a("eInvoiceRenewal")
|
|
6689
6691
|
);
|
|
6690
6692
|
const { container: O, open: e } = qB();
|
|
@@ -6717,22 +6719,22 @@ function mI(g, A, E, B) {
|
|
|
6717
6719
|
onCompleteSignature: B
|
|
6718
6720
|
});
|
|
6719
6721
|
Q(I), g.appendChild(C);
|
|
6720
|
-
const { container:
|
|
6722
|
+
const { container: c } = yield KC({
|
|
6721
6723
|
orderId: t,
|
|
6722
6724
|
callbackUrl: n,
|
|
6723
6725
|
onCompleteSignature: B
|
|
6724
6726
|
});
|
|
6725
|
-
Q(
|
|
6726
|
-
const
|
|
6727
|
+
Q(c);
|
|
6728
|
+
const w = EQ(
|
|
6727
6729
|
() => {
|
|
6728
|
-
|
|
6730
|
+
s();
|
|
6729
6731
|
},
|
|
6730
6732
|
{ includeHash: !1 }
|
|
6731
6733
|
);
|
|
6732
|
-
function
|
|
6733
|
-
|
|
6734
|
+
function s() {
|
|
6735
|
+
w(), g && g.parentNode && (g.innerHTML = "");
|
|
6734
6736
|
}
|
|
6735
|
-
return { destroy:
|
|
6737
|
+
return { destroy: s };
|
|
6736
6738
|
});
|
|
6737
6739
|
}
|
|
6738
6740
|
export {
|