(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 Ve = Object.defineProperty;
var Fe = (t, e, n) => e in t ? Ve(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var l = (t, e, n) => (Fe(t, typeof e != "symbol" ? e + "" : e, n), n);
var k = /* @__PURE__ */ ((t) => (t.CORNER = "CORNER", t.EMBED = "EMBED", t.ADHESION = "ADHESION", t.EMBED_FLOAT = "EMBED_FLOAT", t.SPLIT_AD = "SPLIT_AD", t))(k || {}), R = /* @__PURE__ */ ((t) => (t.VAST = "VAST", t.BANNER = "BANNER", t.LOCAL_VIDEO = "LOCAL_VIDEO", t.LOCAL_IMAGE = "LOCAL_IMAGE", t))(R || {}), Se = /* @__PURE__ */ ((t) => (t[t.SUNDAY = 0] = "SUNDAY", t[t.MONDAY = 1] = "MONDAY", t[t.TUESDAY = 2] = "TUESDAY", t[t.WEDNESDAY = 3] = "WEDNESDAY", t[t.THURSDAY = 4] = "THURSDAY", t[t.FRIDAY = 5] = "FRIDAY", t[t.SATURDAY = 6] = "SATURDAY", t))(Se || {});
const v = {
  apiKey: "",
  apiToken: "",
  baseUrl: "",
  isAlreadyInit: !1
};
async function He() {
  const t = await xe();
  localStorage.setItem("streannCountryId", t.countryCode);
  const e = await fetch(
    `${v.baseUrl}v1/r/${v.apiKey}/campaigns/WEB?country=${t.countryCode}`,
    {
      method: "GET",
      headers: new Headers({
        Authorization: `ApiToken ${v.apiToken}`
      })
    }
  );
  if (e.status != 200)
    throw new Error("Someting went wrong fetching campaign err");
  return e.json();
}
async function xe() {
  const t = await fetch(`${v.baseUrl}v1/geo-ip-config`), { geoIpUrl: e } = await t.json();
  return await (await fetch(e)).json();
}
function ze() {
  return Object.values(Se)[(/* @__PURE__ */ new Date()).getDay()];
}
function he(t) {
  let e = t.reduce((o, s) => o + s.weight, 0), n = Math.floor(Math.random() * e) + 1, r = 0, i = null;
  for (let o of t)
    if (r += o.weight, n <= r) {
      i = o;
      break;
    }
  return i || t[0];
}
function ve(t) {
  return new Promise((e, n) => {
    const r = document.createElement("script");
    r.async = !0, r.src = t, r.onload = e, r.onerror = n, document.body.appendChild(r);
  });
}
function Ye(t) {
  const e = Date.now(), n = new Date(t.startDate), r = new Date(t.endDate);
  return n.getTime() <= e && r.getTime() >= e;
}
function je(t) {
  if (!t.timePeriods)
    return !0;
  const e = ze(), n = /* @__PURE__ */ new Date();
  return t.timePeriods.every((i) => {
    const [o, s, a] = i.startTime.split(":").map(Number), c = /* @__PURE__ */ new Date();
    c.setHours(o), c.setMinutes(s), c.setSeconds(a);
    const [E, g, f] = i.endTime.split(":").map(Number), h = /* @__PURE__ */ new Date();
    return h.setHours(E), h.setMinutes(g), h.setSeconds(f), i.daysOfWeek.includes(e) && c <= n && h >= n;
  });
}
function Ge(t) {
  const e = location.host.replace(/^www\./, ""), n = t.replace(/^https?:\/\//, "").replace(/^www\./, "");
  return e === n;
}
function Te(t) {
  if (t.domain) {
    if (t.domain.includes(location.host) || Ge(t.domain)) {
      if (t.absolutePath && t.absolutePath.length > 0)
        return !!t.absolutePath.some((e) => e === location.pathname);
      if (t.tags && t.tags.length)
        return t.tags.some((e) => location.pathname.includes(e));
    }
    return !1;
  } else {
    if (t.absolutePath && t.absolutePath.length > 0)
      return !!t.absolutePath.some((e) => e === location.pathname);
    if (t.tags && t.tags.length)
      return t.tags.some((e) => location.pathname.includes(e));
  }
  return !0;
}
function qe(t) {
  const e = t.placements.filter(Te).filter(be);
  return !(!e || e.length == 0);
}
function be(t) {
  var i, o;
  const e = (o = (i = t.properties) == null ? void 0 : i.webSettings) == null ? void 0 : o.screens;
  let n = "";
  const r = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
  return r <= 425 ? n = "MOBILE" : r <= 768 ? n = "TABLET" : n = "DESKTOP", e ? e.includes(n) : !0;
}
function Ke(t) {
  const e = t.filter(Ye).filter(je);
  if (e.length == 0)
    throw new Error("No valid campaigns");
  let n;
  if (e.length > 1 ? n = he(e.filter(qe)) : n = e[0], !n)
    throw new Error("No valid campaign");
  const r = n.placements.filter(Te).filter(be);
  if (r.length == 0)
    throw new Error("No valid placement Tag");
  const i = r.map(
    (o) => o.ads.length > 1 ? { ...o, ad: he(o.ads) } : { ...o, ad: o.ads[0] }
  );
  return { campaign: n, filteredPlacements: i };
}
class We {
  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 d = new We();
class Xe {
  constructor(e, n) {
    l(this, "campaing");
    l(this, "refresh");
    l(this, "refreshTimeout");
    this.campaing = e, this.refresh = n;
  }
  insideAdReceived(e) {
    d.info("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) {
    d.info("insideAdError", e);
  }
  insideAdVolumeChanged(e) {
    d.info("insideAdVolumeChanged", e);
  }
  clearRefreshTimeout() {
    clearTimeout(this.refreshTimeout);
  }
}
const $e = "https://imasdk.googleapis.com/js/sdkloader/ima3.js";
let O = null;
const fe = () => {
  O = null;
}, Ne = () => {
  const t = window;
  return t.google && t.google.ima ? Promise.resolve(t.google.ima) : O || (O = ve($e).then(() => t.google.ima), O.then(fe).catch(fe), O);
}, Qe = "https://securepubads.g.doubleclick.net/tag/js/gpt.js", Je = () => {
  const t = window;
  return t.googletag && t.googletag.apiReady ? Promise.resolve(t.googletag) : ve(Qe).then(() => t.googletag);
};
var Q = function(t, e) {
  return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
    n.__proto__ = r;
  } || function(n, r) {
    for (var i in r)
      Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
  }, Q(t, e);
};
function Y(t, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
  Q(t, e);
  function n() {
    this.constructor = t;
  }
  t.prototype = e === null ? Object.create(e) : (n.prototype = e.prototype, new n());
}
function J(t) {
  var e = typeof Symbol == "function" && Symbol.iterator, n = e && t[e], r = 0;
  if (n)
    return n.call(t);
  if (t && typeof t.length == "number")
    return {
      next: function() {
        return t && r >= t.length && (t = void 0), { value: t && t[r++], done: !t };
      }
    };
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function H(t, e) {
  var n = typeof Symbol == "function" && t[Symbol.iterator];
  if (!n)
    return t;
  var r = n.call(t), i, o = [], s;
  try {
    for (; (e === void 0 || e-- > 0) && !(i = r.next()).done; )
      o.push(i.value);
  } catch (a) {
    s = { error: a };
  } finally {
    try {
      i && !i.done && (n = r.return) && n.call(r);
    } finally {
      if (s)
        throw s.error;
    }
  }
  return o;
}
function x(t, e, n) {
  if (n || 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 t.concat(o || Array.prototype.slice.call(e));
}
function N(t) {
  return typeof t == "function";
}
function Ie(t) {
  var e = function(r) {
    Error.call(r), r.stack = new Error().stack;
  }, n = t(e);
  return n.prototype = Object.create(Error.prototype), n.prototype.constructor = n, n;
}
var X = Ie(function(t) {
  return function(n) {
    t(this), this.message = n ? n.length + ` errors occurred during unsubscription:
` + n.map(function(r, i) {
      return i + 1 + ") " + r.toString();
    }).join(`
  `) : "", this.name = "UnsubscriptionError", this.errors = n;
  };
});
function Z(t, e) {
  if (t) {
    var n = t.indexOf(e);
    0 <= n && t.splice(n, 1);
  }
}
var j = function() {
  function t(e) {
    this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
  }
  return t.prototype.unsubscribe = function() {
    var e, n, r, i, o;
    if (!this.closed) {
      this.closed = !0;
      var s = this._parentage;
      if (s)
        if (this._parentage = null, Array.isArray(s))
          try {
            for (var a = J(s), c = a.next(); !c.done; c = a.next()) {
              var E = c.value;
              E.remove(this);
            }
          } catch (y) {
            e = { error: y };
          } finally {
            try {
              c && !c.done && (n = a.return) && n.call(a);
            } finally {
              if (e)
                throw e.error;
            }
          }
        else
          s.remove(this);
      var g = this.initialTeardown;
      if (N(g))
        try {
          g();
        } catch (y) {
          o = y instanceof X ? y.errors : [y];
        }
      var f = this._finalizers;
      if (f) {
        this._finalizers = null;
        try {
          for (var h = J(f), S = h.next(); !S.done; S = h.next()) {
            var w = S.value;
            try {
              me(w);
            } catch (y) {
              o = o ?? [], y instanceof X ? o = x(x([], H(o)), H(y.errors)) : o.push(y);
            }
          }
        } catch (y) {
          r = { error: y };
        } finally {
          try {
            S && !S.done && (i = h.return) && i.call(h);
          } finally {
            if (r)
              throw r.error;
          }
        }
      }
      if (o)
        throw new X(o);
    }
  }, t.prototype.add = function(e) {
    var n;
    if (e && e !== this)
      if (this.closed)
        me(e);
      else {
        if (e instanceof t) {
          if (e.closed || e._hasParent(this))
            return;
          e._addParent(this);
        }
        (this._finalizers = (n = this._finalizers) !== null && n !== void 0 ? n : []).push(e);
      }
  }, t.prototype._hasParent = function(e) {
    var n = this._parentage;
    return n === e || Array.isArray(n) && n.includes(e);
  }, t.prototype._addParent = function(e) {
    var n = this._parentage;
    this._parentage = Array.isArray(n) ? (n.push(e), n) : n ? [n, e] : e;
  }, t.prototype._removeParent = function(e) {
    var n = this._parentage;
    n === e ? this._parentage = null : Array.isArray(n) && Z(n, e);
  }, t.prototype.remove = function(e) {
    var n = this._finalizers;
    n && Z(n, e), e instanceof t && e._removeParent(this);
  }, t.EMPTY = function() {
    var e = new t();
    return e.closed = !0, e;
  }(), t;
}(), we = j.EMPTY;
function Re(t) {
  return t instanceof j || t && "closed" in t && N(t.remove) && N(t.add) && N(t.unsubscribe);
}
function me(t) {
  N(t) ? t() : t.unsubscribe();
}
var Ce = {
  onUnhandledError: null,
  onStoppedNotification: null,
  Promise: void 0,
  useDeprecatedSynchronousErrorHandling: !1,
  useDeprecatedNextContext: !1
}, ee = {
  setTimeout: function(t, e) {
    for (var n = [], r = 2; r < arguments.length; r++)
      n[r - 2] = arguments[r];
    var i = ee.delegate;
    return i != null && i.setTimeout ? i.setTimeout.apply(i, x([t, e], H(n))) : setTimeout.apply(void 0, x([t, e], H(n)));
  },
  clearTimeout: function(t) {
    var e = ee.delegate;
    return ((e == null ? void 0 : e.clearTimeout) || clearTimeout)(t);
  },
  delegate: void 0
};
function Ze(t) {
  ee.setTimeout(function() {
    throw t;
  });
}
function Ee() {
}
function V(t) {
  t();
}
var Be = function(t) {
  Y(e, t);
  function e(n) {
    var r = t.call(this) || this;
    return r.isStopped = !1, n ? (r.destination = n, Re(n) && n.add(r)) : r.destination = rt, r;
  }
  return e.create = function(n, r, i) {
    return new te(n, r, i);
  }, e.prototype.next = function(n) {
    this.isStopped || this._next(n);
  }, e.prototype.error = function(n) {
    this.isStopped || (this.isStopped = !0, this._error(n));
  }, e.prototype.complete = function() {
    this.isStopped || (this.isStopped = !0, this._complete());
  }, e.prototype.unsubscribe = function() {
    this.closed || (this.isStopped = !0, t.prototype.unsubscribe.call(this), this.destination = null);
  }, e.prototype._next = function(n) {
    this.destination.next(n);
  }, e.prototype._error = function(n) {
    try {
      this.destination.error(n);
    } finally {
      this.unsubscribe();
    }
  }, e.prototype._complete = function() {
    try {
      this.destination.complete();
    } finally {
      this.unsubscribe();
    }
  }, e;
}(j), et = Function.prototype.bind;
function $(t, e) {
  return et.call(t, e);
}
var tt = function() {
  function t(e) {
    this.partialObserver = e;
  }
  return t.prototype.next = function(e) {
    var n = this.partialObserver;
    if (n.next)
      try {
        n.next(e);
      } catch (r) {
        _(r);
      }
  }, t.prototype.error = function(e) {
    var n = this.partialObserver;
    if (n.error)
      try {
        n.error(e);
      } catch (r) {
        _(r);
      }
    else
      _(e);
  }, t.prototype.complete = function() {
    var e = this.partialObserver;
    if (e.complete)
      try {
        e.complete();
      } catch (n) {
        _(n);
      }
  }, t;
}(), te = function(t) {
  Y(e, t);
  function e(n, r, i) {
    var o = t.call(this) || this, s;
    if (N(n) || !n)
      s = {
        next: n ?? void 0,
        error: r ?? void 0,
        complete: i ?? void 0
      };
    else {
      var a;
      o && Ce.useDeprecatedNextContext ? (a = Object.create(n), a.unsubscribe = function() {
        return o.unsubscribe();
      }, s = {
        next: n.next && $(n.next, a),
        error: n.error && $(n.error, a),
        complete: n.complete && $(n.complete, a)
      }) : s = n;
    }
    return o.destination = new tt(s), o;
  }
  return e;
}(Be);
function _(t) {
  Ze(t);
}
function nt(t) {
  throw t;
}
var rt = {
  closed: !0,
  next: Ee,
  error: nt,
  complete: Ee
}, it = function() {
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
}();
function ot(t) {
  return t;
}
function st(t) {
  return t.length === 0 ? ot : t.length === 1 ? t[0] : function(n) {
    return t.reduce(function(r, i) {
      return i(r);
    }, n);
  };
}
var ye = function() {
  function t(e) {
    e && (this._subscribe = e);
  }
  return t.prototype.lift = function(e) {
    var n = new t();
    return n.source = this, n.operator = e, n;
  }, t.prototype.subscribe = function(e, n, r) {
    var i = this, o = dt(e) ? e : new te(e, n, r);
    return V(function() {
      var s = i, a = s.operator, c = s.source;
      o.add(a ? a.call(o, c) : c ? i._subscribe(o) : i._trySubscribe(o));
    }), o;
  }, t.prototype._trySubscribe = function(e) {
    try {
      return this._subscribe(e);
    } catch (n) {
      e.error(n);
    }
  }, t.prototype.forEach = function(e, n) {
    var r = this;
    return n = Ae(n), new n(function(i, o) {
      var s = new te({
        next: function(a) {
          try {
            e(a);
          } catch (c) {
            o(c), s.unsubscribe();
          }
        },
        error: o,
        complete: i
      });
      r.subscribe(s);
    });
  }, t.prototype._subscribe = function(e) {
    var n;
    return (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e);
  }, t.prototype[it] = function() {
    return this;
  }, t.prototype.pipe = function() {
    for (var e = [], n = 0; n < arguments.length; n++)
      e[n] = arguments[n];
    return st(e)(this);
  }, t.prototype.toPromise = function(e) {
    var n = this;
    return e = Ae(e), new e(function(r, i) {
      var o;
      n.subscribe(function(s) {
        return o = s;
      }, function(s) {
        return i(s);
      }, function() {
        return r(o);
      });
    });
  }, t.create = function(e) {
    return new t(e);
  }, t;
}();
function Ae(t) {
  var e;
  return (e = t ?? Ce.Promise) !== null && e !== void 0 ? e : Promise;
}
function at(t) {
  return t && N(t.next) && N(t.error) && N(t.complete);
}
function dt(t) {
  return t && t instanceof Be || at(t) && Re(t);
}
var ct = Ie(function(t) {
  return function() {
    t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
  };
}), Le = function(t) {
  Y(e, t);
  function e() {
    var n = t.call(this) || this;
    return n.closed = !1, n.currentObservers = null, n.observers = [], n.isStopped = !1, n.hasError = !1, n.thrownError = null, n;
  }
  return e.prototype.lift = function(n) {
    var r = new ge(this, this);
    return r.operator = n, r;
  }, e.prototype._throwIfClosed = function() {
    if (this.closed)
      throw new ct();
  }, e.prototype.next = function(n) {
    var r = this;
    V(function() {
      var i, o;
      if (r._throwIfClosed(), !r.isStopped) {
        r.currentObservers || (r.currentObservers = Array.from(r.observers));
        try {
          for (var s = J(r.currentObservers), a = s.next(); !a.done; a = s.next()) {
            var c = a.value;
            c.next(n);
          }
        } catch (E) {
          i = { error: E };
        } finally {
          try {
            a && !a.done && (o = s.return) && o.call(s);
          } finally {
            if (i)
              throw i.error;
          }
        }
      }
    });
  }, e.prototype.error = function(n) {
    var r = this;
    V(function() {
      if (r._throwIfClosed(), !r.isStopped) {
        r.hasError = r.isStopped = !0, r.thrownError = n;
        for (var i = r.observers; i.length; )
          i.shift().error(n);
      }
    });
  }, e.prototype.complete = function() {
    var n = this;
    V(function() {
      if (n._throwIfClosed(), !n.isStopped) {
        n.isStopped = !0;
        for (var r = n.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 n;
      return ((n = this.observers) === null || n === void 0 ? void 0 : n.length) > 0;
    },
    enumerable: !1,
    configurable: !0
  }), e.prototype._trySubscribe = function(n) {
    return this._throwIfClosed(), t.prototype._trySubscribe.call(this, n);
  }, e.prototype._subscribe = function(n) {
    return this._throwIfClosed(), this._checkFinalizedStatuses(n), this._innerSubscribe(n);
  }, e.prototype._innerSubscribe = function(n) {
    var r = this, i = this, o = i.hasError, s = i.isStopped, a = i.observers;
    return o || s ? we : (this.currentObservers = null, a.push(n), new j(function() {
      r.currentObservers = null, Z(a, n);
    }));
  }, e.prototype._checkFinalizedStatuses = function(n) {
    var r = this, i = r.hasError, o = r.thrownError, s = r.isStopped;
    i ? n.error(o) : s && n.complete();
  }, e.prototype.asObservable = function() {
    var n = new ye();
    return n.source = this, n;
  }, e.create = function(n, r) {
    return new ge(n, r);
  }, e;
}(ye), ge = function(t) {
  Y(e, t);
  function e(n, r) {
    var i = t.call(this) || this;
    return i.destination = n, i.source = r, i;
  }
  return e.prototype.next = function(n) {
    var r, i;
    (i = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || i === void 0 || i.call(r, n);
  }, e.prototype.error = function(n) {
    var r, i;
    (i = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || i === void 0 || i.call(r, n);
  }, e.prototype.complete = function() {
    var n, r;
    (r = (n = this.destination) === null || n === void 0 ? void 0 : n.complete) === null || r === void 0 || r.call(n);
  }, e.prototype._subscribe = function(n) {
    var r, i;
    return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(n)) !== null && i !== void 0 ? i : we;
  }, e;
}(Le);
const De = new Le();
function F(t) {
  De.next(t);
}
function lt() {
  return De.asObservable();
}
class ut {
  constructor() {
    l(this, "googletag");
    l(this, "timeOutCornerBanner");
    l(this, "timeOutAdhesion");
    l(this, "insideAdCallback");
    l(this, "onCornerBannerFinish");
    l(this, "onCornerBannerLoaded");
    l(this, "mapBanners", /* @__PURE__ */ new Map());
    l(this, "onSlotRender", (e) => {
      const n = e.slot, r = n.getSlotElementId(), i = this.mapBanners.get(r);
      i && (e.isEmpty ? (d.warn("Banner slot rendered EMPTY", {
        slotId: r,
        bannerUrl: i.url,
        bannerType: i.type,
        adUnitPath: n.getAdUnitPath(),
        size: e.size,
        creativeId: e.creativeId,
        lineItemId: e.lineItemId
      }), i.type === "CORNER" && this.onCornerBannerFinish(!0), i.type === "ADHESION" && F("ERROR")) : (d.info("Banner slot rendered SUCCESSFULLY", {
        slotId: r,
        bannerUrl: i.url,
        size: e.size,
        creativeId: e.creativeId,
        lineItemId: e.lineItemId,
        advertiserId: e.advertiserId
      }), i.type === "CORNER" && this.onCornerBannerLoaded && this.onCornerBannerLoaded(), i.type === "ADHESION" && F("STARTED")));
    });
    l(this, "onViewableListener", (e) => {
      const n = e.slot, r = this.mapBanners.get(n.getSlotElementId());
      r && (r.type === "CORNER" ? this.timeOutCornerBanner = setTimeout(() => {
        if (!this.checkIfBannerExist(n.getSlotElementId())) {
          d.error("Banner not found refreshing false");
          return;
        }
        this.destroyCornerAdBanner();
      }, r.duration * 1e3) : r.type === "ADHESION" ? this.timeOutAdhesion = setTimeout(() => {
        if (!this.checkIfBannerExist(n.getSlotElementId())) {
          d.error("Banner not found refreshing false");
          return;
        }
        this.removeBanner(r.id);
      }, r.duration * 1e3) : setTimeout(() => {
        if (!this.checkIfBannerExist(n.getSlotElementId())) {
          d.error("Banner not found refreshing false");
          return;
        }
        d.info("Refreshing banner", r == null ? void 0 : r.id), this.googletag.pubads().refresh([n]);
      }, r.duration * 1e3));
    });
    Je().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 n = e.slot;
        this.mapBanners.get(n.getSlotElementId()) && d.info("Banner ad REQUEST sent to Google", {
          slotId: n.getSlotElementId(),
          adUnitPath: n.getAdUnitPath(),
          targetingKeys: n.getTargetingKeys()
        });
      }), this.googletag.pubads().addEventListener("slotResponseReceived", (e) => {
        const n = e.slot;
        this.mapBanners.get(n.getSlotElementId()) && d.info("Banner ad RESPONSE received from Google", {
          slotId: n.getSlotElementId(),
          adUnitPath: n.getAdUnitPath()
        });
      }), this.googletag.pubads().setCentering(!0), this.googletag.enableServices();
    });
  }
  checkIfBannerExist(e) {
    return this.mapBanners.has(e);
  }
  mapToBannerSizes(e) {
    const n = [];
    return e.forEach(({ width: r, height: i }) => {
      n.push([r, i]);
    }), n;
  }
  addBanners(e) {
    this.googletag.cmd.push(() => {
      e.forEach((n) => {
        if (n.type == "CORNER") {
          const o = document.querySelector("#streann-node");
          if (!o) {
            d.warn("streann-node not found - cannot insert corner banner"), setTimeout(() => this.addBanners([n]), 500);
            return;
          }
          const s = o.querySelector("#page-content");
          s && s.remove(), document.getElementById(n.id) || o.insertAdjacentHTML("beforeend", `<div id="${n.id}"></div>`);
          const a = this.mapBanners.get(n.id);
          if (a)
            try {
              this.googletag.destroySlots([a.slot]), this.mapBanners.delete(n.id), d.info("Destroyed existing banner slot", n.id);
            } catch (c) {
              d.warn("Error destroying existing slot:", c), this.mapBanners.delete(n.id);
            }
        }
        const r = this.mapToBannerSizes(n.sizes);
        d.info("Attempting to define banner slot", {
          adUnitPath: n.url,
          sizes: r,
          elementId: n.id,
          bannerType: n.type
        });
        const i = this.googletag.defineSlot(
          n.url,
          r,
          n.id
        );
        if (!i) {
          d.warn("Banner cannot be defined", n), n.type === "CORNER" && this.onCornerBannerFinish && this.onCornerBannerFinish(!0);
          return;
        }
        d.info("Banner defined successfully", {
          adUnitPath: i.getAdUnitPath(),
          slotElementId: i.getSlotElementId()
        }), i.addService(this.googletag.pubads()), this.mapBanners.set(n.id, { ...n, slot: i }), d.info("Calling googletag.display() for banner", n.id), this.googletag.display(n.id);
      });
    });
  }
  removeBanner(e) {
    const n = this.mapBanners.get(e);
    if (n) {
      if (n.type === "ADHESION") {
        F("FINISHED"), clearTimeout(this.timeOutAdhesion), this.clearSlot(n.slot), this.mapBanners.delete(e);
        return;
      }
      this.clearSlot(n.slot);
    }
  }
  addCallback(e, n, r) {
    this.insideAdCallback = e, this.onCornerBannerFinish = n, 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]), d.info("Destroyed corner banner slot");
      } catch (n) {
        d.warn("Error destroying corner banner slot:", n);
      }
    }), this.onCornerBannerFinish(!1), this.insideAdCallback && this.insideAdCallback.insideAdStop());
  }
  clearSlot(e) {
    this.googletag.cmd.push(() => {
      const n = this.googletag.pubads().clear([e]);
      d.info("clearing slot", e, "is Cleared", n);
      try {
        const r = e.getSlotElementId();
        this.mapBanners.has(r) && (this.mapBanners.delete(r), d.info("deleted banner mapping for", r));
      } catch (r) {
        d.warn("Could not delete banner map entry:", r);
      }
    });
  }
  clearAllSlots() {
    this.googletag.cmd.push(() => {
    }), this.mapBanners.clear();
  }
}
const D = new ut(), pt = {
  "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 ht(t) {
  return pt[t];
}
let M = null;
async function ft() {
  if (M)
    return M;
  try {
    const t = await fetch(`${v.baseUrl}v1/geo-ip-config`), { geoIpUrl: e } = await t.json(), r = await (await fetch(e)).json();
    return M = {
      country: r.countryCode || r.country || "",
      city: r.city || "",
      state: r.region || r.state || "",
      zip: r.zip || r.PostalCode || ""
    }, M;
  } catch {
    return {
      country: "",
      city: "",
      state: "",
      zip: ""
    };
  }
}
function mt() {
  return M;
}
const Et = "3.6.7";
class yt {
  constructor() {
    l(this, "initialized", !1);
    l(this, "writeKey");
    l(this, "resellerId");
  }
  initialize(e) {
    this.initialized || (this.resellerId = e, this.writeKey = ht(e), this.writeKey && (this.loadSegmentSnippet(this.writeKey), this.initialized = !0));
  }
  getCommonProperties() {
    const e = mt();
    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: Et
    };
  }
  loadSegmentSnippet(e) {
    const n = window.analytics = window.analytics || [];
    if (!n.initialize) {
      if (n.invoked)
        return;
      n.invoked = !0, n.methods = [
        "trackSubmit",
        "trackClick",
        "trackLink",
        "trackForm",
        "pageview",
        "identify",
        "reset",
        "group",
        "track",
        "ready",
        "alias",
        "debug",
        "page",
        "once",
        "off",
        "on",
        "addSourceMiddleware",
        "addIntegrationMiddleware",
        "setAnonymousId",
        "addDestinationMiddleware"
      ], n.factory = function(r) {
        return function(...i) {
          return i.unshift(r), n.push(i), n;
        };
      };
      for (const r of n.methods)
        n[r] = n.factory(r);
      n.load = function(r, i) {
        var a;
        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 s = document.getElementsByTagName("script")[0];
        (a = s == null ? void 0 : s.parentNode) == null || a.insertBefore(o, s), n._loadOptions = i;
      }, n._writeKey = e, n.SNIPPET_VERSION = "4.15.3", n.load(e), n.page();
    }
  }
  track(e, n) {
    if (this.initialized)
      try {
        const r = window.analytics;
        if (r && r.track) {
          const i = {
            ...this.getCommonProperties(),
            ...n
          };
          r.track(e, i);
        }
      } catch (r) {
        d.error(`Error tracking Segment event: ${e}`, r);
      }
  }
  trackAdRequested(e) {
    this.track("Ad Requested", {
      screen: e
    });
  }
  trackAdDisplayed(e, n, r) {
    this.track("Ad Displayed", {
      adName: e,
      adType: n,
      screen: r
    });
  }
  trackAdFailed(e, n) {
    this.track("Ad Failed", {
      screen: e,
      error: n
    });
  }
}
const G = new yt();
let m, A, U, q, C, B, p, K, se, u, W, ne, z = !1, T = 0;
const Oe = `
<div id="page-content">
    <div id="video-container">
      <video id="video-element" src="">
      </video>
      <div id="ad-container"></div>
    </div>
</div>
`, At = `
<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 ae = "", I, b = null;
function gt(t, e, n, r, i, o) {
  T++;
  const s = T;
  i && o && (b = {
    adName: i.name,
    adType: i.adType,
    screen: o
  }), d.info("initImaSdk called - starting VAST ad request", {
    vastUrl: e,
    sessionId: s,
    timestamp: (/* @__PURE__ */ new Date()).toISOString()
  }), Ne().then((a) => {
    var g;
    if (s !== T) {
      d.warn("STALE SESSION detected - ad request cancelled", {
        requestedSessionId: s,
        currentSessionId: T
      });
      return;
    }
    W = n, ne = r, I = t, (g = document.querySelector("#streann-node")) == null || g.insertAdjacentHTML("beforeend", Oe), u = a, ae = Pe(e), p = document.getElementById("video-element"), q = document.getElementById("playButton"), C = document.getElementById("mute"), B = document.getElementById("un-mute"), B.style.display = "none", C.style.display = "none";
    const c = document.getElementById("cornerCloseButton"), E = document.getElementById("streann-logo");
    c && (c.style.display = "none"), E && (E.style.display = "none"), Nt(), ke();
  }).catch((a) => {
    d.error("Fail loading ima", a);
  });
}
function St(t, e, n, r, i, o) {
  i && o && (b = {
    adName: i.name,
    adType: i.adType,
    screen: o
  }), Ne().then((s) => {
    W = n, I = t;
    const a = document.getElementById(r);
    if (a)
      a.insertAdjacentHTML("beforeend", At);
    else {
      console.error(`Container with id ${r} not found`);
      return;
    }
    u = s, ae = Pe(e), p = a.querySelector("#video-element"), q = a.querySelector("#playButton"), It(r), ke();
  }).catch((s) => {
    d.error("Fail loading ima", s);
  });
}
function Pe(t) {
  switch (!0) {
    case t.includes("[STREANN-PLAYER-HEIGHT]"):
      return t.replace("[STREANN-PLAYER-HEIGHT]", window.innerHeight.toString());
    case t.includes("[STREANN-PLAYER-WIDTH]"):
      return t.replace("[STREANN-PLAYER-WIDTH]", window.innerWidth.toString());
    case t.includes("[STREANN-APP-BUNDLE-ID]"):
      return t.replace("[STREANN-APP-BUNDLE-ID]", "");
    case t.includes("[STREANN-APP-NAME]"):
      return t.replace("[STREANN-APP-NAME]", "");
    case t.includes("[STREANN-APP-VERSION]"):
      return t.replace("[STREANN-APP-VERSION]", "");
    case t.includes("[STREANN-APP-DOMAIN]"):
      return t.replace("[STREANN-APP-DOMAIN]", "");
    case t.includes("[STREANN-APP-STORE-URL]"):
      return t.replace("[STREANN-APP-STORE-URL]", "");
    case t.includes("[STREANN-SITE-URL]"):
      return t.replace("[STREANN-SITE-URL]", `${window.location.origin}${window.location.pathname}`);
    case t.includes("[STREANN-CONTENT-ID]"): {
      const e = localStorage.getItem("streannContentId") || "";
      return t.replace("[STREANN-CONTENT-ID]", e);
    }
    case t.includes("[STREANN-CONTENT-TITLE]"): {
      const e = localStorage.getItem("streannContentTitle") || "";
      return t.replace("[STREANN-CONTENT-TITLE]", e);
    }
    case t.includes("[STREANN-CONTENT-LENGTH]"):
      return t.replace("[STREANN-CONTENT-LENGTH]", "");
    case t.includes("[STREANN-CONTENT-URL]"):
      return t.replace("[STREANN-CONTENT-URL]", window.location.href);
    case t.includes("[STREANN-CONTENT-ENCODED-URL]"):
      return t.replace("[STREANN-CONTENT-ENCODED-URL]", "");
    case t.includes("[STREANN-DESCRIPTION-URL]"):
      return t.replace("[STREANN-DESCRIPTION-URL]", "");
    case t.includes("[STREANN-DEVICE-ID]"):
      return t.replace("[STREANN-DEVICE-ID]", "");
    case t.includes("[STREANN-NETWORK]"):
      return t.replace("[STREANN-NETWORK]", "");
    case t.includes("[STREANN-CARRIER]"):
      return t.replace("[STREANN-CARRIER]", "");
    case t.includes("[STREANN-DEVICE-MANUFACTURER]"):
      return t.replace("[STREANN-DEVICE-MANUFACTURER]", "");
    case t.includes("[STREANN-DEVICE-MODEL]"):
      return t.replace("[STREANN-DEVICE-MODEL]", "");
    case t.includes("[STREANN-DEVICE-OS]"):
      return t.replace("[STREANN-DEVICE-OS]", "");
    case t.includes("[STREANN-DEVICE-OS-VERSION]"):
      return t.replace("[STREANN-DEVICE-OS-VERSION]", "");
    case t.includes("[STREANN-DEVICE-TYPE]"):
      return t.replace("[STREANN-DEVICE-TYPE]", "web");
    case t.includes("[STREANN-IP]"):
      return t.replace("[STREANN-IP]", "https://geoip.streann.com/");
    case t.includes("[STREANN-UA]"):
      return t.replace("[STREANN-UA]", navigator.userAgent);
    case t.includes("[STREANN-IFA-TYPE]"):
      return t.replace("[STREANN-IFA-TYPE]", "");
    case t.includes("[STREANN-ADVERTISING-ID]"):
      return t.replace("[STREANN-ADVERTISING-ID]", "");
    case t.includes("[STREANN-ADVERTISING-ID-HEX]"):
      return t.replace("[STREANN-ADVERTISING-ID-HEX]", "");
    case t.includes("[STREANN-ADVERTISING-ID-MD5]"):
      return t.replace("[STREANN-ADVERTISING-ID-MD5]", "");
    case t.includes("[STREANN-IDFA]"):
      return t.replace("[STREANN-IDFA]", "");
    case t.includes("[STREANN-IDFA-MD5]"):
      return t.replace("[STREANN-IDFA-MD5]", "");
    case t.includes("[STREANN-IDFA-HEX]"):
      return t.replace("[STREANN-IDFA-HEX]", "");
    case t.includes("[STREANN-LOCATION-LAT]"):
      return t.replace("[STREANN-LOCATION-LAT]", "");
    case t.includes("[STREANN-LOCATION-LONG]"):
      return t.replace("[STREANN-LOCATION-LONG]", "");
    case t.includes("[STREANN-COUNTRY-ID]"): {
      const e = localStorage.getItem("streannCountryId") || "";
      return t.replace("[STREANN-COUNTRY-ID]", e);
    }
    case t.includes("[STREANN-DO-NOT-TRACK]"):
      return t.replace("[STREANN-DO-NOT-TRACK]", "");
    case t.includes("[STREANN-GDPR]"):
      return t.replace("[STREANN-GDPR]", "");
    case t.includes("[STREANN-GDPR-CONSENT]"):
      return t.replace("[STREANN-GDPR-CONSENT]", "");
    case t.includes("[STREANN-USER-BIRTHYEAR]"):
      return t.replace("[STREANN-USER-BIRTHYEAR]", "");
    case t.includes("[STREANN-USER-GENDER]"):
      return t.replace("[STREANN-USER-GENDER]", "");
    case t.includes("[STREANN-CACHEBUSTER]"): {
      const e = () => Math.random().toString(36).substring(2, 12);
      return t.replace("[STREANN-CACHEBUSTER]", e());
    }
    case t.includes("[STREANN-US-PRIVACY]"):
      return t.replace("[STREANN-US-PRIVACY]", "");
    default:
      return t;
  }
}
function vt(t) {
  var i;
  (i = document.querySelector("#streann-node")) == null || i.insertAdjacentHTML("beforeend", Oe);
  const e = document.getElementById("video-element");
  q = document.getElementById("playButton"), C = document.getElementById("mute"), B = document.getElementById("un-mute");
  const n = document.getElementById("cornerCloseButton"), r = document.getElementById("streann-logo");
  n && (n.style.display = "none"), r && (r.style.display = "block"), e.src = t.url, e.load(), B.style.display = "block", C.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() {
    t.properties.clickThroughUrl && window.open(t.properties.clickThroughUrl, "_blank");
  }), e.addEventListener("ended", de), C.addEventListener("click", () => {
    e.muted = !0, C.style.display = "none", B.style.display = "block";
  }), B.addEventListener("click", () => {
    e.muted = !1, B.style.display = "none", C.style.display = "block";
  });
}
function de() {
  const t = document.getElementById("video-element");
  t && (t.pause(), t.removeEventListener("ended", de), t.style.display = "none");
  const e = document.getElementById("page-content");
  e && e.remove();
}
function ke() {
  p.volume = 0, p.muted = !0;
  const t = p.play();
  t !== void 0 && t.then(Tt).catch(bt);
}
function Tt() {
  p.pause(), K = !0, se = !0, Me();
}
function bt() {
  p.pause(), K = !0, se = !0, Me();
}
function Nt() {
  Rt(), A = new u.AdsLoader(U), A.getSettings().setDisableCustomPlaybackForIOS10Plus(!0), A.addEventListener(
    u.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
    Ue,
    !1
  ), z = !1, A.addEventListener(u.AdErrorEvent.Type.AD_ERROR, le, !1), p.onended = ce;
}
function It(t) {
  wt(t), A = new u.AdsLoader(U), A.addEventListener(
    u.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
    Ue,
    !1
  ), A.addEventListener(u.AdErrorEvent.Type.AD_ERROR, le, !1), p.onended = ce;
}
function wt(t) {
  var n;
  const e = (n = document.getElementById(t)) == null ? void 0 : n.querySelector("#ad-container");
  if (e.style.display = "none", !e) {
    console.error(`Ad container not found in ${t}`);
    return;
  }
  U = new u.AdDisplayContainer(e, p);
}
function ce() {
  p.onended = null, A && A.contentComplete();
}
function Me() {
  const t = new u.AdsRequest();
  t.adTagUrl = ae, t.linearAdSlotWidth = p.clientWidth, t.linearAdSlotHeight = p.clientHeight, t.nonLinearAdSlotWidth = p.clientWidth, t.nonLinearAdSlotHeight = p.clientHeight / 3, t.vastLoadTimeout = 1e4, t.setAdWillAutoPlay(K), t.setAdWillPlayMuted(se), A.requestAds(t), b && G.trackAdRequested(b.screen);
}
function Rt() {
  const t = document.getElementById("ad-container");
  if (!t) {
    console.error("NO AD CONTIANER");
    return;
  }
  U = new u.AdDisplayContainer(t, p);
}
function Ct() {
  try {
    U.initialize(), m.init(
      p.clientWidth,
      p.clientHeight,
      u.ViewMode.NORMAL
    ), m.start();
  } catch (t) {
    console.error(t), p.play();
  }
}
function Ue(t) {
  const e = new u.AdsRenderingSettings();
  e.restoreCustomPlaybackStateOnAdBreakComplete = !0, e.loadVideoTimeout = 15e3, m = t.getAdsManager(
    p,
    e
  ), m.setVolume(0), z = !1, m.addEventListener(u.AdErrorEvent.Type.AD_ERROR, le), m.addEventListener(
    u.AdEvent.Type.CONTENT_PAUSE_REQUESTED,
    Bt
  ), m.addEventListener(
    u.AdEvent.Type.CONTENT_RESUME_REQUESTED,
    Lt
  ), m.addEventListener(u.AdEvent.Type.ALL_ADS_COMPLETED, P), m.addEventListener(u.AdEvent.Type.LOADED, P), m.addEventListener(u.AdEvent.Type.STARTED, P), m.addEventListener(u.AdEvent.Type.IMPRESSION, P), m.addEventListener(u.AdEvent.Type.COMPLETE, P), K ? Ct() : q.style.display = "block";
}
function P(t) {
  var n;
  const e = t.getAd();
  switch (d.info(t), t.type) {
    case u.AdEvent.Type.LOADED:
      I.insideAdLoaded(), e.isLinear() || p.play();
      break;
    case u.AdEvent.Type.STARTED:
      I.insideAdPlay(), b && G.trackAdDisplayed(
        b.adName,
        b.adType,
        b.screen
      );
      const r = (n = document.getElementById("split-ad-container")) == null ? void 0 : n.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 u.AdEvent.Type.IMPRESSION:
      ue(!0), ne && ne();
      break;
    case u.AdEvent.Type.CLICK:
      I.insideAdClicked();
      break;
    case u.AdEvent.Type.SKIPPED:
      re(), I.insideAdSkipped();
      break;
    case u.AdEvent.Type.ALL_ADS_COMPLETED:
      re();
      break;
    case u.AdEvent.Type.COMPLETE:
      break;
  }
}
function le(t) {
  var n;
  if (z) {
    d.warn("VAST error BLOCKED - adErrorHandled flag already true", {
      errorCode: t.getError().getErrorCode(),
      errorMessage: t.getError().getMessage(),
      currentSessionId: T
    });
    return;
  }
  if (z = !0, d.error("VAST ad ERROR - triggering fallback", {
    errorCode: t.getError().getErrorCode(),
    errorMessage: t.getError().getMessage(),
    errorType: t.getError().getType(),
    sessionId: T
  }), b) {
    const r = `${t.getError().getErrorCode()}: ${t.getError().getMessage()}`;
    G.trackAdFailed(b.screen, r);
  }
  if (T++, d.info("Session ID incremented to prevent stale errors", {
    newSessionId: T
  }), (n = document.getElementById("split-ad-container")) == null || n.remove(), m)
    try {
      m.destroy();
    } catch {
    }
  if (A)
    try {
      A.contentComplete();
    } catch {
    }
  const e = document.getElementById("page-content");
  e && e.remove(), p && (p.onended = null, p.pause()), ue(!1), I.insideAdError(t.getError().toString()), d.info("VAST error cleanup complete - calling onAdFinish(true) to trigger waterfall"), W(!0);
}
function Bt() {
  p.pause(), p.onended = null;
}
function Lt() {
  p.onended = ce;
}
function re() {
  if (d.info("destoryIma called - cleaning up VAST ad", {
    sessionId: T
  }), T++, W(), ue(!1), m)
    try {
      m.destroy(), d.info("adsManager destroyed successfully");
    } catch (e) {
      d.warn("Error destroying adsManager:", e);
    }
  if (A)
    try {
      A.contentComplete(), d.info("adsLoader content complete called");
    } catch (e) {
      d.warn("Error calling adsLoader.contentComplete:", e);
    }
  const t = document.getElementById("page-content");
  t && t.remove(), I.insideAdStop();
}
function ue(t) {
  const e = document.getElementById("streann-logo");
  t ? e && (e.style.display = "block") : e && (e.style.display = "none");
}
const L = class L {
  constructor(e, n, r) {
    l(this, "placement");
    // private ad : any;
    l(this, "counterFailedCornerAd", 0);
    l(this, "insideAdCallback");
    l(this, "currentAd");
    l(this, "closeButtonTimer");
    l(this, "adInProgress", !1);
    l(this, "lastAttemptTime", 0);
    l(this, "currentAttemptCount", 0);
    l(this, "finishing", !1);
    this.placement = e, this.insideAdCallback = r;
    const i = 1;
    this.counterFailedCornerAd = 0, setTimeout(() => {
      this.startAd(n);
    }, 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, s, a;
    if (this.adInProgress) {
      d.warn("BLOCKED: Ad already in progress, skipping startAd", {
        blockedAdType: e.adType,
        blockedAdName: e.name,
        currentAdInProgress: (i = this.currentAd) == null ? void 0 : i.adType
      });
      return;
    }
    const n = Date.now(), r = n - this.lastAttemptTime;
    if (this.currentAttemptCount > 0 && r < L.MIN_RETRY_DELAY && this.lastAttemptTime > 0) {
      const c = L.MIN_RETRY_DELAY - r;
      d.warn("RATE LIMITED: Delaying startAd", {
        adType: e.adType,
        adName: e.name,
        delayMs: c
      }), setTimeout(() => this.startAd(e), c);
      return;
    }
    if (this.lastAttemptTime = n, this.currentAttemptCount++, d.info("Starting ad attempt", {
      adType: e.adType,
      adName: e.name,
      attemptNumber: this.currentAttemptCount,
      waterfallDepth: this.counterFailedCornerAd
    }), this.adInProgress = !0, this.currentAd = e, this.createCornerAdView(), e.adType == R.VAST) {
      const c = ((a = (s = (o = this.placement.properties) == null ? void 0 : o.webSettings) == null ? void 0 : s.screens) == null ? void 0 : a[0]) || window.location.pathname;
      gt(
        this.insideAdCallback,
        e.url,
        this.onAdFinish.bind(this),
        this.startCloseButtonTimer.bind(this),
        // Start timer only when VAST ad loads
        e,
        c
      );
    } else if (e.adType == R.BANNER) {
      D.addCallback(
        this.insideAdCallback,
        this.onAdFinish.bind(this),
        this.startCloseButtonTimer.bind(this)
        // Start timer only when banner loads
      );
      const c = {
        duration: e.properties.durationInSeconds,
        id: "corner-banner",
        sizes: e.properties.sizes,
        type: "CORNER",
        url: e.url
      };
      D.addBanners([c]);
    } else
      e.adType == R.LOCAL_VIDEO && vt(e);
  }
  createCornerAdView() {
    var r, i, o;
    if (document.getElementById("streann-node")) {
      const s = document.getElementById("cornerCloseButton");
      s && (s.style.display = "none");
      return;
    }
    const n = ((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;
    `;
    d.info("style", n), (o = document.querySelector("body")) == null || o.insertAdjacentHTML("beforeend", this.cornerElem(n || ""));
  }
  // 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 n = document.getElementById("cornerCloseButton");
        n && (n.onclick = this.handleOnCloseButton.bind(this), n.style.setProperty("display", "block"));
      }, Number(e) * 1e3);
    }
  }
  handleOnCloseButton() {
    var e, n, r;
    ((e = this.currentAd) == null ? void 0 : e.adType) == R.BANNER ? D.destroyCornerAdBanner() : ((n = this.currentAd) == null ? void 0 : n.adType) == R.VAST ? re() : ((r = this.currentAd) == null ? void 0 : r.adType) == R.LOCAL_VIDEO ? de() : d.error("Closing UnSupperoted ad type");
  }
  onAdFinish(e = !1) {
    var s, a, c, E, g, f, h, S;
    if (this.finishing)
      return;
    this.finishing = !0, this.adInProgress = !1, this.closeButtonTimer && (clearTimeout(this.closeButtonTimer), this.closeButtonTimer = void 0), d.info("cornerAd finished", {
      withError: e,
      failedAttempts: this.counterFailedCornerAd,
      currentAdType: (s = this.currentAd) == null ? void 0 : s.adType,
      currentAdName: (a = this.currentAd) == null ? void 0 : a.name,
      hasFallback: !!((c = this.currentAd) != null && c.fallback)
    });
    const n = (E = this.currentAd) == null ? void 0 : E.fallback;
    if (n && e && this.counterFailedCornerAd < 20) {
      d.info("cornerAd starting waterfall ad", {
        adId: n.id,
        adName: n.name,
        adType: n.adType,
        waterfallDepth: this.counterFailedCornerAd + 1
      }), this.counterFailedCornerAd++;
      const w = document.getElementById("cornerCloseButton"), y = document.getElementById("streann-logo");
      w && (w.style.display = "none"), y && (y.style.display = "none"), this.finishing = !1, setTimeout(() => {
        this.startAd(n);
      }, L.WATERFALL_RETRY_DELAY);
      return;
    }
    e && !n ? d.warn("cornerAd waterfall EXHAUSTED - no more fallbacks", {
      lastAdType: (g = this.currentAd) == null ? void 0 : g.adType,
      lastAdName: (f = this.currentAd) == null ? void 0 : f.name,
      totalAttempts: this.counterFailedCornerAd + 1
    }) : e && this.counterFailedCornerAd >= 20 && d.error("cornerAd waterfall MAX RETRIES reached", {
      lastAdType: (h = this.currentAd) == null ? void 0 : h.adType,
      lastAdName: (S = this.currentAd) == null ? void 0 : S.name,
      totalAttempts: this.counterFailedCornerAd + 1
    });
    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 w = document.getElementById("streann-node");
      w && w.remove(), this.finishing = !1, this.insideAdCallback && this.insideAdCallback.insideAdStop();
    }, r);
  }
};
l(L, "MIN_RETRY_DELAY", 1e3), // 1 second between attempts
l(L, "WATERFALL_RETRY_DELAY", 500);
let ie = L;
class Dt {
  constructor(e, n) {
    var c, E, g;
    const r = {
      id: "",
      duration: n.properties.durationInSeconds,
      sizes: n.properties.sizes,
      type: "EMBED",
      url: n.url
    }, i = (c = e.properties) == null ? void 0 : c.webSettings;
    if (!i) {
      d.error("invalid Embed placement with out web settings");
      return;
    }
    const { elemId: o, parentXpath: s, advancedScript: a } = i;
    if (o) {
      const f = document.getElementById(o);
      if (!f) {
        d.error("invalid element id");
        return;
      }
      const h = (g = (E = e.properties) == null ? void 0 : E.webSettings) == null ? void 0 : g.styles;
      h && f.setAttribute("style", h), r.id = o;
    } else if (s) {
      const f = this.getElementByXpath(s);
      if (!f) {
        d.error("invalid xpath");
        return;
      }
      if (document.getElementById(e.id))
        r.id = e.id;
      else {
        const S = this.generateElement(e);
        f.appendChild(S), r.id = e.id;
      }
    } else if (a) {
      const f = new Function(a)();
      if (!document.getElementById(f)) {
        d.error("invalid element id advanced script");
        return;
      }
      r.id = f;
    } else {
      d.error("invalid Embed placement with incorrect web settings");
      return;
    }
    D.addBanners([r]);
  }
  getElementByXpath(e) {
    return document.evaluate(
      e,
      document,
      null,
      XPathResult.FIRST_ORDERED_NODE_TYPE,
      null
    ).singleNodeValue;
  }
  generateElement(e) {
    var i, o;
    const n = document.createElement("div");
    n.setAttribute("id", e.id);
    const r = (o = (i = e.properties) == null ? void 0 : i.webSettings) == null ? void 0 : o.styles;
    return r && n.setAttribute("style", r), n;
  }
  randId() {
    return Math.random().toString(36).replace("0.", "inside-ad");
  }
}
class Ot {
  constructor() {
    l(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>`);
    l(this, "lastShownLocation", "");
    l(this, "adHesionTimeout");
  }
  setAd(e, n) {
    if (this.lastShownLocation == location.pathname)
      return;
    lt().subscribe({
      next: (i) => {
        switch (d.info("Adhesion Event", i), 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(n);
    }, Number(r) * 1e3)) : this.startAd(n);
  }
  onCloseButton() {
    D.removeBanner("adhesion");
  }
  createAdHeasonElem() {
    var n;
    (n = document.querySelector("body")) == null || n.insertAdjacentHTML("beforeend", this.adHeasonElem);
    const e = document.getElementById("adHesionCloseBtn");
    e && (e.style.setProperty("display", "block"), e.onclick = this.onCloseButton.bind(this));
  }
  startAd(e) {
    F("REQUESTED"), this.createAdHeasonElem();
    const n = {
      duration: e.properties.durationInSeconds,
      id: "adhesion",
      sizes: e.properties.sizes,
      type: "ADHESION",
      url: e.url
      // url: "/22290518902/flexflix_web_corner_rectangle",
    };
    D.addBanners([n]);
  }
  onAdFinish() {
    var e;
    (e = document.getElementById("streann-adhesion")) == null || e.remove();
  }
}
const _e = new Ot();
class Pt {
  constructor(e, n, r) {
    l(this, "placement");
    l(this, "ad");
    l(this, "insideAdCallback");
    l(this, "currentAd");
    l(this, "insideAdActive", !1);
    this.placement = e, this.ad = n, this.insideAdCallback = r, setTimeout(() => {
      this.startAd(n);
    }, 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 n = document.getElementById("ad-player");
    n ? (n.style.display = "none", n.addEventListener("play", () => {
      n.style.display = "block";
    }), n.src = e.url, n.muted = !0, n.autoplay = !0, n.play().catch((r) => {
      console.error("Error playing ad video:", r);
    }), n.addEventListener("ended", () => {
      var i;
      console.log("Ad finished playing"), (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 n = localStorage.getItem("streannShowSplitAd");
    if (this.cleanupExistingAdContainer(), !n || n === "false") {
      console.warn("No ads in player"), this.insideAdActive = !1;
      return;
    } else {
      this.currentAd = e;
      const s = document.querySelector("body");
      if (s && (s.classList.remove("flex-column"), s.classList.add("flex-row-reverse")), e.adType === "LOCAL_VIDEO")
        this.createSplitAdView(), this.initLocalVideoAd_(e);
      else if (e.adType === "VAST") {
        this.createSplitAdViewVast();
        const a = ((o = (i = (r = this.placement.properties) == null ? void 0 : r.webSettings) == null ? void 0 : i.screens) == null ? void 0 : o[0]) || window.location.pathname;
        St(this.insideAdCallback, e.url, this.removeAd, "split-ad-container", e, a);
      } 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 n = ((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(n)), this.showCloseButton(), this.showUnmuteButton();
  }
  showCloseButton() {
    if (this.placement.properties.showCloseButtonAfterSeconds != null) {
      const e = document.getElementById("cornerCloseSplitAdButton");
      if (!e)
        return;
      const n = this.placement.properties.showCloseButtonAfterSeconds;
      e.style.setProperty("display", "none"), setTimeout(() => {
        e.onclick = this.handleOnCloseButton.bind(this), e.style.setProperty("display", "block");
      }, Number(n) * 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"), n = document.getElementById("ad-player");
    !n || !e || (n.muted ? (n.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>`) : (n.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"), n = document.getElementById("ad-player");
    n && (n.pause(), n.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 n = document.querySelector("body");
    n && (n.classList.remove("flex-row-reverse"), n.classList.add("flex-column"));
  }
  cleanupExistingAdContainer() {
    const e = document.getElementById("split-ad-container");
    e && e.remove();
    const n = document.getElementById("streann-splitad");
    n && n.remove();
  }
}
window.insideAd = {
  initialize: kt,
  debug: !0
};
function kt(t) {
  if (!v.isAlreadyInit) {
    if (!t.apiKey && !t.apiToken && !t.baseUrl) {
      d.error("Invalid key config");
      return;
    }
    v.apiKey = t.apiKey, v.apiToken = t.apiToken, v.baseUrl = t.baseUrl, v.isAlreadyInit = !0, d.info("24.10.2025 12:10 | V.3.6.7"), t.apiKey && G.initialize(t.apiKey), ft(), pe();
  }
}
let oe;
async function pe() {
  const t = await He(), { campaign: e, filteredPlacements: n } = Ke(t), r = new Xe(e, pe), i = n.find(
    (a) => a.viewType == k.CORNER
  );
  i && (oe = new ie(
    i,
    i.ad,
    r
  ));
  const o = n.find(
    (a) => a.viewType == k.SPLIT_AD
  );
  o && new Pt(
    o,
    o.ad,
    r
  );
  const s = n.find(
    (a) => a.viewType == k.ADHESION
  );
  s && _e.setAd(s, s.ad), n.filter((a) => a.viewType == k.EMBED).forEach((a) => new Dt(a, a.ad));
}
let Mt = window.location.pathname;
function Ut() {
  console.log("Path changed to:", window.location.pathname), Mt != window.location.pathname && (D.clearAllSlots(), oe && oe.handleOnCloseButton(), _e.onAdFinish(), pe());
}
window.addEventListener("locationchange", function() {
  Ut();
});
(() => {
  let t = history.pushState;
  history.pushState = function() {
    let r = t.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"));
  });
})();
