@invoice-sdk/widget 1.3.1 → 1.4.0
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.esm.js +801 -731
- package/dist/index.umd.js +6 -6
- package/dist/widget.css +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,424 +1,445 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Z({ steps: m = [], currentStep: e = 1 } = {}) {
|
|
2
|
+
const s = document.createElement("div");
|
|
3
|
+
s.className = [
|
|
4
|
+
"wgt:relative",
|
|
5
|
+
"wgt:flex",
|
|
6
|
+
"wgt:bg-weak-50",
|
|
7
|
+
"wgt:rounded-[10px]",
|
|
8
|
+
"wgt:overflow-hidden",
|
|
9
|
+
"wgt:shadow-sm",
|
|
10
|
+
"wgt:justify-between"
|
|
11
|
+
].join(" ");
|
|
2
12
|
const o = document.createElement("div");
|
|
3
13
|
o.className = [
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"justify-between"
|
|
11
|
-
].join(" ");
|
|
12
|
-
const l = document.createElement("div");
|
|
13
|
-
l.className = [
|
|
14
|
-
"absolute",
|
|
15
|
-
"inset-0",
|
|
16
|
-
"h-full",
|
|
17
|
-
"bg-primary/16",
|
|
18
|
-
"transition-all",
|
|
19
|
-
"duration-250"
|
|
14
|
+
"wgt:absolute",
|
|
15
|
+
"wgt:inset-0",
|
|
16
|
+
"wgt:h-full",
|
|
17
|
+
"wgt:bg-primary/16",
|
|
18
|
+
"wgt:transition-all",
|
|
19
|
+
"wgt:duration-250"
|
|
20
20
|
].join(" ");
|
|
21
21
|
const c = document.createElement("div");
|
|
22
|
-
c.className = "relative flex w-full z-10";
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const
|
|
22
|
+
c.className = "wgt:relative wgt:flex wgt:w-full wgt:z-10";
|
|
23
|
+
const t = [];
|
|
24
|
+
m.forEach((n, r) => {
|
|
25
|
+
const l = r + 1, a = document.createElement("div");
|
|
26
26
|
a.setAttribute("role", "listitem"), a.setAttribute(
|
|
27
27
|
"aria-label",
|
|
28
|
-
`Step ${
|
|
28
|
+
`Step ${l} of ${m.length}: ${n.label}${e === l ? " (current)" : ""}`
|
|
29
29
|
), a.className = [
|
|
30
|
-
"relative",
|
|
31
|
-
"flex-1",
|
|
32
|
-
"flex",
|
|
33
|
-
"items-center",
|
|
34
|
-
"justify-center",
|
|
35
|
-
"py-5",
|
|
36
|
-
"pr-9",
|
|
37
|
-
"px-4"
|
|
30
|
+
"wgt:relative",
|
|
31
|
+
"wgt:flex-1",
|
|
32
|
+
"wgt:flex",
|
|
33
|
+
"wgt:items-center",
|
|
34
|
+
"wgt:justify-center",
|
|
35
|
+
"wgt:py-5",
|
|
36
|
+
"wgt:pr-9",
|
|
37
|
+
"wgt:px-4"
|
|
38
38
|
].join(" ");
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
"flex",
|
|
42
|
-
"items-center",
|
|
43
|
-
"justify-center",
|
|
44
|
-
"w-8",
|
|
45
|
-
"h-8",
|
|
46
|
-
"rounded-full",
|
|
39
|
+
const g = document.createElement("div");
|
|
40
|
+
g.className = [
|
|
41
|
+
"wgt:flex",
|
|
42
|
+
"wgt:items-center",
|
|
43
|
+
"wgt:justify-center",
|
|
44
|
+
"wgt:w-8",
|
|
45
|
+
"wgt:h-8",
|
|
46
|
+
"wgt:rounded-full",
|
|
47
47
|
// color will be set in update()
|
|
48
|
-
"flex-shrink-0",
|
|
49
|
-
"mr-4"
|
|
48
|
+
"wgt:flex-shrink-0",
|
|
49
|
+
"wgt:mr-4"
|
|
50
50
|
].join(" ");
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
function d(
|
|
57
|
-
const r =
|
|
51
|
+
const i = document.createElement("span");
|
|
52
|
+
i.innerText = String(l), i.className = "wgt:text-white wgt:font-medium", g.appendChild(i);
|
|
53
|
+
const w = document.createElement("span");
|
|
54
|
+
w.innerText = n.label, w.className = "wgt:font-medium wgt:whitespace-nowrap", a.appendChild(g), a.appendChild(w), c.appendChild(a), t.push({ wrapper: a, circle: g, textSpan: w });
|
|
55
|
+
}), s.appendChild(o), s.appendChild(c);
|
|
56
|
+
function d(n) {
|
|
57
|
+
const r = s.getBoundingClientRect(), l = r.width || 0;
|
|
58
58
|
let a = 0;
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
a =
|
|
59
|
+
if (n > 0 && n <= t.length) {
|
|
60
|
+
const w = t[n - 1].wrapper.getBoundingClientRect(), u = r.left;
|
|
61
|
+
a = w.left - u + w.width;
|
|
62
62
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
63
|
+
const g = l > 0 ? Math.min(a / l * 100, 100) : 0;
|
|
64
|
+
o.style.width = `${g}%`, t.forEach((i, w) => {
|
|
65
|
+
const u = w + 1, T = u < n, f = u === n;
|
|
66
|
+
T || f ? (i.textSpan.classList.add("wgt:text-primary-dark"), i.textSpan.classList.remove("wgt:text-soft-400")) : (i.textSpan.classList.add("wgt:text-soft-400"), i.textSpan.classList.remove("wgt:text-primary-dark")), T || f ? (i.circle.classList.add("wgt:bg-icon-primary"), i.circle.classList.remove("wgt:bg-icon-soft-400")) : (i.circle.classList.add("wgt:bg-icon-soft-400"), i.circle.classList.remove("wgt:bg-icon-primary"));
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
return setTimeout(() => d(
|
|
70
|
-
container:
|
|
69
|
+
return setTimeout(() => d(e), 0), {
|
|
70
|
+
container: s,
|
|
71
71
|
/**
|
|
72
72
|
* @param {number} newStep – the new 1‐based current step
|
|
73
73
|
*/
|
|
74
|
-
update(
|
|
75
|
-
d(
|
|
74
|
+
update(n) {
|
|
75
|
+
d(n);
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
function _({ steps: m = [], currentStep: e = 1 } = {}) {
|
|
80
|
+
const s = document.createElement("div");
|
|
81
|
+
s.className = [
|
|
82
|
+
"wgt:flex",
|
|
83
|
+
"wgt:flex-col",
|
|
84
|
+
"wgt:h-fit",
|
|
85
|
+
"wgt:gap-6",
|
|
86
|
+
"wgt:items-center",
|
|
87
|
+
"wgt:justify-start",
|
|
88
|
+
"wgt:fixed",
|
|
89
|
+
"wgt:w-full",
|
|
90
|
+
"wgt:h-screen",
|
|
91
|
+
"wgt:inset-0",
|
|
92
|
+
"wgt:py-8",
|
|
93
|
+
"wgt:overflow-auto"
|
|
94
|
+
].join(" ");
|
|
95
|
+
const o = document.createElement("h1");
|
|
96
|
+
o.className = [
|
|
97
|
+
"wgt:text-[28px]",
|
|
98
|
+
"wgt:font-bold",
|
|
99
|
+
"wgt:leading-[30px]",
|
|
100
|
+
"wgt:text-strong-950"
|
|
101
|
+
].join(" "), o.innerText = "Đăng ký hóa đơn điện tử";
|
|
84
102
|
const c = document.createElement("div");
|
|
85
103
|
c.className = [
|
|
86
|
-
"w-[1320px]",
|
|
87
|
-
"flex-1",
|
|
88
|
-
"mx-auto",
|
|
89
|
-
"p-6",
|
|
90
|
-
"flex",
|
|
91
|
-
"flex-col",
|
|
92
|
-
"border",
|
|
93
|
-
"border-[#E1E4EA]",
|
|
94
|
-
"rounded-3xl",
|
|
95
|
-
"gap-6",
|
|
96
|
-
"shadow-[0px_1px_8px_0px_rgba(82,88,102,0.06)]"
|
|
104
|
+
"wgt:w-[1320px]",
|
|
105
|
+
"wgt:flex-1",
|
|
106
|
+
"wgt:mx-auto",
|
|
107
|
+
"wgt:p-6",
|
|
108
|
+
"wgt:flex",
|
|
109
|
+
"wgt:flex-col",
|
|
110
|
+
"wgt:border",
|
|
111
|
+
"wgt:border-[#E1E4EA]",
|
|
112
|
+
"wgt:rounded-3xl",
|
|
113
|
+
"wgt:gap-6",
|
|
114
|
+
"wgt:shadow-[0px_1px_8px_0px_rgba(82,88,102,0.06)]"
|
|
97
115
|
].join(" ");
|
|
98
|
-
const
|
|
99
|
-
|
|
116
|
+
const t = Z({
|
|
117
|
+
steps: m.map((n) => ({ label: n })),
|
|
118
|
+
currentStep: e
|
|
119
|
+
});
|
|
120
|
+
c.appendChild(t.container);
|
|
100
121
|
const d = document.createElement("div");
|
|
101
|
-
return d.className = "flex-1", c.appendChild(d),
|
|
102
|
-
container:
|
|
122
|
+
return d.className = "wgt:flex-1", c.appendChild(d), s.appendChild(o), s.appendChild(c), {
|
|
123
|
+
container: s,
|
|
103
124
|
/**
|
|
104
125
|
* Change which step is active (1‐based index):
|
|
105
126
|
*/
|
|
106
|
-
setStep(
|
|
107
|
-
|
|
127
|
+
setStep(n) {
|
|
128
|
+
t.update(n);
|
|
108
129
|
},
|
|
109
130
|
/**
|
|
110
131
|
* Replace whatever content is inside the “children” area:
|
|
111
132
|
* @param {HTMLElement} domNode
|
|
112
133
|
*/
|
|
113
|
-
setContent(
|
|
114
|
-
d.replaceChildren(
|
|
134
|
+
setContent(n) {
|
|
135
|
+
d.replaceChildren(n);
|
|
115
136
|
}
|
|
116
137
|
};
|
|
117
138
|
}
|
|
118
|
-
function
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
const r =
|
|
124
|
-
typeof
|
|
139
|
+
function I({ checked: m = !1, onChange: e }) {
|
|
140
|
+
const s = document.createElement("label");
|
|
141
|
+
s.className = "wgt:relative wgt:inline-flex wgt:cursor-pointer wgt:items-center";
|
|
142
|
+
const o = document.createElement("input");
|
|
143
|
+
o.type = "checkbox", o.checked = m, o.className = "wgt:peer wgt:sr-only", o.addEventListener("change", (n) => {
|
|
144
|
+
const r = n.target.checked;
|
|
145
|
+
typeof e == "function" && e(r), o.checked = r, t(r);
|
|
125
146
|
});
|
|
126
147
|
const c = document.createElement("div");
|
|
127
148
|
c.className = [
|
|
128
|
-
"border-grey-6",
|
|
129
|
-
"relative",
|
|
130
|
-
"h-5",
|
|
131
|
-
"w-5",
|
|
132
|
-
"rounded-full",
|
|
133
|
-
"border-2"
|
|
149
|
+
"wgt:border-grey-6",
|
|
150
|
+
"wgt:relative",
|
|
151
|
+
"wgt:h-5",
|
|
152
|
+
"wgt:w-5",
|
|
153
|
+
"wgt:rounded-full",
|
|
154
|
+
"wgt:border-2"
|
|
134
155
|
// The “before:” pseudo‐element shows when checked → we’ll toggle via JS
|
|
135
156
|
].join(" ");
|
|
136
|
-
function
|
|
137
|
-
|
|
157
|
+
function t(n) {
|
|
158
|
+
n ? (c.classList.add("wgt:border-primary"), d.style.display = "block") : (c.classList.remove("wgt:border-primary"), d.style.display = "none");
|
|
138
159
|
}
|
|
139
160
|
const d = document.createElement("div");
|
|
140
161
|
return d.className = [
|
|
141
|
-
"absolute",
|
|
142
|
-
"left-1/2",
|
|
143
|
-
"top-1/2",
|
|
144
|
-
"h-2.5",
|
|
145
|
-
"w-2.5",
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"rounded-full",
|
|
149
|
-
"bg-primary"
|
|
150
|
-
].join(" "), d.style.display =
|
|
151
|
-
container:
|
|
152
|
-
setChecked(
|
|
153
|
-
|
|
162
|
+
"wgt:absolute",
|
|
163
|
+
"wgt:left-1/2",
|
|
164
|
+
"wgt:top-1/2",
|
|
165
|
+
"wgt:h-2.5",
|
|
166
|
+
"wgt:w-2.5",
|
|
167
|
+
"wgt:-translate-x-1/2",
|
|
168
|
+
"wgt:-translate-y-1/2",
|
|
169
|
+
"wgt:rounded-full",
|
|
170
|
+
"wgt:bg-primary"
|
|
171
|
+
].join(" "), d.style.display = m ? "block" : "none", c.appendChild(d), s.appendChild(o), s.appendChild(c), {
|
|
172
|
+
container: s,
|
|
173
|
+
setChecked(n) {
|
|
174
|
+
o.checked = n, t(n), typeof e == "function" && e(n);
|
|
154
175
|
}
|
|
155
176
|
};
|
|
156
177
|
}
|
|
157
|
-
function
|
|
158
|
-
providers:
|
|
159
|
-
selectedRoute:
|
|
160
|
-
onProviderChange:
|
|
178
|
+
function $({
|
|
179
|
+
providers: m = [],
|
|
180
|
+
selectedRoute: e = null,
|
|
181
|
+
onProviderChange: s
|
|
161
182
|
}) {
|
|
162
|
-
const
|
|
163
|
-
|
|
183
|
+
const o = document.createElement("div");
|
|
184
|
+
o.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
164
185
|
const c = document.createElement("h2");
|
|
165
|
-
c.className = "heading", c.innerText = "Nhà cung cấp",
|
|
166
|
-
const
|
|
167
|
-
|
|
186
|
+
c.className = "heading", c.innerText = "Nhà cung cấp", o.appendChild(c);
|
|
187
|
+
const t = document.createElement("div");
|
|
188
|
+
t.className = "wgt:grid wgt:grid-cols-3 wgt:gap-4", o.appendChild(t);
|
|
168
189
|
function d() {
|
|
169
|
-
|
|
170
|
-
const r =
|
|
171
|
-
|
|
172
|
-
"flex",
|
|
173
|
-
"items-center",
|
|
174
|
-
"justify-between",
|
|
175
|
-
"gap-2",
|
|
176
|
-
"p-4",
|
|
177
|
-
"border",
|
|
178
|
-
"border-border-light",
|
|
179
|
-
"rounded-xl",
|
|
180
|
-
"hover:bg-gray-100",
|
|
181
|
-
"cursor-pointer",
|
|
182
|
-
"transition-colors",
|
|
183
|
-
"duration-200",
|
|
184
|
-
r ? "border-primary" : ""
|
|
185
|
-
].filter(Boolean).join(" "),
|
|
186
|
-
|
|
190
|
+
t.innerHTML = "", m.forEach((n) => {
|
|
191
|
+
const r = n.route === e, l = document.createElement("div");
|
|
192
|
+
l.dataset.checked = r ? "true" : "false", l.className = [
|
|
193
|
+
"wgt:flex",
|
|
194
|
+
"wgt:items-center",
|
|
195
|
+
"wgt:justify-between",
|
|
196
|
+
"wgt:gap-2",
|
|
197
|
+
"wgt:p-4",
|
|
198
|
+
"wgt:border",
|
|
199
|
+
"wgt:border-border-light",
|
|
200
|
+
"wgt:rounded-xl",
|
|
201
|
+
"wgt:hover:bg-gray-100",
|
|
202
|
+
"wgt:cursor-pointer",
|
|
203
|
+
"wgt:transition-colors",
|
|
204
|
+
"wgt:duration-200",
|
|
205
|
+
r ? "wgt:border-primary" : ""
|
|
206
|
+
].filter(Boolean).join(" "), l.addEventListener("click", () => {
|
|
207
|
+
e = n.route, typeof s == "function" && s(n), d();
|
|
187
208
|
});
|
|
188
209
|
const a = document.createElement("div");
|
|
189
|
-
a.className = "flex items-center gap-3";
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
const { container:
|
|
210
|
+
a.className = "wgt:flex wgt:items-center wgt:gap-3";
|
|
211
|
+
const g = document.createElement("img");
|
|
212
|
+
g.src = n.logoUrl, g.alt = n.name, g.className = "wgt:h-8 wgt:object-contain";
|
|
213
|
+
const i = document.createElement("div");
|
|
214
|
+
i.className = "wgt:w-[1px] wgt:h-8 wgt:bg-border-light";
|
|
215
|
+
const w = document.createElement("label");
|
|
216
|
+
w.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase", w.innerText = n.name, a.appendChild(g), a.appendChild(i), a.appendChild(w);
|
|
217
|
+
const { container: u } = I({
|
|
197
218
|
checked: r,
|
|
198
|
-
onChange: (
|
|
199
|
-
|
|
219
|
+
onChange: (T) => {
|
|
220
|
+
T && (e = n.route, typeof s == "function" && s(n), d());
|
|
200
221
|
}
|
|
201
222
|
});
|
|
202
|
-
|
|
223
|
+
l.appendChild(a), l.appendChild(u), t.appendChild(l);
|
|
203
224
|
});
|
|
204
225
|
}
|
|
205
226
|
return d(), {
|
|
206
|
-
container:
|
|
207
|
-
setSelectedRoute(
|
|
208
|
-
|
|
227
|
+
container: o,
|
|
228
|
+
setSelectedRoute(n) {
|
|
229
|
+
e = n, d();
|
|
209
230
|
}
|
|
210
231
|
};
|
|
211
232
|
}
|
|
212
|
-
function
|
|
213
|
-
name:
|
|
214
|
-
value:
|
|
215
|
-
type:
|
|
216
|
-
placeholder:
|
|
233
|
+
function j({
|
|
234
|
+
name: m,
|
|
235
|
+
value: e = "",
|
|
236
|
+
type: s = "text",
|
|
237
|
+
placeholder: o = "",
|
|
217
238
|
label: c,
|
|
218
|
-
required:
|
|
239
|
+
required: t = !1,
|
|
219
240
|
error: d = null,
|
|
220
|
-
onInput:
|
|
241
|
+
onInput: n = null
|
|
221
242
|
}) {
|
|
222
243
|
const r = document.createElement("div");
|
|
223
|
-
r.className = "flex flex-col";
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
const
|
|
227
|
-
|
|
244
|
+
r.className = "wgt:flex wgt:flex-col";
|
|
245
|
+
const l = document.createElement("label");
|
|
246
|
+
if (l.htmlFor = m, l.className = "wgt:font-medium wgt:mb-2 wgt:text-text-black", l.innerText = c, t) {
|
|
247
|
+
const i = document.createElement("span");
|
|
248
|
+
i.className = "wgt:text-red-500 wgt:ml-1", i.innerText = "*", l.appendChild(i);
|
|
228
249
|
}
|
|
229
250
|
const a = document.createElement("input");
|
|
230
|
-
a.type =
|
|
231
|
-
"border",
|
|
232
|
-
"rounded",
|
|
233
|
-
"px-3",
|
|
234
|
-
"py-2",
|
|
235
|
-
"focus:outline-none",
|
|
236
|
-
"focus:ring-2",
|
|
237
|
-
"focus:ring-blue-500",
|
|
238
|
-
d ? "border-red-500" : "border-gray-300"
|
|
239
|
-
].join(" "),
|
|
240
|
-
const
|
|
241
|
-
return
|
|
251
|
+
a.type = s, a.name = m, a.id = m, a.value = e, a.placeholder = o, a.className = [
|
|
252
|
+
"wgt:border",
|
|
253
|
+
"wgt:rounded",
|
|
254
|
+
"wgt:px-3",
|
|
255
|
+
"wgt:py-2",
|
|
256
|
+
"wgt:focus:outline-none",
|
|
257
|
+
"wgt:focus:ring-2",
|
|
258
|
+
"wgt:focus:ring-blue-500",
|
|
259
|
+
d ? "wgt:border-red-500" : "wgt:border-gray-300"
|
|
260
|
+
].join(" "), t && a.setAttribute("required", "true"), typeof n == "function" && a.addEventListener("input", n);
|
|
261
|
+
const g = document.createElement("span");
|
|
262
|
+
return g.className = "wgt:text-red-500 wgt:text-sm mt-1", g.innerText = d || "", d || (g.style.display = "none"), r.appendChild(l), r.appendChild(a), r.appendChild(g), {
|
|
242
263
|
container: r,
|
|
243
264
|
inputEl: a,
|
|
244
|
-
setError(
|
|
245
|
-
|
|
265
|
+
setError(i) {
|
|
266
|
+
i ? (g.innerText = i, g.style.display = "block", a.classList.remove("wgt:border-gray-300"), a.classList.add("wgt:border-red-500")) : (g.innerText = "", g.style.display = "none", a.classList.remove("wgt:border-red-500"), a.classList.add("wgt:border-gray-300"));
|
|
246
267
|
},
|
|
247
268
|
getValue() {
|
|
248
269
|
return a.value;
|
|
249
270
|
}
|
|
250
271
|
};
|
|
251
272
|
}
|
|
252
|
-
function
|
|
253
|
-
name:
|
|
254
|
-
value:
|
|
255
|
-
options:
|
|
256
|
-
label:
|
|
273
|
+
function F({
|
|
274
|
+
name: m,
|
|
275
|
+
value: e = "",
|
|
276
|
+
options: s = [],
|
|
277
|
+
label: o,
|
|
257
278
|
disabled: c = !1,
|
|
258
|
-
error:
|
|
279
|
+
error: t = null,
|
|
259
280
|
onChange: d = null
|
|
260
281
|
}) {
|
|
261
|
-
const
|
|
262
|
-
|
|
282
|
+
const n = document.createElement("div");
|
|
283
|
+
n.className = "wgt:flex wgt:flex-col";
|
|
263
284
|
const r = document.createElement("label");
|
|
264
|
-
r.htmlFor =
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
"border",
|
|
268
|
-
"rounded",
|
|
269
|
-
"px-3",
|
|
270
|
-
"py-2",
|
|
271
|
-
"bg-white",
|
|
272
|
-
"focus:outline-none",
|
|
273
|
-
"focus:ring-2",
|
|
274
|
-
"focus:ring-blue-500",
|
|
275
|
-
|
|
285
|
+
r.htmlFor = m, r.className = "wgt:font-medium wgt:mb-1 wgt:text-gray-700", r.innerText = o;
|
|
286
|
+
const l = document.createElement("select");
|
|
287
|
+
l.id = m, l.name = m, l.disabled = c, l.className = [
|
|
288
|
+
"wgt:border",
|
|
289
|
+
"wgt:rounded",
|
|
290
|
+
"wgt:px-3",
|
|
291
|
+
"wgt:py-2",
|
|
292
|
+
"wgt:bg-white",
|
|
293
|
+
"wgt:focus:outline-none",
|
|
294
|
+
"wgt:focus:ring-2",
|
|
295
|
+
"wgt:focus:ring-blue-500",
|
|
296
|
+
t ? "wgt:border-red-500" : "wgt:border-gray-300"
|
|
276
297
|
].join(" ");
|
|
277
298
|
const a = document.createElement("option");
|
|
278
|
-
a.value = "", a.disabled = !0, a.selected =
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
}), typeof d == "function" &&
|
|
282
|
-
const
|
|
283
|
-
return
|
|
284
|
-
container:
|
|
285
|
-
selectEl:
|
|
286
|
-
setError(
|
|
287
|
-
|
|
299
|
+
a.value = "", a.disabled = !0, a.selected = e === "" || e == null, a.innerText = `-- Chọn ${o.toLowerCase()} --`, l.appendChild(a), s.forEach((i) => {
|
|
300
|
+
const w = document.createElement("option");
|
|
301
|
+
w.value = i.value, w.innerText = i.label, i.value === e && (w.selected = !0), l.appendChild(w);
|
|
302
|
+
}), typeof d == "function" && l.addEventListener("change", d);
|
|
303
|
+
const g = document.createElement("span");
|
|
304
|
+
return g.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", g.innerText = t || "", t || (g.style.display = "none"), n.appendChild(l), n.appendChild(g), {
|
|
305
|
+
container: n,
|
|
306
|
+
selectEl: l,
|
|
307
|
+
setError(i) {
|
|
308
|
+
i ? (g.innerText = i, g.style.display = "block", l.classList.remove("wgt:border-gray-300"), l.classList.add("wgt:border-red-500")) : (g.innerText = "", g.style.display = "none", l.classList.remove("wgt:border-red-500"), l.classList.add("wgt:border-gray-300"));
|
|
288
309
|
},
|
|
289
310
|
getValue() {
|
|
290
|
-
return
|
|
311
|
+
return l.value;
|
|
291
312
|
},
|
|
292
|
-
setOptions(
|
|
293
|
-
for (;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
|
|
313
|
+
setOptions(i) {
|
|
314
|
+
for (; l.options.length > 1; )
|
|
315
|
+
l.remove(1);
|
|
316
|
+
i.forEach((w) => {
|
|
317
|
+
const u = document.createElement("option");
|
|
318
|
+
u.value = w.value, u.innerText = w.label, l.appendChild(u);
|
|
298
319
|
});
|
|
299
320
|
},
|
|
300
|
-
setDisabled(
|
|
301
|
-
|
|
321
|
+
setDisabled(i) {
|
|
322
|
+
l.disabled = !!i;
|
|
302
323
|
}
|
|
303
324
|
};
|
|
304
325
|
}
|
|
305
|
-
function
|
|
306
|
-
label:
|
|
307
|
-
required:
|
|
308
|
-
file:
|
|
309
|
-
onFileChange:
|
|
326
|
+
function O({
|
|
327
|
+
label: m,
|
|
328
|
+
required: e = !1,
|
|
329
|
+
file: s = null,
|
|
330
|
+
onFileChange: o,
|
|
310
331
|
error: c = null
|
|
311
332
|
}) {
|
|
312
|
-
const
|
|
313
|
-
|
|
333
|
+
const t = document.createElement("form");
|
|
334
|
+
t.className = "wgt:flex wgt:flex-col";
|
|
314
335
|
const d = document.createElement("label");
|
|
315
|
-
if (d.className = "font-medium mb-1 text-gray-700", d.innerText =
|
|
316
|
-
const
|
|
317
|
-
|
|
336
|
+
if (d.htmlFor = "upload", d.className = "wgt:font-medium wgt:mb-1 wgt:text-gray-700", d.innerText = m, e) {
|
|
337
|
+
const p = document.createElement("span");
|
|
338
|
+
p.className = "wgt:text-red-500 wgt:ml-1", p.innerText = "*", d.appendChild(p);
|
|
318
339
|
}
|
|
319
|
-
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
"h-fit",
|
|
323
|
-
"py-4",
|
|
324
|
-
"w-full",
|
|
325
|
-
"rounded",
|
|
326
|
-
"overflow-hidden",
|
|
327
|
-
"flex",
|
|
328
|
-
"items-center",
|
|
329
|
-
"cursor-pointer",
|
|
330
|
-
"justify-center",
|
|
331
|
-
"border",
|
|
332
|
-
"border-dashed",
|
|
333
|
-
"border-grey-6",
|
|
334
|
-
"flex-col",
|
|
335
|
-
"gap-2"
|
|
336
|
-
].join(" ")
|
|
337
|
-
r.click();
|
|
338
|
-
});
|
|
340
|
+
t.appendChild(d);
|
|
341
|
+
const n = document.createElement("div");
|
|
342
|
+
n.className = [
|
|
343
|
+
"wgt:h-fit",
|
|
344
|
+
"wgt:py-4",
|
|
345
|
+
"wgt:w-full",
|
|
346
|
+
"wgt:rounded",
|
|
347
|
+
"wgt:overflow-hidden",
|
|
348
|
+
"wgt:flex",
|
|
349
|
+
"wgt:items-center",
|
|
350
|
+
"wgt:cursor-pointer",
|
|
351
|
+
"wgt:justify-center",
|
|
352
|
+
"wgt:border",
|
|
353
|
+
"wgt:border-dashed",
|
|
354
|
+
"wgt:border-grey-6",
|
|
355
|
+
"wgt:flex-col",
|
|
356
|
+
"wgt:gap-2"
|
|
357
|
+
].join(" ");
|
|
339
358
|
const r = document.createElement("input");
|
|
340
|
-
r.type = "file", r.accept = "image/*,.pdf", r.className = "hidden", r.addEventListener("change", (
|
|
341
|
-
const
|
|
342
|
-
|
|
359
|
+
r.id = "upload", r.type = "file", r.accept = "image/*,.pdf", r.className = "wgt:hidden", r.addEventListener("change", (p) => {
|
|
360
|
+
const b = p.target.files && p.target.files[0] ? p.target.files[0] : null;
|
|
361
|
+
x(b), s = b;
|
|
343
362
|
});
|
|
344
|
-
const
|
|
345
|
-
|
|
363
|
+
const l = document.createElement("div");
|
|
364
|
+
l.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2 wgt:items-center wgt:justify-center";
|
|
346
365
|
const a = document.createElement("span");
|
|
347
|
-
a.className = "text-red-500 text-sm mt-1", a.innerText = c || "", c || (a.style.display = "none");
|
|
348
|
-
let
|
|
349
|
-
function
|
|
350
|
-
if (!
|
|
351
|
-
|
|
352
|
-
"fixed",
|
|
353
|
-
"inset-0",
|
|
354
|
-
"bg-black",
|
|
355
|
-
"bg-opacity-75",
|
|
356
|
-
"z-50",
|
|
357
|
-
"flex",
|
|
358
|
-
"items-center",
|
|
359
|
-
"justify-center"
|
|
360
|
-
].join(" "),
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
h.stopPropagation(),
|
|
366
|
-
}),
|
|
367
|
-
const
|
|
368
|
-
if (
|
|
366
|
+
a.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", a.innerText = c || "", c || (a.style.display = "none");
|
|
367
|
+
let g = null;
|
|
368
|
+
function i() {
|
|
369
|
+
if (!s || g) return;
|
|
370
|
+
g = document.createElement("div"), g.className = [
|
|
371
|
+
"wgt:fixed",
|
|
372
|
+
"wgt:inset-0",
|
|
373
|
+
"wgt:bg-black",
|
|
374
|
+
"wgt:bg-opacity-75",
|
|
375
|
+
"wgt:z-50",
|
|
376
|
+
"wgt:flex",
|
|
377
|
+
"wgt:items-center",
|
|
378
|
+
"wgt:justify-center"
|
|
379
|
+
].join(" "), g.addEventListener("click", () => w());
|
|
380
|
+
const p = document.createElement("div");
|
|
381
|
+
p.className = "wgt:relative wgt:w-full wgt:h-screen wgt:bg-white wgt:overflow-auto";
|
|
382
|
+
const b = document.createElement("button");
|
|
383
|
+
b.innerHTML = "×", b.className = "wgt:absolute wgt:w-8 wgt:h-8 wgt:top-2 wgt:right-2 wgt:text-gray-600 wgt:text-2xl wgt:cursor-pointer", b.setAttribute("aria-label", "Close preview"), b.addEventListener("click", (h) => {
|
|
384
|
+
h.stopPropagation(), w();
|
|
385
|
+
}), p.appendChild(b);
|
|
386
|
+
const v = document.createElement("div");
|
|
387
|
+
if (v.className = "wgt:px-10 wgt:w-full wgt:h-full wgt:flex wgt:flex-col wgt:items-center wgt:justify-center", s.type === "application/pdf") {
|
|
369
388
|
const h = document.createElement("object");
|
|
370
|
-
h.data =
|
|
389
|
+
h.data = f, h.type = "application/pdf", h.className = "wgt:w-full wgt:h-full wgt:object-contain", v.appendChild(h);
|
|
371
390
|
} else {
|
|
372
391
|
const h = document.createElement("img");
|
|
373
|
-
h.src =
|
|
392
|
+
h.src = f, h.alt = "Full Preview", h.className = "wgt:max-h-screen wgt:object-contain", v.appendChild(h);
|
|
374
393
|
}
|
|
375
|
-
|
|
394
|
+
p.appendChild(v), g.appendChild(p), document.body.appendChild(g);
|
|
376
395
|
}
|
|
377
|
-
function
|
|
378
|
-
|
|
396
|
+
function w() {
|
|
397
|
+
g && (document.body.removeChild(g), g = null);
|
|
379
398
|
}
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
399
|
+
const u = document.createElement("button");
|
|
400
|
+
u.type = "button", u.className = "wgt:bg-primary wgt:hover:bg-primary-dark wgt:text-white wgt:px-4 wgt:py-1 wgt:rounded-md wgt:cursor-pointer", u.innerText = "Upload file", u.addEventListener("click", (p) => {
|
|
401
|
+
p.stopPropagation(), r.click();
|
|
383
402
|
});
|
|
384
|
-
function
|
|
385
|
-
if (
|
|
386
|
-
const
|
|
387
|
-
return parseFloat((
|
|
403
|
+
function T(p, b = 2) {
|
|
404
|
+
if (p === 0) return "0 Bytes";
|
|
405
|
+
const v = 1024, h = Math.max(0, b), H = ["Bytes", "KB", "MB", "GB", "TB"], y = Math.floor(Math.log(p) / Math.log(v));
|
|
406
|
+
return parseFloat((p / Math.pow(v, y)).toFixed(h)) + " " + H[y];
|
|
388
407
|
}
|
|
389
|
-
let
|
|
390
|
-
function E(
|
|
391
|
-
|
|
408
|
+
let f = null;
|
|
409
|
+
function E(p) {
|
|
410
|
+
f && (URL.revokeObjectURL(f), f = null), p && (f = URL.createObjectURL(p));
|
|
392
411
|
}
|
|
393
|
-
function
|
|
394
|
-
if (E(
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
const
|
|
398
|
-
if (
|
|
399
|
-
|
|
400
|
-
|
|
412
|
+
function x(p) {
|
|
413
|
+
if (E(p), l.innerHTML = "", p) {
|
|
414
|
+
const b = document.createElement("div");
|
|
415
|
+
b.className = "wgt:flex wgt:w-full wgt:items-center wgt:justify-between";
|
|
416
|
+
const v = document.createElement("div");
|
|
417
|
+
if (v.className = "wgt:flex wgt:space-x-4 wgt:w-full wgt:justify-start wgt:items-center wgt:px-4", v.addEventListener("click", () => {
|
|
418
|
+
r.click();
|
|
419
|
+
}), p.type === "application/pdf") {
|
|
420
|
+
const N = document.createElement("div");
|
|
421
|
+
N.className = "wgt:flex-shrink-0 wgt:flex wgt:items-center wgt:justify-center wgt:rounded", N.innerHTML = `
|
|
401
422
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-gray-500" fill="currentColor" viewBox="0 0 24 24">
|
|
402
423
|
<path d="M6 2h9l5 5v15a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"/>
|
|
403
424
|
<path d="M14 2v5h5"/>
|
|
404
425
|
</svg>
|
|
405
|
-
`,
|
|
426
|
+
`, v.appendChild(N);
|
|
406
427
|
} else {
|
|
407
|
-
const
|
|
408
|
-
|
|
428
|
+
const N = document.createElement("img");
|
|
429
|
+
N.src = f, N.alt = "Preview thumbnail", N.className = "wgt:object-contain wgt:h-20 wgt:w-20 wgt:rounded", v.appendChild(N);
|
|
409
430
|
}
|
|
410
431
|
const h = document.createElement("div");
|
|
411
|
-
h.className = "flex-1";
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
}),
|
|
432
|
+
h.className = "wgt:flex-1";
|
|
433
|
+
const H = document.createElement("p");
|
|
434
|
+
H.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800 wgt:truncate", H.innerText = p.name;
|
|
435
|
+
const y = document.createElement("p");
|
|
436
|
+
y.className = "wgt:text-sm wgt:text-gray-500", y.innerText = T(p.size), h.appendChild(H), h.appendChild(y), v.appendChild(h), b.appendChild(v);
|
|
437
|
+
const C = document.createElement("button");
|
|
438
|
+
C.type = "button", C.innerText = "Preview", C.className = "wgt:p-2 wgt:text-xs wgt:font-medium wgt:text-text-black wgt:cursor:pointer", C.addEventListener("click", (N) => {
|
|
439
|
+
N.stopPropagation(), i();
|
|
440
|
+
}), b.appendChild(C), l.appendChild(b);
|
|
420
441
|
} else {
|
|
421
|
-
|
|
442
|
+
l.innerHTML = `
|
|
422
443
|
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
423
444
|
<path d="M13.1313 9.25809L13.1313 22.2754" stroke="#595959" stroke-width="0.810811" stroke-linecap="round" stroke-linejoin="round"/>
|
|
424
445
|
<path d="M16.2832 12.4238L13.1308 9.25842L9.97834 12.4238" stroke="#595959" stroke-width="0.810811" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -427,27 +448,30 @@ function I({
|
|
|
427
448
|
<span class="text-sm font-semibold leading-4 text-grey-8">Tải tệp lên</span>
|
|
428
449
|
<span class="text-xs font-normal leading-3 text-grey-7">(Tối thiểu 400x400px, PNG hoặc JPEG)</span>
|
|
429
450
|
`;
|
|
430
|
-
const
|
|
431
|
-
|
|
451
|
+
const b = document.createElement("div");
|
|
452
|
+
b.className = "wgt:flex wgt:items-center", b.appendChild(u), l.appendChild(b);
|
|
432
453
|
}
|
|
433
454
|
}
|
|
434
|
-
return
|
|
435
|
-
container:
|
|
436
|
-
|
|
437
|
-
|
|
455
|
+
return x(s), n.appendChild(l), n.appendChild(r), t.appendChild(n), t.appendChild(a), {
|
|
456
|
+
container: t,
|
|
457
|
+
getValues() {
|
|
458
|
+
return s;
|
|
459
|
+
},
|
|
460
|
+
setFile(p) {
|
|
461
|
+
s = p, x(p);
|
|
438
462
|
},
|
|
439
463
|
clearFile() {
|
|
440
|
-
|
|
464
|
+
s = null, x(null);
|
|
441
465
|
},
|
|
442
|
-
setError(
|
|
443
|
-
|
|
466
|
+
setError(p) {
|
|
467
|
+
p ? (a.innerText = p, a.style.display = "block") : (a.innerText = "", a.style.display = "none");
|
|
444
468
|
}
|
|
445
469
|
};
|
|
446
470
|
}
|
|
447
|
-
const
|
|
471
|
+
const z = [
|
|
448
472
|
{ value: "VN", label: "Việt Nam" }
|
|
449
473
|
// …you could list other countries here…
|
|
450
|
-
],
|
|
474
|
+
], U = {
|
|
451
475
|
VN: [
|
|
452
476
|
{ value: "HN", label: "Hà Nội" },
|
|
453
477
|
{ value: "HCM", label: "TP. Hồ Chí Minh" },
|
|
@@ -455,7 +479,7 @@ const U = [
|
|
|
455
479
|
// …etc…
|
|
456
480
|
]
|
|
457
481
|
// if you had other countries, put them here
|
|
458
|
-
},
|
|
482
|
+
}, R = {
|
|
459
483
|
HN: [
|
|
460
484
|
{ value: "QL", label: "Quận Ba Đình" },
|
|
461
485
|
{ value: "TL", label: "Quận Tây Hồ" }
|
|
@@ -471,7 +495,7 @@ const U = [
|
|
|
471
495
|
{ value: "S0", label: "Sơn Trà" }
|
|
472
496
|
// …etc…
|
|
473
497
|
]
|
|
474
|
-
},
|
|
498
|
+
}, W = {
|
|
475
499
|
QL: [
|
|
476
500
|
{ value: "PD", label: "Phường Điện Biên" },
|
|
477
501
|
{ value: "NT", label: "Phường Ngọc Hà" }
|
|
@@ -497,127 +521,134 @@ const U = [
|
|
|
497
521
|
{ value: "NB", label: "Phường Nại Hiên Đông" }
|
|
498
522
|
]
|
|
499
523
|
};
|
|
500
|
-
function
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
524
|
+
function G({ onSubmit: m, registrationData: e }) {
|
|
525
|
+
var H, y, C, N, V, M, S;
|
|
526
|
+
const s = document.createElement("form");
|
|
527
|
+
s.className = "wgt:w-full", s.addEventListener("submit", (k) => {
|
|
528
|
+
k.preventDefault();
|
|
529
|
+
const L = h();
|
|
530
|
+
typeof m == "function" && m(L);
|
|
506
531
|
});
|
|
507
532
|
const o = document.createElement("div");
|
|
508
|
-
o.className = "grid grid-cols-1 md:grid-cols-2 gap-8",
|
|
509
|
-
const l = document.createElement("div");
|
|
510
|
-
l.className = "space-y-4";
|
|
533
|
+
o.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-2 wgt:gap-8", s.appendChild(o);
|
|
511
534
|
const c = document.createElement("div");
|
|
512
|
-
c.className = "space-y-4"
|
|
513
|
-
const
|
|
535
|
+
c.className = "wgt:space-y-4";
|
|
536
|
+
const t = document.createElement("div");
|
|
537
|
+
t.className = "wgt:space-y-4", o.appendChild(c), o.appendChild(t);
|
|
538
|
+
const d = j({
|
|
514
539
|
name: "taxCode",
|
|
515
540
|
label: "Mã số thuế",
|
|
516
541
|
required: !0,
|
|
517
542
|
error: null,
|
|
518
543
|
placeholder: "",
|
|
519
|
-
type: "text"
|
|
544
|
+
type: "text",
|
|
545
|
+
value: (e == null ? void 0 : e.taxCode) ?? ""
|
|
520
546
|
});
|
|
521
|
-
|
|
522
|
-
const
|
|
547
|
+
c.appendChild(d.container);
|
|
548
|
+
const n = j({
|
|
523
549
|
name: "representative",
|
|
524
550
|
label: "Người đại diện",
|
|
525
551
|
required: !0,
|
|
526
552
|
error: null,
|
|
527
553
|
placeholder: "",
|
|
528
|
-
type: "text"
|
|
554
|
+
type: "text",
|
|
555
|
+
value: (e == null ? void 0 : e.representative) ?? ""
|
|
529
556
|
});
|
|
530
|
-
|
|
531
|
-
const
|
|
557
|
+
c.appendChild(n.container);
|
|
558
|
+
const r = j({
|
|
532
559
|
name: "email",
|
|
533
560
|
label: "Email",
|
|
534
561
|
required: !0,
|
|
535
562
|
error: null,
|
|
536
563
|
placeholder: "",
|
|
537
|
-
type: "email"
|
|
564
|
+
type: "email",
|
|
565
|
+
value: (e == null ? void 0 : e.email) ?? ""
|
|
538
566
|
});
|
|
539
|
-
|
|
540
|
-
const
|
|
567
|
+
c.appendChild(r.container);
|
|
568
|
+
const l = j({
|
|
541
569
|
name: "phone",
|
|
542
570
|
label: "Số điện thoại",
|
|
543
571
|
required: !0,
|
|
544
572
|
error: null,
|
|
545
573
|
placeholder: "",
|
|
546
|
-
type: "tel"
|
|
574
|
+
type: "tel",
|
|
575
|
+
value: (e == null ? void 0 : e.phone) ?? ""
|
|
547
576
|
});
|
|
548
|
-
|
|
549
|
-
const
|
|
577
|
+
c.appendChild(l.container);
|
|
578
|
+
const a = O({
|
|
550
579
|
label: "Giấy phép đăng ký kinh doanh",
|
|
551
580
|
required: !0,
|
|
552
|
-
file: null,
|
|
553
|
-
onFileChange: (
|
|
581
|
+
file: (e == null ? void 0 : e.license) ?? null,
|
|
582
|
+
onFileChange: (k) => {
|
|
554
583
|
},
|
|
555
584
|
error: null
|
|
556
585
|
});
|
|
557
|
-
|
|
558
|
-
const
|
|
586
|
+
c.appendChild(a.container);
|
|
587
|
+
const g = j({
|
|
559
588
|
name: "companyName",
|
|
560
589
|
label: "Tên công ty",
|
|
561
590
|
required: !1,
|
|
562
591
|
error: null,
|
|
563
592
|
placeholder: "",
|
|
564
|
-
type: "text"
|
|
593
|
+
type: "text",
|
|
594
|
+
value: (e == null ? void 0 : e.companyName) ?? ""
|
|
565
595
|
});
|
|
566
|
-
|
|
567
|
-
const i =
|
|
596
|
+
t.appendChild(g.container);
|
|
597
|
+
const i = j({
|
|
568
598
|
name: "position",
|
|
569
599
|
label: "Chức vụ",
|
|
570
600
|
required: !1,
|
|
571
601
|
error: null,
|
|
572
602
|
placeholder: "",
|
|
573
|
-
type: "text"
|
|
603
|
+
type: "text",
|
|
604
|
+
value: (e == null ? void 0 : e.position) ?? ""
|
|
574
605
|
});
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
const
|
|
606
|
+
t.appendChild(i.container);
|
|
607
|
+
const w = document.createElement("div");
|
|
608
|
+
w.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2", t.appendChild(w);
|
|
609
|
+
const u = document.createElement("span");
|
|
610
|
+
u.className = "wgt:font-medium wgt:text-text-black", u.innerText = "Địa chỉ", w.appendChild(u);
|
|
611
|
+
const T = F({
|
|
581
612
|
name: "country",
|
|
582
613
|
label: "Quốc gia",
|
|
583
|
-
options:
|
|
614
|
+
options: z,
|
|
584
615
|
// e.g. [{value:"vn",label:"Việt Nam"}, …]
|
|
585
616
|
value: "",
|
|
586
617
|
disabled: !1,
|
|
587
618
|
error: null,
|
|
588
|
-
onChange: (
|
|
589
|
-
const
|
|
590
|
-
|
|
619
|
+
onChange: (k) => {
|
|
620
|
+
const L = k.target.value;
|
|
621
|
+
U[L] ? (f.setOptions(U[L]), f.setDisabled(!1)) : (f.setOptions([]), f.setDisabled(!0)), f.selectEl.value = "", E.setOptions([]), E.selectEl.value = "", E.setDisabled(!0), x.setOptions([]), x.selectEl.value = "", x.setDisabled(!0);
|
|
591
622
|
}
|
|
592
623
|
});
|
|
593
|
-
|
|
594
|
-
const
|
|
624
|
+
w.appendChild(T.container);
|
|
625
|
+
const f = F({
|
|
595
626
|
name: "province",
|
|
596
627
|
label: "Tỉnh/Thành phố",
|
|
597
628
|
options: [],
|
|
598
629
|
value: "",
|
|
599
630
|
disabled: !0,
|
|
600
631
|
error: null,
|
|
601
|
-
onChange: (
|
|
602
|
-
const
|
|
603
|
-
|
|
632
|
+
onChange: (k) => {
|
|
633
|
+
const L = k.target.value;
|
|
634
|
+
R[L] ? (E.setOptions(R[L]), E.setDisabled(!1)) : (E.setOptions([]), E.setDisabled(!0)), x.setOptions([]), x.selectEl.value = "", x.setDisabled(!0);
|
|
604
635
|
}
|
|
605
636
|
});
|
|
606
|
-
|
|
607
|
-
const
|
|
637
|
+
w.appendChild(f.container);
|
|
638
|
+
const E = F({
|
|
608
639
|
name: "district",
|
|
609
640
|
label: "Quận/Huyện",
|
|
610
641
|
options: [],
|
|
611
642
|
value: "",
|
|
612
643
|
disabled: !0,
|
|
613
644
|
error: null,
|
|
614
|
-
onChange: (
|
|
615
|
-
const
|
|
616
|
-
|
|
645
|
+
onChange: (k) => {
|
|
646
|
+
const L = k.target.value;
|
|
647
|
+
W[L] ? (x.setOptions(W[L]), x.setDisabled(!1)) : (x.setOptions([]), x.setDisabled(!0));
|
|
617
648
|
}
|
|
618
649
|
});
|
|
619
|
-
|
|
620
|
-
const
|
|
650
|
+
w.appendChild(E.container);
|
|
651
|
+
const x = F({
|
|
621
652
|
name: "ward",
|
|
622
653
|
label: "Phường/Xã",
|
|
623
654
|
options: [],
|
|
@@ -627,231 +658,268 @@ function Z({ onSubmit: f }) {
|
|
|
627
658
|
onChange: () => {
|
|
628
659
|
}
|
|
629
660
|
});
|
|
630
|
-
|
|
631
|
-
const
|
|
661
|
+
w.appendChild(x.container);
|
|
662
|
+
const p = j({
|
|
632
663
|
name: "detail",
|
|
633
664
|
label: "Địa chỉ cụ thể",
|
|
634
665
|
required: !1,
|
|
635
666
|
error: null,
|
|
636
667
|
placeholder: "",
|
|
637
|
-
type: "text"
|
|
668
|
+
type: "text",
|
|
669
|
+
value: ((H = e == null ? void 0 : e.address) == null ? void 0 : H.detail) ?? ""
|
|
638
670
|
});
|
|
639
|
-
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
"bg-primary",
|
|
645
|
-
"hover:bg-primary-dark",
|
|
646
|
-
"text-white",
|
|
647
|
-
"px-6",
|
|
648
|
-
"py-2",
|
|
649
|
-
"rounded",
|
|
650
|
-
"disabled:opacity-50",
|
|
651
|
-
"disabled:cursor-not-allowed",
|
|
652
|
-
"cursor-pointer"
|
|
653
|
-
].join(" "),
|
|
654
|
-
|
|
671
|
+
w.appendChild(p.container);
|
|
672
|
+
const b = document.createElement("div");
|
|
673
|
+
b.className = "wgt:flex wgt:mt-4 wgt:items-center wgt:justify-end wgt:gap-2 ";
|
|
674
|
+
const v = document.createElement("button");
|
|
675
|
+
if (v.type = "submit", v.innerText = "Tiếp theo", v.className = [
|
|
676
|
+
"wgt:bg-primary",
|
|
677
|
+
"wgt:hover:bg-primary-dark",
|
|
678
|
+
"wgt:text-white",
|
|
679
|
+
"wgt:px-6",
|
|
680
|
+
"wgt:py-2",
|
|
681
|
+
"wgt:rounded",
|
|
682
|
+
"wgt:disabled:opacity-50",
|
|
683
|
+
"wgt:disabled:cursor-not-allowed",
|
|
684
|
+
"wgt:cursor-pointer"
|
|
685
|
+
].join(" "), b.appendChild(v), s.appendChild(b), (y = e == null ? void 0 : e.address) != null && y.country) {
|
|
686
|
+
const k = e == null ? void 0 : e.address.country;
|
|
687
|
+
T.selectEl.value = k;
|
|
688
|
+
const L = U[k] || [];
|
|
689
|
+
if (L.length > 0) {
|
|
690
|
+
f.setOptions(L), f.setDisabled(!1);
|
|
691
|
+
const P = (C = e == null ? void 0 : e.address) == null ? void 0 : C.province;
|
|
692
|
+
P && (f.selectEl.value = P);
|
|
693
|
+
}
|
|
694
|
+
const A = (N = e == null ? void 0 : e.address) == null ? void 0 : N.province;
|
|
695
|
+
if (A && R[A]) {
|
|
696
|
+
const P = R[A];
|
|
697
|
+
E.setOptions(P), E.setDisabled(!1);
|
|
698
|
+
const B = (V = e == null ? void 0 : e.address) == null ? void 0 : V.district;
|
|
699
|
+
B && (E.selectEl.value = B);
|
|
700
|
+
}
|
|
701
|
+
const q = (M = e == null ? void 0 : e.address) == null ? void 0 : M.district;
|
|
702
|
+
if (q && W[q]) {
|
|
703
|
+
const P = W[q];
|
|
704
|
+
x.setOptions(P), x.setDisabled(!1);
|
|
705
|
+
const B = (S = e == null ? void 0 : e.address) == null ? void 0 : S.ward;
|
|
706
|
+
B && (x.selectEl.value = B);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
function h() {
|
|
655
710
|
return {
|
|
656
|
-
taxCode:
|
|
657
|
-
representative:
|
|
658
|
-
email:
|
|
659
|
-
phone:
|
|
660
|
-
license:
|
|
661
|
-
companyName:
|
|
711
|
+
taxCode: d.getValue().trim(),
|
|
712
|
+
representative: n.getValue().trim(),
|
|
713
|
+
email: r.getValue().trim(),
|
|
714
|
+
phone: l.getValue().trim(),
|
|
715
|
+
license: a.getValues(),
|
|
716
|
+
companyName: g.getValue().trim(),
|
|
662
717
|
position: i.getValue().trim(),
|
|
663
718
|
address: {
|
|
664
|
-
country:
|
|
665
|
-
province:
|
|
666
|
-
district:
|
|
667
|
-
ward:
|
|
668
|
-
detail:
|
|
719
|
+
country: T.getValue(),
|
|
720
|
+
province: f.getValue(),
|
|
721
|
+
district: E.getValue(),
|
|
722
|
+
ward: x.getValue(),
|
|
723
|
+
detail: p.getValue().trim()
|
|
669
724
|
}
|
|
670
725
|
};
|
|
671
726
|
}
|
|
672
727
|
return {
|
|
673
|
-
container:
|
|
674
|
-
getValues:
|
|
728
|
+
container: s,
|
|
729
|
+
getValues: h
|
|
675
730
|
};
|
|
676
731
|
}
|
|
677
|
-
function
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
const c =
|
|
683
|
-
return
|
|
732
|
+
function K({ providerProps: m, formProps: e }) {
|
|
733
|
+
const s = document.createElement("div");
|
|
734
|
+
s.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full wgt:max-w-[1072px] wgt:mx-auto";
|
|
735
|
+
const o = $(m);
|
|
736
|
+
s.appendChild(o.container);
|
|
737
|
+
const c = G(e);
|
|
738
|
+
return s.appendChild(c.container), { container: s };
|
|
684
739
|
}
|
|
685
|
-
function
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
const
|
|
689
|
-
|
|
740
|
+
function X({ value: m = "", onInputChange: e } = {}) {
|
|
741
|
+
const s = document.createElement("div");
|
|
742
|
+
s.className = "wgt:flex wgt:flex-col";
|
|
743
|
+
const o = document.createElement("label");
|
|
744
|
+
o.className = "wgt:font-medium wgt:mb-1 wgt:text-gray-700", o.innerHTML = 'Chọn gói đăng ký <span class="wgt:text-red-500">*</span>', s.appendChild(o);
|
|
690
745
|
const c = document.createElement("div");
|
|
691
|
-
c.className = "flex rounded-lg border border-gray-300 overflow-hidden";
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
"flex-1",
|
|
695
|
-
"px-4",
|
|
696
|
-
"py-2",
|
|
697
|
-
"text-gray-700",
|
|
698
|
-
"placeholder-gray-400",
|
|
699
|
-
"bg-white",
|
|
700
|
-
"focus:outline-none"
|
|
701
|
-
].join(" "), typeof
|
|
746
|
+
c.className = "wgt:flex wgt:rounded-lg wgt:border wgt:border-gray-300 wgt:overflow-hidden";
|
|
747
|
+
const t = document.createElement("input");
|
|
748
|
+
t.type = "text", t.inputMode = "numeric", t.value = m, t.placeholder = "Số đơn/tháng", t.className = [
|
|
749
|
+
"wgt:flex-1",
|
|
750
|
+
"wgt:px-4",
|
|
751
|
+
"wgt:py-2",
|
|
752
|
+
"wgt:text-gray-700",
|
|
753
|
+
"wgt:placeholder-gray-400",
|
|
754
|
+
"wgt:bg-white",
|
|
755
|
+
"wgt:focus:outline-none"
|
|
756
|
+
].join(" "), typeof e == "function" && t.addEventListener("input", e);
|
|
702
757
|
const d = document.createElement("span");
|
|
703
|
-
return d.className = "px-4 py-2 bg-gray-100 text-gray-600 flex-shrink-0", d.innerText = "đơn/tháng", c.appendChild(
|
|
704
|
-
container:
|
|
705
|
-
inputEl:
|
|
758
|
+
return d.className = "wgt:px-4 wgt:py-2 wgt:bg-gray-100 wgt:text-gray-600 wgt:flex-shrink-0", d.innerText = "đơn/tháng", c.appendChild(t), c.appendChild(d), s.appendChild(c), {
|
|
759
|
+
container: s,
|
|
760
|
+
inputEl: t,
|
|
706
761
|
getValue() {
|
|
707
|
-
return
|
|
762
|
+
return t.value;
|
|
708
763
|
},
|
|
709
|
-
setValue(
|
|
710
|
-
|
|
764
|
+
setValue(n) {
|
|
765
|
+
t.value = n;
|
|
711
766
|
}
|
|
712
767
|
};
|
|
713
768
|
}
|
|
714
|
-
function
|
|
715
|
-
packageOptions:
|
|
716
|
-
selectedPackageId:
|
|
717
|
-
|
|
769
|
+
function J({
|
|
770
|
+
packageOptions: m = [],
|
|
771
|
+
selectedPackageId: e = "",
|
|
772
|
+
handlePackageSelect: s
|
|
718
773
|
} = {}) {
|
|
719
|
-
const
|
|
720
|
-
|
|
774
|
+
const o = document.createElement("div");
|
|
775
|
+
o.className = "space-y-6";
|
|
721
776
|
const c = document.createElement("h3");
|
|
722
|
-
c.className = "text-lg font-medium text-gray-800 mb-2", c.innerText = "Gói phù hợp nhất",
|
|
723
|
-
const
|
|
724
|
-
|
|
777
|
+
c.className = "wgt:text-lg wgt:font-medium wgt:text-gray-800 wgt:mb-2", c.innerText = "Gói phù hợp nhất", o.appendChild(c);
|
|
778
|
+
const t = document.createElement("div");
|
|
779
|
+
t.className = "wgt:w-full wgt:grid wgt:grid-cols-3 wgt:gap-6", o.appendChild(t);
|
|
725
780
|
function d() {
|
|
726
|
-
|
|
727
|
-
const r =
|
|
728
|
-
|
|
729
|
-
"relative",
|
|
730
|
-
"border",
|
|
731
|
-
"rounded-xl",
|
|
732
|
-
"p-4",
|
|
733
|
-
"flex-shrink-0",
|
|
734
|
-
"cursor-pointer",
|
|
735
|
-
"bg-white",
|
|
736
|
-
r ? "border-primary" : "border-grey-6 hover:border-gray-300"
|
|
781
|
+
t.innerHTML = "", m.forEach((n) => {
|
|
782
|
+
const r = n.id === e, l = document.createElement("label");
|
|
783
|
+
l.className = [
|
|
784
|
+
"wgt:relative",
|
|
785
|
+
"wgt:border",
|
|
786
|
+
"wgt:rounded-xl",
|
|
787
|
+
"wgt:p-4",
|
|
788
|
+
"wgt:flex-shrink-0",
|
|
789
|
+
"wgt:cursor-pointer",
|
|
790
|
+
"wgt:bg-white",
|
|
791
|
+
r ? "wgt:border-primary" : "wgt:border-grey-6 wgt:hover:border-gray-300"
|
|
737
792
|
].filter(Boolean).join(" ");
|
|
738
793
|
const a = document.createElement("div");
|
|
739
|
-
a.className = "flex justify-between items-center";
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
"text-base",
|
|
743
|
-
"font-semibold",
|
|
744
|
-
r ? "text-green-700" : "text-gray-800"
|
|
745
|
-
].join(" "),
|
|
746
|
-
const { container:
|
|
794
|
+
a.className = "wgt:flex wgt:justify-between wgt:items-center";
|
|
795
|
+
const g = document.createElement("span");
|
|
796
|
+
g.className = [
|
|
797
|
+
"wgt:text-base",
|
|
798
|
+
"wgt:font-semibold",
|
|
799
|
+
r ? "wgt:text-green-700" : "wgt:text-gray-800"
|
|
800
|
+
].join(" "), g.innerText = n.code, a.appendChild(g);
|
|
801
|
+
const { container: i } = I({
|
|
747
802
|
checked: r,
|
|
748
|
-
onChange: (
|
|
749
|
-
|
|
803
|
+
onChange: (p) => {
|
|
804
|
+
p && (e = n.id, typeof s == "function" && s(n.id), d());
|
|
750
805
|
}
|
|
751
806
|
});
|
|
752
|
-
a.appendChild(
|
|
753
|
-
const
|
|
754
|
-
|
|
755
|
-
const
|
|
756
|
-
|
|
807
|
+
a.appendChild(i), l.appendChild(a);
|
|
808
|
+
const w = document.createElement("div");
|
|
809
|
+
w.className = "wgt:flex wgt:items-center wgt:text-gray-600 wgt:mt-2";
|
|
810
|
+
const u = document.createElement("svg");
|
|
811
|
+
u.setAttribute("xmlns", "http://www.w3.org/2000/svg"), u.setAttribute("class", "w-5 h-5 text-green-500 flex-shrink-0"), u.setAttribute("fill", "none"), u.setAttribute("viewBox", "0 0 24 24"), u.setAttribute("stroke", "currentColor"), u.setAttribute("stroke-width", "3"), u.innerHTML = `
|
|
757
812
|
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
|
758
|
-
`,
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
|
|
813
|
+
`, w.appendChild(u);
|
|
814
|
+
const T = document.createElement("span");
|
|
815
|
+
T.className = "wgt:ml-2 wgt:text-sm", T.innerText = `${n.unitsPerMonth.toLocaleString("vi-VN")} hóa đơn điện tử / tháng`, w.appendChild(T), l.appendChild(w);
|
|
816
|
+
const f = document.createElement("div");
|
|
817
|
+
f.className = "wgt:mt-4";
|
|
763
818
|
const E = document.createElement("span");
|
|
764
819
|
E.className = [
|
|
765
|
-
"block",
|
|
766
|
-
"text-2xl",
|
|
767
|
-
"font-bold",
|
|
768
|
-
r ? "text-green-700" : "text-gray-900"
|
|
769
|
-
].join(" "), E.innerText =
|
|
770
|
-
const
|
|
771
|
-
|
|
820
|
+
"wgt:block",
|
|
821
|
+
"wgt:text-2xl",
|
|
822
|
+
"wgt:font-bold",
|
|
823
|
+
r ? "wgt:text-green-700" : "wgt:text-gray-900"
|
|
824
|
+
].join(" "), E.innerText = n.priceVND.toLocaleString("vi-VN"), f.appendChild(E);
|
|
825
|
+
const x = document.createElement("span");
|
|
826
|
+
x.className = "wgt:text-sm wgt:text-gray-600", x.innerText = "VND/Gói", f.appendChild(x), l.appendChild(f), t.appendChild(l);
|
|
772
827
|
});
|
|
773
828
|
}
|
|
774
829
|
return d(), {
|
|
775
|
-
container:
|
|
776
|
-
setSelectedPackageId(
|
|
777
|
-
|
|
830
|
+
container: o,
|
|
831
|
+
setSelectedPackageId(n) {
|
|
832
|
+
e = n, d();
|
|
778
833
|
}
|
|
779
834
|
};
|
|
780
835
|
}
|
|
781
|
-
function
|
|
782
|
-
title:
|
|
783
|
-
isDisabled:
|
|
784
|
-
handleClick:
|
|
785
|
-
type:
|
|
836
|
+
function Q({
|
|
837
|
+
title: m,
|
|
838
|
+
isDisabled: e = !1,
|
|
839
|
+
handleClick: s = null,
|
|
840
|
+
type: o = "button",
|
|
786
841
|
className: c = ""
|
|
787
842
|
} = {}) {
|
|
788
|
-
const
|
|
789
|
-
return
|
|
790
|
-
"bg-primary",
|
|
791
|
-
"hover:bg-primary-dark",
|
|
792
|
-
"text-white",
|
|
793
|
-
"px-6",
|
|
794
|
-
"py-2",
|
|
795
|
-
"rounded",
|
|
796
|
-
"disabled:opacity-50",
|
|
797
|
-
"disabled:cursor-not-allowed",
|
|
798
|
-
"cursor-pointer",
|
|
843
|
+
const t = document.createElement("button");
|
|
844
|
+
return t.type = o, t.disabled = e, t.className = [
|
|
845
|
+
"wgt:bg-primary",
|
|
846
|
+
"wgt:hover:bg-primary-dark",
|
|
847
|
+
"wgt:text-white",
|
|
848
|
+
"wgt:px-6",
|
|
849
|
+
"wgt:py-2",
|
|
850
|
+
"wgt:rounded",
|
|
851
|
+
"wgt:disabled:opacity-50",
|
|
852
|
+
"wgt:disabled:cursor-not-allowed",
|
|
853
|
+
"wgt:cursor-pointer",
|
|
799
854
|
c
|
|
800
|
-
].filter(Boolean).join(" "),
|
|
801
|
-
|
|
802
|
-
}),
|
|
855
|
+
].filter(Boolean).join(" "), t.innerText = m, typeof s == "function" && t.addEventListener("click", (d) => {
|
|
856
|
+
t.disabled || s(d);
|
|
857
|
+
}), t;
|
|
803
858
|
}
|
|
804
|
-
function
|
|
805
|
-
|
|
859
|
+
function Y({
|
|
860
|
+
onNext: m,
|
|
861
|
+
onPrev: e,
|
|
862
|
+
setSelectedOption: s,
|
|
863
|
+
selectedOption: o
|
|
864
|
+
}) {
|
|
865
|
+
const c = [
|
|
806
866
|
{ id: "pkg-300-a", code: "DT-300", unitsPerMonth: 300, priceVND: 45e4 },
|
|
807
867
|
{ id: "pkg-500", code: "DT-500", unitsPerMonth: 500, priceVND: 75e4 },
|
|
808
|
-
{
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
868
|
+
{
|
|
869
|
+
id: "pkg-1000-b",
|
|
870
|
+
code: "DT-1000",
|
|
871
|
+
unitsPerMonth: 1e3,
|
|
872
|
+
priceVND: 105e4
|
|
873
|
+
}
|
|
874
|
+
], t = document.createElement("div");
|
|
875
|
+
t.className = "wgt:flex wgt:flex-col wgt:gap-6 wgt:h-full wgt:justify-between";
|
|
813
876
|
const d = document.createElement("div");
|
|
814
|
-
d.className = "w-full
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
877
|
+
d.className = "wgt:w-full wgt:max-w-[1070px] wgt:mx-auto wgt:flex wgt:flex-col wgt:gap-6", t.appendChild(d);
|
|
878
|
+
const n = document.createElement("div");
|
|
879
|
+
n.className = "wgt:w-full wgt:px-6 wgt:pb-6 wgt:pt-4 wgt:rounded-3xl wgt:bg-weak-50 wgt:flex wgt:flex-col wgt:gap-6", d.appendChild(n);
|
|
880
|
+
let r = "", l = [...c], a = (o == null ? void 0 : o.id) ?? c[1].id;
|
|
881
|
+
const g = X({
|
|
882
|
+
value: r,
|
|
883
|
+
onInputChange: (C) => {
|
|
884
|
+
r = C.target.value.replace(/\D/g, ""), f();
|
|
820
885
|
}
|
|
821
886
|
});
|
|
822
|
-
|
|
887
|
+
n.appendChild(g.container);
|
|
823
888
|
const i = document.createElement("div");
|
|
824
|
-
|
|
825
|
-
let
|
|
826
|
-
function
|
|
827
|
-
if (i.innerHTML = "",
|
|
828
|
-
|
|
829
|
-
packageOptions:
|
|
830
|
-
selectedPackageId:
|
|
831
|
-
|
|
889
|
+
n.appendChild(i);
|
|
890
|
+
let w = null;
|
|
891
|
+
function u() {
|
|
892
|
+
if (i.innerHTML = "", l.length > 0)
|
|
893
|
+
w = J({
|
|
894
|
+
packageOptions: l,
|
|
895
|
+
selectedPackageId: a,
|
|
896
|
+
handlePackageSelect: (C) => {
|
|
897
|
+
a = C, u();
|
|
898
|
+
}
|
|
899
|
+
}), i.appendChild(w.container);
|
|
832
900
|
else {
|
|
833
|
-
const
|
|
834
|
-
|
|
901
|
+
const C = document.createElement("span");
|
|
902
|
+
C.className = "wgt:text-gray-500", C.innerText = "No package found.", i.appendChild(C), w = null;
|
|
835
903
|
}
|
|
836
904
|
}
|
|
837
|
-
let
|
|
838
|
-
function
|
|
839
|
-
|
|
840
|
-
const
|
|
841
|
-
(
|
|
905
|
+
let T = null;
|
|
906
|
+
function f() {
|
|
907
|
+
T && clearTimeout(T), r !== "" ? T = setTimeout(() => {
|
|
908
|
+
const C = c.find(
|
|
909
|
+
(N) => N.code.endsWith(r)
|
|
842
910
|
);
|
|
843
|
-
|
|
844
|
-
}, 500) : (
|
|
911
|
+
C ? (a = C.id, l = [C]) : l = [], u();
|
|
912
|
+
}, 500) : (l = [...c], u());
|
|
845
913
|
}
|
|
846
|
-
|
|
847
|
-
const
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
const
|
|
852
|
-
|
|
853
|
-
const
|
|
854
|
-
|
|
914
|
+
u();
|
|
915
|
+
const E = document.createElement("div");
|
|
916
|
+
E.className = "wgt:flex wgt:items-center wgt:gap-4";
|
|
917
|
+
const x = document.createElement("span");
|
|
918
|
+
x.className = "wgt:text-sm wgt:font-semibold wgt:leading-[18px] wgt:text-text-black", x.innerText = "Hình thức thanh toán:", E.appendChild(x);
|
|
919
|
+
const p = document.createElement("div");
|
|
920
|
+
p.className = "wgt:p-2 wgt:w-fit wgt:rounded-[10px] wgt:border wgt:border-soft-200 wgt:flex wgt:items-center wgt:gap-2";
|
|
921
|
+
const b = document.createElement("div");
|
|
922
|
+
b.innerHTML = `
|
|
855
923
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
856
924
|
xmlns="http://www.w3.org/2000/svg">
|
|
857
925
|
<rect width="24" height="24" rx="8" fill="#379DF1" />
|
|
@@ -871,146 +939,146 @@ function z({ onNext: f, onPrev: p, setSelectedOption: o }) {
|
|
|
871
939
|
</clipPath>
|
|
872
940
|
</defs>
|
|
873
941
|
</svg>
|
|
874
|
-
`,
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
const
|
|
942
|
+
`, p.appendChild(b);
|
|
943
|
+
const v = document.createElement("span");
|
|
944
|
+
v.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-strong-950", v.innerText = "Thanh toán qua mã QR", p.appendChild(v), E.appendChild(p), d.appendChild(E);
|
|
945
|
+
const h = document.createElement("div");
|
|
946
|
+
h.className = "wgt:flex wgt:items-center wgt:justify-between wgt:gap-2 wgt:px-6";
|
|
947
|
+
const H = Q({
|
|
880
948
|
type: "button",
|
|
881
949
|
title: "Quay lại",
|
|
882
|
-
className: "bg-transparent
|
|
883
|
-
handleClick:
|
|
950
|
+
className: "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline",
|
|
951
|
+
handleClick: e
|
|
884
952
|
});
|
|
885
|
-
|
|
886
|
-
const
|
|
953
|
+
h.appendChild(H);
|
|
954
|
+
const y = Q({
|
|
887
955
|
type: "button",
|
|
888
956
|
title: "Tiếp theo",
|
|
889
957
|
className: "",
|
|
890
958
|
handleClick: () => {
|
|
891
|
-
const
|
|
892
|
-
(
|
|
959
|
+
const C = c.find(
|
|
960
|
+
(N) => N.id === a
|
|
893
961
|
);
|
|
894
|
-
|
|
962
|
+
C && (s(C), m());
|
|
895
963
|
}
|
|
896
964
|
});
|
|
897
|
-
return
|
|
965
|
+
return h.appendChild(y), t.appendChild(h), { container: t };
|
|
898
966
|
}
|
|
899
|
-
function
|
|
900
|
-
qrSrc:
|
|
901
|
-
logos:
|
|
902
|
-
accountName:
|
|
903
|
-
accountNumber:
|
|
967
|
+
function D({
|
|
968
|
+
qrSrc: m = "",
|
|
969
|
+
logos: e = [],
|
|
970
|
+
accountName: s = "",
|
|
971
|
+
accountNumber: o = "",
|
|
904
972
|
bankName: c = "",
|
|
905
|
-
instructions:
|
|
973
|
+
instructions: t = [],
|
|
906
974
|
illustrationSrc: d = ""
|
|
907
975
|
} = {}) {
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
const r = document.createElement("div"),
|
|
911
|
-
|
|
976
|
+
const n = document.createElement("div");
|
|
977
|
+
n.className = "wgt:flex wgt:flex-col wgt:md:flex-row wgt:gap-6 wgt:p-6 wgt:bg-gray-50 wgt:rounded-xl";
|
|
978
|
+
const r = document.createElement("div"), l = document.createElement("h3");
|
|
979
|
+
l.className = "wgt:text-lg wgt:font-semibold wgt:text-gray-800 wgt:mb-4 wgt:text-center", l.innerText = "Quét mã QR để thanh toán", r.appendChild(l);
|
|
912
980
|
const a = document.createElement("div");
|
|
913
|
-
a.className = "bg-white rounded-md p-6 flex flex-col gap-4 border border-[#E4E7EC]";
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
}), a.appendChild(
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
const
|
|
928
|
-
|
|
981
|
+
a.className = "wgt:bg-white wgt:rounded-md wgt:p-6 wgt:flex wgt:flex-col wgt:gap-4 wgt:border wgt:border-[#E4E7EC]";
|
|
982
|
+
const g = document.createElement("div");
|
|
983
|
+
g.className = "wgt:flex wgt:justify-center";
|
|
984
|
+
const i = document.createElement("img");
|
|
985
|
+
i.src = m, i.alt = "QR code", i.className = "wgt:w-full wgt:max-w-[200px] wgt:aspect-square wgt:object-contain", g.appendChild(i), a.appendChild(g);
|
|
986
|
+
const w = document.createElement("div");
|
|
987
|
+
w.className = "wgt:flex wgt:justify-center wgt:items-center wgt:gap-4 wgt:flex-wrap", e.forEach((y) => {
|
|
988
|
+
const C = document.createElement("img");
|
|
989
|
+
C.src = y, C.alt = "Logo", C.className = "wgt:w-8 wgt:object-contain", w.appendChild(C);
|
|
990
|
+
}), a.appendChild(w);
|
|
991
|
+
const u = document.createElement("div");
|
|
992
|
+
u.className = "wgt:text-center wgt:flex wgt:flex-col wgt:gap-1";
|
|
993
|
+
const T = document.createElement("h3");
|
|
994
|
+
T.className = "wgt:text-lg wgt:font-bold wgt:text-text-black", T.innerText = s, u.appendChild(T);
|
|
995
|
+
const f = document.createElement("p");
|
|
996
|
+
f.className = "wgt:text-sm wgt:text-grey-8", f.innerHTML = `Số tài khoản: <span class="wgt:font-medium">${o}</span>`, u.appendChild(f);
|
|
929
997
|
const E = document.createElement("p");
|
|
930
|
-
E.className = "text-sm text-grey-8", E.innerHTML = `Ngân hàng thụ hưởng: <span class="font-medium">${c}</span>`,
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
const
|
|
934
|
-
|
|
935
|
-
const
|
|
936
|
-
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
const
|
|
940
|
-
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
}),
|
|
998
|
+
E.className = "wgt:text-sm wgt:text-grey-8", E.innerHTML = `Ngân hàng thụ hưởng: <span class="wgt:font-medium">${c}</span>`, u.appendChild(E), a.appendChild(u), r.appendChild(a), n.appendChild(r);
|
|
999
|
+
const x = document.createElement("div");
|
|
1000
|
+
x.className = "wgt:flex wgt:flex-col wgt:justify-between wgt:md:w-1/2";
|
|
1001
|
+
const p = document.createElement("div"), b = document.createElement("h3");
|
|
1002
|
+
b.className = "wgt:text-lg wgt:font-semibold wgt:text-gray-800 mb-4", b.innerText = "Hướng dẫn thanh toán QR", p.appendChild(b);
|
|
1003
|
+
const v = document.createElement("ol");
|
|
1004
|
+
v.className = "wgt:space-y-4", t.forEach((y, C) => {
|
|
1005
|
+
const N = document.createElement("li");
|
|
1006
|
+
N.className = "wgt:flex wgt:items-start";
|
|
1007
|
+
const V = document.createElement("div");
|
|
1008
|
+
V.className = "wgt:flex-shrink-0 wgt:mt-0.5";
|
|
1009
|
+
const M = document.createElement("div");
|
|
1010
|
+
M.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
|
|
1011
|
+
const S = document.createElement("span");
|
|
1012
|
+
S.className = "wgt:text-white wgt:text-sm wgt:font-semibold", S.innerText = String(C + 1), M.appendChild(S), V.appendChild(M);
|
|
1013
|
+
const k = document.createElement("p");
|
|
1014
|
+
k.className = "wgt:ml-3 wgt:text-gray-700", k.innerText = y, N.appendChild(V), N.appendChild(k), v.appendChild(N);
|
|
1015
|
+
}), p.appendChild(v), x.appendChild(p);
|
|
948
1016
|
const h = document.createElement("div");
|
|
949
|
-
h.className = "h-[300px] flex justify-center";
|
|
950
|
-
const
|
|
951
|
-
return
|
|
952
|
-
container:
|
|
953
|
-
update(
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
})),
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
const H = document.createElement("div");
|
|
961
|
-
H.className = "flex-shrink-0 mt-0.5";
|
|
1017
|
+
h.className = "wgt:h-[300px] wgt:flex wgt:justify-center";
|
|
1018
|
+
const H = document.createElement("img");
|
|
1019
|
+
return H.src = d, H.alt = "QR payment illustration", H.className = "wgt:h-full wgt:object-contain", h.appendChild(H), x.appendChild(h), n.appendChild(x), {
|
|
1020
|
+
container: n,
|
|
1021
|
+
update(y = {}) {
|
|
1022
|
+
y.qrSrc != null && (i.src = y.qrSrc), y.logos && (w.innerHTML = "", y.logos.forEach((C) => {
|
|
1023
|
+
const N = document.createElement("img");
|
|
1024
|
+
N.src = C, N.alt = "Logo", N.className = "wgt:w-8 wgt:object-contain", w.appendChild(N);
|
|
1025
|
+
})), y.accountName != null && (T.innerText = y.accountName), y.accountNumber != null && (f.innerHTML = `Số tài khoản: <span class="wgt:font-medium">${y.accountNumber}</span>`), y.bankName != null && (E.innerHTML = `Ngân hàng thụ hưởng: <span class="wgt:font-medium">${y.bankName}</span>`), y.instructions && (v.innerHTML = "", y.instructions.forEach((C, N) => {
|
|
1026
|
+
const V = document.createElement("li");
|
|
1027
|
+
V.className = "wgt:flex wgt:items-start";
|
|
962
1028
|
const M = document.createElement("div");
|
|
963
|
-
M.className = "
|
|
964
|
-
const
|
|
965
|
-
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
|
|
1029
|
+
M.className = "wgt:flex-shrink-0 wgt:mt-0.5";
|
|
1030
|
+
const S = document.createElement("div");
|
|
1031
|
+
S.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
|
|
1032
|
+
const k = document.createElement("span");
|
|
1033
|
+
k.className = "wgt:text-white wgt:text-sm wgt:font-semibold", k.innerText = String(N + 1), S.appendChild(k), M.appendChild(S);
|
|
1034
|
+
const L = document.createElement("p");
|
|
1035
|
+
L.className = "wgt:ml-3 wgt:text-gray-700", L.innerText = C, V.appendChild(M), V.appendChild(L), v.appendChild(V);
|
|
1036
|
+
})), y.illustrationSrc != null && (H.src = y.illustrationSrc);
|
|
969
1037
|
}
|
|
970
1038
|
};
|
|
971
1039
|
}
|
|
972
|
-
function
|
|
973
|
-
qrSrc:
|
|
974
|
-
logos:
|
|
975
|
-
accountName:
|
|
976
|
-
accountNumber:
|
|
1040
|
+
function ee({
|
|
1041
|
+
qrSrc: m,
|
|
1042
|
+
logos: e = [],
|
|
1043
|
+
accountName: s = "",
|
|
1044
|
+
accountNumber: o = "",
|
|
977
1045
|
bankName: c = "",
|
|
978
|
-
instructions:
|
|
1046
|
+
instructions: t = [],
|
|
979
1047
|
illustrationSrc: d
|
|
980
1048
|
} = {}) {
|
|
981
|
-
const { container:
|
|
982
|
-
qrSrc:
|
|
983
|
-
logos:
|
|
984
|
-
accountName:
|
|
985
|
-
accountNumber:
|
|
1049
|
+
const { container: n } = D({
|
|
1050
|
+
qrSrc: m,
|
|
1051
|
+
logos: e,
|
|
1052
|
+
accountName: s,
|
|
1053
|
+
accountNumber: o,
|
|
986
1054
|
bankName: c,
|
|
987
|
-
instructions:
|
|
1055
|
+
instructions: t,
|
|
988
1056
|
illustrationSrc: d
|
|
989
1057
|
});
|
|
990
|
-
return { container:
|
|
1058
|
+
return { container: n };
|
|
991
1059
|
}
|
|
992
|
-
function
|
|
993
|
-
selectedProvider:
|
|
994
|
-
selectedOption:
|
|
995
|
-
totalAmountText:
|
|
996
|
-
onCancel:
|
|
1060
|
+
function te({
|
|
1061
|
+
selectedProvider: m = null,
|
|
1062
|
+
selectedOption: e = null,
|
|
1063
|
+
totalAmountText: s = "",
|
|
1064
|
+
onCancel: o
|
|
997
1065
|
} = {}) {
|
|
998
1066
|
const c = document.createElement("div");
|
|
999
1067
|
c.className = [
|
|
1000
|
-
"w-[440px]",
|
|
1001
|
-
"flex",
|
|
1002
|
-
"flex-col",
|
|
1003
|
-
"rounded-2xl",
|
|
1004
|
-
"border",
|
|
1005
|
-
"border-soft-200",
|
|
1006
|
-
"overflow-hidden"
|
|
1068
|
+
"wgt:w-[440px]",
|
|
1069
|
+
"wgt:flex",
|
|
1070
|
+
"wgt:flex-col",
|
|
1071
|
+
"wgt:rounded-2xl",
|
|
1072
|
+
"wgt:border",
|
|
1073
|
+
"wgt:border-soft-200",
|
|
1074
|
+
"wgt:overflow-hidden"
|
|
1007
1075
|
].join(" ");
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1076
|
+
const t = document.createElement("div");
|
|
1077
|
+
t.className = "wgt:p-4 wgt:w-full wgt:flex wgt:items-center wgt:justify-center wgt:gap-2 wgt:bg-primary/10";
|
|
1010
1078
|
const d = document.createElement("p");
|
|
1011
|
-
d.className = "text-base font-medium leading-6 text-primary", d.innerHTML = 'Hoàn tất thanh toán của bạn trong <span class="font-bold">01:00:00</span>',
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1079
|
+
d.className = "wgt:text-base wgt:font-medium wgt:leading-6 wgt:text-primary", d.innerHTML = 'Hoàn tất thanh toán của bạn trong <span class="font-bold">01:00:00</span>', t.appendChild(d);
|
|
1080
|
+
const n = document.createElement("svg");
|
|
1081
|
+
n.setAttribute("width", "24"), n.setAttribute("height", "24"), n.setAttribute("viewBox", "0 0 24 24"), n.setAttribute("fill", "none"), n.setAttribute("xmlns", "http://www.w3.org/2000/svg"), n.innerHTML = `
|
|
1014
1082
|
<path
|
|
1015
1083
|
d="M12 1.40039C17.8537 1.40039 22.5996 6.14633 22.5996 12C22.5996 17.8537 17.8537 22.5996 12 22.5996C6.14633 22.5996 1.40039 17.8537 1.40039 12C1.40039 6.14633 6.14633 1.40039 12 1.40039ZM12 3.38086C7.24117 3.38086 3.38086 7.24117 3.38086 12C3.38086 16.7588 7.24117 20.6191 12 20.6191C16.7588 20.6191 20.6191 16.7588 20.6191 12C20.6191 7.24117 16.7588 3.38086 12 3.38086Z"
|
|
1016
1084
|
fill="#1D963E"
|
|
@@ -1021,95 +1089,95 @@ function X({
|
|
|
1021
1089
|
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"
|
|
1022
1090
|
fill="#1D963E"
|
|
1023
1091
|
/>
|
|
1024
|
-
`,
|
|
1092
|
+
`, t.appendChild(n), c.appendChild(t);
|
|
1025
1093
|
const r = document.createElement("div");
|
|
1026
1094
|
r.className = [
|
|
1027
|
-
"p-6",
|
|
1028
|
-
"w-full",
|
|
1029
|
-
"flex",
|
|
1030
|
-
"flex-col",
|
|
1031
|
-
"gap-10",
|
|
1032
|
-
"shadow-[0px_2px_6px_0px_rgba(31,34,41,0.04)]"
|
|
1095
|
+
"wgt:p-6",
|
|
1096
|
+
"wgt:w-full",
|
|
1097
|
+
"wgt:flex",
|
|
1098
|
+
"wgt:flex-col",
|
|
1099
|
+
"wgt:gap-10",
|
|
1100
|
+
"wgt:shadow-[0px_2px_6px_0px_rgba(31,34,41,0.04)]"
|
|
1033
1101
|
].join(" ");
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1102
|
+
const l = document.createElement("div");
|
|
1103
|
+
l.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
1036
1104
|
const a = document.createElement("h2");
|
|
1037
|
-
a.className = "text-xl font-semibold leading-6 text-black", a.innerText = "Thông tin đơn hàng",
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1048
|
-
const
|
|
1049
|
-
|
|
1105
|
+
a.className = "wgt:text-xl wgt:font-semibold wgt:leading-6 wgt:text-black", a.innerText = "Thông tin đơn hàng", l.appendChild(a);
|
|
1106
|
+
const g = document.createElement("div");
|
|
1107
|
+
g.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
1108
|
+
const i = document.createElement("h4");
|
|
1109
|
+
i.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", i.innerText = "Nhà cung cấp";
|
|
1110
|
+
const w = document.createElement("img");
|
|
1111
|
+
m && m.logoUrl && (w.src = m.logoUrl, w.alt = m.name, w.className = "wgt:h-6 wgt:object-contain"), g.appendChild(i), g.appendChild(w), l.appendChild(g);
|
|
1112
|
+
const u = document.createElement("div");
|
|
1113
|
+
u.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
1114
|
+
const T = document.createElement("h4");
|
|
1115
|
+
T.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", T.innerText = "Gói đăng ký";
|
|
1116
|
+
const f = document.createElement("span");
|
|
1117
|
+
f.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", f.innerText = e ? String(e.unitsPerMonth) : "", u.appendChild(T), u.appendChild(f), l.appendChild(u);
|
|
1050
1118
|
const E = document.createElement("hr");
|
|
1051
|
-
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
const
|
|
1119
|
+
l.appendChild(E);
|
|
1120
|
+
const x = document.createElement("div");
|
|
1121
|
+
x.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
1122
|
+
const p = document.createElement("h4");
|
|
1123
|
+
p.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", p.innerText = "Số tiền thanh toán";
|
|
1124
|
+
const b = document.createElement("span");
|
|
1125
|
+
b.className = "wgt:text-2xl wgt:font-bold wgt:leading-6 wgt:text-[#ED1C24]", b.innerText = s, x.appendChild(p), x.appendChild(b), l.appendChild(x), r.appendChild(l);
|
|
1126
|
+
const v = Q({
|
|
1059
1127
|
title: "Hủy giao dịch",
|
|
1060
|
-
className: "bg-transparent border border-primary
|
|
1128
|
+
className: "wgt:bg-transparent wgt:border wgt:border-primary wgt:!text-primary wgt:hover:bg-transparent",
|
|
1061
1129
|
handleClick: () => {
|
|
1062
|
-
typeof
|
|
1130
|
+
typeof o == "function" && o();
|
|
1063
1131
|
}
|
|
1064
1132
|
});
|
|
1065
|
-
return r.appendChild(
|
|
1133
|
+
return r.appendChild(v), c.appendChild(r), {
|
|
1066
1134
|
container: c,
|
|
1067
1135
|
setSelectedProvider(h) {
|
|
1068
|
-
|
|
1136
|
+
m = h, w.src = (h == null ? void 0 : h.logo) || "", w.alt = (h == null ? void 0 : h.name) || "";
|
|
1069
1137
|
},
|
|
1070
1138
|
setSelectedOption(h) {
|
|
1071
|
-
|
|
1139
|
+
e = h, f.innerText = h ? String(h.unitsPerMonth) : "";
|
|
1072
1140
|
},
|
|
1073
1141
|
setTotalAmountText(h) {
|
|
1074
|
-
|
|
1142
|
+
s = h, b.innerText = h;
|
|
1075
1143
|
}
|
|
1076
1144
|
};
|
|
1077
1145
|
}
|
|
1078
|
-
function
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1146
|
+
function ne({ onPrev: m, checkoutProps: e, orderInfoProps: s }) {
|
|
1147
|
+
const o = document.createElement("div");
|
|
1148
|
+
o.className = "wgt:flex wgt:flex-col wgt:gap-6";
|
|
1081
1149
|
const c = document.createElement("div");
|
|
1082
|
-
c.className = "w-full flex items-start gap-6";
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1085
|
-
const { container: d } =
|
|
1086
|
-
|
|
1087
|
-
const { container:
|
|
1088
|
-
c.appendChild(
|
|
1150
|
+
c.className = "wgt:w-full wgt:flex wgt:items-start wgt:gap-6";
|
|
1151
|
+
const t = document.createElement("div");
|
|
1152
|
+
t.className = "wgt:flex-1";
|
|
1153
|
+
const { container: d } = ee(e);
|
|
1154
|
+
t.appendChild(d), c.appendChild(t);
|
|
1155
|
+
const { container: n } = te(s);
|
|
1156
|
+
c.appendChild(n), o.appendChild(c);
|
|
1089
1157
|
const r = document.createElement("div");
|
|
1090
|
-
r.className = "flex items-center justify-between gap-2 px-6";
|
|
1091
|
-
const
|
|
1158
|
+
r.className = "wgt:flex wgt:items-center wgt:justify-between wgt:gap-2 wgt:px-6";
|
|
1159
|
+
const l = Q({
|
|
1092
1160
|
type: "button",
|
|
1093
1161
|
title: "Quay lại",
|
|
1094
|
-
className: "bg-transparent
|
|
1095
|
-
handleClick:
|
|
1162
|
+
className: "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline",
|
|
1163
|
+
handleClick: m
|
|
1096
1164
|
});
|
|
1097
|
-
return r.appendChild(
|
|
1165
|
+
return r.appendChild(l), o.appendChild(r), { container: o };
|
|
1098
1166
|
}
|
|
1099
|
-
function
|
|
1100
|
-
const
|
|
1167
|
+
function le(m) {
|
|
1168
|
+
const e = [
|
|
1101
1169
|
"Thông Tin",
|
|
1102
1170
|
"Gói Hóa Đơn",
|
|
1103
1171
|
"Xác Nhận Và Thanh Toán"
|
|
1104
|
-
], { container:
|
|
1105
|
-
steps:
|
|
1172
|
+
], { container: s, setStep: o, setContent: c } = _({
|
|
1173
|
+
steps: e.map((a) => a),
|
|
1106
1174
|
currentStep: 1
|
|
1107
1175
|
});
|
|
1108
|
-
|
|
1109
|
-
let
|
|
1110
|
-
function
|
|
1111
|
-
if (
|
|
1112
|
-
const { container:
|
|
1176
|
+
m.appendChild(s);
|
|
1177
|
+
let t = 1, d = null, n = null, r = null;
|
|
1178
|
+
function l(a) {
|
|
1179
|
+
if (a === 1) {
|
|
1180
|
+
const { container: g } = K({
|
|
1113
1181
|
providerProps: {
|
|
1114
1182
|
providers: [
|
|
1115
1183
|
{ name: "Misa", route: "misa", logoUrl: "./assets/misa.svg" },
|
|
@@ -1123,28 +1191,30 @@ function Y(f) {
|
|
|
1123
1191
|
},
|
|
1124
1192
|
formProps: {
|
|
1125
1193
|
onSubmit: (i) => {
|
|
1126
|
-
|
|
1127
|
-
}
|
|
1194
|
+
n = i, t = 2, o(t), l(t);
|
|
1195
|
+
},
|
|
1196
|
+
registrationData: n
|
|
1128
1197
|
}
|
|
1129
1198
|
});
|
|
1130
|
-
c(
|
|
1131
|
-
} else if (
|
|
1132
|
-
const { container:
|
|
1199
|
+
c(g);
|
|
1200
|
+
} else if (a === 2) {
|
|
1201
|
+
const { container: g } = Y({
|
|
1133
1202
|
onNext: () => {
|
|
1134
|
-
|
|
1203
|
+
t = 3, o(t), l(t);
|
|
1135
1204
|
},
|
|
1136
1205
|
onPrev: () => {
|
|
1137
|
-
|
|
1206
|
+
t = 1, o(t), l(t);
|
|
1138
1207
|
},
|
|
1139
1208
|
setSelectedOption: (i) => {
|
|
1140
|
-
|
|
1141
|
-
}
|
|
1209
|
+
r = i;
|
|
1210
|
+
},
|
|
1211
|
+
selectedOption: r
|
|
1142
1212
|
});
|
|
1143
|
-
c(
|
|
1144
|
-
} else if (
|
|
1145
|
-
const { container:
|
|
1213
|
+
c(g);
|
|
1214
|
+
} else if (a === 3) {
|
|
1215
|
+
const { container: g } = ne({
|
|
1146
1216
|
onPrev: () => {
|
|
1147
|
-
|
|
1217
|
+
t = 2, o(t), l(t);
|
|
1148
1218
|
},
|
|
1149
1219
|
checkoutProps: {
|
|
1150
1220
|
qrSrc: "./assets/qrcode.png",
|
|
@@ -1167,18 +1237,18 @@ function Y(f) {
|
|
|
1167
1237
|
},
|
|
1168
1238
|
orderInfoProps: {
|
|
1169
1239
|
selectedProvider: d || { name: "", logo: "" },
|
|
1170
|
-
selectedOption:
|
|
1171
|
-
totalAmountText:
|
|
1240
|
+
selectedOption: r || { unitsPerMonth: 0 },
|
|
1241
|
+
totalAmountText: r ? r.priceVND.toLocaleString("vi-VN") + " VND" : "0 VND",
|
|
1172
1242
|
onCancel: () => {
|
|
1173
|
-
|
|
1243
|
+
t = 2, o(t), l(t);
|
|
1174
1244
|
}
|
|
1175
1245
|
}
|
|
1176
1246
|
});
|
|
1177
|
-
c(
|
|
1247
|
+
c(g);
|
|
1178
1248
|
}
|
|
1179
1249
|
}
|
|
1180
|
-
|
|
1250
|
+
l(t);
|
|
1181
1251
|
}
|
|
1182
1252
|
export {
|
|
1183
|
-
|
|
1253
|
+
le as InvoiceRegisterWidget
|
|
1184
1254
|
};
|