@kalamba/sdk 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/plugins.js CHANGED
@@ -2,60 +2,60 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2024, Kalamba Games Limited
4
4
  */
5
- var Gt = Object.defineProperty;
6
- var Nt = (i, t, e) => t in i ? Gt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
7
- var w = (i, t, e) => (Nt(i, typeof t != "symbol" ? t + "" : t, e), e), at = (i, t, e) => {
8
- if (!t.has(i))
9
- throw TypeError("Cannot " + e);
5
+ var Nt = Object.defineProperty;
6
+ var Ht = (i, e, t) => e in i ? Nt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
7
+ var p = (i, e, t) => (Ht(i, typeof e != "symbol" ? e + "" : e, t), t), ot = (i, e, t) => {
8
+ if (!e.has(i))
9
+ throw TypeError("Cannot " + t);
10
10
  };
11
- var y = (i, t, e) => (at(i, t, "read from private field"), e ? e.call(i) : t.get(i)), v = (i, t, e) => {
12
- if (t.has(i))
11
+ var y = (i, e, t) => (ot(i, e, "read from private field"), t ? t.call(i) : e.get(i)), E = (i, e, t) => {
12
+ if (e.has(i))
13
13
  throw TypeError("Cannot add the same private member more than once");
14
- t instanceof WeakSet ? t.add(i) : t.set(i, e);
15
- }, E = (i, t, e, s) => (at(i, t, "write to private field"), s ? s.call(i, e) : t.set(i, e), e);
16
- import { a as ot } from "./noop-3336849b.js";
17
- function x(i, t) {
18
- return (e, ...s) => {
19
- console.log(`[%c${i}\x1B[m] %s`, t, e, ...s);
14
+ e instanceof WeakSet ? e.add(i) : e.set(i, t);
15
+ }, v = (i, e, t, n) => (ot(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t);
16
+ import { a as rt } from "./noop-3336849b.js";
17
+ function O(i, e) {
18
+ return (t, ...n) => {
19
+ console.log(`[%c${i}\x1B[m] %s`, e, t, ...n);
20
20
  };
21
21
  }
22
- function xt(i, t) {
23
- return Math.round(i * 100 / t);
22
+ function Ot(i, e) {
23
+ return Math.round(i * 100 / e);
24
24
  }
25
25
  class $ {
26
- constructor(t) {
27
- w(this, "config");
28
- this.config = t;
26
+ constructor(e) {
27
+ p(this, "config");
28
+ this.config = e;
29
29
  }
30
- on(t, e, s) {
31
- const n = function(a) {
32
- a.data.message !== `kalamba:wrapper-casino:${t}` && a.data.message !== `kalamba:wrapper:${t}` || e(a.data.payload);
30
+ on(e, t, n) {
31
+ const a = function(s) {
32
+ s.data.message !== `kalamba:wrapper-casino:${e}` && s.data.message !== `kalamba:wrapper:${e}` || t(s.data.payload);
33
33
  };
34
- window.addEventListener("message", n, s);
34
+ window.addEventListener("message", a, n);
35
35
  }
36
- send(t, ...[e]) {
36
+ send(e, ...[t]) {
37
37
  window.postMessage({
38
- message: `kalamba:casino:${t}`,
39
- payload: e
38
+ message: `kalamba:casino:${e}`,
39
+ payload: t
40
40
  });
41
41
  }
42
42
  }
43
- const Ht = x("BasicPlugin", "color:#000000;font-weight:bold;");
44
- class Pi extends $ {
45
- constructor(...t) {
46
- super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Ht("configured");
43
+ const Vt = O("BasicPlugin", "color:#000000;font-weight:bold;");
44
+ class Oi extends $ {
45
+ constructor(...e) {
46
+ super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), Vt("configured");
47
47
  }
48
48
  registerToSdkEvents() {
49
- window.addEventListener("message", (t) => {
49
+ window.addEventListener("message", (e) => {
50
50
  try {
51
- const { type: e, payload: s } = t.data;
52
- switch (e) {
51
+ const { type: t, payload: n } = e.data;
52
+ switch (t) {
53
53
  case "doAudioSettings":
54
- this.send("settings", { music: s == null ? void 0 : s.musicEnabled, sounds: s == null ? void 0 : s.soundEnabled });
54
+ this.send("settings", { music: n == null ? void 0 : n.musicEnabled, sounds: n == null ? void 0 : n.soundEnabled });
55
55
  return;
56
56
  case "doBalanceUpdate":
57
- const { currency: n, coinValueInCents: c } = this.config.api;
58
- s.currency === n && typeof s.balanceInCurrency == "number" ? this.send("balance", { balance: xt(s.balanceInCurrency, c) }) : (s.balanceInCoins, this.send("balance", { balance: s.balanceInCoins }));
57
+ const { currency: a, coinValueInCents: c } = this.config.api;
58
+ n.currency === a && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance: Ot(n.balanceInCurrency, c) }) : (n.balanceInCoins, this.send("balance", { balance: n.balanceInCoins }));
59
59
  return;
60
60
  case "doGamePause":
61
61
  this.send("freeze");
@@ -90,50 +90,50 @@ class Pi extends $ {
90
90
  });
91
91
  }
92
92
  }
93
- const k = x("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), zt = x("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
94
- class xi extends $ {
95
- constructor(...t) {
96
- super(...t), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
93
+ const k = O("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), zt = O("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
94
+ class Li extends $ {
95
+ constructor(...e) {
96
+ super(...e), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
97
97
  }
98
98
  // TODO add types
99
99
  registerDebugToSdkEvents() {
100
100
  window.DebuggingPlugin = {
101
- balance: (t) => this._send("balance", t),
102
- bet: (t) => this._send("bet", t),
103
- choice: (t) => this._send("choice", t),
104
- close: (t) => this._send("close", t),
105
- help: (t) => this._send("help", t),
106
- history: (t) => this._send("history", t),
107
- freeze: (t) => this._send("freeze", t),
108
- paytable: (t) => this._send("paytable", t),
109
- settings: (t) => this._send("settings", t),
110
- suspend: (t) => this._send("suspend", t),
111
- unfreeze: (t) => this._send("unfreeze", t)
101
+ balance: (e) => this._send("balance", e),
102
+ bet: (e) => this._send("bet", e),
103
+ choice: (e) => this._send("choice", e),
104
+ close: (e) => this._send("close", e),
105
+ help: (e) => this._send("help", e),
106
+ history: (e) => this._send("history", e),
107
+ freeze: (e) => this._send("freeze", e),
108
+ paytable: (e) => this._send("paytable", e),
109
+ settings: (e) => this._send("settings", e),
110
+ suspend: (e) => this._send("suspend", e),
111
+ unfreeze: (e) => this._send("unfreeze", e)
112
112
  };
113
113
  }
114
114
  registerSdkToDebugEvents() {
115
- this.on("autoplay", (t) => k("autoplay", t)), this.on("balance", (t) => k("balance", t)), this.on("bet", (t) => k("bet", t)), this.on("cashier", (t) => k("cashier", t)), this.on("choice", (t) => k("choice", t)), this.on("close", (t) => k("close", t)), this.on("error", (t) => k("error", t)), this.on("loadEnd", (t) => k("loadEnd", t)), this.on("loadProgress", (t) => k("loadProgress", t)), this.on("loadStart", (t) => k("loadStart", t)), this.on("playCycleStart", (t) => k("playCycleStart", t)), this.on("playCycleEnd", (t) => k("playCycleEnd", t)), this.on("playEnd", (t) => k("playEnd", t)), this.on("playError", (t) => k("playError", t)), this.on("playReady", (t) => k("playReady", t)), this.on("playStart", (t) => k("playStart", t)), this.on("settings", (t) => k("settings", t));
115
+ this.on("autoplay", (e) => k("autoplay", e)), this.on("balance", (e) => k("balance", e)), this.on("bet", (e) => k("bet", e)), this.on("cashier", (e) => k("cashier", e)), this.on("choice", (e) => k("choice", e)), this.on("close", (e) => k("close", e)), this.on("error", (e) => k("error", e)), this.on("loadEnd", (e) => k("loadEnd", e)), this.on("loadProgress", (e) => k("loadProgress", e)), this.on("loadStart", (e) => k("loadStart", e)), this.on("playCycleStart", (e) => k("playCycleStart", e)), this.on("playCycleEnd", (e) => k("playCycleEnd", e)), this.on("playEnd", (e) => k("playEnd", e)), this.on("playError", (e) => k("playError", e)), this.on("playReady", (e) => k("playReady", e)), this.on("playStart", (e) => k("playStart", e)), this.on("settings", (e) => k("settings", e));
116
116
  }
117
- _send(...t) {
118
- zt(...t), this.send(...t);
117
+ _send(...e) {
118
+ zt(...e), this.send(...e);
119
119
  }
120
120
  }
121
- const Vt = x("GigPlugin", "color:#000000;font-weight:bold;");
122
- class Ui extends $ {
123
- constructor(...t) {
124
- super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Vt("configured");
121
+ const qt = O("GigPlugin", "color:#000000;font-weight:bold;");
122
+ class Bi extends $ {
123
+ constructor(...e) {
124
+ super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), qt("configured");
125
125
  }
126
- postMessage(t) {
127
- const e = {
128
- event: t
126
+ postMessage(e) {
127
+ const t = {
128
+ event: e
129
129
  };
130
- window.top.postMessage(e, "*");
130
+ window.top.postMessage(t, "*");
131
131
  }
132
132
  registerToSdkEvents() {
133
- window.addEventListener("message", (t) => {
133
+ window.addEventListener("message", (e) => {
134
134
  try {
135
- const { data: e } = t;
136
- switch (e) {
135
+ const { data: t } = e;
136
+ switch (t) {
137
137
  case "STOP_AUTO_PLAY":
138
138
  this.send("suspend");
139
139
  return;
@@ -169,18 +169,18 @@ class Ui extends $ {
169
169
  });
170
170
  }
171
171
  }
172
- const qt = x("OryxPlugin", "color:#000000;font-weight:bold;");
173
- class Oi extends $ {
174
- constructor(...t) {
175
- super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), qt("configured");
172
+ const Gt = O("OryxPlugin", "color:#000000;font-weight:bold;");
173
+ class Fi extends $ {
174
+ constructor(...e) {
175
+ super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), Gt("configured");
176
176
  }
177
177
  registerToSdkEvents() {
178
- window.addEventListener("message", (t) => {
178
+ window.addEventListener("message", (e) => {
179
179
  try {
180
- const { type: e, param: s } = t.data;
181
- switch (e) {
180
+ const { type: t, param: n } = e.data;
181
+ switch (t) {
182
182
  case "doBalanceUpdate":
183
- this.send("balance", { balance: s });
183
+ this.send("balance", { balance: n });
184
184
  return;
185
185
  case "doGamePause":
186
186
  this.send("freeze");
@@ -199,11 +199,11 @@ class Oi extends $ {
199
199
  });
200
200
  }
201
201
  registerFromSdkEvents() {
202
- let t = 0;
202
+ let e = 0;
203
203
  this.on("close", () => {
204
204
  window.top.postMessage({ wpgaction: "close" }, "*"), window.parent.postMessage({ wpgaction: "close.parent" }, "*");
205
- }), this.on("balance", ({ balance: e }) => {
206
- t !== e && (t = e, window.top.postMessage({ param: {}, wpgaction: "balance" }, "*"), window.parent.postMessage({ param: {}, wpgaction: "balance.parent" }, "*"));
205
+ }), this.on("balance", ({ balance: t }) => {
206
+ e !== t && (e = t, window.top.postMessage({ param: {}, wpgaction: "balance" }, "*"), window.parent.postMessage({ param: {}, wpgaction: "balance.parent" }, "*"));
207
207
  }), this.on("loadStart", () => {
208
208
  window.top.postMessage({ wpgaction: "loadStart" }, "*"), window.parent.postMessage({ wpgaction: "loadStart.parent" }, "*");
209
209
  }), this.on("loadEnd", () => {
@@ -212,8 +212,8 @@ class Oi extends $ {
212
212
  window.top.postMessage({ wpgaction: "gameSpinStart" }, "*"), window.parent.postMessage({ wpgaction: "gameSpinStart.parent" }, "*");
213
213
  }), this.on("playEnd", () => {
214
214
  window.top.postMessage({ wpgaction: "gameSpinEnd" }, "*"), window.parent.postMessage({ wpgaction: "gameSpinEnd.parent" }, "*");
215
- }), this.on("cashier", ({ type: e }) => {
216
- switch (e) {
215
+ }), this.on("cashier", ({ type: t }) => {
216
+ switch (t) {
217
217
  case "BALANCE_LOW":
218
218
  window.top.postMessage({ wpgaction: "cashier" }, "*"), window.parent.postMessage({ wpgaction: "cashier.parent" }, "*");
219
219
  break;
@@ -224,35 +224,35 @@ class Oi extends $ {
224
224
  });
225
225
  }
226
226
  }
227
- const rt = x("PariplayPlugin", "color:#000000;font-weight:bold;");
228
- function Ge(i) {
227
+ const ct = O("PariplayPlugin", "color:#000000;font-weight:bold;");
228
+ function He(i) {
229
229
  try {
230
230
  window.top.location = i;
231
231
  } catch {
232
232
  window.location = i;
233
233
  }
234
234
  }
235
- function Ne(i, t) {
236
- return new Promise(function(s, n) {
235
+ function Ve(i, e) {
236
+ return new Promise(function(n, a) {
237
237
  const c = new XMLHttpRequest();
238
238
  c.onload = function() {
239
- c.status >= 200 && c.status < 300 ? s(c.responseText) : n(c.responseText);
240
- }, c.open(i, t), c.send();
239
+ c.status >= 200 && c.status < 300 ? n(c.responseText) : a(c.responseText);
240
+ }, c.open(i, e), c.send();
241
241
  });
242
242
  }
243
- function He() {
243
+ function ze() {
244
244
  }
245
245
  function Wt(i) {
246
- return i.filter(function(e) {
247
- return e.messageType.toUpperCase() === "DATA";
246
+ return i.filter(function(t) {
247
+ return t.messageType.toUpperCase() === "DATA";
248
248
  });
249
249
  }
250
- function ze(i) {
251
- return i.filter(function(e) {
252
- return ["NOTIFICATION", "POPUP"].includes(e.messageType.toUpperCase());
250
+ function qe(i) {
251
+ return i.filter(function(t) {
252
+ return ["NOTIFICATION", "POPUP"].includes(t.messageType.toUpperCase());
253
253
  });
254
254
  }
255
- function Ut(i) {
255
+ function Lt(i) {
256
256
  try {
257
257
  return JSON.parse(i.text);
258
258
  } catch {
@@ -260,56 +260,56 @@ function Ut(i) {
260
260
  }
261
261
  }
262
262
  function $t(i) {
263
- return i.map(Ut).filter(Boolean).find(function(e) {
264
- return e.betId != null && e.winId != null;
263
+ return i.map(Lt).filter(Boolean).find(function(t) {
264
+ return t.betId != null && t.winId != null;
265
265
  }) || {};
266
266
  }
267
267
  function jt(i) {
268
- return i.map(Ut).filter(Boolean).find(function(e) {
269
- return e.TotalBet != null && e.TotalWin != null;
268
+ return i.map(Lt).filter(Boolean).find(function(t) {
269
+ return t.TotalBet != null && t.TotalWin != null;
270
270
  }) || {};
271
271
  }
272
- class Li extends $ {
273
- constructor(...t) {
274
- super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), rt("configured");
272
+ class _i extends $ {
273
+ constructor(...e) {
274
+ super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), ct("configured");
275
275
  }
276
- postMessage(t, e) {
277
- const s = {
276
+ postMessage(e, t) {
277
+ const n = {
278
278
  lang: this.config.ui.language,
279
279
  sender: this.config.api.game,
280
- type: t
280
+ type: e
281
281
  };
282
- e != null && (s.data = e), rt("postMessage", s), window.parent.postMessage(s, "*");
282
+ t != null && (n.data = t), ct("postMessage", n), window.parent.postMessage(n, "*");
283
283
  }
284
- coinsToCurrency(t) {
285
- return t * this.config.api.coinValueInCents / 100;
284
+ coinsToCurrency(e) {
285
+ return e * this.config.api.coinValueInCents / 100;
286
286
  }
287
- handleContinueButton(t, e) {
288
- t.link && Ne("GET", t.link), e();
287
+ handleContinueButton(e, t) {
288
+ e.link && Ve("GET", e.link), t();
289
289
  }
290
- handleLinkButton(t, e) {
291
- switch (t.linkType.toUpperCase()) {
290
+ handleLinkButton(e, t) {
291
+ switch (e.linkType.toUpperCase()) {
292
292
  case "AJAX":
293
- Ne("GET", t.link), e();
293
+ Ve("GET", e.link), t();
294
294
  return;
295
295
  case "AJAXRESPONSE":
296
- Ne("GET", t.link).then(() => {
297
- e();
296
+ Ve("GET", e.link).then(() => {
297
+ t();
298
298
  });
299
299
  return;
300
300
  case "REDIRECT":
301
- Ge(t.link), e();
301
+ He(e.link), t();
302
302
  return;
303
303
  }
304
304
  }
305
- handleQuitButton(t, e) {
306
- this.send("close"), e();
305
+ handleQuitButton(e, t) {
306
+ this.send("close"), t();
307
307
  }
308
- handleCashierButton(t, e) {
309
- this.send("cashier", { type: "ON_DEMAND" }), e();
308
+ handleCashierButton(e, t) {
309
+ this.send("cashier", { type: "ON_DEMAND" }), t();
310
310
  }
311
- handleHistoryButton(t, e) {
312
- this.send("history", { source: "casino" }), e();
311
+ handleHistoryButton(e, t) {
312
+ this.send("history", { source: "casino" }), t();
313
313
  }
314
314
  get buttonActions() {
315
315
  return {
@@ -320,24 +320,24 @@ class Li extends $ {
320
320
  QUIT: this.handleQuitButton
321
321
  };
322
322
  }
323
- processInfoUiMessages(t) {
324
- return t.reduce((e, s) => e.then(() => new Promise((n) => {
325
- Object.assign({}, s, {
326
- buttons: s.buttons.filter((c) => c.action.toUpperCase() === "CASHIER" ? !!this.config.api.cashierUrl : !0).map((c) => Object.assign({}, c, {
323
+ processInfoUiMessages(e) {
324
+ return e.reduce((t, n) => t.then(() => new Promise((a) => {
325
+ Object.assign({}, n, {
326
+ buttons: n.buttons.filter((c) => c.action.toUpperCase() === "CASHIER" ? !!this.config.api.cashierUrl : !0).map((c) => Object.assign({}, c, {
327
327
  onRelease: () => {
328
- const a = s.messageType.toUpperCase() === "POPUP" ? He : n, h = this.buttonActions[c.action.toUpperCase()];
329
- h ? h(c, a) : a();
328
+ const s = n.messageType.toUpperCase() === "POPUP" ? ze : a, h = this.buttonActions[c.action.toUpperCase()];
329
+ h ? h(c, s) : s();
330
330
  }
331
331
  }))
332
332
  });
333
- }).catch(He)), Promise.resolve()).then(() => {
334
- }).catch(He);
333
+ }).catch(ze)), Promise.resolve()).then(() => {
334
+ }).catch(ze);
335
335
  }
336
336
  registerToSdkEvents() {
337
- window.addEventListener("message", (t) => {
337
+ window.addEventListener("message", (e) => {
338
338
  try {
339
- const { type: e } = t.data;
340
- switch (e) {
339
+ const { type: t } = e.data;
340
+ switch (t) {
341
341
  case "pause":
342
342
  case "disableSpin":
343
343
  this.send("freeze");
@@ -357,34 +357,34 @@ class Li extends $ {
357
357
  });
358
358
  }
359
359
  registerFromSdkEvents() {
360
- let t = 0;
361
- this.on("openGameResponse", (e) => {
362
- let s;
360
+ let e = 0;
361
+ this.on("openGameResponse", (t) => {
362
+ let n;
363
363
  try {
364
- const n = JSON.parse(
364
+ const a = JSON.parse(
365
365
  JSON.parse(atob(this.config.api.integrationData.token.split(".")[1])).token
366
- ), c = JSON.parse(n.integrationSpecificAttributes.sessionData || "{}");
367
- s = {
368
- ClientToken: n.integrationSpecificAttributes.clientToken,
369
- CurrencyCode: n.currency,
370
- PlayerTokenId: n.user,
366
+ ), c = JSON.parse(a.integrationSpecificAttributes.sessionData || "{}");
367
+ n = {
368
+ ClientToken: a.integrationSpecificAttributes.clientToken,
369
+ CurrencyCode: a.currency,
370
+ PlayerTokenId: a.user,
371
371
  SessionData: c
372
372
  };
373
373
  } catch {
374
- s = void 0;
374
+ n = void 0;
375
375
  }
376
376
  this.postMessage("gameDataLoaded", {
377
- LoadGameData: s,
377
+ LoadGameData: n,
378
378
  success: !0
379
379
  });
380
380
  try {
381
- const n = ze(e.data.uiMessages);
382
- this.processInfoUiMessages(n);
381
+ const a = qe(t.data.uiMessages);
382
+ this.processInfoUiMessages(a);
383
383
  } catch {
384
384
  }
385
- }), this.on("balance", ({ balance: e }) => {
386
- t !== e && (t = e, this.postMessage("balance", {
387
- amount: this.coinsToCurrency(e)
385
+ }), this.on("balance", ({ balance: t }) => {
386
+ e !== t && (e = t, this.postMessage("balance", {
387
+ amount: this.coinsToCurrency(t)
388
388
  }));
389
389
  }), this.on("close", () => {
390
390
  if (this.config.api.homeUrl)
@@ -395,63 +395,63 @@ class Li extends $ {
395
395
  window.history.back();
396
396
  }
397
397
  else
398
- this.config.api.homeUrl === "(api)" ? this.postMessage("quit") : Ge(this.config.api.homeUrl);
399
- }), this.on("playEnd", (e) => {
398
+ this.config.api.homeUrl === "(api)" ? this.postMessage("quit") : He(this.config.api.homeUrl);
399
+ }), this.on("playEnd", (t) => {
400
400
  this.postMessage("roundEnded", {
401
- balanceAfter: this.coinsToCurrency(e.balance),
402
- win: this.coinsToCurrency(e.data.gameRoundResult.win)
401
+ balanceAfter: this.coinsToCurrency(t.balance),
402
+ win: this.coinsToCurrency(t.data.gameRoundResult.win)
403
403
  });
404
404
  try {
405
- const s = ze(e.data.uiMessages);
406
- this.processInfoUiMessages(s);
405
+ const n = qe(t.data.uiMessages);
406
+ this.processInfoUiMessages(n);
407
407
  } catch {
408
408
  }
409
- }), this.on("playError", (e) => {
409
+ }), this.on("playError", (t) => {
410
410
  this.postMessage("ticketReceived", {
411
- ErrorCode: e.data.data.data.operatorSpecificErrorCode,
412
- ErrorMessage: e.data.data.data.operatorSpecificErrorMessage,
411
+ ErrorCode: t.data.data.data.operatorSpecificErrorCode,
412
+ ErrorMessage: t.data.data.data.operatorSpecificErrorMessage,
413
413
  Status: {
414
- ErrCode: e.data.data.data.operatorSpecificErrorCode
414
+ ErrCode: t.data.data.data.operatorSpecificErrorCode
415
415
  }
416
416
  });
417
- }), this.on("playResponse", (e) => {
417
+ }), this.on("playResponse", (t) => {
418
418
  this.postMessage("roundStarted", {
419
- balanceBefore: this.coinsToCurrency(e.balance + e.data.gameState.totalBetFromCurrentGameCycle)
419
+ balanceBefore: this.coinsToCurrency(t.balance + t.data.gameState.totalBetFromCurrentGameCycle)
420
420
  });
421
- const s = e.data.gameState.stateTypeThisRound === "BaseGame", n = Wt(e.data.uiMessages), c = ze(e.data.uiMessages), a = $t(n), h = jt(n);
421
+ const n = t.data.gameState.stateTypeThisRound === "BaseGame", a = Wt(t.data.uiMessages), c = qe(t.data.uiMessages), s = $t(a), h = jt(a);
422
422
  this.postMessage("ticketReceived", {
423
- Balance: this.coinsToCurrency(e.balance),
424
- BetAmount: s ? this.coinsToCurrency(e.data.gameState.totalBetFromCurrentGameCycle) : 0,
425
- CreditTransactionId: a.betId,
426
- DebitTransactionId: a.winId,
423
+ Balance: this.coinsToCurrency(t.balance),
424
+ BetAmount: n ? this.coinsToCurrency(t.data.gameState.totalBetFromCurrentGameCycle) : 0,
425
+ CreditTransactionId: s.betId,
426
+ DebitTransactionId: s.winId,
427
427
  Message: c,
428
428
  SessionData: h,
429
429
  Status: {
430
430
  ErrCode: 0
431
431
  },
432
- WinAmount: this.coinsToCurrency(e.data.gameRoundResult.win)
432
+ WinAmount: this.coinsToCurrency(t.data.gameRoundResult.win)
433
433
  });
434
- }), this.on("playStart", (e) => {
435
- e.bet && this.postMessage("roundStart", {
436
- totalBet: this.coinsToCurrency(e.bet.base * e.bet.multiplier)
434
+ }), this.on("playStart", (t) => {
435
+ t.bet && this.postMessage("roundStart", {
436
+ totalBet: this.coinsToCurrency(t.bet.base * t.bet.multiplier)
437
437
  });
438
438
  }), this.on("loadEnd", () => {
439
439
  this.postMessage("gameReady");
440
440
  }), this.on("loadStart", () => {
441
441
  this.postMessage("onAppFrameReady");
442
442
  }), this.on("cashier", () => {
443
- this.config.api.cashierUrl && (this.config.api.cashierUrl === "(api)" ? this.postMessage("cashier") : Ge(this.config.api.cashierUrl));
443
+ this.config.api.cashierUrl && (this.config.api.cashierUrl === "(api)" ? this.postMessage("cashier") : He(this.config.api.cashierUrl));
444
444
  });
445
445
  }
446
446
  }
447
- const he = x("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
448
- class _i extends $ {
449
- constructor(...e) {
450
- super(...e);
451
- w(this, "VERSION", "1.15.0");
452
- const s = document.createElement("script");
453
- s.src = `https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`, s.onload = () => {
454
- he("loaded"), window.FEIM.configure({
447
+ const ue = O("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
448
+ class Di extends $ {
449
+ constructor(...t) {
450
+ super(...t);
451
+ p(this, "VERSION", "1.15.0");
452
+ const n = document.createElement("script");
453
+ n.src = `https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`, n.onload = () => {
454
+ ue("loaded"), window.FEIM.configure({
455
455
  p2pConfig: {
456
456
  currency: this.config.api.currency,
457
457
  launchParams: {
@@ -459,21 +459,21 @@ class _i extends $ {
459
459
  homeurl: "homeUrl"
460
460
  }
461
461
  }
462
- }), he("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
463
- }, document.body.appendChild(s);
462
+ }), ue("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
463
+ }, document.body.appendChild(n);
464
464
  }
465
465
  registerToSdkEvents() {
466
- window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() => he("!!! NOT IMPLEMENTED: exitingGame !!!")), window.FEIM.on.freeze(() => this.send("freeze")), window.FEIM.on.initialized(() => he("!!! NOT IMPLEMENTED: initialized !!!")), window.FEIM.on.pauseAutoPlay(() => this.send("suspend")), window.FEIM.on.refreshBalance(() => he("!!! NOT IMPLEMENTED: refreshBalance !!!")), window.FEIM.on.toggleGameHelp(() => {
466
+ window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() => ue("!!! NOT IMPLEMENTED: exitingGame !!!")), window.FEIM.on.freeze(() => this.send("freeze")), window.FEIM.on.initialized(() => ue("!!! NOT IMPLEMENTED: initialized !!!")), window.FEIM.on.pauseAutoPlay(() => this.send("suspend")), window.FEIM.on.refreshBalance(() => ue("!!! NOT IMPLEMENTED: refreshBalance !!!")), window.FEIM.on.toggleGameHelp(() => {
467
467
  this.send("help", {});
468
468
  }), window.FEIM.on.togglePaytable(() => {
469
469
  this.send("paytable", {});
470
470
  }), window.FEIM.on.unfreeze(() => this.send("unfreeze")), window.FEIM.on.updateSettings(
471
- ({ payload: [e] }) => this.send("settings", { sounds: e.sounds, fastPlay: e.fastPlay })
471
+ ({ payload: [t] }) => this.send("settings", { sounds: t.sounds, fastPlay: t.fastPlay })
472
472
  );
473
473
  }
474
474
  registerFromSdkEvents() {
475
- this.on("autoplay", ({ action: e }) => {
476
- switch (e) {
475
+ this.on("autoplay", ({ action: t }) => {
476
+ switch (t) {
477
477
  case "start":
478
478
  window.FEIM.send.autoPlayStarted();
479
479
  break;
@@ -481,73 +481,71 @@ class _i extends $ {
481
481
  window.FEIM.send.autoPlayFinished();
482
482
  break;
483
483
  }
484
- }), this.on("balance", ({ balance: e }) => {
485
- window.FEIM.send.balanceUpdate(e);
486
- }), this.on("bet", ({ base: e, multiplier: s }) => {
487
- window.FEIM.send.betUpdate(e * s);
488
- }), this.on("error", ({ message: e }) => {
489
- window.FEIM.send.errorMessage(e);
484
+ }), this.on("balance", ({ balance: t }) => {
485
+ window.FEIM.send.balanceUpdate(t);
486
+ }), this.on("bet", ({ base: t, multiplier: n }) => {
487
+ window.FEIM.send.betUpdate(t * n);
488
+ }), this.on("error", ({ message: t }) => {
489
+ window.FEIM.send.errorMessage(t);
490
490
  }), this.on("close", () => {
491
491
  window.FEIM.send.exitGame();
492
492
  }), this.on("loadEnd", () => {
493
493
  window.FEIM.send.gameLoadCompleted();
494
- }), this.on("loadProgress", ({ progress: e }) => {
495
- window.FEIM.send.gameLoadProgress(e);
494
+ }), this.on("loadProgress", ({ progress: t }) => {
495
+ window.FEIM.send.gameLoadProgress(t);
496
496
  }), this.on("loadStart", () => {
497
497
  window.FEIM.send.gameLoadStarted();
498
498
  }), this.on("cashier", () => {
499
499
  window.FEIM.send.openQuickDeposit();
500
- }), this.on("playCycleEnd", (e) => {
501
- const s = {
502
- balance: e.balance,
503
- // TODO: response should be processed by adapter
504
- // Current implementation works only with Kalamba RGS
505
- bet: e.data.gameState.totalBetFromCurrentGameCycle,
500
+ }), this.on("playCycleEnd", (t) => {
501
+ const n = {
502
+ balance: t.contract.balance.coins,
503
+ bet: t.contract.bet.lastPaid.base * t.contract.bet.lastPaid.multiplier,
506
504
  win: {
507
- win: e.data.gameState.totalWinFromCurrentGameCycle
505
+ win: t.contract.win.total
508
506
  }
509
507
  };
510
- window.FEIM.send.roundFinished(s);
511
- }), this.on("playResponse", (e) => {
512
- const s = {
513
- balance: e.balance,
514
- playResponse: e.data
508
+ window.FEIM.send.roundFinished(n);
509
+ }), this.on("playResponse", (t) => {
510
+ const n = {
511
+ balance: t.contract.balance.coins,
512
+ playResponse: t.data
515
513
  };
516
- window.FEIM.send.roundStarted(s);
514
+ window.FEIM.send.roundStarted(n);
517
515
  }), this.on("history", () => {
518
516
  window.FEIM.send.showHistory();
519
- }), this.on("settings", (e) => {
520
- window.FEIM.send.updateSettings(e);
517
+ }), this.on("settings", (t) => {
518
+ window.FEIM.send.updateSettings(t);
521
519
  });
522
520
  }
523
521
  }
524
- const Ve = x("TukoPlugin", "color:#000000;font-weight:bold;");
525
- class Fi extends $ {
526
- constructor(...e) {
527
- super(...e);
528
- w(this, "PING_INTERVAL", 1e4);
529
- const n = new URLSearchParams(window.location.search).get("pingCallbackUrl");
530
- n && window.setInterval(() => {
531
- this.ping(n);
532
- }, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), Ve("configured");
533
- }
534
- ping(e) {
535
- const s = new XMLHttpRequest();
536
- s.onreadystatechange = function() {
537
- s.readyState === XMLHttpRequest.DONE && (s.status === 0 || s.status >= 200 && s.status < 400 ? Ve("ping ok", s) : Ve("ping error", s));
538
- }, s.open("GET", e), s.send();
522
+ const Ge = O("TukoPlugin", "color:#000000;font-weight:bold;");
523
+ class Ri extends $ {
524
+ constructor(...t) {
525
+ super(...t);
526
+ p(this, "PING_INTERVAL", 1e4);
527
+ const a = new URLSearchParams(window.location.search).get("pingCallbackUrl");
528
+ a && window.setInterval(() => {
529
+ this.ping(a);
530
+ }, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), Ge("configured");
531
+ }
532
+ ping(t) {
533
+ const n = new XMLHttpRequest();
534
+ n.onreadystatechange = function() {
535
+ n.readyState === XMLHttpRequest.DONE && (n.status === 0 || n.status >= 200 && n.status < 400 ? Ge("ping ok", n) : Ge("ping error", n));
536
+ }, n.open("GET", t), n.send();
539
537
  }
540
538
  registerToSdkEvents() {
541
- window.addEventListener("message", (e) => {
539
+ window.addEventListener("message", (t) => {
542
540
  try {
543
- const { type: s, payload: n } = e.data;
544
- switch (s) {
541
+ const { type: n, payload: a } = t.data;
542
+ switch (n) {
545
543
  case "doAudioSettings":
546
- this.send("settings", { music: n == null ? void 0 : n.musicEnabled, sounds: n == null ? void 0 : n.soundEnabled });
544
+ this.send("settings", { music: a == null ? void 0 : a.musicEnabled, sounds: a == null ? void 0 : a.soundEnabled });
547
545
  return;
548
546
  case "doBalanceUpdate":
549
- const { currency: c, coinValueInCents: a } = this.config.api;
550
- n.currency === c && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance: xt(n.balanceInCurrency, a) }) : (n.balanceInCoins, this.send("balance", { balance: n.balanceInCoins }));
547
+ const { currency: c, coinValueInCents: s } = this.config.api;
548
+ a.currency === c && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance: Ot(a.balanceInCurrency, s) }) : (a.balanceInCoins, this.send("balance", { balance: a.balanceInCoins }));
551
549
  return;
552
550
  case "doGamePause":
553
551
  this.send("freeze");
@@ -583,104 +581,119 @@ class Fi extends $ {
583
581
  }
584
582
  }
585
583
  class Qt {
586
- constructor(t) {
587
- w(this, "socket", null);
588
- w(this, "webSocketUrl");
589
- w(this, "eventListeners", {
584
+ constructor(e) {
585
+ p(this, "config");
586
+ this.config = e;
587
+ }
588
+ on(e, t, n) {
589
+ const a = function(s) {
590
+ s.data.message !== `kalamba:wrapper-rgs:${e}` && s.data.message !== `kalamba:wrapper:${e}` || t(s.data.payload);
591
+ };
592
+ window.addEventListener("message", a, n);
593
+ }
594
+ send(e, ...[t]) {
595
+ window.postMessage({
596
+ message: `kalamba:rgs:${e}`,
597
+ payload: t
598
+ });
599
+ }
600
+ }
601
+ class Xt {
602
+ constructor(e) {
603
+ p(this, "socket", null);
604
+ p(this, "webSocketUrl");
605
+ p(this, "eventListeners", {
590
606
  close: [],
591
607
  error: [],
592
608
  message: []
593
609
  });
594
- w(this, "connect", () => {
595
- const t = new WebSocket(this.webSocketUrl);
596
- return t.addEventListener("message", this.handleMessage), new Promise((e) => {
597
- t.addEventListener("open", (s) => {
598
- this.handleOpen(s), e(this.socket);
610
+ p(this, "connect", () => {
611
+ const e = new WebSocket(this.webSocketUrl);
612
+ return e.addEventListener("message", this.handleMessage), new Promise((t) => {
613
+ e.addEventListener("open", (n) => {
614
+ this.handleOpen(n), t(this.socket);
599
615
  });
600
616
  });
601
617
  });
602
- w(this, "send", (t) => {
618
+ p(this, "send", (e) => {
603
619
  if (this.socket == null)
604
620
  throw new Error("Cannot send message, the WebSocket connection is not open");
605
- this.socket.send(t);
621
+ this.socket.send(e);
606
622
  });
607
- w(this, "close", () => {
623
+ p(this, "close", () => {
608
624
  if (this.socket == null)
609
625
  throw new Error("Cannot close the WebSocket connection that is not open");
610
- this.socket.close(), this.addEventListener("error", (t) => {
611
- console.log(t);
626
+ this.socket.close(), this.addEventListener("error", (e) => {
627
+ console.log(e);
612
628
  });
613
629
  });
614
- w(this, "handleClose", (t) => {
615
- this.eventListeners.close.forEach((e) => {
616
- e(t);
630
+ p(this, "handleClose", (e) => {
631
+ this.eventListeners.close.forEach((t) => {
632
+ t(e);
617
633
  });
618
634
  });
619
- w(this, "handleError", (t) => {
620
- this.eventListeners.error.forEach((e) => {
621
- e(t);
635
+ p(this, "handleError", (e) => {
636
+ this.eventListeners.error.forEach((t) => {
637
+ t(e);
622
638
  });
623
639
  });
624
- w(this, "handleMessage", (t) => {
625
- this.eventListeners.message.forEach((e) => {
626
- e(t);
640
+ p(this, "handleMessage", (e) => {
641
+ this.eventListeners.message.forEach((t) => {
642
+ t(e);
627
643
  });
628
644
  });
629
- w(this, "handleOpen", (t) => {
630
- const e = t.target;
631
- e.addEventListener("close", this.handleClose), e.addEventListener("error", this.handleError), this.socket = e;
645
+ p(this, "handleOpen", (e) => {
646
+ const t = e.target;
647
+ t.addEventListener("close", this.handleClose), t.addEventListener("error", this.handleError), this.socket = t;
632
648
  });
633
- this.webSocketUrl = t;
649
+ this.webSocketUrl = e;
634
650
  }
635
- addEventListener(t, e) {
636
- this.eventListeners[t].push(e);
651
+ addEventListener(e, t) {
652
+ this.eventListeners[e].push(t);
637
653
  }
638
- removeEventListener(t, e) {
639
- const s = this.eventListeners[t].indexOf(e);
640
- s !== -1 && this.eventListeners[t].splice(s, 1);
654
+ removeEventListener(e, t) {
655
+ const n = this.eventListeners[e].indexOf(t);
656
+ n !== -1 && this.eventListeners[e].splice(n, 1);
641
657
  }
642
658
  }
643
- function Me(i) {
659
+ function Ce(i) {
644
660
  try {
645
661
  return JSON.parse(i == null ? void 0 : i.data);
646
- } catch (t) {
647
- return console.error("fakap", t), null;
662
+ } catch (e) {
663
+ return console.error("fakap", e), null;
648
664
  }
649
665
  }
650
- function oe(i) {
651
- var t;
652
- return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "GameEvent";
653
- }
654
- function Xt(i) {
655
- return oe(i) && i.body.event === "OPEN_GAME";
666
+ function be(i) {
667
+ var e;
668
+ return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "GameEvent";
656
669
  }
657
670
  function Kt(i) {
658
- return oe(i) && i.body.event === "SPIN_ERROR";
671
+ return be(i) && i.body.event === "OPEN_GAME";
659
672
  }
660
673
  function Jt(i) {
661
- return oe(i) && i.body.event === "SPIN_RESULT";
674
+ return be(i) && i.body.event === "SPIN_ERROR";
662
675
  }
663
676
  function Yt(i) {
664
- return oe(i) && i.body.event === "BG_RESULT";
677
+ return be(i) && i.body.event.includes("_RESULT");
665
678
  }
666
679
  function Zt(i) {
667
- var t;
668
- return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "OpenGame";
680
+ var e;
681
+ return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "OpenGame";
669
682
  }
670
683
  function ei(i) {
671
- var t;
672
- return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "Ping";
684
+ var e;
685
+ return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "Ping";
673
686
  }
674
- function ct(i) {
675
- var t;
676
- return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "RealityCheck";
687
+ function dt(i) {
688
+ var e;
689
+ return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "RealityCheck";
677
690
  }
678
691
  var Z, ye;
679
- class ti extends Qt {
680
- constructor(e, s) {
681
- const n = new URL(e.apiUrl);
682
- n.searchParams.set("cageCode", e.cageCode), n.searchParams.set("gameCode", e.gameCode), n.searchParams.set("operatorCode", e.operatorCode), n.searchParams.set("playMode", e.playMode), n.searchParams.set("token", e.token), n.searchParams.set("username", e.username);
683
- super(n.toString());
692
+ class ti extends Xt {
693
+ constructor(t, n) {
694
+ const a = new URL(t.apiUrl);
695
+ a.searchParams.set("cageCode", t.cageCode), a.searchParams.set("gameCode", t.gameCode), a.searchParams.set("operatorCode", t.operatorCode), a.searchParams.set("playMode", t.playMode), a.searchParams.set("token", t.token), a.searchParams.set("username", t.username);
696
+ super(a.toString());
684
697
  /*
685
698
  * Correlation ID. Used in Request and Response types.
686
699
  * ----
@@ -691,7 +704,7 @@ class ti extends Qt {
691
704
  * request sent. Client and server independently maintain their own
692
705
  * correlation id counter.
693
706
  */
694
- w(this, "cId", 0);
707
+ p(this, "cId", 0);
695
708
  // Initial values for header
696
709
  /*
697
710
  * Increasing message ID
@@ -703,144 +716,293 @@ class ti extends Qt {
703
716
  * received out of sync).
704
717
  */
705
718
  // TODO make sure messages are processed in order
706
- w(this, "mId", 0);
719
+ p(this, "mId", 0);
707
720
  // Initial values for body
708
721
  /*
709
722
  * Sequence ID. Action/Event correlation.
710
723
  */
711
- w(this, "seqId", 10);
712
- w(this, "gameCode");
713
- v(this, Z, void 0);
714
- v(this, ye, void 0);
715
- w(this, "onMessage", (e) => {
716
- const s = Me(e);
717
- (oe(s) || ei(s) || ct(s)) && this.sendAcknowledgement(s), ct(s) && this.handleRealityCheck(s);
724
+ p(this, "seqId", 10);
725
+ p(this, "gameCode");
726
+ E(this, Z, void 0);
727
+ E(this, ye, void 0);
728
+ p(this, "onMessage", (t) => {
729
+ const n = Ce(t);
730
+ (be(n) || ei(n) || dt(n)) && this.sendAcknowledgement(n), dt(n) && this.handleRealityCheck(n);
718
731
  });
719
- this.eventListeners.realityCheck = [], this.gameCode = e.gameCode, E(this, Z, s.requestTimeoutMs), E(this, ye, s.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
732
+ this.eventListeners.realityCheck = [], this.gameCode = t.gameCode, v(this, Z, n.requestTimeoutMs), v(this, ye, n.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
720
733
  }
721
- handleRealityCheck(e) {
722
- this.eventListeners.realityCheck.forEach((s) => {
723
- s(e.body);
734
+ handleRealityCheck(t) {
735
+ this.eventListeners.realityCheck.forEach((n) => {
736
+ n(t.body);
724
737
  });
725
738
  }
726
- addEventListener(e, s) {
727
- super.addEventListener(e, s);
739
+ addEventListener(t, n) {
740
+ super.addEventListener(t, n);
728
741
  }
729
- removeEventListener(e, s) {
730
- super.removeEventListener(e, s);
742
+ removeEventListener(t, n) {
743
+ super.removeEventListener(t, n);
731
744
  }
732
- buildHeader(e, s = null) {
745
+ buildHeader(t, n = null) {
733
746
  return {
734
747
  // Assign new cId if it is not provided
735
- cId: s ?? ++this.cId,
736
- code: s !== null ? 1 : void 0,
748
+ cId: n ?? ++this.cId,
749
+ code: n !== null ? 1 : void 0,
737
750
  mId: ++this.mId,
738
- name: e
751
+ name: t
739
752
  };
740
753
  }
741
754
  // TODO infer body from header
742
- buildPayload(e, s) {
755
+ buildPayload(t, n) {
743
756
  return JSON.stringify({
744
- body: s,
745
- header: e
757
+ body: n,
758
+ header: t
746
759
  });
747
760
  }
748
- getBodyExtras(e) {
761
+ getBodyExtras(t) {
749
762
  return {
750
- action: e,
763
+ action: t,
751
764
  seqId: ++this.seqId
752
765
  };
753
766
  }
754
- request(e, s) {
755
- const n = this.buildPayload(e, s);
756
- return new Promise((c, a) => {
757
- setTimeout(() => a({ request: { body: s, header: e }, type: "timeout" }), y(this, Z));
758
- const h = (p) => {
759
- const g = Me(p);
767
+ request(t, n) {
768
+ const a = this.buildPayload(t, n);
769
+ return new Promise((c, s) => {
770
+ setTimeout(() => s({ request: { body: n, header: t }, type: "timeout" }), y(this, Z));
771
+ const h = (g) => {
772
+ const w = Ce(g);
760
773
  try {
761
- e.cId === (g == null ? void 0 : g.header.cId) && (this.removeEventListener("message", h), g.header.code === 1 ? c(g) : a({ response: g, type: "response" }));
774
+ t.cId === (w == null ? void 0 : w.header.cId) && (this.removeEventListener("message", h), w.header.code === 1 ? c(w) : s({ response: w, type: "response" }));
762
775
  } catch {
763
- a({ response: g, type: "error" });
776
+ s({ response: w, type: "error" });
764
777
  }
765
778
  };
766
- this.addEventListener("message", h), this.send(n);
779
+ this.addEventListener("message", h), this.send(a);
767
780
  });
768
781
  }
769
- activateFreeRound(e) {
770
- const s = this.buildHeader("ActivateFreeRound");
782
+ activateFreeRound(t) {
783
+ const n = this.buildHeader("ActivateFreeRound");
771
784
  return this.request(
772
- s,
773
- e
785
+ n,
786
+ t
774
787
  );
775
788
  }
776
- authenticate(e = !1) {
777
- const s = this.buildHeader("Authenticate"), n = {
789
+ authenticate(t = !1) {
790
+ const n = this.buildHeader("Authenticate"), a = {
778
791
  clientType: 3,
779
792
  version: y(this, ye),
780
- reconnect: e
793
+ reconnect: t
781
794
  };
782
795
  return this.request(
783
- s,
784
- n
796
+ n,
797
+ a
785
798
  ).then((c) => c.body);
786
799
  }
787
800
  openGame() {
788
- const e = this.buildHeader("OpenGame"), s = {
801
+ const t = this.buildHeader("OpenGame"), n = {
789
802
  gameCode: this.gameCode
790
803
  };
791
- return new Promise((n, c) => {
792
- const a = (h) => {
793
- const p = Me(h);
794
- Xt(p) && (this.removeEventListener("message", a), n(p.body));
804
+ return new Promise((a, c) => {
805
+ const s = (h) => {
806
+ const g = Ce(h);
807
+ Kt(g) && (this.removeEventListener("message", s), a(g.body));
795
808
  };
796
- this.addEventListener("message", a), this.request(e, s).catch((h) => {
809
+ this.addEventListener("message", s), this.request(t, n).catch((h) => {
797
810
  Zt(h.response) && c(h), c(h);
798
811
  });
799
812
  });
800
813
  }
801
- sendAcknowledgement(e) {
802
- const { name: s, cId: n } = e.header, c = this.buildHeader(s, n), a = this.buildPayload(c, {});
803
- this.send(a);
814
+ sendAcknowledgement(t) {
815
+ const { name: n, cId: a } = t.header, c = this.buildHeader(n, a), s = this.buildPayload(c, {});
816
+ this.send(s);
804
817
  }
805
- sendAction(e, s) {
806
- const n = this.buildHeader("GameAction"), c = {
807
- ...this.getBodyExtras(e),
808
- data: s
818
+ sendAction(t, n) {
819
+ const a = this.buildHeader("GameAction"), c = {
820
+ ...this.getBodyExtras(t),
821
+ data: n
809
822
  };
810
- return new Promise((a, h) => {
811
- const p = (g) => {
812
- const f = Me(g);
813
- oe(f) && c.seqId === f.body.correlationSeqId && (this.removeEventListener("message", p), Jt(f) || Yt(f) ? a(f.body) : Kt(f) && h(f.body));
823
+ return new Promise((s, h) => {
824
+ const g = (w) => {
825
+ const m = Ce(w);
826
+ be(m) && c.seqId === m.body.correlationSeqId && (this.removeEventListener("message", g), Yt(m) ? s(m.body) : Jt(m) && h(m.body));
814
827
  };
815
- this.addEventListener("message", p), this.request(n, c).catch(
816
- (g) => {
817
- h(g);
828
+ this.addEventListener("message", g), this.request(a, c).catch(
829
+ (w) => {
830
+ h(w);
818
831
  }
819
832
  );
820
833
  });
821
834
  }
822
- setRequestTimeoutMs(e) {
823
- E(this, Z, e);
835
+ setRequestTimeoutMs(t) {
836
+ v(this, Z, t);
824
837
  }
825
838
  }
826
839
  Z = new WeakMap(), ye = new WeakMap();
827
- class ii {
828
- constructor(t) {
829
- w(this, "config");
830
- this.config = t;
831
- }
832
- on(t, e, s) {
833
- const n = function(a) {
834
- a.data.message !== `kalamba:wrapper-rgs:${t}` && a.data.message !== `kalamba:wrapper:${t}` || e(a.data.payload);
835
- };
836
- window.addEventListener("message", n, s);
837
- }
838
- send(t, ...[e]) {
839
- window.postMessage({
840
- message: `kalamba:rgs:${t}`,
841
- payload: e
842
- });
843
- }
840
+ function ii(i) {
841
+ return i.contract ? {
842
+ contract: {
843
+ balance: {
844
+ coins: i.contract.balance,
845
+ version: i.contract.balanceVersion
846
+ },
847
+ coinValueInCents: i.contract.coinValueInCents,
848
+ country: i.contract.countryCode,
849
+ currency: i.contract.currencyCode,
850
+ jurisdiction: i.contract.jurisdictionCode,
851
+ uiMessages: i.contract.uiMessages,
852
+ username: i.contract.username
853
+ }
854
+ } : {
855
+ contract: {
856
+ balance: {
857
+ coins: i.balance,
858
+ version: i.balanceVersion
859
+ },
860
+ coinValueInCents: i.coinValueInCents,
861
+ country: i.countryCode,
862
+ currency: i.currencyCode,
863
+ jurisdiction: i.jurisdictionCode,
864
+ uiMessages: i.uiMessages,
865
+ username: i.username
866
+ }
867
+ };
868
+ }
869
+ function ni(i, e) {
870
+ return e.contract ? {
871
+ contract: {
872
+ bet: {
873
+ available: e.contract.availableMultipliersPerBaseBet,
874
+ default: {
875
+ base: e.contract.defaultBet.baseBet,
876
+ multiplier: e.contract.defaultBet.betMultiplier
877
+ },
878
+ max: e.contract.maxBetInCoins,
879
+ last: e.contract.lastBet ? {
880
+ base: e.contract.lastBet.baseBet,
881
+ multiplier: e.contract.lastBet.betMultiplier
882
+ } : null,
883
+ lastPaid: e.contract.lastMainGameBet ? {
884
+ base: e.contract.lastMainGameBet.baseBet,
885
+ multiplier: e.contract.lastMainGameBet.betMultiplier
886
+ } : null
887
+ },
888
+ balance: {
889
+ coins: e.contract.balanceInCoins,
890
+ version: e.contract.balanceVersion
891
+ },
892
+ gameModel: e.contract.gameModelFile,
893
+ metaData: e.contract.metaData,
894
+ serverTime: e.contract.serverTime,
895
+ sessionId: e.contract.sessionId,
896
+ stateType: {
897
+ thisRound: e.contract.stateTypeThisRound,
898
+ nextRound: e.contract.stateTypeNextRound
899
+ },
900
+ uiMessages: i.contract.uiMessages.concat(e.contract.uiMessages),
901
+ win: {
902
+ round: e.contract.roundWin,
903
+ total: e.contract.totalWin
904
+ }
905
+ },
906
+ data: e.opaqueGameServerToUi
907
+ } : {
908
+ contract: {
909
+ bet: {
910
+ available: e.data.additionalConfigData.availableMultipliersPerBaseBet,
911
+ default: {
912
+ base: e.data.additionalConfigData.defaultBet.baseBet,
913
+ multiplier: e.data.additionalConfigData.defaultBet.betMultiplier
914
+ },
915
+ max: e.data.additionalConfigData.maxAllowedOverallBetInCoins,
916
+ last: e.data.gameState.betFromCurrentRound ? {
917
+ base: e.data.gameState.betFromCurrentRound.baseBet,
918
+ multiplier: e.data.gameState.betFromCurrentRound.betMultiplier
919
+ } : null,
920
+ lastPaid: e.data.gameState.lastPlacedMainGameBet ? {
921
+ base: e.data.gameState.lastPlacedMainGameBet.baseBet,
922
+ multiplier: e.data.gameState.lastPlacedMainGameBet.betMultiplier
923
+ } : null
924
+ },
925
+ balance: {
926
+ coins: e.balance,
927
+ version: e.balanceVersion
928
+ },
929
+ gameModel: e.data.additionalConfigData.gameModelFile,
930
+ metaData: e.data.gameConfigData.metaData,
931
+ serverTime: e.balanceVersion,
932
+ sessionId: e.data.gameState.sessionId,
933
+ stateType: {
934
+ thisRound: e.data.gameState.stateTypeThisRound,
935
+ nextRound: e.data.gameState.stateTypeNextRound
936
+ },
937
+ uiMessages: i.uiMessages,
938
+ win: {
939
+ round: e.data.gameState.totalWinFromCurrentRound,
940
+ total: e.data.gameState.totalWinFromCurrentGameCycle
941
+ }
942
+ },
943
+ data: e.data
944
+ };
945
+ }
946
+ function ai(i) {
947
+ return i.contract ? {
948
+ contract: {
949
+ bet: {
950
+ last: i.contract.lastBet ? {
951
+ base: i.contract.lastBet.baseBet,
952
+ multiplier: i.contract.lastBet.betMultiplier
953
+ } : null,
954
+ lastPaid: {
955
+ base: i.contract.lastMainGameBet.baseBet,
956
+ multiplier: i.contract.lastMainGameBet.betMultiplier
957
+ }
958
+ },
959
+ balance: {
960
+ coins: i.contract.balanceInCoins,
961
+ version: i.contract.balanceVersion
962
+ },
963
+ serverTime: i.contract.serverTime,
964
+ roundId: i.contract.roundId,
965
+ stateType: {
966
+ thisRound: i.contract.stateTypeThisRound,
967
+ nextRound: i.contract.stateTypeNextRound
968
+ },
969
+ uiMessages: i.contract.uiMessages,
970
+ win: {
971
+ round: i.contract.roundWin,
972
+ total: i.contract.totalWin
973
+ }
974
+ },
975
+ data: i.opaqueGameServerToUi
976
+ } : {
977
+ contract: {
978
+ bet: {
979
+ last: i.data.gameState.betFromCurrentRound ? {
980
+ base: i.data.gameState.betFromCurrentRound.baseBet,
981
+ multiplier: i.data.gameState.betFromCurrentRound.betMultiplier
982
+ } : null,
983
+ lastPaid: {
984
+ base: i.data.gameState.lastPlacedMainGameBet.baseBet,
985
+ multiplier: i.data.gameState.lastPlacedMainGameBet.betMultiplier
986
+ }
987
+ },
988
+ balance: {
989
+ coins: i.balance,
990
+ version: i.balanceVersion
991
+ },
992
+ serverTime: i.balanceVersion,
993
+ roundId: i.data.gameState.cycleId,
994
+ stateType: {
995
+ thisRound: i.data.gameState.stateTypeThisRound,
996
+ nextRound: i.data.gameState.stateTypeNextRound
997
+ },
998
+ uiMessages: i.data.uiMessages,
999
+ win: {
1000
+ round: i.data.gameState.totalWinFromCurrentRound,
1001
+ total: i.data.gameState.totalWinFromCurrentGameCycle
1002
+ }
1003
+ },
1004
+ data: i.data
1005
+ };
844
1006
  }
845
1007
  const si = {
846
1008
  bul: "bg",
@@ -874,167 +1036,168 @@ const si = {
874
1036
  tur: "tr",
875
1037
  ukr: "uk",
876
1038
  vie: "vi"
877
- }, ni = x("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
878
- var Ee;
879
- class Di extends ii {
880
- constructor(...e) {
881
- super(...e);
1039
+ }, oi = O("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
1040
+ var ve;
1041
+ class Ni extends Qt {
1042
+ constructor(...t) {
1043
+ super(...t);
882
1044
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
883
1045
  // @ts-ignore
884
- w(this, "socket");
885
- v(this, Ee, "");
1046
+ p(this, "socket");
1047
+ E(this, ve, "");
886
1048
  this.on("openGame", async () => {
887
1049
  try {
888
- const s = await this.openGame();
889
- this.send("openGameResponse", s);
890
- } catch (s) {
891
- this.send("openGameError", s);
1050
+ const n = await this.openGame();
1051
+ this.send("openGameResponse", n);
1052
+ } catch (n) {
1053
+ this.send("openGameError", n);
892
1054
  }
893
- }), this.on("play", async (s) => {
1055
+ }), this.on("play", async (n) => {
894
1056
  try {
895
- const n = await this.play(s);
896
- this.send("playResponse", n);
897
- } catch (n) {
898
- this.send("playError", n);
1057
+ const a = await this.play(n);
1058
+ this.send("playResponse", a);
1059
+ } catch (a) {
1060
+ this.send("playError", a);
899
1061
  }
900
- }), this.on("state", ({ version: s }) => {
901
- E(this, Ee, s);
902
- }), this.on("configured", (s) => {
903
- this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs);
1062
+ }), this.on("state", ({ version: n }) => {
1063
+ v(this, ve, n);
1064
+ }), this.on("configured", (n) => {
1065
+ this.socket.setRequestTimeoutMs(n.ui.requestTimeoutMs);
904
1066
  }), this.registerFromSdkEvents();
905
1067
  }
906
- initialize(e) {
907
- this.socket = new ti(e, {
908
- gameVersion: y(this, Ee),
1068
+ initialize(t) {
1069
+ this.socket = new ti(t, {
1070
+ gameVersion: y(this, ve),
909
1071
  requestTimeoutMs: this.config.ui.requestTimeoutMs
910
- }), this.socket.addEventListener("close", (s) => {
911
- s.code === 1006 && this.reconnect(e);
1072
+ }), this.socket.addEventListener("close", (n) => {
1073
+ n.code === 1006 && this.reconnect(t);
912
1074
  }), document.addEventListener("visibilitychange", () => {
913
- document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(e);
914
- }), this.socket.addEventListener("error", (s) => ni("error", s)), this.socket.addEventListener("realityCheck", (s) => {
915
- this.send("realityCheck", s);
1075
+ document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(t);
1076
+ }), this.socket.addEventListener("error", (n) => oi("error", n)), this.socket.addEventListener("realityCheck", (n) => {
1077
+ this.send("realityCheck", n);
916
1078
  });
917
1079
  }
918
- async reconnect(e) {
919
- this.initialize(e), await this.socket.connect(), await this.socket.authenticate(!0), await this.socket.openGame();
1080
+ async reconnect(t) {
1081
+ this.initialize(t), await this.socket.connect(), await this.socket.authenticate(!0), await this.socket.openGame();
920
1082
  }
921
1083
  async openGame() {
922
- const e = new URLSearchParams(window.location.search), s = e.get("apiUrl"), n = e.get("cageCode"), c = e.get("gameCode"), a = e.get("operatorCode"), h = e.get("playMode"), p = e.get("token"), g = e.get("username"), f = e.get("gameHistoryUrl"), A = e.get("homeUrl") ?? void 0, D = e.get("cashierUrl") ?? void 0;
923
- this.initialize({ apiUrl: s, cageCode: n, gameCode: c, operatorCode: a, playMode: h, token: p, username: g }), await this.socket.connect();
924
- const B = await this.socket.authenticate(), le = await this.socket.openGame();
1084
+ const t = new URLSearchParams(window.location.search), n = t.get("apiUrl"), a = t.get("cageCode"), c = t.get("gameCode"), s = t.get("operatorCode"), h = t.get("playMode"), g = t.get("token"), w = t.get("username"), m = t.get("gameHistoryUrl"), A = t.get("homeUrl") ?? void 0, R = t.get("cashierUrl") ?? void 0;
1085
+ this.initialize({ apiUrl: n, cageCode: a, gameCode: c, operatorCode: s, playMode: h, token: g, username: w }), await this.socket.connect();
1086
+ const de = await this.socket.authenticate(), le = await this.socket.openGame(), L = ii(de), Se = ni(de, le);
925
1087
  this.config.api = {
926
- brand: n,
1088
+ brand: a,
927
1089
  game: c,
928
- integration: a,
929
- jurisdiction: B.jurisdictionCode,
1090
+ integration: s,
1091
+ jurisdiction: L.contract.jurisdiction,
930
1092
  playMode: h,
931
- user: B.username,
1093
+ user: L.contract.username,
932
1094
  integrationData: {
933
- token: p
1095
+ token: g
934
1096
  },
935
- country: B.countryCode,
936
- currency: B.currencyCode,
937
- coinValueInCents: B.coinValueInCents,
938
- gameHistoryUrl: f,
1097
+ country: L.contract.country,
1098
+ currency: L.contract.currency,
1099
+ coinValueInCents: L.contract.coinValueInCents,
1100
+ gameHistoryUrl: m,
939
1101
  homeUrl: A,
940
- cashierUrl: D
1102
+ cashierUrl: R,
1103
+ sessionId: Se.contract.sessionId
941
1104
  };
942
- const U = e.get("languageCode");
943
- return U && (this.config.ui.language = U.length === 3 ? si[U] ?? U : U), le;
1105
+ const x = t.get("languageCode");
1106
+ return x && (this.config.ui.language = x.length === 3 ? si[x] ?? x : x), Se;
944
1107
  }
945
- // TODO: redefine PlayResponse type
946
- play(e) {
1108
+ async play(t) {
947
1109
  const {
948
- contract: { bet: s, ...n },
1110
+ contract: { bet: n, ...a },
949
1111
  extra: c,
950
- actionType: a
951
- } = e;
952
- return this.socket.sendAction(a, {
953
- bet: s ? { baseBet: s.base, betMultiplier: s.multiplier } : void 0,
954
- ...n,
955
- ...c
956
- });
1112
+ actionType: s
1113
+ } = t, h = await this.socket.sendAction(s, {
1114
+ bet: n ? { baseBet: n.base, betMultiplier: n.multiplier } : void 0,
1115
+ // TODO: get rid of contractRest - it' a legacy from old RGS
1116
+ ...a,
1117
+ opaqueUiToGameServer: c
1118
+ }), g = ai(h);
1119
+ return this.config.api.lastRoundId = g.contract.roundId, g;
957
1120
  }
958
1121
  registerFromSdkEvents() {
959
1122
  this.on("history", () => {
960
1123
  const {
961
- api: { game: e, integration: s, integrationData: n, jurisdiction: c, user: a, gameHistoryUrl: h },
962
- ui: { language: p }
963
- } = this.config, g = a.replace(/^user_/, "").replace(new RegExp(`_${s}$`), ""), f = new URL(h);
964
- f.searchParams.set("gameCode", e), f.searchParams.set("jurisdiction", c), f.searchParams.set("operatorCode", s), f.searchParams.set("token", n.token), f.searchParams.set("username", g), f.searchParams.set("languageCode", p), window.open(f.toString(), "_blank");
1124
+ api: { game: t, integration: n, integrationData: a, jurisdiction: c, user: s, gameHistoryUrl: h },
1125
+ ui: { language: g }
1126
+ } = this.config, w = s.replace(/^user_/, "").replace(new RegExp(`_${n}$`), ""), m = new URL(h);
1127
+ m.searchParams.set("gameCode", t), m.searchParams.set("jurisdiction", c), m.searchParams.set("operatorCode", n), m.searchParams.set("token", a.token), m.searchParams.set("username", w), m.searchParams.set("languageCode", g), window.open(m.toString(), "_blank");
965
1128
  });
966
1129
  }
967
1130
  }
968
- Ee = new WeakMap();
969
- var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce = "object", Je = "string", fe = "major", d = "model", o = "name", l = "type", u = "vendor", r = "version", M = "architecture", K = "console", m = "mobile", b = "tablet", I = "smarttv", X = "wearable", Ye = "embedded", lt = "user-agent", Ze = 500, it = "brands", q = "formFactor", st = "fullVersionList", J = "platform", nt = "platformVersion", De = "bitness", V = "sec-ch-ua", oi = V + "-full-version-list", ri = V + "-arch", ci = V + "-" + De, di = V + "-form-factor", li = V + "-" + m, ui = V + "-" + d, Ot = V + "-" + J, hi = Ot + "-version", Lt = [it, st, m, d, J, nt, M, q, De], T = "browser", O = "cpu", P = "device", L = "engine", R = "os", Y = "result", Ce = "Amazon", pe = "Apple", ut = "ASUS", ht = "BlackBerry", Ie = "Google", pt = "Huawei", gt = "Lenovo", qe = "LG", Ue = "Microsoft", wt = "Motorola", Te = "Samsung", mt = "Sharp", Ae = "Sony", We = "Xiaomi", $e = "Zebra", j = "Mobile ", Q = " Browser", Re = "Chrome", pi = "Edge", ge = "Firefox", we = "Opera", ft = "Facebook", bt = "Sogou", et = "Windows", gi = typeof window !== H, C = gi && window.navigator ? window.navigator : void 0, G = C && C.userAgentData ? C.userAgentData : void 0, wi = function(i, t) {
970
- var e = {};
971
- for (var s in i)
972
- e[s] = t[s] && t[s].length % 2 === 0 ? t[s].concat(i[s]) : i[s];
973
- return e;
974
- }, Be = function(i) {
975
- for (var t = {}, e = 0; e < i.length; e++)
976
- t[i[e].toUpperCase()] = i[e];
1131
+ ve = new WeakMap();
1132
+ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re = "object", Ye = "string", me = "major", d = "model", o = "name", l = "type", u = "vendor", r = "version", S = "architecture", K = "console", b = "mobile", f = "tablet", I = "smarttv", X = "wearable", Ze = "embedded", ut = "user-agent", et = 500, nt = "brands", G = "formFactor", at = "fullVersionList", J = "platform", st = "platformVersion", Re = "bitness", q = "sec-ch-ua", ci = q + "-full-version-list", di = q + "-arch", li = q + "-" + Re, ui = q + "-form-factor", hi = q + "-" + b, gi = q + "-" + d, Bt = q + "-" + J, wi = Bt + "-version", Ft = [nt, at, b, d, J, st, S, G, Re], T = "browser", B = "cpu", U = "device", F = "engine", P = "os", Y = "result", Ie = "Amazon", he = "Apple", ht = "ASUS", gt = "BlackBerry", Te = "Google", wt = "Huawei", pt = "Lenovo", We = "LG", Le = "Microsoft", bt = "Motorola", Ae = "Samsung", mt = "Sharp", Pe = "Sony", $e = "Xiaomi", je = "Zebra", j = "Mobile ", Q = " Browser", xe = "Chrome", pi = "Edge", ge = "Firefox", we = "Opera", ft = "Facebook", yt = "Sogou", tt = "Windows", bi = typeof window !== V, C = bi && window.navigator ? window.navigator : void 0, N = C && C.userAgentData ? C.userAgentData : void 0, mi = function(i, e) {
1133
+ var t = {};
1134
+ for (var n in i)
1135
+ t[n] = e[n] && e[n].length % 2 === 0 ? e[n].concat(i[n]) : i[n];
977
1136
  return t;
978
- }, tt = function(i, t) {
979
- if (typeof i === ce && i.length > 0) {
980
- for (var e in i)
981
- if (z(i[e]) == z(t))
1137
+ }, Ne = function(i) {
1138
+ for (var e = {}, t = 0; t < i.length; t++)
1139
+ e[i[t].toUpperCase()] = i[t];
1140
+ return e;
1141
+ }, it = function(i, e) {
1142
+ if (typeof i === re && i.length > 0) {
1143
+ for (var t in i)
1144
+ if (z(i[t]) == z(e))
982
1145
  return !0;
983
1146
  return !1;
984
1147
  }
985
- return de(i) ? z(t).indexOf(z(i)) !== -1 : !1;
986
- }, yt = function(i) {
987
- for (var t in i)
988
- return /^(browser|cpu|device|engine|os)$/.test(t);
989
- }, de = function(i) {
990
- return typeof i === Je;
991
- }, je = function(i) {
1148
+ return ce(i) ? z(e).indexOf(z(i)) !== -1 : !1;
1149
+ }, vt = function(i) {
1150
+ for (var e in i)
1151
+ return /^(browser|cpu|device|engine|os)$/.test(e);
1152
+ }, ce = function(i) {
1153
+ return typeof i === Ye;
1154
+ }, Qe = function(i) {
992
1155
  if (i) {
993
- for (var t = [], e = W(/\\?\"/g, i).split(","), s = 0; s < e.length; s++)
994
- if (e[s].indexOf(";") > -1) {
995
- var n = be(e[s]).split(";v=");
996
- t[s] = { brand: n[0], version: n[1] };
1156
+ for (var e = [], t = W(/\\?\"/g, i).split(","), n = 0; n < t.length; n++)
1157
+ if (t[n].indexOf(";") > -1) {
1158
+ var a = fe(t[n]).split(";v=");
1159
+ e[n] = { brand: a[0], version: a[1] };
997
1160
  } else
998
- t[s] = be(e[s]);
999
- return t;
1161
+ e[n] = fe(t[n]);
1162
+ return e;
1000
1163
  }
1001
1164
  }, z = function(i) {
1002
- return de(i) ? i.toLowerCase() : i;
1003
- }, Qe = function(i) {
1004
- return de(i) ? W(/[^\d\.]/g, i).split(".")[0] : void 0;
1165
+ return ce(i) ? i.toLowerCase() : i;
1166
+ }, Xe = function(i) {
1167
+ return ce(i) ? W(/[^\d\.]/g, i).split(".")[0] : void 0;
1005
1168
  }, _ = function(i) {
1006
- for (var t in i) {
1007
- var e = i[t];
1008
- typeof e == ce && e.length == 2 ? this[e[0]] = e[1] : this[e] = void 0;
1169
+ for (var e in i) {
1170
+ var t = i[e];
1171
+ typeof t == re && t.length == 2 ? this[t[0]] = t[1] : this[t] = void 0;
1009
1172
  }
1010
1173
  return this;
1011
- }, W = function(i, t) {
1012
- return de(t) ? t.replace(i, re) : t;
1013
- }, me = function(i) {
1174
+ }, W = function(i, e) {
1175
+ return ce(e) ? e.replace(i, oe) : e;
1176
+ }, pe = function(i) {
1014
1177
  return W(/\\?\"/g, i);
1015
- }, be = function(i, t) {
1016
- if (de(i))
1017
- return i = W(/^\s\s*/, i), typeof t === H ? i : i.substring(0, Ze);
1018
- }, Et = function(i, t) {
1019
- if (!(!i || !t))
1020
- for (var e = 0, s, n, c, a, h, p; e < t.length && !h; ) {
1021
- var g = t[e], f = t[e + 1];
1022
- for (s = n = 0; s < g.length && !h && g[s]; )
1023
- if (h = g[s++].exec(i), h)
1024
- for (c = 0; c < f.length; c++)
1025
- p = h[++n], a = f[c], typeof a === ce && a.length > 0 ? a.length === 2 ? typeof a[1] == Ke ? this[a[0]] = a[1].call(this, p) : this[a[0]] = a[1] : a.length === 3 ? typeof a[1] === Ke && !(a[1].exec && a[1].test) ? this[a[0]] = p ? a[1].call(this, p, a[2]) : void 0 : this[a[0]] = p ? p.replace(a[1], a[2]) : void 0 : a.length === 4 && (this[a[0]] = p ? a[3].call(this, p.replace(a[1], a[2])) : void 0) : this[a] = p || void 0;
1026
- e += 2;
1178
+ }, fe = function(i, e) {
1179
+ if (ce(i))
1180
+ return i = W(/^\s\s*/, i), typeof e === V ? i : i.substring(0, et);
1181
+ }, Et = function(i, e) {
1182
+ if (!(!i || !e))
1183
+ for (var t = 0, n, a, c, s, h, g; t < e.length && !h; ) {
1184
+ var w = e[t], m = e[t + 1];
1185
+ for (n = a = 0; n < w.length && !h && w[n]; )
1186
+ if (h = w[n++].exec(i), h)
1187
+ for (c = 0; c < m.length; c++)
1188
+ g = h[++a], s = m[c], typeof s === re && s.length > 0 ? s.length === 2 ? typeof s[1] == Je ? this[s[0]] = s[1].call(this, g) : this[s[0]] = s[1] : s.length === 3 ? typeof s[1] === Je && !(s[1].exec && s[1].test) ? this[s[0]] = g ? s[1].call(this, g, s[2]) : void 0 : this[s[0]] = g ? g.replace(s[1], s[2]) : void 0 : s.length === 4 && (this[s[0]] = g ? s[3].call(this, g.replace(s[1], s[2])) : void 0) : this[s] = g || void 0;
1189
+ t += 2;
1027
1190
  }
1028
- }, Oe = function(i, t) {
1029
- for (var e in t)
1030
- if (typeof t[e] === ce && t[e].length > 0) {
1031
- for (var s = 0; s < t[e].length; s++)
1032
- if (tt(t[e][s], i))
1033
- return e === dt ? void 0 : e;
1034
- } else if (tt(t[e], i))
1035
- return e === dt ? void 0 : e;
1036
- return t.hasOwnProperty("*") ? t["*"] : i;
1037
- }, vt = {
1191
+ }, Be = function(i, e) {
1192
+ for (var t in e)
1193
+ if (typeof e[t] === re && e[t].length > 0) {
1194
+ for (var n = 0; n < e[t].length; n++)
1195
+ if (it(e[t][n], i))
1196
+ return t === lt ? void 0 : t;
1197
+ } else if (it(e[t], i))
1198
+ return t === lt ? void 0 : t;
1199
+ return e.hasOwnProperty("*") ? e["*"] : i;
1200
+ }, kt = {
1038
1201
  ME: "4.90",
1039
1202
  "NT 3.11": "NT3.51",
1040
1203
  "NT 4.0": "NT4.0",
@@ -1046,7 +1209,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1046
1209
  "8.1": "NT 6.3",
1047
1210
  10: ["NT 6.4", "NT 10.0"],
1048
1211
  RT: "ARM"
1049
- }, kt = {
1212
+ }, Mt = {
1050
1213
  embedded: "Automotive",
1051
1214
  mobile: "Mobile",
1052
1215
  tablet: ["Tablet", "EInk"],
@@ -1149,7 +1312,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1149
1312
  /slbrowser\/([\w\.]+)/i
1150
1313
  // Smart Lenovo Browser
1151
1314
  ],
1152
- [r, [o, "Smart " + gt + Q]],
1315
+ [r, [o, "Smart " + pt + Q]],
1153
1316
  [
1154
1317
  /(avast|avg)\/([\w\.]+)/i
1155
1318
  // Avast/AVG Secure Browser
@@ -1204,7 +1367,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1204
1367
  /samsungbrowser\/([\w\.]+)/i
1205
1368
  // Samsung Internet
1206
1369
  ],
1207
- [r, [o, Te + " Internet"]],
1370
+ [r, [o, Ae + " Internet"]],
1208
1371
  [
1209
1372
  /(comodo_dragon)\/([\w\.]+)/i
1210
1373
  // Comodo Dragon
@@ -1214,12 +1377,12 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1214
1377
  /metasr[\/ ]?([\d\.]+)/i
1215
1378
  // Sogou Explorer
1216
1379
  ],
1217
- [r, [o, bt + " Explorer"]],
1380
+ [r, [o, yt + " Explorer"]],
1218
1381
  [
1219
1382
  /(sogou)mo\w+\/([\d\.]+)/i
1220
1383
  // Sogou Mobile
1221
1384
  ],
1222
- [[o, bt + " Mobile"], r],
1385
+ [[o, yt + " Mobile"], r],
1223
1386
  [
1224
1387
  /(electron)\/([\w\.]+) safari/i,
1225
1388
  // Electron-based App
@@ -1273,12 +1436,12 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1273
1436
  /headlesschrome(?:\/([\w\.]+)| )/i
1274
1437
  // Chrome Headless
1275
1438
  ],
1276
- [r, [o, Re + " Headless"]],
1439
+ [r, [o, xe + " Headless"]],
1277
1440
  [
1278
1441
  / wv\).+(chrome)\/([\w\.]+)/i
1279
1442
  // Chrome WebView
1280
1443
  ],
1281
- [[o, Re + " WebView"], r],
1444
+ [[o, xe + " WebView"], r],
1282
1445
  [
1283
1446
  /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
1284
1447
  // Android Browser
@@ -1359,51 +1522,51 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1359
1522
  /(cobalt)\/([\w\.]+)/i
1360
1523
  // Cobalt
1361
1524
  ],
1362
- [o, [r, /[^\d\.]+./, re]]
1525
+ [o, [r, /[^\d\.]+./, oe]]
1363
1526
  ],
1364
1527
  cpu: [
1365
1528
  [
1366
1529
  /\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i
1367
1530
  // AMD64 (x64)
1368
1531
  ],
1369
- [[M, "amd64"]],
1532
+ [[S, "amd64"]],
1370
1533
  [
1371
1534
  /(ia32(?=;))/i,
1372
1535
  // IA32 (quicktime)
1373
1536
  /((?:i[346]|x)86)[;\)]/i
1374
1537
  // IA32 (x86)
1375
1538
  ],
1376
- [[M, "ia32"]],
1539
+ [[S, "ia32"]],
1377
1540
  [
1378
1541
  /\b(aarch64|arm(v?8e?l?|_?64))\b/i
1379
1542
  // ARM64
1380
1543
  ],
1381
- [[M, "arm64"]],
1544
+ [[S, "arm64"]],
1382
1545
  [
1383
1546
  /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
1384
1547
  // ARMHF
1385
1548
  ],
1386
- [[M, "armhf"]],
1549
+ [[S, "armhf"]],
1387
1550
  [
1388
1551
  // PocketPC mistakenly identified as PowerPC
1389
1552
  /windows (ce|mobile); ppc;/i
1390
1553
  ],
1391
- [[M, "arm"]],
1554
+ [[S, "arm"]],
1392
1555
  [
1393
1556
  /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
1394
1557
  // PowerPC
1395
1558
  ],
1396
- [[M, /ower/, re, z]],
1559
+ [[S, /ower/, oe, z]],
1397
1560
  [
1398
1561
  /(sun4\w)[;\)]/i
1399
1562
  // SPARC
1400
1563
  ],
1401
- [[M, "sparc"]],
1564
+ [[S, "sparc"]],
1402
1565
  [
1403
1566
  /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
1404
1567
  // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
1405
1568
  ],
1406
- [[M, z]]
1569
+ [[S, z]]
1407
1570
  ],
1408
1571
  device: [
1409
1572
  [
@@ -1413,45 +1576,45 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1413
1576
  // Samsung
1414
1577
  /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
1415
1578
  ],
1416
- [d, [u, Te], [l, b]],
1579
+ [d, [u, Ae], [l, f]],
1417
1580
  [
1418
1581
  /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
1419
1582
  /samsung[- ]([-\w]+)/i,
1420
1583
  /sec-(sgh\w+)/i
1421
1584
  ],
1422
- [d, [u, Te], [l, m]],
1585
+ [d, [u, Ae], [l, b]],
1423
1586
  [
1424
1587
  // Apple
1425
1588
  /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
1426
1589
  // iPod/iPhone
1427
1590
  ],
1428
- [d, [u, pe], [l, m]],
1591
+ [d, [u, he], [l, b]],
1429
1592
  [
1430
1593
  /\((ipad);[-\w\),; ]+apple/i,
1431
1594
  // iPad
1432
1595
  /applecoremedia\/[\w\.]+ \((ipad)/i,
1433
1596
  /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
1434
1597
  ],
1435
- [d, [u, pe], [l, b]],
1598
+ [d, [u, he], [l, f]],
1436
1599
  [
1437
1600
  /(macintosh);/i
1438
1601
  ],
1439
- [d, [u, pe]],
1602
+ [d, [u, he]],
1440
1603
  [
1441
1604
  // Sharp
1442
1605
  /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
1443
1606
  ],
1444
- [d, [u, mt], [l, m]],
1607
+ [d, [u, mt], [l, b]],
1445
1608
  [
1446
1609
  // Huawei
1447
1610
  /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
1448
1611
  ],
1449
- [d, [u, pt], [l, b]],
1612
+ [d, [u, wt], [l, f]],
1450
1613
  [
1451
1614
  /(?:huawei|honor)([-\w ]+)[;\)]/i,
1452
1615
  /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
1453
1616
  ],
1454
- [d, [u, pt], [l, m]],
1617
+ [d, [u, wt], [l, b]],
1455
1618
  [
1456
1619
  // Xiaomi
1457
1620
  /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
@@ -1467,92 +1630,92 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1467
1630
  /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
1468
1631
  // Xiaomi Mi
1469
1632
  ],
1470
- [[d, /_/g, " "], [u, We], [l, m]],
1633
+ [[d, /_/g, " "], [u, $e], [l, b]],
1471
1634
  [
1472
1635
  /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
1473
1636
  // Redmi Pad
1474
1637
  /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
1475
1638
  // Mi Pad tablets
1476
1639
  ],
1477
- [[d, /_/g, " "], [u, We], [l, b]],
1640
+ [[d, /_/g, " "], [u, $e], [l, f]],
1478
1641
  [
1479
1642
  // OPPO
1480
1643
  /; (\w+) bui.+ oppo/i,
1481
1644
  /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
1482
1645
  ],
1483
- [d, [u, "OPPO"], [l, m]],
1646
+ [d, [u, "OPPO"], [l, b]],
1484
1647
  [
1485
1648
  // Vivo
1486
1649
  /vivo (\w+)(?: bui|\))/i,
1487
1650
  /\b(v[12]\d{3}\w?[at])(?: bui|;)/i
1488
1651
  ],
1489
- [d, [u, "Vivo"], [l, m]],
1652
+ [d, [u, "Vivo"], [l, b]],
1490
1653
  [
1491
1654
  // Realme
1492
1655
  /\b(rmx[1-3]\d{3})(?: bui|;|\))/i
1493
1656
  ],
1494
- [d, [u, "Realme"], [l, m]],
1657
+ [d, [u, "Realme"], [l, b]],
1495
1658
  [
1496
1659
  // Motorola
1497
1660
  /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
1498
1661
  /\bmot(?:orola)?[- ](\w*)/i,
1499
1662
  /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
1500
1663
  ],
1501
- [d, [u, wt], [l, m]],
1664
+ [d, [u, bt], [l, b]],
1502
1665
  [
1503
1666
  /\b(mz60\d|xoom[2 ]{0,2}) build\//i
1504
1667
  ],
1505
- [d, [u, wt], [l, b]],
1668
+ [d, [u, bt], [l, f]],
1506
1669
  [
1507
1670
  // LG
1508
1671
  /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
1509
1672
  ],
1510
- [d, [u, qe], [l, b]],
1673
+ [d, [u, We], [l, f]],
1511
1674
  [
1512
1675
  /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
1513
1676
  /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
1514
1677
  /\blg-?([\d\w]+) bui/i
1515
1678
  ],
1516
- [d, [u, qe], [l, m]],
1679
+ [d, [u, We], [l, b]],
1517
1680
  [
1518
1681
  // Lenovo
1519
1682
  /(ideatab[-\w ]+)/i,
1520
1683
  /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
1521
1684
  ],
1522
- [d, [u, gt], [l, b]],
1685
+ [d, [u, pt], [l, f]],
1523
1686
  [
1524
1687
  // Nokia
1525
1688
  /(?:maemo|nokia).*(n900|lumia \d+)/i,
1526
1689
  /nokia[-_ ]?([-\w\.]*)/i
1527
1690
  ],
1528
- [[d, /_/g, " "], [u, "Nokia"], [l, m]],
1691
+ [[d, /_/g, " "], [u, "Nokia"], [l, b]],
1529
1692
  [
1530
1693
  // Google
1531
1694
  /(pixel c)\b/i
1532
1695
  // Google Pixel C
1533
1696
  ],
1534
- [d, [u, Ie], [l, b]],
1697
+ [d, [u, Te], [l, f]],
1535
1698
  [
1536
1699
  /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
1537
1700
  // Google Pixel
1538
1701
  ],
1539
- [d, [u, Ie], [l, m]],
1702
+ [d, [u, Te], [l, b]],
1540
1703
  [
1541
1704
  // Sony
1542
1705
  /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
1543
1706
  ],
1544
- [d, [u, Ae], [l, m]],
1707
+ [d, [u, Pe], [l, b]],
1545
1708
  [
1546
1709
  /sony tablet [ps]/i,
1547
1710
  /\b(?:sony)?sgp\w+(?: bui|\))/i
1548
1711
  ],
1549
- [[d, "Xperia Tablet"], [u, Ae], [l, b]],
1712
+ [[d, "Xperia Tablet"], [u, Pe], [l, f]],
1550
1713
  [
1551
1714
  // OnePlus
1552
1715
  / (kb2005|in20[12]5|be20[12][59])\b/i,
1553
1716
  /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
1554
1717
  ],
1555
- [d, [u, "OnePlus"], [l, m]],
1718
+ [d, [u, "OnePlus"], [l, b]],
1556
1719
  [
1557
1720
  // Amazon
1558
1721
  /(alexa)webm/i,
@@ -1561,39 +1724,39 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1561
1724
  /(kf[a-z]+)( bui|\)).+silk\//i
1562
1725
  // Kindle Fire HD
1563
1726
  ],
1564
- [d, [u, Ce], [l, b]],
1727
+ [d, [u, Ie], [l, f]],
1565
1728
  [
1566
1729
  /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
1567
1730
  // Fire Phone
1568
1731
  ],
1569
- [[d, /(.+)/g, "Fire Phone $1"], [u, Ce], [l, m]],
1732
+ [[d, /(.+)/g, "Fire Phone $1"], [u, Ie], [l, b]],
1570
1733
  [
1571
1734
  // BlackBerry
1572
1735
  /(playbook);[-\w\),; ]+(rim)/i
1573
1736
  // BlackBerry PlayBook
1574
1737
  ],
1575
- [d, u, [l, b]],
1738
+ [d, u, [l, f]],
1576
1739
  [
1577
1740
  /\b((?:bb[a-f]|st[hv])100-\d)/i,
1578
1741
  /\(bb10; (\w+)/i
1579
1742
  // BlackBerry 10
1580
1743
  ],
1581
- [d, [u, ht], [l, m]],
1744
+ [d, [u, gt], [l, b]],
1582
1745
  [
1583
1746
  // Asus
1584
1747
  /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
1585
1748
  ],
1586
- [d, [u, ut], [l, b]],
1749
+ [d, [u, ht], [l, f]],
1587
1750
  [
1588
1751
  / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
1589
1752
  ],
1590
- [d, [u, ut], [l, m]],
1753
+ [d, [u, ht], [l, b]],
1591
1754
  [
1592
1755
  // HTC
1593
1756
  /(nexus 9)/i
1594
1757
  // HTC Nexus 9
1595
1758
  ],
1596
- [d, [u, "HTC"], [l, b]],
1759
+ [d, [u, "HTC"], [l, f]],
1597
1760
  [
1598
1761
  /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
1599
1762
  // HTC
@@ -1602,23 +1765,23 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1602
1765
  /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
1603
1766
  // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
1604
1767
  ],
1605
- [u, [d, /_/g, " "], [l, m]],
1768
+ [u, [d, /_/g, " "], [l, b]],
1606
1769
  [
1607
1770
  // Acer
1608
1771
  /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
1609
1772
  ],
1610
- [d, [u, "Acer"], [l, b]],
1773
+ [d, [u, "Acer"], [l, f]],
1611
1774
  [
1612
1775
  // Meizu
1613
1776
  /droid.+; (m[1-5] note) bui/i,
1614
1777
  /\bmz-([-\w]{2,})/i
1615
1778
  ],
1616
- [d, [u, "Meizu"], [l, m]],
1779
+ [d, [u, "Meizu"], [l, b]],
1617
1780
  [
1618
1781
  // Ulefone
1619
1782
  /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
1620
1783
  ],
1621
- [d, [u, "Ulefone"], [l, m]],
1784
+ [d, [u, "Ulefone"], [l, b]],
1622
1785
  [
1623
1786
  // MIXED
1624
1787
  /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
@@ -1636,7 +1799,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1636
1799
  /(oppo) ?([\w ]+) bui/i
1637
1800
  // OPPO
1638
1801
  ],
1639
- [u, d, [l, m]],
1802
+ [u, d, [l, b]],
1640
1803
  [
1641
1804
  /(kobo)\s(ereader|touch)/i,
1642
1805
  // Kobo
@@ -1647,41 +1810,41 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1647
1810
  /(kindle)\/([\w\.]+)/i
1648
1811
  // Kindle
1649
1812
  ],
1650
- [u, d, [l, b]],
1813
+ [u, d, [l, f]],
1651
1814
  [
1652
1815
  /(surface duo)/i
1653
1816
  // Surface Duo
1654
1817
  ],
1655
- [d, [u, Ue], [l, b]],
1818
+ [d, [u, Le], [l, f]],
1656
1819
  [
1657
1820
  /droid [\d\.]+; (fp\du?)(?: b|\))/i
1658
1821
  // Fairphone
1659
1822
  ],
1660
- [d, [u, "Fairphone"], [l, m]],
1823
+ [d, [u, "Fairphone"], [l, b]],
1661
1824
  [
1662
1825
  /(shield[\w ]+) b/i
1663
1826
  // Nvidia Shield Tablets
1664
1827
  ],
1665
- [d, [u, "Nvidia"], [l, b]],
1828
+ [d, [u, "Nvidia"], [l, f]],
1666
1829
  [
1667
1830
  /(sprint) (\w+)/i
1668
1831
  // Sprint Phones
1669
1832
  ],
1670
- [u, d, [l, m]],
1833
+ [u, d, [l, b]],
1671
1834
  [
1672
1835
  /(kin\.[onetw]{3})/i
1673
1836
  // Microsoft Kin
1674
1837
  ],
1675
- [[d, /\./g, " "], [u, Ue], [l, m]],
1838
+ [[d, /\./g, " "], [u, Le], [l, b]],
1676
1839
  [
1677
1840
  /droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
1678
1841
  // Zebra
1679
1842
  ],
1680
- [d, [u, $e], [l, b]],
1843
+ [d, [u, je], [l, f]],
1681
1844
  [
1682
1845
  /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
1683
1846
  ],
1684
- [d, [u, $e], [l, m]],
1847
+ [d, [u, je], [l, b]],
1685
1848
  [
1686
1849
  ///////////////////
1687
1850
  // SMARTTVS
@@ -1693,27 +1856,27 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1693
1856
  [
1694
1857
  /hbbtv.+maple;(\d+)/i
1695
1858
  ],
1696
- [[d, /^/, "SmartTV"], [u, Te], [l, I]],
1859
+ [[d, /^/, "SmartTV"], [u, Ae], [l, I]],
1697
1860
  [
1698
1861
  /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
1699
1862
  // LG SmartTV
1700
1863
  ],
1701
- [[u, qe], [l, I]],
1864
+ [[u, We], [l, I]],
1702
1865
  [
1703
1866
  /(apple) ?tv/i
1704
1867
  // Apple TV
1705
1868
  ],
1706
- [u, [d, pe + " TV"], [l, I]],
1869
+ [u, [d, he + " TV"], [l, I]],
1707
1870
  [
1708
1871
  /crkey/i
1709
1872
  // Google Chromecast
1710
1873
  ],
1711
- [[d, Re + "cast"], [u, Ie], [l, I]],
1874
+ [[d, xe + "cast"], [u, Te], [l, I]],
1712
1875
  [
1713
1876
  /droid.+aft(\w+)( bui|\))/i
1714
1877
  // Fire TV
1715
1878
  ],
1716
- [d, [u, Ce], [l, I]],
1879
+ [d, [u, Ie], [l, I]],
1717
1880
  [
1718
1881
  /\(dtv[\);].+(aquos)/i,
1719
1882
  /(aquos-tv[\w ]+)\)/i
@@ -1724,12 +1887,12 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1724
1887
  /(bravia[\w ]+)( bui|\))/i
1725
1888
  // Sony
1726
1889
  ],
1727
- [d, [u, Ae], [l, I]],
1890
+ [d, [u, Pe], [l, I]],
1728
1891
  [
1729
1892
  /(mitv-\w{5}) bui/i
1730
1893
  // Xiaomi
1731
1894
  ],
1732
- [d, [u, We], [l, I]],
1895
+ [d, [u, $e], [l, I]],
1733
1896
  [
1734
1897
  /Hbbtv.*(technisat) (.*);/i
1735
1898
  // TechniSAT
@@ -1741,7 +1904,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1741
1904
  /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
1742
1905
  // HbbTV devices
1743
1906
  ],
1744
- [[u, be], [d, be], [l, I]],
1907
+ [[u, fe], [d, fe], [l, I]],
1745
1908
  [
1746
1909
  /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
1747
1910
  // SmartTV from Unidentified Vendors
@@ -1766,12 +1929,12 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1766
1929
  /(playstation \w+)/i
1767
1930
  // Playstation
1768
1931
  ],
1769
- [d, [u, Ae], [l, K]],
1932
+ [d, [u, Pe], [l, K]],
1770
1933
  [
1771
1934
  /\b(xbox(?: one)?(?!; xbox))[\); ]/i
1772
1935
  // Microsoft Xbox
1773
1936
  ],
1774
- [d, [u, Ue], [l, K]],
1937
+ [d, [u, Le], [l, K]],
1775
1938
  [
1776
1939
  ///////////////////
1777
1940
  // WEARABLES
@@ -1784,16 +1947,16 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1784
1947
  /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
1785
1948
  // Apple Watch
1786
1949
  ],
1787
- [d, [u, pe], [l, X]],
1950
+ [d, [u, he], [l, X]],
1788
1951
  [
1789
1952
  /droid.+; (glass) \d/i
1790
1953
  // Google Glass
1791
1954
  ],
1792
- [d, [u, Ie], [l, X]],
1955
+ [d, [u, Te], [l, X]],
1793
1956
  [
1794
1957
  /droid.+; (wt63?0{2,3})\)/i
1795
1958
  ],
1796
- [d, [u, $e], [l, X]],
1959
+ [d, [u, je], [l, X]],
1797
1960
  [
1798
1961
  /(quest( 2| pro)?)/i
1799
1962
  // Oculus Quest
@@ -1806,12 +1969,12 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1806
1969
  /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
1807
1970
  // Tesla
1808
1971
  ],
1809
- [u, [l, Ye]],
1972
+ [u, [l, Ze]],
1810
1973
  [
1811
1974
  /(aeobc)\b/i
1812
1975
  // Echo Dot
1813
1976
  ],
1814
- [d, [u, Ce], [l, Ye]],
1977
+ [d, [u, Ie], [l, Ze]],
1815
1978
  [
1816
1979
  ////////////////////
1817
1980
  // MIXED (GENERIC)
@@ -1819,22 +1982,22 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1819
1982
  /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
1820
1983
  // Android Phones from Unidentified Vendors
1821
1984
  ],
1822
- [d, [l, m]],
1985
+ [d, [l, b]],
1823
1986
  [
1824
1987
  /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
1825
1988
  // Android Tablets from Unidentified Vendors
1826
1989
  ],
1827
- [d, [l, b]],
1990
+ [d, [l, f]],
1828
1991
  [
1829
1992
  /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
1830
1993
  // Unidentifiable Tablet
1831
1994
  ],
1832
- [[l, b]],
1995
+ [[l, f]],
1833
1996
  [
1834
1997
  /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
1835
1998
  // Unidentifiable Mobile
1836
1999
  ],
1837
- [[l, m]],
2000
+ [[l, b]],
1838
2001
  [
1839
2002
  /(android[-\w\. ]{0,9});.+buil/i
1840
2003
  // Generic Android Device
@@ -1883,14 +2046,14 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1883
2046
  /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
1884
2047
  // Windows Phone
1885
2048
  ],
1886
- [o, [r, Oe, vt]],
2049
+ [o, [r, Be, kt]],
1887
2050
  [
1888
2051
  /windows nt 6\.2; (arm)/i,
1889
2052
  // Windows RT
1890
2053
  /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
1891
2054
  /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
1892
2055
  ],
1893
- [[r, Oe, vt], [o, et]],
2056
+ [[r, Be, kt], [o, tt]],
1894
2057
  [
1895
2058
  // iOS/macOS
1896
2059
  /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
@@ -1926,7 +2089,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1926
2089
  /\(bb(10);/i
1927
2090
  // BlackBerry 10
1928
2091
  ],
1929
- [r, [o, ht]],
2092
+ [r, [o, gt]],
1930
2093
  [
1931
2094
  /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
1932
2095
  // Symbian
@@ -1953,7 +2116,7 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
1953
2116
  /crkey\/([\d\.]+)/i
1954
2117
  // Google Chromecast
1955
2118
  ],
1956
- [r, [o, Re + "cast"]],
2119
+ [r, [o, xe + "cast"]],
1957
2120
  [
1958
2121
  /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
1959
2122
  // Chromium OS
@@ -2008,253 +2171,253 @@ var ai = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
2008
2171
  ],
2009
2172
  [o, r]
2010
2173
  ]
2011
- }, Pe = function() {
2174
+ }, Ue = function() {
2012
2175
  var i = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} };
2013
2176
  return _.call(i.init, [
2014
- [T, [o, r, fe]],
2015
- [O, [M]],
2016
- [P, [l, d, u]],
2017
- [L, [o, r]],
2018
- [R, [o, r]]
2177
+ [T, [o, r, me]],
2178
+ [B, [S]],
2179
+ [U, [l, d, u]],
2180
+ [F, [o, r]],
2181
+ [P, [o, r]]
2019
2182
  ]), _.call(i.isIgnore, [
2020
- [T, [r, fe]],
2021
- [L, [r]],
2022
- [R, [r]]
2183
+ [T, [r, me]],
2184
+ [F, [r]],
2185
+ [P, [r]]
2023
2186
  ]), _.call(i.isIgnoreRgx, [
2024
2187
  [T, / ?browser$/i],
2025
- [R, / ?os$/i]
2188
+ [P, / ?os$/i]
2026
2189
  ]), _.call(i.toString, [
2027
2190
  [T, [o, r]],
2028
- [O, [M]],
2029
- [P, [u, d]],
2030
- [L, [o, r]],
2031
- [R, [o, r]]
2191
+ [B, [S]],
2192
+ [U, [u, d]],
2193
+ [F, [o, r]],
2194
+ [P, [o, r]]
2032
2195
  ]), i;
2033
- }(), mi = function(i, t) {
2034
- var e = Pe.init[t], s = Pe.isIgnore[t] || 0, n = Pe.isIgnoreRgx[t] || 0, c = Pe.toString[t] || 0;
2035
- function a() {
2036
- _.call(this, e);
2196
+ }(), fi = function(i, e) {
2197
+ var t = Ue.init[e], n = Ue.isIgnore[e] || 0, a = Ue.isIgnoreRgx[e] || 0, c = Ue.toString[e] || 0;
2198
+ function s() {
2199
+ _.call(this, t);
2037
2200
  }
2038
- return a.prototype.getItem = function() {
2201
+ return s.prototype.getItem = function() {
2039
2202
  return i;
2040
- }, a.prototype.withClientHints = function() {
2041
- return G ? G.getHighEntropyValues(Lt).then(function(h) {
2203
+ }, s.prototype.withClientHints = function() {
2204
+ return N ? N.getHighEntropyValues(Ft).then(function(h) {
2042
2205
  return i.setCH(new _t(h, !1)).parseCH().get();
2043
2206
  }) : i.parseCH().get();
2044
- }, a.prototype.withFeatureCheck = function() {
2207
+ }, s.prototype.withFeatureCheck = function() {
2045
2208
  return i.detectFeature().get();
2046
- }, t != Y && (a.prototype.is = function(h) {
2047
- var p = !1;
2048
- for (var g in this)
2049
- if (this.hasOwnProperty(g) && !tt(s, g) && z(n ? W(n, this[g]) : this[g]) == z(n ? W(n, h) : h)) {
2050
- if (p = !0, h != H)
2209
+ }, e != Y && (s.prototype.is = function(h) {
2210
+ var g = !1;
2211
+ for (var w in this)
2212
+ if (this.hasOwnProperty(w) && !it(n, w) && z(a ? W(a, this[w]) : this[w]) == z(a ? W(a, h) : h)) {
2213
+ if (g = !0, h != V)
2051
2214
  break;
2052
- } else if (h == H && p) {
2053
- p = !p;
2215
+ } else if (h == V && g) {
2216
+ g = !g;
2054
2217
  break;
2055
2218
  }
2056
- return p;
2057
- }, a.prototype.toString = function() {
2058
- var h = re;
2059
- for (var p in c)
2060
- typeof this[c[p]] !== H && (h += (h ? " " : re) + this[c[p]]);
2061
- return h || H;
2062
- }), G || (a.prototype.then = function(h) {
2063
- var p = this, g = function() {
2064
- for (var A in p)
2065
- p.hasOwnProperty(A) && (this[A] = p[A]);
2219
+ return g;
2220
+ }, s.prototype.toString = function() {
2221
+ var h = oe;
2222
+ for (var g in c)
2223
+ typeof this[c[g]] !== V && (h += (h ? " " : oe) + this[c[g]]);
2224
+ return h || V;
2225
+ }), N || (s.prototype.then = function(h) {
2226
+ var g = this, w = function() {
2227
+ for (var A in g)
2228
+ g.hasOwnProperty(A) && (this[A] = g[A]);
2066
2229
  };
2067
- g.prototype = {
2068
- is: a.prototype.is,
2069
- toString: a.prototype.toString
2230
+ w.prototype = {
2231
+ is: s.prototype.is,
2232
+ toString: s.prototype.toString
2070
2233
  };
2071
- var f = new g();
2072
- return h(f), f;
2073
- }), new a();
2234
+ var m = new w();
2235
+ return h(m), m;
2236
+ }), new s();
2074
2237
  };
2075
- function _t(i, t) {
2076
- if (i = i || {}, _.call(this, Lt), t)
2238
+ function _t(i, e) {
2239
+ if (i = i || {}, _.call(this, Ft), e)
2077
2240
  _.call(this, [
2078
- [it, je(i[V])],
2079
- [st, je(i[oi])],
2080
- [m, /\?1/.test(i[li])],
2081
- [d, me(i[ui])],
2082
- [J, me(i[Ot])],
2083
- [nt, me(i[hi])],
2084
- [M, me(i[ri])],
2085
- [q, je(i[di])],
2086
- [De, me(i[ci])]
2241
+ [nt, Qe(i[q])],
2242
+ [at, Qe(i[ci])],
2243
+ [b, /\?1/.test(i[hi])],
2244
+ [d, pe(i[gi])],
2245
+ [J, pe(i[Bt])],
2246
+ [st, pe(i[wi])],
2247
+ [S, pe(i[di])],
2248
+ [G, Qe(i[ui])],
2249
+ [Re, pe(i[li])]
2087
2250
  ]);
2088
2251
  else
2089
- for (var e in i)
2090
- this.hasOwnProperty(e) && typeof i[e] !== H && (this[e] = i[e]);
2252
+ for (var t in i)
2253
+ this.hasOwnProperty(t) && typeof i[t] !== V && (this[t] = i[t]);
2091
2254
  }
2092
- function Mt(i, t, e, s) {
2093
- return this.get = function(n) {
2094
- return n ? this.data.hasOwnProperty(n) ? this.data[n] : void 0 : this.data;
2095
- }, this.set = function(n, c) {
2096
- return this.data[n] = c, this;
2097
- }, this.setCH = function(n) {
2098
- return this.uaCH = n, this;
2255
+ function Ct(i, e, t, n) {
2256
+ return this.get = function(a) {
2257
+ return a ? this.data.hasOwnProperty(a) ? this.data[a] : void 0 : this.data;
2258
+ }, this.set = function(a, c) {
2259
+ return this.data[a] = c, this;
2260
+ }, this.setCH = function(a) {
2261
+ return this.uaCH = a, this;
2099
2262
  }, this.detectFeature = function() {
2100
2263
  if (C && C.userAgent == this.ua)
2101
2264
  switch (this.itemType) {
2102
2265
  case T:
2103
- C.brave && typeof C.brave.isBrave == Ke && this.set(o, "Brave");
2266
+ C.brave && typeof C.brave.isBrave == Je && this.set(o, "Brave");
2104
2267
  break;
2105
- case P:
2106
- !this.get(l) && G && G[m] && this.set(l, m), this.get(d) == "Macintosh" && C && typeof C.standalone !== H && C.maxTouchPoints && C.maxTouchPoints > 2 && this.set(d, "iPad").set(l, b);
2268
+ case U:
2269
+ !this.get(l) && N && N[b] && this.set(l, b), this.get(d) == "Macintosh" && C && typeof C.standalone !== V && C.maxTouchPoints && C.maxTouchPoints > 2 && this.set(d, "iPad").set(l, f);
2107
2270
  break;
2108
- case R:
2109
- !this.get(o) && G && G[J] && this.set(o, G[J]);
2271
+ case P:
2272
+ !this.get(o) && N && N[J] && this.set(o, N[J]);
2110
2273
  break;
2111
2274
  case Y:
2112
- var n = this.data, c = function(a) {
2113
- return n[a].getItem().detectFeature().get();
2275
+ var a = this.data, c = function(s) {
2276
+ return a[s].getItem().detectFeature().get();
2114
2277
  };
2115
- this.set(T, c(T)).set(O, c(O)).set(P, c(P)).set(L, c(L)).set(R, c(R));
2278
+ this.set(T, c(T)).set(B, c(B)).set(U, c(U)).set(F, c(F)).set(P, c(P));
2116
2279
  }
2117
2280
  return this;
2118
2281
  }, this.parseUA = function() {
2119
- return this.itemType != Y && Et.call(this.data, this.ua, this.rgxMap), this.itemType == T && this.set(fe, Qe(this.get(r))), this;
2282
+ return this.itemType != Y && Et.call(this.data, this.ua, this.rgxMap), this.itemType == T && this.set(me, Xe(this.get(r))), this;
2120
2283
  }, this.parseCH = function() {
2121
- var n = this.uaCH, c = this.rgxMap;
2284
+ var a = this.uaCH, c = this.rgxMap;
2122
2285
  switch (this.itemType) {
2123
2286
  case T:
2124
- var a = n[st] || n[it], h;
2125
- if (a)
2126
- for (var p in a) {
2127
- var g = W(/(Google|Microsoft) /, a[p].brand || a[p]), f = a[p].version;
2128
- !/not.a.brand/i.test(g) && (!h || /chrom/i.test(h) && !/chromi/i.test(g)) && (this.set(o, g).set(r, f).set(fe, Qe(f)), h = g);
2287
+ var s = a[at] || a[nt], h;
2288
+ if (s)
2289
+ for (var g in s) {
2290
+ var w = W(/(Google|Microsoft) /, s[g].brand || s[g]), m = s[g].version;
2291
+ !/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(o, w).set(r, m).set(me, Xe(m)), h = w);
2129
2292
  }
2130
2293
  break;
2131
- case O:
2132
- var A = n[M];
2133
- A && (A && n[De] == "64" && (A += "64"), Et.call(this.data, A + ";", c));
2294
+ case B:
2295
+ var A = a[S];
2296
+ A && (A && a[Re] == "64" && (A += "64"), Et.call(this.data, A + ";", c));
2134
2297
  break;
2135
- case P:
2136
- if (n[m] && this.set(l, m), n[d] && this.set(d, n[d]), n[d] == "Xbox" && this.set(l, K).set(u, Ue), n[q]) {
2137
- var D;
2138
- if (typeof n[q] != "string")
2139
- for (var B = 0; !D && B < n[q].length; )
2140
- D = Oe(n[q][B++], kt);
2298
+ case U:
2299
+ if (a[b] && this.set(l, b), a[d] && this.set(d, a[d]), a[d] == "Xbox" && this.set(l, K).set(u, Le), a[G]) {
2300
+ var R;
2301
+ if (typeof a[G] != "string")
2302
+ for (var de = 0; !R && de < a[G].length; )
2303
+ R = Be(a[G][de++], Mt);
2141
2304
  else
2142
- D = Oe(n[q], kt);
2143
- this.set(l, D);
2305
+ R = Be(a[G], Mt);
2306
+ this.set(l, R);
2144
2307
  }
2145
2308
  break;
2146
- case R:
2147
- var le = n[J];
2309
+ case P:
2310
+ var le = a[J];
2148
2311
  if (le) {
2149
- var U = n[nt];
2150
- le == et && (U = parseInt(Qe(U), 10) >= 13 ? "11" : "10"), this.set(o, le).set(r, U);
2312
+ var L = a[st];
2313
+ le == tt && (L = parseInt(Xe(L), 10) >= 13 ? "11" : "10"), this.set(o, le).set(r, L);
2151
2314
  }
2152
- this.get(o) == et && n[d] == "Xbox" && this.set(o, "Xbox").set(r, void 0);
2315
+ this.get(o) == tt && a[d] == "Xbox" && this.set(o, "Xbox").set(r, void 0);
2153
2316
  break;
2154
2317
  case Y:
2155
- var Dt = this.data, ue = function(Bt) {
2156
- return Dt[Bt].getItem().setCH(n).parseCH().get();
2318
+ var Se = this.data, x = function(Rt) {
2319
+ return Se[Rt].getItem().setCH(a).parseCH().get();
2157
2320
  };
2158
- this.set(T, ue(T)).set(O, ue(O)).set(P, ue(P)).set(L, ue(L)).set(R, ue(R));
2321
+ this.set(T, x(T)).set(B, x(B)).set(U, x(U)).set(F, x(F)).set(P, x(P));
2159
2322
  }
2160
2323
  return this;
2161
2324
  }, _.call(this, [
2162
2325
  ["itemType", i],
2163
- ["ua", t],
2164
- ["uaCH", s],
2165
- ["rgxMap", e],
2166
- ["data", mi(this, i)]
2326
+ ["ua", e],
2327
+ ["uaCH", n],
2328
+ ["rgxMap", t],
2329
+ ["data", fi(this, i)]
2167
2330
  ]), this;
2168
2331
  }
2169
- function F(i, t, e) {
2170
- if (typeof i === ce ? (yt(i) ? (typeof t === ce && (e = t), t = i) : (e = i, t = void 0), i = void 0) : typeof i === Je && !yt(t) && (e = t, t = void 0), !(this instanceof F))
2171
- return new F(i, t, e).getResult();
2172
- var s = typeof i === Je ? i : (
2332
+ function D(i, e, t) {
2333
+ if (typeof i === re ? (vt(i) ? (typeof e === re && (t = e), e = i) : (t = i, e = void 0), i = void 0) : typeof i === Ye && !vt(e) && (t = e, e = void 0), !(this instanceof D))
2334
+ return new D(i, e, t).getResult();
2335
+ var n = typeof i === Ye ? i : (
2173
2336
  // Passed user-agent string
2174
2337
  C && C.userAgent ? C.userAgent : (
2175
2338
  // navigator.userAgent
2176
- e && e[lt] ? e[lt] : (
2339
+ t && t[ut] ? t[ut] : (
2177
2340
  // User-Agent from passed headers
2178
- re
2341
+ oe
2179
2342
  )
2180
2343
  )
2181
- ), n = new _t(e, !0), c = t ? wi(St, t) : St, a = function(h) {
2344
+ ), a = new _t(t, !0), c = e ? mi(St, e) : St, s = function(h) {
2182
2345
  return h == Y ? function() {
2183
- return new Mt(h, s, c, n).set("ua", s).set(T, this.getBrowser()).set(O, this.getCPU()).set(P, this.getDevice()).set(L, this.getEngine()).set(R, this.getOS()).get();
2346
+ return new Ct(h, n, c, a).set("ua", n).set(T, this.getBrowser()).set(B, this.getCPU()).set(U, this.getDevice()).set(F, this.getEngine()).set(P, this.getOS()).get();
2184
2347
  } : function() {
2185
- return new Mt(h, s, c[h], n).parseUA().get();
2348
+ return new Ct(h, n, c[h], a).parseUA().get();
2186
2349
  };
2187
2350
  };
2188
2351
  return _.call(this, [
2189
- ["getBrowser", a(T)],
2190
- ["getCPU", a(O)],
2191
- ["getDevice", a(P)],
2192
- ["getEngine", a(L)],
2193
- ["getOS", a(R)],
2194
- ["getResult", a(Y)],
2352
+ ["getBrowser", s(T)],
2353
+ ["getCPU", s(B)],
2354
+ ["getDevice", s(U)],
2355
+ ["getEngine", s(F)],
2356
+ ["getOS", s(P)],
2357
+ ["getResult", s(Y)],
2195
2358
  ["getUA", function() {
2196
- return s;
2359
+ return n;
2197
2360
  }],
2198
2361
  ["setUA", function(h) {
2199
- return de(h) && (s = h.length > Ze ? be(h, Ze) : h), this;
2362
+ return ce(h) && (n = h.length > et ? fe(h, et) : h), this;
2200
2363
  }]
2201
- ]).setUA(s), this;
2364
+ ]).setUA(n), this;
2202
2365
  }
2203
- F.VERSION = ai;
2204
- F.BROWSER = Be([o, r, fe]);
2205
- F.CPU = Be([M]);
2206
- F.DEVICE = Be([d, u, l, K, m, I, b, X, Ye]);
2207
- F.ENGINE = F.OS = Be([o, r]);
2208
- class fi {
2209
- constructor(t, e) {
2210
- w(this, "trackers");
2211
- w(this, "config");
2212
- this.trackers = t, this.config = e;
2213
- }
2214
- on(t, e, s) {
2215
- const n = function(a) {
2216
- a.data.message !== `kalamba:wrapper-telemetry:${t}` && a.data.message !== `kalamba:wrapper:${t}` || e(a.data.payload);
2366
+ D.VERSION = ri;
2367
+ D.BROWSER = Ne([o, r, me]);
2368
+ D.CPU = Ne([S]);
2369
+ D.DEVICE = Ne([d, u, l, K, b, I, f, X, Ze]);
2370
+ D.ENGINE = D.OS = Ne([o, r]);
2371
+ class yi {
2372
+ constructor(e, t) {
2373
+ p(this, "trackers");
2374
+ p(this, "config");
2375
+ this.trackers = e, this.config = t;
2376
+ }
2377
+ on(e, t, n) {
2378
+ const a = function(s) {
2379
+ s.data.message !== `kalamba:wrapper-telemetry:${e}` && s.data.message !== `kalamba:wrapper:${e}` || t(s.data.payload);
2217
2380
  };
2218
- window.addEventListener("message", n, s);
2381
+ window.addEventListener("message", a, n);
2219
2382
  }
2220
- track(t, e) {
2221
- this.trackers.forEach((s) => s.track(t, e));
2383
+ track(e, t) {
2384
+ this.trackers.forEach((n) => n.track(e, t));
2222
2385
  }
2223
2386
  }
2224
- function Ct(i) {
2225
- return i.reduce((t, e) => t + e, 0);
2387
+ function It(i) {
2388
+ return i.reduce((e, t) => e + t, 0);
2226
2389
  }
2227
- function bi(i) {
2228
- const t = i.length, e = Ct(i) / t, s = i.map((c) => Math.pow(c - e, 2)), n = Ct(s) / t;
2229
- return Math.sqrt(n);
2390
+ function vi(i) {
2391
+ const e = i.length, t = It(i) / e, n = i.map((c) => Math.pow(c - t, 2)), a = It(n) / e;
2392
+ return Math.sqrt(a);
2230
2393
  }
2231
- class It {
2394
+ class Tt {
2232
2395
  constructor() {
2233
- w(this, "rafId", -1);
2234
- w(this, "startTime", 0);
2235
- w(this, "stopTime", 0);
2236
- w(this, "frames", []);
2237
- w(this, "calculateFPS", () => {
2238
- const t = Math.floor((this.stopTime - this.startTime) / 1e3);
2239
- return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e, s, n, c) => (c[n] !== c[n - 1] ? e.push(1) : e[e.length - 1]++, e), []).slice(0, t);
2396
+ p(this, "rafId", -1);
2397
+ p(this, "startTime", 0);
2398
+ p(this, "stopTime", 0);
2399
+ p(this, "frames", []);
2400
+ p(this, "calculateFPS", () => {
2401
+ const e = Math.floor((this.stopTime - this.startTime) / 1e3);
2402
+ return this.frames.map((t) => Math.floor((t - this.startTime) / 1e3)).reduce((t, n, a, c) => (c[a] !== c[a - 1] ? t.push(1) : t[t.length - 1]++, t), []).slice(0, e);
2240
2403
  });
2241
- w(this, "getReport", () => {
2242
- const t = this.calculateFPS(), e = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), s = t.length > 0 ? Math.max(...t) : e, n = t.length > 0 ? Math.min(...t) : e, c = t.length > 0 ? bi(t) : 0;
2243
- return { fpsAvg: e, fpsMax: s, fpsMin: n, fpsStdDev: c };
2404
+ p(this, "getReport", () => {
2405
+ const e = this.calculateFPS(), t = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), n = e.length > 0 ? Math.max(...e) : t, a = e.length > 0 ? Math.min(...e) : t, c = e.length > 0 ? vi(e) : 0;
2406
+ return { fpsAvg: t, fpsMax: n, fpsMin: a, fpsStdDev: c };
2244
2407
  });
2245
- w(this, "start", () => {
2246
- this.startTime = Date.now(), this.trackFrames();
2408
+ p(this, "start", () => {
2409
+ this.startTime = Date.now(), this.frames = [], this.trackFrames();
2247
2410
  });
2248
- w(this, "stop", () => {
2411
+ p(this, "stop", () => {
2249
2412
  cancelAnimationFrame(this.rafId), this.stopTime = Date.now();
2250
2413
  });
2251
- w(this, "trackFrames", () => {
2414
+ p(this, "trackFrames", () => {
2252
2415
  this.frames.push(Date.now()), this.rafId = requestAnimationFrame(this.trackFrames);
2253
2416
  });
2254
2417
  }
2255
2418
  }
2256
- const yi = "landscape", Ei = "portrait";
2257
- function vi() {
2419
+ const Ei = "landscape", ki = "portrait";
2420
+ function Mi() {
2258
2421
  try {
2259
2422
  const i = document.createElement("canvas");
2260
2423
  return !!window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
@@ -2262,68 +2425,68 @@ function vi() {
2262
2425
  return !1;
2263
2426
  }
2264
2427
  }
2265
- async function ki() {
2428
+ async function Si() {
2266
2429
  if (!window.createImageBitmap)
2267
2430
  return !1;
2268
- const e = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
2431
+ const t = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
2269
2432
  try {
2270
- return await createImageBitmap(e), !0;
2433
+ return await createImageBitmap(t), !0;
2271
2434
  } catch {
2272
2435
  return !1;
2273
2436
  }
2274
2437
  }
2275
- function Xe() {
2276
- return window.innerWidth >= window.innerHeight ? yi : Ei;
2438
+ function Ke() {
2439
+ return window.innerWidth >= window.innerHeight ? Ei : ki;
2277
2440
  }
2278
- var Le, ee, te, ie, ve, _e, ke, Fe;
2279
- class Bi extends fi {
2280
- constructor(...e) {
2281
- super(...e);
2282
- w(this, "FPS_SAMPLE_INTERVAL", 1e4);
2441
+ var Fe, ee, te, ie, Ee, _e, ke, De;
2442
+ class Hi extends yi {
2443
+ constructor(...t) {
2444
+ super(...t);
2445
+ p(this, "FPS_SAMPLE_INTERVAL", 1e4);
2283
2446
  // wrapper state
2284
- v(this, Le, 0);
2285
- v(this, ee, "");
2286
- v(this, te, void 0);
2287
- v(this, ie, void 0);
2288
- v(this, ve, !1);
2289
- v(this, _e, !1);
2290
- v(this, ke, "");
2291
- v(this, Fe, []);
2292
- E(this, te, {}), E(this, ie, this.deviceInfo()), this.on("state", ({ balance: s, version: n }) => {
2293
- E(this, ee, n), E(this, Le, s);
2294
- }), this.on("autoplay", ({ action: s }) => {
2295
- ["start", "resume"].includes(s) ? E(this, ve, !0) : E(this, ve, !1);
2296
- }), this.on("settings", ({ fastPlay: s }) => {
2297
- s !== void 0 && E(this, _e, s);
2447
+ E(this, Fe, 0);
2448
+ E(this, ee, "");
2449
+ E(this, te, void 0);
2450
+ E(this, ie, void 0);
2451
+ E(this, Ee, !1);
2452
+ E(this, _e, !1);
2453
+ E(this, ke, "");
2454
+ E(this, De, []);
2455
+ v(this, te, {}), v(this, ie, this.deviceInfo()), this.on("state", ({ balance: n, version: a }) => {
2456
+ v(this, ee, a), v(this, Fe, n);
2457
+ }), this.on("autoplay", ({ action: n }) => {
2458
+ ["start", "resume"].includes(n) ? v(this, Ee, !0) : v(this, Ee, !1);
2459
+ }), this.on("settings", ({ fastPlay: n }) => {
2460
+ n !== void 0 && v(this, _e, n);
2298
2461
  }), this.registerEvents();
2299
2462
  }
2300
2463
  async registerEvents() {
2301
- y(this, ie).then((e) => {
2302
- this.track("Device Information", e);
2464
+ y(this, ie).then((t) => {
2465
+ this.track("Device Information", t);
2303
2466
  }), this.on("loadStart", () => {
2304
2467
  this.track("Game Loading", { progress: 0, step: "initial" });
2305
- }), this.on("loadProgress", (e) => {
2306
- this.track("Game Loading", { progress: e.progress });
2468
+ }), this.on("loadProgress", (t) => {
2469
+ this.track("Game Loading", { progress: t.progress });
2307
2470
  }), this.on("loadEnd", () => {
2308
2471
  this.track("Game Loading", { progress: 100, step: "complete" });
2309
- }), this.on("error", (e) => {
2472
+ }), this.on("error", (t) => {
2310
2473
  this.track("System Message", {
2311
- systemMessageText: e.messageKey,
2312
- systemMessageType: e.type
2474
+ systemMessageText: t.messageKey,
2475
+ systemMessageType: t.type
2313
2476
  });
2314
- }), this.on("openGameResponse", async (e) => {
2315
- E(this, ke, e.data.gameState.stateTypeNextRound), E(this, te, {
2316
- balanceInCoins: e.balance,
2477
+ }), this.on("openGameResponse", async (t) => {
2478
+ v(this, ke, t.contract.stateType.nextRound), v(this, te, {
2479
+ balanceInCoins: t.contract.balance.coins,
2317
2480
  clientVersion: y(this, ee),
2318
2481
  coinValueInCents: this.config.api.coinValueInCents,
2319
2482
  coinValueInCentsFloat: this.config.api.coinValueInCents,
2320
2483
  currency: this.config.api.currency,
2321
- defaultBaseBet: e.data.additionalConfigData.defaultBet.baseBet,
2322
- defaultBetMultiplier: e.data.additionalConfigData.defaultBet.betMultiplier,
2484
+ defaultBaseBet: t.contract.bet.default.base,
2485
+ defaultBetMultiplier: t.contract.bet.default.multiplier,
2323
2486
  environment: "release",
2324
2487
  gameCode: this.config.api.game,
2325
2488
  gameCodeServer: this.config.api.game,
2326
- gameModelFile: e.data.additionalConfigData.gameModelFile,
2489
+ gameModelFile: t.contract.gameModel,
2327
2490
  jurisdiction: this.config.api.jurisdiction,
2328
2491
  languageCode: this.config.ui.language,
2329
2492
  operatorName: "kalamba",
@@ -2334,15 +2497,15 @@ class Bi extends fi {
2334
2497
  referrer: window.location.hostname,
2335
2498
  // rootTrackingSessionID: 'unknown',
2336
2499
  // rtpVariant: 'unknown',
2337
- serverVersion: e.data.gameConfigData.metaData.version
2500
+ serverVersion: t.contract.metaData.version
2338
2501
  // testVariants: '',
2339
2502
  }), this.track("Game Open", y(this, te));
2340
- }), this.on("playCycleEnd", async (e) => {
2341
- const s = await y(this, ie), { baseBet: n, betMultiplier: c, specialAction: a } = e.data.gameState.lastPlacedMainGameBet ?? {}, h = e.balance, p = e.data.gameState.totalBetFromCurrentGameCycle, g = e.data.gameState.totalWinFromCurrentGameCycle, f = g - p, A = a || "spin", D = e.data.gameState.cycleId;
2503
+ }), this.on("playCycleEnd", async (t) => {
2504
+ const n = await y(this, ie), { base: a, multiplier: c, specialAction: s } = t.contract.bet.lastPaid ?? {}, h = t.contract.balance.coins, g = t.contract.bet.lastPaid.base * t.contract.bet.lastPaid.multiplier, w = t.contract.win.total, m = w - g, A = s || "spin", R = t.contract.roundId;
2342
2505
  this.track("Betting Activity", {
2343
- balance: h - f,
2506
+ balance: h - m,
2344
2507
  balanceAfter: h,
2345
- baseBet: n,
2508
+ baseBet: a,
2346
2509
  // baseBetIndex,
2347
2510
  betMultiplier: c,
2348
2511
  betType: A,
@@ -2353,26 +2516,26 @@ class Bi extends fi {
2353
2516
  environment: "release",
2354
2517
  gameCode: this.config.api.game,
2355
2518
  gameCodeServer: this.config.api.game,
2356
- isMobile: s.isMobile,
2357
- netResult: f,
2519
+ isMobile: n.isMobile,
2520
+ netResult: m,
2358
2521
  operatorName: "kalamba",
2359
- orientation: Xe(),
2522
+ orientation: Ke(),
2360
2523
  partnerId: this.config.api.brand,
2361
2524
  partnerParentId: this.config.api.integration,
2362
2525
  platform: "WEB",
2363
2526
  playMode: this.config.api.playMode,
2364
- roundId: D,
2527
+ roundId: R,
2365
2528
  // TODO: uncomment when tracking TrackingEvent.GameSpin is implemented
2366
2529
  // roundTypes: [...this.#roundTypes],
2367
2530
  roundTypes: ["BaseGame"],
2368
- totalBet: p,
2369
- totalWin: g
2370
- }), E(this, Fe, []);
2371
- }), this.on("telemetry.click", (e) => {
2531
+ totalBet: g,
2532
+ totalWin: w
2533
+ }), v(this, De, []);
2534
+ }), this.on("telemetry.click", (t) => {
2372
2535
  this.track("UI Interaction", {
2373
2536
  action: "click",
2374
2537
  ...this.getExtraUiInteractionData(),
2375
- ...e
2538
+ ...t
2376
2539
  });
2377
2540
  }), this.on("telemetry.orientationChange", () => {
2378
2541
  this.track("UI Interaction", {
@@ -2382,47 +2545,47 @@ class Bi extends fi {
2382
2545
  }), this.reportFpsSample(), this.reportFpsRound();
2383
2546
  }
2384
2547
  reportFpsSample() {
2385
- const e = new It(), s = () => {
2386
- e.stop();
2387
- const c = e.getReport();
2388
- this.track("FPS Performance", { ...c, fpsType: "sample" }), n();
2389
- }, n = async () => {
2390
- e.start(), setTimeout(s, this.FPS_SAMPLE_INTERVAL);
2548
+ const t = new Tt(), n = () => {
2549
+ t.stop();
2550
+ const c = t.getReport();
2551
+ this.track("FPS Performance", { ...c, fpsType: "sample" }), a();
2552
+ }, a = async () => {
2553
+ t.start(), setTimeout(n, this.FPS_SAMPLE_INTERVAL);
2391
2554
  };
2392
- n();
2555
+ a();
2393
2556
  }
2394
2557
  reportFpsRound() {
2395
- const e = new It();
2558
+ const t = new Tt();
2396
2559
  this.on("playCycleStart", () => {
2397
- e.start();
2560
+ t.start();
2398
2561
  }), this.on("playCycleEnd", () => {
2399
- e.stop();
2400
- const s = e.getReport();
2401
- this.track("FPS Performance", { ...s, fpsType: "playCycleStart->playCycleEnd" });
2562
+ t.stop();
2563
+ const n = t.getReport();
2564
+ this.track("FPS Performance", { ...n, fpsType: "playCycleStart->playCycleEnd" });
2402
2565
  });
2403
2566
  }
2404
2567
  getExtraUiInteractionData() {
2405
2568
  return {
2406
- orientation: Xe(),
2569
+ orientation: Ke(),
2407
2570
  stateType: y(this, ke)
2408
2571
  };
2409
2572
  }
2410
2573
  async deviceInfo() {
2411
- var p;
2412
- const e = new F(navigator.userAgent), s = vi(), n = await ki(), c = e.getBrowser(), a = e.getDevice(), h = e.getOS();
2574
+ var g;
2575
+ const t = new D(navigator.userAgent), n = Mi(), a = await Si(), c = t.getBrowser(), s = t.getDevice(), h = t.getOS();
2413
2576
  return {
2414
2577
  browserName: c.name,
2415
2578
  browserVersion: c.version,
2416
- connection: (p = navigator.connection) == null ? void 0 : p.effectiveType,
2417
- deviceName: a.model,
2418
- deviceType: a.type,
2419
- isMobile: ["mobile", "tablet"].includes(a.type ?? ""),
2420
- isWebGLSupported: s,
2421
- isWebPSupported: n,
2422
- manufacturer: a.vendor,
2579
+ connection: (g = navigator.connection) == null ? void 0 : g.effectiveType,
2580
+ deviceName: s.model,
2581
+ deviceType: s.type,
2582
+ isMobile: ["mobile", "tablet"].includes(s.type ?? ""),
2583
+ isWebGLSupported: n,
2584
+ isWebPSupported: a,
2585
+ manufacturer: s.vendor,
2423
2586
  operatingSystem: h.name,
2424
2587
  operatingSystemVersion: h.version,
2425
- orientation: Xe(),
2588
+ orientation: Ke(),
2426
2589
  pixelRatio: window.devicePixelRatio,
2427
2590
  screenHeight: window.screen.height,
2428
2591
  screenSize: `${window.screen.width}x${window.screen.height}`,
@@ -2434,123 +2597,123 @@ class Bi extends fi {
2434
2597
  };
2435
2598
  }
2436
2599
  }
2437
- Le = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), ie = new WeakMap(), ve = new WeakMap(), _e = new WeakMap(), ke = new WeakMap(), Fe = new WeakMap();
2438
- let xe;
2439
- const Si = new Uint8Array(16);
2440
- function Mi() {
2441
- if (!xe && (xe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !xe))
2600
+ Fe = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), ie = new WeakMap(), Ee = new WeakMap(), _e = new WeakMap(), ke = new WeakMap(), De = new WeakMap();
2601
+ let Oe;
2602
+ const Ci = new Uint8Array(16);
2603
+ function Ii() {
2604
+ if (!Oe && (Oe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Oe))
2442
2605
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2443
- return xe(Si);
2606
+ return Oe(Ci);
2444
2607
  }
2445
- const S = [];
2608
+ const M = [];
2446
2609
  for (let i = 0; i < 256; ++i)
2447
- S.push((i + 256).toString(16).slice(1));
2448
- function Ci(i, t = 0) {
2449
- return S[i[t + 0]] + S[i[t + 1]] + S[i[t + 2]] + S[i[t + 3]] + "-" + S[i[t + 4]] + S[i[t + 5]] + "-" + S[i[t + 6]] + S[i[t + 7]] + "-" + S[i[t + 8]] + S[i[t + 9]] + "-" + S[i[t + 10]] + S[i[t + 11]] + S[i[t + 12]] + S[i[t + 13]] + S[i[t + 14]] + S[i[t + 15]];
2610
+ M.push((i + 256).toString(16).slice(1));
2611
+ function Ti(i, e = 0) {
2612
+ return M[i[e + 0]] + M[i[e + 1]] + M[i[e + 2]] + M[i[e + 3]] + "-" + M[i[e + 4]] + M[i[e + 5]] + "-" + M[i[e + 6]] + M[i[e + 7]] + "-" + M[i[e + 8]] + M[i[e + 9]] + "-" + M[i[e + 10]] + M[i[e + 11]] + M[i[e + 12]] + M[i[e + 13]] + M[i[e + 14]] + M[i[e + 15]];
2450
2613
  }
2451
- const Ii = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Tt = {
2452
- randomUUID: Ii
2614
+ const Ai = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), At = {
2615
+ randomUUID: Ai
2453
2616
  };
2454
- function At(i, t, e) {
2455
- if (Tt.randomUUID && !t && !i)
2456
- return Tt.randomUUID();
2617
+ function Pt(i, e, t) {
2618
+ if (At.randomUUID && !e && !i)
2619
+ return At.randomUUID();
2457
2620
  i = i || {};
2458
- const s = i.random || (i.rng || Mi)();
2459
- if (s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, t) {
2460
- e = e || 0;
2461
- for (let n = 0; n < 16; ++n)
2462
- t[e + n] = s[n];
2463
- return t;
2464
- }
2465
- return Ci(s);
2621
+ const n = i.random || (i.rng || Ii)();
2622
+ if (n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, e) {
2623
+ t = t || 0;
2624
+ for (let a = 0; a < 16; ++a)
2625
+ e[t + a] = n[a];
2626
+ return e;
2627
+ }
2628
+ return Ti(n);
2466
2629
  }
2467
- class Ft {
2468
- constructor(t) {
2469
- w(this, "config");
2470
- this.config = t;
2630
+ class Dt {
2631
+ constructor(e) {
2632
+ p(this, "config");
2633
+ this.config = e;
2471
2634
  }
2472
2635
  }
2473
- const Rt = 25, Pt = 1e4;
2474
- var se, ne, ae, N, Se;
2475
- class Gi extends Ft {
2476
- constructor(...e) {
2477
- super(...e);
2478
- v(this, se, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
2479
- v(this, ne, void 0);
2480
- v(this, ae, void 0);
2481
- v(this, N, []);
2482
- v(this, Se, void 0);
2483
- w(this, "processQueueForced");
2484
- E(this, ne, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), E(this, N, []), E(this, Se, At()), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(y(this, se), {
2636
+ const xt = 25, Ut = 1e4;
2637
+ var ne, ae, se, H, Me;
2638
+ class Vi extends Dt {
2639
+ constructor(...t) {
2640
+ super(...t);
2641
+ E(this, ne, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
2642
+ E(this, ae, void 0);
2643
+ E(this, se, void 0);
2644
+ E(this, H, []);
2645
+ E(this, Me, void 0);
2646
+ p(this, "processQueueForced");
2647
+ v(this, ae, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), v(this, H, []), v(this, Me, Pt()), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(y(this, ne), {
2485
2648
  method: "OPTIONS"
2486
- }).catch(ot), this.subscribe();
2649
+ }).catch(rt), this.subscribe();
2487
2650
  }
2488
2651
  subscribe() {
2489
2652
  window.addEventListener("beforeunload", this.processQueueForced, !1), window.addEventListener("pagehide", this.processQueueForced, !1), window.addEventListener("visibilitychange", this.processQueueForced, !1);
2490
2653
  }
2491
2654
  schedule() {
2492
- y(this, ae) && clearTimeout(y(this, ae)), E(this, ae, window.setTimeout(() => this.processQueue(), Pt));
2655
+ y(this, se) && clearTimeout(y(this, se)), v(this, se, window.setTimeout(() => this.processQueue(), Ut));
2493
2656
  }
2494
- send(e) {
2495
- E(this, ne, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime());
2657
+ send(t) {
2658
+ v(this, ae, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime());
2496
2659
  try {
2497
- navigator.sendBeacon(y(this, se), JSON.stringify(e));
2660
+ navigator.sendBeacon(y(this, ne), JSON.stringify(t));
2498
2661
  } catch {
2499
- fetch(y(this, se), {
2500
- body: JSON.stringify(e),
2662
+ fetch(y(this, ne), {
2663
+ body: JSON.stringify(t),
2501
2664
  method: "POST",
2502
2665
  headers: {
2503
2666
  "Content-Type": "application/json"
2504
2667
  },
2505
2668
  keepalive: !0
2506
- }).catch(ot);
2669
+ }).catch(rt);
2507
2670
  }
2508
2671
  this.schedule();
2509
2672
  }
2510
- addToQueue(e) {
2511
- y(this, N).push(e), this.processQueue();
2673
+ addToQueue(t) {
2674
+ y(this, H).push(t), this.processQueue();
2512
2675
  }
2513
- processQueue(e = !1) {
2514
- if (!(this.config == null || !this.config.ui.feature.allowTelemetry) && !(!e && y(this, N).length < Rt && /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime() - y(this, ne) < Pt))
2515
- for (; y(this, N).length; ) {
2516
- const s = y(this, N).splice(0, Rt).map((n) => ({
2517
- ...n,
2518
- sessionID: y(this, Se),
2676
+ processQueue(t = !1) {
2677
+ if (!(this.config == null || !this.config.ui.feature.allowTelemetry) && !(!t && y(this, H).length < xt && /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime() - y(this, ae) < Ut))
2678
+ for (; y(this, H).length; ) {
2679
+ const n = y(this, H).splice(0, xt).map((a) => ({
2680
+ ...a,
2681
+ sessionID: y(this, Me),
2519
2682
  userID: this.config.api.user
2520
2683
  }));
2521
- this.send(s);
2684
+ this.send(n);
2522
2685
  }
2523
2686
  }
2524
- track(e, s) {
2687
+ track(t, n) {
2525
2688
  this.addToQueue({
2526
- eventName: e,
2527
- eventParams: s,
2689
+ eventName: t,
2690
+ eventParams: n,
2528
2691
  eventTimestamp: /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime(),
2529
- eventUUID: At()
2692
+ eventUUID: Pt()
2530
2693
  });
2531
2694
  }
2532
2695
  }
2533
- se = new WeakMap(), ne = new WeakMap(), ae = new WeakMap(), N = new WeakMap(), Se = new WeakMap();
2534
- const Ti = x("LoggingTracker", "color:#000000;font-weight:bold;");
2535
- class Ni extends Ft {
2536
- track(t, e) {
2537
- Ti(`@${this.config.api.user}`, `[${t}]`, e);
2696
+ ne = new WeakMap(), ae = new WeakMap(), se = new WeakMap(), H = new WeakMap(), Me = new WeakMap();
2697
+ const Pi = O("LoggingTracker", "color:#000000;font-weight:bold;");
2698
+ class zi extends Dt {
2699
+ track(e, t) {
2700
+ Pi(`@${this.config.api.user}`, `[${e}]`, t);
2538
2701
  }
2539
2702
  }
2540
2703
  export {
2541
- Pi as BasicPlugin,
2704
+ Oi as BasicPlugin,
2542
2705
  $ as CasinoPlugin,
2543
- xi as DebuggingPlugin,
2544
- Ui as GigPlugin,
2545
- Di as KalambaBullseyePlugin,
2546
- Bi as KalambaStargazerPlugin,
2547
- Gi as KalambaStargazerTracker,
2548
- Ni as LoggingTracker,
2549
- Oi as OryxPlugin,
2550
- Li as PariplayPlugin,
2551
- _i as RelaxFEIMPlugin,
2552
- ii as RgsPlygin,
2553
- fi as TelemetryPlugin,
2554
- Ft as Tracker,
2555
- Fi as TukoPlugin
2706
+ Li as DebuggingPlugin,
2707
+ Bi as GigPlugin,
2708
+ Ni as KalambaBullseyePlugin,
2709
+ Hi as KalambaStargazerPlugin,
2710
+ Vi as KalambaStargazerTracker,
2711
+ zi as LoggingTracker,
2712
+ Fi as OryxPlugin,
2713
+ _i as PariplayPlugin,
2714
+ Di as RelaxFEIMPlugin,
2715
+ Qt as RgsPlygin,
2716
+ yi as TelemetryPlugin,
2717
+ Dt as Tracker,
2718
+ Ri as TukoPlugin
2556
2719
  };