import { mV as je, mW as xe, jl as U, hL as He } from "./56c67d3b.js";
import B from "react";
import { c as ae } from "./50da7644.js";
import { r as ne } from "./1bf547ac.js";
function ze(e, t) {
  for (var r = 0; r < t.length; r++) {
    const a = t[r];
    if (typeof a != "string" && !Array.isArray(a)) {
      for (const n in a)
        if (n !== "default" && !(n in e)) {
          const o = Object.getOwnPropertyDescriptor(a, n);
          o && Object.defineProperty(e, n, o.get ? o : {
            enumerable: !0,
            get: () => a[n]
          });
        }
    }
  }
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
}
var Ve = function(t, r, a) {
  var n = document.head || document.getElementsByTagName("head")[0], o = document.createElement("script");
  typeof r == "function" && (a = r, r = {}), r = r || {}, a = a || function() {
  }, o.type = r.type || "text/javascript", o.charset = r.charset || "utf8", o.async = "async" in r ? !!r.async : !0, o.src = t, r.attrs && Fe(o, r.attrs), r.text && (o.text = "" + r.text);
  var h = "onload" in o ? Z : Be;
  h(o, a), o.onload || Z(o, a), n.appendChild(o);
};
function Fe(e, t) {
  for (var r in t)
    e.setAttribute(r, t[r]);
}
function Z(e, t) {
  e.onload = function() {
    this.onerror = this.onload = null, t(null, e);
  }, e.onerror = function() {
    this.onerror = this.onload = null, t(new Error("Failed to load " + this.src), e);
  };
}
function Be(e, t) {
  e.onreadystatechange = function() {
    this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, t(null, e));
  };
}
var We = Object.create, $ = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, Xe = Object.getOwnPropertyNames, Ye = Object.getPrototypeOf, Je = Object.prototype.hasOwnProperty, qe = (e, t) => {
  for (var r in t)
    $(e, r, { get: t[r], enumerable: !0 });
}, oe = (e, t, r, a) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let n of Xe(t))
      !Je.call(e, n) && n !== r && $(e, n, { get: () => t[n], enumerable: !(a = Ke(t, n)) || a.enumerable });
  return e;
}, W = (e, t, r) => (r = e != null ? We(Ye(e)) : {}, oe(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  t || !e || !e.__esModule ? $(r, "default", { value: e, enumerable: !0 }) : r,
  e
)), Ze = (e) => oe($({}, "__esModule", { value: !0 }), e), ie = {};
qe(ie, {
  callPlayer: () => dt,
  getConfig: () => ct,
  getSDK: () => pt,
  isBlobUrl: () => ht,
  isMediaStream: () => ft,
  lazy: () => tt,
  omit: () => yt,
  parseEndTime: () => st,
  parseStartTime: () => it,
  queryString: () => ut,
  randomString: () => lt,
  supportsWebKitPresentationMode: () => _t
});
var L = Ze(ie), Qe = W(B), Ge = W(Ve), et = W(ae);
const tt = (e) => Qe.default.lazy(async () => {
  const t = await e();
  return typeof t.default == "function" ? t : t.default;
}), rt = /[?&#](?:start|t)=([0-9hms]+)/, at = /[?&#]end=([0-9hms]+)/, H = /(\d+)(h|m|s)/g, nt = /^\d+$/;
function se(e, t) {
  if (e instanceof Array)
    return;
  const r = e.match(t);
  if (r) {
    const a = r[1];
    if (a.match(H))
      return ot(a);
    if (nt.test(a))
      return parseInt(a);
  }
}
function ot(e) {
  let t = 0, r = H.exec(e);
  for (; r !== null; ) {
    const [, a, n] = r;
    n === "h" && (t += parseInt(a, 10) * 60 * 60), n === "m" && (t += parseInt(a, 10) * 60), n === "s" && (t += parseInt(a, 10)), r = H.exec(e);
  }
  return t;
}
function it(e) {
  return se(e, rt);
}
function st(e) {
  return se(e, at);
}
function lt() {
  return Math.random().toString(36).substr(2, 5);
}
function ut(e) {
  return Object.keys(e).map((t) => `${t}=${e[t]}`).join("&");
}
function N(e) {
  return window[e] ? window[e] : window.exports && window.exports[e] ? window.exports[e] : window.module && window.module.exports && window.module.exports[e] ? window.module.exports[e] : null;
}
const g = {}, pt = function(t, r, a = null, n = () => !0, o = Ge.default) {
  const h = N(r);
  return h && n(h) ? Promise.resolve(h) : new Promise((_, y) => {
    if (g[t]) {
      g[t].push({ resolve: _, reject: y });
      return;
    }
    g[t] = [{ resolve: _, reject: y }];
    const b = (v) => {
      g[t].forEach((T) => T.resolve(v));
    };
    if (a) {
      const v = window[a];
      window[a] = function() {
        v && v(), b(N(r));
      };
    }
    o(t, (v) => {
      v ? (g[t].forEach((T) => T.reject(v)), g[t] = null) : a || b(N(r));
    });
  });
};
function ct(e, t) {
  return (0, et.default)(t.config, e.config);
}
function yt(e, ...t) {
  const r = [].concat(...t), a = {}, n = Object.keys(e);
  for (const o of n)
    r.indexOf(o) === -1 && (a[o] = e[o]);
  return a;
}
function dt(e, ...t) {
  if (!this.player || !this.player[e]) {
    let r = `ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;
    return this.player ? this.player[e] || (r += "The method was not available") : r += "The player was not available", console.warn(r, "font-weight: bold", ""), null;
  }
  return this.player[e](...t);
}
function ft(e) {
  return typeof window < "u" && typeof window.MediaStream < "u" && e instanceof window.MediaStream;
}
function ht(e) {
  return /^blob:/.test(e);
}
function _t(e = document.createElement("video")) {
  const t = /iPhone|iPod/.test(navigator.userAgent) === !1;
  return e.webkitSupportsPresentationMode && typeof e.webkitSetPresentationMode == "function" && t;
}
var K = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, Pt = Object.getOwnPropertyNames, vt = Object.prototype.hasOwnProperty, bt = (e, t) => {
  for (var r in t)
    K(e, r, { get: t[r], enumerable: !0 });
}, gt = (e, t, r, a) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let n of Pt(t))
      !vt.call(e, n) && n !== r && K(e, n, { get: () => t[n], enumerable: !(a = mt(t, n)) || a.enumerable });
  return e;
}, Ot = (e) => gt(K({}, "__esModule", { value: !0 }), e), le = {};
bt(le, {
  AUDIO_EXTENSIONS: () => X,
  DASH_EXTENSIONS: () => Oe,
  FLV_EXTENSIONS: () => we,
  HLS_EXTENSIONS: () => J,
  MATCH_URL_DAILYMOTION: () => Pe,
  MATCH_URL_FACEBOOK: () => ye,
  MATCH_URL_FACEBOOK_WATCH: () => de,
  MATCH_URL_KALTURA: () => ge,
  MATCH_URL_MIXCLOUD: () => ve,
  MATCH_URL_MUX: () => ce,
  MATCH_URL_SOUNDCLOUD: () => ue,
  MATCH_URL_STREAMABLE: () => fe,
  MATCH_URL_TWITCH_CHANNEL: () => me,
  MATCH_URL_TWITCH_VIDEO: () => _e,
  MATCH_URL_VIDYARD: () => be,
  MATCH_URL_VIMEO: () => pe,
  MATCH_URL_WISTIA: () => he,
  MATCH_URL_YOUTUBE: () => z,
  VIDEO_EXTENSIONS: () => Y,
  canPlay: () => Tt
});
var wt = Ot(le), Q = L;
const z = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//, ue = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/, pe = /vimeo\.com\/(?!progressive_redirect).+/, ce = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/, ye = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/, de = /^https?:\/\/fb\.watch\/.+$/, fe = /streamable\.com\/([a-z0-9]+)$/, he = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/, _e = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/, me = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/, Pe = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/, ve = /mixcloud\.com\/([^/]+\/[^/]+)/, be = /vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/, ge = /^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/, X = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, Y = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i, J = /\.(m3u8)($|\?)/i, Oe = /\.(mpd)($|\?)/i, we = /\.(flv)($|\?)/i, V = (e) => {
  if (e instanceof Array) {
    for (const t of e)
      if (typeof t == "string" && V(t) || V(t.src))
        return !0;
    return !1;
  }
  return (0, Q.isMediaStream)(e) || (0, Q.isBlobUrl)(e) ? !0 : X.test(e) || Y.test(e) || J.test(e) || Oe.test(e) || we.test(e);
}, Tt = {
  youtube: (e) => e instanceof Array ? e.every((t) => z.test(t)) : z.test(e),
  soundcloud: (e) => ue.test(e) && !X.test(e),
  vimeo: (e) => pe.test(e) && !Y.test(e) && !J.test(e),
  mux: (e) => ce.test(e),
  facebook: (e) => ye.test(e) || de.test(e),
  streamable: (e) => fe.test(e),
  wistia: (e) => he.test(e),
  twitch: (e) => _e.test(e) || me.test(e),
  dailymotion: (e) => Pe.test(e),
  mixcloud: (e) => ve.test(e),
  vidyard: (e) => be.test(e),
  kaltura: (e) => ge.test(e),
  file: V
};
var q = Object.defineProperty, St = Object.getOwnPropertyDescriptor, Ct = Object.getOwnPropertyNames, Et = Object.prototype.hasOwnProperty, At = (e, t) => {
  for (var r in t)
    q(e, r, { get: t[r], enumerable: !0 });
}, Rt = (e, t, r, a) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let n of Ct(t))
      !Et.call(e, n) && n !== r && q(e, n, { get: () => t[n], enumerable: !(a = St(t, n)) || a.enumerable });
  return e;
}, Mt = (e) => Rt(q({}, "__esModule", { value: !0 }), e), Te = {};
At(Te, {
  default: () => Lt
});
var $t = Mt(Te), m = L, d = wt, Lt = [
  {
    key: "youtube",
    name: "YouTube",
    canPlay: d.canPlay.youtube,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerYouTube' */
      "./4274e06e.js"
    ).then((e) => e.Y))
  },
  {
    key: "soundcloud",
    name: "SoundCloud",
    canPlay: d.canPlay.soundcloud,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerSoundCloud' */
      "./f6b3dbcc.js"
    ).then((e) => e.S))
  },
  {
    key: "vimeo",
    name: "Vimeo",
    canPlay: d.canPlay.vimeo,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerVimeo' */
      "./c9e8b383.js"
    ).then((e) => e.V))
  },
  {
    key: "mux",
    name: "Mux",
    canPlay: d.canPlay.mux,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerMux' */
      "./d5be77db.js"
    ).then((e) => e.M))
  },
  {
    key: "facebook",
    name: "Facebook",
    canPlay: d.canPlay.facebook,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerFacebook' */
      "./5b4734e0.js"
    ).then((e) => e.F))
  },
  {
    key: "streamable",
    name: "Streamable",
    canPlay: d.canPlay.streamable,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerStreamable' */
      "./ea90bfd1.js"
    ).then((e) => e.S))
  },
  {
    key: "wistia",
    name: "Wistia",
    canPlay: d.canPlay.wistia,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerWistia' */
      "./260f11a2.js"
    ).then((e) => e.W))
  },
  {
    key: "twitch",
    name: "Twitch",
    canPlay: d.canPlay.twitch,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerTwitch' */
      "./c9dfb79b.js"
    ).then((e) => e.T))
  },
  {
    key: "dailymotion",
    name: "DailyMotion",
    canPlay: d.canPlay.dailymotion,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerDailyMotion' */
      "./a8cecd44.js"
    ).then((e) => e.D))
  },
  {
    key: "mixcloud",
    name: "Mixcloud",
    canPlay: d.canPlay.mixcloud,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerMixcloud' */
      "./2db4969f.js"
    ).then((e) => e.M))
  },
  {
    key: "vidyard",
    name: "Vidyard",
    canPlay: d.canPlay.vidyard,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerVidyard' */
      "./4ada6205.js"
    ).then((e) => e.V))
  },
  {
    key: "kaltura",
    name: "Kaltura",
    canPlay: d.canPlay.kaltura,
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerKaltura' */
      "./0cb22310.js"
    ).then((e) => e.K))
  },
  {
    key: "file",
    name: "FilePlayer",
    canPlay: d.canPlay.file,
    canEnablePIP: (e) => d.canPlay.file(e) && (document.pictureInPictureEnabled || (0, m.supportsWebKitPresentationMode)()) && !d.AUDIO_EXTENSIONS.test(e),
    lazyPlayer: (0, m.lazy)(() => import(
      /* webpackChunkName: 'reactPlayerFilePlayer' */
      "./5877ed54.js"
    ).then((e) => e.F))
  }
], G = Number.isNaN || function(t) {
  return typeof t == "number" && t !== t;
};
function It(e, t) {
  return !!(e === t || G(e) && G(t));
}
function kt(e, t) {
  if (e.length !== t.length)
    return !1;
  for (var r = 0; r < e.length; r++)
    if (!It(e[r], t[r]))
      return !1;
  return !0;
}
function Dt(e, t) {
  t === void 0 && (t = kt);
  var r, a = [], n, o = !1;
  function h() {
    for (var _ = [], y = 0; y < arguments.length; y++)
      _[y] = arguments[y];
    return o && r === this && t(_, a) || (n = e.apply(this, _), o = !0, r = this, a = _), n;
  }
  return h;
}
const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: Dt
}, Symbol.toStringTag, { value: "Module" })), Nt = /* @__PURE__ */ je(Ut);
var jt = Object.create, I = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, Ht = Object.getOwnPropertyNames, zt = Object.getPrototypeOf, Vt = Object.prototype.hasOwnProperty, Ft = (e, t) => {
  for (var r in t)
    I(e, r, { get: t[r], enumerable: !0 });
}, Se = (e, t, r, a) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let n of Ht(t))
      !Vt.call(e, n) && n !== r && I(e, n, { get: () => t[n], enumerable: !(a = xt(t, n)) || a.enumerable });
  return e;
}, Bt = (e, t, r) => (r = e != null ? jt(zt(e)) : {}, Se(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  t || !e || !e.__esModule ? I(r, "default", { value: e, enumerable: !0 }) : r,
  e
)), Wt = (e) => Se(I({}, "__esModule", { value: !0 }), e), Ce = {};
Ft(Ce, {
  defaultProps: () => Yt,
  propTypes: () => Xt
});
var Ee = Wt(Ce), Kt = Bt(xe);
const { string: u, bool: f, number: O, array: j, oneOfType: S, shape: P, object: c, func: l, node: ee } = Kt.default, Xt = {
  url: S([u, j, c]),
  playing: f,
  loop: f,
  controls: f,
  volume: O,
  muted: f,
  playbackRate: O,
  width: S([u, O]),
  height: S([u, O]),
  style: c,
  progressInterval: O,
  playsinline: f,
  pip: f,
  stopOnUnmount: f,
  light: S([f, u, c]),
  playIcon: ee,
  previewTabIndex: O,
  previewAriaLabel: u,
  fallback: ee,
  oEmbedUrl: u,
  wrapper: S([
    u,
    l,
    P({ render: l.isRequired })
  ]),
  config: P({
    soundcloud: P({
      options: c
    }),
    youtube: P({
      playerVars: c,
      embedOptions: c,
      onUnstarted: l
    }),
    facebook: P({
      appId: u,
      version: u,
      playerId: u,
      attributes: c
    }),
    dailymotion: P({
      params: c
    }),
    vimeo: P({
      playerOptions: c,
      title: u
    }),
    mux: P({
      attributes: c,
      version: u
    }),
    file: P({
      attributes: c,
      tracks: j,
      forceVideo: f,
      forceAudio: f,
      forceHLS: f,
      forceSafariHLS: f,
      forceDisableHls: f,
      forceDASH: f,
      forceFLV: f,
      hlsOptions: c,
      hlsVersion: u,
      dashVersion: u,
      flvVersion: u
    }),
    wistia: P({
      options: c,
      playerId: u,
      customControls: j
    }),
    mixcloud: P({
      options: c
    }),
    twitch: P({
      options: c,
      playerId: u
    }),
    vidyard: P({
      options: c
    })
  }),
  onReady: l,
  onStart: l,
  onPlay: l,
  onPause: l,
  onBuffer: l,
  onBufferEnd: l,
  onEnded: l,
  onError: l,
  onDuration: l,
  onSeek: l,
  onPlaybackRateChange: l,
  onPlaybackQualityChange: l,
  onProgress: l,
  onClickPreview: l,
  onEnablePIP: l,
  onDisablePIP: l
}, p = () => {
}, Yt = {
  playing: !1,
  loop: !1,
  controls: !1,
  volume: null,
  muted: !1,
  playbackRate: 1,
  width: "640px",
  height: "360px",
  style: {},
  progressInterval: 1e3,
  playsinline: !1,
  pip: !1,
  stopOnUnmount: !0,
  light: !1,
  fallback: null,
  wrapper: "div",
  previewTabIndex: 0,
  previewAriaLabel: "",
  oEmbedUrl: "https://noembed.com/embed?url={url}",
  config: {
    soundcloud: {
      options: {
        visual: !0,
        // Undocumented, but makes player fill container and look better
        buying: !1,
        liking: !1,
        download: !1,
        sharing: !1,
        show_comments: !1,
        show_playcount: !1
      }
    },
    youtube: {
      playerVars: {
        playsinline: 1,
        showinfo: 0,
        rel: 0,
        iv_load_policy: 3,
        modestbranding: 1
      },
      embedOptions: {},
      onUnstarted: p
    },
    facebook: {
      appId: "1309697205772819",
      version: "v3.3",
      playerId: null,
      attributes: {}
    },
    dailymotion: {
      params: {
        api: 1,
        "endscreen-enable": !1
      }
    },
    vimeo: {
      playerOptions: {
        autopause: !1,
        byline: !1,
        portrait: !1,
        title: !1
      },
      title: null
    },
    mux: {
      attributes: {},
      version: "2"
    },
    file: {
      attributes: {},
      tracks: [],
      forceVideo: !1,
      forceAudio: !1,
      forceHLS: !1,
      forceDASH: !1,
      forceFLV: !1,
      hlsOptions: {},
      hlsVersion: "1.1.4",
      dashVersion: "3.1.3",
      flvVersion: "1.5.0",
      forceDisableHls: !1
    },
    wistia: {
      options: {},
      playerId: null,
      customControls: null
    },
    mixcloud: {
      options: {
        hide_cover: 1
      }
    },
    twitch: {
      options: {},
      playerId: null
    },
    vidyard: {
      options: {}
    }
  },
  onReady: p,
  onStart: p,
  onPlay: p,
  onPause: p,
  onBuffer: p,
  onBufferEnd: p,
  onEnded: p,
  onError: p,
  onDuration: p,
  onSeek: p,
  onPlaybackRateChange: p,
  onPlaybackQualityChange: p,
  onProgress: p,
  onClickPreview: p,
  onEnablePIP: p,
  onDisablePIP: p
};
var Jt = Object.create, A = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, Zt = Object.getOwnPropertyNames, Qt = Object.getPrototypeOf, Gt = Object.prototype.hasOwnProperty, er = (e, t, r) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, tr = (e, t) => {
  for (var r in t)
    A(e, r, { get: t[r], enumerable: !0 });
}, Ae = (e, t, r, a) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let n of Zt(t))
      !Gt.call(e, n) && n !== r && A(e, n, { get: () => t[n], enumerable: !(a = qt(t, n)) || a.enumerable });
  return e;
}, Re = (e, t, r) => (r = e != null ? Jt(Qt(e)) : {}, Ae(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  t || !e || !e.__esModule ? A(r, "default", { value: e, enumerable: !0 }) : r,
  e
)), rr = (e) => Ae(A({}, "__esModule", { value: !0 }), e), s = (e, t, r) => (er(e, typeof t != "symbol" ? t + "" : t, r), r), Me = {};
tr(Me, {
  default: () => k
});
var ar = rr(Me), te = Re(B), nr = Re(ne), $e = Ee, or = L;
const ir = 5e3;
class k extends te.Component {
  constructor() {
    super(...arguments), s(this, "mounted", !1), s(this, "isReady", !1), s(this, "isPlaying", !1), s(this, "isLoading", !0), s(this, "loadOnReady", null), s(this, "startOnPlay", !0), s(this, "seekOnPlay", null), s(this, "onDurationCalled", !1), s(this, "handlePlayerMount", (t) => {
      if (this.player) {
        this.progress();
        return;
      }
      this.player = t, this.player.load(this.props.url), this.progress();
    }), s(this, "getInternalPlayer", (t) => this.player ? this.player[t] : null), s(this, "progress", () => {
      if (this.props.url && this.player && this.isReady) {
        const t = this.getCurrentTime() || 0, r = this.getSecondsLoaded(), a = this.getDuration();
        if (a) {
          const n = {
            playedSeconds: t,
            played: t / a
          };
          r !== null && (n.loadedSeconds = r, n.loaded = r / a), (n.playedSeconds !== this.prevPlayed || n.loadedSeconds !== this.prevLoaded) && this.props.onProgress(n), this.prevPlayed = n.playedSeconds, this.prevLoaded = n.loadedSeconds;
        }
      }
      this.progressTimeout = setTimeout(this.progress, this.props.progressFrequency || this.props.progressInterval);
    }), s(this, "handleReady", () => {
      if (!this.mounted)
        return;
      this.isReady = !0, this.isLoading = !1;
      const { onReady: t, playing: r, volume: a, muted: n } = this.props;
      t(), !n && a !== null && this.player.setVolume(a), this.loadOnReady ? (this.player.load(this.loadOnReady, !0), this.loadOnReady = null) : r && this.player.play(), this.handleDurationCheck();
    }), s(this, "handlePlay", () => {
      this.isPlaying = !0, this.isLoading = !1;
      const { onStart: t, onPlay: r, playbackRate: a } = this.props;
      this.startOnPlay && (this.player.setPlaybackRate && a !== 1 && this.player.setPlaybackRate(a), t(), this.startOnPlay = !1), r(), this.seekOnPlay && (this.seekTo(this.seekOnPlay), this.seekOnPlay = null), this.handleDurationCheck();
    }), s(this, "handlePause", (t) => {
      this.isPlaying = !1, this.isLoading || this.props.onPause(t);
    }), s(this, "handleEnded", () => {
      const { activePlayer: t, loop: r, onEnded: a } = this.props;
      t.loopOnEnded && r && this.seekTo(0), r || (this.isPlaying = !1, a());
    }), s(this, "handleError", (...t) => {
      this.isLoading = !1, this.props.onError(...t);
    }), s(this, "handleDurationCheck", () => {
      clearTimeout(this.durationCheckTimeout);
      const t = this.getDuration();
      t ? this.onDurationCalled || (this.props.onDuration(t), this.onDurationCalled = !0) : this.durationCheckTimeout = setTimeout(this.handleDurationCheck, 100);
    }), s(this, "handleLoaded", () => {
      this.isLoading = !1;
    });
  }
  componentDidMount() {
    this.mounted = !0;
  }
  componentWillUnmount() {
    clearTimeout(this.progressTimeout), clearTimeout(this.durationCheckTimeout), this.isReady && this.props.stopOnUnmount && (this.player.stop(), this.player.disablePIP && this.player.disablePIP()), this.mounted = !1;
  }
  componentDidUpdate(t) {
    if (!this.player)
      return;
    const { url: r, playing: a, volume: n, muted: o, playbackRate: h, pip: _, loop: y, activePlayer: b, disableDeferredLoading: v } = this.props;
    if (!(0, nr.default)(t.url, r)) {
      if (this.isLoading && !b.forceLoad && !v && !(0, or.isMediaStream)(r)) {
        console.warn(`ReactPlayer: the attempt to load ${r} is being deferred until the player has loaded`), this.loadOnReady = r;
        return;
      }
      this.isLoading = !0, this.startOnPlay = !0, this.onDurationCalled = !1, this.player.load(r, this.isReady);
    }
    !t.playing && a && !this.isPlaying && this.player.play(), t.playing && !a && this.isPlaying && this.player.pause(), !t.pip && _ && this.player.enablePIP && this.player.enablePIP(), t.pip && !_ && this.player.disablePIP && this.player.disablePIP(), t.volume !== n && n !== null && this.player.setVolume(n), t.muted !== o && (o ? this.player.mute() : (this.player.unmute(), n !== null && setTimeout(() => this.player.setVolume(n)))), t.playbackRate !== h && this.player.setPlaybackRate && this.player.setPlaybackRate(h), t.loop !== y && this.player.setLoop && this.player.setLoop(y);
  }
  getDuration() {
    return this.isReady ? this.player.getDuration() : null;
  }
  getCurrentTime() {
    return this.isReady ? this.player.getCurrentTime() : null;
  }
  getSecondsLoaded() {
    return this.isReady ? this.player.getSecondsLoaded() : null;
  }
  seekTo(t, r, a) {
    if (!this.isReady) {
      t !== 0 && (this.seekOnPlay = t, setTimeout(() => {
        this.seekOnPlay = null;
      }, ir));
      return;
    }
    if (r ? r === "fraction" : t > 0 && t < 1) {
      const o = this.player.getDuration();
      if (!o) {
        console.warn("ReactPlayer: could not seek using fraction – duration not yet available");
        return;
      }
      this.player.seekTo(o * t, a);
      return;
    }
    this.player.seekTo(t, a);
  }
  render() {
    const t = this.props.activePlayer;
    return t ? /* @__PURE__ */ te.default.createElement(
      t,
      {
        ...this.props,
        onMount: this.handlePlayerMount,
        onReady: this.handleReady,
        onPlay: this.handlePlay,
        onPause: this.handlePause,
        onEnded: this.handleEnded,
        onLoaded: this.handleLoaded,
        onError: this.handleError
      }
    ) : null;
  }
}
s(k, "displayName", "Player");
s(k, "propTypes", $e.propTypes);
s(k, "defaultProps", $e.defaultProps);
var sr = Object.create, R = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, ur = Object.getOwnPropertyNames, pr = Object.getPrototypeOf, cr = Object.prototype.hasOwnProperty, yr = (e, t, r) => t in e ? R(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, dr = (e, t) => {
  for (var r in t)
    R(e, r, { get: t[r], enumerable: !0 });
}, Le = (e, t, r, a) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let n of ur(t))
      !cr.call(e, n) && n !== r && R(e, n, { get: () => t[n], enumerable: !(a = lr(t, n)) || a.enumerable });
  return e;
}, M = (e, t, r) => (r = e != null ? sr(pr(e)) : {}, Le(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  t || !e || !e.__esModule ? R(r, "default", { value: e, enumerable: !0 }) : r,
  e
)), fr = (e) => Le(R({}, "__esModule", { value: !0 }), e), i = (e, t, r) => (yr(e, typeof t != "symbol" ? t + "" : t, r), r), Ie = {};
dr(Ie, {
  createReactPlayer: () => wr
});
var hr = fr(Ie), w = M(B), _r = M(ae), x = M(Nt), re = M(ne), E = Ee, ke = L, mr = M(ar);
const Pr = (0, ke.lazy)(() => import(
  /* webpackChunkName: 'reactPlayerPreview' */
  "./a019cab5.js"
).then((e) => e.P)), vr = typeof window < "u" && window.document && typeof document < "u", br = typeof U < "u" && U.window && U.window.document, gr = Object.keys(E.propTypes), Or = vr || br ? w.Suspense : () => null, C = [], wr = (e, t) => {
  var r;
  return r = class extends w.Component {
    constructor() {
      super(...arguments), i(this, "state", {
        showPreview: !!this.props.light
      }), i(this, "references", {
        wrapper: (a) => {
          this.wrapper = a;
        },
        player: (a) => {
          this.player = a;
        }
      }), i(this, "handleClickPreview", (a) => {
        this.setState({ showPreview: !1 }), this.props.onClickPreview(a);
      }), i(this, "showPreview", () => {
        this.setState({ showPreview: !0 });
      }), i(this, "getDuration", () => this.player ? this.player.getDuration() : null), i(this, "getCurrentTime", () => this.player ? this.player.getCurrentTime() : null), i(this, "getSecondsLoaded", () => this.player ? this.player.getSecondsLoaded() : null), i(this, "getInternalPlayer", (a = "player") => this.player ? this.player.getInternalPlayer(a) : null), i(this, "seekTo", (a, n, o) => {
        if (!this.player)
          return null;
        this.player.seekTo(a, n, o);
      }), i(this, "handleReady", () => {
        this.props.onReady(this);
      }), i(this, "getActivePlayer", (0, x.default)((a) => {
        for (const n of [...C, ...e])
          if (n.canPlay(a))
            return n;
        return t || null;
      })), i(this, "getConfig", (0, x.default)((a, n) => {
        const { config: o } = this.props;
        return _r.default.all([
          E.defaultProps.config,
          E.defaultProps.config[n] || {},
          o,
          o[n] || {}
        ]);
      })), i(this, "getAttributes", (0, x.default)((a) => (0, ke.omit)(this.props, gr))), i(this, "renderActivePlayer", (a) => {
        if (!a)
          return null;
        const n = this.getActivePlayer(a);
        if (!n)
          return null;
        const o = this.getConfig(a, n.key);
        return /* @__PURE__ */ w.default.createElement(
          mr.default,
          {
            ...this.props,
            key: n.key,
            ref: this.references.player,
            config: o,
            activePlayer: n.lazyPlayer || n,
            onReady: this.handleReady
          }
        );
      });
    }
    shouldComponentUpdate(a, n) {
      return !(0, re.default)(this.props, a) || !(0, re.default)(this.state, n);
    }
    componentDidUpdate(a) {
      const { light: n } = this.props;
      !a.light && n && this.setState({ showPreview: !0 }), a.light && !n && this.setState({ showPreview: !1 });
    }
    renderPreview(a) {
      if (!a)
        return null;
      const { light: n, playIcon: o, previewTabIndex: h, oEmbedUrl: _, previewAriaLabel: y } = this.props;
      return /* @__PURE__ */ w.default.createElement(
        Pr,
        {
          url: a,
          light: n,
          playIcon: o,
          previewTabIndex: h,
          previewAriaLabel: y,
          oEmbedUrl: _,
          onClick: this.handleClickPreview
        }
      );
    }
    render() {
      const { url: a, style: n, width: o, height: h, fallback: _, wrapper: y } = this.props, { showPreview: b } = this.state, v = this.getAttributes(a), T = typeof y == "string" ? this.references.wrapper : void 0;
      return /* @__PURE__ */ w.default.createElement(y, { ref: T, style: { ...n, width: o, height: h }, ...v }, /* @__PURE__ */ w.default.createElement(Or, { fallback: _ }, b ? this.renderPreview(a) : this.renderActivePlayer(a)));
    }
  }, i(r, "displayName", "ReactPlayer"), i(r, "propTypes", E.propTypes), i(r, "defaultProps", E.defaultProps), i(r, "addCustomPlayer", (a) => {
    C.push(a);
  }), i(r, "removeCustomPlayers", () => {
    C.length = 0;
  }), i(r, "canPlay", (a) => {
    for (const n of [...C, ...e])
      if (n.canPlay(a))
        return !0;
    return !1;
  }), i(r, "canEnablePIP", (a) => {
    for (const n of [...C, ...e])
      if (n.canEnablePIP && n.canEnablePIP(a))
        return !0;
    return !1;
  }), r;
};
var Tr = Object.create, D = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, Cr = Object.getOwnPropertyNames, Er = Object.getPrototypeOf, Ar = Object.prototype.hasOwnProperty, Rr = (e, t) => {
  for (var r in t)
    D(e, r, { get: t[r], enumerable: !0 });
}, De = (e, t, r, a) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let n of Cr(t))
      !Ar.call(e, n) && n !== r && D(e, n, { get: () => t[n], enumerable: !(a = Sr(t, n)) || a.enumerable });
  return e;
}, Mr = (e, t, r) => (r = e != null ? Tr(Er(e)) : {}, De(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  t || !e || !e.__esModule ? D(r, "default", { value: e, enumerable: !0 }) : r,
  e
)), $r = (e) => De(D({}, "__esModule", { value: !0 }), e), Ue = {};
Rr(Ue, {
  default: () => kr
});
var Ne = $r(Ue), F = Mr($t), Lr = hr;
const Ir = F.default[F.default.length - 1];
var kr = (0, Lr.createReactPlayer)(F.default, Ir);
const Dr = /* @__PURE__ */ He(Ne), Hr = /* @__PURE__ */ ze({
  __proto__: null,
  default: Dr
}, [Ne]);
export {
  Hr as i,
  wt as p,
  L as u
};
