@sri-xml-viewer/vue 1.0.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.js ADDED
@@ -0,0 +1,4025 @@
1
+ import { defineComponent as V, toRefs as En, ref as Ee, onMounted as On, watch as xn, unref as D, openBlock as h, createElementBlock as v, createCommentVNode as $, computed as P, createElementVNode as a, toDisplayString as l, Fragment as S, createTextVNode as B, createVNode as q, renderList as I, normalizeClass as Oe, watchEffect as $n, createBlock as _e } from "vue";
2
+ import { getDataAccessKey as Tt, getTotals as wn, getInfoFactura as An, getInfoAdicional as xe, getPagos as Sn, TYPE_IDENTITY as Tn, getDetailsFc as Ht, getInfoTributaria as Rn, nameCodeRetention as Dn, getFullInvoiceDataFromXml as In } from "@sri-xml-viewer/core";
3
+ export * from "@sri-xml-viewer/core";
4
+ function kn(t) {
5
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
6
+ }
7
+ var Je = {}, $e = {}, N = {};
8
+ Object.defineProperty(N, "__esModule", {
9
+ value: !0
10
+ });
11
+ function Pn(t, e) {
12
+ if (!(t instanceof e))
13
+ throw new TypeError("Cannot call a class as a function");
14
+ }
15
+ var Nn = function t(e, n) {
16
+ Pn(this, t), this.data = e, this.text = n.text || e, this.options = n;
17
+ };
18
+ N.default = Nn;
19
+ Object.defineProperty($e, "__esModule", {
20
+ value: !0
21
+ });
22
+ $e.CODE39 = void 0;
23
+ var Cn = /* @__PURE__ */ function() {
24
+ function t(e, n) {
25
+ for (var r = 0; r < n.length; r++) {
26
+ var o = n[r];
27
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
28
+ }
29
+ }
30
+ return function(e, n, r) {
31
+ return n && t(e.prototype, n), r && t(e, r), e;
32
+ };
33
+ }(), Mn = N, jn = Bn(Mn);
34
+ function Bn(t) {
35
+ return t && t.__esModule ? t : { default: t };
36
+ }
37
+ function Ln(t, e) {
38
+ if (!(t instanceof e))
39
+ throw new TypeError("Cannot call a class as a function");
40
+ }
41
+ function zn(t, e) {
42
+ if (!t)
43
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
44
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
45
+ }
46
+ function Un(t, e) {
47
+ if (typeof e != "function" && e !== null)
48
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
49
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
50
+ }
51
+ var Gn = function(t) {
52
+ Un(e, t);
53
+ function e(n, r) {
54
+ return Ln(this, e), n = n.toUpperCase(), r.mod43 && (n += Hn(Xn(n))), zn(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
55
+ }
56
+ return Cn(e, [{
57
+ key: "encode",
58
+ value: function() {
59
+ for (var r = ze("*"), o = 0; o < this.data.length; o++)
60
+ r += ze(this.data[o]) + "0";
61
+ return r += ze("*"), {
62
+ data: r,
63
+ text: this.text
64
+ };
65
+ }
66
+ }, {
67
+ key: "valid",
68
+ value: function() {
69
+ return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/) !== -1;
70
+ }
71
+ }]), e;
72
+ }(jn.default), Xt = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "-", ".", " ", "$", "/", "+", "%", "*"], Fn = [20957, 29783, 23639, 30485, 20951, 29813, 23669, 20855, 29789, 23645, 29975, 23831, 30533, 22295, 30149, 24005, 21623, 29981, 23837, 22301, 30023, 23879, 30545, 22343, 30161, 24017, 21959, 30065, 23921, 22385, 29015, 18263, 29141, 17879, 29045, 18293, 17783, 29021, 18269, 17477, 17489, 17681, 20753, 35770];
73
+ function ze(t) {
74
+ return Vn(qt(t));
75
+ }
76
+ function Vn(t) {
77
+ return Fn[t].toString(2);
78
+ }
79
+ function Hn(t) {
80
+ return Xt[t];
81
+ }
82
+ function qt(t) {
83
+ return Xt.indexOf(t);
84
+ }
85
+ function Xn(t) {
86
+ for (var e = 0, n = 0; n < t.length; n++)
87
+ e += qt(t[n]);
88
+ return e = e % 43, e;
89
+ }
90
+ $e.CODE39 = Gn;
91
+ var U = {}, Ze = {}, ne = {}, T = {};
92
+ Object.defineProperty(T, "__esModule", {
93
+ value: !0
94
+ });
95
+ var ie;
96
+ function Ue(t, e, n) {
97
+ return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
98
+ }
99
+ var Yt = T.SET_A = 0, Jt = T.SET_B = 1, Zt = T.SET_C = 2;
100
+ T.SHIFT = 98;
101
+ var qn = T.START_A = 103, Yn = T.START_B = 104, Jn = T.START_C = 105;
102
+ T.MODULO = 103;
103
+ T.STOP = 106;
104
+ T.FNC1 = 207;
105
+ T.SET_BY_CODE = (ie = {}, Ue(ie, qn, Yt), Ue(ie, Yn, Jt), Ue(ie, Jn, Zt), ie);
106
+ T.SWAP = {
107
+ 101: Yt,
108
+ 100: Jt,
109
+ 99: Zt
110
+ };
111
+ T.A_START_CHAR = "Ð";
112
+ T.B_START_CHAR = "Ñ";
113
+ T.C_START_CHAR = "Ò";
114
+ T.A_CHARS = "[\0-_È-Ï]";
115
+ T.B_CHARS = "[ -È-Ï]";
116
+ T.C_CHARS = "(Ï*[0-9]{2}Ï*)";
117
+ T.BARS = [11011001100, 11001101100, 11001100110, 10010011e3, 10010001100, 10001001100, 10011001e3, 10011000100, 10001100100, 11001001e3, 11001000100, 11000100100, 10110011100, 10011011100, 10011001110, 10111001100, 10011101100, 10011100110, 11001110010, 11001011100, 11001001110, 11011100100, 11001110100, 11101101110, 11101001100, 11100101100, 11100100110, 11101100100, 11100110100, 11100110010, 11011011e3, 11011000110, 11000110110, 10100011e3, 10001011e3, 10001000110, 10110001e3, 10001101e3, 10001100010, 11010001e3, 11000101e3, 11000100010, 10110111e3, 10110001110, 10001101110, 10111011e3, 10111000110, 10001110110, 11101110110, 11010001110, 11000101110, 11011101e3, 11011100010, 11011101110, 11101011e3, 11101000110, 11100010110, 11101101e3, 11101100010, 11100011010, 11101111010, 11001000010, 11110001010, 1010011e4, 10100001100, 1001011e4, 10010000110, 10000101100, 10000100110, 1011001e4, 10110000100, 1001101e4, 10011000010, 10000110100, 10000110010, 11000010010, 1100101e4, 11110111010, 11000010100, 10001111010, 10100111100, 10010111100, 10010011110, 10111100100, 10011110100, 10011110010, 11110100100, 11110010100, 11110010010, 11011011110, 11011110110, 11110110110, 10101111e3, 10100011110, 10001011110, 10111101e3, 10111100010, 11110101e3, 11110100010, 10111011110, 10111101110, 11101011110, 11110101110, 11010000100, 1101001e4, 11010011100, 1100011101011];
118
+ Object.defineProperty(ne, "__esModule", {
119
+ value: !0
120
+ });
121
+ var Zn = /* @__PURE__ */ function() {
122
+ function t(e, n) {
123
+ for (var r = 0; r < n.length; r++) {
124
+ var o = n[r];
125
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
126
+ }
127
+ }
128
+ return function(e, n, r) {
129
+ return n && t(e.prototype, n), r && t(e, r), e;
130
+ };
131
+ }(), Wn = N, Qn = Kn(Wn), M = T;
132
+ function Kn(t) {
133
+ return t && t.__esModule ? t : { default: t };
134
+ }
135
+ function er(t, e) {
136
+ if (!(t instanceof e))
137
+ throw new TypeError("Cannot call a class as a function");
138
+ }
139
+ function tr(t, e) {
140
+ if (!t)
141
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
142
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
143
+ }
144
+ function nr(t, e) {
145
+ if (typeof e != "function" && e !== null)
146
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
147
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
148
+ }
149
+ var rr = function(t) {
150
+ nr(e, t);
151
+ function e(n, r) {
152
+ er(this, e);
153
+ var o = tr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n.substring(1), r));
154
+ return o.bytes = n.split("").map(function(i) {
155
+ return i.charCodeAt(0);
156
+ }), o;
157
+ }
158
+ return Zn(e, [{
159
+ key: "valid",
160
+ value: function() {
161
+ return /^[\x00-\x7F\xC8-\xD3]+$/.test(this.data);
162
+ }
163
+ // The public encoding function
164
+ }, {
165
+ key: "encode",
166
+ value: function() {
167
+ var r = this.bytes, o = r.shift() - 105, i = M.SET_BY_CODE[o];
168
+ if (i === void 0)
169
+ throw new RangeError("The encoding does not start with a start character.");
170
+ this.shouldEncodeAsEan128() === !0 && r.unshift(M.FNC1);
171
+ var d = e.next(r, 1, i);
172
+ return {
173
+ text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, "") : this.text,
174
+ data: (
175
+ // Add the start bits
176
+ e.getBar(o) + // Add the encoded bits
177
+ d.result + // Add the checksum
178
+ e.getBar((d.checksum + o) % M.MODULO) + // Add the end bits
179
+ e.getBar(M.STOP)
180
+ )
181
+ };
182
+ }
183
+ // GS1-128/EAN-128
184
+ }, {
185
+ key: "shouldEncodeAsEan128",
186
+ value: function() {
187
+ var r = this.options.ean128 || !1;
188
+ return typeof r == "string" && (r = r.toLowerCase() === "true"), r;
189
+ }
190
+ // Get a bar symbol by index
191
+ }], [{
192
+ key: "getBar",
193
+ value: function(r) {
194
+ return M.BARS[r] ? M.BARS[r].toString() : "";
195
+ }
196
+ // Correct an index by a set and shift it from the bytes array
197
+ }, {
198
+ key: "correctIndex",
199
+ value: function(r, o) {
200
+ if (o === M.SET_A) {
201
+ var i = r.shift();
202
+ return i < 32 ? i + 64 : i - 32;
203
+ } else return o === M.SET_B ? r.shift() - 32 : (r.shift() - 48) * 10 + r.shift() - 48;
204
+ }
205
+ }, {
206
+ key: "next",
207
+ value: function(r, o, i) {
208
+ if (!r.length)
209
+ return { result: "", checksum: 0 };
210
+ var d = void 0, u = void 0;
211
+ if (r[0] >= 200) {
212
+ u = r.shift() - 105;
213
+ var b = M.SWAP[u];
214
+ b !== void 0 ? d = e.next(r, o + 1, b) : ((i === M.SET_A || i === M.SET_B) && u === M.SHIFT && (r[0] = i === M.SET_A ? r[0] > 95 ? r[0] - 96 : r[0] : r[0] < 32 ? r[0] + 96 : r[0]), d = e.next(r, o + 1, i));
215
+ } else
216
+ u = e.correctIndex(r, i), d = e.next(r, o + 1, i);
217
+ var f = e.getBar(u), s = u * o;
218
+ return {
219
+ result: f + d.result,
220
+ checksum: s + d.checksum
221
+ };
222
+ }
223
+ }]), e;
224
+ }(Qn.default);
225
+ ne.default = rr;
226
+ var We = {};
227
+ Object.defineProperty(We, "__esModule", {
228
+ value: !0
229
+ });
230
+ var F = T, Wt = function(e) {
231
+ return e.match(new RegExp("^" + F.A_CHARS + "*"))[0].length;
232
+ }, Qt = function(e) {
233
+ return e.match(new RegExp("^" + F.B_CHARS + "*"))[0].length;
234
+ }, Kt = function(e) {
235
+ return e.match(new RegExp("^" + F.C_CHARS + "*"))[0];
236
+ };
237
+ function Qe(t, e) {
238
+ var n = e ? F.A_CHARS : F.B_CHARS, r = t.match(new RegExp("^(" + n + "+?)(([0-9]{2}){2,})([^0-9]|$)"));
239
+ if (r)
240
+ return r[1] + "Ì" + en(t.substring(r[1].length));
241
+ var o = t.match(new RegExp("^" + n + "+"))[0];
242
+ return o.length === t.length ? t : o + String.fromCharCode(e ? 205 : 206) + Qe(t.substring(o.length), !e);
243
+ }
244
+ function en(t) {
245
+ var e = Kt(t), n = e.length;
246
+ if (n === t.length)
247
+ return t;
248
+ t = t.substring(n);
249
+ var r = Wt(t) >= Qt(t);
250
+ return e + String.fromCharCode(r ? 206 : 205) + Qe(t, r);
251
+ }
252
+ We.default = function(t) {
253
+ var e = void 0, n = Kt(t).length;
254
+ if (n >= 2)
255
+ e = F.C_START_CHAR + en(t);
256
+ else {
257
+ var r = Wt(t) > Qt(t);
258
+ e = (r ? F.A_START_CHAR : F.B_START_CHAR) + Qe(t, r);
259
+ }
260
+ return e.replace(
261
+ /[\xCD\xCE]([^])[\xCD\xCE]/,
262
+ // Any sequence between 205 and 206 characters
263
+ function(o, i) {
264
+ return "Ë" + i;
265
+ }
266
+ );
267
+ };
268
+ Object.defineProperty(Ze, "__esModule", {
269
+ value: !0
270
+ });
271
+ var or = ne, ar = tn(or), ir = We, ur = tn(ir);
272
+ function tn(t) {
273
+ return t && t.__esModule ? t : { default: t };
274
+ }
275
+ function lr(t, e) {
276
+ if (!(t instanceof e))
277
+ throw new TypeError("Cannot call a class as a function");
278
+ }
279
+ function Ge(t, e) {
280
+ if (!t)
281
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
282
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
283
+ }
284
+ function cr(t, e) {
285
+ if (typeof e != "function" && e !== null)
286
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
287
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
288
+ }
289
+ var fr = function(t) {
290
+ cr(e, t);
291
+ function e(n, r) {
292
+ if (lr(this, e), /^[\x00-\x7F\xC8-\xD3]+$/.test(n))
293
+ var o = Ge(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, (0, ur.default)(n), r));
294
+ else
295
+ var o = Ge(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
296
+ return Ge(o);
297
+ }
298
+ return e;
299
+ }(ar.default);
300
+ Ze.default = fr;
301
+ var Ke = {};
302
+ Object.defineProperty(Ke, "__esModule", {
303
+ value: !0
304
+ });
305
+ var dr = /* @__PURE__ */ function() {
306
+ function t(e, n) {
307
+ for (var r = 0; r < n.length; r++) {
308
+ var o = n[r];
309
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
310
+ }
311
+ }
312
+ return function(e, n, r) {
313
+ return n && t(e.prototype, n), r && t(e, r), e;
314
+ };
315
+ }(), sr = ne, hr = vr(sr), Rt = T;
316
+ function vr(t) {
317
+ return t && t.__esModule ? t : { default: t };
318
+ }
319
+ function _r(t, e) {
320
+ if (!(t instanceof e))
321
+ throw new TypeError("Cannot call a class as a function");
322
+ }
323
+ function pr(t, e) {
324
+ if (!t)
325
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
326
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
327
+ }
328
+ function gr(t, e) {
329
+ if (typeof e != "function" && e !== null)
330
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
331
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
332
+ }
333
+ var yr = function(t) {
334
+ gr(e, t);
335
+ function e(n, r) {
336
+ return _r(this, e), pr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, Rt.A_START_CHAR + n, r));
337
+ }
338
+ return dr(e, [{
339
+ key: "valid",
340
+ value: function() {
341
+ return new RegExp("^" + Rt.A_CHARS + "+$").test(this.data);
342
+ }
343
+ }]), e;
344
+ }(hr.default);
345
+ Ke.default = yr;
346
+ var et = {};
347
+ Object.defineProperty(et, "__esModule", {
348
+ value: !0
349
+ });
350
+ var br = /* @__PURE__ */ function() {
351
+ function t(e, n) {
352
+ for (var r = 0; r < n.length; r++) {
353
+ var o = n[r];
354
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
355
+ }
356
+ }
357
+ return function(e, n, r) {
358
+ return n && t(e.prototype, n), r && t(e, r), e;
359
+ };
360
+ }(), mr = ne, Er = Or(mr), Dt = T;
361
+ function Or(t) {
362
+ return t && t.__esModule ? t : { default: t };
363
+ }
364
+ function xr(t, e) {
365
+ if (!(t instanceof e))
366
+ throw new TypeError("Cannot call a class as a function");
367
+ }
368
+ function $r(t, e) {
369
+ if (!t)
370
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
371
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
372
+ }
373
+ function wr(t, e) {
374
+ if (typeof e != "function" && e !== null)
375
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
376
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
377
+ }
378
+ var Ar = function(t) {
379
+ wr(e, t);
380
+ function e(n, r) {
381
+ return xr(this, e), $r(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, Dt.B_START_CHAR + n, r));
382
+ }
383
+ return br(e, [{
384
+ key: "valid",
385
+ value: function() {
386
+ return new RegExp("^" + Dt.B_CHARS + "+$").test(this.data);
387
+ }
388
+ }]), e;
389
+ }(Er.default);
390
+ et.default = Ar;
391
+ var tt = {};
392
+ Object.defineProperty(tt, "__esModule", {
393
+ value: !0
394
+ });
395
+ var Sr = /* @__PURE__ */ function() {
396
+ function t(e, n) {
397
+ for (var r = 0; r < n.length; r++) {
398
+ var o = n[r];
399
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
400
+ }
401
+ }
402
+ return function(e, n, r) {
403
+ return n && t(e.prototype, n), r && t(e, r), e;
404
+ };
405
+ }(), Tr = ne, Rr = Dr(Tr), It = T;
406
+ function Dr(t) {
407
+ return t && t.__esModule ? t : { default: t };
408
+ }
409
+ function Ir(t, e) {
410
+ if (!(t instanceof e))
411
+ throw new TypeError("Cannot call a class as a function");
412
+ }
413
+ function kr(t, e) {
414
+ if (!t)
415
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
416
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
417
+ }
418
+ function Pr(t, e) {
419
+ if (typeof e != "function" && e !== null)
420
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
421
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
422
+ }
423
+ var Nr = function(t) {
424
+ Pr(e, t);
425
+ function e(n, r) {
426
+ return Ir(this, e), kr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, It.C_START_CHAR + n, r));
427
+ }
428
+ return Sr(e, [{
429
+ key: "valid",
430
+ value: function() {
431
+ return new RegExp("^" + It.C_CHARS + "+$").test(this.data);
432
+ }
433
+ }]), e;
434
+ }(Rr.default);
435
+ tt.default = Nr;
436
+ Object.defineProperty(U, "__esModule", {
437
+ value: !0
438
+ });
439
+ U.CODE128C = U.CODE128B = U.CODE128A = U.CODE128 = void 0;
440
+ var Cr = Ze, Mr = we(Cr), jr = Ke, Br = we(jr), Lr = et, zr = we(Lr), Ur = tt, Gr = we(Ur);
441
+ function we(t) {
442
+ return t && t.__esModule ? t : { default: t };
443
+ }
444
+ U.CODE128 = Mr.default;
445
+ U.CODE128A = Br.default;
446
+ U.CODE128B = zr.default;
447
+ U.CODE128C = Gr.default;
448
+ var C = {}, nt = {}, z = {};
449
+ Object.defineProperty(z, "__esModule", {
450
+ value: !0
451
+ });
452
+ z.SIDE_BIN = "101";
453
+ z.MIDDLE_BIN = "01010";
454
+ z.BINARIES = {
455
+ L: [
456
+ // The L (left) type of encoding
457
+ "0001101",
458
+ "0011001",
459
+ "0010011",
460
+ "0111101",
461
+ "0100011",
462
+ "0110001",
463
+ "0101111",
464
+ "0111011",
465
+ "0110111",
466
+ "0001011"
467
+ ],
468
+ G: [
469
+ // The G type of encoding
470
+ "0100111",
471
+ "0110011",
472
+ "0011011",
473
+ "0100001",
474
+ "0011101",
475
+ "0111001",
476
+ "0000101",
477
+ "0010001",
478
+ "0001001",
479
+ "0010111"
480
+ ],
481
+ R: [
482
+ // The R (right) type of encoding
483
+ "1110010",
484
+ "1100110",
485
+ "1101100",
486
+ "1000010",
487
+ "1011100",
488
+ "1001110",
489
+ "1010000",
490
+ "1000100",
491
+ "1001000",
492
+ "1110100"
493
+ ],
494
+ O: [
495
+ // The O (odd) encoding for UPC-E
496
+ "0001101",
497
+ "0011001",
498
+ "0010011",
499
+ "0111101",
500
+ "0100011",
501
+ "0110001",
502
+ "0101111",
503
+ "0111011",
504
+ "0110111",
505
+ "0001011"
506
+ ],
507
+ E: [
508
+ // The E (even) encoding for UPC-E
509
+ "0100111",
510
+ "0110011",
511
+ "0011011",
512
+ "0100001",
513
+ "0011101",
514
+ "0111001",
515
+ "0000101",
516
+ "0010001",
517
+ "0001001",
518
+ "0010111"
519
+ ]
520
+ };
521
+ z.EAN2_STRUCTURE = ["LL", "LG", "GL", "GG"];
522
+ z.EAN5_STRUCTURE = ["GGLLL", "GLGLL", "GLLGL", "GLLLG", "LGGLL", "LLGGL", "LLLGG", "LGLGL", "LGLLG", "LLGLG"];
523
+ z.EAN13_STRUCTURE = ["LLLLLL", "LLGLGG", "LLGGLG", "LLGGGL", "LGLLGG", "LGGLLG", "LGGGLL", "LGLGLG", "LGLGGL", "LGGLGL"];
524
+ var Ae = {}, Y = {};
525
+ Object.defineProperty(Y, "__esModule", {
526
+ value: !0
527
+ });
528
+ var Fr = z, Vr = function(e, n, r) {
529
+ var o = e.split("").map(function(d, u) {
530
+ return Fr.BINARIES[n[u]];
531
+ }).map(function(d, u) {
532
+ return d ? d[e[u]] : "";
533
+ });
534
+ if (r) {
535
+ var i = e.length - 1;
536
+ o = o.map(function(d, u) {
537
+ return u < i ? d + r : d;
538
+ });
539
+ }
540
+ return o.join("");
541
+ };
542
+ Y.default = Vr;
543
+ Object.defineProperty(Ae, "__esModule", {
544
+ value: !0
545
+ });
546
+ var Hr = /* @__PURE__ */ function() {
547
+ function t(e, n) {
548
+ for (var r = 0; r < n.length; r++) {
549
+ var o = n[r];
550
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
551
+ }
552
+ }
553
+ return function(e, n, r) {
554
+ return n && t(e.prototype, n), r && t(e, r), e;
555
+ };
556
+ }(), W = z, Xr = Y, kt = nn(Xr), qr = N, Yr = nn(qr);
557
+ function nn(t) {
558
+ return t && t.__esModule ? t : { default: t };
559
+ }
560
+ function Jr(t, e) {
561
+ if (!(t instanceof e))
562
+ throw new TypeError("Cannot call a class as a function");
563
+ }
564
+ function Zr(t, e) {
565
+ if (!t)
566
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
567
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
568
+ }
569
+ function Wr(t, e) {
570
+ if (typeof e != "function" && e !== null)
571
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
572
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
573
+ }
574
+ var Qr = function(t) {
575
+ Wr(e, t);
576
+ function e(n, r) {
577
+ Jr(this, e);
578
+ var o = Zr(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
579
+ return o.fontSize = !r.flat && r.fontSize > r.width * 10 ? r.width * 10 : r.fontSize, o.guardHeight = r.height + o.fontSize / 2 + r.textMargin, o;
580
+ }
581
+ return Hr(e, [{
582
+ key: "encode",
583
+ value: function() {
584
+ return this.options.flat ? this.encodeFlat() : this.encodeGuarded();
585
+ }
586
+ }, {
587
+ key: "leftText",
588
+ value: function(r, o) {
589
+ return this.text.substr(r, o);
590
+ }
591
+ }, {
592
+ key: "leftEncode",
593
+ value: function(r, o) {
594
+ return (0, kt.default)(r, o);
595
+ }
596
+ }, {
597
+ key: "rightText",
598
+ value: function(r, o) {
599
+ return this.text.substr(r, o);
600
+ }
601
+ }, {
602
+ key: "rightEncode",
603
+ value: function(r, o) {
604
+ return (0, kt.default)(r, o);
605
+ }
606
+ }, {
607
+ key: "encodeGuarded",
608
+ value: function() {
609
+ var r = { fontSize: this.fontSize }, o = { height: this.guardHeight };
610
+ return [{ data: W.SIDE_BIN, options: o }, { data: this.leftEncode(), text: this.leftText(), options: r }, { data: W.MIDDLE_BIN, options: o }, { data: this.rightEncode(), text: this.rightText(), options: r }, { data: W.SIDE_BIN, options: o }];
611
+ }
612
+ }, {
613
+ key: "encodeFlat",
614
+ value: function() {
615
+ var r = [W.SIDE_BIN, this.leftEncode(), W.MIDDLE_BIN, this.rightEncode(), W.SIDE_BIN];
616
+ return {
617
+ data: r.join(""),
618
+ text: this.text
619
+ };
620
+ }
621
+ }]), e;
622
+ }(Yr.default);
623
+ Ae.default = Qr;
624
+ Object.defineProperty(nt, "__esModule", {
625
+ value: !0
626
+ });
627
+ var Kr = /* @__PURE__ */ function() {
628
+ function t(e, n) {
629
+ for (var r = 0; r < n.length; r++) {
630
+ var o = n[r];
631
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
632
+ }
633
+ }
634
+ return function(e, n, r) {
635
+ return n && t(e.prototype, n), r && t(e, r), e;
636
+ };
637
+ }(), ue = function t(e, n, r) {
638
+ e === null && (e = Function.prototype);
639
+ var o = Object.getOwnPropertyDescriptor(e, n);
640
+ if (o === void 0) {
641
+ var i = Object.getPrototypeOf(e);
642
+ return i === null ? void 0 : t(i, n, r);
643
+ } else {
644
+ if ("value" in o)
645
+ return o.value;
646
+ var d = o.get;
647
+ return d === void 0 ? void 0 : d.call(r);
648
+ }
649
+ }, eo = z, to = Ae, no = ro(to);
650
+ function ro(t) {
651
+ return t && t.__esModule ? t : { default: t };
652
+ }
653
+ function oo(t, e) {
654
+ if (!(t instanceof e))
655
+ throw new TypeError("Cannot call a class as a function");
656
+ }
657
+ function ao(t, e) {
658
+ if (!t)
659
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
660
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
661
+ }
662
+ function io(t, e) {
663
+ if (typeof e != "function" && e !== null)
664
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
665
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
666
+ }
667
+ var Pt = function(e) {
668
+ var n = e.substr(0, 12).split("").map(function(r) {
669
+ return +r;
670
+ }).reduce(function(r, o, i) {
671
+ return i % 2 ? r + o * 3 : r + o;
672
+ }, 0);
673
+ return (10 - n % 10) % 10;
674
+ }, uo = function(t) {
675
+ io(e, t);
676
+ function e(n, r) {
677
+ oo(this, e), n.search(/^[0-9]{12}$/) !== -1 && (n += Pt(n));
678
+ var o = ao(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
679
+ return o.lastChar = r.lastChar, o;
680
+ }
681
+ return Kr(e, [{
682
+ key: "valid",
683
+ value: function() {
684
+ return this.data.search(/^[0-9]{13}$/) !== -1 && +this.data[12] === Pt(this.data);
685
+ }
686
+ }, {
687
+ key: "leftText",
688
+ value: function() {
689
+ return ue(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "leftText", this).call(this, 1, 6);
690
+ }
691
+ }, {
692
+ key: "leftEncode",
693
+ value: function() {
694
+ var r = this.data.substr(1, 6), o = eo.EAN13_STRUCTURE[this.data[0]];
695
+ return ue(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "leftEncode", this).call(this, r, o);
696
+ }
697
+ }, {
698
+ key: "rightText",
699
+ value: function() {
700
+ return ue(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "rightText", this).call(this, 7, 6);
701
+ }
702
+ }, {
703
+ key: "rightEncode",
704
+ value: function() {
705
+ var r = this.data.substr(7, 6);
706
+ return ue(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "rightEncode", this).call(this, r, "RRRRRR");
707
+ }
708
+ // The "standard" way of printing EAN13 barcodes with guard bars
709
+ }, {
710
+ key: "encodeGuarded",
711
+ value: function() {
712
+ var r = ue(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "encodeGuarded", this).call(this);
713
+ return this.options.displayValue && (r.unshift({
714
+ data: "000000000000",
715
+ text: this.text.substr(0, 1),
716
+ options: { textAlign: "left", fontSize: this.fontSize }
717
+ }), this.options.lastChar && (r.push({
718
+ data: "00"
719
+ }), r.push({
720
+ data: "00000",
721
+ text: this.options.lastChar,
722
+ options: { fontSize: this.fontSize }
723
+ }))), r;
724
+ }
725
+ }]), e;
726
+ }(no.default);
727
+ nt.default = uo;
728
+ var rt = {};
729
+ Object.defineProperty(rt, "__esModule", {
730
+ value: !0
731
+ });
732
+ var lo = /* @__PURE__ */ function() {
733
+ function t(e, n) {
734
+ for (var r = 0; r < n.length; r++) {
735
+ var o = n[r];
736
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
737
+ }
738
+ }
739
+ return function(e, n, r) {
740
+ return n && t(e.prototype, n), r && t(e, r), e;
741
+ };
742
+ }(), pe = function t(e, n, r) {
743
+ e === null && (e = Function.prototype);
744
+ var o = Object.getOwnPropertyDescriptor(e, n);
745
+ if (o === void 0) {
746
+ var i = Object.getPrototypeOf(e);
747
+ return i === null ? void 0 : t(i, n, r);
748
+ } else {
749
+ if ("value" in o)
750
+ return o.value;
751
+ var d = o.get;
752
+ return d === void 0 ? void 0 : d.call(r);
753
+ }
754
+ }, co = Ae, fo = so(co);
755
+ function so(t) {
756
+ return t && t.__esModule ? t : { default: t };
757
+ }
758
+ function ho(t, e) {
759
+ if (!(t instanceof e))
760
+ throw new TypeError("Cannot call a class as a function");
761
+ }
762
+ function vo(t, e) {
763
+ if (!t)
764
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
765
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
766
+ }
767
+ function _o(t, e) {
768
+ if (typeof e != "function" && e !== null)
769
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
770
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
771
+ }
772
+ var Nt = function(e) {
773
+ var n = e.substr(0, 7).split("").map(function(r) {
774
+ return +r;
775
+ }).reduce(function(r, o, i) {
776
+ return i % 2 ? r + o : r + o * 3;
777
+ }, 0);
778
+ return (10 - n % 10) % 10;
779
+ }, po = function(t) {
780
+ _o(e, t);
781
+ function e(n, r) {
782
+ return ho(this, e), n.search(/^[0-9]{7}$/) !== -1 && (n += Nt(n)), vo(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
783
+ }
784
+ return lo(e, [{
785
+ key: "valid",
786
+ value: function() {
787
+ return this.data.search(/^[0-9]{8}$/) !== -1 && +this.data[7] === Nt(this.data);
788
+ }
789
+ }, {
790
+ key: "leftText",
791
+ value: function() {
792
+ return pe(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "leftText", this).call(this, 0, 4);
793
+ }
794
+ }, {
795
+ key: "leftEncode",
796
+ value: function() {
797
+ var r = this.data.substr(0, 4);
798
+ return pe(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "leftEncode", this).call(this, r, "LLLL");
799
+ }
800
+ }, {
801
+ key: "rightText",
802
+ value: function() {
803
+ return pe(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "rightText", this).call(this, 4, 4);
804
+ }
805
+ }, {
806
+ key: "rightEncode",
807
+ value: function() {
808
+ var r = this.data.substr(4, 4);
809
+ return pe(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "rightEncode", this).call(this, r, "RRRR");
810
+ }
811
+ }]), e;
812
+ }(fo.default);
813
+ rt.default = po;
814
+ var ot = {};
815
+ Object.defineProperty(ot, "__esModule", {
816
+ value: !0
817
+ });
818
+ var go = /* @__PURE__ */ function() {
819
+ function t(e, n) {
820
+ for (var r = 0; r < n.length; r++) {
821
+ var o = n[r];
822
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
823
+ }
824
+ }
825
+ return function(e, n, r) {
826
+ return n && t(e.prototype, n), r && t(e, r), e;
827
+ };
828
+ }(), yo = z, bo = Y, mo = rn(bo), Eo = N, Oo = rn(Eo);
829
+ function rn(t) {
830
+ return t && t.__esModule ? t : { default: t };
831
+ }
832
+ function xo(t, e) {
833
+ if (!(t instanceof e))
834
+ throw new TypeError("Cannot call a class as a function");
835
+ }
836
+ function $o(t, e) {
837
+ if (!t)
838
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
839
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
840
+ }
841
+ function wo(t, e) {
842
+ if (typeof e != "function" && e !== null)
843
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
844
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
845
+ }
846
+ var Ao = function(e) {
847
+ var n = e.split("").map(function(r) {
848
+ return +r;
849
+ }).reduce(function(r, o, i) {
850
+ return i % 2 ? r + o * 9 : r + o * 3;
851
+ }, 0);
852
+ return n % 10;
853
+ }, So = function(t) {
854
+ wo(e, t);
855
+ function e(n, r) {
856
+ return xo(this, e), $o(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
857
+ }
858
+ return go(e, [{
859
+ key: "valid",
860
+ value: function() {
861
+ return this.data.search(/^[0-9]{5}$/) !== -1;
862
+ }
863
+ }, {
864
+ key: "encode",
865
+ value: function() {
866
+ var r = yo.EAN5_STRUCTURE[Ao(this.data)];
867
+ return {
868
+ data: "1011" + (0, mo.default)(this.data, r, "01"),
869
+ text: this.text
870
+ };
871
+ }
872
+ }]), e;
873
+ }(Oo.default);
874
+ ot.default = So;
875
+ var at = {};
876
+ Object.defineProperty(at, "__esModule", {
877
+ value: !0
878
+ });
879
+ var To = /* @__PURE__ */ function() {
880
+ function t(e, n) {
881
+ for (var r = 0; r < n.length; r++) {
882
+ var o = n[r];
883
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
884
+ }
885
+ }
886
+ return function(e, n, r) {
887
+ return n && t(e.prototype, n), r && t(e, r), e;
888
+ };
889
+ }(), Ro = z, Do = Y, Io = on(Do), ko = N, Po = on(ko);
890
+ function on(t) {
891
+ return t && t.__esModule ? t : { default: t };
892
+ }
893
+ function No(t, e) {
894
+ if (!(t instanceof e))
895
+ throw new TypeError("Cannot call a class as a function");
896
+ }
897
+ function Co(t, e) {
898
+ if (!t)
899
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
900
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
901
+ }
902
+ function Mo(t, e) {
903
+ if (typeof e != "function" && e !== null)
904
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
905
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
906
+ }
907
+ var jo = function(t) {
908
+ Mo(e, t);
909
+ function e(n, r) {
910
+ return No(this, e), Co(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
911
+ }
912
+ return To(e, [{
913
+ key: "valid",
914
+ value: function() {
915
+ return this.data.search(/^[0-9]{2}$/) !== -1;
916
+ }
917
+ }, {
918
+ key: "encode",
919
+ value: function() {
920
+ var r = Ro.EAN2_STRUCTURE[parseInt(this.data) % 4];
921
+ return {
922
+ // Start bits + Encode the two digits with 01 in between
923
+ data: "1011" + (0, Io.default)(this.data, r, "01"),
924
+ text: this.text
925
+ };
926
+ }
927
+ }]), e;
928
+ }(Po.default);
929
+ at.default = jo;
930
+ var fe = {};
931
+ Object.defineProperty(fe, "__esModule", {
932
+ value: !0
933
+ });
934
+ var Bo = /* @__PURE__ */ function() {
935
+ function t(e, n) {
936
+ for (var r = 0; r < n.length; r++) {
937
+ var o = n[r];
938
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
939
+ }
940
+ }
941
+ return function(e, n, r) {
942
+ return n && t(e.prototype, n), r && t(e, r), e;
943
+ };
944
+ }();
945
+ fe.checksum = Xe;
946
+ var Lo = Y, Q = an(Lo), zo = N, Uo = an(zo);
947
+ function an(t) {
948
+ return t && t.__esModule ? t : { default: t };
949
+ }
950
+ function Go(t, e) {
951
+ if (!(t instanceof e))
952
+ throw new TypeError("Cannot call a class as a function");
953
+ }
954
+ function Fo(t, e) {
955
+ if (!t)
956
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
957
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
958
+ }
959
+ function Vo(t, e) {
960
+ if (typeof e != "function" && e !== null)
961
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
962
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
963
+ }
964
+ var Ho = function(t) {
965
+ Vo(e, t);
966
+ function e(n, r) {
967
+ Go(this, e), n.search(/^[0-9]{11}$/) !== -1 && (n += Xe(n));
968
+ var o = Fo(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
969
+ return o.displayValue = r.displayValue, r.fontSize > r.width * 10 ? o.fontSize = r.width * 10 : o.fontSize = r.fontSize, o.guardHeight = r.height + o.fontSize / 2 + r.textMargin, o;
970
+ }
971
+ return Bo(e, [{
972
+ key: "valid",
973
+ value: function() {
974
+ return this.data.search(/^[0-9]{12}$/) !== -1 && this.data[11] == Xe(this.data);
975
+ }
976
+ }, {
977
+ key: "encode",
978
+ value: function() {
979
+ return this.options.flat ? this.flatEncoding() : this.guardedEncoding();
980
+ }
981
+ }, {
982
+ key: "flatEncoding",
983
+ value: function() {
984
+ var r = "";
985
+ return r += "101", r += (0, Q.default)(this.data.substr(0, 6), "LLLLLL"), r += "01010", r += (0, Q.default)(this.data.substr(6, 6), "RRRRRR"), r += "101", {
986
+ data: r,
987
+ text: this.text
988
+ };
989
+ }
990
+ }, {
991
+ key: "guardedEncoding",
992
+ value: function() {
993
+ var r = [];
994
+ return this.displayValue && r.push({
995
+ data: "00000000",
996
+ text: this.text.substr(0, 1),
997
+ options: { textAlign: "left", fontSize: this.fontSize }
998
+ }), r.push({
999
+ data: "101" + (0, Q.default)(this.data[0], "L"),
1000
+ options: { height: this.guardHeight }
1001
+ }), r.push({
1002
+ data: (0, Q.default)(this.data.substr(1, 5), "LLLLL"),
1003
+ text: this.text.substr(1, 5),
1004
+ options: { fontSize: this.fontSize }
1005
+ }), r.push({
1006
+ data: "01010",
1007
+ options: { height: this.guardHeight }
1008
+ }), r.push({
1009
+ data: (0, Q.default)(this.data.substr(6, 5), "RRRRR"),
1010
+ text: this.text.substr(6, 5),
1011
+ options: { fontSize: this.fontSize }
1012
+ }), r.push({
1013
+ data: (0, Q.default)(this.data[11], "R") + "101",
1014
+ options: { height: this.guardHeight }
1015
+ }), this.displayValue && r.push({
1016
+ data: "00000000",
1017
+ text: this.text.substr(11, 1),
1018
+ options: { textAlign: "right", fontSize: this.fontSize }
1019
+ }), r;
1020
+ }
1021
+ }]), e;
1022
+ }(Uo.default);
1023
+ function Xe(t) {
1024
+ var e = 0, n;
1025
+ for (n = 1; n < 11; n += 2)
1026
+ e += parseInt(t[n]);
1027
+ for (n = 0; n < 11; n += 2)
1028
+ e += parseInt(t[n]) * 3;
1029
+ return (10 - e % 10) % 10;
1030
+ }
1031
+ fe.default = Ho;
1032
+ var it = {};
1033
+ Object.defineProperty(it, "__esModule", {
1034
+ value: !0
1035
+ });
1036
+ var Xo = /* @__PURE__ */ function() {
1037
+ function t(e, n) {
1038
+ for (var r = 0; r < n.length; r++) {
1039
+ var o = n[r];
1040
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1041
+ }
1042
+ }
1043
+ return function(e, n, r) {
1044
+ return n && t(e.prototype, n), r && t(e, r), e;
1045
+ };
1046
+ }(), qo = Y, Yo = un(qo), Jo = N, Zo = un(Jo), Wo = fe;
1047
+ function un(t) {
1048
+ return t && t.__esModule ? t : { default: t };
1049
+ }
1050
+ function Qo(t, e) {
1051
+ if (!(t instanceof e))
1052
+ throw new TypeError("Cannot call a class as a function");
1053
+ }
1054
+ function Fe(t, e) {
1055
+ if (!t)
1056
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1057
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1058
+ }
1059
+ function Ko(t, e) {
1060
+ if (typeof e != "function" && e !== null)
1061
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1062
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1063
+ }
1064
+ var ea = ["XX00000XXX", "XX10000XXX", "XX20000XXX", "XXX00000XX", "XXXX00000X", "XXXXX00005", "XXXXX00006", "XXXXX00007", "XXXXX00008", "XXXXX00009"], ta = [["EEEOOO", "OOOEEE"], ["EEOEOO", "OOEOEE"], ["EEOOEO", "OOEEOE"], ["EEOOOE", "OOEEEO"], ["EOEEOO", "OEOOEE"], ["EOOEEO", "OEEOOE"], ["EOOOEE", "OEEEOO"], ["EOEOEO", "OEOEOE"], ["EOEOOE", "OEOEEO"], ["EOOEOE", "OEEOEO"]], na = function(t) {
1065
+ Ko(e, t);
1066
+ function e(n, r) {
1067
+ Qo(this, e);
1068
+ var o = Fe(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1069
+ if (o.isValid = !1, n.search(/^[0-9]{6}$/) !== -1)
1070
+ o.middleDigits = n, o.upcA = Ct(n, "0"), o.text = r.text || "" + o.upcA[0] + n + o.upcA[o.upcA.length - 1], o.isValid = !0;
1071
+ else if (n.search(/^[01][0-9]{7}$/) !== -1)
1072
+ if (o.middleDigits = n.substring(1, n.length - 1), o.upcA = Ct(o.middleDigits, n[0]), o.upcA[o.upcA.length - 1] === n[n.length - 1])
1073
+ o.isValid = !0;
1074
+ else
1075
+ return Fe(o);
1076
+ else
1077
+ return Fe(o);
1078
+ return o.displayValue = r.displayValue, r.fontSize > r.width * 10 ? o.fontSize = r.width * 10 : o.fontSize = r.fontSize, o.guardHeight = r.height + o.fontSize / 2 + r.textMargin, o;
1079
+ }
1080
+ return Xo(e, [{
1081
+ key: "valid",
1082
+ value: function() {
1083
+ return this.isValid;
1084
+ }
1085
+ }, {
1086
+ key: "encode",
1087
+ value: function() {
1088
+ return this.options.flat ? this.flatEncoding() : this.guardedEncoding();
1089
+ }
1090
+ }, {
1091
+ key: "flatEncoding",
1092
+ value: function() {
1093
+ var r = "";
1094
+ return r += "101", r += this.encodeMiddleDigits(), r += "010101", {
1095
+ data: r,
1096
+ text: this.text
1097
+ };
1098
+ }
1099
+ }, {
1100
+ key: "guardedEncoding",
1101
+ value: function() {
1102
+ var r = [];
1103
+ return this.displayValue && r.push({
1104
+ data: "00000000",
1105
+ text: this.text[0],
1106
+ options: { textAlign: "left", fontSize: this.fontSize }
1107
+ }), r.push({
1108
+ data: "101",
1109
+ options: { height: this.guardHeight }
1110
+ }), r.push({
1111
+ data: this.encodeMiddleDigits(),
1112
+ text: this.text.substring(1, 7),
1113
+ options: { fontSize: this.fontSize }
1114
+ }), r.push({
1115
+ data: "010101",
1116
+ options: { height: this.guardHeight }
1117
+ }), this.displayValue && r.push({
1118
+ data: "00000000",
1119
+ text: this.text[7],
1120
+ options: { textAlign: "right", fontSize: this.fontSize }
1121
+ }), r;
1122
+ }
1123
+ }, {
1124
+ key: "encodeMiddleDigits",
1125
+ value: function() {
1126
+ var r = this.upcA[0], o = this.upcA[this.upcA.length - 1], i = ta[parseInt(o)][parseInt(r)];
1127
+ return (0, Yo.default)(this.middleDigits, i);
1128
+ }
1129
+ }]), e;
1130
+ }(Zo.default);
1131
+ function Ct(t, e) {
1132
+ for (var n = parseInt(t[t.length - 1]), r = ea[n], o = "", i = 0, d = 0; d < r.length; d++) {
1133
+ var u = r[d];
1134
+ u === "X" ? o += t[i++] : o += u;
1135
+ }
1136
+ return o = "" + e + o, "" + o + (0, Wo.checksum)(o);
1137
+ }
1138
+ it.default = na;
1139
+ Object.defineProperty(C, "__esModule", {
1140
+ value: !0
1141
+ });
1142
+ C.UPCE = C.UPC = C.EAN2 = C.EAN5 = C.EAN8 = C.EAN13 = void 0;
1143
+ var ra = nt, oa = re(ra), aa = rt, ia = re(aa), ua = ot, la = re(ua), ca = at, fa = re(ca), da = fe, sa = re(da), ha = it, va = re(ha);
1144
+ function re(t) {
1145
+ return t && t.__esModule ? t : { default: t };
1146
+ }
1147
+ C.EAN13 = oa.default;
1148
+ C.EAN8 = ia.default;
1149
+ C.EAN5 = la.default;
1150
+ C.EAN2 = fa.default;
1151
+ C.UPC = sa.default;
1152
+ C.UPCE = va.default;
1153
+ var ee = {}, Se = {}, de = {};
1154
+ Object.defineProperty(de, "__esModule", {
1155
+ value: !0
1156
+ });
1157
+ de.START_BIN = "1010";
1158
+ de.END_BIN = "11101";
1159
+ de.BINARIES = ["00110", "10001", "01001", "11000", "00101", "10100", "01100", "00011", "10010", "01010"];
1160
+ Object.defineProperty(Se, "__esModule", {
1161
+ value: !0
1162
+ });
1163
+ var _a = /* @__PURE__ */ function() {
1164
+ function t(e, n) {
1165
+ for (var r = 0; r < n.length; r++) {
1166
+ var o = n[r];
1167
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1168
+ }
1169
+ }
1170
+ return function(e, n, r) {
1171
+ return n && t(e.prototype, n), r && t(e, r), e;
1172
+ };
1173
+ }(), ge = de, pa = N, ga = ya(pa);
1174
+ function ya(t) {
1175
+ return t && t.__esModule ? t : { default: t };
1176
+ }
1177
+ function ba(t, e) {
1178
+ if (!(t instanceof e))
1179
+ throw new TypeError("Cannot call a class as a function");
1180
+ }
1181
+ function ma(t, e) {
1182
+ if (!t)
1183
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1184
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1185
+ }
1186
+ function Ea(t, e) {
1187
+ if (typeof e != "function" && e !== null)
1188
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1189
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1190
+ }
1191
+ var Oa = function(t) {
1192
+ Ea(e, t);
1193
+ function e() {
1194
+ return ba(this, e), ma(this, (e.__proto__ || Object.getPrototypeOf(e)).apply(this, arguments));
1195
+ }
1196
+ return _a(e, [{
1197
+ key: "valid",
1198
+ value: function() {
1199
+ return this.data.search(/^([0-9]{2})+$/) !== -1;
1200
+ }
1201
+ }, {
1202
+ key: "encode",
1203
+ value: function() {
1204
+ var r = this, o = this.data.match(/.{2}/g).map(function(i) {
1205
+ return r.encodePair(i);
1206
+ }).join("");
1207
+ return {
1208
+ data: ge.START_BIN + o + ge.END_BIN,
1209
+ text: this.text
1210
+ };
1211
+ }
1212
+ // Calculate the data of a number pair
1213
+ }, {
1214
+ key: "encodePair",
1215
+ value: function(r) {
1216
+ var o = ge.BINARIES[r[1]];
1217
+ return ge.BINARIES[r[0]].split("").map(function(i, d) {
1218
+ return (i === "1" ? "111" : "1") + (o[d] === "1" ? "000" : "0");
1219
+ }).join("");
1220
+ }
1221
+ }]), e;
1222
+ }(ga.default);
1223
+ Se.default = Oa;
1224
+ var ut = {};
1225
+ Object.defineProperty(ut, "__esModule", {
1226
+ value: !0
1227
+ });
1228
+ var xa = /* @__PURE__ */ function() {
1229
+ function t(e, n) {
1230
+ for (var r = 0; r < n.length; r++) {
1231
+ var o = n[r];
1232
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1233
+ }
1234
+ }
1235
+ return function(e, n, r) {
1236
+ return n && t(e.prototype, n), r && t(e, r), e;
1237
+ };
1238
+ }(), $a = Se, wa = Aa($a);
1239
+ function Aa(t) {
1240
+ return t && t.__esModule ? t : { default: t };
1241
+ }
1242
+ function Sa(t, e) {
1243
+ if (!(t instanceof e))
1244
+ throw new TypeError("Cannot call a class as a function");
1245
+ }
1246
+ function Ta(t, e) {
1247
+ if (!t)
1248
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1249
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1250
+ }
1251
+ function Ra(t, e) {
1252
+ if (typeof e != "function" && e !== null)
1253
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1254
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1255
+ }
1256
+ var Mt = function(e) {
1257
+ var n = e.substr(0, 13).split("").map(function(r) {
1258
+ return parseInt(r, 10);
1259
+ }).reduce(function(r, o, i) {
1260
+ return r + o * (3 - i % 2 * 2);
1261
+ }, 0);
1262
+ return Math.ceil(n / 10) * 10 - n;
1263
+ }, Da = function(t) {
1264
+ Ra(e, t);
1265
+ function e(n, r) {
1266
+ return Sa(this, e), n.search(/^[0-9]{13}$/) !== -1 && (n += Mt(n)), Ta(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1267
+ }
1268
+ return xa(e, [{
1269
+ key: "valid",
1270
+ value: function() {
1271
+ return this.data.search(/^[0-9]{14}$/) !== -1 && +this.data[13] === Mt(this.data);
1272
+ }
1273
+ }]), e;
1274
+ }(wa.default);
1275
+ ut.default = Da;
1276
+ Object.defineProperty(ee, "__esModule", {
1277
+ value: !0
1278
+ });
1279
+ ee.ITF14 = ee.ITF = void 0;
1280
+ var Ia = Se, ka = ln(Ia), Pa = ut, Na = ln(Pa);
1281
+ function ln(t) {
1282
+ return t && t.__esModule ? t : { default: t };
1283
+ }
1284
+ ee.ITF = ka.default;
1285
+ ee.ITF14 = Na.default;
1286
+ var L = {}, J = {};
1287
+ Object.defineProperty(J, "__esModule", {
1288
+ value: !0
1289
+ });
1290
+ var Ca = /* @__PURE__ */ function() {
1291
+ function t(e, n) {
1292
+ for (var r = 0; r < n.length; r++) {
1293
+ var o = n[r];
1294
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1295
+ }
1296
+ }
1297
+ return function(e, n, r) {
1298
+ return n && t(e.prototype, n), r && t(e, r), e;
1299
+ };
1300
+ }(), Ma = N, ja = Ba(Ma);
1301
+ function Ba(t) {
1302
+ return t && t.__esModule ? t : { default: t };
1303
+ }
1304
+ function La(t, e) {
1305
+ if (!(t instanceof e))
1306
+ throw new TypeError("Cannot call a class as a function");
1307
+ }
1308
+ function za(t, e) {
1309
+ if (!t)
1310
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1311
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1312
+ }
1313
+ function Ua(t, e) {
1314
+ if (typeof e != "function" && e !== null)
1315
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1316
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1317
+ }
1318
+ var Ga = function(t) {
1319
+ Ua(e, t);
1320
+ function e(n, r) {
1321
+ return La(this, e), za(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1322
+ }
1323
+ return Ca(e, [{
1324
+ key: "encode",
1325
+ value: function() {
1326
+ for (var r = "110", o = 0; o < this.data.length; o++) {
1327
+ var i = parseInt(this.data[o]), d = i.toString(2);
1328
+ d = Fa(d, 4 - d.length);
1329
+ for (var u = 0; u < d.length; u++)
1330
+ r += d[u] == "0" ? "100" : "110";
1331
+ }
1332
+ return r += "1001", {
1333
+ data: r,
1334
+ text: this.text
1335
+ };
1336
+ }
1337
+ }, {
1338
+ key: "valid",
1339
+ value: function() {
1340
+ return this.data.search(/^[0-9]+$/) !== -1;
1341
+ }
1342
+ }]), e;
1343
+ }(ja.default);
1344
+ function Fa(t, e) {
1345
+ for (var n = 0; n < e; n++)
1346
+ t = "0" + t;
1347
+ return t;
1348
+ }
1349
+ J.default = Ga;
1350
+ var lt = {}, Z = {};
1351
+ Object.defineProperty(Z, "__esModule", {
1352
+ value: !0
1353
+ });
1354
+ Z.mod10 = Va;
1355
+ Z.mod11 = Ha;
1356
+ function Va(t) {
1357
+ for (var e = 0, n = 0; n < t.length; n++) {
1358
+ var r = parseInt(t[n]);
1359
+ (n + t.length) % 2 === 0 ? e += r : e += r * 2 % 10 + Math.floor(r * 2 / 10);
1360
+ }
1361
+ return (10 - e % 10) % 10;
1362
+ }
1363
+ function Ha(t) {
1364
+ for (var e = 0, n = [2, 3, 4, 5, 6, 7], r = 0; r < t.length; r++) {
1365
+ var o = parseInt(t[t.length - 1 - r]);
1366
+ e += n[r % n.length] * o;
1367
+ }
1368
+ return (11 - e % 11) % 11;
1369
+ }
1370
+ Object.defineProperty(lt, "__esModule", {
1371
+ value: !0
1372
+ });
1373
+ var Xa = J, qa = Ja(Xa), Ya = Z;
1374
+ function Ja(t) {
1375
+ return t && t.__esModule ? t : { default: t };
1376
+ }
1377
+ function Za(t, e) {
1378
+ if (!(t instanceof e))
1379
+ throw new TypeError("Cannot call a class as a function");
1380
+ }
1381
+ function Wa(t, e) {
1382
+ if (!t)
1383
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1384
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1385
+ }
1386
+ function Qa(t, e) {
1387
+ if (typeof e != "function" && e !== null)
1388
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1389
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1390
+ }
1391
+ var Ka = function(t) {
1392
+ Qa(e, t);
1393
+ function e(n, r) {
1394
+ return Za(this, e), Wa(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n + (0, Ya.mod10)(n), r));
1395
+ }
1396
+ return e;
1397
+ }(qa.default);
1398
+ lt.default = Ka;
1399
+ var ct = {};
1400
+ Object.defineProperty(ct, "__esModule", {
1401
+ value: !0
1402
+ });
1403
+ var ei = J, ti = ri(ei), ni = Z;
1404
+ function ri(t) {
1405
+ return t && t.__esModule ? t : { default: t };
1406
+ }
1407
+ function oi(t, e) {
1408
+ if (!(t instanceof e))
1409
+ throw new TypeError("Cannot call a class as a function");
1410
+ }
1411
+ function ai(t, e) {
1412
+ if (!t)
1413
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1414
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1415
+ }
1416
+ function ii(t, e) {
1417
+ if (typeof e != "function" && e !== null)
1418
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1419
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1420
+ }
1421
+ var ui = function(t) {
1422
+ ii(e, t);
1423
+ function e(n, r) {
1424
+ return oi(this, e), ai(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n + (0, ni.mod11)(n), r));
1425
+ }
1426
+ return e;
1427
+ }(ti.default);
1428
+ ct.default = ui;
1429
+ var ft = {};
1430
+ Object.defineProperty(ft, "__esModule", {
1431
+ value: !0
1432
+ });
1433
+ var li = J, ci = fi(li), jt = Z;
1434
+ function fi(t) {
1435
+ return t && t.__esModule ? t : { default: t };
1436
+ }
1437
+ function di(t, e) {
1438
+ if (!(t instanceof e))
1439
+ throw new TypeError("Cannot call a class as a function");
1440
+ }
1441
+ function si(t, e) {
1442
+ if (!t)
1443
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1444
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1445
+ }
1446
+ function hi(t, e) {
1447
+ if (typeof e != "function" && e !== null)
1448
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1449
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1450
+ }
1451
+ var vi = function(t) {
1452
+ hi(e, t);
1453
+ function e(n, r) {
1454
+ return di(this, e), n += (0, jt.mod10)(n), n += (0, jt.mod10)(n), si(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1455
+ }
1456
+ return e;
1457
+ }(ci.default);
1458
+ ft.default = vi;
1459
+ var dt = {};
1460
+ Object.defineProperty(dt, "__esModule", {
1461
+ value: !0
1462
+ });
1463
+ var _i = J, pi = gi(_i), Bt = Z;
1464
+ function gi(t) {
1465
+ return t && t.__esModule ? t : { default: t };
1466
+ }
1467
+ function yi(t, e) {
1468
+ if (!(t instanceof e))
1469
+ throw new TypeError("Cannot call a class as a function");
1470
+ }
1471
+ function bi(t, e) {
1472
+ if (!t)
1473
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1474
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1475
+ }
1476
+ function mi(t, e) {
1477
+ if (typeof e != "function" && e !== null)
1478
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1479
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1480
+ }
1481
+ var Ei = function(t) {
1482
+ mi(e, t);
1483
+ function e(n, r) {
1484
+ return yi(this, e), n += (0, Bt.mod11)(n), n += (0, Bt.mod10)(n), bi(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1485
+ }
1486
+ return e;
1487
+ }(pi.default);
1488
+ dt.default = Ei;
1489
+ Object.defineProperty(L, "__esModule", {
1490
+ value: !0
1491
+ });
1492
+ L.MSI1110 = L.MSI1010 = L.MSI11 = L.MSI10 = L.MSI = void 0;
1493
+ var Oi = J, xi = se(Oi), $i = lt, wi = se($i), Ai = ct, Si = se(Ai), Ti = ft, Ri = se(Ti), Di = dt, Ii = se(Di);
1494
+ function se(t) {
1495
+ return t && t.__esModule ? t : { default: t };
1496
+ }
1497
+ L.MSI = xi.default;
1498
+ L.MSI10 = wi.default;
1499
+ L.MSI11 = Si.default;
1500
+ L.MSI1010 = Ri.default;
1501
+ L.MSI1110 = Ii.default;
1502
+ var Te = {};
1503
+ Object.defineProperty(Te, "__esModule", {
1504
+ value: !0
1505
+ });
1506
+ Te.pharmacode = void 0;
1507
+ var ki = /* @__PURE__ */ function() {
1508
+ function t(e, n) {
1509
+ for (var r = 0; r < n.length; r++) {
1510
+ var o = n[r];
1511
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1512
+ }
1513
+ }
1514
+ return function(e, n, r) {
1515
+ return n && t(e.prototype, n), r && t(e, r), e;
1516
+ };
1517
+ }(), Pi = N, Ni = Ci(Pi);
1518
+ function Ci(t) {
1519
+ return t && t.__esModule ? t : { default: t };
1520
+ }
1521
+ function Mi(t, e) {
1522
+ if (!(t instanceof e))
1523
+ throw new TypeError("Cannot call a class as a function");
1524
+ }
1525
+ function ji(t, e) {
1526
+ if (!t)
1527
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1528
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1529
+ }
1530
+ function Bi(t, e) {
1531
+ if (typeof e != "function" && e !== null)
1532
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1533
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1534
+ }
1535
+ var Li = function(t) {
1536
+ Bi(e, t);
1537
+ function e(n, r) {
1538
+ Mi(this, e);
1539
+ var o = ji(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1540
+ return o.number = parseInt(n, 10), o;
1541
+ }
1542
+ return ki(e, [{
1543
+ key: "encode",
1544
+ value: function() {
1545
+ for (var r = this.number, o = ""; !isNaN(r) && r != 0; )
1546
+ r % 2 === 0 ? (o = "11100" + o, r = (r - 2) / 2) : (o = "100" + o, r = (r - 1) / 2);
1547
+ return o = o.slice(0, -2), {
1548
+ data: o,
1549
+ text: this.text
1550
+ };
1551
+ }
1552
+ }, {
1553
+ key: "valid",
1554
+ value: function() {
1555
+ return this.number >= 3 && this.number <= 131070;
1556
+ }
1557
+ }]), e;
1558
+ }(Ni.default);
1559
+ Te.pharmacode = Li;
1560
+ var Re = {};
1561
+ Object.defineProperty(Re, "__esModule", {
1562
+ value: !0
1563
+ });
1564
+ Re.codabar = void 0;
1565
+ var zi = /* @__PURE__ */ function() {
1566
+ function t(e, n) {
1567
+ for (var r = 0; r < n.length; r++) {
1568
+ var o = n[r];
1569
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1570
+ }
1571
+ }
1572
+ return function(e, n, r) {
1573
+ return n && t(e.prototype, n), r && t(e, r), e;
1574
+ };
1575
+ }(), Ui = N, Gi = Fi(Ui);
1576
+ function Fi(t) {
1577
+ return t && t.__esModule ? t : { default: t };
1578
+ }
1579
+ function Vi(t, e) {
1580
+ if (!(t instanceof e))
1581
+ throw new TypeError("Cannot call a class as a function");
1582
+ }
1583
+ function Hi(t, e) {
1584
+ if (!t)
1585
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1586
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1587
+ }
1588
+ function Xi(t, e) {
1589
+ if (typeof e != "function" && e !== null)
1590
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1591
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1592
+ }
1593
+ var qi = function(t) {
1594
+ Xi(e, t);
1595
+ function e(n, r) {
1596
+ Vi(this, e), n.search(/^[0-9\-\$\:\.\+\/]+$/) === 0 && (n = "A" + n + "A");
1597
+ var o = Hi(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n.toUpperCase(), r));
1598
+ return o.text = o.options.text || o.text.replace(/[A-D]/g, ""), o;
1599
+ }
1600
+ return zi(e, [{
1601
+ key: "valid",
1602
+ value: function() {
1603
+ return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1;
1604
+ }
1605
+ }, {
1606
+ key: "encode",
1607
+ value: function() {
1608
+ for (var r = [], o = this.getEncodings(), i = 0; i < this.data.length; i++)
1609
+ r.push(o[this.data.charAt(i)]), i !== this.data.length - 1 && r.push("0");
1610
+ return {
1611
+ text: this.text,
1612
+ data: r.join("")
1613
+ };
1614
+ }
1615
+ }, {
1616
+ key: "getEncodings",
1617
+ value: function() {
1618
+ return {
1619
+ 0: "101010011",
1620
+ 1: "101011001",
1621
+ 2: "101001011",
1622
+ 3: "110010101",
1623
+ 4: "101101001",
1624
+ 5: "110101001",
1625
+ 6: "100101011",
1626
+ 7: "100101101",
1627
+ 8: "100110101",
1628
+ 9: "110100101",
1629
+ "-": "101001101",
1630
+ $: "101100101",
1631
+ ":": "1101011011",
1632
+ "/": "1101101011",
1633
+ ".": "1101101101",
1634
+ "+": "1011011011",
1635
+ A: "1011001001",
1636
+ B: "1001001011",
1637
+ C: "1010010011",
1638
+ D: "1010011001"
1639
+ };
1640
+ }
1641
+ }]), e;
1642
+ }(Gi.default);
1643
+ Re.codabar = qi;
1644
+ var te = {}, De = {}, he = {};
1645
+ Object.defineProperty(he, "__esModule", {
1646
+ value: !0
1647
+ });
1648
+ he.SYMBOLS = [
1649
+ "0",
1650
+ "1",
1651
+ "2",
1652
+ "3",
1653
+ "4",
1654
+ "5",
1655
+ "6",
1656
+ "7",
1657
+ "8",
1658
+ "9",
1659
+ "A",
1660
+ "B",
1661
+ "C",
1662
+ "D",
1663
+ "E",
1664
+ "F",
1665
+ "G",
1666
+ "H",
1667
+ "I",
1668
+ "J",
1669
+ "K",
1670
+ "L",
1671
+ "M",
1672
+ "N",
1673
+ "O",
1674
+ "P",
1675
+ "Q",
1676
+ "R",
1677
+ "S",
1678
+ "T",
1679
+ "U",
1680
+ "V",
1681
+ "W",
1682
+ "X",
1683
+ "Y",
1684
+ "Z",
1685
+ "-",
1686
+ ".",
1687
+ " ",
1688
+ "$",
1689
+ "/",
1690
+ "+",
1691
+ "%",
1692
+ // Only used for csum and multi-symbols character encodings
1693
+ "($)",
1694
+ "(%)",
1695
+ "(/)",
1696
+ "(+)",
1697
+ // Start/Stop
1698
+ "ÿ"
1699
+ ];
1700
+ he.BINARIES = ["100010100", "101001000", "101000100", "101000010", "100101000", "100100100", "100100010", "101010000", "100010010", "100001010", "110101000", "110100100", "110100010", "110010100", "110010010", "110001010", "101101000", "101100100", "101100010", "100110100", "100011010", "101011000", "101001100", "101000110", "100101100", "100010110", "110110100", "110110010", "110101100", "110100110", "110010110", "110011010", "101101100", "101100110", "100110110", "100111010", "100101110", "111010100", "111010010", "111001010", "101101110", "101110110", "110101110", "100100110", "111011010", "111010110", "100110010", "101011110"];
1701
+ he.MULTI_SYMBOLS = {
1702
+ "\0": ["(%)", "U"],
1703
+ "": ["($)", "A"],
1704
+ "": ["($)", "B"],
1705
+ "": ["($)", "C"],
1706
+ "": ["($)", "D"],
1707
+ "": ["($)", "E"],
1708
+ "": ["($)", "F"],
1709
+ "\x07": ["($)", "G"],
1710
+ "\b": ["($)", "H"],
1711
+ " ": ["($)", "I"],
1712
+ "\n": ["($)", "J"],
1713
+ "\v": ["($)", "K"],
1714
+ "\f": ["($)", "L"],
1715
+ "\r": ["($)", "M"],
1716
+ "": ["($)", "N"],
1717
+ "": ["($)", "O"],
1718
+ "": ["($)", "P"],
1719
+ "": ["($)", "Q"],
1720
+ "": ["($)", "R"],
1721
+ "": ["($)", "S"],
1722
+ "": ["($)", "T"],
1723
+ "": ["($)", "U"],
1724
+ "": ["($)", "V"],
1725
+ "": ["($)", "W"],
1726
+ "": ["($)", "X"],
1727
+ "": ["($)", "Y"],
1728
+ "": ["($)", "Z"],
1729
+ "\x1B": ["(%)", "A"],
1730
+ "": ["(%)", "B"],
1731
+ "": ["(%)", "C"],
1732
+ "": ["(%)", "D"],
1733
+ "": ["(%)", "E"],
1734
+ "!": ["(/)", "A"],
1735
+ '"': ["(/)", "B"],
1736
+ "#": ["(/)", "C"],
1737
+ "&": ["(/)", "F"],
1738
+ "'": ["(/)", "G"],
1739
+ "(": ["(/)", "H"],
1740
+ ")": ["(/)", "I"],
1741
+ "*": ["(/)", "J"],
1742
+ ",": ["(/)", "L"],
1743
+ ":": ["(/)", "Z"],
1744
+ ";": ["(%)", "F"],
1745
+ "<": ["(%)", "G"],
1746
+ "=": ["(%)", "H"],
1747
+ ">": ["(%)", "I"],
1748
+ "?": ["(%)", "J"],
1749
+ "@": ["(%)", "V"],
1750
+ "[": ["(%)", "K"],
1751
+ "\\": ["(%)", "L"],
1752
+ "]": ["(%)", "M"],
1753
+ "^": ["(%)", "N"],
1754
+ _: ["(%)", "O"],
1755
+ "`": ["(%)", "W"],
1756
+ a: ["(+)", "A"],
1757
+ b: ["(+)", "B"],
1758
+ c: ["(+)", "C"],
1759
+ d: ["(+)", "D"],
1760
+ e: ["(+)", "E"],
1761
+ f: ["(+)", "F"],
1762
+ g: ["(+)", "G"],
1763
+ h: ["(+)", "H"],
1764
+ i: ["(+)", "I"],
1765
+ j: ["(+)", "J"],
1766
+ k: ["(+)", "K"],
1767
+ l: ["(+)", "L"],
1768
+ m: ["(+)", "M"],
1769
+ n: ["(+)", "N"],
1770
+ o: ["(+)", "O"],
1771
+ p: ["(+)", "P"],
1772
+ q: ["(+)", "Q"],
1773
+ r: ["(+)", "R"],
1774
+ s: ["(+)", "S"],
1775
+ t: ["(+)", "T"],
1776
+ u: ["(+)", "U"],
1777
+ v: ["(+)", "V"],
1778
+ w: ["(+)", "W"],
1779
+ x: ["(+)", "X"],
1780
+ y: ["(+)", "Y"],
1781
+ z: ["(+)", "Z"],
1782
+ "{": ["(%)", "P"],
1783
+ "|": ["(%)", "Q"],
1784
+ "}": ["(%)", "R"],
1785
+ "~": ["(%)", "S"],
1786
+ "": ["(%)", "T"]
1787
+ };
1788
+ Object.defineProperty(De, "__esModule", {
1789
+ value: !0
1790
+ });
1791
+ var Yi = /* @__PURE__ */ function() {
1792
+ function t(e, n) {
1793
+ for (var r = 0; r < n.length; r++) {
1794
+ var o = n[r];
1795
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1796
+ }
1797
+ }
1798
+ return function(e, n, r) {
1799
+ return n && t(e.prototype, n), r && t(e, r), e;
1800
+ };
1801
+ }(), ye = he, Ji = N, Zi = Wi(Ji);
1802
+ function Wi(t) {
1803
+ return t && t.__esModule ? t : { default: t };
1804
+ }
1805
+ function Qi(t, e) {
1806
+ if (!(t instanceof e))
1807
+ throw new TypeError("Cannot call a class as a function");
1808
+ }
1809
+ function Ki(t, e) {
1810
+ if (!t)
1811
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1812
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1813
+ }
1814
+ function eu(t, e) {
1815
+ if (typeof e != "function" && e !== null)
1816
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1817
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1818
+ }
1819
+ var tu = function(t) {
1820
+ eu(e, t);
1821
+ function e(n, r) {
1822
+ return Qi(this, e), Ki(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1823
+ }
1824
+ return Yi(e, [{
1825
+ key: "valid",
1826
+ value: function() {
1827
+ return /^[0-9A-Z\-. $/+%]+$/.test(this.data);
1828
+ }
1829
+ }, {
1830
+ key: "encode",
1831
+ value: function() {
1832
+ var r = this.data.split("").flatMap(function(u) {
1833
+ return ye.MULTI_SYMBOLS[u] || u;
1834
+ }), o = r.map(function(u) {
1835
+ return e.getEncoding(u);
1836
+ }).join(""), i = e.checksum(r, 20), d = e.checksum(r.concat(i), 15);
1837
+ return {
1838
+ text: this.text,
1839
+ data: (
1840
+ // Add the start bits
1841
+ e.getEncoding("ÿ") + // Add the encoded bits
1842
+ o + // Add the checksum
1843
+ e.getEncoding(i) + e.getEncoding(d) + // Add the stop bits
1844
+ e.getEncoding("ÿ") + // Add the termination bit
1845
+ "1"
1846
+ )
1847
+ };
1848
+ }
1849
+ // Get the binary encoding of a symbol
1850
+ }], [{
1851
+ key: "getEncoding",
1852
+ value: function(r) {
1853
+ return ye.BINARIES[e.symbolValue(r)];
1854
+ }
1855
+ // Get the symbol for a symbol value
1856
+ }, {
1857
+ key: "getSymbol",
1858
+ value: function(r) {
1859
+ return ye.SYMBOLS[r];
1860
+ }
1861
+ // Get the symbol value of a symbol
1862
+ }, {
1863
+ key: "symbolValue",
1864
+ value: function(r) {
1865
+ return ye.SYMBOLS.indexOf(r);
1866
+ }
1867
+ // Calculate a checksum symbol
1868
+ }, {
1869
+ key: "checksum",
1870
+ value: function(r, o) {
1871
+ var i = r.slice().reverse().reduce(function(d, u, b) {
1872
+ var f = b % o + 1;
1873
+ return d + e.symbolValue(u) * f;
1874
+ }, 0);
1875
+ return e.getSymbol(i % 47);
1876
+ }
1877
+ }]), e;
1878
+ }(Zi.default);
1879
+ De.default = tu;
1880
+ var st = {};
1881
+ Object.defineProperty(st, "__esModule", {
1882
+ value: !0
1883
+ });
1884
+ var nu = /* @__PURE__ */ function() {
1885
+ function t(e, n) {
1886
+ for (var r = 0; r < n.length; r++) {
1887
+ var o = n[r];
1888
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1889
+ }
1890
+ }
1891
+ return function(e, n, r) {
1892
+ return n && t(e.prototype, n), r && t(e, r), e;
1893
+ };
1894
+ }(), ru = De, ou = au(ru);
1895
+ function au(t) {
1896
+ return t && t.__esModule ? t : { default: t };
1897
+ }
1898
+ function iu(t, e) {
1899
+ if (!(t instanceof e))
1900
+ throw new TypeError("Cannot call a class as a function");
1901
+ }
1902
+ function uu(t, e) {
1903
+ if (!t)
1904
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1905
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1906
+ }
1907
+ function lu(t, e) {
1908
+ if (typeof e != "function" && e !== null)
1909
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1910
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1911
+ }
1912
+ var cu = function(t) {
1913
+ lu(e, t);
1914
+ function e(n, r) {
1915
+ return iu(this, e), uu(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1916
+ }
1917
+ return nu(e, [{
1918
+ key: "valid",
1919
+ value: function() {
1920
+ return /^[\x00-\x7f]+$/.test(this.data);
1921
+ }
1922
+ }]), e;
1923
+ }(ou.default);
1924
+ st.default = cu;
1925
+ Object.defineProperty(te, "__esModule", {
1926
+ value: !0
1927
+ });
1928
+ te.CODE93FullASCII = te.CODE93 = void 0;
1929
+ var fu = De, du = cn(fu), su = st, hu = cn(su);
1930
+ function cn(t) {
1931
+ return t && t.__esModule ? t : { default: t };
1932
+ }
1933
+ te.CODE93 = du.default;
1934
+ te.CODE93FullASCII = hu.default;
1935
+ var Ie = {};
1936
+ Object.defineProperty(Ie, "__esModule", {
1937
+ value: !0
1938
+ });
1939
+ Ie.GenericBarcode = void 0;
1940
+ var vu = /* @__PURE__ */ function() {
1941
+ function t(e, n) {
1942
+ for (var r = 0; r < n.length; r++) {
1943
+ var o = n[r];
1944
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1945
+ }
1946
+ }
1947
+ return function(e, n, r) {
1948
+ return n && t(e.prototype, n), r && t(e, r), e;
1949
+ };
1950
+ }(), _u = N, pu = gu(_u);
1951
+ function gu(t) {
1952
+ return t && t.__esModule ? t : { default: t };
1953
+ }
1954
+ function yu(t, e) {
1955
+ if (!(t instanceof e))
1956
+ throw new TypeError("Cannot call a class as a function");
1957
+ }
1958
+ function bu(t, e) {
1959
+ if (!t)
1960
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1961
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1962
+ }
1963
+ function mu(t, e) {
1964
+ if (typeof e != "function" && e !== null)
1965
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1966
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1967
+ }
1968
+ var Eu = function(t) {
1969
+ mu(e, t);
1970
+ function e(n, r) {
1971
+ return yu(this, e), bu(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, n, r));
1972
+ }
1973
+ return vu(e, [{
1974
+ key: "encode",
1975
+ value: function() {
1976
+ return {
1977
+ data: "10101010101010101010101010101010101010101",
1978
+ text: this.text
1979
+ };
1980
+ }
1981
+ // Resturn true/false if the string provided is valid for this encoder
1982
+ }, {
1983
+ key: "valid",
1984
+ value: function() {
1985
+ return !0;
1986
+ }
1987
+ }]), e;
1988
+ }(pu.default);
1989
+ Ie.GenericBarcode = Eu;
1990
+ Object.defineProperty(Je, "__esModule", {
1991
+ value: !0
1992
+ });
1993
+ var Ou = $e, be = U, K = C, Lt = ee, le = L, xu = Te, $u = Re, zt = te, wu = Ie;
1994
+ Je.default = {
1995
+ CODE39: Ou.CODE39,
1996
+ CODE128: be.CODE128,
1997
+ CODE128A: be.CODE128A,
1998
+ CODE128B: be.CODE128B,
1999
+ CODE128C: be.CODE128C,
2000
+ EAN13: K.EAN13,
2001
+ EAN8: K.EAN8,
2002
+ EAN5: K.EAN5,
2003
+ EAN2: K.EAN2,
2004
+ UPC: K.UPC,
2005
+ UPCE: K.UPCE,
2006
+ ITF14: Lt.ITF14,
2007
+ ITF: Lt.ITF,
2008
+ MSI: le.MSI,
2009
+ MSI10: le.MSI10,
2010
+ MSI11: le.MSI11,
2011
+ MSI1010: le.MSI1010,
2012
+ MSI1110: le.MSI1110,
2013
+ pharmacode: xu.pharmacode,
2014
+ codabar: $u.codabar,
2015
+ CODE93: zt.CODE93,
2016
+ CODE93FullASCII: zt.CODE93FullASCII,
2017
+ GenericBarcode: wu.GenericBarcode
2018
+ };
2019
+ var oe = {};
2020
+ Object.defineProperty(oe, "__esModule", {
2021
+ value: !0
2022
+ });
2023
+ var Au = Object.assign || function(t) {
2024
+ for (var e = 1; e < arguments.length; e++) {
2025
+ var n = arguments[e];
2026
+ for (var r in n)
2027
+ Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
2028
+ }
2029
+ return t;
2030
+ };
2031
+ oe.default = function(t, e) {
2032
+ return Au({}, t, e);
2033
+ };
2034
+ var ht = {};
2035
+ Object.defineProperty(ht, "__esModule", {
2036
+ value: !0
2037
+ });
2038
+ ht.default = Su;
2039
+ function Su(t) {
2040
+ var e = [];
2041
+ function n(r) {
2042
+ if (Array.isArray(r))
2043
+ for (var o = 0; o < r.length; o++)
2044
+ n(r[o]);
2045
+ else
2046
+ r.text = r.text || "", r.data = r.data || "", e.push(r);
2047
+ }
2048
+ return n(t), e;
2049
+ }
2050
+ var vt = {};
2051
+ Object.defineProperty(vt, "__esModule", {
2052
+ value: !0
2053
+ });
2054
+ vt.default = Tu;
2055
+ function Tu(t) {
2056
+ return t.marginTop = t.marginTop || t.margin, t.marginBottom = t.marginBottom || t.margin, t.marginRight = t.marginRight || t.margin, t.marginLeft = t.marginLeft || t.margin, t;
2057
+ }
2058
+ var _t = {}, pt = {}, ke = {};
2059
+ Object.defineProperty(ke, "__esModule", {
2060
+ value: !0
2061
+ });
2062
+ ke.default = Ru;
2063
+ function Ru(t) {
2064
+ var e = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"];
2065
+ for (var n in e)
2066
+ e.hasOwnProperty(n) && (n = e[n], typeof t[n] == "string" && (t[n] = parseInt(t[n], 10)));
2067
+ return typeof t.displayValue == "string" && (t.displayValue = t.displayValue != "false"), t;
2068
+ }
2069
+ var Pe = {};
2070
+ Object.defineProperty(Pe, "__esModule", {
2071
+ value: !0
2072
+ });
2073
+ var Du = {
2074
+ width: 2,
2075
+ height: 100,
2076
+ format: "auto",
2077
+ displayValue: !0,
2078
+ fontOptions: "",
2079
+ font: "monospace",
2080
+ text: void 0,
2081
+ textAlign: "center",
2082
+ textPosition: "bottom",
2083
+ textMargin: 2,
2084
+ fontSize: 20,
2085
+ background: "#ffffff",
2086
+ lineColor: "#000000",
2087
+ margin: 10,
2088
+ marginTop: void 0,
2089
+ marginBottom: void 0,
2090
+ marginLeft: void 0,
2091
+ marginRight: void 0,
2092
+ valid: function() {
2093
+ }
2094
+ };
2095
+ Pe.default = Du;
2096
+ Object.defineProperty(pt, "__esModule", {
2097
+ value: !0
2098
+ });
2099
+ var Iu = ke, ku = fn(Iu), Pu = Pe, Ut = fn(Pu);
2100
+ function fn(t) {
2101
+ return t && t.__esModule ? t : { default: t };
2102
+ }
2103
+ function Nu(t) {
2104
+ var e = {};
2105
+ for (var n in Ut.default)
2106
+ Ut.default.hasOwnProperty(n) && (t.hasAttribute("jsbarcode-" + n.toLowerCase()) && (e[n] = t.getAttribute("jsbarcode-" + n.toLowerCase())), t.hasAttribute("data-" + n.toLowerCase()) && (e[n] = t.getAttribute("data-" + n.toLowerCase())));
2107
+ return e.value = t.getAttribute("jsbarcode-value") || t.getAttribute("data-value"), e = (0, ku.default)(e), e;
2108
+ }
2109
+ pt.default = Nu;
2110
+ var gt = {}, yt = {}, j = {};
2111
+ Object.defineProperty(j, "__esModule", {
2112
+ value: !0
2113
+ });
2114
+ j.getTotalWidthOfEncodings = j.calculateEncodingAttributes = j.getBarcodePadding = j.getEncodingHeight = j.getMaximumHeightOfEncodings = void 0;
2115
+ var Cu = oe, Mu = ju(Cu);
2116
+ function ju(t) {
2117
+ return t && t.__esModule ? t : { default: t };
2118
+ }
2119
+ function dn(t, e) {
2120
+ return e.height + (e.displayValue && t.text.length > 0 ? e.fontSize + e.textMargin : 0) + e.marginTop + e.marginBottom;
2121
+ }
2122
+ function sn(t, e, n) {
2123
+ if (n.displayValue && e < t) {
2124
+ if (n.textAlign == "center")
2125
+ return Math.floor((t - e) / 2);
2126
+ if (n.textAlign == "left")
2127
+ return 0;
2128
+ if (n.textAlign == "right")
2129
+ return Math.floor(t - e);
2130
+ }
2131
+ return 0;
2132
+ }
2133
+ function Bu(t, e, n) {
2134
+ for (var r = 0; r < t.length; r++) {
2135
+ var o = t[r], i = (0, Mu.default)(e, o.options), d;
2136
+ i.displayValue ? d = Uu(o.text, i, n) : d = 0;
2137
+ var u = o.data.length * i.width;
2138
+ o.width = Math.ceil(Math.max(d, u)), o.height = dn(o, i), o.barcodePadding = sn(d, u, i);
2139
+ }
2140
+ }
2141
+ function Lu(t) {
2142
+ for (var e = 0, n = 0; n < t.length; n++)
2143
+ e += t[n].width;
2144
+ return e;
2145
+ }
2146
+ function zu(t) {
2147
+ for (var e = 0, n = 0; n < t.length; n++)
2148
+ t[n].height > e && (e = t[n].height);
2149
+ return e;
2150
+ }
2151
+ function Uu(t, e, n) {
2152
+ var r;
2153
+ if (n)
2154
+ r = n;
2155
+ else if (typeof document < "u")
2156
+ r = document.createElement("canvas").getContext("2d");
2157
+ else
2158
+ return 0;
2159
+ r.font = e.fontOptions + " " + e.fontSize + "px " + e.font;
2160
+ var o = r.measureText(t);
2161
+ if (!o)
2162
+ return 0;
2163
+ var i = o.width;
2164
+ return i;
2165
+ }
2166
+ j.getMaximumHeightOfEncodings = zu;
2167
+ j.getEncodingHeight = dn;
2168
+ j.getBarcodePadding = sn;
2169
+ j.calculateEncodingAttributes = Bu;
2170
+ j.getTotalWidthOfEncodings = Lu;
2171
+ Object.defineProperty(yt, "__esModule", {
2172
+ value: !0
2173
+ });
2174
+ var Gu = /* @__PURE__ */ function() {
2175
+ function t(e, n) {
2176
+ for (var r = 0; r < n.length; r++) {
2177
+ var o = n[r];
2178
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
2179
+ }
2180
+ }
2181
+ return function(e, n, r) {
2182
+ return n && t(e.prototype, n), r && t(e, r), e;
2183
+ };
2184
+ }(), Fu = oe, Vu = Hu(Fu), Ve = j;
2185
+ function Hu(t) {
2186
+ return t && t.__esModule ? t : { default: t };
2187
+ }
2188
+ function Xu(t, e) {
2189
+ if (!(t instanceof e))
2190
+ throw new TypeError("Cannot call a class as a function");
2191
+ }
2192
+ var qu = function() {
2193
+ function t(e, n, r) {
2194
+ Xu(this, t), this.canvas = e, this.encodings = n, this.options = r;
2195
+ }
2196
+ return Gu(t, [{
2197
+ key: "render",
2198
+ value: function() {
2199
+ if (!this.canvas.getContext)
2200
+ throw new Error("The browser does not support canvas.");
2201
+ this.prepareCanvas();
2202
+ for (var n = 0; n < this.encodings.length; n++) {
2203
+ var r = (0, Vu.default)(this.options, this.encodings[n].options);
2204
+ this.drawCanvasBarcode(r, this.encodings[n]), this.drawCanvasText(r, this.encodings[n]), this.moveCanvasDrawing(this.encodings[n]);
2205
+ }
2206
+ this.restoreCanvas();
2207
+ }
2208
+ }, {
2209
+ key: "prepareCanvas",
2210
+ value: function() {
2211
+ var n = this.canvas.getContext("2d");
2212
+ n.save(), (0, Ve.calculateEncodingAttributes)(this.encodings, this.options, n);
2213
+ var r = (0, Ve.getTotalWidthOfEncodings)(this.encodings), o = (0, Ve.getMaximumHeightOfEncodings)(this.encodings);
2214
+ this.canvas.width = r + this.options.marginLeft + this.options.marginRight, this.canvas.height = o, n.clearRect(0, 0, this.canvas.width, this.canvas.height), this.options.background && (n.fillStyle = this.options.background, n.fillRect(0, 0, this.canvas.width, this.canvas.height)), n.translate(this.options.marginLeft, 0);
2215
+ }
2216
+ }, {
2217
+ key: "drawCanvasBarcode",
2218
+ value: function(n, r) {
2219
+ var o = this.canvas.getContext("2d"), i = r.data, d;
2220
+ n.textPosition == "top" ? d = n.marginTop + n.fontSize + n.textMargin : d = n.marginTop, o.fillStyle = n.lineColor;
2221
+ for (var u = 0; u < i.length; u++) {
2222
+ var b = u * n.width + r.barcodePadding;
2223
+ i[u] === "1" ? o.fillRect(b, d, n.width, n.height) : i[u] && o.fillRect(b, d, n.width, n.height * i[u]);
2224
+ }
2225
+ }
2226
+ }, {
2227
+ key: "drawCanvasText",
2228
+ value: function(n, r) {
2229
+ var o = this.canvas.getContext("2d"), i = n.fontOptions + " " + n.fontSize + "px " + n.font;
2230
+ if (n.displayValue) {
2231
+ var d, u;
2232
+ n.textPosition == "top" ? u = n.marginTop + n.fontSize - n.textMargin : u = n.height + n.textMargin + n.marginTop + n.fontSize, o.font = i, n.textAlign == "left" || r.barcodePadding > 0 ? (d = 0, o.textAlign = "left") : n.textAlign == "right" ? (d = r.width - 1, o.textAlign = "right") : (d = r.width / 2, o.textAlign = "center"), o.fillText(r.text, d, u);
2233
+ }
2234
+ }
2235
+ }, {
2236
+ key: "moveCanvasDrawing",
2237
+ value: function(n) {
2238
+ var r = this.canvas.getContext("2d");
2239
+ r.translate(n.width, 0);
2240
+ }
2241
+ }, {
2242
+ key: "restoreCanvas",
2243
+ value: function() {
2244
+ var n = this.canvas.getContext("2d");
2245
+ n.restore();
2246
+ }
2247
+ }]), t;
2248
+ }();
2249
+ yt.default = qu;
2250
+ var bt = {};
2251
+ Object.defineProperty(bt, "__esModule", {
2252
+ value: !0
2253
+ });
2254
+ var Yu = /* @__PURE__ */ function() {
2255
+ function t(e, n) {
2256
+ for (var r = 0; r < n.length; r++) {
2257
+ var o = n[r];
2258
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
2259
+ }
2260
+ }
2261
+ return function(e, n, r) {
2262
+ return n && t(e.prototype, n), r && t(e, r), e;
2263
+ };
2264
+ }(), Ju = oe, Zu = Wu(Ju), He = j;
2265
+ function Wu(t) {
2266
+ return t && t.__esModule ? t : { default: t };
2267
+ }
2268
+ function Qu(t, e) {
2269
+ if (!(t instanceof e))
2270
+ throw new TypeError("Cannot call a class as a function");
2271
+ }
2272
+ var me = "http://www.w3.org/2000/svg", Ku = function() {
2273
+ function t(e, n, r) {
2274
+ Qu(this, t), this.svg = e, this.encodings = n, this.options = r, this.document = r.xmlDocument || document;
2275
+ }
2276
+ return Yu(t, [{
2277
+ key: "render",
2278
+ value: function() {
2279
+ var n = this.options.marginLeft;
2280
+ this.prepareSVG();
2281
+ for (var r = 0; r < this.encodings.length; r++) {
2282
+ var o = this.encodings[r], i = (0, Zu.default)(this.options, o.options), d = this.createGroup(n, i.marginTop, this.svg);
2283
+ this.setGroupOptions(d, i), this.drawSvgBarcode(d, i, o), this.drawSVGText(d, i, o), n += o.width;
2284
+ }
2285
+ }
2286
+ }, {
2287
+ key: "prepareSVG",
2288
+ value: function() {
2289
+ for (; this.svg.firstChild; )
2290
+ this.svg.removeChild(this.svg.firstChild);
2291
+ (0, He.calculateEncodingAttributes)(this.encodings, this.options);
2292
+ var n = (0, He.getTotalWidthOfEncodings)(this.encodings), r = (0, He.getMaximumHeightOfEncodings)(this.encodings), o = n + this.options.marginLeft + this.options.marginRight;
2293
+ this.setSvgAttributes(o, r), this.options.background && this.drawRect(0, 0, o, r, this.svg).setAttribute("fill", this.options.background);
2294
+ }
2295
+ }, {
2296
+ key: "drawSvgBarcode",
2297
+ value: function(n, r, o) {
2298
+ var i = o.data, d;
2299
+ r.textPosition == "top" ? d = r.fontSize + r.textMargin : d = 0;
2300
+ for (var u = 0, b = 0, f = 0; f < i.length; f++)
2301
+ b = f * r.width + o.barcodePadding, i[f] === "1" ? u++ : u > 0 && (this.drawRect(b - r.width * u, d, r.width * u, r.height, n), u = 0);
2302
+ u > 0 && this.drawRect(b - r.width * (u - 1), d, r.width * u, r.height, n);
2303
+ }
2304
+ }, {
2305
+ key: "drawSVGText",
2306
+ value: function(n, r, o) {
2307
+ var i = this.document.createElementNS(me, "text");
2308
+ if (r.displayValue) {
2309
+ var d, u;
2310
+ i.setAttribute("font-family", r.font), i.setAttribute("font-size", r.fontSize), r.fontOptions.includes("bold") && i.setAttribute("font-weight", "bold"), r.fontOptions.includes("italic") && i.setAttribute("font-style", "italic"), r.textPosition == "top" ? u = r.fontSize - r.textMargin : u = r.height + r.textMargin + r.fontSize, r.textAlign == "left" || o.barcodePadding > 0 ? (d = 0, i.setAttribute("text-anchor", "start")) : r.textAlign == "right" ? (d = o.width - 1, i.setAttribute("text-anchor", "end")) : (d = o.width / 2, i.setAttribute("text-anchor", "middle")), i.setAttribute("x", d), i.setAttribute("y", u), i.appendChild(this.document.createTextNode(o.text)), n.appendChild(i);
2311
+ }
2312
+ }
2313
+ }, {
2314
+ key: "setSvgAttributes",
2315
+ value: function(n, r) {
2316
+ var o = this.svg;
2317
+ o.setAttribute("width", n + "px"), o.setAttribute("height", r + "px"), o.setAttribute("x", "0px"), o.setAttribute("y", "0px"), o.setAttribute("viewBox", "0 0 " + n + " " + r), o.setAttribute("xmlns", me), o.setAttribute("version", "1.1");
2318
+ }
2319
+ }, {
2320
+ key: "createGroup",
2321
+ value: function(n, r, o) {
2322
+ var i = this.document.createElementNS(me, "g");
2323
+ return i.setAttribute("transform", "translate(" + n + ", " + r + ")"), o.appendChild(i), i;
2324
+ }
2325
+ }, {
2326
+ key: "setGroupOptions",
2327
+ value: function(n, r) {
2328
+ n.setAttribute("fill", r.lineColor);
2329
+ }
2330
+ }, {
2331
+ key: "drawRect",
2332
+ value: function(n, r, o, i, d) {
2333
+ var u = this.document.createElementNS(me, "rect");
2334
+ return u.setAttribute("x", n), u.setAttribute("y", r), u.setAttribute("width", o), u.setAttribute("height", i), d.appendChild(u), u;
2335
+ }
2336
+ }]), t;
2337
+ }();
2338
+ bt.default = Ku;
2339
+ var mt = {};
2340
+ Object.defineProperty(mt, "__esModule", {
2341
+ value: !0
2342
+ });
2343
+ var el = /* @__PURE__ */ function() {
2344
+ function t(e, n) {
2345
+ for (var r = 0; r < n.length; r++) {
2346
+ var o = n[r];
2347
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
2348
+ }
2349
+ }
2350
+ return function(e, n, r) {
2351
+ return n && t(e.prototype, n), r && t(e, r), e;
2352
+ };
2353
+ }();
2354
+ function tl(t, e) {
2355
+ if (!(t instanceof e))
2356
+ throw new TypeError("Cannot call a class as a function");
2357
+ }
2358
+ var nl = function() {
2359
+ function t(e, n, r) {
2360
+ tl(this, t), this.object = e, this.encodings = n, this.options = r;
2361
+ }
2362
+ return el(t, [{
2363
+ key: "render",
2364
+ value: function() {
2365
+ this.object.encodings = this.encodings;
2366
+ }
2367
+ }]), t;
2368
+ }();
2369
+ mt.default = nl;
2370
+ Object.defineProperty(gt, "__esModule", {
2371
+ value: !0
2372
+ });
2373
+ var rl = yt, ol = Et(rl), al = bt, il = Et(al), ul = mt, ll = Et(ul);
2374
+ function Et(t) {
2375
+ return t && t.__esModule ? t : { default: t };
2376
+ }
2377
+ gt.default = { CanvasRenderer: ol.default, SVGRenderer: il.default, ObjectRenderer: ll.default };
2378
+ var ae = {};
2379
+ Object.defineProperty(ae, "__esModule", {
2380
+ value: !0
2381
+ });
2382
+ function Ot(t, e) {
2383
+ if (!(t instanceof e))
2384
+ throw new TypeError("Cannot call a class as a function");
2385
+ }
2386
+ function xt(t, e) {
2387
+ if (!t)
2388
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2389
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
2390
+ }
2391
+ function $t(t, e) {
2392
+ if (typeof e != "function" && e !== null)
2393
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
2394
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
2395
+ }
2396
+ var cl = function(t) {
2397
+ $t(e, t);
2398
+ function e(n, r) {
2399
+ Ot(this, e);
2400
+ var o = xt(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
2401
+ return o.name = "InvalidInputException", o.symbology = n, o.input = r, o.message = '"' + o.input + '" is not a valid input for ' + o.symbology, o;
2402
+ }
2403
+ return e;
2404
+ }(Error), fl = function(t) {
2405
+ $t(e, t);
2406
+ function e() {
2407
+ Ot(this, e);
2408
+ var n = xt(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
2409
+ return n.name = "InvalidElementException", n.message = "Not supported type to render on", n;
2410
+ }
2411
+ return e;
2412
+ }(Error), dl = function(t) {
2413
+ $t(e, t);
2414
+ function e() {
2415
+ Ot(this, e);
2416
+ var n = xt(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
2417
+ return n.name = "NoElementException", n.message = "No element to render on.", n;
2418
+ }
2419
+ return e;
2420
+ }(Error);
2421
+ ae.InvalidInputException = cl;
2422
+ ae.InvalidElementException = fl;
2423
+ ae.NoElementException = dl;
2424
+ Object.defineProperty(_t, "__esModule", {
2425
+ value: !0
2426
+ });
2427
+ var sl = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
2428
+ return typeof t;
2429
+ } : function(t) {
2430
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
2431
+ }, hl = pt, qe = hn(hl), vl = gt, ce = hn(vl), _l = ae;
2432
+ function hn(t) {
2433
+ return t && t.__esModule ? t : { default: t };
2434
+ }
2435
+ function wt(t) {
2436
+ if (typeof t == "string")
2437
+ return pl(t);
2438
+ if (Array.isArray(t)) {
2439
+ for (var e = [], n = 0; n < t.length; n++)
2440
+ e.push(wt(t[n]));
2441
+ return e;
2442
+ } else {
2443
+ if (typeof HTMLCanvasElement < "u" && t instanceof HTMLImageElement)
2444
+ return gl(t);
2445
+ if (t && t.nodeName && t.nodeName.toLowerCase() === "svg" || typeof SVGElement < "u" && t instanceof SVGElement)
2446
+ return {
2447
+ element: t,
2448
+ options: (0, qe.default)(t),
2449
+ renderer: ce.default.SVGRenderer
2450
+ };
2451
+ if (typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement)
2452
+ return {
2453
+ element: t,
2454
+ options: (0, qe.default)(t),
2455
+ renderer: ce.default.CanvasRenderer
2456
+ };
2457
+ if (t && t.getContext)
2458
+ return {
2459
+ element: t,
2460
+ renderer: ce.default.CanvasRenderer
2461
+ };
2462
+ if (t && (typeof t > "u" ? "undefined" : sl(t)) === "object" && !t.nodeName)
2463
+ return {
2464
+ element: t,
2465
+ renderer: ce.default.ObjectRenderer
2466
+ };
2467
+ throw new _l.InvalidElementException();
2468
+ }
2469
+ }
2470
+ function pl(t) {
2471
+ var e = document.querySelectorAll(t);
2472
+ if (e.length !== 0) {
2473
+ for (var n = [], r = 0; r < e.length; r++)
2474
+ n.push(wt(e[r]));
2475
+ return n;
2476
+ }
2477
+ }
2478
+ function gl(t) {
2479
+ var e = document.createElement("canvas");
2480
+ return {
2481
+ element: e,
2482
+ options: (0, qe.default)(t),
2483
+ renderer: ce.default.CanvasRenderer,
2484
+ afterRender: function() {
2485
+ t.setAttribute("src", e.toDataURL());
2486
+ }
2487
+ };
2488
+ }
2489
+ _t.default = wt;
2490
+ var At = {};
2491
+ Object.defineProperty(At, "__esModule", {
2492
+ value: !0
2493
+ });
2494
+ var yl = /* @__PURE__ */ function() {
2495
+ function t(e, n) {
2496
+ for (var r = 0; r < n.length; r++) {
2497
+ var o = n[r];
2498
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
2499
+ }
2500
+ }
2501
+ return function(e, n, r) {
2502
+ return n && t(e.prototype, n), r && t(e, r), e;
2503
+ };
2504
+ }();
2505
+ function bl(t, e) {
2506
+ if (!(t instanceof e))
2507
+ throw new TypeError("Cannot call a class as a function");
2508
+ }
2509
+ var ml = function() {
2510
+ function t(e) {
2511
+ bl(this, t), this.api = e;
2512
+ }
2513
+ return yl(t, [{
2514
+ key: "handleCatch",
2515
+ value: function(n) {
2516
+ if (n.name === "InvalidInputException")
2517
+ if (this.api._options.valid !== this.api._defaults.valid)
2518
+ this.api._options.valid(!1);
2519
+ else
2520
+ throw n.message;
2521
+ else
2522
+ throw n;
2523
+ this.api.render = function() {
2524
+ };
2525
+ }
2526
+ }, {
2527
+ key: "wrapBarcodeCall",
2528
+ value: function(n) {
2529
+ try {
2530
+ var r = n.apply(void 0, arguments);
2531
+ return this.api._options.valid(!0), r;
2532
+ } catch (o) {
2533
+ return this.handleCatch(o), this.api;
2534
+ }
2535
+ }
2536
+ }]), t;
2537
+ }();
2538
+ At.default = ml;
2539
+ var El = Je, X = H(El), Ol = oe, ve = H(Ol), xl = ht, vn = H(xl), $l = vt, Gt = H($l), wl = _t, Al = H(wl), Sl = ke, Tl = H(Sl), Rl = At, Dl = H(Rl), _n = ae, Il = Pe, pn = H(Il);
2540
+ function H(t) {
2541
+ return t && t.__esModule ? t : { default: t };
2542
+ }
2543
+ var G = function() {
2544
+ }, Ne = function(e, n, r) {
2545
+ var o = new G();
2546
+ if (typeof e > "u")
2547
+ throw Error("No element to render on was provided.");
2548
+ return o._renderProperties = (0, Al.default)(e), o._encodings = [], o._options = pn.default, o._errorHandler = new Dl.default(o), typeof n < "u" && (r = r || {}, r.format || (r.format = yn()), o.options(r)[r.format](n, r).render()), o;
2549
+ };
2550
+ Ne.getModule = function(t) {
2551
+ return X.default[t];
2552
+ };
2553
+ for (var Ft in X.default)
2554
+ X.default.hasOwnProperty(Ft) && kl(X.default, Ft);
2555
+ function kl(t, e) {
2556
+ G.prototype[e] = G.prototype[e.toUpperCase()] = G.prototype[e.toLowerCase()] = function(n, r) {
2557
+ var o = this;
2558
+ return o._errorHandler.wrapBarcodeCall(function() {
2559
+ r.text = typeof r.text > "u" ? void 0 : "" + r.text;
2560
+ var i = (0, ve.default)(o._options, r);
2561
+ i = (0, Tl.default)(i);
2562
+ var d = t[e], u = gn(n, d, i);
2563
+ return o._encodings.push(u), o;
2564
+ });
2565
+ };
2566
+ }
2567
+ function gn(t, e, n) {
2568
+ t = "" + t;
2569
+ var r = new e(t, n);
2570
+ if (!r.valid())
2571
+ throw new _n.InvalidInputException(r.constructor.name, t);
2572
+ var o = r.encode();
2573
+ o = (0, vn.default)(o);
2574
+ for (var i = 0; i < o.length; i++)
2575
+ o[i].options = (0, ve.default)(n, o[i].options);
2576
+ return o;
2577
+ }
2578
+ function yn() {
2579
+ return X.default.CODE128 ? "CODE128" : Object.keys(X.default)[0];
2580
+ }
2581
+ G.prototype.options = function(t) {
2582
+ return this._options = (0, ve.default)(this._options, t), this;
2583
+ };
2584
+ G.prototype.blank = function(t) {
2585
+ var e = new Array(t + 1).join("0");
2586
+ return this._encodings.push({ data: e }), this;
2587
+ };
2588
+ G.prototype.init = function() {
2589
+ if (this._renderProperties) {
2590
+ Array.isArray(this._renderProperties) || (this._renderProperties = [this._renderProperties]);
2591
+ var t;
2592
+ for (var e in this._renderProperties) {
2593
+ t = this._renderProperties[e];
2594
+ var n = (0, ve.default)(this._options, t.options);
2595
+ n.format == "auto" && (n.format = yn()), this._errorHandler.wrapBarcodeCall(function() {
2596
+ var r = n.value, o = X.default[n.format.toUpperCase()], i = gn(r, o, n);
2597
+ Ye(t, i, n);
2598
+ });
2599
+ }
2600
+ }
2601
+ };
2602
+ G.prototype.render = function() {
2603
+ if (!this._renderProperties)
2604
+ throw new _n.NoElementException();
2605
+ if (Array.isArray(this._renderProperties))
2606
+ for (var t = 0; t < this._renderProperties.length; t++)
2607
+ Ye(this._renderProperties[t], this._encodings, this._options);
2608
+ else
2609
+ Ye(this._renderProperties, this._encodings, this._options);
2610
+ return this;
2611
+ };
2612
+ G.prototype._defaults = pn.default;
2613
+ function Ye(t, e, n) {
2614
+ e = (0, vn.default)(e);
2615
+ for (var r = 0; r < e.length; r++)
2616
+ e[r].options = (0, ve.default)(n, e[r].options), (0, Gt.default)(e[r].options);
2617
+ (0, Gt.default)(n);
2618
+ var o = t.renderer, i = new o(t.element, e, n);
2619
+ i.render(), t.afterRender && t.afterRender();
2620
+ }
2621
+ typeof window < "u" && (window.JsBarcode = Ne);
2622
+ typeof jQuery < "u" && (jQuery.fn.JsBarcode = function(t, e) {
2623
+ var n = [];
2624
+ return jQuery(this).each(function() {
2625
+ n.push(this);
2626
+ }), Ne(n, t, e);
2627
+ });
2628
+ var Pl = Ne;
2629
+ const Nl = /* @__PURE__ */ kn(Pl), Cl = /* @__PURE__ */ V({
2630
+ __name: "barCode",
2631
+ props: {
2632
+ text: {
2633
+ type: String,
2634
+ required: !1
2635
+ }
2636
+ },
2637
+ setup(t) {
2638
+ const e = t, { text: n } = En(e), r = Ee(null), o = {
2639
+ format: "CODE128",
2640
+ lineColor: "#000",
2641
+ width: 2,
2642
+ height: 100,
2643
+ displayValue: !1,
2644
+ fontOptions: "",
2645
+ font: "monospace",
2646
+ textAlign: "center",
2647
+ textPosition: "bottom",
2648
+ textMargin: 2,
2649
+ fontSize: 20,
2650
+ background: "#fff",
2651
+ margin: 10,
2652
+ marginTop: void 0,
2653
+ marginBottom: void 0,
2654
+ marginLeft: void 0,
2655
+ marginRight: void 0
2656
+ };
2657
+ function i() {
2658
+ Nl(r.value, n.value, o);
2659
+ }
2660
+ return On(() => {
2661
+ i();
2662
+ }), xn(() => e.text, () => {
2663
+ i();
2664
+ }), (d, u) => D(n) ? (h(), v("svg", {
2665
+ key: 0,
2666
+ id: "canvas",
2667
+ ref_key: "canvas",
2668
+ ref: r,
2669
+ class: "flex flex-col items-center justify-center w-full h-full",
2670
+ viewbox: "0 0 210 500",
2671
+ preserveAspectRatio: "none"
2672
+ }, null, 512)) : $("", !0);
2673
+ }
2674
+ });
2675
+ function bn(t, e) {
2676
+ if (t == null || t === "") return e === "decimal" ? "0.00" : "$0.00";
2677
+ const n = typeof t == "string" ? parseFloat(t) : t;
2678
+ return isNaN(n) ? e === "decimal" ? "0.00" : "$0.00" : e === "decimal" ? n.toFixed(2) : new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(n);
2679
+ }
2680
+ function Vt(t, e = 2) {
2681
+ return Math.round((t + Number.EPSILON) * Math.pow(10, e)) / Math.pow(10, e);
2682
+ }
2683
+ function Ml(t, e) {
2684
+ return t ? String(t) : "";
2685
+ }
2686
+ const jl = { class: "flex gap-2" }, Bl = { class: "flex flex-col justify-between w-full m-1" }, Ll = { class: "flex items-center p-1 flex-1" }, zl = {
2687
+ key: 0,
2688
+ class: "text-red-600 font-bold text-4xl text-center w-full"
2689
+ }, Ul = ["src"], Gl = { class: "w-full border rounded-lg" }, Fl = {
2690
+ key: 0,
2691
+ class: "text-center"
2692
+ }, Vl = { class: "text-center text-2xl" }, Hl = { class: "text-xs" }, Xl = { class: "flex-none flex" }, ql = {
2693
+ key: 0,
2694
+ class: "flex-none flex pr-2"
2695
+ }, Yl = {
2696
+ key: 1,
2697
+ class: "flex"
2698
+ }, Jl = { class: "flex gap-2" }, Zl = {
2699
+ key: 2,
2700
+ class: "text-center w-full"
2701
+ }, Wl = { class: "pr-1 font-bold text-red-800" }, Ql = {
2702
+ key: 3,
2703
+ class: "flex w-full justify-center bg-accented p-2 mb-1"
2704
+ }, Kl = { class: "pr-1 font-bold" }, ec = {
2705
+ key: 4,
2706
+ class: "flex w-full justify-center bg-accented rounded-lg p-2 mb-1"
2707
+ }, tc = { class: "border rounded-lg w-full m-1 overflow-x-auto p-1" }, nc = { class: "mx-4 text-2xl" }, rc = { class: "text-center text-3xl bg-accented" }, oc = { class: "text-sm" }, ac = { class: "text-center text-2xl" }, ic = { class: "text-center text-clave text-xs" }, uc = {
2708
+ key: 0,
2709
+ class: "flex"
2710
+ }, lc = { class: "flex" }, cc = { class: "flex" }, fc = { class: "text-center text-clave text-xs" }, dc = { class: "w-full p-2" }, Ce = /* @__PURE__ */ V({
2711
+ __name: "headDoc",
2712
+ props: {
2713
+ document: {
2714
+ type: typeof Document < "u" ? Document : Object,
2715
+ required: !0
2716
+ },
2717
+ dateAuthorization: {
2718
+ type: String || void 0,
2719
+ default: void 0
2720
+ },
2721
+ logoUrl: {
2722
+ type: String,
2723
+ required: !1,
2724
+ default: void 0
2725
+ }
2726
+ },
2727
+ setup(t) {
2728
+ const e = t, n = P(() => {
2729
+ var s;
2730
+ const d = e.document, u = d == null ? void 0 : d.getElementsByTagName("infoTributaria");
2731
+ if (!u)
2732
+ return {};
2733
+ const b = {}, f = (s = u.item(0)) == null ? void 0 : s.children;
2734
+ if (f)
2735
+ for (let c = 0; c < f.length; c++) {
2736
+ const p = f[c];
2737
+ p != null && p.tagName && (b[p.tagName || "na"] = p.textContent || "");
2738
+ }
2739
+ return b;
2740
+ }), r = P(() => {
2741
+ var d, u;
2742
+ if ((d = n.value) != null && d.claveAcceso) {
2743
+ const b = Tt((u = n.value) == null ? void 0 : u.claveAcceso);
2744
+ return b ? b.typeWithName : "";
2745
+ }
2746
+ return "";
2747
+ }), o = P(() => {
2748
+ var c;
2749
+ const d = e.document;
2750
+ if (!d) return {};
2751
+ const u = ["infoFactura", "infoNotaCredito", "infoGuiaRemision", "infoCompRetencion"];
2752
+ let b = null;
2753
+ for (const p of u) {
2754
+ const E = d.getElementsByTagName(p);
2755
+ if (E && E.length > 0) {
2756
+ b = E;
2757
+ break;
2758
+ }
2759
+ }
2760
+ if (!b)
2761
+ return {};
2762
+ const f = {}, s = (c = b.item(0)) == null ? void 0 : c.children;
2763
+ if (s)
2764
+ for (let p = 0; p < s.length; p++) {
2765
+ const E = s[p];
2766
+ E != null && E.tagName && (f[E.tagName] = E.textContent || "");
2767
+ }
2768
+ return f;
2769
+ }), i = P(() => {
2770
+ var d, u;
2771
+ if ((d = n.value) != null && d.claveAcceso) {
2772
+ const b = Tt((u = n.value) == null ? void 0 : u.claveAcceso);
2773
+ if (b)
2774
+ return b.mode === "2" ? "PRODUCCIÓN" : "PRUEBAS";
2775
+ }
2776
+ return "";
2777
+ });
2778
+ return (d, u) => (h(), v("div", jl, [
2779
+ a("div", Bl, [
2780
+ a("div", Ll, [
2781
+ t.logoUrl ? (h(), v("img", {
2782
+ key: 1,
2783
+ src: t.logoUrl,
2784
+ alt: "Logo",
2785
+ class: "w-full h-full object-contain"
2786
+ }, null, 8, Ul)) : (h(), v("div", zl, " NO TIENE LOGO "))
2787
+ ]),
2788
+ a("div", Gl, [
2789
+ n.value.nombreComercial ? (h(), v("div", Fl, [
2790
+ a("strong", null, l(n.value.nombreComercial), 1)
2791
+ ])) : $("", !0),
2792
+ a("div", Vl, [
2793
+ a("strong", null, l(n.value.razonSocial), 1)
2794
+ ]),
2795
+ a("div", Hl, [
2796
+ a("div", Xl, [
2797
+ u[0] || (u[0] = a("div", { class: "font-bold pr-2" }, " Dirección Matriz ", -1)),
2798
+ a("div", null, l(n.value.dirMatriz), 1)
2799
+ ]),
2800
+ o.value.dirEstablecimiento ? (h(), v("div", ql, [
2801
+ u[1] || (u[1] = a("div", { class: "font-bold pr-2" }, " Dirección Sucursal ", -1)),
2802
+ a("div", null, l(o.value.dirEstablecimiento), 1)
2803
+ ])) : $("", !0),
2804
+ o.value.contribuyenteEspecial ? (h(), v("div", Yl, [
2805
+ u[2] || (u[2] = a("div", { class: "pr-1 font-bold" }, " CONTRIBUYENTE ESPECIAL ", -1)),
2806
+ a("div", null, l(o.value.contribuyenteEspecial), 1)
2807
+ ])) : $("", !0),
2808
+ a("div", Jl, [
2809
+ u[3] || (u[3] = a("div", { class: "pr-1 font-bold" }, " OBLIGADO A LLEVAR CONTABILIDAD ", -1)),
2810
+ a("div", null, l(o.value.obligadoContabilidad), 1)
2811
+ ]),
2812
+ n.value.agenteRetencion ? (h(), v("div", Zl, [
2813
+ u[4] || (u[4] = a("span", { class: "pr-1 font-bold" }, "Agente de Retencion", -1)),
2814
+ a("span", Wl, " Nº " + l(n.value.agenteRetencion), 1)
2815
+ ])) : $("", !0),
2816
+ n.value.contribuyenteRimpe ? (h(), v("div", Ql, [
2817
+ a("span", Kl, [
2818
+ n.value.contribuyenteRimpe === "CONTRIBUYENTE RÉGIMEN RIMPE" ? (h(), v(S, { key: 0 }, [
2819
+ B(" CONTRIBUYENTE RÉGIMEN RIMPE ")
2820
+ ], 64)) : (h(), v(S, { key: 1 }, [
2821
+ B(l(n.value.contribuyenteRimpe), 1)
2822
+ ], 64))
2823
+ ])
2824
+ ])) : n.value.contribuyenteEspecial ? $("", !0) : (h(), v("div", ec, [...u[5] || (u[5] = [
2825
+ a("span", { class: "pr-1 font-bold" }, " CONTRIBUYENTE RÉGIMEN GENERAL ", -1)
2826
+ ])]))
2827
+ ])
2828
+ ])
2829
+ ]),
2830
+ a("div", tc, [
2831
+ a("div", null, [
2832
+ a("strong", null, [
2833
+ u[6] || (u[6] = a("span", { class: "text-2xl" }, " R.U.C ", -1)),
2834
+ u[7] || (u[7] = B()),
2835
+ a("span", nc, l(n.value.ruc), 1)
2836
+ ])
2837
+ ]),
2838
+ a("div", rc, [
2839
+ a("strong", null, l(r.value), 1)
2840
+ ]),
2841
+ a("div", oc, [
2842
+ a("div", null, [
2843
+ u[8] || (u[8] = a("div", { class: "font-bold" }, " NUMERO COMPROBANTE ", -1)),
2844
+ a("div", ac, l(n.value.estab) + "-" + l(n.value.ptoEmi) + "-" + l(n.value.secuencial), 1)
2845
+ ]),
2846
+ u[13] || (u[13] = a("div", { class: "font-bold" }, " NUMERO DE AUTORIZACIÓN ", -1)),
2847
+ a("div", ic, l(n.value.claveAcceso), 1),
2848
+ t.dateAuthorization ? (h(), v("div", uc, [
2849
+ u[9] || (u[9] = a("div", { class: "font-bold pr-2" }, " FECHA AUTORIZACIÓN ", -1)),
2850
+ a("div", null, l(D(Ml)(t.dateAuthorization, "dd/mm/yyyy HH:mm:ss") || "SRI"), 1)
2851
+ ])) : $("", !0),
2852
+ a("div", lc, [
2853
+ u[10] || (u[10] = a("div", { class: "font-bold pr-2" }, " AMBIENTE ", -1)),
2854
+ a("div", null, l(i.value), 1)
2855
+ ]),
2856
+ a("div", cc, [
2857
+ u[11] || (u[11] = a("div", { class: "font-bold pr-2" }, " EMISIÓN ", -1)),
2858
+ a("div", null, l(n.value.tipoEmision === "1" ? "NORMAL" : "ERROR"), 1)
2859
+ ]),
2860
+ u[14] || (u[14] = a("div", { class: "text-center font-bold" }, " CLAVE DE ACCESO ", -1)),
2861
+ a("div", fc, l(n.value.claveAcceso), 1),
2862
+ a("div", dc, [
2863
+ q(Cl, {
2864
+ class: "flex-1 barcode",
2865
+ text: n.value.claveAcceso
2866
+ }, null, 8, ["text"]),
2867
+ u[12] || (u[12] = a("div", { id: "barcode" }, null, -1))
2868
+ ])
2869
+ ])
2870
+ ])
2871
+ ]));
2872
+ }
2873
+ }), sc = { class: "w-full text-xs border border-accented" }, hc = { class: "text-right border pr-1 border-accented" }, vc = { class: "text-right w-24 border border-accented" }, mn = /* @__PURE__ */ V({
2874
+ __name: "tableSubtotals",
2875
+ props: {
2876
+ data: {
2877
+ type: typeof Document < "u" ? Document : Object,
2878
+ required: !0
2879
+ }
2880
+ },
2881
+ setup(t) {
2882
+ const e = t;
2883
+ return (n, r) => (h(), v("table", sc, [
2884
+ a("tbody", null, [
2885
+ (h(!0), v(S, null, I(D(wn)(e.data), (o, i) => (h(), v("tr", { key: i }, [
2886
+ a("td", hc, l(o.name), 1),
2887
+ a("td", vc, l(D(bn)(o.valor, "decimal")), 1)
2888
+ ]))), 128))
2889
+ ])
2890
+ ]));
2891
+ }
2892
+ }), _c = { class: "bg-white! font-sans antialiased text-gray-800 max-w-6xl mx-auto print:mx-0 print:w-full text-black m-1 rounded-md p-1 printContent" }, pc = {
2893
+ key: 0,
2894
+ class: "print:hidden flex justify-end"
2895
+ }, gc = { class: "font-bold text-green-700" }, yc = { class: "flex mt-2 text-sm" }, bc = { class: "border rounded-lg w-full px-1" }, mc = { class: "flex-none flex" }, Ec = { class: "flex-none flex gap-x-2" }, Oc = { class: "font-bold pr-2" }, xc = { class: "flex-none flex" }, $c = { key: 0 }, wc = {
2896
+ key: 0,
2897
+ class: "flex-none flex"
2898
+ }, Ac = { class: "overflow-x-auto mt-1" }, Sc = { class: "w-full table-bordered text-xs" }, Tc = { class: "flex justify-between gap-2" }, Rc = { class: "flex-1" }, Dc = {
2899
+ key: 0,
2900
+ class: "text-center"
2901
+ }, Ic = {
2902
+ key: 1,
2903
+ class: "mb-1"
2904
+ }, kc = { class: "text-xs w-full table-fixed border border-accented" }, Pc = { class: "w-[100px] break-words !p-0 !pr-1 border border-accented" }, Nc = { class: "break-words !p-0 !pl-1 border-b border-accented" }, Cc = {
2905
+ key: 2,
2906
+ class: "w-full text-xs border border-accented"
2907
+ }, Mc = { class: "text-center" }, jc = { class: "text-right" }, Bc = { class: "text-right" }, Lc = { class: "" }, zc = { class: "rounded-lg mt-1 min-w-[400px]" }, Uc = { class: "w-full text-xs" }, Gc = /* @__PURE__ */ V({
2908
+ __name: "factura",
2909
+ props: {
2910
+ document: {
2911
+ type: typeof Document < "u" ? Document : Object,
2912
+ required: !0
2913
+ },
2914
+ dateAuthorization: {
2915
+ type: String,
2916
+ required: !1,
2917
+ default: void 0
2918
+ },
2919
+ logoUrl: {
2920
+ type: String,
2921
+ required: !1,
2922
+ default: void 0
2923
+ }
2924
+ },
2925
+ setup(t) {
2926
+ const e = t, n = An(e.document), r = xe(e.document), o = Sn(e.document), i = P(() => {
2927
+ var s;
2928
+ const f = (s = Tn.find((c) => c.value == n.tipoIdentificacionComprador)) == null ? void 0 : s.label;
2929
+ return f || "NO ENCONTRADO";
2930
+ }), d = Ht(e.document);
2931
+ function u() {
2932
+ if (d.length === 0)
2933
+ return [];
2934
+ const f = d.some((E) => E.codigoAuxiliar), s = d.some((E) => E.unidadMedida), c = d[0], p = ["#"];
2935
+ return c != null && c.codigoPrincipal && p.push("COD"), f && p.push("COD.aux"), c != null && c.descripcion && p.push("Descripcion"), c != null && c.cantidad && p.push("CANT"), s && p.push("UNIDAD"), c != null && c.precioUnitario && p.push("PVP"), c != null && c.descuento && p.push("DESC"), c != null && c.detallesAdicionales && (c == null || c.detallesAdicionales.detAdicional.forEach((E) => {
2936
+ p.push(E["@nombre"]);
2937
+ })), c != null && c.precioTotalSinImpuesto && p.push("TOTAL"), p;
2938
+ }
2939
+ function b() {
2940
+ let f = [];
2941
+ const s = [];
2942
+ let c = [];
2943
+ f = d;
2944
+ const p = f.some((m) => m.codigoAuxiliar), E = f.some((m) => m.unidadMedida);
2945
+ return f.forEach((m, k) => {
2946
+ c = [], c.push({ valor: k + 1, clase: "text-center" }), m.codigoPrincipal && c.push({ valor: m.codigoPrincipal }), p && c.push({ valor: m.codigoAuxiliar ?? "" }), m.descripcion && c.push({ valor: m.descripcion }), m.cantidad && c.push({ valor: m.cantidad, clase: "text-right" }), E && c.push({ valor: m.unidadMedida ?? "", clase: "text-right" }), m.precioUnitario && c.push({ valor: m.precioUnitario, clase: "text-right" }), m.descuento && c.push({ valor: m.descuento, clase: "text-right" }), m.detallesAdicionales && m.detallesAdicionales.detAdicional.forEach((y) => {
2947
+ c.push({ valor: y["@valor"] });
2948
+ }), m.precioTotalSinImpuesto && c.push({
2949
+ valor: m.precioTotalSinImpuesto,
2950
+ clase: "text-right"
2951
+ }), s.push(c);
2952
+ }), s;
2953
+ }
2954
+ return (f, s) => (h(), v("div", _c, [
2955
+ t.dateAuthorization ? (h(), v("div", pc, [
2956
+ a("div", gc, " Documento autorizado el " + l(t.dateAuthorization ?? "SIN FECHA"), 1)
2957
+ ])) : $("", !0),
2958
+ q(Ce, {
2959
+ document: t.document,
2960
+ logoUrl: t.logoUrl,
2961
+ dateAuthorization: t.dateAuthorization
2962
+ }, null, 8, ["document", "logoUrl", "dateAuthorization"]),
2963
+ a("div", yc, [
2964
+ a("div", bc, [
2965
+ a("div", mc, [
2966
+ s[0] || (s[0] = a("div", { class: "font-bold pr-2" }, " Razón Social / Nombres y Apellidos : ", -1)),
2967
+ a("div", null, l(D(n).razonSocialComprador || "no hay"), 1)
2968
+ ]),
2969
+ a("div", Ec, [
2970
+ s[1] || (s[1] = a("div", { class: "font-bold" }, " Identificación: ", -1)),
2971
+ a("div", null, l(D(n).identificacionComprador || "no hay"), 1),
2972
+ a("div", Oc, l(D(n).tipoIdentificacionComprador) + ": " + l(i.value), 1)
2973
+ ]),
2974
+ a("div", xc, [
2975
+ s[2] || (s[2] = a("div", { class: "font-bold pr-2" }, " FECHA EMISION: ", -1)),
2976
+ a("div", null, l(D(n).fechaEmision), 1),
2977
+ s[3] || (s[3] = a("div", { class: "font-bold pr-2 pl-4" }, " GUIA: ", -1)),
2978
+ D(n).guiaRemision ? (h(), v("div", $c, l(D(n).guiaRemision), 1)) : $("", !0)
2979
+ ]),
2980
+ D(n).direccionComprador ? (h(), v("div", wc, [
2981
+ s[4] || (s[4] = a("div", { class: "font-bold pr-2" }, " Dirección: ", -1)),
2982
+ a("div", null, l(D(n).direccionComprador), 1)
2983
+ ])) : $("", !0)
2984
+ ])
2985
+ ]),
2986
+ a("div", Ac, [
2987
+ a("table", Sc, [
2988
+ a("thead", null, [
2989
+ a("tr", null, [
2990
+ (h(!0), v(S, null, I(u(), (c, p) => (h(), v("th", {
2991
+ key: p,
2992
+ class: "border"
2993
+ }, l(c), 1))), 128))
2994
+ ])
2995
+ ]),
2996
+ a("tbody", null, [
2997
+ (h(!0), v(S, null, I(b(), (c, p) => (h(), v("tr", { key: p }, [
2998
+ (h(!0), v(S, null, I(c, (E, m) => (h(), v("td", {
2999
+ key: m,
3000
+ class: Oe(["break-words border", E.clase ? E.clase : ""])
3001
+ }, l(E.valor), 3))), 128))
3002
+ ]))), 128))
3003
+ ])
3004
+ ])
3005
+ ]),
3006
+ a("div", Tc, [
3007
+ a("div", Rc, [
3008
+ D(r) ? (h(), v("div", Dc, " Información Adicional ")) : $("", !0),
3009
+ D(r) ? (h(), v("div", Ic, [
3010
+ a("table", kc, [
3011
+ a("tbody", null, [
3012
+ (h(!0), v(S, null, I(D(r), (c, p) => (h(), v("tr", { key: p }, [
3013
+ a("td", Pc, l(c.name), 1),
3014
+ a("td", Nc, l(c.value), 1)
3015
+ ]))), 128))
3016
+ ])
3017
+ ])
3018
+ ])) : $("", !0),
3019
+ D(o) ? (h(), v("table", Cc, [
3020
+ s[5] || (s[5] = a("thead", null, [
3021
+ a("tr", null, [
3022
+ a("th", { class: "" }, " Forma de pago "),
3023
+ a("th", { class: "" }, " Valor "),
3024
+ a("th", { class: "" }, " PAZO "),
3025
+ a("th", { class: "" }, " TIEMPO ")
3026
+ ])
3027
+ ], -1)),
3028
+ a("tbody", null, [
3029
+ (h(!0), v(S, null, I(D(o), (c, p) => (h(), v("tr", { key: p }, [
3030
+ a("td", Mc, l(c.formaPago), 1),
3031
+ a("td", jc, l(c.total), 1),
3032
+ a("td", Bc, l(c.plazo), 1),
3033
+ a("td", Lc, l(c.unidadTiempo), 1)
3034
+ ]))), 128))
3035
+ ])
3036
+ ])) : $("", !0)
3037
+ ]),
3038
+ a("div", zc, [
3039
+ a("table", Uc, [
3040
+ q(mn, { data: t.document }, null, 8, ["data"])
3041
+ ])
3042
+ ])
3043
+ ])
3044
+ ]));
3045
+ }
3046
+ }), Fc = { class: "max-w-5xl mx-auto print:border bg-gray-50 text-black m-1 rounded-md p-1 printContent print:mx-0 print:w-screen" }, Vc = {
3047
+ key: 0,
3048
+ class: "print:hidden flex justify-end"
3049
+ }, Hc = { class: "font-bold text-green-700" }, Xc = { class: "border rounded-lg w-full mt-8" }, qc = { class: "flex-none flex" }, Yc = { class: "font-bold mx-2" }, Jc = { class: "flex" }, Zc = { class: "flex" }, Wc = { class: "flex gap-x-2" }, Qc = { class: "mx-10" }, Kc = { class: "flex" }, ef = { class: "flex justify-between items-center" }, tf = { class: "font-bold text-2xl" }, nf = { class: "border rounded-lg w-full mt-8" }, rf = { class: "overflow-x-auto" }, of = { class: "w-full table-bordered text-xs" }, af = { class: "flex justify-center flex-wrap" }, uf = { class: "border rounded-lg w-1/2" }, lf = {
3050
+ key: 0,
3051
+ class: "text-xs w-full table-fixed"
3052
+ }, cf = { class: "break-words font-bold" }, ff = { class: "w-full break-words" }, df = { class: "rounded-lg w-1/2" }, sf = /* @__PURE__ */ V({
3053
+ __name: "notaCredito",
3054
+ props: {
3055
+ document: {
3056
+ type: typeof Document < "u" ? Document : Object,
3057
+ required: !0
3058
+ },
3059
+ authorization: {
3060
+ type: String,
3061
+ required: !1,
3062
+ default: void 0
3063
+ },
3064
+ logoUrl: {
3065
+ type: String,
3066
+ required: !1,
3067
+ default: void 0
3068
+ }
3069
+ },
3070
+ setup(t) {
3071
+ const e = t;
3072
+ P(() => Rn(e.document));
3073
+ const n = P(() => xe(e.document)), r = P(() => Ht(e.document)), o = P(() => {
3074
+ const b = e.document.getElementsByTagName("infoNotaCredito");
3075
+ if (!b || b.length === 0) return {};
3076
+ const f = b[0], s = {};
3077
+ for (let c = 0; c < f.children.length; c++) {
3078
+ const p = f.children[c];
3079
+ s[p.tagName] = p.textContent || "";
3080
+ }
3081
+ return s;
3082
+ });
3083
+ function i(b, f = 0) {
3084
+ switch (f) {
3085
+ case 0:
3086
+ switch (b) {
3087
+ case "05":
3088
+ return "Cedula";
3089
+ case "04":
3090
+ return "RUC";
3091
+ case "06":
3092
+ return "Pasaporte";
3093
+ case "07":
3094
+ return "Consumidor final";
3095
+ case "08":
3096
+ return "Identificacion extranjera";
3097
+ case "09":
3098
+ return "Placa";
3099
+ }
3100
+ break;
3101
+ case 1:
3102
+ switch (b) {
3103
+ case "01":
3104
+ return "FACTURA";
3105
+ case "04":
3106
+ return "NOTA DE CREDITO";
3107
+ case "05":
3108
+ return "NOTA DE DEBITO";
3109
+ case "06":
3110
+ return "GUIA DE REMISION";
3111
+ case "07":
3112
+ return "COMPROBANTE DE RETENCION";
3113
+ default:
3114
+ return "FACTURA";
3115
+ }
3116
+ case 2:
3117
+ switch (b) {
3118
+ case "2":
3119
+ return "RENTA";
3120
+ case "1":
3121
+ return "IVA";
3122
+ }
3123
+ }
3124
+ return "";
3125
+ }
3126
+ function d() {
3127
+ if (r.value.length === 0) return [];
3128
+ const b = r.value[0], f = ["#"];
3129
+ return b.codigoPrincipal && f.push("COD"), b.codigoAuxiliar && f.push("COD.aux"), b.descripcion && f.push("Descripcion"), b.cantidad && f.push("CANT"), b.precioUnitario && f.push("PVP"), b.descuento && f.push("DESC"), b.precioTotalSinImpuesto && f.push("TOTAL"), f;
3130
+ }
3131
+ function u() {
3132
+ const b = [];
3133
+ return r.value.forEach((f, s) => {
3134
+ const c = [];
3135
+ c.push({ valor: s + 1 }), f.codigoPrincipal && c.push({ valor: f.codigoPrincipal }), f.codigoAuxiliar && c.push({ valor: f.codigoAuxiliar }), f.descripcion && c.push({ valor: f.descripcion }), f.cantidad && c.push({ valor: f.cantidad, clase: "text-right" }), f.precioUnitario && c.push({ valor: f.precioUnitario, clase: "text-right" }), f.descuento && c.push({ valor: f.descuento, clase: "text-right" }), f.precioTotalSinImpuesto && c.push({
3136
+ valor: f.precioTotalSinImpuesto,
3137
+ clase: "text-right"
3138
+ }), b.push(c);
3139
+ }), b;
3140
+ }
3141
+ return (b, f) => (h(), v("div", Fc, [
3142
+ t.authorization ? (h(), v("div", Vc, [
3143
+ a("div", Hc, " Documento autorizado el " + l(t.authorization), 1)
3144
+ ])) : $("", !0),
3145
+ q(Ce, {
3146
+ document: t.document,
3147
+ logoUrl: t.logoUrl,
3148
+ dateAuthorization: t.authorization
3149
+ }, null, 8, ["document", "logoUrl", "dateAuthorization"]),
3150
+ a("div", Xc, [
3151
+ a("div", qc, [
3152
+ f[0] || (f[0] = a("div", { class: "font-bold pr-2" }, " Razón Social / Nombres y Apellidos : ", -1)),
3153
+ a("div", null, l(o.value.razonSocialComprador), 1),
3154
+ f[1] || (f[1] = a("div", { class: "font-bold pr-2 mx-2" }, " Identificacion : ", -1)),
3155
+ a("div", null, l(o.value.identificacionComprador), 1),
3156
+ a("div", Yc, " (" + l(i(o.value.tipoIdentificacionComprador, 0)) + ") ", 1)
3157
+ ]),
3158
+ a("div", Jc, [
3159
+ a("div", Zc, [
3160
+ f[2] || (f[2] = a("div", { class: "font-bold pr-2" }, " Fecha Emisión : ", -1)),
3161
+ a("div", null, l(o.value.fechaEmision), 1)
3162
+ ])
3163
+ ]),
3164
+ f[7] || (f[7] = a("div", { class: "px-10 py-4" }, [
3165
+ a("hr")
3166
+ ], -1)),
3167
+ a("div", null, [
3168
+ a("div", Wc, [
3169
+ f[3] || (f[3] = a("div", { class: "font-bold pr-2" }, " Comprobante que se modifica : ", -1)),
3170
+ a("div", null, l(i(o.value.codDocModificado, 1)), 1),
3171
+ a("div", Qc, l(o.value.numDocModificado), 1)
3172
+ ]),
3173
+ a("div", Kc, [
3174
+ f[4] || (f[4] = a("div", { class: "font-bold pr-2" }, " Fecha Emision (Comprobante a modificar) : ", -1)),
3175
+ a("div", null, l(o.value.fechaEmisionDocSustento), 1)
3176
+ ]),
3177
+ a("div", ef, [
3178
+ f[5] || (f[5] = a("div", { class: "font-bold pr-2" }, " Razón de Modificación: ", -1)),
3179
+ a("div", tf, l(o.value.motivo), 1),
3180
+ f[6] || (f[6] = a("div", { class: "mx-10" }, null, -1))
3181
+ ])
3182
+ ])
3183
+ ]),
3184
+ a("div", nf, [
3185
+ a("div", rf, [
3186
+ a("table", of, [
3187
+ a("thead", null, [
3188
+ a("tr", null, [
3189
+ (h(!0), v(S, null, I(d(), (s, c) => (h(), v("th", {
3190
+ key: c,
3191
+ class: "border"
3192
+ }, l(s), 1))), 128))
3193
+ ])
3194
+ ]),
3195
+ a("tbody", null, [
3196
+ (h(!0), v(S, null, I(u(), (s, c) => (h(), v("tr", { key: c }, [
3197
+ (h(!0), v(S, null, I(s, (p, E) => (h(), v("td", {
3198
+ key: E,
3199
+ class: Oe(["break-words border", p.clase ? p.clase : ""])
3200
+ }, l(p.valor), 3))), 128))
3201
+ ]))), 128))
3202
+ ])
3203
+ ])
3204
+ ]),
3205
+ a("div", af, [
3206
+ a("div", uf, [
3207
+ f[8] || (f[8] = a("div", { class: "text-center" }, " Información Adicional ", -1)),
3208
+ a("div", null, [
3209
+ n.value && n.value.length > 0 ? (h(), v("table", lf, [
3210
+ a("tbody", null, [
3211
+ (h(!0), v(S, null, I(n.value, (s, c) => (h(), v("tr", { key: c }, [
3212
+ a("td", cf, l(s.name), 1),
3213
+ a("td", ff, l(s.value), 1)
3214
+ ]))), 128))
3215
+ ])
3216
+ ])) : $("", !0)
3217
+ ])
3218
+ ]),
3219
+ a("div", df, [
3220
+ q(mn, { data: t.document }, null, 8, ["data"])
3221
+ ])
3222
+ ])
3223
+ ])
3224
+ ]));
3225
+ }
3226
+ }), hf = { class: "text-xs flex flex-col gap-2 max-w-5xl mx-auto bg-gray-50 text-black m-1 rounded-md p-1 printContent print:mx-0 print:w-full" }, vf = {
3227
+ key: 0,
3228
+ class: "print:hidden flex justify-end"
3229
+ }, _f = { class: "font-bold text-green-700" }, pf = { class: "border rounded-lg p-2 mt-2" }, gf = { class: "grid grid-cols-2 gap-2" }, yf = { class: "bg-gray-200 px-2 py-0.5 rounded font-mono font-bold" }, bf = { class: "grid grid-cols-[200px_1fr]" }, mf = { class: "font-bold uppercase" }, Ef = { class: "ml-5" }, Of = { class: "font-bold" }, xf = { class: "font-bold" }, $f = { class: "font-bold" }, wf = { class: "font-bold" }, Af = { class: "font-bold" }, Sf = { class: "font-bold" }, Tf = { class: "font-bold" }, Rf = { class: "p-4" }, Df = { class: "w-full border border-accented text-xs" }, If = { class: "bg-accented text-left text-gray-700" }, kf = {
3230
+ key: 1,
3231
+ class: "mx-20"
3232
+ }, Pf = { class: "text-xs w-full table-fixed border border-accented" }, Nf = { class: "w-1/3 break-words !p-1 border font-bold bg-gray-50" }, Cf = { class: "w-2/3 break-words !p-1 border" }, Mf = /* @__PURE__ */ V({
3233
+ __name: "guiaRemision",
3234
+ props: {
3235
+ document: {
3236
+ type: typeof Document < "u" ? Document : Object,
3237
+ required: !0
3238
+ },
3239
+ authorization: {
3240
+ type: String,
3241
+ required: !1,
3242
+ default: void 0
3243
+ },
3244
+ logoUrl: {
3245
+ type: String,
3246
+ required: !1,
3247
+ default: void 0
3248
+ }
3249
+ },
3250
+ setup(t) {
3251
+ const e = t, n = P(() => {
3252
+ const f = e.document, s = f == null ? void 0 : f.getElementsByTagName("infoGuiaRemision").item(0);
3253
+ if (!s) return {};
3254
+ const c = {};
3255
+ for (let p = 0; p < s.children.length; p++) {
3256
+ const E = s.children[p];
3257
+ c[E.tagName] = E.textContent || "";
3258
+ }
3259
+ return c;
3260
+ }), r = P(() => {
3261
+ const f = e.document, s = f == null ? void 0 : f.getElementsByTagName("destinatario");
3262
+ if (!s) return [];
3263
+ const c = [];
3264
+ for (let p = 0; p < s.length; p++) {
3265
+ const E = s.item(p);
3266
+ if (!E) continue;
3267
+ const m = {};
3268
+ for (let y = 0; y < E.children.length; y++) {
3269
+ const _ = E.children[y];
3270
+ _.tagName !== "detalles" && (m[_.tagName] = _.textContent || "");
3271
+ }
3272
+ m.detalles = [];
3273
+ const k = E.getElementsByTagName("detalle");
3274
+ for (let y = 0; y < k.length; y++) {
3275
+ const _ = k.item(y);
3276
+ if (!_) continue;
3277
+ const g = {};
3278
+ for (let O = 0; O < _.children.length; O++) {
3279
+ const w = _.children[O];
3280
+ if (w.tagName === "detallesAdicionales") {
3281
+ g.detallesAdicionales = [];
3282
+ const x = w.getElementsByTagName("detAdicional");
3283
+ for (let A = 0; A < x.length; A++) {
3284
+ const R = x.item(A);
3285
+ R && g.detallesAdicionales.push({
3286
+ nombre: R.getAttribute("nombre") || "",
3287
+ valor: R.getAttribute("valor") || R.textContent || ""
3288
+ });
3289
+ }
3290
+ } else
3291
+ g[w.tagName] = w.textContent || "";
3292
+ }
3293
+ m.detalles.push(g);
3294
+ }
3295
+ c.push(m);
3296
+ }
3297
+ return c;
3298
+ }), o = xe(e.document);
3299
+ function i(f) {
3300
+ const s = /* @__PURE__ */ new Set();
3301
+ return f.forEach((c) => {
3302
+ c.detallesAdicionales && Array.isArray(c.detallesAdicionales) && c.detallesAdicionales.forEach((p) => {
3303
+ p.nombre && s.add(p.nombre);
3304
+ });
3305
+ }), Array.from(s);
3306
+ }
3307
+ function d(f) {
3308
+ if (f.length === 0) return [];
3309
+ const s = [{
3310
+ label: "#",
3311
+ headerClassName: "text-center"
3312
+ }];
3313
+ return s.push({ label: "CANT", headerClassName: "text-center" }), s.push({ label: "Descripción" }), f.some((m) => m.codigoInterno) && s.push({ label: "Còdigo Princial" }), f.some((m) => m.codigoAdicional) && s.push({ label: "COD.aux" }), i(f).forEach((m) => {
3314
+ s.push({ label: m });
3315
+ }), s;
3316
+ }
3317
+ function u(f) {
3318
+ const s = [], c = f.some((m) => m.codigoInterno), p = f.some((m) => m.codigoAdicional), E = i(f);
3319
+ return f.forEach((m, k) => {
3320
+ const y = [];
3321
+ y.push({ valor: k + 1, clase: "text-center" }), y.push({ valor: m.cantidad || "0", clase: "text-right font-bold" }), y.push({ valor: m.descripcion || "" }), c && y.push({ valor: m.codigoInterno || "" }), p && y.push({ valor: m.codigoAdicional || "" }), E.forEach((_) => {
3322
+ let g = "";
3323
+ if (m.detallesAdicionales && Array.isArray(m.detallesAdicionales)) {
3324
+ const O = m.detallesAdicionales.find((w) => w.nombre === _);
3325
+ O && (g = O.valor);
3326
+ }
3327
+ y.push({ valor: g });
3328
+ }), s.push(y);
3329
+ }), s;
3330
+ }
3331
+ function b(f) {
3332
+ switch (f) {
3333
+ case "01":
3334
+ return "Factura";
3335
+ case "04":
3336
+ return "Nota de Crédito";
3337
+ case "05":
3338
+ return "Nota de Débito";
3339
+ default:
3340
+ return "Comprobante";
3341
+ }
3342
+ }
3343
+ return (f, s) => (h(), v("div", hf, [
3344
+ t.authorization ? (h(), v("div", vf, [
3345
+ a("div", _f, " Documento autorizado el " + l(t.authorization), 1)
3346
+ ])) : $("", !0),
3347
+ q(Ce, {
3348
+ document: t.document,
3349
+ dateAuthorization: t.authorization,
3350
+ logoUrl: t.logoUrl
3351
+ }, null, 8, ["document", "dateAuthorization", "logoUrl"]),
3352
+ a("div", pf, [
3353
+ a("div", gf, [
3354
+ a("div", null, [
3355
+ s[0] || (s[0] = a("span", { class: "font-bold" }, "Transportista (Razón Social):", -1)),
3356
+ B(" " + l(n.value.razonSocialTransportista), 1)
3357
+ ]),
3358
+ a("div", null, [
3359
+ s[1] || (s[1] = a("span", { class: "font-bold" }, "R.U.C. / C.I.:", -1)),
3360
+ B(" " + l(n.value.rucTransportista), 1)
3361
+ ]),
3362
+ a("div", null, [
3363
+ s[2] || (s[2] = a("span", { class: "font-bold" }, "Placa del Vehículo:", -1)),
3364
+ s[3] || (s[3] = B()),
3365
+ a("span", yf, l(n.value.placa), 1)
3366
+ ]),
3367
+ a("div", null, [
3368
+ s[4] || (s[4] = a("span", { class: "font-bold" }, "Punto de Partida:", -1)),
3369
+ B(" " + l(n.value.dirPartida), 1)
3370
+ ]),
3371
+ a("div", null, [
3372
+ s[5] || (s[5] = a("span", { class: "font-bold" }, "Fecha Inicio Transporte:", -1)),
3373
+ B(" " + l(n.value.fechaIniTransporte), 1)
3374
+ ]),
3375
+ a("div", null, [
3376
+ s[6] || (s[6] = a("span", { class: "font-bold" }, "Fecha Fin Transporte:", -1)),
3377
+ B(" " + l(n.value.fechaFinTransporte), 1)
3378
+ ])
3379
+ ])
3380
+ ]),
3381
+ (h(!0), v(S, null, I(r.value, (c, p) => (h(), v("div", {
3382
+ key: p,
3383
+ class: "border rounded-lg p-2 mt-2"
3384
+ }, [
3385
+ a("div", bf, [
3386
+ c.numDocSustento ? (h(), v(S, { key: 0 }, [
3387
+ s[8] || (s[8] = a("div", null, " Comprobante de venta: ", -1)),
3388
+ a("div", null, [
3389
+ a("span", mf, l(b(c.codDocSustento ?? "")) + " " + l(c.numDocSustento), 1),
3390
+ a("span", Ef, [
3391
+ s[7] || (s[7] = B(" Fecha de emisión: ", -1)),
3392
+ a("span", Of, l(c.fechaEmisionDocSustento), 1)
3393
+ ])
3394
+ ]),
3395
+ s[9] || (s[9] = a("div", null, " Numero de autorización: ", -1)),
3396
+ a("div", null, [
3397
+ a("span", xf, l(c.numAutDocSustento), 1)
3398
+ ])
3399
+ ], 64)) : $("", !0),
3400
+ s[10] || (s[10] = a("div", null, " Motivo de Traslado: ", -1)),
3401
+ a("div", $f, l(c.motivoTraslado), 1),
3402
+ s[11] || (s[11] = a("div", null, " DESTINO (punto de llegada) : ", -1)),
3403
+ a("div", wf, l(c.dirDestinatario), 1),
3404
+ s[12] || (s[12] = a("div", null, " Identificación(Destinatario) : ", -1)),
3405
+ a("div", Af, l(c.identificacionDestinatario), 1),
3406
+ s[13] || (s[13] = a("div", null, " Nombre / Razón Social ", -1)),
3407
+ a("div", Sf, l(c.razonSocialDestinatario), 1),
3408
+ s[14] || (s[14] = a("div", null, " Ruta: ", -1)),
3409
+ a("div", Tf, l(c.ruta ?? ""), 1)
3410
+ ]),
3411
+ a("div", Rf, [
3412
+ a("table", Df, [
3413
+ a("thead", null, [
3414
+ a("tr", If, [
3415
+ (h(!0), v(S, null, I(d(c.detalles), (E, m) => (h(), v("th", {
3416
+ key: m,
3417
+ class: Oe(["p-1 font-bold", E.headerClassName ? E.headerClassName : ""])
3418
+ }, l(E.label), 3))), 128))
3419
+ ])
3420
+ ]),
3421
+ a("tbody", null, [
3422
+ (h(!0), v(S, null, I(u(c.detalles), (E, m) => (h(), v("tr", { key: m }, [
3423
+ (h(!0), v(S, null, I(E, (k, y) => (h(), v("td", {
3424
+ key: y,
3425
+ class: Oe(["border border-accented p-1 break-words", k.clase ? k.clase : ""])
3426
+ }, l(k.valor), 3))), 128))
3427
+ ]))), 128))
3428
+ ])
3429
+ ])
3430
+ ])
3431
+ ]))), 128)),
3432
+ D(o) && D(o).length > 0 ? (h(), v("div", kf, [
3433
+ a("table", Pf, [
3434
+ s[15] || (s[15] = a("thead", { class: "border" }, [
3435
+ a("tr", { class: "bg-gray-100 text-gray-700" }, [
3436
+ a("th", {
3437
+ colspan: "2",
3438
+ class: "p-1 text-center font-bold"
3439
+ }, " INFORMACIÓN ADICIONAL ")
3440
+ ])
3441
+ ], -1)),
3442
+ a("tbody", null, [
3443
+ (h(!0), v(S, null, I(D(o), (c, p) => (h(), v("tr", { key: p }, [
3444
+ a("td", Nf, l(c.name), 1),
3445
+ a("td", Cf, l(c.value), 1)
3446
+ ]))), 128))
3447
+ ])
3448
+ ])
3449
+ ])) : $("", !0)
3450
+ ]));
3451
+ }
3452
+ }), jf = { class: "text-xs flex flex-col gap-1 max-w-5xl mx-auto bg-gray-50 text-black m-1 rounded-md p-1 printContent print:mx-0 print:w-full" }, Bf = {
3453
+ key: 0,
3454
+ class: "print:hidden flex justify-end"
3455
+ }, Lf = { class: "font-bold text-green-700" }, zf = { class: "flex mt-5" }, Uf = { class: "border rounded-lg w-full" }, Gf = { class: "flex-none flex" }, Ff = { class: "flex-none flex" }, Vf = { class: "mx-2 font-bold" }, Hf = { class: "flex-none flex" }, Xf = { key: 0 }, qf = { key: 1 }, Yf = { key: 0 }, Jf = { class: "flex gap-2" }, Zf = { class: "flex gap-2" }, Wf = { class: "flex gap-2" }, Qf = { class: "font-bold" }, Kf = { class: "px-2 rounded-md border bg-gray-300" }, ed = {
3456
+ key: 0,
3457
+ class: "flex mx-4"
3458
+ }, td = { class: "flex gap-2" }, nd = { class: "text-center" }, rd = { key: 0 }, od = { class: "text-center" }, ad = { class: "text-center" }, id = { class: "text-center" }, ud = { class: "text-center" }, ld = { class: "hidden" }, cd = { class: "w-full" }, fd = {
3459
+ key: 0,
3460
+ class: "w-full text-xs"
3461
+ }, dd = { class: "border text-center" }, sd = { class: "border text-right" }, hd = { class: "border text-right" }, vd = { class: "border" }, _d = { class: "w-full" }, pd = {
3462
+ key: 0,
3463
+ class: "w-full text-xs"
3464
+ }, gd = { class: "border text-right" }, yd = { class: "border text-right" }, bd = { class: "border text-right" }, md = { class: "px-4 pt-4" }, Ed = {
3465
+ border: "",
3466
+ "border-gray-500": "",
3467
+ "mb-2": ""
3468
+ }, Od = { class: "w-full table-bordered text-xs" }, xd = ["colspan"], $d = { class: "break-words border" }, wd = { class: "break-words border text-center" }, Ad = { class: "break-words border" }, Sd = { class: "break-words border text-right" }, Td = { class: "break-words border text-right" }, Rd = { class: "break-words border text-right" }, Dd = { class: "text-right" }, Id = { class: "px-2 bg-gray-300" }, kd = {
3469
+ key: 1,
3470
+ class: "border border-gray-500 mt-4"
3471
+ }, Pd = {
3472
+ border: "",
3473
+ "border-gray-500": "",
3474
+ "mb-2": ""
3475
+ }, Nd = { class: "w-full table-bordered text-xs" }, Cd = ["colspan"], Md = { class: "break-words border text-center" }, jd = { class: "break-words border text-center" }, Bd = { class: "break-words border" }, Ld = { class: "break-words border" }, zd = { class: "break-words border text-right" }, Ud = { class: "break-words border text-right" }, Gd = { class: "break-words border text-right" }, Fd = { class: "break-words border text-right" }, Vd = { class: "text-right" }, Hd = { class: "px-2 bg-gray-300" }, Xd = { class: "p-8" }, qd = { class: "border rounded-lg w-full mt-2" }, Yd = {
3476
+ key: 0,
3477
+ class: "text-xs w-full table-fixed"
3478
+ }, Jd = { class: "w-1/3 break-words" }, Zd = { class: "w-full break-words" }, Wd = /* @__PURE__ */ V({
3479
+ __name: "retencion",
3480
+ props: {
3481
+ document: {
3482
+ type: typeof Document < "u" ? Document : Object,
3483
+ required: !0
3484
+ },
3485
+ authorization: {
3486
+ type: String,
3487
+ required: !1,
3488
+ default: void 0
3489
+ }
3490
+ },
3491
+ setup(t) {
3492
+ const e = t, n = P(() => {
3493
+ var y, _;
3494
+ return (_ = (y = e.document) == null ? void 0 : y.getElementsByTagName("comprobanteRetencion").item(0)) == null ? void 0 : _.getAttribute("version");
3495
+ }), r = xe(e.document);
3496
+ function o(y) {
3497
+ return Dn(y);
3498
+ }
3499
+ function i(y, _ = 0) {
3500
+ switch (_) {
3501
+ case 0:
3502
+ switch (y) {
3503
+ case "05":
3504
+ return "Cedula";
3505
+ case "04":
3506
+ return "RUC";
3507
+ case "06":
3508
+ return "Pasaporte";
3509
+ case "07":
3510
+ return "Consumidor final";
3511
+ case "08":
3512
+ return "Identificacion extranjera";
3513
+ case "09":
3514
+ return "Placa";
3515
+ }
3516
+ break;
3517
+ case 1:
3518
+ switch (y) {
3519
+ case "01":
3520
+ return "FACTURA";
3521
+ case "04":
3522
+ return "NOTA DE CREDITO";
3523
+ case "05":
3524
+ return "NOTA DE DEBITO";
3525
+ case "06":
3526
+ return "GUIA DE REMISION";
3527
+ case "07":
3528
+ return "COMPROBANTE DE RETENCION";
3529
+ default:
3530
+ return "FACTURA";
3531
+ }
3532
+ case 2:
3533
+ switch (y) {
3534
+ case "2":
3535
+ return "IVA";
3536
+ case "1":
3537
+ return "RENTA";
3538
+ }
3539
+ }
3540
+ }
3541
+ function d() {
3542
+ return [
3543
+ "#",
3544
+ "TIPO",
3545
+ "CODIGO",
3546
+ "PORCENTAJE",
3547
+ "BASE IMPONIBLE",
3548
+ "VALOR"
3549
+ ];
3550
+ }
3551
+ function u() {
3552
+ return [
3553
+ "Comprobante",
3554
+ "Número",
3555
+ "Fecha Emisión",
3556
+ "Ejercicio Fiscal",
3557
+ "Base Imponible para la Retención",
3558
+ "Impuesto",
3559
+ "Porcentaje Retención",
3560
+ "Valor Retenido"
3561
+ ];
3562
+ }
3563
+ function b(y) {
3564
+ const _ = y.substring(0, 3), g = y.substring(3, 6), O = y.substring(6, 15);
3565
+ return `${_}-${g}-${O}`;
3566
+ }
3567
+ function f(y) {
3568
+ const _ = [
3569
+ {
3570
+ name: "SIN UTILIZACION DEL SISTEMA FINANCIERO",
3571
+ value: "01"
3572
+ },
3573
+ {
3574
+ name: "COMPENSACIÓN DE DEUDAS",
3575
+ value: "15"
3576
+ },
3577
+ {
3578
+ name: "TARJETA DE DÉBITO",
3579
+ value: "16"
3580
+ },
3581
+ {
3582
+ name: "DINERO ELECTRÓNICO",
3583
+ value: "17"
3584
+ },
3585
+ {
3586
+ name: "TARJETA PREPAGO",
3587
+ value: "18"
3588
+ },
3589
+ {
3590
+ name: "TARJETA DE CRÉDITO",
3591
+ value: "19"
3592
+ },
3593
+ {
3594
+ name: "OTROS CON UTILIZACION DEL SISTEMA FINANCIERO",
3595
+ value: "20"
3596
+ },
3597
+ {
3598
+ name: "ENDOSO DE TÍTULOS",
3599
+ value: "21"
3600
+ }
3601
+ ];
3602
+ return y.map((O) => {
3603
+ var w;
3604
+ return {
3605
+ formaPago: ((w = _.find((x) => x.value === O.formaPago)) == null ? void 0 : w.name) || "",
3606
+ total: O.total,
3607
+ plazo: O.plazo && O.plazo || 0,
3608
+ unidadTiempo: O.unidadTiempo && O.unidadTiempo || 0
3609
+ };
3610
+ });
3611
+ }
3612
+ function s(y) {
3613
+ const _ = [
3614
+ {
3615
+ name: "IVA",
3616
+ value: "2"
3617
+ },
3618
+ {
3619
+ name: "ICE",
3620
+ value: "3"
3621
+ },
3622
+ {
3623
+ name: "IRBPNR",
3624
+ value: "5"
3625
+ }
3626
+ ], g = [
3627
+ {
3628
+ name: "0%",
3629
+ value: "0"
3630
+ },
3631
+ {
3632
+ name: "IVA 12% ",
3633
+ value: "2"
3634
+ },
3635
+ {
3636
+ name: "IVA 15% ",
3637
+ value: "7"
3638
+ },
3639
+ {
3640
+ name: "IVA 5% ",
3641
+ value: "6"
3642
+ },
3643
+ {
3644
+ name: "IVA 5% ",
3645
+ value: "6"
3646
+ },
3647
+ {
3648
+ name: "IVA 14%",
3649
+ value: "3"
3650
+ },
3651
+ {
3652
+ name: "No Objeto de Impuesto",
3653
+ value: "6"
3654
+ },
3655
+ {
3656
+ name: "Exento de IVA",
3657
+ value: "7"
3658
+ }
3659
+ ];
3660
+ return y.map((w) => {
3661
+ var x, A;
3662
+ return {
3663
+ typeTax: ((x = _.find((R) => R.value === w.codImpuestoDocSustento)) == null ? void 0 : x.name) || "",
3664
+ typePor: ((A = g.find((R) => R.value === w.codigoPorcentaje)) == null ? void 0 : A.name) || "",
3665
+ tarifa: w.tarifa,
3666
+ baseImponible: w.baseImponible,
3667
+ valor: w.valorImpuesto
3668
+ };
3669
+ });
3670
+ }
3671
+ const c = P(() => {
3672
+ const y = e.document;
3673
+ if (!y)
3674
+ return [];
3675
+ const _ = y.getElementsByTagName("impuesto"), g = [];
3676
+ for (let O = 0; O < _.length; O++) {
3677
+ const w = _[O], x = {};
3678
+ if (w) {
3679
+ for (let A = 0; A < w.children.length; A++) {
3680
+ const R = w.children[A];
3681
+ R && (x[R.tagName] = R.textContent || "");
3682
+ }
3683
+ g.push(x);
3684
+ }
3685
+ }
3686
+ return g;
3687
+ }), p = P(() => {
3688
+ const y = e.document;
3689
+ if (!y)
3690
+ return [];
3691
+ const _ = y.getElementsByTagName("docSustento"), g = [];
3692
+ for (let O = 0; O < _.length; O++) {
3693
+ const w = _[O], x = {};
3694
+ if (w) {
3695
+ for (let A = 0; A < w.children.length; A++) {
3696
+ const R = w.children[A];
3697
+ if (R && (R.tagName === "impuestosDocSustento" || R.tagName === "retenciones" || R.tagName === "pagos")) {
3698
+ x[R.tagName] = [];
3699
+ for (let Me = 0; Me < R.children.length; Me++) {
3700
+ const je = R.children[Me];
3701
+ if (!je)
3702
+ continue;
3703
+ const St = {};
3704
+ for (let Be = 0; Be < je.children.length; Be++) {
3705
+ const Le = je.children[Be];
3706
+ Le && (St[Le.tagName] = Le.textContent || "");
3707
+ }
3708
+ x[R.tagName].push(St);
3709
+ }
3710
+ } else
3711
+ R && (x[R.tagName] = R.textContent || "");
3712
+ }
3713
+ g.push(x);
3714
+ }
3715
+ }
3716
+ return g;
3717
+ }), E = P(() => {
3718
+ const y = c.value;
3719
+ let _ = 0;
3720
+ return y.forEach((g) => {
3721
+ _ += Number.parseFloat(g.valorRetenido || "0");
3722
+ }), Vt(_, 2);
3723
+ }), m = P(() => {
3724
+ const y = p.value;
3725
+ let _ = 0;
3726
+ return y.forEach((g) => {
3727
+ g.retenciones.forEach((O) => {
3728
+ _ += Number.parseFloat(O.valorRetenido);
3729
+ });
3730
+ }), Vt(_, 2);
3731
+ }), k = P(() => {
3732
+ var w;
3733
+ const y = e.document, _ = y == null ? void 0 : y.getElementsByTagName("infoCompRetencion");
3734
+ if (!_)
3735
+ return {};
3736
+ const g = {}, O = (w = _.item(0)) == null ? void 0 : w.children;
3737
+ if (O)
3738
+ for (let x = 0; x < O.length; x++) {
3739
+ const A = O[x];
3740
+ A != null && A.tagName && (g[A.tagName || "na"] = A.textContent || "");
3741
+ }
3742
+ return g;
3743
+ });
3744
+ return (y, _) => (h(), v("div", jf, [
3745
+ t.authorization ? (h(), v("div", Bf, [
3746
+ a("div", Lf, " Documento autorizado el " + l(t.authorization), 1)
3747
+ ])) : $("", !0),
3748
+ q(Ce, {
3749
+ document: t.document,
3750
+ dateAuthorization: t.authorization
3751
+ }, null, 8, ["document", "dateAuthorization"]),
3752
+ a("div", zf, [
3753
+ a("div", Uf, [
3754
+ a("div", Gf, [
3755
+ _[0] || (_[0] = a("div", { class: "font-bold pr-2" }, " Razón Social / Nombres y Apellidos : ", -1)),
3756
+ a("div", null, l(k.value.razonSocialSujetoRetenido), 1)
3757
+ ]),
3758
+ a("div", Ff, [
3759
+ _[1] || (_[1] = a("div", { class: "font-bold pr-2" }, " Identificación: ", -1)),
3760
+ a("div", null, l(k.value.identificacionSujetoRetenido), 1),
3761
+ a("div", Vf, " (" + l(i(
3762
+ k.value.tipoIdentificacionSujetoRetenido
3763
+ )) + ") ", 1)
3764
+ ]),
3765
+ a("div", Hf, [
3766
+ _[2] || (_[2] = a("div", { class: "font-bold pr-2" }, " FECHA EMISION: ", -1)),
3767
+ a("div", null, l(k.value.fechaEmision), 1),
3768
+ _[3] || (_[3] = a("div", { class: "font-bold pr-2 pl-4" }, " Es obligado a llevar Contablilidad: ", -1)),
3769
+ k.value.obligadoContabilidad ? (h(), v("div", Xf, l(k.value.obligadoContabilidad), 1)) : $("", !0),
3770
+ _[4] || (_[4] = a("div", { class: "font-bold pr-2 pl-4" }, " Parte Relacionada: ", -1)),
3771
+ a("div", null, l(k.value.parteRel ?? "NO"), 1),
3772
+ _[5] || (_[5] = a("div", { class: "font-bold pr-2 pl-4" }, " Periodo Fiscal: ", -1)),
3773
+ k.value.periodoFiscal ? (h(), v("div", qf, l(k.value.periodoFiscal), 1)) : $("", !0)
3774
+ ]),
3775
+ n.value === "2.0.0" ? (h(), v("div", Yf, [
3776
+ (h(!0), v(S, null, I(p.value, (g, O) => {
3777
+ var w;
3778
+ return h(), v("div", {
3779
+ key: O,
3780
+ class: "border border-gray-500 mt-4"
3781
+ }, [
3782
+ _[17] || (_[17] = a("div", { class: "text-center font-bold italic" }, " DATOS DOCUMENTOS DE SUSTENTO V2.0.0 ", -1)),
3783
+ a("div", Jf, [
3784
+ a("div", Zf, [
3785
+ a("div", Wf, [
3786
+ a("div", Qf, l(i(g.codDocSustento, 1)), 1),
3787
+ a("div", Kf, l(b(g.numDocSustento)), 1)
3788
+ ]),
3789
+ g.numAutDocSustento ? (h(), v("div", ed, [
3790
+ _[6] || (_[6] = a("div", { class: "font-bold" }, " Numero Autorización: ", -1)),
3791
+ a("div", null, l(g.numAutDocSustento), 1)
3792
+ ])) : $("", !0)
3793
+ ])
3794
+ ]),
3795
+ a("div", td, [
3796
+ a("div", null, [
3797
+ _[7] || (_[7] = a("div", { class: "font-bold" }, " Fecha Emisión: ", -1)),
3798
+ a("div", nd, l(g.fechaEmisionDocSustento), 1)
3799
+ ]),
3800
+ g.fechaRegistroContable ? (h(), v("div", rd, [
3801
+ _[8] || (_[8] = a("div", { class: "font-bold" }, " Fecha Registro Contable: ", -1)),
3802
+ a("div", od, l(g.fechaRegistroContable), 1)
3803
+ ])) : $("", !0),
3804
+ a("div", null, [
3805
+ _[9] || (_[9] = a("div", { class: "font-bold" }, " Pago a Residente: ", -1)),
3806
+ a("div", ad, l(g.pagoLocExt === "01" ? "SI" : "NO"), 1)
3807
+ ]),
3808
+ a("div", null, [
3809
+ _[10] || (_[10] = a("div", { class: "font-bold" }, " Total Sin impuestos: ", -1)),
3810
+ a("div", id, l(g.totalSinImpuestos), 1)
3811
+ ]),
3812
+ a("div", null, [
3813
+ _[11] || (_[11] = a("div", { class: "font-bold" }, " Importe Total: ", -1)),
3814
+ a("div", ud, l(g.importeTotal), 1)
3815
+ ])
3816
+ ]),
3817
+ a("div", ld, [
3818
+ a("div", cd, [
3819
+ _[13] || (_[13] = a("div", { class: "text-center" }, " FORMAS DE PAGOS ", -1)),
3820
+ g.pagos.pago ? (h(), v("table", fd, [
3821
+ _[12] || (_[12] = a("thead", null, [
3822
+ a("tr", null, [
3823
+ a("th", { class: "border" }, " TIPO "),
3824
+ a("th", { class: "border" }, " VALOR "),
3825
+ a("th", { class: "border" }, " PAZO "),
3826
+ a("th", { class: "border" }, " TIEMPO ")
3827
+ ])
3828
+ ], -1)),
3829
+ a("tbody", null, [
3830
+ (h(!0), v(S, null, I(f(
3831
+ g.pagos.pago
3832
+ ), (x, A) => (h(), v("tr", { key: A }, [
3833
+ a("td", dd, l(x.formaPago), 1),
3834
+ a("td", sd, l(x.total), 1),
3835
+ a("td", hd, l(x.plazo), 1),
3836
+ a("td", vd, l(x.unidadTiempo), 1)
3837
+ ]))), 128))
3838
+ ])
3839
+ ])) : $("", !0)
3840
+ ]),
3841
+ a("div", _d, [
3842
+ _[14] || (_[14] = a("div", { class: "text-center" }, " Detalle Impuestos Doc de Sustento ", -1)),
3843
+ (w = g == null ? void 0 : g.pagos) != null && w.pago ? (h(), v("table", pd, [
3844
+ a("tbody", null, [
3845
+ (h(!0), v(S, null, I(s(
3846
+ g.impuestosDocSustento.impuestoDocSustento
3847
+ ), (x, A) => (h(), v("tr", { key: A }, [
3848
+ a("td", gd, l(x.typePor), 1),
3849
+ a("td", yd, l(x.baseImponible), 1),
3850
+ a("td", bd, l(x.valor), 1)
3851
+ ]))), 128))
3852
+ ])
3853
+ ])) : $("", !0)
3854
+ ])
3855
+ ]),
3856
+ a("div", null, [
3857
+ a("div", md, [
3858
+ a("div", Ed, [
3859
+ a("table", Od, [
3860
+ a("thead", null, [
3861
+ a("tr", null, [
3862
+ a("td", {
3863
+ class: "text-center font-bold",
3864
+ colspan: d().length
3865
+ }, " DETALLES DE LA RETENCION ", 8, xd)
3866
+ ]),
3867
+ a("tr", null, [
3868
+ (h(!0), v(S, null, I(d(), (x, A) => (h(), v("th", {
3869
+ key: A,
3870
+ class: "border"
3871
+ }, l(x), 1))), 128))
3872
+ ])
3873
+ ]),
3874
+ a("tbody", null, [
3875
+ (h(!0), v(S, null, I(g.retenciones, (x, A) => (h(), v("tr", { key: A }, [
3876
+ a("td", $d, l(A + 1), 1),
3877
+ a("td", wd, l(i(x.codigo, 2)), 1),
3878
+ a("td", Ad, l(o(x.codigoRetencion)), 1),
3879
+ a("td", Sd, " %" + l(x.porcentajeRetener), 1),
3880
+ a("td", Td, l(x.baseImponible), 1),
3881
+ a("td", Rd, l(x.valorRetenido), 1)
3882
+ ]))), 128)),
3883
+ a("tr", null, [
3884
+ _[16] || (_[16] = a("td", { colspan: "5" }, null, -1)),
3885
+ a("td", Dd, [
3886
+ _[15] || (_[15] = B(" TOTAL RETENIDO ", -1)),
3887
+ a("span", Id, l(D(bn)(m.value)), 1)
3888
+ ])
3889
+ ])
3890
+ ])
3891
+ ])
3892
+ ])
3893
+ ])
3894
+ ])
3895
+ ]);
3896
+ }), 128))
3897
+ ])) : $("", !0),
3898
+ n.value === "1.0.0" ? (h(), v("div", kd, [
3899
+ a("div", Pd, [
3900
+ a("table", Nd, [
3901
+ a("thead", null, [
3902
+ a("tr", null, [
3903
+ a("td", {
3904
+ class: "text-center font-bold",
3905
+ colspan: u().length
3906
+ }, " DETALLES DE LA RETENCION V1 ", 8, Cd)
3907
+ ]),
3908
+ a("tr", null, [
3909
+ (h(!0), v(S, null, I(u(), (g, O) => (h(), v("th", {
3910
+ key: O,
3911
+ class: "border"
3912
+ }, l(g), 1))), 128))
3913
+ ])
3914
+ ]),
3915
+ a("tbody", null, [
3916
+ (h(!0), v(S, null, I(c.value, (g, O) => (h(), v("tr", { key: O }, [
3917
+ a("td", Md, l(i(g.codDocSustento, 1)), 1),
3918
+ a("td", jd, l(b(g.numDocSustento)), 1),
3919
+ a("td", Bd, l(g.fechaEmisionDocSustento), 1),
3920
+ a("td", Ld, l(k.value.periodoFiscal), 1),
3921
+ a("td", zd, l(g.baseImponible), 1),
3922
+ a("td", Ud, l(i(g.codigo, 2)) + " " + l(g.codigoRetencion), 1),
3923
+ a("td", Gd, " %" + l(g.porcentajeRetener), 1),
3924
+ a("td", Fd, l(g.valorRetenido), 1)
3925
+ ]))), 128)),
3926
+ a("tr", null, [
3927
+ _[19] || (_[19] = a("td", { colspan: "7" }, null, -1)),
3928
+ a("td", Vd, [
3929
+ _[18] || (_[18] = B(" TOTAL RETENIDO ", -1)),
3930
+ a("span", Hd, l(E.value), 1)
3931
+ ])
3932
+ ])
3933
+ ])
3934
+ ])
3935
+ ])
3936
+ ])) : $("", !0),
3937
+ a("div", Xd, [
3938
+ a("div", qd, [
3939
+ _[20] || (_[20] = a("div", { class: "text-center text-lg font-bold" }, " INFORMACIÓN ADICIONAL ", -1)),
3940
+ a("div", null, [
3941
+ D(r) ? (h(), v("table", Yd, [
3942
+ a("tbody", null, [
3943
+ (h(!0), v(S, null, I(D(r), (g, O) => (h(), v("tr", { key: O }, [
3944
+ a("td", Jd, l(g.name), 1),
3945
+ a("td", Zd, l(g.value), 1)
3946
+ ]))), 128))
3947
+ ])
3948
+ ])) : $("", !0)
3949
+ ])
3950
+ ])
3951
+ ])
3952
+ ])
3953
+ ])
3954
+ ]));
3955
+ }
3956
+ }), Qd = { class: "w-full" }, Kd = {
3957
+ key: 0,
3958
+ class: "p-6 text-center bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 rounded-xl"
3959
+ }, es = { class: "text-sm text-red-600 dark:text-red-300" }, ts = { key: 1 }, os = /* @__PURE__ */ V({
3960
+ __name: "VisorXml",
3961
+ props: {
3962
+ xml: {},
3963
+ logoUrl: {}
3964
+ },
3965
+ setup(t) {
3966
+ const e = t, n = Ee(null), r = Ee("");
3967
+ return $n(() => {
3968
+ if (!(typeof window > "u") && e.xml)
3969
+ try {
3970
+ n.value = In(e.xml), r.value = "";
3971
+ } catch (o) {
3972
+ r.value = o.message || "Error al procesar el XML", console.error(o);
3973
+ }
3974
+ }), Ee(!1), (o, i) => (h(), v("div", Qd, [
3975
+ r.value ? (h(), v("div", Kd, [
3976
+ i[0] || (i[0] = a("div", { class: "inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-100 dark:bg-red-900/40 text-red-600 dark:text-red-400 mb-3" }, [
3977
+ a("svg", {
3978
+ class: "w-6 h-6",
3979
+ fill: "none",
3980
+ viewBox: "0 0 24 24",
3981
+ stroke: "currentColor"
3982
+ }, [
3983
+ a("path", {
3984
+ "stroke-linecap": "round",
3985
+ "stroke-linejoin": "round",
3986
+ "stroke-width": "2",
3987
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
3988
+ })
3989
+ ])
3990
+ ], -1)),
3991
+ i[1] || (i[1] = a("h4", { class: "text-base font-bold text-red-800 dark:text-red-400 mb-1" }, " Error al procesar el comprobante ", -1)),
3992
+ a("p", es, l(r.value), 1)
3993
+ ])) : n.value ? (h(), v("div", ts, [
3994
+ n.value.typeDoc === "01" ? (h(), _e(Gc, {
3995
+ key: 0,
3996
+ document: n.value.documentData,
3997
+ logoUrl: t.logoUrl,
3998
+ dateAuthorization: n.value.dateAuthorization
3999
+ }, null, 8, ["document", "logoUrl", "dateAuthorization"])) : n.value.typeDoc === "04" ? (h(), _e(sf, {
4000
+ key: 1,
4001
+ document: n.value.documentData,
4002
+ logoUrl: t.logoUrl,
4003
+ authorization: n.value.dateAuthorization
4004
+ }, null, 8, ["document", "logoUrl", "authorization"])) : n.value.typeDoc === "06" ? (h(), _e(Mf, {
4005
+ key: 2,
4006
+ document: n.value.documentData,
4007
+ logoUrl: t.logoUrl,
4008
+ authorization: n.value.dateAuthorization
4009
+ }, null, 8, ["document", "logoUrl", "authorization"])) : n.value.typeDoc === "07" ? (h(), _e(Wd, {
4010
+ key: 3,
4011
+ document: n.value.documentData,
4012
+ authorization: n.value.dateAuthorization
4013
+ }, null, 8, ["document", "authorization"])) : $("", !0)
4014
+ ])) : $("", !0)
4015
+ ]));
4016
+ }
4017
+ });
4018
+ export {
4019
+ os as VisorXml,
4020
+ Gc as facturaSri,
4021
+ Mf as guiaRemisionSri,
4022
+ Ce as headDocSri,
4023
+ sf as notaCreditoSri,
4024
+ Wd as retencionSri
4025
+ };