@jolibox/ads 1.4.1 → 1.4.3

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.
Files changed (2) hide show
  1. package/dist/index.js +100 -100
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@ var qt = (t, e) => {
20
20
  return i;
21
21
  };
22
22
  import { options as xe, Component as on, isValidElement as sn } from "preact";
23
- import { useRef as gi, useLayoutEffect as an, useEffect as Re, useMemo as dn, useState as Ae, useCallback as _t, render as fe, createRef as Kt } from "preact/compat";
23
+ import { useRef as gi, useLayoutEffect as an, useEffect as Re, useMemo as dn, useState as we, useCallback as _t, render as fe, createRef as Kt } from "preact/compat";
24
24
  import { registerCanIUseContext as ln, invokeNative as ft, offNative as un, onNative as cn } from "@jolibox/native-bridge";
25
- var wi = Object.defineProperty, hn = Object.defineProperties, fn = Object.getOwnPropertyDescriptors, zt = Object.getOwnPropertySymbols, vn = Object.prototype.hasOwnProperty, yn = Object.prototype.propertyIsEnumerable, Wt = (t, e, i) => e in t ? wi(t, e, {
25
+ var Ai = Object.defineProperty, hn = Object.defineProperties, fn = Object.getOwnPropertyDescriptors, zt = Object.getOwnPropertySymbols, vn = Object.prototype.hasOwnProperty, yn = Object.prototype.propertyIsEnumerable, Wt = (t, e, i) => e in t ? Ai(t, e, {
26
26
  enumerable: !0,
27
27
  configurable: !0,
28
28
  writable: !0,
@@ -34,13 +34,13 @@ var wi = Object.defineProperty, hn = Object.defineProperties, fn = Object.getOwn
34
34
  for (var i of zt(e))
35
35
  yn.call(e, i) && Wt(t, i, e[i]);
36
36
  return t;
37
- }, wn = (t, e) => hn(t, fn(e)), An = (t, e) => {
37
+ }, An = (t, e) => hn(t, fn(e)), wn = (t, e) => {
38
38
  for (var i in e)
39
- wi(t, i, {
39
+ Ai(t, i, {
40
40
  get: e[i],
41
41
  enumerable: !0
42
42
  });
43
- }, Ai = (t, e, i, n) => {
43
+ }, wi = (t, e, i, n) => {
44
44
  for (var r = e, o = t.length - 1, s; o >= 0; o--)
45
45
  (s = t[o]) && (r = s(r) || r);
46
46
  return r;
@@ -149,7 +149,7 @@ function Xe(t, e) {
149
149
  }
150
150
  function On(t) {
151
151
  let e = t.location ? Xe(t.location, Xt) : null, i = t.target ? Xe(t.target, Xt) : null;
152
- return Xe(wn(gn({}, t), {
152
+ return Xe(An(gn({}, t), {
153
153
  location: e,
154
154
  target: i
155
155
  }), Tn);
@@ -364,7 +364,7 @@ var D = mt, Nn = class {
364
364
  this.on(t, n, !1);
365
365
  }
366
366
  }, Et = {};
367
- An(Et, {
367
+ wn(Et, {
368
368
  None: () => Mn,
369
369
  filter: () => $n,
370
370
  once: () => Si,
@@ -463,7 +463,7 @@ var kt = class {
463
463
  return t;
464
464
  }
465
465
  };
466
- kt = Ai([bi], kt);
466
+ kt = wi([bi], kt);
467
467
  var Yt = class {
468
468
  constructor() {
469
469
  this._onWillExecuteCommand = new $e(), this.onWillExecuteCommand = this._onWillExecuteCommand.event, this._onDidExecuteCommand = new $e(), this.onDidExecuteCommand = this._onDidExecuteCommand.event, this.registry = new kt(), this._starActivation = null;
@@ -521,7 +521,7 @@ var Yt = class {
521
521
  }
522
522
  }
523
523
  };
524
- Yt = Ai([bi], Yt);
524
+ Yt = wi([bi], Yt);
525
525
  function H(t, e, i) {
526
526
  return (e = Gn(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
527
527
  }
@@ -850,10 +850,10 @@ class er {
850
850
  }
851
851
  this.push(n);
852
852
  }), ae(this, "adUnit", async (n) => {
853
- var g, v, w, y;
853
+ var g, v, A, y;
854
854
  if (this.context.track("CallAdUnit", {
855
855
  adFormat: (v = (g = n.adFormat) == null ? void 0 : g.toString()) != null ? v : null,
856
- fullWidthResponsive: (w = n.fullWidthResponsive) != null ? w : null
856
+ fullWidthResponsive: (A = n.fullWidthResponsive) != null ? A : null
857
857
  }), document.querySelector("#jolibox-ads")) {
858
858
  console.warn("Ad unit already set, skipping");
859
859
  return;
@@ -875,8 +875,8 @@ class er {
875
875
  throw new Error("slot is required");
876
876
  const c = typeof s == "object" && Array.isArray(s) ? s.join(", ") : s, h = document.createElement("ins");
877
877
  if (h.className = "adsbygoogle", h.id = "jolibox-ads", h.style.display = "block", h.setAttribute("data-ad-client", this.initParams.clientId), h.setAttribute("data-ad-slot", u), c && h.setAttribute("data-ad-format", c), a && h.setAttribute("data-full-width-responsive", a), d && h.setAttribute("style", d), (y = this.contextInfo.testAdsMode) != null ? y : !1) {
878
- const A = document.createElement("div");
879
- A.style.position = "absolute", A.style.top = "0", A.style.left = "0", A.style.width = "100%", A.style.height = "100%", A.style.display = "flex", A.style.justifyContent = "center", A.style.alignItems = "center", A.style.backgroundColor = "rgba(0, 0, 0, 0.5)", A.style.color = "white", A.innerHTML = "Test Ad", h.style.position = "relative", l.appendChild(h), h.appendChild(A);
878
+ const w = document.createElement("div");
879
+ w.style.position = "absolute", w.style.top = "0", w.style.left = "0", w.style.width = "100%", w.style.height = "100%", w.style.display = "flex", w.style.justifyContent = "center", w.style.alignItems = "center", w.style.backgroundColor = "rgba(0, 0, 0, 0.5)", w.style.color = "white", w.innerHTML = "Test Ad", h.style.position = "relative", l.appendChild(h), h.appendChild(w);
880
880
  } else
881
881
  l.appendChild(h), new MutationObserver((S) => {
882
882
  S.forEach((b) => {
@@ -1085,21 +1085,21 @@ function gr(t) {
1085
1085
  Z();
1086
1086
  return Ve(t, X);
1087
1087
  }
1088
- function wr(t) {
1088
+ function Ar(t) {
1089
1089
  return Ti(Ze("", null, null, null, [""], t = Ri(t), 0, [0], t));
1090
1090
  }
1091
1091
  function Ze(t, e, i, n, r, o, s, a, d) {
1092
- for (var l = 0, u = 0, c = s, h = 0, f = 0, g = 0, v = 1, w = 1, y = 1, A = 0, S = "", b = r, m = o, E = n, p = S; w; )
1093
- switch (g = A, A = Z()) {
1092
+ for (var l = 0, u = 0, c = s, h = 0, f = 0, g = 0, v = 1, A = 1, y = 1, w = 0, S = "", b = r, m = o, E = n, p = S; A; )
1093
+ switch (g = w, w = Z()) {
1094
1094
  case 40:
1095
1095
  if (g != 108 && U(p, c - 1) == 58) {
1096
- It(p += R(Qe(A), "&", "&\f"), "&\f") != -1 && (y = -1);
1096
+ It(p += R(Qe(w), "&", "&\f"), "&\f") != -1 && (y = -1);
1097
1097
  break;
1098
1098
  }
1099
1099
  case 34:
1100
1100
  case 39:
1101
1101
  case 91:
1102
- p += Qe(A);
1102
+ p += Qe(w);
1103
1103
  break;
1104
1104
  case 9:
1105
1105
  case 10:
@@ -1114,7 +1114,7 @@ function Ze(t, e, i, n, r, o, s, a, d) {
1114
1114
  switch (oe()) {
1115
1115
  case 42:
1116
1116
  case 47:
1117
- He(Ar(yr(Z(), Ye()), e, i), d);
1117
+ He(wr(yr(Z(), Ye()), e, i), d);
1118
1118
  break;
1119
1119
  default:
1120
1120
  p += "/";
@@ -1125,17 +1125,17 @@ function Ze(t, e, i, n, r, o, s, a, d) {
1125
1125
  case 125 * v:
1126
1126
  case 59:
1127
1127
  case 0:
1128
- switch (A) {
1128
+ switch (w) {
1129
1129
  case 0:
1130
1130
  case 125:
1131
- w = 0;
1131
+ A = 0;
1132
1132
  case 59 + u:
1133
1133
  y == -1 && (p = R(p, /\f/g, "")), f > 0 && re(p) - c && He(f > 32 ? Zt(p + ";", n, i, c - 1) : Zt(R(p, " ", "") + ";", n, i, c - 2), d);
1134
1134
  break;
1135
1135
  case 59:
1136
1136
  p += ";";
1137
1137
  default:
1138
- if (He(E = Qt(p, e, i, l, u, r, a, S, b = [], m = [], c), o), A === 123)
1138
+ if (He(E = Qt(p, e, i, l, u, r, a, S, b = [], m = [], c), o), w === 123)
1139
1139
  if (u === 0)
1140
1140
  Ze(p, e, E, E, b, o, c, a, m);
1141
1141
  else
@@ -1156,12 +1156,12 @@ function Ze(t, e, i, n, r, o, s, a, d) {
1156
1156
  c = 1 + re(p), f = g;
1157
1157
  default:
1158
1158
  if (v < 1) {
1159
- if (A == 123)
1159
+ if (w == 123)
1160
1160
  --v;
1161
- else if (A == 125 && v++ == 0 && hr() == 125)
1161
+ else if (w == 125 && v++ == 0 && hr() == 125)
1162
1162
  continue;
1163
1163
  }
1164
- switch (p += dt(A), A * v) {
1164
+ switch (p += dt(w), w * v) {
1165
1165
  case 38:
1166
1166
  y = u > 0 ? 1 : (p += "\f", -1);
1167
1167
  break;
@@ -1169,7 +1169,7 @@ function Ze(t, e, i, n, r, o, s, a, d) {
1169
1169
  a[l++] = (re(p) - 1) * y, y = 1;
1170
1170
  break;
1171
1171
  case 64:
1172
- oe() === 45 && (p += Qe(Z())), h = oe(), u = c = re(S = p += gr(Ye())), A++;
1172
+ oe() === 45 && (p += Qe(Z())), h = oe(), u = c = re(S = p += gr(Ye())), w++;
1173
1173
  break;
1174
1174
  case 45:
1175
1175
  g === 45 && re(p) == 2 && (v = 0);
@@ -1178,12 +1178,12 @@ function Ze(t, e, i, n, r, o, s, a, d) {
1178
1178
  return o;
1179
1179
  }
1180
1180
  function Qt(t, e, i, n, r, o, s, a, d, l, u) {
1181
- for (var c = r - 1, h = r === 0 ? o : [""], f = Lt(h), g = 0, v = 0, w = 0; g < n; ++g)
1182
- for (var y = 0, A = Fe(t, c + 1, c = sr(v = s[g])), S = t; y < f; ++y)
1183
- (S = Ii(v > 0 ? h[y] + " " + A : R(A, /&\f/g, h[y]))) && (d[w++] = S);
1181
+ for (var c = r - 1, h = r === 0 ? o : [""], f = Lt(h), g = 0, v = 0, A = 0; g < n; ++g)
1182
+ for (var y = 0, w = Fe(t, c + 1, c = sr(v = s[g])), S = t; y < f; ++y)
1183
+ (S = Ii(v > 0 ? h[y] + " " + w : R(w, /&\f/g, h[y]))) && (d[A++] = S);
1184
1184
  return ut(t, e, i, r === 0 ? Pt : a, d, l, u);
1185
1185
  }
1186
- function Ar(t, e, i) {
1186
+ function wr(t, e, i) {
1187
1187
  return ut(t, e, i, Ei, dt(cr()), Fe(t, 2, -2), 0);
1188
1188
  }
1189
1189
  function Zt(t, e, i, n) {
@@ -1428,8 +1428,8 @@ var Rr = function(e, i, n, r) {
1428
1428
  if (i === "css") {
1429
1429
  var n = document.querySelectorAll("style[data-emotion]:not([data-s])");
1430
1430
  Array.prototype.forEach.call(n, function(v) {
1431
- var w = v.getAttribute("data-emotion");
1432
- w.indexOf(" ") !== -1 && (document.head.appendChild(v), v.setAttribute("data-s", ""));
1431
+ var A = v.getAttribute("data-emotion");
1432
+ A.indexOf(" ") !== -1 && (document.head.appendChild(v), v.setAttribute("data-s", ""));
1433
1433
  });
1434
1434
  }
1435
1435
  var r = e.stylisPlugins || Tr, o = {}, s, a = [];
@@ -1438,8 +1438,8 @@ var Rr = function(e, i, n, r) {
1438
1438
  // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
1439
1439
  document.querySelectorAll('style[data-emotion^="' + i + ' "]'),
1440
1440
  function(v) {
1441
- for (var w = v.getAttribute("data-emotion").split(" "), y = 1; y < w.length; y++)
1442
- o[w[y]] = !0;
1441
+ for (var A = v.getAttribute("data-emotion").split(" "), y = 1; y < A.length; y++)
1442
+ o[A[y]] = !0;
1443
1443
  a.push(v);
1444
1444
  }
1445
1445
  );
@@ -1447,11 +1447,11 @@ var Rr = function(e, i, n, r) {
1447
1447
  {
1448
1448
  var u, c = [br, _r(function(v) {
1449
1449
  u.insert(v);
1450
- })], h = pr(l.concat(r, c)), f = function(w) {
1451
- return Ie(wr(w), h);
1450
+ })], h = pr(l.concat(r, c)), f = function(A) {
1451
+ return Ie(Ar(A), h);
1452
1452
  };
1453
- d = function(w, y, A, S) {
1454
- u = A, f(w ? w + "{" + y.styles + "}" : y.styles), S && (g.inserted[y.name] = !0);
1453
+ d = function(A, y, w, S) {
1454
+ u = w, f(A ? A + "{" + y.styles + "}" : y.styles), S && (g.inserted[y.name] = !0);
1455
1455
  };
1456
1456
  }
1457
1457
  var g = {
@@ -1761,7 +1761,7 @@ var Ur = function(e) {
1761
1761
  return i;
1762
1762
  }, Fr = Ur({
1763
1763
  key: "css"
1764
- }), G = Fr.css, Rt, Q, wt, si, ai = 0, Pi = [], B = xe, di = B.__b, li = B.__r, ui = B.diffed, ci = B.__c, hi = B.unmount, fi = B.__;
1764
+ }), G = Fr.css, Rt, Q, At, si, ai = 0, Pi = [], B = xe, di = B.__b, li = B.__r, ui = B.diffed, ci = B.__c, hi = B.unmount, fi = B.__;
1765
1765
  function jr(t, e) {
1766
1766
  B.__h && B.__h(Q, t, ai || e), ai = 0;
1767
1767
  var i = Q.__H || (Q.__H = { __: [], __h: [] });
@@ -1787,15 +1787,15 @@ B.__b = function(t) {
1787
1787
  }, B.__r = function(t) {
1788
1788
  li && li(t), Rt = 0;
1789
1789
  var e = (Q = t.__c).__H;
1790
- e && (wt === Q ? (e.__h = [], Q.__h = [], e.__.forEach(function(i) {
1790
+ e && (At === Q ? (e.__h = [], Q.__h = [], e.__.forEach(function(i) {
1791
1791
  i.__N && (i.__ = i.__N), i.u = i.__N = void 0;
1792
- })) : (e.__h.forEach(et), e.__h.forEach(Tt), e.__h = [], Rt = 0)), wt = Q;
1792
+ })) : (e.__h.forEach(et), e.__h.forEach(Tt), e.__h = [], Rt = 0)), At = Q;
1793
1793
  }, B.diffed = function(t) {
1794
1794
  ui && ui(t);
1795
1795
  var e = t.__c;
1796
1796
  e && e.__H && (e.__H.__h.length && (Pi.push(e) !== 1 && si === B.requestAnimationFrame || ((si = B.requestAnimationFrame) || Gr)(Vr)), e.__H.__.forEach(function(i) {
1797
1797
  i.u && (i.__H = i.u), i.u = void 0;
1798
- })), wt = Q = null;
1798
+ })), At = Q = null;
1799
1799
  }, B.__c = function(t, e) {
1800
1800
  e.some(function(i) {
1801
1801
  try {
@@ -2082,7 +2082,7 @@ function qe(t) {
2082
2082
  }
2083
2083
  return e.d.bind(e);
2084
2084
  }
2085
- var Fi, At, ji = [];
2085
+ var Fi, wt, ji = [];
2086
2086
  qe(function() {
2087
2087
  Fi = this.N;
2088
2088
  })();
@@ -2091,7 +2091,7 @@ function De(t, e) {
2091
2091
  });
2092
2092
  }
2093
2093
  function at(t) {
2094
- At && At(), At = t && t.S();
2094
+ wt && wt(), wt = t && t.S();
2095
2095
  }
2096
2096
  function Vi(t) {
2097
2097
  var e = this, i = t.data, n = Gi(i);
@@ -2568,12 +2568,12 @@ const Qr = G`
2568
2568
  countdown: d,
2569
2569
  src: l,
2570
2570
  mode: u
2571
- } = e, c = dn(() => ro(), []), [h, f] = Ae(!1), g = (w) => {
2572
- var y, A, S, b;
2573
- a.value = !1, w === "dismiss" ? (y = n.value) == null || y.call(n) : w === "viewed" && ((A = r.value) == null || A.call(r)), (S = i.value) == null || S.call(i), (b = o.value) == null || b.call(o), f(!1);
2571
+ } = e, c = dn(() => ro(), []), [h, f] = we(!1), g = (A) => {
2572
+ var y, w, S, b;
2573
+ a.value = !1, A === "dismiss" ? (y = n.value) == null || y.call(n) : A === "viewed" && ((w = r.value) == null || w.call(r)), (S = i.value) == null || S.call(i), (b = o.value) == null || b.call(o), f(!1);
2574
2574
  }, v = _t(() => {
2575
- var w;
2576
- h || (f(!0), (w = s.value) == null || w.call(s));
2575
+ var A;
2576
+ h || (f(!0), (A = s.value) == null || A.call(s));
2577
2577
  }, [h]);
2578
2578
  return Re(() => {
2579
2579
  h && (u.value === "reward" || u.value === "rewarded_insterstitial") && setTimeout(() => {
@@ -2713,7 +2713,7 @@ class uo {
2713
2713
  P(() => {
2714
2714
  this.state.afterAd.value = c, this.state.adDismissed.value = f, this.state.adViewed.value = g, this.state.adBreakDone.value = v;
2715
2715
  });
2716
- const w = () => {
2716
+ const A = () => {
2717
2717
  var y;
2718
2718
  if (this.lastUnDisplayedAdBreak = null, !this.adsOverlay) {
2719
2719
  (y = e.adBreakDone) == null || y.call(e, {
@@ -2725,11 +2725,11 @@ class uo {
2725
2725
  return;
2726
2726
  }
2727
2727
  this.adsIsShowing = !0, P(() => {
2728
- var A;
2729
- this.state.countdown.value = (A = i.params.countdown) != null ? A : 15, this.state.src.value = i.params.url, this.state.mode.value = "reward", this.state.visible.value = !0;
2728
+ var w;
2729
+ this.state.countdown.value = (w = i.params.countdown) != null ? w : 15, this.state.src.value = i.params.url, this.state.mode.value = "reward", this.state.visible.value = !0;
2730
2730
  });
2731
2731
  };
2732
- this.lastUnDisplayedAdBreak = e, (u = e.beforeReward) == null || u.call(e, w);
2732
+ this.lastUnDisplayedAdBreak = e, (u = e.beforeReward) == null || u.call(e, A);
2733
2733
  break;
2734
2734
  }
2735
2735
  }
@@ -2781,7 +2781,7 @@ const co = () => {
2781
2781
  `, go = G`
2782
2782
  font-size: 14px;
2783
2783
  font-weight: 500;
2784
- `, wo = G`
2784
+ `, Ao = G`
2785
2785
  ${M}
2786
2786
  flex: 1;
2787
2787
  background: #050505;
@@ -2798,7 +2798,7 @@ const co = () => {
2798
2798
  justify-content: center;
2799
2799
  color: #6e7da1;
2800
2800
  font-size: 14px;
2801
- `, Ao = G`
2801
+ `, wo = G`
2802
2802
  position: absolute;
2803
2803
  bottom: 32px;
2804
2804
  right: 32px;
@@ -2843,7 +2843,7 @@ const co = () => {
2843
2843
  adError: a,
2844
2844
  visible: d,
2845
2845
  payload: l
2846
- } = e, [u, c] = Ae(!1), [h, f] = Ae(0), [g, v] = Ae(!1), [w, y] = Ae(!1), [A, S] = Ae("Loading next content..."), b = gi(null), m = l.value, E = _t((L) => {
2846
+ } = e, [u, c] = we(!1), [h, f] = we(0), [g, v] = we(!1), [A, y] = we(!1), [w, S] = we("Loading next content..."), b = gi(null), m = l.value, E = _t((L) => {
2847
2847
  var C, W, q, I;
2848
2848
  c(!1), d.value = !1, L === "dismiss" ? (C = n.value) == null || C.call(n) : (W = r.value) == null || W.call(r), (q = i.value) == null || q.call(i), (I = o.value) == null || I.call(o);
2849
2849
  }, [d, n, r, i, o]), p = _t(() => {
@@ -2919,20 +2919,20 @@ const co = () => {
2919
2919
  children: be
2920
2920
  })]
2921
2921
  }), _("div", {
2922
- className: wo,
2922
+ className: Ao,
2923
2923
  ref: b,
2924
2924
  children: !u && _("div", {
2925
2925
  className: yi,
2926
- children: A
2926
+ children: w
2927
2927
  })
2928
2928
  }), _("div", {
2929
- className: Ao,
2929
+ className: wo,
2930
2930
  children: m.mode === "reward" ? _("button", {
2931
2931
  className: bo,
2932
2932
  type: "button",
2933
2933
  onClick: () => E("viewed"),
2934
- disabled: !w,
2935
- children: w ? "Continue" : `Continue in ${h}s`
2934
+ disabled: !A,
2935
+ children: A ? "Continue" : `Continue in ${h}s`
2936
2936
  }) : g && _("button", {
2937
2937
  className: po,
2938
2938
  type: "button",
@@ -3091,18 +3091,18 @@ class Eo {
3091
3091
  breakName: e.name,
3092
3092
  breakFormat: "interstitial",
3093
3093
  breakStatus: "viewed"
3094
- }, w = () => {
3094
+ }, A = () => {
3095
3095
  var S;
3096
3096
  this.adsIsShowing = !1, (S = e.afterAd) == null || S.call(e);
3097
3097
  }, y = () => {
3098
3098
  var S;
3099
3099
  this.adsIsShowing = !1, (S = e.adBreakDone) == null || S.call(e, v);
3100
- }, A = () => {
3100
+ }, w = () => {
3101
3101
  var S, b;
3102
3102
  this.adsIsShowing = !1, v.breakStatus = "noAdPreloaded", (S = e.afterAd) == null || S.call(e), (b = e.adBreakDone) == null || b.call(e, v);
3103
3103
  };
3104
3104
  P(() => {
3105
- this.adsIsShowing = !0, this.state.afterAd.value = w, this.state.adBreakDone.value = y, this.state.adDismissed.value = null, this.state.adViewed.value = null, this.state.adError.value = A, this.showBannerOverlay("interstitial", o);
3105
+ this.adsIsShowing = !0, this.state.afterAd.value = A, this.state.adBreakDone.value = y, this.state.adDismissed.value = null, this.state.adViewed.value = null, this.state.adError.value = w, this.showBannerOverlay("interstitial", o);
3106
3106
  });
3107
3107
  break;
3108
3108
  }
@@ -3118,13 +3118,13 @@ class Eo {
3118
3118
  breakName: e.name,
3119
3119
  breakFormat: "reward",
3120
3120
  breakStatus: "ignored"
3121
- }, w = () => {
3121
+ }, A = () => {
3122
3122
  var E;
3123
3123
  this.adsIsShowing = !1, (E = e.afterAd) == null || E.call(e);
3124
3124
  }, y = () => {
3125
3125
  var E;
3126
3126
  this.adsIsShowing = !1, v.breakStatus = "dismissed", (E = e.adDismissed) == null || E.call(e);
3127
- }, A = () => {
3127
+ }, w = () => {
3128
3128
  var E;
3129
3129
  this.adsIsShowing = !1, v.breakStatus = "viewed", (E = e.adViewed) == null || E.call(e);
3130
3130
  }, S = () => {
@@ -3135,7 +3135,7 @@ class Eo {
3135
3135
  this.adsIsShowing = !1, v.breakStatus = "noAdPreloaded", (E = e.afterAd) == null || E.call(e), (p = e.adBreakDone) == null || p.call(e, v);
3136
3136
  };
3137
3137
  P(() => {
3138
- this.state.afterAd.value = w, this.state.adDismissed.value = y, this.state.adViewed.value = A, this.state.adBreakDone.value = S, this.state.adError.value = b;
3138
+ this.state.afterAd.value = A, this.state.adDismissed.value = y, this.state.adViewed.value = w, this.state.adBreakDone.value = S, this.state.adError.value = b;
3139
3139
  });
3140
3140
  const m = () => {
3141
3141
  var E, p;
@@ -3213,9 +3213,9 @@ const _e = (t, e) => {
3213
3213
  adLinkClicked: a,
3214
3214
  visible: d,
3215
3215
  src: l
3216
- } = e, [u, c] = Ae(!1), h = (g) => {
3217
- var v, w, y, A;
3218
- c(!1), d.value = !1, g === "dismiss" ? (v = n.value) == null || v.call(n) : g === "viewed" && ((w = r.value) == null || w.call(r)), (y = i.value) == null || y.call(i), (A = o.value) == null || A.call(o);
3216
+ } = e, [u, c] = we(!1), h = (g) => {
3217
+ var v, A, y, w;
3218
+ c(!1), d.value = !1, g === "dismiss" ? (v = n.value) == null || v.call(n) : g === "viewed" && ((A = r.value) == null || A.call(r)), (y = i.value) == null || y.call(i), (w = o.value) == null || w.call(o);
3219
3219
  }, f = () => {
3220
3220
  var g;
3221
3221
  (g = s.value) == null || g.call(s);
@@ -3321,19 +3321,19 @@ class Ro {
3321
3321
  case "pause": {
3322
3322
  (d = e.beforeAd) == null || d.call(e);
3323
3323
  const f = () => {
3324
- var w;
3325
- this.adsIsShowing = !1, (w = e.afterAd) == null || w.call(e);
3324
+ var A;
3325
+ this.adsIsShowing = !1, (A = e.afterAd) == null || A.call(e);
3326
3326
  }, g = () => {
3327
- var w;
3328
- this.adsIsShowing = !1, (w = e.adBreakDone) == null || w.call(e, {
3327
+ var A;
3328
+ this.adsIsShowing = !1, (A = e.adBreakDone) == null || A.call(e, {
3329
3329
  breakType: e.type,
3330
3330
  breakName: e.name,
3331
3331
  breakFormat: "interstitial",
3332
3332
  breakStatus: "viewed"
3333
3333
  });
3334
3334
  }, v = () => {
3335
- var w;
3336
- this.adsIsShowing = !1, (w = e.adBreakDone) == null || w.call(e, {
3335
+ var A;
3336
+ this.adsIsShowing = !1, (A = e.adBreakDone) == null || A.call(e, {
3337
3337
  breakType: e.type,
3338
3338
  breakName: e.name,
3339
3339
  breakFormat: "interstitial",
@@ -3363,17 +3363,17 @@ class Ro {
3363
3363
  }, v = () => {
3364
3364
  var b;
3365
3365
  this.adsIsShowing = !1, g.breakStatus = "dismissed", (b = e.adDismissed) == null || b.call(e);
3366
- }, w = () => {
3366
+ }, A = () => {
3367
3367
  var b;
3368
3368
  this.adsIsShowing = !1, g.breakStatus = "viewed", (b = e.adViewed) == null || b.call(e);
3369
3369
  }, y = () => {
3370
3370
  var b;
3371
3371
  this.adsIsShowing = !1, (b = e.adBreakDone) == null || b.call(e, g);
3372
- }, A = () => {
3372
+ }, w = () => {
3373
3373
  this.adsIsShowing = !1, g.breakStatus = "noAdPreloaded";
3374
3374
  };
3375
3375
  P(() => {
3376
- this.state.afterAd.value = f, this.state.adDismissed.value = v, this.state.adViewed.value = w, this.state.adBreakDone.value = y, this.state.adLinkClicked.value = n, this.state.adError.value = A;
3376
+ this.state.afterAd.value = f, this.state.adDismissed.value = v, this.state.adViewed.value = A, this.state.adBreakDone.value = y, this.state.adLinkClicked.value = n, this.state.adError.value = w;
3377
3377
  });
3378
3378
  const S = () => {
3379
3379
  var b;
@@ -3550,7 +3550,7 @@ class Po {
3550
3550
  });
3551
3551
  }
3552
3552
  }
3553
- function we(t, e, i) {
3553
+ function Ae(t, e, i) {
3554
3554
  return (e = No(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
3555
3555
  }
3556
3556
  function No(t) {
@@ -3571,7 +3571,7 @@ function Lo(t, e) {
3571
3571
  }
3572
3572
  class Bo {
3573
3573
  constructor(e, i) {
3574
- we(this, "name", "GOOGLE_GPT"), we(this, "context", void 0), we(this, "contextInfo", void 0), we(this, "initParams", void 0), we(this, "rewardAdManager", void 0), we(this, "interstitialManager", void 0), we(this, "insertScript", () => {
3574
+ Ae(this, "name", "GOOGLE_GPT"), Ae(this, "context", void 0), Ae(this, "contextInfo", void 0), Ae(this, "initParams", void 0), Ae(this, "rewardAdManager", void 0), Ae(this, "interstitialManager", void 0), Ae(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));
@@ -3994,9 +3994,9 @@ class Ho {
3994
3994
  }
3995
3995
  constructor(e, i) {
3996
3996
  ue(this, "providers", void 0), ue(this, "helper", void 0), ue(this, "adsContext", null), ue(this, "_isAdsReady", !1), ue(this, "init", async () => {
3997
- this.helper.canIUse() && ((await this.helper.loadAdsAsync({
3997
+ this.helper.canIUse() ? (await this.helper.loadAdsAsync({
3998
3998
  providers: this.providers
3999
- })).code === "SUCCESS" ? this._isAdsReady = !0 : this._isAdsReady = !1);
3999
+ })).code === "SUCCESS" ? this._isAdsReady = !0 : this._isAdsReady = !1 : this._isAdsReady = !1;
4000
4000
  }), ue(this, "destroy", (n) => {
4001
4001
  var r, o;
4002
4002
  this._isAdsReady = !1, (o = (r = this.adsContext) == null ? void 0 : r.adBreakDone) == null || o.call(r, n), n !== "ignored" && (this.adsContext = null);
@@ -4328,7 +4328,7 @@ class Ms {
4328
4328
  this.providers.ADSENSE ? this.providers.ADSENSE.adConfig(e) : window.adsbygoogle.push(e);
4329
4329
  }
4330
4330
  async adBreak(e) {
4331
- var r, o, s, a, d, l, u, c, h, f, g, v, w, y, A, S;
4331
+ var r, o, s, a, d, l, u, c, h, f, g, v, A, y, w, S;
4332
4332
  const i = Date.now();
4333
4333
  if (i - this.initializedTimeStamp < 3e3) {
4334
4334
  (r = e.adBreakDone) == null || r.call(e, {
@@ -4433,7 +4433,7 @@ class Ms {
4433
4433
  const be = new Kn(this.context);
4434
4434
  this.adsActionDetection.adBreakIsShowing = !0;
4435
4435
  const L = m.filter((I) => I.isNative).sort((I, Y) => I.seq - Y.seq), C = m.filter((I) => !I.isNative).sort((I, Y) => I.seq - Y.seq), W = {
4436
- seq: (w = (v = L[0]) == null ? void 0 : v.seq) != null ? w : 0,
4436
+ seq: (A = (v = L[0]) == null ? void 0 : v.seq) != null ? A : 0,
4437
4437
  provider: "INTERNAL_NATIVE",
4438
4438
  params: L
4439
4439
  };
@@ -4462,7 +4462,7 @@ class Ms {
4462
4462
  p && se && ((y = e.adBreakDone) == null || y.call(e, se));
4463
4463
  }
4464
4464
  } catch (b) {
4465
- (A = e.adBreakDone) == null || A.call(e, {
4465
+ (w = e.adBreakDone) == null || w.call(e, {
4466
4466
  breakType: e.type,
4467
4467
  breakFormat: e.type === "reward" ? "reward" : "interstitial",
4468
4468
  breakStatus: "noAdPreloaded"
@@ -4877,13 +4877,13 @@ class gs {
4877
4877
  }
4878
4878
  }
4879
4879
  function ne(t, e, i) {
4880
- return (e = ws(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
4880
+ return (e = As(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
4881
4881
  }
4882
- function ws(t) {
4883
- var e = As(t, "string");
4882
+ function As(t) {
4883
+ var e = ws(t, "string");
4884
4884
  return typeof e == "symbol" ? e : e + "";
4885
4885
  }
4886
- function As(t, e) {
4886
+ function ws(t, e) {
4887
4887
  if (typeof t != "object" || !t)
4888
4888
  return t;
4889
4889
  var i = t[Symbol.toPrimitive];
@@ -5153,28 +5153,28 @@ class Us {
5153
5153
  return;
5154
5154
  }
5155
5155
  if (v) {
5156
- const w = v == null ? void 0 : v.sort((b, m) => b.seq - m.seq);
5157
- if (w.length === 0) {
5156
+ const A = v == null ? void 0 : v.sort((b, m) => b.seq - m.seq);
5157
+ if (A.length === 0) {
5158
5158
  const b = $.from(new Error("No ads available"), "JOLIBOX_IMA_ERROR");
5159
5159
  (l = e.onAdError) == null || l.call(e, b);
5160
5160
  return;
5161
5161
  }
5162
- let y = !0, A = null;
5162
+ let y = !0, w = null;
5163
5163
  const S = new os(this.context);
5164
- for (; w.length > 0; ) {
5165
- const b = w.shift(), m = this.providers[b.provider];
5164
+ for (; A.length > 0; ) {
5165
+ const b = A.shift(), m = this.providers[b.provider];
5166
5166
  if (m) {
5167
5167
  const [E, p] = await S.callAdRequestAndContinue(m, e, b);
5168
- y = E, A = p;
5168
+ y = E, w = p;
5169
5169
  } else
5170
- y = !0, A = $.from(new Error("No provider available"), "JOLIBOX_IMA_ERROR");
5170
+ y = !0, w = $.from(new Error("No provider available"), "JOLIBOX_IMA_ERROR");
5171
5171
  if (!y)
5172
5172
  break;
5173
5173
  }
5174
- y && A && ((u = e.onAdError) == null || u.call(e, A));
5174
+ y && w && ((u = e.onAdError) == null || u.call(e, w));
5175
5175
  } else {
5176
- const w = $.from(new Error("Unknown error"), "JOLIBOX_IMA_ERROR");
5177
- (d = e.onAdError) == null || d.call(e, w);
5176
+ const A = $.from(new Error("Unknown error"), "JOLIBOX_IMA_ERROR");
5177
+ (d = e.onAdError) == null || d.call(e, A);
5178
5178
  return;
5179
5179
  }
5180
5180
  } catch (f) {
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.1",
4
+ "version": "1.4.3",
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.1",
15
+ "@jolibox/common": "1.4.3",
16
16
  "@emotion/css": "11.13.5",
17
- "@jolibox/types": "1.4.1",
17
+ "@jolibox/types": "1.4.3",
18
18
  "preact": "10.26.4",
19
19
  "@preact/signals": "2.0.4",
20
- "@jolibox/native-bridge": "1.4.1"
20
+ "@jolibox/native-bridge": "1.4.3"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@babel/core": "7.23.3",