@danidoble/webserial 4.0.6 → 4.0.7

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/webserial.js CHANGED
@@ -1,40 +1,40 @@
1
- var pn = Object.defineProperty;
1
+ var _n = Object.defineProperty;
2
2
  var Me = (f) => {
3
3
  throw TypeError(f);
4
4
  };
5
- var _n = (f, r, t) => r in f ? pn(f, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : f[r] = t;
6
- var A = (f, r, t) => _n(f, typeof r != "symbol" ? r + "" : r, t), be = (f, r, t) => r.has(f) || Me("Cannot " + t);
7
- var y = (f, r, t) => (be(f, r, "read from private field"), t ? t.call(f) : r.get(f)), S = (f, r, t) => r.has(f) ? Me("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(f) : r.set(f, t), g = (f, r, t, e) => (be(f, r, "write to private field"), e ? e.call(f, t) : r.set(f, t), t), i = (f, r, t) => (be(f, r, "access private method"), t);
5
+ var fn = (f, r, t) => r in f ? _n(f, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : f[r] = t;
6
+ var B = (f, r, t) => fn(f, typeof r != "symbol" ? r + "" : r, t), be = (f, r, t) => r.has(f) || Me("Cannot " + t);
7
+ var w = (f, r, t) => (be(f, r, "read from private field"), t ? t.call(f) : r.get(f)), S = (f, r, t) => r.has(f) ? Me("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(f) : r.set(f, t), g = (f, r, t, e) => (be(f, r, "write to private field"), e ? e.call(f, t) : r.set(f, t), t), i = (f, r, t) => (be(f, r, "access private method"), t);
8
8
  var M = [];
9
9
  for (var ye = 0; ye < 256; ++ye)
10
10
  M.push((ye + 256).toString(16).slice(1));
11
- function fn(f, r = 0) {
11
+ function bn(f, r = 0) {
12
12
  return (M[f[r + 0]] + M[f[r + 1]] + M[f[r + 2]] + M[f[r + 3]] + "-" + M[f[r + 4]] + M[f[r + 5]] + "-" + M[f[r + 6]] + M[f[r + 7]] + "-" + M[f[r + 8]] + M[f[r + 9]] + "-" + M[f[r + 10]] + M[f[r + 11]] + M[f[r + 12]] + M[f[r + 13]] + M[f[r + 14]] + M[f[r + 15]]).toLowerCase();
13
13
  }
14
- var te, bn = new Uint8Array(16);
15
- function yn() {
14
+ var te, yn = new Uint8Array(16);
15
+ function wn() {
16
16
  if (!te && (te = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !te))
17
17
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
18
- return te(bn);
18
+ return te(yn);
19
19
  }
20
- var wn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
20
+ var kn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
21
21
  const Fe = {
22
- randomUUID: wn
22
+ randomUUID: kn
23
23
  };
24
- function kn(f, r, t) {
24
+ function vn(f, r, t) {
25
25
  if (Fe.randomUUID && !r && !f)
26
26
  return Fe.randomUUID();
27
27
  f = f || {};
28
- var e = f.random || (f.rng || yn)();
29
- return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, fn(e);
28
+ var e = f.random || (f.rng || wn)();
29
+ return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, bn(e);
30
30
  }
31
31
  class Pe extends EventTarget {
32
32
  constructor() {
33
33
  super(...arguments);
34
- A(this, "__listeners__", {});
34
+ B(this, "__listeners__", {});
35
35
  }
36
36
  dispatch(t, e = null) {
37
- const n = new vn(t, { detail: e });
37
+ const n = new mn(t, { detail: e });
38
38
  this.dispatchEvent(n);
39
39
  }
40
40
  dispatchAsync(t, e = null, n = 100) {
@@ -59,7 +59,7 @@ class Pe extends EventTarget {
59
59
  }));
60
60
  }
61
61
  }
62
- class vn extends CustomEvent {
62
+ class mn extends CustomEvent {
63
63
  constructor(r, t) {
64
64
  super(r, t);
65
65
  }
@@ -67,24 +67,24 @@ class vn extends CustomEvent {
67
67
  function W(f = 100) {
68
68
  return new Promise((r) => setTimeout(() => r(), f));
69
69
  }
70
- function Be() {
70
+ function Ae() {
71
71
  return "serial" in navigator;
72
72
  }
73
73
  function we(f = 1) {
74
74
  return f * 1e3;
75
75
  }
76
- var R, H, o, Ae, Ne, _, ke, x, m, ne, p, ve, Y;
76
+ var R, L, o, Be, Ne, _, ke, x, m, ne, p, ve, K;
77
77
  const a = class a {
78
78
  static status(r = null) {
79
79
  var e, n;
80
80
  if (!i(e = a, o, _).call(e, r)) return !1;
81
81
  let t = [];
82
- switch (y(a, R)) {
82
+ switch (w(a, R)) {
83
83
  case "locker":
84
84
  t = ["0", "8"];
85
85
  break;
86
86
  case "boardroid":
87
- t = ["2", (5 + y(a, H)).toString(16).toUpperCase()];
87
+ t = ["2", (5 + w(a, L)).toString(16).toUpperCase()];
88
88
  break;
89
89
  case "jofemar":
90
90
  t = ["6"];
@@ -98,7 +98,7 @@ const a = class a {
98
98
  var e, n;
99
99
  if (!i(e = a, o, _).call(e, r)) return !1;
100
100
  let t = [];
101
- switch (y(a, R)) {
101
+ switch (w(a, R)) {
102
102
  case "locker":
103
103
  t = ["0", "7", "4", "4", "4"];
104
104
  break;
@@ -117,7 +117,7 @@ const a = class a {
117
117
  var e, n;
118
118
  if (!i(e = a, o, _).call(e, r)) return !1;
119
119
  let t = [];
120
- switch (y(a, R)) {
120
+ switch (w(a, R)) {
121
121
  case "locker":
122
122
  t = ["0", "7", "5", "5", "5"];
123
123
  break;
@@ -145,15 +145,15 @@ const a = class a {
145
145
  static keyPressed(r = null) {
146
146
  var s, c, u;
147
147
  if (!i(s = a, o, _).call(s, r) || !i(c = a, o, m).call(c)) return !1;
148
- const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], e = (128 + y(a, H)).toString(16), n = Math.floor(Math.random() * 15);
148
+ const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], e = (128 + w(a, L)).toString(16), n = Math.floor(Math.random() * 15);
149
149
  i(u = a, o, p).call(u, ["2", e, "54", t[n]]);
150
150
  }
151
151
  static doorOpened(r = null) {
152
152
  var n, s;
153
153
  if (!i(n = a, o, _).call(n, r) || !i(this, o, ne).call(this)) return !1;
154
154
  let t = [];
155
- const e = (128 + y(a, H)).toString(16);
156
- switch (y(a, R)) {
155
+ const e = (128 + w(a, L)).toString(16);
156
+ switch (w(a, R)) {
157
157
  case "boardroid":
158
158
  t = ["2", "D8", "dc"];
159
159
  break;
@@ -167,8 +167,8 @@ const a = class a {
167
167
  var n, s;
168
168
  if (!i(n = a, o, _).call(n, r) || !i(this, o, ne).call(this)) return !1;
169
169
  let t = [];
170
- const e = (128 + y(a, H)).toString(16);
171
- switch (y(a, R)) {
170
+ const e = (128 + w(a, L)).toString(16);
171
+ switch (w(a, R)) {
172
172
  case "boardroid":
173
173
  t = ["2", "D8", "db"];
174
174
  break;
@@ -181,33 +181,33 @@ const a = class a {
181
181
  static channelDisconnected(r = null) {
182
182
  var e, n, s;
183
183
  if (!i(e = a, o, _).call(e, r) || !i(n = a, o, m).call(n)) return !1;
184
- const t = (128 + y(a, H)).toString(16);
184
+ const t = (128 + w(a, L)).toString(16);
185
185
  i(s = a, o, p).call(s, ["2", t, "43", "43", "43", "FD"]);
186
186
  }
187
187
  static channelConnected(r = null) {
188
188
  var e, n, s;
189
189
  if (!i(e = a, o, _).call(e, r) || !i(n = a, o, m).call(n)) return !1;
190
- const t = (128 + y(a, H)).toString(16);
190
+ const t = (128 + w(a, L)).toString(16);
191
191
  i(s = a, o, p).call(s, ["2", t, "43", "43", "43", "FC"]);
192
192
  }
193
193
  static channelEmpty(r = null) {
194
194
  var e, n, s;
195
195
  if (!i(e = a, o, _).call(e, r) || !i(n = a, o, m).call(n)) return !1;
196
- const t = (128 + y(a, H)).toString(16);
196
+ const t = (128 + w(a, L)).toString(16);
197
197
  i(s = a, o, p).call(s, ["2", t, "43", "43", "43", "FF"]);
198
198
  }
199
199
  static workingTemperature(r = null) {
200
200
  var e, n, s;
201
201
  if (!i(e = a, o, _).call(e, r) || !i(n = a, o, m).call(n)) return !1;
202
- const t = (128 + y(a, H)).toString(16);
202
+ const t = (128 + w(a, L)).toString(16);
203
203
  i(s = a, o, p).call(s, ["2", t, "43", "54", "16"]);
204
204
  }
205
205
  static currentTemperature(r = null) {
206
206
  var n, s, c;
207
207
  if (!i(n = a, o, _).call(n, r) || !i(s = a, o, ne).call(s)) return !1;
208
208
  let t = [];
209
- const e = (128 + y(a, H)).toString(16);
210
- switch (y(a, R)) {
209
+ const e = (128 + w(a, L)).toString(16);
210
+ switch (w(a, R)) {
211
211
  case "boardroid":
212
212
  t = ["2", "D9", "44", "30"];
213
213
  break;
@@ -377,25 +377,25 @@ const a = class a {
377
377
  static banknoteInsertedStacker(r = null, t = null) {
378
378
  var s, c, u, h;
379
379
  if (!i(s = a, o, _).call(s, r) || !i(c = a, o, x).call(c)) return !1;
380
- const e = ["80", "81", "82", "83", "84"], n = i(u = a, o, Y).call(u, e, t);
380
+ const e = ["80", "81", "82", "83", "84"], n = i(u = a, o, K).call(u, e, t);
381
381
  i(h = a, o, p).call(h, ["2", "B0", n]);
382
382
  }
383
383
  static banknoteInsertedEscrow(r = null, t = null) {
384
384
  var s, c, u, h;
385
385
  if (!i(s = a, o, _).call(s, r) || !i(c = a, o, x).call(c)) return !1;
386
- const e = ["90", "91", "92", "93", "94"], n = i(u = a, o, Y).call(u, e, t);
386
+ const e = ["90", "91", "92", "93", "94"], n = i(u = a, o, K).call(u, e, t);
387
387
  i(h = a, o, p).call(h, ["2", "B0", n]);
388
388
  }
389
389
  static banknoteEjected(r = null, t = null) {
390
390
  var s, c, u, h;
391
391
  if (!i(s = a, o, _).call(s, r) || !i(c = a, o, x).call(c)) return !1;
392
- const e = ["A0", "A1", "A2", "A3", "A4"], n = i(u = a, o, Y).call(u, e, t);
392
+ const e = ["A0", "A1", "A2", "A3", "A4"], n = i(u = a, o, K).call(u, e, t);
393
393
  i(h = a, o, p).call(h, ["2", "B0", n]);
394
394
  }
395
395
  static banknoteInsertedRecycler(r = null, t = null) {
396
396
  var s, c, u, h;
397
397
  if (!i(s = a, o, _).call(s, r) || !i(c = a, o, x).call(c)) return !1;
398
- const e = ["B0", "B1", "B2", "B3", "B4"], n = i(u = a, o, Y).call(u, e, t);
398
+ const e = ["B0", "B1", "B2", "B3", "B4"], n = i(u = a, o, K).call(u, e, t);
399
399
  i(h = a, o, p).call(h, ["2", "B0", n]);
400
400
  }
401
401
  static banknoteTaken(r = null) {
@@ -615,26 +615,26 @@ const a = class a {
615
615
  r.__internal__.serial.connected = !0;
616
616
  }
617
617
  };
618
- R = new WeakMap(), H = new WeakMap(), o = new WeakSet(), Ae = function() {
618
+ R = new WeakMap(), L = new WeakMap(), o = new WeakSet(), Be = function() {
619
619
  if (a.enable === !1) throw new Error("Emulator is disabled");
620
620
  return a.enable;
621
621
  }, Ne = function(r) {
622
- if (typeof r != "object" || !(r instanceof G)) throw new Error(`Type ${r.typeDevice} is not supported`);
623
- return a.instance = r, g(a, R, r.typeDevice), g(a, H, r.deviceNumber), !0;
622
+ if (typeof r != "object" || !(r instanceof Y)) throw new Error(`Type ${r.typeDevice} is not supported`);
623
+ return a.instance = r, g(a, R, r.typeDevice), g(a, L, r.deviceNumber), !0;
624
624
  }, _ = function(r = null) {
625
625
  var t, e;
626
- return !i(t = a, o, Ae).call(t) || r === null && a.instance === null ? !1 : (a.instance === null && i(e = a, o, Ne).call(e, r), !0);
626
+ return !i(t = a, o, Be).call(t) || r === null && a.instance === null ? !1 : (a.instance === null && i(e = a, o, Ne).call(e, r), !0);
627
627
  }, ke = function() {
628
- if (y(a, R) !== "locker") throw new Error("This function is only available for Locker devices");
628
+ if (w(a, R) !== "locker") throw new Error("This function is only available for Locker devices");
629
629
  return !0;
630
630
  }, x = function() {
631
- if (y(a, R) !== "boardroid") throw new Error("This function is only available for Boardroid devices");
631
+ if (w(a, R) !== "boardroid") throw new Error("This function is only available for Boardroid devices");
632
632
  return !0;
633
633
  }, m = function() {
634
- if (y(a, R) !== "jofemar") throw new Error("This function is only available for Jofemar devices");
634
+ if (w(a, R) !== "jofemar") throw new Error("This function is only available for Jofemar devices");
635
635
  return !0;
636
636
  }, ne = function() {
637
- if (y(a, R) === "locker") throw new Error("This function is not available for Locker devices");
637
+ if (w(a, R) === "locker") throw new Error("This function is not available for Locker devices");
638
638
  return !0;
639
639
  }, p = function(r) {
640
640
  a.instance.__emulate({ code: r });
@@ -659,7 +659,7 @@ R = new WeakMap(), H = new WeakMap(), o = new WeakSet(), Ae = function() {
659
659
  break;
660
660
  }
661
661
  return e;
662
- }, Y = function(r, t = null) {
662
+ }, K = function(r, t = null) {
663
663
  let e = r[Math.floor(Math.random() * 4)];
664
664
  if (t !== null && !isNaN(parseFloat(t)))
665
665
  switch (t.toString()) {
@@ -680,76 +680,76 @@ R = new WeakMap(), H = new WeakMap(), o = new WeakSet(), Ae = function() {
680
680
  break;
681
681
  }
682
682
  return e;
683
- }, S(a, o), A(a, "enable", !1), A(a, "instance", null), S(a, R, null), S(a, H, 1);
683
+ }, S(a, o), B(a, "enable", !1), B(a, "instance", null), S(a, R, null), S(a, L, 1);
684
684
  let pe = a;
685
- const k = class k extends Pe {
685
+ const v = class v extends Pe {
686
686
  static typeError(r) {
687
687
  const t = new Error();
688
688
  throw t.message = `Type ${r} is not supported`, t.name = "DeviceTypeError", t;
689
689
  }
690
690
  static addCustom(r, t) {
691
- typeof k.devices[r] > "u" && (k.devices[r] = []), k.add(t);
691
+ typeof v.devices[r] > "u" && (v.devices[r] = []), v.add(t);
692
692
  }
693
693
  static add(r) {
694
694
  const t = r.typeDevice, e = r.uuid;
695
- if (typeof k.devices[t] > "u") return k.typeError(t);
696
- if (this.instance.dispatch("change", k.devices), !k.devices[t][e])
697
- return k.devices[t][e] = r, this.instance.dispatch("change", k.devices), k.devices[t].indexOf(r);
695
+ if (typeof v.devices[t] > "u") return v.typeError(t);
696
+ if (this.instance.dispatch("change", v.devices), !v.devices[t][e])
697
+ return v.devices[t][e] = r, this.instance.dispatch("change", v.devices), v.devices[t].indexOf(r);
698
698
  }
699
699
  static get(r, t) {
700
- return typeof k.devices[r] > "u" ? k.typeError(r) : k.devices[r][t];
700
+ return typeof v.devices[r] > "u" ? v.typeError(r) : v.devices[r][t];
701
701
  }
702
702
  static getJofemarByUuid(r) {
703
- return k.get("jofemar", r);
703
+ return v.get("jofemar", r);
704
704
  }
705
705
  static getLockerByUuid(r) {
706
- return k.get("locker", r);
706
+ return v.get("locker", r);
707
707
  }
708
708
  static getRelayByUuid(r) {
709
- return k.get("relay", r);
709
+ return v.get("relay", r);
710
710
  }
711
711
  static getBoardroidByUuid(r) {
712
- return k.get("boardroid", r);
712
+ return v.get("boardroid", r);
713
713
  }
714
714
  static getArduinoByUuid(r) {
715
- return k.get("arduino", r);
715
+ return v.get("arduino", r);
716
716
  }
717
717
  static getAll(r = null) {
718
- return r === null ? k.devices : typeof k.devices[r] > "u" ? k.typeError(r) : k.devices[r];
718
+ return r === null ? v.devices : typeof v.devices[r] > "u" ? v.typeError(r) : v.devices[r];
719
719
  }
720
720
  static getList() {
721
- return Object.values(k.devices).map((t) => Object.values(t)).flat();
721
+ return Object.values(v.devices).map((t) => Object.values(t)).flat();
722
722
  }
723
723
  static getJofemar(r = 1) {
724
- return Object.values(k.devices.jofemar).find((e) => e.deviceNumber === r) ?? null;
724
+ return Object.values(v.devices.jofemar).find((e) => e.deviceNumber === r) ?? null;
725
725
  }
726
726
  static getBoardroid(r = 1) {
727
- return Object.values(k.devices.boardroid).find((e) => e.deviceNumber === r) ?? null;
727
+ return Object.values(v.devices.boardroid).find((e) => e.deviceNumber === r) ?? null;
728
728
  }
729
729
  static getLocker(r = 1) {
730
- return Object.values(k.devices.locker).find((e) => e.deviceNumber === r) ?? null;
730
+ return Object.values(v.devices.locker).find((e) => e.deviceNumber === r) ?? null;
731
731
  }
732
732
  static getRelay(r = 1) {
733
- return Object.values(k.devices.relay).find((e) => e.deviceNumber === r) ?? null;
733
+ return Object.values(v.devices.relay).find((e) => e.deviceNumber === r) ?? null;
734
734
  }
735
735
  static getArduino(r = 1) {
736
- return Object.values(k.devices.arduino).find((e) => e.deviceNumber === r) ?? null;
736
+ return Object.values(v.devices.arduino).find((e) => e.deviceNumber === r) ?? null;
737
737
  }
738
738
  static getCustom(r, t = 1) {
739
- return typeof k.devices[r] > "u" ? k.typeError(r) : Object.values(k.devices[r]).find((n) => n.deviceNumber === t) ?? null;
739
+ return typeof v.devices[r] > "u" ? v.typeError(r) : Object.values(v.devices[r]).find((n) => n.deviceNumber === t) ?? null;
740
740
  }
741
741
  };
742
- A(k, "instance", null), A(k, "devices", {
742
+ B(v, "instance", null), B(v, "devices", {
743
743
  relay: [],
744
744
  locker: [],
745
745
  jofemar: [],
746
746
  boardroid: [],
747
747
  arduino: []
748
748
  });
749
- let D = k;
749
+ let D = v;
750
750
  D.instance || (D.instance = new D());
751
- var w, qe, me, Q, Re, He, Le, Oe, Ue, je, We, Qe, Ve, Je, ze, $e;
752
- class G extends Pe {
751
+ var k, qe, me, Q, Re, Le, He, Oe, Ue, je, We, Qe, Ve, Je, ze, Ge;
752
+ class Y extends Pe {
753
753
  /**
754
754
  *
755
755
  * @param {null|array} filters
@@ -764,8 +764,8 @@ class G extends Pe {
764
764
  device_listen_on_port: s = 1
765
765
  } = {}) {
766
766
  super();
767
- S(this, w);
768
- A(this, "__internal__", {
767
+ S(this, k);
768
+ B(this, "__internal__", {
769
769
  device_number: 1,
770
770
  aux_port_connector: 0,
771
771
  last_error: { message: null, action: null, code: null, no_code: 0 },
@@ -798,7 +798,7 @@ class G extends Pe {
798
798
  },
799
799
  device: {
800
800
  type: "unknown",
801
- id: kn(),
801
+ id: vn(),
802
802
  listen_on_port: null,
803
803
  door_open: !1
804
804
  },
@@ -825,7 +825,7 @@ class G extends Pe {
825
825
  backup_dispense: {}
826
826
  }
827
827
  });
828
- t && (this.serialFilters = t), e && (this.serialConfigPort = e), n && i(this, w, ze).call(this, n), s && (typeof s == "number" || typeof s == "string") && (this.listenOnPort = s), i(this, w, We).call(this), i(this, w, Qe).call(this);
828
+ t && (this.serialFilters = t), e && (this.serialConfigPort = e), n && i(this, k, ze).call(this, n), s && (typeof s == "number" || typeof s == "string") && (this.listenOnPort = s), i(this, k, We).call(this), i(this, k, Qe).call(this);
829
829
  }
830
830
  set listenOnPort(t) {
831
831
  if (t = parseInt(t), isNaN(t) || t < 1 || t > 255) throw new Error("Invalid port number");
@@ -882,7 +882,7 @@ class G extends Pe {
882
882
  }
883
883
  async connect() {
884
884
  return new Promise((t, e) => {
885
- Be() || e("Web Serial not supported"), setTimeout(async () => {
885
+ Ae() || e("Web Serial not supported"), setTimeout(async () => {
886
886
  await W(499), await this.serialConnect(), this.isConnected ? t(`${this.typeDevice} device ${this.deviceNumber} connected`) : e(`${this.typeDevice} device ${this.deviceNumber} not connected`);
887
887
  }, 1);
888
888
  });
@@ -952,7 +952,7 @@ class G extends Pe {
952
952
  async serialConnect() {
953
953
  try {
954
954
  this.dispatch("serial:connecting", {});
955
- const t = await i(this, w, Re).call(this);
955
+ const t = await i(this, k, Re).call(this);
956
956
  if (t.length > 0)
957
957
  await this.serialPortsSaved(t);
958
958
  else {
@@ -968,16 +968,16 @@ class G extends Pe {
968
968
  await n.disconnect(s.detail ?? null);
969
969
  }, await W(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
970
970
  await n.timeout(n.__internal__.serial.bytes_connection, "connection:start");
971
- }, this.__internal__.time.response_connection), await i(this, w, me).call(this, this.__internal__.serial.bytes_connection), this.dispatch("serial:sent", {
971
+ }, this.__internal__.time.response_connection), await i(this, k, me).call(this, this.__internal__.serial.bytes_connection), this.dispatch("serial:sent", {
972
972
  action: "connect",
973
973
  bytes: this.__internal__.serial.bytes_connection
974
- }), this.typeDevice === "relay" && i(this, w, Q).call(this, ["DD", "DD"], null), await i(this, w, Ue).call(this);
974
+ }), this.typeDevice === "relay" && i(this, k, Q).call(this, ["DD", "DD"], null), await i(this, k, Ue).call(this);
975
975
  } catch (t) {
976
976
  this.serialErrors(t);
977
977
  }
978
978
  }
979
979
  async serialForget() {
980
- return await i(this, w, je).call(this);
980
+ return await i(this, k, je).call(this);
981
981
  }
982
982
  decToHex(t) {
983
983
  return parseInt(t, 10).toString(16);
@@ -1112,7 +1112,7 @@ class G extends Pe {
1112
1112
  });
1113
1113
  }
1114
1114
  softReload() {
1115
- i(this, w, $e).call(this), this.dispatch("serial:soft-reload", {});
1115
+ i(this, k, Ge).call(this), this.dispatch("serial:soft-reload", {});
1116
1116
  }
1117
1117
  async sendConnect() {
1118
1118
  await this.appendToQueue(this.__internal__.serial.bytes_connection, "connect");
@@ -1121,7 +1121,7 @@ class G extends Pe {
1121
1121
  await this.appendToQueue(t, "custom");
1122
1122
  }
1123
1123
  }
1124
- w = new WeakSet(), qe = function(t) {
1124
+ k = new WeakSet(), qe = function(t) {
1125
1125
  return !!(t.readable && t.writable);
1126
1126
  }, me = async function(t) {
1127
1127
  const e = this.__internal__.serial.port;
@@ -1150,26 +1150,26 @@ Q = function(t = [], e = null) {
1150
1150
  return t.length === 0 ? e : e.filter((s) => {
1151
1151
  const c = s.getInfo();
1152
1152
  return t.some((u) => c.usbProductId === u.usbProductId && c.usbVendorId === u.usbVendorId);
1153
- }).filter((s) => !i(this, w, qe).call(this, s));
1154
- }, He = function(t) {
1153
+ }).filter((s) => !i(this, k, qe).call(this, s));
1154
+ }, Le = function(t) {
1155
1155
  if (t) {
1156
1156
  const e = this.__internal__.serial.response.buffer;
1157
1157
  let n = new Uint8Array(e.length + t.byteLength);
1158
1158
  n.set(e, 0), n.set(new Uint8Array(t), e.length), this.__internal__.serial.response.buffer = n;
1159
1159
  }
1160
- }, Le = async function() {
1160
+ }, He = async function() {
1161
1161
  this.__internal__.serial.time_until_send_bytes && (clearTimeout(this.__internal__.serial.time_until_send_bytes), this.__internal__.serial.time_until_send_bytes = 0), this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
1162
1162
  let t = [];
1163
1163
  for (const e in this.__internal__.serial.response.buffer)
1164
1164
  t.push(this.__internal__.serial.response.buffer[e].toString(16));
1165
- this.__internal__.serial.response.buffer && i(this, w, Q).call(this, t), this.__internal__.serial.response.buffer = new Uint8Array(0);
1165
+ this.__internal__.serial.response.buffer && i(this, k, Q).call(this, t), this.__internal__.serial.response.buffer = new Uint8Array(0);
1166
1166
  }, 400);
1167
1167
  }, Oe = async function() {
1168
1168
  if (this.__internal__.serial.response.length === this.__internal__.serial.response.buffer.length) {
1169
1169
  const t = [];
1170
1170
  for (const e in this.__internal__.serial.response.buffer)
1171
1171
  t.push(this.__internal__.serial.response.buffer[e].toString(16));
1172
- await i(this, w, Q).call(this, t), this.__internal__.serial.response.buffer = new Uint8Array(0);
1172
+ await i(this, k, Q).call(this, t), this.__internal__.serial.response.buffer = new Uint8Array(0);
1173
1173
  } else if (this.__internal__.serial.response.length < this.__internal__.serial.response.buffer.length) {
1174
1174
  let t = [];
1175
1175
  for (let n = 0; n < this.__internal__.serial.response.length; n++)
@@ -1178,7 +1178,7 @@ Q = function(t = [], e = null) {
1178
1178
  const n = [];
1179
1179
  for (const s in t)
1180
1180
  n.push(t[s].toString(16));
1181
- await i(this, w, Q).call(this, n), this.__internal__.serial.response.buffer = new Uint8Array(0);
1181
+ await i(this, k, Q).call(this, n), this.__internal__.serial.response.buffer = new Uint8Array(0);
1182
1182
  return;
1183
1183
  }
1184
1184
  t = [];
@@ -1190,7 +1190,7 @@ Q = function(t = [], e = null) {
1190
1190
  const n = [];
1191
1191
  for (const s in t)
1192
1192
  n.push(t[s].toString(16));
1193
- await i(this, w, Q).call(this, n), this.__internal__.serial.response.buffer = new Uint8Array(0);
1193
+ await i(this, k, Q).call(this, n), this.__internal__.serial.response.buffer = new Uint8Array(0);
1194
1194
  }
1195
1195
  }
1196
1196
  }
@@ -1207,7 +1207,7 @@ Q = function(t = [], e = null) {
1207
1207
  e.releaseLock(), this.__internal__.serial.keep_reading = !1, n = !1;
1208
1208
  break;
1209
1209
  }
1210
- i(this, w, He).call(this, s), this.__internal__.serial.response.length === null ? await i(this, w, Le).call(this) : await i(this, w, Oe).call(this);
1210
+ i(this, k, Le).call(this, s), this.__internal__.serial.response.length === null ? await i(this, k, He).call(this) : await i(this, k, Oe).call(this);
1211
1211
  }
1212
1212
  } catch (n) {
1213
1213
  this.serialErrors(n);
@@ -1243,8 +1243,8 @@ Q = function(t = [], e = null) {
1243
1243
  const t = this;
1244
1244
  this.on("internal:queue", async () => {
1245
1245
  var e;
1246
- await i(e = t, w, Je).call(e);
1247
- }), i(this, w, Ve).call(this);
1246
+ await i(e = t, k, Je).call(e);
1247
+ }), i(this, k, Ve).call(this);
1248
1248
  }, Ve = function() {
1249
1249
  const t = this;
1250
1250
  navigator.serial.addEventListener("connect", async () => {
@@ -1261,19 +1261,19 @@ Q = function(t = [], e = null) {
1261
1261
  let e = this.__internal__.time.response_general;
1262
1262
  t.action === "connect" ? e = this.__internal__.time.response_connection : t.action === "dispense" && (e = this.__internal__.time.response_engines), this.__internal__.timeout.until_response = setTimeout(async () => {
1263
1263
  await this.timeout(t.bytes, t.action);
1264
- }, e), await i(this, w, me).call(this, t.bytes), this.dispatch("serial:sent", {
1264
+ }, e), await i(this, k, me).call(this, t.bytes), this.dispatch("serial:sent", {
1265
1265
  action: t.action,
1266
1266
  bytes: t.bytes
1267
- }), this.typeDevice === "relay" && i(this, w, Q).call(this, ["DD", "DD"], null);
1267
+ }), this.typeDevice === "relay" && i(this, k, Q).call(this, ["DD", "DD"], null);
1268
1268
  const n = [...this.__internal__.serial.queue];
1269
1269
  this.__internal__.serial.queue = n.splice(1);
1270
1270
  }, ze = function(t = 1) {
1271
1271
  this.__internal__.device_number = t, this.__internal__.serial.bytes_connection = this.serialSetConnectionConstant(t);
1272
- }, $e = function() {
1272
+ }, Ge = function() {
1273
1273
  this.__internal__.last_error = { message: null, action: null, code: null, no_code: 0 };
1274
1274
  };
1275
- var X, _e, Ge;
1276
- class Cn extends G {
1275
+ var X, _e, $e;
1276
+ class gn extends Y {
1277
1277
  constructor({
1278
1278
  filters: t = null,
1279
1279
  config_port: e = null,
@@ -1286,7 +1286,7 @@ class Cn extends G {
1286
1286
  deactivate: ["A0", "01", "00", "A1"]
1287
1287
  });
1288
1288
  if (this.__internal__.device.type = "relay", D.getCustom(this.typeDevice, n)) throw new Error(`Device ${this.typeDevice} ${n} already exists`);
1289
- i(this, _e, Ge).call(this);
1289
+ i(this, _e, $e).call(this);
1290
1290
  }
1291
1291
  serialMessage(t) {
1292
1292
  const e = {
@@ -1319,11 +1319,11 @@ class Cn extends G {
1319
1319
  return e[1] = this.hexMaker(this.decToHex(t.toString())), e[3] = this.serialRelaySumHex(e), this.add0x(e);
1320
1320
  }
1321
1321
  async turnOn() {
1322
- const t = y(this, X).activate;
1322
+ const t = w(this, X).activate;
1323
1323
  t[3] = this.serialRelaySumHex(t), await this.appendToQueue(t, "relay:turn-on");
1324
1324
  }
1325
1325
  async turnOff() {
1326
- const t = y(this, X).deactivate;
1326
+ const t = w(this, X).deactivate;
1327
1327
  t[3] = this.serialRelaySumHex(t), await this.appendToQueue(t, "relay:turn-off");
1328
1328
  }
1329
1329
  async toggle({ inverse: t = !1, ms: e = 300 } = {}) {
@@ -1331,11 +1331,11 @@ class Cn extends G {
1331
1331
  t ? (await n.turnOff(), await W(e), await n.turnOn()) : (await n.turnOn(), await W(e), await n.turnOff());
1332
1332
  }
1333
1333
  }
1334
- X = new WeakMap(), _e = new WeakSet(), Ge = function() {
1334
+ X = new WeakMap(), _e = new WeakSet(), $e = function() {
1335
1335
  D.add(this);
1336
1336
  };
1337
- var B, E, j, v, Ye, Ke, Ze, Ce, K, V, ie, re, se;
1338
- class xn extends G {
1337
+ var A, E, j, y, Ye, Ke, Ze, Cn, Ce, Xe, V, J, ie, re, se;
1338
+ class Tn extends Y {
1339
1339
  constructor({
1340
1340
  filters: t = null,
1341
1341
  config_port: e = null,
@@ -1343,12 +1343,12 @@ class xn extends G {
1343
1343
  device_listen_on_port: s = 3
1344
1344
  } = {}) {
1345
1345
  super({ filters: t, config_port: e, no_device: n, device_listen_on_port: s });
1346
- S(this, v);
1347
- S(this, B, !1);
1346
+ S(this, y);
1347
+ S(this, A, !1);
1348
1348
  S(this, E, 0);
1349
1349
  S(this, j, 0);
1350
1350
  if (this.__internal__.device.type = "locker", D.getCustom(this.typeDevice, n)) throw new Error(`Device ${this.typeDevice} ${n} already exists`);
1351
- this.__internal__.device.milliseconds = 666, this.__internal__.dispense.limit_counter = 1, i(this, v, Ke).call(this), i(this, v, Ye).call(this);
1351
+ this.__internal__.device.milliseconds = 666, this.__internal__.dispense.limit_counter = 1, i(this, y, Ke).call(this), i(this, y, Ye).call(this);
1352
1352
  }
1353
1353
  serialMessage(t) {
1354
1354
  const e = {
@@ -1365,14 +1365,14 @@ class xn extends G {
1365
1365
  case "07":
1366
1366
  switch (t[4]) {
1367
1367
  case "00":
1368
- e.name = "Cell closed.", e.description = "The selected cell is closed.", e.request = "dispense", e.no_code = 1102, this.__internal__.dispense.status = !1, this.dispatch("dispensed", {}), y(this, B) && y(this, E) >= 89 ? (e.finished_test = !0, g(this, B, !1), g(this, E, 0)) : y(this, B) && (e.finished_test = !1);
1368
+ e.name = "Cell closed.", e.description = "The selected cell is closed.", e.request = "dispense", e.no_code = 1102, this.__internal__.dispense.status = !1, this.dispatch("dispensed", {}), w(this, A) && w(this, E) >= 89 ? (e.finished_test = !0, g(this, A, !1), g(this, E, 0)) : w(this, A) && (e.finished_test = !1);
1369
1369
  break;
1370
1370
  case "01":
1371
1371
  case "04":
1372
- e.name = "Cell open.", e.description = "The selected cell was open successfully.", e.request = "dispense", e.no_code = 102, this.__internal__.dispense.status = !0, this.dispatch("dispensed", {}), y(this, B) && y(this, E) >= 89 ? (e.finished_test = !0, g(this, B, !1), g(this, E, 0)) : y(this, B) && (e.finished_test = !1);
1372
+ e.name = "Cell open.", e.description = "The selected cell was open successfully.", e.request = "dispense", e.no_code = 102, this.__internal__.dispense.status = !0, this.dispatch("dispensed", {}), w(this, A) && w(this, E) >= 89 ? (e.finished_test = !0, g(this, A, !1), g(this, E, 0)) : w(this, A) && (e.finished_test = !1);
1373
1373
  break;
1374
1374
  case "05":
1375
- e.name = "Cell inactive.", e.description = "The selected cell is inactive or doesn't exist.", e.request = "dispense", e.no_code = 101, this.__internal__.dispense.status = !1, this.dispatch("not-dispensed", {}), y(this, B) && y(this, E) >= 89 ? (e.finished_test = !0, g(this, B, !1), g(this, E, 0)) : y(this, B) && (e.finished_test = !1);
1375
+ e.name = "Cell inactive.", e.description = "The selected cell is inactive or doesn't exist.", e.request = "dispense", e.no_code = 101, this.__internal__.dispense.status = !1, this.dispatch("not-dispensed", {}), w(this, A) && w(this, E) >= 89 ? (e.finished_test = !0, g(this, A, !1), g(this, E, 0)) : w(this, A) && (e.finished_test = !1);
1376
1376
  break;
1377
1377
  }
1378
1378
  break;
@@ -1420,53 +1420,55 @@ class xn extends G {
1420
1420
  if (t < 1 || t > 255) throw new Error("Invalid port number");
1421
1421
  return this.serialLockerHexCmd(new Uint8Array([0, t]));
1422
1422
  }
1423
- // #serialLockerGetLightScanCmd(since = 0, until = 10) {
1424
- // return this.serialLockerHexCmd(new Uint8Array([32, this.__internal__.device.listen_on_port, since, until]));
1425
- // }
1426
1423
  parseCellToColumnRow(t) {
1427
1424
  const e = Math.floor((t - 1) / 10) + 1;
1428
1425
  let n = t % 8;
1429
1426
  return n === 0 && (n = 8), [e, n];
1430
1427
  }
1431
1428
  async dispense({ cell: t = 1 } = {}) {
1432
- t = i(this, v, K).call(this, t);
1433
- const e = i(this, v, Ze).call(this, t);
1429
+ t = i(this, y, V).call(this, t);
1430
+ const e = i(this, y, Xe).call(this, t);
1434
1431
  return await this.internalDispense(e);
1435
1432
  }
1433
+ async status({ cell: t = 1 } = {}) {
1434
+ t = i(this, y, V).call(this, t);
1435
+ const e = i(this, y, Ze).call(this, t);
1436
+ return await this.appendToQueue(e, "status");
1437
+ }
1436
1438
  async enable({ cell: t = 1 } = {}) {
1437
- t = i(this, v, K).call(this, t);
1438
- const [e, n] = this.parseCellToColumnRow(t), s = i(this, v, Ce).call(this, { enable: !0, column: e, row: n });
1439
+ t = i(this, y, V).call(this, t);
1440
+ const [e, n] = this.parseCellToColumnRow(t), s = i(this, y, Ce).call(this, { enable: !0, column: e, row: n });
1439
1441
  await this.appendToQueue(s, "activate");
1440
1442
  }
1441
1443
  async disable({ cell: t = 1 } = {}) {
1442
- t = i(this, v, K).call(this, t);
1443
- const [e, n] = this.parseCellToColumnRow(t), s = i(this, v, Ce).call(this, { enable: !1, column: e, row: n });
1444
+ t = i(this, y, V).call(this, t);
1445
+ const [e, n] = this.parseCellToColumnRow(t), s = i(this, y, Ce).call(this, { enable: !1, column: e, row: n });
1444
1446
  await this.appendToQueue(s, "disable");
1445
1447
  }
1446
1448
  async openAll() {
1447
1449
  if (this.isDispensing) throw new Error("Another dispensing process is running");
1448
- i(this, v, V).call(this), g(this, B, !0), i(this, v, ie).call(this);
1450
+ i(this, y, J).call(this), g(this, A, !0), i(this, y, ie).call(this);
1449
1451
  const t = [];
1450
1452
  for (let e = 1; e <= 90; e++) {
1451
1453
  const n = await this.dispense(e);
1452
- t.push(n), g(this, E, e), i(this, v, ie).call(this);
1454
+ t.push(n), g(this, E, e), i(this, y, ie).call(this);
1453
1455
  }
1454
- g(this, E, 90), i(this, v, ie).call(this, t), i(this, v, V).call(this);
1456
+ g(this, E, 90), i(this, y, ie).call(this, t), i(this, y, J).call(this);
1455
1457
  }
1456
1458
  async enableAll() {
1457
- i(this, v, V).call(this), g(this, B, !0), i(this, v, re).call(this);
1459
+ i(this, y, J).call(this), g(this, A, !0), i(this, y, re).call(this);
1458
1460
  for (let t = 1; t <= 90; t++)
1459
- await this.enable(t), g(this, E, t), i(this, v, re).call(this);
1460
- g(this, E, 90), i(this, v, re).call(this), i(this, v, V).call(this);
1461
+ await this.enable(t), g(this, E, t), i(this, y, re).call(this);
1462
+ g(this, E, 90), i(this, y, re).call(this), i(this, y, J).call(this);
1461
1463
  }
1462
1464
  async disableAll() {
1463
- i(this, v, V).call(this), g(this, B, !0), i(this, v, se).call(this);
1465
+ i(this, y, J).call(this), g(this, A, !0), i(this, y, se).call(this);
1464
1466
  for (let t = 1; t <= 90; t++)
1465
- await this.enable(t), g(this, E, t), i(this, v, se).call(this);
1466
- g(this, E, 90), i(this, v, se).call(this), i(this, v, V).call(this);
1467
+ await this.enable(t), g(this, E, t), i(this, y, se).call(this);
1468
+ g(this, E, 90), i(this, y, se).call(this), i(this, y, J).call(this);
1467
1469
  }
1468
1470
  }
1469
- B = new WeakMap(), E = new WeakMap(), j = new WeakMap(), v = new WeakSet(), Ye = function() {
1471
+ A = new WeakMap(), E = new WeakMap(), j = new WeakMap(), y = new WeakSet(), Ye = function() {
1470
1472
  const t = [
1471
1473
  "percentage:disable",
1472
1474
  "percentage:enable",
@@ -1477,35 +1479,33 @@ B = new WeakMap(), E = new WeakMap(), j = new WeakMap(), v = new WeakSet(), Ye =
1477
1479
  }, Ke = function() {
1478
1480
  D.add(this);
1479
1481
  }, Ze = function(t = 1) {
1480
- return t = i(this, v, K).call(this, t), this.serialLockerHexCmd(new Uint8Array([16, this.__internal__.device.listen_on_port, t]));
1482
+ return t = i(this, y, V).call(this, t), this.serialLockerHexCmd(new Uint8Array([16, this.__internal__.device.listen_on_port, t]));
1483
+ }, Cn = function(t = 0, e = 10) {
1484
+ return this.serialLockerHexCmd(new Uint8Array([32, this.__internal__.device.listen_on_port, t, e]));
1481
1485
  }, Ce = function({ enable: t = !0, column: e = 0, row: n = 10 } = {}) {
1482
1486
  if (e < 0 || e > 8) throw new Error("Invalid column number");
1483
1487
  if (n < 0 || n > 10) throw new Error("Invalid row number");
1484
1488
  let s = 1;
1485
1489
  return t || (s = 0), this.serialLockerHexCmd(new Uint8Array([48, this.__internal__.device.listen_on_port, e, n, s]));
1486
- }, // #serialLockerGetOpenCmd(cell = 1) {
1487
- // cell = this.#validateCell(cell);
1488
- // const time = this.__internal__.device.milliseconds;
1489
- // //const time = new Date().getMilliseconds();
1490
- // const timeHigh = time % 256;
1491
- // const timeLow = Math.floor(time / 3) % 256;
1492
- // return this.serialLockerHexCmd(new Uint8Array([64, this.__internal__.device.listen_on_port, cell, timeHigh, timeLow]));
1493
- // }
1494
- K = function(t) {
1490
+ }, Xe = function(t = 1) {
1491
+ t = i(this, y, V).call(this, t);
1492
+ const e = this.__internal__.device.milliseconds, n = e % 256, s = Math.floor(e / 3) % 256;
1493
+ return this.serialLockerHexCmd(new Uint8Array([64, this.__internal__.device.listen_on_port, t, n, s]));
1494
+ }, V = function(t) {
1495
1495
  const e = parseInt(t);
1496
1496
  if (isNaN(e) || e < 1 || e > 90) throw new Error("Invalid cell number");
1497
1497
  return e;
1498
- }, V = function() {
1499
- g(this, B, !1), g(this, E, 0), g(this, j, 0);
1498
+ }, J = function() {
1499
+ g(this, A, !1), g(this, E, 0), g(this, j, 0);
1500
1500
  }, ie = function(t = null) {
1501
- g(this, j, Math.round(y(this, E) * 100 / 90)), this.dispatch("percentage:open", { percentage: y(this, j), dispensed: t });
1501
+ g(this, j, Math.round(w(this, E) * 100 / 90)), this.dispatch("percentage:open", { percentage: w(this, j), dispensed: t });
1502
1502
  }, re = function() {
1503
- g(this, j, Math.round(y(this, E) * 100 / 90)), this.dispatch("percentage:enable", { percentage: y(this, j) });
1503
+ g(this, j, Math.round(w(this, E) * 100 / 90)), this.dispatch("percentage:enable", { percentage: w(this, j) });
1504
1504
  }, se = function() {
1505
- g(this, j, Math.round(y(this, E) * 100 / 90)), this.dispatch("percentage:disable", { percentage: y(this, j) });
1505
+ g(this, j, Math.round(w(this, E) * 100 / 90)), this.dispatch("percentage:disable", { percentage: w(this, j) });
1506
1506
  };
1507
- var l, Xe, et, tt, N, ae, nt, it, rt, st, at, ot, lt, ct, ht, dt, ut, pt, _t, ft, bt, yt, wt, kt, vt, mt, Ct, xt, gt, Tt, Dt, Et, L, F, oe, P, O, It, St, Mt, Ft, Z, xe, ge, le, ce, Pt;
1508
- class gn extends G {
1507
+ var l, et, tt, nt, N, ae, it, rt, st, at, ot, lt, ct, ht, dt, ut, pt, _t, ft, bt, yt, wt, kt, vt, mt, Ct, xt, gt, Tt, Dt, Et, It, H, F, oe, P, O, St, Mt, Ft, Pt, Z, xe, ge, le, ce, At;
1508
+ class Dn extends Y {
1509
1509
  constructor({
1510
1510
  filters: t = null,
1511
1511
  config_port: e = null,
@@ -1516,7 +1516,7 @@ class gn extends G {
1516
1516
  } = {}) {
1517
1517
  super({ filters: t, config_port: e, no_device: n, device_listen_on_port: s });
1518
1518
  S(this, l);
1519
- A(this, "__device", {
1519
+ B(this, "__device", {
1520
1520
  type: "esplus",
1521
1521
  support_cart: !1,
1522
1522
  withdraw: {
@@ -1546,7 +1546,7 @@ class gn extends G {
1546
1546
  locking_time: 60,
1547
1547
  locking_interval: 0,
1548
1548
  need_reset: !1
1549
- }, this.deviceType = c, this.supportCart = u, i(this, l, Xe).call(this), i(this, l, tt).call(this), i(this, l, et).call(this);
1549
+ }, this.deviceType = c, this.supportCart = u, i(this, l, et).call(this), i(this, l, nt).call(this), i(this, l, tt).call(this);
1550
1550
  }
1551
1551
  set startChannelVerification(t) {
1552
1552
  const e = parseInt(t);
@@ -1608,10 +1608,10 @@ class gn extends G {
1608
1608
  };
1609
1609
  switch (t[0]) {
1610
1610
  case "02":
1611
- n = i(this, l, Et).call(this, t, n, 128);
1611
+ n = i(this, l, It).call(this, t, n, 128);
1612
1612
  break;
1613
1613
  case "06":
1614
- n = i(this, l, It).call(this, t, n);
1614
+ n = i(this, l, St).call(this, t, n);
1615
1615
  break;
1616
1616
  case "15":
1617
1617
  n.name = "Checksum error", n.description = "The calculated checksum does not match the received checksum", n.no_code = 38, i(this, l, F).call(this);
@@ -1636,7 +1636,7 @@ class gn extends G {
1636
1636
  cart: e = !1
1637
1637
  } = {}) {
1638
1638
  if (t = parseInt(t), isNaN(t) || t < 1 || t > 130) throw new Error("Invalid selection");
1639
- const { channel: n, tray: s } = i(this, l, St).call(this, t);
1639
+ const { channel: n, tray: s } = i(this, l, Mt).call(this, t);
1640
1640
  this.__internal__.dispense.backup_dispense = {
1641
1641
  selection: t,
1642
1642
  cart: e,
@@ -1647,7 +1647,7 @@ class gn extends G {
1647
1647
  e && (u[4] = "4D"), u = i(this, l, ae).call(this, u);
1648
1648
  let h;
1649
1649
  do
1650
- h = await this.internalDispense(u), i(this, l, Mt).call(this), h.error === "elevator-locked" ? await i(this, l, nt).call(this) : h.error === "no-response" && await W(1e3);
1650
+ h = await this.internalDispense(u), i(this, l, Ft).call(this), h.error === "elevator-locked" ? await i(this, l, it).call(this) : h.error === "no-response" && await W(1e3);
1651
1651
  while (["elevator-locked", "no-response"].includes(h.error));
1652
1652
  return this.__internal__.dispense.backup_dispense = {}, h;
1653
1653
  }
@@ -1945,7 +1945,7 @@ class gn extends G {
1945
1945
  }
1946
1946
  async programClock({ date: t = /* @__PURE__ */ new Date() } = {}) {
1947
1947
  if (!(t instanceof Date)) throw new Error("Invalid date, must be an instance of Date");
1948
- const e = ["02", "30", "30", "81", "72", ...i(this, l, Pt).call(this, t)];
1948
+ const e = ["02", "30", "30", "81", "72", ...i(this, l, At).call(this, t)];
1949
1949
  return await i(this, l, N).call(this, e, "clock");
1950
1950
  }
1951
1951
  /**
@@ -1987,7 +1987,7 @@ class gn extends G {
1987
1987
  });
1988
1988
  }
1989
1989
  }
1990
- l = new WeakSet(), Xe = function() {
1990
+ l = new WeakSet(), et = function() {
1991
1991
  const t = [
1992
1992
  "dispensing:withdrawal",
1993
1993
  "command-executed",
@@ -2023,9 +2023,9 @@ l = new WeakSet(), Xe = function() {
2023
2023
  ];
2024
2024
  for (const e of t)
2025
2025
  this.serialRegisterAvailableListener(e);
2026
- }, et = function() {
2027
- this.on("internal:dispense:running", i(this, l, Ft).bind(this));
2028
2026
  }, tt = function() {
2027
+ this.on("internal:dispense:running", i(this, l, Pt).bind(this));
2028
+ }, nt = function() {
2029
2029
  D.add(this);
2030
2030
  }, N = function(t, e) {
2031
2031
  return t[3] = this.__internal__.device.hex_number, this.appendToQueue(i(this, l, ae).call(this, t), e);
@@ -2034,7 +2034,7 @@ l = new WeakSet(), Xe = function() {
2034
2034
  for (let s = 0; s < 2; s++)
2035
2035
  t.push(this.hexMaker(n[s]));
2036
2036
  return t.push("03"), t;
2037
- }, nt = async function() {
2037
+ }, it = async function() {
2038
2038
  if (this.__internal__.dispense.elevator.locking_interval) return;
2039
2039
  this.__internal__.dispense.elevator.need_reset && (this.__internal__.dispense.elevator.need_reset = !1, await this.resetWaitingProductRemovedError(), await W(500)), await this.collect();
2040
2040
  const t = this;
@@ -2047,9 +2047,9 @@ l = new WeakSet(), Xe = function() {
2047
2047
  }), t.__internal__.dispense.elevator.locking_time -= 1, t.__internal__.dispense.elevator.locking_time <= 0 && (clearInterval(t.__internal__.dispense.elevator.locking_interval), t.__internal__.dispense.elevator.locking_interval = 0, e(!0));
2048
2048
  }, 1e3);
2049
2049
  });
2050
- }, it = function(t, e) {
2051
- return e.name = "ok", e.description = "The last command was executed successfully", e.no_code = 1, this.dispatch("command-executed", e), e;
2052
2050
  }, rt = function(t, e) {
2051
+ return e.name = "ok", e.description = "The last command was executed successfully", e.no_code = 1, this.dispatch("command-executed", e), e;
2052
+ }, st = function(t, e) {
2053
2053
  e.additional = {
2054
2054
  hex: t,
2055
2055
  dec: this.hexToDec(t),
@@ -2074,20 +2074,20 @@ l = new WeakSet(), Xe = function() {
2074
2074
  44: "D"
2075
2075
  };
2076
2076
  return e.additional.ascii = n[t] ?? null, e.name = "Key pressed", e.description = `The key ${e.additional.ascii} was pressed`, e.no_code = 2, this.dispatch("keyboard:pressed", e.additional), e;
2077
- }, st = function(t, e) {
2078
- return e.additional = { open: !1 }, e.no_code = 3, t === "4f" ? (e.name = "door open", e.description = "The door was opened", e.additional.open = !0, this.__internal__.device.door_open = !0, this.dispatch("door:event", e.additional)) : t === "43" ? (e.name = "door close", e.description = "The door was closed", e.additional.open = !1, this.__internal__.device.door_open = !1, this.dispatch("door:event", e.additional)) : (e.name = "door event", e.description = "The door event received is unknown", this.dispatch("door:event", { open: e.additional.open, message: e })), e;
2079
2077
  }, at = function(t, e) {
2078
+ return e.additional = { open: !1 }, e.no_code = 3, t === "4f" ? (e.name = "door open", e.description = "The door was opened", e.additional.open = !0, this.__internal__.device.door_open = !0, this.dispatch("door:event", e.additional)) : t === "43" ? (e.name = "door close", e.description = "The door was closed", e.additional.open = !1, this.__internal__.device.door_open = !1, this.dispatch("door:event", e.additional)) : (e.name = "door event", e.description = "The door event received is unknown", this.dispatch("door:event", { open: e.additional.open, message: e })), e;
2079
+ }, ot = function(t, e) {
2080
2080
  e.no_code = 404;
2081
2081
  let n = t[5] ?? null;
2082
2082
  return n && this.listenOnPort > 1 && (n = this.hexToDec(n) - this.listenOnPort + 1, n = this.decToHex(n)), n && (n === "FD" ? (e.no_code = 4, e.name = "channel disconnected", e.description = "The channel is disconnected", e.additional = { active: !1 }) : n === "FC" ? (e.no_code = 5, e.name = "channel connected", e.description = "The channel is connected", e.additional = { active: !0 }) : (e.no_code = 6, e.name = "channel sold out", e.description = "The channel is empty", e.additional = { active: !0 }), this.__device.channels.verification.running && (this.__device.channels.verification.channels.push({
2083
2083
  selection: this.__device.channels.verification.current,
2084
2084
  active: e.additional.active
2085
2085
  }), e.additional.selection = this.__device.channels.verification.current), this.dispatch("channel:status", e.additional)), e;
2086
- }, ot = function(t, e) {
2086
+ }, lt = function(t, e) {
2087
2087
  e.no_code = 39, e.name = "Program version";
2088
2088
  const n = t.slice(4, 12), s = n.map((c) => String.fromCharCode(this.hexToDec(c))).join("");
2089
2089
  return e.additional = { version: s, hex: n }, e.description = `The program version is ${s}`, this.dispatch("program:version", e.additional), e;
2090
- }, lt = function(t, e) {
2090
+ }, ct = function(t, e) {
2091
2091
  e.no_code = 39, e.name = "Machine faults", e.description = "No faults detected", e.additional = { no_faults: 0, faults: [] };
2092
2092
  const n = t.slice(4, -3);
2093
2093
  if (n.length > 1 && n[0] !== "30") {
@@ -2130,7 +2130,7 @@ l = new WeakSet(), Xe = function() {
2130
2130
  s[c] && (e.additional.faults.push(s[c]), e.additional.no_faults++);
2131
2131
  }
2132
2132
  return this.dispatch("machine:faults", e.additional), e;
2133
- }, ct = function(t, e) {
2133
+ }, ht = function(t, e) {
2134
2134
  e.no_code = 40, e.name = "Clock registers", e.description = "Clock registers";
2135
2135
  const n = t.slice(4, -3), s = n.map((fe) => String.fromCharCode(this.hexToDec(fe))).join(""), [c, u] = s.split(" "), [h, b] = c.split(":"), [C, T, I] = u.split("-"), U = new Date(2e3 + parseInt(I), parseInt(T) - 1, parseInt(C), parseInt(h), parseInt(b));
2136
2136
  return e.additional = {
@@ -2143,7 +2143,7 @@ l = new WeakSet(), Xe = function() {
2143
2143
  date: U,
2144
2144
  hex: n
2145
2145
  }, this.dispatch("clock:registers", e.additional), e;
2146
- }, ht = function(t, e) {
2146
+ }, dt = function(t, e) {
2147
2147
  e.no_code = 41, e.name = "Machine activity", e.description = "Events from read machine activity";
2148
2148
  const n = String.fromCharCode(this.hexToDec(t[4]));
2149
2149
  if (n !== "0") {
@@ -2178,7 +2178,7 @@ l = new WeakSet(), Xe = function() {
2178
2178
  meaning: C[n] ?? "Unknown"
2179
2179
  };
2180
2180
  } else if (s.length === 13) {
2181
- const c = s.map((un) => String.fromCharCode(this.hexToDec(un))).join(""), u = parseInt(c.slice(0, 2)), h = parseInt(c.slice(2, 4)), b = parseInt(c.slice(4, 6)), C = parseInt(c.slice(7, 9)), T = parseInt(c.slice(9, 11)) - 1, I = 2e3 + parseInt(c.slice(11, 13)), U = new Date(I, T, C, u, h, b), fe = {
2181
+ const c = s.map((pn) => String.fromCharCode(this.hexToDec(pn))).join(""), u = parseInt(c.slice(0, 2)), h = parseInt(c.slice(2, 4)), b = parseInt(c.slice(4, 6)), C = parseInt(c.slice(7, 9)), T = parseInt(c.slice(9, 11)) - 1, I = 2e3 + parseInt(c.slice(11, 13)), U = new Date(I, T, C, u, h, b), fe = {
2182
2182
  A: "Attempt to close product exit door",
2183
2183
  C: "Closing of exterior door",
2184
2184
  H: "Error on opening of product exit door",
@@ -2207,7 +2207,7 @@ l = new WeakSet(), Xe = function() {
2207
2207
  }
2208
2208
  }
2209
2209
  return this.dispatch("machine:activity", e.additional), e;
2210
- }, dt = function(t, e) {
2210
+ }, ut = function(t, e) {
2211
2211
  const n = {
2212
2212
  30: "Spanish",
2213
2213
  31: "English",
@@ -2217,91 +2217,91 @@ l = new WeakSet(), Xe = function() {
2217
2217
  hex: t,
2218
2218
  language: n[t] ?? "unknown"
2219
2219
  }, this.dispatch("check:language", e.additional), e;
2220
- }, ut = function(t, e) {
2220
+ }, pt = function(t, e) {
2221
2221
  return e.no_code = 43, e.name = "Beeper", e.description = `The beeper is ${t === "30" ? "on" : "off"}`, e.additional = {
2222
2222
  hex: t,
2223
2223
  beeper: t === "30"
2224
2224
  }, this.dispatch("check:beeper", e.additional), e;
2225
- }, pt = function(t, e) {
2225
+ }, _t = function(t, e) {
2226
2226
  e.no_code = 44, e.name = "Isolation tray", e.description = "Isolation tray";
2227
2227
  const n = this.hexToDec(t) - 139;
2228
2228
  return e.additional = {
2229
2229
  hex: t,
2230
2230
  tray: n
2231
2231
  }, this.dispatch("check:isolation-tray", e.additional), e;
2232
- }, _t = function(t, e) {
2232
+ }, ft = function(t, e) {
2233
2233
  e.no_code = 45, e.name = "Engine voltage", e.description = "Engine voltage";
2234
2234
  const n = (this.hexToDec(t) - 128) / 2 + 5;
2235
2235
  return e.additional = {
2236
2236
  hex: t,
2237
2237
  voltage: n
2238
2238
  }, this.dispatch("check:engine-voltage", e.additional), e;
2239
- }, ft = function(t, e) {
2239
+ }, bt = function(t, e) {
2240
2240
  e.no_code = 46, e.name = "Push over", e.description = "Push over";
2241
2241
  const n = t === "30";
2242
2242
  return e.additional = {
2243
2243
  hex: t,
2244
2244
  push: n
2245
2245
  }, this.dispatch("check:push-over", e.additional), e;
2246
- }, bt = function(t, e) {
2246
+ }, yt = function(t, e) {
2247
2247
  e.no_code = 47, e.name = "Extractor after dispense", e.description = "Extractor after dispense";
2248
2248
  const n = (this.hexToDec(t) - 128) / 10;
2249
2249
  return e.additional = {
2250
2250
  hex: t,
2251
2251
  seconds: n
2252
2252
  }, this.dispatch("check:extractor-after-dispense", e.additional), e;
2253
- }, yt = function(t, e) {
2253
+ }, wt = function(t, e) {
2254
2254
  e.no_code = 48, e.name = "Standby after collect", e.description = "Time to standby after collect product";
2255
2255
  const n = this.hexToDec(t) - 128;
2256
2256
  return e.additional = {
2257
2257
  hex: t,
2258
2258
  seconds: n
2259
2259
  }, this.dispatch("check:standby-after-collect", e.additional), e;
2260
- }, wt = function(t, e) {
2260
+ }, kt = function(t, e) {
2261
2261
  e.no_code = 49, e.name = "Standby without collect", e.description = "Time to standby when product delivery is not collected";
2262
2262
  const n = this.hexToDec(t) - 128;
2263
2263
  return e.additional = {
2264
2264
  hex: t,
2265
2265
  minutes: n
2266
2266
  }, this.dispatch("check:standby-without-collect", e.additional), e;
2267
- }, kt = function(t, e) {
2267
+ }, vt = function(t, e) {
2268
2268
  e.no_code = 50, e.name = "Elevator speed", e.description = "Elevator speed";
2269
2269
  const n = t === "30" ? "low" : "high";
2270
2270
  return e.additional = {
2271
2271
  hex: t,
2272
2272
  speed: n
2273
2273
  }, this.dispatch("check:elevator-speed", e.additional), e;
2274
- }, vt = function(t, e) {
2274
+ }, mt = function(t, e) {
2275
2275
  e.no_code = 51, e.name = "Temperature expiration", e.description = "Temperature expiration";
2276
2276
  const n = t === "31";
2277
2277
  return e.additional = {
2278
2278
  hex: t,
2279
2279
  enabled: n
2280
2280
  }, this.dispatch("check:expiration-by-temperature", e.additional), e;
2281
- }, mt = function(t, e) {
2281
+ }, Ct = function(t, e) {
2282
2282
  e.no_code = 52, e.name = "Temperature before expiration", e.description = "Temperature before expiration";
2283
2283
  const n = (this.hexToDec(t) - 128) / 2;
2284
2284
  return e.additional = {
2285
2285
  hex: t,
2286
2286
  temperature: n
2287
2287
  }, this.dispatch("check:temperature-before-expiration", e.additional), e;
2288
- }, Ct = function(t, e) {
2288
+ }, xt = function(t, e) {
2289
2289
  e.no_code = 53, e.name = "Time before expiration", e.description = "Time before expiration";
2290
2290
  const n = this.hexToDec(t) - 128;
2291
2291
  return e.additional = {
2292
2292
  hex: t,
2293
2293
  minutes: n
2294
2294
  }, this.dispatch("check:expiration-after", e.additional), e;
2295
- }, xt = function(t, e) {
2295
+ }, gt = function(t, e) {
2296
2296
  e.no_code = 54, e.name = "Temperature scale", e.description = "Temperature scale";
2297
2297
  const n = t === "43" ? "Celsius" : "Fahrenheit";
2298
2298
  return e.additional = {
2299
2299
  hex: t,
2300
2300
  scale: n
2301
2301
  }, this.dispatch("check:temperature-scale", e.additional), e;
2302
- }, gt = function(t, e) {
2303
- return e.no_code = 54, e.name = "Machine ID", e.description = "Machine ID", e.additional = { hex: t[4], full_hex: t }, this.dispatch("check:machine-id", e.additional), e;
2304
2302
  }, Tt = function(t, e) {
2303
+ return e.no_code = 54, e.name = "Machine ID", e.description = "Machine ID", e.additional = { hex: t[4], full_hex: t }, this.dispatch("check:machine-id", e.additional), e;
2304
+ }, Dt = function(t, e) {
2305
2305
  return e.no_code = 7, e.name = "working temperature", e.description = `The working temperature is ${t}`, e.additional = {
2306
2306
  hex: t,
2307
2307
  temperature: {
@@ -2309,7 +2309,7 @@ l = new WeakSet(), Xe = function() {
2309
2309
  ice_plus: (this.hexToDec(t) - this.hexToDec("80")) / 2 - 25.5
2310
2310
  }
2311
2311
  }, this.dispatch("temperature:working", e.additional), e;
2312
- }, Dt = function(t, e) {
2312
+ }, Et = function(t, e) {
2313
2313
  return e.no_code = 8, e.name = "current temperature", e.additional = {
2314
2314
  sign: null,
2315
2315
  tens: null,
@@ -2320,87 +2320,87 @@ l = new WeakSet(), Xe = function() {
2320
2320
  decimal_point: t[7] === "2e" ? "." : null,
2321
2321
  degrees: t[9] === "7f" ? "°" : null
2322
2322
  }, t[4] === "2b" ? e.additional.sign = t[4] = "+" : ["2e", "2d"].includes(t[4]) && (e.additional.sign = t[4] = "-"), this.hexToDec(t[5]) >= 48 && this.hexToDec(t[5]) <= 57 && (e.additional.tens = this.hexToDec(t[5]) - 48), this.hexToDec(t[6]) >= 48 && this.hexToDec(t[6]) <= 57 && (e.additional.units = this.hexToDec(t[6]) - 48), this.hexToDec(t[8]) >= 48 && this.hexToDec(t[8]) <= 57 && (e.additional.decimals = this.hexToDec(t[8]) - 48), t[10] === "43" ? e.additional.type_degrees = "C" : t[10] === "46" && (e.additional.type_degrees = "F"), e.additional.formatted = (e.additional.sign ?? "") + (e.additional.tens ?? "") + (e.additional.units ?? "") + (e.additional.decimal_point ?? "") + (e.additional.decimals ?? "") + (e.additional.degrees ?? "") + (e.additional.type_degrees ?? ""), e.description = `The current temperature is ${e.additional.formatted}`, this.dispatch("temperature:current", e.additional), e;
2323
- }, Et = function(t, e, n = 128) {
2323
+ }, It = function(t, e, n = 128) {
2324
2324
  if (t[1] && (e.additional.machine.hex = t[1], e.additional.machine.dec = this.hexToDec(t[1]) - n), !(t[1] && t[2]))
2325
- e = i(this, l, it).call(this, t, e);
2325
+ e = i(this, l, rt).call(this, t, e);
2326
2326
  else
2327
2327
  switch (t[2]) {
2328
2328
  case "54":
2329
- e.request = "--automatic", e = i(this, l, rt).call(this, t[3], e);
2329
+ e.request = "--automatic", e = i(this, l, st).call(this, t[3], e);
2330
2330
  break;
2331
2331
  case "50":
2332
- e.request = "--automatic", e = i(this, l, st).call(this, t[3], e);
2332
+ e.request = "--automatic", e = i(this, l, at).call(this, t[3], e);
2333
2333
  break;
2334
2334
  case "43":
2335
2335
  switch (e.request = "check-data", t[3]) {
2336
2336
  case "41":
2337
- e = i(this, l, ht).call(this, t, e);
2337
+ e = i(this, l, dt).call(this, t, e);
2338
2338
  break;
2339
2339
  case "43":
2340
- e.request = "channel-status", e = i(this, l, at).call(this, t, e);
2340
+ e.request = "channel-status", e = i(this, l, ot).call(this, t, e);
2341
2341
  break;
2342
2342
  case "50":
2343
- e = i(this, l, ot).call(this, t, e);
2343
+ e = i(this, l, lt).call(this, t, e);
2344
2344
  break;
2345
2345
  case "53":
2346
- e = i(this, l, lt).call(this, t, e);
2346
+ e = i(this, l, ct).call(this, t, e);
2347
2347
  break;
2348
2348
  case "54":
2349
- e.request = "working-temperature", e = i(this, l, Tt).call(this, t[4], e);
2349
+ e.request = "working-temperature", e = i(this, l, Dt).call(this, t[4], e);
2350
2350
  break;
2351
2351
  case "72":
2352
- e = i(this, l, ct).call(this, t, e);
2352
+ e = i(this, l, ht).call(this, t, e);
2353
2353
  break;
2354
2354
  case "74":
2355
- e.request = "current-temperature", e = i(this, l, Dt).call(this, t, e);
2355
+ e.request = "current-temperature", e = i(this, l, Et).call(this, t, e);
2356
2356
  break;
2357
2357
  case "49":
2358
- e = i(this, l, dt).call(this, t[4], e);
2358
+ e = i(this, l, ut).call(this, t[4], e);
2359
2359
  break;
2360
2360
  case "5a":
2361
- e = i(this, l, ut).call(this, t[4], e);
2361
+ e = i(this, l, pt).call(this, t[4], e);
2362
2362
  break;
2363
2363
  case "42":
2364
- e = i(this, l, pt).call(this, t[4], e);
2364
+ e = i(this, l, _t).call(this, t[4], e);
2365
2365
  break;
2366
2366
  case "47":
2367
- e = i(this, l, _t).call(this, t[4], e);
2367
+ e = i(this, l, ft).call(this, t[4], e);
2368
2368
  break;
2369
2369
  case "4e":
2370
- e = i(this, l, gt).call(this, t, e);
2370
+ e = i(this, l, Tt).call(this, t, e);
2371
2371
  break;
2372
2372
  case "4f":
2373
- e = i(this, l, ft).call(this, t[4], e);
2373
+ e = i(this, l, bt).call(this, t[4], e);
2374
2374
  break;
2375
2375
  case "45":
2376
- e = i(this, l, bt).call(this, t[4], e);
2376
+ e = i(this, l, yt).call(this, t[4], e);
2377
2377
  break;
2378
2378
  case "46":
2379
- e = i(this, l, yt).call(this, t[4], e);
2379
+ e = i(this, l, wt).call(this, t[4], e);
2380
2380
  break;
2381
2381
  case "48":
2382
- e = i(this, l, wt).call(this, t[4], e);
2382
+ e = i(this, l, kt).call(this, t[4], e);
2383
2383
  break;
2384
2384
  case "76":
2385
- e = i(this, l, kt).call(this, t[4], e);
2385
+ e = i(this, l, vt).call(this, t[4], e);
2386
2386
  break;
2387
2387
  case "63":
2388
- e = i(this, l, vt).call(this, t[4], e);
2388
+ e = i(this, l, mt).call(this, t[4], e);
2389
2389
  break;
2390
2390
  case "65":
2391
- e = i(this, l, mt).call(this, t[4], e);
2391
+ e = i(this, l, Ct).call(this, t[4], e);
2392
2392
  break;
2393
2393
  case "66":
2394
- e = i(this, l, Ct).call(this, t[4], e);
2394
+ e = i(this, l, xt).call(this, t[4], e);
2395
2395
  break;
2396
2396
  case "67":
2397
- e = i(this, l, xt).call(this, t[4], e);
2397
+ e = i(this, l, gt).call(this, t[4], e);
2398
2398
  break;
2399
2399
  }
2400
2400
  break;
2401
2401
  }
2402
2402
  return e;
2403
- }, L = function() {
2403
+ }, H = function() {
2404
2404
  this.__internal__.dispense.dispensing && (this.__internal__.dispense.status = !0);
2405
2405
  }, F = function() {
2406
2406
  this.__internal__.dispense.dispensing && (this.__internal__.dispense.status = !1);
@@ -2420,11 +2420,11 @@ P = function({ type: t = null, severity: e = "low" } = {}) {
2420
2420
  */
2421
2421
  O = function({ type: t = null, severity: e = "high" } = {}) {
2422
2422
  this.dispatch("jofemar:error", { type: t, severity: e });
2423
- }, It = function(t, e) {
2423
+ }, St = function(t, e) {
2424
2424
  if (e.request = "status", t[1] && !t[2]) {
2425
2425
  switch (t[1]) {
2426
2426
  case "30":
2427
- e.name = "Machine ready", e.description = "The machine is ready for instructions", e.no_code = 9, i(this, l, L).call(this);
2427
+ e.name = "Machine ready", e.description = "The machine is ready for instructions", e.no_code = 9, i(this, l, H).call(this);
2428
2428
  break;
2429
2429
  case "31":
2430
2430
  e.name = "Machine busy", e.description = "The machine is busy right now", e.no_code = 10;
@@ -2454,13 +2454,13 @@ O = function({ type: t = null, severity: e = "high" } = {}) {
2454
2454
  e.name = "Product detector fault", e.description = "Product detector fault", e.no_code = 18, i(this, l, oe).call(this), i(this, l, P).call(this, { type: "fault-product-detector" });
2455
2455
  break;
2456
2456
  case "41":
2457
- e.name = "Fault in 485 BUS", e.description = "Machine display is disconnected", e.no_code = 19, i(this, l, L).call(this), i(this, l, P).call(this, { type: "display-disconnected" });
2457
+ e.name = "Fault in 485 BUS", e.description = "Machine display is disconnected", e.no_code = 19, i(this, l, H).call(this), i(this, l, P).call(this, { type: "display-disconnected" });
2458
2458
  break;
2459
2459
  case "42":
2460
2460
  e.name = "Product under elevator", e.description = "Product alarm under elevator", e.no_code = 20, i(this, l, F).call(this), i(this, l, P).call(this, { type: "product-under-elevator" });
2461
2461
  break;
2462
2462
  case "43":
2463
- e.name = "Error when elevator approaching to a position", e.description = "Error when elevator approaching to a position", e.no_code = 21, i(this, l, L).call(this), i(this, l, P).call(this, { type: "error-approaching-position", severity: "high" });
2463
+ e.name = "Error when elevator approaching to a position", e.description = "Error when elevator approaching to a position", e.no_code = 21, i(this, l, H).call(this), i(this, l, P).call(this, { type: "error-approaching-position", severity: "high" });
2464
2464
  break;
2465
2465
  case "44":
2466
2466
  e.name = "Fault in keyboard", e.description = "Fault in keyboard", e.no_code = 22, i(this, l, F).call(this), i(this, l, O).call(this, { type: "fault-keyboard" });
@@ -2469,16 +2469,16 @@ O = function({ type: t = null, severity: e = "high" } = {}) {
2469
2469
  e.name = "Eeprom writing error", e.description = "Eeprom writing error", e.no_code = 23, i(this, l, F).call(this), i(this, l, O).call(this, { type: "eeprom-writing-error", severity: "critical" });
2470
2470
  break;
2471
2471
  case "46":
2472
- e.name = "Fault communicating with temperature control", e.description = "Fault communicating with temperature control", e.no_code = 24, i(this, l, L).call(this), i(this, l, P).call(this, { type: "fault-temperature-control" });
2472
+ e.name = "Fault communicating with temperature control", e.description = "Fault communicating with temperature control", e.no_code = 24, i(this, l, H).call(this), i(this, l, P).call(this, { type: "fault-temperature-control" });
2473
2473
  break;
2474
2474
  case "47":
2475
- e.name = "Thermometer disconnected", e.description = "The thermometer is disconnected", e.no_code = 25, i(this, l, L).call(this), i(this, l, P).call(this, { type: "thermometer-disconnected" });
2475
+ e.name = "Thermometer disconnected", e.description = "The thermometer is disconnected", e.no_code = 25, i(this, l, H).call(this), i(this, l, P).call(this, { type: "thermometer-disconnected" });
2476
2476
  break;
2477
2477
  case "48":
2478
- e.name = "Thermometer programming lost", e.description = "Thermometer programming lost", e.no_code = 26, i(this, l, L).call(this), i(this, l, P).call(this, { type: "thermometer-programming-lost" });
2478
+ e.name = "Thermometer programming lost", e.description = "Thermometer programming lost", e.no_code = 26, i(this, l, H).call(this), i(this, l, P).call(this, { type: "thermometer-programming-lost" });
2479
2479
  break;
2480
2480
  case "49":
2481
- e.name = "Thermometer faulty", e.description = "Thermometer faulty", e.no_code = 27, i(this, l, L).call(this), i(this, l, P).call(this, { type: "thermometer-faulty" });
2481
+ e.name = "Thermometer faulty", e.description = "Thermometer faulty", e.no_code = 27, i(this, l, H).call(this), i(this, l, P).call(this, { type: "thermometer-faulty" });
2482
2482
  break;
2483
2483
  case "4a":
2484
2484
  e.name = "Channels power consumption detector faulty", e.description = "Channels power consumption detector faulty", e.no_code = 28, i(this, l, F).call(this), i(this, l, O).call(this, { type: "channels-power-consumption-detector-faulty", severity: "critical" });
@@ -2499,10 +2499,10 @@ O = function({ type: t = null, severity: e = "high" } = {}) {
2499
2499
  e.name = "Waiting for product to be removed", e.description = "Waiting for product to be removed", e.no_code = 33, i(this, l, oe).call(this);
2500
2500
  break;
2501
2501
  case "50":
2502
- e.name = "Product expired by temperature reasons", e.description = "Product expired by temperature reasons", e.no_code = 34, i(this, l, L).call(this), i(this, l, P).call(this, { type: "product-expired-temperature" });
2502
+ e.name = "Product expired by temperature reasons", e.description = "Product expired by temperature reasons", e.no_code = 34, i(this, l, H).call(this), i(this, l, P).call(this, { type: "product-expired-temperature" });
2503
2503
  break;
2504
2504
  case "51":
2505
- e.name = "Automatic door faulty", e.description = "Automatic door faulty", e.no_code = 35, i(this, l, L).call(this), i(this, l, P).call(this, { type: "automatic-door-faulty" });
2505
+ e.name = "Automatic door faulty", e.description = "Automatic door faulty", e.no_code = 35, i(this, l, H).call(this), i(this, l, P).call(this, { type: "automatic-door-faulty" });
2506
2506
  break;
2507
2507
  case "59":
2508
2508
  case "5a":
@@ -2523,24 +2523,24 @@ O = function({ type: t = null, severity: e = "high" } = {}) {
2523
2523
  e.additional.nsf_alarm = 5;
2524
2524
  break;
2525
2525
  }
2526
- e.no_code = 36, i(this, l, L).call(this), i(this, l, P).call(this, { type: "product-expired" });
2526
+ e.no_code = 36, i(this, l, H).call(this), i(this, l, P).call(this, { type: "product-expired" });
2527
2527
  break;
2528
2528
  case "64":
2529
- e.name = "Product detector didn't change during its verification test", e.description = "Product detector didn't change during its verification test", e.no_code = 37, i(this, l, L).call(this), i(this, l, P).call(this, { type: "automatic-door-faulty" });
2529
+ e.name = "Product detector didn't change during its verification test", e.description = "Product detector didn't change during its verification test", e.no_code = 37, i(this, l, H).call(this), i(this, l, P).call(this, { type: "automatic-door-faulty" });
2530
2530
  break;
2531
2531
  }
2532
2532
  this.dispatch("machine:status", e);
2533
2533
  } else
2534
2534
  e.name = "executed", e.description = "The last command was executed successfully", e.no_code = 8, !t[1] && this.__internal__.dispense.dispensing && i(this, l, F).call(this);
2535
2535
  return e;
2536
- }, St = function(t) {
2536
+ }, Mt = function(t) {
2537
2537
  if (t = parseInt(t) + 109, t = t.toString(), t.length !== 3)
2538
2538
  throw new Error("Invalid selection");
2539
2539
  const e = (parseInt(t.substring(0, 2)) + 128).toString(16).padStart(2, "0");
2540
2540
  return { channel: (parseInt(t.substring(2, 3)) + 128).toString(16).padStart(2, "0"), tray: e };
2541
- }, Mt = function() {
2542
- this.__internal__.dispense.timeout && clearTimeout(this.__internal__.dispense.timeout), this.__internal__.dispense.interval && clearInterval(this.__internal__.dispense.interval), this.__internal__.dispense.timeout = 0, this.__internal__.dispense.interval = 0;
2543
2541
  }, Ft = function() {
2542
+ this.__internal__.dispense.timeout && clearTimeout(this.__internal__.dispense.timeout), this.__internal__.dispense.interval && clearInterval(this.__internal__.dispense.interval), this.__internal__.dispense.timeout = 0, this.__internal__.dispense.interval = 0;
2543
+ }, Pt = function() {
2544
2544
  this.__internal__.dispense.timeout && clearTimeout(this.__internal__.dispense.timeout), this.__internal__.dispense.interval && clearInterval(this.__internal__.dispense.interval);
2545
2545
  const t = this;
2546
2546
  t.__internal__.dispense.timeout = setTimeout(() => {
@@ -2572,15 +2572,15 @@ O = function({ type: t = null, severity: e = "high" } = {}) {
2572
2572
  for (let n = 0; n < 32; n++)
2573
2573
  e.push(t.charCodeAt(n).toString(16));
2574
2574
  return e;
2575
- }, Pt = function(t) {
2575
+ }, At = function(t) {
2576
2576
  if (!(t instanceof Date)) throw new Error("Invalid date, must be an instance of Date");
2577
2577
  const e = t.getHours().toString().padStart(2, "0"), n = t.getMinutes().toString().padStart(2, "0"), s = t.getDate().toString().padStart(2, "0"), c = (t.getMonth() + 1).toString().padStart(2, "0"), u = t.getFullYear().toString().substring(2, 4), h = `${e}:${n} ${s}-${c}-${u}`, b = [];
2578
2578
  for (let C = 0; C < 14; C++)
2579
2579
  b.push(h.charCodeAt(C).toString(16));
2580
2580
  return b;
2581
2581
  };
2582
- var ee, J, z, d, Bt, At, he, Nt, qt, Rt, Ht, Lt, Ot, Ut, jt, Te, Wt, Qt, Vt, Jt, zt, $t, Gt, Yt, Kt, Zt, Xt, en, tn, nn, q, de, rn, sn, an, on, De, ue, ln, cn, Ee, Ie, Se;
2583
- class Tn extends G {
2582
+ var ee, z, G, d, Bt, Nt, he, qt, Rt, Lt, Ht, Ot, Ut, jt, Wt, Te, Qt, Vt, Jt, zt, Gt, $t, Yt, Kt, Zt, Xt, en, tn, nn, rn, q, de, sn, an, on, ln, De, ue, cn, hn, Ee, Ie, Se;
2583
+ class En extends Y {
2584
2584
  constructor({
2585
2585
  filters: t = null,
2586
2586
  config_port: e = null,
@@ -2588,10 +2588,10 @@ class Tn extends G {
2588
2588
  } = {}) {
2589
2589
  super({ filters: t, config_port: e, no_device: n });
2590
2590
  S(this, d);
2591
- A(this, "__coin_purse", {
2591
+ B(this, "__coin_purse", {
2592
2592
  available: !0
2593
2593
  });
2594
- A(this, "__banknote_purse", {
2594
+ B(this, "__banknote_purse", {
2595
2595
  available: !0,
2596
2596
  isRecycler: !0,
2597
2597
  recycler: {
@@ -2600,7 +2600,7 @@ class Tn extends G {
2600
2600
  // 0: $20, 1: $50, 2: $100, 3: $200, 4: $500
2601
2601
  }
2602
2602
  });
2603
- A(this, "__sale", {
2603
+ B(this, "__sale", {
2604
2604
  price: 0,
2605
2605
  change: 0,
2606
2606
  change_verified: 0,
@@ -2610,40 +2610,40 @@ class Tn extends G {
2610
2610
  this.price = 0, this.change = 0, this.change_verified = 0, this.dispense_all = !0, this.last_change = 0;
2611
2611
  }
2612
2612
  });
2613
- A(this, "__money_session", {
2613
+ B(this, "__money_session", {
2614
2614
  inserted: 0,
2615
2615
  retired: 0,
2616
2616
  clear() {
2617
2617
  this.inserted = 0, this.retired = 0;
2618
2618
  }
2619
2619
  });
2620
- A(this, "coins", {
2620
+ B(this, "coins", {
2621
2621
  tubes: { g50: 0, c50: 0, p1: 0, p2: 0, p5: 0, p10: 0 },
2622
2622
  box: { g50: 0, c50: 0, p1: 0, p2: 0, p5: 0, p10: 0 },
2623
2623
  totals: { g50: 0, c50: 0, p1: 0, p2: 0, p5: 0, p10: 0 },
2624
2624
  total: 0
2625
2625
  });
2626
- A(this, "banknotes", {
2626
+ B(this, "banknotes", {
2627
2627
  stacker: { p20: 0, p50: 0, p100: 0, p200: 0, p500: 0, p1000: 0 },
2628
2628
  recycler: { p20: 0, p50: 0, p100: 0, p200: 0, p500: 0, p1000: 0 },
2629
2629
  out: { p20: 0, p50: 0, p100: 0, p200: 0, p500: 0, p1000: 0 },
2630
2630
  totals: { p20: 0, p50: 0, p100: 0, p200: 0, p500: 0, p1000: 0 },
2631
2631
  total: 0
2632
2632
  });
2633
- A(this, "card_reader", {
2633
+ B(this, "card_reader", {
2634
2634
  available: !1,
2635
2635
  max_pre_credit: 0
2636
2636
  });
2637
2637
  S(this, ee, !1);
2638
- S(this, J, 0);
2639
2638
  S(this, z, 0);
2639
+ S(this, G, 0);
2640
2640
  if (this.__internal__.device.type = "boardroid", D.getCustom(this.typeDevice, n)) throw new Error(`Device ${this.typeDevice} ${n} already exists`);
2641
2641
  this.__internal__.serial.config_port.baudRate = 115200, this.__internal__.serial.response.length = 14, this.__internal__.time.response_connection = 600, this.__internal__.time.response_general = 4e3, this.__internal__.time.response_engines = 15e3, this.__internal__.dispense.limit_counter = 15, this.__internal__.dispense.custom_limit_counter = null, this.__internal__.dispense.backup_dispense = {
2642
2642
  channel: 1,
2643
2643
  second_channel: null,
2644
2644
  sensor: !0,
2645
2645
  seconds: null
2646
- }, i(this, d, Bt).call(this), i(this, d, At).call(this);
2646
+ }, i(this, d, Bt).call(this), i(this, d, Nt).call(this);
2647
2647
  }
2648
2648
  get totalInTubes() {
2649
2649
  return this.coins.tubes.g50 * 0.5 + this.coins.tubes.c50 * 0.5 + this.coins.tubes.p1 + this.coins.tubes.p2 * 2 + this.coins.tubes.p5 * 5 + this.coins.tubes.p10 * 10;
@@ -2703,46 +2703,46 @@ class Tn extends G {
2703
2703
  const n = (5 + this.deviceNumber).toString(16).padStart(2, "0").toLowerCase();
2704
2704
  switch (t[1]) {
2705
2705
  case n:
2706
- e.request = "connect", e = i(this, d, qt).call(this, e);
2706
+ e.request = "connect", e = i(this, d, Rt).call(this, e);
2707
2707
  break;
2708
2708
  case "a0":
2709
- e.request = "--automatic", e = i(this, d, Wt).call(this, t, e);
2709
+ e.request = "--automatic", e = i(this, d, Qt).call(this, t, e);
2710
2710
  break;
2711
2711
  case "b0":
2712
- e.request = "--automatic", e = i(this, d, Qt).call(this, t, e);
2712
+ e.request = "--automatic", e = i(this, d, Vt).call(this, t, e);
2713
2713
  break;
2714
2714
  case "d0":
2715
- e.request = "coin-purse:config", e = i(this, d, Vt).call(this, t[2], e);
2715
+ e.request = "coin-purse:config", e = i(this, d, Jt).call(this, t[2], e);
2716
2716
  break;
2717
2717
  case "d1":
2718
- e.request = "banknote-purse:config", e.additional = { scrow: null }, e = i(this, d, Jt).call(this, t, e);
2718
+ e.request = "banknote-purse:config", e.additional = { scrow: null }, e = i(this, d, zt).call(this, t, e);
2719
2719
  break;
2720
2720
  case "d2":
2721
- e.request = "coin-purse:read-tubes", e = i(this, d, zt).call(this, t, e);
2721
+ e.request = "coin-purse:read-tubes", e = i(this, d, Gt).call(this, t, e);
2722
2722
  break;
2723
2723
  case "d3":
2724
2724
  e.request = "banknote-purse:read-recycler", e = i(this, d, $t).call(this, t, e);
2725
2725
  break;
2726
2726
  case "d4":
2727
- e.request = "banknote-purse:banknote-scrow-status", e = i(this, d, Gt).call(this, t[2], e);
2727
+ e.request = "banknote-purse:banknote-scrow-status", e = i(this, d, Yt).call(this, t[2], e);
2728
2728
  break;
2729
2729
  case "d5":
2730
- e.request = "banknote-purse:dispense", e = i(this, d, Yt).call(this, t, e);
2730
+ e.request = "banknote-purse:dispense", e = i(this, d, Kt).call(this, t, e);
2731
2731
  break;
2732
2732
  case "d6":
2733
- e.request = "coin-purse:dispense", e = i(this, d, Kt).call(this, t, e);
2733
+ e.request = "coin-purse:dispense", e = i(this, d, Zt).call(this, t, e);
2734
2734
  break;
2735
2735
  case "d7":
2736
- e.request = "dispense", e = i(this, d, Zt).call(this, t[5], e);
2736
+ e.request = "dispense", e = i(this, d, Xt).call(this, t[5], e);
2737
2737
  break;
2738
2738
  case "d8":
2739
- e.request = "--automatic", e = i(this, d, Xt).call(this, t[13], e);
2739
+ e.request = "--automatic", e = i(this, d, en).call(this, t[13], e);
2740
2740
  break;
2741
2741
  case "d9":
2742
- e.request = "status:temperature", e = i(this, d, en).call(this, t, e);
2742
+ e.request = "status:temperature", e = i(this, d, tn).call(this, t, e);
2743
2743
  break;
2744
2744
  case "da":
2745
- e.request = "status:relay", e = i(this, d, tn).call(this, t[2], e);
2745
+ e.request = "status:relay", e = i(this, d, nn).call(this, t[2], e);
2746
2746
  break;
2747
2747
  case "db":
2748
2748
  e.request = "banknote-purse:save-memory", e.no_code = 18, e.name = "Bill purse memory saved?", e.description = "The memory of bill purse was saved successfully?", this.dispatch("banknote-purse:save-memory", { message: e });
@@ -2751,7 +2751,7 @@ class Tn extends G {
2751
2751
  e.request = "coin-purse:read-memory", e.no_code = 19, e.name = "Coin purse memory read?", e.description = "The memory of coin purse was read successfully?", this.dispatch("banknote-purse:read-memory", { message: e });
2752
2752
  break;
2753
2753
  case "dd":
2754
- e.request = "card-reader", i(this, d, nn).call(this, t, e);
2754
+ e.request = "card-reader", i(this, d, rn).call(this, t, e);
2755
2755
  break;
2756
2756
  default:
2757
2757
  e.request = "--unknown", e.name = "Response unrecognized", e.description = "The response of application was received, but dont identify with any of current parameters", e.no_code = 400, this.dispatch("unknown", e);
@@ -2796,7 +2796,7 @@ class Tn extends G {
2796
2796
  async banknotePurseConfigure({ enable: t = !1, scrow: e = !1 } = {}) {
2797
2797
  if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
2798
2798
  let n;
2799
- return i(this, d, he).call(this) ? n = i(this, d, rn).call(this, { enable: t, scrow: e }) : n = i(this, d, sn).call(this, { enable: t, scrow: e }), await i(this, d, q).call(this, n, "banknote-purse:config");
2799
+ return i(this, d, he).call(this) ? n = i(this, d, sn).call(this, { enable: t, scrow: e }) : n = i(this, d, an).call(this, { enable: t, scrow: e }), await i(this, d, q).call(this, n, "banknote-purse:config");
2800
2800
  }
2801
2801
  async banknotePurseDispense({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200: s = 0, $_500: c = 0, $_1000: u = 0 } = {}) {
2802
2802
  if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
@@ -2804,9 +2804,9 @@ class Tn extends G {
2804
2804
  let h;
2805
2805
  if (i(this, d, he).call(this)) {
2806
2806
  const b = [t, e, n, s, c];
2807
- h = i(this, d, an).call(this, b[this.__banknote_purse.recycler.banknote]);
2807
+ h = i(this, d, on).call(this, b[this.__banknote_purse.recycler.banknote]);
2808
2808
  } else
2809
- h = i(this, d, on).call(this, { $_20: t, $_50: e, $_100: n, $_200: s, $_500: c, $_1000: u });
2809
+ h = i(this, d, ln).call(this, { $_20: t, $_50: e, $_100: n, $_200: s, $_500: c, $_1000: u });
2810
2810
  await i(this, d, q).call(this, h, "banknote-purse:dispense");
2811
2811
  }
2812
2812
  async banknotePurseEnable({ scrow: t = !1 }) {
@@ -2945,9 +2945,9 @@ class Tn extends G {
2945
2945
  seconds: 0.4,
2946
2946
  retry: !1
2947
2947
  });
2948
- e.push(s), g(this, J, n), i(this, d, ue).call(this), t || n++;
2948
+ e.push(s), g(this, z, n), i(this, d, ue).call(this), t || n++;
2949
2949
  }
2950
- g(this, J, 80), i(this, d, ue).call(this, { dispensed: e }), i(this, d, De).call(this);
2950
+ g(this, z, 80), i(this, d, ue).call(this, { dispensed: e }), i(this, d, De).call(this);
2951
2951
  }
2952
2952
  async sendCustomCode({ code: t = [] } = {}) {
2953
2953
  if (t.length === 0) throw new Error("Invalid code");
@@ -2968,7 +2968,7 @@ class Tn extends G {
2968
2968
  this.dispatch("corrupt:message", { data: t, message: e });
2969
2969
  }
2970
2970
  }
2971
- ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt = function() {
2971
+ ee = new WeakMap(), z = new WeakMap(), G = new WeakMap(), d = new WeakSet(), Bt = function() {
2972
2972
  const t = [
2973
2973
  "banknote-purse:banknote-scrow-status",
2974
2974
  "banknote-purse:config",
@@ -2994,15 +2994,15 @@ ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt
2994
2994
  ];
2995
2995
  for (const e of t)
2996
2996
  this.serialRegisterAvailableListener(e);
2997
- }, At = function() {
2997
+ }, Nt = function() {
2998
2998
  D.add(this);
2999
2999
  }, he = function() {
3000
3000
  return this.__banknote_purse.isRecycler && this.__banknote_purse.recycler.ict;
3001
- }, Nt = function() {
3001
+ }, qt = function() {
3002
3002
  return this.hasCoinPurse || this.hasRecycler;
3003
- }, qt = function(t) {
3004
- return t.name = "Connection with the serial device completed.", t.description = "Your connection with the serial device was successfully completed.", t.no_code = 1, this.dispatch("run:default-load", {}), t;
3005
3003
  }, Rt = function(t) {
3004
+ return t.name = "Connection with the serial device completed.", t.description = "Your connection with the serial device was successfully completed.", t.no_code = 1, this.dispatch("run:default-load", {}), t;
3005
+ }, Lt = function(t) {
3006
3006
  const e = {
3007
3007
  g50: ["40", "50", "60", "70", "90"],
3008
3008
  c50: ["41", "51", "61", "71", "91"],
@@ -3029,7 +3029,7 @@ ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt
3029
3029
  }[n], n] : [`Undefined value: ¿${t}?`, null];
3030
3030
  }, Ht = function(t) {
3031
3031
  return ["g50", "c50", "p1", "p2", "p5", "p10", "p20"].includes(t);
3032
- }, Lt = function(t) {
3032
+ }, Ot = function(t) {
3033
3033
  const e = {
3034
3034
  p20: ["80", "90", "a0", "b0"],
3035
3035
  p50: ["81", "91", "a1", "b1"],
@@ -3052,11 +3052,11 @@ ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt
3052
3052
  p500: "500 pesos",
3053
3053
  p1000: "1000 pesos"
3054
3054
  }[n], n] : [`Undefined value: ¿${t}?`, null];
3055
- }, Ot = function(t) {
3056
- return ["p20", "p50", "p100", "p200", "p500", "p1000"].includes(t);
3057
3055
  }, Ut = function(t) {
3056
+ return ["p20", "p50", "p100", "p200", "p500", "p1000"].includes(t);
3057
+ }, jt = function(t) {
3058
3058
  return ["r20", "r50", "r100"].includes(t);
3059
- }, jt = function() {
3059
+ }, Wt = function() {
3060
3060
  return [
3061
3061
  "r20",
3062
3062
  "r50",
@@ -3072,31 +3072,31 @@ ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt
3072
3072
  e === "tube" ? this.coins.tubes[t] += 1 : e === "box" && (this.coins.box[t] += 1);
3073
3073
  let s = 0;
3074
3074
  ["g50", "c50"].includes(t) ? s = 0.5 : s += parseInt(t.slice(1)), this.coins.totals[t] += s, this.__money_session.inserted += s, this.coins.total += s;
3075
- } else if (i(this, d, Ot).call(this, t)) {
3075
+ } else if (i(this, d, Ut).call(this, t)) {
3076
3076
  if (typeof this.banknotes.tubes[t] > "u") return;
3077
3077
  e === "recycler" ? this.banknotes.recycler[t] += 1 : e === "stacker" && (this.banknotes.stacker[t] += 1);
3078
3078
  let s = parseInt(t.slice(1));
3079
3079
  this.banknotes.totals[t] += s, this.__money_session.inserted += s, this.banknotes.total += s;
3080
- } else if (i(this, d, Ut).call(this, t) && e === "out") {
3080
+ } else if (i(this, d, jt).call(this, t) && e === "out") {
3081
3081
  if (typeof this.banknotes.out[t] > "u") return;
3082
3082
  this.banknotes.out[t] += 1;
3083
3083
  let s = parseInt(t.slice(1));
3084
3084
  this.__money_session.retired += s, this.banknotes.recycler[t] -= 1, this.banknotes.total -= s, n = !1, this.dispatch("session:money-dispensed", { type_money: t, retired: s, finish: !1, type: "banknotes" });
3085
3085
  }
3086
3086
  n && this.dispatch("session:money-request", {});
3087
- }, Wt = function(t, e) {
3088
- const n = parseInt(t[2], 16);
3089
- return e.name = "Coin Inserted", e.no_code = 2, e.additional = { where: null, coin: null }, n === 1 ? (e.name = "Lever pressed", e.description = "Reject lever", e.no_code = 100, this.dispatch("coin-purse:reject-lever", {})) : n === 2 ? (e.name = "Reset coin purse", e.description = "The configuration of coin purse was reset", e.no_code = 101, this.dispatch("coin-purse:reset", {})) : n >= 64 && n <= 79 ? (e.name = "Coin inserted in profit box", e.additional.where = "box") : n >= 80 && n <= 95 ? (e.name = "Coin inserted in tube", e.additional.where = "tube") : n >= 96 && n <= 111 ? (e.name = "Unused coin", e.description = "Something come from coin changer but in MDB Docs is unused", e.additional.where = "unused") : n >= 112 && n <= 127 ? (e.name = "Coin rejected", e.additional.where = "rejected") : n >= 144 && n <= 159 ? (e.name = "Coin dispensed", e.additional.where = "out", e.description = `Undefined value: ¿${t[2]}?`) : (e.name = "Coin inserted", e.description = "Undefined status. Without information of this", e.no_code = 400), n === 1 || n === 2 || n >= 160 || n >= 128 && n <= 143 || ([e.description, e.additional.coin] = i(this, d, Rt).call(this, t[2]), e.no_code = 38 + n, i(this, d, Te).call(this, e.additional.coin, e.additional.where), ["tube", "out"].includes(e.additional.where) && this.dispatch("coin-purse:tubes", this.coins.tubes), this.dispatch("coin-purse:coin-event", this.coins)), e;
3090
3087
  }, Qt = function(t, e) {
3091
3088
  const n = parseInt(t[2], 16);
3092
- return e.name = "Banknote Inserted", e.no_code = 2, e.additional = { where: null, banknote: null }, n === 42 ? (e.name = "Banknote dispensed", e.description = "Banknote dispensed by request.", e.additional.banknote = i(this, d, jt).call(this), e.additional.where = "out", e.no_code = 200) : n >= 128 && n <= 143 ? (e.name = "Banknote inserted", e.additional.where = "stacker") : n >= 144 && n <= 159 ? (e.name = "Banknote inserted in pre stacker", e.additional.where = "tmp") : n >= 160 && n <= 175 ? (e.name = "Banknote rejected", e.additional.where = "nothing") : n >= 176 && n <= 191 && (e.name = "Banknote inserted", e.additional.where = "recycler"), n >= 128 && n <= 191 && ([e.description, e.additional.banknote] = i(this, d, Lt).call(this, t[2]), e.no_code = 74 + n), i(this, d, Te).call(this, e.additional.banknote, e.additional.where), this.dispatch("banknote-purse:event-banknote", this.banknotes), e;
3089
+ return e.name = "Coin Inserted", e.no_code = 2, e.additional = { where: null, coin: null }, n === 1 ? (e.name = "Lever pressed", e.description = "Reject lever", e.no_code = 100, this.dispatch("coin-purse:reject-lever", {})) : n === 2 ? (e.name = "Reset coin purse", e.description = "The configuration of coin purse was reset", e.no_code = 101, this.dispatch("coin-purse:reset", {})) : n >= 64 && n <= 79 ? (e.name = "Coin inserted in profit box", e.additional.where = "box") : n >= 80 && n <= 95 ? (e.name = "Coin inserted in tube", e.additional.where = "tube") : n >= 96 && n <= 111 ? (e.name = "Unused coin", e.description = "Something come from coin changer but in MDB Docs is unused", e.additional.where = "unused") : n >= 112 && n <= 127 ? (e.name = "Coin rejected", e.additional.where = "rejected") : n >= 144 && n <= 159 ? (e.name = "Coin dispensed", e.additional.where = "out", e.description = `Undefined value: ¿${t[2]}?`) : (e.name = "Coin inserted", e.description = "Undefined status. Without information of this", e.no_code = 400), n === 1 || n === 2 || n >= 160 || n >= 128 && n <= 143 || ([e.description, e.additional.coin] = i(this, d, Lt).call(this, t[2]), e.no_code = 38 + n, i(this, d, Te).call(this, e.additional.coin, e.additional.where), ["tube", "out"].includes(e.additional.where) && this.dispatch("coin-purse:tubes", this.coins.tubes), this.dispatch("coin-purse:coin-event", this.coins)), e;
3093
3090
  }, Vt = function(t, e) {
3091
+ const n = parseInt(t[2], 16);
3092
+ return e.name = "Banknote Inserted", e.no_code = 2, e.additional = { where: null, banknote: null }, n === 42 ? (e.name = "Banknote dispensed", e.description = "Banknote dispensed by request.", e.additional.banknote = i(this, d, Wt).call(this), e.additional.where = "out", e.no_code = 200) : n >= 128 && n <= 143 ? (e.name = "Banknote inserted", e.additional.where = "stacker") : n >= 144 && n <= 159 ? (e.name = "Banknote inserted in pre stacker", e.additional.where = "tmp") : n >= 160 && n <= 175 ? (e.name = "Banknote rejected", e.additional.where = "nothing") : n >= 176 && n <= 191 && (e.name = "Banknote inserted", e.additional.where = "recycler"), n >= 128 && n <= 191 && ([e.description, e.additional.banknote] = i(this, d, Ot).call(this, t[2]), e.no_code = 74 + n), i(this, d, Te).call(this, e.additional.banknote, e.additional.where), this.dispatch("banknote-purse:event-banknote", this.banknotes), e;
3093
+ }, Jt = function(t, e) {
3094
3094
  const n = parseInt(t, 16);
3095
3095
  return n === 1 ? (e.name = "Coin purse enabled", e.description = "Configuration complete, enabled", e.no_code = 3) : n === 0 ? (e.name = "Coin purse disabled", e.description = "Disabled by system request", e.no_code = 4) : (e.name = "Status unknown", e.description = "The response of coin purse doesn't identify successfully", e.no_code = 400), this.dispatch("coin-purse:config", { enabled: n === 1 }), e;
3096
- }, Jt = function(t, e) {
3096
+ }, zt = function(t, e) {
3097
3097
  const n = parseInt(t[2], 16), s = parseInt(t[3], 16);
3098
3098
  return n === 0 ? (e.name = "Bill purse disabled", e.description = "Configuration complete, disabled") : n === 1 && (e.name = "Bill purse enabled", e.description = "Configuration complete, enabled"), s === 0 ? e.additional.scrow = "Scrow disabled, banknote received automatic" : s === 1 && (e.additional.scrow = "Scrow enabled, require manual action"), e.no_code = 5, this.dispatch("banknote-purse:config", { enabled: n === 1, scrow: s === 1 }), e;
3099
- }, zt = function(t, e) {
3099
+ }, Gt = function(t, e) {
3100
3100
  e.no_code = 6;
3101
3101
  const [n, s, c, u, h, b] = [
3102
3102
  parseInt(t[2], 16),
@@ -3122,10 +3122,10 @@ ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt
3122
3122
  return e.additional = {
3123
3123
  banknotes: { b20: n, b50: s, b100: c, b200: u, b500: h, b1000: b }
3124
3124
  }, this.banknotes.recycler.p20 = n, this.banknotes.recycler.p50 = s, this.banknotes.recycler.p100 = c, this.banknotes.recycler.p200 = u, this.banknotes.recycler.p500 = h, this.banknotes.recycler.p1000 = b, this.banknotes.totals.p20 = (this.banknotes.stacker.p20 + n) * 20, this.banknotes.totals.p50 = (this.banknotes.stacker.p50 + s) * 50, this.banknotes.totals.p100 = (this.banknotes.stacker.p100 + c) * 100, this.banknotes.totals.p200 = (this.banknotes.stacker.p200 + u) * 200, this.banknotes.totals.p500 = (this.banknotes.stacker.p500 + h) * 500, this.banknotes.totals.p1000 = (this.banknotes.stacker.p1000 + b) * 1e3, this.banknotes.total = this.banknotes.totals.p20 + this.banknotes.totals.p50 + this.banknotes.totals.p100 + this.banknotes.totals.p200 + this.banknotes.totals.p500 + this.banknotes.totals.p1000, e.name = "Read recycler", e.description = "Quantity of banknotes approximated", this.dispatch("banknote-purse:recycler", this.banknotes.recycler), e;
3125
- }, Gt = function(t, e) {
3125
+ }, Yt = function(t, e) {
3126
3126
  const n = parseInt(t, 16);
3127
3127
  return n === 1 ? e.name = "Banknote accepted" : n === 0 ? e.name = "Banknote rejected" : e.name = "Unknown status banknote", e.no_code = 8, this.dispatch("banknote-purse:banknote-scrow-status", { status: n === 1 }), e;
3128
- }, Yt = function(t, e) {
3128
+ }, Kt = function(t, e) {
3129
3129
  const [n, s, c, u, h, b] = [
3130
3130
  parseInt(t[2], 16),
3131
3131
  parseInt(t[3], 16),
@@ -3144,31 +3144,31 @@ ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt
3144
3144
  type: "banknotes",
3145
3145
  data: e
3146
3146
  }), e;
3147
- }, Kt = function(t, e) {
3147
+ }, Zt = function(t, e) {
3148
3148
  return e.name = "Coins dispensed", e.no_code = 10, e.description = "Coins dispensed by request", isNaN(this.__sale.last_change) && (this.__sale.last_change = 0), this.__money_session.retired += this.__sale.last_change, this.dispatchAsync("session:money-dispensed", {
3149
3149
  type_money: null,
3150
3150
  retired: null,
3151
3151
  finish: !1,
3152
3152
  type: "coins"
3153
3153
  }, 500), e;
3154
- }, Zt = function(t, e) {
3154
+ }, Xt = function(t, e) {
3155
3155
  const n = parseInt(t, 16);
3156
3156
  return n === 1 ? (e.name = "Product not delivered", e.description = "The product requested wasn't delivered", e.no_code = 11, this.__internal__.dispense.status = !1) : n === 0 ? (e.name = "Product delivered", e.description = "The product requested was delivered", e.no_code = 12, this.__internal__.dispense.status = !0) : (e.name = "Unknown status product", e.description = "The response of product doesn't identify successfully", e.no_code = 400, this.__internal__.dispense.status = !1), this.dispatch("dispensed", {}), e;
3157
- }, Xt = function(t, e) {
3157
+ }, en = function(t, e) {
3158
3158
  let n = "closed";
3159
3159
  return t === "db" ? (e.name = "Door closed", e.no_code = 13) : t === "dc" ? (e.name = "Door open", e.no_code = 14, n = "open") : (e.name = "Unknown status door", e.description = "The response of door doesn't identify successfully", e.no_code = 400, n = "unknown"), this.__internal__.device.door_open = n === "open", this.dispatch("event:door", { open: n === "open" }), this.dispatch("door:event", { open: n === "open" }), e;
3160
- }, en = function(t, e) {
3160
+ }, tn = function(t, e) {
3161
3161
  const n = parseInt(t[2], 16) * 255, s = parseInt(t[3], 16), c = (n + s) * 0.1;
3162
3162
  return e.no_code = 15, e.name = "Temperature status", e.description = `Temperature: ${c}`, e.additional = {
3163
3163
  high: n,
3164
3164
  low: s,
3165
3165
  temperature: parseFloat(c.toString())
3166
3166
  }, this.dispatch("status:temperature", e.additional), e;
3167
- }, tn = function(t, e) {
3167
+ }, nn = function(t, e) {
3168
3168
  const n = parseInt(t, 16);
3169
3169
  let s = "unknown";
3170
3170
  return n === 1 ? (e.name = "Relay on", e.description = "Relay on", e.no_code = 16, s = "on") : n === 0 ? (e.name = "Relay off", e.description = "Relay off", e.no_code = 17, s = "off") : (e.name = "Status unknown", e.description = "Status unknown", e.no_code = 400), this.dispatch("status:relay", { enabled: s === "on" }), e;
3171
- }, nn = function(t, e) {
3171
+ }, rn = function(t, e) {
3172
3172
  const n = parseInt(t[2], 16);
3173
3173
  if (e.no_code = 20 + n, e.name = "Status unknown", e.description = "The status of card reader does not identified correctly", e.no_code = 400, n === 0)
3174
3174
  e.request += ":disable", e.name = "Card reader disabled", e.description = "Card reader device was disabled successfully";
@@ -3197,15 +3197,15 @@ ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt
3197
3197
  return t[11] = this.serialBoardroidSumHex(t), t.map((e, n) => {
3198
3198
  t[n] = this.hexMaker(e);
3199
3199
  }), t;
3200
- }, rn = function({ enable: t = !1, scrow: e = !1 } = {}) {
3200
+ }, sn = function({ enable: t = !1, scrow: e = !1 } = {}) {
3201
3201
  const n = t ? "FF" : "00", s = e ? "FF" : "00";
3202
3202
  return ["F1", "C0", n, n, s, s, "00", "00", "00", "00", "F2", "00"];
3203
- }, sn = function({ enable: t = !1, scrow: e = !1 } = {}) {
3203
+ }, an = function({ enable: t = !1, scrow: e = !1 } = {}) {
3204
3204
  return ["F1", "C0", t ? "01" : "00", e ? "01" : "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
3205
- }, an = function(t = 1) {
3205
+ }, on = function(t = 1) {
3206
3206
  if (t < 1) throw new Error("No banknotes to dispense");
3207
3207
  return t = this.decToHex(t), ["F1", "C5", this.decToHex(this.__banknote_purse.recycler.banknote.toString()), t, "00", "00", "00", "00", "00", "00", "F2", "00"];
3208
- }, on = function({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200: s = 0, $_500: c = 0, $_1000: u = 0 } = {}) {
3208
+ }, ln = function({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200: s = 0, $_500: c = 0, $_1000: u = 0 } = {}) {
3209
3209
  if ([t, e, n, s, c, u].some((h) => isNaN(h) || typeof h == "string"))
3210
3210
  throw new Error("One of the values is not a number");
3211
3211
  if (t < 1 && e < 1 && n < 1 && s < 1 && c < 1 && u < 1) throw new Error("No banknotes to dispense");
@@ -3218,15 +3218,15 @@ ee = new WeakMap(), J = new WeakMap(), z = new WeakMap(), d = new WeakSet(), Bt
3218
3218
  this.decToHex(u)
3219
3219
  ], ["F1", "C5", t, e, n, s, c, u, "00", "00", "F2", "00"];
3220
3220
  }, De = function() {
3221
- g(this, ee, !1), g(this, J, 0), g(this, z, 0);
3221
+ g(this, ee, !1), g(this, z, 0), g(this, G, 0);
3222
3222
  }, /**
3223
3223
  *
3224
3224
  * @param {null|object} dispensed
3225
3225
  * @param {number} limit
3226
3226
  */
3227
3227
  ue = function({ dispensed: t = null, limit: e = 80 } = {}) {
3228
- g(this, z, Math.round(y(this, J) * 100 / e)), this.dispatch("percentage:test", { percentage: y(this, z), dispensed: t });
3229
- }, ln = function(t) {
3228
+ g(this, G, Math.round(w(this, z) * 100 / e)), this.dispatch("percentage:test", { percentage: w(this, G), dispensed: t });
3229
+ }, cn = function(t) {
3230
3230
  const e = ["20", "50", "100", "200", "500"], n = this.__banknote_purse.recycler.banknote, s = "$_" + e[n], c = parseInt(e[n]), u = this.banknotes.recycler[`p${e[n]}`], h = Math.min(
3231
3231
  Math.floor(t / c),
3232
3232
  u
@@ -3236,7 +3236,7 @@ ue = function({ dispensed: t = null, limit: e = 80 } = {}) {
3236
3236
  will_dispense: h > 0
3237
3237
  };
3238
3238
  return this.totalInRecycler === 0 || h < 1 || t === 0 || (b.banknotes[s] = h, b.pending = parseFloat((t - h * c).toFixed(2))), b;
3239
- }, cn = function(t) {
3239
+ }, hn = function(t) {
3240
3240
  const e = {
3241
3241
  banknotes: { $_20: 0, $_50: 0, $_100: 0, $_200: 0, $_500: 0, $_1000: 0 },
3242
3242
  pending: t,
@@ -3251,7 +3251,7 @@ ue = function({ dispensed: t = null, limit: e = 80 } = {}) {
3251
3251
  };
3252
3252
  return n(1e3, "p1000"), n(500, "p500"), n(200, "p200"), n(100, "p100"), n(50, "p50"), n(20, "p20"), e.will_dispense = Object.values(e.banknotes).some((s) => s > 0), e;
3253
3253
  }, Ee = function(t) {
3254
- return i(this, d, he).call(this) ? i(this, d, ln).call(this, t) : i(this, d, cn).call(this, t);
3254
+ return i(this, d, he).call(this) ? i(this, d, cn).call(this, t) : i(this, d, hn).call(this, t);
3255
3255
  }, Ie = function(t) {
3256
3256
  const e = {
3257
3257
  coins: { $_50c: 0, $_1: 0, $_2: 0, $_5: 0, $_10: 0 },
@@ -3268,7 +3268,7 @@ ue = function({ dispensed: t = null, limit: e = 80 } = {}) {
3268
3268
  };
3269
3269
  return n(10, "p10"), n(5, "p5"), n(2, "p2"), n(1, "p1"), n(0.5, "g50", "$_50c"), e.will_dispense = Object.values(e.coins).some((s) => s > 0), e;
3270
3270
  }, Se = async function(t = null) {
3271
- if (!i(this, d, Nt).call(this)) throw new Error("Change not available");
3271
+ if (!i(this, d, qt).call(this)) throw new Error("Change not available");
3272
3272
  let e = this.change, n = this.change;
3273
3273
  if (t !== null && (e = t, n = t), n <= 0) return !1;
3274
3274
  const s = i(this, d, Ee).call(this, n);
@@ -3276,8 +3276,8 @@ ue = function({ dispensed: t = null, limit: e = 80 } = {}) {
3276
3276
  const c = i(this, d, Ie).call(this, n);
3277
3277
  return n = c.pending, n > 0 && this.dispatch("change:pending", { pending: n }), n === e ? !1 : (s.will_dispense && await this.banknotePurseDispense(s.banknotes), c.will_dispense && await this.coinPurseDispense(c.coins), !0);
3278
3278
  };
3279
- var $, hn, dn;
3280
- class Dn extends G {
3279
+ var $, dn, un;
3280
+ class In extends Y {
3281
3281
  constructor({
3282
3282
  filters: t = null,
3283
3283
  config_port: e = null,
@@ -3286,7 +3286,7 @@ class Dn extends G {
3286
3286
  super({ filters: t, config_port: e, no_device: n });
3287
3287
  S(this, $);
3288
3288
  if (this.__internal__.device.type = "arduino", D.getCustom(this.typeDevice, n)) throw new Error(`Device ${this.typeDevice} ${n} already exists`);
3289
- this.__internal__.time.response_connection = 2e3, this.__internal__.time.response_general = 2e3, this.__internal__.serial.delay_first_connection = 1e3, i(this, $, dn).call(this), i(this, $, hn).call(this);
3289
+ this.__internal__.time.response_connection = 2e3, this.__internal__.time.response_general = 2e3, this.__internal__.serial.delay_first_connection = 1e3, i(this, $, un).call(this), i(this, $, dn).call(this);
3290
3290
  }
3291
3291
  serialMessage(t) {
3292
3292
  const e = {
@@ -3348,9 +3348,9 @@ class Dn extends G {
3348
3348
  await this.sayCredits(), await this.sayAra(), await this.sayHi();
3349
3349
  }
3350
3350
  }
3351
- $ = new WeakSet(), hn = function() {
3351
+ $ = new WeakSet(), dn = function() {
3352
3352
  D.addCustom("arduino", this);
3353
- }, dn = function() {
3353
+ }, un = function() {
3354
3354
  };
3355
3355
  /**
3356
3356
  * @license Webserial
@@ -3361,20 +3361,20 @@ $ = new WeakSet(), hn = function() {
3361
3361
  * This source code is licensed under the MIT license found in the
3362
3362
  * LICENSE file in the root directory of this source tree.
3363
3363
  */
3364
- const En = {
3364
+ const Sn = {
3365
3365
  wait: W,
3366
3366
  getSeconds: we,
3367
- supportWebSerial: Be
3368
- }, In = "4.0.6";
3367
+ supportWebSerial: Ae
3368
+ }, Mn = "4.0.6";
3369
3369
  export {
3370
- Dn as Arduino,
3371
- Tn as Boardroid,
3370
+ In as Arduino,
3371
+ En as Boardroid,
3372
3372
  D as Devices,
3373
3373
  pe as Emulator,
3374
- gn as Jofemar,
3375
- G as Kernel,
3376
- xn as Locker,
3377
- Cn as Relay,
3378
- En as utils,
3379
- In as version
3374
+ Dn as Jofemar,
3375
+ Y as Kernel,
3376
+ Tn as Locker,
3377
+ gn as Relay,
3378
+ Sn as utils,
3379
+ Mn as version
3380
3380
  };