mulmocast-viewer 0.2.0 → 0.2.2

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.
@@ -1,493 +1,509 @@
1
- import { defineComponent as z, ref as $, watch as j, onMounted as ee, computed as E, onUnmounted as se, openBlock as i, createElementBlock as u, createElementVNode as e, createCommentVNode as k, toDisplayString as S, Fragment as R, renderList as Y, renderSlot as O, normalizeProps as te, guardReactiveProps as ie, createVNode as N, mergeProps as ae, unref as ue, withDirectives as re, createBlock as Z, vShow as de, normalizeClass as ce, withModifiers as ve, resolveDynamicComponent as oe, withCtx as le } from "vue";
2
- const Q = async (t) => await new Promise((c) => setTimeout(c, t)), me = (t, c) => {
3
- const a = (o) => o instanceof Error ? o : new Error("Aborted");
4
- return new Promise((o, p) => {
5
- if (c.aborted) {
6
- p(a(c.reason));
1
+ import { defineComponent as R, ref as $, watch as _, onMounted as ae, computed as B, onUnmounted as ve, openBlock as i, createElementBlock as r, createElementVNode as e, normalizeClass as ne, createCommentVNode as k, toDisplayString as L, Fragment as D, renderList as Z, renderSlot as q, normalizeProps as oe, guardReactiveProps as me, createVNode as z, mergeProps as le, unref as fe, withDirectives as ge, createBlock as I, vShow as pe, withModifiers as he, resolveDynamicComponent as se, withCtx as ie } from "vue";
2
+ const X = async (a) => await new Promise((d) => setTimeout(d, a)), ye = (a, d) => {
3
+ const o = (l) => l instanceof Error ? l : new Error("Aborted");
4
+ return new Promise((l, p) => {
5
+ if (d.aborted) {
6
+ p(o(d.reason));
7
7
  return;
8
8
  }
9
9
  const g = () => {
10
- clearTimeout(n), p(a(c.reason));
11
- }, n = setTimeout(() => {
12
- c.removeEventListener("abort", g), o();
13
- }, t);
14
- c.addEventListener("abort", g, { once: !0 });
10
+ clearTimeout(t), p(o(d.reason));
11
+ }, t = setTimeout(() => {
12
+ d.removeEventListener("abort", g), l();
13
+ }, a);
14
+ d.addEventListener("abort", g, { once: !0 });
15
15
  });
16
- }, fe = { class: "items-center justify-center w-full" }, ge = {
16
+ }, xe = { class: "items-center justify-center w-full" }, be = {
17
17
  key: 0,
18
18
  class: "group relative"
19
- }, pe = ["src"], ye = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, he = {
19
+ }, ke = ["src"], we = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, Se = {
20
20
  key: 0,
21
21
  class: "w-8 h-8 text-white ml-1",
22
22
  fill: "currentColor",
23
23
  viewBox: "0 0 24 24"
24
- }, xe = {
24
+ }, $e = {
25
25
  key: 1,
26
26
  class: "w-8 h-8 text-white",
27
27
  fill: "currentColor",
28
28
  viewBox: "0 0 24 24"
29
- }, be = {
29
+ }, Le = {
30
30
  key: 1,
31
31
  class: "group relative inline-block"
32
- }, ke = ["src"], we = ["src"], Se = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, $e = {
32
+ }, Pe = ["src", "controls"], Ce = ["src"], Ee = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, Be = {
33
33
  key: 0,
34
34
  class: "w-8 h-8 text-white ml-1",
35
35
  fill: "currentColor",
36
36
  viewBox: "0 0 24 24"
37
- }, Le = {
37
+ }, Te = {
38
38
  key: 1,
39
39
  class: "w-8 h-8 text-white",
40
40
  fill: "currentColor",
41
41
  viewBox: "0 0 24 24"
42
- }, Pe = {
42
+ }, Me = {
43
43
  key: 2,
44
44
  class: "group relative inline-block"
45
- }, Ce = ["src"], Ee = ["src"], Be = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, Te = {
45
+ }, _e = ["src"], Ve = ["src"], Ae = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, je = {
46
46
  key: 0,
47
47
  class: "w-8 h-8 text-white ml-1",
48
48
  fill: "currentColor",
49
49
  viewBox: "0 0 24 24"
50
- }, _e = {
50
+ }, Ue = {
51
51
  key: 1,
52
52
  class: "w-8 h-8 text-white",
53
53
  fill: "currentColor",
54
54
  viewBox: "0 0 24 24"
55
- }, Ve = {
55
+ }, De = {
56
56
  key: 3,
57
57
  class: "group relative inline-block"
58
- }, Me = ["src"], je = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, Ae = {
58
+ }, Re = ["src"], ze = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, Ne = {
59
59
  key: 0,
60
60
  class: "w-8 h-8 text-white ml-1",
61
61
  fill: "currentColor",
62
62
  viewBox: "0 0 24 24"
63
- }, Ue = {
63
+ }, We = {
64
64
  key: 1,
65
65
  class: "w-8 h-8 text-white",
66
66
  fill: "currentColor",
67
67
  viewBox: "0 0 24 24"
68
- }, Re = { key: 4 }, ze = {
68
+ }, He = { key: 4 }, Fe = {
69
69
  key: 5,
70
70
  class: "mt-4 px-6 py-4 text-left"
71
- }, De = { class: "text-lg leading-relaxed font-sans text-gray-800" }, Ne = {
71
+ }, Ge = { class: "text-lg leading-relaxed font-sans text-gray-800" }, Oe = {
72
72
  key: 0,
73
73
  class: "text-base leading-relaxed font-sans text-gray-400 mt-3 italic"
74
- }, We = "https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true", He = /* @__PURE__ */ z({
74
+ }, qe = "https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true", Je = /* @__PURE__ */ R({
75
75
  __name: "mulmo_player",
76
76
  props: {
77
77
  index: {},
78
- videoWithAudioSource: {},
79
- soundEffectSource: {},
80
- videoSource: {},
81
- imageSource: {},
82
- audioSource: {},
83
- text: {},
84
- originalText: {},
85
- duration: {},
86
- defaultLang: {},
87
- currentLang: {},
78
+ videoWithAudioSource: { default: void 0 },
79
+ soundEffectSource: { default: void 0 },
80
+ videoSource: { default: void 0 },
81
+ imageSource: { default: void 0 },
82
+ audioSource: { default: void 0 },
83
+ text: { default: void 0 },
84
+ originalText: { default: void 0 },
85
+ duration: { default: void 0 },
86
+ defaultLang: { default: void 0 },
87
+ currentLang: { default: void 0 },
88
88
  playbackSpeed: { default: 1 }
89
89
  },
90
90
  emits: ["play", "pause", "ended"],
91
- setup(t, { expose: c, emit: a }) {
92
- const o = t, p = a, g = $(), n = $(), d = $(), l = $(), f = () => {
93
- if (n.value) {
94
- if (o.soundEffectSource) {
95
- n.value.volume = 1;
91
+ setup(a, { expose: d, emit: o }) {
92
+ const l = a, p = o, g = $(), t = $(), u = $(), n = $(), f = $(!1), h = () => {
93
+ t.value && u.value && !isNaN(t.value.duration) && !isNaN(u.value.duration) && (f.value = u.value.duration > t.value.duration + 1);
94
+ }, v = () => {
95
+ if (t.value) {
96
+ if (l.soundEffectSource) {
97
+ t.value.volume = 1;
96
98
  return;
97
99
  }
98
- o.videoSource && (o.audioSource && o.currentLang && o.defaultLang && o.currentLang !== o.defaultLang ? n.value.volume = 0.2 : n.value.volume = 0);
100
+ l.videoSource && (l.audioSource && l.currentLang && l.defaultLang && l.currentLang !== l.defaultLang ? t.value.volume = 0.2 : t.value.volume = 0);
99
101
  }
100
- }, m = () => {
101
- const x = o.playbackSpeed ?? 1;
102
- g.value && (g.value.playbackRate = x), n.value && (n.value.playbackRate = x), d.value && (d.value.playbackRate = x), l.value && (l.value.playbackRate = x);
102
+ }, x = () => {
103
+ const y = l.playbackSpeed ?? 1;
104
+ g.value && (g.value.playbackRate = y), t.value && (t.value.playbackRate = y), u.value && (u.value.playbackRate = y), n.value && (n.value.playbackRate = y);
103
105
  };
104
- j([() => o.currentLang, () => o.defaultLang, () => o.videoSource, () => o.audioSource], () => {
105
- f();
106
- }), j(
107
- () => o.playbackSpeed,
106
+ _([() => l.currentLang, () => l.defaultLang, () => l.videoSource, () => l.audioSource], () => {
107
+ v();
108
+ }), _(
109
+ () => l.playbackSpeed,
108
110
  () => {
109
- m();
111
+ x();
110
112
  }
111
- ), j(n, (x) => {
112
- x && (f(), m());
113
- }), j([g, d, l], () => {
114
- m();
115
- }), ee(() => {
116
- f(), m();
113
+ ), _(t, (y) => {
114
+ y && (v(), x());
115
+ }), _([g, u, n], () => {
116
+ x();
117
+ }), ae(() => {
118
+ v(), x();
117
119
  });
118
- const r = $(!1), w = $(!1), L = E(() => y.value || w.value);
119
- let b = null;
120
- const A = () => {
121
- b && (b.abort(), b = null);
122
- }, P = () => {
123
- y.value = !0, d.value && n.value && !d.value.ended && (d.value.currentTime = n.value.currentTime, d.value.play().catch(() => {
120
+ const C = $(!1), b = $(!1), P = B(() => m.value || b.value);
121
+ let w = null;
122
+ const V = () => {
123
+ w && (w.abort(), w = null);
124
+ }, W = () => {
125
+ m.value = !0, u.value && t.value && !u.value.ended && (u.value.currentTime = t.value.currentTime, u.value.play().catch(() => {
124
126
  })), p("play");
125
- }, H = (x) => {
126
- w.value || (document.hidden || (y.value = !1), !n.value?.ended && d?.value && d.value?.pause(), B(x));
127
+ }, J = (y) => {
128
+ b.value || t.value?.ended && u.value && !u.value.ended || (document.hidden || (m.value = !1), !t.value?.ended && u?.value && u.value?.pause(), j(y));
129
+ }, H = () => {
130
+ if (C.value) return;
131
+ (!u.value || u.value.ended) && U();
132
+ }, A = () => {
133
+ if (C.value) return;
134
+ (!t.value || t.value.ended) && U();
127
135
  }, F = () => {
128
- if (r.value) return;
129
- (!d.value || d.value.ended) && V();
130
- }, q = () => {
131
- if (r.value) return;
132
- (!n.value || n.value.ended) && V();
133
- }, D = () => {
134
- y.value = !0, p("play");
135
- }, B = (x) => {
136
- if (w.value) return;
137
- document.hidden || (y.value = !1);
138
- const v = x.target;
139
- v.duration !== v.currentTime && p("pause");
140
- }, V = () => {
141
- r.value || (r.value = !0, y.value = !1, p("ended"));
136
+ if (!t.value || !u.value) return;
137
+ const y = Math.min(u.value.currentTime, t.value.duration);
138
+ Math.abs(t.value.currentTime - y) > 0.5 && (t.value.currentTime = y);
139
+ }, K = () => {
140
+ m.value = !0, t.value && !t.value.ended && t.value.play().catch(() => {
141
+ }), p("play");
142
+ }, E = () => {
143
+ b.value || u.value?.ended || (document.hidden || (m.value = !1), t.value && !t.value.ended && t.value.pause(), p("pause"));
144
+ }, G = () => {
145
+ m.value = !0, p("play");
146
+ }, j = (y) => {
147
+ if (b.value) return;
148
+ document.hidden || (m.value = !1);
149
+ const c = y.target;
150
+ c.duration !== c.currentTime && p("pause");
142
151
  }, U = () => {
143
- g.value?.pause(), n.value?.pause(), l.value?.pause();
144
- }, y = $(!1);
145
- let C = null;
146
- const T = async () => {
147
- if (w.value = !1, r.value = !1, y.value = !0, g.value && (m(), g.value.play().catch(() => {
148
- })), n.value && (f(), m(), n.value.play().catch(() => {
149
- }), d.value && (d.value.currentTime = n.value.currentTime, d.value.play().catch(() => {
150
- }))), l.value && (m(), l.value.play().catch(() => {
151
- })), !g.value && !n.value && !l.value)
152
+ C.value || (C.value = !0, m.value = !1, p("ended"));
153
+ }, s = () => {
154
+ g.value?.pause(), t.value?.pause(), u.value?.pause(), n.value?.pause();
155
+ }, m = $(!1);
156
+ let S = null;
157
+ const M = async () => {
158
+ if (b.value = !1, C.value = !1, m.value = !0, g.value && (x(), g.value.play().catch(() => {
159
+ })), t.value && (v(), x(), t.value.play().catch(() => {
160
+ }), u.value && (u.value.currentTime = t.value.currentTime, u.value.play().catch(() => {
161
+ }))), n.value && (x(), n.value.play().catch(() => {
162
+ })), !g.value && !t.value && !n.value)
152
163
  try {
153
- A(), b = new AbortController(), await me((o.duration ?? 0) * 1e3, b.signal), b = null, r.value || (y.value = !1, r.value = !0, p("ended"));
164
+ V(), w = new AbortController(), await ye((l.duration ?? 0) * 1e3, w.signal), w = null, C.value || (m.value = !1, C.value = !0, p("ended"));
154
165
  } catch {
155
166
  }
156
- }, J = () => {
157
- w.value = !0, y.value = !1, r.value = !0, A(), g.value?.pause(), n.value?.pause(), d.value?.pause(), l.value?.pause();
158
- }, s = () => {
159
- d.value && n.value && !d.value.ended && (d.value.currentTime = n.value.currentTime);
160
- }, h = (x) => {
161
- x?.paused && !x.ended && x.play().catch(() => {
167
+ }, re = () => {
168
+ b.value = !0, m.value = !1, C.value = !0, V(), g.value?.pause(), t.value?.pause(), u.value?.pause(), n.value?.pause();
169
+ }, de = () => {
170
+ !u.value || !t.value || u.value.ended || Math.abs(u.value.currentTime - t.value.currentTime) > 0.5 && (u.value.currentTime = t.value.currentTime);
171
+ }, O = (y) => {
172
+ y?.paused && !y.ended && y.play().catch(() => {
162
173
  });
163
- }, M = (x, v) => {
164
- v.paused && !v.ended && (x.ended || (v.currentTime = x.currentTime), v.play().catch(() => {
174
+ }, ce = (y, c) => {
175
+ c.paused && !c.ended && (y.ended || (c.currentTime = y.currentTime), c.play().catch(() => {
165
176
  }));
166
- }, G = () => {
167
- y.value && (h(g.value), n.value && d.value ? (h(n.value), M(n.value, d.value)) : h(n.value), h(l.value));
168
- }, I = () => {
169
- document.hidden && y.value ? C || (C = setInterval(G, 500)) : document.hidden || C && (clearInterval(C), C = null);
170
- }, _ = () => {
171
- document.hidden && y.value && setTimeout(G, 50);
177
+ }, ee = () => {
178
+ m.value && (O(g.value), t.value && u.value ? (O(t.value), ce(t.value, u.value)) : O(t.value), O(n.value));
179
+ }, te = () => {
180
+ document.hidden && m.value ? S || (S = setInterval(ee, 500)) : document.hidden || S && (clearInterval(S), S = null);
181
+ }, T = () => {
182
+ document.hidden && m.value && setTimeout(ee, 50);
172
183
  };
173
- return ee(() => {
174
- document.addEventListener("visibilitychange", I), g.value?.addEventListener("pause", _), n.value?.addEventListener("pause", _), l.value?.addEventListener("pause", _), d.value?.addEventListener("pause", _);
175
- }), se(() => {
176
- document.removeEventListener("visibilitychange", I), g.value?.removeEventListener("pause", _), n.value?.removeEventListener("pause", _), l.value?.removeEventListener("pause", _), d.value?.removeEventListener("pause", _), C && (clearInterval(C), C = null), A();
177
- }), c({
178
- play: T,
179
- stop: J
180
- }), (x, v) => (i(), u("div", fe, [
181
- t.videoWithAudioSource ? (i(), u("div", ge, [
184
+ return ae(() => {
185
+ document.addEventListener("visibilitychange", te), g.value?.addEventListener("pause", T), t.value?.addEventListener("pause", T), n.value?.addEventListener("pause", T), u.value?.addEventListener("pause", T);
186
+ }), ve(() => {
187
+ document.removeEventListener("visibilitychange", te), g.value?.removeEventListener("pause", T), t.value?.removeEventListener("pause", T), n.value?.removeEventListener("pause", T), u.value?.removeEventListener("pause", T), S && (clearInterval(S), S = null), V();
188
+ }), d({
189
+ play: M,
190
+ stop: re
191
+ }), (y, c) => (i(), r("div", xe, [
192
+ a.videoWithAudioSource ? (i(), r("div", be, [
182
193
  e("video", {
183
194
  ref_key: "videoWithAudioRef",
184
195
  ref: g,
185
- src: t.videoWithAudioSource,
196
+ src: a.videoWithAudioSource,
186
197
  class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
187
198
  controls: !0,
188
199
  playsinline: "true",
189
- onPlay: D,
190
- onPause: B,
191
- onEnded: V
192
- }, null, 40, pe),
193
- e("div", ye, [
200
+ onPlay: G,
201
+ onPause: j,
202
+ onEnded: U
203
+ }, null, 40, ke),
204
+ e("div", we, [
194
205
  e("button", {
195
206
  class: "pointer-events-auto w-16 h-16 bg-black/50 hover:bg-black/70 rounded-full flex items-center justify-center transition-colors cursor-pointer",
196
- onClick: v[0] || (v[0] = (K) => L.value ? U() : T())
207
+ onClick: c[0] || (c[0] = (Q) => P.value ? s() : M())
197
208
  }, [
198
- L.value ? (i(), u("svg", xe, [...v[5] || (v[5] = [
209
+ P.value ? (i(), r("svg", $e, [...c[5] || (c[5] = [
199
210
  e("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }, null, -1)
200
- ])])) : (i(), u("svg", he, [...v[4] || (v[4] = [
211
+ ])])) : (i(), r("svg", Se, [...c[4] || (c[4] = [
201
212
  e("path", { d: "M8 5v14l11-7z" }, null, -1)
202
213
  ])]))
203
214
  ])
204
215
  ])
205
- ])) : t.soundEffectSource || t.videoSource ? (i(), u("div", be, [
216
+ ])) : a.soundEffectSource || a.videoSource ? (i(), r("div", Le, [
206
217
  e("video", {
207
218
  ref_key: "videoRef",
208
- ref: n,
219
+ ref: t,
209
220
  class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
210
- src: t.soundEffectSource || t.videoSource,
211
- controls: !0,
221
+ src: a.soundEffectSource || a.videoSource,
222
+ controls: !f.value,
212
223
  playsinline: "true",
213
- onPlay: P,
214
- onPause: H,
215
- onEnded: F,
216
- onSeeked: s
217
- }, null, 40, ke),
218
- t.audioSource ? (i(), u("audio", {
224
+ onPlay: W,
225
+ onPause: J,
226
+ onEnded: H,
227
+ onSeeked: de,
228
+ onLoadedmetadata: h
229
+ }, null, 40, Pe),
230
+ a.audioSource ? (i(), r("audio", {
219
231
  key: 0,
220
232
  ref_key: "audioSyncRef",
221
- ref: d,
222
- src: t.audioSource,
233
+ ref: u,
234
+ src: a.audioSource,
223
235
  controls: !0,
224
- class: "hidden",
225
- onEnded: q
226
- }, null, 40, we)) : k("", !0),
227
- e("div", Se, [
236
+ class: ne(f.value ? "mulmocast-audio absolute bottom-0 left-0 w-full" : "hidden"),
237
+ onEnded: A,
238
+ onSeeked: F,
239
+ onPlay: K,
240
+ onPause: E,
241
+ onLoadedmetadata: h
242
+ }, null, 42, Ce)) : k("", !0),
243
+ e("div", Ee, [
228
244
  e("button", {
229
245
  class: "pointer-events-auto w-16 h-16 bg-black/50 hover:bg-black/70 rounded-full flex items-center justify-center transition-colors cursor-pointer",
230
- onClick: v[1] || (v[1] = (K) => L.value ? U() : T())
246
+ onClick: c[1] || (c[1] = (Q) => P.value ? s() : M())
231
247
  }, [
232
- L.value ? (i(), u("svg", Le, [...v[7] || (v[7] = [
248
+ P.value ? (i(), r("svg", Te, [...c[7] || (c[7] = [
233
249
  e("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }, null, -1)
234
- ])])) : (i(), u("svg", $e, [...v[6] || (v[6] = [
250
+ ])])) : (i(), r("svg", Be, [...c[6] || (c[6] = [
235
251
  e("path", { d: "M8 5v14l11-7z" }, null, -1)
236
252
  ])]))
237
253
  ])
238
254
  ])
239
- ])) : t.audioSource ? (i(), u("div", Pe, [
240
- t.imageSource ? (i(), u("img", {
255
+ ])) : a.audioSource ? (i(), r("div", Me, [
256
+ a.imageSource ? (i(), r("img", {
241
257
  key: 0,
242
- src: t.imageSource,
258
+ src: a.imageSource,
243
259
  class: "mx-auto h-auto max-h-[80vh] w-auto object-contain",
244
260
  alt: "Background"
245
- }, null, 8, Ce)) : (i(), u("img", {
261
+ }, null, 8, _e)) : (i(), r("img", {
246
262
  key: 1,
247
- src: We,
263
+ src: qe,
248
264
  class: "mx-auto h-auto max-h-[80vh] w-auto object-contain",
249
265
  alt: "Background"
250
266
  })),
251
267
  e("audio", {
252
268
  ref_key: "audioRef",
253
- ref: l,
269
+ ref: n,
254
270
  class: "mulmocast-audio absolute inset-0 w-full h-full",
255
- src: t.audioSource,
271
+ src: a.audioSource,
256
272
  controls: !0,
257
- onPlay: D,
258
- onPause: B,
259
- onEnded: V
260
- }, null, 40, Ee),
261
- e("div", Be, [
273
+ onPlay: G,
274
+ onPause: j,
275
+ onEnded: U
276
+ }, null, 40, Ve),
277
+ e("div", Ae, [
262
278
  e("button", {
263
279
  class: "pointer-events-auto w-16 h-16 bg-black/50 hover:bg-black/70 rounded-full flex items-center justify-center transition-colors cursor-pointer",
264
- onClick: v[2] || (v[2] = (K) => L.value ? U() : T())
280
+ onClick: c[2] || (c[2] = (Q) => P.value ? s() : M())
265
281
  }, [
266
- L.value ? (i(), u("svg", _e, [...v[9] || (v[9] = [
282
+ P.value ? (i(), r("svg", Ue, [...c[9] || (c[9] = [
267
283
  e("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }, null, -1)
268
- ])])) : (i(), u("svg", Te, [...v[8] || (v[8] = [
284
+ ])])) : (i(), r("svg", je, [...c[8] || (c[8] = [
269
285
  e("path", { d: "M8 5v14l11-7z" }, null, -1)
270
286
  ])]))
271
287
  ])
272
288
  ])
273
- ])) : t.imageSource ? (i(), u("div", Ve, [
289
+ ])) : a.imageSource ? (i(), r("div", De, [
274
290
  e("img", {
275
- src: t.imageSource,
291
+ src: a.imageSource,
276
292
  class: "max-w-full max-h-full object-contain"
277
- }, null, 8, Me),
278
- e("div", je, [
293
+ }, null, 8, Re),
294
+ e("div", ze, [
279
295
  e("button", {
280
296
  class: "pointer-events-auto w-16 h-16 bg-black/50 hover:bg-black/70 rounded-full flex items-center justify-center transition-colors cursor-pointer",
281
- onClick: v[3] || (v[3] = (K) => L.value ? U() : T())
297
+ onClick: c[3] || (c[3] = (Q) => P.value ? s() : M())
282
298
  }, [
283
- L.value ? (i(), u("svg", Ue, [...v[11] || (v[11] = [
299
+ P.value ? (i(), r("svg", We, [...c[11] || (c[11] = [
284
300
  e("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }, null, -1)
285
- ])])) : (i(), u("svg", Ae, [...v[10] || (v[10] = [
301
+ ])])) : (i(), r("svg", Ne, [...c[10] || (c[10] = [
286
302
  e("path", { d: "M8 5v14l11-7z" }, null, -1)
287
303
  ])]))
288
304
  ])
289
305
  ])
290
- ])) : (i(), u("div", Re, "No media available")),
291
- t.text ? (i(), u("div", ze, [
292
- e("p", De, S(t.text), 1),
293
- t.originalText && t.originalText !== t.text ? (i(), u("p", Ne, S(t.originalText), 1)) : k("", !0)
306
+ ])) : (i(), r("div", He, "No media available")),
307
+ a.text ? (i(), r("div", Fe, [
308
+ e("p", Ge, L(a.text), 1),
309
+ a.originalText && a.originalText !== a.text ? (i(), r("p", Oe, L(a.originalText), 1)) : k("", !0)
294
310
  ])) : k("", !0)
295
311
  ]));
296
312
  }
297
- }), ne = (t, c) => {
298
- const a = t.__vccOpts || t;
299
- for (const [o, p] of c)
300
- a[o] = p;
301
- return a;
302
- }, X = /* @__PURE__ */ ne(He, [["__scopeId", "data-v-cbee8ea0"]]), Fe = ["value"], Ge = ["value"], W = /* @__PURE__ */ z({
313
+ }), ue = (a, d) => {
314
+ const o = a.__vccOpts || a;
315
+ for (const [l, p] of d)
316
+ o[l] = p;
317
+ return o;
318
+ }, Y = /* @__PURE__ */ ue(Je, [["__scopeId", "data-v-843621f0"]]), Ke = ["value"], Qe = ["value"], N = /* @__PURE__ */ R({
303
319
  __name: "select_language",
304
320
  props: {
305
321
  modelValue: {}
306
322
  },
307
323
  emits: ["update:modelValue"],
308
- setup(t, { emit: c }) {
309
- const a = ["en", "ja"], o = {
324
+ setup(a, { emit: d }) {
325
+ const o = ["en", "ja"], l = {
310
326
  en: "English",
311
327
  ja: "日本語"
312
- }, p = c, g = (n) => {
313
- const d = n.target;
314
- p("update:modelValue", d.value);
328
+ }, p = d, g = (t) => {
329
+ const u = t.target;
330
+ p("update:modelValue", u.value);
315
331
  };
316
- return (n, d) => (i(), u("select", {
317
- value: t.modelValue,
332
+ return (t, u) => (i(), r("select", {
333
+ value: a.modelValue,
318
334
  class: "px-4 py-2 bg-white border-2 border-gray-300 rounded-lg shadow-sm hover:border-indigo-400 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 focus:outline-none transition-colors cursor-pointer text-base font-medium text-gray-700",
319
335
  onChange: g
320
336
  }, [
321
- (i(), u(R, null, Y(a, (l) => e("option", {
322
- key: l,
323
- value: l
324
- }, S(o[l] || l), 9, Ge)), 64))
325
- ], 40, Fe));
337
+ (i(), r(D, null, Z(o, (n) => e("option", {
338
+ key: n,
339
+ value: n
340
+ }, L(l[n] || n), 9, Qe)), 64))
341
+ ], 40, Ke));
326
342
  }
327
- }), Oe = { class: "w-full overflow-hidden" }, qe = { class: "max-w-7xl mx-auto px-4" }, Je = { class: "grid grid-cols-[auto,1fr,auto] gap-x-4 gap-y-4 max-sm:grid-cols-2" }, Ke = ["disabled"], Qe = { class: "col-start-2 row-start-1 min-w-0 max-sm:col-span-2 max-sm:col-start-1" }, Xe = ["disabled"], Ye = {
343
+ }), Xe = { class: "w-full overflow-hidden" }, Ye = { class: "max-w-7xl mx-auto px-4" }, Ze = { class: "grid grid-cols-[auto,1fr,auto] gap-x-4 gap-y-4 max-sm:grid-cols-2" }, Ie = ["disabled"], et = { class: "col-start-2 row-start-1 min-w-0 max-sm:col-span-2 max-sm:col-start-1" }, tt = ["disabled"], at = {
328
344
  key: 0,
329
345
  class: "mulmo-text-box col-start-2 row-start-2 min-w-0 mt-1 rounded-lg px-6 py-4 text-left max-sm:col-span-2 max-sm:col-start-1 max-sm:row-start-3"
330
- }, Ze = { class: "mulmo-text-primary text-lg leading-relaxed font-sans" }, Ie = {
346
+ }, ot = { class: "mulmo-text-primary text-lg leading-relaxed font-sans" }, lt = {
331
347
  key: 0,
332
348
  class: "mulmo-text-secondary text-base leading-relaxed font-sans mt-3 italic"
333
- }, et = ["src"], tt = /* @__PURE__ */ z({
349
+ }, nt = ["src"], st = /* @__PURE__ */ R({
334
350
  __name: "mulmo_viewer",
335
351
  props: {
336
- dataSet: {},
352
+ dataSet: { default: void 0 },
337
353
  basePath: {},
338
- initPage: {},
354
+ initPage: { default: void 0 },
339
355
  audioLang: { default: "en" },
340
356
  textLang: { default: "en" },
341
357
  playbackSpeed: { default: 1 }
342
358
  },
343
359
  emits: ["updatedPage", "update:audioLang", "update:textLang", "allCompleted"],
344
- setup(t, { expose: c, emit: a }) {
345
- const o = t, p = a, g = o.dataSet?.beats?.length ?? 0, n = $(o.initPage ?? 0), d = $(!0), l = $(), f = $(), m = E({
346
- get: () => o.audioLang,
360
+ setup(a, { expose: d, emit: o }) {
361
+ const l = a, p = o, g = l.dataSet?.beats?.length ?? 0, t = $(l.initPage ?? 0), u = $(!0), n = $(), f = $(), h = B({
362
+ get: () => l.audioLang,
347
363
  set: (s) => p("update:audioLang", s || "en")
348
- }), r = E({
349
- get: () => o.textLang,
364
+ }), v = B({
365
+ get: () => l.textLang,
350
366
  set: (s) => p("update:textLang", s || "en")
351
367
  });
352
- let w = 0;
353
- j(
354
- () => o.audioLang,
355
- async (s, h) => {
356
- if (s !== h && P.value) {
357
- w++;
358
- const M = w;
359
- if (l.value?.stop(), await Q(500), M !== w) return;
360
- l.value && (P.value = !0, await l.value.play());
368
+ let x = 0;
369
+ _(
370
+ () => l.audioLang,
371
+ async (s, m) => {
372
+ if (s !== m && w.value) {
373
+ x++;
374
+ const S = x;
375
+ if (n.value?.stop(), await X(500), S !== x) return;
376
+ n.value && (w.value = !0, await n.value.play());
361
377
  }
362
378
  }
363
- ), j(
364
- () => o.textLang,
365
- async (s, h) => {
366
- s !== h && P.value && (await Q(100), l.value && await l.value.play());
379
+ ), _(
380
+ () => l.textLang,
381
+ async (s, m) => {
382
+ s !== m && w.value && (await X(100), n.value && await n.value.play());
367
383
  }
368
- ), j(f, (s) => {
384
+ ), _(f, (s) => {
369
385
  s && (s.volume = 0.3);
370
386
  });
371
- const L = E(() => o.dataSet?.beats[n.value]), b = (s) => s ? o.basePath + "/" + s : "", A = E(() => b(o.dataSet?.bgmSource)), P = $(!1), H = () => {
372
- P.value = !0, f.value && (f.value.volume = 0.3, f.value.play());
387
+ const C = B(() => l.dataSet?.beats[t.value]), b = (s) => s ? l.basePath + "/" + s : "", P = B(() => b(l.dataSet?.bgmSource)), w = $(!1), V = () => {
388
+ w.value = !0, f.value && (f.value.volume = 0.3, f.value.play());
389
+ }, W = () => {
390
+ w.value = !1, f.value && f.value.pause();
391
+ }, J = async () => {
392
+ x++;
393
+ const s = x;
394
+ n.value?.stop(), await X(500), s === x && n.value && n.value.play();
395
+ }, H = (s) => {
396
+ t.value !== s && (t.value = s, w.value && u.value && J());
397
+ }, A = (s) => {
398
+ const m = t.value + s;
399
+ return m > -1 && m < g ? (H(m), p("updatedPage", m), !0) : !1;
373
400
  }, F = () => {
374
- P.value = !1, f.value && f.value.pause();
375
- }, q = async () => {
376
- w++;
377
- const s = w;
378
- l.value?.stop(), await Q(500), s === w && l.value && l.value.play();
379
- }, D = (s) => {
380
- n.value !== s && (n.value = s, P.value && d.value && q());
381
- }, B = (s) => {
382
- const h = n.value + s;
383
- return h > -1 && h < g ? (D(h), p("updatedPage", h), !0) : !1;
384
- }, V = () => {
385
- d.value && B(1) || (P.value = !1, f.value && f.value.pause(), p("allCompleted"));
386
- }, U = {
387
- onPlay: H,
388
- onPause: F,
389
- onEnded: V
390
- }, y = E(() => {
391
- const s = L.value, h = s?.audioSources?.[m.value], M = s?.multiLinguals?.[r.value] ?? s?.text ?? "", G = o.dataSet?.lang ? s?.multiLinguals?.[o.dataSet.lang] ?? s?.text ?? "" : "";
401
+ u.value && A(1) || (w.value = !1, f.value && f.value.pause(), p("allCompleted"));
402
+ }, K = {
403
+ onPlay: V,
404
+ onPause: W,
405
+ onEnded: F
406
+ }, E = B(() => {
407
+ const s = C.value, m = s?.audioSources?.[h.value], S = s?.multiLinguals?.[v.value] ?? s?.text ?? "", M = l.dataSet?.lang ? s?.multiLinguals?.[l.dataSet.lang] ?? s?.text ?? "" : "";
392
408
  return {
393
409
  videoWithAudioSource: b(s?.videoWithAudioSource),
394
410
  videoSource: b(s?.videoSource),
395
411
  soundEffectSource: b(s?.soundEffectSource),
396
- audioSource: b(h),
412
+ audioSource: b(m),
397
413
  imageSource: b(s?.imageSource),
398
- index: n.value,
399
- text: M,
400
- originalText: G,
414
+ index: t.value,
415
+ text: S,
416
+ originalText: M,
401
417
  duration: s?.duration,
402
- defaultLang: o.dataSet?.lang,
403
- currentLang: m.value,
404
- playbackSpeed: o.playbackSpeed,
405
- ...U
418
+ defaultLang: l.dataSet?.lang,
419
+ currentLang: h.value,
420
+ playbackSpeed: l.playbackSpeed,
421
+ ...K
406
422
  };
407
- }), C = E(() => o.dataSet?.beats[n.value + 1]), T = E(() => {
408
- if (n.value + 1 >= g) return null;
409
- const s = C.value;
423
+ }), G = B(() => l.dataSet?.beats[t.value + 1]), j = B(() => {
424
+ if (t.value + 1 >= g) return null;
425
+ const s = G.value;
410
426
  return {
411
427
  videoWithAudioSource: b(s?.videoWithAudioSource),
412
428
  videoSource: b(s?.videoSource),
413
429
  soundEffectSource: b(s?.soundEffectSource),
414
- audioSource: b(s?.audioSources?.[m.value]),
430
+ audioSource: b(s?.audioSources?.[h.value]),
415
431
  imageSource: b(s?.imageSource),
416
- index: n.value + 1,
417
- text: s?.multiLinguals?.[r.value] ?? s?.text ?? "",
432
+ index: t.value + 1,
433
+ text: s?.multiLinguals?.[v.value] ?? s?.text ?? "",
418
434
  duration: s?.duration
419
435
  };
420
- }), J = E(() => ({
421
- MulmoPlayer: X,
422
- pageProps: y.value,
423
- currentPage: n.value,
436
+ }), U = B(() => ({
437
+ MulmoPlayer: Y,
438
+ pageProps: E.value,
439
+ currentPage: t.value,
424
440
  pageCount: g,
425
- pageMove: B,
426
- isPlaying: P.value,
427
- audioLang: m,
428
- textLang: r,
429
- SelectLanguage: W,
430
- mediaPlayerRef: l,
441
+ pageMove: A,
442
+ isPlaying: w.value,
443
+ audioLang: h,
444
+ textLang: v,
445
+ SelectLanguage: N,
446
+ mediaPlayerRef: n,
431
447
  // Event handlers for direct access
432
- handlePlay: H,
433
- handlePause: F,
434
- handleEnded: V
448
+ handlePlay: V,
449
+ handlePause: W,
450
+ handleEnded: F
435
451
  }));
436
- return c({
437
- updatePage: D
438
- }), (s, h) => (i(), u(R, null, [
439
- O(s.$slots, "default", te(ie(J.value)), () => [
440
- e("div", Oe, [
441
- e("div", qe, [
442
- e("div", Je, [
452
+ return d({
453
+ updatePage: H
454
+ }), (s, m) => (i(), r(D, null, [
455
+ q(s.$slots, "default", oe(me(U.value)), () => [
456
+ e("div", Xe, [
457
+ e("div", Ye, [
458
+ e("div", Ze, [
443
459
  e("button", {
444
460
  class: "col-start-1 row-start-1 justify-self-start w-auto px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50 self-center max-sm:row-start-2",
445
- disabled: n.value === 0,
446
- onClick: h[0] || (h[0] = (M) => B(-1))
447
- }, " Prev ", 8, Ke),
448
- e("div", Qe, [
449
- N(X, ae({
461
+ disabled: t.value === 0,
462
+ onClick: m[0] || (m[0] = (S) => A(-1))
463
+ }, " Prev ", 8, Ie),
464
+ e("div", et, [
465
+ z(Y, le({
450
466
  ref_key: "mediaPlayer",
451
- ref: l
452
- }, { ...y.value, text: "", originalText: "" }), null, 16)
467
+ ref: n
468
+ }, { ...E.value, text: "", originalText: "" }), null, 16)
453
469
  ]),
454
470
  e("button", {
455
471
  class: "col-start-3 row-start-1 justify-self-end w-auto px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50 self-center max-sm:col-start-2 max-sm:row-start-2",
456
- disabled: n.value >= ue(g) - 1,
457
- onClick: h[1] || (h[1] = (M) => B(1))
458
- }, " Next ", 8, Xe),
459
- y.value.text ? (i(), u("div", Ye, [
460
- e("p", Ze, S(y.value.text), 1),
461
- y.value.originalText && y.value.originalText !== y.value.text ? (i(), u("p", Ie, S(y.value.originalText), 1)) : k("", !0)
472
+ disabled: t.value >= fe(g) - 1,
473
+ onClick: m[1] || (m[1] = (S) => A(1))
474
+ }, " Next ", 8, tt),
475
+ E.value.text ? (i(), r("div", at, [
476
+ e("p", ot, L(E.value.text), 1),
477
+ E.value.originalText && E.value.originalText !== E.value.text ? (i(), r("p", lt, L(E.value.originalText), 1)) : k("", !0)
462
478
  ])) : k("", !0)
463
479
  ])
464
480
  ])
465
481
  ])
466
482
  ], !0),
467
- T.value ? re((i(), Z(X, te(ae({ key: 0 }, T.value)), null, 16)), [
468
- [de, !1]
483
+ j.value ? ge((i(), I(Y, oe(le({ key: 0 }, j.value)), null, 16)), [
484
+ [pe, !1]
469
485
  ]) : k("", !0),
470
- A.value ? (i(), u("audio", {
486
+ P.value ? (i(), r("audio", {
471
487
  key: 1,
472
488
  ref_key: "bgmRef",
473
489
  ref: f,
474
- src: A.value
475
- }, null, 8, et)) : k("", !0)
490
+ src: P.value
491
+ }, null, 8, nt)) : k("", !0)
476
492
  ], 64));
477
493
  }
478
- }), Mt = /* @__PURE__ */ ne(tt, [["__scopeId", "data-v-889afa79"]]), at = { class: "container mx-auto px-4 py-2 sm:py-4" }, ot = { class: "flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2 sm:gap-4" }, lt = { class: "flex items-center gap-4 flex-wrap" }, nt = { class: "flex items-center gap-2 sm:gap-4 flex-wrap w-full sm:w-auto" }, st = {
494
+ }), Rt = /* @__PURE__ */ ue(st, [["__scopeId", "data-v-fdffe885"]]), it = { class: "container mx-auto px-4 py-2 sm:py-4" }, ut = { class: "flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2 sm:gap-4" }, rt = { class: "flex items-center gap-4 flex-wrap" }, dt = { class: "flex items-center gap-2 sm:gap-4 flex-wrap w-full sm:w-auto" }, ct = {
479
495
  key: 0,
480
496
  class: "hidden sm:flex items-center gap-3"
481
- }, it = ["value"], ut = {
497
+ }, vt = ["value"], mt = {
482
498
  key: 1,
483
499
  class: "hidden sm:flex items-center gap-3"
484
- }, rt = { class: "hidden sm:flex items-center gap-3" }, dt = { class: "flex items-center justify-between mb-4" }, ct = {
500
+ }, ft = { class: "hidden sm:flex items-center gap-3" }, gt = { class: "flex items-center justify-between mb-4" }, pt = {
485
501
  key: 0,
486
502
  class: "space-y-2"
487
- }, vt = ["value"], mt = {
503
+ }, ht = ["value"], yt = {
488
504
  key: 1,
489
505
  class: "space-y-2"
490
- }, ft = { class: "space-y-2" }, jt = /* @__PURE__ */ z({
506
+ }, xt = { class: "space-y-2" }, zt = /* @__PURE__ */ R({
491
507
  __name: "mulmo_viewer_header",
492
508
  props: {
493
509
  audioLang: {},
@@ -500,147 +516,147 @@ const Q = async (t) => await new Promise((c) => setTimeout(c, t)), me = (t, c) =
500
516
  sticky: { type: Boolean, default: !1 }
501
517
  },
502
518
  emits: ["update:audioLang", "update:textLang", "update:playbackSpeed", "update:showMobileSettings"],
503
- setup(t) {
504
- return (c, a) => (i(), u(R, null, [
519
+ setup(a) {
520
+ return (d, o) => (i(), r(D, null, [
505
521
  e("div", {
506
- class: ce(["bg-white shadow-md border-b border-gray-200", { "sticky top-0 z-50": t.sticky }])
522
+ class: ne(["bg-white shadow-md border-b border-gray-200", { "sticky top-0 z-50": a.sticky }])
507
523
  }, [
508
- e("div", at, [
509
- e("div", ot, [
510
- e("div", lt, [
511
- O(c.$slots, "left")
524
+ e("div", it, [
525
+ e("div", ut, [
526
+ e("div", rt, [
527
+ q(d.$slots, "left")
512
528
  ]),
513
- e("div", nt, [
514
- O(c.$slots, "actions"),
515
- t.hideDesktopControls ? k("", !0) : (i(), u(R, { key: 0 }, [
516
- t.showSpeedControl ? (i(), u("div", st, [
517
- a[11] || (a[11] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Speed:", -1)),
529
+ e("div", dt, [
530
+ q(d.$slots, "actions"),
531
+ a.hideDesktopControls ? k("", !0) : (i(), r(D, { key: 0 }, [
532
+ a.showSpeedControl ? (i(), r("div", ct, [
533
+ o[11] || (o[11] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Speed:", -1)),
518
534
  e("select", {
519
- value: t.playbackSpeed,
535
+ value: a.playbackSpeed,
520
536
  class: "px-3 py-2 border border-gray-300 rounded-lg bg-white text-gray-700 font-medium shadow-sm hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition-colors",
521
- onChange: a[0] || (a[0] = (o) => c.$emit("update:playbackSpeed", Number(o.target.value)))
522
- }, [...a[10] || (a[10] = [
537
+ onChange: o[0] || (o[0] = (l) => d.$emit("update:playbackSpeed", Number(l.target.value)))
538
+ }, [...o[10] || (o[10] = [
523
539
  e("option", { value: 1 }, "1x", -1),
524
540
  e("option", { value: 1.25 }, "1.25x", -1),
525
541
  e("option", { value: 1.5 }, "1.5x", -1),
526
542
  e("option", { value: 1.75 }, "1.75x", -1),
527
543
  e("option", { value: 2 }, "2x", -1)
528
- ])], 40, it)
544
+ ])], 40, vt)
529
545
  ])) : k("", !0),
530
- t.showAudioLang ? (i(), u("div", ut, [
531
- a[12] || (a[12] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Audio:", -1)),
532
- N(W, {
533
- "model-value": t.audioLang,
534
- "onUpdate:modelValue": a[1] || (a[1] = (o) => c.$emit("update:audioLang", o))
546
+ a.showAudioLang ? (i(), r("div", mt, [
547
+ o[12] || (o[12] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Audio:", -1)),
548
+ z(N, {
549
+ "model-value": a.audioLang,
550
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => d.$emit("update:audioLang", l))
535
551
  }, null, 8, ["model-value"])
536
552
  ])) : k("", !0),
537
- e("div", rt, [
538
- a[13] || (a[13] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Text:", -1)),
539
- N(W, {
540
- "model-value": t.textLang,
541
- "onUpdate:modelValue": a[2] || (a[2] = (o) => c.$emit("update:textLang", o))
553
+ e("div", ft, [
554
+ o[13] || (o[13] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Text:", -1)),
555
+ z(N, {
556
+ "model-value": a.textLang,
557
+ "onUpdate:modelValue": o[2] || (o[2] = (l) => d.$emit("update:textLang", l))
542
558
  }, null, 8, ["model-value"])
543
559
  ])
544
560
  ], 64)),
545
- O(c.$slots, "mobile-actions")
561
+ q(d.$slots, "mobile-actions")
546
562
  ])
547
563
  ])
548
564
  ])
549
565
  ], 2),
550
- t.showMobileSettings ? (i(), u("div", {
566
+ a.showMobileSettings ? (i(), r("div", {
551
567
  key: 0,
552
568
  class: "fixed inset-0 bg-black bg-opacity-50 z-50 sm:hidden",
553
- onClick: a[9] || (a[9] = (o) => c.$emit("update:showMobileSettings", !1))
569
+ onClick: o[9] || (o[9] = (l) => d.$emit("update:showMobileSettings", !1))
554
570
  }, [
555
571
  e("div", {
556
572
  class: "absolute bottom-0 left-0 right-0 bg-white rounded-t-2xl shadow-xl p-6 space-y-4",
557
- onClick: a[8] || (a[8] = ve(() => {
573
+ onClick: o[8] || (o[8] = he(() => {
558
574
  }, ["stop"]))
559
575
  }, [
560
- e("div", dt, [
561
- a[14] || (a[14] = e("h2", { class: "text-xl font-bold text-gray-800" }, "Settings", -1)),
576
+ e("div", gt, [
577
+ o[14] || (o[14] = e("h2", { class: "text-xl font-bold text-gray-800" }, "Settings", -1)),
562
578
  e("button", {
563
579
  class: "text-gray-500 hover:text-gray-700 text-2xl",
564
- onClick: a[3] || (a[3] = (o) => c.$emit("update:showMobileSettings", !1))
580
+ onClick: o[3] || (o[3] = (l) => d.$emit("update:showMobileSettings", !1))
565
581
  }, " × ")
566
582
  ]),
567
- t.showSpeedControl ? (i(), u("div", ct, [
568
- a[16] || (a[16] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Playback Speed", -1)),
583
+ a.showSpeedControl ? (i(), r("div", pt, [
584
+ o[16] || (o[16] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Playback Speed", -1)),
569
585
  e("select", {
570
- value: t.playbackSpeed,
586
+ value: a.playbackSpeed,
571
587
  class: "w-full px-4 py-3 border border-gray-300 rounded-lg bg-white text-gray-700 font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",
572
- onChange: a[4] || (a[4] = (o) => c.$emit("update:playbackSpeed", Number(o.target.value)))
573
- }, [...a[15] || (a[15] = [
588
+ onChange: o[4] || (o[4] = (l) => d.$emit("update:playbackSpeed", Number(l.target.value)))
589
+ }, [...o[15] || (o[15] = [
574
590
  e("option", { value: 1 }, "1x (Normal)", -1),
575
591
  e("option", { value: 1.25 }, "1.25x", -1),
576
592
  e("option", { value: 1.5 }, "1.5x", -1),
577
593
  e("option", { value: 1.75 }, "1.75x", -1),
578
594
  e("option", { value: 2 }, "2x (Double)", -1)
579
- ])], 40, vt)
595
+ ])], 40, ht)
580
596
  ])) : k("", !0),
581
- t.showAudioLang ? (i(), u("div", mt, [
582
- a[17] || (a[17] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Audio Language", -1)),
583
- N(W, {
584
- "model-value": t.audioLang,
597
+ a.showAudioLang ? (i(), r("div", yt, [
598
+ o[17] || (o[17] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Audio Language", -1)),
599
+ z(N, {
600
+ "model-value": a.audioLang,
585
601
  class: "w-full",
586
- "onUpdate:modelValue": a[5] || (a[5] = (o) => c.$emit("update:audioLang", o))
602
+ "onUpdate:modelValue": o[5] || (o[5] = (l) => d.$emit("update:audioLang", l))
587
603
  }, null, 8, ["model-value"])
588
604
  ])) : k("", !0),
589
- e("div", ft, [
590
- a[18] || (a[18] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Text Language", -1)),
591
- N(W, {
592
- "model-value": t.textLang,
605
+ e("div", xt, [
606
+ o[18] || (o[18] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Text Language", -1)),
607
+ z(N, {
608
+ "model-value": a.textLang,
593
609
  class: "w-full",
594
- "onUpdate:modelValue": a[6] || (a[6] = (o) => c.$emit("update:textLang", o))
610
+ "onUpdate:modelValue": o[6] || (o[6] = (l) => d.$emit("update:textLang", l))
595
611
  }, null, 8, ["model-value"])
596
612
  ]),
597
613
  e("button", {
598
614
  class: "w-full px-4 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 font-medium shadow-sm transition-colors mt-4",
599
- onClick: a[7] || (a[7] = (o) => c.$emit("update:showMobileSettings", !1))
615
+ onClick: o[7] || (o[7] = (l) => d.$emit("update:showMobileSettings", !1))
600
616
  }, " Done ")
601
617
  ])
602
618
  ])) : k("", !0)
603
619
  ], 64));
604
620
  }
605
- }), gt = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6" }, pt = { class: "relative aspect-video bg-gray-200" }, yt = ["src", "alt"], ht = { class: "absolute top-2 left-2 bg-black bg-opacity-70 text-white px-3 py-1 rounded-full text-sm font-semibold" }, xt = { class: "p-4" }, bt = { class: "text-gray-700 text-sm line-clamp-3 group-hover:text-indigo-600 transition-colors" }, kt = { class: "text-gray-500 text-xs mt-2 space-y-1" }, wt = { key: 0 }, St = { key: 1 }, At = /* @__PURE__ */ z({
621
+ }), bt = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6" }, kt = { class: "relative aspect-video bg-gray-200" }, wt = ["src", "alt"], St = { class: "absolute top-2 left-2 bg-black bg-opacity-70 text-white px-3 py-1 rounded-full text-sm font-semibold" }, $t = { class: "p-4" }, Lt = { class: "text-gray-700 text-sm line-clamp-3 group-hover:text-indigo-600 transition-colors" }, Pt = { class: "text-gray-500 text-xs mt-2 space-y-1" }, Ct = { key: 0 }, Et = { key: 1 }, Nt = /* @__PURE__ */ R({
606
622
  __name: "beat_grid_view",
607
623
  props: {
608
624
  beats: {},
609
625
  basePath: { default: "" },
610
626
  textLang: { default: "en" },
611
- linkUrlBuilder: {},
627
+ linkUrlBuilder: { type: Function, default: void 0 },
612
628
  linkComponent: { default: "a" }
613
629
  },
614
630
  emits: ["beat-click"],
615
- setup(t, { emit: c }) {
616
- const a = t, o = c, p = (l) => {
617
- const f = Math.floor(l / 3600), m = Math.floor(l % 3600 / 60), r = Math.floor(l % 60);
618
- return f > 0 ? `${f}:${m.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}` : `${m}:${r.toString().padStart(2, "0")}`;
619
- }, g = (l) => l.multiLinguals?.[a.textLang] || l.text || "No text available", n = (l) => `${a.basePath}/${l + 1}.jpg`, d = (l, f) => {
620
- a.linkComponent === "a" && a.linkUrlBuilder && f.preventDefault(), o("beat-click", l);
631
+ setup(a, { emit: d }) {
632
+ const o = a, l = d, p = (n) => {
633
+ const f = Math.floor(n / 3600), h = Math.floor(n % 3600 / 60), v = Math.floor(n % 60);
634
+ return f > 0 ? `${f}:${h.toString().padStart(2, "0")}:${v.toString().padStart(2, "0")}` : `${h}:${v.toString().padStart(2, "0")}`;
635
+ }, g = (n) => n.multiLinguals?.[o.textLang] || n.text || "No text available", t = (n) => `${o.basePath}/${n + 1}.jpg`, u = (n, f) => {
636
+ o.linkComponent === "a" && o.linkUrlBuilder && f.preventDefault(), l("beat-click", n);
621
637
  };
622
- return (l, f) => (i(), u("div", gt, [
623
- (i(!0), u(R, null, Y(t.beats, ({ beat: m, originalIndex: r }) => (i(), Z(oe(t.linkComponent), {
624
- key: r,
625
- to: t.linkUrlBuilder ? t.linkUrlBuilder(r) : void 0,
626
- href: t.linkUrlBuilder ? t.linkUrlBuilder(r) : void 0,
638
+ return (n, f) => (i(), r("div", bt, [
639
+ (i(!0), r(D, null, Z(a.beats, ({ beat: h, originalIndex: v }) => (i(), I(se(a.linkComponent), {
640
+ key: v,
641
+ to: a.linkUrlBuilder ? a.linkUrlBuilder(v) : void 0,
642
+ href: a.linkUrlBuilder ? a.linkUrlBuilder(v) : void 0,
627
643
  class: "group block bg-white rounded-lg shadow-md hover:shadow-xl transition-shadow duration-300 overflow-hidden",
628
- onClick: (w) => d(r, w)
644
+ onClick: (x) => u(v, x)
629
645
  }, {
630
- default: le(() => [
631
- e("div", pt, [
646
+ default: ie(() => [
647
+ e("div", kt, [
632
648
  e("img", {
633
- src: n(r),
634
- alt: `Beat ${r + 1}`,
649
+ src: t(v),
650
+ alt: `Beat ${v + 1}`,
635
651
  class: "w-full h-full object-cover"
636
- }, null, 8, yt),
637
- e("div", ht, S(r + 1), 1)
652
+ }, null, 8, wt),
653
+ e("div", St, L(v + 1), 1)
638
654
  ]),
639
- e("div", xt, [
640
- e("p", bt, S(g(m)), 1),
641
- e("div", kt, [
642
- m.startTime !== void 0 ? (i(), u("p", wt, "Start: " + S(p(m.startTime)), 1)) : k("", !0),
643
- m.duration ? (i(), u("p", St, "Duration: " + S(p(m.duration)), 1)) : k("", !0)
655
+ e("div", $t, [
656
+ e("p", Lt, L(g(h)), 1),
657
+ e("div", Pt, [
658
+ h.startTime !== void 0 ? (i(), r("p", Ct, "Start: " + L(p(h.startTime)), 1)) : k("", !0),
659
+ h.duration ? (i(), r("p", Et, "Duration: " + L(p(h.duration)), 1)) : k("", !0)
644
660
  ])
645
661
  ])
646
662
  ]),
@@ -648,65 +664,65 @@ const Q = async (t) => await new Promise((c) => setTimeout(c, t)), me = (t, c) =
648
664
  }, 1032, ["to", "href", "onClick"]))), 128))
649
665
  ]));
650
666
  }
651
- }), $t = { class: "space-y-6" }, Lt = ["id"], Pt = { class: "flex items-center gap-3 mb-2 flex-wrap" }, Ct = { class: "bg-indigo-600 text-white px-4 py-1 rounded-full text-sm font-semibold" }, Et = {
667
+ }), Bt = { class: "space-y-6" }, Tt = ["id"], Mt = { class: "flex items-center gap-3 mb-2 flex-wrap" }, _t = { class: "bg-indigo-600 text-white px-4 py-1 rounded-full text-sm font-semibold" }, Vt = {
652
668
  key: 0,
653
669
  class: "text-gray-500 text-sm"
654
- }, Bt = {
670
+ }, At = {
655
671
  key: 1,
656
672
  class: "text-gray-500 text-sm"
657
- }, Tt = ["src", "alt"], _t = { class: "text-gray-800 text-base leading-relaxed font-sans" }, Ut = /* @__PURE__ */ z({
673
+ }, jt = ["src", "alt"], Ut = { class: "text-gray-800 text-base leading-relaxed font-sans" }, Wt = /* @__PURE__ */ R({
658
674
  __name: "beat_list_view",
659
675
  props: {
660
676
  beats: {},
661
677
  basePath: { default: "" },
662
678
  textLang: { default: "en" },
663
- linkUrlBuilder: {},
679
+ linkUrlBuilder: { type: Function, default: void 0 },
664
680
  linkComponent: { default: "a" }
665
681
  },
666
682
  emits: ["beat-click"],
667
- setup(t, { emit: c }) {
668
- const a = t, o = c, p = (l) => {
669
- const f = Math.floor(l / 3600), m = Math.floor(l % 3600 / 60), r = Math.floor(l % 60);
670
- return f > 0 ? `${f}:${m.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}` : `${m}:${r.toString().padStart(2, "0")}`;
671
- }, g = (l) => l.multiLinguals?.[a.textLang] || l.text || "No text available", n = (l) => `${a.basePath}/${l + 1}.jpg`, d = (l, f) => {
672
- a.linkComponent === "a" && a.linkUrlBuilder && f.preventDefault(), o("beat-click", l);
683
+ setup(a, { emit: d }) {
684
+ const o = a, l = d, p = (n) => {
685
+ const f = Math.floor(n / 3600), h = Math.floor(n % 3600 / 60), v = Math.floor(n % 60);
686
+ return f > 0 ? `${f}:${h.toString().padStart(2, "0")}:${v.toString().padStart(2, "0")}` : `${h}:${v.toString().padStart(2, "0")}`;
687
+ }, g = (n) => n.multiLinguals?.[o.textLang] || n.text || "No text available", t = (n) => `${o.basePath}/${n + 1}.jpg`, u = (n, f) => {
688
+ o.linkComponent === "a" && o.linkUrlBuilder && f.preventDefault(), l("beat-click", n);
673
689
  };
674
- return (l, f) => (i(), u("div", $t, [
675
- (i(!0), u(R, null, Y(t.beats, ({ beat: m, originalIndex: r }) => (i(), u("div", {
676
- id: `beat-${r}`,
677
- key: r,
690
+ return (n, f) => (i(), r("div", Bt, [
691
+ (i(!0), r(D, null, Z(a.beats, ({ beat: h, originalIndex: v }) => (i(), r("div", {
692
+ id: `beat-${v}`,
693
+ key: v,
678
694
  class: "bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow"
679
695
  }, [
680
- (i(), Z(oe(t.linkComponent), {
681
- to: t.linkUrlBuilder ? t.linkUrlBuilder(r) : void 0,
682
- href: t.linkUrlBuilder ? t.linkUrlBuilder(r) : void 0,
696
+ (i(), I(se(a.linkComponent), {
697
+ to: a.linkUrlBuilder ? a.linkUrlBuilder(v) : void 0,
698
+ href: a.linkUrlBuilder ? a.linkUrlBuilder(v) : void 0,
683
699
  class: "float-left mr-4 mb-2 w-64 flex-shrink-0",
684
- onClick: (w) => d(r, w)
700
+ onClick: (x) => u(v, x)
685
701
  }, {
686
- default: le(() => [
687
- e("div", Pt, [
688
- e("span", Ct, " #" + S(r + 1), 1),
689
- m.startTime !== void 0 ? (i(), u("span", Et, " Start: " + S(p(m.startTime)), 1)) : k("", !0),
690
- m.duration ? (i(), u("span", Bt, " Duration: " + S(p(m.duration)), 1)) : k("", !0)
702
+ default: ie(() => [
703
+ e("div", Mt, [
704
+ e("span", _t, " #" + L(v + 1), 1),
705
+ h.startTime !== void 0 ? (i(), r("span", Vt, " Start: " + L(p(h.startTime)), 1)) : k("", !0),
706
+ h.duration ? (i(), r("span", At, " Duration: " + L(p(h.duration)), 1)) : k("", !0)
691
707
  ]),
692
708
  e("img", {
693
- src: n(r),
694
- alt: `Beat ${r + 1}`,
709
+ src: t(v),
710
+ alt: `Beat ${v + 1}`,
695
711
  class: "w-full h-auto object-cover rounded-lg hover:opacity-80 transition-opacity shadow-sm"
696
- }, null, 8, Tt)
712
+ }, null, 8, jt)
697
713
  ]),
698
714
  _: 2
699
715
  }, 1032, ["to", "href", "onClick"])),
700
- e("p", _t, S(g(m)), 1),
716
+ e("p", Ut, L(g(h)), 1),
701
717
  f[0] || (f[0] = e("div", { class: "clear-both" }, null, -1))
702
- ], 8, Lt))), 128))
718
+ ], 8, Tt))), 128))
703
719
  ]));
704
720
  }
705
721
  });
706
722
  export {
707
- At as BeatGridView,
708
- Ut as BeatListView,
709
- Mt as MulmoViewer,
710
- jt as MulmoViewerHeader,
711
- W as SelectLanguage
723
+ Nt as BeatGridView,
724
+ Wt as BeatListView,
725
+ Rt as MulmoViewer,
726
+ zt as MulmoViewerHeader,
727
+ N as SelectLanguage
712
728
  };