@danidoble/webserial 4.2.3 → 4.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,35 @@
1
- var he = Object.defineProperty;
2
- var V = (l) => {
1
+ var ce = Object.defineProperty;
2
+ var W = (l) => {
3
3
  throw TypeError(l);
4
4
  };
5
- var de = (l, e, t) => e in l ? he(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
6
- var F = (l, e, t) => de(l, typeof e != "symbol" ? e + "" : e, t), j = (l, e, t) => e.has(l) || V("Cannot " + t);
7
- var w = (l, e, t) => (j(l, e, "read from private field"), t ? t.call(l) : e.get(l)), I = (l, e, t) => e.has(l) ? V("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), L = (l, e, t, n) => (j(l, e, "write to private field"), n ? n.call(l, t) : e.set(l, t), t), a = (l, e, t) => (j(l, e, "access private method"), t);
8
- function fe(l = 100) {
5
+ var ue = (l, e, t) => e in l ? ce(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
6
+ var N = (l, e, t) => ue(l, typeof e != "symbol" ? e + "" : e, t), F = (l, e, t) => e.has(l) || W("Cannot " + t);
7
+ var w = (l, e, t) => (F(l, e, "read from private field"), t ? t.call(l) : e.get(l)), U = (l, e, t) => e.has(l) ? W("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), j = (l, e, t, n) => (F(l, e, "write to private field"), n ? n.call(l, t) : e.set(l, t), t), a = (l, e, t) => (F(l, e, "access private method"), t);
8
+ function _e(l = 100) {
9
9
  return new Promise((e) => setTimeout(() => e(), l));
10
10
  }
11
- function Me() {
11
+ function ve() {
12
12
  return "serial" in navigator;
13
13
  }
14
- function Te() {
14
+ function ke() {
15
15
  return "geolocation" in navigator;
16
16
  }
17
- function Pe() {
17
+ function Ce() {
18
18
  return "crypto" in window;
19
19
  }
20
- function Ue(l = 1) {
20
+ function De(l = 1) {
21
21
  return l * 1e3;
22
22
  }
23
- function Be(l) {
23
+ function Ae(l) {
24
24
  return l == null || l === "";
25
25
  }
26
- var k, A, i, te, ne, c, $, p, d, N, o, H, P;
26
+ var v, A, s, Y, Z, c, O, p, d, I, o, $, T;
27
27
  const r = class r {
28
28
  static status(e = null) {
29
- var n, s;
30
- if (!a(n = r, i, c).call(n, e)) return !1;
29
+ var n, i;
30
+ if (!a(n = r, s, c).call(n, e)) return !1;
31
31
  let t = [];
32
- switch (w(r, k)) {
32
+ switch (w(r, v)) {
33
33
  case "locker":
34
34
  t = ["0", "8"];
35
35
  break;
@@ -42,13 +42,13 @@ const r = class r {
42
42
  default:
43
43
  return !1;
44
44
  }
45
- a(s = r, i, o).call(s, t);
45
+ a(i = r, s, o).call(i, t);
46
46
  }
47
47
  static dispensed(e = null) {
48
- var n, s;
49
- if (!a(n = r, i, c).call(n, e)) return !1;
48
+ var n, i;
49
+ if (!a(n = r, s, c).call(n, e)) return !1;
50
50
  let t = [];
51
- switch (w(r, k)) {
51
+ switch (w(r, v)) {
52
52
  case "locker":
53
53
  t = ["0", "7", "4", "4", "4"];
54
54
  break;
@@ -61,13 +61,13 @@ const r = class r {
61
61
  default:
62
62
  return !1;
63
63
  }
64
- a(s = r, i, o).call(s, t);
64
+ a(i = r, s, o).call(i, t);
65
65
  }
66
66
  static notDispensed(e = null) {
67
- var n, s;
68
- if (!a(n = r, i, c).call(n, e)) return !1;
67
+ var n, i;
68
+ if (!a(n = r, s, c).call(n, e)) return !1;
69
69
  let t = [];
70
- switch (w(r, k)) {
70
+ switch (w(r, v)) {
71
71
  case "locker":
72
72
  t = ["0", "7", "5", "5", "5"];
73
73
  break;
@@ -80,30 +80,30 @@ const r = class r {
80
80
  default:
81
81
  return !1;
82
82
  }
83
- a(s = r, i, o).call(s, t);
83
+ a(i = r, s, o).call(i, t);
84
84
  }
85
85
  static gateInactive(e = null) {
86
86
  var t;
87
- if (!a(t = r, i, c).call(t, e) || !a(this, i, $).call(this)) return !1;
88
- a(this, i, o).call(this, ["0", "7", "5", "5", "5"]);
87
+ if (!a(t = r, s, c).call(t, e) || !a(this, s, O).call(this)) return !1;
88
+ a(this, s, o).call(this, ["0", "7", "5", "5", "5"]);
89
89
  }
90
90
  static gateConfigured(e = null) {
91
91
  var t;
92
- if (!a(t = r, i, c).call(t, e) || !a(this, i, $).call(this)) return !1;
93
- a(this, i, o).call(this, ["0", "6"]);
92
+ if (!a(t = r, s, c).call(t, e) || !a(this, s, O).call(this)) return !1;
93
+ a(this, s, o).call(this, ["0", "6"]);
94
94
  }
95
95
  static keyPressed(e = null) {
96
96
  var u, g, f;
97
- if (!a(u = r, i, c).call(u, e) || !a(g = r, i, d).call(g)) return !1;
98
- const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], n = (128 + w(r, A)).toString(16), s = Math.floor(Math.random() * 15);
99
- a(f = r, i, o).call(f, ["2", n, "54", t[s]]);
97
+ if (!a(u = r, s, c).call(u, e) || !a(g = r, s, d).call(g)) return !1;
98
+ const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], n = (128 + w(r, A)).toString(16), i = Math.floor(Math.random() * 15);
99
+ a(f = r, s, o).call(f, ["2", n, "54", t[i]]);
100
100
  }
101
101
  static doorOpened(e = null) {
102
- var s, u;
103
- if (!a(s = r, i, c).call(s, e) || !a(this, i, N).call(this)) return !1;
102
+ var i, u;
103
+ if (!a(i = r, s, c).call(i, e) || !a(this, s, I).call(this)) return !1;
104
104
  let t = [];
105
105
  const n = (128 + w(r, A)).toString(16);
106
- switch (w(r, k)) {
106
+ switch (w(r, v)) {
107
107
  case "boardroid":
108
108
  t = ["2", "D8", "dc"];
109
109
  break;
@@ -111,14 +111,14 @@ const r = class r {
111
111
  t = ["2", n, "50", "4F"];
112
112
  break;
113
113
  }
114
- a(u = r, i, o).call(u, t);
114
+ a(u = r, s, o).call(u, t);
115
115
  }
116
116
  static doorClosed(e = null) {
117
- var s, u;
118
- if (!a(s = r, i, c).call(s, e) || !a(this, i, N).call(this)) return !1;
117
+ var i, u;
118
+ if (!a(i = r, s, c).call(i, e) || !a(this, s, I).call(this)) return !1;
119
119
  let t = [];
120
120
  const n = (128 + w(r, A)).toString(16);
121
- switch (w(r, k)) {
121
+ switch (w(r, v)) {
122
122
  case "boardroid":
123
123
  t = ["2", "D8", "db"];
124
124
  break;
@@ -126,38 +126,38 @@ const r = class r {
126
126
  t = ["2", n, "50", "43"];
127
127
  break;
128
128
  }
129
- a(u = r, i, o).call(u, t);
129
+ a(u = r, s, o).call(u, t);
130
130
  }
131
131
  static channelDisconnected(e = null) {
132
- var n, s, u;
133
- if (!a(n = r, i, c).call(n, e) || !a(s = r, i, d).call(s)) return !1;
132
+ var n, i, u;
133
+ if (!a(n = r, s, c).call(n, e) || !a(i = r, s, d).call(i)) return !1;
134
134
  const t = (128 + w(r, A)).toString(16);
135
- a(u = r, i, o).call(u, ["2", t, "43", "43", "43", "FD"]);
135
+ a(u = r, s, o).call(u, ["2", t, "43", "43", "43", "FD"]);
136
136
  }
137
137
  static channelConnected(e = null) {
138
- var n, s, u;
139
- if (!a(n = r, i, c).call(n, e) || !a(s = r, i, d).call(s)) return !1;
138
+ var n, i, u;
139
+ if (!a(n = r, s, c).call(n, e) || !a(i = r, s, d).call(i)) return !1;
140
140
  const t = (128 + w(r, A)).toString(16);
141
- a(u = r, i, o).call(u, ["2", t, "43", "43", "43", "FC"]);
141
+ a(u = r, s, o).call(u, ["2", t, "43", "43", "43", "FC"]);
142
142
  }
143
143
  static channelEmpty(e = null) {
144
- var n, s, u;
145
- if (!a(n = r, i, c).call(n, e) || !a(s = r, i, d).call(s)) return !1;
144
+ var n, i, u;
145
+ if (!a(n = r, s, c).call(n, e) || !a(i = r, s, d).call(i)) return !1;
146
146
  const t = (128 + w(r, A)).toString(16);
147
- a(u = r, i, o).call(u, ["2", t, "43", "43", "43", "FF"]);
147
+ a(u = r, s, o).call(u, ["2", t, "43", "43", "43", "FF"]);
148
148
  }
149
149
  static workingTemperature(e = null) {
150
- var n, s, u;
151
- if (!a(n = r, i, c).call(n, e) || !a(s = r, i, d).call(s)) return !1;
150
+ var n, i, u;
151
+ if (!a(n = r, s, c).call(n, e) || !a(i = r, s, d).call(i)) return !1;
152
152
  const t = (128 + w(r, A)).toString(16);
153
- a(u = r, i, o).call(u, ["2", t, "43", "54", "16"]);
153
+ a(u = r, s, o).call(u, ["2", t, "43", "54", "16"]);
154
154
  }
155
155
  static currentTemperature(e = null) {
156
- var s, u, g;
157
- if (!a(s = r, i, c).call(s, e) || !a(u = r, i, N).call(u)) return !1;
156
+ var i, u, g;
157
+ if (!a(i = r, s, c).call(i, e) || !a(u = r, s, I).call(u)) return !1;
158
158
  let t = [];
159
159
  const n = (128 + w(r, A)).toString(16);
160
- switch (w(r, k)) {
160
+ switch (w(r, v)) {
161
161
  case "boardroid":
162
162
  t = ["2", "D9", "44", "30"];
163
163
  break;
@@ -165,217 +165,217 @@ const r = class r {
165
165
  t = ["2", n, "43", "74", "2B", "30", "39", "2E", "31", "7F", "43"];
166
166
  break;
167
167
  }
168
- a(g = r, i, o).call(g, t);
168
+ a(g = r, s, o).call(g, t);
169
169
  }
170
170
  static ready(e = null) {
171
- var t, n, s;
172
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
173
- a(s = r, i, o).call(s, ["6", "30"]);
171
+ var t, n, i;
172
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
173
+ a(i = r, s, o).call(i, ["6", "30"]);
174
174
  }
175
175
  static busy(e = null) {
176
- var t, n, s;
177
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
178
- a(s = r, i, o).call(s, ["6", "31"]);
176
+ var t, n, i;
177
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
178
+ a(i = r, s, o).call(i, ["6", "31"]);
179
179
  }
180
180
  static invalidTray(e = null) {
181
- var t, n, s;
182
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
183
- a(s = r, i, o).call(s, ["6", "32"]);
181
+ var t, n, i;
182
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
183
+ a(i = r, s, o).call(i, ["6", "32"]);
184
184
  }
185
185
  static invalidChannel(e = null) {
186
- var t, n, s;
187
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
188
- a(s = r, i, o).call(s, ["6", "33"]);
186
+ var t, n, i;
187
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
188
+ a(i = r, s, o).call(i, ["6", "33"]);
189
189
  }
190
190
  static emptyChannel(e = null) {
191
- var t, n, s;
192
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
193
- a(s = r, i, o).call(s, ["6", "34"]);
191
+ var t, n, i;
192
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
193
+ a(i = r, s, o).call(i, ["6", "34"]);
194
194
  }
195
195
  static elevatorJam(e = null) {
196
- var t, n, s;
197
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
198
- a(s = r, i, o).call(s, ["6", "35"]);
196
+ var t, n, i;
197
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
198
+ a(i = r, s, o).call(i, ["6", "35"]);
199
199
  }
200
200
  static elevatorMalfunction(e = null) {
201
- var t, n, s;
202
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
203
- a(s = r, i, o).call(s, ["6", "36"]);
201
+ var t, n, i;
202
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
203
+ a(i = r, s, o).call(i, ["6", "36"]);
204
204
  }
205
205
  static phototransistorFailure(e = null) {
206
- var t, n, s;
207
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
208
- a(s = r, i, o).call(s, ["6", "37"]);
206
+ var t, n, i;
207
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
208
+ a(i = r, s, o).call(i, ["6", "37"]);
209
209
  }
210
210
  static allChannelsEmpty(e = null) {
211
- var t, n, s;
212
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
213
- a(s = r, i, o).call(s, ["6", "38"]);
211
+ var t, n, i;
212
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
213
+ a(i = r, s, o).call(i, ["6", "38"]);
214
214
  }
215
215
  static productDetectorFailure(e = null) {
216
- var t, n, s;
217
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
218
- a(s = r, i, o).call(s, ["6", "39"]);
216
+ var t, n, i;
217
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
218
+ a(i = r, s, o).call(i, ["6", "39"]);
219
219
  }
220
220
  static displayDisconnected(e = null) {
221
- var t, n, s;
222
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
223
- a(s = r, i, o).call(s, ["6", "41"]);
221
+ var t, n, i;
222
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
223
+ a(i = r, s, o).call(i, ["6", "41"]);
224
224
  }
225
225
  static productUnderElevator(e = null) {
226
- var t, n, s;
227
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
228
- a(s = r, i, o).call(s, ["6", "42"]);
226
+ var t, n, i;
227
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
228
+ a(i = r, s, o).call(i, ["6", "42"]);
229
229
  }
230
230
  static elevatorSettingAlarm(e = null) {
231
- var t, n, s;
232
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
233
- a(s = r, i, o).call(s, ["6", "43"]);
231
+ var t, n, i;
232
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
233
+ a(i = r, s, o).call(i, ["6", "43"]);
234
234
  }
235
235
  static buttonPanelFailure(e = null) {
236
- var t, n, s;
237
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
238
- a(s = r, i, o).call(s, ["6", "44"]);
236
+ var t, n, i;
237
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
238
+ a(i = r, s, o).call(i, ["6", "44"]);
239
239
  }
240
240
  static errorWritingEeprom(e = null) {
241
- var t, n, s;
242
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
243
- a(s = r, i, o).call(s, ["6", "45"]);
241
+ var t, n, i;
242
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
243
+ a(i = r, s, o).call(i, ["6", "45"]);
244
244
  }
245
245
  static errorControlTemperature(e = null) {
246
- var t, n, s;
247
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
248
- a(s = r, i, o).call(s, ["6", "46"]);
246
+ var t, n, i;
247
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
248
+ a(i = r, s, o).call(i, ["6", "46"]);
249
249
  }
250
250
  static thermometerDisconnected(e = null) {
251
- var t, n, s;
252
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
253
- a(s = r, i, o).call(s, ["6", "47"]);
251
+ var t, n, i;
252
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
253
+ a(i = r, s, o).call(i, ["6", "47"]);
254
254
  }
255
255
  static thermometerMisconfigured(e = null) {
256
- var t, n, s;
257
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
258
- a(s = r, i, o).call(s, ["6", "48"]);
256
+ var t, n, i;
257
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
258
+ a(i = r, s, o).call(i, ["6", "48"]);
259
259
  }
260
260
  static thermometerFailure(e = null) {
261
- var t, n, s;
262
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
263
- a(s = r, i, o).call(s, ["6", "49"]);
261
+ var t, n, i;
262
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
263
+ a(i = r, s, o).call(i, ["6", "49"]);
264
264
  }
265
265
  static errorExtractorConsumption(e = null) {
266
- var t, n, s;
267
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
268
- a(s = r, i, o).call(s, ["6", "4A"]);
266
+ var t, n, i;
267
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
268
+ a(i = r, s, o).call(i, ["6", "4A"]);
269
269
  }
270
270
  static channelSearchError(e = null) {
271
- var t, n, s;
272
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
273
- a(s = r, i, o).call(s, ["6", "4B"]);
271
+ var t, n, i;
272
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
273
+ a(i = r, s, o).call(i, ["6", "4B"]);
274
274
  }
275
275
  static productExitMouthSearchError(e = null) {
276
- var t, n, s;
277
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
278
- a(s = r, i, o).call(s, ["6", "4C"]);
276
+ var t, n, i;
277
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
278
+ a(i = r, s, o).call(i, ["6", "4C"]);
279
279
  }
280
280
  static elevatorInteriorLocked(e = null) {
281
- var t, n, s;
282
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
283
- a(s = r, i, o).call(s, ["6", "4D"]);
281
+ var t, n, i;
282
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
283
+ a(i = r, s, o).call(i, ["6", "4D"]);
284
284
  }
285
285
  static productDetectorVerifierError(e = null) {
286
- var t, n, s;
287
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
288
- a(s = r, i, o).call(s, ["6", "4E"]);
286
+ var t, n, i;
287
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
288
+ a(i = r, s, o).call(i, ["6", "4E"]);
289
289
  }
290
290
  static waitingForProductRecall(e = null) {
291
- var t, n, s;
292
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
293
- a(s = r, i, o).call(s, ["6", "4F"]);
291
+ var t, n, i;
292
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
293
+ a(i = r, s, o).call(i, ["6", "4F"]);
294
294
  }
295
295
  static productExpiredByTemperature(e = null) {
296
- var t, n, s;
297
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
298
- a(s = r, i, o).call(s, ["6", "50"]);
296
+ var t, n, i;
297
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
298
+ a(i = r, s, o).call(i, ["6", "50"]);
299
299
  }
300
300
  static faultyAutomaticDoor(e = null) {
301
- var t, n, s;
302
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
303
- a(s = r, i, o).call(s, ["6", "51"]);
301
+ var t, n, i;
302
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
303
+ a(i = r, s, o).call(i, ["6", "51"]);
304
304
  }
305
305
  static rejectLever(e = null) {
306
- var t, n, s;
307
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
308
- a(s = r, i, o).call(s, ["2", "A0", "1"]);
306
+ var t, n, i;
307
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
308
+ a(i = r, s, o).call(i, ["2", "A0", "1"]);
309
309
  }
310
310
  static resetCoinPurse(e = null) {
311
- var t, n, s;
312
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
313
- a(s = r, i, o).call(s, ["2", "A0", "2"]);
311
+ var t, n, i;
312
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
313
+ a(i = r, s, o).call(i, ["2", "A0", "2"]);
314
314
  }
315
315
  static coinInsertedBox(e = null, t = null) {
316
316
  var u, g, f, h;
317
- if (!a(u = r, i, c).call(u, e) || !a(g = r, i, p).call(g)) return !1;
318
- const n = ["40", "41", "42", "43", "44", "45"], s = a(f = r, i, H).call(f, n, t);
319
- a(h = r, i, o).call(h, ["2", "A0", s]);
317
+ if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
318
+ const n = ["40", "41", "42", "43", "44", "45"], i = a(f = r, s, $).call(f, n, t);
319
+ a(h = r, s, o).call(h, ["2", "A0", i]);
320
320
  }
321
321
  static coinInsertedTube(e = null, t = null) {
322
322
  var u, g, f, h;
323
- if (!a(u = r, i, c).call(u, e) || !a(g = r, i, p).call(g)) return !1;
324
- const n = ["50", "51", "52", "53", "54", "55"], s = a(f = r, i, H).call(f, n, t);
325
- a(h = r, i, o).call(h, ["2", "A0", s]);
323
+ if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
324
+ const n = ["50", "51", "52", "53", "54", "55"], i = a(f = r, s, $).call(f, n, t);
325
+ a(h = r, s, o).call(h, ["2", "A0", i]);
326
326
  }
327
327
  static banknoteInsertedStacker(e = null, t = null) {
328
328
  var u, g, f, h;
329
- if (!a(u = r, i, c).call(u, e) || !a(g = r, i, p).call(g)) return !1;
330
- const n = ["80", "81", "82", "83", "84"], s = a(f = r, i, P).call(f, n, t);
331
- a(h = r, i, o).call(h, ["2", "B0", s]);
329
+ if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
330
+ const n = ["80", "81", "82", "83", "84"], i = a(f = r, s, T).call(f, n, t);
331
+ a(h = r, s, o).call(h, ["2", "B0", i]);
332
332
  }
333
333
  static banknoteInsertedEscrow(e = null, t = null) {
334
334
  var u, g, f, h;
335
- if (!a(u = r, i, c).call(u, e) || !a(g = r, i, p).call(g)) return !1;
336
- const n = ["90", "91", "92", "93", "94"], s = a(f = r, i, P).call(f, n, t);
337
- a(h = r, i, o).call(h, ["2", "B0", s]);
335
+ if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
336
+ const n = ["90", "91", "92", "93", "94"], i = a(f = r, s, T).call(f, n, t);
337
+ a(h = r, s, o).call(h, ["2", "B0", i]);
338
338
  }
339
339
  static banknoteEjected(e = null, t = null) {
340
340
  var u, g, f, h;
341
- if (!a(u = r, i, c).call(u, e) || !a(g = r, i, p).call(g)) return !1;
342
- const n = ["A0", "A1", "A2", "A3", "A4"], s = a(f = r, i, P).call(f, n, t);
343
- a(h = r, i, o).call(h, ["2", "B0", s]);
341
+ if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
342
+ const n = ["A0", "A1", "A2", "A3", "A4"], i = a(f = r, s, T).call(f, n, t);
343
+ a(h = r, s, o).call(h, ["2", "B0", i]);
344
344
  }
345
345
  static banknoteInsertedRecycler(e = null, t = null) {
346
346
  var u, g, f, h;
347
- if (!a(u = r, i, c).call(u, e) || !a(g = r, i, p).call(g)) return !1;
348
- const n = ["B0", "B1", "B2", "B3", "B4"], s = a(f = r, i, P).call(f, n, t);
349
- a(h = r, i, o).call(h, ["2", "B0", s]);
347
+ if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
348
+ const n = ["B0", "B1", "B2", "B3", "B4"], i = a(f = r, s, T).call(f, n, t);
349
+ a(h = r, s, o).call(h, ["2", "B0", i]);
350
350
  }
351
351
  static banknoteTaken(e = null) {
352
- var t, n, s;
353
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
354
- a(s = r, i, o).call(s, ["2", "B0", "2a"]);
352
+ var t, n, i;
353
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
354
+ a(i = r, s, o).call(i, ["2", "B0", "2a"]);
355
355
  }
356
356
  static coinPurseEnabled(e = null) {
357
- var t, n, s;
358
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
359
- a(s = r, i, o).call(s, ["2", "D0", "1"]);
357
+ var t, n, i;
358
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
359
+ a(i = r, s, o).call(i, ["2", "D0", "1"]);
360
360
  }
361
361
  static coinPurseDisabled(e = null) {
362
- var t, n, s;
363
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
364
- a(s = r, i, o).call(s, ["2", "D0", "0"]);
362
+ var t, n, i;
363
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
364
+ a(i = r, s, o).call(i, ["2", "D0", "0"]);
365
365
  }
366
366
  static billPurseDisabled(e = null) {
367
- var t, n, s;
368
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
369
- a(s = r, i, o).call(s, ["2", "D1", "0", "0"]);
367
+ var t, n, i;
368
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
369
+ a(i = r, s, o).call(i, ["2", "D1", "0", "0"]);
370
370
  }
371
371
  static billPurseEnabled(e = null) {
372
- var t, n, s;
373
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
374
- a(s = r, i, o).call(s, ["2", "D1", "1", "1"]);
372
+ var t, n, i;
373
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
374
+ a(i = r, s, o).call(i, ["2", "D1", "1", "1"]);
375
375
  }
376
376
  static readTubes(e = null) {
377
- var C, D, S;
378
- if (!a(C = r, i, c).call(C, e) || !a(D = r, i, p).call(D)) return !1;
377
+ var k, C, D;
378
+ if (!a(k = r, s, c).call(k, e) || !a(C = r, s, p).call(C)) return !1;
379
379
  const t = [
380
380
  "0",
381
381
  "1",
@@ -409,7 +409,7 @@ const r = class r {
409
409
  "1d",
410
410
  "1e",
411
411
  "1f"
412
- ], [n, s, u, g, f, h] = [
412
+ ], [n, i, u, g, f, h] = [
413
413
  t[Math.floor(Math.random() * 30)],
414
414
  t[Math.floor(Math.random() * 30)],
415
415
  t[Math.floor(Math.random() * 30)],
@@ -417,11 +417,11 @@ const r = class r {
417
417
  t[Math.floor(Math.random() * 30)],
418
418
  t[Math.floor(Math.random() * 30)]
419
419
  ];
420
- a(S = r, i, o).call(S, ["2", "D2", n, s, u, g, f, h]);
420
+ a(D = r, s, o).call(D, ["2", "D2", n, i, u, g, f, h]);
421
421
  }
422
422
  static readBillPurse(e = null, t = null) {
423
- var s, u, g, f;
424
- if (!a(s = r, i, c).call(s, e) || !a(u = r, i, p).call(u)) return !1;
423
+ var i, u, g, f;
424
+ if (!a(i = r, s, c).call(i, e) || !a(u = r, s, p).call(u)) return !1;
425
425
  let n = [
426
426
  "0",
427
427
  "1",
@@ -455,46 +455,46 @@ const r = class r {
455
455
  ];
456
456
  if (e._recycler.ict) {
457
457
  const h = n[Math.floor(Math.random() * 31)];
458
- let C = "0", D = "0", S = "0", x = "0", T = "0";
458
+ let k = "0", C = "0", D = "0", S = "0", M = "0";
459
459
  if (t !== null && !isNaN(parseInt(t)))
460
460
  switch (t.toString()) {
461
461
  case "20":
462
- C = h;
462
+ k = h;
463
463
  break;
464
464
  case "50":
465
- D = h;
465
+ C = h;
466
466
  break;
467
467
  case "100":
468
- S = h;
468
+ D = h;
469
469
  break;
470
470
  case "200":
471
- x = h;
471
+ S = h;
472
472
  break;
473
473
  case "500":
474
- T = h;
474
+ M = h;
475
475
  break;
476
476
  }
477
477
  else
478
478
  switch (e._recycler.bill) {
479
479
  case 0:
480
- C = h;
480
+ k = h;
481
481
  break;
482
482
  case 1:
483
- D = h;
483
+ C = h;
484
484
  break;
485
485
  case 2:
486
- S = h;
486
+ D = h;
487
487
  break;
488
488
  case 3:
489
- x = h;
489
+ S = h;
490
490
  break;
491
491
  case 4:
492
- T = h;
492
+ M = h;
493
493
  break;
494
494
  }
495
- a(g = r, i, o).call(g, ["2", "D3", C, D, S, x, T, "0"]);
495
+ a(g = r, s, o).call(g, ["2", "D3", k, C, D, S, M, "0"]);
496
496
  } else {
497
- const [h, C, D, S, x, T] = [
497
+ const [h, k, C, D, S, M] = [
498
498
  n[Math.floor(Math.random() * 30)],
499
499
  n[Math.floor(Math.random() * 30)],
500
500
  n[Math.floor(Math.random() * 30)],
@@ -502,22 +502,22 @@ const r = class r {
502
502
  n[Math.floor(Math.random())],
503
503
  n[Math.floor(Math.random())]
504
504
  ];
505
- a(f = r, i, o).call(f, ["2", "D3", h, C, D, S, x, T]);
505
+ a(f = r, s, o).call(f, ["2", "D3", h, k, C, D, S, M]);
506
506
  }
507
507
  }
508
508
  static banknoteAccepted(e = null) {
509
- var t, n, s;
510
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
511
- a(s = r, i, o).call(s, ["2", "D4", "1"]);
509
+ var t, n, i;
510
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
511
+ a(i = r, s, o).call(i, ["2", "D4", "1"]);
512
512
  }
513
513
  static banknoteRejected(e = null) {
514
- var t, n, s;
515
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
516
- a(s = r, i, o).call(s, ["2", "D4", "0"]);
514
+ var t, n, i;
515
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
516
+ a(i = r, s, o).call(i, ["2", "D4", "0"]);
517
517
  }
518
518
  static banknotesDispensed(e = null) {
519
- var n, s, u, g;
520
- if (!a(n = r, i, c).call(n, e) || !a(s = r, i, p).call(s)) return !1;
519
+ var n, i, u, g;
520
+ if (!a(n = r, s, c).call(n, e) || !a(i = r, s, p).call(i)) return !1;
521
521
  let t = [
522
522
  "1",
523
523
  "2",
@@ -550,27 +550,27 @@ const r = class r {
550
550
  ];
551
551
  if (e._recycler.ict) {
552
552
  const f = t[Math.floor(Math.random() * 30)];
553
- let h = "0", C = "0", D = "0", S = "0", x = "0";
553
+ let h = "0", k = "0", C = "0", D = "0", S = "0";
554
554
  switch (e._recycler.bill) {
555
555
  case 0:
556
556
  h = f;
557
557
  break;
558
558
  case 1:
559
- C = f;
559
+ k = f;
560
560
  break;
561
561
  case 2:
562
- D = f;
562
+ C = f;
563
563
  break;
564
564
  case 3:
565
- S = f;
565
+ D = f;
566
566
  break;
567
567
  case 4:
568
- x = f;
568
+ S = f;
569
569
  break;
570
570
  }
571
- a(u = r, i, o).call(u, ["2", "D5", h, C, D, S, x, "0"]);
571
+ a(u = r, s, o).call(u, ["2", "D5", h, k, C, D, S, "0"]);
572
572
  } else {
573
- const [f, h, C, D, S, x] = [
573
+ const [f, h, k, C, D, S] = [
574
574
  t[Math.floor(Math.random() * 30)],
575
575
  t[Math.floor(Math.random() * 30)],
576
576
  t[Math.floor(Math.random() * 30)],
@@ -578,111 +578,111 @@ const r = class r {
578
578
  t[Math.floor(Math.random())],
579
579
  t[Math.floor(Math.random())]
580
580
  ];
581
- a(g = r, i, o).call(g, ["2", "D5", f, h, C, D, S, x]);
581
+ a(g = r, s, o).call(g, ["2", "D5", f, h, k, C, D, S]);
582
582
  }
583
583
  }
584
584
  static coinsDispensed(e = null) {
585
- var t, n, s;
586
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
587
- a(s = r, i, o).call(s, ["2", "D6"]);
585
+ var t, n, i;
586
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
587
+ a(i = r, s, o).call(i, ["2", "D6"]);
588
588
  }
589
589
  static relayOn(e = null) {
590
- var t, n, s;
591
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
592
- a(s = r, i, o).call(s, ["2", "DA", "1"]);
590
+ var t, n, i;
591
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
592
+ a(i = r, s, o).call(i, ["2", "DA", "1"]);
593
593
  }
594
594
  static relayOff(e = null) {
595
- var t, n, s;
596
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
597
- a(s = r, i, o).call(s, ["2", "DA", "0"]);
595
+ var t, n, i;
596
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
597
+ a(i = r, s, o).call(i, ["2", "DA", "0"]);
598
598
  }
599
599
  static nayaxEnabled(e = null) {
600
- var t, n, s;
601
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
602
- a(s = r, i, o).call(s, ["2", "DD", "1"]);
600
+ var t, n, i;
601
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
602
+ a(i = r, s, o).call(i, ["2", "DD", "1"]);
603
603
  }
604
604
  static nayaxDisabled(e = null) {
605
- var t, n, s;
606
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
607
- a(s = r, i, o).call(s, ["2", "DD", "0"]);
605
+ var t, n, i;
606
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
607
+ a(i = r, s, o).call(i, ["2", "DD", "0"]);
608
608
  }
609
609
  static nayaxPreCreditAuthorized(e = null) {
610
- var t, n, s;
611
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
612
- a(s = r, i, o).call(s, ["2", "DD", "3"]);
610
+ var t, n, i;
611
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
612
+ a(i = r, s, o).call(i, ["2", "DD", "3"]);
613
613
  }
614
614
  static nayaxCancelRequest(e = null) {
615
- var t, n, s;
616
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
617
- a(s = r, i, o).call(s, ["2", "DD", "4"]);
615
+ var t, n, i;
616
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
617
+ a(i = r, s, o).call(i, ["2", "DD", "4"]);
618
618
  }
619
619
  static nayaxSellApproved(e = null) {
620
- var t, n, s;
621
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
622
- a(s = r, i, o).call(s, ["2", "DD", "5"]);
620
+ var t, n, i;
621
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
622
+ a(i = r, s, o).call(i, ["2", "DD", "5"]);
623
623
  }
624
624
  static nayaxSellDenied(e = null) {
625
- var t, n, s;
626
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
627
- a(s = r, i, o).call(s, ["2", "DD", "6"]);
625
+ var t, n, i;
626
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
627
+ a(i = r, s, o).call(i, ["2", "DD", "6"]);
628
628
  }
629
629
  static nayaxEndSession(e = null) {
630
- var t, n, s;
631
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
632
- a(s = r, i, o).call(s, ["2", "DD", "7"]);
630
+ var t, n, i;
631
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
632
+ a(i = r, s, o).call(i, ["2", "DD", "7"]);
633
633
  }
634
634
  static nayaxCancelled(e = null) {
635
- var t, n, s;
636
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
637
- a(s = r, i, o).call(s, ["2", "DD", "8"]);
635
+ var t, n, i;
636
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
637
+ a(i = r, s, o).call(i, ["2", "DD", "8"]);
638
638
  }
639
639
  static nayaxDispensed(e = null) {
640
- var t, n, s;
641
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
642
- a(s = r, i, o).call(s, ["2", "DD", "A", "0"]);
640
+ var t, n, i;
641
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
642
+ a(i = r, s, o).call(i, ["2", "DD", "A", "0"]);
643
643
  }
644
644
  static nayaxNotDispensed(e = null) {
645
- var t, n, s;
646
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, p).call(n)) return !1;
647
- a(s = r, i, o).call(s, ["2", "DD", "A", "1"]);
645
+ var t, n, i;
646
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
647
+ a(i = r, s, o).call(i, ["2", "DD", "A", "1"]);
648
648
  }
649
649
  static fullTray(e = null) {
650
- var t, n, s;
651
- if (!a(t = r, i, c).call(t, e) || !a(n = r, i, d).call(n)) return !1;
652
- a(s = r, i, o).call(s, ["6", "4F"]);
650
+ var t, n, i;
651
+ if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
652
+ a(i = r, s, o).call(i, ["6", "4F"]);
653
653
  }
654
654
  static setConnection(e = null) {
655
655
  var t;
656
- if (!a(t = r, i, c).call(t, e)) return !1;
656
+ if (!a(t = r, s, c).call(t, e)) return !1;
657
657
  e.__internal__.serial.connected = !0;
658
658
  }
659
659
  };
660
- k = new WeakMap(), A = new WeakMap(), i = new WeakSet(), te = function() {
660
+ v = new WeakMap(), A = new WeakMap(), s = new WeakSet(), Y = function() {
661
661
  if (r.enable === !1) throw new Error("Emulator is disabled");
662
662
  return r.enable;
663
- }, ne = function(e) {
664
- if (typeof e != "object" || !(e instanceof xe))
663
+ }, Z = function(e) {
664
+ if (typeof e != "object" || !(e instanceof me))
665
665
  throw new Error(`Type ${e.typeDevice} is not supported`);
666
- return r.instance = e, L(r, k, e.typeDevice), L(r, A, e.deviceNumber), !0;
666
+ return r.instance = e, j(r, v, e.typeDevice), j(r, A, e.deviceNumber), !0;
667
667
  }, c = function(e = null) {
668
668
  var t, n;
669
- return !a(t = r, i, te).call(t) || e === null && r.instance === null ? !1 : (r.instance === null && a(n = r, i, ne).call(n, e), !0);
670
- }, $ = function() {
671
- if (w(r, k) !== "locker") throw new Error("This function is only available for Locker devices");
669
+ return !a(t = r, s, Y).call(t) || e === null && r.instance === null ? !1 : (r.instance === null && a(n = r, s, Z).call(n, e), !0);
670
+ }, O = function() {
671
+ if (w(r, v) !== "locker") throw new Error("This function is only available for Locker devices");
672
672
  return !0;
673
673
  }, p = function() {
674
- if (w(r, k) !== "boardroid")
674
+ if (w(r, v) !== "boardroid")
675
675
  throw new Error("This function is only available for Boardroid devices");
676
676
  return !0;
677
677
  }, d = function() {
678
- if (w(r, k) !== "jofemar") throw new Error("This function is only available for Jofemar devices");
678
+ if (w(r, v) !== "jofemar") throw new Error("This function is only available for Jofemar devices");
679
679
  return !0;
680
- }, N = function() {
681
- if (w(r, k) === "locker") throw new Error("This function is not available for Locker devices");
680
+ }, I = function() {
681
+ if (w(r, v) === "locker") throw new Error("This function is not available for Locker devices");
682
682
  return !0;
683
683
  }, o = function(e) {
684
684
  r.instance.__emulate({ code: e });
685
- }, H = function(e, t = null) {
685
+ }, $ = function(e, t = null) {
686
686
  let n = e[Math.floor(Math.random() * 5)];
687
687
  if (t !== null && !isNaN(parseFloat(t)))
688
688
  switch (t.toString()) {
@@ -703,7 +703,7 @@ k = new WeakMap(), A = new WeakMap(), i = new WeakSet(), te = function() {
703
703
  break;
704
704
  }
705
705
  return n;
706
- }, P = function(e, t = null) {
706
+ }, T = function(e, t = null) {
707
707
  let n = e[Math.floor(Math.random() * 4)];
708
708
  if (t !== null && !isNaN(parseFloat(t)))
709
709
  switch (t.toString()) {
@@ -724,57 +724,30 @@ k = new WeakMap(), A = new WeakMap(), i = new WeakSet(), te = function() {
724
724
  break;
725
725
  }
726
726
  return n;
727
- }, I(r, i), F(r, "enable", !1), F(r, "instance", null), I(r, k, null), I(r, A, 1);
728
- let R = r;
729
- var pe = Object.defineProperty, re = (l) => {
727
+ }, U(r, s), N(r, "enable", !1), N(r, "instance", null), U(r, v, null), U(r, A, 1);
728
+ let L = r;
729
+ var he = Object.defineProperty, ee = (l) => {
730
730
  throw TypeError(l);
731
- }, ge = (l, e, t) => e in l ? pe(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, B = (l, e, t) => ge(l, typeof e != "symbol" ? e + "" : e, t), be = (l, e, t) => e.has(l) || re("Cannot " + t), me = (l, e, t) => e.has(l) ? re("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), y = (l, e, t) => (be(l, e, "access private method"), t);
732
- const v = [];
733
- for (let l = 0; l < 256; ++l)
734
- v.push((l + 256).toString(16).slice(1));
735
- function ye(l, e = 0) {
736
- return (v[l[e + 0]] + v[l[e + 1]] + v[l[e + 2]] + v[l[e + 3]] + "-" + v[l[e + 4]] + v[l[e + 5]] + "-" + v[l[e + 6]] + v[l[e + 7]] + "-" + v[l[e + 8]] + v[l[e + 9]] + "-" + v[l[e + 10]] + v[l[e + 11]] + v[l[e + 12]] + v[l[e + 13]] + v[l[e + 14]] + v[l[e + 15]]).toLowerCase();
737
- }
738
- let O;
739
- const we = new Uint8Array(16);
740
- function ve() {
741
- if (!O) {
742
- if (typeof crypto > "u" || !crypto.getRandomValues)
743
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
744
- O = crypto.getRandomValues.bind(crypto);
745
- }
746
- return O(we);
747
- }
748
- const ke = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), J = { randomUUID: ke };
749
- function Ce(l, e, t) {
750
- var n;
751
- if (J.randomUUID && !l)
752
- return J.randomUUID();
753
- l = l || {};
754
- const s = l.random ?? ((n = l.rng) == null ? void 0 : n.call(l)) ?? ve();
755
- if (s.length < 16)
756
- throw new Error("Random bytes length must be >= 16");
757
- return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, ye(s);
758
- }
759
- class z extends CustomEvent {
731
+ }, de = (l, e, t) => e in l ? he(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, B = (l, e, t) => de(l, typeof e != "symbol" ? e + "" : e, t), fe = (l, e, t) => e.has(l) || ee("Cannot " + t), pe = (l, e, t) => e.has(l) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), m = (l, e, t) => (fe(l, e, "access private method"), t);
732
+ class Q extends CustomEvent {
760
733
  constructor(e, t) {
761
734
  super(e, t);
762
735
  }
763
736
  }
764
- class se extends EventTarget {
737
+ class te extends EventTarget {
765
738
  constructor() {
766
739
  super(...arguments), B(this, "__listeners__", {
767
740
  debug: !1
768
741
  }), B(this, "__debug__", !1);
769
742
  }
770
743
  dispatch(e, t = null) {
771
- const n = new z(e, { detail: t });
772
- this.dispatchEvent(n), this.__debug__ && this.dispatchEvent(new z("debug", { detail: { type: e, data: t } }));
744
+ const n = new Q(e, { detail: t });
745
+ this.dispatchEvent(n), this.__debug__ && this.dispatchEvent(new Q("debug", { detail: { type: e, data: t } }));
773
746
  }
774
747
  dispatchAsync(e, t = null, n = 100) {
775
- const s = this;
748
+ const i = this;
776
749
  setTimeout(() => {
777
- s.dispatch(e, t);
750
+ i.dispatch(e, t);
778
751
  }, n);
779
752
  }
780
753
  on(e, t) {
@@ -793,55 +766,55 @@ class se extends EventTarget {
793
766
  }));
794
767
  }
795
768
  }
796
- const W = class m extends se {
769
+ const R = class y extends te {
797
770
  constructor() {
798
771
  super(), ["change"].forEach((e) => {
799
772
  this.serialRegisterAvailableListener(e);
800
773
  });
801
774
  }
802
775
  static $dispatchChange(e = null) {
803
- e && e.$checkAndDispatchConnection(), m.instance.dispatch("change", { devices: m.devices, dispatcher: e });
776
+ e && e.$checkAndDispatchConnection(), y.instance.dispatch("change", { devices: y.devices, dispatcher: e });
804
777
  }
805
778
  static typeError(e) {
806
779
  const t = new Error();
807
780
  throw t.message = `Type ${e} is not supported`, t.name = "DeviceTypeError", t;
808
781
  }
809
782
  static registerType(e) {
810
- typeof m.devices[e] > "u" && (m.devices[e] = {});
783
+ typeof y.devices[e] > "u" && (y.devices[e] = {});
811
784
  }
812
785
  static add(e) {
813
786
  const t = e.typeDevice;
814
- typeof m.devices[t] > "u" && (m.devices[t] = {});
787
+ typeof y.devices[t] > "u" && (y.devices[t] = {});
815
788
  const n = e.uuid;
816
- if (typeof m.devices[t] > "u" && m.typeError(t), m.devices[t][n])
789
+ if (typeof y.devices[t] > "u" && y.typeError(t), y.devices[t][n])
817
790
  throw new Error(`Device with id ${n} already exists`);
818
- return m.devices[t][n] = e, m.$dispatchChange(e), Object.keys(m.devices[t]).indexOf(n);
791
+ return y.devices[t][n] = e, y.$dispatchChange(e), Object.keys(y.devices[t]).indexOf(n);
819
792
  }
820
793
  static get(e, t) {
821
- return typeof m.devices[e] > "u" && (m.devices[e] = {}), typeof m.devices[e] > "u" && m.typeError(e), m.devices[e][t];
794
+ return typeof y.devices[e] > "u" && (y.devices[e] = {}), typeof y.devices[e] > "u" && y.typeError(e), y.devices[e][t];
822
795
  }
823
796
  static getAll(e = null) {
824
- return e === null ? m.devices : (typeof m.devices[e] > "u" && m.typeError(e), m.devices[e]);
797
+ return e === null ? y.devices : (typeof y.devices[e] > "u" && y.typeError(e), y.devices[e]);
825
798
  }
826
799
  static getList() {
827
- return Object.values(m.devices).map((e) => Object.values(e)).flat();
800
+ return Object.values(y.devices).map((e) => Object.values(e)).flat();
828
801
  }
829
802
  static getByNumber(e, t) {
830
- return typeof m.devices[e] > "u" && m.typeError(e), Object.values(m.devices[e]).find((n) => n.deviceNumber === t) ?? null;
803
+ return typeof y.devices[e] > "u" && y.typeError(e), Object.values(y.devices[e]).find((n) => n.deviceNumber === t) ?? null;
831
804
  }
832
805
  static getCustom(e, t = 1) {
833
- return typeof m.devices[e] > "u" && m.typeError(e), Object.values(m.devices[e]).find((n) => n.deviceNumber === t) ?? null;
806
+ return typeof y.devices[e] > "u" && y.typeError(e), Object.values(y.devices[e]).find((n) => n.deviceNumber === t) ?? null;
834
807
  }
835
808
  };
836
- B(W, "instance"), B(W, "devices", {});
837
- let _ = W;
809
+ B(R, "instance"), B(R, "devices", {});
810
+ let _ = R;
838
811
  _.instance || (_.instance = new _());
839
- function K(l = 100) {
812
+ function J(l = 100) {
840
813
  return new Promise(
841
814
  (e) => setTimeout(() => e(), l)
842
815
  );
843
816
  }
844
- function De() {
817
+ function ge() {
845
818
  return "serial" in navigator;
846
819
  }
847
820
  const q = {
@@ -852,20 +825,20 @@ const q = {
852
825
  bufferSize: 32768,
853
826
  flowControl: "none"
854
827
  };
855
- var b, M, U, Q, E, ie, G, X, Y, ae, le, oe, ce, Z, ee, ue, _e;
856
- class Se extends se {
828
+ var b, x, P, H, E, ne, V, z, K, re, ie, se, ae, G, X, le, oe;
829
+ class be extends te {
857
830
  constructor({
858
831
  filters: e = null,
859
832
  config_port: t = q,
860
833
  no_device: n = 1,
861
- device_listen_on_channel: s = 1
834
+ device_listen_on_channel: i = 1
862
835
  } = {
863
836
  filters: null,
864
837
  config_port: q,
865
838
  no_device: 1,
866
839
  device_listen_on_channel: 1
867
840
  }) {
868
- if (super(), me(this, b), B(this, "__internal__", {
841
+ if (super(), pe(this, b), B(this, "__internal__", {
869
842
  auto_response: !1,
870
843
  device_number: 1,
871
844
  aux_port_connector: 0,
@@ -882,7 +855,7 @@ class Se extends se {
882
855
  response: {
883
856
  length: null,
884
857
  buffer: new Uint8Array([]),
885
- as: "hex",
858
+ as: "uint8",
886
859
  replacer: /[\n\r]+/g,
887
860
  limiter: null
888
861
  },
@@ -902,7 +875,7 @@ class Se extends se {
902
875
  },
903
876
  device: {
904
877
  type: "unknown",
905
- id: Ce(),
878
+ id: window.crypto.randomUUID(),
906
879
  listen_on_port: null
907
880
  },
908
881
  time: {
@@ -917,7 +890,7 @@ class Se extends se {
917
890
  }
918
891
  }), !("serial" in navigator))
919
892
  throw new Error("Web Serial not supported");
920
- e && (this.serialFilters = e), t && (this.serialConfigPort = t), n && y(this, b, ue).call(this, n), s && ["number", "string"].includes(typeof s) && (this.listenOnChannel = s), y(this, b, oe).call(this), y(this, b, ce).call(this);
893
+ e && (this.serialFilters = e), t && (this.serialConfigPort = t), n && m(this, b, le).call(this, n), i && ["number", "string"].includes(typeof i) && (this.listenOnChannel = i), m(this, b, se).call(this), m(this, b, ae).call(this);
921
894
  }
922
895
  set listenOnChannel(e) {
923
896
  if (typeof e == "string" && (e = parseInt(e)), isNaN(e) || e < 1 || e > 255)
@@ -943,11 +916,11 @@ class Se extends se {
943
916
  return this.__internal__.serial.config_port;
944
917
  }
945
918
  get isConnected() {
946
- const e = this.__internal__.serial.connected, t = y(this, b, M).call(this, this.__internal__.serial.port);
947
- return e && !t && y(this, b, U).call(this, { error: "Port is closed, not readable or writable." }), this.__internal__.serial.connected = t, this.__internal__.serial.connected;
919
+ const e = this.__internal__.serial.connected, t = m(this, b, x).call(this, this.__internal__.serial.port);
920
+ return e && !t && m(this, b, P).call(this, { error: "Port is closed, not readable or writable." }), this.__internal__.serial.connected = t, this.__internal__.serial.connected;
948
921
  }
949
922
  get isDisconnected() {
950
- const e = this.__internal__.serial.connected, t = y(this, b, M).call(this, this.__internal__.serial.port);
923
+ const e = this.__internal__.serial.connected, t = m(this, b, x).call(this, this.__internal__.serial.port);
951
924
  return !e && t && (this.dispatch("serial:connected"), _.$dispatchChange(this)), this.__internal__.serial.connected = t, !this.__internal__.serial.connected;
952
925
  }
953
926
  get deviceNumber() {
@@ -970,12 +943,12 @@ class Se extends se {
970
943
  });
971
944
  }
972
945
  async disconnect(e = null) {
973
- await this.serialDisconnect(), y(this, b, U).call(this, e);
946
+ await this.serialDisconnect(), m(this, b, P).call(this, e);
974
947
  }
975
948
  async connect() {
976
949
  return new Promise((e, t) => {
977
- De() || t("Web Serial not supported"), setTimeout(async () => {
978
- await K(499), await this.serialConnect(), this.isConnected ? e(`${this.typeDevice} device ${this.deviceNumber} connected`) : t(`${this.typeDevice} device ${this.deviceNumber} not connected`);
950
+ ge() || t("Web Serial not supported"), setTimeout(async () => {
951
+ await J(499), await this.serialConnect(), this.isConnected ? e(`${this.typeDevice} device ${this.deviceNumber} connected`) : t(`${this.typeDevice} device ${this.deviceNumber} not connected`);
979
952
  }, 1);
980
953
  });
981
954
  }
@@ -1063,13 +1036,13 @@ class Se extends se {
1063
1036
  async serialConnect() {
1064
1037
  try {
1065
1038
  this.dispatch("serial:connecting", {});
1066
- const e = await y(this, b, ie).call(this);
1039
+ const e = await m(this, b, ne).call(this);
1067
1040
  if (e.length > 0)
1068
1041
  await this.serialPortsSaved(e);
1069
1042
  else {
1070
- const s = this.serialFilters;
1043
+ const i = this.serialFilters;
1071
1044
  this.__internal__.serial.port = await navigator.serial.requestPort({
1072
- filters: s
1045
+ filters: i
1073
1046
  });
1074
1047
  }
1075
1048
  const t = this.__internal__.serial.port;
@@ -1077,22 +1050,22 @@ class Se extends se {
1077
1050
  throw new Error("No port selected by the user");
1078
1051
  await t.open(this.serialConfigPort);
1079
1052
  const n = this;
1080
- t.onconnect = (s) => {
1081
- console.log(s), n.dispatch("serial:connected", s), _.$dispatchChange(this), n.__internal__.serial.queue.length > 0 && n.dispatch("internal:queue", {});
1053
+ t.onconnect = (i) => {
1054
+ console.log(i), n.dispatch("serial:connected", i), _.$dispatchChange(this), n.__internal__.serial.queue.length > 0 && n.dispatch("internal:queue", {});
1082
1055
  }, t.ondisconnect = async () => {
1083
1056
  await n.disconnect();
1084
- }, await K(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
1057
+ }, await J(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
1085
1058
  await n.timeout(n.__internal__.serial.bytes_connection ?? [], "connection:start");
1086
- }, this.__internal__.time.response_connection), this.__internal__.serial.last_action = "connect", await y(this, b, Q).call(this, this.__internal__.serial.bytes_connection ?? []), this.dispatch("serial:sent", {
1059
+ }, this.__internal__.time.response_connection), this.__internal__.serial.last_action = "connect", await m(this, b, H).call(this, this.__internal__.serial.bytes_connection ?? []), this.dispatch("serial:sent", {
1087
1060
  action: "connect",
1088
1061
  bytes: this.__internal__.serial.bytes_connection
1089
- }), this.__internal__.auto_response && y(this, b, E).call(this, this.__internal__.serial.auto_response, null), await y(this, b, ae).call(this);
1062
+ }), this.__internal__.auto_response && m(this, b, E).call(this, this.__internal__.serial.auto_response, null), await m(this, b, re).call(this);
1090
1063
  } catch (e) {
1091
1064
  this.serialErrors(e);
1092
1065
  }
1093
1066
  }
1094
1067
  async serialForget() {
1095
- return await y(this, b, le).call(this);
1068
+ return await m(this, b, ie).call(this);
1096
1069
  }
1097
1070
  decToHex(e) {
1098
1071
  return typeof e == "string" && (e = parseInt(e, 10)), e.toString(16);
@@ -1105,15 +1078,29 @@ class Se extends se {
1105
1078
  }
1106
1079
  add0x(e) {
1107
1080
  const t = [];
1108
- return e.forEach((n, s) => {
1109
- t[s] = "0x" + n;
1081
+ return e.forEach((n, i) => {
1082
+ t[i] = "0x" + n;
1110
1083
  }), t;
1111
1084
  }
1112
1085
  bytesToHex(e) {
1113
1086
  return this.add0x(Array.from(e, (t) => this.hexMaker(t)));
1114
1087
  }
1088
+ validateBytes(e) {
1089
+ let t = new Uint8Array(0);
1090
+ if (e instanceof Uint8Array)
1091
+ t = e;
1092
+ else if (typeof e == "string")
1093
+ t = this.parseStringToTextEncoder(e);
1094
+ else if (Array.isArray(e) && typeof e[0] == "string")
1095
+ t = this.stringArrayToUint8Array(e);
1096
+ else if (Array.isArray(e) && typeof e[0] == "number")
1097
+ t = new Uint8Array(e);
1098
+ else
1099
+ throw new Error("Invalid data type");
1100
+ return t;
1101
+ }
1115
1102
  async appendToQueue(e, t) {
1116
- const n = this.bytesToHex(e);
1103
+ const n = this.validateBytes(e);
1117
1104
  if (["connect", "connection:start"].includes(t)) {
1118
1105
  if (this.__internal__.serial.connected) return;
1119
1106
  await this.serialConnect();
@@ -1149,7 +1136,7 @@ class Se extends se {
1149
1136
  });
1150
1137
  }
1151
1138
  softReload() {
1152
- y(this, b, _e).call(this), this.dispatch("serial:soft-reload", {});
1139
+ m(this, b, oe).call(this), this.dispatch("serial:soft-reload", {});
1153
1140
  }
1154
1141
  async sendConnect() {
1155
1142
  if (!this.__internal__.serial.bytes_connection)
@@ -1177,7 +1164,7 @@ class Se extends se {
1177
1164
  parseStringToBytes(e = "", t = `
1178
1165
  `) {
1179
1166
  const n = this.parseStringToTextEncoder(e, t);
1180
- return Array.from(n).map((s) => s.toString(16));
1167
+ return Array.from(n).map((i) => i.toString(16));
1181
1168
  }
1182
1169
  parseUint8ToHex(e) {
1183
1170
  return Array.from(e).map((t) => t.toString(16));
@@ -1188,26 +1175,26 @@ class Se extends se {
1188
1175
  stringArrayToUint8Array(e) {
1189
1176
  const t = [];
1190
1177
  return e.forEach((n) => {
1191
- const s = n.replace("0x", "");
1192
- t.push(parseInt(s, 16));
1178
+ const i = n.replace("0x", "");
1179
+ t.push(parseInt(i, 16));
1193
1180
  }), new Uint8Array(t);
1194
1181
  }
1195
1182
  parseUint8ArrayToString(e) {
1196
- const t = this.stringArrayToUint8Array(e);
1197
- e = this.parseUint8ToHex(t);
1198
- const n = e.map((s) => parseInt(s, 16));
1183
+ let t = new Uint8Array(0);
1184
+ e instanceof Uint8Array ? t = e : t = this.stringArrayToUint8Array(e), e = this.parseUint8ToHex(t);
1185
+ const n = e.map((i) => parseInt(i, 16));
1199
1186
  return this.__internal__.serial.response.replacer ? String.fromCharCode(...n).replace(this.__internal__.serial.response.replacer, "") : String.fromCharCode(...n);
1200
1187
  }
1201
1188
  hexToAscii(e) {
1202
1189
  const t = e.toString();
1203
1190
  let n = "";
1204
- for (let s = 0; s < t.length; s += 2)
1205
- n += String.fromCharCode(parseInt(t.substring(s, 2), 16));
1191
+ for (let i = 0; i < t.length; i += 2)
1192
+ n += String.fromCharCode(parseInt(t.substring(i, 2), 16));
1206
1193
  return n;
1207
1194
  }
1208
1195
  asciiToHex(e) {
1209
1196
  const t = [];
1210
- for (let n = 0, s = e.length; n < s; n++) {
1197
+ for (let n = 0, i = e.length; n < i; n++) {
1211
1198
  const u = Number(e.charCodeAt(n)).toString(16);
1212
1199
  t.push(u);
1213
1200
  }
@@ -1217,79 +1204,65 @@ class Se extends se {
1217
1204
  return this.isConnected;
1218
1205
  }
1219
1206
  }
1220
- b = /* @__PURE__ */ new WeakSet(), M = function(l) {
1207
+ b = /* @__PURE__ */ new WeakSet(), x = function(l) {
1221
1208
  return !!(l && l.readable && l.writable);
1222
- }, U = function(l = null) {
1209
+ }, P = function(l = null) {
1223
1210
  this.__internal__.serial.connected = !1, this.__internal__.aux_port_connector = 0, this.dispatch("serial:disconnected", l), _.$dispatchChange(this);
1224
- }, Q = async function(l) {
1211
+ }, H = async function(l) {
1225
1212
  const e = this.__internal__.serial.port;
1226
1213
  if (!e || e && (!e.readable || !e.writable))
1227
- throw y(this, b, U).call(this, { error: "Port is closed, not readable or writable." }), new Error("The port is closed or is not readable/writable");
1228
- const t = this.stringArrayToUint8Array(l);
1214
+ throw m(this, b, P).call(this, { error: "Port is closed, not readable or writable." }), new Error("The port is closed or is not readable/writable");
1215
+ const t = this.validateBytes(l);
1229
1216
  if (e.writable === null) return;
1230
1217
  const n = e.writable.getWriter();
1231
1218
  await n.write(t), n.releaseLock();
1232
- }, E = function(l = [], e = null) {
1219
+ }, E = function(l = new Uint8Array([]), e = null) {
1233
1220
  if (l && l.length > 0) {
1234
1221
  const t = this.__internal__.serial.connected;
1235
- this.__internal__.serial.connected = y(this, b, M).call(this, this.__internal__.serial.port), _.$dispatchChange(this), !t && this.__internal__.serial.connected && this.dispatch("serial:connected"), this.__internal__.interval.reconnection && (clearInterval(this.__internal__.interval.reconnection), this.__internal__.interval.reconnection = 0), this.__internal__.timeout.until_response && (clearTimeout(this.__internal__.timeout.until_response), this.__internal__.timeout.until_response = 0);
1236
- const n = [];
1237
- for (const s in l)
1238
- n.push(l[s].toString().padStart(2, "0").toLowerCase());
1239
- if (this.__internal__.serial.response.as === "hex")
1240
- this.serialMessage(n);
1222
+ if (this.__internal__.serial.connected = m(this, b, x).call(this, this.__internal__.serial.port), _.$dispatchChange(this), !t && this.__internal__.serial.connected && this.dispatch("serial:connected"), this.__internal__.interval.reconnection && (clearInterval(this.__internal__.interval.reconnection), this.__internal__.interval.reconnection = 0), this.__internal__.timeout.until_response && (clearTimeout(this.__internal__.timeout.until_response), this.__internal__.timeout.until_response = 0), this.__internal__.serial.response.as === "hex")
1223
+ this.serialMessage(this.parseUint8ToHex(l));
1241
1224
  else if (this.__internal__.serial.response.as === "uint8")
1242
- this.serialMessage(this.parseHexToUint8(this.add0x(n)));
1243
- else if (this.__internal__.serial.response.as === "string")
1225
+ this.serialMessage(l);
1226
+ else if (this.__internal__.serial.response.as === "string") {
1227
+ const n = this.parseUint8ArrayToString(l);
1244
1228
  if (this.__internal__.serial.response.limiter !== null) {
1245
- const s = this.parseUint8ArrayToString(this.add0x(n)).split(this.__internal__.serial.response.limiter);
1246
- for (const u in s)
1247
- s[u] && this.serialMessage(s[u]);
1229
+ const i = n.split(this.__internal__.serial.response.limiter);
1230
+ for (const u in i)
1231
+ i[u] && this.serialMessage(i[u]);
1248
1232
  } else
1249
- this.serialMessage(this.parseUint8ArrayToString(this.add0x(n)));
1250
- else {
1251
- const s = this.stringToArrayBuffer(
1252
- this.parseUint8ArrayToString(this.add0x(n))
1253
- );
1254
- this.serialMessage(s);
1233
+ this.serialMessage(n);
1234
+ } else {
1235
+ const n = this.stringToArrayBuffer(this.parseUint8ArrayToString(l));
1236
+ this.serialMessage(n);
1255
1237
  }
1256
1238
  } else
1257
1239
  this.serialCorruptMessage(l, e);
1258
1240
  this.__internal__.serial.queue.length !== 0 && this.dispatch("internal:queue", {});
1259
- }, ie = async function() {
1241
+ }, ne = async function() {
1260
1242
  const l = this.serialFilters, e = await navigator.serial.getPorts({ filters: l });
1261
1243
  return l.length === 0 ? e : e.filter((t) => {
1262
1244
  const n = t.getInfo();
1263
- return l.some((s) => n.usbProductId === s.usbProductId && n.usbVendorId === s.usbVendorId);
1264
- }).filter((t) => !y(this, b, M).call(this, t));
1265
- }, G = function(l) {
1245
+ return l.some((i) => n.usbProductId === i.usbProductId && n.usbVendorId === i.usbVendorId);
1246
+ }).filter((t) => !m(this, b, x).call(this, t));
1247
+ }, V = function(l) {
1266
1248
  if (l) {
1267
1249
  const e = this.__internal__.serial.response.buffer, t = new Uint8Array(e.length + l.byteLength);
1268
1250
  t.set(e, 0), t.set(new Uint8Array(l), e.length), this.__internal__.serial.response.buffer = t;
1269
1251
  }
1270
- }, X = async function() {
1252
+ }, z = async function() {
1271
1253
  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(() => {
1272
- const l = [];
1273
- for (const e in this.__internal__.serial.response.buffer)
1274
- l.push(this.__internal__.serial.response.buffer[e].toString(16));
1275
- this.__internal__.serial.response.buffer && y(this, b, E).call(this, l), this.__internal__.serial.response.buffer = new Uint8Array(0);
1254
+ this.__internal__.serial.response.buffer && m(this, b, E).call(this, this.__internal__.serial.response.buffer), this.__internal__.serial.response.buffer = new Uint8Array(0);
1276
1255
  }, 400);
1277
- }, Y = async function() {
1256
+ }, K = async function() {
1278
1257
  if (this.__internal__.serial.response.length !== null) {
1279
- if (this.__internal__.serial.response.length === this.__internal__.serial.response.buffer.length) {
1280
- const l = [];
1281
- for (const e in this.__internal__.serial.response.buffer)
1282
- l.push(this.__internal__.serial.response.buffer[e].toString(16));
1283
- y(this, b, E).call(this, l), this.__internal__.serial.response.buffer = new Uint8Array(0);
1284
- } else if (this.__internal__.serial.response.length < this.__internal__.serial.response.buffer.length) {
1258
+ if (this.__internal__.serial.response.length === this.__internal__.serial.response.buffer.length)
1259
+ m(this, b, E).call(this, this.__internal__.serial.response.buffer), this.__internal__.serial.response.buffer = new Uint8Array(0);
1260
+ else if (this.__internal__.serial.response.length < this.__internal__.serial.response.buffer.length) {
1285
1261
  let l = new Uint8Array(0);
1286
1262
  for (let t = 0; t < this.__internal__.serial.response.length; t++)
1287
1263
  l[t] = this.__internal__.serial.response.buffer[t];
1288
1264
  if (l.length === this.__internal__.serial.response.length) {
1289
- const t = [];
1290
- for (const n in l)
1291
- t.push(l[n].toString(16));
1292
- y(this, b, E).call(this, t), this.__internal__.serial.response.buffer = new Uint8Array(0);
1265
+ m(this, b, E).call(this, l), this.__internal__.serial.response.buffer = new Uint8Array(0);
1293
1266
  return;
1294
1267
  }
1295
1268
  l = new Uint8Array(0);
@@ -1297,16 +1270,11 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
1297
1270
  if (this.__internal__.serial.response.buffer.length === e) {
1298
1271
  for (let t = 14; t < e; t++)
1299
1272
  l[t - this.__internal__.serial.response.length] = this.__internal__.serial.response.buffer[t];
1300
- if (l.length === this.__internal__.serial.response.length) {
1301
- const t = [];
1302
- for (const n in l)
1303
- t.push(l[n].toString(16));
1304
- y(this, b, E).call(this, t), this.__internal__.serial.response.buffer = new Uint8Array(0);
1305
- }
1273
+ l.length === this.__internal__.serial.response.length && (m(this, b, E).call(this, l), this.__internal__.serial.response.buffer = new Uint8Array(0));
1306
1274
  }
1307
1275
  }
1308
1276
  }
1309
- }, ae = async function() {
1277
+ }, re = async function() {
1310
1278
  const l = this.__internal__.serial.port;
1311
1279
  if (!l || !l.readable) throw new Error("Port is not readable");
1312
1280
  for (; l.readable && this.__internal__.serial.keep_reading; ) {
@@ -1315,12 +1283,12 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
1315
1283
  try {
1316
1284
  let t = !0;
1317
1285
  for (; t; ) {
1318
- const { value: n, done: s } = await e.read();
1319
- if (s) {
1286
+ const { value: n, done: i } = await e.read();
1287
+ if (i) {
1320
1288
  e.releaseLock(), this.__internal__.serial.keep_reading = !1, t = !1;
1321
1289
  break;
1322
1290
  }
1323
- y(this, b, G).call(this, n), this.__internal__.serial.response.length === null ? await y(this, b, X).call(this) : await y(this, b, Y).call(this);
1291
+ m(this, b, V).call(this, n), this.__internal__.serial.response.length === null ? await m(this, b, z).call(this) : await m(this, b, K).call(this);
1324
1292
  }
1325
1293
  } catch (t) {
1326
1294
  this.serialErrors(t);
@@ -1329,9 +1297,9 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
1329
1297
  }
1330
1298
  }
1331
1299
  this.__internal__.serial.keep_reading = !0, this.__internal__.serial.port && await this.__internal__.serial.port.close();
1332
- }, le = async function() {
1300
+ }, ie = async function() {
1333
1301
  return typeof window > "u" ? !1 : "serial" in navigator && "forget" in SerialPort.prototype && this.__internal__.serial.port ? (await this.__internal__.serial.port.forget(), !0) : !1;
1334
- }, oe = function() {
1302
+ }, se = function() {
1335
1303
  [
1336
1304
  "serial:connected",
1337
1305
  "serial:connecting",
@@ -1350,37 +1318,45 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
1350
1318
  ].forEach((l) => {
1351
1319
  this.serialRegisterAvailableListener(l);
1352
1320
  });
1353
- }, ce = function() {
1321
+ }, ae = function() {
1354
1322
  const l = this;
1355
1323
  this.on("internal:queue", async () => {
1356
1324
  var e;
1357
- await y(e = l, b, ee).call(e);
1358
- }), y(this, b, Z).call(this);
1359
- }, Z = function() {
1325
+ await m(e = l, b, X).call(e);
1326
+ }), m(this, b, G).call(this);
1327
+ }, G = function() {
1360
1328
  const l = this;
1361
1329
  navigator.serial.addEventListener("connect", async () => {
1362
1330
  l.isDisconnected && await l.serialConnect().catch(() => {
1363
1331
  });
1364
1332
  });
1365
- }, ee = async function() {
1366
- if (!y(this, b, M).call(this, this.__internal__.serial.port)) {
1367
- y(this, b, U).call(this, { error: "Port is closed, not readable or writable." }), await this.serialConnect();
1333
+ }, X = async function() {
1334
+ if (!m(this, b, x).call(this, this.__internal__.serial.port)) {
1335
+ m(this, b, P).call(this, { error: "Port is closed, not readable or writable." }), await this.serialConnect();
1368
1336
  return;
1369
1337
  }
1370
1338
  if (this.__internal__.timeout.until_response || this.__internal__.serial.queue.length === 0) return;
1371
1339
  const l = this.__internal__.serial.queue[0];
1372
1340
  let e = this.__internal__.time.response_general;
1373
- l.action === "connect" && (e = this.__internal__.time.response_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
1341
+ if (l.action === "connect" && (e = this.__internal__.time.response_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
1374
1342
  await this.timeout(l.bytes, l.action);
1375
- }, e), this.__internal__.serial.last_action = l.action ?? "unknown", await y(this, b, Q).call(this, l.bytes), this.dispatch("serial:sent", {
1343
+ }, e), this.__internal__.serial.last_action = l.action ?? "unknown", await m(this, b, H).call(this, l.bytes), this.dispatch("serial:sent", {
1376
1344
  action: l.action,
1377
1345
  bytes: l.bytes
1378
- }), this.__internal__.auto_response && y(this, b, E).call(this, this.__internal__.serial.auto_response, null);
1346
+ }), this.__internal__.auto_response) {
1347
+ let n = new Uint8Array(0);
1348
+ try {
1349
+ n = this.validateBytes(this.__internal__.serial.auto_response);
1350
+ } catch (i) {
1351
+ this.serialErrors(i);
1352
+ }
1353
+ m(this, b, E).call(this, n, null);
1354
+ }
1379
1355
  const t = [...this.__internal__.serial.queue];
1380
1356
  this.__internal__.serial.queue = t.splice(1);
1381
- }, ue = function(l = 1) {
1357
+ }, le = function(l = 1) {
1382
1358
  this.__internal__.device_number = l, this.__internal__.serial.bytes_connection = this.serialSetConnectionConstant(l);
1383
- }, _e = function() {
1359
+ }, oe = function() {
1384
1360
  this.__internal__.last_error = {
1385
1361
  message: null,
1386
1362
  action: null,
@@ -1389,7 +1365,7 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
1389
1365
  };
1390
1366
  };
1391
1367
  _.instance || (_.instance = new _());
1392
- const Ae = {
1368
+ const ye = {
1393
1369
  relay: [],
1394
1370
  locker: [],
1395
1371
  jofemar: [],
@@ -1398,7 +1374,7 @@ const Ae = {
1398
1374
  pinpad: [],
1399
1375
  pinpax: []
1400
1376
  };
1401
- _.devices = { ..._.devices, ...Ae };
1377
+ _.devices = { ..._.devices, ...ye };
1402
1378
  _.addCustom = (l, e) => {
1403
1379
  _.registerType(l), _.add(e);
1404
1380
  };
@@ -1417,7 +1393,7 @@ _.getRelay = (l = 1) => _.getByNumber("relay", l);
1417
1393
  _.getArduino = (l = 1) => _.getByNumber("arduino", l);
1418
1394
  _.getPinPad = (l = 1) => _.getByNumber("pinpad", l);
1419
1395
  _.getPinPax = (l = 1) => _.getByNumber("pinpax", l);
1420
- class xe extends Se {
1396
+ class me extends be {
1421
1397
  constructor(e) {
1422
1398
  super(e), this.__internal__ = structuredClone(this.__internal__), this.getResponseAsArrayHex(), this.__internal__.device.door_open = !1, this.__internal__.time.response_engines = 2e3, this.__internal__.time.sense = 100, this.__internal__.interval.waiting_sense = 0, this.__internal__.dispense = {
1423
1399
  must_response: !1,
@@ -1460,7 +1436,7 @@ class xe extends Se {
1460
1436
  }), null);
1461
1437
  }
1462
1438
  async internalDispenseStatus() {
1463
- if (this.__internal__.dispense.must_response && (await fe(this.__internal__.time.response_engines + 10), this.__internal__.dispense.status === "no-response"))
1439
+ if (this.__internal__.dispense.must_response && (await _e(this.__internal__.time.response_engines + 10), this.__internal__.dispense.status === "no-response"))
1464
1440
  return this.internalClearSensing(), this.__internal__.dispense.status = !1, this.dispatch("not-dispensed", { reason: "no-response" }), { status: !1, error: "no-response" };
1465
1441
  this.__internal__.dispense.status = null, this.__internal__.dispense.dispensing = !0, this.dispatch("internal:dispense:running", {});
1466
1442
  const e = this;
@@ -1488,14 +1464,14 @@ class xe extends Se {
1488
1464
  }
1489
1465
  async internalDispense(e) {
1490
1466
  if (this.isDispensing) throw new Error("Another dispensing process is running");
1491
- if (!R.enable && !this.__internal__.serial.connected && (await this.serialConnect(), !this.__internal__.serial.connected))
1467
+ if (!L.enable && !this.__internal__.serial.connected && (await this.serialConnect(), !this.__internal__.serial.connected))
1492
1468
  throw new Error("Serial device not connected");
1493
1469
  return this.__internal__.serial.queue.length === 0 ? (await this.appendToQueue(e, "dispense"), await this.internalDispenseStatus()) : new Promise((t) => {
1494
1470
  const n = setInterval(async () => {
1495
1471
  if (this.__internal__.serial.queue.length > 0) return;
1496
1472
  clearInterval(n), await this.appendToQueue(e, "dispense");
1497
- const s = await this.internalDispenseStatus();
1498
- t(s);
1473
+ const i = await this.internalDispenseStatus();
1474
+ t(i);
1499
1475
  }, 100);
1500
1476
  });
1501
1477
  }
@@ -1525,13 +1501,13 @@ class xe extends Se {
1525
1501
  }
1526
1502
  }
1527
1503
  export {
1528
- R as E,
1529
- xe as K,
1530
- Pe as a,
1531
- Te as b,
1532
- _ as c,
1533
- Ue as g,
1534
- Be as i,
1535
- Me as s,
1536
- fe as w
1504
+ L as E,
1505
+ me as K,
1506
+ _,
1507
+ Ce as a,
1508
+ ke as b,
1509
+ De as g,
1510
+ Ae as i,
1511
+ ve as s,
1512
+ _e as w
1537
1513
  };