if (e.has(t))
throw new TypeError("Cannot initialize the same private elements twice on an object")
}(t, e),
e.set(t, r)
}
function Et(t, e) {
return function(t, e) {
return e.get ? e.get.call(t) : e.value
}(t, Pt(t, e, "get"))
}
function Pt(t, e, r) {
if (!e.has(t))
throw new TypeError("attempted to " + r + " private field on non-instance");
return e.get(t)
}
var wt = new WeakMap
, At = new WeakMap
, Ot = function(t) {
!function(t, e) {
if ("function" != typeof e && null !== e)
throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
writable: !0,
configurable: !0
}
}),
Object.defineProperty(t, "prototype", {
writable: !1
}),
e && _t(t, e)
}(c, t);
var r, o, i, a, s = (i = c,
a = function() {
if ("undefined" == typeof Reflect || !Reflect.construct)
return !1;
if (Reflect.construct.sham)
return !1;
if ("function" == typeof Proxy)
return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}
))),
!0
} catch (t) {
return !1
}
}(),
function() {
var t, e = St(i);
if (a) {
var r = St(this).constructor;
t = Reflect.construct(e, arguments, r)
} else
t = e.apply(this, arguments);
return function(t, e) {
if (e && ("object" === yt(e) || "function" == typeof e))
return e;
if (void 0 !== e)
throw new TypeError("Derived constructors may only return object or undefined");
return gt(t)
}(this, t)
}
);
function c(t) {
var e;
return function(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function")
}(this, c),
bt(gt(e = s.call(this, t)), wt, {
writable: !0,
value: !1
}),
bt(gt(e), At, {
writable: !0,
value: performance.now()
}),
e._platformBridge.on(n.AUDIO_STATE_CHANGED, (function(t) {
return e.emit(n.AUDIO_STATE_CHANGED, t)
}
)),
e._platformBridge.on(n.PAUSE_STATE_CHANGED, (function(t) {
return e.emit(n.PAUSE_STATE_CHANGED, t)
}
)),
e
}
return r = c,
(o = [{
key: "id",
get: function() {
return this._platformBridge.platformId
}
}, {
key: "sdk",
get: function() {
return this._platformBridge.platformSdk
}
}, {
key: "language",
get: function() {
return this._platformBridge.platformLanguage
}
}, {
key: "payload",
get: function() {
return this._platformBridge.platformPayload
}
}, {
key: "tld",
get: function() {
return this._platformBridge.platformTld
}
}, {
key: "isGetAllGamesSupported",
get: function() {
return this._platformBridge.isPlatformGetAllGamesSupported
}
}, {
key: "isGetGameByIdSupported",
get: function() {
return this._platformBridge.isPlatformGetGameByIdSupported
}
}, {
key: "isAudioEnabled",
get: function() {
return this._platformBridge.isPlatformAudioEnabled
}
}, {
key: "isPaused",
get: function() {
return this._platformBridge.isPlatformPaused
}
}, {
key: "sendMessage",
value: function(t) {
var r, n, o = {};
if (t === h.GAME_READY) {
if (Et(this, wt))
return Promise.reject();
n = !0,
function(t, e, r) {
if (e.set)
e.set.call(t, r);
else {
if (!e.writable)
throw new TypeError("attempted to set read only private field");
e.value = r
}
}(r = this, Pt(r, wt, "set"), n),
o = {
time_s: ((performance.now() - Et(this, At)) / 1e3).toFixed(2)
};
var i = document.getElementById("loading-overlay");
i && i.remove()
}
return dt.send("".concat(e.PLATFORM, "_message_").concat(t), e.PLATFORM, o),
this._platformBridge.sendMessage(t)
}
}, {
key: "getServerTime",
value: function() {
return this._platformBridge.getServerTime()
}
|