@invoice-sdk/widget 1.115.6 → 1.116.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-BInljDkt.js → index-Ba_b4M50.js} +3 -3
- package/dist/{index-B3BxLLGz.js → index-DfRo2uNU.js} +329 -323
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +58 -58
- package/dist/loading-BHrUW4gA.js +237 -0
- package/dist/{widget-Bg4h17Ae.js → widget-DVCT2ZIV.js} +188 -208
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/dist/invoice-QZ5cgmMz.js +0 -220
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
var n = (e, t, r) => new Promise((i, c) => {
|
|
2
|
+
var s = (o) => {
|
|
3
|
+
try {
|
|
4
|
+
g(r.next(o));
|
|
5
|
+
} catch (p) {
|
|
6
|
+
c(p);
|
|
7
|
+
}
|
|
8
|
+
}, d = (o) => {
|
|
9
|
+
try {
|
|
10
|
+
g(r.throw(o));
|
|
11
|
+
} catch (p) {
|
|
12
|
+
c(p);
|
|
13
|
+
}
|
|
14
|
+
}, g = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(s, d);
|
|
15
|
+
g((r = r.apply(e, t)).next());
|
|
16
|
+
});
|
|
17
|
+
import { j as l, g as w, k as f, C as m, G as y, l as E, I as R, S as v, n as C, a as h, o as I, p as u, q as T, O as b } from "./index-Ba_b4M50.js";
|
|
18
|
+
function _({
|
|
19
|
+
title: e,
|
|
20
|
+
isDisabled: t = !1,
|
|
21
|
+
handleClick: r = null,
|
|
22
|
+
type: i = "button",
|
|
23
|
+
className: c = ""
|
|
24
|
+
} = {}) {
|
|
25
|
+
const s = document.createElement("button");
|
|
26
|
+
return s.type = i, s.disabled = t, s.className = [
|
|
27
|
+
"wgt:bg-primary",
|
|
28
|
+
"wgt:hover:bg-primary-dark",
|
|
29
|
+
"wgt:px-6",
|
|
30
|
+
"wgt:py-2",
|
|
31
|
+
"wgt:rounded-lg",
|
|
32
|
+
"wgt:disabled:opacity-50",
|
|
33
|
+
"wgt:disabled:cursor-not-allowed",
|
|
34
|
+
"wgt:cursor-pointer",
|
|
35
|
+
"wgt:hover:text-primary-hover-text",
|
|
36
|
+
c
|
|
37
|
+
].filter(Boolean).join(" "), s.innerText = e, typeof r == "function" && s.addEventListener("click", (d) => n(null, null, function* () {
|
|
38
|
+
if (!s.disabled) {
|
|
39
|
+
s.disabled = !0;
|
|
40
|
+
try {
|
|
41
|
+
yield r(d);
|
|
42
|
+
} catch (g) {
|
|
43
|
+
console.error("Button click handler error:", g);
|
|
44
|
+
} finally {
|
|
45
|
+
s.disabled = !1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
})), s;
|
|
49
|
+
}
|
|
50
|
+
const a = l.create({
|
|
51
|
+
headers: {
|
|
52
|
+
Accept: "application/json"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
a.interceptors.request.use(
|
|
56
|
+
function(e) {
|
|
57
|
+
return e.baseURL = w().invoiceHubBaseUrl, e;
|
|
58
|
+
},
|
|
59
|
+
function(e) {
|
|
60
|
+
return Promise.reject(e);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
f(a, {});
|
|
64
|
+
function k(e) {
|
|
65
|
+
return n(this, null, function* () {
|
|
66
|
+
if (!e)
|
|
67
|
+
throw new Error("Tax code is required to fetch tax information.");
|
|
68
|
+
return yield a.get(E, {
|
|
69
|
+
params: {
|
|
70
|
+
tax: e
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function x(e, t, r) {
|
|
76
|
+
return n(this, null, function* () {
|
|
77
|
+
if (!t)
|
|
78
|
+
throw new Error("Tax code is required to check new customer.");
|
|
79
|
+
return (yield a.get(m, {
|
|
80
|
+
params: {
|
|
81
|
+
provider: e,
|
|
82
|
+
taxCode: t,
|
|
83
|
+
invoiceType: r
|
|
84
|
+
}
|
|
85
|
+
})).data;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function $(e, t) {
|
|
89
|
+
return n(this, null, function* () {
|
|
90
|
+
return (yield a.get(y, {
|
|
91
|
+
params: {
|
|
92
|
+
provider: e,
|
|
93
|
+
taxCode: t
|
|
94
|
+
}
|
|
95
|
+
})).data;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const A = (e) => new Intl.NumberFormat("vi-VN").format(e), O = "1.116.0";
|
|
99
|
+
function U(r) {
|
|
100
|
+
return n(this, arguments, function* ({ search: e, bank: t }) {
|
|
101
|
+
return (yield a.get(`${u}`, {
|
|
102
|
+
params: {
|
|
103
|
+
isActive: !0,
|
|
104
|
+
search: e || null,
|
|
105
|
+
type: "service",
|
|
106
|
+
bank: t
|
|
107
|
+
}
|
|
108
|
+
})).data;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function M(t) {
|
|
112
|
+
return n(this, arguments, function* ({ bank: e }) {
|
|
113
|
+
return (yield a.get(`${u}`, {
|
|
114
|
+
params: {
|
|
115
|
+
isActive: !0,
|
|
116
|
+
type: "initial_fee",
|
|
117
|
+
bank: e
|
|
118
|
+
}
|
|
119
|
+
})).data;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function j(i) {
|
|
123
|
+
return n(this, arguments, function* ({ bank: e, hasRenew: t, isCashRegister: r }) {
|
|
124
|
+
return (yield a.get(`${u}`, {
|
|
125
|
+
params: {
|
|
126
|
+
isActive: !0,
|
|
127
|
+
type: "service",
|
|
128
|
+
bank: e,
|
|
129
|
+
hasRenew: t,
|
|
130
|
+
limit: 99,
|
|
131
|
+
isCashRegister: r
|
|
132
|
+
}
|
|
133
|
+
})).data;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function q(t) {
|
|
137
|
+
return n(this, arguments, function* ({ bank: e }) {
|
|
138
|
+
return (yield a.get(`${u}`, {
|
|
139
|
+
params: {
|
|
140
|
+
isActive: !0,
|
|
141
|
+
type: "signature",
|
|
142
|
+
bank: e,
|
|
143
|
+
limit: 99
|
|
144
|
+
}
|
|
145
|
+
})).data;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function F(e) {
|
|
149
|
+
return n(this, null, function* () {
|
|
150
|
+
const t = new FormData();
|
|
151
|
+
return t.append(
|
|
152
|
+
"eInvoiceRegistration",
|
|
153
|
+
JSON.stringify(e.eInvoiceRegistration)
|
|
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
|
+
"organizationRegistrationCert",
|
|
156
|
+
e.organizationRegistrationCert
|
|
157
|
+
), e.legalRepresentativeIdCard.forEach((i) => {
|
|
158
|
+
t.append("legalRepresentativeIdCard", i);
|
|
159
|
+
}), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), yield a.post(C, t, {
|
|
160
|
+
headers: {
|
|
161
|
+
"Content-Type": "multipart/form-data",
|
|
162
|
+
"X-Invoice-Widget-Mode": h(),
|
|
163
|
+
"X-Invoice-Widget-Version": O
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function G(e) {
|
|
169
|
+
return n(this, null, function* () {
|
|
170
|
+
return yield a.get(`${b}/${e}/status`);
|
|
171
|
+
});
|
|
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;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function W(e) {
|
|
181
|
+
return n(this, null, function* () {
|
|
182
|
+
return yield a.post(`${T}/${e}`);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function D(e) {
|
|
186
|
+
return n(this, null, function* () {
|
|
187
|
+
return yield a.get(
|
|
188
|
+
`${R}/${encodeURIComponent(e)}`
|
|
189
|
+
);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function L(e, t) {
|
|
193
|
+
return n(this, null, function* () {
|
|
194
|
+
try {
|
|
195
|
+
return yield a.post(
|
|
196
|
+
`${v}/${encodeURIComponent(e)}`,
|
|
197
|
+
t
|
|
198
|
+
);
|
|
199
|
+
} catch (r) {
|
|
200
|
+
throw r;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
function V() {
|
|
205
|
+
const e = document.createElement("div");
|
|
206
|
+
e.className = "wgt:absolute wgt:inset-0 wgt:bg-white/80 wgt:items-center wgt:justify-center wgt:z-50 wgt:w-full wgt:h-full wgt:backdrop-blur-sm", e.style.display = "none";
|
|
207
|
+
const t = document.createElement("div");
|
|
208
|
+
t.className = "wgt:flex wgt:flex-col wgt:items-center wgt:gap-4 wgt:bg-white wgt:rounded-lg wgt:p-6 wgt:shadow-lg";
|
|
209
|
+
const r = document.createElement("div");
|
|
210
|
+
return r.className = "wgt:h-12 wgt:w-12 wgt:animate-spin wgt:rounded-full wgt:border-4 wgt:border-solid wgt:border-primary wgt:border-t-transparent", t.appendChild(r), e.appendChild(t), {
|
|
211
|
+
container: e,
|
|
212
|
+
open: () => {
|
|
213
|
+
e.style.display = "flex";
|
|
214
|
+
},
|
|
215
|
+
close: () => {
|
|
216
|
+
e.style.display = "none";
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
export {
|
|
221
|
+
x as a,
|
|
222
|
+
k as b,
|
|
223
|
+
_ as c,
|
|
224
|
+
U as d,
|
|
225
|
+
V as e,
|
|
226
|
+
A as f,
|
|
227
|
+
$ as g,
|
|
228
|
+
F as h,
|
|
229
|
+
B as i,
|
|
230
|
+
M as j,
|
|
231
|
+
j as k,
|
|
232
|
+
q as l,
|
|
233
|
+
W as m,
|
|
234
|
+
G as n,
|
|
235
|
+
D as o,
|
|
236
|
+
L as s
|
|
237
|
+
};
|