(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.id="inside-ad",t.appendChild(document.createTextNode("#streann-node{position:fixed;right:0;bottom:0;width:auto}#page-content{position:relative;width:426px}#page-content-split-ad{position:relative!important;width:100vh!important}#video-container{position:relative;padding-bottom:56.25%}#video-element{position:absolute;top:0;left:0;width:100%;height:100%}#streann-adhesion{position:fixed;width:100%;left:0;top:0;background:#0006;height:100px;z-index:10000;padding-top:15px;padding-bottom:15px}.adhesion-container{width:100%;margin:0 auto;text-align:center;opacity:1!important;z-index:11111}#adhesion{margin:0 auto;text-align:center}.close-btn-container{position:fixed;right:10px;opacity:1!important;top:10px;height:30px;width:30px;border-radius:100%;background-color:#fff;display:flex;justify-content:center}.closeButton{position:absolute;background-color:#00000080;padding:5px 13px;top:0;right:0;z-index:1;cursor:pointer;border-radius:4px;display:none}#streann-logo{position:absolute;top:0;left:0;z-index:1;cursor:pointer}.logo{width:30px;height:30px}#un-mute,#mute{position:absolute;bottom:0;left:0;padding:5px 13px;z-index:1;cursor:pointer}.split-ad-close-btn{position:absolute;right:1px;top:90%;transform:translateY(-50%);background-color:transparent;color:#fff;padding:10px 20px;border:2px solid white;cursor:pointer;border-radius:5px;font-size:16px}.split-ad-unmute-btn{display:block;position:absolute;top:10px;right:10px;background-color:transparent;border:none;border-radius:50%;width:40px;height:40px;cursor:pointer;padding:8px;z-index:1000}#video-container-split-ad{position:relative!important;padding-bottom:56.25%}")),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
var Ue = Object.defineProperty;
var Ve = (n, e, t) => e in n ? Ue(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
var c = (n, e, t) => (Ve(n, typeof e != "symbol" ? e + "" : e, t), t);
var D = /* @__PURE__ */ ((n) => (n.CORNER = "CORNER", n.EMBED = "EMBED", n.ADHESION = "ADHESION", n.EMBED_FLOAT = "EMBED_FLOAT", n.SPLIT_AD = "SPLIT_AD", n))(D || {}), N = /* @__PURE__ */ ((n) => (n.VAST = "VAST", n.BANNER = "BANNER", n.LOCAL_VIDEO = "LOCAL_VIDEO", n.LOCAL_IMAGE = "LOCAL_IMAGE", n))(N || {}), Ae = /* @__PURE__ */ ((n) => (n[n.SUNDAY = 0] = "SUNDAY", n[n.MONDAY = 1] = "MONDAY", n[n.TUESDAY = 2] = "TUESDAY", n[n.WEDNESDAY = 3] = "WEDNESDAY", n[n.THURSDAY = 4] = "THURSDAY", n[n.FRIDAY = 5] = "FRIDAY", n[n.SATURDAY = 6] = "SATURDAY", n))(Ae || {});
const T = {
  apiKey: "",
  apiToken: "",
  baseUrl: "",
  isAlreadyInit: !1
};
async function He() {
  const n = await Fe();
  localStorage.setItem("streannCountryId", n.countryCode);
  const e = await fetch(
    `${T.baseUrl}v1/r/${T.apiKey}/campaigns/WEB?country=${n.countryCode}`,
    {
      method: "GET",
      headers: new Headers({
        Authorization: `ApiToken ${T.apiToken}`
      })
    }
  );
  return e.status != 200, e.json();
}
async function Fe() {
  return await (await fetch("https://geoip.streann.tech/")).json();
}
function xe() {
  return Object.values(Ae)[(/* @__PURE__ */ new Date()).getDay()];
}
function ue(n) {
  let e = n.reduce((o, a) => o + a.weight, 0), t = Math.floor(Math.random() * e) + 1, r = 0, i = null;
  for (let o of n)
    if (r += o.weight, t <= r) {
      i = o;
      break;
    }
  return i || n[0];
}
function ge(n) {
  return new Promise((e, t) => {
    const r = document.createElement("script");
    r.async = !0, r.src = n, r.onload = e, r.onerror = t, document.body.appendChild(r);
  });
}
function ze(n) {
  const e = Date.now(), t = new Date(n.startDate), r = new Date(n.endDate);
  return t.getTime() <= e && r.getTime() >= e;
}
function je(n) {
  if (!n.timePeriods)
    return !0;
  const e = xe(), t = /* @__PURE__ */ new Date();
  return n.timePeriods.every((i) => {
    const [o, a, s] = i.startTime.split(":").map(Number), l = /* @__PURE__ */ new Date();
    l.setHours(o), l.setMinutes(a), l.setSeconds(s);
    const [E, A, m] = i.endTime.split(":").map(Number), h = /* @__PURE__ */ new Date();
    return h.setHours(E), h.setMinutes(A), h.setSeconds(m), i.daysOfWeek.includes(e) && l <= t && h >= t;
  });
}
function Ye(n) {
  const e = location.host.replace(/^www\./, ""), t = n.replace(/^https?:\/\//, "").replace(/^www\./, "");
  return e === t;
}
function Se(n) {
  if (n.domain) {
    if (n.domain.includes(location.host) || Ye(n.domain)) {
      if (n.absolutePath && n.absolutePath.length > 0)
        return !!n.absolutePath.some((e) => e === location.pathname);
      if (n.tags && n.tags.length)
        return n.tags.some((e) => location.pathname.includes(e));
    }
    return !1;
  } else {
    if (n.absolutePath && n.absolutePath.length > 0)
      return !!n.absolutePath.some((e) => e === location.pathname);
    if (n.tags && n.tags.length)
      return n.tags.some((e) => location.pathname.includes(e));
  }
  return !0;
}
function Ge(n) {
  const e = n.placements.filter(Se).filter(ve);
  return !(!e || e.length == 0);
}
function ve(n) {
  var i, o;
  const e = (o = (i = n.properties) == null ? void 0 : i.webSettings) == null ? void 0 : o.screens;
  let t = "";
  const r = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
  return r <= 425 ? t = "MOBILE" : r <= 768 ? t = "TABLET" : t = "DESKTOP", e ? e.includes(t) : !0;
}
function qe(n) {
  const e = n.filter(ze).filter(je);
  let t;
  if (e.length > 1 ? t = ue(e.filter(Ge)) : t = e[0], !t || !t.placements)
    return { campaign: void 0, filteredPlacements: [] };
  const r = t.placements.filter(Se).filter(ve);
  r.length == 0;
  const i = r.map(
    (o) => o.ads.length > 1 ? { ...o, ad: ue(o.ads) } : { ...o, ad: o.ads[0] }
  );
  return { campaign: t, filteredPlacements: i };
}
class Ke {
  constructor(e, t) {
    c(this, "campaing");
    c(this, "refresh");
    c(this, "refreshTimeout");
    this.campaing = e, this.refresh = t;
  }
  insideAdReceived(e) {
  }
  insideAdLoaded() {
  }
  insideAdPlay() {
  }
  insideAdStop() {
    const e = this.campaing.properties.intervalInMinutes || 1;
    !e || e <= 0 || (this.clearRefreshTimeout(), this.refreshTimeout = setTimeout(() => {
      this.refresh();
    }, e * 6e4));
  }
  insideAdSkipped() {
  }
  insideAdClicked() {
  }
  insideAdError(e) {
  }
  insideAdVolumeChanged(e) {
  }
  clearRefreshTimeout() {
    clearTimeout(this.refreshTimeout);
  }
}
const We = "https://imasdk.googleapis.com/js/sdkloader/ima3.js";
let B = null;
const pe = () => {
  B = null;
}, Te = () => {
  const n = window;
  return n.google && n.google.ima ? Promise.resolve(n.google.ima) : B || (B = ge(We).then(() => n.google.ima), B.then(pe).catch(pe), B);
}, Xe = "https://securepubads.g.doubleclick.net/tag/js/gpt.js", $e = () => {
  const n = window;
  return n.googletag && n.googletag.apiReady ? Promise.resolve(n.googletag) : ge(Xe).then(() => n.googletag);
};
var X = function(n, e) {
  return X = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
    t.__proto__ = r;
  } || function(t, r) {
    for (var i in r)
      Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i]);
  }, X(n, e);
};
function x(n, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
  X(n, e);
  function t() {
    this.constructor = n;
  }
  n.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
}
function $(n) {
  var e = typeof Symbol == "function" && Symbol.iterator, t = e && n[e], r = 0;
  if (t)
    return t.call(n);
  if (n && typeof n.length == "number")
    return {
      next: function() {
        return n && r >= n.length && (n = void 0), { value: n && n[r++], done: !n };
      }
    };
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function H(n, e) {
  var t = typeof Symbol == "function" && n[Symbol.iterator];
  if (!t)
    return n;
  var r = t.call(n), i, o = [], a;
  try {
    for (; (e === void 0 || e-- > 0) && !(i = r.next()).done; )
      o.push(i.value);
  } catch (s) {
    a = { error: s };
  } finally {
    try {
      i && !i.done && (t = r.return) && t.call(r);
    } finally {
      if (a)
        throw a.error;
    }
  }
  return o;
}
function F(n, e, t) {
  if (t || arguments.length === 2)
    for (var r = 0, i = e.length, o; r < i; r++)
      (o || !(r in e)) && (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
  return n.concat(o || Array.prototype.slice.call(e));
}
function S(n) {
  return typeof n == "function";
}
function be(n) {
  var e = function(r) {
    Error.call(r), r.stack = new Error().stack;
  }, t = n(e);
  return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
}
var K = be(function(n) {
  return function(t) {
    n(this), this.message = t ? t.length + ` errors occurred during unsubscription:
` + t.map(function(r, i) {
      return i + 1 + ") " + r.toString();
    }).join(`
  `) : "", this.name = "UnsubscriptionError", this.errors = t;
  };
});
function Q(n, e) {
  if (n) {
    var t = n.indexOf(e);
    0 <= t && n.splice(t, 1);
  }
}
var z = function() {
  function n(e) {
    this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
  }
  return n.prototype.unsubscribe = function() {
    var e, t, r, i, o;
    if (!this.closed) {
      this.closed = !0;
      var a = this._parentage;
      if (a)
        if (this._parentage = null, Array.isArray(a))
          try {
            for (var s = $(a), l = s.next(); !l.done; l = s.next()) {
              var E = l.value;
              E.remove(this);
            }
          } catch (y) {
            e = { error: y };
          } finally {
            try {
              l && !l.done && (t = s.return) && t.call(s);
            } finally {
              if (e)
                throw e.error;
            }
          }
        else
          a.remove(this);
      var A = this.initialTeardown;
      if (S(A))
        try {
          A();
        } catch (y) {
          o = y instanceof K ? y.errors : [y];
        }
      var m = this._finalizers;
      if (m) {
        this._finalizers = null;
        try {
          for (var h = $(m), v = h.next(); !v.done; v = h.next()) {
            var _e = v.value;
            try {
              he(_e);
            } catch (y) {
              o = o ?? [], y instanceof K ? o = F(F([], H(o)), H(y.errors)) : o.push(y);
            }
          }
        } catch (y) {
          r = { error: y };
        } finally {
          try {
            v && !v.done && (i = h.return) && i.call(h);
          } finally {
            if (r)
              throw r.error;
          }
        }
      }
      if (o)
        throw new K(o);
    }
  }, n.prototype.add = function(e) {
    var t;
    if (e && e !== this)
      if (this.closed)
        he(e);
      else {
        if (e instanceof n) {
          if (e.closed || e._hasParent(this))
            return;
          e._addParent(this);
        }
        (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e);
      }
  }, n.prototype._hasParent = function(e) {
    var t = this._parentage;
    return t === e || Array.isArray(t) && t.includes(e);
  }, n.prototype._addParent = function(e) {
    var t = this._parentage;
    this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
  }, n.prototype._removeParent = function(e) {
    var t = this._parentage;
    t === e ? this._parentage = null : Array.isArray(t) && Q(t, e);
  }, n.prototype.remove = function(e) {
    var t = this._finalizers;
    t && Q(t, e), e instanceof n && e._removeParent(this);
  }, n.EMPTY = function() {
    var e = new n();
    return e.closed = !0, e;
  }(), n;
}(), Ne = z.EMPTY;
function Re(n) {
  return n instanceof z || n && "closed" in n && S(n.remove) && S(n.add) && S(n.unsubscribe);
}
function he(n) {
  S(n) ? n() : n.unsubscribe();
}
var Ie = {
  onUnhandledError: null,
  onStoppedNotification: null,
  Promise: void 0,
  useDeprecatedSynchronousErrorHandling: !1,
  useDeprecatedNextContext: !1
}, J = {
  setTimeout: function(n, e) {
    for (var t = [], r = 2; r < arguments.length; r++)
      t[r - 2] = arguments[r];
    var i = J.delegate;
    return i != null && i.setTimeout ? i.setTimeout.apply(i, F([n, e], H(t))) : setTimeout.apply(void 0, F([n, e], H(t)));
  },
  clearTimeout: function(n) {
    var e = J.delegate;
    return ((e == null ? void 0 : e.clearTimeout) || clearTimeout)(n);
  },
  delegate: void 0
};
function Qe(n) {
  J.setTimeout(function() {
    throw n;
  });
}
function fe() {
}
function U(n) {
  n();
}
var Ce = function(n) {
  x(e, n);
  function e(t) {
    var r = n.call(this) || this;
    return r.isStopped = !1, t ? (r.destination = t, Re(t) && t.add(r)) : r.destination = tt, r;
  }
  return e.create = function(t, r, i) {
    return new Z(t, r, i);
  }, e.prototype.next = function(t) {
    this.isStopped || this._next(t);
  }, e.prototype.error = function(t) {
    this.isStopped || (this.isStopped = !0, this._error(t));
  }, e.prototype.complete = function() {
    this.isStopped || (this.isStopped = !0, this._complete());
  }, e.prototype.unsubscribe = function() {
    this.closed || (this.isStopped = !0, n.prototype.unsubscribe.call(this), this.destination = null);
  }, e.prototype._next = function(t) {
    this.destination.next(t);
  }, e.prototype._error = function(t) {
    try {
      this.destination.error(t);
    } finally {
      this.unsubscribe();
    }
  }, e.prototype._complete = function() {
    try {
      this.destination.complete();
    } finally {
      this.unsubscribe();
    }
  }, e;
}(z), Je = Function.prototype.bind;
function W(n, e) {
  return Je.call(n, e);
}
var Ze = function() {
  function n(e) {
    this.partialObserver = e;
  }
  return n.prototype.next = function(e) {
    var t = this.partialObserver;
    if (t.next)
      try {
        t.next(e);
      } catch (r) {
        _(r);
      }
  }, n.prototype.error = function(e) {
    var t = this.partialObserver;
    if (t.error)
      try {
        t.error(e);
      } catch (r) {
        _(r);
      }
    else
      _(e);
  }, n.prototype.complete = function() {
    var e = this.partialObserver;
    if (e.complete)
      try {
        e.complete();
      } catch (t) {
        _(t);
      }
  }, n;
}(), Z = function(n) {
  x(e, n);
  function e(t, r, i) {
    var o = n.call(this) || this, a;
    if (S(t) || !t)
      a = {
        next: t ?? void 0,
        error: r ?? void 0,
        complete: i ?? void 0
      };
    else {
      var s;
      o && Ie.useDeprecatedNextContext ? (s = Object.create(t), s.unsubscribe = function() {
        return o.unsubscribe();
      }, a = {
        next: t.next && W(t.next, s),
        error: t.error && W(t.error, s),
        complete: t.complete && W(t.complete, s)
      }) : a = t;
    }
    return o.destination = new Ze(a), o;
  }
  return e;
}(Ce);
function _(n) {
  Qe(n);
}
function et(n) {
  throw n;
}
var tt = {
  closed: !0,
  next: fe,
  error: et,
  complete: fe
}, nt = function() {
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
}();
function rt(n) {
  return n;
}
function it(n) {
  return n.length === 0 ? rt : n.length === 1 ? n[0] : function(t) {
    return n.reduce(function(r, i) {
      return i(r);
    }, t);
  };
}
var me = function() {
  function n(e) {
    e && (this._subscribe = e);
  }
  return n.prototype.lift = function(e) {
    var t = new n();
    return t.source = this, t.operator = e, t;
  }, n.prototype.subscribe = function(e, t, r) {
    var i = this, o = st(e) ? e : new Z(e, t, r);
    return U(function() {
      var a = i, s = a.operator, l = a.source;
      o.add(s ? s.call(o, l) : l ? i._subscribe(o) : i._trySubscribe(o));
    }), o;
  }, n.prototype._trySubscribe = function(e) {
    try {
      return this._subscribe(e);
    } catch (t) {
      e.error(t);
    }
  }, n.prototype.forEach = function(e, t) {
    var r = this;
    return t = Ee(t), new t(function(i, o) {
      var a = new Z({
        next: function(s) {
          try {
            e(s);
          } catch (l) {
            o(l), a.unsubscribe();
          }
        },
        error: o,
        complete: i
      });
      r.subscribe(a);
    });
  }, n.prototype._subscribe = function(e) {
    var t;
    return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
  }, n.prototype[nt] = function() {
    return this;
  }, n.prototype.pipe = function() {
    for (var e = [], t = 0; t < arguments.length; t++)
      e[t] = arguments[t];
    return it(e)(this);
  }, n.prototype.toPromise = function(e) {
    var t = this;
    return e = Ee(e), new e(function(r, i) {
      var o;
      t.subscribe(function(a) {
        return o = a;
      }, function(a) {
        return i(a);
      }, function() {
        return r(o);
      });
    });
  }, n.create = function(e) {
    return new n(e);
  }, n;
}();
function Ee(n) {
  var e;
  return (e = n ?? Ie.Promise) !== null && e !== void 0 ? e : Promise;
}
function ot(n) {
  return n && S(n.next) && S(n.error) && S(n.complete);
}
function st(n) {
  return n && n instanceof Ce || ot(n) && Re(n);
}
var at = be(function(n) {
  return function() {
    n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
  };
}), we = function(n) {
  x(e, n);
  function e() {
    var t = n.call(this) || this;
    return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
  }
  return e.prototype.lift = function(t) {
    var r = new ye(this, this);
    return r.operator = t, r;
  }, e.prototype._throwIfClosed = function() {
    if (this.closed)
      throw new at();
  }, e.prototype.next = function(t) {
    var r = this;
    U(function() {
      var i, o;
      if (r._throwIfClosed(), !r.isStopped) {
        r.currentObservers || (r.currentObservers = Array.from(r.observers));
        try {
          for (var a = $(r.currentObservers), s = a.next(); !s.done; s = a.next()) {
            var l = s.value;
            l.next(t);
          }
        } catch (E) {
          i = { error: E };
        } finally {
          try {
            s && !s.done && (o = a.return) && o.call(a);
          } finally {
            if (i)
              throw i.error;
          }
        }
      }
    });
  }, e.prototype.error = function(t) {
    var r = this;
    U(function() {
      if (r._throwIfClosed(), !r.isStopped) {
        r.hasError = r.isStopped = !0, r.thrownError = t;
        for (var i = r.observers; i.length; )
          i.shift().error(t);
      }
    });
  }, e.prototype.complete = function() {
    var t = this;
    U(function() {
      if (t._throwIfClosed(), !t.isStopped) {
        t.isStopped = !0;
        for (var r = t.observers; r.length; )
          r.shift().complete();
      }
    });
  }, e.prototype.unsubscribe = function() {
    this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
  }, Object.defineProperty(e.prototype, "observed", {
    get: function() {
      var t;
      return ((t = this.observers) === null || t === void 0 ? void 0 : t.length) > 0;
    },
    enumerable: !1,
    configurable: !0
  }), e.prototype._trySubscribe = function(t) {
    return this._throwIfClosed(), n.prototype._trySubscribe.call(this, t);
  }, e.prototype._subscribe = function(t) {
    return this._throwIfClosed(), this._checkFinalizedStatuses(t), this._innerSubscribe(t);
  }, e.prototype._innerSubscribe = function(t) {
    var r = this, i = this, o = i.hasError, a = i.isStopped, s = i.observers;
    return o || a ? Ne : (this.currentObservers = null, s.push(t), new z(function() {
      r.currentObservers = null, Q(s, t);
    }));
  }, e.prototype._checkFinalizedStatuses = function(t) {
    var r = this, i = r.hasError, o = r.thrownError, a = r.isStopped;
    i ? t.error(o) : a && t.complete();
  }, e.prototype.asObservable = function() {
    var t = new me();
    return t.source = this, t;
  }, e.create = function(t, r) {
    return new ye(t, r);
  }, e;
}(me), ye = function(n) {
  x(e, n);
  function e(t, r) {
    var i = n.call(this) || this;
    return i.destination = t, i.source = r, i;
  }
  return e.prototype.next = function(t) {
    var r, i;
    (i = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || i === void 0 || i.call(r, t);
  }, e.prototype.error = function(t) {
    var r, i;
    (i = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || i === void 0 || i.call(r, t);
  }, e.prototype.complete = function() {
    var t, r;
    (r = (t = this.destination) === null || t === void 0 ? void 0 : t.complete) === null || r === void 0 || r.call(t);
  }, e.prototype._subscribe = function(t) {
    var r, i;
    return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(t)) !== null && i !== void 0 ? i : Ne;
  }, e;
}(we);
const Be = new we();
function V(n) {
  Be.next(n);
}
function ct() {
  return Be.asObservable();
}
class dt {
  constructor() {
    c(this, "googletag");
    c(this, "timeOutCornerBanner");
    c(this, "timeOutAdhesion");
    c(this, "insideAdCallback");
    c(this, "onCornerBannerFinish");
    c(this, "onCornerBannerLoaded");
    c(this, "mapBanners", /* @__PURE__ */ new Map());
    c(this, "onSlotRender", (e) => {
      const r = e.slot.getSlotElementId(), i = this.mapBanners.get(r);
      i && (e.isEmpty ? (i.type === "CORNER" && this.onCornerBannerFinish(!0), i.type === "ADHESION" && V("ERROR")) : (i.type === "CORNER" && this.onCornerBannerLoaded && this.onCornerBannerLoaded(), i.type === "ADHESION" && V("STARTED")));
    });
    c(this, "onViewableListener", (e) => {
      const t = e.slot, r = this.mapBanners.get(t.getSlotElementId());
      r && (r.type === "CORNER" ? this.timeOutCornerBanner = setTimeout(() => {
        this.checkIfBannerExist(t.getSlotElementId()) && this.destroyCornerAdBanner();
      }, r.duration * 1e3) : r.type === "ADHESION" ? this.timeOutAdhesion = setTimeout(() => {
        this.checkIfBannerExist(t.getSlotElementId()) && this.removeBanner(r.id);
      }, r.duration * 1e3) : setTimeout(() => {
        this.checkIfBannerExist(t.getSlotElementId()) && this.googletag.pubads().refresh([t]);
      }, r.duration * 1e3));
    });
    $e().then((e) => {
      this.googletag = e, this.init();
    });
  }
  init() {
    this.googletag.cmd.push(() => {
      this.googletag.pubads().addEventListener("impressionViewable", this.onViewableListener), this.googletag.pubads().addEventListener("slotRenderEnded", this.onSlotRender), this.googletag.pubads().addEventListener("slotRequested", (e) => {
        const t = e.slot;
        this.mapBanners.get(t.getSlotElementId());
      }), this.googletag.pubads().addEventListener("slotResponseReceived", (e) => {
        const t = e.slot;
        this.mapBanners.get(t.getSlotElementId());
      }), this.googletag.pubads().setCentering(!0), this.googletag.enableServices();
    });
  }
  checkIfBannerExist(e) {
    return this.mapBanners.has(e);
  }
  mapToBannerSizes(e) {
    const t = [];
    return e.forEach(({ width: r, height: i }) => {
      t.push([r, i]);
    }), t;
  }
  addBanners(e) {
    this.googletag.cmd.push(() => {
      e.forEach((t) => {
        if (t.type == "CORNER") {
          const o = document.querySelector("#streann-node");
          if (!o) {
            setTimeout(() => this.addBanners([t]), 500);
            return;
          }
          const a = o.querySelector("#page-content");
          a && a.remove(), document.getElementById(t.id) || o.insertAdjacentHTML("beforeend", `<div id="${t.id}"></div>`);
          const s = this.mapBanners.get(t.id);
          if (s)
            try {
              this.googletag.destroySlots([s.slot]), this.mapBanners.delete(t.id);
            } catch {
              this.mapBanners.delete(t.id);
            }
        }
        const r = this.mapToBannerSizes(t.sizes), i = this.googletag.defineSlot(
          t.url,
          r,
          t.id
        );
        if (!i) {
          t.type === "CORNER" && this.onCornerBannerFinish && this.onCornerBannerFinish(!0);
          return;
        }
        i.addService(this.googletag.pubads()), this.mapBanners.set(t.id, { ...t, slot: i }), this.googletag.display(t.id);
      });
    });
  }
  removeBanner(e) {
    const t = this.mapBanners.get(e);
    if (t) {
      if (t.type === "ADHESION") {
        V("FINISHED"), clearTimeout(this.timeOutAdhesion), this.clearSlot(t.slot), this.mapBanners.delete(e);
        return;
      }
      this.clearSlot(t.slot);
    }
  }
  addCallback(e, t, r) {
    this.insideAdCallback = e, this.onCornerBannerFinish = t, this.onCornerBannerLoaded = r;
  }
  destroyCornerAdBanner() {
    const e = this.mapBanners.get("corner-banner");
    e && (clearTimeout(this.timeOutCornerBanner), this.mapBanners.delete("corner-banner"), this.googletag.cmd.push(() => {
      try {
        this.googletag.destroySlots([e.slot]);
      } catch {
      }
    }), this.onCornerBannerFinish(!1), this.insideAdCallback && this.insideAdCallback.insideAdStop());
  }
  clearSlot(e) {
    this.googletag.cmd.push(() => {
      this.googletag.pubads().clear([e]);
      try {
        const t = e.getSlotElementId();
        this.mapBanners.has(t) && this.mapBanners.delete(t);
      } catch {
      }
    });
  }
  clearAllSlots() {
    this.googletag.cmd.push(() => {
    }), this.mapBanners.clear();
  }
}
const w = new dt(), lt = {
  "559ff7ade4b0d0aff40888dd": "waOD17zDaPce11Z0puO7SnklPkRA9OFA",
  "611fd870e4b03ec37aae6e5e": "7cYD4eXXRSfU3Fm1cRUfbzLjGl5TCa0H",
  //Bethelmedia
  "63588500e4b0a3efdffcd7ae": "2JW19nsrunPbTCvLlDpujMeEqy7B5BKw",
  //Emmanueltv
  "6849d5ca8f0828869550a9d4": "VVClTfMzzYh9tp8xzWiXgtZiXLSOAKTC",
  //Fearpix
  "61290efae4b0304f3eb75567": "SfZ3PMQtGdOvQLpddJcqRXQM9byJT2oR",
  //FlexFlix
  "67ae4dca8f0849e7e4f7bacd": "AGOodqAzgaWFLGl4dnABChTF7fOr4N6B",
  //GameStreamMedia
  "665489308f0895bfb0a92709": "8n31clcNq8cBbtgFzfJlCDmhFFLqkOVt",
  //Gols
  "68d6ef1f8f0806541640a2bf": "aVgVElbEaVAlkTGtiEACO2OcLSutKY4V",
  //ImpactProfessionals
  "67ffb7cd8f088acea336789e": "AChsRySIuKQeAB2JTjaXKEQLaG9zr8qk",
  //Okgol
  "5fc01321e4b0612f786b31c1": "LnfN4l7AeFfI3ygS5ChjTFwfO9KpiKjd",
  //Panamsport,
  "61316705e4b0295f87dae396": "YTAtmWLysGqH38Hl8pH3GNWxKjuJwW1T",
  //Tdmax
  "67afc6258f0849e7e502973e": "bo2q97sTBTo35YQaMo14uiusWqosZr3p",
  //Televicentro
  "686c6dac8f0802f464222b69": "8oGsm3BJC5qq4mrDY2b3oDkcImVJ2Nb5",
  //Tvin
  "613fa9a7e4b0ee1171b95105": "aCQPR3Q6FuA0HmDPRYdKONpC7ULP6dCj",
  //Wipr
  "56bb41cce4b01db401d1b040": "XKHTYLWGqZszh7ZSIUl91CDeQZ23Cg0m"
  //Actualidad
};
function ut(n) {
  return lt[n];
}
let O = null;
async function pt() {
  if (O)
    return O;
  try {
    const t = await (await fetch("https://geoip.streann.tech/")).json();
    return O = {
      country: t.countryCode || t.country || "",
      city: t.city || "",
      state: t.region || t.state || "",
      zip: t.zip || t.PostalCode || ""
    }, O;
  } catch {
    return {
      country: "",
      city: "",
      state: "",
      zip: ""
    };
  }
}
function ht() {
  return O;
}
const ft = "3.6.7";
class mt {
  constructor() {
    c(this, "initialized", !1);
    c(this, "writeKey");
    c(this, "resellerId");
  }
  initialize(e) {
    this.initialized || (this.resellerId = e, this.writeKey = ut(e), this.writeKey && (this.loadSegmentSnippet(this.writeKey), this.initialized = !0));
  }
  getCommonProperties() {
    const e = ht();
    return {
      resellerId: this.resellerId || "",
      country: (e == null ? void 0 : e.country) || "",
      city: (e == null ? void 0 : e.city) || "",
      state: (e == null ? void 0 : e.state) || "",
      zip: (e == null ? void 0 : e.zip) || "",
      platform: "Web",
      deviceType: "Web",
      appVersion: ft
    };
  }
  loadSegmentSnippet(e) {
    const t = window.analytics = window.analytics || [];
    if (!t.initialize) {
      if (t.invoked)
        return;
      t.invoked = !0, t.methods = [
        "trackSubmit",
        "trackClick",
        "trackLink",
        "trackForm",
        "pageview",
        "identify",
        "reset",
        "group",
        "track",
        "ready",
        "alias",
        "debug",
        "page",
        "once",
        "off",
        "on",
        "addSourceMiddleware",
        "addIntegrationMiddleware",
        "setAnonymousId",
        "addDestinationMiddleware"
      ], t.factory = function(r) {
        return function(...i) {
          return i.unshift(r), t.push(i), t;
        };
      };
      for (const r of t.methods)
        t[r] = t.factory(r);
      t.load = function(r, i) {
        var s;
        const o = document.createElement("script");
        o.type = "text/javascript", o.async = !0, o.src = `https://cdn.segment.com/analytics.js/v1/${r}/analytics.min.js`;
        const a = document.getElementsByTagName("script")[0];
        (s = a == null ? void 0 : a.parentNode) == null || s.insertBefore(o, a), t._loadOptions = i;
      }, t._writeKey = e, t.SNIPPET_VERSION = "4.15.3", t.load(e), t.page();
    }
  }
  track(e, t) {
    if (this.initialized)
      try {
        const r = window.analytics;
        if (r && r.track) {
          const i = {
            ...this.getCommonProperties(),
            ...t
          };
          r.track(e, i);
        }
      } catch {
      }
  }
  trackAdRequested(e) {
    this.track("Ad Requested", {
      screen: e
    });
  }
  trackAdDisplayed(e, t, r) {
    this.track("Ad Displayed", {
      adName: e,
      adType: t,
      screen: r
    });
  }
  trackAdFailed(e, t) {
    this.track("Ad Failed", {
      screen: e,
      error: t
    });
  }
}
const j = new mt();
let p, f, M, Y, R, I, u, G, ie, d, q, ee, k = !1, P = 0;
const Le = `
<div id="page-content">
    <div id="video-container">
      <video id="video-element" src="">
      </video>
      <div id="ad-container"></div>
    </div>
</div>
`, Et = `
<div id="page-content-split-ad">
 <div id="video-container-split-ad">
      <video id="video-element" src="">
      </video>
      <div id="ad-container"></div>
    </div>
</div>
`;
let oe = "", b, g = null;
function yt(n, e, t, r, i, o) {
  P++;
  const a = P;
  i && o && (g = {
    adName: i.name,
    adType: i.adType,
    screen: o
  }), Te().then((s) => {
    var A;
    if (a !== P)
      return;
    q = t, ee = r, b = n, (A = document.querySelector("#streann-node")) == null || A.insertAdjacentHTML("beforeend", Le), d = s, oe = De(e), u = document.getElementById("video-element"), Y = document.getElementById("playButton"), R = document.getElementById("mute"), I = document.getElementById("un-mute"), I.style.display = "none", R.style.display = "none";
    const l = document.getElementById("cornerCloseButton"), E = document.getElementById("streann-logo");
    l && (l.style.display = "none"), E && (E.style.display = "none"), Tt(), Oe();
  }).catch(() => {
  });
}
function At(n, e, t, r, i, o) {
  i && o && (g = {
    adName: i.name,
    adType: i.adType,
    screen: o
  }), Te().then((a) => {
    q = t, b = n;
    const s = document.getElementById(r);
    if (s)
      s.insertAdjacentHTML("beforeend", Et);
    else {
      console.error(`Container with id ${r} not found`);
      return;
    }
    d = a, oe = De(e), u = s.querySelector("#video-element"), Y = s.querySelector("#playButton"), bt(r), Oe();
  }).catch(() => {
  });
}
function De(n) {
  switch (!0) {
    case n.includes("[STREANN-PLAYER-HEIGHT]"):
      return n.replace("[STREANN-PLAYER-HEIGHT]", window.innerHeight.toString());
    case n.includes("[STREANN-PLAYER-WIDTH]"):
      return n.replace("[STREANN-PLAYER-WIDTH]", window.innerWidth.toString());
    case n.includes("[STREANN-APP-BUNDLE-ID]"):
      return n.replace("[STREANN-APP-BUNDLE-ID]", "");
    case n.includes("[STREANN-APP-NAME]"):
      return n.replace("[STREANN-APP-NAME]", "");
    case n.includes("[STREANN-APP-VERSION]"):
      return n.replace("[STREANN-APP-VERSION]", "");
    case n.includes("[STREANN-APP-DOMAIN]"):
      return n.replace("[STREANN-APP-DOMAIN]", "");
    case n.includes("[STREANN-APP-STORE-URL]"):
      return n.replace("[STREANN-APP-STORE-URL]", "");
    case n.includes("[STREANN-SITE-URL]"):
      return n.replace("[STREANN-SITE-URL]", `${window.location.origin}${window.location.pathname}`);
    case n.includes("[STREANN-CONTENT-ID]"): {
      const e = localStorage.getItem("streannContentId") || "";
      return n.replace("[STREANN-CONTENT-ID]", e);
    }
    case n.includes("[STREANN-CONTENT-TITLE]"): {
      const e = localStorage.getItem("streannContentTitle") || "";
      return n.replace("[STREANN-CONTENT-TITLE]", e);
    }
    case n.includes("[STREANN-CONTENT-LENGTH]"):
      return n.replace("[STREANN-CONTENT-LENGTH]", "");
    case n.includes("[STREANN-CONTENT-URL]"):
      return n.replace("[STREANN-CONTENT-URL]", window.location.href);
    case n.includes("[STREANN-CONTENT-ENCODED-URL]"):
      return n.replace("[STREANN-CONTENT-ENCODED-URL]", "");
    case n.includes("[STREANN-DESCRIPTION-URL]"):
      return n.replace("[STREANN-DESCRIPTION-URL]", "");
    case n.includes("[STREANN-DEVICE-ID]"):
      return n.replace("[STREANN-DEVICE-ID]", "");
    case n.includes("[STREANN-NETWORK]"):
      return n.replace("[STREANN-NETWORK]", "");
    case n.includes("[STREANN-CARRIER]"):
      return n.replace("[STREANN-CARRIER]", "");
    case n.includes("[STREANN-DEVICE-MANUFACTURER]"):
      return n.replace("[STREANN-DEVICE-MANUFACTURER]", "");
    case n.includes("[STREANN-DEVICE-MODEL]"):
      return n.replace("[STREANN-DEVICE-MODEL]", "");
    case n.includes("[STREANN-DEVICE-OS]"):
      return n.replace("[STREANN-DEVICE-OS]", "");
    case n.includes("[STREANN-DEVICE-OS-VERSION]"):
      return n.replace("[STREANN-DEVICE-OS-VERSION]", "");
    case n.includes("[STREANN-DEVICE-TYPE]"):
      return n.replace("[STREANN-DEVICE-TYPE]", "web");
    case n.includes("[STREANN-IP]"):
      return n.replace("[STREANN-IP]", "https://geoip.streann.com/");
    case n.includes("[STREANN-UA]"):
      return n.replace("[STREANN-UA]", navigator.userAgent);
    case n.includes("[STREANN-IFA-TYPE]"):
      return n.replace("[STREANN-IFA-TYPE]", "");
    case n.includes("[STREANN-ADVERTISING-ID]"):
      return n.replace("[STREANN-ADVERTISING-ID]", "");
    case n.includes("[STREANN-ADVERTISING-ID-HEX]"):
      return n.replace("[STREANN-ADVERTISING-ID-HEX]", "");
    case n.includes("[STREANN-ADVERTISING-ID-MD5]"):
      return n.replace("[STREANN-ADVERTISING-ID-MD5]", "");
    case n.includes("[STREANN-IDFA]"):
      return n.replace("[STREANN-IDFA]", "");
    case n.includes("[STREANN-IDFA-MD5]"):
      return n.replace("[STREANN-IDFA-MD5]", "");
    case n.includes("[STREANN-IDFA-HEX]"):
      return n.replace("[STREANN-IDFA-HEX]", "");
    case n.includes("[STREANN-LOCATION-LAT]"):
      return n.replace("[STREANN-LOCATION-LAT]", "");
    case n.includes("[STREANN-LOCATION-LONG]"):
      return n.replace("[STREANN-LOCATION-LONG]", "");
    case n.includes("[STREANN-COUNTRY-ID]"): {
      const e = localStorage.getItem("streannCountryId") || "";
      return n.replace("[STREANN-COUNTRY-ID]", e);
    }
    case n.includes("[STREANN-DO-NOT-TRACK]"):
      return n.replace("[STREANN-DO-NOT-TRACK]", "");
    case n.includes("[STREANN-GDPR]"):
      return n.replace("[STREANN-GDPR]", "");
    case n.includes("[STREANN-GDPR-CONSENT]"):
      return n.replace("[STREANN-GDPR-CONSENT]", "");
    case n.includes("[STREANN-USER-BIRTHYEAR]"):
      return n.replace("[STREANN-USER-BIRTHYEAR]", "");
    case n.includes("[STREANN-USER-GENDER]"):
      return n.replace("[STREANN-USER-GENDER]", "");
    case n.includes("[STREANN-CACHEBUSTER]"): {
      const e = () => Math.random().toString(36).substring(2, 12);
      return n.replace("[STREANN-CACHEBUSTER]", e());
    }
    case n.includes("[STREANN-US-PRIVACY]"):
      return n.replace("[STREANN-US-PRIVACY]", "");
    default:
      return n;
  }
}
function gt(n) {
  var i;
  (i = document.querySelector("#streann-node")) == null || i.insertAdjacentHTML("beforeend", Le);
  const e = document.getElementById("video-element");
  Y = document.getElementById("playButton"), R = document.getElementById("mute"), I = document.getElementById("un-mute");
  const t = document.getElementById("cornerCloseButton"), r = document.getElementById("streann-logo");
  t && (t.style.display = "none"), r && (r.style.display = "block"), e.src = n.url, e.load(), I.style.display = "block", R.style.display = "none", e.addEventListener("play", () => {
    r && (r.style.display = "block");
  }), e.muted = !0, e.play().catch(function(o) {
    console.error("Autoplay failed:", o);
  }), e.addEventListener("click", function() {
    n.properties.clickThroughUrl && window.open(n.properties.clickThroughUrl, "_blank");
  }), e.addEventListener("ended", se), R.addEventListener("click", () => {
    e.muted = !0, R.style.display = "none", I.style.display = "block";
  }), I.addEventListener("click", () => {
    e.muted = !1, I.style.display = "none", R.style.display = "block";
  });
}
function se() {
  const n = document.getElementById("video-element");
  n && (n.pause(), n.removeEventListener("ended", se), n.style.display = "none");
  const e = document.getElementById("page-content");
  e && e.remove();
}
function Oe() {
  u.volume = 0, u.muted = !0;
  const n = u.play();
  n !== void 0 && n.then(St).catch(vt);
}
function St() {
  u.pause(), G = !0, ie = !0, Pe();
}
function vt() {
  u.pause(), G = !0, ie = !0, Pe();
}
function Tt() {
  Rt(), f = new d.AdsLoader(M), f.getSettings().setDisableCustomPlaybackForIOS10Plus(!0), f.addEventListener(
    d.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
    ke,
    !1
  ), k = !1, f.addEventListener(d.AdErrorEvent.Type.AD_ERROR, ce, !1), u.onended = ae;
}
function bt(n) {
  Nt(n), f = new d.AdsLoader(M), f.addEventListener(
    d.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
    ke,
    !1
  ), k = !1, f.addEventListener(d.AdErrorEvent.Type.AD_ERROR, ce, !1), u.onended = ae;
}
function Nt(n) {
  var t;
  const e = (t = document.getElementById(n)) == null ? void 0 : t.querySelector("#ad-container");
  if (e.style.display = "none", !e) {
    console.error(`Ad container not found in ${n}`);
    return;
  }
  M = new d.AdDisplayContainer(e, u);
}
function ae() {
  u.onended = null, f && f.contentComplete();
}
function Pe() {
  const n = new d.AdsRequest();
  n.adTagUrl = oe, n.linearAdSlotWidth = u.clientWidth, n.linearAdSlotHeight = u.clientHeight, n.nonLinearAdSlotWidth = u.clientWidth, n.nonLinearAdSlotHeight = u.clientHeight / 3, n.vastLoadTimeout = 1e4, n.setAdWillAutoPlay(G), n.setAdWillPlayMuted(ie), f.requestAds(n), g && j.trackAdRequested(g.screen);
}
function Rt() {
  const n = document.getElementById("ad-container");
  if (!n) {
    console.error("NO AD CONTIANER");
    return;
  }
  M = new d.AdDisplayContainer(n, u);
}
function It() {
  try {
    M.initialize(), p.init(
      u.clientWidth,
      u.clientHeight,
      d.ViewMode.NORMAL
    ), p.start();
  } catch (n) {
    console.error(n), u.play();
  }
}
function ke(n) {
  const e = new d.AdsRenderingSettings();
  e.restoreCustomPlaybackStateOnAdBreakComplete = !0, e.loadVideoTimeout = 15e3, p = n.getAdsManager(
    u,
    e
  ), p.setVolume(0), k = !1, p.addEventListener(d.AdErrorEvent.Type.AD_ERROR, ce), p.addEventListener(
    d.AdEvent.Type.CONTENT_PAUSE_REQUESTED,
    Ct
  ), p.addEventListener(
    d.AdEvent.Type.CONTENT_RESUME_REQUESTED,
    wt
  ), p.addEventListener(d.AdEvent.Type.ALL_ADS_COMPLETED, L), p.addEventListener(d.AdEvent.Type.LOADED, L), p.addEventListener(d.AdEvent.Type.STARTED, L), p.addEventListener(d.AdEvent.Type.IMPRESSION, L), p.addEventListener(d.AdEvent.Type.COMPLETE, L), G ? It() : Y.style.display = "block";
}
function L(n) {
  var t;
  const e = n.getAd();
  switch (n.type) {
    case d.AdEvent.Type.LOADED:
      b.insideAdLoaded(), e.isLinear() || u.play();
      break;
    case d.AdEvent.Type.STARTED:
      b.insideAdPlay(), g && j.trackAdDisplayed(
        g.adName,
        g.adType,
        g.screen
      );
      const r = (t = document.getElementById("split-ad-container")) == null ? void 0 : t.querySelector("#ad-container");
      if (r) {
        r.style.display = "block";
        const i = document.getElementById("vjsplayer");
        i && (i.style.width = "50%", i.style.float = "right");
      }
      break;
    case d.AdEvent.Type.IMPRESSION:
      de(!0), ee && ee();
      break;
    case d.AdEvent.Type.CLICK:
      b.insideAdClicked();
      break;
    case d.AdEvent.Type.SKIPPED:
      te(), b.insideAdSkipped();
      break;
    case d.AdEvent.Type.ALL_ADS_COMPLETED:
      te();
      break;
    case d.AdEvent.Type.COMPLETE:
      break;
  }
}
function ce(n) {
  var r;
  if (k)
    return;
  if (k = !0, g) {
    const i = `${n.getError().getErrorCode()}: ${n.getError().getMessage()}`;
    j.trackAdFailed(g.screen, i);
  }
  P++, (r = document.getElementById("split-ad-container")) == null || r.remove();
  const e = document.getElementById("vjsplayer");
  if (e && (e.style.width = "100%", e.style.float = "none"), p)
    try {
      p.destroy();
    } catch {
    }
  if (f)
    try {
      f.contentComplete();
    } catch {
    }
  const t = document.getElementById("page-content");
  t && t.remove(), u && (u.onended = null, u.pause()), de(!1), b.insideAdError(n.getError().toString()), q(!0);
}
function Ct() {
  u.pause(), u.onended = null;
}
function wt() {
  u.onended = ae;
}
function te() {
  if (P++, q(), de(!1), p)
    try {
      p.destroy();
    } catch {
    }
  if (f)
    try {
      f.contentComplete();
    } catch {
    }
  const n = document.getElementById("page-content");
  n && n.remove();
  const e = document.getElementById("split-ad-container");
  if (e) {
    e.remove();
    const t = document.getElementById("vjsplayer");
    t && (t.style.width = "100%", t.style.float = "none");
  }
  b.insideAdStop();
}
function de(n) {
  const e = document.getElementById("streann-logo");
  n ? e && (e.style.display = "block") : e && (e.style.display = "none");
}
const C = class C {
  constructor(e, t, r) {
    c(this, "placement");
    // private ad : any;
    c(this, "counterFailedCornerAd", 0);
    c(this, "insideAdCallback");
    c(this, "currentAd");
    c(this, "closeButtonTimer");
    c(this, "adInProgress", !1);
    c(this, "lastAttemptTime", 0);
    c(this, "currentAttemptCount", 0);
    c(this, "finishing", !1);
    this.placement = e, this.insideAdCallback = r;
    const i = 1;
    this.counterFailedCornerAd = 0, setTimeout(() => {
      this.startAd(t);
    }, Number(i) * 1e3);
  }
  cornerElem(e) {
    return `
  <div id="streann-node" style="${e}">
    <div id="cornerCloseButton" class="closeButton">x</div>
    <div id="streann-logo" class="streann-logo">
      <a href="https://streann.com/" target="_blank">
        <img src="https://img.streann.com/streann-img/559ff7ade4b0d0aff40888dd/uploads/images/754c4884-ab89-4331-9134-bbe6f89bde28/NEW_Streann-Logo-Icon-Inside-Corner.png" class="logo" alt="streann-logo">    
      </a>
    </div>
    <div id="un-mute" class="un-mute">
      <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-volume-mute-fill" viewBox="0 0 16 16">
        <path d="M6.717 3.55A.5.5 0 0 1 7 4v8a.5.5 0 0 1-.812.39L3.825 10.5H1.5A.5.5 0 0 1 1 10V6a.5.5 0 0 1 .5-.5h2.325l2.363-1.89a.5.5 0 0 1 .529-.06m7.137 2.096a.5.5 0 0 1 0 .708L12.207 8l1.647 1.646a.5.5 0 0 1-.708.708L11.5 8.707l-1.646 1.647a.5.5 0 0 1-.708-.708L10.793 8 9.146 6.354a.5.5 0 1 1 .708-.708L11.5 7.293l1.646-1.647a.5.5 0 0 1 .708 0"/>
      </svg>
    </div>
    <div class="mute" id="mute">
      <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-volume-up-fill" viewBox="0 0 16 16">
        <path d="M11.536 14.01A8.47 8.47 0 0 0 14.026 8a8.47 8.47 0 0 0-2.49-6.01l-.708.707A7.48 7.48 0 0 1 13.025 8c0 2.071-.84 3.946-2.197 5.303z"/>
        <path d="M10.121 12.596A6.48 6.48 0 0 0 12.025 8a6.48 6.48 0 0 0-1.904-4.596l-.707.707A5.48 5.48 0 0 1 11.025 8a5.48 5.48 0 0 1-1.61 3.89z"/>
        <path d="M8.707 11.182A4.5 4.5 0 0 0 10.025 8a4.5 4.5 0 0 0-1.318-3.182L8 5.525A3.5 3.5 0 0 1 9.025 8 3.5 3.5 0 0 1 8 10.475zM6.717 3.55A.5.5 0 0 1 7 4v8a.5.5 0 0 1-.812.39L3.825 10.5H1.5A.5.5 0 0 1 1 10V6a.5.5 0 0 1 .5-.5h2.325l2.363-1.89a.5.5 0 0 1 .529-.06"/>
      </svg>
    </div>
  </div>
`;
  }
  // Delay before trying next ad in waterfall
  startAd(e) {
    var i, o, a;
    if (this.adInProgress)
      return;
    const t = Date.now(), r = t - this.lastAttemptTime;
    if (this.currentAttemptCount > 0 && r < C.MIN_RETRY_DELAY && this.lastAttemptTime > 0) {
      const s = C.MIN_RETRY_DELAY - r;
      setTimeout(() => this.startAd(e), s);
      return;
    }
    if (this.lastAttemptTime = t, this.currentAttemptCount++, this.adInProgress = !0, this.currentAd = e, this.createCornerAdView(), e.adType == N.VAST) {
      const s = ((a = (o = (i = this.placement.properties) == null ? void 0 : i.webSettings) == null ? void 0 : o.screens) == null ? void 0 : a[0]) || window.location.pathname;
      yt(
        this.insideAdCallback,
        e.url,
        this.onAdFinish.bind(this),
        this.startCloseButtonTimer.bind(this),
        // Start timer only when VAST ad loads
        e,
        s
      );
    } else if (e.adType == N.BANNER) {
      w.addCallback(
        this.insideAdCallback,
        this.onAdFinish.bind(this),
        this.startCloseButtonTimer.bind(this)
        // Start timer only when banner loads
      );
      const s = {
        duration: e.properties.durationInSeconds,
        id: "corner-banner",
        sizes: e.properties.sizes,
        type: "CORNER",
        url: e.url
      };
      w.addBanners([s]);
    } else
      e.adType == N.LOCAL_VIDEO && gt(e);
  }
  createCornerAdView() {
    var r, i, o;
    if (document.getElementById("streann-node")) {
      const a = document.getElementById("cornerCloseButton");
      a && (a.style.display = "none");
      return;
    }
    const t = ((i = (r = this.placement.properties) == null ? void 0 : r.webSettings) == null ? void 0 : i.styles) || `
      position: fixed;
      bottom: 20px;
      right: 20px;
      z-index: 1000;
      width: 300px;
      height: 250px;
    `;
    (o = document.querySelector("body")) == null || o.insertAdjacentHTML("beforeend", this.cornerElem(t || ""));
  }
  // Call this when ad successfully loads (from bannerService or ima)
  startCloseButtonTimer() {
    this.showCloseButton();
  }
  showCloseButton() {
    if (this.closeButtonTimer && (clearTimeout(this.closeButtonTimer), this.closeButtonTimer = void 0), this.placement.properties.showCloseButtonAfterSeconds != null) {
      const e = this.placement.properties.showCloseButtonAfterSeconds;
      this.closeButtonTimer = setTimeout(() => {
        const t = document.getElementById("cornerCloseButton");
        t && (t.onclick = this.handleOnCloseButton.bind(this), t.style.setProperty("display", "block"));
      }, Number(e) * 1e3);
    }
  }
  handleOnCloseButton() {
    var e, t, r;
    ((e = this.currentAd) == null ? void 0 : e.adType) == N.BANNER ? w.destroyCornerAdBanner() : ((t = this.currentAd) == null ? void 0 : t.adType) == N.VAST ? te() : ((r = this.currentAd) == null ? void 0 : r.adType) == N.LOCAL_VIDEO && se();
  }
  onAdFinish(e = !1) {
    var a;
    if (this.finishing)
      return;
    this.finishing = !0, this.adInProgress = !1, this.closeButtonTimer && (clearTimeout(this.closeButtonTimer), this.closeButtonTimer = void 0);
    const t = (a = this.currentAd) == null ? void 0 : a.fallback;
    if (t && e && this.counterFailedCornerAd < 20) {
      this.counterFailedCornerAd++;
      const s = document.getElementById("cornerCloseButton"), l = document.getElementById("streann-logo");
      s && (s.style.display = "none"), l && (l.style.display = "none"), this.finishing = !1, setTimeout(() => {
        this.startAd(t);
      }, C.WATERFALL_RETRY_DELAY);
      return;
    }
    e && !t || e && this.counterFailedCornerAd >= 20;
    const r = e ? 0 : 1e3;
    this.counterFailedCornerAd = 0, this.currentAttemptCount = 0, this.lastAttemptTime = 0;
    const i = document.getElementById("cornerCloseButton"), o = document.getElementById("streann-logo");
    i && (i.style.display = "none"), o && (o.style.display = "none"), setTimeout(() => {
      const s = document.getElementById("streann-node");
      s && s.remove(), this.finishing = !1, this.insideAdCallback && this.insideAdCallback.insideAdStop();
    }, r);
  }
};
c(C, "MIN_RETRY_DELAY", 1e3), // 1 second between attempts
c(C, "WATERFALL_RETRY_DELAY", 500);
let ne = C;
class Bt {
  constructor(e, t) {
    var l, E, A;
    const r = {
      id: "",
      duration: t.properties.durationInSeconds,
      sizes: t.properties.sizes,
      type: "EMBED",
      url: t.url
    }, i = (l = e.properties) == null ? void 0 : l.webSettings;
    if (!i)
      return;
    const { elemId: o, parentXpath: a, advancedScript: s } = i;
    if (o) {
      const m = document.getElementById(o);
      if (!m)
        return;
      const h = (A = (E = e.properties) == null ? void 0 : E.webSettings) == null ? void 0 : A.styles;
      h && m.setAttribute("style", h), r.id = o;
    } else if (a) {
      const m = this.getElementByXpath(a);
      if (!m)
        return;
      if (document.getElementById(e.id))
        r.id = e.id;
      else {
        const v = this.generateElement(e);
        m.appendChild(v), r.id = e.id;
      }
    } else if (s) {
      const m = new Function(s)();
      if (!document.getElementById(m))
        return;
      r.id = m;
    } else
      return;
    w.addBanners([r]);
  }
  getElementByXpath(e) {
    return document.evaluate(
      e,
      document,
      null,
      XPathResult.FIRST_ORDERED_NODE_TYPE,
      null
    ).singleNodeValue;
  }
  generateElement(e) {
    var i, o;
    const t = document.createElement("div");
    t.setAttribute("id", e.id);
    const r = (o = (i = e.properties) == null ? void 0 : i.webSettings) == null ? void 0 : o.styles;
    return r && t.setAttribute("style", r), t;
  }
  randId() {
    return Math.random().toString(36).replace("0.", "inside-ad");
  }
}
class Lt {
  constructor() {
    c(this, "adHeasonElem", `<div id="streann-adhesion">
    <div class="adhesion-container">
        <div id="adhesion">
        </div>
    </div>
    <div class="close-btn-container">
    <button id='adHesionCloseBtn' class="closeButton">x</button>
    </div>
</div>`);
    c(this, "lastShownLocation", "");
    c(this, "adHesionTimeout");
  }
  setAd(e, t) {
    if (this.lastShownLocation == location.pathname)
      return;
    ct().subscribe({
      next: (i) => {
        switch (i) {
          case "REQUESTED":
            this.lastShownLocation = location.pathname;
            break;
          case "ERROR":
            this.onAdFinish();
            break;
          case "STARTED":
            break;
          case "FINISHED":
            this.onAdFinish();
            break;
        }
      }
    });
    const r = e.properties.startAfterSeconds;
    r != null ? (clearTimeout(this.adHesionTimeout), this.adHesionTimeout = setTimeout(() => {
      this.startAd(t);
    }, Number(r) * 1e3)) : this.startAd(t);
  }
  onCloseButton() {
    w.removeBanner("adhesion");
  }
  createAdHeasonElem() {
    var t;
    (t = document.querySelector("body")) == null || t.insertAdjacentHTML("beforeend", this.adHeasonElem);
    const e = document.getElementById("adHesionCloseBtn");
    e && (e.style.setProperty("display", "block"), e.onclick = this.onCloseButton.bind(this));
  }
  startAd(e) {
    V("REQUESTED"), this.createAdHeasonElem();
    const t = {
      duration: e.properties.durationInSeconds,
      id: "adhesion",
      sizes: e.properties.sizes,
      type: "ADHESION",
      url: e.url
      // url: "/22290518902/flexflix_web_corner_rectangle",
    };
    w.addBanners([t]);
  }
  onAdFinish() {
    var e;
    (e = document.getElementById("streann-adhesion")) == null || e.remove();
  }
}
const Me = new Lt();
class Dt {
  constructor(e, t, r) {
    c(this, "placement");
    c(this, "ad");
    c(this, "insideAdCallback");
    c(this, "currentAd");
    c(this, "insideAdActive", !1);
    this.placement = e, this.ad = t, this.insideAdCallback = r, setTimeout(() => {
      this.startAd(t);
    }, Number(5) * 1e3), window.addEventListener("popstate", this.removeAd.bind(this)), window.addEventListener("hashchange", this.removeAd.bind(this));
  }
  splitAdElem(e) {
    return `<div id="streann-splitad" style="${e};height: 100vh; background: black; display: flex; justify-content: center; align-items: center; position: relative;">
            <video id="ad-player" style="width: 100%; height: 100%;"></video>
            <button id="cornerUnmuteSplitAdButton" class="split-ad-unmute-btn"></button>
            <button id="cornerCloseSplitAdButton" class="split-ad-close-btn">Skip Ad</button>
        </div>`;
  }
  initLocalVideoAd_(e) {
    const t = document.getElementById("ad-player");
    t ? (t.style.display = "none", t.addEventListener("play", () => {
      t.style.display = "block";
    }), t.src = e.url, t.muted = !0, t.autoplay = !0, t.play().catch((r) => {
      console.error("Error playing ad video:", r);
    }), t.addEventListener("ended", () => {
      var i;
      (i = document.getElementById("streann-splitad")) == null || i.remove();
      const r = document.getElementById("vjsplayer");
      r && (r.style.width = "100%", r.style.float = "none");
    })) : console.error("Ad player not found");
  }
  startAd(e) {
    var r, i, o;
    if (this.insideAdActive)
      return;
    this.insideAdActive = !0;
    const t = localStorage.getItem("streannShowSplitAd");
    if (this.cleanupExistingAdContainer(), !t || t === "false") {
      console.warn("No ads in player"), this.insideAdActive = !1;
      return;
    } else {
      this.currentAd = e;
      const a = document.querySelector("body");
      if (a && (a.classList.remove("flex-column"), a.classList.add("flex-row-reverse")), e.adType === "LOCAL_VIDEO")
        this.createSplitAdView(), this.initLocalVideoAd_(e);
      else if (e.adType === "VAST") {
        this.createSplitAdViewVast();
        const s = ((o = (i = (r = this.placement.properties) == null ? void 0 : r.webSettings) == null ? void 0 : i.screens) == null ? void 0 : o[0]) || window.location.pathname;
        At(this.insideAdCallback, e.url, this.removeAd.bind(this), "split-ad-container", e, s);
      } else
        console.warn("Ad type not supported");
    }
  }
  createSplitAdViewVast() {
    const e = document.createElement("div");
    e.id = "split-ad-container", e.style.setProperty("width", "50%", "important"), e.style.background = "black", e.style.height = "100vh", e.style.display = "flex", e.style.justifyContent = "center", e.style.alignItems = "center", document.body.appendChild(e);
  }
  createSplitAdView() {
    var r, i, o;
    const e = document.getElementById("vjsplayer");
    e && (e.style.width = "50%", e.style.float = "right", e.style.height = "100vh", e.style.display = "flex", e.style.justifyContent = "center", e.style.alignItems = "center");
    const t = ((i = (r = this.placement.properties) == null ? void 0 : r.webSettings) == null ? void 0 : i.styles) || "";
    (o = document.querySelector("body")) == null || o.insertAdjacentHTML("beforeend", this.splitAdElem(t)), this.showCloseButton(), this.showUnmuteButton();
  }
  showCloseButton() {
    if (this.placement.properties.showCloseButtonAfterSeconds != null) {
      const e = document.getElementById("cornerCloseSplitAdButton");
      if (!e)
        return;
      const t = this.placement.properties.showCloseButtonAfterSeconds;
      e.style.setProperty("display", "none"), setTimeout(() => {
        e.onclick = this.handleOnCloseButton.bind(this), e.style.setProperty("display", "block");
      }, Number(t) * 1e3);
    }
  }
  showUnmuteButton() {
    const e = document.getElementById("cornerUnmuteSplitAdButton");
    e && (e.innerHTML = `<svg width="24" height="24" viewBox="0 0 24 24" fill="white">
                <path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/>
            </svg>`, e.onclick = this.toggleMute.bind(this));
  }
  toggleMute() {
    const e = document.getElementById("cornerUnmuteSplitAdButton"), t = document.getElementById("ad-player");
    !t || !e || (t.muted ? (t.muted = !1, e.innerHTML = `<svg width="24" height="24" viewBox="0 0 24 24" fill="white">
                    <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/>
                </svg>`) : (t.muted = !0, e.innerHTML = `<svg width="24" height="24" viewBox="0 0 24 24" fill="white">
                    <path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/>
                </svg>`));
  }
  handleOnCloseButton() {
    const e = document.getElementById("streann-splitad"), t = document.getElementById("ad-player");
    t && (t.pause(), t.currentTime = 0), e && e.remove();
    const r = document.getElementById("vjsplayer");
    r && (r.style.width = "100%", r.style.float = "none");
  }
  removeAd() {
    var r, i;
    this.insideAdActive = !1, (r = document.getElementById("split-ad-container")) == null || r.remove(), (i = document.getElementById("streann-splitad")) == null || i.remove();
    const e = document.getElementById("vjsplayer");
    e && (e.style.width = "100%", e.style.float = "none");
    const t = document.querySelector("body");
    t && (t.classList.remove("flex-row-reverse"), t.classList.add("flex-column"));
  }
  cleanupExistingAdContainer() {
    const e = document.getElementById("split-ad-container");
    e && e.remove();
    const t = document.getElementById("streann-splitad");
    t && t.remove();
  }
}
class Ot {
  info(...e) {
    console.info(
      "%c streann.com(cornerAd) %c",
      "background: orange; color: black; display: block;border-radius: 2px; padding: 2px;",
      "background: white; color: black;",
      ...e
    );
  }
  warn(...e) {
    console.warn(
      "%c streann.com(cornerAd) %c",
      "background: orange; color: black; display: block;border-radius: 2px; padding: 2px;",
      "background: white; color: black;",
      ...e
    );
  }
  error(...e) {
    console.error(
      "%c streann.com(cornerAd) %c",
      "background: orange; color: black; display: block;border-radius: 2px; padding: 2px;",
      "background: white; color: black;",
      ...e
    );
  }
}
const Pt = new Ot();
window.insideAd = {
  initialize: kt,
  debug: !0
};
function kt(n) {
  T.isAlreadyInit || !n.apiKey && !n.apiToken && !n.baseUrl || (T.apiKey = n.apiKey, T.apiToken = n.apiToken, T.baseUrl = n.baseUrl, T.isAlreadyInit = !0, Pt.info("ADS 19.06.2026 | V.3.7.2"), n.apiKey && j.initialize(n.apiKey), pt(), le());
}
let re;
async function le() {
  const n = await He(), { campaign: e, filteredPlacements: t } = qe(n);
  if (!e || t.length === 0)
    return;
  const r = new Ke(e, le), i = t.find(
    (s) => s.viewType == D.CORNER
  );
  i && (re = new ne(
    i,
    i.ad,
    r
  ));
  const o = t.find(
    (s) => s.viewType == D.SPLIT_AD
  );
  o && new Dt(
    o,
    o.ad,
    r
  );
  const a = t.find(
    (s) => s.viewType == D.ADHESION
  );
  a && Me.setAd(a, a.ad), t.filter((s) => s.viewType == D.EMBED).forEach((s) => new Bt(s, s.ad));
}
let Mt = window.location.pathname;
function _t() {
  Mt != window.location.pathname && (w.clearAllSlots(), re && re.handleOnCloseButton(), Me.onAdFinish(), le());
}
window.addEventListener("locationchange", function() {
  _t();
});
(() => {
  let n = history.pushState;
  history.pushState = function() {
    let r = n.apply(this, arguments);
    return window.dispatchEvent(new Event("pushstate")), window.dispatchEvent(new Event("locationchange")), r;
  };
  let e = history.replaceState;
  history.replaceState = function() {
    let r = e.apply(this, arguments);
    return window.dispatchEvent(new Event("replacestate")), window.dispatchEvent(new Event("locationchange")), r;
  }, window.addEventListener("popstate", () => {
    window.dispatchEvent(new Event("locationchange"));
  });
})();
