UNPKG

@aigamo/hydrangean-diva

Version:

An open-source online media player that can be deployed to and hosted on GitHub pages.

1,546 lines (1,544 loc) 75.2 kB
var Ir = Object.defineProperty; var Pr = (t, e, n) => e in t ? Ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; var U = (t, e, n) => Pr(t, typeof e != "symbol" ? e + "" : e, n); import { makeObservable as Rr, action as y, computed as _, observable as te, reaction as wr } from "mobx"; import * as re from "react"; import zt, { forwardRef as Or, useContext as st, memo as Z, useState as q, useCallback as $, createContext as Lt, useEffect as _r, useLayoutEffect as Ar, useMemo as Vt } from "react"; import kr from "@emotion/cache"; import { EuiButton as ne, EuiModalHeaderTitle as Mr, EuiModalHeader as Fr, EuiForm as jr, EuiFormRow as tt, EuiFieldText as It, EuiModalBody as Nr, EuiModalFooter as $r, EuiButtonEmpty as Dr, EuiModal as zr, useEuiTheme as Yt, EuiCheckbox as Bt, EuiTableHeaderCellCheckbox as Lr, EuiTableHeader as Vr, EuiContextMenuItem as Yr, EuiContextMenuPanel as Br, EuiTableRowCell as rt, EuiTableRowCellCheckbox as Wr, EuiLink as Ur, EuiTableRow as qr, EuiTable as Hr, EuiButtonIcon as G, EuiPopover as lt, EuiIcon as H, EuiHorizontalRule as Pt, EuiTableHeaderCell as Xe, EuiCodeBlock as Gr, EuiFlyout as Jr, EuiFlexGroup as me, EuiFlexItem as J, EuiSpacer as Wt, EuiEmptyPrompt as Kr, EuiPageTemplate as nt, EuiRange as Ut, EuiContextMenu as Xr, EuiBottomBar as Zr } from "@elastic/eui"; import { AddRegular as ct, PlayRegular as Qr, DismissRegular as ut, MoreHorizontalFilled as qt, ArrowUploadRegular as en, ArrowDownloadRegular as tn, WindowDevToolsRegular as rn, DeleteRegular as nn, Speaker2Regular as Ht, TopSpeedRegular as on, SkipBack10Regular as an, SkipForward30Regular as sn, ArrowRepeat1Filled as ln, ArrowRepeatAllFilled as cn, ArrowRepeatAllOffFilled as un, ArrowShuffleFilled as fn, ArrowShuffleOffFilled as dn, PreviousFilled as mn, PauseFilled as hn, PlayFilled as vn, NextFilled as pn, NavigationPlayRegular as yn } from "@fluentui/react-icons"; import { observer as Y } from "mobx-react-lite"; import { findVideoService as gn, useNostalgicDiva as ie, NostalgicDiva as bn } from "@aigamo/nostalgic-diva"; import { ReactSortable as En } from "react-sortablejs"; import { pull as Rt } from "lodash-es"; import Tn from "ajv"; class Gt { makeObservable(e, n) { return Rr(e, n); } } class _i { makeObservable(e, n) { return e; } } var $e = { exports: {} }, xe = {}; /** * @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 wt; function xn() { if (wt) return xe; wt = 1; var t = zt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 }; function f(h, m, p) { var E, P = {}, D = null, j = null; p !== void 0 && (D = "" + p), m.key !== void 0 && (D = "" + m.key), m.ref !== void 0 && (j = m.ref); for (E in m) i.call(m, E) && !l.hasOwnProperty(E) && (P[E] = m[E]); if (h && h.defaultProps) for (E in m = h.defaultProps, m) P[E] === void 0 && (P[E] = m[E]); return { $$typeof: e, type: h, key: D, ref: j, props: P, _owner: a.current }; } return xe.Fragment = n, xe.jsx = f, xe.jsxs = f, xe; } var Se = {}; /** * @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 Ot; function Sn() { return Ot || (Ot = 1, process.env.NODE_ENV !== "production" && function() { var t = zt, e = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), h = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), A = Symbol.iterator, B = "@@iterator"; function Q(r) { if (r === null || typeof r != "object") return null; var s = A && r[A] || r[B]; return typeof s == "function" ? s : null; } var z = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function I(r) { { for (var s = arguments.length, u = new Array(s > 1 ? s - 1 : 0), v = 1; v < s; v++) u[v - 1] = arguments[v]; k("error", r, u); } } function k(r, s, u) { { var v = z.ReactDebugCurrentFrame, T = v.getStackAddendum(); T !== "" && (s += "%s", u = u.concat([T])); var C = u.map(function(b) { return String(b); }); C.unshift("Warning: " + s), Function.prototype.apply.call(console[r], console, C); } } var w = !1, c = !1, L = !1, he = !1, Re = !1, we; we = Symbol.for("react.module.reference"); function Ve(r) { return !!(typeof r == "string" || typeof r == "function" || r === i || r === l || Re || r === a || r === p || r === E || he || r === j || w || c || L || typeof r == "object" && r !== null && (r.$$typeof === D || r.$$typeof === P || r.$$typeof === f || r.$$typeof === h || r.$$typeof === m || // 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. r.$$typeof === we || r.getModuleId !== void 0)); } function Ye(r, s, u) { var v = r.displayName; if (v) return v; var T = s.displayName || s.name || ""; return T !== "" ? u + "(" + T + ")" : u; } function Oe(r) { return r.displayName || "Context"; } function K(r) { if (r == null) return null; if (typeof r.tag == "number" && I("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function") return r.displayName || r.name || null; if (typeof r == "string") return r; switch (r) { case i: return "Fragment"; case n: return "Portal"; case l: return "Profiler"; case a: return "StrictMode"; case p: return "Suspense"; case E: return "SuspenseList"; } if (typeof r == "object") switch (r.$$typeof) { case h: var s = r; return Oe(s) + ".Consumer"; case f: var u = r; return Oe(u._context) + ".Provider"; case m: return Ye(r, r.render, "ForwardRef"); case P: var v = r.displayName || null; return v !== null ? v : K(r.type) || "Memo"; case D: { var T = r, C = T._payload, b = T._init; try { return K(b(C)); } catch { return null; } } } return null; } var ee = Object.assign, oe = 0, _e, Ae, ve, ke, pe, Me, Fe; function je() { } je.__reactDisabledLog = !0; function Be() { { if (oe === 0) { _e = console.log, Ae = console.info, ve = console.warn, ke = console.error, pe = console.group, Me = console.groupCollapsed, Fe = console.groupEnd; var r = { configurable: !0, enumerable: !0, value: je, writable: !0 }; Object.defineProperties(console, { info: r, log: r, warn: r, error: r, group: r, groupCollapsed: r, groupEnd: r }); } oe++; } } function We() { { if (oe--, oe === 0) { var r = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: ee({}, r, { value: _e }), info: ee({}, r, { value: Ae }), warn: ee({}, r, { value: ve }), error: ee({}, r, { value: ke }), group: ee({}, r, { value: pe }), groupCollapsed: ee({}, r, { value: Me }), groupEnd: ee({}, r, { value: Fe }) }); } oe < 0 && I("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var ye = z.ReactCurrentDispatcher, ge; function le(r, s, u) { { if (ge === void 0) try { throw Error(); } catch (T) { var v = T.stack.trim().match(/\n( *(at )?)/); ge = v && v[1] || ""; } return ` ` + ge + r; } } var be = !1, ce; { var Ue = typeof WeakMap == "function" ? WeakMap : Map; ce = new Ue(); } function d(r, s) { if (!r || be) return ""; { var u = ce.get(r); if (u !== void 0) return u; } var v; be = !0; var T = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var C; C = ye.current, ye.current = null, Be(); try { if (s) { var b = function() { throw Error(); }; if (Object.defineProperty(b.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(b, []); } catch (V) { v = V; } Reflect.construct(r, [], b); } else { try { b.call(); } catch (V) { v = V; } r.call(b.prototype); } } else { try { throw Error(); } catch (V) { v = V; } r(); } } catch (V) { if (V && v && typeof V.stack == "string") { for (var g = V.stack.split(` `), N = v.stack.split(` `), O = g.length - 1, M = N.length - 1; O >= 1 && M >= 0 && g[O] !== N[M]; ) M--; for (; O >= 1 && M >= 0; O--, M--) if (g[O] !== N[M]) { if (O !== 1 || M !== 1) do if (O--, M--, M < 0 || g[O] !== N[M]) { var W = ` ` + g[O].replace(" at new ", " at "); return r.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", r.displayName)), typeof r == "function" && ce.set(r, W), W; } while (O >= 1 && M >= 0); break; } } } finally { be = !1, ye.current = C, We(), Error.prepareStackTrace = T; } var de = r ? r.displayName || r.name : "", se = de ? le(de) : ""; return typeof r == "function" && ce.set(r, se), se; } function Ee(r, s, u) { return d(r, !1); } function ue(r) { var s = r.prototype; return !!(s && s.isReactComponent); } function ae(r, s, u) { if (r == null) return ""; if (typeof r == "function") return d(r, ue(r)); if (typeof r == "string") return le(r); switch (r) { case p: return le("Suspense"); case E: return le("SuspenseList"); } if (typeof r == "object") switch (r.$$typeof) { case m: return Ee(r.render); case P: return ae(r.type, s, u); case D: { var v = r, T = v._payload, C = v._init; try { return ae(C(T), s, u); } catch { } } } return ""; } var Te = Object.prototype.hasOwnProperty, ft = {}, dt = z.ReactDebugCurrentFrame; function Ne(r) { if (r) { var s = r._owner, u = ae(r.type, r._source, s ? s.type : null); dt.setExtraStackFrame(u); } else dt.setExtraStackFrame(null); } function nr(r, s, u, v, T) { { var C = Function.call.bind(Te); for (var b in r) if (C(r, b)) { var g = void 0; try { if (typeof r[b] != "function") { var N = Error((v || "React class") + ": " + u + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw N.name = "Invariant Violation", N; } g = r[b](s, b, v, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (O) { g = O; } g && !(g instanceof Error) && (Ne(T), I("%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).", v || "React class", u, b, typeof g), Ne(null)), g instanceof Error && !(g.message in ft) && (ft[g.message] = !0, Ne(T), I("Failed %s type: %s", u, g.message), Ne(null)); } } } var ir = Array.isArray; function qe(r) { return ir(r); } function or(r) { { var s = typeof Symbol == "function" && Symbol.toStringTag, u = s && r[Symbol.toStringTag] || r.constructor.name || "Object"; return u; } } function ar(r) { try { return mt(r), !1; } catch { return !0; } } function mt(r) { return "" + r; } function ht(r) { if (ar(r)) return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", or(r)), mt(r); } var vt = z.ReactCurrentOwner, sr = { key: !0, ref: !0, __self: !0, __source: !0 }, pt, yt; function lr(r) { if (Te.call(r, "ref")) { var s = Object.getOwnPropertyDescriptor(r, "ref").get; if (s && s.isReactWarning) return !1; } return r.ref !== void 0; } function cr(r) { if (Te.call(r, "key")) { var s = Object.getOwnPropertyDescriptor(r, "key").get; if (s && s.isReactWarning) return !1; } return r.key !== void 0; } function ur(r, s) { typeof r.ref == "string" && vt.current; } function fr(r, s) { { var u = function() { pt || (pt = !0, I("%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)", s)); }; u.isReactWarning = !0, Object.defineProperty(r, "key", { get: u, configurable: !0 }); } } function dr(r, s) { { var u = function() { yt || (yt = !0, I("%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)", s)); }; u.isReactWarning = !0, Object.defineProperty(r, "ref", { get: u, configurable: !0 }); } } var mr = function(r, s, u, v, T, C, b) { var g = { // This tag allows us to uniquely identify this as a React Element $$typeof: e, // Built-in properties that belong on the element type: r, key: s, ref: u, props: b, // Record the component responsible for creating this element. _owner: C }; return g._store = {}, Object.defineProperty(g._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(g, "_self", { configurable: !1, enumerable: !1, writable: !1, value: v }), Object.defineProperty(g, "_source", { configurable: !1, enumerable: !1, writable: !1, value: T }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g; }; function hr(r, s, u, v, T) { { var C, b = {}, g = null, N = null; u !== void 0 && (ht(u), g = "" + u), cr(s) && (ht(s.key), g = "" + s.key), lr(s) && (N = s.ref, ur(s, T)); for (C in s) Te.call(s, C) && !sr.hasOwnProperty(C) && (b[C] = s[C]); if (r && r.defaultProps) { var O = r.defaultProps; for (C in O) b[C] === void 0 && (b[C] = O[C]); } if (g || N) { var M = typeof r == "function" ? r.displayName || r.name || "Unknown" : r; g && fr(b, M), N && dr(b, M); } return mr(r, g, N, T, v, vt.current, b); } } var He = z.ReactCurrentOwner, gt = z.ReactDebugCurrentFrame; function fe(r) { if (r) { var s = r._owner, u = ae(r.type, r._source, s ? s.type : null); gt.setExtraStackFrame(u); } else gt.setExtraStackFrame(null); } var Ge; Ge = !1; function Je(r) { return typeof r == "object" && r !== null && r.$$typeof === e; } function bt() { { if (He.current) { var r = K(He.current.type); if (r) return ` Check the render method of \`` + r + "`."; } return ""; } } function vr(r) { return ""; } var Et = {}; function pr(r) { { var s = bt(); if (!s) { var u = typeof r == "string" ? r : r.displayName || r.name; u && (s = ` Check the top-level render call using <` + u + ">."); } return s; } } function Tt(r, s) { { if (!r._store || r._store.validated || r.key != null) return; r._store.validated = !0; var u = pr(s); if (Et[u]) return; Et[u] = !0; var v = ""; r && r._owner && r._owner !== He.current && (v = " It was passed a child from " + K(r._owner.type) + "."), fe(r), I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, v), fe(null); } } function xt(r, s) { { if (typeof r != "object") return; if (qe(r)) for (var u = 0; u < r.length; u++) { var v = r[u]; Je(v) && Tt(v, s); } else if (Je(r)) r._store && (r._store.validated = !0); else if (r) { var T = Q(r); if (typeof T == "function" && T !== r.entries) for (var C = T.call(r), b; !(b = C.next()).done; ) Je(b.value) && Tt(b.value, s); } } } function yr(r) { { var s = r.type; if (s == null || typeof s == "string") return; var u; if (typeof s == "function") u = s.propTypes; else if (typeof s == "object" && (s.$$typeof === m || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. s.$$typeof === P)) u = s.propTypes; else return; if (u) { var v = K(s); nr(u, r.props, "prop", v, r); } else if (s.PropTypes !== void 0 && !Ge) { Ge = !0; var T = K(s); I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown"); } typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function gr(r) { { for (var s = Object.keys(r.props), u = 0; u < s.length; u++) { var v = s[u]; if (v !== "children" && v !== "key") { fe(r), I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), fe(null); break; } } r.ref !== null && (fe(r), I("Invalid attribute `ref` supplied to `React.Fragment`."), fe(null)); } } var St = {}; function Ct(r, s, u, v, T, C) { { var b = Ve(r); if (!b) { var g = ""; (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (g += " 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 = vr(); N ? g += N : g += bt(); var O; r === null ? O = "null" : qe(r) ? O = "array" : r !== void 0 && r.$$typeof === e ? (O = "<" + (K(r.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : O = typeof r, I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", O, g); } var M = hr(r, s, u, T, C); if (M == null) return M; if (b) { var W = s.children; if (W !== void 0) if (v) if (qe(W)) { for (var de = 0; de < W.length; de++) xt(W[de], r); Object.freeze && Object.freeze(W); } else I("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 xt(W, r); } if (Te.call(s, "key")) { var se = K(r), V = Object.keys(s).filter(function(Cr) { return Cr !== "key"; }), Ke = V.length > 0 ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!St[se + Ke]) { var Sr = V.length > 0 ? "{" + V.join(": ..., ") + ": ...}" : "{}"; I(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, Ke, se, Sr, se), St[se + Ke] = !0; } } return r === i ? gr(M) : yr(M), M; } } function br(r, s, u) { return Ct(r, s, u, !0); } function Er(r, s, u) { return Ct(r, s, u, !1); } var Tr = Er, xr = br; Se.Fragment = i, Se.jsx = Tr, Se.jsxs = xr; }()), Se; } var _t; function Cn() { return _t || (_t = 1, process.env.NODE_ENV === "production" ? $e.exports = xn() : $e.exports = Sn()), $e.exports; } var Ie = Cn(), De = { exports: {} }, x = {}; /** @license React v16.13.1 * react-is.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 At; function In() { if (At) return x; At = 1; var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, n = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, l = t ? Symbol.for("react.profiler") : 60114, f = t ? Symbol.for("react.provider") : 60109, h = t ? Symbol.for("react.context") : 60110, m = t ? Symbol.for("react.async_mode") : 60111, p = t ? Symbol.for("react.concurrent_mode") : 60111, E = t ? Symbol.for("react.forward_ref") : 60112, P = t ? Symbol.for("react.suspense") : 60113, D = t ? Symbol.for("react.suspense_list") : 60120, j = t ? Symbol.for("react.memo") : 60115, A = t ? Symbol.for("react.lazy") : 60116, B = t ? Symbol.for("react.block") : 60121, Q = t ? Symbol.for("react.fundamental") : 60117, z = t ? Symbol.for("react.responder") : 60118, I = t ? Symbol.for("react.scope") : 60119; function k(c) { if (typeof c == "object" && c !== null) { var L = c.$$typeof; switch (L) { case e: switch (c = c.type, c) { case m: case p: case i: case l: case a: case P: return c; default: switch (c = c && c.$$typeof, c) { case h: case E: case A: case j: case f: return c; default: return L; } } case n: return L; } } } function w(c) { return k(c) === p; } return x.AsyncMode = m, x.ConcurrentMode = p, x.ContextConsumer = h, x.ContextProvider = f, x.Element = e, x.ForwardRef = E, x.Fragment = i, x.Lazy = A, x.Memo = j, x.Portal = n, x.Profiler = l, x.StrictMode = a, x.Suspense = P, x.isAsyncMode = function(c) { return w(c) || k(c) === m; }, x.isConcurrentMode = w, x.isContextConsumer = function(c) { return k(c) === h; }, x.isContextProvider = function(c) { return k(c) === f; }, x.isElement = function(c) { return typeof c == "object" && c !== null && c.$$typeof === e; }, x.isForwardRef = function(c) { return k(c) === E; }, x.isFragment = function(c) { return k(c) === i; }, x.isLazy = function(c) { return k(c) === A; }, x.isMemo = function(c) { return k(c) === j; }, x.isPortal = function(c) { return k(c) === n; }, x.isProfiler = function(c) { return k(c) === l; }, x.isStrictMode = function(c) { return k(c) === a; }, x.isSuspense = function(c) { return k(c) === P; }, x.isValidElementType = function(c) { return typeof c == "string" || typeof c == "function" || c === i || c === p || c === l || c === a || c === P || c === D || typeof c == "object" && c !== null && (c.$$typeof === A || c.$$typeof === j || c.$$typeof === f || c.$$typeof === h || c.$$typeof === E || c.$$typeof === Q || c.$$typeof === z || c.$$typeof === I || c.$$typeof === B); }, x.typeOf = k, x; } var S = {}; /** @license React v16.13.1 * react-is.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 kt; function Pn() { return kt || (kt = 1, process.env.NODE_ENV !== "production" && function() { var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, n = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, l = t ? Symbol.for("react.profiler") : 60114, f = t ? Symbol.for("react.provider") : 60109, h = t ? Symbol.for("react.context") : 60110, m = t ? Symbol.for("react.async_mode") : 60111, p = t ? Symbol.for("react.concurrent_mode") : 60111, E = t ? Symbol.for("react.forward_ref") : 60112, P = t ? Symbol.for("react.suspense") : 60113, D = t ? Symbol.for("react.suspense_list") : 60120, j = t ? Symbol.for("react.memo") : 60115, A = t ? Symbol.for("react.lazy") : 60116, B = t ? Symbol.for("react.block") : 60121, Q = t ? Symbol.for("react.fundamental") : 60117, z = t ? Symbol.for("react.responder") : 60118, I = t ? Symbol.for("react.scope") : 60119; function k(d) { return typeof d == "string" || typeof d == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. d === i || d === p || d === l || d === a || d === P || d === D || typeof d == "object" && d !== null && (d.$$typeof === A || d.$$typeof === j || d.$$typeof === f || d.$$typeof === h || d.$$typeof === E || d.$$typeof === Q || d.$$typeof === z || d.$$typeof === I || d.$$typeof === B); } function w(d) { if (typeof d == "object" && d !== null) { var Ee = d.$$typeof; switch (Ee) { case e: var ue = d.type; switch (ue) { case m: case p: case i: case l: case a: case P: return ue; default: var ae = ue && ue.$$typeof; switch (ae) { case h: case E: case A: case j: case f: return ae; default: return Ee; } } case n: return Ee; } } } var c = m, L = p, he = h, Re = f, we = e, Ve = E, Ye = i, Oe = A, K = j, ee = n, oe = l, _e = a, Ae = P, ve = !1; function ke(d) { return ve || (ve = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), pe(d) || w(d) === m; } function pe(d) { return w(d) === p; } function Me(d) { return w(d) === h; } function Fe(d) { return w(d) === f; } function je(d) { return typeof d == "object" && d !== null && d.$$typeof === e; } function Be(d) { return w(d) === E; } function We(d) { return w(d) === i; } function ye(d) { return w(d) === A; } function ge(d) { return w(d) === j; } function le(d) { return w(d) === n; } function be(d) { return w(d) === l; } function ce(d) { return w(d) === a; } function Ue(d) { return w(d) === P; } S.AsyncMode = c, S.ConcurrentMode = L, S.ContextConsumer = he, S.ContextProvider = Re, S.Element = we, S.ForwardRef = Ve, S.Fragment = Ye, S.Lazy = Oe, S.Memo = K, S.Portal = ee, S.Profiler = oe, S.StrictMode = _e, S.Suspense = Ae, S.isAsyncMode = ke, S.isConcurrentMode = pe, S.isContextConsumer = Me, S.isContextProvider = Fe, S.isElement = je, S.isForwardRef = Be, S.isFragment = We, S.isLazy = ye, S.isMemo = ge, S.isPortal = le, S.isProfiler = be, S.isStrictMode = ce, S.isSuspense = Ue, S.isValidElementType = k, S.typeOf = w; }()), S; } var Mt; function Rn() { return Mt || (Mt = 1, process.env.NODE_ENV === "production" ? De.exports = In() : De.exports = Pn()), De.exports; } var Ze, Ft; function wn() { if (Ft) return Ze; Ft = 1; var t = Rn(), e = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, n = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, i = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, a = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, l = {}; l[t.ForwardRef] = i, l[t.Memo] = a; function f(A) { return t.isMemo(A) ? a : l[A.$$typeof] || e; } var h = Object.defineProperty, m = Object.getOwnPropertyNames, p = Object.getOwnPropertySymbols, E = Object.getOwnPropertyDescriptor, P = Object.getPrototypeOf, D = Object.prototype; function j(A, B, Q) { if (typeof B != "string") { if (D) { var z = P(B); z && z !== D && j(A, z, Q); } var I = m(B); p && (I = I.concat(p(B))); for (var k = f(A), w = f(B), c = 0; c < I.length; ++c) { var L = I[c]; if (!n[L] && !(Q && Q[L]) && !(w && w[L]) && !(k && k[L])) { var he = E(B, L); try { h(A, L, he); } catch { } } } } return A; } return Ze = j, Ze; } wn(); var On = !0; function _n(t, e, n) { var i = ""; return n.split(" ").forEach(function(a) { t[a] !== void 0 ? e.push(t[a] + ";") : a && (i += a + " "); }), i; } var Jt = function(e, n, i) { var a = e.key + "-" + n.name; // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (i === !1 || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser On === !1) && e.registered[a] === void 0 && (e.registered[a] = n.styles); }, An = function(e, n, i) { Jt(e, n, i); var a = e.key + "-" + n.name; if (e.inserted[n.name] === void 0) { var l = n; do e.insert(n === l ? "." + a : "", l, e.sheet, !0), l = l.next; while (l !== void 0); } }; function kn(t) { for (var e = 0, n, i = 0, a = t.length; a >= 4; ++i, a -= 4) n = t.charCodeAt(i) & 255 | (t.charCodeAt(++i) & 255) << 8 | (t.charCodeAt(++i) & 255) << 16 | (t.charCodeAt(++i) & 255) << 24, n = /* Math.imul(k, m): */ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */ n >>> 24, e = /* Math.imul(k, m): */ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */ (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16); switch (a) { case 3: e ^= (t.charCodeAt(i + 2) & 255) << 16; case 2: e ^= (t.charCodeAt(i + 1) & 255) << 8; case 1: e ^= t.charCodeAt(i) & 255, e = /* Math.imul(h, m): */ (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16); } return e ^= e >>> 13, e = /* Math.imul(h, m): */ (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16), ((e ^ e >>> 15) >>> 0).toString(36); } var Mn = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, scale: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }; function Fn(t) { var e = /* @__PURE__ */ Object.create(null); return function(n) { return e[n] === void 0 && (e[n] = t(n)), e[n]; }; } var jn = /[A-Z]|^ms/g, Nn = /_EMO_([^_]+?)_([^]*?)_EMO_/g, Kt = function(e) { return e.charCodeAt(1) === 45; }, jt = function(e) { return e != null && typeof e != "boolean"; }, Qe = /* @__PURE__ */ Fn(function(t) { return Kt(t) ? t : t.replace(jn, "-$&").toLowerCase(); }), Nt = function(e, n) { switch (e) { case "animation": case "animationName": if (typeof n == "string") return n.replace(Nn, function(i, a, l) { return X = { name: a, styles: l, next: X }, a; }); } return Mn[e] !== 1 && !Kt(e) && typeof n == "number" && n !== 0 ? n + "px" : n; }; function Pe(t, e, n) { if (n == null) return ""; var i = n; if (i.__emotion_styles !== void 0) return i; switch (typeof n) { case "boolean": return ""; case "object": { var a = n; if (a.anim === 1) return X = { name: a.name, styles: a.styles, next: X }, a.name; var l = n; if (l.styles !== void 0) { var f = l.next; if (f !== void 0) for (; f !== void 0; ) X = { name: f.name, styles: f.styles, next: X }, f = f.next; var h = l.styles + ";"; return h; } return $n(t, e, n); } case "function": { if (t !== void 0) { var m = X, p = n(t); return X = m, Pe(t, e, p); } break; } } var E = n; return E; } function $n(t, e, n) { var i = ""; if (Array.isArray(n)) for (var a = 0; a < n.length; a++) i += Pe(t, e, n[a]) + ";"; else for (var l in n) { var f = n[l]; if (typeof f != "object") { var h = f; jt(h) && (i += Qe(l) + ":" + Nt(l, h) + ";"); } else if (Array.isArray(f) && typeof f[0] == "string" && e == null) for (var m = 0; m < f.length; m++) jt(f[m]) && (i += Qe(l) + ":" + Nt(l, f[m]) + ";"); else { var p = Pe(t, e, f); switch (l) { case "animation": case "animationName": { i += Qe(l) + ":" + p + ";"; break; } default: i += l + "{" + p + "}"; } } } return i; } var $t = /label:\s*([^\s;{]+)\s*(;|$)/g, X; function Dn(t, e, n) { if (t.length === 1 && typeof t[0] == "object" && t[0] !== null && t[0].styles !== void 0) return t[0]; var i = !0, a = ""; X = void 0; var l = t[0]; if (l == null || l.raw === void 0) i = !1, a += Pe(n, e, l); else { var f = l; a += f[0]; } for (var h = 1; h < t.length; h++) if (a += Pe(n, e, t[h]), i) { var m = l; a += m[h]; } $t.lastIndex = 0; for (var p = "", E; (E = $t.exec(a)) !== null; ) p += "-" + E[1]; var P = kn(a) + p; return { name: P, styles: a, next: X }; } var zn = function(e) { return e(); }, Ln = re.useInsertionEffect ? re.useInsertionEffect : !1, Vn = Ln || zn, Xt = /* @__PURE__ */ re.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement < "u" ? /* @__PURE__ */ kr({ key: "css" }) : null ); Xt.Provider; var Yn = function(e) { return /* @__PURE__ */ Or(function(n, i) { var a = st(Xt); return e(n, a, i); }); }, Bn = /* @__PURE__ */ re.createContext({}), ze = {}.hasOwnProperty, it = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", Zt = function(e, n) { var i = {}; for (var a in n) ze.call(n, a) && (i[a] = n[a]); return i[it] = e, i; }, Wn = function(e) { var n = e.cache, i = e.serialized, a = e.isStringTag; return Jt(n, i, a), Vn(function() { return An(n, i, a); }), null; }, Un = /* @__PURE__ */ Yn(function(t, e, n) { var i = t.css; typeof i == "string" && e.registered[i] !== void 0 && (i = e.registered[i]); var a = t[it], l = [i], f = ""; typeof t.className == "string" ? f = _n(e.registered, l, t.className) : t.className != null && (f = t.className + " "); var h = Dn(l, void 0, re.useContext(Bn)); f += e.key + "-" + h.name; var m = {}; for (var p in t) ze.call(t, p) && p !== "css" && p !== it && (m[p] = t[p]); return m.className = f, n && (m.ref = n), /* @__PURE__ */ re.createElement(re.Fragment, null, /* @__PURE__ */ re.createElement(Wn, { cache: e, serialized: h, isStringTag: typeof a == "string" }), /* @__PURE__ */ re.createElement(a, m)); }), Qt = Un, Le = Ie.Fragment, o = function(e, n, i) { return ze.call(n, "css") ? Ie.jsx(Qt, Zt(e, n), i) : Ie.jsx(e, n, i); }, F = function(e, n, i) { return ze.call(n, "css") ? Ie.jsxs(Qt, Zt(e, n), i) : Ie.jsxs(e, n, i); }; const qn = ({ onCancel: t, onSave: e }) => { const [n, i] = q(""), [a, l] = q(""), [f, h] = q(!1); return /* @__PURE__ */ F(zr, { onClose: t, initialFocus: "[name=url]", children: [ /* @__PURE__ */ o(Fr, { children: /* @__PURE__ */ o(Mr, { children: "Add video" }) }), /* @__PURE__ */ o(Nr, { children: /* @__PURE__ */ F(jr, { component: "form", children: [ /* @__PURE__ */ o(tt, { label: "URL", children: /* @__PURE__ */ o( It, { name: "url", value: n, onChange: (m) => i(m.target.value) } ) }), /* @__PURE__ */ o(tt, { label: "Title", children: /* @__PURE__ */ o( It, { name: "title", value: a, onChange: (m) => l(m.target.value) } ) }) ] }) }), /* @__PURE__ */ F($r, { children: [ /* @__PURE__ */ o(Dr, { onClick: t, children: "Cancel" }), /* @__PURE__ */ o( ne, { type: "submit", onClick: async () => { try { h(!0), await e({ url: n, title: a }); } finally { h(!1); } }, fill: !0, disabled: n.trim().length === 0, isLoading: f, children: "Save" } ) ] }) ] }); }; function Hn(t) { return t !== null && typeof t == "object" && "title" in t && typeof t.title == "string"; } const Dt = Z( ({ playQueueStore: t }) => { const [e, n] = q(!1), i = $( async (a) => { const l = gn(a.url); if (l !== void 0) { const f = l.extractVideoId(a.url); if (f !== void 0) { const m = await (await fetch( `https://noembed.com/embed?url=${encodeURIComponent( a.url )}` )).json(); await t.addItems([ t.createItem({ url: a.url, type: l.type, videoId: f, title: a.title || (Hn(m) ? m.title : f) }) ]); } } n(!1); }, [t] ); return /* @__PURE__ */ F(Le, { children: [ /* @__PURE__ */ o( ne, { onClick: () => n(!0), iconType: ct, color: "primary", children: "Add video" } ), e && /* @__PURE__ */ o( qn, { onCancel: () => n(!1), onSave: i } ) ] }); } ), Gn = Y( ({ playQueueStore: t }) => { const { euiTheme: e } = Yt(); return /* @__PURE__ */ F( Vr, { style: { position: "sticky", top: 112, zIndex: 998, background: e.colors.backgroundBasePlain }, children: [ /* @__PURE__ */ o(Lr, { children: /* @__PURE__ */ o( Bt, { id: "", checked: t.allItemsSelected, onChange: (n) => { t.allItemsSelected = n.target.checked; } } ) }), /* @__PURE__ */ o(Xe, { width: 24 }), /* @__PURE__ */ o(Xe, { children: "Title" }), /* @__PURE__ */ o(Xe, {}) ] } ); } ), Jn = Z( ({ item: t, closePopover: e }) => { const n = Z( ({ onClick: i, ...a }) => { const l = $( (f) => { e(), i == null || i(f); }, [i] ); return /* @__PURE__ */ o(Yr, { ...a, onClick: l }); } ); return /* @__PURE__ */ F(Br, { children: [ /* @__PURE__ */ o( n, { icon: /* @__PURE__ */ o(H, { type: "" }), onClick: t.playFirst, children: "Play first" } ), /* @__PURE__ */ o( n, { icon: /* @__PURE__ */ o(H, { type: "" }), onClick: t.playNext, children: "Play next" } ), /* @__PURE__ */ o( n, { icon: /* @__PURE__ */ o(H, { type: ct }), onClick: t.addToPlayQueue, children: "Add to play queue" } ), /* @__PURE__ */ o(Pt, { margin: "none" }), /* @__PURE__ */ o( n, { icon: /* @__PURE__ */ o(H, { type: en }), onClick: t.moveToTop, disabled: !t.canMoveToTop, children: "Move to the top" } ), /* @__PURE__ */ o( n, { icon: /* @__PURE__ */ o(H, { type: tn }), onClick: t.moveToBottom, disabled: !t.canMoveToBottom, children: "Move to the bottom" } ), /* @__PURE__ */ o(Pt, { margin: "none" }), /* @__PURE__ */ o( n, { icon: /* @__PURE__ */ o(H, { type: "" }), onClick: t.removeToTop, disabled: !t.canRemoveToTop, children: "Remove to the top" } ), /* @__PURE__ */ o( n, { icon: /* @__PURE__ */ o(H, { type: "" }), onClick: t.removeOthers, disabled: !t.canRemoveOthers, children: "Remove others" } ) ] }); } ), Kn = Z( ({ item: t }) => { const [e, n] = q(!1), i = $(() => n(!e), [e]), a = $(() => n(!1), []); return /* @__PURE__ */ o( lt, { button: /* @__PURE__ */ o( G, { title: "More options", "aria-label": "More options", iconType: qt, size: "s", color: "text", onClick: i } ), isOpen: e, closePopover: a, panelPaddingSize: "none", anchorPosition: "leftCenter", children: /* @__PURE__ */ o( Jn, { item: t, closePopover: a } ) } ); } ), Xn = Y( ({ item: t }) => { const e = ie(); return /* @__PURE__ */ F(rt, { textOnly: !1, hasActions: !0, align: "right", children: [ /* @__PURE__ */ o( ne, { iconType: Qr, size: "s", onClick: async () => { t.isCurrent ? await e.setCurrentTime(0) : t.play(); }, children: "Play" } ), /* @__PURE__ */ o( ne, { iconType: ut, size: "s", onClick: t.remove, children: "Remove" } ), /* @__PURE__ */ o(Kn, { item: t }) ] }); } ), Zn = { Audio: "", Dailymotion: "https://www.dailymotion.com/favicon.ico", Niconico: "https://www.nicovideo.jp/favicon.ico", SoundCloud: "https://soundcloud.com/favicon.ico", Twitch: "https://www.twitch.tv/favicon.ico", Vimeo: "https://vimeo.com/favicon.ico", YouTube: "https://www.youtube.com/favicon.ico" }, Qn = Y( ({ item: t }) => { const e = ie(); return /* @__PURE__ */ F(qr, { isSelected: t.isCurrent, children: [ /* @__PURE__ */ o(Wr, { children: /* @__PURE__ */ o( Bt, { id: t.id.toString(), checked: t.isSelected, onChange: t.toggleSelected } ) }), /* @__PURE__ */ o(rt, { textOnly: !1, children: /* @__PURE__ */ o( "img", { src: Zn[t.type], width: 16, height: 16, alt: t.type } ) }), /* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o( Ur, { href: t.url, target: "_blank", external: !0, onClick: () => e.pause(), children: t.title } ) }), /* @__PURE__ */ o(Xn, { item: t }) ] }, t.id); } ), ei = Y( ({ playQueueStore: t }) => /* @__PURE__ */ o( En, { tag: "tbody", list: t.items, setList: (e) => t.setItems(e), children: t.items.map((e) => /* @__PURE__ */ o(Qn, { item: e }, e.id)) } ) ), ti = Y( ({ playQueueStore: t }) => /* @__PURE__ */ F(Hr, { children: [ /* @__PURE__ */ o(Gn, { playQueueStore: t }), /* @__PURE__ */ o(ei, { playQueueStore: t }) ] }) ); Y( ({ playQueueStore: t }) => { const [e, n] = q(!1); return /* @__PURE__ */ F(Le, { children: [ e && /* @__PURE__ */ o( Jr, { type: "push", size: "s", onClose: () => n(!1), children: /* @__PURE__ */ o("div", { style: { blockSize: "100%" }, children: /* @__PURE__ */ o( Gr, { language: "json", overflowHeight: "100%", isCopyable: !0, isVirtualized: !0, children: JSON.stringify( t.localStorageState, void 0, 2 ) } ) }) } ), /* @__PURE__ */ o( ne, { onClick: () => n((i) => !i), iconType: rn, children: "Developer tools" } ) ] }); } ); const ri = Y( ({ playQueueStore: t }) => { const { euiTheme: e } = Yt(); return /* @__PURE__ */ F(Le, { children: [ /* @__PURE__ */ F( me, { alignItems: "center", gutterSize: "m", style: { position: "sticky", top: 48, zIndex: 998, background: e.colors.backgroundBasePlain }, children: [ /* @__PURE__ */ o(J, { grow: !1, children: /* @__PURE__ */ o( ne, {