@kalamba/sdk 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -0
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +157 -5
- package/dist/plugins.js +1339 -1289
- package/dist/wrapper.cjs +1 -1
- package/dist/wrapper.d.ts +3 -0
- package/dist/wrapper.js +2 -1
- package/package.json +3 -3
package/dist/plugins.js
CHANGED
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
if (!t.has(
|
|
5
|
+
var Xt = Object.defineProperty;
|
|
6
|
+
var Kt = (s, t, e) => t in s ? Xt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
7
|
+
var g = (s, t, e) => (Kt(s, typeof t != "symbol" ? t + "" : t, e), e), dt = (s, t, e) => {
|
|
8
|
+
if (!t.has(s))
|
|
9
9
|
throw TypeError("Cannot " + e);
|
|
10
10
|
};
|
|
11
|
-
var y = (
|
|
12
|
-
if (t.has(
|
|
11
|
+
var y = (s, t, e) => (dt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), M = (s, t, e) => {
|
|
12
|
+
if (t.has(s))
|
|
13
13
|
throw TypeError("Cannot add the same private member more than once");
|
|
14
|
-
t instanceof WeakSet ? t.add(
|
|
15
|
-
}, k = (
|
|
16
|
-
import { a as
|
|
17
|
-
import { a as
|
|
18
|
-
function U(
|
|
19
|
-
return (e, ...
|
|
20
|
-
console.log(`[%c${
|
|
14
|
+
t instanceof WeakSet ? t.add(s) : t.set(s, e);
|
|
15
|
+
}, k = (s, t, e, i) => (dt(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e);
|
|
16
|
+
import { a as Ne } from "./errors-afd9f527.js";
|
|
17
|
+
import { a as lt } from "./noop-3336849b.js";
|
|
18
|
+
function U(s, t) {
|
|
19
|
+
return (e, ...i) => {
|
|
20
|
+
console.log(`[%c${s}\x1B[m] %s`, t, e, ...i);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function Bt(
|
|
24
|
-
return Math.round(
|
|
23
|
+
function Bt(s, t) {
|
|
24
|
+
return Math.round(s * 100 / t);
|
|
25
25
|
}
|
|
26
|
-
class
|
|
26
|
+
class j {
|
|
27
27
|
constructor(t, e) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
g(this, "config");
|
|
29
|
+
g(this, "sdkConfig");
|
|
30
30
|
this.config = t, this.sdkConfig = e;
|
|
31
31
|
}
|
|
32
|
-
on(t, e,
|
|
32
|
+
on(t, e, i) {
|
|
33
33
|
const n = function(a) {
|
|
34
34
|
a.data.message !== `kalamba:wrapper-casino:${t}` && a.data.message !== `kalamba:wrapper:${t}` || e(a.data.payload);
|
|
35
35
|
};
|
|
36
|
-
window.addEventListener("message", n,
|
|
36
|
+
window.addEventListener("message", n, i);
|
|
37
37
|
}
|
|
38
38
|
send(t, ...[e]) {
|
|
39
39
|
window.postMessage({
|
|
@@ -42,22 +42,22 @@ class $ {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
class
|
|
45
|
+
const Qt = U("BasicPlugin", "color:#000000;font-weight:bold;");
|
|
46
|
+
class Fi extends j {
|
|
47
47
|
constructor(...t) {
|
|
48
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
48
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Qt("configured");
|
|
49
49
|
}
|
|
50
50
|
registerToSdkEvents() {
|
|
51
51
|
window.addEventListener("message", (t) => {
|
|
52
52
|
try {
|
|
53
|
-
const { type: e, payload:
|
|
53
|
+
const { type: e, payload: i } = t.data;
|
|
54
54
|
switch (e) {
|
|
55
55
|
case "doAudioSettings":
|
|
56
|
-
this.send("settings", { music:
|
|
56
|
+
this.send("settings", { music: i == null ? void 0 : i.musicEnabled, sounds: i == null ? void 0 : i.soundEnabled });
|
|
57
57
|
return;
|
|
58
58
|
case "doBalanceUpdate":
|
|
59
59
|
const { currency: n, coinValueInCents: o } = this.sdkConfig.api;
|
|
60
|
-
|
|
60
|
+
i.currency === n && typeof i.balanceInCurrency == "number" ? this.send("balance", { balance: Bt(i.balanceInCurrency, o) }) : (i.balanceInCoins, this.send("balance", { balance: i.balanceInCoins }));
|
|
61
61
|
return;
|
|
62
62
|
case "doGamePause":
|
|
63
63
|
this.send("freeze");
|
|
@@ -92,8 +92,8 @@ class _i extends $ {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
class
|
|
95
|
+
const E = U("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), Jt = U("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
|
|
96
|
+
class Ni extends j {
|
|
97
97
|
constructor(...t) {
|
|
98
98
|
super(...t), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
|
|
99
99
|
}
|
|
@@ -114,16 +114,16 @@ class Fi extends $ {
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
registerSdkToDebugEvents() {
|
|
117
|
-
this.on("autoplay", (t) =>
|
|
117
|
+
this.on("autoplay", (t) => E("autoplay", t)), this.on("balance", (t) => E("balance", t)), this.on("bet", (t) => E("bet", t)), this.on("cashier", (t) => E("cashier", t)), this.on("choice", (t) => E("choice", t)), this.on("close", (t) => E("close", t)), this.on("error", (t) => E("error", t)), this.on("loadEnd", (t) => E("loadEnd", t)), this.on("loadProgress", (t) => E("loadProgress", t)), this.on("loadStart", (t) => E("loadStart", t)), this.on("playCycleStart", (t) => E("playCycleStart", t)), this.on("playCycleEnd", (t) => E("playCycleEnd", t)), this.on("playEnd", (t) => E("playEnd", t)), this.on("playError", (t) => E("playError", t)), this.on("playReady", (t) => E("playReady", t)), this.on("playStart", (t) => E("playStart", t)), this.on("settings", (t) => E("settings", t));
|
|
118
118
|
}
|
|
119
119
|
_send(...t) {
|
|
120
|
-
|
|
120
|
+
Jt(...t), this.send(...t);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
const
|
|
124
|
-
class
|
|
123
|
+
const Yt = U("GigPlugin", "color:#000000;font-weight:bold;");
|
|
124
|
+
class Gi extends j {
|
|
125
125
|
constructor(...t) {
|
|
126
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
126
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Yt("configured");
|
|
127
127
|
}
|
|
128
128
|
postMessage(t) {
|
|
129
129
|
const e = {
|
|
@@ -171,18 +171,18 @@ class Ri extends $ {
|
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
const
|
|
175
|
-
class
|
|
174
|
+
const Zt = U("OryxPlugin", "color:#000000;font-weight:bold;");
|
|
175
|
+
class Hi extends j {
|
|
176
176
|
constructor(...t) {
|
|
177
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
177
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Zt("configured");
|
|
178
178
|
}
|
|
179
179
|
registerToSdkEvents() {
|
|
180
180
|
window.addEventListener("message", (t) => {
|
|
181
181
|
try {
|
|
182
|
-
const { type: e, param:
|
|
182
|
+
const { type: e, param: i } = t.data;
|
|
183
183
|
switch (e) {
|
|
184
184
|
case "doBalanceUpdate":
|
|
185
|
-
this.send("balance", { balance:
|
|
185
|
+
this.send("balance", { balance: i });
|
|
186
186
|
return;
|
|
187
187
|
case "doGamePause":
|
|
188
188
|
this.send("freeze");
|
|
@@ -226,81 +226,81 @@ class Di extends $ {
|
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
const
|
|
230
|
-
function
|
|
229
|
+
const ut = U("PariplayPlugin", "color:#000000;font-weight:bold;");
|
|
230
|
+
function Ve(s) {
|
|
231
231
|
try {
|
|
232
|
-
window.top.location =
|
|
232
|
+
window.top.location = s;
|
|
233
233
|
} catch {
|
|
234
|
-
window.location =
|
|
234
|
+
window.location = s;
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return new Promise(function(
|
|
237
|
+
function ze(s, t) {
|
|
238
|
+
return new Promise(function(i, n) {
|
|
239
239
|
const o = new XMLHttpRequest();
|
|
240
240
|
o.onload = function() {
|
|
241
|
-
o.status >= 200 && o.status < 300 ?
|
|
242
|
-
}, o.open(
|
|
241
|
+
o.status >= 200 && o.status < 300 ? i(o.responseText) : n(o.responseText);
|
|
242
|
+
}, o.open(s, t), o.send();
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function qe() {
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
247
|
+
function ei(s) {
|
|
248
|
+
return s.filter(function(e) {
|
|
249
249
|
return e.messageType.toUpperCase() === "DATA";
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
return
|
|
252
|
+
function We(s) {
|
|
253
|
+
return s.filter(function(e) {
|
|
254
254
|
return ["NOTIFICATION", "POPUP"].includes(e.messageType.toUpperCase());
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Dt(s) {
|
|
258
258
|
try {
|
|
259
|
-
return JSON.parse(
|
|
259
|
+
return JSON.parse(s.text);
|
|
260
260
|
} catch {
|
|
261
261
|
return {};
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
return
|
|
264
|
+
function ti(s) {
|
|
265
|
+
return s.map(Dt).filter(Boolean).find(function(e) {
|
|
266
266
|
return e.betId != null && e.winId != null;
|
|
267
267
|
}) || {};
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
269
|
+
function ii(s) {
|
|
270
|
+
return s.map(Dt).filter(Boolean).find(function(e) {
|
|
271
271
|
return e.TotalBet != null && e.TotalWin != null;
|
|
272
272
|
}) || {};
|
|
273
273
|
}
|
|
274
|
-
class
|
|
274
|
+
class Vi extends j {
|
|
275
275
|
constructor(...t) {
|
|
276
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
276
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), ut("configured");
|
|
277
277
|
}
|
|
278
278
|
postMessage(t, e) {
|
|
279
|
-
const
|
|
279
|
+
const i = {
|
|
280
280
|
lang: this.sdkConfig.ui.language,
|
|
281
281
|
sender: this.sdkConfig.api.game,
|
|
282
282
|
type: t
|
|
283
283
|
};
|
|
284
|
-
e != null && (
|
|
284
|
+
e != null && (i.data = e), ut("postMessage", i), window.parent.postMessage(i, "*");
|
|
285
285
|
}
|
|
286
286
|
coinsToCurrency(t) {
|
|
287
287
|
return t * this.sdkConfig.api.coinValueInCents / 100;
|
|
288
288
|
}
|
|
289
289
|
handleContinueButton(t, e) {
|
|
290
|
-
t.link &&
|
|
290
|
+
t.link && ze("GET", t.link), e();
|
|
291
291
|
}
|
|
292
292
|
handleLinkButton(t, e) {
|
|
293
293
|
switch (t.linkType.toUpperCase()) {
|
|
294
294
|
case "AJAX":
|
|
295
|
-
|
|
295
|
+
ze("GET", t.link), e();
|
|
296
296
|
return;
|
|
297
297
|
case "AJAXRESPONSE":
|
|
298
|
-
|
|
298
|
+
ze("GET", t.link).then(() => {
|
|
299
299
|
e();
|
|
300
300
|
});
|
|
301
301
|
return;
|
|
302
302
|
case "REDIRECT":
|
|
303
|
-
|
|
303
|
+
Ve(t.link), e();
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
@@ -323,17 +323,17 @@ class Ni extends $ {
|
|
|
323
323
|
};
|
|
324
324
|
}
|
|
325
325
|
processInfoUiMessages(t) {
|
|
326
|
-
return t.reduce((e,
|
|
327
|
-
Object.assign({},
|
|
328
|
-
buttons:
|
|
326
|
+
return t.reduce((e, i) => e.then(() => new Promise((n) => {
|
|
327
|
+
Object.assign({}, i, {
|
|
328
|
+
buttons: i.buttons.filter((o) => o.action.toUpperCase() === "CASHIER" ? !!this.sdkConfig.api.cashierUrl : !0).map((o) => Object.assign({}, o, {
|
|
329
329
|
onRelease: () => {
|
|
330
|
-
const a =
|
|
330
|
+
const a = i.messageType.toUpperCase() === "POPUP" ? qe : n, h = this.buttonActions[o.action.toUpperCase()];
|
|
331
331
|
h ? h(o, a) : a();
|
|
332
332
|
}
|
|
333
333
|
}))
|
|
334
334
|
});
|
|
335
|
-
}).catch(
|
|
336
|
-
}).catch(
|
|
335
|
+
}).catch(qe)), Promise.resolve()).then(() => {
|
|
336
|
+
}).catch(qe);
|
|
337
337
|
}
|
|
338
338
|
registerToSdkEvents() {
|
|
339
339
|
window.addEventListener("message", (t) => {
|
|
@@ -361,26 +361,26 @@ class Ni extends $ {
|
|
|
361
361
|
registerFromSdkEvents() {
|
|
362
362
|
let t = 0;
|
|
363
363
|
this.on("openGameResponse", (e) => {
|
|
364
|
-
let
|
|
364
|
+
let i;
|
|
365
365
|
try {
|
|
366
366
|
const n = JSON.parse(
|
|
367
367
|
JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token
|
|
368
368
|
), o = JSON.parse(n.integrationSpecificAttributes.sessionData || "{}");
|
|
369
|
-
|
|
369
|
+
i = {
|
|
370
370
|
ClientToken: n.integrationSpecificAttributes.clientToken,
|
|
371
371
|
CurrencyCode: n.currency,
|
|
372
372
|
PlayerTokenId: n.user,
|
|
373
373
|
SessionData: o
|
|
374
374
|
};
|
|
375
375
|
} catch {
|
|
376
|
-
|
|
376
|
+
i = void 0;
|
|
377
377
|
}
|
|
378
378
|
this.postMessage("gameDataLoaded", {
|
|
379
|
-
LoadGameData:
|
|
379
|
+
LoadGameData: i,
|
|
380
380
|
success: !0
|
|
381
381
|
});
|
|
382
382
|
try {
|
|
383
|
-
const n =
|
|
383
|
+
const n = We(e.contract.uiMessages);
|
|
384
384
|
this.processInfoUiMessages(n);
|
|
385
385
|
} catch {
|
|
386
386
|
}
|
|
@@ -397,22 +397,22 @@ class Ni extends $ {
|
|
|
397
397
|
window.history.back();
|
|
398
398
|
}
|
|
399
399
|
else
|
|
400
|
-
this.sdkConfig.api.homeUrl === "(api)" ? this.postMessage("quit") :
|
|
400
|
+
this.sdkConfig.api.homeUrl === "(api)" ? this.postMessage("quit") : Ve(this.sdkConfig.api.homeUrl);
|
|
401
401
|
}), this.on("playEnd", (e) => {
|
|
402
402
|
this.postMessage("roundEnded", {
|
|
403
403
|
balanceAfter: this.coinsToCurrency(e.contract.balance.coins),
|
|
404
404
|
win: this.coinsToCurrency(e.contract.win.round)
|
|
405
405
|
});
|
|
406
406
|
try {
|
|
407
|
-
const
|
|
408
|
-
this.processInfoUiMessages(
|
|
407
|
+
const i = We(e.contract.uiMessages);
|
|
408
|
+
this.processInfoUiMessages(i);
|
|
409
409
|
} catch {
|
|
410
410
|
}
|
|
411
411
|
}), this.on("playError", (e) => {
|
|
412
|
-
var
|
|
412
|
+
var i, n;
|
|
413
413
|
this.postMessage("ticketReceived", {
|
|
414
414
|
// TODO: Operator specific error code and message
|
|
415
|
-
ErrorCode: (
|
|
415
|
+
ErrorCode: (i = e.data) == null ? void 0 : i.code,
|
|
416
416
|
ErrorMessage: "ERROR",
|
|
417
417
|
Status: {
|
|
418
418
|
ErrCode: (n = e.data) == null ? void 0 : n.code
|
|
@@ -424,10 +424,10 @@ class Ni extends $ {
|
|
|
424
424
|
e.contract.balance.coins + e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier
|
|
425
425
|
)
|
|
426
426
|
});
|
|
427
|
-
const
|
|
427
|
+
const i = ["BaseGame", "PaidSpin"].includes(e.contract.stateType.thisRound), n = ei(e.contract.uiMessages), o = We(e.contract.uiMessages), a = ti(n), h = ii(n);
|
|
428
428
|
this.postMessage("ticketReceived", {
|
|
429
429
|
Balance: this.coinsToCurrency(e.contract.balance.coins),
|
|
430
|
-
BetAmount:
|
|
430
|
+
BetAmount: i ? this.coinsToCurrency(e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier) : 0,
|
|
431
431
|
CreditTransactionId: a.betId,
|
|
432
432
|
DebitTransactionId: a.winId,
|
|
433
433
|
Message: o,
|
|
@@ -446,18 +446,18 @@ class Ni extends $ {
|
|
|
446
446
|
}), this.on("loadStart", () => {
|
|
447
447
|
this.postMessage("onAppFrameReady");
|
|
448
448
|
}), this.on("cashier", () => {
|
|
449
|
-
this.sdkConfig.api.cashierUrl && (this.sdkConfig.api.cashierUrl === "(api)" ? this.postMessage("cashier") :
|
|
449
|
+
this.sdkConfig.api.cashierUrl && (this.sdkConfig.api.cashierUrl === "(api)" ? this.postMessage("cashier") : Ve(this.sdkConfig.api.cashierUrl));
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
const
|
|
454
|
-
class
|
|
453
|
+
const he = U("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
|
|
454
|
+
class zi extends j {
|
|
455
455
|
constructor(...e) {
|
|
456
456
|
super(...e);
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
457
|
+
g(this, "VERSION", "1.15.0");
|
|
458
|
+
const i = document.createElement("script");
|
|
459
|
+
i.src = `https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`, i.onload = () => {
|
|
460
|
+
he("loaded"), window.FEIM.configure({
|
|
461
461
|
p2pConfig: {
|
|
462
462
|
currency: this.sdkConfig.api.currency,
|
|
463
463
|
launchParams: {
|
|
@@ -465,11 +465,11 @@ class Gi extends $ {
|
|
|
465
465
|
homeurl: "homeUrl"
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
}),
|
|
469
|
-
}, document.body.appendChild(
|
|
468
|
+
}), he("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
|
|
469
|
+
}, document.body.appendChild(i);
|
|
470
470
|
}
|
|
471
471
|
registerToSdkEvents() {
|
|
472
|
-
window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() =>
|
|
472
|
+
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(() => {
|
|
473
473
|
this.send("help", {});
|
|
474
474
|
}), window.FEIM.on.togglePaytable(() => {
|
|
475
475
|
this.send("paytable", {});
|
|
@@ -489,8 +489,8 @@ class Gi extends $ {
|
|
|
489
489
|
}
|
|
490
490
|
}), this.on("balance", ({ balance: e }) => {
|
|
491
491
|
window.FEIM.send.balanceUpdate(e);
|
|
492
|
-
}), this.on("bet", ({ base: e, multiplier:
|
|
493
|
-
window.FEIM.send.betUpdate(e *
|
|
492
|
+
}), this.on("bet", ({ base: e, multiplier: i }) => {
|
|
493
|
+
window.FEIM.send.betUpdate(e * i);
|
|
494
494
|
}), this.on("error", ({ message: e }) => {
|
|
495
495
|
window.FEIM.send.errorMessage(e);
|
|
496
496
|
}), this.on("close", () => {
|
|
@@ -504,20 +504,20 @@ class Gi extends $ {
|
|
|
504
504
|
}), this.on("cashier", () => {
|
|
505
505
|
window.FEIM.send.openQuickDeposit();
|
|
506
506
|
}), this.on("playCycleEnd", (e) => {
|
|
507
|
-
const
|
|
507
|
+
const i = {
|
|
508
508
|
balance: e.contract.balance.coins,
|
|
509
509
|
bet: e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier,
|
|
510
510
|
win: {
|
|
511
511
|
win: e.contract.win.total
|
|
512
512
|
}
|
|
513
513
|
};
|
|
514
|
-
window.FEIM.send.roundFinished(
|
|
514
|
+
window.FEIM.send.roundFinished(i);
|
|
515
515
|
}), this.on("playResponse", (e) => {
|
|
516
|
-
const
|
|
516
|
+
const i = {
|
|
517
517
|
balance: e.contract.balance.coins,
|
|
518
518
|
playResponse: e.data
|
|
519
519
|
};
|
|
520
|
-
window.FEIM.send.roundStarted(
|
|
520
|
+
window.FEIM.send.roundStarted(i);
|
|
521
521
|
}), this.on("history", () => {
|
|
522
522
|
window.FEIM.send.showHistory();
|
|
523
523
|
}), this.on("settings", (e) => {
|
|
@@ -525,27 +525,27 @@ class Gi extends $ {
|
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
class
|
|
528
|
+
const $e = U("TukoPlugin", "color:#000000;font-weight:bold;");
|
|
529
|
+
class qi extends j {
|
|
530
530
|
constructor(...e) {
|
|
531
531
|
super(...e);
|
|
532
|
-
|
|
532
|
+
g(this, "PING_INTERVAL", 1e4);
|
|
533
533
|
const n = new URLSearchParams(window.location.search).get("pingCallbackUrl");
|
|
534
534
|
n && window.setInterval(() => {
|
|
535
535
|
this.ping(n);
|
|
536
|
-
}, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
536
|
+
}, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), $e("configured");
|
|
537
537
|
}
|
|
538
538
|
ping(e) {
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
},
|
|
539
|
+
const i = new XMLHttpRequest();
|
|
540
|
+
i.onreadystatechange = function() {
|
|
541
|
+
i.readyState === XMLHttpRequest.DONE && (i.status === 0 || i.status >= 200 && i.status < 400 ? $e("ping ok", i) : $e("ping error", i));
|
|
542
|
+
}, i.open("GET", e), i.send();
|
|
543
543
|
}
|
|
544
544
|
registerToSdkEvents() {
|
|
545
545
|
window.addEventListener("message", (e) => {
|
|
546
546
|
try {
|
|
547
|
-
const { type:
|
|
548
|
-
switch (
|
|
547
|
+
const { type: i, payload: n } = e.data;
|
|
548
|
+
switch (i) {
|
|
549
549
|
case "doAudioSettings":
|
|
550
550
|
this.send("settings", { music: n == null ? void 0 : n.musicEnabled, sounds: n == null ? void 0 : n.soundEnabled });
|
|
551
551
|
return;
|
|
@@ -586,751 +586,80 @@ class Hi extends $ {
|
|
|
586
586
|
});
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
p(this, "socket", null);
|
|
611
|
-
p(this, "webSocketUrl");
|
|
612
|
-
p(this, "eventListeners", {
|
|
613
|
-
close: [],
|
|
614
|
-
error: [],
|
|
615
|
-
message: []
|
|
616
|
-
});
|
|
617
|
-
p(this, "connect", () => {
|
|
618
|
-
const t = new WebSocket(this.webSocketUrl);
|
|
619
|
-
return t.addEventListener("message", this.handleMessage), new Promise((e) => {
|
|
620
|
-
t.addEventListener("open", (s) => {
|
|
621
|
-
this.handleOpen(s), e(this.socket);
|
|
622
|
-
});
|
|
623
|
-
});
|
|
624
|
-
});
|
|
625
|
-
p(this, "send", (t) => {
|
|
626
|
-
if (this.socket == null)
|
|
627
|
-
throw new Error("Cannot send message, the WebSocket connection is not open");
|
|
628
|
-
this.socket.send(t);
|
|
629
|
-
});
|
|
630
|
-
p(this, "close", () => {
|
|
631
|
-
if (this.socket == null)
|
|
632
|
-
throw new Error("Cannot close the WebSocket connection that is not open");
|
|
633
|
-
this.socket.close(), this.addEventListener("error", (t) => {
|
|
634
|
-
console.log(t);
|
|
635
|
-
});
|
|
636
|
-
});
|
|
637
|
-
p(this, "handleClose", (t) => {
|
|
638
|
-
this.eventListeners.close.forEach((e) => {
|
|
639
|
-
e(t);
|
|
640
|
-
});
|
|
641
|
-
});
|
|
642
|
-
p(this, "handleError", (t) => {
|
|
643
|
-
this.eventListeners.error.forEach((e) => {
|
|
644
|
-
e(t);
|
|
645
|
-
});
|
|
646
|
-
});
|
|
647
|
-
p(this, "handleMessage", (t) => {
|
|
648
|
-
this.eventListeners.message.forEach((e) => {
|
|
649
|
-
e(t);
|
|
650
|
-
});
|
|
651
|
-
});
|
|
652
|
-
p(this, "handleOpen", (t) => {
|
|
653
|
-
const e = t.target;
|
|
654
|
-
e.addEventListener("close", this.handleClose), e.addEventListener("error", this.handleError), this.socket = e;
|
|
655
|
-
});
|
|
656
|
-
this.webSocketUrl = t;
|
|
657
|
-
}
|
|
658
|
-
addEventListener(t, e) {
|
|
659
|
-
this.eventListeners[t].push(e);
|
|
660
|
-
}
|
|
661
|
-
removeEventListener(t, e) {
|
|
662
|
-
const s = this.eventListeners[t].indexOf(e);
|
|
663
|
-
s !== -1 && this.eventListeners[t].splice(s, 1);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
function Me(i) {
|
|
667
|
-
return JSON.parse(i == null ? void 0 : i.data);
|
|
668
|
-
}
|
|
669
|
-
function Jt(i) {
|
|
670
|
-
var t;
|
|
671
|
-
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "Ping";
|
|
672
|
-
}
|
|
673
|
-
function lt(i) {
|
|
674
|
-
var t;
|
|
675
|
-
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "RealityCheck";
|
|
676
|
-
}
|
|
677
|
-
function Le(i) {
|
|
678
|
-
return i.header.name === "GameEvent";
|
|
679
|
-
}
|
|
680
|
-
function Yt(i) {
|
|
681
|
-
return Le(i) && i.body.event === "OPEN_GAME";
|
|
682
|
-
}
|
|
683
|
-
function ut(i) {
|
|
684
|
-
return i.header.code !== 1;
|
|
685
|
-
}
|
|
686
|
-
function Zt(i) {
|
|
687
|
-
return Le(i) && i.body.event.includes("_RESULT");
|
|
688
|
-
}
|
|
689
|
-
var ie, ke;
|
|
690
|
-
class ei extends Kt {
|
|
691
|
-
constructor(e, s) {
|
|
692
|
-
const n = new URL(e.apiUrl);
|
|
693
|
-
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);
|
|
694
|
-
super(n.toString());
|
|
695
|
-
/*
|
|
696
|
-
* Correlation ID. Used in Request and Response types.
|
|
697
|
-
* ----
|
|
698
|
-
* Since web socket communication is async, correlation id enables us
|
|
699
|
-
* to connect requests and responses together. This is suitable also for
|
|
700
|
-
* troubleshooting. Connected requests and responses must have
|
|
701
|
-
* same correlation id. Correlation id should increase with every
|
|
702
|
-
* request sent. Client and server independently maintain their own
|
|
703
|
-
* correlation id counter.
|
|
704
|
-
*/
|
|
705
|
-
p(this, "cId", 0);
|
|
706
|
-
// Initial values for header
|
|
707
|
-
/*
|
|
708
|
-
* Increasing message ID
|
|
709
|
-
* ----
|
|
710
|
-
* mId should be increased with every message sent and is independently
|
|
711
|
-
* maintained by client and server (ids on server and ids on client are not
|
|
712
|
-
* correlated). This id is used by accepting party to keep incoming
|
|
713
|
-
* messages in order (network issues could be the cause that messages are
|
|
714
|
-
* received out of sync).
|
|
715
|
-
*/
|
|
716
|
-
// TODO make sure messages are processed in order
|
|
717
|
-
p(this, "mId", 0);
|
|
718
|
-
// Initial values for body
|
|
719
|
-
/*
|
|
720
|
-
* Sequence ID. Action/Event correlation.
|
|
721
|
-
*/
|
|
722
|
-
p(this, "seqId", 10);
|
|
723
|
-
p(this, "gameCode");
|
|
724
|
-
M(this, ie, void 0);
|
|
725
|
-
M(this, ke, void 0);
|
|
726
|
-
p(this, "onMessage", (e) => {
|
|
727
|
-
const s = Me(e);
|
|
728
|
-
(Le(s) || Jt(s) || lt(s)) && this.sendAcknowledgement(s), lt(s) && this.handleRealityCheck(s);
|
|
729
|
-
});
|
|
730
|
-
this.eventListeners.realityCheck = [], this.gameCode = e.gameCode, k(this, ie, s.requestTimeoutMs), k(this, ke, s.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
|
|
731
|
-
}
|
|
732
|
-
handleRealityCheck(e) {
|
|
733
|
-
this.eventListeners.realityCheck.forEach((s) => {
|
|
734
|
-
s(e.body);
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
addEventListener(e, s) {
|
|
738
|
-
super.addEventListener(e, s);
|
|
739
|
-
}
|
|
740
|
-
removeEventListener(e, s) {
|
|
741
|
-
super.removeEventListener(e, s);
|
|
742
|
-
}
|
|
743
|
-
buildHeader(e, s = null) {
|
|
744
|
-
return {
|
|
745
|
-
// Assign new cId if it is not provided
|
|
746
|
-
cId: s ?? ++this.cId,
|
|
747
|
-
code: s !== null ? 1 : void 0,
|
|
748
|
-
mId: ++this.mId,
|
|
749
|
-
name: e
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
// TODO infer body from header
|
|
753
|
-
buildPayload(e, s) {
|
|
754
|
-
return JSON.stringify({
|
|
755
|
-
body: s,
|
|
756
|
-
header: e
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
getBodyExtras(e) {
|
|
760
|
-
return {
|
|
761
|
-
action: e,
|
|
762
|
-
seqId: ++this.seqId
|
|
763
|
-
};
|
|
764
|
-
}
|
|
765
|
-
request(e, s) {
|
|
766
|
-
const n = this.buildPayload(e, s);
|
|
767
|
-
return new Promise((o, a) => {
|
|
768
|
-
setTimeout(() => a({ type: "timeout" }), y(this, ie));
|
|
769
|
-
const h = (g) => {
|
|
770
|
-
const w = Me(g);
|
|
771
|
-
try {
|
|
772
|
-
e.cId === w.header.cId && (this.removeEventListener("message", h), w.header.code === 1 ? o(w) : a({ message: w, type: "error" }));
|
|
773
|
-
} catch {
|
|
774
|
-
a({ message: w, type: "error" });
|
|
775
|
-
}
|
|
776
|
-
};
|
|
777
|
-
this.addEventListener("message", h), this.send(n);
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
freeRounds(e) {
|
|
781
|
-
const s = this.buildHeader("ActivateFreeRound");
|
|
782
|
-
return this.request(s, e).then((n) => n.body).catch((n) => {
|
|
783
|
-
var o;
|
|
784
|
-
throw { data: (o = n == null ? void 0 : n.message) == null ? void 0 : o.body, type: n.type };
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
authenticate(e = !1) {
|
|
788
|
-
const s = this.buildHeader("Authenticate"), n = {
|
|
789
|
-
clientType: 3,
|
|
790
|
-
version: y(this, ke),
|
|
791
|
-
reconnect: e
|
|
792
|
-
};
|
|
793
|
-
return this.request(s, n).then((o) => o.body).catch((o) => {
|
|
794
|
-
var a;
|
|
795
|
-
throw { data: (a = o == null ? void 0 : o.message) == null ? void 0 : a.body, type: o.type };
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
openGame() {
|
|
799
|
-
const e = this.buildHeader("OpenGame"), s = {
|
|
800
|
-
gameCode: this.gameCode
|
|
801
|
-
};
|
|
802
|
-
return new Promise((n, o) => {
|
|
803
|
-
const a = (h) => {
|
|
804
|
-
const g = Me(h);
|
|
805
|
-
Yt(g) ? (this.removeEventListener("message", a), n(g.body)) : ut(g) && o({ data: g.body, type: "error" });
|
|
806
|
-
};
|
|
807
|
-
this.addEventListener("message", a), this.request(e, s).catch(
|
|
808
|
-
(h) => {
|
|
809
|
-
var g;
|
|
810
|
-
return o({ data: (g = h == null ? void 0 : h.message) == null ? void 0 : g.body, type: h.type });
|
|
811
|
-
}
|
|
812
|
-
);
|
|
813
|
-
});
|
|
814
|
-
}
|
|
815
|
-
sendAcknowledgement(e) {
|
|
816
|
-
const { name: s, cId: n } = e.header, o = this.buildHeader(s, n), a = this.buildPayload(o, {});
|
|
817
|
-
this.send(a);
|
|
589
|
+
var si = "2.0.0-beta.3", ce = "", ht = "?", et = "function", V = "undefined", de = "object", tt = "string", be = "major", l = "model", r = "name", d = "type", u = "vendor", c = "version", S = "architecture", Y = "console", b = "mobile", f = "tablet", T = "smarttv", xe = "wearable", pt = "xr", it = "embedded", gt = "user-agent", st = 500, ot = "brands", W = "formFactors", rt = "fullVersionList", Z = "platform", ct = "platformVersion", Ge = "bitness", q = "sec-ch-ua", ni = q + "-full-version-list", ai = q + "-arch", oi = q + "-" + Ge, ri = q + "-form-factors", ci = q + "-" + b, di = q + "-" + l, Ft = q + "-" + Z, li = Ft + "-version", Nt = [ot, rt, b, l, Z, ct, S, W, Ge], A = "browser", B = "cpu", x = "device", D = "engine", P = "os", ee = "result", Ce = "Amazon", pe = "Apple", wt = "ASUS", mt = "BlackBerry", Me = "Google", bt = "Huawei", ft = "Lenovo", je = "LG", Re = "Microsoft", yt = "Motorola", Se = "Samsung", kt = "Sharp", Ie = "Sony", Xe = "Xiaomi", Ke = "Zebra", Q = "Mobile ", J = " Browser", Te = "Chrome", ui = "Edge", ge = "Firefox", we = "Opera", vt = "Facebook", Et = "Sogou", nt = "Windows", hi = typeof window !== V, I = hi && window.navigator ? window.navigator : void 0, G = I && I.userAgentData ? I.userAgentData : void 0, pi = function(s, t) {
|
|
590
|
+
var e = {}, i = t;
|
|
591
|
+
if (!Ue(t)) {
|
|
592
|
+
i = {};
|
|
593
|
+
for (var n in t)
|
|
594
|
+
for (var o in t[n])
|
|
595
|
+
i[o] = t[n][o].concat(i[o] ? i[o] : []);
|
|
596
|
+
}
|
|
597
|
+
for (var a in s)
|
|
598
|
+
e[a] = i[a] && i[a].length % 2 === 0 ? i[a].concat(s[a]) : s[a];
|
|
599
|
+
return e;
|
|
600
|
+
}, He = function(s) {
|
|
601
|
+
for (var t = {}, e = 0; e < s.length; e++)
|
|
602
|
+
t[s[e].toUpperCase()] = s[e];
|
|
603
|
+
return t;
|
|
604
|
+
}, at = function(s, t) {
|
|
605
|
+
if (typeof s === de && s.length > 0) {
|
|
606
|
+
for (var e in s)
|
|
607
|
+
if (z(s[e]) == z(t))
|
|
608
|
+
return !0;
|
|
609
|
+
return !1;
|
|
818
610
|
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
);
|
|
835
|
-
});
|
|
611
|
+
return le(s) ? z(t).indexOf(z(s)) !== -1 : !1;
|
|
612
|
+
}, Ue = function(s, t) {
|
|
613
|
+
for (var e in s)
|
|
614
|
+
return /^(browser|cpu|device|engine|os)$/.test(e) || (t ? Ue(s[e]) : !1);
|
|
615
|
+
}, le = function(s) {
|
|
616
|
+
return typeof s === tt;
|
|
617
|
+
}, Qe = function(s) {
|
|
618
|
+
if (s) {
|
|
619
|
+
for (var t = [], e = $(/\\?\"/g, s).split(","), i = 0; i < e.length; i++)
|
|
620
|
+
if (e[i].indexOf(";") > -1) {
|
|
621
|
+
var n = fe(e[i]).split(";v=");
|
|
622
|
+
t[i] = { brand: n[0], version: n[1] };
|
|
623
|
+
} else
|
|
624
|
+
t[i] = fe(e[i]);
|
|
625
|
+
return t;
|
|
836
626
|
}
|
|
837
|
-
|
|
838
|
-
|
|
627
|
+
}, z = function(s) {
|
|
628
|
+
return le(s) ? s.toLowerCase() : s;
|
|
629
|
+
}, Je = function(s) {
|
|
630
|
+
return le(s) ? $(/[^\d\.]/g, s).split(".")[0] : void 0;
|
|
631
|
+
}, F = function(s) {
|
|
632
|
+
for (var t in s) {
|
|
633
|
+
var e = s[t];
|
|
634
|
+
typeof e == de && e.length == 2 ? this[e[0]] = e[1] : this[e] = void 0;
|
|
839
635
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
contract: {
|
|
858
|
-
balance: {
|
|
859
|
-
coins: i.balance,
|
|
860
|
-
version: i.balanceVersion
|
|
861
|
-
},
|
|
862
|
-
coinValueInCents: i.coinValueInCents,
|
|
863
|
-
country: i.countryCode,
|
|
864
|
-
currency: i.currencyCode,
|
|
865
|
-
jurisdiction: i.jurisdictionCode,
|
|
866
|
-
uiMessages: i.uiMessages,
|
|
867
|
-
username: i.username
|
|
636
|
+
return this;
|
|
637
|
+
}, $ = function(s, t) {
|
|
638
|
+
return le(t) ? t.replace(s, ce) : t;
|
|
639
|
+
}, me = function(s) {
|
|
640
|
+
return $(/\\?\"/g, s);
|
|
641
|
+
}, fe = function(s, t) {
|
|
642
|
+
if (le(s))
|
|
643
|
+
return s = $(/^\s\s*/, s), typeof t === V ? s : s.substring(0, st);
|
|
644
|
+
}, Ct = function(s, t) {
|
|
645
|
+
if (!(!s || !t))
|
|
646
|
+
for (var e = 0, i, n, o, a, h, p; e < t.length && !h; ) {
|
|
647
|
+
var w = t[e], m = t[e + 1];
|
|
648
|
+
for (i = n = 0; i < w.length && !h && w[i]; )
|
|
649
|
+
if (h = w[i++].exec(s), h)
|
|
650
|
+
for (o = 0; o < m.length; o++)
|
|
651
|
+
p = h[++n], a = m[o], typeof a === de && a.length > 0 ? a.length === 2 ? typeof a[1] == et ? this[a[0]] = a[1].call(this, p) : this[a[0]] = a[1] : a.length === 3 ? typeof a[1] === et && !(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;
|
|
652
|
+
e += 2;
|
|
868
653
|
}
|
|
869
|
-
|
|
870
|
-
}
|
|
871
|
-
function ii(i) {
|
|
872
|
-
var t, e;
|
|
873
|
-
return {
|
|
874
|
-
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
875
|
-
code: ((t = i.data) == null ? void 0 : t.code) ?? De.UNKNOWN,
|
|
876
|
-
details: (e = i.data) == null ? void 0 : e.details
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
function si(i, t) {
|
|
880
|
-
const e = t.contract;
|
|
881
|
-
if (!e) {
|
|
882
|
-
const s = t.data;
|
|
883
|
-
return {
|
|
884
|
-
contract: {
|
|
885
|
-
bet: {
|
|
886
|
-
available: s.additionalConfigData.availableMultipliersPerBaseBet,
|
|
887
|
-
default: {
|
|
888
|
-
base: s.additionalConfigData.defaultBet.baseBet,
|
|
889
|
-
multiplier: s.additionalConfigData.defaultBet.betMultiplier
|
|
890
|
-
},
|
|
891
|
-
max: s.additionalConfigData.maxAllowedOverallBetInCoins,
|
|
892
|
-
last: s.gameState.betFromCurrentRound ? {
|
|
893
|
-
base: s.gameState.betFromCurrentRound.baseBet,
|
|
894
|
-
multiplier: s.gameState.betFromCurrentRound.betMultiplier
|
|
895
|
-
} : null,
|
|
896
|
-
lastPaid: s.gameState.lastPlacedMainGameBet ? {
|
|
897
|
-
base: s.gameState.lastPlacedMainGameBet.baseBet,
|
|
898
|
-
multiplier: s.gameState.lastPlacedMainGameBet.betMultiplier
|
|
899
|
-
} : null
|
|
900
|
-
},
|
|
901
|
-
balance: {
|
|
902
|
-
coins: t.balance,
|
|
903
|
-
version: t.balanceVersion
|
|
904
|
-
},
|
|
905
|
-
freeRounds: (s.FREE_ROUNDS ?? []).map((n) => ({
|
|
906
|
-
conf: {
|
|
907
|
-
base: n.conf.baseBet,
|
|
908
|
-
multiplier: n.conf.betMultiplier,
|
|
909
|
-
numAwarded: n.conf.numAwarded
|
|
910
|
-
},
|
|
911
|
-
data: {
|
|
912
|
-
numPlayed: n.data.numPlayed,
|
|
913
|
-
win: n.data.winAmount,
|
|
914
|
-
numLeft: n.data.numLeft
|
|
915
|
-
},
|
|
916
|
-
id: n.id,
|
|
917
|
-
rejectable: n.rejectable,
|
|
918
|
-
skippable: n.skippable,
|
|
919
|
-
status: n.status,
|
|
920
|
-
type: n.type
|
|
921
|
-
})),
|
|
922
|
-
gameModel: s.additionalConfigData.gameModelFile,
|
|
923
|
-
metaData: s.gameConfigData.metaData,
|
|
924
|
-
roundId: s.gameState.cycleId,
|
|
925
|
-
serverTime: t.balanceVersion,
|
|
926
|
-
sessionId: s.gameState.sessionId,
|
|
927
|
-
stateType: {
|
|
928
|
-
thisRound: s.gameState.stateTypeThisRound,
|
|
929
|
-
nextRound: s.gameState.stateTypeNextRound
|
|
930
|
-
},
|
|
931
|
-
uiMessages: i.uiMessages,
|
|
932
|
-
win: {
|
|
933
|
-
round: s.gameState.totalWinFromCurrentRound,
|
|
934
|
-
total: s.gameState.totalWinFromCurrentGameCycle
|
|
935
|
-
}
|
|
936
|
-
},
|
|
937
|
-
data: s
|
|
938
|
-
};
|
|
939
|
-
}
|
|
940
|
-
return {
|
|
941
|
-
contract: {
|
|
942
|
-
bet: {
|
|
943
|
-
available: e.availableMultipliersPerBaseBet,
|
|
944
|
-
default: {
|
|
945
|
-
base: e.defaultBet.baseBet,
|
|
946
|
-
multiplier: e.defaultBet.betMultiplier
|
|
947
|
-
},
|
|
948
|
-
max: e.maxBetInCoins,
|
|
949
|
-
last: e.lastBet ? {
|
|
950
|
-
base: e.lastBet.baseBet,
|
|
951
|
-
multiplier: e.lastBet.betMultiplier
|
|
952
|
-
} : null,
|
|
953
|
-
lastPaid: e.lastMainGameBet ? {
|
|
954
|
-
base: e.lastMainGameBet.baseBet,
|
|
955
|
-
multiplier: e.lastMainGameBet.betMultiplier
|
|
956
|
-
} : null
|
|
957
|
-
},
|
|
958
|
-
balance: {
|
|
959
|
-
coins: e.balanceInCoins,
|
|
960
|
-
version: e.balanceVersion
|
|
961
|
-
},
|
|
962
|
-
freeRounds: (e.freeRounds ?? []).map((s) => ({
|
|
963
|
-
conf: {
|
|
964
|
-
base: s.conf.baseBet,
|
|
965
|
-
multiplier: s.conf.betMultiplier,
|
|
966
|
-
numAwarded: s.conf.numAwarded
|
|
967
|
-
},
|
|
968
|
-
data: {
|
|
969
|
-
numPlayed: s.data.numPlayed,
|
|
970
|
-
win: s.data.winAmount,
|
|
971
|
-
numLeft: s.data.numLeft
|
|
972
|
-
},
|
|
973
|
-
id: s.id,
|
|
974
|
-
rejectable: s.rejectable,
|
|
975
|
-
skippable: s.skippable,
|
|
976
|
-
status: s.status,
|
|
977
|
-
type: s.type
|
|
978
|
-
})),
|
|
979
|
-
gameModel: e.gameModelFile,
|
|
980
|
-
metaData: e.metaData,
|
|
981
|
-
roundId: e.roundId,
|
|
982
|
-
serverTime: e.serverTime,
|
|
983
|
-
sessionId: e.sessionId,
|
|
984
|
-
stateType: {
|
|
985
|
-
thisRound: e.stateTypeThisRound,
|
|
986
|
-
nextRound: e.stateTypeNextRound
|
|
987
|
-
},
|
|
988
|
-
uiMessages: i.contract.uiMessages.concat(e.uiMessages),
|
|
989
|
-
win: {
|
|
990
|
-
round: e.roundWin,
|
|
991
|
-
total: e.totalWin
|
|
992
|
-
}
|
|
993
|
-
},
|
|
994
|
-
data: t.opaqueGameServerToUi
|
|
995
|
-
};
|
|
996
|
-
}
|
|
997
|
-
function ni(i) {
|
|
998
|
-
var t, e;
|
|
999
|
-
return {
|
|
1000
|
-
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
1001
|
-
code: ((t = i.data) == null ? void 0 : t.code) ?? De.UNKNOWN,
|
|
1002
|
-
details: (e = i.data) == null ? void 0 : e.details
|
|
1003
|
-
};
|
|
1004
|
-
}
|
|
1005
|
-
function ai(i) {
|
|
1006
|
-
const t = i.contract;
|
|
1007
|
-
if (!t) {
|
|
1008
|
-
const e = i.data;
|
|
1009
|
-
return {
|
|
1010
|
-
contract: {
|
|
1011
|
-
bet: {
|
|
1012
|
-
last: e.gameState.betFromCurrentRound ? {
|
|
1013
|
-
base: e.gameState.betFromCurrentRound.baseBet,
|
|
1014
|
-
multiplier: e.gameState.betFromCurrentRound.betMultiplier
|
|
1015
|
-
} : null,
|
|
1016
|
-
lastPaid: {
|
|
1017
|
-
base: e.gameState.lastPlacedMainGameBet.baseBet,
|
|
1018
|
-
multiplier: e.gameState.lastPlacedMainGameBet.betMultiplier
|
|
1019
|
-
}
|
|
1020
|
-
},
|
|
1021
|
-
balance: {
|
|
1022
|
-
coins: i.balance,
|
|
1023
|
-
version: i.balanceVersion
|
|
1024
|
-
},
|
|
1025
|
-
freeRounds: (e.FREE_ROUNDS ?? []).map((s) => ({
|
|
1026
|
-
conf: {
|
|
1027
|
-
base: s.conf.baseBet,
|
|
1028
|
-
multiplier: s.conf.betMultiplier,
|
|
1029
|
-
numAwarded: s.conf.numAwarded
|
|
1030
|
-
},
|
|
1031
|
-
data: {
|
|
1032
|
-
numPlayed: s.data.numPlayed,
|
|
1033
|
-
win: s.data.winAmount,
|
|
1034
|
-
numLeft: s.data.numLeft
|
|
1035
|
-
},
|
|
1036
|
-
id: s.id,
|
|
1037
|
-
rejectable: s.rejectable,
|
|
1038
|
-
skippable: s.skippable,
|
|
1039
|
-
status: s.status,
|
|
1040
|
-
type: s.type
|
|
1041
|
-
})),
|
|
1042
|
-
serverTime: i.balanceVersion,
|
|
1043
|
-
roundId: e.gameState.cycleId,
|
|
1044
|
-
stateType: {
|
|
1045
|
-
thisRound: e.gameState.stateTypeThisRound,
|
|
1046
|
-
nextRound: e.gameState.stateTypeNextRound
|
|
1047
|
-
},
|
|
1048
|
-
uiMessages: e.uiMessages,
|
|
1049
|
-
win: {
|
|
1050
|
-
round: e.gameState.totalWinFromCurrentRound,
|
|
1051
|
-
total: e.gameState.totalWinFromCurrentGameCycle
|
|
1052
|
-
}
|
|
1053
|
-
},
|
|
1054
|
-
data: e
|
|
1055
|
-
};
|
|
1056
|
-
}
|
|
1057
|
-
return {
|
|
1058
|
-
contract: {
|
|
1059
|
-
bet: {
|
|
1060
|
-
last: i.contract.lastBet ? {
|
|
1061
|
-
base: i.contract.lastBet.baseBet,
|
|
1062
|
-
multiplier: i.contract.lastBet.betMultiplier
|
|
1063
|
-
} : null,
|
|
1064
|
-
lastPaid: {
|
|
1065
|
-
base: i.contract.lastMainGameBet.baseBet,
|
|
1066
|
-
multiplier: i.contract.lastMainGameBet.betMultiplier
|
|
1067
|
-
}
|
|
1068
|
-
},
|
|
1069
|
-
balance: {
|
|
1070
|
-
coins: i.contract.balanceInCoins,
|
|
1071
|
-
version: i.contract.balanceVersion
|
|
1072
|
-
},
|
|
1073
|
-
freeRounds: (t.freeRounds ?? []).map((e) => ({
|
|
1074
|
-
conf: {
|
|
1075
|
-
base: e.conf.baseBet,
|
|
1076
|
-
multiplier: e.conf.betMultiplier,
|
|
1077
|
-
numAwarded: e.conf.numAwarded
|
|
1078
|
-
},
|
|
1079
|
-
data: {
|
|
1080
|
-
numPlayed: e.data.numPlayed,
|
|
1081
|
-
win: e.data.winAmount,
|
|
1082
|
-
numLeft: e.data.numLeft
|
|
1083
|
-
},
|
|
1084
|
-
id: e.id,
|
|
1085
|
-
rejectable: e.rejectable,
|
|
1086
|
-
skippable: e.skippable,
|
|
1087
|
-
status: e.status,
|
|
1088
|
-
type: e.type
|
|
1089
|
-
})),
|
|
1090
|
-
serverTime: i.contract.serverTime,
|
|
1091
|
-
roundId: i.contract.roundId,
|
|
1092
|
-
stateType: {
|
|
1093
|
-
thisRound: i.contract.stateTypeThisRound,
|
|
1094
|
-
nextRound: i.contract.stateTypeNextRound
|
|
1095
|
-
},
|
|
1096
|
-
uiMessages: i.contract.uiMessages,
|
|
1097
|
-
win: {
|
|
1098
|
-
round: i.contract.roundWin,
|
|
1099
|
-
total: i.contract.totalWin
|
|
1100
|
-
}
|
|
1101
|
-
},
|
|
1102
|
-
data: i.opaqueGameServerToUi
|
|
1103
|
-
};
|
|
1104
|
-
}
|
|
1105
|
-
function oi(i) {
|
|
1106
|
-
var t, e;
|
|
1107
|
-
return {
|
|
1108
|
-
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
1109
|
-
code: ((t = i.data) == null ? void 0 : t.code) ?? De.UNKNOWN,
|
|
1110
|
-
details: (e = i.data) == null ? void 0 : e.details
|
|
1111
|
-
};
|
|
1112
|
-
}
|
|
1113
|
-
const ri = {
|
|
1114
|
-
bul: "bg",
|
|
1115
|
-
chi: "zh",
|
|
1116
|
-
zho: "zh",
|
|
1117
|
-
hrv: "hr",
|
|
1118
|
-
cze: "cs",
|
|
1119
|
-
dan: "da",
|
|
1120
|
-
dut: "nl",
|
|
1121
|
-
eng: "en",
|
|
1122
|
-
est: "et",
|
|
1123
|
-
fin: "fi",
|
|
1124
|
-
fra: "fr",
|
|
1125
|
-
ger: "de",
|
|
1126
|
-
gre: "el",
|
|
1127
|
-
hun: "hu",
|
|
1128
|
-
ind: "id",
|
|
1129
|
-
ita: "it",
|
|
1130
|
-
jpn: "ja",
|
|
1131
|
-
kor: "ko",
|
|
1132
|
-
nor: "no",
|
|
1133
|
-
pol: "pl",
|
|
1134
|
-
por: "pt",
|
|
1135
|
-
rum: "ro",
|
|
1136
|
-
rus: "ru",
|
|
1137
|
-
srp: "sr",
|
|
1138
|
-
slo: "sk",
|
|
1139
|
-
spa: "es",
|
|
1140
|
-
swe: "sv",
|
|
1141
|
-
tha: "th",
|
|
1142
|
-
tur: "tr",
|
|
1143
|
-
ukr: "uk",
|
|
1144
|
-
vie: "vi"
|
|
1145
|
-
}, ci = U("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
|
|
1146
|
-
class Vi extends Xt {
|
|
1147
|
-
constructor(...e) {
|
|
1148
|
-
super(...e);
|
|
1149
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1150
|
-
// @ts-ignore
|
|
1151
|
-
p(this, "socket");
|
|
1152
|
-
this.on("openGame", async () => {
|
|
1153
|
-
try {
|
|
1154
|
-
const s = await this.openGame();
|
|
1155
|
-
this.send("openGameResponse", s);
|
|
1156
|
-
} catch (s) {
|
|
1157
|
-
this.send("openGameError", s);
|
|
1158
|
-
}
|
|
1159
|
-
}), this.on("play", async (s) => {
|
|
1160
|
-
try {
|
|
1161
|
-
const n = await this.play(s);
|
|
1162
|
-
this.send("playResponse", n);
|
|
1163
|
-
} catch (n) {
|
|
1164
|
-
this.send("playError", n);
|
|
1165
|
-
}
|
|
1166
|
-
}), this.on("freeRounds", async (s) => {
|
|
1167
|
-
try {
|
|
1168
|
-
await this.socket.freeRounds(s), this.send("freeRoundsResponse", s);
|
|
1169
|
-
} catch (n) {
|
|
1170
|
-
this.send("freeRoundsError", n);
|
|
1171
|
-
}
|
|
1172
|
-
}), this.on("configured", (s) => {
|
|
1173
|
-
this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs);
|
|
1174
|
-
}), this.registerFromSdkEvents();
|
|
1175
|
-
}
|
|
1176
|
-
initialize(e) {
|
|
1177
|
-
this.socket = new ei(e, {
|
|
1178
|
-
gameVersion: this.config.gameVersion,
|
|
1179
|
-
requestTimeoutMs: this.sdkConfig.ui.requestTimeoutMs
|
|
1180
|
-
}), this.socket.addEventListener("close", (s) => {
|
|
1181
|
-
s.code === 1006 && this.reconnect(e);
|
|
1182
|
-
}), document.addEventListener("visibilitychange", () => {
|
|
1183
|
-
document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(e);
|
|
1184
|
-
}), this.socket.addEventListener("error", (s) => ci("error", s)), this.socket.addEventListener("realityCheck", (s) => {
|
|
1185
|
-
this.send("realityCheck", s);
|
|
1186
|
-
});
|
|
1187
|
-
}
|
|
1188
|
-
async reconnect(e) {
|
|
1189
|
-
this.initialize(e), await this.socket.connect(), await this.socket.authenticate(!0), await this.socket.openGame();
|
|
1190
|
-
}
|
|
1191
|
-
async openGame() {
|
|
1192
|
-
const e = new URLSearchParams(window.location.search), s = e.get("apiUrl"), n = e.get("cageCode"), o = e.get("gameCode"), a = e.get("operatorCode"), h = e.get("playMode"), g = e.get("token"), w = e.get("username"), m = e.get("gameHistoryUrl"), C = e.get("homeUrl") ?? void 0, N = e.get("cashierUrl") ?? void 0;
|
|
1193
|
-
this.initialize({ apiUrl: s, cageCode: n, gameCode: o, operatorCode: a, playMode: h, token: g, username: w });
|
|
1194
|
-
try {
|
|
1195
|
-
await this.socket.connect();
|
|
1196
|
-
} catch {
|
|
1197
|
-
throw { type: "error", data: { code: De.CONNECTION_ERROR } };
|
|
1198
|
-
}
|
|
1199
|
-
let Q;
|
|
1200
|
-
try {
|
|
1201
|
-
Q = await this.socket.authenticate();
|
|
1202
|
-
} catch (B) {
|
|
1203
|
-
throw { type: B.type, data: B.type === "error" ? ii(B.data) : void 0 };
|
|
1204
|
-
}
|
|
1205
|
-
let X;
|
|
1206
|
-
try {
|
|
1207
|
-
X = await this.socket.openGame();
|
|
1208
|
-
} catch (B) {
|
|
1209
|
-
throw { type: B.type, data: B.type === "error" ? ni(B.data) : void 0 };
|
|
1210
|
-
}
|
|
1211
|
-
const L = ti(Q), he = si(Q, X);
|
|
1212
|
-
this.sdkConfig.api = {
|
|
1213
|
-
brand: n,
|
|
1214
|
-
game: o,
|
|
1215
|
-
integration: a,
|
|
1216
|
-
jurisdiction: L.contract.jurisdiction,
|
|
1217
|
-
playMode: h,
|
|
1218
|
-
user: L.contract.username,
|
|
1219
|
-
integrationData: {
|
|
1220
|
-
token: g
|
|
1221
|
-
},
|
|
1222
|
-
country: L.contract.country,
|
|
1223
|
-
currency: L.contract.currency,
|
|
1224
|
-
coinValueInCents: L.contract.coinValueInCents,
|
|
1225
|
-
gameHistoryUrl: m,
|
|
1226
|
-
homeUrl: C,
|
|
1227
|
-
cashierUrl: N,
|
|
1228
|
-
sessionId: he.contract.sessionId,
|
|
1229
|
-
lastRoundId: he.contract.roundId
|
|
1230
|
-
};
|
|
1231
|
-
const x = e.get("languageCode");
|
|
1232
|
-
return x && (this.sdkConfig.ui.language = x.length === 3 ? ri[x] ?? x : x), he;
|
|
1233
|
-
}
|
|
1234
|
-
async play(e) {
|
|
1235
|
-
const {
|
|
1236
|
-
contract: { bet: s, forcedOutcomes: n, ...o },
|
|
1237
|
-
extra: a,
|
|
1238
|
-
payloadToInject: h,
|
|
1239
|
-
actionType: g
|
|
1240
|
-
} = e, w = {
|
|
1241
|
-
bet: s ? { baseBet: s.base, betMultiplier: s.multiplier } : void 0,
|
|
1242
|
-
forcedOutcomes: n,
|
|
1243
|
-
// TODO: get rid of contractRest - it' a legacy from old RGS
|
|
1244
|
-
...o,
|
|
1245
|
-
...h,
|
|
1246
|
-
opaqueUiToGameServer: a
|
|
1247
|
-
};
|
|
1248
|
-
let m;
|
|
1249
|
-
try {
|
|
1250
|
-
m = await this.socket.sendAction(g, w);
|
|
1251
|
-
} catch (C) {
|
|
1252
|
-
throw { type: C.type, data: C.type === "error" ? oi(C.data) : void 0 };
|
|
1253
|
-
}
|
|
1254
|
-
return ai(m);
|
|
1255
|
-
}
|
|
1256
|
-
registerFromSdkEvents() {
|
|
1257
|
-
this.on("history", () => {
|
|
1258
|
-
const {
|
|
1259
|
-
api: { game: e, integration: s, integrationData: n, jurisdiction: o, user: a, gameHistoryUrl: h },
|
|
1260
|
-
ui: { language: g }
|
|
1261
|
-
} = this.sdkConfig, w = a.replace(/^user_/, "").replace(new RegExp(`_${s}$`), ""), m = new URL(h);
|
|
1262
|
-
m.searchParams.set("gameCode", e), m.searchParams.set("jurisdiction", o), m.searchParams.set("operatorCode", s), m.searchParams.set("token", n.token), m.searchParams.set("username", w), m.searchParams.set("languageCode", g), window.open(m.toString(), "_blank");
|
|
1263
|
-
});
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le = "object", Ze = "string", fe = "major", d = "model", r = "name", l = "type", u = "vendor", c = "version", S = "architecture", Z = "console", b = "mobile", f = "tablet", T = "smarttv", Y = "wearable", et = "embedded", gt = "user-agent", tt = 500, nt = "brands", W = "formFactor", at = "fullVersionList", ee = "platform", ot = "platformVersion", Ne = "bitness", q = "sec-ch-ua", li = q + "-full-version-list", ui = q + "-arch", hi = q + "-" + Ne, gi = q + "-form-factor", pi = q + "-" + b, wi = q + "-" + d, Ft = q + "-" + ee, mi = Ft + "-version", Rt = [nt, at, b, d, ee, ot, S, W, Ne], A = "browser", _ = "cpu", O = "device", F = "engine", P = "os", te = "result", Se = "Amazon", pe = "Apple", pt = "ASUS", wt = "BlackBerry", Ie = "Google", mt = "Huawei", bt = "Lenovo", je = "LG", Ue = "Microsoft", ft = "Motorola", Te = "Samsung", yt = "Sharp", Ae = "Sony", $e = "Xiaomi", Qe = "Zebra", K = "Mobile ", J = " Browser", Pe = "Chrome", bi = "Edge", we = "Firefox", me = "Opera", kt = "Facebook", vt = "Sogou", it = "Windows", fi = typeof window !== V, I = fi && window.navigator ? window.navigator : void 0, G = I && I.userAgentData ? I.userAgentData : void 0, yi = function(i, t) {
|
|
1267
|
-
var e = {};
|
|
1268
|
-
for (var s in i)
|
|
1269
|
-
e[s] = t[s] && t[s].length % 2 === 0 ? t[s].concat(i[s]) : i[s];
|
|
1270
|
-
return e;
|
|
1271
|
-
}, Ge = function(i) {
|
|
1272
|
-
for (var t = {}, e = 0; e < i.length; e++)
|
|
1273
|
-
t[i[e].toUpperCase()] = i[e];
|
|
1274
|
-
return t;
|
|
1275
|
-
}, st = function(i, t) {
|
|
1276
|
-
if (typeof i === le && i.length > 0) {
|
|
1277
|
-
for (var e in i)
|
|
1278
|
-
if (z(i[e]) == z(t))
|
|
1279
|
-
return !0;
|
|
1280
|
-
return !1;
|
|
1281
|
-
}
|
|
1282
|
-
return ue(i) ? z(t).indexOf(z(i)) !== -1 : !1;
|
|
1283
|
-
}, Et = function(i) {
|
|
1284
|
-
for (var t in i)
|
|
1285
|
-
return /^(browser|cpu|device|engine|os)$/.test(t);
|
|
1286
|
-
}, ue = function(i) {
|
|
1287
|
-
return typeof i === Ze;
|
|
1288
|
-
}, Xe = function(i) {
|
|
1289
|
-
if (i) {
|
|
1290
|
-
for (var t = [], e = j(/\\?\"/g, i).split(","), s = 0; s < e.length; s++)
|
|
1291
|
-
if (e[s].indexOf(";") > -1) {
|
|
1292
|
-
var n = ye(e[s]).split(";v=");
|
|
1293
|
-
t[s] = { brand: n[0], version: n[1] };
|
|
1294
|
-
} else
|
|
1295
|
-
t[s] = ye(e[s]);
|
|
1296
|
-
return t;
|
|
1297
|
-
}
|
|
1298
|
-
}, z = function(i) {
|
|
1299
|
-
return ue(i) ? i.toLowerCase() : i;
|
|
1300
|
-
}, Ke = function(i) {
|
|
1301
|
-
return ue(i) ? j(/[^\d\.]/g, i).split(".")[0] : void 0;
|
|
1302
|
-
}, R = function(i) {
|
|
1303
|
-
for (var t in i) {
|
|
1304
|
-
var e = i[t];
|
|
1305
|
-
typeof e == le && e.length == 2 ? this[e[0]] = e[1] : this[e] = void 0;
|
|
1306
|
-
}
|
|
1307
|
-
return this;
|
|
1308
|
-
}, j = function(i, t) {
|
|
1309
|
-
return ue(t) ? t.replace(i, de) : t;
|
|
1310
|
-
}, be = function(i) {
|
|
1311
|
-
return j(/\\?\"/g, i);
|
|
1312
|
-
}, ye = function(i, t) {
|
|
1313
|
-
if (ue(i))
|
|
1314
|
-
return i = j(/^\s\s*/, i), typeof t === V ? i : i.substring(0, tt);
|
|
1315
|
-
}, Ct = function(i, t) {
|
|
1316
|
-
if (!(!i || !t))
|
|
1317
|
-
for (var e = 0, s, n, o, a, h, g; e < t.length && !h; ) {
|
|
1318
|
-
var w = t[e], m = t[e + 1];
|
|
1319
|
-
for (s = n = 0; s < w.length && !h && w[s]; )
|
|
1320
|
-
if (h = w[s++].exec(i), h)
|
|
1321
|
-
for (o = 0; o < m.length; o++)
|
|
1322
|
-
g = h[++n], a = m[o], typeof a === le && a.length > 0 ? a.length === 2 ? typeof a[1] == Ye ? this[a[0]] = a[1].call(this, g) : this[a[0]] = a[1] : a.length === 3 ? typeof a[1] === Ye && !(a[1].exec && a[1].test) ? this[a[0]] = g ? a[1].call(this, g, a[2]) : void 0 : this[a[0]] = g ? g.replace(a[1], a[2]) : void 0 : a.length === 4 && (this[a[0]] = g ? a[3].call(this, g.replace(a[1], a[2])) : void 0) : this[a] = g || void 0;
|
|
1323
|
-
e += 2;
|
|
1324
|
-
}
|
|
1325
|
-
}, Be = function(i, t) {
|
|
654
|
+
}, Le = function(s, t) {
|
|
1326
655
|
for (var e in t)
|
|
1327
|
-
if (typeof t[e] ===
|
|
1328
|
-
for (var
|
|
1329
|
-
if (
|
|
656
|
+
if (typeof t[e] === de && t[e].length > 0) {
|
|
657
|
+
for (var i = 0; i < t[e].length; i++)
|
|
658
|
+
if (at(t[e][i], s))
|
|
1330
659
|
return e === ht ? void 0 : e;
|
|
1331
|
-
} else if (
|
|
660
|
+
} else if (at(t[e], s))
|
|
1332
661
|
return e === ht ? void 0 : e;
|
|
1333
|
-
return t.hasOwnProperty("*") ? t["*"] :
|
|
662
|
+
return t.hasOwnProperty("*") ? t["*"] : s;
|
|
1334
663
|
}, Mt = {
|
|
1335
664
|
ME: "4.90",
|
|
1336
665
|
"NT 3.11": "NT3.51",
|
|
@@ -1348,7 +677,8 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1348
677
|
mobile: "Mobile",
|
|
1349
678
|
tablet: ["Tablet", "EInk"],
|
|
1350
679
|
smarttv: "TV",
|
|
1351
|
-
wearable:
|
|
680
|
+
wearable: "Watch",
|
|
681
|
+
xr: ["VR", "XR"],
|
|
1352
682
|
"?": ["Desktop", "Unknown"],
|
|
1353
683
|
"*": void 0
|
|
1354
684
|
}, It = {
|
|
@@ -1358,7 +688,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1358
688
|
/\b(?:crmo|crios)\/([\w\.]+)/i
|
|
1359
689
|
// Chrome for Android/iOS
|
|
1360
690
|
],
|
|
1361
|
-
[c, [r,
|
|
691
|
+
[c, [r, Q + "Chrome"]],
|
|
1362
692
|
[
|
|
1363
693
|
/edg(?:e|ios|a)?\/([\w\.]+)/i
|
|
1364
694
|
// Microsoft Edge
|
|
@@ -1378,17 +708,17 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1378
708
|
/opios[\/ ]+([\w\.]+)/i
|
|
1379
709
|
// Opera mini on iphone >= 8.0
|
|
1380
710
|
],
|
|
1381
|
-
[c, [r,
|
|
711
|
+
[c, [r, we + " Mini"]],
|
|
1382
712
|
[
|
|
1383
713
|
/\bop(?:rg)?x\/([\w\.]+)/i
|
|
1384
714
|
// Opera GX
|
|
1385
715
|
],
|
|
1386
|
-
[c, [r,
|
|
716
|
+
[c, [r, we + " GX"]],
|
|
1387
717
|
[
|
|
1388
718
|
/\bopr\/([\w\.]+)/i
|
|
1389
719
|
// Opera Webkit
|
|
1390
720
|
],
|
|
1391
|
-
[c, [r,
|
|
721
|
+
[c, [r, we]],
|
|
1392
722
|
[
|
|
1393
723
|
// Mixed
|
|
1394
724
|
/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
|
|
@@ -1398,22 +728,27 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1398
728
|
[
|
|
1399
729
|
/(kindle)\/([\w\.]+)/i,
|
|
1400
730
|
// Kindle
|
|
1401
|
-
/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
|
|
1402
|
-
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
|
|
731
|
+
/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,
|
|
732
|
+
// Lunascape/Maxthon/Netfront/Jasmine/Blazer/Sleipnir
|
|
1403
733
|
// Trident based
|
|
1404
734
|
/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,
|
|
1405
735
|
// Avant/IEMobile/SlimBrowser
|
|
1406
736
|
/(?:ms|\()(ie) ([\w\.]+)/i,
|
|
1407
737
|
// Internet Explorer
|
|
1408
738
|
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
|
|
1409
|
-
/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|
|
|
1410
|
-
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo
|
|
739
|
+
/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar)\/([-\w\.]+)/i,
|
|
740
|
+
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar
|
|
1411
741
|
/(heytap|ovi)browser\/([\d\.]+)/i,
|
|
1412
742
|
// HeyTap/Ovi
|
|
1413
743
|
/(weibo)__([\d\.]+)/i
|
|
1414
744
|
// Weibo
|
|
1415
745
|
],
|
|
1416
746
|
[r, c],
|
|
747
|
+
[
|
|
748
|
+
/\bddg\/([\w\.]+)/i
|
|
749
|
+
// DuckDuckGo
|
|
750
|
+
],
|
|
751
|
+
[c, [r, "DuckDuckGo"]],
|
|
1417
752
|
[
|
|
1418
753
|
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
|
|
1419
754
|
// UCBrowser
|
|
@@ -1446,7 +781,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1446
781
|
/slbrowser\/([\w\.]+)/i
|
|
1447
782
|
// Smart Lenovo Browser
|
|
1448
783
|
],
|
|
1449
|
-
[c, [r, "Smart " +
|
|
784
|
+
[c, [r, "Smart " + ft + J]],
|
|
1450
785
|
[
|
|
1451
786
|
/(avast|avg)\/([\w\.]+)/i
|
|
1452
787
|
// Avast/AVG Secure Browser
|
|
@@ -1456,12 +791,12 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1456
791
|
/\bfocus\/([\w\.]+)/i
|
|
1457
792
|
// Firefox Focus
|
|
1458
793
|
],
|
|
1459
|
-
[c, [r,
|
|
794
|
+
[c, [r, ge + " Focus"]],
|
|
1460
795
|
[
|
|
1461
796
|
/\bopt\/([\w\.]+)/i
|
|
1462
797
|
// Opera Touch
|
|
1463
798
|
],
|
|
1464
|
-
[c, [r,
|
|
799
|
+
[c, [r, we + " Touch"]],
|
|
1465
800
|
[
|
|
1466
801
|
/coc_coc\w+\/([\w\.]+)/i
|
|
1467
802
|
// Coc Coc Browser
|
|
@@ -1476,7 +811,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1476
811
|
/coast\/([\w\.]+)/i
|
|
1477
812
|
// Opera Coast
|
|
1478
813
|
],
|
|
1479
|
-
[c, [r,
|
|
814
|
+
[c, [r, we + " Coast"]],
|
|
1480
815
|
[
|
|
1481
816
|
/miuibrowser\/([\w\.]+)/i
|
|
1482
817
|
// MIUI Browser
|
|
@@ -1486,22 +821,27 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1486
821
|
/fxios\/([\w\.-]+)/i
|
|
1487
822
|
// Firefox for iOS
|
|
1488
823
|
],
|
|
1489
|
-
[c, [r,
|
|
824
|
+
[c, [r, Q + ge]],
|
|
1490
825
|
[
|
|
1491
826
|
/\bqihu|(qi?ho?o?|360)browser/i
|
|
1492
827
|
// 360
|
|
1493
828
|
],
|
|
1494
829
|
[[r, "360" + J]],
|
|
1495
830
|
[
|
|
1496
|
-
|
|
831
|
+
/\b(qq)\/([\w\.]+)/i
|
|
832
|
+
// QQ
|
|
833
|
+
],
|
|
834
|
+
[[r, /(.+)/, "$1Browser"], c],
|
|
835
|
+
[
|
|
836
|
+
/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i
|
|
1497
837
|
],
|
|
1498
838
|
[[r, /(.+)/, "$1" + J], c],
|
|
1499
839
|
[
|
|
1500
|
-
// Oculus/Sailfish/HuaweiBrowser/VivoBrowser
|
|
840
|
+
// Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser
|
|
1501
841
|
/samsungbrowser\/([\w\.]+)/i
|
|
1502
842
|
// Samsung Internet
|
|
1503
843
|
],
|
|
1504
|
-
[c, [r,
|
|
844
|
+
[c, [r, Se + " Internet"]],
|
|
1505
845
|
[
|
|
1506
846
|
/(comodo_dragon)\/([\w\.]+)/i
|
|
1507
847
|
// Comodo Dragon
|
|
@@ -1511,12 +851,12 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1511
851
|
/metasr[\/ ]?([\d\.]+)/i
|
|
1512
852
|
// Sogou Explorer
|
|
1513
853
|
],
|
|
1514
|
-
[c, [r,
|
|
854
|
+
[c, [r, Et + " Explorer"]],
|
|
1515
855
|
[
|
|
1516
856
|
/(sogou)mo\w+\/([\d\.]+)/i
|
|
1517
857
|
// Sogou Mobile
|
|
1518
858
|
],
|
|
1519
|
-
[[r,
|
|
859
|
+
[[r, Et + " Mobile"], c],
|
|
1520
860
|
[
|
|
1521
861
|
/(electron)\/([\w\.]+) safari/i,
|
|
1522
862
|
// Electron-based App
|
|
@@ -1527,8 +867,8 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1527
867
|
],
|
|
1528
868
|
[r, c],
|
|
1529
869
|
[
|
|
1530
|
-
/(lbbrowser)/i,
|
|
1531
|
-
// LieBao Browser
|
|
870
|
+
/(lbbrowser|rekonq)/i,
|
|
871
|
+
// LieBao Browser/Rekonq
|
|
1532
872
|
/\[(linkedin)app\]/i
|
|
1533
873
|
// LinkedIn App for iOS & Android
|
|
1534
874
|
],
|
|
@@ -1538,7 +878,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1538
878
|
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
|
|
1539
879
|
// Facebook App for iOS & Android
|
|
1540
880
|
],
|
|
1541
|
-
[[r,
|
|
881
|
+
[[r, vt], c],
|
|
1542
882
|
[
|
|
1543
883
|
/(Klarna)\/([\w\.]+)/i,
|
|
1544
884
|
// Klarna Shopping Browser for iOS & Android
|
|
@@ -1552,6 +892,8 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1552
892
|
// Line App for Android
|
|
1553
893
|
/(alipay)client\/([\w\.]+)/i,
|
|
1554
894
|
// Alipay
|
|
895
|
+
/(twitter)(?:and| f.+e\/([\w\.]+))/i,
|
|
896
|
+
// Twitter
|
|
1555
897
|
/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i
|
|
1556
898
|
// Chromium/Instagram/Snapchat
|
|
1557
899
|
],
|
|
@@ -1570,12 +912,12 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1570
912
|
/headlesschrome(?:\/([\w\.]+)| )/i
|
|
1571
913
|
// Chrome Headless
|
|
1572
914
|
],
|
|
1573
|
-
[c, [r,
|
|
915
|
+
[c, [r, Te + " Headless"]],
|
|
1574
916
|
[
|
|
1575
917
|
/ wv\).+(chrome)\/([\w\.]+)/i
|
|
1576
918
|
// Chrome WebView
|
|
1577
919
|
],
|
|
1578
|
-
[[r,
|
|
920
|
+
[[r, Te + " WebView"], c],
|
|
1579
921
|
[
|
|
1580
922
|
/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
|
|
1581
923
|
// Android Browser
|
|
@@ -1585,7 +927,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1585
927
|
/chrome\/([\w\.]+) mobile/i
|
|
1586
928
|
// Chrome Mobile
|
|
1587
929
|
],
|
|
1588
|
-
[c, [r,
|
|
930
|
+
[c, [r, Q + "Chrome"]],
|
|
1589
931
|
[
|
|
1590
932
|
/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
|
|
1591
933
|
// Chrome/OmniWeb/Arora/Tizen/Nokia
|
|
@@ -1595,11 +937,11 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1595
937
|
/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i
|
|
1596
938
|
// Safari Mobile
|
|
1597
939
|
],
|
|
1598
|
-
[c, [r,
|
|
940
|
+
[c, [r, Q + "Safari"]],
|
|
1599
941
|
[
|
|
1600
942
|
/iphone .*mobile(?:\/\w+ | ?)safari/i
|
|
1601
943
|
],
|
|
1602
|
-
[[r,
|
|
944
|
+
[[r, Q + "Safari"]],
|
|
1603
945
|
[
|
|
1604
946
|
/version\/([\w\.\,]+) .*(safari)/i
|
|
1605
947
|
// Safari
|
|
@@ -1619,24 +961,29 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1619
961
|
/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i
|
|
1620
962
|
// Firefox Mobile
|
|
1621
963
|
],
|
|
1622
|
-
[[r,
|
|
964
|
+
[[r, Q + ge], c],
|
|
1623
965
|
[
|
|
1624
966
|
/(navigator|netscape\d?)\/([-\w\.]+)/i
|
|
1625
967
|
// Netscape
|
|
1626
968
|
],
|
|
1627
969
|
[[r, "Netscape"], c],
|
|
970
|
+
[
|
|
971
|
+
/(wolvic)\/([\w\.]+)/i
|
|
972
|
+
// Wolvic
|
|
973
|
+
],
|
|
974
|
+
[r, c],
|
|
1628
975
|
[
|
|
1629
976
|
/mobile vr; rv:([\w\.]+)\).+firefox/i
|
|
1630
977
|
// Firefox Reality
|
|
1631
978
|
],
|
|
1632
|
-
[c, [r,
|
|
979
|
+
[c, [r, ge + " Reality"]],
|
|
1633
980
|
[
|
|
1634
981
|
/ekiohf.+(flow)\/([\w\.]+)/i,
|
|
1635
982
|
// Flow
|
|
1636
983
|
/(swiftfox)/i,
|
|
1637
984
|
// Swiftfox
|
|
1638
|
-
/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror
|
|
1639
|
-
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
|
|
985
|
+
/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,
|
|
986
|
+
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
|
|
1640
987
|
/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
|
|
1641
988
|
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
|
|
1642
989
|
/(firefox)\/([\w\.]+)/i,
|
|
@@ -1644,19 +991,17 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1644
991
|
/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
|
|
1645
992
|
// Mozilla
|
|
1646
993
|
// Other
|
|
1647
|
-
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|
|
|
1648
|
-
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/
|
|
1649
|
-
/(links) \(([\w\.]+)/i
|
|
994
|
+
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
|
|
995
|
+
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Obigo/Mosaic/Go/ICE/UP.Browser
|
|
996
|
+
/(links) \(([\w\.]+)/i
|
|
1650
997
|
// Links
|
|
1651
|
-
/panasonic;(viera)/i
|
|
1652
|
-
// Panasonic Viera
|
|
1653
998
|
],
|
|
1654
|
-
[r, c],
|
|
999
|
+
[r, [c, /_/g, "."]],
|
|
1655
1000
|
[
|
|
1656
1001
|
/(cobalt)\/([\w\.]+)/i
|
|
1657
1002
|
// Cobalt
|
|
1658
1003
|
],
|
|
1659
|
-
[r, [c, /[^\d\.]+./,
|
|
1004
|
+
[r, [c, /[^\d\.]+./, ce]]
|
|
1660
1005
|
],
|
|
1661
1006
|
cpu: [
|
|
1662
1007
|
[
|
|
@@ -1690,7 +1035,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1690
1035
|
/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
|
|
1691
1036
|
// PowerPC
|
|
1692
1037
|
],
|
|
1693
|
-
[[S, /ower/,
|
|
1038
|
+
[[S, /ower/, ce, z]],
|
|
1694
1039
|
[
|
|
1695
1040
|
/(sun4\w)[;\)]/i
|
|
1696
1041
|
// SPARC
|
|
@@ -1710,45 +1055,45 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1710
1055
|
// Samsung
|
|
1711
1056
|
/\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
|
|
1712
1057
|
],
|
|
1713
|
-
[
|
|
1058
|
+
[l, [u, Se], [d, f]],
|
|
1714
1059
|
[
|
|
1715
1060
|
/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
|
|
1716
1061
|
/samsung[- ]([-\w]+)/i,
|
|
1717
1062
|
/sec-(sgh\w+)/i
|
|
1718
1063
|
],
|
|
1719
|
-
[
|
|
1064
|
+
[l, [u, Se], [d, b]],
|
|
1720
1065
|
[
|
|
1721
1066
|
// Apple
|
|
1722
1067
|
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
|
|
1723
1068
|
// iPod/iPhone
|
|
1724
1069
|
],
|
|
1725
|
-
[
|
|
1070
|
+
[l, [u, pe], [d, b]],
|
|
1726
1071
|
[
|
|
1727
1072
|
/\((ipad);[-\w\),; ]+apple/i,
|
|
1728
1073
|
// iPad
|
|
1729
1074
|
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
|
1730
1075
|
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
|
|
1731
1076
|
],
|
|
1732
|
-
[
|
|
1077
|
+
[l, [u, pe], [d, f]],
|
|
1733
1078
|
[
|
|
1734
1079
|
/(macintosh);/i
|
|
1735
1080
|
],
|
|
1736
|
-
[
|
|
1081
|
+
[l, [u, pe]],
|
|
1737
1082
|
[
|
|
1738
1083
|
// Sharp
|
|
1739
1084
|
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
|
|
1740
1085
|
],
|
|
1741
|
-
[
|
|
1086
|
+
[l, [u, kt], [d, b]],
|
|
1742
1087
|
[
|
|
1743
1088
|
// Huawei
|
|
1744
1089
|
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
|
|
1745
1090
|
],
|
|
1746
|
-
[
|
|
1091
|
+
[l, [u, bt], [d, f]],
|
|
1747
1092
|
[
|
|
1748
1093
|
/(?:huawei|honor)([-\w ]+)[;\)]/i,
|
|
1749
1094
|
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
|
|
1750
1095
|
],
|
|
1751
|
-
[
|
|
1096
|
+
[l, [u, bt], [d, b]],
|
|
1752
1097
|
[
|
|
1753
1098
|
// Xiaomi
|
|
1754
1099
|
/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
|
|
@@ -1764,92 +1109,96 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1764
1109
|
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
|
|
1765
1110
|
// Xiaomi Mi
|
|
1766
1111
|
],
|
|
1767
|
-
[[
|
|
1112
|
+
[[l, /_/g, " "], [u, Xe], [d, b]],
|
|
1768
1113
|
[
|
|
1769
1114
|
/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
|
|
1770
1115
|
// Redmi Pad
|
|
1771
1116
|
/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
|
|
1772
1117
|
// Mi Pad tablets
|
|
1773
1118
|
],
|
|
1774
|
-
[[
|
|
1119
|
+
[[l, /_/g, " "], [u, Xe], [d, f]],
|
|
1775
1120
|
[
|
|
1776
1121
|
// OPPO
|
|
1777
1122
|
/; (\w+) bui.+ oppo/i,
|
|
1778
1123
|
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
|
|
1779
1124
|
],
|
|
1780
|
-
[
|
|
1125
|
+
[l, [u, "OPPO"], [d, b]],
|
|
1126
|
+
[
|
|
1127
|
+
/\b(opd2\d{3}a?) bui/i
|
|
1128
|
+
],
|
|
1129
|
+
[l, [u, "OPPO"], [d, f]],
|
|
1781
1130
|
[
|
|
1782
1131
|
// Vivo
|
|
1783
1132
|
/vivo (\w+)(?: bui|\))/i,
|
|
1784
1133
|
/\b(v[12]\d{3}\w?[at])(?: bui|;)/i
|
|
1785
1134
|
],
|
|
1786
|
-
[
|
|
1135
|
+
[l, [u, "Vivo"], [d, b]],
|
|
1787
1136
|
[
|
|
1788
1137
|
// Realme
|
|
1789
1138
|
/\b(rmx[1-3]\d{3})(?: bui|;|\))/i
|
|
1790
1139
|
],
|
|
1791
|
-
[
|
|
1140
|
+
[l, [u, "Realme"], [d, b]],
|
|
1792
1141
|
[
|
|
1793
1142
|
// Motorola
|
|
1794
1143
|
/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
|
|
1795
1144
|
/\bmot(?:orola)?[- ](\w*)/i,
|
|
1796
1145
|
/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
|
|
1797
1146
|
],
|
|
1798
|
-
[
|
|
1147
|
+
[l, [u, yt], [d, b]],
|
|
1799
1148
|
[
|
|
1800
1149
|
/\b(mz60\d|xoom[2 ]{0,2}) build\//i
|
|
1801
1150
|
],
|
|
1802
|
-
[
|
|
1151
|
+
[l, [u, yt], [d, f]],
|
|
1803
1152
|
[
|
|
1804
1153
|
// LG
|
|
1805
1154
|
/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
|
|
1806
1155
|
],
|
|
1807
|
-
[
|
|
1156
|
+
[l, [u, je], [d, f]],
|
|
1808
1157
|
[
|
|
1809
1158
|
/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
|
|
1810
1159
|
/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
|
|
1811
1160
|
/\blg-?([\d\w]+) bui/i
|
|
1812
1161
|
],
|
|
1813
|
-
[
|
|
1162
|
+
[l, [u, je], [d, b]],
|
|
1814
1163
|
[
|
|
1815
1164
|
// Lenovo
|
|
1816
1165
|
/(ideatab[-\w ]+)/i,
|
|
1817
1166
|
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
|
|
1818
1167
|
],
|
|
1819
|
-
[
|
|
1168
|
+
[l, [u, ft], [d, f]],
|
|
1820
1169
|
[
|
|
1821
1170
|
// Nokia
|
|
1822
1171
|
/(?:maemo|nokia).*(n900|lumia \d+)/i,
|
|
1823
1172
|
/nokia[-_ ]?([-\w\.]*)/i
|
|
1824
1173
|
],
|
|
1825
|
-
[[
|
|
1174
|
+
[[l, /_/g, " "], [u, "Nokia"], [d, b]],
|
|
1826
1175
|
[
|
|
1827
1176
|
// Google
|
|
1828
1177
|
/(pixel c)\b/i
|
|
1829
1178
|
// Google Pixel C
|
|
1830
1179
|
],
|
|
1831
|
-
[
|
|
1180
|
+
[l, [u, Me], [d, f]],
|
|
1832
1181
|
[
|
|
1833
1182
|
/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
|
|
1834
1183
|
// Google Pixel
|
|
1835
1184
|
],
|
|
1836
|
-
[
|
|
1185
|
+
[l, [u, Me], [d, b]],
|
|
1837
1186
|
[
|
|
1838
1187
|
// Sony
|
|
1839
1188
|
/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
|
|
1840
1189
|
],
|
|
1841
|
-
[
|
|
1190
|
+
[l, [u, Ie], [d, b]],
|
|
1842
1191
|
[
|
|
1843
1192
|
/sony tablet [ps]/i,
|
|
1844
1193
|
/\b(?:sony)?sgp\w+(?: bui|\))/i
|
|
1845
1194
|
],
|
|
1846
|
-
[[
|
|
1195
|
+
[[l, "Xperia Tablet"], [u, Ie], [d, f]],
|
|
1847
1196
|
[
|
|
1848
1197
|
// OnePlus
|
|
1849
1198
|
/ (kb2005|in20[12]5|be20[12][59])\b/i,
|
|
1850
1199
|
/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
|
|
1851
1200
|
],
|
|
1852
|
-
[
|
|
1201
|
+
[l, [u, "OnePlus"], [d, b]],
|
|
1853
1202
|
[
|
|
1854
1203
|
// Amazon
|
|
1855
1204
|
/(alexa)webm/i,
|
|
@@ -1858,39 +1207,39 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1858
1207
|
/(kf[a-z]+)( bui|\)).+silk\//i
|
|
1859
1208
|
// Kindle Fire HD
|
|
1860
1209
|
],
|
|
1861
|
-
[
|
|
1210
|
+
[l, [u, Ce], [d, f]],
|
|
1862
1211
|
[
|
|
1863
1212
|
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
|
|
1864
1213
|
// Fire Phone
|
|
1865
1214
|
],
|
|
1866
|
-
[[
|
|
1215
|
+
[[l, /(.+)/g, "Fire Phone $1"], [u, Ce], [d, b]],
|
|
1867
1216
|
[
|
|
1868
1217
|
// BlackBerry
|
|
1869
1218
|
/(playbook);[-\w\),; ]+(rim)/i
|
|
1870
1219
|
// BlackBerry PlayBook
|
|
1871
1220
|
],
|
|
1872
|
-
[
|
|
1221
|
+
[l, u, [d, f]],
|
|
1873
1222
|
[
|
|
1874
1223
|
/\b((?:bb[a-f]|st[hv])100-\d)/i,
|
|
1875
1224
|
/\(bb10; (\w+)/i
|
|
1876
1225
|
// BlackBerry 10
|
|
1877
1226
|
],
|
|
1878
|
-
[
|
|
1227
|
+
[l, [u, mt], [d, b]],
|
|
1879
1228
|
[
|
|
1880
1229
|
// Asus
|
|
1881
1230
|
/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
|
|
1882
1231
|
],
|
|
1883
|
-
[
|
|
1232
|
+
[l, [u, wt], [d, f]],
|
|
1884
1233
|
[
|
|
1885
1234
|
/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
|
|
1886
1235
|
],
|
|
1887
|
-
[
|
|
1236
|
+
[l, [u, wt], [d, b]],
|
|
1888
1237
|
[
|
|
1889
1238
|
// HTC
|
|
1890
1239
|
/(nexus 9)/i
|
|
1891
1240
|
// HTC Nexus 9
|
|
1892
1241
|
],
|
|
1893
|
-
[
|
|
1242
|
+
[l, [u, "HTC"], [d, f]],
|
|
1894
1243
|
[
|
|
1895
1244
|
/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
|
|
1896
1245
|
// HTC
|
|
@@ -1899,23 +1248,23 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1899
1248
|
/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
|
|
1900
1249
|
// Alcatel/GeeksPhone/Nexian/Panasonic/Sony
|
|
1901
1250
|
],
|
|
1902
|
-
[u, [
|
|
1251
|
+
[u, [l, /_/g, " "], [d, b]],
|
|
1903
1252
|
[
|
|
1904
1253
|
// Acer
|
|
1905
1254
|
/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
|
|
1906
1255
|
],
|
|
1907
|
-
[
|
|
1256
|
+
[l, [u, "Acer"], [d, f]],
|
|
1908
1257
|
[
|
|
1909
1258
|
// Meizu
|
|
1910
1259
|
/droid.+; (m[1-5] note) bui/i,
|
|
1911
1260
|
/\bmz-([-\w]{2,})/i
|
|
1912
1261
|
],
|
|
1913
|
-
[
|
|
1262
|
+
[l, [u, "Meizu"], [d, b]],
|
|
1914
1263
|
[
|
|
1915
1264
|
// Ulefone
|
|
1916
1265
|
/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
|
|
1917
1266
|
],
|
|
1918
|
-
[
|
|
1267
|
+
[l, [u, "Ulefone"], [d, b]],
|
|
1919
1268
|
[
|
|
1920
1269
|
// MIXED
|
|
1921
1270
|
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
|
|
@@ -1933,7 +1282,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1933
1282
|
/(oppo) ?([\w ]+) bui/i
|
|
1934
1283
|
// OPPO
|
|
1935
1284
|
],
|
|
1936
|
-
[u,
|
|
1285
|
+
[u, l, [d, b]],
|
|
1937
1286
|
[
|
|
1938
1287
|
/(kobo)\s(ereader|touch)/i,
|
|
1939
1288
|
// Kobo
|
|
@@ -1944,41 +1293,41 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1944
1293
|
/(kindle)\/([\w\.]+)/i
|
|
1945
1294
|
// Kindle
|
|
1946
1295
|
],
|
|
1947
|
-
[u,
|
|
1296
|
+
[u, l, [d, f]],
|
|
1948
1297
|
[
|
|
1949
1298
|
/(surface duo)/i
|
|
1950
1299
|
// Surface Duo
|
|
1951
1300
|
],
|
|
1952
|
-
[
|
|
1301
|
+
[l, [u, Re], [d, f]],
|
|
1953
1302
|
[
|
|
1954
1303
|
/droid [\d\.]+; (fp\du?)(?: b|\))/i
|
|
1955
1304
|
// Fairphone
|
|
1956
1305
|
],
|
|
1957
|
-
[
|
|
1306
|
+
[l, [u, "Fairphone"], [d, b]],
|
|
1958
1307
|
[
|
|
1959
1308
|
/(shield[\w ]+) b/i
|
|
1960
1309
|
// Nvidia Shield Tablets
|
|
1961
1310
|
],
|
|
1962
|
-
[
|
|
1311
|
+
[l, [u, "Nvidia"], [d, f]],
|
|
1963
1312
|
[
|
|
1964
1313
|
/(sprint) (\w+)/i
|
|
1965
1314
|
// Sprint Phones
|
|
1966
1315
|
],
|
|
1967
|
-
[u,
|
|
1316
|
+
[u, l, [d, b]],
|
|
1968
1317
|
[
|
|
1969
1318
|
/(kin\.[onetw]{3})/i
|
|
1970
1319
|
// Microsoft Kin
|
|
1971
1320
|
],
|
|
1972
|
-
[[
|
|
1321
|
+
[[l, /\./g, " "], [u, Re], [d, b]],
|
|
1973
1322
|
[
|
|
1974
1323
|
/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
|
|
1975
1324
|
// Zebra
|
|
1976
1325
|
],
|
|
1977
|
-
[
|
|
1326
|
+
[l, [u, Ke], [d, f]],
|
|
1978
1327
|
[
|
|
1979
1328
|
/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
|
|
1980
1329
|
],
|
|
1981
|
-
[
|
|
1330
|
+
[l, [u, Ke], [d, b]],
|
|
1982
1331
|
[
|
|
1983
1332
|
///////////////////
|
|
1984
1333
|
// SMARTTVS
|
|
@@ -1986,64 +1335,64 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
1986
1335
|
/smart-tv.+(samsung)/i
|
|
1987
1336
|
// Samsung
|
|
1988
1337
|
],
|
|
1989
|
-
[u, [
|
|
1338
|
+
[u, [d, T]],
|
|
1990
1339
|
[
|
|
1991
1340
|
/hbbtv.+maple;(\d+)/i
|
|
1992
1341
|
],
|
|
1993
|
-
[[
|
|
1342
|
+
[[l, /^/, "SmartTV"], [u, Se], [d, T]],
|
|
1994
1343
|
[
|
|
1995
1344
|
/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
|
|
1996
1345
|
// LG SmartTV
|
|
1997
1346
|
],
|
|
1998
|
-
[[u, je], [
|
|
1347
|
+
[[u, je], [d, T]],
|
|
1999
1348
|
[
|
|
2000
1349
|
/(apple) ?tv/i
|
|
2001
1350
|
// Apple TV
|
|
2002
1351
|
],
|
|
2003
|
-
[u, [
|
|
1352
|
+
[u, [l, pe + " TV"], [d, T]],
|
|
2004
1353
|
[
|
|
2005
1354
|
/crkey/i
|
|
2006
1355
|
// Google Chromecast
|
|
2007
1356
|
],
|
|
2008
|
-
[[
|
|
1357
|
+
[[l, Te + "cast"], [u, Me], [d, T]],
|
|
2009
1358
|
[
|
|
2010
1359
|
/droid.+aft(\w+)( bui|\))/i
|
|
2011
1360
|
// Fire TV
|
|
2012
1361
|
],
|
|
2013
|
-
[
|
|
1362
|
+
[l, [u, Ce], [d, T]],
|
|
2014
1363
|
[
|
|
2015
1364
|
/\(dtv[\);].+(aquos)/i,
|
|
2016
1365
|
/(aquos-tv[\w ]+)\)/i
|
|
2017
1366
|
// Sharp
|
|
2018
1367
|
],
|
|
2019
|
-
[
|
|
1368
|
+
[l, [u, kt], [d, T]],
|
|
2020
1369
|
[
|
|
2021
1370
|
/(bravia[\w ]+)( bui|\))/i
|
|
2022
1371
|
// Sony
|
|
2023
1372
|
],
|
|
2024
|
-
[
|
|
1373
|
+
[l, [u, Ie], [d, T]],
|
|
2025
1374
|
[
|
|
2026
1375
|
/(mitv-\w{5}) bui/i
|
|
2027
1376
|
// Xiaomi
|
|
2028
1377
|
],
|
|
2029
|
-
[
|
|
1378
|
+
[l, [u, Xe], [d, T]],
|
|
2030
1379
|
[
|
|
2031
1380
|
/Hbbtv.*(technisat) (.*);/i
|
|
2032
1381
|
// TechniSAT
|
|
2033
1382
|
],
|
|
2034
|
-
[u,
|
|
1383
|
+
[u, l, [d, T]],
|
|
2035
1384
|
[
|
|
2036
1385
|
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
|
|
2037
1386
|
// Roku
|
|
2038
1387
|
/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
|
|
2039
1388
|
// HbbTV devices
|
|
2040
1389
|
],
|
|
2041
|
-
[[u,
|
|
1390
|
+
[[u, fe], [l, fe], [d, T]],
|
|
2042
1391
|
[
|
|
2043
1392
|
/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
|
|
2044
1393
|
// SmartTV from Unidentified Vendors
|
|
2045
1394
|
],
|
|
2046
|
-
[[
|
|
1395
|
+
[[d, T]],
|
|
2047
1396
|
[
|
|
2048
1397
|
///////////////////
|
|
2049
1398
|
// CONSOLES
|
|
@@ -2053,22 +1402,22 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2053
1402
|
/(nintendo) (\w+)/i
|
|
2054
1403
|
// Nintendo
|
|
2055
1404
|
],
|
|
2056
|
-
[u,
|
|
1405
|
+
[u, l, [d, Y]],
|
|
2057
1406
|
[
|
|
2058
1407
|
/droid.+; (shield) bui/i
|
|
2059
1408
|
// Nvidia
|
|
2060
1409
|
],
|
|
2061
|
-
[
|
|
1410
|
+
[l, [u, "Nvidia"], [d, Y]],
|
|
2062
1411
|
[
|
|
2063
1412
|
/(playstation \w+)/i
|
|
2064
1413
|
// Playstation
|
|
2065
1414
|
],
|
|
2066
|
-
[
|
|
1415
|
+
[l, [u, Ie], [d, Y]],
|
|
2067
1416
|
[
|
|
2068
1417
|
/\b(xbox(?: one)?(?!; xbox))[\); ]/i
|
|
2069
1418
|
// Microsoft Xbox
|
|
2070
1419
|
],
|
|
2071
|
-
[
|
|
1420
|
+
[l, [u, Re], [d, Y]],
|
|
2072
1421
|
[
|
|
2073
1422
|
///////////////////
|
|
2074
1423
|
// WEARABLES
|
|
@@ -2076,26 +1425,29 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2076
1425
|
/((pebble))app/i
|
|
2077
1426
|
// Pebble
|
|
2078
1427
|
],
|
|
2079
|
-
[u,
|
|
1428
|
+
[u, l, [d, xe]],
|
|
2080
1429
|
[
|
|
2081
1430
|
/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
|
|
2082
1431
|
// Apple Watch
|
|
2083
1432
|
],
|
|
2084
|
-
[
|
|
1433
|
+
[l, [u, pe], [d, xe]],
|
|
2085
1434
|
[
|
|
2086
|
-
/droid.+; (
|
|
2087
|
-
// Google Glass
|
|
1435
|
+
/droid.+; (wt63?0{2,3})\)/i
|
|
2088
1436
|
],
|
|
2089
|
-
[
|
|
1437
|
+
[l, [u, Ke], [d, xe]],
|
|
2090
1438
|
[
|
|
2091
|
-
|
|
1439
|
+
///////////////////
|
|
1440
|
+
// XR
|
|
1441
|
+
///////////////////
|
|
1442
|
+
/droid.+; (glass) \d/i
|
|
1443
|
+
// Google Glass
|
|
2092
1444
|
],
|
|
2093
|
-
[
|
|
1445
|
+
[l, [u, Me], [d, pt]],
|
|
2094
1446
|
[
|
|
2095
|
-
/(quest(
|
|
1447
|
+
/(quest( \d| pro)?)/i
|
|
2096
1448
|
// Oculus Quest
|
|
2097
1449
|
],
|
|
2098
|
-
[
|
|
1450
|
+
[l, [u, vt], [d, pt]],
|
|
2099
1451
|
[
|
|
2100
1452
|
///////////////////
|
|
2101
1453
|
// EMBEDDED
|
|
@@ -2103,12 +1455,12 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2103
1455
|
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
|
|
2104
1456
|
// Tesla
|
|
2105
1457
|
],
|
|
2106
|
-
[u, [
|
|
1458
|
+
[u, [d, it]],
|
|
2107
1459
|
[
|
|
2108
1460
|
/(aeobc)\b/i
|
|
2109
1461
|
// Echo Dot
|
|
2110
1462
|
],
|
|
2111
|
-
[
|
|
1463
|
+
[l, [u, Ce], [d, it]],
|
|
2112
1464
|
[
|
|
2113
1465
|
////////////////////
|
|
2114
1466
|
// MIXED (GENERIC)
|
|
@@ -2116,34 +1468,34 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2116
1468
|
/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
|
|
2117
1469
|
// Android Phones from Unidentified Vendors
|
|
2118
1470
|
],
|
|
2119
|
-
[
|
|
1471
|
+
[l, [d, b]],
|
|
2120
1472
|
[
|
|
2121
1473
|
/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
|
|
2122
1474
|
// Android Tablets from Unidentified Vendors
|
|
2123
1475
|
],
|
|
2124
|
-
[
|
|
1476
|
+
[l, [d, f]],
|
|
2125
1477
|
[
|
|
2126
1478
|
/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
|
|
2127
1479
|
// Unidentifiable Tablet
|
|
2128
1480
|
],
|
|
2129
|
-
[[
|
|
1481
|
+
[[d, f]],
|
|
2130
1482
|
[
|
|
2131
1483
|
/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
|
|
2132
1484
|
// Unidentifiable Mobile
|
|
2133
1485
|
],
|
|
2134
|
-
[[
|
|
1486
|
+
[[d, b]],
|
|
2135
1487
|
[
|
|
2136
1488
|
/(android[-\w\. ]{0,9});.+buil/i
|
|
2137
1489
|
// Generic Android Device
|
|
2138
1490
|
],
|
|
2139
|
-
[
|
|
1491
|
+
[l, [u, "Generic"]]
|
|
2140
1492
|
],
|
|
2141
1493
|
engine: [
|
|
2142
1494
|
[
|
|
2143
1495
|
/windows.+ edge\/([\w\.]+)/i
|
|
2144
1496
|
// EdgeHTML
|
|
2145
1497
|
],
|
|
2146
|
-
[c, [r,
|
|
1498
|
+
[c, [r, ui + "HTML"]],
|
|
2147
1499
|
[
|
|
2148
1500
|
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
|
2149
1501
|
// Blink
|
|
@@ -2180,14 +1532,14 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2180
1532
|
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
|
|
2181
1533
|
// Windows Phone
|
|
2182
1534
|
],
|
|
2183
|
-
[r, [c,
|
|
1535
|
+
[r, [c, Le, Mt]],
|
|
2184
1536
|
[
|
|
2185
1537
|
/windows nt 6\.2; (arm)/i,
|
|
2186
1538
|
// Windows RT
|
|
2187
1539
|
/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
|
|
2188
1540
|
/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
|
|
2189
1541
|
],
|
|
2190
|
-
[[c,
|
|
1542
|
+
[[c, Le, Mt], [r, nt]],
|
|
2191
1543
|
[
|
|
2192
1544
|
// iOS/macOS
|
|
2193
1545
|
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
|
@@ -2223,7 +1575,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2223
1575
|
/\(bb(10);/i
|
|
2224
1576
|
// BlackBerry 10
|
|
2225
1577
|
],
|
|
2226
|
-
[c, [r,
|
|
1578
|
+
[c, [r, mt]],
|
|
2227
1579
|
[
|
|
2228
1580
|
/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
|
|
2229
1581
|
// Symbian
|
|
@@ -2233,7 +1585,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2233
1585
|
/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
|
|
2234
1586
|
// Firefox OS
|
|
2235
1587
|
],
|
|
2236
|
-
[c, [r,
|
|
1588
|
+
[c, [r, ge + " OS"]],
|
|
2237
1589
|
[
|
|
2238
1590
|
/web0s;.+rt(tv)/i,
|
|
2239
1591
|
/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
|
|
@@ -2250,7 +1602,7 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2250
1602
|
/crkey\/([\d\.]+)/i
|
|
2251
1603
|
// Google Chromecast
|
|
2252
1604
|
],
|
|
2253
|
-
[c, [r,
|
|
1605
|
+
[c, [r, Te + "cast"]],
|
|
2254
1606
|
[
|
|
2255
1607
|
/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
|
|
2256
1608
|
// Chromium OS
|
|
@@ -2305,262 +1657,959 @@ var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", V = "undefined", le
|
|
|
2305
1657
|
],
|
|
2306
1658
|
[r, c]
|
|
2307
1659
|
]
|
|
2308
|
-
},
|
|
2309
|
-
var
|
|
2310
|
-
return
|
|
2311
|
-
[A, [r, c,
|
|
2312
|
-
[
|
|
2313
|
-
[
|
|
2314
|
-
[
|
|
1660
|
+
}, Ae = function() {
|
|
1661
|
+
var s = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} };
|
|
1662
|
+
return F.call(s.init, [
|
|
1663
|
+
[A, [r, c, be, d]],
|
|
1664
|
+
[B, [S]],
|
|
1665
|
+
[x, [d, l, u]],
|
|
1666
|
+
[D, [r, c]],
|
|
2315
1667
|
[P, [r, c]]
|
|
2316
|
-
]),
|
|
2317
|
-
[A, [c,
|
|
2318
|
-
[
|
|
1668
|
+
]), F.call(s.isIgnore, [
|
|
1669
|
+
[A, [c, be]],
|
|
1670
|
+
[D, [c]],
|
|
2319
1671
|
[P, [c]]
|
|
2320
|
-
]),
|
|
1672
|
+
]), F.call(s.isIgnoreRgx, [
|
|
2321
1673
|
[A, / ?browser$/i],
|
|
2322
1674
|
[P, / ?os$/i]
|
|
2323
|
-
]),
|
|
1675
|
+
]), F.call(s.toString, [
|
|
2324
1676
|
[A, [r, c]],
|
|
2325
|
-
[
|
|
2326
|
-
[
|
|
2327
|
-
[
|
|
1677
|
+
[B, [S]],
|
|
1678
|
+
[x, [u, l]],
|
|
1679
|
+
[D, [r, c]],
|
|
2328
1680
|
[P, [r, c]]
|
|
2329
|
-
]),
|
|
2330
|
-
}(),
|
|
2331
|
-
var e =
|
|
1681
|
+
]), s;
|
|
1682
|
+
}(), gi = function(s, t) {
|
|
1683
|
+
var e = Ae.init[t], i = Ae.isIgnore[t] || 0, n = Ae.isIgnoreRgx[t] || 0, o = Ae.toString[t] || 0;
|
|
2332
1684
|
function a() {
|
|
2333
|
-
|
|
1685
|
+
F.call(this, e);
|
|
2334
1686
|
}
|
|
2335
1687
|
return a.prototype.getItem = function() {
|
|
2336
|
-
return
|
|
1688
|
+
return s;
|
|
2337
1689
|
}, a.prototype.withClientHints = function() {
|
|
2338
|
-
return G ? G.getHighEntropyValues(
|
|
2339
|
-
return
|
|
2340
|
-
}) :
|
|
1690
|
+
return G ? G.getHighEntropyValues(Nt).then(function(h) {
|
|
1691
|
+
return s.setCH(new Gt(h, !1)).parseCH().get();
|
|
1692
|
+
}) : s.parseCH().get();
|
|
2341
1693
|
}, a.prototype.withFeatureCheck = function() {
|
|
2342
|
-
return
|
|
2343
|
-
}, t !=
|
|
2344
|
-
var
|
|
1694
|
+
return s.detectFeature().get();
|
|
1695
|
+
}, t != ee && (a.prototype.is = function(h) {
|
|
1696
|
+
var p = !1;
|
|
2345
1697
|
for (var w in this)
|
|
2346
|
-
if (this.hasOwnProperty(w) && !
|
|
2347
|
-
if (
|
|
1698
|
+
if (this.hasOwnProperty(w) && !at(i, w) && z(n ? $(n, this[w]) : this[w]) == z(n ? $(n, h) : h)) {
|
|
1699
|
+
if (p = !0, h != V)
|
|
2348
1700
|
break;
|
|
2349
|
-
} else if (h == V &&
|
|
2350
|
-
|
|
1701
|
+
} else if (h == V && p) {
|
|
1702
|
+
p = !p;
|
|
2351
1703
|
break;
|
|
2352
1704
|
}
|
|
2353
|
-
return
|
|
2354
|
-
}, a.prototype.toString = function() {
|
|
2355
|
-
var h =
|
|
2356
|
-
for (var
|
|
2357
|
-
typeof this[o[
|
|
2358
|
-
return h || V;
|
|
2359
|
-
}), G || (a.prototype.then = function(h) {
|
|
2360
|
-
var
|
|
2361
|
-
for (var
|
|
2362
|
-
|
|
2363
|
-
};
|
|
2364
|
-
w.prototype = {
|
|
2365
|
-
is: a.prototype.is,
|
|
2366
|
-
toString: a.prototype.toString
|
|
2367
|
-
};
|
|
2368
|
-
var m = new w();
|
|
2369
|
-
return h(m), m;
|
|
2370
|
-
}), new a();
|
|
2371
|
-
};
|
|
2372
|
-
function
|
|
2373
|
-
if (
|
|
2374
|
-
|
|
2375
|
-
[
|
|
2376
|
-
[
|
|
2377
|
-
[b, /\?1/.test(
|
|
2378
|
-
[
|
|
2379
|
-
[
|
|
2380
|
-
[
|
|
2381
|
-
[S,
|
|
2382
|
-
[W,
|
|
2383
|
-
[
|
|
2384
|
-
]);
|
|
2385
|
-
else
|
|
2386
|
-
for (var e in
|
|
2387
|
-
this.hasOwnProperty(e) && typeof
|
|
1705
|
+
return p;
|
|
1706
|
+
}, a.prototype.toString = function() {
|
|
1707
|
+
var h = ce;
|
|
1708
|
+
for (var p in o)
|
|
1709
|
+
typeof this[o[p]] !== V && (h += (h ? " " : ce) + this[o[p]]);
|
|
1710
|
+
return h || V;
|
|
1711
|
+
}), G || (a.prototype.then = function(h) {
|
|
1712
|
+
var p = this, w = function() {
|
|
1713
|
+
for (var v in p)
|
|
1714
|
+
p.hasOwnProperty(v) && (this[v] = p[v]);
|
|
1715
|
+
};
|
|
1716
|
+
w.prototype = {
|
|
1717
|
+
is: a.prototype.is,
|
|
1718
|
+
toString: a.prototype.toString
|
|
1719
|
+
};
|
|
1720
|
+
var m = new w();
|
|
1721
|
+
return h(m), m;
|
|
1722
|
+
}), new a();
|
|
1723
|
+
};
|
|
1724
|
+
function Gt(s, t) {
|
|
1725
|
+
if (s = s || {}, F.call(this, Nt), t)
|
|
1726
|
+
F.call(this, [
|
|
1727
|
+
[ot, Qe(s[q])],
|
|
1728
|
+
[rt, Qe(s[ni])],
|
|
1729
|
+
[b, /\?1/.test(s[ci])],
|
|
1730
|
+
[l, me(s[di])],
|
|
1731
|
+
[Z, me(s[Ft])],
|
|
1732
|
+
[ct, me(s[li])],
|
|
1733
|
+
[S, me(s[ai])],
|
|
1734
|
+
[W, Qe(s[ri])],
|
|
1735
|
+
[Ge, me(s[oi])]
|
|
1736
|
+
]);
|
|
1737
|
+
else
|
|
1738
|
+
for (var e in s)
|
|
1739
|
+
this.hasOwnProperty(e) && typeof s[e] !== V && (this[e] = s[e]);
|
|
1740
|
+
}
|
|
1741
|
+
function Tt(s, t, e, i) {
|
|
1742
|
+
return this.get = function(n) {
|
|
1743
|
+
return n ? this.data.hasOwnProperty(n) ? this.data[n] : void 0 : this.data;
|
|
1744
|
+
}, this.set = function(n, o) {
|
|
1745
|
+
return this.data[n] = o, this;
|
|
1746
|
+
}, this.setCH = function(n) {
|
|
1747
|
+
return this.uaCH = n, this;
|
|
1748
|
+
}, this.detectFeature = function() {
|
|
1749
|
+
if (I && I.userAgent == this.ua)
|
|
1750
|
+
switch (this.itemType) {
|
|
1751
|
+
case A:
|
|
1752
|
+
I.brave && typeof I.brave.isBrave == et && this.set(r, "Brave");
|
|
1753
|
+
break;
|
|
1754
|
+
case x:
|
|
1755
|
+
!this.get(d) && G && G[b] && this.set(d, b), this.get(l) == "Macintosh" && I && typeof I.standalone !== V && I.maxTouchPoints && I.maxTouchPoints > 2 && this.set(l, "iPad").set(d, f);
|
|
1756
|
+
break;
|
|
1757
|
+
case P:
|
|
1758
|
+
!this.get(r) && G && G[Z] && this.set(r, G[Z]);
|
|
1759
|
+
break;
|
|
1760
|
+
case ee:
|
|
1761
|
+
var n = this.data, o = function(a) {
|
|
1762
|
+
return n[a].getItem().detectFeature().get();
|
|
1763
|
+
};
|
|
1764
|
+
this.set(A, o(A)).set(B, o(B)).set(x, o(x)).set(D, o(D)).set(P, o(P));
|
|
1765
|
+
}
|
|
1766
|
+
return this;
|
|
1767
|
+
}, this.parseUA = function() {
|
|
1768
|
+
return this.itemType != ee && Ct.call(this.data, this.ua, this.rgxMap), this.itemType == A && this.set(be, Je(this.get(c))), this;
|
|
1769
|
+
}, this.parseCH = function() {
|
|
1770
|
+
var n = this.uaCH, o = this.rgxMap;
|
|
1771
|
+
switch (this.itemType) {
|
|
1772
|
+
case A:
|
|
1773
|
+
var a = n[rt] || n[ot], h;
|
|
1774
|
+
if (a)
|
|
1775
|
+
for (var p in a) {
|
|
1776
|
+
var w = $(/(Google|Microsoft) /, a[p].brand || a[p]), m = a[p].version;
|
|
1777
|
+
!/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(r, w).set(c, m).set(be, Je(m)), h = w);
|
|
1778
|
+
}
|
|
1779
|
+
break;
|
|
1780
|
+
case B:
|
|
1781
|
+
var v = n[S];
|
|
1782
|
+
v && (v && n[Ge] == "64" && (v += "64"), Ct.call(this.data, v + ";", o));
|
|
1783
|
+
break;
|
|
1784
|
+
case x:
|
|
1785
|
+
if (n[b] && this.set(d, b), n[l] && this.set(l, n[l]), n[l] == "Xbox" && this.set(d, Y).set(u, Re), n[W]) {
|
|
1786
|
+
var N;
|
|
1787
|
+
if (typeof n[W] != "string")
|
|
1788
|
+
for (var X = 0; !N && X < n[W].length; )
|
|
1789
|
+
N = Le(n[W][X++], St);
|
|
1790
|
+
else
|
|
1791
|
+
N = Le(n[W], St);
|
|
1792
|
+
this.set(d, N);
|
|
1793
|
+
}
|
|
1794
|
+
break;
|
|
1795
|
+
case P:
|
|
1796
|
+
var K = n[Z];
|
|
1797
|
+
if (K) {
|
|
1798
|
+
var L = n[ct];
|
|
1799
|
+
K == nt && (L = parseInt(Je(L), 10) >= 13 ? "11" : "10"), this.set(r, K).set(c, L);
|
|
1800
|
+
}
|
|
1801
|
+
this.get(r) == nt && n[l] == "Xbox" && this.set(r, "Xbox").set(c, void 0);
|
|
1802
|
+
break;
|
|
1803
|
+
case ee:
|
|
1804
|
+
var ue = this.data, O = function(_) {
|
|
1805
|
+
return ue[_].getItem().setCH(n).parseCH().get();
|
|
1806
|
+
};
|
|
1807
|
+
this.set(A, O(A)).set(B, O(B)).set(x, O(x)).set(D, O(D)).set(P, O(P));
|
|
1808
|
+
}
|
|
1809
|
+
return this;
|
|
1810
|
+
}, F.call(this, [
|
|
1811
|
+
["itemType", s],
|
|
1812
|
+
["ua", t],
|
|
1813
|
+
["uaCH", i],
|
|
1814
|
+
["rgxMap", e],
|
|
1815
|
+
["data", gi(this, s)]
|
|
1816
|
+
]), this;
|
|
1817
|
+
}
|
|
1818
|
+
function R(s, t, e) {
|
|
1819
|
+
if (typeof s === de ? (Ue(s, !0) ? (typeof t === de && (e = t), t = s) : (e = s, t = void 0), s = void 0) : typeof s === tt && !Ue(t, !0) && (e = t, t = void 0), !(this instanceof R))
|
|
1820
|
+
return new R(s, t, e).getResult();
|
|
1821
|
+
var i = typeof s === tt ? s : (
|
|
1822
|
+
// Passed user-agent string
|
|
1823
|
+
I && I.userAgent ? I.userAgent : (
|
|
1824
|
+
// navigator.userAgent
|
|
1825
|
+
e && e[gt] ? e[gt] : (
|
|
1826
|
+
// User-Agent from passed headers
|
|
1827
|
+
ce
|
|
1828
|
+
)
|
|
1829
|
+
)
|
|
1830
|
+
), n = new Gt(e, !0), o = t ? pi(It, t) : It, a = function(h) {
|
|
1831
|
+
return h == ee ? function() {
|
|
1832
|
+
return new Tt(h, i, o, n).set("ua", i).set(A, this.getBrowser()).set(B, this.getCPU()).set(x, this.getDevice()).set(D, this.getEngine()).set(P, this.getOS()).get();
|
|
1833
|
+
} : function() {
|
|
1834
|
+
return new Tt(h, i, o[h], n).parseUA().get();
|
|
1835
|
+
};
|
|
1836
|
+
};
|
|
1837
|
+
return F.call(this, [
|
|
1838
|
+
["getBrowser", a(A)],
|
|
1839
|
+
["getCPU", a(B)],
|
|
1840
|
+
["getDevice", a(x)],
|
|
1841
|
+
["getEngine", a(D)],
|
|
1842
|
+
["getOS", a(P)],
|
|
1843
|
+
["getResult", a(ee)],
|
|
1844
|
+
["getUA", function() {
|
|
1845
|
+
return i;
|
|
1846
|
+
}],
|
|
1847
|
+
["setUA", function(h) {
|
|
1848
|
+
return le(h) && (i = h.length > st ? fe(h, st) : h), this;
|
|
1849
|
+
}]
|
|
1850
|
+
]).setUA(i), this;
|
|
1851
|
+
}
|
|
1852
|
+
R.VERSION = si;
|
|
1853
|
+
R.BROWSER = He([r, c, be, d]);
|
|
1854
|
+
R.CPU = He([S]);
|
|
1855
|
+
R.DEVICE = He([l, u, d, Y, b, T, f, xe, it]);
|
|
1856
|
+
R.ENGINE = R.OS = He([r, c]);
|
|
1857
|
+
class wi {
|
|
1858
|
+
constructor(t, e) {
|
|
1859
|
+
g(this, "config");
|
|
1860
|
+
g(this, "sdkConfig");
|
|
1861
|
+
this.config = t, this.sdkConfig = e;
|
|
1862
|
+
}
|
|
1863
|
+
on(t, e, i) {
|
|
1864
|
+
const n = function(a) {
|
|
1865
|
+
a.data.message !== `kalamba:wrapper-rgs:${t}` && a.data.message !== `kalamba:wrapper:${t}` || e(a.data.payload);
|
|
1866
|
+
};
|
|
1867
|
+
window.addEventListener("message", n, i);
|
|
1868
|
+
}
|
|
1869
|
+
send(t, ...[e]) {
|
|
1870
|
+
window.postMessage({
|
|
1871
|
+
message: `kalamba:rgs:${t}`,
|
|
1872
|
+
payload: e
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
class mi {
|
|
1877
|
+
constructor(t) {
|
|
1878
|
+
g(this, "socket", null);
|
|
1879
|
+
g(this, "webSocketUrl");
|
|
1880
|
+
g(this, "eventListeners", {
|
|
1881
|
+
close: [],
|
|
1882
|
+
error: [],
|
|
1883
|
+
message: []
|
|
1884
|
+
});
|
|
1885
|
+
g(this, "connect", async () => {
|
|
1886
|
+
const t = new WebSocket(this.webSocketUrl);
|
|
1887
|
+
return t.addEventListener("message", this.handleMessage), new Promise((e) => {
|
|
1888
|
+
t.addEventListener(
|
|
1889
|
+
"open",
|
|
1890
|
+
(i) => {
|
|
1891
|
+
this.handleOpen(i), e(this.socket);
|
|
1892
|
+
},
|
|
1893
|
+
{ once: !0 }
|
|
1894
|
+
);
|
|
1895
|
+
});
|
|
1896
|
+
});
|
|
1897
|
+
g(this, "send", (t) => {
|
|
1898
|
+
if (this.socket == null)
|
|
1899
|
+
throw new Error("Cannot send message, the WebSocket connection is not open");
|
|
1900
|
+
this.socket.send(t);
|
|
1901
|
+
});
|
|
1902
|
+
g(this, "close", () => {
|
|
1903
|
+
if (this.socket == null)
|
|
1904
|
+
throw new Error("Cannot close the WebSocket connection that is not open");
|
|
1905
|
+
this.socket.close();
|
|
1906
|
+
});
|
|
1907
|
+
g(this, "handleClose", (t) => {
|
|
1908
|
+
this.eventListeners.close.forEach((e) => {
|
|
1909
|
+
e(t);
|
|
1910
|
+
}), this.socket.removeEventListener("message", this.handleMessage), this.socket.removeEventListener("close", this.handleClose), this.socket.removeEventListener("error", this.handleError), this.socket = null;
|
|
1911
|
+
});
|
|
1912
|
+
g(this, "handleError", (t) => {
|
|
1913
|
+
this.eventListeners.error.forEach((e) => {
|
|
1914
|
+
e(t);
|
|
1915
|
+
});
|
|
1916
|
+
});
|
|
1917
|
+
g(this, "handleMessage", (t) => {
|
|
1918
|
+
this.eventListeners.message.forEach((e) => {
|
|
1919
|
+
e(t);
|
|
1920
|
+
});
|
|
1921
|
+
});
|
|
1922
|
+
g(this, "handleOpen", (t) => {
|
|
1923
|
+
const e = t.target;
|
|
1924
|
+
e.addEventListener("close", this.handleClose), e.addEventListener("error", this.handleError), this.socket = e;
|
|
1925
|
+
});
|
|
1926
|
+
this.webSocketUrl = t;
|
|
1927
|
+
}
|
|
1928
|
+
addEventListener(t, e) {
|
|
1929
|
+
this.eventListeners[t].push(e);
|
|
1930
|
+
}
|
|
1931
|
+
removeEventListener(t, e) {
|
|
1932
|
+
const i = this.eventListeners[t].indexOf(e);
|
|
1933
|
+
i !== -1 && this.eventListeners[t].splice(i, 1);
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
function Pe(s) {
|
|
1937
|
+
return JSON.parse(s == null ? void 0 : s.data);
|
|
1938
|
+
}
|
|
1939
|
+
function bi(s) {
|
|
1940
|
+
var t;
|
|
1941
|
+
return ((t = s == null ? void 0 : s.header) == null ? void 0 : t.name) === "Ping";
|
|
1942
|
+
}
|
|
1943
|
+
function At(s) {
|
|
1944
|
+
var t;
|
|
1945
|
+
return ((t = s == null ? void 0 : s.header) == null ? void 0 : t.name) === "RealityCheck";
|
|
1946
|
+
}
|
|
1947
|
+
function _e(s) {
|
|
1948
|
+
return s.header.name === "GameEvent";
|
|
1949
|
+
}
|
|
1950
|
+
function fi(s) {
|
|
1951
|
+
return _e(s) && s.body.event === "OPEN_GAME";
|
|
1952
|
+
}
|
|
1953
|
+
function Pt(s) {
|
|
1954
|
+
return s.header.code !== 1;
|
|
1955
|
+
}
|
|
1956
|
+
function yi(s) {
|
|
1957
|
+
return _e(s) && s.body.event.includes("_RESULT");
|
|
1958
|
+
}
|
|
1959
|
+
var te, ye;
|
|
1960
|
+
class ki extends mi {
|
|
1961
|
+
constructor(e, i) {
|
|
1962
|
+
const n = new URL(e.apiUrl);
|
|
1963
|
+
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);
|
|
1964
|
+
super(n.toString());
|
|
1965
|
+
/*
|
|
1966
|
+
* Correlation ID. Used in Request and Response types.
|
|
1967
|
+
* ----
|
|
1968
|
+
* Since web socket communication is async, correlation id enables us
|
|
1969
|
+
* to connect requests and responses together. This is suitable also for
|
|
1970
|
+
* troubleshooting. Connected requests and responses must have
|
|
1971
|
+
* same correlation id. Correlation id should increase with every
|
|
1972
|
+
* request sent. Client and server independently maintain their own
|
|
1973
|
+
* correlation id counter.
|
|
1974
|
+
*/
|
|
1975
|
+
g(this, "cId", 0);
|
|
1976
|
+
// Initial values for header
|
|
1977
|
+
/*
|
|
1978
|
+
* Increasing message ID
|
|
1979
|
+
* ----
|
|
1980
|
+
* mId should be increased with every message sent and is independently
|
|
1981
|
+
* maintained by client and server (ids on server and ids on client are not
|
|
1982
|
+
* correlated). This id is used by accepting party to keep incoming
|
|
1983
|
+
* messages in order (network issues could be the cause that messages are
|
|
1984
|
+
* received out of sync).
|
|
1985
|
+
*/
|
|
1986
|
+
// TODO make sure messages are processed in order
|
|
1987
|
+
g(this, "mId", 0);
|
|
1988
|
+
// Initial values for body
|
|
1989
|
+
/*
|
|
1990
|
+
* Sequence ID. Action/Event correlation.
|
|
1991
|
+
*/
|
|
1992
|
+
g(this, "seqId", 0);
|
|
1993
|
+
g(this, "gameCode");
|
|
1994
|
+
M(this, te, void 0);
|
|
1995
|
+
M(this, ye, void 0);
|
|
1996
|
+
g(this, "onMessage", (e) => {
|
|
1997
|
+
const i = Pe(e);
|
|
1998
|
+
(_e(i) || bi(i) || At(i)) && this.sendAcknowledgement(i), At(i) && this.handleRealityCheck(i);
|
|
1999
|
+
});
|
|
2000
|
+
this.eventListeners.realityCheck = [], this.gameCode = e.gameCode, k(this, te, i.requestTimeoutMs), k(this, ye, i.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
|
|
2001
|
+
}
|
|
2002
|
+
handleRealityCheck(e) {
|
|
2003
|
+
this.eventListeners.realityCheck.forEach((i) => {
|
|
2004
|
+
i(e.body);
|
|
2005
|
+
});
|
|
2006
|
+
}
|
|
2007
|
+
addEventListener(e, i) {
|
|
2008
|
+
super.addEventListener(e, i);
|
|
2009
|
+
}
|
|
2010
|
+
removeEventListener(e, i) {
|
|
2011
|
+
super.removeEventListener(e, i);
|
|
2012
|
+
}
|
|
2013
|
+
buildHeader(e, i = null) {
|
|
2014
|
+
return {
|
|
2015
|
+
// Assign new cId if it is not provided
|
|
2016
|
+
cId: i ?? ++this.cId,
|
|
2017
|
+
code: i !== null ? 1 : void 0,
|
|
2018
|
+
mId: ++this.mId,
|
|
2019
|
+
name: e
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
// TODO infer body from header
|
|
2023
|
+
buildPayload(e, i) {
|
|
2024
|
+
return JSON.stringify({
|
|
2025
|
+
body: i,
|
|
2026
|
+
header: e
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
getBodyExtras(e) {
|
|
2030
|
+
return {
|
|
2031
|
+
action: e,
|
|
2032
|
+
seqId: ++this.seqId
|
|
2033
|
+
};
|
|
2034
|
+
}
|
|
2035
|
+
request(e, i) {
|
|
2036
|
+
const n = this.buildPayload(e, i);
|
|
2037
|
+
return new Promise((o, a) => {
|
|
2038
|
+
setTimeout(() => a({ type: "timeout" }), y(this, te));
|
|
2039
|
+
const h = (p) => {
|
|
2040
|
+
const w = Pe(p);
|
|
2041
|
+
try {
|
|
2042
|
+
e.cId === w.header.cId && (this.removeEventListener("message", h), w.header.code === 1 ? o(w) : a({ message: w, type: "error" }));
|
|
2043
|
+
} catch {
|
|
2044
|
+
a({ message: w, type: "error" });
|
|
2045
|
+
}
|
|
2046
|
+
};
|
|
2047
|
+
this.addEventListener("message", h), this.send(n);
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
freeRounds(e) {
|
|
2051
|
+
const i = this.buildHeader("ActivateFreeRound");
|
|
2052
|
+
return this.request(i, e).then((n) => n.body).catch((n) => {
|
|
2053
|
+
var o;
|
|
2054
|
+
throw { data: (o = n == null ? void 0 : n.message) == null ? void 0 : o.body, type: n.type };
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2057
|
+
async authenticate(e = !1) {
|
|
2058
|
+
const i = this.buildHeader("Authenticate"), n = {
|
|
2059
|
+
clientType: 3,
|
|
2060
|
+
version: y(this, ye),
|
|
2061
|
+
reconnect: e
|
|
2062
|
+
};
|
|
2063
|
+
return this.request(i, n).then((o) => o.body).catch((o) => {
|
|
2064
|
+
var a;
|
|
2065
|
+
throw { data: (a = o == null ? void 0 : o.message) == null ? void 0 : a.body, type: o.type };
|
|
2066
|
+
});
|
|
2067
|
+
}
|
|
2068
|
+
async openGame() {
|
|
2069
|
+
const e = this.buildHeader("OpenGame"), i = {
|
|
2070
|
+
gameCode: this.gameCode
|
|
2071
|
+
};
|
|
2072
|
+
return new Promise((n, o) => {
|
|
2073
|
+
const a = (h) => {
|
|
2074
|
+
const p = Pe(h);
|
|
2075
|
+
fi(p) ? (this.removeEventListener("message", a), n(p.body)) : Pt(p) && o({ data: p.body, type: "error" });
|
|
2076
|
+
};
|
|
2077
|
+
this.addEventListener("message", a), this.request(e, i).catch(
|
|
2078
|
+
(h) => {
|
|
2079
|
+
var p;
|
|
2080
|
+
return o({ data: (p = h == null ? void 0 : h.message) == null ? void 0 : p.body, type: h.type });
|
|
2081
|
+
}
|
|
2082
|
+
);
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
sendAcknowledgement(e) {
|
|
2086
|
+
const { name: i, cId: n } = e.header, o = this.buildHeader(i, n), a = this.buildPayload(o, {});
|
|
2087
|
+
this.send(a);
|
|
2088
|
+
}
|
|
2089
|
+
sendAction(e, i) {
|
|
2090
|
+
const n = this.buildHeader("GameAction"), o = {
|
|
2091
|
+
...this.getBodyExtras(e),
|
|
2092
|
+
data: i
|
|
2093
|
+
};
|
|
2094
|
+
return new Promise((a, h) => {
|
|
2095
|
+
const p = (w) => {
|
|
2096
|
+
const m = Pe(w);
|
|
2097
|
+
_e(m) && o.seqId === m.body.correlationSeqId && (this.removeEventListener("message", p), yi(m) ? a(m.body) : Pt(m) && h({ data: m.body, type: "error" }));
|
|
2098
|
+
};
|
|
2099
|
+
this.addEventListener("message", p), this.request(n, o).catch(
|
|
2100
|
+
(w) => {
|
|
2101
|
+
var m;
|
|
2102
|
+
return h({ data: (m = w == null ? void 0 : w.message) == null ? void 0 : m.body, type: w.type });
|
|
2103
|
+
}
|
|
2104
|
+
);
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2107
|
+
setRequestTimeoutMs(e) {
|
|
2108
|
+
k(this, te, e);
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
te = new WeakMap(), ye = new WeakMap();
|
|
2112
|
+
function Ht(s) {
|
|
2113
|
+
const t = s.contract;
|
|
2114
|
+
return t ? {
|
|
2115
|
+
contract: {
|
|
2116
|
+
balance: {
|
|
2117
|
+
coins: t.balance,
|
|
2118
|
+
version: t.balanceVersion
|
|
2119
|
+
},
|
|
2120
|
+
coinValueInCents: t.coinValueInCents,
|
|
2121
|
+
country: t.countryCode,
|
|
2122
|
+
currency: t.currencyCode,
|
|
2123
|
+
jurisdiction: t.jurisdictionCode,
|
|
2124
|
+
uiMessages: t.uiMessages,
|
|
2125
|
+
username: t.username
|
|
2126
|
+
}
|
|
2127
|
+
} : {
|
|
2128
|
+
contract: {
|
|
2129
|
+
balance: {
|
|
2130
|
+
coins: s.balance,
|
|
2131
|
+
version: s.balanceVersion
|
|
2132
|
+
},
|
|
2133
|
+
coinValueInCents: s.coinValueInCents,
|
|
2134
|
+
country: s.countryCode,
|
|
2135
|
+
currency: s.currencyCode,
|
|
2136
|
+
jurisdiction: s.jurisdictionCode,
|
|
2137
|
+
uiMessages: s.uiMessages,
|
|
2138
|
+
username: s.username
|
|
2139
|
+
}
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
function Vt(s) {
|
|
2143
|
+
var t, e;
|
|
2144
|
+
return {
|
|
2145
|
+
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
2146
|
+
code: ((t = s.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
2147
|
+
details: (e = s.data) == null ? void 0 : e.details
|
|
2148
|
+
};
|
|
2149
|
+
}
|
|
2150
|
+
function zt(s, t) {
|
|
2151
|
+
const e = t.contract;
|
|
2152
|
+
if (!e) {
|
|
2153
|
+
const i = t.data;
|
|
2154
|
+
return {
|
|
2155
|
+
contract: {
|
|
2156
|
+
bet: {
|
|
2157
|
+
available: i.additionalConfigData.availableMultipliersPerBaseBet,
|
|
2158
|
+
default: {
|
|
2159
|
+
base: i.additionalConfigData.defaultBet.baseBet,
|
|
2160
|
+
multiplier: i.additionalConfigData.defaultBet.betMultiplier
|
|
2161
|
+
},
|
|
2162
|
+
max: i.additionalConfigData.maxAllowedOverallBetInCoins,
|
|
2163
|
+
last: i.gameState.betFromCurrentRound ? {
|
|
2164
|
+
base: i.gameState.betFromCurrentRound.baseBet,
|
|
2165
|
+
multiplier: i.gameState.betFromCurrentRound.betMultiplier
|
|
2166
|
+
} : null,
|
|
2167
|
+
lastPaid: i.gameState.lastPlacedMainGameBet ? {
|
|
2168
|
+
base: i.gameState.lastPlacedMainGameBet.baseBet,
|
|
2169
|
+
multiplier: i.gameState.lastPlacedMainGameBet.betMultiplier
|
|
2170
|
+
} : null
|
|
2171
|
+
},
|
|
2172
|
+
balance: {
|
|
2173
|
+
coins: t.balance,
|
|
2174
|
+
version: t.balanceVersion
|
|
2175
|
+
},
|
|
2176
|
+
freeRounds: (i.FREE_ROUNDS ?? []).map((n) => ({
|
|
2177
|
+
conf: {
|
|
2178
|
+
base: n.conf.baseBet,
|
|
2179
|
+
multiplier: n.conf.betMultiplier,
|
|
2180
|
+
numAwarded: n.conf.numAwarded
|
|
2181
|
+
},
|
|
2182
|
+
data: {
|
|
2183
|
+
numPlayed: n.data.numPlayed,
|
|
2184
|
+
win: n.data.winAmount,
|
|
2185
|
+
numLeft: n.data.numLeft
|
|
2186
|
+
},
|
|
2187
|
+
id: n.id,
|
|
2188
|
+
rejectable: n.rejectable,
|
|
2189
|
+
skippable: n.skippable,
|
|
2190
|
+
status: n.status,
|
|
2191
|
+
type: n.type
|
|
2192
|
+
})),
|
|
2193
|
+
gameModel: i.additionalConfigData.gameModelFile,
|
|
2194
|
+
metaData: i.gameConfigData.metaData,
|
|
2195
|
+
roundId: i.gameState.cycleId,
|
|
2196
|
+
serverTime: t.balanceVersion,
|
|
2197
|
+
sessionId: i.gameState.sessionId,
|
|
2198
|
+
stateType: {
|
|
2199
|
+
thisRound: i.gameState.stateTypeThisRound,
|
|
2200
|
+
nextRound: i.gameState.stateTypeNextRound
|
|
2201
|
+
},
|
|
2202
|
+
uiMessages: s.uiMessages,
|
|
2203
|
+
win: {
|
|
2204
|
+
round: i.gameState.totalWinFromCurrentRound,
|
|
2205
|
+
total: i.gameState.totalWinFromCurrentGameCycle
|
|
2206
|
+
}
|
|
2207
|
+
},
|
|
2208
|
+
data: i
|
|
2209
|
+
};
|
|
2210
|
+
}
|
|
2211
|
+
return {
|
|
2212
|
+
contract: {
|
|
2213
|
+
bet: {
|
|
2214
|
+
available: e.availableMultipliersPerBaseBet,
|
|
2215
|
+
default: {
|
|
2216
|
+
base: e.defaultBet.baseBet,
|
|
2217
|
+
multiplier: e.defaultBet.betMultiplier
|
|
2218
|
+
},
|
|
2219
|
+
max: e.maxBetInCoins,
|
|
2220
|
+
last: e.lastBet ? {
|
|
2221
|
+
base: e.lastBet.baseBet,
|
|
2222
|
+
multiplier: e.lastBet.betMultiplier
|
|
2223
|
+
} : null,
|
|
2224
|
+
lastPaid: e.lastMainGameBet ? {
|
|
2225
|
+
base: e.lastMainGameBet.baseBet,
|
|
2226
|
+
multiplier: e.lastMainGameBet.betMultiplier
|
|
2227
|
+
} : null
|
|
2228
|
+
},
|
|
2229
|
+
balance: {
|
|
2230
|
+
coins: e.balanceInCoins,
|
|
2231
|
+
version: e.balanceVersion
|
|
2232
|
+
},
|
|
2233
|
+
freeRounds: (e.freeRounds ?? []).map((i) => ({
|
|
2234
|
+
conf: {
|
|
2235
|
+
base: i.conf.baseBet,
|
|
2236
|
+
multiplier: i.conf.betMultiplier,
|
|
2237
|
+
numAwarded: i.conf.numAwarded
|
|
2238
|
+
},
|
|
2239
|
+
data: {
|
|
2240
|
+
numPlayed: i.data.numPlayed,
|
|
2241
|
+
win: i.data.winAmount,
|
|
2242
|
+
numLeft: i.data.numLeft
|
|
2243
|
+
},
|
|
2244
|
+
id: i.id,
|
|
2245
|
+
rejectable: i.rejectable,
|
|
2246
|
+
skippable: i.skippable,
|
|
2247
|
+
status: i.status,
|
|
2248
|
+
type: i.type
|
|
2249
|
+
})),
|
|
2250
|
+
gameModel: e.gameModelFile,
|
|
2251
|
+
metaData: e.metaData,
|
|
2252
|
+
roundId: e.roundId,
|
|
2253
|
+
serverTime: e.serverTime,
|
|
2254
|
+
sessionId: e.sessionId,
|
|
2255
|
+
stateType: {
|
|
2256
|
+
thisRound: e.stateTypeThisRound,
|
|
2257
|
+
nextRound: e.stateTypeNextRound
|
|
2258
|
+
},
|
|
2259
|
+
uiMessages: s.contract.uiMessages.concat(e.uiMessages),
|
|
2260
|
+
win: {
|
|
2261
|
+
round: e.roundWin,
|
|
2262
|
+
total: e.totalWin
|
|
2263
|
+
}
|
|
2264
|
+
},
|
|
2265
|
+
data: t.opaqueGameServerToUi
|
|
2266
|
+
};
|
|
2388
2267
|
}
|
|
2389
|
-
function
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
};
|
|
2412
|
-
this.set(A, o(A)).set(_, o(_)).set(O, o(O)).set(F, o(F)).set(P, o(P));
|
|
2413
|
-
}
|
|
2414
|
-
return this;
|
|
2415
|
-
}, this.parseUA = function() {
|
|
2416
|
-
return this.itemType != te && Ct.call(this.data, this.ua, this.rgxMap), this.itemType == A && this.set(fe, Ke(this.get(c))), this;
|
|
2417
|
-
}, this.parseCH = function() {
|
|
2418
|
-
var n = this.uaCH, o = this.rgxMap;
|
|
2419
|
-
switch (this.itemType) {
|
|
2420
|
-
case A:
|
|
2421
|
-
var a = n[at] || n[nt], h;
|
|
2422
|
-
if (a)
|
|
2423
|
-
for (var g in a) {
|
|
2424
|
-
var w = j(/(Google|Microsoft) /, a[g].brand || a[g]), m = a[g].version;
|
|
2425
|
-
!/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(r, w).set(c, m).set(fe, Ke(m)), h = w);
|
|
2268
|
+
function qt(s) {
|
|
2269
|
+
var t, e;
|
|
2270
|
+
return {
|
|
2271
|
+
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
2272
|
+
code: ((t = s.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
2273
|
+
details: (e = s.data) == null ? void 0 : e.details
|
|
2274
|
+
};
|
|
2275
|
+
}
|
|
2276
|
+
function Wt(s) {
|
|
2277
|
+
const t = s.contract;
|
|
2278
|
+
if (!t) {
|
|
2279
|
+
const e = s.data;
|
|
2280
|
+
return {
|
|
2281
|
+
contract: {
|
|
2282
|
+
bet: {
|
|
2283
|
+
last: e.gameState.betFromCurrentRound ? {
|
|
2284
|
+
base: e.gameState.betFromCurrentRound.baseBet,
|
|
2285
|
+
multiplier: e.gameState.betFromCurrentRound.betMultiplier
|
|
2286
|
+
} : null,
|
|
2287
|
+
lastPaid: {
|
|
2288
|
+
base: e.gameState.lastPlacedMainGameBet.baseBet,
|
|
2289
|
+
multiplier: e.gameState.lastPlacedMainGameBet.betMultiplier
|
|
2426
2290
|
}
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2291
|
+
},
|
|
2292
|
+
balance: {
|
|
2293
|
+
coins: s.balance,
|
|
2294
|
+
version: s.balanceVersion
|
|
2295
|
+
},
|
|
2296
|
+
freeRounds: (e.FREE_ROUNDS ?? []).map((i) => ({
|
|
2297
|
+
conf: {
|
|
2298
|
+
base: i.conf.baseBet,
|
|
2299
|
+
multiplier: i.conf.betMultiplier,
|
|
2300
|
+
numAwarded: i.conf.numAwarded
|
|
2301
|
+
},
|
|
2302
|
+
data: {
|
|
2303
|
+
numPlayed: i.data.numPlayed,
|
|
2304
|
+
win: i.data.winAmount,
|
|
2305
|
+
numLeft: i.data.numLeft
|
|
2306
|
+
},
|
|
2307
|
+
id: i.id,
|
|
2308
|
+
rejectable: i.rejectable,
|
|
2309
|
+
skippable: i.skippable,
|
|
2310
|
+
status: i.status,
|
|
2311
|
+
type: i.type
|
|
2312
|
+
})),
|
|
2313
|
+
serverTime: s.balanceVersion,
|
|
2314
|
+
roundId: e.gameState.cycleId,
|
|
2315
|
+
stateType: {
|
|
2316
|
+
thisRound: e.gameState.stateTypeThisRound,
|
|
2317
|
+
nextRound: e.gameState.stateTypeNextRound
|
|
2318
|
+
},
|
|
2319
|
+
uiMessages: e.uiMessages,
|
|
2320
|
+
win: {
|
|
2321
|
+
round: e.gameState.totalWinFromCurrentRound,
|
|
2322
|
+
total: e.gameState.totalWinFromCurrentGameCycle
|
|
2441
2323
|
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2324
|
+
},
|
|
2325
|
+
data: e
|
|
2326
|
+
};
|
|
2327
|
+
}
|
|
2328
|
+
return {
|
|
2329
|
+
contract: {
|
|
2330
|
+
bet: {
|
|
2331
|
+
last: t.lastBet ? {
|
|
2332
|
+
base: t.lastBet.baseBet,
|
|
2333
|
+
multiplier: t.lastBet.betMultiplier
|
|
2334
|
+
} : null,
|
|
2335
|
+
lastPaid: {
|
|
2336
|
+
base: t.lastMainGameBet.baseBet,
|
|
2337
|
+
multiplier: t.lastMainGameBet.betMultiplier
|
|
2448
2338
|
}
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2339
|
+
},
|
|
2340
|
+
balance: {
|
|
2341
|
+
coins: t.balanceInCoins,
|
|
2342
|
+
version: t.balanceVersion
|
|
2343
|
+
},
|
|
2344
|
+
freeRounds: (t.freeRounds ?? []).map((e) => ({
|
|
2345
|
+
conf: {
|
|
2346
|
+
base: e.conf.baseBet,
|
|
2347
|
+
multiplier: e.conf.betMultiplier,
|
|
2348
|
+
numAwarded: e.conf.numAwarded
|
|
2349
|
+
},
|
|
2350
|
+
data: {
|
|
2351
|
+
numPlayed: e.data.numPlayed,
|
|
2352
|
+
win: e.data.winAmount,
|
|
2353
|
+
numLeft: e.data.numLeft
|
|
2354
|
+
},
|
|
2355
|
+
id: e.id,
|
|
2356
|
+
rejectable: e.rejectable,
|
|
2357
|
+
skippable: e.skippable,
|
|
2358
|
+
status: e.status,
|
|
2359
|
+
type: e.type
|
|
2360
|
+
})),
|
|
2361
|
+
serverTime: t.serverTime,
|
|
2362
|
+
roundId: t.roundId,
|
|
2363
|
+
stateType: {
|
|
2364
|
+
thisRound: t.stateTypeThisRound,
|
|
2365
|
+
nextRound: t.stateTypeNextRound
|
|
2366
|
+
},
|
|
2367
|
+
uiMessages: t.uiMessages,
|
|
2368
|
+
win: {
|
|
2369
|
+
round: t.roundWin,
|
|
2370
|
+
total: t.totalWin
|
|
2371
|
+
}
|
|
2372
|
+
},
|
|
2373
|
+
data: s.opaqueGameServerToUi
|
|
2374
|
+
};
|
|
2465
2375
|
}
|
|
2466
|
-
function
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
// navigator.userAgent
|
|
2473
|
-
e && e[gt] ? e[gt] : (
|
|
2474
|
-
// User-Agent from passed headers
|
|
2475
|
-
de
|
|
2476
|
-
)
|
|
2477
|
-
)
|
|
2478
|
-
), n = new Dt(e, !0), o = t ? yi(It, t) : It, a = function(h) {
|
|
2479
|
-
return h == te ? function() {
|
|
2480
|
-
return new Tt(h, s, o, n).set("ua", s).set(A, this.getBrowser()).set(_, this.getCPU()).set(O, this.getDevice()).set(F, this.getEngine()).set(P, this.getOS()).get();
|
|
2481
|
-
} : function() {
|
|
2482
|
-
return new Tt(h, s, o[h], n).parseUA().get();
|
|
2483
|
-
};
|
|
2376
|
+
function $t(s) {
|
|
2377
|
+
var t, e;
|
|
2378
|
+
return {
|
|
2379
|
+
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
2380
|
+
code: ((t = s.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
2381
|
+
details: (e = s.data) == null ? void 0 : e.details
|
|
2484
2382
|
};
|
|
2485
|
-
return R.call(this, [
|
|
2486
|
-
["getBrowser", a(A)],
|
|
2487
|
-
["getCPU", a(_)],
|
|
2488
|
-
["getDevice", a(O)],
|
|
2489
|
-
["getEngine", a(F)],
|
|
2490
|
-
["getOS", a(P)],
|
|
2491
|
-
["getResult", a(te)],
|
|
2492
|
-
["getUA", function() {
|
|
2493
|
-
return s;
|
|
2494
|
-
}],
|
|
2495
|
-
["setUA", function(h) {
|
|
2496
|
-
return ue(h) && (s = h.length > tt ? ye(h, tt) : h), this;
|
|
2497
|
-
}]
|
|
2498
|
-
]).setUA(s), this;
|
|
2499
2383
|
}
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2384
|
+
const Wi = {
|
|
2385
|
+
parseAuthenticateResponse: Ht,
|
|
2386
|
+
parseAuthenticateError: Vt,
|
|
2387
|
+
parseOpenGameResponse: zt,
|
|
2388
|
+
parseOpenGameError: qt,
|
|
2389
|
+
parsePlayResponse: Wt,
|
|
2390
|
+
parsePlayError: $t
|
|
2391
|
+
}, vi = {
|
|
2392
|
+
bul: "bg",
|
|
2393
|
+
chi: "zh",
|
|
2394
|
+
zho: "zh",
|
|
2395
|
+
hrv: "hr",
|
|
2396
|
+
cze: "cs",
|
|
2397
|
+
dan: "da",
|
|
2398
|
+
dut: "nl",
|
|
2399
|
+
eng: "en",
|
|
2400
|
+
est: "et",
|
|
2401
|
+
fin: "fi",
|
|
2402
|
+
fra: "fr",
|
|
2403
|
+
ger: "de",
|
|
2404
|
+
gre: "el",
|
|
2405
|
+
hun: "hu",
|
|
2406
|
+
ind: "id",
|
|
2407
|
+
ita: "it",
|
|
2408
|
+
jpn: "ja",
|
|
2409
|
+
kor: "ko",
|
|
2410
|
+
nor: "no",
|
|
2411
|
+
pol: "pl",
|
|
2412
|
+
por: "pt",
|
|
2413
|
+
rum: "ro",
|
|
2414
|
+
rus: "ru",
|
|
2415
|
+
srp: "sr",
|
|
2416
|
+
slo: "sk",
|
|
2417
|
+
spa: "es",
|
|
2418
|
+
swe: "sv",
|
|
2419
|
+
tha: "th",
|
|
2420
|
+
tur: "tr",
|
|
2421
|
+
ukr: "uk",
|
|
2422
|
+
vie: "vi"
|
|
2423
|
+
}, { device: Ei } = R(navigator.userAgent), Ci = U("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
|
|
2424
|
+
class $i extends wi {
|
|
2425
|
+
constructor(...e) {
|
|
2426
|
+
super(...e);
|
|
2427
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2428
|
+
// @ts-ignore
|
|
2429
|
+
g(this, "socket");
|
|
2430
|
+
this.on("openGame", async () => {
|
|
2431
|
+
try {
|
|
2432
|
+
const i = await this.openGame();
|
|
2433
|
+
this.send("openGameResponse", i);
|
|
2434
|
+
} catch (i) {
|
|
2435
|
+
this.send("openGameError", i);
|
|
2436
|
+
}
|
|
2437
|
+
}), this.on("play", async (i) => {
|
|
2438
|
+
try {
|
|
2439
|
+
const n = await this.play(i);
|
|
2440
|
+
this.send("playResponse", n);
|
|
2441
|
+
} catch (n) {
|
|
2442
|
+
this.send("playError", n);
|
|
2443
|
+
}
|
|
2444
|
+
}), this.on("freeRounds", async (i) => {
|
|
2445
|
+
try {
|
|
2446
|
+
await this.socket.freeRounds(i), this.send("freeRoundsResponse", i);
|
|
2447
|
+
} catch (n) {
|
|
2448
|
+
this.send("freeRoundsError", n);
|
|
2449
|
+
}
|
|
2450
|
+
}), this.on("configured", (i) => {
|
|
2451
|
+
this.socket.setRequestTimeoutMs(i.ui.requestTimeoutMs);
|
|
2452
|
+
}), this.registerFromSdkEvents();
|
|
2453
|
+
}
|
|
2454
|
+
initialize(e) {
|
|
2455
|
+
this.socket = new ki(e, {
|
|
2456
|
+
gameVersion: this.config.gameVersion,
|
|
2457
|
+
requestTimeoutMs: this.sdkConfig.ui.requestTimeoutMs
|
|
2458
|
+
}), ["deeprush", "sharkstrike", "fireboltroulette"].includes(e.gameCode) || (this.socket.addEventListener("close", (i) => {
|
|
2459
|
+
i.code === 1008 ? this.send("error", {
|
|
2460
|
+
type: "CLOSE",
|
|
2461
|
+
messageCode: "TOO_MANY_OPEN_GAMES",
|
|
2462
|
+
messageKey: "RgsError.TOO_MANY_OPEN_GAMES"
|
|
2463
|
+
}) : i.code === 1011 || this.reconnect();
|
|
2464
|
+
}), ["mobile", "tablet"].includes(Ei.type ?? "") && document.addEventListener("visibilitychange", async () => {
|
|
2465
|
+
document.hidden || (this.socket.socket ? this.socket.socket && [WebSocket.CONNECTING, WebSocket.OPEN].includes(this.socket.socket.readyState) && this.socket.close() : this.reconnect());
|
|
2466
|
+
})), this.socket.addEventListener("error", (i) => Ci("error", i)), this.socket.addEventListener("realityCheck", (i) => {
|
|
2467
|
+
this.send("realityCheck", i);
|
|
2468
|
+
});
|
|
2469
|
+
}
|
|
2470
|
+
async reconnect() {
|
|
2471
|
+
try {
|
|
2472
|
+
await this.socket.connect(), await this.socket.authenticate(!0), await this.socket.openGame();
|
|
2473
|
+
} catch {
|
|
2474
|
+
this.send("error", { type: "CLOSE", messageCode: "CONNECTION_ERROR", messageKey: "RgsError.CONNECTION_ERROR" });
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
async openGame() {
|
|
2478
|
+
const e = new URLSearchParams(window.location.search), i = e.get("apiUrl"), n = e.get("cageCode"), o = e.get("gameCode"), a = e.get("operatorCode"), h = e.get("playMode"), p = e.get("token"), w = e.get("username"), m = e.get("gameHistoryUrl"), v = e.get("homeUrl") ?? void 0, N = e.get("cashierUrl") ?? void 0;
|
|
2479
|
+
this.initialize({ apiUrl: i, cageCode: n, gameCode: o, operatorCode: a, playMode: h, token: p, username: w });
|
|
2480
|
+
try {
|
|
2481
|
+
await this.socket.connect();
|
|
2482
|
+
} catch {
|
|
2483
|
+
throw { type: "error", data: { code: Ne.CONNECTION_ERROR } };
|
|
2484
|
+
}
|
|
2485
|
+
let X;
|
|
2486
|
+
try {
|
|
2487
|
+
X = await this.socket.authenticate();
|
|
2488
|
+
} catch (_) {
|
|
2489
|
+
throw { type: _.type, data: _.type === "error" ? Vt(_.data) : void 0 };
|
|
2490
|
+
}
|
|
2491
|
+
let K;
|
|
2492
|
+
try {
|
|
2493
|
+
K = await this.socket.openGame();
|
|
2494
|
+
} catch (_) {
|
|
2495
|
+
throw { type: _.type, data: _.type === "error" ? qt(_.data) : void 0 };
|
|
2496
|
+
}
|
|
2497
|
+
const L = Ht(X), ue = zt(X, K);
|
|
2498
|
+
this.sdkConfig.api = {
|
|
2499
|
+
brand: n,
|
|
2500
|
+
game: o,
|
|
2501
|
+
integration: a,
|
|
2502
|
+
jurisdiction: L.contract.jurisdiction,
|
|
2503
|
+
playMode: h,
|
|
2504
|
+
user: L.contract.username,
|
|
2505
|
+
integrationData: {
|
|
2506
|
+
token: p
|
|
2507
|
+
},
|
|
2508
|
+
country: L.contract.country,
|
|
2509
|
+
currency: L.contract.currency,
|
|
2510
|
+
coinValueInCents: L.contract.coinValueInCents,
|
|
2511
|
+
gameHistoryUrl: m,
|
|
2512
|
+
homeUrl: v,
|
|
2513
|
+
cashierUrl: N,
|
|
2514
|
+
sessionId: ue.contract.sessionId,
|
|
2515
|
+
lastRoundId: ue.contract.roundId
|
|
2516
|
+
};
|
|
2517
|
+
const O = e.get("languageCode");
|
|
2518
|
+
return O && (this.sdkConfig.ui.language = O.length === 3 ? vi[O] ?? O : O), ue;
|
|
2519
|
+
}
|
|
2520
|
+
async play(e) {
|
|
2521
|
+
for (; !this.socket.socket; )
|
|
2522
|
+
await new Promise((v) => setTimeout(() => v(), 500));
|
|
2523
|
+
const {
|
|
2524
|
+
contract: { bet: i, forcedOutcomes: n, ...o },
|
|
2525
|
+
extra: a,
|
|
2526
|
+
payloadToInject: h,
|
|
2527
|
+
actionType: p
|
|
2528
|
+
} = e, w = {
|
|
2529
|
+
bet: i ? { baseBet: i.base, betMultiplier: i.multiplier } : void 0,
|
|
2530
|
+
forcedOutcomes: n,
|
|
2531
|
+
// TODO: get rid of contractRest - it' a legacy from old RGS
|
|
2532
|
+
...o,
|
|
2533
|
+
...h,
|
|
2534
|
+
opaqueUiToGameServer: a
|
|
2535
|
+
};
|
|
2536
|
+
let m;
|
|
2537
|
+
try {
|
|
2538
|
+
m = await this.socket.sendAction(p, w);
|
|
2539
|
+
} catch (v) {
|
|
2540
|
+
throw { type: v.type, data: v.type === "error" ? $t(v.data) : void 0 };
|
|
2541
|
+
}
|
|
2542
|
+
return Wt(m);
|
|
2543
|
+
}
|
|
2544
|
+
registerFromSdkEvents() {
|
|
2545
|
+
this.on("history", () => {
|
|
2546
|
+
const {
|
|
2547
|
+
api: { game: e, integration: i, integrationData: n, jurisdiction: o, user: a, gameHistoryUrl: h },
|
|
2548
|
+
ui: { language: p }
|
|
2549
|
+
} = this.sdkConfig, w = a.replace(/^user_/, "").replace(new RegExp(`_${i}$`), ""), m = new URL(h);
|
|
2550
|
+
m.searchParams.set("gameCode", e), m.searchParams.set("jurisdiction", o), m.searchParams.set("operatorCode", i), m.searchParams.set("token", n.token), m.searchParams.set("username", w), m.searchParams.set("languageCode", p), this.config.gameHistoryUrl && m.searchParams.set("gameHistoryUrl", this.config.gameHistoryUrl), window.open(m.toString(), "_blank");
|
|
2551
|
+
});
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
class Mi {
|
|
2555
|
+
constructor(t, e, i) {
|
|
2556
|
+
g(this, "trackers");
|
|
2557
|
+
g(this, "config");
|
|
2558
|
+
g(this, "sdkConfig");
|
|
2559
|
+
this.trackers = t, this.config = e, this.sdkConfig = i;
|
|
2560
|
+
}
|
|
2561
|
+
on(t, e, i) {
|
|
2513
2562
|
const n = function(a) {
|
|
2514
2563
|
a.data.message !== `kalamba:wrapper-telemetry:${t}` && a.data.message !== `kalamba:wrapper:${t}` || e(a.data.payload);
|
|
2515
2564
|
};
|
|
2516
|
-
window.addEventListener("message", n,
|
|
2565
|
+
window.addEventListener("message", n, i);
|
|
2517
2566
|
}
|
|
2518
2567
|
track(t, e) {
|
|
2519
|
-
this.trackers.forEach((
|
|
2568
|
+
this.trackers.forEach((i) => i.track(t, e));
|
|
2520
2569
|
}
|
|
2521
2570
|
}
|
|
2522
|
-
function
|
|
2523
|
-
return
|
|
2571
|
+
function Ot(s) {
|
|
2572
|
+
return s.reduce((t, e) => t + e, 0);
|
|
2524
2573
|
}
|
|
2525
|
-
function
|
|
2526
|
-
const t =
|
|
2574
|
+
function Si(s) {
|
|
2575
|
+
const t = s.length, e = Ot(s) / t, i = s.map((o) => Math.pow(o - e, 2)), n = Ot(i) / t;
|
|
2527
2576
|
return Math.sqrt(n);
|
|
2528
2577
|
}
|
|
2529
|
-
class
|
|
2578
|
+
class xt {
|
|
2530
2579
|
constructor() {
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2580
|
+
g(this, "rafId", -1);
|
|
2581
|
+
g(this, "startTime", 0);
|
|
2582
|
+
g(this, "stopTime", 0);
|
|
2583
|
+
g(this, "frames", []);
|
|
2584
|
+
g(this, "calculateFPS", () => {
|
|
2536
2585
|
const t = Math.floor((this.stopTime - this.startTime) / 1e3);
|
|
2537
|
-
return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e,
|
|
2586
|
+
return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e, i, n, o) => (o[n] !== o[n - 1] ? e.push(1) : e[e.length - 1]++, e), []).slice(0, t);
|
|
2538
2587
|
});
|
|
2539
|
-
|
|
2540
|
-
const t = this.calculateFPS(), e = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)),
|
|
2541
|
-
return { fpsAvg: e, fpsMax:
|
|
2588
|
+
g(this, "getReport", () => {
|
|
2589
|
+
const t = this.calculateFPS(), e = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), i = t.length > 0 ? Math.max(...t) : e, n = t.length > 0 ? Math.min(...t) : e, o = t.length > 0 ? Si(t) : 0;
|
|
2590
|
+
return { fpsAvg: e, fpsMax: i, fpsMin: n, fpsStdDev: o };
|
|
2542
2591
|
});
|
|
2543
|
-
|
|
2592
|
+
g(this, "start", () => {
|
|
2544
2593
|
this.startTime = Date.now(), this.frames = [], this.trackFrames();
|
|
2545
2594
|
});
|
|
2546
|
-
|
|
2595
|
+
g(this, "stop", () => {
|
|
2547
2596
|
cancelAnimationFrame(this.rafId), this.stopTime = Date.now();
|
|
2548
2597
|
});
|
|
2549
|
-
|
|
2598
|
+
g(this, "trackFrames", () => {
|
|
2550
2599
|
this.frames.push(Date.now()), this.rafId = requestAnimationFrame(this.trackFrames);
|
|
2551
2600
|
});
|
|
2552
2601
|
}
|
|
2553
2602
|
}
|
|
2554
|
-
const
|
|
2555
|
-
function
|
|
2603
|
+
const Ii = "landscape", Ti = "portrait";
|
|
2604
|
+
function Ai() {
|
|
2556
2605
|
try {
|
|
2557
|
-
const
|
|
2558
|
-
return !!window.WebGLRenderingContext && (
|
|
2606
|
+
const s = document.createElement("canvas");
|
|
2607
|
+
return !!window.WebGLRenderingContext && (s.getContext("webgl") || s.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
|
|
2559
2608
|
} catch {
|
|
2560
2609
|
return !1;
|
|
2561
2610
|
}
|
|
2562
2611
|
}
|
|
2563
|
-
async function
|
|
2612
|
+
async function Pi() {
|
|
2564
2613
|
if (!window.createImageBitmap)
|
|
2565
2614
|
return !1;
|
|
2566
2615
|
const e = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
|
|
@@ -2570,33 +2619,33 @@ async function Ii() {
|
|
|
2570
2619
|
return !1;
|
|
2571
2620
|
}
|
|
2572
2621
|
}
|
|
2573
|
-
function
|
|
2574
|
-
return window.innerWidth >= window.innerHeight ?
|
|
2622
|
+
function Ye() {
|
|
2623
|
+
return window.innerWidth >= window.innerHeight ? Ii : Ti;
|
|
2575
2624
|
}
|
|
2576
|
-
var
|
|
2577
|
-
class
|
|
2625
|
+
var Be, ie, se, ne, ke, De, ve, Fe;
|
|
2626
|
+
class ji extends Mi {
|
|
2578
2627
|
constructor(...e) {
|
|
2579
2628
|
super(...e);
|
|
2580
|
-
|
|
2629
|
+
g(this, "FPS_SAMPLE_INTERVAL", 1e4);
|
|
2581
2630
|
// wrapper state
|
|
2582
|
-
M(this,
|
|
2631
|
+
M(this, Be, 0);
|
|
2632
|
+
M(this, ie, void 0);
|
|
2583
2633
|
M(this, se, void 0);
|
|
2584
2634
|
M(this, ne, void 0);
|
|
2585
|
-
M(this,
|
|
2586
|
-
M(this,
|
|
2587
|
-
M(this,
|
|
2588
|
-
M(this,
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
s !== void 0 && k(this, Fe, s);
|
|
2635
|
+
M(this, ke, !1);
|
|
2636
|
+
M(this, De, !1);
|
|
2637
|
+
M(this, ve, "");
|
|
2638
|
+
M(this, Fe, []);
|
|
2639
|
+
k(this, se, {}), k(this, ne, this.deviceInfo()), k(this, ie, this.config.gameVersion), this.on("state", ({ balance: i }) => {
|
|
2640
|
+
k(this, Be, i);
|
|
2641
|
+
}), this.on("autoplay", ({ action: i }) => {
|
|
2642
|
+
["start", "resume"].includes(i) ? k(this, ke, !0) : k(this, ke, !1);
|
|
2643
|
+
}), this.on("settings", ({ fastPlay: i }) => {
|
|
2644
|
+
i !== void 0 && k(this, De, i);
|
|
2596
2645
|
}), this.registerEvents();
|
|
2597
2646
|
}
|
|
2598
2647
|
async registerEvents() {
|
|
2599
|
-
y(this,
|
|
2648
|
+
y(this, ne).then((e) => {
|
|
2600
2649
|
this.track("Device Information", e);
|
|
2601
2650
|
}), this.on("loadStart", () => {
|
|
2602
2651
|
this.track("Game Loading", { progress: 0, step: "initial" });
|
|
@@ -2610,9 +2659,9 @@ class zi extends vi {
|
|
|
2610
2659
|
systemMessageType: e.type
|
|
2611
2660
|
});
|
|
2612
2661
|
}), this.on("openGameResponse", async (e) => {
|
|
2613
|
-
k(this,
|
|
2662
|
+
k(this, ve, e.contract.stateType.nextRound), k(this, se, {
|
|
2614
2663
|
balanceInCoins: e.contract.balance.coins,
|
|
2615
|
-
clientVersion: y(this,
|
|
2664
|
+
clientVersion: y(this, ie),
|
|
2616
2665
|
coinValueInCents: this.sdkConfig.api.coinValueInCents,
|
|
2617
2666
|
coinValueInCentsFloat: this.sdkConfig.api.coinValueInCents,
|
|
2618
2667
|
currency: this.sdkConfig.api.currency,
|
|
@@ -2634,27 +2683,27 @@ class zi extends vi {
|
|
|
2634
2683
|
// rtpVariant: 'unknown',
|
|
2635
2684
|
serverVersion: e.contract.metaData.version
|
|
2636
2685
|
// testVariants: '',
|
|
2637
|
-
}), this.track("Game Open", y(this,
|
|
2686
|
+
}), this.track("Game Open", y(this, se));
|
|
2638
2687
|
}), this.on("playCycleEnd", async (e) => {
|
|
2639
|
-
const
|
|
2688
|
+
const i = await y(this, ne), { base: n, multiplier: o, specialAction: a } = e.contract.bet.lastPaid ?? {}, h = e.contract.balance.coins, p = e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier, w = e.contract.win.total, m = w - p, v = a || "spin", N = e.contract.roundId;
|
|
2640
2689
|
this.track("Betting Activity", {
|
|
2641
2690
|
balance: h - m,
|
|
2642
2691
|
balanceAfter: h,
|
|
2643
2692
|
baseBet: n,
|
|
2644
2693
|
// baseBetIndex,
|
|
2645
2694
|
betMultiplier: o,
|
|
2646
|
-
betType:
|
|
2647
|
-
gameVersion: y(this,
|
|
2695
|
+
betType: v,
|
|
2696
|
+
gameVersion: y(this, ie),
|
|
2648
2697
|
coinValueInCents: this.sdkConfig.api.coinValueInCents,
|
|
2649
2698
|
coinValueInCentsFloat: this.sdkConfig.api.coinValueInCents,
|
|
2650
2699
|
currency: this.sdkConfig.api.currency,
|
|
2651
2700
|
environment: "release",
|
|
2652
2701
|
gameCode: this.sdkConfig.api.game,
|
|
2653
2702
|
gameCodeServer: this.sdkConfig.api.game,
|
|
2654
|
-
isMobile:
|
|
2703
|
+
isMobile: i.isMobile,
|
|
2655
2704
|
netResult: m,
|
|
2656
2705
|
operatorName: "kalamba",
|
|
2657
|
-
orientation:
|
|
2706
|
+
orientation: Ye(),
|
|
2658
2707
|
partnerId: this.sdkConfig.api.brand,
|
|
2659
2708
|
partnerParentId: this.sdkConfig.api.integration,
|
|
2660
2709
|
platform: "WEB",
|
|
@@ -2663,9 +2712,9 @@ class zi extends vi {
|
|
|
2663
2712
|
// TODO: uncomment when tracking TrackingEvent.GameSpin is implemented
|
|
2664
2713
|
// roundTypes: [...this.#roundTypes],
|
|
2665
2714
|
roundTypes: ["BaseGame"],
|
|
2666
|
-
totalBet:
|
|
2715
|
+
totalBet: p,
|
|
2667
2716
|
totalWin: w
|
|
2668
|
-
}), k(this,
|
|
2717
|
+
}), k(this, Fe, []);
|
|
2669
2718
|
}), this.on("telemetry.click", (e) => {
|
|
2670
2719
|
this.track("UI Interaction", {
|
|
2671
2720
|
action: "click",
|
|
@@ -2680,47 +2729,47 @@ class zi extends vi {
|
|
|
2680
2729
|
}), this.reportFpsSample(), this.reportFpsRound();
|
|
2681
2730
|
}
|
|
2682
2731
|
reportFpsSample() {
|
|
2683
|
-
const e = new
|
|
2732
|
+
const e = new xt(), i = () => {
|
|
2684
2733
|
e.stop();
|
|
2685
2734
|
const o = e.getReport();
|
|
2686
2735
|
this.track("FPS Performance", { ...o, fpsType: "sample" }), n();
|
|
2687
2736
|
}, n = async () => {
|
|
2688
|
-
e.start(), setTimeout(
|
|
2737
|
+
e.start(), setTimeout(i, this.FPS_SAMPLE_INTERVAL);
|
|
2689
2738
|
};
|
|
2690
2739
|
n();
|
|
2691
2740
|
}
|
|
2692
2741
|
reportFpsRound() {
|
|
2693
|
-
const e = new
|
|
2742
|
+
const e = new xt();
|
|
2694
2743
|
this.on("playCycleStart", () => {
|
|
2695
2744
|
e.start();
|
|
2696
2745
|
}), this.on("playCycleEnd", () => {
|
|
2697
2746
|
e.stop();
|
|
2698
|
-
const
|
|
2699
|
-
this.track("FPS Performance", { ...
|
|
2747
|
+
const i = e.getReport();
|
|
2748
|
+
this.track("FPS Performance", { ...i, fpsType: "playCycleStart->playCycleEnd" });
|
|
2700
2749
|
});
|
|
2701
2750
|
}
|
|
2702
2751
|
getExtraUiInteractionData() {
|
|
2703
2752
|
return {
|
|
2704
|
-
orientation:
|
|
2705
|
-
stateType: y(this,
|
|
2753
|
+
orientation: Ye(),
|
|
2754
|
+
stateType: y(this, ve)
|
|
2706
2755
|
};
|
|
2707
2756
|
}
|
|
2708
2757
|
async deviceInfo() {
|
|
2709
|
-
var
|
|
2710
|
-
const
|
|
2758
|
+
var h;
|
|
2759
|
+
const { browser: e, device: i, os: n } = R(navigator.userAgent), o = Ai(), a = await Pi();
|
|
2711
2760
|
return {
|
|
2712
|
-
browserName:
|
|
2713
|
-
browserVersion:
|
|
2714
|
-
connection: (
|
|
2715
|
-
deviceName:
|
|
2716
|
-
deviceType:
|
|
2717
|
-
isMobile: ["mobile", "tablet"].includes(
|
|
2718
|
-
isWebGLSupported:
|
|
2719
|
-
isWebPSupported:
|
|
2720
|
-
manufacturer:
|
|
2721
|
-
operatingSystem:
|
|
2722
|
-
operatingSystemVersion:
|
|
2723
|
-
orientation:
|
|
2761
|
+
browserName: e.name,
|
|
2762
|
+
browserVersion: e.version,
|
|
2763
|
+
connection: (h = navigator.connection) == null ? void 0 : h.effectiveType,
|
|
2764
|
+
deviceName: i.model,
|
|
2765
|
+
deviceType: i.type,
|
|
2766
|
+
isMobile: ["mobile", "tablet"].includes(i.type ?? ""),
|
|
2767
|
+
isWebGLSupported: o,
|
|
2768
|
+
isWebPSupported: a,
|
|
2769
|
+
manufacturer: i.vendor,
|
|
2770
|
+
operatingSystem: n.name,
|
|
2771
|
+
operatingSystemVersion: n.version,
|
|
2772
|
+
orientation: Ye(),
|
|
2724
2773
|
pixelRatio: window.devicePixelRatio,
|
|
2725
2774
|
screenHeight: window.screen.height,
|
|
2726
2775
|
screenSize: `${window.screen.width}x${window.screen.height}`,
|
|
@@ -2732,77 +2781,77 @@ class zi extends vi {
|
|
|
2732
2781
|
};
|
|
2733
2782
|
}
|
|
2734
2783
|
}
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2784
|
+
Be = new WeakMap(), ie = new WeakMap(), se = new WeakMap(), ne = new WeakMap(), ke = new WeakMap(), De = new WeakMap(), ve = new WeakMap(), Fe = new WeakMap();
|
|
2785
|
+
var C = [];
|
|
2786
|
+
for (var Ze = 0; Ze < 256; ++Ze)
|
|
2787
|
+
C.push((Ze + 256).toString(16).slice(1));
|
|
2788
|
+
function Oi(s, t = 0) {
|
|
2789
|
+
return (C[s[t + 0]] + C[s[t + 1]] + C[s[t + 2]] + C[s[t + 3]] + "-" + C[s[t + 4]] + C[s[t + 5]] + "-" + C[s[t + 6]] + C[s[t + 7]] + "-" + C[s[t + 8]] + C[s[t + 9]] + "-" + C[s[t + 10]] + C[s[t + 11]] + C[s[t + 12]] + C[s[t + 13]] + C[s[t + 14]] + C[s[t + 15]]).toLowerCase();
|
|
2790
|
+
}
|
|
2791
|
+
var Oe, xi = new Uint8Array(16);
|
|
2792
|
+
function Ri() {
|
|
2739
2793
|
if (!Oe && (Oe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Oe))
|
|
2740
2794
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2741
|
-
return Oe(
|
|
2742
|
-
}
|
|
2743
|
-
const E = [];
|
|
2744
|
-
for (let i = 0; i < 256; ++i)
|
|
2745
|
-
E.push((i + 256).toString(16).slice(1));
|
|
2746
|
-
function Pi(i, t = 0) {
|
|
2747
|
-
return E[i[t + 0]] + E[i[t + 1]] + E[i[t + 2]] + E[i[t + 3]] + "-" + E[i[t + 4]] + E[i[t + 5]] + "-" + E[i[t + 6]] + E[i[t + 7]] + "-" + E[i[t + 8]] + E[i[t + 9]] + "-" + E[i[t + 10]] + E[i[t + 11]] + E[i[t + 12]] + E[i[t + 13]] + E[i[t + 14]] + E[i[t + 15]];
|
|
2795
|
+
return Oe(xi);
|
|
2748
2796
|
}
|
|
2749
|
-
|
|
2750
|
-
|
|
2797
|
+
var Ui = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
2798
|
+
const Rt = {
|
|
2799
|
+
randomUUID: Ui
|
|
2751
2800
|
};
|
|
2752
|
-
function
|
|
2753
|
-
if (
|
|
2754
|
-
return
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
if (
|
|
2801
|
+
function Ut(s, t, e) {
|
|
2802
|
+
if (Rt.randomUUID && !t && !s)
|
|
2803
|
+
return Rt.randomUUID();
|
|
2804
|
+
s = s || {};
|
|
2805
|
+
var i = s.random || (s.rng || Ri)();
|
|
2806
|
+
if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
|
|
2758
2807
|
e = e || 0;
|
|
2759
|
-
for (
|
|
2760
|
-
t[e + n] =
|
|
2808
|
+
for (var n = 0; n < 16; ++n)
|
|
2809
|
+
t[e + n] = i[n];
|
|
2761
2810
|
return t;
|
|
2762
2811
|
}
|
|
2763
|
-
return
|
|
2812
|
+
return Oi(i);
|
|
2764
2813
|
}
|
|
2765
|
-
class
|
|
2814
|
+
class jt {
|
|
2766
2815
|
constructor(t, e) {
|
|
2767
|
-
|
|
2768
|
-
|
|
2816
|
+
g(this, "config");
|
|
2817
|
+
g(this, "sdkConfig");
|
|
2769
2818
|
this.config = t, this.sdkConfig = e;
|
|
2770
2819
|
}
|
|
2771
2820
|
}
|
|
2772
|
-
const
|
|
2773
|
-
var oe, re,
|
|
2774
|
-
class
|
|
2821
|
+
const Lt = 25, _t = 1e4;
|
|
2822
|
+
var ae, oe, re, H, Ee;
|
|
2823
|
+
class Xi extends jt {
|
|
2775
2824
|
constructor(...e) {
|
|
2776
2825
|
super(...e);
|
|
2777
|
-
M(this,
|
|
2826
|
+
M(this, ae, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
|
|
2827
|
+
M(this, oe, void 0);
|
|
2778
2828
|
M(this, re, void 0);
|
|
2779
|
-
M(this, ce, void 0);
|
|
2780
2829
|
M(this, H, []);
|
|
2781
|
-
M(this,
|
|
2782
|
-
|
|
2783
|
-
k(this,
|
|
2830
|
+
M(this, Ee, void 0);
|
|
2831
|
+
g(this, "processQueueForced");
|
|
2832
|
+
k(this, oe, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), k(this, H, []), k(this, Ee, Ut()), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(y(this, ae), {
|
|
2784
2833
|
method: "OPTIONS"
|
|
2785
|
-
}).catch(
|
|
2834
|
+
}).catch(lt), this.subscribe();
|
|
2786
2835
|
}
|
|
2787
2836
|
subscribe() {
|
|
2788
2837
|
window.addEventListener("beforeunload", this.processQueueForced, !1), window.addEventListener("pagehide", this.processQueueForced, !1), window.addEventListener("visibilitychange", this.processQueueForced, !1);
|
|
2789
2838
|
}
|
|
2790
2839
|
schedule() {
|
|
2791
|
-
y(this,
|
|
2840
|
+
y(this, re) && clearTimeout(y(this, re)), k(this, re, window.setTimeout(() => this.processQueue(), _t));
|
|
2792
2841
|
}
|
|
2793
2842
|
send(e) {
|
|
2794
|
-
k(this,
|
|
2843
|
+
k(this, oe, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime());
|
|
2795
2844
|
try {
|
|
2796
|
-
navigator.sendBeacon(y(this,
|
|
2845
|
+
navigator.sendBeacon(y(this, ae), JSON.stringify(e));
|
|
2797
2846
|
} catch {
|
|
2798
|
-
fetch(y(this,
|
|
2847
|
+
fetch(y(this, ae), {
|
|
2799
2848
|
body: JSON.stringify(e),
|
|
2800
2849
|
method: "POST",
|
|
2801
2850
|
headers: {
|
|
2802
2851
|
"Content-Type": "application/json"
|
|
2803
2852
|
},
|
|
2804
2853
|
keepalive: !0
|
|
2805
|
-
}).catch(
|
|
2854
|
+
}).catch(lt);
|
|
2806
2855
|
}
|
|
2807
2856
|
this.schedule();
|
|
2808
2857
|
}
|
|
@@ -2810,46 +2859,47 @@ class qi extends Nt {
|
|
|
2810
2859
|
y(this, H).push(e), this.processQueue();
|
|
2811
2860
|
}
|
|
2812
2861
|
processQueue(e = !1) {
|
|
2813
|
-
if (!(this.sdkConfig == null || !this.sdkConfig.ui.feature.allowTelemetry) && !(!e && y(this, H).length <
|
|
2862
|
+
if (!(this.sdkConfig == null || !this.sdkConfig.ui.feature.allowTelemetry) && !(!e && y(this, H).length < Lt && /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime() - y(this, oe) < _t))
|
|
2814
2863
|
for (; y(this, H).length; ) {
|
|
2815
|
-
const
|
|
2864
|
+
const i = y(this, H).splice(0, Lt).map((n) => ({
|
|
2816
2865
|
...n,
|
|
2817
|
-
sessionID: y(this,
|
|
2866
|
+
sessionID: y(this, Ee),
|
|
2818
2867
|
userID: this.sdkConfig.api.user
|
|
2819
2868
|
}));
|
|
2820
|
-
this.send(
|
|
2869
|
+
this.send(i);
|
|
2821
2870
|
}
|
|
2822
2871
|
}
|
|
2823
|
-
track(e,
|
|
2872
|
+
track(e, i) {
|
|
2824
2873
|
this.addToQueue({
|
|
2825
2874
|
eventName: e,
|
|
2826
|
-
eventParams:
|
|
2875
|
+
eventParams: i,
|
|
2827
2876
|
eventTimestamp: /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime(),
|
|
2828
|
-
eventUUID:
|
|
2877
|
+
eventUUID: Ut()
|
|
2829
2878
|
});
|
|
2830
2879
|
}
|
|
2831
2880
|
}
|
|
2832
|
-
|
|
2833
|
-
const
|
|
2834
|
-
class
|
|
2881
|
+
ae = new WeakMap(), oe = new WeakMap(), re = new WeakMap(), H = new WeakMap(), Ee = new WeakMap();
|
|
2882
|
+
const Li = U("LoggingTracker", "color:#000000;font-weight:bold;");
|
|
2883
|
+
class Ki extends jt {
|
|
2835
2884
|
track(t, e) {
|
|
2836
|
-
|
|
2885
|
+
Li(`@${this.sdkConfig.api.user}`, `[${t}]`, e);
|
|
2837
2886
|
}
|
|
2838
2887
|
}
|
|
2839
2888
|
export {
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2889
|
+
Fi as BasicPlugin,
|
|
2890
|
+
j as CasinoPlugin,
|
|
2891
|
+
Ni as DebuggingPlugin,
|
|
2892
|
+
Gi as GigPlugin,
|
|
2893
|
+
Wi as KalambaBullseyeParsers,
|
|
2894
|
+
$i as KalambaBullseyePlugin,
|
|
2895
|
+
ji as KalambaStargazerPlugin,
|
|
2896
|
+
Xi as KalambaStargazerTracker,
|
|
2897
|
+
Ki as LoggingTracker,
|
|
2898
|
+
Hi as OryxPlugin,
|
|
2899
|
+
Vi as PariplayPlugin,
|
|
2900
|
+
zi as RelaxFEIMPlugin,
|
|
2901
|
+
wi as RgsPlugin,
|
|
2902
|
+
Mi as TelemetryPlugin,
|
|
2903
|
+
jt as Tracker,
|
|
2904
|
+
qi as TukoPlugin
|
|
2855
2905
|
};
|