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