@aigamo/hydrangean-diva 0.0.1-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/LICENSE +93 -0
  2. package/dist/App.d.ts +3 -0
  3. package/dist/AppRoutes.d.ts +4 -0
  4. package/dist/common/components/Compose.d.ts +7 -0
  5. package/dist/favicon.svg +39 -0
  6. package/dist/features/media-player/components/AddVideoButton.d.ts +7 -0
  7. package/dist/features/media-player/components/BottomBar.d.ts +12 -0
  8. package/dist/features/media-player/components/Header.d.ts +2 -0
  9. package/dist/features/media-player/components/HydrangeanDiva.d.ts +11 -0
  10. package/dist/features/media-player/components/MediaPlayerLayout.d.ts +8 -0
  11. package/dist/features/media-player/components/MiniPlayer.d.ts +15 -0
  12. package/dist/features/media-player/components/PlayQueueStoreContext.d.ts +8 -0
  13. package/dist/features/media-player/components/PlayQueueTable.d.ts +9 -0
  14. package/dist/features/media-player/components/PlayerStoreContext.d.ts +8 -0
  15. package/dist/features/media-player/components/index.d.ts +6 -0
  16. package/dist/features/media-player/index.d.ts +2 -0
  17. package/dist/features/media-player/pages/PlayQueuePage.d.ts +2 -0
  18. package/dist/features/media-player/stores/IObservableStateProvider.d.ts +4 -0
  19. package/dist/features/media-player/stores/IPlayQueueItemStore.d.ts +33 -0
  20. package/dist/features/media-player/stores/IPlayQueueStore.d.ts +15 -0
  21. package/dist/features/media-player/stores/MobXObservableStateProvider.d.ts +5 -0
  22. package/dist/features/media-player/stores/ObservableStateProvider.d.ts +5 -0
  23. package/dist/features/media-player/stores/PlayQueueItemStore.d.ts +39 -0
  24. package/dist/features/media-player/stores/PlayQueueLocalStorageState.d.ts +10 -0
  25. package/dist/features/media-player/stores/PlayQueueStore.d.ts +55 -0
  26. package/dist/features/media-player/stores/PlayerStore.d.ts +15 -0
  27. package/dist/features/media-player/stores/RepeatMode.d.ts +5 -0
  28. package/dist/features/media-player/stores/getOrAddSchema.d.ts +2 -0
  29. package/dist/features/media-player/stores/index.d.ts +6 -0
  30. package/dist/icons.d.ts +1 -0
  31. package/dist/index.cjs.js +45 -0
  32. package/dist/index.cjs.js.map +1 -0
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.es.js +2543 -0
  35. package/dist/index.es.js.map +1 -0
  36. package/dist/main.d.ts +1 -0
  37. package/dist/sw.d.ts +1 -0
  38. package/package.json +118 -0
@@ -0,0 +1,2543 @@
1
+ var Ir = Object.defineProperty;
2
+ var Pr = (t, e, n) => e in t ? Ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var U = (t, e, n) => Pr(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import * as te from "react";
5
+ import Dt, { forwardRef as Rr, useContext as st, useCallback as $, memo as Z, useState as q, useLayoutEffect as wr, useMemo as zt, createContext as Lt, useEffect as Or } from "react";
6
+ import _r from "@emotion/cache";
7
+ import { useNostalgicDiva as ie, findVideoService as Ar, NostalgicDiva as kr } from "@aigamo/nostalgic-diva";
8
+ import { EuiRange as Vt, EuiButtonIcon as K, EuiFlexGroup as me, EuiFlexItem as G, EuiBottomBar as Mr, EuiFormRow as tt, EuiPopover as lt, EuiIcon as H, EuiContextMenu as Fr, EuiButton as ne, EuiModalHeaderTitle as jr, EuiModalHeader as Nr, EuiForm as $r, EuiFieldText as It, EuiModalBody as Dr, EuiModalFooter as zr, EuiButtonEmpty as Lr, EuiModal as Vr, useEuiTheme as Yt, EuiCheckbox as Bt, EuiTableHeaderCellCheckbox as Yr, EuiTableHeaderCell as Xe, EuiTableHeader as Br, EuiContextMenuItem as Wr, EuiHorizontalRule as Pt, EuiContextMenuPanel as Ur, EuiTableRowCell as rt, EuiTableRowCellCheckbox as qr, EuiLink as Hr, EuiTableRow as Gr, EuiTable as Jr, EuiCodeBlock as Kr, EuiFlyout as Xr, EuiSpacer as Wt, EuiEmptyPrompt as Zr, EuiPageTemplate as nt } from "@elastic/eui";
9
+ import { ArrowRepeat1Filled as Qr, ArrowRepeatAllFilled as en, ArrowRepeatAllOffFilled as tn, ArrowShuffleFilled as rn, ArrowShuffleOffFilled as nn, PreviousFilled as on, PauseFilled as an, PlayFilled as sn, NextFilled as ln, Speaker2Regular as Ut, MoreHorizontalFilled as qt, TopSpeedRegular as cn, SkipBack10Regular as un, SkipForward30Regular as fn, DismissRegular as ct, AddRegular as ut, ArrowUploadRegular as dn, ArrowDownloadRegular as mn, PlayRegular as hn, DeleteRegular as vn } from "@fluentui/react-icons";
10
+ import { observer as Y } from "mobx-react-lite";
11
+ import { ReactSortable as pn } from "react-sortablejs";
12
+ import { makeObservable as yn, action as y, computed as _, observable as re, reaction as gn } from "mobx";
13
+ import { pull as Rt } from "lodash-es";
14
+ import bn from "ajv";
15
+ var $e = { exports: {} }, xe = {};
16
+ /**
17
+ * @license React
18
+ * react-jsx-runtime.production.min.js
19
+ *
20
+ * Copyright (c) Facebook, Inc. and its affiliates.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE file in the root directory of this source tree.
24
+ */
25
+ var wt;
26
+ function En() {
27
+ if (wt) return xe;
28
+ wt = 1;
29
+ var t = Dt, 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 };
30
+ function f(h, m, p) {
31
+ var E, P = {}, D = null, j = null;
32
+ p !== void 0 && (D = "" + p), m.key !== void 0 && (D = "" + m.key), m.ref !== void 0 && (j = m.ref);
33
+ for (E in m) i.call(m, E) && !l.hasOwnProperty(E) && (P[E] = m[E]);
34
+ if (h && h.defaultProps) for (E in m = h.defaultProps, m) P[E] === void 0 && (P[E] = m[E]);
35
+ return { $$typeof: e, type: h, key: D, ref: j, props: P, _owner: a.current };
36
+ }
37
+ return xe.Fragment = n, xe.jsx = f, xe.jsxs = f, xe;
38
+ }
39
+ var Se = {};
40
+ /**
41
+ * @license React
42
+ * react-jsx-runtime.development.js
43
+ *
44
+ * Copyright (c) Facebook, Inc. and its affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */
49
+ var Ot;
50
+ function Tn() {
51
+ return Ot || (Ot = 1, process.env.NODE_ENV !== "production" && function() {
52
+ var t = Dt, 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";
53
+ function Q(r) {
54
+ if (r === null || typeof r != "object")
55
+ return null;
56
+ var s = A && r[A] || r[B];
57
+ return typeof s == "function" ? s : null;
58
+ }
59
+ var z = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
60
+ function I(r) {
61
+ {
62
+ for (var s = arguments.length, u = new Array(s > 1 ? s - 1 : 0), v = 1; v < s; v++)
63
+ u[v - 1] = arguments[v];
64
+ k("error", r, u);
65
+ }
66
+ }
67
+ function k(r, s, u) {
68
+ {
69
+ var v = z.ReactDebugCurrentFrame, T = v.getStackAddendum();
70
+ T !== "" && (s += "%s", u = u.concat([T]));
71
+ var C = u.map(function(b) {
72
+ return String(b);
73
+ });
74
+ C.unshift("Warning: " + s), Function.prototype.apply.call(console[r], console, C);
75
+ }
76
+ }
77
+ var w = !1, c = !1, L = !1, he = !1, Re = !1, we;
78
+ we = Symbol.for("react.module.reference");
79
+ function Ve(r) {
80
+ 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
81
+ // types supported by any Flight configuration anywhere since
82
+ // we don't know which Flight build this will end up being used
83
+ // with.
84
+ r.$$typeof === we || r.getModuleId !== void 0));
85
+ }
86
+ function Ye(r, s, u) {
87
+ var v = r.displayName;
88
+ if (v)
89
+ return v;
90
+ var T = s.displayName || s.name || "";
91
+ return T !== "" ? u + "(" + T + ")" : u;
92
+ }
93
+ function Oe(r) {
94
+ return r.displayName || "Context";
95
+ }
96
+ function J(r) {
97
+ if (r == null)
98
+ return null;
99
+ 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")
100
+ return r.displayName || r.name || null;
101
+ if (typeof r == "string")
102
+ return r;
103
+ switch (r) {
104
+ case i:
105
+ return "Fragment";
106
+ case n:
107
+ return "Portal";
108
+ case l:
109
+ return "Profiler";
110
+ case a:
111
+ return "StrictMode";
112
+ case p:
113
+ return "Suspense";
114
+ case E:
115
+ return "SuspenseList";
116
+ }
117
+ if (typeof r == "object")
118
+ switch (r.$$typeof) {
119
+ case h:
120
+ var s = r;
121
+ return Oe(s) + ".Consumer";
122
+ case f:
123
+ var u = r;
124
+ return Oe(u._context) + ".Provider";
125
+ case m:
126
+ return Ye(r, r.render, "ForwardRef");
127
+ case P:
128
+ var v = r.displayName || null;
129
+ return v !== null ? v : J(r.type) || "Memo";
130
+ case D: {
131
+ var T = r, C = T._payload, b = T._init;
132
+ try {
133
+ return J(b(C));
134
+ } catch {
135
+ return null;
136
+ }
137
+ }
138
+ }
139
+ return null;
140
+ }
141
+ var ee = Object.assign, oe = 0, _e, Ae, ve, ke, pe, Me, Fe;
142
+ function je() {
143
+ }
144
+ je.__reactDisabledLog = !0;
145
+ function Be() {
146
+ {
147
+ if (oe === 0) {
148
+ _e = console.log, Ae = console.info, ve = console.warn, ke = console.error, pe = console.group, Me = console.groupCollapsed, Fe = console.groupEnd;
149
+ var r = {
150
+ configurable: !0,
151
+ enumerable: !0,
152
+ value: je,
153
+ writable: !0
154
+ };
155
+ Object.defineProperties(console, {
156
+ info: r,
157
+ log: r,
158
+ warn: r,
159
+ error: r,
160
+ group: r,
161
+ groupCollapsed: r,
162
+ groupEnd: r
163
+ });
164
+ }
165
+ oe++;
166
+ }
167
+ }
168
+ function We() {
169
+ {
170
+ if (oe--, oe === 0) {
171
+ var r = {
172
+ configurable: !0,
173
+ enumerable: !0,
174
+ writable: !0
175
+ };
176
+ Object.defineProperties(console, {
177
+ log: ee({}, r, {
178
+ value: _e
179
+ }),
180
+ info: ee({}, r, {
181
+ value: Ae
182
+ }),
183
+ warn: ee({}, r, {
184
+ value: ve
185
+ }),
186
+ error: ee({}, r, {
187
+ value: ke
188
+ }),
189
+ group: ee({}, r, {
190
+ value: pe
191
+ }),
192
+ groupCollapsed: ee({}, r, {
193
+ value: Me
194
+ }),
195
+ groupEnd: ee({}, r, {
196
+ value: Fe
197
+ })
198
+ });
199
+ }
200
+ oe < 0 && I("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
201
+ }
202
+ }
203
+ var ye = z.ReactCurrentDispatcher, ge;
204
+ function le(r, s, u) {
205
+ {
206
+ if (ge === void 0)
207
+ try {
208
+ throw Error();
209
+ } catch (T) {
210
+ var v = T.stack.trim().match(/\n( *(at )?)/);
211
+ ge = v && v[1] || "";
212
+ }
213
+ return `
214
+ ` + ge + r;
215
+ }
216
+ }
217
+ var be = !1, ce;
218
+ {
219
+ var Ue = typeof WeakMap == "function" ? WeakMap : Map;
220
+ ce = new Ue();
221
+ }
222
+ function d(r, s) {
223
+ if (!r || be)
224
+ return "";
225
+ {
226
+ var u = ce.get(r);
227
+ if (u !== void 0)
228
+ return u;
229
+ }
230
+ var v;
231
+ be = !0;
232
+ var T = Error.prepareStackTrace;
233
+ Error.prepareStackTrace = void 0;
234
+ var C;
235
+ C = ye.current, ye.current = null, Be();
236
+ try {
237
+ if (s) {
238
+ var b = function() {
239
+ throw Error();
240
+ };
241
+ if (Object.defineProperty(b.prototype, "props", {
242
+ set: function() {
243
+ throw Error();
244
+ }
245
+ }), typeof Reflect == "object" && Reflect.construct) {
246
+ try {
247
+ Reflect.construct(b, []);
248
+ } catch (V) {
249
+ v = V;
250
+ }
251
+ Reflect.construct(r, [], b);
252
+ } else {
253
+ try {
254
+ b.call();
255
+ } catch (V) {
256
+ v = V;
257
+ }
258
+ r.call(b.prototype);
259
+ }
260
+ } else {
261
+ try {
262
+ throw Error();
263
+ } catch (V) {
264
+ v = V;
265
+ }
266
+ r();
267
+ }
268
+ } catch (V) {
269
+ if (V && v && typeof V.stack == "string") {
270
+ for (var g = V.stack.split(`
271
+ `), N = v.stack.split(`
272
+ `), O = g.length - 1, M = N.length - 1; O >= 1 && M >= 0 && g[O] !== N[M]; )
273
+ M--;
274
+ for (; O >= 1 && M >= 0; O--, M--)
275
+ if (g[O] !== N[M]) {
276
+ if (O !== 1 || M !== 1)
277
+ do
278
+ if (O--, M--, M < 0 || g[O] !== N[M]) {
279
+ var W = `
280
+ ` + g[O].replace(" at new ", " at ");
281
+ return r.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", r.displayName)), typeof r == "function" && ce.set(r, W), W;
282
+ }
283
+ while (O >= 1 && M >= 0);
284
+ break;
285
+ }
286
+ }
287
+ } finally {
288
+ be = !1, ye.current = C, We(), Error.prepareStackTrace = T;
289
+ }
290
+ var de = r ? r.displayName || r.name : "", se = de ? le(de) : "";
291
+ return typeof r == "function" && ce.set(r, se), se;
292
+ }
293
+ function Ee(r, s, u) {
294
+ return d(r, !1);
295
+ }
296
+ function ue(r) {
297
+ var s = r.prototype;
298
+ return !!(s && s.isReactComponent);
299
+ }
300
+ function ae(r, s, u) {
301
+ if (r == null)
302
+ return "";
303
+ if (typeof r == "function")
304
+ return d(r, ue(r));
305
+ if (typeof r == "string")
306
+ return le(r);
307
+ switch (r) {
308
+ case p:
309
+ return le("Suspense");
310
+ case E:
311
+ return le("SuspenseList");
312
+ }
313
+ if (typeof r == "object")
314
+ switch (r.$$typeof) {
315
+ case m:
316
+ return Ee(r.render);
317
+ case P:
318
+ return ae(r.type, s, u);
319
+ case D: {
320
+ var v = r, T = v._payload, C = v._init;
321
+ try {
322
+ return ae(C(T), s, u);
323
+ } catch {
324
+ }
325
+ }
326
+ }
327
+ return "";
328
+ }
329
+ var Te = Object.prototype.hasOwnProperty, ft = {}, dt = z.ReactDebugCurrentFrame;
330
+ function Ne(r) {
331
+ if (r) {
332
+ var s = r._owner, u = ae(r.type, r._source, s ? s.type : null);
333
+ dt.setExtraStackFrame(u);
334
+ } else
335
+ dt.setExtraStackFrame(null);
336
+ }
337
+ function nr(r, s, u, v, T) {
338
+ {
339
+ var C = Function.call.bind(Te);
340
+ for (var b in r)
341
+ if (C(r, b)) {
342
+ var g = void 0;
343
+ try {
344
+ if (typeof r[b] != "function") {
345
+ 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`.");
346
+ throw N.name = "Invariant Violation", N;
347
+ }
348
+ g = r[b](s, b, v, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
349
+ } catch (O) {
350
+ g = O;
351
+ }
352
+ 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));
353
+ }
354
+ }
355
+ }
356
+ var ir = Array.isArray;
357
+ function qe(r) {
358
+ return ir(r);
359
+ }
360
+ function or(r) {
361
+ {
362
+ var s = typeof Symbol == "function" && Symbol.toStringTag, u = s && r[Symbol.toStringTag] || r.constructor.name || "Object";
363
+ return u;
364
+ }
365
+ }
366
+ function ar(r) {
367
+ try {
368
+ return mt(r), !1;
369
+ } catch {
370
+ return !0;
371
+ }
372
+ }
373
+ function mt(r) {
374
+ return "" + r;
375
+ }
376
+ function ht(r) {
377
+ if (ar(r))
378
+ 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);
379
+ }
380
+ var vt = z.ReactCurrentOwner, sr = {
381
+ key: !0,
382
+ ref: !0,
383
+ __self: !0,
384
+ __source: !0
385
+ }, pt, yt;
386
+ function lr(r) {
387
+ if (Te.call(r, "ref")) {
388
+ var s = Object.getOwnPropertyDescriptor(r, "ref").get;
389
+ if (s && s.isReactWarning)
390
+ return !1;
391
+ }
392
+ return r.ref !== void 0;
393
+ }
394
+ function cr(r) {
395
+ if (Te.call(r, "key")) {
396
+ var s = Object.getOwnPropertyDescriptor(r, "key").get;
397
+ if (s && s.isReactWarning)
398
+ return !1;
399
+ }
400
+ return r.key !== void 0;
401
+ }
402
+ function ur(r, s) {
403
+ typeof r.ref == "string" && vt.current;
404
+ }
405
+ function fr(r, s) {
406
+ {
407
+ var u = function() {
408
+ 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));
409
+ };
410
+ u.isReactWarning = !0, Object.defineProperty(r, "key", {
411
+ get: u,
412
+ configurable: !0
413
+ });
414
+ }
415
+ }
416
+ function dr(r, s) {
417
+ {
418
+ var u = function() {
419
+ 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));
420
+ };
421
+ u.isReactWarning = !0, Object.defineProperty(r, "ref", {
422
+ get: u,
423
+ configurable: !0
424
+ });
425
+ }
426
+ }
427
+ var mr = function(r, s, u, v, T, C, b) {
428
+ var g = {
429
+ // This tag allows us to uniquely identify this as a React Element
430
+ $$typeof: e,
431
+ // Built-in properties that belong on the element
432
+ type: r,
433
+ key: s,
434
+ ref: u,
435
+ props: b,
436
+ // Record the component responsible for creating this element.
437
+ _owner: C
438
+ };
439
+ return g._store = {}, Object.defineProperty(g._store, "validated", {
440
+ configurable: !1,
441
+ enumerable: !1,
442
+ writable: !0,
443
+ value: !1
444
+ }), Object.defineProperty(g, "_self", {
445
+ configurable: !1,
446
+ enumerable: !1,
447
+ writable: !1,
448
+ value: v
449
+ }), Object.defineProperty(g, "_source", {
450
+ configurable: !1,
451
+ enumerable: !1,
452
+ writable: !1,
453
+ value: T
454
+ }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
455
+ };
456
+ function hr(r, s, u, v, T) {
457
+ {
458
+ var C, b = {}, g = null, N = null;
459
+ u !== void 0 && (ht(u), g = "" + u), cr(s) && (ht(s.key), g = "" + s.key), lr(s) && (N = s.ref, ur(s, T));
460
+ for (C in s)
461
+ Te.call(s, C) && !sr.hasOwnProperty(C) && (b[C] = s[C]);
462
+ if (r && r.defaultProps) {
463
+ var O = r.defaultProps;
464
+ for (C in O)
465
+ b[C] === void 0 && (b[C] = O[C]);
466
+ }
467
+ if (g || N) {
468
+ var M = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
469
+ g && fr(b, M), N && dr(b, M);
470
+ }
471
+ return mr(r, g, N, T, v, vt.current, b);
472
+ }
473
+ }
474
+ var He = z.ReactCurrentOwner, gt = z.ReactDebugCurrentFrame;
475
+ function fe(r) {
476
+ if (r) {
477
+ var s = r._owner, u = ae(r.type, r._source, s ? s.type : null);
478
+ gt.setExtraStackFrame(u);
479
+ } else
480
+ gt.setExtraStackFrame(null);
481
+ }
482
+ var Ge;
483
+ Ge = !1;
484
+ function Je(r) {
485
+ return typeof r == "object" && r !== null && r.$$typeof === e;
486
+ }
487
+ function bt() {
488
+ {
489
+ if (He.current) {
490
+ var r = J(He.current.type);
491
+ if (r)
492
+ return `
493
+
494
+ Check the render method of \`` + r + "`.";
495
+ }
496
+ return "";
497
+ }
498
+ }
499
+ function vr(r) {
500
+ return "";
501
+ }
502
+ var Et = {};
503
+ function pr(r) {
504
+ {
505
+ var s = bt();
506
+ if (!s) {
507
+ var u = typeof r == "string" ? r : r.displayName || r.name;
508
+ u && (s = `
509
+
510
+ Check the top-level render call using <` + u + ">.");
511
+ }
512
+ return s;
513
+ }
514
+ }
515
+ function Tt(r, s) {
516
+ {
517
+ if (!r._store || r._store.validated || r.key != null)
518
+ return;
519
+ r._store.validated = !0;
520
+ var u = pr(s);
521
+ if (Et[u])
522
+ return;
523
+ Et[u] = !0;
524
+ var v = "";
525
+ r && r._owner && r._owner !== He.current && (v = " It was passed a child from " + J(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);
526
+ }
527
+ }
528
+ function xt(r, s) {
529
+ {
530
+ if (typeof r != "object")
531
+ return;
532
+ if (qe(r))
533
+ for (var u = 0; u < r.length; u++) {
534
+ var v = r[u];
535
+ Je(v) && Tt(v, s);
536
+ }
537
+ else if (Je(r))
538
+ r._store && (r._store.validated = !0);
539
+ else if (r) {
540
+ var T = Q(r);
541
+ if (typeof T == "function" && T !== r.entries)
542
+ for (var C = T.call(r), b; !(b = C.next()).done; )
543
+ Je(b.value) && Tt(b.value, s);
544
+ }
545
+ }
546
+ }
547
+ function yr(r) {
548
+ {
549
+ var s = r.type;
550
+ if (s == null || typeof s == "string")
551
+ return;
552
+ var u;
553
+ if (typeof s == "function")
554
+ u = s.propTypes;
555
+ else if (typeof s == "object" && (s.$$typeof === m || // Note: Memo only checks outer props here.
556
+ // Inner props are checked in the reconciler.
557
+ s.$$typeof === P))
558
+ u = s.propTypes;
559
+ else
560
+ return;
561
+ if (u) {
562
+ var v = J(s);
563
+ nr(u, r.props, "prop", v, r);
564
+ } else if (s.PropTypes !== void 0 && !Ge) {
565
+ Ge = !0;
566
+ var T = J(s);
567
+ I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
568
+ }
569
+ typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
570
+ }
571
+ }
572
+ function gr(r) {
573
+ {
574
+ for (var s = Object.keys(r.props), u = 0; u < s.length; u++) {
575
+ var v = s[u];
576
+ if (v !== "children" && v !== "key") {
577
+ fe(r), I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), fe(null);
578
+ break;
579
+ }
580
+ }
581
+ r.ref !== null && (fe(r), I("Invalid attribute `ref` supplied to `React.Fragment`."), fe(null));
582
+ }
583
+ }
584
+ var St = {};
585
+ function Ct(r, s, u, v, T, C) {
586
+ {
587
+ var b = Ve(r);
588
+ if (!b) {
589
+ var g = "";
590
+ (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.");
591
+ var N = vr();
592
+ N ? g += N : g += bt();
593
+ var O;
594
+ r === null ? O = "null" : qe(r) ? O = "array" : r !== void 0 && r.$$typeof === e ? (O = "<" + (J(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);
595
+ }
596
+ var M = hr(r, s, u, T, C);
597
+ if (M == null)
598
+ return M;
599
+ if (b) {
600
+ var W = s.children;
601
+ if (W !== void 0)
602
+ if (v)
603
+ if (qe(W)) {
604
+ for (var de = 0; de < W.length; de++)
605
+ xt(W[de], r);
606
+ Object.freeze && Object.freeze(W);
607
+ } else
608
+ 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.");
609
+ else
610
+ xt(W, r);
611
+ }
612
+ if (Te.call(s, "key")) {
613
+ var se = J(r), V = Object.keys(s).filter(function(Cr) {
614
+ return Cr !== "key";
615
+ }), Ke = V.length > 0 ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}";
616
+ if (!St[se + Ke]) {
617
+ var Sr = V.length > 0 ? "{" + V.join(": ..., ") + ": ...}" : "{}";
618
+ I(`A props object containing a "key" prop is being spread into JSX:
619
+ let props = %s;
620
+ <%s {...props} />
621
+ React keys must be passed directly to JSX without using spread:
622
+ let props = %s;
623
+ <%s key={someKey} {...props} />`, Ke, se, Sr, se), St[se + Ke] = !0;
624
+ }
625
+ }
626
+ return r === i ? gr(M) : yr(M), M;
627
+ }
628
+ }
629
+ function br(r, s, u) {
630
+ return Ct(r, s, u, !0);
631
+ }
632
+ function Er(r, s, u) {
633
+ return Ct(r, s, u, !1);
634
+ }
635
+ var Tr = Er, xr = br;
636
+ Se.Fragment = i, Se.jsx = Tr, Se.jsxs = xr;
637
+ }()), Se;
638
+ }
639
+ var _t;
640
+ function xn() {
641
+ return _t || (_t = 1, process.env.NODE_ENV === "production" ? $e.exports = En() : $e.exports = Tn()), $e.exports;
642
+ }
643
+ var Ie = xn(), De = { exports: {} }, x = {};
644
+ /** @license React v16.13.1
645
+ * react-is.production.min.js
646
+ *
647
+ * Copyright (c) Facebook, Inc. and its affiliates.
648
+ *
649
+ * This source code is licensed under the MIT license found in the
650
+ * LICENSE file in the root directory of this source tree.
651
+ */
652
+ var At;
653
+ function Sn() {
654
+ if (At) return x;
655
+ At = 1;
656
+ 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;
657
+ function k(c) {
658
+ if (typeof c == "object" && c !== null) {
659
+ var L = c.$$typeof;
660
+ switch (L) {
661
+ case e:
662
+ switch (c = c.type, c) {
663
+ case m:
664
+ case p:
665
+ case i:
666
+ case l:
667
+ case a:
668
+ case P:
669
+ return c;
670
+ default:
671
+ switch (c = c && c.$$typeof, c) {
672
+ case h:
673
+ case E:
674
+ case A:
675
+ case j:
676
+ case f:
677
+ return c;
678
+ default:
679
+ return L;
680
+ }
681
+ }
682
+ case n:
683
+ return L;
684
+ }
685
+ }
686
+ }
687
+ function w(c) {
688
+ return k(c) === p;
689
+ }
690
+ 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) {
691
+ return w(c) || k(c) === m;
692
+ }, x.isConcurrentMode = w, x.isContextConsumer = function(c) {
693
+ return k(c) === h;
694
+ }, x.isContextProvider = function(c) {
695
+ return k(c) === f;
696
+ }, x.isElement = function(c) {
697
+ return typeof c == "object" && c !== null && c.$$typeof === e;
698
+ }, x.isForwardRef = function(c) {
699
+ return k(c) === E;
700
+ }, x.isFragment = function(c) {
701
+ return k(c) === i;
702
+ }, x.isLazy = function(c) {
703
+ return k(c) === A;
704
+ }, x.isMemo = function(c) {
705
+ return k(c) === j;
706
+ }, x.isPortal = function(c) {
707
+ return k(c) === n;
708
+ }, x.isProfiler = function(c) {
709
+ return k(c) === l;
710
+ }, x.isStrictMode = function(c) {
711
+ return k(c) === a;
712
+ }, x.isSuspense = function(c) {
713
+ return k(c) === P;
714
+ }, x.isValidElementType = function(c) {
715
+ 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);
716
+ }, x.typeOf = k, x;
717
+ }
718
+ var S = {};
719
+ /** @license React v16.13.1
720
+ * react-is.development.js
721
+ *
722
+ * Copyright (c) Facebook, Inc. and its affiliates.
723
+ *
724
+ * This source code is licensed under the MIT license found in the
725
+ * LICENSE file in the root directory of this source tree.
726
+ */
727
+ var kt;
728
+ function Cn() {
729
+ return kt || (kt = 1, process.env.NODE_ENV !== "production" && function() {
730
+ 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;
731
+ function k(d) {
732
+ return typeof d == "string" || typeof d == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
733
+ 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);
734
+ }
735
+ function w(d) {
736
+ if (typeof d == "object" && d !== null) {
737
+ var Ee = d.$$typeof;
738
+ switch (Ee) {
739
+ case e:
740
+ var ue = d.type;
741
+ switch (ue) {
742
+ case m:
743
+ case p:
744
+ case i:
745
+ case l:
746
+ case a:
747
+ case P:
748
+ return ue;
749
+ default:
750
+ var ae = ue && ue.$$typeof;
751
+ switch (ae) {
752
+ case h:
753
+ case E:
754
+ case A:
755
+ case j:
756
+ case f:
757
+ return ae;
758
+ default:
759
+ return Ee;
760
+ }
761
+ }
762
+ case n:
763
+ return Ee;
764
+ }
765
+ }
766
+ }
767
+ var c = m, L = p, he = h, Re = f, we = e, Ve = E, Ye = i, Oe = A, J = j, ee = n, oe = l, _e = a, Ae = P, ve = !1;
768
+ function ke(d) {
769
+ 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;
770
+ }
771
+ function pe(d) {
772
+ return w(d) === p;
773
+ }
774
+ function Me(d) {
775
+ return w(d) === h;
776
+ }
777
+ function Fe(d) {
778
+ return w(d) === f;
779
+ }
780
+ function je(d) {
781
+ return typeof d == "object" && d !== null && d.$$typeof === e;
782
+ }
783
+ function Be(d) {
784
+ return w(d) === E;
785
+ }
786
+ function We(d) {
787
+ return w(d) === i;
788
+ }
789
+ function ye(d) {
790
+ return w(d) === A;
791
+ }
792
+ function ge(d) {
793
+ return w(d) === j;
794
+ }
795
+ function le(d) {
796
+ return w(d) === n;
797
+ }
798
+ function be(d) {
799
+ return w(d) === l;
800
+ }
801
+ function ce(d) {
802
+ return w(d) === a;
803
+ }
804
+ function Ue(d) {
805
+ return w(d) === P;
806
+ }
807
+ 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 = J, 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;
808
+ }()), S;
809
+ }
810
+ var Mt;
811
+ function In() {
812
+ return Mt || (Mt = 1, process.env.NODE_ENV === "production" ? De.exports = Sn() : De.exports = Cn()), De.exports;
813
+ }
814
+ var Ze, Ft;
815
+ function Pn() {
816
+ if (Ft) return Ze;
817
+ Ft = 1;
818
+ var t = In(), e = {
819
+ childContextTypes: !0,
820
+ contextType: !0,
821
+ contextTypes: !0,
822
+ defaultProps: !0,
823
+ displayName: !0,
824
+ getDefaultProps: !0,
825
+ getDerivedStateFromError: !0,
826
+ getDerivedStateFromProps: !0,
827
+ mixins: !0,
828
+ propTypes: !0,
829
+ type: !0
830
+ }, n = {
831
+ name: !0,
832
+ length: !0,
833
+ prototype: !0,
834
+ caller: !0,
835
+ callee: !0,
836
+ arguments: !0,
837
+ arity: !0
838
+ }, i = {
839
+ $$typeof: !0,
840
+ render: !0,
841
+ defaultProps: !0,
842
+ displayName: !0,
843
+ propTypes: !0
844
+ }, a = {
845
+ $$typeof: !0,
846
+ compare: !0,
847
+ defaultProps: !0,
848
+ displayName: !0,
849
+ propTypes: !0,
850
+ type: !0
851
+ }, l = {};
852
+ l[t.ForwardRef] = i, l[t.Memo] = a;
853
+ function f(A) {
854
+ return t.isMemo(A) ? a : l[A.$$typeof] || e;
855
+ }
856
+ var h = Object.defineProperty, m = Object.getOwnPropertyNames, p = Object.getOwnPropertySymbols, E = Object.getOwnPropertyDescriptor, P = Object.getPrototypeOf, D = Object.prototype;
857
+ function j(A, B, Q) {
858
+ if (typeof B != "string") {
859
+ if (D) {
860
+ var z = P(B);
861
+ z && z !== D && j(A, z, Q);
862
+ }
863
+ var I = m(B);
864
+ p && (I = I.concat(p(B)));
865
+ for (var k = f(A), w = f(B), c = 0; c < I.length; ++c) {
866
+ var L = I[c];
867
+ if (!n[L] && !(Q && Q[L]) && !(w && w[L]) && !(k && k[L])) {
868
+ var he = E(B, L);
869
+ try {
870
+ h(A, L, he);
871
+ } catch {
872
+ }
873
+ }
874
+ }
875
+ }
876
+ return A;
877
+ }
878
+ return Ze = j, Ze;
879
+ }
880
+ Pn();
881
+ var Rn = !0;
882
+ function wn(t, e, n) {
883
+ var i = "";
884
+ return n.split(" ").forEach(function(a) {
885
+ t[a] !== void 0 ? e.push(t[a] + ";") : a && (i += a + " ");
886
+ }), i;
887
+ }
888
+ var Ht = function(e, n, i) {
889
+ var a = e.key + "-" + n.name;
890
+ // we only need to add the styles to the registered cache if the
891
+ // class name could be used further down
892
+ // the tree but if it's a string tag, we know it won't
893
+ // so we don't have to add it to registered cache.
894
+ // this improves memory usage since we can avoid storing the whole style string
895
+ (i === !1 || // we need to always store it if we're in compat mode and
896
+ // in node since emotion-server relies on whether a style is in
897
+ // the registered cache to know whether a style is global or not
898
+ // also, note that this check will be dead code eliminated in the browser
899
+ Rn === !1) && e.registered[a] === void 0 && (e.registered[a] = n.styles);
900
+ }, On = function(e, n, i) {
901
+ Ht(e, n, i);
902
+ var a = e.key + "-" + n.name;
903
+ if (e.inserted[n.name] === void 0) {
904
+ var l = n;
905
+ do
906
+ e.insert(n === l ? "." + a : "", l, e.sheet, !0), l = l.next;
907
+ while (l !== void 0);
908
+ }
909
+ };
910
+ function _n(t) {
911
+ for (var e = 0, n, i = 0, a = t.length; a >= 4; ++i, a -= 4)
912
+ 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): */
913
+ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */
914
+ n >>> 24, e = /* Math.imul(k, m): */
915
+ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
916
+ (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16);
917
+ switch (a) {
918
+ case 3:
919
+ e ^= (t.charCodeAt(i + 2) & 255) << 16;
920
+ case 2:
921
+ e ^= (t.charCodeAt(i + 1) & 255) << 8;
922
+ case 1:
923
+ e ^= t.charCodeAt(i) & 255, e = /* Math.imul(h, m): */
924
+ (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16);
925
+ }
926
+ return e ^= e >>> 13, e = /* Math.imul(h, m): */
927
+ (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16), ((e ^ e >>> 15) >>> 0).toString(36);
928
+ }
929
+ var An = {
930
+ animationIterationCount: 1,
931
+ aspectRatio: 1,
932
+ borderImageOutset: 1,
933
+ borderImageSlice: 1,
934
+ borderImageWidth: 1,
935
+ boxFlex: 1,
936
+ boxFlexGroup: 1,
937
+ boxOrdinalGroup: 1,
938
+ columnCount: 1,
939
+ columns: 1,
940
+ flex: 1,
941
+ flexGrow: 1,
942
+ flexPositive: 1,
943
+ flexShrink: 1,
944
+ flexNegative: 1,
945
+ flexOrder: 1,
946
+ gridRow: 1,
947
+ gridRowEnd: 1,
948
+ gridRowSpan: 1,
949
+ gridRowStart: 1,
950
+ gridColumn: 1,
951
+ gridColumnEnd: 1,
952
+ gridColumnSpan: 1,
953
+ gridColumnStart: 1,
954
+ msGridRow: 1,
955
+ msGridRowSpan: 1,
956
+ msGridColumn: 1,
957
+ msGridColumnSpan: 1,
958
+ fontWeight: 1,
959
+ lineHeight: 1,
960
+ opacity: 1,
961
+ order: 1,
962
+ orphans: 1,
963
+ scale: 1,
964
+ tabSize: 1,
965
+ widows: 1,
966
+ zIndex: 1,
967
+ zoom: 1,
968
+ WebkitLineClamp: 1,
969
+ // SVG-related properties
970
+ fillOpacity: 1,
971
+ floodOpacity: 1,
972
+ stopOpacity: 1,
973
+ strokeDasharray: 1,
974
+ strokeDashoffset: 1,
975
+ strokeMiterlimit: 1,
976
+ strokeOpacity: 1,
977
+ strokeWidth: 1
978
+ };
979
+ function kn(t) {
980
+ var e = /* @__PURE__ */ Object.create(null);
981
+ return function(n) {
982
+ return e[n] === void 0 && (e[n] = t(n)), e[n];
983
+ };
984
+ }
985
+ var Mn = /[A-Z]|^ms/g, Fn = /_EMO_([^_]+?)_([^]*?)_EMO_/g, Gt = function(e) {
986
+ return e.charCodeAt(1) === 45;
987
+ }, jt = function(e) {
988
+ return e != null && typeof e != "boolean";
989
+ }, Qe = /* @__PURE__ */ kn(function(t) {
990
+ return Gt(t) ? t : t.replace(Mn, "-$&").toLowerCase();
991
+ }), Nt = function(e, n) {
992
+ switch (e) {
993
+ case "animation":
994
+ case "animationName":
995
+ if (typeof n == "string")
996
+ return n.replace(Fn, function(i, a, l) {
997
+ return X = {
998
+ name: a,
999
+ styles: l,
1000
+ next: X
1001
+ }, a;
1002
+ });
1003
+ }
1004
+ return An[e] !== 1 && !Gt(e) && typeof n == "number" && n !== 0 ? n + "px" : n;
1005
+ };
1006
+ function Pe(t, e, n) {
1007
+ if (n == null)
1008
+ return "";
1009
+ var i = n;
1010
+ if (i.__emotion_styles !== void 0)
1011
+ return i;
1012
+ switch (typeof n) {
1013
+ case "boolean":
1014
+ return "";
1015
+ case "object": {
1016
+ var a = n;
1017
+ if (a.anim === 1)
1018
+ return X = {
1019
+ name: a.name,
1020
+ styles: a.styles,
1021
+ next: X
1022
+ }, a.name;
1023
+ var l = n;
1024
+ if (l.styles !== void 0) {
1025
+ var f = l.next;
1026
+ if (f !== void 0)
1027
+ for (; f !== void 0; )
1028
+ X = {
1029
+ name: f.name,
1030
+ styles: f.styles,
1031
+ next: X
1032
+ }, f = f.next;
1033
+ var h = l.styles + ";";
1034
+ return h;
1035
+ }
1036
+ return jn(t, e, n);
1037
+ }
1038
+ case "function": {
1039
+ if (t !== void 0) {
1040
+ var m = X, p = n(t);
1041
+ return X = m, Pe(t, e, p);
1042
+ }
1043
+ break;
1044
+ }
1045
+ }
1046
+ var E = n;
1047
+ return E;
1048
+ }
1049
+ function jn(t, e, n) {
1050
+ var i = "";
1051
+ if (Array.isArray(n))
1052
+ for (var a = 0; a < n.length; a++)
1053
+ i += Pe(t, e, n[a]) + ";";
1054
+ else
1055
+ for (var l in n) {
1056
+ var f = n[l];
1057
+ if (typeof f != "object") {
1058
+ var h = f;
1059
+ jt(h) && (i += Qe(l) + ":" + Nt(l, h) + ";");
1060
+ } else if (Array.isArray(f) && typeof f[0] == "string" && e == null)
1061
+ for (var m = 0; m < f.length; m++)
1062
+ jt(f[m]) && (i += Qe(l) + ":" + Nt(l, f[m]) + ";");
1063
+ else {
1064
+ var p = Pe(t, e, f);
1065
+ switch (l) {
1066
+ case "animation":
1067
+ case "animationName": {
1068
+ i += Qe(l) + ":" + p + ";";
1069
+ break;
1070
+ }
1071
+ default:
1072
+ i += l + "{" + p + "}";
1073
+ }
1074
+ }
1075
+ }
1076
+ return i;
1077
+ }
1078
+ var $t = /label:\s*([^\s;{]+)\s*(;|$)/g, X;
1079
+ function Nn(t, e, n) {
1080
+ if (t.length === 1 && typeof t[0] == "object" && t[0] !== null && t[0].styles !== void 0)
1081
+ return t[0];
1082
+ var i = !0, a = "";
1083
+ X = void 0;
1084
+ var l = t[0];
1085
+ if (l == null || l.raw === void 0)
1086
+ i = !1, a += Pe(n, e, l);
1087
+ else {
1088
+ var f = l;
1089
+ a += f[0];
1090
+ }
1091
+ for (var h = 1; h < t.length; h++)
1092
+ if (a += Pe(n, e, t[h]), i) {
1093
+ var m = l;
1094
+ a += m[h];
1095
+ }
1096
+ $t.lastIndex = 0;
1097
+ for (var p = "", E; (E = $t.exec(a)) !== null; )
1098
+ p += "-" + E[1];
1099
+ var P = _n(a) + p;
1100
+ return {
1101
+ name: P,
1102
+ styles: a,
1103
+ next: X
1104
+ };
1105
+ }
1106
+ var $n = function(e) {
1107
+ return e();
1108
+ }, Dn = te.useInsertionEffect ? te.useInsertionEffect : !1, zn = Dn || $n, Jt = /* @__PURE__ */ te.createContext(
1109
+ // we're doing this to avoid preconstruct's dead code elimination in this one case
1110
+ // because this module is primarily intended for the browser and node
1111
+ // but it's also required in react native and similar environments sometimes
1112
+ // and we could have a special build just for that
1113
+ // but this is much easier and the native packages
1114
+ // might use a different theme context in the future anyway
1115
+ typeof HTMLElement < "u" ? /* @__PURE__ */ _r({
1116
+ key: "css"
1117
+ }) : null
1118
+ );
1119
+ Jt.Provider;
1120
+ var Ln = function(e) {
1121
+ return /* @__PURE__ */ Rr(function(n, i) {
1122
+ var a = st(Jt);
1123
+ return e(n, a, i);
1124
+ });
1125
+ }, Vn = /* @__PURE__ */ te.createContext({}), ze = {}.hasOwnProperty, it = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", Kt = function(e, n) {
1126
+ var i = {};
1127
+ for (var a in n)
1128
+ ze.call(n, a) && (i[a] = n[a]);
1129
+ return i[it] = e, i;
1130
+ }, Yn = function(e) {
1131
+ var n = e.cache, i = e.serialized, a = e.isStringTag;
1132
+ return Ht(n, i, a), zn(function() {
1133
+ return On(n, i, a);
1134
+ }), null;
1135
+ }, Bn = /* @__PURE__ */ Ln(function(t, e, n) {
1136
+ var i = t.css;
1137
+ typeof i == "string" && e.registered[i] !== void 0 && (i = e.registered[i]);
1138
+ var a = t[it], l = [i], f = "";
1139
+ typeof t.className == "string" ? f = wn(e.registered, l, t.className) : t.className != null && (f = t.className + " ");
1140
+ var h = Nn(l, void 0, te.useContext(Vn));
1141
+ f += e.key + "-" + h.name;
1142
+ var m = {};
1143
+ for (var p in t)
1144
+ ze.call(t, p) && p !== "css" && p !== it && (m[p] = t[p]);
1145
+ return m.className = f, n && (m.ref = n), /* @__PURE__ */ te.createElement(te.Fragment, null, /* @__PURE__ */ te.createElement(Yn, {
1146
+ cache: e,
1147
+ serialized: h,
1148
+ isStringTag: typeof a == "string"
1149
+ }), /* @__PURE__ */ te.createElement(a, m));
1150
+ }), Xt = Bn, Le = Ie.Fragment, o = function(e, n, i) {
1151
+ return ze.call(n, "css") ? Ie.jsx(Xt, Kt(e, n), i) : Ie.jsx(e, n, i);
1152
+ }, F = function(e, n, i) {
1153
+ return ze.call(n, "css") ? Ie.jsxs(Xt, Kt(e, n), i) : Ie.jsxs(e, n, i);
1154
+ }, R = /* @__PURE__ */ ((t) => (t.Off = "Off", t.All = "All", t.One = "One", t))(R || {});
1155
+ const Zt = 80, Wn = Y(
1156
+ ({ playerStore: t, playQueueStore: e }) => {
1157
+ const n = ie(), i = $(
1158
+ (f) => {
1159
+ const h = Number(f.currentTarget.value) / 100;
1160
+ t.setPercent(h);
1161
+ },
1162
+ [t]
1163
+ ), a = $(
1164
+ (f) => {
1165
+ f.button === 0 && t.setSeeking(!0);
1166
+ },
1167
+ [t]
1168
+ ), l = $(
1169
+ async (f) => {
1170
+ if (f.button === 0) {
1171
+ const h = Number(f.currentTarget.value) / 100;
1172
+ t.setSeeking(!1);
1173
+ const m = await n.getDuration();
1174
+ m !== void 0 && await n.setCurrentTime(m * h);
1175
+ }
1176
+ },
1177
+ [t, n]
1178
+ );
1179
+ return /* @__PURE__ */ o(
1180
+ Vt,
1181
+ {
1182
+ min: 0,
1183
+ max: 100,
1184
+ step: 1e-7,
1185
+ value: t.percent * 100,
1186
+ onChange: i,
1187
+ onMouseDown: a,
1188
+ onMouseUp: l,
1189
+ fullWidth: !0,
1190
+ showRange: !0,
1191
+ css: { blockSize: 32 },
1192
+ disabled: e.isEmpty
1193
+ }
1194
+ );
1195
+ }
1196
+ ), Un = Z(
1197
+ ({ button: t, isOpen: e, closePopover: n }) => {
1198
+ const [i, a] = q("0"), l = ie();
1199
+ wr(() => {
1200
+ e && l.getVolume().then((h) => {
1201
+ h !== void 0 && a(Math.floor(h * 100).toString());
1202
+ });
1203
+ }, [e, l]);
1204
+ const f = $(
1205
+ async (h) => {
1206
+ a(h.currentTarget.value), await l.setVolume(Number(h.currentTarget.value) / 100);
1207
+ },
1208
+ [l]
1209
+ );
1210
+ return /* @__PURE__ */ o(
1211
+ lt,
1212
+ {
1213
+ button: t,
1214
+ isOpen: e,
1215
+ closePopover: n,
1216
+ anchorPosition: "upRight",
1217
+ children: /* @__PURE__ */ o(tt, { children: /* @__PURE__ */ F(
1218
+ me,
1219
+ {
1220
+ responsive: !1,
1221
+ gutterSize: "s",
1222
+ justifyContent: "center",
1223
+ alignItems: "center",
1224
+ children: [
1225
+ /* @__PURE__ */ o(
1226
+ K,
1227
+ {
1228
+ title: "Mute",
1229
+ "aria-label": "Mute",
1230
+ iconType: Ut,
1231
+ size: "s",
1232
+ iconSize: "l"
1233
+ }
1234
+ ),
1235
+ /* @__PURE__ */ o(
1236
+ Vt,
1237
+ {
1238
+ min: 0,
1239
+ max: 100,
1240
+ step: 1,
1241
+ value: i,
1242
+ onChange: f,
1243
+ css: { blockSize: 32 }
1244
+ }
1245
+ )
1246
+ ]
1247
+ }
1248
+ ) })
1249
+ }
1250
+ );
1251
+ }
1252
+ ), qn = Z(
1253
+ ({
1254
+ playQueueStore: t,
1255
+ closePopover: e
1256
+ }) => {
1257
+ const n = ie(), i = $(async () => {
1258
+ const p = await n.getCurrentTime();
1259
+ p !== void 0 && await n.setCurrentTime(p - 10), e();
1260
+ }, [n, e]), a = $(async () => {
1261
+ const p = await n.getCurrentTime();
1262
+ p !== void 0 && await n.setCurrentTime(p + 30), e();
1263
+ }, [n, e]), l = $(
1264
+ async (p) => {
1265
+ await n.setPlaybackRate(p), e();
1266
+ },
1267
+ [n, e]
1268
+ ), f = $(async () => {
1269
+ t.currentItem !== void 0 && await t.removeItems([
1270
+ t.currentItem
1271
+ ]), e();
1272
+ }, [t, e]), [h] = q(), m = zt(
1273
+ () => [
1274
+ {
1275
+ id: 0,
1276
+ items: [
1277
+ {
1278
+ name: "Speed",
1279
+ icon: /* @__PURE__ */ o(H, { type: cn, size: "m" }),
1280
+ panel: 1
1281
+ },
1282
+ {
1283
+ name: "Skip back 10 seconds",
1284
+ icon: /* @__PURE__ */ o(H, { type: un, size: "m" }),
1285
+ onClick: i,
1286
+ disabled: t.isEmpty
1287
+ },
1288
+ {
1289
+ name: "Skip forward 30 seconds",
1290
+ icon: /* @__PURE__ */ o(H, { type: fn, size: "m" }),
1291
+ onClick: a,
1292
+ disabled: t.isEmpty
1293
+ },
1294
+ {
1295
+ isSeparator: !0
1296
+ },
1297
+ {
1298
+ name: "Remove from play queue",
1299
+ icon: /* @__PURE__ */ o(H, { type: ct, size: "m" }),
1300
+ onClick: f,
1301
+ disabled: t.isEmpty
1302
+ }
1303
+ ]
1304
+ },
1305
+ {
1306
+ id: 1,
1307
+ title: "Speed",
1308
+ items: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2].map(
1309
+ (p) => ({
1310
+ name: p.toString(),
1311
+ onClick: () => l(p),
1312
+ icon: p === h ? "check" : "empty"
1313
+ })
1314
+ )
1315
+ }
1316
+ ],
1317
+ [
1318
+ t,
1319
+ i,
1320
+ a,
1321
+ f,
1322
+ l,
1323
+ h
1324
+ ]
1325
+ );
1326
+ return /* @__PURE__ */ o(Fr, { initialPanelId: 0, panels: m });
1327
+ }
1328
+ ), Hn = Z(
1329
+ ({
1330
+ playQueueStore: t,
1331
+ button: e,
1332
+ isOpen: n,
1333
+ closePopover: i
1334
+ }) => /* @__PURE__ */ o(
1335
+ lt,
1336
+ {
1337
+ button: e,
1338
+ isOpen: n,
1339
+ closePopover: i,
1340
+ panelPaddingSize: "none",
1341
+ anchorPosition: "upRight",
1342
+ children: /* @__PURE__ */ o(
1343
+ qn,
1344
+ {
1345
+ playQueueStore: t,
1346
+ closePopover: i
1347
+ }
1348
+ )
1349
+ }
1350
+ )
1351
+ ), Gn = {
1352
+ [R.Off]: tn,
1353
+ [R.All]: en,
1354
+ [R.One]: Qr
1355
+ }, Jn = Y(
1356
+ ({
1357
+ playerStore: t,
1358
+ playQueueStore: e
1359
+ }) => {
1360
+ const n = ie(), i = $(async () => {
1361
+ if (e.hasPreviousItem) {
1362
+ const a = await n.getCurrentTime();
1363
+ a === void 0 || a < 5 ? await e.previous() : await n.setCurrentTime(0);
1364
+ } else
1365
+ await n.setCurrentTime(0);
1366
+ }, [e, n]);
1367
+ return /* @__PURE__ */ F(
1368
+ me,
1369
+ {
1370
+ responsive: !1,
1371
+ gutterSize: "s",
1372
+ justifyContent: "center",
1373
+ alignItems: "center",
1374
+ children: [
1375
+ /* @__PURE__ */ o(
1376
+ K,
1377
+ {
1378
+ title: `Shuffle: ${e.shuffle ? "On" : "Off"}`,
1379
+ "aria-label": `Shuffle: ${e.shuffle ? "On" : "Off"}`,
1380
+ iconType: e.shuffle ? rn : nn,
1381
+ size: "s",
1382
+ iconSize: "l",
1383
+ onClick: e.toggleShuffle,
1384
+ disabled: !0
1385
+ }
1386
+ ),
1387
+ /* @__PURE__ */ o(
1388
+ K,
1389
+ {
1390
+ title: "Previous",
1391
+ "aria-label": "Previous",
1392
+ iconType: on,
1393
+ size: "s",
1394
+ iconSize: "l",
1395
+ onClick: i,
1396
+ disabled: e.isEmpty
1397
+ }
1398
+ ),
1399
+ t.playing ? /* @__PURE__ */ o(
1400
+ K,
1401
+ {
1402
+ title: "Pause",
1403
+ "aria-label": "Pause",
1404
+ iconType: an,
1405
+ size: "s",
1406
+ iconSize: "l",
1407
+ onClick: () => n.pause(),
1408
+ disabled: !e.canPlay
1409
+ }
1410
+ ) : /* @__PURE__ */ o(
1411
+ K,
1412
+ {
1413
+ title: "Play",
1414
+ "aria-label": "Play",
1415
+ iconType: sn,
1416
+ size: "s",
1417
+ iconSize: "l",
1418
+ onClick: () => n.play(),
1419
+ disabled: !e.canPlay
1420
+ }
1421
+ ),
1422
+ /* @__PURE__ */ o(
1423
+ K,
1424
+ {
1425
+ title: "Next",
1426
+ "aria-label": "Next",
1427
+ iconType: ln,
1428
+ size: "s",
1429
+ iconSize: "l",
1430
+ onClick: e.next,
1431
+ disabled: !e.hasNextItem
1432
+ }
1433
+ ),
1434
+ /* @__PURE__ */ o(
1435
+ K,
1436
+ {
1437
+ title: `Repeat: ${e.repeat === R.All ? "All" : e.repeat === R.One ? "One" : "Off"}`,
1438
+ "aria-label": `Repeat: ${e.repeat === R.All ? "All" : e.repeat === R.One ? "One" : "Off"}`,
1439
+ iconType: Gn[e.repeat],
1440
+ size: "s",
1441
+ iconSize: "l",
1442
+ onClick: e.toggleRepeat
1443
+ }
1444
+ )
1445
+ ]
1446
+ }
1447
+ );
1448
+ }
1449
+ ), Kn = Z(() => {
1450
+ const [t, e] = q(!1);
1451
+ return /* @__PURE__ */ o(
1452
+ Un,
1453
+ {
1454
+ button: /* @__PURE__ */ o(
1455
+ K,
1456
+ {
1457
+ title: "Volume",
1458
+ "aria-label": "Volume",
1459
+ iconType: Ut,
1460
+ size: "s",
1461
+ iconSize: "l",
1462
+ onClick: () => e(!t)
1463
+ }
1464
+ ),
1465
+ isOpen: t,
1466
+ closePopover: () => e(!1)
1467
+ }
1468
+ );
1469
+ }), Xn = Z(
1470
+ ({ playQueueStore: t }) => {
1471
+ const [e, n] = q(!1);
1472
+ return /* @__PURE__ */ o(
1473
+ Hn,
1474
+ {
1475
+ playQueueStore: t,
1476
+ button: /* @__PURE__ */ o(
1477
+ K,
1478
+ {
1479
+ title: "More options",
1480
+ "aria-label": "More options",
1481
+ iconType: qt,
1482
+ size: "s",
1483
+ iconSize: "l",
1484
+ onClick: () => n(!e)
1485
+ }
1486
+ ),
1487
+ isOpen: e,
1488
+ closePopover: () => n(!1)
1489
+ }
1490
+ );
1491
+ }
1492
+ ), Zn = Z(
1493
+ ({ playQueueStore: t }) => /* @__PURE__ */ F(
1494
+ me,
1495
+ {
1496
+ responsive: !1,
1497
+ gutterSize: "s",
1498
+ justifyContent: "flexEnd",
1499
+ alignItems: "center",
1500
+ children: [
1501
+ /* @__PURE__ */ o(Kn, {}),
1502
+ /* @__PURE__ */ o(Xn, { playQueueStore: t })
1503
+ ]
1504
+ }
1505
+ )
1506
+ ), wi = Y(
1507
+ ({ playerStore: t, playQueueStore: e }) => /* @__PURE__ */ o(Mr, { paddingSize: "s", children: /* @__PURE__ */ F(me, { direction: "column", gutterSize: "none", children: [
1508
+ /* @__PURE__ */ o(G, { children: /* @__PURE__ */ o(
1509
+ Wn,
1510
+ {
1511
+ playerStore: t,
1512
+ playQueueStore: e
1513
+ }
1514
+ ) }),
1515
+ /* @__PURE__ */ o(G, { children: /* @__PURE__ */ F(me, { responsive: !1, children: [
1516
+ /* @__PURE__ */ o(G, { css: { width: "calc(100% / 3)" } }),
1517
+ /* @__PURE__ */ o(G, { css: { width: "calc(100% / 3)" }, children: /* @__PURE__ */ o(
1518
+ Jn,
1519
+ {
1520
+ playerStore: t,
1521
+ playQueueStore: e
1522
+ }
1523
+ ) }),
1524
+ /* @__PURE__ */ o(G, { css: { width: "calc(100% / 3)" }, children: /* @__PURE__ */ o(
1525
+ Zn,
1526
+ {
1527
+ playQueueStore: e
1528
+ }
1529
+ ) })
1530
+ ] }) })
1531
+ ] }) })
1532
+ ), Qn = ({
1533
+ onCancel: t,
1534
+ onSave: e
1535
+ }) => {
1536
+ const [n, i] = q(""), [a, l] = q(""), [f, h] = q(!1);
1537
+ return /* @__PURE__ */ F(Vr, { onClose: t, initialFocus: "[name=url]", children: [
1538
+ /* @__PURE__ */ o(Nr, { children: /* @__PURE__ */ o(jr, { children: "Add video" }) }),
1539
+ /* @__PURE__ */ o(Dr, { children: /* @__PURE__ */ F($r, { component: "form", children: [
1540
+ /* @__PURE__ */ o(tt, { label: "URL", children: /* @__PURE__ */ o(
1541
+ It,
1542
+ {
1543
+ name: "url",
1544
+ value: n,
1545
+ onChange: (m) => i(m.target.value)
1546
+ }
1547
+ ) }),
1548
+ /* @__PURE__ */ o(tt, { label: "Title", children: /* @__PURE__ */ o(
1549
+ It,
1550
+ {
1551
+ name: "title",
1552
+ value: a,
1553
+ onChange: (m) => l(m.target.value)
1554
+ }
1555
+ ) })
1556
+ ] }) }),
1557
+ /* @__PURE__ */ F(zr, { children: [
1558
+ /* @__PURE__ */ o(Lr, { onClick: t, children: "Cancel" }),
1559
+ /* @__PURE__ */ o(
1560
+ ne,
1561
+ {
1562
+ type: "submit",
1563
+ onClick: async () => {
1564
+ try {
1565
+ h(!0), await e({ url: n, title: a });
1566
+ } finally {
1567
+ h(!1);
1568
+ }
1569
+ },
1570
+ fill: !0,
1571
+ disabled: n.trim().length === 0,
1572
+ isLoading: f,
1573
+ children: "Save"
1574
+ }
1575
+ )
1576
+ ] })
1577
+ ] });
1578
+ };
1579
+ function ei(t) {
1580
+ return t !== null && typeof t == "object" && "title" in t && typeof t.title == "string";
1581
+ }
1582
+ const Qt = Z(
1583
+ ({ playQueueStore: t }) => {
1584
+ const [e, n] = q(!1), i = $(
1585
+ async (a) => {
1586
+ const l = Ar(a.url);
1587
+ if (l !== void 0) {
1588
+ const f = l.extractVideoId(a.url);
1589
+ if (f !== void 0) {
1590
+ const m = await (await fetch(
1591
+ `https://noembed.com/embed?url=${encodeURIComponent(
1592
+ a.url
1593
+ )}`
1594
+ )).json();
1595
+ await t.addItems([
1596
+ t.createItem({
1597
+ url: a.url,
1598
+ type: l.type,
1599
+ videoId: f,
1600
+ title: a.title || (ei(m) ? m.title : f)
1601
+ })
1602
+ ]);
1603
+ }
1604
+ }
1605
+ n(!1);
1606
+ },
1607
+ [t]
1608
+ );
1609
+ return /* @__PURE__ */ F(Le, { children: [
1610
+ /* @__PURE__ */ o(
1611
+ ne,
1612
+ {
1613
+ onClick: () => n(!0),
1614
+ iconType: ut,
1615
+ color: "primary",
1616
+ children: "Add video"
1617
+ }
1618
+ ),
1619
+ e && /* @__PURE__ */ o(
1620
+ Qn,
1621
+ {
1622
+ onCancel: () => n(!1),
1623
+ onSave: i
1624
+ }
1625
+ )
1626
+ ] });
1627
+ }
1628
+ ), ti = Y(
1629
+ ({ playQueueStore: t }) => {
1630
+ const { euiTheme: e } = Yt();
1631
+ return /* @__PURE__ */ F(
1632
+ Br,
1633
+ {
1634
+ style: {
1635
+ position: "sticky",
1636
+ top: 112,
1637
+ zIndex: 998,
1638
+ background: e.colors.backgroundBasePlain
1639
+ },
1640
+ children: [
1641
+ /* @__PURE__ */ o(Yr, { children: /* @__PURE__ */ o(
1642
+ Bt,
1643
+ {
1644
+ id: "",
1645
+ checked: t.allItemsSelected,
1646
+ onChange: (n) => {
1647
+ t.allItemsSelected = n.target.checked;
1648
+ }
1649
+ }
1650
+ ) }),
1651
+ /* @__PURE__ */ o(Xe, { width: 24 }),
1652
+ /* @__PURE__ */ o(Xe, { children: "Title" }),
1653
+ /* @__PURE__ */ o(Xe, {})
1654
+ ]
1655
+ }
1656
+ );
1657
+ }
1658
+ ), ri = Z(
1659
+ ({
1660
+ item: t,
1661
+ closePopover: e
1662
+ }) => {
1663
+ const n = Z(
1664
+ ({
1665
+ onClick: i,
1666
+ ...a
1667
+ }) => {
1668
+ const l = $(
1669
+ (f) => {
1670
+ e(), i == null || i(f);
1671
+ },
1672
+ [i]
1673
+ );
1674
+ return /* @__PURE__ */ o(Wr, { ...a, onClick: l });
1675
+ }
1676
+ );
1677
+ return /* @__PURE__ */ F(Ur, { children: [
1678
+ /* @__PURE__ */ o(
1679
+ n,
1680
+ {
1681
+ icon: /* @__PURE__ */ o(H, { type: "" }),
1682
+ onClick: t.playFirst,
1683
+ children: "Play first"
1684
+ }
1685
+ ),
1686
+ /* @__PURE__ */ o(
1687
+ n,
1688
+ {
1689
+ icon: /* @__PURE__ */ o(H, { type: "" }),
1690
+ onClick: t.playNext,
1691
+ children: "Play next"
1692
+ }
1693
+ ),
1694
+ /* @__PURE__ */ o(
1695
+ n,
1696
+ {
1697
+ icon: /* @__PURE__ */ o(H, { type: ut }),
1698
+ onClick: t.addToPlayQueue,
1699
+ children: "Add to play queue"
1700
+ }
1701
+ ),
1702
+ /* @__PURE__ */ o(Pt, { margin: "none" }),
1703
+ /* @__PURE__ */ o(
1704
+ n,
1705
+ {
1706
+ icon: /* @__PURE__ */ o(H, { type: dn }),
1707
+ onClick: t.moveToTop,
1708
+ disabled: !t.canMoveToTop,
1709
+ children: "Move to the top"
1710
+ }
1711
+ ),
1712
+ /* @__PURE__ */ o(
1713
+ n,
1714
+ {
1715
+ icon: /* @__PURE__ */ o(H, { type: mn }),
1716
+ onClick: t.moveToBottom,
1717
+ disabled: !t.canMoveToBottom,
1718
+ children: "Move to the bottom"
1719
+ }
1720
+ ),
1721
+ /* @__PURE__ */ o(Pt, { margin: "none" }),
1722
+ /* @__PURE__ */ o(
1723
+ n,
1724
+ {
1725
+ icon: /* @__PURE__ */ o(H, { type: "" }),
1726
+ onClick: t.removeToTop,
1727
+ disabled: !t.canRemoveToTop,
1728
+ children: "Remove to the top"
1729
+ }
1730
+ ),
1731
+ /* @__PURE__ */ o(
1732
+ n,
1733
+ {
1734
+ icon: /* @__PURE__ */ o(H, { type: "" }),
1735
+ onClick: t.removeOthers,
1736
+ disabled: !t.canRemoveOthers,
1737
+ children: "Remove others"
1738
+ }
1739
+ )
1740
+ ] });
1741
+ }
1742
+ ), ni = Z(
1743
+ ({ item: t }) => {
1744
+ const [e, n] = q(!1), i = $(() => n(!e), [e]), a = $(() => n(!1), []);
1745
+ return /* @__PURE__ */ o(
1746
+ lt,
1747
+ {
1748
+ button: /* @__PURE__ */ o(
1749
+ K,
1750
+ {
1751
+ title: "More options",
1752
+ "aria-label": "More options",
1753
+ iconType: qt,
1754
+ size: "s",
1755
+ color: "text",
1756
+ onClick: i
1757
+ }
1758
+ ),
1759
+ isOpen: e,
1760
+ closePopover: a,
1761
+ panelPaddingSize: "none",
1762
+ anchorPosition: "leftCenter",
1763
+ children: /* @__PURE__ */ o(
1764
+ ri,
1765
+ {
1766
+ item: t,
1767
+ closePopover: a
1768
+ }
1769
+ )
1770
+ }
1771
+ );
1772
+ }
1773
+ ), ii = Y(
1774
+ ({ item: t }) => {
1775
+ const e = ie();
1776
+ return /* @__PURE__ */ F(rt, { textOnly: !1, hasActions: !0, align: "right", children: [
1777
+ /* @__PURE__ */ o(
1778
+ ne,
1779
+ {
1780
+ iconType: hn,
1781
+ size: "s",
1782
+ onClick: async () => {
1783
+ t.isCurrent ? await e.setCurrentTime(0) : t.play();
1784
+ },
1785
+ children: "Play"
1786
+ }
1787
+ ),
1788
+ /* @__PURE__ */ o(
1789
+ ne,
1790
+ {
1791
+ iconType: ct,
1792
+ size: "s",
1793
+ onClick: t.remove,
1794
+ children: "Remove"
1795
+ }
1796
+ ),
1797
+ /* @__PURE__ */ o(ni, { item: t })
1798
+ ] });
1799
+ }
1800
+ ), oi = {
1801
+ Audio: "",
1802
+ Dailymotion: "https://www.dailymotion.com/favicon.ico",
1803
+ Niconico: "https://www.nicovideo.jp/favicon.ico",
1804
+ SoundCloud: "https://soundcloud.com/favicon.ico",
1805
+ Twitch: "https://www.twitch.tv/favicon.ico",
1806
+ Vimeo: "https://vimeo.com/favicon.ico",
1807
+ YouTube: "https://www.youtube.com/favicon.ico"
1808
+ }, ai = Y(
1809
+ ({ item: t }) => {
1810
+ const e = ie();
1811
+ return /* @__PURE__ */ F(Gr, { isSelected: t.isCurrent, children: [
1812
+ /* @__PURE__ */ o(qr, { children: /* @__PURE__ */ o(
1813
+ Bt,
1814
+ {
1815
+ id: t.id.toString(),
1816
+ checked: t.isSelected,
1817
+ onChange: t.toggleSelected
1818
+ }
1819
+ ) }),
1820
+ /* @__PURE__ */ o(rt, { textOnly: !1, children: /* @__PURE__ */ o(
1821
+ "img",
1822
+ {
1823
+ src: oi[t.type],
1824
+ width: 16,
1825
+ height: 16,
1826
+ alt: t.type
1827
+ }
1828
+ ) }),
1829
+ /* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o(
1830
+ Hr,
1831
+ {
1832
+ href: t.url,
1833
+ target: "_blank",
1834
+ external: !0,
1835
+ onClick: () => e.pause(),
1836
+ children: t.title
1837
+ }
1838
+ ) }),
1839
+ /* @__PURE__ */ o(ii, { item: t })
1840
+ ] }, t.id);
1841
+ }
1842
+ ), si = Y(
1843
+ ({ playQueueStore: t }) => /* @__PURE__ */ o(
1844
+ pn,
1845
+ {
1846
+ tag: "tbody",
1847
+ list: t.items,
1848
+ setList: (e) => t.setItems(e),
1849
+ children: t.items.map((e) => /* @__PURE__ */ o(ai, { item: e }, e.id))
1850
+ }
1851
+ )
1852
+ ), li = Y(
1853
+ ({ playQueueStore: t }) => /* @__PURE__ */ F(Jr, { children: [
1854
+ /* @__PURE__ */ o(ti, { playQueueStore: t }),
1855
+ /* @__PURE__ */ o(si, { playQueueStore: t })
1856
+ ] })
1857
+ ), ci = Y(
1858
+ ({ playQueueStore: t }) => {
1859
+ const [e, n] = q(!1);
1860
+ return /* @__PURE__ */ F(Le, { children: [
1861
+ e && /* @__PURE__ */ o(
1862
+ Xr,
1863
+ {
1864
+ type: "push",
1865
+ size: "s",
1866
+ onClose: () => n(!1),
1867
+ children: /* @__PURE__ */ o("div", { style: { blockSize: "100%" }, children: /* @__PURE__ */ o(
1868
+ Kr,
1869
+ {
1870
+ language: "json",
1871
+ overflowHeight: "100%",
1872
+ isCopyable: !0,
1873
+ isVirtualized: !0,
1874
+ children: JSON.stringify(
1875
+ t.localStorageState,
1876
+ void 0,
1877
+ 2
1878
+ )
1879
+ }
1880
+ ) })
1881
+ }
1882
+ ),
1883
+ /* @__PURE__ */ o(Qt, { playQueueStore: t })
1884
+ ] });
1885
+ }
1886
+ ), ui = Y(
1887
+ ({ playerStore: t, playQueueStore: e }) => {
1888
+ const { euiTheme: n } = Yt();
1889
+ return /* @__PURE__ */ F(Le, { children: [
1890
+ /* @__PURE__ */ F(
1891
+ me,
1892
+ {
1893
+ alignItems: "center",
1894
+ gutterSize: "m",
1895
+ style: {
1896
+ position: "sticky",
1897
+ top: 48,
1898
+ zIndex: 998,
1899
+ background: n.colors.backgroundBasePlain
1900
+ },
1901
+ children: [
1902
+ /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(
1903
+ ne,
1904
+ {
1905
+ disabled: e.isEmpty || e.selectedItems.length === 0,
1906
+ onClick: e.playSelectedItemsNext,
1907
+ children: "Play next"
1908
+ }
1909
+ ) }),
1910
+ /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(
1911
+ ne,
1912
+ {
1913
+ iconType: ut,
1914
+ onClick: e.addSelectedItems,
1915
+ disabled: e.isEmpty || e.selectedItems.length === 0,
1916
+ children: "Add to play queue"
1917
+ }
1918
+ ) }),
1919
+ /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(
1920
+ ne,
1921
+ {
1922
+ iconType: ct,
1923
+ onClick: e.removeSelectedItems,
1924
+ disabled: e.isEmpty || e.selectedItems.length === 0,
1925
+ children: "Remove"
1926
+ }
1927
+ ) }),
1928
+ /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(
1929
+ ne,
1930
+ {
1931
+ iconType: vn,
1932
+ onClick: e.clear,
1933
+ disabled: e.isEmpty,
1934
+ children: "Clear"
1935
+ }
1936
+ ) }),
1937
+ /* @__PURE__ */ o(G, { grow: !0 }),
1938
+ /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(ci, { playQueueStore: e }) })
1939
+ ]
1940
+ }
1941
+ ),
1942
+ /* @__PURE__ */ o(
1943
+ Wt,
1944
+ {
1945
+ size: "l",
1946
+ style: {
1947
+ position: "sticky",
1948
+ top: 88,
1949
+ zIndex: 998,
1950
+ background: n.colors.backgroundBasePlain
1951
+ }
1952
+ }
1953
+ ),
1954
+ e.isEmpty ? /* @__PURE__ */ o(
1955
+ Zr,
1956
+ {
1957
+ title: /* @__PURE__ */ o("h2", { children: "We couldn't find any videos" }),
1958
+ body: /* @__PURE__ */ o("p", { children: "Your video library doesn't contain any video content." }),
1959
+ actions: /* @__PURE__ */ o(Qt, { playQueueStore: e })
1960
+ }
1961
+ ) : /* @__PURE__ */ o(li, { playQueueStore: e })
1962
+ ] });
1963
+ }
1964
+ ), Oi = Y(
1965
+ ({ playerStore: t, playQueueStore: e }) => /* @__PURE__ */ F(Le, { children: [
1966
+ /* @__PURE__ */ o(
1967
+ nt.Header,
1968
+ {
1969
+ pageTitle: "Play queue",
1970
+ rightSideItems: []
1971
+ }
1972
+ ),
1973
+ /* @__PURE__ */ o(nt.Section, { children: /* @__PURE__ */ o(
1974
+ ui,
1975
+ {
1976
+ playerStore: t,
1977
+ playQueueStore: e
1978
+ }
1979
+ ) })
1980
+ ] })
1981
+ ), ot = {
1982
+ width: 16 * 25,
1983
+ height: 9 * 25
1984
+ }, _i = Y(
1985
+ ({ playerStore: t, playQueueStore: e }) => {
1986
+ const n = ie(), i = $(async () => {
1987
+ e.interacted && await n.play();
1988
+ }, [e, n]), a = $(async () => {
1989
+ switch (e.repeat) {
1990
+ case R.One:
1991
+ await n.setCurrentTime(0);
1992
+ break;
1993
+ case R.Off:
1994
+ case R.All:
1995
+ if (e.isLastItem)
1996
+ switch (e.repeat) {
1997
+ case R.Off:
1998
+ t.onEnded();
1999
+ break;
2000
+ case R.All:
2001
+ e.hasMultipleItems ? await e.goToFirst() : await n.setCurrentTime(0);
2002
+ break;
2003
+ }
2004
+ else
2005
+ await e.next();
2006
+ break;
2007
+ }
2008
+ }, [e, t, n]), l = zt(
2009
+ () => ({
2010
+ onLoaded: i,
2011
+ onPlay: t.onPlay,
2012
+ onPause: t.onPause,
2013
+ onEnded: a,
2014
+ onTimeUpdate: t.onTimeUpdate
2015
+ }),
2016
+ [t, i, a]
2017
+ );
2018
+ return /* @__PURE__ */ o(
2019
+ "div",
2020
+ {
2021
+ css: {
2022
+ position: "fixed",
2023
+ right: 0,
2024
+ bottom: Zt,
2025
+ width: ot.width,
2026
+ height: ot.height,
2027
+ zIndex: 998,
2028
+ backgroundColor: "rgb(39, 39, 39)",
2029
+ display: "flex",
2030
+ flexDirection: "column"
2031
+ },
2032
+ children: /* @__PURE__ */ o("div", { css: { flexGrow: 1, backgroundColor: "black" }, children: e.currentItem && /* @__PURE__ */ o(
2033
+ kr,
2034
+ {
2035
+ src: e.currentItem.url,
2036
+ options: l
2037
+ }
2038
+ ) })
2039
+ }
2040
+ );
2041
+ }
2042
+ );
2043
+ class er {
2044
+ makeObservable(e, n) {
2045
+ return yn(e, n);
2046
+ }
2047
+ }
2048
+ const Ce = class Ce {
2049
+ constructor(e, n, i) {
2050
+ U(this, "id");
2051
+ U(this, "isSelected", !1);
2052
+ this.observableStateProvider = e, this.playQueueStore = n, this.dto = i, this.id = Ce.nextId++, e.makeObservable(this, {
2053
+ isSelected: re,
2054
+ isCurrent: _,
2055
+ index: _,
2056
+ isFirst: _,
2057
+ isLast: _,
2058
+ canMoveToTop: _,
2059
+ canMoveToBottom: _,
2060
+ canRemoveToTop: _,
2061
+ canRemoveOthers: _,
2062
+ unselect: y,
2063
+ toggleSelected: y.bound,
2064
+ play: y,
2065
+ remove: y.bound,
2066
+ playFirst: y.bound,
2067
+ playNext: y.bound,
2068
+ addToPlayQueue: y.bound,
2069
+ moveToTop: y.bound,
2070
+ moveToBottom: y.bound,
2071
+ removeToTop: y.bound,
2072
+ removeOthers: y.bound
2073
+ });
2074
+ }
2075
+ static fromDto(e, n, i) {
2076
+ return new Ce(
2077
+ e,
2078
+ n,
2079
+ i
2080
+ );
2081
+ }
2082
+ get url() {
2083
+ return this.dto.url;
2084
+ }
2085
+ get type() {
2086
+ return this.dto.type;
2087
+ }
2088
+ get videoId() {
2089
+ return this.dto.videoId;
2090
+ }
2091
+ get title() {
2092
+ return this.dto.title;
2093
+ }
2094
+ get isCurrent() {
2095
+ return this.playQueueStore.currentItem === this;
2096
+ }
2097
+ get index() {
2098
+ return this.playQueueStore.items.indexOf(this);
2099
+ }
2100
+ get isFirst() {
2101
+ return this.index === 0;
2102
+ }
2103
+ get isLast() {
2104
+ return this.index === this.playQueueStore.items.length - 1;
2105
+ }
2106
+ get canMoveToTop() {
2107
+ return !this.isFirst;
2108
+ }
2109
+ get canMoveToBottom() {
2110
+ return !this.isLast;
2111
+ }
2112
+ get canRemoveToTop() {
2113
+ return !this.isFirst;
2114
+ }
2115
+ get canRemoveOthers() {
2116
+ return this.playQueueStore.hasMultipleItems;
2117
+ }
2118
+ clone() {
2119
+ return this.playQueueStore.createItem(this.dto);
2120
+ }
2121
+ unselect() {
2122
+ this.isSelected = !1;
2123
+ }
2124
+ toggleSelected() {
2125
+ this.isSelected = !this.isSelected;
2126
+ }
2127
+ play() {
2128
+ this.playQueueStore.setCurrentItem(this);
2129
+ }
2130
+ remove() {
2131
+ return this.playQueueStore.removeItems([this]);
2132
+ }
2133
+ async playFirst() {
2134
+ await this.playQueueStore.playFirst([this.clone()]);
2135
+ }
2136
+ async playNext() {
2137
+ await this.playQueueStore.playNext([this.clone()]);
2138
+ }
2139
+ async addToPlayQueue() {
2140
+ await this.playQueueStore.addItems([this.clone()]);
2141
+ }
2142
+ moveToTop() {
2143
+ this.playQueueStore.moveItem(this, 0);
2144
+ }
2145
+ moveToBottom() {
2146
+ this.playQueueStore.moveItem(
2147
+ this,
2148
+ this.playQueueStore.items.length - 1
2149
+ );
2150
+ }
2151
+ removeToTop() {
2152
+ return this.playQueueStore.removeItemsAbove(this);
2153
+ }
2154
+ removeOthers() {
2155
+ return this.playQueueStore.removeOtherItems(this);
2156
+ }
2157
+ };
2158
+ U(Ce, "nextId", 1);
2159
+ let at = Ce;
2160
+ const et = new bn({
2161
+ coerceTypes: !0
2162
+ });
2163
+ function fi(t, e) {
2164
+ let n;
2165
+ if (n = et.getSchema(e), n === void 0 && (et.addSchema(t, e), n = et.getSchema(e)), n === void 0 || n.schema !== t)
2166
+ throw new Error(
2167
+ `Invalid schema. Expected: '${JSON.stringify(
2168
+ t
2169
+ )}', but got '${JSON.stringify(n == null ? void 0 : n.schema)}'.`
2170
+ );
2171
+ return n;
2172
+ }
2173
+ const di = {
2174
+ type: "object",
2175
+ properties: {
2176
+ version: {
2177
+ type: "string",
2178
+ nullable: !0
2179
+ },
2180
+ repeat: {
2181
+ type: "string",
2182
+ enum: Object.values(R),
2183
+ nullable: !0
2184
+ },
2185
+ shuffle: {
2186
+ type: "boolean",
2187
+ nullable: !0
2188
+ },
2189
+ items: {
2190
+ type: "array",
2191
+ nullable: !0,
2192
+ items: {
2193
+ type: "object",
2194
+ properties: {
2195
+ url: {
2196
+ type: "string"
2197
+ },
2198
+ type: {
2199
+ type: "string"
2200
+ },
2201
+ videoId: {
2202
+ type: "string"
2203
+ },
2204
+ title: {
2205
+ type: "string"
2206
+ }
2207
+ },
2208
+ required: ["url", "type", "videoId", "title"]
2209
+ }
2210
+ },
2211
+ currentIndex: {
2212
+ type: "integer",
2213
+ nullable: !0
2214
+ }
2215
+ }
2216
+ }, mi = fi(
2217
+ di,
2218
+ "PlayQueueStore"
2219
+ );
2220
+ class hi {
2221
+ constructor(e) {
2222
+ U(this, "interacted", !1);
2223
+ U(this, "items", []);
2224
+ U(this, "currentId");
2225
+ U(this, "repeat", R.Off);
2226
+ U(this, "shuffle", !1);
2227
+ this.observableStateProvider = e, e.makeObservable(this, {
2228
+ interacted: re,
2229
+ items: re,
2230
+ currentId: re,
2231
+ repeat: re,
2232
+ shuffle: re,
2233
+ localStorageState: _.struct,
2234
+ isEmpty: _,
2235
+ currentItem: _,
2236
+ canPlay: _,
2237
+ canPause: _,
2238
+ hasMultipleItems: _,
2239
+ currentIndex: _,
2240
+ hasPreviousItem: _,
2241
+ hasNextItem: _,
2242
+ isLastItem: _,
2243
+ selectedItems: _,
2244
+ allItemsSelected: _,
2245
+ selectedItemsOrAllItems: _,
2246
+ setItems: y,
2247
+ interact: y,
2248
+ clear: y.bound,
2249
+ unselectAll: y,
2250
+ setCurrentItem: y,
2251
+ setNextItems: y,
2252
+ clearAndSetItems: y,
2253
+ playNext: y,
2254
+ playSelectedItemsNext: y.bound,
2255
+ addItems: y,
2256
+ addSelectedItems: y.bound,
2257
+ playFirst: y,
2258
+ moveItem: y,
2259
+ removeItems: y,
2260
+ removeSelectedItems: y.bound,
2261
+ removeOtherItems: y,
2262
+ removeItemsAbove: y,
2263
+ toggleRepeat: y.bound,
2264
+ toggleShuffle: y.bound,
2265
+ previous: y,
2266
+ next: y.bound,
2267
+ goToFirst: y
2268
+ });
2269
+ }
2270
+ createItem(e) {
2271
+ return at.fromDto(
2272
+ this.observableStateProvider,
2273
+ this,
2274
+ e
2275
+ );
2276
+ }
2277
+ get localStorageState() {
2278
+ return {
2279
+ version: "1.0",
2280
+ repeat: this.repeat,
2281
+ shuffle: this.shuffle,
2282
+ items: this.items.map((e) => e.dto),
2283
+ currentIndex: this.currentIndex
2284
+ };
2285
+ }
2286
+ set localStorageState(e) {
2287
+ var n;
2288
+ this.repeat = e.repeat ?? R.Off, this.shuffle = e.shuffle ?? !1, this.items = ((n = e.items) == null ? void 0 : n.map((i) => this.createItem(i))) ?? [], this.currentIndex = e.currentIndex;
2289
+ }
2290
+ validateLocalStorageState(e) {
2291
+ return mi(e);
2292
+ }
2293
+ get isEmpty() {
2294
+ return this.items.length === 0;
2295
+ }
2296
+ get currentItem() {
2297
+ return this.items.find((e) => e.id === this.currentId);
2298
+ }
2299
+ get canPlay() {
2300
+ return this.currentItem !== void 0;
2301
+ }
2302
+ get canPause() {
2303
+ return this.currentItem !== void 0;
2304
+ }
2305
+ get hasMultipleItems() {
2306
+ return this.items.length > 1;
2307
+ }
2308
+ get currentIndex() {
2309
+ return this.currentId !== void 0 ? this.items.findIndex((e) => e.id === this.currentId) : void 0;
2310
+ }
2311
+ set currentIndex(e) {
2312
+ var n;
2313
+ this.currentId = e !== void 0 ? (n = this.items.at(e)) == null ? void 0 : n.id : void 0;
2314
+ }
2315
+ get hasPreviousItem() {
2316
+ return this.hasMultipleItems && this.currentIndex !== void 0 && this.currentIndex > 0;
2317
+ }
2318
+ get hasNextItem() {
2319
+ return this.hasMultipleItems && this.currentIndex !== void 0 && this.currentIndex < this.items.length - 1;
2320
+ }
2321
+ get isLastItem() {
2322
+ return this.currentIndex !== void 0 && this.currentIndex === this.items.length - 1;
2323
+ }
2324
+ get selectedItems() {
2325
+ return this.items.filter((e) => e.isSelected);
2326
+ }
2327
+ get allItemsSelected() {
2328
+ return this.selectedItems.length === this.items.length;
2329
+ }
2330
+ set allItemsSelected(e) {
2331
+ for (const n of this.items)
2332
+ n.isSelected = e;
2333
+ }
2334
+ get selectedItemsOrAllItems() {
2335
+ return this.selectedItems.length > 0 ? this.selectedItems : this.items;
2336
+ }
2337
+ setItems(e) {
2338
+ this.items = e;
2339
+ }
2340
+ interact() {
2341
+ this.interacted = !0;
2342
+ }
2343
+ clear() {
2344
+ this.interact(), this.currentIndex = void 0, this.items = [];
2345
+ }
2346
+ unselectAll() {
2347
+ for (const e of this.items)
2348
+ e.unselect();
2349
+ }
2350
+ setCurrentItem(e) {
2351
+ this.interact(), this.currentId = e == null ? void 0 : e.id;
2352
+ }
2353
+ setNextItems(e) {
2354
+ this.currentIndex !== void 0 && this.items.splice(this.currentIndex + 1, 0, ...e);
2355
+ }
2356
+ clearAndSetItems(e) {
2357
+ this.clear(), this.setCurrentItem(e[0]), this.setNextItems(e);
2358
+ }
2359
+ async playNext(e) {
2360
+ if (this.isEmpty) {
2361
+ this.clearAndSetItems(e);
2362
+ return;
2363
+ }
2364
+ this.setNextItems(e);
2365
+ }
2366
+ async playSelectedItemsNext() {
2367
+ await this.playNext(
2368
+ this.selectedItemsOrAllItems.map((e) => e.clone())
2369
+ ), this.unselectAll();
2370
+ }
2371
+ async addItems(e) {
2372
+ if (this.isEmpty) {
2373
+ this.clearAndSetItems(e);
2374
+ return;
2375
+ }
2376
+ this.items.push(...e);
2377
+ }
2378
+ async addSelectedItems() {
2379
+ await this.addItems(
2380
+ this.selectedItemsOrAllItems.map((e) => e.clone())
2381
+ ), this.unselectAll();
2382
+ }
2383
+ async playFirst(e) {
2384
+ if (this.isEmpty) {
2385
+ this.clearAndSetItems(e);
2386
+ return;
2387
+ }
2388
+ const { currentIndex: n } = this;
2389
+ n !== void 0 && (this.interact(), this.items.splice(n, 0, ...e), this.currentIndex = n);
2390
+ }
2391
+ moveItem(e, n) {
2392
+ const i = this.items.splice(this.items.indexOf(e), 1)[0];
2393
+ this.items.splice(n, 0, i);
2394
+ }
2395
+ async removeItems(e) {
2396
+ const { currentItem: n } = this;
2397
+ Rt(this.items, ...e.filter((l) => l !== n));
2398
+ const { currentIndex: i, isLastItem: a } = this;
2399
+ Rt(
2400
+ this.items,
2401
+ e.find((l) => l === n)
2402
+ ), this.currentItem !== n && (this.interact(), a ? await this.goToFirst() : this.currentIndex = i);
2403
+ }
2404
+ async removeSelectedItems() {
2405
+ await this.removeItems(this.selectedItemsOrAllItems), this.unselectAll();
2406
+ }
2407
+ async removeOtherItems(e) {
2408
+ const n = e.id;
2409
+ return this.removeItems(
2410
+ this.items.filter((i) => i.id !== n)
2411
+ );
2412
+ }
2413
+ async removeItemsAbove(e) {
2414
+ const n = this.items.indexOf(e);
2415
+ return this.removeItems(
2416
+ this.items.filter((i, a) => a < n)
2417
+ );
2418
+ }
2419
+ toggleRepeat() {
2420
+ switch (this.repeat) {
2421
+ case R.Off:
2422
+ this.repeat = R.All;
2423
+ break;
2424
+ case R.All:
2425
+ this.repeat = R.One;
2426
+ break;
2427
+ case R.One:
2428
+ this.repeat = R.Off;
2429
+ break;
2430
+ }
2431
+ }
2432
+ toggleShuffle() {
2433
+ this.shuffle = !this.shuffle;
2434
+ }
2435
+ async previous() {
2436
+ this.currentIndex !== void 0 && this.hasPreviousItem && (this.interact(), this.currentIndex--);
2437
+ }
2438
+ async next() {
2439
+ this.currentIndex !== void 0 && this.hasNextItem && (this.interact(), this.currentIndex++);
2440
+ }
2441
+ async goToFirst() {
2442
+ this.currentIndex !== void 0 && (this.currentIndex = 0);
2443
+ }
2444
+ }
2445
+ const tr = Lt(void 0), Ai = ({
2446
+ children: t
2447
+ }) => {
2448
+ const [e] = q(
2449
+ () => new hi(new er())
2450
+ ), n = ie();
2451
+ return Or(() => gn(
2452
+ () => e.currentItem,
2453
+ async (i, a) => {
2454
+ i === void 0 || a === void 0 || i.type === a.type && i.videoId === a.videoId && await n.setCurrentTime(0);
2455
+ }
2456
+ ), [e, n]), /* @__PURE__ */ o(tr.Provider, { value: e, children: t });
2457
+ }, vi = () => st(tr), ki = Y(
2458
+ ({ children: t }) => {
2459
+ const e = vi();
2460
+ return /* @__PURE__ */ F(
2461
+ nt,
2462
+ {
2463
+ panelled: !0,
2464
+ style: {
2465
+ minBlockSize: `max(460px, 100vh - ${Zt}px)`
2466
+ },
2467
+ children: [
2468
+ t,
2469
+ !e.isEmpty && /* @__PURE__ */ o(Wt, { style: { blockSize: ot.height } })
2470
+ ]
2471
+ }
2472
+ );
2473
+ }
2474
+ );
2475
+ class pi {
2476
+ constructor(e) {
2477
+ U(this, "playing", !1);
2478
+ U(this, "percent", 0);
2479
+ U(this, "seeking", !1);
2480
+ e.makeObservable(this, {
2481
+ playing: re,
2482
+ percent: re,
2483
+ seeking: re,
2484
+ setPlaying: y,
2485
+ setPercent: y,
2486
+ setSeeking: y,
2487
+ onPlay: y.bound,
2488
+ onPause: y.bound,
2489
+ onEnded: y.bound,
2490
+ onTimeUpdate: y.bound
2491
+ });
2492
+ }
2493
+ setPlaying(e) {
2494
+ this.playing = e;
2495
+ }
2496
+ setPercent(e) {
2497
+ this.percent = e;
2498
+ }
2499
+ setSeeking(e) {
2500
+ this.seeking = e;
2501
+ }
2502
+ onPlay() {
2503
+ this.playing = !0;
2504
+ }
2505
+ onPause() {
2506
+ this.playing = !1;
2507
+ }
2508
+ onEnded() {
2509
+ this.playing = !1;
2510
+ }
2511
+ onTimeUpdate({ percent: e }) {
2512
+ e !== void 0 && (this.seeking || (this.percent = e));
2513
+ }
2514
+ }
2515
+ const rr = Lt(void 0), Mi = ({
2516
+ children: t
2517
+ }) => {
2518
+ const [e] = q(
2519
+ () => new pi(new er())
2520
+ );
2521
+ return /* @__PURE__ */ o(rr.Provider, { value: e, children: t });
2522
+ }, Fi = () => st(rr);
2523
+ class ji {
2524
+ makeObservable(e, n) {
2525
+ return e;
2526
+ }
2527
+ }
2528
+ export {
2529
+ wi as BottomBar,
2530
+ Oi as HydrangeanDiva,
2531
+ ki as MediaPlayerLayout,
2532
+ _i as MiniPlayer,
2533
+ er as MobXObservableStateProvider,
2534
+ ji as ObservableStateProvider,
2535
+ Ai as PlayQueueStoreProvider,
2536
+ Mi as PlayerStoreProvider,
2537
+ R as RepeatMode,
2538
+ Zt as bottomBarHeight,
2539
+ ot as miniPlayerSize,
2540
+ vi as usePlayQueueStore,
2541
+ Fi as usePlayerStore
2542
+ };
2543
+ //# sourceMappingURL=index.es.js.map