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