UNPKG

@tidal-music/player

Version:
27,990 lines 1.31 MB
let ld = Object.freeze({
  apiUrl: "https://openapi.tidal.com/v2/",
  audioAdaptiveBitrateStreaming: !0,
  desiredVolumeLevel: 1,
  gatherEvents: !0,
  legacyApiUrl: "https://api.tidal.com/v1",
  loudnessNormalizationMode: "ALBUM",
  outputDevicesEnabled: !1,
  streamingWifiAudioQuality: "LOW"
});
function vr(y) {
  return ld[y];
}
function jr(y) {
  return ld = Object.freeze({
    ...ld,
    ...y
  }), Object.keys(y).forEach((v) => {
    const S = v;
    nP.dispatchEvent(new CustomEvent(S, { detail: y[S] }));
  }), ld;
}
const nP = new EventTarget();
class rP {
  #e;
  #n = !1;
  #r;
  #t;
  constructor(v) {
    this.#t = new URL(v), this.synchronize();
  }
  /**
   * Returns the current time adjusted to server-time.
   *
   * @param clientCurrentTime The current time on the client side. Defaults to Date.now().
   * @returns The current adjusted time (or the client time if not synced yet).
   */
  // eslint-disable-next-line no-restricted-syntax
  now(v = Date.now()) {
    return !this.#r || !this.#e ? (console.warn("TrueTime is not yet synchronized"), v) : this.#r + (v - this.#e);
  }
  /**
   * Synchronizes the client's time with the server's time.
   * If the client's time is already synchronized within an hour, this method does nothing.
   *
   * @returns {Promise<void>} A promise that resolves when the synchronization is complete.
   */
  async synchronize() {
    if (!(this.#e && // eslint-disable-next-line no-restricted-syntax
    Math.abs(Date.now() - this.#e) < 36e5 || this.#n)) {
      this.#n = !0;
      try {
        const v = await fetch(this.#t);
        v.ok && v.headers.has("date") && (this.#r = new Date(v.headers.get("date")).getTime(), this.#e = Date.now());
      } catch (v) {
        console.error(v);
      }
      this.#n = !1;
    }
  }
  /**
   * Returns the timestamp of a performance mark with the specified name and detail.
   * PS: `performance.mark` must be called with `startTime: trueTime.now()`.
   *
   * @param markName - The name of the performance mark.
   * @param detail - Optional. The detail of the performance mark.
   * @returns The timestamp of the performance mark, or undefined if not found.
   * @throws ReferenceError if the performance mark is not found.
   */
  timestamp(v, S) {
    let _;
    if (S) {
      if (_ = performance.getEntriesByName(v).find((C) => "detail" in C && C.detail === S), !_)
        throw new ReferenceError(
          `There is no performance entry named "${v}" with detail "${S}"`
        );
    } else
      _ = performance.getEntriesByName(v).pop();
    return _ ? _.startTime : void 0;
  }
}
const Dn = new rP("https://api.tidal.com/v1/ping"), iP = (y, v, S) => {
  for (const _ of y) {
    const C = _.addedNodes[0];
    _.type === "childList" && C.id === v && S();
  }
};
function oP() {
  const y = document.getElementById("tidal-player-root");
  if (!y)
    return Promise.reject("No player root");
  if ("video-one" in y.children)
    return Promise.resolve();
  const v = [];
  return "video-one" in y.children || v.push(
    new Promise((S) => {
      new MutationObserver(
        (_) => iP(_, "video-one", S)
      ).observe(y, { childList: !0 });
    })
  ), Promise.all(v);
}
const vo = document.createElement("video"), sP = (y) => {
  y.setAttribute("crossorigin", "anonymous"), y.setAttribute("playsinline", "playsinline");
};
sP(vo);
vo.id = "video-one";
const mg = "tidal-player-root";
function uP() {
  if (!document.getElementById(mg)) {
    const v = document.createElement("template");
    v.id = mg, document.body.appendChild(v);
  }
  return aP();
}
function aP() {
  const y = document.getElementById(
    mg
  );
  return y && (vo.id in y.children || y.appendChild(vo)), oP();
}
function lP() {
  return new Promise(
    (y) => document.addEventListener(
      "click",
      () => {
        vo.readyState === HTMLMediaElement.HAVE_NOTHING && !vo.src && vo.load(), y();
      },
      { once: !0 }
    )
  );
}
function vg(y) {
  return new Promise((v) => setTimeout(() => v(), y));
}
function cP(y, v) {
  return new Promise((S) => {
    y.addEventListener(v, (_) => S(_), !1);
  });
}
class dP extends EventTarget {
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  // @ts-ignore - Setter
  #e;
  set eventSender(v) {
    this.#e = v;
  }
  get eventSender() {
    return this.#e;
  }
  hasEventSender() {
    return !!this.#e;
  }
}
class fP extends EventTarget {
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  // @ts-ignore - Setter
  #e;
  set credentialsProvider(v) {
    this.#e = v, this.dispatchAuthorized().catch(console.error), this.#e.bus((S) => {
      S.detail.type === "CredentialsUpdatedMessage" ? this.dispatchAuthorized().catch(console.error) : console.warn("Unhandled event from credentials provider: ", S);
    });
  }
  get credentialsProvider() {
    return this.#e;
  }
  async dispatchAuthorized() {
    const v = await this.#e.getCredentials();
    v?.token ? this.dispatchEvent(
      new CustomEvent("authorized", {
        detail: {
          credentials: v
        }
      })
    ) : this.dispatchEvent(
      new CustomEvent("unauthenticated", { detail: { credentials: v } })
    );
  }
}
class yo extends Error {
  errorCode = null;
  errorId = null;
  referenceId;
  constructor(v, S, _) {
    super(`${v}: ${S} (${_})`), this.errorId = v, this.errorCode = S, this.referenceId = _;
  }
  toJSON() {
    return {
      errorCode: this.errorCode,
      errorId: this.errorId,
      referenceId: this.referenceId
    };
  }
  toString() {
    return JSON.stringify(this.toJSON());
  }
}
async function Ns() {
  if (Ar.credentialsProvider) {
    const y = await Ar.credentialsProvider.getCredentials();
    return !!(y.token && y.userId);
  }
  return await cP(Ar, "authorized"), Ns();
}
const Ar = new fP(), fd = new dP();
async function hP() {
  const y = await Ns(), v = async () => {
    const { Pushkin: S } = await Promise.resolve().then(() => MD);
    return S.refresh();
  };
  if (y) {
    jr({
      gatherEvents: !0
    });
    try {
      await Promise.all([v()]);
    } catch (S) {
      console.error(S);
    }
  } else
    jr({
      gatherEvents: !1
    });
}
function pP() {
  jr({
    gatherEvents: !0
  });
}
Ar.addEventListener("authorized", () => {
  hP().then().catch(console.error);
});
Ar.addEventListener("unauthenticated", () => {
  pP();
});
async function MS() {
  return Ar.credentialsProvider ? (await Ar.credentialsProvider.getCredentials()).token ?? null : null;
}
class gP extends EventTarget {
  dispatchError(v) {
    this.dispatchEvent(
      new CustomEvent("error", {
        detail: v.toJSON()
      })
    );
  }
}
const mr = new gP(), bs = {
  BTS: "application/vnd.tidal.bts",
  DASH: "application/dash+xml",
  EMU: "application/vnd.tidal.emu",
  HLS: "application/vnd.apple.mpegurl"
};
class mP {
  #e = /* @__PURE__ */ new Map();
  #n = /* @__PURE__ */ new Map();
  #r = /* @__PURE__ */ new Map();
  #t = /* @__PURE__ */ new Map();
  /**
   * Clones a session to re-use the media product and playback content for a new session.
   *
   * @param from - streamingSessionId to clone
   * @param to - target streamingSessionId
   */
  clone(v, S) {
    const _ = this.getMediaProductTransition(v), C = this.getStreamInfo(v), $ = this.getPlaybackInfo(v);
    if (!_ || !C || !$)
      throw new Error(
        `Cannot clone ${v}. Missing mediaProductTransition or streamInfo.`
      );
    this.saveMediaProductTransition(S, {
      ..._,
      playbackContext: {
        ..._.playbackContext,
        playbackSessionId: S
      }
    }), this.saveStreamInfo(S, {
      ...C,
      streamingSessionId: S
    }), this.savePlaybackInfo(S, {
      ...$,
      streamingSessionId: S
    });
  }
  deleteMediaProductTransition(v) {
    this.#e.delete(v);
  }
  /**
   * Removed cached playbackInfo, streamInfo and mediaProductTransition for session.
   * For re-using playbackInfo etc for other sessions make sure to run clone before deletion!
   *
   * @see {@link StreamingSessionStore.clone}
   */
  deleteSession(v) {
    this.deleteMediaProductTransition(v), this.#n.delete(v), this.#r.delete(v), this.deleteStreamInfo(v);
  }
  deleteStartedStreamInfo(v) {
    this.#r.delete(v);
  }
  deleteStreamInfo(v) {
    this.#t.delete(v);
  }
  getMediaProductTransition(v) {
    return v ? this.#e.get(v) : void 0;
  }
  getPlaybackInfo(v) {
    return v ? this.#n.get(v) : void 0;
  }
  getStreamInfo(v) {
    return v ? this.#t.get(v) : void 0;
  }
  hasMediaProductTransition(v) {
    return this.#e.has(v);
  }
  hasPlaybackInfo(v) {
    return this.#n.has(v);
  }
  hasStartedStreamInfo(v) {
    return this.#r.has(v);
  }
  hasStreamInfo(v) {
    return this.#t.has(v);
  }
  overwriteDuration(v, S) {
    const _ = this.#e.get(v);
    _ && (_.playbackContext = {
      ..._.playbackContext,
      actualDuration: S
    }, this.saveMediaProductTransition(v, _));
  }
  saveMediaProductTransition(v, S) {
    this.#e.set(
      v,
      S
    );
  }
  savePlaybackInfo(v, S) {
    this.#n.set(v, S);
  }
  saveStreamInfo(v, S) {
    this.#t.set(v, S);
  }
  setStartedStreamInfo(v) {
    return this.#r.set(v, !0);
  }
}
const ai = new mP();
class vP {
  activePlayer;
  preloadPlayer;
  get preloadedMediaProduct() {
    return ai.getMediaProductTransition(
      this.preloadedStreamingSessionId
    )?.mediaProduct ?? void 0;
  }
  get preloadedStreamingSessionId() {
    return this.preloadPlayer?.preloadedStreamingSessionId ?? void 0;
  }
}
const et = new vP();
let yg;
const yP = [
  {
    itemTypes: ["track", "video"],
    player: "shaka",
    qualities: ["HIGH", "LOSSLESS", "LOW", "HI_RES_LOSSLESS"]
  }
];
let wo = yP;
const Rn = {
  browser: void 0,
  native: void 0,
  shaka: void 0
};
function wP(y) {
  wo = y;
}
async function TP() {
  await Promise.all(
    wo.map((y) => {
      const v = Rn[y.player];
      return v ? v.reset() : Promise.resolve();
    })
  ), et.activePlayer = void 0, et.preloadPlayer = void 0;
}
function Sg(y) {
  y.name !== "nativePlayer" && Rn.native && Rn.native.abandon(), et.activePlayer = y;
}
async function SP(y) {
  Sg(y), await Promise.all(
    wo.filter((v) => Rn[v.player] !== et.activePlayer).map(async (v) => {
      const S = Rn[v.player];
      return S && await S.reset(), Promise.resolve();
    })
  ), await et.activePlayer?.skipToPreloadedMediaProduct(), await et.activePlayer?.play();
}
function NS() {
  mr.removeEventListener("ended", yg);
}
function xP(y) {
  y.name !== et.activePlayer?.name && (yg = () => {
    SP(y).then().catch(console.error);
  }, mr.addEventListener("ended", yg, { once: !0 }));
}
async function OS() {
  const { default: y } = await import("./nativePlayer-VeywcFxB.js");
  return Rn.native || (Rn.native = new y()), Rn.native;
}
async function AP() {
  const { default: y } = await import("./browserPlayer-Q3zxD6ve.js");
  return Rn.browser || (Rn.browser = new y()), Rn.browser;
}
async function EP() {
  const { default: y } = await import("./shakaPlayer-16_jV3wU.js");
  return Rn.shaka || (Rn.shaka = new y()), Rn.shaka;
}
function jS(y, v) {
  const S = wo.filter((_) => _.itemTypes.includes(y)).filter(
    (_) => y === "track" && _.qualities && v ? _.qualities.includes(v) : !0
  );
  return S.length === 0 ? "shaka" : S[0].player;
}
async function US(y, v, S) {
  const _ = wo.filter(($) => $.itemTypes.includes(y)).filter(
    ($) => y === "track" && $.qualities && v ? $.qualities.includes(v) : !0
  );
  _.length === 0 && console.error(
    `No player found to handle audio quality "${String(
      v
    )}" for product type "${y}" in player config: `,
    wo
  );
  let { player: C } = _[0];
  switch ((S === bs.DASH || S === bs.HLS) && C === "native" && (C = "shaka"), C) {
    case "browser":
      return AP();
    case "native":
      return OS();
    case "shaka":
      return EP();
    default:
      throw new Error("No player found.");
  }
}
async function IP() {
  await Promise.all(
    wo.map((y) => {
      const v = Rn[y.player];
      return v ? v.unloadPreloadedMediaProduct() : Promise.resolve();
    })
  );
}
function UD() {
  return et.activePlayer?.getPosition() ?? 0;
}
function _D() {
  return vr("audioAdaptiveBitrateStreaming");
}
function BD() {
  return vr("loudnessNormalizationMode");
}
function FD() {
  return et.activePlayer?.currentMediaProduct ?? null;
}
function VD() {
  return et.preloadedMediaProduct ?? null;
}
async function HD() {
  const { outputDevices: y } = await import("./output-devices-CMDZU3db.js");
  return [...y.outputDevices];
}
function GD() {
  const y = et.activePlayer;
  if (y) {
    const v = ai.getMediaProductTransition(
      y.currentStreamingSessionId
    );
    if (v)
      return v.playbackContext;
  }
}
function KD() {
  return et.activePlayer?.playbackState ?? "IDLE";
}
function WD() {
  return "0.15.0";
}
function zD() {
  return vr("streamingWifiAudioQuality");
}
function XD() {
  return vr("desiredVolumeLevel");
}
class MP {
  #e;
  constructor() {
    this.#e = /* @__PURE__ */ new Map();
  }
  async #n(v, S) {
    const _ = new TextEncoder().encode(
      `${v}-${S}`
    ), C = await crypto.subtle.digest("SHA-1", _);
    return Array.from(new Uint8Array(C)).map((f) => f.toString(16).padStart(2, "0")).join("");
  }
  /**
   * Delete a logged event by name and streamingSessionId.
   */
  async delete({
    name: v,
    streamingSessionId: S
  }) {
    const _ = await this.#n(
      S,
      v
    );
    this.#e.delete(_);
  }
  /**
   * Get a logged event by name and streamingSessionId.
   */
  async get({
    name: v,
    streamingSessionId: S
  }) {
    const _ = await this.#n(
      S,
      v
    );
    return this.#e.get(_);
  }
  /**
   * Adds or updates an event.
   */
  async put(v) {
    const S = await this.#n(
      v.streamingSessionId,
      v.name
    );
    this.#e.set(S, v);
  }
}
const wg = new MP();
async function Os(y, v) {
  return vr("gatherEvents") ? async (S) => {
    try {
      const _ = await wg.get({
        name: y,
        streamingSessionId: S.streamingSessionId
      }), C = Object.assign(
        {},
        v,
        _ ? _.payload : {},
        S
      );
      for (const $ of Object.keys(S)) {
        const ne = $;
        Array.isArray(S[ne]) && (C[ne] = [
          ...v[ne] || [],
          ..._ && _.payload[ne] || [],
          ...S[ne] || []
        ]);
      }
      return await wg.put({
        name: y,
        payload: C,
        streamingSessionId: S.streamingSessionId
      }), {
        name: y,
        payload: C,
        streamingSessionId: S.streamingSessionId
      };
    } catch (_) {
      console.error(_);
    }
  } : (S) => Promise.resolve(void 0);
}
const CP = {
  endReason: "COMPLETE",
  endTimestamp: 0,
  errorCode: null,
  errorMessage: null,
  startTimestamp: 0,
  streamingSessionId: ""
}, kP = await Os(
  "drm_license_fetch",
  CP
);
function qD(y) {
  return kP(y);
}
const PP = {
  endReason: "COMPLETE",
  endTimestamp: 0,
  errorCode: null,
  errorMessage: null,
  startTimestamp: 0,
  streamingSessionId: ""
}, DP = await Os(
  "playback_info_fetch",
  PP
);
function cd(y) {
  return DP(y);
}
function YD(y) {
  switch (y) {
    case "bluetooth":
      return "BLUETOOTH";
    case "builtIn":
      return "BUILT_IN";
    case "displayPort":
      return "DISPLAY_PORT";
    case "hdmi":
      return "HDMI";
    case "systemDefault":
      return "SYSTEM_DEFAULT";
    case "usb":
      return "USB";
    default:
      return;
  }
}
const RP = {
  actualAssetPresentation: "FULL",
  actualAudioMode: "STEREO",
  actualProductId: null,
  actualQuality: "LOSSLESS",
  actualStartTimestamp: 0,
  actualStreamType: "ON_DEMAND",
  adaptations: [],
  cdm: "WIDEVINE",
  cdmVersion: null,
  endReason: "COMPLETE",
  endTimestamp: 0,
  errorCode: null,
  errorMessage: null,
  hasAds: !1,
  idealStartTimestamp: 0,
  outputDevice: null,
  productType: "TRACK",
  stalls: [],
  streamingSessionId: ""
}, LP = await Os(
  "playback_statistics",
  RP
);
function CS(y) {
  return LP(y);
}
const bP = {
  streamingSessionId: "",
  timestamp: 0
}, NP = await Os(
  "streaming_session_end",
  bP
);
function OP(y) {
  return NP(y);
}
const jP = {
  AmazonBot: "amazonbot",
  "Amazon Silk": "amazon_silk",
  "Android Browser": "android",
  BaiduSpider: "baiduspider",
  Bada: "bada",
  BingCrawler: "bingcrawler",
  Brave: "brave",
  BlackBerry: "blackberry",
  "ChatGPT-User": "chatgpt_user",
  Chrome: "chrome",
  ClaudeBot: "claudebot",
  Chromium: "chromium",
  Diffbot: "diffbot",
  DuckDuckBot: "duckduckbot",
  DuckDuckGo: "duckduckgo",
  Electron: "electron",
  Epiphany: "epiphany",
  FacebookExternalHit: "facebookexternalhit",
  Firefox: "firefox",
  Focus: "focus",
  Generic: "generic",
  "Google Search": "google_search",
  Googlebot: "googlebot",
  GPTBot: "gptbot",
  "Internet Explorer": "ie",
  InternetArchiveCrawler: "internetarchivecrawler",
  "K-Meleon": "k_meleon",
  LibreWolf: "librewolf",
  Linespider: "linespider",
  Maxthon: "maxthon",
  "Meta-ExternalAds": "meta_externalads",
  "Meta-ExternalAgent": "meta_externalagent",
  "Meta-ExternalFetcher": "meta_externalfetcher",
  "Meta-WebIndexer": "meta_webindexer",
  "Microsoft Edge": "edge",
  "MZ Browser": "mz",
  "NAVER Whale Browser": "naver",
  "OAI-SearchBot": "oai_searchbot",
  Omgilibot: "omgilibot",
  Opera: "opera",
  "Opera Coast": "opera_coast",
  "Pale Moon": "pale_moon",
  PerplexityBot: "perplexitybot",
  "Perplexity-User": "perplexity_user",
  PhantomJS: "phantomjs",
  PingdomBot: "pingdombot",
  Puffin: "puffin",
  QQ: "qq",
  QQLite: "qqlite",
  QupZilla: "qupzilla",
  Roku: "roku",
  Safari: "safari",
  Sailfish: "sailfish",
  "Samsung Internet for Android": "samsung_internet",
  SlackBot: "slackbot",
  SeaMonkey: "seamonkey",
  Sleipnir: "sleipnir",
  "Sogou Browser": "sogou",
  Swing: "swing",
  Tizen: "tizen",
  "UC Browser": "uc",
  Vivaldi: "vivaldi",
  "WebOS Browser": "webos",
  WeChat: "wechat",
  YahooSlurp: "yahooslurp",
  "Yandex Browser": "yandex",
  YandexBot: "yandexbot",
  YouBot: "youbot"
}, _S = {
  amazonbot: "AmazonBot",
  amazon_silk: "Amazon Silk",
  android: "Android Browser",
  baiduspider: "BaiduSpider",
  bada: "Bada",
  bingcrawler: "BingCrawler",
  blackberry: "BlackBerry",
  brave: "Brave",
  chatgpt_user: "ChatGPT-User",
  chrome: "Chrome",
  claudebot: "ClaudeBot",
  chromium: "Chromium",
  diffbot: "Diffbot",
  duckduckbot: "DuckDuckBot",
  duckduckgo: "DuckDuckGo",
  edge: "Microsoft Edge",
  electron: "Electron",
  epiphany: "Epiphany",
  facebookexternalhit: "FacebookExternalHit",
  firefox: "Firefox",
  focus: "Focus",
  generic: "Generic",
  google_search: "Google Search",
  googlebot: "Googlebot",
  gptbot: "GPTBot",
  ie: "Internet Explorer",
  internetarchivecrawler: "InternetArchiveCrawler",
  k_meleon: "K-Meleon",
  librewolf: "LibreWolf",
  linespider: "Linespider",
  maxthon: "Maxthon",
  meta_externalads: "Meta-ExternalAds",
  meta_externalagent: "Meta-ExternalAgent",
  meta_externalfetcher: "Meta-ExternalFetcher",
  meta_webindexer: "Meta-WebIndexer",
  mz: "MZ Browser",
  naver: "NAVER Whale Browser",
  oai_searchbot: "OAI-SearchBot",
  omgilibot: "Omgilibot",
  opera: "Opera",
  opera_coast: "Opera Coast",
  pale_moon: "Pale Moon",
  perplexitybot: "PerplexityBot",
  perplexity_user: "Perplexity-User",
  phantomjs: "PhantomJS",
  pingdombot: "PingdomBot",
  puffin: "Puffin",
  qq: "QQ Browser",
  qqlite: "QQ Browser Lite",
  qupzilla: "QupZilla",
  roku: "Roku",
  safari: "Safari",
  sailfish: "Sailfish",
  samsung_internet: "Samsung Internet for Android",
  seamonkey: "SeaMonkey",
  slackbot: "SlackBot",
  sleipnir: "Sleipnir",
  sogou: "Sogou Browser",
  swing: "Swing",
  tizen: "Tizen",
  uc: "UC Browser",
  vivaldi: "Vivaldi",
  webos: "WebOS Browser",
  wechat: "WeChat",
  yahooslurp: "YahooSlurp",
  yandex: "Yandex Browser",
  yandexbot: "YandexBot",
  youbot: "YouBot"
}, Oe = {
  bot: "bot",
  desktop: "desktop",
  mobile: "mobile",
  tablet: "tablet",
  tv: "tv"
}, Tn = {
  Android: "Android",
  Bada: "Bada",
  BlackBerry: "BlackBerry",
  ChromeOS: "Chrome OS",
  HarmonyOS: "HarmonyOS",
  iOS: "iOS",
  Linux: "Linux",
  MacOS: "macOS",
  PlayStation4: "PlayStation 4",
  Roku: "Roku",
  Tizen: "Tizen",
  WebOS: "WebOS",
  Windows: "Windows",
  WindowsPhone: "Windows Phone"
}, Bi = {
  Blink: "Blink",
  EdgeHTML: "EdgeHTML",
  Gecko: "Gecko",
  Presto: "Presto",
  Trident: "Trident",
  WebKit: "WebKit"
};
class K {
  /**
   * Get first matched item for a string
   * @param {RegExp} regexp
   * @param {String} ua
   * @return {Array|{index: number, input: string}|*|boolean|string}
   */
  static getFirstMatch(v, S) {
    const _ = S.match(v);
    return _ && _.length > 0 && _[1] || "";
  }
  /**
   * Get second matched item for a string
   * @param regexp
   * @param {String} ua
   * @return {Array|{index: number, input: string}|*|boolean|string}
   */
  static getSecondMatch(v, S) {
    const _ = S.match(v);
    return _ && _.length > 1 && _[2] || "";
  }
  /**
   * Match a regexp and return a constant or undefined
   * @param {RegExp} regexp
   * @param {String} ua
   * @param {*} _const Any const that will be returned if regexp matches the string
   * @return {*}
   */
  static matchAndReturnConst(v, S, _) {
    if (v.test(S))
      return _;
  }
  static getWindowsVersionName(v) {
    switch (v) {
      case "NT":
        return "NT";
      case "XP":
        return "XP";
      case "NT 5.0":
        return "2000";
      case "NT 5.1":
        return "XP";
      case "NT 5.2":
        return "2003";
      case "NT 6.0":
        return "Vista";
      case "NT 6.1":
        return "7";
      case "NT 6.2":
        return "8";
      case "NT 6.3":
        return "8.1";
      case "NT 10.0":
        return "10";
      default:
        return;
    }
  }
  /**
   * Get macOS version name
   *    10.5 - Leopard
   *    10.6 - Snow Leopard
   *    10.7 - Lion
   *    10.8 - Mountain Lion
   *    10.9 - Mavericks
   *    10.10 - Yosemite
   *    10.11 - El Capitan
   *    10.12 - Sierra
   *    10.13 - High Sierra
   *    10.14 - Mojave
   *    10.15 - Catalina
   *    11 - Big Sur
   *    12 - Monterey
   *    13 - Ventura
   *    14 - Sonoma
   *    15 - Sequoia
   *
   * @example
   *   getMacOSVersionName("10.14") // 'Mojave'
   *
   * @param  {string} version
   * @return {string} versionName
   */
  static getMacOSVersionName(v) {
    const S = v.split(".").splice(0, 2).map(($) => parseInt($, 10) || 0);
    S.push(0);
    const _ = S[0], C = S[1];
    if (_ === 10)
      switch (C) {
        case 5:
          return "Leopard";
        case 6:
          return "Snow Leopard";
        case 7:
          return "Lion";
        case 8:
          return "Mountain Lion";
        case 9:
          return "Mavericks";
        case 10:
          return "Yosemite";
        case 11:
          return "El Capitan";
        case 12:
          return "Sierra";
        case 13:
          return "High Sierra";
        case 14:
          return "Mojave";
        case 15:
          return "Catalina";
        default:
          return;
      }
    switch (_) {
      case 11:
        return "Big Sur";
      case 12:
        return "Monterey";
      case 13:
        return "Ventura";
      case 14:
        return "Sonoma";
      case 15:
        return "Sequoia";
      default:
        return;
    }
  }
  /**
   * Get Android version name
   *    1.5 - Cupcake
   *    1.6 - Donut
   *    2.0 - Eclair
   *    2.1 - Eclair
   *    2.2 - Froyo
   *    2.x - Gingerbread
   *    3.x - Honeycomb
   *    4.0 - Ice Cream Sandwich
   *    4.1 - Jelly Bean
   *    4.4 - KitKat
   *    5.x - Lollipop
   *    6.x - Marshmallow
   *    7.x - Nougat
   *    8.x - Oreo
   *    9.x - Pie
   *
   * @example
   *   getAndroidVersionName("7.0") // 'Nougat'
   *
   * @param  {string} version
   * @return {string} versionName
   */
  static getAndroidVersionName(v) {
    const S = v.split(".").splice(0, 2).map((_) => parseInt(_, 10) || 0);
    if (S.push(0), !(S[0] === 1 && S[1] < 5)) {
      if (S[0] === 1 && S[1] < 6) return "Cupcake";
      if (S[0] === 1 && S[1] >= 6) return "Donut";
      if (S[0] === 2 && S[1] < 2) return "Eclair";
      if (S[0] === 2 && S[1] === 2) return "Froyo";
      if (S[0] === 2 && S[1] > 2) return "Gingerbread";
      if (S[0] === 3) return "Honeycomb";
      if (S[0] === 4 && S[1] < 1) return "Ice Cream Sandwich";
      if (S[0] === 4 && S[1] < 4) return "Jelly Bean";
      if (S[0] === 4 && S[1] >= 4) return "KitKat";
      if (S[0] === 5) return "Lollipop";
      if (S[0] === 6) return "Marshmallow";
      if (S[0] === 7) return "Nougat";
      if (S[0] === 8) return "Oreo";
      if (S[0] === 9) return "Pie";
    }
  }
  /**
   * Get version precisions count
   *
   * @example
   *   getVersionPrecision("1.10.3") // 3
   *
   * @param  {string} version
   * @return {number}
   */
  static getVersionPrecision(v) {
    return v.split(".").length;
  }
  /**
   * Calculate browser version weight
   *
   * @example
   *   compareVersions('1.10.2.1',  '1.8.2.1.90')    // 1
   *   compareVersions('1.010.2.1', '1.09.2.1.90');  // 1
   *   compareVersions('1.10.2.1',  '1.10.2.1');     // 0
   *   compareVersions('1.10.2.1',  '1.0800.2');     // -1
   *   compareVersions('1.10.2.1',  '1.10',  true);  // 0
   *
   * @param {String} versionA versions versions to compare
   * @param {String} versionB versions versions to compare
   * @param {boolean} [isLoose] enable loose comparison
   * @return {Number} comparison result: -1 when versionA is lower,
   * 1 when versionA is bigger, 0 when both equal
   */
  /* eslint consistent-return: 1 */
  static compareVersions(v, S, _ = !1) {
    const C = K.getVersionPrecision(v), $ = K.getVersionPrecision(S);
    let ne = Math.max(C, $), f = 0;
    const we = K.map([v, S], (Pe) => {
      const Ye = ne - K.getVersionPrecision(Pe), it = Pe + new Array(Ye + 1).join(".0");
      return K.map(it.split("."), (ie) => new Array(20 - ie.length).join("0") + ie).reverse();
    });
    for (_ && (f = ne - Math.min(C, $)), ne -= 1; ne >= f; ) {
      if (we[0][ne] > we[1][ne])
        return 1;
      if (we[0][ne] === we[1][ne]) {
        if (ne === f)
          return 0;
        ne -= 1;
      } else if (we[0][ne] < we[1][ne])
        return -1;
    }
  }
  /**
   * Array::map polyfill
   *
   * @param  {Array} arr
   * @param  {Function} iterator
   * @return {Array}
   */
  static map(v, S) {
    const _ = [];
    let C;
    if (Array.prototype.map)
      return Array.prototype.map.call(v, S);
    for (C = 0; C < v.length; C += 1)
      _.push(S(v[C]));
    return _;
  }
  /**
   * Array::find polyfill
   *
   * @param  {Array} arr
   * @param  {Function} predicate
   * @return {Array}
   */
  static find(v, S) {
    let _, C;
    if (Array.prototype.find)
      return Array.prototype.find.call(v, S);
    for (_ = 0, C = v.length; _ < C; _ += 1) {
      const $ = v[_];
      if (S($, _))
        return $;
    }
  }
  /**
   * Object::assign polyfill
   *
   * @param  {Object} obj
   * @param  {Object} ...objs
   * @return {Object}
   */
  static assign(v, ...S) {
    const _ = v;
    let C, $;
    if (Object.assign)
      return Object.assign(v, ...S);
    for (C = 0, $ = S.length; C < $; C += 1) {
      const ne = S[C];
      typeof ne == "object" && ne !== null && Object.keys(ne).forEach((we) => {
        _[we] = ne[we];
      });
    }
    return v;
  }
  /**
   * Get short version/alias for a browser name
   *
   * @example
   *   getBrowserAlias('Microsoft Edge') // edge
   *
   * @param  {string} browserName
   * @return {string}
   */
  static getBrowserAlias(v) {
    return jP[v];
  }
  /**
   * Get browser name for a short version/alias
   *
   * @example
   *   getBrowserTypeByAlias('edge') // Microsoft Edge
   *
   * @param  {string} browserAlias
   * @return {string}
   */
  static getBrowserTypeByAlias(v) {
    return _S[v] || "";
  }
}
const je = /version\/(\d+(\.?_?\d+)+)/i, UP = [
  /* GPTBot */
  {
    test: [/gptbot/i],
    describe(y) {
      const v = {
        name: "GPTBot"
      }, S = K.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* ChatGPT-User */
  {
    test: [/chatgpt-user/i],
    describe(y) {
      const v = {
        name: "ChatGPT-User"
      }, S = K.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* OAI-SearchBot */
  {
    test: [/oai-searchbot/i],
    describe(y) {
      const v = {
        name: "OAI-SearchBot"
      }, S = K.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* ClaudeBot */
  {
    test: [/claudebot/i, /claude-web/i, /claude-user/i, /claude-searchbot/i],
    describe(y) {
      const v = {
        name: "ClaudeBot"
      }, S = K.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Omgilibot */
  {
    test: [/omgilibot/i, /webzio-extended/i],
    describe(y) {
      const v = {
        name: "Omgilibot"
      }, S = K.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Diffbot */
  {
    test: [/diffbot/i],
    describe(y) {
      const v = {
        name: "Diffbot"
      }, S = K.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* PerplexityBot */
  {
    test: [/perplexitybot/i],
    describe(y) {
      const v = {
        name: "PerplexityBot"
      }, S = K.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Perplexity-User */
  {
    test: [/perplexity-user/i],
    describe(y) {
      const v = {
        name: "Perplexity-User"
      }, S = K.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* YouBot */
  {
    test: [/youbot/i],
    describe(y) {
      const v = {
        name: "YouBot"
      }, S = K.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Meta-WebIndexer */
  {
    test: [/meta-webindexer/i],
    describe(y) {
      const v = {
        name: "Meta-WebIndexer"
      }, S = K.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Meta-ExternalAds */
  {
    test: [/meta-externalads/i],
    describe(y) {
      const v = {
        name: "Meta-ExternalAds"
      }, S = K.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Meta-ExternalAgent */
  {
    test: [/meta-externalagent/i],
    describe(y) {
      const v = {
        name: "Meta-ExternalAgent"
      }, S = K.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Meta-ExternalFetcher */
  {
    test: [/meta-externalfetcher/i],
    describe(y) {
      const v = {
        name: "Meta-ExternalFetcher"
      }, S = K.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Googlebot */
  {
    test: [/googlebot/i],
    describe(y) {
      const v = {
        name: "Googlebot"
      }, S = K.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Linespider */
  {
    test: [/linespider/i],
    describe(y) {
      const v = {
        name: "Linespider"
      }, S = K.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* AmazonBot */
  {
    test: [/amazonbot/i],
    describe(y) {
      const v = {
        name: "AmazonBot"
      }, S = K.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* BingCrawler */
  {
    test: [/bingbot/i],
    describe(y) {
      const v = {
        name: "BingCrawler"
      }, S = K.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* BaiduSpider */
  {
    test: [/baiduspider/i],
    describe(y) {
      const v = {
        name: "BaiduSpider"
      }, S = K.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* DuckDuckBot */
  {
    test: [/duckduckbot/i],
    describe(y) {
      const v = {
        name: "DuckDuckBot"
      }, S = K.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* InternetArchiveCrawler */
  {
    test: [/ia_archiver/i],
    describe(y) {
      const v = {
        name: "InternetArchiveCrawler"
      }, S = K.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* FacebookExternalHit */
  {
    test: [/facebookexternalhit/i, /facebookcatalog/i],
    describe() {
      return {
        name: "FacebookExternalHit"
      };
    }
  },
  /* SlackBot */
  {
    test: [/slackbot/i, /slack-imgProxy/i],
    describe(y) {
      const v = {
        name: "SlackBot"
      }, S = K.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* YahooSlurp */
  {
    test: [/yahoo!?[\s/]*slurp/i],
    describe() {
      return {
        name: "YahooSlurp"
      };
    }
  },
  /* YandexBot */
  {
    test: [/yandexbot/i, /yandexmobilebot/i],
    describe() {
      return {
        name: "YandexBot"
      };
    }
  },
  /* PingdomBot */
  {
    test: [/pingdom/i],
    describe() {
      return {
        name: "PingdomBot"
      };
    }
  },
  /* Opera < 13.0 */
  {
    test: [/opera/i],
    describe(y) {
      const v = {
        name: "Opera"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  /* Opera > 13.0 */
  {
    test: [/opr\/|opios/i],
    describe(y) {
      const v = {
        name: "Opera"
      }, S = K.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/SamsungBrowser/i],
    describe(y) {
      const v = {
        name: "Samsung Internet for Android"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/Whale/i],
    describe(y) {
      const v = {
        name: "NAVER Whale Browser"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/PaleMoon/i],
    describe(y) {
      const v = {
        name: "Pale Moon"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/MZBrowser/i],
    describe(y) {
      const v = {
        name: "MZ Browser"
      }, S = K.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/focus/i],
    describe(y) {
      const v = {
        name: "Focus"
      }, S = K.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/swing/i],
    describe(y) {
      const v = {
        name: "Swing"
      }, S = K.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/coast/i],
    describe(y) {
      const v = {
        name: "Opera Coast"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/opt\/\d+(?:.?_?\d+)+/i],
    describe(y) {
      const v = {
        name: "Opera Touch"
      }, S = K.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/yabrowser/i],
    describe(y) {
      const v = {
        name: "Yandex Browser"
      }, S = K.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/ucbrowser/i],
    describe(y) {
      const v = {
        name: "UC Browser"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/Maxthon|mxios/i],
    describe(y) {
      const v = {
        name: "Maxthon"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/epiphany/i],
    describe(y) {
      const v = {
        name: "Epiphany"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/puffin/i],
    describe(y) {
      const v = {
        name: "Puffin"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/sleipnir/i],
    describe(y) {
      const v = {
        name: "Sleipnir"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/k-meleon/i],
    describe(y) {
      const v = {
        name: "K-Meleon"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/micromessenger/i],
    describe(y) {
      const v = {
        name: "WeChat"
      }, S = K.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/qqbrowser/i],
    describe(y) {
      const v = {
        name: /qqbrowserlite/i.test(y) ? "QQ Browser Lite" : "QQ Browser"
      }, S = K.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/msie|trident/i],
    describe(y) {
      const v = {
        name: "Internet Explorer"
      }, S = K.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/\sedg\//i],
    describe(y) {
      const v = {
        name: "Microsoft Edge"
      }, S = K.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/edg([ea]|ios)/i],
    describe(y) {
      const v = {
        name: "Microsoft Edge"
      }, S = K.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/vivaldi/i],
    describe(y) {
      const v = {
        name: "Vivaldi"
      }, S = K.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/seamonkey/i],
    describe(y) {
      const v = {
        name: "SeaMonkey"
      }, S = K.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/sailfish/i],
    describe(y) {
      const v = {
        name: "Sailfish"
      }, S = K.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/silk/i],
    describe(y) {
      const v = {
        name: "Amazon Silk"
      }, S = K.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/phantom/i],
    describe(y) {
      const v = {
        name: "PhantomJS"
      }, S = K.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/slimerjs/i],
    describe(y) {
      const v = {
        name: "SlimerJS"
      }, S = K.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
    describe(y) {
      const v = {
        name: "BlackBerry"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/(web|hpw)[o0]s/i],
    describe(y) {
      const v = {
        name: "WebOS Browser"
      }, S = K.getFirstMatch(je, y) || K.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/bada/i],
    describe(y) {
      const v = {
        name: "Bada"
      }, S = K.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/tizen/i],
    describe(y) {
      const v = {
        name: "Tizen"
      }, S = K.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/qupzilla/i],
    describe(y) {
      const v = {
        name: "QupZilla"
      }, S = K.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/librewolf/i],
    describe(y) {
      const v = {
        name: "LibreWolf"
      }, S = K.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/firefox|iceweasel|fxios/i],
    describe(y) {
      const v = {
        name: "Firefox"
      }, S = K.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/electron/i],
    describe(y) {
      const v = {
        name: "Electron"
      }, S = K.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/sogoumobilebrowser/i, /metasr/i, /se 2\.[x]/i],
    describe(y) {
      const v = {
        name: "Sogou Browser"
      }, S = K.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i, y), _ = K.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, y), C = K.getFirstMatch(/se ([\d.]+)x/i, y), $ = S || _ || C;
      return $ && (v.version = $), v;
    }
  },
  {
    test: [/MiuiBrowser/i],
    describe(y) {
      const v = {
        name: "Miui"
      }, S = K.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  /* DuckDuckGo Browser */
  {
    test(y) {
      return y.hasBrand("DuckDuckGo") ? !0 : y.test(/\sDdg\/[\d.]+$/i);
    },
    describe(y, v) {
      const S = {
        name: "DuckDuckGo"
      };
      if (v) {
        const C = v.getBrandVersion("DuckDuckGo");
        if (C)
          return S.version = C, S;
      }
      const _ = K.getFirstMatch(/\sDdg\/([\d.]+)$/i, y);
      return _ && (S.version = _), S;
    }
  },
  /* Brave Browser */
  {
    test(y) {
      return y.hasBrand("Brave");
    },
    describe(y, v) {
      const S = {
        name: "Brave"
      };
      if (v) {
        const _ = v.getBrandVersion("Brave");
        if (_)
          return S.version = _, S;
      }
      return S;
    }
  },
  {
    test: [/chromium/i],
    describe(y) {
      const v = {
        name: "Chromium"
      }, S = K.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, y) || K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/chrome|crios|crmo/i],
    describe(y) {
      const v = {
        name: "Chrome"
      }, S = K.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  {
    test: [/GSA/i],
    describe(y) {
      const v = {
        name: "Google Search"
      }, S = K.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  /* Android Browser */
  {
    test(y) {
      const v = !y.test(/like android/i), S = y.test(/android/i);
      return v && S;
    },
    describe(y) {
      const v = {
        name: "Android Browser"
      }, S = K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* PlayStation 4 */
  {
    test: [/playstation 4/i],
    describe(y) {
      const v = {
        name: "PlayStation 4"
      }, S = K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Safari */
  {
    test: [/safari|applewebkit/i],
    describe(y) {
      const v = {
        name: "Safari"
      }, S = K.getFirstMatch(je, y);
      return S && (v.version = S), v;
    }
  },
  /* Something else */
  {
    test: [/.*/i],
    describe(y) {
      const v = /^(.*)\/(.*) /, S = /^(.*)\/(.*)[ \t]\((.*)/, C = y.search("\\(") !== -1 ? S : v;
      return {
        name: K.getFirstMatch(C, y),
        version: K.getSecondMatch(C, y)
      };
    }
  }
], _P = [
  /* Roku */
  {
    test: [/Roku\/DVP/],
    describe(y) {
      const v = K.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, y);
      return {
        name: Tn.Roku,
        version: v
      };
    }
  },
  /* Windows Phone */
  {
    test: [/windows phone/i],
    describe(y) {
      const v = K.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, y);
      return {
        name: Tn.WindowsPhone,
        version: v
      };
    }
  },
  /* Windows */
  {
    test: [/windows /i],
    describe(y) {
      const v = K.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, y), S = K.getWindowsVersionName(v);
      return {
        name: Tn.Windows,
        version: v,
        versionName: S
      };
    }
  },
  /* Firefox on iPad */
  {
    test: [/Macintosh(.*?) FxiOS(.*?)\//],
    describe(y) {
      const v = {
        name: Tn.iOS
      }, S = K.getSecondMatch(/(Version\/)(\d[\d.]+)/, y);
      return S && (v.version = S), v;
    }
  },
  /* macOS */
  {
    test: [/macintosh/i],
    describe(y) {
      const v = K.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, y).replace(/[_\s]/g, "."), S = K.getMacOSVersionName(v), _ = {
        name: Tn.MacOS,
        version: v
      };
      return S && (_.versionName = S), _;
    }
  },
  /* iOS */
  {
    test: [/(ipod|iphone|ipad)/i],
    describe(y) {
      const v = K.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, y).replace(/[_\s]/g, ".");
      return {
        name: Tn.iOS,
        version: v
      };
    }
  },
  /* HarmonyOS */
  {
    test: [/OpenHarmony/i],
    describe(y) {
      const v = K.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i, y);
      return {
        name: Tn.HarmonyOS,
        version: v
      };
    }
  },
  /* Android */
  {
    test(y) {
      const v = !y.test(/like android/i), S = y.test(/android/i);
      return v && S;
    },
    describe(y) {
      const v = K.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, y), S = K.getAndroidVersionName(v), _ = {
        name: Tn.Android,
        version: v
      };
      return S && (_.versionName = S), _;
    }
  },
  /* WebOS */
  {
    test: [/(web|hpw)[o0]s/i],
    describe(y) {
      const v = K.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, y), S = {
        name: Tn.WebOS
      };
      return v && v.length && (S.version = v), S;
    }
  },
  /* BlackBerry */
  {
    test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
    describe(y) {
      const v = K.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i, y) || K.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i, y) || K.getFirstMatch(/\bbb(\d+)/i, y);
      return {
        name: Tn.BlackBerry,
        version: v
      };
    }
  },
  /* Bada */
  {
    test: [/bada/i],
    describe(y) {
      const v = K.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, y);
      return {
        name: Tn.Bada,
        version: v
      };
    }
  },
  /* Tizen */
  {
    test: [/tizen/i],
    describe(y) {
      const v = K.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, y);
      return {
        name: Tn.Tizen,
        version: v
      };
    }
  },
  /* Linux */
  {
    test: [/linux/i],
    describe() {
      return {
        name: Tn.Linux
      };
    }
  },
  /* Chrome OS */
  {
    test: [/CrOS/],
    describe() {
      return {
        name: Tn.ChromeOS
      };
    }
  },
  /* Playstation 4 */
  {
    test: [/PlayStation 4/],
    describe(y) {
      const v = K.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, y);
      return {
        name: Tn.PlayStation4,
        version: v
      };
    }
  }
], BP = [
  /* Googlebot */
  {
    test: [/googlebot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Google"
      };
    }
  },
  /* LineSpider */
  {
    test: [/linespider/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Line"
      };
    }
  },
  /* AmazonBot */
  {
    test: [/amazonbot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Amazon"
      };
    }
  },
  /* GPTBot */
  {
    test: [/gptbot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "OpenAI"
      };
    }
  },
  /* ChatGPT-User */
  {
    test: [/chatgpt-user/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "OpenAI"
      };
    }
  },
  /* OAI-SearchBot */
  {
    test: [/oai-searchbot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "OpenAI"
      };
    }
  },
  /* Baidu */
  {
    test: [/baiduspider/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Baidu"
      };
    }
  },
  /* Bingbot */
  {
    test: [/bingbot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Bing"
      };
    }
  },
  /* DuckDuckBot */
  {
    test: [/duckduckbot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "DuckDuckGo"
      };
    }
  },
  /* ClaudeBot */
  {
    test: [/claudebot/i, /claude-web/i, /claude-user/i, /claude-searchbot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Anthropic"
      };
    }
  },
  /* Omgilibot */
  {
    test: [/omgilibot/i, /webzio-extended/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Webz.io"
      };
    }
  },
  /* Diffbot */
  {
    test: [/diffbot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Diffbot"
      };
    }
  },
  /* PerplexityBot */
  {
    test: [/perplexitybot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Perplexity AI"
      };
    }
  },
  /* Perplexity-User */
  {
    test: [/perplexity-user/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Perplexity AI"
      };
    }
  },
  /* YouBot */
  {
    test: [/youbot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "You.com"
      };
    }
  },
  /* Internet Archive Crawler */
  {
    test: [/ia_archiver/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Internet Archive"
      };
    }
  },
  /* Meta-WebIndexer */
  {
    test: [/meta-webindexer/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Meta"
      };
    }
  },
  /* Meta-ExternalAds */
  {
    test: [/meta-externalads/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Meta"
      };
    }
  },
  /* Meta-ExternalAgent */
  {
    test: [/meta-externalagent/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Meta"
      };
    }
  },
  /* Meta-ExternalFetcher */
  {
    test: [/meta-externalfetcher/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Meta"
      };
    }
  },
  /* Meta Web Crawler */
  {
    test: [/facebookexternalhit/i, /facebookcatalog/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Meta"
      };
    }
  },
  /* SlackBot */
  {
    test: [/slackbot/i, /slack-imgProxy/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Slack"
      };
    }
  },
  /* Yahoo! Slurp */
  {
    test: [/yahoo/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Yahoo"
      };
    }
  },
  /* Yandex */
  {
    test: [/yandexbot/i, /yandexmobilebot/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Yandex"
      };
    }
  },
  /* Pingdom */
  {
    test: [/pingdom/i],
    describe() {
      return {
        type: Oe.bot,
        vendor: "Pingdom"
      };
    }
  },
  /* Huawei */
  {
    test: [/huawei/i],
    describe(y) {
      const v = K.getFirstMatch(/(can-l01)/i, y) && "Nova", S = {
        type: Oe.mobile,
        vendor: "Huawei"
      };
      return v && (S.model = v), S;
    }
  },
  /* Nexus Tablet */
  {
    test: [/nexus\s*(?:7|8|9|10).*/i],
    describe() {
      return {
        type: Oe.tablet,
        vendor: "Nexus"
      };
    }
  },
  /* iPad */
  {
    test: [/ipad/i],
    describe() {
      return {
        type: Oe.tablet,
        vendor: "Apple",
        model: "iPad"
      };
    }
  },
  /* Firefox on iPad */
  {
    test: [/Macintosh(.*?) FxiOS(.*?)\//],
    describe() {
      return {
        type: Oe.tablet,
        vendor: "Apple",
        model: "iPad"
      };
    }
  },
  /* Amazon Kindle Fire */
  {
    test: [/kftt build/i],
    describe() {
      return {
        type: Oe.tablet,
        vendor: "Amazon",
        model: "Kindle Fire HD 7"
      };
    }
  },
  /* Another Amazon Tablet with Silk */
  {
    test: [/silk/i],
    describe() {
      return {
        type: Oe.tablet,
        vendor: "Amazon"
      };
    }
  },
  /* Tablet */
  {
    test: [/tablet(?! pc)/i],
    describe() {
      return {
        type: Oe.tablet
      };
    }
  },
  /* iPod/iPhone */
  {
    test(y) {
      const v = y.test(/ipod|iphone/i), S = y.test(/like (ipod|iphone)/i);
      return v && !S;
    },
    describe(y) {
      const v = K.getFirstMatch(/(ipod|iphone)/i, y);
      return {
        type: Oe.mobile,
        vendor: "Apple",
        model: v
      };
    }
  },
  /* Nexus Mobile */
  {
    test: [/nexus\s*[0-6].*/i, /galaxy nexus/i],
    describe() {
      return {
        type: Oe.mobile,
        vendor: "Nexus"
      };
    }
  },
  /* Nokia */
  {
    test: [/Nokia/i],
    describe(y) {
      const v = K.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i, y), S = {
        type: Oe.mobile,
        vendor: "Nokia"
      };
      return v && (S.model = v), S;
    }
  },
  /* Mobile */
  {
    test: [/[^-]mobi/i],
    describe() {
      return {
        type: Oe.mobile
      };
    }
  },
  /* BlackBerry */
  {
    test(y) {
      return y.getBrowserName(!0) === "blackberry";
    },
    describe() {
      return {
        type: Oe.mobile,
        vendor: "BlackBerry"
      };
    }
  },
  /* Bada */
  {
    test(y) {
      return y.getBrowserName(!0) === "bada";
    },
    describe() {
      return {
        type: Oe.mobile
      };
    }
  },
  /* Windows Phone */
  {
    test(y) {
      return y.getBrowserName() === "windows phone";
    },
    describe() {
      return {
        type: Oe.mobile,
        vendor: "Microsoft"
      };
    }
  },
  /* Android Tablet */
  {
    test(y) {
      const v = Number(String(y.getOSVersion()).split(".")[0]);
      return y.getOSName(!0) === "android" && v >= 3;
    },
    describe() {
      return {
        type: Oe.tablet
      };
    }
  },
  /* Android Mobile */
  {
    test(y) {
      return y.getOSName(!0) === "android";
    },
    describe() {
      return {
        type: Oe.mobile
      };
    }
  },
  /* Smart TV */
  {
    test: [/smart-?tv|smarttv/i],
    describe() {
      return {
        type: Oe.tv
      };
    }
  },
  /* NetCast (LG Smart TV) */
  {
    test: [/netcast/i],
    describe() {
      return {
        type: Oe.tv
      };
    }
  },
  /* desktop */
  {
    test(y) {
      return y.getOSName(!0) === "macos";
    },
    describe() {
      return {
        type: Oe.desktop,
        vendor: "Apple"
      };
    }
  },
  /* Windows */
  {
    test(y) {
      return y.getOSName(!0) === "windows";
    },
    describe() {
      return {
        type: Oe.desktop
      };
    }
  },
  /* Linux */
  {
    test(y) {
      return y.getOSName(!0) === "linux";
    },
    describe() {
      return {
        type: Oe.desktop
      };
    }
  },
  /* PlayStation 4 */
  {
    test(y) {
      return y.getOSName(!0) === "playstation 4";
    },
    describe() {
      return {
        type: Oe.tv
      };
    }
  },
  /* Roku */
  {
    test(y) {
      return y.getOSName(!0) === "roku";
    },
    describe() {
      return {
        type: Oe.tv
      };
    }
  }
], FP = [
  /* EdgeHTML */
  {
    test(y) {
      return y.getBrowserName(!0) === "microsoft edge";
    },
    describe(y) {
      if (/\sedg\//i.test(y))
        return {
          name: Bi.Blink
        };
      const S = K.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, y);
      return {
        name: Bi.EdgeHTML,
        version: S
      };
    }
  },
  /* Trident */
  {
    test: [/trident/i],
    describe(y) {
      const v = {
        name: Bi.Trident
      }, S = K.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  /* Presto */
  {
    test(y) {
      return y.test(/presto/i);
    },
    describe(y) {
      const v = {
        name: Bi.Presto
      }, S = K.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  /* Gecko */
  {
    test(y) {
      const v = y.test(/gecko/i), S = y.test(/like gecko/i);
      return v && !S;
    },
    describe(y) {
      const v = {
        name: Bi.Gecko
      }, S = K.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  },
  /* Blink */
  {
    test: [/(apple)?webkit\/537\.36/i],
    describe() {
      return {
        name: Bi.Blink
      };
    }
  },
  /* WebKit */
  {
    test: [/(apple)?webkit/i],
    describe(y) {
      const v = {
        name: Bi.WebKit
      }, S = K.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, y);
      return S && (v.version = S), v;
    }
  }
];
class kS {
  /**
   * Create instance of Parser
   *
   * @param {String} UA User-Agent string
   * @param {Boolean|ClientHints} [skipParsingOrHints=false] Either a boolean to skip parsing,
   * or a ClientHints object containing User-Agent Client Hints data
   * @param {ClientHints} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
   *
   * @throw {Error} in case of empty UA String
   *
   * @constructor
   */
  constructor(v, S = !1, _ = null) {
    if (v == null || v === "")
      throw new Error("UserAgent parameter can't be empty");
    this._ua = v;
    let C = !1;
    typeof S == "boolean" ? (C = S, this._hints = _) : S != null && typeof S == "object" ? this._hints = S : this._hints = null, this.parsedResult = {}, C !== !0 && this.parse();
  }
  /**
   * Get Client Hints data
   * @return {ClientHints|null}
   *
   * @public
   * @example
   * const parser = Bowser.getParser(UA, clientHints);
   * const hints = parser.getHints();
   * console.log(hints.platform); // 'Windows'
   * console.log(hints.mobile); // false
   */
  getHints() {
    return this._hints;
  }
  /**
   * Check if a brand exists in Client Hints brands array
   * @param {string} brandName The brand name to check for
   * @return {boolean}
   *
   * @public
   * @example
   * const parser = Bowser.getParser(UA, clientHints);
   * if (parser.hasBrand('Google Chrome')) {
   *   console.log('Chrome detected!');
   * }
   */
  hasBrand(v) {
    if (!this._hints || !Array.isArray(this._hints.brands))
      return !1;
    const S = v.toLowerCase();
    return this._hints.brands.some(
      (_) => _.brand && _.brand.toLowerCase() === S
    );
  }
  /**
   * Get brand version from Client Hints
   * @param {string} brandName The brand name to get version for
   * @return {string|undefined}
   *
   * @public
   * @example
   * const parser = Bowser.getParser(UA, clientHints);
   * const version = parser.getBrandVersion('Google Chrome');
   * console.log(version); // '131'
   */
  getBrandVersion(v) {
    if (!this._hints || !Array.isArray(this._hints.brands))
      return;
    const S = v.toLowerCase(), _ = this._hints.brands.find(
      (C) => C.brand && C.brand.toLowerCase() === S
    );
    return _ ? _.version : void 0;
  }
  /**
   * Get UserAgent string of current Parser instance
   * @return {String} User-Agent String of the current <Parser> object
   *
   * @public
   */
  getUA() {
    return this._ua;
  }
  /**
   * Test a UA string for a regexp
   * @param {RegExp} regex
   * @return {Boolean}
   */
  test(v) {
    return v.test(this._ua);
  }
  /**
   * Get parsed browser object
   * @return {Object}
   */
  parseBrowser() {
    this.parsedResult.browser = {};
    const v = K.find(UP, (S) => {
      if (typeof S.test == "function")
        return S.test(this);
      if (Array.isArray(S.test))
        return S.test.some((_) => this.test(_));
      throw new Error("Browser's test function is not valid");
    });
    return v && (this.parsedResult.browser = v.describe(this.getUA(), this)), this.parsedResult.browser;
  }
  /**
   * Get parsed browser object
   * @return {Object}
   *
   * @public
   */
  getBrowser() {
    return this.parsedResult.browser ? this.parsedResult.browser : this.parseBrowser();
  }
  /**
   * Get browser's name
   * @return {String} Browser's name or an empty string
   *
   * @public
   */
  getBrowserName(v) {
    return v ? String(this.getBrowser().name).toLowerCase() || "" : this.getBrowser().name || "";
  }
  /**
   * Get browser's version
   * @return {String} version of browser
   *
   * @public
   */
  getBrowserVersion() {
    return this.getBrowser().version;
  }
  /**
   * Get OS
   * @return {Object}
   *
   * @example
   * this.getOS();
   * {
   *   name: 'macOS',
   *   version: '10.11.12'
   * }
   */
  getOS() {
    return this.parsedResult.os ? this.parsedResult.os : this.parseOS();
  }
  /**
   * Parse OS and save it to this.parsedResult.os
   * @return {*|{}}
   */
  parseOS() {
    this.parsedResult.os = {};
    const v = K.find(_P, (S) => {
      if (typeof S.test == "function")
        return S.test(this);
      if (Array.isArray(S.test))
        return S.test.some((_) => this.test(_));
      throw new Error("Browser's test function is not valid");
    });
    return v && (this.parsedResult.os = v.describe(this.getUA())), this.parsedResult.os;
  }
  /**
   * Get OS name
   * @param {Boolean} [toLowerCase] return lower-cased value
   * @return {String} name of the OS — macOS, Windows, Linux, etc.
   */
  getOSName(v) {
    const { name: S } = this.getOS();
    return v ? String(S).toLowerCase() || "" : S || "";
  }
  /**
   * Get OS version
   * @return {String} full version with dots ('10.11.12', '5.6', etc)
   */
  getOSVersion() {
    return this.getOS().version;
  }
  /**
   * Get parsed platform
   * @return {{}}
   */
  getPlatform() {
    return this.parsedResult.platform ? this.parsedResult.platform : this.parsePlatform();
  }
  /**
   * Get platform name
   * @param {Boolean} [toLowerCase=false]
   * @return {*}
   */
  getPlatformType(v = !1) {
    const { type: S } = this.getPlatform();
    return v ? String(S).toLowerCase() || "" : S || "";
  }
  /**
   * Get parsed platform
   * @return {{}}
   */
  parsePlatform() {
    this.parsedResult.platform = {};
    const v = K.find(BP, (S) => {
      if (typeof S.test == "function")
        return S.test(this);
      if (Array.isArray(S.test))
        return S.test.some((_) => this.test(_));
      throw new Error("Browser's test function is not valid");
    });
    return v && (this.parsedResult.platform = v.describe(this.getUA())), this.parsedResult.platform;
  }
  /**
   * Get parsed engine
   * @return {{}}
   */
  getEngine() {
    return this.parsedResult.engine ? this.parsedResult.engine : this.parseEngine();
  }
  /**
   * Get engines's name
   * @return {String} Engines's name or an empty string
   *
   * @public
   */
  getEngineName(v) {
    return v ? String(this.getEngine().name).toLowerCase() || "" : this.getEngine().name || "";
  }
  /**
   * Get parsed platform
   * @return {{}}
   */
  parseEngine() {
    this.parsedResult.engine = {};
    const v = K.find(FP, (S) => {
      if (typeof S.test == "function")
        return S.test(this);
      if (Array.isArray(S.test))
        return S.test.some((_) => this.test(_));
      throw new Error("Browser's test function is not valid");
    });
    return v && (this.parsedResult.engine = v.describe(this.getUA())), this.parsedResult.engine;
  }
  /**
   * Parse full information about the browser
   * @returns {Parser}
   */
  parse() {
    return this.parseBrowser(), this.parseOS(), this.parsePlatform(), this.parseEngine(), this;
  }
  /**
   * Get parsed result
   * @return {ParsedResult}
   */
  getResult() {
    return K.assign({}, this.parsedResult);
  }
  /**
   * Check if parsed browser matches certain conditions
   *
   * @param {Object} checkTree It's one or two layered object,
   * which can include a platform or an OS on the first layer
   * and should have browsers specs on the bottom-laying layer
   *
   * @returns {Boolean|undefined} Whether the browser satisfies the set conditions or not.
   * Returns `undefined` when the browser is no described in the checkTree object.
   *
   * @example
   * const browser = Bowser.getParser(window.navigator.userAgent);
   * if (browser.satisfies({chrome: '>118.01.1322' }))
   * // or with os
   * if (browser.satisfies({windows: { chrome: '>118.01.1322' } }))
   * // or with platforms
   * if (browser.satisfies({desktop: { chrome: '>118.01.1322' } }))
   */
  satisfies(v) {
    const S = {};
    let _ = 0;
    const C = {};
    let $ = 0;
    if (Object.keys(v).forEach((f) => {
      const we = v[f];
      typeof we == "string" ? (C[f] = we, $ += 1) : typeof we == "object" && (S[f] = we, _ += 1);
    }), _ > 0) {
      const f = Object.keys(S), we = K.find(f, (Ye) => this.isOS(Ye));
      if (we) {
        const Ye = this.satisfies(S[we]);
        if (Ye !== void 0)
          return Ye;
      }
      const Pe = K.find(
        f,
        (Ye) => this.isPlatform(Ye)
      );
      if (Pe) {
        const Ye = this.satisfies(S[Pe]);
        if (Ye !== void 0)
          return Ye;
      }
    }
    if ($ > 0) {
      const f = Object.keys(C), we = K.find(f, (Pe) => this.isBrowser(Pe, !0));
      if (we !== void 0)
        return this.compareVersion(C[we]);
    }
  }
  /**
   * Check if the browser name equals the passed string
   * @param {string} browserName The string to compare with the browser name
   * @param [includingAlias=false] The flag showing whether alias will be included into comparison
   * @returns {boolean}
   */
  isBrowser(v, S = !1) {
    const _ = this.getBrowserName().toLowerCase();
    let C = v.toLowerCase();
    const $ = K.getBrowserTypeByAlias(C);
    return S && $ && (C = $.toLowerCase()), C === _;
  }
  compareVersion(v) {
    let S = [0], _ = v, C = !1;
    const $ = this.getBrowserVersion();
    if (typeof $ == "string")
      return v[0] === ">" || v[0] === "<" ? (_ = v.substr(1), v[1] === "=" ? (C = !0, _ = v.substr(2)) : S = [], v[0] === ">" ? S.push(1) : S.push(-1)) : v[0] === "=" ? _ = v.substr(1) : v[0] === "~" && (C = !0, _ = v.substr(1)), S.indexOf(
        K.compareVersions($, _, C)
      ) > -1;
  }
  /**
   * Check if the OS name equals the passed string
   * @param {string} osName The string to compare with the OS name
   * @returns {boolean}
   */
  isOS(v) {
    return this.getOSName(!0) === String(v).toLowerCase();
  }
  /**
   * Check if the platform type equals the passed string
   * @param {string} platformType The string to compare with the platform type
   * @returns {boolean}
   */
  isPlatform(v) {
    return this.getPlatformType(!0) === String(v).toLowerCase();
  }
  /**
   * Check if the engine name equals the passed string
   * @param {string} engineName The string to compare with the engine name
   * @returns {boolean}
   */
  isEngine(v) {
    return this.getEngineName(!0) === String(v).toLowerCase();
  }
  /**
   * Is anything? Check if the browser is called "anything",
   * the OS called "anything" or the platform called "anything"
   * @param {String} anything
   * @param [includingAlias=false] The flag showing whether alias will be included into comparison
   * @returns {Boolean}
   */
  is(v, S = !1) {
    return this.isBrowser(v, S) || this.isOS(v) || this.isPlatform(v);
  }
  /**
   * Check if any of the given values satisfies this.is(anything)
   * @param {String[]} anythings
   * @returns {Boolean}
   */
  some(v = []) {
    return v.some((S) => this.is(S));
  }
}
class VP {
  /**
   * Creates a {@link Parser} instance
   *
   * @param {String} UA UserAgent string
   * @param {Boolean|Object} [skipParsingOrHints=false] Either a boolean to skip parsing,
   * or a ClientHints object (navigator.userAgentData)
   * @param {Object} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
   * @returns {Parser}
   * @throws {Error} when UA is not a String
   *
   * @example
   * const parser = Bowser.getParser(window.navigator.userAgent);
   * const result = parser.getResult();
   *
   * @example
   * // With User-Agent Client Hints
   * const parser = Bowser.getParser(
   *   window.navigator.userAgent,
   *   window.navigator.userAgentData
   * );
   */
  static getParser(v, S = !1, _ = null) {
    if (typeof v != "string")
      throw new Error("UserAgent should be a string");
    return new kS(v, S, _);
  }
  /**
   * Creates a {@link Parser} instance and runs {@link Parser.getResult} immediately
   *
   * @param {String} UA UserAgent string
   * @param {Object} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
   * @return {ParsedResult}
   *
   * @example
   * const result = Bowser.parse(window.navigator.userAgent);
   *
   * @example
   * // With User-Agent Client Hints
   * const result = Bowser.parse(
   *   window.navigator.userAgent,
   *   window.navigator.userAgentData
   * );
   */
  static parse(v, S = null) {
    return new kS(v, S).getResult();
  }
  static get BROWSER_MAP() {
    return _S;
  }
  static get ENGINE_MAP() {
    return Bi;
  }
  static get OS_MAP() {
    return Tn;
  }
  static get PLATFORMS_MAP() {
    return Oe;
  }
}
const pa = VP.parse(navigator.userAgent), HP = {
  abTestGroup: null,
  abTestName: null,
  browser: pa.browser.name ?? null,
  browserVersion: pa.browser.version ?? null,
  hardwarePlatform: pa.browser.name === "Electron" ? "DESKTOP" : "WEB",
  isOfflineModeStart: !1,
  mobileNetworkType: null,
  networkType: "WIFI",
  operatingSystem: pa.os.name ?? null,
  operatingSystemVersion: pa.os.version ?? null,
  screenHeight: window.screen.height,
  screenWidth: window.screen.width,
  sessionProductId: "",
  sessionProductType: "TRACK",
  sessionTags: [],
  sessionType: "PLAYBACK",
  startReason: "IMPLICIT",
  streamingSessionId: "",
  timestamp: 0
}, GP = await Os(
  "streaming_session_start",
  HP
);
function Tg(y) {
  return GP(y);
}
async function KP(y) {
  if (await Ns())
    return y();
}
async function BS(y) {
  const v = {
    consentCategory: "NECESSARY",
    ..."extras" in y && { extras: y.extras },
    group: y.group,
    name: y.name,
    payload: y.payload,
    version: y.version
  }, S = v.payload.streamingSessionId;
  v.name === "progress" && "streamingSessionId" in v.payload && delete v.payload.streamingSessionId, fd.eventSender.sendEvent(v), S && await wg.delete({
    name: v.name,
    streamingSessionId: S
  });
}
async function dd(y) {
  return KP(async () => {
    for (const v of y)
      if (v) {
        const S = await v;
        S && await BS({
          group: "streaming_metrics",
          name: S.name,
          payload: S.payload,
          version: 2
        });
      }
  });
}
function FS(y = !0) {
  const v = y && "crypto" in window && "getRandomValues" in crypto;
  return ("10000000-1000-4000-8000" + -1e11).replace(/[018]/g, (S) => {
    const _ = v ? crypto.getRandomValues(new Uint8Array(1))[0] : Math.floor(256 * Math.random());
    return (S ^ (_ ?? 0) & 15 >> S / 4).toString(16);
  });
}
function WP(y) {
  return JSON.parse(atob(y));
}
function zP(y, v) {
  if ("codecs" in y)
    switch (y.codecs) {
      case "aac":
        return "aac";
      case "aac+":
        return "aac+";
      case "flac":
        return "flac";
      case "mp3":
        return "mp3";
      case "mp4a.40.2":
        return "mp4a.40.2";
      case "mp4a.40.5":
        return "mp4a.40.5";
    }
  else if (v)
    switch (v) {
      case "HI_RES":
      case "HI_RES_LOSSLESS":
      case "LOSSLESS":
        return "flac";
      case "HIGH":
        return "mp4a.40.2";
      case "LOW":
        return "mp4a.40.5";
    }
  return "none";
}
function PS(y) {
  switch (y) {
    case "aac":
    case "aac+":
    case "mp4a.40.2":
    case "mp4a.40.5":
      return "aac";
    case "flac":
      return y;
    case "mp3":
      return "mp3";
    default:
      return;
  }
}
function XP(y) {
  const v = /<Representation[^>]*id="([^"]+)"/.exec(y);
  if (v) {
    const S = v[1];
    if (!S?.includes(","))
      return;
    const _ = S.match(/\d+/g);
    if (_ && _.length > 0)
      return Number(_[_.length - 1]);
  }
}
function qP(y) {
  const v = /codecs=(["'])?((?:.(?!\1|>))*.?)\1?/.exec(y);
  if (v === null)
    return;
  const S = v[2] ?? "";
  if (S.includes("mp4a") || S.includes("aac"))
    return "aac";
  if (S === "flac")
    return S;
}
function YP(y) {
  const S = /PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?/.exec(y);
  if (!S)
    throw new Error("Invalid duration format");
  const _ = parseFloat(S[1] || "0"), C = parseFloat(S[2] || "0"), $ = parseFloat(S[3] || "0");
  return _ * 3600 + C * 60 + $;
}
function $P(y) {
  const S = /mediaPresentationDuration="([^"]+)"/.exec(y);
  if (S) {
    const _ = S[1];
    if (_)
      return YP(_);
  }
}
function JP(y) {
  const S = /<Representation[^>]*audioSamplingRate="(\d+)"/.exec(y);
  if (S) {
    const _ = S[1];
    if (_)
      return Number(_);
  }
}
function QP(y) {
  const S = /X-COM-TIDAL-SAMPLE-DEPTH=(\d+)/.exec(y);
  if (S)
    return Number(S[1]);
}
function ZP(y) {
  const S = /#EXT-X-STREAM-INF:[^\n]*CODECS="([^"]+)"/.exec(y);
  if (S)
    return S[1];
}
function eD(y) {
  const v = /#EXTINF:([\d.]+),/g;
  let S, _ = 0, C = !1;
  for (; (S = v.exec(y)) !== null; ) {
    const $ = S[1];
    $ && (_ += parseFloat($), C = !0);
  }
  return C ? _ : void 0;
}
function tD(y) {
  const S = /X-COM-TIDAL-SAMPLE-RATE=(\d+)/.exec(y);
  if (S)
    return Number(S[1]);
}
function VS(y) {
  const { prefetched: v, streamingSessionId: S } = y, _ = "albumReplayGain" in y ? {
    albumPeakAmplitude: y.albumPeakAmplitude,
    albumReplayGain: y.albumReplayGain,
    trackPeakAmplitude: y.trackPeakAmplitude,
    trackReplayGain: y.trackReplayGain
  } : {}, C = "audioQuality" in y ? y.audioQuality : y.videoQuality, $ = {
    id: String(
      "videoId" in y ? y.videoId : y.trackId
    ),
    type: "trackId" in y ? "track" : "video"
  };
  if (y.manifestMimeType === bs.BTS || y.manifestMimeType === bs.EMU) {
    const ne = WP(y.manifest), f = ne.urls[0], we = zP(
      ne,
      "audioQuality" in y ? y.audioQuality : null
    );
    let Pe;
    return "keyId" in ne && (Pe = ne.keyId), "licenseSecurityToken" in y && (Pe = y.licenseSecurityToken), {
      ..._,
      bitDepth: "bitDepth" in y ? y.bitDepth ?? void 0 : void 0,
      codec: PS(we),
      prefetched: v,
      quality: C,
      sampleRate: "sampleRate" in y ? y.sampleRate ?? void 0 : void 0,
      securityToken: Pe,
      streamFormat: we,
      streamUrl: f,
      streamingSessionId: S,
      ...$,
      expires: y.expires
    };
  }
  if (y.manifestMimeType === bs.DASH) {
    const ne = `data:${y.manifestMimeType};base64,${y.manifest}`, f = atob(y.manifest);
    return {
      ..._,
      bitDepth: XP(f),
      codec: qP(f),
      duration: $P(f),
      prefetched: v,
      quality: C,
      sampleRate: JP(f),
      securityToken: y.licenseSecurityToken,
      streamUrl: ne,
      streamingSessionId: S,
      ...$,
      expires: y.expires
    };
  }
  if (y.manifestMimeType === bs.HLS) {
    const ne = `data:${y.manifestMimeType};base64,${y.manifest}`, f = atob(y.manifest), we = f.split("base64,")[1], Pe = we?.split(`
`)[0];
    if (!we || !Pe)
      throw new TypeError(
        "Invalid HLS manifest format: missing base64-encoded variant manifest."
      );
    const Ye = atob(Pe);
    return {
      ..._,
      bitDepth: QP(Ye),
      codec: PS(
        ZP(
          f
        )?.toLowerCase()
      ),
      duration: eD(Ye),
      prefetched: v,
      quality: C,
      sampleRate: tD(Ye),
      securityToken: y.licenseSecurityToken,
      streamUrl: ne,
      streamingSessionId: S,
      ...$,
      expires: y.expires
    };
  }
  throw new TypeError(
    `${y.manifestMimeType} not supported as playback info manifest mime type.`
  );
}
const nD = /\{[^{}]+\}/g, rD = () => typeof process == "object" && Number.parseInt(process?.versions?.node?.substring(0, 2)) >= 18 && process.versions.undici;
function iD() {
  return Math.random().toString(36).slice(2, 11);
}
function oD(y) {
  let {
    baseUrl: v = "",
    Request: S = globalThis.Request,
    fetch: _ = globalThis.fetch,
    querySerializer: C,
    bodySerializer: $,
    pathSerializer: ne,
    headers: f,
    requestInitExt: we = void 0,
    ...Pe
  } = { ...y };
  we = rD() ? we : void 0, v = LS(v);
  const Ye = [];
  async function it(ie, Fe) {
    const {
      baseUrl: Ht,
      fetch: Ln = _,
      Request: js = S,
      headers: Us,
      params: tt = {},
      parseAs: Fi = "json",
      querySerializer: m,
      bodySerializer: X = $ ?? uD,
      pathSerializer: To,
      body: So,
      middleware: _s = [],
      ...x
    } = Fe || {};
    let q = v;
    Ht && (q = LS(Ht) ?? v);
    let de = typeof C == "function" ? C : DS(C);
    m && (de = typeof m == "function" ? m : DS({
      ...typeof C == "object" ? C : {},
      ...m
    }));
    const ir = To || ne || sD, ye = So === void 0 ? void 0 : X(
      So,
      // Note: we declare mergeHeaders() both here and below because it’s a bit of a chicken-or-egg situation:
      // bodySerializer() needs all headers so we aren’t dropping ones set by the user, however,
      // the result of this ALSO sets the lowest-priority content-type header. So we re-merge below,
      // setting the content-type at the very beginning to be overwritten.
      // Lastly, based on the way headers work, it’s not a simple “present-or-not” check becauase null intentionally un-sets headers.
      RS(f, Us, tt.header)
    ), he = RS(
      // with no body, we should not to set Content-Type
      ye === void 0 || // if serialized body is FormData; browser will correctly set Content-Type & boundary expression
      ye instanceof FormData ? {} : {
        "Content-Type": "application/json"
      },
      f,
      Us,
      tt.header
    ), Ct = [...Ye, ..._s], ln = {
      redirect: "follow",
      ...Pe,
      ...x,
      body: ye,
      headers: he
    };
    let xo, Ao, or = new js(
      aD(ie, { baseUrl: q, params: tt, querySerializer: de, pathSerializer: ir }),
      ln
    ), Tt;
    for (const D in x)
      D in or || (or[D] = x[D]);
    if (Ct.length) {
      xo = iD(), Ao = Object.freeze({
        baseUrl: q,
        fetch: Ln,
        parseAs: Fi,
        querySerializer: de,
        bodySerializer: X,
        pathSerializer: ir
      });
      for (const D of Ct)
        if (D && typeof D == "object" && typeof D.onRequest == "function") {
          const $e = await D.onRequest({
            request: or,
            schemaPath: ie,
            params: tt,
            options: Ao,
            id: xo
          });
          if ($e)
            if ($e instanceof js)
              or = $e;
            else if ($e instanceof Response) {
              Tt = $e;
              break;
            } else
              throw new Error("onRequest: must return new Request() or Response() when modifying the request");
        }
    }
    if (!Tt) {
      try {
        Tt = await Ln(or, we);
      } catch (D) {
        let $e = D;
        if (Ct.length)
          for (let Er = Ct.length - 1; Er >= 0; Er--) {
            const cn = Ct[Er];
            if (cn && typeof cn == "object" && typeof cn.onError == "function") {
              const li = await cn.onError({
                request: or,
                error: $e,
                schemaPath: ie,
                params: tt,
                options: Ao,
                id: xo
              });
              if (li) {
                if (li instanceof Response) {
                  $e = void 0, Tt = li;
                  break;
                }
                if (li instanceof Error) {
                  $e = li;
                  continue;
                }
                throw new Error("onError: must return new Response() or instance of Error");
              }
            }
          }
        if ($e)
          throw $e;
      }
      if (Ct.length)
        for (let D = Ct.length - 1; D >= 0; D--) {
          const $e = Ct[D];
          if ($e && typeof $e == "object" && typeof $e.onResponse == "function") {
            const Er = await $e.onResponse({
              request: or,
              response: Tt,
              schemaPath: ie,
              params: tt,
              options: Ao,
              id: xo
            });
            if (Er) {
              if (!(Er instanceof Response))
                throw new Error("onResponse: must return new Response() when modifying the response");
              Tt = Er;
            }
          }
        }
    }
    const ga = Tt.headers.get("Content-Length");
    if (Tt.status === 204 || or.method === "HEAD" || ga === "0" && !Tt.headers.get("Transfer-Encoding")?.includes("chunked"))
      return Tt.ok ? { data: void 0, response: Tt } : { error: void 0, response: Tt };
    if (Tt.ok)
      return { data: await (async () => {
        if (Fi === "stream")
          return Tt.body;
        if (Fi === "json" && !ga) {
          const D = await Tt.text();
          return D ? JSON.parse(D) : void 0;
        }
        return await Tt[Fi]();
      })(), response: Tt };
    let Bs = await Tt.text();
    try {
      Bs = JSON.parse(Bs);
    } catch {
    }
    return { error: Bs, response: Tt };
  }
  return {
    request(ie, Fe, Ht) {
      return it(Fe, { ...Ht, method: ie.toUpperCase() });
    },
    /** Call a GET endpoint */
    GET(ie, Fe) {
      return it(ie, { ...Fe, method: "GET" });
    },
    /** Call a PUT endpoint */
    PUT(ie, Fe) {
      return it(ie, { ...Fe, method: "PUT" });
    },
    /** Call a POST endpoint */
    POST(ie, Fe) {
      return it(ie, { ...Fe, method: "POST" });
    },
    /** Call a DELETE endpoint */
    DELETE(ie, Fe) {
      return it(ie, { ...Fe, method: "DELETE" });
    },
    /** Call a OPTIONS endpoint */
    OPTIONS(ie, Fe) {
      return it(ie, { ...Fe, method: "OPTIONS" });
    },
    /** Call a HEAD endpoint */
    HEAD(ie, Fe) {
      return it(ie, { ...Fe, method: "HEAD" });
    },
    /** Call a PATCH endpoint */
    PATCH(ie, Fe) {
      return it(ie, { ...Fe, method: "PATCH" });
    },
    /** Call a TRACE endpoint */
    TRACE(ie, Fe) {
      return it(ie, { ...Fe, method: "TRACE" });
    },
    /** Register middleware */
    use(...ie) {
      for (const Fe of ie)
        if (Fe) {
          if (typeof Fe != "object" || !("onRequest" in Fe || "onResponse" in Fe || "onError" in Fe))
            throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");
          Ye.push(Fe);
        }
    },
    /** Unregister middleware */
    eject(...ie) {
      for (const Fe of ie) {
        const Ht = Ye.indexOf(Fe);
        Ht !== -1 && Ye.splice(Ht, 1);
      }
    }
  };
}
function hd(y, v, S) {
  if (v == null)
    return "";
  if (typeof v == "object")
    throw new Error(
      "Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these."
    );
  return `${y}=${S?.allowReserved === !0 ? v : encodeURIComponent(v)}`;
}
function HS(y, v, S) {
  if (!v || typeof v != "object")
    return "";
  const _ = [], C = {
    simple: ",",
    label: ".",
    matrix: ";"
  }[S.style] || "&";
  if (S.style !== "deepObject" && S.explode === !1) {
    for (const f in v)
      _.push(f, S.allowReserved === !0 ? v[f] : encodeURIComponent(v[f]));
    const ne = _.join(",");
    switch (S.style) {
      case "form":
        return `${y}=${ne}`;
      case "label":
        return `.${ne}`;
      case "matrix":
        return `;${y}=${ne}`;
      default:
        return ne;
    }
  }
  for (const ne in v) {
    const f = S.style === "deepObject" ? `${y}[${ne}]` : ne;
    _.push(hd(f, v[ne], S));
  }
  const $ = _.join(C);
  return S.style === "label" || S.style === "matrix" ? `${C}${$}` : $;
}
function GS(y, v, S) {
  if (!Array.isArray(v))
    return "";
  if (S.explode === !1) {
    const $ = { form: ",", spaceDelimited: "%20", pipeDelimited: "|" }[S.style] || ",", ne = (S.allowReserved === !0 ? v : v.map((f) => encodeURIComponent(f))).join($);
    switch (S.style) {
      case "simple":
        return ne;
      case "label":
        return `.${ne}`;
      case "matrix":
        return `;${y}=${ne}`;
      // case "spaceDelimited":
      // case "pipeDelimited":
      default:
        return `${y}=${ne}`;
    }
  }
  const _ = { simple: ",", label: ".", matrix: ";" }[S.style] || "&", C = [];
  for (const $ of v)
    S.style === "simple" || S.style === "label" ? C.push(S.allowReserved === !0 ? $ : encodeURIComponent($)) : C.push(hd(y, $, S));
  return S.style === "label" || S.style === "matrix" ? `${_}${C.join(_)}` : C.join(_);
}
function DS(y) {
  return function(v) {
    const S = [];
    if (v && typeof v == "object")
      for (const _ in v) {
        const C = v[_];
        if (C != null) {
          if (Array.isArray(C)) {
            if (C.length === 0)
              continue;
            S.push(
              GS(_, C, {
                style: "form",
                explode: !0,
                ...y?.array,
                allowReserved: y?.allowReserved || !1
              })
            );
            continue;
          }
          if (typeof C == "object") {
            S.push(
              HS(_, C, {
                style: "deepObject",
                explode: !0,
                ...y?.object,
                allowReserved: y?.allowReserved || !1
              })
            );
            continue;
          }
          S.push(hd(_, C, y));
        }
      }
    return S.join("&");
  };
}
function sD(y, v) {
  let S = y;
  for (const _ of y.match(nD) ?? []) {
    let C = _.substring(1, _.length - 1), $ = !1, ne = "simple";
    if (C.endsWith("*") && ($ = !0, C = C.substring(0, C.length - 1)), C.startsWith(".") ? (ne = "label", C = C.substring(1)) : C.startsWith(";") && (ne = "matrix", C = C.substring(1)), !v || v[C] === void 0 || v[C] === null)
      continue;
    const f = v[C];
    if (Array.isArray(f)) {
      S = S.replace(_, GS(C, f, { style: ne, explode: $ }));
      continue;
    }
    if (typeof f == "object") {
      S = S.replace(_, HS(C, f, { style: ne, explode: $ }));
      continue;
    }
    if (ne === "matrix") {
      S = S.replace(_, `;${hd(C, f)}`);
      continue;
    }
    S = S.replace(_, ne === "label" ? `.${encodeURIComponent(f)}` : encodeURIComponent(f));
  }
  return S;
}
function uD(y, v) {
  return y instanceof FormData ? y : v && (v.get instanceof Function ? v.get("Content-Type") ?? v.get("content-type") : v["Content-Type"] ?? v["content-type"]) === "application/x-www-form-urlencoded" ? new URLSearchParams(y).toString() : JSON.stringify(y);
}
function aD(y, v) {
  let S = `${v.baseUrl}${y}`;
  v.params?.path && (S = v.pathSerializer(S, v.params.path));
  let _ = v.querySerializer(v.params.query ?? {});
  return _.startsWith("?") && (_ = _.substring(1)), _ && (S += `?${_}`), S;
}
function RS(...y) {
  const v = new Headers();
  for (const S of y) {
    if (!S || typeof S != "object")
      continue;
    const _ = S instanceof Headers ? S.entries() : Object.entries(S);
    for (const [C, $] of _)
      if ($ === null)
        v.delete(C);
      else if (Array.isArray($))
        for (const ne of $)
          v.append(C, ne);
      else $ !== void 0 && v.set(C, $);
  }
  return v;
}
function LS(y) {
  return y.endsWith("/") ? y.substring(0, y.length - 1) : y;
}
function lD(y, v = "https://openapi.tidal.com/v2/") {
  const S = {
    async onRequest({ request: C }) {
      const $ = await y.getCredentials();
      return C.headers.set("Authorization", `Bearer ${$.token}`), (C.method === "POST" || C.method === "PATCH" || C.method === "DELETE") && C.headers.set("Content-Type", "application/vnd.api+json"), C;
    }
  }, _ = oD({
    baseUrl: v
  });
  return _.use(S), _;
}
var cD = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function dD(y) {
  return y && y.__esModule && Object.prototype.hasOwnProperty.call(y, "default") ? y.default : y;
}
var gg = {};
var bS;
function fD() {
  return bS || (bS = 1, (function(y) {
    (function() {
      var v = typeof window < "u" ? window : cD, S = {};
      (function(C, $, ne) {
        var f, we = typeof Object.create == "function" ? Object.create : function(e) {
          function t() {
          }
          return t.prototype = e, new t();
        }, Pe = typeof Object.defineProperties == "function" ? Object.defineProperty : function(e, t, n) {
          return e == Array.prototype || e == Object.prototype || (e[t] = n.value), e;
        };
        function Ye(e) {
          e = [typeof globalThis == "object" && globalThis, e, typeof C == "object" && C, typeof self == "object" && self, typeof $ == "object" && $];
          for (var t = 0; t < e.length; ++t) {
            var n = e[t];
            if (n && n.Math == Math) return n;
          }
          throw Error("Cannot find global object");
        }
        var it = Ye(this);
        function ie(e, t) {
          if (t) e: {
            var n = it;
            e = e.split(".");
            for (var r = 0; r < e.length - 1; r++) {
              var i = e[r];
              if (!(i in n)) break e;
              n = n[i];
            }
            e = e[e.length - 1], r = n[e], t = t(r), t != r && t != null && Pe(n, e, { configurable: !0, writable: !0, value: t });
          }
        }
        var Fe;
        if (typeof Object.setPrototypeOf == "function") Fe = Object.setPrototypeOf;
        else {
          var Ht;
          e: {
            var Ln = { a: !0 }, js = {};
            try {
              js.__proto__ = Ln, Ht = js.a;
              break e;
            } catch {
            }
            Ht = !1;
          }
          Fe = Ht ? function(e, t) {
            if (e.__proto__ = t, e.__proto__ !== t) throw new TypeError(e + " is not extensible");
            return e;
          } : null;
        }
        var Us = Fe;
        function tt(e, t) {
          if (e.prototype = we(t.prototype), e.prototype.constructor = e, Us) Us(e, t);
          else for (var n in t) if (n != "prototype") if (Object.defineProperties) {
            var r = Object.getOwnPropertyDescriptor(t, n);
            r && Object.defineProperty(e, n, r);
          } else e[n] = t[n];
          e.Gm = t.prototype;
        }
        function Fi(e) {
          var t = 0;
          return function() {
            return t < e.length ? { done: !1, value: e[t++] } : { done: !0 };
          };
        }
        function m(e) {
          var t = typeof Symbol < "u" && Symbol.iterator && e[Symbol.iterator];
          if (t) return t.call(e);
          if (typeof e.length == "number") return { next: Fi(e) };
          throw Error(String(e) + " is not an iterable or ArrayLike");
        }
        function X(e) {
          if (!(e instanceof Array)) {
            e = m(e);
            for (var t, n = []; !(t = e.next()).done; ) n.push(t.value);
            e = n;
          }
          return e;
        }
        function To() {
          this.o = !1, this.l = null, this.h = void 0, this.g = 1, this.j = this.m = 0, this.B = this.i = null;
        }
        function So(e) {
          if (e.o) throw new TypeError("Generator is already running");
          e.o = !0;
        }
        To.prototype.u = function(e) {
          this.h = e;
        };
        function _s(e, t) {
          e.i = { Zh: t, oi: !0 }, e.g = e.m || e.j;
        }
        To.prototype.return = function(e) {
          this.i = { return: e }, this.g = this.j;
        };
        function x(e, t, n) {
          return e.g = n, { value: t };
        }
        To.prototype.A = function(e) {
          this.g = e;
        };
        function q(e) {
          e.g = 0;
        }
        function de(e, t, n) {
          e.m = t, n != null && (e.j = n);
        }
        function ir(e, t) {
          e.m = 0, e.j = t || 0;
        }
        function ye(e, t, n) {
          e.g = t, e.m = n || 0;
        }
        function he(e, t) {
          return e.m = t || 0, t = e.i.Zh, e.i = null, t;
        }
        function Ct(e) {
          e.B = [e.i], e.m = 0, e.j = 0;
        }
        function ln(e, t) {
          var n = e.B.splice(0)[0];
          (n = e.i = e.i || n) ? n.oi ? e.g = e.m || e.j : n.A != null && e.j < n.A ? (e.g = n.A, e.i = null) : e.g = e.j : e.g = t;
        }
        function xo(e) {
          this.g = new To(), this.h = e;
        }
        function Ao(e, t) {
          So(e.g);
          var n = e.g.l;
          return n ? or(e, "return" in n ? n.return : function(r) {
            return { value: r, done: !0 };
          }, t, e.g.return) : (e.g.return(t), Tt(e));
        }
        function or(e, t, n, r) {
          try {
            var i = t.call(e.g.l, n);
            if (!(i instanceof Object)) throw new TypeError("Iterator result " + i + " is not an object");
            if (!i.done) return e.g.o = !1, i;
            var o = i.value;
          } catch (s) {
            return e.g.l = null, _s(e.g, s), Tt(e);
          }
          return e.g.l = null, r.call(e.g, o), Tt(e);
        }
        function Tt(e) {
          for (; e.g.g; ) try {
            var t = e.h(e.g);
            if (t) return e.g.o = !1, { value: t.value, done: !1 };
          } catch (n) {
            e.g.h = void 0, _s(e.g, n);
          }
          if (e.g.o = !1, e.g.i) {
            if (t = e.g.i, e.g.i = null, t.oi) throw t.Zh;
            return { value: t.return, done: !0 };
          }
          return { value: void 0, done: !0 };
        }
        function ga(e) {
          this.next = function(t) {
            return So(e.g), e.g.l ? t = or(e, e.g.l.next, t, e.g.u) : (e.g.u(t), t = Tt(e)), t;
          }, this.throw = function(t) {
            return So(e.g), e.g.l ? t = or(e, e.g.l.throw, t, e.g.u) : (_s(e.g, t), t = Tt(e)), t;
          }, this.return = function(t) {
            return Ao(e, t);
          }, this[Symbol.iterator] = function() {
            return this;
          };
        }
        function Bs(e) {
          function t(r) {
            return e.next(r);
          }
          function n(r) {
            return e.throw(r);
          }
          return new Promise(function(r, i) {
            function o(s) {
              s.done ? r(s.value) : Promise.resolve(s.value).then(t, n).then(o, i);
            }
            o(e.next());
          });
        }
        function D(e) {
          return Bs(new ga(new xo(e)));
        }
        function $e() {
          for (var e = Number(this), t = [], n = e; n < arguments.length; n++) t[n - e] = arguments[n];
          return t;
        }
        ie("Symbol", function(e) {
          function t(o) {
            if (this instanceof t) throw new TypeError("Symbol is not a constructor");
            return new n(r + (o || "") + "_" + i++, o);
          }
          function n(o, s) {
            this.g = o, Pe(this, "description", { configurable: !0, writable: !0, value: s });
          }
          if (e) return e;
          n.prototype.toString = function() {
            return this.g;
          };
          var r = "jscomp_symbol_" + (Math.random() * 1e9 >>> 0) + "_", i = 0;
          return t;
        }), ie("Symbol.iterator", function(e) {
          return e || (e = /* @__PURE__ */ Symbol("Symbol.iterator"), Pe(Array.prototype, e, { configurable: !0, writable: !0, value: function() {
            return Er(Fi(this));
          } }), e);
        });
        function Er(e) {
          return e = { next: e }, e[Symbol.iterator] = function() {
            return this;
          }, e;
        }
        ie("Promise", function(e) {
          function t(s) {
            this.h = 0, this.i = void 0, this.g = [], this.o = !1;
            var u = this.j();
            try {
              s(u.resolve, u.reject);
            } catch (a) {
              u.reject(a);
            }
          }
          function n() {
            this.g = null;
          }
          function r(s) {
            return s instanceof t ? s : new t(function(u) {
              u(s);
            });
          }
          if (e) return e;
          n.prototype.h = function(s) {
            if (this.g == null) {
              this.g = [];
              var u = this;
              this.i(function() {
                u.l();
              });
            }
            this.g.push(s);
          };
          var i = it.setTimeout;
          n.prototype.i = function(s) {
            i(s, 0);
          }, n.prototype.l = function() {
            for (; this.g && this.g.length; ) {
              var s = this.g;
              this.g = [];
              for (var u = 0; u < s.length; ++u) {
                var a = s[u];
                s[u] = null;
                try {
                  a();
                } catch (l) {
                  this.j(l);
                }
              }
            }
            this.g = null;
          }, n.prototype.j = function(s) {
            this.i(function() {
              throw s;
            });
          }, t.prototype.j = function() {
            function s(l) {
              return function(c) {
                a || (a = !0, l.call(u, c));
              };
            }
            var u = this, a = !1;
            return { resolve: s(this.G), reject: s(this.l) };
          }, t.prototype.G = function(s) {
            if (s === this) this.l(new TypeError("A Promise cannot resolve to itself"));
            else if (s instanceof t) this.I(s);
            else {
              e: switch (typeof s) {
                case "object":
                  var u = s != null;
                  break e;
                case "function":
                  u = !0;
                  break e;
                default:
                  u = !1;
              }
              u ? this.F(s) : this.m(s);
            }
          }, t.prototype.F = function(s) {
            var u = void 0;
            try {
              u = s.then;
            } catch (a) {
              this.l(a);
              return;
            }
            typeof u == "function" ? this.J(u, s) : this.m(s);
          }, t.prototype.l = function(s) {
            this.u(2, s);
          }, t.prototype.m = function(s) {
            this.u(1, s);
          }, t.prototype.u = function(s, u) {
            if (this.h != 0) throw Error("Cannot settle(" + s + ", " + u + "): Promise already settled in state" + this.h);
            this.h = s, this.i = u, this.h === 2 && this.H(), this.B();
          }, t.prototype.H = function() {
            var s = this;
            i(function() {
              if (s.C()) {
                var u = it.console;
                typeof u < "u" && u.error(s.i);
              }
            }, 1);
          }, t.prototype.C = function() {
            if (this.o) return !1;
            var s = it.CustomEvent, u = it.Event, a = it.dispatchEvent;
            return typeof a > "u" ? !0 : (typeof s == "function" ? s = new s("unhandledrejection", { cancelable: !0 }) : typeof u == "function" ? s = new u("unhandledrejection", { cancelable: !0 }) : (s = it.document.createEvent("CustomEvent"), s.initCustomEvent("unhandledrejection", !1, !0, s)), s.promise = this, s.reason = this.i, a(s));
          }, t.prototype.B = function() {
            if (this.g != null) {
              for (var s = 0; s < this.g.length; ++s) o.h(this.g[s]);
              this.g = null;
            }
          };
          var o = new n();
          return t.prototype.I = function(s) {
            var u = this.j();
            s.Se(u.resolve, u.reject);
          }, t.prototype.J = function(s, u) {
            var a = this.j();
            try {
              s.call(u, a.resolve, a.reject);
            } catch (l) {
              a.reject(l);
            }
          }, t.prototype.then = function(s, u) {
            function a(h, p) {
              return typeof h == "function" ? function(g) {
                try {
                  l(h(g));
                } catch (w) {
                  c(w);
                }
              } : p;
            }
            var l, c, d = new t(function(h, p) {
              l = h, c = p;
            });
            return this.Se(a(s, l), a(u, c)), d;
          }, t.prototype.catch = function(s) {
            return this.then(void 0, s);
          }, t.prototype.Se = function(s, u) {
            function a() {
              switch (l.h) {
                case 1:
                  s(l.i);
                  break;
                case 2:
                  u(l.i);
                  break;
                default:
                  throw Error("Unexpected state: " + l.h);
              }
            }
            var l = this;
            this.g == null ? o.h(a) : this.g.push(a), this.o = !0;
          }, t.resolve = r, t.reject = function(s) {
            return new t(function(u, a) {
              a(s);
            });
          }, t.race = function(s) {
            return new t(function(u, a) {
              for (var l = m(s), c = l.next(); !c.done; c = l.next()) r(c.value).Se(u, a);
            });
          }, t.all = function(s) {
            var u = m(s), a = u.next();
            return a.done ? r([]) : new t(function(l, c) {
              function d(g) {
                return function(w) {
                  h[g] = w, p--, p == 0 && l(h);
                };
              }
              var h = [], p = 0;
              do
                h.push(void 0), p++, r(a.value).Se(d(h.length - 1), c), a = u.next();
              while (!a.done);
            });
          }, t;
        });
        function cn(e, t) {
          return Object.prototype.hasOwnProperty.call(e, t);
        }
        ie("WeakMap", function(e) {
          function t(a) {
            if (this.g = (u += Math.random() + 1).toString(), a) {
              a = m(a);
              for (var l; !(l = a.next()).done; ) l = l.value, this.set(l[0], l[1]);
            }
          }
          function n() {
          }
          function r(a) {
            var l = typeof a;
            return l === "object" && a !== null || l === "function";
          }
          function i(a) {
            if (!cn(a, s)) {
              var l = new n();
              Pe(a, s, { value: l });
            }
          }
          function o(a) {
            var l = Object[a];
            l && (Object[a] = function(c) {
              return c instanceof n ? c : (Object.isExtensible(c) && i(c), l(c));
            });
          }
          if ((function() {
            if (!e || !Object.seal) return !1;
            try {
              var a = Object.seal({}), l = Object.seal({}), c = new e([[a, 2], [l, 3]]);
              return c.get(a) != 2 || c.get(l) != 3 ? !1 : (c.delete(a), c.set(l, 4), !c.has(a) && c.get(l) == 4);
            } catch {
              return !1;
            }
          })()) return e;
          var s = "$jscomp_hidden_" + Math.random();
          o("freeze"), o("preventExtensions"), o("seal");
          var u = 0;
          return t.prototype.set = function(a, l) {
            if (!r(a)) throw Error("Invalid WeakMap key");
            if (i(a), !cn(a, s)) throw Error("WeakMap key fail: " + a);
            return a[s][this.g] = l, this;
          }, t.prototype.get = function(a) {
            return r(a) && cn(a, s) ? a[s][this.g] : void 0;
          }, t.prototype.has = function(a) {
            return r(a) && cn(
              a,
              s
            ) && cn(a[s], this.g);
          }, t.prototype.delete = function(a) {
            return r(a) && cn(a, s) && cn(a[s], this.g) ? delete a[s][this.g] : !1;
          }, t;
        }), ie("Map", function(e) {
          function t() {
            var u = {};
            return u.yc = u.next = u.head = u;
          }
          function n(u, a) {
            var l = u[1];
            return Er(function() {
              if (l) {
                for (; l.head != u[1]; ) l = l.yc;
                for (; l.next != l.head; ) return l = l.next, { done: !1, value: a(l) };
                l = null;
              }
              return { done: !0, value: void 0 };
            });
          }
          function r(u, a) {
            var l = a && typeof a;
            l == "object" || l == "function" ? o.has(a) ? l = o.get(a) : (l = "" + ++s, o.set(a, l)) : l = "p_" + a;
            var c = u[0][l];
            if (c && cn(u[0], l)) for (u = 0; u < c.length; u++) {
              var d = c[u];
              if (a !== a && d.key !== d.key || a === d.key) return { id: l, list: c, index: u, entry: d };
            }
            return {
              id: l,
              list: c,
              index: -1,
              entry: void 0
            };
          }
          function i(u) {
            if (this[0] = {}, this[1] = t(), this.size = 0, u) {
              u = m(u);
              for (var a; !(a = u.next()).done; ) a = a.value, this.set(a[0], a[1]);
            }
          }
          if ((function() {
            if (!e || typeof e != "function" || !e.prototype.entries || typeof Object.seal != "function") return !1;
            try {
              var u = Object.seal({ x: 4 }), a = new e(m([[u, "s"]]));
              if (a.get(u) != "s" || a.size != 1 || a.get({ x: 4 }) || a.set({ x: 4 }, "t") != a || a.size != 2) return !1;
              var l = a.entries(), c = l.next();
              return c.done || c.value[0] != u || c.value[1] != "s" ? !1 : (c = l.next(), !(c.done || c.value[0].x != 4 || c.value[1] != "t" || !l.next().done));
            } catch {
              return !1;
            }
          })()) return e;
          var o = /* @__PURE__ */ new WeakMap();
          i.prototype.set = function(u, a) {
            u = u === 0 ? 0 : u;
            var l = r(this, u);
            return l.list || (l.list = this[0][l.id] = []), l.entry ? l.entry.value = a : (l.entry = { next: this[1], yc: this[1].yc, head: this[1], key: u, value: a }, l.list.push(l.entry), this[1].yc.next = l.entry, this[1].yc = l.entry, this.size++), this;
          }, i.prototype.delete = function(u) {
            return u = r(this, u), u.entry && u.list ? (u.list.splice(u.index, 1), u.list.length || delete this[0][u.id], u.entry.yc.next = u.entry.next, u.entry.next.yc = u.entry.yc, u.entry.head = null, this.size--, !0) : !1;
          }, i.prototype.clear = function() {
            this[0] = {}, this[1] = this[1].yc = t(), this.size = 0;
          }, i.prototype.has = function(u) {
            return !!r(this, u).entry;
          }, i.prototype.get = function(u) {
            return (u = r(this, u).entry) && u.value;
          }, i.prototype.entries = function() {
            return n(this, function(u) {
              return [u.key, u.value];
            });
          }, i.prototype.keys = function() {
            return n(this, function(u) {
              return u.key;
            });
          }, i.prototype.values = function() {
            return n(this, function(u) {
              return u.value;
            });
          }, i.prototype.forEach = function(u, a) {
            for (var l = this.entries(), c; !(c = l.next()).done; ) c = c.value, u.call(a, c[1], c[0], this);
          }, i.prototype[Symbol.iterator] = i.prototype.entries;
          var s = 0;
          return i;
        }), ie("Set", function(e) {
          function t(n) {
            if (this.g = /* @__PURE__ */ new Map(), n) {
              n = m(n);
              for (var r; !(r = n.next()).done; ) this.add(r.value);
            }
            this.size = this.g.size;
          }
          return (function() {
            if (!e || typeof e != "function" || !e.prototype.entries || typeof Object.seal != "function") return !1;
            try {
              var n = Object.seal({ x: 4 }), r = new e(m([n]));
              if (!r.has(n) || r.size != 1 || r.add(n) != r || r.size != 1 || r.add({ x: 4 }) != r || r.size != 2) return !1;
              var i = r.entries(), o = i.next();
              return o.done || o.value[0] != n || o.value[1] != n ? !1 : (o = i.next(), o.done || o.value[0] == n || o.value[0].x != 4 || o.value[1] != o.value[0] ? !1 : i.next().done);
            } catch {
              return !1;
            }
          })() ? e : (t.prototype.add = function(n) {
            return n = n === 0 ? 0 : n, this.g.set(n, n), this.size = this.g.size, this;
          }, t.prototype.delete = function(n) {
            return n = this.g.delete(n), this.size = this.g.size, n;
          }, t.prototype.clear = function() {
            this.g.clear(), this.size = 0;
          }, t.prototype.has = function(n) {
            return this.g.has(n);
          }, t.prototype.entries = function() {
            return this.g.entries();
          }, t.prototype.values = function() {
            return this.g.values();
          }, t.prototype.keys = t.prototype.values, t.prototype[Symbol.iterator] = t.prototype.values, t.prototype.forEach = function(n, r) {
            var i = this;
            this.g.forEach(function(o) {
              return n.call(r, o, o, i);
            });
          }, t);
        });
        function li(e, t, n) {
          e instanceof String && (e = String(e));
          for (var r = e.length, i = 0; i < r; i++) {
            var o = e[i];
            if (t.call(n, o, i, e)) return { ki: i, v: o };
          }
          return { ki: -1, v: void 0 };
        }
        ie("Array.prototype.findIndex", function(e) {
          return e || function(t, n) {
            return li(this, t, n).ki;
          };
        });
        function gd(e, t) {
          e instanceof String && (e += "");
          var n = 0, r = !1, i = { next: function() {
            if (!r && n < e.length) {
              var o = n++;
              return { value: t(o, e[o]), done: !1 };
            }
            return r = !0, { done: !0, value: void 0 };
          } };
          return i[Symbol.iterator] = function() {
            return i;
          }, i;
        }
        ie("Array.prototype.values", function(e) {
          return e || function() {
            return gd(this, function(t, n) {
              return n;
            });
          };
        }), ie("Array.from", function(e) {
          return e || function(t, n, r) {
            n = n ?? function(u) {
              return u;
            };
            var i = [], o = typeof Symbol < "u" && Symbol.iterator && t[Symbol.iterator];
            if (typeof o == "function") {
              t = o.call(t);
              for (var s = 0; !(o = t.next()).done; ) i.push(n.call(r, o.value, s++));
            } else for (o = t.length, s = 0; s < o; s++) i.push(n.call(r, t[s], s));
            return i;
          };
        }), ie("Array.prototype.keys", function(e) {
          return e || function() {
            return gd(this, function(t) {
              return t;
            });
          };
        });
        function ma(e, t, n) {
          if (e == null) throw new TypeError("The 'this' value for String.prototype." + n + " must not be null or undefined");
          if (t instanceof RegExp) throw new TypeError("First argument to String.prototype." + n + " must not be a regular expression");
          return e + "";
        }
        ie("String.prototype.startsWith", function(e) {
          return e || function(t, n) {
            var r = ma(this, t, "startsWith"), i = r.length, o = t.length;
            n = Math.max(0, Math.min(n | 0, r.length));
            for (var s = 0; s < o && n < i; ) if (r[n++] != t[s++]) return !1;
            return s >= o;
          };
        }), ie("Object.is", function(e) {
          return e || function(t, n) {
            return t === n ? t !== 0 || 1 / t === 1 / n : t !== t && n !== n;
          };
        }), ie("Array.prototype.includes", function(e) {
          return e || function(t, n) {
            var r = this;
            r instanceof String && (r = String(r));
            var i = r.length;
            for (n = n || 0, n < 0 && (n = Math.max(n + i, 0)); n < i; n++) {
              var o = r[n];
              if (o === t || Object.is(o, t)) return !0;
            }
            return !1;
          };
        }), ie("String.prototype.includes", function(e) {
          return e || function(t, n) {
            return ma(this, t, "includes").indexOf(t, n || 0) !== -1;
          };
        }), ie("String.fromCodePoint", function(e) {
          return e || function(t) {
            for (var n = "", r = 0; r < arguments.length; r++) {
              var i = Number(arguments[r]);
              if (i < 0 || i > 1114111 || i !== Math.floor(i)) throw new RangeError("invalid_code_point " + i);
              i <= 65535 ? n += String.fromCharCode(i) : (i -= 65536, n += String.fromCharCode(i >>> 10 & 1023 | 55296), n += String.fromCharCode(i & 1023 | 56320));
            }
            return n;
          };
        }), ie("WeakSet", function(e) {
          function t(n) {
            if (this.g = /* @__PURE__ */ new WeakMap(), n) {
              n = m(n);
              for (var r; !(r = n.next()).done; ) this.add(r.value);
            }
          }
          return (function() {
            if (!e || !Object.seal) return !1;
            try {
              var n = Object.seal({}), r = Object.seal({}), i = new e([n]);
              return !i.has(n) || i.has(r) ? !1 : (i.delete(n), i.add(r), !i.has(n) && i.has(r));
            } catch {
              return !1;
            }
          })() ? e : (t.prototype.add = function(n) {
            return this.g.set(n, !0), this;
          }, t.prototype.has = function(n) {
            return this.g.has(n);
          }, t.prototype.delete = function(n) {
            return this.g.delete(n);
          }, t);
        }), ie("Array.prototype.find", function(e) {
          return e || function(t, n) {
            return li(this, t, n).v;
          };
        }), ie("Object.entries", function(e) {
          return e || function(t) {
            var n = [], r;
            for (r in t) cn(t, r) && n.push([r, t[r]]);
            return n;
          };
        });
        var tx = typeof Object.assign == "function" ? Object.assign : function(e, t) {
          if (e == null) throw new TypeError("No nullish arg");
          e = Object(e);
          for (var n = 1; n < arguments.length; n++) {
            var r = arguments[n];
            if (r) for (var i in r) cn(r, i) && (e[i] = r[i]);
          }
          return e;
        };
        ie("Object.assign", function(e) {
          return e || tx;
        }), ie("Promise.prototype.finally", function(e) {
          return e || function(t) {
            return this.then(function(n) {
              return Promise.resolve(t()).then(function() {
                return n;
              });
            }, function(n) {
              return Promise.resolve(t()).then(function() {
                throw n;
              });
            });
          };
        }), ie("Array.prototype.entries", function(e) {
          return e || function() {
            return gd(this, function(t, n) {
              return [t, n];
            });
          };
        }), ie("Number.isNaN", function(e) {
          return e || function(t) {
            return typeof t == "number" && isNaN(t);
          };
        }), ie("String.prototype.repeat", function(e) {
          return e || function(t) {
            var n = ma(this, null, "repeat");
            if (t < 0 || t > 1342177279) throw new RangeError("Invalid count value");
            t |= 0;
            for (var r = ""; t; ) t & 1 && (r += n), (t >>>= 1) && (n += n);
            return r;
          };
        }), ie("Number.EPSILON", function() {
          return 2220446049250313e-31;
        }), ie("Number.MAX_SAFE_INTEGER", function() {
          return 9007199254740991;
        }), ie("Number.isFinite", function(e) {
          return e || function(t) {
            return typeof t != "number" ? !1 : !isNaN(t) && t !== 1 / 0 && t !== -1 / 0;
          };
        }), ie("Object.values", function(e) {
          return e || function(t) {
            var n = [], r;
            for (r in t) cn(t, r) && n.push(t[r]);
            return n;
          };
        }), ie("Math.log2", function(e) {
          return e || function(t) {
            return Math.log(t) / Math.LN2;
          };
        }), ie("String.prototype.endsWith", function(e) {
          return e || function(t, n) {
            var r = ma(this, t, "endsWith");
            n === void 0 && (n = r.length), n = Math.max(0, Math.min(n | 0, r.length));
            for (var i = t.length; i > 0 && n > 0; ) if (r[--n] != t[--i]) return !1;
            return i <= 0;
          };
        }), ie("Math.trunc", function(e) {
          return e || function(t) {
            if (t = Number(t), isNaN(t) || t === 1 / 0 || t === -1 / 0 || t === 0) return t;
            var n = Math.floor(Math.abs(t));
            return t < 0 ? -n : n;
          };
        });
        var nx = this || self;
        function Y(e, t) {
          e = e.split(".");
          var n = nx;
          e[0] in n || typeof n.execScript > "u" || n.execScript("var " + e[0]);
          for (var r; e.length && (r = e.shift()); ) e.length || t === void 0 ? n[r] && n[r] !== Object.prototype[r] ? n = n[r] : n = n[r] = {} : n[r] = t;
        }
        function Eo(e) {
          this.i = Math.log(0.5), this.g = Math.exp(this.i / e), this.j = this.h = 0;
        }
        Eo.prototype.sample = function(e, t) {
          var n = Math.pow(this.g, e);
          t = t * (1 - n) + n * this.h, isNaN(t) || (this.h = t, this.j += e);
        };
        function va(e) {
          return e.h / (1 - Math.pow(e.g, e.j));
        }
        function Fs() {
          this.h = new Eo(2), this.j = new Eo(5), this.g = 0, this.i = 128e3, this.l = 16e3;
        }
        Fs.prototype.configure = function(e) {
          this.i = e.minTotalBytes, this.l = e.minBytes;
          var t = this.h;
          t.g = Math.exp(t.i / e.fastHalfLife), t = this.j, t.g = Math.exp(t.i / e.slowHalfLife);
        }, Fs.prototype.sample = function(e, t) {
          if (!(t < this.l)) {
            var n = 8e3 * t / e;
            e /= 1e3, this.g += t, this.h.sample(e, n), this.j.sample(e, n);
          }
        }, Fs.prototype.getBandwidthEstimate = function(e) {
          return this.g < this.i ? e : Math.min(va(this.h), va(this.j));
        };
        function rx() {
        }
        function Ir() {
        }
        function De() {
        }
        function ci(e) {
          var t = $e.apply(1, arguments);
          xg.has(e) || (xg.add(e), De.apply(rx, X(t)));
        }
        function ix() {
        }
        function OD() {
        }
        function jD() {
        }
        var xg = /* @__PURE__ */ new Set();
        C.console && ((/* @__PURE__ */ new Map()).set(1, function() {
          return console.error.apply(console, X($e.apply(0, arguments)));
        }).set(2, function() {
          return console.warn.apply(console, X($e.apply(0, arguments)));
        }).set(3, function() {
          return console.info.apply(console, X($e.apply(0, arguments)));
        }).set(4, function() {
          return console.log.apply(console, X($e.apply(0, arguments)));
        }).set(5, function() {
          return console.debug.apply(console, X($e.apply(0, arguments)));
        }).set(6, function() {
          return console.debug.apply(console, X($e.apply(0, arguments)));
        }), De = function() {
          return console.warn.apply(console, X($e.apply(0, arguments)));
        }, Ir = function() {
          console.error.apply(console, X($e.apply(0, arguments)));
        });
        function Ag(e, t) {
          return typeof e == "number" && typeof t == "number" && isNaN(e) && isNaN(t) ? !0 : e === t;
        }
        function Gn(e, t) {
          t = e.indexOf(t), t > -1 && e.splice(t, 1);
        }
        function Vi(e, t, n) {
          if (n || (n = Ag), e.length != t.length) return !1;
          t = t.slice(), e = m(e);
          for (var r = e.next(), i = {}; !r.done; i = { ri: void 0 }, r = e.next()) {
            if (i.ri = r.value, r = t.findIndex(/* @__PURE__ */ (function(o) {
              return function(s) {
                return n(o.ri, s);
              };
            })(i)), r == -1) return !1;
            t[r] = t[t.length - 1], t.pop();
          }
          return t.length == 0;
        }
        function di(e, t, n) {
          if (e === t) return !0;
          if (!e || !t) return e == t;
          if (n || (n = Ag), e.length != t.length) return !1;
          for (var r = 0; r < e.length; r++) if (!n(e[r], t[r])) return !1;
          return !0;
        }
        function ya() {
          this.g = /* @__PURE__ */ new Map();
        }
        f = ya.prototype, f.push = function(e, t) {
          this.g.has(e) ? this.g.get(e).push(t) : this.g.set(e, [t]);
        }, f.get = function(e) {
          return this.g.has(e) ? this.g.get(e).slice() : null;
        }, f.remove = function(e, t) {
          if (this.g.has(e)) {
            var n = this.g.get(e).filter(function(r) {
              return r != t;
            });
            this.g.set(e, n), n.length || this.g.delete(e);
          }
        }, f.forEach = function(e) {
          this.g.forEach(function(t, n) {
            e(n, t);
          });
        }, f.size = function() {
          return this.g.size;
        }, f.keys = function() {
          return Array.from(this.g.keys());
        };
        function Ve() {
          this.g = new ya();
        }
        f = Ve.prototype, f.release = function() {
          this.Qa(), this.g = null;
        }, f.D = function(e, t, n, r) {
          this.g && (e = new Eg(e, t, n, r), this.g.push(t, e));
        }, f.Aa = function(e, t, n, r) {
          function i(s) {
            o.Ma(e, t, i), n(s);
          }
          var o = this;
          this.D(e, t, i, r);
        }, f.Ma = function(e, t, n) {
          if (this.g) {
            var r = this.g.get(t) || [];
            r = m(r);
            for (var i = r.next(); !i.done; i = r.next()) i = i.value, i.target != e || n != i.listener && n || (i.Ma(), this.g.remove(t, i));
          }
        }, f.Qa = function() {
          if (this.g) {
            for (var e = [], t = m(this.g.g.values()), n = t.next(); !n.done; n = t.next()) e.push.apply(e, X(n.value));
            for (e = m(e), t = e.next(); !t.done; t = e.next()) t.value.Ma();
            this.g.g.clear();
          }
        }, Y("shaka.util.EventManager", Ve), Ve.prototype.removeAll = Ve.prototype.Qa, Ve.prototype.unlisten = Ve.prototype.Ma, Ve.prototype.listenOnce = Ve.prototype.Aa, Ve.prototype.listen = Ve.prototype.D, Ve.prototype.release = Ve.prototype.release;
        function Eg(e, t, n, r) {
          this.target = e, this.type = t, this.listener = n, this.g = ox(e, r), this.target.addEventListener(t, n, this.g);
        }
        Eg.prototype.Ma = function() {
          this.target.removeEventListener(this.type, this.listener, this.g), this.listener = this.target = null, this.g = !1;
        };
        function ox(e, t) {
          if (t == null) return !1;
          if (typeof t == "boolean") return t;
          var n = /* @__PURE__ */ new Set(["passive", "capture"]);
          return Object.keys(t).filter(function(r) {
            return !n.has(r);
          }), sx(e) ? t : t.capture || !1;
        }
        function sx(e) {
          var t = Ig;
          if (t == null) {
            t = !1;
            try {
              var n = {}, r = { get: function() {
                return t = !0, !1;
              } };
              Object.defineProperty(n, "passive", r), Object.defineProperty(n, "capture", r), r = function() {
              }, e.addEventListener("test", r, n), e.removeEventListener("test", r, n);
            } catch {
              t = !1;
            }
            Ig = t;
          }
          return t || !1;
        }
        var Ig = void 0;
        Y("shaka.config.AutoShowText", { NEVER: 0, ALWAYS: 1, IF_PREFERRED_TEXT_LANGUAGE: 2, IF_SUBTITLES_MAY_BE_NEEDED: 3 });
        function ct(e) {
          this.h = e, this.g = void 0;
        }
        ct.prototype.value = function() {
          return this.g === void 0 && (this.g = this.h()), this.g;
        };
        function Se() {
          return ux.value();
        }
        var yr = null, md = null, ux = new ct(function() {
          var e = void 0;
          return yr && (e = yr()), !e && md && (e = md()), e;
        });
        function vd(e, t) {
          this.g = e, this.h = t;
        }
        vd.prototype.toString = function() {
          return "v" + this.g + "." + this.h;
        };
        function Ne(e, t) {
          var n = new vd(5, 0), r = Mg, i = r.g, o = n.h - i.h;
          ((n.g - i.g || o) > 0 ? r.i : r.h)(r.g, n, e, t);
        }
        function ax(e, t, n, r) {
          De([n, "has been deprecated and will be removed in", t, ". We are currently at version", e, ". Additional information:", r].join(" "));
        }
        function lx(e, t, n, r) {
          Ir([n, "has been deprecated and has been removed in", t, ". We are now at version", e, ". Additional information:", r].join(" "));
        }
        var Mg = null;
        var cx = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
        function yt(e) {
          var t;
          e instanceof yt ? (wa(this, e.jc), this.fd = e.fd, Ta(this, e.Fb), yd(this, e.Dd), this.Sb = e.Sb, Io(this, e.g.clone()), this.Rc = e.Rc) : e && (t = String(e).match(cx)) ? (wa(this, t[1] || "", !0), this.fd = Vs(t[2] || ""), Ta(this, t[3] || "", !0), yd(this, t[4]), this.Sb = Vs(t[5] || "", !0), Io(this, t[6] || "", !0), this.Rc = Vs(t[7] || "")) : this.g = new Mo(null);
        }
        f = yt.prototype, f.jc = "", f.fd = "", f.Fb = "", f.Dd = null, f.Sb = "", f.Rc = "", f.toString = function() {
          var e = [], t = this.jc;
          if (t && e.push(Hs(t, Cg, !0), ":"), t = this.Fb) {
            e.push("//");
            var n = this.fd;
            n && e.push(Hs(n, Cg, !0), "@"), e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g, "%$1")), t = this.Dd, t != null && e.push(":", String(t));
          }
          return (t = this.Sb) && (this.Fb && t.charAt(0) != "/" && e.push("/"), e.push(Hs(t, t.charAt(0) == "/" ? hx : fx, !0))), (t = this.g.toString()) && e.push("?", t), (t = this.Rc) && e.push("#", Hs(t, gx)), e.join("");
        }, f.resolve = function(e) {
          var t = this.clone();
          t.jc === "data" && (t = new yt());
          var n = !!e.jc;
          n ? wa(t, e.jc) : n = !!e.fd, n ? t.fd = e.fd : n = !!e.Fb, n ? Ta(t, e.Fb) : n = e.Dd != null;
          var r = e.Sb;
          if (n) yd(t, e.Dd);
          else if (n = !!e.Sb) {
            if (r.charAt(0) != "/") if (this.Fb && !this.Sb) r = "/" + r;
            else {
              var i = t.Sb.lastIndexOf("/");
              i != -1 && (r = t.Sb.substr(0, i + 1) + r);
            }
            if (r == ".." || r == ".") r = "";
            else if (r.indexOf("./") != -1 || r.indexOf("/.") != -1) {
              i = r.lastIndexOf("/", 0) == 0, r = r.split("/");
              for (var o = [], s = 0; s < r.length; ) {
                var u = r[s++];
                u == "." ? i && s == r.length && o.push("") : u == ".." ? ((o.length > 1 || o.length == 1 && o[0] != "") && o.pop(), i && s == r.length && o.push("")) : (o.push(u), i = !0);
              }
              r = o.join("/");
            }
          }
          return n ? t.Sb = r : n = e.g.toString() !== "", n ? Io(t, e.g.clone()) : n = !!e.Rc, n && (t.Rc = e.Rc), t;
        }, f.clone = function() {
          return new yt(this);
        };
        function wa(e, t, n) {
          e.jc = n ? Vs(t, !0) : t, e.jc && (e.jc = e.jc.replace(/:$/, ""));
        }
        function Ta(e, t, n) {
          e.Fb = n ? Vs(t, !0) : t;
        }
        function yd(e, t) {
          if (t) {
            if (t = Number(t), isNaN(t) || t < 0) throw Error("Bad port number " + t);
            e.Dd = t;
          } else e.Dd = null;
        }
        function Io(e, t, n) {
          t instanceof Mo ? e.g = t : (n || (t = Hs(t, px)), e.g = new Mo(t));
        }
        function Vs(e, t) {
          return e ? t ? decodeURI(e) : decodeURIComponent(e) : "";
        }
        function Hs(e, t, n) {
          return e != null ? (e = encodeURI(e).replace(t, dx), n && (e = e.replace(/%25([0-9a-fA-F]{2})/g, "%$1")), e) : null;
        }
        function dx(e) {
          return e = e.charCodeAt(0), "%" + (e >> 4 & 15).toString(16) + (e & 15).toString(16);
        }
        var Cg = /[#\/\?@]/g, fx = /[#\?:]/g, hx = /[#\?]/g, px = /[#\?@]/g, gx = /#/g;
        function Mo(e) {
          this.g = e || null;
        }
        function Sa(e) {
          if (!e.fb && (e.fb = /* @__PURE__ */ new Map(), e.Vd = 0, e.g)) for (var t = e.g.split("&"), n = 0; n < t.length; n++) {
            var r = t[n].indexOf("="), i = null;
            if (r >= 0) {
              var o = t[n].substring(0, r);
              i = t[n].substring(r + 1);
            } else o = t[n];
            o = decodeURIComponent(o), i = i || "", e.add(o, decodeURIComponent(i));
          }
        }
        f = Mo.prototype, f.fb = null, f.Vd = null, f.add = function(e, t) {
          Sa(this), this.g = null;
          var n = this.fb.has(e) ? this.fb.get(e) : null;
          return n || this.fb.set(e, n = []), n.push(t), this.Vd++, this;
        }, f.set = function(e, t) {
          return Sa(this), this.g = null, this.fb.has(e) ? this.fb.set(e, [t]) : this.add(e, t), this;
        }, f.get = function(e) {
          return Sa(this), this.fb.get(e) || [];
        }, f.toString = function() {
          if (this.g) return this.g;
          if (!this.fb || !this.fb.size) return "";
          for (var e = [], t = m(this.fb.keys()), n = t.next(); !n.done; n = t.next()) {
            var r = n.value;
            n = encodeURIComponent(r), r = this.fb.get(r);
            for (var i = 0; i < r.length; i++) {
              var o = n;
              r[i] !== "" && (o += "=" + encodeURIComponent(r[i])), e.push(o);
            }
          }
          return this.g = e.join("&");
        }, f.clone = function() {
          var e = new Mo();
          if (e.g = this.g, this.fb) {
            for (var t = /* @__PURE__ */ new Map(), n = m(this.fb), r = n.next(); !r.done; r = n.next()) {
              var i = m(r.value);
              r = i.next().value, i = i.next().value, t.set(r, i.concat());
            }
            e.fb = t, e.Vd = this.Vd;
          }
          return e;
        };
        function Co() {
        }
        function Ur(e, t) {
          if (!e && !t) return !0;
          if (!e || !t || e.byteLength != t.byteLength) return !1;
          if ((ArrayBuffer.isView(e) ? e.buffer : e) == (ArrayBuffer.isView(t) ? t.buffer : t) && (e.byteOffset || 0) == (t.byteOffset || 0)) return !0;
          var n = pe(e);
          t = pe(t);
          for (var r = 0; r < e.byteLength; r++) if (n[r] != t[r]) return !1;
          return !0;
        }
        function Kn(e) {
          return ArrayBuffer.isView(e) ? e.byteOffset == 0 && e.byteLength == e.buffer.byteLength ? e.buffer : new Uint8Array(e).buffer : e;
        }
        function pe(e, t, n) {
          return n = n === void 0 ? 1 / 0 : n, wd(e, t === void 0 ? 0 : t, n, Uint8Array);
        }
        function kg(e, t, n) {
          return n = n === void 0 ? 1 / 0 : n, wd(e, t === void 0 ? 0 : t, n, Uint16Array);
        }
        function dn(e, t, n) {
          return n = n === void 0 ? 1 / 0 : n, wd(e, t === void 0 ? 0 : t, n, DataView);
        }
        function wd(e, t, n, r) {
          var i = ArrayBuffer.isView(e) ? e.buffer : e, o = 1;
          "BYTES_PER_ELEMENT" in r && (o = r.BYTES_PER_ELEMENT);
          var s = ((e.byteOffset || 0) + e.byteLength) / o;
          return e = Math.floor(Math.max(0, Math.min(((e.byteOffset || 0) + t) / o, s))), new r(i, e, Math.floor(Math.min(e + Math.max(n, 0), s)) - e);
        }
        Y("shaka.util.BufferUtils", Co), Co.toDataView = dn, Co.toUint16 = kg, Co.toUint8 = pe, Co.toArrayBuffer = Kn, Co.equal = Ur;
        function Pg(e, t) {
          if (e === t || !e.length || !t.length) return !0;
          e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) {
            if (n = n.value, Aa(n)) return !0;
            for (var r = m(t), i = r.next(); !i.done; i = r.next()) if (i = i.value, n.keySystem === i.keySystem || Aa(i)) return !0;
          }
          return !1;
        }
        function Dg(e, t) {
          if (!e.length) return t;
          if (!t.length) return e;
          var n = [];
          e = m(e);
          for (var r = e.next(); !r.done; r = e.next()) {
            r = r.value;
            for (var i = m(t), o = i.next(); !o.done; o = i.next()) if (o = o.value, r.keySystem == o.keySystem) {
              i = /* @__PURE__ */ new Map();
              for (var s = m((r.initData || []).concat(o.initData || [])), u = s.next(); !u.done; u = s.next()) u = u.value, i.set(u.keyId, u);
              i = Array.from(i.values()), s = r.keyIds && o.keyIds ? new Set([].concat(X(r.keyIds), X(o.keyIds))) : r.keyIds || o.keyIds, n.push({ keySystem: r.keySystem, licenseServerUri: r.licenseServerUri || o.licenseServerUri, distinctiveIdentifierRequired: r.distinctiveIdentifierRequired || o.distinctiveIdentifierRequired, persistentStateRequired: r.persistentStateRequired || o.persistentStateRequired, videoRobustness: r.videoRobustness || o.videoRobustness, audioRobustness: r.audioRobustness || o.audioRobustness, serverCertificate: r.serverCertificate || o.serverCertificate, serverCertificateUri: r.serverCertificateUri || o.serverCertificateUri, initData: i, keyIds: s });
              break;
            } else Aa(r) ? n.push(r) : Aa(o) && n.push(o);
          }
          return n;
        }
        function Td(e) {
          return e === "org.w3.clearkey";
        }
        function Rg(e) {
          return e ? !!e.match(/^com\.widevine\.alpha/) : !1;
        }
        function xa(e) {
          return e ? !!e.match(/^com\.(microsoft|chromecast)\.playready/) : !1;
        }
        function ko(e) {
          return e ? !!e.match(/^com\.apple\.fps/) : !1;
        }
        function Aa(e) {
          return (e = e.licenseServerUri) ? e.startsWith("data:application/json;base64,") : !1;
        }
        function Sd(e, t, n, r) {
          return r = [].concat(X(new Set(r))).sort().join("#"), e + "#" + t + "#" + n + "#" + r;
        }
        var Ea = new ct(function() {
          return Kn(new Uint8Array([0]));
        }), Po = /* @__PURE__ */ new Map();
        function b(e, t, n) {
          var r = $e.apply(3, arguments);
          this.severity = e, this.category = t, this.code = n, this.data = r, this.handled = !1, this.message = "Shaka Error " + this.code;
          try {
            throw Error(this.message || "Shaka Error");
          } catch (i) {
            this.stack = i.stack;
          }
        }
        b.prototype.toString = function() {
          return "shaka.util.Error " + JSON.stringify(this, null, "  ");
        }, Y("shaka.util.Error", b), b.Severity = { RECOVERABLE: 1, CRITICAL: 2 }, b.Category = { NETWORK: 1, TEXT: 2, MEDIA: 3, MANIFEST: 4, STREAMING: 5, DRM: 6, PLAYER: 7, CAST: 8, STORAGE: 9, ADS: 10 }, b.Code = {
          UNSUPPORTED_SCHEME: 1e3,
          BAD_HTTP_STATUS: 1001,
          HTTP_ERROR: 1002,
          TIMEOUT: 1003,
          MALFORMED_DATA_URI: 1004,
          REQUEST_FILTER_ERROR: 1006,
          RESPONSE_FILTER_ERROR: 1007,
          MALFORMED_TEST_URI: 1008,
          UNEXPECTED_TEST_REQUEST: 1009,
          ATTEMPTS_EXHAUSTED: 1010,
          SEGMENT_MISSING: 1011,
          INVALID_TEXT_HEADER: 2e3,
          INVALID_TEXT_CUE: 2001,
          UNABLE_TO_DETECT_ENCODING: 2003,
          BAD_ENCODING: 2004,
          INVALID_XML: 2005,
          INVALID_MP4_TTML: 2007,
          INVALID_MP4_VTT: 2008,
          UNABLE_TO_EXTRACT_CUE_START_TIME: 2009,
          INVALID_MP4_CEA: 2010,
          TEXT_COULD_NOT_GUESS_MIME_TYPE: 2011,
          CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS: 2012,
          TEXT_ONLY_WEBVTT_SRC_EQUALS: 2013,
          MISSING_TEXT_PLUGIN: 2014,
          UNSUPPORTED_EXTERNAL_THUMBNAILS_URI: 2017,
          BUFFER_READ_OUT_OF_BOUNDS: 3e3,
          JS_INTEGER_OVERFLOW: 3001,
          EBML_OVERFLOW: 3002,
          EBML_BAD_FLOATING_POINT_SIZE: 3003,
          MP4_SIDX_WRONG_BOX_TYPE: 3004,
          MP4_SIDX_INVALID_TIMESCALE: 3005,
          MP4_SIDX_TYPE_NOT_SUPPORTED: 3006,
          WEBM_CUES_ELEMENT_MISSING: 3007,
          WEBM_EBML_HEADER_ELEMENT_MISSING: 3008,
          WEBM_SEGMENT_ELEMENT_MISSING: 3009,
          WEBM_INFO_ELEMENT_MISSING: 3010,
          WEBM_DURATION_ELEMENT_MISSING: 3011,
          WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING: 3012,
          WEBM_CUE_TIME_ELEMENT_MISSING: 3013,
          MEDIA_SOURCE_OPERATION_FAILED: 3014,
          MEDIA_SOURCE_OPERATION_THREW: 3015,
          VIDEO_ERROR: 3016,
          QUOTA_EXCEEDED_ERROR: 3017,
          TRANSMUXING_FAILED: 3018,
          CONTENT_TRANSFORMATION_FAILED: 3019,
          MSS_MISSING_DATA_FOR_TRANSMUXING: 3020,
          MSS_TRANSMUXING_FAILED: 3022,
          TRANSMUXING_NO_VIDEO_DATA: 3023,
          STREAMING_NOT_ALLOWED: 3024,
          UNABLE_TO_GUESS_MANIFEST_TYPE: 4e3,
          DASH_INVALID_XML: 4001,
          DASH_NO_SEGMENT_INFO: 4002,
          DASH_EMPTY_ADAPTATION_SET: 4003,
          DASH_EMPTY_PERIOD: 4004,
          DASH_WEBM_MISSING_INIT: 4005,
          DASH_UNSUPPORTED_CONTAINER: 4006,
          DASH_PSSH_BAD_ENCODING: 4007,
          DASH_NO_COMMON_KEY_SYSTEM: 4008,
          DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED: 4009,
          DASH_CONFLICTING_KEY_IDS: 4010,
          RESTRICTIONS_CANNOT_BE_MET: 4012,
          HLS_PLAYLIST_HEADER_MISSING: 4015,
          INVALID_HLS_TAG: 4016,
          HLS_INVALID_PLAYLIST_HIERARCHY: 4017,
          DASH_DUPLICATE_REPRESENTATION_ID: 4018,
          HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND: 4020,
          HLS_REQUIRED_ATTRIBUTE_MISSING: 4023,
          HLS_REQUIRED_TAG_MISSING: 4024,
          HLS_COULD_NOT_GUESS_CODECS: 4025,
          HLS_KEYFORMATS_NOT_SUPPORTED: 4026,
          DASH_UNSUPPORTED_XLINK_ACTUATE: 4027,
          DASH_XLINK_DEPTH_LIMIT: 4028,
          CONTENT_UNSUPPORTED_BY_BROWSER: 4032,
          CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM: 4033,
          NO_VARIANTS: 4036,
          PERIOD_FLATTENING_FAILED: 4037,
          INCONSISTENT_DRM_ACROSS_PERIODS: 4038,
          HLS_VARIABLE_NOT_FOUND: 4039,
          HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED: 4040,
          HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED: 4041,
          NO_WEB_CRYPTO_API: 4042,
          CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM: 4045,
          MSS_INVALID_XML: 4046,
          MSS_LIVE_CONTENT_NOT_SUPPORTED: 4047,
          AES_128_INVALID_IV_LENGTH: 4048,
          AES_128_INVALID_KEY_LENGTH: 4049,
          DASH_CONFLICTING_AES_128: 4050,
          DASH_UNSUPPORTED_AES_128: 4051,
          DASH_INVALID_PATCH: 4052,
          HLS_EMPTY_MEDIA_PLAYLIST: 4053,
          DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED: 4054,
          CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM: 4055,
          STREAMING_ENGINE_STARTUP_INVALID_STATE: 5006,
          NO_RECOGNIZED_KEY_SYSTEMS: 6e3,
          REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE: 6001,
          FAILED_TO_CREATE_CDM: 6002,
          FAILED_TO_ATTACH_TO_VIDEO: 6003,
          INVALID_SERVER_CERTIFICATE: 6004,
          FAILED_TO_CREATE_SESSION: 6005,
          FAILED_TO_GENERATE_LICENSE_REQUEST: 6006,
          LICENSE_REQUEST_FAILED: 6007,
          LICENSE_RESPONSE_REJECTED: 6008,
          ENCRYPTED_CONTENT_WITHOUT_DRM_INFO: 6010,
          NO_LICENSE_SERVER_GIVEN: 6012,
          OFFLINE_SESSION_REMOVED: 6013,
          EXPIRED: 6014,
          SERVER_CERTIFICATE_REQUIRED: 6015,
          INIT_DATA_TRANSFORM_ERROR: 6016,
          SERVER_CERTIFICATE_REQUEST_FAILED: 6017,
          MIN_HDCP_VERSION_NOT_MATCH: 6018,
          ERROR_CHECKING_HDCP_VERSION: 6019,
          MISSING_EME_SUPPORT: 6020,
          LOAD_INTERRUPTED: 7e3,
          OPERATION_ABORTED: 7001,
          NO_VIDEO_ELEMENT: 7002,
          OBJECT_DESTROYED: 7003,
          CONTENT_NOT_LOADED: 7004,
          SRC_EQUALS_PRELOAD_NOT_SUPPORTED: 7005,
          PRELOAD_DESTROYED: 7006,
          QUEUE_INDEX_OUT_OF_BOUNDS: 7007,
          CAST_API_UNAVAILABLE: 8e3,
          NO_CAST_RECEIVERS: 8001,
          ALREADY_CASTING: 8002,
          UNEXPECTED_CAST_ERROR: 8003,
          CAST_CANCELED_BY_USER: 8004,
          CAST_CONNECTION_TIMED_OUT: 8005,
          CAST_RECEIVER_APP_UNAVAILABLE: 8006,
          STORAGE_NOT_SUPPORTED: 9e3,
          INDEXED_DB_ERROR: 9001,
          DEPRECATED_OPERATION_ABORTED: 9002,
          REQUESTED_ITEM_NOT_FOUND: 9003,
          MALFORMED_OFFLINE_URI: 9004,
          CANNOT_STORE_LIVE_OFFLINE: 9005,
          NO_INIT_DATA_FOR_OFFLINE: 9007,
          LOCAL_PLAYER_INSTANCE_REQUIRED: 9008,
          NEW_KEY_OPERATION_NOT_SUPPORTED: 9011,
          KEY_NOT_FOUND: 9012,
          MISSING_STORAGE_CELL: 9013,
          STORAGE_LIMIT_REACHED: 9014,
          DOWNLOAD_SIZE_CALLBACK_ERROR: 9015,
          MODIFY_OPERATION_NOT_SUPPORTED: 9016,
          INDEXED_DB_INIT_TIMED_OUT: 9017,
          CS_IMA_SDK_MISSING: 1e4,
          CS_AD_MANAGER_NOT_INITIALIZED: 10001,
          SS_IMA_SDK_MISSING: 10002,
          SS_AD_MANAGER_NOT_INITIALIZED: 10003,
          CURRENT_DAI_REQUEST_NOT_FINISHED: 10004,
          MT_AD_MANAGER_NOT_INITIALIZED: 10005,
          INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED: 10006,
          VAST_INVALID_XML: 10007
        };
        function Hi() {
        }
        function dt(e) {
          if (!e) return "";
          if (e = pe(e), e[0] == 239 && e[1] == 187 && e[2] == 191 && (e = e.subarray(3)), C.TextDecoder && !Se().sh()) return e = new TextDecoder().decode(e), e.includes("�") && Ir('Decoded string contains an "unknown character" codepoint.  That probably means the UTF8 encoding was incorrect!'), e;
          for (var t = "", n = 0; n < e.length; ++n) {
            var r = 65533;
            if ((e[n] & 128) == 0 ? r = e[n] : e.length >= n + 2 && (e[n] & 224) == 192 && (e[n + 1] & 192) == 128 ? (r = (e[n] & 31) << 6 | e[n + 1] & 63, n += 1) : e.length >= n + 3 && (e[n] & 240) == 224 && (e[n + 1] & 192) == 128 && (e[n + 2] & 192) == 128 ? (r = (e[n] & 15) << 12 | (e[n + 1] & 63) << 6 | e[n + 2] & 63, n += 2) : e.length >= n + 4 && (e[n] & 241) == 240 && (e[n + 1] & 192) == 128 && (e[n + 2] & 192) == 128 && (e[n + 3] & 192) == 128 && (r = (e[n] & 7) << 18 | (e[n + 1] & 63) << 12 | (e[n + 2] & 63) << 6 | e[n + 3] & 63, n += 3), r <= 65535) t += String.fromCharCode(r);
            else {
              r -= 65536;
              var i = r & 1023;
              t += String.fromCharCode(55296 + (r >> 10)), t += String.fromCharCode(56320 + i);
            }
          }
          return t;
        }
        function fi(e, t, n) {
          if (!e) return "";
          if (!n && e.byteLength % 2 != 0) throw new b(2, 2, 2004);
          n = Math.floor(e.byteLength / 2);
          var r = new Uint16Array(n);
          e = dn(e);
          for (var i = 0; i < n; i++) r[i] = e.getUint16(i * 2, t);
          return Ia.value()(r);
        }
        function Mr(e) {
          function t(r) {
            return n.byteLength <= r || n[r] >= 9 && n[r] <= 126;
          }
          if (!e) return "";
          var n = pe(e);
          if (n[0] == 239 && n[1] == 187 && n[2] == 191) return dt(n);
          if (n[0] == 254 && n[1] == 255) return fi(n.subarray(2), !1);
          if (n[0] == 255 && n[1] == 254) return fi(n.subarray(2), !0);
          if (n[0] == 0 && n[2] == 0) return fi(e, !1);
          if (n[1] == 0 && n[3] == 0) return fi(e, !0);
          if (t(0) && t(1) && t(2) && t(3)) return dt(e);
          throw new b(2, 2, 2003);
        }
        function sr(e) {
          if (C.TextEncoder && !Se().sh()) {
            var t = new TextEncoder();
            return Kn(t.encode(e));
          }
          e = encodeURIComponent(e), e = unescape(e), t = new Uint8Array(e.length);
          for (var n = 0; n < e.length; n++) t[n] = e[n].charCodeAt(0);
          return Kn(t);
        }
        function xd(e, t) {
          for (var n = new ArrayBuffer(e.length * 2), r = new DataView(n), i = 0; i < e.length; ++i) r.setUint16(i * 2, e.charCodeAt(i), t);
          return n;
        }
        function en(e) {
          var t = { "&amp;": "&", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&apos;": "'", "&nbsp;": " ", "&lrm;": "‎", "&rlm;": "‏" }, n = /&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g, r = RegExp(n.source);
          return e && r.test(e) ? e.replace(n, function(i) {
            return i[1] == "#" ? (i = i[2] == "x" || i[2] == "X" ? parseInt(i.substring(3), 16) : parseInt(i.substring(2), 10), i >= 0 && i <= 1114111 ? String.fromCodePoint(i) : "") : t[i] || "'";
          }) : e || "";
        }
        Y("shaka.util.StringUtils", Hi), Hi.resetFromCharCode = function() {
          Ia.g = void 0;
        }, Hi.toUTF16 = xd, Hi.toUTF8 = sr, Hi.fromBytesAutoDetect = Mr, Hi.fromUTF16 = fi, Hi.fromUTF8 = dt;
        var Ia = new ct(function() {
          function e(n) {
            try {
              var r = new Uint8Array(n);
              return String.fromCharCode.apply(null, r).length > 0;
            } catch {
              return !1;
            }
          }
          for (var t = { Pc: 65536 }; t.Pc > 0; t = { Pc: t.Pc }, t.Pc /= 2) if (e(t.Pc)) return /* @__PURE__ */ (function(n) {
            return function(r) {
              for (var i = "", o = 0; o < r.length; o += n.Pc) i += String.fromCharCode.apply(null, r.subarray(o, o + n.Pc));
              return i;
            };
          })(t);
          return null;
        });
        function Gt() {
        }
        function Ma(e) {
          return e = pe(e), Uint8Array.prototype.toBase64 ? e.toBase64({ alphabet: "base64", omitPadding: !1 }) : (e = Ia.value()(e), btoa(e));
        }
        function _r(e, t) {
          return t = t ?? !0, Uint8Array.prototype.toBase64 ? pe(e).toBase64({ alphabet: "base64url", omitPadding: !t }) : (e = Ma(e).replace(/\+/g, "-").replace(/\//g, "_"), t ? e : e.replace(/[=]*$/, ""));
        }
        function Wn(e) {
          if (!("fromBase64" in Uint8Array)) {
            e = C.atob(e.replace(/-/g, "+").replace(/_/g, "/"));
            for (var t = new Uint8Array(e.length), n = 0; n < e.length; ++n) t[n] = e.charCodeAt(n);
            return t;
          }
          return e = e.replace(/\s+/g, ""), Uint8Array.fromBase64(e, { alphabet: /[-_]/.test(e) ? "base64url" : "base64" });
        }
        function Gi(e) {
          if (!("fromHex" in Uint8Array)) {
            for (var t = e.length / 2, n = new Uint8Array(t), r = 0; r < t; r++) n[r] = C.parseInt(e.substr(r * 2, 2), 16);
            return n;
          }
          return Uint8Array.fromHex(e);
        }
        function hi(e) {
          var t = pe(e);
          if (!Uint8Array.prototype.toHex) {
            e = "", t = m(t);
            for (var n = t.next(); !n.done; n = t.next()) n = n.value, n = n.toString(16), n.length == 1 && (n = "0" + n), e += n;
            return e;
          }
          return t.toHex();
        }
        function St() {
          for (var e = $e.apply(0, arguments), t = 0, n = 0; n < e.length; ++n) t += e[n].byteLength;
          t = new Uint8Array(t);
          for (var r = n = 0; r < e.length; ++r) {
            var i = e[r];
            ArrayBuffer.isView(i) && i.BYTES_PER_ELEMENT === 1 ? t.set(i, n) : t.set(pe(i), n), n += i.byteLength;
          }
          return t;
        }
        Y("shaka.util.Uint8ArrayUtils", Gt), Gt.concat = St, Gt.toHex = hi, Gt.fromHex = Gi, Gt.fromBase64 = Wn, Gt.toBase64 = _r, Gt.toStandardBase64 = Ma;
        function bt(e, t, n) {
          if (n = n === void 0 ? "" : n, t.length == 0) return e;
          if (e.length == 1 && t.length == 1) {
            var r = new yt(e[0]);
            return t = new yt(t[0]), t = r.resolve(t), n && Io(t, n), [t.toString()];
          }
          t = t.map(function(u) {
            return new yt(u);
          }), r = [], e = m(e);
          for (var i = e.next(); !i.done; i = e.next()) {
            i = new yt(i.value);
            for (var o = m(t), s = o.next(); !s.done; s = o.next()) s = i.resolve(s.value), n && Io(s, n), r.push(s.toString());
          }
          return r;
        }
        function Br(e, t, n, r, i) {
          return t = { keySystem: e, encryptionScheme: t, licenseServerUri: "", distinctiveIdentifierRequired: !1, persistentStateRequired: !1, audioRobustness: "", videoRobustness: "", serverCertificate: null, serverCertificateUri: "", sessionType: "", initData: n || [], keyIds: /* @__PURE__ */ new Set(), mediaTypes: i }, r && (t.keySystemUris = /* @__PURE__ */ new Set([r])), !n && ko(e) && t.initData.push({ initDataType: "sinf", initData: new Uint8Array(0), keyId: null }), t;
        }
        function Lg(e, t) {
          t = t === void 0 ? "cenc" : t;
          var n = [], r = [], i = [];
          e.forEach(function(s, u) {
            var a = u;
            a.length != 22 && (a = _r(Gi(u), !1));
            var l = s;
            l.length != 22 && (l = _r(Gi(s), !1)), s = { kty: "oct", kid: a, k: l }, n.push(s), r.push(s.kid), i.push(u);
          }), e = JSON.stringify({ keys: n });
          var o = JSON.stringify({ kids: r });
          return o = [{ initData: pe(sr(o)), initDataType: "keyids" }], {
            keySystem: "org.w3.clearkey",
            encryptionScheme: t,
            licenseServerUri: "data:application/json;base64," + C.btoa(e),
            distinctiveIdentifierRequired: !1,
            persistentStateRequired: !1,
            audioRobustness: "",
            videoRobustness: "",
            serverCertificate: null,
            serverCertificateUri: "",
            sessionType: "",
            initData: o,
            keyIds: new Set(i)
          };
        }
        function Do(e, t) {
          if (t.length == 1) return t[0];
          if (e = fn(e, t), e != null) return e;
          throw new b(2, 4, 4025, t);
        }
        function fn(e, t) {
          var n = Ng.get(e);
          n = m(n);
          for (var r = n.next(); !r.done; r = n.next()) {
            r = r.value;
            for (var i = m(t), o = i.next(); !o.done; o = i.next()) if (o = o.value, r.test(o.trim())) return o.trim();
          }
          return e == xe ? "" : null;
        }
        function Ad(e, t) {
          var n = [];
          e = Ng.get(e), e = m(e);
          for (var r = e.next(); !r.done; r = e.next()) {
            r = r.value;
            for (var i = m(t), o = i.next(); !o.done; o = i.next()) o = o.value, r.test(o.trim()) && n.push(o.trim());
          }
          return n;
        }
        var xe = "text", xt = { wa: "video", aa: "audio", Na: xe, Vf: "image", ql: "application" }, bg = 1 / 15, Ng = (/* @__PURE__ */ new Map()).set("audio", [/^vorbis$/, /^Opus$/, /^opus$/, /^fLaC$/, /^flac$/, /^mp4a/, /^[ae]c-3$/, /^ac-4/, /^dts[cex]$/, /^iamf/, /^mhm[12]/, /^ac3$/, /^eac3$/, /^apac$/]).set("video", [/^avc/, /^hev/, /^hvc/, /^vvc/, /^vvi/, /^vp0?[89]/, /^av01/, /^dvh/, /^dva/, /^dav/]).set("text", [/^vtt$/, /^wvtt/, /^stpp/]);
        function Gs(e, t, n, r) {
          this.g = null, this.l = e, this.i = t, this.m = n, this.o = r, this.j = !1;
          e: {
            if (typeof libDPIModule > "u" && De("Could not find LCEVC Library dependencies on this page"), typeof LCEVCdec < "u") this.h = LCEVCdec;
            else if (typeof LcevcDil < "u") this.h = LcevcDil, this.j = !0, Ne("LcevcDil", "lcevc_dil.js is deprecated, please use lcevc_dec.js instead");
            else {
              De("Could not find LCEVC Library on this page"), e = !1;
              break e;
            }
            typeof this.h.SupportObject > "u" ? (De("Could not find LCEVC Library on this page"), e = !1) : (this.h.SupportObject.SupportStatus || De(this.h.SupportObject.SupportError), e = typeof this.h < "u" && typeof libDPIModule < "u" && this.i instanceof HTMLCanvasElement && this.h.SupportObject.SupportStatus);
          }
          e && !this.g && this.h.SupportObject.webGLSupport(this.i) && (this.i.classList.remove("shaka-hidden"), this.g = this.j ? new this.h.LcevcDil(this.l, this.i, this.m) : new this.h.LCEVCdec(this.l, this.i, this.m));
        }
        function Ca(e, t, n, r) {
          r.type !== "video" || e.o && !r.baseOriginalId || e.g && e.g.appendBuffer(t, "video", r.id, -n, !e.o);
        }
        function Og(e) {
          e.g && e.i.classList.add("shaka-hidden");
        }
        Gs.prototype.release = function() {
          this.g && (this.g.close(), this.g = null);
        };
        function jg(e) {
          return e && typeof LCEVCdec < "u" ? e.codecs == "lvc1" : !1;
        }
        Y("shaka.lcevc.Dec", Gs), Gs.prototype.release = Gs.prototype.release;
        function Ks() {
        }
        function Ki(e, t) {
          Ro.set(e, t);
        }
        function mx() {
          var e = {};
          if (Se(), br()) for (var t = m(Ro.keys()), n = t.next(); !n.done; n = t.next()) e[n.value] = !0;
          for (t = m(["application/dash+xml", "application/x-mpegurl", "application/vnd.apple.mpegurl", "application/vnd.ms-sstr+xml"]), n = t.next(); !n.done; n = t.next()) n = n.value, e[n] = br() ? Ro.has(n) : oo().canPlayType(n) != "";
          return e;
        }
        function Ug(e, t) {
          if (t) {
            var n = Ro.get(t.toLowerCase());
            if (n) return n;
          }
          throw new b(2, 4, 4e3, e, t);
        }
        Y("shaka.media.ManifestParser", Ks), Ks.unregisterParserByMime = function(e) {
          Ro.delete(e);
        }, Ks.registerParserByMime = Ki, Ks.registerParserByExtension = function() {
          Ne("ManifestParser.registerParserByExtension", "Please use an ManifestParser with registerParserByMime function.");
        }, Ks.AccessibilityPurpose = { Am: "visually impaired", Ll: "hard of hearing", hm: "spoken subtitles" };
        var Ro = /* @__PURE__ */ new Map();
        function Ws() {
        }
        Ws.prototype.extract = function() {
        }, Ws.prototype.decode = function() {
          return [];
        }, Ws.prototype.clear = function() {
        }, Ws.prototype.getStreams = function() {
          return [];
        };
        function Ed() {
        }
        Ed.prototype.init = function() {
        }, Ed.prototype.parse = function() {
          return [];
        };
        function ur(e) {
          this.h = /* @__PURE__ */ new Map(), this.i = 0, this.j = new Ed(), (e = _g(e.toLowerCase())) && (this.j = e()), this.g = new Ws(), (e = Wi) && (this.g = e(), this.h.set(this.i, this.g));
        }
        ur.prototype.init = function(e, t, n) {
          if (t = t === void 0 ? !1 : t, n = n === void 0 ? -1 : n, n != -1 && this.i != n) {
            t = n;
            var r = this.h.get(t);
            this.h.set(this.i, this.g), r ? this.g = r : ((r = Wi) && (this.g = r()), this.h.set(t, this.g));
          } else t || this.g.clear();
          this.j.init(e), n != -1 && (this.i = n);
        };
        function Id(e, t) {
          t = e.j.parse(t), t = m(t);
          for (var n = t.next(); !n.done; n = t.next()) {
            n = n.value;
            var r = pe(n.packet);
            r.length > 0 && e.g.extract(r, n.pts);
          }
          return e.g.decode();
        }
        ur.prototype.remove = function(e) {
          e = e === void 0 ? [] : e, e = new Set(e);
          for (var t = m(this.h.keys()), n = t.next(); !n.done; n = t.next()) if (n = n.value, !e.has(n)) {
            var r = this.h.get(n);
            r && r.clear(), this.h.delete(n);
          }
        };
        function Md(e, t) {
          Cd.set(e, t);
        }
        function _g(e) {
          return Cd.get(e);
        }
        Y("shaka.media.ClosedCaptionParser", ur), ur.findDecoder = function() {
          return Wi;
        }, ur.unregisterDecoder = function() {
          Wi = null;
        }, ur.registerDecoder = function(e) {
          Wi = e;
        }, ur.findParser = _g, ur.unregisterParser = function(e) {
          Cd.delete(e);
        }, ur.registerParser = Md;
        var Cd = /* @__PURE__ */ new Map(), Wi = null;
        function zi() {
          this.id = "", this.regionAnchorY = this.regionAnchorX = this.viewportAnchorY = this.viewportAnchorX = 0, this.height = this.width = 100, this.viewportAnchorUnits = this.widthUnits = this.heightUnits = Sn, this.scroll = Bg;
        }
        Y("shaka.text.CueRegion", zi);
        var Sn = 1;
        zi.units = { PX: 0, PERCENTAGE: Sn, LINES: 2 };
        var Bg = "";
        zi.scrollMode = { NONE: Bg, UP: "up" };
        function Lo(e) {
          this.h = e || "", this.g = 0;
        }
        function bo(e) {
          pi(e, /[ \t]+/gm);
        }
        function pi(e, t) {
          return t.lastIndex = e.g, t = t.exec(e.h), t = t == null ? null : { position: t.index, length: t[0].length, results: t }, e.g == e.h.length || t == null || t.position != e.g ? null : (e.g += t.length, t.results);
        }
        function Xi(e) {
          return e.g == e.h.length ? null : (e = pi(e, /[^ \t\n]*/gm)) ? e[0] : null;
        }
        function zs(e) {
          if (e = pi(e, vx), e == null) return null;
          var t = Number(e[2]), n = Number(e[3]);
          return t > 59 || n > 59 ? null : (Number(e[6]) || 0) / 1e3 + n + t * 60 + (Number(e[1]) || 0) * 3600;
        }
        function No(e) {
          return e ? zs(new Lo(e)) : null;
        }
        var vx = /(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;
        function ka() {
        }
        function ar(e) {
          function t(r) {
            switch (typeof r) {
              case "undefined":
              case "boolean":
              case "number":
              case "string":
              case "symbol":
              case "function":
                return r;
              default:
                if (!r || ArrayBuffer.isView(r)) return r;
                if (n.has(r)) return null;
                var i = Array.isArray(r);
                if (r.constructor != Object && !i) return null;
                n.add(r);
                var o = i ? [] : {}, s;
                for (s in r) o[s] = t(r[s]);
                return i && (o.length = r.length), o;
            }
          }
          var n = /* @__PURE__ */ new WeakSet();
          return t(e);
        }
        function gi(e) {
          var t = {}, n;
          for (n in e) t[n] = e[n];
          return t;
        }
        function Pa(e) {
          if (Array.isArray(e)) {
            for (var t = [], n = 0; n < e.length; n++) {
              var r = n.toString(), i = e[n];
              i !== void 0 && (i = Pa(i)) && t.push(r + ":" + i);
            }
            e = "[" + t.join(",") + "]";
          } else if (typeof e == "function") e = "";
          else if (e instanceof Object) {
            for (n = Object.keys(e), n.sort(), t = [], n = m(n), r = n.next(); !r.done; r = n.next()) i = r.value, r = JSON.stringify(i), i = e[i], i !== void 0 && (i = Pa(i)) && t.push(r + ":" + i);
            e = "{" + t.join(",") + "}";
          } else e = JSON.stringify(e);
          return e;
        }
        Y("shaka.util.ObjectUtils", ka), ka.alphabeticalKeyOrderStringify = Pa, ka.shallowCloneObject = gi, ka.cloneObject = ar;
        function Xs(e, t) {
          var n = n === void 0 ? !1 : n;
          return e = Mr(e), qi(e, t, n);
        }
        function qi(e, t, n) {
          if (e = yx(e, n === void 0 ? !1 : n), !t && e.length) return e[0];
          var r = t.split(",");
          return (t = e.find(function(i) {
            return r.includes(i.tagName);
          })) ? t : null;
        }
        function kd(e) {
          return Dd.has(e) ? Dd.get(e) : "";
        }
        function yx(e, t) {
          function n(o, s) {
            s = s === void 0 ? !1 : s;
            for (var u = []; e[i]; ) if (e.charCodeAt(i) == 60) {
              if (e.charCodeAt(i + 1) === 47) {
                s = i + 2, i = e.indexOf(">", i), s = e.substring(s, i);
                var a = s.indexOf(o);
                if (a == -1) {
                  var l = o.indexOf(".");
                  l > 0 && (a = s.indexOf(o.substring(0, l)));
                }
                if (a == -1) throw o = e.substring(0, i).split(`
`), Error(`Unexpected close tag
Line: ` + (o.length - 1) + `
Column: ` + (o[o.length - 1].length + 1) + `
Char: ` + e[i]);
                i + 1 && (i += 1);
                break;
              } else if (e.charCodeAt(i + 1) === 33) {
                if (e.charCodeAt(i + 2) == 45) {
                  for (; i !== -1 && (e.charCodeAt(i) !== 62 || e.charCodeAt(i - 1) != 45 || e.charCodeAt(i - 2) != 45 || i == -1); ) i = e.indexOf(">", i + 1);
                  i === -1 && (i = e.length);
                } else if (e.charCodeAt(i + 2) === 91 && e.charCodeAt(i + 8) === 91 && e.substr(i + 3, 5).toLowerCase() === "cdata") {
                  a = e.indexOf("]]>", i), a == -1 ? (u.push(e.substr(i + 9)), i = e.length) : (u.push(e.substring(i + 9, a)), i = a + 3);
                  continue;
                }
                i++;
                continue;
              }
              e: {
                l = s, i++;
                var c = r(), d = {};
                for (a = []; e.charCodeAt(i) !== 62 && e[i]; ) {
                  var h = e.charCodeAt(i);
                  if (h > 64 && h < 91 || h > 96 && h < 123) {
                    h = r();
                    for (var p = e.charCodeAt(i); p && p !== 39 && p !== 34 && !(p > 64 && p < 91 || p > 96 && p < 123) && p !== 62; ) i++, p = e.charCodeAt(i);
                    var g = i + 1;
                    if (i = e.indexOf(e[i], g), g = (" " + e.slice(g, i)).slice(1), p === 39 || p === 34) {
                      if (i === -1) {
                        if (l = { tagName: c, attributes: d, children: a, parent: null }, t) for (c = 0; c < a.length; c++) typeof a[c] != "string" && (a[c].parent = l);
                        a = l;
                        break e;
                      }
                    } else g = null, i--;
                    if (h.startsWith("xmlns:")) {
                      p = g;
                      var w = h.split(":")[1];
                      Dd.set(p, w), Rd.set(w, p);
                    }
                    c === "tt" && h === "xml:space" && g === "preserve" && (l = !0), d[h] = g;
                  }
                  i++;
                }
                for (e.charCodeAt(i - 1) !== 47 ? (i++, a = n(c, l)) : i++, l = { tagName: c, attributes: d, children: a, parent: null }, c = a.length, d = 0; d < c; d++) h = a[d], typeof h != "string" ? t && (h.parent = l) : d == c - 1 && h == `
` && a.pop();
                a = l;
              }
              if (u.push(a), typeof a == "string") break;
              a.tagName[0] === "?" && a.children && (u.push.apply(u, X(a.children)), a.children = []);
            } else a = i, i = e.indexOf("<", i) - 1, i === -2 && (i = e.length), a = (" " + e.slice(a, i + 1)).slice(1), s ? a.length > 0 && u.push(a) : (u.length && a.length == 1 && a[0] == `
` || a.trim().length > 0) && u.push(a), i++;
            return u;
          }
          function r() {
            for (var o = i; `\r
	>/= `.indexOf(e[i]) === -1 && e[i]; ) i++;
            return (" " + e.slice(o, i)).slice(1);
          }
          var i = 0;
          return n("");
        }
        function Da(e) {
          return typeof e == "string";
        }
        function Fg(e) {
          var t = [];
          if (!e.children) return [];
          e = m(e.children);
          for (var n = e.next(); !n.done; n = e.next()) n = n.value, typeof n != "string" && t.push(n);
          return t;
        }
        function We(e, t) {
          var n = [];
          if (!e.children) return [];
          e = m(e.children);
          for (var r = e.next(); !r.done; r = e.next()) r = r.value, r.tagName === t && n.push(r);
          return n;
        }
        function wt(e) {
          if (typeof e == "string") return en(e);
          var t = [];
          e = m(e.children);
          for (var n = e.next(); !n.done; n = e.next()) n = n.value, typeof n == "string" && t.push(n);
          return t = t.join(""), t === "" ? null : en(t);
        }
        function tn(e) {
          for (var t = m(e.children), n = t.next(); !n.done; n = t.next()) if (typeof n.value != "string") return null;
          return (e = wt(e)) && (e = e.trim()), e;
        }
        function wr(e, t, n) {
          if (n = n === void 0 ? [] : n, e.tagName === t && n.push(e), e.children) {
            e = m(e.children);
            for (var r = e.next(); !r.done; r = e.next()) wr(r.value, t, n);
          }
          return n;
        }
        function ut(e, t) {
          return e = We(e, t), e.length != 1 ? null : e[0];
        }
        function zn(e, t, n) {
          return e = Vg(e, t, n), e.length != 1 ? null : e[0];
        }
        function ge(e, t, n, r) {
          r = r === void 0 ? null : r;
          var i = null;
          return e = e.attributes[t], e != null && (i = n(e)), i ?? r;
        }
        function Fr(e, t, n) {
          return t = kd(t), e.attributes[t + ":" + n] || null;
        }
        function Vg(e, t, n) {
          var r = kd(t);
          if (t = [], e.children) for (n = r ? r + ":" + n : n, e = m(e.children), r = e.next(); !r.done; r = e.next()) (r = r.value) && r.tagName === n && t.push(r);
          return t;
        }
        function Cr(e, t, n) {
          t = m(t);
          for (var r = t.next(); !r.done; r = t.next()) if (r = Fr(e, r.value, n)) return r;
          return null;
        }
        function Vr(e) {
          return e ? (/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e) && (e += "Z"), e = Date.parse(e), isNaN(e) ? null : e / 1e3) : null;
        }
        function kr(e) {
          return !e || (e = RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$", "i").exec(e), !e) ? null : (e = 31536e3 * Number(e[1] || null) + 2592e3 * Number(e[2] || null) + 86400 * Number(e[3] || null) + 3600 * Number(e[4] || null) + 60 * Number(e[5] || null) + Number(e[6] || null), isFinite(e) ? e : null);
        }
        function Ra(e) {
          var t = /([0-9]+)-([0-9]+)/.exec(e);
          return !t || (e = Number(t[1]), !isFinite(e)) ? null : (t = Number(t[2]), isFinite(t) ? { start: e, end: t } : null);
        }
        function Ut(e) {
          return e = Number(e), e % 1 === 0 ? e : null;
        }
        function Pr(e) {
          return e = Number(e), e % 1 === 0 && e > 0 ? e : null;
        }
        function _t(e) {
          return e = Number(e), e % 1 === 0 && e >= 0 ? e : null;
        }
        function La(e) {
          return e = Number(e), isNaN(e) ? null : e;
        }
        function ba(e) {
          return e ? e.toLowerCase() === "true" : !1;
        }
        function wx(e) {
          var t, n = (t = e.match(/^(\d+)\/(\d+)$/)) ? Number(t[1]) / Number(t[2]) : Number(e);
          return isNaN(n) ? null : n;
        }
        function Na(e) {
          var t = [];
          e = en(e).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/), e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) {
            n = n.value;
            var r = n.match(/^([\w]+)/);
            if (r) {
              var i = n.match(/(@id='(.*?)')/), o = n.match(/(@t='(\d+)')/), s = n.match(/(@n='(\d+)')/), u = n.match(/\[(\d+)\]/);
              t.push({ name: r[0], id: i ? i[0].match(/'(.*?)'/)[0].replace(/'/gm, "") : null, t: o ? Number(o[0].match(/'(.*?)'/)[0].replace(/'/gm, "")) : null, n: s ? Number(s[0].match(/'(.*?)'/)[0].replace(/'/gm, "")) : null, position: u ? Number(u[1]) - 1 : null, Ec: n.split("/@")[1] || null });
            } else n.startsWith("@") && t.length && (t[t.length - 1].Ec = n.slice(1));
          }
          return t;
        }
        function Hg(e, t) {
          var n = Na(t.attributes.sel || "");
          if (n.length) {
            var r = n[n.length - 1], i = t.attributes.pos || null;
            n = r.position, n == null && (r.t !== null && (n = Gg(e, "t", r.t)), r.n !== null && (n = Gg(e, "n", r.n))), n === null ? n = i === "prepend" ? 0 : e.length : i === "prepend" ? --n : i === "after" && ++n, i = t.tagName, (r = r.Ec) && e[n] ? Kg(e[n], i, r, tn(t) || "") : (i !== "remove" && i !== "replace" || e.splice(n, 1), i !== "add" && i !== "replace" || e.splice.apply(e, [n, 0].concat(X(t.children))));
          }
        }
        function Gg(e, t, n) {
          var r = 0;
          e = m(e);
          for (var i = e.next(); !i.done; i = e.next()) {
            if (Number(i.value.attributes[t]) === n) return r;
            r++;
          }
          return null;
        }
        function Kg(e, t, n, r) {
          t === "remove" ? delete e.attributes[n] : (t === "add" || t === "replace") && (e.attributes[n] = r);
        }
        function Wg(e) {
          var t = "", n = e.tagName.split(":");
          n.length > 0 && (t = n[0], t = Rd.has(t) ? Rd.get(t) : ""), t = document.createElementNS(t, e.tagName);
          for (var r in e.attributes) t.setAttribute(r, e.attributes[r]);
          for (e = m(e.children), r = e.next(); !r.done; r = e.next()) r = r.value, n = void 0, typeof r == "string" ? n = new Text(r) : n = Wg(r), t.appendChild(n);
          return t;
        }
        function Pd(e) {
          if (!e) return null;
          var t = { tagName: e.tagName, attributes: gi(e.attributes), children: [], parent: null };
          e = m(e.children);
          for (var n = e.next(); !n.done; n = e.next()) n = n.value, typeof n == "string" || (n = Pd(n), n.parent = t), t.children.push(n);
          return t;
        }
        var Dd = /* @__PURE__ */ new Map(), Rd = /* @__PURE__ */ new Map();
        function ot(e, t, n) {
          this.startTime = e, this.endTime = t, this.payload = n, this.region = new zi(), this.position = null, this.positionAlign = Ua, this.size = 0, this.textAlign = Dr, this.direction = $s, this.writingMode = Yi, this.lineInterpretation = Js, this.line = null, this.lineHeight = "", this.lineAlign = $i, this.displayAlign = Ys, this.fontSize = this.border = this.backgroundImage = this.backgroundColor = this.color = "", this.fontWeight = Qg, this.fontStyle = Nd, this.linePadding = this.letterSpacing = this.fontFamily = "", this.opacity = 1, this.textCombineUpright = "", this.textDecoration = [], this.textStrokeWidth = this.textStrokeColor = this.textShadow = "", this.wrapLine = !0, this.id = "", this.nestedCues = [], this.lineBreak = this.isContainer = !1, this.rubyTag = null, this.cellResolution = { columns: 32, rows: 15 };
        }
        function zg(e, t) {
          return e = new ot(e, t, ""), e.lineBreak = !0, e;
        }
        ot.prototype.clone = function() {
          var e = new ot(0, 0, ""), t;
          for (t in this) e[t] = this[t], Array.isArray(e[t]) && (e[t] = e[t].slice());
          return e;
        };
        function Oa(e, t) {
          if (e.payload != t.payload || !(Math.abs(e.startTime - t.startTime) < 1e-3 && Math.abs(e.endTime - t.endTime) < 1e-3)) return !1;
          for (var n in e) if (n != "startTime" && n != "endTime" && n != "payload") {
            if (n == "nestedCues") {
              if (!di(e.nestedCues, t.nestedCues, Oa)) return !1;
            } else if (n == "region" || n == "cellResolution") {
              for (var r in e[n])
                if (e[n][r] != t[n][r]) return !1;
            } else if (Array.isArray(e[n])) {
              if (!di(e[n], t[n])) return !1;
            } else if (e[n] != t[n]) return !1;
          }
          return !0;
        }
        function ja(e, t) {
          t = t === void 0 ? /* @__PURE__ */ new Map() : t;
          var n = e.payload;
          if (n.includes("<")) {
            t.size === 0 && Xg(t);
            var r = n;
            n = [];
            for (var i = -1, o = 0; o < r.length; o++) r[o] === "<" ? i = o + 1 : r[o] === ">" && i > 0 && (i = r.substr(i, o - i), i.match(Sx) && n.push(i), i = -1);
            for (n = m(n), o = n.next(); !o.done; o = n.next()) o = o.value, r = r.replace("<" + o + ">", '<div time="' + o + '">'), r += "</div>";
            e: {
              o = r, i = [];
              var s = -1;
              n = "", r = !1;
              for (var u = 0; u < o.length; u++) if (o[u] === "/") {
                var a = o.indexOf(">", u);
                if (a === -1) {
                  n = o;
                  break e;
                }
                if ((a = o.substring(u + 1, a)) && a == "v") {
                  r = !0;
                  var l = null;
                  if (i.length && (l = i[i.length - 1]), l) {
                    if (l === a) n += "/" + a + ">";
                    else {
                      if (!l.startsWith("v")) {
                        n += o[u];
                        continue;
                      }
                      n += "/" + l + ">";
                    }
                    u += a.length + 1;
                  } else n += o[u];
                } else n += o[u];
              } else o[u] === "<" ? (s = u + 1, o[s] != "v" && (s = -1)) : o[u] === ">" && s > 0 && (i.push(o.substr(s, u - s)), s = -1), n += o[u];
              for (o = m(i), i = o.next(); !i.done; i = o.next()) i = i.value, s = i.replace(" ", ".voice-"), n = n.replace("<" + i + ">", "<" + s + ">"), n = n.replace("</" + i + ">", "</" + s + ">"), r || (n += "</" + s + ">");
            }
            n = Tx(n), e.payload = "", r = "<span>" + n.replace(/\n/g, "<br />") + "</span>";
            try {
              var c = qi(r, "span");
            } catch {
            }
            if (c) if (c = c.children, c.length != 1 || c[0].tagName) for (c = m(c), n = c.next(); !n.done; n = c.next()) qg(n.value, e, t);
            else e.payload = en(n);
            else e.payload = en(n);
          } else e.payload = en(n);
        }
        function Xg(e) {
          for (var t = m(Object.entries($g)), n = t.next(); !n.done; n = t.next()) {
            var r = m(n.value);
            n = r.next().value, r = r.next().value;
            var i = new ot(0, 0, "");
            i.color = r, e.set("." + n, i);
          }
          for (t = m(Object.entries(Jg)), n = t.next(); !n.done; n = t.next()) r = m(n.value), n = r.next().value, r = r.next().value, i = new ot(0, 0, ""), i.backgroundColor = r, e.set("." + n, i);
        }
        function Tx(e) {
          var t = { "< ": "", " >": " &gt;" }, n = /(< +>|<\s|\s>)/g, r = RegExp(n.source);
          return e && r.test(e) ? e.replace(n, function(i) {
            return t[i] || "";
          }) : e || "";
        }
        function qg(e, t, n) {
          var r = t.clone();
          if (r.nestedCues = [], r.payload = "", r.rubyTag = "", r.line = null, r.region = new zi(), r.position = null, r.size = 0, r.textAlign = Dr, e.tagName) for (var i = m(e.tagName.split(/(?=[ .])+/g)), o = i.next(); !o.done; o = i.next()) {
            var s = o = o.value;
            if (s.startsWith(".voice-")) {
              var u = s.split("-").pop();
              s = 'v[voice="' + u + '"]', n.has(s) || (s = "v[voice=" + u + "]");
            }
            switch (n.has(s) && (u = r, s = n.get(s)) && (u.backgroundColor = qs(s.backgroundColor, u.backgroundColor), u.color = qs(s.color, u.color), u.fontFamily = qs(s.fontFamily, u.fontFamily), u.fontSize = qs(s.fontSize, u.fontSize), u.textShadow = qs(s.textShadow, u.textShadow), u.fontWeight = s.fontWeight, u.fontStyle = s.fontStyle, u.opacity = s.opacity, u.rubyTag = s.rubyTag, u.textCombineUpright = s.textCombineUpright, u.wrapLine = s.wrapLine), o) {
              case "br":
                r = zg(r.startTime, r.endTime), t.nestedCues.push(r);
                return;
              case "b":
                r.fontWeight = Oo;
                break;
              case "i":
                r.fontStyle = jo;
                break;
              case "u":
                r.textDecoration.push(Hr);
                break;
              case "font":
                (o = e.attributes.color) && (r.color = o);
                break;
              case "div":
                if (o = e.attributes.time, !o) break;
                (o = No(o)) && (r.startTime = o);
                break;
              case "ruby":
              case "rp":
              case "rt":
                r.rubyTag = o;
            }
          }
          if (i = e.children, Da(e) || i.length == 1 && Da(i[0])) for (n = wt(e).split(`
`), e = !0, n = m(n), i = n.next(); !i.done; i = n.next()) i = i.value, e || (e = zg(r.startTime, r.endTime), t.nestedCues.push(e)), i.length > 0 && (e = r.clone(), e.payload = en(i), t.nestedCues.push(e)), e = !1;
          else for (t.nestedCues.push(r), t = m(i), e = t.next(); !e.done; e = t.next()) qg(e.value, r, n);
        }
        function qs(e, t) {
          return e && e.length > 0 ? e : t;
        }
        Y("shaka.text.Cue", ot), ot.parseCuePayload = ja, ot.equal = Oa, ot.prototype.clone = ot.prototype.clone;
        var Ua = "auto";
        ot.positionAlign = { LEFT: "line-left", RIGHT: "line-right", CENTER: "center", AUTO: Ua };
        var Dr = "center", Ld = { LEFT: "left", RIGHT: "right", CENTER: Dr, START: "start", END: "end" };
        ot.textAlign = Ld;
        var Ys = "after", Yg = { BEFORE: "before", CENTER: "center", AFTER: Ys };
        ot.displayAlign = Yg;
        var $s = "ltr";
        ot.direction = { HORIZONTAL_LEFT_TO_RIGHT: $s, HORIZONTAL_RIGHT_TO_LEFT: "rtl" };
        var Yi = "horizontal-tb";
        ot.writingMode = { HORIZONTAL_TOP_TO_BOTTOM: Yi, VERTICAL_LEFT_TO_RIGHT: "vertical-lr", VERTICAL_RIGHT_TO_LEFT: "vertical-rl" };
        var Js = 0;
        ot.lineInterpretation = { LINE_NUMBER: Js, PERCENTAGE: 1 };
        var $i = "start", bd = { CENTER: "center", START: $i, END: "end" };
        ot.lineAlign = bd;
        var $g = { white: "white", lime: "lime", cyan: "cyan", red: "red", yellow: "yellow", magenta: "magenta", blue: "blue", black: "black" };
        ot.defaultTextColor = $g;
        var Jg = { bg_white: "white", bg_lime: "lime", bg_cyan: "cyan", bg_red: "red", bg_yellow: "yellow", bg_magenta: "magenta", bg_blue: "blue", bg_black: "black" };
        ot.defaultTextBackgroundColor = Jg;
        var Qg = 400, Oo = 700;
        ot.fontWeight = { NORMAL: Qg, BOLD: Oo };
        var Nd = "normal", jo = "italic", Zg = { NORMAL: Nd, ITALIC: jo, OBLIQUE: "oblique" };
        ot.fontStyle = Zg;
        var Hr = "underline";
        ot.textDecoration = { UNDERLINE: Hr, LINE_THROUGH: "lineThrough", OVERLINE: "overline" };
        var Sx = /(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;
        function mi() {
        }
        mi.prototype.destroy = function() {
        };
        function Gr(e, t, n) {
          Od.set(e.toLowerCase().split(";")[0] + "-" + n, { priority: n, yf: t });
        }
        function Uo(e, t) {
          for (var n = e.toLowerCase().split(";")[0], r = m([em, Ud, jd, vi]), i = r.next(); !i.done; i = r.next()) if (i = Od.get(n + "-" + i.value)) {
            var o = i.yf(), s = o.isSupported(e, t);
            if (o.destroy(), s) return i.yf;
          }
          return null;
        }
        Y("shaka.transmuxer.TransmuxerEngine", mi), mi.findTransmuxer = Uo, mi.unregisterTransmuxer = function(e, t) {
          Od.delete(e.toLowerCase().split(";")[0] + "-" + t);
        }, mi.registerTransmuxer = Gr, mi.prototype.destroy = mi.prototype.destroy;
        var Od = /* @__PURE__ */ new Map(), vi = 1, jd = 2, Ud = 3, em = 4;
        mi.PluginPriority = { FALLBACK: vi, PREFERRED_SECONDARY: jd, PREFERRED: Ud, APPLICATION: em };
        function _d() {
        }
        function gt(e, t) {
          var n = e;
          return t && !Kr.includes(e) && (n += '; codecs="' + t + '"'), n;
        }
        function _a(e, t) {
          return t && (e += '; codecs="' + t + '"'), e;
        }
        function Bd(e, t, n) {
          var r = gt(e, t);
          return t = _a(e, t), Uo(t) ? (e = Uo(t)) ? (e = e(), n = e.convertCodecs(n, t), e.destroy()) : n = t : n = e != "video/mp2t" && n == "audio" ? r.replace("video", "audio") : r, n;
        }
        function Qs(e) {
          return e.split(";")[0].split("/")[1];
        }
        function Kt(e) {
          var t = tm(e);
          switch (e = t[0].toLowerCase(), t = t[1].toLowerCase(), !0) {
            case (e === "mp4a" && t === "69"):
            case (e === "mp4a" && t === "6b"):
            case (e === "mp4a" && t === "40.34"):
              return "mp3";
            case (e === "mp4a" && t === "66"):
            case (e === "mp4a" && t === "67"):
            case (e === "mp4a" && t === "68"):
            case (e === "mp4a" && t === "40.2"):
            case (e === "mp4a" && t === "40.02"):
            case (e === "mp4a" && t === "40.5"):
            case (e === "mp4a" && t === "40.05"):
            case (e === "mp4a" && t === "40.29"):
            case (e === "mp4a" && t === "40.42"):
              return "aac";
            case (e === "mp4a" && t === "a5"):
            case e === "ac3":
            case e === "ac-3":
              return "ac-3";
            case (e === "mp4a" && t === "a6"):
            case e === "eac3":
            case e === "ec-3":
              return "ec-3";
            case e === "ac-4":
              return "ac-4";
            case (e === "mp4a" && t === "b2"):
              return "dtsx";
            case (e === "mp4a" && t === "a9"):
              return "dtsc";
            case e === "vp09":
            case e === "vp9":
              return "vp9";
            case e === "avc1":
            case e === "avc3":
              return "avc";
            case e === "hvc1":
            case e === "hev1":
              return "hevc";
            case e === "vvc1":
            case e === "vvi1":
              return "vvc";
            case e === "dvh1":
            case e === "dvhe":
              return t && t.startsWith("05") ? "dovi-p5" : "dovi-hevc";
            case e === "dvav":
            case e === "dva1":
              return "dovi-avc";
            case e === "dav1":
              return "dovi-av1";
            case e === "dvc1":
            case e === "dvi1":
              return "dovi-vvc";
            case e === "lvc1":
              return "lcevc";
          }
          return e;
        }
        function yi(e) {
          var t = [];
          e = m(e.split(","));
          for (var n = e.next(); !n.done; n = e.next()) n = tm(n.value), t.push(n[0]);
          return t.sort().join(",");
        }
        function xn(e) {
          return e.split(";")[0];
        }
        function hn(e) {
          return e = e.split(/ *; */), e.shift(), (e = e.find(function(t) {
            return t.startsWith("codecs=");
          })) ? e.split("=")[1].replace(/^"|"$/g, "") : "";
        }
        function Ba(e) {
          return e === "application/x-mpegurl" || e === "application/vnd.apple.mpegurl";
        }
        function tm(e) {
          e = e.split(".");
          var t = e[0];
          return e.shift(), [t, e.join(".")];
        }
        Y("shaka.util.MimeUtils", _d), _d.getFullTypeWithAllCodecs = _a, _d.getFullType = gt, (/* @__PURE__ */ new Map()).set("codecs", "codecs").set("frameRate", "framerate").set("bandwidth", "bitrate").set("width", "width").set("height", "height").set("channelsCount", "channels");
        var Kr = ["audio/aac", "audio/ac3", "audio/ec3", "audio/mpeg"];
        function Wr(e) {
          this.i = null, this.l = e, this.B = this.G = !1, this.m = this.u = 0, this.o = 1 / 0, this.h = this.g = null, this.F = "", this.C = function() {
          }, this.j = /* @__PURE__ */ new Map();
        }
        function Bt(e, t) {
          tu.set(e, t);
        }
        function Zs(e) {
          return tu.get(e);
        }
        function eu(e) {
          return tu.has(e) ? !0 : e == "application/cea-608" || e == "application/cea-708" ? !!Wi : !1;
        }
        Wr.prototype.destroy = function() {
          return this.l = this.i = null, this.j.clear(), Promise.resolve();
        };
        function xx(e, t, n, r, i) {
          var o, s, u, a, l, c, d, h;
          return D(function(p) {
            if (p.g == 1) return x(p, Promise.resolve(), 2);
            if (!e.i || !e.l) return p.return();
            if (n == null || r == null) return e.i.parseInit(pe(t)), p.return();
            for (o = e.B ? 0 : e.u, s = e.G || e.B ? n : e.u, u = { periodStart: o, segmentStart: n, segmentEnd: r, vttOffset: s }, a = e.i.parseMedia(pe(t), u, i, []), l = m(a), c = l.next(); !c.done; c = l.next()) d = c.value, e.C(d, i || null, u);
            h = a.filter(function(g) {
              return g.startTime >= e.m && g.startTime < e.o;
            }), e.l.append(h), e.g == null && (e.g = Math.max(n, e.m)), e.h = Math.min(
              r,
              e.o
            ), q(p);
          });
        }
        Wr.prototype.remove = function(e, t, n) {
          n = n === void 0 ? !1 : n;
          var r = this;
          return D(function(i) {
            if (i.g == 1) return x(i, Promise.resolve(), 2);
            if (e >= t || n && (Ix(r, e, t), r.F === "")) return i.return();
            r.l && r.l.remove(e, t) && r.g != null && (t <= r.g || e >= r.h || (e <= r.g && t >= r.h ? r.g = r.h = null : e <= r.g && t < r.h ? r.g = t : e > r.g && t >= r.h && (r.h = e)), im(r)), q(i);
          });
        };
        function Ax(e, t, n) {
          e.m = t, e.o = n;
        }
        function nm(e, t, n) {
          e.F = t, (t = e.j.get(t)) && (t = t.filter(function(r) {
            return r.endTime <= n;
          }), t.length && e.l.append(t));
        }
        function rm(e, t, n) {
          t.startTime += n, t.endTime += n, t = m(t.nestedCues);
          for (var r = t.next(); !r.done; r = t.next()) rm(e, r.value, n);
        }
        function Ex(e, t, n) {
          var r = /* @__PURE__ */ new Map();
          t = m(t);
          for (var i = t.next(); !i.done; i = t.next()) {
            var o = i.value;
            i = o.stream, o = o.cue, r.has(i) || r.set(i, []), rm(e, o, n), o.startTime >= e.m && o.startTime < e.o && (r.get(i).push(o), i == e.F && e.l.append([o]));
          }
          for (n = m(r.keys()), t = n.next(); !t.done; t = n.next()) for (t = t.value, e.j.has(t) || e.j.set(t, []), i = m(r.get(t)), o = i.next(); !o.done; o = i.next()) o = o.value, e.j.get(t).push(o);
          im(e);
        }
        function Ix(e, t, n) {
          for (var r = m(e.j.keys()), i = r.next(); !i.done; i = r.next()) {
            i = i.value;
            var o = e.j.get(i);
            o = o.filter(function(s) {
              return s.startTime < t || s.endTime >= n;
            }), e.j.set(i, o);
          }
        }
        function im(e) {
          for (var t = 1 / 0, n = -1 / 0, r = m(e.j.values()), i = r.next(); !i.done; i = r.next()) {
            i = m(i.value);
            for (var o = i.next(); !o.done; o = i.next()) o = o.value, t = Math.min(t, o.startTime), n = Math.max(n, o.endTime);
          }
          t !== 1 / 0 && n !== -1 / 0 && (e.g = e.g == null ? Math.max(t, e.m) : Math.min(e.g, Math.max(t, e.m)), e.h = Math.max(e.h, Math.min(n, e.o)));
        }
        Y("shaka.text.TextEngine", Wr), Wr.prototype.destroy = Wr.prototype.destroy, Wr.findParser = Zs, Wr.unregisterParser = function(e) {
          tu.delete(e);
        }, Wr.registerParser = Bt;
        var tu = /* @__PURE__ */ new Map();
        function nu(e) {
          this.h = e, this.g = null;
        }
        nu.prototype.ka = function(e) {
          var t = this;
          this.stop();
          var n = !0, r = null;
          return this.g = function() {
            C.clearTimeout(r), n = !1;
          }, r = C.setTimeout(function() {
            n && t.h();
          }, e * 1e3), this;
        }, nu.prototype.stop = function() {
          this.g && (this.g(), this.g = null);
        };
        function Ae(e) {
          this.h = e, this.g = null;
        }
        Ae.prototype.Cb = function() {
          return this.stop(), this.h(), this;
        }, Ae.prototype.ka = function(e) {
          var t = this;
          return this.stop(), this.g = new nu(function() {
            t.h();
          }).ka(e), this;
        }, Ae.prototype.Ea = function(e) {
          var t = this;
          return this.stop(), this.g = new nu(function() {
            t.g.ka(e), t.h();
          }).ka(e), this;
        }, Ae.prototype.stop = function() {
          this.g && (this.g.stop(), this.g = null);
        }, Y("shaka.util.Timer", Ae), Ae.prototype.stop = Ae.prototype.stop, Ae.prototype.tickEvery = Ae.prototype.Ea, Ae.prototype.tickAfter = Ae.prototype.ka, Ae.prototype.tickNow = Ae.prototype.Cb;
        function Mx(e, t) {
          return e.concat(t);
        }
        function Cx() {
        }
        function wi(e) {
          return e != null;
        }
        function Fa(e, t) {
          return Promise.race([t, new Promise(function(n, r) {
            new Ae(r).ka(e);
          })]);
        }
        function lr() {
        }
        function _o(e, t) {
          return e = He(e), t = He(t), e.split("-")[0] == t.split("-")[0];
        }
        function ru(e, t) {
          return e = He(e), t = He(t), e = e.split("-"), t = t.split("-"), e[0] == t[0] && e.length == 1 && t.length == 2;
        }
        function Fd(e, t) {
          return e = He(e), t = He(t), e = e.split("-"), t = t.split("-"), e.length == 2 && t.length == 2 && e[0] == t[0];
        }
        function He(e) {
          e = m(e.split("-x-"));
          var t = e.next().value;
          t = t === void 0 ? "" : t, e = e.next().value, e = e === void 0 ? "" : e;
          var n = m(t.split("-"));
          return t = n.next().value, t = t === void 0 ? "" : t, n = n.next().value, n = n === void 0 ? "" : n, e = e ? "x-" + e : "", t = t.toLowerCase(), t = om.get(t) || t, n = n.toUpperCase(), (n ? t + "-" + n : t) + (e ? "-" + e : "");
        }
        function Ji(e, t) {
          return e = He(e), t = He(t), t == e ? 4 : ru(t, e) ? 3 : Fd(t, e) ? 2 : ru(e, t) ? 1 : 0;
        }
        function Va(e) {
          var t = e.indexOf("-");
          return e = t >= 0 ? e.substring(0, t) : e, e = e.toLowerCase(), e = om.get(e) || e;
        }
        function Vd(e) {
          return e.language ? He(e.language) : e.audio && e.audio.language ? He(e.audio.language) : e.video && e.video.language ? He(e.video.language) : "und";
        }
        function Ha(e, t) {
          e = He(e);
          var n = /* @__PURE__ */ new Set();
          t = m(t);
          for (var r = t.next(); !r.done; r = t.next()) n.add(He(r.value));
          for (t = m(n), r = t.next(); !r.done; r = t.next()) if (r = r.value, r == e) return r;
          for (t = m(n), r = t.next(); !r.done; r = t.next()) if (r = r.value, ru(r, e)) return r;
          for (t = m(n), r = t.next(); !r.done; r = t.next()) if (r = r.value, Fd(r, e)) return r;
          for (n = m(n), t = n.next(); !t.done; t = n.next()) if (t = t.value, ru(e, t)) return t;
          return null;
        }
        Y("shaka.util.LanguageUtils", lr), lr.findClosestLocale = Ha, lr.getLocaleForVariant = Vd, lr.getLocaleForText = function(e) {
          return He(e.language || "und");
        }, lr.getBase = Va, lr.relatedness = Ji, lr.areSiblings = function(e, t) {
          var n = Va(e), r = Va(t);
          return e != n && t != r && n == r;
        }, lr.normalize = He, lr.isSiblingOf = Fd, lr.isParentOf = ru, lr.areLanguageCompatible = _o, lr.areLocaleCompatible = function(e, t) {
          return e = He(e), t = He(t), e == t;
        };
        var om = /* @__PURE__ */ new Map([["aar", "aa"], ["abk", "ab"], ["afr", "af"], ["aka", "ak"], ["alb", "sq"], ["amh", "am"], ["ara", "ar"], ["arg", "an"], ["arm", "hy"], ["asm", "as"], ["ava", "av"], ["ave", "ae"], ["aym", "ay"], ["aze", "az"], ["bak", "ba"], ["bam", "bm"], ["baq", "eu"], ["bel", "be"], ["ben", "bn"], ["bih", "bh"], ["bis", "bi"], ["bod", "bo"], ["bos", "bs"], ["bre", "br"], ["bul", "bg"], ["bur", "my"], ["cat", "ca"], ["ces", "cs"], ["cha", "ch"], ["che", "ce"], ["chi", "zh"], ["chu", "cu"], ["chv", "cv"], ["cor", "kw"], ["cos", "co"], ["cre", "cr"], ["cym", "cy"], [
          "cze",
          "cs"
        ], ["dan", "da"], ["deu", "de"], ["div", "dv"], ["dut", "nl"], ["dzo", "dz"], ["ell", "el"], ["eng", "en"], ["epo", "eo"], ["est", "et"], ["eus", "eu"], ["ewe", "ee"], ["fao", "fo"], ["fas", "fa"], ["fij", "fj"], ["fin", "fi"], ["fra", "fr"], ["fre", "fr"], ["fry", "fy"], ["ful", "ff"], ["geo", "ka"], ["ger", "de"], ["gla", "gd"], ["gle", "ga"], ["glg", "gl"], ["glv", "gv"], ["gre", "el"], ["grn", "gn"], ["guj", "gu"], ["hat", "ht"], ["hau", "ha"], ["heb", "he"], ["her", "hz"], ["hin", "hi"], ["hmo", "ho"], ["hrv", "hr"], ["hun", "hu"], ["hye", "hy"], ["ibo", "ig"], [
          "ice",
          "is"
        ], ["ido", "io"], ["iii", "ii"], ["iku", "iu"], ["ile", "ie"], ["ina", "ia"], ["ind", "id"], ["ipk", "ik"], ["isl", "is"], ["ita", "it"], ["jav", "jv"], ["jpn", "ja"], ["kal", "kl"], ["kan", "kn"], ["kas", "ks"], ["kat", "ka"], ["kau", "kr"], ["kaz", "kk"], ["khm", "km"], ["kik", "ki"], ["kin", "rw"], ["kir", "ky"], ["kom", "kv"], ["kon", "kg"], ["kor", "ko"], ["kua", "kj"], ["kur", "ku"], ["lao", "lo"], ["lat", "la"], ["lav", "lv"], ["lim", "li"], ["lin", "ln"], ["lit", "lt"], ["ltz", "lb"], ["lub", "lu"], ["lug", "lg"], ["mac", "mk"], ["mah", "mh"], ["mal", "ml"], [
          "mao",
          "mi"
        ], ["mar", "mr"], ["may", "ms"], ["mkd", "mk"], ["mlg", "mg"], ["mlt", "mt"], ["mon", "mn"], ["mri", "mi"], ["msa", "ms"], ["mya", "my"], ["nau", "na"], ["nav", "nv"], ["nbl", "nr"], ["nde", "nd"], ["ndo", "ng"], ["nep", "ne"], ["nld", "nl"], ["nno", "nn"], ["nob", "nb"], ["nor", "no"], ["nya", "ny"], ["oci", "oc"], ["oji", "oj"], ["ori", "or"], ["orm", "om"], ["oss", "os"], ["pan", "pa"], ["per", "fa"], ["pli", "pi"], ["pol", "pl"], ["por", "pt"], ["pus", "ps"], ["que", "qu"], ["roh", "rm"], ["ron", "ro"], ["rum", "ro"], ["run", "rn"], ["rus", "ru"], ["sag", "sg"], [
          "san",
          "sa"
        ], ["sin", "si"], ["slk", "sk"], ["slo", "sk"], ["slv", "sl"], ["sme", "se"], ["smo", "sm"], ["sna", "sn"], ["snd", "sd"], ["som", "so"], ["sot", "st"], ["spa", "es"], ["sqi", "sq"], ["srd", "sc"], ["srp", "sr"], ["ssw", "ss"], ["sun", "su"], ["swa", "sw"], ["swe", "sv"], ["tah", "ty"], ["tam", "ta"], ["tat", "tt"], ["tel", "te"], ["tgk", "tg"], ["tgl", "tl"], ["tha", "th"], ["tib", "bo"], ["tir", "ti"], ["ton", "to"], ["tsn", "tn"], ["tso", "ts"], ["tuk", "tk"], ["tur", "tr"], ["twi", "tw"], ["uig", "ug"], ["ukr", "uk"], ["urd", "ur"], ["uzb", "uz"], ["ven", "ve"], [
          "vie",
          "vi"
        ], ["vol", "vo"], ["wel", "cy"], ["wln", "wa"], ["wol", "wo"], ["xho", "xh"], ["yid", "yi"], ["yor", "yo"], ["zha", "za"], ["zho", "zh"], ["zul", "zu"]]);
        function sm() {
        }
        function um(e, t, n, r, i) {
          if (i.length) {
            var o = e.textStreams;
            i = m(i);
            for (var s = i.next(), u = {}; !s.done; u = { Ch: void 0 }, s = i.next()) if (u.Ch = s.value, s = o.filter(/* @__PURE__ */ (function(g) {
              return function(w) {
                return !!(w.codecs.startsWith(g.Ch) || w.mimeType.startsWith(g.Ch));
              };
            })(u)), s.length) {
              o = s;
              break;
            }
            e.textStreams = o;
          }
          if (o = e.variants, (t.length || n.length) && (o = kx(o, t, n)), r.length) {
            for (t = new ya(), o = m(o), n = o.next(); !n.done; n = o.next()) n = n.value, t.push(String(n.video.width || 0), n);
            var a = [];
            t.forEach(function(g, w) {
              g = 0;
              var T = [];
              w = m(w);
              for (var E = w.next(), A = {}; !E.done; A = { Uf: void 0 }, E = w.next()) A.Uf = E.value, E = r.filter(/* @__PURE__ */ (function(I) {
                return function(P) {
                  return I.Uf.decodingInfos[0][P];
                };
              })(A)).length, E > g ? (g = E, T = [A.Uf]) : E == g && T.push(A.Uf);
              a.push.apply(a, X(T));
            }), o = a;
          }
          for (t = /* @__PURE__ */ new Set(), n = m(o), i = n.next(); !i.done; i = n.next()) i = i.value, i.video && t.add(i.video);
          if (t.size) {
            var l = { vp8: 1, avc: 1, "dovi-avc": 0.95, vp9: 0.9, vp09: 0.9, hevc: 0.85, "dovi-hevc": 0.8, "dovi-p5": 0.75, av01: 0.7, "dovi-av1": 0.65, vvc: 0.6 };
            i = Array.from(t).sort(function(g, w) {
              return g.bandwidth && w.bandwidth && g.bandwidth != w.bandwidth ? g.bandwidth - w.bandwidth : g.width != w.width ? g.width - w.width : g.codecs && w.codecs ? (g = Kt(g.codecs), w = Kt(w.codecs), (l[g] || 1) - (l[w] || 1)) : 0;
            });
            var c = [];
            for (t = /* @__PURE__ */ new Map(), n = function(g) {
              var w = [String(g.width || ""), String(g.height || ""), String(Math.round(g.frameRate || 0)), g.hdr || "", g.fastSwitching];
              return g.dependencyStream && w.push(g.dependencyStream.baseOriginalId || ""), g.roles && w.push(g.roles.sort().join("_")), w.join(";");
            }, i = m(i), s = i.next(); !s.done; s = i.next()) {
              s = s.value, u = n(s);
              var d = t.get(u) || [];
              if (d.length) {
                var h = Kt(d[d.length - 1].codecs), p = Kt(s.codecs);
                h == p && (d.push(s), c.push(s.id));
              } else d.push(s), c.push(s.id);
              t.set(u, d);
            }
            e.variants = o.filter(function(g) {
              return !((g = g.video) && !c.includes(g.id));
            });
          } else e.variants = o;
        }
        function kx(e, t, n) {
          t = m(t);
          for (var r = t.next(), i = {}; !r.done; i = { ij: void 0 }, r = t.next()) if (i.ij = r.value, r = e.filter(/* @__PURE__ */ (function(o) {
            return function(s) {
              return s.video && s.video.codecs.startsWith(o.ij);
            };
          })(i)), r.length) {
            e = r;
            break;
          }
          for (n = m(n), t = n.next(), r = {}; !t.done; r = { Oh: void 0 }, t = n.next()) if (r.Oh = t.value, t = e.filter(/* @__PURE__ */ (function(o) {
            return function(s) {
              return s.audio && s.audio.codecs.startsWith(o.Oh);
            };
          })(r)), t.length) {
            e = t;
            break;
          }
          return e;
        }
        function Px(e, t, n) {
          e.variants = e.variants.filter(function(r) {
            return Ga(r, t, n);
          });
        }
        function Ga(e, t, n) {
          function r(s, u, a) {
            return s >= u && s <= a;
          }
          if (e && e.video && e.video.width && e.video.height) {
            var i = e.video.width, o = e.video.height;
            if (o > i && (o = m([o, i]), i = o.next().value, o = o.next().value), !r(i, t.minWidth, Math.min(t.maxWidth, n.width)) || !r(o, t.minHeight, Math.min(t.maxHeight, n.height)) || !r(i * o, t.minPixels, t.maxPixels)) return !1;
          }
          return !(e && e.video && e.video.frameRate && !r(e.video.frameRate, t.minFrameRate, t.maxFrameRate) || e && e.audio && e.audio.channelsCount && !r(
            e.audio.channelsCount,
            t.minChannelsCount,
            t.maxChannelsCount
          ) || !r(e.bandwidth, t.minBandwidth, t.maxBandwidth));
        }
        function Dx(e, t, n, r) {
          return n = n === void 0 ? [] : n, r = r === void 0 ? {} : r, D(function(i) {
            return i.g == 1 ? x(i, am(e, t, t.offlineSessionIds.length > 0, n, r), 2) : (Nx(t), x(i, Ox(t), 0));
          });
        }
        function am(e, t, n, r, i) {
          var o, s;
          return D(function(u) {
            if (u.g == 1) return Se().Xi() && Rx(t.variants), x(u, Hd(t.variants, n, !1, r), 2);
            o = null, e && (s = e.g) && (o = s.keySystem), t.variants = t.variants.filter(function(a) {
              var l = Lx(a, o, i);
              if (!l) {
                var c = [];
                a.audio && c.push(pm(a.audio)), a.video && c.push(pm(a.video));
              }
              return l;
            }), q(u);
          });
        }
        function Rx(e) {
          var t = (/* @__PURE__ */ new Map()).set("dvav", "avc3").set("dva1", "avc1").set("dvhe", "hev1").set("dvh1", "hvc1").set("dvc1", "vvc1").set("dvi1", "vvi1"), n = /* @__PURE__ */ new Set();
          e = m(e);
          for (var r = e.next(); !r.done; r = e.next()) r = r.value, r.video && n.add(r.video);
          for (n = m(n), e = n.next(); !e.done; e = n.next()) {
            e = e.value, r = m(t);
            for (var i = r.next(); !i.done; i = r.next()) {
              var o = m(i.value);
              if (i = o.next().value, o = o.next().value, e.codecs.includes(i)) {
                e.codecs = e.codecs.replace(i, o);
                break;
              }
            }
          }
        }
        function Lx(e, t, n) {
          if (!e.decodingInfos.some(function(a) {
            return !(!a.supported || t && (a = a.keySystemAccess) && (n[a.keySystem] || a.keySystem) != t);
          })) return !1;
          var r = Se(), i = r.Nb() === "Xbox";
          r = r.Oa() === "MOBILE" && r.Ha() === "GECKO";
          var o = e.video, s = o && o.width || 0, u = o && o.height || 0;
          return i && o && (s > 1920 || u > 1080) && (o.codecs.includes("avc1.") || o.codecs.includes("avc3.")) || (i = o && o.dependencyStream) && !jg(i) ? !1 : (e = e.audio, !(r && e && e.encrypted && e.codecs.toLowerCase().includes("opus") || e && e.dependencyStream));
        }
        function lm(e, t) {
          var n, r, i, o, s, u, a;
          return D(function(l) {
            if (l.g == 1) {
              for (n = function(c, d) {
                if (c) {
                  var h = gi(c);
                  return h.supported = c.supported && d.supported, h.powerEfficient = c.powerEfficient && d.powerEfficient, h.smooth = c.smooth && d.smooth, d.keySystemAccess && !h.keySystemAccess && (h.keySystemAccess = d.keySystemAccess), h;
                }
                return d;
              }, r = null, i = [], o = m(t), s = o.next(), u = {}; !s.done; u = { cache: void 0, Re: void 0 }, s = o.next()) a = s.value, u.Re = Pa(a), u.cache = Xa, u.cache.has(u.Re) ? r = n(r, u.cache.get(u.Re)) : i.push(bx(a).then(/* @__PURE__ */ (function(c) {
                return function(d) {
                  var h = null;
                  d = m(d || []);
                  for (var p = d.next(); !p.done; p = d.next()) h = n(h, p.value);
                  h && (c.cache.set(c.Re, h), r = n(r, h));
                };
              })(u)));
              return x(l, Promise.all(i), 2);
            }
            r && e.decodingInfos.push(r), q(l);
          });
        }
        function bx(e) {
          var t = [""];
          e.video && (t = hn(e.video.contentType).split(","));
          var n = [""];
          e.audio && (n = hn(e.audio.contentType).split(","));
          var r = [];
          t = m(t);
          for (var i = t.next(); !i.done; i = t.next()) {
            i = i.value;
            for (var o = m(n), s = o.next(), u = {}; !s.done; u = { Qc: void 0 }, s = o.next()) s = s.value, u.Qc = ar(e), e.video && (u.Qc.video.contentType = gt(xn(u.Qc.video.contentType), i)), e.audio && (u.Qc.audio.contentType = gt(xn(u.Qc.audio.contentType), s)), r.push(new Promise(/* @__PURE__ */ (function(a) {
              return function(l, c) {
                (Se().Oa() == "MOBILE" ? Fa(5, navigator.mediaCapabilities.decodingInfo(a.Qc)) : navigator.mediaCapabilities.decodingInfo(a.Qc)).then(function(d) {
                  l(d);
                }).catch(c);
              };
            })(u)));
          }
          return Promise.all(r).catch(function() {
            return JSON.stringify(e), null;
          });
        }
        function Hd(e, t, n, r) {
          var i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N;
          return D(function(M) {
            switch (M.g) {
              case 1:
                if (e.some(function(R) {
                  return R.decodingInfos.length;
                })) return M.return();
                i = m(r), o = i.next(), s = {};
              case 2:
                if (o.done) {
                  M.A(4);
                  break;
                }
                s.Fi = o.value, u = !1, a = m(e), l = a.next();
              case 5:
                if (l.done) {
                  M.A(7);
                  break;
                }
                c = l.value, d = cm(c, t, n).filter(/* @__PURE__ */ (function(R) {
                  return function(k) {
                    return k = k[0], (k.keySystemConfiguration && k.keySystemConfiguration.keySystem) === R.Fi;
                  };
                })(s)), h = m(d), p = h.next();
              case 8:
                if (p.done) {
                  M.A(10);
                  break;
                }
                return g = p.value, x(M, lm(c, g), 9);
              case 9:
                p = h.next(), M.A(8);
                break;
              case 10:
                c.decodingInfos.some(function(R) {
                  return R.supported;
                }) && (u = !0), l = a.next(), M.A(5);
                break;
              case 7:
                if (u) return M.return();
                s = { Fi: void 0 }, o = i.next(), M.A(2);
                break;
              case 4:
                w = m(e), T = w.next();
              case 12:
                if (T.done) {
                  M.A(0);
                  break;
                }
                E = T.value, A = cm(E, t, n).filter(function(R) {
                  return R = R[0], R = R.keySystemConfiguration && R.keySystemConfiguration.keySystem, !R || !r.includes(R);
                }), I = m(A), P = I.next();
              case 15:
                if (P.done) {
                  T = w.next(), M.A(12);
                  break;
                }
                return N = P.value, x(
                  M,
                  lm(E, N),
                  16
                );
              case 16:
                P = I.next(), M.A(15);
            }
          });
        }
        function cm(e, t, n) {
          var r = e.audio, i = e.video, o = [], s = [];
          if (i) for (var u = m(i.fullMimeTypes), a = u.next(); !a.done; a = u.next()) {
            a = a.value;
            var l = hn(a);
            if (l.includes(",") && !r) {
              var c = l.split(","), d = xn(a);
              l = Do("video", c), c = Do("audio", c), c = iu(c, d), d = Bd(d, c, "audio"), s.push({ contentType: d, channels: 2, bitrate: e.bandwidth || 1, samplerate: 1, spatialRendering: !1 });
            }
            if (l = Gd(l), a = { contentType: Bd(xn(a), l, "video"), width: i.width || 64, height: i.height || 64, bitrate: i.bandwidth || e.bandwidth || 1, framerate: i.frameRate || 30 }, i.hdr) switch (i.hdr) {
              case "PQ":
                a.transferFunction = "pq";
                break;
              case "HLG":
                a.transferFunction = "hlg";
            }
            i.colorGamut && (a.colorGamut = i.colorGamut), o.push(a);
          }
          if (r) for (u = m(r.fullMimeTypes), a = u.next(); !a.done; a = u.next()) l = a.value, a = xn(l), l = iu(hn(l), a), a = Bd(a, l, "audio"), s.push({ contentType: a, channels: r.channelsCount || 2, bitrate: r.bandwidth || e.bandwidth || 1, samplerate: r.audioSamplingRate || 1, spatialRendering: r.spatialAudio });
          for (u = [], o.length == 0 && o.push(null), s.length == 0 && s.push(null), o = m(o), a = o.next(); !a.done; a = o.next()) for (a = a.value, l = m(s), d = l.next(); !d.done; d = l.next()) d = d.value, c = { type: n ? "file" : "media-source" }, a && (c.video = a), d && (c.audio = d), u.push(c);
          if (s = (e.video ? e.video.drmInfos : []).concat(e.audio ? e.audio.drmInfos : []), !s.length) return [u];
          for (e = [], n = /* @__PURE__ */ new Map(), s = m(s), o = s.next(); !o.done; o = s.next()) o = o.value, n.get(o.keySystem) || n.set(o.keySystem, []), n.get(o.keySystem).push(o);
          for (s = t ? "required" : "optional", t = t ? ["persistent-license"] : ["temporary"], o = m(n.keys()), a = o.next(); !a.done; a = o.next()) {
            for (a = a.value, d = n.get(a), l = /* @__PURE__ */ new Map(), d = m(d), c = d.next(); !c.done; c = d.next()) {
              c = c.value;
              var h = c.videoRobustness + "," + c.audioRobustness;
              l.get(h) || l.set(h, []), l.get(h).push(c);
            }
            for (l = m(l.values()), d = l.next(); !d.done; d = l.next()) {
              d = d.value, c = [], h = m(u);
              for (var p = h.next(); !p.done; p = h.next()) {
                p = Object.assign({}, p.value);
                for (var g = { keySystem: a, initDataType: "cenc", persistentState: s, distinctiveIdentifier: "optional", sessionTypes: t }, w = m(d), T = w.next(); !T.done; T = w.next()) {
                  if (T = T.value, T.initData && T.initData.length) {
                    for (var E = /* @__PURE__ */ new Set(), A = m(T.initData), I = A.next(); !I.done; I = A.next()) E.add(I.value.initDataType);
                    g.initDataType = T.initData[0].initDataType;
                  }
                  T.distinctiveIdentifierRequired && (g.distinctiveIdentifier = "required"), T.persistentStateRequired && (g.persistentState = "required"), T.sessionType && (g.sessionTypes = [T.sessionType]), r && (g.audio ? (T.encryptionScheme && (g.audio.encryptionScheme = g.audio.encryptionScheme || T.encryptionScheme), g.audio.robustness = g.audio.robustness || T.audioRobustness) : (g.audio = { robustness: T.audioRobustness }, T.encryptionScheme && (g.audio.encryptionScheme = T.encryptionScheme)), g.audio.robustness == "" && delete g.audio.robustness), i && (g.video ? (T.encryptionScheme && (g.video.encryptionScheme = g.video.encryptionScheme || T.encryptionScheme), g.video.robustness = g.video.robustness || T.videoRobustness) : (g.video = { robustness: T.videoRobustness }, T.encryptionScheme && (g.video.encryptionScheme = T.encryptionScheme)), g.video.robustness == "" && delete g.video.robustness);
                }
                p.keySystemConfiguration = g, c.push(p);
              }
              e.push(c);
            }
          }
          return e;
        }
        function iu(e, t) {
          var n = Se();
          return e.toLowerCase() == "flac" ? n.Ha() != "WEBKIT" ? "flac" : "fLaC" : e.toLowerCase() === "opus" ? n.Ha() != "WEBKIT" ? "opus" : Qs(t) == "mp4" ? "Opus" : "opus" : e.toLowerCase() == "ac-3" && n.re() ? "ec-3" : e;
        }
        function Gd(e) {
          if (e.includes("avc1")) {
            var t = e.split(".");
            if (t.length == 3) return e = t.shift() + ".", e += parseInt(t.shift(), 10).toString(16), e += ("000" + parseInt(t.shift(), 10).toString(16)).slice(-4);
          } else if (e == "vp9") return "vp09.00.41.08";
          return e;
        }
        function Nx(e) {
          e.textStreams = e.textStreams.filter(function(t) {
            return t = gt(t.mimeType, t.codecs), eu(t);
          });
        }
        function Ox(e) {
          var t, n, r, i, o, s, u;
          return D(function(a) {
            switch (a.g) {
              case 1:
                t = [], n = m(e.imageStreams), r = n.next();
              case 2:
                if (r.done) {
                  a.A(4);
                  break;
                }
                if (i = r.value, o = i.mimeType, o == "application/mp4" && i.codecs == "mjpg" && (o = "image/jpg"), qa.has(o)) {
                  a.A(5);
                  break;
                }
                if (s = Bx.get(o), !s) {
                  qa.set(o, !1), a.A(5);
                  break;
                }
                return x(a, jx(s), 7);
              case 7:
                u = a.h, qa.set(o, u);
              case 5:
                qa.get(o) && t.push(i), r = n.next(), a.A(2);
                break;
              case 4:
                e.imageStreams = t, q(a);
            }
          });
        }
        function jx(e) {
          return new Promise(function(t) {
            var n = new Image();
            n.src = e, "decode" in n ? n.decode().then(function() {
              t(!0);
            }).catch(function() {
              t(!1);
            }) : n.onload = n.onerror = function() {
              t(n.height === 2);
            };
          });
        }
        function Qi(e) {
          var t = e.audio, n = e.video, r = t ? t.mimeType : null, i = n ? n.mimeType : null, o = t ? t.codecs : null, s = n ? n.codecs : null, u = t ? t.groupId : null, a = [];
          n && a.push(n.mimeType), t && a.push(t.mimeType), a = a[0] || null;
          var l = [];
          t && l.push(t.kind), n && l.push(n.kind), l = l[0] || null;
          var c = /* @__PURE__ */ new Set();
          if (t) for (var d = m(t.roles), h = d.next(); !h.done; h = d.next()) c.add(h.value);
          if (n) for (d = m(n.roles), h = d.next(); !h.done; h = d.next()) c.add(h.value);
          if (e = {
            id: e.id,
            active: !1,
            type: "variant",
            bandwidth: e.bandwidth,
            language: e.language,
            label: null,
            videoLabel: null,
            kind: l,
            width: null,
            height: null,
            frameRate: null,
            pixelAspectRatio: null,
            hdr: null,
            colorGamut: null,
            videoLayout: null,
            mimeType: a,
            audioMimeType: r,
            videoMimeType: i,
            codecs: "",
            audioCodec: o,
            videoCodec: s,
            primary: e.primary,
            roles: Array.from(c),
            audioRoles: null,
            videoRoles: null,
            forced: !1,
            videoId: null,
            audioId: null,
            audioGroupId: u,
            channelsCount: null,
            audioSamplingRate: null,
            spatialAudio: !1,
            tilesLayout: null,
            audioBandwidth: null,
            videoBandwidth: null,
            originalVideoId: null,
            originalAudioId: null,
            originalTextId: null,
            originalImageId: null,
            accessibilityPurpose: null,
            originalLanguage: null
          }, n && (e.videoId = n.id, e.originalVideoId = n.originalId, e.width = n.width || null, e.height = n.height || null, e.frameRate = n.frameRate || null, e.pixelAspectRatio = n.pixelAspectRatio || null, e.videoBandwidth = n.bandwidth || null, e.hdr = n.hdr || null, e.colorGamut = n.colorGamut || null, e.videoLayout = n.videoLayout || null, e.videoRoles = n.roles, e.videoLabel = n.label, (r = n.dependencyStream) && (e.width = r.width || e.width, e.height = r.height || e.height, e.videoCodec = r.codecs || e.videoCodec, e.pixelAspectRatio = r.pixelAspectRatio || e.pixelAspectRatio, e.videoBandwidth && r.bandwidth && (e.videoBandwidth += r.bandwidth)), s.includes(","))) {
            e.channelsCount = n.channelsCount, e.audioSamplingRate = n.audioSamplingRate, e.spatialAudio = n.spatialAudio, e.originalLanguage = n.originalLanguage, e.audioMimeType = i, i = s.split(",");
            try {
              e.videoCodec = Do("video", i), e.audioCodec = Do("audio", i);
            } catch {
            }
          }
          return t && (e.audioId = t.id, e.originalAudioId = t.originalId, e.channelsCount = t.channelsCount, e.audioSamplingRate = t.audioSamplingRate, e.audioBandwidth = t.bandwidth || null, e.spatialAudio = t.spatialAudio, e.label = t.label, e.audioRoles = t.roles, e.accessibilityPurpose = t.accessibilityPurpose, e.originalLanguage = t.originalLanguage, i = t.dependencyStream) && (e.audioCodec = i.codecs || e.audioCodec, e.audioBandwidth && i.bandwidth && (e.audioBandwidth += i.bandwidth)), n && !e.videoBandwidth && (t ? e.audioBandwidth && (e.videoBandwidth = e.bandwidth - e.audioBandwidth) : e.videoBandwidth = e.bandwidth), t && !e.audioBandwidth && (n ? e.videoBandwidth && (e.audioBandwidth = e.bandwidth - e.videoBandwidth) : e.audioBandwidth = e.bandwidth), t = [], e.videoCodec && t.push(e.videoCodec), e.audioCodec && t.push(e.audioCodec), e.codecs = t.join(", "), e;
        }
        function Zi(e) {
          return { id: e.id, active: !1, type: xe, bandwidth: e.bandwidth || 0, language: e.language, label: e.label, kind: e.kind || null, mimeType: e.mimeType, codecs: e.codecs || null, primary: e.primary, roles: e.roles, accessibilityPurpose: e.accessibilityPurpose, forced: e.forced, originalTextId: e.originalId, originalLanguage: e.originalLanguage };
        }
        function Kd(e) {
          var t = e.width || null, n = e.height || null, r = null;
          e.segmentIndex && (r = Tr(e.segmentIndex));
          var i = e.tilesLayout;
          return r && (i = r.tilesLayout || i), i && t != null && (t /= Number(i.split("x")[0])), i && n != null && (n /= Number(i.split("x")[1])), { id: e.id, type: "image", bandwidth: e.bandwidth || 0, width: t, height: n, mimeType: e.mimeType, codecs: e.codecs || null, tilesLayout: i || null, originalImageId: e.originalId };
        }
        function Ka(e) {
          return e.__shaka_id || (e.__shaka_id = _x++), e.__shaka_id;
        }
        function dm(e) {
          var t = { id: Ka(e), active: e.mode != "disabled", type: xe, bandwidth: 0, language: He(e.language || "und"), label: e.label, kind: e.kind, mimeType: null, codecs: null, primary: !1, roles: [], accessibilityPurpose: null, forced: e.kind == "forced", originalTextId: e.id, originalLanguage: e.language };
          return e.kind == "captions" && (t.mimeType = "unknown"), e.kind == "subtitles" && (t.mimeType = "text/vtt"), e.kind && (t.roles = [e.kind]), t;
        }
        function Wa(e, t) {
          var n = e ? e.language : null;
          if (n = {
            id: Ka(e || t),
            active: e ? e.enabled : t.selected,
            type: "variant",
            bandwidth: 0,
            language: He(n || "und"),
            label: e ? e.label : null,
            videoLabel: null,
            kind: e ? e.kind : null,
            width: null,
            height: null,
            frameRate: null,
            pixelAspectRatio: null,
            hdr: null,
            colorGamut: null,
            videoLayout: null,
            mimeType: null,
            audioMimeType: null,
            videoMimeType: null,
            codecs: null,
            audioCodec: null,
            videoCodec: null,
            primary: e ? e.kind == "main" : !1,
            roles: [],
            forced: !1,
            audioRoles: null,
            videoRoles: null,
            videoId: null,
            audioId: null,
            audioGroupId: null,
            channelsCount: null,
            audioSamplingRate: null,
            spatialAudio: !1,
            tilesLayout: null,
            audioBandwidth: null,
            videoBandwidth: null,
            originalVideoId: t ? t.id : null,
            originalAudioId: e ? e.id : null,
            originalTextId: null,
            originalImageId: null,
            accessibilityPurpose: null,
            originalLanguage: n
          }, e && e.kind && (n.roles = [e.kind], n.audioRoles = [e.kind]), e && e.configuration && (e.configuration.codec && (n.audioCodec = e.configuration.codec, n.codecs = n.audioCodec), e.configuration.bitrate && (n.audioBandwidth = e.configuration.bitrate, n.bandwidth += n.audioBandwidth), e.configuration.sampleRate && (n.audioSamplingRate = e.configuration.sampleRate), e.configuration.numberOfChannels && (n.channelsCount = e.configuration.numberOfChannels)), t && t.configuration && (t.configuration.codec && (n.videoCodec = t.configuration.codec, n.codecs = n.codecs ? n.codecs + ("," + n.videoCodec) : n.videoCodec), t.configuration.bitrate && (n.videoBandwidth = t.configuration.bitrate, n.bandwidth += n.videoBandwidth), t.configuration.framerate && (n.frameRate = t.configuration.framerate), t.configuration.width && (n.width = t.configuration.width), t.configuration.height && (n.height = t.configuration.height), t.configuration.colorSpace && t.configuration.colorSpace.transfer)) switch (t.configuration.colorSpace.transfer) {
            case "pq":
              n.hdr = "PQ";
              break;
            case "hlg":
              n.hdr = "HLG";
              break;
            case "bt709":
              n.hdr = "SDR";
          }
          return n;
        }
        function ou(e) {
          return e.allowedByApplication && e.allowedByKeySystem && e.disabledUntilTime == 0;
        }
        function za(e) {
          return e.filter(function(t) {
            return ou(t);
          });
        }
        function Bo(e, t, n, r) {
          var i = e, o = e.filter(function(a) {
            return a.primary;
          });
          o.length && (i = o);
          var s = i.length ? i[0].language : "";
          if (i = i.filter(function(a) {
            return a.language == s;
          }), t) {
            var u = Ha(He(t), e.map(function(a) {
              return a.language;
            }));
            u && (i = e.filter(function(a) {
              return He(a.language) == u;
            }));
          }
          if (i = i.filter(function(a) {
            return a.forced == r;
          }), n) {
            if (e = fm(i, n), e.length) return e;
          } else if (e = i.filter(function(a) {
            return a.roles.length == 0;
          }), e.length) return e;
          return e = i.map(function(a) {
            return a.roles;
          }).reduce(Mx, []), e.length ? fm(i, e[0]) : i;
        }
        function fm(e, t) {
          return e.filter(function(n) {
            return n.roles.includes(t);
          });
        }
        function Ux(e) {
          var t = [];
          return e.audio && t.push(e.audio), e.video && t.push(e.video), t;
        }
        function hm(e, t) {
          t.length && (t = t.filter(function(n) {
            return Kt(e.codecs) == Kt(n.codecs);
          }).sort(function(n, r) {
            return n.bandwidth && r.bandwidth && n.bandwidth != r.bandwidth ? n.bandwidth - r.bandwidth : (n.width || 0) - (r.width || 0);
          }), e.trickModeVideo = t[0], t.length > 1 && (t = t.find(function(n) {
            return e.width == n.width && e.height == n.height;
          }))) && (e.trickModeVideo = t);
        }
        function pm(e) {
          return e.type == "audio" ? "type=audio codecs=" + e.codecs + " bandwidth=" + e.bandwidth + " channelsCount=" + e.channelsCount + " audioSamplingRate=" + e.audioSamplingRate : e.type == "video" ? "type=video codecs=" + e.codecs + " bandwidth=" + e.bandwidth + " frameRate=" + e.frameRate + " width=" + e.width + " height=" + e.height : "unexpected stream type";
        }
        function gm(e, t, n) {
          if (n.autoShowText == 0) return !1;
          if (n.autoShowText == 1) return !0;
          var r = He(n.preferredTextLanguage);
          return t = He(t.language), n.autoShowText == 2 ? _o(t, r) : n.autoShowText == 3 ? e ? (e = He(e.language), _o(t, r) && !_o(e, t)) : !1 : (De("Invalid autoShowText setting!"), !1);
        }
        function mm(e) {
          var t = { id: 0, language: "und", disabledUntilTime: 0, primary: !1, audio: null, video: null, bandwidth: 100, allowedByApplication: !0, allowedByKeySystem: !0, decodingInfos: [] };
          e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) {
            n = n.value;
            var r = {
              id: 0,
              originalId: null,
              groupId: null,
              createSegmentIndex: function() {
                return Promise.resolve();
              },
              segmentIndex: null,
              mimeType: n ? xn(n) : "",
              codecs: n ? hn(n) : "",
              encrypted: !0,
              drmInfos: [],
              keyIds: /* @__PURE__ */ new Set(),
              language: "und",
              originalLanguage: null,
              label: null,
              type: "video",
              primary: !1,
              trickModeVideo: null,
              dependencyStream: null,
              emsgSchemeIdUris: null,
              roles: [],
              forced: !1,
              channelsCount: null,
              audioSamplingRate: null,
              spatialAudio: !1,
              closedCaptions: null,
              accessibilityPurpose: null,
              external: !1,
              fastSwitching: !1,
              fullMimeTypes: /* @__PURE__ */ new Set(),
              isAudioMuxedInVideo: !1,
              baseOriginalId: null
            };
            r.fullMimeTypes.add(gt(r.mimeType, r.codecs)), n.startsWith("audio/") ? (r.type = "audio", t.audio = r) : t.video = r;
          }
          return t;
        }
        Y("shaka.util.StreamUtils", sm), sm.meetsRestrictions = Ga;
        var Xa = /* @__PURE__ */ new Map(), _x = 0, qa = (/* @__PURE__ */ new Map()).set("image/svg+xml", !0).set("image/png", !0).set("image/jpeg", !0).set("image/jpg", !0), Bx = (/* @__PURE__ */ new Map()).set("image/webp", "data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif", "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");
        function ht() {
          var e = this;
          this.G = null, this.H = !1, this.u = new Fs(), this.j = new Ve(), navigator.connection && navigator.connection.addEventListener && this.j.D(navigator.connection, "change", function() {
            e.g.useNetworkInformation && navigator.onLine && (e.u = new Fs(), e.g && e.u.configure(e.g.advanced), e.trySuggestStreams());
          }), this.l = [], this.I = 1, this.J = !1, this.h = this.o = this.g = this.B = null, this.m = new Ae(function() {
            if (e.H && (e.g.restrictToElementSize || e.g.restrictToScreenSize)) {
              var t = e.chooseVariant();
              t && e.G && e.G(
                t,
                e.g.clearBufferSwitch,
                e.g.safeMarginSwitch
              );
            }
          }), this.C = C, "documentPictureInPicture" in C && this.j.D(C.documentPictureInPicture, "enter", function() {
            e.C = C.documentPictureInPicture.window, e.m && e.m.Cb(), e.j.Aa(e.C, "pagehide", function() {
              e.C = C, e.m && e.m.Cb();
            });
          }), this.F = this.i = null;
        }
        f = ht.prototype, f.stop = function() {
          this.G = null, this.H = !1, this.l = [], this.I = 1, this.o = this.B = null, this.h && (this.h.disconnect(), this.h = null), this.m && this.m.stop(), this.F = this.i = null;
        }, f.release = function() {
          this.stop(), this.j.release(), this.m = null;
        }, f.init = function(e) {
          this.G = e;
        }, f.chooseVariant = function(e) {
          e = e === void 0 ? !1 : e;
          var t = 1 / 0, n = 1 / 0;
          if (this.g.restrictToScreenSize && (n = this.g.ignoreDevicePixelRatio ? 1 : this.C.devicePixelRatio, t = this.C.screen.height * n, n *= this.C.screen.width), this.h && this.g.restrictToElementSize) {
            var r = this.g.ignoreDevicePixelRatio ? 1 : this.C.devicePixelRatio, i = this.o.clientHeight, o = this.o.clientWidth;
            this.i && document.pictureInPictureElement && document.pictureInPictureElement == this.o && (i = this.i.height, o = this.i.width), t = Math.min(t, i * r), n = Math.min(
              n,
              o * r
            );
          }
          if (i = this.l.filter(function(l) {
            return l && !(l.audio && l.audio.fastSwitching || l.video && l.video.fastSwitching);
          }), i.length || (i = this.l), r = i, e && i.length != this.l.length && (r = this.l.filter(function(l) {
            return l && !!(l.audio && l.audio.fastSwitching || l.video && l.video.fastSwitching);
          })), e = Wd(this, this.g.restrictions, r, 1 / 0, 1 / 0), t != 1 / 0 || n != 1 / 0) {
            for (e = Fx(e), e = m(e), i = e.next(); !i.done; i = e.next()) if (i = i.value, i.height >= t && i.width >= n) {
              t = i.height, n = i.width;
              break;
            }
            e = Wd(
              this,
              this.g.restrictions,
              r,
              t,
              n
            );
          }
          for (t = this.getBandwidthEstimate(), r.length && !e.length && (e = Wd(this, null, r, 1 / 0, 1 / 0), e = [e[0]]), n = e[0] || null, r = 0; r < e.length; r++) {
            i = e[r];
            var s = isNaN(this.I) ? 1 : Math.abs(this.I);
            o = s * i.bandwidth / this.g.bandwidthDowngradeTarget;
            for (var u = { bandwidth: 1 / 0 }, a = r + 1; a < e.length; a++) if (i.bandwidth != e[a].bandwidth) {
              u = e[a];
              break;
            }
            s = s * u.bandwidth / this.g.bandwidthUpgradeTarget, n && i && t >= o && t <= s && (n.bandwidth != i.bandwidth || n.bandwidth == i.bandwidth && n.video && i.video && (n.video.width < i.video.width || n.video.height < i.video.height)) && (n = i);
          }
          return this.B = Date.now(), n;
        }, f.enable = function() {
          this.H = !0, this.l.length && this.trySuggestStreams();
        }, f.disable = function() {
          this.H = !1;
        }, f.segmentDownloaded = function(e, t, n, r) {
          var i = e;
          this.g.removeLatencyFromFirstPacketTime && r && r.packetNumber === 1 && r.timeToFirstByte && (i = e - r.timeToFirstByte), i >= this.g.cacheLoadThreshold && this.u.sample(i, t), n && this.B != null && this.H && vm(this);
        }, f.trySuggestStreams = function() {
          this.H && (this.B = Date.now(), vm(this, !0));
        }, f.getBandwidthEstimate = function() {
          var e = this.g.defaultBandwidthEstimate;
          return navigator.connection && navigator.connection.downlink && this.g.useNetworkInformation && (e = navigator.connection.downlink * 1e6), navigator.connection && navigator.connection.downlink && this.g.useNetworkInformation && this.g.preferNetworkInformationBandwidth ? e : (e = this.u.getBandwidthEstimate(e), this.F ? this.F.getBandwidthEstimate(e) : e);
        }, f.setVariants = function(e) {
          return Vi(e, this.l) ? !1 : (this.l = e, !0);
        }, f.playbackRateChanged = function(e) {
          this.I = e;
        }, f.setMediaElement = function(e) {
          function t() {
            n.m.ka(Vx);
          }
          var n = this;
          this.o = e, this.h && (this.h.disconnect(), this.h = null), this.o && "ResizeObserver" in C && (this.h = new ResizeObserver(t), this.h.observe(this.o)), this.j.D(e, "enterpictureinpicture", function(r) {
            r.pictureInPictureWindow && (n.i = r.pictureInPictureWindow, n.j.D(n.i, "resize", t));
          }), this.j.D(e, "leavepictureinpicture", function() {
            n.i && n.j.Ma(n.i, "resize", t), n.i = null;
          });
        }, f.setCmsdManager = function(e) {
          this.F = e;
        }, f.configure = function(e) {
          this.g = e, this.u && this.g && this.u.configure(this.g.advanced);
        };
        function vm(e, t) {
          if (t === void 0 || !t) {
            if (!e.J) {
              if (t = e.u, !(t.g >= t.i)) return;
              e.J = !0, e.B -= (e.g.switchInterval - e.g.minTimeToSwitch) * 1e3;
            }
            if (Date.now() - e.B < e.g.switchInterval * 1e3) return;
          }
          t = e.chooseVariant(), e.getBandwidthEstimate(), t && e.G && e.G(t, e.g.clearBufferSwitch, e.g.safeMarginSwitch);
        }
        function Wd(e, t, n, r, i) {
          if (e.F) {
            var o = e.F.ei();
            o && (n = n.filter(function(s) {
              return s.bandwidth && o ? s.bandwidth <= o : !0;
            }));
          }
          return t && (n = n.filter(function(s) {
            return Ga(s, t, { width: i, height: r });
          })), n.sort(function(s, u) {
            return s.bandwidth - u.bandwidth;
          });
        }
        function Fx(e) {
          var t = [];
          e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) (n = n.value) && (n = n.video) && n.height && n.width && t.push({ height: n.height, width: n.width });
          return t.sort(function(r, i) {
            return r.width - i.width;
          });
        }
        Y("shaka.abr.SimpleAbrManager", ht), ht.prototype.configure = ht.prototype.configure, ht.prototype.setCmsdManager = ht.prototype.setCmsdManager, ht.prototype.setMediaElement = ht.prototype.setMediaElement, ht.prototype.playbackRateChanged = ht.prototype.playbackRateChanged, ht.prototype.setVariants = ht.prototype.setVariants, ht.prototype.getBandwidthEstimate = ht.prototype.getBandwidthEstimate, ht.prototype.trySuggestStreams = ht.prototype.trySuggestStreams, ht.prototype.segmentDownloaded = ht.prototype.segmentDownloaded, ht.prototype.disable = ht.prototype.disable, ht.prototype.enable = ht.prototype.enable, ht.prototype.chooseVariant = ht.prototype.chooseVariant, ht.prototype.init = ht.prototype.init, ht.prototype.release = ht.prototype.release, ht.prototype.stop = ht.prototype.stop;
        var Vx = 1;
        function ym(e, t) {
          var n = cr();
          this.l = e.maxAttempts == null ? n.maxAttempts : e.maxAttempts, this.j = e.baseDelay == null ? n.baseDelay : e.baseDelay, this.o = e.fuzzFactor == null ? n.fuzzFactor : e.fuzzFactor, this.m = e.backoffFactor == null ? n.backoffFactor : e.backoffFactor, this.g = 0, this.h = this.j, (this.i = t === void 0 ? !1 : t) && (this.g = 1);
        }
        function wm(e) {
          var t, n;
          return D(function(r) {
            if (r.g == 1) {
              if (e.g >= e.l) if (e.i) e.g = 1, e.h = e.j;
              else throw new b(2, 7, 1010);
              return t = e.g, e.g++, t == 0 ? r.return() : (n = e.h * (1 + (Math.random() * 2 - 1) * e.o), x(r, new Promise(function(i) {
                new Ae(i).ka(n / 1e3);
              }), 2));
            }
            e.h *= e.m, q(r);
          });
        }
        function cr() {
          return { maxAttempts: 2, baseDelay: 1e3, backoffFactor: 2, fuzzFactor: 0.5, timeout: 3e4, stallTimeout: 5e3, connectionTimeout: 1e4 };
        }
        function Je() {
          var e, t, n = new Promise(function(r, i) {
            e = r, t = i;
          });
          return n.resolve = e, n.reject = t, n;
        }
        Je.prototype.resolve = function() {
        }, Je.prototype.reject = function() {
        };
        function mt(e, t) {
          this.promise = e, this.i = t, this.g = null;
        }
        function Ti(e) {
          return new mt(Promise.reject(e), function() {
            return Promise.resolve();
          });
        }
        function zd() {
          var e = Promise.reject(new b(2, 7, 7001));
          return e.catch(function() {
          }), new mt(e, function() {
            return Promise.resolve();
          });
        }
        function Fo(e) {
          return new mt(Promise.resolve(e), function() {
            return Promise.resolve();
          });
        }
        function Tm(e) {
          return new mt(e, function() {
            return e.catch(function() {
            });
          });
        }
        mt.prototype.abort = function() {
          return this.g || (this.g = this.i()), this.g;
        };
        function Sm(e) {
          return new mt(Promise.all(e.map(function(t) {
            return t.promise;
          })), function() {
            return Promise.all(e.map(function(t) {
              return t.abort();
            }));
          });
        }
        mt.prototype.finally = function(e) {
          return this.promise.then(function() {
            return e(!0);
          }, function() {
            return e(!1);
          }), this;
        }, mt.prototype.Xa = function(e, t) {
          function n(u) {
            return function(a) {
              if (i.g && u) o.reject(s);
              else {
                var l = u ? e : t;
                l ? r = Hx(l, a, o) : (u ? o.resolve : o.reject)(a);
              }
            };
          }
          function r() {
            return o.reject(s), i.abort();
          }
          var i = this, o = new Je();
          o.catch(function() {
          });
          var s = new b(2, 7, 7001);
          return this.promise.then(n(!0), n(!1)), new mt(o, function() {
            return r();
          });
        };
        function Hx(e, t, n) {
          try {
            var r = e(t);
            return r && r.promise && r.abort ? (n.resolve(r.promise), function() {
              return r.abort();
            }) : (n.resolve(r), function() {
              return Promise.resolve(r).then(function() {
              }, function() {
              });
            });
          } catch (i) {
            return n.reject(i), function() {
              return Promise.resolve();
            };
          }
        }
        it.Object.defineProperties(mt.prototype, { aborted: { configurable: !0, enumerable: !0, get: function() {
          return this.g !== null;
        } } }), Y("shaka.util.AbortableOperation", mt), mt.prototype.chain = mt.prototype.Xa, mt.prototype.finally = mt.prototype.finally, mt.all = Sm, mt.prototype.abort = mt.prototype.abort, mt.notAbortable = Tm, mt.completed = Fo, mt.aborted = zd, mt.failed = Ti;
        function ee(e, t) {
          if (t) if (t instanceof Map) for (var n = m(t.keys()), r = n.next(); !r.done; r = n.next()) r = r.value, Object.defineProperty(this, r, { value: t.get(r), writable: !0, enumerable: !0 });
          else for (n in t) Object.defineProperty(this, n, { value: t[n], writable: !0, enumerable: !0 });
          this.defaultPrevented = this.cancelable = this.bubbles = !1, this.timeStamp = C.performance && C.performance.now ? C.performance.now() : Date.now(), this.type = e, this.isTrusted = !1, this.target = this.currentTarget = null, this.g = !1;
        }
        function xm(e) {
          var t = new ee(e.type), n;
          for (n in e) Object.defineProperty(t, n, { value: e[n], writable: !0, enumerable: !0 });
          return t;
        }
        ee.prototype.preventDefault = function() {
          this.cancelable && (this.defaultPrevented = !0);
        }, ee.prototype.stopImmediatePropagation = function() {
          this.g = !0;
        }, ee.prototype.stopPropagation = function() {
        }, Y("shaka.util.FakeEvent", ee);
        var Ya = {
          ul: "abrstatuschanged",
          vl: "adaptation",
          wl: "audiotrackchanged",
          xl: "audiotrackschanged",
          yl: "boundarycrossed",
          zl: "buffering",
          Al: "canupdatestarttime",
          Bl: "complete",
          Cl: "currentitemchanged",
          Dl: "downloadcompleted",
          El: "downloadfailed",
          Fl: "downloadheadersreceived",
          Gl: "drmsessionupdate",
          Hl: "emsg",
          Nl: "itemsinserted",
          Ol: "itemsremoved",
          dm: "prft",
          Error: "error",
          Il: "expirationupdated",
          Jl: "firstquartile",
          Kl: "gapjumped",
          Pl: "keystatuschanged",
          Sl: "loaded",
          Tl: "loading",
          Vl: "manifestparsed",
          Wl: "manifestupdated",
          Xl: "mediaqualitychanged",
          Yl: "mediasourcerecovered",
          Zl: "metadataadded",
          Metadata: "metadata",
          $l: "midpoint",
          am: "nospatialvideoinfo",
          bm: "onstatechange",
          fm: "ratechange",
          im: "segmentappended",
          jm: "sessiondata",
          lm: "spatialvideoinfo",
          nm: "stalldetected",
          om: "started",
          pm: "statechanged",
          qm: "streaming",
          rm: "textchanged",
          sm: "texttrackvisibility",
          tm: "thirdquartile",
          um: "timelineregionadded",
          vm: "timelineregionenter",
          wm: "timelineregionexit",
          xm: "trackschanged",
          zm: "unloading",
          Bm: "variantchanged"
        };
        function Xe() {
          this.ab = new ya(), this.Ie = this;
        }
        Xe.prototype.addEventListener = function(e, t) {
          this.ab && this.ab.push(e, t);
        }, Xe.prototype.removeEventListener = function(e, t) {
          this.ab && this.ab.remove(e, t);
        }, Xe.prototype.dispatchEvent = function(e) {
          if (!this.ab) return !0;
          var t = this.ab.get(e.type) || [], n = this.ab.get("All");
          for (n && (t = t.concat(n)), t = m(t), n = t.next(); !n.done; n = t.next()) {
            n = n.value, e.target = this.Ie, e.currentTarget = this.Ie;
            try {
              n.handleEvent ? n.handleEvent(e) : n.call(this, e);
            } catch {
            }
            if (e.g) break;
          }
          return e.defaultPrevented;
        }, Xe.prototype.release = function() {
          this.ab = null;
        };
        function Vo() {
          this.g = [];
        }
        function eo(e, t) {
          e.g.push(t.finally(function() {
            Gn(e.g, t);
          }));
        }
        Vo.prototype.destroy = function() {
          for (var e = [], t = m(this.g), n = t.next(); !n.done; n = t.next()) n = n.value, n.promise.catch(function() {
          }), e.push(n.abort());
          return this.g = [], Promise.all(e);
        };
        function at(e, t, n, r, i, o, s) {
          Xe.call(this), this.i = null, this.j = !1, this.u = new Vo(), this.g = /* @__PURE__ */ new Set(), this.h = /* @__PURE__ */ new Set(), this.o = e || null, this.m = t || null, this.B = n || null, this.C = r || null, this.F = i || null, this.H = o || null, this.G = s || null, this.l = /* @__PURE__ */ new Map();
        }
        tt(at, Xe), f = at.prototype, f.configure = function(e) {
          this.i = e;
        };
        function zr(e, t, n, r) {
          r = r === void 0 ? !1 : r, n = n || Cm;
          var i = Ja.get(e);
          (!i || n >= i.priority) && Ja.set(e, { priority: n, yf: t, Gk: r });
        }
        function Am(e, t) {
          for (var n = m(e.g), r = n.next(); !r.done; r = n.next()) t.g.add(r.value);
          for (e = m(e.h), n = e.next(); !n.done; n = e.next()) t.h.add(n.value);
        }
        f.Jk = function(e) {
          this.g.add(e);
        }, f.il = function(e) {
          this.g.delete(e);
        }, f.sj = function() {
          this.g.clear();
        }, f.Kk = function(e) {
          this.h.add(e);
        }, f.jl = function(e) {
          this.h.delete(e);
        }, f.tj = function() {
          this.h.clear();
        }, f.Th = function() {
          this.l.clear();
        };
        function At(e, t, n) {
          return { uris: e, method: "GET", body: null, headers: {}, allowCrossSiteCredentials: !1, retryParameters: t, licenseRequestType: null, sessionId: null, drmInfo: null, initData: null, initDataType: null, streamDataCallback: n === void 0 ? null : n };
        }
        f.destroy = function() {
          return this.j = !0, this.g.clear(), this.h.clear(), this.l.clear(), Xe.prototype.release.call(this), this.u.destroy();
        }, f.request = function(e, t, n) {
          var r = this, i = new Mm();
          if (this.j) {
            var o = Promise.reject(new b(2, 7, 7001));
            return o.catch(function() {
            }), new $a(o, function() {
              return Promise.resolve();
            }, i);
          }
          t.method = t.method || "GET", t.headers = t.headers || {}, t.retryParameters = t.retryParameters ? ar(t.retryParameters) : cr(), t.uris = ar(t.uris), o = Gx(this, e, t, n);
          var s = o.Xa(function() {
            return Em(r, e, t, n, new ym(t.retryParameters, !1), 0, null, i);
          }), u = s.Xa(function(h) {
            return Kx(r, e, h, n);
          }), a = Date.now(), l = 0;
          o.promise.then(function() {
            l = Date.now() - a;
          }, function() {
          });
          var c = 0;
          s.promise.then(function() {
            c = Date.now();
          }, function() {
          });
          var d = u.Xa(function(h) {
            var p = Date.now() - c, g = h.response;
            return g.timeMs += l, g.timeMs += p, h.gk || !r.o || g.fromCache || t.method == "HEAD" || e != Xn || r.o(g.timeMs, g.data.byteLength, Im(n), t, n), r.G && r.G(e, g, n), g;
          }, function(h) {
            throw h && (h.severity = 2), h;
          });
          return o = new $a(d.promise, function() {
            return d.abort();
          }, i), eo(this.u, o), o;
        };
        function Gx(e, t, n, r) {
          function i(u) {
            o = o.Xa(function() {
              return n.body && (n.body = Kn(n.body)), u(t, n, r);
            });
          }
          var o = Fo(void 0);
          e.F && i(e.F), e = m(e.g);
          for (var s = e.next(); !s.done; s = e.next()) i(s.value);
          return o.Xa(void 0, function(u) {
            throw u instanceof b && u.code == 7001 ? u : new b(2, 1, 1006, u);
          });
        }
        function Em(e, t, n, r, i, o, s, u) {
          e.i.forceHTTP && (n.uris[o] = n.uris[o].replace("https://", "http://")), e.i.forceHTTPS && (n.uris[o] = n.uris[o].replace("http://", "https://")), o > 0 && e.H && e.H(t, r, n.uris[o], n.uris[o - 1]);
          var a = new yt(n.uris[o]), l = a.jc, c = !1;
          l || (l = location.protocol, l = l.slice(0, -1), wa(a, l), n.uris[o] = a.toString()), l = l.toLowerCase();
          var d = (l = Ja.get(l)) ? l.yf : null;
          if (!d) return Ti(new b(2, 1, 1e3, a));
          var h = l.Gk;
          (a = e.l.get(a.Fb)) && (n.headers["common-access-token"] = a);
          var p = null, g = null, w = !1, T = !1, E;
          return Tm(wm(i)).Xa(function() {
            if (e.j) return zd();
            E = Date.now();
            var A = 0;
            n.requestStartTime = Date.now();
            var I = d(n.uris[o], n, t, function(M, R, k) {
              p && p.stop(), g && g.ka(N / 1e3), e.o && t == Xn && (A++, n.packetNumber = A, e.o(M, R, Im(r), n, r), c = !0, u.g = k);
            }, function(M) {
              T = !0, n.timeToFirstByte = Date.now() - n.requestStartTime, e.m && e.m(M, n, t);
            }, { minBytesForProgressEvents: e.i.minBytesForProgressEvents });
            if (!h) return I;
            var P = n.retryParameters.connectionTimeout;
            P && (p = new Ae(function() {
              w = !0, I.abort();
            }), p.ka(P / 1e3));
            var N = n.retryParameters.stallTimeout;
            return N && (g = new Ae(function() {
              w = !0, I.abort();
            })), I;
          }).Xa(function(A) {
            p && p.stop(), g && g.stop(), A.timeMs == null && (A.timeMs = Date.now() - E);
            var I = A.headers["common-access-token"];
            if (I) {
              var P = new yt(A.uri);
              e.l.set(P.Fb, I);
            }
            return I = { response: A, gk: c }, !T && e.m && e.m(A.headers, n, t), e.B && e.B(n, A), I;
          }, function(A) {
            if (p && p.stop(), g && g.stop(), e.C) {
              var I = null, P = 0;
              A instanceof b && (I = A, A.code == 1001 && (P = A.data[1])), e.C(n, I, P, w);
            }
            if (e.j) return zd();
            if (w && (A = new b(1, 1, 1003, n.uris[o], t)), A instanceof b) {
              if (A.code == 7001) throw A;
              if (A.code == 1010) throw s;
              if (A.severity == 1) {
                if (I = (/* @__PURE__ */ new Map()).set("error", A), I = new ee("retry", I), I.cancelable = !0, e.dispatchEvent(I), I.defaultPrevented) throw A;
                return o = (o + 1) % n.uris.length, Em(e, t, n, r, i, o, A, u);
              }
            }
            throw A;
          });
        }
        function Kx(e, t, n, r) {
          var i = Fo(void 0);
          e = m(e.h);
          for (var o = e.next(), s = {}; !o.done; s = { Li: void 0 }, o = e.next()) s.Li = o.value, i = i.Xa(/* @__PURE__ */ (function(u) {
            return function() {
              var a = n.response;
              return a.data && (a.data = Kn(a.data)), (0, u.Li)(t, a, r);
            };
          })(s));
          return i.Xa(function() {
            return n;
          }, function(u) {
            var a = 2;
            if (u instanceof b) {
              if (u.code == 7001) throw u;
              a = u.severity;
            }
            throw new b(a, 1, 1007, u);
          });
        }
        function Im(e) {
          if (e) {
            var t = e.segment;
            if (e = e.stream, t && e && e.fastSwitching && t.Wc) return !1;
          }
          return !0;
        }
        Y("shaka.net.NetworkingEngine", at), at.prototype.request = at.prototype.request, at.prototype.destroy = at.prototype.destroy, at.makeRequest = At, at.defaultRetryParameters = function() {
          return cr();
        }, at.prototype.clearCommonAccessTokenMap = at.prototype.Th, at.prototype.clearAllResponseFilters = at.prototype.tj, at.prototype.unregisterResponseFilter = at.prototype.jl, at.prototype.registerResponseFilter = at.prototype.Kk, at.prototype.clearAllRequestFilters = at.prototype.sj, at.prototype.unregisterRequestFilter = at.prototype.il, at.prototype.registerRequestFilter = at.prototype.Jk, at.unregisterScheme = function(e) {
          Ja.delete(e);
        }, at.registerScheme = zr, at.prototype.configure = at.prototype.configure;
        function Mm() {
          this.g = 0;
        }
        at.NumBytesRemainingClass = Mm;
        function $a(e, t, n) {
          mt.call(this, e, t), this.h = n;
        }
        tt($a, mt), at.PendingRequest = $a;
        var Xn = 1;
        at.RequestType = { MANIFEST: 0, SEGMENT: Xn, LICENSE: 2, APP: 3, TIMING: 4, SERVER_CERTIFICATE: 5, KEY: 6, ADS: 7, CONTENT_STEERING: 8, CMCD: 9 }, at.AdvancedRequestType = { INIT_SEGMENT: 0, MEDIA_SEGMENT: 1, MEDIA_PLAYLIST: 2, MASTER_PLAYLIST: 3, MPD: 4, MSS: 5, MPD_PATCH: 6, MEDIATAILOR_SESSION_INFO: 7, MEDIATAILOR_TRACKING_INFO: 8, MEDIATAILOR_STATIC_RESOURCE: 9, MEDIATAILOR_TRACKING_EVENT: 10, INTERSTITIAL_ASSET_LIST: 11, INTERSTITIAL_AD_URL: 12 };
        var Cm = 3;
        at.PluginPriority = { FALLBACK: 1, PREFERRED: 2, APPLICATION: Cm };
        var Ja = /* @__PURE__ */ new Map();
        function Ho(e) {
          this.g = !1, this.h = new Je(), this.i = e;
        }
        Ho.prototype.destroy = function() {
          var e = this;
          return this.g ? this.h : (this.g = !0, this.i().then(function() {
            e.h.resolve();
          }, function() {
            e.h.resolve();
          }));
        };
        function nt(e, t) {
          if (e.g)
            throw t instanceof b && t.code == 7003 ? t : new b(2, 7, 7003, t);
        }
        function Xd(e, t) {
          var n = [];
          e = m(e);
          for (var r = e.next(); !r.done; r = e.next()) n.push(t(r.value));
          return n;
        }
        function Wx(e, t) {
          e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) if (!t(n.value)) return !1;
          return !0;
        }
        function Go(e) {
          for (var t = /* @__PURE__ */ new Map(), n = m(Object.keys(e)), r = n.next(); !r.done; r = n.next()) r = r.value, t.set(r, e[r]);
          return t;
        }
        function qd(e) {
          var t = {};
          return e.forEach(function(n, r) {
            t[r] = n;
          }), t;
        }
        function st(e, t) {
          this.h = dn(e), this.i = t == km, this.g = 0;
        }
        f = st.prototype, f.Ka = function() {
          return this.g < this.h.byteLength;
        }, f.Pa = function() {
          return this.g;
        }, f.getLength = function() {
          return this.h.byteLength;
        }, f.Z = function() {
          try {
            var e = this.h.getUint8(this.g);
            return this.g += 1, e;
          } catch {
            throw Xr();
          }
        }, f.Ca = function() {
          try {
            var e = this.h.getUint16(this.g, this.i);
            return this.g += 2, e;
          } catch {
            throw Xr();
          }
        }, f.V = function() {
          try {
            var e = this.h.getUint32(this.g, this.i);
            return this.g += 4, e;
          } catch {
            throw Xr();
          }
        }, f.$g = function() {
          try {
            var e = this.h.getInt32(this.g, this.i);
            return this.g += 4, e;
          } catch {
            throw Xr();
          }
        }, f.Fd = function() {
          try {
            if (this.i)
              var e = this.h.getUint32(this.g, !0), t = this.h.getUint32(this.g + 4, !0);
            else t = this.h.getUint32(this.g, !1), e = this.h.getUint32(this.g + 4, !1);
          } catch {
            throw Xr();
          }
          if (t > 2097151) throw new b(2, 3, 3001);
          return this.g += 8, t * 4294967296 + e;
        }, f.Tb = function(e, t) {
          if (this.g + e > this.h.byteLength) throw Xr();
          var n = pe(this.h, this.g, e);
          return this.g += e, t ? new Uint8Array(n) : n;
        }, f.skip = function(e) {
          if (this.g + e > this.h.byteLength) throw Xr();
          this.g += e;
        }, f.Mi = function(e) {
          if (this.g < e) throw Xr();
          this.g -= e;
        }, f.seek = function(e) {
          if (e < 0 || e > this.h.byteLength) throw Xr();
          this.g = e;
        }, f.Ed = function() {
          for (var e = this.g; this.Ka() && this.h.getUint8(this.g) != 0; ) this.g += 1;
          return e = pe(this.h, e, this.g - e), this.g += 1, dt(e);
        };
        function Xr() {
          return new b(2, 3, 3e3);
        }
        Y("shaka.util.DataViewReader", st), st.prototype.readTerminatedString = st.prototype.Ed, st.prototype.seek = st.prototype.seek, st.prototype.rewind = st.prototype.Mi, st.prototype.skip = st.prototype.skip, st.prototype.readBytes = st.prototype.Tb, st.prototype.readUint64 = st.prototype.Fd, st.prototype.readInt32 = st.prototype.$g, st.prototype.readUint32 = st.prototype.V, st.prototype.readUint16 = st.prototype.Ca, st.prototype.readUint8 = st.prototype.Z, st.prototype.getLength = st.prototype.getLength, st.prototype.getPosition = st.prototype.Pa, st.prototype.hasMoreData = st.prototype.Ka;
        var km = 1;
        st.Endianness = { BIG_ENDIAN: 0, LITTLE_ENDIAN: km };
        function qe() {
          this.i = /* @__PURE__ */ new Map(), this.h = /* @__PURE__ */ new Map(), this.g = !1;
        }
        f = qe.prototype, f.box = function(e, t) {
          return e = Pm(e), this.i.set(e, zx), this.h.set(e, t), this;
        }, f.S = function(e, t) {
          return e = Pm(e), this.i.set(e, Dm), this.h.set(e, t), this;
        }, f.stop = function() {
          this.g = !0;
        }, f.parse = function(e, t, n) {
          for (e = new st(e, 0), this.g = !1; e.Ka() && !this.g; ) this.Bd(0, e, t, n);
        }, f.Bd = function(e, t, n, r) {
          var i = t.Pa();
          if (r && i + 8 > t.getLength()) this.g = !0;
          else {
            var o = t.V(), s = t.V(), u = Za(s), a = !1;
            switch (o) {
              case 0:
                o = t.getLength() - i;
                break;
              case 1:
                if (r && t.Pa() + 8 > t.getLength()) {
                  this.g = !0;
                  return;
                }
                o = t.Fd(), a = !0;
            }
            var l = this.h.get(s);
            if (l) {
              var c = null, d = null;
              if (this.i.get(s) == Dm) {
                if (r && t.Pa() + 4 > t.getLength()) {
                  this.g = !0;
                  return;
                }
                d = t.V(), c = d >>> 24, d &= 16777215;
              }
              s = i + o, n && s > t.getLength() && (s = t.getLength()), r && s > t.getLength() ? this.g = !0 : (s -= t.Pa(), t = s > 0 ? t.Tb(s, !1) : new Uint8Array(0), t = new st(t, 0), l({
                name: u,
                parser: this,
                partialOkay: n || !1,
                stopOnPartial: r || !1,
                version: c,
                flags: d,
                reader: t,
                size: o,
                start: i + e,
                has64BitSize: a
              }));
            } else t.skip(Math.min(i + o - t.Pa(), t.getLength() - t.Pa()));
          }
        };
        function Te(e) {
          for (var t = Si(e); e.reader.Ka() && !e.parser.g; ) e.parser.Bd(e.start + t, e.reader, e.partialOkay, e.stopOnPartial);
        }
        function qr(e) {
          for (var t = Si(e), n = e.reader.V(), r = 0; r < n && (e.parser.Bd(e.start + t, e.reader, e.partialOkay, e.stopOnPartial), !e.parser.g); r++) ;
        }
        function An(e) {
          var t = Si(e);
          for (e.reader.skip(78); e.reader.Ka() && !e.parser.g; ) e.parser.Bd(e.start + t, e.reader, e.partialOkay, e.stopOnPartial);
        }
        function Qa(e) {
          var t = Si(e);
          e.reader.skip(8);
          var n = e.reader.Ca();
          for (e.reader.skip(6), n == 2 ? e.reader.skip(48) : e.reader.skip(12), n == 1 && e.reader.skip(16); e.reader.Ka() && !e.parser.g; ) e.parser.Bd(e.start + t, e.reader, e.partialOkay, e.stopOnPartial);
        }
        function Ko(e, t) {
          return function(n) {
            e(n.reader.Tb(n.reader.getLength() - n.reader.Pa(), t));
          };
        }
        function Pm(e) {
          var t = 0;
          e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) t = t << 8 | n.value.charCodeAt(0);
          return t;
        }
        function Za(e) {
          return String.fromCharCode(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255);
        }
        function Si(e) {
          return 8 + (e.has64BitSize ? 8 : 0) + (e.flags != null ? 4 : 0);
        }
        Y("shaka.util.Mp4Parser", qe), qe.headerSize = Si, qe.typeToString = Za, qe.allData = Ko, qe.audioSampleEntry = Qa, qe.visualSampleEntry = An, qe.sampleDescription = qr, qe.children = Te, qe.prototype.parseNext = qe.prototype.Bd, qe.prototype.parse = qe.prototype.parse, qe.prototype.stop = qe.prototype.stop, qe.prototype.fullBox = qe.prototype.S, qe.prototype.box = qe.prototype.box;
        var zx = 0, Dm = 1;
        function Yd(e) {
          var t = this;
          this.g = [], this.data = [], new qe().box("moov", Te).box("moof", Te).S("pssh", function(n) {
            if (!(n.version > 1)) {
              var r = pe(n.reader.h, -12, n.size);
              t.data.push(r), n = n.reader.Tb(16, !1), t.g.push(hi(n));
            }
          }).parse(e);
        }
        function el(e, t, n, r) {
          var i = e.length, o = 12 + t.length + 4 + i;
          r > 0 && (o += 4 + 16 * n.size);
          var s = new Uint8Array(o), u = dn(s), a = 0;
          if (u.setUint32(a, o), a += 4, u.setUint32(a, 1886614376), a += 4, r < 1 ? u.setUint32(a, 0) : u.setUint32(a, 16777216), a += 4, s.set(t, a), a += t.length, r > 0) for (u.setUint32(a, n.size), a += 4, t = m(n), n = t.next(); !n.done; n = t.next()) n = Gi(n.value), s.set(n, a), a += n.length;
          return u.setUint32(a, i), s.set(e, a + 4), s;
        }
        function tl(e) {
          var t = this;
          this.F = e, this.l = this.B = null, this.$ = this.T = !1, this.J = 0, this.g = null, this.o = new Ve(), this.i = /* @__PURE__ */ new Map(), this.X = [], this.C = /* @__PURE__ */ new Map(), this.K = !1, this.m = new Je(), this.h = null, this.u = function(n) {
            n.severity == 2 && t.m.reject(n), e.onError(n);
          }, this.ba = /* @__PURE__ */ new Map(), this.ma = /* @__PURE__ */ new Map(), this.M = new Ae(function() {
            return rA(t);
          }), this.R = !1, this.N = [], this.oa = !1, this.G = new Ae(function() {
            oA(t);
          }), this.m.catch(function() {
          }), this.j = new Ho(function() {
            return Xx(t);
          }), this.O = !1, this.H = this.I = null, this.W = function() {
            return !1;
          };
        }
        f = tl.prototype, f.destroy = function() {
          return this.j.destroy();
        };
        function Xx(e) {
          return D(function(t) {
            switch (t.g) {
              case 1:
                return e.o.release(), e.o = null, e.m.reject(), e.G.stop(), e.G = null, e.M.stop(), e.M = null, x(t, uu(e), 2);
              case 2:
                if (!e.l) {
                  t.A(3);
                  break;
                }
                return de(t, 4), x(t, e.l.setMediaKeys(null), 6);
              case 6:
                ye(t, 5);
                break;
              case 4:
                he(t);
              case 5:
                e.l = null;
              case 3:
                e.g = null, e.B = null, e.C = /* @__PURE__ */ new Map(), e.h = null, e.u = function() {
                }, e.F = null, e.O = !1, e.I = null, q(t);
            }
          });
        }
        f.configure = function(e, t) {
          this.h = e, t && (this.W = t), this.G && this.T && this.g && this.G.Ea(this.h.updateExpirationTime);
        };
        function qx(e, t, n) {
          return e.$ = !0, e.C = /* @__PURE__ */ new Map(), e.R = n, Lm(e, t, !1);
        }
        function Rm(e, t, n, r) {
          r = r === void 0 ? !0 : r, e.C = /* @__PURE__ */ new Map(), n = m(n);
          for (var i = n.next(); !i.done; i = n.next()) e.C.set(i.value, { initData: null, initDataType: null });
          for (n = m(e.h.persistentSessionsMetadata), i = n.next(); !i.done; i = n.next()) i = i.value, e.C.set(i.sessionId, { initData: i.initData, initDataType: i.initDataType });
          return e.R = e.C.size > 0, Lm(e, t, r);
        }
        function Yx(e, t, n, r, i, o) {
          var s, u, a, l, c;
          return D(function(d) {
            return d.g == 1 ? (s = [], o.length && s.push(o[0].contentType), i.length && s.push(i[0].contentType), u = function(h) {
              return h = Br(t, h, null), h.licenseServerUri = n, h.serverCertificate = r, h.persistentStateRequired = !0, h.sessionType = "persistent-license", h;
            }, a = mm(s), a.video && (l = u(o[0].encryptionScheme || ""), a.video.drmInfos.push(l)), a.audio && (c = u(i[0].encryptionScheme || ""), a.audio.drmInfos.push(c)), x(d, Hd([a], !0, e.O, []), 2)) : (nt(e.j), d.return(jm(e, [a])));
          });
        }
        function Lm(e, t, n) {
          var r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P;
          return D(function(N) {
            if (N.g == 1) {
              for (Hm(e.h.clearKeys, t), r = t.some(function(M) {
                return !!(M.video && M.video.drmInfos.length || M.audio && M.audio.drmInfos.length);
              }), i = Go(e.h.servers), o = Go(e.h.advanced || {}), !r && n && uA(t, i), s = /* @__PURE__ */ new WeakSet(), u = m(t), a = u.next(); !a.done; a = u.next()) for (l = a.value, c = Vm(l), d = m(c), h = d.next(); !h.done; h = d.next()) p = h.value, s.has(p) || (s.add(p), lA(p, i, o, e.h.keySystemsMapping));
              for (g = function(M, R) {
                var k = [];
                M = m(M);
                for (var O = M.next(); !O.done; O = M.next()) {
                  O = O.value;
                  var L = O[R] || o.has(O.keySystem) && o.get(O.keySystem)[R] || "";
                  if (L == "" && Rg(O.keySystem) && (R == "audioRobustness" ? L = [e.h.defaultAudioRobustnessForWidevine] : R == "videoRobustness" && (L = [e.h.defaultVideoRobustnessForWidevine])), typeof L == "string") k.push(O);
                  else if (Array.isArray(L)) {
                    L.length === 0 && (L = [""]), L = m(L);
                    for (var U = L.next(); !U.done; U = L.next()) {
                      var j = {};
                      k.push(Object.assign({}, O, (j[R] = U.value, j)));
                    }
                  }
                }
                return k;
              }, w = /* @__PURE__ */ new WeakSet(), T = m(t), E = T.next(); !E.done; E = T.next()) A = E.value, A.video && !w.has(A.video) && (A.video.drmInfos = g(A.video.drmInfos, "videoRobustness"), A.video.drmInfos = g(A.video.drmInfos, "audioRobustness"), w.add(A.video)), A.audio && !w.has(A.audio) && (A.audio.drmInfos = g(A.audio.drmInfos, "videoRobustness"), A.audio.drmInfos = g(A.audio.drmInfos, "audioRobustness"), w.add(A.audio));
              return x(N, Hd(t, e.R, e.O, e.h.preferredKeySystems), 2);
            }
            return nt(e.j), I = r || i.size > 0, I ? (P = jm(e, t), N.return(r ? P : P.catch(function() {
            }))) : (e.T = !0, N.return(Promise.resolve()));
          });
        }
        function bm(e) {
          var t;
          return D(function(n) {
            switch (n.g) {
              case 1:
                if (e.l.mediaKeys) return n.return();
                if (!e.I) {
                  n.A(2);
                  break;
                }
                return x(n, e.I, 3);
              case 3:
                return nt(e.j), n.return();
              case 2:
                return de(n, 4), e.I = e.l.setMediaKeys(e.B), x(n, e.I, 6);
              case 6:
                ye(n, 5);
                break;
              case 4:
                t = he(n), e.u(new b(2, 6, 6003, t.message));
              case 5:
                nt(e.j), q(n);
            }
          });
        }
        function $x(e, t) {
          return D(function(n) {
            if (n.g == 1) return x(n, bm(e), 2);
            su(e, t.initDataType, pe(t.initData)), q(n);
          });
        }
        f.Vb = function(e) {
          var t = this, n, r;
          return D(function(i) {
            if (i.g == 1)
              return t.l === e ? i.return() : t.B ? (t.l = e, t.h.delayLicenseRequestUntilPlayed && t.o.Aa(t.l, "play", function() {
                for (var o = m(t.N), s = o.next(); !s.done; s = o.next()) Qd(t, s.value);
                t.oa = !0, t.N = [];
              }), t.l.remote ? (t.o.D(t.l.remote, "connect", function() {
                return uu(t);
              }), t.o.D(t.l.remote, "connecting", function() {
                return uu(t);
              }), t.o.D(t.l.remote, "disconnect", function() {
                return uu(t);
              })) : "webkitCurrentPlaybackTargetIsWireless" in t.l && t.o.D(t.l, "webkitcurrentplaybacktargetiswirelesschanged", function() {
                return uu(t);
              }), t.H = t.g && t.g.initData.find(function(o) {
                return o.initData.length > 0;
              }) || null, n = t.g.keySystem, (r = Se().Sg(n)) || !t.H && t.g.keySystem === "com.apple.fps" && !t.C.size ? i.A(2) : x(i, bm(t), 2)) : (t.o.Aa(e, "encrypted", function() {
                t.u(new b(2, 6, 6010));
              }), i.return());
            Nm(t).catch(function() {
            }), !r && (t.H || t.C.size || t.h.parseInbandPsshEnabled) || t.o.D(t.l, "encrypted", function(o) {
              return $x(t, o);
            }), q(i);
          });
        };
        function Jx(e) {
          var t, n, r, i, o;
          return D(function(s) {
            switch (s.g) {
              case 1:
                if (!e.B || !e.g) return s.return();
                if (!e.g.serverCertificateUri || e.g.serverCertificate && e.g.serverCertificate.length) {
                  s.A(2);
                  break;
                }
                return t = At([e.g.serverCertificateUri], e.h.retryParameters), de(s, 3), n = e.F.wc.request(5, t, { isPreload: e.W() }), x(s, n.promise, 5);
              case 5:
                r = s.h, e.g.serverCertificate = pe(r.data), ye(s, 4);
                break;
              case 3:
                throw i = he(s), new b(2, 6, 6017, i);
              case 4:
                if (e.j.g) return s.return();
              case 2:
                return !e.g.serverCertificate || !e.g.serverCertificate.length ? s.return() : (de(s, 6), x(s, e.B.setServerCertificate(e.g.serverCertificate), 8));
              case 8:
                ye(s, 0);
                break;
              case 6:
                throw o = he(s), new b(2, 6, 6004, o.message);
            }
          });
        }
        function Qx(e, t) {
          var n, r, i;
          return D(function(o) {
            if (o.g == 1) return x(o, _m(e, t, { initData: null, initDataType: null }), 2);
            if (o.g != 3)
              return n = o.h, n ? (r = [], (i = e.i.get(n)) && (i.Kb = new Je(), r.push(i.Kb)), r.push(n.remove()), x(o, Promise.all(r), 3)) : o.return();
            e.i.delete(n), q(o);
          });
        }
        function Nm(e) {
          var t, n, r, i, o;
          return D(function(s) {
            if (s.g == 1)
              return e.C.size ? (e.C.forEach(function(u, a) {
                _m(e, a, u);
              }), x(s, e.m, 3)) : s.A(2);
            if (s.g != 2) {
              if (t = e.g && e.g.keyIds || /* @__PURE__ */ new Set([]), t.size > 0 && sA(e)) return s.return(e.m);
              e.K = !1, e.m = new Je(), e.m.catch(function() {
              });
            }
            for (n = (e.g ? e.g.initData : []) || [], r = m(n), i = r.next(); !i.done; i = r.next()) o = i.value, su(e, o.initDataType, o.initData);
            return au(e) && e.m.resolve(), s.return(e.m);
          });
        }
        function su(e, t, n) {
          if (n.length) {
            try {
              n = e.h.initDataTransform(n, t, e.g);
            } catch (s) {
              t = s, s instanceof b || (t = new b(2, 6, 6016, s)), e.u(t);
              return;
            }
            if (e.h.ignoreDuplicateInitData) {
              var r = e.i.values();
              r = m(r);
              for (var i = r.next(); !i.done; i = r.next()) if (Ur(n, i.value.initData)) return;
              var o = !1;
              if (e.C.forEach(function(s) {
                !o && Ur(n, s.initData) && (o = !0);
              }), o) return;
            }
            e.K = !0, e.i.size > 0 && au(e) && (e.m.resolve(), e.K = !1, e.m = new Je(), e.m.catch(function() {
            })), tA(e, t, n, e.g.sessionType);
          }
        }
        function Om(e) {
          return e = e.i.keys(), e = Xd(e, function(t) {
            return t.sessionId;
          }), Array.from(e);
        }
        f.Gg = function() {
          var e = this, t = this.i.keys();
          return t = Xd(t, function(n) {
            var r = e.i.get(n);
            return { sessionId: n.sessionId, sessionType: r.type, initData: r.initData, initDataType: r.initDataType };
          }), Array.from(t);
        }, f.Zd = function() {
          var e = 1 / 0, t = this.i.keys();
          t = m(t);
          for (var n = t.next(); !n.done; n = t.next()) n = n.value, isNaN(n.expiration) || (e = Math.min(e, n.expiration));
          return e;
        };
        function Zx(e) {
          return e.J ? e.J : NaN;
        }
        f.Ze = function() {
          return qd(this.ma);
        };
        function jm(e, t) {
          var n, r, i, o, s, u, a;
          return D(function(l) {
            switch (l.g) {
              case 1:
                if (n = /* @__PURE__ */ new Map(), r = eA(e, t, n), !r)
                  throw navigator.requestMediaKeySystemAccess ? new b(2, 6, 6001) : new b(2, 6, 6020);
                nt(e.j), de(l, 2), r.getConfiguration();
                var c = i = e.h.keySystemsMapping[r.keySystem] || r.keySystem, d = n.get(i), h = [], p = [], g = [], w = [], T = [], E = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set();
                aA(d, h, p, w, g, T, E, A);
                var I = e.R ? "persistent-license" : "temporary";
                for (c = {
                  keySystem: c,
                  encryptionScheme: h[0],
                  licenseServerUri: p[0],
                  distinctiveIdentifierRequired: d[0].distinctiveIdentifierRequired,
                  persistentStateRequired: d[0].persistentStateRequired,
                  sessionType: d[0].sessionType || I,
                  audioRobustness: d[0].audioRobustness || "",
                  videoRobustness: d[0].videoRobustness || "",
                  serverCertificate: w[0],
                  serverCertificateUri: g[0],
                  initData: T,
                  keyIds: E,
                  mediaTypes: d[0].mediaTypes
                }, A.size > 0 && (c.keySystemUris = A), d = m(d), A = d.next(); !A.done; A = d.next()) A = A.value, A.distinctiveIdentifierRequired && (c.distinctiveIdentifierRequired = A.distinctiveIdentifierRequired), A.persistentStateRequired && (c.persistentStateRequired = A.persistentStateRequired);
                if (e.g = c, !e.g.licenseServerUri) throw new b(2, 6, 6012, e.g.keySystem);
                return x(l, r.createMediaKeys(), 4);
              case 4:
                if (o = l.h, nt(e.j), e.B = o, !(e.h.minHdcpVersion != "" && "getStatusForPolicy" in e.B)) {
                  l.A(5);
                  break;
                }
                return de(l, 6), x(l, e.B.getStatusForPolicy({ minHdcpVersion: e.h.minHdcpVersion }), 8);
              case 8:
                if (s = l.h, s != "usable") throw new b(2, 6, 6018);
                nt(e.j), ye(l, 5, 2);
                break;
              case 6:
                throw u = he(l, 2), u instanceof b ? u : new b(2, 6, 6019, u.message);
              case 5:
                return e.T = !0, e.G.Ea(e.h.updateExpirationTime), x(l, Jx(e), 9);
              case 9:
                nt(e.j), ye(l, 0);
                break;
              case 2:
                throw a = he(l), nt(e.j, a), e.g = null, a instanceof b ? a : new b(2, 6, 6002, a.message);
            }
          });
        }
        function eA(e, t, n) {
          for (var r = m(t), i = r.next(); !i.done; i = r.next()) {
            i = m(Vm(i.value));
            for (var o = i.next(); !o.done; o = i.next()) o = o.value, n.has(o.keySystem) || n.set(o.keySystem, []), n.get(o.keySystem).push(o);
          }
          if (n.size == 1 && n.has("")) throw new b(2, 6, 6e3);
          r = e.h.preferredKeySystems, r.length || (i = Go(e.h.servers), i.size == 1 && (r = Array.from(i.keys()))), i = m(r);
          var s = i.next();
          for (o = {}; !s.done; o = { Gi: void 0 }, s = i.next()) {
            o.Gi = s.value, s = m(t);
            for (var u = s.next(); !u.done; u = s.next()) if (u = u.value.decodingInfos.find(/* @__PURE__ */ (function(d) {
              return function(h) {
                return h.supported && h.keySystemAccess != null && h.keySystemAccess.keySystem == d.Gi;
              };
            })(o))) return u.keySystemAccess;
          }
          for (i = m([!0, !1]), o = i.next(); !o.done; o = i.next()) for (o = o.value, s = m(t), u = s.next(); !u.done; u = s.next()) {
            u = m(u.value.decodingInfos);
            for (var a = u.next(); !a.done; a = u.next()) if (a = a.value, a.supported && a.keySystemAccess) {
              var l = a.keySystemAccess.keySystem;
              if (!r.includes(l)) {
                var c = n.get(l);
                for (!c && e.h.keySystemsMapping[l] && (c = n.get(e.h.keySystemsMapping[l])), l = m(c), c = l.next(); !c.done; c = l.next()) if (!!c.value.licenseServerUri == o) return a.keySystemAccess;
              }
            }
          }
          return null;
        }
        function $d(e) {
          au(e) && e.m.resolve();
        }
        function Um(e, t) {
          new Ae(function() {
            t.loaded = !0, $d(e);
          }).ka(dA);
        }
        function _m(e, t, n) {
          var r, i, o, s, u, a, l;
          return D(function(c) {
            switch (c.g) {
              case 1:
                try {
                  r = e.B.createSession("persistent-license");
                } catch (d) {
                  return i = new b(2, 6, 6005, d.message), e.u(i), c.return(Promise.reject(i));
                }
                return e.o.D(r, "message", function(d) {
                  Jd(e) ? e.N.push(d) : Qd(e, d);
                }), e.o.D(r, "keystatuseschange", function(d) {
                  return Bm(e, d);
                }), o = { initData: n.initData, initDataType: n.initDataType, loaded: !1, Vg: 1 / 0, Kb: null, type: "persistent-license" }, e.i.set(r, o), de(c, 2), x(c, r.load(t), 4);
              case 4:
                return s = c.h, nt(e.j), s || (e.i.delete(r), u = e.h.persistentSessionOnlinePlayback ? 1 : 2, e.u(new b(u, 6, 6013)), o.loaded = !0), Um(e, o), $d(e), c.return(r);
              case 2:
                a = he(c), nt(e.j, a), e.i.delete(r), l = e.h.persistentSessionOnlinePlayback ? 1 : 2, e.u(new b(l, 6, 6005, a.message)), o.loaded = !0, $d(e);
              case 3:
                return c.return(Promise.resolve());
            }
          });
        }
        function tA(e, t, n, r) {
          try {
            var i = e.B.createSession(r);
          } catch (o) {
            e.u(new b(2, 6, 6005, o.message));
            return;
          }
          e.o.D(i, "message", function(o) {
            Jd(e) ? e.N.push(o) : Qd(e, o);
          }), e.o.D(i, "keystatuseschange", function(o) {
            return Bm(e, o);
          }), e.i.set(i, { initData: n, initDataType: t, loaded: !1, Vg: 1 / 0, Kb: null, type: r }), e.h.logLicenseExchange && _r(n), i.generateRequest(t, n).catch(function(o) {
            if (!e.j.g) {
              e.i.delete(i);
              var s = o.errorCode;
              if (s && s.systemCode) {
                var u = s.systemCode;
                u < 0 && (u += 4294967296), u = "0x" + u.toString(16);
              }
              e.u(new b(
                2,
                6,
                6006,
                o.message,
                o,
                u
              ));
            }
          });
        }
        function Jd(e) {
          return e.l ? e.h.delayLicenseRequestUntilPlayed && e.l.paused && !e.oa : !e.$ && e.h.delayLicenseRequestUntilPlayed;
        }
        function nA(e) {
          return D(function(t) {
            return t.g == 1 ? !e.K || Jd(e) ? t.A(0) : x(t, e.m, 3) : x(t, Promise.all(e.X.map(function(n) {
              return n.promise;
            })), 0);
          });
        }
        function Qd(e, t) {
          var n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E;
          D(function(A) {
            switch (A.g) {
              case 1:
                if (n = t.target, e.h.logLicenseExchange && _r(t.message), r = e.i.get(n), i = e.g.licenseServerUri, o = e.h.advanced[e.g.keySystem], t.messageType == "individualization-request" && o && o.individualizationServer && (i = o.individualizationServer), s = At([i], e.h.retryParameters), s.body = t.message, s.method = "POST", s.licenseRequestType = t.messageType, s.sessionId = n.sessionId, s.drmInfo = e.g, r && (s.initData = r.initData, s.initDataType = r.initDataType), o && o.headers) for (u in o.headers) s.headers[u] = o.headers[u];
                if (Td(e.g.keySystem)) {
                  var I = s, P = e.g;
                  try {
                    var N = Mr(I.body);
                    if (N) {
                      var M = JSON.parse(N);
                      M.type || (M.type = P.sessionType, I.body = sr(JSON.stringify(M)));
                    }
                  } catch {
                  }
                }
                if (xa(e.g.keySystem)) if (I = fi(s.body, !0, !0), I.includes("PlayReadyKeyMessage")) {
                  for (I = qi(I, "PlayReadyKeyMessage"), P = wr(I, "HttpHeader"), P = m(P), N = P.next(); !N.done; N = P.next()) M = N.value, N = wr(M, "name")[0], M = wr(M, "value")[0], s.headers[wt(N)] = wt(M);
                  I = wr(I, "Challenge")[0], s.body = Wn(wt(I));
                } else s.headers["Content-Type"] = "text/xml; charset=utf-8";
                return a = Date.now(), de(A, 2), c = e.F.wc.request(2, s, { isPreload: e.W() }), e.X.push(c), x(A, c.promise, 4);
              case 4:
                l = A.h, Gn(e.X, c), ye(A, 3);
                break;
              case 2:
                return d = he(A), e.j.g || (h = { sessionId: n.sessionId, sessionType: r.type, initData: r.initData, initDataType: r.initDataType }, p = new b(2, 6, 6007, d, h), e.i.size == 1 ? (e.u(p), r && r.Kb && r.Kb.reject(p)) : (r && r.Kb && r.Kb.reject(p), e.i.delete(n), au(e) && (e.m.resolve(), e.M.ka(0.1)))), A.return();
              case 3:
                return e.j.g ? A.return() : (e.J += (Date.now() - a) / 1e3, e.h.logLicenseExchange && _r(l.data), de(A, 5), x(A, n.update(l.data), 7));
              case 7:
                ye(A, 6);
                break;
              case 5:
                return w = (g = he(A)) && g.message || String(g), T = new b(2, 6, 6008, w), e.u(T), r && r.Kb && r.Kb.reject(T), A.return();
              case 6:
                if (e.j.g) return A.return();
                E = new ee("drmsessionupdate"), e.F.onEvent(E), r && (r.Kb && r.Kb.resolve(), Um(e, r)), q(A);
            }
          });
        }
        function Bm(e, t) {
          t = t.target;
          var n = e.i.get(t), r = !1;
          t.keyStatuses.forEach(function(o, s) {
            if (typeof s == "string") {
              var u = s;
              s = o, o = u;
            }
            if (u = Se(), xa(e.g.keySystem) && s.byteLength == 16 && u.Cf()) {
              u = dn(s);
              var a = u.getUint32(0, !0), l = u.getUint16(4, !0), c = u.getUint16(6, !0);
              u.setUint32(0, a, !1), u.setUint16(4, l, !1), u.setUint16(6, c, !1);
            }
            o != "status-pending" && (n.loaded = !0), o == "expired" && (r = !0), s = hi(s).slice(0, 32), e.ba.set(s, o);
          });
          var i = t.expiration - Date.now();
          (i < 0 || r && i < 1e3) && n && !n.Kb && (e.i.delete(t), Fm(t)), au(e) && (e.m.resolve(), e.M.ka(fA));
        }
        function rA(e) {
          var t = e.ba, n = e.ma;
          n.clear(), t.forEach(function(r, i) {
            return n.set(i, r);
          }), t = Array.from(n.values()), t.length && t.every(function(r) {
            return r == "expired";
          }) && e.u(new b(2, 6, 6014)), e.F.xf(qd(n));
        }
        function iA() {
          var e, t, n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j;
          return D(function(G) {
            if (G.g == 1) {
              if (e = "org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" "), !(C.MediaKeys && C.navigator && C.navigator.requestMediaKeySystemAccess && C.MediaKeySystemAccess && C.MediaKeySystemAccess.prototype.getConfiguration)) {
                for (t = {}, n = m(e), r = n.next(); !r.done; r = n.next()) i = r.value, t[i] = null;
                return G.return(t);
              }
              for (o = "1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" "), s = ["SW_SECURE_CRYPTO", "SW_SECURE_DECODE", "HW_SECURE_CRYPTO", "HW_SECURE_DECODE", "HW_SECURE_ALL"], u = ["150", "2000", "3000"], a = { "com.widevine.alpha": s, "com.widevine.alpha.experiment": s, "com.microsoft.playready.recommendation": u }, l = [{ contentType: 'video/mp4; codecs="avc1.42E01E"' }, { contentType: 'video/webm; codecs="vp8"' }], c = [{ contentType: 'audio/mp4; codecs="mp4a.40.2"' }, { contentType: 'audio/webm; codecs="opus"' }], d = { videoCapabilities: l, audioCapabilities: c, initDataTypes: ["cenc", "sinf", "skd", "keyids"] }, h = [null, "cenc", "cbcs"], p = /* @__PURE__ */ new Map(), g = Se(), w = function(H, B, F) {
                var W, z, me, Q, Be, ve, ze, Ce, Ee, Le, _e, be, Ie;
                return D(function(ke) {
                  switch (ke.g) {
                    case 1:
                      return de(ke, 2), x(ke, B.createMediaKeys(), 5);
                    case 5:
                      W = ke.h;
                    case 4:
                      ye(ke, 3);
                      break;
                    case 2:
                      return he(ke), ke.return();
                    case 3:
                      if (me = (z = B.getConfiguration().sessionTypes) ? z.includes("persistent-license") : !1, g.zi() && (me = !1), Q = B.getConfiguration().videoCapabilities, Be = B.getConfiguration().audioCapabilities, ve = { persistentState: me, encryptionSchemes: [], videoRobustnessLevels: [], audioRobustnessLevels: [], minHdcpVersions: [] }, p.get(H) ? ve = p.get(H) : p.set(H, ve), (ze = Q[0].encryptionScheme) && !ve.encryptionSchemes.includes(ze) && ve.encryptionSchemes.push(ze), (Ce = Q[0].robustness) && !ve.videoRobustnessLevels.includes(Ce) && ve.videoRobustnessLevels.push(Ce), (Ee = Be[0].robustness) && !ve.audioRobustnessLevels.includes(Ee) && ve.audioRobustnessLevels.push(Ee), !(F && "getStatusForPolicy" in W)) {
                        ke.A(0);
                        break;
                      }
                      Le = m(o), _e = Le.next();
                    case 7:
                      if (_e.done) {
                        ke.A(0);
                        break;
                      }
                      if (be = _e.value, ve.minHdcpVersions.includes(be)) {
                        ke.A(8);
                        break;
                      }
                      return x(ke, W.getStatusForPolicy({ minHdcpVersion: be }), 10);
                    case 10:
                      if (Ie = ke.h, Ie == "usable") ve.minHdcpVersions.includes(be) || ve.minHdcpVersions.push(be);
                      else {
                        ke.A(0);
                        break;
                      }
                    case 8:
                      _e = Le.next(), ke.A(7);
                  }
                });
              }, T = function(H, B, F, W, z) {
                z = z === void 0 ? !1 : z;
                var me, Q, Be, ve, ze, Ce, Ee, Le, _e, be, Ie;
                return D(function(ke) {
                  switch (ke.g) {
                    case 1:
                      for (de(
                        ke,
                        2
                      ), me = ar(d), Q = m(me.videoCapabilities), Be = Q.next(); !Be.done; Be = Q.next()) ve = Be.value, ve.encryptionScheme = B, ve.robustness = F;
                      for (ze = m(me.audioCapabilities), Ce = ze.next(); !Ce.done; Ce = ze.next()) Ee = Ce.value, Ee.encryptionScheme = B, Ee.robustness = W;
                      return Le = ar(me), Le.persistentState = "required", Le.sessionTypes = ["persistent-license"], _e = [Le, me], Ie = Se(), Ie.Oa() == "MOBILE" ? x(ke, Fa(5, navigator.requestMediaKeySystemAccess(H, _e)), 7) : x(ke, navigator.requestMediaKeySystemAccess(H, _e), 6);
                    case 6:
                      be = ke.h, ke.A(5);
                      break;
                    case 7:
                      be = ke.h;
                    case 5:
                      return x(ke, w(H, be, z), 8);
                    case 8:
                      ye(ke, 0);
                      break;
                    case 2:
                      he(ke), q(ke);
                  }
                });
              }, E = function(H) {
                return !(Se().Ha() === "WEBKIT" && Td(H));
              }, A = [], I = m(e), P = I.next(); !P.done; P = I.next()) if (N = P.value, p.set(N, null), E(N)) {
                for (M = !0, R = m(h), k = R.next(); !k.done; k = R.next()) O = k.value, A.push(T(N, O, "", "", M)), M = !1;
                for (L = m(a[N] || []), U = L.next(); !U.done; U = L.next()) j = U.value, A.push(T(N, null, j, "")), A.push(T(N, null, "", j));
              }
              return x(G, Promise.all(A), 2);
            }
            return G.return(qd(p));
          });
        }
        function Fm(e) {
          return D(function(t) {
            if (t.g == 1) return de(t, 2), x(t, Fa(cA, Promise.all([e.close().catch(function() {
            }), e.closed])), 4);
            if (t.g != 2) return ye(t, 0);
            he(t), q(t);
          });
        }
        function uu(e) {
          var t;
          return D(function(n) {
            return t = Array.from(e.i.entries()), e.i.clear(), x(n, Promise.all(t.map(function(r) {
              r = m(r);
              var i = r.next().value, o = r.next().value;
              return D(function(s) {
                if (s.g == 1) return de(s, 2), e.$ || e.C.has(i.sessionId) || o.type !== "persistent-license" || e.h.persistentSessionOnlinePlayback ? x(s, Fm(i), 5) : x(s, i.remove(), 5);
                if (s.g != 2) return ye(s, 0);
                he(s), q(s);
              });
            })), 0);
          });
        }
        function Vm(e) {
          return (e.video ? e.video.drmInfos : []).concat(e.audio ? e.audio.drmInfos : []);
        }
        function oA(e) {
          e.i.forEach(function(t, n) {
            var r = t.Vg, i = n.expiration;
            isNaN(i) && (i = 1 / 0), i != r && (e.F.onExpirationUpdated(n.sessionId, i), t.Vg = i);
          });
        }
        function au(e) {
          return e = e.i.values(), Wx(e, function(t) {
            return t.loaded;
          });
        }
        function sA(e) {
          for (var t = m(e.g && e.g.keyIds || /* @__PURE__ */ new Set([])), n = t.next(); !n.done; n = t.next()) if (e.ba.get(n.value) !== "usable") return !1;
          return !0;
        }
        function uA(e, t) {
          var n = [];
          for (t.forEach(function(r, i) {
            n.push({ keySystem: i, licenseServerUri: r, distinctiveIdentifierRequired: !1, persistentStateRequired: !1, audioRobustness: "", videoRobustness: "", serverCertificate: null, serverCertificateUri: "", initData: [], keyIds: /* @__PURE__ */ new Set() });
          }), e = m(e), t = e.next(); !t.done; t = e.next()) t = t.value, t.video && (t.video.drmInfos = n), t.audio && (t.audio.drmInfos = n);
        }
        function aA(e, t, n, r, i, o, s, u) {
          var a = [];
          e = m(e);
          for (var l = e.next(), c = {}; !l.done; c = { La: void 0 }, l = e.next()) {
            if (c.La = l.value, t.includes(c.La.encryptionScheme) || t.push(c.La.encryptionScheme), c.La.keySystem == "org.w3.clearkey" && c.La.licenseServerUri.startsWith("data:application/json;base64,") ? a.includes(c.La.licenseServerUri) || a.push(c.La.licenseServerUri) : n.includes(c.La.licenseServerUri) || n.push(c.La.licenseServerUri), i.includes(c.La.serverCertificateUri) || i.push(c.La.serverCertificateUri), c.La.serverCertificate && (r.some(/* @__PURE__ */ (function(p) {
              return function(g) {
                return Ur(g, p.La.serverCertificate);
              };
            })(c)) || r.push(c.La.serverCertificate)), c.La.initData) {
              l = m(c.La.initData);
              for (var d = l.next(), h = {}; !d.done; h = { Mg: void 0 }, d = l.next()) h.Mg = d.value, o.some(/* @__PURE__ */ (function(p) {
                return function(g) {
                  var w = p.Mg;
                  return g.keyId && g.keyId == w.keyId ? !0 : g.initDataType == w.initDataType && Ur(g.initData, w.initData);
                };
              })(h)) || o.push(h.Mg);
            }
            if (c.La.keyIds) for (l = m(c.La.keyIds), d = l.next(); !d.done; d = l.next()) s.add(d.value);
            if (c.La.keySystemUris && u) for (c = m(c.La.keySystemUris), l = c.next(); !l.done; l = c.next()) u.add(l.value);
          }
          if (a.length == 1) n.push(a[0]);
          else if (a.length > 0) {
            for (t = [], a = m(a), r = a.next(); !r.done; r = a.next()) r = C.atob(r.value.split("data:application/json;base64,").pop()), r = JSON.parse(r), t.push.apply(t, X(r.keys));
            a = JSON.stringify({ keys: t }), n.push("data:application/json;base64," + C.btoa(a));
          }
        }
        function lA(e, t, n, r) {
          var i = e.keySystem;
          i && (i != "org.w3.clearkey" || !e.licenseServerUri) && (t.size && t.get(i) && (t = t.get(i), e.licenseServerUri = t), e.keyIds || (e.keyIds = /* @__PURE__ */ new Set()), (n = n.get(i)) && (e.distinctiveIdentifierRequired || (e.distinctiveIdentifierRequired = n.distinctiveIdentifierRequired), e.persistentStateRequired || (e.persistentStateRequired = n.persistentStateRequired), e.serverCertificate || (e.serverCertificate = n.serverCertificate), n.sessionType && (e.sessionType = n.sessionType), e.serverCertificateUri || (e.serverCertificateUri = n.serverCertificateUri)), r[i] && (e.keySystem = r[i]), C.cast && C.cast.__platform__ && i == "com.microsoft.playready" && (e.keySystem = "com.chromecast.playready"));
        }
        function Hm(e, t) {
          if (e = Go(e), e.size != 0) {
            e = Lg(e), t = m(t);
            for (var n = t.next(); !n.done; n = t.next()) n = n.value, n.video && (n.video.drmInfos = [e]), n.audio && (n.audio.drmInfos = [e]);
          }
        }
        var cA = 1, dA = 5, fA = 0.5;
        function hA() {
          this.g = no, this.j = (/* @__PURE__ */ new Map()).set(no, 2).set(to, 1), this.i = 0, this.h = -1;
        }
        function Zd(e, t) {
          var n = e.g !== t;
          return e.g = t, n && t === no && (e.i = Date.now()), n;
        }
        var to = 0, no = 1;
        function ef(e, t, n) {
          this.h = e, this.i = t, this.g = n;
        }
        function Gm(e, t) {
          return D(function(n) {
            if (n.g == 1) return x(n, Dx(e.g, t, e.h.drm.preferredKeySystems, e.h.drm.keySystemsMapping), 2);
            if (e.h.streaming.dontChooseCodecs || um(t, e.h.preferredVideoCodecs, e.h.preferredAudioCodecs, e.h.preferredDecodingAttributes, e.h.preferredTextFormats), !t.variants.some(ou)) throw new b(2, 4, 4032);
            return n.return(Wm(e, t));
          });
        }
        function Km(e, t) {
          var n = e.h.restrictions;
          e = e.i;
          var r = !1;
          t = m(t.variants);
          for (var i = t.next(); !i.done; i = t.next()) {
            i = i.value;
            var o = i.allowedByApplication;
            i.allowedByApplication = Ga(i, n, e), o != i.allowedByApplication && (r = !0);
          }
          return r;
        }
        function Wm(e, t) {
          var n = Km(e, t);
          if (t) {
            var r = e.g ? e.g.g : null;
            if (r && e.g.B) {
              for (var i = /* @__PURE__ */ new Set(), o = m(t.variants), s = o.next(); !s.done; s = o.next()) s = s.value, s.audio && i.add(s.audio), s.video && i.add(s.video);
              for (i = m(i), o = i.next(); !o.done; o = i.next()) zm(e, r.keySystem, o.value);
            }
            Xm(e, t);
          }
          return n;
        }
        function zm(e, t, n) {
          n = m(n.drmInfos);
          for (var r = n.next(); !r.done; r = n.next()) if (r = r.value, r.keySystem == t) {
            for (var i = m(r.initData || []), o = i.next(); !o.done; o = i.next()) o = o.value, su(e.g, o.initDataType, o.initData);
            i = e.g, i.g && i.g.mediaTypes !== r.mediaTypes && (i.g.mediaTypes = r.mediaTypes);
          }
        }
        function Xm(e, t) {
          function n(l) {
            if (l && !u.has(l) && (u.add(l), l.keyIds.size)) {
              l = m(l.keyIds);
              for (var c = l.next(); !c.done; c = l.next()) {
                c = c.value;
                var d = r[i ? "00" : c];
                d ? qm.includes(d) && s.add(d) : o.add(c);
              }
            }
          }
          var r = e.g ? e.g.Ze() : {};
          e = Object.keys(r);
          var i = e.length && e[0] == "00";
          e = !1;
          var o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new WeakSet();
          t = m(t.variants);
          for (var a = t.next(); !a.done; a = t.next()) {
            if (a = a.value, !a.allowedByApplication) e = !0;
            else if (a.allowedByKeySystem) return;
            n(a.audio), n(a.video);
          }
          throw e = {
            hasAppRestrictions: e,
            missingKeys: Array.from(o),
            restrictedKeyStatuses: Array.from(s)
          }, new b(2, 4, 4012, e);
        }
        var qm = ["output-restricted", "internal-error"];
        Y("shaka.config.CodecSwitchingStrategy", { RELOAD: "reload", SMOOTH: "smooth" });
        function Qt(e) {
          if (tf.has(e)) return tf.get(e);
          var t = C.ManagedMediaSource || C.MediaSource;
          return t ? (t = t.isTypeSupported(e), tf.set(e, t), t) : !1;
        }
        function Ym() {
          var e = C.ManagedMediaSource || C.MediaSource;
          return e && e.prototype ? !!e.prototype.setLiveSeekableRange && !!e.prototype.clearLiveSeekableRange : !1;
        }
        var tf = /* @__PURE__ */ new Map();
        function nl(e, t) {
          var n = null, r = null, i = null, o = null, s = e.V();
          return t & 1 && (i = e.Fd()), t & 2 && (o = e.V()), t & 8 && (n = e.V()), t & 16 && (r = e.V()), { trackId: s, Wd: n, Xd: r, oj: i, Ni: o };
        }
        function rl(e, t) {
          return t == 1 ? (t = e.V(), e = e.V(), { baseMediaDecodeTime: t * 4294967296 + e }) : { baseMediaDecodeTime: e.V() };
        }
        function il(e, t) {
          return t == 1 ? (e.skip(8), e.skip(8)) : (e.skip(4), e.skip(4)), t = e.V(), e.skip(4), e = e.Ca(), { timescale: t, language: String.fromCharCode((e >> 10) + 96) + String.fromCharCode(((e & 960) >> 5) + 96) + String.fromCharCode((e & 31) + 96) };
        }
        function ol(e, t, n) {
          var r = e.V(), i = [], o = null;
          n & 1 && (o = e.$g()), n & 4 && e.skip(4);
          for (var s = 0; s < r; s++) {
            var u = { kh: null, sampleSize: null, Df: null };
            n & 256 && (u.kh = e.V()), n & 512 && (u.sampleSize = e.V()), n & 1024 && e.skip(4), n & 2048 && (u.Df = t == 0 ? e.V() : e.$g()), i.push(u);
          }
          return { Fm: r, jh: i, mg: o };
        }
        function $m(e) {
          e.skip(6), e.skip(2), e.skip(8);
          var t = e.Ca();
          return e.skip(2), e.skip(2), e.skip(2), e = e.Ca() + e.Ca() / 65536, { channelCount: t, sampleRate: e };
        }
        function nf(e) {
          return e = e.V(), { codec: Za(e) };
        }
        function pA(e) {
          var t = null, n = null, r = e.Tb(4, !1), i = String.fromCharCode(r[0]);
          if (i += String.fromCharCode(r[1]), i += String.fromCharCode(r[2]), i += String.fromCharCode(r[3]), i === "nclx") {
            switch (e.Ca()) {
              case 1:
              case 5:
              case 6:
              case 7:
                t = "srgb";
                break;
              case 9:
                t = "rec2020";
                break;
              case 11:
              case 12:
                t = "p3";
            }
            switch (r = e.Ca(), e.Ca(), r) {
              case 1:
              case 6:
              case 13:
              case 14:
              case 15:
                n = "SDR";
                break;
              case 16:
                n = "PQ";
                break;
              case 18:
                n = "HLG";
            }
          }
          return { colorGamut: t, ye: n };
        }
        function lu(e, t) {
          return t = t === void 0 ? !1 : t, e = e.toString(16).toUpperCase(), t ? e : ("0" + e).slice(-2);
        }
        function En(e) {
          return (e < 10 ? "0" : "") + e;
        }
        function Wo(e) {
          this.g = e = e === void 0 ? [] : e;
        }
        function zo(e) {
          if (e.g.length === 0) throw Error("StreamInfos must have elements");
          for (var t = [], n = m(e.g), r = n.next(); !r.done; r = n.next()) {
            var i = t, o = i.push, s = r.value;
            r = Re;
            var u = s.id + 1, a = s.stream.width || 0, l = s.stream.height || 0;
            s.type == "audio" && (l = a = 0);
            var c = s.duration * s.timescale, d = Math.floor(c / (xi + 1));
            switch (c = Math.floor(c % (xi + 1)), u = new Uint8Array([1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3].concat(X(ft(u, 4)), [0, 0, 0, 0], X(ft(d, 4)), X(ft(c, 4)), [
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              1,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              1,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              64,
              0,
              0,
              0
            ], X(ft(a, 2)), [0, 0], X(ft(l, 2)), [0, 0])), u = Re("tkhd", u), a = Re, d = s.duration * s.timescale, l = Math.floor(d / (xi + 1)), d = Math.floor(d % (xi + 1)), c = s.stream.language, c = c.charCodeAt(0) - 96 << 10 | c.charCodeAt(1) - 96 << 5 | c.charCodeAt(2) - 96, l = new Uint8Array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3].concat(X(ft(s.timescale, 4)), X(ft(l, 4)), X(ft(d, 4)), X(ft(c, 2)), [0, 0])), l = Re("mdhd", l), d = s, c = new Uint8Array([]), d.type) {
              case "video":
                c = mA.value();
                break;
              case "audio":
                c = vA.value();
            }
            d = Re(
              "hdlr",
              c
            );
            e: {
              switch (s.type) {
                case "video":
                  s = Re("minf", Re("vmhd", xA.value()), rv.value(), Jm(s));
                  break e;
                case "audio":
                  s = Re("minf", Re("smhd", AA.value()), rv.value(), Jm(s));
                  break e;
              }
              s = new Uint8Array([]);
            }
            s = a("mdia", l, d, s), r = r("trak", u, s), o.call(i, r);
          }
          for (t = St.apply(Gt, X(t)), n = e.g[0], i = Re, r = n.duration * n.timescale, o = Math.floor(r / (xi + 1)), r = Math.floor(r % (xi + 1)), o = new Uint8Array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3].concat(X(ft(n.timescale, 4)), X(ft(o, 4)), X(ft(r, 4)), [
            0,
            1,
            0,
            0,
            1,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            1,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            1,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            64,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            255,
            255,
            255,
            255
          ])), o = Re("mvhd", o), r = [], e = m(e.g), a = e.next(); !a.done; a = e.next()) s = r, u = s.push, a = new Uint8Array([0, 0, 0, 0].concat(X(ft(a.value.id + 1, 4)), [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])), a = Re("trex", a), u.call(s, a);
          return e = St.apply(Gt, X(r)), e = Re("mvex", e), e = i("moov", o, t, e, Zm(n.stream)), t = IA.value(), n = new Uint8Array(t.byteLength + e.byteLength), n.set(t), n.set(e, t.byteLength), n;
        }
        function Jm(e) {
          var t = Re, n = "aac";
          e.codecs.includes("mp3") ? n = "mp3" : e.codecs.includes("ac-3") ? n = Se().re() ? "ec-3" : "ac-3" : e.codecs.includes("ec-3") ? n = "ec-3" : e.codecs.includes("opus") && (n = "opus");
          var r = new Uint8Array([]);
          switch (e.type) {
            case "video":
              if (e.codecs.includes("avc1")) {
                if (n = e.stream.width || 0, r = e.stream.height || 0, e.Sa.byteLength > 0) var i = Re("avcC", e.Sa);
                else {
                  i = Re;
                  for (var o = 7, s = [], u = [], a = 0, l = 0, c = 0, d = 0; d < e.Db.length; d++) {
                    var h = ev(e.Db[d]);
                    switch (h[0] & 31) {
                      case 7:
                        s.push(h), o += h.length + 2;
                        break;
                      case 8:
                        u.push(h), o += h.length + 2;
                    }
                  }
                  for (s.length > 0 && (a = s[0][1], c = s[0][2], l = s[0][3]), o = new Uint8Array(o), d = 0, o[d++] = 1, o[d++] = a, o[d++] = c, o[d++] = l, o[d++] = 255, o[d++] = 224 | s.length, a = 0; a < s.length; a++) o[d++] = (s[a].length & 65280) >> 8, o[d++] = s[a].length & 255, o.set(s[a], d), d += s[a].length;
                  for (o[d++] = u.length, s = 0; s < u.length; s++) o[d++] = (u[s].length & 65280) >> 8, o[d++] = u[s].length & 255, o.set(u[s], d), d += u[s].length;
                  i = i("avcC", o);
                }
                n = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].concat(X(ft(n, 2)), X(ft(r, 2)), [
                  0,
                  72,
                  0,
                  0,
                  0,
                  72,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  1,
                  19,
                  118,
                  105,
                  100,
                  101,
                  111,
                  106,
                  115,
                  45,
                  99,
                  111,
                  110,
                  116,
                  114,
                  105,
                  98,
                  45,
                  104,
                  108,
                  115,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  24,
                  17,
                  17
                ])), r = "avc1", u = Qm(e), s = new Uint8Array([]), io(e.stream) && (s = ro(e.stream, e.codecs), r = "encv"), r = Re(r, n, i, u, s);
              } else e.codecs.includes("hvc1") && (r = e.stream.width || 0, i = e.stream.height || 0, n = new Uint8Array([]), e.Sa.byteLength > 0 && (n = Re("hvcC", e.Sa)), r = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].concat(X(ft(r, 2)), X(ft(i, 2)), [
                0,
                72,
                0,
                0,
                0,
                72,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                19,
                118,
                105,
                100,
                101,
                111,
                106,
                115,
                45,
                99,
                111,
                110,
                116,
                114,
                105,
                98,
                45,
                104,
                108,
                115,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                24,
                17,
                17
              ])), i = "hvc1", u = Qm(e), s = new Uint8Array([]), io(e.stream) && (s = ro(e.stream, e.codecs), i = "encv"), r = Re(i, r, n, u, s));
              break;
            case "audio":
              n == "mp3" ? e = Re(".mp3", cu(e)) : n == "ac-3" ? (n = Re("dac3", e.Ga), r = "ac-3", i = new Uint8Array([]), io(e.stream) && (i = ro(e.stream, e.codecs), r = "enca"), e = Re(r, cu(e), n, i)) : n == "ec-3" ? (n = Re("dec3", e.Ga), r = "ec-3", i = new Uint8Array([]), io(e.stream) && (i = ro(e.stream, e.codecs), r = "enca"), e = Re(r, cu(e), n, i)) : n == "opus" ? (n = Re("dOps", e.Ga), r = "Opus", i = new Uint8Array([]), io(e.stream) && (i = ro(e.stream, e.codecs), r = "enca"), e = Re(r, cu(e), n, i)) : (e.Ga.byteLength > 0 ? n = Re("esds", e.Ga) : (n = Re, r = e.id + 1, i = e.stream.channelsCount || 2, s = e.stream.audioSamplingRate || 44100, a = Do("audio", e.codecs.split(",")), l = { 96e3: 0, 88200: 1, 64e3: 2, 48e3: 3, 44100: 4, 32e3: 5, 24e3: 6, 22050: 7, 16e3: 8, 12e3: 9, 11025: 10, 8e3: 11, 7350: 12 }, u = l[s], (a === "mp4a.40.5" || a === "mp4a.40.29") && (u = l[s * 2]), s = parseInt(a.split(".").pop(), 10), r = new Uint8Array([0, 0, 0, 0, 3, 25].concat(X(ft(r, 2)), [0, 4, 17, 64, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 2, s << 3 | u >>> 1, u << 7 | i << 3, 6, 1, 2])), n = n("esds", r)), r = "mp4a", i = new Uint8Array([]), io(e.stream) && (i = ro(e.stream, e.codecs), r = "enca"), e = Re(r, cu(e), n, i)), r = e;
          }
          return e = Re("stsd", EA.value(), r), t("stbl", e, Re("stts", yA.value()), Re("stsc", wA.value()), Re("stsz", SA.value()), Re("stco", TA.value()));
        }
        function Qm(e) {
          if (!e.Za && !e.$a) return new Uint8Array([]);
          var t = e.$a;
          return e = new Uint8Array([].concat(X(ft(e.Za, 4)), X(ft(t, 4)))), Re("pasp", e);
        }
        function cu(e) {
          return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, e.stream.channelsCount || 2, 0, 16, 0, 0, 0, 0].concat(X(ft(e.stream.audioSamplingRate || 44100, 2)), [0, 0]));
        }
        function Zm(e) {
          var t = [];
          if (!io(e)) return new Uint8Array([]);
          e = m(e.drmInfos);
          for (var n = e.next(); !n.done; n = e.next()) if (n = n.value, n.initData) {
            n = m(n.initData);
            for (var r = n.next(); !r.done; r = n.next()) t.push(r.value.initData);
          }
          return St.apply(Gt, X(t));
        }
        function ro(e, t) {
          var n = Re;
          t = new Uint8Array([].concat(X(ft(tv(t.split(".")[0]), 4)))), t = Re("frma", t);
          var r = "cenc", i = e.drmInfos[0];
          i && i.encryptionScheme && (r = i.encryptionScheme), r = new Uint8Array([0, 0, 0, 0].concat(X(ft(tv(r), 4)), [0, 1, 0, 0])), r = Re("schm", r), i = Re;
          var o = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
          e = m(e.drmInfos);
          for (var s = e.next(); !s.done; s = e.next()) if ((s = s.value) && s.keyIds && s.keyIds.size) {
            s = m(s.keyIds);
            for (var u = s.next(); !u.done; u = s.next()) o = ev(u.value);
          }
          return e = new Uint8Array([
            0,
            0,
            0,
            0,
            0,
            0,
            1,
            8
          ]), o = Re("tenc", e, o), n("sinf", t, r, i("schi", o));
        }
        function du(e) {
          var t = [];
          e = m(e.g);
          for (var n = e.next(); !n.done; n = e.next()) {
            n = n.value;
            var r = t.push, i = r.apply, o = Re, s = new Uint8Array([0, 0, 0, 0].concat(X(ft(n.data ? n.data.sequenceNumber : 0, 4))));
            s = Re("mfhd", s);
            var u, a = n.data ? n.data.zb : [], l = new Uint8Array(4 + a.length);
            for (u = 0; u < a.length; u++) {
              var c = a[u].flags;
              l[u + 4] = c.ib << 4 | c.mb << 2 | c.jb;
            }
            a = Re("sdtp", l);
            var d = a.length + 32 + 20 + 8 + 16 + 8 + 8;
            l = Re, u = new Uint8Array([0, 0, 0, 58].concat(X(ft(n.id + 1, 4)), [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])), u = Re("tfhd", u), c = n.data ? n.data.baseMediaDecodeTime : 0;
            var h = Math.floor(c % (xi + 1));
            c = new Uint8Array([1, 0, 0, 0].concat(X(ft(Math.floor(c / (xi + 1)), 4)), X(ft(h, 4)))), c = Re("tfdt", c);
            var p = d;
            d = n.data ? n.data.zb : [], h = d.length;
            var g = 12 + 16 * h, w = new Uint8Array(g);
            for (p += 8 + g, w.set([n.type === "video" ? 1 : 0, 0, 15, 1].concat(X(ft(h, 4)), X(ft(p, 4))), 0), p = 0; p < h; p++) {
              var T = d[p];
              g = ft(T.duration, 4);
              var E = ft(T.size, 4), A = T.flags;
              T = ft(T.sb, 4), w.set([].concat(X(g), X(E), [A.xb << 2 | A.ib, A.mb << 6 | A.jb << 4 | A.yb, A.hb & 61440, A.hb & 15], X(T)), 12 + 16 * p);
            }
            d = Re("trun", w), a = l("traf", u, c, d, a), o = o("moof", s, a), i.call(r, t, [o, gA(n)]);
          }
          return St.apply(Gt, X(t));
        }
        function gA(e) {
          return e = (e.data ? e.data.zb : []).map(function(t) {
            return t.data;
          }), e = St.apply(Gt, X(e)), Re("mdat", e);
        }
        function ft(e, t) {
          var n = [];
          for (--t; t >= 0; t--) n.push(e >> 8 * t & 255);
          return n;
        }
        function ev(e) {
          for (var t = new Uint8Array(e.length / 2), n = 0; n < e.length / 2; n += 1) t[n] = parseInt(String(e[n * 2] + e[n * 2 + 1]), 16);
          return t;
        }
        function tv(e) {
          for (var t = 0, n = 0; n < e.length; n += 1) t |= e.charCodeAt(n) << (e.length - n - 1) * 8;
          return t;
        }
        function Re(e) {
          var t = $e.apply(1, arguments), n = nv.get(e);
          n || (n = [e.charCodeAt(0), e.charCodeAt(1), e.charCodeAt(2), e.charCodeAt(3)], nv.set(e, n));
          for (var r = 8, i = t.length - 1; i >= 0; i--) r += t[i].byteLength;
          for (i = new Uint8Array(r), i[0] = r >> 24 & 255, i[1] = r >> 16 & 255, i[2] = r >> 8 & 255, i[3] = r & 255, i.set(n, 4), n = 0, r = 8; n < t.length; n++) i.set(t[n], r), r += t[n].byteLength;
          return i;
        }
        function io(e) {
          return e.encrypted && e.drmInfos.length > 0;
        }
        var xi = 4294967295, nv = /* @__PURE__ */ new Map(), mA = new ct(function() {
          return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114, 0]);
        }), vA = new ct(function() {
          return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0]);
        }), yA = new ct(function() {
          return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]);
        }), wA = new ct(function() {
          return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]);
        }), TA = new ct(function() {
          return new Uint8Array([
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ]);
        }), SA = new ct(function() {
          return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
        }), xA = new ct(function() {
          return new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
        }), AA = new ct(function() {
          return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]);
        }), EA = new ct(function() {
          return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]);
        }), IA = new ct(function() {
          var e = new Uint8Array([105, 115, 111, 109]), t = new Uint8Array([97, 118, 99, 49]), n = new Uint8Array([0, 0, 0, 1]);
          return Re("ftyp", e, n, e, t);
        }), rv = new ct(function() {
          var e = new Uint8Array([
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            1,
            0,
            0,
            0,
            12,
            117,
            114,
            108,
            32,
            0,
            0,
            0,
            1
          ]);
          return e = Re("dref", e), Re("dinf", e);
        });
        function MA(e) {
          e = pe(e);
          var t = null;
          return new qe().box("moov", Te).box("trak", Te).box("mdia", Te).box("minf", Te).box("stbl", Te).S("stsd", qr).box("enca", function(n) {
            return t = n.reader.h, Qa(n);
          }).box("sinf", Te).box("frma", function(n) {
            n.parser.stop(), nf(n.reader).codec === "ec-3" && t && t.getUint16(16) !== 2 && t.setUint16(16, 2);
          }).parse(e), e;
        }
        function CA(e, t, n) {
          function r(p) {
            d.push({ box: p, Ai: 1701733217 });
          }
          function i(p) {
            d.push({ box: p, Ai: 1701733238 });
          }
          function o(p) {
            a = !0, p.parser.stop();
          }
          function s(p) {
            c.push(p), Te(p);
          }
          var u = t = pe(t), a = !1, l, c = [], d = [];
          if (new qe().box("moov", s).box("trak", s).box("mdia", s).box("minf", s).box("stbl", s).S("stsd", function(p) {
            l = p, c.push(p), qr(p);
          }).S("encv", o).S("enca", o).S("dvav", i).S("dva1", i).S("dvh1", i).S("dvhe", i).S("dvc1", i).S("dvi1", i).S("hev1", i).S("hvc1", i).S("avc1", i).S("avc3", i).S("ac-3", r).S("ec-3", r).S(
            "ac-4",
            r
          ).S("Opus", r).S("fLaC", r).S("mp4a", r).parse(t), a) return t;
          if (d.length == 0 || !l) throw hi(t), new b(2, 3, 3019, n);
          d.reverse(), n = m(d);
          for (var h = n.next(); !h.done; h = n.next()) h = h.value, u = DA(e, u, l, h.box, c, h.Ai);
          return u = RA(e, u), Se().gh() ? (e = new Uint8Array(t.byteLength + u.byteLength), e.set(u), e.set(t, u.byteLength), e) : u;
        }
        function kA(e) {
          e = pe(e);
          var t = [];
          new qe().box("mdat", function(s) {
            t.push(s);
          }).parse(e);
          for (var n = [], r = 0; r < t.length; r++) {
            var i = t[r - 1], o = t[r];
            n.push(PA(e.subarray(i ? i.start + i.size : 0, o.start + o.size)));
          }
          return St.apply(Gt, X(n));
        }
        function PA(e) {
          function t(d) {
            s.push(d), Te(d);
          }
          var n, r, i, o, s = [];
          if (new qe().box("moof", t).box("traf", t).S("tfhd", function(d) {
            n = d, i = nl(d.reader, d.flags);
          }).S("trun", function(d) {
            r = d, o = ol(d.reader, d.version, d.flags);
          }).parse(e), i && i.Ni !== 2) {
            var u = n.start + Si(n) + 4 + (i.oj !== null ? 8 : 0), a = dn(e);
            if (i.Ni !== null) a.setUint32(u, 2);
            else {
              fu(e, n.start, n.size + 4);
              var l = a.getUint32(n.start + 8);
              a.setUint32(n.start + 8, l | 2), o && o.mg !== null && a.setInt32(r.start + Si(r) + 4, o.mg + 4), l = e.subarray(0, u), a = e.subarray(u), e = new Uint8Array(e.byteLength + 4), e.set(l), l = [];
              for (var c = 3; c >= 0; c--) l.push(2 >> 8 * c & 255);
              for (e.set(new Uint8Array(l), u), e.set(a, u + 4), u = m(s), a = u.next(); !a.done; a = u.next()) a = a.value, fu(e, a.start, a.size + 4);
            }
          }
          return e;
        }
        function DA(e, t, n, r, i, o) {
          var s = ro(e, r.name), u = t.subarray(r.start, r.start + r.size);
          for (e = new Uint8Array(r.size + s.byteLength), e.set(u, 0), dn(e).setUint32(4, o), e.set(s, r.size), fu(e, 0, e.byteLength), o = new Uint8Array(t.byteLength + e.byteLength), r = Se().gf() ? r.start : r.start + r.size, s = t.subarray(r), o.set(t.subarray(0, r)), o.set(e, r), o.set(s, r + e.byteLength), t = m(i), i = t.next(); !i.done; i = t.next()) i = i.value, fu(o, i.start, i.size + e.byteLength);
          return e = dn(o, n.start), n = Si(n), t = e.getUint32(n), e.setUint32(n, t + 1), o;
        }
        function RA(e, t) {
          if (e = Zm(e), e.byteLength === 0) return t;
          var n = 0, r = 0;
          new qe().box("moov", function(u) {
            n = u.start, r = u.size, u.parser.stop();
          }).parse(t);
          var i = n + r;
          fu(t, n, r + e.byteLength);
          var o = new Uint8Array(t.byteLength + e.byteLength), s = t.subarray(i);
          return o.set(t.subarray(0, i)), o.set(e, i), o.set(s, i + e.byteLength), o;
        }
        function fu(e, t, n) {
          e = dn(e, t), t = e.getUint32(0), t != 0 && (t == 1 ? (e.setUint32(8, n >> 32), e.setUint32(12, n & 4294967295)) : e.setUint32(0, n));
        }
        function LA(e) {
          function t(i) {
            r.push({ start: i.start, size: i.size }), Te(i);
          }
          var n = pe(e), r = [];
          return new qe().box("moov", t).box("trak", t).box("mdia", t).box("minf", t).box("stbl", t).box("stsd", function(i) {
            r.push({ start: i.start, size: i.size });
            for (var o = dn(n, i.start), s = 0; s < i.size - 3; s++) {
              var u = o.getUint32(s);
              u == 1633889587 ? o.setUint32(s, 1700998451) : u == 1684103987 && o.setUint32(s, 1684366131);
            }
          }).parse(n), n;
        }
        function pn(e, t, n, r, i, o, s, u) {
          this.P = e, this.startByte = t, this.endByte = n, this.xd = r === void 0 ? null : r, this.timescale = i === void 0 ? null : i, this.h = o === void 0 ? null : o, this.aesKey = s === void 0 ? null : s, this.g = this.mimeType = this.codecs = null, this.encrypted = u === void 0 ? !1 : u;
        }
        pn.prototype.Kc = function() {
          return this.startByte;
        }, pn.prototype.Ic = function() {
          return this.endByte;
        }, pn.prototype.se = function(e) {
          this.h = e;
        }, pn.prototype.ac = function() {
          return this.h;
        };
        function hu(e, t) {
          return e === t ? !0 : e && t ? e.Kc() == t.Kc() && e.Ic() == t.Ic() && di(e.P().sort(), t.P().sort()) && Ur(e.ac(), t.ac()) : e == t;
        }
        Y("shaka.media.InitSegmentReference", pn), pn.prototype.getEndByte = pn.prototype.Ic, pn.prototype.getStartByte = pn.prototype.Kc;
        function se(e, t, n, r, i, o, s, u, a, l, c, d, h, p, g, w) {
          for (l = l === void 0 ? [] : l, p = p === void 0 ? Yr : p, this.startTime = e, this.j = this.endTime = t, this.C = n, this.startByte = r, this.endByte = i, this.ea = o, this.timestampOffset = s, this.appendWindowStart = u, this.appendWindowEnd = a, this.g = l, this.tilesLayout = c === void 0 ? "" : c, this.B = d === void 0 ? null : d, this.h = h === void 0 ? null : h, this.status = p, this.preload = !1, this.l = !0, this.o = !1, this.aesKey = g === void 0 ? null : g, this.thumbnailSprite = null, this.i = -1, this.m = w === void 0 ? !1 : w, this.ie = this.Wc = !1, e = m(this.g), t = e.next(); !t.done; t = e.next()) t.value.wi();
          this.m && this.g.length && this.g[this.g.length - 1].ui(), this.u = this.bandwidth = this.mimeType = this.codecs = null, this.F = !1;
        }
        f = se.prototype, f.P = function() {
          return this.C();
        }, f.getStartTime = function() {
          return this.startTime;
        }, f.Hj = function() {
          return this.endTime;
        }, f.Kc = function() {
          return this.startByte;
        }, f.Ic = function() {
          return this.endByte;
        };
        function rf(e) {
          if (e.endByte) return e.endByte + 1 - e.startByte;
          if (e.bandwidth) {
            var t = e.bandwidth * (e.endTime - e.startTime);
            if (!isNaN(t) && t > 0) return t;
          }
          if (e.g.length > 0 && e.m) for (e = m(e.g), e = e.next(); !e.done; e = e.next()) {
            rf(e.value);
            break;
          }
          return null;
        }
        f.bk = function() {
          return this.tilesLayout;
        }, f.$j = function() {
          return this.B;
        }, f.bc = function() {
          return this.status;
        }, f.xk = function() {
          this.status = ov;
        }, f.Rg = function() {
          this.preload = !0;
        }, f.isPreload = function() {
          return this.preload;
        }, f.wd = function() {
          this.l = !1;
        }, f.lk = function() {
          return this.l;
        }, f.wi = function() {
          this.Wc = !0;
        }, f.pk = function() {
          return this.Wc;
        }, f.ui = function() {
          this.ie = !0;
        }, f.nk = function() {
          return this.ie;
        }, f.ti = function() {
          this.o = !0;
        }, f.hk = function() {
          return this.o;
        }, f.Jf = function(e) {
          this.thumbnailSprite = e;
        }, f.Yj = function() {
          return this.thumbnailSprite;
        }, f.offset = function(e) {
          this.startTime += e, this.endTime += e, this.j += e;
          for (var t = m(this.g), n = t.next(); !n.done; n = t.next()) n = n.value, n.startTime += e, n.endTime += e, n.j += e;
        }, f.Ah = function(e) {
          this.h == null ? Ir("Sync attempted without sync time!") : (e = this.h - e - this.startTime, Math.abs(e) >= 1e-3 && this.offset(e));
        }, f.se = function(e, t) {
          this.u = e, this.F = t === void 0 ? !1 : t;
        }, f.ac = function(e) {
          var t = this.u;
          return (e === void 0 || e) && this.F && (this.u = null), t;
        };
        function iv(e, t) {
          e.ea = t, e = m(e.g);
          for (var n = e.next(); !n.done; n = e.next()) iv(n.value, t);
        }
        Y("shaka.media.SegmentReference", se), se.prototype.getSegmentData = se.prototype.ac, se.prototype.setSegmentData = se.prototype.se, se.prototype.syncAgainst = se.prototype.Ah, se.prototype.offset = se.prototype.offset, se.prototype.getThumbnailSprite = se.prototype.Yj, se.prototype.setThumbnailSprite = se.prototype.Jf, se.prototype.hasByterangeOptimization = se.prototype.hk, se.prototype.markAsByterangeOptimization = se.prototype.ti, se.prototype.isLastPartial = se.prototype.nk, se.prototype.markAsLastPartial = se.prototype.ui, se.prototype.isPartial = se.prototype.pk, se.prototype.markAsPartial = se.prototype.wi, se.prototype.isIndependent = se.prototype.lk, se.prototype.markAsNonIndependent = se.prototype.wd, se.prototype.isPreload = se.prototype.isPreload, se.prototype.markAsPreload = se.prototype.Rg, se.prototype.markAsUnavailable = se.prototype.xk, se.prototype.getStatus = se.prototype.bc, se.prototype.getTileDuration = se.prototype.$j, se.prototype.getTilesLayout = se.prototype.bk, se.prototype.getEndByte = se.prototype.Ic, se.prototype.getStartByte = se.prototype.Kc, se.prototype.getEndTime = se.prototype.Hj, se.prototype.getStartTime = se.prototype.getStartTime, se.prototype.getUris = se.prototype.P;
        var Yr = 0, ov = 1;
        se.Status = { rl: Yr, ym: ov, Ul: 2 };
        function pu(e) {
          return e.length == 1 && e.end(0) - e.start(0) < 1e-4;
        }
        function sv(e) {
          return !e || pu(e) ? null : e.length == 1 && e.start(0) < 0 ? 0 : e.length ? e.start(0) : null;
        }
        function sl(e) {
          return !e || pu(e) ? null : e.length ? e.end(e.length - 1) : null;
        }
        function of(e, t) {
          return !e || !e.length || pu(e) || t > e.end(e.length - 1) ? !1 : t >= e.start(0);
        }
        function uv(e, t) {
          if (!e || !e.length || pu(e)) return 0;
          var n = 0;
          e = m($r(e));
          for (var r = e.next(); !r.done; r = e.next()) {
            var i = r.value;
            r = i.start, i = i.end, i > t && (n += i - Math.max(r, t));
          }
          return n;
        }
        function bA(e, t, n) {
          return !e || !e.length || pu(e) ? null : (e = $r(e).findIndex(function(r, i, o) {
            return r.start > t && (i == 0 || o[i - 1].end - t <= n);
          }), e >= 0 ? e : null);
        }
        function $r(e) {
          if (!e) return [];
          for (var t = [], n = 0; n < e.length; n++) t.push({ start: e.start(n), end: e.end(n) });
          return t;
        }
        function sf() {
        }
        function av(e, t) {
          var n = document.createElement("source");
          return n.src = e, n.type = t === void 0 ? "" : t, n;
        }
        function ul(e) {
          for (var t = !1, n = e.getElementsByTagName("source"), r = n.length - 1; r >= 0; --r) e.removeChild(n[r]), t = !0;
          return e.src && (e.removeAttribute("src"), t = !0), t;
        }
        function gu(e) {
          for (; e.firstChild; ) e.removeChild(e.firstChild);
        }
        function oo() {
          return Xo || (uf || (uf = new Ae(function() {
            Xo = null;
          })), (Xo = document.getElementsByTagName("video")[0] || document.getElementsByTagName("audio")[0]) || (Xo = document.createElement("video")), uf.ka(1), Xo);
        }
        function NA(e, t) {
          var n, r, i, o, s;
          return D(function(u) {
            if (u.g == 1) return "fonts" in document && "FontFace" in C ? x(u, document.fonts.ready, 2) : u.return();
            if (!("entries" in document.fonts)) return u.return();
            for (n = function(a) {
              a = a.entries();
              for (var l = [], c = a.next(); c.done === !1; ) l.push(c.value), c = a.next();
              return l;
            }, r = m(n(document.fonts)), i = r.next(); !i.done; i = r.next()) if (o = i.value, o.family === e && o.display === "swap") return u.return();
            s = new FontFace(e, "url(" + t + ")", { display: "swap" }), document.fonts.add(s), q(u);
          });
        }
        Y("shaka.util.Dom", sf), sf.removeAllChildren = gu, sf.clearSourceFromVideo = ul;
        var uf = null, Xo = null;
        function af() {
        }
        function lv(e, t) {
          return t + 10 <= e.length && e[t] === 73 && e[t + 1] === 68 && e[t + 2] === 51 && e[t + 3] < 255 && e[t + 4] < 255 && e[t + 6] < 128 && e[t + 7] < 128 && e[t + 8] < 128 && e[t + 9] < 128;
        }
        function cv(e, t) {
          return t + 10 <= e.length && e[t] === 51 && e[t + 1] === 68 && e[t + 2] === 73 && e[t + 3] < 255 && e[t + 4] < 255 && e[t + 6] < 128 && e[t + 7] < 128 && e[t + 8] < 128 && e[t + 9] < 128;
        }
        function lf(e, t) {
          var n = (e[t] & 127) << 21;
          return n |= (e[t + 1] & 127) << 14, n |= (e[t + 2] & 127) << 7, n |= e[t + 3] & 127;
        }
        function OA(e) {
          var t = { key: e.type, description: "", data: "", mimeType: null, pictureType: null };
          if (e.type === "APIC") {
            if (e.size < 2 || e.data[0] !== 3) return null;
            var n = e.data.subarray(1).indexOf(0);
            if (n === -1) return null;
            var r = dt(pe(e.data, 1, n)), i = e.data[2 + n], o = e.data.subarray(3 + n).indexOf(0);
            if (o === -1) return null;
            var s = dt(pe(e.data, 3 + n, o)), u;
            return r === "-->" ? u = dt(pe(e.data, 4 + n + o)) : u = Kn(e.data.subarray(4 + n + o)), t.mimeType = r, t.pictureType = i, t.description = s, t.data = u, t;
          }
          return e.type === "TXXX" ? e.size < 2 || e.data[0] !== 3 || (r = e.data.subarray(1).indexOf(0), r === -1) ? null : (n = dt(pe(e.data, 1, r)), e = dt(pe(e.data, 2 + r)).replace(/\0*$/, ""), t.description = n, t.data = e, t) : e.type === "WXXX" ? e.size < 2 || e.data[0] !== 3 || (r = e.data.subarray(1).indexOf(0), r === -1) ? null : (n = dt(pe(e.data, 1, r)), e = dt(pe(e.data, 2 + r)).replace(/\0*$/, ""), t.description = n, t.data = e, t) : e.type === "PRIV" ? e.size < 2 || (n = e.data.indexOf(0), n === -1) ? null : (n = dt(pe(e.data, 0, n)), t.description = n, n == "com.apple.streaming.transportStreamTimestamp" ? (n = e.data.subarray(n.length + 1), e = n[3] & 1, n = (n[4] << 23) + (n[5] << 15) + (n[6] << 7) + n[7], n /= 45, e && (n += 4772185884e-2), t.data = n) : (e = Kn(e.data.subarray(n.length + 1)), t.data = e), t) : e.type[0] === "T" ? e.size < 2 || e.data[0] !== 3 ? null : (e = dt(e.data.subarray(1)).replace(/\0*$/, ""), t.data = e, t) : e.type[0] === "W" ? (e = dt(e.data).replace(/\0*$/, ""), t.data = e, t) : e.data ? (t.data = Kn(e.data), t) : null;
        }
        function so(e) {
          for (var t = 0, n = []; lv(e, t); ) {
            var r = lf(e, t + 6);
            for (e[t + 5] >> 6 & 1 && (t += 10), t += 10, r = t + r; t + 10 < r; ) {
              var i = e.subarray(t), o = lf(i, 4);
              i = { type: String.fromCharCode(i[0], i[1], i[2], i[3]), size: o, data: i.subarray(10, 10 + o) }, (o = OA(i)) && n.push(o), t += i.size + 10;
            }
            cv(e, t) && (t += 10);
          }
          return n;
        }
        function qo(e, t) {
          for (var n = t = t === void 0 ? 0 : t, r = 0; lv(e, t); ) e[t + 5] >> 6 & 1 && (r += 10), r += 10, r += lf(e, t + 6), cv(e, t + 10) && (r += 10), t += r;
          return r > 0 ? e.subarray(n, n + r) : new Uint8Array([]);
        }
        Y("shaka.util.Id3Utils", af), af.getID3Data = qo, af.getID3Frames = so;
        function dv(e) {
          return new Date(Date.UTC(1900, 0, 1, 0, 0, 0, 0) + e).getTime();
        }
        function Jr(e, t) {
          if (this.j = e, t !== void 0 && t) {
            t = new Uint8Array(e.byteLength);
            for (var n = 0, r = 0; r < e.byteLength; r++) r >= 2 && e[r] == 3 && e[r - 1] == 0 && e[r - 2] == 0 || (t[n] = e[r], n++);
            this.j = pe(t, 0, n);
          }
          this.i = this.j.byteLength, this.g = this.h = 0;
        }
        function cf(e) {
          var t = e.j.byteLength - e.i, n = new Uint8Array(4), r = Math.min(4, e.i);
          r !== 0 && (n.set(e.j.subarray(t, t + r)), e.h = new st(n, 0).V(), e.g = r * 8, e.i -= r);
        }
        function In(e, t) {
          if (e.g <= t) {
            t -= e.g;
            var n = Math.floor(t / 8);
            t -= n * 8, e.g -= n, cf(e);
          }
          e.h <<= t, e.g -= t;
        }
        function Me(e, t) {
          var n = Math.min(e.g, t), r = e.h >>> 32 - n;
          return e.g -= n, e.g > 0 ? e.h <<= n : e.i > 0 && cf(e), n = t - n, n > 0 ? r << n | Me(e, n) : r;
        }
        function df(e) {
          var t;
          for (t = 0; t < e.g; ++t) if ((e.h & 2147483648 >>> t) !== 0) return e.h <<= t, e.g -= t, t;
          return cf(e), t + df(e);
        }
        function Ft(e) {
          In(e, 1 + df(e));
        }
        function Z(e) {
          var t = df(e);
          return Me(e, t + 1) - 1;
        }
        function Yo(e) {
          return e = Z(e), 1 & e ? 1 + e >>> 1 : -1 * (e >>> 1);
        }
        function re(e) {
          return Me(e, 1) === 1;
        }
        function Ge(e) {
          return Me(e, 8);
        }
        function al(e, t) {
          for (var n = 8, r = 8, i = 0; i < t; i++) r !== 0 && (r = Yo(e), r = (n + r + 256) % 256), n = r === 0 ? n : r;
        }
        function jA(e) {
          return Ge(e), Z(e), Z(e);
        }
        Y("shaka.util.ExpGolomb", Jr);
        function rt() {
          this.I = null, this.J = !1, this.m = this.K = null, this.j = [], this.g = [], this.C = this.F = null, this.i = [], this.h = [], this.G = null, this.l = [], this.B = this.H = this.o = this.u = null;
        }
        f = rt.prototype, f.clearData = function() {
          this.j = [], this.g = [], this.i = [], this.h = [], this.l = [];
        }, f.Hf = function(e) {
          this.B != null && this.B != e && (this.o = this.u = null), this.B = e;
        }, f.parse = function(e) {
          if (e.length < 564) return this;
          for (var t = Math.max(0, hf(e)), n = e.length - (e.length + t) % 188, r = !1, i = t; i < n; i += 188) if (e[i] == 71) {
            var o = !!(e[i + 1] & 64), s = ((e[i + 1] & 31) << 8) + e[i + 2];
            if ((e[i + 3] & 48) >> 4 > 1) {
              var u = i + 5 + e[i + 4];
              if (u == i + 188) continue;
            } else u = i + 4;
            switch (s) {
              case 0:
                o && (u += e[u] + 1), this.I = (e[u + 10] & 31) << 8 | e[u + 11];
                break;
              case 17:
              case 8191:
                break;
              case this.I:
                o && (u += e[u] + 1), o = e, s = { audio: -1, video: -1, df: -1, audioCodec: "", videoCodec: "" };
                var a = u + 3 + ((o[u + 1] & 15) << 8 | o[u + 2]) - 4;
                for (u += 12 + ((o[u + 10] & 15) << 8 | o[u + 11]); u < a; ) {
                  var l = (o[u + 1] & 31) << 8 | o[u + 2], c = (o[u + 3] & 15) << 8 | o[u + 4];
                  switch (o[u]) {
                    case 6:
                      if (c > 0) for (var d = u + 5, h = c; h > 2; ) {
                        var p = o[d + 1] + 2;
                        switch (o[d]) {
                          case 5:
                            var g = o.subarray(d + 2, d + p);
                            g = Ia.value()(g), s.audio == -1 && g === "Opus" ? (s.audio = l, s.audioCodec = "opus") : s.video == -1 && g === "AV01" && (s.video = l, s.videoCodec = "av1");
                            break;
                          case 106:
                            s.audio == -1 && (s.audio = l, s.audioCodec = "ac3");
                            break;
                          case 122:
                            s.audio == -1 && (s.audio = l, s.audioCodec = "ec3");
                            break;
                          case 124:
                            s.audio == -1 && (s.audio = l, s.audioCodec = "aac");
                            break;
                          case 127:
                            s.audioCodec == "opus" && (g = null, o[d + 2] === 128 && (g = o[d + 3]), g != null && (this.H = { channelCount: (g & 15) === 0 ? 2 : g & 15, rj: g, sampleRate: 48e3 }));
                        }
                        d += p, h -= p;
                      }
                      break;
                    case 15:
                      s.audio == -1 && (s.audio = l, s.audioCodec = "aac");
                      break;
                    case 17:
                      s.audio == -1 && (s.audio = l, s.audioCodec = "aac-loas");
                      break;
                    case 21:
                      s.df == -1 && (s.df = l);
                      break;
                    case 27:
                      s.video == -1 && (s.video = l, s.videoCodec = "avc");
                      break;
                    case 3:
                    case 4:
                      s.audio == -1 && (s.audio = l, s.audioCodec = "mp3");
                      break;
                    case 36:
                      s.video == -1 && (s.video = l, s.videoCodec = "hvc");
                      break;
                    case 129:
                      s.audio == -1 && (s.audio = l, s.audioCodec = "ac3");
                      break;
                    case 132:
                    case 135:
                      s.audio == -1 && (s.audio = l, s.audioCodec = "ec3");
                  }
                  u += c + 5;
                }
                o = s, o.video != -1 && (this.K = o.video, this.m = o.videoCodec), o.audio != -1 && (this.F = o.audio, this.C = o.audioCodec), o.df != -1 && (this.G = o.df), r && !this.J && (r = !1, i = t - 188), this.J = !0;
                break;
              case this.K:
                u = e.subarray(u, i + 188), o ? this.j.push([u]) : this.j.length && this.j[this.j.length - 1] && this.j[this.j.length - 1].push(u);
                break;
              case this.F:
                u = e.subarray(u, i + 188), o ? this.i.push([u]) : this.i.length && this.i[this.i.length - 1] && this.i[this.i.length - 1].push(u);
                break;
              case this.G:
                u = e.subarray(u, i + 188), o ? this.l.push([u]) : this.l.length && this.l[this.l.length - 1] && this.l[this.l.length - 1].push(u);
                break;
              default:
                r = !0;
            }
          }
          return this;
        };
        function ff(e, t) {
          if ((t[0] << 16 | t[1] << 8 | t[2]) !== 1) return null;
          var n = { data: new Uint8Array(0), packetLength: t[4] << 8 | t[5], pts: null, dts: null, nalus: [] };
          if (n.packetLength && n.packetLength > t.byteLength - 6) return null;
          var r = t[7];
          if (r & 192) {
            var i = (t[9] & 14) * 536870912 + (t[10] & 255) * 4194304 + (t[11] & 254) * 16384 + (t[12] & 255) * 128 + (t[13] & 254) / 2;
            e.u == null && (e.u = i), n.pts = hv(i, e.u), e.u = n.pts, n.dts = n.pts, r & 64 && (r = (t[14] & 14) * 536870912 + (t[15] & 255) * 4194304 + (t[16] & 254) * 16384 + (t[17] & 255) * 128 + (t[18] & 254) / 2, e.o == null && (e.o = r), n.dts = n.pts != i ? hv(r, e.o) : r), e.o = n.dts;
          }
          return e = t[8] + 9, t.byteLength <= e ? null : (n.data = t.subarray(e), n);
        }
        f.Fk = function(e) {
          return Ne("TsParser.parseAvcNalus", "Please use parseNalus function instead."), this.Xg(e, { ke: null, state: null });
        }, f.Xg = function(e, t) {
          var n = e.pts ? e.pts / 9e4 : null;
          e = e.data;
          var r = e.byteLength, i = 1;
          this.m == "hvc" && (i = 2);
          var o = t.state || 0, s = o, u = 0, a = [], l = -1, c = 0;
          for (o == -1 && (l = 0, c = this.m == "hvc" ? e[0] >> 1 & 63 : e[0] & 31, o = 0, u = 1); u < r; ) {
            var d = e[u++];
            o ? o === 1 ? o = d ? 0 : 2 : d ? d == 1 ? (d = u - o - 1, l >= 0 ? a.push({ data: e.subarray(l + i, d), fullData: e.subarray(l, d), type: c, time: n, state: null }) : (o = a.length ? a[a.length - 1] : t.ke) && (s && u <= 4 - s && o.state && (o.data = o.data.subarray(0, o.data.byteLength - s), o.fullData = o.fullData.subarray(0, o.fullData.byteLength - s)), d > 0 && (d = e.subarray(0, d), o.data = St(o.data, d), o.fullData = St(o.fullData, d), o.state = 0)), u < r ? (c = this.m == "hvc" ? e[u] >> 1 & 63 : e[u] & 31, l = u, o = 0) : o = -1) : o = 0 : o = 3 : o = d ? 0 : 1;
          }
          return l >= 0 && o >= 0 && a.push({ data: e.subarray(l + i, r), fullData: e.subarray(l, r), type: c, time: n, state: o }), !a.length && t.ke && (n = a.length ? a[a.length - 1] : t.ke) && (n.data = St(n.data, e), n.fullData = St(n.fullData, e)), t.state = o, a;
        }, f.getMetadata = function() {
          for (var e = [], t = m(this.l), n = t.next(); !n.done; n = t.next()) n = St.apply(Gt, X(n.value)), (n = ff(this, n)) && e.push({ cueTime: n.pts ? n.pts / 9e4 : null, data: n.data, frames: so(n.data), dts: n.dts, pts: n.pts });
          return e;
        }, f.ub = function() {
          if (this.i.length && !this.h.length) for (var e = m(this.i), t = e.next(); !t.done; t = e.next()) {
            var n = St.apply(Gt, X(t.value)), r = ff(this, n);
            t = this.h.length ? this.h[this.h.length - 1] : null, r && r.pts != null && r.dts != null && (!t || t.pts != r.pts && t.dts != r.dts) ? this.h.push(r) : this.h.length && (n = r ? r.data : n) && (t = this.h.pop(), t.data = St(t.data, n), this.h.push(t));
          }
          return this.h;
        }, f.td = function(e) {
          if (e = e === void 0 ? !0 : e, this.j.length && !this.g.length) {
            for (var t = m(this.j), n = t.next(); !n.done; n = t.next()) {
              var r = St.apply(Gt, X(n.value)), i = ff(this, r);
              n = this.g.length ? this.g[this.g.length - 1] : null, i && i.pts != null && i.dts != null && (!n || n.pts != i.pts && n.dts != i.dts) ? this.g.push(i) : this.g.length && (r = i ? i.data : r) && (n = this.g.pop(), n.data = St(n.data, r), this.g.push(n));
            }
            if (e) {
              for (t = { ke: null, state: null }, n = [], r = m(this.g), i = r.next(); !i.done; i = r.next()) i = i.value, i.nalus = this.Xg(i, t), i.nalus.length && (n.push(i), t.ke = i.nalus[i.nalus.length - 1]);
              this.g = n;
            }
          }
          return e ? this.g : (e = this.g, this.g = [], e);
        }, f.getStartTime = function(e) {
          if (e == "audio") {
            e = null;
            var t = this.ub();
            return t.length && (e = t[0], e = Math.min(e.dts, e.pts) / 9e4), e;
          }
          return e == "video" ? (e = null, t = this.td(!1), t.length && (e = t[0], e = Math.min(e.dts, e.pts) / 9e4), e) : null;
        }, f.Yd = function() {
          return { audio: this.C, video: this.m };
        }, f.cf = function() {
          for (var e = [], t = m(this.td()), n = t.next(); !n.done; n = t.next()) e.push.apply(e, X(n.value.nalus));
          return e;
        }, f.ek = function() {
          Ne("TsParser.getVideoResolution", "Please use getVideoInfo function instead.");
          var e = this.Kg();
          return { height: e.height, width: e.width };
        }, f.Kg = function() {
          return this.m == "hvc" ? _A(this) : UA(this);
        };
        function fv(e) {
          var t = e.td();
          return t.length > 1 && (e = t[0].pts, t = t[1].pts, !isNaN(t - e)) ? String(Math.abs(1 / (t - e) * 9e4)) : null;
        }
        function UA(e) {
          var t = { height: null, width: null, codec: null, frameRate: null }, n = e.cf();
          if (!n.length || (n = n.find(function(p) {
            return p.type == 7;
          }), !n)) return t;
          n = new Jr(n.data);
          var r = Ge(n), i = Ge(n), o = Ge(n);
          if (Ft(n), BA.includes(r)) {
            var s = Z(n);
            if (s === 3 && In(n, 1), Ft(n), Ft(n), In(n, 1), re(n)) {
              s = s !== 3 ? 8 : 12;
              for (var u = 0; u < s; u++) re(n) && (u < 6 ? al(n, 16) : al(n, 64));
            }
          }
          if (Ft(n), s = Z(n), s === 0) Z(n);
          else if (s === 1) for (In(n, 1), Ft(n), Ft(n), s = Z(n), u = 0; u < s; u++) Ft(n);
          Ft(n), In(n, 1), s = Z(n), u = Z(n);
          var a = Me(n, 1);
          a === 0 && In(n, 1), In(
            n,
            1
          );
          var l = 0, c = 0, d = 0, h = 0;
          return re(n) && (l = Z(n), c = Z(n), d = Z(n), h = Z(n)), t.height = String((2 - a) * (u + 1) * 16 - d * 2 - h * 2), t.width = String((s + 1) * 16 - l * 2 - c * 2), t.codec = "avc1." + ("0" + r.toString(16).toUpperCase()).slice(-2) + ("0" + i.toString(16).toUpperCase()).slice(-2) + ("0" + o.toString(16).toUpperCase()).slice(-2), t.frameRate = fv(e), t;
        }
        function _A(e) {
          var t = { height: null, width: null, codec: null, frameRate: null }, n = e.cf();
          if (!n.length || (n = n.find(function(N) {
            return N.type == 33;
          }), !n)) return t;
          var r = new Jr(n.fullData, !0);
          Ge(r), Ge(r), Me(r, 4);
          var i = Me(r, 3);
          re(r);
          var o = Me(r, 2), s = Me(r, 1), u = Me(r, 5), a = Me(r, 32);
          n = Ge(r);
          for (var l = Ge(r), c = Ge(r), d = Ge(r), h = Ge(r), p = Ge(r), g = Ge(r), w = [], T = [], E = 0; E < i; E++) w.push(re(r)), T.push(re(r));
          if (i > 0) for (E = i; E < 8; E++) Me(r, 2);
          for (E = 0; E < i; E++) w[E] && Me(r, 88), T[E] && Ge(r);
          Z(r), i = Z(r), i == 3 && Me(r, 1), w = Z(r), T = Z(r);
          var A = E = 0, I = 0, P = 0;
          return re(r) && (E += Z(r), A += Z(r), I += Z(r), P += Z(r)), t.width = String(w - (E + A) * (i === 1 || i === 2 ? 2 : 1)), t.height = String(T - (I + P) * (i === 1 ? 2 : 1)), r = (function(N) {
            for (var M = 0, R = 0; R < 32; R++) M |= (N >> R & 1) << 31 - R;
            return M >>> 0;
          })(a), s = s == 1 ? "H" : "L", o = "hvc1" + ("." + ["", "A", "B", "C"][o] + u), o += "." + r.toString(16).toUpperCase(), o += "." + s + g, p && (o += "." + p.toString(16).toUpperCase()), h && (o += "." + h.toString(16).toUpperCase()), d && (o += "." + d.toString(16).toUpperCase()), c && (o += "." + c.toString(16).toUpperCase()), l && (o += "." + l.toString(16).toUpperCase()), n && (o += "." + n.toString(16).toUpperCase()), t.codec = o, t.frameRate = fv(e), t;
        }
        function hv(e, t) {
          var n = 1;
          for (e > t && (n = -1); Math.abs(t - e) > 4294967296; ) e += n * 8589934592;
          return e;
        }
        function $o(e) {
          return !(hf(e) < 0);
        }
        function hf(e) {
          for (var t = Math.min(1e3, e.length - 564), n = 0; n < t; ) {
            if (e[n] == 71 && e[n + 188] == 71 && e[n + 376] == 71) return n;
            n++;
          }
          return -1;
        }
        Y("shaka.util.TsParser", rt), rt.syncOffset = hf, rt.probe = $o, rt.prototype.getVideoInfo = rt.prototype.Kg, rt.prototype.getVideoResolution = rt.prototype.ek, rt.prototype.getVideoNalus = rt.prototype.cf, rt.prototype.getCodecs = rt.prototype.Yd, rt.prototype.getStartTime = rt.prototype.getStartTime, rt.prototype.getVideoData = rt.prototype.td, rt.prototype.getAudioData = rt.prototype.ub, rt.prototype.getMetadata = rt.prototype.getMetadata, rt.prototype.parseNalus = rt.prototype.Xg, rt.prototype.parseAvcNalus = rt.prototype.Fk, rt.prototype.parse = rt.prototype.parse, rt.prototype.setDiscontinuitySequence = rt.prototype.Hf, rt.prototype.clearData = rt.prototype.clearData, rt.Timescale = 9e4;
        var BA = [100, 110, 122, 244, 44, 83, 86, 118, 128, 138, 139, 134];
        function pv(e, t, n, r, i) {
          var o = this;
          this.g = e, this.O = n, this.B = r, this.ba = t, this.l = /* @__PURE__ */ new Map(), this.G = /* @__PURE__ */ new Map(), this.Ta = /* @__PURE__ */ new Map(), this.h = null, this.Fa = !1, this.C = i || null, this.m = /* @__PURE__ */ new Map(), this.u = new Ve(), this.j = /* @__PURE__ */ new Map(), this.K = null, this.M = new Je(), this.Da = "", this.ob = !1, this.za = !0, this.N = !1, this.F = this.R = null, this.i = pf(this, this.M), this.Ua = this.I = !1, this.H = new Ho(function() {
            return HA(o);
          }), this.J = !1, this.X = "UNKNOWN", this.eb = this.kb = !1, this.ab = new Je(), this.o = !1, this.ya = null, this.$ = /* @__PURE__ */ new Map(), this.oa = this.T = this.va = this.W = null, this.ma = new Je(), this.g.remote && (this.N = this.g.remote.state != "disconnected", this.u.D(this.g.remote, "connect", function() {
            o.N = o.g.remote.state != "disconnected";
          }), this.u.D(this.g.remote, "connecting", function() {
            o.N = o.g.remote.state != "disconnected";
          }), this.u.D(this.g.remote, "disconnect", function() {
            o.N = o.g.remote.state != "disconnected";
          }));
        }
        function pf(e, t) {
          if (e.za = !0, C.ManagedMediaSource) {
            e.F || (e.g.disableRemotePlayback = !0);
            var n = new ManagedMediaSource();
            e.u.D(n, "startstreaming", function() {
              e.za = !0;
            }), e.u.D(n, "endstreaming", function() {
              e.za = !1;
            });
          } else n = new MediaSource();
          if (e.u.Aa(n, "sourceopen", function() {
            URL.revokeObjectURL(e.Da), t.resolve();
          }), e.u.Aa(e.g, "playing", function() {
            e.ob = !0;
          }), e.Da = yf(n), e.B.useSourceElements) {
            e.g.removeAttribute("src");
            var r;
            ((r = e.R) == null ? void 0 : r.parentElement) === e.g && e.g.removeChild(e.R);
            var i;
            ((i = e.F) == null ? void 0 : i.parentElement) === e.g && e.g.removeChild(e.F), e.R = av(e.Da), e.g.appendChild(e.R), e.F && e.g.appendChild(e.F), e.g.load();
          } else e.g.src = e.Da;
          return n;
        }
        function FA(e, t, n) {
          if (e.g && C.ManagedMediaSource && e.i && e.B.useSourceElements) {
            var r;
            ((r = e.F) == null ? void 0 : r.parentElement) === e.g && e.g.removeChild(e.F), e.F = av(t, n), e.g.appendChild(e.F), e.g.disableRemotePlayback = !1;
          }
        }
        function VA() {
          var e = 'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.20000000.L153.B0",video/mp4; codecs="hvc1.2.4.L120.b0",video/mp4; codecs="hvc1.2.4.L123.b0",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="av01.0.31M.10.0.111.09.16.09.0",video/mp4; codecs="av01.0.31M.10.0.112.09.18.09.0",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.08.01",video/mp4; codecs="dav1.10.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.03",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",audio/mp4; codecs="apac.31.00",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(X(Kr)), t = {};
          Se(), e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) {
            if (n = n.value, eu(n)) t[n] = !0;
            else if (br()) {
              var r = xn(n), i = iu(hn(n), r);
              r = gt(r, i), t[n] = Qt(r) || !!Uo(r);
            } else t[n] = oo().canPlayType(n) != "";
            r = n.split(";")[0], t[r] = t[r] || t[n];
          }
          return t;
        }
        f = pv.prototype, f.destroy = function() {
          return this.H.destroy();
        };
        function HA(e) {
          var t, n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E;
          return D(function(A) {
            if (A.g == 1) {
              for (t = [], n = m(e.m), r = n.next(); !r.done; r = n.next()) for (i = r.value, o = m(i), s = o.next().value, u = o.next().value, a = u[0], l = s, e.m.set(l, u.slice(0, 1)), a && t.push(a.p.catch(Cx)), c = m(u.slice(1)), d = c.next(); !d.done; d = c.next()) h = d.value, h.p.reject(new b(2, 7, 7003, void 0));
              return e.h && t.push(e.h.destroy()), x(A, Promise.all(t), 2);
            }
            for (p = m(e.j.values()), g = p.next(); !g.done; g = p.next()) w = g.value, w.destroy();
            e.u && (e.u.release(), e.u = null), e.g && ((T = e.F) == null ? void 0 : T.parentElement) === e.g && e.g.removeChild(e.F), e.g && ((E = e.R) == null ? void 0 : E.parentElement) === e.g && (e.g.removeChild(e.R), e.g.load(), e.g.disableRemotePlayback = !1), e.g = null, e.R = null, e.F = null, e.B = null, e.i = null, e.h = null, e.ba = null, e.l.clear(), e.Ta.clear(), e.j.clear(), e.K = null, e.m.clear(), e.C = null, e.$.clear(), e.O = null, q(A);
          });
        }
        f.init = function(e, t, n, r) {
          t = t === void 0 ? !1 : t, n = n === void 0 ? "UNKNOWN" : n, r = r === void 0 ? !1 : r;
          var i = this, o, s, u, a, l, c;
          return D(function(d) {
            if (d.g == 1) return o = xt, x(d, i.M, 2);
            if (d.g != 3)
              return !uo(i) && !Ai(i) ? d.A(3) : (Ir("Expected MediaSource to be open during init(); reopening the media source."), i.M = new Je(), i.i = pf(i, i.M), x(d, i.M, 3));
            for (i.J = t, i.X = n, i.kb = r, i.eb = !i.J && i.X == "HLS" && !i.kb, i.$.clear(), i.W = null, i.va = null, i.T = null, i.oa = null, i.ma = new Je(), s = m(e.keys()), u = s.next(); !u.done; u = s.next()) a = u.value, l = e.get(a), ll(i, a, l, l.codecs), i.o ? (i.m.set(o.aa, []), i.m.set(o.wa, [])) : i.m.set(a, []);
            (c = e.get(o.aa)) && c.isAudioMuxedInVideo && (i.o = !0), q(d);
          });
        };
        function ll(e, t, n, r) {
          t == "audio" && r && (r = iu(r, n.mimeType)), t == "video" && r && n.mimeType == "video/mp4" && (r = Gd(r));
          var i = gt(n.mimeType, r);
          if (t == xe) cl(e, i, e.J, n.external);
          else {
            var o = e.B.forceTransmux;
            (!Qt(i) || !e.J && Kr.includes(i)) && (o = !0);
            var s = _a(n.mimeType, r);
            if (o) {
              if (o = fn("audio", (r || "").split(",")), r = fn("video", (r || "").split(",")), o && r) {
                e.o = !0, ll(e, "audio", n, o), ll(e, "video", n, r);
                return;
              }
              (r = Uo(s)) && (i = r(), e.j.set(t, i), i = i.convertCodecs(t, s));
            }
            s = i + e.B.addExtraFeaturesToSourceBuffer(i), nt(e.H);
            try {
              var u = e.i.addSourceBuffer(s);
            } catch (a) {
              throw new b(
                2,
                3,
                3015,
                a,
                "The mediaSource_ status was " + e.i.readyState + " expected 'open'",
                null
              );
            }
            e.J && (u.mode = eE), e.u.D(u, "error", function() {
              var a = e.m.get(t)[0];
              a.p.reject(new b(2, 3, 3014, e.g.error ? e.g.error.code : 0, a.uri));
            }), e.u.D(u, "updateend", function() {
              return Ii(e, t);
            }), e.l.set(t, u), e.G.set(t, i), e.Ta.set(t, !!n.drmInfos.length);
          }
        }
        f.configure = function(e) {
          this.B = e, this.h && (this.h.C = e.modifyCueCallback);
        };
        function gv(e) {
          return e.za && !e.N && !e.I;
        }
        function cl(e, t, n, r) {
          e.h || (e.h = new Wr(e.ba), e.h && (e.h.C = e.B.modifyCueCallback));
          var i = e.h, o = e.Fa;
          e = e.X, t == "application/cea-608" || t == "application/cea-708" ? i.i = null : (i.i = tu.get(t)(), i.i.setSequenceMode ? i.i.setSequenceMode(n) : Ne("Text parsers w/ setSequenceMode", 'Text parsers should have a "setSequenceMode" method!'), i.i.setManifestType ? i.i.setManifestType(e) : Ne("Text parsers w/ setManifestType", 'Text parsers should have a "setManifestType" method!'), i.G = o, i.B = r);
        }
        function uo(e) {
          return e.I ? !1 : e.i ? e.i.readyState == "ended" : !0;
        }
        function Ai(e) {
          return e.I ? !1 : e.i ? e.i.readyState == "closed" : !0;
        }
        function gf(e, t) {
          return e.l.size ? t == xe ? e.h.g : sv(Jo(e, t)) : null;
        }
        function Ei(e, t) {
          return e.l.size ? t == xe ? e.h.h : sl(Jo(e, t)) : null;
        }
        function GA(e, t, n) {
          return t == xe ? (e = e.h, e.h == null || e.h < n ? 0 : e.h - Math.max(n, e.g)) : (e = Jo(e, t), uv(e, n));
        }
        f.Hc = function() {
          var e = { total: this.I ? [] : $r(this.g.buffered), audio: $r(Jo(this, "audio")), video: $r(Jo(this, "video")), text: [] };
          if (this.h) {
            var t = this.h.g, n = this.h.h;
            t != null && n != null && e.text.push({ start: t, end: n });
          }
          return e;
        };
        function Jo(e, t) {
          if (e.I || e.N || Ai(e)) return null;
          try {
            return e.l.get(t).buffered;
          } catch {
            return e.l.has(t), null;
          }
        }
        function KA(e, t, n, r, i, o, s) {
          s = s === void 0 ? !1 : s;
          var u = null, a = [], l = pe(n);
          if (Kr.includes(o)) n = so(l), n.length && r && ((s = n.find(function(g) {
            return g.description === "com.apple.streaming.transportStreamTimestamp";
          })) && typeof s.data == "number" && (u = Math.round(s.data) / 1e3), e.O.onMetadata([{ cueTime: r.startTime, data: l, frames: n, dts: r.startTime, pts: r.startTime }], 0, r.endTime));
          else if (o.includes("/mp4") && r && r.ea) {
            l = new qe();
            var c = i.emsgSchemeIdUris != null && i.emsgSchemeIdUris.length > 0 || e.B.dispatchAllEmsgBoxes;
            c && l.S(
              "emsg",
              function(g) {
                var w = i.emsgSchemeIdUris;
                if (g.version === 0)
                  var T = g.reader.Ed(), E = g.reader.Ed(), A = g.reader.V(), I = g.reader.V(), P = g.reader.V(), N = g.reader.V(), M = r.startTime + I / A;
                else A = g.reader.V(), M = g.reader.Fd() / A + r.timestampOffset, I = M - r.startTime, P = g.reader.V(), N = g.reader.V(), T = g.reader.Ed(), E = g.reader.Ed();
                g = g.reader.Tb(g.reader.getLength() - g.reader.Pa(), !0), (w && w.includes(T) || e.B.dispatchAllEmsgBoxes) && (T == "urn:mpeg:dash:event:2012" ? e.O.Ek() : (w = M + P / A, e.O.Ck({
                  startTime: M,
                  endTime: w,
                  schemeIdUri: T,
                  value: E,
                  timescale: A,
                  presentationTimeDelta: I,
                  eventDuration: P,
                  id: N,
                  messageData: g
                }), (T == "https://aomedia.org/emsg/ID3" || T == "https://developer.apple.com/streaming/emsg-id3") && (A = so(g), A.length && e.O.onMetadata([{ cueTime: M, data: g, frames: A, dts: M, pts: M }], 0, w))));
              }
            );
            var d = r.ea.timescale;
            t = d && !isNaN(d);
            var h = 0, p = !1;
            t && l.S("prft", function(g) {
              var w = g.reader, T = g.version;
              w.V(), g = w.V();
              var E = w.V();
              g = g * 1e3 + E / 4294967296 * 1e3, T === 0 ? w = w.V() : (T = w.V(), w = w.V(), w = T * 4294967296 + w), g = dv(g), w = (/* @__PURE__ */ new Map()).set(
                "detail",
                { wallClockTime: g, programStartDate: new Date(g - w / d * 1e3) }
              ), w = new ee("prft", w), e.O.onEvent(w);
            }).box("moof", Te).box("traf", Te).S("tfdt", function(g) {
              p || (h = rl(g.reader, g.version).baseMediaDecodeTime / d, p = !0, c || g.parser.stop());
            }), (c || t) && l.parse(n, !1, s), p && r.timestampOffset == 0 && (u = h);
          } else o.includes("/mp4") || o.includes("/webm") || !$o(l) || (e.$.has(t) || e.$.set(t, new rt()), a = e.$.get(t), a.clearData(), a.Hf(r.i), a.parse(l), l = a.getStartTime(t), l != null && (u = l), a = a.getMetadata());
          return { timestamp: u, metadata: a };
        }
        function dl(e, t, n, r, i, o, s, u, a, l, c) {
          s = s === void 0 ? !1 : s, u = u === void 0 ? !1 : u, a = a === void 0 ? !1 : a, l = l === void 0 ? !1 : l;
          var d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H;
          return D(function(B) {
            switch (B.g) {
              case 1:
                if (d = xt, t != d.Na) {
                  B.A(2);
                  break;
                }
                if (e.X != "HLS") {
                  B.A(3);
                  break;
                }
                return x(B, e.ab, 4);
              case 4:
                h = B.h, e.h.u = h;
              case 3:
                return x(B, xx(e.h, n, r ? r.startTime : null, r ? r.endTime : null, r ? r.P()[0] : null), 5);
              case 5:
                return B.return();
              case 2:
                if (l || !e.o) {
                  B.A(6);
                  break;
                }
                return x(B, dl(e, d.aa, n, r, i, o, s, u, a, !0), 7);
              case 7:
                return x(B, dl(
                  e,
                  d.wa,
                  n,
                  r,
                  i,
                  o,
                  s,
                  u,
                  a,
                  !0
                ), 8);
              case 8:
                return B.return();
              case 6:
                if (!e.l.has(t)) return B.return();
                if (p = e.l.get(t).timestampOffset, g = e.G.get(t), e.j.has(t) && (g = e.j.get(t).getOriginalMimeType()), r && (w = KA(e, t, n, r, i, g, a), T = w.timestamp, E = w.metadata, T != null && (e.W == null && t == d.wa && (e.W = T, e.va = r.startTime, e.T != null && (A = 0, e.va == e.oa && (A = e.W - e.T), e.ma.resolve(A))), e.T == null && t == d.aa && (e.T = T, e.oa = r.startTime, e.W != null && (I = 0, e.va == e.oa && (I = e.W - e.T), e.ma.resolve(I))), P = T, N = Kr, !e.J && N.includes(e.G.get(t)) && (P = 0), M = r.startTime - P, R = Math.abs(p - M), (R >= 1e-3 || s || u) && (!a || M > 0 || !p) && (p = M, e.eb && (kt(e, t, function() {
                  return Qo(e, t);
                }, null), kt(e, t, function() {
                  return Zo(e, t, p);
                }, null))), (t == d.wa || !e.l.has(d.wa)) && e.ab.resolve(p)), E.length) && e.O.onMetadata(E, p, r ? r.endTime : null), o && t == d.wa && (e.h || cl(e, "application/cea-608", e.J, !1), e.K || (k = g.split(";", 1)[0], e.K = new ur(k)), r ? (O = Id(e.K, n), O.length && Ex(e.h, O, p)) : e.K.init(n, u, c)), !e.j.has(t)) {
                  B.A(9);
                  break;
                }
                return x(B, e.j.get(t).transmux(n, i, r, e.i.duration, t), 10);
              case 10:
                L = B.h, ArrayBuffer.isView(L) ? n = L : (U = L, U.init != null && (j = U.init, kt(e, t, function() {
                  e.C && Ca(e.C, j, p, i), e.l.get(t).appendBuffer(j);
                }, r ? r.P()[0] : null)), n = U.data);
              case 9:
                if (n = YA(e, i, n, r, t), !r || !e.J || t == d.Na) {
                  B.A(11);
                  break;
                }
                if (!s && !u) {
                  B.A(11);
                  break;
                }
                if (G = r.startTime, e.X != "HLS" || e.o || t != d.aa || !e.l.has(d.wa)) {
                  B.A(13);
                  break;
                }
                return x(B, e.ma, 14);
              case 14:
                H = B.h, Math.abs(H) > 0.15 && (G -= H);
              case 13:
                kt(e, t, function() {
                  return Qo(e, t);
                }, null), kt(e, t, function() {
                  return Zo(e, t, G);
                }, null);
              case 11:
                return x(B, kt(
                  e,
                  t,
                  function() {
                    var F = n;
                    e.C && Ca(e.C, F, p, i), e.l.get(t).appendBuffer(F);
                  },
                  r ? r.P()[0] : null
                ), 15);
              case 15:
                q(B);
            }
          });
        }
        function WA(e, t) {
          var n = Ei(e, "video") || 0;
          nm(e.h, t, n);
        }
        function zA(e) {
          e.h && nm(e.h, "", 0);
        }
        f.remove = function(e, t, n, r) {
          var i = this, o, s;
          return D(function(u) {
            return u.g == 1 ? (o = xt, e == o.wa && i.K && (i.K.remove(r), s = i.h.g || 0, i.h.remove(s, n, !0)), e == o.Na ? x(u, i.h.remove(t, n), 0) : n > t ? x(u, kt(i, e, function() {
              return fl(i, e, t, n);
            }, null), 5) : u.A(0)) : i.o ? x(u, kt(i, o.aa, function() {
              return fl(i, o.aa, t, n);
            }, null), 0) : u.A(0);
          });
        };
        function mv(e, t) {
          var n;
          return D(function(r) {
            return r.g == 1 ? (n = xt, t == n.Na ? e.h ? x(r, e.h.remove(0, 1 / 0), 0) : r.return() : t === n.wa && e.K && e.h ? x(r, e.h.remove(0, 1 / 0, !0), 4) : r.A(4)) : r.g != 6 ? x(r, kt(e, t, function() {
              return fl(e, t, 0, e.i.duration);
            }, null), 6) : e.o ? x(r, kt(e, n.aa, function() {
              return fl(e, n.aa, 0, e.i.duration);
            }, null), 0) : r.A(0);
          });
        }
        f.flush = function(e) {
          var t = this, n;
          return D(function(r) {
            return r.g == 1 ? (n = xt, e == n.Na ? r.return() : x(r, kt(t, e, function() {
              t.g.currentTime -= 1e-3, Ii(t, e);
            }, null), 2)) : t.o ? x(r, kt(t, n.aa, function() {
              var i = n.aa;
              t.g.currentTime -= 1e-3, Ii(t, i);
            }, null), 0) : r.A(0);
          });
        };
        function vv(e, t, n, r, i, o, s, u, a) {
          var l, c, d;
          return D(function(h) {
            return h.g == 1 ? (l = xt, t == l.Na ? (o || (e.h.u = n), Ax(e.h, r, i), h.return()) : (c = [], x(h, QA(e, t, s, u, a), 2))) : (d = h.h, d || (c.push(kt(e, t, function() {
              return Qo(e, t);
            }, null)), e.o && c.push(kt(e, l.aa, function() {
              return Qo(e, l.aa);
            }, null))), o || (c.push(kt(e, t, function() {
              return Zo(e, t, n);
            }, null)), e.o && c.push(kt(e, l.aa, function() {
              return Zo(e, l.aa, n);
            }, null))), (r != 0 || i != 1 / 0) && (c.push(kt(e, t, function() {
              return wv(e, t, r, i);
            }, null)), e.o && c.push(kt(e, l.aa, function() {
              return wv(
                e,
                l.aa,
                r,
                i
              );
            }, null))), c.length ? x(h, Promise.all(c), 0) : h.A(0));
          });
        }
        function yv(e, t, n) {
          var r, i;
          return D(function(o) {
            return o.g == 1 ? (r = xt, t == r.Na || (t == r.wa && (e.ab = new Je()), !e.J || (i = Ei(e, t)) && Math.abs(i - n) < 0.15) ? o.return() : (kt(e, t, function() {
              return Qo(e, t);
            }, null), e.o && kt(e, r.aa, function() {
              return Qo(e, r.aa);
            }, null), x(o, kt(e, t, function() {
              return Zo(e, t, n);
            }, null), 2))) : e.o ? x(o, kt(e, r.aa, function() {
              return Zo(e, r.aa, n);
            }, null), 0) : o.A(0);
          });
        }
        f.endOfStream = function(e) {
          var t = this;
          return D(function(n) {
            return x(n, mu(t, function() {
              uo(t) || Ai(t) || (e ? t.i.endOfStream(e) : t.i.endOfStream());
            }), 0);
          });
        }, f.Ab = function(e) {
          var t = this;
          return D(function(n) {
            return x(n, mu(t, function() {
              if (t.B.durationReductionEmitsUpdateEnd && e < t.i.duration) for (var r = m(t.l.keys()), i = r.next(); !i.done; i = r.next()) {
                i = i.value;
                var o = { start: function() {
                }, p: new Je(), uri: null };
                t.m.get(i).unshift(o);
              }
              t.i.duration = e, t.ya = e;
            }), 0);
          });
        }, f.getDuration = function() {
          return this.i.duration;
        };
        function XA(e, t, n) {
          D(function(r) {
            return e.H.g || e.g.error || e.N || e.I || uo(e) || Ai(e) ? r.return() : x(r, mu(e, function() {
              uo(e) || Ai(e) || e.i.setLiveSeekableRange(t, n);
            }), 0);
          });
        }
        function mf(e) {
          D(function(t) {
            return e.H.g || e.g.error || e.N || e.I || uo(e) || Ai(e) ? t.return() : x(t, mu(e, function() {
              uo(e) || Ai(e) || e.i.clearLiveSeekableRange();
            }), 0);
          });
        }
        function fl(e, t, n, r) {
          if (r <= n) Ii(e, t);
          else {
            if (e.C) {
              var i = e.C;
              t === "video" && i.g && i.g.flushBuffer(n, r);
            }
            e.l.get(t).remove(n, r);
          }
        }
        function Qo(e, t) {
          var n = e.l.get(t), r = n.appendWindowStart, i = n.appendWindowEnd;
          n.abort(), n.appendWindowStart = r, n.appendWindowEnd = i, Ii(e, t);
        }
        function Zo(e, t, n) {
          n < 0 && (n += 1e-3), e.l.get(t).timestampOffset = n, Ii(e, t);
        }
        function wv(e, t, n, r) {
          var i = e.l.get(t);
          (i.appendWindowEnd !== r || i.appendWindowStart !== n) && (i.appendWindowStart = 0, i.appendWindowEnd = r, i.appendWindowStart = n), Ii(e, t);
        }
        function Ii(e, t) {
          if (e.I || e.H.g) {
            var n = e.m.get(t);
            n && n.length && ((n = n[0]) && n.p && n.p.resolve(), e.m.set(t, []));
          } else (n = e.m.get(t)[0]) && (n.p.resolve(), vf(e, t));
        }
        function kt(e, t, n, r) {
          return nt(e.H), n = { start: n, p: new Je(), uri: r }, e.m.get(t).push(n), e.m.get(t).length == 1 && Tv(e, t), n.p;
        }
        function mu(e, t) {
          var n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I;
          return D(function(P) {
            switch (P.g) {
              case 1:
                for (nt(e.H), n = [], r = Array.from(e.l.keys()), i = /* @__PURE__ */ new Map(), o = m(r), s = o.next(), u = {}; !s.done; u = { ready: void 0 }, s = o.next()) a = s.value, u.ready = new Je(), l = { start: /* @__PURE__ */ (function(N) {
                  return function() {
                    return N.ready.resolve();
                  };
                })(u), p: u.ready, uri: null }, c = e.m.get(a), c.push(l), n.push(u.ready), i.set(a, l), c.length == 1 && l.start();
                return de(P, 2), x(P, Promise.all(n), 4);
              case 4:
                ye(P, 3);
                break;
              case 2:
                if (d = he(P), e.H.g) {
                  for (h = m(r), p = h.next(); !p.done; p = h.next()) g = p.value, w = e.m.get(g), i.has(g) && Gn(w, i.get(g));
                  return P.return();
                }
                throw d;
              case 3:
                return de(P, 5, 6), x(P, t(), 6);
              case 6:
                for (Ct(P), T = m(r), E = T.next(); !E.done; E = T.next()) A = E.value, vf(e, A);
                ln(P, 0);
                break;
              case 5:
                throw I = he(P), new b(2, 3, 3015, I, e.g.error || "No error in the media element", null);
            }
          });
        }
        function vf(e, t) {
          e.m.get(t).shift(), Tv(e, t);
        }
        function Tv(e, t) {
          var n = e.m.get(t)[0];
          if (n) try {
            n.start();
          } catch (r) {
            r.name == "QuotaExceededError" ? n.p.reject(new b(2, 3, 3017, t)) : gv(e) ? n.p.reject(new b(2, 3, 3015, r, e.g.error || "No error in the media element", n.uri)) : n.p.reject(new b(2, 3, 3024, t)), vf(e, t);
          }
        }
        function qA(e, t) {
          e.ba = t, e.h && (e.h.l = t);
        }
        function YA(e, t, n, r, i) {
          if (Qs(e.G.get(i)) != "mp4") return n;
          var o = r === null, s = e.Ta.get(i), u = e.O.Mj(), a = !1;
          r && r.ea && (a = r.ea.encrypted), r = r ? r.P()[0] : null;
          var l = Se();
          return e.B.correctEc3Enca && o && i === "audio" && (n = MA(n)), e.B.insertFakeEncryptionInInit && s && l.Gd(u, i) && (o ? n = CA(t, n, r) : !a && l.Ji(i) && (n = kA(n))), o && l.re() && (n = LA(n)), n;
        }
        function $A(e, t, n, r) {
          return kt(e, t, function() {
            if (t !== xe) {
              if (e.G.get(t), Se().Bb()) {
                e.j.has(t) && (e.j.get(t).destroy(), e.j.delete(t)), r && e.j.set(t, r);
                var i = n + e.B.addExtraFeaturesToSourceBuffer(n);
                e.l.get(t).changeType(i), e.G.set(t, n);
              }
              Ii(e, t);
            }
          }, null);
        }
        function JA(e, t) {
          var n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N;
          return D(function(M) {
            if (M.g == 1) {
              if (e.I || e.N) return M.return();
              for (n = xt, e.I = !0, e.o = !1, r = e.g.currentTime, i = e.g.autoplay, e.g.paused || (e.Ua = !0), e.ob && (e.g.autoplay = !1), ir(M, 2), e.u.Qa(), o = m(e.j.values()), s = o.next(); !s.done; s = o.next()) u = s.value, u.destroy();
              for (a = m(e.l.values()), l = a.next(); !l.done; l = a.next()) {
                c = l.value;
                try {
                  e.i.removeSourceBuffer(c);
                } catch {
                }
              }
              return e.j.clear(), e.l.clear(), d = e.i.duration, e.M = new Je(), e.i = pf(e, e.M), x(M, e.M, 4);
            }
            if (M.g != 2) {
              for (!isNaN(d) && d ? e.i.duration = d : !isNaN(e.ya) && e.ya && (e.i.duration = e.ya), h = new Je(), p = e.i.sourceBuffers, g = t.size, w = 0, T = function() {
                w++, w === g && (h.resolve(), e.u.Ma(p, "addsourcebuffer", T));
              }, e.u.D(p, "addsourcebuffer", T), E = m(t.keys()), A = E.next(); !A.done; A = E.next()) I = A.value, P = t.get(I), ll(e, I, P, P.codecs);
              return (N = t.get(n.aa)) && N.isAudioMuxedInVideo && (e.o = !0), e.o && !e.m.has(n.aa) && e.m.set(n.aa, []), x(M, h, 2);
            }
            return Ct(M), e.I = !1, nt(e.H), e.u.Aa(e.g, "loadedmetadata", function() {
              e.H.g || (e.g.currentTime = r);
            }), e.u.Aa(
              e.g,
              "canplaythrough",
              function() {
                e.H.g || (e.g.autoplay = i, e.Ua && (e.Ua = !1, e.g.play()));
              }
            ), ln(M, 0);
          });
        }
        function Sv(e, t) {
          return mu(e, function() {
            return JA(e, t);
          });
        }
        function xv(e, t, n, r) {
          var i = !1, o = fn("audio", (r || "").split(",")), s = fn("video", (r || "").split(",")), u = s;
          t == "audio" && (u = o), u || (u = r);
          var a = gt(n, u), l = xn(e.G.get(t)), c = e.B.forceTransmux;
          if (!Qt(a) || !e.J && Kr.includes(a) ? c = !0 : c || n == l || (c = !Se().Kf() && Kr.includes(n)), c && (e = _a(n, u), u = Uo(e))) {
            var d = u();
            o && s && (i = !0), a = d.convertCodecs(t, e);
          }
          return !d && t === "video" && o && (a = gt(n, r)), t = Kt(hn(a)), { lc: d, hl: i, Qh: xn(a), codec: t, mimeType: a };
        }
        function Av(e, t, n, r, i) {
          if (t == xe) return { type: wf, uf: n, lc: null };
          var o = Kt(hn(e.G.get(t))), s = xn(e.G.get(t)), u = xv(e, t, n, r), a = u.lc, l = u.hl, c = u.Qh, d = u.codec;
          u = u.mimeType;
          var h = !0;
          return l && e.G.has("audio") && (n = xv(e, "audio", n, r), r = Kt(hn(e.G.get("audio"))), h = xn(e.G.get("audio")), h = r == n.codec && h == n.Qh, n.lc && n.lc.destroy()), o === d && s === c && h ? { type: wf, uf: u, lc: a } : (o = !0, (e.o && !i.has("audio") || l && a && !e.j.has(t)) && (o = !1), t = Se(), o && e.B.codecSwitchingStrategy === "smooth" && t.Bb() ? { type: Ev, uf: u, lc: a } : (a && a.destroy(), { type: Tf, uf: u, lc: null }));
        }
        function QA(e, t, n, r, i) {
          var o, s, u, a, l, c;
          return D(function(d) {
            return d.g == 1 ? (o = xt, s = Av(e, t, n, r, i), u = s.type, a = s.lc, l = s.uf, (c = i.get(o.aa)) && (e.o = c.isAudioMuxedInVideo), u == wf ? (e.j.has(t) && !a ? (e.j.get(t).destroy(), e.j.delete(t)) : !e.j.has(t) && a ? e.j.set(t, a) : a && (e.j.has(t) && e.j.get(t).transmux !== a.transmux ? (e.j.get(t).destroy(), e.j.set(t, a)) : a.destroy()), d.return(!1)) : u == Ev ? x(d, $A(e, t, l, a), 3) : u != Tf ? d.A(3) : (a && a.destroy(), x(d, Sv(e, i), 3))) : d.return(!0);
          });
        }
        function ZA(e, t, n, r, i) {
          return e = Av(e, t, n, r, i), e.lc && e.lc.destroy(), e.type == Tf;
        }
        var yf = C.URL.createObjectURL, eE = "sequence", wf = "none", Tf = "reset", Ev = "changeType";
        function fe(e, t, n) {
          this.i = e, this.F = t, this.u = this.l = 1 / 0, this.h = 1, this.g = this.j = null, this.B = 0, this.C = !0, this.J = !1, this.I = 0, this.G = n === void 0 ? !0 : n, this.H = 0, this.o = !1, this.m = e;
        }
        f = fe.prototype, f.getDuration = function() {
          return this.l;
        }, f.Oj = function() {
          return this.h;
        }, f.Si = function(e) {
          this.i = e;
        }, f.Ab = function(e) {
          this.l = e;
        }, f.Tj = function() {
          return this.i;
        }, f.Ri = function(e) {
          this.B = e;
        }, f.$c = function(e) {
          e && !this.C && (this.J = !0), this.C = e;
        }, f.If = function(e) {
          this.u = e;
        }, f.bf = function() {
          return this.u;
        }, f.ph = function(e) {
          this.F = e;
        }, f.Gj = function() {
          return this.F;
        }, f.Di = function(e, t) {
          if (e.length != 0) {
            var n = (Date.now() + this.B) / 1e3;
            if (e = e.filter(function(i) {
              return i.start + t < n;
            }), e.length != 0) {
              var r = e[e.length - 1].end + t;
              this.vf(e[0].start + t), this.h = e.reduce(function(i, o) {
                return Math.max(i, o.end - o.start);
              }, this.h), this.g = Math.max(this.g, r), this.i != null && this.G && !this.o && (this.i = n - this.g - this.h);
            }
          }
        }, f.le = function(e) {
          if (e.length != 0) {
            var t = e[0].startTime, n = e[0].endTime, r = (Date.now() + this.B) / 1e3;
            e = m(e);
            for (var i = e.next(); !i.done; i = e.next()) i = i.value, r < i.startTime || (t = Math.min(t, i.startTime), n = Math.max(n, i.endTime), this.h = Math.max(this.h, i.endTime - i.startTime));
            this.vf(t), this.g = Math.max(this.g, n), this.i != null && this.G && !this.o && (this.i = r - this.g - this.h);
          }
        }, f.Ci = function(e, t) {
          this.vf(e), t == 1 / 0 || this.U() || (this.g = Math.max(this.g, t));
        }, f.Pj = function() {
          return this.g;
        }, f.nf = function() {
          this.o = !0;
        }, f.qk = function() {
          return this.o;
        }, f.qh = function(e) {
          this.m = e;
        }, f.Lj = function() {
          return this.m;
        }, f.vf = function(e) {
          this.j == null ? this.j = e : this.J || (this.j = Math.min(this.j, e));
        }, f.Tg = function(e) {
          this.h = Math.max(this.h, e);
        }, f.offset = function(e) {
          this.j != null && (this.j += e), this.g != null && (this.g += e);
        }, f.U = function() {
          return this.l == 1 / 0 && !this.C;
        }, f.Uc = function() {
          return this.l != 1 / 0 && !this.C;
        }, f.Jb = function() {
          return Math.max(this.I, this.Jc() - this.u);
        }, f.Vi = function(e) {
          this.I = e;
        }, f.Jc = function() {
          return this.U() || this.Uc() ? Math.min(Math.max(0, (Date.now() + this.B) / 1e3 - this.h - this.i) + this.H, this.l) : this.g ? Math.min(this.g, this.l) : this.l;
        }, f.ae = function(e) {
          var t = Math.max(this.j, this.I);
          return this.u == 1 / 0 ? Math.ceil(t * 1e3) / 1e3 : Math.max(t, Math.min(this.Jc() - this.u + e, this.Ib()));
        }, f.$b = function() {
          return this.ae(0);
        }, f.Ib = function() {
          return Math.max(0, this.Jc() - (this.U() || this.Uc() ? this.F : 0));
        }, f.hj = function() {
          return !(this.i == null || this.g != null && this.G);
        }, f.Qi = function(e) {
          this.H = e;
        }, f.Bj = function() {
          return this.H;
        }, Y("shaka.media.PresentationTimeline", fe), fe.prototype.getAvailabilityTimeOffset = fe.prototype.Bj, fe.prototype.setAvailabilityTimeOffset = fe.prototype.Qi, fe.prototype.usingPresentationStartTime = fe.prototype.hj, fe.prototype.getSeekRangeEnd = fe.prototype.Ib, fe.prototype.getSeekRangeStart = fe.prototype.$b, fe.prototype.getSafeSeekRangeStart = fe.prototype.ae, fe.prototype.getSegmentAvailabilityEnd = fe.prototype.Jc, fe.prototype.setUserSeekStart = fe.prototype.Vi, fe.prototype.getSegmentAvailabilityStart = fe.prototype.Jb, fe.prototype.isInProgress = fe.prototype.Uc, fe.prototype.isLive = fe.prototype.U, fe.prototype.offset = fe.prototype.offset, fe.prototype.notifyMaxSegmentDuration = fe.prototype.Tg, fe.prototype.notifyMinSegmentStartTime = fe.prototype.vf, fe.prototype.getInitialProgramDateTime = fe.prototype.Lj, fe.prototype.setInitialProgramDateTime = fe.prototype.qh, fe.prototype.isStartTimeLocked = fe.prototype.qk, fe.prototype.lockStartTime = fe.prototype.nf, fe.prototype.getMaxSegmentEndTime = fe.prototype.Pj, fe.prototype.notifyPeriodDuration = fe.prototype.Ci, fe.prototype.notifySegments = fe.prototype.le, fe.prototype.notifyTimeRange = fe.prototype.Di, fe.prototype.getDelay = fe.prototype.Gj, fe.prototype.setDelay = fe.prototype.ph, fe.prototype.getSegmentAvailabilityDuration = fe.prototype.bf, fe.prototype.setSegmentAvailabilityDuration = fe.prototype.If, fe.prototype.setStatic = fe.prototype.$c, fe.prototype.setClockOffset = fe.prototype.Ri, fe.prototype.getPresentationStartTime = fe.prototype.Tj, fe.prototype.setDuration = fe.prototype.Ab, fe.prototype.setPresentationStartTime = fe.prototype.Si, fe.prototype.getMaxSegmentDuration = fe.prototype.Oj, fe.prototype.getDuration = fe.prototype.getDuration;
        function Sf(e, t, n, r) {
          var i = this;
          this.u = r, this.g = e, this.F = t, this.h = n, this.j = new Ve(), this.m = !1, this.l = 0, this.C = !1, this.H = this.G = 0, this.o = nE(this), this.B = !1, this.j.D(e, "waiting", function() {
            return vu(i);
          }), this.i = new Ae(function() {
            vu(i);
          }).Ea(this.h.gapJumpTimerTime);
        }
        Sf.prototype.release = function() {
          this.j && (this.j.release(), this.j = null), this.i != null && (this.i.stop(), this.i = null), this.o && (this.o.release(), this.o = null), this.g = this.F = this.u = null;
        }, Sf.prototype.zd = function() {
          this.B = !0, this.i && this.i.Ea(this.h.gapJumpTimerTime), vu(this);
        };
        function vu(e) {
          if (e.g.readyState != 0) {
            if (e.g.seeking) {
              if (!e.m) return;
            } else e.m = !1;
            if (!e.g.paused || e.g.currentTime == e.l && (e.g.autoplay || e.g.currentTime != e.l)) {
              var t;
              if (!(t = !e.o)) {
                t = e.o;
                var n = t.h, r = Cv(n), i = n.g.currentTime, o = Date.now() / 1e3;
                (t.g != i || t.m != r) && (t.l = o, t.g = i, t.m = r, t.i = !1), i = o - t.l, (r = i >= t.o && r && !t.i) && (t.j && t.j(t.g, i), t.i = !0, t.g = n.g.currentTime), t = !r;
              }
              t && (t = e.g.currentTime, n = e.g.buffered, r = bA(n, t, e.h.gapDetectionThreshold), r == null || r == 0 && !e.B || (i = n.start(r), (o = e.h.gapPadding) && (i = Math.ceil((i + o) * 100) / 100), i >= e.F.Ib() || i - t < 1e-3 || (r != 0 && n.end(r - 1), tE(e, i), t == e.l && (e.l = i), e.G++, e.u(new ee("gapjumped")))));
            }
          }
        }
        function tE(e, t) {
          e.C = !0, e.j.Aa(e.g, "seeked", function() {
            e.C = !1;
          }), e.g.currentTime = t;
        }
        function nE(e) {
          if (!e.h.stallEnabled) return null;
          var t = e.h.stallThreshold, n = e.h.stallSkip;
          return new Iv(new Mv(e.g), t, function() {
            var r;
            return D(function(i) {
              if (i.g == 1) return r = $r(e.g.buffered), r.length ? n ? (e.g.currentTime += n, i.A(2)) : x(i, e.g.play(), 3) : i.return();
              if (i.g != 2) {
                if (!e.g) return i.return();
                e.g.pause(), e.g.play();
              }
              e.H++, e.u(new ee("stalldetected")), q(i);
            });
          });
        }
        function Iv(e, t, n) {
          this.h = e, this.m = Cv(e), this.g = e.g.currentTime, this.l = Date.now() / 1e3, this.i = !1, this.o = t, this.j = n;
        }
        Iv.prototype.release = function() {
          this.h && this.h.release(), this.j = this.h = null;
        };
        function Mv(e) {
          var t = this;
          this.g = e, this.h = new Ve(), this.i = !1, this.h.D(this.g, "audiofocuspaused", function() {
            t.i = !0;
          }), this.h.D(this.g, "audiofocusgranted", function() {
            t.i = !1;
          }), this.h.D(this.g, "audiofocuslost", function() {
            t.i = !0;
          });
        }
        function Cv(e) {
          if (e.g.paused || e.g.playbackRate == 0 || e.i || e.g.buffered.length == 0) var t = !1;
          else e: {
            t = e.g.currentTime, e = m($r(e.g.buffered));
            for (var n = e.next(); !n.done; n = e.next()) if (n = n.value, !(t < n.start - 0.1 || t > n.end - 0.5)) {
              t = !0;
              break e;
            }
            t = !1;
          }
          return t;
        }
        Mv.prototype.release = function() {
          this.h && this.h.release(), this.h = null;
        };
        function es(e, t, n, r) {
          t == HTMLMediaElement.HAVE_NOTHING || e.readyState >= t ? r() : (t = rE.value().get(t), n.Aa(e, t, r));
        }
        var rE = new ct(function() {
          return /* @__PURE__ */ new Map([[HTMLMediaElement.HAVE_METADATA, "loadedmetadata"], [HTMLMediaElement.HAVE_CURRENT_DATA, "loadeddata"], [HTMLMediaElement.HAVE_FUTURE_DATA, "canplay"], [HTMLMediaElement.HAVE_ENOUGH_DATA, "canplaythrough"]]);
        });
        function kv(e, t, n, r) {
          var i = this;
          this.g = e, this.m = t, this.u = n, this.l = null, this.j = function() {
            return i.l == null && (i.l = r()), i.l;
          }, this.o = !1, this.h = new Ve(), this.i = new Lv(e), es(this.g, HTMLMediaElement.HAVE_METADATA, this.h, function() {
            Dv(i, i.j());
          });
        }
        kv.prototype.release = function() {
          this.h && (this.h.release(), this.h = null), this.i != null && (this.i.release(), this.i = null), this.m = function() {
          }, this.g = null;
        };
        function xf(e) {
          return e.o ? e.g.currentTime : e.j();
        }
        function Pv(e, t) {
          e.g.readyState > 0 ? bv(e.i, t) : es(e.g, HTMLMediaElement.HAVE_METADATA, e.h, function() {
            Dv(e, e.j());
          });
        }
        function Dv(e, t) {
          Math.abs(e.g.currentTime - t) < 1e-3 ? Rv(e) : (e.h.Aa(e.g, "seeking", function() {
            Rv(e);
          }), bv(e.i, e.g.currentTime && e.g.currentTime != 0 ? e.g.currentTime : t));
        }
        function Rv(e) {
          e.o = !0, e.h.D(e.g, "seeking", function() {
            return e.m();
          }), e.u(e.g.currentTime);
        }
        function Lv(e) {
          var t = this;
          this.g = e, this.m = 10, this.j = this.l = this.i = 0, this.h = new Ae(function() {
            t.i <= 0 || t.g.currentTime != t.l || t.g.currentTime === t.j ? t.h.stop() : (t.g.currentTime = t.j, t.i--);
          });
        }
        Lv.prototype.release = function() {
          this.h && (this.h.stop(), this.h = null), this.g = null;
        };
        function bv(e, t) {
          e.l = e.g.currentTime, e.j = t, e.i = e.m, e.g.currentTime = t, e.h.Ea(0.1);
        }
        function Nv(e) {
          this.g = e, this.i = !1, this.h = null, this.j = new Ve();
        }
        f = Nv.prototype, f.ready = function() {
          function e() {
            if (t.h == null || t.h == 0 && t.g.duration != 1 / 0) t.i = !0;
            else {
              var n = t.g.currentTime, r = null;
              if (typeof t.h == "number") r = t.h;
              else if (t.h instanceof Date) {
                var i = Ov(t);
                i !== null && (r = t.h.getTime() / 1e3 - i, r = jv(t, r));
              }
              r == null ? t.i = !0 : (r < 0 && (r = Math.max(0, n + r)), n != r ? (t.j.Aa(t.g, "seeking", function() {
                t.i = !0;
              }), t.g.currentTime = r) : t.i = !0);
            }
          }
          var t = this;
          es(this.g, HTMLMediaElement.HAVE_FUTURE_DATA, this.j, function() {
            e();
          });
        }, f.release = function() {
          this.j && (this.j.release(), this.j = null), this.g = null;
        }, f.Wf = function(e) {
          this.h = this.i ? this.h : e;
        }, f.Qd = function() {
          var e = this.i ? this.g.currentTime : this.h;
          return e instanceof Date && (e = e.getTime() / 1e3 - (Ov(this) || 0), e = jv(this, e)), e || 0;
        }, f.Kh = function() {
          return 0;
        }, f.Ih = function() {
          return 0;
        }, f.Jh = function() {
          return !1;
        }, f.Bi = function() {
        }, f.ni = function() {
          var e = sl(this.g.buffered);
          return e != null && e >= this.g.duration - 1;
        };
        function Ov(e) {
          return e.g.getStartDate && (e = e.g.getStartDate().getTime(), !isNaN(e)) ? e / 1e3 : null;
        }
        function jv(e, t) {
          return e = e.g.seekable, e.length > 0 && (t = Math.max(e.start(0), t), t = Math.min(e.end(e.length - 1), t)), t;
        }
        function Uv(e, t, n, r, i, o) {
          var s = this;
          this.h = e, this.g = t.presentationTimeline, this.l = n, this.u = i, this.o = null, this.i = new Sf(e, t.presentationTimeline, n, o), this.j = new kv(e, function() {
            e: {
              var u = s.i;
              u.m = !0, u.B = !1, u.i && u.i.Ea(u.h.gapJumpTimerTime), vu(u);
              var a = xf(s.j);
              if (u = Fv(s, a), !Ym() && Math.abs(u - a) > 1e-3) {
                a = !1;
                var l = Se().Oi();
                if (l) {
                  var c = Date.now() / 1e3;
                  (!s.o || s.o < c - l) && (s.o = c, a = !0);
                } else a = !0;
                if (a) {
                  Pv(s.j, u), u = void 0;
                  break e;
                }
              }
              s.u(), u = void 0;
            }
            return u;
          }, function(u) {
            var a = s.i;
            a.g.seeking && !a.m && (a.m = !0, a.l = u), a.i && a.i.Ea(a.h.gapJumpTimerTime), vu(a);
          }, function() {
            return _v(s, r);
          }), this.m = new Ae(function() {
            if (s.h.readyState != 0 && !s.h.paused) {
              var u = xf(s.j), a = s.g.$b(), l = s.g.Ib();
              l - a < 3 && (a = l - 3), u < a && (u = Fv(s, u), s.h.currentTime = u);
            }
          });
        }
        f = Uv.prototype, f.ready = function() {
          this.m.Ea(0.25);
        }, f.release = function() {
          this.j && (this.j.release(), this.j = null), this.i && (this.i.release(), this.i = null), this.m && (this.m.stop(), this.m = null), this.h = this.j = this.g = this.l = null, this.u = function() {
          };
        }, f.Wf = function(e) {
          Pv(this.j, _v(this, e));
        }, f.Qd = function() {
          var e = xf(this.j);
          return this.h.readyState > 0 && !this.h.paused ? Vv(this, e) : e;
        }, f.Kh = function() {
          return this.i.H;
        }, f.Ih = function() {
          return this.i.G;
        }, f.Jh = function() {
          return this.i.C;
        };
        function _v(e, t) {
          return t == null ? t = e.g.getDuration() < 1 / 0 ? e.g.$b() : e.g.Ib() : t instanceof Date ? t = t.getTime() / 1e3 - (e.g.m || e.g.i) : t < 0 && (t = e.g.Ib() + t), Bv(e, Vv(e, t));
        }
        f.Bi = function() {
          this.i.zd();
        }, f.ni = function() {
          if (this.g.U()) {
            var e = this.g.Jc(), t = sl(this.h.buffered);
            if (t != null && t >= e) return !0;
          }
          return !1;
        };
        function Bv(e, t) {
          var n = e.g.getDuration();
          return t >= n ? n - e.l.durationBackoff : t;
        }
        function Fv(e, t) {
          var n = e.l.rebufferingGoal, r = e.l.safeSeekOffset, i = e.g.$b(), o = e.g.Ib(), s = e.g.getDuration();
          o - i < 3 && (i = o - 3);
          var u = e.g.ae(n), a = e.g.ae(r);
          return n = e.g.ae(n + r), t >= s ? Bv(e, t) : t > o ? o - e.l.safeSeekEndOffset : t < i ? e.g.U() && e.l.returnToEndOfLiveWindowWhenOutside ? o - e.l.safeSeekEndOffset : of(e.h.buffered, a) ? a : n : t >= u || of(e.h.buffered, t) ? t : n;
        }
        function Vv(e, t) {
          var n = e.g.$b();
          return t < n ? n : (e = e.g.Ib(), t > e ? e : t);
        }
        function Ue(e) {
          this.g = e, this.m = null, this.i = 0, this.o = !1;
        }
        f = Ue.prototype, f.getNumReferences = function() {
          return this.g.length;
        }, f.getNumEvicted = function() {
          return this.i;
        }, f.release = function() {
          this.o || (this.g = [], this.m && this.m.stop(), this.m = null);
        }, f.yk = function() {
          this.o = !0;
        }, f.Hb = function(e) {
          for (var t = m(this.g), n = t.next(); !n.done; n = t.next()) e(n.value);
        };
        function Tr(e) {
          return e.g[0] || null;
        }
        f.find = function(e) {
          for (var t = this.g.length - 1, n = t; n >= 0; --n) {
            var r = this.g[n], i = n < t ? this.g[n + 1].startTime : r.endTime;
            if (e >= r.startTime && e < i) return n + this.i;
          }
          return this.g.length && e < this.g[0].startTime ? this.i : null;
        }, f.get = function(e) {
          return this.g.length == 0 ? null : (e -= this.i, e < 0 || e >= this.g.length ? null : this.g[e]);
        }, f.offset = function(e) {
          if (!this.o) for (var t = m(this.g), n = t.next(); !n.done; n = t.next()) n.value.offset(e);
        }, f.qf = function(e) {
          if (!this.o && e.length) {
            var t = Math.round(e[0].startTime * 1e3) / 1e3;
            this.g = this.g.filter(function(n) {
              return Math.round(n.startTime * 1e3) / 1e3 < t;
            }), this.g.push.apply(this.g, X(e));
          }
        }, f.je = function(e, t) {
          var n = this;
          e = e.filter(function(r) {
            return r.endTime > t && (n.g.length == 0 || r.endTime > n.g[0].startTime);
          }), this.qf(e), this.Ya(t);
        }, f.Ya = function(e) {
          if (!this.o) {
            var t = this.g.length;
            this.g = this.g.filter(function(n) {
              return n.endTime > e;
            }), this.i += t - this.g.length;
          }
        }, f.nd = function(e, t, n) {
          if (n = n === void 0 ? !1 : n, !this.o) {
            for (; this.g.length && this.g[this.g.length - 1].startTime >= t; ) this.g.pop();
            for (; this.g.length && this.g[0].endTime <= e; ) this.g.shift(), n || this.i++;
            this.g.length != 0 && (e = this.g[this.g.length - 1], t = new se(e.startTime, t, e.C, e.startByte, e.endByte, e.ea, e.timestampOffset, e.appendWindowStart, e.appendWindowEnd, e.g, e.tilesLayout, e.B, e.h, e.status, e.aesKey), t.mimeType = e.mimeType, t.codecs = e.codecs, t.i = e.i, this.g[this.g.length - 1] = t);
          }
        }, f.Of = function(e, t) {
          var n = this;
          this.o || (this.m && this.m.stop(), this.m = new Ae(function() {
            var r = t();
            r ? n.g.push.apply(n.g, X(r)) : (n.m.stop(), n.m = null);
          }), this.m.Ea(e));
        }, Ue.prototype[Symbol.iterator] = function() {
          return this.Xb(0);
        }, Ue.prototype.Xb = function(e, t, n) {
          t = t === void 0 ? !1 : t, n = n === void 0 ? !1 : n;
          var r = this.find(e);
          if (r == null) return null;
          var i = this.get(r);
          n ? r++ : r--;
          var o = -1;
          if (i && i.g.length > 0) for (var s = i.g.length - 1; s >= 0; --s) {
            var u = i.g[s];
            if (e >= u.startTime && e < u.endTime) {
              if (!t) {
                for (; s && !u.l; ) s--, u = i.g[s];
                if (!u.l) return Ir("No independent partial segment found!"), null;
              }
              n ? r-- : r++, o = s - 1;
              break;
            }
          }
          return new qn(this, r, o, n);
        }, Ue.prototype.Ve = function() {
          return -1;
        };
        function hl(e, t, n) {
          return e = new se(e, e + t, function() {
            return n;
          }, 0, null, null, e, e, e + t), new Ue([e]);
        }
        Y("shaka.media.SegmentIndex", Ue), Ue.forSingleSegment = hl, Ue.prototype.getIteratorForTime = Ue.prototype.Xb, Ue.prototype.updateEvery = Ue.prototype.Of, Ue.prototype.fit = Ue.prototype.nd, Ue.prototype.evict = Ue.prototype.Ya, Ue.prototype.mergeAndEvict = Ue.prototype.je, Ue.prototype.offset = Ue.prototype.offset, Ue.prototype.get = Ue.prototype.get, Ue.prototype.find = Ue.prototype.find, Ue.prototype.markImmutable = Ue.prototype.yk, Ue.prototype.release = Ue.prototype.release, Ue.prototype.getNumEvicted = Ue.prototype.getNumEvicted, Ue.prototype.getNumReferences = Ue.prototype.getNumReferences;
        function qn(e, t, n, r) {
          this.i = e, this.h = t, this.g = n, this.reverse = r;
        }
        f = qn.prototype, f.Kd = function(e) {
          this.reverse = e;
        }, f.wj = function() {
          return this.h;
        }, f.current = function() {
          var e = this.i.get(this.h);
          return e && e.g.length > 0 && e.m && this.g >= e.g.length && (this.h++, this.g = 0, e = this.i.get(this.h)), e && e.g.length > 0 ? e.g[this.g] : e;
        }, f.next = function() {
          var e = this.i.get(this.h);
          return this.reverse ? e && e.g.length > 0 ? (this.g--, this.g < 0 && (this.h--, this.g = (e = this.i.get(this.h)) && e.g.length > 0 ? e.g.length - 1 : 0)) : (this.h--, this.g = 0) : e && e.g.length > 0 ? (this.g++, e.m && this.g == e.g.length && (this.h++, this.g = 0)) : (this.h++, this.g = 0), e = this.current(), { value: e, done: !e };
        }, f.hh = function() {
          var e = this.current();
          if (e && e.Wc && !e.l && (e = this.i.get(this.h)) && e.g.length > 0) for (var t = e.g[this.g]; t.l && !(this.g <= 0); ) this.g--, t = e.g[this.g];
        }, Y("shaka.media.SegmentIterator", qn), qn.prototype.resetToLastIndependent = qn.prototype.hh, qn.prototype.next = qn.prototype.next, qn.prototype.current = qn.prototype.current, qn.prototype.currentPosition = qn.prototype.wj, qn.prototype.setReverse = qn.prototype.Kd;
        function pt() {
          Ue.call(this, []), this.h = [];
        }
        tt(pt, Ue), f = pt.prototype, f.clone = function() {
          var e = new pt();
          return e.h = this.h.slice(), e.i = this.i, e;
        }, f.release = function() {
          this.h = [];
        }, f.Hb = function(e) {
          for (var t = m(this.h), n = t.next(); !n.done; n = t.next()) n.value.Hb(e);
        };
        function iE(e, t) {
          e = m(e.h);
          for (var n = e.next(); !n.done; n = e.next()) t(n.value);
        }
        f.find = function(e) {
          for (var t = this.i, n = m(this.h), r = n.next(); !r.done; r = n.next()) {
            r = r.value;
            var i = r.find(e);
            if (i != null) return i + t;
            t += r.getNumEvicted() + r.getNumReferences();
          }
          return null;
        };
        function oE(e, t) {
          e = m(e.h);
          for (var n = e.next(); !n.done; n = e.next()) if (n = n.value, n.find(t) != null) return n.Ve();
          return -1;
        }
        f.get = function(e) {
          for (var t = this.i, n = m(this.h), r = n.next(); !r.done; r = n.next()) {
            r = r.value;
            var i = r.get(e - t);
            if (i) return i;
            i = r.getNumReferences(), t += r.getNumEvicted() + i;
          }
          return null;
        }, f.offset = function() {
        }, f.qf = function() {
        }, f.Ya = function(e) {
          if (this.h.length) {
            var t = this.h[0];
            t.Ya(e), t.getNumReferences() == 0 && (this.h.shift(), this.i += t.getNumEvicted(), t.release(), this.Ya(e));
          }
        }, f.je = function() {
        }, f.nd = function() {
        }, f.Of = function() {
        }, Y("shaka.media.MetaSegmentIndex", pt), pt.prototype.updateEvery = pt.prototype.Of, pt.prototype.fit = pt.prototype.nd, pt.prototype.mergeAndEvict = pt.prototype.je, pt.prototype.evict = pt.prototype.Ya, pt.prototype.merge = pt.prototype.qf, pt.prototype.offset = pt.prototype.offset, pt.prototype.get = pt.prototype.get, pt.prototype.find = pt.prototype.find, pt.prototype.forEachTopLevelReference = pt.prototype.Hb, pt.prototype.release = pt.prototype.release;
        function pl(e) {
          var t = this;
          this.g = e, this.j = !1, this.i = this.g.Ig(), this.h = new Ae(function() {
            t.g.isPaused() || t.g.Ak(t.i * 0.25);
          });
        }
        pl.prototype.release = function() {
          this.set(this.qd()), this.h && (this.h.stop(), this.h = null), this.g = null;
        }, pl.prototype.set = function(e) {
          this.i = e, Af(this);
        }, pl.prototype.qd = function() {
          return this.g.qd();
        };
        function Af(e) {
          e.h.stop();
          var t = e.j ? 0 : e.i;
          if (t >= 0) try {
            e.g.Ig() != t && e.g.Ti(t);
            return;
          } catch {
          }
          e.h.Ea(0.25), e.g.Ig() != 0 && e.g.Ti(0);
        }
        function Ef(e) {
          var t = this;
          this.j = e, this.h = new Ve(), this.g = /* @__PURE__ */ new Set(), this.i = new Ae(function() {
            Hv(t, !1);
          }).Cb(), e.paused || this.i.Ea(0.25), this.h.D(e, "playing", function() {
            t.i.Cb().Ea(0.25);
          }), this.h.D(e, "pause", function() {
            t.i.stop();
          }), this.h.D(e, "seeked", function() {
            t.i.Cb(), e.paused || t.i.Ea(0.25);
          });
        }
        Ef.prototype.release = function() {
          this.h && (this.h.release(), this.h = null), this.i.stop();
          for (var e = m(this.g), t = e.next(); !t.done; t = e.next()) t.value.release();
          this.g.clear();
        };
        function Hv(e, t) {
          var n = e.j.currentTime;
          e = m(e.g);
          for (var r = e.next(); !r.done; r = e.next()) r.value.j(n, t);
        }
        function gl(e) {
          Xe.call(this), this.g = /* @__PURE__ */ new Map(), this.h = e;
        }
        tt(gl, Xe), gl.prototype.release = function() {
          this.g.clear(), Xe.prototype.release.call(this);
        };
        function sE(e, t) {
          var n = e.g.get(t);
          return n || (n = { qe: [], lg: null, contentType: t }, e.g.set(t, n)), n;
        }
        function uE(e, t, n) {
          var r = sE(e, t.contentType);
          aE(e, r), e = { xd: t, position: n }, r = r.qe, t = r.findIndex(function(i) {
            return i.position >= n;
          }), t >= 0 ? r.splice(t, r[t].position == n ? 1 : 0, e) : r.push(e);
        }
        gl.prototype.j = function(e) {
          for (var t = m(this.g.values()), n = t.next(); !n.done; n = t.next()) {
            n = n.value;
            var r = n.lg;
            e: {
              for (var i = n.qe, o = i.length - 1; o >= 0; o--) {
                var s = i[o];
                if (s.position <= e) {
                  i = s.xd;
                  break e;
                }
              }
              i = null;
            }
            o = i && !(r === i || r && i && r.bandwidth == i.bandwidth && r.audioSamplingRate == i.audioSamplingRate && r.codecs == i.codecs && r.contentType == i.contentType && r.frameRate == i.frameRate && r.height == i.height && r.mimeType == i.mimeType && r.channelsCount == i.channelsCount && r.pixelAspectRatio == i.pixelAspectRatio && r.width == i.width), s = i && r && i.label && r.label && r.label !== i.label;
            var u = i && r && i.language && r.language && r.language !== i.language;
            r = i && r && i.roles && r.roles && !di(r.roles, i.roles), (s || u || r) && Gv(this, e, i.contentType) && (n.lg = i, r = new ee("audiotrackchange", /* @__PURE__ */ new Map([["quality", i], ["position", e]])), this.dispatchEvent(r)), o && Gv(this, e, i.contentType) && (n.lg = i, JSON.stringify(i), n = new ee("qualitychange", /* @__PURE__ */ new Map([["quality", i], ["position", e]])), this.dispatchEvent(n));
          }
        };
        function Gv(e, t, n) {
          return !!((e = e.h()[n]) && e.length > 0 && (n = e[e.length - 1].end, t >= e[0].start && t < n));
        }
        function aE(e, t) {
          if ((e = e.h()[t.contentType]) && e.length > 0) {
            var n = e[0].start, r = e[e.length - 1].end, i = t.qe;
            t.qe = i.filter(function(o, s) {
              return !(o.position <= n && s + 1 < i.length && i[s + 1].position <= n || o.position >= r);
            });
          } else t.qe = [];
        }
        function ml(e) {
          var t = { bandwidth: e.bandwidth || 0, audioSamplingRate: null, codecs: e.codecs, contentType: e.type, frameRate: null, height: null, mimeType: e.mimeType, channelsCount: null, pixelAspectRatio: null, width: null, label: null, roles: e.roles, language: null };
          return e.type == "video" && (t.frameRate = e.frameRate || null, t.height = e.height || null, t.pixelAspectRatio = e.pixelAspectRatio || null, t.width = e.width || null), e.type == "audio" && (t.audioSamplingRate = e.audioSamplingRate, t.channelsCount = e.channelsCount, t.label = e.label || null, t.language = e.language), t;
        }
        function yu(e) {
          Xe.call(this), this.h = /* @__PURE__ */ new Map(), this.i = e, this.g = null;
        }
        tt(yu, Xe), yu.prototype.release = function() {
          this.h.clear(), this.g && (this.g.stop(), this.g = null), Xe.prototype.release.call(this);
        };
        function If(e, t) {
          var n = t.schemeIdUri + "_" + t.id + "_" + (t.startTime.toFixed(1) + "_" + t.endTime.toFixed(1));
          e.h.has(n) || (e.h.set(n, t), t = new ee("regionadd", /* @__PURE__ */ new Map([["region", t]])), e.dispatchEvent(t), lE(e));
        }
        function lE(e) {
          e.g || (e.g = new Ae(function() {
            for (var t = e.i(), n = m(e.h), r = n.next(); !r.done; r = n.next()) {
              var i = m(r.value);
              r = i.next().value, i = i.next().value, i.endTime < t.start && (e.h.delete(r), r = new ee("regionremove", /* @__PURE__ */ new Map([["region", i]])), e.dispatchEvent(r));
            }
            !e.h.size && e.g && (e.g.stop(), e.g = null);
          }).Ea(2));
        }
        function vl(e, t, n, r, i) {
          function o(s, u) {
            return !(u.fastSwitching && s.Wc && s.ie);
          }
          this.m = e, this.i = t, this.l = n, this.g = /* @__PURE__ */ new Map(), this.j = /* @__PURE__ */ new Map(), this.h = null, this.o = r, this.u = i || o;
        }
        function cE(e, t) {
          e.l = t, e = m(e.g.values());
          for (var n = e.next(); !n.done; n = e.next()) n.value.g = t;
        }
        function wu(e, t, n) {
          if (n = n === void 0 ? !1 : n, !e.i.segmentIndex || (e.h || (e.h = e.i.segmentIndex.Xb(t, !0, e.o)), !e.h)) return Promise.resolve();
          for (n && e.h.next(), t = []; e.g.size < e.m && (n = e.h.next().value, !!n); ) {
            var r = !0;
            if (n.isPreload() && n.endByte != null && (r = !1), n.bc() == 2 && (r = !1), n.ac(!1) && (r = !1), r && n.ea && t.push(Kv(e, n.ea)), r && !e.g.has(n) && (r = new Cf(e.l), t.push(Xv(r, n, e.i)), e.g.set(n, r)), !e.u(n, e.i)) break;
          }
          return Mf(e), Promise.all(t);
        }
        function Kv(e, t) {
          if (!e.i.segmentIndex || t.ac() || Array.from(e.j.keys()).some(function(i) {
            return hu(i, t);
          })) return Promise.resolve();
          var n = new Cf(e.l), r = Xv(n, t, e.i);
          return e.j.set(t, n), r;
        }
        function Wv(e, t) {
          t = m(t.keys());
          for (var n = t.next(); !n.done; n = t.next()) (n = n.value) && Tu(e, n);
        }
        function Sr(e) {
          Wv(e, e.g), Wv(e, e.j), e.h = null;
        }
        vl.prototype.Ya = function(e, t) {
          t = t === void 0 ? !1 : t;
          for (var n = m(this.g.keys()), r = n.next(); !r.done; r = n.next()) r = r.value, e > r.endTime && Tu(this, r);
          t && Mf(this);
        }, vl.prototype.Kd = function(e) {
          this.o = e, this.h && this.h.Kd(e);
        };
        function Mf(e) {
          if (e.g.size) for (var t = Array.from(e.g.keys()), n = m(e.j.keys()), r = n.next(), i = {}; !r.done; i = { Ng: void 0 }, r = n.next()) i.Ng = r.value, t.some(/* @__PURE__ */ (function(o) {
            return function(s) {
              return hu(s.ea, o.Ng);
            };
          })(i)) || Tu(e, i.Ng);
        }
        function zv(e, t) {
          e.m = t;
          for (var n = Array.from(e.g.keys()); n.length > t; ) {
            var r = n.pop();
            r && Tu(e, r);
          }
          Mf(e);
        }
        function dE(e, t) {
          t && t !== e.i && (Sr(e), e.i = t);
        }
        function Tu(e, t) {
          var n = e.g;
          t instanceof pn && (n = e.j), e = n.get(t), n.delete(t), e && e.abort();
        }
        function Cf(e) {
          this.g = e, this.me = this.xh = null;
        }
        function Xv(e, t, n) {
          var r = new Uint8Array(0);
          return e.me = e.g(t, n, function(i) {
            return D(function(o) {
              if (o.g == 1) return r.byteLength > 0 ? r = St(r, i) : r = i, e.xh ? x(o, e.xh(r), 3) : o.A(0);
              r = new Uint8Array(0), q(o);
            });
          }), e.me.promise.catch(function(i) {
            return i instanceof b && i.code == 7001 ? Promise.resolve() : Promise.reject(i);
          });
        }
        Cf.prototype.abort = function() {
          this.me && this.me.abort();
        }, Y("shaka.config.CrossBoundaryStrategy", { KEEP: "keep", RESET: "reset", RESET_TO_ENCRYPTED: "reset_to_encrypted", RESET_ON_ENCRYPTION_CHANGE: "RESET_ON_ENCRYPTION_CHANGE" });
        function kf(e) {
          var t = xn(e), n = t.split("/")[0];
          return e = hn(e), { type: n, mimeType: t, codecs: e, language: null, height: null, width: null, channelCount: null, sampleRate: null, closedCaptions: /* @__PURE__ */ new Map(), ye: null, colorGamut: null, frameRate: null, timescale: null };
        }
        function fE(e, t, n) {
          function r(k) {
            A = k.name;
            var O = k.reader;
            O.skip(24);
            var L = O.Ca(), U = O.Ca();
            O.skip(50), h = String(L), d = String(U), k.reader.Ka() && Te(k);
          }
          function i(k) {
            var O = $m(k.reader);
            p = O.channelCount, g = O.sampleRate, o(k.name);
          }
          function o(k) {
            switch (k = k.toLowerCase(), k) {
              case "avc1":
              case "avc3":
                u.push(k + ".42E01E"), l = !0;
                break;
              case "hev1":
              case "hvc1":
                u.push(k + ".1.6.L93.90"), l = !0;
                break;
              case "dvh1":
              case "dvhe":
                u.push(k + ".05.04"), l = !0;
                break;
              case "vp09":
                u.push(k + ".00.10.08"), l = !0;
                break;
              case "av01":
                u.push(k + ".0.01M.08"), l = !0;
                break;
              case "mp4a":
                s.push("mp4a.40.2"), a = !0;
                break;
              case "ac-3":
              case "ec-3":
              case "ac-4":
              case "opus":
              case "flac":
                s.push(k), a = !0;
                break;
              case "apac":
                s.push("apac.31.00"), a = !0;
            }
          }
          var s = [], u = [], a = !1, l = !1, c = null, d = null, h = null, p = null, g = null, w = null, T = null, E = null, A;
          if (new qe().box("moov", Te).box("trak", Te).box("mdia", Te).S("mdhd", function(k) {
            k = il(k.reader, k.version), c = k.language, E = k.timescale;
          }).box("minf", Te).box("stbl", Te).S("stsd", qr).box("mp4a", function(k) {
            var O = $m(k.reader);
            p = O.channelCount, g = O.sampleRate, k.reader.Ka() ? Te(k) : o(k.name);
          }).box("esds", function(k) {
            k = k.reader;
            for (var O = "mp4a", L, U; k.Ka(); ) {
              L = k.Z();
              for (var j = k.Z(); j & 128; ) j = k.Z();
              if (L == 3) k.Ca(), j = k.Z(), j & 128 && k.Ca(), j & 64 && k.skip(k.Z()), j & 32 && k.Ca();
              else if (L == 4) U = k.Z(), k.skip(12);
              else if (L == 5) break;
            }
            U && (O += "." + lu(U), L == 5 && k.Ka() && (L = k.Z(), U = (L & 248) >> 3, U === 31 && k.Ka() && (U = 32 + ((L & 7) << 3) + ((k.Z() & 224) >> 5)), O += "." + U)), s.push(O), a = !0;
          }).box("ac-3", i).box("ec-3", i).box("ac-4", i).box("Opus", i).box("fLaC", i).box("apac", i).box("avc1", r).box("avc3", r).box(
            "hev1",
            r
          ).box("hvc1", r).box("dva1", r).box("dvav", r).box("dvh1", r).box("dvhe", r).box("vp09", r).box("av01", r).box("avcC", function(k) {
            var O = A || "";
            switch (A) {
              case "dvav":
                O = "avc3";
                break;
              case "dva1":
                O = "avc1";
            }
            k = k.reader, k.skip(1), k = O + "." + lu(k.Z()) + lu(k.Z()) + lu(k.Z()), u.push(k), l = !0;
          }).box("hvcC", function(k) {
            var O = A || "";
            switch (A) {
              case "dvh1":
                O = "hvc1";
                break;
              case "dvhe":
                O = "hev1";
            }
            var L = k.reader;
            L.skip(1), k = L.Z();
            var U = ["", "A", "B", "C"][k >> 6], j = k & 31, G = L.V(), H = (k & 32) >> 5 ? "H" : "L";
            k = [L.Z(), L.Z(), L.Z(), L.Z(), L.Z(), L.Z()], L = L.Z();
            for (var B = 0, F = 0; F < 32 && (B |= G & 1, F != 31); F++)
              B <<= 1, G >>= 1;
            for (O = O + ("." + U + j) + ("." + lu(B, !0)), O += "." + H + L, U = "", j = k.length; j--; ) ((H = k[j]) || U) && (U = "." + H.toString(16).toUpperCase() + U);
            O += U, u.push(O), l = !0;
          }).box("dvcC", function(k) {
            var O = A || "";
            switch (A) {
              case "hvc1":
                O = "dvh1";
                break;
              case "hev1":
                O = "dvhe";
                break;
              case "avc1":
                O = "dva1";
                break;
              case "avc3":
                O = "dvav";
                break;
              case "av01":
                O = "dav1";
            }
            var L = k.reader;
            L.skip(2), k = L.Z(), L = L.Z(), u.push(O + "." + En(k >> 1 & 127) + "." + En(k << 5 & 32 | L >> 3 & 31)), l = !0;
          }).box("dvvC", function(k) {
            var O = A || "";
            switch (A) {
              case "hvc1":
                O = "dvh1";
                break;
              case "hev1":
                O = "dvhe";
                break;
              case "avc1":
                O = "dva1";
                break;
              case "avc3":
                O = "dvav";
                break;
              case "av01":
                O = "dav1";
            }
            var L = k.reader;
            L.skip(2), k = L.Z(), L = L.Z(), u.push(O + "." + En(k >> 1 & 127) + "." + En(k << 5 & 32 | L >> 3 & 31)), l = !0;
          }).S("vpcC", function(k) {
            var O = A || "", L = k.reader;
            k = L.Z();
            var U = L.Z();
            L = L.Z() >> 4 & 15, u.push(O + "." + En(k) + "." + En(U) + "." + En(L)), l = !0;
          }).box("av1C", function(k) {
            var O = A || "";
            A === "dav1" && (O = "av01");
            var L = k.reader;
            L.skip(1), k = L.Z(), L = L.Z();
            var U = k >>> 5, j = (L & 64) >> 6;
            u.push(O + "." + U + "." + En(k & 31) + (L >>> 7 ? "H" : "M") + "." + En(U === 2 && j ? (L & 32) >> 5 ? 12 : 10 : j ? 10 : 8) + "." + ((L & 16) >> 4) + "." + ((L & 8) >> 3) + ((L & 4) >> 2) + (L & 3) + "." + En(1) + "." + En(1) + "." + En(1) + ".0"), l = !0;
          }).box("enca", Qa).box("encv", An).box("sinf", Te).box("frma", function(k) {
            k = nf(k.reader).codec, o(k);
          }).box("colr", function(k) {
            u = u.map(function(U) {
              if (U.startsWith("av01.")) {
                var j = k.reader, G = j.Pa(), H = j.Tb(4, !1), B = String.fromCharCode(H[0]);
                if (B += String.fromCharCode(H[1]), B += String.fromCharCode(H[2]), B += String.fromCharCode(H[3]), B === "nclx") {
                  H = j.Ca(), B = j.Ca();
                  var F = j.Ca(), W = j.Z() >> 7, z = U.split(".");
                  z.length == 10 && (z[6] = En(H), z[7] = En(B), z[8] = En(F), z[9] = String(W), U = z.join("."));
                }
                j.seek(G);
              }
              return U;
            });
            var O = pA(k.reader), L = O.colorGamut;
            w = O.ye, T = L;
          }).parse(e || t, !0, !0), !s.length && !u.length) return null;
          var I = a && !l, P = /* @__PURE__ */ new Map();
          if (l && !n) {
            n = new ur("video/mp4"), e && n.init(e);
            try {
              Id(n, t);
              for (var N = m(n.g.getStreams()), M = N.next(); !M.done; M = N.next()) {
                var R = M.value;
                P.set(R, R);
              }
            } catch {
            }
            n.g.clear();
          }
          return {
            type: I ? "audio" : "video",
            mimeType: I ? "audio/mp4" : "video/mp4",
            codecs: Pf(s.concat(u)).join(", "),
            language: c,
            height: d,
            width: h,
            channelCount: p,
            sampleRate: g,
            closedCaptions: P,
            ye: w,
            colorGamut: T,
            frameRate: null,
            timescale: E
          };
        }
        function Pf(e) {
          var t = /* @__PURE__ */ new Set(), n = [];
          e = m(e);
          for (var r = e.next(); !r.done; r = e.next()) {
            r = r.value;
            var i = yi(r);
            t.has(i) || (n.push(r), t.add(i));
          }
          return t = Ad("audio", n), r = Ad("video", n), e = Ad(xe, n), r = hE(r), t = t.concat(r).concat(e), n.length && !t.length ? n : t;
        }
        function hE(e) {
          if (e.length <= 1) return e;
          var t = e.find(function(n) {
            return n.startsWith("dvav.") || n.startsWith("dva1.") || n.startsWith("dvh1.") || n.startsWith("dvhe.") || n.startsWith("dav1.") || n.startsWith("dvc1.") || n.startsWith("dvi1.");
          });
          return t ? Qt('video/mp4; codecs="' + t + '"') ? [t] : e.filter(function(n) {
            return n != t;
          }) : e;
        }
        function pE(e) {
          var t = null;
          return new qe().box("moov", Te).box("trak", Te).box("mdia", Te).box("minf", Te).box("stbl", Te).S("stsd", qr).box("encv", An).box("enca", Qa).box("sinf", Te).box("schi", Te).S("tenc", function(n) {
            n = n.reader, n.Z(), n.Z(), n.Z(), n.Z(), n = n.Tb(16, !1), t = hi(n);
          }).parse(e, !0), t;
        }
        function Df(e, t, n) {
          var r, i, o, s, u;
          return D(function(a) {
            if (a.g == 1) return r = t, r.cryptoKey ? a.A(2) : x(a, r.fetchKey(), 3);
            if (i = r.iv, !i) for (i = pe(new ArrayBuffer(16)), o = r.firstMediaSequenceNumber + n, s = i.byteLength - 1; s >= 0; s--) i[s] = o & 255, o >>= 8;
            return t.blockCipherMode == "CBC" ? u = { name: "AES-CBC", iv: i } : u = { name: "AES-CTR", counter: i, length: 64 }, a.return(C.crypto.subtle.decrypt(u, r.cryptoKey, e));
          });
        }
        function ts(e, t, n) {
          var r, i, o, s, u, a, l;
          return D(function(c) {
            switch (c.g) {
              case 1:
                return r = ns(e), (i = gE.get(r)) ? c.return(i) : (o = 0, s = At([e], n), de(c, 2), s.method = "HEAD", x(c, t.request(o, s).promise, 4));
              case 4:
                u = c.h, i = u.headers["content-type"], ye(c, 3);
                break;
              case 2:
                if (a = he(c), !a || a.code != 1002 && a.code != 1001) {
                  c.A(3);
                  break;
                }
                return s.method = "GET", x(c, t.request(o, s).promise, 6);
              case 6:
                l = c.h, i = l.headers["content-type"];
              case 3:
                return c.return(i ? i.toLowerCase().split(";").shift() : "");
            }
          });
        }
        function ns(e) {
          return e = new yt(e).Sb.split("/").pop().split("."), e.length == 1 ? "" : e.pop().toLowerCase();
        }
        function Su(e, t, n, r, i) {
          return e = At(e, r, i), (t != 0 || n != null) && (e.headers.Range = n ? "bytes=" + t + "-" + n : "bytes=" + t + "-"), e;
        }
        var gE = (/* @__PURE__ */ new Map()).set("mp4", "video/mp4").set("m4v", "video/mp4").set("m4a", "audio/mp4").set("webm", "video/webm").set("weba", "audio/webm").set("mkv", "video/webm").set("ts", "video/mp2t").set("ogv", "video/ogg").set("ogg", "audio/ogg").set("mpg", "video/mpeg").set("mpeg", "video/mpeg").set("mov", "video/quicktime").set("m3u8", "application/x-mpegurl").set("mpd", "application/dash+xml").set("ism", "application/vnd.ms-sstr+xml").set("mp3", "audio/mpeg").set("aac", "audio/aac").set("flac", "audio/flac").set("wav", "audio/wav").set(
          "sbv",
          "text/x-subviewer"
        ).set("srt", "text/srt").set("vtt", "text/vtt").set("webvtt", "text/vtt").set("ttml", "application/ttml+xml").set("lrc", "application/x-subtitle-lrc").set("ssa", "text/x-ssa").set("ass", "text/x-ssa").set("jpeg", "image/jpeg").set("jpg", "image/jpeg").set("png", "image/png").set("svg", "image/svg+xml").set("webp", "image/webp").set("avif", "image/avif").set("html", "text/html").set("htm", "text/html");
        function qv(e, t) {
          var n = this;
          this.g = t, this.j = e, this.i = null, this.M = /* @__PURE__ */ new Map(), this.C = 1, this.B = this.o = null, this.W = 0, this.h = /* @__PURE__ */ new Map(), this.N = !1, this.X = null, this.F = !1, this.l = new Ho(function() {
            return mE(n);
          }), this.R = Date.now() / 1e3, this.m = /* @__PURE__ */ new Map(), this.T = { projection: null, hfov: null }, this.ba = 0, this.$ = 1 / 0, this.H = null, this.O = [], this.u = new Ae(function() {
            if (n.j && n.g) if (n.j.presentationTimeline.U()) {
              var r = n.j.presentationTimeline.$b(), i = n.j.presentationTimeline.Ib();
              i - r > 1 ? XA(n.g.Y, r, i) : mf(n.g.Y);
            } else mf(n.g.Y), n.u && n.u.stop();
            else n.u && n.u.stop();
          }), this.I = null, this.J = !1, this.K = new Ae(function() {
            var r = n.g.video;
            !r.ended && n.I && (n.J = !0, r.currentTime = n.I, n.I = null);
          }), this.G = new Ve();
        }
        f = qv.prototype, f.destroy = function() {
          return this.l.destroy();
        };
        function mE(e) {
          var t, n, r, i, o, s, u;
          return D(function(a) {
            if (a.g == 1) {
              for (e.u && e.u.stop(), e.u = null, e.K && e.K.stop(), e.K = null, e.G && (e.G.release(), e.G = null), t = [], n = m(e.h.values()), r = n.next(); !r.done; r = n.next()) i = r.value, Rr(i), t.push(Al(i)), i.ia && (Sr(i.ia), i.ia = null);
              for (o = m(e.m.values()), s = o.next(); !s.done; s = o.next()) u = s.value, Sr(u);
              return x(a, Promise.all(t), 2);
            }
            e.h.clear(), e.m.clear(), e.g = null, e.j = null, e.i = null, e.I = null, q(a);
          });
        }
        f.configure = function(e) {
          if (this.i = e, this.X = new ym({ maxAttempts: Math.max(e.retryParameters.maxAttempts, 2), baseDelay: e.retryParameters.baseDelay, backoffFactor: e.retryParameters.backoffFactor, fuzzFactor: e.retryParameters.fuzzFactor }, !0), e.disableAudioPrefetch) {
            var t = this.h.get("audio");
            t && t.ia && (Sr(t.ia), t.ia = null), t = m(this.m.keys());
            for (var n = t.next(); !n.done; n = t.next()) n = n.value, Sr(this.m.get(n)), this.m.delete(n);
          }
          for (e.disableTextPrefetch && (t = this.h.get(xe)) && t.ia && (Sr(t.ia), t.ia = null), e.disableVideoPrefetch && (t = this.h.get("video")) && t.ia && (Sr(t.ia), t.ia = null), t = m(this.h.keys()), n = t.next(); !n.done; n = t.next()) n = this.h.get(n.value), n.ia ? (zv(n.ia, e.segmentPrefetchLimit), e.segmentPrefetchLimit > 0 || (Sr(n.ia), n.ia = null)) : e.segmentPrefetchLimit > 0 && (n.ia = Lf(this, n.stream));
          e.disableAudioPrefetch || AE(this);
        };
        function vE(e, t, n) {
          e.j.presentationTimeline.U() || (e.ba = t, e.$ = n);
        }
        f.start = function(e) {
          var t = this;
          return D(function(n) {
            if (n.g == 1) return x(n, xE(t, e || /* @__PURE__ */ new Map()), 2);
            nt(t.l), t.N = !0, q(n);
          });
        };
        function yE(e, t) {
          var n, r, i, o, s, u;
          D(function(a) {
            switch (a.g) {
              case 1:
                return n = xt, e.W++, r = e.W, de(a, 2), x(a, mv(e.g.Y, n.Na), 4);
              case 4:
                ye(a, 3);
                break;
              case 2:
                i = he(a), e.g && e.g.onError(i);
              case 3:
                o = gt(t.mimeType, t.codecs), cl(e.g.Y, o, e.j.sequenceMode, t.external), s = e.g.Y.ba, (s.isTextVisible() || e.i.alwaysStreamText) && e.W == r && (u = wl(e, t), e.h.set(n.Na, u), Wt(e, u, 0)), q(a);
            }
          });
        }
        function wE(e) {
          var t = e.h.get(xe);
          t && (Rr(t), Al(t).catch(function() {
          }), e.H = e.h.get(xe), e.h.delete(xe), t.stream && t.stream.closeSegmentIndex && t.stream.closeSegmentIndex()), e.B = null;
        }
        function Yv(e, t) {
          for (var n = e.g.Ob() < 0, r = m(e.h.values()), i = r.next(); !i.done; i = r.next()) i = i.value, i.sa && i.sa.Kd(n), i.ia && i.ia.Kd(n);
          for (r = m(e.m.values()), i = r.next(); !i.done; i = r.next()) i.value.Kd(n);
          (n = e.h.get("video")) && (r = n.stream) && (t ? (t = r.trickModeVideo) && !n.Nc && (rs(e, t, !1, 0, !1), n.Nc = r) : (t = n.Nc) && (n.Nc = null, rs(e, t, !0, 0, !1)));
        }
        function $v(e, t, n, r, i, o) {
          n = n === void 0 ? !1 : n, r = r === void 0 ? 0 : r, i = i === void 0 ? !1 : i, o = o === void 0 ? !1 : o, e.o = t, e.N && (t.video && rs(e, t.video, n, r, i, o), t.audio && rs(e, t.audio, n, r, i, o));
        }
        function yl(e, t) {
          D(function(n) {
            if (n.g == 1) return e.H = null, e.B = t, e.N ? t.segmentIndex ? n.A(2) : x(n, t.createSegmentIndex(), 2) : n.return();
            rs(e, t, !0, 0, !1), q(n);
          });
        }
        function TE(e) {
          var t = e.h.get(xe);
          t && rs(e, t.stream, !0, 0, !0);
        }
        function SE(e, t) {
          for (var n = m(e.M.entries()), r = n.next(); !r.done; r = n.next()) {
            var i = m(r.value);
            r = i.next().value, i = i.next().value, r.includes(t.type) && (i(), e.M.delete(r));
          }
        }
        function rs(e, t, n, r, i, o) {
          var s = e.h.get(t.type);
          s || t.type != xe ? s && (s.Nc && (t.trickModeVideo ? (s.Nc = t, t = t.trickModeVideo) : s.Nc = null), s.stream != t || i) && (e.m.has(t) ? s.ia = e.m.get(t) : s.ia && dE(s.ia, t), t.type == xe && s.stream != t && (i = gt(t.mimeType, t.codecs), cl(e.g.Y, i, e.j.sequenceMode, t.external)), !e.m.has(s.stream) && s.stream.closeSegmentIndex && (s.Ja ? (i = "(" + s.type + ":" + s.stream.id + ")", e.M.has(i) || e.M.set(i, s.stream.closeSegmentIndex)) : s.stream.closeSegmentIndex()), i = s.stream.isAudioMuxedInVideo != t.isAudioMuxedInVideo, s.stream = t, s.sa = null, s.cg = !!o, t.dependencyStream ? s.Gc = wl(e, t.dependencyStream) : s.Gc = null, ey(e), i && (s.pb = null, s.uc = null, s.tc = null, t.isAudioMuxedInVideo && (t = null, s.type === "video" ? t = e.h.get("audio") : s.type === "audio" && (t = e.h.get("video")), t && (Al(t).catch(function() {
          }), t.pb = null, t.uc = null, t.tc = null, Rf(e, t), Jv(e, t).catch(function(u) {
            e.g && e.g.onError(u);
          })))), n ? s.Wb ? s.Nd = !0 : s.Ja ? (s.Ub = !0, s.jd = r, s.Nd = !0) : (Rr(s), Of(e, s, !0, r).catch(function(u) {
            e.g && e.g.onError(u);
          })) : s.Ja || s.qb || Wt(e, s, 0), Jv(e, s).catch(function(u) {
            e.g && e.g.onError(u);
          })) : yE(e, t);
        }
        function Jv(e, t) {
          var n, r, i;
          return D(function(o) {
            if (o.g == 1)
              return t.Va ? (n = t.stream, r = t.Va, n.segmentIndex ? o.A(2) : x(o, n.createSegmentIndex(), 2)) : o.return();
            if (o.g != 4) return i = n.dependencyStream, !i || i.segmentIndex ? o.A(4) : x(o, i.createSegmentIndex(), 4);
            if (t.Va != r || t.stream != n) return o.return();
            var s = e.g.Zb(), u = Ei(e.g.Y, t.type), a = t.stream.segmentIndex.find(t.Ia ? t.Ia.endTime : s), l = a == null ? null : t.stream.segmentIndex.get(a);
            a = l ? rf(l) : null, l && !a && (a = (l.endTime - l.getStartTime()) * (t.stream.bandwidth || e.o.bandwidth) / 8), a ? ((l = l.ea) && (a += (l.endByte ? l.endByte + 1 - l.startByte : null) || 0), l = e.g.getBandwidthEstimate(), s = a * 8 / l < (u || 0) - s - e.i.rebufferingGoal || t.Va.h.g > a) : s = !0, s && t.Va.abort(), q(o);
          });
        }
        f.Zc = function() {
          if (this.g) {
            for (var e = this.g.Zb(), t = m(this.h.keys()), n = t.next(); !n.done; n = t.next()) {
              var r = n.value;
              n = this.h.get(r);
              var i;
              if ((i = !this.J) && (i = this.g.Y, r == xe ? (i = i.h, i = i.g == null || i.h == null ? !1 : e >= i.g && e < i.h) : (i = Jo(i, r), i = of(i, e)), i = !i), i) {
                if (this.R = 0, n.ia && (n.ia.h = null), n.type === "audio") {
                  i = m(this.m.values());
                  for (var o = i.next(); !o.done; o = i.next()) o.value.h = null;
                }
                n.sa = null, (Ei(this.g.Y, r) != null || n.Ja) && Rf(this, n), n.Va && (n.Va.abort(), n.Va = null), r === xe && (r = this.g.Y, r.K && r.K.g.clear()), n.Zc = !0;
              }
              !this.J || n.Wb || n.Ja || n.qb || Wt(this, n, 0);
            }
            Au(this) && _f(this);
          }
        };
        function Rf(e, t) {
          t.Wb || t.Ub || (t.Ja ? (t.Ub = !0, t.jd = 0) : gf(e.g.Y, t.type) == null ? t.qb == null && Wt(e, t, 0) : (Rr(t), Of(e, t, !1, 0).catch(function(n) {
            e.g && e.g.onError(n);
          })));
        }
        function xE(e, t) {
          var n, r, i, o, s, u, a, l;
          return D(function(c) {
            if (c.g == 1) {
              if (!e.o) throw new b(2, 5, 5006);
              return n = Il(e, !0), r = e.g.Y, x(c, r.init(n, e.j.sequenceMode, e.j.type, e.j.ignoreManifestTimestampsInSegmentsMode), 2);
            }
            for (nt(e.l), e.updateDuration(), i = m(n.keys()), o = i.next(); !o.done; o = i.next()) s = o.value, u = n.get(s), e.h.has(s) || (a = wl(e, u), t.has(u.id) && (l = t.get(u.id), cE(l, function(d, h, p) {
              return xl(d, h, p || null, e.i.retryParameters, e.g.wc);
            }), a.ia = l), e.h.set(s, a), Wt(e, a, 0));
            ey(e), q(c);
          });
        }
        function wl(e, t) {
          var n = { stream: t, type: t.type, sa: null, ia: Lf(e, t), Ia: null, pb: null, mf: null, uc: null, tc: null, kf: null, lf: null, Nc: null, endOfStream: !1, Ja: !1, qb: null, Ub: !1, jd: 0, Nd: !1, Wb: !1, Zc: !0, cg: !1, bh: !1, ud: !1, Va: null, Gc: null };
          return t.dependencyStream && (n.Gc = wl(e, t.dependencyStream)), n;
        }
        function Lf(e, t) {
          if (t.type === "video" && e.i.disableVideoPrefetch || t.type === "audio" && e.i.disableAudioPrefetch || t.type === xe && (t.mimeType == "application/cea-608" || t.mimeType == "application/cea-708") || t.type === xe && e.i.disableTextPrefetch) return null;
          if (e.m.has(t)) return e.m.get(t);
          var n = e.h.get(t.type);
          return (n = n && n.ia) && t === n.i ? n : e.i.segmentPrefetchLimit > 0 ? new vl(e.i.segmentPrefetchLimit, t, function(r, i, o) {
            return xl(r, i, o || null, e.i.retryParameters, e.g.wc);
          }, e.g.Ob() < 0, e.g.cl) : null;
        }
        function AE(e) {
          for (var t = e.i.segmentPrefetchLimit, n = e.i.prefetchAudioLanguages, r = m(e.j.variants), i = r.next(), o = {}; !i.done; o = { Mb: void 0 }, i = r.next()) if (o.Mb = i.value, o.Mb.audio) if (e.m.has(o.Mb.audio)) {
            if (i = e.m.get(o.Mb.audio), zv(i, t), !(t > 0 && n.some(/* @__PURE__ */ (function(u) {
              return function(a) {
                return _o(u.Mb.audio.language, a);
              };
            })(o)))) {
              var s = e.h.get(o.Mb.audio.type);
              i !== (s && s.ia) && Sr(i), e.m.delete(o.Mb.audio);
            }
          } else t <= 0 || !n.some(/* @__PURE__ */ (function(u) {
            return function(a) {
              return _o(u.Mb.audio.language, a);
            };
          })(o)) || !(i = Lf(e, o.Mb.audio)) || (o.Mb.audio.segmentIndex || o.Mb.audio.createSegmentIndex(), e.m.set(o.Mb.audio, i));
        }
        f.updateDuration = function() {
          var e = Ym(), t = this.j.presentationTimeline.getDuration();
          t < 1 / 0 ? (e && (this.u && this.u.stop(), mf(this.g.Y)), this.g.Y.Ab(t)) : e ? (this.u && this.u.Ea(0.5), this.g.Y.Ab(1 / 0)) : this.g.Y.Ab(4294967296);
        };
        function EE(e, t) {
          var n, r, i, o, s, u, a, l, c;
          return D(function(d) {
            switch (d.g) {
              case 1:
                if (nt(e.l), n = xt, t.Ja || t.qb == null || t.Wb) return d.return();
                if (t.qb = null, !t.Ub) {
                  d.A(2);
                  break;
                }
                return x(d, Of(e, t, t.Nd, t.jd), 3);
              case 3:
                return d.return();
              case 2:
                if (SE(e, t), t.stream.segmentIndex) {
                  d.A(4);
                  break;
                }
                return r = t.stream, de(d, 5), x(d, t.stream.createSegmentIndex(), 7);
              case 7:
                ye(d, 6);
                break;
              case 5:
                return i = he(d), x(d, jf(e, t, i), 8);
              case 8:
                return d.return();
              case 6:
                if (r != t.stream) return r.closeSegmentIndex && r.closeSegmentIndex(), t.Ja || t.qb || Wt(e, t, 0), d.return();
              case 4:
                if (!t.Gc) {
                  d.A(9);
                  break;
                }
                if (t.Gc.stream.segmentIndex) {
                  d.A(9);
                  break;
                }
                return de(d, 11), x(d, t.Gc.stream.createSegmentIndex(), 13);
              case 13:
                ye(d, 9);
                break;
              case 11:
                he(d);
              case 9:
                de(d, 14), o = IE(e, t), o != null && (Wt(e, t, o), t.ud = !1), ye(d, 15);
                break;
              case 14:
                return s = he(d), x(d, jf(e, t, s), 16);
              case 16:
                return d.return();
              case 15:
                if (t.type === n.Na) return d.return();
                if (u = [], t.stream && !t.stream.isAudioMuxedInVideo && u.push(t), a = t.type === n.aa ? n.wa : n.aa, (l = e.h.get(a)) && l.stream && !l.stream.isAudioMuxedInVideo && u.push(l), !e.N || !u.every(function(h) {
                  return h.endOfStream;
                })) {
                  d.A(0);
                  break;
                }
                return x(d, e.g.Y.endOfStream(), 18);
              case 18:
                nt(e.l), c = e.g.Y.getDuration(), c != 0 && c < e.j.presentationTimeline.getDuration() && e.j.presentationTimeline.Ab(c), q(d);
            }
          });
        }
        function IE(e, t) {
          if (Nf(t)) return WA(e.g.Y, t.stream.originalId || ""), null;
          if (t.type == xe && zA(e.g.Y), t.stream.isAudioMuxedInVideo && t.type == "audio") return null;
          if (t.type != xe && Ai(e.g.Y)) return El(e, !0), null;
          var n = e.i.updateIntervalSeconds / Math.max(1, Math.abs(e.g.Ob()));
          if (!gv(e.g.Y) && t.type != xe) return n / 2;
          var r = e.g.Zb();
          if (t.type === "audio") for (var i = m(e.m.keys()), o = i.next(); !o.done; o = i.next()) o = e.m.get(o.value), o.Ya(r, !0), wu(o, r);
          i = t.Ia ? t.Ia.endTime : r;
          var s = GA(e.g.Y, t.type, r);
          o = Math.max(1, Math.max(
            e.i.rebufferingGoal,
            e.i.bufferingGoal
          ) * e.C);
          var u = e.j.presentationTimeline.getDuration() - i, a = Ei(e.g.Y, t.type);
          if (u < 1e-6 && a) return t.endOfStream = !0, t.type == "video" && (n = e.h.get(xe)) && Nf(n) && (n.endOfStream = !0), null;
          if (t.endOfStream = !1, s >= o) return n / 2;
          if (u = !t.sa, a = Tl(e, t, r, a), !a) return e = 1 / 0, (t = t.Ia) && (e = t.endTime - t.startTime), Math.min(e / 2, n);
          s = t.pb;
          var l = a.ea;
          s && l && hu(l, s) && (s.g = l.g), s = !1, u && t.cg && (s = !0, t.cg = !1), u = 1 / 0, l = Array.from(e.h.values()), l = m(l);
          for (var c = l.next(); !c.done; c = l.next()) c = c.value, Nf(c) || c.sa && !c.sa.current() || (u = Math.min(u, c.Ia ? c.Ia.endTime : r));
          return i >= u + e.j.presentationTimeline.h ? n : (t.ia && t.sa && !e.m.has(t.stream) && (t.ia.Ya(a.startTime + 1e-3), wu(t.ia, a.startTime).catch(function() {
          })), Au(e) && DE(e, t, a) || (ME(e, t, r, a, s).catch(function() {
          }), t.Gc && Qv(e, t.Gc, r, o)), null);
        }
        function Tl(e, t, n, r) {
          if (t.sa) {
            var i = t.sa.current();
            return i && t.Ia && Math.abs(t.Ia.startTime - i.startTime) < 1e-3 && (i = t.sa.next().value), i;
          }
          if (t.Ia || r) return i = t.Ia ? t.Ia.endTime : r, n = e.g.Ob() < 0, t.stream.segmentIndex && (t.sa = t.stream.segmentIndex.Xb(i, !1, n)), t.sa && t.sa.next().value;
          r = e.j.sequenceMode || Au(e) ? 0 : e.i.inaccurateManifestTolerance;
          var o = Math.max(n - r, 0), s = e.g.Y.getDuration();
          for (Math.abs(o - s) < 1 && (r = 1, o = Math.max(n - r, 0)), s = e.g.Ob() < 0, e = null, r && (t.stream.segmentIndex && (t.sa = t.stream.segmentIndex.Xb(
            o,
            !1,
            s
          )), e = t.sa && t.sa.next().value), e || (t.stream.segmentIndex && (t.sa = t.stream.segmentIndex.Xb(n, !1, s)), e = t.sa && t.sa.next().value); ((i = e) == null ? void 0 : i.bc()) === 2; ) r = n = void 0, e = (r = (n = t.sa) == null ? void 0 : n.next().value) != null ? r : null;
          return e;
        }
        function ME(e, t, n, r, i) {
          var o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N;
          return D(function(M) {
            switch (M.g) {
              case 1:
                if (o = xt, s = t.stream, u = t.sa, t.Ja = !0, de(M, 2), r.bc() == 2) throw new b(1, 1, 1011);
                return x(M, kE(e, t, r, i), 4);
              case 4:
                return nt(e.l), e.F ? M.return() : (a = s.mimeType == "video/mp4" || s.mimeType == "audio/mp4", l = C.ReadableStream, e.i.lowLatencyMode && e.j.isLowLatency && l && a && (e.j.type != "HLS" || r.o) ? (h = new Uint8Array(0), g = p = !1, T = function(R) {
                  var k, O, L;
                  return D(function(U) {
                    switch (U.g) {
                      case 1:
                        if (p || (g = !0, nt(e.l), e.F)) return U.return();
                        if (de(U, 2), h = St(h, R), k = !1, O = 0, new qe().box("mdat", function(j) {
                          O = j.size + j.start, k = !0;
                        }).parse(h, !1, !0), !k) {
                          U.A(4);
                          break;
                        }
                        return L = h.subarray(0, O), h = h.subarray(O), x(U, bf(e, t, n, s, r, L, !0, i), 5);
                      case 5:
                        t.ia && t.sa && wu(t.ia, r.startTime, !0);
                      case 4:
                        ye(U, 0);
                        break;
                      case 2:
                        w = he(U), q(U);
                    }
                  });
                }, x(M, xu(e, t, r, T), 9)) : (c = xu(e, t, r), x(M, c, 7)));
              case 7:
                return d = M.h, nt(e.l), e.F ? M.return() : (nt(e.l), t.Ub ? (t.Ja = !1, Wt(e, t, 0), M.return()) : x(M, bf(e, t, n, s, r, d, !1, i), 6));
              case 9:
                if (E = M.h, w) throw w;
                if (g) {
                  M.A(10);
                  break;
                }
                return p = !0, nt(e.l), e.F ? M.return() : t.Ub ? (t.Ja = !1, Wt(e, t, 0), M.return()) : x(M, bf(e, t, n, s, r, E, !1, i), 10);
              case 10:
                t.ia && t.sa && wu(t.ia, r.startTime, !0);
              case 6:
                if (nt(e.l), e.F) return M.return();
                t.Ia = r, u.next(), t.Ja = !1, t.bh = !1, A = e.g.Y.Hc(), I = A[t.type], JSON.stringify(I), t.Ub || (P = null, t.type === o.wa ? P = e.h.get(o.aa) : t.type === o.aa && (P = e.h.get(o.wa)), P && P.type == o.aa ? e.g.zd(r, t.stream, P.stream.isAudioMuxedInVideo, !1) : e.g.zd(r, t.stream, t.stream.codecs.includes(","), !1)), Rr(t), Wt(e, t, 0), ye(
                  M,
                  0
                );
                break;
              case 2:
                if (N = he(M), nt(e.l, N), e.F) return M.return();
                if (t.Ja = !1, N.code == 7001) t.Ja = !1, Rr(t), Wt(e, t, 0), M.A(0);
                else if (t.type == o.Na && e.i.ignoreTextStreamFailures) e.h.delete(o.Na), M.A(0);
                else
                  return N.code == 3017 ? x(M, CE(e, t, N), 0) : (t.ud = !0, N.category == 1 && t.ia && Tu(t.ia, r), N.severity = 2, x(M, jf(e, t, N), 0));
            }
          });
        }
        function Qv(e, t, n, r) {
          var i, o, s, u, a, l, c, d, h, p, g, w, T;
          return D(function(E) {
            switch (E.g) {
              case 1:
                for (i = xt, o = t.stream, a = (u = (s = o.segmentIndex) && s.Xb(n)) && u.next().value; a && e.O.includes(a.startTime); ) a = u && u.next().value;
                if (!a) {
                  E.A(0);
                  break;
                }
                if (l = a.ea, !l || hu(l, t.pb)) {
                  E.A(3);
                  break;
                }
                return t.pb = l, de(E, 4), x(E, xu(e, t, l), 6);
              case 6:
                if (c = E.h, !e.g) return E.return();
                var A = e.g.Y;
                A.C && Ca(A.C, c, 0, o), e.O = [], ye(E, 3);
                break;
              case 4:
                throw d = he(E), t.pb = null, d;
              case 3:
                if (t.Ia && t.Ia == a) {
                  E.A(0);
                  break;
                }
                return t.Ia = a, de(E, 8), x(E, xu(
                  e,
                  t,
                  a
                ), 10);
              case 10:
                if (h = E.h, !e.g) return E.return();
                A = e.g.Y, A.C && Ca(A.C, h, 0, o), e.O.push(a.startTime), ye(E, 9);
                break;
              case 8:
                throw p = he(E), t.Ia = null, p;
              case 9:
                if (!e.g) return E.return();
                if (t.Ub || (g = null, t.type === i.wa ? g = e.h.get(i.aa) : t.type === i.aa && (g = e.h.get(i.wa)), g && g.type == i.aa ? e.g.zd(a, t.stream, g.stream.isAudioMuxedInVideo, !0) : e.g.zd(a, t.stream, t.stream.codecs.includes(","), !0)), w = Math.max.apply(Math, [0].concat(X(e.O))), T = e.g.Zb(), T + r > w) return x(E, Qv(e, t, a.startTime, r), 0);
                E.A(0);
            }
          });
        }
        function CE(e, t, n) {
          var r, i, o, s, u, a, l;
          return D(function(c) {
            switch (c.g) {
              case 1:
                if (r = Array.from(e.h.values()), r.some(function(d) {
                  return d != t && d.bh;
                })) {
                  c.A(2);
                  break;
                }
                if (e.i.avoidEvictionOnQuotaExceededError)
                  return i = Uf(e, n), e.g.disableStream(t.stream, i) || Wt(e, t, 4), c.return();
                if (o = Math.round(100 * e.C), o > 20) {
                  e.C -= 0.2, c.A(3);
                  break;
                }
                if (o > 4) {
                  e.C -= 0.04, c.A(3);
                  break;
                }
                if (s = Uf(e, n), u = e.g.disableStream(t.stream, s), !u) {
                  t.ud = !0, e.F = !0, e.g.onError(n), c.A(5);
                  break;
                }
                return e.C = 1, a = e.g.Zb(), x(
                  c,
                  Sl(e, t, a),
                  5
                );
              case 5:
                return c.return();
              case 3:
                return t.bh = !0, l = e.g.Zb(), x(c, Sl(e, t, l), 2);
              case 2:
                Wt(e, t, 4), q(c);
            }
          });
        }
        function kE(e, t, n, r) {
          var i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I;
          return D(function(P) {
            switch (P.g) {
              case 1:
                if (i = xt, o = t.Ia == null, s = [], u = Math.max(0, Math.max(n.appendWindowStart, e.ba) - 0.1), a = Math.min(n.appendWindowEnd, e.$) + 0.1, l = n.codecs || t.stream.codecs, c = yi(l), d = xn(n.mimeType || t.stream.mimeType), h = n.timestampOffset, h == t.mf && u == t.uc && a == t.tc && c == t.kf && d == t.lf) {
                  P.A(2);
                  break;
                }
                if (p = t.kf && t.lf && ZA(e.g.Y, t.type, d, l, Il(e)), !p) {
                  P.A(3);
                  break;
                }
                if (g = null, t.type === i.wa ? g = e.h.get(i.aa) : t.type === i.aa && (g = e.h.get(i.wa)), !g) {
                  P.A(3);
                  break;
                }
                return x(P, Al(g).catch(function() {
                }), 5);
              case 5:
                g.pb = null, g.uc = null, g.tc = null, Rf(e, g);
              case 3:
                return x(P, Zv(e, t, h, u, a, n, c, d), 2);
              case 2:
                return hu(n.ea, t.pb) || (t.pb = n.ea, n.l && n.ea && (w = xu(e, t, n.ea), T = function() {
                  var N, M, R, k, O, L, U, j, G, H, B;
                  return D(function(F) {
                    switch (F.g) {
                      case 1:
                        return de(F, 2), x(F, w, 4);
                      case 4:
                        return N = F.h, nt(e.l), M = null, R = /* @__PURE__ */ new Map(), k = { projection: null, hfov: null }, t.stream && (O = t.stream.videoLayout) && (L = O.split("/"), L.includes("PROJ-RECT") ? k.projection = "rect" : L.includes("PROJ-EQUI") ? k.projection = "equi" : L.includes("PROJ-HEQU") ? k.projection = "hequ" : L.includes("PROJ-PRIM") ? k.projection = "prim" : L.includes("PROJ-AIV") && (k.projection = "hequ")), U = new qe(), U.box("moov", Te).box("trak", Te).box("mdia", Te).S("mdhd", function(W) {
                          M = il(W.reader, W.version).timescale;
                        }).S("hdlr", function(W) {
                          switch (W = W.reader, W.skip(4), W = W.Tb(4, !1), String.fromCharCode(W[0], W[1], W[2], W[3])) {
                            case "soun":
                              R.set(i.aa, M);
                              break;
                            case "vide":
                              R.set(i.wa, M);
                          }
                          M = null;
                        }), t.type !== i.wa || k.projection || U.box("minf", Te).box("stbl", Te).S("stsd", qr).box(
                          "encv",
                          An
                        ).box("avc1", An).box("avc3", An).box("hev1", An).box("hvc1", An).box("dvav", An).box("dva1", An).box("dvh1", An).box("dvhe", An).box("dvc1", An).box("dvi1", An).box("vexu", Te).box("proj", Te).S("prji", function(W) {
                          W = W.reader.Ed(), k.projection = W;
                        }).box("hfov", function(W) {
                          W = W.reader.V() / 1e3, k.hfov = W;
                        }), U.parse(N, !0, !0), t.type === i.wa && PE(e, k), R.has(t.type) ? n.ea.timescale = R.get(t.type) : M != null && (n.ea.timescale = M), j = t.stream.segmentIndex, j instanceof pt && (G = oE(j, n.startTime)), H = t.stream.closedCaptions && t.stream.closedCaptions.size > 0, x(F, e.g.Rh(t.type, N), 5);
                      case 5:
                        return x(F, dl(e.g.Y, t.type, N, null, t.stream, H, t.Zc, r, !1, !1, G), 6);
                      case 6:
                        ye(F, 0);
                        break;
                      case 2:
                        throw B = he(F), t.pb = null, B;
                    }
                  });
                }, E = n.startTime, o && (A = Ei(e.g.Y, t.type), A != null && (E = A)), e.g.Dk(E, n.ea), s.push(T()))), I = t.Ia ? t.Ia.i : -1, n.i != I && s.push(yv(e.g.Y, t.type, n.startTime)), x(P, Promise.all(s), 0);
            }
          });
        }
        function Zv(e, t, n, r, i, o, s, u) {
          var a, l, c, d, h;
          return D(function(p) {
            switch (p.g) {
              case 1:
                if (a = xt, l = Il(e), de(p, 2), t.uc = r, t.tc = i, s && (t.kf = s), u && (t.lf = u), t.mf = n, c = e.j.sequenceMode || e.j.type == "HLS", d = null, t.type === a.wa ? d = e.h.get(a.aa) : t.type === a.aa && (d = e.h.get(a.wa)), !(d && d.stream && d.stream.isAudioMuxedInVideo)) {
                  p.A(4);
                  break;
                }
                return x(p, vv(e.g.Y, d.type, n, r, i, c, d.stream.mimeType, d.stream.codecs, l), 4);
              case 4:
                return x(p, vv(e.g.Y, t.type, n, r, i, c, o.mimeType || t.stream.mimeType, o.codecs || t.stream.codecs, l), 6);
              case 6:
                ye(
                  p,
                  0
                );
                break;
              case 2:
                throw h = he(p), t.uc = null, t.tc = null, t.kf = null, t.lf = null, t.mf = null, h;
            }
          });
        }
        function bf(e, t, n, r, i, o, s, u) {
          s = s === void 0 ? !1 : s, u = u === void 0 ? !1 : u;
          var a, l, c, d;
          return D(function(h) {
            switch (h.g) {
              case 1:
                return a = r.closedCaptions && r.closedCaptions.size > 0, e.i.shouldFixTimestampOffset && (l = r.mimeType == "video/mp4" || r.mimeType == "audio/mp4", c = null, i.ea && (c = i.ea.timescale), l && c && r.type === "video" && e.j.type == "DASH" && new qe().box("moof", Te).box("traf", Te).S("tfdt", function(p) {
                  var g, w, T, E, A, I;
                  return D(function(P) {
                    return g = rl(p.reader, p.version), w = g.baseMediaDecodeTime, w ? (T = -w / c, E = Number(t.mf) || 0, E < T ? (A = t.uc, I = t.tc, x(P, Zv(e, t, T, A, I, i), 0)) : P.A(0)) : P.return();
                  });
                }).parse(o, !1, s)), x(h, Sl(e, t, n), 2);
              case 2:
                return nt(e.l), d = t.Zc, t.Zc = !1, x(h, e.g.Rh(t.type, o), 3);
              case 3:
                return x(h, dl(e.g.Y, t.type, o, i, r, a, d, u, s), 4);
              case 4:
                nt(e.l), q(h);
            }
          });
        }
        function Sl(e, t, n) {
          var r, i, o, s, u, a, l, c, d;
          return D(function(h) {
            if (h.g == 1)
              return e.H == t && (e.H = null), r = t.stream.segmentIndex, r instanceof pt && (r.Ya(e.j.presentationTimeline.Jb()), i = [], iE(r, function(p) {
                i.push(p.Ve());
              })), o = Math.max(e.i.bufferBehind * e.C, e.j.presentationTimeline.h), s = gf(e.g.Y, t.type), s == null ? h.return() : (u = n - s, a = e.i.evictionGoal, l = e.j.presentationTimeline.$b(), c = e.j.presentationTimeline.Ib(), d = u - o, c - l > a && (d = Math.max(u - o, l - a - s)), d <= a ? h.return() : x(h, e.g.Y.remove(t.type, s, s + d, i), 2));
            if (h.g != 4) return nt(e.l), e.H ? x(h, Sl(e, e.H, n), 4) : h.A(0);
            nt(e.l), q(h);
          });
        }
        function Nf(e) {
          return e && e.type == xe && (e.stream.mimeType == "application/cea-608" || e.stream.mimeType == "application/cea-708");
        }
        function xu(e, t, n, r) {
          var i, o, s, u, a;
          return D(function(l) {
            switch (l.g) {
              case 1:
                if (i = n.ac()) return l.return(i);
                if (o = null, t.ia) {
                  var c = t.ia, d = c.g;
                  n instanceof pn && (d = c.j), d.has(n) ? (c = d.get(n), r && (c.xh = r), o = c.me) : o = null;
                }
                return o || (o = xl(n, t.stream, r || null, e.i.retryParameters, e.g.wc)), s = 0, t.sa && (s = t.sa.h), t.Va = o, x(l, o.promise, 2);
              case 2:
                if (u = l.h, t.Va = null, a = u.data, !n.aesKey) {
                  l.A(3);
                  break;
                }
                return x(l, Df(a, n.aesKey, s), 4);
              case 4:
                a = l.h;
              case 3:
                return l.return(a);
            }
          });
        }
        function xl(e, t, n, r, i, o) {
          o = o === void 0 ? !1 : o;
          var s = e instanceof se ? e : void 0, u = s ? 1 : 0;
          return e = Su(e.P(), e.startByte, e.endByte, r, n), e.contentType = t.type, i.request(Xn, e, { type: u, stream: t, segment: s, isPreload: o });
        }
        function Of(e, t, n, r) {
          var i, o;
          return D(function(s) {
            if (s.g == 1) return t.Ub = !1, t.Nd = !1, t.jd = 0, t.Wb = !0, t.Ia = null, t.sa = null, t.ia && !e.m.has(t.stream) && Sr(t.ia), r ? (i = e.g.Zb(), o = e.g.Y.getDuration(), x(s, e.g.Y.remove(t.type, i + r, o), 3)) : x(s, mv(e.g.Y, t.type), 4);
            if (s.g != 3) return nt(e.l), n ? x(s, e.g.Y.flush(t.type), 3) : s.A(3);
            nt(e.l), t.Wb = !1, t.endOfStream = !1, t.Ja || t.qb || Wt(e, t, 0), q(s);
          });
        }
        function Wt(e, t, n) {
          var r = t.type;
          (r != xe || e.h.has(r)) && (t.qb = new nu(function() {
            var i;
            return D(function(o) {
              if (o.g == 1) return de(o, 2), x(o, EE(e, t), 4);
              if (o.g != 2) return ye(o, 0);
              i = he(o), e.g && e.g.onError(i), q(o);
            });
          }).ka(n));
        }
        function Rr(e) {
          e.qb != null && (e.qb.stop(), e.qb = null);
        }
        function Al(e) {
          return D(function(t) {
            return e.Va ? x(t, e.Va.abort(), 0) : t.A(0);
          });
        }
        function jf(e, t, n) {
          var r, i, o, s, u;
          return D(function(a) {
            switch (a.g) {
              case 1:
                return n.code == 3024 ? (t.Ja = !1, Rr(t), Wt(e, t, 0), a.return()) : x(a, wm(e.X), 2);
              case 2:
                if (nt(e.l), n.category === 1 && n.code != 1003) {
                  if (t.Nc) return Yv(e, !1), a.return();
                  r = Uf(e, n), n.handled = e.g.disableStream(t.stream, r), n.handled && (n.severity = 1);
                }
                if (n.handled || n.code != 1011) {
                  a.A(3);
                  break;
                }
                for (i = e.g.Zb(), o = Ei(e.g.Y, t.type), s = Tl(e, t, i, o); ((u = s) == null ? void 0 : u.bc()) === 2; ) t.Ia = s, s = Tl(e, t, i, o);
                if (!s) {
                  a.A(3);
                  break;
                }
                return x(
                  a,
                  yv(e.g.Y, t.type, s.startTime),
                  5
                );
              case 5:
                return t.Ja = !1, t.ud = !1, Rr(t), Wt(e, t, 0), a.return();
              case 3:
                (!n.handled || n.code != 1011) && e.g.onError(n), n.handled || e.i.failureCallback(n), q(a);
            }
          });
        }
        function Uf(e, t) {
          return e.i.maxDisabledTime === 0 && t.code == 1011 ? 1 : e.i.maxDisabledTime;
        }
        function El(e, t) {
          t = t === void 0 ? !1 : t;
          var n, r, i, o, s, u;
          return D(function(a) {
            if (a.g == 1) {
              if (n = Date.now() / 1e3, r = e.i.minTimeBetweenRecoveries, !t) {
                if (!e.i.allowMediaSourceRecoveries || n - e.R < r) return a.return(!1);
                e.R = n;
              }
              return i = xt, (o = e.h.get(i.aa)) && (Rr(o), o.Va && (o.Va.abort(), o.Va = null), o.pb = null, o.uc = null, o.tc = null, o.Ja = !1, o.Ub = !1, o.jd = 0, o.Nd = !1, o.Wb = !1, o.sa && o.sa.hh()), (s = e.h.get(i.wa)) && (Rr(s), s.Va && (s.Va.abort(), s.Va = null), s.pb = null, s.uc = null, s.tc = null, s.Ja = !1, s.Ub = !1, s.jd = 0, s.Nd = !1, s.Wb = !1, s.sa && s.sa.hh()), u = e.g.video.paused, x(a, Sv(e.g.Y, Il(e)), 2);
            }
            return !s || s.Wb || s.Ja || s.qb || Wt(e, s, 0), !o || o.Wb || o.Ja || o.qb || Wt(e, o, 0), u || e.g.video.play(), a.return(!0);
          });
        }
        function PE(e, t) {
          if (e.T.projection != t.projection || e.T.hfov != t.hfov) {
            if (t.projection != null || t.hfov != null) {
              var n = (/* @__PURE__ */ new Map()).set("detail", t);
              n = new ee("spatialvideoinfo", n);
            } else n = new ee("nospatialvideoinfo");
            n.cancelable = !0, e.g.onEvent(n), e.T = t;
          }
        }
        function Au(e) {
          if (e.i.crossBoundaryStrategy !== "keep") return !0;
          var t = Se();
          if (t.Bb()) {
            if (!t.Kf()) {
              for (t = m(e.h.keys()), n = t.next(); !n.done; n = t.next()) if (n = e.h.get(n.value), n.type !== xt.Na && (n = n.stream) && n.fullMimeTypes && n.fullMimeTypes.size > 1) {
                for (e = /* @__PURE__ */ new Set(), t = m(n.fullMimeTypes), n = t.next(); !n.done; n = t.next()) e.add(Qs(n.value));
                return e.size > 1;
              }
            }
          } else {
            t = m(e.h.keys());
            for (var n = t.next(); !n.done; n = t.next()) if (n = e.h.get(n.value), n.type !== xt.Na && (n = n.stream) && n.fullMimeTypes && n.fullMimeTypes.size > 1) return !0;
          }
          return !1;
        }
        function ey(e) {
          e.G.Qa(), Au(e) && (e.G.D(e.g.video, "waiting", function() {
            return _f(e);
          }), e.G.D(e.g.video, "timeupdate", function() {
            return _f(e);
          }));
        }
        function _f(e) {
          if (Au(e)) {
            e.K.stop();
            var t = e.g.Zb(), n = e.h.get("video") || e.h.get("audio");
            n && (n = n.pb) && n.g !== null && (t = n.g - t, t < 0 || t > 1 || (e.I = n.g + 0.1, e.K.ka(t)));
          }
        }
        function DE(e, t, n) {
          if (t.type === xe) return !1;
          var r = t.pb;
          if (!r) return !1;
          var i = n.ea;
          if (n = r.g !== i.g, e.i.crossBoundaryStrategy === "reset_to_encrypted" && (r.encrypted || i.encrypted || (n = !1), r.encrypted && (e.i.crossBoundaryStrategy = "keep")), e.i.crossBoundaryStrategy === "RESET_ON_ENCRYPTION_CHANGE" && r.encrypted == i.encrypted && (n = !1), e.i.crossBoundaryStrategy === "keep" && r.mimeType && i.mimeType) {
            var o = Kt(hn(r.mimeType)), s = Kt(hn(r.mimeType));
            r.mimeType == i.mimeType && o == s && (n = !1);
          }
          return (e.h.get("video") || e.h.get("audio")) === t && n && (e.J || t.Zc) && (e.J = !1, El(e, !0).then(function() {
            var u = (/* @__PURE__ */ new Map()).set("oldEncrypted", r.encrypted).set("newEncrypted", i.encrypted);
            e.g.onEvent(new ee("boundarycrossed", u));
          })), n;
        }
        function Il(e, t) {
          function n(o) {
            if (o.fullMimeTypes && o.fullMimeTypes.size > 1 && e.h.has(o.type)) {
              var s = e.h.get(o.type), u = Ei(e.g.Y, s.type), a = e.g.Zb();
              (s = Tl(e, s, a, u)) && s.codecs && s.mimeType && (o.codecs = s.codecs, o.mimeType = s.mimeType);
            }
          }
          t = t === void 0 ? !1 : t;
          var r = /* @__PURE__ */ new Map(), i = e.o.audio;
          return i && (n(i), r.set("audio", i)), (i = e.o.video) && (n(i), r.set("video", i)), t && e.B && r.set(xe, e.B), r;
        }
        function Ml() {
        }
        function Bf(e, t, n, r, i) {
          var o = i in r, s = o ? n.constructor == Object && Object.keys(r).length == 0 : n.constructor == Object && Object.keys(n).length == 0, u = o || s, a = !0, l;
          for (l in t) {
            var c = i + "." + l, d = o ? r[i] : n[l];
            u || l in n ? t[l] === void 0 ? d === void 0 || u ? delete e[l] : e[l] = ar(d) : s ? e[l] = t[l] : d.constructor == Object && t[l] && t[l].constructor == Object ? (e[l] || (e[l] = ar(d)), c = Bf(e[l], t[l], d, r, c), a = a && c) : typeof t[l] != typeof d || t[l] == null || typeof t[l] != "function" && t[l].constructor != d.constructor ? (Ir("Invalid config, wrong type for " + c), a = !1) : typeof n[l] == "function" && n[l].length != t[l].length ? (De("Unexpected number of arguments for " + c), e[l] = t[l]) : e[l] = Array.isArray(e[l]) ? t[l].slice() : t[l] : (Ir("Invalid config, unrecognized key " + c), a = !1);
          }
          return a;
        }
        function Cl(e, t) {
          for (var n = {}, r = n, i = 0, o = 0; i = e.indexOf(".", i), !(i < 0); )
            (i == 0 || e[i - 1] != "\\") && (o = e.substring(o, i).replace(/\\\./g, "."), r[o] = {}, r = r[o], o = i + 1), i += 1;
          return r[e.substring(o).replace(/\\\./g, ".")] = t, n;
        }
        function is(e, t) {
          return e && t;
        }
        function ty(e, t) {
          function n(o) {
            for (var s = m(Object.keys(o)), u = s.next(); !u.done; u = s.next()) if (u = u.value, !(o[u] instanceof HTMLElement)) if (i(o[u]) && Object.keys(o[u]).length === 0) delete o[u];
            else {
              var a = o[u];
              Array.isArray(a) && a.length === 0 || typeof o[u] == "function" ? delete o[u] : i(o[u]) && (n(o[u]), Object.keys(o[u]).length === 0 && delete o[u]);
            }
          }
          function r(o, s) {
            return Object.keys(o).reduce(function(u, a) {
              var l = o[a];
              return s.hasOwnProperty(a) ? l instanceof HTMLElement && s[a] instanceof HTMLElement ? l.isEqualNode(s[a]) || (u[a] = l) : i(l) && i(s[a]) ? (l = r(l, s[a]), (Object.keys(l).length > 0 || !i(l)) && (u[a] = l)) : Array.isArray(l) && Array.isArray(s[a]) ? Vi(l, s[a]) || (u[a] = l) : Number.isNaN(l) && Number.isNaN(s[a]) || l !== s[a] && (u[a] = l) : u[a] = l, u;
            }, {});
          }
          function i(o) {
            return o && typeof o == "object" && !Array.isArray(o);
          }
          return e = r(e, t), n(e), e;
        }
        Y("shaka.util.ConfigUtils", Ml), Ml.getDifferenceFromConfigObjects = ty, Ml.convertToConfigObject = Cl, Ml.mergeConfigObjects = Bf, Y("shaka.config.RepeatMode", { OFF: 0, ALL: 1, SINGLE: 2 });
        function gn() {
        }
        function ny(e) {
          return e = Mr(e), new yt(e).Fb;
        }
        function Eu(e, t, n) {
          function r(u) {
            dn(o).setUint32(s, u.byteLength, !0), s += 4, o.set(pe(u), s), s += u.byteLength;
          }
          if (!n || !n.byteLength) throw new b(2, 6, 6015);
          var i;
          typeof t == "string" ? i = xd(t, !0) : i = t, e = Mr(e), e = xd(e, !0);
          var o = new Uint8Array(12 + e.byteLength + i.byteLength + n.byteLength), s = 0;
          return r(e), r(i), r(n), o;
        }
        function Ff(e, t, n) {
          return t !== "skd" ? e : (t = n.serverCertificate, n = Mr(e).split("skd://").pop(), Eu(e, n, t));
        }
        function kl(e, t) {
          e === 2 && (e = t.drmInfo) && ko(e.keySystem) && (t.headers["Content-Type"] = "application/octet-stream");
        }
        Y("shaka.drm.FairPlay", gn), gn.commonFairPlayResponse = function(e, t) {
          if (e === 2 && (e = t.originalRequest.drmInfo) && ko(e.keySystem)) {
            try {
              var n = dt(t.data);
            } catch {
              return;
            }
            if (e = !1, n = n.trim(), n.substr(0, 5) === "<ckc>" && n.substr(-6) === "</ckc>" && (n = n.slice(5, -6), e = !0), !e) try {
              var r = JSON.parse(n);
              r.ckc && (n = r.ckc, e = !0), r.CkcMessage && (n = r.CkcMessage, e = !0), r.License && (n = r.License, e = !0);
            } catch {
            }
            e && (t.data = Kn(Wn(n)));
          }
        }, gn.muxFairPlayRequest = function(e, t) {
          kl(e, t);
        }, gn.expressplayFairPlayRequest = function(e, t) {
          if (e === 2) {
            var n = t.drmInfo;
            n && ko(n.keySystem) && kl(e, t);
          }
        }, gn.conaxFairPlayRequest = function(e, t) {
          kl(e, t);
        }, gn.ezdrmFairPlayRequest = function(e, t) {
          kl(e, t);
        }, gn.verimatrixFairPlayRequest = function(e, t) {
          e === 2 && (e = t.drmInfo) && ko(e.keySystem) && (e = pe(t.body), e = _r(e), t.headers["Content-Type"] = "application/x-www-form-urlencoded", t.body = sr("spc=" + e));
        }, gn.muxInitDataTransform = function(e, t, n) {
          return Ff(e, t, n);
        }, gn.expressplayInitDataTransform = function(e, t, n) {
          return Ff(e, t, n);
        }, gn.conaxInitDataTransform = function(e, t, n) {
          if (t !== "skd") return e;
          t = n.serverCertificate, n = Mr(e).split("skd://").pop().split("?").shift(), n = C.atob(n);
          var r = new ArrayBuffer(n.length * 2);
          r = kg(r);
          for (var i = 0, o = n.length; i < o; i++) r[i] = n.charCodeAt(i);
          return Eu(e, r, t);
        }, gn.ezdrmInitDataTransform = function(e, t, n) {
          return t !== "skd" ? e : (t = n.serverCertificate, n = Mr(e).split(";").pop(), Eu(e, n, t));
        }, gn.verimatrixInitDataTransform = function(e, t, n) {
          return Ff(e, t, n);
        }, gn.initDataTransform = Eu, gn.defaultGetContentId = ny, gn.isFairPlaySupported = function() {
          var e;
          return D(function(t) {
            return t.g == 1 ? (e = { initDataTypes: ["cenc", "sinf", "skd"], videoCapabilities: [{ contentType: 'video/mp4; codecs="avc1.42E01E"' }] }, de(t, 2), x(t, navigator.requestMediaKeySystemAccess("com.apple.fps", [e]), 4)) : t.g != 2 ? t.return(!0) : (he(t), t.return(!1));
          });
        };
        function Pl(e, t, n) {
          for (n = n === void 0 ? !0 : n, this.h = e, this.g = /* @__PURE__ */ new Set([e]), t = t || [], e = m(t), t = e.next(); !t.done; t = e.next()) this.add(t.value, n);
        }
        Pl.prototype.add = function(e, t) {
          var n = this.h;
          t = t === void 0 ? !0 : t;
          var r;
          if (!(r = !!n.audio != !!e.audio || !!n.video != !!e.video || n.language != e.language) && (r = n.audio && e.audio)) {
            r = n.audio;
            var i = e.audio;
            r = !(!((!r.channelsCount || !i.channelsCount || r.channelsCount > 2 || i.channelsCount > 2) && r.channelsCount != i.channelsCount || r.spatialAudio !== i.spatialAudio || t && !ry(r, i)) && Vi(r.roles, i.roles) && r.groupId === i.groupId);
          }
          return !r && (r = n.video && e.video) && (n = n.video, r = e.video, r = !((!t || ry(n, r)) && Vi(n.roles, r.roles))), r ? !1 : (this.g.add(e), !0);
        }, Pl.prototype.values = function() {
          return this.g.values();
        };
        function ry(e, t) {
          return e.mimeType != t.mimeType ? !1 : (e = e.codecs.split(",").map(function(n) {
            return yi(n);
          }), t = t.codecs.split(",").map(function(n) {
            return yi(n);
          }), Vi(e, t));
        }
        Y("shaka.media.AdaptationSet", Pl);
        function Iu() {
          this.h = this.g = null;
        }
        Iu.prototype.configure = function(e) {
          this.g = e;
        }, Iu.prototype.getConfiguration = function() {
          return this.g;
        }, Iu.prototype.create = function(e) {
          var t;
          if (this.g.language) {
            var n = RE(e, this.g.language);
            n.length && (t = n);
          }
          t || (t = e.filter(function(o) {
            return o.primary;
          }), t = t.length ? t : e), e = LE(t, this.g.role), e.length && (t = e), e = bE(t, this.g.videoRole), e.length && (t = e), this.g.videoLayout && (e = _E(t, this.g.videoLayout), e.length && (t = e)), this.g.hdrLevel && (e = UE(t, this.g.hdrLevel), e.length && (t = e));
          var r = [this.g.channelCount, this.g.preferredAudioChannelCount];
          if (e = r.filter(function(o, s) {
            return o && r.indexOf(o) === s;
          }), e.length) {
            for (e = m(e), n = e.next(); !n.done; n = e.next()) if (n = jE(t, n.value), n.length) {
              t = n;
              break;
            }
          }
          this.g.audioLabel && (e = NE(t, this.g.audioLabel), e.length && (t = e)), this.g.videoLabel && (e = OE(t, this.g.videoLabel), e.length && (t = e)), e = BE(t, this.g.spatialAudio), e.length && (t = e);
          var i = [this.g.audioCodec, this.g.activeAudioCodec].concat(X(this.g.preferredAudioCodecs));
          if (e = i.filter(function(o, s) {
            return o && i.indexOf(o) === s;
          }), e.length) {
            for (e = m(e), n = e.next(); !n.done; n = e.next()) if (n = FE(t, n.value), n.length) {
              t = n;
              break;
            }
          }
          return e = Se(), e = this.g.codecSwitchingStrategy == "smooth" && e.Bb(), this.h = new Pl(t[0], t, !e);
        }, Iu.prototype.getLastAdaptationSet = function() {
          return this.h;
        };
        function RE(e, t) {
          t = He(t);
          var n = Ha(t, e.map(function(r) {
            return Vd(r);
          }));
          return n ? e.filter(function(r) {
            return n == Vd(r);
          }) : [];
        }
        function LE(e, t) {
          return e.filter(function(n) {
            return n.audio ? t ? n.audio.roles.includes(t) : n.audio.roles.length == 0 : !1;
          });
        }
        function bE(e, t) {
          return e.filter(function(n) {
            return n.video ? t ? n.video.roles.includes(t) : n.video.roles.length == 0 : !1;
          });
        }
        function NE(e, t) {
          return e.filter(function(n) {
            return n.audio && n.audio.label ? n.audio.label.toLowerCase() == t.toLowerCase() : !1;
          });
        }
        function OE(e, t) {
          return e.filter(function(n) {
            return n.video && n.video.label ? n.video.label.toLowerCase() == t.toLowerCase() : !1;
          });
        }
        function jE(e, t) {
          return e.filter(function(n) {
            return !(n.audio && n.audio.channelsCount && n.audio.channelsCount > t);
          }).sort(function(n, r) {
            return n.audio || r.audio ? n.audio ? r.audio ? (r.audio.channelsCount || 0) - (n.audio.channelsCount || 0) : 1 : -1 : 0;
          });
        }
        function UE(e, t) {
          if (t == "AUTO") {
            var n = e.some(function(r) {
              return !!(r.video && r.video.hdr && r.video.hdr == "HLG");
            });
            t = Se().rd(n);
          }
          return e.filter(function(r) {
            return !(r.video && r.video.hdr && r.video.hdr != t);
          });
        }
        function _E(e, t) {
          return e.filter(function(n) {
            return !(n.video && n.video.videoLayout && n.video.videoLayout != t);
          });
        }
        function BE(e, t) {
          return e.filter(function(n) {
            return !(n.audio && n.audio.spatialAudio != t);
          });
        }
        function FE(e, t) {
          return e.filter(function(n) {
            return !(n.audio && n.audio.codecs != t);
          });
        }
        function Dl() {
        }
        function os() {
          var e = 1 / 0, t = Se();
          navigator.connection && navigator.connection.saveData && (e = 360);
          var n = {
            retryParameters: cr(),
            servers: {},
            clearKeys: {},
            advanced: {},
            delayLicenseRequestUntilPlayed: !1,
            persistentSessionOnlinePlayback: !1,
            persistentSessionsMetadata: [],
            initDataTransform: function(u, a, l) {
              return C.shakaMediaKeysPolyfill === "apple" && a == "skd" && (a = l.serverCertificate, l = ny(u), u = Eu(u, l, a)), u;
            },
            logLicenseExchange: !1,
            updateExpirationTime: 1,
            preferredKeySystems: [],
            keySystemsMapping: {},
            parseInbandPsshEnabled: !1,
            minHdcpVersion: "",
            ignoreDuplicateInitData: !0,
            defaultAudioRobustnessForWidevine: "SW_SECURE_CRYPTO",
            defaultVideoRobustnessForWidevine: "SW_SECURE_DECODE"
          }, r = "reload";
          t.Bb() && (r = "smooth");
          var i = {
            retryParameters: cr(),
            availabilityWindowOverride: NaN,
            disableAudio: !1,
            disableVideo: !1,
            disableText: !1,
            disableThumbnails: !1,
            disableIFrames: !1,
            defaultPresentationDelay: 0,
            segmentRelativeVttTiming: !1,
            raiseFatalErrorOnManifestUpdateRequestFailure: !1,
            continueLoadingWhenPaused: !0,
            ignoreSupplementalCodecs: !1,
            updatePeriod: -1,
            ignoreDrmInfo: !1,
            enableAudioGroups: !0,
            dash: { clockSyncUri: "", disableXlinkProcessing: !0, xlinkFailGracefully: !1, ignoreMinBufferTime: !1, autoCorrectDrift: !0, initialSegmentLimit: 1e3, ignoreSuggestedPresentationDelay: !1, ignoreEmptyAdaptationSet: !1, ignoreMaxSegmentDuration: !1, keySystemsByURI: {
              "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
              "urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e": "org.w3.clearkey",
              "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
              "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
              "urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready",
              "urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2": "com.apple.fps",
              "urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c": "com.huawei.wiseplay"
            }, manifestPreprocessor: Rl, manifestPreprocessorTXml: Ll, sequenceMode: !1, useStreamOnceInPeriodFlattening: !1, enableFastSwitching: !0 },
            hls: {
              ignoreTextStreamFailures: !1,
              ignoreImageStreamFailures: !1,
              defaultAudioCodec: "mp4a.40.2",
              defaultVideoCodec: "avc1.42E01E",
              ignoreManifestProgramDateTime: !1,
              ignoreManifestProgramDateTimeForTypes: [],
              mediaPlaylistFullMimeType: 'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',
              liveSegmentsDelay: 3,
              sequenceMode: t.dd(),
              ignoreManifestTimestampsInSegmentsMode: !1,
              disableCodecGuessing: !1,
              disableClosedCaptionsDetection: !1,
              allowLowLatencyByteRangeOptimization: !0,
              allowRangeRequestsToGuessMimeType: !1
            },
            mss: { manifestPreprocessor: Rl, manifestPreprocessorTXml: Ll, sequenceMode: !1, keySystemsBySystemId: { "9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready", "79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready" } }
          }, o = { trackSelectionCallback: function(u) {
            return D(function(a) {
              return a.return(u);
            });
          }, downloadSizeCallback: function(u) {
            var a;
            return D(function(l) {
              return l.g == 1 ? navigator.storage && navigator.storage.estimate ? x(l, navigator.storage.estimate(), 3) : l.return(!0) : (a = l.h, l.return(a.usage + u < a.quota * 0.95));
            });
          }, progressCallback: function(u, a) {
            return is([u, a]);
          }, usePersistentLicense: !0, numberOfParallelDownloads: 5 }, s = {
            drm: n,
            manifest: i,
            streaming: {
              retryParameters: cr(),
              failureCallback: function(u) {
                return is([u]);
              },
              rebufferingGoal: 0,
              bufferingGoal: 10,
              bufferBehind: 30,
              evictionGoal: 1,
              ignoreTextStreamFailures: !1,
              alwaysStreamText: !1,
              startAtSegmentBoundary: !1,
              gapDetectionThreshold: 0.5,
              gapPadding: 0,
              gapJumpTimerTime: 0.25,
              durationBackoff: 1,
              safeSeekOffset: 5,
              safeSeekEndOffset: 0,
              stallEnabled: !0,
              stallThreshold: 1,
              stallSkip: 0.1,
              useNativeHlsForFairPlay: !0,
              inaccurateManifestTolerance: 2,
              lowLatencyMode: !0,
              preferNativeDash: !1,
              preferNativeHls: !1,
              updateIntervalSeconds: 1,
              observeQualityChanges: !1,
              maxDisabledTime: 30,
              segmentPrefetchLimit: 1,
              prefetchAudioLanguages: [],
              disableAudioPrefetch: !1,
              disableTextPrefetch: !1,
              disableVideoPrefetch: !1,
              liveSync: { enabled: !1, targetLatency: 0.5, targetLatencyTolerance: 0.5, maxPlaybackRate: 1.1, minPlaybackRate: 0.95, panicMode: !1, panicThreshold: 60, dynamicTargetLatency: { enabled: !1, stabilityThreshold: 60, rebufferIncrement: 0.5, maxAttempts: 10, maxLatency: 4, minLatency: 1 } },
              allowMediaSourceRecoveries: !0,
              minTimeBetweenRecoveries: 5,
              vodDynamicPlaybackRate: !1,
              vodDynamicPlaybackRateLowBufferRate: 0.95,
              vodDynamicPlaybackRateBufferRatio: 0.5,
              preloadNextUrlWindow: 30,
              loadTimeout: 30,
              clearDecodingCache: !1,
              dontChooseCodecs: !1,
              shouldFixTimestampOffset: !1,
              avoidEvictionOnQuotaExceededError: !1,
              crossBoundaryStrategy: "keep",
              returnToEndOfLiveWindowWhenOutside: !1
            },
            networking: { forceHTTP: !1, forceHTTPS: !1, minBytesForProgressEvents: 16e3 },
            mediaSource: {
              codecSwitchingStrategy: r,
              addExtraFeaturesToSourceBuffer: function(u) {
                return is([u], "");
              },
              forceTransmux: !1,
              insertFakeEncryptionInInit: !0,
              correctEc3Enca: !1,
              modifyCueCallback: function(u, a, l) {
                return is([u, a, l]);
              },
              dispatchAllEmsgBoxes: !1,
              useSourceElements: !0,
              durationReductionEmitsUpdateEnd: !0
            },
            offline: o,
            abrFactory: function() {
              return new ht();
            },
            adaptationSetCriteriaFactory: function() {
              return new (Function.prototype.bind.apply(Iu, [null].concat(X($e.apply(0, arguments)))))();
            },
            abr: { enabled: !0, useNetworkInformation: !0, defaultBandwidthEstimate: 1e6, switchInterval: 8, bandwidthUpgradeTarget: 0.85, bandwidthDowngradeTarget: 0.95, restrictions: {
              minWidth: 0,
              maxWidth: 1 / 0,
              minHeight: 0,
              maxHeight: e,
              minPixels: 0,
              maxPixels: 1 / 0,
              minFrameRate: 0,
              maxFrameRate: 1 / 0,
              minBandwidth: 0,
              maxBandwidth: 1 / 0,
              minChannelsCount: 0,
              maxChannelsCount: 1 / 0
            }, advanced: { minTotalBytes: 128e3, minBytes: 16e3, fastHalfLife: 2, slowHalfLife: 5 }, restrictToElementSize: !1, restrictToScreenSize: !1, ignoreDevicePixelRatio: !1, clearBufferSwitch: !1, safeMarginSwitch: 0, cacheLoadThreshold: 5, minTimeToSwitch: 0, preferNetworkInformationBandwidth: !1, removeLatencyFromFirstPacketTime: !1 },
            autoShowText: 3,
            preferredAudioLanguage: "",
            preferredAudioLabel: "",
            preferredTextLanguage: "",
            preferredAudioRole: "",
            preferredVideoRole: "",
            preferredTextRole: "",
            preferredAudioChannelCount: 2,
            preferredVideoHdrLevel: "AUTO",
            preferredVideoLayout: "",
            preferredVideoLabel: "",
            preferredVideoCodecs: [],
            preferredAudioCodecs: [],
            preferredTextFormats: [],
            preferForcedSubs: !1,
            preferSpatialAudio: !1,
            preferredDecodingAttributes: [],
            restrictions: { minWidth: 0, maxWidth: 1 / 0, minHeight: 0, maxHeight: 1 / 0, minPixels: 0, maxPixels: 1 / 0, minFrameRate: 0, maxFrameRate: 1 / 0, minBandwidth: 0, maxBandwidth: 1 / 0, minChannelsCount: 0, maxChannelsCount: 1 / 0 },
            playRangeStart: 0,
            playRangeEnd: 1 / 0,
            textDisplayer: { captionsUpdatePeriod: 0.25, fontScaleFactor: 1 },
            textDisplayFactory: function() {
              return null;
            },
            cmcd: { enabled: !1, sessionId: "", contentId: "", rtpSafetyFactor: 5, useHeaders: !1, includeKeys: [], version: 1, targets: [] },
            cmsd: { enabled: !0, applyMaximumSuggestedBitrate: !0, estimatedThroughputWeightRatio: 0.5 },
            lcevc: { enabled: !1, dynamicPerformanceScaling: !0, logLevel: 0, drawLogo: !1, poster: !0 },
            ads: {
              customPlayheadTracker: !1,
              skipPlayDetection: !1,
              supportsMultipleMediaElements: !0,
              disableHLSInterstitial: !1,
              disableDASHInterstitial: !1,
              allowPreloadOnDomElements: !0,
              allowStartInMiddleOfInterstitial: !0
            },
            ignoreHardwareResolution: !1,
            queue: { preloadNextUrlWindow: 1 / 0, preloadPrevItem: !0, repeatMode: 0 }
          };
          return o.trackSelectionCallback = function(u) {
            return D(function(a) {
              return a.return(VE(u, s.preferredAudioLanguage, s.preferredVideoHdrLevel));
            });
          }, t.Wa(s);
        }
        function iy() {
          return { streaming: { inaccurateManifestTolerance: 0, segmentPrefetchLimit: 2, updateIntervalSeconds: 0.1, maxDisabledTime: 1, retryParameters: { baseDelay: 100 } }, manifest: { dash: { autoCorrectDrift: !1 }, retryParameters: { baseDelay: 100 } }, drm: { retryParameters: { baseDelay: 100 } } };
        }
        function Qr(e, t, n) {
          var r = { ".drm.keySystemsMapping": "", ".drm.servers": "", ".drm.clearKeys": "", ".drm.advanced": { distinctiveIdentifierRequired: !1, persistentStateRequired: !1, videoRobustness: [], audioRobustness: [], sessionType: "", serverCertificate: new Uint8Array(0), serverCertificateUri: "", individualizationServer: "", headers: {} } };
          return Bf(e, t, n || os(), r, "");
        }
        function VE(e, t, n) {
          var r = n;
          r == "AUTO" && (n = e.some(function(u) {
            return !!(u.hdr && u.hdr == "HLG");
          }), r = Se().rd(n));
          var i = e.filter(function(u) {
            return !(u.type != "variant" || u.hdr && u.hdr != r);
          });
          n = [];
          var o = Ha(t, i.map(function(u) {
            return u.language;
          }));
          o && (n = i.filter(function(u) {
            return He(u.language) == o;
          })), n.length == 0 && (n = i.filter(function(u) {
            return u.primary;
          })), n.length == 0 && (i.map(function(u) {
            return u.language;
          }), n = i);
          var s = n.filter(function(u) {
            return u.height && u.height <= 480;
          });
          for (s.length && (s.sort(function(u, a) {
            return a.height - u.height;
          }), n = s.filter(function(u) {
            return u.height == s[0].height;
          })), t = [], n.length && (i = Math.floor(n.length / 2), n.sort(function(u, a) {
            return u.bandwidth - a.bandwidth;
          }), t.push(n[i])), e = m(e), n = e.next(); !n.done; n = e.next()) n = n.value, n.type != xe && n.type != "image" || t.push(n);
          return t;
        }
        function Rl(e) {
          return is([e], e);
        }
        function Ll(e) {
          return is([e], e);
        }
        Y("shaka.util.PlayerConfiguration", Dl), Dl.mergeConfigObjects = Qr, Dl.createDefaultForLL = iy, Dl.createDefault = os;
        function HE() {
          this.g = null, this.h = [];
        }
        function Vf(e, t) {
          var n = 0;
          e.g && e.g.state == t && (n += e.g.duration), e = m(e.h);
          for (var r = e.next(); !r.done; r = e.next()) r = r.value, n += r.state == t ? r.duration : 0;
          return n;
        }
        function GE(e) {
          function t(o) {
            return { timestamp: o.timestamp, state: o.state, duration: o.duration };
          }
          for (var n = [], r = m(e.h), i = r.next(); !i.done; i = r.next()) n.push(t(i.value));
          return e.g && n.push(t(e.g)), n;
        }
        function KE() {
          this.i = this.h = null, this.g = [];
        }
        function Hf(e, t, n) {
          e.i != t && (e.i = t, e.g.push({ timestamp: Date.now() / 1e3, id: t.id, type: "text", fromAdaptation: n, bandwidth: null }));
        }
        function bl() {
          this.C = this.X = NaN, this.l = "", this.j = this.si = this.u = this.B = this.K = this.F = this.o = this.m = this.J = this.G = this.i = this.T = this.W = this.N = this.O = this.R = NaN, this.M = 0, this.H = this.I = NaN, this.g = new HE(), this.h = new KE();
        }
        function WE(e, t, n) {
          e.R = t, e.O = n;
        }
        function oy(e, t, n) {
          e.X = t, e.C = n;
        }
        function zE(e, t) {
          e.i = isNaN(e.i) ? t : Math.max(e.i, t);
        }
        function sy(e, t) {
          e.j = isNaN(e.j) ? t : e.j + t;
        }
        function XE(e) {
          var t = e.X, n = e.C, r = e.l, i = e.B, o = e.O, s = e.R, u = e.N, a = e.W, l = e.T, c = e.u, d = e.i, h = e.G, p = e.J, g = e.m, w = Vf(e.g, "playing"), T = Vf(e.g, "paused"), E = Vf(e.g, "buffering"), A = e.o, I = e.F, P = e.K, N = e.si, M = e.j, R = e.M, k = e.I, O = e.H, L = GE(e.g), U = [];
          e = m(e.h.g);
          for (var j = e.next(); !j.done; j = e.next()) j = j.value, U.push({ timestamp: j.timestamp, id: j.id, type: j.type, fromAdaptation: j.fromAdaptation, bandwidth: j.bandwidth });
          return {
            width: t,
            height: n,
            currentCodecs: r,
            streamBandwidth: i,
            decodedFrames: o,
            droppedFrames: s,
            corruptedFrames: u,
            stallsDetected: a,
            gapsJumped: l,
            estimatedBandwidth: c,
            completionPercent: d,
            loadLatency: h,
            manifestTimeSeconds: p,
            drmTimeSeconds: g,
            playTime: w,
            pauseTime: T,
            bufferingTime: E,
            licenseTime: A,
            liveLatency: I,
            maxSegmentDuration: P,
            manifestSizeBytes: N,
            bytesDownloaded: M,
            nonFatalErrorCount: R,
            manifestPeriodCount: k,
            manifestGapCount: O,
            stateHistory: L,
            switchHistory: U
          };
        }
        function Yn(e, t, n, r) {
          Xe.call(this), this.N = e, this.W = t, this.Da = r.networkingEngine, this.o = n, this.C = null, this.za = 0, this.Ta = r.kd, this.G = r.vk, this.Ua = r.wk, this.g = r.config, this.m = this.H = this.h = null, this.oa = !1, this.I = r.Ik, this.va = !1, this.j = null, this.ba = !1, this.u = null, this.M = /* @__PURE__ */ new Map(), this.ya = !1, this.Fa = r.Hk, this.X = new bl(), this.ma = new Je(), this.B = new Je(), this.O = null, this.l = !1, this.$ = r.mj, this.T = this.i = null, this.R = !1, this.K = [], this.J = [], this.F = !0;
        }
        tt(Yn, Xe);
        function Mu(e, t, n) {
          (e = t ? e.J : e.K) ? e.push(n) : n();
        }
        function qE(e) {
          if (e.J) for (var t = m(e.J), n = t.next(); !n.done; n = t.next()) n = n.value, n();
          e.J = null;
        }
        function uy(e, t) {
          if (e.O = t, e.R = !0, e.K) {
            t = m(e.K);
            for (var n = t.next(); !n.done; n = t.next()) n = n.value, n();
          }
          e.K = null;
        }
        f = Yn.prototype, f.getStartTime = function() {
          return this.o;
        }, f.pd = function() {
          return this.N;
        }, f.Hg = function() {
          return this.h;
        };
        function YE(e) {
          return e.va = !0, e.I;
        }
        f.getStats = function() {
          return this.X;
        };
        function $E(e) {
          return e.ba = !0, e.j;
        }
        f.Sj = function() {
          return this.i ? Qi(this.i) : null;
        }, f.Rj = function() {
          return this.T ? Zi(this.T) : null;
        };
        function JE(e) {
          return e.ya = !0, e.M;
        }
        f.start = function() {
          var e = this;
          (function() {
            var t;
            return D(function(n) {
              switch (n.g) {
                case 1:
                  return x(n, Promise.resolve(), 2);
                case 2:
                  return de(n, 3), x(n, QE(e), 5);
                case 5:
                  if (Mi(e), C.shakaMediaKeysPolyfill === "webkit") {
                    n.A(6);
                    break;
                  }
                  return x(n, ay(e), 7);
                case 7:
                  Mi(e);
                case 6:
                  return x(n, eI(e), 8);
                case 8:
                  if (Mi(e), !e.$) {
                    n.A(9);
                    break;
                  }
                  return x(n, tI(e), 10);
                case 10:
                  Mi(e);
                case 9:
                  if (!e.$ || !e.j) {
                    n.A(11);
                    break;
                  }
                  return x(n, nA(e.j), 12);
                case 12:
                  Mi(e);
                case 11:
                  e.B.resolve(), ye(n, 0);
                  break;
                case 3:
                  t = he(n), t instanceof b && (t.code == 7001 || t.code == 7003) || e.B.reject(t), q(n);
              }
            });
          })();
        }, f.dispatchEvent = function(e) {
          return this.O ? this.O.dispatchEvent(e) : Xe.prototype.dispatchEvent.call(this, e);
        }, f.onError = function(e) {
          e.severity === 2 && (this.B.reject(e), this.destroy());
          var t = (/* @__PURE__ */ new Map()).set("detail", e);
          t = new ee("error", t), this.dispatchEvent(t), t.defaultPrevented && (e.handled = !0);
        };
        function Mi(e) {
          if (e.l) throw new b(2, 7, 7003);
        }
        function Gf(e, t) {
          e.dispatchEvent(new ee("onstatechange", (/* @__PURE__ */ new Map()).set("state", t)));
        }
        function QE(e) {
          var t, n, r, i, o, s;
          return D(function(u) {
            switch (u.g) {
              case 1:
                if (Gf(e, "manifest-parser"), e.m || (e.H = Ug(e.N, e.W), e.m = e.H(), e.m.configure(e.g.manifest, function() {
                  return e.F;
                })), t = Date.now() / 1e3, Gf(e, "manifest"), e.h) {
                  u.A(2);
                  break;
                }
                return x(u, e.m.start(e.N, e.Ua), 3);
              case 3:
                return e.h = u.h, cy(e.h), x(u, ZE(e), 2);
              case 2:
                return e.ma.resolve(), n = new ee("manifestparsed", void 0), x(u, Promise.resolve(), 5);
              case 5:
                if (e.dispatchEvent(n), e.h.variants.length == 0) throw new b(2, 4, 4036);
                if (cy(e.h), r = Km(e.G, e.h), !r) {
                  u.A(6);
                  break;
                }
                return i = new ee("trackschanged", void 0), x(u, Promise.resolve(), 7);
              case 7:
                Mi(e), e.dispatchEvent(i);
              case 6:
                o = Date.now() / 1e3, s = o - t, e.X.J = s, q(u);
            }
          });
        }
        function ay(e, t) {
          var n, r, i, o;
          return D(function(s) {
            switch (s.g) {
              case 1:
                return !e.h || e.j ? s.return() : (Gf(e, "drm-engine"), e.za = Date.now() / 1e3, e.j = e.Ta(), e.G.g = e.j, e.j.configure(e.g.drm, function() {
                  return e.F;
                }), n = za(e.h.variants), r = !0, e.h && e.h.presentationTimeline && (r = e.h.presentationTimeline.U()), x(s, Rm(e.j, n, e.h.offlineSessionIds, r), 2));
              case 2:
                if (Mi(e), !t) {
                  s.A(3);
                  break;
                }
                return x(s, e.j.Vb(t), 4);
              case 4:
                Mi(e);
              case 3:
                return x(s, Gm(e.G, e.h), 5);
              case 5:
                if (i = s.h, !i) {
                  s.A(0);
                  break;
                }
                return o = new ee(
                  "trackschanged",
                  void 0
                ), x(s, Promise.resolve(), 7);
              case 7:
                e.dispatchEvent(o), q(s);
            }
          });
        }
        f.configure = function(e, t) {
          e = Cl(e, t), Qr(this.g, e);
        }, f.getConfiguration = function() {
          return ar(this.g);
        };
        function ZE(e) {
          return D(function(t) {
            return e.C || (e.C = e.g.adaptationSetCriteriaFactory(), e.C.configure({
              language: e.g.preferredAudioLanguage,
              role: e.g.preferredAudioRole,
              videoRole: e.g.preferredVideoRole,
              channelCount: 0,
              hdrLevel: e.g.preferredVideoHdrLevel,
              spatialAudio: e.g.preferSpatialAudio,
              videoLayout: e.g.preferredVideoLayout,
              audioLabel: e.g.preferredAudioLabel,
              videoLabel: e.g.preferredVideoLabel,
              codecSwitchingStrategy: e.g.mediaSource.codecSwitchingStrategy,
              audioCodec: "",
              activeAudioCodec: "",
              activeAudioChannelCount: 0,
              preferredAudioCodecs: e.g.preferredAudioCodecs,
              preferredAudioChannelCount: e.g.preferredAudioChannelCount
            })), e.i || !e.h.variants.length || e.h.variants.length != 1 && e.h.type != "HLS" ? t.A(0) : (e.i = Kf(e), e.i ? x(t, ly(e.i), 0) : t.A(0));
          });
        }
        function eI(e) {
          return D(function(t) {
            return t.g == 1 ? !e.i || e.h.variants.includes(e.i) ? t.A(0) : x(t, nI(e.i), 3) : (e.i = Kf(e), e.i ? x(t, ly(e.i), 0) : t.A(0));
          });
        }
        function tI(e) {
          var t, n, r, i, o;
          return D(function(s) {
            return !e.i && (t = Kf(e)) && (e.i = t), e.i ? (n = e.h.presentationTimeline.U(), r = [], i = e.i, i.video && r.push(Wf(e, i.video, n)), i.audio && r.push(Wf(e, i.audio, n)), (o = Bo(e.h.textStreams, e.g.preferredTextLanguage, e.g.preferredTextRole, e.g.preferForcedSubs)[0] || null) && gm(i.audio, o, e.g) && (r.push(Wf(e, o, n)), e.T = o), x(s, Promise.all(r), 0)) : s.A(0);
          });
        }
        function Kf(e) {
          if (!e.u) {
            var t = e.g.abrFactory;
            e.u = t(), e.u.configure(e.g.abr);
          }
          return t = za(e.h.variants), t = e.C.create(t), e.u.setVariants(Array.from(t.values())), e.u.chooseVariant(!0);
        }
        function Wf(e, t, n) {
          var r, i, o, s, u;
          return D(function(a) {
            return a.g == 1 ? (r = e.g.streaming.segmentPrefetchLimit || 2, i = new vl(r, t, function(l, c, d) {
              return xl(l, c, d || null, e.g.streaming.retryParameters, e.Da, e.F);
            }, !1), e.M.set(t.id, i), t.segmentIndex ? a.A(2) : x(a, t.createSegmentIndex(), 2)) : (o = typeof e.o == "number" ? e.o : 0, s = t.segmentIndex.Xb(o), u = null, s && (u = s.current(), u || (u = s.next().value)), u || (u = Tr(t.segmentIndex)), u ? n ? u.ea ? x(a, Kv(i, u.ea), 0) : a.A(0) : x(a, wu(i, u.startTime), 0) : a.A(0));
          });
        }
        function ly(e) {
          var t, n, r, i;
          return D(function(o) {
            for (t = [], n = m([e.video, e.audio]), r = n.next(); !r.done; r = n.next()) (i = r.value) && !i.segmentIndex && t.push(i.createSegmentIndex());
            return t.length > 0 ? x(o, Promise.all(t), 0) : o.A(0);
          });
        }
        function nI(e) {
          var t, n, r, i;
          return D(function(o) {
            for (t = [], n = m([e.video, e.audio]), r = n.next(); !r.done; r = n.next()) (i = r.value) && i.segmentIndex && i.closeSegmentIndex && t.push(i.closeSegmentIndex());
            return t.length > 0 ? x(o, Promise.all(t), 0) : o.A(0);
          });
        }
        f.ol = function() {
          return this.B;
        }, f.destroy = function() {
          var e = this, t, n, r;
          return D(function(i) {
            if (i.g == 1) return e.l = !0, !e.m || e.oa ? i.A(2) : x(i, e.m.stop(), 2);
            if (i.g != 4) return e.u && e.u.release(), e.I && !e.va && e.I.release(), !e.j || e.ba ? i.A(4) : x(i, e.j.destroy(), 4);
            if (e.M.size > 0 && !e.ya) for (t = m(e.M.values()), n = t.next(); !n.done; n = t.next()) r = n.value, Sr(r);
            q(i);
          });
        };
        function cy(e) {
          function t(n) {
            return n.video && n.audio || n.video && n.video.codecs.includes(",");
          }
          e.variants.some(t) && (e.variants = e.variants.filter(t));
        }
        Y("shaka.media.PreloadManager", Yn), Yn.prototype.destroy = Yn.prototype.destroy, Yn.prototype.waitForFinish = Yn.prototype.ol, Yn.prototype.getPrefetchedTextTrack = Yn.prototype.Rj, Yn.prototype.getPrefetchedVariantTrack = Yn.prototype.Sj;
        function ao(e, t) {
          Xe.call(this);
          var n = this;
          this.i = e, this.l = t, this.g = /* @__PURE__ */ new Map(), this.m = [{ hd: null, gd: ss, Tc: function(r, i) {
            return Zr(n, "enter", r, i);
          } }, { hd: Cu, gd: ss, Tc: function(r, i) {
            return Zr(n, "enter", r, i);
          } }, { hd: ku, gd: ss, Tc: function(r, i) {
            return Zr(n, "enter", r, i);
          } }, { hd: ss, gd: Cu, Tc: function(r, i) {
            return Zr(n, "exit", r, i);
          } }, { hd: ss, gd: ku, Tc: function(r, i) {
            return Zr(n, "exit", r, i);
          } }, { hd: Cu, gd: ku, Tc: function(r, i) {
            i ? Zr(n, "skip", r, i) : (Zr(n, "enter", r, i), Zr(n, "exit", r, i));
          } }, { hd: ku, gd: Cu, Tc: function(r, i) {
            return Zr(
              n,
              "skip",
              r,
              i
            );
          } }], this.h = new Ve(), this.h.D(this.i, "regionremove", function(r) {
            n.g.delete(r.region);
          });
        }
        tt(ao, Xe), ao.prototype.release = function() {
          this.i = null, this.g.clear(), this.h.release(), this.h = null, Xe.prototype.release.call(this);
        }, ao.prototype.j = function(e, t) {
          if (!this.l || e != 0) {
            this.l = !1;
            for (var n = m(this.i.h.values()), r = n.next(); !r.done; r = n.next()) {
              r = r.value;
              var i = this.g.get(r), o = e < r.startTime ? Cu : e > r.endTime ? ku : ss;
              this.g.set(r, o);
              for (var s = m(this.m), u = s.next(); !u.done; u = s.next()) u = u.value, u.hd == i && u.gd == o && u.Tc(r, t);
            }
          }
        };
        function Zr(e, t, n, r) {
          t = new ee(t, /* @__PURE__ */ new Map([["region", n], ["seeking", r]])), e.dispatchEvent(t);
        }
        var Cu = 1, ss = 2, ku = 3;
        for (var Ci = {
          ach: "Lwo",
          ady: "Адыгэбзэ",
          af: "Afrikaans",
          "af-NA": "Afrikaans (Namibia)",
          "af-ZA": "Afrikaans (South Africa)",
          ak: "Tɕɥi",
          ar: "العربية",
          "ar-AR": "العربية",
          "ar-MA": "العربية",
          "ar-SA": "العربية (السعودية)",
          "ay-BO": "Aymar aru",
          az: "Azərbaycan dili",
          "az-AZ": "Azərbaycan dili",
          "be-BY": "Беларуская",
          bg: "Български",
          "bg-BG": "Български",
          bn: "বাংলা",
          "bn-IN": "বাংলা (ভারত)",
          "bn-BD": "বাংলা(বাংলাদেশ)",
          "bs-BA": "Bosanski",
          ca: "Català",
          "ca-ES": "Català",
          cak: "Maya Kaqchikel",
          "ck-US": "ᏣᎳᎩ (tsalagi)",
          cs: "Čeština",
          "cs-CZ": "Čeština",
          cy: "Cymraeg",
          "cy-GB": "Cymraeg",
          da: "Dansk",
          "da-DK": "Dansk",
          de: "Deutsch",
          "de-AT": "Deutsch (Österreich)",
          "de-DE": "Deutsch (Deutschland)",
          "de-CH": "Deutsch (Schweiz)",
          dsb: "Dolnoserbšćina",
          el: "Ελληνικά",
          "el-GR": "Ελληνικά",
          en: "English",
          "en-GB": "English (UK)",
          "en-AU": "English (Australia)",
          "en-CA": "English (Canada)",
          "en-IE": "English (Ireland)",
          "en-IN": "English (India)",
          "en-PI": "English (Pirate)",
          "en-UD": "English (Upside Down)",
          "en-US": "English (US)",
          "en-ZA": "English (South Africa)",
          "en@pirate": "English (Pirate)",
          eo: "Esperanto",
          "eo-EO": "Esperanto",
          es: "Español",
          "es-AR": "Español (Argentine)",
          "es-419": "Español (Latinoamérica)",
          "es-CL": "Español (Chile)",
          "es-CO": "Español (Colombia)",
          "es-EC": "Español (Ecuador)",
          "es-ES": "Español (España)",
          "es-LA": "Español (Latinoamérica)",
          "es-NI": "Español (Nicaragua)",
          "es-MX": "Español (México)",
          "es-US": "Español (Estados Unidos)",
          "es-VE": "Español (Venezuela)",
          et: "eesti keel",
          "et-EE": "Eesti (Estonia)",
          eu: "Euskara",
          "eu-ES": "Euskara",
          fa: "فارسی",
          "fa-IR": "فارسی",
          "fb-LT": "Leet Speak",
          ff: "Fulah",
          fi: "Suomi",
          "fi-FI": "Suomi",
          "fo-FO": "Føroyskt",
          fr: "Français",
          "fr-CA": "Français (Canada)",
          "fr-FR": "Français (France)",
          "fr-BE": "Français (Belgique)",
          "fr-CH": "Français (Suisse)",
          "fy-NL": "Frysk",
          ga: "Gaeilge",
          "ga-IE": "Gaeilge (Gaelic)",
          gl: "Galego",
          "gl-ES": "Galego",
          "gn-PY": "Avañe'ẽ",
          "gu-IN": "ગુજરાતી",
          "gx-GR": "Ἑλληνική ἀρχαία",
          he: "עברית‏",
          "he-IL": "עברית‏",
          hi: "हिन्दी",
          "hi-IN": "हिन्दी",
          hr: "Hrvatski",
          "hr-HR": "Hrvatski",
          hsb: "Hornjoserbšćina",
          ht: "Kreyòl",
          hu: "Magyar",
          "hu-HU": "Magyar",
          "hy-AM": "Հայերեն",
          id: "Bahasa Indonesia",
          "id-ID": "Bahasa Indonesia",
          is: "Íslenska",
          "is-IS": "Íslenska (Iceland)",
          it: "Italiano",
          "it-IT": "Italiano",
          ja: "日本語",
          "ja-JP": "日本語",
          "jv-ID": "Basa Jawa",
          "ka-GE": "ქართული",
          "kk-KZ": "Қазақша",
          km: "ភាសាខ្មែរ",
          "km-KH": "ភាសាខ្មែរ",
          kab: "Taqbaylit",
          kn: "ಕನ್ನಡ",
          "kn-IN": "ಕನ್ನಡ (India)",
          ko: "한국어",
          "ko-KR": "한국어 (韩国)",
          ku: "Kurdî",
          "ku-TR": "Kurdî",
          la: "Latin",
          "la-VA": "Latin",
          lb: "Lëtzebuergesch",
          "li-NL": "Lèmbörgs",
          lt: "Lietuvių",
          "lt-LT": "Lietuvių",
          lv: "Latviešu",
          "lv-LV": "Latviešu",
          mai: "मैथिली, মৈথিলী",
          "mg-MG": "Malagasy",
          mk: "Македонски",
          "mk-MK": "Македонски (Македонски)",
          ml: "മലയാളം",
          "ml-IN": "മലയാളം",
          "mn-MN": "Монгол",
          mr: "मराठी",
          "mr-IN": "मराठी",
          ms: "Bahasa Melayu",
          "ms-MY": "Bahasa Melayu",
          mt: "Malti",
          "mt-MT": "Malti",
          my: "ဗမာစကာ",
          nb: "Norsk (bokmål)",
          "nb-NO": "Norsk (bokmål)",
          ne: "नेपाली",
          "ne-NP": "नेपाली",
          nl: "Nederlands",
          "nl-BE": "Nederlands (België)",
          "nl-NL": "Nederlands (Nederland)",
          "nn-NO": "Norsk (nynorsk)",
          no: "Norsk",
          oc: "Occitan",
          "or-IN": "ଓଡ଼ିଆ",
          pa: "ਪੰਜਾਬੀ",
          "pa-IN": "ਪੰਜਾਬੀ (ਭਾਰਤ ਨੂੰ)",
          pl: "Polski",
          "pl-PL": "Polski",
          "ps-AF": "پښتو",
          pt: "Português",
          "pt-BR": "Português (Brasil)",
          "pt-PT": "Português (Portugal)",
          "qu-PE": "Qhichwa",
          "rm-CH": "Rumantsch",
          ro: "Română",
          "ro-RO": "Română",
          ru: "Русский",
          "ru-RU": "Русский",
          "sa-IN": "संस्कृतम्",
          "se-NO": "Davvisámegiella",
          "si-LK": "පළාත",
          sk: "Slovenčina",
          "sk-SK": "Slovenčina (Slovakia)",
          sl: "Slovenščina",
          "sl-SI": "Slovenščina",
          "so-SO": "Soomaaliga",
          sq: "Shqip",
          "sq-AL": "Shqip",
          sr: "Српски",
          "sr-RS": "Српски (Serbia)",
          su: "Basa Sunda",
          sv: "Svenska",
          "sv-SE": "Svenska",
          sw: "Kiswahili",
          "sw-KE": "Kiswahili",
          ta: "தமிழ்",
          "ta-IN": "தமிழ்",
          te: "తెలుగు",
          "te-IN": "తెలుగు",
          tg: "забо́ни тоҷикӣ́",
          "tg-TJ": "тоҷикӣ",
          th: "ภาษาไทย",
          "th-TH": "ภาษาไทย (ประเทศไทย)",
          tl: "Filipino",
          "tl-PH": "Filipino",
          tlh: "tlhIngan-Hol",
          tr: "Türkçe",
          "tr-TR": "Türkçe",
          "tt-RU": "татарча",
          uk: "Українська",
          "uk-UA": "Українська",
          ur: "اردو",
          "ur-PK": "اردو",
          uz: "O'zbek",
          "uz-UZ": "O'zbek",
          vi: "Tiếng Việt",
          "vi-VN": "Tiếng Việt",
          "xh-ZA": "isiXhosa",
          yi: "ייִדיש",
          "yi-DE": "ייִדיש (German)",
          zh: "中文",
          "zh-HANS": "中文简体",
          "zh-HANT": "中文繁體",
          "zh-CN": "中文(中国)",
          "zh-HK": "中文(香港)",
          "zh-SG": "中文(新加坡)",
          "zh-TW": "中文(台灣)",
          "zu-ZA": "isiZulu"
        }, dy = m(Object.keys(Ci)), zf = dy.next(); !zf.done; zf = dy.next()) {
          var fy = zf.value;
          Ci[fy.toLowerCase()] = Ci[fy];
        }
        function hy(e, t) {
          if (e.lineBreak) return `
`;
          if (e.nestedCues.length) return e.nestedCues.map(function(s) {
            return hy(s, e);
          }).join("");
          if (!e.payload) return e.payload;
          var n = [], r = e.fontWeight >= Oo, i = e.fontStyle == jo, o = e.textDecoration.includes(Hr);
          return r && n.push(["b"]), i && n.push(["i"]), o && n.push(["u"]), i = e.color, i == "" && t && (i = t.color), r = "", (i = py(i)) && (r += "." + i), i = e.backgroundColor, i == "" && t && (i = t.backgroundColor), (t = py(i)) && (r += ".bg_" + t), r && n.push(["c", r]), n.reduceRight(function(s, u) {
            var a = m(u);
            return u = a.next().value, a = a.next().value, "<" + u + (a === void 0 ? "" : a) + ">" + s + "</" + u + ">";
          }, e.payload);
        }
        function py(e) {
          e = e.toLowerCase();
          var t = e.replace(/\s/g, "").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);
          switch (t ? e = "#" + (parseInt(t[1], 10) | 256).toString(16).slice(1) + (parseInt(t[2], 10) | 256).toString(16).slice(1) + (parseInt(t[3], 10) | 256).toString(16).slice(1) : e.startsWith("#") && e.length > 7 && (e = e.slice(0, 7)), e) {
            case "white":
            case "#fff":
            case "#ffffff":
              return "white";
            case "lime":
            case "#0f0":
            case "#00ff00":
              return "lime";
            case "cyan":
            case "#0ff":
            case "#00ffff":
              return "cyan";
            case "red":
            case "#f00":
            case "#ff0000":
              return "red";
            case "yellow":
            case "#ff0":
            case "#ffff00":
              return "yellow";
            case "magenta":
            case "#f0f":
            case "#ff00ff":
              return "magenta";
            case "blue":
            case "#00f":
            case "#0000ff":
              return "blue";
            case "black":
            case "#000":
            case "#000000":
              return "black";
          }
          return null;
        }
        function Xf(e, t) {
          var n = [];
          e = m(gy(e));
          for (var r = e.next(); !r.done; r = e.next()) if (r = r.value, r.isContainer) n.push.apply(n, X(Xf(r.nestedCues, r)));
          else {
            var i = r.clone();
            i.nestedCues = [], i.payload = hy(r, t), n.push(i);
          }
          return n;
        }
        function gy(e) {
          var t = [];
          e = m(e);
          for (var n = e.next(), r = {}; !n.done; r = { ig: void 0 }, n = e.next()) r.ig = n.value, t.some(/* @__PURE__ */ (function(i) {
            return function(o) {
              return Oa(i.ig, o);
            };
          })(r)) || t.push(r.ig);
          return t;
        }
        function rI(e) {
          function t(r) {
            for (var i = 5381, o = r.length; o; ) i = i * 33 ^ r.charCodeAt(--o);
            return (i >>> 0).toString();
          }
          if (e.startTime >= e.endTime) return null;
          var n = new VTTCue(e.startTime, e.endTime, e.payload);
          n.id = t(e.startTime.toString()) + t(e.endTime.toString()) + t(e.payload), n.lineAlign = e.lineAlign, n.positionAlign = e.positionAlign, e.size && (n.size = e.size);
          try {
            n.align = e.textAlign;
          } catch {
          }
          return e.textAlign == "center" && n.align != "center" && (n.align = "middle"), e.writingMode == "vertical-lr" ? n.vertical = "lr" : e.writingMode == "vertical-rl" && (n.vertical = "rl"), e.lineInterpretation == 1 && (n.snapToLines = !1), e.line != null && (n.line = e.line), e.position != null && (n.position = e.position), n;
        }
        function my(e, t) {
          var n = Xf(t), r = [];
          t = e.cues ? Array.from(e.cues) : [], n = m(n);
          for (var i = n.next(), o = {}; !i.done; o = { vd: void 0 }, i = n.next()) o.vd = i.value, !t.some(/* @__PURE__ */ (function(s) {
            return function(u) {
              return u.startTime == s.vd.startTime && u.endTime == s.vd.endTime && u.text == s.vd.payload;
            };
          })(o)) && o.vd.payload && (i = rI(o.vd)) && r.push(i);
          for (t = r.slice().sort(function(s, u) {
            return s.startTime != u.startTime ? s.startTime - u.startTime : s.endTime != u.endTime ? s.endTime - u.startTime : "line" in VTTCue.prototype ? r.indexOf(u) - r.indexOf(s) : r.indexOf(s) - r.indexOf(u);
          }), t = m(t), n = t.next(); !n.done; n = t.next()) e.addCue(n.value);
        }
        function qf(e, t) {
          var n = !1;
          e.mode === "disabled" && (n = !0, e.mode = "hidden");
          for (var r = 0; r < e.cues.length; ) {
            var i = e.cues[r];
            t(i) ? e.removeCue(i) : r++;
          }
          n && (e.mode = "disabled");
        }
        function Pt(e) {
          var t = this;
          this.i = e, this.l = new Ve(), this.j = null, this.h = /* @__PURE__ */ new Map(), this.g = -1, this.u = !1, this.o = null, this.C = function() {
            t.l.Ma(t.i, "textchanged", t.m), t.l.Ma(t.j.textTracks, "change", t.B);
            for (var n = m(t.h.values()), r = n.next(); !r.done; r = n.next()) r.value.remove();
            t.h.clear(), t.g = -1, t.j = null;
          }, this.m = function() {
            var n = /* @__PURE__ */ new Map(), r = t.i.Lc();
            r = m(r);
            for (var i = r.next(); !i.done; i = r.next()) {
              if (i = i.value, t.h.has(i.id)) {
                var o = t.h.get(i.id);
                i.active || o.track.mode === "disabled" || (o.track.mode = "disabled"), t.h.delete(i.id);
              } else {
                o = t.j.ownerDocument.createElement("track"), o.kind = iI(i);
                var s = o, u = void 0;
                if (i.label) u = i.label;
                else if (i.language) if (i.language in Ci) u = Ci[i.language];
                else {
                  var a = Va(i.language);
                  a in Ci && (u = Ci[a] + " (" + i.language + ")");
                }
                u || (u = i.originalTextId, i.language && i.language !== i.originalTextId && (u += " (" + i.language + ")")), s.label = u, i.language in Ci && (o.srclang = i.language), o.src = "data:,WEBVTT", o.track.mode = "disabled", t.j.appendChild(o);
              }
              n.set(i.id, o), i.active && (t.g = i.id);
            }
            for (r = m(t.h.values()), i = r.next(); !i.done; i = r.next()) i.value.remove();
            t.g > -1 && (n.has(t.g) ? (r = n.get(t.g).track, r.mode === "disabled" && (r.mode = t.u ? "showing" : "hidden")) : t.g = -1), t.h = n;
          }, this.B = function() {
            if (!t.o) {
              var n = t.j;
              t.o = new Ae(function() {
                if (t.o = null, t.j === n) {
                  var r = -1, i = !1;
                  if (t.h.has(t.g)) {
                    var o = t.h.get(t.g);
                    o.track.mode === "showing" ? (r = t.g, i = !0) : o.track.mode === "hidden" && (r = t.g);
                  }
                  if (!i) for (i = m(t.h), o = i.next(); !o.done; o = i.next()) {
                    var s = m(o.value);
                    if (o = s.next().value, s = s.next().value, s.track.mode === "showing") {
                      r = o;
                      break;
                    } else r < 0 && s.track.mode === "hidden" && (r = o);
                  }
                  for (i = m(t.h), o = i.next(); !o.done; o = i.next()) s = m(o.value), o = s.next().value, s = s.next().value, o !== r && s.track.mode !== "disabled" && (s.track.mode = "disabled");
                  t.g !== r && (t.g = r, r > -1 && t.i.nh({ id: r })), t.i.rh(r > -1 && t.h.get(r).track.mode === "showing");
                }
              }).ka(0);
            }
          }, this.l.D(e, "loaded", function() {
            return t.enableTextDisplayer();
          }), this.enableTextDisplayer();
        }
        f = Pt.prototype, f.configure = function() {
        }, f.remove = function(e, t) {
          if (this.i) this.h.has(this.g) && qf(this.h.get(this.g).track, function(n) {
            return n.startTime < t && n.endTime > e;
          });
          else return !1;
          return !0;
        }, f.append = function(e) {
          this.h.has(this.g) && my(this.h.get(this.g).track, e);
        }, f.destroy = function() {
          return this.i && (this.j && this.C(), this.i = null), this.l && (this.l.release(), this.l = null), Promise.resolve();
        }, f.isTextVisible = function() {
          return this.u;
        }, f.setTextVisibility = function(e) {
          if (this.u = e, this.h.has(this.g)) {
            var t = this.h.get(this.g).track;
            t.mode !== "disabled" && (e = e ? "showing" : "hidden", t.mode !== e && (t.mode = e));
          } else if (this.i && this.i.$d() === 3) if (t = Array.from(this.i.$e().textTracks).filter(function(r) {
            return ["captions", "subtitles", "forced"].includes(r.kind);
          }), e) {
            e = null, t = m(t);
            for (var n = t.next(); !n.done; n = t.next()) if (n = n.value, n.mode === "showing") {
              e = null;
              break;
            } else e || n.mode !== "hidden" || (e = n);
            e && (e.mode = "showing");
          } else for (e = m(t), t = e.next(); !t.done; t = e.next()) t = t.value, t.mode === "showing" && (t.mode = "hidden");
        }, f.setTextLanguage = function() {
        }, f.enableTextDisplayer = function() {
          !this.j && this.i && this.i.$d() === 2 && (this.j = this.i.$e(), this.l.Aa(this.i, "unloading", this.C), this.l.D(this.i, "textchanged", this.m), this.l.D(this.j.textTracks, "change", this.B), this.m());
        };
        function iI(e) {
          var t = Se();
          return e.forced && t.Ha() === "WEBKIT" ? "forced" : e.kind === "caption" || e.roles && e.roles.some(function(n) {
            return n.includes("transcribes-spoken-dialog");
          }) && e.roles.some(function(n) {
            return n.includes("describes-music-and-sound");
          }) ? "captions" : "subtitles";
        }
        Y("shaka.text.NativeTextDisplayer", Pt), Pt.prototype.enableTextDisplayer = Pt.prototype.enableTextDisplayer, Pt.prototype.setTextLanguage = Pt.prototype.setTextLanguage, Pt.prototype.setTextVisibility = Pt.prototype.setTextVisibility, Pt.prototype.isTextVisible = Pt.prototype.isTextVisible, Pt.prototype.destroy = Pt.prototype.destroy, Pt.prototype.append = Pt.prototype.append, Pt.prototype.remove = Pt.prototype.remove, Pt.prototype.configure = Pt.prototype.configure;
        function zt(e, t) {
          for (Ne("SimpleTextDisplayer", "Please migrate to NativeTextDisplayer"), this.h = e, this.i = t, this.g = null, e = m(Array.from(this.h.textTracks)), t = e.next(); !t.done; t = e.next()) t = t.value, t.kind !== "metadata" && t.kind !== "chapters" && (t.mode = "disabled", t.label == this.i && (this.g = t));
          this.g && (this.g.mode = "hidden");
        }
        f = zt.prototype, f.configure = function() {
        }, f.remove = function(e, t) {
          return this.g ? (qf(this.g, function(n) {
            return n.startTime < t && n.endTime > e;
          }), !0) : !1;
        }, f.append = function(e) {
          this.g && my(this.g, e);
        }, f.destroy = function() {
          return this.g && (qf(this.g, function() {
            return !0;
          }), this.g.mode = "disabled"), this.g = this.h = null, Promise.resolve();
        }, f.isTextVisible = function() {
          return this.g ? this.g.mode == "showing" : !1;
        }, f.setTextVisibility = function(e) {
          e && !this.g && vy(this), this.g && (this.g.mode = e ? "showing" : "hidden");
        }, f.setTextLanguage = function() {
        }, f.enableTextDisplayer = function() {
          vy(this);
        };
        function vy(e) {
          e.h && !e.g && (e.g = e.h.addTextTrack("subtitles", e.i), e.g.mode = "hidden");
        }
        Y("shaka.text.SimpleTextDisplayer", zt), zt.prototype.enableTextDisplayer = zt.prototype.enableTextDisplayer, zt.prototype.setTextLanguage = zt.prototype.setTextLanguage, zt.prototype.setTextVisibility = zt.prototype.setTextVisibility, zt.prototype.isTextVisible = zt.prototype.isTextVisible, zt.prototype.destroy = zt.prototype.destroy, zt.prototype.append = zt.prototype.append, zt.prototype.remove = zt.prototype.remove, zt.prototype.configure = zt.prototype.configure;
        function Xt() {
        }
        f = Xt.prototype, f.configure = function() {
        }, f.remove = function() {
        }, f.append = function() {
        }, f.destroy = function() {
        }, f.isTextVisible = function() {
          return !1;
        }, f.setTextVisibility = function() {
        }, f.setTextLanguage = function() {
        }, f.enableTextDisplayer = function() {
        }, Y("shaka.text.StubTextDisplayer", Xt), Xt.prototype.enableTextDisplayer = Xt.prototype.enableTextDisplayer, Xt.prototype.setTextLanguage = Xt.prototype.setTextLanguage, Xt.prototype.setTextVisibility = Xt.prototype.setTextVisibility, Xt.prototype.isTextVisible = Xt.prototype.isTextVisible, Xt.prototype.destroy = Xt.prototype.destroy, Xt.prototype.append = Xt.prototype.append, Xt.prototype.remove = Xt.prototype.remove, Xt.prototype.configure = Xt.prototype.configure;
        function qt(e, t) {
          var n = this;
          this.j = !1, this.h = [], this.m = e, this.l = t, this.C = this.u = null, this.g = document.createElement("div"), this.g.classList.add("shaka-text-container"), this.g.style.textAlign = "center", this.g.style.display = "flex", this.g.style.flexDirection = "column", this.g.style.alignItems = "center", this.g.style.justifyContent = "flex-end", this.B = new Ae(function() {
            n.m.paused || ki(n);
          }), Pu(this), this.o = /* @__PURE__ */ new Map(), this.i = new Ve(), this.i.D(document, "fullscreenchange", function() {
            ki(n, !0);
          }), this.i.D(
            this.m,
            "seeking",
            function() {
              ki(n, !0);
            }
          ), this.i.D(this.m, "ratechange", function() {
            Pu(n);
          }), this.i.D(this.m, "resize", function() {
            var r = n.m, i = r.videoWidth;
            r = r.videoHeight, i && r ? n.u = i / r : n.u = null;
          }), this.H = !1, this.F = null, "ResizeObserver" in C && (this.F = new ResizeObserver(function() {
            n.H || (n.H = !0, requestAnimationFrame(function() {
              n.H = !1, n.g && n.g.parentElement && n.j && ki(n, !0);
            }));
          }), this.F.observe(this.l)), this.G = /* @__PURE__ */ new Map();
        }
        f = qt.prototype, f.configure = function(e) {
          this.C = e, Pu(this), ki(this, !0);
        }, f.append = function(e) {
          var t = [].concat(X(this.h));
          e = m(gy(e));
          for (var n = e.next(), r = {}; !n.done; r = { jg: void 0 }, n = e.next()) r.jg = n.value, t.some(/* @__PURE__ */ (function(i) {
            return function(o) {
              return Oa(o, i.jg);
            };
          })(r)) || this.h.push(r.jg);
          this.h.length && Pu(this), ki(this);
        }, f.destroy = function() {
          return this.g && (this.g.parentElement && this.l.removeChild(this.g), this.g = null, this.j = !1, this.h = [], this.B && (this.B.stop(), this.B = null), this.o.clear(), this.i && (this.i.release(), this.i = null), this.F && (this.F.disconnect(), this.F = null)), Promise.resolve();
        }, f.remove = function(e, t) {
          if (!this.g) return !1;
          var n = this.h.length;
          return this.h = this.h.filter(function(r) {
            return r.startTime < e || r.endTime >= t;
          }), ki(this, n > this.h.length), this.h.length || Pu(this), !0;
        }, f.isTextVisible = function() {
          return this.j;
        }, f.setTextVisibility = function(e) {
          (this.j = e) ? (this.g.parentElement || this.l.appendChild(this.g), ki(this, !0)) : this.g.parentElement && this.l.removeChild(this.g);
        }, f.setTextLanguage = function(e) {
          e && e != "und" ? this.g.setAttribute("lang", e) : this.g.setAttribute("lang", "");
        }, f.enableTextDisplayer = function() {
        };
        function Pu(e) {
          e.B && (e.h.length ? e.B.Ea((e.C ? e.C.captionsUpdatePeriod : 0.25) / Math.max(1, Math.abs(e.m.playbackRate))) : e.B.stop());
        }
        function oI(e, t) {
          for (; t != null; ) {
            if (t == e.g) return !0;
            t = t.parentElement;
          }
          return !1;
        }
        function yy(e, t, n, r, i) {
          var o = !1, s = [], u = [];
          t = m(t);
          for (var a = t.next(); !a.done; a = t.next()) {
            a = a.value, i.push(a);
            var l = e.o.get(a), c = a.startTime <= r && a.endTime > r, d = l ? l.kj : null;
            l && (s.push(l.kg), l.Yc && s.push(l.Yc), c || (o = !0, e.o.delete(a), l = null)), c && (u.push(a), l ? oI(e, d) || (o = !0) : (sI(e, a, i), l = e.o.get(a), d = l.kj, o = !0)), a.nestedCues.length > 0 && d && yy(e, a.nestedCues, d, r, i), i.pop();
          }
          if (o) {
            for (r = m(s), i = r.next(); !i.done; i = r.next()) i = i.value, i.parentElement && i.parentElement.removeChild(i);
            for (u.sort(function(h, p) {
              return h.startTime != p.startTime ? h.startTime - p.startTime : h.endTime - p.endTime;
            }), u = m(u), r = u.next(); !r.done; r = u.next()) r = e.o.get(r.value), r.Yc ? (r.Yc.contains(n) && r.Yc.removeChild(n), n.appendChild(r.Yc), r.Yc.appendChild(r.kg)) : n.appendChild(r.kg);
          }
        }
        function ki(e, t) {
          if (e.g) {
            var n = e.m.currentTime;
            if (!e.j || t !== void 0 && t) {
              t = m(e.G.values());
              for (var r = t.next(); !r.done; r = t.next()) gu(r.value);
              gu(e.g), e.o.clear(), e.G.clear();
            }
            e.j && yy(e, e.h, e.g, n, []);
          }
        }
        function sI(e, t, n) {
          var r = n.length > 1, i = r ? "span" : "div";
          t.lineBreak && (i = "br"), t.rubyTag && (i = t.rubyTag), r = !r && t.nestedCues.length > 0;
          var o = document.createElement(i);
          if (i != "br" && aI(e, o, t, n, r), n = null, t.region && t.region.id) {
            var s = t.region, u = e.u === 4 / 3 ? 2.5 : 1.9;
            if (n = s.id + "_" + s.width + "x" + s.height + (s.heightUnits == Sn ? "%" : "px") + "-" + s.viewportAnchorX + "x" + s.viewportAnchorY + (s.viewportAnchorUnits == Sn ? "%" : "px"), e.G.has(n)) n = e.G.get(n);
            else {
              i = document.createElement("span");
              var a = s.heightUnits == Sn ? "%" : "px", l = s.widthUnits == Sn ? "%" : "px", c = s.viewportAnchorUnits == Sn ? "%" : "px";
              i.id = "shaka-text-region---" + n, i.classList.add("shaka-text-region"), i.style.position = "absolute";
              var d = s.height, h = s.width;
              s.heightUnits === 2 && (d = s.height * 5.33, a = "%"), s.widthUnits === 2 && (h = s.width * u, l = "%"), i.style.height = d + a, i.style.width = h + l, s.viewportAnchorUnits === 2 ? (u = s.viewportAnchorY / 75 * 100, a = s.viewportAnchorX / (e.u === 4 / 3 ? 160 : 210) * 100, u -= s.regionAnchorY * d / 100, a -= s.regionAnchorX * h / 100, i.style.top = u + "%", i.style.left = a + "%") : (i.style.top = s.viewportAnchorY - s.regionAnchorY * d / 100 + c, i.style.left = s.viewportAnchorX - s.regionAnchorX * h / 100 + c), s.heightUnits !== 0 && s.widthUnits !== 0 && s.viewportAnchorUnits !== 0 && (s = Math.max(0, Math.min(100 - (parseInt(i.style.width.slice(0, -1), 10) || 0), parseInt(i.style.left.slice(0, -1), 10) || 0)), i.style.top = Math.max(0, Math.min(100 - (parseInt(i.style.height.slice(0, -1), 10) || 0), parseInt(i.style.top.slice(0, -1), 10) || 0)) + "%", i.style.left = s + "%"), i.style.display = "flex", i.style.flexDirection = "column", i.style.alignItems = "center", i.style.justifyContent = t.displayAlign == "before" ? "flex-start" : t.displayAlign == "center" ? "center" : "flex-end", e.G.set(n, i), n = i;
            }
          }
          i = o, r && (i = document.createElement("span"), i.classList.add("shaka-text-wrapper"), i.style.backgroundColor = t.backgroundColor, i.style.lineHeight = "normal", o.appendChild(i)), e.o.set(t, { kg: o, kj: i, Yc: n });
        }
        function uI(e) {
          var t = e.direction, n = e.positionAlign;
          return e = e.textAlign, n !== Ua ? n : e === "left" || e === "start" && t === $s || e === "end" && t === "rtl" ? "line-left" : e === "right" || e === "start" && t === "rtl" || e === "end" && t === $s ? "line-right" : "center";
        }
        function aI(e, t, n, r, i) {
          var o = t.style, s = n.nestedCues.length == 0, u = r.length > 1;
          o.whiteSpace = "pre-wrap";
          var a = n.payload.replace(/\s+$/g, function(c) {
            return " ".repeat(c.length);
          });
          if (o.webkitTextStrokeColor = n.textStrokeColor, o.webkitTextStrokeWidth = n.textStrokeWidth, o.color = n.color, o.direction = n.direction, o.opacity = n.opacity, o.paddingLeft = Yf(n.linePadding, n, e.l), o.paddingRight = Yf(n.linePadding, n, e.l), o.textCombineUpright = n.textCombineUpright, o.textShadow = n.textShadow, n.backgroundImage) o.backgroundImage = "url('" + n.backgroundImage + "')", o.backgroundRepeat = "no-repeat", o.backgroundSize = "contain", o.backgroundPosition = "center", n.backgroundColor && (o.backgroundColor = n.backgroundColor), o.width = "100%", o.height = "100%";
          else {
            if (n.nestedCues.length) var l = t;
            else l = document.createElement("span"), t.appendChild(l);
            n.border && (l.style.border = n.border), i || ((t = lI(r, function(c) {
              return c.backgroundColor;
            })) ? l.style.backgroundColor = t : a && (l.style.backgroundColor = "rgba(0, 0, 0, 0.8)")), a && (l.setAttribute("translate", "no"), l.textContent = a);
          }
          u && !r[r.length - 1].isContainer ? o.display = "inline" : (o.display = "flex", o.flexDirection = "column", o.alignItems = "center", n.textAlign == "left" || n.textAlign == "start" ? (o.width = "100%", o.alignItems = "flex-start") : (n.textAlign == "right" || n.textAlign == "end") && (o.width = "100%", o.alignItems = "flex-end"), o.justifyContent = n.displayAlign == "before" ? "flex-start" : n.displayAlign == "center" ? "center" : "flex-end"), s || (o.margin = "0"), o.fontFamily = n.fontFamily, o.fontWeight = n.fontWeight.toString(), o.fontStyle = n.fontStyle, o.letterSpacing = n.letterSpacing, r = e.C ? e.C.fontScaleFactor : 1, (r !== 1 || n.fontSize) && (o.fontSize = Yf(n.fontSize || "1em", n, e.l, r)), r = n.line, r != null && (s = n.lineInterpretation, s == Js && (s = 1, u = 16, e.u && e.u < 1 && (u = 32), r = r < 0 ? 100 + r / u * 100 : r / u * 100), s == 1 && (o.position = "absolute", n.writingMode == Yi ? (o.width = "100%", n.lineAlign == $i ? o.top = r + "%" : n.lineAlign == "end" && (o.bottom = 100 - r + "%")) : n.writingMode == "vertical-lr" ? (o.height = "100%", n.lineAlign == $i ? o.left = r + "%" : n.lineAlign == "end" && (o.right = 100 - r + "%")) : (o.height = "100%", n.lineAlign == $i ? o.right = r + "%" : n.lineAlign == "end" && (o.left = 100 - r + "%")))), o.lineHeight = n.lineHeight, e = uI(n), e == "line-left" ? (o.cssFloat = "left", n.position !== null && (o.position = "absolute", n.writingMode == Yi ? (o.left = n.position + "%", o.width = "auto") : o.top = n.position + "%")) : e == "line-right" ? (o.cssFloat = "right", n.position !== null && (o.position = "absolute", n.writingMode == Yi ? (o.right = 100 - n.position + "%", o.width = "auto") : o.bottom = n.position + "%")) : n.position !== null && n.position != 50 && (o.position = "absolute", n.writingMode == Yi ? (o.left = n.position + "%", o.width = "auto") : o.top = n.position + "%", n.size && (o.transform = "translateX(-50%)")), o.textAlign = n.textAlign, o.textDecoration = n.textDecoration.join(" "), o.writingMode = n.writingMode, "writingMode" in document.documentElement.style && o.writingMode == n.writingMode || (o.webkitWritingMode = n.writingMode), n.size && (n.writingMode == Yi ? o.width = n.size + "%" : o.height = n.size + "%");
        }
        function Yf(e, t, n, r) {
          r = r === void 0 ? 1 : r;
          var i = (i = new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e)) ? { value: Number(i[1]), unit: i[2] } : null;
          if (!i) return e;
          switch (e = i.unit, r *= i.value, e) {
            case "%":
              return r / 100 * n.clientHeight / t.cellResolution.rows + "px";
            case "c":
              return n.clientHeight * r / t.cellResolution.rows + "px";
            default:
              return r + e;
          }
        }
        function lI(e, t) {
          for (var n = e.length - 1; n >= 0; n--) {
            var r = t(e[n]);
            if (r || r === 0) return r;
          }
          return null;
        }
        Y("shaka.text.UITextDisplayer", qt), qt.prototype.enableTextDisplayer = qt.prototype.enableTextDisplayer, qt.prototype.setTextLanguage = qt.prototype.setTextLanguage, qt.prototype.setTextVisibility = qt.prototype.setTextVisibility, qt.prototype.isTextVisible = qt.prototype.isTextVisible, qt.prototype.remove = qt.prototype.remove, qt.prototype.destroy = qt.prototype.destroy, qt.prototype.append = qt.prototype.append, qt.prototype.configure = qt.prototype.configure;
        function cI(e, t) {
          function n(o) {
            for (var s = o, u = m(t), a = u.next(); !a.done; a = u.next()) a = a.value, a.end && a.start < o && (s += a.end - a.start);
            return o = Math.floor(s / 3600), u = Math.floor(s / 60 % 60), a = Math.floor(s % 60), s = Math.floor(s * 1e3 % 1e3), (o < 10 ? "0" : "") + o + ":" + (u < 10 ? "0" : "") + u + ":" + (a < 10 ? "0" : "") + a + "." + (s < 100 ? s < 10 ? "00" : "0" : "") + s;
          }
          var r = Xf(e);
          e = `WEBVTT

`, r = m(r);
          for (var i = r.next(); !i.done; i = r.next()) i = i.value, e += n(i.startTime) + " --> " + n(i.endTime) + (function(o) {
            var s = [];
            switch (o.textAlign) {
              case "left":
                s.push("align:left");
                break;
              case "right":
                s.push("align:right");
                break;
              case Dr:
                s.push("align:middle");
                break;
              case "start":
                s.push("align:start");
                break;
              case "end":
                s.push("align:end");
            }
            switch (o.writingMode) {
              case "vertical-lr":
                s.push("vertical:lr");
                break;
              case "vertical-rl":
                s.push("vertical:rl");
            }
            return s.length ? " " + s.join(" ") : "";
          })(i) + `
`, e += i.payload + `

`;
          return e;
        }
        Y("shaka.text.WebVttGenerator", function() {
        });
        function $f(e, t) {
          this.g = t, this.j = e, this.m = /* @__PURE__ */ new Map(), this.l = void 0, this.F = !1, this.J = !0, this.u = this.I = !1, this.C = this.B = void 0, this.H = 0, this.K = { request: !1, response: !1, event: !1 }, this.o = {}, this.i = new Ve(), this.G = [], this.h = null;
        }
        $f.prototype.setMediaElement = function(e) {
          this.h = e, gI(this);
        }, $f.prototype.configure = function(e) {
          this.g = e, mI(this);
        };
        function dI(e) {
          e.m.clear(), e.F = !1, e.J = !0, e.I = !1, e.u = !1, e.B = 0, e.C = 0, e.H = 0, e.K = { request: !1, response: !1, event: !1 }, wy(e), e.o = {}, e.h = null, e.i.Qa();
        }
        function fI(e, t) {
          e.u = t, e.u ? e.l == Bl ? e.l = Fl : e.l == Vl && (e.l = Hl) : e.l == Fl ? e.l = Bl : e.l == Hl && (e.l = Vl);
        }
        function hI(e, t) {
          if (e.g && e.g.enabled && (Yt(e, "ps", { bd: "d" }), e.h && e.h.autoplay)) {
            var n = e.h.play();
            n && n.then(function() {
              e.H = t;
            }).catch(function() {
              e.H = 0;
            });
          }
        }
        function pI(e, t, n) {
          try {
            if (!e.g.enabled) return t;
            var r = Qf(e);
            e: {
              switch (n.toLowerCase()) {
                case "audio/mp4":
                case "audio/webm":
                case "audio/ogg":
                case "audio/mpeg":
                case "audio/aac":
                case "audio/flac":
                case "audio/wav":
                  var i = Ol;
                  break e;
                case "video/webm":
                case "video/mp4":
                case "video/mpeg":
                case "video/mp2t":
                  i = Ul;
                  break e;
                case "application/x-mpegurl":
                case "application/vnd.apple.mpegurl":
                case "application/dash+xml":
                case "video/vnd.mpeg.dash.mpd":
                case "application/vnd.ms-sstr+xml":
                  i = My;
                  break e;
              }
              i = void 0;
            }
            r.ot = i, r.su = !0;
            var o = Du(r);
            return Nl(t, o);
          } catch (s) {
            return ci("CMCD_SRC_ERROR", "Could not generate src CMCD data.", s), t;
          }
        }
        function gI(e) {
          e.i.D(e.h, "playing", function() {
            e.C || (e.C = Date.now()), Yt(e, "ps", { bd: "p" });
          }), e.i.D(e.h, "volumechange", function() {
            Yt(e, e.h.muted ? "m" : "um");
          }), e.i.D(e.h, "play", function() {
            e.B || (e.B = Date.now(), Yt(e, "ps", { bd: "s" }));
          }), e.i.D(e.h, "pause", function() {
            Yt(e, "ps", { bd: "a" });
          }), e.i.D(e.j, "buffering", function() {
            Yt(e, "ps", { bd: "w" });
          }), e.i.D(e.h, "seeking", function() {
            return Yt(e, "ps", { bd: "k" });
          }), e.i.D(document, "fullscreenchange", function() {
            Yt(e, document.fullscreenElement ? "pe" : "pc");
          });
          var t = e.h;
          (t.webkitPresentationMode || t.webkitSupportsFullscreen) && e.i.D(t, "webkitpresentationmodechanged", function() {
            t.webkitPresentationMode ? Yt(e, t.webkitPresentationMode !== "inline" ? "pe" : "pc") : t.webkitSupportsFullscreen && Yt(e, t.webkitDisplayingFullscreen ? "pe" : "pc");
          }), e.i.D(e.h, "enterpictureinpicture", function() {
            Yt(e, "pe");
          }), e.i.D(e.h, "leavepictureinpicture", function() {
            Yt(e, "pc");
          }), "documentPictureInPicture" in C && e.i.D(C.documentPictureInPicture, "enter", function(n) {
            Yt(e, "pe"), e.i.Aa(n.window, "pagehide", function() {
              Yt(e, "pc");
            });
          }), e.i.D(document, "visibilitychange", function() {
            document.hidden ? Yt(e, "b", { bg: !0 }) : Yt(e, "b");
          }), e.i.D(e.j, "complete", function() {
            Yt(e, "ps", { bd: "e" });
          });
        }
        function mI(e) {
          wy(e);
          var t = Ty(e);
          t = m(t);
          for (var n = t.next(); !n.done; n = t.next()) if (n = n.value.timeInterval, n === void 0 && (n = PI), n >= 1) {
            var r = new Ae(function() {
              return Yt(e, DI);
            });
            r.Ea(n), e.G.push(r);
          }
        }
        function wy(e) {
          if (e.G) for (var t = m(e.G), n = t.next(); !n.done; n = t.next()) n.value.stop();
          e.G = [];
        }
        function Ty(e) {
          return (e = e.g.targets) ? e.filter(function(t) {
            return t.mode === Ry && t.enabled;
          }) : [];
        }
        function Jf(e) {
          return (e = e.g.targets) ? e.filter(function(t) {
            return t.mode === Dy && t.enabled === !0;
          }) : [];
        }
        function Qf(e) {
          return e.g.sessionId || (e.g.sessionId = C.crypto.randomUUID()), { v: e.g.version, sf: e.l, sid: e.g.sessionId, cid: e.g.contentId, mtp: e.j.getBandwidthEstimate() / 1e3 };
        }
        function Yt(e, t, n) {
          if (n = n === void 0 ? {} : n, t = Object.assign({ e: t, ts: Date.now() }, n), t = th(e, t, Ry), n = e.g.targets, !(e.g.version < rh) && n) {
            var r = Ty(e);
            n = Array.from(new Set([].concat(X(ih), X(MI)))), r = m(r);
            for (var i = r.next(); !i.done; i = r.next()) {
              i = i.value;
              var o = Zf(i.includeKeys || [], n);
              o.includes(ky) || o.push(ky), o = eh(t, o);
              var s = i.events || [], u = o.e, a = o.sta;
              u && (!CI.includes(u) || !(u !== "ps" || a && kI.includes(a)) || s && s.length > 0 && !s.includes(u)) || Sy(e, o, i);
            }
          }
        }
        function us(e, t, n) {
          if (e.g.enabled) {
            n = th(e, n, Py);
            var r = xy({ mode: Py, useHeaders: e.g.useHeaders, includeKeys: e.g.includeKeys || [] });
            e.o[r] || (e.o[r] = { request: 1, response: 1 }), n.sn = e.o[r].request++, r = e.g.includeKeys || [];
            var i = e.g.version == rh ? Array.from(new Set([].concat(X(ih), X(EI)))) : Cy;
            r = Zf(r, i), n = eh(n, r), vI(e, n, t, e.g.useHeaders);
          }
        }
        function Sy(e, t, n, r) {
          var i = cr(), o = n.url;
          if (n.useHeaders) {
            if (t = Iy(t), !Object.keys(t).length) return;
            r && Object.assign(r.headers, t), r = At([o], i), Object.assign(r.headers, t);
          } else {
            if (t = Du(t), !t) return;
            o = Nl(o, t), r && (r.uri = o), r = At([o], i);
          }
          e.j.Yb().request(9, r);
        }
        function vI(e, t, n, r) {
          if (r) {
            if (t = Iy(t), !Object.keys(t).length) return;
            Object.assign(n.headers, t);
          } else {
            var i = Du(t);
            if (!i) return;
            n.uris = n.uris.map(function(o) {
              return Nl(o, i);
            });
          }
          Jf(e).length > 0 || !e.m.has(n) || e.m.delete(n);
        }
        function Zf(e, t) {
          if (!e || e.length === 0) return t;
          for (var n = m(e), r = n.next(); !r.done; r = n.next()) t.includes(r.value);
          return e = e.filter(function(i) {
            return t.includes(i);
          });
        }
        function eh(e, t) {
          return Object.keys(e).reduce(function(n, r) {
            return t.includes(r) && (n[r] = e[r]), n;
          }, {});
        }
        function yI(e) {
          if (e.type === 0) return SI;
          if (e = e.stream) {
            var t = e.type;
            if (t == "video") return e.codecs && e.codecs.includes(",") ? Ul : jl;
            if (t == "audio") return Ol;
            if (t == "text") return e.mimeType === "application/mp4" ? _l : nh;
          }
        }
        function xy(e) {
          var t = Object.keys(e).sort().reduce(function(n, r) {
            return r !== "enabled" && (n[r] = e[r]), n;
          }, {});
          return JSON.stringify(t);
        }
        function wI(e, t) {
          if (t = e.j.Hc()[t], !t.length) return NaN;
          var n = e.h ? e.h.currentTime : 0;
          return (e = t.find(function(r) {
            return r.start <= n && r.end >= n;
          })) ? (e.end - n) * 1e3 : NaN;
        }
        function Ay(e, t) {
          if (t = e.j.Hc()[t], !t.length) return 0;
          var n = e.h ? e.h.currentTime : 0;
          return (e = t.find(function(r) {
            return r.start <= n && r.end >= n;
          })) ? (e.end - n) * 1e3 : 0;
        }
        function TI(e, t) {
          var n = e.j.sc();
          if (!n.length) return NaN;
          e = n[0], n = m(n);
          for (var r = n.next(); !r.done; r = n.next()) r = r.value, r.type === "variant" && r.bandwidth > e.bandwidth && (e = r);
          switch (t) {
            case jl:
              return e.videoBandwidth || NaN;
            case Ol:
              return e.audioBandwidth || NaN;
            default:
              return e.bandwidth;
          }
        }
        function Ey(e, t, n) {
          var r = t.segment, i = 0;
          r && (i = r.endTime - r.startTime), i = { d: i * 1e3, st: e.j.U() ? AI : xI }, i.ot = yI(t);
          var o = i.ot === jl || i.ot === Ol || i.ot === Ul || i.ot === _l;
          if (t = t.stream) {
            var s = e.j.Ob();
            if (o && (i.bl = wI(e, t.type), i.ot !== _l)) {
              var u = Ay(e, t.type);
              i.dl = s ? u / Math.abs(s) : u;
            }
            if (t.bandwidth && (i.br = t.bandwidth / 1e3), t.segmentIndex && r) {
              if ((s = t.segmentIndex.Xb(r.endTime, !0, s < 0)) && (s = s.next().value) && s != r) {
                if (n && !di(r.P(), s.P())) {
                  var a = s.P()[0];
                  u = new URL(a);
                  var l = new URL(n);
                  if (u.origin !== l.origin) n = a;
                  else {
                    n = u.pathname.split("/").slice(1), a = l.pathname.split("/").slice(1, -1), l = Math.min(n.length, a.length);
                    for (var c = 0; c < l && n[c] === a[c]; c++) n.shift(), a.shift();
                    for (; a.length; ) a.shift(), n.unshift("..");
                    n = n.join("/") + u.search + u.hash;
                  }
                  i.nor = n;
                }
                !s.startByte && !s.endByte || r.startByte == s.startByte && r.endByte == s.endByte || (n = s.startByte + "-", s.endByte && (n += s.endByte), i.nrr = n);
              }
              s = e.j.Ob() || 1, n = Ay(e, t.type) || 500, r = (t = t.bandwidth) ? t * (r.endTime - r.startTime) / 1e3 / (n / s / 1e3) * e.g.rtpSafetyFactor : NaN, isNaN(r) || (i.rtp = r);
            }
          }
          return o && i.ot !== _l && (i.tb = TI(e, i.ot) / 1e3), i;
        }
        function th(e, t, n) {
          Object.assign(t, Qf(e)), t.pr = e.j.Ob();
          var r = t.ot === jl || t.ot === Ul;
          return e.I && r && (t.bs = !0, t.su = !0, e.I = !1), t.su == null && (t.su = e.J), e.j.U() && (r = Zy(e.j), t.ltc = r || void 0), document.hidden && (t.bg = !0), r = e.C && e.B ? e.C - (e.H || e.B) : void 0, r == null || e.K[n] || (t.msd = r, e.K[n] = !0), t;
        }
        function Du(e) {
          function t(d) {
            return n(d / 100) * 100;
          }
          function n(d) {
            return Math.round(d);
          }
          function r(d) {
            return !Number.isNaN(d) && d != null && d !== "" && d !== !1;
          }
          var i = [], o = { br: n, d: n, bl: t, dl: t, mtp: t, nor: function(d) {
            return encodeURIComponent(d);
          }, rtp: t, tb: n, ttfb: n, ttlb: n }, s = Object.keys(e || {}).sort();
          s = m(s);
          for (var u = s.next(); !u.done; u = s.next()) {
            u = u.value;
            var a = e[u];
            if (r(a) && (u !== "v" || a !== 1) && (u != "pr" || a !== 1)) {
              var l = o[u];
              l && (a = l(a)), l = typeof a;
              var c = void 0;
              c = l === "string" && u !== "ot" && u !== "sf" && u !== "st" ? u + "=" + JSON.stringify(a) : l === "boolean" ? u : l === "symbol" ? u + "=" + a.description : u + "=" + a, i.push(c);
            }
          }
          return i.join(",");
        }
        function Iy(e) {
          var t = Object.keys(e), n = {}, r = ["Object", "Request", "Session", "Status"], i = [{}, {}, {}, {}], o = { br: 0, d: 0, ot: 0, tb: 0, url: 0, bl: 1, dl: 1, mtp: 1, nor: 1, nrr: 1, su: 1, ltc: 1, ttfb: 1, ttlb: 1, ts: 1, rc: 1, cmsdd: 1, cmsds: 1, sn: 1, cid: 2, pr: 2, sf: 2, sid: 2, st: 2, v: 2, msd: 2, bs: 3, rtp: 3, bg: 3 };
          t = m(t);
          for (var s = t.next(); !s.done; s = t.next()) s = s.value, i[o[s] != null ? o[s] : 1][s] = e[s];
          for (e = 0; e < i.length; e++) (o = Du(i[e])) && (n["CMCD-" + r[e]] = o);
          return n;
        }
        function Nl(e, t) {
          return !t || e.includes("offline:") ? e : (e = new yt(e), e.g.set("CMCD", t), e.toString());
        }
        var My = "m", Ol = "a", jl = "v", Ul = "av", SI = "i", nh = "c", _l = "tt", rh = 2, xI = "v", AI = "l", Bl = "d", Fl = "ld", Vl = "h", Hl = "lh";
        Y("shaka.util.CmcdManager.StreamingFormat", { DASH: Bl, Ql: Fl, HLS: Vl, Rl: Hl, gm: "s", OTHER: "o" });
        var Cy = "br bl bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v".split(" "), ih = "br ab bl tbl bs cdn cid ltc mtp pr sf sid bg sta st ts tpb tb lb tab lab pt ec msd v sn".split(" "), EI = "ab bl tbl bs cdn cid d dl ltc mtp nor ot pr rtp sf sid bg sta st su ts tpb tb lb tab lab pt ec msd v".split(" "), II = "d dl nor ot rtp rc su ttfb ttfbb ttlb url cmsdd cmsds".split(" "), MI = ["e", "sta"], CI = "ps e t c b m um pe pc".split(" "), kI = "spawkrfeqd".split(""), PI = 10, ky = "ts", DI = "t", Py = "request", Dy = "response", Ry = "event";
        function $n(e) {
          this.h = e, this.g = null;
        }
        f = $n.prototype, f.configure = function(e) {
          this.h = e;
        }, f.ei = function() {
          return this.h.enabled && this.h.applyMaximumSuggestedBitrate && this.g && this.g.has(Ny) ? this.g.get(Ny) * 1e3 : null;
        }, f.ci = function() {
          return this.h.enabled && this.g && this.g.has(by) ? this.g.get(by) * 1e3 : null;
        }, f.Uj = function() {
          return this.h.enabled && this.g && this.g.has(Oy) ? this.g.get(Oy) : null;
        }, f.Vj = function() {
          return this.h.enabled && this.g && this.g.has(jy) ? this.g.get(jy) : null;
        }, f.getBandwidthEstimate = function(e) {
          var t = this.ci();
          if (!t) return e;
          var n = this.h.estimatedThroughputWeightRatio;
          return n > 0 && n <= 1 ? e * (1 - n) + t * n : e;
        };
        function Ly(e) {
          return e ? e.toLowerCase() === "false" ? !1 : /^[-0-9]/.test(e) ? parseInt(e, 10) : e.replace(/["]+/g, "") : !0;
        }
        Y("shaka.util.CmsdManager", $n), $n.prototype.getBandwidthEstimate = $n.prototype.getBandwidthEstimate, $n.prototype.getRoundTripTime = $n.prototype.Vj, $n.prototype.getResponseDelay = $n.prototype.Uj, $n.prototype.getEstimatedThroughput = $n.prototype.ci, $n.prototype.getMaxBitrate = $n.prototype.ei;
        var by = "etp", Ny = "mb", Oy = "rd", jy = "rtt";
        function Uy() {
          this.g = null, this.h = [];
        }
        function oh(e, t) {
          return D(function(n) {
            if (n.g == 1) return e.g ? x(n, new Promise(function(r) {
              return e.h.push(r);
            }), 2) : n.A(2);
            e.g = t, q(n);
          });
        }
        Uy.prototype.release = function() {
          this.h.length > 0 ? this.h.shift()() : this.g = null;
        };
        function sh(e, t, n) {
          return n = n === void 0 ? Number.EPSILON : n, e === t ? !0 : (e = Math.abs(e - t), e <= n ? !0 : n !== Number.EPSILON ? Math.abs(e - n) <= Number.EPSILON : !1);
        }
        function V(e, t, n) {
          t = t === void 0 ? null : t, Xe.call(this);
          var r = this;
          this.m = Yl, this.h = null, this.Ae = t, this.$ = !1, this.Ke = new Ve(), this.Be = new Ve(), this.j = new Ve(), this.fc = new Ve(), this.Hd = new Ve(), this.G = this.H = this.F = this.N = null, this.Le = 0, this.ba = new Uy(), this.O = this.Fa = this.X = this.i = this.Ac = this.I = this.l = this.xe = this.T = this.Mh = this.va = this.K = this.kb = this.za = this.ze = this.R = this.Ta = this.M = this.cc = null, this.Ua = !1, this.Fe = this.o = null, this.Ee = 1e9, this.Je = [], this.zc = /* @__PURE__ */ new Map(), this.ob = [], this.Xf = -1, this.g = xr(this), this.Zf = iy(), this.W = null, this.Me = -1, this.ec = null, this.ya = { width: 1 / 0, height: 1 / 0 }, this.De = new ef(this.g, this.ya, null), this.He = [], this.B = null, this.J = this.g.adaptationSetCriteriaFactory(), this.J.configure({
            language: this.g.preferredAudioLanguage,
            role: this.g.preferredAudioRole,
            videoRole: this.g.preferredVideoRole,
            channelCount: 0,
            hdrLevel: this.g.preferredVideoHdrLevel,
            spatialAudio: this.g.preferSpatialAudio,
            videoLayout: this.g.preferredVideoLayout,
            audioLabel: this.g.preferredAudioLabel,
            videoLabel: this.g.preferredVideoLabel,
            codecSwitchingStrategy: this.g.mediaSource.codecSwitchingStrategy,
            audioCodec: "",
            activeAudioCodec: "",
            activeAudioChannelCount: 0,
            preferredAudioCodecs: this.g.preferredAudioCodecs,
            preferredAudioChannelCount: this.g.preferredAudioChannelCount
          }), this.Ld = this.g.preferredTextLanguage, this.Pd = this.g.preferredTextRole, this.Od = this.g.preferForcedSubs, this.Ce = [], n && n(this), this.K = new $f(this, this.g.cmcd), this.va = new $n(this.g.cmsd), this.N = Wy(this), this.ma = this.oa = this.Da = this.C = null, this.ag = !1, this.Yf = [], this.$f = new Ae(function() {
            return D(function(i) {
              if (i.g == 1) return r.oa ? x(i, r.Vb(r.ma, !0), 3) : i.A(0);
              if (i.g != 4) return x(i, r.load(r.oa), 4);
              r.ag ? r.ma.pause() : r.ma.play(), r.oa = null, r.ag = !1, q(i);
            });
          }), $l && (this.C = $l(), this.C.configure(this.g.ads), this.Hd.D(this.C, "ad-content-pause-requested", function(i) {
            var o, s;
            return D(function(u) {
              if (u.g == 1)
                return r.$f.stop(), r.oa ? u.A(0) : (r.ma = r.h, r.ag = r.fe(), o = i.saveLivePosition || !1, s = !0, r.U() && (s = o), x(u, r.Xh(!0, s), 3));
              r.oa = u.h, q(u);
            });
          }), this.Hd.D(
            this.C,
            "ad-content-resume-requested",
            function(i) {
              if (i = i.offset || 0, r.oa) {
                var o = r.oa;
                o.o && i && (typeof o.o == "number" ? o.o += i : o.o.setTime(o.o.getTime() + i * 1e3));
              }
              r.$f.ka(0.1);
            }
          ), this.Hd.D(this.C, "ad-content-attach-requested", function() {
            return D(function(i) {
              if (i.g == 1) return r.h || !r.ma ? i.A(0) : x(i, r.Vb(r.ma, !0), 3);
              r.ma = null, q(i);
            });
          })), Jl && (this.Da = Jl(this), this.Da.configure(this.g.queue)), this.Ke.D(C, "online", function() {
            hh(r), r.ih();
          }), this.Ge = new Ae(function() {
            for (var i = Date.now() / 1e3, o = !1, s = !0, u = m(r.i.variants), a = u.next(); !a.done; a = u.next()) a = a.value, a.disabledUntilTime > 0 && a.disabledUntilTime <= i && (a.disabledUntilTime = 0, o = !0), a.disabledUntilTime > 0 && (s = !1);
            s && r.Ge.stop(), o && Di(r, !1, void 0, !1, !1);
          }), this.eb = null, e && (Ne("Player w/ mediaElement", "Please migrate from initializing Player with a mediaElement; use the attach method instead."), this.Vb(e, !0)), this.u = null;
        }
        tt(V, Xe);
        function Gl(e) {
          e.T != null && (Og(e.T), e.T.release(), e.T = null);
        }
        function RI(e, t, n) {
          n || t.lcevc.enabled ? (Gl(e), e.T == null && (e.T = new Gs(e.h, e.Mh, t.lcevc, n), e.H && (e.H.C = e.T))) : Gl(e);
        }
        function Ze(e, t) {
          return new ee(e, t);
        }
        f = V.prototype, f.destroy = function() {
          var e = this, t;
          return D(function(n) {
            switch (n.g) {
              case 1:
                return e.m == dr ? n.return() : (Gl(e), t = e.detach(), e.m = dr, x(n, t, 2));
              case 2:
                return x(n, e.ng(), 3);
              case 3:
                if (e.Ke && (e.Ke.release(), e.Ke = null), e.Be && (e.Be.release(), e.Be = null), e.j && (e.j.release(), e.j = null), e.fc && (e.fc.release(), e.fc = null), e.Hd && (e.Hd.release(), e.Hd = null), e.Fe = null, e.g = null, e.B = null, e.Ae = null, e.K = null, e.va = null, !e.N) {
                  n.A(4);
                  break;
                }
                return x(n, e.N.destroy(), 5);
              case 5:
                e.N = null;
              case 4:
                e.o && (e.o.release(), e.o = null), e.Da && (e.Da.destroy(), e.Da = null), Xe.prototype.release.call(e), q(n);
            }
          });
        };
        function _y(e, t) {
          p0.set(e, t);
        }
        function as(e, t) {
          e.dispatchEvent(Ze("onstatechange", (/* @__PURE__ */ new Map()).set("state", t)));
        }
        f.Vb = function(e, t) {
          t = t === void 0 ? !0 : t;
          var n = this, r, i, o;
          return D(function(s) {
            switch (s.g) {
              case 1:
                if (n.m == dr) throw new b(2, 7, 7e3);
                if (r = n.h && n.h == e, !n.h || n.h == e) {
                  s.A(2);
                  break;
                }
                return x(s, n.detach(), 2);
              case 2:
                return x(s, uh(n, "attach"), 4);
              case 4:
                if (s.h) return s.return();
                if (de(s, 5, 6), r || (as(n, "attach"), i = function() {
                  var u = ph(n, !1);
                  u && ls(n, u);
                }, n.Be.D(e, "error", i), n.h = e, n.K && n.K.setMediaElement(e)), Se(), !t || !br() || n.H) {
                  s.A(6);
                  break;
                }
                return x(s, ah(n), 6);
              case 6:
                Ct(s), n.ba.release(), ln(s, 0);
                break;
              case 5:
                return o = he(s), x(s, n.detach(), 10);
              case 10:
                throw o;
            }
          });
        }, f.nj = function(e) {
          this.Mh = e;
        }, f.detach = function(e) {
          e = e === void 0 ? !1 : e;
          var t = this;
          return D(function(n) {
            if (n.g == 1) {
              if (t.m == dr) throw new b(2, 7, 7e3);
              return x(n, t.Dc(!1, e), 2);
            }
            if (n.g != 3) return x(n, uh(t, "detach"), 3);
            if (n.h) return n.return();
            try {
              t.h && (t.Be.Qa(), t.h = null), as(t, "detach"), t.C && !e && t.C.release();
            } finally {
              t.ba.release();
            }
            q(n);
          });
        };
        function uh(e, t) {
          var n;
          return D(function(r) {
            return r.g == 1 ? (n = ++e.Le, x(r, oh(e.ba, t), 2)) : n != e.Le ? (e.ba.release(), r.return(!0)) : r.return(!1);
          });
        }
        f.Dc = function(e, t) {
          e = e === void 0 ? !0 : e, t = t === void 0 ? !1 : t;
          var n = this, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A;
          return D(function(I) {
            switch (I.g) {
              case 1:
                return n.m != dr && (n.m = Yl), x(I, uh(n, "unload"), 2);
              case 2:
                return I.h ? I.return() : (ir(I, 3), n.Ua = !1, as(n, "unload"), Gl(n), r = n.Ce.map(function(P) {
                  return P();
                }), n.Ce = [], x(I, Promise.all(r), 5));
              case 5:
                if (n.dispatchEvent(Ze("unloading")), n.ze && (n.ze.release(), n.ze = null), n.za && (n.za.release(), n.za = null), n.kb && (n.kb.release(), n.kb = null), n.h && (n.j.Qa(), n.fc.Qa()), n.Ge.stop(), n.cc && (n.cc.release(), n.cc = null), n.Ta && (n.Ta.stop(), n.Ta = null), !n.I) {
                  I.A(6);
                  break;
                }
                return x(I, n.I.stop(), 7);
              case 7:
                n.I = null, n.Ac = null;
              case 6:
                if (n.o && n.o.stop(), !n.l) {
                  I.A(8);
                  break;
                }
                return x(I, n.l.destroy(), 9);
              case 9:
                n.l = null;
              case 8:
                if (n.M && (n.M.release(), n.M = null), n.G && (n.G.release(), n.G = null), C.shakaMediaKeysPolyfill !== "webkit" || !n.F) {
                  I.A(10);
                  break;
                }
                return x(I, n.F.destroy(), 11);
              case 11:
                n.F = null;
              case 10:
                if (!n.H) {
                  I.A(12);
                  break;
                }
                return x(I, n.H.destroy(), 13);
              case 13:
                n.H = null;
              case 12:
                if (n.C && !t && n.C.onAssetUnload(), n.oa && !t && (n.oa.destroy(), n.oa = null), t || n.$f.stop(), n.K && dI(n.K), n.va && (n.va.g = null), !n.u) {
                  I.A(14);
                  break;
                }
                return x(I, n.u.destroy(), 15);
              case 15:
                n.u = null;
              case 14:
                if (n.$ = !1, n.h) {
                  for (i = m(n.Yf), o = i.next(); !o.done; o = i.next()) s = o.value, s.src.startsWith("blob:") && URL.revokeObjectURL(s.src), s.remove();
                  n.Yf = [], ul(n.h) && n.h.load();
                }
                if (!n.F) {
                  I.A(16);
                  break;
                }
                return x(I, n.F.destroy(), 17);
              case 17:
                n.F = null;
              case 16:
                if (n.eb && n.X != n.eb.pd() && (n.eb.l || n.eb.destroy(), n.eb = null), n.X = null, n.Fa = null, n.R = null, n.i) {
                  for (u = m(n.i.variants), a = u.next(); !a.done; a = u.next()) for (l = a.value, c = m([l.audio, l.video]), d = c.next(); !d.done; d = c.next()) (h = d.value) && h.segmentIndex && h.segmentIndex.release();
                  for (p = m(n.i.textStreams), g = p.next(); !g.done; g = p.next()) w = g.value, w.segmentIndex && w.segmentIndex.release();
                }
                for (n.g && n.g.streaming.clearDecodingCache && (Xa.clear(), Po.clear()), n.i = null, n.B = new bl(), n.Lh = null, n.ec = null, n.W = null, n.Me = -1, n.Je = [], T = m(n.zc.values()), E = T.next(); !E.done; E = T.next()) A = E.value, A.stop();
                n.zc.clear(), n.ob = [], n.Xf = -1, n.N && n.N.Th(), Ru(n);
              case 3:
                Ct(I), n.ba.release(), ln(I, 4);
                break;
              case 4:
                if (Se(), e && br() && !n.H && n.h) return x(I, ah(n), 0);
                I.A(0);
            }
          });
        }, f.ll = function(e) {
          this.O = e;
        }, f.load = function(e, t, n) {
          t = t === void 0 ? null : t;
          var r = this, i, o, s, u, a, l, c, d, h, p, g, w, T, E;
          return D(function(A) {
            switch (A.g) {
              case 1:
                if (r.m == dr) throw new b(2, 7, 7e3);
                if (r.h || !r.ma) {
                  A.A(2);
                  break;
                }
                return x(A, r.Vb(r.ma, !0), 3);
              case 3:
                r.ma = null;
              case 2:
                if (i = null, o = "", e instanceof Yn) {
                  if (e.l) throw new b(2, 7, 7006);
                  i = e, o = i.pd() || "";
                } else o = e || "";
                return x(A, oh(r.ba, "load"), 4);
              case 4:
                if (r.ba.release(), !r.h) throw new b(2, 7, 7002);
                if (!r.X) {
                  A.A(5);
                  break;
                }
                return r.X = o, x(A, r.Dc(!1), 5);
              case 5:
                if (s = ++r.Le, u = function() {
                  return D(function(I) {
                    if (I.g == 1) return r.Le == s ? I.A(0) : i ? x(I, i.destroy(), 3) : I.A(3);
                    throw new b(2, 7, 7e3);
                  });
                }, a = function(I, P) {
                  return D(function(N) {
                    switch (N.g) {
                      case 1:
                        return ir(N, 2), x(N, oh(r.ba, P), 4);
                      case 4:
                        return x(N, u(), 5);
                      case 5:
                        return x(N, I(), 6);
                      case 6:
                        return x(N, u(), 7);
                      case 7:
                        i && r.g && (i.g = r.g);
                      case 2:
                        Ct(N), r.ba.release(), ln(N, 0);
                    }
                  });
                }, de(A, 7, 8), t == null && i && (t = i.getStartTime()), r.O = t, r.Ua = !1, r.dispatchEvent(Ze("loading")), i) {
                  n = i.W, A.A(10);
                  break;
                }
                if (n) {
                  A.A(10);
                  break;
                }
                return x(A, a(function() {
                  return D(function(I) {
                    if (I.g == 1) return x(
                      I,
                      Hy(r, o),
                      2
                    );
                    n = I.h, q(I);
                  });
                }, "guessMimeType_"), 10);
              case 10:
                if (l = !!i, i) {
                  uy(i, r), r.B = i.getStats(), A.A(13);
                  break;
                }
                return x(A, Fy(r, o, t, n, !0, r.g), 14);
              case 14:
                (i = A.h) ? (i.F = !1, uy(i, r), r.B = i.getStats(), i.start(), i.B.catch(function() {
                })) : r.B = new bl();
              case 13:
                return c = !i, d = Date.now() / 1e3, r.B = i ? i.getStats() : new bl(), r.X = o, r.Fa = n || null, Ru(r), h = function() {
                  var I = r.h ? r.h.buffered : null;
                  return { start: sv(I) || 0, end: sl(I) || 0 };
                }, r.za = new yu(h), r.za.addEventListener("regionadd", function(I) {
                  lh(r, I.region, "metadataadded");
                }), c ? x(
                  A,
                  a(function() {
                    return D(function(I) {
                      return x(I, OI(r, n), 0);
                    });
                  }, "initializeSrcEqualsDrmInner_"),
                  25
                ) : (r.kb = new yu(h), x(A, a(function() {
                  return D(function(I) {
                    if (I.g == 1) return x(I, Promise.race([i.ma, i.B]), 2);
                    r.Ac = i.H;
                    var P = i;
                    P.oa = !0, r.I = P.m, r.i = i.Hg(), q(I);
                  });
                }, "waitForFinish"), 17));
              case 17:
                if (r.H) {
                  A.A(18);
                  break;
                }
                return x(A, a(function() {
                  return D(function(I) {
                    return x(I, ah(r), 0);
                  });
                }, "initializeMediaSourceEngineInner_"), 18);
              case 18:
                return r.i && r.i.textStreams.length && (r.u.enableTextDisplayer ? r.u.enableTextDisplayer() : Ne("Text displayer w/ enableTextDisplayer", 'Text displayer should have a "enableTextDisplayer" method!')), x(A, a(function() {
                  return D(function(I) {
                    return x(I, i.B, 0);
                  });
                }, "waitForFinish"), 20);
              case 20:
                if (r.g = i.getConfiguration(), r.De = i.G, r.I && r.I.setMediaElement && r.h && r.I.setMediaElement(r.h), r.ze = YE(i), r.xe = i.Fa, (p = i.C) && (r.J = p), l && r.h && r.h.nodeName === "AUDIO" && (LI(r), r.configure("manifest.disableVideo", !0)), i.j) {
                  A.A(21);
                  break;
                }
                return x(
                  A,
                  a(function() {
                    return D(function(I) {
                      return x(I, ay(i, r.h), 0);
                    });
                  }, "drmEngine_.init"),
                  21
                );
              case 21:
                return r.F = $E(i), x(A, a(function() {
                  return D(function(I) {
                    return x(I, r.F.Vb(r.h), 0);
                  });
                }, "drmEngine_.attach"), 23);
              case 23:
                return g = r.g.abrFactory, r.o && r.Fe == g || (r.Fe = g, r.o && r.o.release(), r.o = g(), typeof r.o.setMediaElement != "function" && (Ne("AbrManager w/o setMediaElement", "Please use an AbrManager with setMediaElement function."), r.o.setMediaElement = function() {
                }), typeof r.o.setCmsdManager != "function" && (Ne("AbrManager w/o setCmsdManager", "Please use an AbrManager with setCmsdManager function."), r.o.setCmsdManager = function() {
                }), typeof r.o.trySuggestStreams != "function" && (Ne("AbrManager w/o trySuggestStreams", "Please use an AbrManager with trySuggestStreams function."), r.o.trySuggestStreams = function() {
                }), r.o.configure(r.g.abr)), w = JE(i), T = i.i, x(A, a(function() {
                  return D(function(I) {
                    return x(I, NI(r, d, T, w), 0);
                  });
                }, "loadInner_"), 24);
              case 24:
                qE(i), r.Fa && Se().dj() && Ba(r.Fa) && FA(r.H, r.X, r.Fa), A.A(16);
                break;
              case 25:
                return x(
                  A,
                  a(function() {
                    return D(function(I) {
                      return x(I, jI(r, d, n), 0);
                    });
                  }, "srcEqualsInner_"),
                  16
                );
              case 16:
                r.dispatchEvent(Ze("loaded"));
              case 8:
                if (Ct(A), !i) {
                  A.A(27);
                  break;
                }
                return x(A, i.destroy(), 27);
              case 27:
                r.eb = null, ln(A, 0);
                break;
              case 7:
                if (E = he(A), !E || E.code == 7e3) {
                  A.A(29);
                  break;
                }
                return x(A, r.Dc(!1), 29);
              case 29:
                throw E;
            }
          });
        };
        function LI(e) {
          for (var t = m(e.i.variants), n = t.next(); !n.done; n = t.next()) n = n.value, n.video && (n.video.closeSegmentIndex(), n.video = null), n.bandwidth = n.audio && n.audio.bandwidth ? n.audio.bandwidth : 0;
          e.i.variants = e.i.variants.filter(function(r) {
            return r.audio;
          });
        }
        f.gj = function(e, t, n) {
          e = e === void 0 ? !0 : e, t = t === void 0 ? !1 : t, n = n === void 0 ? !1 : n;
          var r = this, i;
          return D(function(o) {
            return o.g == 1 ? x(o, By(r, n), 2) : o.g != 3 ? (i = o.h, x(o, r.Dc(e, t), 3)) : o.return(i);
          });
        }, f.Xh = function(e, t) {
          e = e === void 0 ? !1 : e, t = t === void 0 ? !1 : t;
          var n = this, r;
          return D(function(i) {
            return i.g == 1 ? x(i, By(n, t), 2) : i.g != 3 ? (r = i.h, x(i, n.detach(e), 3)) : i.return(r);
          });
        };
        function By(e, t) {
          t = t === void 0 ? !1 : t;
          var n, r, i;
          return D(function(o) {
            if (o.g == 1)
              return n = null, e.i && e.I && e.Ac && e.X && e.g ? (r = e.h.currentTime, t || (r = null), x(o, Vy(e, e.X, r, e.Fa, e.g, !0, !1), 3)) : o.A(2);
            if (o.g != 2) {
              n = o.h, e.He.push(n), e.I && e.I.setMediaElement && e.I.setMediaElement(null), (i = e.l ? e.l.o : null) && (n.i = i);
              var s = n, u = e.I, a = e.Ac;
              s.h = e.i, s.m = u, s.H = a, n.C = e.J, n.start(), e.i = null, e.I = null, e.Ac = null, e.o = null, e.Fe = null;
            }
            return o.return(n);
          });
        }
        f.preload = function(e, t, n, r) {
          t = t === void 0 ? null : t;
          var i = this, o, s;
          return D(function(u) {
            return u.g == 1 ? (o = xr(i), Qr(o, r || i.g, xr(i)), x(u, Fy(i, e, t, n, !1, o), 2)) : ((s = u.h) ? s.start() : ls(i, new b(2, 7, 7005)), u.return(s));
          });
        }, f.ng = function() {
          var e = this, t, n, r, i;
          return D(function(o) {
            for (t = [], n = m(e.He), r = n.next(); !r.done; r = n.next()) i = r.value, i.l || t.push(i.destroy());
            return e.He = [], x(o, Promise.all(t), 0);
          });
        };
        function Fy(e, t, n, r, i, o) {
          i = i === void 0 ? !1 : i;
          var s, u, a;
          return D(function(l) {
            return l.g == 1 ? r ? l.A(2) : x(l, Hy(e, t), 3) : (l.g != 2 && (r = l.h), bI(e, r) ? l.return(null) : (s = o || e.g, u = !1, i && e.h && e.h.nodeName === "AUDIO" && (u = !0), a = Vy(e, t, n, r || null, s, !i, u), a = i ? a.then(function(c) {
              return c.F = !1, c;
            }) : a.then(function(c) {
              return e.He.push(c), c;
            }), l.return(a)));
          });
        }
        function Vy(e, t, n, r, i, o, s) {
          o = o === void 0 ? !0 : o, s = s === void 0 ? !1 : s;
          var u, a, l, c, d, h, p, g, w, T, E, A, I, P, N;
          return D(function(M) {
            return M.g == 1 ? (u = null, a = ar(i), s && (a.manifest.disableVideo = !0), l = function() {
              return u.R && u.l ? null : u;
            }, c = function() {
              return l() ? l().getConfiguration() : e.g;
            }, e.ya.width != 1 / 0 || e.ya.height != 1 / 0 || e.g.ignoreHardwareResolution ? M.A(2) : (d = Se(), x(M, d.nc(), 3))) : (M.g != 2 && (h = M.h, e.ya.width = h.width, e.ya.height = h.height), p = new ef(a, e.ya, null), g = { networkingEngine: e.N, filter: function(R) {
              var k, O;
              return D(function(L) {
                if (L.g == 1) return x(L, Gm(p, R), 2);
                if (L.g != 4)
                  return k = L.h, k ? (O = Ze("trackschanged"), x(L, Promise.resolve(), 4)) : L.A(0);
                u.dispatchEvent(O), q(L);
              });
            }, makeTextStreamsForClosedCaptions: function(R) {
              return YI(e, R);
            }, onTimelineRegionAdded: function(R) {
              If(u.I, R);
            }, onEvent: function(R) {
              return u.dispatchEvent(R);
            }, onError: function(R) {
              return u.onError(R);
            }, isLowLatencyMode: function() {
              return c().streaming.lowLatencyMode;
            }, updateDuration: function() {
              e.l && u.R && e.l.updateDuration();
            }, newDrmInfo: function(R) {
              var k = u.j, O = k ? k.g : null;
              O && k.B && zm(p, O.keySystem, R);
            }, onManifestUpdated: function() {
              var R = (/* @__PURE__ */ new Map()).set("isLive", e.U());
              u.dispatchEvent(Ze("manifestupdated", R)), Mu(u, !1, function() {
                e.C && e.C.onManifestUpdated(e.U());
              });
            }, getBandwidthEstimate: function() {
              return e.o.getBandwidthEstimate();
            }, onMetadata: function(R, k, O, L) {
              var U = R;
              (R == "com.apple.hls.interstitial" || R == "com.apple.hls.overlay") && (U = "com.apple.quicktime.HLS", R = { startTime: k, endTime: O, values: L }, e.C && e.C.onHLSInterstitialMetadata(e, e.h, R)), L = m(L), R = L.next();
              for (var j = {}; !R.done; j = { Zg: void 0 }, R = L.next()) j.Zg = R.value, j.Zg.name != "ID" && Mu(u, !1, /* @__PURE__ */ (function(G) {
                return function() {
                  ch(e, k, O, U, G.Zg);
                };
              })(j));
            }, disableStream: function(R) {
              return e.disableStream(R, e.g.streaming.maxDisabledTime);
            }, addFont: function(R, k) {
              return e.addFont(R, k);
            } }, w = new yu(function() {
              return e.Ra();
            }), w.addEventListener("regionadd", function(R) {
              var k = R.region;
              Nu(e, "timelineregionadded", k, u), Mu(u, !1, function() {
                e.C && (e.C.onDashTimedMetadata(k), e.C.onDASHInterstitialMetadata(e, e.h, k));
              });
            }), T = null, a.streaming.observeQualityChanges && (T = new gl(function() {
              return e.Hc();
            }), T.addEventListener("qualitychange", function(R) {
              c0(e, R.quality, R.position);
            }), T.addEventListener("audiotrackchange", function(R) {
              c0(e, R.quality, R.position, !0);
            })), E = !0, A = { wc: e.N, onError: function(R) {
              return u.onError(R);
            }, xf: function(R) {
              Mu(u, !0, function() {
                e.F && JI(e, R);
              });
            }, onExpirationUpdated: function(R, k) {
              var O = Ze("expirationupdated");
              u.dispatchEvent(O), (O = u.m) && O.onExpirationUpdated && O.onExpirationUpdated(R, k);
            }, onEvent: function(R) {
              u.dispatchEvent(R), R.type == "drmsessionupdate" && E && (E = !1, R = Date.now() / 1e3 - u.za, (e.B || u.getStats()).m = R, e.T && Og(e.T));
            } }, I = Wy(e, l), Am(e.N, I), P = function() {
              return e.kd(A);
            }, N = { config: a, wk: g, Ik: w, Hk: T, kd: P, vk: p, networkingEngine: I, mj: o }, u = new Yn(t, r, n, N), M.return(u));
          });
        }
        function Hy(e, t) {
          var n, r, i, o;
          return D(function(s) {
            return s.g == 1 ? (n = e.g.manifest.retryParameters, x(s, ts(t, e.N, n), 2)) : (r = s.h, r == "application/x-mpegurl" && (i = Se(), i.Ha() === "WEBKIT" && (r = "application/vnd.apple.mpegurl")), r == "video/quicktime" && (o = Se(), o.Ha() === "CHROMIUM" && (r = "video/mp4")), s.return(r));
          });
        }
        function bI(e, t) {
          if (!br(Se())) return !0;
          if (t) {
            if ((e.h || oo()).canPlayType(t) == "") return !1;
            if (!br(Se()) || !Ro.has(t.toLowerCase())) return !0;
            if (Ba(t)) return Se().Ha() === "WEBKIT" && (e.g.drm.servers["com.apple.fps"] || e.g.drm.servers["com.apple.fps.1_0"]) ? e.g.streaming.useNativeHlsForFairPlay : e.g.streaming.preferNativeHls;
            if (t === "application/dash+xml" || t === "video/vnd.mpeg.dash.mpd") return e.g.streaming.preferNativeDash;
          }
          return !1;
        }
        function Kl(e, t) {
          var n = e.g.textDisplayFactory;
          e.Lh !== n || t !== void 0 && t ? (t = e.u, e.u = n(), e.u.configure ? e.u.configure(e.g.textDisplayer) : Ne("Text displayer w/ configure", 'Text displayer should have a "configure" method!'), e.u.setTextLanguage || Ne("Text displayer w/ setTextLanguage", 'Text displayer should have a "setTextLanguage" method!'), t ? (e.u.setTextVisibility(t.isTextVisible()), t.destroy().catch(function() {
          })) : e.u.setTextVisibility(e.$), e.H && qA(e.H, e.u), e.Lh = n, e.l && TE(e.l)) : e.u && e.u.configure && e.u.configure(e.g.textDisplayer);
        }
        function ah(e) {
          var t, n, r;
          return D(function(i) {
            if (i.g == 1) return Se(), as(e, "media-source"), e.g.mediaSource.useSourceElements && ul(e.h), Kl(e), t = KI(e.h, e.u, { Mj: function() {
              return e.keySystem();
            }, onMetadata: function(o, s, u) {
              o = m(o);
              for (var a = o.next(); !a.done; a = o.next()) if (a = a.value, a.data && typeof a.cueTime == "number" && a.frames) {
                var l = a.cueTime + s, c = u;
                c && l > c && (c = l);
                for (var d = m(a.frames), h = d.next(); !h.done; h = d.next()) ch(e, l, c, "org.id3", h.value);
                e.C && e.C.onHlsTimedMetadata(a, l);
              }
            }, Ck: function(o) {
              e.kb && If(
                e.kb,
                { schemeIdUri: o.schemeIdUri, startTime: o.startTime, endTime: o.endTime, id: String(o.id), emsg: o }
              );
            }, onEvent: function(o) {
              return e.dispatchEvent(o);
            }, Ek: function() {
              e.I && e.I.update && e.I.update();
            } }, e.T, e.g.mediaSource), n = e.g.manifest, r = n.segmentRelativeVttTiming, t.Fa = r, x(i, t.M, 2);
            e.H = t, q(i);
          });
        }
        function Gy(e, t) {
          e.M = new pl({ Ig: function() {
            return t.playbackRate;
          }, qd: function() {
            return t.defaultPlaybackRate;
          }, Ti: function(n) {
            t.playbackRate = n;
          }, Ak: function(n) {
            t.currentTime += n;
          }, isPaused: function() {
            return t.paused;
          } });
        }
        function Ky(e, t, n) {
          function r() {
            return dh(e);
          }
          if (e.j.D(t, "playing", r), e.j.D(t, "pause", r), e.j.D(t, "ended", r), e.j.D(t, "ratechange", function() {
            var o = e.h.playbackRate;
            o != 0 && (e.M && (e.M.set(o), e.m == Vt && e.o.playbackRateChanged(o), t0(e, o)), o = Ze("ratechange"), e.dispatchEvent(o));
          }), t.remote && (e.j.D(t.remote, "connect", function() {
            e.l && t.remote.state == "connected" && ei(e), nn(e);
          }), e.j.D(t.remote, "connecting", function() {
            return nn(e);
          }), e.j.D(t.remote, "disconnect", function() {
            return D(function(o) {
              if (o.g == 1) return e.l && t.remote.state == "disconnected" ? x(o, El(e.l), 3) : o.A(2);
              o.g != 2 && ei(e), nn(e), q(o);
            });
          })), t.audioTracks && (e.j.D(t.audioTracks, "addtrack", function() {
            return nn(e);
          }), e.j.D(t.audioTracks, "removetrack", function() {
            return nn(e);
          }), e.j.D(t.audioTracks, "change", function() {
            return nn(e);
          })), t.videoTracks && (e.j.D(t.videoTracks, "addtrack", function() {
            return nn(e);
          }), e.j.D(t.videoTracks, "removetrack", function() {
            return nn(e);
          }), e.j.D(t.videoTracks, "change", function() {
            return nn(e);
          })), (t.webkitPresentationMode || t.webkitSupportsFullscreen) && e.j.D(t, "webkitpresentationmodechanged", function() {
            e.Ae && Kl(e, !0);
          }), t.textTracks) {
            var i = function() {
              e.m === Mn && e.u instanceof Pt && ei(e), nn(e);
            };
            e.j.D(t.textTracks, "addtrack", function(o) {
              if (o.track) switch (o = o.track, o.kind) {
                case "metadata":
                  BI(e, o);
                  break;
                case "chapters":
                  FI(e, o);
                  break;
                default:
                  i();
              }
            }), e.j.D(t.textTracks, "removetrack", i), e.j.D(t.textTracks, "change", i);
          }
          t.preload != "none" && e.j.Aa(t, "loadedmetadata", function() {
            e.B.G = Date.now() / 1e3 - n;
          });
        }
        function NI(e, t, n, r) {
          var i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B;
          return D(function(F) {
            switch (F.g) {
              case 1:
                for (as(e, "load"), i = e.h, Gy(e, i), Ky(e, i, t), ("onchange" in C.screen) && e.j.D(C.screen, "change", function() {
                  if (e.J.getConfiguration) {
                    var W = e.J.getConfiguration();
                    W.hdrLevel == "AUTO" ? Pi(e) : e.g.preferredVideoHdrLevel == "AUTO" && e.g.abr.enabled && (W.hdrLevel = "AUTO", e.J.configure(W), Pi(e));
                  }
                }), o = !1, s = m(e.i.variants), u = s.next(); !u.done; u = s.next()) a = u.value, (l = a.video && a.video.dependencyStream) && (o = jg(l));
                RI(e, e.g, o), e.Ld = e.g.preferredTextLanguage, e.Pd = e.g.preferredTextRole, e.Od = e.g.preferForcedSubs, gh(e.i.presentationTimeline, e.g.playRangeStart, e.g.playRangeEnd), e.o.init(function(W, z, me) {
                  e.i && e.l && W != e.l.o && Lu(e, W, !0, z === void 0 ? !1 : z, me === void 0 ? 0 : me);
                }), e.o.setMediaElement(i), e.o.setCmsdManager(e.va), e.l = WI(e), e.l.configure(e.g.streaming), e.m = Vt, e.dispatchEvent(Ze("streaming")), c = n;
              case 2:
                for ((h = e.l.o) || c || (c = r0(e, !0)), p = [], d = h || c, g = m([d.video, d.audio]), w = g.next(); !w.done; w = g.next()) (T = w.value) && !T.segmentIndex && (p.push(T.createSegmentIndex()), T.dependencyStream && p.push(T.dependencyStream.createSegmentIndex()));
                if (!(p.length > 0)) {
                  F.A(4);
                  break;
                }
                return x(F, Promise.all(p), 4);
              case 4:
                if (!d || d.disabledUntilTime != 0) {
                  F.A(2);
                  break;
                }
                if (Pi(e), e.I && e.I.onInitialVariantChosen && e.I.onInitialVariantChosen(d), e.i.isLowLatency && (e.g.streaming.lowLatencyMode ? e.configure(e.Zf) : De("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details.")), e.K && (fI(e.K, e.i.isLowLatency && e.g.streaming.lowLatencyMode), hI(e.K, t * 1e3)), gh(e.i.presentationTimeline, e.g.playRangeStart, e.g.playRangeEnd), vE(e.l, e.g.playRangeStart, e.g.playRangeEnd), e.Ua = !0, e.dispatchEvent(Ze("canupdatestarttime")), E = function(W) {
                  e.G = VI(e, W), e.cc = HI(e, W), zy(e, i, !1);
                }, e.g.streaming.startAtSegmentBoundary || (A = e.O, A == null && e.i.startTime && (A = e.i.startTime), E(A)), h) {
                  F.A(7);
                  break;
                }
                if (!e.g.streaming.startAtSegmentBoundary) {
                  F.A(8);
                  break;
                }
                return I = e.i.presentationTimeline, e.O instanceof Date && (N = I.m || I.i, M = e.O.getTime() / 1e3 - N, M != null && (P = M)), P == null && (P = typeof e.O == "number" ? e.O : e.U() ? 1 / 0 : e.h.currentTime), e.O == null && e.i.startTime && (P = e.i.startTime), R = I.$b(), k = I.Ib(), P < R ? P = R : P > k && (P = k), x(F, $I(c, P), 9);
              case 9:
                O = F.h, E(O);
              case 8:
                Lu(e, c, !0, !1, 0);
              case 7:
                return e.G.ready(), L = e.Lc().find(function(W) {
                  return W.active;
                }), L || ((U = Bo(e.i.textStreams, e.Ld, e.Pd, e.Od)[0] || null) && Hf(e.B.h, U, !0), c && (U ? (gm(c.audio, U, e.g) && (e.$ = !0), e.$ && e.u.setTextVisibility(!0)) : (e.$ = !1, e.u.setTextVisibility(!1)), a0(e)), U && (e.g.streaming.alwaysStreamText || e.Pg()) && (yl(e.l, U), bu(e))), x(F, e.l.start(r), 10);
              case 10:
                e.g.abr.enabled && (e.o.enable(), l0(e)), nn(e), e.i.variants.some(function(W) {
                  return W.primary;
                }), ((j = e.U()) && (e.g.streaming.liveSync && e.g.streaming.liveSync.enabled || e.i.serviceDescription || e.g.streaming.liveSync.panicMode) || e.g.streaming.vodDynamicPlaybackRate) && (G = function() {
                  return n0(e);
                }, e.j.D(i, "timeupdate", G)), j || (H = function() {
                  return ql(e);
                }, e.j.D(i, "timeupdate", H), ql(e), e.i.nextUrl && (e.g.streaming.preloadNextUrlWindow > 0 && (B = function() {
                  var W;
                  return D(function(z) {
                    if (z.g == 1)
                      return W = e.Ra().end - e.h.currentTime, isNaN(W) || !(W <= e.g.streaming.preloadNextUrlWindow) ? z.A(0) : (e.j.Ma(i, "timeupdate", B), x(z, e.preload(e.i.nextUrl), 4));
                    e.eb = z.h, q(z);
                  });
                }, e.j.D(i, "timeupdate", B)), e.j.D(i, "ended", function() {
                  e.load(e.eb || e.i.nextUrl);
                }))), e.C && e.C.onManifestUpdated(j), q(F);
            }
          });
        }
        function OI(e, t) {
          var n, r, i;
          return D(function(o) {
            return o.g == 1 ? (n = Date.now() / 1e3, r = !0, e.F = e.kd({ wc: e.N, onError: function(s) {
              ls(e, s);
            }, xf: function() {
            }, onExpirationUpdated: function() {
              var s = Ze("expirationupdated");
              e.dispatchEvent(s);
            }, onEvent: function(s) {
              e.dispatchEvent(s), s.type == "drmsessionupdate" && r && (r = !1, e.B.m = Date.now() / 1e3 - n);
            } }), e.F.configure(e.g.drm), i = mm([t]), e.F.O = !0, x(o, Rm(e.F, [i], []), 2)) : x(o, e.F.Vb(e.h), 0);
          });
        }
        function jI(e, t, n) {
          var r, i, o, s, u, a, l, c, d, h, p, g;
          return D(function(w) {
            switch (w.g) {
              case 1:
                if (as(e, "src-equals"), r = e.h, e.G = new Nv(r), i = !1, e.Ce.push(function() {
                  i = !0;
                }), e.dispatchEvent(Ze("canupdatestarttime")), e.O != null && e.G.Wf(e.O), e.cc = GI(e, e.O || 0), Gy(e, r), zy(e, r, !0), r.textTracks && (Kl(e), o = function(T) {
                  if (!(e.u instanceof Pt)) {
                    var E = Wl(e).find(function(A) {
                      return A.mode !== "disabled";
                    });
                    E && (E.mode = T ? "showing" : "hidden"), e.u instanceof zt && (E = zI(e)) && (E.mode = !T && e.u.isTextVisible() ? "showing" : "hidden");
                  }
                }, e.j.D(
                  r,
                  "enterpictureinpicture",
                  function() {
                    return o(!0);
                  }
                ), e.j.D(r, "leavepictureinpicture", function() {
                  return o(!1);
                }), r.remote ? (e.j.D(r.remote, "connect", function() {
                  return o(!1);
                }), e.j.D(r.remote, "connecting", function() {
                  return o(!1);
                }), e.j.D(r.remote, "disconnect", function() {
                  return o(!1);
                })) : "webkitCurrentPlaybackTargetIsWireless" in r && e.j.D(r, "webkitcurrentplaybacktargetiswirelesschanged", function() {
                  return o(!1);
                }), s = r, (s.webkitPresentationMode || s.webkitSupportsFullscreen) && e.j.D(
                  s,
                  "webkitpresentationmodechanged",
                  function() {
                    s.webkitPresentationMode ? o(s.webkitPresentationMode !== "inline") : s.webkitSupportsFullscreen && o(s.webkitDisplayingFullscreen);
                  }
                )), Ky(e, r, t), u = pI(e.K, e.X, n), !u.includes("#t=") && (e.g.playRangeStart > 0 || isFinite(e.g.playRangeEnd)) && (u += "#t=", e.g.playRangeStart > 0 && (u += e.g.playRangeStart), isFinite(e.g.playRangeEnd) && (u += "," + e.g.playRangeEnd)), !e.H) {
                  w.A(2);
                  break;
                }
                return x(w, e.H.destroy(), 3);
              case 3:
                e.H = null;
              case 2:
                return ul(r), r.src = u, a = Se(), a.Oa() == "TV" && r.load(), r.preload != "none" && !r.autoplay && Ba(n) && a.Ha() === "WEBKIT" && r.load(), e.m = Mn, e.dispatchEvent(Ze("streaming")), l = function() {
                  return new Promise(function(T) {
                    var E = new Ae(T);
                    e.j.D(r.textTracks, "change", function() {
                      return E.ka(0.5);
                    }), E.ka(0.5);
                  });
                }, c = new Je(), es(r, HTMLMediaElement.HAVE_METADATA, e.j, function() {
                  return D(function(T) {
                    if (T.g == 1) return e.G.ready(), e.Fa && Ba(e.Fa) ? x(T, l(), 3) : (c.resolve(), T.A(0));
                    c.resolve(), q(T);
                  });
                }), es(r, HTMLMediaElement.HAVE_CURRENT_DATA, e.j, function() {
                  var T, E, A, I, P;
                  return D(function(N) {
                    if (N.g == 1) return x(N, l(), 2);
                    if (i) return N.return();
                    if (UI(e), T = Wl(e), T.some(function(M) {
                      return M.mode === "showing";
                    }) && (e.$ = !0, e.u.setTextVisibility(!0)), !(e.u instanceof Pt)) for (T.length && (e.u.enableTextDisplayer ? e.u.enableTextDisplayer() : Ne("Text displayer w/ enableTextDisplayer", 'Text displayer should have a "enableTextDisplayer" method')), E = !1, A = m(T), I = A.next(); !I.done; I = A.next()) P = I.value, P.mode !== "disabled" && (E ? (P.mode = "disabled", De("Found more than one enabled text track, disabling it", P)) : (Qy(e, P), E = !0));
                    _I(e), q(N);
                  });
                }), r.error ? c.reject(ph(e)) : r.preload == "none" && (De('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'), c.resolve()), e.j.Aa(r, "error", function() {
                  c.reject(ph(e));
                }), x(w, Fa(e.g.streaming.loadTimeout, c), 4);
              case 4:
                ((d = e.U()) && (e.g.streaming.liveSync && e.g.streaming.liveSync.enabled || e.g.streaming.liveSync.panicMode) || e.g.streaming.vodDynamicPlaybackRate) && (h = function() {
                  return n0(e);
                }, e.j.D(r, "timeupdate", h)), d || (p = function() {
                  return ql(e);
                }, e.j.D(r, "timeupdate", p), ql(e)), e.C && (e.C.onManifestUpdated(d), d && (g = e.Ra().end, e.j.D(r, "progress", function() {
                  var T = e.Ra().end;
                  g != T && (e.C.onManifestUpdated(e.U()), g = T);
                }))), e.Ua = !0, q(w);
            }
          });
        }
        function UI(e) {
          var t = e.g.preferredAudioLanguage;
          t != "" && e.Pi(t, e.g.preferredAudioRole);
        }
        function _I(e) {
          var t = e.g.preferredTextLanguage;
          t != "" && e.mh(t, e.g.preferredTextRole, e.g.preferForcedSubs);
        }
        function BI(e, t) {
          if (t.kind == "metadata") {
            t.mode = "hidden", e.j.D(t, "cuechange", function() {
              if (t.activeCues) for (var r = m(t.activeCues), i = r.next(); !i.done; i = r.next()) i = i.value, ch(e, i.startTime, i.endTime, i.type, i.value), e.C && e.C.onCueMetadataChange(i.value);
              if (t.cues) {
                r = [], i = m(t.cues);
                for (var o = i.next(), s = {}; !o.done; s = { Fc: void 0 }, o = i.next()) s.Fc = o.value, s.Fc.type == "com.apple.quicktime.HLS" && s.Fc.startTime != null && (o = r.find(/* @__PURE__ */ (function(u) {
                  return function(a) {
                    return a.startTime == u.Fc.startTime && a.endTime == u.Fc.endTime;
                  };
                })(s)), o || (o = { startTime: s.Fc.startTime, endTime: s.Fc.endTime, values: [] }, r.push(o)), o.values.push(s.Fc.value));
                for (r = m(r), i = r.next(); !i.done; i = r.next()) i = i.value, i.values.some(function(u) {
                  return u.key == "X-ASSET-URI" || u.key == "X-ASSET-LIST";
                }) && e.C && (i.values.push({ key: "CUE", description: "", data: i.startTime != 0 || e.U() ? "ONCE" : "ONCE,PRE", mimeType: null, pictureType: null }), e.C.onHLSInterstitialMetadata(e, e.h, i));
              }
            });
            var n = new Ae(function() {
              var r = XI(e);
              r = m(r);
              for (var i = r.next(); !i.done; i = r.next()) i.value.mode = "hidden";
            }).Cb().ka(0.5);
            e.Ce.push(function() {
              n.stop();
            });
          }
        }
        function lh(e, t, n) {
          t = (/* @__PURE__ */ new Map()).set("startTime", t.startTime).set("endTime", t.endTime).set("metadataType", t.schemeIdUri).set("payload", t.payload), e.dispatchEvent(Ze(n, t));
        }
        function ch(e, t, n, r, i) {
          e.za && (t = { schemeIdUri: r, startTime: t, endTime: n || 1 / 0, id: "", payload: i }, t.id = JSON.stringify(t), If(e.za, t));
        }
        function FI(e, t) {
          if (t && t.kind == "chapters") {
            t.mode = "hidden";
            var n = new Ae(function() {
              t.mode = "hidden";
            }).Cb().ka(0.5);
            e.Ce.push(function() {
              n.stop();
            });
          }
        }
        f.Mk = function() {
          for (var e = this.ba; e.g; ) e.release();
        }, f.kd = function(e) {
          return new tl(e);
        };
        function Wy(e, t) {
          function n(o) {
            t() ? t().dispatchEvent(o) : e.dispatchEvent(o);
          }
          function r(o) {
            t() ? Mu(t(), !0, o) : o();
          }
          t || (t = function() {
            return null;
          });
          var i = new at(function(o, s, u, a, l) {
            r(function() {
              e.o && e.o.segmentDownloaded(o, s, u, a, l);
            });
          }, function(o, s, u) {
            s = (/* @__PURE__ */ new Map()).set("headers", o).set("request", s).set("requestType", u), n(Ze("downloadheadersreceived", s)), r(function() {
              if (e.va) {
                var a = e.va;
                if (a.h.enabled) {
                  var l = o["cmsd-static"];
                  if (l) try {
                    var c = /* @__PURE__ */ new Map(), d = l.split(",");
                    for (l = 0; l < d.length; l++) {
                      var h = d[l].split("=");
                      c.set(h[0], Ly(h[1]));
                    }
                  } catch {
                  }
                  if (c = o["cmsd-dynamic"]) {
                    e: {
                      try {
                        var p = /* @__PURE__ */ new Map(), g = c.split(";");
                        for (c = 1; c < g.length; c++) {
                          var w = g[c].split("=");
                          p.set(w[0], Ly(w[1]));
                        }
                        var T = p;
                        break e;
                      } catch {
                        T = null;
                        break e;
                      }
                      T = void 0;
                    }
                    T && (a.g = T);
                  }
                }
              }
            });
          }, function(o, s) {
            o = (/* @__PURE__ */ new Map()).set("request", o).set("response", s), n(Ze("downloadcompleted", o));
          }, function(o, s, u, a) {
            o = (/* @__PURE__ */ new Map()).set("request", o).set("error", s).set("httpResponseCode", u).set("aborted", a), n(Ze("downloadfailed", o));
          }, function(o, s, u) {
            r(function() {
              if (e.K) {
                var a = e.K, l = u;
                if (l = l === void 0 ? {} : l, a.g.enabled) if (s.method === "HEAD") us(a, s, {});
                else switch (o) {
                  case 0:
                    try {
                      if (a.g.enabled) {
                        if (l.type) {
                          e: {
                            switch (l.type) {
                              case 4:
                                var c = a.u ? Fl : Bl;
                                break e;
                              case 3:
                              case 2:
                                c = a.u ? Hl : Vl;
                                break e;
                              case 5:
                                c = "s";
                                break e;
                            }
                            c = void 0;
                          }
                          a.l = c;
                        }
                        us(a, s, { ot: My, su: !a.F });
                      }
                    } catch (h) {
                      ci("CMCD_MANIFEST_ERROR", "Could not generate manifest CMCD data.", h);
                    }
                    break;
                  case Xn:
                    try {
                      if (a.g.enabled) {
                        var d = Ey(a, l, s.uris[0]);
                        d.ts = Date.now(), a.m.has(s) && a.m.delete(s), a.m.set(s, d.ts), us(a, s, d);
                      }
                    } catch (h) {
                      ci(
                        "CMCD_SEGMENT_ERROR",
                        "Could not generate segment CMCD data.",
                        h
                      );
                    }
                    break;
                  case 2:
                  case 5:
                  case 6:
                    us(a, s, { ot: "k" });
                    break;
                  case 4:
                    us(a, s, { ot: "o" });
                }
              }
            });
          }, function(o, s, u, a) {
            (o = t() ? t().m : e.I) && o.banLocation && o.banLocation(a);
          }, function(o, s, u) {
            if (s.data) {
              var a = s.data.byteLength, l = t() ? t().getStats() : e.B;
              if (l && (sy(l, a), o === 0 && (l.si = a)), a = e.K, u = u === void 0 ? {} : u, Jf(a).length !== 0) switch (o) {
                case Xn:
                  try {
                    var c = Ey(a, u, s.uri);
                    s.originalRequest && s.originalRequest.timeToFirstByte != null && (c.ttfb = s.originalRequest.timeToFirstByte), s.timeMs != null && (c.ttlb = s.timeMs);
                    var d = s.originalUri || s.uri;
                    if (d.includes("CMCD=")) try {
                      var h = new URL(d);
                      h.searchParams.delete("CMCD");
                      var p = h.toString();
                    } catch {
                      p = d;
                    }
                    else p = d;
                    c.url = p, a.m.has(s.originalRequest) ? (c.ts = a.m.get(s.originalRequest), a.m.delete(s.originalRequest)) : c.ts || (c.ts = Date.now());
                    var g = Jf(a);
                    if (g.length !== 0) {
                      var w = a.g.version == rh ? Array.from(new Set([].concat(X(ih), X(II)))) : Cy;
                      c.rc = s.status || 0;
                      var T = th(a, c, Dy);
                      s.headers && s.headers["CMSD-Static"] && (T.cmsds = btoa(s.headers["CMSD-Static"])), s.headers && s.headers["CMSD-Dynamic"] && (T.cmsdd = btoa(s.headers["CMSD-Dynamic"]));
                      for (var E = m(g), A = E.next(); !A.done; A = E.next()) {
                        var I = A.value, P = Zf(I.includeKeys || [], w), N = xy(I);
                        a.o[N] || (a.o[N] = { request: 1, response: 1 }), T.sn = a.o[N].response++;
                        var M = eh(T, P);
                        Sy(a, M, I, s);
                      }
                    }
                  } catch (R) {
                    ci("CMCD_SEGMENT_ERROR", "Could not generate response segment CMCD data.", R);
                  }
              }
            }
          });
          return i.configure(e.g.networking), i;
        }
        function VI(e, t) {
          return new Uv(e.h, e.i, e.g.streaming, t, function() {
            e.cc && Hv(e.cc, !e.G.Jh()), e.l && e.l.Zc(), e.R && Lr(e, "seeking");
          }, function(n) {
            return e.dispatchEvent(n);
          });
        }
        function HI(e, t) {
          var n = e.U() || typeof t == "number" && t > 0;
          t = new ao(e.ze, n), t.addEventListener("enter", function(o) {
            Nu(e, "timelineregionenter", o.region);
          }), t.addEventListener("exit", function(o) {
            Nu(e, "timelineregionexit", o.region);
          }), t.addEventListener("skip", function(o) {
            var s = o.region;
            o.seeking || (Nu(e, "timelineregionenter", s), Nu(e, "timelineregionexit", s));
          });
          var r = new ao(e.za, n);
          r.addEventListener("enter", function(o) {
            lh(e, o.region, "metadata");
          }), n = new ao(e.kb, n), n.addEventListener("enter", function(o) {
            o = (/* @__PURE__ */ new Map()).set(
              "detail",
              o.region.emsg
            ), e.dispatchEvent(Ze("emsg", o));
          });
          var i = new Ef(e.h);
          return i.g.add(t), i.g.add(r), i.g.add(n), e.xe && i.g.add(e.xe), i;
        }
        function GI(e, t) {
          t = new ao(e.za, t instanceof Date || t > 0), t.addEventListener("enter", function(r) {
            lh(e, r.region, "metadata");
          });
          var n = new Ef(e.h);
          return n.g.add(t), n;
        }
        function zy(e, t, n) {
          e.R = new hA(), Zd(e.R, to), Xy(e), Ru(e), e.Ta = new Ae(function() {
            Lr(e);
          }), e.g.streaming.rebufferingGoal && e.Ta.Ea(0.25), e.j.D(t, "waiting", function() {
            return Lr(e, "waiting");
          }), e.j.D(t, "canplaythrough", function() {
            return Lr(e, "canplaythrough");
          }), e.j.D(t, "playing", function() {
            return Lr(e, "playing");
          }), e.j.D(t, "seeked", function() {
            return Lr(e, "seeked");
          }), e.j.D(t, "timeupdate", function() {
            return Lr(e, "timeupdate");
          }), n && (e.j.D(t, "progress", function() {
            return Lr(e, "progress");
          }), e.j.D(t, "stalled", function() {
            return Lr(
              e,
              "stalled"
            );
          }));
        }
        function Xy(e) {
          var t = e.g.streaming.rebufferingGoal;
          e.R.j.set(no, Math.min(0.5, t / 2)).set(to, t);
        }
        function Lr(e, t) {
          if (e.g.streaming.rebufferingGoal) {
            t = e.H ? uo(e.H) : !1, t = e.fe() || t || e.G.ni();
            var n = uv(e.h.buffered, e.h.currentTime), r = e.R, i = r.j.get(r.g);
            Zd(r, t || n >= i && n > 0 ? no : to) && Ru(e);
          } else if (t) {
            n = e.R, r = e.h.currentTime, i = n.h, n.h = r;
            var o = void 0;
            switch (t) {
              case "seeking":
              case "waiting":
                n.h = -1, o = to;
                break;
              case "canplaythrough":
              case "playing":
              case "seeked":
                o = no;
                break;
              case "timeupdate":
                i >= 0 && r - i > 0.01 && (o = no);
            }
            o !== void 0 && Zd(n, o) && Ru(e);
          }
        }
        function KI(e, t, n, r, i) {
          return new pv(e, t, n, i, r);
        }
        function WI(e) {
          return new qv(e.i, { Zb: function() {
            return e.G ? e.G.Qd() : 0;
          }, getBandwidthEstimate: function() {
            return e.o.getBandwidthEstimate();
          }, Ob: function() {
            return e.Ob();
          }, video: e.h, Y: e.H, wc: e.N, onError: function(t) {
            return ls(e, t);
          }, onEvent: function(t) {
            return e.dispatchEvent(t);
          }, zd: function(t, n, r, i) {
            var o = t.startTime, s = t.endTime, u = n.type;
            if (u != xe) {
              if (e.G) {
                e.G.Bi();
                var a = gf(e.H, u);
                !e.U() && e.h.paused && !e.h.seeking && a != null && a > 0 && e.G.Qd() < a && !sh(e.G.Qd(), a, 1e-3) && e.G.Wf(a);
              }
              Lr(e);
            }
            r = (/* @__PURE__ */ new Map()).set("start", o).set(
              "end",
              s
            ).set("contentType", u).set("isMuxed", r).set("isDependency", i), e.dispatchEvent(Ze("segmentappended", r)), e.o && n.fastSwitching && t.Wc && t.ie && e.o.trySuggestStreams();
          }, Dk: function(t, n) {
            (n = n.xd) && e.xe && uE(e.xe, n, t);
          }, Rh: function(t, n) {
            var r = e.F;
            if (r.h.parseInbandPsshEnabled && !r.H && ["audio", "video"].includes(t)) {
              t = new Yd(pe(n)), n = 0;
              for (var i = m(t.data), o = i.next(); !o.done; o = i.next()) n += o.value.length;
              if (n == 0) r = Promise.resolve();
              else {
                for (n = new Uint8Array(n), i = 0, t = m(t.data), o = t.next(); !o.done; o = t.next()) o = o.value, n.set(o, i), i += o.length;
                su(r, "cenc", n), r = r.m;
              }
            } else r = Promise.resolve();
            return r;
          }, disableStream: function(t, n) {
            return e.disableStream(t, n);
          }, cl: function(t, n) {
            return !(e.g.abr.enabled && n.fastSwitching && t.Wc && t.ie);
          } });
        }
        f.configure = function(e, t) {
          var n = this.getConfiguration();
          if (arguments.length == 2 && typeof e == "string" && (e = Cl(e, t)), "preferredVariantRole" in e && (Ne("preferredVariantRole configuration", "Please Use preferredAudioRole instead."), e.preferredAudioRole = e.preferredVariantRole, delete e.preferredVariantRole), e.streaming && "forceTransmuxTS" in e.streaming && (Ne("streaming.forceTransmuxTS configuration", "Please Use mediaSource.forceTransmux instead."), e.mediaSource = e.mediaSource || {}, e.mediaSource.mediaSource = e.streaming.forceTransmuxTS, delete e.streaming.forceTransmuxTS), e.streaming && "forceTransmux" in e.streaming && (Ne("streaming.forceTransmux configuration", "Please Use mediaSource.forceTransmux instead."), e.mediaSource = e.mediaSource || {}, e.mediaSource.mediaSource = e.streaming.forceTransmux, delete e.streaming.forceTransmux), e.streaming && "useNativeHlsOnSafari" in e.streaming) {
            Ne("streaming.useNativeHlsOnSafari configuration", "Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");
            var r = Se();
            e.streaming.preferNativeHls = e.streaming.useNativeHlsOnSafari && r.Ha() === "WEBKIT", delete e.streaming.useNativeHlsOnSafari;
          }
          if (e.streaming && typeof e.streaming.liveSync == "boolean" && (Ne("streaming.liveSync", "Please Use streaming.liveSync.enabled instead."), r = e.streaming.liveSync, e.streaming.liveSync = {}, e.streaming.liveSync.enabled = r), e.streaming && !(e.streaming.liveSync && "targetLatency" in e.streaming.liveSync) && ("liveSyncMinLatency" in e.streaming || "liveSyncMaxLatency" in e.streaming)) {
            r = e.streaming.liveSyncMinLatency || 0;
            var i = Math.abs((e.streaming.liveSyncMaxLatency || 1) - r) / 2;
            e.streaming.liveSync = e.streaming.liveSync || {}, e.streaming.liveSync.targetLatency = r + i, e.streaming.liveSync.targetLatencyTolerance = i;
          }
          if (e.streaming && "liveSyncMaxLatency" in e.streaming && (Ne("streaming.liveSyncMaxLatency", "Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"), delete e.streaming.liveSyncMaxLatency), e.streaming && "liveSyncMinLatency" in e.streaming && (Ne("streaming.liveSyncMinLatency", "Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"), delete e.streaming.liveSyncMinLatency), e.streaming && "liveSyncTargetLatency" in e.streaming && (Ne("streaming.liveSyncTargetLatency", "Please Use streaming.liveSync.targetLatency instead."), e.streaming.liveSync = e.streaming.liveSync || {}, e.streaming.liveSync.targetLatency = e.streaming.liveSyncTargetLatency, delete e.streaming.liveSyncTargetLatency), e.streaming && "liveSyncTargetLatencyTolerance" in e.streaming && (Ne("streaming.liveSyncTargetLatencyTolerance", "Please Use streaming.liveSync.targetLatencyTolerance instead."), e.streaming.liveSync = e.streaming.liveSync || {}, e.streaming.liveSync.targetLatencyTolerance = e.streaming.liveSyncTargetLatencyTolerance, delete e.streaming.liveSyncTargetLatencyTolerance), e.streaming && "liveSyncPlaybackRate" in e.streaming && (Ne("streaming.liveSyncPlaybackRate", "Please Use streaming.liveSync.maxPlaybackRate instead."), e.streaming.liveSync = e.streaming.liveSync || {}, e.streaming.liveSync.maxPlaybackRate = e.streaming.liveSyncPlaybackRate, delete e.streaming.liveSyncPlaybackRate), e.streaming && "liveSyncMinPlaybackRate" in e.streaming && (Ne("streaming.liveSyncMinPlaybackRate", "Please Use streaming.liveSync.minPlaybackRate instead."), e.streaming.liveSync = e.streaming.liveSync || {}, e.streaming.liveSync.minPlaybackRate = e.streaming.liveSyncMinPlaybackRate, delete e.streaming.liveSyncMinPlaybackRate), e.streaming && "liveSyncPanicMode" in e.streaming && (Ne("streaming.liveSyncPanicMode", "Please Use streaming.liveSync.panicMode instead."), e.streaming.liveSync = e.streaming.liveSync || {}, e.streaming.liveSync.panicMode = e.streaming.liveSyncPanicMode, delete e.streaming.liveSyncPanicMode), e.streaming && "liveSyncPanicThreshold" in e.streaming && (Ne("streaming.liveSyncPanicThreshold", "Please Use streaming.liveSync.panicThreshold instead."), e.streaming.liveSync = e.streaming.liveSync || {}, e.streaming.liveSync.panicThreshold = e.streaming.liveSyncPanicThreshold, delete e.streaming.liveSyncPanicThreshold), e.mediaSource && "sourceBufferExtraFeatures" in e.mediaSource) {
            Ne("mediaSource.sourceBufferExtraFeatures configuration", "Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");
            var o = e.mediaSource.sourceBufferExtraFeatures;
            e.mediaSource.addExtraFeaturesToSourceBuffer = function() {
              return o;
            }, delete e.mediaSource.sourceBufferExtraFeatures;
          }
          if (e.manifest && e.manifest.hls && "useSafariBehaviorForLive" in e.manifest.hls && (Ne("manifest.hls.useSafariBehaviorForLive configuration", "Please Use liveSync config to keep on live Edge instead."), delete e.manifest.hls.useSafariBehaviorForLive), e.streaming && "parsePrftBox" in e.streaming && (Ne("streaming.parsePrftBox configuration", "Now fired without needing a configuration."), delete e.streaming.parsePrftBox), e.manifest && e.manifest.dash && "enableAudioGroups" in e.manifest.dash && (Ne("manifest.dash.enableAudioGroups configuration", "Please Use manifest.enableAudioGroups instead."), e.manifest.enableAudioGroups = e.manifest.dash.enableAudioGroups, delete e.manifest.dash.enableAudioGroups), e.streaming && "dispatchAllEmsgBoxes" in e.streaming && (Ne("streaming.dispatchAllEmsgBoxes configuration", "Please Use mediaSource.dispatchAllEmsgBoxes instead."), e.mediaSource = e.mediaSource || {}, e.mediaSource.dispatchAllEmsgBoxes = e.streaming.dispatchAllEmsgBoxes, delete e.streaming.dispatchAllEmsgBoxes), e.streaming && "autoLowLatencyMode" in e.streaming && (Ne("streaming.autoLowLatencyMode configuration", "Please Use streaming.lowLatencyMode instead."), e.streaming.lowLatencyMode = e.streaming.autoLowLatencyMode, delete e.streaming.autoLowLatencyMode), e.manifest && e.manifest.dash && "ignoreSupplementalCodecs" in e.manifest.dash && (Ne("manifest.dash.ignoreSupplementalCodecs configuration", "Please Use manifest.ignoreSupplementalCodecs instead."), e.manifest.ignoreSupplementalCodecs = e.manifest.dash.ignoreSupplementalCodecs, delete e.manifest.dash.ignoreSupplementalCodecs), e.manifest && e.manifest.hls && "ignoreSupplementalCodecs" in e.manifest.hls && (Ne("manifest.hls.ignoreSupplementalCodecs configuration", "Please Use manifest.ignoreSupplementalCodecs instead."), e.manifest.ignoreSupplementalCodecs = e.manifest.hls.ignoreSupplementalCodecs, delete e.manifest.hls.ignoreSupplementalCodecs), e.manifest && e.manifest.dash && "updatePeriod" in e.manifest.dash && (Ne("manifest.dash.updatePeriod configuration", "Please Use manifest.updatePeriod instead."), e.manifest.updatePeriod = e.manifest.dash.updatePeriod, delete e.manifest.dash.updatePeriod), e.manifest && e.manifest.hls && "updatePeriod" in e.manifest.hls && (Ne("manifest.hls.updatePeriod configuration", "Please Use manifest.updatePeriod instead."), e.manifest.updatePeriod = e.manifest.hls.updatePeriod, delete e.manifest.hls.updatePeriod), e.manifest && e.manifest.dash && "ignoreDrmInfo" in e.manifest.dash && (Ne(
            "manifest.dash.ignoreDrmInfo configuration",
            "Please Use manifest.ignoreDrmInfo instead."
          ), e.manifest.ignoreDrmInfo = e.manifest.dash.ignoreDrmInfo, delete e.manifest.dash.ignoreDrmInfo), e.drm && e.drm.advanced) {
            r = !1;
            for (var s in e.drm.advanced) {
              var u = e.drm.advanced[s];
              i = u.videoRobustness, u = u.audioRobustness, "videoRobustness" in e.drm.advanced[s] && !Array.isArray(e.drm.advanced[s].videoRobustness) && (e.drm.advanced[s].videoRobustness = [i], r = !0), "audioRobustness" in e.drm.advanced[s] && !Array.isArray(e.drm.advanced[s].audioRobustness) && (e.drm.advanced[s].audioRobustness = [u], r = !0);
            }
            r && Ne("AdvancedDrmConfiguration's videoRobustness and audioRobustness", "These properties are no longer strings but array of strings, please update your usage of these properties.");
          }
          return e.streaming && "forceHTTP" in e.streaming && (Ne("streaming.forceHTTP configuration", "Please Use networking.forceHTTP instead."), e.networking = e.networking || {}, e.networking.forceHTTP = e.streaming.forceHTTP, delete e.streaming.forceHTTP), e.streaming && "forceHTTPS" in e.streaming && (Ne(
            "streaming.forceHTTPS configuration",
            "Please Use networking.forceHTTP instead."
          ), e.networking = e.networking || {}, e.networking.forceHTTPS = e.streaming.forceHTTPS, delete e.streaming.forceHTTPS), e.streaming && "minBytesForProgressEvents" in e.streaming && (Ne("streaming.minBytesForProgressEvents configuration", "Please Use networking.minBytesForProgressEvents instead."), e.networking = e.networking || {}, e.networking.minBytesForProgressEvents = e.streaming.minBytesForProgressEvents, delete e.streaming.minBytesForProgressEvents), s = Qr(this.g, e, xr(this)), qy(this, n), s;
        }, f.vj = function(e) {
          this.Zf = e;
        };
        function qy(e, t) {
          if (e.De = new ef(e.g, e.ya, e.F), e.I) {
            var n = ar(e.g.manifest);
            e.h && e.h.nodeName === "AUDIO" && (n.disableVideo = !0), e.I.configure(n);
          }
          if (e.F && e.F.configure(e.g.drm), e.l) {
            e.l.configure(e.g.streaming);
            try {
              e.m != dr && Wm(e.De, e.i) && nn(e);
            } catch (i) {
              ls(e, i);
            }
            e.o && Pi(e), n = e.l.o, !n || n.allowedByApplication && n.allowedByKeySystem || Di(e);
          }
          if (e.N && e.N.configure(e.g.networking), e.H && (e.H.configure(e.g.mediaSource), e.H.Fa = e.g.manifest.segmentRelativeVttTiming), e.u && Kl(e), e.o && (e.o.configure(e.g.abr), e.g.abr.enabled ? e.o.enable() : e.o.disable(), l0(e)), e.R && Xy(e), e.Ta && (e.g.streaming.rebufferingGoal ? e.Ta.Ea(0.25) : e.Ta.stop()), e.i && gh(e.i.presentationTimeline, e.g.playRangeStart, e.g.playRangeEnd), e.C && e.C.configure(e.g.ads), e.K && e.K.configure(e.g.cmcd), e.va && e.va.configure(e.g.cmsd), e.Da && e.Da.configure(e.g.queue), e.m == Vt && e.J.getConfiguration) {
            n = e.J.getConfiguration();
            var r = !1;
            t.preferredVideoHdrLevel != e.g.preferredVideoHdrLevel && n.hdrLevel != e.g.preferredVideoHdrLevel && (n.hdrLevel = e.g.preferredVideoHdrLevel, r = !0), t.preferredVideoLayout != e.g.preferredVideoLayout && n.videoLayout != e.g.preferredVideoLayout && (n.videoLayout = e.g.preferredVideoLayout, r = !0), t.preferSpatialAudio != e.g.preferSpatialAudio && n.spatialAudio != e.g.preferSpatialAudio && (n.spatialAudio = e.g.preferSpatialAudio, r = !0), t.preferredVideoRole != e.g.preferredVideoRole && n.videoRole != e.g.preferredVideoRole && (n.videoRole = e.g.preferredVideoRole, r = !0), r && (e.J.configure(n), Di(e));
          }
        }
        f.getConfiguration = function() {
          var e = xr(this);
          return Qr(e, this.g, xr(this)), e;
        }, f.Fj = function() {
          return this.Zf;
        }, f.gi = function() {
          var e = xr(this);
          return Qr(e, this.g, xr(this)), ty(this.g, xr(this));
        }, f.bi = function() {
          if (this.h) {
            var e = this.h.buffered.length;
            e = e ? this.h.buffered.end(e - 1) : 0;
            var t = this.getConfiguration().streaming.bufferingGoal;
            if (t = Math.min(this.h.currentTime + t, this.Ra().end), e >= t) return 1;
            if (!(e <= this.h.currentTime) && e < t) return (e - this.h.currentTime) / (t - this.h.currentTime);
          }
          return 0;
        }, f.Ki = function() {
          var e = this.getConfiguration(), t;
          for (t in this.g) delete this.g[t];
          Qr(this.g, xr(this), xr(this)), qy(this, e);
        }, f.$d = function() {
          return this.m;
        }, f.di = function() {
          return this.i ? this.i.type : null;
        }, f.$e = function() {
          return this.h;
        }, f.Yb = function() {
          return this.N;
        }, f.pd = function() {
          return this.X;
        }, f.ai = function() {
          return this.C ? this.C : null;
        }, f.ji = function() {
          return this.Da ? this.Da : null;
        }, f.U = function() {
          return this.i && !this.xa() ? this.i.presentationTimeline.U() : this.h && (this.h.src || this.xa()) ? this.h.duration == 1 / 0 : !1;
        }, f.Uc = function() {
          return this.i ? this.i.presentationTimeline.Uc() : !1;
        }, f.ik = function() {
          if (this.i && !this.xa()) {
            var e = this.i.variants;
            return e.length ? !e[0].video : !1;
          }
          return this.h && (this.h.src || this.xa()) ? this.h.videoTracks ? this.h.videoTracks.length == 0 : this.h.videoHeight == 0 : !1;
        }, f.pi = function() {
          if (this.i && !this.xa()) {
            var e = this.i.variants;
            return e.length ? (e = e[0], e.audio || !e.video ? !1 : !e.video.codecs.includes(",")) : !1;
          }
          return this.h && (this.h.src || this.xa()) && this.h.audioTracks ? this.h.audioTracks.length == 0 : !1;
        }, f.Ra = function() {
          if (this.i && !this.xa()) {
            if (!this.Ua && this.i.type == "HLS") return { start: 0, end: 0 };
            var e = this.i.presentationTimeline;
            return { start: e.$b(), end: e.Ib() };
          }
          if (this.h && (this.h.src || this.xa()) && (e = this.h.seekable) && e.length) {
            var t = this.g ? this.g.playRangeStart : 0;
            t = Math.max(e.start(0), t);
            var n = this.g ? this.g.playRangeEnd : 1 / 0;
            return e = Math.min(e.end(e.length - 1), n), { start: t, end: e };
          }
          return { start: 0, end: 0 };
        }, f.fk = function() {
          this.U() && (this.h.currentTime = this.Ra().end);
        }, f.jk = function() {
          return this.Ua;
        }, f.keySystem = function() {
          var e = this.drmInfo();
          return e ? e.keySystem : "";
        }, f.drmInfo = function() {
          return this.F ? this.F.g : null;
        }, f.Zd = function() {
          return this.F ? this.F.Zd() : 1 / 0;
        }, f.Gg = function() {
          return this.F ? this.F.Gg() : [];
        }, f.Ze = function() {
          return this.F ? this.F.Ze() : {};
        }, f.Og = function() {
          return this.R ? this.R.g == to : !!this.X;
        }, f.Ob = function() {
          return this.h ? this.M ? this.M.i : 1 : 0;
        }, f.Hh = function(e) {
          this.m == Vt && this.l && Yv(this.l, e);
        }, f.we = function(e, t) {
          t = t === void 0 ? !0 : t, e == 0 ? De("A trick play rate of 0 is unsupported!") : (this.M.set(e), this.m == Vt && (this.o.playbackRateChanged(e), this.Hh(t && e != 1)), t0(this, e));
        }, f.Sd = function() {
          var e = this.M.qd();
          this.m == Mn && this.M.set(e), this.m == Vt && (this.M.set(e), this.o.playbackRateChanged(e), this.Hh(!1)), this.fc.Qa();
        }, f.sc = function() {
          if (this.i && !this.xa()) {
            for (var e = this.l ? this.l.o : null, t = [], n = 0, r = m(this.i.variants), i = r.next(); !i.done; i = r.next()) if (i = i.value, ou(i)) {
              var o = Qi(i);
              o.active = i == e, o.active || n == 1 || e == null || i.video != e.video || i.audio != e.audio || (o.active = !0), o.active && n++, t.push(o);
            }
            return t;
          }
          if (this.h && this.h.audioTracks) {
            var s = i0(this);
            return e = Array.from(this.h.audioTracks), e.length ? e.map(function(u) {
              return Wa(u, s);
            }) : s ? [Wa(null, s)] : [];
          }
          return [];
        }, f.Lc = function() {
          if (this.i) {
            if (this.xa()) return [];
            for (var e = this.l ? this.l.B : null, t = [], n = m(this.i.textStreams), r = n.next(); !r.done; r = n.next()) {
              r = r.value;
              var i = Zi(r);
              i.active = r == e, t.push(i);
            }
            return t;
          }
          return this.h && this.h.src && this.h.textTracks ? Wl(this).map(function(o) {
            return dm(o);
          }) : [];
        }, f.Kj = function() {
          var e = this.Je;
          return this.i && (e = this.i.imageStreams), e.map(function(t) {
            return Kd(t);
          });
        }, f.yj = function(e) {
          var t = this, n, r;
          return D(function(i) {
            return i.g == 1 ? x(i, $y(t, e), 2) : (n = i.h, n ? (r = [], n.segmentIndex.Hb(function(o) {
              var s = Yy(o.tilesLayout || n.tilesLayout);
              if (s) for (var u = s.rows * s.columns, a = (o.j - o.startTime) / u, l = 0; l < u; l++) {
                var c = Jy(o, n, o.startTime + l * a, s);
                if (!c) break;
                r.push(c);
              }
            }), n.closeSegmentIndex && n.closeSegmentIndex(), i.return(r)) : i.return(null));
          });
        };
        function Yy(e) {
          return e && (e = /(\d+)x(\d+)/.exec(e)) ? { columns: parseInt(e[1], 10), rows: parseInt(e[2], 10) } : null;
        }
        f.Zj = function(e, t) {
          var n = this, r, i, o, s, u, a;
          return D(function(l) {
            return l.g == 1 ? x(l, $y(n, e), 2) : (r = l.h, !r || (r.closeSegmentIndex && (n.zc.has(r) || (i = new Ae(function() {
              r.closeSegmentIndex(), n.zc.delete(r);
            }), n.zc.set(r, i)), o = n.zc.get(r), o.ka(5)), s = r.segmentIndex.find(t), s == null) ? l.return(null) : (u = r.segmentIndex.get(s), (a = Yy(u.tilesLayout || r.tilesLayout)) ? l.return(Jy(u, r, t, a)) : l.return(null)));
          });
        };
        function $y(e, t) {
          var n, r;
          return D(function(i) {
            return i.g == 1 ? e.m != Vt && e.m != Mn || (n = e.Je, e.i && (n = e.i.imageStreams), r = n[0], !r) ? i.return(null) : (t != null && (r = n.find(function(o) {
              return o.id == t;
            })), r ? r.segmentIndex ? i.A(2) : x(i, r.createSegmentIndex(), 2) : i.return(null)) : i.return(r);
          });
        }
        function Jy(e, t, n, r) {
          var i = t.width || 0, o = t.height || 0, s = i / r.columns, u = o / r.rows, a = r.columns * r.rows, l = e.j - e.startTime;
          l = e.B || l / a;
          var c = e.startTime, d = 0, h = 0;
          return a > 1 && (h = Math.floor((n - e.startTime) / l + 1e-4), c = e.startTime + h * l, d = h % r.columns * s, h = Math.floor(h / r.columns) * u), c >= e.endTime || sh(c, e.endTime, 1e-4) ? null : (r = !1, (n = e.thumbnailSprite) && (r = !0, u = n.height, d = n.positionX, h = n.positionY, s = n.width), {
            segment: e,
            imageHeight: o,
            imageWidth: i,
            height: u,
            positionX: d,
            positionY: h,
            startTime: c,
            duration: l,
            uris: e.P(),
            startByte: e.Kc(),
            endByte: e.Ic(),
            width: s,
            sprite: r,
            mimeType: e.mimeType || t.mimeType,
            codecs: e.codecs || t.codecs
          });
        }
        f.nh = function(e) {
          function t() {
            var r = n.i.textStreams.find(function(i) {
              return i.id == e.id;
            });
            r && r != n.l.B && (Hf(n.B.h, r, !1), yl(n.l, r), ei(n), bu(n), n.Ld = r.language);
          }
          var n = this;
          this.i && this.G && (t(), !this.xa()) || (function() {
            if (n.h && n.h.textTracks) {
              var r = Wl(n), i = r.find(function(u) {
                return Ka(u) === e.id;
              });
              if (i) {
                if (n.u instanceof Pt) {
                  r = m(r);
                  for (var o = r.next(); !o.done; o = r.next()) {
                    o = o.value;
                    var s = o === i ? n.$ ? "showing" : "hidden" : "disabled";
                    o.mode !== s && (o.mode = s);
                  }
                } else r = r.find(function(u) {
                  return u.mode !== "disabled";
                }), r !== i && (r && (r.mode = "disabled", n.j.Ma(r, "cuechange"), n.u.remove(0, 1 / 0)), i && Qy(n, i));
                ei(n), bu(n);
              }
            }
          })();
        };
        function Qy(e, t) {
          e.j.D(t, "cuechange", function() {
            e.u.remove(0, Math.max(0, e.h.currentTime - e.g.streaming.bufferBehind));
            var n = { periodStart: 0, segmentStart: 0, segmentEnd: e.h.duration, vttOffset: 0 }, r = [], i = Array.from(t.activeCues || []);
            i = m(i);
            for (var o = i.next(); !o.done; o = i.next()) {
              if (o = o.value, o.endTime === 1 / 0 || o.endTime < o.startTime) o = null;
              else {
                var s = new ot(o.startTime, o.endTime, o.text);
                s.line = typeof o.line == "number" ? o.line : null, o.lineAlign && (s.lineAlign = o.lineAlign), s.lineInterpretation = o.snapToLines ? Js : 1, s.position = typeof o.position == "number" ? o.position : null, o.positionAlign && (s.positionAlign = o.positionAlign), s.size = o.size, s.textAlign = o.align, o.vertical === "lr" ? s.writingMode = "vertical-lr" : o.vertical === "rl" && (s.writingMode = "vertical-rl"), o.region && (s.region.id = o.region.id, s.region.height = o.region.lines, s.region.heightUnits = 2, s.region.regionAnchorX = o.region.regionAnchorX, s.region.regionAnchorY = o.region.regionAnchorY, s.region.scroll = o.region.scroll, s.region.viewportAnchorX = o.region.viewportAnchorX, s.region.viewportAnchorY = o.region.viewportAnchorY, s.region.viewportAnchorUnits = Sn, s.region.width = o.region.width, s.region.widthUnits = Sn), ja(s), o = s;
              }
              o && ((s = e.g.mediaSource.modifyCueCallback) && s(o, null, n), r.push(o));
            }
            e.u.append(r);
          }), t.mode = document.pictureInPictureElement ? "showing" : "hidden";
        }
        f.Gf = function(e, t, n) {
          function r() {
            var o = i.i.variants.find(function(u) {
              return u.id == e.id;
            });
            if (o && ou(o)) {
              var s = i.l.o;
              i.g.abr.enabled && (s.video != o.video || s.audio && o.audio && s.audio.language == o.audio.language && s.audio.channelsCount == o.audio.channelsCount && s.audio.label == o.audio.label) && De("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack()."), i.xa() ? Lu(i, o, !1, !1, 0) : Lu(i, o, !1, t || !1, n || 0), i.J.configure({
                language: o.language,
                role: o.audio && o.audio.roles && o.audio.roles[0] || "",
                videoRole: o.video && o.video.roles && o.video.roles[0] || "",
                channelCount: o.audio && o.audio.channelsCount ? o.audio.channelsCount : 0,
                hdrLevel: o.video && o.video.hdr ? o.video.hdr : "",
                spatialAudio: o.audio && o.audio.spatialAudio ? o.audio.spatialAudio : !1,
                videoLayout: o.video && o.video.videoLayout ? o.video.videoLayout : "",
                audioLabel: o.audio && o.audio.label ? o.audio.label : "",
                videoLabel: o.video && o.video.label ? o.video.label : "",
                codecSwitchingStrategy: i.g.mediaSource.codecSwitchingStrategy,
                audioCodec: o.audio && o.audio.codecs ? o.audio.codecs : "",
                activeAudioCodec: s.audio && s.audio.codecs ? s.audio.codecs : "",
                activeAudioChannelCount: s.audio && s.audio.channelsCount ? s.audio.channelsCount : 0,
                preferredAudioCodecs: i.g.preferredAudioCodecs,
                preferredAudioChannelCount: i.g.preferredAudioChannelCount
              }), Pi(i);
            }
          }
          var i = this;
          t = t === void 0 ? !1 : t, n = n === void 0 ? 0 : n, !(this.i && this.G && (r(), !this.xa())) && (function() {
            if (e.originalAudioId && i.h && i.h.audioTracks) {
              var o = Array.from(i.h.audioTracks);
              o = m(o);
              for (var s = o.next(); !s.done; s = o.next()) if (s = s.value, Ka(s) == e.id) {
                fh(i, s);
                break;
              }
            }
          })();
        }, f.Uk = function(e, t) {
          function n() {
            var i = r.J.getConfiguration();
            i.audioCodec = e.codecs || "", i.audioLabel = e.label || "", i.channelCount = e.channelsCount || 0, i.language = e.language, i.role = e.roles[0] || "", i.spatialAudio = e.spatialAudio;
            var o = r.l.o;
            (o = o && o.audio) && (i.activeAudioCodec = o.codecs || "", i.activeAudioChannelCount = o.channelsCount || 0), r.J.configure(i), Di(r, !0, t, !1, !1);
          }
          var r = this;
          t = t === void 0 ? 0 : t, !(this.i && this.G && (n(), !this.xa())) && (function() {
            if (r.h && r.h.audioTracks) {
              var i = He(e.language), o = Array.from(r.h.audioTracks), s = null;
              o = m(o);
              for (var u = o.next(); !u.done; u = o.next()) {
                u = u.value;
                var a = u.language || "und";
                if (u.label == e.label && He(a) == i && u.kind == e.roles[0]) {
                  s = u;
                  break;
                }
              }
              s && fh(r, s);
            }
          })();
        }, f.getAudioTracks = function() {
          if (this.i && !this.xa()) {
            var e = this.sc();
            if (!e.length) return [];
            var t = e.find(function(o) {
              return o.active;
            });
            if (!t) return [];
            var n = e;
            if (this.m != Vt || this.xa() || (n = e.filter(function(o) {
              return o.originalVideoId === t.originalVideoId && (o.audioCodec || Kr.includes(o.audioMimeType || ""));
            })), !n.length) return [];
            e = /* @__PURE__ */ new Map(), n = m(n);
            for (var r = n.next(); !r.done; r = n.next()) {
              var i = r.value;
              r = [i.language, i.originalLanguage, i.label || "", (i.audioRoles || []).join(","), i.channelsCount, i.spatialAudio, i.audioCodec || "", i.accessibilityPurpose || ""].join("_"), i = { active: i.active, language: i.language, label: i.label, mimeType: i.audioMimeType, codecs: i.audioCodec, primary: i.primary, roles: i.audioRoles || [], accessibilityPurpose: i.accessibilityPurpose, channelsCount: i.channelsCount, audioSamplingRate: i.audioSamplingRate, spatialAudio: i.spatialAudio, originalLanguage: i.originalLanguage }, e.has(r) ? !e.get(r).active && i.active && e.set(r, i) : e.set(r, i);
            }
            return Array.from(e.values());
          }
          return this.h && this.h.audioTracks ? Array.from(this.h.audioTracks).map(function(o) {
            var s = o.language;
            return s = { active: o.enabled, language: He(s || "und"), label: o.label, mimeType: null, codecs: null, primary: o.kind == "main", roles: [], accessibilityPurpose: null, channelsCount: null, audioSamplingRate: null, spatialAudio: !1, originalLanguage: s }, o.kind && (o.kind == "description" && (s.accessibilityPurpose = "visually impaired"), s.roles.push(o.kind)), o.configuration && (o.configuration.codec && (s.codecs = o.configuration.codec), o.configuration.sampleRate && (s.audioSamplingRate = o.configuration.sampleRate), o.configuration.numberOfChannels && (s.channelsCount = o.configuration.numberOfChannels)), s;
          }) : [];
        }, f.Wk = function(e, t, n) {
          t = t === void 0 ? !1 : t, n = n === void 0 ? 0 : n;
          var r = this.sc();
          if (r.length) {
            var i = r.find(function(s) {
              return s.active;
            });
            if (i) {
              r = r.filter(function(s) {
                return (s.videoBandwidth || s.bandwidth) == e.bandwidth && s.width == e.width && s.height == e.height && s.frameRate == e.frameRate && s.pixelAspectRatio == e.pixelAspectRatio && s.hdr == e.hdr && s.colorGamut == e.colorGamut && s.videoLayout == e.videoLayout && s.videoMimeType == e.mimeType && s.videoCodec == e.codecs && di(s.videoRoles, e.roles) && s.videoLabel == e.label;
              });
              var o;
              r.length == 1 ? o = r[0] : o = r.find(function(s) {
                return s.audioId === i.audioId;
              }), o || (o = r.find(function(s) {
                return s.language == i.language && s.label === i.label && s.channelsCount === i.channelsCount && s.spatialAudio === i.spatialAudio && s.audioMimeType === i.audioMimeType && Kt(s.audioCodec || "") === Kt(i.audioCodec || "") && di(s.audioRoles, i.audioRoles);
              })), o && !o.active && this.Gf(o, t, n);
            }
          }
        }, f.getVideoTracks = function() {
          if (this.m == Mn || this.xa()) return [];
          var e = this.sc();
          if (!e.length) return [];
          var t = e.find(function(o) {
            return o.active;
          });
          if (!t) return [];
          var n = e;
          if (this.pi() || (n = e.filter(function(o) {
            return o.videoCodec && o.audioGroupId === t.audioGroupId && o.originalAudioId === t.originalAudioId ? o.audioId === t.audioId ? !0 : o.language === t.language && o.label === t.label && o.channelsCount === t.channelsCount && o.spatialAudio === t.spatialAudio && o.audioMimeType === t.audioMimeType && Kt(o.audioCodec || "") === Kt(t.audioCodec || "") && di(o.audioRoles, t.audioRoles) : !1;
          })), !n.length) return [];
          e = /* @__PURE__ */ new Map(), n = m(n);
          for (var r = n.next(); !r.done; r = n.next()) {
            r = r.value;
            var i = r.originalVideoId;
            i || r.videoId == null || (i = String(r.videoId)), i && e.set(i, { active: r.active, bandwidth: r.videoBandwidth || r.bandwidth, width: r.width, height: r.height, frameRate: r.frameRate, pixelAspectRatio: r.pixelAspectRatio, hdr: r.hdr, colorGamut: r.colorGamut, videoLayout: r.videoLayout, mimeType: r.videoMimeType, codecs: r.videoCodec, roles: r.videoRoles || [], label: r.videoLabel });
          }
          return Array.from(e.values());
        }, f.Aj = function() {
          return f0(this.sc());
        }, f.Xj = function() {
          return f0(this.Lc());
        }, f.zj = function() {
          return Array.from(d0(this.sc()));
        }, f.Wj = function() {
          return Array.from(d0(this.Lc()));
        }, f.Pi = function(e, t, n, r, i, o, s) {
          function u() {
            function l(g, w) {
              return g.video || w.video ? g.video && w.video ? Math.abs((g.video.height || 0) - (w.video.height || 0)) + Math.abs((g.video.width || 0) - (w.video.width || 0)) : 1 / 0 : 0;
            }
            var c = a.l.o;
            a.J = a.g.adaptationSetCriteriaFactory(), a.J.configure({
              language: e,
              role: t || "",
              videoRole: c.video && c.video.roles && c.video.roles[0] || "",
              channelCount: n || 0,
              hdrLevel: "",
              spatialAudio: o || !1,
              videoLayout: "",
              audioLabel: s || "",
              videoLabel: "",
              codecSwitchingStrategy: a.g.mediaSource.codecSwitchingStrategy,
              audioCodec: i || "",
              activeAudioCodec: c.audio && c.audio.codecs ? c.audio.codecs : "",
              activeAudioChannelCount: c.audio && c.audio.channelsCount ? c.audio.channelsCount : 0,
              preferredAudioCodecs: a.g.preferredAudioCodecs,
              preferredAudioChannelCount: a.g.preferredAudioChannelCount
            });
            var d = a.J.create(a.i.variants), h = null;
            d = m(d.values());
            for (var p = d.next(); !p.done; p = d.next()) p = p.value, ou(p) && (!h || l(h, c) > l(p, c)) && (h = p);
            h != c && (h ? (c = Qi(h), a.Gf(c, !0, r || 0)) : Di(a));
          }
          var a = this;
          n = n === void 0 ? 0 : n, r = r === void 0 ? 0 : r, i = i === void 0 ? "" : i, o = o === void 0 ? !1 : o, s = s === void 0 ? "" : s, !(this.i && this.G && (u(), !this.xa())) && (function() {
            if (a.h && a.h.audioTracks) {
              var l = Bo(a.sc(), e, t || "", !1)[0];
              l && a.Gf(l);
            }
          })();
        }, f.mh = function(e, t, n) {
          function r() {
            i.Ld = e, i.Pd = t || "", i.Od = n || !1;
            var o = Bo(i.i.textStreams, i.Ld, i.Pd, i.Od)[0] || null;
            o && o != i.l.B && (Hf(i.B.h, o, !1), i.g.streaming.alwaysStreamText || i.Pg()) && (yl(i.l, o), ei(i), bu(i));
          }
          var i = this;
          n = n === void 0 ? !1 : n, !(this.i && this.G && (r(), !this.xa())) && (function() {
            var o = Bo(i.Lc(), e, t || "", n || !1)[0];
            o && i.nh(o);
          })();
        }, f.Vk = function(e, t, n) {
          function r() {
            for (var o = null, s = m(i.i.variants), u = s.next(); !u.done; u = s.next()) if (u = u.value, u.audio.label == e) {
              o = u;
              break;
            }
            o != null && (i.J = i.g.adaptationSetCriteriaFactory(), i.J.configure({ language: o.language, role: "", videoRole: "", channelCount: 0, hdrLevel: "", spatialAudio: !1, videoLayout: "", videoLabel: "", audioLabel: e, codecSwitchingStrategy: i.g.mediaSource.codecSwitchingStrategy, audioCodec: "", activeAudioCodec: "", activeAudioChannelCount: 0, preferredAudioCodecs: i.g.preferredAudioCodecs, preferredAudioChannelCount: i.g.preferredAudioChannelCount }), Di(i, t, n));
          }
          var i = this;
          t = t === void 0 ? !0 : t, n = n === void 0 ? 0 : n, !(this.i && this.G && (r(), !this.xa())) && (function() {
            if (i.h && i.h.audioTracks) {
              var o = Array.from(i.h.audioTracks), s = null;
              o = m(o);
              for (var u = o.next(); !u.done; u = o.next()) u = u.value, u.label == e && (s = u);
              s && fh(i, s);
            }
          })();
        }, f.Pg = function() {
          var e = this.$;
          return this.u ? this.u.isTextVisible() : e;
        }, f.Ej = function() {
          return this.ob.map(function(e) {
            return Zi(e);
          });
        }, f.Cj = function(e) {
          if (Ne("getChapters", "Please use an getChaptersAsync."), !this.ob.length) return [];
          var t = He(e);
          if (e = this.ob.filter(function(o) {
            return He(o.language) == t;
          }), !e.length) return [];
          var n = [], r = /* @__PURE__ */ new Set();
          e = m(e);
          for (var i = e.next(); !i.done; i = e.next()) i = i.value, i.segmentIndex && i.segmentIndex.Hb(function(o) {
            var s = o.P()[0], u = o.startTime + "-" + o.endTime + "-" + s;
            o = { id: u, title: s, startTime: o.startTime, endTime: o.endTime }, r.has(u) || (n.push(o), r.add(u));
          });
          return n;
        }, f.Dj = function(e) {
          var t = this, n, r, i, o, s, u, a;
          return D(function(l) {
            switch (l.g) {
              case 1:
                if (!t.ob.length) return l.return([]);
                if (n = He(e), r = t.ob.filter(function(c) {
                  return He(c.language) == n;
                }), !r.length) return l.return([]);
                i = [], o = /* @__PURE__ */ new Set(), s = m(r), u = s.next();
              case 2:
                if (u.done) {
                  l.A(4);
                  break;
                }
                if (a = u.value, a.segmentIndex) {
                  l.A(5);
                  break;
                }
                return x(l, a.createSegmentIndex(), 5);
              case 5:
                a.segmentIndex.Hb(function(c) {
                  var d = c.P()[0], h = c.startTime + "-" + c.endTime + "-" + d;
                  c = { id: h, title: d, startTime: c.startTime, endTime: c.endTime }, o.has(h) || (i.push(c), o.add(h));
                }), u = s.next(), l.A(2);
                break;
              case 4:
                return l.return(i);
            }
          });
        };
        function Wl(e) {
          return Array.from(e.h.textTracks).filter(function(t) {
            return t.kind != "metadata" && t.kind != "chapters" && t.label != "Shaka Player TextTrack";
          });
        }
        function zI(e) {
          return Array.from(e.h.textTracks).find(function(t) {
            return t.label == "Shaka Player TextTrack";
          });
        }
        function XI(e) {
          return Array.from(e.h.textTracks).filter(function(t) {
            return t.kind == "metadata";
          });
        }
        f.rh = function(e) {
          e = !!e, this.$ != e && (this.$ = e, this.m == Vt ? (this.u.setTextVisibility(e), this.g.streaming.alwaysStreamText || (e ? this.l.B || (e = Bo(this.i.textStreams, this.Ld, this.Pd, this.Od), e.length > 0 && (yl(this.l, e[0]), ei(this), bu(this))) : wE(this.l))) : this.h && this.h.src && this.h.textTracks && this.u.setTextVisibility(e), a0(this));
        }, f.Qj = function() {
          if (this.G) var e = this.G.Qd();
          else {
            if (this.O == null) return /* @__PURE__ */ new Date();
            if (this.O instanceof Date) return this.O;
            e = this.O;
          }
          if (this.i && !this.xa()) {
            var t = this.i.presentationTimeline;
            return new Date(((t.m || t.i) + e) * 1e3);
          }
          return this.h && this.h.getStartDate ? (t = this.h.getStartDate(), t instanceof Date && !isNaN(t.getTime()) ? new Date(t.getTime() + e * 1e3) : null) : null;
        }, f.ii = function() {
          if (this.i && !this.xa()) {
            var e = this.i.presentationTimeline;
            return e = e.m || e.i, e === null ? null : new Date(e * 1e3);
          }
          return this.h && this.h.getStartDate ? (e = this.h.getStartDate(), e instanceof Date && !isNaN(e.getTime()) ? e : null) : null;
        }, f.bf = function() {
          return this.U() && this.i ? this.i.presentationTimeline.bf() : null;
        }, f.Hc = function() {
          if (this.m == Vt) return this.H.Hc();
          var e = { total: [], audio: [], video: [], text: [] };
          return this.m == Mn && (e.total = $r(this.h.buffered)), e;
        };
        function Zy(e) {
          if (!e.h || !e.h.currentTime) return null;
          var t = e.ii();
          return t ? Math.floor(Date.now() - (t.getTime() + e.h.currentTime * 1e3)) : null;
        }
        f.getBandwidthEstimate = function() {
          return this.o ? this.o.getBandwidthEstimate() : NaN;
        }, f.getStats = function() {
          if (this.m != Vt && this.m != Mn) return {
            width: NaN,
            height: NaN,
            currentCodecs: "",
            streamBandwidth: NaN,
            decodedFrames: NaN,
            droppedFrames: NaN,
            corruptedFrames: NaN,
            stallsDetected: NaN,
            gapsJumped: NaN,
            estimatedBandwidth: NaN,
            completionPercent: NaN,
            loadLatency: NaN,
            manifestTimeSeconds: NaN,
            drmTimeSeconds: NaN,
            playTime: NaN,
            pauseTime: NaN,
            bufferingTime: NaN,
            licenseTime: NaN,
            liveLatency: NaN,
            maxSegmentDuration: NaN,
            manifestSizeBytes: NaN,
            bytesDownloaded: NaN,
            nonFatalErrorCount: NaN,
            manifestPeriodCount: NaN,
            manifestGapCount: NaN,
            switchHistory: [],
            stateHistory: []
          };
          dh(this);
          var e = this.h, t = e.currentTime / e.duration;
          if (isNaN(t) || this.U() || zE(this.B, Math.round(100 * t)), this.G && (this.B.T = this.G.Ih(), this.B.W = this.G.Kh()), e.getVideoPlaybackQuality && (t = e.getVideoPlaybackQuality(), WE(this.B, Number(t.droppedVideoFrames), Number(t.totalVideoFrames)), this.B.N = Number(t.corruptedVideoFrames)), this.B.o = this.F ? Zx(this.F) : NaN, oy(this.B, e.videoWidth || NaN, e.videoHeight || NaN), this.B.l = "", this.U() && (e = Zy(this), e != null && (this.B.F = e / 1e3)), t = this.sc().find(function(i) {
            return i.active;
          }), e = this.Lc().find(function(i) {
            return i.active;
          }), t) {
            if (t.bandwidth) {
              var n = this.M ? this.M.i : 1, r = n * t.bandwidth;
              e && e.bandwidth && (r += n * e.bandwidth), this.B.B = r;
            }
            t.width && t.height && oy(this.B, t.width || NaN, t.height || NaN), t = t.codecs, e && (t += "," + (e.codecs || e.mimeType)), t && (this.B.l = t);
          }
          return this.m != Vt || this.xa() || (this.i && (this.B.I = this.i.periodCount, this.B.H = this.i.gapCount, this.i.presentationTimeline && (this.B.K = this.i.presentationTimeline.h)), e = this.o.getBandwidthEstimate(), this.B.u = e), this.m == Mn && sy(this.B, NaN), XE(this.B);
        }, f.Rd = function(e, t, n, r, i, o, s) {
          s = s === void 0 ? !1 : s;
          var u = this, a, l, c, d, h, p, g, w, T, E, A, I;
          return D(function(P) {
            switch (P.g) {
              case 1:
                if (u.m != Vt && u.m != Mn) throw new b(1, 7, 7004);
                if (n != "subtitles" && n != "captions" && De("Using a kind value different of `subtitles` or `captions` can cause unwanted issues."), r) {
                  P.A(2);
                  break;
                }
                return x(P, zl(u, e), 3);
              case 3:
                r = P.h;
              case 2:
                if (a = [], u.C && (a = u.C.getCuePoints()), u.m != Mn) {
                  P.A(4);
                  break;
                }
                return l = Se(), s && l.Ha() === "WEBKIT" && (n = "forced"), x(P, qI(u, e, t, n, r, o || "", a), 5);
              case 5:
                if (c = P.h, c.track) return nn(u), ei(u), P.return(dm(c.track));
                throw new b(1, 2, 2012);
              case 4:
                if (d = xt, h = u.Ra(), p = h.end - h.start, u.i && (p = u.i.presentationTimeline.getDuration()), p == 1 / 0) throw new b(1, 4, 4033);
                if (!a.length) {
                  P.A(6);
                  break;
                }
                return x(P, Xl(u, e), 7);
              case 7:
                g = P.h, w = e0(u, g, r, a), T = new Blob([w], { type: "text/vtt" }), e = yf(T), r = "text/vtt";
              case 6:
                if (E = {
                  id: u.Ee++,
                  originalId: null,
                  groupId: null,
                  createSegmentIndex: function() {
                    return Promise.resolve();
                  },
                  segmentIndex: hl(0, p, [e]),
                  mimeType: r || "",
                  codecs: i || "",
                  kind: n,
                  encrypted: !1,
                  drmInfos: [],
                  keyIds: /* @__PURE__ */ new Set(),
                  language: t,
                  originalLanguage: t,
                  label: o || null,
                  type: d.Na,
                  primary: !1,
                  trickModeVideo: null,
                  dependencyStream: null,
                  emsgSchemeIdUris: null,
                  roles: [],
                  forced: !!s,
                  channelsCount: null,
                  audioSamplingRate: null,
                  spatialAudio: !1,
                  closedCaptions: null,
                  accessibilityPurpose: null,
                  external: !0,
                  fastSwitching: !1,
                  fullMimeTypes: /* @__PURE__ */ new Set([gt(r || "", i || "")]),
                  isAudioMuxedInVideo: !1,
                  baseOriginalId: null
                }, A = gt(E.mimeType, E.codecs), I = eu(A), !I) throw new b(2, 2, 2014, r);
                return u.i.textStreams.push(E), nn(u), ei(u), P.return(Zi(E));
            }
          });
        }, f.Oe = function(e, t) {
          var n = this, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P;
          return D(function(N) {
            switch (N.g) {
              case 1:
                if (n.m != Vt && n.m != Mn) throw new b(1, 7, 7004);
                if (t) {
                  N.A(2);
                  break;
                }
                return x(N, zl(n, e), 3);
              case 3:
                t = N.h;
              case 2:
                if (t != "text/vtt") throw new b(1, 2, 2017, e);
                if (r = xt, i = n.Ra(), o = i.end - i.start, n.i && (o = n.i.presentationTimeline.getDuration()), o == 1 / 0) throw new b(1, 4, 4045);
                return x(N, Xl(n, e), 4);
              case 4:
                if (s = N.h, u = Zs(t), !u) throw new b(2, 2, 2014, t);
                for (a = u(), l = { periodStart: 0, segmentStart: 0, segmentEnd: o, vttOffset: 0 }, c = pe(s), d = a.parseMedia(c, l, e, []), h = [], p = m(d), g = p.next(), w = {}; !g.done; w = { Tf: void 0, ld: void 0 }, g = p.next()) w.ld = g.value, w.Tf = null, T = /* @__PURE__ */ (function(M) {
                  return function() {
                    return M.Tf == null && (M.Tf = bt([e], [M.ld.payload])), M.Tf || [];
                  };
                })(w), E = new se(w.ld.startTime, w.ld.endTime, T, 0, null, null, 0, 0, 1 / 0), w.ld.payload.includes("#xywh") && (A = w.ld.payload.split("#xywh=")[1].split(","), A.length === 4 && E.Jf({ height: parseInt(A[3], 10), positionX: parseInt(A[0], 10), positionY: parseInt(A[1], 10), width: parseInt(A[2], 10) })), h.push(E);
                if (I = t, !h.length) {
                  N.A(5);
                  break;
                }
                return x(N, zl(n, h[0].P()[0]), 6);
              case 6:
                I = N.h;
              case 5:
                return P = {
                  id: n.Ee++,
                  originalId: null,
                  groupId: null,
                  createSegmentIndex: function() {
                    return Promise.resolve();
                  },
                  segmentIndex: new Ue(h),
                  mimeType: I || "",
                  codecs: "",
                  kind: "",
                  encrypted: !1,
                  drmInfos: [],
                  keyIds: /* @__PURE__ */ new Set(),
                  language: "und",
                  originalLanguage: null,
                  label: null,
                  type: r.Vf,
                  primary: !1,
                  trickModeVideo: null,
                  dependencyStream: null,
                  emsgSchemeIdUris: null,
                  roles: [],
                  forced: !1,
                  channelsCount: null,
                  audioSamplingRate: null,
                  spatialAudio: !1,
                  closedCaptions: null,
                  tilesLayout: "1x1",
                  accessibilityPurpose: null,
                  external: !0,
                  fastSwitching: !1,
                  fullMimeTypes: /* @__PURE__ */ new Set([gt(I || "", "")]),
                  isAudioMuxedInVideo: !1,
                  baseOriginalId: null
                }, n.m == Mn ? n.Je.push(P) : n.i.imageStreams.push(P), nn(n), N.return(Kd(P));
            }
          });
        }, f.Ne = function(e, t, n) {
          var r = this, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A;
          return D(function(I) {
            switch (I.g) {
              case 1:
                if (r.m != Vt && r.m != Mn) throw new b(1, 7, 7004);
                if (n) {
                  I.A(2);
                  break;
                }
                return x(I, zl(r, e), 3);
              case 3:
                n = I.h;
              case 2:
                if (i = xt, o = r.Ra(), s = o.end - o.start, r.i && (s = r.i.presentationTimeline.getDuration()), s == 1 / 0) throw new b(1, 4, 4055);
                if (u = Zs(n), !u) throw new b(2, 2, 2014, n);
                return x(I, Xl(r, e), 4);
              case 4:
                for (a = I.h, l = u(), c = { periodStart: 0, segmentStart: 0, segmentEnd: s, vttOffset: 0 }, d = pe(a), h = l.parseMedia(d, c, e, []), p = [], g = m(h), w = g.next(), T = {}; !w.done; T = { We: void 0 }, w = g.next()) T.We = w.value, E = new se(T.We.startTime, T.We.endTime, /* @__PURE__ */ (function(P) {
                  return function() {
                    return [P.We.payload];
                  };
                })(T), 0, null, null, 0, 0, 1 / 0), p.push(E);
                return A = {
                  id: r.Ee++,
                  originalId: null,
                  groupId: null,
                  createSegmentIndex: function() {
                    return Promise.resolve();
                  },
                  segmentIndex: new Ue(p),
                  mimeType: "text/plain",
                  codecs: "",
                  kind: "",
                  encrypted: !1,
                  drmInfos: [],
                  keyIds: /* @__PURE__ */ new Set(),
                  language: t,
                  originalLanguage: t,
                  label: null,
                  type: i.Na,
                  primary: !1,
                  trickModeVideo: null,
                  dependencyStream: null,
                  emsgSchemeIdUris: null,
                  roles: [],
                  forced: !1,
                  channelsCount: null,
                  audioSamplingRate: null,
                  spatialAudio: !1,
                  closedCaptions: null,
                  accessibilityPurpose: null,
                  external: !0,
                  fastSwitching: !1,
                  fullMimeTypes: /* @__PURE__ */ new Set([gt("text/plain", "")]),
                  isAudioMuxedInVideo: !1,
                  baseOriginalId: null
                }, r.ob.push(A), nn(r), I.return(Zi(A));
            }
          });
        };
        function zl(e, t) {
          var n;
          return D(function(r) {
            switch (r.g) {
              case 1:
                return de(r, 2), x(r, ts(t, e.N, e.g.streaming.retryParameters), 4);
              case 4:
                n = r.h, ye(r, 3);
                break;
              case 2:
                he(r);
              case 3:
                if (n) return r.return(n);
                throw new b(1, 2, 2011, t);
            }
          });
        }
        function qI(e, t, n, r, i, o, s) {
          var u, a, l, c;
          return D(function(d) {
            if (d.g == 1) return i != "text/vtt" || s.length ? x(d, Xl(e, t), 3) : d.A(2);
            d.g != 2 && (u = d.h, a = e0(e, u, i, s), l = new Blob([a], { type: "text/vtt" }), t = yf(l), i = "text/vtt"), c = document.createElement("track");
            e: {
              var h = e.K, p = t;
              try {
                if (!h.g.enabled) {
                  var g = p;
                  break e;
                }
                var w = Qf(h);
                w.ot = nh, w.su = !0;
                var T = Du(w);
                g = Nl(p, T);
                break e;
              } catch (E) {
                ci("CMCD_TEXT_TRACK_ERROR", "Could not generate text track CMCD data.", E), g = p;
                break e;
              }
              g = void 0;
            }
            return c.src = g, c.label = o, c.kind = r, c.srclang = n, e.h.getAttribute("crossorigin") || e.h.setAttribute("crossorigin", "anonymous"), e.h.appendChild(c), e.Yf.push(c), d.return(c);
          });
        }
        function Xl(e, t) {
          var n, r, i, o;
          return D(function(s) {
            if (s.g == 1) {
              n = Xn, r = e.g.streaming.retryParameters, i = At([t], r), i.method = "GET";
              var u = e.K;
              try {
                u.g.enabled && us(u, i, { ot: nh, su: !0 });
              } catch (a) {
                ci("CMCD_TEXT_ERROR", "Could not generate text CMCD data.", a);
              }
              return x(s, e.N.request(n, i).promise, 2);
            }
            return o = s.h, s.return(o.data);
          });
        }
        function e0(e, t, n, r) {
          var i = Zs(n);
          if (i) return n = i(), e = { periodStart: 0, segmentStart: 0, segmentEnd: e.h.duration, vttOffset: 0 }, t = pe(t), t = n.parseMedia(t, e, null, []), cI(t, r);
          throw new b(2, 2, 2014, n);
        }
        f.al = function(e, t) {
          this.ya.width = e, this.ya.height = t;
        }, f.ih = function(e) {
          if (this.m == Vt) {
            var t = this.l;
            if (e = e === void 0 ? 0.1 : e, t.l.g) t = !1;
            else if (t.F) t = !1;
            else {
              for (var n = m(t.h.values()), r = n.next(); !r.done; r = n.next()) r = r.value, !r.ud || r.Ja || r.qb || (r.ud = !1, Wt(t, r, e));
              t = !0;
            }
          } else t = !1;
          return t;
        }, f.Hg = function() {
          return De("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees.  It may change at any time!  Please consider filing a feature request for whatever you use getManifest() for."), this.i;
        }, f.Nj = function() {
          return this.Ac;
        }, f.Ij = function() {
          var e = { video: null, audio: null, text: null };
          if (this.m != Vt) return e;
          var t = this.l.o, n = this.h.currentTime;
          t = m([t.video, t.audio, this.l.B]);
          for (var r = t.next(); !r.done; r = t.next()) if ((r = r.value) && r.segmentIndex) {
            var i = r.segmentIndex.find(n);
            i = r.segmentIndex.get(i), i = { codecs: i.codecs || r.codecs, mimeType: i.mimeType || r.mimeType, bandwidth: i.bandwidth || r.bandwidth }, r.type == "video" ? (i.width = r.width, i.height = r.height, e.video = i) : r.type == "audio" ? e.audio = i : r.type == xe && (e.text = i);
          }
          return e;
        };
        function xr(e) {
          var t = os();
          return t.streaming.failureCallback = function(n) {
            if (e.U()) {
              var r = null;
              n.code == 1001 || n.code == 1002 ? (r = 1, e.g.streaming.lowLatencyMode && (r = 0.1)) : n.code == 1003 && (r = 0.1), r != null && (n.severity = 1, e.ih(r));
            }
          }, t.textDisplayFactory = function() {
            if (e.Ae) {
              var n = e.h;
              n = !(n.webkitDisplayingFullscreen || n.webkitPresentationMode && n.webkitPresentationMode != "inline");
            } else n = !1;
            return n ? new qt(e.h, e.Ae) : "track" in document.createElement("track") ? new Pt(e) : new Xt();
          }, t;
        }
        f.Wi = function(e) {
          this.Ae = e;
        };
        function YI(e, t) {
          for (var n = /* @__PURE__ */ new Set(), r = m(t.textStreams), i = r.next(); !i.done; i = r.next()) i = i.value, i.mimeType != "application/cea-608" && i.mimeType != "application/cea-708" || n.add(i.originalId);
          for (r = m(t.variants), i = r.next(); !i.done; i = r.next()) if ((i = i.value.video) && i.closedCaptions) {
            for (var o = m(i.closedCaptions.keys()), s = o.next(); !s.done; s = o.next()) if (s = s.value, !n.has(s)) {
              var u = s.startsWith("CC") ? "application/cea-608" : "application/cea-708", a = new pt(), l = i.closedCaptions.get(s);
              u = {
                id: e.Ee++,
                originalId: s,
                groupId: null,
                createSegmentIndex: function() {
                  return Promise.resolve();
                },
                segmentIndex: a,
                mimeType: u,
                codecs: "",
                kind: "caption",
                encrypted: !1,
                drmInfos: [],
                keyIds: /* @__PURE__ */ new Set(),
                language: l,
                originalLanguage: l,
                label: null,
                type: xe,
                primary: !1,
                trickModeVideo: null,
                dependencyStream: null,
                emsgSchemeIdUris: null,
                roles: i.roles,
                forced: !1,
                channelsCount: null,
                audioSamplingRate: null,
                spatialAudio: !1,
                closedCaptions: null,
                accessibilityPurpose: null,
                external: !1,
                fastSwitching: !1,
                fullMimeTypes: /* @__PURE__ */ new Set([gt(u, "")]),
                isAudioMuxedInVideo: !1,
                baseOriginalId: null
              }, t.textStreams.push(u), n.add(s);
            }
          }
        }
        function $I(e, t) {
          var n, r, i, o, s;
          return D(function(u) {
            return u.g == 1 ? (n = e.audio, r = e.video, i = function(a, l) {
              var c, d, h;
              return D(function(p) {
                return p.g == 1 ? a ? a.segmentIndex ? p.A(2) : x(p, a.createSegmentIndex(), 2) : p.return(null) : (d = (c = a.segmentIndex.Xb(l)) ? c.next().value : null, d ? (h = d.startTime, p.return(h)) : p.return(null));
              });
            }, x(u, i(n, t), 2)) : u.g != 3 ? (o = u.h, x(u, i(r, t), 3)) : (s = u.h, s != null && o != null ? u.return(Math.max(s, o)) : s != null ? u.return(s) : o != null ? u.return(o) : u.return(t));
          });
        }
        function Ru(e) {
          var t = e.Og();
          if (e.B && e.R && e.G) {
            if (e.g.streaming.rebufferingGoal == 0) {
              var n = e.M;
              n.j = !1, Af(n);
            } else n = e.M, n.j = t, Af(n);
            if (e.K && (n = e.K, t || n.F || (n.F = !0), n.F && t && (n.I = !0, Yt(n, "ps", { bd: "r" })), n.J = t), dh(e), n = e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts, e.g.streaming.liveSync.dynamicTargetLatency.enabled && t && e.Me < n) {
              n = e.g.streaming.liveSync.dynamicTargetLatency.maxLatency;
              var r = e.g.streaming.liveSync.targetLatencyTolerance, i = e.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;
              e.W && (e.W = Math.min(e.W + ++e.Me * i, n - r));
            }
          }
          t = (/* @__PURE__ */ new Map()).set("buffering", t), e.dispatchEvent(Ze("buffering", t));
        }
        function t0(e, t) {
          e.fc.Qa(), e.fc.D(e.h, "timeupdate", function() {
            var n = e.h.currentTime, r = e.Ra(), i = e.U(), o = i ? e.g.streaming.safeSeekOffset : 0;
            t > 0 ? i && t > 1 && Math.floor(n) >= Math.floor(r.end) && e.Sd() : Math.floor(n) <= Math.floor(r.start + o) && e.Sd();
          });
        }
        function dh(e) {
          if (e.B && e.R) {
            var t = e.B.g, n = "playing";
            e.R.g == to ? n = "buffering" : e.fe() ? n = "ended" : e.h.paused && (n = "paused");
            var r = n;
            if (t.g == null) t.g = { timestamp: Date.now() / 1e3, state: r, duration: 0 }, t = !0;
            else {
              var i = Date.now() / 1e3;
              t.g.duration = i - t.g.timestamp, t.g.state == r ? t = !1 : (t.h.push(t.g), t.g = { timestamp: i, state: r, duration: 0 }, t = !0);
            }
            t && (n = (/* @__PURE__ */ new Map()).set("newstate", n), e.dispatchEvent(Ze("statechanged", n)));
          }
        }
        function n0(e) {
          var t = e.h.playbackRate, n = e.U();
          if (e.g.streaming.vodDynamicPlaybackRate && !n) {
            var r = e.g.streaming.vodDynamicPlaybackRateLowBufferRate, i = e.bi();
            i <= e.g.streaming.vodDynamicPlaybackRateBufferRatio ? t != r && e.we(r, !1) : i == 1 && t !== e.M.qd() && e.Sd();
          }
          if (n && (n = e.Ra(), Number.isFinite(n.end) && !(e.h.currentTime < n.start || e.h.paused))) {
            r = e.g.streaming.liveSync.targetLatencyTolerance, i = e.g.streaming.liveSync.dynamicTargetLatency.enabled;
            var o = e.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
            if (e.g.streaming.liveSync && e.g.streaming.liveSync.enabled)
              var s = e.g.streaming.liveSync.targetLatency, u = s + r, a = Math.max(0, s - r), l = e.g.streaming.liveSync.maxPlaybackRate, c = e.g.streaming.liveSync.minPlaybackRate;
            else e.i && e.i.serviceDescription && (s = e.i.serviceDescription.targetLatency, e.i.serviceDescription.targetLatency != null ? u = e.i.serviceDescription.targetLatency + r : e.i.serviceDescription.maxLatency != null && (u = e.i.serviceDescription.maxLatency), e.i.serviceDescription.targetLatency != null ? a = Math.max(0, e.i.serviceDescription.targetLatency - r) : e.i.serviceDescription.minLatency != null && (a = e.i.serviceDescription.minLatency), l = e.i.serviceDescription.maxPlaybackRate || e.g.streaming.liveSync.maxPlaybackRate, c = e.i.serviceDescription.minPlaybackRate || e.g.streaming.liveSync.minPlaybackRate);
            e.W || typeof s != "number" || (e.W = s);
            var d = e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;
            i && e.ec && e.W !== null && typeof s == "number" && e.Me < d && Date.now() - e.ec > o * 1e3 && (o = e.g.streaming.liveSync.dynamicTargetLatency.minLatency, e.W = Math.max(e.W - (s - o) / 2, o + r), e.ec = Date.now()), i && e.W !== null && (u = e.W + r, a = e.W - r), s = n.end - e.h.currentTime, r = 0, e.m == Mn && (i = e.h.buffered, i.length > 0 && (r = i.end(i.length - 1), r = Math.max(l, r - n.end))), n = e.g.streaming.liveSync.panicMode, i = e.g.streaming.liveSync.panicThreshold * 1e3, o = Date.now() - e.R.i, n && !c && (c = e.g.streaming.liveSync.minPlaybackRate), n && c && o <= i ? t != c && e.we(c, !1) : u != null && l && s - r > u ? (t != l && e.we(l, !1), e.ec = null) : a != null && c && s - r < a ? (t != c && e.we(c, !1), e.ec = null) : t !== e.M.qd() && (e.Sd(), e.ec = Date.now());
          }
        }
        function ql(e) {
          if (e.h) {
            var t = function(i, o) {
              return (sh(i, o, 0.01) || o > i) && e.Xf < i ? (e.Xf = i, !0) : !1;
            }, n = e.Ra();
            if (n = n.end - n.start, n = n > 0 ? e.h.currentTime / n : 0, !isNaN(n)) {
              if (n *= 100, t(0, n)) var r = Ze("started");
              else t(25, n) ? r = Ze("firstquartile") : t(50, n) ? r = Ze("midpoint") : t(75, n) ? r = Ze("thirdquartile") : ((t(100, n) || n > 100) && (r = Ze("complete")), e.g && e.g.playRangeEnd != 1 / 0 && e.fe() && e.h.pause());
              r && e.dispatchEvent(r);
            }
          }
        }
        function Pi(e) {
          try {
            Xm(e.De, e.i);
          } catch (n) {
            return ls(e, n), !1;
          }
          var t = za(e.i.variants);
          return t = e.J.create(t), e = e.o.setVariants(Array.from(t.values())), typeof e == "boolean" ? e : !0;
        }
        function r0(e, t) {
          if (t = t === void 0 ? !1 : t, Pi(e)) {
            if (!e.g.abr.enabled) {
              var n = e.J;
              if (typeof n.getLastAdaptationSet != "function" && (Ne("AdaptationSetCriteria w/o getLastAdaptationSet", "Please use an AdaptationSetCriteria with getLastAdaptationSet."), n.getLastAdaptationSet = function() {
                return null;
              }), (n = n.getLastAdaptationSet()) && (n = Array.from(n.values()), n.length)) {
                var r = e.l.o;
                if (r && r.video && (n = n.find(function(i) {
                  return i.video == r.video;
                }))) return n;
              }
            }
            return e.o.chooseVariant(t);
          }
          return null;
        }
        function Di(e, t, n, r, i) {
          t = t === void 0 ? !0 : t, n = n === void 0 ? 0 : n, r = r === void 0 ? !1 : r, i = i === void 0 ? !0 : i;
          var o = r0(e);
          o && Lu(e, o, i, t, n, r);
        }
        function Lu(e, t, n, r, i, o) {
          o = o === void 0 ? !1 : o;
          var s = e.l.o;
          if (t == s) r && $v(e.l, t, r, i, !0);
          else {
            var u = e.B.h;
            if (u.h != t && (u.h = t, u.g.push({ timestamp: Date.now() / 1e3, id: t.id, type: "variant", fromAdaptation: n, bandwidth: t.bandwidth })), $v(e.l, t, r, i, o, n), r = null, s && (r = Qi(s)), s = Qi(t), s.active = !0, e.T && (i = e.T, t = t.video)) {
              switch (t.dependencyStream && (t = t.dependencyStream), o = 0, u = -1, t.mimeType) {
                case "video/webm":
                  o = 1;
                  break;
                case "video/mp4":
                  o = 2;
              }
              switch (e.di()) {
                case "DASH":
                  u = 1;
                  break;
                case "HLS":
                  u = 0;
              }
              i.g && (i.g.setLevelSwitching(
                t.id,
                !0
              ), i.g.setContainerFormat(o), i.j || i.g.setStreamingFormat(u));
            }
            n ? (n = (/* @__PURE__ */ new Map()).set("oldTrack", r).set("newTrack", s), n = Ze("adaptation", n), lo(e, n)) : o0(e, r, s), s0(e, r, s);
          }
        }
        function fh(e, t) {
          var n = Array.from(e.h.audioTracks).find(function(i) {
            return i.enabled;
          });
          if (t.enabled = !0, n) {
            t.id !== n.id && (n.enabled = !1);
            var r = i0(e);
            n = Wa(n, r), t = Wa(t, r), o0(e, n, t), s0(e, n, t);
          }
        }
        function i0(e) {
          return e.h && e.h.videoTracks ? Array.from(e.h.videoTracks).find(function(t) {
            return t.selected;
          }) : null;
        }
        function nn(e) {
          var t = Ze("trackschanged");
          lo(e, t), u0(e);
        }
        function o0(e, t, n) {
          t = (/* @__PURE__ */ new Map()).set("oldTrack", t).set("newTrack", n), t = Ze("variantchanged", t), lo(e, t);
        }
        function s0(e, t, n) {
          var r = !1;
          t && t.audioId == n.audioId && t.audioGroupId == n.audioGroupId || (r = !0), r && u0(e);
        }
        function u0(e) {
          var t = Ze("audiotrackschanged");
          lo(e, t);
        }
        function ei(e) {
          var t = Ze("textchanged");
          lo(e, t);
        }
        function a0(e) {
          var t = Ze("texttrackvisibility");
          lo(e, t);
        }
        function l0(e) {
          e.g.abr.enabled || hh(e);
          var t = (/* @__PURE__ */ new Map()).set("newStatus", e.g.abr.enabled);
          lo(e, Ze("abrstatuschanged", t));
        }
        function bu(e) {
          var t = e.Lc().find(function(n) {
            return n.active;
          });
          t && e.u && e.u.setTextLanguage && e.u.setTextLanguage(t.language);
        }
        function hh(e, t) {
          if (t = t === void 0 ? !0 : t, e.m == Vt) {
            e.Ge.stop();
            for (var n = m(e.i.variants), r = n.next(); !r.done; r = n.next()) r.value.disabledUntilTime = 0;
            t && Pi(e);
          }
        }
        f.disableStream = function(e, t) {
          if (!this.g.abr.enabled || this.m === dr || !navigator.onLine || t == 0 || !this.i) return !1;
          if (this.i.variants.some(function(u) {
            var a = u[e.type];
            return a && a.id !== e.id && !u.disabledUntilTime ? e.type == "audio" ? e.language === a.language : !0 : !1;
          })) {
            for (var n = !1, r = !1, i = m(this.i.variants), o = i.next(); !o.done; o = i.next()) {
              o = o.value;
              var s = o[e.type];
              s && (s.id === e.id ? (o.disabledUntilTime = Date.now() / 1e3 + t, n = !0) : s.trickModeVideo && s.trickModeVideo.id == e.id && (r = !0));
            }
            return !n && r ? !1 : (this.Ge.Ea(1), t = this.Hc().video.reduce(function(u, a) {
              return u + a.end - a.start;
            }, 0), Di(this, !1, t, !0, !1), !0);
          }
          return !1;
        };
        function ls(e, t) {
          var n, r, i, o, s;
          return D(function(u) {
            switch (u.g) {
              case 1:
                if (e.m == dr) return u.return();
                if (t.severity === 1 && e.B.M++, n = !0, !(e.Ua && e.i && e.l) || t.code != 3016 && t.code != 3014 && t.code != 3015 && t.code != 3024 && t.code != 3018) {
                  u.A(2);
                  break;
                }
                return r = Se(), r.Ha() === "WEBKIT" && t.code == 3016 ? u.return() : (de(u, 3), x(u, El(e.l), 5));
              case 5:
                i = u.h, n = !i, i && (o = Ze("mediasourcerecovered"), e.dispatchEvent(o)), ye(u, 2);
                break;
              case 3:
                he(u), n = !0;
              case 2:
                if (!n) return u.return();
                t.severity === 2 && hh(e, !1), s = Ze("error", (/* @__PURE__ */ new Map()).set(
                  "detail",
                  t
                )), e.dispatchEvent(s), s.defaultPrevented && (t.handled = !0), q(u);
            }
          });
        }
        f.addFont = function(e, t) {
          return NA(e, t);
        };
        function Nu(e, t, n, r) {
          r = r === void 0 ? e : r, e = (/* @__PURE__ */ new Map()).set("detail", { schemeIdUri: n.schemeIdUri, value: n.value, startTime: n.startTime, endTime: n.endTime, id: n.id, timescale: n.timescale, eventElement: n.eventElement, eventNode: n.eventNode }), r.dispatchEvent(Ze(t, e));
        }
        function c0(e, t, n, r) {
          r = r === void 0 ? !1 : r, t = (/* @__PURE__ */ new Map()).set("mediaQuality", { bandwidth: t.bandwidth, audioSamplingRate: t.audioSamplingRate, codecs: t.codecs, contentType: t.contentType, frameRate: t.frameRate, height: t.height, mimeType: t.mimeType, channelsCount: t.channelsCount, pixelAspectRatio: t.pixelAspectRatio, width: t.width, label: t.label, roles: t.roles, language: t.language }).set("position", n), e.dispatchEvent(Ze(r ? "audiotrackchanged" : "mediaqualitychanged", t));
        }
        function ph(e, t) {
          if (t = t === void 0 ? !0 : t, !e.h.error) return t ? new b(2, 3, 3016) : null;
          var n = e.h.error.code;
          return !t && n == 1 ? null : ((t = e.h.error.msExtendedCode) && (t < 0 && (t += 4294967296), t = t.toString(16)), new b(2, 3, 3016, n, t, e.h.error.message));
        }
        function JI(e, t) {
          var n = Ze("keystatuschanged");
          e.dispatchEvent(n);
          var r = Object.keys(t);
          r.length == 1 && r[0] == "" && (r = ["00"], t = { "00": t[""] });
          var i = r.length == 1 && r[0] == "00";
          if (n = !1, r.length) {
            r = e.keySystem();
            for (var o = Go(e.g.drm.clearKeys), s = function(g, w) {
              g.allowedByKeySystem = !0, w = m(w);
              for (var T = w.next(); !T.done; T = w.next()) T = T.value, ((T = t[i ? "00" : T]) || e.F.H) && (g.allowedByKeySystem = g.allowedByKeySystem && !!T && !qm.includes(T));
            }, u = m(e.i.variants), a = u.next(); !a.done; a = u.next()) {
              a = a.value;
              var l = Ux(a);
              l = m(l);
              for (var c = l.next(); !c.done; c = l.next()) {
                c = c.value;
                var d = a.allowedByKeySystem;
                if (c.keyIds.size) if (c.drmInfos.length && !o.size && e.i.type == "HLS") for (var h = m(c.drmInfos), p = h.next(); !p.done; p = h.next()) p = p.value, p.keySystem == r && (p.keyIds.size ? s(a, p.keyIds) : s(a, c.keyIds));
                else s(a, c.keyIds);
                d != a.allowedByKeySystem && (n = !0);
              }
            }
          }
          n && (nn(e), (n = e.l.o) && !n.allowedByKeySystem ? Di(e) : Pi(e));
        }
        function gh(e, t, n) {
          t > 0 && (e.U() || e.Vi(t)), t = e.getDuration(), n < t && (e.U() || e.Ab(n));
        }
        function lo(e, t) {
          D(function(n) {
            if (n.g == 1) return x(n, Promise.resolve(), 2);
            e.m != dr && e.dispatchEvent(t), q(n);
          });
        }
        function d0(e) {
          var t = /* @__PURE__ */ new Set();
          e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) n = n.value, n.language ? t.add(He(n.language)) : t.add("und");
          return t;
        }
        function f0(e) {
          for (var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0; r < e.length; r++) {
            var i = e[r], o = "und", s = [];
            i.language && (o = He(i.language)), i.type == "variant" ? s = i.audioRoles : s = i.roles, s && s.length || (s = [""]), t.has(o) || t.set(o, /* @__PURE__ */ new Set()), s = m(s);
            for (var u = s.next(); !u.done; u = s.next()) u = u.value, t.get(o).add(u), i.label && (n.has(o) || n.set(o, /* @__PURE__ */ new Map()), n.get(o).set(u, i.label));
          }
          var a = [];
          return t.forEach(function(l, c) {
            l = m(l);
            for (var d = l.next(); !d.done; d = l.next()) {
              d = d.value;
              var h = null;
              n.has(c) && n.get(c).has(d) && (h = n.get(c).get(d)), a.push({
                language: c,
                role: d,
                label: h
              });
            }
          }), a;
        }
        f.xa = function() {
          return this.h && this.h.remote ? this.h.remote.state != "disconnected" : !1;
        }, f.fe = function() {
          return !this.h || this.h.ended ? !0 : this.Ua && !this.U() && this.h.currentTime >= this.Ra().end;
        }, Y("shaka.Player", V), V.prototype.isEnded = V.prototype.fe, V.prototype.isRemotePlayback = V.prototype.xa, V.prototype.addFont = V.prototype.addFont, V.prototype.setVideoContainer = V.prototype.Wi, V.prototype.getFetchedPlaybackInfo = V.prototype.Ij, V.prototype.getManifestParserFactory = V.prototype.Nj, V.prototype.getManifest = V.prototype.Hg, V.prototype.retryStreaming = V.prototype.ih, V.prototype.setMaxHardwareResolution = V.prototype.al, V.prototype.addChaptersTrack = V.prototype.Ne, V.prototype.addThumbnailsTrack = V.prototype.Oe, V.prototype.addTextTrackAsync = V.prototype.Rd, V.prototype.getStats = V.prototype.getStats, V.prototype.getBufferedInfo = V.prototype.Hc, V.prototype.getSegmentAvailabilityDuration = V.prototype.bf, V.prototype.getPresentationStartTimeAsDate = V.prototype.ii, V.prototype.getPlayheadTimeAsDate = V.prototype.Qj, V.prototype.setTextTrackVisibility = V.prototype.rh, V.prototype.getChaptersAsync = V.prototype.Dj, V.prototype.getChapters = V.prototype.Cj, V.prototype.getChaptersTracks = V.prototype.Ej, V.prototype.isTextTrackVisible = V.prototype.Pg, V.prototype.selectVariantsByLabel = V.prototype.Vk, V.prototype.selectTextLanguage = V.prototype.mh, V.prototype.selectAudioLanguage = V.prototype.Pi, V.prototype.getTextLanguages = V.prototype.Wj, V.prototype.getAudioLanguages = V.prototype.zj, V.prototype.getTextLanguagesAndRoles = V.prototype.Xj, V.prototype.getAudioLanguagesAndRoles = V.prototype.Aj, V.prototype.getVideoTracks = V.prototype.getVideoTracks, V.prototype.selectVideoTrack = V.prototype.Wk, V.prototype.getAudioTracks = V.prototype.getAudioTracks, V.prototype.selectAudioTrack = V.prototype.Uk, V.prototype.selectVariantTrack = V.prototype.Gf, V.prototype.selectTextTrack = V.prototype.nh, V.prototype.getThumbnails = V.prototype.Zj, V.prototype.getAllThumbnails = V.prototype.yj, V.prototype.getImageTracks = V.prototype.Kj, V.prototype.getTextTracks = V.prototype.Lc, V.prototype.getVariantTracks = V.prototype.sc, V.prototype.cancelTrickPlay = V.prototype.Sd, V.prototype.trickPlay = V.prototype.we, V.prototype.useTrickPlayTrackIfAvailable = V.prototype.Hh, V.prototype.getPlaybackRate = V.prototype.Ob, V.prototype.isBuffering = V.prototype.Og, V.prototype.getKeyStatuses = V.prototype.Ze, V.prototype.getActiveSessionsMetadata = V.prototype.Gg, V.prototype.getExpiration = V.prototype.Zd, V.prototype.drmInfo = V.prototype.drmInfo, V.prototype.keySystem = V.prototype.keySystem, V.prototype.isFullyLoaded = V.prototype.jk, V.prototype.goToLive = V.prototype.fk, V.prototype.seekRange = V.prototype.Ra, V.prototype.isVideoOnly = V.prototype.pi, V.prototype.isAudioOnly = V.prototype.ik, V.prototype.isInProgress = V.prototype.Uc, V.prototype.isLive = V.prototype.U, V.prototype.getQueueManager = V.prototype.ji, V.prototype.getAdManager = V.prototype.ai, V.prototype.getAssetUri = V.prototype.pd, V.prototype.getNetworkingEngine = V.prototype.Yb, V.prototype.getMediaElement = V.prototype.$e, V.prototype.getManifestType = V.prototype.di, V.prototype.getLoadMode = V.prototype.$d, V.prototype.resetConfiguration = V.prototype.Ki, V.prototype.getBufferFullness = V.prototype.bi, V.prototype.getNonDefaultConfiguration = V.prototype.gi, V.prototype.getConfigurationForLowLatency = V.prototype.Fj, V.prototype.getConfiguration = V.prototype.getConfiguration, V.prototype.configurationForLowLatency = V.prototype.vj, V.prototype.configure = V.prototype.configure, V.prototype.releaseAllMutexes = V.prototype.Mk, V.prototype.destroyAllPreloads = V.prototype.ng, V.prototype.preload = V.prototype.preload, V.prototype.detachAndSavePreload = V.prototype.Xh, V.prototype.unloadAndSavePreload = V.prototype.gj, V.prototype.load = V.prototype.load, V.prototype.updateStartTime = V.prototype.ll, V.prototype.unload = V.prototype.Dc, V.prototype.detach = V.prototype.detach, V.prototype.attachCanvas = V.prototype.nj, V.prototype.attach = V.prototype.Vb, V.probeSupport = function(e) {
          e = e === void 0 ? !0 : e;
          var t, n, r, i, o, s, u;
          return D(function(a) {
            switch (a.g) {
              case 1:
                if (t = {}, !e) {
                  a.A(2);
                  break;
                }
                return x(a, iA(), 3);
              case 3:
                t = a.h;
              case 2:
                return n = mx(), r = VA(), i = Se(), x(a, i.nc(), 4);
              case 4:
                return o = a.h, s = { manifest: n, media: r, drm: t, hardwareResolution: o }, u = p0, u.forEach(function(l, c) {
                  s[c] = l();
                }), a.return(s);
            }
          });
        }, V.isBrowserSupported = function() {
          return C.Promise || De("A Promise implementation or polyfill is required"), !(C.Promise && C.Uint8Array && Array.prototype.forEach) || (navigator.userAgent || "").includes("Trident/") ? !1 : (Se(), br() ? !0 : oo().canPlayType("application/x-mpegurl") != "");
        }, V.setQueueManagerFactory = function(e) {
          Jl = e;
        }, V.setAdManagerFactory = function(e) {
          $l = e;
        }, V.registerSupportPlugin = _y, V.prototype.destroy = V.prototype.destroy;
        var dr = 0, Yl = 1, Vt = 2, Mn = 3;
        V.LoadMode = { DESTROYED: dr, NOT_LOADED: Yl, MEDIA_SOURCE: Vt, SRC_EQUALS: Mn }, V.version = "v4.16.19";
        var h0 = ["4", "16"];
        Mg = new function(e) {
          this.g = e, this.i = ax, this.h = lx;
        }(new vd(Number(h0[0]), Number(h0[1])));
        var p0 = /* @__PURE__ */ new Map(), $l = null, Jl = null;
        function g0() {
          this.g = [], this.i = this.m = this.l = this.j = this.h = 0;
        }
        function QI(e) {
          return e.g.length ? e.g.reduce(function(t, n) {
            return t + n;
          }, 0) / e.g.length : 0;
        }
        function ue(e, t, n) {
          var r = this;
          this.g = e, this.h = t, this.m = n, this.i = !1, this.j = this.h.getVolume(), this.l = new Ve(), this.l.D(this.h, google.ima.AdEvent.Type.PAUSED, function() {
            r.i = !0;
          }), this.l.D(this.h, google.ima.AdEvent.Type.RESUMED, function() {
            r.i = !1;
          });
        }
        f = ue.prototype, f.needsSkipUI = function() {
          return !1;
        }, f.isClientRendering = function() {
          return !0;
        }, f.hasCustomClick = function() {
          return !0;
        }, f.isUsingAnotherMediaElement = function() {
          return !0;
        }, f.getDuration = function() {
          return this.g.getDuration();
        }, f.getMinSuggestedDuration = function() {
          return this.g.getMinSuggestedDuration();
        }, f.getRemainingTime = function() {
          return this.h.getRemainingTime();
        }, f.isPaused = function() {
          return this.i;
        }, f.isSkippable = function() {
          return this.g.getSkipTimeOffset() >= 0;
        }, f.getTimeUntilSkippable = function() {
          var e = this.g.getSkipTimeOffset();
          return e = this.getRemainingTime() - e, Math.max(e, 0);
        }, f.canSkipNow = function() {
          return this.h.getAdSkippableState();
        }, f.skip = function() {
          return this.h.skip();
        }, f.pause = function() {
          return this.h.pause();
        }, f.play = function() {
          return this.h.resume();
        }, f.getVolume = function() {
          return this.h.getVolume();
        }, f.setVolume = function(e) {
          return this.m.volume = e, this.h.setVolume(e);
        }, f.isMuted = function() {
          return this.h.getVolume() == 0;
        }, f.isLinear = function() {
          return this.g.isLinear();
        }, f.resize = function(e, t) {
          this.h.resize(e, t);
        }, f.setMuted = function(e) {
          (this.m.muted = e) ? (this.j = this.getVolume(), this.h.setVolume(0)) : this.h.setVolume(this.j);
        }, f.getSequenceLength = function() {
          var e = this.g.getAdPodInfo();
          return e == null ? 1 : e.getTotalAds();
        }, f.getPositionInSequence = function() {
          var e = this.g.getAdPodInfo();
          return e == null ? 1 : e.getAdPosition();
        }, f.getTitle = function() {
          return this.g.getTitle();
        }, f.getDescription = function() {
          return this.g.getDescription();
        }, f.getVastMediaBitrate = function() {
          return this.g.getVastMediaBitrate();
        }, f.getVastMediaHeight = function() {
          return this.g.getVastMediaHeight();
        }, f.getVastMediaWidth = function() {
          return this.g.getVastMediaWidth();
        }, f.getVastAdId = function() {
          return "";
        }, f.getAdId = function() {
          return this.g.getAdId();
        }, f.getCreativeAdId = function() {
          return this.g.getCreativeAdId();
        }, f.getAdvertiserName = function() {
          return this.g.getAdvertiserName();
        }, f.getMediaUrl = function() {
          return this.g.getMediaUrl();
        }, f.getTimeOffset = function() {
          var e = this.g.getAdPodInfo();
          return e == null ? 0 : e.getTimeOffset();
        }, f.getPodIndex = function() {
          var e = this.g.getAdPodInfo();
          return e == null ? 0 : e.getPodIndex();
        }, f.release = function() {
          this.h = this.g = null;
        }, Y("shaka.ads.ClientSideAd", ue), ue.prototype.release = ue.prototype.release, ue.prototype.getPodIndex = ue.prototype.getPodIndex, ue.prototype.getTimeOffset = ue.prototype.getTimeOffset, ue.prototype.getMediaUrl = ue.prototype.getMediaUrl, ue.prototype.getAdvertiserName = ue.prototype.getAdvertiserName, ue.prototype.getCreativeAdId = ue.prototype.getCreativeAdId, ue.prototype.getAdId = ue.prototype.getAdId, ue.prototype.getVastAdId = ue.prototype.getVastAdId, ue.prototype.getVastMediaWidth = ue.prototype.getVastMediaWidth, ue.prototype.getVastMediaHeight = ue.prototype.getVastMediaHeight, ue.prototype.getVastMediaBitrate = ue.prototype.getVastMediaBitrate, ue.prototype.getDescription = ue.prototype.getDescription, ue.prototype.getTitle = ue.prototype.getTitle, ue.prototype.getPositionInSequence = ue.prototype.getPositionInSequence, ue.prototype.getSequenceLength = ue.prototype.getSequenceLength, ue.prototype.setMuted = ue.prototype.setMuted, ue.prototype.resize = ue.prototype.resize, ue.prototype.isLinear = ue.prototype.isLinear, ue.prototype.isMuted = ue.prototype.isMuted, ue.prototype.setVolume = ue.prototype.setVolume, ue.prototype.getVolume = ue.prototype.getVolume, ue.prototype.play = ue.prototype.play, ue.prototype.pause = ue.prototype.pause, ue.prototype.skip = ue.prototype.skip, ue.prototype.canSkipNow = ue.prototype.canSkipNow, ue.prototype.getTimeUntilSkippable = ue.prototype.getTimeUntilSkippable, ue.prototype.isSkippable = ue.prototype.isSkippable, ue.prototype.isPaused = ue.prototype.isPaused, ue.prototype.getRemainingTime = ue.prototype.getRemainingTime, ue.prototype.getMinSuggestedDuration = ue.prototype.getMinSuggestedDuration, ue.prototype.getDuration = ue.prototype.getDuration, ue.prototype.isUsingAnotherMediaElement = ue.prototype.isUsingAnotherMediaElement, ue.prototype.hasCustomClick = ue.prototype.hasCustomClick, ue.prototype.isClientRendering = ue.prototype.isClientRendering, ue.prototype.needsSkipUI = ue.prototype.needsSkipUI;
        function lt() {
        }
        function m0(e, t) {
          var n = [];
          e = m(We(e, "Ad"));
          for (var r = e.next(); !r.done; r = e.next()) if ((r = ut(r.value, "InLine")) && (r = ut(r, "Creatives"))) {
            r = m(We(r, "Creative"));
            for (var i = r.next(); !i.done; i = r.next()) {
              i = i.value;
              var o = ut(i, "Linear");
              if (o && ZI(n, t, o), i = ut(i, "NonLinearAds")) {
                i = We(i, "NonLinear"), i = m(i);
                for (var s = i.next(); !s.done; s = i.next()) e: {
                  o = n;
                  var u = t, a = s.value, l = ut(a, "StaticResource");
                  if (l) s = l.attributes.creativeType;
                  else {
                    if (l = ut(a, "HTMLResource"), !l) break e;
                    s = "text/html";
                  }
                  if (l = tn(l)) {
                    s === "text/html" && (l = "data:text/html;charset=UTF-8," + encodeURIComponent(l));
                    var c = ge(a, "width", Ut) || ge(a, "expandedWidth", Ut), d = ge(a, "height", Ut) || ge(a, "expandedHeight", Ut);
                    if (c || d) {
                      var h = null, p = ut(a, "NonLinearClickThrough");
                      p && (p = tn(p)) && (h = p), p = null, (a = a.attributes.minSuggestedDuration) && (p = No(a)), a = 0, u != null && (a = u), o.push({ id: null, groupId: null, startTime: a, endTime: null, uri: l, mimeType: s, isSkippable: !1, skipOffset: null, skipFor: null, canJump: !1, resumeOffset: 0, playoutLimit: p, once: !0, pre: u == null, post: u == 1 / 0, timelineRange: !1, loop: !1, overlay: { viewport: {
                        x: 0,
                        y: 0
                      }, topLeft: { x: 0, y: 0 }, size: { x: c || 0, y: d || 0 } }, displayOnBackground: !1, currentVideo: null, background: null, clickThroughUrl: h });
                    }
                  }
                }
              }
            }
          }
          return n;
        }
        function ZI(e, t, n) {
          var r = 0;
          t != null && (r = t);
          var i = null;
          n.attributes.skipoffset && (i = No(n.attributes.skipoffset), isNaN(i) && (i = null));
          var o = ut(n, "MediaFiles");
          if (o) {
            var s = null;
            for ((n = ut(n, "VideoClicks")) && (n = ut(n, "ClickThrough")) && (n = tn(n)) && (s = n), o = n = We(o, "MediaFile"), n = n.filter(function(a) {
              return a.attributes.delivery == "streaming";
            }), n.length && (o = n), o = o.sort(function(a, l) {
              return (parseInt(l.attributes.height, 10) || 0) - (parseInt(a.attributes.height, 10) || 0);
            }), o = m(o), n = o.next(); !n.done; n = o.next()) if (n = n.value, !n.attributes.apiFramework) {
              var u = tn(n);
              if (u) {
                e.push({ id: null, groupId: null, startTime: r, endTime: null, uri: u, mimeType: n.attributes.type || null, isSkippable: i != null, skipOffset: i, skipFor: null, canJump: !1, resumeOffset: 0, playoutLimit: null, once: !0, pre: t == null, post: t == 1 / 0, timelineRange: !1, loop: !1, overlay: null, displayOnBackground: !1, currentVideo: null, background: null, clickThroughUrl: s });
                break;
              }
            }
          }
        }
        function e2(e) {
          var t = [];
          e = m(We(e, "vmap:AdBreak"));
          for (var n = e.next(); !n.done; n = e.next()) {
            var r = n.value, i = r.attributes.timeOffset;
            i && (n = null, i == "start" ? n = null : i == "end" ? n = 1 / 0 : n = No(i), (r = ut(r, "vmap:AdSource")) && (r = ut(r, "vmap:AdTagURI")) && (r = wt(r)) && t.push({ time: n, uri: r }));
          }
          return t;
        }
        Y("shaka.ads.Utils", lt), lt.ADS_LOADED = "ads-loaded", lt.AD_STARTED = "ad-started", lt.AD_FIRST_QUARTILE = "ad-first-quartile", lt.AD_MIDPOINT = "ad-midpoint", lt.AD_THIRD_QUARTILE = "ad-third-quartile", lt.AD_COMPLETE = "ad-complete", lt.AD_STOPPED = "ad-stopped", lt.AD_SKIPPED = "ad-skipped", lt.AD_VOLUME_CHANGED = "ad-volume-changed", lt.AD_MUTED = "ad-muted", lt.AD_PAUSED = "ad-paused", lt.AD_RESUMED = "ad-resumed", lt.AD_SKIP_STATE_CHANGED = "ad-skip-state-changed", lt.CUEPOINTS_CHANGED = "ad-cue-points-changed", lt.IMA_AD_MANAGER_LOADED = "ima-ad-manager-loaded", lt.IMA_STREAM_MANAGER_LOADED = "ima-stream-manager-loaded", lt.AD_CLICKED = "ad-clicked", lt.AD_PROGRESS = "ad-progress", lt.AD_BUFFERING = "ad-buffering", lt.AD_IMPRESSION = "ad-impression", lt.AD_DURATION_CHANGED = "ad-duration-changed", lt.AD_CLOSED = "ad-closed", lt.AD_LOADED = "ad-loaded", lt.ALL_ADS_COMPLETED = "all-ads-completed", lt.AD_LINEAR_CHANGED = "ad-linear-changed", lt.AD_METADATA = "ad-metadata", lt.AD_RECOVERABLE_ERROR = "ad-recoverable-error", lt.AD_ERROR = "ad-error", lt.AD_BREAK_READY = "ad-break-ready", lt.AD_INTERACTION = "ad-interaction", lt.AD_CONTENT_PAUSE_REQUESTED = "ad-content-pause-requested", lt.AD_CONTENT_RESUME_REQUESTED = "ad-content-resume-requested", lt.AD_CONTENT_ATTACH_REQUESTED = "ad-content-attach-requested";
        function Ql(e, t, n, r, i) {
          var o = this;
          this.u = e, this.i = t, this.G = !1, this.B = this.o = null, this.H = NaN, this.l = i, this.j = null, this.h = new Ve(), google.ima.settings.setLocale(n), google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0), this.F = new google.ima.AdDisplayContainer(this.u, this.i), this.F.initialize(), this.m = new google.ima.AdsLoader(this.F), this.m.getSettings().setPlayerType("shaka-player"), this.m.getSettings().setPlayerVersion("v4.16.19"), this.g = null, this.C = r || new google.ima.AdsRenderingSettings(), this.h.D(
            this.m,
            google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
            function(s) {
              t2(o, s);
            }
          ), this.h.D(this.m, google.ima.AdErrorEvent.Type.AD_ERROR, function(s) {
            v0(o, s);
          }), this.h.D(this.i, "ended", function() {
            o.m.contentComplete();
          }), this.h.Aa(this.i, "play", function() {
            o.G = !0;
          });
        }
        Ql.prototype.configure = function(e) {
          this.o = e;
        }, Ql.prototype.stop = function() {
          this.g && this.g.stop(), this.u && gu(this.u);
        }, Ql.prototype.release = function() {
          this.stop(), this.B && this.B.disconnect(), this.h && this.h.release(), this.g && this.g.destroy(), this.m.destroy(), this.F.destroy();
        };
        function v0(e, t) {
          t.getError(), t = (/* @__PURE__ */ new Map()).set("originalEvent", t), e.l(new ee("ad-error", t)), Zl(e, null), e.l(new ee("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", [])));
        }
        function t2(e, t) {
          if (e.l(new ee("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", Date.now() / 1e3 - e.H))), e.o.customPlayheadTracker) {
            var n = { currentTime: e.i.currentTime };
            e.g = t.getAdsManager(n, e.C), e.i.muted ? e.g.setVolume(0) : e.g.setVolume(e.i.volume), e.h.D(e.i, "timeupdate", function() {
              e.i.duration && (n.currentTime = e.i.currentTime);
            }), e.h.D(e.i, "volumechange", function() {
              e.j && (e.j.setVolume(e.i.volume), e.i.muted && e.j.setMuted(!0));
            });
          } else e.g = t.getAdsManager(e.i, e.C);
          e.l(new ee("ima-ad-manager-loaded", (/* @__PURE__ */ new Map()).set(
            "imaAdManager",
            e.g
          )));
          var r = e.g.getCuePoints();
          if (r.length) {
            t = [], r = m(r);
            for (var i = r.next(); !i.done; i = r.next()) t.push({ start: i.value, end: null });
            e.l(new ee("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", t)));
          }
          n2(e);
          try {
            e.g.init(e.i.offsetWidth, e.i.offsetHeight), e.h.D(e.i, "loadeddata", function() {
              e.g.resize(e.i.offsetWidth, e.i.offsetHeight);
            }), "ResizeObserver" in C ? (e.B = new ResizeObserver(function() {
              e.g.resize(e.i.offsetWidth, e.i.offsetHeight);
            }), e.B.observe(e.i)) : e.h.D(document, "fullscreenchange", function() {
              e.g.resize(
                e.i.offsetWidth,
                e.i.offsetHeight
              );
            }), e.G || e.o.skipPlayDetection ? e.g.start() : e.h.Aa(e.i, "play", function() {
              e.G = !0, e.g.start();
            });
          } catch {
            Zl(e, null);
          }
        }
        function n2(e) {
          function t(n, r) {
            n = (/* @__PURE__ */ new Map()).set("originalEvent", n), e.l(new ee(r, n));
          }
          e.h.D(e.g, google.ima.AdErrorEvent.Type.AD_ERROR, function(n) {
            v0(e, n);
          }), e.h.D(e.g, google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, function(n) {
            y0(e, n);
          }), e.h.D(e.g, google.ima.AdEvent.Type.STARTED, function(n) {
            y0(e, n);
          }), e.h.D(e.g, google.ima.AdEvent.Type.FIRST_QUARTILE, function(n) {
            t(n, "ad-first-quartile");
          }), e.h.D(e.g, google.ima.AdEvent.Type.MIDPOINT, function(n) {
            t(n, "ad-midpoint");
          }), e.h.D(
            e.g,
            google.ima.AdEvent.Type.THIRD_QUARTILE,
            function(n) {
              t(n, "ad-third-quartile");
            }
          ), e.h.D(e.g, google.ima.AdEvent.Type.COMPLETE, function(n) {
            t(n, "ad-complete");
          }), e.h.D(e.g, google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, function(n) {
            Zl(e, n);
          }), e.h.D(e.g, google.ima.AdEvent.Type.ALL_ADS_COMPLETED, function(n) {
            t(n, "all-ads-completed"), Zl(e, n);
          }), e.h.D(e.g, google.ima.AdEvent.Type.SKIPPED, function(n) {
            t(n, "ad-skipped");
          }), e.h.D(e.g, google.ima.AdEvent.Type.VOLUME_CHANGED, function(n) {
            t(n, "ad-volume-changed");
          }), e.h.D(
            e.g,
            google.ima.AdEvent.Type.VOLUME_MUTED,
            function(n) {
              t(n, "ad-muted");
            }
          ), e.h.D(e.g, google.ima.AdEvent.Type.PAUSED, function(n) {
            e.j && (e.j.i = !0, t(n, "ad-paused"));
          }), e.h.D(e.g, google.ima.AdEvent.Type.RESUMED, function(n) {
            e.j && (e.j.i = !1, t(n, "ad-resumed"));
          }), e.h.D(e.g, google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED, function(n) {
            e.j && t(n, "ad-skip-state-changed");
          }), e.h.D(e.g, google.ima.AdEvent.Type.CLICK, function(n) {
            t(n, "ad-clicked");
          }), e.h.D(e.g, google.ima.AdEvent.Type.AD_PROGRESS, function(n) {
            t(n, "ad-progress");
          }), e.h.D(
            e.g,
            google.ima.AdEvent.Type.AD_BUFFERING,
            function(n) {
              t(n, "ad-buffering");
            }
          ), e.h.D(e.g, google.ima.AdEvent.Type.IMPRESSION, function(n) {
            t(n, "ad-impression");
          }), e.h.D(e.g, google.ima.AdEvent.Type.DURATION_CHANGE, function(n) {
            t(n, "ad-duration-changed");
          }), e.h.D(e.g, google.ima.AdEvent.Type.USER_CLOSE, function(n) {
            t(n, "ad-closed");
          }), e.h.D(e.g, google.ima.AdEvent.Type.LOADED, function(n) {
            t(n, "ad-loaded");
          }), e.h.D(e.g, google.ima.AdEvent.Type.LINEAR_CHANGED, function(n) {
            t(n, "ad-linear-changed");
          }), e.h.D(e.g, google.ima.AdEvent.Type.AD_METADATA, function(n) {
            t(
              n,
              "ad-metadata"
            );
          }), e.h.D(e.g, google.ima.AdEvent.Type.LOG, function(n) {
            t(n, "ad-recoverable-error");
          }), e.h.D(e.g, google.ima.AdEvent.Type.AD_BREAK_READY, function(n) {
            t(n, "ad-break-ready");
          }), e.h.D(e.g, google.ima.AdEvent.Type.INTERACTION, function(n) {
            t(n, "ad-interaction");
          });
        }
        function y0(e, t) {
          var n = t.getAd();
          n ? (e.j = new ue(n, e.g, e.i), t.type != google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED || e.o.supportsMultipleMediaElements || e.l(new ee("ad-content-pause-requested")), t = (/* @__PURE__ */ new Map()).set("ad", e.j).set("sdkAdObject", n).set("originalEvent", t), e.l(new ee("ad-started", t)), e.j.isLinear() && (e.u.setAttribute("ad-active", "true"), e.o.customPlayheadTracker || e.i.pause(), e.i.muted ? (t = e.j, t.j = e.i.volume, t.h.setVolume(0)) : e.j.setVolume(e.i.volume))) : De("The IMA SDK fired a " + t.type + " event with no associated ad. Unable to play ad!");
        }
        function Zl(e, t) {
          t && t.type == google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED && !e.o.supportsMultipleMediaElements && e.l(new ee("ad-content-resume-requested")), e.l(new ee("ad-stopped", (/* @__PURE__ */ new Map()).set("originalEvent", t))), e.j && e.j.isLinear() && (e.u.removeAttribute("ad-active"), e.o.customPlayheadTracker || e.i.ended || e.i.play());
        }
        function ae(e, t, n, r, i, o) {
          this.g = e, this.h = t, this.j = (this.i = t.isSkippable) ? t.skipOffset || 0 : t.skipOffset, this.l = t.skipFor, this.B = n, this.o = r, this.m = i, this.u = o, this.C = t.overlay;
        }
        f = ae.prototype, f.needsSkipUI = function() {
          return !0;
        }, f.isClientRendering = function() {
          return !0;
        }, f.hasCustomClick = function() {
          return this.h.clickThroughUrl != null;
        }, f.isUsingAnotherMediaElement = function() {
          return this.u;
        }, f.getDuration = function() {
          var e = this.g.duration;
          return isNaN(e) ? -1 : e;
        }, f.getMinSuggestedDuration = function() {
          return this.getDuration();
        }, f.getRemainingTime = function() {
          var e = this.g.duration;
          return isNaN(e) ? -1 : e - this.g.currentTime;
        }, f.isPaused = function() {
          return this.g.paused;
        }, f.isSkippable = function() {
          return this.i && this.l != null ? this.getDuration() - this.getRemainingTime() < this.j + this.l : this.i;
        }, f.getTimeUntilSkippable = function() {
          if (this.isSkippable()) {
            var e = this.getRemainingTime() + this.j - this.getDuration();
            return Math.max(e, 0);
          }
          return Math.max(this.getRemainingTime(), 0);
        }, f.canSkipNow = function() {
          return this.i && this.getTimeUntilSkippable() == 0;
        }, f.skip = function() {
          this.canSkipNow() && this.B();
        }, f.pause = function() {
          return this.g.pause();
        }, f.play = function() {
          return this.g.play();
        }, f.getVolume = function() {
          return this.g.volume;
        }, f.setVolume = function(e) {
          this.g.volume = e;
        }, f.isMuted = function() {
          return this.g.muted;
        }, f.isLinear = function() {
          return this.C == null;
        }, f.resize = function() {
        }, f.setMuted = function(e) {
          this.g.muted = e;
        }, f.getSequenceLength = function() {
          return this.o;
        }, f.getPositionInSequence = function() {
          return this.m;
        }, f.getTitle = function() {
          return "";
        }, f.getDescription = function() {
          return "";
        }, f.getVastMediaBitrate = function() {
          return 0;
        }, f.getVastMediaHeight = function() {
          return 0;
        }, f.getVastMediaWidth = function() {
          return 0;
        }, f.getVastAdId = function() {
          return "";
        }, f.getAdId = function() {
          return this.h.id || "";
        }, f.getCreativeAdId = function() {
          return "";
        }, f.getAdvertiserName = function() {
          return "";
        }, f.getMediaUrl = function() {
          return this.h.uri;
        }, f.getTimeOffset = function() {
          return this.h.pre ? 0 : this.h.post ? -1 : this.h.startTime;
        }, f.getPodIndex = function() {
          return 0;
        }, f.release = function() {
          this.g = null;
        }, Y("shaka.ads.InterstitialAd", ae), ae.prototype.release = ae.prototype.release, ae.prototype.getPodIndex = ae.prototype.getPodIndex, ae.prototype.getTimeOffset = ae.prototype.getTimeOffset, ae.prototype.getMediaUrl = ae.prototype.getMediaUrl, ae.prototype.getAdvertiserName = ae.prototype.getAdvertiserName, ae.prototype.getCreativeAdId = ae.prototype.getCreativeAdId, ae.prototype.getAdId = ae.prototype.getAdId, ae.prototype.getVastAdId = ae.prototype.getVastAdId, ae.prototype.getVastMediaWidth = ae.prototype.getVastMediaWidth, ae.prototype.getVastMediaHeight = ae.prototype.getVastMediaHeight, ae.prototype.getVastMediaBitrate = ae.prototype.getVastMediaBitrate, ae.prototype.getDescription = ae.prototype.getDescription, ae.prototype.getTitle = ae.prototype.getTitle, ae.prototype.getPositionInSequence = ae.prototype.getPositionInSequence, ae.prototype.getSequenceLength = ae.prototype.getSequenceLength, ae.prototype.setMuted = ae.prototype.setMuted, ae.prototype.resize = ae.prototype.resize, ae.prototype.isLinear = ae.prototype.isLinear, ae.prototype.isMuted = ae.prototype.isMuted, ae.prototype.setVolume = ae.prototype.setVolume, ae.prototype.getVolume = ae.prototype.getVolume, ae.prototype.play = ae.prototype.play, ae.prototype.pause = ae.prototype.pause, ae.prototype.skip = ae.prototype.skip, ae.prototype.canSkipNow = ae.prototype.canSkipNow, ae.prototype.getTimeUntilSkippable = ae.prototype.getTimeUntilSkippable, ae.prototype.isSkippable = ae.prototype.isSkippable, ae.prototype.isPaused = ae.prototype.isPaused, ae.prototype.getRemainingTime = ae.prototype.getRemainingTime, ae.prototype.getMinSuggestedDuration = ae.prototype.getMinSuggestedDuration, ae.prototype.getDuration = ae.prototype.getDuration, ae.prototype.isUsingAnotherMediaElement = ae.prototype.isUsingAnotherMediaElement, ae.prototype.hasCustomClick = ae.prototype.hasCustomClick, ae.prototype.isClientRendering = ae.prototype.isClientRendering, ae.prototype.needsSkipUI = ae.prototype.needsSkipUI;
        function le(e, t, n) {
          this.g = e, this.j = t, this.h = n, this.i = e.overlay == null;
        }
        f = le.prototype, f.needsSkipUI = function() {
          return !0;
        }, f.isClientRendering = function() {
          return !0;
        }, f.hasCustomClick = function() {
          return this.g.clickThroughUrl != null;
        }, f.isUsingAnotherMediaElement = function() {
          return !1;
        }, f.getDuration = function() {
          return -1;
        }, f.getMinSuggestedDuration = function() {
          return this.getDuration();
        }, f.getRemainingTime = function() {
          return -1;
        }, f.isPaused = function() {
          return !1;
        }, f.isSkippable = function() {
          return !1;
        }, f.getTimeUntilSkippable = function() {
          return 0;
        }, f.canSkipNow = function() {
          return !1;
        }, f.skip = function() {
        }, f.pause = function() {
        }, f.play = function() {
        }, f.getVolume = function() {
          return 1;
        }, f.setVolume = function() {
        }, f.isMuted = function() {
          return !1;
        }, f.isLinear = function() {
          return this.i;
        }, f.resize = function() {
        }, f.setMuted = function() {
        }, f.getSequenceLength = function() {
          return this.j;
        }, f.getPositionInSequence = function() {
          return this.h;
        }, f.getTitle = function() {
          return "";
        }, f.getDescription = function() {
          return "";
        }, f.getVastMediaBitrate = function() {
          return 0;
        }, f.getVastMediaHeight = function() {
          return 0;
        }, f.getVastMediaWidth = function() {
          return 0;
        }, f.getVastAdId = function() {
          return "";
        }, f.getAdId = function() {
          return this.g.id || "";
        }, f.getCreativeAdId = function() {
          return "";
        }, f.getAdvertiserName = function() {
          return "";
        }, f.getMediaUrl = function() {
          return this.g.uri;
        }, f.getTimeOffset = function() {
          return this.g.pre ? 0 : this.g.post ? -1 : this.g.startTime;
        }, f.getPodIndex = function() {
          return 0;
        }, f.release = function() {
        }, Y("shaka.ads.InterstitialStaticAd", le), le.prototype.release = le.prototype.release, le.prototype.getPodIndex = le.prototype.getPodIndex, le.prototype.getTimeOffset = le.prototype.getTimeOffset, le.prototype.getMediaUrl = le.prototype.getMediaUrl, le.prototype.getAdvertiserName = le.prototype.getAdvertiserName, le.prototype.getCreativeAdId = le.prototype.getCreativeAdId, le.prototype.getAdId = le.prototype.getAdId, le.prototype.getVastAdId = le.prototype.getVastAdId, le.prototype.getVastMediaWidth = le.prototype.getVastMediaWidth, le.prototype.getVastMediaHeight = le.prototype.getVastMediaHeight, le.prototype.getVastMediaBitrate = le.prototype.getVastMediaBitrate, le.prototype.getDescription = le.prototype.getDescription, le.prototype.getTitle = le.prototype.getTitle, le.prototype.getPositionInSequence = le.prototype.getPositionInSequence, le.prototype.getSequenceLength = le.prototype.getSequenceLength, le.prototype.setMuted = le.prototype.setMuted, le.prototype.resize = le.prototype.resize, le.prototype.isLinear = le.prototype.isLinear, le.prototype.isMuted = le.prototype.isMuted, le.prototype.setVolume = le.prototype.setVolume, le.prototype.getVolume = le.prototype.getVolume, le.prototype.play = le.prototype.play, le.prototype.pause = le.prototype.pause, le.prototype.skip = le.prototype.skip, le.prototype.canSkipNow = le.prototype.canSkipNow, le.prototype.getTimeUntilSkippable = le.prototype.getTimeUntilSkippable, le.prototype.isSkippable = le.prototype.isSkippable, le.prototype.isPaused = le.prototype.isPaused, le.prototype.getRemainingTime = le.prototype.getRemainingTime, le.prototype.getMinSuggestedDuration = le.prototype.getMinSuggestedDuration, le.prototype.getDuration = le.prototype.getDuration, le.prototype.isUsingAnotherMediaElement = le.prototype.isUsingAnotherMediaElement, le.prototype.hasCustomClick = le.prototype.hasCustomClick, le.prototype.isClientRendering = le.prototype.isClientRendering, le.prototype.needsSkipUI = le.prototype.needsSkipUI;
        function w0(e, t, n, r) {
          function i(s) {
            return s ? s.overlay ? !0 : o.g.ended ? s.post : !o.g.paused : !1;
          }
          var o = this;
          this.M = null, this.m = e, this.C = t, this.g = n, this.G = null, this.u = !0, this.h = this.g, this.va = r, this.ma = /* @__PURE__ */ new Set(), this.T = /* @__PURE__ */ new Set(), this.H = /* @__PURE__ */ new Set(), this.F = /* @__PURE__ */ new Map(), this.K = /* @__PURE__ */ new Map(), this.i = new V(), wh(this), this.I = new Ve(), this.j = new Ve(), this.J = !1, this.$ = this.o = this.B = this.l = null, this.ba = !1, this.O = -1, this.X = function() {
            if (!o.J && o.l && !o.C.xa()) {
              o.l = o.g.currentTime;
              var s = cs(o);
              s && i(s) && ec(o, s, 1, 1, Date.now());
            }
          }, this.W = function() {
            if (!(o.J || o.l || o.C.xa())) {
              o.g.paused || (o.l = o.g.currentTime);
              var s = cs(o, !0);
              s || (s = cs(o)), s && i(s) && ec(o, s, 1, 1, Date.now());
            }
          }, this.oa = function() {
            if (!o.J && o.l && !o.C.xa()) {
              var s = o.g.currentTime;
              o.B && !o.B.pre && !o.B.post && s < (o.B.endTime || o.B.startTime) && (o.B = null);
            }
          }, this.R = new Ae(this.X), this.N = new Ae(function() {
            var s, u, a, l, c, d, h, p, g, w, T;
            return D(function(E) {
              switch (E.g) {
                case 1:
                  if (!o.H.size || o.l == null) {
                    E.A(0);
                    break;
                  }
                  if (s = o.C.$d(), s == dr || s == Yl) return E.return();
                  u = !1, a = Array.from(o.H), l = o.C.Ra(), c = m(a), d = c.next();
                case 3:
                  if (d.done) {
                    E.A(5);
                    break;
                  }
                  if (h = d.value, h == o.B) {
                    E.A(4);
                    break;
                  }
                  if (p = h.endTime || h.startTime, !(l.start - p >= 1)) {
                    g = h.startTime - o.l, g > 0 && g <= 10 && (!o.F.has(h) && S0(h) && o.F.set(h, o.i.preload(h.uri, null, h.mimeType || void 0)), A0(o, h)), E.A(4);
                    break;
                  }
                  if (!o.F.has(h)) {
                    E.A(7);
                    break;
                  }
                  return x(E, o.F.get(h), 8);
                case 8:
                  (w = E.h) && w.destroy(), o.F.delete(h);
                case 7:
                  E0(o, h), T = h.id || JSON.stringify(h), o.T.has(T) && o.T.delete(T), o.H.delete(h), mh(o), h.overlay || (u = !0);
                case 4:
                  d = c.next(), E.A(3);
                  break;
                case 5:
                  u && tc(o), q(E);
              }
            });
          }), this.configure(this.C.getConfiguration().ads);
        }
        f = w0.prototype, f.configure = function(e) {
          this.M = e, this.J || vh(this);
        };
        function r2(e) {
          if (!e.ba && e.H.size) {
            if (e.I.D(e.g, "playing", e.W), e.I.D(e.g, "timeupdate", e.W), e.I.D(e.g, "seeked", e.oa), e.I.D(e.g, "ended", e.X), "requestVideoFrameCallback" in e.g && !x0()) {
              var t = e.g, n = function() {
                e.O != -1 && (e.X(), e.O != -1 && (e.O = t.requestVideoFrameCallback(n)));
              };
              e.O = t.requestVideoFrameCallback(n);
            } else e.R.Ea(0.025);
            e.N && e.N.Ea(1), e.ba = !0;
          }
        }
        function mh(e) {
          e.ba && !e.H.size && (e.I.Ma(e.g, "playing", e.W), e.I.Ma(e.g, "timeupdate", e.W), e.I.Ma(e.g, "seeked", e.oa), e.I.Ma(e.g, "ended", e.X), e.O != -1 && (e.g.cancelVideoFrameCallback(e.O), e.O = -1), e.R && e.R.stop(), e.N && e.N.stop(), e.ba = !1);
        }
        function vh(e) {
          if (e.m && e.M) {
            var t = e.M.supportsMultipleMediaElements, n = e.g;
            (n.controls || n.webkitPresentationMode && n.webkitPresentationMode !== "inline" || n.webkitDisplayingFullscreen) && (t = !1), e.u == t && (e.u = !t, e.u ? (e.h = e.g, e.G && (e.G.parentElement && e.m.removeChild(e.G), e.G = null)) : (e.G || (t = document.createElement(e.g.tagName), t.autoplay = !0, t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.width = "100%", t.style.height = "100%", t.style.display = "none", t.setAttribute("playsinline", ""), e.G = t), e.h = e.G));
          } else e.u = !0;
        }
        f.stop = function() {
          if (this.j && this.j.Qa(), this.ma.clear(), this.T.clear(), this.H.clear(), this.i.ng(), this.F.size) {
            var e = Array.from(this.F.values());
            e = m(e);
            for (var t = e.next(); !t.done; t = e.next()) (t = t.value) && t.then(function(n) {
              n && n.destroy();
            });
          }
          if (this.F.clear(), this.K.size) for (e = Array.from(this.K.keys()), e = m(e), t = e.next(); !t.done; t = e.next()) E0(this, t.value);
          this.K.clear(), this.i.detach(), this.J = !1, this.B = this.l = null, this.u = !0, this.h = this.g, this.G = null, yh(this), mh(this), this.m && gu(this.m), this.o && (this.o.stop(), this.o = null);
        }, f.release = function() {
          this.stop(), this.I && this.I.release(), this.j && this.j.release(), this.R && (this.R.stop(), this.R = null), this.N && (this.N.stop(), this.N = null), this.i.destroy();
        }, f.sd = function() {
          return this.i;
        };
        function i2(e, t) {
          var n, r, i;
          D(function(o) {
            if (o.g == 1) {
              if (n = null, (r = t.values.find(function(s) {
                return s.key == "ID";
              })) && (n = r.data), n) {
                if (e.ma.has(n)) return o.return();
                e.ma.add(n);
              }
              return wh(e), i = [], t && t.values.find(function(s) {
                return s.key == "X-OVERLAY-ID";
              }) ? (i = l2(t), o.A(2)) : x(o, a2(e, t), 3);
            }
            o.g != 2 && (i = o.h), i.length ? Ou(e, i) : De("Unsupported HLS interstitial", t), q(o);
          });
        }
        function o2(e, t) {
          var n = ut(t.eventNode, "OverlayEvent"), r = n.attributes.uri, i = n.attributes.mimeType, o = n.attributes.loop == "true", s = ge(n, "z", Ut);
          if (r && s != 0) {
            var u = null, a = ut(n, "Background");
            if (a) {
              var l = a.attributes.uri;
              l ? u = "center / contain no-repeat url('" + l + "')" : u = tn(a);
            }
            a = 1920, l = 1080;
            var c = ut(n, "Viewport");
            if (c && (a = ge(c, "x", Ut), a == null || (l = ge(c, "y", Ut), l == null)))
              return;
            var d = { viewport: { x: a, y: l }, topLeft: { x: 0, y: 0 }, size: { x: a, y: l } }, h = ut(n, "Overlay");
            if (c && h) {
              var p = ut(h, "TopLeft"), g = ut(h, "Size");
              if (p && g) {
                if (h = ge(p, "x", Ut), h == null || (p = ge(p, "y", Ut), p == null)) return;
                var w = ge(g, "x", Ut);
                if (w == null || (g = ge(g, "y", Ut), g == null)) return;
                d.topLeft.x = h, d.topLeft.y = p, d.size.x = w, d.size.y = g;
              }
            }
            if (h = null, n = ut(n, "Squeeze"), c && n && (g = ut(n, "TopLeft"), n = ut(n, "Size"), g && n)) {
              if (c = ge(g, "x", Ut), c == null || (h = ge(g, "y", Ut), h == null) || (g = ge(n, "x", Ut), g == null) || (n = ge(n, "y", Ut), n == null)) return;
              h = { viewport: { x: a, y: l }, topLeft: { x: c, y: h }, size: { x: g, y: n } };
            }
            Ou(e, [{
              id: t.id,
              groupId: null,
              startTime: t.startTime,
              endTime: t.endTime,
              uri: r,
              mimeType: i,
              isSkippable: !1,
              skipOffset: null,
              skipFor: null,
              canJump: !0,
              resumeOffset: null,
              playoutLimit: null,
              once: !1,
              pre: !1,
              post: !1,
              timelineRange: !0,
              loop: o,
              overlay: d,
              displayOnBackground: s == -1,
              currentVideo: h,
              background: u,
              clickThroughUrl: null
            }]);
          }
        }
        f.addAdUrlInterstitial = function(e) {
          var t = this, n, r, i, o, s, u, a, l, c;
          return D(function(d) {
            if (d.g == 1) return n = { type: 12 }, x(d, Th(t, e, n), 2);
            if (d.g != 3) {
              if (r = d.h, i = Xs(r, "VAST,vmap:VMAP"), !i) throw new b(2, 10, 10007);
              if (o = [], i.tagName == "VAST") return o = m0(i, t.l), d.A(3);
              if (i.tagName != "vmap:VMAP") return d.A(3);
              for (s = function(h) {
                var p, g;
                return D(function(w) {
                  if (w.g == 1) return x(w, Th(t, h.uri, n), 2);
                  if (p = w.h, g = Xs(p, "VAST"), !g) throw new b(2, 10, 10007);
                  o.push.apply(o, X(m0(g, h.time))), q(w);
                });
              }, u = [], a = m(e2(i)), l = a.next(); !l.done; l = a.next()) c = l.value, u.push(s(c));
              return u.length ? x(d, Promise.all(u), 3) : d.A(3);
            }
            Ou(t, o), q(d);
          });
        };
        function Ou(e, t) {
          var n, r, i, o, s, u, a, l;
          D(function(c) {
            switch (c.g) {
              case 1:
                n = !1, r = m(t), i = r.next();
              case 2:
                if (i.done) {
                  c.A(4);
                  break;
                }
                if (o = i.value, !o.uri) {
                  De("Missing URL in interstitial", o), c.A(3);
                  break;
                }
                if (o.mimeType) {
                  c.A(5);
                  break;
                }
                return de(c, 6), s = e.i.Yb(), x(c, ts(o.uri, s, e.C.getConfiguration().streaming.retryParameters), 8);
              case 8:
                o.mimeType = c.h, ye(c, 5);
                break;
              case 6:
                he(c);
              case 5:
                if (u = o.id || JSON.stringify(o), e.T.has(u)) {
                  c.A(3);
                  break;
                }
                o.loop && !o.overlay && De("Loop is only supported in overlay interstitials", o), o.overlay || (n = !0), e.T.add(u), e.H.add(o), a = !1, o.pre && e.l == null ? a = !0 : o.startTime != 0 || o.canJump ? e.l != null && (l = o.startTime - e.l, l > 0 && l <= 10 && (a = !0)) : a = !0, a && (!e.F.has(o) && S0(o) && e.F.set(o, e.i.preload(o.uri, null, o.mimeType || void 0)), A0(e, o));
              case 3:
                i = r.next(), c.A(2);
                break;
              case 4:
                n && tc(e), r2(e), q(c);
            }
          });
        }
        function cs(e, t, n) {
          t = t === void 0 ? !1 : t, n = n === void 0 ? null : n;
          var r = 0, i = null;
          if (e.H.size && e.l != null) {
            var o = e.g.ended, s = Array.from(e.H).sort(function(d, h) {
              return h.startTime - d.startTime;
            }), u = s;
            for (u = t ? s.filter(function(d) {
              return d.pre;
            }) : o ? s.filter(function(d) {
              return d.post;
            }) : s.filter(function(d) {
              return !d.pre && !d.post;
            }), s = m(u), u = s.next(); !u.done; u = s.next()) {
              u = u.value;
              var a = !1;
              if (t) a = u.pre;
              else if (o) a = u.post;
              else if (!u.pre && !u.post) {
                var l = e.l - Math.round(u.startTime * 1e3) / 1e3, c = 1;
                e.M.allowStartInMiddleOfInterstitial && u.endTime && u.endTime != 1 / 0 && (c = u.endTime - u.startTime), (l > 0 || l == 0 && e.l == 0) && (l <= c || !u.canJump) && (a = !(n == null && e.B && !e.B.pre && !e.B.post && e.B.startTime >= u.startTime));
              }
              a && (!e.B || u.startTime >= e.B.startTime) && (r == (n || 0) ? i = u : i && !u.canJump && Math.round(u.startTime * 1e3) / 1e3 - Math.round(i.startTime * 1e3) / 1e3 > 1e-3 && (i = u, r = 0), r++);
            }
          }
          return i;
        }
        function ec(e, t, n, r, i, o) {
          o = o === void 0 ? 0 : o, e.B = t, vh(e), e.u || !e.m || e.h.parentElement || e.m.appendChild(e.h), r == 1 && n == 1 && (n = Array.from(e.H).filter(function(s) {
            return t.pre ? s.pre == t.pre : t.post ? s.post == t.post : Math.abs(s.startTime - t.startTime) < 1e-3;
          }).length), t.once && (o++, e.H.delete(t), mh(e), t.overlay || tc(e)), t.mimeType && (t.mimeType.startsWith("image/") || t.mimeType === "text/html") ? t.overlay ? s2(e, t, n, r, o) : De("Unsupported interstitial", t) : e.u && t.overlay ? De("Unsupported interstitial", t) : u2(e, t, n, r, i, o);
        }
        function s2(e, t, n, r, i) {
          function o() {
            e.o && (e.o.stop(), e.o = null), e.m.removeChild(a), yh(e, t), vt(e, "ad-stopped"), e.j.Qa();
            var h = cs(e, t.pre, r - i);
            h ? ec(e, h, n, ++r, Date.now(), i) : e.J = !1;
          }
          e.J = !0;
          var s = t.overlay, u = t.mimeType == "text/html" ? "iframe" : "img", a = document.createElement(u);
          a.style.objectFit = "contain", a.style.position = "absolute", a.style.border = "none", T0(e, t);
          var l = new le(t, n, r);
          vt(e, "ad-impression"), vt(e, "ad-started", (/* @__PURE__ */ new Map()).set("ad", l)), u == "iframe" ? a.src = t.uri : (a.src = t.uri, a.onerror = function(h) {
            vt(
              e,
              "ad-error",
              (/* @__PURE__ */ new Map()).set("originalEvent", h)
            ), o();
          }), l = s.viewport;
          var c = s.topLeft;
          s = s.size, l.x == 0 && l.y == 0 ? (a.width = t.overlay.size.x, a.height = t.overlay.size.y, a.style.bottom = "10%", a.style.left = "0", a.style.right = "0", a.style.width = "100%", t.overlay.size.y || u != "iframe" || (a.style.height = "auto")) : (a.style.height = s.y / l.y * 100 + "%", a.style.left = c.x / l.x * 100 + "%", a.style.top = c.y / l.y * 100 + "%", a.style.width = s.x / l.x * 100 + "%"), e.m.appendChild(a);
          var d = Date.now();
          e.o && e.o.stop(), e.o = new Ae(function() {
            t.playoutLimit && (Date.now() - d) / 1e3 > t.playoutLimit || t.endTime && e.g.currentTime > t.endTime ? (vt(e, "ad-complete"), o()) : e.g.currentTime < t.startTime && (vt(e, "ad-skipped"), o());
          }), t.playoutLimit && !t.endTime ? e.o.ka(t.playoutLimit) : t.endTime && e.o.Ea(0.025), e.j.D(e.g, "seeked", function() {
            var h = e.g.currentTime;
            (h < t.startTime || t.endTime && h > t.endTime) && (e.o && e.o.stop(), vt(e, "ad-skipped"), o());
          }), t.clickThroughUrl && e.j.D(a, "click", function() {
            t.clickThroughUrl && C.open(t.clickThroughUrl, "_blank");
          });
        }
        function u2(e, t, n, r, i, o) {
          var s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L;
          D(function(U) {
            switch (U.g) {
              case 1:
                if (s = Date.now(), e.J = !0, u = !1, a = function() {
                  if (!e.u && !t.overlay && t.resumeOffset == null) if (t.timelineRange && t.endTime && t.endTime != 1 / 0) e.g.currentTime != t.endTime && (e.g.currentTime = t.endTime);
                  else {
                    var j = Date.now();
                    e.g.currentTime += (j - i) / 1e3, i = j;
                  }
                }, l = function(j) {
                  var G, H;
                  return D(function(B) {
                    if (B.g == 1) {
                      if (a(), G = cs(e, t.pre, r - o), j && t.groupId) for (; G && G.groupId == t.groupId; ) r++, G = cs(e, t.pre, r - o);
                      return e.o && (!t.groupId || G && G.groupId != t.groupId) && (e.o.stop(), e.o = null), yh(e, t), G && !G.overlay ? B.A(2) : (t.post && (e.l = null, e.B = null), e.u ? x(B, e.i.detach(), 4) : x(B, e.i.Dc(), 4));
                    }
                    B.g != 2 && (e.u && (H = t.resumeOffset, H == null && (H = t.timelineRange && t.endTime && t.endTime != 1 / 0 ? t.endTime - (e.l || 0) : (Date.now() - i) / 1e3), vt(e, "ad-content-resume-requested", (/* @__PURE__ */ new Map()).set("offset", H))), vt(e, "ad-stopped"), e.j.Qa(), e.J = !1, e.u ? tc(e) : (e.h.style.display = "none", a(), e.g.ended || e.g.play())), vh(e), G && (vt(e, "ad-stopped"), e.j.Qa(), ec(
                      e,
                      G,
                      n,
                      ++r,
                      i,
                      o
                    )), q(B);
                  });
                }, c = function(j) {
                  return D(function(G) {
                    return u ? G.return() : (u = !0, vt(e, "ad-error", (/* @__PURE__ */ new Map()).set("originalEvent", j)), x(G, l(!1), 0));
                  });
                }, d = function() {
                  return D(function(j) {
                    if (j.g == 1)
                      return u ? j.return() : (u = !0, x(j, l(!1), 2));
                    vt(e, "ad-complete"), q(j);
                  });
                }, e.$ = function() {
                  return D(function(j) {
                    return u ? j.return() : (u = !0, vt(e, "ad-skipped"), x(j, l(!0), 0));
                  });
                }, h = new ae(e.h, t, e.$, n, r, !e.u), e.u || (h.setMuted(e.g.muted), h.setVolume(e.g.volume)), vt(e, "ad-started", (/* @__PURE__ */ new Map()).set("ad", h)), (p = h.canSkipNow()) && vt(e, "ad-skip-state-changed"), e.j.Aa(e.i, "error", c), e.j.D(e.h, "timeupdate", function() {
                  if (e.h.duration) {
                    var j = h.canSkipNow();
                    p != j && h.getRemainingTime() > 0 && h.getDuration() > 0 && vt(e, "ad-skip-state-changed"), p = j, !e.u && !t.overlay && t.resumeOffset == null && t.timelineRange && t.endTime && t.endTime != 1 / 0 && e.g.currentTime != t.endTime && e.C.Ra().end >= t.endTime && (e.g.currentTime = t.endTime);
                  }
                }), e.j.Aa(e.i, "firstquartile", function() {
                  a(), vt(e, "ad-first-quartile");
                }), e.j.Aa(e.i, "midpoint", function() {
                  a(), vt(e, "ad-midpoint");
                }), e.j.Aa(e.i, "thirdquartile", function() {
                  a(), vt(e, "ad-third-quartile");
                }), e.j.Aa(e.i, "complete", d), e.j.D(e.h, "play", function() {
                  vt(e, "ad-resumed");
                }), e.j.D(e.h, "pause", function() {
                  var j = e.i.getConfiguration();
                  e.h.currentTime >= j.playRangeEnd ? d() : vt(e, "ad-paused");
                }), e.j.D(e.h, "volumechange", function() {
                  e.h.muted ? vt(e, "ad-muted") : vt(e, "ad-volume-changed");
                }), t.clickThroughUrl && (g = e.m || e.h, e.j.D(g, "click", function() {
                  t.clickThroughUrl && (h.isPaused() || h.pause(), C.open(
                    t.clickThroughUrl,
                    "_blank"
                  ));
                })), !e.u || r != 1) {
                  U.A(2);
                  break;
                }
                return vt(e, "ad-content-pause-requested", (/* @__PURE__ */ new Map()).set("saveLivePosition", !0)), w = new Je(), T = function(j) {
                  return D(function(G) {
                    if (G.g == 1) return j.state != "detach" ? G.A(0) : x0() ? x(G, new Promise(function(H) {
                      return new Ae(H).ka(0.1);
                    }), 3) : G.A(3);
                    w.resolve(), e.j.Ma(e.C, "onstatechange", T), q(G);
                  });
                }, e.j.D(e.C, "onstatechange", T), x(U, w, 2);
              case 2:
                return T0(e, t), e.u || (e.h.style.display = "", t.overlay ? (e.h.loop = t.loop, E = t.overlay.viewport, A = t.overlay.topLeft, I = t.overlay.size, e.h.style.height = I.y / E.y * 100 + "%", e.h.style.left = A.x / E.x * 100 + "%", e.h.style.top = A.y / E.y * 100 + "%", e.h.style.width = I.x / E.x * 100 + "%") : (e.g.pause(), t.resumeOffset != null && t.resumeOffset != 0 && (e.g.currentTime += t.resumeOffset), e.h.loop = !1, e.h.style.height = "100%", e.h.style.left = "0", e.h.style.top = "0", e.h.style.width = "100%")), de(U, 4), wh(e), t.startTime && t.endTime && t.endTime != 1 / 0 && t.startTime != t.endTime && (P = t.endTime - t.startTime, P > 0 && e.i.configure("playRangeEnd", P)), t.playoutLimit && !e.o && (e.o = new Ae(function() {
                  e.$();
                }).ka(t.playoutLimit), e.i.configure("playRangeEnd", t.playoutLimit)), x(U, e.i.Vb(e.h), 6);
              case 6:
                return N = null, t.pre || t.post || !e.M.allowStartInMiddleOfInterstitial || e.l == null || (M = e.l - t.startTime, Math.abs(M) > 0.25 && (N = M)), e.F.has(t) ? x(U, e.F.get(t), 10) : x(U, e.i.load(t.uri, N, t.mimeType || void 0), 8);
              case 10:
                return R = U.h, e.F.delete(t), R ? x(U, e.i.load(R), 8) : x(U, e.i.load(t.uri, N, t.mimeType || void 0), 8);
              case 8:
                t.overlay && e.g.paused ? e.h.pause() : e.h.play(), k = (Date.now() - s) / 1e3, vt(e, "ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", k)), e.u && e.g.play(), t.overlay && (t.pre || t.post || e.C.U() && !(t.startTime > 0) || (O = function() {
                  var j = e.g.currentTime - t.startTime;
                  Math.abs(j - e.h.currentTime) > 0.1 && (e.h.currentTime = j);
                }, e.j.Aa(e.h, "playing", O), e.j.D(e.g, "seeking", O)), e.j.D(e.g, "seeked", function() {
                  var j = e.g.currentTime;
                  (j < t.startTime || t.endTime && j > t.endTime) && e.$();
                })), ye(U, 0);
                break;
              case 4:
                if (L = he(U), !e.J) return U.return();
                c(L), q(U);
            }
          });
        }
        function T0(e, t) {
          if (t.displayOnBackground && (e.g.style.zIndex = "1"), t.currentVideo != null) {
            var n = t.currentVideo;
            e.g.style.transformOrigin = "top left";
            var r = !0, i = [], o = n.topLeft.x / n.viewport.x * 100;
            o > 0 && o <= 100 && (i.push("translateX(" + o + "%)"), r = !1), o = n.topLeft.y / n.viewport.y * 100, o > 0 && o <= 100 && (i.push("translateY(" + o + "%)"), r = !1), o = n.size.x / n.viewport.x, o < 1 && i.push("scaleX(" + o + ")"), n = n.size.y / n.viewport.y, o < 1 && i.push("scaleY(" + n + ")"), i.length && (e.g.style.transform = i.join(" ")), r && (e.g.style.transition = "transform 250ms");
          }
          e.m && (t.clickThroughUrl ? (e.m.setAttribute("ad-active", "true"), e.m.style.pointerEvents = "") : e.m.style.pointerEvents = "none", t.background && (e.m.style.background = t.background)), e.G && (e.G.style.background = t.overlay ? "" : "rgb(0, 0, 0)");
        }
        function yh(e, t) {
          (!t || t.displayOnBackground) && (e.g.style.zIndex = ""), t && t.currentVideo == null || (e.g.style.transformOrigin = "", e.g.style.transition = "", e.g.style.transform = ""), e.m && (e.m.removeAttribute("ad-active"), e.m.style.pointerEvents = "", !t || t.background) && (e.m.style.background = ""), e.G && (e.G.style.background = "");
        }
        function a2(e, t) {
          var n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B, F, W, z, me, Q, Be, ve, ze, Ce, Ee, Le, _e;
          return D(function(be) {
            switch (be.g) {
              case 1:
                if (n = [], !t || (r = t.values.find(function(Ie) {
                  return Ie.key == "X-ASSET-URI";
                }), i = t.values.find(function(Ie) {
                  return Ie.key == "X-ASSET-LIST";
                }), !r && !i)) return be.return(n);
                if (o = null, (s = t.values.find(function(Ie) {
                  return Ie.key == "ID";
                })) && (o = s.data), u = o == null ? Math.floor(t.startTime * 10) / 10 : t.startTime, (a = t.endTime) && t.endTime != 1 / 0 && typeof t.endTime == "number" && (a = o == null ? Math.floor(t.endTime * 10) / 10 : t.endTime), l = t.values.find(function(Ie) {
                  return Ie.key == "X-RESTRICT";
                }), d = c = !0, l && l.data && (h = l.data, c = !h.includes("SKIP"), d = !h.includes("JUMP")), p = c ? 0 : null, (g = t.values.find(function(Ie) {
                  return Ie.key == "X-ENABLE-SKIP-AFTER";
                })) && (w = g.data, p = parseFloat(w), isNaN(p) && (p = c ? 0 : null)), T = null, (E = t.values.find(function(Ie) {
                  return Ie.key == "X-ENABLE-SKIP-FOR";
                })) && (A = E.data, T = parseFloat(A), isNaN(p) && (T = null)), I = null, (P = t.values.find(function(Ie) {
                  return Ie.key == "X-RESUME-OFFSET";
                })) && (N = P.data, I = parseFloat(N), isNaN(I) && (I = null)), M = null, (R = t.values.find(function(Ie) {
                  return Ie.key == "X-PLAYOUT-LIMIT";
                })) && (k = R.data, M = parseFloat(k), isNaN(M) && (M = null)), U = L = O = !1, (j = t.values.find(function(Ie) {
                  return Ie.key == "CUE";
                })) && (G = j.data, O = G.includes("ONCE"), L = G.includes("PRE"), U = G.includes("POST")), H = !1, (B = t.values.find(function(Ie) {
                  return Ie.key == "X-TIMELINE-OCCUPIES";
                })) ? (F = B.data, H = F.includes("RANGE")) : !P && e.C.U() && (H = !L && !U), r) {
                  if (W = r.data, !W) return be.return(n);
                  n.push({
                    id: o,
                    groupId: null,
                    startTime: u,
                    endTime: a,
                    uri: W,
                    mimeType: null,
                    isSkippable: c,
                    skipOffset: p,
                    skipFor: T,
                    canJump: d,
                    resumeOffset: I,
                    playoutLimit: M,
                    once: O,
                    pre: L,
                    post: U,
                    timelineRange: H,
                    loop: !1,
                    overlay: null,
                    displayOnBackground: !1,
                    currentVideo: null,
                    background: null,
                    clickThroughUrl: null
                  }), be.A(2);
                  break;
                }
                if (!i) {
                  be.A(2);
                  break;
                }
                return z = i.data, z ? (de(be, 4), me = { type: 11 }, x(be, Th(e, z, me), 6)) : be.return(n);
              case 6:
                for (Q = be.h, Be = dt(Q), ve = JSON.parse(Be), (ze = ve["SKIP-CONTROL"]) && (Ce = ze["ENABLE-SKIP-AFTER"], typeof Ce == "number" && (p = parseFloat(Ce), isNaN(Ce) && (p = c ? 0 : null)), Ee = ze["ENABLE-SKIP-FOR"], typeof Ee == "number" && (T = parseFloat(Ee), isNaN(Ee) && (T = null))), Le = 0; Le < ve.ASSETS.length; Le++) _e = ve.ASSETS[Le], _e.URI && n.push({ id: o + "_shaka_asset_" + Le, groupId: o, startTime: u, endTime: a, uri: _e.URI, mimeType: null, isSkippable: c, skipOffset: p, skipFor: T, canJump: d, resumeOffset: I, playoutLimit: M, once: O, pre: L, post: U, timelineRange: H, loop: !1, overlay: null, displayOnBackground: !1, currentVideo: null, background: null, clickThroughUrl: null });
                ye(be, 2);
                break;
              case 4:
                he(be);
              case 2:
                return be.return(n);
            }
          });
        }
        function l2(e) {
          var t = [];
          if (!e) return t;
          var n = e.values.find(function(T) {
            return T.key == "X-ASSET-URI";
          });
          if (!n || (n = n.data, !n)) return t;
          var r = null, i = e.values.find(function(T) {
            return T.key == "X-OVERLAY-ID";
          });
          i && (r = i.data), i = r == null ? Math.floor(e.startTime * 10) / 10 : e.startTime;
          var o = e.endTime;
          e.endTime && e.endTime != 1 / 0 && typeof e.endTime == "number" && (o = r == null ? Math.floor(e.endTime * 10) / 10 : e.endTime);
          var s = !1, u = !1, a = !1, l = e.values.find(function(T) {
            return T.key == "CUE";
          });
          l && (a = l.data, s = a.includes("ONCE"), u = a.includes("PRE"), a = a.includes("POST")), l = null;
          var c = e.values.find(function(T) {
            return T.key == "X-ASSET-MIMETYPE";
          });
          c && (l = c.data), c = !1;
          var d = e.values.find(function(T) {
            return T.key == "X-LOOP";
          });
          d && (c = d.data == "YES"), d = 1;
          var h = e.values.find(function(T) {
            return T.key == "X-DEPTH";
          });
          h && (d = parseFloat(h.data), isNaN(d) && (d = 1)), h = null;
          var p = e.values.find(function(T) {
            return T.key == "X-BACKGROUND";
          });
          p && (h = p.data), p = 1920;
          var g = 1080, w = e.values.find(function(T) {
            return T.key == "X-VIEWPORT";
          });
          if (w) {
            if (g = w.data.split("x"), g.length != 2) return t;
            p = parseFloat(g[0]), g = parseFloat(g[1]);
          }
          if (p = { viewport: { x: p, y: g }, topLeft: { x: 0, y: 0 }, size: { x: p, y: g } }, g = e.values.find(function(T) {
            return T.key == "X-OVERLAY-POSITION";
          })) {
            if (g = g.data.split("x"), g.length != 2) return t;
            p.topLeft.x = parseFloat(g[0]), p.topLeft.y = parseFloat(g[1]);
          }
          if (g = e.values.find(function(T) {
            return T.key == "X-OVERLAY-SIZE";
          })) {
            if (g = g.data.split("x"), g.length != 2) return t;
            p.size.x = parseFloat(g[0]), p.size.y = parseFloat(g[1]);
          }
          if (g = null, (w = e.values.find(function(T) {
            return T.key == "X-SQUEEZECURRENT";
          })) && (g = parseFloat(w.data), isNaN(g) && (g = 1), g = { viewport: { x: 1920, y: 1080 }, topLeft: { x: 0, y: 0 }, size: { x: 1920 * g, y: 1080 * g } }, e = e.values.find(function(T) {
            return T.key == "X-SQUEEZECURRENT-POSITION";
          }))) {
            if (e = e.data.split("x"), e.length != 2) return t;
            g.topLeft.x = parseFloat(e[0]), g.topLeft.y = parseFloat(e[1]);
          }
          return t.push({
            id: r,
            groupId: null,
            startTime: i,
            endTime: o,
            uri: n,
            mimeType: l,
            isSkippable: !1,
            skipOffset: null,
            skipFor: null,
            canJump: !0,
            resumeOffset: null,
            playoutLimit: null,
            once: s,
            pre: u,
            post: a,
            timelineRange: !0,
            loop: c,
            overlay: p,
            displayOnBackground: d == -1,
            currentVideo: g,
            background: h,
            clickThroughUrl: null
          }), t;
        }
        function tc(e) {
          for (var t = [], n = m(e.H), r = n.next(), i = {}; !r.done; i = { Cc: void 0 }, r = n.next()) r = r.value, r.overlay || (i.Cc = { start: r.startTime, end: null }, r.pre ? (i.Cc.start = 0, i.Cc.end = null) : r.post ? (i.Cc.start = -1, i.Cc.end = null) : r.timelineRange && (i.Cc.end = r.endTime), t.find(/* @__PURE__ */ (function(o) {
            return function(s) {
              return o.Cc.start == s.start && o.Cc.end == s.end;
            };
          })(i)) || t.push(i.Cc));
          vt(e, "ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", t));
        }
        function wh(e) {
          e.i.configure(e.C.gi()), e.i.configure("ads.disableHLSInterstitial", !0), e.i.configure("ads.disableDASHInterstitial", !0), e.i.configure("playRangeEnd", 1 / 0), Am(e.C.Yb(), e.i.Yb());
        }
        function Th(e, t, n) {
          var r, i, o;
          return D(function(s) {
            return s.g == 1 ? (r = At([t], cr()), i = e.C.Yb().request(7, r, n), x(s, i.promise, 2)) : (o = s.h, s.return(o.data));
          });
        }
        function S0(e) {
          return (e = e.mimeType) ? !e.startsWith("image/") && e !== "text/html" : !0;
        }
        function x0() {
          var e = Se().Oa();
          return e == "TV" || e == "CONSOLE" || e == "CAST";
        }
        function A0(e, t) {
          if (!(e.K.has(t) || e.M && !e.M.allowPreloadOnDomElements)) {
            var n = function(o) {
              var s = document.createElement("link");
              return s.rel = "preload", s.href = o, s.as = "image", document.head.appendChild(s), s;
            }, r = [];
            if (t.background) {
              var i = t.background.match(/url\(('|")?([^'"()]+)('|")\)?/);
              i && r.push(n(i[2]));
            }
            t.mimeType && t.mimeType.startsWith("image/") && r.push(n(t.uri)), e.K.set(t, r);
          }
        }
        function E0(e, t) {
          if (e.K.has(t)) {
            var n = e.K.get(t);
            n = m(n);
            for (var r = n.next(); !r.done; r = n.next()) r = r.value, r.parentNode.removeChild(r);
            e.K.delete(t);
          }
        }
        function vt(e, t, n) {
          e.va(new ee(t, n));
        }
        function oe(e, t, n, r, i) {
          this.h = e, this.j = No(this.h.skipOffset), this.g = i, this.i = t, this.l = n, this.o = r, this.m = !1;
        }
        f = oe.prototype, f.needsSkipUI = function() {
          return !0;
        }, f.isClientRendering = function() {
          return !1;
        }, f.hasCustomClick = function() {
          return !1;
        }, f.isUsingAnotherMediaElement = function() {
          return !1;
        }, f.getDuration = function() {
          return this.h.durationInSeconds;
        }, f.getMinSuggestedDuration = function() {
          return this.getDuration();
        }, f.getRemainingTime = function() {
          return this.h.startTimeInSeconds + this.h.durationInSeconds - this.g.currentTime;
        }, f.isPaused = function() {
          return this.g.paused;
        }, f.isSkippable = function() {
          return typeof this.j == "number";
        }, f.getTimeUntilSkippable = function() {
          if (typeof this.j != "number") return this.getRemainingTime();
          var e = this.getRemainingTime() + this.j - this.getDuration();
          return Math.max(e, 0);
        }, f.canSkipNow = function() {
          return this.getTimeUntilSkippable() == 0;
        }, f.skip = function() {
          this.m = !0, this.g.currentTime += this.getRemainingTime();
        }, f.pause = function() {
          return this.g.pause();
        }, f.play = function() {
          return this.g.play();
        }, f.getVolume = function() {
          return this.g.volume;
        }, f.setVolume = function(e) {
          this.g.volume = e;
        }, f.isMuted = function() {
          return this.g.muted;
        }, f.isLinear = function() {
          return this.o;
        }, f.resize = function() {
        }, f.setMuted = function(e) {
          this.g.muted = e;
        }, f.getSequenceLength = function() {
          return this.l ? this.l : 1;
        }, f.getPositionInSequence = function() {
          return this.i ? this.i : 1;
        }, f.getTitle = function() {
          return this.h.adTitle;
        }, f.getDescription = function() {
          return "";
        }, f.getVastMediaBitrate = function() {
          return 0;
        }, f.getVastMediaHeight = function() {
          return 0;
        }, f.getVastMediaWidth = function() {
          return 0;
        }, f.getVastAdId = function() {
          return this.h.vastAdId || "";
        }, f.getAdId = function() {
          return this.h.adId;
        }, f.getCreativeAdId = function() {
          return this.h.creativeId;
        }, f.getAdvertiserName = function() {
          return "";
        }, f.getMediaUrl = function() {
          return null;
        }, f.getTimeOffset = function() {
          return 0;
        }, f.getPodIndex = function() {
          return 0;
        }, f.release = function() {
          this.l = this.i = this.g = this.h = null;
        }, Y("shaka.ads.MediaTailorAd", oe), oe.prototype.release = oe.prototype.release, oe.prototype.getPodIndex = oe.prototype.getPodIndex, oe.prototype.getTimeOffset = oe.prototype.getTimeOffset, oe.prototype.getMediaUrl = oe.prototype.getMediaUrl, oe.prototype.getAdvertiserName = oe.prototype.getAdvertiserName, oe.prototype.getCreativeAdId = oe.prototype.getCreativeAdId, oe.prototype.getAdId = oe.prototype.getAdId, oe.prototype.getVastAdId = oe.prototype.getVastAdId, oe.prototype.getVastMediaWidth = oe.prototype.getVastMediaWidth, oe.prototype.getVastMediaHeight = oe.prototype.getVastMediaHeight, oe.prototype.getVastMediaBitrate = oe.prototype.getVastMediaBitrate, oe.prototype.getDescription = oe.prototype.getDescription, oe.prototype.getTitle = oe.prototype.getTitle, oe.prototype.getPositionInSequence = oe.prototype.getPositionInSequence, oe.prototype.getSequenceLength = oe.prototype.getSequenceLength, oe.prototype.setMuted = oe.prototype.setMuted, oe.prototype.resize = oe.prototype.resize, oe.prototype.isLinear = oe.prototype.isLinear, oe.prototype.isMuted = oe.prototype.isMuted, oe.prototype.setVolume = oe.prototype.setVolume, oe.prototype.getVolume = oe.prototype.getVolume, oe.prototype.play = oe.prototype.play, oe.prototype.pause = oe.prototype.pause, oe.prototype.skip = oe.prototype.skip, oe.prototype.canSkipNow = oe.prototype.canSkipNow, oe.prototype.getTimeUntilSkippable = oe.prototype.getTimeUntilSkippable, oe.prototype.isSkippable = oe.prototype.isSkippable, oe.prototype.isPaused = oe.prototype.isPaused, oe.prototype.getRemainingTime = oe.prototype.getRemainingTime, oe.prototype.getMinSuggestedDuration = oe.prototype.getMinSuggestedDuration, oe.prototype.getDuration = oe.prototype.getDuration, oe.prototype.isUsingAnotherMediaElement = oe.prototype.isUsingAnotherMediaElement, oe.prototype.hasCustomClick = oe.prototype.hasCustomClick, oe.prototype.isClientRendering = oe.prototype.isClientRendering, oe.prototype.needsSkipUI = oe.prototype.needsSkipUI;
        function ju(e, t, n, r) {
          this.C = e, this.K = t, this.h = n, this.l = null, this.R = NaN, this.i = r, this.J = !1, this.B = null, this.j = [], this.N = [], this.M = this.F = this.g = null, this.G = /* @__PURE__ */ new Map(), this.m = [], this.u = [], this.H = "", this.O = !0, this.I = "", this.o = new Ve();
        }
        ju.prototype.stop = function() {
          for (var e = m(this.m), t = e.next(); !t.done; t = e.next()) t = t.value, this.o.Ma(t.target, t.type, t.listener);
          ds(this), this.m = [], this.u = [], this.H = "", this.O = !0, this.I = "", this.B = null, this.j = [], this.N = [], this.G.clear();
        }, ju.prototype.release = function() {
          this.stop(), this.o && this.o.release();
        }, ju.prototype.onManifestUpdated = function(e) {
          this.J = e, this.H != "" && (d2(this, this.H, this.O), this.O = !1);
        }, ju.prototype.getCuePoints = function() {
          for (var e = [], t = m(this.j), n = t.next(); !n.done; n = t.next()) {
            n = m(n.value.ads);
            for (var r = n.next(); !r.done; r = n.next()) r = r.value, e.push({ start: r.startTimeInSeconds, end: r.startTimeInSeconds + r.durationInSeconds });
          }
          return e;
        };
        function c2(e, t, n) {
          var r, i, o, s, u, a, l, c, d, h, p, g;
          D(function(w) {
            if (w.g == 1) return r = { type: 7 }, i = At([t], cr()), i.method = "POST", n && (o = JSON.stringify(n), i.body = sr(o)), s = e.K.request(7, i, r), de(w, 2), x(w, s.promise, 4);
            if (w.g != 2) {
              if (u = w.h, a = dt(u.data), l = JSON.parse(a), l.manifestUrl && l.trackingUrl) c = new yt(t), d = new yt(l.trackingUrl), e.H = c.resolve(d).toString(), h = Date.now() / 1e3, p = h - e.R, e.i(new ee("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", p))), g = new yt(l.manifestUrl), e.l.resolve(c.resolve(g).toString()), e.l = null;
              else throw Error("Insufficient data from MediaTailor.");
              return ye(w, 0);
            }
            if (he(w), !e.I.length) return e.l.reject("MediaTailor request returned an error and there was no backup asset uri provided."), e.l = null, w.return();
            e.l.resolve(e.I), e.l = null, q(w);
          });
        }
        function d2(e, t, n) {
          var r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A;
          D(function(I) {
            if (I.g == 1) return r = { type: 8 }, i = At([t], cr()), o = e.K.request(7, i, r), de(I, 2), x(I, o.promise, 4);
            if (I.g != 2) {
              if (s = I.h, u = [], a = dt(s.data), l = JSON.parse(a), l.avails.length > 0) {
                if (JSON.stringify(e.j) != JSON.stringify(l.avails)) {
                  for (e.j = l.avails, c = m(e.j), d = c.next(); !d.done; d = c.next()) for (h = d.value, p = m(h.nonLinearAdsList), g = p.next(); !g.done; g = p.next()) for (w = g.value, T = m(w.nonLinearAdList), E = T.next(); !E.done; E = T.next()) A = E.value, f2(e, A);
                  u = e.getCuePoints(), e.i(new ee("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", u)));
                }
              } else e.j.length && e.i(new ee("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", u))), ds(e), e.j = [];
              return n && (e.J || u.length > 0) && h2(e), ye(I, 0);
            }
            he(I), q(I);
          });
        }
        function f2(e, t) {
          var n, r, i, o, s, u, a, l;
          D(function(c) {
            if (c.g == 1)
              return !t.staticResource || (n = I0(t), e.G.get(n)) ? c.return() : (r = { type: 9 }, i = At([t.staticResource], cr()), o = e.K.request(7, i, r), de(c, 2), e.G.set(n, []), x(c, o.promise, 4));
            if (c.g != 2) return s = c.h, u = dt(s.data), a = JSON.parse(u), l = a.apps, e.G.set(n, l), ye(c, 0);
            he(c), e.G.delete(n), q(c);
          });
        }
        function I0(e) {
          return [e.adId, e.adParameters, e.adSystem, e.adTitle, e.creativeAdId, e.creativeId, e.creativeSequence, e.height, e.width, e.staticResource].join("");
        }
        function h2(e) {
          C0(e), e.J || (M0(e), e.o.D(e.h, "seeked", function() {
            M0(e);
          }), e.o.D(e.h, "ended", function() {
            ds(e);
          })), e.o.D(e.h, "timeupdate", function() {
            C0(e);
          });
        }
        function M0(e) {
          var t = e.h.currentTime;
          if (t != 0 && e.B == null) {
            for (var n, r, i = m(e.j), o = i.next(); !o.done; o = i.next()) {
              o = o.value;
              for (var s = m(o.ads), u = s.next(); !u.done; u = s.next()) if (u = u.value, !r) u.startTimeInSeconds < t && (r = u, n = o);
              else if (u.startTimeInSeconds < t && u.startTimeInSeconds > r.startTimeInSeconds + r.durationInSeconds) {
                r = u, n = o;
                break;
              }
            }
            n && r && !e.N.includes(r.adId) && (e.B = t, e.h.currentTime = n.startTimeInSeconds);
          }
        }
        function C0(e) {
          if (e.h.duration && (e.g || e.j.length)) {
            var t = e.h.currentTime, n = !1;
            if (e.g) {
              n = !0;
              var r = e.F, i = r.startTimeInSeconds + 0.5 * r.durationInSeconds, o = r.startTimeInSeconds + 0.75 * r.durationInSeconds;
              t >= r.startTimeInSeconds + 0.25 * r.durationInSeconds && !e.u.includes("firstQuartile") ? (e.u.push("firstQuartile"), rn(e, "firstQuartile")) : t >= i && !e.u.includes("midpoint") ? (e.u.push("midpoint"), rn(e, "midpoint")) : t >= o && !e.u.includes("thirdQuartile") && (e.u.push("thirdQuartile"), rn(e, "thirdQuartile")), r = e.g.getRemainingTime(), i = e.g.getDuration(), e.g.canSkipNow() && r > 0 && i > 0 && rn(e, "skipStateChanged"), i > 0 && (r <= 0 || r > i) && ds(e);
            }
            if (!e.g || !e.g.isLinear()) {
              e: for (r = m(e.j), i = r.next(); !i.done && (i = i.value, !(e.g && e.g.isLinear())); i = r.next())
                for (o = 0; o < i.ads.length; o++) {
                  var s = i.ads[o], u = s.startTimeInSeconds + s.durationInSeconds;
                  if (s.startTimeInSeconds <= t && u > t) {
                    if (e.N.includes(s.adId)) {
                      if (e.h.ended) continue;
                      e.h.currentTime = u;
                      break e;
                    }
                    ds(e), e.M = i, e.g = new oe(s, o + 1, i.ads.length, !0, e.h), e.F = s, o === 0 && rn(e, "breakStart"), k0(e);
                    break;
                  }
                }
              if (!e.g) {
                for (r = m(e.j), i = r.next(); !i.done && (i = i.value, !e.g); i = r.next())
                  for (o = 0; o < i.nonLinearAdsList.length; o++) if (s = i.nonLinearAdsList[o], s.nonLinearAdList.length) {
                    u = i.startTimeInSeconds;
                    var a = e.G.get(I0(s.nonLinearAdList[0]));
                    if (u <= t && a && a.length) {
                      ds(e), u = e, a = m(a);
                      for (var l = a.next(); !l.done; l = a.next()) if (l = l.value, l.data.source.length) {
                        var c = document.createElement("img");
                        c.src = l.data.source[0].url, c.style.top = (l.placeholder.top || 0) + "%", c.style.height = 100 - (l.placeholder.top || 0) + "%", c.style.left = (l.placeholder.left || 0) + "%", c.style.maxWidth = 100 - (l.placeholder.left || 0) + "%", c.style.objectFit = "contain", c.style.position = "absolute", u.C.appendChild(c);
                      }
                      e.M = i, e.g = new oe(s, o + 1, i.ads.length, !1, e.h), e.F = s, o === 0 && rn(e, "breakStart"), k0(e);
                      break;
                    }
                  }
              }
              n && !e.g && (t = e.h.currentTime, e.B && e.B > t && (e.h.currentTime = e.B), e.B = null);
            }
          }
        }
        function ds(e) {
          if (e.g) {
            for (; e.C.lastChild; ) e.C.removeChild(e.C.firstChild);
            e.J || e.N.push(e.F.adId);
            var t = e.g.m;
            t !== void 0 && t ? rn(e, "skip") : rn(e, "complete"), t = m(e.m);
            for (var n = t.next(); !n.done; n = t.next()) n = n.value, e.o.Ma(n.target, n.type, n.listener);
            e.m = [], e.u = [], t = e.g.getPositionInSequence(), n = e.g.getSequenceLength(), t === n && rn(e, "breakEnd"), e.g = null, e.F = null, e.M = null;
          }
        }
        function k0(e) {
          var t = !1;
          e.h.paused ? t = !0 : (rn(e, "impression"), rn(e, "start")), e.m.push({ target: e.h, type: "volumechange", listener: function() {
            e.h.muted && rn(e, "mute");
          } }), e.m.push({ target: e.h, type: "volumechange", listener: function() {
            e.h.muted || rn(e, "unmute");
          } }), e.m.push({ target: e.h, type: "play", listener: function() {
            t ? (rn(e, "impression"), rn(e, "start"), t = !1) : rn(e, "resume");
          } }), e.m.push({ target: e.h, type: "pause", listener: function() {
            rn(e, "pause");
          } });
          for (var n = m(e.m), r = n.next(); !r.done; r = n.next()) r = r.value, e.o.D(
            r.target,
            r.type,
            r.listener
          );
        }
        function rn(e, t) {
          var n = e.F.trackingEvents.find(function(o) {
            return o.eventType == t;
          });
          if (n || (n = e.M.adBreakTrackingEvents.find(function(o) {
            return o.eventType == t;
          })), n) {
            var r = { type: 10 };
            n = m(n.beaconUrls);
            for (var i = n.next(); !i.done; i = n.next()) (i = i.value) && i != "" && (i = At([i], cr()), i.method = "POST", e.K.request(7, i, r));
          }
          switch (t) {
            case "impression":
              e.i(new ee("ad-impression"));
              break;
            case "start":
              e.i(new ee("ad-started", (/* @__PURE__ */ new Map()).set("ad", e.g)));
              break;
            case "mute":
              e.i(new ee("ad-muted"));
              break;
            case "unmute":
              e.i(new ee("ad-volume-changed"));
              break;
            case "resume":
              e.i(new ee("ad-resumed"));
              break;
            case "pause":
              e.i(new ee("ad-paused"));
              break;
            case "firstQuartile":
              e.i(new ee("ad-first-quartile"));
              break;
            case "midpoint":
              e.i(new ee("ad-midpoint"));
              break;
            case "thirdQuartile":
              e.i(new ee("ad-third-quartile"));
              break;
            case "complete":
              e.i(new ee("ad-complete")), e.i(new ee("ad-stopped"));
              break;
            case "skip":
              e.i(new ee("ad-skipped")), e.i(new ee("ad-stopped"));
              break;
            case "breakStart":
              e.C.setAttribute("ad-active", "true");
              break;
            case "breakEnd":
              e.C.removeAttribute("ad-active");
              break;
            case "skipStateChanged":
              e.i(new ee("ad-skip-state-changed"));
          }
        }
        function ce(e, t) {
          this.g = e, this.i = null, this.h = t;
        }
        f = ce.prototype, f.needsSkipUI = function() {
          return !0;
        }, f.isClientRendering = function() {
          return !1;
        }, f.hasCustomClick = function() {
          return !0;
        }, f.isUsingAnotherMediaElement = function() {
          return !1;
        }, f.getDuration = function() {
          return this.i ? this.i.duration : -1;
        }, f.getMinSuggestedDuration = function() {
          return this.getDuration();
        }, f.getRemainingTime = function() {
          return this.i ? this.i.duration - this.i.currentTime : -1;
        }, f.isPaused = function() {
          return this.h.paused;
        }, f.isSkippable = function() {
          return this.g.isSkippable();
        }, f.getTimeUntilSkippable = function() {
          var e = this.g.getSkipTimeOffset();
          return e = this.getRemainingTime() - e, Math.max(e, 0);
        }, f.canSkipNow = function() {
          return this.getTimeUntilSkippable() == 0;
        }, f.skip = function() {
          this.h.currentTime += this.getRemainingTime();
        }, f.pause = function() {
          return this.h.pause();
        }, f.play = function() {
          return this.h.play();
        }, f.getVolume = function() {
          return this.h.volume;
        }, f.setVolume = function(e) {
          this.h.volume = e;
        }, f.isMuted = function() {
          return this.h.muted;
        }, f.isLinear = function() {
          return !0;
        }, f.resize = function() {
        }, f.setMuted = function(e) {
          this.h.muted = e;
        }, f.getSequenceLength = function() {
          var e = this.g.getAdPodInfo();
          return e == null ? 1 : e.getTotalAds();
        }, f.getPositionInSequence = function() {
          var e = this.g.getAdPodInfo();
          return e == null ? 1 : e.getAdPosition();
        }, f.getTitle = function() {
          return this.g.getTitle();
        }, f.getDescription = function() {
          return this.g.getDescription();
        }, f.getVastMediaBitrate = function() {
          return 0;
        }, f.getVastMediaHeight = function() {
          return this.g.getVastMediaHeight();
        }, f.getVastMediaWidth = function() {
          return this.g.getVastMediaWidth();
        }, f.getVastAdId = function() {
          return "";
        }, f.getAdId = function() {
          return this.g.getAdId();
        }, f.getCreativeAdId = function() {
          return this.g.getCreativeAdId();
        }, f.getAdvertiserName = function() {
          return this.g.getAdvertiserName();
        }, f.getMediaUrl = function() {
          return null;
        }, f.getTimeOffset = function() {
          var e = this.g.getAdPodInfo();
          return e == null ? 0 : e.getTimeOffset();
        }, f.getPodIndex = function() {
          var e = this.g.getAdPodInfo();
          return e == null ? 0 : e.getPodIndex();
        }, f.release = function() {
          this.h = this.i = this.g = null;
        }, Y("shaka.ads.ServerSideAd", ce), ce.prototype.release = ce.prototype.release, ce.prototype.getPodIndex = ce.prototype.getPodIndex, ce.prototype.getTimeOffset = ce.prototype.getTimeOffset, ce.prototype.getMediaUrl = ce.prototype.getMediaUrl, ce.prototype.getAdvertiserName = ce.prototype.getAdvertiserName, ce.prototype.getCreativeAdId = ce.prototype.getCreativeAdId, ce.prototype.getAdId = ce.prototype.getAdId, ce.prototype.getVastAdId = ce.prototype.getVastAdId, ce.prototype.getVastMediaWidth = ce.prototype.getVastMediaWidth, ce.prototype.getVastMediaHeight = ce.prototype.getVastMediaHeight, ce.prototype.getVastMediaBitrate = ce.prototype.getVastMediaBitrate, ce.prototype.getDescription = ce.prototype.getDescription, ce.prototype.getTitle = ce.prototype.getTitle, ce.prototype.getPositionInSequence = ce.prototype.getPositionInSequence, ce.prototype.getSequenceLength = ce.prototype.getSequenceLength, ce.prototype.setMuted = ce.prototype.setMuted, ce.prototype.resize = ce.prototype.resize, ce.prototype.isLinear = ce.prototype.isLinear, ce.prototype.isMuted = ce.prototype.isMuted, ce.prototype.setVolume = ce.prototype.setVolume, ce.prototype.getVolume = ce.prototype.getVolume, ce.prototype.play = ce.prototype.play, ce.prototype.pause = ce.prototype.pause, ce.prototype.skip = ce.prototype.skip, ce.prototype.canSkipNow = ce.prototype.canSkipNow, ce.prototype.getTimeUntilSkippable = ce.prototype.getTimeUntilSkippable, ce.prototype.isSkippable = ce.prototype.isSkippable, ce.prototype.isPaused = ce.prototype.isPaused, ce.prototype.getRemainingTime = ce.prototype.getRemainingTime, ce.prototype.getMinSuggestedDuration = ce.prototype.getMinSuggestedDuration, ce.prototype.getDuration = ce.prototype.getDuration, ce.prototype.isUsingAnotherMediaElement = ce.prototype.isUsingAnotherMediaElement, ce.prototype.hasCustomClick = ce.prototype.hasCustomClick, ce.prototype.isClientRendering = ce.prototype.isClientRendering, ce.prototype.needsSkipUI = ce.prototype.needsSkipUI;
        function P0(e, t, n, r) {
          var i = this;
          this.u = e, this.l = t, this.j = null, this.G = NaN, this.i = r, this.H = !1, this.B = this.m = this.o = null, this.C = "", this.F = [], this.h = new Ve(), e = new google.ima.dai.api.UiSettings(), e.setLocale(n), this.g = new google.ima.dai.api.StreamManager(this.l, this.u, e), this.i(new ee("ima-stream-manager-loaded", (/* @__PURE__ */ new Map()).set("imaStreamManager", this.g))), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.LOADED, function(o) {
            p2(i, o);
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.ERROR, function() {
            i.C.length ? i.j.resolve(i.C) : i.j.reject("IMA Stream request returned an error and there was no backup asset uri provided."), i.j = null;
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED, function() {
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.STARTED, function(o) {
            o = o.getAd(), i.m = new ce(o, i.l), i.B && (i.m.i = i.B), i.i(new ee("ad-started", (/* @__PURE__ */ new Map()).set("ad", i.m))), i.u.setAttribute("ad-active", "true");
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED, function() {
            i.u.removeAttribute("ad-active");
            var o = i.l.currentTime;
            i.o && i.o > o && (i.l.currentTime = i.o, i.o = null);
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.AD_PROGRESS, function(o) {
            i.B = o.getStreamData().adProgressData, i.m && (i.m.i = i.B);
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE, function() {
            i.i(new ee("ad-first-quartile"));
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.MIDPOINT, function() {
            i.i(new ee("ad-midpoint"));
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE, function() {
            i.i(new ee("ad-third-quartile"));
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.COMPLETE, function() {
            i.i(new ee("ad-complete")), i.i(new ee("ad-stopped")), i.u.removeAttribute("ad-active"), i.m = null;
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.SKIPPED, function() {
            i.i(new ee("ad-skipped")), i.i(new ee("ad-stopped"));
          }), this.h.D(this.g, google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED, function(o) {
            var s = o.getStreamData();
            o = [], s = m(s.cuepoints);
            for (var u = s.next(); !u.done; u = s.next()) u = u.value, o.push({ start: u.start, end: u.end });
            i.F = o, i.i(new ee("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", o)));
          });
        }
        f = P0.prototype, f.configure = function() {
        }, f.stop = function() {
          this.C = "", this.o = null, this.F = [];
        }, f.release = function() {
          this.stop(), this.h && this.h.release();
        }, f.onCueMetadataChange = function(e) {
          if (e.key && e.data) {
            var t = {};
            t[e.key] = e.data, this.g.onTimedMetadata(t);
          }
        }, f.getCuePoints = function() {
          return this.F;
        };
        function p2(e, t) {
          e.i(new ee("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", Date.now() / 1e3 - e.G))), t = t.getStreamData().url, e.j.resolve(t), e.j = null, e.H || e.h.D(e.l, "seeked", function() {
            var n = e.l.currentTime;
            if (n != 0) {
              e.g.streamTimeForContentTime(n);
              var r = e.g.previousCuePointForStreamTime(n);
              r && !r.played && (e.o = n, e.l.currentTime = r.start);
            }
          });
        }
        function J() {
          Xe.call(this), this.h = this.i = this.j = this.g = null, this.m = new g0(), this.o = navigator.language, this.l = null;
        }
        tt(J, Xe), f = J.prototype, f.setLocale = function(e) {
          this.o = e;
        }, f.configure = function(e) {
          this.l = e, this.g && this.g.configure(this.l), this.j && this.j.configure(this.l), this.h && this.h.configure(this.l);
        }, f.initInterstitial = function(e, t, n) {
          var r = this;
          this.g && this.g.release(), this.g = new w0(e, t, n, function(i) {
            return nc(r, i);
          }), this.g.configure(this.l);
        }, f.initClientSide = function(e, t, n) {
          var r = this;
          if (!C.google || !google.ima || !google.ima.AdsLoader) throw new b(2, 10, 1e4);
          this.j && this.j.release(), this.j = new Ql(e, t, this.o, n, function(i) {
            return nc(r, i);
          }), this.j.configure(this.l);
        }, f.release = function() {
          this.g && (this.g.release(), this.g = null), this.j && (this.j.release(), this.j = null), this.i && (this.i.release(), this.i = null), this.h && (this.h.release(), this.h = null), Xe.prototype.release.call(this);
        }, f.onAssetUnload = function() {
          this.g && this.g.stop(), this.j && this.j.stop(), this.i && this.i.stop(), this.h && this.h.stop(), this.dispatchEvent(new ee("ad-stopped")), this.dispatchEvent(new ee("ad-content-attach-requested")), this.m = new g0();
        }, f.requestClientSideAds = function(e) {
          if (!this.j) throw new b(1, 10, 10001);
          var t = this.j;
          t.g && t.g.destroy(), t.m && t.m.contentComplete(), t.H = Date.now() / 1e3, t.m.requestAds(e);
        }, f.updateClientSideAdsRenderingSettings = function(e) {
          if (!this.j) throw new b(1, 10, 10001);
          var t = this.j;
          t.C = e, t.g && t.g.updateAdsRenderingSettings(t.C);
        }, f.initMediaTailor = function(e, t, n) {
          var r = this;
          this.i && this.i.release(), this.i = new ju(e, t, n, function(i) {
            return nc(r, i);
          });
        }, f.requestMediaTailorStream = function(e, t, n) {
          if (!this.i) throw new b(1, 10, 10005);
          var r = this.i;
          return n = n === void 0 ? "" : n, r.l ? e = Promise.reject(new b(1, 10, 10004)) : (r.l = new Je(), c2(r, e, t), r.I = n || "", r.R = Date.now() / 1e3, e = r.l), e;
        }, f.addMediaTailorTrackingUrl = function(e) {
          if (!this.i) throw new b(1, 10, 10005);
          var t = this.i;
          t.H = e, t.i(new ee("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", 0)));
        }, f.initServerSide = function(e, t) {
          var n = this;
          if (!C.google || !google.ima || !google.ima.dai) throw new b(2, 10, 10002);
          this.h && this.h.release(), this.h = new P0(e, t, this.o, function(r) {
            return nc(n, r);
          }), this.h.configure(this.l);
        }, f.requestServerSideStream = function(e, t) {
          if (t = t === void 0 ? "" : t, !this.h) throw new b(1, 10, 10003);
          e.adTagParameters || (e.adTagParameters = {});
          var n = e.adTagParameters;
          return (n.mpt || n.mpv) && De('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.'), e.adTagParameters.mpt = "shaka-player", e.adTagParameters.mpv = "v4.16.19", n = this.h, n.j ? e = Promise.reject(new b(1, 10, 10004)) : (e instanceof google.ima.dai.api.LiveStreamRequest && (n.H = !0), n.j = new Je(), n.g.requestStream(e), n.C = t || "", n.G = Date.now() / 1e3, e = n.j), e;
        }, f.replaceServerSideAdTagParameters = function(e) {
          if (!this.h) throw new b(1, 10, 10003);
          (e.mpt || e.mpv) && De('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.'), e.mpt = "Shaka Player", e.mpv = "v4.16.19", this.h.g.replaceAdTagParameters(e);
        }, f.getServerSideCuePoints = function() {
          return Ne("AdManager.getServerSideCuePoints", "Please use getCuePoints function."), this.getCuePoints();
        }, f.getCuePoints = function() {
          var e = [];
          return this.h && (e = e.concat(this.h.getCuePoints())), this.i && (e = e.concat(this.i.getCuePoints())), e;
        }, f.getStats = function() {
          var e = this.m;
          return { loadTimes: e.g, averageLoadTime: QI(e), started: e.h, overlayAds: e.j, playedCompletely: e.l, skipped: e.m, errors: e.i };
        }, f.onManifestUpdated = function(e) {
          this.i && this.i.onManifestUpdated(e);
        }, f.onDashTimedMetadata = function(e) {
          this.h && e.schemeIdUri == "urn:google:dai:2018" && this.h.g.processMetadata(e.schemeIdUri, e.eventNode ? e.eventNode.attributes.messageData : null, e.startTime);
        }, f.onHlsTimedMetadata = function(e, t) {
          this.h && this.h.g.processMetadata("ID3", e.data, t);
        }, f.onCueMetadataChange = function(e) {
          this.h && this.h.onCueMetadataChange(e);
        }, f.onHLSInterstitialMetadata = function(e, t, n) {
          this.l && this.l.disableHLSInterstitial || (this.g || this.initInterstitial(null, e, t), this.g && i2(this.g, n));
        }, f.onDASHInterstitialMetadata = function(e, t, n) {
          if (!this.l || !this.l.disableDASHInterstitial) {
            var r = n.schemeIdUri;
            if (r == "urn:mpeg:dash:event:alternativeMPD:insert:2025" || r == "urn:mpeg:dash:event:alternativeMPD:replace:2025") {
              if (this.g || this.initInterstitial(null, e, t), this.g && (e = this.g, t = n.schemeIdUri == "urn:mpeg:dash:event:alternativeMPD:replace:2025", r = n.schemeIdUri == "urn:mpeg:dash:event:alternativeMPD:insert:2025", t || r)) {
                for (var i = n.startTime, o = n.endTime, s = null, u = 0, a, l = m(n.eventNode.children), c = l.next(); !c.done; c = l.next()) if (c = c.value, c.tagName == "AlternativeMPD") {
                  if (c = c.attributes.uri) {
                    a = c;
                    break;
                  }
                } else if (c.tagName == "InsertPresentation" || c.tagName == "ReplacePresentation") {
                  var d = c.attributes.url;
                  if (d) {
                    a = en(d), (l = ge(c, "maxDuration", Ut)) && (s = l / n.timescale), (l = ge(c, "returnOffset", Ut)) && (u = l / n.timescale), t && u && (o = i + u);
                    break;
                  }
                }
                a && Ou(e, [{ id: n.id, groupId: null, startTime: i, endTime: o, uri: a, mimeType: null, isSkippable: !1, skipOffset: null, skipFor: null, canJump: !0, resumeOffset: r ? u : null, playoutLimit: s, once: !1, pre: !1, post: !1, timelineRange: t && !r, loop: !1, overlay: null, displayOnBackground: !1, currentVideo: null, background: null, clickThroughUrl: null }]);
              }
            } else (r == "urn:mpeg:dash:event:2012" || r == "urn:scte:dash:scte214-events") && n.eventNode && ut(n.eventNode, "OverlayEvent") && (this.g || this.initInterstitial(null, e, t), this.g && o2(this.g, n));
          }
        }, f.addCustomInterstitial = function(e) {
          if (!this.g) throw new b(1, 10, 10006);
          Ou(this.g, [e]);
        }, f.addAdUrlInterstitial = function(e) {
          if (!this.g) throw new b(1, 10, 10006);
          return this.g.addAdUrlInterstitial(e);
        }, f.getInterstitialPlayer = function() {
          if (!this.g) throw new b(1, 10, 10006);
          return this.g.sd();
        };
        function nc(e, t) {
          if (t && t.type) switch (t.type) {
            case "ads-loaded":
              e.m.g.push(t.loadTime);
              break;
            case "ad-started":
              e.m.h++;
              var n = t.ad;
              n && !n.isLinear() && e.m.j++;
              break;
            case "ad-complete":
              e.m.l++;
              break;
            case "ad-skipped":
              e.m.m++;
              break;
            case "ad-error":
              e.m.i++;
          }
          e.dispatchEvent(t);
        }
        Y("shaka.ads.AdManager", J), J.prototype.getInterstitialPlayer = J.prototype.getInterstitialPlayer, J.prototype.addAdUrlInterstitial = J.prototype.addAdUrlInterstitial, J.prototype.addCustomInterstitial = J.prototype.addCustomInterstitial, J.prototype.onDASHInterstitialMetadata = J.prototype.onDASHInterstitialMetadata, J.prototype.onHLSInterstitialMetadata = J.prototype.onHLSInterstitialMetadata, J.prototype.onCueMetadataChange = J.prototype.onCueMetadataChange, J.prototype.onHlsTimedMetadata = J.prototype.onHlsTimedMetadata, J.prototype.onDashTimedMetadata = J.prototype.onDashTimedMetadata, J.prototype.onManifestUpdated = J.prototype.onManifestUpdated, J.prototype.getStats = J.prototype.getStats, J.prototype.getCuePoints = J.prototype.getCuePoints, J.prototype.getServerSideCuePoints = J.prototype.getServerSideCuePoints, J.prototype.replaceServerSideAdTagParameters = J.prototype.replaceServerSideAdTagParameters, J.prototype.requestServerSideStream = J.prototype.requestServerSideStream, J.prototype.initServerSide = J.prototype.initServerSide, J.prototype.addMediaTailorTrackingUrl = J.prototype.addMediaTailorTrackingUrl, J.prototype.requestMediaTailorStream = J.prototype.requestMediaTailorStream, J.prototype.initMediaTailor = J.prototype.initMediaTailor, J.prototype.updateClientSideAdsRenderingSettings = J.prototype.updateClientSideAdsRenderingSettings, J.prototype.requestClientSideAds = J.prototype.requestClientSideAds, J.prototype.onAssetUnload = J.prototype.onAssetUnload, J.prototype.release = J.prototype.release, J.prototype.initClientSide = J.prototype.initClientSide, J.prototype.initInterstitial = J.prototype.initInterstitial, J.prototype.configure = J.prototype.configure, J.prototype.setLocale = J.prototype.setLocale, J.ADS_LOADED = "ads-loaded", J.AD_STARTED = "ad-started", J.AD_FIRST_QUARTILE = "ad-first-quartile", J.AD_MIDPOINT = "ad-midpoint", J.AD_THIRD_QUARTILE = "ad-third-quartile", J.AD_COMPLETE = "ad-complete", J.AD_STOPPED = "ad-stopped", J.AD_SKIPPED = "ad-skipped", J.AD_VOLUME_CHANGED = "ad-volume-changed", J.AD_MUTED = "ad-muted", J.AD_PAUSED = "ad-paused", J.AD_RESUMED = "ad-resumed", J.AD_SKIP_STATE_CHANGED = "ad-skip-state-changed", J.CUEPOINTS_CHANGED = "ad-cue-points-changed", J.IMA_AD_MANAGER_LOADED = "ima-ad-manager-loaded", J.IMA_STREAM_MANAGER_LOADED = "ima-stream-manager-loaded", J.AD_CLICKED = "ad-clicked", J.AD_PROGRESS = "ad-progress", J.AD_BUFFERING = "ad-buffering", J.AD_IMPRESSION = "ad-impression", J.AD_DURATION_CHANGED = "ad-duration-changed", J.AD_CLOSED = "ad-closed", J.AD_LOADED = "ad-loaded", J.ALL_ADS_COMPLETED = "all-ads-completed", J.AD_LINEAR_CHANGED = "ad-linear-changed", J.AD_METADATA = "ad-metadata", J.AD_RECOVERABLE_ERROR = "ad-recoverable-error", J.AD_ERROR = "ad-error", J.AD_BREAK_READY = "ad-break-ready", J.AD_INTERACTION = "ad-interaction", J.AD_CONTENT_PAUSE_REQUESTED = "ad-content-pause-requested", J.AD_CONTENT_RESUME_REQUESTED = "ad-content-resume-requested", J.AD_CONTENT_ATTACH_REQUESTED = "ad-content-attach-requested", $l = function() {
          return new J();
        };
        function Sh(e) {
          return JSON.stringify(e, function(t, n) {
            if (typeof n != "function") {
              if (t = n instanceof ee, n instanceof Event || t) {
                var r = {};
                for (o in n) {
                  var i = n[o];
                  i && typeof i == "object" ? o == "detail" ? r[o] = i : i instanceof Event || i instanceof ee ? r[o] = { __type__: "Event", event: Sh(i) } : t && Array.isArray(i) && (r[o] = i) : o in Event || (r[o] = i);
                }
                return r;
              }
              if (n instanceof Error) {
                var o = /* @__PURE__ */ new Set(["name", "message", "stack"]);
                for (r in n) o.add(r);
                for (t = m(Object.getOwnPropertyNames(n)), r = t.next(); !r.done; r = t.next()) o.add(r.value);
                for (t = {}, o = m(o), r = o.next(); !r.done; r = o.next()) r = r.value, t[r] = n[r];
                n = { __type__: "Error", contents: t };
              } else if (n instanceof TimeRanges) {
                for (o = { __type__: "TimeRanges", length: n.length, start: [], end: [] }, n = m($r(n)), t = n.next(); !t.done; t = n.next()) t = t.value, r = t.end, o.start.push(t.start), o.end.push(r);
                n = o;
              } else n = ArrayBuffer.isView(n) && n.BYTES_PER_ELEMENT === 1 ? { __type__: "Uint8Array", entries: Array.from(n) } : typeof n == "number" ? isNaN(n) ? "NaN" : isFinite(n) ? n : n < 0 ? "-Infinity" : "Infinity" : n;
              return n;
            }
          });
        }
        function rc(e) {
          return JSON.parse(e, function(t, n) {
            if (n == "NaN") var r = NaN;
            else if (n == "-Infinity") r = -1 / 0;
            else if (n == "Infinity") r = 1 / 0;
            else if (n && typeof n == "object" && n.__type__ == "TimeRanges") r = g2(n);
            else if (n && typeof n == "object" && n.__type__ == "Uint8Array") r = new Uint8Array(n.entries);
            else if (n && typeof n == "object" && n.__type__ == "Error") {
              t = n.contents, n = Error(t.message);
              for (r in t) n[r] = t[r];
              r = n;
            } else r = n && typeof n == "object" && n.__type__ == "Event" ? rc(n.event) : n;
            return r;
          });
        }
        function g2(e) {
          return { length: e.length, start: function(t) {
            return e.start[t];
          }, end: function(t) {
            return e.end[t];
          } };
        }
        var D0 = "ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "), m2 = "buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "), xh = ["loop", "playbackRate"], v2 = ["pause", "play"], Ah = (/* @__PURE__ */ new Map()).set("getAssetUri", 2).set("getAudioLanguages", 4).set("getAudioLanguagesAndRoles", 4).set("getBufferFullness", 1).set("getBufferedInfo", 2).set("getExpiration", 2).set("getKeyStatuses", 2).set("getPlaybackRate", 2).set(
          "getTextLanguages",
          4
        ).set("getTextLanguagesAndRoles", 4).set("isAudioOnly", 10).set("isBuffering", 1).set("isInProgress", 1).set("isLive", 10).set("isTextTrackVisible", 1).set("isVideoOnly", 10).set("keySystem", 10).set("seekRange", 1).set("getLoadMode", 10).set("getManifestType", 10).set("isFullyLoaded", 1).set("isEnded", 1).set("getBandwidthEstimate", 1).set("isRemotePlayback", 1), Eh = (/* @__PURE__ */ new Map()).set("getConfiguration", 4).set("getConfigurationForLowLatency", 4).set("getStats", 5).set("getAudioTracks", 2).set("getChaptersTracks", 2).set(
          "getImageTracks",
          2
        ).set("getVideoTracks", 2).set("getTextTracks", 2).set("getVariantTracks", 2), R0 = (/* @__PURE__ */ new Map()).set("getPlayheadTimeAsDate", 1).set("getPresentationStartTimeAsDate", 20).set("getSegmentAvailabilityDuration", 20), L0 = [["getConfiguration", "configure", "getConfigurationForLowLatency", "configurationForLowLatency"]], b0 = [["isTextTrackVisible", "setTextTrackVisibility"]], y2 = "cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable".split(" "), w2 = "addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" ");
        function Ih(e, t, n, r, i, o, s) {
          var u = this;
          this.H = e, this.K = s, this.l = new Ae(t), this.M = n, this.u = !1, this.B = r, this.G = i, this.N = o, this.i = this.m = !1, this.J = "", this.o = null, this.C = function() {
            return Mh(u);
          }, this.F = function(a, l) {
            switch (a = rc(l), a.type) {
              case "event":
                var c = a.targetName, d = xm(a.event);
                u.B(c, d);
                break;
              case "update":
                c = a.update;
                for (d in c) {
                  a = u.g[d] || {};
                  for (var h in c[d]) a[h] = c[d][h];
                }
                u.u && (u.M(), u.u = !1);
                break;
              case "asyncComplete":
                if (h = a.id, d = a.error, l = a.res, a = u.h.get(h), u.h.delete(h), a) if (d) {
                  h = new b(
                    d.severity,
                    d.category,
                    d.code
                  );
                  for (c in d) h[c] = d[c];
                  a.reject(h);
                } else a.resolve(l);
            }
          }, this.g = { video: {}, player: {} }, this.I = 0, this.h = /* @__PURE__ */ new Map(), this.j = null, _u.add(this);
        }
        f = Ih.prototype, f.destroy = function() {
          return _u.delete(this), Ch(this), fr && O0(this), this.l && (this.l.stop(), this.l = null), this.G = this.B = null, this.i = this.m = !1, this.F = this.C = this.j = this.h = this.g = this.o = null, Promise.resolve();
        }, f.wb = function() {
          return this.i;
        }, f.ah = function() {
          return this.J;
        }, f.init = function() {
          if (this.H.length) if (C.chrome && chrome.cast && chrome.cast.isAvailable) {
            this.m = !0, this.l.Cb();
            var e = new chrome.cast.SessionRequest(this.H, [], null, this.K, null);
            e = new chrome.cast.ApiConfig(e, function(t) {
              for (var n = m(_u), r = n.next(); !r.done; r = n.next()) {
                r = r.value;
                var i = t;
                r.j = new Je(), r.u = !0, ic(r, i);
              }
            }, function(t) {
              for (var n = m(_u), r = n.next(); !r.done; r = n.next()) r = r.value, oc = t == "available", r.l.Cb();
            }, "origin_scoped"), chrome.cast.initialize(e, function() {
            }, function() {
            }), oc && this.l.ka(S2), (e = fr) && e.status != chrome.cast.SessionStatus.STOPPED ? (this.j = new Je(), this.u = !0, ic(this, e)) : fr = null;
          } else C.__onGCastApiAvailable !== j0 && (sc = C.__onGCastApiAvailable || null, C.__onGCastApiAvailable = j0);
        }, f.oh = function(e) {
          this.o = e, this.i && Uu(this, { type: "appData", appData: this.o });
        }, f.cast = function() {
          var e = this;
          return D(function(t) {
            if (!e.m) throw new b(1, 8, 8e3);
            if (!oc) throw new b(1, 8, 8001);
            if (e.i) throw new b(1, 8, 8002);
            return e.j = new Je(), chrome.cast.requestSession(function(n) {
              return ic(e, n);
            }, function(n) {
              return N0(e, n);
            }), x(t, e.j, 0);
          });
        };
        function T2(e) {
          e.i && chrome.cast.requestSession(function(t) {
            return ic(e, t);
          }, function(t) {
            return N0(e, t);
          });
        }
        f.od = function() {
          if (this.i) {
            if (Ch(this), fr) {
              O0(this);
              try {
                fr.stop(function() {
                }, function() {
                });
              } catch {
              }
              fr = null;
            }
            Mh(this);
          }
        }, f.get = function(e, t) {
          var n = this;
          if (e == "video") {
            if (v2.includes(t)) return function() {
              return n.Ii.apply(n, [e, t].concat(X($e.apply(0, arguments))));
            };
          } else if (e == "player") {
            if (R0.has(t) && !this.get("player", "isLive")()) return function() {
            };
            if (y2.includes(t)) return function() {
              return n.Ii.apply(n, [e, t].concat(X($e.apply(0, arguments))));
            };
            if (w2.includes(t)) return function() {
              return n.Nk.apply(n, [e, t].concat(X($e.apply(0, arguments))));
            };
            if (Ah.has(t) || Eh.has(t)) return function() {
              return n.g[e][t];
            };
          }
          return this.g[e][t];
        }, f.set = function(e, t, n) {
          this.g[e][t] = n, Uu(this, { type: "set", targetName: e, property: t, value: n });
        };
        function ic(e, t) {
          var n = e.N();
          fr = t, t.addUpdateListener(e.C), t.addMessageListener("urn:x-cast:com.google.shaka.v2", e.F), Mh(e), Uu(e, { type: "init", initState: n, appData: e.o }), e.j.resolve();
        }
        function N0(e, t) {
          var n = 8003;
          switch (t.code) {
            case "cancel":
              n = 8004;
              break;
            case "timeout":
              n = 8005;
              break;
            case "receiver_unavailable":
              n = 8006;
          }
          e.j.reject(new b(2, 8, n, t));
        }
        f.Ii = function(e, t) {
          Uu(this, { type: "call", targetName: e, methodName: t, args: $e.apply(2, arguments) });
        }, f.Nk = function(e, t) {
          var n = $e.apply(2, arguments), r = new Je(), i = this.I.toString();
          this.I++, this.h.set(i, r);
          try {
            Uu(this, { type: "asyncCall", targetName: e, methodName: t, args: n, id: i });
          } catch (o) {
            r.reject(o);
          }
          return r;
        };
        function O0(e) {
          var t = fr;
          t.removeUpdateListener(e.C), t.removeMessageListener("urn:x-cast:com.google.shaka.v2", e.F);
        }
        function Mh(e) {
          var t = fr ? fr.status == "connected" : !1;
          if (e.i && !t) {
            e.G();
            for (var n in e.g) e.g[n] = {};
            Ch(e);
          }
          e.i = t, e.J = t ? fr.receiver.friendlyName : "", e.l.Cb();
        }
        function Ch(e) {
          if (e.h) for (var t = m(e.h.keys()), n = t.next(); !n.done; n = t.next()) {
            n = n.value;
            var r = e.h.get(n);
            e.h.delete(n), r.reject(new b(1, 7, 7e3));
          }
        }
        function Uu(e, t) {
          t = Sh(t);
          var n = fr;
          try {
            n.sendMessage("urn:x-cast:com.google.shaka.v2", t, function() {
            }, ix);
          } catch (r) {
            throw t = new b(2, 8, 8005, r), n = new ee("error", (/* @__PURE__ */ new Map()).set("detail", t)), e.B("player", n), e.od(), t;
          }
        }
        var S2 = 0.02, oc = !1, fr = null, sc = null, _u = /* @__PURE__ */ new Set();
        function j0(e) {
          if (sc ? C.__onGCastApiAvailable = sc : delete C.__onGCastApiAvailable, sc = null, e) for (var t = m(_u), n = t.next(); !n.done; n = t.next()) n.value.init();
          typeof C.__onGCastApiAvailable == "function" && C.__onGCastApiAvailable(e);
        }
        function Et(e, t, n, r) {
          r = r === void 0 ? !1 : r, Xe.call(this);
          var i = this;
          this.i = e, this.h = t, this.l = this.o = this.m = this.u = this.j = null, this.I = n, this.H = r, this.F = [], this.C = [], this.B = [], this.G = /* @__PURE__ */ new Map(), this.g = null, C.chrome && Se().Oa() != "CAST" ? (this.g = new Ih(n, function() {
            return B0(i);
          }, function() {
            return F0(i);
          }, function(o, s) {
            return H0(i, o, s);
          }, function() {
            return V0(i);
          }, function() {
            return _0(i);
          }, r), x2(this)) : (this.j = this.i, this.u = this.h);
        }
        tt(Et, Xe), f = Et.prototype, f.destroy = function(e) {
          return this.g && (e !== void 0 && e) && this.g.od(), this.l && (this.l.release(), this.l = null), e = [], this.h && (e.push(this.h.destroy()), this.h = null), this.g && (e.push(this.g.destroy()), this.g = null), this.u = this.j = this.i = null, Xe.prototype.release.call(this), Promise.all(e);
        }, f.dk = function() {
          return this.j;
        }, f.sd = function() {
          return this.u;
        }, f.pj = function() {
          return this.g ? this.g.m && oc : !1;
        }, f.wb = function() {
          return this.g ? this.g.wb() : !1;
        }, f.ah = function() {
          return this.g ? this.g.ah() : "";
        }, f.cast = function() {
          var e = this;
          return D(function(t) {
            return t.g == 1 ? e.g ? x(t, e.g.cast(), 2) : t.return() : e.h ? x(t, e.h.Dc(), 0) : t.return();
          });
        }, f.oh = function(e) {
          this.g && this.g.oh(e);
        }, f.fl = function() {
          this.g && T2(this.g);
        }, f.od = function() {
          this.g && this.g.od();
        }, f.qj = function(e, t) {
          t = t === void 0 ? !1 : t;
          var n = this;
          return D(function(r) {
            if (r.g == 1)
              return e == n.I && t == n.H || (n.I = e, n.H = t, !n.g) ? r.return() : (n.g.od(), x(r, n.g.destroy(), 2));
            n.g = null, n.g = new Ih(e, function() {
              return B0(n);
            }, function() {
              return F0(n);
            }, function(i, o) {
              return H0(n, i, o);
            }, function() {
              return V0(n);
            }, function() {
              return _0(n);
            }, t), n.g.init(), q(r);
          });
        };
        function x2(e) {
          e.g.init(), e.l = new Ve();
          for (var t = m(D0), n = t.next(); !n.done; n = t.next()) e.l.D(e.i, n.value, function(o) {
            e.g.wb() || (o = xm(o), e.m.dispatchEvent(o));
          });
          for (var r in Ya) e.l.D(e.h, Ya[r], function(o) {
            e.g.wb() || e.o.dispatchEvent(o);
          });
          e.j = {}, t = {};
          for (var i in e.i) t = { ge: t.ge }, t.ge = i, Object.defineProperty(e.j, t.ge, { configurable: !1, enumerable: !0, get: /* @__PURE__ */ (function(o) {
            return function() {
              return E2(e, o.ge);
            };
          })(t), set: /* @__PURE__ */ (function(o) {
            return function(s) {
              var u = o.ge;
              e.g.wb() ? e.g.set("video", u, s) : e.i[u] = s;
            };
          })(t) });
          e.u = {}, U0(
            e,
            function(o) {
              Object.defineProperty(e.u, o, { configurable: !1, enumerable: !0, get: function() {
                return uc(e, o);
              } });
            }
          ), A2(e), e.m = new Xe(), e.m.Ie = e.j, e.o = new Xe(), e.o.Ie = e.u, e.l.D(e.h, "unloading", function() {
            e.g && e.g.wb() || kh(e);
          });
        }
        function A2(e) {
          var t = /* @__PURE__ */ new Map();
          U0(e, function(n, r) {
            t.has(r) ? (r = t.get(r), n.length < r.length ? e.G.set(n, r) : e.G.set(r, n)) : t.set(r, n);
          });
        }
        function U0(e, t) {
          function n(a) {
            return a == "constructor" || typeof r[a] != "function" ? !1 : !i.has(a);
          }
          var r = e.h, i = /* @__PURE__ */ new Set(), o;
          for (o in r) n(o) && (i.add(o), t(o, r[o]));
          for (e = Object.getPrototypeOf(r), o = Object.getPrototypeOf({}); e && e != o; ) {
            for (var s = m(Object.getOwnPropertyNames(e)), u = s.next(); !u.done; u = s.next()) u = u.value, n(u) && (i.add(u), t(u, r[u]));
            e = Object.getPrototypeOf(e);
          }
        }
        function _0(e) {
          var t = { video: {}, player: {}, playerAfterLoad: {}, manifest: e.h.pd(), startTime: null, addThumbnailsTrackCalls: e.F, addTextTrackAsyncCalls: e.C, addChaptersTrackCalls: e.B };
          e.i.pause();
          for (var n = m(xh), r = n.next(); !r.done; r = n.next()) r = r.value, t.video[r] = e.i[r];
          for (e.i.ended || (t.startTime = e.i.currentTime), n = m(L0), r = n.next(); !r.done; r = n.next()) {
            var i = r.value;
            r = i[1], i = e.h[i[0]](), t.player[r] = i;
          }
          for (n = m(b0), r = n.next(); !r.done; r = n.next()) i = r.value, r = i[1], i = e.h[i[0]](), t.playerAfterLoad[r] = i;
          return t;
        }
        function B0(e) {
          var t = new ee("caststatuschanged");
          e.dispatchEvent(t);
        }
        function F0(e) {
          var t = new ee(e.j.paused ? "pause" : "play");
          e.m.dispatchEvent(t);
        }
        function V0(e) {
          for (var t = m(L0), n = t.next(); !n.done; n = t.next()) {
            var r = n.value;
            n = r[1], r = e.g.get("player", r[0])(), e.h[n](r);
          }
          var i = e.F, o = e.C, s = e.B;
          kh(e);
          var u = e.g.get("player", "getAssetUri")();
          r = e.g.get("video", "ended"), t = Promise.resolve();
          var a = e.i.autoplay;
          n = null, r || (n = e.g.get("video", "currentTime"));
          var l;
          (r = e.g.get("player", "getTextTracks")()) && r.length && (l = r.find(function(h) {
            return h.active;
          }));
          var c = e.g.get("player", "isTextTrackVisible")();
          u && (e.i.autoplay = !1, t = e.h.load(u, n));
          var d = {};
          for (n = m(xh), r = n.next(); !r.done; r = n.next()) r = r.value, d[r] = e.g.get("video", r);
          t.then(function() {
            if (e.i) {
              for (var h = m(i), p = h.next(); !p.done; p = h.next()) {
                p = p.value;
                var g;
                (g = e.sd()).Oe.apply(g, X(p));
              }
              for (h = m(o), g = h.next(); !g.done; g = h.next()) {
                g = g.value;
                var w;
                (w = e.sd()).Rd.apply(w, X(g));
              }
              for (w = m(s), h = w.next(); !h.done; h = w.next()) {
                h = h.value;
                var T;
                (T = e.sd()).Ne.apply(T, X(h));
              }
              for (T = m(xh), w = T.next(); !w.done; w = T.next()) w = w.value, e.i[w] = d[w];
              for (T = m(b0), w = T.next(); !w.done; w = T.next()) h = w.value, w = h[1], h = e.g.get("player", h[0])(), e.h[w](h);
              e.h.rh(c), l && e.h.mh(l.language, l.roles, l.forced), e.i.autoplay = a, u && e.i.play();
            }
          }, function(h) {
            h = (/* @__PURE__ */ new Map()).set("detail", h), h = new ee("error", h), e.h.dispatchEvent(h);
          });
        }
        function E2(e, t) {
          if (t == "addEventListener") return function(r, i, o) {
            return e.m.addEventListener(r, i, o);
          };
          if (t == "removeEventListener") return function(r, i, o) {
            return e.m.removeEventListener(r, i, o);
          };
          if (e.g.wb() && Object.keys(e.g.g.video).length == 0) {
            var n = e.i[t];
            if (typeof n != "function") return n;
          }
          return e.g.wb() ? e.g.get("video", t) : (t = e.i[t], typeof t == "function" && (t = t.bind(e.i)), t);
        }
        function uc(e, t, n) {
          if (n = n === void 0 ? !1 : n, e.G.has(t) && (t = e.G.get(t)), t == "addEventListener") return function(r, i, o) {
            return e.o.addEventListener(r, i, o);
          };
          if (t == "removeEventListener") return function(r, i, o) {
            return e.o.removeEventListener(r, i, o);
          };
          if (t == "getMediaElement") return function() {
            return e.j;
          };
          if (t == "getSharedConfiguration") return e.g.get("player", "getConfiguration");
          if (t == "getNetworkingEngine") return function() {
            return e.h.Yb();
          };
          if (t == "getDrmEngine") return function() {
            return e.h.F;
          };
          if (t == "getAdManager") return function() {
            return e.h.ai();
          };
          if (t == "getQueueManager") return function() {
            return e.h.ji();
          };
          if (t == "setVideoContainer") return function(r) {
            return e.h.Wi(r);
          };
          if (!n) {
            if (t == "addThumbnailsTrack") return function() {
              var r = $e.apply(0, arguments);
              return e.F.push(r), uc(e, t, !0).apply(null, X(r));
            };
            if (t == "addTextTrackAsync") return function() {
              var r = $e.apply(0, arguments);
              return e.C.push(r), uc(e, t, !0).apply(null, X(r));
            };
            if (t == "addChaptersTrack") return function() {
              var r = $e.apply(0, arguments);
              return e.B.push(r), uc(e, t, !0).apply(null, X(r));
            };
          }
          if (e.g.wb()) {
            if (t == "getManifest" || t == "drmInfo") return function() {
              return De(t + "() does not work while casting!"), null;
            };
            if (t == "attach" || t == "detach") return function() {
              return De(t + "() does not work while casting!"), Promise.resolve();
            };
            if (t == "getChapters") return function() {
              return De(t + "() does not work while casting!"), [];
            };
          }
          return e.g.wb() && Object.keys(e.g.g.video).length == 0 && (Ah.has(t) || Eh.has(t)) || !e.g.wb() ? e.h[t].bind(e.h) : e.g.get("player", t);
        }
        function H0(e, t, n) {
          e.g.wb() && (t == "video" ? e.m.dispatchEvent(n) : t == "player" && (n.type == "unloading" && kh(e), e.o.dispatchEvent(n)));
        }
        function kh(e) {
          e.F = [], e.C = [], e.B = [];
        }
        Y("shaka.cast.CastProxy", Et), Et.prototype.changeReceiverId = Et.prototype.qj, Et.prototype.forceDisconnect = Et.prototype.od, Et.prototype.suggestDisconnect = Et.prototype.fl, Et.prototype.setAppData = Et.prototype.oh, Et.prototype.cast = Et.prototype.cast, Et.prototype.receiverName = Et.prototype.ah, Et.prototype.isCasting = Et.prototype.wb, Et.prototype.canCast = Et.prototype.pj, Et.prototype.getPlayer = Et.prototype.sd, Et.prototype.getVideo = Et.prototype.dk, Et.prototype.destroy = Et.prototype.destroy;
        function $t(e, t, n, r) {
          Xe.call(this);
          var i = this;
          this.h = e, this.g = t, this.j = new Ve(), this.I = { video: e, player: t }, this.G = n || function() {
          }, this.J = r || function(o) {
            return o;
          }, this.i = null, this.H = !1, this.o = !0, this.m = 0, this.C = !1, this.B = !0, this.u = this.l = null, this.F = new Ae(function() {
            Ph(i);
          }), I2(this);
        }
        tt($t, Xe), f = $t.prototype, f.isConnected = function() {
          return this.H;
        }, f.kk = function() {
          return this.o;
        }, f.Zk = function(e) {
          this.i = e;
        }, f.uj = function() {
          this.i = null;
        }, f.$k = function(e) {
          this.i || (this.i = { metadataType: cast.receiver.media.MetadataType.GENERIC }), this.i.title = e;
        }, f.Yk = function(e) {
          this.i || (this.i = { metadataType: cast.receiver.media.MetadataType.GENERIC }), this.i.images = [{ url: e }];
        }, f.Xk = function(e) {
          this.i || (this.i = {}), this.i.artist = e, this.i.metadataType = cast.receiver.media.MetadataType.MUSIC_TRACK;
        }, f.destroy = function() {
          var e = this, t, n;
          return D(function(r) {
            if (r.g == 1) return e.j && (e.j.release(), e.j = null), t = [], e.g && (t.push(e.g.destroy()), e.g = null), e.F && (e.F.stop(), e.F = null), e.h = null, e.I = null, e.G = null, e.H = !1, e.o = !0, e.l = null, e.u = null, Xe.prototype.release.call(e), x(r, Promise.all(t), 2);
            n = cast.receiver.CastReceiverManager.getInstance(), n.stop(), q(r);
          });
        };
        function I2(e) {
          var t = cast.receiver.CastReceiverManager.getInstance();
          t.onSenderConnected = function() {
            return G0(e);
          }, t.onSenderDisconnected = function() {
            return G0(e);
          }, t.onSystemVolumeChanged = function() {
            var i = cast.receiver.CastReceiverManager.getInstance().getSystemVolume();
            i && ti(e, { type: "update", update: { video: { volume: i.level, muted: i.muted } } }, e.l), ti(e, { type: "event", targetName: "video", event: { type: "volumechange" } }, e.l);
          }, e.u = t.getCastMessageBus("urn:x-cast:com.google.cast.media"), e.u.onMessage = function(i) {
            return k2(
              e,
              i
            );
          }, e.l = t.getCastMessageBus("urn:x-cast:com.google.shaka.v2"), e.l.onMessage = function(i) {
            return C2(e, i);
          }, t.start(), t = m(D0);
          for (var n = t.next(); !n.done; n = t.next()) e.j.D(e.h, n.value, function(i) {
            return K0(e, "video", i);
          });
          for (var r in Ya) e.j.D(e.g, Ya[r], function(i) {
            return K0(e, "player", i);
          });
          e.j.D(e.h, "loadeddata", function() {
            e.C = !0;
          }), e.j.D(e.g, "loading", function() {
            e.o = !1, fs(e);
          }), e.j.D(e.h, "playing", function() {
            e.o = !1, fs(e);
          }), e.j.D(e.h, "pause", function() {
            fs(e);
          }), e.j.D(e.g, "unloading", function() {
            e.o = !0, fs(e);
          }), e.j.D(e.h, "ended", function() {
            new Ae(function() {
              e.h && e.h.ended && (e.o = !0, fs(e));
            }).ka(D2);
          });
        }
        function G0(e) {
          e.m = 0, e.B = !0, e.H = cast.receiver.CastReceiverManager.getInstance().getSenders().length != 0, fs(e);
        }
        function fs(e) {
          var t;
          D(function(n) {
            if (n.g == 1) return x(n, Promise.resolve(), 2);
            if (!e.g) return n.return();
            t = new ee("caststatuschanged"), e.dispatchEvent(t), W0(e) || ni(e), q(n);
          });
        }
        function M2(e, t, n) {
          var r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N;
          D(function(M) {
            switch (M.g) {
              case 1:
                for (r in t.player) i = t.player[r], e.g[r](i);
                return e.G(n), o = e.h.autoplay, t.manifest ? (e.h.autoplay = !1, de(M, 5), x(M, e.g.load(t.manifest, t.startTime), 7)) : x(M, Promise.resolve(), 3);
              case 7:
                if (t.addThumbnailsTrackCalls) for (s = m(t.addThumbnailsTrackCalls), u = s.next(); !u.done; u = s.next()) a = u.value, e.g.Oe.apply(e.g, X(a));
                if (t.addTextTrackAsyncCalls) for (l = m(t.addTextTrackAsyncCalls), c = l.next(); !c.done; c = l.next()) d = c.value, e.g.Rd.apply(e.g, X(d));
                if (t.addChaptersTrackCalls) for (h = m(t.addChaptersTrackCalls), p = h.next(); !p.done; p = h.next()) g = p.value, e.g.Ne.apply(e.g, X(g));
                ye(M, 3);
                break;
              case 5:
                return w = he(M), T = (/* @__PURE__ */ new Map()).set("detail", w), E = new ee("error", T), e.g && e.g.dispatchEvent(E), M.return();
              case 3:
                if (!e.g) return M.return();
                for (A in t.video) I = t.video[A], e.h[A] = I;
                for (P in t.playerAfterLoad) N = t.playerAfterLoad[P], e.g[P](N);
                e.h.autoplay = o, t.manifest && (e.h.play(), ni(e)), q(M);
            }
          });
        }
        function K0(e, t, n) {
          e.g && (Ph(e), ti(e, { type: "event", targetName: t, event: n }, e.l));
        }
        function Ph(e) {
          e.F.ka(P2);
          for (var t = { video: {}, player: {} }, n = m(m2), r = n.next(); !r.done; r = n.next()) r = r.value, t.video[r] = e.h[r];
          e.g.U() && R0.forEach(function(i, o) {
            e.m % i == 0 && (t.player[o] = e.g[o]());
          }), Ah.forEach(function(i, o) {
            e.m % i == 0 && (t.player[o] = e.g[o]());
          }), (n = cast.receiver.CastReceiverManager.getInstance().getSystemVolume()) && (t.video.volume = n.level, t.video.muted = n.muted), ti(e, { type: "update", update: t }, e.l), Eh.forEach(function(i, o) {
            e.m % i == 0 && (i = { player: {} }, i.player[o] = e.g[o](), ti(
              e,
              { type: "update", update: i },
              e.l
            ));
          }), e.C && (e.m += 1), W0(e);
        }
        function W0(e) {
          return e.B && (e.h.duration || e.g.U()) ? (Dh(e), e.B = !1, !0) : !1;
        }
        function Dh(e, t) {
          var n = { contentId: e.g.pd(), streamType: e.g.U() ? "LIVE" : "BUFFERED", contentType: "" };
          e.g.U() || (n.duration = e.h.duration), e.i && (n.metadata = e.i), ni(e, t === void 0 ? 0 : t, n);
        }
        function C2(e, t) {
          var n = rc(t.data);
          switch (n.type) {
            case "init":
              e.m = 0, e.C = !1, e.B = !0, M2(e, n.initState, n.appData), Ph(e);
              break;
            case "appData":
              e.G(n.appData);
              break;
            case "set":
              var r = n.targetName, i = n.property;
              if (n = n.value, r == "video") {
                if (t = cast.receiver.CastReceiverManager.getInstance(), i == "volume") {
                  t.setSystemVolumeLevel(n);
                  break;
                } else if (i == "muted") {
                  t.setSystemVolumeMuted(n);
                  break;
                }
              }
              e.I[r][i] = n;
              break;
            case "call":
              r = e.I[n.targetName], r[n.methodName].apply(r, n.args);
              break;
            case "asyncCall":
              r = n.targetName, i = n.methodName, r == "player" && i == "load" && (e.m = 0, e.C = !1);
              var o = n.id, s = t.senderId;
              t = e.I[r], n = t[i].apply(t, n.args), r == "player" && i == "load" && (n = n.then(function() {
                e.B = !0;
              })), n.then(function(u) {
                return z0(e, s, o, null, u);
              }, function(u) {
                return z0(e, s, o, u, null);
              });
          }
        }
        function k2(e, t) {
          var n = rc(t.data);
          switch (n.type) {
            case "PLAY":
              e.h.play(), ni(e);
              break;
            case "PAUSE":
              e.h.pause(), ni(e);
              break;
            case "SEEK":
              t = n.currentTime;
              var r = n.resumeState;
              t != null && (e.h.currentTime = Number(t)), r && r == "PLAYBACK_START" ? (e.h.play(), ni(e)) : r && r == "PLAYBACK_PAUSE" && (e.h.pause(), ni(e));
              break;
            case "STOP":
              e.g.Dc().then(function() {
                e.g && ni(e);
              });
              break;
            case "GET_STATUS":
              Dh(e, Number(n.requestId));
              break;
            case "VOLUME":
              r = n.volume, t = r.level, r = r.muted;
              var i = e.h.volume, o = e.h.muted;
              t != null && (e.h.volume = Number(t)), r != null && (e.h.muted = r), i == e.h.volume && o == e.h.muted || ni(e);
              break;
            case "LOAD":
              e.m = 0, e.C = !1, e.B = !1, t = n.media, r = n.currentTime, i = e.J(t.contentId), o = n.autoplay || !0, e.G(t.customData), o && (e.h.autoplay = !0), e.g.load(i, r).then(function() {
                e.g && Dh(e);
              }).catch(function(s) {
                var u = "LOAD_FAILED";
                s.category == 7 && s.code == 7e3 && (u = "LOAD_CANCELLED"), ti(e, { requestId: Number(n.requestId), type: u }, e.u);
              });
              break;
            default:
              ti(e, { requestId: Number(n.requestId), type: "INVALID_REQUEST", reason: "INVALID_COMMAND" }, e.u);
          }
        }
        function z0(e, t, n, r, i) {
          e.g && ti(e, { type: "asyncComplete", id: n, error: r, res: i }, e.l, t);
        }
        function ti(e, t, n, r) {
          e.H && (e = Sh(t), r ? n.getCastChannel(r).send(e) : n.broadcast(e));
        }
        function ni(e, t, n) {
          n = n === void 0 ? null : n;
          var r = { mediaSessionId: 0, playbackRate: e.h.playbackRate, playerState: e.o ? R2 : e.g.Og() ? b2 : e.h.paused ? N2 : L2, currentTime: e.h.currentTime, supportedMediaCommands: 63, volume: { level: e.h.volume, muted: e.h.muted } };
          n && (r.media = n), ti(e, { requestId: t === void 0 ? 0 : t, type: "MEDIA_STATUS", status: [r] }, e.u);
        }
        Y("shaka.cast.CastReceiver", $t), $t.prototype.destroy = $t.prototype.destroy, $t.prototype.setContentArtist = $t.prototype.Xk, $t.prototype.setContentImage = $t.prototype.Yk, $t.prototype.setContentTitle = $t.prototype.$k, $t.prototype.clearContentMetadata = $t.prototype.uj, $t.prototype.setContentMetadata = $t.prototype.Zk, $t.prototype.isIdle = $t.prototype.kk, $t.prototype.isConnected = $t.prototype.isConnected;
        var P2 = 0.5, D2 = 5, R2 = "IDLE", L2 = "PLAYING", b2 = "BUFFERING", N2 = "PAUSED";
        function X0(e, t, n, r, i) {
          if (r >= i) return null;
          for (var o = -1, s = -1, u = 0; u < n.length; u++) if (n[u].some(function(P) {
            return P != null && P.g.trim() != "";
          })) {
            o = u;
            break;
          }
          for (u = n.length - 1; u >= 0; u--) if (n[u].some(function(P) {
            return P != null && P.g.trim() != "";
          })) {
            s = u;
            break;
          }
          if (o === -1 || s === -1) return null;
          for (var a = u = !1, l = "white", c = "black", d = Rh(r, i, u, a, l, c); o <= s; o++) {
            for (var h = n[o], p = -1, g = -1, w = 0; w < h.length; w++) if (h[w] != null && h[w].g.trim() !== "") {
              p = w;
              break;
            }
            for (w = h.length - 1; w >= 0; w--) if (h[w] != null && h[w].g.trim() !== "") {
              g = w;
              break;
            }
            if (p === -1 || g === -1) h = q0(r, i), e.nestedCues.push(h);
            else {
              for (; p <= g; p++) if (w = h[p]) {
                var T = w.l, E = w.i, A = w.j, I = w.h;
                (T != u || E != a || A != l || I != c) && (d.payload && e.nestedCues.push(d), d = Rh(r, i, T, E, A, I), u = T, a = E, l = A, c = I), d.payload += w.g;
              } else d.payload += " ";
              d.payload && e.nestedCues.push(d), o !== s && (d = q0(r, i), e.nestedCues.push(d)), d = Rh(r, i, u, a, l, c);
            }
          }
          return e.nestedCues.length ? { cue: e, stream: t } : null;
        }
        function Rh(e, t, n, r, i, o) {
          return e = new ot(e, t, ""), n && e.textDecoration.push(Hr), r && (e.fontStyle = jo), e.color = i, e.backgroundColor = o, e;
        }
        function q0(e, t) {
          return e = new ot(e, t, ""), e.lineBreak = !0, e;
        }
        function Y0(e, t, n, r, i) {
          this.g = e, this.l = t, this.i = n, this.h = r, this.j = i;
        }
        function Lh(e, t) {
          this.i = [], this.g = 1, this.h = 0, this.F = e, this.C = t, this.j = this.m = !1, this.l = "white", this.o = "black", this.u = this.B = null, Bu(this);
        }
        function ac(e, t, n) {
          var r = "CC" + ((e.F << 1 | e.C) + 1), i = new ot(t, n, "");
          i.lineInterpretation = 1;
          var o = Q0.get(e.g);
          return o && (i.line = o), e.u != null && e.B != null && (i.position = 10 + Math.min(70, e.u * 10) + e.B * 2.5), (t = X0(i, r, e.i, t, n)) && e.g + t.cue.nestedCues.length - 3 > 15 && (o = Q0.get(e.g + 3 - t.cue.nestedCues.length)) && (i.line = o), t;
        }
        function Bu(e) {
          ri(e, 0, 15), e.g = 1;
        }
        function hs(e, t, n) {
          if (!(n < 32 || n > 127)) {
            var r = "";
            switch (t) {
              case 0:
                r = J0.has(n) ? J0.get(n) : String.fromCharCode(n);
                break;
              case 1:
                r = O2.get(n);
                break;
              case 2:
                e.i[e.g].pop(), r = j2.get(n);
                break;
              case 3:
                e.i[e.g].pop(), r = U2.get(n);
            }
            r && e.i[e.g].push(new Y0(r, e.m, e.j, e.o, e.l));
          }
        }
        function $0(e, t, n, r) {
          if (!(n < 0 || t < 0)) if (t >= n) for (--r; r >= 0; r--) e.i[t + r] = e.i[n + r].map(function(o) {
            return o;
          });
          else for (var i = 0; i < r; i++) e.i[t + i] = e.i[n + i].map(function(o) {
            return o;
          });
        }
        function ri(e, t, n) {
          for (var r = 0; r <= n; r++) e.i[t + r] = [];
        }
        var J0 = /* @__PURE__ */ new Map([[39, "’"], [42, "á"], [92, "é"], [92, "é"], [94, "í"], [95, "ó"], [96, "ú"], [123, "ç"], [124, "÷"], [125, "Ñ"], [126, "ñ"], [127, "█"]]), O2 = /* @__PURE__ */ new Map([[48, "®"], [49, "°"], [50, "½"], [51, "¿"], [52, "™"], [53, "¢"], [54, "£"], [55, "♪"], [56, "à"], [57, " "], [58, "è"], [59, "â"], [60, "ê"], [61, "î"], [62, "ô"], [63, "û"]]), j2 = /* @__PURE__ */ new Map([
          [32, "Á"],
          [33, "É"],
          [34, "Ó"],
          [35, "Ú"],
          [36, "Ü"],
          [37, "ü"],
          [38, "‘"],
          [39, "¡"],
          [40, "*"],
          [41, "'"],
          [42, "─"],
          [43, "©"],
          [44, "℠"],
          [45, "·"],
          [46, "“"],
          [47, "”"],
          [48, "À"],
          [49, "Â"],
          [50, "Ç"],
          [51, "È"],
          [52, "Ê"],
          [53, "Ë"],
          [54, "ë"],
          [55, "Î"],
          [56, "Ï"],
          [57, "ï"],
          [58, "Ô"],
          [59, "Ù"],
          [60, "ù"],
          [61, "Û"],
          [62, "«"],
          [63, "»"]
        ]), U2 = /* @__PURE__ */ new Map([
          [32, "Ã"],
          [33, "ã"],
          [34, "Í"],
          [35, "Ì"],
          [36, "ì"],
          [37, "Ò"],
          [38, "ò"],
          [39, "Õ"],
          [40, "õ"],
          [41, "{"],
          [42, "}"],
          [43, "\\"],
          [44, "^"],
          [45, "_"],
          [46, "|"],
          [47, "~"],
          [48, "Ä"],
          [49, "ä"],
          [50, "Ö"],
          [51, "ö"],
          [52, "ß"],
          [53, "¥"],
          [54, "¤"],
          [55, "│"],
          [56, "Å"],
          [57, "å"],
          [58, "Ø"],
          [59, "ø"],
          [60, "┌"],
          [61, "┐"],
          [62, "└"],
          [63, "┘"]
        ]), Q0 = /* @__PURE__ */ new Map([[1, 10], [2, 15.33], [3, 20.66], [4, 26], [5, 31.33], [6, 36.66], [7, 42], [8, 47.33], [9, 52.66], [10, 58], [11, 63.33], [12, 68.66], [13, 74], [14, 79.33], [15, 84.66]]);
        function lc(e, t) {
          this.h = 0, this.o = new Lh(e, t), this.i = new Lh(e, t), this.g = this.j = new Lh(e, t), this.l = 0, this.m = null;
        }
        function bh(e, t, n) {
          e.g = e.i;
          var r = e.g, i = null;
          return e.h !== 3 && e.h !== 4 && (i = ac(r, e.l, n), n = e.i, n.g = n.h > 0 ? n.h : 0, ri(n, 0, 15), n = e.j, n.g = n.h > 0 ? n.h : 0, ri(n, 0, 15), r.g = 15), e.h = 3, r.h = t, i;
        }
        function Z0(e) {
          e.h = 1, e.g = e.j, e.g.h = 0;
        }
        function e1(e) {
          ci("Cea608DataChannel", "CEA-608 text mode entered, but is unsupported"), e.g = e.o, e.h = 4;
        }
        var _2 = "black green blue cyan red yellow magenta black".split(" "), t1 = "white green blue cyan red yellow magenta white_italics".split(" ");
        function Nh(e, t) {
          this.J = t, this.N = e, this.K = this.l = !1, this.m = this.o = this.H = this.M = this.I = 0, this.G = 2, this.i = [], this.g = this.h = this.j = 0, this.F = this.B = !1, this.C = "white", this.u = "black", Oh(this);
        }
        function Oh(e) {
          e.i = [];
          for (var t = 0; t < 16; t++) e.i.push(jh());
        }
        function jh() {
          for (var e = [], t = 0; t < 42; t++) e.push(null);
          return e;
        }
        function Ri(e, t) {
          n1(e) && (e.i[e.h][e.g] = new Y0(t, e.F, e.B, e.u, e.C), e.g++);
        }
        function n1(e) {
          var t = e.g < e.m && e.g >= 0;
          return e.h < e.o && e.h >= 0 && t;
        }
        Nh.prototype.isVisible = function() {
          return this.l;
        };
        function B2(e) {
          for (var t = 0, n = 1; n < 16; n++, t++) e.i[t] = e.i[n];
          for (n = 0; n < 1; n++, t++) e.i[t] = jh();
        }
        function co(e, t, n) {
          var r = new ot(e.j, t, "");
          r.textAlign = e.G === 0 ? "left" : e.G === 1 ? "right" : Dr;
          var i = r.region;
          switch (e.J && (i.id += "svc" + e.J), i.id += "win" + e.N, i.height = e.o, i.width = e.m, i.heightUnits = 2, i.widthUnits = 2, i.viewportAnchorX = e.I, i.viewportAnchorY = e.M, i.viewportAnchorUnits = e.K ? Sn : 2, e.H) {
            case 0:
              i.regionAnchorX = 0, i.regionAnchorY = 0;
              break;
            case 1:
              i.regionAnchorX = 50, i.regionAnchorY = 0;
              break;
            case 2:
              i.regionAnchorX = 100, i.regionAnchorY = 0;
              break;
            case 3:
              i.regionAnchorX = 0, i.regionAnchorY = 50;
              break;
            case 4:
              i.regionAnchorX = 50, i.regionAnchorY = 50;
              break;
            case 5:
              i.regionAnchorX = 100, i.regionAnchorY = 50;
              break;
            case 6:
              i.regionAnchorX = 0, i.regionAnchorY = 100;
              break;
            case 7:
              i.regionAnchorX = 50, i.regionAnchorY = 100;
              break;
            case 8:
              i.regionAnchorX = 100, i.regionAnchorY = 100;
          }
          return (n = X0(r, "svc" + n, e.i, e.j, t)) && (e.j = t), n;
        }
        Nh.prototype.display = function() {
          this.l = !0;
        };
        function F2() {
          this.i = [], this.h = null, this.g = 0;
        }
        function V2(e, t) {
          t.type === 3 ? (e.g = (t.value & 63) * 2 - 1, e.h = []) : e.h && (e.g > 0 && (e.h.push(t), e.g--), e.g === 0 && (e.i.push(new Fu(e.h)), e.h = null, e.g = 0));
        }
        function Fu(e) {
          this.g = 0, this.h = e;
        }
        Fu.prototype.Ka = function() {
          return this.g < this.h.length;
        }, Fu.prototype.Pa = function() {
          return this.g;
        };
        function Dt(e) {
          if (!e.Ka()) throw new b(2, 2, 3e3);
          return e.h[e.g++];
        }
        Fu.prototype.skip = function(e) {
          if (this.g + e > this.h.length) throw new b(2, 2, 3e3);
          this.g += e;
        }, Fu.prototype.Mi = function(e) {
          if (this.g - e < 0) throw new b(2, 2, 3e3);
          this.g -= e;
        };
        function H2(e) {
          this.i = e, this.h = [null, null, null, null, null, null, null, null], this.g = null;
        }
        function G2(e, t, n, r) {
          if (!e.g) return [];
          if (n == 24) return n = Dt(t).value, r = Dt(t).value, n = (function(o) {
            return o.map(function(s) {
              return ("0" + (s & 255).toString(16)).slice(-2);
            }).join("");
          })([n, r]), Ri(e.g, String.fromCharCode(parseInt(n, 16))), [];
          t = e.g;
          var i = null;
          switch (n) {
            case 8:
              !n1(t) || t.g <= 0 && t.h <= 0 || (t.g <= 0 ? (t.g = t.m - 1, t.h--) : t.g--, t.i[t.h][t.g] = null);
              break;
            case 13:
              t.isVisible() && (i = co(t, r, e.i)), t.h + 1 >= t.o ? B2(t) : t.h++, t.g = 0;
              break;
            case 14:
              t.isVisible() && (i = co(t, r, e.i)), t.i[t.h] = jh(), t.g = 0;
              break;
            case 12:
              t.isVisible() && (i = co(t, r, e.i)), Oh(t), t.h = 0, t.g = 0;
          }
          return i ? [i] : [];
        }
        function K2(e, t, n, r) {
          if (n >= 128 && n <= 135) r = n & 7, e.h[r] && (e.g = e.h[r]);
          else {
            if (n === 136) {
              n = Dt(t).value, t = [], n = m(Vu(e, n));
              for (var i = n.next(); !i.done; i = n.next()) {
                if (i = e.h[i.value], i.isVisible()) {
                  var o = co(i, r, e.i);
                  o && t.push(o);
                }
                Oh(i);
              }
              return t;
            }
            if (n === 137) for (t = Dt(t).value, t = m(Vu(e, t)), n = t.next(); !n.done; n = t.next()) n = e.h[n.value], n.isVisible() || (n.j = r), n.display();
            else {
              if (n === 138) {
                for (n = Dt(t).value, t = null, n = m(Vu(e, n)), i = n.next(); !i.done; i = n.next()) i = e.h[i.value], i.isVisible() && (t = co(i, r, e.i)), i.l = !1;
                return t ? [t] : [];
              }
              if (n === 139) {
                for (n = Dt(t).value, t = null, n = m(Vu(e, n)), i = n.next(); !i.done; i = n.next()) i = e.h[i.value], i.isVisible() ? t = co(i, r, e.i) : i.j = r, i.l = !i.l;
                return t ? [t] : [];
              }
              if (n === 140) return t = Dt(t).value, r1(e, t, r);
              if (n === 143) return r = r1(e, 255, r), i1(e), r;
              if (n === 144) t.skip(1), r = Dt(t).value, e.g && (e.g.B = (r & 128) > 0, e.g.F = (r & 64) > 0);
              else if (n === 145) r = Dt(t).value, n = Dt(t).value, t.skip(1), e.g && (t = o1((n & 48) >> 4, (n & 12) >> 2, n & 3), e.g.C = o1((r & 48) >> 4, (r & 12) >> 2, r & 3), e.g.u = t);
              else if (n === 146) r = Dt(t).value, t = Dt(t).value, e.g && (e = e.g, e.h = r & 15, e.g = t & 63);
              else if (n === 151) t.skip(1), t.skip(1), r = Dt(t).value, t.skip(1), e.g && (e.g.G = r & 3);
              else if (n >= 152 && n <= 159) {
                n = (n & 15) - 8, i = e.h[n] !== null, i || (o = new Nh(n, e.i), o.j = r, e.h[n] = o), r = Dt(t).value, o = Dt(t).value;
                var s = Dt(t).value, u = Dt(t).value, a = Dt(t).value;
                t = Dt(t).value, i && (t & 7) === 0 || (t = e.h[n], t.h = 0, t.g = 0, t.F = !1, t.B = !1, t.C = "white", t.u = "black"), t = e.h[n], t.l = (r & 32) > 0, t.M = o & 127, t.I = s, t.H = (u & 240) >> 4, t.K = (o & 128) > 0, t.o = (u & 15) + 1, t.m = (a & 63) + 1, e.g = e.h[n];
              }
            }
          }
          return [];
        }
        function Vu(e, t) {
          for (var n = [], r = 0; r < 8; r++) (t & 1) === 1 && e.h[r] && n.push(r), t >>= 1;
          return n;
        }
        function r1(e, t, n) {
          var r = [];
          t = m(Vu(e, t));
          for (var i = t.next(); !i.done; i = t.next()) {
            i = i.value;
            var o = e.h[i];
            o.isVisible() && (o = co(o, n, e.i)) && r.push(o), e.h[i] = null;
          }
          return r;
        }
        function i1(e) {
          e.g = null, e.h = [null, null, null, null, null, null, null, null];
        }
        function o1(e, t, n) {
          var r = { 0: 0, 1: 0, 2: 1, 3: 1 };
          return e = r[e], t = r[t], n = r[n], W2[e << 2 | t << 1 | n];
        }
        var s1 = /* @__PURE__ */ new Map([[32, " "], [33, " "], [37, "…"], [42, "Š"], [44, "Œ"], [48, "█"], [49, "‘"], [50, "’"], [51, "“"], [52, "”"], [53, "•"], [57, "™"], [58, "š"], [60, "œ"], [61, "℠"], [63, "Ÿ"], [118, "⅛"], [119, "⅜"], [120, "⅝"], [121, "⅞"], [122, "│"], [123, "┐"], [124, "└"], [125, "─"], [126, "┘"], [127, "┌"]]), W2 = "black blue green cyan red magenta yellow white".split(" ");
        function ps() {
          this.h = [], this.g = [], this.i = new F2(), this.l = 0, this.m = /* @__PURE__ */ new Map([["CC1", new lc(0, 0)], ["CC2", new lc(0, 1)], ["CC3", new lc(1, 0)], ["CC4", new lc(1, 1)]]), this.u = this.o = 0, this.j = /* @__PURE__ */ new Map(), this.C = !0, this.B = /* @__PURE__ */ new Set(), Uh(this);
        }
        ps.prototype.clear = function() {
          this.l = 0, this.h = [], this.g = [];
          var e = this.i;
          e.i = [], e.h = [], e.g = 0, Uh(this), e = m(this.j.values());
          for (var t = e.next(); !t.done; t = e.next()) i1(t.value);
        };
        function Uh(e) {
          e.o = 0, e.u = 0;
          for (var t = m(e.m.values()), n = t.next(); !n.done; n = t.next()) n = n.value, n.h = 0, n.g = n.j, n.m = null, Bu(n.i), Bu(n.j), Bu(n.o);
          e.C = !0;
        }
        ps.prototype.extract = function(e, t) {
          if (this.C) {
            for (var n = m(this.m.values()), r = n.next(); !r.done; r = n.next()) r.value.l = t;
            this.C = !1;
          }
          if (e = new st(e, 0), !(e.getLength() < 8) && e.Z() === 181 && e.Ca() === 49 && e.V() === 1195456820 && e.Z() === 3 && (n = e.Z(), (n & 64) !== 0)) for (n &= 31, e.skip(1), r = 0; r < n; r++) {
            var i = e.Z(), o = (i & 4) >> 2, s = e.Z(), u = e.Z();
            o && (i &= 3, i === 0 || i === 1 ? this.h.push({ pts: t, type: i, Eb: s, mc: u, order: this.h.length }) : (this.g.push({ pts: t, type: i, value: s, order: this.g.length }), this.g.push({ pts: t, type: 2, value: u, order: this.g.length })));
          }
        }, ps.prototype.decode = function() {
          function e(i, o) {
            return i.pts - o.pts || i.order - o.order;
          }
          var t = [];
          this.h.sort(e), this.g.sort(e);
          for (var n = m(this.h), r = n.next(); !r.done; r = n.next()) (r = z2(this, r.value)) && t.push(r);
          for (n = m(this.g), r = n.next(); !r.done; r = n.next()) V2(this.i, r.value);
          for (n = m(this.i.i), r = n.next(); !r.done; r = n.next()) r = X2(this, r.value), t.push.apply(t, X(r));
          return this.i.i = [], this.h = [], this.g = [], t;
        };
        function z2(e, t) {
          var n = t.type;
          if ((t.Eb & 112) === 16) {
            var r = t.Eb >> 3 & 1;
            n === 0 ? e.o = r : e.u = r;
          }
          if (r = "CC" + ((n << 1 | (n ? e.u : e.o)) + 1), n = e.m.get(r), t.Eb === 255 && t.mc === 255 || !t.Eb && !t.mc || !u1(t.Eb) || !u1(t.mc)) return ++e.l >= 45 && Uh(e), null;
          e.l = 0, t.Eb &= 127, t.mc &= 127;
          var i = t.Eb;
          if (i >= 1 && i <= 15 || !t.Eb && !t.mc) return null;
          if (i = null, (t.Eb & 112) === 16) e: {
            if (e.B.add(r), r = t.Eb, e = t.mc, n.m === (r << 8 | e)) n.m = null;
            else if (n.m = r << 8 | e, (r & 240) === 16 && (e & 192) === 64) {
              t = [11, 11, 1, 2, 3, 4, 12, 13, 14, 15, 5, 6, 7, 8, 9, 10][(r & 7) << 1 | e >> 5 & 1], r = "white", i = !1;
              var o = null, s = e > 95 ? e - 96 : e - 64;
              s <= 13 ? r = t1[Math.floor(s / 2)] : s <= 15 ? i = !0 : o = Math.floor((s - 16) / 2), e = (e & 1) === 1, n.h !== 4 && (s = n.g, n.h === 3 && t !== s.g && (n = 1 + t - s.h, $0(s, n, 1 + s.g - s.h, s.h), ri(s, 0, n - 1), ri(s, t + 1, 15 - t)), s.g = t, s.m = e, s.j = i, s.l = r, s.u = o, s.o = "black");
            } else if ((r & 247) === 17 && (e & 240) === 32) n.g.m = !1, n.g.j = !1, n.g.l = "white", hs(n.g, 0, 32), r = !1, t = t1[(e & 14) >> 1], t === "white_italics" && (t = "white", r = !0), n.g.m = (e & 1) === 1, n.g.j = r, n.g.l = t;
            else if ((r & 247) === 16 && (e & 240) === 32 || (r & 247) === 23 && (e & 255) === 45) t = "black", (r & 7) === 0 && (t = _2[(e & 14) >> 1]), n.g.o = t;
            else if ((r & 247) === 17 && (e & 240) === 48) hs(n.g, 1, e);
            else if ((r & 246) === 18 && (e & 224) === 32) hs(n.g, r & 1 ? 3 : 2, e);
            else {
              if ((r & 246) === 20 && (e & 240) === 32) {
                switch (e = t.pts, r = null, t.mc) {
                  case 32:
                    Z0(n);
                    break;
                  case 33:
                    n = n.g, n.i[n.g].pop();
                    break;
                  case 37:
                    r = bh(n, 2, e);
                    break;
                  case 38:
                    r = bh(n, 3, e);
                    break;
                  case 39:
                    r = bh(n, 4, e);
                    break;
                  case 40:
                    hs(n.g, 0, 32);
                    break;
                  case 41:
                    n.h = 2, n.g = n.i, n.g.h = 0, n.l = e;
                    break;
                  case 42:
                    Bu(n.o), e1(n);
                    break;
                  case 43:
                    e1(n);
                    break;
                  case 44:
                    t = n.i, r = null, n.h !== 4 && (r = ac(t, n.l, e)), ri(t, 0, 15);
                    break;
                  case 45:
                    t = n.g, n.h !== 3 ? r = null : (r = ac(t, n.l, e), i = t.g - t.h + 1, $0(t, i - 1, i, t.h), ri(t, 0, i - 1), ri(t, t.g, 15 - t.g), n.l = e);
                    break;
                  case 46:
                    ri(n.j, 0, 15);
                    break;
                  case 47:
                    t = null, n.h !== 4 && (t = ac(n.i, n.l, e)), r = n.j, n.j = n.i, n.i = r, Z0(n), n.l = e, r = t;
                }
                i = r;
                break e;
              }
              (r == 23 || r == 31) && e >= 33 && e <= 35 && (n.g.B = e - 32);
            }
            i = null;
          }
          else e = t.mc, hs(n.g, 0, t.Eb), hs(n.g, 0, e);
          return i;
        }
        function X2(e, t) {
          var n = [];
          try {
            for (; t.Ka(); ) {
              var r = Dt(t).value, i = (r & 224) >> 5, o = r & 31;
              if (i === 7 && o != 0 && (i = Dt(t).value & 63), i != 0) {
                e.B.add("svc" + i), e.j.has(i) || e.j.set(i, new H2(i));
                for (var s = e.j.get(i), u = t.Pa(); t.Pa() - u < o; ) {
                  i = s;
                  var a = t, l = Dt(a), c = l.value, d = l.pts;
                  if (c === 16) {
                    var h = Dt(a);
                    c = c << 16 | h.value;
                  }
                  if (c >= 0 && c <= 31) var p = G2(i, a, c, d);
                  else if (c >= 128 && c <= 159) p = K2(i, a, c, d);
                  else {
                    if (c >= 4096 && c <= 4127) i = a, a = c & 255, a >= 8 && a <= 15 ? i.skip(1) : a >= 16 && a <= 23 ? i.skip(2) : a >= 24 && a <= 31 && i.skip(3);
                    else if (c >= 4224 && c <= 4255) i = a, a = c & 255, a >= 128 && a <= 135 ? i.skip(4) : a >= 136 && a <= 143 && i.skip(5);
                    else if (c >= 32 && c <= 127) a = c, i.g && (a === 127 ? Ri(i.g, "♪") : Ri(i.g, String.fromCharCode(a)));
                    else if (c >= 160 && c <= 255) i.g && Ri(i.g, String.fromCharCode(c));
                    else if (c >= 4128 && c <= 4223) {
                      if (a = c & 255, i.g) if (s1.has(a)) {
                        var g = s1.get(a);
                        Ri(i.g, g);
                      } else Ri(i.g, "_");
                    } else c >= 4256 && c <= 4351 && i.g && ((c & 255) != 160 ? Ri(i.g, "_") : Ri(i.g, "[CC]"));
                    p = [];
                  }
                  n.push.apply(n, X(p));
                }
              }
            }
          } catch (w) {
            if (w instanceof b && w.code === 3e3) ci("CEA708_INVALID_DATA", "Buffer read out of bounds / invalid CEA-708 Data.");
            else throw w;
          }
          return n;
        }
        function u1(e) {
          for (var t = 0; e; ) t ^= e & 1, e >>= 1;
          return t === 1;
        }
        ps.prototype.getStreams = function() {
          return Array.from(this.B);
        }, Y("shaka.cea.CeaDecoder", ps), Wi = function() {
          return new ps();
        };
        function a1(e) {
          for (var t = [], n = e, r = e = 0; r < n.length; ) e == 2 && n[r] == 3 ? (e = 0, n = [].concat(X(n)), n.splice(r, 1), n = new Uint8Array(n)) : n[r] == 0 ? e++ : e = 0, r++;
          for (e = n, r = 0; r < e.length; ) {
            for (n = 0; e[r] == 255; ) n += 255, r++;
            n += e[r++];
            for (var i = 0; e[r] == 255; ) i += 255, r++;
            i += e[r++], n == 4 && t.push(e.subarray(r, r + i)), r += i;
          }
          return t;
        }
        function cc() {
          this.j = /* @__PURE__ */ new Map(), this.i = this.h = 0, this.g = _h;
        }
        cc.prototype.init = function(e) {
          function t(o) {
            o = o.name, dc.has(o) && (n.g = dc.get(o));
          }
          var n = this, r = [], i = [];
          if (new qe().box("moov", Te).box("mvex", Te).S("trex", function(o) {
            var s = o.reader;
            s.skip(4), s.skip(4), o = s.V(), s = s.V(), n.h = o, n.i = s;
          }).box("trak", Te).S("tkhd", function(o) {
            var s = o.reader;
            o = o.version, o == 1 ? (s.skip(8), s.skip(8)) : (s.skip(4), s.skip(4));
            var u = s.V();
            o == 1 ? s.skip(8) : s.skip(4), s.skip(4), s.skip(8), s.skip(2), s.skip(2), s.skip(2), s.skip(2), s.skip(36), s.Ca(), s.Ca(), s.Ca(), s.Ca(), r.push(u);
          }).box("mdia", Te).S(
            "mdhd",
            function(o) {
              o = il(o.reader, o.version), i.push(o.timescale);
            }
          ).box("minf", Te).box("stbl", Te).S("stsd", qr).box("avc1", t).box("avc3", t).box("dvav", t).box("dva1", t).box("hev1", t).box("hvc1", t).box("dvh1", t).box("dvhe", t).box("vvc1", t).box("vvi1", t).box("dvc1", t).box("dvi1", t).box("encv", An).box("sinf", Te).box("frma", function(o) {
            o = nf(o.reader).codec, dc.has(o) && (n.g = dc.get(o));
          }).parse(e, !0, !0), !r.length || !i.length || r.length != i.length) throw new b(2, 2, 2010);
          this.g == _h && De("Unable to determine bitstream format for CEA parsing!"), r.forEach(function(o, s) {
            n.j.set(o, i[s]);
          });
        }, cc.prototype.parse = function(e) {
          var t = this;
          if (this.g == _h) return [];
          var n = [], r = 0, i = [];
          return new qe().box("moof", function(o) {
            r = o.start, i = [], Te(o);
          }).box("traf", function(o) {
            i.push({ baseMediaDecodeTime: null, Wd: t.h, Xd: t.i, Ei: [], timescale: 9e4 }), Te(o);
          }).S("trun", function(o) {
            var s = i[i.length - 1];
            o = ol(o.reader, o.version, o.flags), s.Ei.push(o);
          }).S("tfhd", function(o) {
            var s = i[i.length - 1];
            o = nl(o.reader, o.flags), s.Wd = o.Wd || t.h, s.Xd = o.Xd || t.i, o = o.trackId, t.j.has(o) && (s.timescale = t.j.get(o));
          }).S("tfdt", function(o) {
            var s = i[i.length - 1];
            o = rl(o.reader, o.version), s.baseMediaDecodeTime = o.baseMediaDecodeTime;
          }).box("mdat", function(o) {
            for (var s = r - o.start - 8, u = o.reader.Pa(), a = m(i), l = a.next(); !l.done; l = a.next()) l = l.value, l.baseMediaDecodeTime === null ? De("Unable to find base media decode time for CEA captions!") : (o.reader.seek(u), q2(t, o.reader, l.baseMediaDecodeTime, l.timescale, l.Wd, l.Xd, s, l.Ei, n));
          }).parse(e, !1, !0), n;
        };
        function q2(e, t, n, r, i, o, s, u, a) {
          var l = 0, c = o, d = u.map(function(g) {
            return g.jh;
          });
          for (d = [].concat.apply([], X(d)), d.length && (c = d[0].sampleSize || o), t.skip(s + u[0].mg); t.Ka(); ) {
            s = t.V();
            var h = t.Z(), p = null;
            switch (p = !1, u = 1, e.g) {
              case Hu:
                p = h & 31, p = p == 6;
                break;
              case Gu:
                u = 2, t.skip(1), p = h >> 1 & 63, p = p == 39 || p == 40;
                break;
              case Ku:
                u = 2, t.skip(1), p = h >> 1 & 63, p = p == 23 || p == 24;
                break;
              default:
                return;
            }
            if (p) for (h = 0, l < d.length && (h = d[l].Df || 0), h = (n + h) / r, u = t.Tb(s - u, !1), u = m(a1(u)), p = u.next(); !p.done; p = u.next()) a.push({ packet: p.value, pts: h });
            else try {
              t.skip(s - u);
            } catch {
              break;
            }
            c -= s + 4, c == 0 && (n = l < d.length ? n + (d[l].kh || i) : n + i, l++, l < d.length ? c = d[l].sampleSize || o : c = o);
          }
        }
        Y("shaka.cea.Mp4CeaParser", cc);
        var _h = 0, Hu = 1, Gu = 2, Ku = 3, dc = (/* @__PURE__ */ new Map()).set("avc1", Hu).set("avc3", Hu).set("dvav", Hu).set("dva1", Hu).set("hev1", Gu).set("hvc1", Gu).set("dvh1", Gu).set("dvhe", Gu).set("vvc1", Ku).set("vvi1", Ku).set("dvc1", Ku).set("dvi1", Ku);
        Md("video/mp4", function() {
          return new cc();
        });
        function fc() {
          this.g = null;
        }
        fc.prototype.init = function() {
        }, fc.prototype.parse = function(e) {
          this.g ? this.g.clearData() : this.g = new rt();
          var t = [];
          if (e = pe(e), !$o(e)) return t;
          e = this.g.parse(e);
          var n = e.Yd(), r = e.cf();
          switch (e = [], n.video) {
            case "avc":
              e.push(6);
              break;
            case "hvc":
              e.push(39), e.push(40);
          }
          if (!e.length) return t;
          for (n = m(r), r = n.next(); !r.done; r = n.next()) if (r = r.value, e.includes(r.type) && r.time != null) for (var i = m(a1(r.data)), o = i.next(); !o.done; o = i.next()) t.push({ packet: o.value, pts: r.time });
          return t;
        }, Y("shaka.cea.TsCeaParser", fc), Md("video/mp2t", function() {
          return new fc();
        });
        function Y2(e) {
          var t = 0, n = dn(e), r = n.getUint32(t, !0);
          if (r != e.byteLength) return [];
          e: {
            for (e = t + 4 + 2, t = []; e < n.byteLength - 1; ) {
              r = n.getUint16(e, !0), e += 2;
              var i = n.getUint16(e, !0);
              if (e += 2, (i & 1) != 0 || i + e > n.byteLength) {
                n = [];
                break e;
              }
              var o = pe(n, e, i);
              t.push({ type: r, value: o }), e += i;
            }
            n = t;
          }
          return n;
        }
        function l1(e) {
          return e = Wn(wt(e)), e = Y2(e).filter(function(t) {
            return t.type === $2;
          })[0], e ? (e = fi(e.value, !0), (e = qi(e, "WRMHEADER")) ? e : null) : null;
        }
        function hc(e) {
          try {
            var t = l1(e);
            if (t) e: {
              for (var n = m(wr(t, "DATA")), r = n.next(); !r.done; r = n.next()) {
                var i = r.value;
                if (i.children) for (var o = m(i.children), s = o.next(); !s.done; s = o.next()) {
                  var u = s.value;
                  if (u.tagName == "LA_URL") {
                    var a = wt(u);
                    break e;
                  }
                }
              }
              a = "";
            }
            else a = "";
            return a;
          } catch {
            return "";
          }
        }
        var $2 = 1;
        function c1() {
          this.g = /* @__PURE__ */ new Map();
        }
        c1.prototype.release = function() {
          this.g.clear();
        };
        function d1(e, t, n, r) {
          var i = Z2(e, t), o = null;
          e = [];
          var s = [];
          t = null;
          var u = new Set(i.map(function(l) {
            return l.keyId;
          }));
          u.delete(null);
          var a = "cenc";
          if (u.size > 1) throw new b(2, 4, 4010);
          if (!n) {
            if (s = i.filter(function(l) {
              return l.Id == "urn:mpeg:dash:sea:2012";
            }), s.length > 1) throw new b(2, 4, 4050);
            s.length && (t = tM(s[0])), (s = i.find(function(l) {
              return l.Id == "urn:mpeg:dash:mp4protection:2011";
            })) && s.encryptionScheme && (a = s.encryptionScheme), s = i.filter(function(l) {
              return l.Id == "urn:mpeg:dash:mp4protection:2011" ? (o = l.init || o, !1) : l.Id != "urn:mpeg:dash:sea:2012";
            }), s.length && (e = Q2(o, a, s, r, u), e.length == 0 && (e = [Br("", a, o)]));
          }
          if (i.length && !t && (n || !s.length)) for (e = [], n = m(Object.values(r)), r = n.next(); !r.done; r = n.next()) r = r.value, r != "org.w3.clearkey" && (r = Br(r, a, o), e.push(r));
          if (u = Array.from(u)[0] || null) for (a = m(e), n = a.next(); !n.done; n = a.next()) for (n = m(n.value.initData), r = n.next(); !r.done; r = n.next()) r.value.keyId = u;
          return { Vh: u, Cm: o, drmInfos: e, dg: t, $h: !0 };
        }
        function J2(e, t, n, r, i) {
          var o = d1(e, t, r, i);
          if (n.$h)
            e = n.drmInfos.length == 1 && !n.drmInfos[0].keySystem, t = o.drmInfos.length == 0, (n.drmInfos.length == 0 || e && !t) && (n.drmInfos = o.drmInfos), n.$h = !1;
          else if (o.drmInfos.length > 0 && (n.drmInfos = n.drmInfos.filter(function(s) {
            return o.drmInfos.some(function(u) {
              return u.keySystem == s.keySystem;
            });
          }), n.drmInfos.length == 0)) throw new b(2, 4, 4008);
          return o.Vh || n.Vh;
        }
        function pc(e) {
          var t = zn(e.node, "https://dashif.org/CPS", "Laurl");
          if (t && (t = wt(t))) return t;
          if ((t = zn(e.node, "urn:microsoft:playready", "pro")) && wt(t)) return hc(t);
          if ((e = zn(e.node, "urn:mpeg:cenc:2013", "pssh")) && (e = wt(e))) {
            t = Wn(e), e = 8, t = dn(t);
            var n = t.getUint8(e);
            return e += 20, n > 0 && (e += 4 + 16 * t.getUint32(e)), e = pe(t, e + 4), e = Ma(e), e = qi("<pro>" + e + "</pro>"), hc(e);
          }
          return "";
        }
        function Q2(e, t, n, r, i) {
          var o = [];
          n = m(n);
          for (var s = n.next(); !s.done; s = n.next()) {
            s = s.value;
            var u = r[s.Id];
            if (u) {
              var a;
              if ((a = zn(s.node, "urn:microsoft:playready", "pro")) && wt(a)) {
                a = wt(a), a = Wn(a);
                var l = new Uint8Array([154, 4, 240, 121, 152, 64, 66, 134, 171, 146, 230, 91, 224, 136, 95, 149]);
                a = [{ initData: el(a, l, /* @__PURE__ */ new Set(), 0), initDataType: "cenc", keyId: s.keyId }];
              } else a = null;
              if (l = null, s.Id === "urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e") {
                l = s;
                var c = i;
                if (c.size == 0) l = null;
                else {
                  var d = new Uint8Array([
                    16,
                    119,
                    239,
                    236,
                    192,
                    178,
                    77,
                    2,
                    172,
                    227,
                    60,
                    30,
                    82,
                    226,
                    251,
                    75
                  ]), h = new Uint8Array([]);
                  l = [{ initData: el(h, d, c, 1), initDataType: "cenc", keyId: l.keyId }];
                }
              }
              a = Br(u, t, s.init || e || a || l), (u = nM.get(u)) && (a.licenseServerUri = u(s));
              e: {
                if ((s = zn(s.node, "https://dashif.org/CPS", "Certurl")) && (s = wt(s))) break e;
                s = "";
              }
              a.serverCertificateUri = s, o.push(a);
            }
          }
          return o;
        }
        function Z2(e, t) {
          var n = [];
          t = m(t);
          for (var r = t.next(); !r.done; r = t.next()) (r = eM(e, r.value)) && n.push(r);
          return n;
        }
        function eM(e, t) {
          var n = t.attributes.schemeIdUri, r = Fr(t, "urn:mpeg:cenc:2013", "default_KID"), i = Vg(t, "urn:mpeg:cenc:2013", "pssh").map(tn), o = t.attributes.value;
          if (!n) return null;
          if (n = n.toLowerCase(), r && (r = r.replace(/-/g, "").toLowerCase(), r.includes(" "))) throw new b(2, 4, 4009);
          var s = [];
          try {
            s = i.map(function(u) {
              if (!e.g.has(u)) {
                var a = Wn(u);
                e.g.set(u, a);
              }
              return { initDataType: "cenc", initData: e.g.get(u), keyId: null };
            });
          } catch {
            throw new b(2, 4, 4007);
          }
          return { node: t, Id: n, keyId: r, init: s.length > 0 ? s : null, encryptionScheme: o };
        }
        function tM(e) {
          if (!C.crypto || !C.crypto.subtle) throw De("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"), new b(2, 4, 4042);
          var t = zn(e.node, "urn:mpeg:dash:schema:sea:2012", "SegmentEncryption");
          if (!t) throw new b(2, 4, 4051);
          if (t.attributes.schemeIdUri != "urn:mpeg:dash:sea:aes128-cbc:2013") throw new b(2, 4, 4051);
          if (t = zn(e.node, "urn:mpeg:dash:schema:sea:2012", "CryptoPeriod"), !t) throw new b(2, 4, 4051);
          if (e = t.attributes.IV, t = en(t.attributes.keyUriTemplate), !e || !t) throw new b(2, 4, 4051);
          if (e = Gi(e.substr(2)), e.byteLength != 16) throw new b(2, 4, 4048);
          return { rk: t, iv: e };
        }
        var nM = (/* @__PURE__ */ new Map()).set("com.apple.fps", function(e) {
          if (C.shakaMediaKeysPolyfill === "apple") throw new b(2, 4, 4054);
          return (e = zn(e.node, "https://dashif.org/CPS", "Laurl")) && (e = wt(e)) ? e : "";
        }).set("com.widevine.alpha", function(e) {
          var t = zn(e.node, "https://dashif.org/CPS", "Laurl");
          return t && (t = wt(t)) ? t : (e = zn(e.node, "urn:microsoft", "laurl")) && en(e.attributes.licenseUrl) || "";
        }).set("com.microsoft.playready", pc).set("com.microsoft.playready.recommendation", pc).set(
          "com.microsoft.playready.software",
          pc
        ).set("com.microsoft.playready.hardware", pc).set("org.w3.clearkey", function(e) {
          var t = zn(e.node, "https://dashif.org/CPS", "Laurl");
          return t && (t = wt(t)) ? t : (e = zn(e.node, "http://dashif.org/guidelines/clearKey", "Laurl")) && e.attributes.Lic_type === "EME-1.0" && e && (e = wt(e)) ? e : "";
        });
        function Wu(e, t, n, r, i, o) {
          var s = (/* @__PURE__ */ new Map()).set("RepresentationID", t).set("Number", n).set("SubNumber", r).set("Bandwidth", i).set("Time", o);
          return e.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g, function(u, a, l, c) {
            if (u == "$$") return "$";
            var d = s.get(a);
            if (d == null) return u;
            switch (a == "RepresentationID" && l && (l = void 0), a == "Time" && typeof d != "bigint" && (Math.abs(d - Math.round(d)) >= 0.2 && De("Calculated $Time$ values must be close to integers"), d = Math.round(d)), c) {
              case void 0:
              case "d":
              case "i":
              case "u":
                u = d.toString();
                break;
              case "o":
                u = d.toString(8);
                break;
              case "x":
                u = d.toString(16);
                break;
              case "X":
                u = d.toString(16).toUpperCase();
                break;
              default:
                u = d.toString();
            }
            return l = C.parseInt(l, 10) || 1, Array(Math.max(0, l - u.length) + 1).join("0") + u;
          });
        }
        function f1(e, t) {
          var n = hr(e, t, "timescale"), r = 1;
          n && (r = Pr(n) || 1), n = hr(e, t, "duration");
          var i = (n = Pr(n || "")) ? n / r : null, o = hr(e, t, "startNumber"), s = Number(hr(e, t, "presentationTimeOffset")) || 0, u = _t(o || "");
          if ((o == null || u == null) && (u = 1), o = null, t = gs(e, t, "SegmentTimeline")) {
            t = We(t, "S"), o = r, e = e.na.duration || 1 / 0;
            for (var a = u, l = [], c = -s, d = 0; d < t.length; ++d) {
              var h = t[d], p = t[d + 1], g = ge(h, "t", _t), w = ge(h, "d", _t), T = ge(h, "r", Ut);
              if (h = ge(h, "k", Ut) || 0, g != null && (g -= s), w) {
                if (g = g ?? c, T = T || 0, T < 0) if (p) {
                  if (p = ge(p, "t", _t), p == null) break;
                  if (g >= p) break;
                  T = Math.ceil((p - g) / w) - 1;
                } else {
                  if (e == 1 / 0) break;
                  if (g / o >= e) break;
                  T = Math.ceil((e * o - g) / w) - 1;
                }
                for (l.length > 0 && g != c && (l[l.length - 1].end = g / o), p = 0; p <= T; ++p) c = g + w, l.push({ start: g / o, Md: g, end: c / o, Gh: c, xc: h, Tk: l.length + a }), g = c;
              }
            }
            o = l;
          }
          return { timescale: r, Nf: n, gb: i, ue: u, hc: s / r || 0, ed: s, timeline: o };
        }
        function h1(e, t) {
          return [t(e.L), t(e.qa), t(e.ua)].filter(wi);
        }
        function hr(e, t, n) {
          t = h1(e, t), e = null, t = m(t);
          for (var r = t.next(); !r.done && !(e = r.value.attributes[n]); r = t.next()) ;
          return e;
        }
        function gs(e, t, n) {
          t = h1(e, t), e = null, t = m(t);
          for (var r = t.next(); !r.done && !(e = ut(r.value, n)); r = t.next()) ;
          return e;
        }
        function rM(e, t, n, r, i, o) {
          for (var s = Fr(e, "http://www.w3.org/1999/xlink", "href"), u = Fr(e, "http://www.w3.org/1999/xlink", "actuate") || "onRequest", a = m(Object.keys(e.attributes)), l = a.next(); !l.done; l = a.next()) {
            l = l.value;
            var c = l.split(":"), d = kd("http://www.w3.org/1999/xlink");
            c[0] == d && delete e.attributes[l];
          }
          if (o >= 5) return Ti(new b(2, 4, 4028));
          if (u != "onLoad") return Ti(new b(2, 4, 4027));
          var h = bt([r], [s]);
          return i.request(0, At(h, t)).Xa(function(p) {
            if (p = Xs(p.data, e.tagName), !p) return Ti(new b(2, 4, 4001, s));
            for (e.children = []; p.children.length; ) {
              var g = p.children.shift();
              e.children.push(g);
            }
            g = m(Object.keys(p.attributes));
            for (var w = g.next(); !w.done; w = g.next()) w = w.value, e.attributes[w] = p.attributes[w];
            return gc(e, t, n, h[0], i, o + 1);
          });
        }
        function gc(e, t, n, r, i, o) {
          if (o = o === void 0 ? 0 : o, Fr(e, "http://www.w3.org/1999/xlink", "href")) {
            var s = rM(e, t, n, r, i, o);
            return n && (s = s.Xa(void 0, function() {
              return gc(e, t, n, r, i, o);
            })), s;
          }
          s = [];
          for (var u = m(Fg(e)), a = u.next(), l = {}; !a.done; l = { Td: void 0 }, a = u.next()) l.Td = a.value, Fr(l.Td, "http://www.w3.org/1999/xlink", "href") == "urn:mpeg:dash:resolve-to-zero:2013" ? e.children = e.children.filter(/* @__PURE__ */ (function(c) {
            return function(d) {
              return d !== c.Td;
            };
          })(l)) : l.Td.tagName != "SegmentTimeline" && s.push(gc(l.Td, t, n, r, i, o));
          return Sm(s).Xa(function() {
            return e;
          });
        }
        function iM(e, t, n, r, i, o, s, u) {
          var a, l = new qe().S("sidx", function(c) {
            a = oM(t, r, i, o, s, n, c, u);
          });
          if (e && l.parse(e), a) return a;
          throw new b(2, 3, 3004);
        }
        function oM(e, t, n, r, i, o, s, u) {
          u = u === void 0 ? !1 : u;
          var a = [];
          s.reader.skip(4);
          var l = s.reader.V();
          if (l == 0) throw new b(2, 3, 3005);
          if (s.version == 0)
            var c = s.reader.V(), d = s.reader.V();
          else c = s.reader.Fd(), d = s.reader.Fd();
          s.reader.skip(2);
          var h = s.reader.Ca();
          for (e = (u ? -s.size : e) + s.size + d, u = 0; u < h; u++) {
            var p = s.reader.V();
            d = (p & 2147483648) >>> 31, p &= 2147483647;
            var g = s.reader.V();
            if (s.reader.skip(4), d == 1) throw new b(2, 3, 3006);
            a.push(new se(c / l + n, (c + g) / l + n, function() {
              return o;
            }, e, e + p - 1, t, n, r, i)), c += g, e += p;
          }
          return s.parser.stop(), a;
        }
        function Li(e) {
          this.h = dn(e), this.g = new st(this.h, 0);
        }
        Li.prototype.Ka = function() {
          return this.g.Ka();
        };
        function ii(e) {
          var t = p1(e);
          if (t.length > 7) throw new b(2, 3, 3002);
          var n = 0;
          t = m(t);
          for (var r = t.next(); !r.done; r = t.next()) n = 256 * n + r.value;
          t = p1(e);
          e: {
            r = m(sM);
            for (var i = r.next(); !i.done; i = r.next()) if (Ur(t, new Uint8Array(i.value))) {
              r = !0;
              break e;
            }
            r = !1;
          }
          if (r) t = e.h.byteLength - e.g.Pa();
          else {
            if (t.length == 8 && t[1] & 224) throw new b(2, 3, 3001);
            for (i = r = 0; i < t.length; i++) {
              var o = t[i];
              r = i == 0 ? o & (1 << 8 - t.length) - 1 : 256 * r + o;
            }
            t = r;
          }
          return t = e.g.Pa() + t <= e.h.byteLength ? t : e.h.byteLength - e.g.Pa(), r = dn(e.h, e.g.Pa(), t), e.g.skip(t), new uM(
            n,
            r
          );
        }
        function p1(e) {
          var t = e.g.Pa(), n = e.g.Z();
          if (n == 0) throw new b(2, 3, 3002);
          return n = 8 - Math.floor(Math.log2(n)), e.g.skip(n - 1), pe(e.h, t, n);
        }
        var sM = [[255], [127, 255], [63, 255, 255], [31, 255, 255, 255], [15, 255, 255, 255, 255], [7, 255, 255, 255, 255, 255], [3, 255, 255, 255, 255, 255, 255], [1, 255, 255, 255, 255, 255, 255, 255]];
        function uM(e, t) {
          this.id = e, this.g = t;
        }
        function Bh(e) {
          if (e.g.byteLength > 8) throw new b(2, 3, 3002);
          if (e.g.byteLength == 8 && e.g.getUint8(0) & 224) throw new b(2, 3, 3001);
          for (var t = 0, n = 0; n < e.g.byteLength; n++) {
            var r = e.g.getUint8(n);
            t = 256 * t + r;
          }
          return t;
        }
        function aM(e, t, n, r, i, o, s) {
          if (t = new Li(t), ii(t).id != 440786851) throw new b(2, 3, 3008);
          var u = ii(t);
          if (u.id != 408125543) throw new b(2, 3, 3009);
          t = u.g.byteOffset, u = new Li(u.g);
          for (var a = null; u.Ka(); ) {
            var l = ii(u);
            if (l.id == 357149030) {
              a = l;
              break;
            }
          }
          if (!a) throw new b(2, 3, 3010);
          for (a = new Li(a.g), l = 1e6, u = null; a.Ka(); ) {
            var c = ii(a);
            if (c.id == 2807729) l = Bh(c);
            else if (c.id == 17545) if (c.g.byteLength == 4) u = c.g.getFloat32(0);
            else if (c.g.byteLength == 8) u = c.g.getFloat64(0);
            else throw new b(2, 3, 3003);
          }
          if (u == null) throw new b(
            2,
            3,
            3011
          );
          if (a = l / 1e9, u *= a, e = ii(new Li(e)), e.id != 475249515) throw new b(2, 3, 3007);
          return lM(e, t, a, u, n, r, i, o, s);
        }
        function lM(e, t, n, r, i, o, s, u, a) {
          function l() {
            return i;
          }
          var c = [];
          e = new Li(e.g);
          for (var d = null, h = null; e.Ka(); ) {
            var p = ii(e);
            if (p.id == 187) {
              var g = cM(p);
              g && (p = n * g.kl, g = t + g.Lk, d != null && c.push(new se(d + s, p + s, l, h, g - 1, o, s, u, a)), d = p, h = g);
            }
          }
          return d != null && c.push(new se(d + s, r + s, l, h, null, o, s, u, a)), c;
        }
        function cM(e) {
          var t = new Li(e.g);
          if (e = ii(t), e.id != 179) throw new b(2, 3, 3013);
          if (e = Bh(e), t = ii(t), t.id != 183) throw new b(2, 3, 3012);
          t = new Li(t.g);
          for (var n = 0; t.Ka(); ) {
            var r = ii(t);
            if (r.id == 241) {
              n = Bh(r);
              break;
            }
          }
          return { kl: e, Lk: n };
        }
        function g1(e, t, n) {
          if (t = gs(e, t, "Initialization"), !t) return null;
          var r = e.L.bb(), i = t.attributes.sourceURL;
          i && (r = bt(r, [en(i)], e.Lb())), i = 0;
          var o = null;
          return (t = ge(t, "range", Ra)) && (i = t.start, o = t.end), n = new pn(function() {
            return r;
          }, i, o, w1(e), null, null, n, e.qa.encrypted), n.codecs = e.L.codecs, n.mimeType = e.L.mimeType, e.na && !e.na.hf && (n.g = e.na.start + e.na.duration), n;
        }
        function dM(e, t, n) {
          var r = Number(hr(e, ms, "presentationTimeOffset")) || 0, i = hr(e, ms, "timescale"), o = 1;
          i && (o = Pr(i) || 1);
          var s = r / o || 0, u = g1(e, ms, n);
          fM(e, u);
          var a = gi(e);
          return { endTime: -1, timeline: -1, Sc: function() {
            var l = gs(a, ms, "RepresentationIndex"), c = a.L.bb();
            return l && (l = en(l.attributes.sourceURL)) && (c = bt(c, [l], a.Lb())), l = v1(a), m1(a, t, u, c, l.start, l.end, s);
          }, timescale: o };
        }
        function m1(e, t, n, r, i, o, s) {
          var u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L;
          return D(function(U) {
            if (U.g == 1) return u = e.presentationTimeline, a = !e.Gb || !e.na.hf, l = e.na.start, c = e.na.duration, d = e.L.mimeType.split("/")[1], h = t, p = null, g = [h(r, i, o, !1), d == "webm" ? h(n.P(), n.startByte, n.endByte, !0) : null], h = null, x(U, Promise.all(g), 2);
            for (w = U.h, T = w[0], E = w[1] || null, A = null, I = l - s, P = l, N = c ? l + c : 1 / 0, M = e.L.bb(), R = M.length != r.length || M.some(function(j, G) {
              return j != r[G];
            }), A = d == "mp4" ? iM(T, i, M, n, I, P, N, R) : aM(T, E, M, n, I, P, N), k = m(A), O = k.next(); !O.done; O = k.next()) L = O.value, L.codecs = e.L.codecs, L.mimeType = e.L.mimeType, L.bandwidth = e.bandwidth;
            return u.le(A), p = new Ue(A), a && p.nd(P, N, !0), U.return(p);
          });
        }
        function ms(e) {
          return e.Jd;
        }
        function v1(e) {
          var t = gs(e, ms, "RepresentationIndex");
          return e = hr(e, ms, "indexRange"), e = Ra(e || ""), t && (e = ge(t, "range", Ra, e)), e;
        }
        function fM(e, t) {
          if (y1(e, t), !v1(e)) throw new b(2, 4, 4002);
        }
        function y1(e, t) {
          var n = e.L.mimeType.split("/")[1];
          if (e.L.contentType != xe && n != "mp4" && n != "webm") throw new b(2, 4, 4006);
          if (n == "webm" && !t) throw new b(2, 4, 4005);
        }
        function w1(e) {
          var t = e.L;
          return { bandwidth: e.bandwidth, audioSamplingRate: t.audioSamplingRate, codecs: t.codecs, contentType: t.contentType, frameRate: t.frameRate || null, height: t.height || null, mimeType: t.mimeType, channelsCount: t.wf, pixelAspectRatio: t.pixelAspectRatio || null, width: t.width || null, label: e.qa.label || null, roles: e.roles || null, language: e.qa.language || null };
        }
        function hM(e, t, n) {
          var r = g1(e, T1, n), i = pM(e);
          if (!i.gb && !i.timeline && i.yd.length > 1) throw new b(2, 4, 4002);
          if (!i.gb && !e.na.duration && !i.timeline && i.yd.length == 1) throw new b(2, 4, 4002);
          if (i.timeline && i.timeline.length == 0) throw new b(2, 4, 4002);
          var o = null, s = null;
          e.ua.id && e.L.id && (s = t.get(e.ua.id + "," + e.L.id)) && (o = s.segmentIndex);
          var u = gM(e.na.start, e.na.duration, e.L.bb, i, r, n, e.L.mimeType, e.L.codecs, e.bandwidth, e.Lb);
          return t = !o, o ? o.je(u, e.presentationTimeline.Jb()) : o = new Ue(u), e.presentationTimeline.le(u), e.Gb && e.na.hf || o.nd(e.na.start, e.na.duration ? e.na.start + e.na.duration : 1 / 0, t), s && (s.segmentIndex = o), { endTime: -1, timeline: -1, Sc: function() {
            return o && o.getNumReferences() != 0 || o.qf(u), Promise.resolve(o);
          }, timescale: i.timescale };
        }
        function T1(e) {
          return e.Bc;
        }
        function pM(e) {
          var t = mM(e);
          e = f1(e, T1);
          var n = e.ue;
          n == 0 && (n = 1);
          var r = 0;
          return e.gb ? r = e.gb * (n - 1) : e.timeline && e.timeline.length > 0 && (r = e.timeline[0].start), { gb: e.gb, startTime: r, ue: n, hc: e.hc, timescale: e.timescale, timeline: e.timeline, yd: t };
        }
        function gM(e, t, n, r, i, o, s, u, a, l) {
          var c = r.yd.length;
          r.timeline && r.timeline.length != r.yd.length && (c = Math.min(r.timeline.length, r.yd.length));
          for (var d = e - r.hc, h = t ? e + t : 1 / 0, p = [], g = r.startTime, w = {}, T = 0; T < c; w = { Pf: void 0, Ef: void 0 }, T++) {
            w.Ef = r.yd[T];
            var E = g;
            g = void 0, g = r.gb != null ? E + r.gb : r.timeline ? r.timeline[T].end : E + t, w.Pf = null, w = new se(e + E, e + g, /* @__PURE__ */ (function(A) {
              return function() {
                return A.Pf == null && (A.Pf = bt(n(), [A.Ef.zk], l())), A.Pf;
              };
            })(w), w.Ef.start, w.Ef.end, i, d, e, h, [], "", null, null, Yr, o), w.codecs = u, w.mimeType = s, w.bandwidth = a, p.push(w);
          }
          return p;
        }
        function mM(e) {
          return [e.L.Bc, e.qa.Bc, e.ua.Bc].filter(wi).map(function(t) {
            return We(t, "SegmentURL");
          }).reduce(function(t, n) {
            return t.length > 0 ? t : n;
          }).map(function(t) {
            t.attributes.indexRange && !e.Lg && (e.Lg = !0);
            var n = en(t.attributes.media);
            return t = ge(t, "mediaRange", Ra, { start: 0, end: null }), { zk: n, start: t.start, end: t.end };
          });
        }
        function S1(e, t, n, r, i, o, s, u, a, l) {
          a || e.L.ef || (e.L.ef = hr(e, bi, "initialization"));
          var c = e.L.ef ? TM(e, s) : null, d = vM(e);
          yM(d);
          var h = gi(e);
          if (d.ee) return y1(e, c), { endTime: -1, timeline: -1, Sc: function() {
            var E = Wu(d.ee, h.L.originalId, null, null, h.bandwidth || null, null);
            return E = bt(h.L.bb(), [E]), m1(h, t, c, E, 0, null, d.hc);
          }, timescale: d.timescale };
          if (d.gb) return r || e.qa.contentType === "image" || e.qa.contentType === "text" || (r = e.na.start, l = e.ua.id, n = e.na.duration, l = (l = l != null && o.get(l) || n) ? r + l : 1 / 0, e.presentationTimeline.Tg(d.gb), e.presentationTimeline.Ci(r, l)), { endTime: -1, timeline: -1, Sc: function() {
            return wM(h, d, i, c, o, s, u, e.L.Ff);
          }, timescale: d.timescale };
          var p = null;
          r = r = null, e.ua.id && e.L.id && (r = e.ua.id + "," + e.L.id, r = n.get(r)) && (p = r.segmentIndex);
          var g = e.na.start, w = e.na.duration ? g + e.na.duration : 1 / 0;
          if (p) l = p, x1(l, d, g, w, c, e.Gb), l.Ya(e.presentationTimeline.Jb());
          else {
            if (n = 0, a = -1, e.ua.id != null && e.L.id != null) {
              var T = l.get(e.ua.id);
              if (T) a = T.timeline;
              else for (l = m(l.values()), T = l.next(); !T.done; T = l.next()) if (T = T.value, Math.abs(d.hc - T.endTime) <= bg && T.eh.includes(e.L.id)) {
                a = T.timeline;
                break;
              } else T.timeline >= n && (n = T.timeline + 1);
            }
            a == -1 && (a = n), p = new zu(e.Gb, d, e.L.originalId, e.bandwidth, e.L.bb, e.Lb, g, w, c, s, e.L.Ff, a);
          }
          return d.timeline && e.qa.contentType !== "image" && e.qa.contentType !== "text" && e.presentationTimeline.Di(p.h ? p.h.timeline : [], g), r && e.Gb && (r.segmentIndex = p), r = (r = (r = d.timeline) && r[r.length - 1]) ? r.end + d.hc : -1, l = -1, p instanceof zu && (l = p.Ve()), { endTime: r, timeline: l, Sc: function() {
            return p instanceof zu && p.getNumReferences() == 0 && x1(
              p,
              d,
              g,
              w,
              c,
              e.Gb
            ), Promise.resolve(p);
          }, timescale: d.timescale };
        }
        function bi(e) {
          return e.Oc;
        }
        function vM(e) {
          var t = f1(e, bi), n = hr(e, bi, "media"), r = hr(e, bi, "index"), i = hr(e, bi, "k"), o = 0;
          return i && (o = parseInt(i, 10)), { Nf: t.Nf, gb: t.gb, timescale: t.timescale, ue: t.ue, hc: t.hc, ed: t.ed, timeline: t.timeline, dc: n && en(n), ee: r, mimeType: e.L.mimeType, codecs: e.L.codecs, bandwidth: e.bandwidth, Bk: o };
        }
        function yM(e) {
          var t = e.ee ? 1 : 0;
          if (t += e.timeline ? 1 : 0, t += e.gb ? 1 : 0, t == 0) throw new b(2, 4, 4002);
          if (t != 1 && (e.ee && (e.timeline = null), e.Nf = null, e.gb = null), !e.ee && !e.dc) throw new b(2, 4, 4002);
        }
        function wM(e, t, n, r, i, o, s, u) {
          function a(j) {
            var G = j - T, H = G * w, B = t.Nf, F = G * B;
            "BigInt" in C && F > Number.MAX_SAFE_INTEGER && (F = BigInt(G) * BigInt(B)), H += h, G = H + w, B = Math.min(G, c());
            var W = [], z = t.Bk;
            if (z) for (var me = (B - H) / z, Q = {}, Be = 0; Be < z; Q = { Zi: void 0 }, Be++) {
              var ve = H + me * Be, ze = ve + me;
              Q.Zi = Be, Q = new se(ve, ze, /* @__PURE__ */ (function(Ce) {
                return function() {
                  var Ee = Wu(E, I, j, Ce.Zi, A, F);
                  return bt(P(), [Ee], N());
                };
              })(Q), 0, null, r, M, h, c(), [], "", null, null, Yr, o), Q.codecs = e.L.codecs, Q.mimeType = e.L.mimeType, u == 0 ? Be > 0 && Q.wd() : Be % u != 0 && Q.wd(), W.push(Q);
            }
            return H = new se(H, B, function() {
              if (z) return [];
              var Ce = Wu(E, I, j, null, A, F);
              return bt(P(), [Ce], N());
            }, 0, null, r, M, h, c(), W, "", null, null, Yr, o, W.length > 0), H.codecs = e.L.codecs, H.mimeType = e.L.mimeType, H.bandwidth = e.bandwidth, H.j = G, H;
          }
          function l() {
            var j = [Math.max(d.Jb(), h), Math.min(d.Jc(), c())].map(function(G) {
              return G - h;
            });
            return j = [Math.ceil(j[0] / w), Math.ceil(j[1] / w) - 1], e.L.rb && j[1]++, j.map(function(G) {
              return G + T;
            });
          }
          function c() {
            var j = p != null && i.get(p) || g;
            return j ? h + j : 1 / 0;
          }
          var d = e.presentationTimeline, h = e.na.start, p = e.ua.id, g = e.na.duration, w = t.gb, T = t.ue, E = t.dc, A = e.bandwidth || null, I = e.L.originalId, P = e.L.bb, N = e.Lb, M = h - t.hc, R = l();
          n = e.Gb ? Math.max(R[0], R[1] - n + 1) : R[0], s = s || R[1], R = [];
          for (var k = n; k <= s; ++k) {
            var O = a(k);
            R.push(O);
          }
          var L = new Ue(R);
          if (R = d.Jc() < c(), k = d.U(), R || k) {
            var U = Math.max(n, s + 1);
            n = w, e.L.rb && (n = 0.1), L.Of(n, function() {
              var j = d.Jb();
              L.Ya(j);
              var G = m(l());
              G.next(), G = G.next().value;
              for (var H = []; U <= G; ) {
                var B = a(U);
                H.push(B), U++;
              }
              return j > c() && !H.length ? null : H;
            });
          }
          return Promise.resolve(L);
        }
        function TM(e, t) {
          var n = e.L.ef;
          if (n || (n = hr(e, bi, "initialization")), !n) return null;
          n = en(n);
          var r = e.L.originalId, i = e.bandwidth || null, o = e.L.bb, s = e.Lb;
          return t = new pn(function() {
            var u = Wu(n, r, null, null, i, null);
            return bt(o(), [u], s());
          }, 0, null, w1(e), null, null, t, e.qa.encrypted), t.codecs = e.L.codecs, t.mimeType = e.L.mimeType, e.na && !e.na.hf && (t.g = e.na.start + e.na.duration), t;
        }
        function zu(e, t, n, r, i, o, s, u, a, l, c, d) {
          Ue.call(this, []), this.F = e, this.h = t, this.H = n, this.C = r, this.G = i, this.J = o, this.j = s, this.l = u, this.u = a, this.B = l, this.I = c, this.K = d, Fh(this);
        }
        tt(zu, Ue), f = zu.prototype, f.getNumReferences = function() {
          return this.h ? this.h.timeline.length : 0;
        }, f.release = function() {
          Ue.prototype.release.call(this), this.h = null;
        }, f.Ya = function(e) {
          if (this.h) {
            for (var t = 0, n = this.h.timeline, r = 0; r < n.length && n[r].end + this.j <= e; r += 1) t += 1;
            t > 0 && (this.h.timeline = n.slice(t), this.g.length >= t && (this.g = this.g.slice(t)), this.i += t, this.getNumReferences() === 0 && this.release());
          }
        };
        function x1(e, t, n, r, i, o) {
          if (SM(e, i), e.F = o, e.h) {
            if (e.h.ed !== t.ed) for (n = t.ed - e.h.ed, i = 0; i < t.timeline.length; i++) o = t.timeline[i], o.Md += n, o.Gh += n, o.start = (o.Md + n) / t.timescale, o.end = (o.Gh + n) / t.timescale;
            if (e.h.dc !== t.dc && (e.h.dc = t.dc), n = e.h.timeline, n.length) {
              var s = n[n.length - 1];
              t = t.timeline.filter(function(u) {
                return u.end > s.end;
              });
            } else t = t.timeline.slice();
            t.length > 0 && e.h.timeline.push.apply(e.h.timeline, X(t)), e.l !== r && (e.l = r);
          } else e.h = t, e.j = n, e.l = r;
          Fh(e);
        }
        function SM(e, t) {
          if (e.u !== t) {
            e.u = t, e = m(e.g);
            for (var n = e.next(); !n.done; n = e.next()) (n = n.value) && iv(n, t);
          }
        }
        function Fh(e) {
          if (e.h && !e.o) {
            for (var t = [], n = m(e.h.timeline), r = n.next(); !r.done; r = n.next()) r = r.value, r.start >= e.l || r.end <= 0 || t.push(r);
            e.h.timeline = t, e.Ya(e.j);
          }
        }
        f.find = function(e) {
          if (this.h && this.h.timeline && this.h.timeline.length && e < this.h.timeline[0].start + this.j) return this.i;
          if (!this.h) return null;
          var t = this.h.timeline;
          if (e < this.j || e >= this.l) return null;
          for (var n = t.length - 1, r = 0; r < t.length; r++) {
            var i = t[r], o = i.start + this.j;
            if (i = r < n ? t[r + 1].start + this.j : this.l === 1 / 0 ? i.end + this.j : this.l, e >= o && e < i) return r + this.i;
          }
          return null;
        }, f.get = function(e) {
          var t = this;
          if (e -= this.i, e < 0 || e >= this.getNumReferences() || !this.h) return null;
          var n = this.g[e];
          if (!n) {
            n = this.h.timeline[e];
            var r = n.Tk, i = n.Md + this.h.ed, o = this.j - this.h.hc, s = this.j + n.end, u = s;
            e === this.getNumReferences() - 1 && this.l !== 1 / 0 && (u = this.F && Math.abs(u - this.l) > 0.1 ? Math.min(u, this.l) : this.l);
            var a = this.h.codecs, l = this.h.mimeType, c = this.h.bandwidth, d = [], h = !1;
            if (n.xc && this.h && this.h.dc && (h = this.h.dc.includes("$SubNumber$")), h) {
              h = (n.end - n.start) / n.xc;
              for (var p = {}, g = 0; g < n.xc; p = {
                Qf: void 0,
                $i: void 0
              }, g++) {
                var w = n.start + h * g, T = w + h;
                p.$i = g, p.Qf = null, p = new se(this.j + w, this.j + T, /* @__PURE__ */ (function(E) {
                  return function() {
                    return t.h ? (E.Qf == null && (E.Qf = A1(t.h.dc, t.H, r, t.C, i, E.$i, t.G, t.J)), E.Qf) : [];
                  };
                })(p), 0, null, this.u, o, this.j, this.l, [], "", null, null, Yr, this.B), p.codecs = a, p.mimeType = l, p.bandwidth = c, this.I == 0 ? g > 0 && p.wd() : g % this.I != 0 && p.wd(), d.push(p);
              }
            }
            n = new se(
              this.j + n.start,
              u,
              function() {
                return d.length > 0 || !t.h ? [] : A1(t.h.dc, t.H, r, t.C, i, null, t.G, t.J);
              },
              0,
              null,
              this.u,
              o,
              this.j,
              this.l,
              d,
              "",
              null,
              null,
              Yr,
              this.B,
              d.length > 0
            ), n.codecs = a, n.mimeType = l, n.j = s, n.bandwidth = c, this.g[e] = n;
          }
          return n;
        }, f.Hb = function(e) {
          Fh(this);
          for (var t = 0; t < this.getNumReferences(); t++) {
            var n = this.get(t + this.i);
            n && e(n);
          }
        };
        function A1(e, t, n, r, i, o, s, u) {
          return e = Wu(e, t, n, o, r || null, i), bt(s(), [e], u()).map(function(a) {
            return a.toString();
          });
        }
        f.Ve = function() {
          return this.K;
        };
        function vs(e) {
          this.o = null, this.B = e, this.H = new Vo(), this.i = [], this.h = null, this.m = [], this.C = null, this.G = [], this.F = 300, this.l = /* @__PURE__ */ new Map(), this.j = /* @__PURE__ */ new Map(), this.g = null, this.u = "UNKNOWN";
        }
        vs.prototype.configure = function(e) {
          this.o = e;
        }, vs.prototype.destroy = function() {
          return this.B = this.o = null, this.i = [], this.h = null, this.m = [], this.G = [], this.l.clear(), this.g != null && (this.g.stop(), this.g = null), this.H.destroy();
        }, vs.prototype.setManifestType = function(e) {
          this.u = e;
        };
        function Xu(e, t) {
          var n, r, i, o, s, u, a;
          return D(function(l) {
            if (l.g == 1) return n = bt(e.i, [xM(e, t)]), r = At(n, e.o.retryParameters), i = e.B.networkingEngine.request(8, r), eo(e.H, i), de(l, 2), x(l, i.promise, 4);
            if (l.g != 2) return o = l.h, s = dt(o.data), u = JSON.parse(s), u.VERSION == 1 && AM(e, u, o.uri), ye(l, 0);
            if ((a = he(l)) && a.code == 7001) return l.return();
            e.g != null && (e.g.stop(), e.g = null), e.g = new Ae(function() {
              Xu(e, t);
            }), e.g.ka(e.F), q(l);
          });
        }
        function xM(e, t) {
          if (!e.m.length) return t;
          t = new yt(t);
          var n = e.C || e.m[0], r = Math.round(e.B.getBandwidthEstimate()), i = t.g;
          return e.u == "DASH" ? (i.add("_DASH_pathway", n), i.add("_DASH_throughput", String(r))) : e.u == "HLS" && (i.add("_HLS_pathway", n), i.add("_HLS_throughput", String(r))), Sa(i), i.Vd && Io(t, i), t.toString();
        }
        function AM(e, t, n) {
          e.g != null && (e.g.stop(), e.g = null);
          var r = t["RELOAD-URI"] || n;
          e.g = new Ae(function() {
            Xu(e, r);
          }), (n = t.TTL) && (e.F = n), e.g.ka(e.F), e.m = t["PATHWAY-PRIORITY"] || [], e.G = t["PATHWAY-CLONES"] || [];
        }
        function ys(e, t, n, r) {
          var i = e.l.get(t);
          i || (i = /* @__PURE__ */ new Map()), i.set(n, r), e.l.set(t, i);
        }
        vs.prototype.banLocation = function(e) {
          this.j.set(e, Date.now() + 6e4);
        };
        function qu(e, t, n) {
          n = n === void 0 ? !1 : n, t = e.l.get(t) || /* @__PURE__ */ new Map();
          for (var r = [], i = m(e.m), o = i.next(), s = {}; !o.done; s = { Cd: void 0 }, o = i.next()) if (s.Cd = o.value, o = t.get(s.Cd)) r.push({ Yg: s.Cd, location: o });
          else if (o = e.G.find(/* @__PURE__ */ (function(a) {
            return function(l) {
              return l.Ml == a.Cd;
            };
          })(s))) {
            var u = t.get(o["BASE-ID"]);
            u && (o["URI-REPLACEMENT"].lj ? (u = new yt(u), Ta(u, o["URI-REPLACEMENT"].lj), r.push({ Yg: s.Cd, location: u.toString() })) : r.push({ Yg: s.Cd, location: u }));
          }
          for (i = Date.now(), s = m(e.j.keys()), o = s.next(); !o.done; o = s.next()) o = o.value, u = e.j.get(o), i > u && e.j.delete(o);
          if (r = r.filter(function(a) {
            for (var l = m(e.j.keys()), c = l.next(); !c.done; c = l.next()) if (c.value.includes(new yt(a.location).Fb)) return !1;
            return !0;
          }), r.length && (e.C = r[0].Yg), r = r.map(function(a) {
            return a.location;
          }), !r.length && e.h) for (i = m(e.h.split(",")), s = i.next(); !s.done; s = i.next()) (s = t.get(s.value)) && (e.C = e.h, r.push(s));
          if (!r.length) for (t = m(t.values()), i = t.next(); !i.done; i = t.next()) r.push(i.value);
          return n ? r : bt(e.i, r);
        }
        function mn() {
          this.l = [], this.h = [], this.g = [], this.j = [], this.i = [], this.o = !1, this.m = /* @__PURE__ */ new Set();
        }
        f = mn.prototype, f.release = function() {
          for (var e = m(this.h.concat(this.g, this.j, this.i)), t = e.next(); !t.done; t = e.next()) t = t.value, t.segmentIndex && t.segmentIndex.release();
          this.h = [], this.g = [], this.j = [], this.i = [], this.l = [], this.o = !1, this.m.clear();
        }, f.ck = function() {
          return this.l;
        }, f.Jg = function() {
          return this.j.slice();
        }, f.Jj = function() {
          return this.i;
        }, f.Wh = function(e, t) {
          if (e) {
            if (e.type == "audio") for (var n = m(this.h), r = n.next(); !r.done; r = n.next()) r = r.value, r.matchedStreams = r.matchedStreams.filter(function(i) {
              return i !== e;
            });
            else if (e.type == "video") for (n = m(this.g), r = n.next(); !r.done; r = n.next()) r = r.value, r.matchedStreams = r.matchedStreams.filter(function(i) {
              return i !== e;
            }), r.trickModeVideo && (r.trickModeVideo.matchedStreams = r.trickModeVideo.matchedStreams.filter(function(i) {
              return i !== e;
            })), r.dependencyStream && (r.dependencyStream.matchedStreams = r.dependencyStream.matchedStreams.filter(function(i) {
              return i !== e;
            }));
            else if (e.type == xe) for (n = m(this.j), r = n.next(); !r.done; r = n.next()) r = r.value, r.matchedStreams = r.matchedStreams.filter(function(i) {
              return i !== e;
            });
            else if (e.type == "image") for (n = m(this.i), r = n.next(); !r.done; r = n.next()) r = r.value, r.matchedStreams = r.matchedStreams.filter(function(i) {
              return i !== e;
            });
            e.segmentIndex && e.closeSegmentIndex(), this.m.delete(t);
          }
        };
        function E1(e, t) {
          var n = [], r = [], i = [], o = [];
          e = m(e);
          for (var s = e.next(); !s.done; s = e.next()) {
            var u = s.value;
            s = new Map(u.audioStreams.map(function(d) {
              return [Kh(d), d];
            }));
            var a = new Map(u.videoStreams.map(function(d) {
              return [Gh(d), d];
            })), l = new Map(u.textStreams.map(function(d) {
              return [$u(d), d];
            }));
            if (u = new Map(u.imageStreams.map(function(d) {
              return [Ju(d), d];
            })), t) {
              var c = R1(xe);
              l.set($u(c), c), c = R1("image"), u.set(Ju(c), c);
            }
            n.push(s), r.push(a), i.push(l), o.push(u);
          }
          return { Ph: n, jj: r, ej: i, mi: o };
        }
        f.hg = function(e, t, n) {
          n = n === void 0 ? !1 : n;
          var r = this, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B, F, W, z, me;
          return D(function(Q) {
            if (Q.g == 1) {
              if (i = xt, !t && e.length == 1) return o = E1(e, !1), s = o.Ph, u = o.jj, a = o.ej, l = o.mi, r.h = Array.from(s[0].values()), r.g = Array.from(u[0].values()), r.j = Array.from(a[0].values()), r.i = Array.from(l[0].values()), Q.A(2);
              for (c = n ? r.m.size : 0, d = -1, h = 0; h < e.length; h++) p = e[h], r.m.has(p.id) || (r.m.add(p.id), d == -1 && (d = h));
              return d == -1 ? Q.return() : (g = E1(e, !0), w = g.Ph, T = g.jj, E = g.ej, A = g.mi, x(Q, Promise.all([Ni(r, r.h, w, d, ws, Oi, c), Ni(r, r.g, T, d, ws, Oi, c), Ni(r, r.j, E, d, ws, Oi, c), Ni(r, r.i, A, d, ws, Oi, c)]), 2));
            }
            if (I = 0, P = [], r.g.length && r.h.length) for (U = m(r.h), j = U.next(); !j.done; j = U.next()) for (G = j.value, H = m(r.g), B = H.next(); !B.done; B = H.next()) F = B.value, W = Dg(G.drmInfos, F.drmInfos), G.drmInfos.length && F.drmInfos.length && !W.length || (z = (G.bandwidth || 0) + (F.bandwidth || 0), G.dependencyStream && (z += G.dependencyStream.bandwidth || 0), F.dependencyStream && (z += F.dependencyStream.bandwidth || 0), me = I++, P.push({
              id: me,
              language: G.language,
              disabledUntilTime: 0,
              primary: G.primary,
              audio: G,
              video: F,
              bandwidth: z,
              drmInfos: W,
              allowedByApplication: !0,
              allowedByKeySystem: !0,
              decodingInfos: []
            }));
            else for (N = r.g.length ? r.g : r.h, M = m(N), R = M.next(); !R.done; R = M.next()) k = R.value, O = I++, L = k.bandwidth || 0, k.dependencyStream && (L += k.dependencyStream.bandwidth || 0), P.push({
              id: O,
              language: k.language,
              disabledUntilTime: 0,
              primary: k.primary,
              audio: k.type == i.aa ? k : null,
              video: k.type == i.wa ? k : null,
              bandwidth: L,
              drmInfos: k.drmInfos,
              allowedByApplication: !0,
              allowedByKeySystem: !0,
              decodingInfos: []
            });
            r.l = P, q(Q);
          });
        };
        function I1(e) {
          var t, n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H;
          return D(function(B) {
            switch (B.g) {
              case 1:
                if (t = xt, e.length == 1) return B.return(e[0]);
                for (n = e.map(function(F) {
                  return new Map(F.filter(function(W) {
                    return W.type === t.aa;
                  }).map(function(W) {
                    return [Kh(W), W];
                  }));
                }), r = e.map(function(F) {
                  return new Map(F.filter(function(W) {
                    return W.type === t.wa;
                  }).map(function(W) {
                    return [Gh(W), W];
                  }));
                }), i = e.map(function(F) {
                  return new Map(F.filter(function(W) {
                    return W.type === t.Na;
                  }).map(function(W) {
                    return [$u(W), W];
                  }));
                }), o = e.map(function(F) {
                  return new Map(F.filter(function(W) {
                    return W.type === t.Vf;
                  }).map(function(W) {
                    return [Ju(W), W];
                  }));
                }), s = m(i), u = s.next(); !u.done; u = s.next()) a = u.value, l = D1(t.Na), a.set($u(l), l);
                for (c = m(o), d = c.next(); !d.done; d = c.next()) h = d.value, p = D1(t.Vf), h.set(Ju(p), p);
                return g = new mn(), x(B, Ni(g, [], n, 0, mc, vc, 0), 2);
              case 2:
                return w = B.h, x(B, Ni(g, [], r, 0, mc, vc, 0), 3);
              case 3:
                return T = B.h, x(B, Ni(g, [], i, 0, mc, vc, 0), 4);
              case 4:
                return E = B.h, x(B, Ni(g, [], o, 0, mc, vc, 0), 5);
              case 5:
                if (A = B.h, I = 0, T.length && w.length) for (k = m(w), O = k.next(); !O.done; O = k.next()) for (L = O.value, U = m(T), j = U.next(); !j.done; j = U.next()) G = j.value, H = I++, G.variantIds.push(H), L.variantIds.push(H);
                else for (P = T.concat(w), N = m(P), M = N.next(); !M.done; M = N.next()) R = M.value, R.variantIds = [I++];
                return B.return(T.concat(w).concat(E).concat(A));
            }
          });
        }
        function Ni(e, t, n, r, i, o, s) {
          var u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O;
          return D(function(L) {
            switch (L.g) {
              case 1:
                for (u = [], a = 0; a < n.length; a++) a >= r ? u.push(new Set(n[a].values())) : u.push(/* @__PURE__ */ new Set());
                l = m(t), c = l.next();
              case 2:
                if (c.done) {
                  L.A(4);
                  break;
                }
                return d = c.value, x(L, EM(e, d, n, r, o, u, s), 5);
              case 5:
                if (h = L.h, !h) throw new b(2, 4, 4037);
                c = l.next(), L.A(2);
                break;
              case 4:
                for (p = m(u), g = p.next(); !g.done; g = p.next()) for (w = g.value, T = m(w), E = T.next(); !E.done; E = T.next()) A = E.value, (I = IM(e, t, A, n, i, o, u)) && t.push(I);
                for (P = m(u), N = P.next(); !N.done; N = P.next()) for (M = N.value, R = m(M), k = R.next(), O = {}; !k.done; O = { uh: void 0 }, k = R.next()) if (O.uh = k.value, !Hh(O.uh) && t.some(/* @__PURE__ */ (function(U) {
                  return function(j) {
                    return Vh(U.uh, j);
                  };
                })(O))) throw new b(2, 4, 4037);
                return L.return(t);
            }
          });
        }
        function EM(e, t, n, r, i, o, s) {
          return D(function(u) {
            return u.g == 1 ? (k1(e, n, t, s > 0), t.matchedStreams ? t.segmentIndex ? x(u, M1(t, r + s), 2) : u.A(2) : u.return(!1)) : (C1(t, r, i, o, s), u.return(!0));
          });
        }
        function M1(e, t) {
          var n, r, i, o, s, u;
          return D(function(a) {
            if (a.g == 1) {
              for (n = [], r = e.matchedStreams, i = t; i < r.length; i++) o = r[i], n.push(o.createSegmentIndex()), o.trickModeVideo && !o.trickModeVideo.segmentIndex && n.push(o.trickModeVideo.createSegmentIndex()), o.dependencyStream && !o.dependencyStream.segmentIndex && n.push(o.dependencyStream.createSegmentIndex());
              return x(a, Promise.all(n), 2);
            }
            if (e.segmentIndex instanceof pt) for (s = t; s < r.length; s++) u = r[s], u.segmentIndex && e.segmentIndex.h.push(u.segmentIndex);
            q(a);
          });
        }
        function IM(e, t, n, r, i, o, s) {
          if (Hh(n)) return null;
          var u = i(n);
          return k1(e, r, u), u.createSegmentIndex && (u.createSegmentIndex = function() {
            return D(function(a) {
              return u.segmentIndex ? a.A(0) : (u.segmentIndex = new pt(), x(a, M1(u, 0), 0));
            });
          }, u.closeSegmentIndex = function() {
            if (u.segmentIndex && (u.segmentIndex.release(), u.segmentIndex = null), u.matchedStreams) for (var a = m(u.matchedStreams), l = a.next(); !l.done; l = a.next()) {
              l = l.value;
              var c;
              if (c = l.segmentIndex) {
                e: {
                  c = m(t);
                  for (var d = c.next(); !d.done; d = c.next()) if (d = d.value, d !== u && d.segmentIndex && d.matchedStreams && d.matchedStreams.includes(l)) {
                    c = !0;
                    break e;
                  }
                  c = !1;
                }
                c = !c;
              }
              c && (l.segmentIndex.release(), l.segmentIndex = null);
            }
          }), !u.matchedStreams || !u.matchedStreams.length ? null : (C1(u, 0, o, s, 0), u);
        }
        function C1(e, t, n, r, i) {
          var o = e.matchedStreams;
          for (t += i; t < o.length; t++) {
            var s = o[t];
            n(e, s);
            var u = !0;
            if (e.type == "audio" && Ji(e.language, s.language) == 0 && (u = !1), u && ((u = r[t - i]) && u.delete(s), s.fullMimeTypes)) for (s = m(s.fullMimeTypes.values()), u = s.next(); !u.done; u = s.next()) e.fullMimeTypes.add(u.value);
          }
        }
        function ws(e) {
          var t = Object.assign({}, e);
          return t.originalId = null, t.createSegmentIndex = function() {
            return Promise.resolve();
          }, t.closeSegmentIndex = function() {
          }, t.roles = t.roles.slice(), t.segmentIndex = null, t.emsgSchemeIdUris = [], t.keyIds = new Set(e.keyIds), t.closedCaptions = e.closedCaptions ? new Map(e.closedCaptions) : null, t.trickModeVideo = null, t.dependencyStream = null, t;
        }
        function mc(e) {
          var t = Object.assign({}, e);
          return t.roles = t.roles.slice(), t.keyIds = new Set(e.keyIds), t.segments = [], t.variantIds = [], t.closedCaptions = e.closedCaptions ? new Map(e.closedCaptions) : null, t;
        }
        function Oi(e, t) {
          function n(s, u) {
            s || (s = []), u = m(u);
            for (var a = u.next(); !a.done; a = u.next()) a = a.value, s.includes(a) || s.push(a);
            return s;
          }
          e.roles = n(e.roles, t.roles), t.emsgSchemeIdUris && (e.emsgSchemeIdUris = n(e.emsgSchemeIdUris, t.emsgSchemeIdUris));
          for (var r = m(t.keyIds), i = r.next(); !i.done; i = r.next()) e.keyIds.add(i.value);
          if (e.originalId == null ? e.originalId = t.originalId : (r = t.originalId || "") && !e.originalId.endsWith(r) && (e.originalId += "," + r), r = Dg(e.drmInfos, t.drmInfos), t.drmInfos.length && e.drmInfos.length && !r.length) throw new b(
            2,
            4,
            4038
          );
          if (e.drmInfos = r, e.encrypted = e.encrypted || t.encrypted, t.closedCaptions) for (e.closedCaptions || (e.closedCaptions = /* @__PURE__ */ new Map()), r = m(t.closedCaptions), i = r.next(); !i.done; i = r.next()) {
            var o = m(i.value);
            i = o.next().value, o = o.next().value, e.closedCaptions.set(i, o);
          }
          e.bandwidth && t.bandwidth && (e.bandwidth = Math.max(e.bandwidth, t.bandwidth)), t.trickModeVideo ? (e.trickModeVideo || (e.trickModeVideo = ws(t.trickModeVideo), e.trickModeVideo.matchedStreams = [], e.trickModeVideo.createSegmentIndex = function() {
            if (e.trickModeVideo.segmentIndex) return Promise.resolve();
            for (var s = new pt(), u = m(e.trickModeVideo.matchedStreams), a = u.next(); !a.done; a = u.next()) s.h.push(a.value.segmentIndex);
            return e.trickModeVideo.segmentIndex = s, Promise.resolve();
          }), e.trickModeVideo.matchedStreams.push(t.trickModeVideo), Oi(e.trickModeVideo, t.trickModeVideo)) : e.trickModeVideo && (e.trickModeVideo.matchedStreams.push(t), Oi(e.trickModeVideo, t)), t.dependencyStream ? (e.dependencyStream || (e.dependencyStream = ws(t.dependencyStream), e.dependencyStream.matchedStreams = [], e.dependencyStream.createSegmentIndex = function() {
            if (e.dependencyStream.segmentIndex) return Promise.resolve();
            for (var s = new pt(), u = m(e.dependencyStream.matchedStreams), a = u.next(); !a.done; a = u.next()) s.h.push(a.value.segmentIndex);
            return e.dependencyStream.segmentIndex = s, Promise.resolve();
          }), e.dependencyStream.matchedStreams.push(t.dependencyStream), Oi(e.dependencyStream, t.dependencyStream)) : e.dependencyStream && (e.dependencyStream.matchedStreams.push(t), Oi(e.dependencyStream, t));
        }
        function vc(e, t) {
          var n = e.roles;
          n || (n = []);
          for (var r = m(t.roles), i = r.next(); !i.done; i = r.next()) i = i.value, n.includes(i) || n.push(i);
          for (e.roles = n, n = m(t.keyIds), r = n.next(); !r.done; r = n.next()) e.keyIds.add(r.value);
          if (e.encrypted = e.encrypted && t.encrypted, e.segments.push.apply(e.segments, X(t.segments)), t.closedCaptions) for (e.closedCaptions || (e.closedCaptions = /* @__PURE__ */ new Map()), t = m(t.closedCaptions), n = t.next(); !n.done; n = t.next()) r = m(n.value), n = r.next().value, r = r.next().value, e.closedCaptions.set(n, r);
        }
        function k1(e, t, n, r) {
          r = r !== void 0 && r ? n.matchedStreams : [], t = m(t);
          for (var i = t.next(); !i.done; i = t.next()) {
            if (i = MM(e, i.value, n), !i) return;
            r.push(i);
          }
          n.matchedStreams = r;
        }
        function MM(e, t, n) {
          var r = { audio: Kh, video: Gh, text: $u, image: Ju }[n.type], i = null, o = r(n);
          if (t.has(o)) i = t.get(o);
          else {
            o = { audio: function(l, c) {
              return Vh(l, c);
            }, video: function(l, c) {
              return Vh(l, c);
            }, text: CM, image: kM }[n.type];
            for (var s = { audio: PM, video: DM, text: RM, image: LM }[n.type], u = m(t.values()), a = u.next(); !a.done; a = u.next()) a = a.value, !o(n, a) || n.fastSwitching != a.fastSwitching || i && !s(n, i, a) || (i = a);
          }
          return e.o && !Hh(i) && t.delete(r(i)), i;
        }
        function P1(e, t) {
          return e.mimeType != t.mimeType ? !1 : N1(e.codecs) === N1(t.codecs);
        }
        f.Ui = function(e) {
          this.o = e;
        };
        function Vh(e, t) {
          return !(e.drmInfos && !Pg(e.drmInfos, t.drmInfos));
        }
        function CM(e, t) {
          return t.language ? !(e.forced !== t.forced || Ji(e.language, t.language) == 0 || t.kind != e.kind) : !0;
        }
        function kM() {
          return !0;
        }
        function PM(e, t, n) {
          var r = L1(e, t, n);
          if (r === Cn) return !0;
          if (r === Jn) return !1;
          r = Ji(e.language, t.language);
          var i = Ji(e.language, n.language);
          if (i > r) return !0;
          if (i < r) return !1;
          if (t.label !== n.label) {
            if (e.label === t.label) return !1;
            if (e.label === n.label) return !0;
          }
          if (e.roles.length) {
            if (r = t.roles.filter(function(o) {
              return e.roles.includes(o);
            }), i = n.roles.filter(function(o) {
              return e.roles.includes(o);
            }), i.length > r.length) return !0;
            if (i.length < r.length) return !1;
            if (n.roles.length !== t.roles.length) return n.roles.length < t.roles.length;
          } else {
            if (!n.roles.length && t.roles.length) return !0;
            if (n.roles.length && !t.roles.length) return !1;
          }
          return !t.primary && n.primary ? !0 : t.primary && !n.primary ? !1 : (r = Yu(e.channelsCount, t.channelsCount, n.channelsCount), r == Cn ? !0 : r == Jn ? !1 : (r = Yu(e.audioSamplingRate, t.audioSamplingRate, n.audioSamplingRate), r == Cn ? !0 : r == Jn ? !1 : !!(e.bandwidth && b1(e.bandwidth, t.bandwidth, n.bandwidth) == Cn)));
        }
        function DM(e, t, n) {
          var r = L1(e, t, n);
          if (r === Cn) return !0;
          if (r === Jn) return !1;
          if (r = Yu(e.width * e.height, t.width * t.height, n.width * n.height), r == Cn) return !0;
          if (r == Jn) return !1;
          if (e.frameRate) {
            if (r = Yu(e.frameRate, t.frameRate, n.frameRate), r == Cn) return !0;
            if (r == Jn) return !1;
          }
          return !!(e.bandwidth && b1(e.bandwidth, t.bandwidth, n.bandwidth) == Cn);
        }
        function RM(e, t, n) {
          var r = Ji(e.language, t.language), i = Ji(e.language, n.language);
          if (i > r) return !0;
          if (i < r) return !1;
          if (!t.primary && n.primary) return !0;
          if (t.primary && !n.primary) return !1;
          if (t.label !== n.label) {
            if (e.label === t.label) return !1;
            if (e.label === n.label) return !0;
          }
          if (e.roles.length) {
            if (r = t.roles.filter(function(o) {
              return e.roles.includes(o);
            }), i = n.roles.filter(function(o) {
              return e.roles.includes(o);
            }), i.length > r.length) return !0;
            if (i.length < r.length) return !1;
          } else {
            if (!n.roles.length && t.roles.length) return !0;
            if (n.roles.length && !t.roles.length) return !1;
          }
          return !(n.mimeType != e.mimeType || n.codecs != e.codecs || t.mimeType == e.mimeType && t.codecs == e.codecs);
        }
        function LM(e, t, n) {
          return Yu(e.width * e.height, t.width * t.height, n.width * n.height) == Cn;
        }
        function D1(e) {
          return { id: 0, originalId: "", groupId: null, primary: !1, type: e, mimeType: "", codecs: "", language: "", originalLanguage: null, label: null, width: null, height: null, encrypted: !1, keyIds: /* @__PURE__ */ new Set(), segments: [], variantIds: [], roles: [], forced: !1, channelsCount: null, audioSamplingRate: null, spatialAudio: !1, closedCaptions: null, external: !1, fastSwitching: !1, isAudioMuxedInVideo: !1, baseOriginalId: null };
        }
        function R1(e) {
          return {
            id: 0,
            originalId: "",
            groupId: null,
            createSegmentIndex: function() {
              return Promise.resolve();
            },
            segmentIndex: new Ue([]),
            mimeType: "",
            codecs: "",
            encrypted: !1,
            drmInfos: [],
            keyIds: /* @__PURE__ */ new Set(),
            language: "",
            originalLanguage: null,
            label: null,
            type: e,
            primary: !1,
            trickModeVideo: null,
            dependencyStream: null,
            emsgSchemeIdUris: null,
            roles: [],
            forced: !1,
            channelsCount: null,
            audioSamplingRate: null,
            spatialAudio: !1,
            closedCaptions: null,
            accessibilityPurpose: null,
            external: !1,
            fastSwitching: !1,
            fullMimeTypes: /* @__PURE__ */ new Set(),
            isAudioMuxedInVideo: !1,
            baseOriginalId: null
          };
        }
        function Yu(e, t, n) {
          if (t == e && e != n) return Jn;
          if (n == e && e != t) return Cn;
          if (t > e) {
            if (n <= e || n - e < t - e) return Cn;
            if (n - e > t - e) return Jn;
          } else {
            if (n > e) return Jn;
            if (e - n < e - t) return Cn;
            if (e - n > e - t) return Jn;
          }
          return Wh;
        }
        function L1(e, t, n) {
          var r = e.mimeType === t.mimeType && e.codecs === t.codecs, i = e.mimeType === n.mimeType && e.codecs === n.codecs;
          return r && !i ? Jn : !r && i ? Cn : (t = P1(e, t), e = P1(e, n), t && !e ? Jn : !t && e ? Cn : Wh);
        }
        function b1(e, t, n) {
          return t = Math.abs(e - t), e = Math.abs(e - n), e < t ? Cn : t < e ? Jn : Wh;
        }
        function Hh(e) {
          switch (e.type) {
            case xe:
              return !e.language;
            case "image":
              return !e.tilesLayout;
            default:
              return !1;
          }
        }
        function Gh(e) {
          return yc([e.fastSwitching, e.width, e.frameRate, e.codecs, e.mimeType, e.label, e.roles, e.closedCaptions ? Array.from(e.closedCaptions.entries()) : null, e.bandwidth, e.dependencyStream ? e.dependencyStream.baseOriginalId : null, Array.from(e.keyIds)]);
        }
        function Kh(e) {
          return yc([e.fastSwitching, e.channelsCount, e.language, e.bandwidth, e.label, e.codecs, e.mimeType, e.roles, e.audioSamplingRate, e.primary, e.dependencyStream ? e.dependencyStream.baseOriginalId : null, Array.from(e.keyIds)]);
        }
        function $u(e) {
          return yc([e.language, e.label, e.codecs, e.mimeType, e.bandwidth, e.roles]);
        }
        function Ju(e) {
          return yc([e.width, e.codecs, e.mimeType]);
        }
        function yc(e) {
          return JSON.stringify(e);
        }
        function N1(e) {
          if (!zh.has(e)) {
            var t = Kt(e);
            zh.set(e, t);
          }
          return zh.get(e);
        }
        Y("shaka.util.PeriodCombiner", mn), mn.prototype.setUseStreamOnce = mn.prototype.Ui, mn.prototype.combinePeriods = mn.prototype.hg, mn.prototype.deleteStream = mn.prototype.Wh, mn.prototype.getImageStreams = mn.prototype.Jj, mn.prototype.getTextStreams = mn.prototype.Jg, mn.prototype.getVariants = mn.prototype.ck;
        var Cn = 1, Wh = 0, Jn = -1, zh = /* @__PURE__ */ new Map();
        function bM(e, t) {
          var n = new DOMParser(), r = NM.value()(e);
          e = null;
          try {
            e = n.parseFromString(r, "text/xml");
          } catch {
            return null;
          }
          if (n = e.documentElement, !n || n.getElementsByTagName("parsererror").length || n.tagName != t) return null;
          if (!("createNodeIterator" in document)) return n;
          for (t = document.createNodeIterator(e, NodeFilter.SHOW_ALL); e = t.nextNode(); ) if (e instanceof HTMLElement || e instanceof SVGElement) return null;
          return n;
        }
        function O1(e, t) {
          try {
            var n = Mr(e);
            return bM(n, t);
          } catch {
            return null;
          }
        }
        var NM = new ct(function() {
          if (typeof trustedTypes < "u") {
            var e = trustedTypes.createPolicy("shaka-player#xml", { createHTML: function(t) {
              return t;
            } });
            return function(t) {
              return e.createHTML(t);
            };
          }
          return function(t) {
            return t;
          };
        });
        function Qu() {
          var e = this;
          this.j = this.g = null, this.B = [], this.h = null, this.Fa = 1, this.H = [], this.l = { tf: "", type: "", profiles: [], vc: null, rb: 0, bb: null, pe: 0 }, this.u = /* @__PURE__ */ new Map(), this.C = /* @__PURE__ */ new Map(), this.o = /* @__PURE__ */ new Map(), this.F = /* @__PURE__ */ new Map(), this.za = /* @__PURE__ */ new Map(), this.m = new mn(), this.K = 0, this.Da = new Eo(5), this.M = new Ae(function() {
            if (e.J && !e.g.continueLoadingWhenPaused && (e.I.Ma(e.J, "timeupdate"), e.J.paused)) {
              e.I.Aa(e.J, "timeupdate", function() {
                return H1(e);
              });
              return;
            }
            H1(e);
          }), this.R = new Vo(), this.O = null, this.G = [], this.ba = 1 / 0, this.va = !1, this.i = null, this.N = 0, this.T = !1, this.I = new Ve(), this.J = null, this.W = !1, this.$ = "", this.oa = function() {
            return !1;
          }, this.X = [], this.ma = /* @__PURE__ */ new Set(), this.ya = new c1();
        }
        f = Qu.prototype, f.configure = function(e, t) {
          var n = this.j && e.updatePeriod != this.g.updatePeriod && e.updatePeriod >= 0;
          this.g = e, t && (this.oa = t), n && this.h && this.h.presentationTimeline.U() && this.M.Cb(), this.i && this.i.configure(this.g), this.m && this.m.Ui(this.g.dash.useStreamOnceInPeriodFlattening);
        }, f.start = function(e, t) {
          var n = this, r;
          return D(function(i) {
            if (i.g == 1) return n.va = t.isLowLatencyMode(), n.B = [e], n.j = t, x(i, Xh(n), 2);
            if (r = i.h, n.j && qh(n, r), !n.j) throw new b(2, 7, 7001);
            return i.return(n.h);
          });
        }, f.stop = function() {
          for (var e = m(this.o.values()), t = e.next(); !t.done; t = e.next()) t = t.value, t.segmentIndex && t.segmentIndex.release();
          return this.m && this.m.release(), this.g = this.j = null, this.B = [], this.h = null, this.o.clear(), this.F.clear(), this.u.clear(), this.C.clear(), this.l = { tf: "", type: "", profiles: [], vc: null, rb: 0, bb: null, pe: 0 }, this.m = null, this.M != null && (this.M.stop(), this.M = null), this.i && this.i.destroy(), this.I && (this.I.release(), this.I = null), this.ma.clear(), this.ya.release(), this.R.destroy();
        }, f.update = function() {
          var e = this, t;
          return D(function(n) {
            if (n.g == 1) return de(n, 2), x(n, Xh(e), 4);
            if (n.g != 2) return ye(n, 0);
            if (t = he(n), !e.j || !t) return n.return();
            e.j.onError(t), q(n);
          });
        }, f.onExpirationUpdated = function() {
        }, f.onInitialVariantChosen = function(e) {
          if (this.h && this.h.presentationTimeline.U()) {
            var t = e.video || e.audio;
            if (t && t.segmentIndex) {
              e = this.h.presentationTimeline.Jc();
              var n = t.segmentIndex.find(e);
              n != null && (t = t.segmentIndex.get(n)) && (this.K = t.endTime - e, qh(this, 0));
            }
          }
        }, f.banLocation = function(e) {
          this.i && this.i.banLocation(e);
        }, f.setMediaElement = function(e) {
          this.J = e;
        };
        function Xh(e) {
          var t, n, r, i, o, s, u, a, l, c, d;
          return D(function(h) {
            return h.g == 1 ? (t = 4, n = "MPD", r = YM(e), i = e.B, r.length ? (i = r, n = "Patch", t = 6) : e.B.length > 1 && e.i && (o = qu(e.i, "Location", !0), o.length && (i = o)), s = At(i, e.g.retryParameters), u = Date.now(), x(h, $h(e, s, 0, { type: t }), 2)) : h.g != 3 ? (a = h.h, e.j ? (a.uri && a.uri != a.originalUri && !e.B.includes(a.uri) && e.B.unshift(a.uri), l = new yt(a.uri), e.$ = l.g.toString(), x(h, OM(e, a.data, a.uri, n), 3)) : h.return(0)) : (c = Date.now(), d = (c - u) / 1e3, e.Da.sample(1, d), e.ma.clear(), h.return(d));
          });
        }
        function OM(e, t, n, r) {
          var i, o, s, u, a, l, c, d, h, p;
          return D(function(g) {
            if (g.g == 1) {
              if (i = t, o = e.g.dash.manifestPreprocessor, s = Rl, o != s) {
                if (Ne("manifest.dash.manifestPreprocessor configuration", "Please Use manifest.dash.manifestPreprocessorTXml instead."), u = O1(i, r), !u) throw new b(2, 4, 4001, n);
                o(u), i = sr(u.outerHTML);
              }
              if (a = Xs(i, r), !a) throw new b(2, 4, 4001, n);
              return l = e.g.dash.manifestPreprocessorTXml, c = Ll, l != c && l(a), r === "Patch" ? g.return(jM(e, a)) : e.g.dash.disableXlinkProcessing ? g.return(j1(e, a, n)) : (d = e.g.dash.xlinkFailGracefully, h = gc(a, e.g.retryParameters, d, n, e.j.networkingEngine), eo(e.R, h), x(g, h.promise, 2));
            }
            return p = g.h, g.return(j1(e, p, n));
          });
        }
        function j1(e, t, n) {
          var r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B, F, W, z, me, Q, Be, ve, ze, Ce, Ee, Le, _e, be, Ie, ke, Lt, It, Hn, wn, sn, po, si, pr, Is, Ms, Zc;
          return D(function(gr) {
            switch (gr.g) {
              case 1:
                for (e.i && e.i.l.clear(), r = [n], i = [], o = /* @__PURE__ */ new Map(), s = We(t, "Location"), u = m(s), a = u.next(); !a.done; a = u.next()) l = a.value, c = l.attributes.serviceLocation, (d = tn(l)) && (h = bt(r, [d])[0], c && (e.i ? ys(e.i, "Location", c, h) : o.set(c, h)), i.push(h));
                if (e.i ? (p = qu(e.i, "Location", !0), p.length > 0 && (r = e.B = p)) : i.length && (r = e.B = i), e.l.tf = t.attributes.id || "", e.l.pe = ge(t, "publishTime", Vr) || 0, e.H = We(t, "PatchLocation"), g = Promise.resolve(), (w = ut(t, "ContentSteering")) && e.j)
                  for (T = w.attributes.defaultServiceLocation, e.i ? (e.i.i = r, e.i.h = T) : (e.i = new vs(e.j), e.i.configure(e.g), e.i.setManifestType("DASH"), e.i.i = r, e.i.h = T, (E = tn(w)) && (ge(w, "queryBeforeStart", ba, !1) ? g = Xu(e.i, E) : Xu(e.i, E))), A = m(o.keys()), I = A.next(); !I.done; I = A.next()) P = I.value, N = o.get(P), ys(e.i, "Location", P, N);
                if (M = We(t, "BaseURL"), R = !1, e.i) for (k = m(M), O = k.next(); !O.done; O = k.next()) L = O.value, U = L.attributes.serviceLocation, j = tn(L), U && j && (ys(e.i, "BaseURL", U, j), R = !0);
                if (e.X.splice(0), R && e.i || (G = M.map(tn), e.X.push.apply(e.X, X(bt(r, G)))), H = e.i, B = e.X, F = $M, W = F.call(Qu, H, R, B), e.l.bb = W, z = 0, M && M.length && (z = ge(M[0], "availabilityTimeOffset", La) || 0), e.l.rb = z, e.K = ge(t, "minimumUpdatePeriod", kr, -1), me = ge(t, "availabilityStartTime", Vr), Q = ge(t, "timeShiftBufferDepth", kr), Be = e.g.dash.ignoreSuggestedPresentationDelay, ve = null, Be || (ve = ge(t, "suggestedPresentationDelay", kr)), ze = e.g.dash.ignoreMaxSegmentDuration, Ce = null, ze || (Ce = ge(t, "maxSegmentDuration", kr)), Ee = t.attributes.type || "static", e.h && e.h.presentationTimeline && (e.W = e.h.presentationTimeline.U() && Ee == "static"), e.l.type = Ee, e.h) for (Le = e.h.presentationTimeline, _e = Le.Jb(), be = m(e.o.values()), Ie = be.next(); !Ie.done; Ie = be.next()) ke = Ie.value, ke.segmentIndex && ke.segmentIndex.Ya(_e);
                else Lt = e.g.dash.ignoreMinBufferTime, It = 0, Lt || (It = ge(t, "minBufferTime", kr) || 0), Hn = 0, Hn = ve != null ? Math.min(ve, Q || 1 / 0) : e.g.defaultPresentationDelay > 0 ? e.g.defaultPresentationDelay : Math.min(It * 1.5, Q || 1 / 0), Le = new fe(me, Hn, e.g.dash.autoCorrectDrift);
                return Le.$c(Ee == "static"), Le.U() && !isNaN(e.g.availabilityWindowOverride) && (Q = e.g.availabilityWindowOverride), Q == null && (Q = 1 / 0), Le.If(Q), wn = t.attributes.profiles || "", e.l.profiles = wn.split(","), sn = { Gb: Ee != "static", presentationTimeline: Le, ua: null, na: null, qa: null, L: null, bandwidth: 0, Lg: !1, rb: z, vc: null, profiles: wn.split(","), roles: null, Lb: z1 }, x(gr, g, 2);
              case 2:
                return e.N = 0, po = F1(e, sn, W, t, !1), si = po.duration, pr = po.periods, (Ee != "static" || e.W) && po.Yh || Le.Ab(si || 1 / 0), e.T && e.va && Le.Qi(e.ba), Le.Tg(Ce || 1), e.T && e.va && (Is = ve ?? e.g.defaultPresentationDelay, Le.ph(Is)), e.h ? (e.h.periodCount = pr.length, e.h.gapCount = e.N, x(gr, U1(e, pr, !1), 4)) : x(gr, e.m.hg(pr, sn.Gb), 6);
              case 6:
                var ed = Le, ng = e.m.l, td = e.m.Jg(), Cs = e.m.i, ca = e.g.dash.sequenceMode, Mt = ut(t, "ServiceDescription");
                if (Mt) {
                  var Pn = ut(Mt, "Latency");
                  if (Mt = ut(Mt, "PlaybackRate"), Pn || Mt) {
                    var un = {};
                    Pn && ("target" in Pn.attributes && (un.targetLatency = parseInt(
                      Pn.attributes.target,
                      10
                    ) / 1e3), "max" in Pn.attributes && (un.maxLatency = parseInt(Pn.attributes.max, 10) / 1e3), "min" in Pn.attributes && (un.minLatency = parseInt(Pn.attributes.min, 10) / 1e3)), Mt && ("max" in Mt.attributes && (un.maxPlaybackRate = parseFloat(Mt.attributes.max)), "min" in Mt.attributes && (un.minPlaybackRate = parseFloat(Mt.attributes.min))), Pn = un;
                  } else Pn = null;
                } else Pn = null;
                e: {
                  if (Mt = We(t, "SupplementalProperty"), Mt.length) {
                    for (Mt = m(Mt), un = Mt.next(); !un.done; un = Mt.next()) if (un = un.value, un.attributes.schemeIdUri == "urn:mpeg:dash:chaining:2016") {
                      Mt = un.attributes.value;
                      break e;
                    }
                  }
                  Mt = null;
                }
                if (e.h = { presentationTimeline: ed, variants: ng, textStreams: td, imageStreams: Cs, offlineSessionIds: [], sequenceMode: ca, ignoreManifestTimestampsInSegmentsMode: !1, type: "DASH", serviceDescription: Pn, nextUrl: Mt, periodCount: pr.length, gapCount: e.N, isLowLatency: e.T, startTime: null }, !Le.hj()) {
                  gr.A(7);
                  break;
                }
                return Ms = We(t, "UTCTiming"), x(gr, XM(e, W, Ms), 8);
              case 8:
                if (Zc = gr.h, !e.j) return gr.return();
                Le.Ri(Zc);
              case 7:
                Le.nf(), e.m && !e.h.presentationTimeline.U() && e.m.release();
              case 4:
                e.j.makeTextStreamsForClosedCaptions(e.h), _M(e), BM(e, pr), q(gr);
            }
          });
        }
        function U1(e, t, n) {
          var r;
          return D(function(i) {
            if (i.g == 1) return x(i, e.m.hg(t, !0, n), 2);
            e.h.variants = e.m.l, r = e.m.Jg(), r.length > 0 && (e.h.textStreams = r), e.h.imageStreams = e.m.i, e.j.filter(e.h), q(i);
          });
        }
        function jM(e, t) {
          var n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j;
          return D(function(G) {
            if (G.g == 1) {
              if (n = t.attributes.mpdId, r = ge(t, "originalPublishTime", Vr), !n || n !== e.l.tf || r !== e.l.pe) throw e.H = [], new b(1, 4, 4052);
              for (i = [], o = [], s = /* @__PURE__ */ new Set(), u = m(Fg(t)), a = u.next(); !a.done; a = u.next()) if (l = a.value, c = Na(l.attributes.sel || ""), d = c[c.length - 1], h = tn(l) || "", d.name === "MPD") if (d.Ec === "mediaPresentationDuration") {
                p = tn(l) || "";
                var H = kr(p);
                if (H != null) {
                  e.l.vc = H;
                  for (var B = m(e.u.values()), F = B.next(); !F.done; F = B.next()) F.value.vc = H;
                }
              } else if (d.Ec === "type") {
                for (e.h.presentationTimeline.$c(h == "static"), e.l.type = h, H = m(e.u.values()), B = H.next(); !B.done; B = H.next()) B.value.Gb = h == "dynamic";
                h == "static" && (e.K = -1);
              } else d.Ec === "publishTime" ? e.l.pe = Vr(h) || 0 : d.Ec === null && l.tagName === "add" && o.push(l);
              else if (d.name === "PatchLocation") Hg(e.H, l);
              else if (d.name === "Period") l.tagName === "add" ? o.push(l) : l.tagName === "remove" && d.id && UM(e, d.id);
              else if (d.name === "SegmentTemplate") {
                if (B = Na(l.attributes.sel || ""), H = B[B.length - 1], H.Ec) {
                  B = _1(e, B), F = tn(l) || "";
                  for (var W = m(B), z = W.next(); !z.done; z = W.next()) z = e.u.get(z.value), Kg(z.L.Oc, l.tagName, H.Ec, F);
                  H = B;
                } else H = [];
                for (g = H, w = m(g), T = w.next(); !T.done; T = w.next()) E = T.value, s.add(E);
              } else if (d.name === "SegmentTimeline" || d.name === "S") {
                for (H = Na(l.attributes.sel || ""), H = _1(e, H), B = m(H), F = B.next(); !F.done; F = B.next()) F = e.u.get(F.value), F = gs(F, bi, "SegmentTimeline"), W = We(F, "S"), Hg(W, l), F.children = W;
                for (A = H, I = m(A), P = I.next(); !P.done; P = I.next()) N = P.value, s.add(N);
              }
              for (M = m(s), R = M.next(); !R.done; R = M.next()) k = R.value, B1(
                e,
                k
              );
              for (O = m(o), L = O.next(); !L.done; L = O.next()) U = L.value, i.push.apply(i, X(F1(e, { Gb: e.l.type == "dynamic", presentationTimeline: e.h.presentationTimeline, ua: null, na: null, qa: null, L: null, bandwidth: 0, Lg: !1, rb: e.l.rb, profiles: e.l.profiles, vc: e.l.vc, roles: null, Lb: z1 }, e.l.bb, U, !0).periods));
              return i.length ? (e.h.periodCount += i.length, e.h.gapCount = e.N, x(G, U1(e, i, !0), 2)) : G.A(2);
            }
            e.l.type == "static" && (j = e.l.vc, e.h.presentationTimeline.Ab(j || 1 / 0)), q(G);
          });
        }
        function UM(e, t) {
          e.h.periodCount--;
          for (var n = m(e.u.keys()), r = n.next(); !r.done; r = n.next()) if (r = r.value, r.startsWith(t)) {
            var i = e.u.get(r);
            gs(i, bi, "SegmentTimeline").children = [], B1(e, r), e.u.delete(r);
          }
          e.G = e.G.filter(function(o) {
            return o !== t;
          });
        }
        function _1(e, t) {
          var n = "", r = "", i = -1, o = "";
          t = m(t);
          for (var s = t.next(); !s.done; s = t.next()) s = s.value, s.name === "Period" ? n = s.id : s.name === "AdaptationSet" ? (r = s.id, s.position !== null && (i = s.position)) : s.name === "Representation" && (o = s.id);
          if (t = [], o) t.push(n + "," + o);
          else if (r) for (i = m(e.u.values()), e = i.next(); !e.done; e = i.next()) e = e.value, e.ua.id === n && e.qa.id === r && e.L.id && t.push(n + "," + e.L.id);
          else if (i > -1) for (r = m(e.u.values()), e = r.next(); !e.done; e = r.next()) e = e.value, e.ua.id === n && e.qa.position === i && e.L.id && t.push(n + "," + e.L.id);
          return t;
        }
        function B1(e, t) {
          var n = e.u.get(t), r = e.o.get(t);
          r.segmentIndex && r.segmentIndex.Ya(e.h.presentationTimeline.Jb());
          try {
            var i = S1(n, function(o, s, u, a) {
              return K1(e, o, s, u, a);
            }, e.o, !0, e.g.dash.initialSegmentLimit, e.za, n.L.aesKey, null, !0, e.C);
            r.createSegmentIndex = function() {
              return D(function(o) {
                if (o.g == 1) return r.segmentIndex ? o.A(0) : x(o, i.Sc(), 3);
                r.segmentIndex = o.h, q(o);
              });
            };
          } catch (o) {
            if (t = n.L.contentType, t != xe && t != "application" && t != "image" || o.code != 4002) throw o;
          }
        }
        function F1(e, t, n, r, i) {
          var o = t.vc;
          o || (o = ge(r, "mediaPresentationDuration", kr), e.l.vc = o);
          var s = 0;
          e.h && e.h.presentationTimeline && e.W && (s = e.h.presentationTimeline.$b());
          var u = [], a = s;
          r = We(r, "Period");
          for (var l = 0; l < r.length; l++) {
            var c = r[l], d = r[l + 1], h = ge(c, "start", kr, a), p = c.attributes.id, g = ge(c, "duration", kr);
            h = l == 0 && h == 0 && e.W ? s : h;
            var w = null;
            if (d) {
              var T = ge(d, "start", kr);
              T != null && (w = T - h + s);
            } else o != null && (w = o - h + s);
            if (T = bg, w && g && Math.abs(w - g) > T && w > g && e.N++, w == null && (w = g), !(e.O !== null && p !== null && h !== null && h < e.O) || e.G.includes(p) || l + 1 == r.length) {
              if (h !== null && (e.O === null || h > e.O) && (e.O = h), a = FM(e, t, n, { start: h, duration: w, node: c, hf: w == null || !d }), u.push(a), t.ua.id && w && e.za.set(t.ua.id, w), w == null) {
                a = null;
                break;
              }
              a = h + w;
            }
          }
          if (i) for (t = m(u), n = t.next(); !n.done; n = t.next()) n = n.value.id, e.G.includes(n) || e.G.push(n);
          else e.G = u.map(function(E) {
            return E.id;
          });
          return o != null ? { periods: u, duration: o + s, Yh: !1 } : { periods: u, duration: a, Yh: !0 };
        }
        function _M(e) {
          var t = Array.from(e.F.keys()).filter(function(u) {
            return !e.G.includes(u);
          });
          t = m(t);
          for (var n = t.next(); !n.done; n = t.next()) {
            n = n.value;
            for (var r = !0, i = m(e.F.get(n)), o = i.next(); !o.done; o = i.next()) {
              o = o.value;
              var s = e.o.get(o);
              s && (s.segmentIndex && s.segmentIndex.getNumReferences() != 0 ? r = !1 : (e.m && e.m.Wh(s, n), e.o.delete(o)));
            }
            r && e.F.delete(n);
          }
        }
        function BM(e, t) {
          t = new Set(t.map(function(i) {
            return i.id;
          }));
          for (var n = m(e.C.keys()), r = n.next(); !r.done; r = n.next()) r = r.value, t.has(r) || e.C.delete(r);
        }
        function FM(e, t, n, r) {
          t.ua = Yh(e, r.node, null, n), t.na = r, t.ua.rb = t.rb, t.ua.id || (t.ua.id = "__shaka_period_" + r.start);
          var i = We(r.node, "EventStream");
          n = t.presentationTimeline.Jb(), i = m(i);
          for (var o = i.next(); !o.done; o = i.next()) qM(e, r.start, r.duration, o.value, n);
          for (n = We(r.node, "SupplementalProperty"), n = m(n), i = n.next(); !i.done; i = n.next()) i = i.value, i.attributes.schemeIdUri == "urn:mpeg:dash:urlparam:2014" && (i = Zu(e, i)) && (t.Lb = i);
          if (n = We(r.node, "AdaptationSet").map(function(p, g) {
            return V1(e, t, g, p);
          }).filter(wi), t.Gb) {
            i = [], o = m(n);
            for (var s = o.next(); !s.done; s = o.next()) {
              s = m(s.value.Pk);
              for (var u = s.next(); !u.done; u = s.next()) i.push(u.value);
            }
            if (i.length != new Set(i).size) throw new b(2, 4, 4018);
          }
          for (i = /* @__PURE__ */ new Map(), o = m(n), s = o.next(); !s.done; s = o.next()) for (s = m(s.value.xj), u = s.next(); !u.done; u = s.next()) {
            var a = m(u.value);
            u = a.next().value, a = a.next().value, i.set(u, a);
          }
          if (i.size) for (o = null, s = m(n), u = s.next(); !u.done; u = s.next()) {
            u = u.value, a = [];
            for (var l = m(u.streams), c = l.next(), d = {}; !c.done; d = { wh: void 0 }, c = l.next()) if (d.wh = c.value, i.has(d.wh.originalId)) {
              o || (o = We(r.node, "AdaptationSet").map(function(p, g) {
                return V1(e, t, g, p);
              }).filter(wi)), c = m(o);
              for (var h = c.next(); !h.done; h = c.next()) (h = h.value.streams.find(/* @__PURE__ */ (function(p) {
                return function(g) {
                  return g.originalId == p.wh.originalId;
                };
              })(d))) && (h.dependencyStream = i.get(h.originalId), h.originalId += h.dependencyStream.originalId, a.push(h));
            }
            a.length && u.streams.push.apply(u.streams, X(a));
          }
          if (r = n.filter(function(p) {
            return !p.Eh;
          }), n = n.filter(function(p) {
            return p.Eh;
          }), !e.g.disableIFrames) {
            for (n = m(n), i = n.next(); !i.done; i = n.next()) for (i = i.value, o = i.Eh.split(" "), s = m(r), u = s.next(); !u.done; u = s.next()) if (u = u.value, o.includes(u.id)) for (u = m(u.streams), a = u.next(); !a.done; a = u.next()) hm(a.value, i.streams);
          }
          if (n = wc(e.g.disableAudio, r, "audio"), i = wc(e.g.disableVideo, r, "video"), o = wc(e.g.disableText, r, xe), r = wc(e.g.disableThumbnails, r, "image"), i.length === 0 && n.length === 0) throw new b(2, 4, 4004);
          return { id: t.ua.id, audioStreams: n, videoStreams: i, textStreams: o, imageStreams: r };
        }
        function wc(e, t, n) {
          return e || !t.length ? [] : t.reduce(function(r, i) {
            return i.contentType != n || r.push.apply(r, X(i.streams)), r;
          }, []);
        }
        function V1(e, t, n, r) {
          function i(j) {
            var G = j.attributes["dvb:fontFamily"];
            j = j.attributes["dvb:url"], G && j && (j = bt(t.qa.bb(), [j], t.Lb()), e.j.addFont(G, j[0]));
          }
          function o(j) {
            switch (j) {
              case 1:
              case 5:
              case 6:
              case 7:
                return "srgb";
              case 9:
                return "rec2020";
              case 11:
              case 12:
                return "p3";
            }
          }
          function s(j) {
            switch (j) {
              case 1:
              case 6:
              case 13:
              case 14:
              case 15:
                return "SDR";
              case 16:
                return "PQ";
              case 18:
                return "HLG";
            }
          }
          t.qa = Yh(e, r, t.ua, null), t.qa.position = n;
          var u = !1;
          n = We(r, "Role");
          var a = n.map(function(j) {
            return j.attributes.value;
          }).filter(wi), l = void 0, c = t.qa.contentType == xe;
          c && (l = "subtitle"), n = m(n);
          for (var d = n.next(); !d.done; d = n.next()) {
            d = d.value;
            var h = d.attributes.schemeIdUri;
            if (h == null || h == "urn:mpeg:dash:role:2011") switch (d = d.attributes.value, d) {
              case "main":
                u = !0;
                break;
              case "caption":
              case "subtitle":
                l = d;
            }
          }
          var p = We(r, "EssentialProperty");
          n = null;
          var g = !1;
          d = null, h = !1, p = m(p);
          for (var w = p.next(); !w.done; w = p.next()) {
            w = w.value;
            var T = w.attributes.schemeIdUri;
            if (T == "http://dashif.org/guidelines/trickmode") n = w.attributes.value;
            else if (T == "urn:mpeg:mpegB:cicp:TransferCharacteristics") var E = s(parseInt(w.attributes.value, 10));
            else if (T == "urn:mpeg:mpegB:cicp:ColourPrimaries") var A = o(parseInt(w.attributes.value, 10));
            else T != "urn:mpeg:mpegB:cicp:MatrixCoefficients" && (T == "urn:mpeg:dash:ssr:2023" && e.g.dash.enableFastSwitching ? g = !0 : T == "urn:dvb:dash:fontdownload:2014" ? i(w) : T == "urn:mpeg:dash:urlparam:2014" && (d = Zu(e, w)) || (h = !0));
          }
          if (h) return null;
          var I = null;
          for (h = We(r, "SupplementalProperty"), h = m(h), p = h.next(); !p.done; p = h.next()) p = p.value, w = p.attributes.schemeIdUri, w == "http://dashif.org/guidelines/last-segment-number" ? I = parseInt(p.attributes.value, 10) - 1 : w == "urn:mpeg:mpegB:cicp:TransferCharacteristics" ? E = s(parseInt(p.attributes.value, 10)) : w == "urn:mpeg:mpegB:cicp:ColourPrimaries" ? A = o(parseInt(p.attributes.value, 10)) : w == "urn:dvb:dash:fontdownload:2014" ? i(p) : w == "urn:mpeg:dash:urlparam:2014" && (d = Zu(e, p));
          d && (t.Lb = d), d = We(r, "Accessibility");
          var P = /* @__PURE__ */ new Map(), N;
          for (d = m(d), h = d.next(); !h.done; h = d.next()) if (p = h.value, h = p.attributes.schemeIdUri, p = p.attributes.value, h != "urn:scte:dash:cc:cea-608:2015" || e.g.disableText) if (h != "urn:scte:dash:cc:cea-708:2015" || e.g.disableText) h == "urn:mpeg:dash:role:2011" ? p != null && (a.push(p), p == "captions" && (l = "caption")) : h == "urn:tva:metadata:cs:AudioPurposeCS:2007" && (p == "1" ? N = "visually impaired" : p == "2" ? N = "hard of hearing" : p == "9" && (N = "spoken subtitles"));
          else if (h = 1, p != null) for (p = m(p.split(";")), w = p.next(); !w.done; w = p.next()) {
            T = w.value;
            var M = w = void 0;
            T.includes("=") ? (T = T.split("="), w = "svc" + T[0], M = T[1].split(",")[0].split(":").pop()) : (w = "svc" + h, h++, M = T), P.set(w, He(M));
          }
          else P.set("svc1", "und");
          else if (h = 1, p != null) for (p = p.split(";"), w = m(p), T = w.next(); !T.done; T = w.next()) {
            M = T.value;
            var R = T = void 0;
            M.includes("=") ? (M = M.split("="), T = M[0].startsWith("CC") ? M[0] : "CC" + M[0], R = M[1] || "und") : (T = "CC" + h, p.length == 2 ? h += 2 : h++, R = M), P.set(T, He(R));
          }
          else P.set("CC1", "und");
          d = We(r, "ContentProtection");
          var k = d1(e.ya, d, e.g.ignoreDrmInfo, e.g.dash.keySystemsByURI);
          t.qa.encrypted = d.length > 0;
          var O = He(t.qa.language || "und"), L = t.qa.label, U = /* @__PURE__ */ new Map();
          if (r = We(r, "Representation"), !e.g.ignoreSupplementalCodecs) {
            for (d = [], h = m(r), p = h.next(); !p.done; p = h.next()) w = p.value, (p = Fr(w, "urn:scte:dash:scte214-extensions", "supplementalCodecs")) && (w = ar(w), w.attributes.codecs = p.split(" ").join(","), w.attributes.id && (w.attributes.supplementalId = w.attributes.id + "_supplementalCodecs"), d.push(w));
            r.push.apply(r, X(d));
          }
          if (d = r.map(function(j) {
            var G = VM(e, t, k, l, O, L, u, a, P, j, N, I);
            return G && (G.hdr = G.hdr || E, G.colorGamut = G.colorGamut || A, G.fastSwitching = g, j = j.attributes.dependencyId) ? (G.baseOriginalId = j, U.set(j, G), null) : G;
          }).filter(function(j) {
            return !!j;
          }), d.length == 0 && U.size == 0) {
            if (n = t.qa.contentType == "image", e.g.dash.ignoreEmptyAdaptationSet || c || n) return null;
            throw new b(2, 4, 4003);
          }
          if (!t.qa.contentType || t.qa.contentType == "application") for (t.qa.contentType = W1(d[0].mimeType, d[0].codecs), c = m(d), h = c.next(); !h.done; h = c.next()) h.value.type = t.qa.contentType;
          for (c = t.qa.id || "__fake__" + e.Fa++, h = m(d), p = h.next(); !p.done; p = h.next()) {
            for (p = p.value, w = m(k.drmInfos), T = w.next(); !T.done; T = w.next()) T = T.value, T.keyIds = T.keyIds && p.keyIds ? new Set([].concat(X(T.keyIds), X(p.keyIds))) : T.keyIds || p.keyIds;
            e.g.enableAudioGroups && (p.groupId = c);
          }
          return r = r.map(function(j) {
            return j.attributes.supplementalId || j.attributes.id;
          }).filter(wi), { id: c, contentType: t.qa.contentType, language: O, Dm: u, streams: d, drmInfos: k.drmInfos, Eh: n, Pk: r, xj: U };
        }
        function Zu(e, t) {
          if ((t = zn(t, "urn:mpeg:dash:schema:urlparam:2014", "UrlQueryInfo")) && ge(t, "useMPDUrlQuery", ba, !1)) {
            var n = t.attributes.queryTemplate;
            if (n) return function() {
              return n == "$querypart$" ? e.$ : n.split("&").map(function(r) {
                if (r == "$querypart$") return e.$;
                var i = /\$query:(.*?)\$/g.exec(r);
                if (i && i.length == 2) {
                  i = i[1];
                  var o = new Mo(e.$).get(i);
                  if (o.length) return i + "=" + o[0];
                }
                return r;
              }).join("&");
            };
          }
          return null;
        }
        function VM(e, t, n, r, i, o, s, u, a, l, c, d) {
          t.L = Yh(e, l, t.qa, null);
          var h = t.L.id;
          if (e.ba = Math.min(e.ba, t.L.rb), e.T = e.ba > 0, !zM(t.L)) return null;
          var p = t.na.start;
          t.bandwidth = ge(l, "bandwidth", Pr) || 0, t.roles = u;
          var g = We(l, "SupplementalProperty"), w = We(l, "EssentialProperty"), T = We(l, "ContentProtection");
          l = null;
          var E = w.find(function(B) {
            return B.attributes.schemeIdUri == "urn:mpeg:dash:urlparam:2014";
          });
          (E || (E = g.find(function(B) {
            return B.attributes.schemeIdUri == "urn:mpeg:dash:urlparam:2014";
          }))) && (l = Zu(e, E)), l && (t.Lb = l), E = t.L.contentType, l = E == xe || E == "application", E = E == "image", T.length && (t.qa.encrypted = !0);
          try {
            var A = void 0;
            if (n.dg) {
              var I = t.L.bb, P = t.Lb, N = bt(I(), [n.dg.rk], P()), M = At(N, e.g.retryParameters);
              A = { bitsKey: 128, blockCipherMode: "CBC", iv: n.dg.iv, firstMediaSequenceNumber: 0, fetchKey: function() {
                var B, F, W;
                return D(function(z) {
                  if (z.g == 1) return x(z, $h(e, M, 6), 2);
                  if (z.g != 3) {
                    if (B = z.h, !B.data || B.data.byteLength != 16) throw new b(2, 4, 4049);
                    return F = { name: "AES-CBC" }, W = A, x(z, C.crypto.subtle.importKey(
                      "raw",
                      B.data,
                      F,
                      !0,
                      ["decrypt"]
                    ), 3);
                  }
                  W.cryptoKey = z.h, A.fetchKey = void 0, q(z);
                });
              } };
            }
            if (t.L.aesKey = A, I = function(B, F, W, z) {
              return K1(e, B, F, W, z);
            }, t.L.Jd) var R = dM(t, I, A);
            else if (t.L.Bc) R = hM(t, e.o, A);
            else if (t.L.Oc) R = S1(t, I, e.o, !!e.h, e.g.dash.initialSegmentLimit, e.za, A, d, !1, e.C);
            else {
              var k = t.na.duration || 0, O = t.L.bb, L = t.L.mimeType, U = t.L.codecs;
              R = { endTime: -1, timeline: -1, Sc: function() {
                var B = hl(p, k, O());
                return B.Hb(function(F) {
                  F.mimeType = L, F.codecs = U;
                }), Promise.resolve(B);
              }, timescale: 1 };
            }
          } catch (B) {
            if ((l || E) && B.code == 4002) return null;
            throw B;
          }
          d = J2(e.ya, T, n, e.g.ignoreDrmInfo, e.g.dash.keySystemsByURI), d = new Set(d ? [d] : []), T = !1, g.some(function(B) {
            return B.attributes.schemeIdUri == "tag:dolby.com,2018:dash:EC3_ExtensionType:2018" && B.attributes.value == "JOC";
          }) && (T = !0), g = !1, l && (g = u.includes("forced_subtitle") || u.includes("forced-subtitle"));
          var j;
          if (E && ((w = w.find(function(B) {
            return ["http://dashif.org/thumbnail_tile", "http://dashif.org/guidelines/thumbnail_tile"].includes(B.attributes.schemeIdUri);
          })) && (j = w.attributes.value), !j)) return null;
          var G;
          l = t.L.codecs, t.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10") && (l.includes("hvc1.2.4.L153.B0") || l.includes("hev1.2.4.L153.B0")) && (G = "PQ"), w = t.L.id ? t.ua.id + "," + t.L.id : "", e.H.length && h && e.u.set(t.ua.id + "," + h, GM(t)), t.L.zf && HM(e, t.L.zf, R, t.presentationTimeline), R.endTime != -1 && t.ua.id != null && t.L.id != null && ((h = e.C.get(t.ua.id)) ? (h.endTime = R.endTime, h.eh.includes(t.L.id) || h.eh.push(t.L.id), e.C.set(t.ua.id, h)) : e.C.set(t.ua.id, { endTime: R.endTime, timeline: R.timeline, eh: [t.L.id] }));
          var H = w && e.o.has(w) ? e.o.get(w) : {
            id: e.Fa++,
            originalId: t.L.id,
            groupId: null,
            createSegmentIndex: function() {
              return Promise.resolve();
            },
            closeSegmentIndex: function() {
              H.segmentIndex && (H.segmentIndex.release(), H.segmentIndex = null);
            },
            segmentIndex: null,
            mimeType: t.L.mimeType,
            codecs: l,
            frameRate: t.L.frameRate,
            pixelAspectRatio: t.L.pixelAspectRatio,
            bandwidth: t.bandwidth,
            width: t.L.width,
            height: t.L.height,
            kind: r,
            encrypted: n.drmInfos.length > 0,
            drmInfos: n.drmInfos,
            keyIds: d,
            language: i,
            originalLanguage: t.qa.language,
            label: o,
            type: t.qa.contentType,
            primary: s,
            trickModeVideo: null,
            dependencyStream: null,
            emsgSchemeIdUris: t.L.emsgSchemeIdUris,
            roles: u,
            forced: g,
            channelsCount: t.L.wf,
            audioSamplingRate: t.L.audioSamplingRate,
            spatialAudio: T,
            closedCaptions: a,
            hdr: G,
            colorGamut: void 0,
            videoLayout: void 0,
            tilesLayout: j,
            accessibilityPurpose: c,
            external: !1,
            fastSwitching: !1,
            fullMimeTypes: /* @__PURE__ */ new Set([gt(t.L.mimeType, t.L.codecs)]),
            isAudioMuxedInVideo: !1,
            baseOriginalId: null
          };
          return H.createSegmentIndex = function() {
            var B;
            return D(function(F) {
              if (F.g == 1)
                return H.segmentIndex ? F.A(0) : (B = H, x(F, R.Sc(), 3));
              B.segmentIndex = F.h, q(F);
            });
          }, w && t.Gb && !e.o.has(w) && (t = t.ua.id || "", e.F.has(t) || e.F.set(t, []), e.o.set(w, H), e.F.get(t).push(w)), H;
        }
        function HM(e, t, n, r) {
          if (!e.ma.has(t)) {
            e.ma.add(t);
            var i = ge(t, "presentationTime", _t) || 0, o = ut(t, "UTCTiming"), s;
            (s = o && o.attributes.schemeIdUri) && (o = o.attributes.schemeIdUri, s = !(o === "urn:mpeg:dash:utc:http-ntp:2014" || o === "urn:mpeg:dash:utc:ntp:2014" || o === "urn:mpeg:dash:utc:sntp:2014")), s ? t = (ge(t, "wallClockTime", Vr) || 0) * 1e3 : (t = ge(t, "wallClockTime", _t) || 0, t = dv(t)), n = new Date(t - i / n.timescale * 1e3), i = n.getTime() / 1e3, isNaN(i) || (r.o || r.qh(i), r = (/* @__PURE__ */ new Map()).set("detail", { wallClockTime: t, programStartDate: n }), r = new ee(
              "prft",
              r
            ), e.j.onEvent(r));
          }
        }
        function GM(e) {
          function t(n) {
            return n ? (n = gi(n), n.Jd = null, n.Bc = null, n.Oc = Pd(n.Oc), n.zf = null, n) : null;
          }
          return e = gi(e), e.ua = t(e.ua), e.qa = t(e.qa), e.L = t(e.L), e.na && (e.na = gi(e.na), e.na.node = null), e;
        }
        function H1(e) {
          var t, n;
          return D(function(r) {
            switch (r.g) {
              case 1:
                return t = 0, de(r, 2), x(r, Xh(e), 4);
              case 4:
                t = r.h, ye(r, 3);
                break;
              case 2:
                if (n = he(r), e.j) {
                  if (e.g.raiseFatalErrorOnManifestUpdateRequestFailure) return e.j.onError(n), r.return();
                  n.severity = 1, e.j.onError(n);
                }
              case 3:
                if (!e.j) return r.return();
                e.j.onManifestUpdated(), qh(e, t), q(r);
            }
          });
        }
        function qh(e, t) {
          if (!(e.K < 0)) {
            var n = e.K;
            e.g.updatePeriod >= 0 && (n = e.g.updatePeriod), e.M.ka(Math.max(n - t, va(e.Da)));
          }
        }
        function Yh(e, t, n, r) {
          n = n || { contentType: "", mimeType: "", codecs: "", emsgSchemeIdUris: [], frameRate: void 0, pixelAspectRatio: void 0, wf: null, audioSamplingRate: null, rb: 0, Ff: 1, encrypted: !1 }, r = r || n.bb;
          var i = t.attributes.id, o = t.attributes.supplementalId, s = We(t, "BaseURL"), u, a = !1;
          if (e.i) for (var l = m(s), c = l.next(); !c.done; c = l.next()) {
            var d = c.value;
            c = d.attributes.serviceLocation, d = tn(d), c && d && (ys(e.i, i, c, d), a = !0);
          }
          a && e.i || (u = s.map(tn));
          var h = e.i;
          e = t.attributes.contentType || n.contentType, l = t.attributes.mimeType || n.mimeType, c = Pf([t.attributes.codecs || n.codecs]).join(","), d = ge(t, "frameRate", wx) || n.frameRate;
          var p = t.attributes.sar || n.pixelAspectRatio, g = KM(We(t, "InbandEventStream"), n.emsgSchemeIdUris), w = We(t, "AudioChannelConfiguration");
          w = WM(w) || n.wf;
          var T = ge(t, "audioSamplingRate", _t) || n.audioSamplingRate;
          e || (e = W1(l, c));
          var E = ut(t, "SegmentBase"), A = ut(t, "SegmentTemplate"), I = E && ge(E, "availabilityTimeOffset", La) || 0, P = A && ge(A, "availabilityTimeOffset", La) || 0, N = s && s.length && ge(s[0], "availabilityTimeOffset", La) || 0;
          I = n.rb + N + I + P, P = null, (N = ut(t, "SegmentSequenceProperties")) && (N = ge(N, "cadence", Pr)) && (P = N), N = t.attributes.label;
          var M = We(t, "Label");
          return M && M.length && (M = M[0], wt(M) && (N = wt(M))), {
            bb: function() {
              return bt(r(), s.length ? h && a ? qu(h, i) : u || [] : []);
            },
            Jd: E || n.Jd,
            Bc: ut(t, "SegmentList") || n.Bc,
            Oc: A || n.Oc,
            zf: ut(t, "ProducerReferenceTime") || n.zf,
            width: ge(t, "width", _t) || n.width,
            height: ge(t, "height", _t) || n.height,
            contentType: e,
            mimeType: l,
            codecs: c,
            frameRate: d,
            pixelAspectRatio: p,
            emsgSchemeIdUris: g,
            id: o || i,
            originalId: i,
            language: t.attributes.lang,
            wf: w,
            audioSamplingRate: T,
            rb: I,
            ef: null,
            Ff: P || n.Ff,
            label: N || null,
            encrypted: !1
          };
        }
        function KM(e, t) {
          t = t.slice(), e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) n = n.value.attributes.schemeIdUri, t.includes(n) || t.push(n);
          return t;
        }
        function WM(e) {
          e = m(e);
          for (var t = e.next(); !t.done; t = e.next()) {
            t = t.value;
            var n = t.attributes.schemeIdUri;
            if (n && (t = t.attributes.value)) switch (n) {
              case "urn:mpeg:dash:outputChannelPositionList:2012":
                return t.trim().split(/ +/).length;
              case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":
              case "urn:dts:dash:audio_channel_configuration:2012":
                if (t = parseInt(t, 10), !t) continue;
                return t;
              case "tag:dolby.com,2015:dash:audio_channel_configuration:2015":
                if (n = [2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2], t = parseInt(
                  t,
                  16
                ), !t) continue;
                for (var r = 0, i = 0; i < n.length; i++) t & 1 << i && (r += n[i]);
                if (r) return r;
                continue;
              case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":
              case "urn:dolby:dash:audio_channel_configuration:2011":
                if (n = [1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 1, 1].reverse(), t = parseInt(t, 16), !t) continue;
                for (i = r = 0; i < n.length; i++) t & 1 << i && (r += n[i]);
                if (r) return r;
                continue;
              case "urn:mpeg:mpegB:cicp:ChannelConfiguration":
                if (n = [0, 1, 2, 3, 4, 5, 6, 8, 2, 3, 4, 7, 8, 24, 8, 12, 10, 12, 14, 12, 14], (t = parseInt(t, 10)) && t > 0 && t < n.length) return n[t];
            }
          }
          return null;
        }
        function zM(e) {
          var t = e.Jd ? 1 : 0;
          return t += e.Bc ? 1 : 0, t += e.Oc ? 1 : 0, t == 0 ? e.contentType == xe || e.contentType == "application" : (t != 1 && (e.Jd && (e.Bc = null), e.Oc = null), !0);
        }
        function G1(e, t, n, r) {
          var i, o, s, u, a, l, c;
          return D(function(d) {
            if (d.g == 1) return i = [en(n)], o = bt(t(), i), s = At(o, e.g.retryParameters), s.method = r, u = e.j.networkingEngine.request(4, s, { isPreload: e.oa() }), eo(e.R, u), x(d, u.promise, 2);
            if (a = d.h, r == "HEAD") {
              if (!a.headers || !a.headers.date) return d.return(0);
              l = a.headers.date;
            } else l = dt(a.data);
            return c = Date.parse(l), isNaN(c) ? d.return(0) : d.return(c - Date.now());
          });
        }
        function XM(e, t, n) {
          var r, i, o, s, u, a, l, c;
          return D(function(d) {
            switch (d.g) {
              case 1:
                r = n.map(function(h) {
                  return { scheme: h.attributes.schemeIdUri, value: h.attributes.value };
                }), i = e.g.dash.clockSyncUri, !r.length && i && r.push({ scheme: "urn:mpeg:dash:utc:http-head:2014", value: i }), o = m(r), s = o.next();
              case 2:
                if (s.done) {
                  d.A(4);
                  break;
                }
                switch (u = s.value, de(d, 5), a = u.scheme, l = u.value, a) {
                  case "urn:mpeg:dash:utc:http-head:2014":
                  case "urn:mpeg:dash:utc:http-head:2012":
                    return d.A(7);
                  case "urn:mpeg:dash:utc:http-xsdate:2014":
                  case "urn:mpeg:dash:utc:http-iso:2014":
                  case "urn:mpeg:dash:utc:http-xsdate:2012":
                  case "urn:mpeg:dash:utc:http-iso:2012":
                    return d.A(8);
                  case "urn:mpeg:dash:utc:direct:2014":
                  case "urn:mpeg:dash:utc:direct:2012":
                    return c = Date.parse(l), d.return(isNaN(c) ? 0 : c - Date.now());
                  case "urn:mpeg:dash:utc:http-ntp:2014":
                  case "urn:mpeg:dash:utc:ntp:2014":
                  case "urn:mpeg:dash:utc:sntp:2014":
                    De("NTP UTCTiming scheme is not supported");
                    break;
                  default:
                    De("Unrecognized scheme in UTCTiming element", a);
                }
                d.A(9);
                break;
              case 7:
                return x(d, G1(e, t, l, "HEAD"), 10);
              case 10:
                return d.return(d.h);
              case 8:
                return x(d, G1(e, t, l, "GET"), 11);
              case 11:
                return d.return(d.h);
              case 9:
                ye(
                  d,
                  3
                );
                break;
              case 5:
                he(d);
              case 3:
                s = o.next(), d.A(2);
                break;
              case 4:
                return De("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"), d.return(0);
            }
          });
        }
        function qM(e, t, n, r, i) {
          var o = r.attributes.schemeIdUri || "", s = r.attributes.value || "", u = ge(r, "timescale", _t) || 1, a = ge(r, "presentationTimeOffset", _t) || 0;
          r = m(We(r, "Event"));
          for (var l = r.next(); !l.done; l = r.next()) {
            l = l.value;
            var c = ge(l, "presentationTime", _t) || 0, d = ge(l, "duration", _t) || 0;
            c = Math.max((c - a) / u + t, t), d = c + d / u, n != null && (c = Math.min(c, t + n), d = Math.min(d, t + n)), d < i || (l = { schemeIdUri: o, value: s, startTime: c, endTime: d, id: l.attributes.id || "", timescale: u, eventElement: Wg(l), eventNode: Pd(l) }, e.j.onTimelineRegionAdded(l));
          }
        }
        function K1(e, t, n, r, i) {
          var o, s, u, a;
          return D(function(l) {
            return l.g == 1 ? (o = Xn, s = i ? 0 : 1, u = Su(t, n, r, e.g.retryParameters), x(l, $h(e, u, o, { type: s }), 2)) : (a = l.h, l.return(a.data));
          });
        }
        function W1(e, t) {
          return t = gt(e, t), eu(t) ? xe : e.split("/")[0];
        }
        function $h(e, t, n, r) {
          return r || (r = {}), r.isPreload = e.oa(), t = e.j.networkingEngine.request(n, t, r), eo(e.R, t), t.promise;
        }
        function YM(e) {
          var t = e.l.pe;
          if (!e.l.tf || !t || !e.H.length) return [];
          var n = Date.now() / 1e3, r = e.H.filter(function(i) {
            return i = _t(i.attributes.ttl), !i || t + i > n;
          }).map(tn).filter(wi);
          return r.length ? bt(e.B, r) : [];
        }
        function z1() {
          return "";
        }
        function $M(e, t, n) {
          return function() {
            return e && t ? qu(e, "BaseURL") : n.slice();
          };
        }
        Y("shaka.dash.DashParser", Qu), Ki("application/dash+xml", function() {
          return new Qu();
        }), Ki("video/vnd.mpeg.dash.mpd", function() {
          return new Qu();
        });
        function Tc() {
        }
        Y("shaka.dependencies", Tc), Tc.has = function(e) {
          return Jh.has(e);
        }, Tc.add = function(e, t) {
          if (!q1[e]) throw Error(e + " is not supported");
          e == X1 ? Ne("mux.js", "mux.js is no longer used in Shaka Player.") : Jh.set(e, function() {
            return t;
          });
        };
        var X1 = "muxjs", q1 = { Em: X1, ISOBoxer: "ISOBoxer" };
        Tc.Allowed = q1;
        var Jh = /* @__PURE__ */ new Map([["ISOBoxer", function() {
          return C.ISOBoxer;
        }]]);
        function Ke() {
          this.j = new ct(function() {
            for (var e = navigator.userAgent.toLowerCase(), t = m([{ type: "VR", dh: /oculus|quest/ }, { type: "TV", dh: /smart[ _]?tv|android ?tv/ }, { type: "MOBILE", dh: /iphone|ipad|ipod|android/ }]), n = t.next(); !n.done; n = t.next()) if (n = n.value, n.dh.test(e)) return n.type;
            e = navigator.userAgentData;
            var r;
            if (t = (e == null || (r = e.platform) == null ? void 0 : r.toLowerCase()) || "", e) {
              if (e.mobile) return "MOBILE";
              if (t.includes("android")) return "TV";
            }
            return "DESKTOP";
          }), this.l = new ct(function() {
            var e = navigator.userAgent;
            return navigator.vendor.includes("Apple") && (e.includes("Version/") || e.includes("OS/")) ? "WEBKIT" : e.includes("Edge/") ? "EDGE" : e.includes("Chrome/") ? "CHROMIUM" : e.includes("Firefox/") ? "GECKO" : "UNKNOWN";
          });
        }
        function br() {
          var e = C.ManagedMediaSource || C.MediaSource;
          return !!(e && e.isTypeSupported);
        }
        f = Ke.prototype, f.kc = function() {
          return !!navigator.mediaCapabilities;
        }, f.Oa = function() {
          return this.j.value();
        }, f.Ha = function() {
          return this.l.value();
        }, f.Gd = function() {
          return !1;
        }, f.gh = function() {
          return !1;
        }, f.gf = function() {
          return !1;
        }, f.Ji = function() {
          return !1;
        }, f.re = function() {
          return !1;
        }, f.dd = function() {
          return !0;
        }, f.Bb = function() {
          var e = C.ManagedSourceBuffer || C.SourceBuffer;
          return !!e && !!e.prototype && !!e.prototype.changeType;
        }, f.ve = function() {
          return !0;
        }, f.Oi = function() {
          return 0;
        }, f.nc = function() {
          return Promise.resolve({ width: 1 / 0, height: 1 / 0 });
        }, f.Xi = function() {
          return !1;
        }, f.sh = function() {
          return !1;
        }, f.Wa = function(e) {
          var t = this.Oa();
          return (t === "TV" || t === "CONSOLE" || t === "CAST") && (e.ads.customPlayheadTracker = !0, e.ads.skipPlayDetection = !0, e.ads.supportsMultipleMediaElements = !1), e;
        }, f.yh = function() {
          return !!C.indexedDB;
        }, f.Hi = function() {
          return [];
        }, f.rd = function(e) {
          return C.matchMedia !== void 0 && C.matchMedia("(color-gamut: p3)").matches ? e ? "HLG" : "PQ" : "SDR";
        }, f.dj = function() {
          return !1;
        }, f.xi = function() {
          return !1;
        }, f.Cf = function() {
          return !1;
        }, f.Lf = function() {
          return !0;
        }, f.zi = function() {
          return !1;
        }, f.cj = function() {
          return !0;
        }, f.cd = function() {
          return !1;
        }, f.Sg = function(e) {
          return e === "com.apple.fps";
        }, f.Kf = function() {
          return !0;
        }, f.toString = function() {
          return "Device: " + this.Nb() + " v" + this.Ba() + "; Type: " + this.Oa();
        };
        function Qh() {
          Ke.call(this), this.g = new ct(function() {
            var e = navigator.userAgent.match(/Version\/(\d+)/);
            return e || (e = navigator.userAgent.match(/OS (\d+)(?:_\d+)?/)) ? parseInt(e[1], 10) : null;
          }), this.h = new ct(function() {
            return /(?:iPhone|iPad|iPod)/.test(navigator.userAgent) || navigator.maxTouchPoints > 1 ? "xr" in navigator ? "APPLE_VR" : "MOBILE" : "xr" in navigator ? "APPLE_VR" : "DESKTOP";
          });
        }
        tt(Qh, Ke), f = Qh.prototype, f.Ba = function() {
          return this.g.value();
        }, f.Nb = function() {
          return "Apple Browser";
        }, f.Oa = function() {
          return this.h.value();
        }, f.Ha = function() {
          return "WEBKIT";
        }, f.kc = function() {
          return !1;
        }, f.Gd = function(e, t) {
          return t === "audio";
        }, f.gf = function() {
          return !0;
        }, f.Ji = function(e) {
          return e === "audio";
        }, f.Wa = function(e) {
          return Ke.prototype.Wa.call(this, e), e.abr.minTimeToSwitch = 0.5, e;
        }, f.dj = function() {
          return !0;
        }, f.Kf = function() {
          return !1;
        }, (navigator.vendor || "").includes("Apple") && (/(?:iPhone|iPad|iPod)/.test(navigator.userAgent) || navigator.maxTouchPoints > 1 || navigator.userAgentData && navigator.userAgentData.platform && navigator.userAgentData.platform.toLowerCase() == "macos" || navigator.platform && navigator.platform.toLowerCase().includes("mac")) && (yr = function() {
          return new Qh();
        });
        function Zh() {
          if (!Y1()) throw Error("Not a Chromecast device!");
          Ke.call(this), this.h = new ct(function() {
            var e = navigator.userAgent.match(/Chrome\/(\d+)/);
            return e ? parseInt(e[1], 10) : null;
          }), this.g = new ct(function() {
            var e = navigator.userAgentData && navigator.userAgentData.platform || navigator.userAgent;
            return e = e.toLowerCase(), e.includes("android") ? $1 : e.includes("fuchsia") ? J1 : ep;
          });
        }
        tt(Zh, Ke), f = Zh.prototype, f.Ba = function() {
          return this.h.value();
        }, f.Nb = function() {
          return "Chromecast with " + this.g.value();
        }, f.Oa = function() {
          return "CAST";
        }, f.Ha = function() {
          return "CHROMIUM";
        }, f.kc = function() {
          return Ke.prototype.kc.call(this) && this.g.value() !== ep;
        }, f.Bb = function() {
          return Ke.prototype.Bb.call(this) && this.g.value() !== ep;
        }, f.Oi = function() {
          switch (this.g.value()) {
            case $1:
              return 0;
            case J1:
              return 3;
            default:
              return 1;
          }
        }, f.nc = function() {
          var e, t, n, r, i;
          return D(function(o) {
            switch (o.g) {
              case 1:
                if (e = C.cast && cast.__platform__ && cast.__platform__.canDisplayType, t = { width: 1280, height: 720 }, de(o, 2), !(n = e)) {
                  o.A(4);
                  break;
                }
                return x(o, cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'), 5);
              case 5:
                n = o.h;
              case 4:
                if (n) {
                  t.width = 3840, t.height = 2160, o.A(6);
                  break;
                }
                if (!(r = e)) {
                  o.A(7);
                  break;
                }
                return x(o, cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'), 8);
              case 8:
                r = o.h;
              case 7:
                r && (t.width = 1920, t.height = 1080);
              case 6:
                ye(o, 3);
                break;
              case 2:
                i = he(o), Ir("Failed to check canDisplayType:", i);
              case 3:
                return o.return(t);
            }
          });
        }, f.Wa = function(e) {
          return Ke.prototype.Wa.call(this, e), e.streaming.stallSkip = 0, e;
        }, f.yh = function() {
          return !1;
        }, f.cd = function() {
          return !0;
        };
        function Y1() {
          return navigator.userAgent.includes("CrKey") && !navigator.userAgent.includes("VIZIO SmartCast");
        }
        var $1 = "Android", J1 = "Fuchsia", ep = "Linux";
        Y1() && (yr = function() {
          return new Zh();
        });
        function tp() {
          Ke.call(this);
          var e = this;
          this.i = new ct(function() {
            var t = navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);
            return t ? parseInt(t[2], 10) : null;
          }), this.g = new ct(function() {
            return navigator.userAgent.match(/Edge?\//) ? "Edge" : navigator.userAgent.includes("Chrome") ? "Chrome" : navigator.userAgent.includes("Firefox") ? "Firefox" : "Unknown";
          }), this.h = new ct(function() {
            return navigator.userAgentData && navigator.userAgentData.platform ? navigator.userAgentData.platform.toLowerCase() == "windows" : navigator.platform ? navigator.platform.toLowerCase().includes("win32") : !1;
          }), this.u = new ct(function() {
            return Ke.prototype.Bb.call(e) ? navigator.userAgent.match(/Edge?\//) ? !e.h.value() : !0 : !1;
          }), this.o = new ct(function() {
            return navigator.userAgent.includes("sony.hbbtv.tv");
          }), this.m = new ct(function() {
            return navigator.userAgentData && navigator.userAgentData.platform ? navigator.userAgentData.platform.toLowerCase() == "android" : !!navigator.userAgent.includes("Android");
          });
        }
        tt(tp, Ke), f = tp.prototype, f.Ba = function() {
          return this.i.value();
        }, f.Nb = function() {
          return this.g.value();
        }, f.Gd = function(e) {
          return xa(e) ? this.g.value() === "Edge" && this.h.value() : !1;
        }, f.gh = function() {
          return this.g.value() === "Edge" && this.h.value();
        }, f.gf = function() {
          return this.g.value() === "Edge" && this.h.value();
        }, f.Bb = function() {
          return this.u.value();
        }, f.Wa = function(e) {
          if (Ke.prototype.Wa.call(this, e), this.h.value()) switch (this.g.value()) {
            case "Firefox":
              e.drm.keySystemsMapping = { "com.microsoft.playready": "com.microsoft.playready.recommendation" };
              break;
            case "Chrome":
              e.drm.keySystemsMapping = { "com.microsoft.playready": "com.microsoft.playready.recommendation.3000", "com.microsoft.playready.recommendation": "com.microsoft.playready.recommendation.3000" };
          }
          return this.m.value() && (e.drm.defaultAudioRobustnessForWidevine = "", e.drm.defaultVideoRobustnessForWidevine = ""), e;
        }, f.Cf = function() {
          return this.g.value() === "Edge" || this.o.value();
        }, f.cd = function() {
          if (this.Ha() === "GECKO") {
            var e = this.Ba();
            return e !== null ? e >= 100 : Ke.prototype.cd.call(this);
          }
          return Ke.prototype.cd.call(this);
        }, f.Sg = function(e) {
          return this.Ha() === "GECKO" ? e.startsWith("com.microsoft.playready.recommendation") : Ke.prototype.Sg.call(this, e);
        }, md = function() {
          return new tp();
        };
        function np() {
          Ke.apply(this, arguments);
        }
        tt(np, Ke), f = np.prototype, f.Ba = function() {
          return null;
        }, f.Nb = function() {
          return "Hisense";
        }, f.Oa = function() {
          return "TV";
        }, f.kc = function() {
          return !1;
        }, f.Bb = function() {
          return !1;
        }, f.nc = function() {
          var e = { width: 1920, height: 1080 }, t = null;
          if (C.Hisense_Get4KSupportState) try {
            t = C.Hisense_Get4KSupportState();
          } catch {
          }
          return t == null && (t = navigator.userAgent.includes("UHD")), t && (e.width = 3840, e.height = 2160), Promise.resolve(e);
        }, f.Wa = function(e) {
          return Ke.prototype.Wa.call(this, e), e.streaming.stallSkip = 0, e;
        }, (navigator.userAgent.includes("Hisense") || navigator.userAgent.includes("VIDAA")) && (yr = function() {
          return new np();
        });
        function rp() {
          Ke.call(this), this.g = new ct(function() {
            var e = navigator.userAgent.match(/PlayStation (\d+)/);
            return e ? parseInt(e[1], 10) : null;
          });
        }
        tt(rp, Ke), f = rp.prototype, f.Nb = function() {
          return "PlayStation";
        }, f.Oa = function() {
          return "CONSOLE";
        }, f.Ha = function() {
          return "WEBKIT";
        }, f.Ba = function() {
          return this.g.value();
        }, f.kc = function() {
          return !1;
        }, f.dd = function() {
          return !1;
        }, f.Bb = function() {
          return !1;
        }, f.sh = function() {
          return this.Ba() === 4;
        }, f.nc = function() {
          var e, t, n, r, i;
          return D(function(o) {
            switch (o.g) {
              case 1:
                return e = { width: 1920, height: 1080 }, t = !1, de(o, 2), x(o, C.msdk.device.getDisplayInfo(), 4);
              case 4:
                n = o.h, t = n.resolution === "4K", ye(o, 3);
                break;
              case 2:
                return he(o), de(o, 5), x(o, C.msdk.device.getDisplayInfoImmediate(), 7);
              case 7:
                r = o.h, t = r.resolution === "4K", ye(o, 3);
                break;
              case 5:
                i = he(o), De("PlayStation: Failed to get the display info:", i);
              case 3:
                return t && (e.width = 3840, e.height = 2160), o.return(e);
            }
          });
        }, f.Wa = function(e) {
          return Ke.prototype.Wa.call(this, e), this.Ba() === 4 && e.drm.preferredKeySystems.push("com.microsoft.playready"), e.streaming.clearDecodingCache = !0, e;
        }, f.Cf = function() {
          return this.Ba() === 4;
        }, f.Lf = function() {
          return this.Ba() !== 4;
        }, navigator.userAgent.includes("PlayStation") && (yr = function() {
          return new rp();
        });
        function ip() {
          Ke.call(this);
          var e = navigator.userAgent.match(/Tizen (\d+).(\d+)/);
          this.g = e ? parseInt(e[1], 10) : null, this.h = e ? parseInt(e[2], 10) : null;
        }
        tt(ip, Ke), f = ip.prototype, f.Ba = function() {
          return this.g;
        }, f.Nb = function() {
          return "Tizen";
        }, f.Ha = function() {
          return "CHROMIUM";
        }, f.Oa = function() {
          return "TV";
        }, f.Gd = function() {
          return !0;
        }, f.re = function() {
          return this.Ba() === 3;
        }, f.kc = function() {
          return !1;
        }, f.dd = function() {
          var e = this.Ba();
          return e !== null ? e >= 4 : Ke.prototype.dd.call(this);
        }, f.Bb = function() {
          return !1;
        }, f.ve = function() {
          return this.g && this.h ? this.g === 5 ? this.h >= 5 : this.g > 5 : Ke.prototype.ve.call(this);
        }, f.nc = function() {
          var e = C.devicePixelRatio;
          e = { width: C.screen.width * e > 1920 ? 3840 : 1920, height: C.screen.height * e > 1080 ? 2160 : 1080 };
          try {
            if (webapis.systeminfo && webapis.systeminfo.getMaxVideoResolution) {
              var t = webapis.systeminfo.getMaxVideoResolution();
              e.width = t.width, e.height = t.height;
            } else webapis.productinfo.is8KPanelSupported && webapis.productinfo.is8KPanelSupported() ? (e.width = 7680, e.height = 4320) : webapis.productinfo.isUdPanelSupported && webapis.productinfo.isUdPanelSupported() && (e.width = 3840, e.height = 2160);
          } catch {
            De("Tizen: Error detecting screen size, default screen size 1920x1080.");
          }
          return Promise.resolve(e);
        }, f.Wa = function(e) {
          return Ke.prototype.Wa.call(this, e), e.drm.ignoreDuplicateInitData = this.Ba() !== 2, this.Ba() === 3 && (e.streaming.crossBoundaryStrategy = "reset_to_encrypted"), e.streaming.shouldFixTimestampOffset = !0, e.streaming.stallSkip = 0, e.streaming.gapPadding = 2, e;
        }, f.Hi = function() {
          var e = [];
          return this.g !== null && this.g < 5 && e.push("opus"), e;
        }, f.rd = function(e) {
          try {
            if (webapis.avinfo.isHdrTvSupport()) return e ? "HLG" : "PQ";
          } catch {
            return Ke.prototype.rd.call(this, e);
          }
          return "SDR";
        }, f.xi = function() {
          return !0;
        }, f.zi = function() {
          return this.Ba() === 3;
        }, navigator.userAgent.includes("Tizen") && (yr = function() {
          return new ip();
        });
        function Ts() {
          Ke.apply(this, arguments);
        }
        tt(Ts, Ke), Ts.prototype.Ba = function() {
          return null;
        }, Ts.prototype.Nb = function() {
          return "Vizio";
        }, Ts.prototype.Oa = function() {
          return "TV";
        }, Ts.prototype.kc = function() {
          return !1;
        }, navigator.userAgent.includes("VIZIO SmartCast") && (yr = function() {
          return new Ts();
        });
        function op() {
          Ke.call(this), this.i = new ct(function() {
            return navigator.userAgent.includes("DT_STB_BCM") || navigator.userAgent.includes("Sky_STB");
          }), this.h = new ct(function() {
            return navigator.userAgent.includes("SOPOpenBrowser");
          }), this.g = new ct(function() {
            if (navigator.userAgent.includes("DT_STB_BCM")) return 11;
            var e = navigator.userAgent.match(/Version\/(\d+)/);
            return e || (e = navigator.userAgent.match(/OS (\d+)(?:_\d+)?/)) ? parseInt(e[1], 10) : null;
          });
        }
        tt(op, Ke), f = op.prototype, f.Ba = function() {
          return this.g.value();
        }, f.Nb = function() {
          return "WebKit STB";
        }, f.Oa = function() {
          return "TV";
        }, f.Ha = function() {
          return "WEBKIT";
        }, f.kc = function() {
          return !1;
        }, f.dd = function() {
          var e = this.g.value();
          return e !== null ? e >= 15 : !0;
        }, f.Gd = function() {
          return this.h.value();
        }, f.nc = function() {
          return Promise.resolve({ width: C.screen.width * C.devicePixelRatio, height: C.screen.height * C.devicePixelRatio });
        }, f.Lf = function() {
          return !this.i.value();
        }, f.Kf = function() {
          return !1;
        }, (navigator.userAgent.includes("SOPOpenBrowser") || navigator.userAgent.includes("DT_STB_BCM") || navigator.userAgent.includes("Sky_STB") || !(!(navigator.vendor || "").includes("Apple") || /(?:iPhone|iPad|iPod)/.test(navigator.userAgent) || navigator.maxTouchPoints > 1 || navigator.userAgentData && navigator.userAgentData.platform && navigator.userAgentData.platform.toLowerCase() == "macos" || navigator.platform && navigator.platform.toLowerCase().includes("mac"))) && (yr = function() {
          return new op();
        });
        function sp() {
          Ke.call(this);
          var e = this;
          this.h = JM(), this.g = null;
          try {
            var t = new PalmServiceBridge();
            t.onservicecallback = function(n) {
              n = JSON.parse(n);
              var r, i, o, s;
              e.g = (s = (o = (r = n.configs) == null ? void 0 : r["tv.model.supportHDR"]) != null ? o : (i = n.configs) == null ? void 0 : i["tv.config.supportDolbyHDRContents"]) != null ? s : !1;
            }, t.call("luna://com.webos.service.config/getConfigs", JSON.stringify({ configNames: ["tv.model.supportHDR", "tv.config.supportDolbyHDRContents"] }));
          } catch (n) {
            De("WebOS: getConfigs call failed", n);
          }
        }
        tt(sp, Ke), f = sp.prototype, f.Ba = function() {
          return this.h;
        }, f.Nb = function() {
          return "WebOS";
        }, f.Oa = function() {
          return "TV";
        }, f.Ha = function() {
          return "CHROMIUM";
        }, f.kc = function() {
          return !1;
        }, f.dd = function() {
          var e = this.Ba();
          return e !== null ? e > 3 : Ke.prototype.dd.call(this);
        }, f.Bb = function() {
          return !1;
        }, f.ve = function() {
          var e = this.Ba();
          return e !== null ? e > 3 : Ke.prototype.ve.call(this);
        }, f.nc = function() {
          var e = { width: 1920, height: 1080 };
          try {
            var t = JSON.parse(C.PalmSystem.deviceInfo);
            e.width = Math.max(1920, t.screenWidth), e.height = Math.max(1080, t.screenHeight);
          } catch {
            De("WebOS: Error detecting screen size, default screen size 1920x1080.");
          }
          return Promise.resolve(e);
        }, f.Wa = function(e) {
          return Ke.prototype.Wa.call(this, e), this.Ba() === 3 && (e.streaming.crossBoundaryStrategy = "reset"), e.streaming.shouldFixTimestampOffset = !0, e.streaming.stallSkip = 0, e;
        }, f.rd = function(e) {
          return this.g == null ? (De("WebOS: getConfigs call haven't finished"), Ke.prototype.rd.call(this, e)) : this.g ? e ? "HLG" : "PQ" : "SDR";
        };
        function JM() {
          var e = null, t = navigator.userAgent.match(/Chrome\/(\d+)/);
          switch (t && (e = parseInt(t[1], 10)), e) {
            case 38:
              return 3;
            case 53:
              return 4;
            case 68:
              return 5;
            case 79:
              return 6;
            case 87:
              return 22;
            case 94:
              return 23;
            case 108:
              return 24;
            case 120:
              return 25;
            default:
              return null;
          }
        }
        if (f.cj = function() {
          return !1;
        }, f.cd = function() {
          var e = this.Ba();
          return e !== null ? e >= 6 : Ke.prototype.cd.call(this);
        }, navigator.userAgent.includes("Web0S")) {
          var QM = new sp();
          yr = function() {
            return QM;
          };
        }
        function up() {
          Ke.call(this), this.g = navigator.userAgent.includes("Edge/");
          var e = navigator.userAgent.match(/Edge?\/(\d+)/);
          this.h = e ? parseInt(e[1], 10) : null;
        }
        tt(up, Ke), f = up.prototype, f.Ba = function() {
          return this.h;
        }, f.Nb = function() {
          return "Xbox";
        }, f.Oa = function() {
          return "CONSOLE";
        }, f.Ha = function() {
          return this.g ? "EDGE" : "CHROMIUM";
        }, f.Gd = function() {
          return !0;
        }, f.gh = function() {
          return !0;
        }, f.gf = function() {
          return !0;
        }, f.Xi = function() {
          return this.g;
        }, f.nc = function() {
          var e = { width: 1920, height: 1080 }, t = Q1();
          if (t) try {
            var n = new t.Media.Protection.ProtectionCapabilities(), r = t.Media.Protection.ProtectionCapabilityResult;
            t = null;
            do
              t = n.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"', "com.microsoft.playready.recommendation");
            while (t === r.maybe);
            t === r.probably && (e.width = 3840, e.height = 2160);
          } catch {
            De("Xbox: Error detecting screen size, default screen size 1920x1080.");
          }
          return Promise.resolve(e);
        }, f.Wa = function(e) {
          return Ke.prototype.Wa.call(this, e), e.drm.parseInbandPsshEnabled = this.g, e.drm.preferredKeySystems.push("com.microsoft.playready"), this.g && (e.streaming.gapPadding = 0.01), e;
        }, f.Cf = function() {
          return !0;
        }, f.yh = function() {
          return !1;
        };
        function Q1() {
          var e = null;
          try {
            e = typeof Windows < "u" ? Windows : chrome.webview.hostObjects.sync.Windows;
          } catch {
          }
          return e;
        }
        (navigator.userAgent.includes("Xbox One") || Q1() !== null) && (yr = function() {
          return new up();
        });
        function Z1(e, t, n) {
          this.type = e, this.ha = t, this.segments = n || null;
        }
        function Sc(e, t, n, r) {
          this.id = e, this.name = t, this.attributes = n, this.value = r === void 0 ? null : r;
        }
        Sc.prototype.toString = function(e) {
          function t(i) {
            return i.name + "=" + (isNaN(Number(i.value)) ? '"' + i.value + '"' : i.value);
          }
          var n = "#" + this.name, r = this.attributes ? this.attributes.filter(function(i) {
            return e ? !e.has(i.name) : !0;
          }).map(t) : [];
          return this.value && r.unshift(this.value), r.length > 0 && (n += ":" + r.join(",")), n;
        };
        function ap(e, t) {
          return t ? e.toString() : (t = (/* @__PURE__ */ new Set()).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI"), e.toString(t));
        }
        function Ss(e, t) {
          return e.attributes.find(function(n) {
            return n.name === t;
          }) || null;
        }
        function te(e, t, n) {
          return (e = Ss(e, t)) ? e.value : n || null;
        }
        function Qe(e, t) {
          if (e = Ss(e, t), !e) throw new b(2, 4, 4023, t);
          return e.value;
        }
        function ew(e, t, n) {
          n = n === void 0 ? [] : n, this.ha = t, this.g = e, this.xc = n;
        }
        function xc(e, t) {
          this.name = e, this.value = t;
        }
        function Qn(e, t) {
          return e.filter(function(n) {
            return n.name == t;
          });
        }
        function tw(e, t) {
          return e.filter(function(n) {
            return Qe(n, "TYPE") == t;
          });
        }
        function Nt(e, t) {
          e = m(e);
          for (var n = e.next(); !n.done; n = e.next()) if (n = n.value, n.name === t) return n;
          return null;
        }
        function xs(e, t, n) {
          return n = n === void 0 ? 0 : n, (e = Nt(e, t)) ? Number(e.value) : n;
        }
        function ji(e, t, n) {
          return t ? nw(e, [t], n) : [];
        }
        function nw(e, t, n) {
          if (!t.length) return [];
          var r = t;
          return n && n.size && (r = t.map(function(i) {
            return rw(i, n);
          })), bt(e, r);
        }
        function rw(e, t) {
          if (!t || !t.size) return e;
          e = String(e).replace(/%7B/g, "{").replace(/%7D/g, "}");
          var n = e.match(/{\$\w*}/g);
          if (n) {
            n = m(n);
            for (var r = n.next(); !r.done; r = n.next()) {
              r = r.value;
              var i = r.slice(2, r.length - 1), o = t.get(i);
              if (o) e = e.replace(r, o);
              else throw new b(2, 4, 4039, i);
            }
          }
          return e;
        }
        function ZM() {
          this.g = 0;
        }
        function lp(e, t) {
          t = dt(t), t = t.replace(/\r\n|\r(?=[^\n]|$)/gm, `
`).trim();
          var n = t.split(/\n+/m);
          if (!tC.test(n[0])) throw new b(2, 4, 4015);
          t = 0;
          for (var r = !1, i = [], o = !0, s = 0; s < n.length; s++) {
            var u = n[s], a = n[s + 1];
            if (u.startsWith("#") && !u.startsWith("#EXT") || o) o = !1;
            else {
              if (u = iw(e, u), r || (sw.has(u.name) ? (t = 1, r = !0) : u.name == "EXT-X-STREAM-INF" || u.name == "EXT-X-MEDIA" ? r = !0 : uw.has(u.name) && (t = 1, r = !0)), uw.has(u.name)) {
                if (t != 1) throw new b(2, 4, 4017);
                o = e, e = Array(Math.max(100, Math.floor((n.length - s) / 2))), r = 0, u = [];
                var l = [];
                for (a = null; s < n.length; s++) {
                  var c = n[s];
                  c.startsWith("#EXT") ? (c = iw(o, c), sw.has(c.name) ? i.push(c) : c.name == "EXT-X-MAP" ? a = c : c.name == "EXT-X-PART" ? l.push(c) : c.name == "EXT-X-PRELOAD-HINT" ? te(c, "TYPE") == "PART" ? l.push(c) : te(c, "TYPE") == "MAP" && (c.name = "EXT-X-MAP", a = c) : u.push(c)) : (!c.startsWith("#") || c.startsWith("#EXT")) && (c = c.trim(), a && u.push(a), u = new ew(c, u, l), r < e.length ? e[r++] = u : (e.push(u), r++), u = [], l = []);
                }
                return l.length && (a && u.push(a), n = new ew("", u, l), r < e.length ? e[r++] = n : (e.push(n), r++)), new Z1(t, i, r < e.length ? e.slice(0, r) : e);
              }
              i.push(u), u.name == "EXT-X-STREAM-INF" && (u.attributes.push(new xc("URI", a)), o = !0);
            }
          }
          return new Z1(t, i);
        }
        function iw(e, t) {
          e = e.g++;
          var n = t.match(eC);
          if (!n) throw new b(2, 4, 4016, t);
          t = n[1];
          var r = n[2];
          n = [];
          var i;
          if (r) {
            r = new Lo(r);
            var o;
            for (ow.lastIndex = 0, (o = pi(r, ow)) && (i = o[1]), cp.lastIndex = 0, o = pi(r, cp); o; ) n.push(new xc(o[1], o[2] || o[3])), bo(r), o = pi(r, cp);
          }
          return new Sc(e, t, n, i);
        }
        var eC = /^#(EXT[^:]*)(?::(.*))?$/, tC = /^#EXTM3U($|[ \t\n])/m, ow = /^([^,=]+)(?:,|$)/g, cp = /([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g, sw = new Set("EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" ")), uw = new Set("EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" "));
        function aw() {
        }
        function lw(e, t) {
          try {
            var n = Ac(e);
            return Fo({ uri: e, originalUri: e, data: n.data, headers: { "content-type": n.contentType }, originalRequest: t });
          } catch (r) {
            return Ti(r);
          }
        }
        function Ac(e) {
          if (!e.startsWith("data:")) throw new b(2, 1, 1004, e);
          var t = e.substring(5), n = t.indexOf(",");
          if (n < 0) throw new b(2, 1, 1004, e);
          e = t.substring(0, n), t = decodeURIComponent(t.substring(n + 1)), n = e.split(";"), e = n[0];
          var r = !1;
          n.length > 1 && n[n.length - 1].toLowerCase() == "base64" && (r = !0, n.pop());
          var i;
          return r ? i = Wn(t) : i = sr(t), { data: i, contentType: e, Fh: n };
        }
        Y("shaka.net.DataUriPlugin", aw), aw.parse = lw, zr("data", lw);
        function Ec() {
          var e = this;
          this.g = this.h = null, this.G = 1, this.B = /* @__PURE__ */ new Map(), this.M = /* @__PURE__ */ new Map(), this.C = /* @__PURE__ */ new Map(), this.C.set("video", /* @__PURE__ */ new Map()), this.C.set("audio", /* @__PURE__ */ new Map()), this.C.set(xe, /* @__PURE__ */ new Map()), this.C.set("image", /* @__PURE__ */ new Map()), this.fc = (/* @__PURE__ */ new Map()).set("com.apple.streamingkeydelivery", function(t, n, r) {
            return PC(e, t, n, r);
          }).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed", function(t) {
            var n = Qe(t, "METHOD");
            if (["SAMPLE-AES", "SAMPLE-AES-CTR"].includes(n)) {
              var r = "cenc";
              n == "SAMPLE-AES" && (r = "cbcs");
              var i = Qe(t, "URI");
              if (n = Ac(i.split("?")[0]), i = i.split("?")[0], !e.I.has(i)) {
                var o = pe(n.data);
                e.I.set(i, o);
              }
              r = Br("com.widevine.alpha", r, [{ initDataType: "cenc", initData: e.I.get(i) }], void 0, n.Fh), (t = te(t, "KEYID")) && r.keyIds.add(t.toLowerCase().substr(2)), t = Promise.resolve(r);
            } else t = Promise.resolve(null);
            return t;
          }).set("com.microsoft.playready", function(t) {
            var n = Qe(t, "METHOD");
            if (["SAMPLE-AES", "SAMPLE-AES-CTR"].includes(n)) {
              var r = "cenc";
              n == "SAMPLE-AES" && (r = "cbcs"), t = Qe(t, "URI"), n = Ac(t.split("?")[0]), t = pe(n.data);
              var i = new Uint8Array([
                154,
                4,
                240,
                121,
                152,
                64,
                66,
                134,
                171,
                146,
                230,
                91,
                224,
                136,
                95,
                149
              ]);
              i = el(t, i, /* @__PURE__ */ new Set(), 0), r = Br("com.microsoft.playready", r, [{ initDataType: "cenc", initData: i }], void 0, n.Fh), (t = qi(["<PLAYREADY>", _r(t), "</PLAYREADY>"].join(`
`))) && (r.licenseServerUri = hc(t)), r = Promise.resolve(r);
            } else r = Promise.resolve(null);
            return r;
          }).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c", function(t) {
            var n = Qe(t, "METHOD");
            if (["SAMPLE-AES", "SAMPLE-AES-CTR"].includes(n)) {
              var r = "cenc";
              n == "SAMPLE-AES" && (r = "cbcs");
              var i = Qe(t, "URI");
              if (n = Ac(i.split("?")[0]), i = i.split("?")[0], !e.I.has(i)) {
                var o = pe(n.data);
                e.I.set(i, o);
              }
              r = Br("com.huawei.wiseplay", r, [{ initDataType: "cenc", initData: e.I.get(i) }], void 0, n.Fh), (t = te(t, "KEYID")) && r.keyIds.add(t.toLowerCase().substr(2)), t = Promise.resolve(r);
            } else t = Promise.resolve(null);
            return t;
          }), this.ob = /* @__PURE__ */ new Set(), this.j = /* @__PURE__ */ new Map(), this.m = null, this.H = "", this.ab = new ZM(), this.N = -1, this.ma = 1 / 0, this.ba = this.Ac = this.kb = !1, this.F = new Ae(function() {
            if (e.X && !e.g.continueLoadingWhenPaused && (e.W.Ma(e.X, "timeupdate"), e.X.paused)) {
              e.W.Aa(
                e.X,
                "timeupdate",
                function() {
                  return Dw(e);
                }
              );
              return;
            }
            Dw(e);
          }), this.Fa = Rc, this.i = null, this.eb = 0, this.u = 1 / 0, this.Ua = this.Ta = this.T = 0, this.$ = new Vo(), this.J = /* @__PURE__ */ new Map(), this.K = /* @__PURE__ */ new Map(), this.Da = /* @__PURE__ */ new Map(), this.va = /* @__PURE__ */ new Map(), this.O = /* @__PURE__ */ new Map(), this.ya = /* @__PURE__ */ new Map(), this.za = /* @__PURE__ */ new Map(), this.zc = this.oa = !1, this.cc = new Eo(5), this.l = null, this.R = !0, this.W = new Ve(), this.o = this.X = null, this.ec = function() {
            return !1;
          }, this.I = /* @__PURE__ */ new Map();
        }
        f = Ec.prototype, f.configure = function(e, t) {
          var n = this.h && e.updatePeriod != this.g.updatePeriod && e.updatePeriod >= 0;
          this.g = e, t && (this.ec = t), this.l && this.l.configure(this.g), n && this.i && this.i.presentationTimeline.U() && this.F.Cb();
        }, f.start = function(e, t) {
          var n = this, r;
          return D(function(i) {
            return i.g == 1 ? (n.h = t, n.oa = t.isLowLatencyMode(), x(i, vp(n, [e]).promise, 2)) : i.g != 3 ? (r = i.h, n.H = r.uri, x(i, iC(n, r.data), 3)) : i.return(n.i);
          });
        }, f.stop = function() {
          this.F && (this.F.stop(), this.F = null);
          var e = [];
          return this.$ && (e.push(this.$.destroy()), this.$ = null), this.g = this.h = null, this.ob.clear(), this.i = null, this.j.clear(), this.M.clear(), this.K.clear(), this.B.clear(), this.Da.clear(), this.va.clear(), this.O.clear(), this.ya.clear(), this.za.clear(), this.I.clear(), this.l && this.l.destroy(), this.W && (this.W.release(), this.W = null), Promise.all(e);
        }, f.update = function() {
          var e = this, t, n, r, i, o, s, u, a, l, c;
          return D(function(d) {
            if (d.g == 1) {
              if (!Zt(e)) return d.return();
              for (t = [], n = Array.from(e.j.values()), e.u = 1 / 0, e.i.gapCount = 0, r = n.filter(function(h) {
                return !h.stream.isAudioMuxedInVideo && h.stream.segmentIndex;
              }), i = m(r), o = i.next(); !o.done; o = i.next()) s = o.value, t.push(nC(e, s));
              return x(d, Promise.all(t), 2);
            }
            for (vw(e, r.map(function(h) {
              return h.stream;
            })), u = r.some(function(h) {
              return h.be == 0;
            }), r.length && !u && (kc(e, Rc), Ic(e)), u && Ic(e), a = m(r), l = a.next(); !l.done; l = a.next()) c = l.value, c.stream.isAudioMuxedInVideo || !c.stream.segmentIndex || Tr(c.stream.segmentIndex) || e.h.disableStream(c.stream);
            q(d);
          });
        };
        function dp(e, t) {
          return Zt(e) ? e.C.get(t.type) : t.pf;
        }
        function nC(e, t) {
          var n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B, F, W, z, me, Q, Be;
          return D(function(ve) {
            switch (ve.g) {
              case 1:
                if (t.stream.isAudioMuxedInVideo) return ve.return();
                for (n = [], r = m(t.P()), i = r.next(); !i.done; i = r.next()) o = i.value, s = new yt(o), u = s.g, t.Te && (t.Qb >= 0 && u.add("_HLS_msn", String(t.Qb)), t.Rb >= 0 && u.add("_HLS_part", String(t.Rb))), t.Ue && u.add("_HLS_skip", "YES"), n.push(s.toString());
                return de(ve, 2), x(ve, vp(e, n, !0).promise, 4);
              case 4:
                a = ve.h, ye(ve, 3);
                break;
              case 2:
                throw l = he(ve), e.h && e.h.disableStream(t.stream), l;
              case 3:
                if (!t.stream.segmentIndex) return ve.return();
                if (c = lp(e.ab, a.data), c.type != 1) throw new b(2, 4, 4017);
                return d = a.uri, d == a.originalUri || t.P().includes(d) || t.Af.push(d), h = Qn(c.ha, "EXT-X-DEFINE"), p = fp(e, h, d), g = t.stream, w = dp(e, t), x(ve, Sw(e, c, g.mimeType, t.P, p), 5);
              case 5:
                for (T = ve.h, E = T.keyIds, A = T.drmInfos, I = T.encrypted, P = T.Nh, g.encrypted || !I || P || (g.encrypted = !0), N = function(ze, Ce) {
                  return ze.size === Ce.size && [].concat(X(ze)).every(function(Ee) {
                    return Ce.has(Ee);
                  });
                }, N(
                  g.keyIds,
                  E
                ) || (g.keyIds = E, g.drmInfos = A, e.h.newDrmInfo(g)), M = Cw(e, c, w, p, t.P, t.type), R = M.segments, (k = M.bandwidth) && (g.bandwidth = k), O = ml(g), L = m(R), U = L.next(); !U.done; U = L.next()) j = U.value, j.ea && (j.ea.xd = O);
                g.segmentIndex.je(R, e.m.Jb()), R.length && (G = xs(c.ha, "EXT-X-MEDIA-SEQUENCE", 0), B = (H = Nt(c.ha, "EXT-X-SKIP")) ? Number(te(H, "SKIPPED-SEGMENTS")) : 0, F = ww(G, R), W = F.Qb, z = F.Rb, t.Qb = W + B, t.Rb = z, me = w.get(G), g.segmentIndex.Ya(me)), (Q = Tr(g.segmentIndex)) && (t.Vc = Q.startTime, Be = R[R.length - 1], t.Mc = Be.endTime), Nt(c.ha, "EXT-X-ENDLIST") && (t.be = !0), pp(e, c), gp(e, c.ha, g.type, p, t.P), q(ve);
            }
          });
        }
        f.onExpirationUpdated = function() {
        }, f.onInitialVariantChosen = function() {
        }, f.banLocation = function(e) {
          this.l && this.l.banLocation(e);
        }, f.setMediaElement = function(e) {
          this.X = e;
        };
        function cw(e, t, n) {
          n = n === void 0 ? !1 : n;
          for (var r = e.N == -1, i = m(t), o = i.next(); !o.done; o = i.next()) {
            o = o.value;
            var s = o.stream.segmentIndex, u = dp(e, o);
            if (s = Tr(s)) {
              u = m(u);
              for (var a = u.next(); !a.done; a = u.next()) {
                a = m(a.value);
                var l = a.next().value;
                if (a.next().value == s.startTime) {
                  r && (e.N = Math.max(e.N, l)), o.og = l;
                  break;
                }
              }
            }
          }
          if (!(e.N < 0)) for (t = m(t), r = t.next(); !r.done; r = t.next()) r = r.value, (ea(e, r.type) || n) && (i = r.stream.segmentIndex) && (o = e.N - r.og, o > 0 && (i.g.splice(0, o), i = Tr(i)) && (i = -i.startTime, r.stream.segmentIndex.offset(i), dw(e, r, i)));
        }
        function rC(e, t) {
          if (e.ma == 1 / 0) {
            t = m(t);
            for (var n = t.next(); !n.done; n = t.next()) n = Tr(n.value.stream.segmentIndex), n != null && n.h != null && (e.ma = Math.min(e.ma, n.h));
          }
          if (t = e.ma, t != 1 / 0) {
            n = m(e.j.values());
            for (var r = n.next(); !r.done; r = n.next()) if (r = r.value, !ea(e, r.type)) {
              var i = r.stream.segmentIndex;
              if (i != null) {
                var o = Tr(i);
                if (o) if (o.h == null) Ir("Missing EXT-X-PROGRAM-DATE-TIME for stream", r.P(), "Expect AV sync issues!");
                else for (dw(e, r, o.h - t - o.startTime), r = m(i), i = r.next(); !i.done; i = r.next()) i.value.Ah(t);
              }
            }
          }
        }
        function dw(e, t, n) {
          if (!(Math.abs(n) < 1e-3)) {
            t.Vc += n, t.Mc += n, e = dp(e, t);
            for (var r = m(e), i = r.next(); !i.done; i = r.next()) {
              var o = m(i.value);
              i = o.next().value, o = o.next().value, e.set(i, o + n);
            }
            t.P();
          }
        }
        function iC(e, t) {
          var n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B, F, W, z, me, Q, Be, ve, ze, Ce, Ee, Le, _e, be;
          return D(function(Ie) {
            switch (Ie.g) {
              case 1:
                return n = xt, r = lp(e.ab, t), i = Qn(r.ha, "EXT-X-DEFINE"), o = [], s = [], u = [], e.m = new fe(null, 0), e.m.$c(!0), a = function() {
                  return [e.H];
                }, l = null, c = /* @__PURE__ */ new Map(), e.i = {
                  presentationTimeline: e.m,
                  variants: o,
                  textStreams: s,
                  imageStreams: u,
                  offlineSessionIds: [],
                  sequenceMode: e.g.hls.sequenceMode,
                  ignoreManifestTimestampsInSegmentsMode: e.g.hls.ignoreManifestTimestampsInSegmentsMode,
                  type: "HLS",
                  serviceDescription: null,
                  nextUrl: null,
                  periodCount: 1,
                  gapCount: 0,
                  isLowLatency: !1,
                  startTime: e.o
                }, r.type == 1 ? (e.R = !1, W = Qn(r.ha, "EXT-X-DEFINE"), c = fp(e, W, e.H), l = n.wa, z = "", me = /* @__PURE__ */ new Map(), x(Ie, yw(e, e.G++, c, r, a, "", l, z, !0, "Media Playlist", null, me, null, !1, null, !1), 7)) : (sC(e, i), d = Qn(r.ha, "EXT-X-MEDIA"), h = Qn(r.ha, "EXT-X-STREAM-INF"), p = Qn(r.ha, "EXT-X-IMAGE-STREAM-INF"), g = Qn(r.ha, "EXT-X-I-FRAME-STREAM-INF"), w = Qn(r.ha, "EXT-X-SESSION-KEY"), T = Qn(r.ha, "EXT-X-SESSION-DATA"), E = Qn(r.ha, "EXT-X-CONTENT-STEERING"), aC(e, T), x(Ie, lC(e, E), 4));
              case 4:
                if (!e.g.ignoreSupplementalCodecs) {
                  for (A = [], I = m(h), P = I.next(), N = {}; !P.done; N = { aj: void 0 }, P = I.next()) M = P.value, (R = te(M, "SUPPLEMENTAL-CODECS")) && (N.aj = R.split(/\s*,\s*/).map(function(ke) {
                    return ke.split("/")[0];
                  }), k = M.attributes.map(/* @__PURE__ */ (function(ke) {
                    return function(Lt) {
                      var It = Lt.name, Hn = Lt.value;
                      return It == "CODECS" && (Hn = ke.aj.join(","), Lt = Lt.value.split(","), Lt.length > 1 && (Lt = fn("audio", Lt)) && (Hn += "," + Lt)), new xc(It, Hn);
                    };
                  })(N)), A.push(new Sc(M.id, M.name, k, null)));
                  for (h.push.apply(
                    h,
                    X(A)
                  ), O = [], L = m(g), U = L.next(), j = {}; !U.done; j = { bj: void 0 }, U = L.next()) G = U.value, (H = te(G, "SUPPLEMENTAL-CODECS")) && (j.bj = H.split(/\s*,\s*/).map(function(ke) {
                    return ke.split("/")[0];
                  }), B = G.attributes.map(/* @__PURE__ */ (function(ke) {
                    return function(Lt) {
                      var It = Lt.name;
                      return Lt = Lt.value, It == "CODECS" && (Lt = ke.bj.join(",")), new xc(It, Lt);
                    };
                  })(j)), O.push(new Sc(G.id, G.name, B, null)));
                  g.push.apply(g, X(O));
                }
                return uC(e, h), SC(e, d), F = hC(e, g), x(Ie, pC(e, h, w, d, a, e.B, F), 5);
              case 5:
                return o = Ie.h, s = cC(e, d), x(Ie, dC(e, p, g), 6);
              case 6:
                u = Ie.h, Ie.A(3);
                break;
              case 7:
                Q = Ie.h, e.j.set(e.H, Q), Q.stream && (Be = ml(Q.stream), Q.stream.segmentIndex.Hb(function(ke) {
                  ke.ea && (ke.ea.xd = Be);
                })), l = Q.stream.type, ve = !0, (e.g.disableAudio && Q.type == "audio" || e.g.disableVideo && Q.type == "video" && !Q.stream.codecs.includes(",")) && (ve = !1), ve && o.push({ id: 0, language: He(z || "und"), disabledUntilTime: 0, primary: !0, audio: Q.type == "audio" ? Q.stream : null, video: Q.type == "video" ? Q.stream : null, bandwidth: Q.stream.bandwidth || 0, allowedByApplication: !0, allowedByKeySystem: !0, decodingInfos: [] });
              case 3:
                if (!e.h) throw new b(2, 7, 7001);
                if (Aw(e, r), r.type == 1 && (Zt(e) && (Ew(e, r), ze = e.u, e.F.ka(ze)), Ce = Array.from(e.j.values()), hp(e, Ce), Ic(e), gp(e, r.ha, l, c, a)), e.i.variants = o, e.i.textStreams = s, e.i.imageStreams = u, e.i.startTime = e.o, e.ba || !e.g.hls.disableCodecGuessing) {
                  Ie.A(8);
                  break;
                }
                for (Ee = [], Le = m(e.i.variants), _e = Le.next(); !_e.done; _e = Le.next()) be = _e.value, be.audio && be.audio.codecs === "" && Ee.push(be.audio.createSegmentIndex()), be.video && be.video.codecs === "" && Ee.push(be.video.createSegmentIndex());
                return x(
                  Ie,
                  Promise.all(Ee),
                  8
                );
              case 8:
                e.h.makeTextStreamsForClosedCaptions(e.i), q(Ie);
            }
          });
        }
        function oC(e, t) {
          var n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E;
          return D(function(A) {
            if (A.g == 1)
              return n = kf(e.g.hls.mediaPlaylistFullMimeType), t.length ? (r = kw(e, t), i = r.segment, o = r.segmentIndex, s = i.P(), (u = ns(s[0])) && (a = yp.get(u)) ? A.return(kf(a)) : x(A, Promise.all([fw(e, i.ea, 0), fw(e, i, o)]), 2)) : A.return(n);
            if (l = A.h, c = l[1].mimeType, d = l[0].data, h = l[1].data, p = "mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" "), g = ["audio/mp4", "video/mp4", "video/iso.segment"], w = i.ea || g.includes(c), !w && $o(pe(h))) {
              var I = h, P = e.g.disableAudio, N = e.g.disableVideo, M = e.g.disableText, R = pe(I), k = new rt().parse(R), O = k.Yd();
              R = k.Kg();
              var L = [], U = !1, j = !1;
              if (!P) switch (O.audio) {
                case "aac":
                case "aac-loas":
                  k.ub().length && (L.push("mp4a.40.2"), U = !0);
                  break;
                case "mp3":
                  k.ub().length && (L.push("mp4a.40.34"), U = !0);
                  break;
                case "ac3":
                  k.ub().length && (L.push("ac-3"), U = !0);
                  break;
                case "ec3":
                  k.ub().length && (L.push("ec-3"), U = !0);
                  break;
                case "opus":
                  k.ub().length && (L.push("opus"), U = !0);
              }
              if (!N) switch (O.video) {
                case "avc":
                  R.codec ? L.push(R.codec) : L.push("avc1.42E01E"), j = !0;
                  break;
                case "hvc":
                  R.codec ? L.push(R.codec) : L.push("hvc1.1.6.L93.90"), j = !0;
                  break;
                case "av1":
                  L.push("av01.0.01M.08"), j = !0;
              }
              if (L.length) {
                if (P = U && !j, N = /* @__PURE__ */ new Map(), j && !M) {
                  for (M = new ur("video/mp2t"), Id(M, I), I = m(M.g.getStreams()), j = I.next(); !j.done; j = I.next()) j = j.value, N.set(j, j);
                  M.g.clear();
                }
                R = {
                  type: P ? "audio" : "video",
                  mimeType: "video/mp2t",
                  codecs: L.join(", "),
                  language: null,
                  height: R.height,
                  width: R.width,
                  channelCount: null,
                  sampleRate: null,
                  closedCaptions: N,
                  ye: null,
                  colorGamut: null,
                  frameRate: R.frameRate,
                  timescale: null
                };
              } else R = null;
              if (T = R) return A.return(T);
            } else if ((w || p.includes(u)) && (E = fE(d, h, e.g.disableText))) return A.return(E);
            return c ? A.return(kf(c)) : A.return(n);
          });
        }
        function fw(e, t, n) {
          var r, i, o, s, u, a;
          return D(function(l) {
            switch (l.g) {
              case 1:
                return t ? (r = Xn, i = Su(t.P(), t.Kc(), t.Ic(), e.g.retryParameters), o = t instanceof se ? 1 : 0, x(l, oi(e, i, r, { type: o }).promise, 2)) : l.return({ mimeType: null, data: null });
              case 2:
                if (s = l.h, u = s.data, !t.aesKey) {
                  l.A(3);
                  break;
                }
                return x(l, Df(u, t.aesKey, n), 4);
              case 4:
                u = l.h;
              case 3:
                return t instanceof se ? t.se(u, !0) : t.se(u), (a = s.headers["content-type"]) && (a = a.split(";")[0].toLowerCase()), l.return({ mimeType: a, data: u });
            }
          });
        }
        function Ic(e) {
          if (Zt(e)) {
            if (e.Fa == wp) {
              for (var t = 1 / 0, n = 1 / 0, r = m(e.j.values()), i = r.next(); !i.done; i = r.next()) i = i.value, i.stream.segmentIndex && i.stream.type != "text" && !i.stream.isAudioMuxedInVideo && (t = Math.min(t, i.Mc), n = Math.min(n, i.Vc));
              t = t - n || 0, isNaN(e.g.availabilityWindowOverride) || (t = e.g.availabilityWindowOverride), e.m.If(t);
            }
          } else e.m.Ab(mw(e));
          if (!e.m.o) for (t = m(e.j.values()), n = t.next(); !n.done; n = t.next()) n = n.value, !n.stream.segmentIndex || n.type != "audio" && n.type != "video" || (n = Tr(n.stream.segmentIndex)) && n.h != null && e.m.qh(n.h);
          e.m.nf();
        }
        function sC(e, t) {
          var n = new yt(e.H).g;
          t = m(t);
          for (var r = t.next(); !r.done; r = t.next()) {
            var i = r.value;
            r = te(i, "NAME");
            var o = te(i, "VALUE");
            i = te(i, "QUERYPARAM"), r && o && (e.B.has(r) || e.B.set(r, o)), i && (r = n.get(i)[0]) && !e.B.has(r) && e.B.set(i, r);
          }
        }
        function fp(e, t, n) {
          n = new yt(n).g;
          var r = /* @__PURE__ */ new Map();
          t = m(t);
          for (var i = t.next(); !i.done; i = t.next()) {
            var o = i.value, s = te(o, "NAME"), u = te(o, "VALUE");
            i = te(o, "QUERYPARAM"), o = te(o, "IMPORT"), s && u && (r.has(s) || r.set(s, u)), i && (s = n.get(i)[0]) && !r.has(s) && r.set(i, s), o && (i = e.B.get(o)) && r.set(o, i);
          }
          return r;
        }
        function uC(e, t) {
          t = m(t);
          for (var n = t.next(); !n.done; n = t.next()) {
            var r = n.value, i = te(r, "AUDIO");
            n = te(r, "VIDEO");
            var o = te(r, "SUBTITLES");
            if (r = hw(e, r), o) {
              var s = fn(xe, r);
              e.K.set(o, s), Gn(r, s);
            }
            i && (o = fn("audio", r), o || (o = e.g.hls.defaultAudioCodec), e.K.set(i, o)), n && (i = fn("video", r), i || (i = e.g.hls.defaultVideoCodec), e.K.set(n, i));
          }
        }
        function aC(e, t) {
          t = m(t);
          for (var n = t.next(); !n.done; n = t.next()) {
            var r = n.value, i = te(r, "DATA-ID");
            n = te(r, "URI");
            var o = te(r, "LANGUAGE");
            r = te(r, "VALUE"), i = (/* @__PURE__ */ new Map()).set("id", i), n && i.set("uri", ji([e.H], n, e.B)[0]), o && i.set("language", o), r && i.set("value", r), n = new ee("sessiondata", i), e.h && e.h.onEvent(n);
          }
        }
        function lC(e, t) {
          var n, r, i, o, s, u;
          return D(function(a) {
            if (!e.h || !e.g) return a.return();
            for (r = m(t), i = r.next(); !i.done; i = r.next()) if (o = i.value, s = te(o, "PATHWAY-ID"), u = te(o, "SERVER-URI"), s && u) {
              e.l = new vs(e.h), e.l.configure(e.g), e.l.i = [e.H], e.l.setManifestType("HLS"), e.l.h = s, n = Xu(e.l, u);
              break;
            }
            return x(a, n, 0);
          });
        }
        function cC(e, t) {
          var n = tw(t, "SUBTITLES"), r = {};
          t = m(n);
          for (var i = t.next(); !i.done; i = t.next()) {
            i = i.value;
            var o = ap(i, !e.l);
            r[o] ? r[o].push(i) : r[o] = [i];
          }
          if (t = [], !e.g.disableText) for (var s in r) try {
            t.push(pw(e, r[s], /* @__PURE__ */ new Map()).stream);
          } catch (u) {
            if (!e.g.hls.ignoreTextStreamFailures) throw u;
          }
          for (s = m(n), n = s.next(); !n.done; n = s.next()) if (r = Qe(n.value, "GROUP-ID"), (n = e.K.get(r)) && (r = e.M.get(r))) for (r = m(r), i = r.next(); !i.done; i = r.next()) i = i.value, i.stream.codecs = n, i.stream.mimeType = mp(xe, n) || Cc(xe), As(i.stream);
          return t.filter(function(u) {
            return u;
          });
        }
        function As(e) {
          var t = /* @__PURE__ */ new Set([gt(e.mimeType, e.codecs)]);
          e.segmentIndex && e.segmentIndex.Hb(function(n) {
            n.mimeType && t.add(gt(n.mimeType, e.codecs));
          }), e.fullMimeTypes = t;
        }
        function dC(e, t, n) {
          var r, i;
          return D(function(o) {
            return o.g == 1 ? (r = t.map(function(s) {
              var u, a;
              return D(function(l) {
                if (l.g == 1)
                  return e.g.disableThumbnails ? l.return(null) : (de(l, 2), x(l, xC(e, s), 4));
                if (l.g != 2) return u = l.h, l.return(u.stream);
                if (a = he(l), e.g.hls.ignoreImageStreamFailures) return l.return(null);
                throw a;
              });
            }).concat(n.map(function(s) {
              if (e.g.disableThumbnails) return null;
              try {
                var u = gw(e, s);
                return u.stream.type !== "image" ? null : u.stream;
              } catch (a) {
                if (e.g.hls.ignoreImageStreamFailures) return null;
                throw a;
              }
            })), x(o, Promise.all(r), 2)) : (i = o.h, o.return(i.filter(function(s) {
              return s;
            })));
          });
        }
        function fC(e, t, n) {
          t = t.filter(function(u) {
            var a = te(u, "URI") || "";
            return u = te(u, "TYPE"), u != "SUBTITLES" && (a != "" || u == "AUDIO");
          });
          var r = {};
          t = m(t);
          for (var i = t.next(); !i.done; i = t.next()) {
            i = i.value;
            var o = ap(i, !e.l);
            r[o] ? r[o].push(i) : r[o] = [i];
          }
          for (var s in r) pw(e, r[s], n, !1);
        }
        function hC(e, t) {
          return t.map(function(n) {
            return n = gw(e, n), n.stream.type !== "video" ? null : n.stream;
          }).filter(function(n) {
            return n;
          });
        }
        function pC(e, t, n, r, i, o, s) {
          var u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B, F, W, z, me, Q, Be, ve, ze, Ce, Ee, Le;
          return D(function(_e) {
            switch (_e.g) {
              case 1:
                if (u = [], a = /* @__PURE__ */ new Set(), e.g.ignoreDrmInfo || !(n.length > 0)) {
                  _e.A(2);
                  break;
                }
                l = m(n), c = l.next();
              case 3:
                if (c.done) {
                  _e.A(2);
                  break;
                }
                if (d = c.value, h = Qe(d, "METHOD"), p = te(d, "KEYFORMAT") || "identity", g = null, h == "NONE") {
                  _e.A(4);
                  break;
                }
                if (Pc(h)) {
                  w = ji(i(), Qe(d, "URI"), o), T = w.sort().join(""), e.O.has(T) || (E = At(w, e.g.retryParameters), A = oi(e, E, 6).promise, e.O.set(T, A)), _e.A(4);
                  break;
                }
                if (p == "identity") return x(_e, Rw(e, d, "", i, null, o), 12);
                if (I = e.fc.get(p), !I) {
                  P = null, _e.A(10);
                  break;
                }
                return x(_e, I(d, "", null), 11);
              case 11:
                P = _e.h;
              case 10:
                g = P, _e.A(6);
                break;
              case 12:
                g = _e.h;
              case 6:
                if (g) {
                  if (g.keyIds) for (N = m(g.keyIds), M = N.next(); !M.done; M = N.next()) R = M.value, a.add(R);
                  u.push(g);
                }
              case 4:
                c = l.next(), _e.A(3);
                break;
              case 2:
                for (k = {}, O = m(t), L = O.next(); !L.done; L = O.next()) U = L.value, j = ap(U, !e.l), k[j] ? k[j].push(U) : k[j] = [U];
                G = [];
                for (H in k) B = k[H], F = B[0], W = te(F, "FRAME-RATE"), z = Number(Qe(F, "BANDWIDTH")) || Number(te(
                  F,
                  "AVERAGE-BANDWIDTH"
                )), me = te(F, "RESOLUTION"), Q = m(me ? me.split("x") : [null, null]), Be = Q.next().value, ve = Q.next().value, ze = te(F, "VIDEO-RANGE"), (Ce = te(F, "REQ-VIDEO-LAYOUT")) && Ce.includes(",") && (Ee = Ce.split(",").filter(function(be) {
                  return be == "CH-STEREO" || be == "CH-MONO";
                }), Ce = Ee[0]), Ce = Ce || "CH-MONO", Le = gC(e, B, r), G.push.apply(G, X(TC(e, Le.audio, Le.video, z, Be, ve, W, ze, Ce, u, a, s)));
                return _e.return(G.filter(function(be) {
                  return be != null;
                }));
            }
          });
        }
        function gC(e, t, n) {
          for (var r = { audio: [], video: [] }, i = /* @__PURE__ */ new Map(), o = [], s = !1, u = !1, a = m(t), l = a.next(); !l.done; l = a.next()) {
            var c = l.value;
            l = te(c, "AUDIO");
            var d = te(c, "VIDEO"), h = l || d;
            h && (o.includes(h) || o.push(h), (c = te(c, "PATHWAY-ID")) && i.set(h, c), l ? s = !0 : d && (u = !0));
          }
          o.length && n.length && (n = n.filter(function(g) {
            return o.includes(Qe(g, "GROUP-ID"));
          }), fC(e, n, i)), n = (i = o.sort().join(",")) && e.M.has(i) ? e.M.get(i) : [], s ? r.audio.push.apply(r.audio, X(n)) : u && r.video.push.apply(r.video, X(n)), u = !1;
          var p = t.map(function(g) {
            return Qe(
              g,
              "URI"
            );
          });
          return s = r.audio.find(function(g) {
            return g && g.P().find(function(w) {
              return p.includes(w);
            });
          }), n = hw(e, t[0]), a = fn("video", n), (l = fn("audio", n)) && !a ? (s = "audio", u = r.audio.length > 0 && !r.audio.some(function(g) {
            return g.stream.isAudioMuxedInVideo;
          })) : !r.audio.length && !r.video.length && l && a ? (s = "video", n = [[a, l].join()]) : r.audio.length && s ? (s = "audio", u = !0) : s = r.video.length && !r.audio.length ? "audio" : "video", u || (t = AC(e, t, n, s), i && e.g.enableAudioGroups && (t.stream.groupId = i), t.stream.type == "audio" && s === "audio" && r.audio.some(function(g) {
            return g.stream.isAudioMuxedInVideo;
          }) && (e = r.audio[0].stream, t.stream.language = e.language, t.stream.channelsCount = e.channelsCount, t.stream.label = e.label, t.stream.audioSamplingRate = e.audioSamplingRate, t.stream.originalId = e.originalId, t.stream.originalLanguage = e.originalLanguage), r[t.stream.type] = [t]), r;
        }
        function hw(e, t) {
          return t = te(t, "CODECS") || "", e.ba = t.length > 0, e.ba || e.g.hls.disableCodecGuessing || (t = [], e.g.disableVideo || t.push(e.g.hls.defaultVideoCodec), e.g.disableAudio || t.push(e.g.hls.defaultAudioCodec), t = t.join(",")), Pf(t.split(/\s*,\s*/));
        }
        function mC(e) {
          return (e = te(e, "CHANNELS")) ? parseInt(e.split("/")[0], 10) : null;
        }
        function vC(e) {
          return (e = te(e, "SAMPLE-RATE")) ? parseInt(e, 10) : null;
        }
        function yC(e) {
          return e = te(e, "CHANNELS"), e ? (e = e.split("/"), e.length != 2 ? !1 : e[1] === "JOC" || e[1].includes("ATMOS")) : !1;
        }
        function wC(e) {
          return e = Qe(e, "TYPE").toLowerCase(), e == "subtitles" && (e = xe), e;
        }
        function TC(e, t, n, r, i, o, s, u, a, l, c, d) {
          for (var h = m(n), p = h.next(); !p.done; p = h.next()) Pw(p.value.stream, i, o, s, u, a, null);
          for (i = e.g.disableVideo, (!n.length || i) && (n = [null]), i && (t = t.filter(function(E) {
            return !E.stream.isAudioMuxedInVideo;
          })), i = e.g.disableAudio, (!t.length || i) && (t = [null]), i = [], t = m(t), o = t.next(); !o.done; o = t.next()) for (o = o.value, s = m(n), u = s.next(); !u.done; u = s.next()) {
            var g = u.value;
            (u = o ? o.stream : null) && (u.drmInfos = l, u.keyIds = c), (a = g ? g.stream : null) && (a.drmInfos = l, a.keyIds = c, e.g.disableIFrames || hm(a, d)), a && !u && (a.bandwidth = r), !a && u && (u.bandwidth = r), h = o ? o.stream.drmInfos : null, p = g ? g.stream.drmInfos : null, g = g ? g.P().sort().join(",") : "";
            var w = o ? o.P().sort().join(",") : "", T = [];
            u && u.codecs && T.push(u.codecs), a && a.codecs && T.push(a.codecs), g = [g, w, T.sort()].join("-"), u && a && !Pg(h, p) || e.ob.has(g) || (u = { id: e.G++, language: u ? u.language : "und", disabledUntilTime: 0, primary: !!u && u.primary || !!a && a.primary, audio: u, video: a, bandwidth: r, allowedByApplication: !0, allowedByKeySystem: !0, decodingInfos: [] }, i.push(u), e.ob.add(g));
          }
          return i;
        }
        function SC(e, t) {
          t = tw(t, "CLOSED-CAPTIONS"), e.R = t.length == 0, t = m(t);
          for (var n = t.next(); !n.done; n = t.next()) {
            var r = n.value, i = te(r, "LANGUAGE");
            n = He(i || "und"), i || (i = te(r, "NAME")) && (n = i), i = Qe(r, "GROUP-ID"), r = Qe(r, "INSTREAM-ID").replace("SERVICE", "svc"), e.J.get(i) || e.J.set(i, /* @__PURE__ */ new Map()), e.J.get(i).set(r, n);
          }
        }
        function pw(e, t, n, r) {
          r = r === void 0 ? !0 : r;
          for (var i = [], o = [], s = /* @__PURE__ */ new Map(), u = m(t), a = u.next(), l = {}; !a.done; l = { li: void 0 }, a = u.next()) {
            a = a.value, l.li = ++e.G, l = /* @__PURE__ */ (function(w) {
              return function() {
                return "shaka://hls-muxed" + w.li;
              };
            })(l);
            var c = r ? Qe(a, "URI") : te(a, "URI") || l();
            l = Qe(a, "GROUP-ID"), i.push(c), o.push(l), s.set(l, c), (a = te(a, "PATHWAY-ID")) && n.set(l, a);
          }
          if (r = o.sort().join(","), a = t[0], t = "", u = wC(a), u == xe) t = te(a, "CODECS") || "";
          else for (o = m(o), l = o.next(); !l.done; l = o.next()) if (l = l.value, e.K.has(l)) {
            t = e.K.get(l);
            break;
          }
          if (o = i.sort().join(","), u == "audio" && r && (o += r), e.j.has(o)) return e.j.get(o);
          if (l = e.G++, e.l) for (s = m(s), c = s.next(); !c.done; c = s.next()) {
            var d = m(c.value);
            c = d.next().value, d = d.next().value, (c = n.get(c)) && ys(e.l, l, c, d);
          }
          n = te(a, "LANGUAGE"), s = te(a, "NAME"), c = te(a, "DEFAULT") == "YES", d = u == "audio" ? mC(a) : null;
          var h = u == "audio" ? yC(a) : !1, p = te(a, "CHARACTERISTICS"), g = te(a, "FORCED") == "YES";
          return a = u == "audio" ? vC(a) : null, i = Mc(e, l, i, t, u, n, c, s, d, null, p, g, a, h), i.stream && e.g.enableAudioGroups && (i.stream.groupId = r), e.M.has(r) ? e.M.get(r).push(i) : e.M.set(
            r,
            [i]
          ), e.j.set(o, i), i;
        }
        function xC(e, t) {
          var n, r, i, o, s, u, a, l, c, d;
          return D(function(h) {
            return h.g == 1 ? (n = Qe(t, "URI"), r = te(t, "CODECS", "jpeg") || "", e.j.has(n) ? h.return(e.j.get(n)) : (i = te(t, "LANGUAGE"), o = te(t, "NAME"), s = te(t, "CHARACTERISTICS"), u = Mc(e, e.G++, [n], r, "image", i, !1, o, null, null, s, !1, null, !1), (a = te(t, "RESOLUTION")) ? x(h, u.stream.createSegmentIndex(), 3) : h.A(2))) : (h.g != 2 && (l = Tr(u.stream.segmentIndex), (c = l.tilesLayout) && (u.stream.width = Number(a.split("x")[0]) * Number(c.split("x")[0]), u.stream.height = Number(a.split("x")[1]) * Number(c.split("x")[1])), u.stream.closeSegmentIndex()), (d = te(t, "BANDWIDTH")) && (u.stream.bandwidth = Number(d)), e.j.set(n, u), h.return(u));
          });
        }
        function gw(e, t) {
          var n = "video", r = Qe(t, "URI"), i = te(t, "CODECS") || "";
          if (i == "mjpg" && (n = "image"), e.j.has(r)) return e.j.get(r);
          var o = te(t, "LANGUAGE"), s = te(t, "NAME"), u = te(t, "CHARACTERISTICS");
          return n = Mc(e, e.G++, [r], i, n, o, !1, s, null, null, u, !1, null, !1), i = te(t, "RESOLUTION"), o = m(i ? i.split("x") : [null, null]), i = o.next().value, o = o.next().value, n.stream.width = Number(i) || void 0, n.stream.height = Number(o) || void 0, (t = te(t, "BANDWIDTH")) && (n.stream.bandwidth = Number(t)), e.j.set(r, n), n;
        }
        function AC(e, t, n, r) {
          for (var i = e.G++, o = [], s = m(t), u = s.next(); !u.done; u = s.next()) {
            var a = u.value;
            u = Qe(a, "URI"), a = te(a, "PATHWAY-ID"), e.l && a && ys(e.l, i, a, u), o.push(u);
          }
          if (s = o.sort().join(",") + n.sort().join(","), e.j.has(s)) return e.j.get(s);
          u = o.join(",");
          e: {
            if (t = te(t[0], "CLOSED-CAPTIONS"), r == "video") {
              if (e.g.disableText) {
                e.R = !1, t = null;
                break e;
              }
              if (t) {
                if (t != "NONE") {
                  t = e.J.get(t);
                  break e;
                }
                e.R = !1;
              } else if (!t && e.J.size) for (t = m(e.J.keys()), t = t.next(); !t.done; t = t.next()) {
                t = e.J.get(t.value);
                break e;
              }
            }
            t = null;
          }
          return n = Do(r, n), r = Mc(e, i, o, n, r, null, !1, u, null, t, null, !1, null, !1), e.j.set(s, r), r;
        }
        function Mc(e, t, n, r, i, o, s, u, a, l, c, d, h, p) {
          function g(P) {
            var N, M, R, k, O, L, U, j, G, H, B, F, W, z, me, Q, Be, ve, ze, Ce;
            return D(function(Ee) {
              switch (Ee.g) {
                case 1:
                  return N = xt, de(Ee, 2), x(Ee, P.promise, 4);
                case 4:
                  if (M = Ee.h, P.aborted) return Ee.return();
                  if (R = M.uri, R != M.originalUri && (k = E.P(), k.includes(R) || E.Af.push(R)), O = lp(e.ab, M.data), O.type != 1) throw new b(2, 4, 4017);
                  return L = Qn(O.ha, "EXT-X-DEFINE"), U = fp(e, L, R), j = !1, (!e.ba && e.g.hls.disableCodecGuessing || e.R && i == N.wa && !e.g.hls.disableClosedCaptionsDetection) && O.segments.length > 0 && (e.R = !1, j = !0), G = !e.ba && e.g.hls.disableCodecGuessing, H = Zt(e), x(Ee, yw(e, 0, U, O, w, r, i, o, s, u, a, l, c, d, h, p, void 0, j, G), 5);
                case 5:
                  if (B = Ee.h, P.aborted) return Ee.return();
                  F = B.stream, Aw(e, O), Zt(e) && !H && Ew(e, O), E.Vc = B.Vc, E.Mc = B.Mc, E.Ue = B.Ue, E.Te = B.Te, E.be = B.be, E.pf = B.pf, E.Qb = B.Qb, E.Rb = B.Rb, T.segmentIndex = F.segmentIndex, T.encrypted = F.encrypted, T.drmInfos = F.drmInfos, T.keyIds = F.keyIds, T.mimeType = F.mimeType, T.bandwidth = T.bandwidth || F.bandwidth, T.codecs = T.codecs || F.codecs, T.closedCaptions = T.closedCaptions || F.closedCaptions, T.width = T.width || F.width, T.height = T.height || F.height, T.hdr = T.hdr || F.hdr, T.colorGamut = T.colorGamut || F.colorGamut, T.frameRate = T.frameRate || F.frameRate, T.language == "und" && F.language != "und" && (T.language = F.language), T.language = T.language || F.language, T.channelsCount = T.channelsCount || F.channelsCount, T.audioSamplingRate = T.audioSamplingRate || F.audioSamplingRate, As(T), T.drmInfos.length && e.h.newDrmInfo(T), W = !1, (!l && T.closedCaptions || l && T.closedCaptions && l.size != T.closedCaptions.size) && (W = !0), e.i && W && e.h.makeTextStreamsForClosedCaptions(e.i), i == N.Na && (z = Tr(F.segmentIndex)) && z.ea && (T.mimeType = "application/mp4", As(T)), me = ml(T), T.segmentIndex.Hb(function(Le) {
                    Le.ea && (Le.ea.xd = me);
                  }), EC(e) && (e.Ac ? hp(e, [E]) : (e.Ac = !0, Q = Array.from(e.j.values()), Be = Q.filter(function(Le) {
                    return Le.stream.segmentIndex;
                  }), hp(e, Be), Ic(e), ve = e.u, ve > 0 && e.F.ka(ve))), gp(e, O.ha, T.type, U, w), e.i && (e.i.startTime = e.o), ye(Ee, 0);
                  break;
                case 2:
                  if (ze = he(Ee), T.closeSegmentIndex(), ze.code === 7001) return Ee.return();
                  if (Ce = e.h.disableStream(T), !Ce) throw ze;
                  q(Ee);
              }
            });
          }
          function w() {
            return e.l && n.length > 1 ? qu(e.l, t) : E.Af.concat(nw([e.H], n, e.B));
          }
          var T = Tw(e, r, i, o, s, u, a, l, c, d, h, p);
          n.some(function(P) {
            return P.startsWith("shaka://hls-muxed");
          }) && (T.isAudioMuxedInVideo = !0, T.mimeType = "video/mp2t", As(T));
          var E = { stream: T, type: i, Af: [], Vc: 0, Mc: 0, pf: /* @__PURE__ */ new Map(), Ue: !1, Te: !1, be: !1, og: -1, Qb: -1, Rb: -1, P: w }, A = null, I;
          return T.createSegmentIndex = function() {
            return A || (T.isAudioMuxedInVideo ? (T.segmentIndex = new Ue([]), Promise.resolve()) : (I = vp(e, E.P(), !0), A = new Promise(function(P) {
              P(g(I));
            })));
          }, T.closeSegmentIndex = function() {
            A && !T.segmentIndex && I.abort(), T.segmentIndex && (T.segmentIndex.release(), T.segmentIndex = null), A = null;
          }, E;
        }
        function mw(e) {
          var t = 1 / 0;
          e = m(e.j.values());
          for (var n = e.next(); !n.done; n = e.next()) n = n.value, n.stream.segmentIndex && n.stream.type != "text" && !n.stream.isAudioMuxedInVideo && (t = Math.min(t, n.Mc));
          return t;
        }
        function vw(e, t) {
          var n = [];
          t = m(t);
          for (var r = t.next(); !r.done; r = t.next()) r = r.value, r.segmentIndex && r.segmentIndex.Hb(function(i) {
            n.push(i);
          });
          e.m.le(n);
        }
        function hp(e, t) {
          if (!Zt(e)) for (var n = mw(e), r = m(t), i = r.next(); !i.done; i = r.next()) i.value.stream.segmentIndex.nd(0, n);
          vw(e, t.map(function(o) {
            return o.stream;
          })), r = Array.from(e.j.values()).filter(function(o) {
            return o.stream.segmentIndex;
          }), n = r.some(function(o) {
            return o.stream.type == "audio";
          }), i = r.some(function(o) {
            return o.stream.type == "video";
          }), r = Zt(e) && !e.kb, n = !Zt(e) && e.kb && !(n && i), e.g.hls.ignoreManifestProgramDateTime || r || n ? cw(e, t, r) : (rC(e, t), e.g.hls.ignoreManifestProgramDateTimeForTypes.length > 0 && cw(
            e,
            t
          ));
        }
        function ea(e, t) {
          return e.g.hls.ignoreManifestProgramDateTime ? !0 : e.g.hls.ignoreManifestProgramDateTimeForTypes.includes(t);
        }
        function EC(e) {
          if (!e.i || !e.i.variants.length) return !1;
          var t = [], n = [];
          e = m(e.i.variants);
          for (var r = e.next(); !r.done; r = e.next()) r = r.value, r.video && t.push(r.video), r.audio && n.push(r.audio);
          return !(t.length > 0 && !t.some(function(i) {
            return i.segmentIndex;
          }) || n.length > 0 && !n.some(function(i) {
            return i.segmentIndex;
          }));
        }
        function yw(e, t, n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A) {
          E = E === void 0 ? !0 : E, A = A === void 0 ? !0 : A;
          var I, P, N, M, R, k, O, L, U, j, G, H, B, F, W, z, me, Q, Be, ve, ze, Ce, Ee, Le, _e, be, Ie, ke, Lt;
          return D(function(It) {
            switch (It.g) {
              case 1:
                if (I = r.segments || [], P = I.every(function(Hn) {
                  return !!Nt(Hn.ha, "EXT-X-GAP");
                }), !I.length || P) throw new b(2, 4, 4053);
                if (IC(e, r), Zt(e) && pp(e, r), N = Zt(e) ? e.C.get(s) : /* @__PURE__ */ new Map(), M = Cw(e, r, N, n, i, s), R = M.segments, k = M.bandwidth, G = j = U = L = O = null, !(R.length > 0 && E)) {
                  It.A(2);
                  break;
                }
                return x(It, oC(e, R), 3);
              case 3:
                H = It.h, s != H.type && Zt(e) && (e.C.set(H.type, e.C.get(s)), e.C.set(s, /* @__PURE__ */ new Map())), s = H.type, u = H.language, c = H.channelCount, g = H.sampleRate, e.g.disableText || (d = H.closedCaptions), L = H.height, O = H.width, U = H.ye, j = H.colorGamut, G = H.frameRate, A && (T = H.mimeType, o = H.codecs);
              case 2:
                if (T) {
                  It.A(4);
                  break;
                }
                return x(It, kC(e, s, o, R), 5);
              case 5:
                T = It.h, s != xe || o || T != "application/mp4" || !R[0] || R[0].ea || (T = "text/vtt");
              case 4:
                return x(It, Sw(e, r, T, i, n), 6);
              case 6:
                if (B = It.h, F = B.drmInfos, W = B.keyIds, z = B.encrypted, me = B.Nh, z && !F.length && !me) throw new b(
                  2,
                  4,
                  4026
                );
                return Q = Tw(e, o, s, u, a, l, c, d, h, p, g, w), Q.encrypted = z && !me, Q.drmInfos = F, Q.keyIds = W, Q.mimeType = T, k && (Q.bandwidth = k), As(Q), s == "video" && (O || L || U || j) && Pw(Q, O, L, G, U, null, j), Zt(e) && pp(e, r), Be = R[0].startTime, ve = R[R.length - 1], ze = ve.endTime, Ce = new Ue(R), Q.segmentIndex = Ce, Le = (Ee = Nt(r.ha, "EXT-X-SERVER-CONTROL")) ? Ss(Ee, "CAN-SKIP-UNTIL") != null : !1, _e = Ee ? Ss(Ee, "CAN-BLOCK-RELOAD") != null : !1, be = xs(r.ha, "EXT-X-MEDIA-SEQUENCE", 0), Ie = ww(be, R), ke = Ie.Qb, Lt = Ie.Rb, It.return({
                  stream: Q,
                  type: s,
                  Af: [],
                  P: i,
                  Vc: Be,
                  Mc: ze,
                  Ue: Le,
                  Te: _e,
                  be: !1,
                  og: -1,
                  Qb: ke,
                  Rb: Lt,
                  pf: N
                });
            }
          });
        }
        function ww(e, t) {
          e = e + t.length - 1;
          var n = -1;
          if (!t.length) return e++, { Qb: e, Rb: n };
          t = t[t.length - 1];
          var r = t.g;
          return t.g.length ? (n = r.length - 1, r[r.length - 1].isPreload() || (e++, n = 0), { Qb: e, Rb: n }) : (e++, t.o && (n = 0), { Qb: e, Rb: n });
        }
        function Tw(e, t, n, r, i, o, s, u, a, l, c, d) {
          var h = mp(n, t) || Cc(n), p = [];
          if (a) {
            a = m(a.split(","));
            for (var g = a.next(); !g.done; g = a.next()) p.push(g.value);
          }
          return g = void 0, a = null, n == xe ? g = p.includes("public.accessibility.transcribes-spoken-dialog") && p.includes("public.accessibility.describes-music-and-sound") ? "caption" : "subtitle" : p.includes("public.accessibility.describes-video") && (a = "visually impaired"), p.length || g !== "subtitle" || p.push("subtitle"), g = null, n != "video" && (g = o), e = {
            id: e.G++,
            originalId: o,
            groupId: null,
            createSegmentIndex: function() {
              return Promise.resolve();
            },
            segmentIndex: null,
            mimeType: h,
            codecs: t,
            kind: n == xe ? "subtitle" : void 0,
            encrypted: !1,
            drmInfos: [],
            keyIds: /* @__PURE__ */ new Set(),
            language: He(r || "und"),
            originalLanguage: r,
            label: g,
            type: n,
            primary: i,
            trickModeVideo: null,
            dependencyStream: null,
            emsgSchemeIdUris: null,
            frameRate: void 0,
            pixelAspectRatio: void 0,
            width: void 0,
            height: void 0,
            bandwidth: void 0,
            roles: p,
            forced: l,
            channelsCount: s,
            audioSamplingRate: c,
            spatialAudio: d,
            closedCaptions: u,
            hdr: void 0,
            colorGamut: void 0,
            videoLayout: void 0,
            tilesLayout: void 0,
            accessibilityPurpose: a,
            external: !1,
            fastSwitching: !1,
            fullMimeTypes: /* @__PURE__ */ new Set(),
            isAudioMuxedInVideo: !1,
            baseOriginalId: null
          }, As(e), e;
        }
        function Sw(e, t, n, r, i) {
          var o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B, F, W;
          return D(function(z) {
            switch (z.g) {
              case 1:
                if (o = /* @__PURE__ */ new Map(), !e.g.ignoreDrmInfo && t.segments) {
                  for (s = m(t.segments), u = s.next(); !u.done; u = s.next()) if (a = u.value, l = Qn(a.ha, "EXT-X-KEY"), c = null, l.length) for (c = Iw(e, t, a.ha, r, i), d = m(l), h = d.next(); !h.done; h = d.next()) p = h.value, o.set(p, c);
                }
                w = g = !1, T = [], E = /* @__PURE__ */ new Set(), A = m(o), I = A.next();
              case 2:
                if (I.done) {
                  z.A(4);
                  break;
                }
                if (P = I.value, N = m(P), M = N.next().value, R = N.next().value, k = M, O = R, L = Qe(k, "METHOD"), L == "NONE") {
                  z.A(3);
                  break;
                }
                if (g = !0, U = te(k, "KEYFORMAT") || "identity", j = null, Pc(L)) {
                  w = !0, z.A(3);
                  break;
                }
                if (U == "identity") return x(z, Rw(e, k, n, r, O, i), 11);
                if (G = e.fc.get(U), !G) {
                  H = null, z.A(9);
                  break;
                }
                return x(z, G(k, n, O), 10);
              case 10:
                H = z.h;
              case 9:
                j = H, z.A(6);
                break;
              case 11:
                j = z.h;
              case 6:
                if (j) {
                  if (j.keyIds) for (B = m(j.keyIds), F = B.next(); !F.done; F = B.next()) W = F.value, E.add(W);
                  T.push(j);
                }
              case 3:
                I = A.next(), z.A(2);
                break;
              case 4:
                return z.return({ drmInfos: T, keyIds: E, encrypted: g, Nh: w });
            }
          });
        }
        function xw(e, t, n, r, i) {
          if (!C.crypto || !C.crypto.subtle) throw De("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"), new b(2, 4, 4042);
          var o = 0, s = te(t, "IV", "");
          if (s) {
            var u = Gi(s.substr(2));
            if (u.byteLength != 16) throw new b(2, 4, 4048);
          } else o = xs(n.ha, "EXT-X-MEDIA-SEQUENCE", 0);
          var a = ji(r(), Qe(t, "URI"), i), l = a.sort().join("");
          if (n = t.toString() + "-" + o + "-" + l, !e.va.has(n)) {
            var c = { bitsKey: 128, blockCipherMode: "CBC", iv: u, firstMediaSequenceNumber: o };
            switch (Qe(
              t,
              "METHOD"
            )) {
              case "AES-256":
                c.bitsKey = 256;
                break;
              case "AES-256-CTR":
                c.bitsKey = 256, c.blockCipherMode = "CTR";
            }
            c.fetchKey = function() {
              var d, h, p, g;
              return D(function(w) {
                if (w.g == 1) return e.O.has(l) || (d = At(a, e.g.retryParameters), h = oi(e, d, 6).promise, e.O.set(l, h)), x(w, e.O.get(l), 2);
                if (w.g != 3) {
                  if (p = w.h, !p.data || p.data.byteLength != c.bitsKey / 8) throw new b(2, 4, 4049);
                  return g = { name: c.blockCipherMode == "CTR" ? "AES-CTR" : "AES-CBC", length: c.bitsKey }, x(w, C.crypto.subtle.importKey("raw", p.data, g, !0, ["decrypt"]), 3);
                }
                c.cryptoKey = w.h, c.fetchKey = void 0, q(w);
              });
            }, e.va.set(n, c);
          }
          return e.va.get(n);
        }
        function Aw(e, t) {
          e.o == null && (t = Nt(t.ha, "EXT-X-START")) && (e.o = Number(Qe(t, "TIME-OFFSET")));
        }
        function IC(e, t) {
          var n = Nt(t.ha, "EXT-X-PLAYLIST-TYPE");
          t = Nt(t.ha, "EXT-X-ENDLIST"), t = n && n.value == "VOD" || t, n = n && n.value == "EVENT" && !t, n = !t && !n, t ? kc(e, Rc) : n ? kc(e, wp) : kc(e, NC);
        }
        function pp(e, t) {
          var n = 1 / 0, r = t.segments;
          if (r.length) for (var i = r.length - 1; i >= 0; ) {
            var o = Nt(r[i].ha, "EXTINF");
            if (o) {
              n = Number(o.value.split(",")[0]);
              break;
            }
            i--;
          }
          if (r = Nt(t.ha, "EXT-X-TARGETDURATION"), !r) throw new b(2, 4, 4024, "EXT-X-TARGETDURATION");
          r = Number(r.value), (i = Nt(t.ha, "EXT-X-PART-INF")) && (e.T = Number(Qe(i, "PART-TARGET"))), t = Nt(t.ha, "EXT-X-SERVER-CONTROL"), e.oa && e.T ? (e.u = e.zc ? e.T * 5 <= n ? Math.min(e.T, e.u) : Math.min(n, e.u) : Math.min(e.T, e.u), e.Ua = t ? Number(Qe(t, "PART-HOLD-BACK")) : 0) : (e.u = Math.min(n, e.u), n = t ? Ss(t, "HOLD-BACK") : null, e.Ta = n ? Number(n.value) : 0), e.eb = Math.max(r, e.eb);
        }
        function Ew(e, t) {
          var n = 0;
          if (e.g.defaultPresentationDelay) n = e.g.defaultPresentationDelay;
          else if (e.Ua) n = e.Ua;
          else if (e.Ta) n = e.Ta;
          else for (var r = t.segments.length, i = r - Math.min(r, e.g.hls.liveSegmentsDelay); i < r; i++) {
            var o = Nt(t.segments[i].ha, "EXTINF");
            n = o ? n + Number(o.value.split(",")[0]) : n + e.eb;
          }
          e.o && e.o < 0 && (n = Math.min(-e.o, n), e.o += n), e.m.Si(0), e.m.ph(n), e.m.$c(!1);
        }
        function Iw(e, t, n, r, i) {
          var o = Nt(n, "EXT-X-MAP");
          if (!o) return null;
          var s = Qe(o, "URI"), u = ji(r(), s, i);
          if (s = [u.toString(), te(o, "BYTERANGE", "")].join("-"), !e.Da.has(s)) {
            var a = void 0, l = null, c = !1;
            n = m(n);
            for (var d = n.next(); !d.done; d = n.next()) d = d.value, d.name == "EXT-X-KEY" ? (c = Qe(d, "METHOD"), Pc(c) && d.id < o.id ? (c = !1, a = xw(e, d, t, r, i)) : c = c != "NONE") : d.name == "EXT-X-BYTERANGE" && d.id < o.id && (l = d);
            t = MC(u, o, l, a, c), e.Da.set(s, t);
          }
          return e.Da.get(s);
        }
        function MC(e, t, n, r, i) {
          var o = 0, s = null;
          return t = te(t, "BYTERANGE"), !t && n && (t = n.value), t && (o = t.split("@"), s = Number(o[0]), o = Number(o[1]), s = o + s - 1, r && (n = s + 1 - o, n % 16 && (s += 16 - n % 16))), new pn(function() {
            return e;
          }, o, s, null, null, null, r, i);
        }
        function CC(e, t, n, r, i, o, s, u, a, l) {
          var c = r.ha, d = Nt(c, "EXTINF"), h = 0, p = 0, g = null;
          r.xc.length && (e.i.isLowLatency = !0);
          var w = null;
          if (!e.g.hls.ignoreManifestProgramDateTime) {
            var T = Nt(c, "EXT-X-PROGRAM-DATE-TIME");
            T && T.value && (w = Vr(T.value), e.kb = !0);
          }
          var E = Yr;
          if (Nt(c, "EXT-X-GAP") && (e.i.gapCount++, E = 2), !d) {
            if (r.xc.length == 0) throw new b(2, 4, 4024, "EXTINF");
            if (!e.oa) return null;
          }
          var A = [];
          T = !1;
          var I = null, P = !1, N = !1;
          if (e.oa && r.xc.length) {
            h = t && C.ReadableStream && e.g.hls.allowLowLatencyByteRangeOptimization;
            for (var M = w, R = {}, k = 0; k < r.xc.length; R = { Rf: void 0, oe: void 0 }, k++) {
              var O = r.xc[k], L = k == 0 ? n : A[A.length - 1], U = k == 0 ? i : L.endTime, j = Number(te(O, "DURATION")) || e.T;
              if (j) {
                var G = U + j, H = 0, B = null;
                if (O.name == "EXT-X-PRELOAD-HINT" ? (H = (H = te(O, "BYTERANGE-START")) ? Number(H) : 0, (L = te(O, "BYTERANGE-LENGTH")) ? B = H + Number(L) - 1 : H && (B = Number.MAX_SAFE_INTEGER)) : (H = te(O, "BYTERANGE"), B = m(Mw(L, H)), H = B.next().value, B = B.next().value), R.oe = te(O, "URI"), R.oe) {
                  L = Yr, te(O, "GAP") == "YES" && (e.i.gapCount++, L = 2, P = !0), R.Rf = null;
                  var F = /* @__PURE__ */ (function(z) {
                    return function() {
                      return z.Rf == null && (z.Rf = ji(u(), z.oe, o)), z.Rf;
                    };
                  })(R);
                  h && H >= 0 && B != null && (I = F, T = !0), U = new se(U, G, F, H, B, t, 0, 0, 1 / 0, [], "", null, M, L, l), O.name == "EXT-X-PRELOAD-HINT" && (U.Rg(), N = !0), te(O, "INDEPENDENT") != "YES" && k > 0 && U.wd(), O = a, O || (A.length && A[0].mimeType ? O = A[0].mimeType : R.oe && (R = ns(R.oe), O = Dc.get(s).get(R) || null)), O && (U.mimeType = O, bw.has(O) && (U.ea = null)), A.push(U), M && (M += j);
                }
              }
            }
          }
          if (d) {
            if (d = Number(d.value.split(",")[0]), d == 0) return null;
            h = i + d;
          } else if (A.length) h = A[A.length - 1].endTime;
          else return null;
          T && (P || A[0].startByte != 0 ? (T = !1, I = null) : A = []), (d = Nt(c, "EXT-X-BYTERANGE")) ? (g = m(Mw(n, d.value)), p = g.next().value, g = g.next().value) : A.length && (p = A[0].startByte, g = A[A.length - 1].endByte), n = "", d = null, s == "image" && (n = "1x1", s = Nt(c, "EXT-X-TILES")) && (n = Qe(s, "LAYOUT"), (s = te(s, "DURATION")) && (d = Number(s)));
          var W = null;
          return t = new se(i, h, function() {
            return I ? I() : (W == null && (W = ji(u(), r.g, o)), W || []);
          }, p, g, t, 0, 0, 1 / 0, A, n, d, w, E, l, A.length > 0 && !!r.g), a && (t.mimeType = a, bw.has(a) && (t.ea = null)), T && (e.zc = !0, t.ti(), N && t.Rg()), t;
        }
        function Mw(e, t) {
          var n = 0, r = null;
          return t && (n = t.split("@"), t = Number(n[0]), n = n[1] ? Number(n[1]) : e.endByte + 1, r = n + t - 1), [n, r];
        }
        function gp(e, t, n, r, i) {
          if (n == "video" || n == "audio") {
            var o = e.m.m;
            if (o != null && !ea(e, n)) for (t = Qn(t, "EXT-X-DATERANGE"), t = t.filter(function(L) {
              return Ss(L, "START-DATE") != null;
            }).sort(function(L, U) {
              return L = Qe(L, "START-DATE"), U = Qe(U, "START-DATE"), L < U ? -1 : L > U ? 1 : 0;
            }), n = 0; n < t.length; n++) {
              var s = t[n];
              try {
                var u = Qe(s, "START-DATE"), a = Vr(u);
                if (!isNaN(a)) {
                  var l = Math.max(0, a - o), c = null, d = te(s, "END-DATE");
                  if (d) {
                    var h = Vr(d);
                    if (!isNaN(h) && (c = h - o, c < 0)) continue;
                  }
                  if (c == null) {
                    var p = te(s, "DURATION") || te(s, "PLANNED-DURATION");
                    if (p) {
                      var g = parseFloat(p);
                      if (isNaN(g) || (c = l + g), a - o + g < 0) continue;
                    }
                  }
                  var w = te(s, "CLASS") || "com.apple.quicktime.HLS", T = te(s, "END-ON-NEXT") == "YES";
                  if (c == null && T) {
                    for (var E = n + 1; E < t.length; E++) {
                      var A = te(t[E], "CLASS") || "com.apple.quicktime.HLS";
                      if (w == A) {
                        var I = Qe(t[E], "START-DATE"), P = Vr(I);
                        if (!isNaN(P) && P && P > a) {
                          c = Math.max(0, P - o);
                          break;
                        }
                      }
                    }
                    if (c == null) continue;
                  }
                  E = ["CLASS", "START-DATE", "END-DATE", "DURATION", "END-ON-NEXT"];
                  for (var N = [], M = m(s.attributes), R = M.next(); !R.done; R = M.next()) {
                    var k = R.value;
                    if (!E.includes(k.name)) {
                      var O = rw(k.value, r);
                      (k.name == "X-ASSET-URI" || k.name == "X-ASSET-LIST") && (O = ji(i(), k.value, r)[0]), N.push({ key: k.name, description: "", data: O, mimeType: null, pictureType: null });
                    }
                  }
                  N.length > 1 && e.h.onMetadata(w, l, c, N);
                }
              } catch {
              }
            }
          }
        }
        function Cw(e, t, n, r, i, o) {
          function s(L) {
            if (L = ns(L), !L) return null;
            var U = Dc.get(o).get(L);
            return U || (U = yp.get(L)), U;
          }
          var u = t.segments, a = null, l = null, c = null, d = null, h = void 0, p = xs(t.ha, "EXT-X-DISCONTINUITY-SEQUENCE", -1), g = xs(t.ha, "EXT-X-MEDIA-SEQUENCE", 0), w = Nt(t.ha, "EXT-X-SKIP"), T = w ? Number(te(w, "SKIPPED-SEGMENTS")) : 0, E = g + T, A = 0;
          Zt(e) && n.has(E) && (A = n.get(E)), A === 0 && e.Fa == wp && n.size > 0 && !n.has(E) && e.m.i != null && (A = e.m.Jb());
          var I = [], P = null;
          w = [];
          for (var N = 0; N < u.length; N++) {
            var M = u[N];
            (E = Nt(M.ha, "EXT-X-MAP")) && E.id !== l && (a = Iw(e, t, M.ha, i, r), l = E.id), E = M.g;
            var R = "";
            E && (R = ns(E)), R !== d && (c = s(E), d = R), R = N == 0 ? A : P.endTime, E = g + T + N, Nt(M.ha, "EXT-X-DISCONTINUITY") && (p++, P && P.ea && (P.ea.g = R));
            for (var k = m(M.ha), O = k.next(); !O.done; O = k.next()) O = O.value, O.name == "EXT-X-KEY" && (Pc(Qe(O, "METHOD")) ? h = xw(e, O, t, i, r) : h = void 0);
            if (n.set(E, R), R = CC(e, a, P, M, R, r, o, i, c, h)) {
              if ((P = xs(M.ha, "EXT-X-BITRATE")) ? (w.push({ bitrate: P, duration: R.endTime - R.startTime }), R.bandwidth = P) : R.endByte ? (M = rf(R)) && (P = R.endTime - R.startTime, M = M * 8 / P / 1e3, w.push({
                bitrate: M,
                duration: P
              }), R.bandwidth = M) : w.length && (P = w.pop(), P.duration += R.endTime - R.startTime, w.push(P), R.bandwidth = P.bitrate), R.bandwidth) for (P = m(R.g), M = P.next(); !M.done; M = P.next()) M.value.bandwidth = R.bandwidth;
              P = R, R.i = p, ea(e, o) && e.N != null && E < e.N || I.push(R);
            }
          }
          if (t = void 0, w.length && (t = w.reduce(function(L, U) {
            return L + U.duration;
          }, 0), t = Math.round(w.reduce(function(L, U) {
            return L + U.bitrate * U.duration;
          }, 0) / t * 1e3)), w = I.some(function(L) {
            return L.h != null;
          })) {
            for (n = {}, r = 0; r < I.length; n = {
              Ye: void 0,
              Xe: void 0,
              Qe: void 0,
              Xc: void 0,
              Pe: void 0
            }, r++) if (n.Xc = I[r], n.Xc.h == null) for (n.Xe = 0, n.Ye = r, i = /* @__PURE__ */ (function(L) {
              return function() {
                var U = I[L.Ye];
                if (U) {
                  if (U.h != null) return U.h + L.Xe;
                  L.Xe -= U.endTime - U.startTime, L.Ye += 1;
                }
                return null;
              };
            })(n), n.Pe = 0, n.Qe = r, u = /* @__PURE__ */ (function(L) {
              return function() {
                var U = I[L.Qe];
                if (U) {
                  if (U != L.Xc && (L.Pe += U.endTime - U.startTime), U.h != null) return U.h + L.Pe;
                  --L.Qe;
                }
                return null;
              };
            })(n); n.Xc.h == null; ) n.Xc.h = u(), n.Xc.h == null && (n.Xc.h = i());
          }
          if (w) for (n = m(I), r = n.next(); !r.done; r = n.next()) for (i = r.value, r = i.h, i = m(i.g), u = i.next(); !u.done; u = i.next()) u = u.value, u.h = r, r += u.endTime - u.startTime;
          if (n = e.ma, w && n != 1 / 0 && !ea(e, o)) for (e = m(I), w = e.next(); !w.done; w = e.next()) w.value.Ah(n);
          return { segments: I, bandwidth: t };
        }
        function mp(e, t) {
          if (e == xe) {
            if (t == "vtt" || t == "wvtt") return "text/vtt";
            if (t && t !== "") return "application/mp4";
          }
          return e != "image" || t && t != "jpeg" ? e == "audio" && t == "mp4a.40.34" ? "audio/mpeg" : t == "mjpg" ? "application/mp4" : null : "image/jpeg";
        }
        function Cc(e) {
          return e == xe ? "text/vtt" : Dc.get(e).get("mp4");
        }
        function kw(e, t) {
          e = Zt(e) ? Math.trunc((t.length - 1) / 2) : 0;
          for (var n = t[e]; n.bc() == 2 && e + 1 < t.length; ) e++, n = t[e];
          return { segment: n, segmentIndex: e };
        }
        function kC(e, t, n, r) {
          var i, o, s, u, a, l, c, d, h, p, g, w, T;
          return D(function(E) {
            switch (E.g) {
              case 1:
                return i = Xn, o = kw(e, r), s = o.segment, s.status == 2 ? E.return(Cc(t)) : (a = s.P(), (l = ns(a[0])) && (c = Dc.get(t), (d = c.get(l)) || (d = yp.get(l))) ? E.return(d) : (u = mp(t, n)) ? E.return(u) : (p = 1, g = At(a, e.g.retryParameters), de(E, 2), g.method = "HEAD", x(E, oi(e, g, i, { type: p }).promise, 4)));
              case 4:
                w = E.h, h = w.headers["content-type"], ye(E, 3);
                break;
              case 2:
                if (T = he(E), !T || T.code != 1002 && T.code != 1001) {
                  E.A(3);
                  break;
                }
                return g.method = "GET", e.g.hls.allowRangeRequestsToGuessMimeType && (g.headers.Range = "bytes=0-0"), x(E, oi(e, g, i, { type: p }).promise, 6);
              case 6:
                w = E.h, h = w.headers["content-type"];
              case 3:
                if (!h) {
                  E.A(7);
                  break;
                }
                if (u = h.toLowerCase().split(";")[0], u != "application/octet-stream") {
                  E.A(8);
                  break;
                }
                if (w.data.byteLength) {
                  E.A(9);
                  break;
                }
                return g.method = "GET", x(E, oi(e, g, i, { type: p }).promise, 10);
              case 10:
                w = E.h;
              case 9:
                $o(pe(w.data)) && (u = "video/mp2t");
              case 8:
                if (u != "application/octet-stream") return E.return(u);
              case 7:
                return E.return(Cc(t));
            }
          });
        }
        function Pw(e, t, n, r, i, o, s) {
          e && (e.width = Number(t) || void 0, e.height = Number(n) || void 0, e.frameRate = Number(r) || void 0, e.hdr = i || void 0, e.videoLayout = o || void 0, e.colorGamut = s || void 0);
        }
        function vp(e, t, n) {
          return oi(e, At(t, e.g.retryParameters), 0, { type: n ? 2 : 3 });
        }
        function Dw(e) {
          var t, n, r, i, o, s;
          return D(function(u) {
            switch (u.g) {
              case 1:
                return e.h ? (de(u, 2), t = Date.now(), x(u, e.update(), 4)) : u.return();
              case 4:
                n = Date.now(), Zt(e) && (r = (n - t) / 1e3, e.cc.sample(1, r), i = e.g.updatePeriod > 0 ? e.g.updatePeriod : e.u, o = Math.max(0, i - va(e.cc)), e.F.ka(o)), ye(u, 3);
                break;
              case 2:
                if (s = he(u), !e.h) return u.return();
                if (e.g.raiseFatalErrorOnManifestUpdateRequestFailure) return e.h.onError(s), u.return();
                s.severity = 1, e.h.onError(s), e.F.ka(0.1);
              case 3:
                if (!e.h) return u.return();
                e.h.onManifestUpdated(), q(u);
            }
          });
        }
        function Zt(e) {
          return e.Fa != Rc;
        }
        function kc(e, t) {
          e.Fa = t, e.m && e.m.$c(!Zt(e)), Zt(e) || e.F.stop();
        }
        function oi(e, t, n, r) {
          if (!e.$) throw new b(2, 7, 7001);
          return r || (r = {}), r.isPreload = e.ec(), t = e.h.networkingEngine.request(n, t, r), eo(e.$, t), t;
        }
        function Pc(e) {
          return e == "AES-128" || e == "AES-256" || e == "AES-256-CTR";
        }
        function PC(e, t, n, r) {
          var i, o, s, u, a, l;
          return D(function(c) {
            if (c.g == 1) {
              if (n == "video/mp2t") throw new b(2, 4, 4040);
              if (C.shakaMediaKeysPolyfill === "apple") throw new b(2, 4, 4041);
              if (i = Qe(t, "METHOD"), o = ["SAMPLE-AES", "SAMPLE-AES-CTR"], !o.includes(i)) return c.return(null);
              s = "cenc", i == "SAMPLE-AES" && (s = "cbcs"), u = Qe(t, "URI"), a = Br("com.apple.fps", s, null, u);
              var d = new yt(u).Fb.replace(/-/g, "").toLowerCase();
              return (l = d.length === 32 && /^[0-9a-f]+$/.test(d) ? d : null) || !r ? c.A(2) : x(c, Lw(e, r), 3);
            }
            return c.g != 2 && (l = c.h), l && a.keyIds.add(l), c.return(a);
          });
        }
        function Rw(e, t, n, r, i, o) {
          var s, u, a, l, c, d, h, p, g, w, T, E;
          return D(function(A) {
            switch (A.g) {
              case 1:
                if (n == "video/mp2t") throw new b(2, 4, 4040);
                if (C.shakaMediaKeysPolyfill === "apple") throw new b(2, 4, 4041);
                if (s = Qe(t, "METHOD"), u = ["SAMPLE-AES", "SAMPLE-AES-CTR"], !u.includes(s)) return A.return(null);
                if (a = ji(r(), Qe(t, "URI"), o), a[0].startsWith("data:text/plain;base64,")) {
                  l = hi(Wn(a[0].split("data:text/plain;base64,").pop())), A.A(2);
                  break;
                }
                return c = a.sort().join(""), e.ya.has(c) || (d = At(a, e.g.retryParameters), h = oi(e, d, 6).promise, e.ya.set(c, h)), x(A, e.ya.get(c), 3);
              case 3:
                p = A.h, l = hi(p.data);
              case 2:
                if (g = "00000000000000000000000000000000", !i) {
                  A.A(4);
                  break;
                }
                return x(A, Lw(e, i), 5);
              case 5:
                (w = A.h) && (g = w);
              case 4:
                return T = /* @__PURE__ */ new Map(), T.set(g, l), E = "cenc", s == "SAMPLE-AES" && (E = "cbcs"), A.return(Lg(T, E));
            }
          });
        }
        function Lw(e, t) {
          var n, r, i, o;
          return D(function(s) {
            return s.g == 1 ? (n = null, e.za.has(t) ? (n = e.za.get(t), s.A(2)) : (r = Su(t.P(), t.Kc(), t.Ic(), e.g.retryParameters), i = Xn, x(s, oi(e, r, i, { type: 0 }).promise, 3))) : (s.g != 2 && (o = s.h, t.se(o.data), n = pE(o.data), e.za.set(t, n)), s.return(n));
          });
        }
        Y("shaka.hls.HlsParser", Ec);
        var yp = (/* @__PURE__ */ new Map()).set("aac", "audio/aac").set("ac3", "audio/ac3").set("ec3", "audio/ec3").set("mp3", "audio/mpeg"), DC = (/* @__PURE__ */ new Map()).set("mp4", "audio/mp4").set("mp4a", "audio/mp4").set("m4s", "audio/mp4").set("m4i", "audio/mp4").set("m4a", "audio/mp4").set("m4f", "audio/mp4").set("cmfa", "audio/mp4").set("ts", "video/mp2t").set("tsa", "video/mp2t"), RC = (/* @__PURE__ */ new Map()).set("mp4", "video/mp4").set("mp4v", "video/mp4").set("m4s", "video/mp4").set("m4i", "video/mp4").set("m4v", "video/mp4").set("m4f", "video/mp4").set("cmfv", "video/mp4").set(
          "ts",
          "video/mp2t"
        ).set("tsv", "video/mp2t"), LC = (/* @__PURE__ */ new Map()).set("mp4", "application/mp4").set("m4s", "application/mp4").set("m4i", "application/mp4").set("m4f", "application/mp4").set("cmft", "application/mp4").set("vtt", "text/vtt").set("webvtt", "text/vtt").set("ttml", "application/ttml+xml"), bC = (/* @__PURE__ */ new Map()).set("jpg", "image/jpeg").set("png", "image/png").set("svg", "image/svg+xml").set("webp", "image/webp").set("avif", "image/avif"), Dc = (/* @__PURE__ */ new Map()).set("audio", DC).set("video", RC).set("text", LC).set("image", bC), bw = new Set(["video/mp2t"].concat(X(Kr))), Rc = "VOD", NC = "EVENT", wp = "LIVE";
        Ki("application/x-mpegurl", function() {
          return new Ec();
        }), Ki("application/vnd.apple.mpegurl", function() {
          return new Ec();
        });
        function Lc(e) {
          return hc(e);
        }
        var OC = (/* @__PURE__ */ new Map()).set("com.microsoft.playready", Lc).set("com.microsoft.playready.recommendation", Lc).set("com.microsoft.playready.software", Lc).set("com.microsoft.playready.hardware", Lc);
        function Tp() {
          var e = this;
          this.h = this.g = null, this.l = [], this.j = null, this.u = 1, this.i = null, this.F = new Eo(5), this.o = new Ae(function() {
            jC(e);
          }), this.C = new Vo(), this.m = /* @__PURE__ */ new Map(), this.B = function() {
            return !1;
          };
        }
        f = Tp.prototype, f.configure = function(e, t) {
          this.g = e, t && (this.B = t);
        }, f.start = function(e, t) {
          var n = this;
          return D(function(r) {
            if (r.g == 1) return n.l = [e], n.h = t, x(r, Sp(n), 2);
            if (!n.h) throw new b(2, 7, 7001);
            return r.return(n.j);
          });
        };
        function jC(e) {
          var t;
          D(function(n) {
            switch (n.g) {
              case 1:
                return de(n, 2), x(n, Sp(e), 4);
              case 4:
                ye(n, 3);
                break;
              case 2:
                t = he(n), e.h && (t.severity = 1, e.h.onError(t));
              case 3:
                if (!e.h) return n.return();
                q(n);
            }
          });
        }
        f.stop = function() {
          return this.g = this.h = null, this.l = [], this.j = null, this.o != null && (this.o.stop(), this.o = null), this.m.clear(), this.C.destroy();
        }, f.update = function() {
          var e = this, t;
          return D(function(n) {
            if (n.g == 1) return de(n, 2), x(n, Sp(e), 4);
            if (n.g != 2) return ye(n, 0);
            if (t = he(n), !e.h || !t) return n.return();
            e.h.onError(t), q(n);
          });
        }, f.onExpirationUpdated = function() {
        }, f.onInitialVariantChosen = function() {
        }, f.banLocation = function() {
        }, f.setMediaElement = function() {
        };
        function Sp(e) {
          var t, n, r, i, o, s, u;
          return D(function(a) {
            if (a.g == 1) return t = At(e.l, e.g.retryParameters), n = e.h.networkingEngine, r = Date.now(), i = n.request(0, t, { type: 5, isPreload: e.B() }), eo(e.C, i), x(a, i.promise, 2);
            if (o = a.h, !e.h) return a.return();
            o.uri && !e.l.includes(o.uri) && e.l.unshift(o.uri);
            var l = o.uri, c = o.data, d = e.g.mss.manifestPreprocessor;
            if (d != Rl) {
              if (Ne("manifest.mss.manifestPreprocessor configuration", "Please Use manifest.mss.manifestPreprocessorTXml instead."), c = O1(c, "SmoothStreamingMedia"), !c) throw new b(
                2,
                4,
                4046,
                l
              );
              d(c), c = sr(c.outerHTML);
            }
            var h = Xs(c, "SmoothStreamingMedia");
            if (!h) throw new b(2, 4, 4046, l);
            if (l = e.g.mss.manifestPreprocessorTXml, l != Ll && l(h), e.i || (e.i = new fe(null, 0)), l = ge(h, "IsLive", ba, !1)) throw new b(2, 4, 4047);
            e.i.$c(!l), d = ge(h, "TimeScale", _t, 1e7), c = ge(h, "DVRWindowLength", _t), l && (c === 0 || isNaN(c)) && (c = 1 / 0);
            var p = ge(h, "CanSeek", ba, !1);
            c === 0 && p && (c = 1 / 0), p = null, c && c > 0 && (p = c / d), l && !isNaN(e.g.availabilityWindowOverride) && (p = e.g.availabilityWindowOverride), p == null && (p = 1 / 0), e.i.If(p), c = ge(h, "Duration", _t, 1 / 0), l || e.i.Ab(c / d), l = { variants: [], textStreams: [], timescale: d, duration: c / d };
            var g;
            for (p = We(h, "Protection"), d = e.g.mss.keySystemsBySystemId, c = [], p = m(p), g = p.next(); !g.done; g = p.next()) c = c.concat(We(g.value, "ProtectionHeader"));
            if (c.length) {
              for (p = [], g = 0; g < c.length; g++) {
                var w = c[g], T = w.attributes.SystemID.toLowerCase(), E = d[T];
                if (E) {
                  var A;
                  e: {
                    if (A = l1(w)) {
                      A = m(wr(A, "DATA"));
                      for (var I = A.next(); !I.done; I = A.next()) if (I = ut(I.value, "KID")) {
                        A = Wn(wt(I)), A = new Uint8Array([
                          A[3],
                          A[2],
                          A[1],
                          A[0],
                          A[5],
                          A[4],
                          A[7],
                          A[6]
                        ].concat(X(A.slice(8)))), A = hi(A);
                        break e;
                      }
                    }
                    A = null;
                  }
                  I = Wn(wt(w)), T = Gi(T.replace(/-/g, "")), T = [{ initData: el(I, T, /* @__PURE__ */ new Set(), 0), initDataType: "cenc", keyId: A }], T = Br(E, "cenc", T), A && T.keyIds.add(A), (E = OC.get(E)) && (T.licenseServerUri = E(w)), p.push(T);
                }
              }
              d = p;
            } else d = [];
            for (g = d, p = [], d = [], c = [], h = We(h, "StreamIndex"), h = m(h), w = h.next(); !w.done; w = h.next()) {
              w = w.value, E = We(w, "QualityLevel"), T = l.timescale, A = l.duration, I = We(w, "c");
              for (var P = [], N = 0, M = 0; M < I.length; ++M) {
                var R = I[M], k = I[M + 1], O = ge(R, "t", _t), L = ge(
                  R,
                  "d",
                  _t
                );
                if (R = ge(R, "r", Ut), !L) break;
                if (O = O ?? N, (R = R || 0) && R--, R < 0) if (k) {
                  if (k = ge(k, "t", _t), k == null) break;
                  if (O >= k) break;
                  R = Math.ceil((k - O) / L) - 1;
                } else {
                  if (A == 1 / 0) break;
                  if (O / T >= A) break;
                  R = Math.ceil((A * T - O) / L) - 1;
                }
                for (k = 0; k <= R; ++k) N = O + L, P.push({ start: O / T, end: N / T, Md: O }), O = N;
              }
              for (T = P, E = m(E), A = E.next(); !A.done; A = E.next()) (A = UC(e, w, A.value, T, g, l)) && (A.type != "audio" || e.g.disableAudio ? A.type != "video" || e.g.disableVideo ? A.type != xe || e.g.disableText || c.push(A) : d.push(A) : p.push(A));
            }
            for (h = [], p = m(p.length > 0 ? p : [null]), g = p.next(); !g.done; g = p.next()) for (g = g.value, w = m(d.length > 0 ? d : [null]), P = w.next(); !P.done; P = w.next()) E = h, T = E.push, A = e, I = g, P = P.value, M = 0, I && I.bandwidth && I.bandwidth > 0 && (M += I.bandwidth), P && P.bandwidth && P.bandwidth > 0 && (M += P.bandwidth), A = { id: A.u++, language: I ? I.language : "und", disabledUntilTime: 0, primary: !!I && I.primary || !!P && P.primary, audio: I, video: P, bandwidth: M, allowedByApplication: !0, allowedByKeySystem: !0, decodingInfos: [] }, T.call(E, A);
            l.variants = h, l.textStreams = c, e.j ? (e.j.variants = l.variants, e.j.textStreams = l.textStreams, e.h.filter(e.j)) : (e.j = { presentationTimeline: e.i, variants: l.variants, textStreams: l.textStreams, imageStreams: [], offlineSessionIds: [], sequenceMode: e.g.mss.sequenceMode, ignoreManifestTimestampsInSegmentsMode: !1, type: "MSS", serviceDescription: null, nextUrl: null, periodCount: 1, gapCount: 0, isLowLatency: !1, startTime: null }, e.i.nf()), Promise.resolve(), s = Date.now(), u = (s - r) / 1e3, e.F.sample(1, u), q(a);
          });
        }
        function UC(e, t, n, r, i, o) {
          var s = t.attributes.Type;
          if (s !== "audio" && s !== "video" && s !== "text") return De("Ignoring unrecognized type:", s), null;
          var u = t.attributes.Language, a = e.u++, l = ge(n, "Bitrate", Pr), c = ge(n, "MaxWidth", Pr), d = ge(n, "MaxHeight", Pr), h = ge(n, "Channels", Pr), p = ge(n, "SamplingRate", Pr), g = o.duration;
          r.length && (g = r[r.length - 1].end - r[0].start);
          var w = e.i.getDuration();
          e.i.Ab(Math.min(g, w)), (w = t.attributes.Name) && (w += n.attributes.Index), w || (w = String(a));
          var T = {
            id: a,
            originalId: w,
            groupId: null,
            createSegmentIndex: function() {
              return Promise.resolve();
            },
            closeSegmentIndex: function() {
              return Promise.resolve();
            },
            segmentIndex: null,
            mimeType: "",
            codecs: "",
            frameRate: void 0,
            pixelAspectRatio: void 0,
            bandwidth: l || 0,
            width: c || void 0,
            height: d || void 0,
            kind: "",
            encrypted: i.length > 0,
            drmInfos: i,
            keyIds: /* @__PURE__ */ new Set(),
            language: He(u || "und"),
            originalLanguage: u,
            label: "",
            type: "",
            primary: !1,
            trickModeVideo: null,
            dependencyStream: null,
            emsgSchemeIdUris: [],
            roles: [],
            forced: !1,
            channelsCount: h,
            audioSamplingRate: p,
            spatialAudio: !1,
            closedCaptions: null,
            hdr: void 0,
            colorGamut: void 0,
            videoLayout: void 0,
            tilesLayout: void 0,
            matchedStreams: [],
            mssPrivateData: { duration: g, timescale: o.timescale, codecPrivateData: null },
            accessibilityPurpose: null,
            external: !1,
            fastSwitching: !1,
            fullMimeTypes: /* @__PURE__ */ new Set(),
            isAudioMuxedInVideo: !1,
            baseOriginalId: null
          };
          if ((i = t.attributes.Subtype) && ((i = GC.get(i)) && T.roles.push(i), i === "main" && (T.primary = !0)), i = n.attributes.FourCC, (i === null || i === "") && (i = t.attributes.FourCC), !i) {
            if (s === "audio") i = "AAC";
            else if (s === "video") return De('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'), null;
          }
          if (!HC.includes(i.toUpperCase())) return De("Codec not supported:", i), null;
          switch (n = _C(n, s, i, T), T.mssPrivateData.codecPrivateData = n, s) {
            case "audio":
              if (!n) return De("Quality unsupported without CodecPrivateData", s), null;
              T.type = "audio", T.mimeType = "mss/audio/mp4", T.codecs = BC(i, n);
              break;
            case "video":
              if (!n) return De("Quality unsupported without CodecPrivateData", s), null;
              T.type = "video", T.mimeType = "mss/video/mp4", T.codecs = FC(n);
              break;
            case "text":
              T.type = xe, T.mimeType = "application/mp4", (i === "TTML" || i === "DFXP") && (T.codecs = "stpp");
          }
          return T.fullMimeTypes.add(gt(T.mimeType, T.codecs)), T.createSegmentIndex = function() {
            if (T.segmentIndex) return Promise.resolve();
            if (e.m.has(T.id)) var E = e.m.get(T.id);
            else E = [], T.type == "video" && (E = T.mssPrivateData.codecPrivateData.split("00000001").slice(1)), E = { id: T.id, type: T.type, codecs: T.codecs, encrypted: T.encrypted, timescale: T.mssPrivateData.timescale, duration: T.mssPrivateData.duration, Db: E, Ga: new Uint8Array([]), Sa: new Uint8Array([]), Za: 0, $a: 0, data: null, stream: T }, E = zo(new Wo([E])), e.m.set(T.id, E);
            return E = VC(e, new pn(function() {
              return [];
            }, 0, null, ml(T), T.mssPrivateData.timescale, E, null, T.encrypted), T, t, r), T.segmentIndex = new Ue(E), Promise.resolve();
          }, T.closeSegmentIndex = function() {
            T.segmentIndex && (T.segmentIndex.release(), T.segmentIndex = null);
          }, T;
        }
        function _C(e, t, n, r) {
          if (e = e.attributes.CodecPrivateData) return e;
          if (t !== "audio") return null;
          t = r.channelsCount || 2, e = r.audioSamplingRate || 44100;
          var i = { 96e3: 0, 88200: 1, 64e3: 2, 48e3: 3, 44100: 4, 32e3: 5, 24e3: 6, 22050: 7, 16e3: 8, 12e3: 9, 11025: 10, 8e3: 11, 7350: 12 };
          return r = i[e], n === "AACH" ? (n = new Uint8Array(4), e = i[e * 2], n[0] = 40 | r >> 1, n[1] = r << 7 | t << 3 | e >> 1, n[2] = e << 7 | 8, n[3] = 0, t = new Uint16Array(2), t[0] = (n[0] << 8) + n[1], t[1] = (n[2] << 8) + n[3], t[0].toString(16) + t[1].toString(16)) : (n = new Uint8Array(2), n[0] = 16 | r >> 1, n[1] = r << 7 | t << 3, t = new Uint16Array(1), t[0] = (n[0] << 8) + n[1], t[0].toString(16));
        }
        function BC(e, t) {
          var n = 0;
          return e === "AACH" && (n = 5), t ? n === 0 && (n = (parseInt(t.substr(0, 2), 16) & 248) >> 3) : (n = 2, e === "AACH" && (n = 5)), "mp4a.40." + n;
        }
        function FC(e) {
          var t = /00000001[0-9]7/.exec(e);
          return t.length && e ? "avc1." + e.substr(e.indexOf(t[0]) + 10, 6) : "";
        }
        function VC(e, t, n, r, i) {
          var o = r.attributes.Url.replace("{bitrate}", String(n.bandwidth));
          r = [], i = m(i);
          for (var s = i.next(), u = {}; !s.done; u = { Mf: void 0 }, s = i.next()) u.Mf = s.value, r.push(new se(u.Mf.start, u.Mf.end, /* @__PURE__ */ (function(a) {
            return function() {
              return bt(e.l, [o.replace("{start time}", String(a.Mf.Md))]);
            };
          })(u), 0, null, t, 0, 0, n.mssPrivateData.duration));
          return r;
        }
        Y("shaka.mss.MssParser", Tp);
        var HC = "AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "), GC = (/* @__PURE__ */ new Map()).set("CAPT", "main").set("SUBT", "alternate").set("DESC", "main");
        Ki("application/vnd.ms-sstr+xml", function() {
          return new Tp();
        });
        function Nw(e, t, n, r, i, o, s) {
          if (n >= 200 && n <= 299 && n != 202 || n == 304) return { uri: i || r, originalUri: r, data: t, status: n, headers: e, fromCache: !!e["x-shaka-from-cache"], originalRequest: o };
          o = null;
          try {
            o = Mr(t);
          } catch {
          }
          throw new b(n == 401 || n == 403 ? 2 : 1, 1, 1001, r, n, o, e, s, i || r);
        }
        function xp() {
        }
        function bc(e, t, n, r, i, o) {
          var s = new YC();
          try {
            Go(t.headers).forEach(function(c, d) {
              s.append(d, c);
            });
          } catch (c) {
            return Ti(new b(1, 1, 1002, e, c, n));
          }
          var u = new XC(), a = { Sh: !1, fj: !1 };
          if (e = KC(e, t, n, { body: t.body || void 0, headers: s, method: t.method, signal: u.signal, credentials: t.allowCrossSiteCredentials ? "include" : void 0 }, a, r, i, t.streamDataCallback, o.minBytesForProgressEvents || 0), e = new mt(e, function() {
            return a.Sh = !0, u.abort(), Promise.resolve();
          }), t = t.retryParameters.timeout) {
            var l = new Ae(function() {
              a.fj = !0, u.abort();
            });
            l.ka(t / 1e3), e.finally(function() {
              l.stop();
            });
          }
          return e;
        }
        function KC(e, t, n, r, i, o, s, u, a) {
          var l, c, d, h, p, g, w, T, E, A, I, P, N, M, R;
          return D(function(k) {
            switch (k.g) {
              case 1:
                return l = zC, c = qC, h = new ArrayBuffer(0), g = p = 0, w = {}, T = Date.now(), de(k, 2), x(k, l(e, r), 4);
              case 4:
                if (d = k.h, w = WC(d.headers), s(w), r.method == "HEAD") {
                  k.A(5);
                  break;
                }
                return A = (E = d.headers.get("Content-Length")) ? parseInt(E, 10) : 0, d.body ? (I = d.clone().body.getReader(), P = function(O) {
                  function L() {
                    var U, j, G, H;
                    return D(function(B) {
                      switch (B.g) {
                        case 1:
                          return de(B, 2), x(B, I.read(), 4);
                        case 4:
                          U = B.h, ye(B, 3);
                          break;
                        case 2:
                          return he(B), B.return();
                        case 3:
                          if (U.done) {
                            B.A(5);
                            break;
                          }
                          if (p += U.value.byteLength, !u) {
                            B.A(5);
                            break;
                          }
                          return x(B, u(U.value), 5);
                        case 5:
                          j = Date.now(), G = p - g, (j - T > 100 && G >= a || U.done) && (H = U.done ? 0 : A - p, o(j - T, G, H), g = p, T = j), U.done ? O.close() : (O.enqueue(U.value), L()), q(B);
                      }
                    });
                  }
                  L();
                }, new c({ start: P }), x(k, d.arrayBuffer(), 8)) : x(k, d.arrayBuffer(), 9);
              case 8:
                h = k.h, k.A(5);
                break;
              case 9:
                h = k.h, N = Date.now(), o(N - T, h.byteLength, 0);
              case 5:
                t.headers.Range && (M = t.headers.Range.replace("bytes=", "").split("-").filter(function(O) {
                  return O;
                }).map(function(O) {
                  return parseInt(
                    O,
                    10
                  );
                }), M.length == 2 && h.byteLength != M[1] - M[0] + 1 && De("Payload length does not match range requested bytes", t, d)), ye(k, 3);
                break;
              case 2:
                throw R = he(k), i.Sh ? new b(1, 1, 7001, e, n) : i.fj ? new b(1, 1, 1003, e, n) : new b(1, 1, 1002, e, R, n);
              case 3:
                return k.return(Nw(w, h, d.status, e, d.url, t, n));
            }
          });
        }
        function WC(e) {
          var t = {};
          return e.forEach(function(n, r) {
            t[r.trim()] = n;
          }), t;
        }
        function Ow() {
          if (C.ReadableStream) try {
            new ReadableStream({});
          } catch {
            return !1;
          }
          else return !1;
          if (C.Response) {
            if (!new Response("").body) return !1;
          } else return !1;
          return !(!C.fetch || "polyfill" in C.fetch || !C.AbortController);
        }
        Y("shaka.net.HttpFetchPlugin", xp), xp.isSupported = Ow, xp.parse = bc;
        var zC = C.fetch, XC = C.AbortController, qC = C.ReadableStream, YC = C.Headers;
        Ow() && (zr("http", bc, 2, !0), zr("https", bc, 2, !0), zr("blob", bc, 2, !0));
        function jw() {
        }
        function Nc(e, t, n, r, i, o) {
          var s = new $C(), u = Date.now(), a = 0, l = new Promise(function(c, d) {
            s.open(t.method, e, !0), s.responseType = "arraybuffer", s.timeout = t.retryParameters.timeout, s.withCredentials = t.allowCrossSiteCredentials;
            var h = {};
            s.onabort = function() {
              d(new b(1, 1, 7001, e, n));
            }, s.onreadystatechange = function() {
              if (s.readyState === XMLHttpRequest.HEADERS_RECEIVED) {
                var g = s.getAllResponseHeaders().trim().split(`\r
`), w = {};
                g = m(g);
                for (var T = g.next(); !T.done; T = g.next()) T = T.value.split(": "), w[T[0].toLowerCase()] = T.slice(1).join(": ");
                h = w, i(h);
              }
            }, s.onload = function() {
              var g = s.response;
              try {
                var w = Nw(h, g, s.status, e, s.responseURL, t, n);
                c(w);
              } catch (T) {
                d(T);
              }
            }, s.onerror = function(g) {
              d(new b(1, 1, 1002, e, g, n));
            }, s.ontimeout = function() {
              d(new b(1, 1, 1003, e, n));
            }, s.onprogress = function(g) {
              var w = Date.now(), T = o.minBytesForProgressEvents || 0, E = g.loaded - a;
              (w - u > 100 && E >= T || g.lengthComputable && g.loaded == g.total) && (r(w - u, E, s.readyState == 4 ? 0 : g.total - g.loaded), a = g.loaded, u = w);
            };
            for (var p in t.headers) try {
              s.setRequestHeader(p.toLowerCase(), t.headers[p]);
            } catch (g) {
              throw new b(
                1,
                1,
                1002,
                e,
                g,
                n
              );
            }
            s.send(t.body);
          });
          return new mt(l, function() {
            return s.abort(), Promise.resolve();
          });
        }
        Y("shaka.net.HttpXHRPlugin", jw), jw.parse = Nc;
        var $C = C.XMLHttpRequest;
        zr("http", Nc, 1, !0), zr("https", Nc, 1, !0), zr("blob", Nc, 1, !0);
        function Uw(e, t, n, r, i) {
          this.g = e, this.i = t, this.groupId = n, this.h = r, this.j = i;
        }
        function Ap(e) {
          var t = e.ac(!1);
          return t ? _r(t) : e.P().map(function(n) {
            return "{" + encodeURI(n.split("#xywh=")[0]) + "}";
          }).join("") + ":" + e.startByte + ":" + e.endByte;
        }
        function JC(e, t) {
          return Su(e.g.P(), e.g.startByte, e.g.endByte, t.streaming.retryParameters);
        }
        function _w() {
          this.g = this.j = this.i = 0, this.h = /* @__PURE__ */ new Map(), this.l = 0;
        }
        function Bw(e, t) {
          e.i += t;
          var n = e.l;
          return e.l++, e.h.set(n, t), n;
        }
        _w.prototype.close = function(e, t) {
          if (this.h.has(e)) {
            var n = this.h.get(e);
            this.h.delete(e), this.j += n, this.g += t;
          }
        };
        function Fw(e) {
          return e.i == 0 ? 0 : e.j / e.i;
        }
        function Ep(e) {
          var t = this;
          this.u = e, this.i = /* @__PURE__ */ new Map(), this.h = new Ho(function() {
            return Ip(t).catch(function() {
            });
          }), this.j = [], this.o = function() {
          }, this.m = function() {
          }, this.g = new _w(), this.l = !1;
        }
        Ep.prototype.destroy = function() {
          return this.h.destroy();
        };
        function QC(e, t, n) {
          e.o = t, e.m = n;
        }
        function Ip(e) {
          e.l = !0;
          var t = e.j.map(function(n) {
            return n();
          });
          return e.j = [], Promise.all(t);
        }
        Ep.prototype.queue = function(e, t, n, r, i) {
          var o = this;
          nt(this.h);
          var s = (this.i.get(e) || Promise.resolve()).then(function() {
            var u, a, l, c, d, h, p;
            return D(function(g) {
              if (g.g == 1) return x(g, tk(o, t), 2);
              if (u = g.h, o.h.g) throw new b(2, 9, 7001);
              if (r) for (c in a = pe(u), l = new Yd(a), l.data) d = Number(c), h = l.data[d], p = l.g[d], o.m(h, p);
              return o.g.close(n, u.byteLength), o.o(Fw(o.g), o.g.g), g.return(i(u));
            });
          });
          return this.i.set(e, s), s;
        };
        function ZC(e, t, n, r, i, o) {
          nt(e.h);
          var s = (e.i.get(t) || Promise.resolve()).then(function() {
            if (e.h.g) throw new b(2, 9, 7001);
            if (i) {
              var u = pe(n);
              u = new Yd(u);
              for (var a in u.data) {
                var l = Number(a);
                e.m(u.data[l], u.g[l]);
              }
            }
            return e.g.close(r, n.byteLength), e.o(Fw(e.g), e.g.g), o(n);
          });
          e.i.set(t, s);
        }
        function ek(e) {
          return D(function(t) {
            return t.g == 1 ? x(t, Promise.all(e.i.values()), 2) : t.return(e.g.g);
          });
        }
        function tk(e, t) {
          var n, r, i, o;
          return D(function(s) {
            return s.g == 1 ? (n = Xn, r = e.u.request(n, t), i = function() {
              return r.abort();
            }, e.j.push(i), x(s, r.promise, 2)) : (o = s.h, Gn(e.j, i), s.return(o.data));
          });
        }
        function Oc(e, t) {
          var n = this;
          this.i = e, this.h = e.objectStore(t), this.g = new Je(), e.onabort = function(r) {
            r.preventDefault(), n.g.reject();
          }, e.onerror = function(r) {
            r.preventDefault(), n.g.reject();
          }, e.oncomplete = function() {
            n.g.resolve();
          };
        }
        Oc.prototype.abort = function() {
          var e = this;
          return D(function(t) {
            if (t.g == 1) {
              try {
                e.i.abort();
              } catch {
              }
              return de(t, 2), x(t, e.g, 4);
            }
            if (t.g != 2) return ye(t, 0);
            he(t), q(t);
          });
        };
        function Mp(e, t) {
          return new Promise(function(n, r) {
            var i = e.h.openCursor();
            i.onerror = r, i.onsuccess = function() {
              var o;
              return D(function(s) {
                if (s.g == 1)
                  return i.result == null ? (n(), s.return()) : (o = i.result, x(s, t(o.key, o.value, o), 2));
                o.continue(), q(s);
              });
            };
          });
        }
        Oc.prototype.store = function() {
          return this.h;
        }, Oc.prototype.promise = function() {
          return this.g;
        };
        function Cp(e) {
          this.h = e, this.g = [];
        }
        Cp.prototype.destroy = function() {
          return Promise.all(this.g.map(function(e) {
            return e.abort();
          }));
        };
        function fo(e, t) {
          return jc(e, t, "readwrite");
        }
        function jc(e, t, n) {
          n = e.h.transaction([t], n);
          var r = new Oc(n, t);
          return e.g.push(r), r.promise().then(function() {
            Gn(e.g, r);
          }, function() {
            Gn(e.g, r);
          }), r;
        }
        function ho(e, t, n) {
          this.h = new Cp(e), this.i = t, this.g = n;
        }
        f = ho.prototype, f.destroy = function() {
          return this.h.destroy();
        }, f.hasFixedKeySpace = function() {
          return !0;
        }, f.addSegments = function() {
          return Vw(this.i);
        }, f.removeSegments = function(e, t) {
          return Hw(this, this.i, e, t);
        }, f.getSegments = function(e) {
          var t = this, n;
          return D(function(r) {
            return r.g == 1 ? x(r, Gw(t, t.i, e), 2) : (n = r.h, r.return(n.map(function(i) {
              return t.Uh(i);
            })));
          });
        }, f.addManifests = function() {
          return Vw(this.g);
        }, f.updateManifest = function() {
          return Promise.reject(new b(2, 9, 9016, "Cannot modify values in " + this.g));
        };
        function nk(e, t, n) {
          e = fo(e.h, e.g);
          var r = e.store();
          return r.get(t).onsuccess = function() {
            r.put(n, t);
          }, e.promise();
        }
        f.updateManifestExpiration = function(e, t) {
          var n = fo(this.h, this.g), r = n.store();
          return r.get(e).onsuccess = function(i) {
            (i = i.target.result) && (i.expiration = t, r.put(i, e));
          }, n.promise();
        }, f.removeManifests = function(e, t) {
          return Hw(this, this.g, e, t);
        }, f.getManifests = function(e) {
          var t = this, n;
          return D(function(r) {
            return r.g == 1 ? x(r, Gw(t, t.g, e), 2) : (n = r.h, r.return(Promise.all(n.map(function(i) {
              return t.Ud(i);
            }))));
          });
        }, f.getAllManifests = function() {
          var e = this, t, n;
          return D(function(r) {
            return r.g == 1 ? (t = jc(e.h, e.g, "readonly"), n = /* @__PURE__ */ new Map(), x(r, Mp(t, function(i, o) {
              var s;
              return D(function(u) {
                if (u.g == 1) return x(u, e.Ud(o), 2);
                s = u.h, n.set(i, s), q(u);
              });
            }), 2)) : r.g != 3 ? x(r, t.promise(), 3) : r.return(n);
          });
        }, f.Uh = function(e) {
          return e;
        }, f.Ud = function(e) {
          return Promise.resolve(e);
        };
        function Vw(e) {
          return Promise.reject(new b(2, 9, 9011, "Cannot add new value to " + e));
        }
        f.add = function(e, t) {
          var n = this, r, i, o, s, u, a, l;
          return D(function(c) {
            if (c.g == 1) {
              for (r = fo(n.h, e), i = r.store(), o = [], s = m(t), u = s.next(), a = {}; !u.done; a = { fh: void 0 }, u = s.next()) l = u.value, a.fh = i.add(l), a.fh.onsuccess = /* @__PURE__ */ (function(d) {
                return function() {
                  o.push(d.fh.result);
                };
              })(a);
              return x(c, r.promise(), 2);
            }
            return c.return(o);
          });
        };
        function Hw(e, t, n, r) {
          e = fo(e.h, t), t = e.store(), n = m(n);
          for (var i = n.next(), o = {}; !i.done; o = { Qg: void 0 }, i = n.next()) o.Qg = i.value, t.delete(o.Qg).onsuccess = /* @__PURE__ */ (function(s) {
            return function() {
              return r(s.Qg);
            };
          })(o);
          return e.promise();
        }
        function Gw(e, t, n) {
          var r, i, o, s, u, a, l;
          return D(function(c) {
            if (c.g == 1) {
              for (r = jc(e.h, t, "readonly"), i = r.store(), o = {}, s = [], u = m(n), a = u.next(), l = {}; !a.done; l = { Bf: void 0, jf: void 0 }, a = u.next()) l.jf = a.value, l.Bf = i.get(l.jf), l.Bf.onsuccess = /* @__PURE__ */ (function(d) {
                return function() {
                  d.Bf.result == null && s.push(d.jf), o[d.jf] = d.Bf.result;
                };
              })(l);
              return x(c, r.promise(), 2);
            }
            if (s.length) throw new b(2, 9, 9012, "Could not find values for " + s);
            return c.return(n.map(function(d) {
              return o[d];
            }));
          });
        }
        function ta(e) {
          this.g = new Cp(e);
        }
        ta.prototype.destroy = function() {
          return this.g.destroy();
        }, ta.prototype.getAll = function() {
          var e = this, t, n;
          return D(function(r) {
            return r.g == 1 ? (t = jc(e.g, "session-ids", "readonly"), n = [], x(r, Mp(t, function(i, o) {
              n.push(o);
            }), 2)) : r.g != 3 ? x(r, t.promise(), 3) : r.return(n);
          });
        }, ta.prototype.add = function(e) {
          var t = fo(this.g, "session-ids"), n = t.store();
          e = m(e);
          for (var r = e.next(); !r.done; r = e.next()) n.add(r.value);
          return t.promise();
        }, ta.prototype.remove = function(e) {
          var t = this, n;
          return D(function(r) {
            return r.g == 1 ? (n = fo(t.g, "session-ids"), x(r, Mp(n, function(i, o, s) {
              e.includes(o.sessionId) && s.delete();
            }), 2)) : x(r, n.promise(), 0);
          });
        };
        function vn() {
          this.g = /* @__PURE__ */ new Map();
        }
        vn.prototype.destroy = function() {
          for (var e = [], t = m(this.g.values()), n = t.next(); !n.done; n = t.next()) e.push(n.value.destroy());
          return this.g.clear(), Promise.all(e);
        }, vn.prototype.init = function() {
          var e = this;
          na.forEach(function(i, o) {
            (i = i()) && e.g.set(o, i);
          });
          for (var t = [], n = m(this.g.values()), r = n.next(); !r.done; r = n.next()) t.push(r.value.init());
          return Promise.all(t);
        };
        function Kw(e) {
          var t = null;
          if (e.g.forEach(function(n, r) {
            n.getCells().forEach(function(i, o) {
              i.hasFixedKeySpace() || t || (t = { path: { Pb: r, cb: o }, cb: i });
            });
          }), t) return t;
          throw new b(2, 9, 9013, "Could not find a cell that supports add-operations");
        }
        function rk(e, t) {
          e.g.forEach(function(n, r) {
            n.getCells().forEach(function(i, o) {
              t({ Pb: r, cb: o }, i);
            });
          });
        }
        function Uc(e, t, n) {
          if (e = e.g.get(t), !e) throw new b(2, 9, 9013, "Could not find mechanism with name " + t);
          if (t = e.getCells().get(n), !t) throw new b(2, 9, 9013, "Could not find cell with name " + n);
          return t;
        }
        function ik(e, t) {
          e.g.forEach(function(n) {
            t(n.getEmeSessionCell());
          });
        }
        function ok(e) {
          var t = Array.from(e.g.keys());
          if (!t.length) throw new b(2, 9, 9e3, "No supported storage mechanisms found");
          return e.g.get(t[0]).getEmeSessionCell();
        }
        function sk(e) {
          var t, n, r;
          return D(function(i) {
            return i.g == 1 ? (t = Array.from(e.g.values()), n = t.length > 0, n || (r = na, r.forEach(function(o) {
              (o = o()) && t.push(o);
            })), x(i, Promise.all(t.map(function(o) {
              return o.erase();
            })), 2)) : n ? i.A(0) : x(i, Promise.all(t.map(function(o) {
              return o.destroy();
            })), 0);
          });
        }
        function Ww(e, t) {
          na.set(e, t);
        }
        Y("shaka.offline.StorageMuxer", vn), vn.unregister = function(e) {
          na.delete(e);
        }, vn.register = Ww, vn.prototype.destroy = vn.prototype.destroy;
        var na = /* @__PURE__ */ new Map();
        function ra() {
          ho.apply(this, arguments);
        }
        tt(ra, ho), ra.prototype.updateManifestExpiration = function(e, t) {
          var n = this, r, i, o;
          return D(function(s) {
            return r = fo(n.h, n.g), i = r.store(), o = new Je(), i.get(e).onsuccess = function(u) {
              (u = u.target.result) ? (u.expiration = t, i.put(u), o.resolve()) : o.reject(new b(2, 9, 9012, "Could not find values for " + e));
            }, x(s, Promise.all([r.promise(), o]), 0);
          });
        }, ra.prototype.Ud = function(e) {
          var t, n, r, i, o, s;
          return D(function(u) {
            if (u.g == 1) {
              for (t = [], n = 0; n < e.periods.length; ++n) r = n == e.periods.length - 1 ? e.duration : e.periods[n + 1].startTime, i = r - e.periods[n].startTime, o = uk(e.periods[n], i), t.push(o);
              return x(u, I1(t), 2);
            }
            return s = u.h, u.return({ creationTime: 0, originalManifestUri: e.originalManifestUri, duration: e.duration, size: e.size, expiration: e.expiration == null ? 1 / 0 : e.expiration, streams: s, sessionIds: e.sessionIds, drmInfo: e.drmInfo, appMetadata: e.appMetadata, sequenceMode: !1 });
          });
        };
        function uk(e, t) {
          lk(e);
          for (var n = m(e.streams), r = n.next(); !r.done; r = n.next()) ;
          return e.streams.map(function(i) {
            return ak(i, e.startTime, t);
          });
        }
        function ak(e, t, n) {
          var r = e.initSegmentUri ? zw(e.initSegmentUri) : null, i = t + e.presentationTimeOffset, o = t + n;
          return { id: e.id, originalId: null, groupId: null, primary: e.primary, type: e.contentType, mimeType: e.mimeType, codecs: e.codecs, frameRate: e.frameRate, pixelAspectRatio: void 0, hdr: void 0, colorGamut: void 0, videoLayout: void 0, kind: e.kind, language: e.language, originalLanguage: e.language || null, label: e.label, width: e.width, height: e.height, initSegmentKey: r, encrypted: e.encrypted, keyIds: /* @__PURE__ */ new Set([e.keyId]), segments: e.segments.map(function(s) {
            var u = zw(s.uri);
            return { startTime: t + s.startTime, endTime: t + s.endTime, dataKey: u, initSegmentKey: r, appendWindowStart: t, appendWindowEnd: o, timestampOffset: i, tilesLayout: "", mimeType: null, codecs: null, thumbnailSprite: null };
          }), variantIds: e.variantIds, roles: [], forced: !1, audioSamplingRate: null, channelsCount: null, spatialAudio: !1, closedCaptions: null, tilesLayout: void 0, external: !1, fastSwitching: !1, isAudioMuxedInVideo: !1 };
        }
        ra.prototype.Uh = function(e) {
          return { data: e.data };
        };
        function zw(e) {
          var t;
          if ((t = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e)) || (t = /^offline:segment\/([0-9]+)$/.exec(e))) return Number(t[1]);
          throw new b(2, 9, 9004, "Could not parse uri " + e);
        }
        function lk(e) {
          var t = e.streams.filter(function(u) {
            return u.contentType == "audio";
          });
          if (e = e.streams.filter(function(u) {
            return u.contentType == "video";
          }), !t.every(function(u) {
            return u.variantIds;
          }) || !e.every(function(u) {
            return u.variantIds;
          })) {
            for (var n = m(t), r = n.next(); !r.done; r = n.next()) r.value.variantIds = [];
            for (n = m(e), r = n.next(); !r.done; r = n.next()) r.value.variantIds = [];
            if (n = 0, e.length && !t.length) {
              r = n++;
              for (var i = m(e), o = i.next(); !o.done; o = i.next()) o.value.variantIds.push(r);
            }
            if (!e.length && t.length) for (r = n++, i = m(t), o = i.next(); !o.done; o = i.next()) o.value.variantIds.push(r);
            if (e.length && t.length) for (t = m(t), r = t.next(); !r.done; r = t.next()) for (r = r.value, i = m(e), o = i.next(); !o.done; o = i.next()) {
              o = o.value;
              var s = n++;
              r.variantIds.push(s), o.variantIds.push(s);
            }
          }
        }
        function _c() {
          ho.apply(this, arguments);
        }
        tt(_c, ho), _c.prototype.Ud = function(e) {
          var t, n, r, i, o, s;
          return D(function(u) {
            if (u.g == 1) {
              for (t = [], n = 0; n < e.periods.length; ++n) {
                r = n == e.periods.length - 1 ? e.duration : e.periods[n + 1].startTime, i = r - e.periods[n].startTime;
                for (var a = e.periods[n], l = [], c = m(a.streams), d = c.next(); !d.done; d = c.next()) d = d.value, d.variantIds.length != 0 && l.push(ck(d, a.startTime, a.startTime + i));
                o = l, t.push(o);
              }
              return x(u, I1(t), 2);
            }
            return s = u.h, u.return({ appMetadata: e.appMetadata, creationTime: 0, drmInfo: e.drmInfo, duration: e.duration, expiration: e.expiration == null ? 1 / 0 : e.expiration, originalManifestUri: e.originalManifestUri, sessionIds: e.sessionIds, size: e.size, streams: s, sequenceMode: !1 });
          });
        };
        function ck(e, t, n) {
          return { id: e.id, originalId: e.originalId, groupId: null, primary: e.primary, type: e.contentType, mimeType: e.mimeType, codecs: e.codecs, frameRate: e.frameRate, pixelAspectRatio: e.pixelAspectRatio, hdr: void 0, colorGamut: void 0, videoLayout: void 0, kind: e.kind, language: e.language, originalLanguage: e.language || null, label: e.label, width: e.width, height: e.height, encrypted: e.encrypted, keyIds: /* @__PURE__ */ new Set([e.keyId]), segments: e.segments.map(function(r) {
            return {
              startTime: t + r.startTime,
              endTime: t + r.endTime,
              initSegmentKey: e.initSegmentKey,
              appendWindowStart: t,
              appendWindowEnd: n,
              timestampOffset: t - e.presentationTimeOffset,
              dataKey: r.dataKey,
              tilesLayout: "",
              mimeType: null,
              codecs: null,
              thumbnailSprite: null
            };
          }), variantIds: e.variantIds, roles: [], forced: !1, audioSamplingRate: null, channelsCount: null, spatialAudio: !1, closedCaptions: null, tilesLayout: void 0, external: !1, fastSwitching: !1, isAudioMuxedInVideo: !1 };
        }
        function kp() {
          ho.apply(this, arguments);
        }
        tt(kp, ho), f = kp.prototype, f.hasFixedKeySpace = function() {
          return !1;
        }, f.addSegments = function(e) {
          return this.add(this.i, e);
        }, f.addManifests = function(e) {
          return this.add(this.g, e);
        }, f.updateManifest = function(e, t) {
          return nk(this, e, t);
        }, f.Ud = function(e) {
          return e.expiration == null && (e.expiration = 1 / 0), Promise.resolve(e);
        };
        function Xw() {
          this.m = this.j = this.i = this.h = this.g = this.l = null;
        }
        f = Xw.prototype, f.init = function() {
          var e = this, t = new Je(), n = !1, r = new Ae(function() {
            n = !0, t.reject(new b(2, 9, 9017));
          });
          typeof Bc == "number" && Bc > 0 && r.ka(Bc);
          var i = C.indexedDB.open("shaka_offline_db", 5);
          return i.onsuccess = function() {
            if (!n) {
              r.stop();
              var o = i.result;
              e.l = o;
              var s = o.objectStoreNames;
              s = s.contains("manifest") && s.contains("segment") ? new ra(o, "segment", "manifest") : null, e.g = s, s = o.objectStoreNames, s = s.contains("manifest-v2") && s.contains("segment-v2") ? new _c(o, "segment-v2", "manifest-v2") : null, e.h = s, s = o.objectStoreNames, s = s.contains("manifest-v3") && s.contains("segment-v3") ? new _c(o, "segment-v3", "manifest-v3") : null, e.i = s, s = o.objectStoreNames, s = s.contains("manifest-v5") && s.contains("segment-v5") ? new kp(o, "segment-v5", "manifest-v5") : null, e.j = s, o = o.objectStoreNames.contains("session-ids") ? new ta(o) : null, e.m = o, t.resolve();
            }
          }, i.onupgradeneeded = function() {
            for (var o = i.result, s = m(["segment-v5", "manifest-v5", "session-ids"]), u = s.next(); !u.done; u = s.next()) u = u.value, o.objectStoreNames.contains(u) || o.createObjectStore(u, { autoIncrement: !0 });
          }, i.onerror = function(o) {
            n || (r.stop(), t.reject(new b(2, 9, 9001, i.error)), o.preventDefault());
          }, t;
        }, f.destroy = function() {
          var e = this;
          return D(function(t) {
            switch (t.g) {
              case 1:
                if (!e.g) {
                  t.A(2);
                  break;
                }
                return x(t, e.g.destroy(), 2);
              case 2:
                if (!e.h) {
                  t.A(4);
                  break;
                }
                return x(t, e.h.destroy(), 4);
              case 4:
                if (!e.i) {
                  t.A(6);
                  break;
                }
                return x(t, e.i.destroy(), 6);
              case 6:
                if (!e.j) {
                  t.A(8);
                  break;
                }
                return x(t, e.j.destroy(), 8);
              case 8:
                if (!e.m) {
                  t.A(10);
                  break;
                }
                return x(t, e.m.destroy(), 10);
              case 10:
                e.l && e.l.close(), q(t);
            }
          });
        }, f.getCells = function() {
          var e = /* @__PURE__ */ new Map();
          return this.g && e.set("v1", this.g), this.h && e.set("v2", this.h), this.i && e.set("v3", this.i), this.j && e.set("v5", this.j), e;
        }, f.getEmeSessionCell = function() {
          return this.m;
        }, f.erase = function() {
          var e = this;
          return D(function(t) {
            switch (t.g) {
              case 1:
                if (!e.g) {
                  t.A(2);
                  break;
                }
                return x(t, e.g.destroy(), 2);
              case 2:
                if (!e.h) {
                  t.A(4);
                  break;
                }
                return x(t, e.h.destroy(), 4);
              case 4:
                if (!e.i) {
                  t.A(6);
                  break;
                }
                return x(t, e.i.destroy(), 6);
              case 6:
                if (!e.j) {
                  t.A(8);
                  break;
                }
                return x(t, e.j.destroy(), 8);
              case 8:
                return e.l && e.l.close(), x(t, dk(), 10);
              case 10:
                return e.l = null, e.g = null, e.h = null, e.i = null, e.j = null, x(t, e.init(), 0);
            }
          });
        };
        function dk() {
          var e = new Je(), t = C.indexedDB.deleteDatabase("shaka_offline_db");
          return t.onblocked = function() {
          }, t.onsuccess = function() {
            e.resolve();
          }, t.onerror = function(n) {
            e.reject(new b(2, 9, 9001, t.error)), n.preventDefault();
          }, e;
        }
        var Bc = 5;
        Y("shaka.offline.indexeddb.StorageMechanismOpenTimeout", Bc), Ww("idb", function() {
          return Se().yh() ? new Xw() : null;
        });
        function Nr(e, t, n, r) {
          this.g = e, this.i = t, this.h = n, this.l = r, this.j = ["offline:", e, "/", t, "/", n, "/", r].join("");
        }
        Nr.prototype.Pb = function() {
          return this.i;
        }, Nr.prototype.cb = function() {
          return this.h;
        }, Nr.prototype.key = function() {
          return this.l;
        }, Nr.prototype.toString = function() {
          return this.j;
        };
        function Pp(e) {
          if (e = /^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(e), e == null) return null;
          var t = e[1];
          if (t != "manifest" && t != "segment") return null;
          var n = e[2];
          if (!n) return null;
          var r = e[3];
          return r && t != null ? new Nr(t, n, r, Number(e[4])) : null;
        }
        function qw(e, t) {
          this.h = e, this.g = t;
        }
        function Yw(e, t) {
          var n = new fe(null, 0);
          n.Ab(t.duration);
          var r = t.streams.filter(function(l) {
            return l.type == "audio";
          }), i = t.streams.filter(function(l) {
            return l.type == "video";
          });
          r = fk(e, r, i, n), i = t.streams.filter(function(l) {
            return l.type == xe;
          }).map(function(l) {
            return Fc(e, l, n);
          });
          var o = t.streams.filter(function(l) {
            return l.type == "image";
          }).map(function(l) {
            return Fc(e, l, n);
          }), s = t.drmInfo ? [t.drmInfo] : [];
          if (t.drmInfo) for (var u = m(r.values()), a = u.next(); !a.done; a = u.next()) a = a.value, a.audio && a.audio.encrypted && (a.audio.drmInfos = s), a.video && a.video.encrypted && (a.video.drmInfos = s);
          return { presentationTimeline: n, offlineSessionIds: t.sessionIds, variants: Array.from(r.values()), textStreams: i, imageStreams: o, sequenceMode: t.sequenceMode || !1, ignoreManifestTimestampsInSegmentsMode: !1, type: t.type || "UNKNOWN", serviceDescription: null, nextUrl: null, periodCount: 1, gapCount: 0, isLowLatency: !1, startTime: null };
        }
        function fk(e, t, n, r) {
          for (var i = /* @__PURE__ */ new Set(), o = m(t), s = o.next(); !s.done; s = o.next()) {
            s = m(s.value.variantIds);
            for (var u = s.next(); !u.done; u = s.next()) i.add(u.value);
          }
          for (o = m(n), s = o.next(); !s.done; s = o.next()) for (s = m(s.value.variantIds), u = s.next(); !u.done; u = s.next()) i.add(u.value);
          for (o = /* @__PURE__ */ new Map(), i = m(i), s = i.next(); !s.done; s = i.next()) s = s.value, o.set(s, { id: s, language: "", disabledUntilTime: 0, primary: !1, audio: null, video: null, bandwidth: 0, allowedByApplication: !0, allowedByKeySystem: !0, decodingInfos: [] });
          for (t = m(t), i = t.next(); !i.done; i = t.next()) for (s = i.value, i = Fc(e, s, r), s = m(s.variantIds), u = s.next(); !u.done; u = s.next()) u = o.get(u.value), u.language = i.language, u.primary = u.primary || i.primary, u.audio = i;
          for (n = m(n), t = n.next(); !t.done; t = n.next()) for (i = t.value, t = Fc(e, i, r), i = m(i.variantIds), s = i.next(); !s.done; s = i.next()) s = o.get(s.value), s.primary = s.primary || t.primary, s.video = t;
          return o;
        }
        function Fc(e, t, n) {
          var r = t.segments.map(function(i) {
            return hk(e, i, t);
          });
          return n.le(r), { id: t.id, originalId: t.originalId, groupId: t.groupId, createSegmentIndex: function() {
            return Promise.resolve();
          }, segmentIndex: new Ue(r), mimeType: t.mimeType, codecs: t.codecs, width: t.width || void 0, height: t.height || void 0, frameRate: t.frameRate, pixelAspectRatio: t.pixelAspectRatio, hdr: t.hdr, colorGamut: t.colorGamut, videoLayout: t.videoLayout, kind: t.kind, encrypted: t.encrypted, drmInfos: [], keyIds: t.keyIds, language: t.language, originalLanguage: t.originalLanguage || null, label: t.label, type: t.type, primary: t.primary, trickModeVideo: null, dependencyStream: null, emsgSchemeIdUris: null, roles: t.roles, forced: t.forced, channelsCount: t.channelsCount, audioSamplingRate: t.audioSamplingRate, spatialAudio: t.spatialAudio, closedCaptions: t.closedCaptions, tilesLayout: t.tilesLayout, mssPrivateData: t.mssPrivateData, accessibilityPurpose: null, external: t.external, fastSwitching: t.fastSwitching, fullMimeTypes: /* @__PURE__ */ new Set([gt(t.mimeType, t.codecs)]), isAudioMuxedInVideo: t.isAudioMuxedInVideo || !1, baseOriginalId: null };
        }
        function hk(e, t, n) {
          var r = new Nr("segment", e.h, e.g, t.dataKey);
          return e = new se(t.startTime, t.endTime, function() {
            return [r.toString()];
          }, 0, null, t.initSegmentKey != null ? pk(e, t.initSegmentKey) : null, t.timestampOffset, t.appendWindowStart, t.appendWindowEnd, [], t.tilesLayout || ""), e.mimeType = t.mimeType || n.mimeType || "", e.codecs = t.codecs || n.codecs || "", t.thumbnailSprite && e.Jf(t.thumbnailSprite), e;
        }
        function pk(e, t) {
          var n = new Nr("segment", e.h, e.g, t);
          return new pn(function() {
            return [n.toString()];
          }, 0, null);
        }
        function $w() {
          this.g = null;
        }
        f = $w.prototype, f.configure = function() {
        }, f.start = function(e, t) {
          var n = this, r, i, o, s, u, a, l;
          return D(function(c) {
            switch (c.g) {
              case 1:
                if (r = Pp(e), n.g = r, r == null || r.g != "manifest") throw new b(2, 1, 9004, e);
                return i = new vn(), ir(c, 2), x(c, i.init(), 4);
              case 4:
                return x(c, Uc(i, r.Pb(), r.cb()), 5);
              case 5:
                return o = c.h, x(c, o.getManifests([r.key()]), 6);
              case 6:
                return s = c.h, u = s[0], a = new qw(r.Pb(), r.cb()), l = Yw(a, u), t.makeTextStreamsForClosedCaptions(l), c.return(l);
              case 2:
                return Ct(c), x(c, i.destroy(), 7);
              case 7:
                ln(c, 0);
            }
          });
        }, f.stop = function() {
          return Promise.resolve();
        }, f.update = function() {
        }, f.onExpirationUpdated = function(e, t) {
          var n = this, r, i, o, s, u, a, l;
          return D(function(c) {
            switch (c.g) {
              case 1:
                return r = n.g, i = new vn(), de(c, 2, 3), x(c, i.init(), 5);
              case 5:
                return x(c, Uc(i, r.Pb(), r.cb()), 6);
              case 6:
                return o = c.h, x(c, o.getManifests([r.key()]), 7);
              case 7:
                if (s = c.h, u = s[0], a = u.sessionIds.includes(e), l = u.expiration == null || u.expiration > t, !a || !l) {
                  c.A(3);
                  break;
                }
                return x(c, o.updateManifestExpiration(r.key(), t), 3);
              case 3:
                return Ct(c), x(c, i.destroy(), 10);
              case 10:
                ln(c, 0);
                break;
              case 2:
                he(c), c.A(3);
            }
          });
        }, f.onInitialVariantChosen = function() {
        }, f.banLocation = function() {
        }, f.setMediaElement = function() {
        }, Ki("application/x-offline-manifest", function() {
          return new $w();
        });
        function Jw() {
        }
        function Qw(e, t) {
          var n = Pp(e);
          return n && n.g == "manifest" ? (e = { uri: e, originalUri: e, data: new ArrayBuffer(0), headers: { "content-type": "application/x-offline-manifest" }, originalRequest: t }, e = Fo(e)) : e = n && n.g == "segment" ? gk(n.key(), n, t) : Ti(new b(2, 1, 9004, e)), e;
        }
        function gk(e, t, n) {
          var r = new vn();
          return Fo(void 0).Xa(function() {
            return r.init();
          }).Xa(function() {
            return Uc(r, t.Pb(), t.cb());
          }).Xa(function(i) {
            return i.getSegments([t.key()]);
          }).Xa(function(i) {
            return { uri: t, data: i[0].data, headers: {}, originalRequest: n };
          }).finally(function() {
            return r.destroy();
          });
        }
        Y("shaka.offline.OfflineScheme", Jw), Jw.plugin = Qw, zr("offline", Qw);
        function Zw(e, t, n) {
          var r, i, o, s, u, a;
          return D(function(l) {
            switch (l.g) {
              case 1:
                r = [];
                for (var c = [], d = m(n), h = d.next(); !h.done; h = d.next()) {
                  h = h.value;
                  for (var p = !1, g = m(c), w = g.next(); !w.done; w = g.next()) if (w = w.value, vk(w.info, h)) {
                    w.sessionIds.push(h.sessionId), p = !0;
                    break;
                  }
                  p || c.push({ info: h, sessionIds: [h.sessionId] });
                }
                i = m(c), o = i.next();
              case 2:
                if (o.done) {
                  l.A(4);
                  break;
                }
                return s = o.value, u = mk(e, t, s), x(l, u, 5);
              case 5:
                a = l.h, r = r.concat(a), o = i.next(), l.A(2);
                break;
              case 4:
                return l.return(r);
            }
          });
        }
        function mk(e, t, n) {
          var r, i;
          return D(function(o) {
            switch (o.g) {
              case 1:
                return r = new tl({ wc: t, onError: function() {
                }, xf: function() {
                }, onExpirationUpdated: function() {
                }, onEvent: function() {
                } }), de(o, 2), r.configure(e), x(o, Yx(r, n.info.keySystem, n.info.licenseUri, n.info.serverCertificate, n.info.audioCapabilities, n.info.videoCapabilities), 4);
              case 4:
                ye(o, 3);
                break;
              case 2:
                return he(o), x(o, r.destroy(), 5);
              case 5:
                return o.return([]);
              case 3:
                return i = [], x(o, Promise.all(n.sessionIds.map(function(s) {
                  return D(function(u) {
                    if (u.g == 1) return de(u, 2), x(u, Qx(r, s), 4);
                    if (u.g != 2) return i.push(s), ye(u, 0);
                    he(u), q(u);
                  });
                })), 6);
              case 6:
                return x(o, r.destroy(), 7);
              case 7:
                return o.return(i);
            }
          });
        }
        function vk(e, t) {
          function n(r, i) {
            return r.robustness == i.robustness && r.contentType == i.contentType;
          }
          return e.keySystem == t.keySystem && e.licenseUri == t.licenseUri && Vi(e.audioCapabilities, t.audioCapabilities, n) && Vi(e.videoCapabilities, t.videoCapabilities, n);
        }
        function yk(e, t, n) {
          var r = t.presentationTimeline.getDuration();
          return t = eT(t), { offlineUri: null, originalManifestUri: e, duration: r, size: 0, expiration: 1 / 0, tracks: t, appMetadata: n, isIncomplete: !1 };
        }
        function Dp(e, t) {
          var n = Yw(new qw(e.Pb(), e.cb()), t), r = t.appMetadata || {};
          return n = eT(n), { offlineUri: e.toString(), originalManifestUri: t.originalManifestUri, duration: t.duration, size: t.size, expiration: t.expiration, tracks: n, appMetadata: r, isIncomplete: t.isIncomplete || !1 };
        }
        function eT(e) {
          var t = [], n = za(e.variants);
          n = m(n);
          for (var r = n.next(); !r.done; r = n.next()) t.push(Qi(r.value));
          for (e = m(e.textStreams), n = e.next(); !n.done; n = e.next()) t.push(Zi(n.value));
          return t;
        }
        function wk() {
          this.g = /* @__PURE__ */ new Map();
        }
        function Tk(e, t) {
          var n = t.audio, r = t.video;
          if (n && !r && e.g.set(n.id, n.bandwidth || t.bandwidth), !n && r && e.g.set(r.id, r.bandwidth || t.bandwidth), n && r) {
            var i = n.bandwidth || 393216, o = r.bandwidth || t.bandwidth - i;
            o <= 0 && (o = t.bandwidth), e.g.set(n.id, i), e.g.set(r.id, o);
          }
        }
        function Sk(e, t) {
          e.g.set(t.id, t.bandwidth || 2048);
        }
        function tT(e, t) {
          return e = e.g.get(t), e == null && (e = 0), e;
        }
        function jt(e) {
          var t = this;
          if (e && e.constructor != V) throw new b(2, 9, 9008);
          this.g = this.h = null, e ? (this.h = e.g, this.g = e.Yb()) : (this.h = os(), this.g = new at(), this.g.configure(this.h.networking)), this.i = [], this.l = [];
          var n = !e;
          this.j = new Ho(function() {
            var r, i, o, s, u;
            return D(function(a) {
              switch (a.g) {
                case 1:
                  return x(a, Promise.all(t.l.map(function(l) {
                    return Ip(l);
                  })), 2);
                case 2:
                  for (r = function() {
                  }, i = [], o = m(t.i), s = o.next(); !s.done; s = o.next()) u = s.value, i.push(u.then(r, r));
                  return x(a, Promise.all(i), 3);
                case 3:
                  if (!n) {
                    a.A(4);
                    break;
                  }
                  return x(a, t.g.destroy(), 4);
                case 4:
                  t.h = null, t.g = null, q(a);
              }
            });
          }), this.m = 1e9;
        }
        function Rp() {
          if (br(Se())) e: {
            for (var e = m(na.values()), t = e.next(); !t.done; t = e.next()) if (t = t.value, t = t()) {
              t.destroy(), e = !0;
              break e;
            }
            e = !1;
          }
          else e = !1;
          return e;
        }
        f = jt.prototype, f.destroy = function() {
          return this.j.destroy();
        }, f.configure = function(e, t) {
          return arguments.length == 2 && typeof e == "string" && (e = Cl(e, t)), Qr(this.h, e);
        }, f.getConfiguration = function() {
          var e = os();
          return Qr(e, this.h, os()), e;
        }, f.Yb = function() {
          return this.g;
        }, f.store = function(e, t, n, r, i) {
          var o = this, s = this.getConfiguration(), u = new Ep(this.g);
          return this.l.push(u), t = xk(this, e, t || {}, r || [], i || [], function() {
            var a;
            return D(function(l) {
              return l.g == 1 ? n ? l.A(2) : x(l, ts(e, o.g, s.manifest.retryParameters), 3) : (l.g != 2 && (n = l.h), a = Ug(e, n || null), l.return(a()));
            });
          }, s, u), t = new mt(t, function() {
            return Ip(u);
          }), t.finally(function() {
            Gn(o.l, u);
          }), _k(this, t);
        };
        function xk(e, t, n, r, i, o, s, u) {
          var a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B;
          return D(function(F) {
            switch (F.g) {
              case 1:
                return Vc(), l = a = null, c = new vn(), p = h = d = null, de(F, 2, 3), x(F, o(), 5);
              case 5:
                return a = F.h, x(F, Rk(e, t, a, s), 6);
              case 6:
                if (g = F.h, bn(e), w = !g.presentationTimeline.U() && !g.presentationTimeline.Uc(), !w) throw new b(2, 9, 9005, t);
                T = m(r), E = T.next();
              case 7:
                if (E.done) {
                  F.A(9);
                  break;
                }
                return A = E.value, x(F, Lk(e, A, g), 10);
              case 10:
                I = F.h, g.imageStreams.push(I), bn(e), E = T.next(), F.A(7);
                break;
              case 9:
                P = m(i), N = P.next();
              case 11:
                return N.done ? (Hm(s.drm.clearKeys, g.variants), k = g.variants.some(function(W) {
                  if (W.audio) {
                    for (var z = m(W.audio.drmInfos), me = z.next(); !me.done; me = z.next()) if (me.value.licenseServerUri.startsWith("data:")) return !0;
                  }
                  if (W.video) {
                    for (W = m(W.video.drmInfos), z = W.next(); !z.done; z = W.next()) if (z.value.licenseServerUri.startsWith("data:")) return !0;
                  }
                  return !1;
                }), O = s.offline.usePersistentLicense, k && (O = !1), x(F, e.kd(g, function(W) {
                  p = p || W;
                }, s, O), 15)) : (M = N.value, x(
                  F,
                  bk(e, g, M.uri, M.language, M.kind, M.mime, M.codecs),
                  14
                ));
              case 14:
                R = F.h, g.textStreams.push(R), bn(e), N = P.next(), F.A(11);
                break;
              case 15:
                if (l = F.h, bn(e), p) throw p;
                return x(F, Ek(g, l, s, O), 16);
              case 16:
                return x(F, c.init(), 17);
              case 17:
                return bn(e), x(F, Kw(c), 18);
              case 18:
                return d = F.h, bn(e), L = Ik(l, g, t, n, s, u, O), U = L.tk, j = L.Dh, x(F, d.cb.addManifests([U]), 19);
              case 19:
                if (G = F.h, bn(e), h = G[0], bn(e), p) throw p;
                return x(F, Ak(e, j, h, U, u, s, d.cb, g, l, O), 20);
              case 20:
                return bn(e), oT(g, U, l, O), x(F, d.cb.updateManifest(h, U), 21);
              case 21:
                return bn(e), H = new Nr(
                  "manifest",
                  d.path.Pb,
                  d.path.cb,
                  h
                ), F.return(Dp(H, U));
              case 3:
                return Ct(F), x(F, c.destroy(), 22);
              case 22:
                if (!a) {
                  F.A(23);
                  break;
                }
                return x(F, a.stop(), 23);
              case 23:
                if (!l) {
                  F.A(25);
                  break;
                }
                return x(F, l.destroy(), 25);
              case 25:
                ln(F, 0);
                break;
              case 2:
                if (B = he(F), h == null) {
                  F.A(27);
                  break;
                }
                return x(F, nT(h), 27);
              case 27:
                throw p || B;
            }
          });
        }
        function Ak(e, t, n, r, i, o, s, u, a, l) {
          var c, d, h, p, g, w, T, E, A, I, P;
          return D(function(N) {
            switch (N.g) {
              case 1:
                if (c = {}, d = 0, h = function() {
                  if (e.j.g || i.l) throw new b(2, 9, 7001);
                }, p = function(M, R) {
                  var k, O, L, U, j, G, H, B, F;
                  return D(function(W) {
                    if (W.g == 1) {
                      for (k = m(M), O = k.next(), L = {}; !O.done; L = { qc: void 0 }, O = k.next()) L.qc = O.value, h(), U = JC(L.qc, o), j = L.qc.i, G = L.qc.h, H = /* @__PURE__ */ (function(z) {
                        return function(me) {
                          var Q, Be, ve, ze;
                          return D(function(Ce) {
                            switch (Ce.g) {
                              case 1:
                                if (Q = z.qc.g, Be = Q.ac(!1), !Q.aesKey || Be) {
                                  Ce.A(2);
                                  break;
                                }
                                return x(Ce, Df(
                                  me,
                                  Q.aesKey,
                                  z.qc.j
                                ), 3);
                              case 3:
                                me = Ce.h;
                              case 2:
                                return ve = Ap(Q), x(Ce, s.addSegments([{ data: me }]), 4);
                              case 4:
                                ze = Ce.h, h(), c[ve] = ze[0], d += me.byteLength, q(Ce);
                            }
                          });
                        };
                      })(L), B = L.qc.g, (F = B.ac(!1)) ? ZC(i, L.qc.groupId, F, j, G, H) : i.queue(L.qc.groupId, U, j, G, H);
                      return x(W, ek(i), 2);
                    }
                    return h(), !R || i.l ? W.A(0) : (oT(u, r, a, l), x(W, s.updateManifest(n, r), 0));
                  });
                }, g = !1, de(N, 2), !Lp(u) || !g || iT(u)) {
                  N.A(4);
                  break;
                }
                return x(N, p(t.filter(function(M) {
                  return M.h;
                }), !0), 5);
              case 5:
                return h(), t = t.filter(function(M) {
                  return !M.h;
                }), w = c, T = d, c = {}, d = 0, x(
                  N,
                  rT(s, n, r, w, T, function() {
                    return bn(e);
                  }),
                  6
                );
              case 6:
                h();
              case 4:
                if (g) {
                  N.A(7);
                  break;
                }
                return x(N, p(t, !1), 8);
              case 8:
                return h(), E = c, A = d, c = {}, d = 0, x(N, rT(s, n, r, E, A, function() {
                  return h();
                }), 9);
              case 9:
                h();
              case 7:
                ye(N, 0);
                break;
              case 2:
                return I = he(N), P = Object.values(c), x(N, s.removeSegments(P, function() {
                }), 10);
              case 10:
                throw I;
            }
          });
        }
        function nT(e) {
          var t, n, r, i;
          return D(function(o) {
            switch (o.g) {
              case 1:
                return t = new vn(), x(o, t.init(), 2);
              case 2:
                return x(o, Kw(t), 3);
              case 3:
                return n = o.h, r = new Nr("manifest", n.path.Pb, n.path.cb, e), x(o, t.destroy(), 4);
              case 4:
                return i = new jt(), x(o, i.remove(r.toString()), 0);
            }
          });
        }
        function rT(e, t, n, r, i, o) {
          var s, u, a, l, c, d, h, p, g, w, T;
          return D(function(E) {
            switch (E.g) {
              case 1:
                for (s = !1, de(E, 2), u = !0, a = m(n.streams), l = a.next(); !l.done; l = a.next()) for (c = l.value, d = m(c.segments), h = d.next(); !h.done; h = d.next()) p = h.value, g = p.pendingSegmentRefId ? r[p.pendingSegmentRefId] : null, g != null && (p.dataKey = g, p.pendingSegmentRefId = void 0), g = p.pendingInitSegmentRefId ? r[p.pendingInitSegmentRefId] : null, g != null && (p.initSegmentKey = g, p.pendingInitSegmentRefId = void 0), p.pendingSegmentRefId && (u = !1), p.pendingInitSegmentRefId && (u = !1);
                return n.size += i, u && (n.isIncomplete = !1), x(E, e.updateManifest(t, n), 4);
              case 4:
                s = !0, o(), ye(E, 0);
                break;
              case 2:
                return w = he(E), x(E, nT(t), 5);
              case 5:
                if (s) {
                  E.A(6);
                  break;
                }
                return T = Object.values(r), x(E, e.removeSegments(T, function() {
                }), 6);
              case 6:
                throw w;
            }
          });
        }
        function Ek(e, t, n, r) {
          var i, o, s, u, a, l, c, d, h, p, g, w, T, E, A, I, P, N, M, R, k, O, L, U, j, G, H, B, F, W;
          return D(function(z) {
            switch (z.g) {
              case 1:
                return i = { width: 1 / 0, height: 1 / 0 }, Px(e, n.restrictions, i), x(z, am(t, e, r, n.drm.preferredKeySystems, n.drm.keySystemsMapping), 2);
              case 2:
                for (o = [], s = n.preferredDecodingAttributes, u = n.preferredVideoCodecs, a = n.preferredAudioCodecs, l = n.preferredTextFormats, um(e, u, a, s, l), c = m(e.variants), d = c.next(); !d.done; d = c.next()) h = d.value, o.push(Qi(h));
                for (p = m(e.textStreams), g = p.next(); !g.done; g = p.next()) w = g.value, o.push(Zi(w));
                for (T = m(e.imageStreams), E = T.next(); !E.done; E = T.next()) A = E.value, o.push(Kd(A));
                return x(z, n.offline.trackSelectionCallback(o), 3);
              case 3:
                for (I = z.h, P = e.presentationTimeline.getDuration(), N = 0, M = m(I), R = M.next(); !R.done; R = M.next()) k = R.value, O = k.bandwidth * P / 8, N += O;
                return de(z, 4), x(z, n.offline.downloadSizeCallback(N), 6);
              case 6:
                if (L = z.h, !L) throw new b(2, 9, 9014);
                ye(z, 5);
                break;
              case 4:
                throw U = he(z), U instanceof b ? U : new b(2, 9, 9015);
              case 5:
                for (j = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Set(), H = /* @__PURE__ */ new Set(), B = m(I), F = B.next(); !F.done; F = B.next()) W = F.value, W.type == "variant" && j.add(W.id), W.type == "text" && G.add(W.id), W.type == "image" && H.add(W.id);
                e.variants = e.variants.filter(function(me) {
                  return j.has(me.id);
                }), e.textStreams = e.textStreams.filter(function(me) {
                  return G.has(me.id);
                }), e.imageStreams = e.imageStreams.filter(function(me) {
                  return H.has(me.id);
                }), Vk(e), q(z);
            }
          });
        }
        function Ik(e, t, n, r, i, o, s) {
          var u = yk(n, t, r), a = i.offline.progressCallback;
          QC(o, function(g, w) {
            u.size = w, a(u, g);
          }, function(g, w) {
            l && s && c == w && su(e, "cenc", g);
          });
          var l = Lp(t) && !iT(t), c = null;
          l && (c = Hk.get(e.g.keySystem));
          for (var d = new wk(), h = m(t.textStreams), p = h.next(); !p.done; p = h.next()) d.g.set(p.value.id, 52);
          for (h = m(t.imageStreams), p = h.next(); !p.done; p = h.next()) Sk(d, p.value);
          for (h = m(t.variants), p = h.next(); !p.done; p = h.next()) Tk(d, p.value);
          return o = Ok(o, d, t, i), i = o.streams, o = o.Dh, (d = e.g) && s && (d.initData = []), { tk: {
            creationTime: Date.now(),
            originalManifestUri: n,
            duration: t.presentationTimeline.getDuration(),
            size: 0,
            expiration: e.Zd(),
            streams: i,
            sessionIds: s ? Om(e) : [],
            drmInfo: d,
            appMetadata: r,
            isIncomplete: !0,
            sequenceMode: t.sequenceMode,
            type: t.type
          }, Dh: o };
        }
        function Lp(e) {
          return e.variants.some(function(t) {
            var n = t.audio && t.audio.encrypted;
            return t.video && t.video.encrypted || n;
          });
        }
        function iT(e) {
          return e.variants.some(function(t) {
            return (t.video ? t.video.drmInfos : []).concat(t.audio ? t.audio.drmInfos : []).some(function(n) {
              return n.initData && n.initData.length;
            });
          });
        }
        function oT(e, t, n, r) {
          if (t.expiration = n.Zd(), n = Om(n), t.sessionIds = r ? n : [], Lp(e) && r && !n.length) throw new b(2, 9, 9007);
        }
        f.remove = function(e) {
          return bp(this, Mk(this, e));
        };
        function Mk(e, t) {
          var n, r, i, o, s, u;
          return D(function(a) {
            switch (a.g) {
              case 1:
                if (Vc(), n = Pp(t), n == null || n.g != "manifest") throw new b(2, 9, 9004, t);
                return r = n, i = new vn(), ir(a, 2), x(a, i.init(), 4);
              case 4:
                return x(a, Uc(i, r.Pb(), r.cb()), 5);
              case 5:
                return o = a.h, x(a, o.getManifests([r.key()]), 6);
              case 6:
                return s = a.h, u = s[0], x(a, Promise.all([Ck(e, u, i), kk(o, r, u)]), 2);
              case 2:
                return Ct(a), x(a, i.destroy(), 8);
              case 8:
                ln(a, 0);
            }
          });
        }
        function sT(e, t) {
          for (var n = [], r = m(e.streams), i = r.next(); !i.done; i = r.next()) i = i.value, t && i.type == "video" ? n.push({ contentType: gt(i.mimeType, i.codecs), robustness: e.drmInfo.videoRobustness }) : t || i.type != "audio" || n.push({ contentType: gt(i.mimeType, i.codecs), robustness: e.drmInfo.audioRobustness });
          return n;
        }
        function Ck(e, t, n) {
          return D(function(r) {
            return x(r, Fk(e.g, e.h.drm, n, t), 0);
          });
        }
        function kk(e, t, n) {
          function r() {
          }
          var i = Bk(n);
          return Dp(t, n), Promise.all([e.removeSegments(i, r), e.removeManifests([t.key()], r)]);
        }
        f.Ok = function() {
          return bp(this, Pk(this));
        };
        function Pk(e) {
          var t, n, r, i, o, s, u, a, l, c;
          return D(function(d) {
            switch (d.g) {
              case 1:
                return Vc(), t = e.g, n = e.h.drm, r = new vn(), i = !1, ir(d, 2), x(d, r.init(), 4);
              case 4:
                o = [], ik(r, function(h) {
                  return o.push(h);
                }), s = m(o), u = s.next();
              case 5:
                if (u.done) {
                  d.A(2);
                  break;
                }
                return a = u.value, x(d, a.getAll(), 8);
              case 8:
                return l = d.h, x(d, Zw(n, t, l), 9);
              case 9:
                return c = d.h, x(d, a.remove(c), 10);
              case 10:
                c.length != l.length && (i = !0), u = s.next(), d.A(5);
                break;
              case 2:
                return Ct(d), x(d, r.destroy(), 11);
              case 11:
                ln(d, 3);
                break;
              case 3:
                return d.return(!i);
            }
          });
        }
        f.list = function() {
          return bp(this, Dk());
        };
        function Dk() {
          var e, t, n;
          return D(function(r) {
            switch (r.g) {
              case 1:
                return Vc(), e = [], t = new vn(), ir(r, 2), x(r, t.init(), 4);
              case 4:
                return n = Promise.resolve(), rk(t, function(i, o) {
                  n = n.then(function() {
                    var s;
                    return D(function(u) {
                      if (u.g == 1) return x(u, o.getAllManifests(), 2);
                      s = u.h, s.forEach(function(a, l) {
                        a = Dp(new Nr("manifest", i.Pb, i.cb, l), a), e.push(a);
                      }), q(u);
                    });
                  });
                }), x(r, n, 2);
              case 2:
                return Ct(r), x(r, t.destroy(), 6);
              case 6:
                ln(r, 3);
                break;
              case 3:
                return r.return(e);
            }
          });
        }
        function Rk(e, t, n, r) {
          var i, o, s, u, a;
          return D(function(l) {
            if (l.g == 1) return i = null, o = e.g, s = {
              networkingEngine: o,
              filter: function() {
                return Promise.resolve();
              },
              makeTextStreamsForClosedCaptions: function() {
              },
              onTimelineRegionAdded: function() {
              },
              onEvent: function() {
              },
              onError: function(c) {
                i = c;
              },
              isLowLatencyMode: function() {
                return !1;
              },
              updateDuration: function() {
              },
              newDrmInfo: function() {
              },
              onManifestUpdated: function() {
              },
              getBandwidthEstimate: function() {
                return r.abr.defaultBandwidthEstimate;
              },
              onMetadata: function() {
              },
              disableStream: function() {
              },
              addFont: function() {
              }
            }, n.configure(r.manifest), bn(e), x(l, n.start(t, s), 2);
            if (l.g != 3) return u = l.h, bn(e), a = aT(u), x(l, Promise.all(Xd(a, function(c) {
              return c.createSegmentIndex();
            })), 3);
            if (bn(e), i) throw i;
            return l.return(u);
          });
        }
        function Lk(e, t, n) {
          var r, i, o, s, u, a, l, c, d, h, p, g, w, T, E;
          return D(function(A) {
            switch (A.g) {
              case 1:
                return x(A, uT(e, t), 2);
              case 2:
                if (r = A.h, r != "text/vtt") throw new b(1, 2, 2017, t);
                return x(A, Nk(t, e.g, e.h.streaming.retryParameters), 3);
              case 3:
                if (i = A.h, o = Zs(r), !o) throw new b(2, 2, 2014, r);
                for (s = o(), u = { periodStart: 0, segmentStart: 0, segmentEnd: n.presentationTimeline.getDuration(), vttOffset: 0 }, a = pe(i), l = s.parseMedia(a, u, t, []), c = [], d = m(l), h = d.next(), p = {}; !h.done; p = { Sf: void 0, md: void 0 }, h = d.next()) p.md = h.value, p.Sf = null, g = /* @__PURE__ */ (function(I) {
                  return function() {
                    return I.Sf == null && (I.Sf = bt([t], [I.md.payload])), I.Sf || [];
                  };
                })(p), w = new se(p.md.startTime, p.md.endTime, g, 0, null, null, 0, 0, 1 / 0), p.md.payload.includes("#xywh") && (T = p.md.payload.split("#xywh=")[1].split(","), T.length === 4 && w.Jf({ height: parseInt(T[3], 10), positionX: parseInt(T[0], 10), positionY: parseInt(T[1], 10), width: parseInt(T[2], 10) })), c.push(w);
                if (E = r, !c.length) {
                  A.A(4);
                  break;
                }
                return x(A, ts(c[0].P()[0], e.g, e.h.manifest.retryParameters), 5);
              case 5:
                E = A.h;
              case 4:
                return A.return({
                  id: e.m++,
                  originalId: null,
                  groupId: null,
                  createSegmentIndex: function() {
                    return Promise.resolve();
                  },
                  segmentIndex: new Ue(c),
                  mimeType: E || "",
                  codecs: "",
                  kind: "",
                  encrypted: !1,
                  drmInfos: [],
                  keyIds: /* @__PURE__ */ new Set(),
                  language: "und",
                  originalLanguage: null,
                  label: null,
                  type: "image",
                  primary: !1,
                  trickModeVideo: null,
                  dependencyStream: null,
                  emsgSchemeIdUris: null,
                  roles: [],
                  forced: !1,
                  channelsCount: null,
                  audioSamplingRate: null,
                  spatialAudio: !1,
                  closedCaptions: null,
                  tilesLayout: "1x1",
                  accessibilityPurpose: null,
                  external: !0,
                  fastSwitching: !1,
                  fullMimeTypes: /* @__PURE__ */ new Set([gt(E || "", "")]),
                  isAudioMuxedInVideo: !1,
                  baseOriginalId: null
                });
            }
          });
        }
        function bk(e, t, n, r, i, o, s) {
          var u, a, l;
          return D(function(c) {
            if (c.g == 1) return o ? c.A(2) : x(c, uT(e, n), 3);
            if (c.g != 2 && (o = c.h), u = {
              id: e.m++,
              originalId: null,
              groupId: null,
              createSegmentIndex: function() {
                return Promise.resolve();
              },
              segmentIndex: hl(0, t.presentationTimeline.getDuration(), [n]),
              mimeType: o || "",
              codecs: s || "",
              kind: i,
              encrypted: !1,
              drmInfos: [],
              keyIds: /* @__PURE__ */ new Set(),
              language: r,
              originalLanguage: r,
              label: null,
              type: xe,
              primary: !1,
              trickModeVideo: null,
              dependencyStream: null,
              emsgSchemeIdUris: null,
              roles: [],
              forced: !1,
              channelsCount: null,
              audioSamplingRate: null,
              spatialAudio: !1,
              closedCaptions: null,
              accessibilityPurpose: null,
              external: !0,
              fastSwitching: !1,
              fullMimeTypes: /* @__PURE__ */ new Set([gt(o || "", s || "")]),
              isAudioMuxedInVideo: !1,
              baseOriginalId: null
            }, a = gt(u.mimeType, u.codecs), l = eu(a), !l) throw new b(2, 2, 2014, o);
            return c.return(u);
          });
        }
        function uT(e, t) {
          var n;
          return D(function(r) {
            switch (r.g) {
              case 1:
                return de(r, 2), x(r, ts(t, e.g, e.h.streaming.retryParameters), 4);
              case 4:
                n = r.h, ye(r, 3);
                break;
              case 2:
                he(r);
              case 3:
                if (n) return r.return(n);
                throw new b(1, 2, 2011, t);
            }
          });
        }
        function Nk(e, t, n) {
          var r, i, o;
          return D(function(s) {
            return s.g == 1 ? (r = Xn, i = At([e], n), i.method = "GET", x(s, t.request(r, i).promise, 2)) : (o = s.h, s.return(o.data));
          });
        }
        f.kd = function(e, t, n, r) {
          var i = this, o;
          return D(function(s) {
            return s.g == 1 ? (o = new tl({ wc: i.g, onError: t, xf: function() {
            }, onExpirationUpdated: function() {
            }, onEvent: function() {
            } }), o.configure(n.drm), x(s, qx(o, e.variants, r), 2)) : s.g != 3 ? x(s, Nm(o), 3) : s.return(o);
          });
        };
        function Ok(e, t, n, r) {
          var i = /* @__PURE__ */ new Map(), o = aT(n), s = /* @__PURE__ */ new Map();
          o = m(o);
          for (var u = o.next(); !u.done; u = o.next()) {
            u = u.value;
            var a = jk(e, t, n, u, r, i);
            s.set(u.id, a);
          }
          for (e = m(n.variants), t = e.next(); !t.done; t = e.next()) t = t.value, t.audio && s.get(t.audio.id).variantIds.push(t.id), t.video && s.get(t.video.id).variantIds.push(t.id);
          return { streams: Array.from(s.values()), Dh: Array.from(i.values()) };
        }
        function jk(e, t, n, r, i, o) {
          var s = {
            id: r.id,
            originalId: r.originalId,
            groupId: r.groupId,
            primary: r.primary,
            type: r.type,
            mimeType: r.mimeType,
            codecs: r.codecs,
            frameRate: r.frameRate,
            pixelAspectRatio: r.pixelAspectRatio,
            hdr: r.hdr,
            colorGamut: r.colorGamut,
            videoLayout: r.videoLayout,
            kind: r.kind,
            language: r.language,
            originalLanguage: r.originalLanguage,
            label: r.label,
            width: r.width || null,
            height: r.height || null,
            encrypted: r.encrypted,
            keyIds: r.keyIds,
            segments: [],
            variantIds: [],
            roles: r.roles,
            forced: r.forced,
            channelsCount: r.channelsCount,
            audioSamplingRate: r.audioSamplingRate,
            spatialAudio: r.spatialAudio,
            closedCaptions: r.closedCaptions,
            tilesLayout: r.tilesLayout,
            mssPrivateData: r.mssPrivateData,
            external: r.external,
            fastSwitching: r.fastSwitching,
            isAudioMuxedInVideo: r.isAudioMuxedInVideo
          }, u = i.offline.numberOfParallelDownloads, a = u === 0 ? r.id : 0;
          return Uk(r, n.presentationTimeline.Jb(), function(l, c) {
            var d = Ap(l), h = void 0;
            if (!o.has(d)) {
              var p = l.endTime - l.startTime;
              p = tT(t, r.id) * p, p = Bw(e.g, p), o.set(d, new Uw(l, p, a, !1, c));
            }
            l.ea && (h = Ap(l.ea), o.has(h) || (p = tT(
              t,
              r.id
            ) * 0.5, p = Bw(e.g, p), o.set(h, new Uw(l.ea, p, a, !0, c)))), s.segments.push({ pendingInitSegmentRefId: h, initSegmentKey: h ? 0 : null, startTime: l.startTime, endTime: l.endTime, appendWindowStart: l.appendWindowStart, appendWindowEnd: l.appendWindowEnd, timestampOffset: l.timestampOffset, tilesLayout: l.tilesLayout, pendingSegmentRefId: d, dataKey: 0, mimeType: l.mimeType, codecs: l.codecs, thumbnailSprite: l.thumbnailSprite }), u !== 0 && (a = (a + 1) % u);
          }), s;
        }
        function Uk(e, t, n) {
          if (t = e.segmentIndex.find(t), t != null) for (var r = e.segmentIndex.get(t); r; ) n(r, t), r = e.segmentIndex.get(++t);
        }
        function bn(e) {
          if (e.j.g) throw new b(2, 9, 7001);
        }
        function Vc() {
          if (!Rp()) throw new b(2, 9, 9e3);
        }
        function bp(e, t) {
          return D(function(n) {
            return n.g == 1 ? (e.i.push(t), ir(n, 2), x(n, t, 4)) : n.g != 2 ? n.return(n.h) : (Ct(n), Gn(e.i, t), ln(n, 0));
          });
        }
        function _k(e, t) {
          var n = t.promise;
          return e.i.push(n), t.finally(function() {
            Gn(e.i, n);
          });
        }
        function Bk(e) {
          var t = /* @__PURE__ */ new Set();
          e = m(e.streams);
          for (var n = e.next(); !n.done; n = e.next()) {
            n = m(n.value.segments);
            for (var r = n.next(); !r.done; r = n.next()) r = r.value, r.initSegmentKey != null && t.add(r.initSegmentKey), t.add(r.dataKey);
          }
          return Array.from(t);
        }
        function Fk(e, t, n, r) {
          var i, o, s;
          return D(function(u) {
            return u.g == 1 ? r.drmInfo ? (i = ok(n), o = r.sessionIds.map(function(a) {
              return { sessionId: a, keySystem: r.drmInfo.keySystem, licenseUri: r.drmInfo.licenseServerUri, serverCertificate: r.drmInfo.serverCertificate, audioCapabilities: sT(r, !1), videoCapabilities: sT(r, !0) };
            }), x(u, Zw(t, e, o), 2)) : u.return() : u.g != 3 ? (s = u.h, x(u, i.remove(s), 3)) : x(u, i.add(o.filter(function(a) {
              return !s.includes(a.sessionId);
            })), 0);
          });
        }
        function aT(e) {
          for (var t = /* @__PURE__ */ new Set(), n = m(e.variants), r = n.next(); !r.done; r = n.next()) r = r.value, r.audio && t.add(r.audio), r.video && t.add(r.video);
          for (n = m(e.textStreams), r = n.next(); !r.done; r = n.next()) t.add(r.value);
          for (e = m(e.imageStreams), n = e.next(); !n.done; n = e.next()) t.add(n.value);
          return t;
        }
        function Vk(e) {
          e.variants.map(function(o) {
            return o.video;
          });
          var t = new Set(e.variants.map(function(o) {
            return o.audio;
          }));
          e = e.textStreams;
          for (var n = m(t), r = n.next(); !r.done; r = n.next()) {
            r = m(t);
            for (var i = r.next(); !i.done; i = r.next()) ;
          }
          for (t = m(e), n = t.next(); !n.done; n = t.next()) for (n = m(e), r = n.next(); !r.done; r = n.next()) ;
        }
        Y("shaka.offline.Storage", jt), jt.deleteAll = function() {
          var e;
          return D(function(t) {
            return t.g == 1 ? (e = new vn(), ir(t, 2), x(t, sk(e), 2)) : t.g != 5 ? (Ct(t), x(t, e.destroy(), 5)) : ln(t, 0);
          });
        }, jt.prototype.list = jt.prototype.list, jt.prototype.removeEmeSessions = jt.prototype.Ok, jt.prototype.remove = jt.prototype.remove, jt.prototype.store = jt.prototype.store, jt.prototype.getNetworkingEngine = jt.prototype.Yb, jt.prototype.getConfiguration = jt.prototype.getConfiguration, jt.prototype.configure = jt.prototype.configure, jt.prototype.destroy = jt.prototype.destroy, jt.support = Rp;
        var Hk = (/* @__PURE__ */ new Map()).set("org.w3.clearkey", "1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha", "edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready", "9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation", "9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software", "9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware", "9a04f07998404286ab92e65be0885f95").set("com.huawei.wiseplay", "3d5e6d359b9a41e8b843dd3c6e72c42c");
        _y("offline", Rp);
        function yn() {
        }
        function Nn(e, t) {
          for (e = { priority: t || 0, callback: e }, t = 0; t < ia.length; t++) if (ia[t].priority < e.priority) {
            ia.splice(t, 0, e);
            return;
          }
          ia.push(e);
        }
        Y("shaka.polyfill", yn), yn.register = Nn, yn.installAll = function() {
          for (var e = m(ia), t = e.next(); !t.done; t = e.next()) {
            t = t.value;
            try {
              t.callback();
            } catch (n) {
              De("Error installing polyfill!", n);
            }
          }
        };
        var ia = [];
        function Hc(e, t, n) {
          this.g = e, this.i = t || null, this.h = n || null, this.keySystem = e.keySystem;
        }
        Hc.prototype.getConfiguration = function() {
          var e = this.g.getConfiguration();
          if (e.videoCapabilities) for (var t = m(e.videoCapabilities), n = t.next(); !n.done; n = t.next()) n.value.encryptionScheme = this.i;
          if (e.audioCapabilities) for (t = m(e.audioCapabilities), n = t.next(); !n.done; n = t.next()) n.value.encryptionScheme = this.h;
          return e;
        }, Hc.prototype.createMediaKeys = function() {
          return this.g.createMediaKeys();
        };
        function lT(e) {
          return ko(e) ? "cbcs" : Rg(e) || xa(e) || Td(e) || e === "com.huawei.wiseplay" ? "cenc" : (De("EmeEncryptionSchemePolyfill: Unknown key system:", e, "Please contribute!"), null);
        }
        function cT(e) {
          if (!e) return !1;
          e = e.getConfiguration();
          var t = e.audioCapabilities && e.audioCapabilities[0];
          return !!((e = e.videoCapabilities && e.videoCapabilities[0] || t) && e.encryptionScheme !== void 0);
        }
        function Np(e, t) {
          return !!(!e || e == t || (e == "cbcs" || e == "cbcs-1-9") && Se().cd());
        }
        function dT() {
        }
        var oa;
        function fT() {
          Se().Lf() && !oa && !navigator.emeEncryptionSchemePolyfilled && navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration && (oa = navigator.requestMediaKeySystemAccess, navigator.requestMediaKeySystemAccess = Gk, navigator.emeEncryptionSchemePolyfilled = !0);
        }
        function Gk(e, t) {
          var n = this, r;
          return D(function(i) {
            return i.g == 1 ? x(i, oa.call(n, e, t), 2) : (r = i.h, cT(r) ? (navigator.requestMediaKeySystemAccess = oa, i.return(r)) : (navigator.requestMediaKeySystemAccess = hT, i.return(hT.call(n, e, t))));
          });
        }
        function hT(e, t) {
          var n = this, r, i, o, s, u, a, l, c, d, h, p, g;
          return D(function(w) {
            if (w.g == 1) {
              for (r = lT(e), i = [], o = m(t), s = o.next(); !s.done; s = o.next()) u = s.value, a = pT(u.videoCapabilities, r), l = pT(u.audioCapabilities, r), u.videoCapabilities && u.videoCapabilities.length && !a.length || u.audioCapabilities && u.audioCapabilities.length && !l.length || (c = Object.assign({}, u), c.videoCapabilities = a, c.audioCapabilities = l, i.push(c));
              if (!i.length) throw d = Error("Unsupported keySystem or supportedConfigurations."), d.name = "NotSupportedError", d.code = DOMException.NOT_SUPPORTED_ERR, d;
              return x(w, oa.call(n, e, i), 2);
            }
            return h = w.h, g = p = null, i[0] && (i[0].videoCapabilities && (p = i[0].videoCapabilities[0].encryptionScheme), i[0].audioCapabilities && (g = i[0].audioCapabilities[0].encryptionScheme)), w.return(new Hc(h, p, g));
          });
        }
        function pT(e, t) {
          return e && e.filter(function(n) {
            return Np(n.encryptionScheme, t);
          });
        }
        yn.EmeEncryptionScheme = dT, dT.install = fT, Nn(fT);
        function gT() {
        }
        var sa;
        function mT() {
          Se().Lf() && !sa && !navigator.mediaCapabilitiesEncryptionSchemePolyfilled && navigator.mediaCapabilities && (sa = navigator.mediaCapabilities.decodingInfo, navigator.mediaCapabilities.decodingInfo = Kk, navigator.mediaCapabilitiesEncryptionSchemePolyfilled = !0);
        }
        function Kk(e) {
          var t = this, n, r;
          return D(function(i) {
            switch (i.g) {
              case 1:
                return x(i, sa.call(t, e), 2);
              case 2:
                if (n = i.h, !n.supported || !e.keySystemConfiguration) return i.return(n);
                if (r = n.keySystemAccess, cT(r)) return navigator.mediaCapabilities.decodingInfo = sa, i.return(n);
                if (navigator.mediaCapabilities.decodingInfo = vT, r) {
                  i.A(3);
                  break;
                }
                return x(i, yT(e), 4);
              case 4:
                return n.keySystemAccess = i.h, i.return(n);
              case 3:
                return i.return(vT.call(t, e));
            }
          });
        }
        function vT(e) {
          var t = this, n, r, i, o, s, u, a;
          return D(function(l) {
            switch (l.g) {
              case 1:
                return r = n = null, !e.keySystemConfiguration || (i = e.keySystemConfiguration, o = i.keySystem, r = i.audio && i.audio.encryptionScheme, n = i.video && i.video.encryptionScheme, s = lT(o), u = { powerEfficient: !1, smooth: !1, supported: !1, keySystemAccess: null, configuration: e }, Np(r, s) && Np(n, s)) ? x(l, sa.call(t, e), 2) : l.return(u);
              case 2:
                if (a = l.h, a.keySystemAccess) {
                  a.keySystemAccess = new Hc(a.keySystemAccess, n, r), l.A(3);
                  break;
                }
                if (!e.keySystemConfiguration) {
                  l.A(3);
                  break;
                }
                return x(l, yT(e), 5);
              case 5:
                a.keySystemAccess = l.h;
              case 3:
                return l.return(a);
            }
          });
        }
        function yT(e) {
          var t, n;
          return D(function(r) {
            if (r.g == 1) {
              var i = e.keySystemConfiguration, o = [], s = [];
              return i.audio && o.push({ robustness: i.audio.robustness || "", contentType: e.audio.contentType, encryptionScheme: i.audio.encryptionScheme }), i.video && s.push({ robustness: i.video.robustness || "", contentType: e.video.contentType, encryptionScheme: i.video.encryptionScheme }), i = { initDataTypes: i.initDataType ? [i.initDataType] : [], distinctiveIdentifier: i.distinctiveIdentifier, persistentState: i.persistentState, sessionTypes: i.sessionTypes }, o.length && (i.audioCapabilities = o), s.length && (i.videoCapabilities = s), t = i, x(r, navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem, [t]), 2);
            }
            return n = r.h, r.return(n);
          });
        }
        yn.MCapEncryptionScheme = gT, gT.install = mT, Nn(mT, -2);
        function Gc() {
        }
        function wT() {
          Se().kc() || (navigator.mediaCapabilities || (navigator.mediaCapabilities = {}), Gc.originalMcap = navigator.mediaCapabilities, navigator.mediaCapabilities.decodingInfo = Wk);
        }
        function Wk(e) {
          var t, n, r, i, o, s, u, a, l, c, d;
          return D(function(h) {
            switch (h.g) {
              case 1:
                if (t = { supported: !1, powerEfficient: !0, smooth: !0, keySystemAccess: null, configuration: e }, Se(), n = e.video, r = e.audio, e.type != "media-source") {
                  if (e.type == "file") {
                    if (n && (i = n.contentType, o = oo().canPlayType(i) != "", !o) || r && (s = r.contentType, u = oo().canPlayType(s) != "", !u)) return h.return(t);
                  } else return h.return(t);
                  h.A(2);
                  break;
                }
                if (!br()) return h.return(t);
                if (!n) {
                  h.A(3);
                  break;
                }
                return x(h, zk(n), 4);
              case 4:
                if (a = h.h, !a) return h.return(t);
              case 3:
                if (r) {
                  var p = Se().Oa(), g = r.contentType;
                  if (p === "CAST" && r.spatialRendering && (g += "; spatialRendering=true"), l = Qt(g), !l) return h.return(t);
                }
              case 2:
                return e.keySystemConfiguration ? (c = e.keySystemConfiguration, x(h, Xk(n, r, c), 6)) : (t.supported = !0, h.return(t));
              case 6:
                (d = h.h) && (t.supported = !0, t.keySystemAccess = d);
              case 5:
                return h.return(t);
            }
          });
        }
        function zk(e) {
          var t, n, r;
          return D(function(i) {
            return i.g == 1 ? (t = Se(), n = t.Oa(), n !== "CAST" ? i.A(2) : x(i, qk(e), 3)) : i.g != 2 ? (r = i.h, i.return(r)) : i.return(Qt(e.contentType));
          });
        }
        function Xk(e, t, n) {
          var r, i, o, s, u, a, l, c, d, h, p, g;
          return D(function(w) {
            switch (w.g) {
              case 1:
                r = [], i = [], o = [], n.audio && (s = { robustness: n.audio.robustness || "", contentType: t.contentType }, Se().xi() && t.contentType.includes('codecs="ac-3"') && (s.contentType = 'audio/mp4; codecs="ec-3"'), n.audio.encryptionScheme && (s.encryptionScheme = n.audio.encryptionScheme, o.push(n.audio.encryptionScheme)), r.push(s)), n.video && (u = { robustness: n.video.robustness || "", contentType: e.contentType }, n.video.encryptionScheme && (u.encryptionScheme = n.video.encryptionScheme, o.push(n.video.encryptionScheme)), i.push(u)), a = { initDataTypes: [n.initDataType], distinctiveIdentifier: n.distinctiveIdentifier, persistentState: n.persistentState, sessionTypes: n.sessionTypes }, r.length && (a.audioCapabilities = r), i.length && (a.videoCapabilities = i), l = e ? e.contentType : "", c = t ? t.contentType : "", d = xn(l) + ";" + yi(l), h = xn(c) + ";" + yi(c), p = n.keySystem, g = null, de(w, 2);
                var T = Sd(d, h, p, o);
                if (Po.has(T)) {
                  T = Sd(d, h, p, o), g = Po.get(T) || null, w.A(4);
                  break;
                }
                return x(w, navigator.requestMediaKeySystemAccess(
                  n.keySystem,
                  [a]
                ), 5);
              case 5:
                T = g = w.h;
                var E = Sd(d, h, p, o);
                Po.set(E, T);
              case 4:
                ye(w, 3);
                break;
              case 2:
                he(w);
              case 3:
                return w.return(g);
            }
          });
        }
        function qk(e) {
          var t, n, r, i, o;
          return D(function(s) {
            if (s.g == 1) {
              if (!(C.cast && cast.__platform__ && cast.__platform__.canDisplayType)) return s.return(Qt(e.contentType));
              switch (t = e.contentType, e.width && e.height && e.width > 1280 && e.height > 720 && (t += "; width=" + e.width + "; height=" + e.height), e.framerate && (n = Math.round(e.framerate), n < 24 || n > 30) && (t += "; framerate=" + e.framerate), r = e.transferFunction || "", r) {
                case "":
                case "srgb":
                  break;
                case "pq":
                  t += "; eotf=smpte2084";
                  break;
                case "hlg":
                  t += "; eotf=arib-std-b67";
                  break;
                default:
                  return s.return(!1);
              }
              return i = !1, o = Yk, o.has(t) ? (i = o.get(t), s.A(2)) : x(s, cast.__platform__.canDisplayType(t), 3);
            }
            return s.g != 2 && (i = s.h, o.set(t, i)), s.return(i);
          });
        }
        yn.MediaCapabilities = Gc, Gc.install = wT, Gc.originalMcap = null;
        var Yk = /* @__PURE__ */ new Map();
        Nn(wT, -1);
        function TT() {
        }
        function ST() {
          var e = Se(), t = e.Ha() === "WEBKIT" ? e.Ba() : null;
          for ((C.MediaSource || C.ManagedMediaSource) && t && C.MediaSource && (t <= 12 ? (xT(), $k()) : t <= 15 && xT()), e = m(e.Hi()), t = e.next(); !t.done; t = e.next()) Qk(t.value);
          (C.MediaSource || C.ManagedMediaSource) && Jk(), C.MediaSource && MediaSource.isTypeSupported('video/webm; codecs="vp9"') && !MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"') && Zk();
        }
        function xT() {
          var e = MediaSource.prototype.addSourceBuffer;
          MediaSource.prototype.addSourceBuffer = function() {
            var t = e.apply(this, $e.apply(0, arguments));
            return t.abort = function() {
            }, t;
          };
        }
        function $k() {
          var e = SourceBuffer.prototype.remove;
          SourceBuffer.prototype.remove = function(t, n) {
            return e.call(this, t, n - 1e-3);
          };
        }
        function Jk() {
          if (C.MediaSource) {
            var e = MediaSource.isTypeSupported.bind(MediaSource);
            MediaSource.isTypeSupported = function(n) {
              return Qs(n) != "mp2t" && e(n);
            };
          }
          if (C.ManagedMediaSource) {
            var t = ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);
            C.ManagedMediaSource.isTypeSupported = function(n) {
              return Qs(n) != "mp2t" && t(n);
            };
          }
        }
        function Qk(e) {
          var t = MediaSource.isTypeSupported.bind(MediaSource);
          if (MediaSource.isTypeSupported = function(r) {
            return yi(r) != e && t(r);
          }, C.ManagedMediaSource) {
            var n = ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);
            C.ManagedMediaSource.isTypeSupported = function(r) {
              return yi(r) != e && n(r);
            };
          }
        }
        function Zk() {
          var e = MediaSource.isTypeSupported;
          Se().cj() && (MediaSource.isTypeSupported = function(t) {
            var n = t.split(/ *; */), r = n.findIndex(function(s) {
              return s.startsWith("codecs=");
            });
            if (r < 0) return e(t);
            var i = n[r].replace("codecs=", "").replace(/"/g, "").split(/\s*,\s*/), o = i.findIndex(function(s) {
              return s.startsWith("vp09");
            });
            return o >= 0 && (i[o] = "vp9", n[r] = 'codecs="' + i.join(",") + '"', t = n.join("; ")), e(t);
          });
        }
        yn.MediaSource = TT, TT.install = ST, Nn(ST);
        function Op() {
        }
        var jp, Up, _p, Bp, Fp, Vp;
        function AT(e) {
          C.HTMLVideoElement && C.WebKitMediaKeys && C.shakaMediaKeysPolyfill != Gp && (e !== void 0 && e && (jp = !0, Up = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "mediaKeys"), _p = HTMLMediaElement.prototype.setMediaKeys, Bp = C.MediaKeys, Fp = C.MediaKeySystemAccess, Vp = navigator.requestMediaKeySystemAccess), delete HTMLMediaElement.prototype.mediaKeys, HTMLMediaElement.prototype.mediaKeys = null, HTMLMediaElement.prototype.setMediaKeys = t4, C.MediaKeys = ua, C.MediaKeySystemAccess = Kc, navigator.requestMediaKeySystemAccess = e4, C.shakaMediaKeysPolyfill = Gp, Xa.clear(), Po.clear());
        }
        function e4(e, t) {
          try {
            var n = new Kc(e, t);
            return Promise.resolve(n);
          } catch (r) {
            return Promise.reject(r);
          }
        }
        function t4(e) {
          var t = this.mediaKeys;
          return t && t != e && ET(t, null), delete this.mediaKeys, (this.mediaKeys = e) ? ET(e, this) : Promise.resolve();
        }
        function n4(e) {
          if (e = pe(e.initData), dn(e).getUint32(0, !0) + 4 != e.byteLength) throw new RangeError("Malformed FairPlay init data");
          e = fi(e.subarray(4), !0), e = sr(e);
          var t = new Event("encrypted");
          t.initDataType = "skd", t.initData = Kn(e), this.dispatchEvent(t);
        }
        yn.PatchedMediaKeysApple = Op, Op.uninstall = function() {
          C.shakaMediaKeysPolyfill == Gp && jp && (jp = !1, Object.defineProperty(HTMLMediaElement.prototype, "mediaKeys", Up), HTMLMediaElement.prototype.setMediaKeys = _p, C.MediaKeys = Bp, C.MediaKeySystemAccess = Fp, navigator.requestMediaKeySystemAccess = Vp, Up = Vp = _p = Fp = Bp = null, C.shakaMediaKeysPolyfill = "", Xa.clear(), Po.clear());
        }, Op.install = AT;
        function Kc(e, t) {
          if (this.keySystem = e, e.startsWith("com.apple.fps")) for (e = m(t), t = e.next(); !t.done; t = e.next()) {
            var n = t.value;
            if (n.persistentState == "required") t = null;
            else {
              t = { audioCapabilities: [], videoCapabilities: [], persistentState: "optional", distinctiveIdentifier: "optional", initDataTypes: n.initDataTypes, sessionTypes: ["temporary"], label: n.label };
              var r = !1, i = !1;
              if (n.audioCapabilities) for (var o = m(n.audioCapabilities), s = o.next(); !s.done; s = o.next()) s = s.value, s.contentType && (r = !0, WebKitMediaKeys.isTypeSupported(
                this.keySystem,
                s.contentType.split(";")[0]
              ) && (t.audioCapabilities.push(s), i = !0));
              if (n.videoCapabilities) for (n = m(n.videoCapabilities), o = n.next(); !o.done; o = n.next()) o = o.value, o.contentType && (r = !0, WebKitMediaKeys.isTypeSupported(this.keySystem, o.contentType.split(";")[0]) && (t.videoCapabilities.push(o), i = !0));
              r || (i = WebKitMediaKeys.isTypeSupported(this.keySystem, "video/mp4")), t = i ? t : null;
            }
            if (t) {
              this.g = t;
              return;
            }
          }
          throw e = Error("Unsupported keySystem"), e.name = "NotSupportedError", e.code = DOMException.NOT_SUPPORTED_ERR, e;
        }
        Kc.prototype.createMediaKeys = function() {
          var e = new ua(this.keySystem);
          return Promise.resolve(e);
        }, Kc.prototype.getConfiguration = function() {
          return this.g;
        };
        function ua(e) {
          this.h = new WebKitMediaKeys(e), this.g = new Ve();
        }
        ua.prototype.createSession = function(e) {
          if (e = e || "temporary", e != "temporary") throw new TypeError("Session type " + e + " is unsupported on this platform.");
          return new Hp(this.h);
        }, ua.prototype.setServerCertificate = function() {
          return Promise.resolve(!1);
        };
        function ET(e, t) {
          if (e.g.Qa(), !t) return Promise.resolve();
          e.g.D(t, "webkitneedkey", n4);
          try {
            return es(t, HTMLMediaElement.HAVE_METADATA, e.g, function() {
              t.webkitSetMediaKeys(e.h);
            }), Promise.resolve();
          } catch (n) {
            return Promise.reject(n);
          }
        }
        ua.prototype.getStatusForPolicy = function() {
          return Promise.resolve("usable");
        };
        function Hp(e) {
          Xe.call(this), this.i = null, this.l = e, this.g = this.h = null, this.j = new Ve(), this.sessionId = "", this.expiration = NaN, this.closed = new Je(), this.keyStatuses = new IT(), this.onkeystatuseschange = null;
        }
        tt(Hp, Xe), f = Hp.prototype, f.generateRequest = function(e, t) {
          var n = this;
          this.h = new Je();
          try {
            var r = this.l.createSession("video/mp4", pe(t));
            this.i = r, this.sessionId = r.sessionId || "", this.j.D(this.i, "webkitkeymessage", function(i) {
              n.h && (n.h.resolve(), n.h = null), i = (/* @__PURE__ */ new Map()).set("messageType", n.keyStatuses.bc() == null ? "license-request" : "license-renewal").set("message", Kn(i.message)), i = new ee("message", i), n.dispatchEvent(i);
            }), this.j.D(r, "webkitkeyadded", function() {
              n.g && (Wc(n, "usable"), n.g.resolve(), n.g = null);
            }), this.j.D(
              r,
              "webkitkeyerror",
              function() {
                var i = Error("EME PatchedMediaKeysApple key error");
                if (i.errorCode = n.i.error, n.h != null) n.h.reject(i), n.h = null;
                else if (n.g != null) n.g.reject(i), n.g = null;
                else switch (n.i.error.code) {
                  case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:
                  case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:
                    Wc(n, "output-not-allowed");
                    break;
                  default:
                    Wc(n, "internal-error");
                }
              }
            ), Wc(this, "status-pending");
          } catch (i) {
            this.h.reject(i);
          }
          return this.h;
        }, f.load = function() {
          return Promise.reject(Error("MediaKeySession.load not yet supported"));
        }, f.update = function(e) {
          this.g = new Je();
          try {
            this.i.update(pe(e));
          } catch (t) {
            this.g.reject(t);
          }
          return this.g;
        }, f.close = function() {
          try {
            this.i.close(), this.closed.resolve(), this.j.Qa();
          } catch (e) {
            this.closed.reject(e);
          }
          return this.closed;
        }, f.remove = function() {
          return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"));
        };
        function Wc(e, t) {
          var n = e.keyStatuses;
          n.size = t == null ? 0 : 1, n.g = t, t = new ee("keystatuseschange"), e.dispatchEvent(t), e.onkeystatuseschange && e.onkeystatuseschange(t);
        }
        function IT() {
          this.size = 0, this.g = void 0;
        }
        f = IT.prototype, f.bc = function() {
          return this.g;
        }, f.forEach = function(e) {
          this.g && e(this.g, Ea.value());
        }, f.get = function(e) {
          if (this.has(e)) return this.g;
        }, f.has = function(e) {
          var t = Ea.value();
          return !!(this.g && Ur(e, t));
        }, f.entries = function() {
        }, f.keys = function() {
        }, f.values = function() {
        };
        var Gp = "apple";
        Nn(function() {
          C.HTMLVideoElement && C.WebKitMediaKeys && (navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration || AT());
        });
        function MT() {
        }
        function CT() {
          if (C.MediaKeys) {
            var e = Se();
            MediaKeys.prototype.setServerCertificate && e.ve() || (MediaKeys.prototype.setServerCertificate = r4);
          }
        }
        function r4() {
          return Promise.resolve(!1);
        }
        yn.PatchedMediaKeysCert = MT, MT.install = CT, Nn(CT);
        function kT() {
        }
        function PT() {
          if (!(!C.HTMLVideoElement || navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration)) {
            if (HTMLMediaElement.prototype.webkitGenerateKeyRequest) qp = "webkit";
            else if (!HTMLMediaElement.prototype.generateKeyRequest) return;
            navigator.requestMediaKeySystemAccess = i4, delete HTMLMediaElement.prototype.mediaKeys, HTMLMediaElement.prototype.mediaKeys = null, HTMLMediaElement.prototype.setMediaKeys = o4, C.MediaKeys = aa, C.MediaKeySystemAccess = zc, C.shakaMediaKeysPolyfill = s4;
          }
        }
        function Kp(e) {
          var t = qp;
          return t ? t + e.charAt(0).toUpperCase() + e.slice(1) : e;
        }
        function i4(e, t) {
          try {
            var n = new zc(e, t);
            return Promise.resolve(n);
          } catch (r) {
            return Promise.reject(r);
          }
        }
        function o4(e) {
          var t = this.mediaKeys;
          return t && t != e && DT(t, null), delete this.mediaKeys, (this.mediaKeys = e) && DT(e, this), Promise.resolve();
        }
        yn.PatchedMediaKeysWebkit = kT, kT.install = PT;
        function zc(e, t) {
          this.g = this.keySystem = e;
          var n = !1;
          e == "org.w3.clearkey" && (this.g = "webkit-org.w3.clearkey", n = !1);
          var r = !1, i = document.getElementsByTagName("video");
          i = i.length ? i[0] : document.createElement("video"), t = m(t);
          for (var o = t.next(); !o.done; o = t.next()) {
            o = o.value;
            var s = { audioCapabilities: [], videoCapabilities: [], persistentState: "optional", distinctiveIdentifier: "optional", initDataTypes: o.initDataTypes, sessionTypes: ["temporary"], label: o.label }, u = !1;
            if (o.audioCapabilities) for (var a = m(o.audioCapabilities), l = a.next(); !l.done; l = a.next()) l = l.value, l.contentType && (u = !0, i.canPlayType(l.contentType.split(";")[0], this.g) && (s.audioCapabilities.push(l), r = !0));
            if (o.videoCapabilities) for (a = m(o.videoCapabilities), l = a.next(); !l.done; l = a.next()) l = l.value, l.contentType && (u = !0, i.canPlayType(l.contentType, this.g) && (s.videoCapabilities.push(l), r = !0));
            if (u || (r = i.canPlayType("video/mp4", this.g) || i.canPlayType("video/webm", this.g)), o.persistentState == "required" && (n ? (s.persistentState = "required", s.sessionTypes = ["persistent-license"]) : r = !1), r) {
              this.h = s;
              return;
            }
          }
          throw n = "Unsupported keySystem", (e == "org.w3.clearkey" || e == "com.widevine.alpha") && (n = "None of the requested configurations were supported."), e = Error(n), e.name = "NotSupportedError", e.code = DOMException.NOT_SUPPORTED_ERR, e;
        }
        zc.prototype.createMediaKeys = function() {
          var e = new aa(this.g);
          return Promise.resolve(e);
        }, zc.prototype.getConfiguration = function() {
          return this.h;
        };
        function aa(e) {
          this.l = e, this.h = null, this.g = new Ve(), this.i = [], this.j = /* @__PURE__ */ new Map();
        }
        function DT(e, t) {
          e.h = t, e.g.Qa();
          var n = qp;
          t && (e.g.D(t, n + "needkey", function(r) {
            var i = new CustomEvent("encrypted");
            i.initDataType = "cenc", i.initData = Kn(r.initData), e.h.dispatchEvent(i);
          }), e.g.D(t, n + "keymessage", function(r) {
            var i = Wp(e, r.sessionId);
            i && (r = (/* @__PURE__ */ new Map()).set("messageType", i.keyStatuses.bc() == null ? "licenserequest" : "licenserenewal").set("message", r.message), r = new ee("message", r), i.h && (i.h.resolve(), i.h = null), i.dispatchEvent(r));
          }), e.g.D(t, n + "keyadded", function(r) {
            (r = Wp(e, r.sessionId)) && r.ready();
          }), e.g.D(t, n + "keyerror", function(r) {
            var i = Wp(e, r.sessionId);
            if (i) {
              var o = Error("EME v0.1b key error"), s = r.errorCode;
              s.systemCode = r.systemCode, o.errorCode = s, !r.sessionId && i.h ? (r.systemCode == 45 && (o.message = "Unsupported session type."), i.h.reject(o), i.h = null) : r.sessionId && i.g ? (i.g.reject(o), i.g = null) : (o = r.systemCode, r.errorCode.code == MediaKeyError.MEDIA_KEYERR_OUTPUT ? Xc(i, "output-restricted") : o == 1 ? Xc(i, "expired") : Xc(i, "internal-error"));
            }
          }));
        }
        aa.prototype.createSession = function(e) {
          if (e = e || "temporary", e != "temporary" && e != "persistent-license") throw new TypeError("Session type " + e + " is unsupported on this platform.");
          var t = this.h || document.createElement("video");
          return t.src || (t.src = "about:blank"), e = new zp(t, this.l, e), this.i.push(e), e;
        }, aa.prototype.setServerCertificate = function() {
          return Promise.resolve(!1);
        }, aa.prototype.getStatusForPolicy = function() {
          return Promise.resolve("usable");
        };
        function Wp(e, t) {
          var n = e.j.get(t);
          return n || ((n = e.i.shift()) ? (n.sessionId = t, e.j.set(t, n), n) : null);
        }
        function zp(e, t, n) {
          Xe.call(this), this.j = e, this.m = !1, this.g = this.h = null, this.i = t, this.l = n, this.sessionId = "", this.expiration = NaN, this.closed = new Je(), this.keyStatuses = new LT(), this.onkeystatuseschange = null;
        }
        tt(zp, Xe), f = zp.prototype, f.ready = function() {
          Xc(this, "usable"), this.g && this.g.resolve(), this.g = null;
        };
        function RT(e, t, n) {
          if (e.m) return Promise.reject(Error("The session is already initialized."));
          e.m = !0;
          try {
            if (e.l == "persistent-license") if (n) var r = pe(sr("LOAD_SESSION|" + n));
            else {
              var i = sr("PERSISTENT|");
              r = St(i, t);
            }
            else r = pe(t);
          } catch (s) {
            return Promise.reject(s);
          }
          e.h = new Je();
          var o = Kp("generateKeyRequest");
          try {
            e.j[o](e.i, r);
          } catch (s) {
            if (s.name != "InvalidStateError") return e.h = null, Promise.reject(s);
            new Ae(function() {
              try {
                e.j[o](e.i, r);
              } catch (u) {
                e.h.reject(u), e.h = null;
              }
            }).ka(0.01);
          }
          return e.h;
        }
        function Xp(e, t, n) {
          if (e.g) e.g.then(function() {
            return Xp(e, t, n);
          }).catch(function() {
            return Xp(e, t, n);
          });
          else {
            if (e.g = t, e.i == "webkit-org.w3.clearkey") {
              var r = dt(n), i = JSON.parse(r);
              i.keys[0].kty != "oct" && (e.g.reject(Error("Response is not a valid JSON Web Key Set.")), e.g = null), r = Wn(i.keys[0].k), i = Wn(i.keys[0].kid);
            } else r = pe(n), i = null;
            var o = Kp("addKey");
            try {
              e.j[o](e.i, r, i, e.sessionId);
            } catch (s) {
              e.g.reject(s), e.g = null;
            }
          }
        }
        function Xc(e, t) {
          var n = e.keyStatuses;
          n.size = t == null ? 0 : 1, n.g = t, t = new ee("keystatuseschange"), e.dispatchEvent(t), e.onkeystatuseschange && e.onkeystatuseschange(t);
        }
        f.generateRequest = function(e, t) {
          return RT(this, t, null);
        }, f.load = function(e) {
          return this.l == "persistent-license" ? RT(this, null, e) : Promise.reject(Error("Not a persistent session."));
        }, f.update = function(e) {
          var t = new Je();
          return Xp(this, t, e), t;
        }, f.close = function() {
          if (this.l != "persistent-license") {
            if (!this.sessionId) return this.closed.reject(Error("The session is not callable.")), this.closed;
            var e = Kp("cancelKeyRequest");
            try {
              this.j[e](this.i, this.sessionId);
            } catch {
            }
          }
          return this.closed.resolve(), this.closed;
        }, f.remove = function() {
          return this.l != "persistent-license" ? Promise.reject(Error("Not a persistent session.")) : this.close();
        };
        function LT() {
          this.size = 0, this.g = void 0;
        }
        f = LT.prototype, f.bc = function() {
          return this.g;
        }, f.forEach = function(e) {
          this.g && e(this.g, Ea.value());
        }, f.get = function(e) {
          if (this.has(e)) return this.g;
        }, f.has = function(e) {
          var t = Ea.value();
          return !!(this.g && Ur(e, t));
        }, f.entries = function() {
        }, f.keys = function() {
        }, f.values = function() {
        };
        var qp = "", s4 = "webkit";
        Nn(PT);
        function bT() {
        }
        function NT() {
          C.crypto && ("randomUUID" in C.crypto || (C.crypto.randomUUID = u4));
        }
        function u4() {
          var e = URL.createObjectURL(new Blob()), t = e.toString();
          return URL.revokeObjectURL(e), t.substr(t.lastIndexOf("/") + 1);
        }
        yn.RandomUUID = bT, bT.install = NT, Nn(NT);
        function OT() {
        }
        function jT() {
          var e = Symbol.prototype;
          "description" in e || Object.defineProperty(e, "description", { get: a4 });
        }
        function a4() {
          var e = /\((.*)\)/.exec(this.toString());
          return e ? e[1] : void 0;
        }
        yn.Symbol = OT, OT.install = jT, Nn(jT);
        function UT() {
        }
        function _T() {
          for (var e = m([Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, Int8Array, Int16Array, Int32Array, Float32Array, Float64Array]), t = e.next(); !t.done; t = e.next()) t = t.value, t.prototype.indexOf || (t.prototype.indexOf = l4), t.prototype.lastIndexOf || (t.prototype.lastIndexOf = c4), t.prototype.includes || (t.prototype.includes = d4);
        }
        function l4(e, t) {
          return Array.prototype.indexOf.call(this, e, t);
        }
        function c4(e, t) {
          return Array.prototype.lastIndexOf.call(this, e, t);
        }
        function d4(e, t) {
          return this.indexOf(e, t) !== -1;
        }
        yn.TypedArray = UT, UT.install = _T, Nn(_T);
        function BT() {
        }
        function FT() {
          if (C.HTMLMediaElement) {
            var e = HTMLMediaElement.prototype.play;
            HTMLMediaElement.prototype.play = function() {
              var t = e.apply(this);
              return t && t.catch(function() {
              }), t;
            };
          }
        }
        yn.VideoPlayPromise = BT, BT.install = FT, Nn(FT);
        function VT() {
        }
        function HT() {
          if (C.HTMLVideoElement) {
            var e = HTMLVideoElement.prototype;
            !e.getVideoPlaybackQuality && ("webkitDroppedFrameCount" in e || typeof oo().webkitDroppedFrameCount == "number") && (e.getVideoPlaybackQuality = f4);
          }
        }
        function f4() {
          return { droppedVideoFrames: this.webkitDroppedFrameCount, totalVideoFrames: this.webkitDecodedFrameCount, corruptedVideoFrames: 0, creationTime: NaN, totalFrameDelay: 0 };
        }
        yn.VideoPlaybackQuality = VT, VT.install = HT, Nn(HT);
        function GT() {
        }
        function KT() {
          if (!C.VTTCue && C.TextTrackCue) {
            var e = null, t = TextTrackCue.length;
            if (t == 3) e = Yp;
            else if (t == 6) e = h4;
            else {
              try {
                var n = !!Yp(1, 2, "");
              } catch {
                n = !1;
              }
              n && (e = Yp);
            }
            e && (C.VTTCue = function(r, i, o) {
              return e(r, i, o);
            });
          }
        }
        function Yp(e, t, n) {
          return new C.TextTrackCue(e, t, n);
        }
        function h4(e, t, n) {
          return new C.TextTrackCue(e + "-" + t + "-" + n, e, t, n);
        }
        yn.VTTCue = GT, GT.install = KT, Nn(KT);
        function Ot(e) {
          Xe.call(this), this.g = e, this.m = null, this.h = [], this.j = -1, this.i = this.l = null, this.o = new Ve();
        }
        tt(Ot, Xe), f = Ot.prototype, f.destroy = function() {
          var e = this;
          return D(function(t) {
            if (t.g == 1) return x(t, e.removeAllItems(), 2);
            e.g = null, e.o && (e.o.release(), e.o = null), Xe.prototype.release.call(e), q(t);
          });
        }, f.configure = function(e) {
          this.m = e;
        }, f.getConfiguration = function() {
          return this.m;
        }, f.getCurrentItem = function() {
          return this.h.length && this.j >= 0 && this.j < this.h.length ? this.h[this.j] : null;
        }, f.getCurrentItemIndex = function() {
          return this.j;
        }, f.getItems = function() {
          return this.h.slice();
        }, f.insertItems = function(e) {
          this.h.push.apply(this.h, X(e)), this.dispatchEvent(new ee("itemsinserted"));
        }, f.removeAllItems = function() {
          var e = this, t, n, r, i;
          return D(function(o) {
            if (o.g == 1) return e.o.Qa(), e.h.length && e.j >= 0 ? x(o, e.g.Dc(), 2) : o.A(2);
            if (o.g != 4) {
              for (t = [], e.i && (e.i.preloadManager.l || t.push(e.i.preloadManager.destroy()), e.i = null), e.l && (e.l.preloadManager.l || t.push(e.l.preloadManager.destroy()), e.l = null), n = m(e.h), r = n.next(); !r.done; r = n.next()) i = r.value, i.preloadManager && !i.preloadManager.l && t.push(i.preloadManager.destroy());
              return t.length ? x(o, Promise.all(t), 4) : o.A(4);
            }
            e.h = [], e.j = -1, e.dispatchEvent(new ee("itemsremoved")), q(o);
          });
        }, f.playItem = function(e) {
          var t = this, n, r, i, o, s, u, a, l, c, d, h, p, g, w, T, E, A;
          return D(function(I) {
            switch (I.g) {
              case 1:
                if (t.o.Qa(), !t.h.length || e >= t.h.length) throw new b(2, 7, 7007);
                if (n = t.getCurrentItem(), r = t.h[e], t.j != e && (t.j = e, t.dispatchEvent(new ee("currentitemchanged"))), i = t.g.$e(), o = t.m ? t.m.preloadNextUrlWindow : 0, o > 0 && (s = !1, t.o.D(i, "timeupdate", function() {
                  var P, N, M, R;
                  return D(function(k) {
                    switch (k.g) {
                      case 1:
                        if (t.l || t.h.length <= 1 || s || t.g.U() || !i.duration) return k.return();
                        if (P = t.g.Ra().end - i.currentTime, isNaN(P)) {
                          k.A(0);
                          break;
                        }
                        if (!(P <= o)) {
                          k.A(0);
                          break;
                        }
                        if (N = t.m && t.m.repeatMode, M = null, t.j + 1 < t.h.length ? M = t.h[t.j + 1] : N == 1 && (M = t.h[0]), !M || M.preloadManager && !M.preloadManager.l) {
                          k.A(0);
                          break;
                        }
                        return s = !0, R = null, de(k, 5), x(k, t.g.preload(M.manifestUri, M.startTime, M.mimeType, M.config), 7);
                      case 7:
                        R = k.h, ye(k, 6);
                        break;
                      case 5:
                        he(k), R = null;
                      case 6:
                        t.l = { item: M, preloadManager: R }, s = !1, q(k);
                    }
                  });
                })), t.o.D(t.g, "complete", function() {
                  var P = t.m && t.m.repeatMode, N = !1;
                  if (P == 2) N = !0;
                  else {
                    var M = t.j + 1;
                    M < t.h.length ? t.playItem(M) : P == 1 && (t.h.length == 1 ? N = !0 : t.playItem(0));
                  }
                  N && (i.paused ? (i.currentTime = t.g.Ra().start, i.play()) : t.o.D(i, "paused", function() {
                    i.currentTime = t.g.Ra().start, i.play();
                  }));
                }), u = r.manifestUri, r.preloadManager && !r.preloadManager.l && (u = r.preloadManager), a = !1, t.l && t.l.item == r && t.l.preloadManager ? u = t.l.preloadManager : t.i && t.i.item == r && t.i.preloadManager && (u = t.i.preloadManager, a = !0), !t.i) {
                  I.A(2);
                  break;
                }
                if (a || t.i.preloadManager.l) {
                  I.A(3);
                  break;
                }
                return x(I, t.i.preloadManager.destroy(), 3);
              case 3:
                t.i = null;
              case 2:
                if (!(t.m && t.m.preloadPrevItem && n && t.g.$d() === Vt)) {
                  I.A(5);
                  break;
                }
                return l = null, de(I, 6), x(I, t.g.gj(), 8);
              case 8:
                l = I.h, ye(I, 7);
                break;
              case 6:
                he(I), l = null;
              case 7:
                t.i = { item: n, preloadManager: l };
              case 5:
                return r.config && (t.g.Ki(), t.g.configure(r.config)), x(I, t.g.load(u, r.startTime, r.mimeType), 9);
              case 9:
                if (t.l = null, r.extraText) for (c = m(r.extraText), d = c.next(); !d.done; d = c.next()) h = d.value, h.mime ? t.g.Rd(h.uri, h.language, h.kind, h.mime, h.codecs) : t.g.Rd(h.uri, h.language, h.kind);
                if (r.extraThumbnail) for (p = m(r.extraThumbnail), g = p.next(); !g.done; g = p.next()) w = g.value, t.g.Oe(w);
                if (r.extraChapter) for (T = m(r.extraChapter), E = T.next(); !E.done; E = T.next()) A = E.value, t.g.Ne(A.uri, A.language, A.mime);
                q(I);
            }
          });
        }, Y("shaka.queue.QueueManager", Ot), Ot.prototype.playItem = Ot.prototype.playItem, Ot.prototype.removeAllItems = Ot.prototype.removeAllItems, Ot.prototype.insertItems = Ot.prototype.insertItems, Ot.prototype.getItems = Ot.prototype.getItems, Ot.prototype.getCurrentItemIndex = Ot.prototype.getCurrentItemIndex, Ot.prototype.getCurrentItem = Ot.prototype.getCurrentItem, Ot.prototype.getConfiguration = Ot.prototype.getConfiguration, Ot.prototype.configure = Ot.prototype.configure, Ot.prototype.destroy = Ot.prototype.destroy, Jl = function(e) {
          return new Ot(e);
        };
        function On() {
        }
        On.prototype.parseInit = function() {
        }, On.prototype.setSequenceMode = function() {
        }, On.prototype.setManifestType = function() {
        }, On.prototype.parseMedia = function(e, t) {
          var n = null, r = [];
          e = dt(e).split(/\r?\n/), e = m(e);
          for (var i = e.next(); !i.done; i = e.next()) if ((i = i.value) && !/^\s+$/.test(i) && (i = p4.exec(i))) {
            var o = g4.exec(i[1]);
            o = parseInt(o[1], 10) * 60 + parseFloat(o[2].replace(",", ".")), i = new ot(o, t.segmentEnd ? t.segmentEnd : o + 2, i[2]), n && (n.endTime = o, r.push(n)), n = i;
          }
          return n && r.push(n), r;
        }, Y("shaka.text.LrcTextParser", On), On.prototype.parseMedia = On.prototype.parseMedia, On.prototype.setManifestType = On.prototype.setManifestType, On.prototype.setSequenceMode = On.prototype.setSequenceMode, On.prototype.parseInit = On.prototype.parseInit;
        var p4 = /^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/, g4 = /^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;
        Bt("application/x-subtitle-lrc", function() {
          return new On();
        });
        function kn() {
          this.g = "UNKNOWN";
        }
        kn.prototype.parseInit = function() {
        }, kn.prototype.setSequenceMode = function() {
        }, kn.prototype.setManifestType = function(e) {
          this.g = e;
        }, kn.prototype.parseMedia = function(e, t, n, r) {
          var i = dt(e);
          if (e = [], i == "") return e;
          var o = qi(i, "tt", !0);
          if (!o) throw new b(2, 2, 2005, "Failed to parse TTML.");
          if (i = wr(o, "body")[0], !i) return [];
          var s = Cr(o, la, "frameRate"), u = Cr(o, la, "subFrameRate"), a = Cr(o, la, "frameRateMultiplier"), l = Cr(o, la, "tickRate"), c = Cr(o, la, "cellResolution"), d = o.attributes["xml:space"] || "default", h = Cr(o, $c, "extent");
          if (d != "default" && d != "preserve") throw new b(2, 2, 2005, "Invalid xml:space value: " + d);
          d = d == "default", s = new T4(s, u, a, l), c = w4(c), u = wr(o, "metadata")[0], u = (u ? u.children : []).filter(function(w) {
            return w != `
`;
          }), a = wr(o, "style"), o = wr(o, "region"), l = [];
          for (var p = m(o), g = p.next(); !g.done; g = p.next()) (g = m4(this, g.value, a, h)) && l.push(g);
          if (We(i, "p").length) throw new b(2, 2, 2001, "<p> can only be inside <div> in TTML");
          for (h = m(We(i, "div")), p = h.next(); !p.done; p = h.next()) if (We(p.value, "span").length) throw new b(2, 2, 2001, "<span> can only be inside <p> in TTML");
          return (t = WT(this, i, t, s, u, a, o, l, d, c, null, !1, n, r)) && (t.backgroundColor || (t.backgroundColor = "transparent"), e.push(t)), e;
        };
        function WT(e, t, n, r, i, o, s, u, a, l, c, d, h, p) {
          var g = c;
          if (Da(t)) {
            if (!d) return null;
            var w = { tagName: "span", children: [wt(t)], attributes: {}, parent: null };
          } else w = t;
          for (var T = null, E = m(tS), A = E.next(); !A.done && !(T = Yc(w, "backgroundImage", i, "#", A.value)[0]); A = E.next()) ;
          E = null, A = Cr(w, tS, "backgroundImage");
          var I = /^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;
          if (A && I.test(A)) {
            if (E = parseInt(A.split(":").pop(), 10) - 1, E >= p.length) return null;
            E = p[E];
          } else h && A && !A.startsWith("#") && (I = new yt(h), A = new yt(A), (A = I.resolve(A).toString()) && (E = A));
          if ((t.tagName == "p" || T || E) && (d = !0), t = d, A = (w.attributes["xml:space"] || (a ? "default" : "preserve")) == "default", I = w.children.every(Da), a = [], !I) for (var P = m(w.children), N = P.next(); !N.done; N = P.next()) (N = WT(e, N.value, n, r, i, o, s, u, A, l, w, d, h, p)) && a.push(N);
          if (i = c != null, h = wt(w), h = w.children.length && h && /\S/.test(h), P = w.attributes.begin || w.attributes.end || w.attributes.dur, !(P || h || w.tagName == "br" || a.length != 0 || i && !A)) return null;
          for (p = qT(w, r), h = p.start, p = p.end; g && g.tagName && g.tagName != "tt"; ) p = y4(g, r, h, p), h = p.start, p = p.end, g = g.parent;
          if (h == null && (h = 0), h += n.periodStart, p = p == null ? 1 / 0 : p + n.periodStart, e.g !== "HLS" && (h = Math.max(h, n.segmentStart), p = Math.min(p, n.segmentEnd)), !P && a.length > 0) for (h = 1 / 0, p = 0, n = m(a), r = n.next(); !r.done; r = n.next()) r = r.value, h = Math.min(h, r.startTime), p = Math.max(p, r.endTime);
          if (w.tagName == "br") return e = new ot(h, p, ""), e.lineBreak = !0, e;
          if (n = "", I && (n = en(wt(w) || ""), A && (n = n.replace(/\s+/g, " "))), n = new ot(h, p, n), n.nestedCues = a, d || (n.isContainer = !0), l && (n.cellResolution = l), l = Yc(
            w,
            "region",
            s,
            ""
          )[0], w.attributes.region && l && l.attributes["xml:id"]) {
            var M = l.attributes["xml:id"];
            n.region = u.filter(function(R) {
              return R.id == M;
            })[0];
          }
          return u = l, c && i && !w.attributes.region && !w.attributes.style && (u = Yc(c, "region", s, "")[0]), v4(e, n, w, u, T, E, o, t, a.length == 0), n;
        }
        function m4(e, t, n, r) {
          var i = new zi(), o = t.attributes["xml:id"];
          if (!o) return null;
          i.id = o, o = null, r && (o = eg.exec(r) || tg.exec(r)), r = o ? Number(o[1]) : null, o = o ? Number(o[2]) : null;
          var s, u = qc(e, t, n, "extent");
          if (u) {
            var a = (s = eg.exec(u)) || tg.exec(u);
            a != null && (i.width = Number(a[1]), i.height = Number(a[2]), s || (r != null && (i.width = i.width * 100 / r), o != null && (i.height = i.height * 100 / o)), i.widthUnits = s || r != null ? Sn : 0, i.heightUnits = s || o != null ? Sn : 0);
          }
          return (e = qc(e, t, n, "origin")) && (a = (s = eg.exec(e)) || tg.exec(e), a != null && (i.viewportAnchorX = Number(a[1]), i.viewportAnchorY = Number(a[2]), s ? u || (i.width = 100 - i.viewportAnchorX, i.widthUnits = Sn, i.height = 100 - i.viewportAnchorY, i.heightUnits = Sn) : (o != null && (i.viewportAnchorY = i.viewportAnchorY * 100 / o), r != null && (i.viewportAnchorX = i.viewportAnchorX * 100 / r)), i.viewportAnchorUnits = s || r != null ? Sn : 0)), i;
        }
        function $p(e) {
          var t = e.match(/rgba\(([^)]+)\)/);
          return t && (t = t[1].split(","), t.length == 4) ? (t[3] = String(Number(t[3]) / 255), "rgba(" + t.join(",") + ")") : e;
        }
        function v4(e, t, n, r, i, o, s, u, a) {
          if (u = u || a, Jt(e, n, r, s, "direction", u) == "rtl" && (t.direction = "rtl"), a = Jt(e, n, r, s, "writingMode", u), a == "tb" || a == "tblr" ? t.writingMode = "vertical-lr" : a == "tbrl" ? t.writingMode = "vertical-rl" : a == "rltb" || a == "rl" ? t.direction = "rtl" : a && (t.direction = $s), (a = Jt(e, n, r, s, "textAlign", !0)) ? (t.positionAlign = A4.get(a), t.lineAlign = x4.get(a), t.textAlign = Ld[a.toUpperCase()]) : t.textAlign = Dr, (a = Jt(e, n, r, s, "displayAlign", !0)) && (t.displayAlign = Yg[a.toUpperCase()]), (a = Jt(e, n, r, s, "color", u)) && (t.color = $p(a)), (a = Jt(e, n, r, s, "backgroundColor", u)) && (t.backgroundColor = $p(a)), (a = Jt(e, n, r, s, "border", u)) && (t.border = a), a = Jt(e, n, r, s, "fontFamily", u)) switch (a) {
            case "monospaceSerif":
              t.fontFamily = "Courier New,Liberation Mono,Courier,monospace";
              break;
            case "proportionalSansSerif":
              t.fontFamily = "Arial,Helvetica,Liberation Sans,sans-serif";
              break;
            case "sansSerif":
              t.fontFamily = "sans-serif";
              break;
            case "monospaceSansSerif":
              t.fontFamily = "Consolas,monospace";
              break;
            case "proportionalSerif":
              t.fontFamily = "serif";
              break;
            default:
              t.fontFamily = a.split(",").filter(function(l) {
                return l != "default";
              }).join(",");
          }
          switch ((a = Jt(e, n, r, s, "fontWeight", u)) && a == "bold" && (t.fontWeight = Oo), a = Jt(e, n, r, s, "wrapOption", u), t.wrapLine = !(a && a == "noWrap"), (a = Jt(e, n, r, s, "lineHeight", u)) && a.match(Es) && (t.lineHeight = a), (a = Jt(e, n, r, s, "fontSize", u)) && (a.match(Es) || a.match(S4)) && (t.fontSize = a), (a = Jt(e, n, r, s, "fontStyle", u)) && (t.fontStyle = Zg[a.toUpperCase()]), i ? (o = i.attributes.imageType || i.attributes.imagetype, a = i.attributes.encoding, i = wt(i).trim(), o == "PNG" && a == "Base64" && i && (t.backgroundImage = "data:image/png;base64," + i)) : o && (t.backgroundImage = o), (i = Jt(e, n, r, s, "textOutline", u)) && (i = i.split(" "), i[0].match(Es) ? t.textStrokeColor = t.color : (t.textStrokeColor = $p(i[0]), i.shift()), i[0] && i[0].match(Es) ? t.textStrokeWidth = i[0] : t.textStrokeColor = ""), (i = Jt(e, n, r, s, "letterSpacing", u)) && i.match(Es) && (t.letterSpacing = i), (i = Jt(e, n, r, s, "linePadding", u)) && i.match(Es) && (t.linePadding = i), (i = Jt(e, n, r, s, "opacity", u)) && (t.opacity = parseFloat(i)), (i = qc(e, r, s, "textDecoration")) && zT(t, i), (i = Jp(
            e,
            n,
            s,
            "textDecoration"
          )) && zT(t, i), (i = Jt(e, n, r, s, "textCombine", u)) && (t.textCombineUpright = i), Jt(e, n, r, s, "ruby", u)) {
            case "container":
              t.rubyTag = "ruby";
              break;
            case "text":
              t.rubyTag = "rt";
          }
        }
        function zT(e, t) {
          t = m(t.split(" "));
          for (var n = t.next(); !n.done; n = t.next()) switch (n.value) {
            case "underline":
              e.textDecoration.includes(Hr) || e.textDecoration.push(Hr);
              break;
            case "noUnderline":
              e.textDecoration.includes(Hr) && Gn(e.textDecoration, Hr);
              break;
            case "lineThrough":
              e.textDecoration.includes("lineThrough") || e.textDecoration.push("lineThrough");
              break;
            case "noLineThrough":
              e.textDecoration.includes("lineThrough") && Gn(e.textDecoration, "lineThrough");
              break;
            case "overline":
              e.textDecoration.includes("overline") || e.textDecoration.push("overline");
              break;
            case "noOverline":
              e.textDecoration.includes("overline") && Gn(e.textDecoration, "overline");
          }
        }
        function Jt(e, t, n, r, i, o) {
          return o = o === void 0 ? !0 : o, (t = Jp(e, t, r, i)) ? t : o ? qc(e, n, r, i) : null;
        }
        function qc(e, t, n, r) {
          if (!t) return null;
          var i = Cr(t, $c, r);
          return i || XT(e, t, n, r);
        }
        function Jp(e, t, n, r) {
          var i = Cr(t, $c, r);
          return i || XT(e, t, n, r);
        }
        function XT(e, t, n, r) {
          t = Yc(t, "style", n, "");
          for (var i = null, o = 0; o < t.length; o++) {
            var s = Fr(t[o], "urn:ebu:tt:style", r);
            s || (s = Cr(t[o], $c, r)), s || (s = Jp(e, t[o], n, r)), s && (i = s);
          }
          return i;
        }
        function Yc(e, t, n, r, i) {
          var o = [];
          if (!e || n.length < 1) return o;
          var s = e;
          for (e = null; !e && !(e = i ? Fr(s, i, t) : s.attributes[t]) && (s = s.parent, s); ) ;
          if (t = e) {
            for (t = m(t.split(" ")), i = t.next(); !i.done; i = t.next()) for (i = i.value, e = m(n), s = e.next(); !s.done; s = e.next()) if (s = s.value, r + s.attributes["xml:id"] == i) {
              o.push(s);
              break;
            }
          }
          return o;
        }
        function y4(e, t, n, r) {
          return e = qT(e, t), n == null ? n = e.start : e.start != null && (n += e.start), r == null ? r = e.end : e.start != null && (r += e.start), { start: n, end: r };
        }
        function qT(e, t) {
          var n = Qp(e.attributes.begin, t), r = Qp(e.attributes.end, t);
          return e = Qp(e.attributes.dur, t), r == null && e != null && (r = n + e), { start: n, end: r };
        }
        function Qp(e, t) {
          var n = null;
          if (YT.test(e)) {
            e = YT.exec(e), n = Number(e[1]);
            var r = Number(e[2]), i = Number(e[3]), o = Number(e[4]);
            o += (Number(e[5]) || 0) / t.h, i += o / t.frameRate, n = i + r * 60 + n * 3600;
          } else if ($T.test(e)) n = Zp($T, e);
          else if (JT.test(e)) n = Zp(JT, e);
          else if (QT.test(e)) e = QT.exec(e), n = Number(e[1]) / t.frameRate;
          else if (ZT.test(e)) e = ZT.exec(e), n = Number(e[1]) / t.g;
          else if (eS.test(e)) n = Zp(eS, e);
          else if (e) throw new b(2, 2, 2001, "Could not parse cue time range in TTML");
          return n;
        }
        function Zp(e, t) {
          return e = e.exec(t), e == null || e[0] == "" ? null : (Number(e[4]) || 0) / 1e3 + (Number(e[3]) || 0) + (Number(e[2]) || 0) * 60 + (Number(e[1]) || 0) * 3600;
        }
        function w4(e) {
          return e && (e = /^(\d+) (\d+)$/.exec(e)) ? { columns: parseInt(e[1], 10), rows: parseInt(e[2], 10) } : null;
        }
        Y("shaka.text.TtmlTextParser", kn), kn.prototype.parseMedia = kn.prototype.parseMedia, kn.prototype.setManifestType = kn.prototype.setManifestType, kn.prototype.setSequenceMode = kn.prototype.setSequenceMode, kn.prototype.parseInit = kn.prototype.parseInit;
        function T4(e, t, n, r) {
          this.frameRate = Number(e) || 30, this.h = Number(t) || 1, this.g = Number(r), this.g == 0 && (this.g = e ? this.frameRate * this.h : 1), n && (e = /^(\d+) (\d+)$/g.exec(n)) && (this.frameRate *= Number(e[1]) / Number(e[2]));
        }
        var eg = /^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/, S4 = /^(\d{1,4}(?:\.\d+)?|100)%$/, Es = /^(\d+px|\d+em|\d*\.?\d+c)$/, tg = /^(\d+)px (\d+)px$/, YT = /^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/, $T = /^(?:(\d{2,}):)?(\d{2}):(\d{2})$/, JT = /^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/, QT = /^(\d*(?:\.\d*)?)f$/, ZT = /^(\d*(?:\.\d*)?)t$/, eS = RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"), x4 = (/* @__PURE__ */ new Map()).set("left", $i).set("center", "center").set(
          "right",
          "end"
        ).set("start", $i).set("end", "end"), A4 = (/* @__PURE__ */ new Map()).set("left", "line-left").set("center", "center").set("right", "line-right").set("start", "line-left").set("end", "line-right"), la = ["http://www.w3.org/ns/ttml#parameter", "http://www.w3.org/2006/10/ttaf1#parameter"], $c = ["http://www.w3.org/ns/ttml#styling", "http://www.w3.org/2006/10/ttaf1#styling"], tS = ["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt", "http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];
        Bt("application/ttml+xml", function() {
          return new kn();
        });
        function Rt() {
          this.g = new kn();
        }
        Rt.prototype.parseInit = function(e) {
          var t = !1;
          if (new qe().box("moov", Te).box("trak", Te).box("mdia", Te).box("minf", Te).box("stbl", Te).S("stsd", qr).box("stpp", function(n) {
            t = !0, n.parser.stop();
          }).parse(e), !t) throw new b(2, 2, 2007);
        }, Rt.prototype.setSequenceMode = function(e) {
          this.g.setSequenceMode(e);
        }, Rt.prototype.setManifestType = function(e) {
          this.g.setManifestType(e);
        }, Rt.prototype.parseMedia = function(e, t, n) {
          var r = [], i = null, o = [], s = /* @__PURE__ */ new Map(), u = [];
          if (new qe().box("moof", Te).box("traf", Te).S("tfhd", function(E) {
            i = nl(E.reader, E.flags).Xd;
          }).S("trun", function(E) {
            E = ol(E.reader, E.version, E.flags), E = m(E.jh);
            for (var A = E.next(); !A.done; A = E.next()) u.push(A.value.sampleSize || i || 0);
          }).S("subs", function(E) {
            for (var A = E.reader, I = A.V(), P = -1, N = 0; N < I; N++) {
              var M = A.V();
              P += M, M = A.Ca();
              for (var R = [], k = 0; k < M; k++) E.version == 1 ? R.push(A.V()) : R.push(A.Ca()), A.Z(), A.Z(), A.V();
              s.set(P, R);
            }
          }).box(
            "mdat",
            Ko(function(E) {
              o.push(E);
            }, !1)
          ).parse(e, !1), o.length == 0) throw new b(2, 2, 2007);
          e = St.apply(Gt, X(o));
          for (var a = 0, l = 0; l < u.length; l++) {
            var c = pe(e, a, u[l]);
            a += u[l];
            var d = s.get(l);
            if (d && d.length) {
              for (var h = pe(c, 0, d[0]), p = [], g = d[0], w = 1; w < d.length; w++) {
                var T = pe(c, g, d[w]);
                T = Ma(T), p.push("data:image/png;base64," + T), g += d[w];
              }
              r = r.concat(this.g.parseMedia(h, t, n, p));
            } else r = r.concat(this.g.parseMedia(c, t, n, []));
          }
          return r;
        }, Y("shaka.text.Mp4TtmlParser", Rt), Rt.prototype.parseMedia = Rt.prototype.parseMedia, Rt.prototype.setManifestType = Rt.prototype.setManifestType, Rt.prototype.setSequenceMode = Rt.prototype.setSequenceMode, Rt.prototype.parseInit = Rt.prototype.parseInit, Bt('application/mp4; codecs="stpp"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.ttml"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.ttml.im1i"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.ttml.im1t"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.ttml.im2i"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.ttml.im2t"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.ttml.etd1"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.ttml.etd1|im1t"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.ttml.im1t|etd1"', function() {
          return new Rt();
        }), Bt('application/mp4; codecs="stpp.TTML.im1t"', function() {
          return new Rt();
        });
        function on() {
          this.g = "UNKNOWN";
        }
        on.prototype.parseInit = function() {
        }, on.prototype.setSequenceMode = function() {
        }, on.prototype.setManifestType = function(e) {
          this.g = e;
        }, on.prototype.parseMedia = function(e, t) {
          e = dt(e), e = e.replace(/\r\n|\r(?=[^\n]|$)/gm, `
`);
          var n = e.split(/\n{2,}/m);
          if (!/^WEBVTT($|[ \t\n])/m.test(n[0])) throw new b(2, 2, 2e3);
          if (e = t.vttOffset, this.g == "HLS" && n[0].includes("X-TIMESTAMP-MAP")) {
            var r = n[0];
            if (e = r.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m), r = r.match(/MPEGTS:(\d+)/m), !e || !r) throw new b(2, 2, 2e3);
            if (e = No(e[1]), e == null) throw new b(2, 2, 2e3);
            r = Number(r[1]);
            for (var i = t.segmentStart - t.periodStart; i >= 95443.7176888889; ) i -= 95443.7176888889, r += 8589934592;
            e = t.periodStart + r / 9e4 - e;
          }
          for (t = [], r = m(n[0].split(`
`)), i = r.next(); !i.done; i = r.next()) if (i = i.value, /^Region:/.test(i)) {
            i = new Lo(i);
            var o = new zi();
            Xi(i), bo(i);
            for (var s = Xi(i); s; ) {
              var u = o, a = s;
              (s = /^id=(.*)$/.exec(a)) ? u.id = s[1] : (s = /^width=(\d{1,2}|100)%$/.exec(a)) ? u.width = Number(s[1]) : (s = /^lines=(\d+)$/.exec(a)) ? (u.height = Number(s[1]), u.heightUnits = 2) : (s = /^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(a)) ? (u.regionAnchorX = Number(s[1]), u.regionAnchorY = Number(s[2])) : (s = /^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(a)) ? (u.viewportAnchorX = Number(s[1]), u.viewportAnchorY = Number(s[2])) : /^scroll=up$/.exec(a) && (u.scroll = "up"), bo(i), s = Xi(i);
            }
            t.push(o);
          }
          for (r = /* @__PURE__ */ new Map(), Xg(r), i = [], n = m(n.slice(1)), o = n.next(); !o.done; o = n.next()) {
            if (o = o.value.split(`
`), (o.length != 1 || o[0]) && !/^NOTE($|[ \t])/.test(o[0]) && o[0] == "STYLE") {
              for (u = [], s = -1, a = 1; a < o.length; a++) o[a].includes("::cue") && (u.push([]), s = u.length - 1), s != -1 && (u[s].push(o[a]), o[a].includes("}") && (s = -1));
              for (u = m(u), s = u.next(); !s.done; s = u.next()) {
                var l = s.value;
                s = "global", (a = l[0].match(/\((.*)\)/)) && (s = a.pop()), a = l.slice(1, -1), l[0].includes("}") && (l = /\{(.*?)\}/.exec(l[0])) && (a = l[1].split(";")), (l = r.get(s)) || (l = new ot(0, 0, ""));
                for (var c = !1, d = 0; d < a.length; d++) {
                  var h = /^\s*([^:]+):\s*(.*)/.exec(a[d]);
                  if (h) {
                    var p = h[2].trim().replace(";", "");
                    switch (h[1].trim()) {
                      case "background-color":
                      case "background":
                        c = !0, l.backgroundColor = p;
                        break;
                      case "color":
                        c = !0, l.color = p;
                        break;
                      case "font-family":
                        c = !0, l.fontFamily = p;
                        break;
                      case "font-size":
                        c = !0, l.fontSize = p;
                        break;
                      case "font-weight":
                        (parseInt(p, 10) >= 700 || p == "bold") && (c = !0, l.fontWeight = Oo);
                        break;
                      case "font-style":
                        switch (p) {
                          case "normal":
                            c = !0, l.fontStyle = Nd;
                            break;
                          case "italic":
                            c = !0, l.fontStyle = jo;
                            break;
                          case "oblique":
                            c = !0, l.fontStyle = "oblique";
                        }
                        break;
                      case "opacity":
                        c = !0, l.opacity = parseFloat(p);
                        break;
                      case "text-combine-upright":
                        c = !0, l.textCombineUpright = p;
                        break;
                      case "text-shadow":
                        c = !0, l.textShadow = p;
                        break;
                      case "white-space":
                        c = !0, l.wrapLine = p != "noWrap";
                    }
                  }
                }
                c && r.set(s, l);
              }
            }
            if (l = o, c = e, l.length == 1 && !l[0] || /^NOTE($|[ \t])/.test(l[0]) || l[0] == "STYLE" || l[0] == "REGION") o = null;
            else if (o = null, l[0].includes("-->") || (o = l[0], l.splice(0, 1)), u = new Lo(l[0]), s = zs(u), d = pi(u, /[ \t]+--\x3e[ \t]+/g), a = zs(u), s == null || d == null || a == null) De("Failed to parse VTT time code. Cue skipped:", o, l), o = null;
            else {
              for (s += c, a += c, s < 0 && (s = 0), c = l.slice(1).join(`
`).trim(), r.has("global") ? (l = r.get("global").clone(), l.startTime = s, l.endTime = a, l.payload = c) : l = new ot(s, a, c), bo(u), s = Xi(u); s; ) nS(l, s, t), bo(u), s = Xi(u);
              ja(l, r), o != null && (l.id = o), o = l;
            }
            o && i.push(o);
          }
          return i;
        };
        function nS(e, t, n) {
          var r;
          (r = /^align:(start|middle|center|end|left|right)$/.exec(t)) ? (t = r[1], t == "middle" ? e.textAlign = Dr : e.textAlign = Ld[t.toUpperCase()]) : (r = /^vertical:(lr|rl)$/.exec(t)) ? e.writingMode = r[1] == "lr" ? "vertical-lr" : "vertical-rl" : (r = /^size:([\d.]+)%$/.exec(t)) ? e.size = Number(r[1]) : (r = /^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/.exec(t)) ? (e.position = Number(r[1]), r[2] && (t = r[2], e.positionAlign = t == "line-left" || t == "start" ? "line-left" : t == "line-right" || t == "end" ? "line-right" : t == "center" || t == "middle" ? "center" : Ua)) : (r = /^region:(.*)$/.exec(t)) ? (t = E4(n, r[1])) && (e.region = t) : (n = /^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t)) ? (e.lineInterpretation = 1, e.line = Number(n[1]), n[2] && (e.lineAlign = bd[n[2].toUpperCase()])) : (n = /^line:(-?\d+)(?:,(start|end|center))?$/.exec(t)) && (e.lineInterpretation = Js, e.line = Number(n[1]), n[2] && (e.lineAlign = bd[n[2].toUpperCase()]));
        }
        function E4(e, t) {
          return e = e.filter(function(n) {
            return n.id == t;
          }), e.length ? e[0] : null;
        }
        Y("shaka.text.VttTextParser", on), on.prototype.parseMedia = on.prototype.parseMedia, on.prototype.setManifestType = on.prototype.setManifestType, on.prototype.setSequenceMode = on.prototype.setSequenceMode, on.prototype.parseInit = on.prototype.parseInit, Bt("text/vtt", function() {
          return new on();
        }), Bt('text/vtt; codecs="vtt"', function() {
          return new on();
        }), Bt('text/vtt; codecs="wvtt"', function() {
          return new on();
        });
        function jn() {
          this.g = null;
        }
        jn.prototype.parseInit = function(e) {
          var t = this, n = !1;
          if (new qe().box("moov", Te).box("trak", Te).box("mdia", Te).S("mdhd", function(r) {
            r = il(r.reader, r.version), t.g = r.timescale;
          }).box("minf", Te).box("stbl", Te).S("stsd", qr).box("wvtt", function() {
            n = !0;
          }).parse(e), !this.g) throw new b(2, 2, 2008);
          if (!n) throw new b(2, 2, 2008);
        }, jn.prototype.setSequenceMode = function() {
        }, jn.prototype.setManifestType = function() {
        }, jn.prototype.parseMedia = function(e, t) {
          if (!e.length) return [];
          if (!this.g) throw new b(2, 2, 2008);
          var n = 0, r = [], i, o = [], s = !1, u = !1, a = !1, l = null;
          if (new qe().box("moof", Te).box("traf", Te).S("tfdt", function(I) {
            s = !0, n = rl(I.reader, I.version).baseMediaDecodeTime;
          }).S("tfhd", function(I) {
            l = nl(I.reader, I.flags).Wd;
          }).S("trun", function(I) {
            u = !0, r = ol(I.reader, I.version, I.flags).jh;
          }).box("mdat", Ko(function(I) {
            a = !0, i = I;
          }, !1)).parse(e, !1), !a && !s && !u) throw new b(2, 2, 2008);
          e = n;
          for (var c = new st(i, 0), d = m(r), h = d.next(); !h.done; h = d.next()) {
            h = h.value;
            var p = h.kh || l, g = h.Df ? n + h.Df : e;
            e = g + (p || 0);
            var w = 0;
            do {
              var T = c.V();
              w += T;
              var E = c.V(), A = null;
              Za(E) == "vttc" ? T > 8 && (A = c.Tb(T - 8, !1)) : c.skip(T - 8), p && A && (T = I4(A, t.periodStart + g / this.g, t.periodStart + e / this.g), o.push(T));
            } while (h.sampleSize && w < h.sampleSize);
          }
          return o.filter(wi);
        };
        function I4(e, t, n) {
          var r, i, o;
          return new qe().box("payl", Ko(function(s) {
            r = dt(s);
          }, !1)).box("iden", Ko(function(s) {
            i = dt(s);
          }, !1)).box("sttg", Ko(function(s) {
            o = dt(s);
          }, !1)).parse(e), r ? M4(r, i, o, t, n) : null;
        }
        function M4(e, t, n, r, i) {
          if (e = new ot(r, i, e), ja(e), t && (e.id = t), n) for (t = new Lo(n), n = Xi(t); n; ) nS(e, n, []), bo(t), n = Xi(t);
          return e;
        }
        Y("shaka.text.Mp4VttParser", jn), jn.prototype.parseMedia = jn.prototype.parseMedia, jn.prototype.setManifestType = jn.prototype.setManifestType, jn.prototype.setSequenceMode = jn.prototype.setSequenceMode, jn.prototype.parseInit = jn.prototype.parseInit, Bt('application/mp4; codecs="wvtt"', function() {
          return new jn();
        });
        function Un() {
        }
        Un.prototype.parseInit = function() {
        }, Un.prototype.setSequenceMode = function() {
        }, Un.prototype.setManifestType = function() {
        }, Un.prototype.parseMedia = function(e) {
          var t = dt(e).replace(/\r+/g, "");
          if (t = t.trim(), e = [], t == "") return e;
          t = m(t.split(`

`));
          for (var n = t.next(); !n.done; n = t.next()) {
            n = n.value.split(`
`);
            var r = new Lo(n[0]), i = zs(r), o = pi(r, /,/g);
            if (r = zs(r), i == null || o == null || r == null) throw new b(2, 2, 2001, "Could not parse cue time range in SubViewer");
            e.push(new ot(i, r, n.slice(1).join(`
`).trim()));
          }
          return e;
        }, Y("shaka.text.SbvTextParser", Un), Un.prototype.parseMedia = Un.prototype.parseMedia, Un.prototype.setManifestType = Un.prototype.setManifestType, Un.prototype.setSequenceMode = Un.prototype.setSequenceMode, Un.prototype.parseInit = Un.prototype.parseInit, Bt("text/x-subviewer", function() {
          return new Un();
        });
        function _n() {
          this.g = new on();
        }
        _n.prototype.parseInit = function() {
        }, _n.prototype.setSequenceMode = function() {
        }, _n.prototype.setManifestType = function() {
        }, _n.prototype.parseMedia = function(e, t, n) {
          var r = dt(e);
          if (e = `WEBVTT

`, r != "") {
            r = r.replace(/\r+/g, ""), r = r.trim(), r = m(r.split(`

`));
            for (var i = r.next(); !i.done; i = r.next()) i = i.value.split(/\n/), i[0].match(/\d+/) && i.shift(), i[0] = i[0].replace(/,/g, "."), e += i.join(`
`).replace(/{b}/g, "<b>").replace(/{\/b}/g, "</b>").replace(/{i}/g, "<i>").replace(/{\/i}/g, "</i>").replace(/{u}/g, "<u>").replace(/{\/u}/g, "</u>") + `

`;
          }
          return e = pe(sr(e)), this.g.parseMedia(e, t, n, []);
        }, Y("shaka.text.SrtTextParser", _n), _n.prototype.parseMedia = _n.prototype.parseMedia, _n.prototype.setManifestType = _n.prototype.setManifestType, _n.prototype.setSequenceMode = _n.prototype.setSequenceMode, _n.prototype.parseInit = _n.prototype.parseInit, Bt("text/srt", function() {
          return new _n();
        });
        function Bn() {
        }
        Bn.prototype.parseInit = function() {
        }, Bn.prototype.setSequenceMode = function() {
        }, Bn.prototype.setManifestType = function() {
        }, Bn.prototype.parseMedia = function(e) {
          var t = "", n = "", r = null, i = null;
          for (i = dt(e).split(/\r?\n\s*\r?\n/), e = m(i), i = e.next(); !i.done; i = e.next()) {
            var o = i.value;
            i = o, (o = k4.exec(o)) && (r = o[1], i = o[2]), r == "V4 Styles" || r == "V4+ Styles" ? (t = i, t = n ? t + (`
` + i) : i) : r == "Events" && (n = n ? n + (`
` + i) : i);
          }
          for (r = [], i = null, t = m(t.split(/\r?\n/)), e = t.next(); !e.done; e = t.next()) if (e = e.value, !/^\s*;/.test(e) && (o = oS.exec(e))) {
            if (e = o[1].trim(), o = o[2].trim(), e == "Format") i = o.split(Jc);
            else if (e == "Style") {
              e = o.split(Jc), o = {};
              for (var s = 0; s < i.length && s < e.length; s++) o[i[s]] = e[s];
              r.push(o);
            }
          }
          for (i = [], t = null, n = m(n.split(/\r?\n/)), o = n.next(), e = {}; !o.done; e = { Yi: void 0 }, o = n.next()) if (o = o.value, !/^\s*;/.test(o) && (s = oS.exec(o))) {
            if (o = s[1].trim(), s = s[2].trim(), o == "Format") t = s.split(Jc);
            else if (o == "Dialogue") {
              s = s.split(Jc), o = {};
              for (var u = 0; u < t.length && u < s.length; u++) o[t[u]] = s[u];
              u = iS(o.Start);
              var a = iS(o.End);
              s = new ot(u, a, s.slice(t.length - 1).join(",").replace(/\\N/g, `
`).replace(/\{[^}]+\}/g, "")), e.Yi = o.Style, (e = r.find(/* @__PURE__ */ (function(l) {
                return function(c) {
                  return c.Name == l.Yi;
                };
              })(e))) && C4(s, e), i.push(s);
            }
          }
          return i;
        };
        function C4(e, t) {
          var n = t.Fontname;
          if (n && (e.fontFamily = n), (n = t.Fontsize) && (e.fontSize = n + "px"), (n = t.PrimaryColour) && (n = rS(n)) && (e.color = n), (n = t.BackColour) && (n = rS(n)) && (e.backgroundColor = n), t.Bold && (e.fontWeight = Oo), t.Italic && (e.fontStyle = jo), t.Underline && e.textDecoration.push(Hr), (n = t.Spacing) && (e.letterSpacing = n + "px"), n = t.Alignment) switch (parseInt(n, 10)) {
            case 1:
              e.displayAlign = Ys, e.textAlign = "start";
              break;
            case 2:
              e.displayAlign = Ys, e.textAlign = Dr;
              break;
            case 3:
              e.displayAlign = Ys, e.textAlign = "end";
              break;
            case 5:
              e.displayAlign = "before", e.textAlign = "start";
              break;
            case 6:
              e.displayAlign = "before", e.textAlign = Dr;
              break;
            case 7:
              e.displayAlign = "before", e.textAlign = "end";
              break;
            case 9:
              e.displayAlign = "center", e.textAlign = "start";
              break;
            case 10:
              e.displayAlign = "center", e.textAlign = Dr;
              break;
            case 11:
              e.displayAlign = "center", e.textAlign = "end";
          }
          (t = t.AlphaLevel) && (e.opacity = parseFloat(t));
        }
        function rS(e) {
          return e = parseInt(e.replace("&H", ""), 16), e >= 0 ? "rgba(" + (e & 255) + "," + (e >> 8 & 255) + "," + (e >> 16 & 255) + "," + (e >> 24 & 255 ^ 255) / 255 + ")" : null;
        }
        function iS(e) {
          return e = P4.exec(e), (e[1] ? parseInt(e[1].replace(":", ""), 10) : 0) * 3600 + parseInt(e[2], 10) * 60 + parseFloat(e[3]);
        }
        Y("shaka.text.SsaTextParser", Bn), Bn.prototype.parseMedia = Bn.prototype.parseMedia, Bn.prototype.setManifestType = Bn.prototype.setManifestType, Bn.prototype.setSequenceMode = Bn.prototype.setSequenceMode, Bn.prototype.parseInit = Bn.prototype.parseInit;
        var k4 = /^\s*\[([^\]]+)\]\r?\n([\s\S]*)/, oS = /^\s*([^:]+):\s*(.*)/, Jc = /\s*,\s*/, P4 = /^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;
        Bt("text/x-ssa", function() {
          return new Bn();
        });
        function sS(e, t) {
          var n = e[t + 1] & 1 ? 7 : 9;
          return t + n <= e.length && (e = ((e[t + 3] & 3) << 11 | e[t + 4] << 3 | (e[t + 5] & 224) >>> 5) - n, e > 0) ? { ce: n, ra: e } : null;
        }
        function uS(e, t) {
          var n = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350], r = (e[t + 2] & 60) >>> 2;
          if (r > n.length - 1) return null;
          var i = ((e[t + 2] & 192) >>> 6) + 1, o = (e[t + 2] & 1) << 2;
          return o |= (e[t + 3] & 192) >>> 6, { sampleRate: n[r], channelCount: o, codec: "mp4a.40." + i };
        }
        function aS(e, t) {
          if (t + 1 < e.length && e[t] === 255 && (e[t + 1] & 246) === 240) {
            var n = e[t + 1] & 1 ? 7 : 9;
            if (t + n >= e.length) return !1;
            var r = (e[t + 3] & 3) << 11 | e[t + 4] << 3 | (e[t + 5] & 224) >>> 5;
            return r <= n ? !1 : (t += r, t === e.length || t + 1 < e.length && e[t] === 255 && (e[t + 1] & 246) === 240);
          }
          return !1;
        }
        function D4(e, t) {
          switch (e) {
            case "mp4a.40.2":
              if (t === 1) return new Uint8Array([0, 200, 0, 128, 35, 128]);
              if (t === 2) return new Uint8Array([33, 0, 73, 144, 2, 25, 0, 35, 128]);
              if (t === 3) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 142]);
              if (t === 4) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 128, 44, 128, 8, 2, 56]);
              if (t === 5) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 56]);
              if (t === 6) return new Uint8Array([
                0,
                200,
                0,
                128,
                32,
                132,
                1,
                38,
                64,
                8,
                100,
                0,
                130,
                48,
                4,
                153,
                0,
                33,
                144,
                2,
                0,
                178,
                0,
                32,
                8,
                224
              ]);
              break;
            default:
              if (t === 1) return new Uint8Array([1, 64, 34, 128, 163, 78, 230, 128, 186, 8, 0, 0, 0, 28, 6, 241, 193, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
              if (t === 2 || t === 3) return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
          }
          return null;
        }
        function Fn(e) {
          this.j = e, this.h = 0, this.g = /* @__PURE__ */ new Map(), this.i = null;
        }
        f = Fn.prototype, f.destroy = function() {
          this.g.clear();
        }, f.isSupported = function(e) {
          return e.toLowerCase().split(";")[0] == "audio/aac" ? Qt(this.convertCodecs("audio", e)) : !1;
        }, f.convertCodecs = function(e, t) {
          return t.toLowerCase().split(";")[0] == "audio/aac" ? 'audio/mp4; codecs="' + (hn(t) || "mp4a.40.2") + '"' : t;
        }, f.getOriginalMimeType = function() {
          return this.j;
        }, f.transmux = function(e, t, n, r) {
          for (var i = pe(e), o = qo(i), s = o.length; s < i.length && !aS(i, s); s++) ;
          if (e = n.endTime * 1e3, o = so(o), o.length && n && (o = o.find(function(c) {
            return c.description === "com.apple.streaming.transportStreamTimestamp";
          })) && (e = o.data), o = uS(i, s), !o) return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
          t.audioSamplingRate = o.sampleRate, t.channelsCount = o.channelCount;
          for (var u = []; s < i.length; ) {
            var a = sS(i, s);
            if (!a) return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
            var l = a.ce + a.ra;
            s + l <= i.length && u.push({ data: i.subarray(s + a.ce, s + l), size: a.ra, duration: 1024, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), s += l;
          }
          return i = o.sampleRate, e = Math.floor(e * i / 1e3), r = { id: t.id, type: "audio", codecs: o.codec, timescale: i, duration: r, Db: [], Ga: new Uint8Array([]), Sa: new Uint8Array([]), Za: 0, $a: 0, data: { sequenceNumber: this.h, baseMediaDecodeTime: e, zb: u }, stream: t }, r = new Wo([r]), n = t.id + "_" + n.i, this.g.has(n) ? t = this.g.get(n) : (t = zo(r), this.g.set(n, t)), n = this.i !== t, r = du(r), this.i = t, this.h++, Promise.resolve({ data: r, init: n ? t : null });
        }, Y("shaka.transmuxer.AacTransmuxer", Fn), Fn.prototype.transmux = Fn.prototype.transmux, Fn.prototype.getOriginalMimeType = Fn.prototype.getOriginalMimeType, Fn.prototype.convertCodecs = Fn.prototype.convertCodecs, Fn.prototype.isSupported = Fn.prototype.isSupported, Fn.prototype.destroy = Fn.prototype.destroy, Gr("audio/aac", function() {
          return new Fn("audio/aac");
        }, vi);
        function lS(e, t) {
          if (t + 8 > e.length || e[t] !== 11 || e[t + 1] !== 119) return null;
          var n = e[t + 4] >> 6;
          if (n >= 3) return null;
          var r = e[t + 4] & 63, i = [
            64,
            69,
            96,
            64,
            70,
            96,
            80,
            87,
            120,
            80,
            88,
            120,
            96,
            104,
            144,
            96,
            105,
            144,
            112,
            121,
            168,
            112,
            122,
            168,
            128,
            139,
            192,
            128,
            140,
            192,
            160,
            174,
            240,
            160,
            175,
            240,
            192,
            208,
            288,
            192,
            209,
            288,
            224,
            243,
            336,
            224,
            244,
            336,
            256,
            278,
            384,
            256,
            279,
            384,
            320,
            348,
            480,
            320,
            349,
            480,
            384,
            417,
            576,
            384,
            418,
            576,
            448,
            487,
            672,
            448,
            488,
            672,
            512,
            557,
            768,
            512,
            558,
            768,
            640,
            696,
            960,
            640,
            697,
            960,
            768,
            835,
            1152,
            768,
            836,
            1152,
            896,
            975,
            1344,
            896,
            976,
            1344,
            1024,
            1114,
            1536,
            1024,
            1115,
            1536,
            1152,
            1253,
            1728,
            1152,
            1254,
            1728,
            1280,
            1393,
            1920,
            1280,
            1394,
            1920
          ][r * 3 + n] * 2;
          if (t + i > e.length) return null;
          var o = e[t + 6] >> 5, s = 0;
          o === 2 ? s += 2 : (o & 1 && o !== 1 && (s += 2), o & 4 && (s += 2)), s = (e[t + 6] << 8 | e[t + 7]) >> 12 - s & 1;
          var u = e[t + 5] & 7;
          return e = new Uint8Array([n << 6 | e[t + 5] >> 3 << 1 | u >> 2, (u & 3) << 6 | o << 3 | s << 2 | r >> 4, r << 4 & 224]), { sampleRate: [48e3, 44100, 32e3][n], channelCount: [2, 1, 2, 3, 3, 4, 4, 5][o] + s, Ga: e, ra: i };
        }
        function R4(e, t) {
          if (e[t] === 11 && e[t + 1] === 119) {
            var n = 0, r = 5;
            t += r;
            for (var i, o; r > 0; ) {
              o = e[t];
              var s = Math.min(r, 8), u = 8 - s;
              i = 4278190080 >>> 24 + u << u, i = (o & i) >> u, n = n ? n << s | i : i, t += 1, r -= s;
            }
            if (n < 16) return !0;
          }
          return !1;
        }
        function Zn(e) {
          this.j = e, this.h = 0, this.g = /* @__PURE__ */ new Map(), this.i = null;
        }
        f = Zn.prototype, f.destroy = function() {
          this.g.clear();
        }, f.isSupported = function(e) {
          return e.toLowerCase().split(";")[0] == "audio/ac3" ? Qt(this.convertCodecs("audio", e)) : !1;
        }, f.convertCodecs = function(e, t) {
          return t.toLowerCase().split(";")[0] == "audio/ac3" ? Se().re() ? 'audio/mp4; codecs="ec-3"' : 'audio/mp4; codecs="ac-3"' : t;
        }, f.getOriginalMimeType = function() {
          return this.j;
        }, f.transmux = function(e, t, n, r) {
          e = pe(e);
          for (var i = qo(e), o = i.length; o < e.length && !R4(e, o); o++) ;
          var s = n.endTime * 1e3;
          i = so(i), i.length && n && (i = i.find(function(c) {
            return c.description === "com.apple.streaming.transportStreamTimestamp";
          })) && (s = i.data), i = 0;
          for (var u = new Uint8Array([]), a = []; o < e.length; ) {
            var l = lS(e, o);
            if (!l) return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
            t.audioSamplingRate = l.sampleRate, t.channelsCount = l.channelCount, i = l.sampleRate, u = l.Ga, a.push({
              data: e.subarray(o, o + l.ra),
              size: l.ra,
              duration: 1536,
              sb: 0,
              flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 }
            }), o += l.ra;
          }
          return e = Math.floor(s * i / 1e3), r = { id: t.id, type: "audio", codecs: "ac-3", timescale: i, duration: r, Db: [], Ga: u, Sa: new Uint8Array([]), Za: 0, $a: 0, data: { sequenceNumber: this.h, baseMediaDecodeTime: e, zb: a }, stream: t }, r = new Wo([r]), n = t.id + "_" + n.i, this.g.has(n) ? t = this.g.get(n) : (t = zo(r), this.g.set(n, t)), n = this.i !== t, r = du(r), this.i = t, this.h++, Promise.resolve({ data: r, init: n ? t : null });
        }, Y("shaka.transmuxer.Ac3Transmuxer", Zn), Zn.prototype.transmux = Zn.prototype.transmux, Zn.prototype.getOriginalMimeType = Zn.prototype.getOriginalMimeType, Zn.prototype.convertCodecs = Zn.prototype.convertCodecs, Zn.prototype.isSupported = Zn.prototype.isSupported, Zn.prototype.destroy = Zn.prototype.destroy, Gr("audio/ac3", function() {
          return new Zn("audio/ac3");
        }, vi);
        function cS(e, t) {
          if (t + 8 > e.length || (e[t] << 8 | e[t + 1] << 0) !== 2935) return null;
          var n = new Jr(e.subarray(t + 2));
          In(n, 2), In(n, 3);
          var r = Me(n, 11) + 1 << 1, i = Me(n, 2);
          if (i == 3) {
            i = Me(n, 2), i = [24e3, 22060, 16e3][i];
            var o = 3;
          } else i = [48e3, 44100, 32e3][i], o = Me(n, 2);
          var s = Me(n, 3), u = Me(n, 1);
          return n = Me(n, 5), t + r > e.byteLength ? null : (e = Math.floor(r * i / ([1, 2, 3, 6][o] * 16)), e = new Uint8Array([(e & 8160) >> 5, (e & 31) << 3, i << 6 | n << 1 | 0, 0 | s << 1 | u << 0, 0]), { sampleRate: i, channelCount: [2, 1, 2, 3, 3, 4, 4, 5][s] + u, Ga: e, ra: r });
        }
        function er(e) {
          this.j = e, this.h = 0, this.g = /* @__PURE__ */ new Map(), this.i = null;
        }
        f = er.prototype, f.destroy = function() {
          this.g.clear();
        }, f.isSupported = function(e) {
          return e.toLowerCase().split(";")[0] == "audio/ec3" ? Qt(this.convertCodecs("audio", e)) : !1;
        }, f.convertCodecs = function(e, t) {
          return t.toLowerCase().split(";")[0] == "audio/ec3" ? 'audio/mp4; codecs="ec-3"' : t;
        }, f.getOriginalMimeType = function() {
          return this.j;
        }, f.transmux = function(e, t, n, r) {
          e = pe(e);
          for (var i = qo(e), o = i.length; o < e.length && (e[o] << 8 | e[o + 1] << 0) !== 2935; o++) ;
          var s = n.endTime * 1e3;
          i = so(i), i.length && n && (i = i.find(function(c) {
            return c.description === "com.apple.streaming.transportStreamTimestamp";
          })) && (s = i.data), i = 0;
          for (var u = new Uint8Array([]), a = []; o < e.length; ) {
            var l = cS(e, o);
            if (!l) return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
            t.audioSamplingRate = l.sampleRate, t.channelsCount = l.channelCount, i = l.sampleRate, u = l.Ga, a.push({
              data: e.subarray(o, o + l.ra),
              size: l.ra,
              duration: 1536,
              sb: 0,
              flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 }
            }), o += l.ra;
          }
          return e = Math.floor(s * i / 1e3), r = { id: t.id, type: "audio", codecs: "ec-3", timescale: i, duration: r, Db: [], Ga: u, Sa: new Uint8Array([]), Za: 0, $a: 0, data: { sequenceNumber: this.h, baseMediaDecodeTime: e, zb: a }, stream: t }, r = new Wo([r]), n = t.id + "_" + n.i, this.g.has(n) ? t = this.g.get(n) : (t = zo(r), this.g.set(n, t)), n = this.i !== t, r = du(r), this.i = t, this.h++, Promise.resolve({ data: r, init: n ? t : null });
        }, Y("shaka.transmuxer.Ec3Transmuxer", er), er.prototype.transmux = er.prototype.transmux, er.prototype.getOriginalMimeType = er.prototype.getOriginalMimeType, er.prototype.convertCodecs = er.prototype.convertCodecs, er.prototype.isSupported = er.prototype.isSupported, er.prototype.destroy = er.prototype.destroy, Gr("audio/ec3", function() {
          return new er("audio/ec3");
        }, vi);
        function L4(e) {
          if (!e.length) return null;
          var t = e.find(function(w) {
            return w.type == 7;
          });
          if (e = e.find(function(w) {
            return w.type == 8;
          }), !t || !e) return null;
          var n = new Jr(t.data), r = Ge(n);
          if (Ge(n), Ge(n), Ft(n), N4.includes(r) && (r = Z(n), r === 3 && In(n, 1), Ft(n), Ft(n), In(n, 1), re(n))) {
            r = r !== 3 ? 8 : 12;
            for (var i = 0; i < r; i++) re(n) && (i < 6 ? al(n, 16) : al(n, 64));
          }
          if (Ft(n), r = Z(n), r === 0) Z(n);
          else if (r === 1) for (In(n, 1), Ft(n), Ft(n), r = Z(n), i = 0; i < r; i++) Ft(n);
          Ft(n), In(n, 1);
          var o = Z(n), s = Z(n), u = Me(n, 1);
          u === 0 && In(n, 1), In(n, 1);
          var a = 0, l = 0, c = 0, d = 0;
          if (re(n) && (a = Z(n), l = Z(n), c = Z(n), d = Z(n)), i = r = 1, re(n) && re(n)) {
            var h = Ge(n), p = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2], g = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];
            h > 0 && h <= 16 ? (r = p[h - 1], i = g[h - 1]) : h === 255 && (r = Me(n, 16), i = Me(n, 16));
          }
          return n = (2 - u) * (s + 1) * 16 - c * 2 - d * 2, o = (o + 1) * 16 - a * 2 - l * 2, a = [], t = t.fullData, a.push(t.byteLength >>> 8 & 255), a.push(t.byteLength & 255), a = a.concat.apply(a, X(t)), t = [], e = e.fullData, t.push(e.byteLength >>> 8 & 255), t.push(e.byteLength & 255), t = t.concat.apply(t, X(e)), e = new Uint8Array([
            1,
            a[3],
            a[4],
            a[5],
            255,
            225
          ].concat(a, [1], t)), { height: n, width: o, Sa: e, Za: r, $a: i };
        }
        function b4(e) {
          function t(g) {
            i = { data: new Uint8Array([]), frame: !1, isKeyframe: !1, pts: g.pts, dts: g.dts, nalus: [] };
          }
          function n() {
            if (i && i.nalus.length && i.frame) {
              for (var g = [], w = m(i.nalus), T = w.next(); !T.done; T = w.next()) {
                T = T.value;
                var E = T.fullData.byteLength, A = new Uint8Array(4);
                A[0] = E >> 24 & 255, A[1] = E >> 16 & 255, A[2] = E >> 8 & 255, A[3] = E & 255, g.push(A), g.push(T.fullData);
              }
              i.data = St.apply(Gt, X(g)), r.push(i);
            }
          }
          for (var r = [], i = null, o = !1, s = 0; s < e.length; s++) {
            var u = e[s], a = u.nalus, l = !1;
            i && a.length && !o && (n(), t(u)), a = m(u.nalus);
            for (var c = a.next(); !c.done; c = a.next()) {
              c = c.value;
              var d = !1;
              switch (c.type) {
                case 1:
                  var h = !1;
                  d = !0;
                  var p = c.data;
                  l && p.length > 4 && (p = jA(new Jr(p)), p === 2 || p === 4 || p === 7 || p === 9) && (h = !0), h && i && i.frame && !i.isKeyframe && (n(), i = null), i || t(u), i.frame = !0, i.isKeyframe = h;
                  break;
                case 5:
                  d = !0, i && i.frame && !i.isKeyframe && (n(), i = null), i || t(u), i.frame = !0, i.isKeyframe = !0;
                  break;
                case 6:
                  d = !0;
                  break;
                case 7:
                  l = d = !0;
                  break;
                case 8:
                  d = !0;
                  break;
                case 9:
                  o = d = !0, i && i.frame && (n(), i = null), i || t(u);
                  break;
                case 12:
                  d = !0;
                  break;
                default:
                  d = !1;
              }
              i && d && i.nalus.push(c);
            }
          }
          return n(), r;
        }
        var N4 = [100, 110, 122, 244, 44, 83, 86, 118, 128, 138, 139, 134];
        function O4(e) {
          if (!e.length) return null;
          var t = e.find(function(s) {
            return s.type == 32;
          }), n = e.find(function(s) {
            return s.type == 33;
          }), r = e.find(function(s) {
            return s.type == 34;
          });
          if (!t || !n || !r) return null;
          var i = j4(t.fullData);
          e = U4(n.fullData);
          var o = _4(r.fullData);
          return t = B4(t.fullData, n.fullData, r.fullData, { Ug: i.Ug, Bh: i.Bh, Eg: e.Eg, Fg: e.Fg, yg: e.yg, Dg: e.Dg, zg: e.zg, Ag: e.Ag, Bg: e.Bg, Cg: e.Cg, rg: e.rg, sg: e.sg, ug: e.ug, vg: e.vg, wg: e.wg, xg: e.xg, rf: e.rf, gg: e.gg, fg: e.fg, eg: e.eg, Wg: o.Wg, qg: e.qg, pg: e.pg }), {
            height: e.height,
            width: e.width,
            Sa: t,
            Za: e.Sk,
            $a: e.Rk
          };
        }
        function j4(e) {
          var t = new Jr(e, !0);
          return Ge(t), Ge(t), Me(t, 4), Me(t, 2), Me(t, 6), e = Me(t, 3), t = re(t), { Ug: e + 1, Bh: t };
        }
        function U4(e) {
          e = new Jr(e, !0), Ge(e), Ge(e);
          var t = 0, n = 0, r = 0, i = 0;
          Me(e, 4);
          var o = Me(e, 3);
          re(e);
          for (var s = Me(e, 2), u = Me(e, 1), a = Me(e, 5), l = Ge(e), c = Ge(e), d = Ge(e), h = Ge(e), p = Ge(e), g = Ge(e), w = Ge(e), T = Ge(e), E = Ge(e), A = Ge(e), I = Ge(e), P = [], N = [], M = 0; M < o; M++) P.push(re(e)), N.push(re(e));
          if (o > 0) for (M = o; M < 8; M++) Me(e, 2);
          for (M = 0; M < o; M++) P[M] && Me(e, 88), N[M] && Ge(e);
          Z(e), P = Z(e), P == 3 && Me(e, 1), N = Z(e), M = Z(e), re(e) && (t += Z(e), n += Z(e), r += Z(e), i += Z(e));
          var R = Z(e), k = Z(e), O = Z(e);
          if (re(e)) for (var L = 0; L <= o; L++) Z(e), Z(e), Z(e);
          else Z(e), Z(e), Z(e);
          if (Z(e), Z(e), Z(e), Z(e), Z(e), Z(e), re(e) && re(e)) for (L = 0; L < 4; L++) for (var U = 0; U < (L === 3 ? 2 : 6); U++) if (re(e)) {
            var j = Math.min(64, 1 << 4 + (L << 1));
            L > 1 && Yo(e);
            for (var G = 0; G < j; G++) Yo(e);
          } else Z(e);
          for (re(e), re(e), re(e) && (Ge(e), Z(e), Z(e), re(e)), L = Z(e), j = U = 0; j < L; j++) if (G = !1, j !== 0 && (G = re(e)), G) {
            j === L && Z(e), re(e), Z(e);
            for (var H = G = 0; H <= U; H++) {
              var B = re(e), F = !1;
              B || (F = re(e)), (B || F) && G++;
            }
            U = G;
          } else {
            for (H = Z(e), G = Z(e), U = H + G, B = 0; B < H; B++) Z(e), re(e);
            for (H = 0; H < G; H++) Z(e), re(e);
          }
          if (re(e)) for (L = Z(e), U = 0; U < L; U++) {
            for (j = 0; j < O + 4; j++) Me(e, 1);
            Me(e, 1);
          }
          if (L = O = 1, U = !0, j = 1, H = G = 0, re(e), re(e), re(e)) {
            if (re(e)) {
              B = Ge(e), F = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2];
              var W = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];
              B > 0 && B <= 16 ? (O = F[B - 1], L = W[B - 1]) : B === 255 && (O = Me(e, 16), L = Me(e, 16));
            }
            if (re(e) && re(e), re(e) && (Me(e, 3), re(e), re(e) && (Ge(e), Ge(e), Ge(e))), re(e) && (Z(e), Z(e)), re(e), re(e), re(e), (B = re(e)) && (Ft(e), Ft(e), Ft(e), Ft(e)), re(e) && (j = Me(e, 32), G = Me(e, 32), re(e) && Z(e), re(e))) {
              W = !1, B = re(e), F = re(e), (B || F) && ((W = re(e)) && (Ge(e), Me(e, 5), re(e), Me(
                e,
                5
              )), Me(e, 4), Me(e, 4), W && Me(e, 4), Me(e, 5), Me(e, 5), Me(e, 5));
              for (var z = 0; z <= o; z++) {
                U = re(e);
                var me = !0, Q = 1;
                U || (me = re(e));
                var Be = !1;
                if (me ? Z(e) : Be = re(e), Be || (Q = Z(e) + 1), B) {
                  for (me = 0; me < Q; me++) Z(e), Z(e), W && (Z(e), Z(e));
                  re(e);
                }
                if (F) {
                  for (me = 0; me < Q; me++) Z(e), Z(e), W && (Z(e), Z(e));
                  re(e);
                }
              }
            }
            re(e) && (re(e), re(e), re(e), H = Z(e), Z(e), Z(e), Z(e), Z(e));
          }
          return { yg: I, Eg: s, Fg: u, Dg: a, zg: l, Ag: c, Bg: d, Cg: h, rg: p, sg: g, ug: w, vg: T, wg: E, xg: A, rf: H, gg: P, fg: R, eg: k, width: N - (t + n) * (P === 1 || P === 2 ? 2 : 1), height: M - (r + i) * (P === 1 ? 2 : 1), Sk: O, Rk: L, qg: G / j, pg: U };
        }
        function _4(e) {
          var t = new Jr(e, !0);
          Ge(t), Ge(t), Z(t), Z(t), re(t), re(t), Me(t, 3), re(t), re(t), Z(t), Z(t), Yo(t), re(t), re(t), re(t) && Z(t), Yo(t), Yo(t), re(t), re(t), re(t), re(t), e = re(t), t = re(t);
          var n = 1;
          return t && e ? n = 0 : t ? n = 3 : e && (n = 2), { Wg: n };
        }
        function B4(e, t, n, r) {
          var i = new Uint8Array(23 + (5 + e.byteLength) + (5 + t.byteLength) + (5 + n.byteLength));
          for (i[0] = 1, i[1] = (r.Eg & 3) << 6 | (r.Fg ? 1 : 0) << 5 | r.Dg & 31, i[2] = r.zg, i[3] = r.Ag, i[4] = r.Bg, i[5] = r.Cg, i[6] = r.rg, i[7] = r.sg, i[8] = r.ug, i[9] = r.vg, i[10] = r.wg, i[11] = r.xg, i[12] = r.yg, i[13] = 240 | (r.rf & 3840) >> 8, i[14] = r.rf & 255, i[15] = 252 | r.Wg & 3, i[16] = 252 | r.gg & 3, i[17] = 248 | r.fg & 7, i[18] = 248 | r.eg & 7, i[19] = 0, i[20] = parseInt(r.qg, 10), i[21] = ((r.pg ? 1 : 0) & 3) << 6 | (r.Ug & 7) << 3 | (r.Bh ? 1 : 0) << 2 | 3, i[22] = 3, e = [e, t, n], t = 23, n = e.length - 1, r = 0; r < e.length; r += 1) i.set(new Uint8Array([32 + r | (r === n ? 128 : 0), 0, 1]), t), t += 3, i.set(new Uint8Array([e[r].byteLength >> 8, e[r].byteLength & 255]), t), t += 2, i.set(e[r], t), t += e[r].byteLength;
          return i;
        }
        function Qc(e, t) {
          var n = e[t + 1] >> 3 & 3, r = e[t + 1] >> 1 & 3, i = e[t + 2] >> 4 & 15, o = e[t + 2] >> 2 & 3;
          if (n !== 1 && i !== 0 && i !== 15 && o !== 3) {
            var s = e[t + 3] >> 6;
            i = F4[(n === 3 ? 3 - r : r === 3 ? 3 : 4) * 14 + i - 1] * 1e3, o = V4[(n === 3 ? 0 : n === 2 ? 1 : 2) * 3 + o], n = H4[n][r];
            var u = G4[r], a = Math.floor(n * i / o + (e[t + 2] >> 1 & 1)) * u, l = (navigator.userAgent || "").match(/Chrome\/(\d+)/i);
            return (l = l ? parseInt(l[1], 10) : 0) && l <= 87 && r === 2 && i >= 224e3 && s === 0 && (e[t + 3] |= 128), { sampleRate: o, channelCount: s === 3 ? 1 : 2, ra: a, Qk: n * 8 * u };
          }
          return null;
        }
        function dS(e, t) {
          return e[t] === 255 && (e[t + 1] & 224) === 224 && (e[t + 1] & 6) !== 0;
        }
        function fS(e, t) {
          if (t + 1 < e.length && dS(e, t)) {
            var n = Qc(e, t), r = 4;
            return n && n.ra && (r = n.ra), t += r, t === e.length || t + 1 < e.length && dS(e, t);
          }
          return !1;
        }
        var F4 = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160], V4 = [44100, 48e3, 32e3, 22050, 24e3, 16e3, 11025, 12e3, 8e3], H4 = [[0, 72, 144, 12], [0, 0, 0, 0], [0, 72, 144, 12], [0, 144, 144, 12]], G4 = [0, 1, 1, 4];
        function tr(e) {
          this.j = e, this.h = 0, this.g = /* @__PURE__ */ new Map(), this.i = null;
        }
        f = tr.prototype, f.destroy = function() {
          this.g.clear();
        }, f.isSupported = function(e) {
          return e.toLowerCase().split(";")[0] == "audio/mpeg" ? Qt(this.convertCodecs("audio", e)) : !1;
        }, f.convertCodecs = function(e, t) {
          return t.toLowerCase().split(";")[0] == "audio/mpeg" ? 'audio/mp4; codecs="mp3"' : t;
        }, f.getOriginalMimeType = function() {
          return this.j;
        }, f.transmux = function(e, t, n, r) {
          for (var i = pe(e), o = qo(i).length; o < i.length && !fS(i, o); o++) ;
          var s;
          for (e = []; o < i.length; ) {
            var u = Qc(i, o);
            if (!u) return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
            s || (s = u), o + u.ra <= i.length && e.push({ data: i.subarray(o, o + u.ra), size: u.ra, duration: 1152, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), o += u.ra;
          }
          return s ? (i = s.Qk * 9e4 / s.sampleRate * this.h, r = {
            id: t.id,
            type: "audio",
            codecs: "mp3",
            timescale: s.sampleRate,
            duration: r,
            Db: [],
            Ga: new Uint8Array([]),
            Sa: new Uint8Array([]),
            Za: 0,
            $a: 0,
            data: { sequenceNumber: this.h, baseMediaDecodeTime: i, zb: e },
            stream: t
          }, r = new Wo([r]), n = t.id + "_" + n.i, this.g.has(n) ? t = this.g.get(n) : (t = zo(r), this.g.set(n, t)), n = this.i !== t, r = du(r), this.i = t, this.h++, Promise.resolve({ data: r, init: n ? t : null })) : Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
        }, Y("shaka.transmuxer.Mp3Transmuxer", tr), tr.prototype.transmux = tr.prototype.transmux, tr.prototype.getOriginalMimeType = tr.prototype.getOriginalMimeType, tr.prototype.convertCodecs = tr.prototype.convertCodecs, tr.prototype.isSupported = tr.prototype.isSupported, tr.prototype.destroy = tr.prototype.destroy, Gr("audio/mpeg", function() {
          return new tr("audio/mpeg");
        }, vi);
        function nr(e) {
          this.h = e, this.g = null;
        }
        f = nr.prototype, f.destroy = function() {
        }, f.isSupported = function(e) {
          if (e.toLowerCase().split(";")[0] != "video/mp2t") return !1;
          var t = hn(e).split(","), n = fn("audio", t);
          return t = fn("video", t), !n || t || Kt(n) != "mp3" ? !1 : Qt(this.convertCodecs("audio", e));
        }, f.convertCodecs = function(e, t) {
          return t.toLowerCase().split(";")[0] == "video/mp2t" ? "audio/mpeg" : t;
        }, f.getOriginalMimeType = function() {
          return this.h;
        }, f.transmux = function(e, t, n, r, i) {
          if (this.g ? this.g.clearData() : this.g = new rt(), this.g.Hf(n.i), e = pe(e), e = this.g.parse(e), e.Yd().audio != "mp3" || i != "audio") return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
          for (n = new Uint8Array([]), i = m(e.ub()), e = i.next(); !e.done; e = i.next()) if (e = e.value.data) for (t = 0; t < e.length; ) (r = Qc(e, t)) ? (t + r.ra <= e.length && (n = St(n, e.subarray(t, t + r.ra))), t += r.ra) : t++;
          return Promise.resolve(n);
        }, Y("shaka.transmuxer.MpegTsTransmuxer", nr), nr.prototype.transmux = nr.prototype.transmux, nr.prototype.getOriginalMimeType = nr.prototype.getOriginalMimeType, nr.prototype.convertCodecs = nr.prototype.convertCodecs, nr.prototype.isSupported = nr.prototype.isSupported, nr.prototype.destroy = nr.prototype.destroy, Gr("video/mp2t", function() {
          return new nr("video/mp2t");
        }, jd);
        function Vn(e) {
          this.h = e, (this.g = Jh.get("ISOBoxer")()) && K4(this);
        }
        function K4(e) {
          function t() {
            this._procFullBox(), this.flags & 1 && (this._procField("AlgorithmID", "uint", 24), this._procField("IV_size", "uint", 8), this._procFieldArray("KID", 16, "uint", 8)), this._procField("sample_count", "uint", 32), this._procEntries("entry", this.sample_count, function(n) {
              this._procEntryField(n, "InitializationVector", "data", 8), this.flags & 2 && (this._procEntryField(n, "NumberOfEntries", "uint", 16), this._procSubEntries(n, "clearAndCryptedData", n.NumberOfEntries, function(r) {
                this._procEntryField(
                  r,
                  "BytesOfClearData",
                  "uint",
                  16
                ), this._procEntryField(r, "BytesOfEncryptedData", "uint", 32);
              }));
            });
          }
          e.g.addBoxProcessor("saio", function() {
            this._procFullBox(), this.flags & 1 && (this._procField("aux_info_type", "uint", 32), this._procField("aux_info_type_parameter", "uint", 32)), this._procField("entry_count", "uint", 32), this._procFieldArray("offset", this.entry_count, "uint", this.version === 1 ? 64 : 32);
          }), e.g.addBoxProcessor("saiz", function() {
            this._procFullBox(), this.flags & 1 && (this._procField("aux_info_type", "uint", 32), this._procField(
              "aux_info_type_parameter",
              "uint",
              32
            )), this._procField("default_sample_info_size", "uint", 8), this._procField("sample_count", "uint", 32), this.default_sample_info_size === 0 && this._procFieldArray("sample_info_size", this.sample_count, "uint", 8);
          }), e.g.addBoxProcessor("senc", t), e.g.addBoxProcessor("uuid", function() {
            for (var n = !0, r = 0; r < 16; r++) this.usertype[r] !== W4[r] && (n = !1);
            n && (this._parsing && (this.type = "sepiff"), t.call(this));
          });
        }
        f = Vn.prototype, f.destroy = function() {
        }, f.isSupported = function(e, t) {
          var n = e.startsWith("mss/");
          return !this.g || !n ? !1 : t ? Qt(this.convertCodecs(t, e)) : (t = this.convertCodecs("audio", e), e = this.convertCodecs("video", e), Qt(t) || Qt(e));
        }, f.convertCodecs = function(e, t) {
          return t.replace("mss/", "");
        }, f.getOriginalMimeType = function() {
          return this.h;
        }, f.transmux = function(e, t, n) {
          if (!n) return Promise.resolve(pe(e));
          if (!t.mssPrivateData) return Promise.reject(new b(2, 3, 3020, n ? n.P()[0] : null));
          try {
            var r, i = this.g.parseBuffer(e), o = i.fetch("tfhd");
            o.track_ID = t.id + 1;
            var s = i.fetch("tfdt"), u = i.fetch("traf");
            s === null && (s = this.g.createFullBox("tfdt", u, o), s.version = 1, s.flags = 0, s.baseMediaDecodeTime = Math.floor(n.startTime * t.mssPrivateData.timescale));
            var a = i.fetch("trun"), l = i.fetch("tfxd");
            l && l._parent.boxes.splice(l._parent.boxes.indexOf(l), 1);
            var c = i.fetch("tfrf");
            c && c._parent.boxes.splice(c._parent.boxes.indexOf(c), 1);
            var d = i.fetch("sepiff");
            if (d !== null) {
              d.type = "senc", d.usertype = void 0;
              var h = i.fetch("saio");
              if (h === null) {
                h = this.g.createFullBox("saio", u), h.version = 0, h.flags = 0, h.entry_count = 1, h.offset = [0];
                var p = this.g.createFullBox("saiz", u);
                if (p.version = 0, p.flags = 0, p.sample_count = d.sample_count, p.default_sample_info_size = 0, p.sample_info_size = [], d.flags & 2) for (r = 0; r < d.sample_count; r += 1) p.sample_info_size[r] = 10 + 6 * d.entry[r].NumberOfEntries;
                else p.default_sample_info_size = 8;
              }
            }
            o.flags &= 16777214, o.flags |= 131072, a.flags |= 1;
            var g = i.fetch("moof");
            a.data_offset = g.getLength() + 8;
            var w = i.fetch("saio");
            w !== null && (w.offset[0] = hS(g, "traf") + hS(u, "senc") + 16);
            var T = pe(i.write());
            return Promise.resolve(T);
          } catch (E) {
            return E instanceof b ? Promise.reject(E) : Promise.reject(new b(2, 3, 3022, n ? n.P()[0] : null));
          }
        };
        function hS(e, t) {
          for (var n = 8, r = 0; r < e.boxes.length && e.boxes[r].type !== t; r++) n += e.boxes[r].size;
          return n;
        }
        Y("shaka.transmuxer.MssTransmuxer", Vn), Vn.prototype.transmux = Vn.prototype.transmux, Vn.prototype.getOriginalMimeType = Vn.prototype.getOriginalMimeType, Vn.prototype.convertCodecs = Vn.prototype.convertCodecs, Vn.prototype.isSupported = Vn.prototype.isSupported, Vn.prototype.destroy = Vn.prototype.destroy;
        var W4 = new Uint8Array([162, 57, 79, 82, 90, 155, 79, 20, 162, 68, 108, 66, 124, 100, 141, 244]);
        Gr("mss/audio/mp4", function() {
          return new Vn("mss/audio/mp4");
        }, vi), Gr("mss/video/mp4", function() {
          return new Vn("mss/video/mp4");
        }, vi);
        function rr(e) {
          this.m = e, this.g = 0, this.j = /* @__PURE__ */ new Map(), this.l = this.i = this.h = null;
        }
        f = rr.prototype, f.destroy = function() {
          this.j.clear(), this.i && this.i.destroy();
        }, f.isSupported = function(e, t) {
          if (e.toLowerCase().split(";")[0] != "video/mp2t") return !1;
          var n = e;
          t && (n = this.convertCodecs(t, e));
          var r = hn(n).split(",");
          return n = fn("audio", r), r = fn("video", r), n && (n = Kt(n), !z4.includes(n)) || r && (n = Kt(r), !X4.includes(n)) ? !1 : t ? Qt(this.convertCodecs(t, e)) : (t = this.convertCodecs("audio", e), e = this.convertCodecs("video", e), Qt(t) || Qt(e));
        }, f.convertCodecs = function(e, t) {
          return t.toLowerCase().split(";")[0] == "video/mp2t" ? (t = hn(t).replace("mp4a.40.34", "mp3").split(",").map(function(n) {
            return iu(n, "audio/mp4");
          }).map(Gd).join(","), e == "audio" ? 'audio/mp4; codecs="' + t + '"' : 'video/mp4; codecs="' + t + '"') : t;
        }, f.getOriginalMimeType = function() {
          return this.m;
        }, f.transmux = function(e, t, n, r, i) {
          var o = pe(e);
          if (i == "audio" && !$o(o)) {
            for (var s = qo(o), u = s.length; u < o.length; u++) if (fS(o, u)) return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
            for (u = s.length; u < o.length; u++) if (aS(o, u)) return this.i || (this.i = new Fn("audio/aac")), this.i.transmux(e, t, n, r, i);
            return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
          }
          this.h ? this.h.clearData() : this.h = new rt(), this.h.Hf(n.i);
          var a = this.h.parse(o), l = [], c = a.Yd();
          try {
            var d = null;
            if (i == "video") {
              switch (c.video) {
                case "avc":
                  var h = [], p = null, g = a.td(), w = b4(g);
                  if (!w.length) throw new b(2, 3, 3023, n ? n.P()[0] : null);
                  for (var T = 0; T < w.length; T++) {
                    var E = w[T];
                    p == null && (p = E.dts);
                    var A = void 0;
                    A = T + 1 < w.length ? (w[T + 1].dts || 0) - (E.dts || 0) : w.length > 1 ? (E.dts || 0) - (w[T - 1].dts || 0) : (n.endTime - n.startTime) * 9e4, h.push({ data: E.data, size: E.data.byteLength, duration: A, sb: Math.round((E.pts || 0) - (E.dts || 0)), flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: E.isKeyframe ? 2 : 1, yb: E.isKeyframe ? 0 : 1 } });
                  }
                  for (var I = [], P = m(g), N = P.next(); !N.done; N = P.next()) I.push.apply(I, X(N.value.nalus));
                  var M = L4(I);
                  if (!M || p == null) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                  t.height = t.height || M.height, t.width = t.width || M.width, d = { id: t.id, type: "video", codecs: "avc1", timescale: 9e4, duration: r, Db: [], Ga: new Uint8Array([]), Sa: M.Sa, Za: M.Za, $a: M.$a, data: { sequenceNumber: this.g, baseMediaDecodeTime: p, zb: h }, stream: t };
                  break;
                case "hvc":
                  var R = [], k = null, O = [], L = a.td();
                  if (!L.length) throw new b(2, 3, 3023, n ? n.P()[0] : null);
                  for (var U = 0; U < L.length; U++) {
                    var j = L[U], G = j.nalus;
                    O.push.apply(O, X(G));
                    for (var H = !1, B = [], F = !1, W = m(G), z = W.next(); !z.done; z = W.next()) {
                      var me = z.value;
                      switch (me.type) {
                        case 1:
                        case 0:
                          var Q = F = !0;
                          break;
                        case 19:
                        case 20:
                        case 21:
                          H = Q = F = !0;
                          break;
                        case 32:
                          Q = !0;
                          break;
                        case 33:
                          Q = !0;
                          break;
                        case 34:
                          Q = !0;
                          break;
                        case 35:
                          F = Q = !0;
                          break;
                        case 39:
                        case 40:
                          Q = !0;
                          break;
                        default:
                          Q = !1;
                      }
                      if (F && Q) {
                        var Be = me.fullData.byteLength, ve = new Uint8Array(4);
                        ve[0] = Be >> 24 & 255, ve[1] = Be >> 16 & 255, ve[2] = Be >> 8 & 255, ve[3] = Be & 255, B.push(ve), B.push(me.fullData);
                      }
                    }
                    var ze = B.length ? { data: St.apply(Gt, X(B)), isKeyframe: H } : null;
                    if (ze) {
                      k == null && j.dts != null && (k = j.dts);
                      var Ce = void 0;
                      Ce = U + 1 < L.length ? (L[U + 1].dts || 0) - (j.dts || 0) : L.length > 1 ? (j.dts || 0) - (L[U - 1].dts || 0) : (n.endTime - n.startTime) * 9e4, R.push({ data: ze.data, size: ze.data.byteLength, duration: Ce, sb: Math.round((j.pts || 0) - (j.dts || 0)), flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: ze.isKeyframe ? 2 : 1, yb: ze.isKeyframe ? 0 : 1 } });
                    }
                  }
                  var Ee = O4(O);
                  if (!Ee || k == null) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                  t.height = t.height || Ee.height, t.width = t.width || Ee.width, d = {
                    id: t.id,
                    type: "video",
                    codecs: "hvc1",
                    timescale: 9e4,
                    duration: r,
                    Db: [],
                    Ga: new Uint8Array([]),
                    Sa: Ee.Sa,
                    Za: Ee.Za,
                    $a: Ee.$a,
                    data: { sequenceNumber: this.g, baseMediaDecodeTime: k, zb: R },
                    stream: t
                  };
              }
              d && (l.push(d), d = null);
            }
            if (i == "audio") {
              switch (c.audio) {
                case "aac":
                  for (var Le = [], _e, be = null, Ie = null, ke = null, Lt = m(a.ub()), It = Lt.next(); !It.done; It = Lt.next()) {
                    var Hn = It.value, wn = Hn.data;
                    if (wn) {
                      var sn = 0;
                      if (Ie == -1 && ke) wn = St(ke, Hn.data), Ie = null;
                      else if (Ie != null && ke) {
                        sn = Math.max(0, Ie);
                        var po = St(ke, wn.subarray(0, sn));
                        Le.push({ data: po, size: po.byteLength, duration: 1024, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), Ie = ke = null;
                      }
                      if (_e = uS(wn, sn), !_e) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                      for (t.audioSamplingRate = _e.sampleRate, t.channelsCount = _e.channelCount, be == null && Hn.pts !== null && (be = Hn.pts); sn < wn.length; ) {
                        var si = sS(wn, sn);
                        if (!si) {
                          ke = wn.subarray(sn, wn.length), Ie = -1;
                          break;
                        }
                        var pr = si.ce + si.ra;
                        Ie = Math.max(0, sn + pr - wn.length), Ie != 0 ? ke = wn.subarray(sn + si.ce, sn + pr) : sn + pr <= wn.length && Le.push({ data: wn.subarray(sn + si.ce, sn + pr), size: si.ra, duration: 1024, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), sn += pr;
                      }
                    }
                  }
                  if (!_e || be == null) {
                    be = n.startTime * 9e4;
                    var Is = fn("audio", t.codecs.split(","));
                    if (!Is || !t.channelsCount || !t.audioSamplingRate) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                    _e = { sampleRate: t.audioSamplingRate, channelCount: t.channelsCount, codec: Is };
                    var Ms = D4(Is, t.channelsCount);
                    if (!Ms) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                    for (var Zc = be + (n.endTime - n.startTime) * 9e4, gr = be; gr < Zc; ) Le.push({ data: Ms, size: Ms.byteLength, duration: 1024, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), gr += 1024 / _e.sampleRate * 9e4;
                  }
                  var ed = _e.sampleRate, ng = be / 9e4 * ed;
                  d = {
                    id: t.id,
                    type: "audio",
                    codecs: _e.codec,
                    timescale: ed,
                    duration: r,
                    Db: [],
                    Ga: new Uint8Array([]),
                    Sa: new Uint8Array([]),
                    Za: 0,
                    $a: 0,
                    data: { sequenceNumber: this.g, baseMediaDecodeTime: ng, zb: Le },
                    stream: t
                  };
                  break;
                case "ac3":
                  for (var td = [], Cs = 0, ca = new Uint8Array([]), Mt = null, Pn = m(a.ub()), un = Pn.next(); !un.done; un = Pn.next()) {
                    var rg = un.value, ig = rg.data;
                    Mt == null && rg.pts !== null && (Mt = rg.pts);
                    for (var ks = 0; ks < ig.length; ) {
                      var Ui = lS(ig, ks);
                      Ui ? (t.audioSamplingRate = Ui.sampleRate, t.channelsCount = Ui.channelCount, Cs = Ui.sampleRate, ca = Ui.Ga, td.push({ data: ig.subarray(
                        ks,
                        ks + Ui.ra
                      ), size: Ui.ra, duration: 1536, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), ks += Ui.ra) : ks++;
                    }
                  }
                  if (Cs == 0 || ca.byteLength == 0 || Mt == null) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                  var q4 = Mt / 9e4 * Cs;
                  d = { id: t.id, type: "audio", codecs: "ac-3", timescale: Cs, duration: r, Db: [], Ga: ca, Sa: new Uint8Array([]), Za: 0, $a: 0, data: { sequenceNumber: this.g, baseMediaDecodeTime: q4, zb: td }, stream: t };
                  break;
                case "ec3":
                  for (var gS = [], nd = 0, og = new Uint8Array([]), rd = null, mS = m(a.ub()), sg = mS.next(); !sg.done; sg = mS.next()) {
                    var ug = sg.value, ag = ug.data;
                    rd == null && ug.pts !== null && (rd = ug.pts);
                    for (var Ps = 0; Ps < ag.length; ) {
                      var _i = cS(ag, Ps);
                      _i ? (t.audioSamplingRate = _i.sampleRate, t.channelsCount = _i.channelCount, nd = _i.sampleRate, og = _i.Ga, gS.push({ data: ag.subarray(Ps, Ps + _i.ra), size: _i.ra, duration: 1536, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), Ps += _i.ra) : Ps++;
                    }
                  }
                  if (nd == 0 || og.byteLength == 0 || rd == null) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                  var Y4 = rd / 9e4 * nd;
                  d = {
                    id: t.id,
                    type: "audio",
                    codecs: "ec-3",
                    timescale: nd,
                    duration: r,
                    Db: [],
                    Ga: og,
                    Sa: new Uint8Array([]),
                    Za: 0,
                    $a: 0,
                    data: { sequenceNumber: this.g, baseMediaDecodeTime: Y4, zb: gS },
                    stream: t
                  };
                  break;
                case "mp3":
                  for (var vS = [], id, od = null, yS = m(a.ub()), lg = yS.next(); !lg.done; lg = yS.next()) {
                    var cg = lg.value, da = cg.data;
                    if (da) {
                      od == null && cg.pts !== null && (od = cg.pts);
                      for (var go = 0; go < da.length; ) {
                        var Ds = Qc(da, go);
                        Ds ? (id || (id = Ds), go + Ds.ra <= da.length && vS.push({ data: da.subarray(go, go + Ds.ra), size: Ds.ra, duration: 1152, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), go += Ds.ra) : go++;
                      }
                    }
                  }
                  if (!id || od == null) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                  var wS = id.sampleRate, $4 = od / 9e4 * wS;
                  d = { id: t.id, type: "audio", codecs: "mp3", timescale: wS, duration: r, Db: [], Ga: new Uint8Array([]), Sa: new Uint8Array([]), Za: 0, $a: 0, data: { sequenceNumber: this.g, baseMediaDecodeTime: $4, zb: vS }, stream: t };
                  break;
                case "opus":
                  var TS = [], sd = null, Or = a.H;
                  if (!Or) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                  var an = [];
                  switch (Or.rj) {
                    case 1:
                    case 2:
                      an = [0];
                      break;
                    case 0:
                      an = [255, 1, 1, 0, 1];
                      break;
                    case 128:
                      an = [255, 2, 0, 0, 1];
                      break;
                    case 3:
                      an = [1, 2, 1, 0, 2, 1];
                      break;
                    case 4:
                      an = [1, 2, 2, 0, 1, 2, 3];
                      break;
                    case 5:
                      an = [
                        1,
                        3,
                        2,
                        0,
                        4,
                        1,
                        2,
                        3
                      ];
                      break;
                    case 6:
                      an = [1, 4, 2, 0, 4, 1, 2, 3, 5];
                      break;
                    case 7:
                      an = [1, 4, 2, 0, 4, 1, 2, 3, 5, 6];
                      break;
                    case 8:
                      an = [1, 5, 3, 0, 6, 1, 2, 3, 4, 5, 7];
                      break;
                    case 130:
                      an = [1, 1, 2, 0, 1];
                      break;
                    case 131:
                      an = [1, 1, 3, 0, 1, 2];
                      break;
                    case 132:
                      an = [1, 1, 4, 0, 1, 2, 3];
                      break;
                    case 133:
                      an = [1, 1, 5, 0, 1, 2, 3, 4];
                      break;
                    case 134:
                      an = [1, 1, 6, 0, 1, 2, 3, 4, 5];
                      break;
                    case 135:
                      an = [1, 1, 7, 0, 1, 2, 3, 4, 5, 6];
                      break;
                    case 136:
                      an = [1, 1, 8, 0, 1, 2, 3, 4, 5, 6, 7];
                  }
                  for (var SS = new Uint8Array([0, Or.channelCount, 0, 0, Or.sampleRate >>> 24 & 255, Or.sampleRate >>> 17 & 255, Or.sampleRate >>> 8 & 255, Or.sampleRate >>> 0 & 255, 0, 0].concat(X(an))), xS = Or.sampleRate, AS = m(a.ub()), dg = AS.next(); !dg.done; dg = AS.next()) {
                    var fg = dg.value, Rs = fg.data;
                    sd == null && fg.pts !== null && (sd = fg.pts);
                    for (var fa = 0; fa < Rs.length; ) {
                      for (var J4 = (Rs[fa + 1] & 16) !== 0, Q4 = (Rs[fa + 1] & 8) !== 0, ui = fa + 2, ud = 0; Rs[ui] === 255; ) ud += 255, ui += 1;
                      ud += Rs[ui], ui += 1, ui += J4 ? 2 : 0, ui += Q4 ? 2 : 0;
                      var ES = Rs.slice(ui, ui + ud);
                      TS.push({ data: ES, size: ES.byteLength, duration: 960, sb: 0, flags: { xb: 0, mb: 0, jb: 0, hb: 0, ib: 2, yb: 0 } }), fa = ui + ud;
                    }
                  }
                  if (SS.byteLength == 0 || sd == null) throw new b(2, 3, 3018, n ? n.P()[0] : null);
                  t.audioSamplingRate = Or.sampleRate, t.channelsCount = Or.channelCount;
                  var Z4 = sd / 9e4 * xS;
                  d = { id: t.id, type: "audio", codecs: "opus", timescale: xS, duration: r, Db: [], Ga: SS, Sa: new Uint8Array([]), Za: 0, $a: 0, data: { sequenceNumber: this.g, baseMediaDecodeTime: Z4, zb: TS }, stream: t };
              }
              d && (l.push(d), d = null);
            }
          } catch (pg) {
            return pg && pg.code == 3023 ? Promise.resolve(new Uint8Array([])) : Promise.reject(pg);
          }
          if (!l.length) return Promise.reject(new b(2, 3, 3018, n ? n.P()[0] : null));
          var IS = new Wo(l), hg = t.id + "_" + n.i;
          if (this.j.has(hg)) var ha = this.j.get(hg);
          else ha = zo(IS), this.j.set(hg, ha);
          var eP = this.l !== ha, tP = du(IS);
          return this.l = ha, this.g++, Promise.resolve({ data: tP, init: eP ? ha : null });
        }, Y("shaka.transmuxer.TsTransmuxer", rr), rr.prototype.transmux = rr.prototype.transmux, rr.prototype.getOriginalMimeType = rr.prototype.getOriginalMimeType, rr.prototype.convertCodecs = rr.prototype.convertCodecs, rr.prototype.isSupported = rr.prototype.isSupported, rr.prototype.destroy = rr.prototype.destroy;
        var z4 = ["aac", "ac-3", "ec-3", "mp3", "opus"], X4 = ["avc", "hevc"];
        Gr("video/mp2t", function() {
          return new rr("video/mp2t");
        }, Ud);
        function pS() {
        }
        tt(pS, gn), Y("shaka.util.FairPlayUtils", pS);
      }).call(S, v, v, void 0);
      for (var _ in S.shaka) y[_] = S.shaka[_];
    })();
  })(gg)), gg;
}
var hD = fD();
const pD = /* @__PURE__ */ dD(hD);
async function gD(y, v) {
  const { baseDelayMs: S, maxRetries: _, shouldRetry: C } = v;
  for (let $ = 0; $ <= _; $++) {
    let ne;
    try {
      ne = await y();
    } catch (f) {
      if ($ < _) {
        await vg(S * Math.pow(2, $));
        continue;
      }
      throw f;
    }
    if (C(ne) && $ < _) {
      await vg(S * Math.pow(2, $));
      continue;
    }
    return ne;
  }
  throw new Error("withRetries: unexpected fall-through");
}
const KS = 36e5, WS = async (y, v = {}, S = 3) => {
  let C, $;
  try {
    C = await fetch(y, v);
  } catch (we) {
    if (S === 0)
      throw we;
    $ = null;
  }
  if (C?.ok)
    return C;
  const ne = C && C.status >= 500 && C.status <= 599, f = $ === null || ne || C?.status === 429;
  if (S > 0 && f) {
    const we = 500 * Math.abs(4 - S);
    return console.debug(
      `Retrying request for ${Math.abs(
        4 - S
      )}th time in ${we}ms`
    ), await vg(we), WS(y, v, S - 1);
  }
  if (!C)
    throw new Error("Retries exhausted. Cannot fetch playbackinfo.");
  return C;
};
function zS(y, v) {
  switch (v) {
    case 4010:
      return "PEMonthlyStreamQuotaExceeded";
    case 4032:
    case 4035:
      return "PEContentNotAvailableInLocation";
    case 4033:
      return "PEContentNotAvailableForSubscription";
  }
  return y >= 500 && y < 600 || y === 429 ? "PERetryable" : y >= 400 && y < 500 ? "PENotAllowed" : "EUnexpected";
}
async function mD(y) {
  const {
    accessToken: v,
    audioQuality: S,
    clientId: _,
    mediaProduct: C,
    prefetch: $,
    streamingSessionId: ne
  } = y, f = vr("legacyApiUrl"), we = new URL(
    `${f}/${C.productType}s/${C.productId}/playbackinfo`
  ), Pe = we.searchParams;
  C.productType === "video" ? Pe.set("videoquality", "HIGH") : Pe.set("audioquality", S), Pe.set("playbackmode", "STREAM"), Pe.set("assetpresentation", "FULL");
  const Ye = new Headers();
  $ && Ye.set("x-tidal-prefetch", "true"), _ && Ye.set("x-tidal-token", _), v && Ye.set("authorization", "Bearer " + v), ne && Ye.set("x-tidal-streamingsessionid", ne);
  let it;
  try {
    it = await WS(
      we.toString(),
      {
        headers: Ye,
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore - It is a thing.
        importance: "high"
      },
      3
    );
  } catch {
    throw new yo("PENetwork", "NPBI0");
  }
  const ie = await it.json();
  if ("status" in ie) {
    const Ln = `A${ie.subStatus}`;
    throw new yo(zS(ie.status, ie.subStatus), Ln);
  }
  const Fe = "trackId" in ie, Ht = "videoId" in ie;
  if (!Fe && !Ht)
    throw new yo("EUnexpected", "B9999");
  return {
    ...ie,
    // eslint-disable-next-line no-restricted-syntax
    expires: Date.now() + KS,
    prefetched: $
  };
}
function vD(y) {
  if (!Array.isArray(y))
    throw new Error("Invalid formats array");
  if (y.length === 0)
    throw new Error("Empty formats array");
  return y.includes("FLAC_HIRES") ? "HI_RES_LOSSLESS" : y.includes("FLAC") ? "LOSSLESS" : y.includes("AACLC") ? "HIGH" : "LOW";
}
function yD(y) {
  switch (y) {
    case "HI_RES":
    case "HI_RES_LOSSLESS":
      return ["HEAACV1", "AACLC", "FLAC", "FLAC_HIRES"];
    case "HIGH":
      return ["HEAACV1", "AACLC"];
    case "LOSSLESS":
      return ["HEAACV1", "AACLC", "FLAC"];
    default:
      return ["HEAACV1"];
  }
}
function wD(y) {
  if (!y)
    return;
  const S = /data:([^;]+);base64,(.+)/.exec(y);
  if (!S || S.length < 3)
    return;
  const _ = S[1]?.trim(), C = S[2]?.trim();
  if (!(!_ || !C))
    return {
      manifest: C,
      manifestMimeType: _
    };
}
const TD = 3, SD = 500;
function xD(y) {
  return y >= 500 && y < 600 || y === 429;
}
async function AD(y) {
  const v = lD(
    Ar.credentialsProvider,
    vr("apiUrl")
  ), {
    audioAdaptiveBitrateStreaming: S,
    audioQuality: _,
    mediaProduct: C,
    prefetch: $,
    streamingSessionId: ne
  } = y, f = C.productId, we = await pD.util.FairPlayUtils.isFairPlaySupported();
  let Pe;
  try {
    Pe = await gD(
      () => v.GET("/trackManifests/{id}", {
        params: {
          headers: {
            "x-playback-session-id": ne
          },
          path: {
            id: f
          },
          query: {
            adaptive: S,
            formats: yD(_),
            manifestType: we ? "HLS" : "MPEG_DASH",
            uriScheme: "DATA",
            usage: "PLAYBACK"
          }
        }
      }),
      {
        baseDelayMs: SD,
        maxRetries: TD,
        shouldRetry: (Fe) => !!Fe.error && xD(Fe.response.status)
      }
    );
  } catch {
    throw new yo("PENetwork", "NPBI0");
  }
  if (Pe.error)
    throw new yo(zS(Pe.response.status, 0), "NPBI0");
  const Ye = wD(Pe.data?.data.attributes?.uri), it = Ye?.manifest, ie = Ye?.manifestMimeType;
  if (!it || !ie)
    throw new yo("EUnexpected", "B9999");
  return {
    albumPeakAmplitude: Pe.data?.data.attributes?.albumAudioNormalizationData?.peakAmplitude ?? 0,
    albumReplayGain: Pe.data?.data.attributes?.albumAudioNormalizationData?.replayGain ?? 0,
    assetPresentation: Pe.data?.data.attributes?.trackPresentation ?? "PREVIEW",
    audioMode: "STEREO",
    // Only stereo (and mono) supported for now, TODO: revise or remove if multi-channel is added
    audioQuality: vD(
      // PS: this is the highest quality returned by API, not necessarily the quality requested by the user or the one that is currently playing (when in ABR mode).
      Pe.data?.data.attributes?.formats
    ),
    bitDepth: 0,
    // eslint-disable-next-line no-restricted-syntax
    expires: Date.now() + KS,
    manifest: it,
    manifestHash: Pe.data?.data.attributes?.hash,
    manifestMimeType: ie,
    prefetched: $,
    previewReason: Pe.data?.data.attributes?.previewReason,
    sampleRate: 0,
    streamingSessionId: ne,
    trackId: Pe.data?.data.id ? Number(Pe.data.data.id) : 0,
    trackPeakAmplitude: Pe.data?.data.attributes?.trackAudioNormalizationData?.peakAmplitude ?? 0,
    trackReplayGain: Pe.data?.data.attributes?.trackAudioNormalizationData?.replayGain ?? 0
  };
}
async function XS(y) {
  const { streamingSessionId: v } = y, S = [];
  performance.mark("streaming_metrics:playback_info_fetch:startTimestamp", {
    detail: v,
    startTime: Dn.now()
  });
  try {
    let _;
    if (y.mediaProduct.productType === "video" || y.playerType === "native" ? _ = await mD(y) : _ = await AD(y), _ === void 0)
      throw new Error("Playback info was fetched, but undefined.");
    cd({
      endReason: "COMPLETE",
      streamingSessionId: v
    }).catch(console.error);
    const C = "adInfo" in _;
    return "trackId" in _ ? CS({
      actualAssetPresentation: _.assetPresentation,
      actualAudioMode: _.audioMode,
      actualProductId: String(_.trackId),
      actualQuality: _.audioQuality,
      actualStreamType: void 0,
      hasAds: C,
      productType: "TRACK",
      streamingSessionId: v
    }).catch(console.error) : CS({
      actualAssetPresentation: _.assetPresentation,
      actualAudioMode: void 0,
      actualProductId: String(_.videoId),
      actualQuality: _.videoQuality,
      actualStreamType: _.streamType,
      hasAds: C,
      productType: "VIDEO",
      streamingSessionId: v
    }).catch(console.error), performance.mark("streaming_metrics:playback_info_fetch:endTimestamp", {
      detail: v,
      startTime: Dn.now()
    }), _;
  } catch (_) {
    throw performance.mark("streaming_metrics:playback_info_fetch:endTimestamp", {
      detail: v,
      startTime: Dn.now()
    }), cd({
      endReason: "ERROR",
      errorCode: _.message,
      errorMessage: _.stack,
      streamingSessionId: v
    }).catch(console.error), S.push(
      OP({
        streamingSessionId: v,
        timestamp: Dn.timestamp(
          "streaming_metrics:playback_info_fetch:endTimestamp"
        )
      })
    ), _;
  } finally {
    S.push(
      cd({
        endTimestamp: Dn.timestamp(
          "streaming_metrics:playback_info_fetch:endTimestamp"
        ),
        startTimestamp: Dn.timestamp(
          "streaming_metrics:playback_info_fetch:startTimestamp"
        ),
        streamingSessionId: v
      })
    ), dd(S).catch(console.error), performance.clearMarks(
      "streaming_metrics:playback_info_fetch:endTimestamp"
    ), performance.clearMarks(
      "streaming_metrics:playback_info_fetch:startTimestamp"
    );
  }
}
class qS {
  /**
   * The current time position to restore playback from when connection is back online.
   */
  static #e = 0;
  static #n = !1;
  /**
   * The media product to restore when connection is back online.
   */
  static #r = null;
  static #t;
  static #i;
  static #o;
  static #s() {
    const { activePlayer: v } = et;
    v?.hasStarted() && (this.#r = v.currentMediaProduct, this.#o = this.#l.bind(this), mr.addEventListener(
      "playback-state-change",
      this.#o
    ));
  }
  static #u() {
    const { activePlayer: v } = et;
    v?.hasStarted() && (v.playbackState !== "PLAYING" && this.#r && (mr.dispatchEvent(
      new CustomEvent("load", {
        detail: {
          currentTime: this.#e,
          mediaProduct: this.#r
        }
      })
    ), this.#a()), mr.removeEventListener(
      "playback-state-change",
      this.#o
    ));
  }
  static #a() {
    this.#r = null, this.#e = 0;
  }
  static #l() {
    const { activePlayer: v } = et;
    v && (this.#e = v.currentTime);
  }
  static disable() {
    this.#n && (this.#t && window.removeEventListener("offline", this.#t, !1), this.#i && window.removeEventListener("online", this.#i, !1), this.#i = void 0, this.#t = void 0, this.#n = !1);
  }
  static enable() {
    this.#n || (this.#i = () => this.#u(), this.#t = () => this.#s(), window.addEventListener("offline", this.#t, !1), window.addEventListener("online", this.#i, !1), this.#n = !0);
  }
}
const ED = "streaming-privileges-revoked";
function ID(y) {
  return new CustomEvent(ED, {
    detail: y
  });
}
let Ls;
async function YS(y) {
  const v = vr("legacyApiUrl"), S = await fetch(v + "/rt/connect", {
    headers: new Headers({
      Authorization: "Bearer " + y,
      "Content-Type": "application/json"
    }),
    method: "POST"
  }), { url: _ } = await S.json();
  return _;
}
function $S(y) {
  return new Promise((v) => {
    y.addEventListener("open", () => v(), { once: !0 });
  });
}
class pd {
  #e;
  #n;
  #r;
  #t;
  constructor() {
    this.#t = void 0, this.#n = this.#i(), mr.addEventListener("user-action", () => {
      this.connected && this.userAction().then().catch(console.error);
    });
  }
  /**
   * Call this method to ensure pushkin is running.
   */
  static async ensure() {
    await Ns() && (Ls ? Ls.connected || await Ls.reconnect() : Ls = new pd());
  }
  /**
   * Call this method when credentials changes to re-setup pushkin with the new credentials
   */
  static async refresh() {
    if (!await Ns())
      return;
    const S = await MS();
    Ls && S && Ls.reconnect().catch(console.error);
  }
  async #i() {
    const v = await MS();
    if (!v)
      throw new Error("No access token to connect to Pushkin.");
    const S = await YS(v);
    S && (this.#t = new WebSocket(S), await $S(this.#t), this.#r = ((_) => this.#u(_.data)), this.#e = () => this.#s(), this.#t.addEventListener("message", this.#r, !1), this.#t.addEventListener("closed", this.#e, !1), window.addEventListener("online", () => this.#s(), {
      once: !0
    }));
  }
  async #o(v) {
    if (!this.#t)
      throw new Error(
        "No socket connected. Did you forget to call connect method in Pushkin service first?"
      );
    this.#t.readyState !== WebSocket.OPEN && await this.#n, this.#t.send(JSON.stringify(v));
  }
  #s() {
    this.#n = this.#i();
  }
  #u(v) {
    const S = JSON.parse(v);
    switch (S.type) {
      case "PRIVILEGED_SESSION_NOTIFICATION": {
        mr.dispatchEvent(
          ID(
            String(S.payload.clientDisplayName)
          )
        ), et.activePlayer?.pause();
        break;
      }
      case "RECONNECT":
        this.reconnect().catch(console.error);
        break;
      default:
        console.warn("Unhandled event from Pushkin: ", S);
        break;
    }
  }
  get connected() {
    return this.#t && this.#t.readyState === WebSocket.OPEN;
  }
  reconnect() {
    return this.#t ? (this.#r && this.#t.removeEventListener("message", this.#r), this.#e && this.#t.removeEventListener("closed", this.#e), this.#t.close(), this.#n = this.#i(), this.#n) : Promise.resolve();
  }
  /**
   * Call this method to tell Pushkin a user action happened, so it can
   * make good qualified guesses if you're the session with allowed playback-
   */
  async userAction() {
    this.connected || await this.reconnect();
    try {
      await this.#o({
        payload: {
          startedAt: Dn.now()
        },
        type: "USER_ACTION"
      });
    } catch (v) {
      console.error(v);
    }
  }
}
const MD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Pushkin: pd,
  fetchWebSocketURL: YS,
  socketOpen: $S
}, Symbol.toStringTag, { value: "Module" }));
async function CD() {
  NS(), qS.disable(), await TP();
}
function kD(y, v) {
  return y === "FULL" && v.sourceType !== "PRIVATE_LINK_SHARING";
}
const PD = {
  actions: [],
  actualAssetPresentation: "PREVIEW",
  actualAudioMode: "STEREO",
  actualProductId: "",
  actualQuality: "LOW",
  endAssetPosition: -1,
  endTimestamp: -1,
  isPostPaywall: !1,
  playbackSessionId: "",
  productType: "TRACK",
  requestedProductId: "",
  sourceId: "",
  sourceType: "",
  startAssetPosition: -1,
  startTimestamp: -1
}, JS = await Os(
  "playback_session",
  PD
);
async function DD(y) {
  const v = await JS(y);
  if (!v) {
    console.error("reducedData is undefined");
    return;
  }
  const { name: S, streamingSessionId: _ } = v, { extras: C, ...$ } = v.payload;
  return {
    extras: C,
    name: S,
    payload: $,
    streamingSessionId: _
  };
}
function $D(y, v) {
  return JS({
    actions: [v],
    streamingSessionId: y
  });
}
function RD(y) {
  return y === "video" ? "VIDEO" : "TRACK";
}
async function JD(y) {
  const v = await Ns();
  for (const S of y)
    if (S) {
      const _ = await S;
      _ && await BS({
        ..."extras" in _ && { extras: _.extras },
        group: v ? "play_log" : "play_log_open",
        name: _.name,
        payload: _.payload,
        version: 2
      });
    }
}
let ad, mo;
async function LD(y, v = []) {
  if (!fd.hasEventSender())
    throw new Error("Playback not allowed without an event sender.");
  if (NS(), !y)
    return IP();
  const S = FS();
  et.preloadedStreamingSessionId && et.preloadedMediaProduct?.productId === y.productId && ai.hasStartedStreamInfo(
    et.preloadedStreamingSessionId
  ) && ai.clone(
    et.preloadedStreamingSessionId,
    S
  );
  const _ = Dn.now();
  dd([
    Tg({
      sessionTags: v,
      startReason: "IMPLICIT",
      streamingSessionId: S,
      timestamp: _
    })
  ]).catch(console.error);
  const { clientId: C, token: $ } = await Ar.credentialsProvider.getCredentials(), ne = vr(
    "audioAdaptiveBitrateStreaming"
  ), f = vr("streamingWifiAudioQuality");
  let we;
  if (ai.hasPlaybackInfo(S)) {
    const Fe = ai.getPlaybackInfo(S);
    Fe && Fe.expires > Dn.now() && (we = Fe);
  }
  if (we === void 0) {
    const Fe = jS(
      y.productType,
      f
    );
    try {
      we = await XS({
        accessToken: $,
        audioAdaptiveBitrateStreaming: ne,
        audioQuality: f,
        clientId: C,
        mediaProduct: y,
        playerType: Fe,
        prefetch: !1,
        streamingSessionId: S
      }), ai.savePlaybackInfo(S, we);
    } catch (Ht) {
      throw console.error(
        "Fetching playback info for preloaded item failed. Try again or do a load when playback ends.",
        Ht
      ), Ht;
    }
  }
  const Pe = we.manifestMimeType;
  et.preloadPlayer = await US(
    y.productType,
    "trackId" in we ? we.audioQuality : void 0,
    Pe
  );
  const Ye = VS(we);
  ai.saveStreamInfo(
    Ye.streamingSessionId,
    Ye
  ), DD({
    actualAssetPresentation: we.assetPresentation,
    actualAudioMode: "audioMode" in we ? we.audioMode : null,
    actualProductId: String(
      "videoId" in we ? we.videoId : we.trackId
    ),
    actualQuality: Ye.quality,
    extras: y.extras,
    isPostPaywall: kD(
      we.assetPresentation,
      y
    ),
    playbackSessionId: S,
    productType: RD(
      y.productType
    ),
    requestedProductId: y.productId,
    sourceId: y.sourceId,
    sourceType: y.sourceType,
    startAssetPosition: 0,
    startTimestamp: _,
    streamingSessionId: S
  }).catch(console.error), dd([
    Tg({ streamingSessionId: S }),
    cd({ streamingSessionId: S })
  ]).catch(console.error);
  const { activePlayer: it } = et;
  it && et.preloadPlayer && it.name === et.preloadPlayer.name ? await it.next({
    assetPosition: 0,
    mediaProduct: y,
    playbackInfo: we,
    streamInfo: Ye
  }) : it && await et.preloadPlayer.next({
    assetPosition: 0,
    mediaProduct: y,
    playbackInfo: we,
    streamInfo: Ye
  }), xP(et.preloadPlayer);
}
function QD(y, v = []) {
  if (y !== void 0 && mo && mo.mediaProduct?.productId === y.productId && ad && !ad.signal.aborted)
    return mo.promise;
  ad = new AbortController();
  const S = LD(y, v).then(() => {
    ad.abort("done");
  });
  return mo = {
    mediaProduct: y,
    promise: S
  }, S;
}
async function bD(y, v = 0, S = !1) {
  if (!fd.hasEventSender())
    throw new Error("Playback not allowed without an event sender.");
  if (await Dn.synchronize(), pd.ensure().catch(console.error), mo && mo.mediaProduct?.productId === y.productId && await mo.promise, et.activePlayer?.nextItem?.mediaProduct.productId === y.productId) {
    const Ln = et.activePlayer;
    return performance.mark(
      "streaming_metrics:playback_statistics:idealStartTimestamp",
      {
        detail: et.preloadedStreamingSessionId,
        startTime: Dn.now()
      }
    ), await Ln.reset({ keepPreload: !0 }), y.referenceId && et.preloadedStreamingSessionId && Ln.overwriteMediaProduct(
      et.preloadedStreamingSessionId,
      y
    ), Ln.skipToPreloadedMediaProduct();
  }
  const _ = CD(), C = FS();
  dd([
    Tg({
      sessionProductId: y.productId,
      sessionProductType: y.productType === "track" ? "TRACK" : "VIDEO",
      sessionType: "PLAYBACK",
      startReason: "EXPLICIT",
      streamingSessionId: C,
      timestamp: Dn.now()
    })
  ]).catch(console.error), performance.mark(
    "streaming_metrics:playback_statistics:idealStartTimestamp",
    {
      detail: C,
      startTime: Dn.now()
    }
  );
  const { clientId: $, token: ne } = await Ar.credentialsProvider.getCredentials(), f = vr(
    "audioAdaptiveBitrateStreaming"
  ), we = vr("streamingWifiAudioQuality");
  let Pe = null;
  const Ye = jS(
    y.productType,
    we
  );
  try {
    Pe = await XS({
      accessToken: ne,
      audioAdaptiveBitrateStreaming: f,
      audioQuality: we,
      clientId: $,
      mediaProduct: y,
      playerType: Ye,
      prefetch: S,
      streamingSessionId: C
    });
  } catch (Ln) {
    Ln instanceof yo && mr.dispatchError(Ln), document.location.href.includes("localhost") && console.error(Ln);
  }
  if (!Pe)
    return;
  const it = VS(Pe);
  ai.saveStreamInfo(
    it.streamingSessionId,
    it
  ), await _, qS.enable();
  const ie = "trackId" in Pe ? Pe.audioQuality : void 0, Fe = Pe.manifestMimeType, Ht = await US(
    y.productType,
    ie,
    Fe
  );
  return Sg(Ht), Ht.load(
    {
      assetPosition: v,
      mediaProduct: y,
      playbackInfo: Pe,
      streamInfo: it
    },
    "explicit"
  );
}
mr.addEventListener("load", (y) => {
  if (y instanceof CustomEvent) {
    const { currentTime: v, mediaProduct: S } = y.detail;
    bD(S, v).then().catch(console.error);
  }
});
function ZD() {
  return et.activePlayer?.pause();
}
async function e3() {
  await Dn.synchronize();
  const { activePlayer: y } = et;
  return y ? (mr.dispatchEvent(new CustomEvent("user-action")), y.play()) : Promise.reject(new Error("No active player"));
}
async function t3(y) {
  const { activePlayer: v } = et;
  return v?.seek(y);
}
function n3(y) {
  try {
    new URL(y);
  } catch (v) {
    throw v;
  }
  jr({ apiUrl: y });
}
function r3(y) {
  jr({
    audioAdaptiveBitrateStreaming: y
  });
}
function i3(y) {
  Ar.credentialsProvider = y;
}
function o3(y) {
  fd.eventSender = y;
}
function s3(y) {
  try {
    new URL(y);
  } catch (v) {
    throw v;
  }
  jr({ legacyApiUrl: y });
}
function u3(y) {
  jr({
    loudnessNormalizationMode: y
  }), et.activePlayer?.updateVolumeLevel();
}
const QS = "active-device-changed";
function a3(y) {
  return new CustomEvent(QS, {
    detail: y
  });
}
function ZS(y, v) {
  return new Promise((S) => {
    y.addEventListener(v, (_) => S(_), { once: !0 });
  });
}
async function l3(y) {
  const { outputDevices: v } = await import("./output-devices-CMDZU3db.js"), S = ZS(mr, QS), _ = [...v.outputDevices].find(
    ($) => $.id === y
  );
  if (!_)
    throw new ReferenceError("Output device does not exist: " + y);
  v.activeDevice = _;
  const C = await S;
  if (C instanceof CustomEvent && C.detail === y)
    return y;
  throw new Error("Could not set new device.");
}
const ex = "active-device-mode-changed";
function c3(y) {
  return new CustomEvent(ex, {
    detail: y
  });
}
async function d3(y = "shared") {
  const { outputDevices: v } = await import("./output-devices-CMDZU3db.js"), S = ZS(mr, ex);
  v.deviceMode = y;
  const _ = await S;
  if (_ instanceof CustomEvent && _.detail === y)
    return y;
  throw new Error("Could not set new device mode.");
}
function f3(y) {
  jr({
    streamingWifiAudioQuality: y
  });
}
function h3(y) {
  jr({
    desiredVolumeLevel: y
  });
}
async function p3() {
  const y = await OS();
  Sg(y);
}
Dn.synchronize().then().catch(console.error);
function g3() {
  const { activePlayer: y } = et;
  if (!y)
    return null;
  switch (y.name) {
    case "browserPlayer":
      return y.mediaElement;
    case "shakaPlayer":
      return y.mediaElement;
    default:
      return null;
  }
}
function m3(y) {
  et.activePlayer = void 0, y.outputDevices === !0 && jr({ outputDevicesEnabled: !0 }), wP(y.players);
}
function ND() {
  const y = localStorage.getItem("ssuid");
  try {
    y && indexedDB.deleteDatabase("streaming-sessions-" + y);
  } catch (v) {
    console.warn(`DB streaming-sessions-${y} could not be deleted`), console.error(v);
  }
}
uP().then().catch(console.error);
lP().then().catch(console.error);
ND();
export {
  l3 as $,
  FS as A,
  VP as B,
  m3 as C,
  UD as D,
  _D as E,
  BD as F,
  g3 as G,
  FD as H,
  VD as I,
  HD as J,
  GD as K,
  KD as L,
  WD as M,
  zD as N,
  XD as O,
  yo as P,
  ZD as Q,
  e3 as R,
  CD as S,
  t3 as T,
  n3 as U,
  r3 as V,
  i3 as W,
  o3 as X,
  s3 as Y,
  u3 as Z,
  QD as _,
  et as a,
  d3 as a0,
  f3 as a1,
  h3 as a2,
  p3 as a3,
  c3 as b,
  a3 as c,
  aP as d,
  mr as e,
  PS as f,
  vr as g,
  Ar as h,
  pD as i,
  dd as j,
  qD as k,
  nP as l,
  vo as m,
  JD as n,
  Dn as o,
  CS as p,
  DD as q,
  OP as r,
  ai as s,
  RD as t,
  kD as u,
  bD as v,
  vg as w,
  YD as x,
  $D as y,
  dD as z
};
//# sourceMappingURL=index-CmV5XX7g.js.map