@jolibox/ads 1.4.11 → 1.4.13
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/components/newsbreak/reward.d.ts +0 -2
- package/dist/index.js +58 -81
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var Jt = (t, e) => {
|
|
|
20
20
|
return i;
|
|
21
21
|
};
|
|
22
22
|
import { options as Te, Component as hn, isValidElement as fn } from "preact";
|
|
23
|
-
import { useRef as mi, useLayoutEffect as vn, useEffect as Ce, useMemo as yn, useState as
|
|
23
|
+
import { useRef as mi, useLayoutEffect as vn, useEffect as Ce, useMemo as yn, useState as pe, useCallback as kt, render as ye, createRef as Ht } from "preact/compat";
|
|
24
24
|
import { registerCanIUseContext as gn, invokeNative as gt, offNative as wn, onNative as An } from "@jolibox/native-bridge";
|
|
25
25
|
var Si = Object.defineProperty, bn = Object.defineProperties, pn = Object.getOwnPropertyDescriptors, Yt = Object.getOwnPropertySymbols, _n = Object.prototype.hasOwnProperty, mn = Object.prototype.propertyIsEnumerable, Xt = (t, e, i) => e in t ? Si(t, e, {
|
|
26
26
|
enumerable: !0,
|
|
@@ -541,7 +541,7 @@ function Xn(t, e) {
|
|
|
541
541
|
}
|
|
542
542
|
return (e === "string" ? String : Number)(t);
|
|
543
543
|
}
|
|
544
|
-
const
|
|
544
|
+
const me = (t) => t ? function() {
|
|
545
545
|
try {
|
|
546
546
|
for (var e = arguments.length, i = new Array(e), n = 0; n < e; n++)
|
|
547
547
|
i[n] = arguments[n];
|
|
@@ -570,7 +570,7 @@ class Qn {
|
|
|
570
570
|
module: "game",
|
|
571
571
|
game_id: this.contextInfo.objectId
|
|
572
572
|
}), (a = this.adIsShowingCallback) == null || a.call(this, !0);
|
|
573
|
-
const r =
|
|
573
|
+
const r = me(i);
|
|
574
574
|
r == null || r();
|
|
575
575
|
}), this.context = e, this.contextInfo = e.getContextInfo();
|
|
576
576
|
}
|
|
@@ -595,7 +595,7 @@ class Qn {
|
|
|
595
595
|
var i, n, r, o;
|
|
596
596
|
if (this.adsHasResponse = !0, this.context.track("CallBeforeAd", this.paramsToTrack), this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_AD", this.paramsToTrack), !this.isBeforeAdCalled) {
|
|
597
597
|
this.isBeforeAdCalled = !0;
|
|
598
|
-
const s =
|
|
598
|
+
const s = me(e);
|
|
599
599
|
s == null || s(), ((i = this.currentClientParams) == null ? void 0 : i.type) !== "reward" && ((n = this.adIsShowingCallback) == null || n.call(this, !0), st() && this.context.track("mmp_ad_impression", {
|
|
600
600
|
ad_network: (o = (r = this.currentProvider) == null ? void 0 : r.name) != null ? o : "",
|
|
601
601
|
ad_format: "interstitial",
|
|
@@ -614,7 +614,7 @@ class Qn {
|
|
|
614
614
|
return () => {
|
|
615
615
|
if (this.adsHasResponse = !0, !this.isAdDismissedCalled) {
|
|
616
616
|
this.isAdDismissedCalled = !0;
|
|
617
|
-
const i =
|
|
617
|
+
const i = me(e);
|
|
618
618
|
i == null || i();
|
|
619
619
|
}
|
|
620
620
|
};
|
|
@@ -623,7 +623,7 @@ class Qn {
|
|
|
623
623
|
return () => {
|
|
624
624
|
if (this.adsHasResponse = !0, !this.isAdViewedCalled) {
|
|
625
625
|
this.isAdViewedCalled = !0;
|
|
626
|
-
const i =
|
|
626
|
+
const i = me(e);
|
|
627
627
|
i == null || i();
|
|
628
628
|
}
|
|
629
629
|
};
|
|
@@ -632,7 +632,7 @@ class Qn {
|
|
|
632
632
|
return () => {
|
|
633
633
|
if (this.adsHasResponse = !0, this.context.track("CallAfterAd", this.paramsToTrack), this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AFTER_AD", this.paramsToTrack), !this.isAfterAdCalled) {
|
|
634
634
|
this.isAfterAdCalled = !0;
|
|
635
|
-
const i =
|
|
635
|
+
const i = me(e);
|
|
636
636
|
i == null || i();
|
|
637
637
|
}
|
|
638
638
|
};
|
|
@@ -657,7 +657,7 @@ class Qn {
|
|
|
657
657
|
case "ignored":
|
|
658
658
|
case "dismissed":
|
|
659
659
|
case "error": {
|
|
660
|
-
const h =
|
|
660
|
+
const h = me(e);
|
|
661
661
|
h == null || h(i), (l = this.adIsShowingCallback) == null || l.call(this, !1), (u = this.continueCallback) == null || u.call(this, [!1, i]);
|
|
662
662
|
break;
|
|
663
663
|
}
|
|
@@ -1551,10 +1551,10 @@ var Fr = {
|
|
|
1551
1551
|
case "animationName":
|
|
1552
1552
|
if (typeof i == "string")
|
|
1553
1553
|
return i.replace(jr, function(n, r, o) {
|
|
1554
|
-
return
|
|
1554
|
+
return we = {
|
|
1555
1555
|
name: r,
|
|
1556
1556
|
styles: o,
|
|
1557
|
-
next:
|
|
1557
|
+
next: we
|
|
1558
1558
|
}, r;
|
|
1559
1559
|
});
|
|
1560
1560
|
}
|
|
@@ -1572,20 +1572,20 @@ function dt(t, e, i) {
|
|
|
1572
1572
|
case "object": {
|
|
1573
1573
|
var r = i;
|
|
1574
1574
|
if (r.anim === 1)
|
|
1575
|
-
return
|
|
1575
|
+
return we = {
|
|
1576
1576
|
name: r.name,
|
|
1577
1577
|
styles: r.styles,
|
|
1578
|
-
next:
|
|
1578
|
+
next: we
|
|
1579
1579
|
}, r.name;
|
|
1580
1580
|
var o = i;
|
|
1581
1581
|
if (o.styles !== void 0) {
|
|
1582
1582
|
var s = o.next;
|
|
1583
1583
|
if (s !== void 0)
|
|
1584
1584
|
for (; s !== void 0; )
|
|
1585
|
-
|
|
1585
|
+
we = {
|
|
1586
1586
|
name: s.name,
|
|
1587
1587
|
styles: s.styles,
|
|
1588
|
-
next:
|
|
1588
|
+
next: we
|
|
1589
1589
|
}, s = s.next;
|
|
1590
1590
|
var a = o.styles + ";";
|
|
1591
1591
|
return a;
|
|
@@ -1628,12 +1628,12 @@ function Vr(t, e, i) {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
return n;
|
|
1630
1630
|
}
|
|
1631
|
-
var ai = /label:\s*([^\s;{]+)\s*(;|$)/g,
|
|
1631
|
+
var ai = /label:\s*([^\s;{]+)\s*(;|$)/g, we;
|
|
1632
1632
|
function bt(t, e, i) {
|
|
1633
1633
|
if (t.length === 1 && typeof t[0] == "object" && t[0] !== null && t[0].styles !== void 0)
|
|
1634
1634
|
return t[0];
|
|
1635
1635
|
var n = !0, r = "";
|
|
1636
|
-
|
|
1636
|
+
we = void 0;
|
|
1637
1637
|
var o = t[0];
|
|
1638
1638
|
if (o == null || o.raw === void 0)
|
|
1639
1639
|
n = !1, r += dt(i, e, o);
|
|
@@ -1653,7 +1653,7 @@ function bt(t, e, i) {
|
|
|
1653
1653
|
return {
|
|
1654
1654
|
name: c,
|
|
1655
1655
|
styles: r,
|
|
1656
|
-
next:
|
|
1656
|
+
next: we
|
|
1657
1657
|
};
|
|
1658
1658
|
}
|
|
1659
1659
|
function $i(t, e, i) {
|
|
@@ -1841,8 +1841,8 @@ function Xr(t, e) {
|
|
|
1841
1841
|
}
|
|
1842
1842
|
var Qr = Symbol.for("preact-signals");
|
|
1843
1843
|
function vt() {
|
|
1844
|
-
if (
|
|
1845
|
-
|
|
1844
|
+
if (Ae > 1)
|
|
1845
|
+
Ae--;
|
|
1846
1846
|
else {
|
|
1847
1847
|
for (var t, e = !1; Fe !== void 0; ) {
|
|
1848
1848
|
var i = Fe;
|
|
@@ -1857,21 +1857,21 @@ function vt() {
|
|
|
1857
1857
|
i = n;
|
|
1858
1858
|
}
|
|
1859
1859
|
}
|
|
1860
|
-
if (Nt = 0,
|
|
1860
|
+
if (Nt = 0, Ae--, e)
|
|
1861
1861
|
throw t;
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
1864
|
function P(t) {
|
|
1865
|
-
if (
|
|
1865
|
+
if (Ae > 0)
|
|
1866
1866
|
return t();
|
|
1867
|
-
|
|
1867
|
+
Ae++;
|
|
1868
1868
|
try {
|
|
1869
1869
|
return t();
|
|
1870
1870
|
} finally {
|
|
1871
1871
|
vt();
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
|
-
var T = void 0, Fe = void 0,
|
|
1874
|
+
var T = void 0, Fe = void 0, Ae = 0, Nt = 0, lt = 0;
|
|
1875
1875
|
function ji(t) {
|
|
1876
1876
|
if (T !== void 0) {
|
|
1877
1877
|
var e = t.n;
|
|
@@ -1934,7 +1934,7 @@ Object.defineProperty(U.prototype, "value", { get: function() {
|
|
|
1934
1934
|
if (t !== this.v) {
|
|
1935
1935
|
if (Nt > 100)
|
|
1936
1936
|
throw new Error("Cycle detected");
|
|
1937
|
-
this.v = t, this.i++, lt++,
|
|
1937
|
+
this.v = t, this.i++, lt++, Ae++;
|
|
1938
1938
|
try {
|
|
1939
1939
|
for (var e = this.t; e !== void 0; e = e.x)
|
|
1940
1940
|
e.t.N();
|
|
@@ -2024,7 +2024,7 @@ function Ue(t) {
|
|
|
2024
2024
|
function qi(t) {
|
|
2025
2025
|
var e = t.u;
|
|
2026
2026
|
if (t.u = void 0, typeof e == "function") {
|
|
2027
|
-
|
|
2027
|
+
Ae++;
|
|
2028
2028
|
var i = T;
|
|
2029
2029
|
T = void 0;
|
|
2030
2030
|
try {
|
|
@@ -2063,7 +2063,7 @@ qe.prototype.c = function() {
|
|
|
2063
2063
|
qe.prototype.S = function() {
|
|
2064
2064
|
if (1 & this.f)
|
|
2065
2065
|
throw new Error("Cycle detected");
|
|
2066
|
-
this.f |= 1, this.f &= -9, qi(this), Gi(this),
|
|
2066
|
+
this.f |= 1, this.f &= -9, qi(this), Gi(this), Ae++;
|
|
2067
2067
|
var t = T;
|
|
2068
2068
|
return T = this, Zr.bind(this, t);
|
|
2069
2069
|
};
|
|
@@ -2568,7 +2568,7 @@ const oo = G`
|
|
|
2568
2568
|
countdown: d,
|
|
2569
2569
|
src: l,
|
|
2570
2570
|
mode: u
|
|
2571
|
-
} = e, c = yn(() => ho(), []), [h, f] =
|
|
2571
|
+
} = e, c = yn(() => ho(), []), [h, f] = pe(!1), v = (w) => {
|
|
2572
2572
|
var g, A, S, p;
|
|
2573
2573
|
a.value = !1, w === "dismiss" ? (g = n.value) == null || g.call(n) : w === "viewed" && ((A = r.value) == null || A.call(r)), (S = i.value) == null || S.call(i), (p = o.value) == null || p.call(o), f(!1);
|
|
2574
2574
|
}, y = kt(() => {
|
|
@@ -2843,7 +2843,7 @@ const Ao = () => {
|
|
|
2843
2843
|
adError: a,
|
|
2844
2844
|
visible: d,
|
|
2845
2845
|
payload: l
|
|
2846
|
-
} = e, [u, c] =
|
|
2846
|
+
} = e, [u, c] = pe(!1), [h, f] = pe(0), [v, y] = pe(!1), [w, g] = pe(!1), [A, S] = pe("Loading next content..."), p = mi(null), _ = l.value, E = kt((L) => {
|
|
2847
2847
|
var C, W, K, I;
|
|
2848
2848
|
c(!1), d.value = !1, L === "dismiss" ? (C = n.value) == null || C.call(n) : (W = r.value) == null || W.call(r), (K = i.value) == null || K.call(i), (I = o.value) == null || I.call(o);
|
|
2849
2849
|
}, [d, n, r, i, o]), b = kt(() => {
|
|
@@ -2904,7 +2904,7 @@ const Ao = () => {
|
|
|
2904
2904
|
};
|
|
2905
2905
|
}, [d.value, _, s, b]), !d.value || !_)
|
|
2906
2906
|
return null;
|
|
2907
|
-
const ee = _.mode === "reward" ? "Next content unlocking" : "Content paused",
|
|
2907
|
+
const ee = _.mode === "reward" ? "Next content unlocking" : "Content paused", _e = h > 0 ? `Content resumes in ${h}s` : "Content ready";
|
|
2908
2908
|
return m("div", {
|
|
2909
2909
|
className: bo,
|
|
2910
2910
|
children: m("div", {
|
|
@@ -2916,7 +2916,7 @@ const Ao = () => {
|
|
|
2916
2916
|
children: ee
|
|
2917
2917
|
}), m("div", {
|
|
2918
2918
|
className: So,
|
|
2919
|
-
children:
|
|
2919
|
+
children: _e
|
|
2920
2920
|
})]
|
|
2921
2921
|
}), m("div", {
|
|
2922
2922
|
className: Eo,
|
|
@@ -3164,7 +3164,7 @@ window.addEventListener("message", (t) => {
|
|
|
3164
3164
|
e(t.data.data);
|
|
3165
3165
|
});
|
|
3166
3166
|
});
|
|
3167
|
-
const
|
|
3167
|
+
const Se = (t, e) => {
|
|
3168
3168
|
Ce(() => (xe[t] || (xe[t] = /* @__PURE__ */ new Set()), xe[t].add(e), () => {
|
|
3169
3169
|
xe[t].delete(e);
|
|
3170
3170
|
}), [t, e]);
|
|
@@ -3213,17 +3213,17 @@ const Ee = (t, e) => {
|
|
|
3213
3213
|
adLinkClicked: a,
|
|
3214
3214
|
visible: d,
|
|
3215
3215
|
src: l
|
|
3216
|
-
} = e, [u, c] =
|
|
3216
|
+
} = e, [u, c] = pe(!1), h = (v) => {
|
|
3217
3217
|
var y, w, g, A;
|
|
3218
3218
|
c(!1), d.value = !1, v === "dismiss" ? (y = n.value) == null || y.call(n) : v === "viewed" && ((w = r.value) == null || w.call(r)), (g = i.value) == null || g.call(i), (A = o.value) == null || A.call(o);
|
|
3219
3219
|
}, f = () => {
|
|
3220
3220
|
var v;
|
|
3221
3221
|
(v = s.value) == null || v.call(s);
|
|
3222
3222
|
};
|
|
3223
|
-
return
|
|
3223
|
+
return Se("appsrockets_ad_dismissed", () => h("dismiss")), Se("appsrockets_ad_rewarded", () => h("viewed")), Se("appsrockets_ad_completed", () => h("viewed")), Se("appsrockets_ad_skipped", () => h("viewed")), Se("appsrockets_ad_clicked", (v) => {
|
|
3224
3224
|
var y;
|
|
3225
3225
|
return (y = a.value) == null ? void 0 : y.call(a, v);
|
|
3226
|
-
}),
|
|
3226
|
+
}), Se("appsrockets_ad_loaded", () => c(!0)), d.value ? m("div", {
|
|
3227
3227
|
className: Do,
|
|
3228
3228
|
style: {
|
|
3229
3229
|
display: u ? "flex" : "none"
|
|
@@ -3550,7 +3550,7 @@ class Uo {
|
|
|
3550
3550
|
});
|
|
3551
3551
|
}
|
|
3552
3552
|
}
|
|
3553
|
-
function
|
|
3553
|
+
function be(t, e, i) {
|
|
3554
3554
|
return (e = jo(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
|
|
3555
3555
|
}
|
|
3556
3556
|
function jo(t) {
|
|
@@ -3571,7 +3571,7 @@ function Vo(t, e) {
|
|
|
3571
3571
|
}
|
|
3572
3572
|
class Go {
|
|
3573
3573
|
constructor(e, i) {
|
|
3574
|
-
|
|
3574
|
+
be(this, "name", "GOOGLE_GPT"), be(this, "context", void 0), be(this, "contextInfo", void 0), be(this, "initParams", void 0), be(this, "rewardAdManager", void 0), be(this, "interstitialManager", void 0), be(this, "insertScript", () => {
|
|
3575
3575
|
const n = "jolibox-google-gpt";
|
|
3576
3576
|
let r = document.getElementById(n);
|
|
3577
3577
|
r || (r = window.document.createElement("script"), r.id = n, r.async = !0, r.src = "https://securepubads.g.doubleclick.net/tag/js/gpt.js", r.crossOrigin = "anonymous", document.head.appendChild(r));
|
|
@@ -4297,7 +4297,7 @@ const rt = () => {
|
|
|
4297
4297
|
} catch (t) {
|
|
4298
4298
|
}
|
|
4299
4299
|
};
|
|
4300
|
-
function
|
|
4300
|
+
function Ee(t, e, i) {
|
|
4301
4301
|
return (e = cs(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
|
|
4302
4302
|
}
|
|
4303
4303
|
function cs(t) {
|
|
@@ -4318,26 +4318,24 @@ function hs(t, e) {
|
|
|
4318
4318
|
}
|
|
4319
4319
|
class fs {
|
|
4320
4320
|
constructor() {
|
|
4321
|
-
|
|
4322
|
-
|
|
4321
|
+
Ee(this, "adsContext", null), Ee(this, "init", async () => {
|
|
4322
|
+
console.log("[JoliboxSDK] NewsBreak init");
|
|
4323
4323
|
const e = rt();
|
|
4324
4324
|
if (e)
|
|
4325
4325
|
try {
|
|
4326
|
-
if (this._isAvailable = await e.isAvailable("rewarded"), console.log("[JoliboxSDK] NewsBreak init isAvailable", this._isAvailable), !this._isAvailable)
|
|
4327
|
-
return;
|
|
4328
4326
|
const i = await e.createRewardAd({
|
|
4329
4327
|
platform: "jolibox"
|
|
4330
4328
|
});
|
|
4331
|
-
console.log("[JoliboxSDK] NewsBreak init createRewardAd result:", i)
|
|
4329
|
+
console.log("[JoliboxSDK] NewsBreak init createRewardAd result:", i);
|
|
4332
4330
|
} catch (i) {
|
|
4333
|
-
|
|
4331
|
+
console.log("[JoliboxSDK] NewsBreak init createRewardAd error:", i);
|
|
4334
4332
|
}
|
|
4335
|
-
}),
|
|
4333
|
+
}), Ee(this, "destroy", (e) => {
|
|
4336
4334
|
var i, n;
|
|
4337
|
-
|
|
4338
|
-
}),
|
|
4339
|
-
this.destroy(e), await this.init();
|
|
4340
|
-
}),
|
|
4335
|
+
(n = (i = this.adsContext) == null ? void 0 : i.adBreakDone) == null || n.call(i, e), e !== "ignored" && (this.adsContext = null);
|
|
4336
|
+
}), Ee(this, "reinit", async (e) => {
|
|
4337
|
+
console.log("[JoliboxSDK] NewsBreak reinit breakStatus:", e), this.destroy(e), await this.init();
|
|
4338
|
+
}), Ee(this, "requestAds", async (e) => {
|
|
4341
4339
|
if (console.log("[JoliboxSDK] NewsBreak newsbreak this.adsContext", this.adsContext), this.adsContext) {
|
|
4342
4340
|
this.destroy("ignored");
|
|
4343
4341
|
return;
|
|
@@ -4348,30 +4346,9 @@ class fs {
|
|
|
4348
4346
|
this.destroy("notReady");
|
|
4349
4347
|
return;
|
|
4350
4348
|
}
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
}
|
|
4355
|
-
const n = await i.isRewardReady();
|
|
4356
|
-
if (console.log("[JoliboxSDK] NewsBreak requestAds sdk.isRewardReady", n), n)
|
|
4357
|
-
this._isReady = !0, this.showAd();
|
|
4358
|
-
else {
|
|
4359
|
-
const r = window.setTimeout(() => {
|
|
4360
|
-
var o, s;
|
|
4361
|
-
console.log("[JoliboxSDK] NewsBreak requestAds timeoutId:", this._isReady), this._isReady || ((s = (o = this.adsContext) == null ? void 0 : o.adBreakDone) == null || s.call(o, "timeout"), this.reinit("timeout"));
|
|
4362
|
-
}, 5e3);
|
|
4363
|
-
i.createRewardAd({
|
|
4364
|
-
platform: "jolibox"
|
|
4365
|
-
}).then((o) => {
|
|
4366
|
-
var s, a;
|
|
4367
|
-
console.log("[JoliboxSDK] NewsBreak requestAds sdk.createRewardAd result:", o), clearTimeout(r), o.success && o.ready ? (this._isReady = !0, this.showAd()) : (this.reinit("noAdPreloaded"), (a = (s = this.adsContext) == null ? void 0 : s.adBreakDone) == null || a.call(s, "noAdPreloaded"));
|
|
4368
|
-
}).catch((o) => {
|
|
4369
|
-
var s, a;
|
|
4370
|
-
console.log("[JoliboxSDK] NewsBreak requestAds sdk.createRewardAd error:", o), clearTimeout(r), this.reinit("noAdPreloaded"), (a = (s = this.adsContext) == null ? void 0 : s.adBreakDone) == null || a.call(s, "noAdPreloaded");
|
|
4371
|
-
});
|
|
4372
|
-
}
|
|
4373
|
-
}), ge(this, "showAd", () => {
|
|
4374
|
-
if (!this.adsContext) {
|
|
4349
|
+
this.showAd();
|
|
4350
|
+
}), Ee(this, "showAd", () => {
|
|
4351
|
+
if (console.log("[JoliboxSDK] NewsBreak showAd"), !this.adsContext) {
|
|
4375
4352
|
this.destroy("error");
|
|
4376
4353
|
return;
|
|
4377
4354
|
}
|
|
@@ -4621,8 +4598,8 @@ class ea {
|
|
|
4621
4598
|
}
|
|
4622
4599
|
case "reward": {
|
|
4623
4600
|
e.beforeReward(() => {
|
|
4624
|
-
var b, ee,
|
|
4625
|
-
(b = e.beforeAd) == null || b.call(e), (ee = e.adViewed) == null || ee.call(e), (
|
|
4601
|
+
var b, ee, _e, L;
|
|
4602
|
+
(b = e.beforeAd) == null || b.call(e), (ee = e.adViewed) == null || ee.call(e), (_e = e.afterAd) == null || _e.call(e), (L = e.adBreakDone) == null || L.call(e, {
|
|
4626
4603
|
breakType: e.type,
|
|
4627
4604
|
breakName: e.name,
|
|
4628
4605
|
breakFormat: "reward",
|
|
@@ -4662,7 +4639,7 @@ class ea {
|
|
|
4662
4639
|
return;
|
|
4663
4640
|
}
|
|
4664
4641
|
let b = !0, ee = null;
|
|
4665
|
-
const
|
|
4642
|
+
const _e = new Qn(this.context);
|
|
4666
4643
|
this.adsActionDetection.adBreakIsShowing = !0;
|
|
4667
4644
|
const L = _.filter((I) => I.isNative).sort((I, X) => I.seq - X.seq), C = _.filter((I) => !I.isNative).sort((I, X) => I.seq - X.seq), W = {
|
|
4668
4645
|
seq: (w = (y = L[0]) == null ? void 0 : y.seq) != null ? w : 0,
|
|
@@ -4676,7 +4653,7 @@ class ea {
|
|
|
4676
4653
|
})); K.length > 0; ) {
|
|
4677
4654
|
const I = K.shift(), X = this.providers[I.provider];
|
|
4678
4655
|
if (X) {
|
|
4679
|
-
const [an, dn] = await
|
|
4656
|
+
const [an, dn] = await _e.callAdBreakAndContinue(X, e, I, (Vt) => {
|
|
4680
4657
|
var Gt;
|
|
4681
4658
|
this.adsIsShowing = Vt, (Gt = this.context.eventEmitter) == null || Gt.emit("isAdShowing", Vt);
|
|
4682
4659
|
});
|
|
@@ -5225,7 +5202,7 @@ class $s {
|
|
|
5225
5202
|
}), this.context = e;
|
|
5226
5203
|
}
|
|
5227
5204
|
}
|
|
5228
|
-
function
|
|
5205
|
+
function ge(t, e, i) {
|
|
5229
5206
|
return (e = Fs(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
|
|
5230
5207
|
}
|
|
5231
5208
|
function Fs(t) {
|
|
@@ -5246,22 +5223,22 @@ function Us(t, e) {
|
|
|
5246
5223
|
}
|
|
5247
5224
|
class js {
|
|
5248
5225
|
constructor(e) {
|
|
5249
|
-
|
|
5226
|
+
ge(this, "name", "GOOGLE_GPT"), ge(this, "context", void 0), ge(this, "contextInfo", void 0), ge(this, "rewardAdManager", void 0), ge(this, "init", async (i) => {
|
|
5250
5227
|
if (!this.rewardAdManager) {
|
|
5251
5228
|
const n = this.contextInfo.testAdsMode ? "/22639388115/rewarded_web_example" : i.params.rewardedSlot, o = `minidrama-${this.contextInfo.runtimeType === "APP" ? "app" : "h5"}`;
|
|
5252
5229
|
this.rewardAdManager = new nn(n, o, i.params.keyValue);
|
|
5253
5230
|
}
|
|
5254
|
-
}),
|
|
5231
|
+
}), ge(this, "insertScript", () => {
|
|
5255
5232
|
const i = "jolibox-google-gpt";
|
|
5256
5233
|
let n = document.getElementById(i);
|
|
5257
5234
|
n || (n = window.document.createElement("script"), n.id = i, n.async = !0, n.src = "https://securepubads.g.doubleclick.net/tag/js/gpt.js", n.crossOrigin = "anonymous", document.head.appendChild(n));
|
|
5258
|
-
}),
|
|
5235
|
+
}), ge(this, "destroy", () => {
|
|
5259
5236
|
var i;
|
|
5260
5237
|
(i = this.rewardAdManager) == null || i.withCommand(() => {
|
|
5261
5238
|
var n;
|
|
5262
5239
|
(n = this.rewardAdManager) == null || n.destroy("ignored");
|
|
5263
5240
|
});
|
|
5264
|
-
}),
|
|
5241
|
+
}), ge(this, "requestAd", (i, n) => {
|
|
5265
5242
|
var r;
|
|
5266
5243
|
if (!this.rewardAdManager) {
|
|
5267
5244
|
(r = i.onAdError) == null || r.call(i, F.from(new Error("rewardAdManager not initialized"), "JOLIBOX_IMA_ERROR"));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jolibox/ads",
|
|
3
3
|
"description": "This project is for integrating Jolibox ads providers",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.13",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
],
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@jolibox/common": "1.4.
|
|
15
|
+
"@jolibox/common": "1.4.13",
|
|
16
16
|
"@emotion/css": "11.13.5",
|
|
17
|
-
"@jolibox/types": "1.4.
|
|
17
|
+
"@jolibox/types": "1.4.13",
|
|
18
18
|
"preact": "10.26.4",
|
|
19
19
|
"@preact/signals": "2.0.4",
|
|
20
|
-
"@jolibox/native-bridge": "1.4.
|
|
20
|
+
"@jolibox/native-bridge": "1.4.13"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@babel/core": "7.23.3",
|