react-modern-audio-player 2.1.0 → 2.3.0

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 (69) hide show
  1. package/README.md +196 -43
  2. package/dist/index.css +1 -1
  3. package/dist/index.es.js +1500 -1217
  4. package/dist/types/api/useAudioPlayer.d.ts +2 -0
  5. package/dist/types/api/useAudioPlayerPlayback.d.ts +2 -0
  6. package/dist/types/components/AudioPlayer/Context/PlaybackContext.d.ts +1 -0
  7. package/dist/types/components/AudioPlayer/Context/StateContext/audio.d.ts +2 -0
  8. package/dist/types/components/AudioPlayer/Context/StateContext/element.d.ts +1 -0
  9. package/dist/types/components/AudioPlayer/Context/StateContext/index.d.ts +3 -1
  10. package/dist/types/components/AudioPlayer/Context/StateContext/placement.d.ts +7 -5
  11. package/dist/types/components/AudioPlayer/Context/UIContext.d.ts +3 -1
  12. package/dist/types/components/AudioPlayer/Context/dispatchContext.d.ts +5 -2
  13. package/dist/types/{hooks/context → components/AudioPlayer/Context/hooks}/index.d.ts +0 -1
  14. package/dist/types/components/AudioPlayer/Context/hooks/useAudioAttrsContext.d.ts +2 -0
  15. package/dist/types/components/AudioPlayer/Context/hooks/usePlaybackContext.d.ts +2 -0
  16. package/dist/types/components/AudioPlayer/Context/hooks/useResourceContext.d.ts +2 -0
  17. package/dist/types/components/AudioPlayer/Context/hooks/useTimeContext.d.ts +2 -0
  18. package/dist/types/components/AudioPlayer/Context/hooks/useTrackContext.d.ts +2 -0
  19. package/dist/types/components/AudioPlayer/Context/hooks/useUIContext.d.ts +1 -0
  20. package/dist/types/components/AudioPlayer/Context/index.d.ts +1 -0
  21. package/dist/types/components/AudioPlayer/Context/providerProps.d.ts +2 -1
  22. package/dist/types/components/AudioPlayer/Interface/Controller/Button/RepeatTypeBtn.d.ts +3 -1
  23. package/dist/types/components/AudioPlayer/Interface/Controller/Button/TransportControls/index.d.ts +4 -0
  24. package/dist/types/components/AudioPlayer/Interface/Controller/Button/index.d.ts +4 -3
  25. package/dist/types/components/AudioPlayer/Interface/Controller/Drawer/SortablePlayList/index.d.ts +5 -1
  26. package/dist/types/components/AudioPlayer/Interface/Controller/Input/Progress/index.d.ts +12 -1
  27. package/dist/types/components/AudioPlayer/Interface/Controller/SpeedSelector/SpeedSelector.d.ts +10 -0
  28. package/dist/types/components/AudioPlayer/Interface/Controller/SpeedSelector/index.d.ts +2 -0
  29. package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/index.d.ts +7 -1
  30. package/dist/types/components/AudioPlayer/Interface/Information/Artwork.d.ts +3 -1
  31. package/dist/types/components/AudioPlayer/Interface/Information/TrackInfo.d.ts +3 -1
  32. package/dist/types/components/AudioPlayer/Interface/Information/TrackTime/index.d.ts +3 -1
  33. package/dist/types/components/AudioPlayer/Interface/PlayListEmpty/index.d.ts +6 -0
  34. package/dist/types/components/AudioPlayer/Interface/compound/index.d.ts +3 -0
  35. package/dist/types/components/AudioPlayer/Interface/compound/slotMetaMap.d.ts +10 -0
  36. package/dist/types/components/AudioPlayer/Interface/compound/useCompoundSlots.d.ts +6 -0
  37. package/dist/types/components/AudioPlayer/Interface/compound/useDuplicateSlotWarning.d.ts +7 -0
  38. package/dist/types/components/AudioPlayer/Interface/contexts/index.d.ts +2 -0
  39. package/dist/types/components/AudioPlayer/Interface/contexts/playListEmptyContext.d.ts +2 -0
  40. package/dist/types/components/AudioPlayer/Interface/contexts/playListPortalContext.d.ts +1 -0
  41. package/dist/types/components/AudioPlayer/Interface/hooks/index.d.ts +4 -0
  42. package/dist/types/components/AudioPlayer/Interface/hooks/useDropdownAutoPlacement.d.ts +5 -0
  43. package/dist/types/components/AudioPlayer/Interface/hooks/useGridTemplate.d.ts +3 -0
  44. package/dist/types/components/AudioPlayer/Interface/hooks/useResolvedDropdownProps.d.ts +18 -0
  45. package/dist/types/components/AudioPlayer/Interface/hooks/useResolvedGridArea.d.ts +2 -0
  46. package/dist/types/components/AudioPlayer/Player/index.d.ts +2 -2
  47. package/dist/types/components/AudioPlayer/Provider/AudioPlayerStateProvider.d.ts +2 -2
  48. package/dist/types/components/AudioPlayer/index.d.ts +28 -5
  49. package/dist/types/components/Drawer/Drawer.d.ts +1 -0
  50. package/dist/types/components/Grid/Item.d.ts +3 -2
  51. package/dist/types/components/Grid/index.d.ts +1 -0
  52. package/dist/types/hooks/index.d.ts +1 -2
  53. package/dist/types/index.d.ts +2 -2
  54. package/dist/types/utils/ssr.d.ts +0 -2
  55. package/llms.txt +61 -0
  56. package/package.json +4 -2
  57. package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/useVolume.d.ts +0 -5
  58. package/dist/types/hooks/context/useAudioAttrsContext.d.ts +0 -2
  59. package/dist/types/hooks/context/usePlaybackContext.d.ts +0 -2
  60. package/dist/types/hooks/context/useResourceContext.d.ts +0 -2
  61. package/dist/types/hooks/context/useTimeContext.d.ts +0 -2
  62. package/dist/types/hooks/context/useTrackContext.d.ts +0 -2
  63. package/dist/types/hooks/context/useUIContext.d.ts +0 -1
  64. package/dist/types/hooks/useGridTemplate.d.ts +0 -2
  65. /package/dist/types/components/AudioPlayer/Interface/Controller/Button/{NextBtn.d.ts → TransportControls/NextBtn.d.ts} +0 -0
  66. /package/dist/types/components/AudioPlayer/Interface/Controller/Button/{PlayBtn.d.ts → TransportControls/PlayBtn.d.ts} +0 -0
  67. /package/dist/types/components/AudioPlayer/Interface/Controller/Button/{PrevBtn.d.ts → TransportControls/PrevBtn.d.ts} +0 -0
  68. /package/dist/types/{utils → components/AudioPlayer/utils}/clampVolume.d.ts +0 -0
  69. /package/dist/types/hooks/{context/useNonNullableContext.d.ts → useNonNullableContext.d.ts} +0 -0
package/dist/index.es.js CHANGED
@@ -1,16 +1,17 @@
1
1
  "use client";
2
2
  import './index.css';
3
- import { jsx as i, Fragment as z, jsxs as w } from "react/jsx-runtime";
4
- import te, { createContext as H, useReducer as it, useMemo as D, useContext as lt, forwardRef as ve, useCallback as f, useRef as A, useEffect as E, memo as W, useState as C, useId as Ne, useLayoutEffect as ct, cloneElement as ut } from "react";
5
- import dt, { flushSync as be } from "react-dom";
6
- const F = {
3
+ import { jsx as c, Fragment as G, jsxs as w } from "react/jsx-runtime";
4
+ import te, { createContext as K, useContext as he, useReducer as xt, useMemo as x, forwardRef as Pe, useCallback as E, useRef as S, useEffect as P, memo as z, useState as N, useId as $e, useLayoutEffect as Mt, cloneElement as _t, isValidElement as Dt } from "react";
5
+ import Rt, { flushSync as Fe } from "react-dom";
6
+ const O = {
7
7
  isPlaying: !1,
8
8
  volume: 1,
9
9
  muted: !1,
10
10
  repeatType: "ALL",
11
11
  currentTime: 0,
12
- duration: 0
13
- }, pr = 10, N = {
12
+ duration: 0,
13
+ playbackRate: 1
14
+ }, Or = 11, de = {
14
15
  templateArea: {
15
16
  artwork: "row1-1",
16
17
  trackInfo: "row1-2",
@@ -20,17 +21,18 @@ const F = {
20
21
  repeatType: "row1-6",
21
22
  volume: "row1-7",
22
23
  playButton: "row1-8",
23
- playList: "row1-9"
24
+ playList: "row1-9",
25
+ playbackRate: "row1-10"
24
26
  }
25
- }, P = H(null);
26
- P.displayName = "AudioPlayerDispatchContext";
27
- const Ce = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Le = (e, t) => Math.round(Math.random() * (t - e) + e), mt = 1, ke = (e, t, o) => {
28
- if (o - t < 1) return e;
29
- let r = Le(t, o);
30
- for (; r === e; )
31
- r = Le(t, o);
32
- return r;
33
- }, pt = (e, t) => {
27
+ }, b = K(null);
28
+ b.displayName = "AudioPlayerDispatchContext";
29
+ const He = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Ke = (e, t) => Math.round(Math.random() * (t - e) + e), Ut = 1, Ve = (e, t, n) => {
30
+ if (n - t < 1) return e;
31
+ let a = Ke(t, n);
32
+ for (; a === e; )
33
+ a = Ke(t, n);
34
+ return a;
35
+ }, Ot = (e, t) => {
34
36
  switch (t.type) {
35
37
  case "NEXT_AUDIO": {
36
38
  if (e.playList.length === 0) return e;
@@ -51,7 +53,7 @@ const Ce = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Le = (e, t) =>
51
53
  audioResetKey: e.audioResetKey + 1,
52
54
  curAudioState: { ...e.curAudioState, currentTime: 0 }
53
55
  };
54
- const r = ke(
56
+ const a = Ve(
55
57
  e.curIdx,
56
58
  0,
57
59
  e.playList.length - 1
@@ -59,8 +61,8 @@ const Ce = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Le = (e, t) =>
59
61
  return {
60
62
  ...e,
61
63
  audioResetKey: e.audioResetKey + 1,
62
- curPlayId: e.playList[r].id,
63
- curIdx: r,
64
+ curPlayId: e.playList[a].id,
65
+ curIdx: a,
64
66
  curAudioState: {
65
67
  ...e.curAudioState,
66
68
  isLoadedMetaData: !1,
@@ -68,41 +70,43 @@ const Ce = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Le = (e, t) =>
68
70
  }
69
71
  };
70
72
  }
71
- const o = (e.curIdx + 1) % e.playList.length;
73
+ const n = (e.curIdx + 1) % e.playList.length;
72
74
  return {
73
75
  ...e,
74
76
  audioResetKey: e.audioResetKey + 1,
75
- curIdx: o,
76
- curPlayId: e.playList[o].id,
77
+ curIdx: n,
78
+ curPlayId: e.playList[n].id,
77
79
  curAudioState: { ...e.curAudioState, currentTime: 0 }
78
80
  };
79
81
  }
80
82
  case "PREV_AUDIO": {
81
- const o = e.playList.length <= 1, r = t.currentTime > mt, a = e.curAudioState.repeatType === "NONE" && e.curIdx === 0;
82
- if (o || r || a)
83
+ const n = e.playList.length <= 1, a = t.currentTime > Ut, r = e.curAudioState.repeatType === "NONE" && e.curIdx === 0;
84
+ if (n || a || r)
83
85
  return {
84
86
  ...e,
85
87
  audioResetKey: e.audioResetKey + 1,
86
88
  curAudioState: { ...e.curAudioState, currentTime: 0 }
87
89
  };
88
90
  if (e.curAudioState.repeatType === "SHUFFLE") {
89
- const n = ke(
91
+ const s = Ve(
90
92
  e.curIdx,
91
93
  0,
92
94
  e.playList.length - 1
93
95
  );
94
96
  return {
95
97
  ...e,
96
- curPlayId: e.playList[n].id,
97
- curIdx: n,
98
+ audioResetKey: e.audioResetKey + 1,
99
+ curPlayId: e.playList[s].id,
100
+ curIdx: s,
98
101
  curAudioState: { ...e.curAudioState, currentTime: 0 }
99
102
  };
100
103
  }
101
- const s = (e.curIdx - 1 + e.playList.length) % e.playList.length;
104
+ const i = (e.curIdx - 1 + e.playList.length) % e.playList.length;
102
105
  return {
103
106
  ...e,
104
- curPlayId: e.playList[s].id,
105
- curIdx: s,
107
+ audioResetKey: e.audioResetKey + 1,
108
+ curPlayId: e.playList[i].id,
109
+ curIdx: i,
106
110
  curAudioState: {
107
111
  ...e.curAudioState,
108
112
  isLoadedMetaData: !1,
@@ -126,7 +130,7 @@ const Ce = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Le = (e, t) =>
126
130
  }
127
131
  };
128
132
  if (!t.playList.find(
129
- (a) => a.id === e.curPlayId
133
+ (r) => r.id === e.curPlayId
130
134
  ))
131
135
  return {
132
136
  ...e,
@@ -140,13 +144,13 @@ const Ce = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Le = (e, t) =>
140
144
  isLoadedMetaData: !1
141
145
  }
142
146
  };
143
- const r = t.playList.findIndex(
144
- (a) => a.id === e.curPlayId
147
+ const a = t.playList.findIndex(
148
+ (r) => r.id === e.curPlayId
145
149
  );
146
150
  return {
147
151
  ...e,
148
152
  playList: t.playList,
149
- curIdx: r
153
+ curIdx: a
150
154
  };
151
155
  }
152
156
  case "SET_VOLUME":
@@ -154,7 +158,15 @@ const Ce = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Le = (e, t) =>
154
158
  ...e,
155
159
  curAudioState: {
156
160
  ...e.curAudioState,
157
- volume: Ce(t.volume)
161
+ volume: He(t.volume)
162
+ }
163
+ };
164
+ case "SET_PLAYBACK_RATE":
165
+ return {
166
+ ...e,
167
+ curAudioState: {
168
+ ...e.curAudioState,
169
+ playbackRate: t.playbackRate
158
170
  }
159
171
  };
160
172
  case "SET_AUDIO_STATE":
@@ -247,370 +259,396 @@ const Ce = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Le = (e, t) =>
247
259
  default:
248
260
  throw new Error("Unhandled action");
249
261
  }
250
- }, Te = H(null);
251
- Te.displayName = "PlaybackContext";
252
- const he = H(null);
253
- he.displayName = "AudioAttrsContext";
254
- const fe = H(null);
255
- fe.displayName = "TrackContext";
256
- const ge = H(null);
257
- ge.displayName = "UIContext";
258
- const Ae = H(null);
259
- Ae.displayName = "ResourceContext";
260
- const Ee = H(null);
261
- Ee.displayName = "TimeContext";
262
- function yt(e) {
262
+ }, Se = K(null);
263
+ Se.displayName = "PlaybackContext";
264
+ const Ie = K(null);
265
+ Ie.displayName = "AudioAttrsContext";
266
+ const we = K(null);
267
+ we.displayName = "TrackContext";
268
+ const be = K(null);
269
+ be.displayName = "UIContext";
270
+ const Le = K(null);
271
+ Le.displayName = "ResourceContext";
272
+ const Ne = K(null);
273
+ Ne.displayName = "TimeContext";
274
+ const A = (e) => {
275
+ const t = he(e);
276
+ if (!t) {
277
+ const n = e.displayName || "Context";
278
+ throw new Error(`${n} is not provided`);
279
+ }
280
+ return t;
281
+ }, k = () => A(Se), re = () => A(Ne), $ = () => A(we), M = () => A(be), L = () => A(Le), Kt = () => A(Ie);
282
+ function Vt(e) {
263
283
  const {
264
284
  playList: t,
265
- audioInitialState: o,
266
- activeUI: r,
267
- placement: a,
268
- customIcons: s,
269
- coverImgsCss: n
270
- } = e, c = {
271
- isPlaying: (o == null ? void 0 : o.isPlaying) ?? F.isPlaying,
272
- repeatType: (o == null ? void 0 : o.repeatType) ?? F.repeatType,
273
- volume: typeof (o == null ? void 0 : o.volume) == "number" ? Ce(o.volume) : F.volume,
274
- muted: (o == null ? void 0 : o.muted) ?? F.muted
275
- }, d = r || { playButton: !0 }, m = {
276
- playerPlacement: a == null ? void 0 : a.player,
277
- playListPlacement: (a == null ? void 0 : a.playList) || "bottom",
278
- interfacePlacement: (a == null ? void 0 : a.interface) || {
285
+ audioInitialState: n,
286
+ activeUI: a,
287
+ placement: r,
288
+ customIcons: i,
289
+ coverImgsCss: s
290
+ } = e, o = {
291
+ isPlaying: (n == null ? void 0 : n.isPlaying) ?? O.isPlaying,
292
+ repeatType: (n == null ? void 0 : n.repeatType) ?? O.repeatType,
293
+ volume: typeof (n == null ? void 0 : n.volume) == "number" ? He(n.volume) : O.volume,
294
+ muted: (n == null ? void 0 : n.muted) ?? O.muted,
295
+ playbackRate: (n == null ? void 0 : n.playbackRate) ?? O.playbackRate
296
+ }, u = a || { playButton: !0 }, d = {
297
+ playerPlacement: r == null ? void 0 : r.player,
298
+ playListPlacement: (r == null ? void 0 : r.playList) || "bottom",
299
+ interfacePlacement: (r == null ? void 0 : r.interface) || {
279
300
  templateArea: {
280
- playButton: N.templateArea.playButton
301
+ playButton: de.templateArea.playButton
281
302
  }
282
303
  },
283
- volumeSliderPlacement: a == null ? void 0 : a.volumeSlider
284
- }, l = t.length === 0, y = o == null ? void 0 : o.curPlayId, u = y == null ? -1 : t.findIndex((p) => p.id === y);
304
+ volumeSliderPlacement: r == null ? void 0 : r.volumeSlider,
305
+ speedSelectorPlacement: r == null ? void 0 : r.speedSelector
306
+ }, l = t.length === 0, m = n == null ? void 0 : n.curPlayId, p = m == null ? -1 : t.findIndex((v) => v.id === m);
285
307
  return {
286
308
  playList: t,
287
- curPlayId: l ? 0 : u >= 0 ? y : t[0].id,
288
- curIdx: l ? -1 : u >= 0 ? u : 0,
289
- curAudioState: c,
290
- activeUI: d,
309
+ curPlayId: l ? 0 : p >= 0 ? m : t[0].id,
310
+ curIdx: l ? -1 : p >= 0 ? p : 0,
311
+ curAudioState: o,
312
+ activeUI: u,
291
313
  audioResetKey: 0,
292
314
  seekRequestKey: 0,
293
- ...m,
294
- customIcons: s,
295
- coverImgsCss: n
315
+ ...d,
316
+ customIcons: i,
317
+ coverImgsCss: s
296
318
  };
297
319
  }
298
- const vt = ({
320
+ const Bt = ({
299
321
  children: e,
300
322
  colorScheme: t,
301
- ...o
323
+ ...n
302
324
  }) => {
303
- var u, p;
304
- const [r, a] = it(
305
- pt,
306
- o,
307
- yt
308
- ), s = D(
325
+ var v, f;
326
+ const [a, r] = xt(
327
+ Ot,
328
+ n,
329
+ Vt
330
+ ), i = x(
309
331
  () => ({
310
- currentTime: r.curAudioState.currentTime ?? F.currentTime,
311
- duration: r.curAudioState.duration ?? F.duration,
312
- seekRequestKey: r.seekRequestKey
332
+ currentTime: a.curAudioState.currentTime ?? O.currentTime,
333
+ duration: a.curAudioState.duration ?? O.duration,
334
+ seekRequestKey: a.seekRequestKey
313
335
  }),
314
336
  [
315
- r.curAudioState.currentTime,
316
- r.curAudioState.duration,
317
- r.seekRequestKey
337
+ a.curAudioState.currentTime,
338
+ a.curAudioState.duration,
339
+ a.seekRequestKey
318
340
  ]
319
- ), n = D(
341
+ ), s = x(
320
342
  () => ({
321
- isPlaying: r.curAudioState.isPlaying ?? F.isPlaying,
322
- volume: r.curAudioState.volume ?? F.volume,
323
- muted: r.curAudioState.muted ?? F.muted,
324
- repeatType: r.curAudioState.repeatType,
325
- isLoadedMetaData: r.curAudioState.isLoadedMetaData,
326
- audioResetKey: r.audioResetKey
343
+ isPlaying: a.curAudioState.isPlaying ?? O.isPlaying,
344
+ volume: a.curAudioState.volume ?? O.volume,
345
+ muted: a.curAudioState.muted ?? O.muted,
346
+ repeatType: a.curAudioState.repeatType,
347
+ isLoadedMetaData: a.curAudioState.isLoadedMetaData,
348
+ audioResetKey: a.audioResetKey,
349
+ playbackRate: a.curAudioState.playbackRate ?? O.playbackRate
327
350
  }),
328
351
  [
329
- r.curAudioState.isPlaying,
330
- r.curAudioState.isLoadedMetaData,
331
- r.curAudioState.volume,
332
- r.curAudioState.muted,
333
- r.curAudioState.repeatType,
334
- r.audioResetKey
352
+ a.curAudioState.isPlaying,
353
+ a.curAudioState.isLoadedMetaData,
354
+ a.curAudioState.volume,
355
+ a.curAudioState.muted,
356
+ a.curAudioState.repeatType,
357
+ a.curAudioState.playbackRate,
358
+ a.audioResetKey
335
359
  ]
336
- ), c = D(
360
+ ), o = x(
337
361
  () => ({
338
- playList: r.playList,
339
- curPlayId: r.curPlayId,
340
- curIdx: r.curIdx
362
+ playList: a.playList,
363
+ curPlayId: a.curPlayId,
364
+ curIdx: a.curIdx
341
365
  }),
342
- [r.playList, r.curPlayId, r.curIdx]
343
- ), d = D(
366
+ [a.playList, a.curPlayId, a.curIdx]
367
+ ), { audioInitialState: u } = n, d = u == null ? void 0 : u.playListExpanded, l = x(
344
368
  () => ({
345
- activeUI: r.activeUI,
346
- playListPlacement: r.playListPlacement,
347
- playerPlacement: r.playerPlacement,
348
- interfacePlacement: r.interfacePlacement,
349
- volumeSliderPlacement: r.volumeSliderPlacement,
350
- colorScheme: t
369
+ activeUI: a.activeUI,
370
+ playListPlacement: a.playListPlacement,
371
+ playerPlacement: a.playerPlacement,
372
+ interfacePlacement: a.interfacePlacement,
373
+ volumeSliderPlacement: a.volumeSliderPlacement,
374
+ speedSelectorPlacement: a.speedSelectorPlacement,
375
+ colorScheme: t,
376
+ playListExpanded: d
351
377
  }),
352
378
  [
353
- r.activeUI,
354
- r.playListPlacement,
355
- r.playerPlacement,
356
- r.interfacePlacement,
357
- r.volumeSliderPlacement,
358
- t
379
+ a.activeUI,
380
+ a.playListPlacement,
381
+ a.playerPlacement,
382
+ a.interfacePlacement,
383
+ a.volumeSliderPlacement,
384
+ a.speedSelectorPlacement,
385
+ t,
386
+ d
359
387
  ]
360
- ), { audioInitialState: m } = o, l = D(() => {
361
- if (!m) return {};
388
+ ), m = x(() => {
389
+ if (!u) return {};
362
390
  const {
363
- isPlaying: T,
364
- repeatType: v,
391
+ isPlaying: y,
392
+ repeatType: T,
365
393
  isLoadedMetaData: h,
366
- currentTime: S,
367
- duration: k,
368
- volume: B,
369
- muted: R,
370
- curPlayId: G,
371
- ...ae
372
- } = m;
373
- return ae;
374
- }, [m]), y = D(
394
+ currentTime: g,
395
+ duration: C,
396
+ volume: W,
397
+ muted: se,
398
+ playbackRate: R,
399
+ curPlayId: ce,
400
+ playListExpanded: ae,
401
+ ...ye
402
+ } = u;
403
+ return ye;
404
+ }, [u]), p = x(
375
405
  () => ({
376
- elementRefs: r.elementRefs,
377
- customIcons: r.customIcons,
378
- coverImgsCss: r.coverImgsCss
406
+ elementRefs: a.elementRefs,
407
+ customIcons: a.customIcons,
408
+ coverImgsCss: a.coverImgsCss
379
409
  }),
380
410
  [
381
- (u = r.elementRefs) == null ? void 0 : u.audioEl,
382
- (p = r.elementRefs) == null ? void 0 : p.waveformInst,
383
- r.customIcons,
384
- r.coverImgsCss
411
+ (v = a.elementRefs) == null ? void 0 : v.audioEl,
412
+ (f = a.elementRefs) == null ? void 0 : f.waveformInst,
413
+ a.customIcons,
414
+ a.coverImgsCss
385
415
  ]
386
416
  );
387
- return /* @__PURE__ */ i(Ee.Provider, { value: s, children: /* @__PURE__ */ i(Te.Provider, { value: n, children: /* @__PURE__ */ i(fe.Provider, { value: c, children: /* @__PURE__ */ i(ge.Provider, { value: d, children: /* @__PURE__ */ i(Ae.Provider, { value: y, children: /* @__PURE__ */ i(he.Provider, { value: l, children: /* @__PURE__ */ i(P.Provider, { value: a, children: e }) }) }) }) }) }) });
388
- }, g = (e) => {
389
- const t = lt(e);
390
- if (!t) {
391
- const o = e.displayName || "Context";
392
- throw new Error(`${o} is not provided`);
393
- }
394
- return t;
395
- }, O = () => g(ge), J = {
417
+ return /* @__PURE__ */ c(Ne.Provider, { value: i, children: /* @__PURE__ */ c(Se.Provider, { value: s, children: /* @__PURE__ */ c(we.Provider, { value: o, children: /* @__PURE__ */ c(be.Provider, { value: l, children: /* @__PURE__ */ c(Le.Provider, { value: p, children: /* @__PURE__ */ c(Ie.Provider, { value: m, children: /* @__PURE__ */ c(b.Provider, { value: r, children: e }) }) }) }) }) }) });
418
+ }, J = {
396
419
  top: "auto",
397
420
  right: "auto",
398
421
  bottom: "auto",
399
422
  left: "auto"
400
- }, Tt = {
423
+ }, $t = {
401
424
  bottom: { ...J, bottom: 0 },
402
425
  top: { ...J, top: 0 },
403
426
  "bottom-left": { ...J, bottom: 0, left: 0 },
404
427
  "bottom-right": { ...J, bottom: 0, right: 0 },
405
428
  "top-left": { ...J, top: 0, left: 0 },
406
429
  "top-right": { ...J, top: 0, right: 0 }
407
- }, Me = te.memo(({ children: e, rootContainerProps: t }) => {
408
- const { playerPlacement: o, colorScheme: r } = O(), a = D(
409
- () => o ? Tt[o] : void 0,
410
- [o]
411
- ), n = {
430
+ }, Ge = te.memo(({ children: e, rootContainerProps: t }) => {
431
+ const { playerPlacement: n, colorScheme: a } = M(), r = x(
432
+ () => n ? $t[n] : void 0,
433
+ [n]
434
+ ), s = {
412
435
  width: "100%",
413
- position: o !== "static" && !!o ? "fixed" : "static",
414
- ...a,
436
+ position: n !== "static" && !!n ? "fixed" : "static",
437
+ ...r,
415
438
  ...(t == null ? void 0 : t.style) ?? {}
416
439
  };
417
- return /* @__PURE__ */ i(
440
+ return /* @__PURE__ */ c(
418
441
  "div",
419
442
  {
420
443
  ...t,
421
444
  className: `rmap-player-provider${t != null && t.className ? ` ${t.className}` : ""}`,
422
- "data-theme": r ?? void 0,
423
- style: n,
445
+ "data-theme": a ?? void 0,
446
+ style: s,
424
447
  children: e
425
448
  }
426
449
  );
427
450
  });
428
- Me.displayName = "AudioPlayerContainer";
429
- const ht = ({
451
+ Ge.displayName = "AudioPlayerContainer";
452
+ const Ft = ({
430
453
  areas: e,
431
454
  columns: t,
432
- alignItems: o,
433
- justifyContent: r,
434
- minHeight: a,
435
- UNSAFE_className: s,
436
- children: n
455
+ alignItems: n,
456
+ justifyContent: a,
457
+ minHeight: r,
458
+ UNSAFE_className: i,
459
+ children: s
437
460
  }) => {
438
- const c = {
461
+ const o = {
439
462
  display: "grid",
440
- gridTemplateAreas: e == null ? void 0 : e.map((d) => `"${d}"`).join(" "),
463
+ gridTemplateAreas: e == null ? void 0 : e.map((u) => `"${u}"`).join(" "),
441
464
  gridTemplateColumns: t == null ? void 0 : t.join(" "),
442
- alignItems: o,
443
- justifyContent: r,
444
- minHeight: a
465
+ alignItems: n,
466
+ justifyContent: a,
467
+ minHeight: r
445
468
  };
446
- return /* @__PURE__ */ i("div", { className: s, style: c, children: n });
447
- }, ft = ht, xe = ve(
469
+ return /* @__PURE__ */ c("div", { className: i, style: o, children: s });
470
+ }, Ht = Ft, ze = Pe(
448
471
  ({
449
472
  children: e,
450
473
  visible: t = !0,
451
- gridArea: o,
452
- width: r,
453
- justifySelf: a = "center",
454
- padding: s,
455
- UNSAFE_className: n,
456
- style: c,
457
- ...d
458
- }, m) => {
474
+ gridArea: n,
475
+ width: a,
476
+ justifySelf: r = "center",
477
+ padding: i,
478
+ UNSAFE_className: s,
479
+ style: o,
480
+ ...u
481
+ }, d) => {
459
482
  if (!t) return null;
460
483
  const l = {
461
- gridArea: o,
462
- width: r,
463
- justifySelf: a,
464
- padding: s ?? "0 5px",
465
- ...c
484
+ gridArea: n,
485
+ width: a,
486
+ justifySelf: r,
487
+ padding: i ?? "0 5px",
488
+ ...o
466
489
  };
467
- return /* @__PURE__ */ i("div", { ref: m, className: n, style: l, ...d, children: e });
490
+ return /* @__PURE__ */ c("div", { ref: d, className: s, style: l, ...u, children: e });
468
491
  }
469
492
  );
470
- xe.displayName = "GridItem";
471
- const M = ft;
472
- M.Item = xe;
473
- const b = () => g(Te), re = () => g(Ee), V = () => g(fe), L = () => g(Ae), _e = ({
493
+ ze.displayName = "GridItem";
494
+ const _ = Ht;
495
+ _.Item = ze;
496
+ const Gt = ({
474
497
  children: e,
475
498
  id: t,
476
- ...o
499
+ ...n
477
500
  }) => {
478
- var l, y;
479
- const r = b(), a = re(), s = V(), n = O(), c = L(), d = {
501
+ var l, m;
502
+ const a = k(), r = re(), i = $(), s = M(), o = L(), u = {
480
503
  curAudioState: {
481
- isPlaying: r.isPlaying,
482
- volume: r.volume,
483
- muted: r.muted,
484
- repeatType: r.repeatType,
485
- isLoadedMetaData: r.isLoadedMetaData,
486
- currentTime: a.currentTime,
487
- duration: a.duration
504
+ isPlaying: a.isPlaying,
505
+ volume: a.volume,
506
+ muted: a.muted,
507
+ repeatType: a.repeatType,
508
+ isLoadedMetaData: a.isLoadedMetaData,
509
+ currentTime: r.currentTime,
510
+ duration: r.duration
488
511
  },
489
- audioResetKey: r.audioResetKey,
490
- ...a,
512
+ audioResetKey: a.audioResetKey,
513
+ ...r,
514
+ ...i,
491
515
  ...s,
492
- ...n,
493
- ...c
494
- }, m = (y = (l = n.interfacePlacement) == null ? void 0 : l.customComponentsArea) == null ? void 0 : y[t];
495
- return /* @__PURE__ */ i(
496
- M.Item,
516
+ ...o
517
+ }, d = (m = (l = s.interfacePlacement) == null ? void 0 : l.customComponentsArea) == null ? void 0 : m[t];
518
+ return /* @__PURE__ */ c(
519
+ _.Item,
497
520
  {
498
521
  UNSAFE_className: "rmap-custom-component",
499
- gridArea: m,
500
- ...o,
501
- children: te.cloneElement(e, { audioPlayerState: d })
522
+ gridArea: d,
523
+ ...n,
524
+ children: te.cloneElement(e, { audioPlayerState: u })
502
525
  }
503
526
  );
504
- }, gt = () => g(he), At = () => {
527
+ }, We = "PlayListEmpty", je = () => null;
528
+ je.displayName = We;
529
+ const zt = () => {
505
530
  const {
506
531
  isPlaying: e,
507
532
  volume: t,
508
- repeatType: o,
509
- audioResetKey: r
510
- } = b(), { currentTime: a, seekRequestKey: s } = re(), { elementRefs: n } = L(), c = g(P), d = f(
511
- (p) => {
512
- if (p.currentTarget.readyState === 0) return;
513
- const T = p.currentTarget.currentTime;
514
- c({
533
+ repeatType: n,
534
+ audioResetKey: a,
535
+ playbackRate: r
536
+ } = k(), { currentTime: i, seekRequestKey: s } = re(), { elementRefs: o } = L(), u = A(b), d = E(
537
+ (y) => {
538
+ if (y.currentTarget.readyState === 0) return;
539
+ const T = y.currentTarget.currentTime;
540
+ u({
515
541
  type: "SET_AUDIO_STATE",
516
542
  audioState: { currentTime: T }
517
543
  });
518
544
  },
519
- [c]
520
- ), m = f(() => {
521
- if (n != null && n.audioEl) {
522
- if (o === "ONE") {
523
- be(() => {
524
- c({ type: "SEEK", time: 0 });
525
- }), n.audioEl.play();
545
+ [u]
546
+ ), l = E(() => {
547
+ if (o != null && o.audioEl) {
548
+ if (n === "ONE") {
549
+ Fe(() => {
550
+ u({ type: "SEEK", time: 0 });
551
+ }), o.audioEl.play();
526
552
  return;
527
553
  }
528
- c({ type: "NEXT_AUDIO" });
554
+ u({ type: "NEXT_AUDIO" });
529
555
  }
530
- }, [c, o, n == null ? void 0 : n.audioEl]), l = f(
531
- (p) => {
532
- const { duration: T } = p.currentTarget;
533
- t != null && (p.currentTarget.volume = t), c({
556
+ }, [u, n, o == null ? void 0 : o.audioEl]), m = E(
557
+ (y) => {
558
+ t != null && (y.volume = t), r != null && (y.playbackRate = r);
559
+ },
560
+ [t, r]
561
+ ), p = E(
562
+ (y) => {
563
+ const { duration: T } = y.currentTarget;
564
+ m(y.currentTarget), u({
534
565
  type: "SET_AUDIO_STATE",
535
566
  audioState: { isLoadedMetaData: !0, duration: T }
536
567
  });
537
568
  },
538
- [c, t]
539
- ), y = A(!1);
540
- E(() => {
541
- if (n != null && n.audioEl) {
542
- if (!y.current) {
543
- y.current = !0;
569
+ [u, m]
570
+ ), v = S(!1);
571
+ P(() => {
572
+ if (o != null && o.audioEl) {
573
+ if (!v.current) {
574
+ v.current = !0;
544
575
  return;
545
576
  }
546
- n.audioEl.currentTime = 0;
577
+ o.audioEl.currentTime = 0;
547
578
  }
548
- }, [r, n == null ? void 0 : n.audioEl]), E(() => {
549
- n != null && n.audioEl && (e ? n.audioEl.play().catch(() => {
550
- c({
579
+ }, [a, o == null ? void 0 : o.audioEl]), P(() => {
580
+ o != null && o.audioEl && (e ? o.audioEl.play().catch((y) => {
581
+ (y == null ? void 0 : y.name) !== "AbortError" && u({
551
582
  type: "SET_AUDIO_STATE",
552
583
  audioState: { isPlaying: !1 }
553
584
  });
554
- }) : n.audioEl.pause());
555
- }, [n == null ? void 0 : n.audioEl, e, c]), E(() => {
556
- !(n != null && n.audioEl) || t == null || (n.audioEl.volume = t);
557
- }, [n == null ? void 0 : n.audioEl, t]);
558
- const u = A(0);
559
- return E(() => {
560
- if (s === u.current) return;
561
- u.current = s;
562
- const p = n == null ? void 0 : n.audioEl;
563
- if (!p || a == null) return;
564
- p.currentTime = a;
565
- const T = n == null ? void 0 : n.waveformInst, v = p.duration, h = Number.isFinite(v) && v > 0;
566
- if (!T || !h) return;
567
- const S = a / v, k = Math.min(1, Math.max(0, S));
568
- T.seekTo(k);
585
+ }) : o.audioEl.pause());
586
+ }, [o == null ? void 0 : o.audioEl, e, u, a]), P(() => {
587
+ !(o != null && o.audioEl) || t == null || (o.audioEl.volume = t);
588
+ }, [o == null ? void 0 : o.audioEl, t]), P(() => {
589
+ !(o != null && o.audioEl) || r == null || (o.audioEl.playbackRate = r);
590
+ }, [o == null ? void 0 : o.audioEl, r]);
591
+ const f = S(0);
592
+ return P(() => {
593
+ if (s === f.current) return;
594
+ f.current = s;
595
+ const y = o == null ? void 0 : o.audioEl;
596
+ if (!y || i == null) return;
597
+ y.currentTime = i;
598
+ const T = o == null ? void 0 : o.waveformInst, h = y.duration, g = Number.isFinite(h) && h > 0;
599
+ if (!T || !g) return;
600
+ const C = i / h, W = Math.min(1, Math.max(0, C));
601
+ T.seekTo(W);
569
602
  }, [
570
603
  s,
571
- a,
572
- n == null ? void 0 : n.audioEl,
573
- n == null ? void 0 : n.waveformInst
604
+ i,
605
+ o == null ? void 0 : o.audioEl,
606
+ o == null ? void 0 : o.waveformInst
574
607
  ]), {
575
608
  onTimeUpdate: d,
576
- onEnded: m,
577
- onLoadedMetadata: l
609
+ onEnded: l,
610
+ onLoadedMetadata: p
578
611
  };
579
- }, De = te.memo(({ audioRef: e }) => {
580
- const t = A(null), { muted: o } = b(), { curPlayId: r, playList: a } = V(), s = gt(), n = g(P), c = a.find(
581
- (m) => m.id === r
582
- ), d = At();
583
- return E(() => {
584
- t.current && (n({
612
+ }, Ye = te.memo(({ audioRef: e }) => {
613
+ const t = S(null), { muted: n } = k(), { curPlayId: a, playList: r } = $(), i = Kt(), s = A(b), o = r.find(
614
+ (d) => d.id === a
615
+ ), u = zt();
616
+ return P(() => {
617
+ t.current && (s({
585
618
  type: "SET_ELEMENT_REFS",
586
619
  elementRefs: { audioEl: t.current }
587
620
  }), e && (e.current = t.current));
588
- }, [n, e]), /* @__PURE__ */ i(
621
+ }, [s, e]), /* @__PURE__ */ c(
589
622
  "audio",
590
623
  {
591
624
  id: "rm-audio-player-audio",
592
- ...s,
593
- muted: o,
625
+ ...i,
626
+ muted: n,
594
627
  ref: t,
595
- src: c == null ? void 0 : c.src,
596
- ...d
628
+ src: o == null ? void 0 : o.src,
629
+ ...u
597
630
  }
598
631
  );
599
632
  });
600
- De.displayName = "Audio";
601
- const q = ve(({ className: e, type: t = "button", ...o }, r) => /* @__PURE__ */ i(
633
+ Ye.displayName = "Audio";
634
+ function B(e, t) {
635
+ var a, r;
636
+ const { interfacePlacement: n } = M();
637
+ return t ?? ((a = n == null ? void 0 : n.itemCustomArea) == null ? void 0 : a[e]) ?? ((r = n == null ? void 0 : n.templateArea) == null ? void 0 : r[e]) ?? de.templateArea[e];
638
+ }
639
+ const q = Pe(({ className: e, type: t = "button", ...n }, a) => /* @__PURE__ */ c(
602
640
  "button",
603
641
  {
604
- ref: r,
642
+ ref: a,
605
643
  type: t,
606
644
  className: `styled-btn${e ? ` ${e}` : ""}`,
607
- ...o
645
+ ...n
608
646
  }
609
647
  ));
610
648
  q.displayName = "StyledBtn";
611
- const Ie = (e) => (
649
+ const ke = (e) => (
612
650
  // eslint-disable-next-line react/display-name
613
- ({ size: t = "1em", color: o, style: r, ...a }) => /* @__PURE__ */ i(
651
+ ({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */ c(
614
652
  "svg",
615
653
  {
616
654
  "aria-hidden": "true",
@@ -621,16 +659,16 @@ const Ie = (e) => (
621
659
  viewBox: "0 0 24 24",
622
660
  height: t,
623
661
  width: t,
624
- color: o,
625
- style: o ? { color: o, ...r } : r,
662
+ color: n,
663
+ style: n ? { color: n, ...a } : a,
626
664
  xmlns: "http://www.w3.org/2000/svg",
627
- ...a,
665
+ ...r,
628
666
  dangerouslySetInnerHTML: { __html: e }
629
667
  }
630
668
  )
631
- ), Y = (e) => (
669
+ ), X = (e) => (
632
670
  // eslint-disable-next-line react/display-name
633
- ({ size: t = "1em", color: o, style: r, ...a }) => /* @__PURE__ */ i(
671
+ ({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */ c(
634
672
  "svg",
635
673
  {
636
674
  "aria-hidden": "true",
@@ -643,16 +681,16 @@ const Ie = (e) => (
643
681
  strokeLinejoin: "round",
644
682
  height: t,
645
683
  width: t,
646
- color: o,
647
- style: o ? { color: o, ...r } : r,
684
+ color: n,
685
+ style: n ? { color: n, ...a } : a,
648
686
  xmlns: "http://www.w3.org/2000/svg",
649
- ...a,
687
+ ...r,
650
688
  dangerouslySetInnerHTML: { __html: e }
651
689
  }
652
690
  )
653
- ), Oe = (e, t = "0 0 16 16") => (
691
+ ), qe = (e, t = "0 0 16 16") => (
654
692
  // eslint-disable-next-line react/display-name
655
- ({ size: o = "1em", color: r, style: a, ...s }) => /* @__PURE__ */ i(
693
+ ({ size: n = "1em", color: a, style: r, ...i }) => /* @__PURE__ */ c(
656
694
  "svg",
657
695
  {
658
696
  "aria-hidden": "true",
@@ -661,358 +699,404 @@ const Ie = (e) => (
661
699
  fill: "currentColor",
662
700
  strokeWidth: 0,
663
701
  viewBox: t,
664
- height: o,
665
- width: o,
666
- color: r,
667
- style: r ? { color: r, ...a } : a,
702
+ height: n,
703
+ width: n,
704
+ color: a,
705
+ style: a ? { color: a, ...r } : r,
668
706
  xmlns: "http://www.w3.org/2000/svg",
669
- ...s,
707
+ ...i,
670
708
  dangerouslySetInnerHTML: { __html: e }
671
709
  }
672
710
  )
673
- ), Ue = Ie(
711
+ ), Xe = ke(
674
712
  '<path fill="none" d="M0 0h24v24H0z"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z"/>'
675
713
  );
676
- Ue.displayName = "MdPlayCircleFilled";
677
- const Ve = Ie(
714
+ Xe.displayName = "MdPlayCircleFilled";
715
+ const Qe = ke(
678
716
  '<path fill="none" d="M0 0h24v24H0z"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"/>'
679
717
  );
680
- Ve.displayName = "MdPauseCircleFilled";
681
- const Be = Ie(
718
+ Qe.displayName = "MdPauseCircleFilled";
719
+ const Je = ke(
682
720
  '<path fill="none" d="M0 0h24v24H0z"/><path d="M3 10h11v2H3zM3 6h11v2H3zM3 14h7v2H3zM16 13v8l6-4z"/>'
683
721
  );
684
- Be.displayName = "MdPlaylistPlay";
685
- const Ke = Y(
722
+ Je.displayName = "MdPlaylistPlay";
723
+ const Ze = X(
686
724
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3"/>'
687
725
  );
688
- Ke.displayName = "TbRepeat";
689
- const $e = Y(
726
+ Ze.displayName = "TbRepeat";
727
+ const et = X(
690
728
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3"/><path d="M11 11l1 -1v4"/>'
691
729
  );
692
- $e.displayName = "TbRepeatOnce";
693
- const Fe = Y(
730
+ et.displayName = "TbRepeatOnce";
731
+ const tt = X(
694
732
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3c0 -1.336 .873 -2.468 2.08 -2.856m3.92 -.144h10m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -.133 .886m-1.99 1.984a3 3 0 0 1 -.877 .13h-13m3 3l-3 -3l3 -3"/><path d="M3 3l18 18"/>'
695
733
  );
696
- Fe.displayName = "TbRepeatOff";
697
- const He = Y(
734
+ tt.displayName = "TbRepeatOff";
735
+ const rt = X(
698
736
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 4l3 3l-3 3"/><path d="M18 20l3 -3l-3 -3"/><path d="M3 7h3a5 5 0 0 1 5 5a5 5 0 0 0 5 5h5"/><path d="M21 7h-5a4.978 4.978 0 0 0 -2.998 .998m-4.002 8.003a4.984 4.984 0 0 1 -3 .999h-3"/>'
699
737
  );
700
- He.displayName = "TbArrowsShuffle";
701
- const Re = Y(
738
+ rt.displayName = "TbArrowsShuffle";
739
+ const at = X(
702
740
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 8a5 5 0 0 1 0 8"/><path d="M17.7 5a9 9 0 0 1 0 14"/><path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"/>'
703
741
  );
704
- Re.displayName = "TbVolume";
705
- const ze = Y(
742
+ at.displayName = "TbVolume";
743
+ const nt = X(
706
744
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 8a5 5 0 0 1 0 8"/><path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"/>'
707
745
  );
708
- ze.displayName = "TbVolume2";
709
- const We = Y(
746
+ nt.displayName = "TbVolume2";
747
+ const ot = X(
710
748
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"/><path d="M16 10l4 4m0 -4l-4 4"/>'
711
749
  );
712
- We.displayName = "TbVolume3";
713
- const Ge = Oe(
750
+ ot.displayName = "TbVolume3";
751
+ const it = qe(
714
752
  '<path d="M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14.5c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5 6.5 2.91 6.5 6.5-2.91 6.5-6.5 6.5z"/><path d="M7 8l4-3v6z"/><path d="M5 5h2v6h-2v-6z"/>'
715
753
  );
716
- Ge.displayName = "ImPrevious";
717
- const je = Oe(
754
+ it.displayName = "ImPrevious";
755
+ const st = qe(
718
756
  '<path d="M8 0c4.418 0 8 3.582 8 8s-3.582 8-8 8-8-3.582-8-8 3.582-8 8-8zM8 14.5c3.59 0 6.5-2.91 6.5-6.5s-2.91-6.5-6.5-6.5-6.5 2.91-6.5 6.5 2.91 6.5 6.5 6.5z"/><path d="M9 8l-4-3v6z"/><path d="M11 5h-2v6h2v-6z"/>'
719
757
  );
720
- je.displayName = "ImNext";
721
- const x = ({ render: e, customIcon: t }) => /* @__PURE__ */ i(z, { children: t ?? e }), Et = W(function() {
722
- const { isPlaying: t } = b(), { customIcons: o } = L(), r = g(P);
723
- return /* @__PURE__ */ i(
758
+ st.displayName = "ImNext";
759
+ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?? e }), Wt = z(function() {
760
+ const { isPlaying: t } = k(), { customIcons: n } = L(), a = A(b);
761
+ return /* @__PURE__ */ c(
724
762
  q,
725
763
  {
726
764
  type: "button",
727
765
  "aria-label": t ? "Pause" : "Play",
728
- onClick: () => r({ type: "CHANGE_PLAYING_STATE" }),
766
+ onClick: () => a({ type: "CHANGE_PLAYING_STATE" }),
729
767
  className: "rmap-play-btn",
730
768
  "data-testid": "play-btn",
731
- children: t ? /* @__PURE__ */ i(
732
- x,
769
+ children: t ? /* @__PURE__ */ c(
770
+ D,
733
771
  {
734
- render: /* @__PURE__ */ i(Ve, {}),
735
- customIcon: o == null ? void 0 : o.pause
772
+ render: /* @__PURE__ */ c(Qe, {}),
773
+ customIcon: n == null ? void 0 : n.pause
736
774
  }
737
- ) : /* @__PURE__ */ i(x, { render: /* @__PURE__ */ i(Ue, {}), customIcon: o == null ? void 0 : o.play })
775
+ ) : /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(Xe, {}), customIcon: n == null ? void 0 : n.play })
738
776
  }
739
777
  );
740
- }), It = W(function({ isVisible: t }) {
741
- const { customIcons: o, elementRefs: r } = L(), a = g(P);
742
- return t ? /* @__PURE__ */ i(
778
+ }), jt = z(function({ isVisible: t }) {
779
+ const { customIcons: n, elementRefs: a } = L(), r = A(b);
780
+ return t ? /* @__PURE__ */ c(
743
781
  q,
744
782
  {
745
783
  type: "button",
746
784
  "aria-label": "Previous track",
747
785
  onClick: () => {
748
- var c;
749
- const n = ((c = r == null ? void 0 : r.audioEl) == null ? void 0 : c.currentTime) ?? 0;
750
- a({ type: "PREV_AUDIO", currentTime: n });
786
+ var o;
787
+ const s = ((o = a == null ? void 0 : a.audioEl) == null ? void 0 : o.currentTime) ?? 0;
788
+ r({ type: "PREV_AUDIO", currentTime: s });
751
789
  },
752
790
  className: "rmap-prev-btn",
753
791
  "data-testid": "prev-btn",
754
- children: /* @__PURE__ */ i(x, { render: /* @__PURE__ */ i(Ge, {}), customIcon: o == null ? void 0 : o.prev })
792
+ children: /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(it, {}), customIcon: n == null ? void 0 : n.prev })
755
793
  }
756
794
  ) : null;
757
- }), St = W(function({ isVisible: t }) {
758
- const { customIcons: o } = L(), r = g(P);
759
- return t ? /* @__PURE__ */ i(
795
+ }), Yt = z(function({ isVisible: t }) {
796
+ const { customIcons: n } = L(), a = A(b);
797
+ return t ? /* @__PURE__ */ c(
760
798
  q,
761
799
  {
762
800
  type: "button",
763
801
  "aria-label": "Next track",
764
802
  onClick: () => {
765
- r({ type: "NEXT_AUDIO" });
803
+ a({ type: "NEXT_AUDIO" });
766
804
  },
767
805
  className: "rmap-next-btn",
768
806
  "data-testid": "next-btn",
769
- children: /* @__PURE__ */ i(x, { render: /* @__PURE__ */ i(je, {}), customIcon: o == null ? void 0 : o.next })
807
+ children: /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(st, {}), customIcon: n == null ? void 0 : n.next })
770
808
  }
771
809
  ) : null;
772
- }), wt = {
810
+ }), ct = ({
811
+ gridArea: e,
812
+ visible: t,
813
+ ...n
814
+ }) => {
815
+ const { activeUI: a } = M(), r = !!(a.prevNnext ?? a.all), i = B("playButton", e);
816
+ return /* @__PURE__ */ c(_.Item, { gridArea: i, visible: t ?? !0, ...n, children: /* @__PURE__ */ w(
817
+ "div",
818
+ {
819
+ className: "rmap-ctrl-btn-wrapper",
820
+ role: "group",
821
+ "aria-label": "Playback controls",
822
+ children: [
823
+ /* @__PURE__ */ c(jt, { isVisible: r }),
824
+ /* @__PURE__ */ c(Wt, {}),
825
+ /* @__PURE__ */ c(Yt, { isVisible: r })
826
+ ]
827
+ }
828
+ ) });
829
+ }, qt = {
773
830
  ALL: "Repeat: All tracks",
774
831
  ONE: "Repeat: One track",
775
832
  NONE: "Repeat: Off",
776
833
  SHUFFLE: "Shuffle"
777
- }, Pt = {
834
+ }, Xt = {
778
835
  ALL: "ONE",
779
836
  ONE: "NONE",
780
837
  NONE: "SHUFFLE",
781
838
  SHUFFLE: "ALL"
782
- }, Lt = W(function() {
783
- const { repeatType: t } = b(), { customIcons: o } = L(), r = g(P), a = () => {
784
- r({
785
- type: "SET_REPEAT_TYPE",
786
- repeatType: Pt[t]
787
- });
788
- };
789
- return /* @__PURE__ */ w(
790
- q,
791
- {
792
- type: "button",
793
- "aria-label": wt[t],
794
- onClick: a,
795
- className: "rmap-repeat-btn",
796
- "data-testid": "repeat-btn",
797
- "data-repeattype": t,
798
- children: [
799
- t === "ALL" && /* @__PURE__ */ i(x, { render: /* @__PURE__ */ i(Ke, {}), customIcon: o == null ? void 0 : o.repeatAll }),
800
- t === "ONE" && /* @__PURE__ */ i(x, { render: /* @__PURE__ */ i($e, {}), customIcon: o == null ? void 0 : o.repeatOne }),
801
- t === "NONE" && /* @__PURE__ */ i(x, { render: /* @__PURE__ */ i(Fe, {}), customIcon: o == null ? void 0 : o.repeatNone }),
802
- t === "SHUFFLE" && /* @__PURE__ */ i(
803
- x,
839
+ }, lt = z(
840
+ function({ gridArea: t, visible: n, ...a }) {
841
+ const { repeatType: r } = k(), { customIcons: i } = L(), s = A(
842
+ b
843
+ ), o = () => {
844
+ s({
845
+ type: "SET_REPEAT_TYPE",
846
+ repeatType: Xt[r]
847
+ });
848
+ }, u = B("repeatType", t);
849
+ return /* @__PURE__ */ c(
850
+ _.Item,
851
+ {
852
+ gridArea: u,
853
+ visible: n ?? !0,
854
+ ...a,
855
+ children: /* @__PURE__ */ w(
856
+ q,
804
857
  {
805
- render: /* @__PURE__ */ i(He, {}),
806
- customIcon: o == null ? void 0 : o.repeatShuffle
858
+ type: "button",
859
+ "aria-label": qt[r],
860
+ onClick: o,
861
+ className: "rmap-repeat-btn",
862
+ "data-testid": "repeat-btn",
863
+ "data-repeattype": r,
864
+ children: [
865
+ r === "ALL" && /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(Ze, {}), customIcon: i == null ? void 0 : i.repeatAll }),
866
+ r === "ONE" && /* @__PURE__ */ c(
867
+ D,
868
+ {
869
+ render: /* @__PURE__ */ c(et, {}),
870
+ customIcon: i == null ? void 0 : i.repeatOne
871
+ }
872
+ ),
873
+ r === "NONE" && /* @__PURE__ */ c(
874
+ D,
875
+ {
876
+ render: /* @__PURE__ */ c(tt, {}),
877
+ customIcon: i == null ? void 0 : i.repeatNone
878
+ }
879
+ ),
880
+ r === "SHUFFLE" && /* @__PURE__ */ c(
881
+ D,
882
+ {
883
+ render: /* @__PURE__ */ c(rt, {}),
884
+ customIcon: i == null ? void 0 : i.repeatShuffle
885
+ }
886
+ )
887
+ ]
807
888
  }
808
889
  )
809
- ]
810
- }
811
- );
812
- }), me = { size: "100%" }, qe = W(() => {
813
- var n;
814
- const { volume: e, muted: t } = b(), { customIcons: o, elementRefs: r } = L(), a = e ?? ((n = r == null ? void 0 : r.audioEl) == null ? void 0 : n.volume) ?? 0, s = a > 0 && a <= 0.5;
815
- return t || a === 0 ? /* @__PURE__ */ i(
816
- x,
890
+ }
891
+ );
892
+ }
893
+ ), Te = { size: "100%" }, ut = z(() => {
894
+ var s;
895
+ const { volume: e, muted: t } = k(), { customIcons: n, elementRefs: a } = L(), r = e ?? ((s = a == null ? void 0 : a.audioEl) == null ? void 0 : s.volume) ?? 0, i = r > 0 && r <= 0.5;
896
+ return t || r === 0 ? /* @__PURE__ */ c(
897
+ D,
817
898
  {
818
- render: /* @__PURE__ */ i(We, { ...me }),
819
- customIcon: o == null ? void 0 : o.volumeMuted
899
+ render: /* @__PURE__ */ c(ot, { ...Te }),
900
+ customIcon: n == null ? void 0 : n.volumeMuted
820
901
  }
821
- ) : s ? /* @__PURE__ */ i(
822
- x,
902
+ ) : i ? /* @__PURE__ */ c(
903
+ D,
823
904
  {
824
- render: /* @__PURE__ */ i(ze, { ...me }),
825
- customIcon: o == null ? void 0 : o.volumeHalf
905
+ render: /* @__PURE__ */ c(nt, { ...Te }),
906
+ customIcon: n == null ? void 0 : n.volumeHalf
826
907
  }
827
- ) : /* @__PURE__ */ i(
828
- x,
908
+ ) : /* @__PURE__ */ c(
909
+ D,
829
910
  {
830
- render: /* @__PURE__ */ i(Re, { ...me }),
831
- customIcon: o == null ? void 0 : o.volumeFull
911
+ render: /* @__PURE__ */ c(at, { ...Te }),
912
+ customIcon: n == null ? void 0 : n.volumeFull
832
913
  }
833
914
  );
834
915
  });
835
- qe.displayName = "VolumeIcon";
836
- const le = H(null);
837
- le.displayName = "DrawerContext";
838
- const Ye = (e, t) => {
839
- E(() => {
840
- const o = (r) => {
841
- const a = e.current, { target: s } = r;
842
- !r || !a || a.contains(s) || t(r);
916
+ ut.displayName = "VolumeIcon";
917
+ const ie = K(null);
918
+ ie.displayName = "DrawerContext";
919
+ const dt = (e, t) => {
920
+ P(() => {
921
+ const n = (a) => {
922
+ const r = e.current, { target: i } = a;
923
+ !a || !r || r.contains(i) || t(a);
843
924
  };
844
- return document.addEventListener("click", o), () => document.removeEventListener("click", o);
925
+ return document.addEventListener("click", n), () => document.removeEventListener("click", n);
845
926
  }, [e, t]);
846
- }, se = ({
927
+ }, oe = ({
847
928
  outboundClickActive: e = !1,
848
929
  placement: t = "bottom",
849
- children: o,
850
- isOpen: r,
851
- onOpenChange: a
930
+ children: n,
931
+ isOpen: a,
932
+ onOpenChange: r,
933
+ initialOpen: i
852
934
  }) => {
853
- const s = A(null), [n, c] = te.Children.toArray(o), [d, m] = C(!1), l = Ne();
854
- Ye(s, () => {
855
- e && (m(!1), a && a(!1));
856
- }), E(() => {
857
- r !== void 0 && m(r);
858
- }, [r]);
859
- const y = D(
860
- () => ({ isOpen: d, setIsOpen: m, onOpenChange: a, drawerId: l }),
861
- [d, m, a, l]
935
+ const s = S(null), [o, u] = te.Children.toArray(n), [d, l] = N(
936
+ a !== void 0 ? a : i ?? !1
937
+ ), m = $e();
938
+ dt(s, () => {
939
+ e && (l(!1), r && r(!1));
940
+ }), P(() => {
941
+ a !== void 0 && l(a);
942
+ }, [a]);
943
+ const p = x(
944
+ () => ({ isOpen: d, setIsOpen: l, onOpenChange: r, drawerId: m }),
945
+ [d, l, r, m]
862
946
  );
863
- return /* @__PURE__ */ i("div", { className: "rmap-drawer-container", ref: s, children: /* @__PURE__ */ i(le.Provider, { value: y, children: /* @__PURE__ */ w(z, { children: [
864
- t === "top" && c,
865
- n,
866
- t === "bottom" && c
947
+ return /* @__PURE__ */ c("div", { className: "rmap-drawer-container", ref: s, children: /* @__PURE__ */ c(ie.Provider, { value: p, children: /* @__PURE__ */ w(G, { children: [
948
+ t === "top" && u,
949
+ o,
950
+ t === "bottom" && u
867
951
  ] }) }) });
868
- }, Xe = typeof window < "u", pe = Xe ? ct : E, Se = ({
952
+ }, pt = typeof window < "u", ge = pt ? Mt : P, Ce = ({
869
953
  visible: e,
870
954
  name: t,
871
- leaveTime: o,
872
- enterTime: r,
873
- clearTime: a,
874
- onExited: s,
875
- onEntered: n,
876
- children: c
955
+ leaveTime: n,
956
+ enterTime: a,
957
+ clearTime: r,
958
+ onExited: i,
959
+ onEntered: s,
960
+ children: o
877
961
  }) => {
878
- const [d, m] = C(""), [l, y] = C(!1), u = A(n), p = A(s), T = A(t), v = A(r), h = A(o), S = A(a);
879
- return pe(() => {
880
- u.current = n, p.current = s, T.current = t, v.current = r, h.current = o, S.current = a;
881
- }), pe(() => {
882
- const k = e ? "enter" : "leave", B = T.current, R = e ? v.current : h.current;
883
- e && !l && y(!0), m(`${B}-${k}`);
884
- const G = setTimeout(() => {
885
- var X, oe;
886
- m(
887
- `${B}-${k} ${B}-${k}-active`
888
- ), k === "leave" ? (X = p.current) == null || X.call(p) : (oe = u.current) == null || oe.call(u);
889
- }, R), ae = setTimeout(() => {
890
- e || (m(B), y(!1));
891
- }, R + S.current);
962
+ const [u, d] = N(""), [l, m] = N(!1), p = S(s), v = S(i), f = S(t), y = S(a), T = S(n), h = S(r);
963
+ return ge(() => {
964
+ p.current = s, v.current = i, f.current = t, y.current = a, T.current = n, h.current = r;
965
+ }), ge(() => {
966
+ const g = e ? "enter" : "leave", C = f.current, W = e ? y.current : T.current;
967
+ e && !l && m(!0), d(`${C}-${g}`);
968
+ const se = setTimeout(() => {
969
+ var ce, ae;
970
+ d(
971
+ `${C}-${g} ${C}-${g}-active`
972
+ ), g === "leave" ? (ce = v.current) == null || ce.call(v) : (ae = p.current) == null || ae.call(p);
973
+ }, W), R = setTimeout(() => {
974
+ e || (d(C), m(!1));
975
+ }, W + h.current);
892
976
  return () => {
893
- clearTimeout(G), clearTimeout(ae);
977
+ clearTimeout(se), clearTimeout(R);
894
978
  };
895
- }, [e, l]), l ? ut(c, {
896
- className: `${c.props.className} ${d}`
979
+ }, [e, l]), l ? _t(o, {
980
+ className: `${o.props.className} ${u}`
897
981
  }) : null;
898
- }, kt = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [role="button"]:not([aria-disabled="true"])', Nt = ({
982
+ }, Qt = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [role="button"]:not([aria-disabled="true"])', Jt = ({
899
983
  children: e,
900
984
  isWithAnimation: t = !0,
901
- "aria-label": o = "Dialog"
985
+ "aria-label": n = "Dialog"
902
986
  }) => {
903
- const { isOpen: r, setIsOpen: a, onOpenChange: s, drawerId: n } = g(le), c = A(null), d = A(null), m = f(
987
+ const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId: s } = A(ie), o = S(null), u = S(null), d = E(
904
988
  () => {
905
- var v;
906
- return (v = c.current) == null ? void 0 : v.querySelectorAll(kt);
989
+ var y;
990
+ return (y = o.current) == null ? void 0 : y.querySelectorAll(Qt);
907
991
  },
908
992
  []
909
- ), l = f(() => {
910
- var v, h;
911
- (h = (v = m()) == null ? void 0 : v[0]) == null || h.focus();
912
- }, [m]), y = f(() => {
913
- d.current = document.activeElement, l();
914
- }, [l]), u = f(() => {
915
- var v;
916
- (v = d.current) == null || v.focus();
993
+ ), l = E(() => {
994
+ var y, T;
995
+ (T = (y = d()) == null ? void 0 : y[0]) == null || T.focus();
996
+ }, [d]), m = E(() => {
997
+ u.current = document.activeElement, l();
998
+ }, [l]), p = E(() => {
999
+ var y;
1000
+ (y = u.current) == null || y.focus();
917
1001
  }, []);
918
- E(() => {
919
- var v;
920
- r && !t ? (d.current = document.activeElement, l()) : !r && !t && ((v = d.current) == null || v.focus());
921
- }, [r, t, l]);
922
- const p = f(
923
- (v) => {
924
- if (v.key === "Escape") {
925
- a(!1), s && s(!1);
1002
+ P(() => {
1003
+ var y;
1004
+ a && !t ? (u.current = document.activeElement, l()) : !a && !t && ((y = u.current) == null || y.focus());
1005
+ }, [a, t, l]);
1006
+ const v = E(
1007
+ (y) => {
1008
+ if (y.key === "Escape") {
1009
+ r(!1), i && i(!1);
926
1010
  return;
927
1011
  }
928
- if (v.key === "Tab") {
929
- const h = m();
930
- if (!h || h.length === 0) return;
931
- const S = h[0], k = h[h.length - 1];
932
- v.shiftKey ? document.activeElement === S && (v.preventDefault(), k.focus()) : document.activeElement === k && (v.preventDefault(), S.focus());
1012
+ if (y.key === "Tab") {
1013
+ const T = d();
1014
+ if (!T || T.length === 0) return;
1015
+ const h = T[0], g = T[T.length - 1];
1016
+ y.shiftKey ? document.activeElement === h && (y.preventDefault(), g.focus()) : document.activeElement === g && (y.preventDefault(), h.focus());
933
1017
  }
934
1018
  },
935
- [a, s, m]
936
- ), T = /* @__PURE__ */ i(
1019
+ [r, i, d]
1020
+ ), f = /* @__PURE__ */ c(
937
1021
  "div",
938
1022
  {
939
- ref: c,
1023
+ ref: o,
940
1024
  className: "rmap-drawer-content-container",
941
1025
  role: "dialog",
942
1026
  "aria-modal": "true",
943
- "aria-label": o,
944
- id: n,
945
- onKeyDown: p,
1027
+ "aria-label": n,
1028
+ id: s,
1029
+ onKeyDown: v,
946
1030
  children: e
947
1031
  }
948
1032
  );
949
- return t ? /* @__PURE__ */ i(
950
- Se,
1033
+ return t ? /* @__PURE__ */ c(
1034
+ Ce,
951
1035
  {
952
- visible: r,
1036
+ visible: a,
953
1037
  name: "rmap-drawer-content",
954
1038
  enterTime: 20,
955
1039
  leaveTime: 60,
956
1040
  clearTime: 300,
957
- onEntered: y,
958
- onExited: u,
959
- children: T
1041
+ onEntered: m,
1042
+ onExited: p,
1043
+ children: f
960
1044
  }
961
- ) : r ? T : null;
962
- }, bt = ({
1045
+ ) : a ? f : null;
1046
+ }, Zt = ({
963
1047
  children: e,
964
1048
  "aria-label": t,
965
- "data-testid": o
1049
+ "data-testid": n
966
1050
  }) => {
967
- const { isOpen: r, setIsOpen: a, onOpenChange: s, drawerId: n } = g(le), c = f(() => {
968
- const d = !r;
969
- a(d), s == null || s(d);
970
- }, [r, a, s]);
971
- return /* @__PURE__ */ i(
1051
+ const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId: s } = A(ie), o = E(() => {
1052
+ const u = !a;
1053
+ r(u), i == null || i(u);
1054
+ }, [a, r, i]);
1055
+ return /* @__PURE__ */ c(
972
1056
  q,
973
1057
  {
974
1058
  className: "rmap-drawer-trigger",
975
1059
  type: "button",
976
- "aria-expanded": r,
977
- "aria-controls": n,
1060
+ "aria-expanded": a,
1061
+ "aria-controls": s,
978
1062
  "aria-label": t,
979
- "data-testid": o,
980
- onClick: c,
1063
+ "data-testid": n,
1064
+ onClick: o,
981
1065
  children: e
982
1066
  }
983
1067
  );
984
1068
  };
985
- se.Content = Nt;
986
- se.Trigger = bt;
987
- const ye = ({ children: e }) => /* @__PURE__ */ i("ul", { className: "rmap-sortable-list-container", "aria-label": "Sortable list", children: e }), Ct = ({
1069
+ oe.Content = Jt;
1070
+ oe.Trigger = Zt;
1071
+ const Ee = ({ children: e }) => /* @__PURE__ */ c("ul", { className: "rmap-sortable-list-container", "aria-label": "Sortable list", children: e }), er = ({
988
1072
  index: e,
989
1073
  dragStartIdx: t,
990
- listData: o,
991
- draggable: r = !0,
992
- onDragStart: a,
993
- onDragOver: s,
994
- onDrop: n,
995
- onReorder: c,
996
- onClick: d
1074
+ listData: n,
1075
+ draggable: a = !0,
1076
+ onDragStart: r,
1077
+ onDragOver: i,
1078
+ onDrop: s,
1079
+ onReorder: o,
1080
+ onClick: u
997
1081
  }) => {
998
- const m = (l, y) => {
999
- if (l < 0 || l >= o.length) return;
1000
- const u = [...o], p = u.splice(e, 1)[0];
1001
- u.splice(l, 0, p);
1002
- const T = u.map((h, S) => ({
1003
- ...h,
1004
- index: S
1005
- })), v = (y == null ? void 0 : y.parentElement) ?? null;
1006
- if (be(() => {
1007
- c == null || c(T);
1008
- }), v) {
1009
- const h = v.children[l];
1010
- h == null || h.focus();
1082
+ const d = (l, m) => {
1083
+ if (l < 0 || l >= n.length) return;
1084
+ const p = [...n], v = p.splice(e, 1)[0];
1085
+ p.splice(l, 0, v);
1086
+ const f = p.map((T, h) => ({
1087
+ ...T,
1088
+ index: h
1089
+ })), y = (m == null ? void 0 : m.parentElement) ?? null;
1090
+ if (Fe(() => {
1091
+ o == null || o(f);
1092
+ }), y) {
1093
+ const T = y.children[l];
1094
+ T == null || T.focus();
1011
1095
  }
1012
1096
  };
1013
1097
  return {
1014
1098
  tabIndex: 0,
1015
- draggable: r,
1099
+ draggable: a,
1016
1100
  onKeyDown: (l) => {
1017
1101
  switch (l.key) {
1018
1102
  case "Enter":
@@ -1020,25 +1104,25 @@ const ye = ({ children: e }) => /* @__PURE__ */ i("ul", { className: "rmap-sorta
1020
1104
  l.preventDefault(), l.currentTarget.click();
1021
1105
  break;
1022
1106
  case "ArrowUp":
1023
- if (l.preventDefault(), r && l.altKey)
1024
- m(e - 1, l.currentTarget);
1107
+ if (l.preventDefault(), a && l.altKey)
1108
+ d(e - 1, l.currentTarget);
1025
1109
  else {
1026
- const y = l.currentTarget.previousElementSibling;
1027
- y == null || y.focus();
1110
+ const m = l.currentTarget.previousElementSibling;
1111
+ m == null || m.focus();
1028
1112
  }
1029
1113
  break;
1030
1114
  case "ArrowDown":
1031
- if (l.preventDefault(), r && l.altKey)
1032
- m(e + 1, l.currentTarget);
1115
+ if (l.preventDefault(), a && l.altKey)
1116
+ d(e + 1, l.currentTarget);
1033
1117
  else {
1034
- const y = l.currentTarget.nextElementSibling;
1035
- y == null || y.focus();
1118
+ const m = l.currentTarget.nextElementSibling;
1119
+ m == null || m.focus();
1036
1120
  }
1037
1121
  break;
1038
1122
  }
1039
1123
  },
1040
1124
  onDragStart: (l) => {
1041
- l.stopPropagation(), l.currentTarget.classList.add("rmap-drag-start"), a == null || a(l);
1125
+ l.stopPropagation(), l.currentTarget.classList.add("rmap-drag-start"), r == null || r(l);
1042
1126
  },
1043
1127
  onDragEnd: (l) => {
1044
1128
  l.stopPropagation(), l.currentTarget.classList.remove("rmap-drag-start");
@@ -1050,67 +1134,71 @@ const ye = ({ children: e }) => /* @__PURE__ */ i("ul", { className: "rmap-sorta
1050
1134
  l.stopPropagation(), l.currentTarget.classList.remove("rmap-drag-over");
1051
1135
  },
1052
1136
  onDragOver: (l) => {
1053
- l.preventDefault(), l.stopPropagation(), s == null || s(l);
1137
+ l.preventDefault(), l.stopPropagation(), i == null || i(l);
1054
1138
  },
1055
1139
  onDrop: (l) => {
1056
1140
  l.stopPropagation(), l.currentTarget.classList.remove("rmap-drag-over");
1057
- const y = [...o], u = o[t];
1058
- y.splice(t, 1);
1059
- const p = [
1060
- ...y.slice(0, e),
1061
- u,
1062
- ...y.slice(e, y.length)
1063
- ].map((T, v) => ({ ...T, index: v }));
1064
- n == null || n(l, p);
1141
+ const m = [...n], p = n[t];
1142
+ m.splice(t, 1);
1143
+ const v = [
1144
+ ...m.slice(0, e),
1145
+ p,
1146
+ ...m.slice(e, m.length)
1147
+ ].map((f, y) => ({ ...f, index: y }));
1148
+ s == null || s(l, v);
1065
1149
  },
1066
1150
  onClick: (l) => {
1067
- l.stopPropagation(), d == null || d(l);
1151
+ l.stopPropagation(), u == null || u(l);
1068
1152
  }
1069
1153
  };
1070
- }, Mt = (e) => {
1071
- const { children: t, ...o } = e, r = Ct(o);
1072
- return /* @__PURE__ */ i("li", { className: "rmap-sortable-item", ...r, children: /* @__PURE__ */ i("div", { className: "rmap-sortable-item-inner", children: t }) });
1154
+ }, tr = (e) => {
1155
+ const { children: t, ...n } = e, a = er(n);
1156
+ return /* @__PURE__ */ c("li", { className: "rmap-sortable-item", ...a, children: /* @__PURE__ */ c("div", { className: "rmap-sortable-item-inner", children: t }) });
1073
1157
  };
1074
- ye.Item = Mt;
1075
- const xt = W(function({
1158
+ Ee.Item = tr;
1159
+ const xe = K(null);
1160
+ xe.displayName = "PlayListPortalContext";
1161
+ const Me = K(null);
1162
+ Me.displayName = "PlayListEmptyContext";
1163
+ const rr = z(function({
1076
1164
  data: t
1077
1165
  }) {
1078
- const { curPlayId: o } = V(), { coverImgsCss: r } = L(), a = o === t.id;
1079
- return /* @__PURE__ */ i(
1166
+ const { curPlayId: n } = $(), { coverImgsCss: a } = L(), r = n === t.id;
1167
+ return /* @__PURE__ */ c(
1080
1168
  "div",
1081
1169
  {
1082
- className: `rmap-playlist-item${a ? " rmap-cur-played" : ""}`,
1170
+ className: `rmap-playlist-item${r ? " rmap-cur-played" : ""}`,
1083
1171
  "data-testid": "playlist-item",
1084
- "aria-current": a ? "true" : void 0,
1172
+ "aria-current": r ? "true" : void 0,
1085
1173
  children: /* @__PURE__ */ w("div", { className: "rmap-playlist-item-contents", children: [
1086
- /* @__PURE__ */ i("div", { className: "rmap-playlist-album-cover", children: t.img && /* @__PURE__ */ i(
1174
+ /* @__PURE__ */ c("div", { className: "rmap-playlist-album-cover", children: t.img && /* @__PURE__ */ c(
1087
1175
  "img",
1088
1176
  {
1089
1177
  src: t.img,
1090
1178
  alt: t.name || "Album thumbnail",
1091
- style: r == null ? void 0 : r.listThumbnail
1179
+ style: a == null ? void 0 : a.listThumbnail
1092
1180
  }
1093
1181
  ) }),
1094
1182
  /* @__PURE__ */ w("div", { className: "rmap-playlist-album-info", children: [
1095
- t.writer && /* @__PURE__ */ i("span", { className: "rmap-playlist-writer", children: t.writer }),
1096
- t.name && /* @__PURE__ */ i("span", { className: "rmap-playlist-title", children: t.name }),
1097
- t.description && /* @__PURE__ */ i("div", { className: "rmap-playlist-description", children: t.description })
1183
+ t.writer && /* @__PURE__ */ c("span", { className: "rmap-playlist-writer", children: t.writer }),
1184
+ t.name && /* @__PURE__ */ c("span", { className: "rmap-playlist-title", children: t.name }),
1185
+ t.description && /* @__PURE__ */ c("div", { className: "rmap-playlist-description", children: t.description })
1098
1186
  ] })
1099
1187
  ] })
1100
1188
  }
1101
1189
  );
1102
- }), _t = ({
1190
+ }), ar = ({
1103
1191
  setIsOpen: e
1104
1192
  }) => {
1105
- const { playList: t } = V(), { activeUI: o } = O(), r = g(P), [a, s] = C(0), n = f(
1106
- (c) => {
1107
- r({
1193
+ const { playList: t } = $(), { activeUI: n } = M(), a = A(b), [r, i] = N(0), s = E(
1194
+ (o) => {
1195
+ a({
1108
1196
  type: "SET_CURRENT_AUDIO",
1109
- currentIndex: c,
1110
- currentAudioId: t[c].id
1197
+ currentIndex: o,
1198
+ currentAudioId: t[o].id
1111
1199
  });
1112
1200
  },
1113
- [r, t]
1201
+ [a, t]
1114
1202
  );
1115
1203
  return {
1116
1204
  cssTransitionEventProps: {
@@ -1118,138 +1206,155 @@ const xt = W(function({
1118
1206
  onEntered: () => e(!0)
1119
1207
  },
1120
1208
  sortableItemEventProps: {
1121
- draggable: o.playList !== "unSortable",
1122
- dragStartIdx: a,
1123
- onDragStart: (c) => s(c),
1124
- onDrop: (c, d) => r({
1209
+ draggable: n.playList !== "unSortable",
1210
+ dragStartIdx: r,
1211
+ onDragStart: (o) => i(o),
1212
+ onDrop: (o, u) => a({
1125
1213
  type: "UPDATE_PLAY_LIST",
1126
- playList: d
1214
+ playList: u
1127
1215
  }),
1128
- onReorder: (c) => r({
1216
+ onReorder: (o) => a({
1129
1217
  type: "UPDATE_PLAY_LIST",
1130
- playList: c
1218
+ playList: o
1131
1219
  }),
1132
- onClick: (c) => n(c)
1220
+ onClick: (o) => s(o)
1133
1221
  }
1134
1222
  };
1135
- }, Dt = () => {
1136
- const { playList: e } = V(), { isOpen: t, setIsOpen: o } = g(le), { cssTransitionEventProps: r, sortableItemEventProps: a } = _t({
1137
- setIsOpen: o
1223
+ }, nr = () => {
1224
+ const { playList: e } = $(), { isOpen: t, setIsOpen: n } = A(ie), a = he(xe), r = he(Me), { cssTransitionEventProps: i, sortableItemEventProps: s } = ar({
1225
+ setIsOpen: n
1138
1226
  }), {
1139
- onClick: s,
1140
- onDragStart: n,
1141
- ...c
1142
- } = a;
1143
- return e.length !== 0 ? dt.createPortal(
1144
- /* @__PURE__ */ i(
1145
- Se,
1227
+ onClick: o,
1228
+ onDragStart: u,
1229
+ ...d
1230
+ } = s;
1231
+ if (!a) return /* @__PURE__ */ c(G, {});
1232
+ const l = e.length === 0;
1233
+ return l && !r ? /* @__PURE__ */ c(G, {}) : Rt.createPortal(
1234
+ /* @__PURE__ */ c(
1235
+ Ce,
1146
1236
  {
1147
1237
  visible: t,
1148
1238
  name: "rmap-playlist-content",
1149
1239
  enterTime: 20,
1150
1240
  leaveTime: 20,
1151
1241
  clearTime: 300,
1152
- ...r,
1153
- children: /* @__PURE__ */ i("div", { className: "rmap-playlist-container", children: /* @__PURE__ */ i(ye, { children: e.map((d, m) => /* @__PURE__ */ i(
1154
- ye.Item,
1242
+ ...i,
1243
+ children: /* @__PURE__ */ c("div", { className: "rmap-playlist-container", children: l ? r : /* @__PURE__ */ c(Ee, { children: e.map((m, p) => /* @__PURE__ */ c(
1244
+ Ee.Item,
1155
1245
  {
1156
- index: m,
1246
+ index: p,
1157
1247
  listData: e,
1158
- onClick: () => s(m),
1159
- onDragStart: () => n(m),
1160
- ...c,
1161
- children: /* @__PURE__ */ i(xt, { data: d })
1248
+ onClick: () => o(p),
1249
+ onDragStart: () => u(p),
1250
+ ...d,
1251
+ children: /* @__PURE__ */ c(rr, { data: m })
1162
1252
  },
1163
- `sortable-item-${m}`
1253
+ m.id
1164
1254
  )) }) })
1165
1255
  }
1166
1256
  ),
1167
- document.querySelector(".rmap-sortable-playlist") ?? document.body
1168
- ) : /* @__PURE__ */ i(z, {});
1169
- }, Ot = () => {
1257
+ a
1258
+ );
1259
+ }, or = () => {
1170
1260
  const { customIcons: e } = L();
1171
- return /* @__PURE__ */ i(
1172
- x,
1261
+ return /* @__PURE__ */ c(
1262
+ D,
1173
1263
  {
1174
- render: /* @__PURE__ */ i(Be, { size: "100%" }),
1264
+ render: /* @__PURE__ */ c(Je, { size: "100%" }),
1175
1265
  customIcon: e == null ? void 0 : e.playList
1176
1266
  }
1177
1267
  );
1178
- }, Ut = () => /* @__PURE__ */ w(se, { children: [
1179
- /* @__PURE__ */ i(se.Trigger, { "aria-label": "Playlist", "data-testid": "playlist-trigger-btn", children: /* @__PURE__ */ i(Ot, {}) }),
1180
- /* @__PURE__ */ i(se.Content, { "aria-label": "Playlist", children: /* @__PURE__ */ i(Dt, {}) })
1181
- ] }), ee = (e) => {
1182
- const t = `${Math.floor(e / 60)}`.padStart(2, "0"), o = `${Math.floor(e % 60)}`.padStart(2, "0");
1183
- return `${t}:${o}`;
1184
- }, ce = (e, t, o = 0) => {
1185
- if (!t) return o;
1186
- const r = e / t;
1187
- return isFinite(r) ? r : o;
1188
- }, Qe = () => {
1189
- const { isLoadedMetaData: e } = b(), { elementRefs: t } = L(), [o, r] = C(!1), a = f(
1190
- (s) => {
1268
+ }, mt = ({
1269
+ initialExpanded: e,
1270
+ gridArea: t,
1271
+ visible: n,
1272
+ ...a
1273
+ }) => {
1274
+ const { playListExpanded: r } = M(), i = e ?? r, s = B("playList", t);
1275
+ return /* @__PURE__ */ c(_.Item, { gridArea: s, visible: n ?? !0, ...a, children: /* @__PURE__ */ w(oe, { initialOpen: i, children: [
1276
+ /* @__PURE__ */ c(
1277
+ oe.Trigger,
1278
+ {
1279
+ "aria-label": "Playlist",
1280
+ "data-testid": "playlist-trigger-btn",
1281
+ children: /* @__PURE__ */ c(or, {})
1282
+ }
1283
+ ),
1284
+ /* @__PURE__ */ c(oe.Content, { "aria-label": "Playlist", children: /* @__PURE__ */ c(nr, {}) })
1285
+ ] }) });
1286
+ }, ee = (e) => {
1287
+ const t = `${Math.floor(e / 60)}`.padStart(2, "0"), n = `${Math.floor(e % 60)}`.padStart(2, "0");
1288
+ return `${t}:${n}`;
1289
+ }, pe = (e, t, n = 0) => {
1290
+ if (!t) return n;
1291
+ const a = e / t;
1292
+ return isFinite(a) ? a : n;
1293
+ }, yt = () => {
1294
+ const { isLoadedMetaData: e } = k(), { elementRefs: t } = L(), [n, a] = N(!1), r = E(
1295
+ (i) => {
1191
1296
  if (!(t != null && t.audioEl) || !e) return;
1192
- const { clientX: n } = s, { clientWidth: c } = s.currentTarget, d = s.currentTarget.getBoundingClientRect(), m = n - d.x, l = ce(m, c) * t.audioEl.duration;
1297
+ const { clientX: s } = i, { clientWidth: o } = i.currentTarget, u = i.currentTarget.getBoundingClientRect(), d = s - u.x, l = pe(d, o) * t.audioEl.duration;
1193
1298
  t.audioEl.currentTime = l;
1194
1299
  },
1195
1300
  [e, t == null ? void 0 : t.audioEl]
1196
1301
  );
1197
- return E(() => {
1198
- if (!o) return;
1199
- const s = (n) => n.preventDefault();
1200
- return document.addEventListener("selectstart", s), () => {
1201
- document.removeEventListener("selectstart", s);
1302
+ return P(() => {
1303
+ if (!n) return;
1304
+ const i = (s) => s.preventDefault();
1305
+ return document.addEventListener("selectstart", i), () => {
1306
+ document.removeEventListener("selectstart", i);
1202
1307
  };
1203
- }, [o]), {
1204
- onMouseDown: () => r(!0),
1205
- onMouseUp: () => r(!1),
1206
- onMouseLeave: () => r(!1),
1207
- onMouseMove: o ? a : void 0,
1208
- onClick: a
1308
+ }, [n]), {
1309
+ onMouseDown: () => a(!0),
1310
+ onMouseUp: () => a(!1),
1311
+ onMouseLeave: () => a(!1),
1312
+ onMouseMove: n ? r : void 0,
1313
+ onClick: r
1209
1314
  };
1210
- }, Je = (e) => {
1211
- const { isLoadedMetaData: t } = b(), { elementRefs: o } = L();
1212
- return f(
1213
- (r) => {
1214
- if (!(o != null && o.audioEl) || !t) return;
1215
- const a = o.audioEl;
1216
- let s = null;
1217
- switch (r.key) {
1315
+ }, vt = (e) => {
1316
+ const { isLoadedMetaData: t } = k(), { elementRefs: n } = L();
1317
+ return E(
1318
+ (a) => {
1319
+ if (!(n != null && n.audioEl) || !t) return;
1320
+ const r = n.audioEl;
1321
+ let i = null;
1322
+ switch (a.key) {
1218
1323
  case "ArrowRight":
1219
1324
  case "ArrowUp":
1220
- r.preventDefault(), s = Math.min(a.currentTime + 5, a.duration);
1325
+ a.preventDefault(), i = Math.min(r.currentTime + 5, r.duration);
1221
1326
  break;
1222
1327
  case "ArrowLeft":
1223
1328
  case "ArrowDown":
1224
- r.preventDefault(), s = Math.max(a.currentTime - 5, 0);
1329
+ a.preventDefault(), i = Math.max(r.currentTime - 5, 0);
1225
1330
  break;
1226
1331
  case "Home":
1227
- r.preventDefault(), s = 0;
1332
+ a.preventDefault(), i = 0;
1228
1333
  break;
1229
1334
  case "End":
1230
- r.preventDefault(), s = a.duration;
1335
+ a.preventDefault(), i = r.duration;
1231
1336
  break;
1232
1337
  }
1233
- s !== null && isFinite(a.duration) && (a.currentTime = s, e == null || e(s, a.duration));
1338
+ i !== null && isFinite(r.duration) && (r.currentTime = i, e == null || e(i, r.duration));
1234
1339
  },
1235
- [o == null ? void 0 : o.audioEl, t, e]
1340
+ [n == null ? void 0 : n.audioEl, t, e]
1236
1341
  );
1237
- }, Vt = () => {
1238
- const { currentTime: e, duration: t } = re(), o = A(null), [r, a] = C(0);
1239
- E(() => {
1240
- const m = o.current;
1241
- if (!m) return;
1242
- a(m.offsetWidth);
1243
- const l = new ResizeObserver(([y]) => {
1244
- a(y.contentBoxSize[0].inlineSize);
1342
+ }, ir = () => {
1343
+ const { currentTime: e, duration: t } = re(), n = S(null), [a, r] = N(0);
1344
+ P(() => {
1345
+ const d = n.current;
1346
+ if (!d) return;
1347
+ r(d.offsetWidth);
1348
+ const l = new ResizeObserver(([m]) => {
1349
+ r(m.contentBoxSize[0].inlineSize);
1245
1350
  });
1246
- return l.observe(m), () => l.disconnect();
1351
+ return l.observe(d), () => l.disconnect();
1247
1352
  }, []);
1248
- const s = ce(e, t), n = Qe(), c = Je(), d = s * r;
1353
+ const i = pe(e, t), s = yt(), o = vt(), u = i * a;
1249
1354
  return /* @__PURE__ */ w(
1250
1355
  "div",
1251
1356
  {
1252
- ref: o,
1357
+ ref: n,
1253
1358
  className: "rmap-bar-progress-wrapper",
1254
1359
  "data-testid": "progress-bar",
1255
1360
  role: "slider",
@@ -1257,133 +1362,133 @@ const xt = W(function({
1257
1362
  "aria-label": "Seek",
1258
1363
  "aria-valuemin": 0,
1259
1364
  "aria-valuemax": 100,
1260
- "aria-valuenow": Math.round(s * 100),
1365
+ "aria-valuenow": Math.round(i * 100),
1261
1366
  "aria-valuetext": `${ee(
1262
1367
  e
1263
1368
  )} of ${ee(t)}`,
1264
- onKeyDown: c,
1265
- ...n,
1369
+ onKeyDown: o,
1370
+ ...s,
1266
1371
  children: [
1267
- /* @__PURE__ */ i("div", { className: "rmap-progress-bar", children: /* @__PURE__ */ i(
1372
+ /* @__PURE__ */ c("div", { className: "rmap-progress-bar", children: /* @__PURE__ */ c(
1268
1373
  "div",
1269
1374
  {
1270
1375
  className: "rmap-progress-fill",
1271
- style: { transform: `scaleX(${s})` }
1376
+ style: { transform: `scaleX(${i})` }
1272
1377
  }
1273
1378
  ) }),
1274
- /* @__PURE__ */ i(
1379
+ /* @__PURE__ */ c(
1275
1380
  "div",
1276
1381
  {
1277
1382
  className: "rmap-progress-handle",
1278
1383
  style: {
1279
- transform: `translateX(${d}px)`
1384
+ transform: `translateX(${u}px)`
1280
1385
  }
1281
1386
  }
1282
1387
  )
1283
1388
  ]
1284
1389
  }
1285
1390
  );
1286
- }, Bt = (e, t) => {
1287
- const o = A(), r = f(() => {
1288
- const a = document.getElementsByClassName("rmap-player-provider")[0];
1289
- if (!a) return;
1290
- const s = Object.entries(
1391
+ }, sr = (e, t) => {
1392
+ const n = S(), a = E(() => {
1393
+ const r = document.getElementsByClassName("rmap-player-provider")[0];
1394
+ if (!r) return;
1395
+ const i = Object.entries(
1291
1396
  e
1292
1397
  ).reduce(
1293
- (n, [c, d]) => ({
1294
- ...n,
1295
- [c]: window.getComputedStyle(a).getPropertyValue(`${d}`)
1398
+ (s, [o, u]) => ({
1399
+ ...s,
1400
+ [o]: window.getComputedStyle(r).getPropertyValue(`${u}`)
1296
1401
  }),
1297
1402
  {}
1298
1403
  );
1299
- o.current = s;
1404
+ n.current = i;
1300
1405
  }, [e]);
1301
- return pe(() => {
1302
- r();
1303
- const a = window.matchMedia("(prefers-color-scheme: dark)");
1304
- return a.addEventListener("change", r), () => a.removeEventListener("change", r);
1305
- }, [r, t]), o;
1306
- }, Kt = {
1406
+ return ge(() => {
1407
+ a();
1408
+ const r = window.matchMedia("(prefers-color-scheme: dark)");
1409
+ return r.addEventListener("change", a), () => r.removeEventListener("change", a);
1410
+ }, [a, t]), n;
1411
+ }, cr = {
1307
1412
  progressColor: "--rm-audio-player-waveform-bar",
1308
1413
  waveColor: "--rm-audio-player-waveform-background"
1309
- }, $t = (e) => {
1414
+ }, lr = (e) => {
1310
1415
  const t = e.backend;
1311
1416
  if (!(!(t != null && t.media) || !t.mediaListeners))
1312
- for (const [o, r] of Object.entries(t.mediaListeners))
1313
- t.media.removeEventListener(o, r);
1314
- }, Ft = (e) => {
1315
- const t = g(P), { isPlaying: o } = b(), { curPlayId: r } = V(), { elementRefs: a } = L(), { colorScheme: s } = O(), n = Bt(Kt, s), c = A(a == null ? void 0 : a.waveformInst);
1316
- c.current = a == null ? void 0 : a.waveformInst, E(() => {
1317
- var p, T;
1318
- if (a != null && a.waveformInst || !((p = n.current) != null && p.progressColor) || !((T = n.current) != null && T.waveColor))
1417
+ for (const [n, a] of Object.entries(t.mediaListeners))
1418
+ t.media.removeEventListener(n, a);
1419
+ }, ur = (e) => {
1420
+ const t = A(b), { isPlaying: n } = k(), { curPlayId: a } = $(), { elementRefs: r } = L(), { colorScheme: i } = M(), s = sr(cr, i), o = S(r == null ? void 0 : r.waveformInst);
1421
+ o.current = r == null ? void 0 : r.waveformInst, P(() => {
1422
+ var v, f;
1423
+ if (r != null && r.waveformInst || !((v = s.current) != null && v.progressColor) || !((f = s.current) != null && f.waveColor))
1319
1424
  return;
1320
- let u = !1;
1321
- return import("./wavesurfer-_j5aw4gZ.mjs").then((v) => v.w).then(({ default: v }) => {
1322
- var S, k;
1323
- if (u || !e.current || !((S = n.current) != null && S.progressColor) || !((k = n.current) != null && k.waveColor)) {
1425
+ let p = !1;
1426
+ return import("./wavesurfer-_j5aw4gZ.mjs").then((y) => y.w).then(({ default: y }) => {
1427
+ var h, g;
1428
+ if (p || !e.current || !((h = s.current) != null && h.progressColor) || !((g = s.current) != null && g.waveColor)) {
1324
1429
  console.error("[useWaveSurfer] missing required dependencies");
1325
1430
  return;
1326
1431
  }
1327
- let h;
1432
+ let T;
1328
1433
  try {
1329
- h = v.create({
1434
+ T = y.create({
1330
1435
  barWidth: 1,
1331
1436
  cursorWidth: 2,
1332
1437
  container: e.current,
1333
1438
  height: 80,
1334
- progressColor: n.current.progressColor,
1439
+ progressColor: s.current.progressColor,
1335
1440
  responsive: !0,
1336
- waveColor: n.current.waveColor,
1441
+ waveColor: s.current.waveColor,
1337
1442
  cursorColor: "var(--rm-audio-player-waveform-cursor)",
1338
1443
  backend: "MediaElement",
1339
1444
  removeMediaElementOnDestroy: !1
1340
1445
  });
1341
- } catch (B) {
1446
+ } catch (C) {
1342
1447
  console.error(
1343
1448
  "[useWaveSurfer] failed to create WaveSurfer instance",
1344
- B
1449
+ C
1345
1450
  );
1346
1451
  return;
1347
1452
  }
1348
1453
  t({
1349
1454
  type: "SET_ELEMENT_REFS",
1350
- elementRefs: { waveformInst: h }
1455
+ elementRefs: { waveformInst: T }
1351
1456
  });
1352
- }).catch((v) => {
1353
- console.error("[useWaveSurfer] failed to load wavesurfer.js", v);
1457
+ }).catch((y) => {
1458
+ console.error("[useWaveSurfer] failed to load wavesurfer.js", y);
1354
1459
  }), () => {
1355
- u = !0;
1460
+ p = !0;
1356
1461
  };
1357
- }, [a == null ? void 0 : a.waveformInst, t, n]);
1358
- const d = A(r);
1359
- E(() => {
1360
- if (!(a != null && a.audioEl) || !(a != null && a.waveformInst)) return;
1361
- const u = a.audioEl;
1362
- if (!u.getAttribute("src")) return;
1363
- const p = a.waveformInst, T = d.current !== r;
1364
- d.current = r;
1365
- const v = T ? 0 : u.currentTime, h = o;
1366
- $t(p), p.load(u);
1367
- const S = () => {
1368
- !T && v > 0 && u.duration && (u.currentTime = v, p.seekTo(v / u.duration)), h && u.play();
1462
+ }, [r == null ? void 0 : r.waveformInst, t, s]);
1463
+ const u = S(a);
1464
+ P(() => {
1465
+ if (!(r != null && r.audioEl) || !(r != null && r.waveformInst)) return;
1466
+ const p = r.audioEl;
1467
+ if (!p.getAttribute("src")) return;
1468
+ const v = r.waveformInst, f = u.current !== a;
1469
+ u.current = a;
1470
+ const y = f ? 0 : p.currentTime, T = n;
1471
+ lr(v), v.load(p);
1472
+ const h = () => {
1473
+ !f && y > 0 && p.duration && (p.currentTime = y, v.seekTo(y / p.duration)), T && p.play();
1369
1474
  };
1370
- return p.on("ready", S), () => {
1371
- p.un("ready", S);
1475
+ return v.on("ready", h), () => {
1476
+ v.un("ready", h);
1372
1477
  };
1373
- }, [r, a == null ? void 0 : a.audioEl, a == null ? void 0 : a.waveformInst]), E(() => {
1374
- if (!e.current || !(a != null && a.waveformInst)) return;
1375
- const u = () => {
1376
- var T, v;
1377
- (v = (T = a.waveformInst) == null ? void 0 : T.drawer) == null || v.fireEvent("redraw");
1378
- }, p = new ResizeObserver(u);
1379
- return p.observe(e.current), () => {
1380
- p.disconnect();
1478
+ }, [a, r == null ? void 0 : r.audioEl, r == null ? void 0 : r.waveformInst]), P(() => {
1479
+ if (!e.current || !(r != null && r.waveformInst)) return;
1480
+ const p = () => {
1481
+ var f, y;
1482
+ (y = (f = r.waveformInst) == null ? void 0 : f.drawer) == null || y.fireEvent("redraw");
1483
+ }, v = new ResizeObserver(p);
1484
+ return v.observe(e.current), () => {
1485
+ v.disconnect();
1381
1486
  };
1382
- }, [a == null ? void 0 : a.waveformInst, e]), E(
1487
+ }, [r == null ? void 0 : r.waveformInst, e]), P(
1383
1488
  () => () => {
1384
- var p, T;
1385
- const u = (p = e.current) == null ? void 0 : p.querySelector("wave");
1386
- u && u.remove(), (T = c.current) == null || T.destroy(), t({
1489
+ var v, f;
1490
+ const p = (v = e.current) == null ? void 0 : v.querySelector("wave");
1491
+ p && p.remove(), (f = o.current) == null || f.destroy(), t({
1387
1492
  type: "SET_ELEMENT_REFS",
1388
1493
  elementRefs: { waveformInst: void 0 }
1389
1494
  });
@@ -1391,47 +1496,47 @@ const xt = W(function({
1391
1496
  // eslint-disable-next-line react-hooks/exhaustive-deps
1392
1497
  [t]
1393
1498
  );
1394
- const m = () => {
1395
- var v, h;
1396
- const u = c.current;
1397
- if (!(u != null && u.isReady)) return;
1398
- const p = (v = n.current) == null ? void 0 : v.waveColor, T = (h = n.current) == null ? void 0 : h.progressColor;
1399
- p && u.setWaveColor(p), T && u.setProgressColor(T);
1400
- }, l = A(m);
1401
- l.current = m;
1402
- const y = A(s);
1403
- E(() => {
1404
- y.current !== s && (y.current = s, l.current());
1405
- }, [s, a == null ? void 0 : a.waveformInst]), E(() => {
1406
- const u = () => l.current(), p = window.matchMedia("(prefers-color-scheme: dark)");
1407
- return p.addEventListener("change", u), () => p.removeEventListener("change", u);
1499
+ const d = () => {
1500
+ var y, T;
1501
+ const p = o.current;
1502
+ if (!(p != null && p.isReady)) return;
1503
+ const v = (y = s.current) == null ? void 0 : y.waveColor, f = (T = s.current) == null ? void 0 : T.progressColor;
1504
+ v && p.setWaveColor(v), f && p.setProgressColor(f);
1505
+ }, l = S(d);
1506
+ l.current = d;
1507
+ const m = S(i);
1508
+ P(() => {
1509
+ m.current !== i && (m.current = i, l.current());
1510
+ }, [i, r == null ? void 0 : r.waveformInst]), P(() => {
1511
+ const p = () => l.current(), v = window.matchMedia("(prefers-color-scheme: dark)");
1512
+ return v.addEventListener("change", p), () => v.removeEventListener("change", p);
1408
1513
  }, []);
1409
- }, Ht = ({ isActive: e }) => {
1410
- var d, m, l, y;
1411
- const t = A(null), { isLoadedMetaData: o, isPlaying: r } = b(), { elementRefs: a } = L();
1412
- Ft(t), E(() => {
1413
- if (!e || !(a != null && a.waveformInst) || !(a != null && a.audioEl) || !o || r)
1514
+ }, dr = ({ isActive: e }) => {
1515
+ var u, d, l, m;
1516
+ const t = S(null), { isLoadedMetaData: n, isPlaying: a } = k(), { elementRefs: r } = L();
1517
+ ur(t), P(() => {
1518
+ if (!e || !(r != null && r.waveformInst) || !(r != null && r.audioEl) || !n || a)
1414
1519
  return;
1415
- const u = ce(
1416
- a.audioEl.currentTime,
1417
- a.audioEl.duration
1520
+ const p = pe(
1521
+ r.audioEl.currentTime,
1522
+ r.audioEl.duration
1418
1523
  );
1419
- a.waveformInst.seekTo(u);
1524
+ r.waveformInst.seekTo(p);
1420
1525
  }, [
1421
1526
  e,
1422
- o,
1423
- a == null ? void 0 : a.waveformInst,
1424
- a == null ? void 0 : a.audioEl,
1425
- r
1527
+ n,
1528
+ r == null ? void 0 : r.waveformInst,
1529
+ r == null ? void 0 : r.audioEl,
1530
+ a
1426
1531
  ]);
1427
- const s = Qe(), n = f(
1428
- (u, p) => {
1429
- var T;
1430
- p && ((T = a == null ? void 0 : a.waveformInst) == null || T.seekTo(ce(u, p)));
1532
+ const i = yt(), s = E(
1533
+ (p, v) => {
1534
+ var f;
1535
+ v && ((f = r == null ? void 0 : r.waveformInst) == null || f.seekTo(pe(p, v)));
1431
1536
  },
1432
- [a == null ? void 0 : a.waveformInst]
1433
- ), c = Je(n);
1434
- return /* @__PURE__ */ i("div", { className: "rmap-waveform-wrapper", "data-active": e, children: /* @__PURE__ */ i(
1537
+ [r == null ? void 0 : r.waveformInst]
1538
+ ), o = vt(s);
1539
+ return /* @__PURE__ */ c("div", { className: "rmap-waveform-wrapper", "data-active": e, children: /* @__PURE__ */ c(
1435
1540
  "div",
1436
1541
  {
1437
1542
  id: "rm-waveform",
@@ -1442,147 +1547,119 @@ const xt = W(function({
1442
1547
  "aria-valuemin": 0,
1443
1548
  "aria-valuemax": 100,
1444
1549
  "aria-valuenow": Math.round(
1445
- (((d = a == null ? void 0 : a.audioEl) == null ? void 0 : d.currentTime) ?? 0) / (((m = a == null ? void 0 : a.audioEl) == null ? void 0 : m.duration) || 1) * 100
1550
+ (((u = r == null ? void 0 : r.audioEl) == null ? void 0 : u.currentTime) ?? 0) / (((d = r == null ? void 0 : r.audioEl) == null ? void 0 : d.duration) || 1) * 100
1446
1551
  ),
1447
1552
  "aria-valuetext": `${ee(
1448
- ((l = a == null ? void 0 : a.audioEl) == null ? void 0 : l.currentTime) ?? 0
1449
- )} of ${ee(((y = a == null ? void 0 : a.audioEl) == null ? void 0 : y.duration) ?? 0)}`,
1450
- onKeyDown: c,
1451
- ...s
1553
+ ((l = r == null ? void 0 : r.audioEl) == null ? void 0 : l.currentTime) ?? 0
1554
+ )} of ${ee(((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.duration) ?? 0)}`,
1555
+ onKeyDown: o,
1556
+ ...i
1452
1557
  }
1453
1558
  ) });
1454
- }, Rt = () => {
1455
- const { activeUI: e } = O(), t = e.progress ?? (e.all ? "bar" : !1), o = t === "waveform", r = t === "bar", [a, s] = C(o);
1456
- return E(() => {
1457
- o && !a && s(!0);
1458
- }, [o, a]), /* @__PURE__ */ w("div", { className: "rmap-progress-container", children: [
1459
- a && /* @__PURE__ */ i(Ht, { isActive: o }),
1460
- r && /* @__PURE__ */ i(Vt, {})
1461
- ] });
1462
- }, zt = ({
1463
- placement: e
1559
+ }, ft = ({
1560
+ gridArea: e,
1561
+ visible: t,
1562
+ type: n,
1563
+ width: a,
1564
+ ...r
1464
1565
  }) => {
1465
- var y;
1466
- const t = A(null), { volume: o, muted: r } = b(), { elementRefs: a } = L(), s = g(P), n = f(
1467
- (u) => {
1468
- u.stopPropagation(), u.preventDefault(), r && s({ type: "SET_MUTED", muted: !1 });
1469
- const { value: p } = u.target, T = parseFloat(p);
1470
- s({
1471
- type: "SET_VOLUME",
1472
- volume: T
1473
- });
1474
- },
1475
- [r, s]
1476
- ), c = o ?? ((y = a == null ? void 0 : a.audioEl) == null ? void 0 : y.volume) ?? 0, d = c * 100, m = Math.round(d), l = D(
1477
- () => ({
1478
- "--rm-audio-player-volume-value": `${d}%`
1479
- }),
1480
- [d]
1481
- );
1482
- return /* @__PURE__ */ i(
1483
- "div",
1566
+ const { activeUI: i } = M(), s = n ?? (i.progress === "waveform" ? "waveform" : "bar"), o = s === "waveform", u = s === "bar", [d, l] = N(o);
1567
+ P(() => {
1568
+ o && !d && l(!0);
1569
+ }, [o, d]);
1570
+ const m = B("progress", e);
1571
+ return /* @__PURE__ */ c(
1572
+ _.Item,
1484
1573
  {
1485
- ref: t,
1486
- className: "rmap-volume-container",
1487
- "data-placement": e,
1488
- "data-testid": "volume-slider",
1489
- style: l,
1490
- children: /* @__PURE__ */ i("div", { className: "rmap-volume-panel", children: /* @__PURE__ */ i(
1491
- "input",
1492
- {
1493
- className: "rmap-volume-slider",
1494
- type: "range",
1495
- style: { cursor: "pointer" },
1496
- value: c,
1497
- onChange: n,
1498
- min: "0",
1499
- max: "1",
1500
- step: "0.01",
1501
- "aria-label": r ? "Volume (muted)" : "Volume",
1502
- "aria-valuetext": `${m} percent`
1503
- }
1504
- ) })
1574
+ gridArea: m,
1575
+ width: a ?? "100%",
1576
+ visible: t ?? !0,
1577
+ ...r,
1578
+ children: /* @__PURE__ */ w("div", { className: "rmap-progress-container", children: [
1579
+ d && /* @__PURE__ */ c(dr, { isActive: o }),
1580
+ u && /* @__PURE__ */ c(ir, {})
1581
+ ] })
1505
1582
  }
1506
1583
  );
1507
- }, ue = H(null);
1508
- ue.displayName = "DropdownContext";
1509
- const Ze = ({
1584
+ }, me = K(null);
1585
+ me.displayName = "DropdownContext";
1586
+ const Tt = ({
1510
1587
  clickArea: e,
1511
1588
  triggerType: t,
1512
- isOpen: o,
1513
- setIsOpen: r,
1514
- onOpenChange: a
1589
+ isOpen: n,
1590
+ setIsOpen: a,
1591
+ onOpenChange: r
1515
1592
  }) => {
1516
- const s = A(), n = (l) => {
1517
- const y = () => {
1518
- clearTimeout(s.current), s.current = void 0;
1519
- }, u = (p) => {
1520
- r(p), a && a(p), y();
1593
+ const i = S(), s = (l) => {
1594
+ const m = () => {
1595
+ clearTimeout(i.current), i.current = void 0;
1596
+ }, p = (v) => {
1597
+ a(v), r && r(v), m();
1521
1598
  };
1522
- if (y(), l) {
1523
- s.current = window.setTimeout(() => u(!0), 100);
1599
+ if (m(), l) {
1600
+ i.current = window.setTimeout(() => p(!0), 100);
1524
1601
  return;
1525
1602
  }
1526
- s.current = window.setTimeout(() => u(!1), 100);
1527
- }, c = (l) => {
1528
- t === "hover" && n(l);
1603
+ i.current = window.setTimeout(() => p(!1), 100);
1604
+ }, o = (l) => {
1605
+ t === "hover" && s(l);
1529
1606
  };
1530
1607
  return {
1531
1608
  onClick: e === "content" ? (l) => {
1532
1609
  l.stopPropagation(), l.nativeEvent.stopImmediatePropagation();
1533
1610
  } : () => {
1534
- t === "click" && (r(!o), a && a(!o));
1611
+ t === "click" && (a(!n), r && r(!n));
1535
1612
  },
1536
- onKeyUp: () => c(!0),
1537
- onMouseEnter: () => c(!0),
1538
- onMouseLeave: () => c(!1),
1539
- onFocus: () => c(!0),
1540
- onBlur: () => c(!1)
1613
+ onKeyUp: () => o(!0),
1614
+ onMouseEnter: () => o(!0),
1615
+ onMouseLeave: () => o(!1),
1616
+ onFocus: () => o(!0),
1617
+ onBlur: () => o(!1)
1541
1618
  };
1542
- }, ie = ({
1619
+ }, j = ({
1543
1620
  triggerType: e = "click",
1544
1621
  outboundClickActive: t = !0,
1545
- children: o,
1546
- isOpen: r,
1547
- placement: a = "bottom",
1548
- disabled: s = !1,
1549
- onOpenChange: n,
1550
- "data-testid": c
1622
+ children: n,
1623
+ isOpen: a,
1624
+ placement: r = "bottom",
1625
+ disabled: i = !1,
1626
+ onOpenChange: s,
1627
+ "data-testid": o
1551
1628
  }) => {
1552
- const d = A(null), [m, l] = te.Children.toArray(o), [y, u] = C(!1), p = Ze({
1553
- setIsOpen: u,
1554
- isOpen: y,
1629
+ const u = S(null), [d, l] = te.Children.toArray(n), [m, p] = N(!1), v = Tt({
1630
+ setIsOpen: p,
1631
+ isOpen: m,
1555
1632
  triggerType: e,
1556
1633
  clickArea: "root"
1557
- }), T = Ne();
1558
- Ye(d, () => t && u(!1)), E(() => {
1559
- r !== void 0 && u(r);
1560
- }, [r]);
1561
- const v = D(
1634
+ }), f = $e();
1635
+ dt(u, () => t && p(!1)), P(() => {
1636
+ a !== void 0 && p(a);
1637
+ }, [a]);
1638
+ const y = x(
1562
1639
  () => ({
1563
- dropdownRef: d,
1564
- placement: a,
1565
- isOpen: y,
1566
- setIsOpen: u,
1567
- onOpenChange: n,
1568
- dropdownId: T
1640
+ dropdownRef: u,
1641
+ placement: r,
1642
+ isOpen: m,
1643
+ setIsOpen: p,
1644
+ onOpenChange: s,
1645
+ dropdownId: f
1569
1646
  }),
1570
- [a, y, n, T]
1647
+ [r, m, s, f]
1571
1648
  );
1572
- return /* @__PURE__ */ i(ue.Provider, { value: v, children: /* @__PURE__ */ i(
1649
+ return /* @__PURE__ */ c(me.Provider, { value: y, children: /* @__PURE__ */ c(
1573
1650
  "div",
1574
1651
  {
1575
1652
  className: "rmap-dropdown-container",
1576
- ref: d,
1577
- "data-testid": c,
1578
- ...p,
1579
- children: /* @__PURE__ */ w(z, { children: [
1580
- m,
1581
- !s && l
1653
+ ref: u,
1654
+ "data-testid": o,
1655
+ ...v,
1656
+ children: /* @__PURE__ */ w(G, { children: [
1657
+ d,
1658
+ !i && l
1582
1659
  ] })
1583
1660
  }
1584
1661
  ) });
1585
- }, Wt = (e, t) => D(() => {
1662
+ }, pr = (e, t) => x(() => {
1586
1663
  if (t)
1587
1664
  return {
1588
1665
  position: "absolute",
@@ -1593,199 +1670,327 @@ const Ze = ({
1593
1670
  left: e === "right" ? `${t.width}px` : void 0,
1594
1671
  right: e === "left" ? `${t.width}px` : void 0
1595
1672
  };
1596
- }, [t, e]), Gt = ({
1673
+ }, [t, e]), mr = ({
1597
1674
  children: e,
1598
1675
  isWithAnimation: t = !0,
1599
- ...o
1676
+ ...n
1600
1677
  }) => {
1601
- const { dropdownRef: r, placement: a, isOpen: s, setIsOpen: n, dropdownId: c } = g(ue), [d, m] = C(), { onClick: l } = Ze({
1602
- setIsOpen: n,
1603
- isOpen: s,
1678
+ const { dropdownRef: a, placement: r, isOpen: i, setIsOpen: s, dropdownId: o } = A(me), [u, d] = N(), { onClick: l } = Tt({
1679
+ setIsOpen: s,
1680
+ isOpen: i,
1604
1681
  clickArea: "content"
1605
- }), y = () => n(!1), u = () => n(!0);
1606
- E(() => {
1607
- r.current && m({
1608
- width: r.current.offsetWidth,
1609
- height: r.current.offsetHeight
1682
+ }), m = () => s(!1), p = () => s(!0);
1683
+ P(() => {
1684
+ a.current && d({
1685
+ width: a.current.offsetWidth,
1686
+ height: a.current.offsetHeight
1610
1687
  });
1611
- }, [r]);
1612
- const p = Wt(a, d), T = d ? /* @__PURE__ */ i(
1688
+ }, [a]);
1689
+ const v = pr(r, u), f = u ? /* @__PURE__ */ c(
1613
1690
  "div",
1614
1691
  {
1615
- ...o,
1616
- id: c,
1617
- style: { ...p, ...o.style },
1692
+ ...n,
1693
+ id: o,
1694
+ style: { ...v, ...n.style },
1618
1695
  onClick: l,
1619
1696
  children: e
1620
1697
  }
1621
1698
  ) : null;
1622
- return t ? /* @__PURE__ */ i(
1623
- Se,
1699
+ return t ? /* @__PURE__ */ c(
1700
+ Ce,
1624
1701
  {
1625
- visible: s,
1702
+ visible: i,
1626
1703
  name: "rmap-dropdown-content",
1627
1704
  enterTime: 20,
1628
1705
  leaveTime: 60,
1629
1706
  clearTime: 300,
1630
- onExited: y,
1631
- onEntered: u,
1632
- children: T
1707
+ onExited: m,
1708
+ onEntered: p,
1709
+ children: f
1633
1710
  }
1634
- ) : s ? T : null;
1635
- }, et = ve(({ children: e, className: t, ...o }, r) => {
1636
- const { isOpen: a, dropdownId: s } = g(ue), n = t ? `rmap-dropdown-trigger ${t}` : "rmap-dropdown-trigger";
1637
- return /* @__PURE__ */ i(
1711
+ ) : i ? f : null;
1712
+ }, ht = Pe(({ children: e, className: t, ...n }, a) => {
1713
+ const { isOpen: r, dropdownId: i } = A(me), s = t ? `rmap-dropdown-trigger ${t}` : "rmap-dropdown-trigger";
1714
+ return /* @__PURE__ */ c(
1638
1715
  q,
1639
1716
  {
1640
- className: n,
1717
+ className: s,
1641
1718
  type: "button",
1642
- ...o,
1719
+ ...n,
1643
1720
  "aria-haspopup": "true",
1644
- "aria-expanded": a,
1645
- "aria-controls": s,
1646
- ref: r,
1721
+ "aria-expanded": r,
1722
+ "aria-controls": i,
1723
+ ref: a,
1647
1724
  children: e
1648
1725
  }
1649
1726
  );
1650
1727
  });
1651
- et.displayName = "DropdownTrigger";
1652
- ie.Content = Gt;
1653
- ie.Trigger = et;
1654
- const jt = ({
1728
+ ht.displayName = "DropdownTrigger";
1729
+ j.Content = mr;
1730
+ j.Trigger = ht;
1731
+ const yr = ({
1655
1732
  triggerRef: e,
1656
1733
  initialState: t
1657
1734
  }) => {
1658
- const { playerPlacement: o } = O(), [r, a] = C(t);
1659
- return E(() => {
1735
+ const { playerPlacement: n } = M(), [a, r] = N(t);
1736
+ return P(() => {
1660
1737
  if (e.current) {
1661
- const s = () => e.current.getBoundingClientRect().top < window.innerHeight / 2 ? "bottom" : "top", n = setTimeout(() => {
1662
- a(s());
1738
+ const i = () => e.current.getBoundingClientRect().top < window.innerHeight / 2 ? "bottom" : "top", s = setTimeout(() => {
1739
+ r(i());
1663
1740
  }, 0);
1664
1741
  return () => {
1665
- clearTimeout(n);
1742
+ clearTimeout(s);
1666
1743
  };
1667
1744
  }
1668
- }, [o, e]), r;
1669
- }, qt = () => {
1670
- const e = A(null), { muted: t } = b(), o = g(P), r = f(
1671
- () => o({ type: "SET_MUTED", muted: !t }),
1672
- [o, t]
1745
+ }, [n, e]), a;
1746
+ }, gt = ({
1747
+ triggerType: e,
1748
+ placement: t,
1749
+ contextPlacement: n,
1750
+ triggerRef: a,
1751
+ defaults: r
1752
+ }) => {
1753
+ const i = yr({
1754
+ triggerRef: a,
1755
+ initialState: r.placement
1756
+ }), s = e ?? r.triggerType;
1757
+ return {
1758
+ triggerType: s,
1759
+ placement: t ?? n ?? i,
1760
+ contentRole: s === "hover" ? "tooltip" : "dialog"
1761
+ };
1762
+ }, vr = [
1763
+ 0.5,
1764
+ 0.75,
1765
+ 1,
1766
+ 1.25,
1767
+ 1.5,
1768
+ 1.75,
1769
+ 2
1770
+ ], fr = (e) => `${e}×`, _e = z(
1771
+ function({
1772
+ gridArea: t,
1773
+ visible: n,
1774
+ options: a,
1775
+ formatRate: r,
1776
+ triggerType: i,
1777
+ placement: s,
1778
+ ...o
1779
+ }) {
1780
+ const u = S(null), { playbackRate: d } = k(), l = A(
1781
+ b
1782
+ ), { speedSelectorPlacement: m } = M(), p = B("playbackRate", t), v = a ?? vr, f = r ?? fr, { triggerType: y, placement: T } = gt({
1783
+ triggerType: i,
1784
+ placement: s,
1785
+ contextPlacement: m,
1786
+ triggerRef: u,
1787
+ defaults: { triggerType: "click", placement: "top" }
1788
+ }), h = E(
1789
+ (g) => {
1790
+ l({ type: "SET_PLAYBACK_RATE", playbackRate: g });
1791
+ },
1792
+ [l]
1793
+ );
1794
+ return /* @__PURE__ */ c(
1795
+ _.Item,
1796
+ {
1797
+ gridArea: p,
1798
+ visible: n ?? !0,
1799
+ ...o,
1800
+ children: /* @__PURE__ */ w(
1801
+ j,
1802
+ {
1803
+ triggerType: y,
1804
+ placement: T,
1805
+ "data-testid": "speed-selector-dropdown",
1806
+ children: [
1807
+ /* @__PURE__ */ c(
1808
+ j.Trigger,
1809
+ {
1810
+ ref: u,
1811
+ "aria-label": `Playback speed, currently ${f(
1812
+ d
1813
+ )}`,
1814
+ className: "rmap-speed-selector-trigger",
1815
+ "data-testid": "speed-selector-trigger",
1816
+ children: f(d)
1817
+ }
1818
+ ),
1819
+ /* @__PURE__ */ c(j.Content, { children: /* @__PURE__ */ c(
1820
+ "ul",
1821
+ {
1822
+ role: "menu",
1823
+ "aria-label": "Playback speed",
1824
+ className: "rmap-speed-selector-menu",
1825
+ children: v.map((g) => {
1826
+ const C = g === d;
1827
+ return /* @__PURE__ */ c("li", { role: "none", children: /* @__PURE__ */ c(
1828
+ "button",
1829
+ {
1830
+ type: "button",
1831
+ role: "menuitemradio",
1832
+ "aria-checked": C,
1833
+ className: C ? "rmap-speed-selector-option rmap-speed-selector-option--active" : "rmap-speed-selector-option",
1834
+ "data-testid": "speed-selector-option",
1835
+ "data-rate": g,
1836
+ onClick: () => h(g),
1837
+ children: f(g)
1838
+ }
1839
+ ) }, g);
1840
+ })
1841
+ }
1842
+ ) })
1843
+ ]
1844
+ }
1845
+ )
1846
+ }
1847
+ );
1848
+ }
1849
+ );
1850
+ _e.displayName = "SpeedSelector";
1851
+ const Tr = ({
1852
+ placement: e
1853
+ }) => {
1854
+ var m;
1855
+ const t = S(null), { volume: n, muted: a } = k(), { elementRefs: r } = L(), i = A(b), s = E(
1856
+ (p) => {
1857
+ p.stopPropagation(), p.preventDefault(), a && i({ type: "SET_MUTED", muted: !1 });
1858
+ const { value: v } = p.target, f = parseFloat(v);
1859
+ i({
1860
+ type: "SET_VOLUME",
1861
+ volume: f
1862
+ });
1863
+ },
1864
+ [a, i]
1865
+ ), o = n ?? ((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.volume) ?? 0, u = o * 100, d = Math.round(u), l = x(
1866
+ () => ({
1867
+ "--rm-audio-player-volume-value": `${u}%`
1868
+ }),
1869
+ [u]
1870
+ );
1871
+ return /* @__PURE__ */ c(
1872
+ "div",
1873
+ {
1874
+ ref: t,
1875
+ className: "rmap-volume-container",
1876
+ "data-placement": e,
1877
+ "data-testid": "volume-slider",
1878
+ style: l,
1879
+ children: /* @__PURE__ */ c("div", { className: "rmap-volume-panel", children: /* @__PURE__ */ c(
1880
+ "input",
1881
+ {
1882
+ className: "rmap-volume-slider",
1883
+ type: "range",
1884
+ style: { cursor: "pointer" },
1885
+ value: o,
1886
+ onChange: s,
1887
+ min: "0",
1888
+ max: "1",
1889
+ step: "0.01",
1890
+ "aria-label": a ? "Volume (muted)" : "Volume",
1891
+ "aria-valuetext": `${d} percent`
1892
+ }
1893
+ ) })
1894
+ }
1895
+ );
1896
+ }, Et = ({
1897
+ gridArea: e,
1898
+ visible: t,
1899
+ triggerType: n,
1900
+ placement: a,
1901
+ ...r
1902
+ }) => {
1903
+ const i = S(null), { muted: s } = k(), o = A(b), u = E(
1904
+ () => o({ type: "SET_MUTED", muted: !s }),
1905
+ [o, s]
1673
1906
  ), {
1674
- activeUI: { volumeSlider: a },
1675
- volumeSliderPlacement: s
1676
- } = O(), n = jt({
1677
- triggerRef: e,
1678
- initialState: "bottom"
1907
+ activeUI: { volumeSlider: d },
1908
+ volumeSliderPlacement: l
1909
+ } = M(), m = B("volume", e), {
1910
+ triggerType: p,
1911
+ placement: v,
1912
+ contentRole: f
1913
+ } = gt({
1914
+ triggerType: n,
1915
+ placement: a,
1916
+ contextPlacement: l,
1917
+ triggerRef: i,
1918
+ defaults: { triggerType: "hover", placement: "bottom" }
1679
1919
  });
1680
- return /* @__PURE__ */ w(
1681
- ie,
1920
+ return /* @__PURE__ */ c(_.Item, { gridArea: m, visible: t ?? !0, ...r, children: /* @__PURE__ */ w(
1921
+ j,
1682
1922
  {
1683
- placement: s || n,
1684
- triggerType: "hover",
1685
- disabled: a === !1,
1923
+ placement: v,
1924
+ triggerType: p,
1925
+ disabled: d === !1,
1686
1926
  "data-testid": "volume-dropdown",
1687
1927
  children: [
1688
- /* @__PURE__ */ i(
1689
- ie.Trigger,
1928
+ /* @__PURE__ */ c(
1929
+ j.Trigger,
1690
1930
  {
1691
- ref: e,
1692
- "aria-label": t ? "Unmute" : "Mute",
1693
- "aria-pressed": t,
1694
- onClick: r,
1931
+ ref: i,
1932
+ "aria-label": s ? "Unmute" : "Mute",
1933
+ "aria-pressed": s,
1934
+ onClick: u,
1695
1935
  className: "rmap-volume-trigger",
1696
1936
  "data-testid": "volume-trigger-btn",
1697
- "data-muted": String(t),
1698
- children: /* @__PURE__ */ i(qe, {})
1937
+ "data-muted": String(s),
1938
+ children: /* @__PURE__ */ c(ut, {})
1699
1939
  }
1700
1940
  ),
1701
- /* @__PURE__ */ i(ie.Content, { role: "tooltip", children: /* @__PURE__ */ i(
1702
- zt,
1703
- {
1704
- placement: s || n
1705
- }
1706
- ) })
1941
+ /* @__PURE__ */ c(j.Content, { role: f, children: /* @__PURE__ */ c(Tr, { placement: v }) })
1707
1942
  ]
1708
1943
  }
1709
- );
1710
- }, Yt = () => {
1711
- var r, a, s, n, c, d, m, l, y, u;
1712
- const { interfacePlacement: e, activeUI: t } = O(), o = !!(t.prevNnext ?? t.all);
1713
- return /* @__PURE__ */ w(z, { children: [
1714
- /* @__PURE__ */ i(
1715
- M.Item,
1716
- {
1717
- gridArea: ((r = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : r.progress) || ((a = e == null ? void 0 : e.templateArea) == null ? void 0 : a.progress) || N.templateArea.progress,
1718
- width: "100%",
1719
- visible: !!(t.progress !== void 0 ? t.progress : t.all),
1720
- children: /* @__PURE__ */ i(Rt, {})
1721
- }
1722
- ),
1723
- /* @__PURE__ */ i(
1724
- M.Item,
1725
- {
1726
- gridArea: ((s = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : s.repeatType) || ((n = e == null ? void 0 : e.templateArea) == null ? void 0 : n.repeatType) || N.templateArea.repeatType,
1727
- visible: !!(t.repeatType ?? t.all),
1728
- children: /* @__PURE__ */ i(Lt, {})
1729
- }
1730
- ),
1731
- /* @__PURE__ */ i(
1732
- M.Item,
1733
- {
1734
- gridArea: ((c = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : c.playButton) || ((d = e == null ? void 0 : e.templateArea) == null ? void 0 : d.playButton) || N.templateArea.playButton,
1735
- visible: !!(t.playButton ?? t.all),
1736
- children: /* @__PURE__ */ w("div", { className: "rmap-ctrl-btn-wrapper", children: [
1737
- /* @__PURE__ */ i(It, { isVisible: o }),
1738
- /* @__PURE__ */ i(Et, {}),
1739
- /* @__PURE__ */ i(St, { isVisible: o })
1740
- ] })
1741
- }
1742
- ),
1743
- /* @__PURE__ */ i(
1744
- M.Item,
1745
- {
1746
- gridArea: ((m = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : m.volume) || ((l = e == null ? void 0 : e.templateArea) == null ? void 0 : l.volume) || N.templateArea.volume,
1747
- visible: !!(t.volume ?? t.all),
1748
- children: /* @__PURE__ */ i(qt, {})
1749
- }
1750
- ),
1751
- /* @__PURE__ */ i(
1752
- M.Item,
1753
- {
1754
- gridArea: ((y = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : y.playList) || ((u = e == null ? void 0 : e.templateArea) == null ? void 0 : u.playList) || N.templateArea.playList,
1755
- visible: !!(t.playList ?? t.all),
1756
- children: /* @__PURE__ */ i(Ut, {})
1757
- }
1758
- )
1944
+ ) });
1945
+ }, hr = () => {
1946
+ const { activeUI: e } = M(), t = (n) => !!(e[n] ?? e.all);
1947
+ return /* @__PURE__ */ w(G, { children: [
1948
+ /* @__PURE__ */ c(ft, { visible: t("progress") }),
1949
+ /* @__PURE__ */ c(lt, { visible: t("repeatType") }),
1950
+ /* @__PURE__ */ c(ct, { visible: t("playButton") }),
1951
+ /* @__PURE__ */ c(Et, { visible: t("volume") }),
1952
+ /* @__PURE__ */ c(_e, { visible: t("playbackRate") }),
1953
+ /* @__PURE__ */ c(mt, { visible: t("playList") })
1759
1954
  ] });
1760
- }, Xt = W(function() {
1761
- const { playList: t, curIdx: o } = V(), { coverImgsCss: r } = L(), a = t[o], s = [a == null ? void 0 : a.writer, a == null ? void 0 : a.name].filter(Boolean).join(" - ") || "Album artwork";
1762
- return /* @__PURE__ */ i("div", { className: "rmap-artwork-container", children: a != null && a.img ? /* @__PURE__ */ i("img", { src: a.img, alt: s, style: r == null ? void 0 : r.artwork }) : /* @__PURE__ */ i(
1955
+ }, At = z(function({
1956
+ gridArea: t,
1957
+ visible: n,
1958
+ ...a
1959
+ }) {
1960
+ const { playList: r, curIdx: i } = $(), { coverImgsCss: s } = L(), o = r[i], u = [o == null ? void 0 : o.writer, o == null ? void 0 : o.name].filter(Boolean).join(" - ") || "Album artwork", d = B("artwork", t);
1961
+ return /* @__PURE__ */ c(_.Item, { gridArea: d, visible: n ?? !0, ...a, children: /* @__PURE__ */ c("div", { className: "rmap-artwork-container", children: o != null && o.img ? /* @__PURE__ */ c("img", { src: o.img, alt: u, style: s == null ? void 0 : s.artwork }) : /* @__PURE__ */ c(
1763
1962
  "div",
1764
1963
  {
1765
1964
  className: "rmap-artwork-fallback",
1766
1965
  role: "img",
1767
- "aria-label": s,
1768
- style: r == null ? void 0 : r.artwork,
1769
- children: (a == null ? void 0 : a.name) || "♪"
1966
+ "aria-label": u,
1967
+ style: s == null ? void 0 : s.artwork,
1968
+ children: (o == null ? void 0 : o.name) || "♪"
1770
1969
  }
1771
- ) });
1772
- }), Qt = W(function() {
1773
- const { playList: t, curIdx: o } = V(), r = t[o];
1774
- return /* @__PURE__ */ i("div", { className: "rmap-track-info-container", children: r != null && r.customTrackInfo ? r.customTrackInfo : /* @__PURE__ */ w(z, { children: [
1775
- (r == null ? void 0 : r.name) && /* @__PURE__ */ i("span", { className: "title", "data-testid": "track-title", children: r.name }),
1776
- (r == null ? void 0 : r.writer) && /* @__PURE__ */ i("span", { className: "writer", children: r.writer })
1777
- ] }) });
1778
- }), tt = ({ position: e, className: t, children: o, ...r }) => /* @__PURE__ */ i(
1970
+ ) }) });
1971
+ }), De = z(function({
1972
+ gridArea: t,
1973
+ visible: n,
1974
+ ...a
1975
+ }) {
1976
+ const { playList: r, curIdx: i } = $(), s = r[i], o = B("trackInfo", t);
1977
+ return /* @__PURE__ */ c(_.Item, { gridArea: o, visible: n ?? !0, ...a, children: /* @__PURE__ */ c("div", { className: "rmap-track-info-container", children: s != null && s.customTrackInfo ? s.customTrackInfo : /* @__PURE__ */ w(G, { children: [
1978
+ (s == null ? void 0 : s.name) && /* @__PURE__ */ c("span", { className: "title", "data-testid": "track-title", children: s.name }),
1979
+ (s == null ? void 0 : s.writer) && /* @__PURE__ */ c("span", { className: "writer", children: s.writer })
1980
+ ] }) }) });
1981
+ });
1982
+ De.displayName = "TrackInfo";
1983
+ const Pt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */ c(
1779
1984
  "div",
1780
1985
  {
1781
1986
  className: `rmap-track-time-container${t ? ` ${t}` : ""}`,
1782
1987
  "data-position": e,
1783
- ...r,
1784
- children: o
1988
+ ...a,
1989
+ children: n
1785
1990
  }
1786
- ), Jt = ({ position: e }) => {
1991
+ ), gr = ({ position: e }) => {
1787
1992
  const { currentTime: t } = re();
1788
- return /* @__PURE__ */ i(tt, { position: e, className: "rmap-track-time-current", children: /* @__PURE__ */ i(
1993
+ return /* @__PURE__ */ c(Pt, { position: e, className: "rmap-track-time-current", children: /* @__PURE__ */ c(
1789
1994
  "span",
1790
1995
  {
1791
1996
  className: "rmap-track-current-time",
@@ -1793,28 +1998,23 @@ const jt = ({
1793
1998
  children: ee(t)
1794
1999
  }
1795
2000
  ) });
1796
- }, Zt = ({ position: e }) => {
2001
+ }, Er = ({ position: e }) => {
1797
2002
  const { duration: t } = re();
1798
- return /* @__PURE__ */ i(
1799
- tt,
2003
+ return /* @__PURE__ */ c(
2004
+ Pt,
1800
2005
  {
1801
2006
  position: e,
1802
2007
  className: "rmap-track-time-duration",
1803
- children: /* @__PURE__ */ i("span", { className: "rmap-track-duration", children: ee(t) })
2008
+ children: /* @__PURE__ */ c("span", { className: "rmap-track-duration", children: ee(t) })
1804
2009
  }
1805
2010
  );
1806
- }, er = () => {
1807
- var c, d, m, l, y, u, p, T;
1808
- const { interfacePlacement: e, activeUI: t } = O(), o = f(
1809
- (v) => +v.split(/[^\d]/).join(""),
2011
+ }, St = ({ visible: e }) => {
2012
+ const t = B("trackTimeCurrent"), n = B("trackTimeDuration"), a = E(
2013
+ (d) => +d.split(/[^\d]/).join(""),
1810
2014
  []
1811
- ), r = o(
1812
- ((c = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : c.trackTimeCurrent) || ((d = e == null ? void 0 : e.templateArea) == null ? void 0 : d.trackTimeCurrent) || N.templateArea.trackTimeCurrent
1813
- ), a = o(
1814
- ((m = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : m.trackTimeDuration) || ((l = e == null ? void 0 : e.templateArea) == null ? void 0 : l.trackTimeDuration) || N.templateArea.trackTimeDuration
1815
- ), s = f(
1816
- (v) => {
1817
- switch (v) {
2015
+ ), r = a(t), i = a(n), s = E(
2016
+ (d) => {
2017
+ switch (d) {
1818
2018
  case 1:
1819
2019
  return "right";
1820
2020
  case -1:
@@ -1824,296 +2024,373 @@ const jt = ({
1824
2024
  }
1825
2025
  },
1826
2026
  []
1827
- ), n = {
1828
- current: s(r - a),
1829
- duration: s(a - r)
1830
- };
1831
- return /* @__PURE__ */ w(z, { children: [
1832
- /* @__PURE__ */ i(
1833
- M.Item,
1834
- {
1835
- gridArea: ((y = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : y.trackTimeCurrent) || ((u = e == null ? void 0 : e.templateArea) == null ? void 0 : u.trackTimeCurrent) || N.templateArea.trackTimeCurrent,
1836
- visible: !!(t.trackTime ?? t.all),
1837
- children: /* @__PURE__ */ i(Jt, { position: n.current })
1838
- }
1839
- ),
1840
- /* @__PURE__ */ i(
1841
- M.Item,
1842
- {
1843
- gridArea: ((p = e == null ? void 0 : e.itemCustomArea) == null ? void 0 : p.trackTimeDuration) || ((T = e == null ? void 0 : e.templateArea) == null ? void 0 : T.trackTimeDuration) || N.templateArea.trackTimeDuration,
1844
- visible: !!(t.trackTime ?? t.all),
1845
- children: /* @__PURE__ */ i(Zt, { position: n.duration })
1846
- }
1847
- )
2027
+ ), o = {
2028
+ current: s(r - i),
2029
+ duration: s(i - r)
2030
+ }, u = e ?? !0;
2031
+ return /* @__PURE__ */ w(G, { children: [
2032
+ /* @__PURE__ */ c(_.Item, { gridArea: t, visible: u, children: /* @__PURE__ */ c(gr, { position: o.current }) }),
2033
+ /* @__PURE__ */ c(_.Item, { gridArea: n, visible: u, children: /* @__PURE__ */ c(Er, { position: o.duration }) })
1848
2034
  ] });
1849
- }, tr = () => {
1850
- var s, n, c, d, m, l, y, u;
1851
- const { playList: e, curIdx: t } = V(), { interfacePlacement: o, activeUI: r } = O(), a = !!(((s = e[t]) == null ? void 0 : s.customTrackInfo) ?? ((n = e[t]) == null ? void 0 : n.writer) ?? ((c = e[t]) == null ? void 0 : c.name)) && !!(r.trackInfo ?? r.all);
1852
- return /* @__PURE__ */ w(z, { children: [
1853
- /* @__PURE__ */ i(
1854
- M.Item,
1855
- {
1856
- gridArea: ((d = o == null ? void 0 : o.itemCustomArea) == null ? void 0 : d.artwork) || ((m = o == null ? void 0 : o.templateArea) == null ? void 0 : m.artwork) || N.templateArea.artwork,
1857
- visible: !!((l = e[t]) != null && l.img && (r.artwork ?? r.all)),
1858
- children: /* @__PURE__ */ i(Xt, {})
1859
- }
1860
- ),
1861
- /* @__PURE__ */ i(
1862
- M.Item,
2035
+ }, Ar = () => {
2036
+ var r, i, s, o;
2037
+ const { playList: e, curIdx: t } = $(), { activeUI: n } = M(), a = !!(((r = e[t]) == null ? void 0 : r.customTrackInfo) ?? ((i = e[t]) == null ? void 0 : i.writer) ?? ((s = e[t]) == null ? void 0 : s.name)) && !!(n.trackInfo ?? n.all);
2038
+ return /* @__PURE__ */ w(G, { children: [
2039
+ /* @__PURE__ */ c(
2040
+ At,
1863
2041
  {
1864
- gridArea: ((y = o == null ? void 0 : o.itemCustomArea) == null ? void 0 : y.trackInfo) || ((u = o == null ? void 0 : o.templateArea) == null ? void 0 : u.trackInfo) || N.templateArea.trackInfo,
1865
- visible: a,
1866
- children: /* @__PURE__ */ i(Qt, {})
2042
+ visible: !!((o = e[t]) != null && o.img && (n.artwork ?? n.all))
1867
2043
  }
1868
2044
  ),
1869
- /* @__PURE__ */ i(er, {})
2045
+ /* @__PURE__ */ c(De, { visible: a }),
2046
+ /* @__PURE__ */ c(St, { visible: !!(n.trackTime ?? n.all) })
1870
2047
  ] });
1871
- }, rr = (e, t, o) => {
1872
- const r = f(
1873
- (u, p, T) => {
1874
- const v = Object.keys(
1875
- N.templateArea
1876
- ).filter((I) => (I === "trackTimeCurrent" || I === "trackTimeDuration") && u.trackTime === !1 ? !1 : u[I] !== void 0 ? u[I] : !0), h = u.all ? v : Object.entries(u).filter(([, I]) => I).map(([I]) => I);
2048
+ }, Ae = {
2049
+ Progress: { displayName: "Progress", activeUIKey: "progress" },
2050
+ Volume: { displayName: "Volume", activeUIKey: "volume" },
2051
+ SortablePlayList: { displayName: "PlayList", activeUIKey: "playList" },
2052
+ TransportControls: { displayName: "PlayButton", activeUIKey: "playButton" },
2053
+ RepeatTypeBtn: { displayName: "RepeatButton", activeUIKey: "repeatType" },
2054
+ Artwork: { displayName: "Artwork", activeUIKey: "artwork" },
2055
+ TrackInfo: { displayName: "TrackInfo", activeUIKey: "trackInfo" },
2056
+ TrackTime: { displayName: "TrackTime", activeUIKey: "trackTime" },
2057
+ SpeedSelector: { displayName: "SpeedSelector", activeUIKey: "playbackRate" }
2058
+ };
2059
+ function Pr(e, t) {
2060
+ const n = e[t];
2061
+ return n === !1 ? !1 : n !== void 0 ? !0 : !!e.all;
2062
+ }
2063
+ function Re(e) {
2064
+ const t = e.type;
2065
+ if (!t) return;
2066
+ const n = t.type ?? t;
2067
+ return n.displayName || n.name || void 0;
2068
+ }
2069
+ const Sr = (e, t, n, a) => {
2070
+ const r = x(
2071
+ () => (a ?? []).map(Re).map(
2072
+ (h) => {
2073
+ var g;
2074
+ return h ? (g = Ae[h]) == null ? void 0 : g.activeUIKey : void 0;
2075
+ }
2076
+ ).filter((h) => h !== void 0),
2077
+ [a]
2078
+ ), i = x(
2079
+ () => [...r].sort().join(","),
2080
+ [r]
2081
+ ), s = E(
2082
+ (h, g, C, W) => {
2083
+ const se = Object.keys(
2084
+ de.templateArea
2085
+ ).filter((I) => (I === "trackTimeCurrent" || I === "trackTimeDuration") && h.trackTime === !1 ? !1 : h[I] !== void 0 ? h[I] : !0), R = h.all ? se : Object.entries(h).filter(([, I]) => I).map(([I]) => I);
2086
+ for (const I of W)
2087
+ R.includes(I) || R.push(I);
1877
2088
  (() => {
1878
- h.find((I) => I === "trackTime") && (h.splice(h.indexOf("trackTime"), 1), h.push("trackTimeCurrent"), h.push("trackTimeDuration"));
2089
+ R.find((I) => I === "trackTime") && (R.splice(R.indexOf("trackTime"), 1), R.push("trackTimeCurrent"), R.push("trackTimeDuration"));
1879
2090
  })();
1880
- const k = {
1881
- ...N.templateArea,
1882
- ...p
1883
- }, B = Object.entries(
1884
- k
1885
- ).filter(([I]) => h.includes(I));
1886
- let R = 1;
1887
- const G = {}, ae = [
1888
- ...B,
1889
- ...Object.entries(T || {})
1890
- ].flatMap(([I, _]) => {
1891
- if (_ == null) return [];
1892
- const [K, $] = _.split("-"), j = +K.split("row")[1];
1893
- return R = Math.max(R, j), G[j] = G[j] ? G[j] + 1 : 1, [
2091
+ const ae = {
2092
+ ...de.templateArea,
2093
+ ...g
2094
+ }, ye = Object.entries(
2095
+ ae
2096
+ ).filter(([I]) => R.includes(I));
2097
+ let le = 1;
2098
+ const ue = {}, wt = [
2099
+ ...ye,
2100
+ ...Object.entries(C || {})
2101
+ ].flatMap(([I, U]) => {
2102
+ if (U == null) return [];
2103
+ const [F, H] = U.split("-"), Y = +F.split("row")[1];
2104
+ return le = Math.max(le, Y), ue[Y] = ue[Y] ? ue[Y] + 1 : 1, [
1894
2105
  {
1895
2106
  key: I,
1896
- row: j,
1897
- col: +$
2107
+ row: Y,
2108
+ col: +H
1898
2109
  }
1899
2110
  ];
1900
- }).sort((I, _) => I.col - _.col), X = Math.max(...Object.values(G));
1901
- let oe;
1902
- const rt = new Array(R).fill("").map((I, _) => {
1903
- let K = "", $;
1904
- const j = ae.filter((U) => U.row !== _ + 1 ? !1 : (U.key === "progress" && ($ = U), !0));
1905
- if ($) {
1906
- const U = /* @__PURE__ */ new Map();
1907
- j.forEach((Q) => U.set(Q.col, Q));
1908
- const de = `row${_ + 1}-${$.col}`, ne = [];
1909
- for (let Q = 0; Q < X; Q++) {
1910
- const Pe = Q + 1;
1911
- U.has(Pe) ? ne.push(`row${_ + 1}-${Pe}`) : ne.push(de);
2111
+ }).sort((I, U) => I.col - U.col), ve = Math.max(...Object.values(ue));
2112
+ let Ue;
2113
+ const bt = new Array(le).fill("").map((I, U) => {
2114
+ let F = "", H;
2115
+ const Y = wt.filter((V) => V.row !== U + 1 ? !1 : (V.key === "progress" && (H = V), !0));
2116
+ if (H) {
2117
+ const V = /* @__PURE__ */ new Map();
2118
+ Y.forEach((Q) => V.set(Q.col, Q));
2119
+ const fe = `row${U + 1}-${H.col}`, ne = [];
2120
+ for (let Q = 0; Q < ve; Q++) {
2121
+ const Oe = Q + 1;
2122
+ V.has(Oe) ? ne.push(`row${U + 1}-${Oe}`) : ne.push(fe);
1912
2123
  }
1913
- const nt = ne.indexOf(de), st = ne.lastIndexOf(de);
1914
- oe = Math.floor((nt + st) / 2), K = " " + ne.join(" ");
2124
+ const kt = ne.indexOf(fe), Ct = ne.lastIndexOf(fe);
2125
+ Ue = Math.floor((kt + Ct) / 2), F = " " + ne.join(" ");
1915
2126
  } else
1916
- for (let U = 0; U < X; U++)
1917
- K += ` row${_ + 1}-${U + 1}`;
1918
- return K.trimStart();
1919
- }), at = Xe ? window.innerWidth - 100 : 1500, ot = new Array(R).fill("").map((I, _) => {
1920
- let K = "";
1921
- for (let $ = 0; $ < X; $++) {
1922
- if (oe === $ && _ === 0) {
1923
- K += " 1fr";
2127
+ for (let V = 0; V < ve; V++)
2128
+ F += ` row${U + 1}-${V + 1}`;
2129
+ return F.trimStart();
2130
+ }), Lt = pt ? window.innerWidth - 100 : 1500, Nt = new Array(le).fill("").map((I, U) => {
2131
+ let F = "";
2132
+ for (let H = 0; H < ve; H++) {
2133
+ if (Ue === H && U === 0) {
2134
+ F += " 1fr";
1924
2135
  continue;
1925
2136
  }
1926
- K += ` fit-content(${at}px)`;
2137
+ F += ` fit-content(${Lt}px)`;
1927
2138
  }
1928
- return K.trimStart();
2139
+ return F.trimStart();
1929
2140
  });
1930
- return { gridAreas: rt, gridColumns: ot };
2141
+ return { gridAreas: bt, gridColumns: Nt };
1931
2142
  },
1932
2143
  []
1933
- ), [a, s] = C(e), [n, c] = C({
2144
+ ), [o, u] = N(e), [d, l] = N(i), [m, p] = N({
1934
2145
  templateArea: t,
1935
- customComponentsArea: o
1936
- }), [d, m] = C();
1937
- if (!d) {
1938
- const { gridAreas: u, gridColumns: p } = r(
1939
- a,
1940
- n.templateArea,
1941
- n.customComponentsArea
2146
+ customComponentsArea: n
2147
+ }), [v, f] = N();
2148
+ if (!v) {
2149
+ const { gridAreas: h, gridColumns: g } = s(
2150
+ o,
2151
+ m.templateArea,
2152
+ m.customComponentsArea,
2153
+ r
1942
2154
  );
1943
- return m({ gridAreas: u, gridColumns: p }), [u, p];
2155
+ return f({ gridAreas: h, gridColumns: g }), [h, g];
1944
2156
  }
1945
- if (a !== e || n.templateArea !== t || n.customComponentsArea !== o) {
1946
- s(e), c({ templateArea: t, customComponentsArea: o });
1947
- const { gridAreas: u, gridColumns: p } = r(
2157
+ if (o !== e || d !== i || m.templateArea !== t || m.customComponentsArea !== n) {
2158
+ u(e), l(i), p({ templateArea: t, customComponentsArea: n });
2159
+ const { gridAreas: h, gridColumns: g } = s(
1948
2160
  e,
1949
2161
  t,
1950
- o
2162
+ n,
2163
+ r
1951
2164
  );
1952
- m({ gridAreas: u, gridColumns: p });
2165
+ f({ gridAreas: h, gridColumns: g });
1953
2166
  }
1954
- const { gridAreas: l, gridColumns: y } = d;
1955
- return [l, y];
1956
- }, ar = ({ children: e }) => {
1957
- const { interfacePlacement: t, activeUI: o, playListPlacement: r } = O(), a = te.Children.toArray(e), [s, n] = rr(
1958
- o,
2167
+ const { gridAreas: y, gridColumns: T } = v;
2168
+ return [y, T];
2169
+ };
2170
+ function Ir(e) {
2171
+ return x(() => {
2172
+ const t = te.Children.toArray(e).filter(Dt), n = t.find(Be);
2173
+ return {
2174
+ compoundChildren: t.filter(
2175
+ (a) => !Be(a)
2176
+ ),
2177
+ playListEmptyNode: wr(n)
2178
+ };
2179
+ }, [e]);
2180
+ }
2181
+ function Be(e) {
2182
+ return Re(e) === We;
2183
+ }
2184
+ function wr(e) {
2185
+ if (!e) return null;
2186
+ const t = e.props;
2187
+ return (t == null ? void 0 : t.children) ?? null;
2188
+ }
2189
+ function br({
2190
+ compoundChildren: e,
2191
+ activeUI: t
2192
+ }) {
2193
+ const n = e.map(Re).filter((a) => !!(a && Ae[a])).sort().join(",");
2194
+ P(() => {
2195
+ if (process.env.NODE_ENV === "production" || !n) return;
2196
+ const a = /* @__PURE__ */ new Set();
2197
+ for (const r of n.split(",")) {
2198
+ const i = Ae[r];
2199
+ i && (a.has(i.displayName) || Pr(t, i.activeUIKey) && (a.add(i.displayName), console.warn(
2200
+ `[react-modern-audio-player] Both preset and compound '${i.displayName}' are rendered. Set \`activeUI.${i.activeUIKey}=false\` to replace the preset control.`
2201
+ )));
2202
+ }
2203
+ }, [n, t]);
2204
+ }
2205
+ const Lr = ({ children: e }) => {
2206
+ const { interfacePlacement: t, activeUI: n, playListPlacement: a } = M(), { compoundChildren: r, playListEmptyNode: i } = Ir(e);
2207
+ br({ compoundChildren: r, activeUI: n });
2208
+ const [s, o] = Sr(
2209
+ n,
1959
2210
  t == null ? void 0 : t.templateArea,
1960
- t == null ? void 0 : t.customComponentsArea
1961
- );
1962
- return /* @__PURE__ */ w(
2211
+ t == null ? void 0 : t.customComponentsArea,
2212
+ r
2213
+ ), [u, d] = N(null);
2214
+ return /* @__PURE__ */ c(
1963
2215
  "div",
1964
2216
  {
1965
2217
  className: "rmap-interface-container",
1966
2218
  "data-testid": "audio-player",
1967
2219
  role: "region",
1968
2220
  "aria-label": "Audio player",
1969
- children: [
1970
- r === "top" && /* @__PURE__ */ i("div", { className: "rmap-sortable-playlist" }),
2221
+ children: /* @__PURE__ */ c(xe.Provider, { value: u, children: /* @__PURE__ */ w(Me.Provider, { value: i, children: [
2222
+ a === "top" && /* @__PURE__ */ c("div", { ref: d, className: "rmap-sortable-playlist" }),
1971
2223
  /* @__PURE__ */ w(
1972
- M,
2224
+ _,
1973
2225
  {
1974
2226
  alignItems: "center",
1975
2227
  justifyContent: "center",
1976
2228
  areas: s,
1977
2229
  minHeight: "30px",
1978
- columns: n,
2230
+ columns: o,
1979
2231
  UNSAFE_className: "rmap-interface-grid",
1980
2232
  children: [
1981
- /* @__PURE__ */ i(tr, {}),
1982
- /* @__PURE__ */ i(Yt, {}),
1983
- a
2233
+ /* @__PURE__ */ c(Ar, {}),
2234
+ /* @__PURE__ */ c(hr, {}),
2235
+ r
1984
2236
  ]
1985
2237
  }
1986
2238
  ),
1987
- r === "bottom" && /* @__PURE__ */ i("div", { className: "rmap-sortable-playlist" })
1988
- ]
2239
+ a === "bottom" && /* @__PURE__ */ c("div", { ref: d, className: "rmap-sortable-playlist" })
2240
+ ] }) })
1989
2241
  }
1990
2242
  );
1991
2243
  }, Z = (e, t) => {
1992
- const o = A(!1);
1993
- E(() => {
1994
- if (o.current)
2244
+ const n = S(!1);
2245
+ P(() => {
2246
+ if (n.current)
1995
2247
  return e();
1996
- }, t), E(() => (o.current = !0, () => {
1997
- o.current = !1;
2248
+ }, t), P(() => (n.current = !0, () => {
2249
+ n.current = !1;
1998
2250
  }), []);
1999
- }, or = ({
2251
+ }, Nr = ({
2000
2252
  placement: e = {},
2001
2253
  activeUI: t,
2002
- coverImgsCss: o,
2003
- audioInitialState: r,
2004
- playList: a,
2005
- customIcons: s
2254
+ coverImgsCss: n,
2255
+ audioInitialState: a,
2256
+ playList: r,
2257
+ customIcons: i
2006
2258
  }) => {
2007
- const n = g(P);
2259
+ const s = A(b);
2008
2260
  Z(() => {
2009
2261
  const {
2010
- player: c,
2011
- playList: d,
2012
- interface: m,
2262
+ player: o,
2263
+ playList: u,
2264
+ interface: d,
2013
2265
  volumeSlider: l
2014
2266
  } = e;
2015
- n({
2267
+ s({
2016
2268
  type: "SET_PLACEMENTS",
2017
- playerPlacement: c,
2018
- playListPlacement: d,
2019
- interfacePlacement: m,
2269
+ playerPlacement: o,
2270
+ playListPlacement: u,
2271
+ interfacePlacement: d,
2020
2272
  volumeSliderPlacement: l
2021
2273
  });
2022
- }, [n, e]), Z(() => {
2023
- t && n({ type: "SET_ACTIVE_UI", activeUI: t });
2024
- }, [t, n]), Z(() => {
2025
- o && n({ type: "SET_COVER_IMGS_CSS", coverImgsCss: o });
2026
- }, [n, o]), Z(() => {
2027
- r && n({
2274
+ }, [s, e]), Z(() => {
2275
+ t && s({ type: "SET_ACTIVE_UI", activeUI: t });
2276
+ }, [t, s]), Z(() => {
2277
+ n && s({ type: "SET_COVER_IMGS_CSS", coverImgsCss: n });
2278
+ }, [s, n]), Z(() => {
2279
+ a && s({
2028
2280
  type: "SET_INITIAL_STATES",
2029
- audioState: r,
2030
- curPlayId: r.curPlayId
2281
+ audioState: a,
2282
+ curPlayId: a.curPlayId
2031
2283
  });
2032
- }, [r, n]), Z(() => {
2033
- n({ type: "UPDATE_PLAY_LIST", playList: a });
2034
- }, [n, a]), Z(() => {
2035
- s && n({ type: "SET_CUSTOM_ICONS", customIcons: s });
2036
- }, [s, n]);
2037
- }, nr = ({
2284
+ }, [a, s]), Z(() => {
2285
+ s({ type: "UPDATE_PLAY_LIST", playList: r });
2286
+ }, [s, r]), Z(() => {
2287
+ i && s({ type: "SET_CUSTOM_ICONS", customIcons: i });
2288
+ }, [i, s]);
2289
+ }, kr = ({
2038
2290
  audioRef: e,
2039
2291
  children: t,
2040
- ...o
2041
- }) => (or(o), /* @__PURE__ */ w("div", { id: "rm-audio-player", className: "rmap-player-container", children: [
2042
- /* @__PURE__ */ i(De, { audioRef: e }),
2043
- /* @__PURE__ */ i(ar, { children: t })
2292
+ ...n
2293
+ }) => (Nr(n), /* @__PURE__ */ w("div", { id: "rm-audio-player", className: "rmap-player-container", children: [
2294
+ /* @__PURE__ */ c(Ye, { audioRef: e }),
2295
+ /* @__PURE__ */ c(Lr, { children: t })
2044
2296
  ] }));
2045
- function we({
2297
+ function It({
2046
2298
  rootContainerProps: e,
2047
2299
  ...t
2048
2300
  }) {
2049
- return /* @__PURE__ */ i(vt, { ...t, children: /* @__PURE__ */ i(Me, { rootContainerProps: e, children: /* @__PURE__ */ i(nr, { ...t }) }) });
2301
+ return /* @__PURE__ */ c(Bt, { ...t, children: /* @__PURE__ */ c(Ge, { rootContainerProps: e, children: /* @__PURE__ */ c(kr, { ...t }) }) });
2050
2302
  }
2051
- we.displayName = "AudioPlayerWithProviders";
2052
- we.CustomComponent = _e;
2053
- const sr = () => {
2054
- const e = g(P), { isPlaying: t, repeatType: o } = b(), r = f(() => {
2303
+ It.displayName = "AudioPlayerWithProviders";
2304
+ const Kr = Object.assign(It, {
2305
+ Progress: ft,
2306
+ Volume: Et,
2307
+ PlayList: mt,
2308
+ PlayListEmpty: je,
2309
+ PlayButton: ct,
2310
+ RepeatButton: lt,
2311
+ SpeedSelector: _e,
2312
+ Artwork: At,
2313
+ TrackInfo: De,
2314
+ TrackTime: St,
2315
+ CustomComponent: Gt
2316
+ }), Cr = () => {
2317
+ const e = A(b), { isPlaying: t, repeatType: n, playbackRate: a } = k(), r = E(() => {
2055
2318
  e({ type: "CHANGE_PLAYING_STATE", state: !0 });
2056
- }, [e]), a = f(() => {
2319
+ }, [e]), i = E(() => {
2057
2320
  e({ type: "CHANGE_PLAYING_STATE", state: !1 });
2058
- }, [e]), s = f(() => {
2321
+ }, [e]), s = E(() => {
2059
2322
  e({ type: "CHANGE_PLAYING_STATE" });
2060
- }, [e]);
2061
- return { isPlaying: t, repeatType: o, play: r, pause: a, togglePlay: s };
2062
- }, ir = () => {
2063
- const e = g(P), { playList: t, curIdx: o, curPlayId: r } = V(), { elementRefs: a } = L(), s = f(
2064
- (d) => {
2065
- const m = t[d];
2066
- m && e({
2323
+ }, [e]), o = E(
2324
+ (u) => {
2325
+ e({ type: "SET_PLAYBACK_RATE", playbackRate: u });
2326
+ },
2327
+ [e]
2328
+ );
2329
+ return {
2330
+ isPlaying: t,
2331
+ repeatType: n,
2332
+ playbackRate: a,
2333
+ play: r,
2334
+ pause: i,
2335
+ togglePlay: s,
2336
+ setPlaybackRate: o
2337
+ };
2338
+ }, xr = () => {
2339
+ const e = A(b), { playList: t, curIdx: n, curPlayId: a } = $(), { elementRefs: r } = L(), i = E(
2340
+ (u) => {
2341
+ const d = t[u];
2342
+ d && e({
2067
2343
  type: "SET_CURRENT_AUDIO",
2068
- currentIndex: d,
2069
- currentAudioId: m.id
2344
+ currentIndex: u,
2345
+ currentAudioId: d.id
2070
2346
  });
2071
2347
  },
2072
2348
  [e, t]
2073
- ), n = f(() => {
2349
+ ), s = E(() => {
2074
2350
  t.length !== 0 && e({ type: "NEXT_AUDIO" });
2075
- }, [e, t.length]), c = f(() => {
2076
- var m;
2351
+ }, [e, t.length]), o = E(() => {
2352
+ var d;
2077
2353
  if (t.length === 0) return;
2078
- const d = ((m = a == null ? void 0 : a.audioEl) == null ? void 0 : m.currentTime) ?? 0;
2079
- e({ type: "PREV_AUDIO", currentTime: d });
2080
- }, [e, t.length, a == null ? void 0 : a.audioEl]);
2354
+ const u = ((d = r == null ? void 0 : r.audioEl) == null ? void 0 : d.currentTime) ?? 0;
2355
+ e({ type: "PREV_AUDIO", currentTime: u });
2356
+ }, [e, t.length, r == null ? void 0 : r.audioEl]);
2081
2357
  return {
2082
- currentPlayId: r,
2083
- currentIndex: o,
2358
+ currentPlayId: a,
2359
+ currentIndex: n,
2084
2360
  playList: t,
2085
- currentTrack: t[o] ?? null,
2086
- setTrack: s,
2087
- next: n,
2088
- prev: c
2361
+ currentTrack: t[n] ?? null,
2362
+ setTrack: i,
2363
+ next: s,
2364
+ prev: o
2089
2365
  };
2090
- }, lr = () => {
2091
- const e = g(P), { volume: t, muted: o } = b(), r = f(
2092
- (s) => {
2093
- e({ type: "SET_VOLUME", volume: s });
2366
+ }, Mr = () => {
2367
+ const e = A(b), { volume: t, muted: n } = k(), a = E(
2368
+ (i) => {
2369
+ e({ type: "SET_VOLUME", volume: i });
2094
2370
  },
2095
2371
  [e]
2096
- ), a = f(() => {
2097
- e({ type: "SET_MUTED", muted: !o });
2098
- }, [e, o]);
2099
- return { volume: t, muted: o, setVolume: r, toggleMute: a };
2100
- }, cr = () => {
2101
- const e = g(P), { currentTime: t, duration: o } = re(), r = f(
2102
- (a) => {
2103
- e({ type: "SEEK", time: a });
2372
+ ), r = E(() => {
2373
+ e({ type: "SET_MUTED", muted: !n });
2374
+ }, [e, n]);
2375
+ return { volume: t, muted: n, setVolume: a, toggleMute: r };
2376
+ }, _r = () => {
2377
+ const e = A(b), { currentTime: t, duration: n } = re(), a = E(
2378
+ (r) => {
2379
+ e({ type: "SEEK", time: r });
2104
2380
  },
2105
2381
  [e]
2106
2382
  );
2107
- return { currentTime: t, duration: o, seek: r };
2108
- }, yr = () => {
2109
- const e = sr(), t = ir(), o = lr(), r = cr();
2383
+ return { currentTime: t, duration: n, seek: a };
2384
+ }, Vr = () => {
2385
+ const e = Cr(), t = xr(), n = Mr(), a = _r();
2110
2386
  return {
2111
2387
  isPlaying: e.isPlaying,
2112
- volume: o.volume,
2113
- currentTime: r.currentTime,
2114
- duration: r.duration,
2388
+ volume: n.volume,
2389
+ currentTime: a.currentTime,
2390
+ duration: a.duration,
2115
2391
  repeatType: e.repeatType,
2116
- muted: o.muted,
2392
+ muted: n.muted,
2393
+ playbackRate: e.playbackRate,
2117
2394
  currentTrack: t.currentTrack,
2118
2395
  currentIndex: t.currentIndex,
2119
2396
  playList: t.playList,
@@ -2122,39 +2399,45 @@ const sr = () => {
2122
2399
  togglePlay: e.togglePlay,
2123
2400
  next: t.next,
2124
2401
  prev: t.prev,
2125
- seek: r.seek,
2126
- setVolume: o.setVolume,
2127
- toggleMute: o.toggleMute,
2128
- setTrack: t.setTrack
2402
+ seek: a.seek,
2403
+ setVolume: n.setVolume,
2404
+ toggleMute: n.toggleMute,
2405
+ setTrack: t.setTrack,
2406
+ setPlaybackRate: e.setPlaybackRate
2129
2407
  };
2130
- }, vr = () => {
2408
+ }, Br = () => {
2131
2409
  const { elementRefs: e } = L();
2132
2410
  return {
2133
2411
  audioEl: e == null ? void 0 : e.audioEl,
2134
2412
  waveformInst: e == null ? void 0 : e.waveformInst
2135
2413
  };
2136
2414
  };
2137
- we.CustomComponent = _e;
2138
2415
  export {
2139
- nr as AudioPlayer,
2140
- Me as AudioPlayerContainer,
2141
- vt as AudioPlayerStateProvider,
2142
- F as DEFAULT_AUDIO_STATE,
2143
- he as audioAttrsContext,
2144
- P as audioPlayerDispatchContext,
2145
- pt as audioPlayerReducer,
2146
- we as default,
2147
- N as defaultInterfacePlacement,
2148
- pr as defaultInterfacePlacementMaxLength,
2149
- Te as playbackContext,
2150
- Ae as resourceContext,
2151
- Ee as timeContext,
2152
- fe as trackContext,
2153
- ge as uiContext,
2154
- yr as useAudioPlayer,
2155
- vr as useAudioPlayerElement,
2156
- sr as useAudioPlayerPlayback,
2157
- cr as useAudioPlayerTime,
2158
- ir as useAudioPlayerTrack,
2159
- lr as useAudioPlayerVolume
2416
+ kr as AudioPlayer,
2417
+ Ge as AudioPlayerContainer,
2418
+ Bt as AudioPlayerStateProvider,
2419
+ O as DEFAULT_AUDIO_STATE,
2420
+ Or as DEFAULT_INTERFACE_GRID_BOUND,
2421
+ Ie as audioAttrsContext,
2422
+ b as audioPlayerDispatchContext,
2423
+ Ot as audioPlayerReducer,
2424
+ Kr as default,
2425
+ de as defaultInterfacePlacement,
2426
+ Se as playbackContext,
2427
+ Le as resourceContext,
2428
+ Ne as timeContext,
2429
+ we as trackContext,
2430
+ be as uiContext,
2431
+ Kt as useAudioAttrsContext,
2432
+ Vr as useAudioPlayer,
2433
+ Br as useAudioPlayerElement,
2434
+ Cr as useAudioPlayerPlayback,
2435
+ _r as useAudioPlayerTime,
2436
+ xr as useAudioPlayerTrack,
2437
+ Mr as useAudioPlayerVolume,
2438
+ k as usePlaybackContext,
2439
+ L as useResourceContext,
2440
+ re as useTimeContext,
2441
+ $ as useTrackContext,
2442
+ M as useUIContext
2160
2443
  };