@invoice-sdk/widget 1.119.0 → 1.120.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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-DenpejIA.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-DveBzjNY.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.119.0";
98
+ const A = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.120.1";
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
  };