import et from "vue";
import ie, { ref as rA, getCurrentScope as oe, onScopeDispose as se, unref as re, watch as Pt, computed as HA, watchEffect as ae, onMounted as Qt, nextTick as ne, onUnmounted as ge, onActivated as Ie, onDeactivated as Be } from "@vue/composition-api/dist/vue-composition-api.mjs";
import Ot from "axios";
var GA, oA, sA, qA, UA, SA, vA, fA, dA, v, QA, q, cA, j, _A, IA, BA, jA;
window.JSMpeg = { Player: null, VideoElement: null, BitBuffer: null, Source: {}, Demuxer: {}, Decoder: {}, Renderer: {}, AudioOutput: {}, Now: function() {
  return window.performance ? window.performance.now() / 1e3 : Date.now() / 1e3;
}, CreateVideoElements: function() {
  for (var A = document.querySelectorAll(".jsmpeg"), t = 0; t < A.length; t++)
    new JSMpeg.VideoElement(A[t]);
}, Fill: function(A, t) {
  if (A.fill)
    A.fill(t);
  else
    for (var e = 0; e < A.length; e++)
      A[e] = t;
}, Base64ToArrayBuffer: function(A) {
  for (var t = window.atob(A), e = t.length, i = new Uint8Array(e), o = 0; o < e; o++)
    i[o] = t.charCodeAt(o);
  return i.buffer;
}, WASM_BINARY_INLINED: null }, document.readyState === "complete" ? JSMpeg.CreateVideoElements() : document.addEventListener("DOMContentLoaded", JSMpeg.CreateVideoElements), JSMpeg.VideoElement = ((GA = function(A) {
  var t = A.dataset.url;
  if (!t)
    throw "VideoElement has no `data-url` attribute";
  var e = function(h, B) {
    for (var p in B)
      h.style[p] = B[p];
  };
  this.container = A, e(this.container, { display: "inline-block", position: "relative", minWidth: "80px", minHeight: "80px" }), this.canvas = document.createElement("canvas"), this.canvas.width = 960, this.canvas.height = 540, e(this.canvas, { display: "block", width: "100%" }), this.container.appendChild(this.canvas), this.playButton = document.createElement("div"), this.playButton.innerHTML = GA.PLAY_BUTTON, e(this.playButton, { zIndex: 2, position: "absolute", top: "0", bottom: "0", left: "0", right: "0", maxWidth: "75px", maxHeight: "75px", margin: "auto", opacity: "0.7", cursor: "pointer" }), this.container.appendChild(this.playButton);
  var i = { canvas: this.canvas };
  for (var o in A.dataset)
    try {
      i[o] = JSON.parse(A.dataset[o]);
    } catch {
      i[o] = A.dataset[o];
    }
  if (this.player = new JSMpeg.Player(t, i), A.playerInstance = this.player, !i.poster || i.autoplay || this.player.options.streaming || (i.decodeFirstFrame = !1, this.poster = new Image(), this.poster.src = i.poster, this.poster.addEventListener("load", this.posterLoaded), e(this.poster, { display: "block", zIndex: 1, position: "absolute", top: 0, left: 0, bottom: 0, right: 0 }), this.container.appendChild(this.poster)), this.player.options.streaming || this.container.addEventListener("click", this.onClick.bind(this)), (i.autoplay || this.player.options.streaming) && (this.playButton.style.display = "none"), this.player.audioOut && !this.player.audioOut.unlocked) {
    var n = this.container;
    (i.autoplay || this.player.options.streaming) && (this.unmuteButton = document.createElement("div"), this.unmuteButton.innerHTML = GA.UNMUTE_BUTTON, e(this.unmuteButton, { zIndex: 2, position: "absolute", bottom: "10px", right: "20px", width: "75px", height: "75px", margin: "auto", opacity: "0.7", cursor: "pointer" }), this.container.appendChild(this.unmuteButton), n = this.unmuteButton), this.unlockAudioBound = this.onUnlockAudio.bind(this, n), n.addEventListener("touchstart", this.unlockAudioBound, !1), n.addEventListener("click", this.unlockAudioBound, !0);
  }
}).prototype.onUnlockAudio = function(A, t) {
  this.unmuteButton && (t.preventDefault(), t.stopPropagation()), this.player.audioOut.unlock(function() {
    this.unmuteButton && (this.unmuteButton.style.display = "none"), A.removeEventListener("touchstart", this.unlockAudioBound), A.removeEventListener("click", this.unlockAudioBound);
  }.bind(this));
}, GA.prototype.onClick = function(A) {
  this.player.isPlaying ? (this.player.pause(), this.playButton.style.display = "block") : (this.player.play(), this.playButton.style.display = "none", this.poster && (this.poster.style.display = "none"));
}, GA.PLAY_BUTTON = '<svg style="max-width: 75px; max-height: 75px;" viewBox="0 0 200 200" alt="Play video"><circle cx="100" cy="100" r="90" fill="none" stroke-width="15" stroke="#fff"/><polygon points="70, 55 70, 145 145, 100" fill="#fff"/></svg>', GA.UNMUTE_BUTTON = '<svg style="max-width: 75px; max-height: 75px;" viewBox="0 0 75 75"><polygon class="audio-speaker" stroke="none" fill="#fff" points="39,13 22,28 6,28 6,47 21,47 39,62 39,13"/><g stroke="#fff" stroke-width="5"><path d="M 49,50 69,26"/><path d="M 69,50 49,26"/></g></svg>', GA), JSMpeg.Player = ((oA = function(A, t) {
  if (this.options = t || {}, t.source ? (this.source = new t.source(A, t), t.streaming = !!this.source.streaming) : A.match(/^wss?:\/\//) ? (this.source = new JSMpeg.Source.WebSocket(A, t), t.streaming = !0) : t.progressive !== !1 ? (this.source = new JSMpeg.Source.AjaxProgressive(A, t), t.streaming = !1) : (this.source = new JSMpeg.Source.Ajax(A, t), t.streaming = !1), this.maxAudioLag = t.maxAudioLag || 0.25, this.loop = t.loop !== !1, this.autoplay = !!t.autoplay || t.streaming, this.demuxer = new JSMpeg.Demuxer.TS(t), this.source.connect(this.demuxer), !t.disableWebAssembly && JSMpeg.WASMModule.IsSupported() && (this.wasmModule = JSMpeg.WASMModule.GetModule(), t.wasmModule = this.wasmModule), t.video !== !1 && (this.video = t.wasmModule ? new JSMpeg.Decoder.MPEG1VideoWASM(t) : new JSMpeg.Decoder.MPEG1Video(t), this.renderer = !t.disableGl && JSMpeg.Renderer.WebGL.IsSupported() ? new JSMpeg.Renderer.WebGL(t) : new JSMpeg.Renderer.Canvas2D(t), this.demuxer.connect(JSMpeg.Demuxer.TS.STREAM.VIDEO_1, this.video), this.video.connect(this.renderer)), t.audio !== !1 && JSMpeg.AudioOutput.WebAudio.IsSupported() && (this.audio = t.wasmModule ? new JSMpeg.Decoder.MP2AudioWASM(t) : new JSMpeg.Decoder.MP2Audio(t), this.audioOut = new JSMpeg.AudioOutput.WebAudio(t), this.demuxer.connect(JSMpeg.Demuxer.TS.STREAM.AUDIO_1, this.audio), this.audio.connect(this.audioOut)), Object.defineProperty(this, "currentTime", { get: this.getCurrentTime, set: this.setCurrentTime }), Object.defineProperty(this, "volume", { get: this.getVolume, set: this.setVolume }), this.paused = !0, this.unpauseOnShow = !1, t.pauseWhenHidden !== !1 && document.addEventListener("visibilitychange", this.showHide.bind(this)), this.wasmModule)
    if (this.wasmModule.ready)
      this.startLoading();
    else if (JSMpeg.WASM_BINARY_INLINED) {
      var e = JSMpeg.Base64ToArrayBuffer(JSMpeg.WASM_BINARY_INLINED);
      this.wasmModule.loadFromBuffer(e, this.startLoading.bind(this));
    } else
      this.wasmModule.loadFromFile("jsmpeg.wasm", this.startLoading.bind(this));
  else
    this.startLoading();
}).prototype.startLoading = function() {
  this.source.start(), this.autoplay && this.play();
}, oA.prototype.showHide = function(A) {
  document.visibilityState === "hidden" ? (this.unpauseOnShow = this.wantsToPlay, this.pause()) : this.unpauseOnShow && this.play();
}, oA.prototype.play = function(A) {
  this.animationId || (this.animationId = requestAnimationFrame(this.update.bind(this)), this.wantsToPlay = !0, this.paused = !1);
}, oA.prototype.pause = function(A) {
  this.paused || (cancelAnimationFrame(this.animationId), this.animationId = null, this.wantsToPlay = !1, this.isPlaying = !1, this.paused = !0, this.audio && this.audio.canPlay && (this.audioOut.stop(), this.seek(this.currentTime)), this.options.onPause && this.options.onPause(this));
}, oA.prototype.getVolume = function() {
  return this.audioOut ? this.audioOut.volume : 0;
}, oA.prototype.setVolume = function(A) {
  this.audioOut && (this.audioOut.volume = A);
}, oA.prototype.stop = function(A) {
  this.pause(), this.seek(0), this.video && this.options.decodeFirstFrame !== !1 && this.video.decode();
}, oA.prototype.destroy = function() {
  this.pause(), this.source.destroy(), this.video && this.video.destroy(), this.renderer && this.renderer.destroy(), this.audio && this.audio.destroy(), this.audioOut && this.audioOut.destroy();
}, oA.prototype.seek = function(A) {
  var t = this.audio && this.audio.canPlay ? this.audio.startTime : this.video.startTime;
  this.video && this.video.seek(A + t), this.audio && this.audio.seek(A + t), this.startTime = JSMpeg.Now() - A;
}, oA.prototype.getCurrentTime = function() {
  return this.audio && this.audio.canPlay ? this.audio.currentTime - this.audio.startTime : this.video.currentTime - this.video.startTime;
}, oA.prototype.setCurrentTime = function(A) {
  this.seek(A);
}, oA.prototype.update = function() {
  this.animationId = requestAnimationFrame(this.update.bind(this)), this.source.established ? (this.isPlaying || (this.isPlaying = !0, this.startTime = JSMpeg.Now() - this.currentTime, this.options.onPlay && this.options.onPlay(this)), this.options.streaming ? this.updateForStreaming() : this.updateForStaticFile()) : this.renderer && this.renderer.renderProgress(this.source.progress);
}, oA.prototype.updateForStreaming = function() {
  if (this.video && this.video.decode(), this.audio) {
    var A = !1;
    do
      this.audioOut.enqueuedTime > this.maxAudioLag && (this.audioOut.resetEnqueuedTime(), this.audioOut.enabled = !1), A = this.audio.decode();
    while (A);
    this.audioOut.enabled = !0;
  }
}, oA.prototype.nextFrame = function() {
  return !(!this.source.established || !this.video) && this.video.decode();
}, oA.prototype.updateForStaticFile = function() {
  var A = !1, t = 0;
  if (this.audio && this.audio.canPlay) {
    for (; !A && this.audio.decodedTime - this.audio.currentTime < 0.25; )
      A = !this.audio.decode();
    this.video && this.video.currentTime < this.audio.currentTime && (A = !this.video.decode()), t = this.demuxer.currentTime - this.audio.currentTime;
  } else if (this.video) {
    var e = JSMpeg.Now() - this.startTime + this.video.startTime, i = e - this.video.currentTime, o = 1 / this.video.frameRate;
    this.video && i > 0 && (i > 2 * o && (this.startTime += i), A = !this.video.decode()), t = this.demuxer.currentTime - e;
  }
  this.source.resume(t), A && this.source.completed ? this.loop ? this.seek(0) : (this.pause(), this.options.onEnded && this.options.onEnded(this)) : A && this.options.onStalled && this.options.onStalled(this);
}, oA), JSMpeg.BitBuffer = ((sA = function(A, t) {
  typeof A == "object" ? (this.bytes = A instanceof Uint8Array ? A : new Uint8Array(A), this.byteLength = this.bytes.length) : (this.bytes = new Uint8Array(A || 1048576), this.byteLength = 0), this.mode = t || sA.MODE.EXPAND, this.index = 0;
}).prototype.resize = function(A) {
  var t = new Uint8Array(A);
  this.byteLength !== 0 && (this.byteLength = Math.min(this.byteLength, A), t.set(this.bytes, 0, this.byteLength)), this.bytes = t, this.index = Math.min(this.index, this.byteLength << 3);
}, sA.prototype.evict = function(A) {
  var t = this.index >> 3, e = this.bytes.length - this.byteLength;
  if (this.index === this.byteLength << 3 || A > e + t)
    return this.byteLength = 0, void (this.index = 0);
  t !== 0 && (this.bytes.copyWithin ? this.bytes.copyWithin(0, t, this.byteLength) : this.bytes.set(this.bytes.subarray(t, this.byteLength)), this.byteLength = this.byteLength - t, this.index -= t << 3);
}, sA.prototype.write = function(A) {
  var t = typeof A[0] == "object", e = 0, i = this.bytes.length - this.byteLength;
  if (t) {
    e = 0;
    for (var o = 0; o < A.length; o++)
      e += A[o].byteLength;
  } else
    e = A.byteLength;
  if (e > i)
    if (this.mode === sA.MODE.EXPAND) {
      var n = Math.max(2 * this.bytes.length, e - i);
      this.resize(n);
    } else
      this.evict(e);
  if (t)
    for (o = 0; o < A.length; o++)
      this.appendSingleBuffer(A[o]);
  else
    this.appendSingleBuffer(A);
  return e;
}, sA.prototype.appendSingleBuffer = function(A) {
  A = A instanceof Uint8Array ? A : new Uint8Array(A), this.bytes.set(A, this.byteLength), this.byteLength += A.length;
}, sA.prototype.findNextStartCode = function() {
  for (var A = this.index + 7 >> 3; A < this.byteLength; A++)
    if (this.bytes[A] == 0 && this.bytes[A + 1] == 0 && this.bytes[A + 2] == 1)
      return this.index = A + 4 << 3, this.bytes[A + 3];
  return this.index = this.byteLength << 3, -1;
}, sA.prototype.findStartCode = function(A) {
  for (var t = 0; ; )
    if ((t = this.findNextStartCode()) === A || t === -1)
      return t;
  return -1;
}, sA.prototype.nextBytesAreStartCode = function() {
  var A = this.index + 7 >> 3;
  return A >= this.byteLength || this.bytes[A] == 0 && this.bytes[A + 1] == 0 && this.bytes[A + 2] == 1;
}, sA.prototype.peek = function(A) {
  for (var t = this.index, e = 0; A; ) {
    var i = 8 - (7 & t), o = i < A ? i : A, n = i - o;
    e = e << o | (this.bytes[t >> 3] & 255 >> 8 - o << n) >> n, t += o, A -= o;
  }
  return e;
}, sA.prototype.read = function(A) {
  var t = this.peek(A);
  return this.index += A, t;
}, sA.prototype.skip = function(A) {
  return this.index += A;
}, sA.prototype.rewind = function(A) {
  this.index = Math.max(this.index - A, 0);
}, sA.prototype.has = function(A) {
  return (this.byteLength << 3) - this.index >= A;
}, sA.MODE = { EVICT: 1, EXPAND: 2 }, sA), JSMpeg.Source.Ajax = ((qA = function(A, t) {
  this.url = A, this.destination = null, this.request = null, this.streaming = !1, this.completed = !1, this.established = !1, this.progress = 0, this.onEstablishedCallback = t.onSourceEstablished, this.onCompletedCallback = t.onSourceCompleted;
}).prototype.connect = function(A) {
  this.destination = A;
}, qA.prototype.start = function() {
  this.request = new XMLHttpRequest(), this.request.onreadystatechange = function() {
    this.request.readyState === this.request.DONE && this.request.status === 200 && this.onLoad(this.request.response);
  }.bind(this), this.request.onprogress = this.onProgress.bind(this), this.request.open("GET", this.url), this.request.responseType = "arraybuffer", this.request.send();
}, qA.prototype.resume = function(A) {
}, qA.prototype.destroy = function() {
  this.request.abort();
}, qA.prototype.onProgress = function(A) {
  this.progress = A.loaded / A.total;
}, qA.prototype.onLoad = function(A) {
  this.established = !0, this.completed = !0, this.progress = 1, this.onEstablishedCallback && this.onEstablishedCallback(this), this.onCompletedCallback && this.onCompletedCallback(this), this.destination && this.destination.write(A);
}, qA), JSMpeg.Source.Fetch = ((UA = function(A, t) {
  this.url = A, this.destination = null, this.request = null, this.streaming = !0, this.completed = !1, this.established = !1, this.progress = 0, this.aborted = !1, this.onEstablishedCallback = t.onSourceEstablished, this.onCompletedCallback = t.onSourceCompleted;
}).prototype.connect = function(A) {
  this.destination = A;
}, UA.prototype.start = function() {
  var A = { method: "GET", headers: new Headers(), cache: "default" };
  self.fetch(this.url, A).then(function(t) {
    if (t.ok && t.status >= 200 && t.status <= 299)
      return this.progress = 1, this.established = !0, this.pump(t.body.getReader());
  }.bind(this)).catch(function(t) {
    throw t;
  });
}, UA.prototype.pump = function(A) {
  return A.read().then(function(t) {
    if (!t.done)
      return this.aborted ? A.cancel() : (this.destination && this.destination.write(t.value.buffer), this.pump(A));
    this.completed = !0;
  }.bind(this)).catch(function(t) {
    throw t;
  });
}, UA.prototype.resume = function(A) {
}, UA.prototype.abort = function() {
  this.aborted = !0;
}, UA), JSMpeg.Source.AjaxProgressive = ((SA = function(A, t) {
  this.url = A, this.destination = null, this.request = null, this.streaming = !1, this.completed = !1, this.established = !1, this.progress = 0, this.fileSize = 0, this.loadedSize = 0, this.chunkSize = t.chunkSize || 1048576, this.isLoading = !1, this.loadStartTime = 0, this.throttled = t.throttled !== !1, this.aborted = !1, this.onEstablishedCallback = t.onSourceEstablished, this.onCompletedCallback = t.onSourceCompleted;
}).prototype.connect = function(A) {
  this.destination = A;
}, SA.prototype.start = function() {
  this.request = new XMLHttpRequest(), this.request.onreadystatechange = function() {
    this.request.readyState === this.request.DONE && (this.fileSize = parseInt(this.request.getResponseHeader("Content-Length")), this.loadNextChunk());
  }.bind(this), this.request.onprogress = this.onProgress.bind(this), this.request.open("HEAD", this.url), this.request.send();
}, SA.prototype.resume = function(A) {
  !this.isLoading && this.throttled && 8 * this.loadTime + 2 > A && this.loadNextChunk();
}, SA.prototype.destroy = function() {
  this.request.abort(), this.aborted = !0;
}, SA.prototype.loadNextChunk = function() {
  var A = this.loadedSize, t = Math.min(this.loadedSize + this.chunkSize - 1, this.fileSize - 1);
  if (A >= this.fileSize || this.aborted)
    return this.completed = !0, void (this.onCompletedCallback && this.onCompletedCallback(this));
  this.isLoading = !0, this.loadStartTime = JSMpeg.Now(), this.request = new XMLHttpRequest(), this.request.onreadystatechange = function() {
    this.request.readyState === this.request.DONE && this.request.status >= 200 && this.request.status < 300 ? this.onChunkLoad(this.request.response) : this.request.readyState === this.request.DONE && this.loadFails++ < 3 && this.loadNextChunk();
  }.bind(this), A === 0 && (this.request.onprogress = this.onProgress.bind(this)), this.request.open("GET", this.url + "?" + A + "-" + t), this.request.setRequestHeader("Range", "bytes=" + A + "-" + t), this.request.responseType = "arraybuffer", this.request.send();
}, SA.prototype.onProgress = function(A) {
  this.progress = A.loaded / A.total;
}, SA.prototype.onChunkLoad = function(A) {
  var t = !this.established;
  this.established = !0, this.progress = 1, this.loadedSize += A.byteLength, this.loadFails = 0, this.isLoading = !1, t && this.onEstablishedCallback && this.onEstablishedCallback(this), this.destination && this.destination.write(A), this.loadTime = JSMpeg.Now() - this.loadStartTime, this.throttled || this.loadNextChunk();
}, SA), JSMpeg.Source.WebSocket = ((vA = function(A, t) {
  this.url = A, this.options = t, this.socket = null, this.streaming = !0, this.callbacks = { connect: [], data: [] }, this.destination = null, this.reconnectInterval = t.reconnectInterval !== void 0 ? t.reconnectInterval : 5, this.shouldAttemptReconnect = !!this.reconnectInterval, this.completed = !1, this.established = !1, this.progress = 0, this.reconnectTimeoutId = 0, this.onEstablishedCallback = t.onSourceEstablished, this.onCompletedCallback = t.onSourceCompleted;
}).prototype.connect = function(A) {
  this.destination = A;
}, vA.prototype.destroy = function() {
  clearTimeout(this.reconnectTimeoutId), this.shouldAttemptReconnect = !1, this.socket.close();
}, vA.prototype.start = function() {
  this.shouldAttemptReconnect = !!this.reconnectInterval, this.progress = 0, this.established = !1, this.options.protocols ? this.socket = new WebSocket(this.url, this.options.protocols) : this.socket = new WebSocket(this.url), this.socket.binaryType = "arraybuffer", this.socket.onmessage = this.onMessage.bind(this), this.socket.onopen = this.onOpen.bind(this), this.socket.onerror = this.onClose.bind(this), this.socket.onclose = this.onClose.bind(this);
}, vA.prototype.resume = function(A) {
}, vA.prototype.onOpen = function() {
  this.progress = 1;
}, vA.prototype.onClose = function() {
  this.shouldAttemptReconnect && (clearTimeout(this.reconnectTimeoutId), this.reconnectTimeoutId = setTimeout(function() {
    this.start();
  }.bind(this), 1e3 * this.reconnectInterval));
}, vA.prototype.onMessage = function(A) {
  var t = !this.established;
  this.established = !0, t && this.onEstablishedCallback && this.onEstablishedCallback(this), this.destination && this.destination.write(A.data);
}, vA), JSMpeg.Demuxer.TS = ((fA = function(A) {
  this.bits = null, this.leftoverBytes = null, this.guessVideoFrameEnd = !0, this.pidsToStreamIds = {}, this.pesPacketInfo = {}, this.startTime = 0, this.currentTime = 0;
}).prototype.connect = function(A, t) {
  this.pesPacketInfo[A] = { destination: t, currentLength: 0, totalLength: 0, pts: 0, buffers: [] };
}, fA.prototype.write = function(A) {
  if (this.leftoverBytes) {
    var t = A.byteLength + this.leftoverBytes.byteLength;
    this.bits = new JSMpeg.BitBuffer(t), this.bits.write([this.leftoverBytes, A]);
  } else
    this.bits = new JSMpeg.BitBuffer(A);
  for (; this.bits.has(1504) && this.parsePacket(); )
    ;
  var e = this.bits.byteLength - (this.bits.index >> 3);
  this.leftoverBytes = e > 0 ? this.bits.bytes.subarray(this.bits.index >> 3) : null;
}, fA.prototype.parsePacket = function() {
  if (this.bits.read(8) !== 71 && !this.resync())
    return !1;
  var A = 187 + (this.bits.index >> 3);
  this.bits.read(1);
  var t = this.bits.read(1);
  this.bits.read(1);
  var e = this.bits.read(13);
  this.bits.read(2);
  var i = this.bits.read(2);
  this.bits.read(4);
  var o = this.pidsToStreamIds[e];
  if (t && o && (S = this.pesPacketInfo[o]) && S.currentLength && this.packetComplete(S), 1 & i) {
    if (2 & i) {
      var n = this.bits.read(8);
      this.bits.skip(n << 3);
    }
    if (t && this.bits.nextBytesAreStartCode()) {
      this.bits.skip(24), o = this.bits.read(8), this.pidsToStreamIds[e] = o;
      var h = this.bits.read(16);
      this.bits.skip(8);
      var B = this.bits.read(2);
      this.bits.skip(6);
      var p = this.bits.read(8), c = this.bits.index + (p << 3);
      if (S = this.pesPacketInfo[o]) {
        var E = 0;
        if (2 & B) {
          this.bits.skip(4);
          var I = this.bits.read(3);
          this.bits.skip(1);
          var l = this.bits.read(15);
          this.bits.skip(1);
          var d = this.bits.read(15);
          this.bits.skip(1), E = (1073741824 * I + 32768 * l + d) / 9e4, this.currentTime = E, this.startTime === -1 && (this.startTime = E);
        }
        var g = h ? h - p - 3 : 0;
        this.packetStart(S, E, g);
      }
      this.bits.index = c;
    }
    var S;
    if (o && (S = this.pesPacketInfo[o])) {
      var s = this.bits.index >> 3, r = !t && 2 & i;
      (this.packetAddData(S, s, A) || this.guessVideoFrameEnd && r) && this.packetComplete(S);
    }
  }
  return this.bits.index = A << 3, !0;
}, fA.prototype.resync = function() {
  if (!this.bits.has(9024))
    return !1;
  for (var A = this.bits.index >> 3, t = 0; t < 187; t++)
    if (this.bits.bytes[A + t] === 71) {
      for (var e = !0, i = 1; i < 5; i++)
        if (this.bits.bytes[A + t + 188 * i] !== 71) {
          e = !1;
          break;
        }
      if (e)
        return this.bits.index = A + t + 1 << 3, !0;
    }
  return this.bits.skip(1496), !1;
}, fA.prototype.packetStart = function(A, t, e) {
  A.totalLength = e, A.currentLength = 0, A.pts = t;
}, fA.prototype.packetAddData = function(A, t, e) {
  return A.buffers.push(this.bits.bytes.subarray(t, e)), A.currentLength += e - t, A.totalLength !== 0 && A.currentLength >= A.totalLength;
}, fA.prototype.packetComplete = function(A) {
  A.destination.write(A.pts, A.buffers), A.totalLength = 0, A.currentLength = 0, A.buffers = [];
}, fA.STREAM = { PACK_HEADER: 186, SYSTEM_HEADER: 187, PROGRAM_MAP: 188, PRIVATE_1: 189, PADDING: 190, PRIVATE_2: 191, AUDIO_1: 192, VIDEO_1: 224, DIRECTORY: 255 }, fA), JSMpeg.Decoder.Base = ((dA = function(A) {
  this.destination = null, this.canPlay = !1, this.collectTimestamps = !A.streaming, this.bytesWritten = 0, this.timestamps = [], this.timestampIndex = 0, this.startTime = 0, this.decodedTime = 0, Object.defineProperty(this, "currentTime", { get: this.getCurrentTime });
}).prototype.destroy = function() {
}, dA.prototype.connect = function(A) {
  this.destination = A;
}, dA.prototype.bufferGetIndex = function() {
  return this.bits.index;
}, dA.prototype.bufferSetIndex = function(A) {
  this.bits.index = A;
}, dA.prototype.bufferWrite = function(A) {
  return this.bits.write(A);
}, dA.prototype.write = function(A, t) {
  this.collectTimestamps && (this.timestamps.length === 0 && (this.startTime = A, this.decodedTime = A), this.timestamps.push({ index: this.bytesWritten << 3, time: A })), this.bytesWritten += this.bufferWrite(t), this.canPlay = !0;
}, dA.prototype.seek = function(A) {
  if (this.collectTimestamps) {
    this.timestampIndex = 0;
    for (var t = 0; t < this.timestamps.length && !(this.timestamps[t].time > A); t++)
      this.timestampIndex = t;
    var e = this.timestamps[this.timestampIndex];
    e ? (this.bufferSetIndex(e.index), this.decodedTime = e.time) : (this.bufferSetIndex(0), this.decodedTime = this.startTime);
  }
}, dA.prototype.decode = function() {
  this.advanceDecodedTime(0);
}, dA.prototype.advanceDecodedTime = function(A) {
  if (this.collectTimestamps) {
    for (var t = -1, e = this.bufferGetIndex(), i = this.timestampIndex; i < this.timestamps.length && !(this.timestamps[i].index > e); i++)
      t = i;
    if (t !== -1 && t !== this.timestampIndex)
      return this.timestampIndex = t, void (this.decodedTime = this.timestamps[this.timestampIndex].time);
  }
  this.decodedTime += A;
}, dA.prototype.getCurrentTime = function() {
  return this.decodedTime;
}, dA), JSMpeg.Decoder.MPEG1Video = (((v = function(A) {
  JSMpeg.Decoder.Base.call(this, A), this.onDecodeCallback = A.onVideoDecode;
  var t = A.videoBufferSize || 524288, e = A.streaming ? JSMpeg.BitBuffer.MODE.EVICT : JSMpeg.BitBuffer.MODE.EXPAND;
  this.bits = new JSMpeg.BitBuffer(t, e), this.customIntraQuantMatrix = new Uint8Array(64), this.customNonIntraQuantMatrix = new Uint8Array(64), this.blockData = new Int32Array(64), this.currentFrame = 0, this.decodeFirstFrame = A.decodeFirstFrame !== !1;
}).prototype = Object.create(JSMpeg.Decoder.Base.prototype)).constructor = v, v.prototype.write = function(A, t) {
  if (JSMpeg.Decoder.Base.prototype.write.call(this, A, t), !this.hasSequenceHeader) {
    if (this.bits.findStartCode(v.START.SEQUENCE) === -1)
      return !1;
    this.decodeSequenceHeader(), this.decodeFirstFrame && this.decode();
  }
}, v.prototype.decode = function() {
  var A = JSMpeg.Now();
  if (!this.hasSequenceHeader)
    return !1;
  if (this.bits.findStartCode(v.START.PICTURE) === -1)
    return this.bits.byteLength, this.bits.index, !1;
  this.decodePicture(), this.advanceDecodedTime(1 / this.frameRate);
  var t = JSMpeg.Now() - A;
  return this.onDecodeCallback && this.onDecodeCallback(this, t), !0;
}, v.prototype.readHuffman = function(A) {
  var t = 0;
  do
    t = A[t + this.bits.read(1)];
  while (t >= 0 && A[t] !== 0);
  return A[t + 2];
}, v.prototype.frameRate = 30, v.prototype.decodeSequenceHeader = function() {
  var A = this.bits.read(12), t = this.bits.read(12);
  if (this.bits.skip(4), this.frameRate = v.PICTURE_RATE[this.bits.read(4)], this.bits.skip(30), A === this.width && t === this.height || (this.width = A, this.height = t, this.initBuffers(), this.destination && this.destination.resize(A, t)), this.bits.read(1)) {
    for (var e = 0; e < 64; e++)
      this.customIntraQuantMatrix[v.ZIG_ZAG[e]] = this.bits.read(8);
    this.intraQuantMatrix = this.customIntraQuantMatrix;
  }
  if (this.bits.read(1)) {
    for (e = 0; e < 64; e++) {
      var i = v.ZIG_ZAG[e];
      this.customNonIntraQuantMatrix[i] = this.bits.read(8);
    }
    this.nonIntraQuantMatrix = this.customNonIntraQuantMatrix;
  }
  this.hasSequenceHeader = !0;
}, v.prototype.initBuffers = function() {
  this.intraQuantMatrix = v.DEFAULT_INTRA_QUANT_MATRIX, this.nonIntraQuantMatrix = v.DEFAULT_NON_INTRA_QUANT_MATRIX, this.mbWidth = this.width + 15 >> 4, this.mbHeight = this.height + 15 >> 4, this.mbSize = this.mbWidth * this.mbHeight, this.codedWidth = this.mbWidth << 4, this.codedHeight = this.mbHeight << 4, this.codedSize = this.codedWidth * this.codedHeight, this.halfWidth = this.mbWidth << 3, this.halfHeight = this.mbHeight << 3, this.currentY = new Uint8ClampedArray(this.codedSize), this.currentY32 = new Uint32Array(this.currentY.buffer), this.currentCr = new Uint8ClampedArray(this.codedSize >> 2), this.currentCr32 = new Uint32Array(this.currentCr.buffer), this.currentCb = new Uint8ClampedArray(this.codedSize >> 2), this.currentCb32 = new Uint32Array(this.currentCb.buffer), this.forwardY = new Uint8ClampedArray(this.codedSize), this.forwardY32 = new Uint32Array(this.forwardY.buffer), this.forwardCr = new Uint8ClampedArray(this.codedSize >> 2), this.forwardCr32 = new Uint32Array(this.forwardCr.buffer), this.forwardCb = new Uint8ClampedArray(this.codedSize >> 2), this.forwardCb32 = new Uint32Array(this.forwardCb.buffer);
}, v.prototype.currentY = null, v.prototype.currentCr = null, v.prototype.currentCb = null, v.prototype.pictureType = 0, v.prototype.forwardY = null, v.prototype.forwardCr = null, v.prototype.forwardCb = null, v.prototype.fullPelForward = !1, v.prototype.forwardFCode = 0, v.prototype.forwardRSize = 0, v.prototype.forwardF = 0, v.prototype.decodePicture = function(A) {
  if (this.currentFrame++, this.bits.skip(10), this.pictureType = this.bits.read(3), this.bits.skip(16), !(this.pictureType <= 0 || this.pictureType >= v.PICTURE_TYPE.B)) {
    if (this.pictureType === v.PICTURE_TYPE.PREDICTIVE) {
      if (this.fullPelForward = this.bits.read(1), this.forwardFCode = this.bits.read(3), this.forwardFCode === 0)
        return;
      this.forwardRSize = this.forwardFCode - 1, this.forwardF = 1 << this.forwardRSize;
    }
    var t = 0;
    do
      t = this.bits.findNextStartCode();
    while (t === v.START.EXTENSION || t === v.START.USER_DATA);
    for (; t >= v.START.SLICE_FIRST && t <= v.START.SLICE_LAST; )
      this.decodeSlice(255 & t), t = this.bits.findNextStartCode();
    if (t !== -1 && this.bits.rewind(32), this.destination && this.destination.render(this.currentY, this.currentCr, this.currentCb, !0), this.pictureType === v.PICTURE_TYPE.INTRA || this.pictureType === v.PICTURE_TYPE.PREDICTIVE) {
      var e = this.forwardY, i = this.forwardY32, o = this.forwardCr, n = this.forwardCr32, h = this.forwardCb, B = this.forwardCb32;
      this.forwardY = this.currentY, this.forwardY32 = this.currentY32, this.forwardCr = this.currentCr, this.forwardCr32 = this.currentCr32, this.forwardCb = this.currentCb, this.forwardCb32 = this.currentCb32, this.currentY = e, this.currentY32 = i, this.currentCr = o, this.currentCr32 = n, this.currentCb = h, this.currentCb32 = B;
    }
  }
}, v.prototype.quantizerScale = 0, v.prototype.sliceBegin = !1, v.prototype.decodeSlice = function(A) {
  for (this.sliceBegin = !0, this.macroblockAddress = (A - 1) * this.mbWidth - 1, this.motionFwH = this.motionFwHPrev = 0, this.motionFwV = this.motionFwVPrev = 0, this.dcPredictorY = 128, this.dcPredictorCr = 128, this.dcPredictorCb = 128, this.quantizerScale = this.bits.read(5); this.bits.read(1); )
    this.bits.skip(8);
  do
    this.decodeMacroblock();
  while (!this.bits.nextBytesAreStartCode());
}, v.prototype.macroblockAddress = 0, v.prototype.mbRow = 0, v.prototype.mbCol = 0, v.prototype.macroblockType = 0, v.prototype.macroblockIntra = !1, v.prototype.macroblockMotFw = !1, v.prototype.motionFwH = 0, v.prototype.motionFwV = 0, v.prototype.motionFwHPrev = 0, v.prototype.motionFwVPrev = 0, v.prototype.decodeMacroblock = function() {
  for (var A = 0, t = this.readHuffman(v.MACROBLOCK_ADDRESS_INCREMENT); t === 34; )
    t = this.readHuffman(v.MACROBLOCK_ADDRESS_INCREMENT);
  for (; t === 35; )
    A += 33, t = this.readHuffman(v.MACROBLOCK_ADDRESS_INCREMENT);
  if (A += t, this.sliceBegin)
    this.sliceBegin = !1, this.macroblockAddress += A;
  else {
    if (this.macroblockAddress + A >= this.mbSize)
      return;
    for (A > 1 && (this.dcPredictorY = 128, this.dcPredictorCr = 128, this.dcPredictorCb = 128, this.pictureType === v.PICTURE_TYPE.PREDICTIVE && (this.motionFwH = this.motionFwHPrev = 0, this.motionFwV = this.motionFwVPrev = 0)); A > 1; )
      this.macroblockAddress++, this.mbRow = this.macroblockAddress / this.mbWidth | 0, this.mbCol = this.macroblockAddress % this.mbWidth, this.copyMacroblock(this.motionFwH, this.motionFwV, this.forwardY, this.forwardCr, this.forwardCb), A--;
    this.macroblockAddress++;
  }
  this.mbRow = this.macroblockAddress / this.mbWidth | 0, this.mbCol = this.macroblockAddress % this.mbWidth;
  var e = v.MACROBLOCK_TYPE[this.pictureType];
  this.macroblockType = this.readHuffman(e), this.macroblockIntra = 1 & this.macroblockType, this.macroblockMotFw = 8 & this.macroblockType, 16 & this.macroblockType && (this.quantizerScale = this.bits.read(5)), this.macroblockIntra ? (this.motionFwH = this.motionFwHPrev = 0, this.motionFwV = this.motionFwVPrev = 0) : (this.dcPredictorY = 128, this.dcPredictorCr = 128, this.dcPredictorCb = 128, this.decodeMotionVectors(), this.copyMacroblock(this.motionFwH, this.motionFwV, this.forwardY, this.forwardCr, this.forwardCb));
  for (var i = 2 & this.macroblockType ? this.readHuffman(v.CODE_BLOCK_PATTERN) : this.macroblockIntra ? 63 : 0, o = 0, n = 32; o < 6; o++)
    i & n && this.decodeBlock(o), n >>= 1;
}, v.prototype.decodeMotionVectors = function() {
  var A, t, e = 0;
  this.macroblockMotFw ? ((A = this.readHuffman(v.MOTION)) !== 0 && this.forwardF !== 1 ? (e = this.bits.read(this.forwardRSize), t = (Math.abs(A) - 1 << this.forwardRSize) + e + 1, A < 0 && (t = -t)) : t = A, this.motionFwHPrev += t, this.motionFwHPrev > (this.forwardF << 4) - 1 ? this.motionFwHPrev -= this.forwardF << 5 : this.motionFwHPrev < -this.forwardF << 4 && (this.motionFwHPrev += this.forwardF << 5), this.motionFwH = this.motionFwHPrev, this.fullPelForward && (this.motionFwH <<= 1), (A = this.readHuffman(v.MOTION)) !== 0 && this.forwardF !== 1 ? (e = this.bits.read(this.forwardRSize), t = (Math.abs(A) - 1 << this.forwardRSize) + e + 1, A < 0 && (t = -t)) : t = A, this.motionFwVPrev += t, this.motionFwVPrev > (this.forwardF << 4) - 1 ? this.motionFwVPrev -= this.forwardF << 5 : this.motionFwVPrev < -this.forwardF << 4 && (this.motionFwVPrev += this.forwardF << 5), this.motionFwV = this.motionFwVPrev, this.fullPelForward && (this.motionFwV <<= 1)) : this.pictureType === v.PICTURE_TYPE.PREDICTIVE && (this.motionFwH = this.motionFwHPrev = 0, this.motionFwV = this.motionFwVPrev = 0);
}, v.prototype.copyMacroblock = function(A, t, e, i, o) {
  var n, h, B, p, c, E, I, l, d, g, S, s, r, Q, a, C, u, f, m, y = this.currentY32, F = this.currentCb32, G = this.currentCr32;
  if (h = (n = this.codedWidth) - 16, B = A >> 1, p = t >> 1, c = (1 & A) == 1, E = (1 & t) == 1, I = ((this.mbRow << 4) + p) * n + (this.mbCol << 4) + B, d = (l = this.mbRow * n + this.mbCol << 2) + (n << 2), c)
    if (E)
      for (; l < d; ) {
        for (S = e[I] + e[I + n], I++, g = 0; g < 4; g++)
          r = S + (s = e[I] + e[I + n]) + 2 >> 2 & 255, r |= (S = e[++I] + e[I + n]) + s + 2 << 6 & 65280, r |= S + (s = e[++I] + e[I + n]) + 2 << 14 & 16711680, S = e[++I] + e[I + n], I++, r |= S + s + 2 << 22 & 4278190080, y[l++] = r;
        l += h >> 2, I += h - 1;
      }
    else
      for (; l < d; ) {
        for (S = e[I++], g = 0; g < 4; g++)
          r = S + (s = e[I++]) + 1 >> 1 & 255, r |= (S = e[I++]) + s + 1 << 7 & 65280, r |= S + (s = e[I++]) + 1 << 15 & 16711680, r |= (S = e[I++]) + s + 1 << 23 & 4278190080, y[l++] = r;
        l += h >> 2, I += h - 1;
      }
  else if (E)
    for (; l < d; ) {
      for (g = 0; g < 4; g++)
        r = e[I] + e[I + n] + 1 >> 1 & 255, r |= e[++I] + e[I + n] + 1 << 7 & 65280, r |= e[++I] + e[I + n] + 1 << 15 & 16711680, r |= e[++I] + e[I + n] + 1 << 23 & 4278190080, I++, y[l++] = r;
      l += h >> 2, I += h;
    }
  else
    for (; l < d; ) {
      for (g = 0; g < 4; g++)
        r = e[I], r |= e[++I] << 8, r |= e[++I] << 16, r |= e[++I] << 24, I++, y[l++] = r;
      l += h >> 2, I += h;
    }
  if (h = (n = this.halfWidth) - 8, B = A / 2 >> 1, p = t / 2 >> 1, c = (A / 2 & 1) == 1, E = (t / 2 & 1) == 1, I = ((this.mbRow << 3) + p) * n + (this.mbCol << 3) + B, d = (l = this.mbRow * n + this.mbCol << 1) + (n << 1), c)
    if (E)
      for (; l < d; ) {
        for (Q = i[I] + i[I + n], u = o[I] + o[I + n], I++, g = 0; g < 2; g++)
          C = Q + (a = i[I] + i[I + n]) + 2 >> 2 & 255, m = u + (f = o[I] + o[I + n]) + 2 >> 2 & 255, C |= (Q = i[++I] + i[I + n]) + a + 2 << 6 & 65280, m |= (u = o[I] + o[I + n]) + f + 2 << 6 & 65280, C |= Q + (a = i[++I] + i[I + n]) + 2 << 14 & 16711680, m |= u + (f = o[I] + o[I + n]) + 2 << 14 & 16711680, Q = i[++I] + i[I + n], u = o[I] + o[I + n], I++, C |= Q + a + 2 << 22 & 4278190080, m |= u + f + 2 << 22 & 4278190080, G[l] = C, F[l] = m, l++;
        l += h >> 2, I += h - 1;
      }
    else
      for (; l < d; ) {
        for (Q = i[I], u = o[I], I++, g = 0; g < 2; g++)
          C = Q + (a = i[I]) + 1 >> 1 & 255, m = u + (f = o[I++]) + 1 >> 1 & 255, C |= (Q = i[I]) + a + 1 << 7 & 65280, m |= (u = o[I++]) + f + 1 << 7 & 65280, C |= Q + (a = i[I]) + 1 << 15 & 16711680, m |= u + (f = o[I++]) + 1 << 15 & 16711680, C |= (Q = i[I]) + a + 1 << 23 & 4278190080, m |= (u = o[I++]) + f + 1 << 23 & 4278190080, G[l] = C, F[l] = m, l++;
        l += h >> 2, I += h - 1;
      }
  else if (E)
    for (; l < d; ) {
      for (g = 0; g < 2; g++)
        C = i[I] + i[I + n] + 1 >> 1 & 255, m = o[I] + o[I + n] + 1 >> 1 & 255, C |= i[++I] + i[I + n] + 1 << 7 & 65280, m |= o[I] + o[I + n] + 1 << 7 & 65280, C |= i[++I] + i[I + n] + 1 << 15 & 16711680, m |= o[I] + o[I + n] + 1 << 15 & 16711680, C |= i[++I] + i[I + n] + 1 << 23 & 4278190080, m |= o[I] + o[I + n] + 1 << 23 & 4278190080, I++, G[l] = C, F[l] = m, l++;
      l += h >> 2, I += h;
    }
  else
    for (; l < d; ) {
      for (g = 0; g < 2; g++)
        C = i[I], m = o[I], C |= i[++I] << 8, m |= o[I] << 8, C |= i[++I] << 16, m |= o[I] << 16, C |= i[++I] << 24, m |= o[I] << 24, I++, G[l] = C, F[l] = m, l++;
      l += h >> 2, I += h;
    }
}, v.prototype.dcPredictorY = 0, v.prototype.dcPredictorCr = 0, v.prototype.dcPredictorCb = 0, v.prototype.blockData = null, v.prototype.decodeBlock = function(A) {
  var t, e = 0;
  if (this.macroblockIntra) {
    var i, o;
    if (A < 4 ? (i = this.dcPredictorY, o = this.readHuffman(v.DCT_DC_SIZE_LUMINANCE)) : (i = A === 4 ? this.dcPredictorCr : this.dcPredictorCb, o = this.readHuffman(v.DCT_DC_SIZE_CHROMINANCE)), o > 0) {
      var n = this.bits.read(o);
      this.blockData[0] = n & 1 << o - 1 ? i + n : i + (-1 << o | n + 1);
    } else
      this.blockData[0] = i;
    A < 4 ? this.dcPredictorY = this.blockData[0] : A === 4 ? this.dcPredictorCr = this.blockData[0] : this.dcPredictorCb = this.blockData[0], this.blockData[0] <<= 8, t = this.intraQuantMatrix, e = 1;
  } else
    t = this.nonIntraQuantMatrix;
  for (var h, B, p, c = 0; ; ) {
    var E = 0, I = this.readHuffman(v.DCT_COEFF);
    if (I === 1 && e > 0 && this.bits.read(1) === 0)
      break;
    I === 65535 ? (E = this.bits.read(6), (c = this.bits.read(8)) === 0 ? c = this.bits.read(8) : c === 128 ? c = this.bits.read(8) - 256 : c > 128 && (c -= 256)) : (E = I >> 8, c = 255 & I, this.bits.read(1) && (c = -c));
    var l = v.ZIG_ZAG[e += E];
    e++, c <<= 1, this.macroblockIntra || (c += c < 0 ? -1 : 1), !(1 & (c = c * this.quantizerScale * t[l] >> 4)) && (c -= c > 0 ? 1 : -1), c > 2047 ? c = 2047 : c < -2048 && (c = -2048), this.blockData[l] = c * v.PREMULTIPLIER_MATRIX[l];
  }
  A < 4 ? (h = this.currentY, p = this.codedWidth - 8, B = this.mbRow * this.codedWidth + this.mbCol << 4, 1 & A && (B += 8), 2 & A && (B += this.codedWidth << 3)) : (h = A === 4 ? this.currentCb : this.currentCr, p = (this.codedWidth >> 1) - 8, B = (this.mbRow * this.codedWidth << 2) + (this.mbCol << 3)), this.macroblockIntra ? e === 1 ? (v.CopyValueToDestination(this.blockData[0] + 128 >> 8, h, B, p), this.blockData[0] = 0) : (v.IDCT(this.blockData), v.CopyBlockToDestination(this.blockData, h, B, p), JSMpeg.Fill(this.blockData, 0)) : e === 1 ? (v.AddValueToDestination(this.blockData[0] + 128 >> 8, h, B, p), this.blockData[0] = 0) : (v.IDCT(this.blockData), v.AddBlockToDestination(this.blockData, h, B, p), JSMpeg.Fill(this.blockData, 0)), e = 0;
}, v.CopyBlockToDestination = function(A, t, e, i) {
  for (var o = 0; o < 64; o += 8, e += i + 8)
    t[e + 0] = A[o + 0], t[e + 1] = A[o + 1], t[e + 2] = A[o + 2], t[e + 3] = A[o + 3], t[e + 4] = A[o + 4], t[e + 5] = A[o + 5], t[e + 6] = A[o + 6], t[e + 7] = A[o + 7];
}, v.AddBlockToDestination = function(A, t, e, i) {
  for (var o = 0; o < 64; o += 8, e += i + 8)
    t[e + 0] += A[o + 0], t[e + 1] += A[o + 1], t[e + 2] += A[o + 2], t[e + 3] += A[o + 3], t[e + 4] += A[o + 4], t[e + 5] += A[o + 5], t[e + 6] += A[o + 6], t[e + 7] += A[o + 7];
}, v.CopyValueToDestination = function(A, t, e, i) {
  for (var o = 0; o < 64; o += 8, e += i + 8)
    t[e + 0] = A, t[e + 1] = A, t[e + 2] = A, t[e + 3] = A, t[e + 4] = A, t[e + 5] = A, t[e + 6] = A, t[e + 7] = A;
}, v.AddValueToDestination = function(A, t, e, i) {
  for (var o = 0; o < 64; o += 8, e += i + 8)
    t[e + 0] += A, t[e + 1] += A, t[e + 2] += A, t[e + 3] += A, t[e + 4] += A, t[e + 5] += A, t[e + 6] += A, t[e + 7] += A;
}, v.IDCT = function(A) {
  for (var t, e, i, o, n, h, B, p, c, E, I, l, d, g, S, s, r, Q, a = 0; a < 8; ++a)
    t = A[32 + a], e = A[16 + a] + A[48 + a], i = A[40 + a] - A[24 + a], h = A[8 + a] + A[56 + a], B = A[24 + a] + A[40 + a], c = (d = (473 * (o = A[8 + a] - A[56 + a]) - 196 * i + 128 >> 8) - (n = h + B)) - (362 * (h - B) + 128 >> 8), g = (E = (p = A[0 + a]) - t) + (I = (362 * (A[16 + a] - A[48 + a]) + 128 >> 8) - e), S = (l = p + t) + e, s = E - I, r = l - e, Q = -c - (473 * i + 196 * o + 128 >> 8), A[0 + a] = n + S, A[8 + a] = d + g, A[16 + a] = s - c, A[24 + a] = r - Q, A[32 + a] = r + Q, A[40 + a] = c + s, A[48 + a] = g - d, A[56 + a] = S - n;
  for (a = 0; a < 64; a += 8)
    t = A[4 + a], e = A[2 + a] + A[6 + a], i = A[5 + a] - A[3 + a], h = A[1 + a] + A[7 + a], B = A[3 + a] + A[5 + a], c = (d = (473 * (o = A[1 + a] - A[7 + a]) - 196 * i + 128 >> 8) - (n = h + B)) - (362 * (h - B) + 128 >> 8), g = (E = (p = A[0 + a]) - t) + (I = (362 * (A[2 + a] - A[6 + a]) + 128 >> 8) - e), S = (l = p + t) + e, s = E - I, r = l - e, Q = -c - (473 * i + 196 * o + 128 >> 8), A[0 + a] = n + S + 128 >> 8, A[1 + a] = d + g + 128 >> 8, A[2 + a] = s - c + 128 >> 8, A[3 + a] = r - Q + 128 >> 8, A[4 + a] = r + Q + 128 >> 8, A[5 + a] = c + s + 128 >> 8, A[6 + a] = g - d + 128 >> 8, A[7 + a] = S - n + 128 >> 8;
}, v.PICTURE_RATE = [0, 23.976, 24, 25, 29.97, 30, 50, 59.94, 60, 0, 0, 0, 0, 0, 0, 0], v.ZIG_ZAG = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]), v.DEFAULT_INTRA_QUANT_MATRIX = new Uint8Array([8, 16, 19, 22, 26, 27, 29, 34, 16, 16, 22, 24, 27, 29, 34, 37, 19, 22, 26, 27, 29, 34, 34, 38, 22, 22, 26, 27, 29, 34, 37, 40, 22, 26, 27, 29, 32, 35, 40, 48, 26, 27, 29, 32, 35, 40, 48, 58, 26, 27, 29, 34, 38, 46, 56, 69, 27, 29, 35, 38, 46, 56, 69, 83]), v.DEFAULT_NON_INTRA_QUANT_MATRIX = new Uint8Array([16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]), v.PREMULTIPLIER_MATRIX = new Uint8Array([32, 44, 42, 38, 32, 25, 17, 9, 44, 62, 58, 52, 44, 35, 24, 12, 42, 58, 55, 49, 42, 33, 23, 12, 38, 52, 49, 44, 38, 30, 20, 10, 32, 44, 42, 38, 32, 25, 17, 9, 25, 35, 33, 30, 25, 20, 14, 7, 17, 24, 23, 20, 17, 14, 9, 5, 9, 12, 12, 10, 9, 7, 5, 2]), v.MACROBLOCK_ADDRESS_INCREMENT = new Int16Array([3, 6, 0, 9, 12, 0, 0, 0, 1, 15, 18, 0, 21, 24, 0, 27, 30, 0, 33, 36, 0, 0, 0, 3, 0, 0, 2, 39, 42, 0, 45, 48, 0, 0, 0, 5, 0, 0, 4, 51, 54, 0, 57, 60, 0, 0, 0, 7, 0, 0, 6, 63, 66, 0, 69, 72, 0, 75, 78, 0, 81, 84, 0, -1, 87, 0, -1, 90, 0, 93, 96, 0, 99, 102, 0, 105, 108, 0, 111, 114, 0, 0, 0, 9, 0, 0, 8, 117, 120, 0, 123, 126, 0, 129, 132, 0, 135, 138, 0, 0, 0, 15, 0, 0, 14, 0, 0, 13, 0, 0, 12, 0, 0, 11, 0, 0, 10, 141, -1, 0, -1, 144, 0, 147, 150, 0, 153, 156, 0, 159, 162, 0, 165, 168, 0, 171, 174, 0, 177, 180, 0, 183, -1, 0, -1, 186, 0, 189, 192, 0, 195, 198, 0, 201, 204, 0, 207, 210, 0, 213, 216, 0, 219, 222, 0, 0, 0, 21, 0, 0, 20, 0, 0, 19, 0, 0, 18, 0, 0, 17, 0, 0, 16, 0, 0, 35, 0, 0, 34, 0, 0, 33, 0, 0, 32, 0, 0, 31, 0, 0, 30, 0, 0, 29, 0, 0, 28, 0, 0, 27, 0, 0, 26, 0, 0, 25, 0, 0, 24, 0, 0, 23, 0, 0, 22]), v.MACROBLOCK_TYPE_INTRA = new Int8Array([3, 6, 0, -1, 9, 0, 0, 0, 1, 0, 0, 17]), v.MACROBLOCK_TYPE_PREDICTIVE = new Int8Array([3, 6, 0, 9, 12, 0, 0, 0, 10, 15, 18, 0, 0, 0, 2, 21, 24, 0, 0, 0, 8, 27, 30, 0, 33, 36, 0, -1, 39, 0, 0, 0, 18, 0, 0, 26, 0, 0, 1, 0, 0, 17]), v.MACROBLOCK_TYPE_B = new Int8Array([3, 6, 0, 9, 15, 0, 12, 18, 0, 24, 21, 0, 0, 0, 12, 27, 30, 0, 0, 0, 14, 39, 42, 0, 36, 33, 0, 0, 0, 4, 0, 0, 6, 54, 48, 0, 45, 51, 0, 0, 0, 8, 0, 0, 10, -1, 57, 0, 0, 0, 1, 60, 63, 0, 0, 0, 30, 0, 0, 17, 0, 0, 22, 0, 0, 26]), v.MACROBLOCK_TYPE = [null, v.MACROBLOCK_TYPE_INTRA, v.MACROBLOCK_TYPE_PREDICTIVE, v.MACROBLOCK_TYPE_B], v.CODE_BLOCK_PATTERN = new Int16Array([6, 3, 0, 9, 18, 0, 12, 15, 0, 24, 33, 0, 36, 39, 0, 27, 21, 0, 30, 42, 0, 60, 57, 0, 54, 48, 0, 69, 51, 0, 81, 75, 0, 63, 84, 0, 45, 66, 0, 72, 78, 0, 0, 0, 60, 105, 120, 0, 132, 144, 0, 114, 108, 0, 126, 141, 0, 87, 93, 0, 117, 96, 0, 0, 0, 32, 135, 138, 0, 99, 123, 0, 129, 102, 0, 0, 0, 4, 90, 111, 0, 0, 0, 8, 0, 0, 16, 0, 0, 44, 150, 168, 0, 0, 0, 28, 0, 0, 52, 0, 0, 62, 183, 177, 0, 156, 180, 0, 0, 0, 1, 165, 162, 0, 0, 0, 61, 0, 0, 56, 171, 174, 0, 0, 0, 2, 0, 0, 40, 153, 186, 0, 0, 0, 48, 192, 189, 0, 147, 159, 0, 0, 0, 20, 0, 0, 12, 240, 249, 0, 0, 0, 63, 231, 225, 0, 195, 219, 0, 252, 198, 0, 0, 0, 24, 0, 0, 36, 0, 0, 3, 207, 261, 0, 243, 237, 0, 204, 213, 0, 210, 234, 0, 201, 228, 0, 216, 222, 0, 258, 255, 0, 264, 246, 0, -1, 282, 0, 285, 291, 0, 0, 0, 33, 0, 0, 9, 318, 330, 0, 306, 348, 0, 0, 0, 5, 0, 0, 10, 279, 267, 0, 0, 0, 6, 0, 0, 18, 0, 0, 17, 0, 0, 34, 339, 357, 0, 309, 312, 0, 270, 276, 0, 327, 321, 0, 351, 354, 0, 303, 297, 0, 294, 288, 0, 300, 273, 0, 342, 345, 0, 315, 324, 0, 336, 333, 0, 363, 375, 0, 0, 0, 41, 0, 0, 14, 0, 0, 21, 372, 366, 0, 360, 369, 0, 0, 0, 11, 0, 0, 19, 0, 0, 7, 0, 0, 35, 0, 0, 13, 0, 0, 50, 0, 0, 49, 0, 0, 58, 0, 0, 37, 0, 0, 25, 0, 0, 45, 0, 0, 57, 0, 0, 26, 0, 0, 29, 0, 0, 38, 0, 0, 53, 0, 0, 23, 0, 0, 43, 0, 0, 46, 0, 0, 42, 0, 0, 22, 0, 0, 54, 0, 0, 51, 0, 0, 15, 0, 0, 30, 0, 0, 39, 0, 0, 47, 0, 0, 55, 0, 0, 27, 0, 0, 59, 0, 0, 31]), v.MOTION = new Int16Array([3, 6, 0, 12, 9, 0, 0, 0, 0, 18, 15, 0, 24, 21, 0, 0, 0, -1, 0, 0, 1, 27, 30, 0, 36, 33, 0, 0, 0, 2, 0, 0, -2, 42, 45, 0, 48, 39, 0, 60, 54, 0, 0, 0, 3, 0, 0, -3, 51, 57, 0, -1, 69, 0, 81, 75, 0, 78, 63, 0, 72, 66, 0, 96, 84, 0, 87, 93, 0, -1, 99, 0, 108, 105, 0, 0, 0, -4, 90, 102, 0, 0, 0, 4, 0, 0, -7, 0, 0, 5, 111, 123, 0, 0, 0, -5, 0, 0, 7, 114, 120, 0, 126, 117, 0, 0, 0, -6, 0, 0, 6, 153, 162, 0, 150, 147, 0, 135, 138, 0, 156, 141, 0, 129, 159, 0, 132, 144, 0, 0, 0, 10, 0, 0, 9, 0, 0, 8, 0, 0, -8, 171, 198, 0, 0, 0, -9, 180, 192, 0, 168, 183, 0, 165, 186, 0, 174, 189, 0, 0, 0, -10, 177, 195, 0, 0, 0, 12, 0, 0, 16, 0, 0, 13, 0, 0, 14, 0, 0, 11, 0, 0, 15, 0, 0, -16, 0, 0, -12, 0, 0, -14, 0, 0, -15, 0, 0, -11, 0, 0, -13]), v.DCT_DC_SIZE_LUMINANCE = new Int8Array([6, 3, 0, 18, 15, 0, 9, 12, 0, 0, 0, 1, 0, 0, 2, 27, 24, 0, 21, 30, 0, 0, 0, 0, 36, 33, 0, 0, 0, 4, 0, 0, 3, 39, 42, 0, 0, 0, 5, 0, 0, 6, 48, 45, 0, 51, -1, 0, 0, 0, 7, 0, 0, 8]), v.DCT_DC_SIZE_CHROMINANCE = new Int8Array([6, 3, 0, 12, 9, 0, 18, 15, 0, 24, 21, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 30, 27, 0, 0, 0, 3, 36, 33, 0, 0, 0, 4, 42, 39, 0, 0, 0, 5, 48, 45, 0, 0, 0, 6, 51, -1, 0, 0, 0, 7, 0, 0, 8]), v.DCT_COEFF = new Int32Array([3, 6, 0, 12, 9, 0, 0, 0, 1, 21, 24, 0, 18, 15, 0, 39, 27, 0, 33, 30, 0, 42, 36, 0, 0, 0, 257, 60, 66, 0, 54, 63, 0, 48, 57, 0, 0, 0, 513, 51, 45, 0, 0, 0, 2, 0, 0, 3, 81, 75, 0, 87, 93, 0, 72, 78, 0, 96, 90, 0, 0, 0, 1025, 69, 84, 0, 0, 0, 769, 0, 0, 258, 0, 0, 1793, 0, 0, 65535, 0, 0, 1537, 111, 108, 0, 0, 0, 1281, 105, 102, 0, 117, 114, 0, 99, 126, 0, 120, 123, 0, 156, 150, 0, 162, 159, 0, 144, 147, 0, 129, 135, 0, 138, 132, 0, 0, 0, 2049, 0, 0, 4, 0, 0, 514, 0, 0, 2305, 153, 141, 0, 165, 171, 0, 180, 168, 0, 177, 174, 0, 183, 186, 0, 0, 0, 2561, 0, 0, 3329, 0, 0, 6, 0, 0, 259, 0, 0, 5, 0, 0, 770, 0, 0, 2817, 0, 0, 3073, 228, 225, 0, 201, 210, 0, 219, 213, 0, 234, 222, 0, 216, 231, 0, 207, 192, 0, 204, 189, 0, 198, 195, 0, 243, 261, 0, 273, 240, 0, 246, 237, 0, 249, 258, 0, 279, 276, 0, 252, 255, 0, 270, 282, 0, 264, 267, 0, 0, 0, 515, 0, 0, 260, 0, 0, 7, 0, 0, 1026, 0, 0, 1282, 0, 0, 4097, 0, 0, 3841, 0, 0, 3585, 315, 321, 0, 333, 342, 0, 312, 291, 0, 375, 357, 0, 288, 294, 0, -1, 369, 0, 285, 303, 0, 318, 363, 0, 297, 306, 0, 339, 309, 0, 336, 348, 0, 330, 300, 0, 372, 345, 0, 351, 366, 0, 327, 354, 0, 360, 324, 0, 381, 408, 0, 417, 420, 0, 390, 378, 0, 435, 438, 0, 384, 387, 0, 0, 0, 2050, 396, 402, 0, 465, 462, 0, 0, 0, 8, 411, 399, 0, 429, 432, 0, 453, 414, 0, 426, 423, 0, 0, 0, 10, 0, 0, 9, 0, 0, 11, 0, 0, 5377, 0, 0, 1538, 0, 0, 771, 0, 0, 5121, 0, 0, 1794, 0, 0, 4353, 0, 0, 4609, 0, 0, 4865, 444, 456, 0, 0, 0, 1027, 459, 450, 0, 0, 0, 261, 393, 405, 0, 0, 0, 516, 447, 441, 0, 516, 519, 0, 486, 474, 0, 510, 483, 0, 504, 498, 0, 471, 537, 0, 507, 501, 0, 522, 513, 0, 534, 531, 0, 468, 477, 0, 492, 495, 0, 549, 546, 0, 525, 528, 0, 0, 0, 263, 0, 0, 2562, 0, 0, 2306, 0, 0, 5633, 0, 0, 5889, 0, 0, 6401, 0, 0, 6145, 0, 0, 1283, 0, 0, 772, 0, 0, 13, 0, 0, 12, 0, 0, 14, 0, 0, 15, 0, 0, 517, 0, 0, 6657, 0, 0, 262, 540, 543, 0, 480, 489, 0, 588, 597, 0, 0, 0, 27, 609, 555, 0, 606, 603, 0, 0, 0, 19, 0, 0, 22, 591, 621, 0, 0, 0, 18, 573, 576, 0, 564, 570, 0, 0, 0, 20, 552, 582, 0, 0, 0, 21, 558, 579, 0, 0, 0, 23, 612, 594, 0, 0, 0, 25, 0, 0, 24, 600, 615, 0, 0, 0, 31, 0, 0, 30, 0, 0, 28, 0, 0, 29, 0, 0, 26, 0, 0, 17, 0, 0, 16, 567, 618, 0, 561, 585, 0, 654, 633, 0, 0, 0, 37, 645, 648, 0, 0, 0, 36, 630, 636, 0, 0, 0, 34, 639, 627, 0, 663, 666, 0, 657, 624, 0, 651, 642, 0, 669, 660, 0, 0, 0, 35, 0, 0, 267, 0, 0, 40, 0, 0, 268, 0, 0, 266, 0, 0, 32, 0, 0, 264, 0, 0, 265, 0, 0, 38, 0, 0, 269, 0, 0, 270, 0, 0, 33, 0, 0, 39, 0, 0, 7937, 0, 0, 6913, 0, 0, 7681, 0, 0, 4098, 0, 0, 7425, 0, 0, 7169, 0, 0, 271, 0, 0, 274, 0, 0, 273, 0, 0, 272, 0, 0, 1539, 0, 0, 2818, 0, 0, 3586, 0, 0, 3330, 0, 0, 3074, 0, 0, 3842]), v.PICTURE_TYPE = { INTRA: 1, PREDICTIVE: 2, B: 3 }, v.START = { SEQUENCE: 179, SLICE_FIRST: 1, SLICE_LAST: 175, PICTURE: 0, EXTENSION: 181, USER_DATA: 178 }, v), JSMpeg.Decoder.MPEG1VideoWASM = (((QA = function(A) {
  JSMpeg.Decoder.Base.call(this, A), this.onDecodeCallback = A.onVideoDecode, this.module = A.wasmModule, this.bufferSize = A.videoBufferSize || 524288, this.bufferMode = A.streaming ? JSMpeg.BitBuffer.MODE.EVICT : JSMpeg.BitBuffer.MODE.EXPAND, this.decodeFirstFrame = A.decodeFirstFrame !== !1, this.hasSequenceHeader = !1;
}).prototype = Object.create(JSMpeg.Decoder.Base.prototype)).constructor = QA, QA.prototype.initializeWasmDecoder = function() {
  this.module.instance && (this.instance = this.module.instance, this.functions = this.module.instance.exports, this.decoder = this.functions._mpeg1_decoder_create(this.bufferSize, this.bufferMode));
}, QA.prototype.destroy = function() {
  this.decoder && this.functions._mpeg1_decoder_destroy(this.decoder);
}, QA.prototype.bufferGetIndex = function() {
  if (this.decoder)
    return this.functions._mpeg1_decoder_get_index(this.decoder);
}, QA.prototype.bufferSetIndex = function(A) {
  this.decoder && this.functions._mpeg1_decoder_set_index(this.decoder, A);
}, QA.prototype.bufferWrite = function(A) {
  this.decoder || this.initializeWasmDecoder();
  for (var t = 0, e = 0; e < A.length; e++)
    t += A[e].length;
  var i = this.functions._mpeg1_decoder_get_write_ptr(this.decoder, t);
  for (e = 0; e < A.length; e++)
    this.instance.heapU8.set(A[e], i), i += A[e].length;
  return this.functions._mpeg1_decoder_did_write(this.decoder, t), t;
}, QA.prototype.write = function(A, t) {
  JSMpeg.Decoder.Base.prototype.write.call(this, A, t), !this.hasSequenceHeader && this.functions._mpeg1_decoder_has_sequence_header(this.decoder) && this.loadSequenceHeader();
}, QA.prototype.loadSequenceHeader = function() {
  if (this.hasSequenceHeader = !0, this.frameRate = this.functions._mpeg1_decoder_get_frame_rate(this.decoder), this.codedSize = this.functions._mpeg1_decoder_get_coded_size(this.decoder), this.destination) {
    var A = this.functions._mpeg1_decoder_get_width(this.decoder), t = this.functions._mpeg1_decoder_get_height(this.decoder);
    this.destination.resize(A, t);
  }
  this.decodeFirstFrame && this.decode();
}, QA.prototype.decode = function() {
  var A = JSMpeg.Now();
  if (!this.decoder || !this.functions._mpeg1_decoder_decode(this.decoder))
    return !1;
  if (this.destination) {
    var t = this.functions._mpeg1_decoder_get_y_ptr(this.decoder), e = this.functions._mpeg1_decoder_get_cr_ptr(this.decoder), i = this.functions._mpeg1_decoder_get_cb_ptr(this.decoder), o = this.instance.heapU8.subarray(t, t + this.codedSize), n = this.instance.heapU8.subarray(e, e + (this.codedSize >> 2)), h = this.instance.heapU8.subarray(i, i + (this.codedSize >> 2));
    this.destination.render(o, n, h, !1);
  }
  this.advanceDecodedTime(1 / this.frameRate);
  var B = JSMpeg.Now() - A;
  return this.onDecodeCallback && this.onDecodeCallback(this, B), !0;
}, QA), JSMpeg.Decoder.MP2Audio = ((q = function(A) {
  JSMpeg.Decoder.Base.call(this, A), this.onDecodeCallback = A.onAudioDecode;
  var t = A.audioBufferSize || 131072, e = A.streaming ? JSMpeg.BitBuffer.MODE.EVICT : JSMpeg.BitBuffer.MODE.EXPAND;
  this.bits = new JSMpeg.BitBuffer(t, e), this.left = new Float32Array(1152), this.right = new Float32Array(1152), this.sampleRate = 44100, this.D = new Float32Array(1024), this.D.set(q.SYNTHESIS_WINDOW, 0), this.D.set(q.SYNTHESIS_WINDOW, 512), this.V = [new Float32Array(1024), new Float32Array(1024)], this.U = new Int32Array(32), this.VPos = 0, this.allocation = [new Array(32), new Array(32)], this.scaleFactorInfo = [new Uint8Array(32), new Uint8Array(32)], this.scaleFactor = [new Array(32), new Array(32)], this.sample = [new Array(32), new Array(32)];
  for (var i = 0; i < 2; i++)
    for (var o = 0; o < 32; o++)
      this.scaleFactor[i][o] = [0, 0, 0], this.sample[i][o] = [0, 0, 0];
}).prototype = Object.create(JSMpeg.Decoder.Base.prototype), q.prototype.constructor = q, q.prototype.decode = function() {
  var A = JSMpeg.Now(), t = this.bits.index >> 3;
  if (t >= this.bits.byteLength)
    return !1;
  var e = this.decodeFrame(this.left, this.right);
  if (this.bits.index = t + e << 3, !e)
    return !1;
  this.destination && this.destination.play(this.sampleRate, this.left, this.right), this.advanceDecodedTime(this.left.length / this.sampleRate);
  var i = JSMpeg.Now() - A;
  return this.onDecodeCallback && this.onDecodeCallback(this, i), !0;
}, q.prototype.getCurrentTime = function() {
  var A = this.destination ? this.destination.enqueuedTime : 0;
  return this.decodedTime - A;
}, q.prototype.decodeFrame = function(A, t) {
  var e = this.bits.read(11), i = this.bits.read(2), o = this.bits.read(2), n = !this.bits.read(1);
  if (e !== q.FRAME_SYNC || i !== q.VERSION.MPEG_1 || o !== q.LAYER.II)
    return 0;
  var h = this.bits.read(4) - 1;
  if (h > 13)
    return 0;
  var B = this.bits.read(2), p = q.SAMPLE_RATE[B];
  if (B === 3)
    return 0;
  i === q.VERSION.MPEG_2 && (B += 4, h += 14);
  var c = this.bits.read(1);
  this.bits.read(1);
  var E = this.bits.read(2), I = 0;
  E === q.MODE.JOINT_STEREO ? I = this.bits.read(2) + 1 << 2 : (this.bits.skip(2), I = E === q.MODE.MONO ? 0 : 32), this.bits.skip(4), n && this.bits.skip(16);
  var l = 144e3 * q.BIT_RATE[h] / (p = q.SAMPLE_RATE[B]) + c | 0, d = 0, g = 0;
  if (i === q.VERSION.MPEG_2)
    d = 2, g = 30;
  else {
    var S = E === q.MODE.MONO ? 0 : 1, s = q.QUANT_LUT_STEP_1[S][h];
    g = 63 & (d = q.QUANT_LUT_STEP_2[s][B]), d >>= 6;
  }
  I > g && (I = g);
  for (var r = 0; r < I; r++)
    this.allocation[0][r] = this.readAllocation(r, d), this.allocation[1][r] = this.readAllocation(r, d);
  for (r = I; r < g; r++)
    this.allocation[0][r] = this.allocation[1][r] = this.readAllocation(r, d);
  var Q = E === q.MODE.MONO ? 1 : 2;
  for (r = 0; r < g; r++) {
    for (a = 0; a < Q; a++)
      this.allocation[a][r] && (this.scaleFactorInfo[a][r] = this.bits.read(2));
    E === q.MODE.MONO && (this.scaleFactorInfo[1][r] = this.scaleFactorInfo[0][r]);
  }
  for (r = 0; r < g; r++) {
    for (var a = 0; a < Q; a++)
      if (this.allocation[a][r]) {
        var C = this.scaleFactor[a][r];
        switch (this.scaleFactorInfo[a][r]) {
          case 0:
            C[0] = this.bits.read(6), C[1] = this.bits.read(6), C[2] = this.bits.read(6);
            break;
          case 1:
            C[0] = C[1] = this.bits.read(6), C[2] = this.bits.read(6);
            break;
          case 2:
            C[0] = C[1] = C[2] = this.bits.read(6);
            break;
          case 3:
            C[0] = this.bits.read(6), C[1] = C[2] = this.bits.read(6);
        }
      }
    E === q.MODE.MONO && (this.scaleFactor[1][r][0] = this.scaleFactor[0][r][0], this.scaleFactor[1][r][1] = this.scaleFactor[0][r][1], this.scaleFactor[1][r][2] = this.scaleFactor[0][r][2]);
  }
  for (var u = 0, f = 0; f < 3; f++)
    for (var m = 0; m < 4; m++) {
      for (r = 0; r < I; r++)
        this.readSamples(0, r, f), this.readSamples(1, r, f);
      for (r = I; r < g; r++)
        this.readSamples(0, r, f), this.sample[1][r][0] = this.sample[0][r][0], this.sample[1][r][1] = this.sample[0][r][1], this.sample[1][r][2] = this.sample[0][r][2];
      for (r = g; r < 32; r++)
        this.sample[0][r][0] = 0, this.sample[0][r][1] = 0, this.sample[0][r][2] = 0, this.sample[1][r][0] = 0, this.sample[1][r][1] = 0, this.sample[1][r][2] = 0;
      for (var y = 0; y < 3; y++) {
        for (this.VPos = this.VPos - 64 & 1023, a = 0; a < 2; a++) {
          q.MatrixTransform(this.sample[a], y, this.V[a], this.VPos), JSMpeg.Fill(this.U, 0);
          for (var F = 512 - (this.VPos >> 1), G = this.VPos % 128 >> 1; G < 1024; ) {
            for (var x = 0; x < 32; ++x)
              this.U[x] += this.D[F++] * this.V[a][G++];
            G += 96, F += 32;
          }
          for (G = 1120 - G, F -= 480; G < 1024; ) {
            for (x = 0; x < 32; ++x)
              this.U[x] += this.D[F++] * this.V[a][G++];
            G += 96, F += 32;
          }
          for (var L = a === 0 ? A : t, T = 0; T < 32; T++)
            L[u + T] = this.U[T] / 2147418112;
        }
        u += 32;
      }
    }
  return this.sampleRate = p, l;
}, q.prototype.readAllocation = function(A, t) {
  var e = q.QUANT_LUT_STEP_3[t][A], i = q.QUANT_LUT_STEP4[15 & e][this.bits.read(e >> 4)];
  return i ? q.QUANT_TAB[i - 1] : 0;
}, q.prototype.readSamples = function(A, t, e) {
  var i = this.allocation[A][t], o = this.scaleFactor[A][t][e], n = this.sample[A][t], h = 0;
  if (i) {
    if (o === 63)
      o = 0;
    else {
      var B = o / 3 | 0;
      o = q.SCALEFACTOR_BASE[o % 3] + (1 << B >> 1) >> B;
    }
    var p = i.levels;
    i.group ? (h = this.bits.read(i.bits), n[0] = h % p, h = h / p | 0, n[1] = h % p, n[2] = h / p | 0) : (n[0] = this.bits.read(i.bits), n[1] = this.bits.read(i.bits), n[2] = this.bits.read(i.bits));
    var c = 65536 / (p + 1) | 0;
    h = ((p = (p + 1 >> 1) - 1) - n[0]) * c, n[0] = h * (o >> 12) + (h * (4095 & o) + 2048 >> 12) >> 12, h = (p - n[1]) * c, n[1] = h * (o >> 12) + (h * (4095 & o) + 2048 >> 12) >> 12, h = (p - n[2]) * c, n[2] = h * (o >> 12) + (h * (4095 & o) + 2048 >> 12) >> 12;
  } else
    n[0] = n[1] = n[2] = 0;
}, q.MatrixTransform = function(A, t, e, i) {
  var o, n, h, B, p, c, E, I, l, d, g, S, s, r, Q, a, C, u, f, m, y, F, G, x, L, T, U, _, k, R, N, D, b;
  o = A[0][t] + A[31][t], n = 0.500602998235 * (A[0][t] - A[31][t]), h = A[1][t] + A[30][t], B = 0.505470959898 * (A[1][t] - A[30][t]), p = A[2][t] + A[29][t], c = 0.515447309923 * (A[2][t] - A[29][t]), E = A[3][t] + A[28][t], I = 0.53104259109 * (A[3][t] - A[28][t]), l = A[4][t] + A[27][t], d = 0.553103896034 * (A[4][t] - A[27][t]), g = A[5][t] + A[26][t], S = 0.582934968206 * (A[5][t] - A[26][t]), s = A[6][t] + A[25][t], r = 0.622504123036 * (A[6][t] - A[25][t]), Q = A[7][t] + A[24][t], a = 0.674808341455 * (A[7][t] - A[24][t]), C = A[8][t] + A[23][t], u = 0.744536271002 * (A[8][t] - A[23][t]), f = A[9][t] + A[22][t], m = 0.839349645416 * (A[9][t] - A[22][t]), y = A[10][t] + A[21][t], F = 0.972568237862 * (A[10][t] - A[21][t]), G = A[11][t] + A[20][t], x = 1.16943993343 * (A[11][t] - A[20][t]), L = A[12][t] + A[19][t], T = 1.48416461631 * (A[12][t] - A[19][t]), U = A[13][t] + A[18][t], _ = 2.05778100995 * (A[13][t] - A[18][t]), k = A[14][t] + A[17][t], R = 3.40760841847 * (A[14][t] - A[17][t]), b = o + (N = A[15][t] + A[16][t]), N = 0.502419286188 * (o - N), o = h + k, k = 0.52249861494 * (h - k), h = p + U, U = 0.566944034816 * (p - U), p = E + L, L = 0.64682178336 * (E - L), E = l + G, G = 0.788154623451 * (l - G), l = g + y, y = 1.06067768599 * (g - y), g = s + f, f = 1.72244709824 * (s - f), s = Q + C, C = 5.10114861869 * (Q - C), Q = b + s, s = 0.509795579104 * (b - s), b = o + g, o = 0.601344886935 * (o - g), g = h + l, l = 0.899976223136 * (h - l), h = p + E, E = 2.56291544774 * (p - E), p = Q + h, Q = 0.541196100146 * (Q - h), h = b + g, g = 1.30656296488 * (b - g), b = p + h, p = 0.707106781187 * (p - h), h = Q + g, h += Q = 0.707106781187 * (Q - g), g = s + E, s = 0.541196100146 * (s - E), E = o + l, l = 1.30656296488 * (o - l), o = g + E, E = 0.707106781187 * (g - E), g = s + l, o += g += s = 0.707106781187 * (s - l), g += E, E += s, l = N + C, N = 0.509795579104 * (N - C), C = k + f, k = 0.601344886935 * (k - f), f = U + y, y = 0.899976223136 * (U - y), U = L + G, G = 2.56291544774 * (L - G), L = l + U, l = 0.541196100146 * (l - U), U = C + f, f = 1.30656296488 * (C - f), C = L + U, U = 0.707106781187 * (L - U), L = l + f, f = 0.707106781187 * (l - f), l = N + G, N = 0.541196100146 * (N - G), G = k + y, y = 1.30656296488 * (k - y), k = l + G, G = 0.707106781187 * (l - G), l = N + y, C += k += l += N = 0.707106781187 * (N - y), k += L += f, L += l += G, l += U, U += G += N, G += f, f += N, y = n + (D = 10.1900081235 * (A[15][t] - A[16][t])), n = 0.502419286188 * (n - D), D = B + R, B = 0.52249861494 * (B - R), R = c + _, _ = 0.566944034816 * (c - _), c = I + T, I = 0.64682178336 * (I - T), T = d + x, d = 0.788154623451 * (d - x), x = S + F, F = 1.06067768599 * (S - F), S = r + m, m = 1.72244709824 * (r - m), r = a + u, a = 5.10114861869 * (a - u), u = y + r, r = 0.509795579104 * (y - r), y = D + S, D = 0.601344886935 * (D - S), S = R + x, x = 0.899976223136 * (R - x), R = c + T, T = 2.56291544774 * (c - T), c = u + R, u = 0.541196100146 * (u - R), R = y + S, S = 1.30656296488 * (y - S), y = c + R, R = 0.707106781187 * (c - R), c = u + S, S = 0.707106781187 * (u - S), u = r + T, T = 0.541196100146 * (r - T), r = D + x, x = 1.30656296488 * (D - x), D = u + r, r = 0.707106781187 * (u - r), u = T + x, D += u += x = 0.707106781187 * (T - x), u += r, T = r + x, r = n + a, n = 0.509795579104 * (n - a), a = B + m, B = 0.601344886935 * (B - m), m = _ + F, F = 0.899976223136 * (_ - F), _ = I + d, d = 2.56291544774 * (I - d), I = r + _, r = 0.541196100146 * (r - _), _ = a + m, m = 1.30656296488 * (a - m), a = I + _, _ = 0.707106781187 * (I - _), I = r + m, m = 0.707106781187 * (r - m), r = n + d, n = 0.541196100146 * (n - d), d = B + F, F = 1.30656296488 * (B - F), B = r + d, d = 0.707106781187 * (r - d), r = n + F, y += a += B += r += n = 0.707106781187 * (n - F), a += D, D += B += I += m, B += c += S, c += I += r += d, I += u, u += r += _, r += R, R += _ += d += n, _ += T, T += d += m, d += S, S += m += n, m += x, x += n, e[i + 48] = -b, e[i + 49] = e[i + 47] = -y, e[i + 50] = e[i + 46] = -C, e[i + 51] = e[i + 45] = -a, e[i + 52] = e[i + 44] = -o, e[i + 53] = e[i + 43] = -D, e[i + 54] = e[i + 42] = -k, e[i + 55] = e[i + 41] = -B, e[i + 56] = e[i + 40] = -h, e[i + 57] = e[i + 39] = -c, e[i + 58] = e[i + 38] = -L, e[i + 59] = e[i + 37] = -I, e[i + 60] = e[i + 36] = -g, e[i + 61] = e[i + 35] = -u, e[i + 62] = e[i + 34] = -l, e[i + 63] = e[i + 33] = -r, e[i + 32] = -p, e[i + 0] = p, e[i + 31] = -R, e[i + 1] = R, e[i + 30] = -U, e[i + 2] = U, e[i + 29] = -_, e[i + 3] = _, e[i + 28] = -E, e[i + 4] = E, e[i + 27] = -T, e[i + 5] = T, e[i + 26] = -G, e[i + 6] = G, e[i + 25] = -d, e[i + 7] = d, e[i + 24] = -Q, e[i + 8] = Q, e[i + 23] = -S, e[i + 9] = S, e[i + 22] = -f, e[i + 10] = f, e[i + 21] = -m, e[i + 11] = m, e[i + 20] = -s, e[i + 12] = s, e[i + 19] = -x, e[i + 13] = x, e[i + 18] = -N, e[i + 14] = N, e[i + 17] = -n, e[i + 15] = n, e[i + 16] = 0;
}, q.FRAME_SYNC = 2047, q.VERSION = { MPEG_2_5: 0, MPEG_2: 2, MPEG_1: 3 }, q.LAYER = { III: 1, II: 2, I: 3 }, q.MODE = { STEREO: 0, JOINT_STEREO: 1, DUAL_CHANNEL: 2, MONO: 3 }, q.SAMPLE_RATE = new Uint16Array([44100, 48e3, 32e3, 0, 22050, 24e3, 16e3, 0]), q.BIT_RATE = new Uint16Array([32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160]), q.SCALEFACTOR_BASE = new Uint32Array([33554432, 26632170, 21137968]), q.SYNTHESIS_WINDOW = new Float32Array([0, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -1, -1, -1, -1, -1.5, -1.5, -2, -2, -2.5, -2.5, -3, -3.5, -3.5, -4, -4.5, -5, -5.5, -6.5, -7, -8, -8.5, -9.5, -10.5, -12, -13, -14.5, -15.5, -17.5, -19, -20.5, -22.5, -24.5, -26.5, -29, -31.5, -34, -36.5, -39.5, -42.5, -45.5, -48.5, -52, -55.5, -58.5, -62.5, -66, -69.5, -73.5, -77, -80.5, -84.5, -88, -91.5, -95, -98, -101, -104, 106.5, 109, 111, 112.5, 113.5, 114, 114, 113.5, 112, 110.5, 107.5, 104, 100, 94.5, 88.5, 81.5, 73, 63.5, 53, 41.5, 28.5, 14.5, -1, -18, -36, -55.5, -76.5, -98.5, -122, -147, -173.5, -200.5, -229.5, -259.5, -290.5, -322.5, -355.5, -389.5, -424, -459.5, -495.5, -532, -568.5, -605, -641.5, -678, -714, -749, -783.5, -817, -849, -879.5, -908.5, -935, -959.5, -981, -1000.5, -1016, -1028.5, -1037.5, -1042.5, -1043.5, -1040, -1031.5, 1018.5, 1e3, 976, 946.5, 911, 869.5, 822, 767.5, 707, 640, 565.5, 485, 397, 302.5, 201, 92.5, -22.5, -144, -272.5, -407, -547.5, -694, -846, -1003, -1165, -1331.5, -1502, -1675.5, -1852.5, -2031.5, -2212.5, -2394, -2576.5, -2758.5, -2939.5, -3118.5, -3294.5, -3467.5, -3635.5, -3798.5, -3955, -4104.5, -4245.5, -4377.5, -4499, -4609.5, -4708, -4792.5, -4863.5, -4919, -4958, -4979.5, -4983, -4967.5, -4931.5, -4875, -4796, -4694.5, -4569.5, -4420, -4246, -4046, -3820, -3567, 3287, 2979.5, 2644, 2280.5, 1888, 1467.5, 1018.5, 541, 35, -499, -1061, -1650, -2266.5, -2909, -3577, -4270, -4987.5, -5727.5, -6490, -7274, -8077.5, -8899.5, -9739, -10594.5, -11464.5, -12347, -13241, -14144.5, -15056, -15973.5, -16895.5, -17820, -18744.5, -19668, -20588, -21503, -22410.5, -23308.5, -24195, -25068.5, -25926.5, -26767, -27589, -28389, -29166.5, -29919, -30644.5, -31342, -32009.5, -32645, -33247, -33814.5, -34346, -34839.5, -35295, -35710, -36084.5, -36417.5, -36707.5, -36954, -37156.5, -37315, -37428, -37496, 37519, 37496, 37428, 37315, 37156.5, 36954, 36707.5, 36417.5, 36084.5, 35710, 35295, 34839.5, 34346, 33814.5, 33247, 32645, 32009.5, 31342, 30644.5, 29919, 29166.5, 28389, 27589, 26767, 25926.5, 25068.5, 24195, 23308.5, 22410.5, 21503, 20588, 19668, 18744.5, 17820, 16895.5, 15973.5, 15056, 14144.5, 13241, 12347, 11464.5, 10594.5, 9739, 8899.5, 8077.5, 7274, 6490, 5727.5, 4987.5, 4270, 3577, 2909, 2266.5, 1650, 1061, 499, -35, -541, -1018.5, -1467.5, -1888, -2280.5, -2644, -2979.5, 3287, 3567, 3820, 4046, 4246, 4420, 4569.5, 4694.5, 4796, 4875, 4931.5, 4967.5, 4983, 4979.5, 4958, 4919, 4863.5, 4792.5, 4708, 4609.5, 4499, 4377.5, 4245.5, 4104.5, 3955, 3798.5, 3635.5, 3467.5, 3294.5, 3118.5, 2939.5, 2758.5, 2576.5, 2394, 2212.5, 2031.5, 1852.5, 1675.5, 1502, 1331.5, 1165, 1003, 846, 694, 547.5, 407, 272.5, 144, 22.5, -92.5, -201, -302.5, -397, -485, -565.5, -640, -707, -767.5, -822, -869.5, -911, -946.5, -976, -1e3, 1018.5, 1031.5, 1040, 1043.5, 1042.5, 1037.5, 1028.5, 1016, 1000.5, 981, 959.5, 935, 908.5, 879.5, 849, 817, 783.5, 749, 714, 678, 641.5, 605, 568.5, 532, 495.5, 459.5, 424, 389.5, 355.5, 322.5, 290.5, 259.5, 229.5, 200.5, 173.5, 147, 122, 98.5, 76.5, 55.5, 36, 18, 1, -14.5, -28.5, -41.5, -53, -63.5, -73, -81.5, -88.5, -94.5, -100, -104, -107.5, -110.5, -112, -113.5, -114, -114, -113.5, -112.5, -111, -109, 106.5, 104, 101, 98, 95, 91.5, 88, 84.5, 80.5, 77, 73.5, 69.5, 66, 62.5, 58.5, 55.5, 52, 48.5, 45.5, 42.5, 39.5, 36.5, 34, 31.5, 29, 26.5, 24.5, 22.5, 20.5, 19, 17.5, 15.5, 14.5, 13, 12, 10.5, 9.5, 8.5, 8, 7, 6.5, 5.5, 5, 4.5, 4, 3.5, 3.5, 3, 2.5, 2.5, 2, 2, 1.5, 1.5, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]), q.QUANT_LUT_STEP_1 = [[0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2], [0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2]], q.QUANT_TAB = { A: 91, B: 94, C: 8, D: 12 }, q.QUANT_LUT_STEP_2 = [[q.QUANT_TAB.C, q.QUANT_TAB.C, q.QUANT_TAB.D], [q.QUANT_TAB.A, q.QUANT_TAB.A, q.QUANT_TAB.A], [q.QUANT_TAB.B, q.QUANT_TAB.A, q.QUANT_TAB.B]], q.QUANT_LUT_STEP_3 = [[68, 68, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52], [67, 67, 67, 66, 66, 66, 66, 66, 66, 66, 66, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 32, 32, 32, 32, 32, 32, 32], [69, 69, 69, 69, 52, 52, 52, 52, 52, 52, 52, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36]], q.QUANT_LUT_STEP4 = [[0, 1, 2, 17], [0, 1, 2, 3, 4, 5, 6, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17], [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]], q.QUANT_TAB = [{ levels: 3, group: 1, bits: 5 }, { levels: 5, group: 1, bits: 7 }, { levels: 7, group: 0, bits: 3 }, { levels: 9, group: 1, bits: 10 }, { levels: 15, group: 0, bits: 4 }, { levels: 31, group: 0, bits: 5 }, { levels: 63, group: 0, bits: 6 }, { levels: 127, group: 0, bits: 7 }, { levels: 255, group: 0, bits: 8 }, { levels: 511, group: 0, bits: 9 }, { levels: 1023, group: 0, bits: 10 }, { levels: 2047, group: 0, bits: 11 }, { levels: 4095, group: 0, bits: 12 }, { levels: 8191, group: 0, bits: 13 }, { levels: 16383, group: 0, bits: 14 }, { levels: 32767, group: 0, bits: 15 }, { levels: 65535, group: 0, bits: 16 }], q), JSMpeg.Decoder.MP2AudioWASM = (((cA = function(A) {
  JSMpeg.Decoder.Base.call(this, A), this.onDecodeCallback = A.onAudioDecode, this.module = A.wasmModule, this.bufferSize = A.audioBufferSize || 131072, this.bufferMode = A.streaming ? JSMpeg.BitBuffer.MODE.EVICT : JSMpeg.BitBuffer.MODE.EXPAND, this.sampleRate = 0;
}).prototype = Object.create(JSMpeg.Decoder.Base.prototype)).constructor = cA, cA.prototype.initializeWasmDecoder = function() {
  this.module.instance && (this.instance = this.module.instance, this.functions = this.module.instance.exports, this.decoder = this.functions._mp2_decoder_create(this.bufferSize, this.bufferMode));
}, cA.prototype.destroy = function() {
  this.decoder && this.functions._mp2_decoder_destroy(this.decoder);
}, cA.prototype.bufferGetIndex = function() {
  if (this.decoder)
    return this.functions._mp2_decoder_get_index(this.decoder);
}, cA.prototype.bufferSetIndex = function(A) {
  this.decoder && this.functions._mp2_decoder_set_index(this.decoder, A);
}, cA.prototype.bufferWrite = function(A) {
  this.decoder || this.initializeWasmDecoder();
  for (var t = 0, e = 0; e < A.length; e++)
    t += A[e].length;
  var i = this.functions._mp2_decoder_get_write_ptr(this.decoder, t);
  for (e = 0; e < A.length; e++)
    this.instance.heapU8.set(A[e], i), i += A[e].length;
  return this.functions._mp2_decoder_did_write(this.decoder, t), t;
}, cA.prototype.decode = function() {
  var A = JSMpeg.Now();
  if (!this.decoder || this.functions._mp2_decoder_decode(this.decoder) === 0)
    return !1;
  if (this.sampleRate || (this.sampleRate = this.functions._mp2_decoder_get_sample_rate(this.decoder)), this.destination) {
    var t = this.functions._mp2_decoder_get_left_channel_ptr(this.decoder), e = this.functions._mp2_decoder_get_right_channel_ptr(this.decoder), i = t / Float32Array.BYTES_PER_ELEMENT, o = e / Float32Array.BYTES_PER_ELEMENT, n = this.instance.heapF32.subarray(i, i + cA.SAMPLES_PER_FRAME), h = this.instance.heapF32.subarray(o, o + cA.SAMPLES_PER_FRAME);
    this.destination.play(this.sampleRate, n, h);
  }
  this.advanceDecodedTime(cA.SAMPLES_PER_FRAME / this.sampleRate);
  var B = JSMpeg.Now() - A;
  return this.onDecodeCallback && this.onDecodeCallback(this, B), !0;
}, cA.prototype.getCurrentTime = function() {
  var A = this.destination ? this.destination.enqueuedTime : 0;
  return this.decodedTime - A;
}, cA.SAMPLES_PER_FRAME = 1152, cA), JSMpeg.Renderer.WebGL = ((j = function(A) {
  A.canvas ? (this.canvas = A.canvas, this.ownsCanvasElement = !1) : (this.canvas = document.createElement("canvas"), this.ownsCanvasElement = !0), this.width = this.canvas.width, this.height = this.canvas.height, this.enabled = !0, this.hasTextureData = {};
  var t = { preserveDrawingBuffer: !!A.preserveDrawingBuffer, alpha: !1, depth: !1, stencil: !1, antialias: !1, premultipliedAlpha: !1 };
  if (this.gl = this.canvas.getContext("webgl", t) || this.canvas.getContext("experimental-webgl", t), !this.gl)
    throw new Error("Failed to get WebGL Context");
  this.handleContextLostBound = this.handleContextLost.bind(this), this.handleContextRestoredBound = this.handleContextRestored.bind(this), this.canvas.addEventListener("webglcontextlost", this.handleContextLostBound, !1), this.canvas.addEventListener("webglcontextrestored", this.handleContextRestoredBound, !1), this.initGL();
}).prototype.initGL = function() {
  this.hasTextureData = {};
  var A = this.gl, t = null;
  A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), this.vertexBuffer = A.createBuffer();
  var e = new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]);
  A.bindBuffer(A.ARRAY_BUFFER, this.vertexBuffer), A.bufferData(A.ARRAY_BUFFER, e, A.STATIC_DRAW), this.program = this.createProgram(j.SHADER.VERTEX_IDENTITY, j.SHADER.FRAGMENT_YCRCB_TO_RGBA), t = A.getAttribLocation(this.program, "vertex"), A.enableVertexAttribArray(t), A.vertexAttribPointer(t, 2, A.FLOAT, !1, 0, 0), this.textureY = this.createTexture(0, "textureY"), this.textureCb = this.createTexture(1, "textureCb"), this.textureCr = this.createTexture(2, "textureCr"), this.loadingProgram = this.createProgram(j.SHADER.VERTEX_IDENTITY, j.SHADER.FRAGMENT_LOADING), t = A.getAttribLocation(this.loadingProgram, "vertex"), A.enableVertexAttribArray(t), A.vertexAttribPointer(t, 2, A.FLOAT, !1, 0, 0), this.shouldCreateUnclampedViews = !this.allowsClampedTextureData();
}, j.prototype.handleContextLost = function(A) {
  A.preventDefault();
}, j.prototype.handleContextRestored = function(A) {
  this.initGL();
}, j.prototype.destroy = function() {
  var A = this.gl;
  this.deleteTexture(A.TEXTURE0, this.textureY), this.deleteTexture(A.TEXTURE1, this.textureCb), this.deleteTexture(A.TEXTURE2, this.textureCr), A.useProgram(null), A.deleteProgram(this.program), A.deleteProgram(this.loadingProgram), A.bindBuffer(A.ARRAY_BUFFER, null), A.deleteBuffer(this.vertexBuffer), this.canvas.removeEventListener("webglcontextlost", this.handleContextLostBound, !1), this.canvas.removeEventListener("webglcontextrestored", this.handleContextRestoredBound, !1), this.ownsCanvasElement && this.canvas.remove();
}, j.prototype.resize = function(A, t) {
  this.width = 0 | A, this.height = 0 | t, this.canvas.width = this.width, this.canvas.height = this.height, this.gl.useProgram(this.program);
  var e = this.width + 15 >> 4 << 4;
  this.gl.viewport(0, 0, e, this.height);
}, j.prototype.createTexture = function(A, t) {
  var e = this.gl, i = e.createTexture();
  return e.bindTexture(e.TEXTURE_2D, i), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.uniform1i(e.getUniformLocation(this.program, t), A), i;
}, j.prototype.createProgram = function(A, t) {
  var e = this.gl, i = e.createProgram();
  return e.attachShader(i, this.compileShader(e.VERTEX_SHADER, A)), e.attachShader(i, this.compileShader(e.FRAGMENT_SHADER, t)), e.linkProgram(i), e.useProgram(i), i;
}, j.prototype.compileShader = function(A, t) {
  var e = this.gl, i = e.createShader(A);
  if (e.shaderSource(i, t), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS))
    throw new Error(e.getShaderInfoLog(i));
  return i;
}, j.prototype.allowsClampedTextureData = function() {
  var A = this.gl, t = A.createTexture();
  return A.bindTexture(A.TEXTURE_2D, t), A.texImage2D(A.TEXTURE_2D, 0, A.LUMINANCE, 1, 1, 0, A.LUMINANCE, A.UNSIGNED_BYTE, new Uint8ClampedArray([0])), A.getError() === 0;
}, j.prototype.renderProgress = function(A) {
  var t = this.gl;
  t.useProgram(this.loadingProgram);
  var e = t.getUniformLocation(this.loadingProgram, "progress");
  t.uniform1f(e, A), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
}, j.prototype.render = function(A, t, e, i) {
  if (this.enabled) {
    var o = this.gl, n = this.width + 15 >> 4 << 4, h = this.height, B = n >> 1, p = h >> 1;
    i && this.shouldCreateUnclampedViews && (A = new Uint8Array(A.buffer), t = new Uint8Array(t.buffer), e = new Uint8Array(e.buffer)), o.useProgram(this.program), this.updateTexture(o.TEXTURE0, this.textureY, n, h, A), this.updateTexture(o.TEXTURE1, this.textureCb, B, p, t), this.updateTexture(o.TEXTURE2, this.textureCr, B, p, e), o.drawArrays(o.TRIANGLE_STRIP, 0, 4);
  }
}, j.prototype.updateTexture = function(A, t, e, i, o) {
  var n = this.gl;
  n.activeTexture(A), n.bindTexture(n.TEXTURE_2D, t), this.hasTextureData[A] ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, e, i, n.LUMINANCE, n.UNSIGNED_BYTE, o) : (this.hasTextureData[A] = !0, n.texImage2D(n.TEXTURE_2D, 0, n.LUMINANCE, e, i, 0, n.LUMINANCE, n.UNSIGNED_BYTE, o));
}, j.prototype.deleteTexture = function(A, t) {
  var e = this.gl;
  e.activeTexture(A), e.bindTexture(e.TEXTURE_2D, null), e.deleteTexture(t);
}, j.IsSupported = function() {
  try {
    if (!window.WebGLRenderingContext)
      return !1;
    var A = document.createElement("canvas");
    return !(!A.getContext("webgl") && !A.getContext("experimental-webgl"));
  } catch {
    return !1;
  }
}, j.SHADER = { FRAGMENT_YCRCB_TO_RGBA: ["precision mediump float;", "uniform sampler2D textureY;", "uniform sampler2D textureCb;", "uniform sampler2D textureCr;", "varying vec2 texCoord;", "mat4 rec601 = mat4(", "1.16438,  0.00000,  1.59603, -0.87079,", "1.16438, -0.39176, -0.81297,  0.52959,", "1.16438,  2.01723,  0.00000, -1.08139,", "0, 0, 0, 1", ");", "void main() {", "float y = texture2D(textureY, texCoord).r;", "float cb = texture2D(textureCb, texCoord).r;", "float cr = texture2D(textureCr, texCoord).r;", "gl_FragColor = vec4(y, cr, cb, 1.0) * rec601;", "}"].join(`
`), FRAGMENT_LOADING: ["precision mediump float;", "uniform float progress;", "varying vec2 texCoord;", "void main() {", "float c = ceil(progress-(1.0-texCoord.y));", "gl_FragColor = vec4(c,c,c,1);", "}"].join(`
`), VERTEX_IDENTITY: ["attribute vec2 vertex;", "varying vec2 texCoord;", "void main() {", "texCoord = vertex;", "gl_Position = vec4((vertex * 2.0 - 1.0) * vec2(1, -1), 0.0, 1.0);", "}"].join(`
`) }, j), JSMpeg.Renderer.Canvas2D = ((_A = function(A) {
  A.canvas ? (this.canvas = A.canvas, this.ownsCanvasElement = !1) : (this.canvas = document.createElement("canvas"), this.ownsCanvasElement = !0), this.width = this.canvas.width, this.height = this.canvas.height, this.enabled = !0, this.context = this.canvas.getContext("2d");
}).prototype.destroy = function() {
  this.ownsCanvasElement && this.canvas.remove();
}, _A.prototype.resize = function(A, t) {
  this.width = 0 | A, this.height = 0 | t, this.canvas.width = this.width, this.canvas.height = this.height, this.imageData = this.context.getImageData(0, 0, this.width, this.height), JSMpeg.Fill(this.imageData.data, 255);
}, _A.prototype.renderProgress = function(A) {
  var t = this.canvas.width, e = this.canvas.height, i = this.context;
  i.fillStyle = "#222", i.fillRect(0, 0, t, e), i.fillStyle = "#fff", i.fillRect(0, e - e * A, t, e * A);
}, _A.prototype.render = function(A, t, e) {
  this.YCbCrToRGBA(A, t, e, this.imageData.data), this.context.putImageData(this.imageData, 0, 0);
}, _A.prototype.YCbCrToRGBA = function(A, t, e, i) {
  if (this.enabled)
    for (var o, n, h, B, p, c = this.width + 15 >> 4 << 4, E = c >> 1, I = 0, l = c, d = c + (c - this.width), g = 0, S = E - (this.width >> 1), s = 0, r = 4 * this.width, Q = 4 * this.width, a = this.width >> 1, C = this.height >> 1, u = 0; u < C; u++) {
      for (var f = 0; f < a; f++) {
        o = t[g], n = e[g], g++, h = o + (103 * o >> 8) - 179, B = (88 * n >> 8) - 44 + (183 * o >> 8) - 91, p = n + (198 * n >> 8) - 227;
        var m = A[I++], y = A[I++];
        i[s] = m + h, i[s + 1] = m - B, i[s + 2] = m + p, i[s + 4] = y + h, i[s + 5] = y - B, i[s + 6] = y + p, s += 8;
        var F = A[l++], G = A[l++];
        i[r] = F + h, i[r + 1] = F - B, i[r + 2] = F + p, i[r + 4] = G + h, i[r + 5] = G - B, i[r + 6] = G + p, r += 8;
      }
      I += d, l += d, s += Q, r += Q, g += S;
    }
}, _A), JSMpeg.AudioOutput.WebAudio = ((IA = function(A) {
  this.context = IA.CachedContext = IA.CachedContext || new (window.AudioContext || window.webkitAudioContext)(), this.gain = this.context.createGain(), this.destination = this.gain, this.gain.connect(this.context.destination), this.context._connections = (this.context._connections || 0) + 1, this.startTime = 0, this.buffer = null, this.wallclockStartTime = 0, this.volume = 1, this.enabled = !0, this.unlocked = !IA.NeedsUnlocking(), Object.defineProperty(this, "enqueuedTime", { get: this.getEnqueuedTime });
}).prototype.destroy = function() {
  this.gain.disconnect(), this.context._connections--, this.context._connections === 0 && (this.context.close(), IA.CachedContext = null);
}, IA.prototype.play = function(A, t, e) {
  if (this.enabled) {
    if (!this.unlocked) {
      var i = JSMpeg.Now();
      return this.wallclockStartTime < i && (this.wallclockStartTime = i), void (this.wallclockStartTime += t.length / A);
    }
    this.gain.gain.value = this.volume;
    var o = this.context.createBuffer(2, t.length, A);
    o.getChannelData(0).set(t), o.getChannelData(1).set(e);
    var n = this.context.createBufferSource();
    n.buffer = o, n.connect(this.destination);
    var h = this.context.currentTime, B = o.duration;
    this.startTime < h && (this.startTime = h, this.wallclockStartTime = JSMpeg.Now()), n.start(this.startTime), this.startTime += B, this.wallclockStartTime += B;
  }
}, IA.prototype.stop = function() {
  this.gain.gain.value = 0;
}, IA.prototype.getEnqueuedTime = function() {
  return Math.max(this.wallclockStartTime - JSMpeg.Now(), 0);
}, IA.prototype.resetEnqueuedTime = function() {
  this.startTime = this.context.currentTime, this.wallclockStartTime = JSMpeg.Now();
}, IA.prototype.unlock = function(A) {
  if (this.unlocked)
    A && A();
  else {
    this.unlockCallback = A;
    var t = this.context.createBuffer(1, 1, 22050), e = this.context.createBufferSource();
    e.buffer = t, e.connect(this.destination), e.start(0), setTimeout(this.checkIfUnlocked.bind(this, e, 0), 0);
  }
}, IA.prototype.checkIfUnlocked = function(A, t) {
  A.playbackState === A.PLAYING_STATE || A.playbackState === A.FINISHED_STATE ? (this.unlocked = !0, this.unlockCallback && (this.unlockCallback(), this.unlockCallback = null)) : t < 10 && setTimeout(this.checkIfUnlocked.bind(this, A, t + 1), 100);
}, IA.NeedsUnlocking = function() {
  return /iPhone|iPad|iPod/i.test(navigator.userAgent);
}, IA.IsSupported = function() {
  return window.AudioContext || window.webkitAudioContext;
}, IA.CachedContext = null, IA), JSMpeg.WASMModule = ((BA = function() {
  this.stackSize = 5242880, this.pageSize = 65536, this.onInitCallbacks = [], this.ready = !1, this.loadingFromFileStarted = !1, this.loadingFromBufferStarted = !1;
}).prototype.write = function(A) {
  this.loadFromBuffer(A);
}, BA.prototype.loadFromFile = function(A, t) {
  if (t && this.onInitCallbacks.push(t), !this.loadingFromFileStarted) {
    this.loadingFromFileStarted = !0, this.onInitCallback = t;
    var e = new JSMpeg.Source.Ajax(A, {});
    e.connect(this), e.start();
  }
}, BA.prototype.loadFromBuffer = function(A, t) {
  if (t && this.onInitCallbacks.push(t), !this.loadingFromBufferStarted)
    if (this.loadingFromBufferStarted = !0, this.moduleInfo = this.readDylinkSection(A), this.moduleInfo) {
      this.memory = new WebAssembly.Memory({ initial: 256 });
      var e = { memory: this.memory, memoryBase: 0, __memory_base: 0, table: new WebAssembly.Table({ initial: this.moduleInfo.tableSize, element: "anyfunc" }), tableBase: 0, __table_base: 0, abort: this.c_abort.bind(this), ___assert_fail: this.c_assertFail.bind(this), _sbrk: this.c_sbrk.bind(this) };
      this.brk = this.align(this.moduleInfo.memorySize + this.stackSize), WebAssembly.instantiate(A, { env: e }).then(function(o) {
        this.instance = o.instance, this.instance.exports.__post_instantiate && this.instance.exports.__post_instantiate(), this.createHeapViews(), this.ready = !0;
        for (var n = 0; n < this.onInitCallbacks.length; n++)
          this.onInitCallbacks[n](this);
      }.bind(this));
    } else
      for (var i = 0; i < this.onInitCallbacks.length; i++)
        this.onInitCallbacks[i](null);
}, BA.prototype.createHeapViews = function() {
  this.instance.heapU8 = new Uint8Array(this.memory.buffer), this.instance.heapU32 = new Uint32Array(this.memory.buffer), this.instance.heapF32 = new Float32Array(this.memory.buffer);
}, BA.prototype.align = function(A) {
  var t = Math.pow(2, this.moduleInfo.memoryAlignment);
  return Math.ceil(A / t) * t;
}, BA.prototype.c_sbrk = function(A) {
  var t = this.brk;
  if (this.brk += A, this.brk > this.memory.buffer.byteLength) {
    var e = this.brk - this.memory.buffer.byteLength, i = Math.ceil(e / this.pageSize);
    this.memory.grow(i), this.createHeapViews();
  }
  return t;
}, BA.prototype.c_abort = function(A) {
}, BA.prototype.c_assertFail = function(A) {
}, BA.prototype.readDylinkSection = function(A) {
  var t = new Uint8Array(A), e = 0, i = function() {
    for (var n = 0, h = 1; ; ) {
      var B = t[e++];
      if (n += (127 & B) * h, h *= 128, !(128 & B))
        return n;
    }
  }, o = function(n) {
    for (var h = 0; h < n.length; h++) {
      var B = typeof n[h] == "string" ? n[h].charCodeAt(0) : n[h];
      if (t[e++] !== B)
        return !1;
    }
    return !0;
  };
  return o([0, "a", "s", "m"]) ? (e = 9, i(), o([6, "d", "y", "l", "i", "n", "k"]) ? { memorySize: i(), memoryAlignment: i(), tableSize: i(), tableAlignment: i() } : null) : null;
}, BA.IsSupported = function() {
  return !!window.WebAssembly;
}, BA.GetModule = function() {
  return BA.CACHED_MODULE = BA.CACHED_MODULE || new BA();
}, BA), JSMpeg.WASM_BINARY_INLINED = " ", (jA = (jA = et) || et) && !jA.__composition_api_installed__ && jA.use(ie), et.version;
var it = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function he(A) {
  if (A.__esModule)
    return A;
  var t = A.default;
  if (typeof t == "function") {
    var e = function i() {
      if (this instanceof i) {
        var o = [null];
        return o.push.apply(o, arguments), new (Function.bind.apply(t, o))();
      }
      return t.apply(this, arguments);
    };
    e.prototype = t.prototype;
  } else
    e = {};
  return Object.defineProperty(e, "__esModule", { value: !0 }), Object.keys(A).forEach(function(i) {
    var o = Object.getOwnPropertyDescriptor(A, i);
    Object.defineProperty(e, i, o.get ? o : { enumerable: !0, get: function() {
      return A[i];
    } });
  }), e;
}
var rt = {}, Ce = { get exports() {
  return rt;
}, set exports(A) {
  rt = A;
} }, at = {}, ce = { get exports() {
  return at;
}, set exports(A) {
  at = A;
} };
const Ee = he(Object.freeze(Object.defineProperty({ __proto__: null, default: {} }, Symbol.toStringTag, { value: "Module" })));
var lt;
function NA() {
  return lt || (lt = 1, ce.exports = (A = A || function(t, e) {
    var i;
    if (typeof window < "u" && window.crypto && (i = window.crypto), typeof self < "u" && self.crypto && (i = self.crypto), typeof globalThis < "u" && globalThis.crypto && (i = globalThis.crypto), !i && typeof window < "u" && window.msCrypto && (i = window.msCrypto), !i && it !== void 0 && it.crypto && (i = it.crypto), !i)
      try {
        i = Ee;
      } catch {
      }
    var o = function() {
      if (i) {
        if (typeof i.getRandomValues == "function")
          try {
            return i.getRandomValues(new Uint32Array(1))[0];
          } catch {
          }
        if (typeof i.randomBytes == "function")
          try {
            return i.randomBytes(4).readInt32LE();
          } catch {
          }
      }
      throw new Error("Native crypto module could not be used to get secure random number.");
    }, n = Object.create || function() {
      function s() {
      }
      return function(r) {
        var Q;
        return s.prototype = r, Q = new s(), s.prototype = null, Q;
      };
    }(), h = {}, B = h.lib = {}, p = B.Base = { extend: function(s) {
      var r = n(this);
      return s && r.mixIn(s), r.hasOwnProperty("init") && this.init !== r.init || (r.init = function() {
        r.$super.init.apply(this, arguments);
      }), r.init.prototype = r, r.$super = this, r;
    }, create: function() {
      var s = this.extend();
      return s.init.apply(s, arguments), s;
    }, init: function() {
    }, mixIn: function(s) {
      for (var r in s)
        s.hasOwnProperty(r) && (this[r] = s[r]);
      s.hasOwnProperty("toString") && (this.toString = s.toString);
    }, clone: function() {
      return this.init.prototype.extend(this);
    } }, c = B.WordArray = p.extend({ init: function(s, r) {
      s = this.words = s || [], this.sigBytes = r != e ? r : 4 * s.length;
    }, toString: function(s) {
      return (s || I).stringify(this);
    }, concat: function(s) {
      var r = this.words, Q = s.words, a = this.sigBytes, C = s.sigBytes;
      if (this.clamp(), a % 4)
        for (var u = 0; u < C; u++) {
          var f = Q[u >>> 2] >>> 24 - u % 4 * 8 & 255;
          r[a + u >>> 2] |= f << 24 - (a + u) % 4 * 8;
        }
      else
        for (var m = 0; m < C; m += 4)
          r[a + m >>> 2] = Q[m >>> 2];
      return this.sigBytes += C, this;
    }, clamp: function() {
      var s = this.words, r = this.sigBytes;
      s[r >>> 2] &= 4294967295 << 32 - r % 4 * 8, s.length = t.ceil(r / 4);
    }, clone: function() {
      var s = p.clone.call(this);
      return s.words = this.words.slice(0), s;
    }, random: function(s) {
      for (var r = [], Q = 0; Q < s; Q += 4)
        r.push(o());
      return new c.init(r, s);
    } }), E = h.enc = {}, I = E.Hex = { stringify: function(s) {
      for (var r = s.words, Q = s.sigBytes, a = [], C = 0; C < Q; C++) {
        var u = r[C >>> 2] >>> 24 - C % 4 * 8 & 255;
        a.push((u >>> 4).toString(16)), a.push((15 & u).toString(16));
      }
      return a.join("");
    }, parse: function(s) {
      for (var r = s.length, Q = [], a = 0; a < r; a += 2)
        Q[a >>> 3] |= parseInt(s.substr(a, 2), 16) << 24 - a % 8 * 4;
      return new c.init(Q, r / 2);
    } }, l = E.Latin1 = { stringify: function(s) {
      for (var r = s.words, Q = s.sigBytes, a = [], C = 0; C < Q; C++) {
        var u = r[C >>> 2] >>> 24 - C % 4 * 8 & 255;
        a.push(String.fromCharCode(u));
      }
      return a.join("");
    }, parse: function(s) {
      for (var r = s.length, Q = [], a = 0; a < r; a++)
        Q[a >>> 2] |= (255 & s.charCodeAt(a)) << 24 - a % 4 * 8;
      return new c.init(Q, r);
    } }, d = E.Utf8 = { stringify: function(s) {
      try {
        return decodeURIComponent(escape(l.stringify(s)));
      } catch {
        throw new Error("Malformed UTF-8 data");
      }
    }, parse: function(s) {
      return l.parse(unescape(encodeURIComponent(s)));
    } }, g = B.BufferedBlockAlgorithm = p.extend({ reset: function() {
      this._data = new c.init(), this._nDataBytes = 0;
    }, _append: function(s) {
      typeof s == "string" && (s = d.parse(s)), this._data.concat(s), this._nDataBytes += s.sigBytes;
    }, _process: function(s) {
      var r, Q = this._data, a = Q.words, C = Q.sigBytes, u = this.blockSize, f = C / (4 * u), m = (f = s ? t.ceil(f) : t.max((0 | f) - this._minBufferSize, 0)) * u, y = t.min(4 * m, C);
      if (m) {
        for (var F = 0; F < m; F += u)
          this._doProcessBlock(a, F);
        r = a.splice(0, m), Q.sigBytes -= y;
      }
      return new c.init(r, y);
    }, clone: function() {
      var s = p.clone.call(this);
      return s._data = this._data.clone(), s;
    }, _minBufferSize: 0 });
    B.Hasher = g.extend({ cfg: p.extend(), init: function(s) {
      this.cfg = this.cfg.extend(s), this.reset();
    }, reset: function() {
      g.reset.call(this), this._doReset();
    }, update: function(s) {
      return this._append(s), this._process(), this;
    }, finalize: function(s) {
      return s && this._append(s), this._doFinalize();
    }, blockSize: 16, _createHelper: function(s) {
      return function(r, Q) {
        return new s.init(Q).finalize(r);
      };
    }, _createHmacHelper: function(s) {
      return function(r, Q) {
        return new S.HMAC.init(s, Q).finalize(r);
      };
    } });
    var S = h.algo = {};
    return h;
  }(Math), A)), at;
  var A;
}
var ut, nt = {}, de = { get exports() {
  return nt;
}, set exports(A) {
  nt = A;
} };
function Qe() {
  return ut || (ut = 1, de.exports = (A = NA(), function() {
    var t = A, e = t.lib.WordArray;
    function i(o, n, h) {
      for (var B = [], p = 0, c = 0; c < n; c++)
        if (c % 4) {
          var E = h[o.charCodeAt(c - 1)] << c % 4 * 2 | h[o.charCodeAt(c)] >>> 6 - c % 4 * 2;
          B[p >>> 2] |= E << 24 - p % 4 * 8, p++;
        }
      return e.create(B, p);
    }
    t.enc.Base64 = { stringify: function(o) {
      var n = o.words, h = o.sigBytes, B = this._map;
      o.clamp();
      for (var p = [], c = 0; c < h; c += 3)
        for (var E = (n[c >>> 2] >>> 24 - c % 4 * 8 & 255) << 16 | (n[c + 1 >>> 2] >>> 24 - (c + 1) % 4 * 8 & 255) << 8 | n[c + 2 >>> 2] >>> 24 - (c + 2) % 4 * 8 & 255, I = 0; I < 4 && c + 0.75 * I < h; I++)
          p.push(B.charAt(E >>> 6 * (3 - I) & 63));
      var l = B.charAt(64);
      if (l)
        for (; p.length % 4; )
          p.push(l);
      return p.join("");
    }, parse: function(o) {
      var n = o.length, h = this._map, B = this._reverseMap;
      if (!B) {
        B = this._reverseMap = [];
        for (var p = 0; p < h.length; p++)
          B[h.charCodeAt(p)] = p;
      }
      var c = h.charAt(64);
      if (c) {
        var E = o.indexOf(c);
        E !== -1 && (n = E);
      }
      return i(o, n, B);
    }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  }(), A.enc.Base64)), nt;
  var A;
}
var pt, gt = {}, le = { get exports() {
  return gt;
}, set exports(A) {
  gt = A;
} };
function ue() {
  return pt || (pt = 1, le.exports = (A = NA(), function(t) {
    var e = A, i = e.lib, o = i.WordArray, n = i.Hasher, h = e.algo, B = [];
    (function() {
      for (var d = 0; d < 64; d++)
        B[d] = 4294967296 * t.abs(t.sin(d + 1)) | 0;
    })();
    var p = h.MD5 = n.extend({ _doReset: function() {
      this._hash = new o.init([1732584193, 4023233417, 2562383102, 271733878]);
    }, _doProcessBlock: function(d, g) {
      for (var S = 0; S < 16; S++) {
        var s = g + S, r = d[s];
        d[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
      }
      var Q = this._hash.words, a = d[g + 0], C = d[g + 1], u = d[g + 2], f = d[g + 3], m = d[g + 4], y = d[g + 5], F = d[g + 6], G = d[g + 7], x = d[g + 8], L = d[g + 9], T = d[g + 10], U = d[g + 11], _ = d[g + 12], k = d[g + 13], R = d[g + 14], N = d[g + 15], D = Q[0], b = Q[1], M = Q[2], w = Q[3];
      D = c(D, b, M, w, a, 7, B[0]), w = c(w, D, b, M, C, 12, B[1]), M = c(M, w, D, b, u, 17, B[2]), b = c(b, M, w, D, f, 22, B[3]), D = c(D, b, M, w, m, 7, B[4]), w = c(w, D, b, M, y, 12, B[5]), M = c(M, w, D, b, F, 17, B[6]), b = c(b, M, w, D, G, 22, B[7]), D = c(D, b, M, w, x, 7, B[8]), w = c(w, D, b, M, L, 12, B[9]), M = c(M, w, D, b, T, 17, B[10]), b = c(b, M, w, D, U, 22, B[11]), D = c(D, b, M, w, _, 7, B[12]), w = c(w, D, b, M, k, 12, B[13]), M = c(M, w, D, b, R, 17, B[14]), D = E(D, b = c(b, M, w, D, N, 22, B[15]), M, w, C, 5, B[16]), w = E(w, D, b, M, F, 9, B[17]), M = E(M, w, D, b, U, 14, B[18]), b = E(b, M, w, D, a, 20, B[19]), D = E(D, b, M, w, y, 5, B[20]), w = E(w, D, b, M, T, 9, B[21]), M = E(M, w, D, b, N, 14, B[22]), b = E(b, M, w, D, m, 20, B[23]), D = E(D, b, M, w, L, 5, B[24]), w = E(w, D, b, M, R, 9, B[25]), M = E(M, w, D, b, f, 14, B[26]), b = E(b, M, w, D, x, 20, B[27]), D = E(D, b, M, w, k, 5, B[28]), w = E(w, D, b, M, u, 9, B[29]), M = E(M, w, D, b, G, 14, B[30]), D = I(D, b = E(b, M, w, D, _, 20, B[31]), M, w, y, 4, B[32]), w = I(w, D, b, M, x, 11, B[33]), M = I(M, w, D, b, U, 16, B[34]), b = I(b, M, w, D, R, 23, B[35]), D = I(D, b, M, w, C, 4, B[36]), w = I(w, D, b, M, m, 11, B[37]), M = I(M, w, D, b, G, 16, B[38]), b = I(b, M, w, D, T, 23, B[39]), D = I(D, b, M, w, k, 4, B[40]), w = I(w, D, b, M, a, 11, B[41]), M = I(M, w, D, b, f, 16, B[42]), b = I(b, M, w, D, F, 23, B[43]), D = I(D, b, M, w, L, 4, B[44]), w = I(w, D, b, M, _, 11, B[45]), M = I(M, w, D, b, N, 16, B[46]), D = l(D, b = I(b, M, w, D, u, 23, B[47]), M, w, a, 6, B[48]), w = l(w, D, b, M, G, 10, B[49]), M = l(M, w, D, b, R, 15, B[50]), b = l(b, M, w, D, y, 21, B[51]), D = l(D, b, M, w, _, 6, B[52]), w = l(w, D, b, M, f, 10, B[53]), M = l(M, w, D, b, T, 15, B[54]), b = l(b, M, w, D, C, 21, B[55]), D = l(D, b, M, w, x, 6, B[56]), w = l(w, D, b, M, N, 10, B[57]), M = l(M, w, D, b, F, 15, B[58]), b = l(b, M, w, D, k, 21, B[59]), D = l(D, b, M, w, m, 6, B[60]), w = l(w, D, b, M, U, 10, B[61]), M = l(M, w, D, b, u, 15, B[62]), b = l(b, M, w, D, L, 21, B[63]), Q[0] = Q[0] + D | 0, Q[1] = Q[1] + b | 0, Q[2] = Q[2] + M | 0, Q[3] = Q[3] + w | 0;
    }, _doFinalize: function() {
      var d = this._data, g = d.words, S = 8 * this._nDataBytes, s = 8 * d.sigBytes;
      g[s >>> 5] |= 128 << 24 - s % 32;
      var r = t.floor(S / 4294967296), Q = S;
      g[15 + (s + 64 >>> 9 << 4)] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8), g[14 + (s + 64 >>> 9 << 4)] = 16711935 & (Q << 8 | Q >>> 24) | 4278255360 & (Q << 24 | Q >>> 8), d.sigBytes = 4 * (g.length + 1), this._process();
      for (var a = this._hash, C = a.words, u = 0; u < 4; u++) {
        var f = C[u];
        C[u] = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8);
      }
      return a;
    }, clone: function() {
      var d = n.clone.call(this);
      return d._hash = this._hash.clone(), d;
    } });
    function c(d, g, S, s, r, Q, a) {
      var C = d + (g & S | ~g & s) + r + a;
      return (C << Q | C >>> 32 - Q) + g;
    }
    function E(d, g, S, s, r, Q, a) {
      var C = d + (g & s | S & ~s) + r + a;
      return (C << Q | C >>> 32 - Q) + g;
    }
    function I(d, g, S, s, r, Q, a) {
      var C = d + (g ^ S ^ s) + r + a;
      return (C << Q | C >>> 32 - Q) + g;
    }
    function l(d, g, S, s, r, Q, a) {
      var C = d + (S ^ (g | ~s)) + r + a;
      return (C << Q | C >>> 32 - Q) + g;
    }
    e.MD5 = n._createHelper(p), e.HmacMD5 = n._createHmacHelper(p);
  }(Math), A.MD5)), gt;
  var A;
}
var ft, It = {}, pe = { get exports() {
  return It;
}, set exports(A) {
  It = A;
} }, Bt = {}, fe = { get exports() {
  return Bt;
}, set exports(A) {
  Bt = A;
} };
function me() {
  return ft || (ft = 1, fe.exports = (B = NA(), t = (A = B).lib, e = t.WordArray, i = t.Hasher, o = A.algo, n = [], h = o.SHA1 = i.extend({ _doReset: function() {
    this._hash = new e.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
  }, _doProcessBlock: function(p, c) {
    for (var E = this._hash.words, I = E[0], l = E[1], d = E[2], g = E[3], S = E[4], s = 0; s < 80; s++) {
      if (s < 16)
        n[s] = 0 | p[c + s];
      else {
        var r = n[s - 3] ^ n[s - 8] ^ n[s - 14] ^ n[s - 16];
        n[s] = r << 1 | r >>> 31;
      }
      var Q = (I << 5 | I >>> 27) + S + n[s];
      Q += s < 20 ? 1518500249 + (l & d | ~l & g) : s < 40 ? 1859775393 + (l ^ d ^ g) : s < 60 ? (l & d | l & g | d & g) - 1894007588 : (l ^ d ^ g) - 899497514, S = g, g = d, d = l << 30 | l >>> 2, l = I, I = Q;
    }
    E[0] = E[0] + I | 0, E[1] = E[1] + l | 0, E[2] = E[2] + d | 0, E[3] = E[3] + g | 0, E[4] = E[4] + S | 0;
  }, _doFinalize: function() {
    var p = this._data, c = p.words, E = 8 * this._nDataBytes, I = 8 * p.sigBytes;
    return c[I >>> 5] |= 128 << 24 - I % 32, c[14 + (I + 64 >>> 9 << 4)] = Math.floor(E / 4294967296), c[15 + (I + 64 >>> 9 << 4)] = E, p.sigBytes = 4 * c.length, this._process(), this._hash;
  }, clone: function() {
    var p = i.clone.call(this);
    return p._hash = this._hash.clone(), p;
  } }), A.SHA1 = i._createHelper(h), A.HmacSHA1 = i._createHmacHelper(h), B.SHA1)), Bt;
  var A, t, e, i, o, n, h, B;
}
var mt, yt, wt = {}, ye = { get exports() {
  return wt;
}, set exports(A) {
  wt = A;
} };
function Dt() {
  return yt || (yt = 1, pe.exports = function(o) {
    return function() {
      var n = o, h = n.lib, B = h.Base, p = h.WordArray, c = n.algo, E = c.MD5, I = c.EvpKDF = B.extend({ cfg: B.extend({ keySize: 4, hasher: E, iterations: 1 }), init: function(l) {
        this.cfg = this.cfg.extend(l);
      }, compute: function(l, d) {
        for (var g, S = this.cfg, s = S.hasher.create(), r = p.create(), Q = r.words, a = S.keySize, C = S.iterations; Q.length < a; ) {
          g && s.update(g), g = s.update(l).finalize(d), s.reset();
          for (var u = 1; u < C; u++)
            g = s.finalize(g), s.reset();
          r.concat(g);
        }
        return r.sigBytes = 4 * a, r;
      } });
      n.EvpKDF = function(l, d, g) {
        return I.create(g).compute(l, d);
      };
    }(), o.EvpKDF;
  }(NA(), me(), mt || (mt = 1, ye.exports = (A = NA(), e = (t = A).lib.Base, i = t.enc.Utf8, void (t.algo.HMAC = e.extend({ init: function(o, n) {
    o = this._hasher = new o.init(), typeof n == "string" && (n = i.parse(n));
    var h = o.blockSize, B = 4 * h;
    n.sigBytes > B && (n = o.finalize(n)), n.clamp();
    for (var p = this._oKey = n.clone(), c = this._iKey = n.clone(), E = p.words, I = c.words, l = 0; l < h; l++)
      E[l] ^= 1549556828, I[l] ^= 909522486;
    p.sigBytes = c.sigBytes = B, this.reset();
  }, reset: function() {
    var o = this._hasher;
    o.reset(), o.update(this._iKey);
  }, update: function(o) {
    return this._hasher.update(o), this;
  }, finalize: function(o) {
    var n = this._hasher, h = n.finalize(o);
    return n.reset(), n.finalize(this._oKey.clone().concat(h));
  } })))))), It;
  var A, t, e, i;
}
var bt, ot, St = {}, we = { get exports() {
  return St;
}, set exports(A) {
  St = A;
} };
Ce.exports = function(A) {
  return function() {
    var t = A, e = t.lib.BlockCipher, i = t.algo, o = [], n = [], h = [], B = [], p = [], c = [], E = [], I = [], l = [], d = [];
    (function() {
      for (var s = [], r = 0; r < 256; r++)
        s[r] = r < 128 ? r << 1 : r << 1 ^ 283;
      var Q = 0, a = 0;
      for (r = 0; r < 256; r++) {
        var C = a ^ a << 1 ^ a << 2 ^ a << 3 ^ a << 4;
        C = C >>> 8 ^ 255 & C ^ 99, o[Q] = C, n[C] = Q;
        var u = s[Q], f = s[u], m = s[f], y = 257 * s[C] ^ 16843008 * C;
        h[Q] = y << 24 | y >>> 8, B[Q] = y << 16 | y >>> 16, p[Q] = y << 8 | y >>> 24, c[Q] = y, y = 16843009 * m ^ 65537 * f ^ 257 * u ^ 16843008 * Q, E[C] = y << 24 | y >>> 8, I[C] = y << 16 | y >>> 16, l[C] = y << 8 | y >>> 24, d[C] = y, Q ? (Q = u ^ s[s[s[m ^ u]]], a ^= s[s[a]]) : Q = a = 1;
      }
    })();
    var g = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], S = i.AES = e.extend({ _doReset: function() {
      if (!this._nRounds || this._keyPriorReset !== this._key) {
        for (var s = this._keyPriorReset = this._key, r = s.words, Q = s.sigBytes / 4, a = 4 * ((this._nRounds = Q + 6) + 1), C = this._keySchedule = [], u = 0; u < a; u++)
          u < Q ? C[u] = r[u] : (y = C[u - 1], u % Q ? Q > 6 && u % Q == 4 && (y = o[y >>> 24] << 24 | o[y >>> 16 & 255] << 16 | o[y >>> 8 & 255] << 8 | o[255 & y]) : (y = o[(y = y << 8 | y >>> 24) >>> 24] << 24 | o[y >>> 16 & 255] << 16 | o[y >>> 8 & 255] << 8 | o[255 & y], y ^= g[u / Q | 0] << 24), C[u] = C[u - Q] ^ y);
        for (var f = this._invKeySchedule = [], m = 0; m < a; m++) {
          if (u = a - m, m % 4)
            var y = C[u];
          else
            y = C[u - 4];
          f[m] = m < 4 || u <= 4 ? y : E[o[y >>> 24]] ^ I[o[y >>> 16 & 255]] ^ l[o[y >>> 8 & 255]] ^ d[o[255 & y]];
        }
      }
    }, encryptBlock: function(s, r) {
      this._doCryptBlock(s, r, this._keySchedule, h, B, p, c, o);
    }, decryptBlock: function(s, r) {
      var Q = s[r + 1];
      s[r + 1] = s[r + 3], s[r + 3] = Q, this._doCryptBlock(s, r, this._invKeySchedule, E, I, l, d, n), Q = s[r + 1], s[r + 1] = s[r + 3], s[r + 3] = Q;
    }, _doCryptBlock: function(s, r, Q, a, C, u, f, m) {
      for (var y = this._nRounds, F = s[r] ^ Q[0], G = s[r + 1] ^ Q[1], x = s[r + 2] ^ Q[2], L = s[r + 3] ^ Q[3], T = 4, U = 1; U < y; U++) {
        var _ = a[F >>> 24] ^ C[G >>> 16 & 255] ^ u[x >>> 8 & 255] ^ f[255 & L] ^ Q[T++], k = a[G >>> 24] ^ C[x >>> 16 & 255] ^ u[L >>> 8 & 255] ^ f[255 & F] ^ Q[T++], R = a[x >>> 24] ^ C[L >>> 16 & 255] ^ u[F >>> 8 & 255] ^ f[255 & G] ^ Q[T++], N = a[L >>> 24] ^ C[F >>> 16 & 255] ^ u[G >>> 8 & 255] ^ f[255 & x] ^ Q[T++];
        F = _, G = k, x = R, L = N;
      }
      _ = (m[F >>> 24] << 24 | m[G >>> 16 & 255] << 16 | m[x >>> 8 & 255] << 8 | m[255 & L]) ^ Q[T++], k = (m[G >>> 24] << 24 | m[x >>> 16 & 255] << 16 | m[L >>> 8 & 255] << 8 | m[255 & F]) ^ Q[T++], R = (m[x >>> 24] << 24 | m[L >>> 16 & 255] << 16 | m[F >>> 8 & 255] << 8 | m[255 & G]) ^ Q[T++], N = (m[L >>> 24] << 24 | m[F >>> 16 & 255] << 16 | m[G >>> 8 & 255] << 8 | m[255 & x]) ^ Q[T++], s[r] = _, s[r + 1] = k, s[r + 2] = R, s[r + 3] = N;
    }, keySize: 8 });
    t.AES = e._createHelper(S);
  }(), A.AES;
}(NA(), Qe(), ue(), Dt(), bt || (bt = 1, we.exports = (ot = NA(), Dt(), void (ot.lib.Cipher || function(A) {
  var t = ot, e = t.lib, i = e.Base, o = e.WordArray, n = e.BufferedBlockAlgorithm, h = t.enc;
  h.Utf8;
  var B = h.Base64, p = t.algo.EvpKDF, c = e.Cipher = n.extend({ cfg: i.extend(), createEncryptor: function(a, C) {
    return this.create(this._ENC_XFORM_MODE, a, C);
  }, createDecryptor: function(a, C) {
    return this.create(this._DEC_XFORM_MODE, a, C);
  }, init: function(a, C, u) {
    this.cfg = this.cfg.extend(u), this._xformMode = a, this._key = C, this.reset();
  }, reset: function() {
    n.reset.call(this), this._doReset();
  }, process: function(a) {
    return this._append(a), this._process();
  }, finalize: function(a) {
    return a && this._append(a), this._doFinalize();
  }, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function() {
    function a(C) {
      return typeof C == "string" ? Q : s;
    }
    return function(C) {
      return { encrypt: function(u, f, m) {
        return a(f).encrypt(C, u, f, m);
      }, decrypt: function(u, f, m) {
        return a(f).decrypt(C, u, f, m);
      } };
    };
  }() });
  e.StreamCipher = c.extend({ _doFinalize: function() {
    return this._process(!0);
  }, blockSize: 1 });
  var E = t.mode = {}, I = e.BlockCipherMode = i.extend({ createEncryptor: function(a, C) {
    return this.Encryptor.create(a, C);
  }, createDecryptor: function(a, C) {
    return this.Decryptor.create(a, C);
  }, init: function(a, C) {
    this._cipher = a, this._iv = C;
  } }), l = E.CBC = function() {
    var a = I.extend();
    function C(u, f, m) {
      var y, F = this._iv;
      F ? (y = F, this._iv = A) : y = this._prevBlock;
      for (var G = 0; G < m; G++)
        u[f + G] ^= y[G];
    }
    return a.Encryptor = a.extend({ processBlock: function(u, f) {
      var m = this._cipher, y = m.blockSize;
      C.call(this, u, f, y), m.encryptBlock(u, f), this._prevBlock = u.slice(f, f + y);
    } }), a.Decryptor = a.extend({ processBlock: function(u, f) {
      var m = this._cipher, y = m.blockSize, F = u.slice(f, f + y);
      m.decryptBlock(u, f), C.call(this, u, f, y), this._prevBlock = F;
    } }), a;
  }(), d = (t.pad = {}).Pkcs7 = { pad: function(a, C) {
    for (var u = 4 * C, f = u - a.sigBytes % u, m = f << 24 | f << 16 | f << 8 | f, y = [], F = 0; F < f; F += 4)
      y.push(m);
    var G = o.create(y, f);
    a.concat(G);
  }, unpad: function(a) {
    var C = 255 & a.words[a.sigBytes - 1 >>> 2];
    a.sigBytes -= C;
  } };
  e.BlockCipher = c.extend({ cfg: c.cfg.extend({ mode: l, padding: d }), reset: function() {
    var a;
    c.reset.call(this);
    var C = this.cfg, u = C.iv, f = C.mode;
    this._xformMode == this._ENC_XFORM_MODE ? a = f.createEncryptor : (a = f.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == a ? this._mode.init(this, u && u.words) : (this._mode = a.call(f, this, u && u.words), this._mode.__creator = a);
  }, _doProcessBlock: function(a, C) {
    this._mode.processBlock(a, C);
  }, _doFinalize: function() {
    var a, C = this.cfg.padding;
    return this._xformMode == this._ENC_XFORM_MODE ? (C.pad(this._data, this.blockSize), a = this._process(!0)) : (a = this._process(!0), C.unpad(a)), a;
  }, blockSize: 4 });
  var g = e.CipherParams = i.extend({ init: function(a) {
    this.mixIn(a);
  }, toString: function(a) {
    return (a || this.formatter).stringify(this);
  } }), S = (t.format = {}).OpenSSL = { stringify: function(a) {
    var C = a.ciphertext, u = a.salt;
    return (u ? o.create([1398893684, 1701076831]).concat(u).concat(C) : C).toString(B);
  }, parse: function(a) {
    var C, u = B.parse(a), f = u.words;
    return f[0] == 1398893684 && f[1] == 1701076831 && (C = o.create(f.slice(2, 4)), f.splice(0, 4), u.sigBytes -= 16), g.create({ ciphertext: u, salt: C });
  } }, s = e.SerializableCipher = i.extend({ cfg: i.extend({ format: S }), encrypt: function(a, C, u, f) {
    f = this.cfg.extend(f);
    var m = a.createEncryptor(u, f), y = m.finalize(C), F = m.cfg;
    return g.create({ ciphertext: y, key: u, iv: F.iv, algorithm: a, mode: F.mode, padding: F.padding, blockSize: a.blockSize, formatter: f.format });
  }, decrypt: function(a, C, u, f) {
    return f = this.cfg.extend(f), C = this._parse(C, f.format), a.createDecryptor(u, f).finalize(C.ciphertext);
  }, _parse: function(a, C) {
    return typeof a == "string" ? C.parse(a, this) : a;
  } }), r = (t.kdf = {}).OpenSSL = { execute: function(a, C, u, f) {
    f || (f = o.random(8));
    var m = p.create({ keySize: C + u }).compute(a, f), y = o.create(m.words.slice(C), 4 * u);
    return m.sigBytes = 4 * C, g.create({ key: m, iv: y, salt: f });
  } }, Q = e.PasswordBasedCipher = s.extend({ cfg: s.cfg.extend({ kdf: r }), encrypt: function(a, C, u, f) {
    var m = (f = this.cfg.extend(f)).kdf.execute(u, a.keySize, a.ivSize);
    f.iv = m.iv;
    var y = s.encrypt.call(this, a, C, m.key, f);
    return y.mixIn(m), y;
  }, decrypt: function(a, C, u, f) {
    f = this.cfg.extend(f), C = this._parse(C, f.format);
    var m = f.kdf.execute(u, a.keySize, a.ivSize, C.salt);
    return f.iv = m.iv, s.decrypt.call(this, a, C, m.key, f);
  } });
}()))));
const De = rt, Kt = (() => {
  const A = Math.floor(9 * Math.random()) + 1;
  return `${De.encrypt("camera-player", "kt".repeat(A)).toString()}${A}`;
})(), Wt = { env: "test", apiHost: { test: "https://ts.keytop.cn", prod: "https://ts.keytop.cn" } }, vt = (A) => ({ test: `${A.apiHost.test}/cameraPlayerServer`, prod: `${A.apiHost.prod}/cameraPlayerServer` })[A.env], ZA = Ot.create({ timeout: 2e4 });
ZA.interceptors.request.use((A) => (A.headers.token = Kt, A)), ZA.interceptors.response.use((A) => {
  const { data: t, status: e } = A;
  return t && e === 200 ? t : Promise.reject();
}, (A) => Ot.isCancel(A) ? Promise.reject(new Error("axios-cancel")) : Promise.reject(A));
const ht = (A) => typeof A == "function", Mt = (A) => ((t) => t !== null && typeof t == "object")(A) && ht(A.then) && ht(A.catch), kt = (A) => {
  const t = (i) => i < 10 ? `0${i}` : i, e = A % 6e4 / 1e3;
  return `${t(parseInt(A % 36e5 / 6e4))}:${t(e)}`;
};
function Xt(A, t, e, i, o, n, h, B) {
  var p, c = typeof A == "function" ? A.options : A;
  if (t && (c.render = t, c.staticRenderFns = e, c._compiled = !0), i && (c.functional = !0), n && (c._scopeId = "data-v-" + n), h ? (p = function(l) {
    (l = l || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || typeof __VUE_SSR_CONTEXT__ > "u" || (l = __VUE_SSR_CONTEXT__), o && o.call(this, l), l && l._registeredComponents && l._registeredComponents.add(h);
  }, c._ssrRegister = p) : o && (p = B ? function() {
    o.call(this, (c.functional ? this.parent : this).$root.$options.shadowRoot);
  } : o), p)
    if (c.functional) {
      c._injectStyles = p;
      var E = c.render;
      c.render = function(l, d) {
        return p.call(d), E(l, d);
      };
    } else {
      var I = c.beforeCreate;
      c.beforeCreate = I ? [].concat(I, p) : [p];
    }
  return { exports: A, options: c };
}
const Rt = {};
var be = Xt({}, function() {
  var A = this.$createElement, t = this._self._c || A;
  return t("span", { staticClass: "anticon anticon-loading", attrs: { role: "img", "aria-label": "loading" } }, [t("svg", { staticClass: "anticon-spin", attrs: { focusable: "false", "data-icon": "loading", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true", viewBox: "0 0 1024 1024" } }, [t("path", { attrs: { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } })])]);
}, [], !1, Se, "377806c9", null, null);
function Se(A) {
  for (let t in Rt)
    this[t] = Rt[t];
}
const ve = function() {
  return be.exports;
}();
function Me(A) {
  return !!oe() && (se(A), !0);
}
function jt(A) {
  return typeof A == "function" ? A() : re(A);
}
const Zt = typeof window < "u", zt = () => {
}, ke = Re();
function Re() {
  var A;
  return Zt && ((A = window == null ? void 0 : window.navigator) == null ? void 0 : A.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
}
function PA(A) {
  var t;
  const e = jt(A);
  return (t = e == null ? void 0 : e.$el) != null ? t : e;
}
const Vt = Zt ? window : void 0;
function st(...A) {
  let t, e, i, o;
  if (typeof A[0] == "string" || Array.isArray(A[0]) ? ([e, i, o] = A, t = Vt) : [t, e, i, o] = A, !t)
    return zt;
  Array.isArray(e) || (e = [e]), Array.isArray(i) || (i = [i]);
  const n = [], h = () => {
    n.forEach((c) => c()), n.length = 0;
  }, B = Pt(() => [PA(t), jt(o)], ([c, E]) => {
    h(), c && n.push(...e.flatMap((I) => i.map((l) => ((d, g, S, s) => (d.addEventListener(g, S, s), () => d.removeEventListener(g, S, s)))(c, I, l, E))));
  }, { immediate: !0, flush: "post" }), p = () => {
    B(), h();
  };
  return Me(p), p;
}
let Ft = !1;
function Gt(A, t, e = {}) {
  const { window: i = Vt, ignore: o = [], capture: n = !0, detectIframe: h = !1 } = e;
  if (!i)
    return;
  ke && !Ft && (Ft = !0, Array.from(i.document.body.children).forEach((E) => E.addEventListener("click", zt)));
  let B = !0;
  const p = (E) => o.some((I) => {
    if (typeof I == "string")
      return Array.from(i.document.querySelectorAll(I)).some((l) => l === E.target || E.composedPath().includes(l));
    {
      const l = PA(I);
      return l && (E.target === l || E.composedPath().includes(l));
    }
  }), c = [st(i, "click", (E) => {
    const I = PA(A);
    I && I !== E.target && !E.composedPath().includes(I) && (E.detail === 0 && (B = !p(E)), B ? t(E) : B = !0);
  }, { passive: !0, capture: n }), st(i, "pointerdown", (E) => {
    const I = PA(A);
    I && (B = !E.composedPath().includes(I) && !p(E));
  }, { passive: !0 }), h && st(i, "blur", (E) => {
    var I;
    const l = PA(A);
    ((I = i.document.activeElement) == null ? void 0 : I.tagName) !== "IFRAME" || l != null && l.contains(i.document.activeElement) || t(E);
  })].filter(Boolean);
  return () => c.forEach((E) => E());
}
const Fe = { inserted(A, t) {
  const e = !t.modifiers.bubble;
  if (typeof t.value == "function")
    A.__onClickOutside_stop = Gt(A, t.value, { capture: e });
  else {
    const [i, o] = t.value;
    A.__onClickOutside_stop = Gt(A, i, Object.assign({ capture: e }, o));
  }
}, unbind(A) {
  A.__onClickOutside_stop();
} };
(function() {
  let A = !1;
  const t = rA(!1);
})();
var zA = {};
({ get exports() {
  return zA;
}, set exports(A) {
  zA = A;
} }.exports = {}).forEach = function(A, t) {
  for (var e = 0; e < A.length; e++) {
    var i = t(A[e]);
    if (i)
      return i;
  }
};
var VA = {}, qt = { get exports() {
  return VA;
}, set exports(A) {
  VA = A;
} }.exports = {};
qt.isIE = function(A) {
  return ((t = navigator.userAgent.toLowerCase()).indexOf("msie") !== -1 || t.indexOf("trident") !== -1 || t.indexOf(" edge/") !== -1) && (!A || A === function() {
    var e = 3, i = document.createElement("div"), o = i.getElementsByTagName("i");
    do
      i.innerHTML = "<!--[if gt IE " + ++e + "]><i></i><![endif]-->";
    while (o[0]);
    return e > 4 ? e : void 0;
  }());
  var t;
}, qt.isLegacyOpera = function() {
  return !!window.opera;
};
var Ct = {};
({ get exports() {
  return Ct;
}, set exports(A) {
  Ct = A;
} }.exports = {}).getOption = function(A, t, e) {
  var i = A[t];
  return i == null && e !== void 0 ? e : i;
};
var xt = Ct;
function Nt() {
  var A = {}, t = 0, e = 0, i = 0;
  return { add: function(o, n) {
    n || (n = o, o = 0), o > e ? e = o : o < i && (i = o), A[o] || (A[o] = []), A[o].push(n), t++;
  }, process: function() {
    for (var o = i; o <= e; o++)
      for (var n = A[o], h = 0; h < n.length; h++)
        (0, n[h])();
  }, size: function() {
    return t;
  } };
}
var ct = "_erd";
function Jt(A) {
  return A[ct];
}
var Ge = { initState: function(A) {
  return A[ct] = {}, Jt(A);
}, getState: Jt, cleanState: function(A) {
  delete A[ct];
} }, YA = VA, qe = zA.forEach, OA = zA.forEach, xe = function(A) {
  var t = A.stateHandler.getState;
  return { isDetectable: function(e) {
    var i = t(e);
    return i && !!i.isDetectable;
  }, markAsDetectable: function(e) {
    t(e).isDetectable = !0;
  }, isBusy: function(e) {
    return !!t(e).busy;
  }, markBusy: function(e, i) {
    t(e).busy = !!i;
  } };
}, Ne = function(A) {
  var t = {};
  function e(i) {
    var o = A.get(i);
    return o === void 0 ? [] : t[o] || [];
  }
  return { get: e, add: function(i, o) {
    var n = A.get(i);
    t[n] || (t[n] = []), t[n].push(o);
  }, removeListener: function(i, o) {
    for (var n = e(i), h = 0, B = n.length; h < B; ++h)
      if (n[h] === o) {
        n.splice(h, 1);
        break;
      }
  }, removeAllListeners: function(i) {
    var o = e(i);
    o && (o.length = 0);
  } };
}, Je = function() {
  var A = 1;
  return { generate: function() {
    return A++;
  } };
}, Te = function(A) {
  var t = A.idGenerator, e = A.stateHandler.getState;
  return { get: function(i) {
    var o = e(i);
    return o && o.id !== void 0 ? o.id : null;
  }, set: function(i) {
    var o = e(i);
    if (!o)
      throw new Error("setId required the element to have a resize detection state.");
    var n = t.generate();
    return o.id = n, n;
  } };
}, Le = function(A) {
  function t() {
  }
  var e = { log: t, warn: t, error: t };
  if (!A && window.console) {
    var i = function(o, n) {
      o[n] = function() {
        var h = console[n];
        if (h.apply)
          h.apply(console, arguments);
        else
          for (var B = 0; B < arguments.length; B++)
            h(arguments[B]);
      };
    };
    i(e, "log"), i(e, "warn"), i(e, "error");
  }
  return e;
}, Tt = VA, Ue = function(A) {
  var t = (A = A || {}).reporter, e = xt.getOption(A, "async", !0), i = xt.getOption(A, "auto", !0);
  i && !e && (t && t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."), e = !0);
  var o, n = Nt(), h = !1;
  function B() {
    for (h = !0; n.size(); ) {
      var c = n;
      n = Nt(), c.process();
    }
    h = !1;
  }
  function p() {
    var c;
    c = B, o = setTimeout(c, 0);
  }
  return { add: function(c, E) {
    !h && i && e && n.size() === 0 && p(), n.add(c, E);
  }, force: function(c) {
    h || (c === void 0 && (c = e), o && (clearTimeout(o), o = null), c ? p() : B());
  } };
}, MA = Ge, _e = function(A) {
  var t = (A = A || {}).reporter, e = A.batchProcessor, i = A.stateHandler.getState;
  if (!t)
    throw new Error("Missing required dependency: reporter.");
  function o(h) {
    var B = A.important ? " !important; " : "; ";
    return (h.join(B) + B).trim();
  }
  function n(h) {
    return i(h).object;
  }
  return { makeDetectable: function(h, B, p) {
    p || (p = B, B = h, h = null), (h = h || {}).debug, YA.isIE(8) ? p(B) : function(c, E) {
      var I = o(["display: block", "position: absolute", "top: 0", "left: 0", "width: 100%", "height: 100%", "border: none", "padding: 0", "margin: 0", "opacity: 0", "z-index: -1000", "pointer-events: none"]), l = !1, d = window.getComputedStyle(c), g = c.offsetWidth, S = c.offsetHeight;
      function s() {
        function r() {
          if (d.position === "static") {
            c.style.setProperty("position", "relative", h.important ? "important" : "");
            var a = function(C, u, f, m) {
              var y = f[m];
              y !== "auto" && function(F) {
                return F.replace(/[^-\d\.]/g, "");
              }(y) !== "0" && (C.warn("An element that is positioned static has style." + m + "=" + y + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + m + " will be set to 0. Element: ", u), u.style.setProperty(m, "0", h.important ? "important" : ""));
            };
            a(t, c, d, "top"), a(t, c, d, "right"), a(t, c, d, "bottom"), a(t, c, d, "left");
          }
        }
        d.position !== "" && (r(), l = !0);
        var Q = document.createElement("object");
        Q.style.cssText = I, Q.tabIndex = -1, Q.type = "text/html", Q.setAttribute("aria-hidden", "true"), Q.onload = function() {
          l || r(), function a(C, u) {
            if (!C.contentDocument) {
              var f = i(C);
              return f.checkForObjectDocumentTimeoutId && window.clearTimeout(f.checkForObjectDocumentTimeoutId), void (f.checkForObjectDocumentTimeoutId = setTimeout(function() {
                f.checkForObjectDocumentTimeoutId = 0, a(C, u);
              }, 100));
            }
            u(C.contentDocument);
          }(this, function(a) {
            E(c);
          });
        }, YA.isIE() || (Q.data = "about:blank"), i(c) && (c.appendChild(Q), i(c).object = Q, YA.isIE() && (Q.data = "about:blank"));
      }
      i(c).startSize = { width: g, height: S }, e ? e.add(s) : s();
    }(B, p);
  }, addListener: function(h, B) {
    function p() {
      B(h);
    }
    if (YA.isIE(8))
      i(h).object = { proxy: p }, h.attachEvent("onresize", p);
    else {
      var c = n(h);
      if (!c)
        throw new Error("Element is not detectable by this strategy.");
      c.contentDocument.defaultView.addEventListener("resize", p);
    }
  }, uninstall: function(h) {
    if (i(h)) {
      var B = n(h);
      B && (YA.isIE(8) ? h.detachEvent("onresize", B.proxy) : h.removeChild(B), i(h).checkForObjectDocumentTimeoutId && window.clearTimeout(i(h).checkForObjectDocumentTimeoutId), delete i(h).object);
    }
  } };
}, He = function(A) {
  var t = (A = A || {}).reporter, e = A.batchProcessor, i = A.stateHandler.getState;
  A.stateHandler.hasState;
  var o = A.idHandler;
  if (!e)
    throw new Error("Missing required dependency: batchProcessor");
  if (!t)
    throw new Error("Missing required dependency: reporter.");
  var n = function() {
    var d = 500, g = 500, S = document.createElement("div");
    S.style.cssText = p(["position: absolute", "width: 1000px", "height: 1000px", "visibility: hidden", "margin: 0", "padding: 0"]);
    var s = document.createElement("div");
    s.style.cssText = p(["position: absolute", "width: 500px", "height: 500px", "overflow: scroll", "visibility: none", "top: -1500px", "left: -1500px", "visibility: hidden", "margin: 0", "padding: 0"]), s.appendChild(S), document.body.insertBefore(s, document.body.firstChild);
    var r = d - s.clientWidth, Q = g - s.clientHeight;
    return document.body.removeChild(s), { width: r, height: Q };
  }(), h = "erd_scroll_detection_container";
  function B(d) {
    (function(g, S, s) {
      function r(u, f) {
        f = f || function(y) {
          g.head.appendChild(y);
        };
        var m = g.createElement("style");
        return m.innerHTML = u, m.id = S, f(m), m;
      }
      if (!g.getElementById(S)) {
        var Q = s + "_animation", a = s + "_animation_active", C = `/* Created by the element-resize-detector library. */
`;
        C += "." + s + " > div::-webkit-scrollbar { " + p(["display: none"]) + ` }

`, C += "." + a + " { " + p(["-webkit-animation-duration: 0.1s", "animation-duration: 0.1s", "-webkit-animation-name: " + Q, "animation-name: " + Q]) + ` }
`, C += "@-webkit-keyframes " + Q + ` { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }
`, r(C += "@keyframes " + Q + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }");
      }
    })(d, "erd_scroll_detection_scrollbar_style", h);
  }
  function p(d) {
    var g = A.important ? " !important; " : "; ";
    return (d.join(g) + g).trim();
  }
  function c(d, g, S) {
    if (d.addEventListener)
      d.addEventListener(g, S);
    else {
      if (!d.attachEvent)
        return t.error("[scroll] Don't know how to add event listeners.");
      d.attachEvent("on" + g, S);
    }
  }
  function E(d, g, S) {
    if (d.removeEventListener)
      d.removeEventListener(g, S);
    else {
      if (!d.detachEvent)
        return t.error("[scroll] Don't know how to remove event listeners.");
      d.detachEvent("on" + g, S);
    }
  }
  function I(d) {
    return i(d).container.childNodes[0].childNodes[0].childNodes[0];
  }
  function l(d) {
    return i(d).container.childNodes[0].childNodes[0].childNodes[1];
  }
  return B(window.document), { makeDetectable: function(d, g, S) {
    function s() {
      if (d.debug) {
        var k = Array.prototype.slice.call(arguments);
        if (k.unshift(o.get(g), "Scroll: "), t.log.apply)
          t.log.apply(null, k);
        else
          for (var R = 0; R < k.length; R++)
            t.log(k[R]);
      }
    }
    function r(k) {
      var R = i(k).container.childNodes[0], N = window.getComputedStyle(R);
      return !N.width || N.width.indexOf("px") === -1;
    }
    function Q() {
      var k = window.getComputedStyle(g), R = {};
      return R.position = k.position, R.width = g.offsetWidth, R.height = g.offsetHeight, R.top = k.top, R.right = k.right, R.bottom = k.bottom, R.left = k.left, R.widthCSS = k.width, R.heightCSS = k.height, R;
    }
    function a() {
      if (s("storeStyle invoked."), i(g)) {
        var k = Q();
        i(g).style = k;
      } else
        s("Aborting because element has been uninstalled");
    }
    function C(k, R, N) {
      i(k).lastWidth = R, i(k).lastHeight = N;
    }
    function u() {
      return 2 * n.width + 1;
    }
    function f() {
      return 2 * n.height + 1;
    }
    function m(k) {
      return k + 10 + u();
    }
    function y(k) {
      return k + 10 + f();
    }
    function F(k, R, N) {
      var D = I(k), b = l(k), M = m(R), w = y(N), H = function(aA) {
        return 2 * aA + u();
      }(R), Z = function(aA) {
        return 2 * aA + f();
      }(N);
      D.scrollLeft = M, D.scrollTop = w, b.scrollLeft = H, b.scrollTop = Z;
    }
    function G() {
      var k = i(g).container;
      if (!k) {
        (k = document.createElement("div")).className = h, k.style.cssText = p(["visibility: hidden", "display: inline", "width: 0px", "height: 0px", "z-index: -1", "overflow: hidden", "margin: 0", "padding: 0"]), i(g).container = k, function(N) {
          N.className += " " + h + "_animation_active";
        }(k), g.appendChild(k);
        var R = function() {
          i(g).onRendered && i(g).onRendered();
        };
        c(k, "animationstart", R), i(g).onAnimationStart = R;
      }
      return k;
    }
    function x() {
      if (s("Injecting elements"), i(g)) {
        (function() {
          var K = i(g).style;
          if (K.position === "static") {
            g.style.setProperty("position", "relative", d.important ? "important" : "");
            var AA = function(X, P, DA, O) {
              var Y = DA[O];
              Y !== "auto" && function(RA) {
                return RA.replace(/[^-\d\.]/g, "");
              }(Y) !== "0" && (X.warn("An element that is positioned static has style." + O + "=" + Y + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + O + " will be set to 0. Element: ", P), P.style[O] = 0);
            };
            AA(t, g, K, "top"), AA(t, g, K, "right"), AA(t, g, K, "bottom"), AA(t, g, K, "left");
          }
        })();
        var k = i(g).container;
        k || (k = G());
        var R, N, D, b, M = n.width, w = n.height, H = p(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%", "left: 0px", "top: 0px"]), Z = p(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden"].concat(["left: " + (R = (R = -(1 + M)) ? R + "px" : "0"), "top: " + (N = (N = -(1 + w)) ? N + "px" : "0"), "right: " + (b = (b = -M) ? b + "px" : "0"), "bottom: " + (D = (D = -w) ? D + "px" : "0")])), aA = p(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]), lA = p(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]), nA = p(["position: absolute", "left: 0", "top: 0"]), mA = p(["position: absolute", "width: 200%", "height: 200%"]), yA = document.createElement("div"), wA = document.createElement("div"), W = document.createElement("div"), JA = document.createElement("div"), gA = document.createElement("div"), J = document.createElement("div");
        yA.dir = "ltr", yA.style.cssText = H, yA.className = h, wA.className = h, wA.style.cssText = Z, W.style.cssText = aA, JA.style.cssText = nA, gA.style.cssText = lA, J.style.cssText = mA, W.appendChild(JA), gA.appendChild(J), wA.appendChild(W), wA.appendChild(gA), yA.appendChild(wA), k.appendChild(yA), c(W, "scroll", eA), c(gA, "scroll", z), i(g).onExpandScroll = eA, i(g).onShrinkScroll = z;
      } else
        s("Aborting because element has been uninstalled");
      function eA() {
        var K = i(g);
        K && K.onExpand ? K.onExpand() : s("Aborting expand scroll handler: element has been uninstalled");
      }
      function z() {
        var K = i(g);
        K && K.onShrink ? K.onShrink() : s("Aborting shrink scroll handler: element has been uninstalled");
      }
    }
    function L() {
      function k(w, H, Z) {
        var aA = function(mA) {
          return I(mA).childNodes[0];
        }(w), lA = m(H), nA = y(Z);
        aA.style.setProperty("width", lA + "px", d.important ? "important" : ""), aA.style.setProperty("height", nA + "px", d.important ? "important" : "");
      }
      function R(w) {
        var H = g.offsetWidth, Z = g.offsetHeight, aA = H !== i(g).lastWidth || Z !== i(g).lastHeight;
        s("Storing current size", H, Z), C(g, H, Z), e.add(0, function() {
          if (aA)
            if (i(g))
              if (N()) {
                if (d.debug) {
                  var lA = g.offsetWidth, nA = g.offsetHeight;
                  lA === H && nA === Z || t.warn(o.get(g), "Scroll: Size changed before updating detector elements.");
                }
                k(g, H, Z);
              } else
                s("Aborting because element container has not been initialized");
            else
              s("Aborting because element has been uninstalled");
        }), e.add(1, function() {
          i(g) ? N() ? F(g, H, Z) : s("Aborting because element container has not been initialized") : s("Aborting because element has been uninstalled");
        }), aA && w && e.add(2, function() {
          i(g) ? N() ? w() : s("Aborting because element container has not been initialized") : s("Aborting because element has been uninstalled");
        });
      }
      function N() {
        return !!i(g).container;
      }
      function D() {
        s("notifyListenersIfNeeded invoked");
        var w = i(g);
        return i(g).lastNotifiedWidth === void 0 && w.lastWidth === w.startSize.width && w.lastHeight === w.startSize.height ? s("Not notifying: Size is the same as the start size, and there has been no notification yet.") : w.lastWidth === w.lastNotifiedWidth && w.lastHeight === w.lastNotifiedHeight ? s("Not notifying: Size already notified") : (s("Current size not notified, notifying..."), w.lastNotifiedWidth = w.lastWidth, w.lastNotifiedHeight = w.lastHeight, void qe(i(g).listeners, function(H) {
          H(g);
        }));
      }
      function b() {
        s("Scroll detected."), r(g) ? s("Scroll event fired while unrendered. Ignoring...") : R(D);
      }
      if (s("registerListenersAndPositionElements invoked."), i(g)) {
        i(g).onRendered = function() {
          if (s("startanimation triggered."), r(g))
            s("Ignoring since element is still unrendered...");
          else {
            s("Element rendered.");
            var w = I(g), H = l(g);
            w.scrollLeft !== 0 && w.scrollTop !== 0 && H.scrollLeft !== 0 && H.scrollTop !== 0 || (s("Scrollbars out of sync. Updating detector elements..."), R(D));
          }
        }, i(g).onExpand = b, i(g).onShrink = b;
        var M = i(g).style;
        k(g, M.width, M.height);
      } else
        s("Aborting because element has been uninstalled");
    }
    function T() {
      if (s("finalizeDomMutation invoked."), i(g)) {
        var k = i(g).style;
        C(g, k.width, k.height), F(g, k.width, k.height);
      } else
        s("Aborting because element has been uninstalled");
    }
    function U() {
      S(g);
    }
    function _() {
      var k;
      s("Installing..."), i(g).listeners = [], k = Q(), i(g).startSize = { width: k.width, height: k.height }, s("Element start size", i(g).startSize), e.add(0, a), e.add(1, x), e.add(2, L), e.add(3, T), e.add(4, U);
    }
    S || (S = g, g = d, d = null), d = d || {}, s("Making detectable..."), function(k) {
      return !function(R) {
        var N = R.getRootNode && R.getRootNode().contains(R);
        return R === R.ownerDocument.body || R.ownerDocument.body.contains(R) || N;
      }(k) || window.getComputedStyle(k) === null;
    }(g) ? (s("Element is detached"), G(), s("Waiting until element is attached..."), i(g).onRendered = function() {
      s("Element is now attached"), _();
    }) : _();
  }, addListener: function(d, g) {
    if (!i(d).listeners.push)
      throw new Error("Cannot add listener to an element that is not detectable.");
    i(d).listeners.push(g);
  }, uninstall: function(d) {
    var g = i(d);
    g && (g.onExpandScroll && E(I(d), "scroll", g.onExpandScroll), g.onShrinkScroll && E(l(d), "scroll", g.onShrinkScroll), g.onAnimationStart && E(g.container, "animationstart", g.onAnimationStart), g.container && d.removeChild(g.container));
  }, initDocument: B };
};
function Lt(A) {
  return Array.isArray(A) || A.length !== void 0;
}
function Ut(A) {
  if (Array.isArray(A))
    return A;
  var t = [];
  return OA(A, function(e) {
    t.push(e);
  }), t;
}
function _t(A) {
  return A && A.nodeType === 1;
}
function kA(A, t, e) {
  var i = A[t];
  return i == null && e !== void 0 ? e : i;
}
var $t = ((A) => (A.Ready = "READY", A.Play = "PLAY", A.Stop = "STOP", A))($t || {});
const xA = { name: "CameraPlayer" };
xA.props = { rtspUrl: { type: [String, Function], default: "" }, videoKey: { type: String, default: () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(A) {
  const t = 16 * Math.random() | 0;
  return (A === "x" ? t : 3 & t | 8).toString(16);
}) }, envConfig: { type: Object, default: () => Wt }, mode: { type: String, default: "aspectFit" }, width: { type: Number }, height: { type: Number }, poster: { type: String }, duration: { type: Number, default: 18e4 }, resize: { type: Object }, controls: { type: Boolean, default: !0 }, autoplay: { type: Boolean, default: !1 }, beforeEndThreshold: { type: Number, default: 1e4 }, onBeforeEnd: { type: Function, default: () => {
} }, keep: { type: Boolean, default: !1 } }, xA.setup = (A, t) => {
  const e = "Repetitive operation", i = "Task not found", o = "Invalid argument", n = "Connection refused", h = "Conversion failed", B = "Parameter validation error", p = "Unknown", c = "Request timeout", E = A, I = HA(() => E.keep ? 18e5 : E.duration), l = (() => {
    const J = rA(!1), eA = () => J.value = window.innerWidth <= 768;
    return eA(), window.addEventListener("resize", eA), J;
  })(), d = rA(), g = HA(() => {
    let J = [`camera-player__mode-${E.mode}`];
    if (E.mode === "aspectFill" && r.value && d.value) {
      const { width: eA, height: z } = r.value.getBoundingClientRect();
      d.value.width / d.value.height >= eA / z ? J.push(`camera-player__mode-${E.mode}--width`) : J.push(`camera-player__mode-${E.mode}--height`);
    }
    return J.join(" ");
  }), S = HA(() => {
    let J = "";
    return J = ["READY", "STOP"].includes(s.value) ? "play" : "stop", J;
  }), s = rA("READY"), r = rA(), Q = rA(), a = (C = E.videoKey, `${((J) => ({ test: `${J.apiHost.test.replace("http", "ws")}/cameraPlayerServer`, prod: `${J.apiHost.prod.replace("http", "ws")}/cameraPlayerServer` })[J.env])(E.envConfig)}/stream/${C}?token=${encodeURIComponent(Kt)}`);
  var C;
  let u, f;
  rA(!0);
  const m = () => {
    u = window.setTimeout(() => {
      if (+/* @__PURE__ */ new Date() - f > 6e3)
        return lA(), void clearTimeout(u);
      m();
    }, 1e3);
  };
  let y = null;
  const F = rA();
  ae(() => {
    let J = {};
    E.resize ? J = { width: "100%" } : E.width && E.height && (J = { width: `${E.width}px`, height: `${E.height}px` }), F.value = J;
  }), Qt(async () => {
    if (E.resize) {
      const { width: J, height: eA } = E.resize, z = J / eA, K = (AA) => {
        const { width: X } = AA.getBoundingClientRect();
        F.value = { width: "100%", height: `${(X / z).toFixed(3)}px` };
      };
      r.value && (function(X) {
        var P;
        if ((X = X || {}).idHandler)
          P = { get: function(V) {
            return X.idHandler.get(V, !0);
          }, set: X.idHandler.set };
        else {
          var DA = Je(), O = Te({ idGenerator: DA, stateHandler: MA });
          P = O;
        }
        var Y = X.reporter;
        Y || (Y = Le(Y === !1));
        var RA = kA(X, "batchProcessor", Ue({ reporter: Y })), uA = {};
        uA.callOnAdd = !!kA(X, "callOnAdd", !0), uA.debug = !!kA(X, "debug", !1);
        var EA, pA = Ne(P), FA = xe({ stateHandler: MA }), hA = kA(X, "strategy", "object"), KA = kA(X, "important", !1), Et = { reporter: Y, batchProcessor: RA, stateHandler: MA, idHandler: P, important: KA };
        if (hA === "scroll" && (Tt.isLegacyOpera() ? (Y.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."), hA = "object") : Tt.isIE(9) && (Y.warn("Scroll strategy is not supported on IE9. Changing to object strategy."), hA = "object")), hA === "scroll")
          EA = He(Et);
        else {
          if (hA !== "object")
            throw new Error("Invalid strategy name: " + hA);
          EA = _e(Et);
        }
        var TA = {};
        return { listenTo: function(V, tA, LA) {
          function dt(iA) {
            var $ = pA.get(iA);
            OA($, function(CA) {
              CA(iA);
            });
          }
          function $A(iA, $, CA) {
            pA.add($, CA), iA && CA($);
          }
          if (LA || (LA = tA, tA = V, V = {}), !tA)
            throw new Error("At least one element required.");
          if (!LA)
            throw new Error("Listener required.");
          if (_t(tA))
            tA = [tA];
          else {
            if (!Lt(tA))
              return Y.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
            tA = Ut(tA);
          }
          var WA = 0, At = kA(V, "callOnAdd", uA.callOnAdd), tt = kA(V, "onReady", function() {
          }), bA = kA(V, "debug", uA.debug);
          OA(tA, function(iA) {
            MA.getState(iA) || (MA.initState(iA), P.set(iA));
            var $ = P.get(iA);
            if (bA && Y.log("Attaching listener to element", $, iA), !FA.isDetectable(iA))
              return bA && Y.log($, "Not detectable."), FA.isBusy(iA) ? (bA && Y.log($, "System busy making it detectable"), $A(At, iA, LA), TA[$] = TA[$] || [], void TA[$].push(function() {
                ++WA === tA.length && tt();
              })) : (bA && Y.log($, "Making detectable..."), FA.markBusy(iA, !0), EA.makeDetectable({ debug: bA, important: KA }, iA, function(CA) {
                if (bA && Y.log($, "onElementDetectable"), MA.getState(CA)) {
                  FA.markAsDetectable(CA), FA.markBusy(CA, !1), EA.addListener(CA, dt), $A(At, CA, LA);
                  var XA = MA.getState(CA);
                  if (XA && XA.startSize) {
                    var Ae = CA.offsetWidth, te = CA.offsetHeight;
                    XA.startSize.width === Ae && XA.startSize.height === te || dt(CA);
                  }
                  TA[$] && OA(TA[$], function(ee) {
                    ee();
                  });
                } else
                  bA && Y.log($, "Element uninstalled before being detectable.");
                delete TA[$], ++WA === tA.length && tt();
              }));
            bA && Y.log($, "Already detecable, adding listener."), $A(At, iA, LA), WA++;
          }), WA === tA.length && tt();
        }, removeListener: pA.removeListener, removeAllListeners: pA.removeAllListeners, uninstall: function(V) {
          if (!V)
            return Y.error("At least one element is required.");
          if (_t(V))
            V = [V];
          else {
            if (!Lt(V))
              return Y.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
            V = Ut(V);
          }
          OA(V, function(tA) {
            pA.removeAllListeners(tA), EA.uninstall(tA), MA.cleanState(tA);
          });
        }, initDocument: function(V) {
          EA.initDocument && EA.initDocument(V);
        } };
      }().listenTo(r.value, K), K(r.value), await ne(), T());
    }
  });
  const G = rA(), x = rA(), L = rA(""), T = () => {
    let J = ["camera-player__mode-poster-aspectFill"];
    if (r.value && x.value) {
      const { width: eA, height: z } = r.value.getBoundingClientRect();
      x.value.width / x.value.height >= eA / z ? J.push("camera-player__mode-poster-aspectFill--width") : J.push("camera-player__mode-poster-aspectFill--height");
    }
    L.value = J.join(" ");
  }, U = rA(0), _ = HA(() => E.keep ? "" : kt(I.value));
  let k;
  const R = rA(0), N = () => {
    k = window.setTimeout(() => {
      var J;
      if (R.value += 1e3, U.value = +(R.value / I.value * 100).toFixed(3), R.value >= I.value)
        return R.value = I.value, U.value = 100, s.value = "STOP", clearTimeout(k), clearTimeout(u), void (b.value = !0);
      E.keep || I.value - R.value !== E.beforeEndThreshold || ((J = E.onBeforeEnd) == null || J.call(E)), N();
    }, 1e3);
  }, D = HA(() => kt(R.value)), b = rA(!0), M = () => {
    w.value || (["READY", "STOP"].includes(s.value) ? yA() : s.value === "PLAY" && lA());
  }, w = rA(!1);
  let H, Z = 1;
  const aA = async (J) => {
    var K, AA, X, P, DA;
    (K = H == null ? void 0 : H.abort) == null || K.call(H), H = new AbortController(), w.value = !0, W.value = "";
    const { videoKey: eA } = E;
    let z = "";
    if (ht(J)) {
      const O = J();
      if (Mt(O))
        try {
          z = await O;
        } catch {
        }
      else
        z = O;
    } else if (Mt(J))
      try {
        await J;
      } catch {
      }
    else
      z = J;
    try {
      const { code: O, data: Y, message: RA } = await ((uA, EA, pA) => ZA.post(`${vt(pA)}/start`, uA, EA))({ key: eA, rtspUrl: z, duration: I.value, keep: E.keep }, { signal: H == null ? void 0 : H.signal }, E.envConfig);
      if (O === 2e3) {
        s.value = "PLAY", b.value = !1;
        const { video_details: uA } = Y, EA = uA[3], [pA, FA] = EA.split("x");
        d.value = { width: FA, height: pA }, y || (y = new window.JSMpeg.Player(a, { loop: !1, canvas: Q.value, onVideoDecode(hA, KA) {
          f = +/* @__PURE__ */ new Date();
        }, onAudioDecode(hA, KA) {
        }, onPlay(hA) {
        }, onPause(hA) {
        }, onEnded(hA) {
        }, onStalled(hA) {
        }, onSourceEstablished(hA) {
        }, onSourceCompleted(hA) {
        } })), R.value = 0, U.value = 0, N(), Z = 1, m();
      } else
        O === 5e3 ? (s.value = "STOP", RA.indexOf("Invalid argument") !== -1 ? W.value = gA(o) : RA.indexOf("Connection refused") !== -1 ? Z >= 3 ? (W.value = gA(n), Z = 1) : (await ((uA = 3e3) => new Promise((EA) => setTimeout(EA, uA)))(500), Z++, await aA(J)) : RA.indexOf("Conversion failed") !== -1 ? W.value = gA(h) : W.value = gA(p)) : O === 5001 ? W.value = gA(e) : O === 4e3 && (W.value = gA(B));
      w.value = !1;
    } catch (O) {
      Z = 1, ((X = (AA = O == null ? void 0 : O.message) == null ? void 0 : AA.indexOf) == null ? void 0 : X.call(AA, "timeout")) >= 0 && (W.value = gA(c), mA()), ((DA = (P = O == null ? void 0 : O.message) == null ? void 0 : P.indexOf) == null ? void 0 : DA.call(P, "axios-cancel")) >= 0 || (w.value = !1);
    }
  }, lA = async () => {
    W.value = "", await mA();
  };
  let nA;
  const mA = async () => {
    var eA, z, K, AA, X;
    (eA = nA == null ? void 0 : nA.abort) == null || eA.call(nA), nA = new AbortController(), w.value = !0;
    const { videoKey: J } = E;
    try {
      const { code: P } = await ((DA, O, Y) => ZA.post(`${vt(Y)}/stop`, DA, O))({ key: J }, { signal: nA == null ? void 0 : nA.signal }, E.envConfig);
      P === 2e3 ? (s.value = "STOP", R.value = 0, U.value = 0, clearTimeout(k), clearTimeout(u), b.value = !0) : P === 5e3 ? (W.value = gA(i), s.value = "STOP", R.value = 0, U.value = 0, clearTimeout(k), clearTimeout(u), b.value = !0) : P === 4e3 && (W.value = gA(B)), w.value = !1;
    } catch (P) {
      ((K = (z = P == null ? void 0 : P.message) == null ? void 0 : z.indexOf) == null ? void 0 : K.call(z, "timeout")) >= 0 && (W.value = gA(c)), ((X = (AA = P == null ? void 0 : P.message) == null ? void 0 : AA.indexOf) == null ? void 0 : X.call(AA, "axios-cancel")) >= 0 || (w.value = !1);
    }
  }, yA = async () => {
    await mA(), await aA(E.rtspUrl);
  }, wA = async () => {
    await lA(), y && (y == null || y.destroy(), y = null), clearTimeout(k), clearTimeout(u), clearTimeout(JA);
  }, W = rA("");
  let JA;
  Pt(W, (J) => {
    J !== "" && (clearTimeout(JA), JA = window.setTimeout(() => {
      W.value = "";
    }, 6e3));
  });
  const gA = (J) => `Error: ${J}`;
  return Qt(() => {
    E.autoplay && M();
  }), ge(() => {
    wA();
  }), Ie(() => {
  }), Be(() => {
  }), Object.assign({ VideoStatus: $t, clsMode: g, clsIcon: S, videoStatus: s, wrapperEl: r, canvasEl: Q, style: F, posterEl: G, handlePosterLoad: (J) => {
    G.value && (x.value = { width: G.value.width, height: G.value.height }, T());
  }, clsPosterMode: L, percent: U, formatDuration: _, formatCurrentTime: D, visibleMobileOperate: b, handleOperate: () => {
    l.value && (b.value = !0);
  }, handleIcon: M, loading: w, tips: W, handleClickOutside: () => {
    s.value === "PLAY" && (b.value = !1);
  } }, { play: yA, stop: lA, destroy: wA, setRtspUrl: async ({ rtspUrl: J }) => {
    s.value = "READY", clearTimeout(u), b.value = !0, R.value = 0, U.value = 0, clearTimeout(k), await mA(), await aA(J);
  } });
}, xA.components = Object.assign({ Loading: ve }, xA.components), xA.directives = Object.assign({ onClickOutside: Fe }, xA.directives);
const Ht = {};
var Ye = Xt(xA, function() {
  var A = this, t = A.$createElement, e = A._self._c || t;
  return e("div", { ref: "wrapperEl", staticClass: "camera-player", class: [A.clsMode, A.videoStatus], style: A.style, on: { click: A.handleOperate } }, [e("canvas", { ref: "canvasEl", staticClass: "camera-player__canvas", class: { "no-play": A.videoStatus !== A.VideoStatus.Play }, attrs: { width: "0", height: "0" } }), e("img", { directives: [{ name: "show", rawName: "v-show", value: A.poster && A.clsPosterMode !== "" && A.videoStatus !== A.VideoStatus.Play, expression: `
      poster && clsPosterMode !== '' && videoStatus !== VideoStatus.Play
    ` }], ref: "posterEl", staticClass: "camera-player__poster", class: A.clsPosterMode, attrs: { src: A.poster }, on: { load: A.handlePosterLoad } }), A.controls ? e("div", { staticClass: "camera-player__control", on: { click: function(i) {
    i.stopPropagation();
  } } }, [e("div", { staticClass: "camera-player__control-top" }, [e("div", { staticClass: "play-icon", class: [A.clsIcon], on: { click: A.handleIcon } }), e("div", { staticClass: "camera-player__control-time" }, [A._v(" " + A._s(A.formatCurrentTime) + " "), A.keep ? A._e() : [A._v("/")], A._v(" " + A._s(A.formatDuration) + " ")], 2)]), A.keep ? A._e() : e("div", { staticClass: "camera-player__control-progress" }, [e("div", { staticClass: "camera-player__control-progress-inner", style: { width: `${A.percent}%` } })])]) : A._e(), A.controls ? e("Transition", { attrs: { name: "fade" } }, [e("div", { directives: [{ name: "show", rawName: "v-show", value: !A.loading && A.visibleMobileOperate, expression: "!loading && visibleMobileOperate" }], staticClass: "camera-player__control-icon-m", on: { click: function(i) {
    i.stopPropagation(), A.videoStatus === A.VideoStatus.Play && (A.visibleMobileOperate = !1);
  } } }, [e("div", { directives: [{ name: "show", rawName: "v-show", value: [A.VideoStatus.Ready, A.VideoStatus.Stop].includes(A.videoStatus), expression: "[VideoStatus.Ready, VideoStatus.Stop].includes(videoStatus)" }], staticClass: "play-icon-m play", on: { click: function(i) {
    return i.stopPropagation(), A.handleIcon.apply(null, arguments);
  } } }), e("div", { directives: [{ name: "show", rawName: "v-show", value: [A.VideoStatus.Play].includes(A.videoStatus), expression: "[VideoStatus.Play].includes(videoStatus)" }, { name: "on-click-outside", rawName: "v-on-click-outside", value: A.handleClickOutside, expression: "handleClickOutside" }], staticClass: "play-icon-m stop", on: { click: function(i) {
    return i.stopPropagation(), A.handleIcon.apply(null, arguments);
  } } })])]) : A._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: A.loading, expression: "loading" }], staticClass: "camera-player__loading", on: { click: function(i) {
    i.stopPropagation();
  } } }, [e("Loading", { staticClass: "camera-player__loading-icon" })], 1), A.controls ? e("Transition", { attrs: { name: "fade" } }, [e("div", { directives: [{ name: "show", rawName: "v-show", value: A.visibleMobileOperate, expression: "visibleMobileOperate" }], staticClass: "camera-player__bottom-m" }, [e("div", [A._v(" " + A._s(A.formatCurrentTime) + " ")]), A.keep ? A._e() : e("div", { staticClass: "camera-player__control-progress-m" }, [e("div", { staticClass: "camera-player__control-progress-inner-m", style: { width: `${A.percent}%` } })]), e("div", [A._v(" " + A._s(A.formatDuration) + " ")])])]) : A._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: A.tips !== "", expression: "tips !== ''" }], staticClass: "camera-player__tips" }, [A._v(" " + A._s(A.tips) + " ")])], 1);
}, [], !1, Pe, "9551bfb2", null, null);
function Pe(A) {
  for (let t in Ht)
    this[t] = Ht[t];
}
const Yt = function() {
  return Ye.exports;
}();
Object.assign(Yt, { install: (A, t = {}) => {
  const { env: e = "test", apiHost: i = { test: "https://ts.keytop.cn", prod: "https://ts.keytop.cn" } } = t;
  Object.assign(Wt, { env: e, apiHost: i }), A.component("camera-player", Yt);
} });
export {
  Yt as default
};
