@kalamba/sdk 0.7.0 → 0.8.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/{errors-c5948a4a.cjs → errors-358575c3.cjs} +1 -1
- package/dist/{errors-867a013a.js → errors-afd9f527.js} +44 -11
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +24 -19
- package/dist/index.js +18 -15
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +34 -27
- package/dist/plugins.js +408 -409
- package/dist/wrapper.cjs +1 -1
- package/dist/wrapper.d.ts +38 -29
- package/dist/wrapper.js +669 -629
- package/package.json +1 -1
package/dist/plugins.js
CHANGED
|
@@ -2,31 +2,32 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var Ht = Object.defineProperty;
|
|
6
|
+
var Vt = (i, t, e) => t in i ? Ht(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
7
|
+
var b = (i, t, e) => (Vt(i, typeof t != "symbol" ? t + "" : t, e), e), rt = (i, t, e) => {
|
|
8
8
|
if (!t.has(i))
|
|
9
9
|
throw TypeError("Cannot " + e);
|
|
10
10
|
};
|
|
11
|
-
var y = (i, t, e) => (
|
|
11
|
+
var y = (i, t, e) => (rt(i, t, "read from private field"), e ? e.call(i) : t.get(i)), C = (i, t, e) => {
|
|
12
12
|
if (t.has(i))
|
|
13
13
|
throw TypeError("Cannot add the same private member more than once");
|
|
14
14
|
t instanceof WeakSet ? t.add(i) : t.set(i, e);
|
|
15
|
-
}, v = (i, t, e, a) => (
|
|
16
|
-
import { a as
|
|
17
|
-
import { a as
|
|
15
|
+
}, v = (i, t, e, a) => (rt(i, t, "write to private field"), a ? a.call(i, e) : t.set(i, e), e);
|
|
16
|
+
import { a as Ne } from "./errors-afd9f527.js";
|
|
17
|
+
import { a as ct } from "./noop-3336849b.js";
|
|
18
18
|
function U(i, t) {
|
|
19
19
|
return (e, ...a) => {
|
|
20
20
|
console.log(`[%c${i}\x1B[m] %s`, t, e, ...a);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Bt(i, t) {
|
|
24
24
|
return Math.round(i * 100 / t);
|
|
25
25
|
}
|
|
26
26
|
class j {
|
|
27
|
-
constructor(t) {
|
|
28
|
-
|
|
29
|
-
this
|
|
27
|
+
constructor(t, e) {
|
|
28
|
+
b(this, "config");
|
|
29
|
+
b(this, "sdkConfig");
|
|
30
|
+
this.config = t, this.sdkConfig = e;
|
|
30
31
|
}
|
|
31
32
|
on(t, e, a) {
|
|
32
33
|
const n = function(s) {
|
|
@@ -41,10 +42,10 @@ class j {
|
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
const
|
|
45
|
-
class
|
|
45
|
+
const zt = U("BasicPlugin", "color:#000000;font-weight:bold;");
|
|
46
|
+
class _i extends j {
|
|
46
47
|
constructor(...t) {
|
|
47
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
48
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), zt("configured");
|
|
48
49
|
}
|
|
49
50
|
registerToSdkEvents() {
|
|
50
51
|
window.addEventListener("message", (t) => {
|
|
@@ -55,8 +56,8 @@ class Fi extends j {
|
|
|
55
56
|
this.send("settings", { music: a == null ? void 0 : a.musicEnabled, sounds: a == null ? void 0 : a.soundEnabled });
|
|
56
57
|
return;
|
|
57
58
|
case "doBalanceUpdate":
|
|
58
|
-
const { currency: n, coinValueInCents: r } = this.
|
|
59
|
-
a.currency === n && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance:
|
|
59
|
+
const { currency: n, coinValueInCents: r } = this.sdkConfig.api;
|
|
60
|
+
a.currency === n && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance: Bt(a.balanceInCurrency, r) }) : (a.balanceInCoins, this.send("balance", { balance: a.balanceInCoins }));
|
|
60
61
|
return;
|
|
61
62
|
case "doGamePause":
|
|
62
63
|
this.send("freeze");
|
|
@@ -76,11 +77,11 @@ class Fi extends j {
|
|
|
76
77
|
}
|
|
77
78
|
registerFromSdkEvents() {
|
|
78
79
|
this.on("close", () => {
|
|
79
|
-
if (this.
|
|
80
|
+
if (this.sdkConfig.api.homeUrl)
|
|
80
81
|
try {
|
|
81
|
-
window.top.location = this.
|
|
82
|
+
window.top.location = this.sdkConfig.api.homeUrl;
|
|
82
83
|
} catch {
|
|
83
|
-
window.location = this.
|
|
84
|
+
window.location = this.sdkConfig.api.homeUrl;
|
|
84
85
|
}
|
|
85
86
|
else
|
|
86
87
|
try {
|
|
@@ -91,8 +92,8 @@ class Fi extends j {
|
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
const k = U("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"),
|
|
95
|
-
class
|
|
95
|
+
const k = U("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), qt = U("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
|
|
96
|
+
class Fi extends j {
|
|
96
97
|
constructor(...t) {
|
|
97
98
|
super(...t), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
|
|
98
99
|
}
|
|
@@ -116,13 +117,13 @@ class Di extends j {
|
|
|
116
117
|
this.on("autoplay", (t) => k("autoplay", t)), this.on("balance", (t) => k("balance", t)), this.on("bet", (t) => k("bet", t)), this.on("cashier", (t) => k("cashier", t)), this.on("choice", (t) => k("choice", t)), this.on("close", (t) => k("close", t)), this.on("error", (t) => k("error", t)), this.on("loadEnd", (t) => k("loadEnd", t)), this.on("loadProgress", (t) => k("loadProgress", t)), this.on("loadStart", (t) => k("loadStart", t)), this.on("playCycleStart", (t) => k("playCycleStart", t)), this.on("playCycleEnd", (t) => k("playCycleEnd", t)), this.on("playEnd", (t) => k("playEnd", t)), this.on("playError", (t) => k("playError", t)), this.on("playReady", (t) => k("playReady", t)), this.on("playStart", (t) => k("playStart", t)), this.on("settings", (t) => k("settings", t));
|
|
117
118
|
}
|
|
118
119
|
_send(...t) {
|
|
119
|
-
|
|
120
|
+
qt(...t), this.send(...t);
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
|
-
const
|
|
123
|
-
class
|
|
123
|
+
const Gt = U("GigPlugin", "color:#000000;font-weight:bold;");
|
|
124
|
+
class Di extends j {
|
|
124
125
|
constructor(...t) {
|
|
125
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
126
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Gt("configured");
|
|
126
127
|
}
|
|
127
128
|
postMessage(t) {
|
|
128
129
|
const e = {
|
|
@@ -153,11 +154,11 @@ class Ni extends j {
|
|
|
153
154
|
}
|
|
154
155
|
registerFromSdkEvents() {
|
|
155
156
|
this.on("close", () => {
|
|
156
|
-
if (this.
|
|
157
|
+
if (this.sdkConfig.api.homeUrl)
|
|
157
158
|
try {
|
|
158
|
-
window.top.location = this.
|
|
159
|
+
window.top.location = this.sdkConfig.api.homeUrl;
|
|
159
160
|
} catch {
|
|
160
|
-
window.location = this.
|
|
161
|
+
window.location = this.sdkConfig.api.homeUrl;
|
|
161
162
|
}
|
|
162
163
|
else
|
|
163
164
|
try {
|
|
@@ -170,10 +171,10 @@ class Ni extends j {
|
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
|
-
const
|
|
174
|
-
class
|
|
174
|
+
const Wt = U("OryxPlugin", "color:#000000;font-weight:bold;");
|
|
175
|
+
class Ni extends j {
|
|
175
176
|
constructor(...t) {
|
|
176
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
177
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Wt("configured");
|
|
177
178
|
}
|
|
178
179
|
registerToSdkEvents() {
|
|
179
180
|
window.addEventListener("message", (t) => {
|
|
@@ -225,15 +226,15 @@ class Ri extends j {
|
|
|
225
226
|
});
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
|
-
const
|
|
229
|
-
function
|
|
229
|
+
const dt = U("PariplayPlugin", "color:#000000;font-weight:bold;");
|
|
230
|
+
function Ve(i) {
|
|
230
231
|
try {
|
|
231
232
|
window.top.location = i;
|
|
232
233
|
} catch {
|
|
233
234
|
window.location = i;
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function ze(i, t) {
|
|
237
238
|
return new Promise(function(a, n) {
|
|
238
239
|
const r = new XMLHttpRequest();
|
|
239
240
|
r.onload = function() {
|
|
@@ -241,65 +242,65 @@ function qe(i, t) {
|
|
|
241
242
|
}, r.open(i, t), r.send();
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
|
-
function
|
|
245
|
+
function qe() {
|
|
245
246
|
}
|
|
246
|
-
function
|
|
247
|
+
function $t(i) {
|
|
247
248
|
return i.filter(function(e) {
|
|
248
249
|
return e.messageType.toUpperCase() === "DATA";
|
|
249
250
|
});
|
|
250
251
|
}
|
|
251
|
-
function
|
|
252
|
+
function Ge(i) {
|
|
252
253
|
return i.filter(function(e) {
|
|
253
254
|
return ["NOTIFICATION", "POPUP"].includes(e.messageType.toUpperCase());
|
|
254
255
|
});
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
+
function _t(i) {
|
|
257
258
|
try {
|
|
258
259
|
return JSON.parse(i.text);
|
|
259
260
|
} catch {
|
|
260
261
|
return {};
|
|
261
262
|
}
|
|
262
263
|
}
|
|
263
|
-
function
|
|
264
|
-
return i.map(
|
|
264
|
+
function jt(i) {
|
|
265
|
+
return i.map(_t).filter(Boolean).find(function(e) {
|
|
265
266
|
return e.betId != null && e.winId != null;
|
|
266
267
|
}) || {};
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
-
return i.map(
|
|
269
|
+
function Qt(i) {
|
|
270
|
+
return i.map(_t).filter(Boolean).find(function(e) {
|
|
270
271
|
return e.TotalBet != null && e.TotalWin != null;
|
|
271
272
|
}) || {};
|
|
272
273
|
}
|
|
273
|
-
class
|
|
274
|
+
class Ri extends j {
|
|
274
275
|
constructor(...t) {
|
|
275
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
276
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), dt("configured");
|
|
276
277
|
}
|
|
277
278
|
postMessage(t, e) {
|
|
278
279
|
const a = {
|
|
279
|
-
lang: this.
|
|
280
|
-
sender: this.
|
|
280
|
+
lang: this.sdkConfig.ui.language,
|
|
281
|
+
sender: this.sdkConfig.api.game,
|
|
281
282
|
type: t
|
|
282
283
|
};
|
|
283
|
-
e != null && (a.data = e),
|
|
284
|
+
e != null && (a.data = e), dt("postMessage", a), window.parent.postMessage(a, "*");
|
|
284
285
|
}
|
|
285
286
|
coinsToCurrency(t) {
|
|
286
|
-
return t * this.
|
|
287
|
+
return t * this.sdkConfig.api.coinValueInCents / 100;
|
|
287
288
|
}
|
|
288
289
|
handleContinueButton(t, e) {
|
|
289
|
-
t.link &&
|
|
290
|
+
t.link && ze("GET", t.link), e();
|
|
290
291
|
}
|
|
291
292
|
handleLinkButton(t, e) {
|
|
292
293
|
switch (t.linkType.toUpperCase()) {
|
|
293
294
|
case "AJAX":
|
|
294
|
-
|
|
295
|
+
ze("GET", t.link), e();
|
|
295
296
|
return;
|
|
296
297
|
case "AJAXRESPONSE":
|
|
297
|
-
|
|
298
|
+
ze("GET", t.link).then(() => {
|
|
298
299
|
e();
|
|
299
300
|
});
|
|
300
301
|
return;
|
|
301
302
|
case "REDIRECT":
|
|
302
|
-
|
|
303
|
+
Ve(t.link), e();
|
|
303
304
|
return;
|
|
304
305
|
}
|
|
305
306
|
}
|
|
@@ -324,15 +325,15 @@ class Hi extends j {
|
|
|
324
325
|
processInfoUiMessages(t) {
|
|
325
326
|
return t.reduce((e, a) => e.then(() => new Promise((n) => {
|
|
326
327
|
Object.assign({}, a, {
|
|
327
|
-
buttons: a.buttons.filter((r) => r.action.toUpperCase() === "CASHIER" ? !!this.
|
|
328
|
+
buttons: a.buttons.filter((r) => r.action.toUpperCase() === "CASHIER" ? !!this.sdkConfig.api.cashierUrl : !0).map((r) => Object.assign({}, r, {
|
|
328
329
|
onRelease: () => {
|
|
329
|
-
const s = a.messageType.toUpperCase() === "POPUP" ?
|
|
330
|
+
const s = a.messageType.toUpperCase() === "POPUP" ? qe : n, h = this.buttonActions[r.action.toUpperCase()];
|
|
330
331
|
h ? h(r, s) : s();
|
|
331
332
|
}
|
|
332
333
|
}))
|
|
333
334
|
});
|
|
334
|
-
}).catch(
|
|
335
|
-
}).catch(
|
|
335
|
+
}).catch(qe)), Promise.resolve()).then(() => {
|
|
336
|
+
}).catch(qe);
|
|
336
337
|
}
|
|
337
338
|
registerToSdkEvents() {
|
|
338
339
|
window.addEventListener("message", (t) => {
|
|
@@ -363,7 +364,7 @@ class Hi extends j {
|
|
|
363
364
|
let a;
|
|
364
365
|
try {
|
|
365
366
|
const n = JSON.parse(
|
|
366
|
-
JSON.parse(atob(this.
|
|
367
|
+
JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token
|
|
367
368
|
), r = JSON.parse(n.integrationSpecificAttributes.sessionData || "{}");
|
|
368
369
|
a = {
|
|
369
370
|
ClientToken: n.integrationSpecificAttributes.clientToken,
|
|
@@ -379,7 +380,7 @@ class Hi extends j {
|
|
|
379
380
|
success: !0
|
|
380
381
|
});
|
|
381
382
|
try {
|
|
382
|
-
const n =
|
|
383
|
+
const n = Ge(e.contract.uiMessages);
|
|
383
384
|
this.processInfoUiMessages(n);
|
|
384
385
|
} catch {
|
|
385
386
|
}
|
|
@@ -388,22 +389,22 @@ class Hi extends j {
|
|
|
388
389
|
amount: this.coinsToCurrency(e)
|
|
389
390
|
}));
|
|
390
391
|
}), this.on("close", () => {
|
|
391
|
-
if (this.
|
|
392
|
-
if (this.
|
|
392
|
+
if (this.sdkConfig.api.homeUrl)
|
|
393
|
+
if (this.sdkConfig.api.homeUrl === "(back)")
|
|
393
394
|
try {
|
|
394
395
|
window.top.history.back();
|
|
395
396
|
} catch {
|
|
396
397
|
window.history.back();
|
|
397
398
|
}
|
|
398
399
|
else
|
|
399
|
-
this.
|
|
400
|
+
this.sdkConfig.api.homeUrl === "(api)" ? this.postMessage("quit") : Ve(this.sdkConfig.api.homeUrl);
|
|
400
401
|
}), this.on("playEnd", (e) => {
|
|
401
402
|
this.postMessage("roundEnded", {
|
|
402
403
|
balanceAfter: this.coinsToCurrency(e.contract.balance.coins),
|
|
403
404
|
win: this.coinsToCurrency(e.contract.win.round)
|
|
404
405
|
});
|
|
405
406
|
try {
|
|
406
|
-
const a =
|
|
407
|
+
const a = Ge(e.contract.uiMessages);
|
|
407
408
|
this.processInfoUiMessages(a);
|
|
408
409
|
} catch {
|
|
409
410
|
}
|
|
@@ -423,7 +424,7 @@ class Hi extends j {
|
|
|
423
424
|
e.contract.balance.coins + e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier
|
|
424
425
|
)
|
|
425
426
|
});
|
|
426
|
-
const a = ["BaseGame", "PaidSpin"].includes(e.contract.stateType.thisRound), n =
|
|
427
|
+
const a = ["BaseGame", "PaidSpin"].includes(e.contract.stateType.thisRound), n = $t(e.contract.uiMessages), r = Ge(e.contract.uiMessages), s = jt(n), h = Qt(n);
|
|
427
428
|
this.postMessage("ticketReceived", {
|
|
428
429
|
Balance: this.coinsToCurrency(e.contract.balance.coins),
|
|
429
430
|
BetAmount: a ? this.coinsToCurrency(e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier) : 0,
|
|
@@ -445,20 +446,20 @@ class Hi extends j {
|
|
|
445
446
|
}), this.on("loadStart", () => {
|
|
446
447
|
this.postMessage("onAppFrameReady");
|
|
447
448
|
}), this.on("cashier", () => {
|
|
448
|
-
this.
|
|
449
|
+
this.sdkConfig.api.cashierUrl && (this.sdkConfig.api.cashierUrl === "(api)" ? this.postMessage("cashier") : Ve(this.sdkConfig.api.cashierUrl));
|
|
449
450
|
});
|
|
450
451
|
}
|
|
451
452
|
}
|
|
452
453
|
const ge = U("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
|
|
453
|
-
class
|
|
454
|
+
class Hi extends j {
|
|
454
455
|
constructor(...e) {
|
|
455
456
|
super(...e);
|
|
456
|
-
|
|
457
|
+
b(this, "VERSION", "1.15.0");
|
|
457
458
|
const a = document.createElement("script");
|
|
458
459
|
a.src = `https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`, a.onload = () => {
|
|
459
460
|
ge("loaded"), window.FEIM.configure({
|
|
460
461
|
p2pConfig: {
|
|
461
|
-
currency: this.
|
|
462
|
+
currency: this.sdkConfig.api.currency,
|
|
462
463
|
launchParams: {
|
|
463
464
|
// unified with KalambaSdkConfig
|
|
464
465
|
homeurl: "homeUrl"
|
|
@@ -524,20 +525,20 @@ class Vi extends j {
|
|
|
524
525
|
});
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
|
-
const
|
|
528
|
-
class
|
|
528
|
+
const We = U("TukoPlugin", "color:#000000;font-weight:bold;");
|
|
529
|
+
class Vi extends j {
|
|
529
530
|
constructor(...e) {
|
|
530
531
|
super(...e);
|
|
531
|
-
|
|
532
|
+
b(this, "PING_INTERVAL", 1e4);
|
|
532
533
|
const n = new URLSearchParams(window.location.search).get("pingCallbackUrl");
|
|
533
534
|
n && window.setInterval(() => {
|
|
534
535
|
this.ping(n);
|
|
535
|
-
}, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
536
|
+
}, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), We("configured");
|
|
536
537
|
}
|
|
537
538
|
ping(e) {
|
|
538
539
|
const a = new XMLHttpRequest();
|
|
539
540
|
a.onreadystatechange = function() {
|
|
540
|
-
a.readyState === XMLHttpRequest.DONE && (a.status === 0 || a.status >= 200 && a.status < 400 ?
|
|
541
|
+
a.readyState === XMLHttpRequest.DONE && (a.status === 0 || a.status >= 200 && a.status < 400 ? We("ping ok", a) : We("ping error", a));
|
|
541
542
|
}, a.open("GET", e), a.send();
|
|
542
543
|
}
|
|
543
544
|
registerToSdkEvents() {
|
|
@@ -549,8 +550,8 @@ class zi extends j {
|
|
|
549
550
|
this.send("settings", { music: n == null ? void 0 : n.musicEnabled, sounds: n == null ? void 0 : n.soundEnabled });
|
|
550
551
|
return;
|
|
551
552
|
case "doBalanceUpdate":
|
|
552
|
-
const { currency: r, coinValueInCents: s } = this.
|
|
553
|
-
n.currency === r && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance:
|
|
553
|
+
const { currency: r, coinValueInCents: s } = this.sdkConfig.api;
|
|
554
|
+
n.currency === r && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance: Bt(n.balanceInCurrency, s) }) : (n.balanceInCoins, this.send("balance", { balance: n.balanceInCoins }));
|
|
554
555
|
return;
|
|
555
556
|
case "doGamePause":
|
|
556
557
|
this.send("freeze");
|
|
@@ -570,11 +571,11 @@ class zi extends j {
|
|
|
570
571
|
}
|
|
571
572
|
registerFromSdkEvents() {
|
|
572
573
|
this.on("close", () => {
|
|
573
|
-
if (this.
|
|
574
|
+
if (this.sdkConfig.api.homeUrl)
|
|
574
575
|
try {
|
|
575
|
-
window.top.location = this.
|
|
576
|
+
window.top.location = this.sdkConfig.api.homeUrl;
|
|
576
577
|
} catch {
|
|
577
|
-
window.location = this.
|
|
578
|
+
window.location = this.sdkConfig.api.homeUrl;
|
|
578
579
|
}
|
|
579
580
|
else
|
|
580
581
|
try {
|
|
@@ -585,10 +586,11 @@ class zi extends j {
|
|
|
585
586
|
});
|
|
586
587
|
}
|
|
587
588
|
}
|
|
588
|
-
class
|
|
589
|
-
constructor(t) {
|
|
590
|
-
|
|
591
|
-
this
|
|
589
|
+
class Xt {
|
|
590
|
+
constructor(t, e) {
|
|
591
|
+
b(this, "config");
|
|
592
|
+
b(this, "sdkConfig");
|
|
593
|
+
this.config = t, this.sdkConfig = e;
|
|
592
594
|
}
|
|
593
595
|
on(t, e, a) {
|
|
594
596
|
const n = function(s) {
|
|
@@ -603,16 +605,16 @@ class Kt {
|
|
|
603
605
|
});
|
|
604
606
|
}
|
|
605
607
|
}
|
|
606
|
-
class
|
|
608
|
+
class Kt {
|
|
607
609
|
constructor(t) {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
610
|
+
b(this, "socket", null);
|
|
611
|
+
b(this, "webSocketUrl");
|
|
612
|
+
b(this, "eventListeners", {
|
|
611
613
|
close: [],
|
|
612
614
|
error: [],
|
|
613
615
|
message: []
|
|
614
616
|
});
|
|
615
|
-
|
|
617
|
+
b(this, "connect", () => {
|
|
616
618
|
const t = new WebSocket(this.webSocketUrl);
|
|
617
619
|
return t.addEventListener("message", this.handleMessage), new Promise((e) => {
|
|
618
620
|
t.addEventListener("open", (a) => {
|
|
@@ -620,34 +622,34 @@ class Jt {
|
|
|
620
622
|
});
|
|
621
623
|
});
|
|
622
624
|
});
|
|
623
|
-
|
|
625
|
+
b(this, "send", (t) => {
|
|
624
626
|
if (this.socket == null)
|
|
625
627
|
throw new Error("Cannot send message, the WebSocket connection is not open");
|
|
626
628
|
this.socket.send(t);
|
|
627
629
|
});
|
|
628
|
-
|
|
630
|
+
b(this, "close", () => {
|
|
629
631
|
if (this.socket == null)
|
|
630
632
|
throw new Error("Cannot close the WebSocket connection that is not open");
|
|
631
633
|
this.socket.close(), this.addEventListener("error", (t) => {
|
|
632
634
|
console.log(t);
|
|
633
635
|
});
|
|
634
636
|
});
|
|
635
|
-
|
|
637
|
+
b(this, "handleClose", (t) => {
|
|
636
638
|
this.eventListeners.close.forEach((e) => {
|
|
637
639
|
e(t);
|
|
638
640
|
});
|
|
639
641
|
});
|
|
640
|
-
|
|
642
|
+
b(this, "handleError", (t) => {
|
|
641
643
|
this.eventListeners.error.forEach((e) => {
|
|
642
644
|
e(t);
|
|
643
645
|
});
|
|
644
646
|
});
|
|
645
|
-
|
|
647
|
+
b(this, "handleMessage", (t) => {
|
|
646
648
|
this.eventListeners.message.forEach((e) => {
|
|
647
649
|
e(t);
|
|
648
650
|
});
|
|
649
651
|
});
|
|
650
|
-
|
|
652
|
+
b(this, "handleOpen", (t) => {
|
|
651
653
|
const e = t.target;
|
|
652
654
|
e.addEventListener("close", this.handleClose), e.addEventListener("error", this.handleError), this.socket = e;
|
|
653
655
|
});
|
|
@@ -661,31 +663,31 @@ class Jt {
|
|
|
661
663
|
a !== -1 && this.eventListeners[t].splice(a, 1);
|
|
662
664
|
}
|
|
663
665
|
}
|
|
664
|
-
function
|
|
666
|
+
function Me(i) {
|
|
665
667
|
return JSON.parse(i == null ? void 0 : i.data);
|
|
666
668
|
}
|
|
667
|
-
function
|
|
669
|
+
function Jt(i) {
|
|
668
670
|
var t;
|
|
669
671
|
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "Ping";
|
|
670
672
|
}
|
|
671
|
-
function
|
|
673
|
+
function lt(i) {
|
|
672
674
|
var t;
|
|
673
675
|
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "RealityCheck";
|
|
674
676
|
}
|
|
675
|
-
function
|
|
677
|
+
function Le(i) {
|
|
676
678
|
return i.header.name === "GameEvent";
|
|
677
679
|
}
|
|
678
|
-
function
|
|
679
|
-
return
|
|
680
|
+
function Yt(i) {
|
|
681
|
+
return Le(i) && i.body.event === "OPEN_GAME";
|
|
680
682
|
}
|
|
681
|
-
function
|
|
683
|
+
function ut(i) {
|
|
682
684
|
return i.header.code !== 1;
|
|
683
685
|
}
|
|
684
|
-
function
|
|
685
|
-
return
|
|
686
|
+
function Zt(i) {
|
|
687
|
+
return Le(i) && i.body.event.includes("_RESULT");
|
|
686
688
|
}
|
|
687
689
|
var ie, ve;
|
|
688
|
-
class
|
|
690
|
+
class ei extends Kt {
|
|
689
691
|
constructor(e, a) {
|
|
690
692
|
const n = new URL(e.apiUrl);
|
|
691
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);
|
|
@@ -700,7 +702,7 @@ class ti extends Jt {
|
|
|
700
702
|
* request sent. Client and server independently maintain their own
|
|
701
703
|
* correlation id counter.
|
|
702
704
|
*/
|
|
703
|
-
|
|
705
|
+
b(this, "cId", 0);
|
|
704
706
|
// Initial values for header
|
|
705
707
|
/*
|
|
706
708
|
* Increasing message ID
|
|
@@ -712,18 +714,18 @@ class ti extends Jt {
|
|
|
712
714
|
* received out of sync).
|
|
713
715
|
*/
|
|
714
716
|
// TODO make sure messages are processed in order
|
|
715
|
-
|
|
717
|
+
b(this, "mId", 0);
|
|
716
718
|
// Initial values for body
|
|
717
719
|
/*
|
|
718
720
|
* Sequence ID. Action/Event correlation.
|
|
719
721
|
*/
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
const a =
|
|
726
|
-
(
|
|
722
|
+
b(this, "seqId", 10);
|
|
723
|
+
b(this, "gameCode");
|
|
724
|
+
C(this, ie, void 0);
|
|
725
|
+
C(this, ve, void 0);
|
|
726
|
+
b(this, "onMessage", (e) => {
|
|
727
|
+
const a = Me(e);
|
|
728
|
+
(Le(a) || Jt(a) || lt(a)) && this.sendAcknowledgement(a), lt(a) && this.handleRealityCheck(a);
|
|
727
729
|
});
|
|
728
730
|
this.eventListeners.realityCheck = [], this.gameCode = e.gameCode, v(this, ie, a.requestTimeoutMs), v(this, ve, a.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
|
|
729
731
|
}
|
|
@@ -765,7 +767,7 @@ class ti extends Jt {
|
|
|
765
767
|
return new Promise((r, s) => {
|
|
766
768
|
setTimeout(() => s({ type: "timeout" }), y(this, ie));
|
|
767
769
|
const h = (g) => {
|
|
768
|
-
const w =
|
|
770
|
+
const w = Me(g);
|
|
769
771
|
try {
|
|
770
772
|
e.cId === w.header.cId && (this.removeEventListener("message", h), w.header.code === 1 ? r(w) : s({ message: w, type: "error" }));
|
|
771
773
|
} catch {
|
|
@@ -799,8 +801,8 @@ class ti extends Jt {
|
|
|
799
801
|
};
|
|
800
802
|
return new Promise((n, r) => {
|
|
801
803
|
const s = (h) => {
|
|
802
|
-
const g =
|
|
803
|
-
|
|
804
|
+
const g = Me(h);
|
|
805
|
+
Yt(g) ? (this.removeEventListener("message", s), n(g.body)) : ut(g) && r({ data: g.body, type: "error" });
|
|
804
806
|
};
|
|
805
807
|
this.addEventListener("message", s), this.request(e, a).catch(
|
|
806
808
|
(h) => {
|
|
@@ -821,13 +823,13 @@ class ti extends Jt {
|
|
|
821
823
|
};
|
|
822
824
|
return new Promise((s, h) => {
|
|
823
825
|
const g = (w) => {
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
+
const p = Me(w);
|
|
827
|
+
Le(p) && r.seqId === p.body.correlationSeqId && (this.removeEventListener("message", g), Zt(p) ? s(p.body) : ut(p) && h({ data: p.body, type: "error" }));
|
|
826
828
|
};
|
|
827
829
|
this.addEventListener("message", g), this.request(n, r).catch(
|
|
828
830
|
(w) => {
|
|
829
|
-
var
|
|
830
|
-
return h({ data: (
|
|
831
|
+
var p;
|
|
832
|
+
return h({ data: (p = w == null ? void 0 : w.message) == null ? void 0 : p.body, type: w.type });
|
|
831
833
|
}
|
|
832
834
|
);
|
|
833
835
|
});
|
|
@@ -837,7 +839,7 @@ class ti extends Jt {
|
|
|
837
839
|
}
|
|
838
840
|
}
|
|
839
841
|
ie = new WeakMap(), ve = new WeakMap();
|
|
840
|
-
function
|
|
842
|
+
function ti(i) {
|
|
841
843
|
return i.contract ? {
|
|
842
844
|
contract: {
|
|
843
845
|
balance: {
|
|
@@ -866,15 +868,15 @@ function ii(i) {
|
|
|
866
868
|
}
|
|
867
869
|
};
|
|
868
870
|
}
|
|
869
|
-
function
|
|
871
|
+
function ii(i) {
|
|
870
872
|
var t, e;
|
|
871
873
|
return {
|
|
872
874
|
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
873
|
-
code: ((t = i.data) == null ? void 0 : t.code) ??
|
|
875
|
+
code: ((t = i.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
874
876
|
details: (e = i.data) == null ? void 0 : e.details
|
|
875
877
|
};
|
|
876
878
|
}
|
|
877
|
-
function
|
|
879
|
+
function ai(i, t) {
|
|
878
880
|
return t.contract ? {
|
|
879
881
|
contract: {
|
|
880
882
|
bet: {
|
|
@@ -953,15 +955,15 @@ function ni(i, t) {
|
|
|
953
955
|
data: t.data
|
|
954
956
|
};
|
|
955
957
|
}
|
|
956
|
-
function
|
|
958
|
+
function ni(i) {
|
|
957
959
|
var t, e;
|
|
958
960
|
return {
|
|
959
961
|
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
960
|
-
code: ((t = i.data) == null ? void 0 : t.code) ??
|
|
962
|
+
code: ((t = i.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
961
963
|
details: (e = i.data) == null ? void 0 : e.details
|
|
962
964
|
};
|
|
963
965
|
}
|
|
964
|
-
function
|
|
966
|
+
function si(i) {
|
|
965
967
|
return i.contract ? {
|
|
966
968
|
contract: {
|
|
967
969
|
bet: {
|
|
@@ -1022,15 +1024,15 @@ function oi(i) {
|
|
|
1022
1024
|
data: i.data
|
|
1023
1025
|
};
|
|
1024
1026
|
}
|
|
1025
|
-
function
|
|
1027
|
+
function oi(i) {
|
|
1026
1028
|
var t, e;
|
|
1027
1029
|
return {
|
|
1028
1030
|
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
1029
|
-
code: ((t = i.data) == null ? void 0 : t.code) ??
|
|
1031
|
+
code: ((t = i.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
1030
1032
|
details: (e = i.data) == null ? void 0 : e.details
|
|
1031
1033
|
};
|
|
1032
1034
|
}
|
|
1033
|
-
const
|
|
1035
|
+
const ri = {
|
|
1034
1036
|
bul: "bg",
|
|
1035
1037
|
chi: "zh",
|
|
1036
1038
|
zho: "zh",
|
|
@@ -1062,15 +1064,13 @@ const ci = {
|
|
|
1062
1064
|
tur: "tr",
|
|
1063
1065
|
ukr: "uk",
|
|
1064
1066
|
vie: "vi"
|
|
1065
|
-
},
|
|
1066
|
-
|
|
1067
|
-
class qi extends Kt {
|
|
1067
|
+
}, ci = U("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
|
|
1068
|
+
class zi extends Xt {
|
|
1068
1069
|
constructor(...e) {
|
|
1069
1070
|
super(...e);
|
|
1070
1071
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1071
1072
|
// @ts-ignore
|
|
1072
|
-
|
|
1073
|
-
E(this, Ee, "");
|
|
1073
|
+
b(this, "socket");
|
|
1074
1074
|
this.on("openGame", async () => {
|
|
1075
1075
|
try {
|
|
1076
1076
|
const a = await this.openGame();
|
|
@@ -1085,21 +1085,19 @@ class qi extends Kt {
|
|
|
1085
1085
|
} catch (n) {
|
|
1086
1086
|
this.send("playError", n);
|
|
1087
1087
|
}
|
|
1088
|
-
}), this.on("state", ({ version: a }) => {
|
|
1089
|
-
v(this, Ee, a);
|
|
1090
1088
|
}), this.on("configured", (a) => {
|
|
1091
1089
|
this.socket.setRequestTimeoutMs(a.ui.requestTimeoutMs);
|
|
1092
1090
|
}), this.registerFromSdkEvents();
|
|
1093
1091
|
}
|
|
1094
1092
|
initialize(e) {
|
|
1095
|
-
this.socket = new
|
|
1096
|
-
gameVersion:
|
|
1097
|
-
requestTimeoutMs: this.
|
|
1093
|
+
this.socket = new ei(e, {
|
|
1094
|
+
gameVersion: this.config.gameVersion,
|
|
1095
|
+
requestTimeoutMs: this.sdkConfig.ui.requestTimeoutMs
|
|
1098
1096
|
}), this.socket.addEventListener("close", (a) => {
|
|
1099
1097
|
a.code === 1006 && this.reconnect(e);
|
|
1100
1098
|
}), document.addEventListener("visibilitychange", () => {
|
|
1101
1099
|
document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(e);
|
|
1102
|
-
}), this.socket.addEventListener("error", (a) =>
|
|
1100
|
+
}), this.socket.addEventListener("error", (a) => ci("error", a)), this.socket.addEventListener("realityCheck", (a) => {
|
|
1103
1101
|
this.send("realityCheck", a);
|
|
1104
1102
|
});
|
|
1105
1103
|
}
|
|
@@ -1107,27 +1105,27 @@ class qi extends Kt {
|
|
|
1107
1105
|
this.initialize(e), await this.socket.connect(), await this.socket.authenticate(!0), await this.socket.openGame();
|
|
1108
1106
|
}
|
|
1109
1107
|
async openGame() {
|
|
1110
|
-
const e = new URLSearchParams(window.location.search), a = e.get("apiUrl"), n = e.get("cageCode"), r = e.get("gameCode"), s = e.get("operatorCode"), h = e.get("playMode"), g = e.get("token"), w = e.get("username"),
|
|
1108
|
+
const e = new URLSearchParams(window.location.search), a = e.get("apiUrl"), n = e.get("cageCode"), r = e.get("gameCode"), s = e.get("operatorCode"), h = e.get("playMode"), g = e.get("token"), w = e.get("username"), p = e.get("gameHistoryUrl"), A = e.get("homeUrl") ?? void 0, R = e.get("cashierUrl") ?? void 0;
|
|
1111
1109
|
this.initialize({ apiUrl: a, cageCode: n, gameCode: r, operatorCode: s, playMode: h, token: g, username: w });
|
|
1112
1110
|
try {
|
|
1113
1111
|
await this.socket.connect();
|
|
1114
1112
|
} catch {
|
|
1115
|
-
throw { type: "error", data: { code:
|
|
1113
|
+
throw { type: "error", data: { code: Ne.CONNECTION_ERROR } };
|
|
1116
1114
|
}
|
|
1117
1115
|
let Q;
|
|
1118
1116
|
try {
|
|
1119
1117
|
Q = await this.socket.authenticate();
|
|
1120
1118
|
} catch (B) {
|
|
1121
|
-
throw { type: B.type, data: B.type === "error" ?
|
|
1119
|
+
throw { type: B.type, data: B.type === "error" ? ii(B.data) : void 0 };
|
|
1122
1120
|
}
|
|
1123
1121
|
let X;
|
|
1124
1122
|
try {
|
|
1125
1123
|
X = await this.socket.openGame();
|
|
1126
1124
|
} catch (B) {
|
|
1127
|
-
throw { type: B.type, data: B.type === "error" ?
|
|
1125
|
+
throw { type: B.type, data: B.type === "error" ? ni(B.data) : void 0 };
|
|
1128
1126
|
}
|
|
1129
|
-
const L =
|
|
1130
|
-
this.
|
|
1127
|
+
const L = ti(Q), he = ai(Q, X);
|
|
1128
|
+
this.sdkConfig.api = {
|
|
1131
1129
|
brand: n,
|
|
1132
1130
|
game: r,
|
|
1133
1131
|
integration: s,
|
|
@@ -1140,14 +1138,14 @@ class qi extends Kt {
|
|
|
1140
1138
|
country: L.contract.country,
|
|
1141
1139
|
currency: L.contract.currency,
|
|
1142
1140
|
coinValueInCents: L.contract.coinValueInCents,
|
|
1143
|
-
gameHistoryUrl:
|
|
1141
|
+
gameHistoryUrl: p,
|
|
1144
1142
|
homeUrl: A,
|
|
1145
1143
|
cashierUrl: R,
|
|
1146
1144
|
sessionId: he.contract.sessionId,
|
|
1147
1145
|
lastRoundId: he.contract.roundId
|
|
1148
1146
|
};
|
|
1149
1147
|
const x = e.get("languageCode");
|
|
1150
|
-
return x && (this.
|
|
1148
|
+
return x && (this.sdkConfig.ui.language = x.length === 3 ? ri[x] ?? x : x), he;
|
|
1151
1149
|
}
|
|
1152
1150
|
async play(e) {
|
|
1153
1151
|
const {
|
|
@@ -1164,32 +1162,31 @@ class qi extends Kt {
|
|
|
1164
1162
|
let w;
|
|
1165
1163
|
try {
|
|
1166
1164
|
w = await this.socket.sendAction(h, g);
|
|
1167
|
-
} catch (
|
|
1168
|
-
throw { type:
|
|
1165
|
+
} catch (p) {
|
|
1166
|
+
throw { type: p.type, data: p.type === "error" ? oi(p.data) : void 0 };
|
|
1169
1167
|
}
|
|
1170
|
-
return
|
|
1168
|
+
return si(w);
|
|
1171
1169
|
}
|
|
1172
1170
|
registerFromSdkEvents() {
|
|
1173
1171
|
this.on("history", () => {
|
|
1174
1172
|
const {
|
|
1175
1173
|
api: { game: e, integration: a, integrationData: n, jurisdiction: r, user: s, gameHistoryUrl: h },
|
|
1176
1174
|
ui: { language: g }
|
|
1177
|
-
} = this.
|
|
1178
|
-
|
|
1175
|
+
} = this.sdkConfig, w = s.replace(/^user_/, "").replace(new RegExp(`_${a}$`), ""), p = new URL(h);
|
|
1176
|
+
p.searchParams.set("gameCode", e), p.searchParams.set("jurisdiction", r), p.searchParams.set("operatorCode", a), p.searchParams.set("token", n.token), p.searchParams.set("username", w), p.searchParams.set("languageCode", g), window.open(p.toString(), "_blank");
|
|
1179
1177
|
});
|
|
1180
1178
|
}
|
|
1181
1179
|
}
|
|
1182
|
-
|
|
1183
|
-
var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le = "object", et = "string", fe = "major", d = "model", o = "name", l = "type", u = "vendor", c = "version", S = "architecture", Z = "console", m = "mobile", f = "tablet", C = "smarttv", Y = "wearable", tt = "embedded", wt = "user-agent", it = 500, st = "brands", W = "formFactor", ot = "fullVersionList", ee = "platform", rt = "platformVersion", He = "bitness", G = "sec-ch-ua", ui = G + "-full-version-list", hi = G + "-arch", gi = G + "-" + He, wi = G + "-form-factor", bi = G + "-" + m, pi = G + "-" + d, Dt = G + "-" + ee, mi = Dt + "-version", Nt = [st, ot, m, d, ee, rt, S, W, He], T = "browser", _ = "cpu", O = "device", F = "engine", P = "os", te = "result", Ce = "Amazon", we = "Apple", bt = "ASUS", pt = "BlackBerry", Te = "Google", mt = "Huawei", ft = "Lenovo", je = "LG", Le = "Microsoft", yt = "Motorola", Ae = "Samsung", vt = "Sharp", Pe = "Sony", Qe = "Xiaomi", Xe = "Zebra", K = "Mobile ", J = " Browser", xe = "Chrome", fi = "Edge", be = "Firefox", pe = "Opera", Et = "Facebook", kt = "Sogou", at = "Windows", yi = typeof window !== z, I = yi && window.navigator ? window.navigator : void 0, H = I && I.userAgentData ? I.userAgentData : void 0, vi = function(i, t) {
|
|
1180
|
+
var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", z = "undefined", le = "object", Ze = "string", fe = "major", d = "model", o = "name", l = "type", u = "vendor", c = "version", M = "architecture", Z = "console", m = "mobile", f = "tablet", I = "smarttv", Y = "wearable", et = "embedded", gt = "user-agent", tt = 500, nt = "brands", W = "formFactor", st = "fullVersionList", ee = "platform", ot = "platformVersion", Re = "bitness", G = "sec-ch-ua", li = G + "-full-version-list", ui = G + "-arch", hi = G + "-" + Re, gi = G + "-form-factor", wi = G + "-" + m, bi = G + "-" + d, Ft = G + "-" + ee, pi = Ft + "-version", Dt = [nt, st, m, d, ee, ot, M, W, Re], T = "browser", _ = "cpu", O = "device", F = "engine", P = "os", te = "result", Se = "Amazon", we = "Apple", wt = "ASUS", bt = "BlackBerry", Ie = "Google", pt = "Huawei", mt = "Lenovo", $e = "LG", Ue = "Microsoft", ft = "Motorola", Te = "Samsung", yt = "Sharp", Ae = "Sony", je = "Xiaomi", Qe = "Zebra", K = "Mobile ", J = " Browser", Pe = "Chrome", mi = "Edge", be = "Firefox", pe = "Opera", vt = "Facebook", kt = "Sogou", it = "Windows", fi = typeof window !== z, S = fi && window.navigator ? window.navigator : void 0, H = S && S.userAgentData ? S.userAgentData : void 0, yi = function(i, t) {
|
|
1184
1181
|
var e = {};
|
|
1185
1182
|
for (var a in i)
|
|
1186
1183
|
e[a] = t[a] && t[a].length % 2 === 0 ? t[a].concat(i[a]) : i[a];
|
|
1187
1184
|
return e;
|
|
1188
|
-
},
|
|
1185
|
+
}, He = function(i) {
|
|
1189
1186
|
for (var t = {}, e = 0; e < i.length; e++)
|
|
1190
1187
|
t[i[e].toUpperCase()] = i[e];
|
|
1191
1188
|
return t;
|
|
1192
|
-
},
|
|
1189
|
+
}, at = function(i, t) {
|
|
1193
1190
|
if (typeof i === le && i.length > 0) {
|
|
1194
1191
|
for (var e in i)
|
|
1195
1192
|
if (q(i[e]) == q(t))
|
|
@@ -1197,12 +1194,12 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1197
1194
|
return !1;
|
|
1198
1195
|
}
|
|
1199
1196
|
return ue(i) ? q(t).indexOf(q(i)) !== -1 : !1;
|
|
1200
|
-
},
|
|
1197
|
+
}, Et = function(i) {
|
|
1201
1198
|
for (var t in i)
|
|
1202
1199
|
return /^(browser|cpu|device|engine|os)$/.test(t);
|
|
1203
1200
|
}, ue = function(i) {
|
|
1204
|
-
return typeof i ===
|
|
1205
|
-
},
|
|
1201
|
+
return typeof i === Ze;
|
|
1202
|
+
}, Xe = function(i) {
|
|
1206
1203
|
if (i) {
|
|
1207
1204
|
for (var t = [], e = $(/\\?\"/g, i).split(","), a = 0; a < e.length; a++)
|
|
1208
1205
|
if (e[a].indexOf(";") > -1) {
|
|
@@ -1214,7 +1211,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1214
1211
|
}
|
|
1215
1212
|
}, q = function(i) {
|
|
1216
1213
|
return ue(i) ? i.toLowerCase() : i;
|
|
1217
|
-
},
|
|
1214
|
+
}, Ke = function(i) {
|
|
1218
1215
|
return ue(i) ? $(/[^\d\.]/g, i).split(".")[0] : void 0;
|
|
1219
1216
|
}, D = function(i) {
|
|
1220
1217
|
for (var t in i) {
|
|
@@ -1228,27 +1225,27 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1228
1225
|
return $(/\\?\"/g, i);
|
|
1229
1226
|
}, ye = function(i, t) {
|
|
1230
1227
|
if (ue(i))
|
|
1231
|
-
return i = $(/^\s\s*/, i), typeof t === z ? i : i.substring(0,
|
|
1232
|
-
},
|
|
1228
|
+
return i = $(/^\s\s*/, i), typeof t === z ? i : i.substring(0, tt);
|
|
1229
|
+
}, Ct = function(i, t) {
|
|
1233
1230
|
if (!(!i || !t))
|
|
1234
1231
|
for (var e = 0, a, n, r, s, h, g; e < t.length && !h; ) {
|
|
1235
|
-
var w = t[e],
|
|
1232
|
+
var w = t[e], p = t[e + 1];
|
|
1236
1233
|
for (a = n = 0; a < w.length && !h && w[a]; )
|
|
1237
1234
|
if (h = w[a++].exec(i), h)
|
|
1238
|
-
for (r = 0; r <
|
|
1239
|
-
g = h[++n], s =
|
|
1235
|
+
for (r = 0; r < p.length; r++)
|
|
1236
|
+
g = h[++n], s = p[r], typeof s === le && s.length > 0 ? s.length === 2 ? typeof s[1] == Ye ? this[s[0]] = s[1].call(this, g) : this[s[0]] = s[1] : s.length === 3 ? typeof s[1] === Ye && !(s[1].exec && s[1].test) ? this[s[0]] = g ? s[1].call(this, g, s[2]) : void 0 : this[s[0]] = g ? g.replace(s[1], s[2]) : void 0 : s.length === 4 && (this[s[0]] = g ? s[3].call(this, g.replace(s[1], s[2])) : void 0) : this[s] = g || void 0;
|
|
1240
1237
|
e += 2;
|
|
1241
1238
|
}
|
|
1242
|
-
},
|
|
1239
|
+
}, Be = function(i, t) {
|
|
1243
1240
|
for (var e in t)
|
|
1244
1241
|
if (typeof t[e] === le && t[e].length > 0) {
|
|
1245
1242
|
for (var a = 0; a < t[e].length; a++)
|
|
1246
|
-
if (
|
|
1247
|
-
return e ===
|
|
1248
|
-
} else if (
|
|
1249
|
-
return e ===
|
|
1243
|
+
if (at(t[e][a], i))
|
|
1244
|
+
return e === ht ? void 0 : e;
|
|
1245
|
+
} else if (at(t[e], i))
|
|
1246
|
+
return e === ht ? void 0 : e;
|
|
1250
1247
|
return t.hasOwnProperty("*") ? t["*"] : i;
|
|
1251
|
-
},
|
|
1248
|
+
}, Mt = {
|
|
1252
1249
|
ME: "4.90",
|
|
1253
1250
|
"NT 3.11": "NT3.51",
|
|
1254
1251
|
"NT 4.0": "NT4.0",
|
|
@@ -1260,7 +1257,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1260
1257
|
"8.1": "NT 6.3",
|
|
1261
1258
|
10: ["NT 6.4", "NT 10.0"],
|
|
1262
1259
|
RT: "ARM"
|
|
1263
|
-
},
|
|
1260
|
+
}, St = {
|
|
1264
1261
|
embedded: "Automotive",
|
|
1265
1262
|
mobile: "Mobile",
|
|
1266
1263
|
tablet: ["Tablet", "EInk"],
|
|
@@ -1268,7 +1265,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1268
1265
|
wearable: ["VR", "XR", "Watch"],
|
|
1269
1266
|
"?": ["Desktop", "Unknown"],
|
|
1270
1267
|
"*": void 0
|
|
1271
|
-
},
|
|
1268
|
+
}, It = {
|
|
1272
1269
|
browser: [
|
|
1273
1270
|
[
|
|
1274
1271
|
// Most common regardless engine
|
|
@@ -1363,7 +1360,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1363
1360
|
/slbrowser\/([\w\.]+)/i
|
|
1364
1361
|
// Smart Lenovo Browser
|
|
1365
1362
|
],
|
|
1366
|
-
[c, [o, "Smart " +
|
|
1363
|
+
[c, [o, "Smart " + mt + J]],
|
|
1367
1364
|
[
|
|
1368
1365
|
/(avast|avg)\/([\w\.]+)/i
|
|
1369
1366
|
// Avast/AVG Secure Browser
|
|
@@ -1418,7 +1415,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1418
1415
|
/samsungbrowser\/([\w\.]+)/i
|
|
1419
1416
|
// Samsung Internet
|
|
1420
1417
|
],
|
|
1421
|
-
[c, [o,
|
|
1418
|
+
[c, [o, Te + " Internet"]],
|
|
1422
1419
|
[
|
|
1423
1420
|
/(comodo_dragon)\/([\w\.]+)/i
|
|
1424
1421
|
// Comodo Dragon
|
|
@@ -1455,7 +1452,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1455
1452
|
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
|
|
1456
1453
|
// Facebook App for iOS & Android
|
|
1457
1454
|
],
|
|
1458
|
-
[[o,
|
|
1455
|
+
[[o, vt], c],
|
|
1459
1456
|
[
|
|
1460
1457
|
/(Klarna)\/([\w\.]+)/i,
|
|
1461
1458
|
// Klarna Shopping Browser for iOS & Android
|
|
@@ -1487,12 +1484,12 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1487
1484
|
/headlesschrome(?:\/([\w\.]+)| )/i
|
|
1488
1485
|
// Chrome Headless
|
|
1489
1486
|
],
|
|
1490
|
-
[c, [o,
|
|
1487
|
+
[c, [o, Pe + " Headless"]],
|
|
1491
1488
|
[
|
|
1492
1489
|
/ wv\).+(chrome)\/([\w\.]+)/i
|
|
1493
1490
|
// Chrome WebView
|
|
1494
1491
|
],
|
|
1495
|
-
[[o,
|
|
1492
|
+
[[o, Pe + " WebView"], c],
|
|
1496
1493
|
[
|
|
1497
1494
|
/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
|
|
1498
1495
|
// Android Browser
|
|
@@ -1580,44 +1577,44 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1580
1577
|
/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i
|
|
1581
1578
|
// AMD64 (x64)
|
|
1582
1579
|
],
|
|
1583
|
-
[[
|
|
1580
|
+
[[M, "amd64"]],
|
|
1584
1581
|
[
|
|
1585
1582
|
/(ia32(?=;))/i,
|
|
1586
1583
|
// IA32 (quicktime)
|
|
1587
1584
|
/((?:i[346]|x)86)[;\)]/i
|
|
1588
1585
|
// IA32 (x86)
|
|
1589
1586
|
],
|
|
1590
|
-
[[
|
|
1587
|
+
[[M, "ia32"]],
|
|
1591
1588
|
[
|
|
1592
1589
|
/\b(aarch64|arm(v?8e?l?|_?64))\b/i
|
|
1593
1590
|
// ARM64
|
|
1594
1591
|
],
|
|
1595
|
-
[[
|
|
1592
|
+
[[M, "arm64"]],
|
|
1596
1593
|
[
|
|
1597
1594
|
/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
|
|
1598
1595
|
// ARMHF
|
|
1599
1596
|
],
|
|
1600
|
-
[[
|
|
1597
|
+
[[M, "armhf"]],
|
|
1601
1598
|
[
|
|
1602
1599
|
// PocketPC mistakenly identified as PowerPC
|
|
1603
1600
|
/windows (ce|mobile); ppc;/i
|
|
1604
1601
|
],
|
|
1605
|
-
[[
|
|
1602
|
+
[[M, "arm"]],
|
|
1606
1603
|
[
|
|
1607
1604
|
/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
|
|
1608
1605
|
// PowerPC
|
|
1609
1606
|
],
|
|
1610
|
-
[[
|
|
1607
|
+
[[M, /ower/, de, q]],
|
|
1611
1608
|
[
|
|
1612
1609
|
/(sun4\w)[;\)]/i
|
|
1613
1610
|
// SPARC
|
|
1614
1611
|
],
|
|
1615
|
-
[[
|
|
1612
|
+
[[M, "sparc"]],
|
|
1616
1613
|
[
|
|
1617
1614
|
/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
|
|
1618
1615
|
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
|
1619
1616
|
],
|
|
1620
|
-
[[
|
|
1617
|
+
[[M, q]]
|
|
1621
1618
|
],
|
|
1622
1619
|
device: [
|
|
1623
1620
|
[
|
|
@@ -1627,13 +1624,13 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1627
1624
|
// Samsung
|
|
1628
1625
|
/\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
|
|
1629
1626
|
],
|
|
1630
|
-
[d, [u,
|
|
1627
|
+
[d, [u, Te], [l, f]],
|
|
1631
1628
|
[
|
|
1632
1629
|
/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
|
|
1633
1630
|
/samsung[- ]([-\w]+)/i,
|
|
1634
1631
|
/sec-(sgh\w+)/i
|
|
1635
1632
|
],
|
|
1636
|
-
[d, [u,
|
|
1633
|
+
[d, [u, Te], [l, m]],
|
|
1637
1634
|
[
|
|
1638
1635
|
// Apple
|
|
1639
1636
|
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
|
|
@@ -1655,17 +1652,17 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1655
1652
|
// Sharp
|
|
1656
1653
|
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
|
|
1657
1654
|
],
|
|
1658
|
-
[d, [u,
|
|
1655
|
+
[d, [u, yt], [l, m]],
|
|
1659
1656
|
[
|
|
1660
1657
|
// Huawei
|
|
1661
1658
|
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
|
|
1662
1659
|
],
|
|
1663
|
-
[d, [u,
|
|
1660
|
+
[d, [u, pt], [l, f]],
|
|
1664
1661
|
[
|
|
1665
1662
|
/(?:huawei|honor)([-\w ]+)[;\)]/i,
|
|
1666
1663
|
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
|
|
1667
1664
|
],
|
|
1668
|
-
[d, [u,
|
|
1665
|
+
[d, [u, pt], [l, m]],
|
|
1669
1666
|
[
|
|
1670
1667
|
// Xiaomi
|
|
1671
1668
|
/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
|
|
@@ -1681,14 +1678,14 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1681
1678
|
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
|
|
1682
1679
|
// Xiaomi Mi
|
|
1683
1680
|
],
|
|
1684
|
-
[[d, /_/g, " "], [u,
|
|
1681
|
+
[[d, /_/g, " "], [u, je], [l, m]],
|
|
1685
1682
|
[
|
|
1686
1683
|
/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
|
|
1687
1684
|
// Redmi Pad
|
|
1688
1685
|
/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
|
|
1689
1686
|
// Mi Pad tablets
|
|
1690
1687
|
],
|
|
1691
|
-
[[d, /_/g, " "], [u,
|
|
1688
|
+
[[d, /_/g, " "], [u, je], [l, f]],
|
|
1692
1689
|
[
|
|
1693
1690
|
// OPPO
|
|
1694
1691
|
/; (\w+) bui.+ oppo/i,
|
|
@@ -1712,28 +1709,28 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1712
1709
|
/\bmot(?:orola)?[- ](\w*)/i,
|
|
1713
1710
|
/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
|
|
1714
1711
|
],
|
|
1715
|
-
[d, [u,
|
|
1712
|
+
[d, [u, ft], [l, m]],
|
|
1716
1713
|
[
|
|
1717
1714
|
/\b(mz60\d|xoom[2 ]{0,2}) build\//i
|
|
1718
1715
|
],
|
|
1719
|
-
[d, [u,
|
|
1716
|
+
[d, [u, ft], [l, f]],
|
|
1720
1717
|
[
|
|
1721
1718
|
// LG
|
|
1722
1719
|
/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
|
|
1723
1720
|
],
|
|
1724
|
-
[d, [u,
|
|
1721
|
+
[d, [u, $e], [l, f]],
|
|
1725
1722
|
[
|
|
1726
1723
|
/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
|
|
1727
1724
|
/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
|
|
1728
1725
|
/\blg-?([\d\w]+) bui/i
|
|
1729
1726
|
],
|
|
1730
|
-
[d, [u,
|
|
1727
|
+
[d, [u, $e], [l, m]],
|
|
1731
1728
|
[
|
|
1732
1729
|
// Lenovo
|
|
1733
1730
|
/(ideatab[-\w ]+)/i,
|
|
1734
1731
|
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
|
|
1735
1732
|
],
|
|
1736
|
-
[d, [u,
|
|
1733
|
+
[d, [u, mt], [l, f]],
|
|
1737
1734
|
[
|
|
1738
1735
|
// Nokia
|
|
1739
1736
|
/(?:maemo|nokia).*(n900|lumia \d+)/i,
|
|
@@ -1745,22 +1742,22 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1745
1742
|
/(pixel c)\b/i
|
|
1746
1743
|
// Google Pixel C
|
|
1747
1744
|
],
|
|
1748
|
-
[d, [u,
|
|
1745
|
+
[d, [u, Ie], [l, f]],
|
|
1749
1746
|
[
|
|
1750
1747
|
/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
|
|
1751
1748
|
// Google Pixel
|
|
1752
1749
|
],
|
|
1753
|
-
[d, [u,
|
|
1750
|
+
[d, [u, Ie], [l, m]],
|
|
1754
1751
|
[
|
|
1755
1752
|
// Sony
|
|
1756
1753
|
/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
|
|
1757
1754
|
],
|
|
1758
|
-
[d, [u,
|
|
1755
|
+
[d, [u, Ae], [l, m]],
|
|
1759
1756
|
[
|
|
1760
1757
|
/sony tablet [ps]/i,
|
|
1761
1758
|
/\b(?:sony)?sgp\w+(?: bui|\))/i
|
|
1762
1759
|
],
|
|
1763
|
-
[[d, "Xperia Tablet"], [u,
|
|
1760
|
+
[[d, "Xperia Tablet"], [u, Ae], [l, f]],
|
|
1764
1761
|
[
|
|
1765
1762
|
// OnePlus
|
|
1766
1763
|
/ (kb2005|in20[12]5|be20[12][59])\b/i,
|
|
@@ -1775,12 +1772,12 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1775
1772
|
/(kf[a-z]+)( bui|\)).+silk\//i
|
|
1776
1773
|
// Kindle Fire HD
|
|
1777
1774
|
],
|
|
1778
|
-
[d, [u,
|
|
1775
|
+
[d, [u, Se], [l, f]],
|
|
1779
1776
|
[
|
|
1780
1777
|
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
|
|
1781
1778
|
// Fire Phone
|
|
1782
1779
|
],
|
|
1783
|
-
[[d, /(.+)/g, "Fire Phone $1"], [u,
|
|
1780
|
+
[[d, /(.+)/g, "Fire Phone $1"], [u, Se], [l, m]],
|
|
1784
1781
|
[
|
|
1785
1782
|
// BlackBerry
|
|
1786
1783
|
/(playbook);[-\w\),; ]+(rim)/i
|
|
@@ -1792,16 +1789,16 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1792
1789
|
/\(bb10; (\w+)/i
|
|
1793
1790
|
// BlackBerry 10
|
|
1794
1791
|
],
|
|
1795
|
-
[d, [u,
|
|
1792
|
+
[d, [u, bt], [l, m]],
|
|
1796
1793
|
[
|
|
1797
1794
|
// Asus
|
|
1798
1795
|
/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
|
|
1799
1796
|
],
|
|
1800
|
-
[d, [u,
|
|
1797
|
+
[d, [u, wt], [l, f]],
|
|
1801
1798
|
[
|
|
1802
1799
|
/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
|
|
1803
1800
|
],
|
|
1804
|
-
[d, [u,
|
|
1801
|
+
[d, [u, wt], [l, m]],
|
|
1805
1802
|
[
|
|
1806
1803
|
// HTC
|
|
1807
1804
|
/(nexus 9)/i
|
|
@@ -1866,7 +1863,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1866
1863
|
/(surface duo)/i
|
|
1867
1864
|
// Surface Duo
|
|
1868
1865
|
],
|
|
1869
|
-
[d, [u,
|
|
1866
|
+
[d, [u, Ue], [l, f]],
|
|
1870
1867
|
[
|
|
1871
1868
|
/droid [\d\.]+; (fp\du?)(?: b|\))/i
|
|
1872
1869
|
// Fairphone
|
|
@@ -1886,16 +1883,16 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1886
1883
|
/(kin\.[onetw]{3})/i
|
|
1887
1884
|
// Microsoft Kin
|
|
1888
1885
|
],
|
|
1889
|
-
[[d, /\./g, " "], [u,
|
|
1886
|
+
[[d, /\./g, " "], [u, Ue], [l, m]],
|
|
1890
1887
|
[
|
|
1891
1888
|
/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
|
|
1892
1889
|
// Zebra
|
|
1893
1890
|
],
|
|
1894
|
-
[d, [u,
|
|
1891
|
+
[d, [u, Qe], [l, f]],
|
|
1895
1892
|
[
|
|
1896
1893
|
/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
|
|
1897
1894
|
],
|
|
1898
|
-
[d, [u,
|
|
1895
|
+
[d, [u, Qe], [l, m]],
|
|
1899
1896
|
[
|
|
1900
1897
|
///////////////////
|
|
1901
1898
|
// SMARTTVS
|
|
@@ -1903,64 +1900,64 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1903
1900
|
/smart-tv.+(samsung)/i
|
|
1904
1901
|
// Samsung
|
|
1905
1902
|
],
|
|
1906
|
-
[u, [l,
|
|
1903
|
+
[u, [l, I]],
|
|
1907
1904
|
[
|
|
1908
1905
|
/hbbtv.+maple;(\d+)/i
|
|
1909
1906
|
],
|
|
1910
|
-
[[d, /^/, "SmartTV"], [u,
|
|
1907
|
+
[[d, /^/, "SmartTV"], [u, Te], [l, I]],
|
|
1911
1908
|
[
|
|
1912
1909
|
/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
|
|
1913
1910
|
// LG SmartTV
|
|
1914
1911
|
],
|
|
1915
|
-
[[u,
|
|
1912
|
+
[[u, $e], [l, I]],
|
|
1916
1913
|
[
|
|
1917
1914
|
/(apple) ?tv/i
|
|
1918
1915
|
// Apple TV
|
|
1919
1916
|
],
|
|
1920
|
-
[u, [d, we + " TV"], [l,
|
|
1917
|
+
[u, [d, we + " TV"], [l, I]],
|
|
1921
1918
|
[
|
|
1922
1919
|
/crkey/i
|
|
1923
1920
|
// Google Chromecast
|
|
1924
1921
|
],
|
|
1925
|
-
[[d,
|
|
1922
|
+
[[d, Pe + "cast"], [u, Ie], [l, I]],
|
|
1926
1923
|
[
|
|
1927
1924
|
/droid.+aft(\w+)( bui|\))/i
|
|
1928
1925
|
// Fire TV
|
|
1929
1926
|
],
|
|
1930
|
-
[d, [u,
|
|
1927
|
+
[d, [u, Se], [l, I]],
|
|
1931
1928
|
[
|
|
1932
1929
|
/\(dtv[\);].+(aquos)/i,
|
|
1933
1930
|
/(aquos-tv[\w ]+)\)/i
|
|
1934
1931
|
// Sharp
|
|
1935
1932
|
],
|
|
1936
|
-
[d, [u,
|
|
1933
|
+
[d, [u, yt], [l, I]],
|
|
1937
1934
|
[
|
|
1938
1935
|
/(bravia[\w ]+)( bui|\))/i
|
|
1939
1936
|
// Sony
|
|
1940
1937
|
],
|
|
1941
|
-
[d, [u,
|
|
1938
|
+
[d, [u, Ae], [l, I]],
|
|
1942
1939
|
[
|
|
1943
1940
|
/(mitv-\w{5}) bui/i
|
|
1944
1941
|
// Xiaomi
|
|
1945
1942
|
],
|
|
1946
|
-
[d, [u,
|
|
1943
|
+
[d, [u, je], [l, I]],
|
|
1947
1944
|
[
|
|
1948
1945
|
/Hbbtv.*(technisat) (.*);/i
|
|
1949
1946
|
// TechniSAT
|
|
1950
1947
|
],
|
|
1951
|
-
[u, d, [l,
|
|
1948
|
+
[u, d, [l, I]],
|
|
1952
1949
|
[
|
|
1953
1950
|
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
|
|
1954
1951
|
// Roku
|
|
1955
1952
|
/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
|
|
1956
1953
|
// HbbTV devices
|
|
1957
1954
|
],
|
|
1958
|
-
[[u, ye], [d, ye], [l,
|
|
1955
|
+
[[u, ye], [d, ye], [l, I]],
|
|
1959
1956
|
[
|
|
1960
1957
|
/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
|
|
1961
1958
|
// SmartTV from Unidentified Vendors
|
|
1962
1959
|
],
|
|
1963
|
-
[[l,
|
|
1960
|
+
[[l, I]],
|
|
1964
1961
|
[
|
|
1965
1962
|
///////////////////
|
|
1966
1963
|
// CONSOLES
|
|
@@ -1980,12 +1977,12 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
1980
1977
|
/(playstation \w+)/i
|
|
1981
1978
|
// Playstation
|
|
1982
1979
|
],
|
|
1983
|
-
[d, [u,
|
|
1980
|
+
[d, [u, Ae], [l, Z]],
|
|
1984
1981
|
[
|
|
1985
1982
|
/\b(xbox(?: one)?(?!; xbox))[\); ]/i
|
|
1986
1983
|
// Microsoft Xbox
|
|
1987
1984
|
],
|
|
1988
|
-
[d, [u,
|
|
1985
|
+
[d, [u, Ue], [l, Z]],
|
|
1989
1986
|
[
|
|
1990
1987
|
///////////////////
|
|
1991
1988
|
// WEARABLES
|
|
@@ -2003,16 +2000,16 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2003
2000
|
/droid.+; (glass) \d/i
|
|
2004
2001
|
// Google Glass
|
|
2005
2002
|
],
|
|
2006
|
-
[d, [u,
|
|
2003
|
+
[d, [u, Ie], [l, Y]],
|
|
2007
2004
|
[
|
|
2008
2005
|
/droid.+; (wt63?0{2,3})\)/i
|
|
2009
2006
|
],
|
|
2010
|
-
[d, [u,
|
|
2007
|
+
[d, [u, Qe], [l, Y]],
|
|
2011
2008
|
[
|
|
2012
2009
|
/(quest( 2| pro)?)/i
|
|
2013
2010
|
// Oculus Quest
|
|
2014
2011
|
],
|
|
2015
|
-
[d, [u,
|
|
2012
|
+
[d, [u, vt], [l, Y]],
|
|
2016
2013
|
[
|
|
2017
2014
|
///////////////////
|
|
2018
2015
|
// EMBEDDED
|
|
@@ -2020,12 +2017,12 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2020
2017
|
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
|
|
2021
2018
|
// Tesla
|
|
2022
2019
|
],
|
|
2023
|
-
[u, [l,
|
|
2020
|
+
[u, [l, et]],
|
|
2024
2021
|
[
|
|
2025
2022
|
/(aeobc)\b/i
|
|
2026
2023
|
// Echo Dot
|
|
2027
2024
|
],
|
|
2028
|
-
[d, [u,
|
|
2025
|
+
[d, [u, Se], [l, et]],
|
|
2029
2026
|
[
|
|
2030
2027
|
////////////////////
|
|
2031
2028
|
// MIXED (GENERIC)
|
|
@@ -2060,7 +2057,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2060
2057
|
/windows.+ edge\/([\w\.]+)/i
|
|
2061
2058
|
// EdgeHTML
|
|
2062
2059
|
],
|
|
2063
|
-
[c, [o,
|
|
2060
|
+
[c, [o, mi + "HTML"]],
|
|
2064
2061
|
[
|
|
2065
2062
|
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
|
2066
2063
|
// Blink
|
|
@@ -2097,14 +2094,14 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2097
2094
|
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
|
|
2098
2095
|
// Windows Phone
|
|
2099
2096
|
],
|
|
2100
|
-
[o, [c,
|
|
2097
|
+
[o, [c, Be, Mt]],
|
|
2101
2098
|
[
|
|
2102
2099
|
/windows nt 6\.2; (arm)/i,
|
|
2103
2100
|
// Windows RT
|
|
2104
2101
|
/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
|
|
2105
2102
|
/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
|
|
2106
2103
|
],
|
|
2107
|
-
[[c,
|
|
2104
|
+
[[c, Be, Mt], [o, it]],
|
|
2108
2105
|
[
|
|
2109
2106
|
// iOS/macOS
|
|
2110
2107
|
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
|
@@ -2140,7 +2137,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2140
2137
|
/\(bb(10);/i
|
|
2141
2138
|
// BlackBerry 10
|
|
2142
2139
|
],
|
|
2143
|
-
[c, [o,
|
|
2140
|
+
[c, [o, bt]],
|
|
2144
2141
|
[
|
|
2145
2142
|
/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
|
|
2146
2143
|
// Symbian
|
|
@@ -2167,7 +2164,7 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2167
2164
|
/crkey\/([\d\.]+)/i
|
|
2168
2165
|
// Google Chromecast
|
|
2169
2166
|
],
|
|
2170
|
-
[c, [o,
|
|
2167
|
+
[c, [o, Pe + "cast"]],
|
|
2171
2168
|
[
|
|
2172
2169
|
/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
|
|
2173
2170
|
// Chromium OS
|
|
@@ -2222,11 +2219,11 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2222
2219
|
],
|
|
2223
2220
|
[o, c]
|
|
2224
2221
|
]
|
|
2225
|
-
},
|
|
2222
|
+
}, xe = function() {
|
|
2226
2223
|
var i = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} };
|
|
2227
2224
|
return D.call(i.init, [
|
|
2228
2225
|
[T, [o, c, fe]],
|
|
2229
|
-
[_, [
|
|
2226
|
+
[_, [M]],
|
|
2230
2227
|
[O, [l, d, u]],
|
|
2231
2228
|
[F, [o, c]],
|
|
2232
2229
|
[P, [o, c]]
|
|
@@ -2239,28 +2236,28 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2239
2236
|
[P, / ?os$/i]
|
|
2240
2237
|
]), D.call(i.toString, [
|
|
2241
2238
|
[T, [o, c]],
|
|
2242
|
-
[_, [
|
|
2239
|
+
[_, [M]],
|
|
2243
2240
|
[O, [u, d]],
|
|
2244
2241
|
[F, [o, c]],
|
|
2245
2242
|
[P, [o, c]]
|
|
2246
2243
|
]), i;
|
|
2247
|
-
}(),
|
|
2248
|
-
var e =
|
|
2244
|
+
}(), vi = function(i, t) {
|
|
2245
|
+
var e = xe.init[t], a = xe.isIgnore[t] || 0, n = xe.isIgnoreRgx[t] || 0, r = xe.toString[t] || 0;
|
|
2249
2246
|
function s() {
|
|
2250
2247
|
D.call(this, e);
|
|
2251
2248
|
}
|
|
2252
2249
|
return s.prototype.getItem = function() {
|
|
2253
2250
|
return i;
|
|
2254
2251
|
}, s.prototype.withClientHints = function() {
|
|
2255
|
-
return H ? H.getHighEntropyValues(
|
|
2256
|
-
return i.setCH(new
|
|
2252
|
+
return H ? H.getHighEntropyValues(Dt).then(function(h) {
|
|
2253
|
+
return i.setCH(new Nt(h, !1)).parseCH().get();
|
|
2257
2254
|
}) : i.parseCH().get();
|
|
2258
2255
|
}, s.prototype.withFeatureCheck = function() {
|
|
2259
2256
|
return i.detectFeature().get();
|
|
2260
2257
|
}, t != te && (s.prototype.is = function(h) {
|
|
2261
2258
|
var g = !1;
|
|
2262
2259
|
for (var w in this)
|
|
2263
|
-
if (this.hasOwnProperty(w) && !
|
|
2260
|
+
if (this.hasOwnProperty(w) && !at(a, w) && q(n ? $(n, this[w]) : this[w]) == q(n ? $(n, h) : h)) {
|
|
2264
2261
|
if (g = !0, h != z)
|
|
2265
2262
|
break;
|
|
2266
2263
|
} else if (h == z && g) {
|
|
@@ -2282,28 +2279,28 @@ var li = "2.0.0-beta.2", de = "", gt = "?", Ze = "function", z = "undefined", le
|
|
|
2282
2279
|
is: s.prototype.is,
|
|
2283
2280
|
toString: s.prototype.toString
|
|
2284
2281
|
};
|
|
2285
|
-
var
|
|
2286
|
-
return h(
|
|
2282
|
+
var p = new w();
|
|
2283
|
+
return h(p), p;
|
|
2287
2284
|
}), new s();
|
|
2288
2285
|
};
|
|
2289
|
-
function
|
|
2290
|
-
if (i = i || {}, D.call(this,
|
|
2286
|
+
function Nt(i, t) {
|
|
2287
|
+
if (i = i || {}, D.call(this, Dt), t)
|
|
2291
2288
|
D.call(this, [
|
|
2292
|
-
[
|
|
2293
|
-
[
|
|
2294
|
-
[m, /\?1/.test(i[
|
|
2295
|
-
[d, me(i[
|
|
2296
|
-
[ee, me(i[
|
|
2297
|
-
[
|
|
2298
|
-
[
|
|
2299
|
-
[W,
|
|
2300
|
-
[
|
|
2289
|
+
[nt, Xe(i[G])],
|
|
2290
|
+
[st, Xe(i[li])],
|
|
2291
|
+
[m, /\?1/.test(i[wi])],
|
|
2292
|
+
[d, me(i[bi])],
|
|
2293
|
+
[ee, me(i[Ft])],
|
|
2294
|
+
[ot, me(i[pi])],
|
|
2295
|
+
[M, me(i[ui])],
|
|
2296
|
+
[W, Xe(i[gi])],
|
|
2297
|
+
[Re, me(i[hi])]
|
|
2301
2298
|
]);
|
|
2302
2299
|
else
|
|
2303
2300
|
for (var e in i)
|
|
2304
2301
|
this.hasOwnProperty(e) && typeof i[e] !== z && (this[e] = i[e]);
|
|
2305
2302
|
}
|
|
2306
|
-
function
|
|
2303
|
+
function Tt(i, t, e, a) {
|
|
2307
2304
|
return this.get = function(n) {
|
|
2308
2305
|
return n ? this.data.hasOwnProperty(n) ? this.data[n] : void 0 : this.data;
|
|
2309
2306
|
}, this.set = function(n, r) {
|
|
@@ -2311,13 +2308,13 @@ function At(i, t, e, a) {
|
|
|
2311
2308
|
}, this.setCH = function(n) {
|
|
2312
2309
|
return this.uaCH = n, this;
|
|
2313
2310
|
}, this.detectFeature = function() {
|
|
2314
|
-
if (
|
|
2311
|
+
if (S && S.userAgent == this.ua)
|
|
2315
2312
|
switch (this.itemType) {
|
|
2316
2313
|
case T:
|
|
2317
|
-
|
|
2314
|
+
S.brave && typeof S.brave.isBrave == Ye && this.set(o, "Brave");
|
|
2318
2315
|
break;
|
|
2319
2316
|
case O:
|
|
2320
|
-
!this.get(l) && H && H[m] && this.set(l, m), this.get(d) == "Macintosh" &&
|
|
2317
|
+
!this.get(l) && H && H[m] && this.set(l, m), this.get(d) == "Macintosh" && S && typeof S.standalone !== z && S.maxTouchPoints && S.maxTouchPoints > 2 && this.set(d, "iPad").set(l, f);
|
|
2321
2318
|
break;
|
|
2322
2319
|
case P:
|
|
2323
2320
|
!this.get(o) && H && H[ee] && this.set(o, H[ee]);
|
|
@@ -2330,40 +2327,40 @@ function At(i, t, e, a) {
|
|
|
2330
2327
|
}
|
|
2331
2328
|
return this;
|
|
2332
2329
|
}, this.parseUA = function() {
|
|
2333
|
-
return this.itemType != te &&
|
|
2330
|
+
return this.itemType != te && Ct.call(this.data, this.ua, this.rgxMap), this.itemType == T && this.set(fe, Ke(this.get(c))), this;
|
|
2334
2331
|
}, this.parseCH = function() {
|
|
2335
2332
|
var n = this.uaCH, r = this.rgxMap;
|
|
2336
2333
|
switch (this.itemType) {
|
|
2337
2334
|
case T:
|
|
2338
|
-
var s = n[
|
|
2335
|
+
var s = n[st] || n[nt], h;
|
|
2339
2336
|
if (s)
|
|
2340
2337
|
for (var g in s) {
|
|
2341
|
-
var w = $(/(Google|Microsoft) /, s[g].brand || s[g]),
|
|
2342
|
-
!/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(o, w).set(c,
|
|
2338
|
+
var w = $(/(Google|Microsoft) /, s[g].brand || s[g]), p = s[g].version;
|
|
2339
|
+
!/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(o, w).set(c, p).set(fe, Ke(p)), h = w);
|
|
2343
2340
|
}
|
|
2344
2341
|
break;
|
|
2345
2342
|
case _:
|
|
2346
|
-
var A = n[
|
|
2347
|
-
A && (A && n[
|
|
2343
|
+
var A = n[M];
|
|
2344
|
+
A && (A && n[Re] == "64" && (A += "64"), Ct.call(this.data, A + ";", r));
|
|
2348
2345
|
break;
|
|
2349
2346
|
case O:
|
|
2350
|
-
if (n[m] && this.set(l, m), n[d] && this.set(d, n[d]), n[d] == "Xbox" && this.set(l, Z).set(u,
|
|
2347
|
+
if (n[m] && this.set(l, m), n[d] && this.set(d, n[d]), n[d] == "Xbox" && this.set(l, Z).set(u, Ue), n[W]) {
|
|
2351
2348
|
var R;
|
|
2352
2349
|
if (typeof n[W] != "string")
|
|
2353
2350
|
for (var Q = 0; !R && Q < n[W].length; )
|
|
2354
|
-
R =
|
|
2351
|
+
R = Be(n[W][Q++], St);
|
|
2355
2352
|
else
|
|
2356
|
-
R =
|
|
2353
|
+
R = Be(n[W], St);
|
|
2357
2354
|
this.set(l, R);
|
|
2358
2355
|
}
|
|
2359
2356
|
break;
|
|
2360
2357
|
case P:
|
|
2361
2358
|
var X = n[ee];
|
|
2362
2359
|
if (X) {
|
|
2363
|
-
var L = n[
|
|
2364
|
-
X ==
|
|
2360
|
+
var L = n[ot];
|
|
2361
|
+
X == it && (L = parseInt(Ke(L), 10) >= 13 ? "11" : "10"), this.set(o, X).set(c, L);
|
|
2365
2362
|
}
|
|
2366
|
-
this.get(o) ==
|
|
2363
|
+
this.get(o) == it && n[d] == "Xbox" && this.set(o, "Xbox").set(c, void 0);
|
|
2367
2364
|
break;
|
|
2368
2365
|
case te:
|
|
2369
2366
|
var he = this.data, x = function(B) {
|
|
@@ -2377,26 +2374,26 @@ function At(i, t, e, a) {
|
|
|
2377
2374
|
["ua", t],
|
|
2378
2375
|
["uaCH", a],
|
|
2379
2376
|
["rgxMap", e],
|
|
2380
|
-
["data",
|
|
2377
|
+
["data", vi(this, i)]
|
|
2381
2378
|
]), this;
|
|
2382
2379
|
}
|
|
2383
2380
|
function N(i, t, e) {
|
|
2384
|
-
if (typeof i === le ? (
|
|
2381
|
+
if (typeof i === le ? (Et(i) ? (typeof t === le && (e = t), t = i) : (e = i, t = void 0), i = void 0) : typeof i === Ze && !Et(t) && (e = t, t = void 0), !(this instanceof N))
|
|
2385
2382
|
return new N(i, t, e).getResult();
|
|
2386
|
-
var a = typeof i ===
|
|
2383
|
+
var a = typeof i === Ze ? i : (
|
|
2387
2384
|
// Passed user-agent string
|
|
2388
|
-
|
|
2385
|
+
S && S.userAgent ? S.userAgent : (
|
|
2389
2386
|
// navigator.userAgent
|
|
2390
|
-
e && e[
|
|
2387
|
+
e && e[gt] ? e[gt] : (
|
|
2391
2388
|
// User-Agent from passed headers
|
|
2392
2389
|
de
|
|
2393
2390
|
)
|
|
2394
2391
|
)
|
|
2395
|
-
), n = new
|
|
2392
|
+
), n = new Nt(e, !0), r = t ? yi(It, t) : It, s = function(h) {
|
|
2396
2393
|
return h == te ? function() {
|
|
2397
|
-
return new
|
|
2394
|
+
return new Tt(h, a, r, n).set("ua", a).set(T, this.getBrowser()).set(_, this.getCPU()).set(O, this.getDevice()).set(F, this.getEngine()).set(P, this.getOS()).get();
|
|
2398
2395
|
} : function() {
|
|
2399
|
-
return new
|
|
2396
|
+
return new Tt(h, a, r[h], n).parseUA().get();
|
|
2400
2397
|
};
|
|
2401
2398
|
};
|
|
2402
2399
|
return D.call(this, [
|
|
@@ -2410,20 +2407,21 @@ function N(i, t, e) {
|
|
|
2410
2407
|
return a;
|
|
2411
2408
|
}],
|
|
2412
2409
|
["setUA", function(h) {
|
|
2413
|
-
return ue(h) && (a = h.length >
|
|
2410
|
+
return ue(h) && (a = h.length > tt ? ye(h, tt) : h), this;
|
|
2414
2411
|
}]
|
|
2415
2412
|
]).setUA(a), this;
|
|
2416
2413
|
}
|
|
2417
|
-
N.VERSION =
|
|
2418
|
-
N.BROWSER =
|
|
2419
|
-
N.CPU =
|
|
2420
|
-
N.DEVICE =
|
|
2421
|
-
N.ENGINE = N.OS =
|
|
2414
|
+
N.VERSION = di;
|
|
2415
|
+
N.BROWSER = He([o, c, fe]);
|
|
2416
|
+
N.CPU = He([M]);
|
|
2417
|
+
N.DEVICE = He([d, u, l, Z, m, I, f, Y, et]);
|
|
2418
|
+
N.ENGINE = N.OS = He([o, c]);
|
|
2422
2419
|
class ki {
|
|
2423
|
-
constructor(t, e) {
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
this
|
|
2420
|
+
constructor(t, e, a) {
|
|
2421
|
+
b(this, "trackers");
|
|
2422
|
+
b(this, "config");
|
|
2423
|
+
b(this, "sdkConfig");
|
|
2424
|
+
this.trackers = t, this.config = e, this.sdkConfig = a;
|
|
2427
2425
|
}
|
|
2428
2426
|
on(t, e, a) {
|
|
2429
2427
|
const n = function(s) {
|
|
@@ -2435,40 +2433,40 @@ class ki {
|
|
|
2435
2433
|
this.trackers.forEach((a) => a.track(t, e));
|
|
2436
2434
|
}
|
|
2437
2435
|
}
|
|
2438
|
-
function
|
|
2436
|
+
function At(i) {
|
|
2439
2437
|
return i.reduce((t, e) => t + e, 0);
|
|
2440
2438
|
}
|
|
2441
|
-
function
|
|
2442
|
-
const t = i.length, e =
|
|
2439
|
+
function Ei(i) {
|
|
2440
|
+
const t = i.length, e = At(i) / t, a = i.map((r) => Math.pow(r - e, 2)), n = At(a) / t;
|
|
2443
2441
|
return Math.sqrt(n);
|
|
2444
2442
|
}
|
|
2445
|
-
class
|
|
2443
|
+
class Pt {
|
|
2446
2444
|
constructor() {
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2445
|
+
b(this, "rafId", -1);
|
|
2446
|
+
b(this, "startTime", 0);
|
|
2447
|
+
b(this, "stopTime", 0);
|
|
2448
|
+
b(this, "frames", []);
|
|
2449
|
+
b(this, "calculateFPS", () => {
|
|
2452
2450
|
const t = Math.floor((this.stopTime - this.startTime) / 1e3);
|
|
2453
2451
|
return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e, a, n, r) => (r[n] !== r[n - 1] ? e.push(1) : e[e.length - 1]++, e), []).slice(0, t);
|
|
2454
2452
|
});
|
|
2455
|
-
|
|
2456
|
-
const t = this.calculateFPS(), e = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), a = t.length > 0 ? Math.max(...t) : e, n = t.length > 0 ? Math.min(...t) : e, r = t.length > 0 ?
|
|
2453
|
+
b(this, "getReport", () => {
|
|
2454
|
+
const t = this.calculateFPS(), e = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), a = t.length > 0 ? Math.max(...t) : e, n = t.length > 0 ? Math.min(...t) : e, r = t.length > 0 ? Ei(t) : 0;
|
|
2457
2455
|
return { fpsAvg: e, fpsMax: a, fpsMin: n, fpsStdDev: r };
|
|
2458
2456
|
});
|
|
2459
|
-
|
|
2457
|
+
b(this, "start", () => {
|
|
2460
2458
|
this.startTime = Date.now(), this.frames = [], this.trackFrames();
|
|
2461
2459
|
});
|
|
2462
|
-
|
|
2460
|
+
b(this, "stop", () => {
|
|
2463
2461
|
cancelAnimationFrame(this.rafId), this.stopTime = Date.now();
|
|
2464
2462
|
});
|
|
2465
|
-
|
|
2463
|
+
b(this, "trackFrames", () => {
|
|
2466
2464
|
this.frames.push(Date.now()), this.rafId = requestAnimationFrame(this.trackFrames);
|
|
2467
2465
|
});
|
|
2468
2466
|
}
|
|
2469
2467
|
}
|
|
2470
|
-
const
|
|
2471
|
-
function
|
|
2468
|
+
const Ci = "landscape", Mi = "portrait";
|
|
2469
|
+
function Si() {
|
|
2472
2470
|
try {
|
|
2473
2471
|
const i = document.createElement("canvas");
|
|
2474
2472
|
return !!window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
|
|
@@ -2476,7 +2474,7 @@ function Ci() {
|
|
|
2476
2474
|
return !1;
|
|
2477
2475
|
}
|
|
2478
2476
|
}
|
|
2479
|
-
async function
|
|
2477
|
+
async function Ii() {
|
|
2480
2478
|
if (!window.createImageBitmap)
|
|
2481
2479
|
return !1;
|
|
2482
2480
|
const e = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
|
|
@@ -2486,29 +2484,29 @@ async function Ti() {
|
|
|
2486
2484
|
return !1;
|
|
2487
2485
|
}
|
|
2488
2486
|
}
|
|
2489
|
-
function
|
|
2490
|
-
return window.innerWidth >= window.innerHeight ?
|
|
2487
|
+
function Je() {
|
|
2488
|
+
return window.innerWidth >= window.innerHeight ? Ci : Mi;
|
|
2491
2489
|
}
|
|
2492
|
-
var
|
|
2493
|
-
class
|
|
2490
|
+
var _e, ae, ne, se, ke, Fe, Ee, De;
|
|
2491
|
+
class qi extends ki {
|
|
2494
2492
|
constructor(...e) {
|
|
2495
2493
|
super(...e);
|
|
2496
|
-
|
|
2494
|
+
b(this, "FPS_SAMPLE_INTERVAL", 1e4);
|
|
2497
2495
|
// wrapper state
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2496
|
+
C(this, _e, 0);
|
|
2497
|
+
C(this, ae, "");
|
|
2498
|
+
C(this, ne, void 0);
|
|
2499
|
+
C(this, se, void 0);
|
|
2500
|
+
C(this, ke, !1);
|
|
2501
|
+
C(this, Fe, !1);
|
|
2502
|
+
C(this, Ee, "");
|
|
2503
|
+
C(this, De, []);
|
|
2506
2504
|
v(this, ne, {}), v(this, se, this.deviceInfo()), this.on("state", ({ balance: a, version: n }) => {
|
|
2507
|
-
v(this, ae, n), v(this,
|
|
2505
|
+
v(this, ae, n), v(this, _e, a);
|
|
2508
2506
|
}), this.on("autoplay", ({ action: a }) => {
|
|
2509
2507
|
["start", "resume"].includes(a) ? v(this, ke, !0) : v(this, ke, !1);
|
|
2510
2508
|
}), this.on("settings", ({ fastPlay: a }) => {
|
|
2511
|
-
a !== void 0 && v(this,
|
|
2509
|
+
a !== void 0 && v(this, Fe, a);
|
|
2512
2510
|
}), this.registerEvents();
|
|
2513
2511
|
}
|
|
2514
2512
|
async registerEvents() {
|
|
@@ -2522,29 +2520,29 @@ class Gi extends ki {
|
|
|
2522
2520
|
this.track("Game Loading", { progress: 100, step: "complete" });
|
|
2523
2521
|
}), this.on("error", (e) => {
|
|
2524
2522
|
this.track("System Message", {
|
|
2525
|
-
systemMessageText: e.
|
|
2523
|
+
systemMessageText: e.messageCode,
|
|
2526
2524
|
systemMessageType: e.type
|
|
2527
2525
|
});
|
|
2528
2526
|
}), this.on("openGameResponse", async (e) => {
|
|
2529
|
-
v(this,
|
|
2527
|
+
v(this, Ee, e.contract.stateType.nextRound), v(this, ne, {
|
|
2530
2528
|
balanceInCoins: e.contract.balance.coins,
|
|
2531
2529
|
clientVersion: y(this, ae),
|
|
2532
|
-
coinValueInCents: this.
|
|
2533
|
-
coinValueInCentsFloat: this.
|
|
2534
|
-
currency: this.
|
|
2530
|
+
coinValueInCents: this.sdkConfig.api.coinValueInCents,
|
|
2531
|
+
coinValueInCentsFloat: this.sdkConfig.api.coinValueInCents,
|
|
2532
|
+
currency: this.sdkConfig.api.currency,
|
|
2535
2533
|
defaultBaseBet: e.contract.bet.default.base,
|
|
2536
2534
|
defaultBetMultiplier: e.contract.bet.default.multiplier,
|
|
2537
2535
|
environment: "release",
|
|
2538
|
-
gameCode: this.
|
|
2539
|
-
gameCodeServer: this.
|
|
2536
|
+
gameCode: this.sdkConfig.api.game,
|
|
2537
|
+
gameCodeServer: this.sdkConfig.api.game,
|
|
2540
2538
|
gameModelFile: e.contract.gameModel,
|
|
2541
|
-
jurisdiction: this.
|
|
2542
|
-
languageCode: this.
|
|
2539
|
+
jurisdiction: this.sdkConfig.api.jurisdiction,
|
|
2540
|
+
languageCode: this.sdkConfig.ui.language,
|
|
2543
2541
|
operatorName: "kalamba",
|
|
2544
|
-
partnerId: this.
|
|
2545
|
-
partnerParentId: this.
|
|
2542
|
+
partnerId: this.sdkConfig.api.brand,
|
|
2543
|
+
partnerParentId: this.sdkConfig.api.integration,
|
|
2546
2544
|
platform: "WEB",
|
|
2547
|
-
playMode: this.
|
|
2545
|
+
playMode: this.sdkConfig.api.playMode,
|
|
2548
2546
|
referrer: window.location.hostname,
|
|
2549
2547
|
// rootTrackingSessionID: 'unknown',
|
|
2550
2548
|
// rtpVariant: 'unknown',
|
|
@@ -2552,36 +2550,36 @@ class Gi extends ki {
|
|
|
2552
2550
|
// testVariants: '',
|
|
2553
2551
|
}), this.track("Game Open", y(this, ne));
|
|
2554
2552
|
}), this.on("playCycleEnd", async (e) => {
|
|
2555
|
-
const a = await y(this, se), { base: n, multiplier: r, specialAction: s } = e.contract.bet.lastPaid ?? {}, h = e.contract.balance.coins, g = e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier, w = e.contract.win.total,
|
|
2553
|
+
const a = await y(this, se), { base: n, multiplier: r, specialAction: s } = e.contract.bet.lastPaid ?? {}, h = e.contract.balance.coins, g = e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier, w = e.contract.win.total, p = w - g, A = s || "spin", R = e.contract.roundId;
|
|
2556
2554
|
this.track("Betting Activity", {
|
|
2557
|
-
balance: h -
|
|
2555
|
+
balance: h - p,
|
|
2558
2556
|
balanceAfter: h,
|
|
2559
2557
|
baseBet: n,
|
|
2560
2558
|
// baseBetIndex,
|
|
2561
2559
|
betMultiplier: r,
|
|
2562
2560
|
betType: A,
|
|
2563
2561
|
gameVersion: y(this, ae),
|
|
2564
|
-
coinValueInCents: this.
|
|
2565
|
-
coinValueInCentsFloat: this.
|
|
2566
|
-
currency: this.
|
|
2562
|
+
coinValueInCents: this.sdkConfig.api.coinValueInCents,
|
|
2563
|
+
coinValueInCentsFloat: this.sdkConfig.api.coinValueInCents,
|
|
2564
|
+
currency: this.sdkConfig.api.currency,
|
|
2567
2565
|
environment: "release",
|
|
2568
|
-
gameCode: this.
|
|
2569
|
-
gameCodeServer: this.
|
|
2566
|
+
gameCode: this.sdkConfig.api.game,
|
|
2567
|
+
gameCodeServer: this.sdkConfig.api.game,
|
|
2570
2568
|
isMobile: a.isMobile,
|
|
2571
|
-
netResult:
|
|
2569
|
+
netResult: p,
|
|
2572
2570
|
operatorName: "kalamba",
|
|
2573
|
-
orientation:
|
|
2574
|
-
partnerId: this.
|
|
2575
|
-
partnerParentId: this.
|
|
2571
|
+
orientation: Je(),
|
|
2572
|
+
partnerId: this.sdkConfig.api.brand,
|
|
2573
|
+
partnerParentId: this.sdkConfig.api.integration,
|
|
2576
2574
|
platform: "WEB",
|
|
2577
|
-
playMode: this.
|
|
2575
|
+
playMode: this.sdkConfig.api.playMode,
|
|
2578
2576
|
roundId: R,
|
|
2579
2577
|
// TODO: uncomment when tracking TrackingEvent.GameSpin is implemented
|
|
2580
2578
|
// roundTypes: [...this.#roundTypes],
|
|
2581
2579
|
roundTypes: ["BaseGame"],
|
|
2582
2580
|
totalBet: g,
|
|
2583
2581
|
totalWin: w
|
|
2584
|
-
}), v(this,
|
|
2582
|
+
}), v(this, De, []);
|
|
2585
2583
|
}), this.on("telemetry.click", (e) => {
|
|
2586
2584
|
this.track("UI Interaction", {
|
|
2587
2585
|
action: "click",
|
|
@@ -2596,7 +2594,7 @@ class Gi extends ki {
|
|
|
2596
2594
|
}), this.reportFpsSample(), this.reportFpsRound();
|
|
2597
2595
|
}
|
|
2598
2596
|
reportFpsSample() {
|
|
2599
|
-
const e = new
|
|
2597
|
+
const e = new Pt(), a = () => {
|
|
2600
2598
|
e.stop();
|
|
2601
2599
|
const r = e.getReport();
|
|
2602
2600
|
this.track("FPS Performance", { ...r, fpsType: "sample" }), n();
|
|
@@ -2606,7 +2604,7 @@ class Gi extends ki {
|
|
|
2606
2604
|
n();
|
|
2607
2605
|
}
|
|
2608
2606
|
reportFpsRound() {
|
|
2609
|
-
const e = new
|
|
2607
|
+
const e = new Pt();
|
|
2610
2608
|
this.on("playCycleStart", () => {
|
|
2611
2609
|
e.start();
|
|
2612
2610
|
}), this.on("playCycleEnd", () => {
|
|
@@ -2617,13 +2615,13 @@ class Gi extends ki {
|
|
|
2617
2615
|
}
|
|
2618
2616
|
getExtraUiInteractionData() {
|
|
2619
2617
|
return {
|
|
2620
|
-
orientation:
|
|
2621
|
-
stateType: y(this,
|
|
2618
|
+
orientation: Je(),
|
|
2619
|
+
stateType: y(this, Ee)
|
|
2622
2620
|
};
|
|
2623
2621
|
}
|
|
2624
2622
|
async deviceInfo() {
|
|
2625
2623
|
var g;
|
|
2626
|
-
const e = new N(navigator.userAgent), a =
|
|
2624
|
+
const e = new N(navigator.userAgent), a = Si(), n = await Ii(), r = e.getBrowser(), s = e.getDevice(), h = e.getOS();
|
|
2627
2625
|
return {
|
|
2628
2626
|
browserName: r.name,
|
|
2629
2627
|
browserVersion: r.version,
|
|
@@ -2636,7 +2634,7 @@ class Gi extends ki {
|
|
|
2636
2634
|
manufacturer: s.vendor,
|
|
2637
2635
|
operatingSystem: h.name,
|
|
2638
2636
|
operatingSystemVersion: h.version,
|
|
2639
|
-
orientation:
|
|
2637
|
+
orientation: Je(),
|
|
2640
2638
|
pixelRatio: window.devicePixelRatio,
|
|
2641
2639
|
screenHeight: window.screen.height,
|
|
2642
2640
|
screenSize: `${window.screen.width}x${window.screen.height}`,
|
|
@@ -2648,62 +2646,63 @@ class Gi extends ki {
|
|
|
2648
2646
|
};
|
|
2649
2647
|
}
|
|
2650
2648
|
}
|
|
2651
|
-
|
|
2652
|
-
let
|
|
2653
|
-
const
|
|
2654
|
-
function
|
|
2655
|
-
if (!
|
|
2649
|
+
_e = new WeakMap(), ae = new WeakMap(), ne = new WeakMap(), se = new WeakMap(), ke = new WeakMap(), Fe = new WeakMap(), Ee = new WeakMap(), De = new WeakMap();
|
|
2650
|
+
let Oe;
|
|
2651
|
+
const Ti = new Uint8Array(16);
|
|
2652
|
+
function Ai() {
|
|
2653
|
+
if (!Oe && (Oe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Oe))
|
|
2656
2654
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2657
|
-
return
|
|
2655
|
+
return Oe(Ti);
|
|
2658
2656
|
}
|
|
2659
|
-
const
|
|
2657
|
+
const E = [];
|
|
2660
2658
|
for (let i = 0; i < 256; ++i)
|
|
2661
|
-
|
|
2662
|
-
function
|
|
2663
|
-
return
|
|
2659
|
+
E.push((i + 256).toString(16).slice(1));
|
|
2660
|
+
function Pi(i, t = 0) {
|
|
2661
|
+
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]];
|
|
2664
2662
|
}
|
|
2665
|
-
const
|
|
2666
|
-
randomUUID:
|
|
2663
|
+
const xi = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xt = {
|
|
2664
|
+
randomUUID: xi
|
|
2667
2665
|
};
|
|
2668
|
-
function
|
|
2669
|
-
if (
|
|
2670
|
-
return
|
|
2666
|
+
function Ot(i, t, e) {
|
|
2667
|
+
if (xt.randomUUID && !t && !i)
|
|
2668
|
+
return xt.randomUUID();
|
|
2671
2669
|
i = i || {};
|
|
2672
|
-
const a = i.random || (i.rng ||
|
|
2670
|
+
const a = i.random || (i.rng || Ai)();
|
|
2673
2671
|
if (a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, t) {
|
|
2674
2672
|
e = e || 0;
|
|
2675
2673
|
for (let n = 0; n < 16; ++n)
|
|
2676
2674
|
t[e + n] = a[n];
|
|
2677
2675
|
return t;
|
|
2678
2676
|
}
|
|
2679
|
-
return
|
|
2677
|
+
return Pi(a);
|
|
2680
2678
|
}
|
|
2681
|
-
class
|
|
2682
|
-
constructor(t) {
|
|
2683
|
-
|
|
2684
|
-
this
|
|
2679
|
+
class Rt {
|
|
2680
|
+
constructor(t, e) {
|
|
2681
|
+
b(this, "config");
|
|
2682
|
+
b(this, "sdkConfig");
|
|
2683
|
+
this.config = t, this.sdkConfig = e;
|
|
2685
2684
|
}
|
|
2686
2685
|
}
|
|
2687
|
-
const
|
|
2688
|
-
var oe, re, ce, V,
|
|
2689
|
-
class
|
|
2686
|
+
const Ut = 25, Lt = 1e4;
|
|
2687
|
+
var oe, re, ce, V, Ce;
|
|
2688
|
+
class Gi extends Rt {
|
|
2690
2689
|
constructor(...e) {
|
|
2691
2690
|
super(...e);
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
v(this, re, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), v(this, V, []), v(this,
|
|
2691
|
+
C(this, oe, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
|
|
2692
|
+
C(this, re, void 0);
|
|
2693
|
+
C(this, ce, void 0);
|
|
2694
|
+
C(this, V, []);
|
|
2695
|
+
C(this, Ce, void 0);
|
|
2696
|
+
b(this, "processQueueForced");
|
|
2697
|
+
v(this, re, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), v(this, V, []), v(this, Ce, Ot()), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(y(this, oe), {
|
|
2699
2698
|
method: "OPTIONS"
|
|
2700
|
-
}).catch(
|
|
2699
|
+
}).catch(ct), this.subscribe();
|
|
2701
2700
|
}
|
|
2702
2701
|
subscribe() {
|
|
2703
2702
|
window.addEventListener("beforeunload", this.processQueueForced, !1), window.addEventListener("pagehide", this.processQueueForced, !1), window.addEventListener("visibilitychange", this.processQueueForced, !1);
|
|
2704
2703
|
}
|
|
2705
2704
|
schedule() {
|
|
2706
|
-
y(this, ce) && clearTimeout(y(this, ce)), v(this, ce, window.setTimeout(() => this.processQueue(),
|
|
2705
|
+
y(this, ce) && clearTimeout(y(this, ce)), v(this, ce, window.setTimeout(() => this.processQueue(), Lt));
|
|
2707
2706
|
}
|
|
2708
2707
|
send(e) {
|
|
2709
2708
|
v(this, re, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime());
|
|
@@ -2717,7 +2716,7 @@ class Wi extends Ht {
|
|
|
2717
2716
|
"Content-Type": "application/json"
|
|
2718
2717
|
},
|
|
2719
2718
|
keepalive: !0
|
|
2720
|
-
}).catch(
|
|
2719
|
+
}).catch(ct);
|
|
2721
2720
|
}
|
|
2722
2721
|
this.schedule();
|
|
2723
2722
|
}
|
|
@@ -2725,12 +2724,12 @@ class Wi extends Ht {
|
|
|
2725
2724
|
y(this, V).push(e), this.processQueue();
|
|
2726
2725
|
}
|
|
2727
2726
|
processQueue(e = !1) {
|
|
2728
|
-
if (!(this.
|
|
2727
|
+
if (!(this.sdkConfig == null || !this.sdkConfig.ui.feature.allowTelemetry) && !(!e && y(this, V).length < Ut && /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime() - y(this, re) < Lt))
|
|
2729
2728
|
for (; y(this, V).length; ) {
|
|
2730
|
-
const a = y(this, V).splice(0,
|
|
2729
|
+
const a = y(this, V).splice(0, Ut).map((n) => ({
|
|
2731
2730
|
...n,
|
|
2732
|
-
sessionID: y(this,
|
|
2733
|
-
userID: this.
|
|
2731
|
+
sessionID: y(this, Ce),
|
|
2732
|
+
userID: this.sdkConfig.api.user
|
|
2734
2733
|
}));
|
|
2735
2734
|
this.send(a);
|
|
2736
2735
|
}
|
|
@@ -2740,31 +2739,31 @@ class Wi extends Ht {
|
|
|
2740
2739
|
eventName: e,
|
|
2741
2740
|
eventParams: a,
|
|
2742
2741
|
eventTimestamp: /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime(),
|
|
2743
|
-
eventUUID:
|
|
2742
|
+
eventUUID: Ot()
|
|
2744
2743
|
});
|
|
2745
2744
|
}
|
|
2746
2745
|
}
|
|
2747
|
-
oe = new WeakMap(), re = new WeakMap(), ce = new WeakMap(), V = new WeakMap(),
|
|
2748
|
-
const
|
|
2749
|
-
class
|
|
2746
|
+
oe = new WeakMap(), re = new WeakMap(), ce = new WeakMap(), V = new WeakMap(), Ce = new WeakMap();
|
|
2747
|
+
const Oi = U("LoggingTracker", "color:#000000;font-weight:bold;");
|
|
2748
|
+
class Wi extends Rt {
|
|
2750
2749
|
track(t, e) {
|
|
2751
|
-
|
|
2750
|
+
Oi(`@${this.sdkConfig.api.user}`, `[${t}]`, e);
|
|
2752
2751
|
}
|
|
2753
2752
|
}
|
|
2754
2753
|
export {
|
|
2755
|
-
|
|
2754
|
+
_i as BasicPlugin,
|
|
2756
2755
|
j as CasinoPlugin,
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2756
|
+
Fi as DebuggingPlugin,
|
|
2757
|
+
Di as GigPlugin,
|
|
2758
|
+
zi as KalambaBullseyePlugin,
|
|
2759
|
+
qi as KalambaStargazerPlugin,
|
|
2760
|
+
Gi as KalambaStargazerTracker,
|
|
2761
|
+
Wi as LoggingTracker,
|
|
2762
|
+
Ni as OryxPlugin,
|
|
2763
|
+
Ri as PariplayPlugin,
|
|
2764
|
+
Hi as RelaxFEIMPlugin,
|
|
2765
|
+
Xt as RgsPlygin,
|
|
2767
2766
|
ki as TelemetryPlugin,
|
|
2768
|
-
|
|
2769
|
-
|
|
2767
|
+
Rt as Tracker,
|
|
2768
|
+
Vi as TukoPlugin
|
|
2770
2769
|
};
|