@invoice-sdk/widget 1.118.5 → 1.120.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.
@@ -1,29 +1,29 @@
1
- var n = (e, t, r) => new Promise((i, c) => {
2
- var s = (o) => {
1
+ var n = (e, t, r) => new Promise((o, c) => {
2
+ var s = (i) => {
3
3
  try {
4
- g(r.next(o));
5
- } catch (p) {
6
- c(p);
4
+ g(r.next(i));
5
+ } catch (u) {
6
+ c(u);
7
7
  }
8
- }, d = (o) => {
8
+ }, d = (i) => {
9
9
  try {
10
- g(r.throw(o));
11
- } catch (p) {
12
- c(p);
10
+ g(r.throw(i));
11
+ } catch (u) {
12
+ c(u);
13
13
  }
14
- }, g = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(s, d);
14
+ }, g = (i) => i.done ? o(i.value) : Promise.resolve(i.value).then(s, d);
15
15
  g((r = r.apply(e, t)).next());
16
16
  });
17
- import { k as l, g as w, l as f, C as m, G as y, n as E, I as R, S as v, o as C, a as h, p as I, q as u, r as T, O as b } from "./index-BceUiawR.js";
18
- function _({
17
+ import { k as l, g as w, l as f, C as m, G as y, n as E, I as R, S as v, o as C, a as h, p as I, q as p, r as O, O as T } from "./index-Dwm5GXG-.js";
18
+ function k({
19
19
  title: e,
20
20
  isDisabled: t = !1,
21
21
  handleClick: r = null,
22
- type: i = "button",
22
+ type: o = "button",
23
23
  className: c = ""
24
24
  } = {}) {
25
25
  const s = document.createElement("button");
26
- return s.type = i, s.disabled = t, s.className = [
26
+ return s.type = o, s.disabled = t, s.className = [
27
27
  "wgt:bg-primary",
28
28
  "wgt:hover:bg-primary-dark",
29
29
  "wgt:px-6",
@@ -61,7 +61,7 @@ a.interceptors.request.use(
61
61
  }
62
62
  );
63
63
  f(a, {});
64
- function k(e) {
64
+ function x(e) {
65
65
  return n(this, null, function* () {
66
66
  if (!e)
67
67
  throw new Error("Tax code is required to fetch tax information.");
@@ -72,7 +72,7 @@ function k(e) {
72
72
  });
73
73
  });
74
74
  }
75
- function x(e, t, r) {
75
+ function N(e, t, r) {
76
76
  return n(this, null, function* () {
77
77
  if (!t)
78
78
  throw new Error("Tax code is required to check new customer.");
@@ -95,10 +95,10 @@ function $(e, t) {
95
95
  })).data;
96
96
  });
97
97
  }
98
- const A = (e) => new Intl.NumberFormat("vi-VN").format(e), O = "1.118.5";
98
+ const A = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.120.0";
99
99
  function U(r) {
100
100
  return n(this, arguments, function* ({ search: e, bank: t }) {
101
- return (yield a.get(`${u}`, {
101
+ return (yield a.get(`${p}`, {
102
102
  params: {
103
103
  isActive: !0,
104
104
  search: e || null,
@@ -110,7 +110,7 @@ function U(r) {
110
110
  }
111
111
  function M(t) {
112
112
  return n(this, arguments, function* ({ bank: e }) {
113
- return (yield a.get(`${u}`, {
113
+ return (yield a.get(`${p}`, {
114
114
  params: {
115
115
  isActive: !0,
116
116
  type: "initial_fee",
@@ -119,9 +119,9 @@ function M(t) {
119
119
  })).data;
120
120
  });
121
121
  }
122
- function q(i) {
122
+ function q(o) {
123
123
  return n(this, arguments, function* ({ bank: e, hasRenew: t, isCashRegister: r }) {
124
- return (yield a.get(`${u}`, {
124
+ return (yield a.get(`${p}`, {
125
125
  params: {
126
126
  isActive: !0,
127
127
  type: "service",
@@ -133,9 +133,9 @@ function q(i) {
133
133
  })).data;
134
134
  });
135
135
  }
136
- function F(t) {
136
+ function B(t) {
137
137
  return n(this, arguments, function* ({ bank: e }) {
138
- return (yield a.get(`${u}`, {
138
+ return (yield a.get(`${p}`, {
139
139
  params: {
140
140
  isActive: !0,
141
141
  type: "signature",
@@ -145,7 +145,7 @@ function F(t) {
145
145
  })).data;
146
146
  });
147
147
  }
148
- function G(e) {
148
+ function F(e) {
149
149
  return n(this, null, function* () {
150
150
  const t = new FormData();
151
151
  return t.append(
@@ -154,32 +154,34 @@ function G(e) {
154
154
  ), t.append("provider", e.provider), t.append("bank", e.bank), t.append("packages", JSON.stringify(e.packages)), t.append("promotionCodes", JSON.stringify(e.promotionCodes)), t.append("logo", e.logo), t.append(
155
155
  "organizationRegistrationCert",
156
156
  e.organizationRegistrationCert
157
- ), e.legalRepresentativeIdCard.forEach((i) => {
158
- t.append("legalRepresentativeIdCard", i);
157
+ ), e.legalRepresentativeIdCard.forEach((o) => {
158
+ t.append("legalRepresentativeIdCard", o);
159
159
  }), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), yield a.post(C, t, {
160
160
  headers: {
161
161
  "Content-Type": "multipart/form-data",
162
162
  "X-Invoice-Widget-Mode": h(),
163
- "X-Invoice-Widget-Version": O
163
+ "X-Invoice-Widget-Version": S
164
164
  }
165
165
  });
166
166
  });
167
167
  }
168
- function j(e) {
168
+ function G(e) {
169
169
  return n(this, null, function* () {
170
- return yield a.get(`${b}/${e}/status`);
170
+ return yield a.get(`${T}/${e}/status`);
171
171
  });
172
172
  }
173
- function B() {
174
- return n(this, arguments, function* ({ isRenewable: e } = {}) {
175
- return (yield a.get(I, {
176
- params: e === !0 ? { isRenewable: !0 } : void 0
177
- })).data;
173
+ function j() {
174
+ return n(this, arguments, function* ({ isRenewable: e, serialNumber: t } = {}) {
175
+ const r = {
176
+ isRenewable: !!e,
177
+ serialNumber: (t != null ? t : "").trim()
178
+ };
179
+ return console.log("PROMO params:", r), (yield a.get(I, { params: r })).data;
178
180
  });
179
181
  }
180
182
  function W(e) {
181
183
  return n(this, null, function* () {
182
- return yield a.post(`${T}/${e}`);
184
+ return yield a.post(`${O}/${e}`);
183
185
  });
184
186
  }
185
187
  function D(e) {
@@ -218,20 +220,20 @@ function V() {
218
220
  };
219
221
  }
220
222
  export {
221
- x as a,
222
- k as b,
223
- _ as c,
223
+ N as a,
224
+ x as b,
225
+ k as c,
224
226
  U as d,
225
227
  V as e,
226
228
  A as f,
227
229
  $ as g,
228
- G as h,
229
- B as i,
230
+ F as h,
231
+ j as i,
230
232
  M as j,
231
233
  q as k,
232
- F as l,
234
+ B as l,
233
235
  W as m,
234
- j as n,
236
+ G as n,
235
237
  D as o,
236
238
  L as s
237
239
  };
@@ -35,8 +35,8 @@ var sn = (t, n, e) => new Promise((c, h) => {
35
35
  }, o = (u) => u.done ? c(u.value) : Promise.resolve(u.value).then(a, A);
36
36
  o((e = e.apply(t, n)).next());
37
37
  });
38
- import { t as g, g as _h, a as $h, b as Pt, s as n0, c as Jt, d as Tc, e as xc, f as dc, m as wc, h as pc, i as Cc, v as fc } from "./index-BceUiawR.js";
39
- import { c as vt, a as c0, g as t0, b as Xc, f as Vn, d as Bc, e as e0, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc, n as vc } from "./loading-2ZdJld2F.js";
38
+ import { t as g, g as _h, a as $h, b as Pt, s as n0, c as Jt, d as Tc, e as xc, f as dc, m as wc, h as pc, i as Cc, v as fc } from "./index-Dwm5GXG-.js";
39
+ import { c as vt, a as c0, g as t0, b as Xc, f as Vn, d as Bc, e as e0, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc, n as vc } from "./loading-CMCk5aav.js";
40
40
  import { g as nc } from "./_commonjsHelpers-bAxELxBV.js";
41
41
  function lh({ steps: t = [], currentStep: n = 1 } = {}) {
42
42
  const e = document.createElement("div");
@@ -939,7 +939,7 @@ const Mc = ({
939
939
  }
940
940
  return [k, B, v, N].forEach(
941
941
  (L) => L.addEventListener("change", H)
942
- ), m.addEventListener("input", H), m.addEventListener("blur", H), /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(n) ? (k.value = n[0], B.value = n[1], v.value = n.slice(2, 4), N.value = n[4], m.value = n.slice(5, 7)) : (k.value = "1", B.value = "C", N.value = "T", m.value = "YY"), H(), {
942
+ ), m.addEventListener("input", H), m.addEventListener("blur", H), /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(n) ? (k.value = n[0], B.value = n[1], v.value = n.slice(2, 4), N.value = n[4], m.value = n.slice(5, 7)) : (k.value = "1", B.value = "C", N.value = "M", m.value = "YY"), H(), {
943
943
  container: i,
944
944
  getValue: P,
945
945
  setValue: (L) => {
@@ -3425,7 +3425,9 @@ function E1(B) {
3425
3425
  isRenewal: E
3426
3426
  }) {
3427
3427
  var Vt;
3428
- const X = ((Vt = x == null ? void 0 : x.eInvoiceRegistration) == null ? void 0 : Vt.invoiceSymbol) || "", C = (X == null ? void 0 : X[4]) === "M";
3428
+ const X = ((Vt = x == null ? void 0 : x.eInvoiceRegistration) == null ? void 0 : Vt.invoiceSymbol) || "";
3429
+ console.log("Invoice Symbol", X);
3430
+ const C = (X == null ? void 0 : X[4]) === "M";
3429
3431
  let y = [];
3430
3432
  function v(G, U) {
3431
3433
  return Array.isArray(G) ? U === "household" ? G.filter((j) => {
@@ -3657,7 +3659,10 @@ function E1(B) {
3657
3659
  an,
3658
3660
  $
3659
3661
  ] = yield Promise.allSettled([
3660
- Ec({ isRenewable: E === !0 }),
3662
+ Ec({
3663
+ isRenewable: E === !0,
3664
+ serialNumber: X
3665
+ }),
3661
3666
  Hc({ bank: r }),
3662
3667
  yc({
3663
3668
  bank: r,
@@ -7302,7 +7307,7 @@ function Na(t, n, e, c, h, a) {
7302
7307
  },
7303
7308
  theme: h || "ocb",
7304
7309
  settingUrl: (c == null ? void 0 : c.settingUrl) || "",
7305
- serial: (c == null ? void 0 : c.serial) || "1C25TYY",
7310
+ serial: (c == null ? void 0 : c.serial) || "1C26MYY",
7306
7311
  provider: x.route
7307
7312
  });
7308
7313
  s(Z);
package/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "prepare": "npm run build"
47
47
  },
48
48
  "type": "module",
49
- "version": "1.118.5",
49
+ "version": "1.120.0",
50
50
  "repository": {},
51
51
  "dependencies": {
52
52
  "@invoice-sdk/id_extraction_qr": "^1.8.3",