@invoice-sdk/widget 1.118.0 → 1.118.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.
@@ -1,278 +1,279 @@
1
- var ie = Object.defineProperty;
1
+ var re = Object.defineProperty;
2
2
  var D = Object.getOwnPropertySymbols;
3
3
  var ae = Object.prototype.hasOwnProperty, se = Object.prototype.propertyIsEnumerable;
4
- var ee = (i, t, e) => t in i ? ie(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, $ = (i, t) => {
4
+ var ee = (r, t, e) => t in r ? re(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, $ = (r, t) => {
5
5
  for (var e in t || (t = {}))
6
- ae.call(t, e) && ee(i, e, t[e]);
6
+ ae.call(t, e) && ee(r, e, t[e]);
7
7
  if (D)
8
8
  for (var e of D(t))
9
- se.call(t, e) && ee(i, e, t[e]);
10
- return i;
9
+ se.call(t, e) && ee(r, e, t[e]);
10
+ return r;
11
11
  };
12
- var R = (i, t, e) => new Promise((n, o) => {
12
+ var j = (r, t, e) => new Promise((i, d) => {
13
13
  var s = (p) => {
14
14
  try {
15
15
  g(e.next(p));
16
16
  } catch (N) {
17
- o(N);
17
+ d(N);
18
18
  }
19
19
  }, a = (p) => {
20
20
  try {
21
21
  g(e.throw(p));
22
22
  } catch (N) {
23
- o(N);
23
+ d(N);
24
24
  }
25
- }, g = (p) => p.done ? n(p.value) : Promise.resolve(p.value).then(s, a);
26
- g((e = e.apply(i, t)).next());
25
+ }, g = (p) => p.done ? i(p.value) : Promise.resolve(p.value).then(s, a);
26
+ g((e = e.apply(r, t)).next());
27
27
  });
28
- import { c as G, f as te, e as oe, b as le, o as ne, s as de } from "./loading-BBaWO-p-.js";
29
- import { t as r, c as J } from "./index-D7Tgbbr0.js";
30
- function z(i) {
31
- const t = i.trim();
32
- return t ? t.length < 2 || t.length > 250 ? { valid: !1, error: r("length_2_250") } : /[<>:"\/\\|?*@#$%!^]/.test(t) ? { valid: !1, error: r("invalid_characters") } : { valid: !0 } : { valid: !1, error: r("equired_name") };
28
+ import { c as G, f as te, e as oe, b as de, o as ne, s as le } from "./loading-Btbxdqb9.js";
29
+ import { t as n, c as J, j as ce } from "./index-EgycCzHi.js";
30
+ function z(r) {
31
+ const t = r.trim();
32
+ return t ? t.length < 2 || t.length > 250 ? { valid: !1, error: n("length_2_250") } : /[<>:"\/\\|?*@#$%!^]/.test(t) ? { valid: !1, error: n("invalid_characters") } : { valid: !0 } : { valid: !1, error: n("required_name") };
33
33
  }
34
- function X(i, t = !1) {
35
- const e = i.trim();
36
- return e ? e.length < 2 || e.length > 250 ? { valid: !1, error: r("length_2_250") } : /[<>:"\/\\|?*@#$%!^]/.test(e) ? { valid: !1, error: r("invalid_characters") } : { valid: !0 } : t ? { valid: !1, error: r("required_address") } : { valid: !0 };
34
+ function X(r, t = !1) {
35
+ const e = String(r != null ? r : "").trim();
36
+ return e ? e.length < 2 || e.length > 250 ? { valid: !1, error: n("length_2_250") } : /[<>:"\\|?*@#$%!^]/.test(e) ? { valid: !1, error: n("invalid_characters") } : { valid: !0 } : t ? { valid: !1, error: n("required_address") } : { valid: !0 };
37
37
  }
38
- function K(i) {
39
- const t = i.trim();
40
- return t ? t.length < 6 || t.length > 254 ? { valid: !1, error: r("email_length") } : /[<>:"\/\\|?*#$%!\s]/.test(t) ? { valid: !1, error: r("email_invalid_format") } : /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t) ? t.includes("@@") ? { valid: !1, error: r("email_invalid_format") } : { valid: !0 } : { valid: !1, error: r("email_invalid_format") } : { valid: !1, error: r("required_email") };
38
+ function K(r) {
39
+ const t = r.trim();
40
+ return t ? t.length < 6 || t.length > 254 ? { valid: !1, error: n("email_length") } : /[<>:"\/\\|?*#$%!\s]/.test(t) ? { valid: !1, error: n("email_invalid_format") } : /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t) ? t.includes("@@") ? { valid: !1, error: n("email_invalid_format") } : { valid: !0 } : { valid: !1, error: n("email_invalid_format") } : { valid: !1, error: n("required_email") };
41
41
  }
42
- function Y(i, t = !1) {
43
- const e = i.trim();
42
+ function Y(r, t = !1) {
43
+ const e = r.trim();
44
44
  if (!e)
45
- return t ? { valid: !1, error: r("required_phone") } : { valid: !0 };
46
- const n = e.replace(/\s/g, "");
47
- if (/[<>:"\/\\|?*@#$%!A-Za-z]/.test(n))
48
- return { valid: !1, error: r("phone_invalid") };
45
+ return t ? { valid: !1, error: n("required_phone") } : { valid: !0 };
46
+ const i = e.replace(/\s/g, "");
47
+ if (/[<>:"\/\\|?*@#$%!A-Za-z]/.test(i))
48
+ return { valid: !1, error: n("phone_invalid") };
49
49
  const s = /^0\d{9}$/, a = /^\+84\d{9}$/;
50
- return !s.test(n) && !a.test(n) ? { valid: !1, error: r("phone_invalid_format") } : { valid: !0 };
50
+ return !s.test(i) && !a.test(i) ? { valid: !1, error: n("phone_invalid_format") } : { valid: !0 };
51
51
  }
52
- function Q(i) {
53
- const t = i.trim();
54
- if (!t) return { valid: !1, error: r("required_tax_code") };
52
+ function Q(r) {
53
+ const t = r.trim();
54
+ if (!t) return { valid: !1, error: n("required_tax_code") };
55
55
  const e = t.replace(/\s/g, "");
56
56
  if (/[<>:"\/\\|?*@#$%!A-Za-z\s]/.test(e))
57
- return { valid: !1, error: r("tax_code_invalid") };
57
+ return { valid: !1, error: n("tax_code_invalid") };
58
58
  if ((e.match(/-/g) || []).length > 1)
59
- return { valid: !1, error: r("tax_code_invalid_format") };
59
+ return { valid: !1, error: n("tax_code_invalid_format") };
60
60
  const s = /^\d{10}$/, a = /^\d{10}-\d{3}$/;
61
- return !s.test(e) && !a.test(e) ? { valid: !1, error: r("tax_code_invalid_format") } : { valid: !0 };
61
+ return !s.test(e) && !a.test(e) ? { valid: !1, error: n("tax_code_invalid_format") } : { valid: !0 };
62
62
  }
63
- function ce({ defaultValues: i = {}, onChange: t } = {}) {
63
+ function pe({ defaultValues: r = {}, onChange: t } = {}) {
64
64
  const e = {
65
- representativeName: i.representativeName || "",
66
- buyerAddress: i.buyerAddress || "",
67
- email: i.email || "",
68
- phone: i.phone || ""
69
- }, n = document.createElement("div");
70
- n.className = "wgt:space-y-2";
71
- function o() {
65
+ representativeName: r.representativeName || "",
66
+ buyerAddress: r.buyerAddress || "",
67
+ email: r.email || "",
68
+ phone: r.phone || ""
69
+ }, i = document.createElement("div");
70
+ i.className = "wgt:space-y-2";
71
+ function d() {
72
72
  typeof t == "function" && t($({}, e));
73
73
  }
74
- function s({ label: v, required: y, name: M, type: B = "text", placeholder: b }) {
75
- const H = document.createElement("div");
76
- H.className = "";
74
+ function s({ label: v, required: E, name: H, type: Z = "text", placeholder: b }) {
75
+ const A = document.createElement("div");
76
+ A.className = "";
77
77
  const _ = document.createElement("label");
78
- _.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", _.htmlFor = M, _.innerHTML = y ? `${v} <span class="wgt:text-semantic-error wgt:text-[#ED1C24]">*</span>` : v;
78
+ _.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", _.htmlFor = H, _.innerHTML = E ? `${v} <span class="wgt:text-semantic-error wgt:text-[#ED1C24]">*</span>` : v;
79
79
  const m = document.createElement("input");
80
- m.id = M, m.name = M, m.type = B, m.placeholder = b || "", m.className = "wgt:w-full wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:mt-2 wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary", m.value = e[M] || "";
80
+ m.id = H, m.name = H, m.type = Z, m.placeholder = b || "", m.className = "wgt:w-full wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:mt-2 wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary", m.value = e[H] || "";
81
81
  const T = document.createElement("div");
82
- return T.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", T.setAttribute("data-error-for", M), m.addEventListener("input", () => {
83
- e[M] = m.value, m.classList.remove(
82
+ return T.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", T.setAttribute("data-error-for", H), m.addEventListener("input", () => {
83
+ e[H] = m.value, m.classList.remove(
84
84
  "wgt:border-semantic-error",
85
85
  "wgt:bg-semantic-error-50"
86
- ), T.classList.add("wgt:hidden"), o();
86
+ ), T.classList.add("wgt:hidden"), d();
87
87
  }), m.addEventListener("blur", () => {
88
- let u;
89
- switch (M) {
88
+ let w;
89
+ switch (H) {
90
90
  case "representativeName":
91
- u = z(m.value);
91
+ w = z(m.value);
92
92
  break;
93
93
  case "buyerAddress":
94
- u = X(m.value);
94
+ w = X(m.value);
95
95
  break;
96
96
  case "email":
97
- u = K(m.value);
97
+ w = K(m.value);
98
98
  break;
99
99
  case "phone":
100
- u = Y(m.value, !1);
100
+ w = Y(m.value, !1);
101
101
  break;
102
102
  default:
103
103
  return;
104
104
  }
105
- !u.valid && u.error && (m.classList.add(
105
+ !w.valid && w.error && (m.classList.add(
106
106
  "wgt:border-semantic-error",
107
107
  "wgt:bg-semantic-error-50"
108
- ), T.textContent = u.error, T.classList.remove("wgt:hidden"));
109
- }), H.appendChild(_), H.appendChild(m), H.appendChild(T), { field: H, input: m, errorEl: T };
108
+ ), T.textContent = w.error, T.classList.remove("wgt:hidden"));
109
+ }), A.appendChild(_), A.appendChild(m), A.appendChild(T), { field: A, input: m, errorEl: T };
110
110
  }
111
111
  const {
112
112
  field: a,
113
113
  input: g,
114
114
  errorEl: p
115
115
  } = s({
116
- label: r("representativeName"),
116
+ label: n("representativeName"),
117
117
  required: !0,
118
118
  name: "representativeName",
119
- placeholder: r("representativeName_input")
120
- }), { field: N, errorEl: A } = s({
121
- label: r("buyerAddress"),
119
+ placeholder: n("representativeName_input")
120
+ }), { field: N, errorEl: k } = s({
121
+ label: n("buyerAddress"),
122
122
  required: !1,
123
123
  name: "buyerAddress",
124
- placeholder: r("buyerAddress_input")
124
+ placeholder: n("buyerAddress_input")
125
125
  }), {
126
126
  field: F,
127
- input: k,
128
- errorEl: d
127
+ input: M,
128
+ errorEl: l
129
129
  } = s({
130
- label: r("email"),
130
+ label: n("email"),
131
131
  required: !0,
132
132
  name: "email",
133
133
  type: "email",
134
- placeholder: r("email_input")
134
+ placeholder: n("email_input")
135
135
  }), {
136
136
  field: x,
137
- input: l,
138
- errorEl: w
137
+ input: o,
138
+ errorEl: u
139
139
  } = s({
140
- label: r("phone"),
140
+ label: n("phone"),
141
141
  required: !1,
142
142
  name: "phone",
143
143
  type: "tel",
144
- placeholder: r("phone_input")
144
+ placeholder: n("phone_input")
145
145
  });
146
- n.appendChild(a), n.appendChild(N), n.appendChild(F), n.appendChild(x);
146
+ i.appendChild(a), i.appendChild(N), i.appendChild(F), i.appendChild(x);
147
147
  function h() {
148
148
  let v = !0;
149
- function y(b, H, _) {
149
+ function E(b, A, _) {
150
150
  b.classList.add(
151
151
  "wgt:border-semantic-error",
152
152
  "wgt:bg-semantic-error-50"
153
- ), _ && H && (H.textContent = _, H.classList.remove("wgt:hidden")), v = !1;
153
+ ), _ && A && (A.textContent = _, A.classList.remove("wgt:hidden")), v = !1;
154
154
  }
155
- const M = z(e.representativeName);
156
- if (M.valid || y(g, p, M.error), e.buyerAddress.trim()) {
155
+ const H = z(e.representativeName);
156
+ if (H.valid || E(g, p, H.error), e.buyerAddress.trim()) {
157
157
  const b = X(e.buyerAddress);
158
- b.valid || y(
158
+ b.valid || E(
159
159
  document.querySelector('input[name="buyerAddress"]'),
160
- A,
160
+ k,
161
161
  b.error
162
162
  );
163
163
  }
164
- const B = K(e.email);
165
- if (B.valid || y(k, d, B.error), e.phone.trim()) {
164
+ const Z = K(e.email);
165
+ if (Z.valid || E(M, l, Z.error), e.phone.trim()) {
166
166
  const b = Y(e.phone, !1);
167
- b.valid || y(l, w, b.error);
167
+ b.valid || E(o, u, b.error);
168
168
  }
169
169
  return v;
170
170
  }
171
171
  function c() {
172
172
  return $({}, e);
173
173
  }
174
- return { container: n, getValues: c, validate: h };
174
+ return { container: i, getValues: c, validate: h };
175
175
  }
176
- function pe({
177
- defaultValues: i = {},
176
+ function ge({
177
+ defaultValues: r = {},
178
178
  onChange: t,
179
179
  onFetchByTaxCode: e
180
180
  } = {}) {
181
- const n = {
182
- noTaxCode: !!i.noTaxCode,
183
- taxCode: i.taxCode || "",
184
- representativeName: i.representativeName || "",
185
- buyerAddress: i.buyerAddress || "",
186
- performerName: i.performerName || "",
187
- email: i.email || "",
188
- phone: i.phone || ""
189
- }, o = document.createElement("div");
190
- o.className = "wgt:space-y-2";
181
+ const i = {
182
+ noTaxCode: !!r.noTaxCode,
183
+ taxCode: r.taxCode || "",
184
+ businessName: r.businessName || "",
185
+ representativeName: r.representativeName || "",
186
+ buyerAddress: r.buyerAddress || "",
187
+ // performerName: defaultValues.performerName || '',
188
+ email: r.email || "",
189
+ phone: r.phone || ""
190
+ }, d = document.createElement("div");
191
+ d.className = "wgt:space-y-2";
191
192
  function s() {
192
- typeof t == "function" && t($({}, n));
193
+ typeof t == "function" && t($({}, i));
193
194
  }
194
195
  function a({ label: C, required: L, name: f, type: W = "text", placeholder: I }) {
195
196
  const O = document.createElement("div");
196
197
  O.className = "";
197
- const j = document.createElement("label");
198
- j.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", j.htmlFor = f, j.innerHTML = L ? `${C} <span class="wgt:text-[#ED1C24]">*</span>` : C;
199
- const E = document.createElement("input");
200
- E.id = f, E.name = f, E.type = W, E.placeholder = I || "", E.className = "wgt:w-full wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:mt-2 wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary", E.value = n[f] || "";
201
- const P = document.createElement("div");
202
- return P.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", P.setAttribute("data-error-for", f), E.addEventListener("input", () => {
203
- n[f] = E.value, E.classList.remove(
198
+ const P = document.createElement("label");
199
+ P.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", P.htmlFor = f, P.innerHTML = L ? `${C} <span class="wgt:text-[#ED1C24]">*</span>` : C;
200
+ const y = document.createElement("input");
201
+ y.id = f, y.name = f, y.type = W, y.placeholder = I || "", y.className = "wgt:w-full wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:mt-2 wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary", y.value = i[f] || "";
202
+ const R = document.createElement("div");
203
+ return R.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", R.setAttribute("data-error-for", f), y.addEventListener("input", () => {
204
+ i[f] = y.value, y.classList.remove(
204
205
  "wgt:border-semantic-error",
205
206
  "wgt:bg-semantic-error-50"
206
- ), P.classList.add("wgt:hidden"), s();
207
- }), E.addEventListener("blur", () => {
208
- if (!E.value.trim() && !L) return;
207
+ ), R.classList.add("wgt:hidden"), s();
208
+ }), y.addEventListener("blur", () => {
209
+ if (!y.value.trim() && !L) return;
209
210
  let U;
210
211
  switch (f) {
211
- case "business_name":
212
+ case "businesName":
212
213
  case "representativeName":
213
- U = z(E.value);
214
+ U = z(y.value);
214
215
  break;
215
216
  case "buyerAddress":
216
- U = X(E.value);
217
+ U = X(y.value);
217
218
  break;
218
219
  case "email":
219
- U = K(E.value);
220
+ U = K(y.value);
220
221
  break;
221
222
  case "phone":
222
- U = Y(E.value, !0);
223
+ U = Y(y.value, !0);
223
224
  break;
224
225
  default:
225
226
  return;
226
227
  }
227
- !U.valid && U.error && (E.classList.add(
228
+ !U.valid && U.error && (y.classList.add(
228
229
  "wgt:border-semantic-error",
229
230
  "wgt:bg-semantic-error-50"
230
- ), P.textContent = U.error, P.classList.remove("wgt:hidden"));
231
- }), O.appendChild(j), O.appendChild(E), O.appendChild(P), { field: O, input: E, errorEl: P };
231
+ ), R.textContent = U.error, R.classList.remove("wgt:hidden"));
232
+ }), O.appendChild(P), O.appendChild(y), O.appendChild(R), { field: O, input: y, errorEl: R };
232
233
  }
233
234
  const g = document.createElement("label");
234
235
  g.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:font-medium wgt:text-strong-950 wgt:text-sm";
235
236
  const p = document.createElement("input");
236
- p.type = "checkbox", p.className = "wgt:h-4 wgt:w-4 wgt:rounded wgt:border-[#E4E7EC] focus:wgt:outline-none focus:wgt:ring-primary", p.checked = n.noTaxCode;
237
+ p.type = "checkbox", p.className = "wgt:h-4 wgt:w-4 wgt:rounded wgt:border-[#E4E7EC] focus:wgt:outline-none focus:wgt:ring-primary", p.checked = i.noTaxCode;
237
238
  const N = document.createElement("span");
238
- N.textContent = r("business_noTaxCode"), N.className = "wgt:italic wgt:font-normal wgt:text-[14px] wgt:leading-[20px] wgt:tracking-[0px] wgt:align-middle wgt:text-[#525866]", N.style.fontFamily = "Inter, sans-serif", p.addEventListener("change", () => {
239
- n.noTaxCode = p.checked, d.disabled = n.noTaxCode, l.disabled = n.noTaxCode, d.classList.remove(
239
+ N.textContent = n("business_noTaxCode"), N.className = "wgt:italic wgt:font-normal wgt:text-[14px] wgt:leading-[20px] wgt:tracking-[0px] wgt:align-middle wgt:text-[#525866]", N.style.fontFamily = "Inter, sans-serif", p.addEventListener("change", () => {
240
+ i.noTaxCode = p.checked, l.disabled = i.noTaxCode, o.disabled = i.noTaxCode, l.classList.remove(
240
241
  "wgt:border-semantic-error",
241
242
  "wgt:bg-semantic-error-50"
242
243
  ), x.classList.add("wgt:hidden"), s();
243
244
  }), g.appendChild(p), g.appendChild(N);
244
- const A = document.createElement("div");
245
- A.className = "wgt:space-y-2";
246
- const F = document.createElement("label");
247
- F.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 ", F.innerHTML = r("confirmation_popup_taxCode") + '<span class="wgt:text-[#ED1C24]">*</span>';
248
245
  const k = document.createElement("div");
249
- k.className = "wgt:flex wgt:gap-2 wgt:mt-2";
250
- const d = document.createElement("input");
251
- d.type = "text", d.name = "taxCode", d.placeholder = r("taxCode_input"), d.value = n.taxCode, d.className = "wgt:flex-1 wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary";
246
+ k.className = "wgt:space-y-2";
247
+ const F = document.createElement("label");
248
+ F.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 ", F.innerHTML = n("confirmation_popup_taxCode") + '<span class="wgt:text-[#ED1C24]">*</span>';
249
+ const M = document.createElement("div");
250
+ M.className = "wgt:flex wgt:gap-2 wgt:mt-2";
251
+ const l = document.createElement("input");
252
+ l.type = "text", l.name = "taxCode", l.placeholder = n("taxCode_input"), l.value = i.taxCode, l.className = "wgt:flex-1 wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary";
252
253
  const x = document.createElement("div");
253
- x.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", d.addEventListener("input", () => {
254
- n.taxCode = d.value, d.classList.remove(
254
+ x.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", l.addEventListener("input", () => {
255
+ i.taxCode = l.value, l.classList.remove(
255
256
  "wgt:border-semantic-error",
256
257
  "wgt:bg-semantic-error-50"
257
258
  ), x.classList.add("wgt:hidden"), s();
258
- }), d.addEventListener("blur", () => {
259
- if (n.noTaxCode || !d.value.trim()) return;
260
- const C = Q(d.value);
261
- C.valid || (d.classList.add(
259
+ }), l.addEventListener("blur", () => {
260
+ if (i.noTaxCode || !l.value.trim()) return;
261
+ const C = Q(l.value);
262
+ C.valid || (l.classList.add(
262
263
  "wgt:border-semantic-error",
263
264
  "wgt:bg-semantic-error-50"
264
265
  ), x.textContent = C.error, x.classList.remove("wgt:hidden"));
265
266
  });
266
- const l = G({
267
+ const o = G({
267
268
  type: "button",
268
- title: r("fetch_info"),
269
+ title: n("fetch_info"),
269
270
  className: "wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:font-semibold wgt:rounded-lg wgt:flex-shrink-0 wgt:text-primary wgt:bg-white wgt:border wgt:border-primary",
270
- handleClick: () => R(null, null, function* () {
271
- if (n.noTaxCode || typeof e != "function")
271
+ handleClick: () => j(null, null, function* () {
272
+ if (i.noTaxCode || typeof e != "function")
272
273
  return;
273
- const C = String(n.taxCode || "").trim();
274
+ const C = String(i.taxCode || "").trim();
274
275
  if (!C) {
275
- d.classList.add(
276
+ l.classList.add(
276
277
  "wgt:border-semantic-error",
277
278
  "wgt:bg-semantic-error-50"
278
279
  ), x.textContent = "Vui lòng nhập MST", x.classList.remove("wgt:hidden");
@@ -280,228 +281,228 @@ function pe({
280
281
  }
281
282
  const L = Q(C);
282
283
  if (!L.valid) {
283
- d.classList.add(
284
+ l.classList.add(
284
285
  "wgt:border-semantic-error",
285
286
  "wgt:bg-semantic-error-50"
286
287
  ), x.textContent = L.error, x.classList.remove("wgt:hidden");
287
288
  return;
288
289
  }
289
290
  try {
290
- l.disabled = !0;
291
- const f = yield e(C, $({}, n));
291
+ o.disabled = !0;
292
+ const f = yield e(C, $({}, i));
292
293
  if (!f || typeof f != "object") return;
293
- f.representativeName != null && (n.representativeName = String(f.representativeName || ""), h.value = n.representativeName), f.buyerAddress != null && (n.buyerAddress = String(f.buyerAddress || ""), b.value = n.buyerAddress), s();
294
+ f.representativeName != null && (i.representativeName = String(f.representativeName || ""), E.value = i.representativeName), f.buyerAddress != null && (i.buyerAddress = String(f.buyerAddress || ""), b.value = i.buyerAddress), s();
294
295
  } catch (f) {
295
- d.classList.add(
296
+ l.classList.add(
296
297
  "wgt:border-semantic-error",
297
298
  "wgt:bg-semantic-error-50"
298
299
  ), x.textContent = "Không tìm thấy thông tin MST", x.classList.remove("wgt:hidden");
299
300
  } finally {
300
- l.disabled = n.noTaxCode;
301
+ o.disabled = i.noTaxCode;
301
302
  }
302
303
  })
303
304
  });
304
- k.appendChild(d), k.appendChild(l), A.appendChild(F), A.appendChild(k), A.appendChild(x);
305
+ M.appendChild(l), M.appendChild(o), k.appendChild(F), k.appendChild(M), k.appendChild(x);
305
306
  const {
306
- field: w,
307
+ field: u,
307
308
  input: h,
308
309
  errorEl: c
309
310
  } = a({
310
- label: r("business_name"),
311
+ label: n("businessName"),
311
312
  required: !0,
312
- name: "business_name",
313
- placeholder: r("business_name_input")
313
+ name: "businessName",
314
+ placeholder: n("businessName_input")
314
315
  }), {
315
316
  field: v,
316
- input: y,
317
- errorEl: M
317
+ input: E,
318
+ errorEl: H
318
319
  } = a({
319
- label: r("representativeName"),
320
+ label: n("representativeName"),
320
321
  required: !0,
321
322
  name: "representativeName",
322
- placeholder: r("representativeName_input")
323
+ placeholder: n("representativeName_input")
323
324
  }), {
324
- field: B,
325
+ field: Z,
325
326
  input: b,
326
- errorEl: H
327
+ errorEl: A
327
328
  } = a({
328
- label: r("buyerAddress"),
329
+ label: n("buyerAddress"),
329
330
  required: !1,
330
331
  name: "buyerAddress",
331
- placeholder: r("buyerAddress_input")
332
+ placeholder: n("buyerAddress_input")
332
333
  }), {
333
334
  field: _,
334
335
  input: m,
335
336
  errorEl: T
336
337
  } = a({
337
- label: r("email"),
338
+ label: n("email"),
338
339
  required: !0,
339
340
  name: "email",
340
341
  type: "email",
341
- placeholder: r("email_input")
342
+ placeholder: n("email_input")
342
343
  }), {
343
- field: u,
344
+ field: w,
344
345
  input: V,
345
- errorEl: Z
346
+ errorEl: S
346
347
  } = a({
347
- label: r("phone"),
348
+ label: n("phone"),
348
349
  required: !0,
349
350
  name: "phone",
350
351
  type: "tel",
351
- placeholder: r("phone_input")
352
+ placeholder: n("phone_input")
352
353
  });
353
- o.appendChild(g), o.appendChild(A), o.appendChild(w), o.appendChild(v), o.appendChild(B), o.appendChild(_), o.appendChild(u), d.disabled = n.noTaxCode, l.disabled = n.noTaxCode;
354
- function S() {
354
+ d.appendChild(g), d.appendChild(k), d.appendChild(u), d.appendChild(v), d.appendChild(Z), d.appendChild(_), d.appendChild(w), l.disabled = i.noTaxCode, o.disabled = i.noTaxCode;
355
+ function B() {
355
356
  let C = !0;
356
- function L(j, E, P) {
357
- j.classList.add(
357
+ function L(P, y, R) {
358
+ P.classList.add(
358
359
  "wgt:border-semantic-error",
359
- "wgt:bg-semantic-error-50 ",
360
+ "wgt:bg-semantic-error-50",
360
361
  "wgt:mt-2"
361
- ), P && E && (E.textContent = P, E.classList.remove("wgt:hidden")), C = !1;
362
+ ), R && y && (y.textContent = R, y.classList.remove("wgt:hidden")), C = !1;
362
363
  }
363
- if (!n.noTaxCode) {
364
- const j = Q(n.taxCode);
365
- j.valid || L(d, x, j.error);
364
+ if (!i.noTaxCode) {
365
+ const P = Q(i.taxCode);
366
+ P.valid || L(l, x, P.error);
366
367
  }
367
- const f = z(n.representativeName);
368
+ const f = z(i.businessName);
368
369
  f.valid || L(h, c, f.error);
369
- const W = z(n.performerName);
370
- if (W.valid || L(y, M, W.error), n.buyerAddress.trim()) {
371
- const j = X(n.buyerAddress);
372
- j.valid || L(b, H, j.error);
370
+ const W = z(i.representativeName);
371
+ if (W.valid || L(E, H, W.error), i.buyerAddress.trim()) {
372
+ const P = X(i.buyerAddress);
373
+ P.valid || L(b, A, P.error);
373
374
  }
374
- const I = K(n.email);
375
+ const I = K(i.email);
375
376
  I.valid || L(m, T, I.error);
376
- const O = Y(n.phone, !0);
377
- return O.valid || L(V, Z, O.error), C;
377
+ const O = Y(i.phone, !0);
378
+ return O.valid || L(V, S, O.error), C;
378
379
  }
379
380
  function q() {
380
- return $({}, n);
381
+ return $({}, i);
381
382
  }
382
- return { container: o, getValues: q, validate: S };
383
+ return { container: d, getValues: q, validate: B };
383
384
  }
384
- function ge({
385
- type: i,
385
+ function me({
386
+ type: r,
386
387
  data: t,
387
388
  orderInfo: e,
388
- theme: n,
389
- onClose: o,
389
+ theme: i,
390
+ onClose: d,
390
391
  onConfirm: s
391
392
  }) {
392
393
  const a = document.createElement("div");
393
394
  a.className = "wgt:fixed wgt:inset-0 wgt:flex wgt:items-center wgt:justify-center wgt:z-50 wgt:p-4", a.style.cssText = `
394
395
  background-color: rgba(0, 0, 0, 0.5);
395
396
  backdrop-filter: blur(4px);
396
- `, n && a.setAttribute("data-theme", n);
397
+ `, i && a.setAttribute("data-theme", i);
397
398
  const g = document.createElement("div");
398
399
  g.className = "wgt:w-full wgt:max-w-md wgt:bg-white wgt:rounded-2xl wgt:shadow-xl wgt:max-h-[90vh] wgt:overflow-y-auto";
399
400
  const p = document.createElement("div");
400
401
  p.className = "wgt:px-6 wgt:pt-6 wgt:pb-4 wgt:space-y-2";
401
402
  const N = document.createElement("h3");
402
- N.className = "wgt:text-xl wgt:font-semibold wgt:text-center wgt:text-strong-950", N.textContent = r("confirmation_popup_title");
403
- const A = document.createElement("p");
404
- A.className = "wgt:text-sm wgt:text-center wgt:text-[#525866]", A.textContent = r("confirmation_popup_subtitle"), p.appendChild(N), p.appendChild(A), g.appendChild(p);
403
+ N.className = "wgt:text-xl wgt:font-semibold wgt:text-center wgt:text-strong-950", N.textContent = n("confirmation_popup_title");
404
+ const k = document.createElement("p");
405
+ k.className = "wgt:text-sm wgt:text-center wgt:text-[#525866]", k.textContent = n("confirmation_popup_subtitle"), p.appendChild(N), p.appendChild(k), g.appendChild(p);
405
406
  const F = document.createElement("div");
406
407
  F.className = "wgt:px-6 wgt:pb-4";
407
- const k = document.createElement("div");
408
- k.className = "wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-4 wgt:py-3";
409
- function d(b, H, _) {
408
+ const M = document.createElement("div");
409
+ M.className = "wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-4 wgt:py-3";
410
+ function l(b, A, _) {
410
411
  const m = document.createElement("div");
411
412
  m.className = "wgt:flex wgt:items-start wgt:gap-3";
412
413
  const T = document.createElement("span");
413
414
  T.className = "wgt:text-primary wgt:flex-shrink-0", T.innerHTML = b;
414
- const u = document.createElement("div");
415
- u.className = "wgt:flex wgt:items-start wgt:justify-between wgt:flex-1 wgt:gap-2";
415
+ const w = document.createElement("div");
416
+ w.className = "wgt:flex wgt:items-start wgt:justify-between wgt:flex-1 wgt:gap-2";
416
417
  const V = document.createElement("span");
417
- V.className = "wgt:text-sm wgt:text-[#525866] wgt:w-1/3", V.textContent = H;
418
- const Z = document.createElement("span");
419
- return Z.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", Z.textContent = _ || "-", u.appendChild(V), u.appendChild(Z), m.appendChild(T), m.appendChild(u), m;
418
+ V.className = "wgt:text-sm wgt:text-[#525866] wgt:w-1/3", V.textContent = A;
419
+ const S = document.createElement("span");
420
+ return S.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", S.textContent = _ || "-", w.appendChild(V), w.appendChild(S), m.appendChild(T), m.appendChild(w), m;
420
421
  }
421
- const x = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>', l = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" /></svg>', w = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';
422
- k.appendChild(
423
- d(
422
+ const x = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>', o = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" /></svg>', u = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';
423
+ M.appendChild(
424
+ l(
424
425
  x,
425
- r("confirmation_popup_orderCode"),
426
+ n("confirmation_popup_orderCode"),
426
427
  e == null ? void 0 : e.billNo
427
428
  )
428
- ), k.appendChild(
429
- d(
430
- l,
431
- r("confirmation_popup_address"),
429
+ ), M.appendChild(
430
+ l(
431
+ o,
432
+ n("confirmation_popup_address"),
432
433
  e == null ? void 0 : e.merchantAddress
433
434
  )
434
- ), k.appendChild(
435
- d(
436
- w,
437
- r("confirmation_popup_totalAmount"),
435
+ ), M.appendChild(
436
+ l(
437
+ u,
438
+ n("confirmation_popup_totalAmount"),
438
439
  te(e == null ? void 0 : e.amount) + " VND"
439
440
  )
440
- ), F.appendChild(k), g.appendChild(F);
441
+ ), F.appendChild(M), g.appendChild(F);
441
442
  const h = document.createElement("div");
442
443
  h.className = "wgt:px-6 wgt:pb-6";
443
444
  const c = document.createElement("div");
444
445
  c.className = "wgt:space-y-3 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:px-4 wgt:py-4";
445
- function v(b, H) {
446
+ function v(b, A) {
446
447
  const _ = document.createElement("div");
447
448
  _.className = "wgt:flex wgt:items-start wgt:justify-between wgt:gap-4";
448
449
  const m = document.createElement("span");
449
450
  m.className = "wgt:text-sm wgt:text-[#0E121B] wgt:w-1/3", m.textContent = b;
450
451
  const T = document.createElement("span");
451
- return T.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", T.textContent = H || "-", _.appendChild(m), _.appendChild(T), _;
452
+ return T.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", T.textContent = A || "-", _.appendChild(m), _.appendChild(T), _;
452
453
  }
453
- i === "business" ? (c.appendChild(
454
- v(r("confirmation_popup_taxCode"), t.taxCode)
454
+ r === "business" ? (c.appendChild(
455
+ v(n("confirmation_popup_taxCode"), t.taxCode)
456
+ ), c.appendChild(
457
+ v(n("businessName"), t.businessName)
455
458
  ), c.appendChild(
456
459
  v(
457
- r("confirmation_popup_representativeName"),
460
+ n("confirmation_popup_representativeName"),
458
461
  t.representativeName
459
462
  )
460
463
  ), c.appendChild(
461
- v(r("confirmation_popup_buyerAddress"), t.buyerAddress)
464
+ v(n("confirmation_popup_buyerAddress"), t.buyerAddress)
462
465
  ), c.appendChild(
463
- v(r("confirmation_popup_performerName"), t.performerName)
466
+ v(n("confirmation_popup_email"), t.email)
464
467
  ), c.appendChild(
465
- v(r("confirmation_popup_email"), t.email)
466
- ), c.appendChild(
467
- v(r("confirmation_popup_phone"), t.phone)
468
+ v(n("confirmation_popup_phone"), t.phone)
468
469
  )) : (c.appendChild(
469
470
  v(
470
- r("confirmation_popup_representativeName"),
471
+ n("confirmation_popup_representativeName"),
471
472
  t.representativeName
472
473
  )
473
474
  ), c.appendChild(
474
- v(r("confirmation_popup_buyerAddress"), t.buyerAddress)
475
+ v(n("confirmation_popup_buyerAddress"), t.buyerAddress)
475
476
  ), c.appendChild(
476
- v(r("confirmation_popup_email"), t.email)
477
+ v(n("confirmation_popup_email"), t.email)
477
478
  )), h.appendChild(c), g.appendChild(h);
478
- const y = document.createElement("div");
479
- y.className = "wgt:px-6 wgt:pb-6 wgt:flex wgt:gap-3";
480
- const M = G({
479
+ const E = document.createElement("div");
480
+ E.className = "wgt:px-6 wgt:pb-6 wgt:flex wgt:gap-3";
481
+ const H = G({
481
482
  type: "button",
482
483
  title: "Đóng",
483
484
  className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-white wgt:text-primary wgt:border wgt:border-primary",
484
485
  handleClick: () => {
485
- typeof o == "function" && o(), a.remove();
486
+ typeof d == "function" && d(), a.remove();
486
487
  }
487
- }), B = G({
488
+ }), Z = G({
488
489
  type: "button",
489
490
  title: "Xác nhận",
490
491
  className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-primary wgt:text-white",
491
492
  handleClick: () => {
492
- typeof s == "function" && s({ type: i, data: t }), a.remove();
493
+ typeof s == "function" && s({ type: r, data: t }), a.remove();
493
494
  }
494
495
  });
495
- return y.appendChild(M), y.appendChild(B), g.appendChild(y), a.appendChild(g), a.addEventListener("click", (b) => {
496
- b.target === a && (typeof o == "function" && o(), a.remove());
496
+ return E.appendChild(H), E.appendChild(Z), g.appendChild(E), a.appendChild(g), a.addEventListener("click", (b) => {
497
+ b.target === a && (typeof d == "function" && d(), a.remove());
497
498
  }), { overlay: a };
498
499
  }
499
- function me({
500
- orderInfo: i,
500
+ function ue({
501
+ orderInfo: r,
501
502
  onPreview: t,
502
503
  theme: e,
503
- onSubmit: n,
504
- taxCode: o = ""
504
+ onSubmit: i,
505
+ taxCode: d = ""
505
506
  }) {
506
507
  const s = document.createElement("div");
507
508
  s.className = "wgt:flex wgt:flex-col wgt:items-center wgt:justify-between wgt:h-full wgt:shadow wgt:rounded-xl", e && s.setAttribute("data-theme", e);
@@ -513,55 +514,55 @@ function me({
513
514
  close: N
514
515
  } = oe();
515
516
  s.style.position = s.style.position || "relative", s.appendChild(g);
516
- const A = document.createElement("div");
517
- A.className = "wgt:space-y-1";
517
+ const k = document.createElement("div");
518
+ k.className = "wgt:space-y-1";
518
519
  const F = document.createElement("h3");
519
- F.className = "wgt:text-2xl wgt:font-semibold wgt:text-text-black wgt:text-center wgt:justify-center", F.textContent = r("invoiceform_title");
520
- const k = document.createElement("p");
521
- k.className = "wgt:text-sm wgt:text-weak-700 wgt:text-center wgt:justify-center", k.textContent = r("invoiceform_subtitle"), A.appendChild(F), A.appendChild(k), a.appendChild(A);
522
- const d = document.createElement("div");
523
- d.className = "wgt:mt-2 wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-6 wgt:py-6";
524
- function x(u, V) {
525
- const Z = document.createElement("div");
526
- Z.className = "wgt:flex wgt:items-start";
520
+ F.className = "wgt:text-2xl wgt:font-semibold wgt:text-text-black wgt:text-center wgt:justify-center", F.textContent = n("invoiceform_title");
521
+ const M = document.createElement("p");
522
+ M.className = "wgt:text-sm wgt:text-weak-700 wgt:text-center wgt:justify-center", M.textContent = n("invoiceform_subtitle"), k.appendChild(F), k.appendChild(M), a.appendChild(k);
523
+ const l = document.createElement("div");
524
+ l.className = "wgt:mt-2 wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-6 wgt:py-6";
525
+ function x(w, V) {
527
526
  const S = document.createElement("div");
528
- S.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:w-1/3";
527
+ S.className = "wgt:flex wgt:items-start";
528
+ const B = document.createElement("div");
529
+ B.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:w-1/3";
529
530
  const q = document.createElement("span");
530
531
  q.className = "wgt:inline-flex wgt:items-center wgt:justify-center wgt:w-4 wgt:h-4 wgt:text-icon-primary";
531
532
  let C = "";
532
- u === r("orderCode") ? C = `
533
+ w === n("orderCode") ? C = `
533
534
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
534
535
  <path d="M12.7996 14H3.19961C3.04048 14 2.88787 13.9368 2.77535 13.8243C2.66282 13.7117 2.59961 13.5591 2.59961 13.4V2.6C2.59961 2.44087 2.66282 2.28826 2.77535 2.17574C2.88787 2.06321 3.04048 2 3.19961 2H12.7996C12.9587 2 13.1114 2.06321 13.2239 2.17574C13.3364 2.28826 13.3996 2.44087 13.3996 2.6V13.4C13.3996 13.5591 13.3364 13.7117 13.2239 13.8243C13.1114 13.9368 12.9587 14 12.7996 14ZM12.1996 12.8V3.2H3.79961V12.8H12.1996ZM5.59961 6.2H10.3996V7.4H5.59961V6.2ZM5.59961 8.6H10.3996V9.8H5.59961V8.6Z" fill="currentColor"/>
535
536
  </svg>
536
537
 
537
- ` : u === r("address_form") ? C = `
538
+ ` : w === n("address_form") ? C = `
538
539
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
539
540
  <path d="M7.99961 13.34L10.9696 10.37C11.557 9.78256 11.9569 9.03419 12.1189 8.21948C12.281 7.40477 12.1978 6.56031 11.8799 5.79289C11.562 5.02546 11.0236 4.36954 10.333 3.90805C9.64229 3.44657 8.83028 3.20026 7.99961 3.20026C7.16895 3.20026 6.35694 3.44657 5.66626 3.90805C4.97558 4.36954 4.43726 5.02546 4.11936 5.79289C3.80146 6.56031 3.71826 7.40477 3.88028 8.21948C4.04231 9.03419 4.44227 9.78256 5.02961 10.37L7.99961 13.34ZM7.99961 15.0368L4.18121 11.2184C3.42602 10.4631 2.91172 9.50096 2.70337 8.45346C2.49501 7.40597 2.60195 6.32021 3.01067 5.33349C3.41938 4.34678 4.11152 3.50342 4.99954 2.91006C5.88756 2.3167 6.9316 2 7.99961 2C9.06763 2 10.1117 2.3167 10.9997 2.91006C11.8877 3.50342 12.5798 4.34678 12.9886 5.33349C13.3973 6.32021 13.5042 7.40597 13.2959 8.45346C13.0875 9.50096 12.5732 10.4631 11.818 11.2184L7.99961 15.0368ZM7.99961 8.59995C8.31787 8.59995 8.6231 8.47353 8.84814 8.24848C9.07318 8.02344 9.19961 7.71821 9.19961 7.39995C9.19961 7.08169 9.07318 6.77647 8.84814 6.55143C8.6231 6.32638 8.31787 6.19995 7.99961 6.19995C7.68135 6.19995 7.37613 6.32638 7.15108 6.55143C6.92604 6.77647 6.79961 7.08169 6.79961 7.39995C6.79961 7.71821 6.92604 8.02344 7.15108 8.24848C7.37613 8.47353 7.68135 8.59995 7.99961 8.59995ZM7.99961 9.79995C7.36309 9.79995 6.75264 9.5471 6.30256 9.09701C5.85247 8.64692 5.59961 8.03647 5.59961 7.39995C5.59961 6.76343 5.85247 6.15298 6.30256 5.7029C6.75264 5.25281 7.36309 4.99995 7.99961 4.99995C8.63613 4.99995 9.24658 5.25281 9.69667 5.7029C10.1468 6.15298 10.3996 6.76343 10.3996 7.39995C10.3996 8.03647 10.1468 8.64692 9.69667 9.09701C9.24658 9.5471 8.63613 9.79995 7.99961 9.79995Z" fill="currentColor"/>
540
541
  </svg>
541
542
 
542
- ` : u === r("total_amount") && (C = `
543
+ ` : w === n("total_amount") && (C = `
543
544
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
544
545
  <path d="M8 14C4.6862 14 2 11.3138 2 8C2 4.6862 4.6862 2 8 2C11.3138 2 14 4.6862 14 8C14 11.3138 11.3138 14 8 14ZM8 12.8C9.27304 12.8 10.4939 12.2943 11.3941 11.3941C12.2943 10.4939 12.8 9.27304 12.8 8C12.8 6.72696 12.2943 5.50606 11.3941 4.60589C10.4939 3.70571 9.27304 3.2 8 3.2C6.72696 3.2 5.50606 3.70571 4.60589 4.60589C3.70571 5.50606 3.2 6.72696 3.2 8C3.2 9.27304 3.70571 10.4939 4.60589 11.3941C5.50606 12.2943 6.72696 12.8 8 12.8V12.8ZM5.9 9.2H9.2C9.27957 9.2 9.35587 9.16839 9.41213 9.11213C9.46839 9.05587 9.5 8.97957 9.5 8.9C9.5 8.82044 9.46839 8.74413 9.41213 8.68787C9.35587 8.63161 9.27957 8.6 9.2 8.6H6.8C6.40218 8.6 6.02064 8.44197 5.73934 8.16066C5.45804 7.87936 5.3 7.49783 5.3 7.1C5.3 6.70218 5.45804 6.32065 5.73934 6.03934C6.02064 5.75804 6.40218 5.6 6.8 5.6H7.4V4.4H8.6V5.6H10.1V6.8H6.8C6.72044 6.8 6.64413 6.83161 6.58787 6.88787C6.53161 6.94413 6.5 7.02044 6.5 7.1C6.5 7.17957 6.53161 7.25587 6.58787 7.31213C6.64413 7.36839 6.72044 7.4 6.8 7.4H9.2C9.59783 7.4 9.97936 7.55804 10.2607 7.83934C10.542 8.12065 10.7 8.50218 10.7 8.9C10.7 9.29783 10.542 9.67936 10.2607 9.96066C9.97936 10.242 9.59783 10.4 9.2 10.4H8.6V11.6H7.4V10.4H5.9V9.2Z" fill="currentColor"/>
545
546
  </svg>
546
547
 
547
548
  `), q.innerHTML = C;
548
549
  const L = document.createElement("span");
549
- L.className = "wgt:text-sm wgt:text-weak-700", L.textContent = u, S.appendChild(q), S.appendChild(L);
550
+ L.className = "wgt:text-sm wgt:text-weak-700", L.textContent = w, B.appendChild(q), B.appendChild(L);
550
551
  const f = document.createElement("span");
551
- return f.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:w-2/3 wgt:text-right", f.textContent = V, Z.appendChild(S), Z.appendChild(f), Z;
552
+ return f.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:w-2/3 wgt:text-right", f.textContent = V, S.appendChild(B), S.appendChild(f), S;
552
553
  }
553
- d.appendChild(x(r("orderCode"), i == null ? void 0 : i.billNo)), d.appendChild(
554
- x(r("address_form"), i == null ? void 0 : i.merchantAddress)
555
- ), d.appendChild(
554
+ l.appendChild(x(n("orderCode"), r == null ? void 0 : r.billNo)), l.appendChild(
555
+ x(n("address_form"), r == null ? void 0 : r.merchantAddress)
556
+ ), l.appendChild(
556
557
  x(
557
- r("total_amount"),
558
- te(i == null ? void 0 : i.amount) + " VND"
558
+ n("total_amount"),
559
+ te(r == null ? void 0 : r.amount) + " VND"
559
560
  )
560
- ), a.appendChild(d);
561
- const l = document.createElement("div");
562
- l.className = "wgt:mt-4 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:bg-white wgt:pb-6", a.appendChild(l);
563
- const w = document.createElement("div");
564
- w.className = "wgt:flex wgt:border-b wgt:border-[#E1E4EA]", l.appendChild(w);
561
+ ), a.appendChild(l);
562
+ const o = document.createElement("div");
563
+ o.className = "wgt:mt-4 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:bg-white wgt:pb-6", a.appendChild(o);
564
+ const u = document.createElement("div");
565
+ u.className = "wgt:flex wgt:border-b wgt:border-[#E1E4EA]", o.appendChild(u);
565
566
  const h = document.createElement("button");
566
567
  h.type = "button", h.className = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold ", h.innerHTML = `
567
568
  <span class="wgt:flex wgt:items-center wgt:justify-center wgt:gap-2">
@@ -569,7 +570,7 @@ function me({
569
570
  <path d="M10 12C11.4587 12 12.8572 12.5799 13.8887 13.6113C14.8016 14.5242 15.3592 15.7247 15.4756 17H14.9746C14.8598 15.8576 14.3542 14.7839 13.5352 13.9648C12.5975 13.0272 11.3261 12.5 10 12.5C8.67392 12.5 7.40253 13.0272 6.46484 13.9648C5.64577 14.7839 5.14018 15.8576 5.02539 17H4.52441C4.64082 15.7247 5.19843 14.5242 6.11133 13.6113C7.07838 12.6443 8.36805 12.0742 9.72754 12.0068L10 12ZM10 2.25C12.2101 2.25 14 4.03989 14 6.25C14 8.46011 12.2101 10.25 10 10.25C7.78989 10.25 6 8.46011 6 6.25C6 4.03989 7.78989 2.25 10 2.25ZM10 2.75C8.06636 2.75 6.5 4.31636 6.5 6.25C6.5 8.18364 8.06636 9.75 10 9.75C11.9336 9.75 13.5 8.18364 13.5 6.25C13.5 4.31636 11.9336 2.75 10 2.75Z" fill="currentColor" stroke="currentColor"/>
570
571
  </svg>
571
572
 
572
- ${r("individual")}
573
+ ${n("individual")}
573
574
  </span>
574
575
  `;
575
576
  const c = document.createElement("button");
@@ -579,64 +580,64 @@ function me({
579
580
  <path d="M4 3.875H11.5C11.5332 3.875 11.5654 3.88769 11.5889 3.91113C11.6123 3.93457 11.625 3.96685 11.625 4V15.875H15.875V8.625H14.375V8.375H16C16.0332 8.375 16.0654 8.38769 16.0889 8.41113C16.1123 8.43457 16.125 8.46685 16.125 8.5V15.875H17.625V16.125H2.375V15.875H3.875V4C3.875 3.96685 3.88769 3.93457 3.91113 3.91113C3.93457 3.88769 3.96685 3.875 4 3.875ZM4.125 15.875H11.375V4.125H4.125V15.875ZM8.625 9.875V10.125H6.875V9.875H8.625ZM8.625 6.875V7.125H6.875V6.875H8.625Z" fill="currentColor" stroke="currentColor" stroke-width="1.25"/>
580
581
  </svg>
581
582
 
582
- ${r("business")}
583
+ ${n("business")}
583
584
  </span>
584
- `, w.appendChild(h), w.appendChild(c);
585
+ `, u.appendChild(h), u.appendChild(c);
585
586
  const v = document.createElement("div");
586
- v.className = "wgt:mt-4 wgt:px-4", l.appendChild(v);
587
- const y = ce(), M = pe({
588
- defaultValues: { taxCode: o || "" },
589
- onFetchByTaxCode: (u) => R(null, null, function* () {
590
- var Z, S;
591
- const V = yield le(u);
587
+ v.className = "wgt:mt-4 wgt:px-4", o.appendChild(v);
588
+ const E = pe(), H = ge({
589
+ defaultValues: { taxCode: d || "" },
590
+ onFetchByTaxCode: (w) => j(null, null, function* () {
591
+ var S, B;
592
+ const V = yield de(w);
592
593
  return {
593
- representativeName: (Z = V.nguoi_dai_dien) != null ? Z : "",
594
- buyerAddress: (S = V.dia_chi) != null ? S : ""
594
+ representativeName: (S = V.nguoi_dai_dien) != null ? S : "",
595
+ buyerAddress: (B = V.dia_chi) != null ? B : ""
595
596
  };
596
597
  })
597
598
  });
598
- let B = "individual", b = y;
599
- function H(u) {
600
- B = u, h.style.borderBottom = "none", c.style.borderBottom = "none";
599
+ let Z = "individual", b = E;
600
+ function A(w) {
601
+ Z = w, h.style.borderBottom = "none", c.style.borderBottom = "none";
601
602
  const V = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold";
602
- u === "individual" ? (h.className = `${V} wgt:text-strong-950`, h.style.borderBottom = "2px solid var(--primary)", c.className = `${V} wgt:text-soft-400`, v.innerHTML = "", v.appendChild(y.container), b = y) : (c.className = `${V} wgt:text-strong-950`, c.style.borderBottom = "2px solid var(--primary)", h.className = `${V} wgt:text-soft-400`, v.innerHTML = "", v.appendChild(M.container), b = M);
603
+ w === "individual" ? (h.className = `${V} wgt:text-strong-950`, h.style.borderBottom = "2px solid var(--primary)", c.className = `${V} wgt:text-soft-400`, v.innerHTML = "", v.appendChild(E.container), b = E) : (c.className = `${V} wgt:text-strong-950`, c.style.borderBottom = "2px solid var(--primary)", h.className = `${V} wgt:text-soft-400`, v.innerHTML = "", v.appendChild(H.container), b = H);
603
604
  }
604
- h.addEventListener("click", () => H("individual")), c.addEventListener("click", () => H("business")), H("individual");
605
+ h.addEventListener("click", () => A("individual")), c.addEventListener("click", () => A("business")), A("individual");
605
606
  const _ = document.createElement("p");
606
- _.className = "wgt:mt-2 wgt:text-xs wgt:text-[#FF8447] wgt:text-left wgt:justify-center", _.textContent = r("invoiceform_note"), a.appendChild(_);
607
+ _.className = "wgt:mt-2 wgt:text-xs wgt:text-[#FF8447] wgt:text-left wgt:justify-center", _.textContent = n("invoiceform_note"), a.appendChild(_);
607
608
  const m = document.createElement("div");
608
609
  m.className = "wgt:mt-6 wgt:w-full wgt:flex wgt:justify-center wgt:items-center";
609
610
  const T = G({
610
611
  type: "button",
611
- title: r("btn_preview"),
612
+ title: n("btn_preview"),
612
613
  className: "wgt:min-w-[163px] wgt:text-white",
613
614
  handleClick: () => {
614
615
  if (!b.validate())
615
616
  return;
616
- const u = {
617
- type: B,
617
+ const w = {
618
+ type: Z,
618
619
  data: b.getValues()
619
- }, { overlay: V } = ge({
620
- type: u.type,
621
- data: u.data,
622
- orderInfo: i,
620
+ }, { overlay: V } = me({
621
+ type: w.type,
622
+ data: w.data,
623
+ orderInfo: r,
623
624
  theme: e,
624
625
  onClose: () => {
625
626
  console.log("Popup closed");
626
627
  },
627
- onConfirm: () => R(null, null, function* () {
628
- var Z, S, q;
628
+ onConfirm: () => j(null, null, function* () {
629
+ var S, B, q;
629
630
  V.remove(), p();
630
631
  try {
631
- if (typeof n != "function") return;
632
- const C = yield n({
633
- type: u.type,
634
- data: u.data
635
- }), L = (q = (S = (Z = C == null ? void 0 : C.finalData) != null ? Z : C == null ? void 0 : C.data) != null ? S : C) != null ? q : {}, f = String((L == null ? void 0 : L.status) || "").trim().toLowerCase();
632
+ if (typeof i != "function") return;
633
+ const C = yield i({
634
+ type: w.type,
635
+ data: w.data
636
+ }), L = (q = (B = (S = C == null ? void 0 : C.finalData) != null ? S : C == null ? void 0 : C.data) != null ? B : C) != null ? q : {}, f = String((L == null ? void 0 : L.status) || "").trim().toLowerCase();
636
637
  if (N(), f === "invoiced") {
637
638
  J({
638
- message: r("invoice_success"),
639
- description: r("invoice_description"),
639
+ message: n("invoice_success"),
640
+ description: n("invoice_description"),
640
641
  // okLabel: t('close'),
641
642
  isSuccess: !0,
642
643
  hideOkButton: !0,
@@ -647,8 +648,8 @@ function me({
647
648
  }
648
649
  if (f === "failed") {
649
650
  J({
650
- message: r("invoice_failed"),
651
- description: r("invoice_description_failed"),
651
+ message: n("invoice_failed"),
652
+ description: n("invoice_description_failed"),
652
653
  // okLabel: t('close'),
653
654
  isSuccess: !1,
654
655
  hideOkButton: !0,
@@ -659,8 +660,8 @@ function me({
659
660
  }
660
661
  } catch (C) {
661
662
  N(), J({
662
- message: r("invoice_failed"),
663
- description: r("invoice_description_failed"),
663
+ message: n("invoice_failed"),
664
+ description: n("invoice_description_failed"),
664
665
  // okLabel: t('close'),
665
666
  isSuccess: !1,
666
667
  hideOkButton: !0,
@@ -675,32 +676,32 @@ function me({
675
676
  });
676
677
  return m.appendChild(T), a.appendChild(m), { container: s };
677
678
  }
678
- function we({ theme: i, onClose: t } = {}) {
679
+ function we({ theme: r, onClose: t } = {}) {
679
680
  const e = document.createElement("div");
680
- e.className = " wgt:flex wgt:h-screen wgt:bg-[#F3F4F6] wgt:p-4", i && e.setAttribute("data-theme", i);
681
- const n = document.createElement("div");
682
- n.className = "wgt:w-full wgt:max-w-md wgt:max-h-[208px] wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:p-8 wgt:text-center";
683
- const o = document.createElement("div");
684
- o.className = "wgt:flex wgt:justify-center wgt:mb-4";
681
+ e.className = " wgt:flex wgt:h-screen wgt:bg-[#F3F4F6] wgt:p-4", r && e.setAttribute("data-theme", r);
682
+ const i = document.createElement("div");
683
+ i.className = "wgt:w-full wgt:max-w-md wgt:max-h-[208px] wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:p-8 wgt:text-center";
684
+ const d = document.createElement("div");
685
+ d.className = "wgt:flex wgt:justify-center wgt:mb-4";
685
686
  const s = document.createElement("div");
686
687
  s.className = "wgt:w-12 wgt:h-12 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center", s.style.backgroundColor = "#335CFF", s.innerHTML = `
687
688
  <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
688
689
  <path d="M20.7996 22.75H5.19961C4.94102 22.75 4.69303 22.6473 4.51018 22.4644C4.32733 22.2816 4.22461 22.0336 4.22461 21.775V4.225C4.22461 3.96641 4.32733 3.71842 4.51018 3.53557C4.69303 3.35272 4.94102 3.25 5.19961 3.25H20.7996C21.0582 3.25 21.3062 3.35272 21.489 3.53557C21.6719 3.71842 21.7746 3.96641 21.7746 4.225V21.775C21.7746 22.0336 21.6719 22.2816 21.489 22.4644C21.3062 22.6473 21.0582 22.75 20.7996 22.75ZM9.09961 10.075V12.025H16.8996V10.075H9.09961ZM9.09961 13.975V15.925H16.8996V13.975H9.09961Z" fill="white"/>
689
690
  </svg>
690
691
 
691
- `, o.appendChild(s), n.appendChild(o);
692
+ `, d.appendChild(s), i.appendChild(d);
692
693
  const a = document.createElement("h2");
693
- a.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", a.textContent = r("invoiceCheckout_title"), n.appendChild(a);
694
+ a.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", a.textContent = n("invoiceCheckout_title"), i.appendChild(a);
694
695
  const g = document.createElement("p");
695
- return g.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed", g.textContent = r("invoiceCheckout_description"), n.appendChild(g), e.appendChild(n), { container: e };
696
+ return g.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed", g.textContent = n("invoiceCheckout_description"), i.appendChild(g), e.appendChild(i), { container: e };
696
697
  }
697
- function ue({ theme: i, onClose: t } = {}) {
698
+ function Ce({ theme: r, onClose: t } = {}) {
698
699
  const e = document.createElement("div");
699
- e.className = "wgt:min-h-screen wgt:flex wgt:bg-[#F3F4F6] wgt:p-4", i && e.setAttribute("data-theme", i);
700
- const n = document.createElement("div");
701
- n.className = "wgt:w-full wgt:max-w-md wgt:max-h-[252px] wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:px-4 wgt:py-5 wgt:text-center";
702
- const o = document.createElement("div");
703
- o.className = "wgt:flex wgt:justify-center wgt:mb-2";
700
+ e.className = "wgt:min-h-screen wgt:flex wgt:bg-[#F3F4F6] wgt:p-4", r && e.setAttribute("data-theme", r);
701
+ const i = document.createElement("div");
702
+ i.className = "wgt:w-full wgt:max-w-md wgt:max-h-[252px] wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:px-4 wgt:py-5 wgt:text-center";
703
+ const d = document.createElement("div");
704
+ d.className = "wgt:flex wgt:justify-center wgt:mb-2";
704
705
  const s = document.createElement("div");
705
706
  s.innerHTML = `
706
707
  <svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -720,163 +721,135 @@ function ue({ theme: i, onClose: t } = {}) {
720
721
  <path fill-rule="evenodd" clip-rule="evenodd" d="M38.7788 33.9142C39.4439 33.9142 39.9696 34.4369 39.9696 35.1051C39.9696 35.7748 39.4447 36.2959 38.7788 36.2959C38.1144 36.2959 37.5879 35.7748 37.5879 35.1051C37.5879 34.4361 38.1144 33.9142 38.7788 33.9142ZM44.1494 28.6799C43.9468 28.6837 43.7479 28.7675 43.6039 28.9146L39.9376 32.59C39.5826 32.4232 39.1925 32.3234 38.7788 32.3234C37.2542 32.3234 36.0039 33.5813 36.0039 35.1051C36.0039 36.6296 37.2542 37.8891 38.7788 37.8891C40.3033 37.8891 41.5544 36.6296 41.5544 35.1051C41.5544 34.5679 41.3944 34.0712 41.1285 33.6445L44.727 30.0376C45.2367 29.5317 44.8702 28.6632 44.1494 28.6799Z" fill="#808080"/>
721
722
  </svg>
722
723
 
723
- `, o.appendChild(s), n.appendChild(o);
724
+ `, d.appendChild(s), i.appendChild(d);
724
725
  const a = document.createElement("h2");
725
- a.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", a.textContent = r("invoiceExpired_title"), n.appendChild(a);
726
+ a.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", a.textContent = n("invoiceExpired_title"), i.appendChild(a);
726
727
  const g = document.createElement("p");
727
- g.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed wgt:px-2 wgt:mb-3", g.textContent = r("invoiceExpired_description"), n.appendChild(g);
728
+ g.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed wgt:px-2 wgt:mb-3", g.textContent = n("invoiceExpired_description"), i.appendChild(g);
728
729
  const p = document.createElement("p");
729
- return p.className = "wgt:text-sm wgt:text-[#99A0AE] wgt:italic wgt:leading-relaxed wgt:px-4", p.textContent = r("invoiceExpired_note"), n.appendChild(p), e.appendChild(n), { container: e };
730
+ return p.className = "wgt:text-sm wgt:text-[#99A0AE] wgt:italic wgt:leading-relaxed wgt:px-4", p.textContent = n("invoiceExpired_note"), i.appendChild(p), e.appendChild(i), { container: e };
730
731
  }
731
- function Ce({ theme: i, onClose: t } = {}) {
732
- const e = document.createElement("div");
733
- e.className = "wgt:min-h-screen wgt:flex wgt:items-center wgt:bg-[#F3F4F6] wgt:p-4 wgt:justify-center", i && e.setAttribute("data-theme", i);
734
- const n = document.createElement("div");
735
- n.className = "wgt:w-full wgt:items-center wgt:flex wgt:flex-col wgt:min-h-screen wgt:justify-center wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:px-4 wgt:py-5 wgt:text-center";
736
- const o = document.createElement("div");
737
- o.className = "wgt:flex wgt:justify-center wgt:mb-2 wgt:items-center wgt:justify-center";
738
- const s = document.createElement("div");
739
- s.innerHTML = `
740
- <svg width="148" height="148" viewBox="0 0 148 148" fill="none" xmlns="http://www.w3.org/2000/svg">
741
- <path d="M135.244 83.385C135.244 100.471 128.265 115.873 117.075 126.943C106.125 137.892 90.9645 144.51 74.2393 144.51C57.6344 144.51 42.4734 137.772 31.4035 126.943C20.2132 115.873 13.2344 100.471 13.2344 83.385C13.2344 49.5736 40.5482 22.2598 74.2393 22.2598C107.93 22.2598 135.244 49.6939 135.244 83.385Z" fill="#F1F3FA" stroke="#D5DAE5" stroke-width="1.58571" stroke-miterlimit="10"/>
742
- <path d="M65.7815 28.5312L61.2562 44.4926L72.0884 51.9999L71.3267 70.3394L84.999 45.2472L78.6484 40.1734L85.9114 28.5312H94.065L118.732 55.3638L119.694 132.853C119.694 135.5 117.528 137.546 114.881 137.546H39.317C36.6697 137.546 34.5039 135.38 34.5039 132.853V33.224C34.5039 30.5768 36.6697 28.5312 39.317 28.5312H65.7815Z" fill="white" stroke="#D5DAE5" stroke-width="1.58571" stroke-miterlimit="10" stroke-linejoin="round"/>
743
- <path d="M60.7974 44.7749H46.2381C45.3958 44.7749 44.6738 44.053 44.6738 43.2107C44.6738 42.3684 45.3958 41.6465 46.2381 41.6465H60.7974C61.6397 41.6465 62.3616 42.3684 62.3616 43.2107C62.3616 44.053 61.6397 44.7749 60.7974 44.7749Z" fill="#D5DAE5"/>
744
- <path d="M60.1958 53.437H46.2381C45.3958 53.437 44.6738 52.7151 44.6738 51.8728C44.6738 51.0305 45.3958 50.3086 46.2381 50.3086H60.0755C60.9177 50.3086 61.6397 51.0305 61.6397 51.8728C61.6397 52.7151 60.9177 53.437 60.1958 53.437Z" fill="#D5DAE5"/>
745
- <path d="M93.0469 28.5312V49.9491C93.0469 52.9573 95.694 55.3638 98.7022 55.3638H117.714" fill="#D5DAE5"/>
746
- <path d="M61.7026 21.3768L57.1523 14.5273" stroke="#AAB2C5" stroke-width="1.58571"/>
747
- <path d="M73.8365 17.9519L74.3711 0.601562" stroke="#AAB2C5" stroke-width="1.58571"/>
748
- <path d="M84.7168 21.5372L91.9805 5.77148" stroke="#AAB2C5" stroke-width="1.58571"/>
749
- <path d="M60.0089 108.149C59.5035 108.149 59.0991 107.947 58.6948 107.644C57.9872 106.936 57.9872 105.723 58.6948 105.016C63.3449 100.467 69.5112 97.9395 76.082 97.9395C82.6528 97.9395 88.8192 100.467 93.4692 105.016C94.1769 105.723 94.1769 106.936 93.4692 107.644C92.7616 108.352 91.5486 108.352 90.8409 107.644C86.8985 103.701 81.6419 101.579 76.082 101.579C70.5221 101.579 65.2655 103.701 61.3231 107.644C60.9187 107.947 60.5144 108.149 60.0089 108.149Z" fill="#AAB2C5"/>
750
- <path d="M66.3775 81.0578L68.8036 78.6317C69.5113 77.9241 69.5113 76.711 68.8036 76.0034C68.096 75.2958 66.883 75.2958 66.1753 76.0034L63.7492 78.4295L61.3231 76.0034C60.6155 75.2958 59.4024 75.2958 58.6948 76.0034C57.9872 76.711 57.9872 77.9241 58.6948 78.6317L61.1209 81.0578L58.6948 83.4839C57.9872 84.1915 57.9872 85.4046 58.6948 86.1122C59.0991 86.5166 59.5035 86.6177 60.0089 86.6177C60.5144 86.6177 60.9187 86.4155 61.3231 86.1122L63.7492 83.6861L66.1753 86.1122C66.5797 86.5166 66.984 86.6177 67.4895 86.6177C67.9949 86.6177 68.3993 86.4155 68.8036 86.1122C69.5113 85.4046 69.5113 84.1915 68.8036 83.4839L66.3775 81.0578Z" fill="#AAB2C5"/>
751
- <path d="M90.942 81.0578L93.3681 78.6317C94.0757 77.9241 94.0757 76.711 93.3681 76.0034C92.6605 75.2958 91.4474 75.2958 90.7398 76.0034L88.3137 78.4295L85.8875 76.0034C85.1799 75.2958 83.9669 75.2958 83.2592 76.0034C82.5516 76.711 82.5516 77.9241 83.2592 78.6317L85.6853 81.0578L83.2592 83.4839C82.5516 84.1915 82.5516 85.4046 83.2592 86.1122C83.6636 86.5166 84.0679 86.6177 84.5734 86.6177C85.0788 86.6177 85.4832 86.4155 85.8875 86.1122L88.3137 83.6861L90.7398 86.1122C91.1441 86.5166 91.5485 86.6177 92.0539 86.6177C92.5594 86.6177 92.9637 86.4155 93.3681 86.1122C94.0757 85.4046 94.0757 84.1915 93.3681 83.4839L90.942 81.0578Z" fill="#AAB2C5"/>
752
- </svg>
753
-
754
-
755
- `, o.appendChild(s), n.appendChild(o);
756
- const a = document.createElement("h2");
757
- return a.className = "wgt:text-base wgt:font-medium wgt:text-[#99A0AE] wgt:mb-2", a.textContent = r("order_not_found_title"), n.appendChild(a), e.appendChild(n), { container: e };
732
+ function ie(r) {
733
+ return String(r || "").trim().toLowerCase();
758
734
  }
759
- function re(i) {
760
- return String(i || "").trim().toLowerCase();
761
- }
762
- function Ne({ uuid: i, orderInfo: t, theme: e }) {
763
- const n = document.createElement("div");
764
- n.className = "wgt:w-full wgt:min-h-screen";
765
- let o = !1;
766
- function s(l) {
767
- o || (n.innerHTML = "", l && n.appendChild(l));
735
+ function Ne({ uuid: r, orderInfo: t, theme: e }) {
736
+ const i = document.createElement("div");
737
+ i.className = "wgt:w-full wgt:min-h-screen";
738
+ let d = !1;
739
+ function s(o) {
740
+ d || (i.innerHTML = "", o && i.appendChild(o));
768
741
  }
769
- function a(l) {
770
- l && console.log("[DEBUG] renderFailedPage:", l);
771
- const w = Ce({
742
+ function a(o) {
743
+ o && console.log("[DEBUG] renderFailedPage:", o);
744
+ const u = ce({
772
745
  theme: e,
773
746
  onClose: F
774
747
  });
775
- s(w.container);
748
+ s(u.container);
776
749
  }
777
750
  function g() {
778
- const l = ue({
751
+ const o = Ce({
779
752
  theme: e
780
753
  });
781
- s(l.container);
754
+ s(o.container);
782
755
  }
783
- function p(l) {
784
- const w = we({
756
+ function p(o) {
757
+ const u = we({
785
758
  theme: e
786
759
  });
787
- s(w.container);
760
+ s(u.container);
788
761
  }
789
- function N(l) {
790
- const w = me({
791
- orderInfo: l || {},
762
+ function N(o) {
763
+ const u = ue({
764
+ orderInfo: o || {},
792
765
  theme: e,
793
- onSubmit: (v) => R(null, [v], function* ({ type: h, data: c }) {
794
- const y = A();
795
- if (!y)
766
+ onSubmit: (v) => j(null, [v], function* ({ type: h, data: c }) {
767
+ const E = k();
768
+ if (!E)
796
769
  return a({ reason: "MISSING_UUID_ON_SUBMIT" }), { ok: !1 };
797
- const M = fe(h, c);
798
- return yield de(y, M), { ok: !0, finalData: yield ve(y, {
770
+ const H = fe(h, c);
771
+ return yield le(E, H), { ok: !0, finalData: yield ve(E, {
799
772
  maxTries: 20,
800
773
  intervalMs: 1500
801
774
  }) };
802
775
  }),
803
776
  onBack: F
804
777
  });
805
- s(w.container);
778
+ s(u.container);
806
779
  }
807
- function A() {
780
+ function k() {
808
781
  var h;
809
- const l = new URLSearchParams(window.location.search || "");
810
- return String((h = l.get("uuid")) != null ? h : "").trim() || String(i || "").trim() || String((t == null ? void 0 : t.uuid) || "").trim();
782
+ const o = new URLSearchParams(window.location.search || "");
783
+ return String((h = o.get("uuid")) != null ? h : "").trim() || String(r || "").trim() || String((t == null ? void 0 : t.uuid) || "").trim();
811
784
  }
812
785
  function F() {
813
- return R(this, null, function* () {
814
- yield k();
786
+ return j(this, null, function* () {
787
+ yield M();
815
788
  });
816
789
  }
817
- function k() {
818
- return R(this, null, function* () {
790
+ function M() {
791
+ return j(this, null, function* () {
819
792
  try {
820
- const l = A();
821
- if (!l)
793
+ const o = k();
794
+ if (!o)
822
795
  return a({ reason: "EMPTY_UUID_NO_API_CALL" });
823
- const w = yield ne(l), h = String((w == null ? void 0 : w.message) || "").trim();
796
+ const u = yield ne(o), h = String((u == null ? void 0 : u.message) || "").trim();
824
797
  if (h)
825
- return a({ reason: "API_MESSAGE", apiMsg: h, res: w });
826
- const c = re(w == null ? void 0 : w.status);
827
- return c === "expired" ? g() : c === "invoiced" ? p(w) : c === "pending" || c === "waiting" ? N(w || t || {}) : c === "" && w && Object.keys(w).length > 0 ? N(w) : a({ reason: "UNKNOWN_STATUS", status: c, res: w });
828
- } catch (l) {
829
- return console.log("[DEBUG] loadAndRender error:", l), a({ reason: "EXCEPTION", error: (l == null ? void 0 : l.message) || l });
798
+ return a({ reason: "API_MESSAGE", apiMsg: h, res: u });
799
+ const c = ie(u == null ? void 0 : u.status);
800
+ return c === "expired" ? g() : c === "invoiced" ? p(u) : c === "pending" || c === "waiting" ? N(u || t || {}) : c === "" && u && Object.keys(u).length > 0 ? N(u) : a({ reason: "UNKNOWN_STATUS", status: c, res: u });
801
+ } catch (o) {
802
+ return console.log("[DEBUG] loadAndRender error:", o), a({ reason: "EXCEPTION", error: (o == null ? void 0 : o.message) || o });
830
803
  }
831
804
  });
832
805
  }
833
- function d() {
834
- return R(this, null, function* () {
806
+ function l() {
807
+ return j(this, null, function* () {
835
808
  a({ reason: "INIT_DEFAULT_RENDER" });
836
809
  try {
837
- yield k();
838
- } catch (l) {
810
+ yield M();
811
+ } catch (o) {
839
812
  return a({
840
813
  reason: "INIT_EXCEPTION",
841
- error: (l == null ? void 0 : l.message) || l
814
+ error: (o == null ? void 0 : o.message) || o
842
815
  });
843
816
  }
844
817
  });
845
818
  }
846
819
  function x() {
847
- o = !0, n.innerHTML = "";
820
+ d = !0, i.innerHTML = "";
848
821
  }
849
- return { container: n, init: d, destroy: x };
822
+ return { container: i, init: l, destroy: x };
850
823
  }
851
- function he(i) {
852
- return String(i || "").trim().toLowerCase() === "business" ? "enterprise" : "individual";
824
+ function he(r) {
825
+ return String(r || "").trim().toLowerCase() === "business" ? "enterprise" : "individual";
853
826
  }
854
- function fe(i, t) {
855
- const e = he(i), n = {
827
+ function fe(r, t) {
828
+ const e = he(r), i = {
856
829
  invoiceType: e,
857
830
  buyerName: (t == null ? void 0 : t.representativeName) || "",
858
831
  address: (t == null ? void 0 : t.buyerAddress) || "",
859
832
  email: (t == null ? void 0 : t.email) || ""
860
833
  };
861
- return e === "enterprise" && (n.taxCode = t != null && t.noTaxCode ? "" : (t == null ? void 0 : t.taxCode) || "", n.performerName = (t == null ? void 0 : t.performerName) || ""), n;
834
+ return e === "enterprise" && (i.taxCode = t != null && t.noTaxCode ? "" : (t == null ? void 0 : t.taxCode) || "", i.businessName = (t == null ? void 0 : t.businessName) || ""), i;
862
835
  }
863
- function ve(n) {
864
- return R(this, arguments, function* (i, { maxTries: t = 20, intervalMs: e = 1500 } = {}) {
836
+ function ve(i) {
837
+ return j(this, arguments, function* (r, { maxTries: t = 20, intervalMs: e = 1500 } = {}) {
865
838
  for (let s = 0; s < t; s++) {
866
839
  yield xe(e);
867
- const a = yield ne(i), g = re(a == null ? void 0 : a.status);
840
+ const a = yield ne(r), g = ie(a == null ? void 0 : a.status);
868
841
  if (g === "invoiced") return a;
869
842
  if (g === "expired") {
870
843
  const p = new Error("Invoice request expired while polling");
871
844
  throw p.code = "EXPIRED", p.data = a, p;
872
845
  }
873
846
  }
874
- const o = new Error("Polling timeout: status not invoiced");
875
- throw o.code = "POLL_TIMEOUT", o;
847
+ const d = new Error("Polling timeout: status not invoiced");
848
+ throw d.code = "POLL_TIMEOUT", d;
876
849
  });
877
850
  }
878
- function xe(i) {
879
- return new Promise((t) => setTimeout(t, i));
851
+ function xe(r) {
852
+ return new Promise((t) => setTimeout(t, r));
880
853
  }
881
854
  export {
882
855
  Ne as createInvoiceRequestFlow