UNPKG

react-audio-player-component-dk

Version:

A mobile-friendly audio player for React with a modern look and convenient usage.

1,486 lines (1,479 loc) 63.1 kB
import Ke, { forwardRef as Nr, useRef as jr, useState as H, useImperativeHandle as mr, useEffect as sr } from "react"; var cr = { exports: {} }, He = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var fr; function Ir() { if (fr) return He; fr = 1; var I = Ke, p = Symbol.for("react.element"), T = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, h = I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, x = { key: !0, ref: !0, __self: !0, __source: !0 }; function A(m, f, M) { var s, d = {}, j = null, O = null; M !== void 0 && (j = "" + M), f.key !== void 0 && (j = "" + f.key), f.ref !== void 0 && (O = f.ref); for (s in f) E.call(f, s) && !x.hasOwnProperty(s) && (d[s] = f[s]); if (m && m.defaultProps) for (s in f = m.defaultProps, f) d[s] === void 0 && (d[s] = f[s]); return { $$typeof: p, type: m, key: j, ref: O, props: d, _owner: h.current }; } return He.Fragment = T, He.jsx = A, He.jsxs = A, He; } var Ge = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var dr; function Er() { return dr || (dr = 1, process.env.NODE_ENV !== "production" && function() { var I = Ke, p = Symbol.for("react.element"), T = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), m = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), z = Symbol.iterator, R = "@@iterator"; function _(e) { if (e === null || typeof e != "object") return null; var r = z && e[z] || e[R]; return typeof r == "function" ? r : null; } var v = I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function c(e) { { for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++) t[n - 1] = arguments[n]; D("error", e, t); } } function D(e, r, t) { { var n = v.ReactDebugCurrentFrame, i = n.getStackAddendum(); i !== "" && (r += "%s", t = t.concat([i])); var u = t.map(function(o) { return String(o); }); u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u); } } var ae = !1, oe = !1, X = !1, ke = !1, Le = !1, fe; fe = Symbol.for("react.module.reference"); function ze(e) { return !!(typeof e == "string" || typeof e == "function" || e === E || e === x || Le || e === h || e === M || e === s || ke || e === O || ae || oe || X || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === d || e.$$typeof === A || e.$$typeof === m || e.$$typeof === f || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. e.$$typeof === fe || e.getModuleId !== void 0)); } function Re(e, r, t) { var n = e.displayName; if (n) return n; var i = r.displayName || r.name || ""; return i !== "" ? t + "(" + i + ")" : t; } function de(e) { return e.displayName || "Context"; } function S(e) { if (e == null) return null; if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null; if (typeof e == "string") return e; switch (e) { case E: return "Fragment"; case T: return "Portal"; case x: return "Profiler"; case h: return "StrictMode"; case M: return "Suspense"; case s: return "SuspenseList"; } if (typeof e == "object") switch (e.$$typeof) { case m: var r = e; return de(r) + ".Consumer"; case A: var t = e; return de(t._context) + ".Provider"; case f: return Re(e, e.render, "ForwardRef"); case d: var n = e.displayName || null; return n !== null ? n : S(e.type) || "Memo"; case j: { var i = e, u = i._payload, o = i._init; try { return S(o(u)); } catch { return null; } } } return null; } var C = Object.assign, P = 0, ie, ye, ge, pe, ue, Me, ve; function je() { } je.__reactDisabledLog = !0; function xe() { { if (P === 0) { ie = console.log, ye = console.info, ge = console.warn, pe = console.error, ue = console.group, Me = console.groupCollapsed, ve = console.groupEnd; var e = { configurable: !0, enumerable: !0, value: je, writable: !0 }; Object.defineProperties(console, { info: e, log: e, warn: e, error: e, group: e, groupCollapsed: e, groupEnd: e }); } P++; } } function _e() { { if (P--, P === 0) { var e = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: C({}, e, { value: ie }), info: C({}, e, { value: ye }), warn: C({}, e, { value: ge }), error: C({}, e, { value: pe }), group: C({}, e, { value: ue }), groupCollapsed: C({}, e, { value: Me }), groupEnd: C({}, e, { value: ve }) }); } P < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var K = v.ReactCurrentDispatcher, q; function $(e, r, t) { { if (q === void 0) try { throw Error(); } catch (i) { var n = i.stack.trim().match(/\n( *(at )?)/); q = n && n[1] || ""; } return ` ` + q + e; } } var ee = !1, Z; { var be = typeof WeakMap == "function" ? WeakMap : Map; Z = new be(); } function De(e, r) { if (!e || ee) return ""; { var t = Z.get(e); if (t !== void 0) return t; } var n; ee = !0; var i = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var u; u = K.current, K.current = null, xe(); try { if (r) { var o = function() { throw Error(); }; if (Object.defineProperty(o.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(o, []); } catch (L) { n = L; } Reflect.construct(e, [], o); } else { try { o.call(); } catch (L) { n = L; } e.call(o.prototype); } } else { try { throw Error(); } catch (L) { n = L; } e(); } } catch (L) { if (L && n && typeof L.stack == "string") { for (var a = L.stack.split(` `), N = n.stack.split(` `), y = a.length - 1, g = N.length - 1; y >= 1 && g >= 0 && a[y] !== N[g]; ) g--; for (; y >= 1 && g >= 0; y--, g--) if (a[y] !== N[g]) { if (y !== 1 || g !== 1) do if (y--, g--, g < 0 || a[y] !== N[g]) { var w = ` ` + a[y].replace(" at new ", " at "); return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, w), w; } while (y >= 1 && g >= 0); break; } } } finally { ee = !1, K.current = u, _e(), Error.prepareStackTrace = i; } var W = e ? e.displayName || e.name : "", Ve = W ? $(W) : ""; return typeof e == "function" && Z.set(e, Ve), Ve; } function l(e, r, t) { return De(e, !1); } function G(e) { var r = e.prototype; return !!(r && r.isReactComponent); } function B(e, r, t) { if (e == null) return ""; if (typeof e == "function") return De(e, G(e)); if (typeof e == "string") return $(e); switch (e) { case M: return $("Suspense"); case s: return $("SuspenseList"); } if (typeof e == "object") switch (e.$$typeof) { case f: return l(e.render); case d: return B(e.type, r, t); case j: { var n = e, i = n._payload, u = n._init; try { return B(u(i), r, t); } catch { } } } return ""; } var Q = Object.prototype.hasOwnProperty, se = {}, J = v.ReactDebugCurrentFrame; function Y(e) { if (e) { var r = e._owner, t = B(e.type, e._source, r ? r.type : null); J.setExtraStackFrame(t); } else J.setExtraStackFrame(null); } function Pe(e, r, t, n, i) { { var u = Function.call.bind(Q); for (var o in e) if (u(e, o)) { var a = void 0; try { if (typeof e[o] != "function") { var N = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw N.name = "Invariant Violation", N; } a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (y) { a = y; } a && !(a instanceof Error) && (Y(i), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), Y(null)), a instanceof Error && !(a.message in se) && (se[a.message] = !0, Y(i), c("Failed %s type: %s", t, a.message), Y(null)); } } } var Qe = Array.isArray; function V(e) { return Qe(e); } function Ne(e) { { var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object"; return t; } } function Oe(e) { try { return me(e), !1; } catch { return !0; } } function me(e) { return "" + e; } function ce(e) { if (Oe(e)) return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ne(e)), me(e); } var U = v.ReactCurrentOwner, Ie = { key: !0, ref: !0, __self: !0, __source: !0 }, Ee, Te, re; re = {}; function te(e) { if (Q.call(e, "ref")) { var r = Object.getOwnPropertyDescriptor(e, "ref").get; if (r && r.isReactWarning) return !1; } return e.ref !== void 0; } function Ue(e) { if (Q.call(e, "key")) { var r = Object.getOwnPropertyDescriptor(e, "key").get; if (r && r.isReactWarning) return !1; } return e.key !== void 0; } function Se(e, r) { if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) { var t = S(U.current.type); re[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', S(U.current.type), e.ref), re[t] = !0); } } function Ce(e, r) { { var t = function() { Ee || (Ee = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r)); }; t.isReactWarning = !0, Object.defineProperty(e, "key", { get: t, configurable: !0 }); } } function Ye(e, r) { { var t = function() { Te || (Te = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r)); }; t.isReactWarning = !0, Object.defineProperty(e, "ref", { get: t, configurable: !0 }); } } var k = function(e, r, t, n, i, u, o) { var a = { // This tag allows us to uniquely identify this as a React Element $$typeof: p, // Built-in properties that belong on the element type: e, key: r, ref: t, props: o, // Record the component responsible for creating this element. _owner: u }; return a._store = {}, Object.defineProperty(a._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(a, "_self", { configurable: !1, enumerable: !1, writable: !1, value: n }), Object.defineProperty(a, "_source", { configurable: !1, enumerable: !1, writable: !1, value: i }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a; }; function ne(e, r, t, n, i) { { var u, o = {}, a = null, N = null; t !== void 0 && (ce(t), a = "" + t), Ue(r) && (ce(r.key), a = "" + r.key), te(r) && (N = r.ref, Se(r, i)); for (u in r) Q.call(r, u) && !Ie.hasOwnProperty(u) && (o[u] = r[u]); if (e && e.defaultProps) { var y = e.defaultProps; for (u in y) o[u] === void 0 && (o[u] = y[u]); } if (a || N) { var g = typeof e == "function" ? e.displayName || e.name || "Unknown" : e; a && Ce(o, g), N && Ye(o, g); } return k(e, a, N, i, n, U.current, o); } } var le = v.ReactCurrentOwner, he = v.ReactDebugCurrentFrame; function F(e) { if (e) { var r = e._owner, t = B(e.type, e._source, r ? r.type : null); he.setExtraStackFrame(t); } else he.setExtraStackFrame(null); } var we; we = !1; function Ae(e) { return typeof e == "object" && e !== null && e.$$typeof === p; } function Fe() { { if (le.current) { var e = S(le.current.type); if (e) return ` Check the render method of \`` + e + "`."; } return ""; } } function qe(e) { { if (e !== void 0) { var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber; return ` Check your code at ` + r + ":" + t + "."; } return ""; } } var We = {}; function er(e) { { var r = Fe(); if (!r) { var t = typeof e == "string" ? e : e.displayName || e.name; t && (r = ` Check the top-level render call using <` + t + ">."); } return r; } } function Be(e, r) { { if (!e._store || e._store.validated || e.key != null) return; e._store.validated = !0; var t = er(r); if (We[t]) return; We[t] = !0; var n = ""; e && e._owner && e._owner !== le.current && (n = " It was passed a child from " + S(e._owner.type) + "."), F(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null); } } function $e(e, r) { { if (typeof e != "object") return; if (V(e)) for (var t = 0; t < e.length; t++) { var n = e[t]; Ae(n) && Be(n, r); } else if (Ae(e)) e._store && (e._store.validated = !0); else if (e) { var i = _(e); if (typeof i == "function" && i !== e.entries) for (var u = i.call(e), o; !(o = u.next()).done; ) Ae(o.value) && Be(o.value, r); } } } function rr(e) { { var r = e.type; if (r == null || typeof r == "string") return; var t; if (typeof r == "function") t = r.propTypes; else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. r.$$typeof === d)) t = r.propTypes; else return; if (t) { var n = S(r); Pe(t, e.props, "prop", n, e); } else if (r.PropTypes !== void 0 && !we) { we = !0; var i = S(r); c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown"); } typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function tr(e) { { for (var r = Object.keys(e.props), t = 0; t < r.length; t++) { var n = r[t]; if (n !== "children" && n !== "key") { F(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null); break; } } e.ref !== null && (F(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), F(null)); } } function Ze(e, r, t, n, i, u) { { var o = ze(e); if (!o) { var a = ""; (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var N = qe(i); N ? a += N : a += Fe(); var y; e === null ? y = "null" : V(e) ? y = "array" : e !== void 0 && e.$$typeof === p ? (y = "<" + (S(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, a); } var g = ne(e, r, t, i, u); if (g == null) return g; if (o) { var w = r.children; if (w !== void 0) if (n) if (V(w)) { for (var W = 0; W < w.length; W++) $e(w[W], e); Object.freeze && Object.freeze(w); } else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else $e(w, e); } return e === E ? tr(g) : rr(g), g; } } function nr(e, r, t) { return Ze(e, r, t, !0); } function ar(e, r, t) { return Ze(e, r, t, !1); } var or = ar, ir = nr; Ge.Fragment = E, Ge.jsx = or, Ge.jsxs = ir; }()), Ge; } process.env.NODE_ENV === "production" ? cr.exports = Ir() : cr.exports = Er(); var b = cr.exports, lr = { exports: {} }, Je = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var yr; function Tr() { if (yr) return Je; yr = 1; var I = Ke, p = Symbol.for("react.element"), T = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, h = I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, x = { key: !0, ref: !0, __self: !0, __source: !0 }; function A(m, f, M) { var s, d = {}, j = null, O = null; M !== void 0 && (j = "" + M), f.key !== void 0 && (j = "" + f.key), f.ref !== void 0 && (O = f.ref); for (s in f) E.call(f, s) && !x.hasOwnProperty(s) && (d[s] = f[s]); if (m && m.defaultProps) for (s in f = m.defaultProps, f) d[s] === void 0 && (d[s] = f[s]); return { $$typeof: p, type: m, key: j, ref: O, props: d, _owner: h.current }; } return Je.Fragment = T, Je.jsx = A, Je.jsxs = A, Je; } var Xe = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var gr; function hr() { return gr || (gr = 1, process.env.NODE_ENV !== "production" && function() { var I = Ke, p = Symbol.for("react.element"), T = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), m = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), z = Symbol.iterator, R = "@@iterator"; function _(e) { if (e === null || typeof e != "object") return null; var r = z && e[z] || e[R]; return typeof r == "function" ? r : null; } var v = I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function c(e) { { for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++) t[n - 1] = arguments[n]; D("error", e, t); } } function D(e, r, t) { { var n = v.ReactDebugCurrentFrame, i = n.getStackAddendum(); i !== "" && (r += "%s", t = t.concat([i])); var u = t.map(function(o) { return String(o); }); u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u); } } var ae = !1, oe = !1, X = !1, ke = !1, Le = !1, fe; fe = Symbol.for("react.module.reference"); function ze(e) { return !!(typeof e == "string" || typeof e == "function" || e === E || e === x || Le || e === h || e === M || e === s || ke || e === O || ae || oe || X || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === d || e.$$typeof === A || e.$$typeof === m || e.$$typeof === f || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. e.$$typeof === fe || e.getModuleId !== void 0)); } function Re(e, r, t) { var n = e.displayName; if (n) return n; var i = r.displayName || r.name || ""; return i !== "" ? t + "(" + i + ")" : t; } function de(e) { return e.displayName || "Context"; } function S(e) { if (e == null) return null; if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null; if (typeof e == "string") return e; switch (e) { case E: return "Fragment"; case T: return "Portal"; case x: return "Profiler"; case h: return "StrictMode"; case M: return "Suspense"; case s: return "SuspenseList"; } if (typeof e == "object") switch (e.$$typeof) { case m: var r = e; return de(r) + ".Consumer"; case A: var t = e; return de(t._context) + ".Provider"; case f: return Re(e, e.render, "ForwardRef"); case d: var n = e.displayName || null; return n !== null ? n : S(e.type) || "Memo"; case j: { var i = e, u = i._payload, o = i._init; try { return S(o(u)); } catch { return null; } } } return null; } var C = Object.assign, P = 0, ie, ye, ge, pe, ue, Me, ve; function je() { } je.__reactDisabledLog = !0; function xe() { { if (P === 0) { ie = console.log, ye = console.info, ge = console.warn, pe = console.error, ue = console.group, Me = console.groupCollapsed, ve = console.groupEnd; var e = { configurable: !0, enumerable: !0, value: je, writable: !0 }; Object.defineProperties(console, { info: e, log: e, warn: e, error: e, group: e, groupCollapsed: e, groupEnd: e }); } P++; } } function _e() { { if (P--, P === 0) { var e = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: C({}, e, { value: ie }), info: C({}, e, { value: ye }), warn: C({}, e, { value: ge }), error: C({}, e, { value: pe }), group: C({}, e, { value: ue }), groupCollapsed: C({}, e, { value: Me }), groupEnd: C({}, e, { value: ve }) }); } P < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var K = v.ReactCurrentDispatcher, q; function $(e, r, t) { { if (q === void 0) try { throw Error(); } catch (i) { var n = i.stack.trim().match(/\n( *(at )?)/); q = n && n[1] || ""; } return ` ` + q + e; } } var ee = !1, Z; { var be = typeof WeakMap == "function" ? WeakMap : Map; Z = new be(); } function De(e, r) { if (!e || ee) return ""; { var t = Z.get(e); if (t !== void 0) return t; } var n; ee = !0; var i = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var u; u = K.current, K.current = null, xe(); try { if (r) { var o = function() { throw Error(); }; if (Object.defineProperty(o.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(o, []); } catch (L) { n = L; } Reflect.construct(e, [], o); } else { try { o.call(); } catch (L) { n = L; } e.call(o.prototype); } } else { try { throw Error(); } catch (L) { n = L; } e(); } } catch (L) { if (L && n && typeof L.stack == "string") { for (var a = L.stack.split(` `), N = n.stack.split(` `), y = a.length - 1, g = N.length - 1; y >= 1 && g >= 0 && a[y] !== N[g]; ) g--; for (; y >= 1 && g >= 0; y--, g--) if (a[y] !== N[g]) { if (y !== 1 || g !== 1) do if (y--, g--, g < 0 || a[y] !== N[g]) { var w = ` ` + a[y].replace(" at new ", " at "); return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, w), w; } while (y >= 1 && g >= 0); break; } } } finally { ee = !1, K.current = u, _e(), Error.prepareStackTrace = i; } var W = e ? e.displayName || e.name : "", Ve = W ? $(W) : ""; return typeof e == "function" && Z.set(e, Ve), Ve; } function l(e, r, t) { return De(e, !1); } function G(e) { var r = e.prototype; return !!(r && r.isReactComponent); } function B(e, r, t) { if (e == null) return ""; if (typeof e == "function") return De(e, G(e)); if (typeof e == "string") return $(e); switch (e) { case M: return $("Suspense"); case s: return $("SuspenseList"); } if (typeof e == "object") switch (e.$$typeof) { case f: return l(e.render); case d: return B(e.type, r, t); case j: { var n = e, i = n._payload, u = n._init; try { return B(u(i), r, t); } catch { } } } return ""; } var Q = Object.prototype.hasOwnProperty, se = {}, J = v.ReactDebugCurrentFrame; function Y(e) { if (e) { var r = e._owner, t = B(e.type, e._source, r ? r.type : null); J.setExtraStackFrame(t); } else J.setExtraStackFrame(null); } function Pe(e, r, t, n, i) { { var u = Function.call.bind(Q); for (var o in e) if (u(e, o)) { var a = void 0; try { if (typeof e[o] != "function") { var N = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw N.name = "Invariant Violation", N; } a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (y) { a = y; } a && !(a instanceof Error) && (Y(i), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), Y(null)), a instanceof Error && !(a.message in se) && (se[a.message] = !0, Y(i), c("Failed %s type: %s", t, a.message), Y(null)); } } } var Qe = Array.isArray; function V(e) { return Qe(e); } function Ne(e) { { var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object"; return t; } } function Oe(e) { try { return me(e), !1; } catch { return !0; } } function me(e) { return "" + e; } function ce(e) { if (Oe(e)) return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ne(e)), me(e); } var U = v.ReactCurrentOwner, Ie = { key: !0, ref: !0, __self: !0, __source: !0 }, Ee, Te, re; re = {}; function te(e) { if (Q.call(e, "ref")) { var r = Object.getOwnPropertyDescriptor(e, "ref").get; if (r && r.isReactWarning) return !1; } return e.ref !== void 0; } function Ue(e) { if (Q.call(e, "key")) { var r = Object.getOwnPropertyDescriptor(e, "key").get; if (r && r.isReactWarning) return !1; } return e.key !== void 0; } function Se(e, r) { if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) { var t = S(U.current.type); re[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', S(U.current.type), e.ref), re[t] = !0); } } function Ce(e, r) { { var t = function() { Ee || (Ee = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r)); }; t.isReactWarning = !0, Object.defineProperty(e, "key", { get: t, configurable: !0 }); } } function Ye(e, r) { { var t = function() { Te || (Te = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r)); }; t.isReactWarning = !0, Object.defineProperty(e, "ref", { get: t, configurable: !0 }); } } var k = function(e, r, t, n, i, u, o) { var a = { // This tag allows us to uniquely identify this as a React Element $$typeof: p, // Built-in properties that belong on the element type: e, key: r, ref: t, props: o, // Record the component responsible for creating this element. _owner: u }; return a._store = {}, Object.defineProperty(a._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(a, "_self", { configurable: !1, enumerable: !1, writable: !1, value: n }), Object.defineProperty(a, "_source", { configurable: !1, enumerable: !1, writable: !1, value: i }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a; }; function ne(e, r, t, n, i) { { var u, o = {}, a = null, N = null; t !== void 0 && (ce(t), a = "" + t), Ue(r) && (ce(r.key), a = "" + r.key), te(r) && (N = r.ref, Se(r, i)); for (u in r) Q.call(r, u) && !Ie.hasOwnProperty(u) && (o[u] = r[u]); if (e && e.defaultProps) { var y = e.defaultProps; for (u in y) o[u] === void 0 && (o[u] = y[u]); } if (a || N) { var g = typeof e == "function" ? e.displayName || e.name || "Unknown" : e; a && Ce(o, g), N && Ye(o, g); } return k(e, a, N, i, n, U.current, o); } } var le = v.ReactCurrentOwner, he = v.ReactDebugCurrentFrame; function F(e) { if (e) { var r = e._owner, t = B(e.type, e._source, r ? r.type : null); he.setExtraStackFrame(t); } else he.setExtraStackFrame(null); } var we; we = !1; function Ae(e) { return typeof e == "object" && e !== null && e.$$typeof === p; } function Fe() { { if (le.current) { var e = S(le.current.type); if (e) return ` Check the render method of \`` + e + "`."; } return ""; } } function qe(e) { { if (e !== void 0) { var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber; return ` Check your code at ` + r + ":" + t + "."; } return ""; } } var We = {}; function er(e) { { var r = Fe(); if (!r) { var t = typeof e == "string" ? e : e.displayName || e.name; t && (r = ` Check the top-level render call using <` + t + ">."); } return r; } } function Be(e, r) { { if (!e._store || e._store.validated || e.key != null) return; e._store.validated = !0; var t = er(r); if (We[t]) return; We[t] = !0; var n = ""; e && e._owner && e._owner !== le.current && (n = " It was passed a child from " + S(e._owner.type) + "."), F(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null); } } function $e(e, r) { { if (typeof e != "object") return; if (V(e)) for (var t = 0; t < e.length; t++) { var n = e[t]; Ae(n) && Be(n, r); } else if (Ae(e)) e._store && (e._store.validated = !0); else if (e) { var i = _(e); if (typeof i == "function" && i !== e.entries) for (var u = i.call(e), o; !(o = u.next()).done; ) Ae(o.value) && Be(o.value, r); } } } function rr(e) { { var r = e.type; if (r == null || typeof r == "string") return; var t; if (typeof r == "function") t = r.propTypes; else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. r.$$typeof === d)) t = r.propTypes; else return; if (t) { var n = S(r); Pe(t, e.props, "prop", n, e); } else if (r.PropTypes !== void 0 && !we) { we = !0; var i = S(r); c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown"); } typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function tr(e) { { for (var r = Object.keys(e.props), t = 0; t < r.length; t++) { var n = r[t]; if (n !== "children" && n !== "key") { F(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null); break; } } e.ref !== null && (F(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), F(null)); } } function Ze(e, r, t, n, i, u) { { var o = ze(e); if (!o) { var a = ""; (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var N = qe(i); N ? a += N : a += Fe(); var y; e === null ? y = "null" : V(e) ? y = "array" : e !== void 0 && e.$$typeof === p ? (y = "<" + (S(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, a); } var g = ne(e, r, t, i, u); if (g == null) return g; if (o) { var w = r.children; if (w !== void 0) if (n) if (V(w)) { for (var W = 0; W < w.length; W++) $e(w[W], e); Object.freeze && Object.freeze(w); } else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else $e(w, e); } return e === E ? tr(g) : rr(g), g; } } function nr(e, r, t) { return Ze(e, r, t, !0); } function ar(e, r, t) { return Ze(e, r, t, !1); } var or = ar, ir = nr; Xe.Fragment = E, Xe.jsx = or, Xe.jsxs = ir; }()), Xe; } process.env.NODE_ENV === "production" ? lr.exports = Tr() : lr.exports = hr(); var wr = lr.exports; const Ar = (I, p, T, E, h) => { const x = I.getChannelData(0), A = T / (E + h), m = Math.floor(x.length / A), f = p / 2; let M = [], s = 0; for (let d = 0; d < A; d++) { const j = []; let O = 0; const z = []; let R = 0; for (let c = 0; c < m && d * m + c < I.length; c++) { const D = x[d * m + c]; D <= 0 && (j.push(D), O++), D > 0 && (z.push(D), R++); } const _ = j.reduce((c, D) => c + D, 0) / O, v = { max: z.reduce((c, D) => c + D, 0) / R, min: _ }; v.max > s && (s = v.max), Math.abs(v.min) > s && (s = Math.abs(v.min)), M.push(v); } if (f * 0.8 > s * f) { const d = f * 0.8 / s; M = M.map((j) => ({ max: j.max * d, min: j.min * d })); } return M; }, ur = (I, p, T, E, h, x, A, m = 0, f = 1) => { const M = p.height / 2, s = p.getContext("2d"); if (!s) return; s.clearRect(0, 0, p.width, p.height), h !== "transparent" && (s.fillStyle = h, s.fillRect(0, 0, p.width, p.height)); const d = (m || 0) / f; I.forEach((j, O) => { const z = O / I.length, R = d > z; s.fillStyle = R && A ? A : x; const _ = O * (T + E), v = M + j.min, c = T, D = M + j.max - v; s.beginPath(), s.roundRect ? (s.roundRect(_, v, c, D, 50), s.fill()) : s.fillRect(_, v, c, D); }); }, Dr = Nr( ({ blob: I, width: p, height: T, barWidth: E = 2, gap: h = 1, currentTime: x, style: A, backgroundColor: m = "transparent", barColor: f = "rgb(184, 184, 184)", barPlayedColor: M = "rgb(160, 198, 255)" }, s) => { const d = jr(null), [j, O] = H([]), [z, R] = H(0); return mr( s, () => d.current, [] ), sr(() => { (async () => { if (!d.current) return; if (!I) { const v = Array.from({ length: 100 }, () => ({ max: 0, min: 0 })); ur( v, d.current, E, h, m, f, M ); return; } const _ = await I.arrayBuffer(); await new AudioContext().decodeAudioData(_, (v) => { if (!d.current) return; R(v.duration); const c = Ar( v, T, p, E, h ); O(c), ur( c, d.current, E, h, m, f, M ); }); })(); }, [I, d.current]), sr(() => { d.current && ur( j, d.current, E, h, m, f, M, x, z ); }, [x, z]), /* @__PURE__ */ wr.jsx( "canvas", { ref: d, width: p, height: T, style: { ...A } } ); } ); Dr.displayName = "AudioVisualizer"; const xr = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJyZ2JhKDEwOSw1NiwxNzQsMSkiPjxwYXRoIGQ9Ik02IDIwLjE5NTdWMy44MDQyMUM2IDMuMDE4NzggNi44NjM5NSAyLjUzOTkzIDcuNTMgMi45NTYyMUwyMC42NDMyIDExLjE1MkMyMS4yNjk5IDExLjU0MzYgMjEuMjY5OSAxMi40NTYzIDIwLjY0MzIgMTIuODQ4TDcuNTMgMjEuMDQzN0M2Ljg2Mzk1IDIxLjQ2IDYgMjAuOTgxMiA2IDIwLjE5NTdaIj48L3BhdGg+PC9zdmc+", br = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJyZ2JhKDEwOSw1NiwxNzQsMSkiPjxwYXRoIGQ9Ik02IDNIOFYyMUg2VjNaTTE2IDNIMThWMjFIMTZWM1oiPjwvcGF0aD48L3N2Zz4=", Or = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJyZ2JhKDg0LDg0LDg0LDEpIj48cGF0aCBkPSJNNyA0QzcuNTUyMjggNCA4IDQuNDQ3NzIgOCA1VjExLjMzMzNMMTguMjIyNyA0LjUxODIzQzE4LjQ1MjQgNC4zNjUwNiAxOC43NjI4IDQuNDI3MTQgMTguOTE2IDQuNjU2OTFDMTguOTcwOCA0LjczOTA0IDE5IDQuODM1NTUgMTkgNC45MzQyNlYxOS4wNjU3QzE5IDE5LjM0MTkgMTguNzc2MSAxOS41NjU3IDE4LjUgMTkuNTY1N0MxOC40MDEzIDE5LjU2NTcgMTguMzA0OCAxOS41MzY1IDE4LjIyMjcgMTkuNDgxOEw4IDEyLjY2NjdWMTlDOCAxOS41NTIzIDcuNTUyMjggMjAgNyAyMEM2LjQ0NzcyIDIwIDYgMTkuNTUyMyA2IDE5VjVDNiA0LjQ0NzcyIDYuNDQ3NzIgNCA3IDRaTTE3IDcuNzM3MDNMMTAuNjA1NiAxMkwxNyAxNi4yNjNWNy43MzcwM1oiPjwvcGF0aD48L3N2Zz4=", Sr = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJyZ2JhKDg0LDg0LDg0LDEpIj48cGF0aCBkPSJNMTYgMTIuNjY2N0w1Ljc3NzM1IDE5LjQ4MThDNS41NDc1OSAxOS42MzQ5IDUuMjM3MTUgMTkuNTcyOSA1LjA4Mzk3IDE5LjM0MzFDNS4wMjkyMiAxOS4yNjEgNSAxOS4xNjQ1IDUgMTkuMDY1N1Y0LjkzNDI2QzUgNC42NTgxMiA1LjIyMzg2IDQuNDM0MjYgNS41IDQuNDM0MjZDNS41OTg3MSA0LjQzNDI2IDUuNjk1MjIgNC40NjM0OCA1Ljc3NzM1IDQuNTE4MjNMMTYgMTEuMzMzM1Y1QzE2IDQuNDQ3NzIgMTYuNDQ3NyA0IDE3IDRDMTcuNTUyMyA0IDE4IDQuNDQ3NzIgMTggNVYxOUMxOCAxOS41NTIzIDE3LjU1MjMgMjAgMTcgMjBDMTYuNDQ3NyAyMCAxNiAxOS41NTIzIDE2IDE5VjEyLjY2NjdaTTcgNy43MzcwM1YxNi4yNjNMMTMuMzk0NCAxMkw3IDcuNzM3MDNaIj48L3BhdGg+PC9zdmc+", pr = ({ isPlaying: I, allowSkip: p, onPlayClick: T, onPauseClick: E, onSkipForwardClick: h, onSkipBackwardClick: x }) => /* @__PURE__ */ b.jsxs( "div", { style: { display: "flex", alignItems: "center", gridColumn: "2 / 2", gap: 15 }, children: [ p && /* @__PURE__ */ b.jsx( "img", { src: Or, onClick: x, title: "Skip backwards", style: { cursor: "pointer", height: 16, width: 16 }, "data-testid": "skip-back" } ), /* @__PURE__ */ b.jsx( "img", { src: I ? br : xr, onClick: I ? E : T, title: I ? "Pause" : "Play", style: { cursor: "pointer", height: "24px", width: "24px" }, "data-testid": "play-pause" } ), p && /* @__PURE__ */ b.jsx( "img", { src: Sr, onClick: h, title: "Skip forwards", style: { cursor: "pointer", height: 16, width: 16 }, "data-testid": "skip-forward" } ) ] } ), Mr = ({ current: I, setCurrent: p, total: T, showTrack: E = !0, showKnob: h = !0, trackHeight: x = 1, color: A = "rgba(140, 140, 140)", ...m }) => { const [f, M] = H(!1), s = jr(null), d = () => `${I / T * 100}%`, j = (D) => { if (!s.current) return; const ae = s.current.getBoundingClientRect(), oe = ae.width, X = O(D) - ae.left; X < 0 ? p(0) : X > oe ? p(T) : p(T * X / oe); }, O = (D) => D instanceof TouchEvent ? D.touches[0].clientX : D.clientX, z = (D) => { D.nativeEvent instanceof MouseEvent ? (window.addEventListener("mousemove", R), window.addEventListener("mouseup", _)) : (window.addEventListener("touchmove", R), window.addEventListener("touchend", _)), j(D.nativeEvent), M(!0); }, R = (D) => { j(D); }, _ = (D) => { D instanceof MouseEvent ? (window.removeEventListener("mousemove", R), window.removeEventListener("mouseup", _)) : (window.removeEventListener("touchmove", R), window.removeEventListener("touchend", _)), M(!1); }, v = () => { M(!0); }, c = () => { M(!1); }; return /* @__PURE__ */ b.jsx( "div", { tabIndex: 0, style: { height: "15px", width: "100%", gridColumn: 1 / 1, gridRow: 1 / 1, placeSelf: "center", display: "flex", alignItems: "center", cursor: "pointer" }, onMouseDown: z, onTouchStart: z, onMouseEnter: v, onMouseLeave: c, ref: s, "data-testid": m["data-testid"] ? `${m["data-testid"]}-trackbar` : "trackbar", children: /* @__PURE__ */ b.jsx( "div",