@lucaismyname/ginger 0.0.25 → 0.0.26
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/dist/GingerSplitContexts-BzBExb95.js.map +1 -1
- package/dist/GingerSplitContexts-C7puo0M7.cjs.map +1 -1
- package/dist/analyzer/liveAudioGraph.d.ts.map +1 -1
- package/dist/analyzer/useGingerLiveAnalyzer.d.ts.map +1 -1
- package/dist/audio/GingerPlayer.d.ts.map +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.js +2 -2
- package/dist/components/current/Artwork.d.ts.map +1 -1
- package/dist/components/current/Chapters.d.ts +1 -1
- package/dist/components/current/Chapters.d.ts.map +1 -1
- package/dist/components/current/FileUrl.d.ts +1 -1
- package/dist/components/current/FileUrl.d.ts.map +1 -1
- package/dist/components/current/Lyrics.d.ts +1 -1
- package/dist/components/current/Lyrics.d.ts.map +1 -1
- package/dist/components/current/LyricsSynced.d.ts +1 -1
- package/dist/components/current/LyricsSynced.d.ts.map +1 -1
- package/dist/components/current/Playback.d.ts +1 -1
- package/dist/components/current/Playback.d.ts.map +1 -1
- package/dist/components/current/QueueMeta.d.ts +1 -1
- package/dist/components/current/QueueMeta.d.ts.map +1 -1
- package/dist/components/current/Time.d.ts.map +1 -1
- package/dist/components/current/Year.d.ts.map +1 -1
- package/dist/components/current/createTextDisplay.d.ts.map +1 -1
- package/dist/components/current/texts.d.ts.map +1 -1
- package/dist/components/playlist/GingerPlaylist.d.ts.map +1 -1
- package/dist/components/queue/QueueDisplay.d.ts +1 -1
- package/dist/components/queue/QueueDisplay.d.ts.map +1 -1
- package/dist/context/GingerContext.d.ts.map +1 -1
- package/dist/context/GingerLocaleContext.d.ts.map +1 -1
- package/dist/context/GingerProvider.d.ts.map +1 -1
- package/dist/context/GingerSplitContexts.d.ts.map +1 -1
- package/dist/core/playbackReducer.d.ts.map +1 -1
- package/dist/core/queue.d.ts.map +1 -1
- package/dist/core/transitions.d.ts.map +1 -1
- package/dist/{ginger-Dj-zM_lq.js → ginger-DE4TKdCR.js} +830 -779
- package/dist/ginger-DE4TKdCR.js.map +1 -0
- package/dist/ginger-yY4Y5liv.cjs +2 -0
- package/dist/ginger-yY4Y5liv.cjs.map +1 -0
- package/dist/ginger.d.ts +1 -1
- package/dist/ginger.d.ts.map +1 -1
- package/dist/hooks/useControlBindings.d.ts.map +1 -1
- package/dist/hooks/useGinger.d.ts.map +1 -1
- package/dist/hooks/useGingerKeyboardShortcuts.d.ts.map +1 -1
- package/dist/hooks/useGingerLyricsSync.d.ts.map +1 -1
- package/dist/hooks/useSeekDrag.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/internal/selectors.d.ts.map +1 -1
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/{useNextTrackPrefetch-iqM3_D0L.cjs → useNextTrackPrefetch-Cs4A1oFv.cjs} +2 -2
- package/dist/useNextTrackPrefetch-Cs4A1oFv.cjs.map +1 -0
- package/dist/{useNextTrackPrefetch-CmfCP_Vz.js → useNextTrackPrefetch-eR_p__O2.js} +53 -45
- package/dist/useNextTrackPrefetch-eR_p__O2.js.map +1 -0
- package/dist/waveform/analyzeAudioFile.d.ts.map +1 -1
- package/dist/waveform/index.cjs +1 -1
- package/dist/waveform/index.cjs.map +1 -1
- package/dist/waveform/index.js +91 -84
- package/dist/waveform/index.js.map +1 -1
- package/dist/waveform/useAudioFileAnalysis.d.ts.map +1 -1
- package/dist/waveform/useAudioPeaks.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/ginger-Dj-zM_lq.js.map +0 -1
- package/dist/ginger-R_CXoaE2.cjs +0 -2
- package/dist/ginger-R_CXoaE2.cjs.map +0 -1
- package/dist/useNextTrackPrefetch-CmfCP_Vz.js.map +0 -1
- package/dist/useNextTrackPrefetch-iqM3_D0L.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as d, jsxs as q } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as Ge, createContext as Ne, useRef as O, useState as Nr, useEffect as E, useMemo as P, useReducer as wr, useCallback as v } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { b as _, u as j, g as $e, c as I, G as Cr, d as Lr } from "./GingerSplitContexts-BzBExb95.js";
|
|
4
4
|
const Oe = Ne(null);
|
|
5
5
|
function Dr() {
|
|
6
6
|
const e = Ge(Oe);
|
|
@@ -26,16 +26,16 @@ function Fr({
|
|
|
26
26
|
}), m = O(""), [y, k] = Nr(!1);
|
|
27
27
|
E(() => {
|
|
28
28
|
if (!a || typeof window > "u") return;
|
|
29
|
-
const p = window.matchMedia("(prefers-reduced-motion: reduce)"),
|
|
30
|
-
return
|
|
29
|
+
const p = window.matchMedia("(prefers-reduced-motion: reduce)"), T = () => k(p.matches);
|
|
30
|
+
return T(), p.addEventListener("change", T), () => p.removeEventListener("change", T);
|
|
31
31
|
}, [a]);
|
|
32
|
-
const b = (p,
|
|
32
|
+
const b = (p, T = !1) => {
|
|
33
33
|
const R = {
|
|
34
34
|
currentTime: p.currentTime,
|
|
35
35
|
duration: p.duration,
|
|
36
36
|
bufferedFraction: Ue(p)
|
|
37
37
|
}, w = g.current, Se = y ? 0.5 : 0.25, K = Math.abs(R.currentTime - w.currentTime) >= Se || Math.abs(R.duration - w.duration) >= 0.01 || Math.abs(R.bufferedFraction - w.bufferedFraction) >= 0.01;
|
|
38
|
-
!
|
|
38
|
+
!T && !K || (g.current = R, o({
|
|
39
39
|
type: "MEDIA_TIME_UPDATE",
|
|
40
40
|
payload: R
|
|
41
41
|
}));
|
|
@@ -69,12 +69,12 @@ function Fr({
|
|
|
69
69
|
b(p.currentTarget);
|
|
70
70
|
},
|
|
71
71
|
onLoadedMetadata: (p) => {
|
|
72
|
-
const
|
|
72
|
+
const T = p.currentTarget;
|
|
73
73
|
g.current = { currentTime: -1, duration: -1, bufferedFraction: -1 }, o({
|
|
74
74
|
type: "MEDIA_LOADED_METADATA",
|
|
75
75
|
payload: {
|
|
76
|
-
duration:
|
|
77
|
-
bufferedFraction: Ue(
|
|
76
|
+
duration: T.duration,
|
|
77
|
+
bufferedFraction: Ue(T)
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
},
|
|
@@ -87,24 +87,66 @@ function Fr({
|
|
|
87
87
|
onCanPlay: () => o({ type: "MEDIA_CANPLAY" }),
|
|
88
88
|
onProgress: (p) => b(p.currentTarget, !0),
|
|
89
89
|
onVolumeChange: (p) => {
|
|
90
|
-
const
|
|
90
|
+
const T = p.currentTarget;
|
|
91
91
|
o({
|
|
92
92
|
type: "MEDIA_VOLUME_SYNC",
|
|
93
|
-
payload: { volume:
|
|
93
|
+
payload: { volume: T.volume, muted: T.muted }
|
|
94
94
|
});
|
|
95
95
|
},
|
|
96
96
|
onError: () => {
|
|
97
97
|
var w;
|
|
98
|
-
const p = i.current,
|
|
99
|
-
o({ type: "MEDIA_ERROR", payload: { message:
|
|
98
|
+
const p = i.current, T = (w = p == null ? void 0 : p.error) == null ? void 0 : w.code;
|
|
99
|
+
o({ type: "MEDIA_ERROR", payload: { message: T === 1 ? "MEDIA_ERR_ABORTED" : T === 2 ? "MEDIA_ERR_NETWORK" : T === 3 ? "MEDIA_ERR_DECODE" : T === 4 ? "MEDIA_ERR_SRC_NOT_SUPPORTED" : "MEDIA_ERR_UNKNOWN" } });
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
|
+
const Ee = {
|
|
105
|
+
seek: "Seek",
|
|
106
|
+
volume: "Volume",
|
|
107
|
+
playbackSpeed: "Playback speed",
|
|
108
|
+
nextTrack: "Next track",
|
|
109
|
+
previousTrack: "Previous track",
|
|
110
|
+
shuffle: "Shuffle",
|
|
111
|
+
mute: "Mute",
|
|
112
|
+
unmute: "Unmute",
|
|
113
|
+
play: "Play",
|
|
114
|
+
pause: "Pause",
|
|
115
|
+
repeat: {
|
|
116
|
+
off: "Repeat off",
|
|
117
|
+
all: "Repeat all",
|
|
118
|
+
one: "Repeat one"
|
|
119
|
+
},
|
|
120
|
+
playbackRateNormal: "1× normal",
|
|
121
|
+
playbackRateTimes: (e) => `${e}×`
|
|
122
|
+
};
|
|
123
|
+
function Ur(e) {
|
|
124
|
+
return e ? {
|
|
125
|
+
...Ee,
|
|
126
|
+
...e,
|
|
127
|
+
repeat: { ...Ee.repeat, ...e.repeat }
|
|
128
|
+
} : Ee;
|
|
129
|
+
}
|
|
130
|
+
const Be = Ne(Ee);
|
|
131
|
+
function Vr({
|
|
132
|
+
locale: e,
|
|
133
|
+
children: r
|
|
134
|
+
}) {
|
|
135
|
+
const n = Ur(e);
|
|
136
|
+
return /* @__PURE__ */ d(Be.Provider, { value: n, children: r });
|
|
137
|
+
}
|
|
138
|
+
function N() {
|
|
139
|
+
return Ge(Be);
|
|
140
|
+
}
|
|
141
|
+
function z(e) {
|
|
142
|
+
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
143
|
+
const r = Math.floor(e % 60);
|
|
144
|
+
return `${Math.floor(e / 60)}:${r.toString().padStart(2, "0")}`;
|
|
145
|
+
}
|
|
104
146
|
function A(e, r) {
|
|
105
147
|
return r <= 0 ? 0 : Math.max(0, Math.min(r - 1, e));
|
|
106
148
|
}
|
|
107
|
-
function
|
|
149
|
+
function Ye(e, r) {
|
|
108
150
|
if (e.length <= 1) return [...e];
|
|
109
151
|
const n = e[r];
|
|
110
152
|
if (!n) return [...e];
|
|
@@ -118,7 +160,7 @@ function Be(e, r) {
|
|
|
118
160
|
function W(e) {
|
|
119
161
|
return e ? e.id != null && e.id !== "" ? `id:${e.id}` : `file:${e.fileUrl}` : "";
|
|
120
162
|
}
|
|
121
|
-
function
|
|
163
|
+
function $r(e, r) {
|
|
122
164
|
var o, u;
|
|
123
165
|
if (!r) return 0;
|
|
124
166
|
const n = e.findIndex((l) => l === r);
|
|
@@ -135,49 +177,49 @@ function Ur(e, r) {
|
|
|
135
177
|
"[@lucaismyname/ginger] Ambiguous track identity: multiple queue rows share the same fileUrl without a unique `id`. Resolving to the first match."
|
|
136
178
|
), a[0];
|
|
137
179
|
}
|
|
138
|
-
function
|
|
180
|
+
function Qe(e, r, n) {
|
|
139
181
|
const t = [...e], a = Math.max(0, Math.min(t.length, n ?? t.length));
|
|
140
182
|
return t.splice(a, 0, r), t;
|
|
141
183
|
}
|
|
142
|
-
function
|
|
184
|
+
function Or(e, r) {
|
|
143
185
|
if (r < 0 || r >= e.length) return [...e];
|
|
144
186
|
const n = [...e];
|
|
145
187
|
return n.splice(r, 1), n;
|
|
146
188
|
}
|
|
147
|
-
function
|
|
189
|
+
function Br(e, r, n) {
|
|
148
190
|
if (r === n || r < 0 || r >= e.length || n < 0 || n >= e.length)
|
|
149
191
|
return [...e];
|
|
150
192
|
const t = [...e], [a] = t.splice(r, 1);
|
|
151
193
|
return a ? (t.splice(n, 0, a), t) : [...e];
|
|
152
194
|
}
|
|
153
|
-
function
|
|
154
|
-
return
|
|
195
|
+
function Yr(e, r, n) {
|
|
196
|
+
return Qe(e, n, Math.max(0, Math.min(e.length, r + 1)));
|
|
155
197
|
}
|
|
156
|
-
function
|
|
198
|
+
function Qr(e) {
|
|
157
199
|
const { tracks: r, currentIndex: n, repeatMode: t, playbackMode: a } = e, i = r.length;
|
|
158
200
|
return i === 0 ? { kind: "stop", nextIndex: 0 } : t === "one" ? { kind: "replay_same" } : a === "single" ? { kind: "stop", nextIndex: A(n, i) } : n < i - 1 ? { kind: "advance", nextIndex: n + 1 } : t === "all" ? { kind: "wrap", nextIndex: 0 } : { kind: "stop", nextIndex: A(n, i) };
|
|
159
201
|
}
|
|
160
|
-
function
|
|
202
|
+
function Hr(e) {
|
|
161
203
|
const { tracks: r, currentIndex: n, repeatMode: t, playbackMode: a } = e, i = r.length;
|
|
162
204
|
return i === 0 ? 0 : a === "single" ? A(n, i) : n < i - 1 ? n + 1 : t === "all" ? 0 : A(n, i);
|
|
163
205
|
}
|
|
164
|
-
function
|
|
206
|
+
function jr(e) {
|
|
165
207
|
const { tracks: r, currentIndex: n, repeatMode: t, playbackMode: a } = e, i = r.length;
|
|
166
208
|
return i === 0 ? 0 : a === "single" ? A(n, i) : n > 0 ? n - 1 : t === "all" ? i - 1 : 0;
|
|
167
209
|
}
|
|
168
|
-
function
|
|
210
|
+
function Kr(e) {
|
|
169
211
|
return e === "off" ? "all" : e === "all" ? "one" : "off";
|
|
170
212
|
}
|
|
171
|
-
function
|
|
213
|
+
function He(e, r) {
|
|
172
214
|
return (e == null ? void 0 : e.artworkUrl) ?? r ?? void 0;
|
|
173
215
|
}
|
|
174
|
-
function
|
|
216
|
+
function Xr(e, r) {
|
|
175
217
|
return (e == null ? void 0 : e.album) ?? r ?? void 0;
|
|
176
218
|
}
|
|
177
219
|
function V(e) {
|
|
178
220
|
return e.tracks[e.currentIndex] ?? null;
|
|
179
221
|
}
|
|
180
|
-
function
|
|
222
|
+
function je(e) {
|
|
181
223
|
return e.errorMessage ? "error" : e.tracks.length === 0 ? "idle" : e.isBuffering ? "loading" : e.isPaused ? Number.isFinite(e.duration) && e.duration > 0 && e.currentTime >= e.duration - 0.05 ? "ended" : "paused" : "playing";
|
|
182
224
|
}
|
|
183
225
|
function J(e) {
|
|
@@ -187,718 +229,707 @@ function J(e) {
|
|
|
187
229
|
const n = (t = e.tracks[e.currentIndex]) == null ? void 0 : t.durationSeconds;
|
|
188
230
|
return typeof n == "number" && Number.isFinite(n) && n > 0 ? n : 0;
|
|
189
231
|
}
|
|
190
|
-
function
|
|
232
|
+
function zr(e) {
|
|
191
233
|
const n = J(e) - e.currentTime;
|
|
192
234
|
return Number.isFinite(n) ? Math.max(0, n) : 0;
|
|
193
235
|
}
|
|
194
|
-
function
|
|
236
|
+
function Ke(e) {
|
|
195
237
|
const r = J(e);
|
|
196
238
|
return r > 0 ? Math.min(1, Math.max(0, e.currentTime / r)) : 0;
|
|
197
239
|
}
|
|
198
|
-
function
|
|
199
|
-
var n;
|
|
200
|
-
const r = V(e);
|
|
201
|
-
return Qe(r, (n = e.playlistMeta) == null ? void 0 : n.artworkUrl);
|
|
202
|
-
}
|
|
203
|
-
function zr(e) {
|
|
240
|
+
function Wr(e) {
|
|
204
241
|
var n;
|
|
205
242
|
const r = V(e);
|
|
206
|
-
return
|
|
207
|
-
}
|
|
208
|
-
function B(e, r) {
|
|
209
|
-
function n(t) {
|
|
210
|
-
const a = I(), o = (r(a) ?? "").trim(), { className: u, style: l, fallback: s, empty: g, children: m } = t;
|
|
211
|
-
if (!o) {
|
|
212
|
-
const y = g ?? s ?? null;
|
|
213
|
-
return y ? /* @__PURE__ */ d("span", { className: u, style: l, children: y }) : null;
|
|
214
|
-
}
|
|
215
|
-
return m ? /* @__PURE__ */ d("span", { className: u, style: l, children: m(o, a) }) : /* @__PURE__ */ d("span", { className: u, style: l, children: o });
|
|
216
|
-
}
|
|
217
|
-
return n.displayName = e, n;
|
|
243
|
+
return He(r, (n = e.playlistMeta) == null ? void 0 : n.artworkUrl);
|
|
218
244
|
}
|
|
219
|
-
function
|
|
220
|
-
return B(e, (n) => r(V(n)));
|
|
221
|
-
}
|
|
222
|
-
const Wr = Y("Ginger.Current.Title", (e) => e == null ? void 0 : e.title), qr = Y("Ginger.Current.Artist", (e) => e == null ? void 0 : e.artist), Jr = B("Ginger.Current.Album", (e) => zr(e)), Zr = Y("Ginger.Current.Description", (e) => e == null ? void 0 : e.description), en = B("Ginger.Current.Copyright", (e) => {
|
|
245
|
+
function qr(e) {
|
|
223
246
|
var n;
|
|
224
247
|
const r = V(e);
|
|
225
|
-
return (r
|
|
226
|
-
}), rn = Y("Ginger.Current.Genre", (e) => e == null ? void 0 : e.genre), nn = Y("Ginger.Current.Label", (e) => e == null ? void 0 : e.label), tn = Y("Ginger.Current.Isrc", (e) => e == null ? void 0 : e.isrc), an = Y(
|
|
227
|
-
"Ginger.Current.TrackNumber",
|
|
228
|
-
(e) => (e == null ? void 0 : e.trackNumber) != null ? String(e.trackNumber) : void 0
|
|
229
|
-
);
|
|
230
|
-
function Ke({ className: e, style: r, fallback: n, empty: t, children: a, format: i }) {
|
|
231
|
-
var s;
|
|
232
|
-
const o = I(), u = (s = V(o)) == null ? void 0 : s.year;
|
|
233
|
-
if (typeof u != "number" || !Number.isFinite(u)) {
|
|
234
|
-
const g = t ?? n ?? null;
|
|
235
|
-
return g ? /* @__PURE__ */ d("span", { className: e, style: r, children: g }) : null;
|
|
236
|
-
}
|
|
237
|
-
const l = i ? i(u) : String(u);
|
|
238
|
-
return a ? /* @__PURE__ */ d("span", { className: e, style: r, children: a(l, o) }) : /* @__PURE__ */ d("span", { className: e, style: r, children: l });
|
|
248
|
+
return Xr(r, (n = e.playlistMeta) == null ? void 0 : n.subtitle);
|
|
239
249
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
+
function Jr() {
|
|
251
|
+
const e = _(), r = j(), n = N(), t = P(() => $e(e, r), [e, r]), a = J(t), i = a > 0 ? t.currentTime : 0, o = Number.isFinite(i) ? i : 0, u = a > 0 ? `${z(o)} of ${z(a)}` : z(o), l = (s) => {
|
|
252
|
+
r.seek(Number(s.currentTarget.value));
|
|
253
|
+
};
|
|
254
|
+
return {
|
|
255
|
+
state: t,
|
|
256
|
+
value: o,
|
|
257
|
+
min: 0,
|
|
258
|
+
max: a > 0 ? a : 1,
|
|
259
|
+
step: "any",
|
|
260
|
+
ariaValueText: u,
|
|
261
|
+
ariaLabel: n.seek,
|
|
262
|
+
onSeekInput: l,
|
|
263
|
+
onSeekChange: l
|
|
264
|
+
};
|
|
250
265
|
}
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
266
|
+
function Zr() {
|
|
267
|
+
const e = _(), r = j(), n = N(), t = P(() => $e(e, r), [e, r]), a = (i) => {
|
|
268
|
+
r.setVolume(Number(i.currentTarget.value));
|
|
269
|
+
};
|
|
270
|
+
return {
|
|
271
|
+
state: t,
|
|
272
|
+
value: t.volume,
|
|
273
|
+
min: 0,
|
|
274
|
+
max: 1,
|
|
275
|
+
step: "any",
|
|
276
|
+
ariaValueText: `${Math.round(t.volume * 100)}%`,
|
|
277
|
+
ariaLabel: n.volume,
|
|
278
|
+
onVolumeInput: a,
|
|
279
|
+
onVolumeChange: a
|
|
280
|
+
};
|
|
265
281
|
}
|
|
266
|
-
function
|
|
267
|
-
const
|
|
268
|
-
for (let o = a.length - 1; o >= 0; o -= 1)
|
|
269
|
-
if (n >= a[o].time) return o;
|
|
270
|
-
return -1;
|
|
271
|
-
}, [n, a]);
|
|
282
|
+
function en(e) {
|
|
283
|
+
const r = _(), n = N(), t = (e == null ? void 0 : e.playAriaLabel) ?? n.play, a = (e == null ? void 0 : e.pauseAriaLabel) ?? n.pause;
|
|
272
284
|
return {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
285
|
+
isPaused: r.isPaused,
|
|
286
|
+
toggle: r.togglePlayPause,
|
|
287
|
+
ariaLabel: r.isPaused ? t : a
|
|
276
288
|
};
|
|
277
289
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
290
|
+
function Xe({
|
|
291
|
+
playLabel: e = "Play",
|
|
292
|
+
pauseLabel: r = "Pause",
|
|
293
|
+
playAriaLabel: n,
|
|
294
|
+
pauseAriaLabel: t,
|
|
295
|
+
children: a,
|
|
296
|
+
type: i = "button",
|
|
297
|
+
onClick: o,
|
|
298
|
+
...u
|
|
287
299
|
}) {
|
|
288
|
-
const l =
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}, ...r }, "aria-label": "Synced lyrics", children: s.map((y, k) => {
|
|
301
|
-
const b = k === g;
|
|
302
|
-
return /* @__PURE__ */ d(
|
|
303
|
-
"li",
|
|
304
|
-
{
|
|
305
|
-
"aria-current": b ? "true" : void 0,
|
|
306
|
-
"data-ginger-active": b || void 0,
|
|
307
|
-
className: [o, b ? i : void 0].filter(Boolean).join(" ") || void 0,
|
|
308
|
-
style: a ? void 0 : {
|
|
309
|
-
padding: "var(--ginger-playlist-row-padding, 4px 8px)",
|
|
310
|
-
fontWeight: b ? 600 : 400,
|
|
311
|
-
opacity: b ? 1 : 0.75
|
|
312
|
-
},
|
|
313
|
-
children: u ? u(y, k, b, l) : y.text
|
|
300
|
+
const l = N(), s = typeof e == "string" ? e : l.play, g = typeof r == "string" ? r : l.pause, m = en({
|
|
301
|
+
playAriaLabel: n ?? s,
|
|
302
|
+
pauseAriaLabel: t ?? g
|
|
303
|
+
});
|
|
304
|
+
return /* @__PURE__ */ d(
|
|
305
|
+
"button",
|
|
306
|
+
{
|
|
307
|
+
...u,
|
|
308
|
+
type: i,
|
|
309
|
+
"aria-label": m.ariaLabel,
|
|
310
|
+
onClick: (y) => {
|
|
311
|
+
m.toggle(), o == null || o(y);
|
|
314
312
|
},
|
|
315
|
-
|
|
316
|
-
);
|
|
317
|
-
}) });
|
|
318
|
-
}
|
|
319
|
-
ze.displayName = "Ginger.Current.LyricsSynced";
|
|
320
|
-
function sn() {
|
|
321
|
-
const { tracks: e, currentIndex: r } = _(), { currentTime: n, seek: t } = j(), a = P(() => {
|
|
322
|
-
var u;
|
|
323
|
-
return [...((u = e[r]) == null ? void 0 : u.chapters) ?? []].filter((l) => l && Number.isFinite(l.startSeconds) && l.startSeconds >= 0).sort((l, s) => l.startSeconds - s.startSeconds);
|
|
324
|
-
}, [r, e]), i = P(() => {
|
|
325
|
-
if (a.length === 0) return -1;
|
|
326
|
-
for (let o = a.length - 1; o >= 0; o -= 1)
|
|
327
|
-
if (n >= a[o].startSeconds) return o;
|
|
328
|
-
return -1;
|
|
329
|
-
}, [n, a]);
|
|
330
|
-
return {
|
|
331
|
-
list: a,
|
|
332
|
-
activeIndex: i,
|
|
333
|
-
active: i >= 0 ? a[i] ?? null : null,
|
|
334
|
-
seekTo: (o) => {
|
|
335
|
-
const u = a[o];
|
|
336
|
-
u && t(u.startSeconds);
|
|
313
|
+
children: a ?? (m.isPaused ? e : r)
|
|
337
314
|
}
|
|
338
|
-
|
|
315
|
+
);
|
|
339
316
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
const
|
|
343
|
-
return
|
|
317
|
+
Xe.displayName = "Ginger.Control.PlayPause";
|
|
318
|
+
function ze({ type: e = "button", ariaLabel: r, onClick: n, children: t, ...a }) {
|
|
319
|
+
const { repeatMode: i, cycleRepeat: o } = _(), l = N().repeat[i];
|
|
320
|
+
return /* @__PURE__ */ d(
|
|
321
|
+
"button",
|
|
322
|
+
{
|
|
323
|
+
...a,
|
|
324
|
+
type: e,
|
|
325
|
+
"aria-label": r ?? l,
|
|
326
|
+
onClick: (s) => {
|
|
327
|
+
o(), n == null || n(s);
|
|
328
|
+
},
|
|
329
|
+
children: t ?? l
|
|
330
|
+
}
|
|
331
|
+
);
|
|
344
332
|
}
|
|
333
|
+
ze.displayName = "Ginger.Control.Repeat";
|
|
345
334
|
function We({
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
formatStart: i = z,
|
|
352
|
-
children: o
|
|
335
|
+
type: e = "button",
|
|
336
|
+
children: r = "Next",
|
|
337
|
+
ariaLabel: n,
|
|
338
|
+
onClick: t,
|
|
339
|
+
...a
|
|
353
340
|
}) {
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
const b = k === s;
|
|
368
|
-
return /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(
|
|
369
|
-
"button",
|
|
370
|
-
{
|
|
371
|
-
type: "button",
|
|
372
|
-
"aria-current": b ? "true" : void 0,
|
|
373
|
-
"data-ginger-active": b || void 0,
|
|
374
|
-
onClick: () => g(k),
|
|
375
|
-
style: {
|
|
376
|
-
width: a ? void 0 : "100%",
|
|
377
|
-
textAlign: a ? void 0 : "left",
|
|
378
|
-
border: a ? void 0 : "none",
|
|
379
|
-
background: a ? void 0 : b ? "var(--ginger-playlist-active-bg, rgba(17, 24, 39, 0.06))" : "transparent",
|
|
380
|
-
color: a ? void 0 : "inherit",
|
|
381
|
-
font: a ? void 0 : "inherit",
|
|
382
|
-
cursor: a ? void 0 : "pointer",
|
|
383
|
-
padding: a ? void 0 : "var(--ginger-playlist-row-padding, 6px 8px)"
|
|
384
|
-
},
|
|
385
|
-
children: o ? o(y, k, b, u) : /* @__PURE__ */ q("span", { children: [
|
|
386
|
-
/* @__PURE__ */ d("span", { style: { opacity: 0.75, marginRight: "0.35em" }, children: i(y.startSeconds) }),
|
|
387
|
-
y.title
|
|
388
|
-
] })
|
|
389
|
-
}
|
|
390
|
-
) }, `${y.startSeconds}-${y.title}`);
|
|
391
|
-
}) });
|
|
341
|
+
const { next: i } = _(), o = N();
|
|
342
|
+
return /* @__PURE__ */ d(
|
|
343
|
+
"button",
|
|
344
|
+
{
|
|
345
|
+
...a,
|
|
346
|
+
type: e,
|
|
347
|
+
"aria-label": n ?? o.nextTrack,
|
|
348
|
+
onClick: (u) => {
|
|
349
|
+
i(), t == null || t(u);
|
|
350
|
+
},
|
|
351
|
+
children: r ?? o.nextTrack
|
|
352
|
+
}
|
|
353
|
+
);
|
|
392
354
|
}
|
|
393
|
-
We.displayName = "Ginger.
|
|
394
|
-
function qe({
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
355
|
+
We.displayName = "Ginger.Control.Next";
|
|
356
|
+
function qe({
|
|
357
|
+
type: e = "button",
|
|
358
|
+
children: r = "Previous",
|
|
359
|
+
ariaLabel: n,
|
|
360
|
+
onClick: t,
|
|
361
|
+
...a
|
|
362
|
+
}) {
|
|
363
|
+
const { prev: i } = _(), o = N();
|
|
364
|
+
return /* @__PURE__ */ d(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
...a,
|
|
368
|
+
type: e,
|
|
369
|
+
"aria-label": n ?? o.previousTrack,
|
|
370
|
+
onClick: (u) => {
|
|
371
|
+
i(), t == null || t(u);
|
|
372
|
+
},
|
|
373
|
+
children: r
|
|
374
|
+
}
|
|
375
|
+
);
|
|
404
376
|
}
|
|
405
|
-
qe.displayName = "Ginger.
|
|
377
|
+
qe.displayName = "Ginger.Control.Previous";
|
|
406
378
|
function Je({
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
loading: i,
|
|
413
|
-
onError: o,
|
|
414
|
-
decoding: u,
|
|
415
|
-
unstyled: l = !1,
|
|
416
|
-
imgStyle: s
|
|
379
|
+
type: e = "button",
|
|
380
|
+
children: r = "Shuffle",
|
|
381
|
+
ariaLabel: n,
|
|
382
|
+
onClick: t,
|
|
383
|
+
...a
|
|
417
384
|
}) {
|
|
418
|
-
const
|
|
419
|
-
if (!y) {
|
|
420
|
-
const b = t ?? n ?? null;
|
|
421
|
-
return b ? /* @__PURE__ */ d("span", { className: e, style: r, children: b }) : null;
|
|
422
|
-
}
|
|
423
|
-
const k = [m == null ? void 0 : m.title, m == null ? void 0 : m.artist].filter(Boolean).join(" — ") || "Artwork";
|
|
385
|
+
const { isShuffled: i, toggleShuffle: o } = _(), u = N();
|
|
424
386
|
return /* @__PURE__ */ d(
|
|
425
|
-
"
|
|
387
|
+
"button",
|
|
426
388
|
{
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
389
|
+
...a,
|
|
390
|
+
type: e,
|
|
391
|
+
"aria-pressed": i,
|
|
392
|
+
"aria-label": n ?? u.shuffle,
|
|
393
|
+
onClick: (l) => {
|
|
394
|
+
o(), t == null || t(l);
|
|
433
395
|
},
|
|
434
|
-
children:
|
|
435
|
-
"img",
|
|
436
|
-
{
|
|
437
|
-
src: y,
|
|
438
|
-
alt: k,
|
|
439
|
-
sizes: a,
|
|
440
|
-
loading: i,
|
|
441
|
-
decoding: u,
|
|
442
|
-
onError: o,
|
|
443
|
-
style: {
|
|
444
|
-
display: l ? void 0 : "block",
|
|
445
|
-
width: l ? void 0 : "100%",
|
|
446
|
-
height: l ? void 0 : "100%",
|
|
447
|
-
objectFit: l ? void 0 : "cover",
|
|
448
|
-
...s
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
)
|
|
396
|
+
children: r ?? u.shuffle
|
|
452
397
|
}
|
|
453
398
|
);
|
|
454
399
|
}
|
|
455
|
-
Je.displayName = "Ginger.
|
|
456
|
-
function Ze({
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
400
|
+
Je.displayName = "Ginger.Control.Shuffle";
|
|
401
|
+
function Ze({ inputStyle: e, style: r, unstyled: n = !1, ariaLabel: t, ...a }) {
|
|
402
|
+
const i = Jr(), o = n ? { ...r, ...e } : { width: "100%", ...r, ...e };
|
|
403
|
+
return /* @__PURE__ */ d(
|
|
404
|
+
"input",
|
|
405
|
+
{
|
|
406
|
+
...a,
|
|
407
|
+
type: "range",
|
|
408
|
+
min: i.min,
|
|
409
|
+
max: i.max,
|
|
410
|
+
step: i.step,
|
|
411
|
+
value: i.value,
|
|
412
|
+
"aria-label": t ?? i.ariaLabel,
|
|
413
|
+
"aria-valuetext": i.ariaValueText,
|
|
414
|
+
onInput: i.onSeekInput,
|
|
415
|
+
onChange: i.onSeekChange,
|
|
416
|
+
style: o
|
|
417
|
+
}
|
|
418
|
+
);
|
|
464
419
|
}
|
|
465
|
-
Ze.displayName = "Ginger.
|
|
466
|
-
function er({
|
|
467
|
-
const i =
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
420
|
+
Ze.displayName = "Ginger.Control.SeekBar";
|
|
421
|
+
function er({ inputStyle: e, style: r, unstyled: n = !1, ariaLabel: t, ...a }) {
|
|
422
|
+
const i = Zr(), o = n ? { ...r, ...e } : { width: "100%", ...r, ...e };
|
|
423
|
+
return /* @__PURE__ */ d(
|
|
424
|
+
"input",
|
|
425
|
+
{
|
|
426
|
+
...a,
|
|
427
|
+
type: "range",
|
|
428
|
+
min: i.min,
|
|
429
|
+
max: i.max,
|
|
430
|
+
step: i.step,
|
|
431
|
+
value: i.value,
|
|
432
|
+
"aria-label": t ?? i.ariaLabel,
|
|
433
|
+
"aria-valuetext": i.ariaValueText,
|
|
434
|
+
onInput: i.onVolumeInput,
|
|
435
|
+
onChange: i.onVolumeChange,
|
|
436
|
+
style: o
|
|
437
|
+
}
|
|
438
|
+
);
|
|
473
439
|
}
|
|
474
|
-
er.displayName = "Ginger.
|
|
440
|
+
er.displayName = "Ginger.Control.Volume";
|
|
475
441
|
function rr({
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
442
|
+
ariaLabel: e,
|
|
443
|
+
muteLabel: r,
|
|
444
|
+
unmuteLabel: n,
|
|
445
|
+
type: t = "button",
|
|
446
|
+
onClick: a,
|
|
447
|
+
children: i,
|
|
448
|
+
...o
|
|
483
449
|
}) {
|
|
484
|
-
const u =
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
const s = l(e);
|
|
500
|
-
return u ? /* @__PURE__ */ d("span", { className: t, style: a, children: u(s, r) }) : /* @__PURE__ */ d("span", { className: t, style: a, children: s });
|
|
501
|
-
}
|
|
502
|
-
function nr(e) {
|
|
503
|
-
const r = I();
|
|
504
|
-
return we(r.currentTime, r, e);
|
|
505
|
-
}
|
|
506
|
-
nr.displayName = "Ginger.Current.Elapsed";
|
|
507
|
-
function tr(e) {
|
|
508
|
-
const r = I();
|
|
509
|
-
return we(J(r), r, e);
|
|
510
|
-
}
|
|
511
|
-
tr.displayName = "Ginger.Current.Duration";
|
|
512
|
-
function ar(e) {
|
|
513
|
-
const r = I();
|
|
514
|
-
return we(Kr(r), r, e);
|
|
515
|
-
}
|
|
516
|
-
ar.displayName = "Ginger.Current.Remaining";
|
|
517
|
-
function ir({ className: e, style: r, fallback: n, empty: t, children: a }) {
|
|
518
|
-
const i = I(), o = J(i), u = je(i);
|
|
519
|
-
if (!(o > 0)) {
|
|
520
|
-
const l = t ?? n ?? null;
|
|
521
|
-
return l ? /* @__PURE__ */ d("span", { className: e, style: r, children: l }) : null;
|
|
522
|
-
}
|
|
523
|
-
return a ? /* @__PURE__ */ d("span", { className: e, style: r, children: a({ fraction: u, currentTime: i.currentTime, duration: o }, i) }) : /* @__PURE__ */ d("span", { className: e, style: r, children: `${Math.round(u * 100)}%` });
|
|
450
|
+
const { muted: u, toggleMute: l } = j(), s = N(), g = r ?? s.mute, m = n ?? s.unmute;
|
|
451
|
+
return /* @__PURE__ */ d(
|
|
452
|
+
"button",
|
|
453
|
+
{
|
|
454
|
+
...o,
|
|
455
|
+
type: t,
|
|
456
|
+
"aria-pressed": u,
|
|
457
|
+
"aria-label": e ?? (u ? s.unmute : s.mute),
|
|
458
|
+
onClick: (y) => {
|
|
459
|
+
l(), a == null || a(y);
|
|
460
|
+
},
|
|
461
|
+
children: i ?? (u ? m : g)
|
|
462
|
+
}
|
|
463
|
+
);
|
|
524
464
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
465
|
+
rr.displayName = "Ginger.Control.Mute";
|
|
466
|
+
const rn = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
467
|
+
function nr({
|
|
468
|
+
rates: e = rn,
|
|
528
469
|
style: r,
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
470
|
+
ariaLabel: n,
|
|
471
|
+
children: t,
|
|
472
|
+
...a
|
|
532
473
|
}) {
|
|
533
|
-
const
|
|
474
|
+
const { playbackRate: i, setPlaybackRate: o } = j(), u = N(), l = P(
|
|
475
|
+
() => Array.from(/* @__PURE__ */ new Set([...e, i])).sort((s, g) => s - g),
|
|
476
|
+
[e, i]
|
|
477
|
+
);
|
|
534
478
|
return /* @__PURE__ */ q(
|
|
535
|
-
"
|
|
479
|
+
"select",
|
|
536
480
|
{
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
borderRadius: 999,
|
|
543
|
-
overflow: "hidden",
|
|
544
|
-
position: "relative",
|
|
545
|
-
...r
|
|
546
|
-
},
|
|
547
|
-
"aria-hidden": !0,
|
|
481
|
+
...a,
|
|
482
|
+
"aria-label": n ?? u.playbackSpeed,
|
|
483
|
+
value: String(i),
|
|
484
|
+
style: r,
|
|
485
|
+
onChange: (s) => o(Number(s.currentTarget.value)),
|
|
548
486
|
children: [
|
|
549
|
-
t
|
|
550
|
-
|
|
551
|
-
{
|
|
552
|
-
style: {
|
|
553
|
-
position: a ? void 0 : "absolute",
|
|
554
|
-
left: a ? void 0 : 0,
|
|
555
|
-
top: a ? void 0 : 0,
|
|
556
|
-
height: a ? void 0 : "100%",
|
|
557
|
-
width: u,
|
|
558
|
-
background: a ? void 0 : "var(--ginger-buffer-color, rgba(107, 114, 128, 0.35))"
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
) : null,
|
|
562
|
-
/* @__PURE__ */ d(
|
|
563
|
-
"div",
|
|
564
|
-
{
|
|
565
|
-
style: {
|
|
566
|
-
position: a ? void 0 : "relative",
|
|
567
|
-
width: o,
|
|
568
|
-
height: a ? void 0 : "100%",
|
|
569
|
-
background: a ? void 0 : "var(--ginger-primary-color, #111827)"
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
)
|
|
487
|
+
t ?? u.playbackSpeed,
|
|
488
|
+
l.map((s) => /* @__PURE__ */ d("option", { value: String(s), children: s === 1 ? u.playbackRateNormal : u.playbackRateTimes(s) }, s))
|
|
573
489
|
]
|
|
574
490
|
}
|
|
575
491
|
);
|
|
576
492
|
}
|
|
577
|
-
|
|
578
|
-
function
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
className:
|
|
584
|
-
style: t ? { ...r } : {
|
|
585
|
-
width: "100%",
|
|
586
|
-
height: n,
|
|
587
|
-
background: "var(--ginger-muted-color, #e5e7eb)",
|
|
588
|
-
borderRadius: 999,
|
|
589
|
-
overflow: "hidden",
|
|
590
|
-
...r
|
|
591
|
-
},
|
|
592
|
-
"aria-hidden": !0,
|
|
593
|
-
children: /* @__PURE__ */ d(
|
|
594
|
-
"div",
|
|
595
|
-
{
|
|
596
|
-
style: {
|
|
597
|
-
width: i,
|
|
598
|
-
height: t ? void 0 : "100%",
|
|
599
|
-
background: t ? void 0 : "var(--ginger-buffer-color, rgba(107, 114, 128, 0.35))"
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
)
|
|
493
|
+
nr.displayName = "Ginger.Control.PlaybackRate";
|
|
494
|
+
function B(e, r) {
|
|
495
|
+
function n(t) {
|
|
496
|
+
const a = I(), o = (r(a) ?? "").trim(), { className: u, style: l, fallback: s, empty: g, children: m } = t;
|
|
497
|
+
if (!o) {
|
|
498
|
+
const y = g ?? s ?? null;
|
|
499
|
+
return y ? /* @__PURE__ */ d("span", { className: u, style: l, children: y }) : null;
|
|
603
500
|
}
|
|
604
|
-
|
|
501
|
+
return m ? /* @__PURE__ */ d("span", { className: u, style: l, children: m(o, a) }) : /* @__PURE__ */ d("span", { className: u, style: l, children: o });
|
|
502
|
+
}
|
|
503
|
+
return n.displayName = e, n;
|
|
605
504
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
const i = I(), o = He(i);
|
|
609
|
-
return a ? /* @__PURE__ */ d("span", { className: e, style: r, children: a(o, i) }) : /* @__PURE__ */ d("span", { className: e, style: r, children: o });
|
|
505
|
+
function Y(e, r) {
|
|
506
|
+
return B(e, (n) => r(V(n)));
|
|
610
507
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
508
|
+
const nn = Y("Ginger.Current.Title", (e) => e == null ? void 0 : e.title), tn = Y("Ginger.Current.Artist", (e) => e == null ? void 0 : e.artist), an = B("Ginger.Current.Album", (e) => qr(e)), on = Y(
|
|
509
|
+
"Ginger.Current.Description",
|
|
510
|
+
(e) => e == null ? void 0 : e.description
|
|
511
|
+
), un = B("Ginger.Current.Copyright", (e) => {
|
|
512
|
+
var n;
|
|
513
|
+
const r = V(e);
|
|
514
|
+
return (r == null ? void 0 : r.copyright) ?? ((n = e.playlistMeta) == null ? void 0 : n.copyright);
|
|
515
|
+
}), sn = Y("Ginger.Current.Genre", (e) => e == null ? void 0 : e.genre), ln = Y("Ginger.Current.Label", (e) => e == null ? void 0 : e.label), cn = Y("Ginger.Current.Isrc", (e) => e == null ? void 0 : e.isrc), dn = Y(
|
|
516
|
+
"Ginger.Current.TrackNumber",
|
|
517
|
+
(e) => (e == null ? void 0 : e.trackNumber) != null ? String(e.trackNumber) : void 0
|
|
518
|
+
);
|
|
519
|
+
function tr({ className: e, style: r, fallback: n, empty: t, children: a, format: i }) {
|
|
520
|
+
var s;
|
|
521
|
+
const o = I(), u = (s = V(o)) == null ? void 0 : s.year;
|
|
522
|
+
if (typeof u != "number" || !Number.isFinite(u)) {
|
|
523
|
+
const g = t ?? n ?? null;
|
|
524
|
+
return g ? /* @__PURE__ */ d("span", { className: e, style: r, children: g }) : null;
|
|
617
525
|
}
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
lr.displayName = "Ginger.Current.ErrorMessage";
|
|
621
|
-
const Ee = {
|
|
622
|
-
seek: "Seek",
|
|
623
|
-
volume: "Volume",
|
|
624
|
-
playbackSpeed: "Playback speed",
|
|
625
|
-
nextTrack: "Next track",
|
|
626
|
-
previousTrack: "Previous track",
|
|
627
|
-
shuffle: "Shuffle",
|
|
628
|
-
mute: "Mute",
|
|
629
|
-
unmute: "Unmute",
|
|
630
|
-
play: "Play",
|
|
631
|
-
pause: "Pause",
|
|
632
|
-
repeat: {
|
|
633
|
-
off: "Repeat off",
|
|
634
|
-
all: "Repeat all",
|
|
635
|
-
one: "Repeat one"
|
|
636
|
-
},
|
|
637
|
-
playbackRateNormal: "1× normal",
|
|
638
|
-
playbackRateTimes: (e) => `${e}×`
|
|
639
|
-
};
|
|
640
|
-
function ln(e) {
|
|
641
|
-
return e ? {
|
|
642
|
-
...Ee,
|
|
643
|
-
...e,
|
|
644
|
-
repeat: { ...Ee.repeat, ...e.repeat }
|
|
645
|
-
} : Ee;
|
|
526
|
+
const l = i ? i(u) : String(u);
|
|
527
|
+
return a ? /* @__PURE__ */ d("span", { className: e, style: r, children: a(l, o) }) : /* @__PURE__ */ d("span", { className: e, style: r, children: l });
|
|
646
528
|
}
|
|
647
|
-
|
|
648
|
-
function
|
|
649
|
-
|
|
650
|
-
|
|
529
|
+
tr.displayName = "Ginger.Current.Year";
|
|
530
|
+
function ar({
|
|
531
|
+
className: e,
|
|
532
|
+
style: r,
|
|
533
|
+
fallback: n,
|
|
534
|
+
empty: t,
|
|
535
|
+
children: a,
|
|
536
|
+
preserveWhitespace: i = !0
|
|
651
537
|
}) {
|
|
652
|
-
|
|
653
|
-
|
|
538
|
+
var g;
|
|
539
|
+
const o = I(), u = ((g = V(o)) == null ? void 0 : g.lyrics) ?? "", l = i ? u.replace(/^\s+|\s+$/g, "") : u.trim();
|
|
540
|
+
if (!l) {
|
|
541
|
+
const m = t ?? n ?? null;
|
|
542
|
+
return m ? /* @__PURE__ */ d("span", { className: e, style: r, children: m }) : null;
|
|
543
|
+
}
|
|
544
|
+
const s = i ? { whiteSpace: "pre-wrap" } : void 0;
|
|
545
|
+
return a ? /* @__PURE__ */ d("span", { className: e, style: { ...s, ...r }, children: a(l, o) }) : /* @__PURE__ */ d("span", { className: e, style: { ...s, ...r }, children: l });
|
|
654
546
|
}
|
|
655
|
-
|
|
656
|
-
|
|
547
|
+
ar.displayName = "Ginger.Current.Lyrics";
|
|
548
|
+
const Ve = /\[(\d{1,2}):(\d{2})(?:\.(\d{1,3}))?\]/g;
|
|
549
|
+
function fn(e) {
|
|
550
|
+
const r = [];
|
|
551
|
+
for (const n of e.split(/\r?\n/)) {
|
|
552
|
+
const t = [...n.matchAll(Ve)];
|
|
553
|
+
if (t.length === 0) continue;
|
|
554
|
+
const a = n.replace(Ve, "").trim();
|
|
555
|
+
for (const i of t) {
|
|
556
|
+
const o = Number(i[1] ?? 0), u = Number(i[2] ?? 0), l = Number((i[3] ?? "0").padEnd(3, "0")), s = o * 60 + u + l / 1e3;
|
|
557
|
+
Number.isFinite(s) && s >= 0 && r.push({ time: s, text: a });
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return r.sort((n, t) => n.time - t.time);
|
|
657
561
|
}
|
|
658
|
-
function
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
|
|
562
|
+
function pn() {
|
|
563
|
+
const { tracks: e, currentIndex: r } = _(), { currentTime: n } = j(), t = e[r], a = P(() => t ? Array.isArray(t.lyricsTimed) && t.lyricsTimed.length > 0 ? [...t.lyricsTimed].filter((o) => Number.isFinite(o.time) && o.time >= 0).sort((o, u) => o.time - u.time) : typeof t.lyrics == "string" ? fn(t.lyrics) : [] : [], [t]), i = P(() => {
|
|
564
|
+
for (let o = a.length - 1; o >= 0; o -= 1)
|
|
565
|
+
if (n >= a[o].time) return o;
|
|
566
|
+
return -1;
|
|
567
|
+
}, [n, a]);
|
|
662
568
|
return {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
max: a > 0 ? a : 1,
|
|
667
|
-
step: "any",
|
|
668
|
-
ariaValueText: u,
|
|
669
|
-
ariaLabel: n.seek,
|
|
670
|
-
onSeekInput: l,
|
|
671
|
-
onSeekChange: l
|
|
569
|
+
lines: a,
|
|
570
|
+
activeIndex: i,
|
|
571
|
+
activeLine: i >= 0 ? a[i] ?? null : null
|
|
672
572
|
};
|
|
673
573
|
}
|
|
674
|
-
function
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
574
|
+
function ir({
|
|
575
|
+
className: e,
|
|
576
|
+
style: r,
|
|
577
|
+
fallback: n,
|
|
578
|
+
empty: t,
|
|
579
|
+
unstyled: a = !1,
|
|
580
|
+
activeClassName: i,
|
|
581
|
+
lineClassName: o,
|
|
582
|
+
children: u
|
|
583
|
+
}) {
|
|
584
|
+
const l = I(), { lines: s, activeIndex: g } = pn();
|
|
585
|
+
if (s.length === 0) {
|
|
586
|
+
const y = t ?? n ?? null;
|
|
587
|
+
return y ? /* @__PURE__ */ d("span", { className: e, style: r, children: y }) : null;
|
|
588
|
+
}
|
|
589
|
+
return /* @__PURE__ */ d("ul", { className: e, style: { ...a ? {} : {
|
|
590
|
+
listStyle: "none",
|
|
591
|
+
margin: 0,
|
|
592
|
+
padding: 0,
|
|
593
|
+
fontFamily: "var(--ginger-font-family, system-ui, sans-serif)",
|
|
594
|
+
fontSize: "var(--ginger-font-size, 14px)",
|
|
595
|
+
color: "var(--ginger-primary-color, #111827)"
|
|
596
|
+
}, ...r }, "aria-label": "Synced lyrics", children: s.map((y, k) => {
|
|
597
|
+
const b = k === g;
|
|
598
|
+
return /* @__PURE__ */ d(
|
|
599
|
+
"li",
|
|
600
|
+
{
|
|
601
|
+
"aria-current": b ? "true" : void 0,
|
|
602
|
+
"data-ginger-active": b || void 0,
|
|
603
|
+
className: [o, b ? i : void 0].filter(Boolean).join(" ") || void 0,
|
|
604
|
+
style: a ? void 0 : {
|
|
605
|
+
padding: "var(--ginger-playlist-row-padding, 4px 8px)",
|
|
606
|
+
fontWeight: b ? 600 : 400,
|
|
607
|
+
opacity: b ? 1 : 0.75
|
|
608
|
+
},
|
|
609
|
+
children: u ? u(y, k, b, l) : y.text
|
|
610
|
+
},
|
|
611
|
+
`${y.time}-${k}`
|
|
612
|
+
);
|
|
613
|
+
}) });
|
|
689
614
|
}
|
|
690
|
-
|
|
691
|
-
|
|
615
|
+
ir.displayName = "Ginger.Current.LyricsSynced";
|
|
616
|
+
function gn() {
|
|
617
|
+
const { tracks: e, currentIndex: r } = _(), { currentTime: n, seek: t } = j(), a = P(() => {
|
|
618
|
+
var u;
|
|
619
|
+
return [...((u = e[r]) == null ? void 0 : u.chapters) ?? []].filter((l) => l && Number.isFinite(l.startSeconds) && l.startSeconds >= 0).sort((l, s) => l.startSeconds - s.startSeconds);
|
|
620
|
+
}, [r, e]), i = P(() => {
|
|
621
|
+
if (a.length === 0) return -1;
|
|
622
|
+
for (let o = a.length - 1; o >= 0; o -= 1)
|
|
623
|
+
if (n >= a[o].startSeconds) return o;
|
|
624
|
+
return -1;
|
|
625
|
+
}, [n, a]);
|
|
692
626
|
return {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
627
|
+
list: a,
|
|
628
|
+
activeIndex: i,
|
|
629
|
+
active: i >= 0 ? a[i] ?? null : null,
|
|
630
|
+
seekTo: (o) => {
|
|
631
|
+
const u = a[o];
|
|
632
|
+
u && t(u.startSeconds);
|
|
633
|
+
}
|
|
696
634
|
};
|
|
697
635
|
}
|
|
698
|
-
function
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
...u
|
|
636
|
+
function or({
|
|
637
|
+
className: e,
|
|
638
|
+
style: r,
|
|
639
|
+
fallback: n,
|
|
640
|
+
empty: t,
|
|
641
|
+
unstyled: a = !1,
|
|
642
|
+
formatStart: i = z,
|
|
643
|
+
children: o
|
|
707
644
|
}) {
|
|
708
|
-
const
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
645
|
+
const u = I(), { list: l, activeIndex: s, seekTo: g } = gn();
|
|
646
|
+
if (l.length === 0) {
|
|
647
|
+
const y = t ?? n ?? null;
|
|
648
|
+
return y ? /* @__PURE__ */ d("span", { className: e, style: r, children: y }) : null;
|
|
649
|
+
}
|
|
650
|
+
return /* @__PURE__ */ d("ul", { className: e, style: { ...a ? {} : {
|
|
651
|
+
listStyle: "none",
|
|
652
|
+
margin: 0,
|
|
653
|
+
padding: 0,
|
|
654
|
+
fontFamily: "var(--ginger-font-family, system-ui, sans-serif)",
|
|
655
|
+
fontSize: "var(--ginger-font-size, 14px)",
|
|
656
|
+
color: "var(--ginger-primary-color, #111827)"
|
|
657
|
+
}, ...r }, "aria-label": "Chapters", children: l.map((y, k) => {
|
|
658
|
+
const b = k === s;
|
|
659
|
+
return /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(
|
|
660
|
+
"button",
|
|
661
|
+
{
|
|
662
|
+
type: "button",
|
|
663
|
+
"aria-current": b ? "true" : void 0,
|
|
664
|
+
"data-ginger-active": b || void 0,
|
|
665
|
+
onClick: () => g(k),
|
|
666
|
+
style: {
|
|
667
|
+
width: a ? void 0 : "100%",
|
|
668
|
+
textAlign: a ? void 0 : "left",
|
|
669
|
+
border: a ? void 0 : "none",
|
|
670
|
+
background: a ? void 0 : b ? "var(--ginger-playlist-active-bg, rgba(17, 24, 39, 0.06))" : "transparent",
|
|
671
|
+
color: a ? void 0 : "inherit",
|
|
672
|
+
font: a ? void 0 : "inherit",
|
|
673
|
+
cursor: a ? void 0 : "pointer",
|
|
674
|
+
padding: a ? void 0 : "var(--ginger-playlist-row-padding, 6px 8px)"
|
|
675
|
+
},
|
|
676
|
+
children: o ? o(y, k, b, u) : /* @__PURE__ */ q("span", { children: [
|
|
677
|
+
/* @__PURE__ */ d("span", { style: { opacity: 0.75, marginRight: "0.35em" }, children: i(y.startSeconds) }),
|
|
678
|
+
y.title
|
|
679
|
+
] })
|
|
680
|
+
}
|
|
681
|
+
) }, `${y.startSeconds}-${y.title}`);
|
|
682
|
+
}) });
|
|
740
683
|
}
|
|
741
|
-
|
|
742
|
-
function
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
684
|
+
or.displayName = "Ginger.Current.Chapters";
|
|
685
|
+
function ur({
|
|
686
|
+
visible: e = !1,
|
|
687
|
+
className: r,
|
|
688
|
+
style: n,
|
|
689
|
+
fallback: t,
|
|
690
|
+
empty: a,
|
|
691
|
+
children: i
|
|
748
692
|
}) {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
},
|
|
759
|
-
children: r ?? o.previousTrack
|
|
760
|
-
}
|
|
761
|
-
);
|
|
693
|
+
var l;
|
|
694
|
+
const o = I();
|
|
695
|
+
if (!e) return null;
|
|
696
|
+
const u = ((l = V(o)) == null ? void 0 : l.fileUrl) ?? "";
|
|
697
|
+
if (!u) {
|
|
698
|
+
const s = a ?? t ?? null;
|
|
699
|
+
return s ? /* @__PURE__ */ d("span", { className: r, style: n, children: s }) : null;
|
|
700
|
+
}
|
|
701
|
+
return i ? /* @__PURE__ */ d("span", { className: r, style: n, children: i(u, o) }) : /* @__PURE__ */ d("span", { className: r, style: n, children: u });
|
|
762
702
|
}
|
|
763
|
-
|
|
764
|
-
function
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
703
|
+
ur.displayName = "Ginger.Current.FileUrl";
|
|
704
|
+
function sr({
|
|
705
|
+
className: e,
|
|
706
|
+
style: r,
|
|
707
|
+
fallback: n,
|
|
708
|
+
empty: t,
|
|
709
|
+
sizes: a,
|
|
710
|
+
loading: i,
|
|
711
|
+
onError: o,
|
|
712
|
+
decoding: u,
|
|
713
|
+
unstyled: l = !1,
|
|
714
|
+
imgStyle: s
|
|
770
715
|
}) {
|
|
771
|
-
const
|
|
716
|
+
const g = I(), m = V(g), y = Wr(g);
|
|
717
|
+
if (!y) {
|
|
718
|
+
const b = t ?? n ?? null;
|
|
719
|
+
return b ? /* @__PURE__ */ d("span", { className: e, style: r, children: b }) : null;
|
|
720
|
+
}
|
|
721
|
+
const k = [m == null ? void 0 : m.title, m == null ? void 0 : m.artist].filter(Boolean).join(" — ") || "Artwork";
|
|
772
722
|
return /* @__PURE__ */ d(
|
|
773
|
-
"
|
|
723
|
+
"div",
|
|
774
724
|
{
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
725
|
+
className: e,
|
|
726
|
+
style: l ? { ...r } : {
|
|
727
|
+
background: "var(--ginger-artwork-bg, transparent)",
|
|
728
|
+
borderRadius: "var(--ginger-artwork-radius, 0)",
|
|
729
|
+
overflow: "hidden",
|
|
730
|
+
...r
|
|
780
731
|
},
|
|
781
|
-
children:
|
|
732
|
+
children: /* @__PURE__ */ d(
|
|
733
|
+
"img",
|
|
734
|
+
{
|
|
735
|
+
src: y,
|
|
736
|
+
alt: k,
|
|
737
|
+
sizes: a,
|
|
738
|
+
loading: i,
|
|
739
|
+
decoding: u,
|
|
740
|
+
onError: o,
|
|
741
|
+
style: {
|
|
742
|
+
display: l ? void 0 : "block",
|
|
743
|
+
width: l ? void 0 : "100%",
|
|
744
|
+
height: l ? void 0 : "100%",
|
|
745
|
+
objectFit: l ? void 0 : "cover",
|
|
746
|
+
...s
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
)
|
|
782
750
|
}
|
|
783
751
|
);
|
|
784
752
|
}
|
|
785
|
-
|
|
786
|
-
function
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
753
|
+
sr.displayName = "Ginger.Current.Artwork";
|
|
754
|
+
function lr({
|
|
755
|
+
base: e = 0,
|
|
756
|
+
className: r,
|
|
757
|
+
style: n,
|
|
758
|
+
fallback: t,
|
|
759
|
+
empty: a,
|
|
760
|
+
children: i
|
|
792
761
|
}) {
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
{
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
"aria-label": n ?? u.shuffle,
|
|
801
|
-
onClick: (l) => {
|
|
802
|
-
o(), t == null || t(l);
|
|
803
|
-
},
|
|
804
|
-
children: r ?? u.shuffle
|
|
805
|
-
}
|
|
806
|
-
);
|
|
762
|
+
const o = I();
|
|
763
|
+
if (o.tracks.length === 0) {
|
|
764
|
+
const s = a ?? t ?? null;
|
|
765
|
+
return s ? /* @__PURE__ */ d("span", { className: r, style: n, children: s }) : null;
|
|
766
|
+
}
|
|
767
|
+
const l = String(o.currentIndex + e);
|
|
768
|
+
return i ? /* @__PURE__ */ d("span", { className: r, style: n, children: i(l, o) }) : /* @__PURE__ */ d("span", { className: r, style: n, children: l });
|
|
807
769
|
}
|
|
808
|
-
|
|
809
|
-
function
|
|
810
|
-
const i =
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
{
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
min: i.min,
|
|
817
|
-
max: i.max,
|
|
818
|
-
step: i.step,
|
|
819
|
-
value: i.value,
|
|
820
|
-
"aria-label": t ?? i.ariaLabel,
|
|
821
|
-
"aria-valuetext": i.ariaValueText,
|
|
822
|
-
onInput: i.onSeekInput,
|
|
823
|
-
onChange: i.onSeekChange,
|
|
824
|
-
style: o
|
|
825
|
-
}
|
|
826
|
-
);
|
|
770
|
+
lr.displayName = "Ginger.Current.QueueIndex";
|
|
771
|
+
function cr({ className: e, style: r, fallback: n, empty: t, children: a }) {
|
|
772
|
+
const i = I(), o = String(i.tracks.length);
|
|
773
|
+
if (i.tracks.length === 0) {
|
|
774
|
+
const u = t ?? n ?? null;
|
|
775
|
+
return u ? /* @__PURE__ */ d("span", { className: e, style: r, children: u }) : null;
|
|
776
|
+
}
|
|
777
|
+
return a ? /* @__PURE__ */ d("span", { className: e, style: r, children: a(o, i) }) : /* @__PURE__ */ d("span", { className: e, style: r, children: o });
|
|
827
778
|
}
|
|
828
|
-
|
|
829
|
-
function
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
779
|
+
cr.displayName = "Ginger.Current.QueueLength";
|
|
780
|
+
function dr({
|
|
781
|
+
base: e = 0,
|
|
782
|
+
separator: r = " / ",
|
|
783
|
+
className: n,
|
|
784
|
+
style: t,
|
|
785
|
+
fallback: a,
|
|
786
|
+
empty: i,
|
|
787
|
+
children: o
|
|
788
|
+
}) {
|
|
789
|
+
const u = I(), l = u.tracks.length;
|
|
790
|
+
if (l === 0) {
|
|
791
|
+
const y = i ?? a ?? null;
|
|
792
|
+
return y ? /* @__PURE__ */ d("span", { className: n, style: t, children: y }) : null;
|
|
793
|
+
}
|
|
794
|
+
const s = String(u.currentIndex + e), g = String(l), m = `${s}${r}${g}`;
|
|
795
|
+
return o ? /* @__PURE__ */ d("span", { className: n, style: t, children: o({ index: s, length: g, label: m }, u) }) : /* @__PURE__ */ d("span", { className: n, style: t, children: m });
|
|
796
|
+
}
|
|
797
|
+
dr.displayName = "Ginger.Current.QueuePosition";
|
|
798
|
+
function we(e, r, n) {
|
|
799
|
+
const { className: t, style: a, fallback: i, empty: o, children: u, format: l = z } = n;
|
|
800
|
+
if (!(e >= 0) || !Number.isFinite(e)) {
|
|
801
|
+
const g = o ?? i ?? null;
|
|
802
|
+
return g ? /* @__PURE__ */ d("span", { className: t, style: a, children: g }) : null;
|
|
803
|
+
}
|
|
804
|
+
const s = l(e);
|
|
805
|
+
return u ? /* @__PURE__ */ d("span", { className: t, style: a, children: u(s, r) }) : /* @__PURE__ */ d("span", { className: t, style: a, children: s });
|
|
806
|
+
}
|
|
807
|
+
function fr(e) {
|
|
808
|
+
const r = I();
|
|
809
|
+
return we(r.currentTime, r, e);
|
|
810
|
+
}
|
|
811
|
+
fr.displayName = "Ginger.Current.Elapsed";
|
|
812
|
+
function pr(e) {
|
|
813
|
+
const r = I();
|
|
814
|
+
return we(J(r), r, e);
|
|
815
|
+
}
|
|
816
|
+
pr.displayName = "Ginger.Current.Duration";
|
|
817
|
+
function gr(e) {
|
|
818
|
+
const r = I();
|
|
819
|
+
return we(zr(r), r, e);
|
|
820
|
+
}
|
|
821
|
+
gr.displayName = "Ginger.Current.Remaining";
|
|
822
|
+
function mr({ className: e, style: r, fallback: n, empty: t, children: a }) {
|
|
823
|
+
const i = I(), o = J(i), u = Ke(i);
|
|
824
|
+
if (!(o > 0)) {
|
|
825
|
+
const l = t ?? n ?? null;
|
|
826
|
+
return l ? /* @__PURE__ */ d("span", { className: e, style: r, children: l }) : null;
|
|
827
|
+
}
|
|
828
|
+
return a ? /* @__PURE__ */ d("span", { className: e, style: r, children: a({ fraction: u, currentTime: i.currentTime, duration: o }, i) }) : /* @__PURE__ */ d("span", { className: e, style: r, children: `${Math.round(u * 100)}%` });
|
|
829
|
+
}
|
|
830
|
+
mr.displayName = "Ginger.Current.Progress";
|
|
831
|
+
function yr({
|
|
832
|
+
className: e,
|
|
833
|
+
style: r,
|
|
834
|
+
height: n = 4,
|
|
835
|
+
showBuffered: t = !1,
|
|
836
|
+
unstyled: a = !1
|
|
837
|
+
}) {
|
|
838
|
+
const i = I(), o = `${Math.round(Ke(i) * 100)}%`, u = `${Math.round(Math.min(1, Math.max(0, i.bufferedFraction)) * 100)}%`;
|
|
839
|
+
return /* @__PURE__ */ q(
|
|
840
|
+
"div",
|
|
833
841
|
{
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
842
|
+
className: e,
|
|
843
|
+
style: a ? { ...r } : {
|
|
844
|
+
width: "100%",
|
|
845
|
+
height: n,
|
|
846
|
+
background: "var(--ginger-muted-color, #e5e7eb)",
|
|
847
|
+
borderRadius: 999,
|
|
848
|
+
overflow: "hidden",
|
|
849
|
+
position: "relative",
|
|
850
|
+
...r
|
|
851
|
+
},
|
|
852
|
+
"aria-hidden": !0,
|
|
853
|
+
children: [
|
|
854
|
+
t ? /* @__PURE__ */ d(
|
|
855
|
+
"div",
|
|
856
|
+
{
|
|
857
|
+
style: {
|
|
858
|
+
position: a ? void 0 : "absolute",
|
|
859
|
+
left: a ? void 0 : 0,
|
|
860
|
+
top: a ? void 0 : 0,
|
|
861
|
+
height: a ? void 0 : "100%",
|
|
862
|
+
width: u,
|
|
863
|
+
background: a ? void 0 : "var(--ginger-buffer-color, rgba(107, 114, 128, 0.35))"
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
) : null,
|
|
867
|
+
/* @__PURE__ */ d(
|
|
868
|
+
"div",
|
|
869
|
+
{
|
|
870
|
+
style: {
|
|
871
|
+
position: a ? void 0 : "relative",
|
|
872
|
+
width: o,
|
|
873
|
+
height: a ? void 0 : "100%",
|
|
874
|
+
background: a ? void 0 : "var(--ginger-primary-color, #111827)"
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
)
|
|
878
|
+
]
|
|
845
879
|
}
|
|
846
880
|
);
|
|
847
881
|
}
|
|
848
|
-
|
|
849
|
-
function
|
|
850
|
-
|
|
851
|
-
muteLabel: r,
|
|
852
|
-
unmuteLabel: n,
|
|
853
|
-
type: t = "button",
|
|
854
|
-
onClick: a,
|
|
855
|
-
children: i,
|
|
856
|
-
...o
|
|
857
|
-
}) {
|
|
858
|
-
const { muted: u, toggleMute: l } = j(), s = N(), g = r ?? s.mute, m = n ?? s.unmute;
|
|
882
|
+
yr.displayName = "Ginger.Current.TimeRail";
|
|
883
|
+
function hr({ className: e, style: r, height: n = 4, unstyled: t = !1 }) {
|
|
884
|
+
const a = I(), i = `${Math.round(Math.min(1, Math.max(0, a.bufferedFraction)) * 100)}%`;
|
|
859
885
|
return /* @__PURE__ */ d(
|
|
860
|
-
"
|
|
886
|
+
"div",
|
|
861
887
|
{
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
888
|
+
className: e,
|
|
889
|
+
style: t ? { ...r } : {
|
|
890
|
+
width: "100%",
|
|
891
|
+
height: n,
|
|
892
|
+
background: "var(--ginger-muted-color, #e5e7eb)",
|
|
893
|
+
borderRadius: 999,
|
|
894
|
+
overflow: "hidden",
|
|
895
|
+
...r
|
|
868
896
|
},
|
|
869
|
-
|
|
897
|
+
"aria-hidden": !0,
|
|
898
|
+
children: /* @__PURE__ */ d(
|
|
899
|
+
"div",
|
|
900
|
+
{
|
|
901
|
+
style: {
|
|
902
|
+
width: i,
|
|
903
|
+
height: t ? void 0 : "100%",
|
|
904
|
+
background: t ? void 0 : "var(--ginger-buffer-color, rgba(107, 114, 128, 0.35))"
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
)
|
|
870
908
|
}
|
|
871
909
|
);
|
|
872
910
|
}
|
|
873
|
-
|
|
874
|
-
|
|
911
|
+
hr.displayName = "Ginger.Current.BufferRail";
|
|
912
|
+
function br({ className: e, style: r, fallback: n, empty: t, children: a }) {
|
|
913
|
+
const i = I(), o = je(i);
|
|
914
|
+
return a ? /* @__PURE__ */ d("span", { className: e, style: r, children: a(o, i) }) : /* @__PURE__ */ d("span", { className: e, style: r, children: o });
|
|
915
|
+
}
|
|
916
|
+
br.displayName = "Ginger.Current.PlaybackState";
|
|
875
917
|
function vr({
|
|
876
|
-
|
|
918
|
+
className: e,
|
|
877
919
|
style: r,
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
920
|
+
fallback: n,
|
|
921
|
+
empty: t,
|
|
922
|
+
live: a = "polite",
|
|
923
|
+
children: i
|
|
881
924
|
}) {
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
{
|
|
889
|
-
...a,
|
|
890
|
-
"aria-label": n ?? u.playbackSpeed,
|
|
891
|
-
value: String(i),
|
|
892
|
-
style: r,
|
|
893
|
-
onChange: (s) => o(Number(s.currentTarget.value)),
|
|
894
|
-
children: [
|
|
895
|
-
t ?? u.playbackSpeed,
|
|
896
|
-
l.map((s) => /* @__PURE__ */ d("option", { value: String(s), children: s === 1 ? u.playbackRateNormal : u.playbackRateTimes(s) }, s))
|
|
897
|
-
]
|
|
898
|
-
}
|
|
899
|
-
);
|
|
925
|
+
const o = I(), u = o.errorMessage ?? "";
|
|
926
|
+
if (!u) {
|
|
927
|
+
const l = t ?? n ?? null;
|
|
928
|
+
return l ? /* @__PURE__ */ d("span", { className: e, style: r, children: l }) : null;
|
|
929
|
+
}
|
|
930
|
+
return i ? /* @__PURE__ */ d("span", { className: e, style: r, "aria-live": a, children: i(u, o) }) : /* @__PURE__ */ d("span", { className: e, style: r, "aria-live": a, children: u });
|
|
900
931
|
}
|
|
901
|
-
vr.displayName = "Ginger.
|
|
932
|
+
vr.displayName = "Ginger.Current.ErrorMessage";
|
|
902
933
|
const _e = Ne(null);
|
|
903
934
|
function mn() {
|
|
904
935
|
const e = Ge(_e);
|
|
@@ -953,7 +984,7 @@ function kr({
|
|
|
953
984
|
}) }) });
|
|
954
985
|
}
|
|
955
986
|
kr.displayName = "Ginger.Playlist";
|
|
956
|
-
function
|
|
987
|
+
function xr({
|
|
957
988
|
index: e,
|
|
958
989
|
unstyled: r = !1,
|
|
959
990
|
className: n,
|
|
@@ -993,23 +1024,36 @@ function Mr({
|
|
|
993
1024
|
}
|
|
994
1025
|
) });
|
|
995
1026
|
}
|
|
996
|
-
|
|
1027
|
+
xr.displayName = "Ginger.Playlist.Track";
|
|
997
1028
|
const yn = Object.assign(kr, {
|
|
998
|
-
Track:
|
|
1029
|
+
Track: xr
|
|
999
1030
|
}), hn = B("Ginger.Queue.Title", (e) => {
|
|
1000
1031
|
var r;
|
|
1001
1032
|
return (r = e.playlistMeta) == null ? void 0 : r.title;
|
|
1002
1033
|
}), bn = B("Ginger.Queue.Subtitle", (e) => {
|
|
1003
1034
|
var r;
|
|
1004
1035
|
return (r = e.playlistMeta) == null ? void 0 : r.subtitle;
|
|
1005
|
-
}), vn = B(
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1036
|
+
}), vn = B(
|
|
1037
|
+
"Ginger.Queue.Description",
|
|
1038
|
+
(e) => {
|
|
1039
|
+
var r;
|
|
1040
|
+
return (r = e.playlistMeta) == null ? void 0 : r.description;
|
|
1041
|
+
}
|
|
1042
|
+
), kn = B(
|
|
1043
|
+
"Ginger.Queue.Copyright",
|
|
1044
|
+
(e) => {
|
|
1045
|
+
var r;
|
|
1046
|
+
return (r = e.playlistMeta) == null ? void 0 : r.copyright;
|
|
1047
|
+
}
|
|
1048
|
+
);
|
|
1049
|
+
function Mr({
|
|
1050
|
+
className: e,
|
|
1051
|
+
style: r,
|
|
1052
|
+
fallback: n,
|
|
1053
|
+
empty: t,
|
|
1054
|
+
unstyled: a = !1,
|
|
1055
|
+
imgStyle: i
|
|
1056
|
+
}) {
|
|
1013
1057
|
var s, g;
|
|
1014
1058
|
const o = I(), u = (s = o.playlistMeta) == null ? void 0 : s.artworkUrl;
|
|
1015
1059
|
if (!u) {
|
|
@@ -1045,7 +1089,7 @@ function Tr({ className: e, style: r, fallback: n, empty: t, unstyled: a = !1, i
|
|
|
1045
1089
|
}
|
|
1046
1090
|
);
|
|
1047
1091
|
}
|
|
1048
|
-
|
|
1092
|
+
Mr.displayName = "Ginger.Queue.Artwork";
|
|
1049
1093
|
function Ae(e) {
|
|
1050
1094
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 1;
|
|
1051
1095
|
}
|
|
@@ -1058,16 +1102,16 @@ const U = {
|
|
|
1058
1102
|
bufferedFraction: 0,
|
|
1059
1103
|
isBuffering: !1,
|
|
1060
1104
|
errorMessage: null
|
|
1061
|
-
},
|
|
1105
|
+
}, xn = {
|
|
1062
1106
|
...U,
|
|
1063
1107
|
volume: 1,
|
|
1064
1108
|
muted: !1,
|
|
1065
1109
|
playbackRate: 1
|
|
1066
1110
|
};
|
|
1067
|
-
function
|
|
1111
|
+
function Tr(e) {
|
|
1068
1112
|
const r = [...e.tracks];
|
|
1069
1113
|
let n = A(e.currentIndex ?? 0, r.length), t = null, a = r;
|
|
1070
|
-
return e.isShuffled && r.length > 1 && (t = [...r], a =
|
|
1114
|
+
return e.isShuffled && r.length > 1 && (t = [...r], a = Ye(r, n), n = 0), {
|
|
1071
1115
|
tracks: a,
|
|
1072
1116
|
currentIndex: n,
|
|
1073
1117
|
playbackMode: e.playbackMode ?? "playlist",
|
|
@@ -1076,13 +1120,13 @@ function xr(e) {
|
|
|
1076
1120
|
repeatMode: e.repeatMode ?? "off",
|
|
1077
1121
|
originalTracks: t,
|
|
1078
1122
|
playlistMeta: e.playlistMeta ?? null,
|
|
1079
|
-
...
|
|
1123
|
+
...xn,
|
|
1080
1124
|
volume: Ae(e.volume ?? 1),
|
|
1081
1125
|
muted: e.muted ?? !1,
|
|
1082
1126
|
playbackRate: Ce(e.playbackRate ?? 1)
|
|
1083
1127
|
};
|
|
1084
1128
|
}
|
|
1085
|
-
function
|
|
1129
|
+
function Mn(e, r) {
|
|
1086
1130
|
switch (r.type) {
|
|
1087
1131
|
case "INIT": {
|
|
1088
1132
|
const {
|
|
@@ -1097,7 +1141,7 @@ function Tn(e, r) {
|
|
|
1097
1141
|
muted: g,
|
|
1098
1142
|
playbackRate: m
|
|
1099
1143
|
} = r.payload;
|
|
1100
|
-
return
|
|
1144
|
+
return Tr({
|
|
1101
1145
|
tracks: n,
|
|
1102
1146
|
currentIndex: t,
|
|
1103
1147
|
playlistMeta: a ?? null,
|
|
@@ -1122,7 +1166,7 @@ function Tn(e, r) {
|
|
|
1122
1166
|
};
|
|
1123
1167
|
}
|
|
1124
1168
|
case "INSERT_TRACK": {
|
|
1125
|
-
const n = r.payload.index ?? e.tracks.length, t =
|
|
1169
|
+
const n = r.payload.index ?? e.tracks.length, t = Qe(e.tracks, r.payload.track, n);
|
|
1126
1170
|
if (r.payload.autoPlay) {
|
|
1127
1171
|
const i = A(n, t.length);
|
|
1128
1172
|
return {
|
|
@@ -1145,7 +1189,7 @@ function Tn(e, r) {
|
|
|
1145
1189
|
};
|
|
1146
1190
|
}
|
|
1147
1191
|
case "REMOVE_TRACK": {
|
|
1148
|
-
const n = r.payload.index, t =
|
|
1192
|
+
const n = r.payload.index, t = Or(e.tracks, n), a = n < e.currentIndex ? e.currentIndex - 1 : n === e.currentIndex ? Math.min(e.currentIndex, Math.max(0, t.length - 1)) : e.currentIndex;
|
|
1149
1193
|
return {
|
|
1150
1194
|
...e,
|
|
1151
1195
|
tracks: t,
|
|
@@ -1156,7 +1200,7 @@ function Tn(e, r) {
|
|
|
1156
1200
|
};
|
|
1157
1201
|
}
|
|
1158
1202
|
case "MOVE_TRACK": {
|
|
1159
|
-
const { fromIndex: n, toIndex: t } = r.payload, a =
|
|
1203
|
+
const { fromIndex: n, toIndex: t } = r.payload, a = Br(e.tracks, n, t);
|
|
1160
1204
|
let i = e.currentIndex;
|
|
1161
1205
|
return e.currentIndex === n ? i = t : n < e.currentIndex && t >= e.currentIndex ? i -= 1 : n > e.currentIndex && t <= e.currentIndex && (i += 1), {
|
|
1162
1206
|
...e,
|
|
@@ -1167,7 +1211,7 @@ function Tn(e, r) {
|
|
|
1167
1211
|
};
|
|
1168
1212
|
}
|
|
1169
1213
|
case "ADD_NEXT": {
|
|
1170
|
-
const n =
|
|
1214
|
+
const n = Yr(e.tracks, e.currentIndex, r.payload.track);
|
|
1171
1215
|
return {
|
|
1172
1216
|
...e,
|
|
1173
1217
|
tracks: n,
|
|
@@ -1193,11 +1237,11 @@ function Tn(e, r) {
|
|
|
1193
1237
|
case "SET_REPEAT":
|
|
1194
1238
|
return { ...e, repeatMode: r.payload };
|
|
1195
1239
|
case "CYCLE_REPEAT":
|
|
1196
|
-
return { ...e, repeatMode:
|
|
1240
|
+
return { ...e, repeatMode: Kr(e.repeatMode) };
|
|
1197
1241
|
case "TOGGLE_SHUFFLE": {
|
|
1198
1242
|
if (e.tracks.length <= 1) return { ...e, isShuffled: !1, originalTracks: null };
|
|
1199
1243
|
if (!e.isShuffled) {
|
|
1200
|
-
const i = [...e.tracks], o =
|
|
1244
|
+
const i = [...e.tracks], o = Ye(i, e.currentIndex);
|
|
1201
1245
|
return {
|
|
1202
1246
|
...e,
|
|
1203
1247
|
isShuffled: !0,
|
|
@@ -1206,7 +1250,7 @@ function Tn(e, r) {
|
|
|
1206
1250
|
currentIndex: 0
|
|
1207
1251
|
};
|
|
1208
1252
|
}
|
|
1209
|
-
const n = e.originalTracks ? [...e.originalTracks] : [...e.tracks], t = e.tracks[e.currentIndex], a =
|
|
1253
|
+
const n = e.originalTracks ? [...e.originalTracks] : [...e.tracks], t = e.tracks[e.currentIndex], a = $r(n, t);
|
|
1210
1254
|
return {
|
|
1211
1255
|
...e,
|
|
1212
1256
|
isShuffled: !1,
|
|
@@ -1216,7 +1260,7 @@ function Tn(e, r) {
|
|
|
1216
1260
|
};
|
|
1217
1261
|
}
|
|
1218
1262
|
case "NEXT": {
|
|
1219
|
-
const n =
|
|
1263
|
+
const n = Hr(e), t = n === e.currentIndex;
|
|
1220
1264
|
return {
|
|
1221
1265
|
...e,
|
|
1222
1266
|
currentIndex: n,
|
|
@@ -1225,7 +1269,7 @@ function Tn(e, r) {
|
|
|
1225
1269
|
};
|
|
1226
1270
|
}
|
|
1227
1271
|
case "PREV": {
|
|
1228
|
-
const n =
|
|
1272
|
+
const n = jr(e), t = n === e.currentIndex;
|
|
1229
1273
|
return {
|
|
1230
1274
|
...e,
|
|
1231
1275
|
currentIndex: n,
|
|
@@ -1290,9 +1334,9 @@ function Tn(e, r) {
|
|
|
1290
1334
|
function Re() {
|
|
1291
1335
|
return typeof navigator > "u" || !("mediaSession" in navigator) ? null : navigator.mediaSession;
|
|
1292
1336
|
}
|
|
1293
|
-
function
|
|
1337
|
+
function Tn(e, r, n) {
|
|
1294
1338
|
var l;
|
|
1295
|
-
const t = r.tracks[r.currentIndex], a = t == null ? void 0 : t.title, i = t == null ? void 0 : t.artist, o = t == null ? void 0 : t.album, u =
|
|
1339
|
+
const t = r.tracks[r.currentIndex], a = t == null ? void 0 : t.title, i = t == null ? void 0 : t.artist, o = t == null ? void 0 : t.album, u = He(t, (l = r.playlistMeta) == null ? void 0 : l.artworkUrl);
|
|
1296
1340
|
E(() => {
|
|
1297
1341
|
const s = Re();
|
|
1298
1342
|
!e || !s || (s.metadata = new MediaMetadata({
|
|
@@ -1352,7 +1396,7 @@ function En({
|
|
|
1352
1396
|
beforePlay: b,
|
|
1353
1397
|
onPlayBlocked: S,
|
|
1354
1398
|
persistence: p,
|
|
1355
|
-
hydrateOnMount:
|
|
1399
|
+
hydrateOnMount: T = !1,
|
|
1356
1400
|
resumeOnTrackChange: R = !1,
|
|
1357
1401
|
unstyled: w = !1,
|
|
1358
1402
|
className: Se,
|
|
@@ -1365,9 +1409,9 @@ function En({
|
|
|
1365
1409
|
}) {
|
|
1366
1410
|
var Fe;
|
|
1367
1411
|
const $ = O(null), [c, h] = wr(
|
|
1368
|
-
|
|
1412
|
+
Mn,
|
|
1369
1413
|
void 0,
|
|
1370
|
-
() =>
|
|
1414
|
+
() => Tr({
|
|
1371
1415
|
tracks: r,
|
|
1372
1416
|
currentIndex: n,
|
|
1373
1417
|
playlistMeta: t,
|
|
@@ -1456,8 +1500,8 @@ function En({
|
|
|
1456
1500
|
}, []), ie = v(() => {
|
|
1457
1501
|
c.isPaused ? L() : D();
|
|
1458
1502
|
}, [D, L, c.isPaused]), F = v((f) => {
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1503
|
+
const x = $.current;
|
|
1504
|
+
x && Number.isFinite(f) && (x.currentTime = Math.max(0, f));
|
|
1461
1505
|
}, []), oe = v((f) => {
|
|
1462
1506
|
h({ type: "SET_VOLUME", payload: Ae(f) });
|
|
1463
1507
|
}, []), ue = v((f) => {
|
|
@@ -1476,14 +1520,14 @@ function En({
|
|
|
1476
1520
|
h({ type: "CYCLE_REPEAT" });
|
|
1477
1521
|
}, []), fe = v(() => {
|
|
1478
1522
|
h({ type: "TOGGLE_SHUFFLE" });
|
|
1479
|
-
}, []), pe = v((f,
|
|
1480
|
-
h({ type: "SET_QUEUE", payload: { tracks: f, currentIndex:
|
|
1481
|
-
}, []), ge = v((f,
|
|
1482
|
-
h({ type: "INSERT_TRACK", payload: { track: f, index:
|
|
1523
|
+
}, []), pe = v((f, x) => {
|
|
1524
|
+
h({ type: "SET_QUEUE", payload: { tracks: f, currentIndex: x } });
|
|
1525
|
+
}, []), ge = v((f, x, M) => {
|
|
1526
|
+
h({ type: "INSERT_TRACK", payload: { track: f, index: x, autoPlay: M } });
|
|
1483
1527
|
}, []), me = v((f) => {
|
|
1484
1528
|
h({ type: "REMOVE_TRACK", payload: { index: f } });
|
|
1485
|
-
}, []), ye = v((f,
|
|
1486
|
-
h({ type: "MOVE_TRACK", payload: { fromIndex: f, toIndex:
|
|
1529
|
+
}, []), ye = v((f, x) => {
|
|
1530
|
+
h({ type: "MOVE_TRACK", payload: { fromIndex: f, toIndex: x } });
|
|
1487
1531
|
}, []), he = v((f) => {
|
|
1488
1532
|
h({ type: "ADD_NEXT", payload: { track: f } });
|
|
1489
1533
|
}, []), be = v((f) => {
|
|
@@ -1492,14 +1536,14 @@ function En({
|
|
|
1492
1536
|
h({ type: "SET_INDEX", payload: { index: f, autoPlay: !1 } });
|
|
1493
1537
|
}, []), ke = v((f) => {
|
|
1494
1538
|
h({ type: "SET_PLAYLIST_META", payload: f });
|
|
1495
|
-
}, []),
|
|
1539
|
+
}, []), xe = v((f) => {
|
|
1496
1540
|
h({ type: "SET_PLAYBACK_MODE", payload: f });
|
|
1497
|
-
}, []),
|
|
1541
|
+
}, []), Me = v((f) => {
|
|
1498
1542
|
h({ type: "INIT", payload: f });
|
|
1499
1543
|
}, []);
|
|
1500
1544
|
E(() => {
|
|
1501
|
-
if (!p || !
|
|
1502
|
-
const f = p.get("ginger:volume"),
|
|
1545
|
+
if (!p || !T) return;
|
|
1546
|
+
const f = p.get("ginger:volume"), x = p.get("ginger:muted"), M = p.get("ginger:playbackRate"), C = p.get("ginger:repeatMode"), Ie = p.get("ginger:currentIndex"), G = Pe.current;
|
|
1503
1547
|
h({
|
|
1504
1548
|
type: "INIT",
|
|
1505
1549
|
payload: {
|
|
@@ -1511,24 +1555,31 @@ function En({
|
|
|
1511
1555
|
currentIndex: typeof Ie == "number" ? Ie : G.currentIndex,
|
|
1512
1556
|
repeatMode: C === "off" || C === "all" || C === "one" ? C : G.repeatMode,
|
|
1513
1557
|
volume: typeof f == "number" ? f : G.volume,
|
|
1514
|
-
muted: typeof
|
|
1515
|
-
playbackRate: typeof
|
|
1558
|
+
muted: typeof x == "boolean" ? x : G.muted,
|
|
1559
|
+
playbackRate: typeof M == "number" ? M : G.playbackRate
|
|
1516
1560
|
}
|
|
1517
1561
|
});
|
|
1518
|
-
}, [
|
|
1562
|
+
}, [T, p]), E(() => {
|
|
1519
1563
|
p && (p.set("ginger:volume", c.volume), p.set("ginger:muted", c.muted), p.set("ginger:playbackRate", c.playbackRate), p.set("ginger:repeatMode", c.repeatMode), p.set("ginger:currentIndex", c.currentIndex));
|
|
1520
|
-
}, [
|
|
1564
|
+
}, [
|
|
1565
|
+
p,
|
|
1566
|
+
c.volume,
|
|
1567
|
+
c.muted,
|
|
1568
|
+
c.playbackRate,
|
|
1569
|
+
c.repeatMode,
|
|
1570
|
+
c.currentIndex
|
|
1571
|
+
]), E(() => {
|
|
1521
1572
|
if (!p || !R) return;
|
|
1522
1573
|
const f = c.tracks[c.currentIndex];
|
|
1523
1574
|
if (!f) return;
|
|
1524
|
-
const
|
|
1525
|
-
typeof
|
|
1575
|
+
const x = `ginger:resume:${W(f)}`, M = p.get(x);
|
|
1576
|
+
typeof M == "number" && Number.isFinite(M) && F(M);
|
|
1526
1577
|
}, [p, R, c.currentIndex, c.tracks, F]), E(() => {
|
|
1527
1578
|
if (!p || !R) return;
|
|
1528
1579
|
const f = c.tracks[c.currentIndex];
|
|
1529
1580
|
if (!f || !(c.currentTime >= 0)) return;
|
|
1530
|
-
const
|
|
1531
|
-
return () => clearTimeout(
|
|
1581
|
+
const x = `ginger:resume:${W(f)}`, M = setTimeout(() => p.set(x, c.currentTime), 250);
|
|
1582
|
+
return () => clearTimeout(M);
|
|
1532
1583
|
}, [p, R, c.currentIndex, c.tracks, c.currentTime]);
|
|
1533
1584
|
const Ir = (Fe = c.tracks[c.currentIndex]) == null ? void 0 : Fe.fileUrl;
|
|
1534
1585
|
E(() => {
|
|
@@ -1538,55 +1589,55 @@ function En({
|
|
|
1538
1589
|
f.pause();
|
|
1539
1590
|
return;
|
|
1540
1591
|
}
|
|
1541
|
-
let
|
|
1592
|
+
let x = !1;
|
|
1542
1593
|
return (async () => {
|
|
1543
1594
|
if (b) {
|
|
1544
|
-
let
|
|
1595
|
+
let M = !1;
|
|
1545
1596
|
try {
|
|
1546
|
-
|
|
1597
|
+
M = await b();
|
|
1547
1598
|
} catch (C) {
|
|
1548
1599
|
const Ie = C instanceof Error ? C.message : "beforePlay rejected";
|
|
1549
1600
|
h({ type: "MEDIA_ERROR", payload: { message: Ie } });
|
|
1550
1601
|
return;
|
|
1551
1602
|
}
|
|
1552
|
-
if (!
|
|
1553
|
-
|
|
1603
|
+
if (!M) {
|
|
1604
|
+
x || (h({ type: "PAUSE" }), S == null || S());
|
|
1554
1605
|
return;
|
|
1555
1606
|
}
|
|
1556
1607
|
}
|
|
1557
|
-
|
|
1558
|
-
const C =
|
|
1608
|
+
x || f.play().catch((M) => {
|
|
1609
|
+
const C = M instanceof Error ? M.message : typeof M == "string" ? M : "Playback failed (e.g. autoplay blocked or unavailable source)";
|
|
1559
1610
|
h({ type: "MEDIA_ERROR", payload: { message: C } });
|
|
1560
1611
|
});
|
|
1561
1612
|
})(), () => {
|
|
1562
|
-
|
|
1613
|
+
x = !0;
|
|
1563
1614
|
};
|
|
1564
1615
|
}, [b, Ir, S, c.isPaused]);
|
|
1565
|
-
const
|
|
1566
|
-
const f =
|
|
1616
|
+
const Te = v(() => {
|
|
1617
|
+
const f = Qr(Le.current);
|
|
1567
1618
|
if (f.kind === "replay_same") {
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1619
|
+
const M = $.current;
|
|
1620
|
+
M && (M.currentTime = 0), h({ type: "PLAY" });
|
|
1570
1621
|
return;
|
|
1571
1622
|
}
|
|
1572
1623
|
if (f.kind === "stop") {
|
|
1573
1624
|
h({ type: "PAUSE" }), ne == null || ne();
|
|
1574
1625
|
return;
|
|
1575
1626
|
}
|
|
1576
|
-
const
|
|
1577
|
-
h({ type: "SET_INDEX", payload: { index:
|
|
1627
|
+
const x = f.nextIndex;
|
|
1628
|
+
h({ type: "SET_INDEX", payload: { index: x, autoPlay: !0 } });
|
|
1578
1629
|
}, [ne]), Er = P(
|
|
1579
1630
|
() => ({ play: L, pause: D, next: Q, prev: H, seek: F }),
|
|
1580
1631
|
[L, D, Q, H, F]
|
|
1581
1632
|
);
|
|
1582
|
-
|
|
1633
|
+
Tn(!!k, c, Er);
|
|
1583
1634
|
const Ar = y != null && y.seek && /[\u0590-\u08FF]/.test(y.seek) ? "rtl" : "ltr", Sr = P(
|
|
1584
1635
|
() => ({
|
|
1585
1636
|
state: c,
|
|
1586
1637
|
dispatch: h,
|
|
1587
1638
|
audioRef: $,
|
|
1588
|
-
notifyEnded:
|
|
1589
|
-
init:
|
|
1639
|
+
notifyEnded: Te,
|
|
1640
|
+
init: Me,
|
|
1590
1641
|
play: L,
|
|
1591
1642
|
pause: D,
|
|
1592
1643
|
togglePlayPause: ie,
|
|
@@ -1608,14 +1659,14 @@ function En({
|
|
|
1608
1659
|
playTrackAt: be,
|
|
1609
1660
|
selectTrackAt: ve,
|
|
1610
1661
|
setPlaylistMeta: ke,
|
|
1611
|
-
setPlaybackMode:
|
|
1662
|
+
setPlaybackMode: xe
|
|
1612
1663
|
}),
|
|
1613
1664
|
[
|
|
1614
1665
|
de,
|
|
1615
1666
|
h,
|
|
1616
|
-
|
|
1667
|
+
Me,
|
|
1617
1668
|
Q,
|
|
1618
|
-
|
|
1669
|
+
Te,
|
|
1619
1670
|
D,
|
|
1620
1671
|
L,
|
|
1621
1672
|
be,
|
|
@@ -1631,7 +1682,7 @@ function En({
|
|
|
1631
1682
|
pe,
|
|
1632
1683
|
ce,
|
|
1633
1684
|
ke,
|
|
1634
|
-
|
|
1685
|
+
xe,
|
|
1635
1686
|
oe,
|
|
1636
1687
|
c,
|
|
1637
1688
|
se,
|
|
@@ -1647,7 +1698,7 @@ function En({
|
|
|
1647
1698
|
repeatMode: c.repeatMode,
|
|
1648
1699
|
originalTracks: c.originalTracks,
|
|
1649
1700
|
playlistMeta: c.playlistMeta,
|
|
1650
|
-
init:
|
|
1701
|
+
init: Me,
|
|
1651
1702
|
play: L,
|
|
1652
1703
|
pause: D,
|
|
1653
1704
|
togglePlayPause: ie,
|
|
@@ -1665,7 +1716,7 @@ function En({
|
|
|
1665
1716
|
playTrackAt: be,
|
|
1666
1717
|
selectTrackAt: ve,
|
|
1667
1718
|
setPlaylistMeta: ke,
|
|
1668
|
-
setPlaybackMode:
|
|
1719
|
+
setPlaybackMode: xe,
|
|
1669
1720
|
dispatch: h
|
|
1670
1721
|
}),
|
|
1671
1722
|
[
|
|
@@ -1677,7 +1728,7 @@ function En({
|
|
|
1677
1728
|
c.playbackMode,
|
|
1678
1729
|
c.originalTracks,
|
|
1679
1730
|
c.playlistMeta,
|
|
1680
|
-
|
|
1731
|
+
Me,
|
|
1681
1732
|
L,
|
|
1682
1733
|
D,
|
|
1683
1734
|
ie,
|
|
@@ -1694,7 +1745,7 @@ function En({
|
|
|
1694
1745
|
be,
|
|
1695
1746
|
ve,
|
|
1696
1747
|
ke,
|
|
1697
|
-
|
|
1748
|
+
xe,
|
|
1698
1749
|
h
|
|
1699
1750
|
]
|
|
1700
1751
|
), Rr = P(
|
|
@@ -1713,7 +1764,7 @@ function En({
|
|
|
1713
1764
|
toggleMute: se,
|
|
1714
1765
|
setPlaybackRate: le,
|
|
1715
1766
|
audioRef: $,
|
|
1716
|
-
notifyEnded:
|
|
1767
|
+
notifyEnded: Te,
|
|
1717
1768
|
dispatch: h
|
|
1718
1769
|
}),
|
|
1719
1770
|
[
|
|
@@ -1731,14 +1782,14 @@ function En({
|
|
|
1731
1782
|
se,
|
|
1732
1783
|
le,
|
|
1733
1784
|
$,
|
|
1734
|
-
|
|
1785
|
+
Te,
|
|
1735
1786
|
h
|
|
1736
1787
|
]
|
|
1737
|
-
), _r =
|
|
1788
|
+
), _r = je(c), Gr = P(
|
|
1738
1789
|
() => w ? K : { ...In, ...K },
|
|
1739
1790
|
[K, w]
|
|
1740
1791
|
);
|
|
1741
|
-
return /* @__PURE__ */ d(
|
|
1792
|
+
return /* @__PURE__ */ d(Vr, { locale: y, children: /* @__PURE__ */ d(Cr.Provider, { value: Pr, children: /* @__PURE__ */ d(Lr.Provider, { value: Rr, children: /* @__PURE__ */ d(Oe.Provider, { value: Sr, children: /* @__PURE__ */ d(
|
|
1742
1793
|
"div",
|
|
1743
1794
|
{
|
|
1744
1795
|
className: Se,
|
|
@@ -1753,74 +1804,74 @@ const Rn = {
|
|
|
1753
1804
|
Provider: En,
|
|
1754
1805
|
Player: Fr,
|
|
1755
1806
|
Current: {
|
|
1756
|
-
Title:
|
|
1757
|
-
Artist:
|
|
1758
|
-
Album:
|
|
1759
|
-
Description:
|
|
1760
|
-
Copyright:
|
|
1761
|
-
Genre:
|
|
1762
|
-
Label:
|
|
1763
|
-
Isrc:
|
|
1764
|
-
TrackNumber:
|
|
1765
|
-
Year:
|
|
1766
|
-
Lyrics:
|
|
1767
|
-
LyricsSynced:
|
|
1768
|
-
Chapters:
|
|
1769
|
-
FileUrl:
|
|
1770
|
-
Artwork:
|
|
1771
|
-
QueueIndex:
|
|
1772
|
-
QueueLength:
|
|
1773
|
-
QueuePosition:
|
|
1774
|
-
Elapsed:
|
|
1775
|
-
Duration:
|
|
1776
|
-
Remaining:
|
|
1777
|
-
Progress:
|
|
1778
|
-
TimeRail:
|
|
1779
|
-
BufferRail:
|
|
1780
|
-
PlaybackState:
|
|
1781
|
-
ErrorMessage:
|
|
1807
|
+
Title: nn,
|
|
1808
|
+
Artist: tn,
|
|
1809
|
+
Album: an,
|
|
1810
|
+
Description: on,
|
|
1811
|
+
Copyright: un,
|
|
1812
|
+
Genre: sn,
|
|
1813
|
+
Label: ln,
|
|
1814
|
+
Isrc: cn,
|
|
1815
|
+
TrackNumber: dn,
|
|
1816
|
+
Year: tr,
|
|
1817
|
+
Lyrics: ar,
|
|
1818
|
+
LyricsSynced: ir,
|
|
1819
|
+
Chapters: or,
|
|
1820
|
+
FileUrl: ur,
|
|
1821
|
+
Artwork: sr,
|
|
1822
|
+
QueueIndex: lr,
|
|
1823
|
+
QueueLength: cr,
|
|
1824
|
+
QueuePosition: dr,
|
|
1825
|
+
Elapsed: fr,
|
|
1826
|
+
Duration: pr,
|
|
1827
|
+
Remaining: gr,
|
|
1828
|
+
Progress: mr,
|
|
1829
|
+
TimeRail: yr,
|
|
1830
|
+
BufferRail: hr,
|
|
1831
|
+
PlaybackState: br,
|
|
1832
|
+
ErrorMessage: vr
|
|
1782
1833
|
},
|
|
1783
1834
|
Queue: {
|
|
1784
1835
|
Title: hn,
|
|
1785
1836
|
Subtitle: bn,
|
|
1786
1837
|
Description: vn,
|
|
1787
1838
|
Copyright: kn,
|
|
1788
|
-
Artwork:
|
|
1839
|
+
Artwork: Mr
|
|
1789
1840
|
},
|
|
1790
1841
|
Control: {
|
|
1791
|
-
PlayPause:
|
|
1792
|
-
Repeat:
|
|
1793
|
-
Next:
|
|
1794
|
-
Previous:
|
|
1795
|
-
Shuffle:
|
|
1796
|
-
SeekBar:
|
|
1797
|
-
Volume:
|
|
1798
|
-
Mute:
|
|
1799
|
-
PlaybackRate:
|
|
1842
|
+
PlayPause: Xe,
|
|
1843
|
+
Repeat: ze,
|
|
1844
|
+
Next: We,
|
|
1845
|
+
Previous: qe,
|
|
1846
|
+
Shuffle: Je,
|
|
1847
|
+
SeekBar: Ze,
|
|
1848
|
+
Volume: er,
|
|
1849
|
+
Mute: rr,
|
|
1850
|
+
PlaybackRate: nr
|
|
1800
1851
|
},
|
|
1801
1852
|
Playlist: yn
|
|
1802
1853
|
};
|
|
1803
1854
|
export {
|
|
1804
|
-
|
|
1855
|
+
or as C,
|
|
1805
1856
|
Rn as G,
|
|
1806
|
-
|
|
1857
|
+
ir as L,
|
|
1807
1858
|
Ae as a,
|
|
1808
|
-
|
|
1859
|
+
je as b,
|
|
1809
1860
|
Ce as c,
|
|
1810
1861
|
Ee as d,
|
|
1811
1862
|
N as e,
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1863
|
+
pn as f,
|
|
1864
|
+
en as g,
|
|
1865
|
+
Jr as h,
|
|
1866
|
+
Zr as i,
|
|
1867
|
+
Wr as j,
|
|
1868
|
+
Ke as k,
|
|
1869
|
+
zr as l,
|
|
1819
1870
|
J as m,
|
|
1820
1871
|
V as n,
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1872
|
+
Hr as o,
|
|
1873
|
+
fn as p,
|
|
1874
|
+
qr as r,
|
|
1875
|
+
gn as u
|
|
1825
1876
|
};
|
|
1826
|
-
//# sourceMappingURL=ginger-
|
|
1877
|
+
//# sourceMappingURL=ginger-DE4TKdCR.js.map
|