strataplayer 1.2.20 → 1.2.21

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,13 +1,13 @@
1
- var mi = Object.defineProperty;
2
- var fi = (n, t, i) => t in n ? mi(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
3
- var R = (n, t, i) => fi(n, typeof t != "symbol" ? t + "" : t, i);
4
- import ke, { useState as N, useEffect as Q, useRef as U, useLayoutEffect as Ee, useMemo as xe, useSyncExternalStore as bi, useCallback as $e } from "react";
5
- import { createRoot as gi } from "react-dom/client";
6
- import { jsxs as d, jsx as e, Fragment as _ } from "react/jsx-runtime";
7
- import { createPortal as vi } from "react-dom";
8
- class xi {
1
+ var Si = Object.defineProperty;
2
+ var Ci = (s, t, i) => t in s ? Si(s, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[t] = i;
3
+ var F = (s, t, i) => Ci(s, typeof t != "symbol" ? t + "" : t, i);
4
+ import Me, { useState as M, useEffect as ee, useRef as W, useLayoutEffect as Be, useMemo as Ce, useSyncExternalStore as Ni, useCallback as Ve } from "react";
5
+ import { createRoot as Mi } from "react-dom/client";
6
+ import { jsxs as c, jsx as e, Fragment as Q } from "react/jsx-runtime";
7
+ import { createPortal as Ti } from "react-dom";
8
+ class zi {
9
9
  constructor() {
10
- R(this, "events");
10
+ F(this, "events");
11
11
  this.events = /* @__PURE__ */ new Map();
12
12
  }
13
13
  on(t, i) {
@@ -18,21 +18,21 @@ class xi {
18
18
  const o = this.events.get(t);
19
19
  o && this.events.set(
20
20
  t,
21
- o.filter((r) => r !== i)
21
+ o.filter((a) => a !== i)
22
22
  );
23
23
  }
24
24
  emit(t, i) {
25
25
  const o = this.events.get(t);
26
- o && o.forEach((r) => r(i));
26
+ o && o.forEach((a) => a(i));
27
27
  }
28
28
  destroy() {
29
29
  this.events.clear();
30
30
  }
31
31
  }
32
- class wi {
32
+ class Ii {
33
33
  constructor(t) {
34
- R(this, "state");
35
- R(this, "listeners");
34
+ F(this, "state");
35
+ F(this, "listeners");
36
36
  this.state = t, this.listeners = /* @__PURE__ */ new Set();
37
37
  }
38
38
  get() {
@@ -40,7 +40,7 @@ class wi {
40
40
  }
41
41
  setState(t) {
42
42
  const i = this.state, o = typeof t == "function" ? t(i) : t;
43
- this.state = { ...i, ...o }, this.listeners.forEach((r) => r(this.state, i));
43
+ this.state = { ...i, ...o }, this.listeners.forEach((a) => a(this.state, i));
44
44
  }
45
45
  subscribe(t) {
46
46
  return this.listeners.add(t), () => this.listeners.delete(t);
@@ -49,13 +49,13 @@ class wi {
49
49
  this.listeners.clear();
50
50
  }
51
51
  }
52
- class yi {
52
+ class Ri {
53
53
  constructor(t) {
54
- R(this, "context", null);
55
- R(this, "source", null);
56
- R(this, "gainNode", null);
57
- R(this, "video");
58
- R(this, "isInitialized", !1);
54
+ F(this, "context", null);
55
+ F(this, "source", null);
56
+ F(this, "gainNode", null);
57
+ F(this, "video");
58
+ F(this, "isInitialized", !1);
59
59
  this.video = t;
60
60
  }
61
61
  /**
@@ -78,67 +78,67 @@ class yi {
78
78
  this.context && this.context.close(), this.isInitialized = !1;
79
79
  }
80
80
  }
81
- const Je = (n) => {
82
- if (isNaN(n)) return "00:00";
83
- const t = Math.floor(n / 3600), i = Math.floor(n % 3600 / 60), o = Math.floor(n % 60);
81
+ const it = (s) => {
82
+ if (isNaN(s)) return "00:00";
83
+ const t = Math.floor(s / 3600), i = Math.floor(s % 3600 / 60), o = Math.floor(s % 60);
84
84
  return t > 0 ? `${t}:${i.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}` : `${i}:${o.toString().padStart(2, "0")}`;
85
- }, ki = async (n, t = 3, i = 2e4) => {
85
+ }, Pi = async (s, t = 3, i = 2e4) => {
86
86
  for (let o = 0; o < t; o++) {
87
- const r = new AbortController(), h = setTimeout(() => r.abort(), i);
87
+ const a = new AbortController(), u = setTimeout(() => a.abort(), i);
88
88
  try {
89
- const u = await fetch(n, { signal: r.signal });
90
- if (clearTimeout(h), !u.ok) throw new Error(`HTTP ${u.status}`);
91
- return await u.text();
92
- } catch (u) {
93
- if (clearTimeout(h), o === t - 1) throw u;
89
+ const h = await fetch(s, { signal: a.signal });
90
+ if (clearTimeout(u), !h.ok) throw new Error(`HTTP ${h.status}`);
91
+ return await h.text();
92
+ } catch (h) {
93
+ if (clearTimeout(u), o === t - 1) throw h;
94
94
  await new Promise((f) => setTimeout(f, 1e3));
95
95
  }
96
96
  }
97
97
  throw new Error("Failed");
98
- }, Si = async (n, t, i = 2e4) => {
98
+ }, Li = async (s, t, i = 2e4) => {
99
99
  try {
100
- const r = (await ki(n, 3, i)).split(`
101
- `), h = [];
102
- let u = null, f = null;
103
- const g = n.substring(0, n.lastIndexOf("/") + 1), x = (p) => {
104
- const w = p.split(":");
105
- let m = 0;
106
- return w.length === 3 ? (m += parseFloat(w[0]) * 3600, m += parseFloat(w[1]) * 60, m += parseFloat(w[2])) : (m += parseFloat(w[0]) * 60, m += parseFloat(w[1])), m;
100
+ const a = (await Pi(s, 3, i)).split(`
101
+ `), u = [];
102
+ let h = null, f = null;
103
+ const x = s.substring(0, s.lastIndexOf("/") + 1), b = (m) => {
104
+ const v = m.split(":");
105
+ let p = 0;
106
+ return v.length === 3 ? (p += parseFloat(v[0]) * 3600, p += parseFloat(v[1]) * 60, p += parseFloat(v[2])) : (p += parseFloat(v[0]) * 60, p += parseFloat(v[1])), p;
107
107
  };
108
- for (let p of r)
109
- if (p = p.trim(), p.includes("-->")) {
110
- const w = p.split("-->");
111
- u = x(w[0].trim()), f = x(w[1].trim());
112
- } else if (u !== null && f !== null && p.length > 0) {
113
- let [w, m] = p.split("#");
114
- !w.match(/^https?:\/\//) && !w.startsWith("data:") && (w = g + w);
115
- let T = 0, I = 0, O = 0, Y = 0;
116
- if (m && m.startsWith("xywh=")) {
117
- const W = m.replace("xywh=", "").split(",");
118
- W.length === 4 && (T = parseInt(W[0]), I = parseInt(W[1]), O = parseInt(W[2]), Y = parseInt(W[3]));
108
+ for (let m of a)
109
+ if (m = m.trim(), m.includes("-->")) {
110
+ const v = m.split("-->");
111
+ h = b(v[0].trim()), f = b(v[1].trim());
112
+ } else if (h !== null && f !== null && m.length > 0) {
113
+ let [v, p] = m.split("#");
114
+ !v.match(/^https?:\/\//) && !v.startsWith("data:") && (v = x + v);
115
+ let S = 0, $ = 0, U = 0, H = 0;
116
+ if (p && p.startsWith("xywh=")) {
117
+ const q = p.replace("xywh=", "").split(",");
118
+ q.length === 4 && (S = parseInt(q[0]), $ = parseInt(q[1]), U = parseInt(q[2]), H = parseInt(q[3]));
119
119
  }
120
- O > 0 && Y > 0 && h.push({ start: u, end: f, url: w, x: T, y: I, w: O, h: Y }), u = null, f = null;
120
+ U > 0 && H > 0 && u.push({ start: h, end: f, url: v, x: S, y: $, w: U, h: H }), h = null, f = null;
121
121
  }
122
- return h;
122
+ return u;
123
123
  } catch {
124
124
  return t({ type: "warning", message: "Failed to load thumbnails", duration: 4e3 }), [];
125
125
  }
126
- }, Ci = () => {
126
+ }, Fi = () => {
127
127
  if (!(typeof document > "u")) {
128
128
  if (!document.getElementById("strata-fonts")) {
129
- const n = document.createElement("link");
130
- n.rel = "preconnect", n.href = "https://fonts.googleapis.com", document.head.appendChild(n);
129
+ const s = document.createElement("link");
130
+ s.rel = "preconnect", s.href = "https://fonts.googleapis.com", document.head.appendChild(s);
131
131
  const t = document.createElement("link");
132
132
  t.rel = "preconnect", t.href = "https://fonts.gstatic.com", t.crossOrigin = "anonymous", document.head.appendChild(t);
133
133
  const i = document.createElement("link");
134
134
  i.id = "strata-fonts", i.rel = "stylesheet", i.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Press+Start+2P&family=Cinzel:wght@400;600;700&display=swap", document.head.appendChild(i);
135
135
  }
136
136
  if (!document.querySelector('script[src*="cast_sender.js"]') && !window.cast) {
137
- const n = document.createElement("script");
138
- n.src = "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1", document.head.appendChild(n);
137
+ const s = document.createElement("script");
138
+ s.src = "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1", document.head.appendChild(s);
139
139
  }
140
140
  }
141
- }, tt = {
141
+ }, rt = {
142
142
  useNative: !1,
143
143
  fixCapitalization: !1,
144
144
  backgroundOpacity: 50,
@@ -149,7 +149,7 @@ const Je = (n) => {
149
149
  isBold: !1,
150
150
  textColor: "#ffffff",
151
151
  verticalOffset: 40
152
- }, Ht = "strata-settings", te = {
152
+ }, Jt = "strata-settings", K = {
153
153
  isPlaying: !1,
154
154
  isBuffering: !1,
155
155
  isLive: !1,
@@ -171,7 +171,7 @@ const Je = (n) => {
171
171
  subtitleTracks: [],
172
172
  currentSubtitle: -1,
173
173
  subtitleOffset: 0,
174
- subtitleSettings: tt,
174
+ subtitleSettings: rt,
175
175
  activeCues: [],
176
176
  viewMode: "normal",
177
177
  notifications: [],
@@ -185,92 +185,98 @@ const Je = (n) => {
185
185
  isLocked: !1,
186
186
  flipState: { horizontal: !1, vertical: !1 },
187
187
  aspectRatio: "default",
188
+ videoFit: "contain",
189
+ brightness: 1,
188
190
  isAutoSized: !1,
189
191
  isLooping: !1,
190
192
  controlsVisible: !0
191
- }, Wt = (n = {}) => {
193
+ }, Kt = (s = {}) => {
192
194
  let t = {};
193
- if (!n.disablePersistence && typeof window < "u")
195
+ if (!s.disablePersistence && typeof window < "u")
194
196
  try {
195
- const o = localStorage.getItem(Ht);
196
- o && (t = JSON.parse(o));
197
+ const a = localStorage.getItem(Jt);
198
+ a && (t = JSON.parse(a));
197
199
  } catch {
198
200
  }
199
201
  const i = {
200
- ...tt,
202
+ ...rt,
201
203
  ...t.subtitleSettings || {},
202
- ...n.subtitleSettings || {}
203
- };
204
+ ...s.subtitleSettings || {}
205
+ }, o = s.videoFit ?? (s.autoSize ? "cover" : void 0) ?? t.videoFit ?? K.videoFit;
204
206
  return {
205
- ...te,
207
+ ...K,
206
208
  ...t,
207
209
  // Load saved first
208
210
  // Override with config if present (not undefined)
209
- volume: n.volume ?? t.volume ?? te.volume,
210
- isMuted: n.muted ?? t.isMuted ?? te.isMuted,
211
- playbackRate: n.playbackRate ?? t.playbackRate ?? te.playbackRate,
212
- audioGain: n.audioGain ?? t.audioGain ?? te.audioGain,
213
- theme: n.theme ?? t.theme ?? te.theme,
214
- themeColor: n.themeColor ?? t.themeColor ?? te.themeColor,
215
- iconSize: n.iconSize ?? t.iconSize ?? te.iconSize,
211
+ volume: s.volume ?? t.volume ?? K.volume,
212
+ isMuted: s.muted ?? t.isMuted ?? K.isMuted,
213
+ playbackRate: s.playbackRate ?? t.playbackRate ?? K.playbackRate,
214
+ audioGain: s.audioGain ?? t.audioGain ?? K.audioGain,
215
+ theme: s.theme ?? t.theme ?? K.theme,
216
+ themeColor: s.themeColor ?? t.themeColor ?? K.themeColor,
217
+ iconSize: s.iconSize ?? t.iconSize ?? K.iconSize,
216
218
  subtitleSettings: i,
217
219
  // Config overrides state for these visual modes
218
- isAutoSized: n.autoSize ?? te.isAutoSized,
219
- isLive: n.isLive ?? t.isLive ?? te.isLive,
220
- isLooping: n.loop ?? t.isLooping ?? te.isLooping,
220
+ isAutoSized: s.autoSize ?? K.isAutoSized,
221
+ videoFit: o,
222
+ brightness: s.brightness ?? t.brightness ?? K.brightness,
223
+ isLive: s.isLive ?? t.isLive ?? K.isLive,
224
+ isLooping: s.loop ?? t.isLooping ?? K.isLooping,
221
225
  sourceStatuses: {}
222
226
  // Never persist statuses
223
227
  };
224
228
  };
225
- class Ni {
229
+ class $i {
226
230
  constructor(t = {}, i) {
227
- R(this, "video");
228
- R(this, "container", null);
229
- R(this, "events");
230
- R(this, "store");
231
- R(this, "plugins", /* @__PURE__ */ new Map());
232
- R(this, "audioEngine");
233
- R(this, "config");
234
- R(this, "resizeObserver", null);
231
+ F(this, "video");
232
+ F(this, "container", null);
233
+ F(this, "events");
234
+ F(this, "store");
235
+ F(this, "plugins", /* @__PURE__ */ new Map());
236
+ F(this, "audioEngine");
237
+ F(this, "config");
238
+ F(this, "resizeObserver", null);
235
239
  // Retry Logic
236
- R(this, "retryCount", 0);
237
- R(this, "maxRetries", 5);
238
- R(this, "retryTimer", null);
239
- R(this, "currentSource", null);
240
- R(this, "currentSrc", "");
240
+ F(this, "retryCount", 0);
241
+ F(this, "maxRetries", 5);
242
+ F(this, "retryTimer", null);
243
+ F(this, "currentSource", null);
244
+ F(this, "currentSrc", "");
241
245
  // Track configs from setSources are stored here to lazy load
242
- R(this, "trackConfigs", []);
246
+ F(this, "trackConfigs", []);
243
247
  // Download Control
244
- R(this, "currentDownloadController", null);
248
+ F(this, "activeDownloads", /* @__PURE__ */ new Map());
245
249
  // Cast
246
- R(this, "castInitialized", !1);
247
- R(this, "boundCueChange");
248
- R(this, "boundFullscreenChange");
249
- Ci(), this.config = t, this.config.autoOrientation = this.config.autoOrientation ?? !0, this.config.fetchTimeout = this.config.fetchTimeout ?? 3e4, this.config.centerControls = this.config.centerControls ?? !0, this.config.gestureSeek = this.config.gestureSeek ?? !1, this.video = i || document.createElement("video"), this.video.crossOrigin = "anonymous", t.playsInline !== !1 && (this.video.playsInline = !0), this.events = new xi();
250
- const o = Wt(t);
251
- this.store = new wi(o), this.audioEngine = new yi(this.video), this.boundCueChange = this.handleCueChange.bind(this), this.boundFullscreenChange = () => {
252
- const r = !!document.fullscreenElement;
253
- if (this.store.setState({ isFullscreen: r }), this.emit("resize"), this.emit(r ? "fullscreen" : "fullscreen_exit"), r && this.config.autoOrientation && screen.orientation && "lock" in screen.orientation) {
254
- const u = this.video.videoWidth > this.video.videoHeight ? "landscape" : "portrait";
250
+ F(this, "castInitialized", !1);
251
+ F(this, "boundCueChange");
252
+ F(this, "boundFullscreenChange");
253
+ Fi(), this.config = t, this.config.autoOrientation = this.config.autoOrientation ?? !0, this.config.fetchTimeout = this.config.fetchTimeout ?? 3e4, this.config.centerControls = this.config.centerControls ?? !0, this.config.gestureSeek = this.config.gestureSeek ?? !1, this.video = i || document.createElement("video"), this.video.crossOrigin = "anonymous", this.video.preload = "auto", t.playsInline !== !1 && (this.video.playsInline = !0), this.events = new zi();
254
+ const o = Kt(t);
255
+ this.store = new Ii(o), this.audioEngine = new Ri(this.video), this.boundCueChange = this.handleCueChange.bind(this), this.boundFullscreenChange = () => {
256
+ const a = !!document.fullscreenElement;
257
+ if (this.store.setState({ isFullscreen: a }), this.emit("resize"), this.emit(a ? "fullscreen" : "fullscreen_exit"), a && this.config.autoOrientation && screen.orientation && "lock" in screen.orientation) {
258
+ const h = this.video.videoWidth > this.video.videoHeight ? "landscape" : "portrait";
255
259
  try {
256
- screen.orientation.lock(u).catch(() => {
260
+ screen.orientation.lock(h).catch(() => {
257
261
  });
258
262
  } catch {
259
263
  }
260
- } else !r && screen.orientation && "unlock" in screen.orientation && screen.orientation.unlock();
261
- }, this.video.volume = o.volume, this.video.muted = o.isMuted, this.video.playbackRate = o.playbackRate, this.video.loop = o.isLooping, o.audioGain > 1 && this.audioEngine.setGain(o.audioGain), o.isAutoSized && (this.video.style.objectFit = "cover"), this.initVideoListeners(), this.initMediaSession(), this.initCast(), t.disablePersistence || this.store.subscribe((r) => {
262
- const h = {
263
- volume: r.volume,
264
- isMuted: r.isMuted,
265
- playbackRate: r.playbackRate,
266
- subtitleSettings: r.subtitleSettings,
267
- iconSize: r.iconSize,
268
- themeColor: r.themeColor,
269
- theme: r.theme,
270
- isLive: r.isLive,
271
- isLooping: r.isLooping
264
+ } else !a && screen.orientation && "unlock" in screen.orientation && screen.orientation.unlock();
265
+ }, this.video.volume = o.volume, this.video.muted = o.isMuted, this.video.playbackRate = o.playbackRate, this.video.loop = o.isLooping, this.video.style.filter = `brightness(${o.brightness})`, o.audioGain > 1 && this.audioEngine.setGain(o.audioGain), this.video.style.objectFit = o.videoFit, this.initVideoListeners(), this.initMediaSession(), this.initCast(), t.disablePersistence || this.store.subscribe((a) => {
266
+ const u = {
267
+ volume: a.volume,
268
+ isMuted: a.isMuted,
269
+ playbackRate: a.playbackRate,
270
+ subtitleSettings: a.subtitleSettings,
271
+ iconSize: a.iconSize,
272
+ themeColor: a.themeColor,
273
+ theme: a.theme,
274
+ isLive: a.isLive,
275
+ isLooping: a.isLooping,
276
+ brightness: a.brightness,
277
+ videoFit: a.videoFit
272
278
  };
273
- localStorage.setItem(Ht, JSON.stringify(h));
279
+ localStorage.setItem(Jt, JSON.stringify(u));
274
280
  });
275
281
  }
276
282
  // --- Instance Properties ---
@@ -356,8 +362,8 @@ class Ni {
356
362
  "volumechange",
357
363
  "waiting"
358
364
  ].forEach((o) => {
359
- this.video.addEventListener(o, (r) => {
360
- switch (this.emit(`video:${o}`, r), o === "play" && this.emit("play"), o === "pause" && this.emit("pause"), o === "ended" && this.emit("ended"), o === "error" && this.emit("error", this.video.error), o === "seeked" && this.emit("seek"), o) {
365
+ this.video.addEventListener(o, (a) => {
366
+ switch (this.emit(`video:${o}`, a), o === "play" && this.emit("play"), o === "pause" && this.emit("pause"), o === "ended" && this.emit("ended"), o === "error" && this.emit("error", this.video.error), o === "seeked" && this.emit("seek"), o) {
361
367
  case "play":
362
368
  t({ isPlaying: !0 }), "mediaSession" in navigator && (navigator.mediaSession.playbackState = "playing"), this.updateMediaSessionPosition();
363
369
  break;
@@ -440,9 +446,9 @@ class Ni {
440
446
  });
441
447
  }
442
448
  updateMediaSessionMetadata() {
443
- var o, r;
449
+ var o, a;
444
450
  if (!("mediaSession" in navigator)) return;
445
- const t = ((o = this.currentSource) == null ? void 0 : o.name) || ((r = this.currentSource) == null ? void 0 : r.url.split("/").pop()) || "Video", i = [];
451
+ const t = ((o = this.currentSource) == null ? void 0 : o.name) || ((a = this.currentSource) == null ? void 0 : a.url.split("/").pop()) || "Video", i = [];
446
452
  this.config.poster && i.push({ src: this.config.poster, sizes: "512x512", type: "image/jpeg" }), i.push({ src: "logo.png", sizes: "512x512", type: "image/png" }), navigator.mediaSession.metadata = new MediaMetadata({
447
453
  title: t,
448
454
  artist: "StrataPlayer",
@@ -460,8 +466,8 @@ class Ni {
460
466
  position: Math.max(0, Math.min(i, t))
461
467
  // Ensure within [0, duration]
462
468
  });
463
- } catch (r) {
464
- console.warn("MediaSession Position Error:", r);
469
+ } catch (a) {
470
+ console.warn("MediaSession Position Error:", a);
465
471
  }
466
472
  }
467
473
  triggerError(t, i = !1) {
@@ -471,29 +477,29 @@ class Ni {
471
477
  const i = this.video.error, o = t || (i == null ? void 0 : i.message) || (i ? `Code ${i.code}` : "Unknown Error");
472
478
  if (this.removeNotification("retry"), this.emit("video:error", i), this.retryCount < this.maxRetries) {
473
479
  this.retryCount++;
474
- const r = Math.pow(2, this.retryCount - 1) * 1500;
480
+ const a = Math.pow(2, this.retryCount - 1) * 1500;
475
481
  this.notify({
476
482
  id: "retry",
477
483
  type: "loading",
478
484
  // Cleaned up formatting with newline
479
485
  message: `Error: ${o}.
480
486
  Retrying (${this.retryCount}/${this.maxRetries})`
481
- }), console.warn(`[StrataPlayer] Error: ${o}. Retrying in ${r}ms...`), this.retryTimer && clearTimeout(this.retryTimer), this.retryTimer = setTimeout(() => {
487
+ }), console.warn(`[StrataPlayer] Error: ${o}. Retrying in ${a}ms...`), this.retryTimer && clearTimeout(this.retryTimer), this.retryTimer = setTimeout(() => {
482
488
  if (this.currentSource) {
483
489
  this.load(this.currentSource, this.trackConfigs, !0);
484
- const h = this.store.get().currentTime;
485
- if (h > 0) {
486
- const u = () => {
487
- this.video.currentTime = h, this.video.removeEventListener("canplay", u);
490
+ const u = this.store.get().currentTime;
491
+ if (u > 0) {
492
+ const h = () => {
493
+ this.video.currentTime = u, this.video.removeEventListener("canplay", h);
488
494
  };
489
- this.video.addEventListener("canplay", u);
495
+ this.video.addEventListener("canplay", h);
490
496
  }
491
497
  }
492
- }, r);
498
+ }, a);
493
499
  } else {
494
500
  this.removeNotification("retry");
495
- const r = `Failed to play after ${this.maxRetries} attempts: ${o}`;
496
- this.store.setState({ error: r }), this.emit("error", r), this.updateSourceStatus("error");
501
+ const a = `Failed to play after ${this.maxRetries} attempts: ${o}`;
502
+ this.store.setState({ error: a }), this.emit("error", a), this.updateSourceStatus("error");
497
503
  }
498
504
  }
499
505
  updateBuffer() {
@@ -507,27 +513,27 @@ Retrying (${this.retryCount}/${this.maxRetries})`
507
513
  }
508
514
  updateSubtitleTrackState(t, i) {
509
515
  this.store.setState((o) => {
510
- const r = [...o.subtitleTracks];
511
- return r[t] && (r[t] = { ...r[t], ...i }), { subtitleTracks: r };
516
+ const a = [...o.subtitleTracks];
517
+ return a[t] && (a[t] = { ...a[t], ...i }), { subtitleTracks: a };
512
518
  });
513
519
  }
514
520
  // --- Utility ---
515
- async fetchWithRetry(t, i = 3, o, r) {
516
- const h = o ?? this.config.fetchTimeout ?? 3e4;
517
- for (let u = 0; u < i; u++) {
518
- const f = r ? null : new AbortController(), g = r || (f == null ? void 0 : f.signal), x = setTimeout(() => f == null ? void 0 : f.abort(), h);
521
+ async fetchWithRetry(t, i = 3, o, a) {
522
+ const u = o ?? this.config.fetchTimeout ?? 3e4;
523
+ for (let h = 0; h < i; h++) {
524
+ const f = a ? null : new AbortController(), x = a || (f == null ? void 0 : f.signal), b = setTimeout(() => f == null ? void 0 : f.abort(), u);
519
525
  try {
520
- const p = await fetch(t, { signal: g });
521
- if (clearTimeout(x), !p.ok) throw new Error(`HTTP ${p.status}`);
522
- return p;
523
- } catch (p) {
524
- if (clearTimeout(x), r != null && r.aborted) throw new Error("Aborted");
525
- if (u === i - 1) throw p;
526
- if (p.name === "AbortError") {
527
- if (r != null && r.aborted) throw p;
528
- console.warn(`Fetch timeout (${h}ms) for ${t}`);
526
+ const m = await fetch(t, { signal: x });
527
+ if (clearTimeout(b), !m.ok) throw new Error(`HTTP ${m.status}`);
528
+ return m;
529
+ } catch (m) {
530
+ if (clearTimeout(b), a != null && a.aborted) throw new Error("Aborted");
531
+ if (h === i - 1) throw m;
532
+ if (m.name === "AbortError") {
533
+ if (a != null && a.aborted) throw m;
534
+ console.warn(`Fetch timeout (${u}ms) for ${t}`);
529
535
  }
530
- await new Promise((w) => setTimeout(w, 1e3 * Math.pow(2, u)));
536
+ await new Promise((v) => setTimeout(v, 1e3 * Math.pow(2, h)));
531
537
  }
532
538
  }
533
539
  throw new Error("Fetch failed");
@@ -546,12 +552,12 @@ Retrying (${this.retryCount}/${this.maxRetries})`
546
552
  // Enhanced Format Duration: Days, Hours, Minutes, Seconds
547
553
  formatDuration(t) {
548
554
  if (!isFinite(t) || t <= 0) return "";
549
- const i = Math.floor(t / 1e3), o = Math.floor(i / (3600 * 24)), r = Math.floor(i % (3600 * 24) / 3600), h = Math.floor(i % 3600 / 60), u = i % 60, f = [];
550
- return o > 0 && f.push(`${o}d`), r > 0 && f.push(`${r}h`), h > 0 && f.push(`${h}m`), f.push(`${u}s`), f.join(" ");
555
+ const i = Math.floor(t / 1e3), o = Math.floor(i / (3600 * 24)), a = Math.floor(i % (3600 * 24) / 3600), u = Math.floor(i % 3600 / 60), h = i % 60, f = [];
556
+ return o > 0 && f.push(`${o}d`), a > 0 && f.push(`${a}h`), u > 0 && f.push(`${u}m`), f.push(`${h}s`), f.join(" ");
551
557
  }
552
558
  // --- Core Methods ---
553
559
  attach(t) {
554
- this.resizeObserver && this.resizeObserver.disconnect(), this.container = t, this.container.appendChild(this.video), this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = this.store.get().isAutoSized ? "cover" : "contain", this.video.style.backgroundColor = "black", this.updateAspectRatio(), this.resizeObserver = new ResizeObserver((i) => {
560
+ this.resizeObserver && this.resizeObserver.disconnect(), this.container = t, this.container.appendChild(this.video), this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = this.store.get().videoFit, this.video.style.backgroundColor = "black", this.updateAspectRatio(), this.resizeObserver = new ResizeObserver((i) => {
555
561
  for (const o of i)
556
562
  this.emit("resize", { width: o.contentRect.width, height: o.contentRect.height }), this.updateAspectRatio();
557
563
  }), this.resizeObserver.observe(this.container), this.emit("ready");
@@ -565,23 +571,23 @@ Retrying (${this.retryCount}/${this.maxRetries})`
565
571
  switchSource(t) {
566
572
  const i = this.store.get().sources;
567
573
  if (t >= 0 && t < i.length) {
568
- const o = this.video.currentTime, r = !this.video.paused;
574
+ const o = this.video.currentTime, a = !this.video.paused;
569
575
  this.load(i[t], this.trackConfigs);
570
- const h = () => {
571
- this.video.currentTime = o, r && this.video.play(), this.video.removeEventListener("canplay", h);
576
+ const u = () => {
577
+ this.video.currentTime = o, a && this.video.play(), this.video.removeEventListener("canplay", u);
572
578
  };
573
- this.video.addEventListener("canplay", h);
579
+ this.video.addEventListener("canplay", u);
574
580
  }
575
581
  }
576
582
  load(t, i = [], o = !1) {
577
583
  this.retryTimer && clearTimeout(this.retryTimer);
578
- const r = typeof t == "string" ? { url: t, type: "auto" } : t;
579
- o || (this.retryCount = 0, this.store.setState({ error: null }), this.removeNotification("retry")), this.currentSrc = r.url, this.currentSource = r, this.trackConfigs = i;
580
- const u = this.store.get().sources.findIndex((w) => w.url === r.url), f = i.map((w, m) => ({
581
- ...w,
582
- index: m,
584
+ const a = typeof t == "string" ? { url: t, type: "auto" } : t;
585
+ o || (this.retryCount = 0, this.store.setState({ error: null }), this.removeNotification("retry")), this.currentSrc = a.url, this.currentSource = a, this.trackConfigs = i;
586
+ const h = this.store.get().sources.findIndex((v) => v.url === a.url), f = i.map((v, p) => ({
587
+ ...v,
588
+ index: p,
583
589
  status: "idle",
584
- isDefault: !!w.default
590
+ isDefault: !!v.default
585
591
  }));
586
592
  this.store.setState({
587
593
  isBuffering: !0,
@@ -593,19 +599,19 @@ Retrying (${this.retryCount}/${this.maxRetries})`
593
599
  // Reset audio track
594
600
  subtitleTracks: f,
595
601
  currentSubtitle: -1,
596
- currentSourceIndex: u
602
+ currentSourceIndex: h
597
603
  }), this.updateMediaSessionMetadata();
598
- let g = r.type || "auto";
599
- g === "auto" && (r.url.includes(".m3u8") ? g = "hls" : r.url.includes(".mpd") ? g = "dash" : r.url.includes(".flv") || r.url.includes(".ts") ? g = "mpegts" : r.url.startsWith("magnet:") || r.url.includes(".torrent") ? g = "webtorrent" : g = "mp4"), this.events.emit("load", { url: r.url, type: g });
600
- const x = this.video.getElementsByTagName("track");
601
- for (; x.length > 0; )
602
- x[0].remove();
603
- const p = f.findIndex((w) => w.default);
604
- p !== -1 && this.setSubtitle(p), (g === "mp4" || g === "webm" || g === "ogg") && (this.video.src = r.url);
604
+ let x = a.type || "auto";
605
+ x === "auto" && (a.url.includes(".m3u8") ? x = "hls" : a.url.includes(".mpd") ? x = "dash" : a.url.includes(".flv") || a.url.includes(".ts") ? x = "mpegts" : a.url.startsWith("magnet:") || a.url.includes(".torrent") ? x = "webtorrent" : x = "mp4"), this.events.emit("load", { url: a.url, type: x });
606
+ const b = this.video.getElementsByTagName("track");
607
+ for (; b.length > 0; )
608
+ b[0].remove();
609
+ const m = f.findIndex((v) => v.default);
610
+ m !== -1 && this.setSubtitle(m), (x === "mp4" || x === "webm" || x === "ogg") && (this.video.src = a.url);
605
611
  }
606
612
  // Wrapper for external subtitle API
607
613
  loadSubtitle(t, i = "Subtitle") {
608
- const o = this.store.get().subtitleTracks.length, r = {
614
+ const o = this.store.get().subtitleTracks.length, a = {
609
615
  src: t,
610
616
  label: i,
611
617
  srcLang: "user",
@@ -615,26 +621,26 @@ Retrying (${this.retryCount}/${this.maxRetries})`
615
621
  status: "idle",
616
622
  isDefault: !0
617
623
  };
618
- this.store.setState((h) => ({
619
- subtitleTracks: [...h.subtitleTracks, r]
624
+ this.store.setState((u) => ({
625
+ subtitleTracks: [...u.subtitleTracks, a]
620
626
  })), this.setSubtitle(o);
621
627
  }
622
628
  addTextTrack(t, i) {
623
629
  const o = new FileReader();
624
- o.onload = (r) => {
625
- var g;
626
- if (!((g = r.target) != null && g.result)) return;
627
- let h = r.target.result;
628
- h = this.convertToVTT(h);
629
- const u = new Blob([h], { type: "text/vtt" }), f = URL.createObjectURL(u);
630
+ o.onload = (a) => {
631
+ var x;
632
+ if (!((x = a.target) != null && x.result)) return;
633
+ let u = a.target.result;
634
+ u = this.convertToVTT(u);
635
+ const h = new Blob([u], { type: "text/vtt" }), f = URL.createObjectURL(h);
630
636
  this.loadSubtitle(f, i), this.notify({ type: "success", message: "Subtitle uploaded", duration: 3e3 });
631
637
  }, o.onerror = () => {
632
638
  this.notify({ type: "error", message: "Failed to read file", duration: 3e3 });
633
639
  }, o.readAsText(t);
634
640
  }
635
- addTextTrackInternal(t, i, o = "", r = !1) {
636
- const h = document.createElement("track");
637
- h.kind = "subtitles", h.label = i, h.src = t, h.srclang = o, r && (h.default = !0), this.video.appendChild(h);
641
+ addTextTrackInternal(t, i, o = "", a = !1) {
642
+ const u = document.createElement("track");
643
+ u.kind = "subtitles", u.label = i, u.src = t, u.srclang = o, a && (u.default = !0), this.video.appendChild(u);
638
644
  }
639
645
  play() {
640
646
  return this.video.play();
@@ -707,8 +713,8 @@ Retrying (${this.retryCount}/${this.maxRetries})`
707
713
  if (i) {
708
714
  i.drawImage(this.video, 0, 0, t.width, t.height);
709
715
  try {
710
- const o = t.toDataURL("image/png"), r = document.createElement("a");
711
- r.download = `screenshot-${(/* @__PURE__ */ new Date()).toISOString()}.png`, r.href = o, r.click(), this.notify({ type: "success", message: "Screenshot saved", duration: 2e3 });
716
+ const o = t.toDataURL("image/png"), a = document.createElement("a");
717
+ a.download = `screenshot-${(/* @__PURE__ */ new Date()).toISOString()}.png`, a.href = o, a.click(), this.notify({ type: "success", message: "Screenshot saved", duration: 2e3 });
712
718
  } catch {
713
719
  this.notify({ type: "error", message: "Failed to take screenshot", duration: 3e3 });
714
720
  }
@@ -726,26 +732,33 @@ Retrying (${this.retryCount}/${this.maxRetries})`
726
732
  [t]: !i[t]
727
733
  };
728
734
  this.store.setState({ flipState: o });
729
- const r = o.horizontal ? -1 : 1, h = o.vertical ? -1 : 1;
730
- this.video.style.transform = `scale(${r}, ${h})`;
735
+ const a = o.horizontal ? -1 : 1, u = o.vertical ? -1 : 1;
736
+ this.video.style.transform = `scale(${a}, ${u})`;
731
737
  }
732
738
  setAspectRatio(t) {
733
739
  this.store.setState({ aspectRatio: t }), this.updateAspectRatio(), t !== "default" && this.notify({ type: "info", message: `Aspect Ratio: ${t}`, duration: 2e3 });
734
740
  }
741
+ setVideoFit(t) {
742
+ this.store.setState({ videoFit: t }), this.video.style.objectFit = t, this.updateAspectRatio();
743
+ }
744
+ setBrightness(t) {
745
+ const i = Math.max(0, Math.min(t, 2));
746
+ this.store.setState({ brightness: i }), this.video.style.filter = `brightness(${i})`;
747
+ }
735
748
  updateAspectRatio() {
736
749
  if (!this.container) return;
737
- const { aspectRatio: t, isAutoSized: i } = this.store.get();
750
+ const { aspectRatio: t, videoFit: i } = this.store.get();
738
751
  if (t === "default") {
739
- this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = i ? "cover" : "contain";
752
+ this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = i;
740
753
  return;
741
754
  }
742
- const [o, r] = t.split(":").map(Number);
743
- if (!o || !r) return;
744
- const h = o / r, u = this.container.getBoundingClientRect();
745
- if (u.width === 0 || u.height === 0) return;
746
- const f = u.width / u.height;
747
- let g, x;
748
- f > h ? (x = u.height, g = x * h) : (g = u.width, x = g / h), this.video.style.width = `${g}px`, this.video.style.height = `${x}px`, this.video.style.objectFit = "fill";
755
+ const [o, a] = t.split(":").map(Number);
756
+ if (!o || !a) return;
757
+ const u = o / a, h = this.container.getBoundingClientRect();
758
+ if (h.width === 0 || h.height === 0) return;
759
+ const f = h.width / h.height;
760
+ let x, b;
761
+ f > u ? (b = h.height, x = b * u) : (x = h.width, b = x / u), this.video.style.width = `${x}px`, this.video.style.height = `${b}px`, this.video.style.objectFit = "fill";
749
762
  }
750
763
  initCast() {
751
764
  const t = window, i = () => {
@@ -783,10 +796,10 @@ Retrying (${this.retryCount}/${this.maxRetries})`
783
796
  try {
784
797
  const i = t.cast.framework.CastContext.getInstance().getCurrentSession();
785
798
  if (!i) return;
786
- const o = new t.chrome.cast.media.MediaInfo(this.currentSrc, this.currentSrc.includes(".m3u8") ? "application/x-mpegurl" : "video/mp4"), r = new t.chrome.cast.media.LoadRequest(o);
787
- i.loadMedia(r).then(() => {
799
+ const o = new t.chrome.cast.media.MediaInfo(this.currentSrc, this.currentSrc.includes(".m3u8") ? "application/x-mpegurl" : "video/mp4"), a = new t.chrome.cast.media.LoadRequest(o);
800
+ i.loadMedia(a).then(() => {
788
801
  this.notify({ type: "success", message: "Casting...", duration: 3e3 });
789
- }).catch((h) => console.error("Cast load error", h));
802
+ }).catch((u) => console.error("Cast load error", u));
790
803
  } catch (i) {
791
804
  console.error("Failed to load media into Cast session", i);
792
805
  }
@@ -796,66 +809,67 @@ Retrying (${this.retryCount}/${this.maxRetries})`
796
809
  this.store.setState({ activeCues: [] });
797
810
  return;
798
811
  }
799
- const o = Array.from(this.video.textTracks).filter((r) => r.kind === "subtitles" || r.kind === "captions").find((r) => r.mode === "showing" || r.mode === "hidden");
812
+ const o = Array.from(this.video.textTracks).filter((a) => a.kind === "subtitles" || a.kind === "captions").find((a) => a.mode === "showing" || a.mode === "hidden");
800
813
  if (o && o.activeCues) {
801
- const r = Array.from(o.activeCues).map((h) => h.text);
802
- this.store.setState({ activeCues: r });
814
+ const a = Array.from(o.activeCues).map((u) => u.text);
815
+ this.store.setState({ activeCues: a });
803
816
  } else
804
817
  this.store.setState({ activeCues: [] });
805
818
  }
806
819
  async setSubtitle(t) {
807
820
  const o = this.store.get().subtitleTracks[t];
808
- if (Array.from(this.video.textTracks).forEach((u) => {
809
- u.removeEventListener("cuechange", this.boundCueChange), u.mode = "disabled";
821
+ if (Array.from(this.video.textTracks).forEach((h) => {
822
+ h.removeEventListener("cuechange", this.boundCueChange), h.mode = "disabled";
810
823
  }), this.store.setState({ currentSubtitle: t, subtitleOffset: 0, activeCues: [] }), t === -1 || !o) return;
811
824
  if (o.status === "idle" || o.status === "error") {
812
825
  this.updateSubtitleTrackState(t, { status: "loading" });
813
826
  try {
814
827
  let f = await (await this.fetchWithRetry(o.src)).text();
815
828
  f = this.convertToVTT(f);
816
- const g = new Blob([f], { type: "text/vtt" }), x = URL.createObjectURL(g);
817
- this.addTextTrackInternal(x, o.label, o.srcLang, !1), this.updateSubtitleTrackState(t, { status: "success" });
818
- } catch (u) {
819
- this.updateSubtitleTrackState(t, { status: "error" }), console.error("Failed to load subtitle", u);
829
+ const x = new Blob([f], { type: "text/vtt" }), b = URL.createObjectURL(x);
830
+ this.addTextTrackInternal(b, o.label, o.srcLang, !1), this.updateSubtitleTrackState(t, { status: "success" });
831
+ } catch (h) {
832
+ this.updateSubtitleTrackState(t, { status: "error" }), console.error("Failed to load subtitle", h);
820
833
  return;
821
834
  }
822
835
  }
823
- const r = Array.from(this.video.textTracks);
824
- let h = r.find((u) => u.label === o.label && u.language === o.srcLang);
825
- if (h || (h = r.find((u) => u.label === o.label)), h) {
826
- const u = this.store.get().subtitleSettings;
827
- h.mode = u.useNative ? "showing" : "hidden", h.addEventListener("cuechange", this.boundCueChange), this.handleCueChange();
836
+ const a = Array.from(this.video.textTracks);
837
+ let u = a.find((h) => h.label === o.label && h.language === o.srcLang);
838
+ if (u || (u = a.find((h) => h.label === o.label)), u) {
839
+ const h = this.store.get().subtitleSettings;
840
+ u.mode = h.useNative ? "showing" : "hidden", u.addEventListener("cuechange", this.boundCueChange), this.handleCueChange();
828
841
  }
829
842
  }
830
843
  updateSubtitleSettings(t) {
831
844
  const o = { ...this.store.get().subtitleSettings, ...t };
832
845
  if (this.store.setState({ subtitleSettings: o }), t.useNative !== void 0) {
833
- const r = this.store.get().currentSubtitle;
834
- if (r !== -1) {
835
- const u = this.store.get().subtitleTracks[r], f = Array.from(this.video.textTracks).find((g) => g.label === u.label && g.language === u.srcLang);
846
+ const a = this.store.get().currentSubtitle;
847
+ if (a !== -1) {
848
+ const h = this.store.get().subtitleTracks[a], f = Array.from(this.video.textTracks).find((x) => x.label === h.label && x.language === h.srcLang);
836
849
  f && (f.mode = t.useNative ? "showing" : "hidden");
837
850
  }
838
851
  }
839
852
  }
840
853
  resetSubtitleSettings() {
841
- this.store.setState({ subtitleSettings: tt }), this.updateSubtitleSettings({ useNative: !1 });
854
+ this.store.setState({ subtitleSettings: rt }), this.updateSubtitleSettings({ useNative: !1 });
842
855
  }
843
856
  setSubtitleOffset(t) {
844
857
  const i = this.store.get().subtitleOffset, o = t - i;
845
- Math.abs(o) < 1e-3 || (Array.from(this.video.textTracks).forEach((r) => {
846
- (r.mode === "showing" || r.mode === "hidden") && r.cues && Array.from(r.cues).forEach((h) => {
847
- h.startTime += o, h.endTime += o;
858
+ Math.abs(o) < 1e-3 || (Array.from(this.video.textTracks).forEach((a) => {
859
+ (a.mode === "showing" || a.mode === "hidden") && a.cues && Array.from(a.cues).forEach((u) => {
860
+ u.startTime += o, u.endTime += o;
848
861
  });
849
862
  }), this.store.setState({ subtitleOffset: t }), this.notify({ type: "info", message: `Subtitle Offset: ${t > 0 ? "+" : ""}${t.toFixed(1)}s`, duration: 1500 }));
850
863
  }
851
- cancelDownload() {
852
- this.currentDownloadController && (this.currentDownloadController.abort(), this.currentDownloadController = null, this.notify({ type: "info", message: "Download cancelled", duration: 2e3 }));
864
+ cancelDownload(t) {
865
+ var i;
866
+ t && this.activeDownloads.has(t) ? ((i = this.activeDownloads.get(t)) == null || i.abort(), this.activeDownloads.delete(t), this.notify({ type: "info", message: "Download cancelled", duration: 2e3 }), this.removeNotification(t)) : t || this.activeDownloads.size > 0 && (this.activeDownloads.forEach((o) => o.abort()), this.activeDownloads.clear(), this.notify({ type: "info", message: "All downloads cancelled", duration: 2e3 }));
853
867
  }
854
868
  async download(t = {}) {
855
- var h, u, f;
869
+ var h, f, x;
856
870
  const i = ((h = this.currentSource) == null ? void 0 : h.url) || this.video.src;
857
871
  if (!i) return;
858
- if (i.includes(".m3u8") || ((u = this.currentSource) == null ? void 0 : u.type) === "hls") {
872
+ if (i.includes(".m3u8") || ((f = this.currentSource) == null ? void 0 : f.type) === "hls") {
859
873
  this.downloadHls(i, t.format || "ts");
860
874
  return;
861
875
  }
@@ -863,172 +877,186 @@ Retrying (${this.retryCount}/${this.maxRetries})`
863
877
  this.notify({ type: "warning", message: "Stream download not supported in browser.", duration: 4e3 });
864
878
  return;
865
879
  }
866
- this.currentDownloadController && this.currentDownloadController.abort(), this.currentDownloadController = new AbortController();
867
- const o = this.currentDownloadController.signal, r = this.notify({
880
+ const o = Math.random().toString(36).substr(2, 9), a = new AbortController();
881
+ this.activeDownloads.set(o, a);
882
+ const u = a.signal;
883
+ this.notify({
884
+ id: o,
868
885
  type: "loading",
869
886
  message: "Preparing download",
870
- // Removed ...
871
887
  progress: 0,
872
888
  action: {
873
889
  label: "Cancel",
874
- onClick: () => this.cancelDownload()
890
+ onClick: () => this.cancelDownload(o)
875
891
  }
876
892
  });
877
893
  try {
878
- const g = await this.fetchWithRetry(i, 3, void 0, o);
879
- if (!g.body) throw new Error("No body");
880
- const x = g.body.getReader(), p = g.headers.get("Content-Length"), w = p ? parseInt(p, 10) : 0;
881
- let m = 0;
882
- const T = [], I = Date.now(), O = [];
894
+ const b = await this.fetchWithRetry(i, 3, void 0, u);
895
+ if (!b.body) throw new Error("No body");
896
+ const m = b.body.getReader(), v = b.headers.get("Content-Length"), p = v ? parseInt(v, 10) : 0;
897
+ let S = 0;
898
+ const $ = [], U = Date.now(), H = [];
899
+ let q = 0;
883
900
  for (; ; ) {
884
- const { done: H, value: k } = await x.read();
885
- if (H) break;
886
- if (T.push(k), m += k.length, w) {
887
- const q = Date.now(), $ = Math.round(m / w * 100);
888
- for (O.push({ time: q, loaded: m }); O.length > 0 && q - O[0].time > 5e3; )
889
- O.shift();
890
- let j = "", Z = 0;
891
- if (O.length > 1) {
892
- const P = O[0], s = O[O.length - 1], ie = s.time - P.time, ne = s.loaded - P.loaded;
893
- ie > 0 && (Z = ne / ie);
894
- } else {
895
- const P = q - I;
896
- P > 0 && (Z = m / P);
897
- }
898
- if (Z > 0) {
899
- const s = (w - m) / Z;
900
- j = `
901
- ${this.formatDuration(s)} remaining`;
902
- }
903
- this.notify({
904
- id: r,
905
- type: "loading",
906
- // Cleaned string
907
- message: `${j}`,
908
- progress: $,
909
- action: {
910
- label: "Cancel",
911
- onClick: () => this.cancelDownload()
901
+ const { done: fe, value: k } = await m.read();
902
+ if (fe) break;
903
+ if ($.push(k), S += k.length, p) {
904
+ const j = Date.now();
905
+ if (j - q > 800 || S === p) {
906
+ q = j;
907
+ const D = Math.round(S / p * 100);
908
+ for (H.push({ time: j, loaded: S }); H.length > 0 && j - H[0].time > 5e3; )
909
+ H.shift();
910
+ let T = "", n = 0;
911
+ if (H.length > 1) {
912
+ const X = H[0], _ = H[H.length - 1], ne = _.time - X.time, re = _.loaded - X.loaded;
913
+ ne > 0 && (n = re / ne);
914
+ } else {
915
+ const X = j - U;
916
+ X > 0 && (n = S / X);
912
917
  }
913
- });
918
+ if (n > 0) {
919
+ const _ = (p - S) / n;
920
+ T = `
921
+ ${this.formatDuration(_)} remaining`;
922
+ }
923
+ this.notify({
924
+ id: o,
925
+ type: "loading",
926
+ // Cleaned string
927
+ message: `${T}`,
928
+ progress: D,
929
+ action: {
930
+ label: "Cancel",
931
+ onClick: () => this.cancelDownload(o)
932
+ }
933
+ });
934
+ }
914
935
  }
915
936
  }
916
- const Y = new Blob(T), W = window.URL.createObjectURL(Y), b = document.createElement("a");
917
- b.style.display = "none", b.href = W, b.download = ((f = i.split("/").pop()) == null ? void 0 : f.split("?")[0]) || "video.mp4", document.body.appendChild(b), b.click(), window.URL.revokeObjectURL(W), document.body.removeChild(b), this.notify({ id: r, type: "success", message: "Saved!", duration: 3e3 });
937
+ const g = new Blob($), Y = window.URL.createObjectURL(g), G = document.createElement("a");
938
+ G.style.display = "none", G.href = Y, G.download = ((x = i.split("/").pop()) == null ? void 0 : x.split("?")[0]) || "video.mp4", document.body.appendChild(G), G.click(), window.URL.revokeObjectURL(Y), document.body.removeChild(G), this.notify({ id: o, type: "success", message: "Saved!", duration: 3e3 });
918
939
  } catch {
919
- o.aborted ? this.removeNotification(r) : (this.notify({ id: r, type: "error", message: "Download failed.", duration: 4e3 }), window.open(i, "_blank"));
940
+ u.aborted ? this.removeNotification(o) : (this.notify({ id: o, type: "error", message: "Download failed.", duration: 4e3 }), window.open(i, "_blank"));
920
941
  } finally {
921
- this.currentDownloadController = null;
942
+ this.activeDownloads.delete(o);
922
943
  }
923
944
  }
924
945
  async downloadHls(t, i) {
925
946
  var h;
926
- this.currentDownloadController && this.currentDownloadController.abort(), this.currentDownloadController = new AbortController();
927
- const o = this.currentDownloadController.signal, r = this.notify({
947
+ const o = Math.random().toString(36).substr(2, 9), a = new AbortController();
948
+ this.activeDownloads.set(o, a);
949
+ const u = a.signal;
950
+ this.notify({
951
+ id: o,
928
952
  type: "loading",
929
953
  message: "Analyzing HLS stream",
930
- // Removed ...
931
954
  progress: 0,
932
- action: { label: "Cancel", onClick: () => this.cancelDownload() }
955
+ action: { label: "Cancel", onClick: () => this.cancelDownload(o) }
933
956
  });
934
957
  try {
935
- let u = await this.fetchWithRetry(t, 3, void 0, o), f = await u.text(), g = t.substring(0, t.lastIndexOf("/") + 1);
936
- if (f.includes("#EXT-X-STREAM-INF")) {
937
- this.notify({ id: r, type: "loading", message: "Selecting best quality", progress: 0 });
938
- const k = f.split(`
958
+ let f = await this.fetchWithRetry(t, 3, void 0, u), x = await f.text(), b = t.substring(0, t.lastIndexOf("/") + 1);
959
+ if (x.includes("#EXT-X-STREAM-INF")) {
960
+ this.notify({ id: o, type: "loading", message: "Selecting best quality", progress: 0 });
961
+ const k = x.split(`
939
962
  `);
940
- let q = 0, $ = "";
941
- for (let j = 0; j < k.length; j++)
942
- if (k[j].includes("#EXT-X-STREAM-INF")) {
943
- const Z = k[j].match(/BANDWIDTH=(\d+)/);
944
- if (Z) {
945
- const P = parseInt(Z[1]);
946
- let s = (h = k[j + 1]) == null ? void 0 : h.trim();
947
- s && !s.startsWith("#") && P > q && (q = P, $ = s);
963
+ let j = 0, D = "";
964
+ for (let T = 0; T < k.length; T++)
965
+ if (k[T].includes("#EXT-X-STREAM-INF")) {
966
+ const n = k[T].match(/BANDWIDTH=(\d+)/);
967
+ if (n) {
968
+ const X = parseInt(n[1]);
969
+ let _ = (h = k[T + 1]) == null ? void 0 : h.trim();
970
+ _ && !_.startsWith("#") && X > j && (j = X, D = _);
948
971
  }
949
972
  }
950
- $ && ($.startsWith("http") || ($ = g + $), u = await this.fetchWithRetry($, 3, void 0, o), f = await u.text(), g = $.substring(0, $.lastIndexOf("/") + 1));
973
+ D && (D.startsWith("http") || (D = b + D), f = await this.fetchWithRetry(D, 3, void 0, u), x = await f.text(), b = D.substring(0, D.lastIndexOf("/") + 1));
951
974
  }
952
- if (f.includes("#EXT-X-KEY"))
975
+ if (x.includes("#EXT-X-KEY"))
953
976
  throw new Error("Encrypted HLS streams are not supported for download.");
954
- const x = f.split(`
955
- `), p = [];
956
- for (let k of x)
957
- k = k.trim(), k && !k.startsWith("#") && (k.startsWith("http") ? p.push(k) : p.push(g + k));
958
- if (p.length === 0) throw new Error("No segments found.");
959
- let w = i === "mp4" ? "mp4" : "ts", m = i === "mp4" ? "video/mp4" : "video/mp2t", T = null, I = null, O = [];
977
+ const m = x.split(`
978
+ `), v = [];
979
+ for (let k of m)
980
+ k = k.trim(), k && !k.startsWith("#") && (k.startsWith("http") ? v.push(k) : v.push(b + k));
981
+ if (v.length === 0) throw new Error("No segments found.");
982
+ let p = i === "mp4" ? "mp4" : "ts", S = i === "mp4" ? "video/mp4" : "video/mp2t", $ = null, U = null, H = [];
960
983
  if ("showSaveFilePicker" in window)
961
984
  try {
962
- T = await window.showSaveFilePicker({
963
- suggestedName: `video.${w}`,
985
+ $ = await window.showSaveFilePicker({
986
+ suggestedName: `video.${p}`,
964
987
  types: [{
965
988
  description: i === "mp4" ? "MPEG-4 Video" : "MPEG Transport Stream",
966
- accept: { [m]: [`.${w}`] }
989
+ accept: { [S]: [`.${p}`] }
967
990
  }]
968
- }), I = await T.createWritable();
991
+ }), U = await $.createWritable();
969
992
  } catch (k) {
970
993
  if (k.name === "AbortError") {
971
- this.removeNotification(r), this.notify({ type: "info", message: "Download cancelled", duration: 2e3 }), this.currentDownloadController = null;
994
+ this.removeNotification(o), this.notify({ type: "info", message: "Download cancelled", duration: 2e3 }), this.activeDownloads.delete(o);
972
995
  return;
973
996
  }
974
997
  console.warn("File System API cancelled or failed, falling back to memory", k);
975
998
  }
976
- let W = !1;
977
- const b = Date.now(), H = [];
978
- for (let k = 0; k < p.length && !o.aborted; k++) {
979
- const q = Math.round((k + 1) / p.length * 100), $ = Date.now();
980
- for (H.push({ time: $, count: k + 1 }); H.length > 0 && $ - H[0].time > 5e3; )
981
- H.shift();
982
- let j = "";
983
- if (H.length > 1) {
984
- const ie = H[0], ne = H[H.length - 1], le = ne.time - ie.time, ce = ne.count - ie.count;
985
- if (le > 0 && ce > 0) {
986
- const Se = le / ce, Ce = (p.length - (k + 1)) * Se;
987
- j = `
988
- ${this.formatDuration(Ce)} remaining`;
999
+ let g = !1;
1000
+ const Y = Date.now(), G = [];
1001
+ let fe = 0;
1002
+ for (let k = 0; k < v.length && !u.aborted; k++) {
1003
+ const j = Date.now();
1004
+ if (j - fe > 800 || k === 0 || k === v.length - 1) {
1005
+ fe = j;
1006
+ const X = Math.round((k + 1) / v.length * 100);
1007
+ for (G.push({ time: j, count: k + 1 }); G.length > 0 && j - G[0].time > 5e3; )
1008
+ G.shift();
1009
+ let _ = "";
1010
+ if (G.length > 1) {
1011
+ const ne = G[0], re = G[G.length - 1], be = re.time - ne.time, ge = re.count - ne.count;
1012
+ if (be > 0 && ge > 0) {
1013
+ const Te = be / ge, je = (v.length - (k + 1)) * Te;
1014
+ _ = `
1015
+ ${this.formatDuration(je)} remaining`;
1016
+ }
1017
+ } else if (k > 0) {
1018
+ const re = (j - Y) / k, ge = (v.length - k) * re;
1019
+ _ = `
1020
+ ${this.formatDuration(ge)} remaining`;
989
1021
  }
990
- } else if (k > 0) {
991
- const ne = ($ - b) / k, ce = (p.length - k) * ne;
992
- j = `
993
- ${this.formatDuration(ce)} remaining`;
1022
+ this.notify({
1023
+ id: o,
1024
+ type: "loading",
1025
+ // Cleaned string
1026
+ message: `Downloading segment ${k + 1}/${v.length}${_}`,
1027
+ progress: X,
1028
+ action: { label: "Cancel", onClick: () => this.cancelDownload(o) }
1029
+ });
994
1030
  }
995
- this.notify({
996
- id: r,
997
- type: "loading",
998
- // Cleaned string
999
- message: `Downloading segment ${k + 1}/${p.length}${j}`,
1000
- progress: q,
1001
- action: { label: "Cancel", onClick: () => this.cancelDownload() }
1002
- });
1003
- const P = await (await this.fetchWithRetry(p[k], 3, void 0, o)).arrayBuffer();
1004
- k === 0 && new Uint8Array(P.slice(0, 4))[0] === 71 && (W = !0, i === "mp4" && (this.notify({
1031
+ const T = await (await this.fetchWithRetry(v[k], 3, void 0, u)).arrayBuffer();
1032
+ k === 0 && new Uint8Array(T.slice(0, 4))[0] === 71 && (g = !0, i === "mp4" && (this.notify({
1005
1033
  type: "info",
1006
1034
  message: "Stream is MPEG-TS. Downloading as .ts to prevent corruption.",
1007
1035
  duration: 5e3
1008
- }), w = "ts", m = "video/mp2t"));
1009
- const s = new Blob([P]);
1010
- I ? await I.write(s) : O.push(s);
1036
+ }), p = "ts", S = "video/mp2t"));
1037
+ const n = new Blob([T]);
1038
+ U ? await U.write(n) : H.push(n);
1011
1039
  }
1012
- if (o.aborted)
1013
- throw I && await I.abort(), new Error("Aborted");
1014
- if (I)
1015
- await I.close(), this.notify({ id: r, type: "success", message: "Download complete!", duration: 3e3 });
1040
+ if (u.aborted)
1041
+ throw U && await U.abort(), new Error("Aborted");
1042
+ if (U)
1043
+ await U.close(), this.notify({ id: o, type: "success", message: "Download complete!", duration: 3e3 });
1016
1044
  else {
1017
- this.notify({ id: r, type: "loading", message: "Stitching video", progress: 100 });
1018
- const k = new Blob(O, { type: m }), q = window.URL.createObjectURL(k), $ = document.createElement("a");
1019
- $.style.display = "none", $.href = q;
1020
- const j = i === "mp4" && W ? "ts" : w;
1021
- $.download = `video.${j}`, document.body.appendChild($), $.click(), window.URL.revokeObjectURL(q), document.body.removeChild($), this.notify({ id: r, type: "success", message: "Saved!", duration: 3e3 });
1045
+ this.notify({ id: o, type: "loading", message: "Stitching video", progress: 100 });
1046
+ const k = new Blob(H, { type: S }), j = window.URL.createObjectURL(k), D = document.createElement("a");
1047
+ D.style.display = "none", D.href = j;
1048
+ const T = i === "mp4" && g ? "ts" : p;
1049
+ D.download = `video.${T}`, document.body.appendChild(D), D.click(), window.URL.revokeObjectURL(j), document.body.removeChild(D), this.notify({ id: o, type: "success", message: "Saved!", duration: 3e3 });
1022
1050
  }
1023
- } catch (u) {
1024
- o.aborted ? this.removeNotification(r) : this.notify({ id: r, type: "error", message: `Download failed: ${u.message}`, duration: 4e3 });
1051
+ } catch (f) {
1052
+ u.aborted ? this.removeNotification(o) : this.notify({ id: o, type: "error", message: `Download failed: ${f.message}`, duration: 4e3 });
1025
1053
  } finally {
1026
- this.currentDownloadController = null;
1054
+ this.activeDownloads.delete(o);
1027
1055
  }
1028
1056
  }
1029
1057
  notify(t) {
1030
1058
  const i = t.id || Math.random().toString(36).substr(2, 9), o = { ...t, id: i };
1031
- return this.store.setState((r) => r.notifications.find((u) => u.id === i) ? { notifications: r.notifications.map((u) => u.id === i ? o : u) } : { notifications: [...r.notifications, o] }), t.duration && setTimeout(() => this.removeNotification(i), t.duration), i;
1059
+ return this.store.setState((a) => a.notifications.find((h) => h.id === i) ? { notifications: a.notifications.map((h) => h.id === i ? o : h) } : { notifications: [...a.notifications, o] }), t.duration && setTimeout(() => this.removeNotification(i), t.duration), i;
1032
1060
  }
1033
1061
  removeNotification(t) {
1034
1062
  const i = this.store.get().notifications;
@@ -1041,112 +1069,112 @@ ${this.formatDuration(ce)} remaining`;
1041
1069
  }));
1042
1070
  }
1043
1071
  destroy() {
1044
- this.retryTimer && clearTimeout(this.retryTimer), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.currentDownloadController && this.currentDownloadController.abort(), this.store.get().isWebFullscreen && typeof document < "u" && (document.body.style.overflow = ""), document.removeEventListener("fullscreenchange", this.boundFullscreenChange), this.video.pause(), this.video.src = "";
1072
+ this.retryTimer && clearTimeout(this.retryTimer), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.activeDownloads.forEach((i) => i.abort()), this.activeDownloads.clear(), this.store.get().isWebFullscreen && typeof document < "u" && (document.body.style.overflow = ""), document.removeEventListener("fullscreenchange", this.boundFullscreenChange), this.video.pause(), this.video.src = "";
1045
1073
  const t = this.video.getElementsByTagName("track");
1046
1074
  for (; t.length > 0; ) t[0].remove();
1047
1075
  this.emit("destroy"), this.events.destroy(), this.store.destroy(), this.plugins.forEach((i) => i.destroy && i.destroy()), this.plugins.clear(), this.video.remove(), this.audioEngine.destroy();
1048
1076
  }
1049
1077
  }
1050
- const Ke = (n, t = 200) => {
1051
- const [i, o] = N(n), [r, h] = N(!1);
1052
- return Q(() => {
1053
- if (n)
1078
+ const st = (s, t = 200) => {
1079
+ const [i, o] = M(s), [a, u] = M(!1);
1080
+ return ee(() => {
1081
+ if (s)
1054
1082
  o(!0), requestAnimationFrame(() => {
1055
1083
  requestAnimationFrame(() => {
1056
- h(!0);
1084
+ u(!0);
1057
1085
  });
1058
1086
  });
1059
1087
  else {
1060
- h(!1);
1061
- const u = setTimeout(() => {
1088
+ u(!1);
1089
+ const h = setTimeout(() => {
1062
1090
  o(!1);
1063
1091
  }, t);
1064
- return () => clearTimeout(u);
1092
+ return () => clearTimeout(h);
1065
1093
  }
1066
- }, [n, t]), { isMounted: i, isVisible: r };
1094
+ }, [s, t]), { isMounted: i, isVisible: a };
1067
1095
  }, y = ({
1068
- className: n,
1096
+ className: s,
1069
1097
  children: t,
1070
1098
  fill: i = "none",
1071
1099
  strokeWidth: o = 2,
1072
- viewBox: r = "0 0 24 24"
1100
+ viewBox: a = "0 0 24 24"
1073
1101
  }) => /* @__PURE__ */ e(
1074
1102
  "svg",
1075
1103
  {
1076
1104
  xmlns: "http://www.w3.org/2000/svg",
1077
- viewBox: r,
1105
+ viewBox: a,
1078
1106
  fill: i,
1079
1107
  stroke: "currentColor",
1080
1108
  strokeWidth: o,
1081
1109
  strokeLinecap: "round",
1082
1110
  strokeLinejoin: "round",
1083
- className: n,
1111
+ className: s,
1084
1112
  children: t
1085
1113
  }
1086
- ), Et = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("polygon", { points: "5 3 19 12 5 21 5 3" }) }), Ft = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1114
+ ), Ht = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("polygon", { points: "5 3 19 12 5 21 5 3" }) }), Wt = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1087
1115
  /* @__PURE__ */ e("rect", { width: "4", height: "16", x: "6", y: "4", rx: "1" }),
1088
1116
  /* @__PURE__ */ e("rect", { width: "4", height: "16", x: "14", y: "4", rx: "1" })
1089
- ] }), Mi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1117
+ ] }), jt = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1090
1118
  /* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1091
1119
  /* @__PURE__ */ e("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
1092
1120
  /* @__PURE__ */ e("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
1093
- ] }), Ti = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1121
+ ] }), Ei = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1094
1122
  /* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1095
1123
  /* @__PURE__ */ e("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
1096
- ] }), zi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1124
+ ] }), Ut = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1097
1125
  /* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1098
1126
  /* @__PURE__ */ e("line", { x1: "23", x2: "17", y1: "9", y2: "15" }),
1099
1127
  /* @__PURE__ */ e("line", { x1: "17", x2: "23", y1: "9", y2: "15" })
1100
- ] }), Ii = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1128
+ ] }), Ai = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1101
1129
  /* @__PURE__ */ e("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
1102
1130
  /* @__PURE__ */ e("path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
1103
1131
  /* @__PURE__ */ e("path", { d: "M3 16v3a2 2 0 0 0 2 2h3" }),
1104
1132
  /* @__PURE__ */ e("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
1105
- ] }), Ri = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1133
+ ] }), Vi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1106
1134
  /* @__PURE__ */ e("path", { d: "M8 3v3a2 2 0 0 1-2 2H3" }),
1107
1135
  /* @__PURE__ */ e("path", { d: "M21 8h-3a2 2 0 0 1-2-2V3" }),
1108
1136
  /* @__PURE__ */ e("path", { d: "M3 16h3a2 2 0 0 1 2 2v3" }),
1109
1137
  /* @__PURE__ */ e("path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" })
1110
- ] }), Pi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1138
+ ] }), Bi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1111
1139
  /* @__PURE__ */ e("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.47a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
1112
1140
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
1113
- ] }), Be = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" }) }), Li = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1141
+ ] }), He = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" }) }), Di = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1114
1142
  /* @__PURE__ */ e("path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" }),
1115
1143
  /* @__PURE__ */ e("rect", { x: "12", y: "13", width: "10", height: "7", rx: "2" })
1116
- ] }), $i = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1144
+ ] }), Oi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1117
1145
  /* @__PURE__ */ e("rect", { width: "18", height: "14", x: "3", y: "5", rx: "2", ry: "2" }),
1118
1146
  /* @__PURE__ */ e("path", { d: "M7 15h4" }),
1119
1147
  /* @__PURE__ */ e("path", { d: "M15 15h2" }),
1120
1148
  /* @__PURE__ */ e("path", { d: "M7 11h2" }),
1121
1149
  /* @__PURE__ */ e("path", { d: "M13 11h4" })
1122
- ] }), Ze = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1150
+ ] }), ot = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1123
1151
  /* @__PURE__ */ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1124
1152
  /* @__PURE__ */ e("polyline", { points: "7 10 12 15 17 10" }),
1125
1153
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
1126
- ] }), Ei = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1154
+ ] }), Hi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1127
1155
  /* @__PURE__ */ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1128
1156
  /* @__PURE__ */ e("polyline", { points: "17 8 12 3 7 8" }),
1129
1157
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
1130
- ] }), Fi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1158
+ ] }), Wi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1131
1159
  /* @__PURE__ */ e("path", { d: "m12 19-7-7 7-7" }),
1132
1160
  /* @__PURE__ */ e("path", { d: "M19 12H5" })
1133
- ] }), Fe = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }), Ai = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1161
+ ] }), De = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }), ji = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1134
1162
  /* @__PURE__ */ e("path", { d: "M2 16.1A5 5 0 0 1 5.9 20" }),
1135
1163
  /* @__PURE__ */ e("path", { d: "M2 12.05A9 9 0 0 1 9.95 20" }),
1136
1164
  /* @__PURE__ */ e("path", { d: "M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6" }),
1137
1165
  /* @__PURE__ */ e("line", { x1: "2", x2: "2.01", y1: "20", y2: "20" })
1138
- ] }), Bi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1166
+ ] }), Ui = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1139
1167
  /* @__PURE__ */ e("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
1140
1168
  /* @__PURE__ */ e("circle", { cx: "9", cy: "7", r: "4" }),
1141
1169
  /* @__PURE__ */ e("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }),
1142
1170
  /* @__PURE__ */ e("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
1143
- ] }), Vi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1171
+ ] }), Gi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1144
1172
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1145
1173
  /* @__PURE__ */ e("polyline", { points: "12 6 12 12 16 14" })
1146
- ] }), Di = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("path", { d: "M5 12h14" }) }), Oi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1174
+ ] }), _i = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("path", { d: "M5 12h14" }) }), qi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1147
1175
  /* @__PURE__ */ e("path", { d: "M5 12h14" }),
1148
1176
  /* @__PURE__ */ e("path", { d: "M12 5v14" })
1149
- ] }), jt = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1177
+ ] }), Zt = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1150
1178
  /* @__PURE__ */ e("path", { d: "M4 21v-7" }),
1151
1179
  /* @__PURE__ */ e("path", { d: "M4 10V3" }),
1152
1180
  /* @__PURE__ */ e("path", { d: "M12 21v-9" }),
@@ -1156,122 +1184,136 @@ const Ke = (n, t = 200) => {
1156
1184
  /* @__PURE__ */ e("path", { d: "M1 14h6" }),
1157
1185
  /* @__PURE__ */ e("path", { d: "M9 8h6" }),
1158
1186
  /* @__PURE__ */ e("path", { d: "M17 16h6" })
1159
- ] }), Hi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1187
+ ] }), Xi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1160
1188
  /* @__PURE__ */ e("polyline", { points: "4 7 4 4 20 4 20 7" }),
1161
1189
  /* @__PURE__ */ e("line", { x1: "9", x2: "15", y1: "20", y2: "20" }),
1162
1190
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "4", y2: "20" })
1163
- ] }), Ut = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1191
+ ] }), ei = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1164
1192
  /* @__PURE__ */ e("circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor" }),
1165
1193
  /* @__PURE__ */ e("circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor" }),
1166
1194
  /* @__PURE__ */ e("circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor" }),
1167
1195
  /* @__PURE__ */ e("circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor" }),
1168
1196
  /* @__PURE__ */ e("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" })
1169
- ] }), Wi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1197
+ ] }), Qi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1170
1198
  /* @__PURE__ */ e("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
1171
1199
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
1172
- ] }), ji = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1200
+ ] }), Yi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1173
1201
  /* @__PURE__ */ e("polyline", { points: "8 18 12 22 16 18" }),
1174
1202
  /* @__PURE__ */ e("polyline", { points: "8 6 12 2 16 6" }),
1175
1203
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "2", y2: "22" })
1176
- ] }), Ui = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1204
+ ] }), Ji = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1177
1205
  /* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
1178
1206
  /* @__PURE__ */ e("path", { d: "M3 3v5h5" })
1179
- ] }), Gi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1207
+ ] }), Ki = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1180
1208
  /* @__PURE__ */ e("path", { d: "M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" }),
1181
1209
  /* @__PURE__ */ e("path", { d: "M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" })
1182
- ] }), _i = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1210
+ ] }), Zi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1183
1211
  /* @__PURE__ */ e("path", { d: "m3 17 4-10 4 10" }),
1184
1212
  /* @__PURE__ */ e("path", { d: "M4 13h6" }),
1185
1213
  /* @__PURE__ */ e("path", { d: "M15 12h4.5a2.5 2.5 0 0 1 0 5H15V7h4a2.5 2.5 0 0 1 0 5h-4" })
1186
- ] }), qi = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("path", { d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z" }) }), Xi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1214
+ ] }), es = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("path", { d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z" }) }), ts = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1187
1215
  /* @__PURE__ */ e("path", { d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z" }),
1188
1216
  /* @__PURE__ */ e("circle", { cx: "12", cy: "13", r: "3" })
1189
- ] }), Qi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1217
+ ] }), is = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1190
1218
  /* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
1191
1219
  /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
1192
- ] }), Ji = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1220
+ ] }), ss = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1193
1221
  /* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
1194
1222
  /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })
1195
- ] }), Ki = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1223
+ ] }), ns = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1196
1224
  /* @__PURE__ */ e("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
1197
1225
  /* @__PURE__ */ e("line", { x1: "8", x2: "16", y1: "21", y2: "21" }),
1198
1226
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
1199
- ] }), Yi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1227
+ ] }), os = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1200
1228
  /* @__PURE__ */ e("polygon", { points: "13 19 22 12 13 5 13 19" }),
1201
1229
  /* @__PURE__ */ e("polygon", { points: "2 19 11 12 2 5 2 19" })
1202
- ] }), Gt = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1230
+ ] }), ti = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1203
1231
  /* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
1204
1232
  /* @__PURE__ */ e("path", { d: "m6 6 12 12" })
1205
- ] }), Zi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1233
+ ] }), as = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1206
1234
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1207
1235
  /* @__PURE__ */ e("path", { d: "M12 16v-4" }),
1208
1236
  /* @__PURE__ */ e("path", { d: "M12 8h.01" })
1209
- ] }), en = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1237
+ ] }), rs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1210
1238
  /* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2" }),
1211
1239
  /* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2" }),
1212
1240
  /* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "6", y2: "6" }),
1213
1241
  /* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "18", y2: "18" })
1214
- ] }), tn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1242
+ ] }), ls = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1215
1243
  /* @__PURE__ */ e("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }),
1216
1244
  /* @__PURE__ */ e("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })
1217
- ] }), nn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1245
+ ] }), cs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1218
1246
  /* @__PURE__ */ e("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2" }),
1219
1247
  /* @__PURE__ */ e("circle", { cx: "12", cy: "14", r: "4" }),
1220
1248
  /* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "6", y2: "6" })
1221
- ] }), sn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1249
+ ] }), ds = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1222
1250
  /* @__PURE__ */ e("path", { d: "m12 14 4-4" }),
1223
1251
  /* @__PURE__ */ e("path", { d: "M3.34 19a10 10 0 1 1 17.32 0" })
1224
- ] }), on = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1252
+ ] }), us = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1225
1253
  /* @__PURE__ */ e("path", { d: "M9 18V5l12-2v13" }),
1226
1254
  /* @__PURE__ */ e("circle", { cx: "6", cy: "18", r: "3" }),
1227
1255
  /* @__PURE__ */ e("circle", { cx: "18", cy: "16", r: "3" })
1228
- ] }), rn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1256
+ ] }), hs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1229
1257
  /* @__PURE__ */ e("path", { d: "M5 12.55a11 11 0 0 1 14.08 0" }),
1230
1258
  /* @__PURE__ */ e("path", { d: "M1.42 9a16 16 0 0 1 21.16 0" }),
1231
1259
  /* @__PURE__ */ e("path", { d: "M8.53 16.11a6 6 0 0 1 6.95 0" }),
1232
1260
  /* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "20", y2: "20" })
1233
- ] }), et = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1261
+ ] }), at = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1234
1262
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1235
1263
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "8", y2: "12" }),
1236
1264
  /* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "16", y2: "16" })
1237
- ] }), an = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1265
+ ] }), ms = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1238
1266
  /* @__PURE__ */ e("path", { d: "M2 20h.01" }),
1239
1267
  /* @__PURE__ */ e("path", { d: "M7 20v-4" }),
1240
1268
  /* @__PURE__ */ e("path", { d: "M12 20v-8" }),
1241
1269
  /* @__PURE__ */ e("path", { d: "M17 20V8" }),
1242
1270
  /* @__PURE__ */ e("path", { d: "M22 20V4" })
1243
- ] }), ln = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1271
+ ] }), ps = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1244
1272
  /* @__PURE__ */ e("path", { d: "M21 7v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
1245
1273
  /* @__PURE__ */ e("path", { d: "M16 2v4" }),
1246
1274
  /* @__PURE__ */ e("path", { d: "M8 2v4" }),
1247
1275
  /* @__PURE__ */ e("path", { d: "M3 12h18" })
1248
- ] }), cn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1276
+ ] }), fs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1249
1277
  /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "8" }),
1250
1278
  /* @__PURE__ */ e("path", { d: "m21 21-4.3-4.3" })
1251
- ] }), _t = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1279
+ ] }), ii = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1252
1280
  /* @__PURE__ */ e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
1253
1281
  /* @__PURE__ */ e("polyline", { points: "14 2 14 8 20 8" }),
1254
1282
  /* @__PURE__ */ e("path", { d: "m9 15 2 2 4-4" })
1255
- ] }), dn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1283
+ ] }), bs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1256
1284
  /* @__PURE__ */ e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
1257
1285
  /* @__PURE__ */ e("polyline", { points: "14 2 14 8 20 8" }),
1258
1286
  /* @__PURE__ */ e("path", { d: "M12 18h.01" }),
1259
1287
  /* @__PURE__ */ e("path", { d: "M12 12v4" })
1260
- ] }), At = ({ className: n }) => /* @__PURE__ */ d("div", { className: `relative flex items-center justify-center ${n}`, children: [
1261
- /* @__PURE__ */ d(y, { className: "w-full h-full", children: [
1288
+ ] }), Gt = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1289
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "5" }),
1290
+ /* @__PURE__ */ e("path", { d: "M12 1v2" }),
1291
+ /* @__PURE__ */ e("path", { d: "M12 21v2" }),
1292
+ /* @__PURE__ */ e("path", { d: "M4.22 4.22l1.42 1.42" }),
1293
+ /* @__PURE__ */ e("path", { d: "M18.36 18.36l1.42 1.42" }),
1294
+ /* @__PURE__ */ e("path", { d: "M1 12h2" }),
1295
+ /* @__PURE__ */ e("path", { d: "M21 12h2" }),
1296
+ /* @__PURE__ */ e("path", { d: "M4.22 19.78l1.42-1.42" }),
1297
+ /* @__PURE__ */ e("path", { d: "M18.36 5.64l1.42-1.42" })
1298
+ ] }), gs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
1299
+ /* @__PURE__ */ e("rect", { width: "18", height: "7", x: "3", y: "3", rx: "1" }),
1300
+ /* @__PURE__ */ e("rect", { width: "9", height: "7", x: "3", y: "14", rx: "1" }),
1301
+ /* @__PURE__ */ e("rect", { width: "5", height: "7", x: "16", y: "14", rx: "1" })
1302
+ ] }), _t = ({ className: s }) => /* @__PURE__ */ c("div", { className: `relative flex items-center justify-center ${s}`, children: [
1303
+ /* @__PURE__ */ c(y, { className: "w-full h-full", children: [
1262
1304
  /* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
1263
1305
  /* @__PURE__ */ e("path", { d: "M3 3v5h5" })
1264
1306
  ] }),
1265
1307
  /* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
1266
- ] }), Bt = ({ className: n }) => /* @__PURE__ */ d("div", { className: `relative flex items-center justify-center ${n}`, children: [
1267
- /* @__PURE__ */ d(y, { className: "w-full h-full", children: [
1308
+ ] }), qt = ({ className: s }) => /* @__PURE__ */ c("div", { className: `relative flex items-center justify-center ${s}`, children: [
1309
+ /* @__PURE__ */ c(y, { className: "w-full h-full", children: [
1268
1310
  /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1269
1311
  /* @__PURE__ */ e("path", { d: "M21 3v5h-5" })
1270
1312
  ] }),
1271
1313
  /* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
1272
- ] }), un = ({
1273
- notifications: n
1274
- }) => /* @__PURE__ */ e("div", { className: "absolute top-4 left-4 z-[100] flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[280px]", children: n.map((t) => {
1314
+ ] }), vs = ({
1315
+ notifications: s
1316
+ }) => /* @__PURE__ */ e("div", { className: "absolute top-4 left-4 z-[100] flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[280px]", children: s.map((t) => {
1275
1317
  const i = typeof t.progress == "number";
1276
1318
  return /* @__PURE__ */ e(
1277
1319
  "div",
@@ -1282,12 +1324,12 @@ const Ke = (n, t = 200) => {
1282
1324
  ${i ? "w-64" : "w-auto max-w-full px-3 py-2.5"}
1283
1325
  `,
1284
1326
  style: { borderRadius: "var(--radius)" },
1285
- children: i ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ d("div", { className: "flex items-start gap-3", children: [
1286
- /* @__PURE__ */ e("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center text-[var(--accent)] shrink-0", children: /* @__PURE__ */ e(Ze, { className: "w-3.5 h-3.5" }) }),
1287
- /* @__PURE__ */ d("div", { className: "flex-1 min-w-0 pt-0.5", children: [
1288
- /* @__PURE__ */ d("div", { className: "flex justify-between items-baseline mb-1", children: [
1327
+ children: i ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
1328
+ /* @__PURE__ */ e("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center text-[var(--accent)] shrink-0", children: /* @__PURE__ */ e(ot, { className: "w-3.5 h-3.5" }) }),
1329
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0 pt-0.5", children: [
1330
+ /* @__PURE__ */ c("div", { className: "flex justify-between items-baseline mb-1", children: [
1289
1331
  /* @__PURE__ */ e("span", { className: "text-xs font-bold text-white tracking-tight", children: "Downloading" }),
1290
- /* @__PURE__ */ d("span", { className: "text-[10px] font-mono text-zinc-400", children: [
1332
+ /* @__PURE__ */ c("span", { className: "text-[10px] font-mono text-zinc-400", children: [
1291
1333
  t.progress,
1292
1334
  "%"
1293
1335
  ] })
@@ -1305,28 +1347,28 @@ const Ke = (n, t = 200) => {
1305
1347
  "button",
1306
1348
  {
1307
1349
  onClick: (o) => {
1308
- var r;
1309
- o.stopPropagation(), (r = t.action) == null || r.onClick();
1350
+ var a;
1351
+ o.stopPropagation(), (a = t.action) == null || a.onClick();
1310
1352
  },
1311
1353
  className: "text-zinc-500 hover:text-zinc-200 transition-colors p-1 -mt-1.5 -mr-1.5",
1312
1354
  title: t.action.label,
1313
- children: /* @__PURE__ */ e(Gt, { className: "w-3.5 h-3.5" })
1355
+ children: /* @__PURE__ */ e(ti, { className: "w-3.5 h-3.5" })
1314
1356
  }
1315
1357
  )
1316
- ] }) }) : /* @__PURE__ */ d("div", { className: "flex items-start gap-2.5", children: [
1317
- t.type === "loading" && /* @__PURE__ */ e(Fe, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)] shrink-0 mt-0.5" }),
1318
- t.type === "success" && /* @__PURE__ */ e(Be, { className: "w-3.5 h-3.5 text-emerald-500 shrink-0 mt-0.5" }),
1319
- t.type === "error" && /* @__PURE__ */ e(et, { className: "w-3.5 h-3.5 text-red-500 shrink-0 mt-0.5" }),
1320
- t.type === "warning" && /* @__PURE__ */ e(et, { className: "w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5" }),
1358
+ ] }) }) : /* @__PURE__ */ c("div", { className: "flex items-start gap-2.5", children: [
1359
+ t.type === "loading" && /* @__PURE__ */ e(De, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)] shrink-0 mt-0.5" }),
1360
+ t.type === "success" && /* @__PURE__ */ e(He, { className: "w-3.5 h-3.5 text-emerald-500 shrink-0 mt-0.5" }),
1361
+ t.type === "error" && /* @__PURE__ */ e(at, { className: "w-3.5 h-3.5 text-red-500 shrink-0 mt-0.5" }),
1362
+ t.type === "warning" && /* @__PURE__ */ e(at, { className: "w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5" }),
1321
1363
  t.type === "info" && /* @__PURE__ */ e("div", { className: "w-1.5 h-1.5 rounded-full bg-[var(--accent)] mt-1.5 shrink-0" }),
1322
- /* @__PURE__ */ d("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
1364
+ /* @__PURE__ */ c("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
1323
1365
  /* @__PURE__ */ e("span", { className: "text-xs font-medium leading-snug break-words text-zinc-200 whitespace-pre-wrap", children: t.message }),
1324
1366
  t.action && /* @__PURE__ */ e(
1325
1367
  "button",
1326
1368
  {
1327
1369
  onClick: (o) => {
1328
- var r;
1329
- o.stopPropagation(), (r = t.action) == null || r.onClick();
1370
+ var a;
1371
+ o.stopPropagation(), (a = t.action) == null || a.onClick();
1330
1372
  },
1331
1373
  className: "mt-1 self-start text-[10px] font-bold text-[var(--accent)] hover:text-white transition-colors uppercase tracking-wider",
1332
1374
  children: t.action.label
@@ -1337,11 +1379,11 @@ const Ke = (n, t = 200) => {
1337
1379
  },
1338
1380
  t.id
1339
1381
  );
1340
- }) }), hn = ({
1341
- cues: n,
1382
+ }) }), xs = ({
1383
+ cues: s,
1342
1384
  settings: t
1343
1385
  }) => {
1344
- if (t.useNative || n.length === 0) return null;
1386
+ if (t.useNative || s.length === 0) return null;
1345
1387
  const i = () => {
1346
1388
  switch (t.textStyle) {
1347
1389
  case "outline":
@@ -1359,11 +1401,11 @@ const Ke = (n, t = 200) => {
1359
1401
  return /* @__PURE__ */ e(
1360
1402
  "div",
1361
1403
  {
1362
- className: "absolute inset-x-0 flex flex-col items-center justify-end text-center z-10 pointer-events-none transition-all duration-200",
1404
+ className: "absolute inset-x-0 flex flex-col items-center justify-end text-center z-10 pointer-events-none transition-all duration-200 strata-subtitle-overlay",
1363
1405
  style: {
1364
1406
  bottom: `${t.verticalOffset}px`
1365
1407
  },
1366
- children: n.map((o, r) => /* @__PURE__ */ e(
1408
+ children: s.map((o, a) => /* @__PURE__ */ e(
1367
1409
  "div",
1368
1410
  {
1369
1411
  className: "mb-1 inline-block max-w-[80%]",
@@ -1388,21 +1430,21 @@ const Ke = (n, t = 200) => {
1388
1430
  }
1389
1431
  )
1390
1432
  },
1391
- r
1433
+ a
1392
1434
  ))
1393
1435
  }
1394
1436
  );
1395
- }, Ae = ({ content: n }) => typeof n == "string" ? n.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ e("span", { children: n }) : /* @__PURE__ */ e(_, { children: n }), oe = ({ label: n, checked: t, onChange: i, icon: o, tooltip: r }) => /* @__PURE__ */ d(
1437
+ }, Oe = ({ content: s }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("span", { children: s }) : /* @__PURE__ */ e(Q, { children: s }), le = ({ label: s, checked: t, onChange: i, icon: o, tooltip: a }) => /* @__PURE__ */ c(
1396
1438
  "div",
1397
1439
  {
1398
1440
  className: "flex items-center justify-between py-2.5 px-3 hover:bg-white/5 group transition-colors",
1399
1441
  style: { borderRadius: "var(--radius)" },
1400
1442
  children: [
1401
- /* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
1402
- o && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Ae, { content: o }) }),
1403
- /* @__PURE__ */ d("div", { className: "flex flex-col", children: [
1404
- /* @__PURE__ */ e("span", { className: "text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center", children: /* @__PURE__ */ e(Ae, { content: n }) }),
1405
- r && /* @__PURE__ */ e("span", { className: "text-[10px] text-zinc-500", children: r })
1443
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-3", children: [
1444
+ o && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Oe, { content: o }) }),
1445
+ /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
1446
+ /* @__PURE__ */ e("span", { className: "text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center", children: /* @__PURE__ */ e(Oe, { content: s }) }),
1447
+ a && /* @__PURE__ */ e("span", { className: "text-[10px] text-zinc-500", children: a })
1406
1448
  ] })
1407
1449
  ] }),
1408
1450
  /* @__PURE__ */ e(
@@ -1430,36 +1472,36 @@ const Ke = (n, t = 200) => {
1430
1472
  )
1431
1473
  ]
1432
1474
  }
1433
- ), we = ({ label: n, value: t, min: i, max: o, step: r, onChange: h, formatValue: u, icon: f }) => /* @__PURE__ */ d(
1475
+ ), xe = ({ label: s, value: t, min: i, max: o, step: a, onChange: u, formatValue: h, icon: f }) => /* @__PURE__ */ c(
1434
1476
  "div",
1435
1477
  {
1436
1478
  className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
1437
1479
  style: { borderRadius: "var(--radius)" },
1438
1480
  children: [
1439
- /* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-2", children: [
1440
- /* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
1441
- f && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Ae, { content: f }) }),
1442
- /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: n })
1481
+ /* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-2", children: [
1482
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-3", children: [
1483
+ f && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Oe, { content: f }) }),
1484
+ /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: s })
1443
1485
  ] }),
1444
1486
  /* @__PURE__ */ e(
1445
1487
  "span",
1446
1488
  {
1447
1489
  className: "text-[10px] font-mono font-medium text-zinc-300 bg-white/10 px-1.5 py-0.5 tabular-nums",
1448
1490
  style: { borderRadius: "var(--radius-sm)" },
1449
- children: u ? u(t) : t
1491
+ children: h ? h(t) : t
1450
1492
  }
1451
1493
  )
1452
1494
  ] }),
1453
- /* @__PURE__ */ d("div", { className: "relative h-4 flex items-center px-1", children: [
1495
+ /* @__PURE__ */ c("div", { className: "relative h-4 flex items-center px-1", children: [
1454
1496
  /* @__PURE__ */ e(
1455
1497
  "input",
1456
1498
  {
1457
1499
  type: "range",
1458
1500
  min: i,
1459
1501
  max: o,
1460
- step: r,
1502
+ step: a,
1461
1503
  value: t,
1462
- onChange: (g) => h(parseFloat(g.target.value)),
1504
+ onChange: (x) => u(parseFloat(x.target.value)),
1463
1505
  className: "w-full h-1.5 appearance-none cursor-pointer focus:outline-none focus:ring-2 strata-range-input",
1464
1506
  style: {
1465
1507
  borderRadius: "var(--radius-full)",
@@ -1488,50 +1530,50 @@ const Ke = (n, t = 200) => {
1488
1530
  ] })
1489
1531
  ]
1490
1532
  }
1491
- ), pn = ({ label: n, value: t, options: i, onChange: o, icon: r }) => /* @__PURE__ */ d(
1533
+ ), ws = ({ label: s, value: t, options: i, onChange: o, icon: a }) => /* @__PURE__ */ c(
1492
1534
  "div",
1493
1535
  {
1494
1536
  className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
1495
1537
  style: { borderRadius: "var(--radius)" },
1496
1538
  children: [
1497
- /* @__PURE__ */ d("div", { className: "flex items-center gap-3 mb-2", children: [
1498
- r && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Ae, { content: r }) }),
1499
- /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: n })
1539
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-3 mb-2", children: [
1540
+ a && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Oe, { content: a }) }),
1541
+ /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: s })
1500
1542
  ] }),
1501
- /* @__PURE__ */ d("div", { className: "relative", children: [
1543
+ /* @__PURE__ */ c("div", { className: "relative", children: [
1502
1544
  /* @__PURE__ */ e(
1503
1545
  "select",
1504
1546
  {
1505
1547
  value: t,
1506
- onChange: (h) => o(h.target.value),
1548
+ onChange: (u) => o(u.target.value),
1507
1549
  className: "w-full bg-zinc-800 border-[length:var(--border-width)] border-white/10 px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:ring-2 appearance-none hover:bg-zinc-700 transition-colors cursor-pointer",
1508
1550
  style: { "--tw-ring-color": "var(--accent)", borderRadius: "var(--radius)" },
1509
- children: i.map((h) => /* @__PURE__ */ e("option", { value: h.value, children: h.label }, h.value))
1551
+ children: i.map((u) => /* @__PURE__ */ e("option", { value: u.value, children: u.label }, u.value))
1510
1552
  }
1511
1553
  ),
1512
1554
  /* @__PURE__ */ e("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-400", children: /* @__PURE__ */ e("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M1 1L5 5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
1513
1555
  ] })
1514
1556
  ]
1515
1557
  }
1516
- ), me = ({ title: n, children: t }) => /* @__PURE__ */ d("div", { className: "py-2", children: [
1517
- n && /* @__PURE__ */ e("h4", { className: "px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2", children: n }),
1558
+ ), pe = ({ title: s, children: t }) => /* @__PURE__ */ c("div", { className: "py-2", children: [
1559
+ s && /* @__PURE__ */ e("h4", { className: "px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2", children: s }),
1518
1560
  /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t })
1519
- ] }), it = ({
1520
- children: n,
1561
+ ] }), lt = ({
1562
+ children: s,
1521
1563
  onClose: t,
1522
1564
  align: i = "right",
1523
1565
  maxHeight: o,
1524
- className: r
1566
+ className: a
1525
1567
  }) => {
1526
- const h = U(null), u = U(null), [f, g] = N("auto"), x = i === "center" ? "left-1/2 -translate-x-1/2 origin-bottom" : "right-0 origin-bottom-right";
1527
- Ee(() => {
1528
- if (!u.current) return;
1529
- const w = () => {
1530
- u.current && g(u.current.offsetHeight);
1531
- }, m = new ResizeObserver(w);
1532
- return m.observe(u.current), w(), () => m.disconnect();
1568
+ const u = W(null), h = W(null), [f, x] = M("auto"), b = i === "center" ? "left-1/2 -translate-x-1/2 origin-bottom" : "right-0 origin-bottom-right";
1569
+ Be(() => {
1570
+ if (!h.current) return;
1571
+ const v = () => {
1572
+ h.current && x(h.current.offsetHeight);
1573
+ }, p = new ResizeObserver(v);
1574
+ return p.observe(h.current), v(), () => p.disconnect();
1533
1575
  }, []);
1534
- const p = {
1576
+ const m = {
1535
1577
  height: f === "auto" ? "auto" : `${f + 14}px`,
1536
1578
  // + padding
1537
1579
  maxHeight: o ? `${o}px` : void 0
@@ -1539,110 +1581,110 @@ const Ke = (n, t = 200) => {
1539
1581
  return /* @__PURE__ */ e(
1540
1582
  "div",
1541
1583
  {
1542
- ref: h,
1543
- className: `absolute bottom-full mb-4 ${x} bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl overflow-hidden w-[300px] max-w-[calc(100vw-32px)] text-sm z-50 ring-1 ring-white/5 font-[family-name:var(--font-main)] flex flex-col p-1.5 transition-[height,opacity,transform] duration-300 ease-out ${r}`,
1544
- style: { ...p, borderRadius: "var(--radius-lg)" },
1545
- onClick: (w) => w.stopPropagation(),
1546
- onMouseDown: (w) => w.stopPropagation(),
1547
- onTouchStart: (w) => w.stopPropagation(),
1584
+ ref: u,
1585
+ className: `absolute bottom-full mb-4 ${b} bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl overflow-hidden w-[300px] max-w-[calc(100vw-32px)] text-sm z-50 ring-1 ring-white/5 font-[family-name:var(--font-main)] flex flex-col p-1.5 transition-[height,opacity,transform] duration-300 ease-out ${a}`,
1586
+ style: { ...m, borderRadius: "var(--radius-lg)" },
1587
+ onClick: (v) => v.stopPropagation(),
1588
+ onMouseDown: (v) => v.stopPropagation(),
1589
+ onTouchStart: (v) => v.stopPropagation(),
1548
1590
  children: /* @__PURE__ */ e(
1549
1591
  "div",
1550
1592
  {
1551
1593
  className: "overflow-y-auto hide-scrollbar flex-1",
1552
1594
  style: { borderRadius: "var(--radius)" },
1553
- children: /* @__PURE__ */ e("div", { ref: u, children: n })
1595
+ children: /* @__PURE__ */ e("div", { ref: h, children: s })
1554
1596
  }
1555
1597
  )
1556
1598
  }
1557
1599
  );
1558
- }, ye = ({
1559
- content: n,
1600
+ }, Ne = ({
1601
+ content: s,
1560
1602
  className: t
1561
- }) => typeof n == "string" ? n.trim().startsWith("<") ? /* @__PURE__ */ e(
1603
+ }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e(
1562
1604
  "span",
1563
1605
  {
1564
1606
  className: t,
1565
- dangerouslySetInnerHTML: { __html: n }
1607
+ dangerouslySetInnerHTML: { __html: s }
1566
1608
  }
1567
- ) : /* @__PURE__ */ e("span", { className: t, children: n }) : /* @__PURE__ */ e("span", { className: t, children: n }), A = ({
1568
- label: n,
1609
+ ) : /* @__PURE__ */ e("span", { className: t, children: s }) : /* @__PURE__ */ e("span", { className: t, children: s }), L = ({
1610
+ label: s,
1569
1611
  value: t,
1570
1612
  active: i,
1571
1613
  onClick: o,
1572
- hasSubmenu: r,
1573
- icon: h,
1574
- rightIcon: u
1575
- }) => /* @__PURE__ */ d(
1614
+ hasSubmenu: a,
1615
+ icon: u,
1616
+ rightIcon: h
1617
+ }) => /* @__PURE__ */ c(
1576
1618
  "button",
1577
1619
  {
1578
1620
  onClick: o,
1579
1621
  className: "w-full flex items-center justify-between px-3 py-2.5 hover:bg-white/10 transition-colors text-left text-zinc-200 active:bg-white/5 focus:outline-none focus:bg-white/10 group overflow-hidden my-0.5",
1580
1622
  style: { borderRadius: "var(--radius)" },
1581
1623
  children: [
1582
- /* @__PURE__ */ d("div", { className: "flex items-center gap-3 overflow-hidden", children: [
1583
- h && /* @__PURE__ */ e("span", { className: "text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(ye, { content: h }) }),
1624
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-3 overflow-hidden", children: [
1625
+ u && /* @__PURE__ */ e("span", { className: "text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Ne, { content: u }) }),
1584
1626
  /* @__PURE__ */ e(
1585
1627
  "span",
1586
1628
  {
1587
1629
  className: `font-medium truncate text-sm flex items-center ${i ? "text-[var(--accent)]" : ""}`,
1588
- title: typeof n == "string" ? n : void 0,
1589
- children: /* @__PURE__ */ e(ye, { content: n })
1630
+ title: typeof s == "string" ? s : void 0,
1631
+ children: /* @__PURE__ */ e(Ne, { content: s })
1590
1632
  }
1591
1633
  )
1592
1634
  ] }),
1593
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2 text-zinc-400 shrink-0", children: [
1635
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2 text-zinc-400 shrink-0", children: [
1594
1636
  t && /* @__PURE__ */ e(
1595
1637
  "span",
1596
1638
  {
1597
1639
  className: "text-xs font-medium truncate max-w-[60px]",
1598
1640
  title: t,
1599
- children: /* @__PURE__ */ e(ye, { content: t })
1641
+ children: /* @__PURE__ */ e(Ne, { content: t })
1600
1642
  }
1601
1643
  ),
1602
- u,
1603
- i && /* @__PURE__ */ e(Be, { className: "w-4 h-4 text-[var(--accent)] shrink-0" }),
1604
- r && /* @__PURE__ */ e("span", { className: "text-xs group-hover:translate-x-0.5 transition-transform text-zinc-500 shrink-0", children: "›" })
1644
+ h,
1645
+ i && /* @__PURE__ */ e(He, { className: "w-4 h-4 text-[var(--accent)] shrink-0" }),
1646
+ a && /* @__PURE__ */ e("span", { className: "text-xs group-hover:translate-x-0.5 transition-transform text-zinc-500 shrink-0", children: "›" })
1605
1647
  ] })
1606
1648
  ]
1607
1649
  }
1608
- ), K = ({
1609
- label: n,
1650
+ ), Z = ({
1651
+ label: s,
1610
1652
  onBack: t,
1611
1653
  rightAction: i
1612
- }) => /* @__PURE__ */ d(
1654
+ }) => /* @__PURE__ */ c(
1613
1655
  "div",
1614
1656
  {
1615
1657
  className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",
1616
1658
  style: { borderRadius: "var(--radius)" },
1617
1659
  children: [
1618
- /* @__PURE__ */ d(
1660
+ /* @__PURE__ */ c(
1619
1661
  "button",
1620
1662
  {
1621
1663
  className: "flex items-center gap-2 hover:text-white transition-colors focus:outline-none",
1622
1664
  onClick: t,
1623
1665
  children: [
1624
- /* @__PURE__ */ e(Fi, { className: "w-3 h-3" }),
1625
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(ye, { content: n }) })
1666
+ /* @__PURE__ */ e(Wi, { className: "w-3 h-3" }),
1667
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(Ne, { content: s }) })
1626
1668
  ]
1627
1669
  }
1628
1670
  ),
1629
1671
  i
1630
1672
  ]
1631
1673
  }
1632
- ), pe = () => /* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }), Vt = ({
1633
- items: n,
1674
+ ), me = () => /* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }), Xt = ({
1675
+ items: s,
1634
1676
  onClose: t,
1635
1677
  title: i,
1636
1678
  maxHeight: o,
1637
- className: r
1679
+ className: a
1638
1680
  }) => {
1639
- const [h, u] = N([]), f = h.length > 0 ? h[h.length - 1] : null, g = f ? f.children || [] : n, x = f ? f.html : i || "Menu", p = () => {
1640
- u((m) => m.slice(0, -1));
1641
- }, w = (m) => {
1642
- m.children && u((T) => [...T, m]);
1681
+ const [u, h] = M([]), f = u.length > 0 ? u[u.length - 1] : null, x = f ? f.children || [] : s, b = f ? f.html : i || "Menu", m = () => {
1682
+ h((p) => p.slice(0, -1));
1683
+ }, v = (p) => {
1684
+ p.children && h((S) => [...S, p]);
1643
1685
  };
1644
- return /* @__PURE__ */ e(it, { onClose: t, maxHeight: o, className: r, children: /* @__PURE__ */ d("div", { className: "animate-in fade-in slide-in-from-right-4 duration-200", children: [
1645
- h.length > 0 ? /* @__PURE__ */ e(K, { label: x || "Menu", onBack: p }) : i && /* @__PURE__ */ e(
1686
+ return /* @__PURE__ */ e(lt, { onClose: t, maxHeight: o, className: a, children: /* @__PURE__ */ c("div", { className: "animate-in fade-in slide-in-from-right-4 duration-200", children: [
1687
+ u.length > 0 ? /* @__PURE__ */ e(Z, { label: b || "Menu", onBack: m }) : i && /* @__PURE__ */ e(
1646
1688
  "div",
1647
1689
  {
1648
1690
  className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",
@@ -1650,74 +1692,74 @@ const Ke = (n, t = 200) => {
1650
1692
  children: /* @__PURE__ */ e("span", { children: i })
1651
1693
  }
1652
1694
  ),
1653
- /* @__PURE__ */ e("div", { className: "pb-1", children: g.map((m, T) => m.separator ? /* @__PURE__ */ e(pe, {}, T) : m.isLabel ? /* @__PURE__ */ e(
1695
+ /* @__PURE__ */ e("div", { className: "pb-1", children: x.map((p, S) => p.separator ? /* @__PURE__ */ e(me, {}, S) : p.isLabel ? /* @__PURE__ */ e(
1654
1696
  "div",
1655
1697
  {
1656
1698
  className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none",
1657
- children: /* @__PURE__ */ e(ye, { content: m.html || "" })
1699
+ children: /* @__PURE__ */ e(Ne, { content: p.html || "" })
1658
1700
  },
1659
- T
1660
- ) : m.range ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
1661
- we,
1701
+ S
1702
+ ) : p.range ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
1703
+ xe,
1662
1704
  {
1663
- label: m.html,
1664
- icon: m.icon,
1665
- value: m.value ?? m.min ?? 0,
1666
- min: m.min ?? 0,
1667
- max: m.max ?? 100,
1668
- step: m.step ?? 1,
1669
- onChange: (I) => m.onRange && m.onRange(I),
1670
- formatValue: m.formatValue
1705
+ label: p.html,
1706
+ icon: p.icon,
1707
+ value: p.value ?? p.min ?? 0,
1708
+ min: p.min ?? 0,
1709
+ max: p.max ?? 100,
1710
+ step: p.step ?? 1,
1711
+ onChange: ($) => p.onRange && p.onRange($),
1712
+ formatValue: p.formatValue
1671
1713
  }
1672
- ) }, T) : m.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
1673
- oe,
1714
+ ) }, S) : p.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
1715
+ le,
1674
1716
  {
1675
- label: m.html,
1676
- icon: m.icon,
1677
- checked: m.switch,
1678
- tooltip: m.tooltip,
1679
- onChange: (I) => m.onSwitch && m.onSwitch(m, I)
1717
+ label: p.html,
1718
+ icon: p.icon,
1719
+ checked: p.switch,
1720
+ tooltip: p.tooltip,
1721
+ onChange: ($) => p.onSwitch && p.onSwitch(p, $)
1680
1722
  }
1681
- ) }, T) : /* @__PURE__ */ e(ke.Fragment, { children: /* @__PURE__ */ e(
1682
- A,
1723
+ ) }, S) : /* @__PURE__ */ e(Me.Fragment, { children: /* @__PURE__ */ e(
1724
+ L,
1683
1725
  {
1684
- label: m.html,
1685
- icon: m.icon,
1686
- value: m.currentLabel || m.value,
1687
- active: m.active,
1688
- hasSubmenu: !!m.children,
1726
+ label: p.html,
1727
+ icon: p.icon,
1728
+ value: p.currentLabel || p.value,
1729
+ active: p.active,
1730
+ hasSubmenu: !!p.children,
1689
1731
  onClick: () => {
1690
- m.children ? w(m) : m.onClick ? (m.onClick(m), !m.switch && !m.range && t()) : m.click && (m.click(m), t());
1732
+ p.children ? v(p) : p.onClick ? (p.onClick(p), !p.switch && !p.range && t()) : p.click && (p.click(p), t());
1691
1733
  }
1692
1734
  }
1693
- ) }, T)) })
1735
+ ) }, S)) })
1694
1736
  ] }) });
1695
- }, mn = ({
1696
- tracks: n,
1737
+ }, ys = ({
1738
+ tracks: s,
1697
1739
  current: t,
1698
1740
  onSelect: i,
1699
1741
  onUpload: o,
1700
- onClose: r,
1701
- settings: h,
1702
- onSettingsChange: u,
1742
+ onClose: a,
1743
+ settings: u,
1744
+ onSettingsChange: h,
1703
1745
  onReset: f,
1704
- offset: g,
1705
- onOffsetChange: x,
1706
- maxHeight: p,
1707
- animationClass: w
1746
+ offset: x,
1747
+ onOffsetChange: b,
1748
+ maxHeight: m,
1749
+ animationClass: v
1708
1750
  }) => {
1709
- const [m, T] = N("main"), [I, O] = N(""), Y = U(null), W = xe(() => I ? n.filter(
1710
- (b) => b.label.toLowerCase().includes(I.toLowerCase()) || b.srcLang && b.srcLang.toLowerCase().includes(I.toLowerCase())
1711
- ) : n, [n, I]);
1712
- return /* @__PURE__ */ d(
1713
- it,
1751
+ const [p, S] = M("main"), [$, U] = M(""), H = W(null), q = Ce(() => $ ? s.filter(
1752
+ (g) => g.label.toLowerCase().includes($.toLowerCase()) || g.srcLang && g.srcLang.toLowerCase().includes($.toLowerCase())
1753
+ ) : s, [s, $]);
1754
+ return /* @__PURE__ */ c(
1755
+ lt,
1714
1756
  {
1715
- onClose: r,
1757
+ onClose: a,
1716
1758
  align: "right",
1717
- maxHeight: p,
1718
- className: w,
1759
+ maxHeight: m,
1760
+ className: v,
1719
1761
  children: [
1720
- m === "main" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200 flex flex-col h-full", children: [
1762
+ p === "main" && /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200 flex flex-col h-full", children: [
1721
1763
  /* @__PURE__ */ e(
1722
1764
  "div",
1723
1765
  {
@@ -1726,15 +1768,15 @@ const Ke = (n, t = 200) => {
1726
1768
  children: /* @__PURE__ */ e("span", { children: "Subtitles" })
1727
1769
  }
1728
1770
  ),
1729
- /* @__PURE__ */ d("div", { className: "px-1.5 pb-2 shrink-0", children: [
1771
+ /* @__PURE__ */ c("div", { className: "px-1.5 pb-2 shrink-0", children: [
1730
1772
  /* @__PURE__ */ e(
1731
- A,
1773
+ L,
1732
1774
  {
1733
1775
  label: "Upload Subtitle",
1734
- icon: /* @__PURE__ */ e(Ei, { className: "w-4 h-4" }),
1776
+ icon: /* @__PURE__ */ e(Hi, { className: "w-4 h-4" }),
1735
1777
  onClick: () => {
1736
- var b;
1737
- return (b = Y.current) == null ? void 0 : b.click();
1778
+ var g;
1779
+ return (g = H.current) == null ? void 0 : g.click();
1738
1780
  }
1739
1781
  }
1740
1782
  ),
@@ -1743,159 +1785,159 @@ const Ke = (n, t = 200) => {
1743
1785
  {
1744
1786
  type: "file",
1745
1787
  accept: ".vtt,.srt",
1746
- ref: Y,
1788
+ ref: H,
1747
1789
  className: "hidden",
1748
- onChange: (b) => {
1749
- var H;
1750
- (H = b.target.files) != null && H[0] && o(b.target.files[0]);
1790
+ onChange: (g) => {
1791
+ var Y;
1792
+ (Y = g.target.files) != null && Y[0] && o(g.target.files[0]);
1751
1793
  }
1752
1794
  }
1753
1795
  ),
1754
1796
  /* @__PURE__ */ e(
1755
- A,
1797
+ L,
1756
1798
  {
1757
1799
  label: "Customize",
1758
- icon: /* @__PURE__ */ e(jt, { className: "w-4 h-4" }),
1759
- onClick: () => T("customize"),
1800
+ icon: /* @__PURE__ */ e(Zt, { className: "w-4 h-4" }),
1801
+ onClick: () => S("customize"),
1760
1802
  hasSubmenu: !0
1761
1803
  }
1762
1804
  ),
1763
1805
  /* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }),
1764
1806
  /* @__PURE__ */ e(
1765
- A,
1807
+ L,
1766
1808
  {
1767
1809
  label: "Off",
1768
1810
  active: t === -1,
1769
1811
  onClick: () => {
1770
- i(-1), r();
1812
+ i(-1), a();
1771
1813
  }
1772
1814
  }
1773
1815
  ),
1774
- /* @__PURE__ */ d("div", { className: "relative mt-2", children: [
1816
+ /* @__PURE__ */ c("div", { className: "relative mt-2", children: [
1775
1817
  /* @__PURE__ */ e(
1776
1818
  "input",
1777
1819
  {
1778
1820
  type: "text",
1779
1821
  placeholder: "Search subtitles...",
1780
- value: I,
1781
- onChange: (b) => O(b.target.value),
1822
+ value: $,
1823
+ onChange: (g) => U(g.target.value),
1782
1824
  className: "w-full bg-zinc-800/50 border border-white/10 rounded-md py-1.5 pl-8 pr-3 text-xs text-zinc-200 focus:outline-none focus:border-white/20 transition-colors"
1783
1825
  }
1784
1826
  ),
1785
- /* @__PURE__ */ e(cn, { className: "w-3.5 h-3.5 text-zinc-500 absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none" })
1827
+ /* @__PURE__ */ e(fs, { className: "w-3.5 h-3.5 text-zinc-500 absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none" })
1786
1828
  ] })
1787
1829
  ] }),
1788
- /* @__PURE__ */ d("div", { className: "overflow-y-auto hide-scrollbar flex-1", children: [
1789
- W.map((b) => {
1790
- let H = null;
1791
- return b.status === "loading" ? H = /* @__PURE__ */ e(Fe, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)]" }) : b.status === "error" ? H = /* @__PURE__ */ e(dn, { className: "w-3.5 h-3.5 text-red-500" }) : b.status === "success" && (H = /* @__PURE__ */ e(_t, { className: "w-3.5 h-3.5 text-emerald-500" })), /* @__PURE__ */ e(
1792
- A,
1830
+ /* @__PURE__ */ c("div", { className: "overflow-y-auto hide-scrollbar flex-1", children: [
1831
+ q.map((g) => {
1832
+ let Y = null;
1833
+ return g.status === "loading" ? Y = /* @__PURE__ */ e(De, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)]" }) : g.status === "error" ? Y = /* @__PURE__ */ e(bs, { className: "w-3.5 h-3.5 text-red-500" }) : g.status === "success" && (Y = /* @__PURE__ */ e(ii, { className: "w-3.5 h-3.5 text-emerald-500" })), /* @__PURE__ */ e(
1834
+ L,
1793
1835
  {
1794
- label: b.label,
1795
- value: b.srcLang,
1796
- active: t === b.index,
1797
- rightIcon: H,
1836
+ label: g.label,
1837
+ value: g.srcLang,
1838
+ active: t === g.index,
1839
+ rightIcon: Y,
1798
1840
  onClick: () => {
1799
- i(b.index), r();
1841
+ i(g.index), a();
1800
1842
  }
1801
1843
  },
1802
- b.index
1844
+ g.index
1803
1845
  );
1804
1846
  }),
1805
- W.length === 0 && I && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-center text-xs text-zinc-500", children: "No results found" })
1847
+ q.length === 0 && $ && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-center text-xs text-zinc-500", children: "No results found" })
1806
1848
  ] })
1807
1849
  ] }),
1808
- m === "customize" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
1850
+ p === "customize" && /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
1809
1851
  /* @__PURE__ */ e(
1810
- K,
1852
+ Z,
1811
1853
  {
1812
1854
  label: "Customize",
1813
- onBack: () => T("main"),
1855
+ onBack: () => S("main"),
1814
1856
  rightAction: /* @__PURE__ */ e(
1815
1857
  "button",
1816
1858
  {
1817
1859
  onClick: f,
1818
1860
  className: "p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10",
1819
1861
  title: "Reset All",
1820
- children: /* @__PURE__ */ e(Ui, { className: "w-4 h-4" })
1862
+ children: /* @__PURE__ */ e(Ji, { className: "w-4 h-4" })
1821
1863
  }
1822
1864
  )
1823
1865
  }
1824
1866
  ),
1825
- /* @__PURE__ */ d("div", { className: "pb-1", children: [
1826
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1827
- oe,
1867
+ /* @__PURE__ */ c("div", { className: "pb-1", children: [
1868
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
1869
+ le,
1828
1870
  {
1829
1871
  label: "Native Video Subtitle",
1830
- checked: h.useNative,
1831
- onChange: (b) => u({ useNative: b })
1872
+ checked: u.useNative,
1873
+ onChange: (g) => h({ useNative: g })
1832
1874
  }
1833
1875
  ) }),
1834
- !h.useNative && /* @__PURE__ */ d(_, { children: [
1835
- /* @__PURE__ */ d(me, { title: "Sync & Position", children: [
1836
- /* @__PURE__ */ d("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
1837
- /* @__PURE__ */ e("div", { className: "flex justify-between items-center mb-2", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
1838
- /* @__PURE__ */ e(Vi, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
1876
+ !u.useNative && /* @__PURE__ */ c(Q, { children: [
1877
+ /* @__PURE__ */ c(pe, { title: "Sync & Position", children: [
1878
+ /* @__PURE__ */ c("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
1879
+ /* @__PURE__ */ e("div", { className: "flex justify-between items-center mb-2", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3", children: [
1880
+ /* @__PURE__ */ e(Gi, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
1839
1881
  /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Sync Offset" })
1840
1882
  ] }) }),
1841
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1883
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1842
1884
  /* @__PURE__ */ e(
1843
1885
  "button",
1844
1886
  {
1845
- onClick: () => x(Math.round((g - 0.1) * 10) / 10),
1887
+ onClick: () => b(Math.round((x - 0.1) * 10) / 10),
1846
1888
  className: "w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",
1847
- children: /* @__PURE__ */ e(Di, { className: "w-4 h-4" })
1889
+ children: /* @__PURE__ */ e(_i, { className: "w-4 h-4" })
1848
1890
  }
1849
1891
  ),
1850
- /* @__PURE__ */ d("div", { className: "flex-1 bg-zinc-900 border border-white/5 rounded-lg h-8 flex items-center justify-center text-xs font-mono font-medium text-[var(--accent)]", children: [
1851
- g > 0 ? "+" : "",
1852
- (g == null ? void 0 : g.toFixed(1)) || "0.0",
1892
+ /* @__PURE__ */ c("div", { className: "flex-1 bg-zinc-900 border border-white/5 rounded-lg h-8 flex items-center justify-center text-xs font-mono font-medium text-[var(--accent)]", children: [
1893
+ x > 0 ? "+" : "",
1894
+ (x == null ? void 0 : x.toFixed(1)) || "0.0",
1853
1895
  "s"
1854
1896
  ] }),
1855
1897
  /* @__PURE__ */ e(
1856
1898
  "button",
1857
1899
  {
1858
- onClick: () => x(Math.round((g + 0.1) * 10) / 10),
1900
+ onClick: () => b(Math.round((x + 0.1) * 10) / 10),
1859
1901
  className: "w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",
1860
- children: /* @__PURE__ */ e(Oi, { className: "w-4 h-4" })
1902
+ children: /* @__PURE__ */ e(qi, { className: "w-4 h-4" })
1861
1903
  }
1862
1904
  )
1863
1905
  ] })
1864
1906
  ] }),
1865
1907
  /* @__PURE__ */ e(
1866
- we,
1908
+ xe,
1867
1909
  {
1868
1910
  label: "Vertical Position",
1869
- icon: /* @__PURE__ */ e(ji, { className: "w-4 h-4" }),
1870
- value: h.verticalOffset,
1911
+ icon: /* @__PURE__ */ e(Yi, { className: "w-4 h-4" }),
1912
+ value: u.verticalOffset,
1871
1913
  min: 0,
1872
1914
  max: 200,
1873
1915
  step: 5,
1874
- onChange: (b) => u({ verticalOffset: b }),
1875
- formatValue: (b) => `${b}px`
1916
+ onChange: (g) => h({ verticalOffset: g }),
1917
+ formatValue: (g) => `${g}px`
1876
1918
  }
1877
1919
  )
1878
1920
  ] }),
1879
- /* @__PURE__ */ d(me, { title: "Appearance", children: [
1921
+ /* @__PURE__ */ c(pe, { title: "Appearance", children: [
1880
1922
  /* @__PURE__ */ e(
1881
- we,
1923
+ xe,
1882
1924
  {
1883
1925
  label: "Text Size",
1884
- icon: /* @__PURE__ */ e(Hi, { className: "w-4 h-4" }),
1885
- value: h.textSize,
1926
+ icon: /* @__PURE__ */ e(Xi, { className: "w-4 h-4" }),
1927
+ value: u.textSize,
1886
1928
  min: 50,
1887
1929
  max: 200,
1888
1930
  step: 10,
1889
- onChange: (b) => u({ textSize: b }),
1890
- formatValue: (b) => `${b}%`
1931
+ onChange: (g) => h({ textSize: g }),
1932
+ formatValue: (g) => `${g}%`
1891
1933
  }
1892
1934
  ),
1893
- /* @__PURE__ */ d("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
1894
- /* @__PURE__ */ d("div", { className: "flex items-center gap-3 mb-2", children: [
1895
- /* @__PURE__ */ e(Ut, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
1935
+ /* @__PURE__ */ c("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
1936
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-3 mb-2", children: [
1937
+ /* @__PURE__ */ e(ei, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
1896
1938
  /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Text Color" })
1897
1939
  ] }),
1898
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg", children: [
1940
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg", children: [
1899
1941
  [
1900
1942
  "#ffffff",
1901
1943
  "#ffff00",
@@ -1903,35 +1945,35 @@ const Ke = (n, t = 200) => {
1903
1945
  "#ff00ff",
1904
1946
  "#ff0000",
1905
1947
  "#00ff00"
1906
- ].map((b) => /* @__PURE__ */ e(
1948
+ ].map((g) => /* @__PURE__ */ e(
1907
1949
  "button",
1908
1950
  {
1909
- onClick: () => u({ textColor: b }),
1910
- className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${h.textColor === b ? "ring-2 scale-110" : ""}`,
1951
+ onClick: () => h({ textColor: g }),
1952
+ className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${u.textColor === g ? "ring-2 scale-110" : ""}`,
1911
1953
  style: {
1912
- backgroundColor: b,
1954
+ backgroundColor: g,
1913
1955
  "--tw-ring-color": "var(--accent)"
1914
1956
  }
1915
1957
  },
1916
- b
1958
+ g
1917
1959
  )),
1918
1960
  /* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/10 mx-1" }),
1919
1961
  /* @__PURE__ */ e("div", { className: "relative w-6 h-6 rounded-full overflow-hidden ring-1 ring-white/20 cursor-pointer", children: /* @__PURE__ */ e(
1920
1962
  "input",
1921
1963
  {
1922
1964
  type: "color",
1923
- value: h.textColor,
1924
- onChange: (b) => u({ textColor: b.target.value }),
1965
+ value: u.textColor,
1966
+ onChange: (g) => h({ textColor: g.target.value }),
1925
1967
  className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"
1926
1968
  }
1927
1969
  ) })
1928
1970
  ] })
1929
1971
  ] }),
1930
1972
  /* @__PURE__ */ e(
1931
- pn,
1973
+ ws,
1932
1974
  {
1933
1975
  label: "Text Style",
1934
- value: h.textStyle,
1976
+ value: u.textStyle,
1935
1977
  options: [
1936
1978
  { label: "None", value: "none" },
1937
1979
  { label: "Outline", value: "outline" },
@@ -1939,65 +1981,65 @@ const Ke = (n, t = 200) => {
1939
1981
  { label: "Depressed", value: "depressed" },
1940
1982
  { label: "Drop Shadow", value: "shadow" }
1941
1983
  ],
1942
- onChange: (b) => u({
1943
- textStyle: b
1984
+ onChange: (g) => h({
1985
+ textStyle: g
1944
1986
  })
1945
1987
  }
1946
1988
  ),
1947
- /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2 mt-1 px-1", children: [
1989
+ /* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-2 mt-1 px-1", children: [
1948
1990
  /* @__PURE__ */ e(
1949
- oe,
1991
+ le,
1950
1992
  {
1951
1993
  label: "Bold",
1952
- icon: /* @__PURE__ */ e(Gi, { className: "w-4 h-4" }),
1953
- checked: h.isBold,
1954
- onChange: (b) => u({ isBold: b })
1994
+ icon: /* @__PURE__ */ e(Ki, { className: "w-4 h-4" }),
1995
+ checked: u.isBold,
1996
+ onChange: (g) => h({ isBold: g })
1955
1997
  }
1956
1998
  ),
1957
1999
  /* @__PURE__ */ e(
1958
- oe,
2000
+ le,
1959
2001
  {
1960
2002
  label: "Fix Caps",
1961
- icon: /* @__PURE__ */ e(_i, { className: "w-4 h-4" }),
1962
- checked: h.fixCapitalization,
1963
- onChange: (b) => u({ fixCapitalization: b })
2003
+ icon: /* @__PURE__ */ e(Zi, { className: "w-4 h-4" }),
2004
+ checked: u.fixCapitalization,
2005
+ onChange: (g) => h({ fixCapitalization: g })
1964
2006
  }
1965
2007
  )
1966
2008
  ] })
1967
2009
  ] }),
1968
- /* @__PURE__ */ d(me, { title: "Background", children: [
2010
+ /* @__PURE__ */ c(pe, { title: "Background", children: [
1969
2011
  /* @__PURE__ */ e(
1970
- we,
2012
+ xe,
1971
2013
  {
1972
2014
  label: "Opacity",
1973
- icon: /* @__PURE__ */ e(Wi, { className: "w-4 h-4" }),
1974
- value: h.backgroundOpacity,
2015
+ icon: /* @__PURE__ */ e(Qi, { className: "w-4 h-4" }),
2016
+ value: u.backgroundOpacity,
1975
2017
  min: 0,
1976
2018
  max: 100,
1977
2019
  step: 5,
1978
- onChange: (b) => u({ backgroundOpacity: b }),
1979
- formatValue: (b) => `${b}%`
2020
+ onChange: (g) => h({ backgroundOpacity: g }),
2021
+ formatValue: (g) => `${g}%`
1980
2022
  }
1981
2023
  ),
1982
2024
  /* @__PURE__ */ e(
1983
- oe,
2025
+ le,
1984
2026
  {
1985
2027
  label: "Blur Background",
1986
- icon: /* @__PURE__ */ e(qi, { className: "w-4 h-4" }),
1987
- checked: h.backgroundBlur,
1988
- onChange: (b) => u({ backgroundBlur: b })
2028
+ icon: /* @__PURE__ */ e(es, { className: "w-4 h-4" }),
2029
+ checked: u.backgroundBlur,
2030
+ onChange: (g) => h({ backgroundBlur: g })
1989
2031
  }
1990
2032
  ),
1991
- h.backgroundBlur && /* @__PURE__ */ e(
1992
- we,
2033
+ u.backgroundBlur && /* @__PURE__ */ e(
2034
+ xe,
1993
2035
  {
1994
2036
  label: "Blur Intensity",
1995
- value: h.backgroundBlurAmount,
2037
+ value: u.backgroundBlurAmount,
1996
2038
  min: 0,
1997
2039
  max: 20,
1998
2040
  step: 1,
1999
- onChange: (b) => u({ backgroundBlurAmount: b }),
2000
- formatValue: (b) => `${b}px`
2041
+ onChange: (g) => h({ backgroundBlurAmount: g }),
2042
+ formatValue: (g) => `${g}px`
2001
2043
  }
2002
2044
  )
2003
2045
  ] })
@@ -2007,33 +2049,33 @@ const Ke = (n, t = 200) => {
2007
2049
  ]
2008
2050
  }
2009
2051
  );
2010
- }, Ye = ({ content: n }) => typeof n == "string" ? n.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ e("span", { children: n }) : /* @__PURE__ */ e(_, { children: n }), fn = ({ x: n, y: t, items: i, onClose: o, containerWidth: r, containerHeight: h }) => {
2011
- const u = U(null), [f, g] = N({
2052
+ }, nt = ({ content: s }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("span", { children: s }) : /* @__PURE__ */ e(Q, { children: s }), ks = ({ x: s, y: t, items: i, onClose: o, containerWidth: a, containerHeight: u }) => {
2053
+ const h = W(null), [f, x] = M({
2012
2054
  top: t,
2013
- left: n,
2055
+ left: s,
2014
2056
  opacity: 0
2015
2057
  });
2016
- return Ee(() => {
2017
- if (!u.current) return;
2018
- const x = u.current.getBoundingClientRect(), p = x.width, w = x.height;
2019
- let m = n, T = t;
2020
- n + p > r - 10 && (m = n - p), m < 10 && (m = 10), m + p > r && (m = Math.max(10, r - p - 10)), t + w > h - 10 && (T = t - w);
2021
- let I = h - 20;
2022
- T < 10 && (T = 10), T + w > h - 10 && (T = Math.max(10, h - w - 10)), g({
2023
- top: T,
2024
- left: m,
2025
- maxHeight: I,
2058
+ return Be(() => {
2059
+ if (!h.current) return;
2060
+ const b = h.current.getBoundingClientRect(), m = b.width, v = b.height;
2061
+ let p = s, S = t;
2062
+ s + m > a - 10 && (p = s - m), p < 10 && (p = 10), p + m > a && (p = Math.max(10, a - m - 10)), t + v > u - 10 && (S = t - v);
2063
+ let $ = u - 20;
2064
+ S < 10 && (S = 10), S + v > u - 10 && (S = Math.max(10, u - v - 10)), x({
2065
+ top: S,
2066
+ left: p,
2067
+ maxHeight: $,
2026
2068
  opacity: 1
2027
2069
  });
2028
- }, [n, t, i, r, h]), Q(() => {
2029
- const x = (p) => {
2030
- u.current && !u.current.contains(p.target) && o();
2070
+ }, [s, t, i, a, u]), ee(() => {
2071
+ const b = (m) => {
2072
+ h.current && !h.current.contains(m.target) && o();
2031
2073
  };
2032
- return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
2074
+ return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
2033
2075
  }, [o]), /* @__PURE__ */ e(
2034
2076
  "div",
2035
2077
  {
2036
- ref: u,
2078
+ ref: h,
2037
2079
  className: "absolute z-50 min-w-[200px] bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl p-1.5 font-[family-name:var(--font-main)] overflow-y-auto hide-scrollbar flex flex-col",
2038
2080
  style: {
2039
2081
  top: f.top,
@@ -2042,301 +2084,310 @@ const Ke = (n, t = 200) => {
2042
2084
  opacity: f.opacity,
2043
2085
  borderRadius: "var(--radius-lg)"
2044
2086
  },
2045
- onClick: (x) => x.stopPropagation(),
2046
- onMouseDown: (x) => x.stopPropagation(),
2047
- onTouchStart: (x) => x.stopPropagation(),
2048
- children: i.map((x, p) => x.separator ? /* @__PURE__ */ e("div", { className: "h-0 border-t border-white/10 mx-2 my-1.5" }, p) : x.isLabel ? /* @__PURE__ */ e("div", { className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none", children: /* @__PURE__ */ e(Ye, { content: x.html || "" }) }, p) : /* @__PURE__ */ d(ke.Fragment, { children: [
2049
- /* @__PURE__ */ d(
2087
+ onClick: (b) => b.stopPropagation(),
2088
+ onMouseDown: (b) => b.stopPropagation(),
2089
+ onTouchStart: (b) => b.stopPropagation(),
2090
+ children: i.map((b, m) => b.separator ? /* @__PURE__ */ e("div", { className: "h-0 border-t border-white/10 mx-2 my-1.5" }, m) : b.isLabel ? /* @__PURE__ */ e("div", { className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none", children: /* @__PURE__ */ e(nt, { content: b.html || "" }) }, m) : /* @__PURE__ */ c(Me.Fragment, { children: [
2091
+ /* @__PURE__ */ c(
2050
2092
  "button",
2051
2093
  {
2052
2094
  onClick: () => {
2053
- x.disabled || (x.click ? x.click(o) : x.onClick && x.onClick(o));
2095
+ b.disabled || (b.click ? b.click(o) : b.onClick && b.onClick(o));
2054
2096
  },
2055
- disabled: x.disabled,
2097
+ disabled: b.disabled,
2056
2098
  className: "w-full text-left px-3 py-2.5 flex items-center justify-between hover:bg-white/10 focus:bg-white/10 focus:outline-none transition-colors text-sm text-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed group my-0.5",
2057
2099
  style: { borderRadius: "var(--radius)" },
2058
2100
  children: [
2059
- /* @__PURE__ */ d("div", { className: "flex items-center gap-3 overflow-hidden", children: [
2060
- x.icon && /* @__PURE__ */ e("span", { className: "text-zinc-400 w-4 h-4 flex items-center justify-center shrink-0 group-hover:text-zinc-300 transition-colors", children: /* @__PURE__ */ e(Ye, { content: x.icon }) }),
2061
- /* @__PURE__ */ e("span", { className: `flex items-center font-medium truncate ${x.checked ? "text-[var(--accent)]" : ""}`, children: /* @__PURE__ */ e(Ye, { content: x.html || "" }) })
2101
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-3 overflow-hidden", children: [
2102
+ b.icon && /* @__PURE__ */ e("span", { className: "text-zinc-400 w-4 h-4 flex items-center justify-center shrink-0 group-hover:text-zinc-300 transition-colors", children: /* @__PURE__ */ e(nt, { content: b.icon }) }),
2103
+ /* @__PURE__ */ e("span", { className: `flex items-center font-medium truncate ${b.checked ? "text-[var(--accent)]" : ""}`, children: /* @__PURE__ */ e(nt, { content: b.html || "" }) })
2062
2104
  ] }),
2063
- x.checked && /* @__PURE__ */ e(Be, { className: "w-4 h-4 text-[var(--accent)] shrink-0 ml-2" })
2105
+ b.checked && /* @__PURE__ */ e(He, { className: "w-4 h-4 text-[var(--accent)] shrink-0 ml-2" })
2064
2106
  ]
2065
2107
  }
2066
2108
  ),
2067
- x.showBorder && /* @__PURE__ */ e("div", { className: "h-0 border-t border-white/10 mx-2 my-1" })
2068
- ] }, p))
2109
+ b.showBorder && /* @__PURE__ */ e("div", { className: "h-0 border-t border-white/10 mx-2 my-1" })
2110
+ ] }, m))
2069
2111
  }
2070
2112
  );
2071
- }, bn = ({ player: n, onClose: t }) => {
2072
- const [i, o] = N({});
2073
- return Q(() => {
2074
- const r = () => {
2075
- var g;
2076
- if (!n.video) return;
2077
- const u = n.video, f = u.getVideoPlaybackQuality ? u.getVideoPlaybackQuality() : null;
2113
+ }, Ss = ({ player: s, onClose: t }) => {
2114
+ const [i, o] = M({});
2115
+ return ee(() => {
2116
+ const a = () => {
2117
+ var x;
2118
+ if (!s.video) return;
2119
+ const h = s.video, f = h.getVideoPlaybackQuality ? h.getVideoPlaybackQuality() : null;
2078
2120
  o({
2079
- "Player Size": `${u.offsetWidth} x ${u.offsetHeight}`,
2080
- "Video Resolution": `${u.videoWidth} x ${u.videoHeight}`,
2081
- "Current Time": `${u.currentTime.toFixed(3)}s`,
2082
- Duration: `${u.duration.toFixed(3)}s`,
2083
- Volume: `${Math.round(u.volume * 100)}%`,
2121
+ "Player Size": `${h.offsetWidth} x ${h.offsetHeight}`,
2122
+ "Video Resolution": `${h.videoWidth} x ${h.videoHeight}`,
2123
+ "Current Time": `${h.currentTime.toFixed(3)}s`,
2124
+ Duration: `${h.duration.toFixed(3)}s`,
2125
+ Volume: `${Math.round(h.volume * 100)}%`,
2084
2126
  "Dropped Frames": f ? f.droppedVideoFrames : "N/A",
2085
- Buffer: u.buffered.length > 0 ? `${(u.buffered.end(u.buffered.length - 1) - u.currentTime).toFixed(2)}s` : "0s",
2086
- Engine: ((g = n.store.get().sources[n.store.get().currentSourceIndex]) == null ? void 0 : g.type) || "native",
2087
- URL: u.currentSrc
2127
+ Buffer: h.buffered.length > 0 ? `${(h.buffered.end(h.buffered.length - 1) - h.currentTime).toFixed(2)}s` : "0s",
2128
+ Engine: ((x = s.store.get().sources[s.store.get().currentSourceIndex]) == null ? void 0 : x.type) || "native",
2129
+ URL: h.currentSrc
2088
2130
  });
2089
2131
  };
2090
- r();
2091
- const h = setInterval(r, 1e3);
2092
- return () => clearInterval(h);
2093
- }, [n]), /* @__PURE__ */ e("div", { className: "absolute inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200", children: /* @__PURE__ */ d(
2132
+ a();
2133
+ const u = setInterval(a, 1e3);
2134
+ return () => clearInterval(u);
2135
+ }, [s]), /* @__PURE__ */ e("div", { className: "absolute inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200", children: /* @__PURE__ */ c(
2094
2136
  "div",
2095
2137
  {
2096
2138
  className: "bg-[var(--bg-panel)] border border-white/10 rounded-xl w-full max-w-md shadow-2xl relative font-mono text-xs text-zinc-300 flex flex-col",
2097
2139
  style: { borderRadius: "var(--radius)", maxHeight: "90%" },
2098
2140
  children: [
2099
- /* @__PURE__ */ d("div", { className: "p-5 pb-0 flex-shrink-0 relative", children: [
2141
+ /* @__PURE__ */ c("div", { className: "p-5 pb-0 flex-shrink-0 relative", children: [
2100
2142
  /* @__PURE__ */ e(
2101
2143
  "button",
2102
2144
  {
2103
- onClick: (r) => {
2104
- r.stopPropagation(), t();
2145
+ onClick: (a) => {
2146
+ a.stopPropagation(), t();
2105
2147
  },
2106
2148
  className: "absolute top-3 right-3 p-1.5 text-zinc-400 hover:text-white hover:bg-white/10 rounded-full transition-colors",
2107
- children: /* @__PURE__ */ e(Gt, { className: "w-4 h-4" })
2149
+ children: /* @__PURE__ */ e(ti, { className: "w-4 h-4" })
2108
2150
  }
2109
2151
  ),
2110
2152
  /* @__PURE__ */ e("h3", { className: "text-sm font-bold text-white mb-4 uppercase tracking-wider border-b border-white/10 pb-2", children: "Video Statistics" })
2111
2153
  ] }),
2112
- /* @__PURE__ */ e("div", { className: "overflow-y-auto hide-scrollbar p-5 pt-0 space-y-2.5 flex-1 min-h-0", children: Object.entries(i).map(([r, h]) => /* @__PURE__ */ d("div", { className: "flex flex-col sm:flex-row sm:justify-between sm:items-center gap-1", children: [
2113
- /* @__PURE__ */ e("span", { className: "text-zinc-500 font-bold shrink-0", children: r }),
2114
- /* @__PURE__ */ e("span", { className: "text-zinc-200 truncate select-all font-medium bg-white/5 px-1.5 py-0.5 rounded break-all text-right", title: String(h), children: String(h) })
2115
- ] }, r)) })
2154
+ /* @__PURE__ */ e("div", { className: "overflow-y-auto hide-scrollbar p-5 pt-0 space-y-2.5 flex-1 min-h-0", children: Object.entries(i).map(([a, u]) => /* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row sm:justify-between sm:items-center gap-1", children: [
2155
+ /* @__PURE__ */ e("span", { className: "text-zinc-500 font-bold shrink-0", children: a }),
2156
+ /* @__PURE__ */ e("span", { className: "text-zinc-200 truncate select-all font-medium bg-white/5 px-1.5 py-0.5 rounded break-all text-right", title: String(u), children: String(u) })
2157
+ ] }, a)) })
2116
2158
  ]
2117
2159
  }
2118
2160
  ) });
2119
2161
  };
2120
- function gn(n) {
2121
- if (!n) return "#ffffff";
2122
- n = n.replace("#", ""), n.length === 3 && (n = n.split("").map((h) => h + h).join(""));
2123
- const t = parseInt(n.substring(0, 2), 16), i = parseInt(n.substring(2, 4), 16), o = parseInt(n.substring(4, 6), 16);
2162
+ function Cs(s) {
2163
+ if (!s) return "#ffffff";
2164
+ s = s.replace("#", ""), s.length === 3 && (s = s.split("").map((u) => u + u).join(""));
2165
+ const t = parseInt(s.substring(0, 2), 16), i = parseInt(s.substring(2, 4), 16), o = parseInt(s.substring(4, 6), 16);
2124
2166
  return (t * 299 + i * 587 + o * 114) / 1e3 >= 128 ? "#000000" : "#ffffff";
2125
2167
  }
2126
- const vn = [
2168
+ const Ns = [
2127
2169
  { label: "Strata", value: "#6366f1" },
2128
2170
  { label: "Emerald", value: "#10b981" },
2129
2171
  { label: "Rose", value: "#f43f5e" },
2130
2172
  { label: "Amber", value: "#f59e0b" },
2131
2173
  { label: "Sky", value: "#0ea5e9" },
2132
2174
  { label: "Violet", value: "#8b5cf6" }
2133
- ], xn = [
2175
+ ], Ms = [
2134
2176
  { label: "Default", value: "default", color: "#6366f1" },
2135
2177
  { label: "Pixel", value: "pixel", color: "#ef4444" },
2136
2178
  { label: "Game", value: "game", color: "#eab308" },
2137
2179
  { label: "Hacker", value: "hacker", color: "#22c55e" }
2138
- ], Dt = ({ content: n, className: t, style: i }) => typeof n == "string" ? n.trim().startsWith("<") ? /* @__PURE__ */ e("div", { className: t, style: i, dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ e("div", { className: t, style: i, children: n }) : /* @__PURE__ */ e("div", { className: t, style: i, children: n }), Ot = (n) => {
2139
- var Lt, $t;
2140
- const { src: t, type: i, sources: o, poster: r, autoPlay: h, thumbnails: u, textTracks: f, plugins: g, onGetInstance: x, ...p } = n, w = p.screenshot ?? !1, m = p.pip ?? !0, T = p.setting ?? !0, I = p.fullscreen ?? !0, O = p.fullscreenWeb ?? !1, Y = p.lock ?? !1, W = p.fastForward ?? !0, b = p.flip ?? !0, H = p.aspectRatio ?? !0, k = p.hotKey ?? !0, q = p.backdrop ?? !0, $ = p.gestureSeek ?? !1, j = p.centerControls ?? !0, Z = p.fetchTimeout ?? 3e4;
2141
- p.autoOrientation;
2142
- const P = U(null), [s, ie] = N(null), [ne, le] = N(!1), [ce, Se] = N(0), [nt, Ce] = N(0), [st, qt] = N(!1), ot = xe(() => Wt(p), []), a = bi(
2143
- $e((c) => s ? s.store.subscribe(c) : () => {
2144
- }, [s]),
2145
- () => s ? s.store.get() : ot,
2146
- () => ot
2147
- ), Xt = xe(() => gn(a.themeColor), [a.themeColor]), [B, rt] = N(!1), [V, at] = N(!1), [X, D] = N("main"), [E, Ve] = N(null), De = U(null);
2148
- E && (De.current = E);
2149
- const [se, lt] = N({ x: 0, y: 0, visible: !1 }), [Qt, ct] = N(!1), dt = Ke(B, 300), ut = Ke(V, 300), Ne = Ke(!!E, 300), C = $e(() => {
2150
- (B || V || E || se.visible) && (rt(!1), at(!1), Ve(null), lt((c) => ({ ...c, visible: !1 })));
2151
- }, [B, V, E, se.visible]);
2152
- Q(() => {
2153
- const c = (v) => {
2154
- (B || V || E || se.visible) && C();
2180
+ ], Qt = ({ content: s, className: t, style: i }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("div", { className: t, style: i, dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("div", { className: t, style: i, children: s }) : /* @__PURE__ */ e("div", { className: t, style: i, children: s }), Yt = (s) => {
2181
+ var Dt, Ot;
2182
+ const { src: t, type: i, sources: o, poster: a, autoPlay: u, thumbnails: h, textTracks: f, plugins: x, onGetInstance: b, ...m } = s, v = m.screenshot ?? !1, p = m.pip ?? !0, S = m.setting ?? !0, $ = m.fullscreen ?? !0, U = m.fullscreenWeb ?? !1, H = m.lock ?? !1, q = m.fastForward ?? !0, g = m.flip ?? !0, Y = m.aspectRatio ?? !0, G = m.hotKey ?? !0, fe = m.backdrop ?? !0, k = m.gestureSeek ?? !1, j = m.centerControls ?? !0, D = m.fetchTimeout ?? 3e4;
2183
+ m.autoOrientation;
2184
+ const T = W(null), [n, X] = M(null), [_, ne] = M(!1), [re, be] = M(0), [ge, Te] = M(0), [We, je] = M(!1), ct = Ce(() => Kt(m), []), r = Ni(
2185
+ Ve((d) => n ? n.store.subscribe(d) : () => {
2186
+ }, [n]),
2187
+ () => n ? n.store.get() : ct,
2188
+ () => ct
2189
+ ), si = Ce(() => Cs(r.themeColor), [r.themeColor]), [V, dt] = M(!1), [B, ut] = M(!1), [J, A] = M("main"), [E, Ue] = M(null), Ge = W(null);
2190
+ E && (Ge.current = E);
2191
+ const [oe, ht] = M({ x: 0, y: 0, visible: !1 }), [ni, mt] = M(!1), pt = st(V, 300), ft = st(B, 300), ze = st(!!E, 300), z = Ve(() => {
2192
+ (V || B || E || oe.visible) && (dt(!1), ut(!1), Ue(null), ht((d) => ({ ...d, visible: !1 })));
2193
+ }, [V, B, E, oe.visible]);
2194
+ ee(() => {
2195
+ const d = (w) => {
2196
+ (V || B || E || oe.visible) && z();
2155
2197
  };
2156
- return (B || V || E || se.visible) && (document.addEventListener("click", c), document.addEventListener("touchstart", c)), () => {
2157
- document.removeEventListener("click", c), document.removeEventListener("touchstart", c);
2198
+ return (V || B || E || oe.visible) && (document.addEventListener("click", d), document.addEventListener("touchstart", d)), () => {
2199
+ document.removeEventListener("click", d), document.removeEventListener("touchstart", d);
2158
2200
  };
2159
- }, [B, V, E, se.visible, C]);
2160
- const [Oe, Me] = N(!1), [Te, He] = N(0), [Jt, ht] = N(!1), [Kt, pt] = N(!1), [We, ze] = N(!1), [mt, ft] = N([]), [bt, gt] = N(null), [Yt, Zt] = N(0), [re, vt] = N(null), [de, Ie] = N(null), [wn, xt] = N(null), [je, wt] = N(!1), Ue = U(null), yt = U(1), be = U(null), kt = U(0), fe = U(!1), ge = U(null), ae = U(null), Ge = U(null), _e = U(null), ve = U(null);
2161
- Ee(() => {
2162
- s && P.current && s.attach(P.current);
2163
- }, [s, a.isWebFullscreen]), Ee(() => {
2164
- if (!P.current) return;
2201
+ }, [V, B, E, oe.visible, z]);
2202
+ const [_e, Ie] = M(!1), [Re, qe] = M(0), [oi, bt] = M(!1), [ai, gt] = M(!1), [Pe, ve] = M(!1), [vt, Xe] = M(!1), [xt, wt] = M([]), [yt, kt] = M(null), [ri, li] = M(0), [ce, St] = M(null), [ue, Le] = M(null), [Ts, Ct] = M(null), [Qe, Nt] = M(!1), Ye = W(null), Mt = W(1), we = W(null), Fe = W(null), Tt = W(0), zt = W(0), It = W(0), te = W(null), ye = W(!1), ke = W(null), de = W(null), Je = W(null), Ke = W(null), Se = W(null);
2203
+ Be(() => {
2204
+ n && T.current && n.attach(T.current);
2205
+ }, [n, r.isWebFullscreen]), Be(() => {
2206
+ if (!T.current) return;
2165
2207
  (() => {
2166
- P.current && (Se(P.current.clientHeight), Ce(P.current.clientWidth));
2208
+ T.current && (be(T.current.clientHeight), Te(T.current.clientWidth));
2167
2209
  })();
2168
- const v = new ResizeObserver((S) => {
2169
- for (const M of S)
2170
- Se(M.contentRect.height), Ce(M.contentRect.width);
2210
+ const w = new ResizeObserver((C) => {
2211
+ for (const N of C)
2212
+ be(N.contentRect.height), Te(N.contentRect.width);
2171
2213
  });
2172
- return v.observe(P.current), () => {
2173
- v.disconnect();
2214
+ return w.observe(T.current), () => {
2215
+ w.disconnect();
2174
2216
  };
2175
- }, [a.isWebFullscreen]), Q(() => {
2176
- if (qt("ontouchstart" in window || navigator.maxTouchPoints > 0), !P.current) return;
2177
- const c = new Ni({ ...p, poster: r });
2178
- return g && g.length > 0 && g.forEach((v) => c.use(v)), c.attach(P.current), ie(c), x && x(c), () => {
2179
- c.destroy(), ie(null);
2217
+ }, [r.isWebFullscreen]), ee(() => {
2218
+ if (je("ontouchstart" in window || navigator.maxTouchPoints > 0), !T.current) return;
2219
+ const d = new $i({ ...m, poster: a });
2220
+ return x && x.length > 0 && x.forEach((w) => d.use(w)), d.attach(T.current), X(d), b && b(d), () => {
2221
+ d.destroy(), X(null);
2180
2222
  };
2181
- }, []), Q(() => {
2182
- if (!s) return;
2183
- const c = {};
2184
- p.theme !== void 0 && p.theme !== a.theme && (c.theme = p.theme), p.themeColor !== void 0 && p.themeColor !== a.themeColor && (c.themeColor = p.themeColor), p.iconSize !== void 0 && p.iconSize !== a.iconSize && (c.iconSize = p.iconSize), Object.keys(c).length > 0 && s.setAppearance(c), p.volume !== void 0 && Math.abs(p.volume - a.volume) > 0.01 && s.setVolume(p.volume), p.muted !== void 0 && p.muted !== a.isMuted && (p.muted ? s.video.muted = !0 : s.video.muted = !1);
2185
- }, [s, p.theme, p.themeColor, p.iconSize, p.volume, p.muted]), Q(() => {
2186
- if (!s) return;
2187
- const c = f || [];
2188
- o && o.length > 0 ? (le(!1), s.setSources(o, c)) : t && (le(!1), s.setSources([{ url: t, type: i || "auto" }], c));
2189
- }, [t, i, o, f, s]), Q(() => {
2190
- s && h && s.play().catch(() => {
2191
- s.pause(), s.store.setState({ isPlaying: !1, isBuffering: !1 }), s.notify({ type: "warning", message: "Autoplay blocked by browser. Click play to start.", duration: 5e3 });
2223
+ }, []), ee(() => {
2224
+ if (!n) return;
2225
+ const d = {};
2226
+ m.theme !== void 0 && m.theme !== r.theme && (d.theme = m.theme), m.themeColor !== void 0 && m.themeColor !== r.themeColor && (d.themeColor = m.themeColor), m.iconSize !== void 0 && m.iconSize !== r.iconSize && (d.iconSize = m.iconSize), m.brightness !== void 0 && Math.abs(m.brightness - r.brightness) > 0.05 && n.setBrightness(m.brightness), m.videoFit !== void 0 && m.videoFit !== r.videoFit && n.setVideoFit(m.videoFit), Object.keys(d).length > 0 && n.setAppearance(d), m.volume !== void 0 && Math.abs(m.volume - r.volume) > 0.01 && n.setVolume(m.volume), m.muted !== void 0 && m.muted !== r.isMuted && (m.muted ? n.video.muted = !0 : n.video.muted = !1);
2227
+ }, [n, m.theme, m.themeColor, m.iconSize, m.volume, m.muted, m.brightness, m.videoFit]), ee(() => {
2228
+ if (!n) return;
2229
+ const d = f || [];
2230
+ o && o.length > 0 ? (ne(!1), n.setSources(o, d)) : t && (ne(!1), n.setSources([{ url: t, type: i || "auto" }], d));
2231
+ }, [t, i, o, f, n]), ee(() => {
2232
+ n && u && n.play().catch(() => {
2233
+ n.pause(), n.store.setState({ isPlaying: !1, isBuffering: !1 }), n.notify({ type: "warning", message: "Autoplay blocked by browser. Click play to start.", duration: 5e3 });
2192
2234
  });
2193
- }, [s, h]), Q(() => {
2194
- a.isPlaying && !ne && le(!0);
2195
- }, [a.isPlaying, ne]), Q(() => {
2196
- u && s ? Si(u, s.notify.bind(s), Z).then((c) => ft(c)) : ft([]);
2197
- }, [u, s, Z]), Q(() => (de && (ve.current && clearTimeout(ve.current), ve.current = setTimeout(() => {
2198
- Ie(null);
2235
+ }, [n, u]), ee(() => {
2236
+ r.isPlaying && !_ && ne(!0);
2237
+ }, [r.isPlaying, _]), ee(() => {
2238
+ h && n ? Li(h, n.notify.bind(n), D).then((d) => wt(d)) : wt([]);
2239
+ }, [h, n, D]), ee(() => (ue && (Se.current && clearTimeout(Se.current), Se.current = setTimeout(() => {
2240
+ Le(null);
2199
2241
  }, 600)), () => {
2200
- ve.current && clearTimeout(ve.current);
2201
- }), [de]), Q(() => {
2202
- const c = (v) => {
2203
- var M;
2204
- if (!s || !k || ((M = document.activeElement) == null ? void 0 : M.tagName) === "INPUT") return;
2205
- switch (v.key.toLowerCase()) {
2242
+ Se.current && clearTimeout(Se.current);
2243
+ }), [ue]), ee(() => {
2244
+ const d = (w) => {
2245
+ var N;
2246
+ if (!n || !G || ((N = document.activeElement) == null ? void 0 : N.tagName) === "INPUT") return;
2247
+ switch (w.key.toLowerCase()) {
2206
2248
  case " ":
2207
2249
  case "k":
2208
- v.preventDefault(), s.togglePlay();
2250
+ w.preventDefault(), n.togglePlay();
2209
2251
  break;
2210
2252
  case "arrowright":
2211
- v.preventDefault(), s.skip(5);
2253
+ w.preventDefault(), n.skip(5);
2212
2254
  break;
2213
2255
  case "arrowleft":
2214
- v.preventDefault(), s.skip(-5);
2256
+ w.preventDefault(), n.skip(-5);
2215
2257
  break;
2216
2258
  case "arrowup":
2217
- v.preventDefault(), s.setVolume(s.video.volume + 0.1);
2259
+ w.preventDefault(), n.setVolume(n.video.volume + 0.1);
2218
2260
  break;
2219
2261
  case "arrowdown":
2220
- v.preventDefault(), s.setVolume(s.video.volume - 0.1);
2262
+ w.preventDefault(), n.setVolume(n.video.volume - 0.1);
2221
2263
  break;
2222
2264
  case "f":
2223
- v.preventDefault(), s.toggleFullscreen();
2265
+ w.preventDefault(), n.toggleFullscreen();
2224
2266
  break;
2225
2267
  case "m":
2226
- v.preventDefault(), s.toggleMute();
2268
+ w.preventDefault(), n.toggleMute();
2227
2269
  break;
2228
2270
  case "escape":
2229
- s.store.get().isWebFullscreen && (v.preventDefault(), s.toggleWebFullscreen());
2271
+ n.store.get().isWebFullscreen && (w.preventDefault(), n.toggleWebFullscreen());
2230
2272
  break;
2231
2273
  }
2232
2274
  };
2233
- return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
2234
- }, [s, k]);
2235
- const St = () => {
2236
- s && (s.setControlsVisible(!0), ae.current && clearTimeout(ae.current), !(B || V || E) && (ae.current = setTimeout(() => {
2237
- !a.isPlaying || B || V || E || s.setControlsVisible(!1);
2275
+ return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
2276
+ }, [n, G]);
2277
+ const Rt = () => {
2278
+ n && (n.setControlsVisible(!0), de.current && clearTimeout(de.current), !(V || B || E) && (de.current = setTimeout(() => {
2279
+ !r.isPlaying || V || B || E || n.setControlsVisible(!1);
2238
2280
  }, 2500)));
2239
2281
  };
2240
- Q(() => {
2241
- s && (!B && !V && !E && a.isPlaying ? St() : (B || V || E) && (s.setControlsVisible(!0), ae.current && clearTimeout(ae.current)));
2242
- }, [B, V, E, a.isPlaying, s]);
2243
- const Ct = $e(() => {
2244
- if (!(!W || !s || !a.isPlaying || a.isLocked)) {
2245
- if (B || V || E) {
2246
- C();
2282
+ ee(() => {
2283
+ n && (!V && !B && !E && r.isPlaying ? Rt() : (V || B || E) && (n.setControlsVisible(!0), de.current && clearTimeout(de.current)));
2284
+ }, [V, B, E, r.isPlaying, n]);
2285
+ const Pt = Ve(() => {
2286
+ if (!(!q || !n || !r.isPlaying || r.isLocked)) {
2287
+ if (V || B || E) {
2288
+ z();
2247
2289
  return;
2248
2290
  }
2249
- yt.current = s.video.playbackRate, Ue.current = setTimeout(() => {
2250
- s.video.playbackRate = 2, wt(!0);
2291
+ Mt.current = n.video.playbackRate, Ye.current = setTimeout(() => {
2292
+ n.video.playbackRate = 2, Nt(!0);
2251
2293
  }, 500);
2252
2294
  }
2253
- }, [W, s, a.isPlaying, a.isLocked, B, V, E]), qe = $e(() => {
2254
- Ue.current && clearTimeout(Ue.current), je && s && (s.video.playbackRate = yt.current, wt(!1));
2255
- }, [je, s]), ei = (c) => {
2256
- if (Ct(), B || V || E) {
2257
- C();
2295
+ }, [q, n, r.isPlaying, r.isLocked, V, B, E]), Ze = Ve(() => {
2296
+ Ye.current && clearTimeout(Ye.current), Qe && n && (n.video.playbackRate = Mt.current, Nt(!1));
2297
+ }, [Qe, n]), ci = (d) => {
2298
+ if (Pt(), V || B || E) {
2299
+ z();
2258
2300
  return;
2259
2301
  }
2260
- $ && !a.isLocked && (be.current = c.touches[0].clientX, kt.current = a.currentTime, fe.current = !1);
2261
- }, ti = (c) => {
2262
- if (!a.isLocked && $ && be.current !== null) {
2263
- const v = c.touches[0].clientX - be.current;
2264
- if (Math.abs(v) > 10 && (qe(), fe.current = !0, Me(!0), P.current && a.duration)) {
2265
- const S = P.current.getBoundingClientRect(), M = v / S.width, L = Math.max(0, Math.min(a.duration, kt.current + M * a.duration));
2266
- He(L);
2302
+ r.isLocked || (we.current = d.touches[0].clientX, Fe.current = d.touches[0].clientY, Tt.current = r.currentTime, zt.current = r.volume, It.current = r.brightness, ye.current = !1, te.current = null);
2303
+ }, di = (d) => {
2304
+ var ae, l;
2305
+ if (r.isLocked || !n || we.current === null || Fe.current === null) return;
2306
+ const w = d.touches[0].clientX, C = d.touches[0].clientY, N = w - we.current, P = C - Fe.current;
2307
+ if (!te.current && (Math.abs(N) > 10 || Math.abs(P) > 10))
2308
+ if (ye.current = !0, Ze(), Math.abs(N) > Math.abs(P))
2309
+ k && (te.current = "seek", Ie(!0));
2310
+ else {
2311
+ const R = T.current ? T.current.clientWidth / 2 : window.innerWidth / 2;
2312
+ we.current < R ? (te.current = "brightness", Xe(!0)) : (te.current = "volume", ve(!0));
2267
2313
  }
2314
+ if (te.current === "seek" && T.current && r.duration) {
2315
+ const R = T.current.getBoundingClientRect(), O = N / R.width, I = Math.max(0, Math.min(r.duration, Tt.current + O * r.duration));
2316
+ qe(I);
2317
+ } else if (te.current === "volume") {
2318
+ const O = -(P / (((ae = T.current) == null ? void 0 : ae.clientHeight) || 300)) * 1.5;
2319
+ n.setVolume(Math.max(0, Math.min(1, zt.current + O)));
2320
+ } else if (te.current === "brightness") {
2321
+ const O = -(P / (((l = T.current) == null ? void 0 : l.clientHeight) || 300)) * 1.5;
2322
+ n.setBrightness(Math.max(0, Math.min(2, It.current + O)));
2268
2323
  }
2269
- }, ii = (c) => {
2270
- if (qe(), $ && fe.current) {
2271
- s == null || s.seek(Te), Me(!1), fe.current = !1, be.current = null;
2272
- return;
2273
- }
2274
- be.current = null;
2275
- }, Xe = (c) => {
2276
- if (!Ge.current || !a.duration) return 0;
2277
- const v = Ge.current.getBoundingClientRect(), S = "touches" in c ? c.touches[0].clientX : c.clientX;
2278
- return Math.max(0, Math.min(1, (S - v.left) / v.width)) * a.duration;
2279
- }, Nt = (c) => {
2280
- if (c.stopPropagation(), a.isLocked) return;
2281
- (B || V || E) && C(), Me(!0), He(Xe(c));
2282
- const v = (M) => He(Xe(M)), S = (M) => {
2283
- s == null || s.seek(Xe(M)), Me(!1), document.removeEventListener("mousemove", v), document.removeEventListener("touchmove", v), document.removeEventListener("mouseup", S), document.removeEventListener("touchend", S);
2324
+ }, ui = (d) => {
2325
+ Ze(), te.current === "seek" ? (n == null || n.seek(Re), Ie(!1)) : te.current === "volume" ? ve(!1) : te.current === "brightness" && Xe(!1), ye.current = !1, te.current = null, we.current = null, Fe.current = null;
2326
+ }, et = (d) => {
2327
+ if (!Je.current || !r.duration) return 0;
2328
+ const w = Je.current.getBoundingClientRect(), C = "touches" in d ? d.touches[0].clientX : d.clientX;
2329
+ return Math.max(0, Math.min(1, (C - w.left) / w.width)) * r.duration;
2330
+ }, Lt = (d) => {
2331
+ if (d.stopPropagation(), r.isLocked) return;
2332
+ (V || B || E) && z(), Ie(!0), qe(et(d));
2333
+ const w = (N) => qe(et(N)), C = (N) => {
2334
+ n == null || n.seek(et(N)), Ie(!1), document.removeEventListener("mousemove", w), document.removeEventListener("touchmove", w), document.removeEventListener("mouseup", C), document.removeEventListener("touchend", C);
2284
2335
  };
2285
- document.addEventListener("mousemove", v), document.addEventListener("touchmove", v), document.addEventListener("mouseup", S), document.addEventListener("touchend", S);
2286
- }, Mt = (c) => {
2287
- if (!_e.current) return 0;
2288
- const v = _e.current.getBoundingClientRect(), S = "touches" in c ? c.touches[0].clientX : c.clientX;
2289
- return Math.max(0, Math.min(1, (S - v.left) / v.width));
2290
- }, Tt = (c) => {
2291
- if (c.stopPropagation(), !s || a.isLocked) return;
2292
- ht(!0), s.setVolume(Mt(c));
2293
- const v = (M) => s.setVolume(Mt(M)), S = () => {
2294
- ht(!1), document.removeEventListener("mousemove", v), document.removeEventListener("touchmove", v), document.removeEventListener("mouseup", S), document.removeEventListener("touchend", S);
2336
+ document.addEventListener("mousemove", w), document.addEventListener("touchmove", w), document.addEventListener("mouseup", C), document.addEventListener("touchend", C);
2337
+ }, Ft = (d) => {
2338
+ if (!Ke.current) return 0;
2339
+ const w = Ke.current.getBoundingClientRect(), C = "touches" in d ? d.touches[0].clientX : d.clientX;
2340
+ return Math.max(0, Math.min(1, (C - w.left) / w.width));
2341
+ }, $t = (d) => {
2342
+ if (d.stopPropagation(), !n || r.isLocked) return;
2343
+ bt(!0), n.setVolume(Ft(d));
2344
+ const w = (N) => n.setVolume(Ft(N)), C = () => {
2345
+ bt(!1), document.removeEventListener("mousemove", w), document.removeEventListener("touchmove", w), document.removeEventListener("mouseup", C), document.removeEventListener("touchend", C);
2295
2346
  };
2296
- document.addEventListener("mousemove", v), document.addEventListener("touchmove", v), document.addEventListener("mouseup", S), document.addEventListener("touchend", S);
2297
- }, ni = (c) => {
2298
- if (!a.duration || a.isLive) return;
2299
- const v = c.currentTarget.getBoundingClientRect(), S = (c.clientX - v.left) / v.width, M = S * a.duration;
2300
- Zt(S * 100), gt(M), mt.length > 0 && vt(mt.find((L) => M >= L.start && M < L.end) || null);
2301
- }, Re = (c) => {
2302
- !s || a.isLocked || (s.skip(c === "forward" ? 10 : -10), xt(c), setTimeout(() => xt(null), 300));
2303
- }, si = (c) => {
2304
- if (!s) return;
2305
- if (fe.current) {
2306
- fe.current = !1;
2347
+ document.addEventListener("mousemove", w), document.addEventListener("touchmove", w), document.addEventListener("mouseup", C), document.addEventListener("touchend", C);
2348
+ }, hi = (d) => {
2349
+ if (!r.duration || r.isLive) return;
2350
+ const w = d.currentTarget.getBoundingClientRect(), C = (d.clientX - w.left) / w.width, N = C * r.duration;
2351
+ li(C * 100), kt(N), xt.length > 0 && St(xt.find((P) => N >= P.start && N < P.end) || null);
2352
+ }, $e = (d) => {
2353
+ !n || r.isLocked || (n.skip(d === "forward" ? 10 : -10), Ct(d), setTimeout(() => Ct(null), 300));
2354
+ }, mi = (d) => {
2355
+ if (!n) return;
2356
+ if (ye.current) {
2357
+ ye.current = !1;
2307
2358
  return;
2308
2359
  }
2309
- if (B || V || E || se.visible) {
2310
- C();
2360
+ if (V || B || E || oe.visible) {
2361
+ z();
2311
2362
  return;
2312
2363
  }
2313
- if (We && ze(!1), s.setControlsVisible(!0), ae.current && clearTimeout(ae.current), ae.current = setTimeout(() => {
2314
- !a.isPlaying || B || V || E || s.setControlsVisible(!1);
2315
- }, 2500), a.isLocked) return;
2316
- const v = c.currentTarget.getBoundingClientRect(), S = c.clientX - v.left, M = v.width, L = Date.now();
2317
- ge.current ? (clearTimeout(ge.current), ge.current = null, S < M * 0.35 ? (Re("rewind"), Ie({ type: "rewind", id: L })) : S > M * 0.65 ? (Re("forward"), Ie({ type: "forward", id: L })) : s.toggleFullscreen()) : ge.current = setTimeout(() => {
2318
- s.togglePlay(), ge.current = null;
2364
+ if (Pe && ve(!1), vt && Xe(!1), n.setControlsVisible(!0), de.current && clearTimeout(de.current), de.current = setTimeout(() => {
2365
+ !r.isPlaying || V || B || E || n.setControlsVisible(!1);
2366
+ }, 2500), r.isLocked) return;
2367
+ const w = d.currentTarget.getBoundingClientRect(), C = d.clientX - w.left, N = w.width, P = Date.now();
2368
+ ke.current ? (clearTimeout(ke.current), ke.current = null, C < N * 0.35 ? ($e("rewind"), Le({ type: "rewind", id: P })) : C > N * 0.65 ? ($e("forward"), Le({ type: "forward", id: P })) : n.toggleFullscreen()) : ke.current = setTimeout(() => {
2369
+ n.togglePlay(), ke.current = null;
2319
2370
  }, 250);
2320
- }, oi = (c) => {
2321
- var S;
2322
- if (c.preventDefault(), c.stopPropagation(), a.isLocked) return;
2323
- C();
2324
- const v = (S = P.current) == null ? void 0 : S.getBoundingClientRect();
2325
- v && requestAnimationFrame(() => {
2326
- lt({
2371
+ }, pi = (d) => {
2372
+ var C;
2373
+ if (d.preventDefault(), d.stopPropagation(), r.isLocked) return;
2374
+ z();
2375
+ const w = (C = T.current) == null ? void 0 : C.getBoundingClientRect();
2376
+ w && requestAnimationFrame(() => {
2377
+ ht({
2327
2378
  visible: !0,
2328
- x: c.clientX - v.left,
2329
- y: c.clientY - v.top
2379
+ x: d.clientX - w.left,
2380
+ y: d.clientY - w.top
2330
2381
  });
2331
2382
  });
2332
- }, ri = (c) => {
2333
- if (c.stopPropagation(), C(), We) {
2334
- ze(!1);
2383
+ }, fi = (d) => {
2384
+ if (d.stopPropagation(), z(), Pe) {
2385
+ ve(!1);
2335
2386
  return;
2336
2387
  }
2337
- st ? ze(!0) : s == null || s.toggleMute();
2338
- }, ai = a.isMuted || a.volume === 0 ? zi : a.volume < 0.5 ? Ti : Mi, Pe = Math.max(100, ce - 120), li = () => {
2339
- switch (a.iconSize) {
2388
+ We ? ve(!0) : n == null || n.toggleMute();
2389
+ }, bi = r.isMuted || r.volume === 0 ? Ut : r.volume < 0.5 ? Ei : jt, Ee = Math.max(100, re - 120), gi = () => {
2390
+ switch (r.iconSize) {
2340
2391
  case "small":
2341
2392
  return "w-4 h-4";
2342
2393
  case "large":
@@ -2344,8 +2395,8 @@ const vn = [
2344
2395
  default:
2345
2396
  return "w-5 h-5";
2346
2397
  }
2347
- }, ci = () => {
2348
- switch (a.iconSize) {
2398
+ }, vi = () => {
2399
+ switch (r.iconSize) {
2349
2400
  case "small":
2350
2401
  return "p-2 min-w-[32px] min-h-[32px]";
2351
2402
  case "large":
@@ -2353,8 +2404,8 @@ const vn = [
2353
2404
  default:
2354
2405
  return "p-2.5 min-w-[36px] min-h-[36px]";
2355
2406
  }
2356
- }, J = li(), ee = ci(), ue = (() => {
2357
- switch (a.iconSize) {
2407
+ }, ie = gi(), se = vi(), he = (() => {
2408
+ switch (r.iconSize) {
2358
2409
  case "small":
2359
2410
  return {
2360
2411
  playBtn: "w-14 h-14",
@@ -2377,8 +2428,8 @@ const vn = [
2377
2428
  skipIcon: "w-6 h-6"
2378
2429
  };
2379
2430
  }
2380
- })(), di = !a.isLocked && (a.controlsVisible || !a.isPlaying || B || V || E || se.visible), zt = Kt || Jt || We, Le = q ? "backdrop-blur-xl bg-black/80" : "bg-black/95", It = xe(() => {
2381
- const c = [
2431
+ })(), xi = !r.isLocked && (r.controlsVisible || !r.isPlaying || V || B || E || oe.visible), Et = ai || oi || Pe, Ae = fe ? "backdrop-blur-xl bg-black/80" : "bg-black/95", At = Ce(() => {
2432
+ const d = [
2382
2433
  { id: "play", position: "left", index: 10, isBuiltIn: !0 },
2383
2434
  { id: "volume", position: "left", index: 20, isBuiltIn: !0 },
2384
2435
  { id: "time", position: "left", index: 30, isBuiltIn: !0 },
@@ -2390,304 +2441,325 @@ const vn = [
2390
2441
  { id: "fullscreenWeb", position: "right", index: 110, isBuiltIn: !0 },
2391
2442
  { id: "fullscreen", position: "right", index: 120, isBuiltIn: !0 }
2392
2443
  ];
2393
- p.controls && p.controls.forEach((L) => {
2394
- const he = c.find((l) => l.id === L.id);
2395
- he ? Object.assign(he, L) : c.push(L);
2444
+ m.controls && m.controls.forEach((P) => {
2445
+ const ae = d.find((l) => l.id === P.id);
2446
+ ae ? Object.assign(ae, P) : d.push(P);
2396
2447
  });
2397
- const v = a.sources[a.currentSourceIndex] || { url: t || "", type: i || "auto" }, S = v.type === "hls" || v.url.includes(".m3u8"), M = c.find((L) => L.id === "download");
2398
- return M && (S ? (M.children = [
2448
+ const w = r.sources[r.currentSourceIndex] || { url: t || "", type: i || "auto" }, C = w.type === "hls" || w.url.includes(".m3u8"), N = d.find((P) => P.id === "download");
2449
+ return N && (C ? (N.children = [
2399
2450
  { html: "Download Format", isLabel: !0 },
2400
2451
  {
2401
2452
  html: "MPEG-TS",
2402
2453
  value: "Original Stream",
2403
- icon: /* @__PURE__ */ e(_t, { className: "w-3.5 h-3.5" }),
2404
- onClick: () => s == null ? void 0 : s.download({ format: "ts" })
2454
+ icon: /* @__PURE__ */ e(ii, { className: "w-3.5 h-3.5" }),
2455
+ onClick: () => n == null ? void 0 : n.download({ format: "ts" })
2405
2456
  },
2406
2457
  {
2407
2458
  html: "MP4",
2408
2459
  value: "Converted",
2409
- icon: /* @__PURE__ */ e(jt, { className: "w-3.5 h-3.5" }),
2410
- onClick: () => s == null ? void 0 : s.download({ format: "mp4" })
2460
+ icon: /* @__PURE__ */ e(Zt, { className: "w-3.5 h-3.5" }),
2461
+ onClick: () => n == null ? void 0 : n.download({ format: "mp4" })
2411
2462
  }
2412
- ], M.onClick = void 0) : (M.children = void 0, M.onClick = (L) => L.download())), c.filter((L) => !(L.id === "screenshot" && !w || L.id === "pip" && !m || L.id === "settings" && !T || L.id === "fullscreen" && !I || L.id === "fullscreenWeb" && !O)).sort((L, he) => L.index - he.index);
2413
- }, [p.controls, w, m, T, I, O, a.currentSourceIndex, a.sources, t, i]), Rt = (c) => {
2414
- var v, S, M, L, he;
2415
- if (!c.isBuiltIn) {
2416
- const l = c.id || `ctrl-${c.index}`, F = E === l, G = F || Ne.isMounted && De.current === l;
2417
- return /* @__PURE__ */ d("div", { className: "relative", children: [
2463
+ ], N.onClick = void 0) : (N.children = void 0, N.onClick = (P) => P.download())), d.filter((P) => !(P.id === "screenshot" && !v || P.id === "pip" && !p || P.id === "settings" && !S || P.id === "fullscreen" && !$ || P.id === "fullscreenWeb" && !U)).sort((P, ae) => P.index - ae.index);
2464
+ }, [m.controls, v, p, S, $, U, r.currentSourceIndex, r.sources, t, i]), Vt = (d) => {
2465
+ var w, C, N, P, ae;
2466
+ if (!d.isBuiltIn) {
2467
+ const l = d.id || `ctrl-${d.index}`, R = E === l, O = R || ze.isMounted && Ge.current === l;
2468
+ return /* @__PURE__ */ c("div", { className: "relative", children: [
2418
2469
  /* @__PURE__ */ e(
2419
2470
  "button",
2420
2471
  {
2421
- onMouseDown: (z) => z.stopPropagation(),
2422
- onTouchStart: (z) => z.stopPropagation(),
2423
- onClick: (z) => {
2424
- if (z.stopPropagation(), c.children) {
2425
- const Qe = F;
2426
- C(), Qe || Ve(l);
2472
+ onMouseDown: (I) => I.stopPropagation(),
2473
+ onTouchStart: (I) => I.stopPropagation(),
2474
+ onClick: (I) => {
2475
+ if (I.stopPropagation(), d.children) {
2476
+ const tt = R;
2477
+ z(), tt || Ue(l);
2427
2478
  } else
2428
- C(), c.click ? c.click(s) : c.onClick && c.onClick(s);
2479
+ z(), d.click ? d.click(n) : d.onClick && d.onClick(n);
2429
2480
  },
2430
- className: `strata-control-btn transition-colors focus:outline-none flex items-center justify-center ${ee} ${F ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"} ${c.className || ""}`,
2431
- style: { borderRadius: "var(--radius)", ...c.style },
2432
- title: c.tooltip,
2433
- children: /* @__PURE__ */ e(Dt, { content: c.html || "" })
2481
+ className: `strata-control-btn transition-colors focus:outline-none flex items-center justify-center ${se} ${R ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"} ${d.className || ""}`,
2482
+ style: { borderRadius: "var(--radius)", ...d.style },
2483
+ title: d.tooltip,
2484
+ children: /* @__PURE__ */ e(Qt, { content: d.html || "" })
2434
2485
  }
2435
2486
  ),
2436
- c.children && G && /* @__PURE__ */ e(
2437
- Vt,
2487
+ d.children && O && /* @__PURE__ */ e(
2488
+ Xt,
2438
2489
  {
2439
- items: c.children,
2440
- onClose: C,
2441
- maxHeight: Pe,
2442
- className: `strata-backdrop ${Le} ${Ne.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2490
+ items: d.children,
2491
+ onClose: z,
2492
+ maxHeight: Ee,
2493
+ className: `strata-backdrop ${Ae} ${ze.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2443
2494
  }
2444
2495
  )
2445
- ] }, c.index);
2496
+ ] }, d.index);
2446
2497
  }
2447
- switch (c.id) {
2498
+ switch (d.id) {
2448
2499
  case "play":
2449
2500
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2450
- l.stopPropagation(), C(), s == null || s.togglePlay();
2451
- }, className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: a.isPlaying ? /* @__PURE__ */ e(Ft, { className: `${J} fill-current` }) : /* @__PURE__ */ e(Et, { className: `${J} fill-current` }) }, "play");
2501
+ l.stopPropagation(), z(), n == null || n.togglePlay();
2502
+ }, className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: r.isPlaying ? /* @__PURE__ */ e(Wt, { className: `${ie} fill-current` }) : /* @__PURE__ */ e(Ht, { className: `${ie} fill-current` }) }, "play");
2452
2503
  case "volume":
2453
- return /* @__PURE__ */ d(
2504
+ return /* @__PURE__ */ c(
2454
2505
  "div",
2455
2506
  {
2456
2507
  className: "flex items-center gap-2 group/vol relative",
2457
2508
  onMouseEnter: () => {
2458
- window.matchMedia("(hover: hover)").matches && pt(!0);
2509
+ window.matchMedia("(hover: hover)").matches && gt(!0);
2459
2510
  },
2460
2511
  onMouseLeave: () => {
2461
- window.matchMedia("(hover: hover)").matches && pt(!1);
2512
+ window.matchMedia("(hover: hover)").matches && gt(!1);
2462
2513
  },
2463
2514
  children: [
2464
- /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: ri, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(ai, { className: J }) }),
2465
- /* @__PURE__ */ e("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${zt ? "w-28 opacity-100 ml-1" : "w-0 opacity-0"}`, children: /* @__PURE__ */ d("div", { ref: _e, className: "relative w-full h-full flex items-center cursor-pointer px-2", onMouseDown: Tt, onTouchStart: Tt, children: [
2466
- /* @__PURE__ */ e("div", { className: "w-full h-1 bg-white/20 overflow-hidden", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("div", { className: "h-full bg-white", style: { width: `${(a.isMuted ? 0 : a.volume) * 100}%`, borderRadius: "var(--radius-full)" } }) }),
2467
- /* @__PURE__ */ e("div", { className: "absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none", style: { left: `calc(${(a.isMuted ? 0 : a.volume) * 100}% * 0.85 + 4px)`, borderRadius: "var(--radius-full)" } })
2515
+ /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: fi, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(bi, { className: ie }) }),
2516
+ /* @__PURE__ */ e("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${Et ? "w-28 opacity-100 ml-1" : "w-0 opacity-0"}`, children: /* @__PURE__ */ c("div", { ref: Ke, className: "relative w-full h-full flex items-center cursor-pointer px-2", onMouseDown: $t, onTouchStart: $t, children: [
2517
+ /* @__PURE__ */ e("div", { className: "w-full h-1 bg-white/20 overflow-hidden", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("div", { className: "h-full bg-white", style: { width: `${(r.isMuted ? 0 : r.volume) * 100}%`, borderRadius: "var(--radius-full)" } }) }),
2518
+ /* @__PURE__ */ e("div", { className: "absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none", style: { left: `calc(${(r.isMuted ? 0 : r.volume) * 100}% * 0.85 + 4px)`, borderRadius: "var(--radius-full)" } })
2468
2519
  ] }) }),
2469
- zt && /* @__PURE__ */ e("div", { className: "strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2", style: { left: `calc(52px + ${(a.isMuted ? 0 : a.volume) * 80}px)` }, children: a.isMuted ? "0%" : `${Math.round(a.volume * 100)}%` })
2520
+ Et && /* @__PURE__ */ e("div", { className: "strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2", style: { left: `calc(52px + ${(r.isMuted ? 0 : r.volume) * 80}px)` }, children: r.isMuted ? "0%" : `${Math.round(r.volume * 100)}%` })
2470
2521
  ]
2471
2522
  },
2472
2523
  "volume"
2473
2524
  );
2474
2525
  case "time":
2475
- return p.isLive ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2 px-2 py-0.5 rounded-md border border-white/10", style: { backgroundColor: `${a.themeColor}1a`, borderColor: `${a.themeColor}33` }, children: [
2476
- /* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full animate-pulse", style: { backgroundColor: a.themeColor } }),
2477
- /* @__PURE__ */ e("span", { className: "text-[10px] font-bold tracking-wider", style: { color: a.themeColor }, children: "LIVE" })
2478
- ] }, "live") : /* @__PURE__ */ d("div", { className: "text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums", children: [
2479
- Je(Oe ? Te : a.currentTime),
2526
+ return m.isLive ? /* @__PURE__ */ c("div", { className: "flex items-center gap-2 px-2 py-0.5 rounded-md border border-white/10", style: { backgroundColor: `${r.themeColor}1a`, borderColor: `${r.themeColor}33` }, children: [
2527
+ /* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full animate-pulse", style: { backgroundColor: r.themeColor } }),
2528
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-bold tracking-wider", style: { color: r.themeColor }, children: "LIVE" })
2529
+ ] }, "live") : /* @__PURE__ */ c("div", { className: "text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums", children: [
2530
+ it(_e ? Re : r.currentTime),
2480
2531
  " ",
2481
2532
  /* @__PURE__ */ e("span", { className: "text-zinc-600", children: "/" }),
2482
2533
  " ",
2483
- Je(a.duration)
2534
+ it(r.duration)
2484
2535
  ] }, "time");
2485
2536
  case "subtitle":
2486
- return /* @__PURE__ */ d("div", { className: "relative", children: [
2537
+ return /* @__PURE__ */ c("div", { className: "relative", children: [
2487
2538
  /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2488
2539
  l.stopPropagation();
2489
- const F = V;
2490
- C(), F || at(!0);
2491
- }, className: `strata-control-btn transition-colors focus:outline-none ${ee} ${V ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e($i, { className: J }) }),
2492
- ut.isMounted && /* @__PURE__ */ e(
2493
- mn,
2540
+ const R = B;
2541
+ z(), R || ut(!0);
2542
+ }, className: `strata-control-btn transition-colors focus:outline-none ${se} ${B ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Oi, { className: ie }) }),
2543
+ ft.isMounted && /* @__PURE__ */ e(
2544
+ ys,
2494
2545
  {
2495
- tracks: a.subtitleTracks,
2496
- current: a.currentSubtitle,
2497
- onSelect: (l) => s == null ? void 0 : s.setSubtitle(l),
2498
- onUpload: (l) => s == null ? void 0 : s.addTextTrack(l, l.name),
2499
- onClose: C,
2500
- settings: a.subtitleSettings,
2501
- onSettingsChange: (l) => s == null ? void 0 : s.updateSubtitleSettings(l),
2502
- onReset: () => s == null ? void 0 : s.resetSubtitleSettings(),
2503
- offset: a.subtitleOffset,
2504
- onOffsetChange: (l) => s == null ? void 0 : s.setSubtitleOffset(l),
2505
- maxHeight: Pe,
2506
- animationClass: `strata-backdrop ${Le} ${ut.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2546
+ tracks: r.subtitleTracks,
2547
+ current: r.currentSubtitle,
2548
+ onSelect: (l) => n == null ? void 0 : n.setSubtitle(l),
2549
+ onUpload: (l) => n == null ? void 0 : n.addTextTrack(l, l.name),
2550
+ onClose: z,
2551
+ settings: r.subtitleSettings,
2552
+ onSettingsChange: (l) => n == null ? void 0 : n.updateSubtitleSettings(l),
2553
+ onReset: () => n == null ? void 0 : n.resetSubtitleSettings(),
2554
+ offset: r.subtitleOffset,
2555
+ onOffsetChange: (l) => n == null ? void 0 : n.setSubtitleOffset(l),
2556
+ maxHeight: Ee,
2557
+ animationClass: `strata-backdrop ${Ae} ${ft.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2507
2558
  }
2508
2559
  )
2509
2560
  ] }, "subtitle");
2510
2561
  case "screenshot":
2511
2562
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2512
- l.stopPropagation(), C(), s == null || s.screenshot();
2513
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, title: "Screenshot", children: /* @__PURE__ */ e(Xi, { className: J }) }, "ss");
2563
+ l.stopPropagation(), z(), n == null || n.screenshot();
2564
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, title: "Screenshot", children: /* @__PURE__ */ e(ts, { className: ie }) }, "ss");
2514
2565
  case "pip":
2515
2566
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2516
- l.stopPropagation(), C(), s == null || s.togglePip();
2517
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Li, { className: J }) }, "pip");
2567
+ l.stopPropagation(), z(), n == null || n.togglePip();
2568
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Di, { className: ie }) }, "pip");
2518
2569
  case "download":
2519
- if (c.children) {
2520
- const l = E === "download-menu", F = l || Ne.isMounted && De.current === "download-menu";
2521
- return /* @__PURE__ */ d("div", { className: "relative", children: [
2522
- /* @__PURE__ */ e("button", { onMouseDown: (G) => G.stopPropagation(), onTouchStart: (G) => G.stopPropagation(), onClick: (G) => {
2523
- G.stopPropagation();
2524
- const z = l;
2525
- C(), z || Ve("download-menu");
2526
- }, className: `strata-control-btn transition-colors hidden sm:block focus:outline-none ${ee} ${l ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Ze, { className: J }) }),
2527
- F && /* @__PURE__ */ e(
2528
- Vt,
2570
+ if (d.children) {
2571
+ const l = E === "download-menu", R = l || ze.isMounted && Ge.current === "download-menu";
2572
+ return /* @__PURE__ */ c("div", { className: "relative", children: [
2573
+ /* @__PURE__ */ e("button", { onMouseDown: (O) => O.stopPropagation(), onTouchStart: (O) => O.stopPropagation(), onClick: (O) => {
2574
+ O.stopPropagation();
2575
+ const I = l;
2576
+ z(), I || Ue("download-menu");
2577
+ }, className: `strata-control-btn transition-colors hidden sm:block focus:outline-none ${se} ${l ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(ot, { className: ie }) }),
2578
+ R && /* @__PURE__ */ e(
2579
+ Xt,
2529
2580
  {
2530
- items: c.children,
2531
- onClose: C,
2532
- maxHeight: Pe,
2533
- className: `strata-backdrop ${Le} ${Ne.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2581
+ items: d.children,
2582
+ onClose: z,
2583
+ maxHeight: Ee,
2584
+ className: `strata-backdrop ${Ae} ${ze.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2534
2585
  }
2535
2586
  )
2536
2587
  ] }, "dl");
2537
2588
  }
2538
2589
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2539
- l.stopPropagation(), C(), s == null || s.download();
2540
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Ze, { className: J }) }, "dl");
2590
+ l.stopPropagation(), z(), n == null || n.download();
2591
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(ot, { className: ie }) }, "dl");
2541
2592
  case "fullscreen":
2542
2593
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2543
- l.stopPropagation(), C(), s == null || s.toggleFullscreen();
2544
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: a.isFullscreen || a.isWebFullscreen ? /* @__PURE__ */ e(Ri, { className: J }) : /* @__PURE__ */ e(Ii, { className: J }) }, "fs");
2594
+ l.stopPropagation(), z(), n == null || n.toggleFullscreen();
2595
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: r.isFullscreen || r.isWebFullscreen ? /* @__PURE__ */ e(Vi, { className: ie }) : /* @__PURE__ */ e(Ai, { className: ie }) }, "fs");
2545
2596
  case "fullscreenWeb":
2546
2597
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2547
- l.stopPropagation(), C(), s == null || s.toggleWebFullscreen();
2548
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${ee} ${a.isWebFullscreen ? "text-[var(--accent)]" : ""}`, style: { borderRadius: "var(--radius)" }, title: "Web Fullscreen", children: /* @__PURE__ */ e(Ki, { className: J }) }, "fsw");
2598
+ l.stopPropagation(), z(), n == null || n.toggleWebFullscreen();
2599
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${se} ${r.isWebFullscreen ? "text-[var(--accent)]" : ""}`, style: { borderRadius: "var(--radius)" }, title: "Web Fullscreen", children: /* @__PURE__ */ e(ns, { className: ie }) }, "fsw");
2549
2600
  case "settings":
2550
- return /* @__PURE__ */ d("div", { className: "relative", children: [
2601
+ return /* @__PURE__ */ c("div", { className: "relative", children: [
2551
2602
  /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2552
2603
  l.stopPropagation();
2553
- const F = B;
2554
- C(), F || (rt(!0), D("main"));
2555
- }, className: `strata-control-btn transition-all duration-300 focus:outline-none ${ee} ${B ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Pi, { className: J }) }),
2556
- dt.isMounted && /* @__PURE__ */ e(it, { onClose: C, align: "right", maxHeight: Pe, className: `strata-backdrop ${Le} ${dt.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`, children: /* @__PURE__ */ d("div", { className: "w-full", children: [
2557
- X === "main" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
2604
+ const R = V;
2605
+ z(), R || (dt(!0), A("main"));
2606
+ }, className: `strata-control-btn transition-all duration-300 focus:outline-none ${se} ${V ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Bi, { className: ie }) }),
2607
+ pt.isMounted && /* @__PURE__ */ e(lt, { onClose: z, align: "right", maxHeight: Ee, className: `strata-backdrop ${Ae} ${pt.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`, children: /* @__PURE__ */ c("div", { className: "w-full", children: [
2608
+ J === "main" && /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
2558
2609
  /* @__PURE__ */ e("div", { className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md", style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("span", { children: "Settings" }) }),
2559
- a.sources.length > 1 && /* @__PURE__ */ d(_, { children: [
2560
- /* @__PURE__ */ e(A, { label: "Source", icon: /* @__PURE__ */ e(en, { className: "w-4 h-4" }), value: ((v = a.sources[a.currentSourceIndex]) == null ? void 0 : v.name) || `Source ${a.currentSourceIndex + 1}`, onClick: () => D("sources"), hasSubmenu: !0 }),
2561
- /* @__PURE__ */ e(pe, {})
2610
+ r.sources.length > 1 && /* @__PURE__ */ c(Q, { children: [
2611
+ /* @__PURE__ */ e(L, { label: "Source", icon: /* @__PURE__ */ e(rs, { className: "w-4 h-4" }), value: ((w = r.sources[r.currentSourceIndex]) == null ? void 0 : w.name) || `Source ${r.currentSourceIndex + 1}`, onClick: () => A("sources"), hasSubmenu: !0 }),
2612
+ /* @__PURE__ */ e(me, {})
2562
2613
  ] }),
2563
- /* @__PURE__ */ e(A, { label: "Quality", icon: /* @__PURE__ */ e(an, { className: "w-4 h-4" }), value: a.currentQuality === -1 ? "Auto" : `${(S = a.qualityLevels[a.currentQuality]) == null ? void 0 : S.height}p`, onClick: () => D("quality"), hasSubmenu: !0 }),
2564
- /* @__PURE__ */ e(A, { label: "Speed", icon: /* @__PURE__ */ e(sn, { className: "w-4 h-4" }), value: `${a.playbackRate}x`, onClick: () => D("speed"), hasSubmenu: !0 }),
2565
- /* @__PURE__ */ e(A, { label: "Audio", icon: /* @__PURE__ */ e(on, { className: "w-4 h-4" }), value: ((M = a.audioTracks[a.currentAudioTrack]) == null ? void 0 : M.label) || "Default", onClick: () => D("audio"), hasSubmenu: !0 }),
2566
- /* @__PURE__ */ e(pe, {}),
2567
- b && /* @__PURE__ */ e(A, { label: "Flip", icon: /* @__PURE__ */ e(ln, { className: "w-4 h-4" }), value: a.flipState.horizontal ? "H" : a.flipState.vertical ? "V" : "Normal", onClick: () => D("flip"), hasSubmenu: !0 }),
2568
- H && /* @__PURE__ */ e(A, { label: "Aspect Ratio", icon: /* @__PURE__ */ e(tn, { className: "w-4 h-4" }), value: a.aspectRatio, onClick: () => D("ratio"), hasSubmenu: !0 }),
2569
- /* @__PURE__ */ e(A, { label: "Audio Boost", icon: /* @__PURE__ */ e(nn, { className: "w-4 h-4" }), value: a.audioGain > 1 ? `${a.audioGain}x` : "Off", onClick: () => D("boost"), hasSubmenu: !0 }),
2570
- /* @__PURE__ */ e(pe, {}),
2571
- /* @__PURE__ */ e(A, { label: "Watch Party", icon: /* @__PURE__ */ e(Bi, { className: "w-4 h-4" }), onClick: () => D("party"), hasSubmenu: !0 }),
2572
- /* @__PURE__ */ e(A, { label: "Cast to Device", icon: /* @__PURE__ */ e(Ai, { className: "w-4 h-4" }), onClick: () => {
2573
- s == null || s.requestCast(), C();
2614
+ /* @__PURE__ */ e(L, { label: "Quality", icon: /* @__PURE__ */ e(ms, { className: "w-4 h-4" }), value: r.currentQuality === -1 ? "Auto" : `${(C = r.qualityLevels[r.currentQuality]) == null ? void 0 : C.height}p`, onClick: () => A("quality"), hasSubmenu: !0 }),
2615
+ /* @__PURE__ */ e(L, { label: "Speed", icon: /* @__PURE__ */ e(ds, { className: "w-4 h-4" }), value: `${r.playbackRate}x`, onClick: () => A("speed"), hasSubmenu: !0 }),
2616
+ /* @__PURE__ */ e(L, { label: "Audio", icon: /* @__PURE__ */ e(us, { className: "w-4 h-4" }), value: ((N = r.audioTracks[r.currentAudioTrack]) == null ? void 0 : N.label) || "Default", onClick: () => A("audio"), hasSubmenu: !0 }),
2617
+ /* @__PURE__ */ e(me, {}),
2618
+ /* @__PURE__ */ e(L, { label: "Video Fit", icon: /* @__PURE__ */ e(gs, { className: "w-4 h-4" }), value: r.videoFit === "none" ? "Default" : r.videoFit.charAt(0).toUpperCase() + r.videoFit.slice(1), onClick: () => A("videofit"), hasSubmenu: !0 }),
2619
+ Y && /* @__PURE__ */ e(L, { label: "Aspect Ratio", icon: /* @__PURE__ */ e(ls, { className: "w-4 h-4" }), value: r.aspectRatio, onClick: () => A("ratio"), hasSubmenu: !0 }),
2620
+ g && /* @__PURE__ */ e(L, { label: "Flip", icon: /* @__PURE__ */ e(ps, { className: "w-4 h-4" }), value: r.flipState.horizontal ? "H" : r.flipState.vertical ? "V" : "Normal", onClick: () => A("flip"), hasSubmenu: !0 }),
2621
+ /* @__PURE__ */ e(L, { label: "Audio Boost", icon: /* @__PURE__ */ e(cs, { className: "w-4 h-4" }), value: r.audioGain > 1 ? `${r.audioGain}x` : "Off", onClick: () => A("boost"), hasSubmenu: !0 }),
2622
+ /* @__PURE__ */ e(me, {}),
2623
+ /* @__PURE__ */ e(L, { label: "Watch Party", icon: /* @__PURE__ */ e(Ui, { className: "w-4 h-4" }), onClick: () => A("party"), hasSubmenu: !0 }),
2624
+ /* @__PURE__ */ e(L, { label: "Cast to Device", icon: /* @__PURE__ */ e(ji, { className: "w-4 h-4" }), onClick: () => {
2625
+ n == null || n.requestCast(), z();
2574
2626
  } }),
2575
- p.settings && p.settings.length > 0 && /* @__PURE__ */ e(pe, {}),
2576
- (L = p.settings) == null ? void 0 : L.map((l, F) => l.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
2577
- oe,
2627
+ m.settings && m.settings.length > 0 && /* @__PURE__ */ e(me, {}),
2628
+ (P = m.settings) == null ? void 0 : P.map((l, R) => l.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
2629
+ le,
2578
2630
  {
2579
2631
  label: l.html,
2580
2632
  icon: l.icon,
2581
2633
  checked: l.switch,
2582
2634
  tooltip: l.tooltip,
2583
- onChange: (G) => {
2584
- l.onSwitch && l.onSwitch(l, G);
2635
+ onChange: (O) => {
2636
+ l.onSwitch && l.onSwitch(l, O);
2585
2637
  }
2586
2638
  }
2587
- ) }, `cust-${F}`) : /* @__PURE__ */ e(
2588
- A,
2639
+ ) }, `cust-${R}`) : /* @__PURE__ */ e(
2640
+ L,
2589
2641
  {
2590
2642
  label: l.html,
2591
2643
  icon: l.icon,
2592
2644
  value: l.currentLabel || l.value,
2593
2645
  hasSubmenu: !!l.children,
2594
2646
  onClick: () => {
2595
- l.children ? D(`custom-${F}`) : (l.click ? l.click(l) : l.onClick && l.onClick(l), C());
2647
+ l.children ? A(`custom-${R}`) : (l.click ? l.click(l) : l.onClick && l.onClick(l), z());
2596
2648
  }
2597
2649
  },
2598
- `cust-${F}`
2650
+ `cust-${R}`
2599
2651
  )),
2600
- /* @__PURE__ */ e(pe, {}),
2601
- /* @__PURE__ */ e(A, { label: "Appearance", icon: /* @__PURE__ */ e(Ut, { className: "w-4 h-4" }), onClick: () => D("appearance"), hasSubmenu: !0 })
2652
+ /* @__PURE__ */ e(me, {}),
2653
+ /* @__PURE__ */ e(L, { label: "Appearance", icon: /* @__PURE__ */ e(ei, { className: "w-4 h-4" }), onClick: () => A("appearance"), hasSubmenu: !0 })
2602
2654
  ] }),
2603
- X.startsWith("custom-") && (() => {
2604
- var G;
2605
- const l = parseInt(X.split("-")[1]), F = (G = p.settings) == null ? void 0 : G[l];
2606
- return !F || !F.children ? null : /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
2607
- /* @__PURE__ */ e(K, { label: F.html || "Menu", onBack: () => D("main") }),
2608
- F.children.map((z, Qe) => /* @__PURE__ */ d(ke.Fragment, { children: [
2609
- z.separator && /* @__PURE__ */ e(pe, {}),
2610
- z.switch !== void 0 && /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(oe, { label: z.html, checked: z.switch, onChange: (pi) => z.onSwitch && z.onSwitch(z, pi) }) }),
2611
- !z.separator && z.switch === void 0 && /* @__PURE__ */ e(
2612
- A,
2655
+ J.startsWith("custom-") && (() => {
2656
+ var O;
2657
+ const l = parseInt(J.split("-")[1]), R = (O = m.settings) == null ? void 0 : O[l];
2658
+ return !R || !R.children ? null : /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
2659
+ /* @__PURE__ */ e(Z, { label: R.html || "Menu", onBack: () => A("main") }),
2660
+ R.children.map((I, tt) => /* @__PURE__ */ c(Me.Fragment, { children: [
2661
+ I.separator && /* @__PURE__ */ e(me, {}),
2662
+ I.switch !== void 0 && /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(le, { label: I.html, checked: I.switch, onChange: (ki) => I.onSwitch && I.onSwitch(I, ki) }) }),
2663
+ !I.separator && I.switch === void 0 && /* @__PURE__ */ e(
2664
+ L,
2613
2665
  {
2614
- label: z.html,
2615
- icon: z.icon,
2616
- value: z.value,
2617
- active: z.active,
2666
+ label: I.html,
2667
+ icon: I.icon,
2668
+ value: I.value,
2669
+ active: I.active,
2618
2670
  onClick: () => {
2619
- z.onClick ? z.onClick(z) : z.click && z.click(z), C();
2671
+ I.onClick ? I.onClick(I) : I.click && I.click(I), z();
2620
2672
  }
2621
2673
  }
2622
2674
  )
2623
- ] }, Qe))
2675
+ ] }, tt))
2624
2676
  ] });
2625
2677
  })(),
2626
- ["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio"].includes(X) && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
2627
- X === "sources" && /* @__PURE__ */ d(_, { children: [
2628
- /* @__PURE__ */ e(K, { label: "Select Source", onBack: () => D("main") }),
2629
- a.sources.map((l, F) => {
2630
- const G = a.sourceStatuses[F], z = G === "success" ? /* @__PURE__ */ e(rn, { className: "w-3.5 h-3.5 text-emerald-500" }) : G === "error" ? /* @__PURE__ */ e(et, { className: "w-3.5 h-3.5 text-red-500" }) : null;
2678
+ ["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio", "videofit"].includes(J) && /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
2679
+ J === "sources" && /* @__PURE__ */ c(Q, { children: [
2680
+ /* @__PURE__ */ e(Z, { label: "Select Source", onBack: () => A("main") }),
2681
+ r.sources.map((l, R) => {
2682
+ const O = r.sourceStatuses[R], I = O === "success" ? /* @__PURE__ */ e(hs, { className: "w-3.5 h-3.5 text-emerald-500" }) : O === "error" ? /* @__PURE__ */ e(at, { className: "w-3.5 h-3.5 text-red-500" }) : null;
2631
2683
  return /* @__PURE__ */ e(
2632
- A,
2684
+ L,
2633
2685
  {
2634
- label: l.name || `Source ${F + 1}`,
2686
+ label: l.name || `Source ${R + 1}`,
2635
2687
  value: l.type,
2636
- active: a.currentSourceIndex === F,
2637
- rightIcon: z,
2638
- onClick: () => s == null ? void 0 : s.switchSource(F)
2688
+ active: r.currentSourceIndex === R,
2689
+ rightIcon: I,
2690
+ onClick: () => n == null ? void 0 : n.switchSource(R)
2639
2691
  },
2640
- F
2692
+ R
2641
2693
  );
2642
2694
  })
2643
2695
  ] }),
2644
- X === "speed" && /* @__PURE__ */ d(_, { children: [
2645
- /* @__PURE__ */ e(K, { label: "Speed", onBack: () => D("main") }),
2646
- [0.5, 1, 1.5, 2].map((l) => /* @__PURE__ */ e(A, { label: `${l}x`, active: a.playbackRate === l, onClick: () => s.video.playbackRate = l }, l))
2696
+ J === "speed" && /* @__PURE__ */ c(Q, { children: [
2697
+ /* @__PURE__ */ e(Z, { label: "Speed", onBack: () => A("main") }),
2698
+ [0.5, 1, 1.5, 2].map((l) => /* @__PURE__ */ e(L, { label: `${l}x`, active: r.playbackRate === l, onClick: () => n.video.playbackRate = l }, l))
2647
2699
  ] }),
2648
- X === "quality" && /* @__PURE__ */ d(_, { children: [
2649
- /* @__PURE__ */ e(K, { label: "Quality", onBack: () => D("main") }),
2650
- /* @__PURE__ */ e(A, { label: "Auto", active: a.currentQuality === -1, onClick: () => s == null ? void 0 : s.setQuality(-1) }),
2651
- a.qualityLevels.map((l) => /* @__PURE__ */ e(A, { label: `${l.height}p`, value: `${Math.round(l.bitrate / 1e3)}k`, active: a.currentQuality === l.index, onClick: () => s == null ? void 0 : s.setQuality(l.index) }, l.index))
2700
+ J === "quality" && /* @__PURE__ */ c(Q, { children: [
2701
+ /* @__PURE__ */ e(Z, { label: "Quality", onBack: () => A("main") }),
2702
+ /* @__PURE__ */ e(L, { label: "Auto", active: r.currentQuality === -1, onClick: () => n == null ? void 0 : n.setQuality(-1) }),
2703
+ r.qualityLevels.map((l) => /* @__PURE__ */ e(L, { label: `${l.height}p`, value: `${Math.round(l.bitrate / 1e3)}k`, active: r.currentQuality === l.index, onClick: () => n == null ? void 0 : n.setQuality(l.index) }, l.index))
2652
2704
  ] }),
2653
- X === "audio" && /* @__PURE__ */ d(_, { children: [
2654
- /* @__PURE__ */ e(K, { label: "Audio Track", onBack: () => D("main") }),
2655
- a.audioTracks.length === 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-zinc-500 text-xs text-center", children: "No tracks available" }),
2656
- a.audioTracks.map((l) => /* @__PURE__ */ e(A, { label: l.label, value: l.language, active: a.currentAudioTrack === l.index, onClick: () => s == null ? void 0 : s.setAudioTrack(l.index) }, l.index))
2705
+ J === "audio" && /* @__PURE__ */ c(Q, { children: [
2706
+ /* @__PURE__ */ e(Z, { label: "Audio Track", onBack: () => A("main") }),
2707
+ r.audioTracks.length === 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-zinc-500 text-xs text-center", children: "No tracks available" }),
2708
+ r.audioTracks.map((l) => /* @__PURE__ */ e(L, { label: l.label, value: l.language, active: r.currentAudioTrack === l.index, onClick: () => n == null ? void 0 : n.setAudioTrack(l.index) }, l.index))
2657
2709
  ] }),
2658
- X === "boost" && /* @__PURE__ */ d(_, { children: [
2659
- /* @__PURE__ */ e(K, { label: "Audio Boost", onBack: () => D("main") }),
2660
- [1, 1.5, 2, 3].map((l) => /* @__PURE__ */ e(A, { label: l === 1 ? "Off" : `${l}x`, active: a.audioGain === l, onClick: () => s == null ? void 0 : s.setAudioGain(l) }, l))
2710
+ J === "boost" && /* @__PURE__ */ c(Q, { children: [
2711
+ /* @__PURE__ */ e(Z, { label: "Audio Boost", onBack: () => A("main") }),
2712
+ [1, 1.5, 2, 3].map((l) => /* @__PURE__ */ e(L, { label: l === 1 ? "Off" : `${l}x`, active: r.audioGain === l, onClick: () => n == null ? void 0 : n.setAudioGain(l) }, l))
2661
2713
  ] }),
2662
- X === "flip" && /* @__PURE__ */ d(_, { children: [
2663
- /* @__PURE__ */ e(K, { label: "Video Flip", onBack: () => D("main") }),
2664
- /* @__PURE__ */ d("div", { className: "p-2 space-y-1", children: [
2665
- /* @__PURE__ */ e(oe, { label: "Horizontal Flip", checked: a.flipState.horizontal, onChange: () => s == null ? void 0 : s.setFlip("horizontal") }),
2666
- /* @__PURE__ */ e(oe, { label: "Vertical Flip", checked: a.flipState.vertical, onChange: () => s == null ? void 0 : s.setFlip("vertical") })
2714
+ J === "flip" && /* @__PURE__ */ c(Q, { children: [
2715
+ /* @__PURE__ */ e(Z, { label: "Video Flip", onBack: () => A("main") }),
2716
+ /* @__PURE__ */ c("div", { className: "p-2 space-y-1", children: [
2717
+ /* @__PURE__ */ e(le, { label: "Horizontal Flip", checked: r.flipState.horizontal, onChange: () => n == null ? void 0 : n.setFlip("horizontal") }),
2718
+ /* @__PURE__ */ e(le, { label: "Vertical Flip", checked: r.flipState.vertical, onChange: () => n == null ? void 0 : n.setFlip("vertical") })
2667
2719
  ] })
2668
2720
  ] }),
2669
- X === "ratio" && /* @__PURE__ */ d(_, { children: [
2670
- /* @__PURE__ */ e(K, { label: "Aspect Ratio", onBack: () => D("main") }),
2671
- ["default", "16:9", "4:3"].map((l) => /* @__PURE__ */ e(A, { label: l === "default" ? "Default" : l, active: a.aspectRatio === l, onClick: () => s == null ? void 0 : s.setAspectRatio(l) }, l))
2721
+ J === "ratio" && /* @__PURE__ */ c(Q, { children: [
2722
+ /* @__PURE__ */ e(Z, { label: "Aspect Ratio", onBack: () => A("main") }),
2723
+ /* @__PURE__ */ e("div", { className: "max-h-[250px] overflow-y-auto hide-scrollbar", children: ["default", "16:9", "4:3", "21:9", "18:9", "1:1", "9:16"].map((l) => /* @__PURE__ */ e(L, { label: l === "default" ? "Default" : l.replace(":", " : "), active: r.aspectRatio === l, onClick: () => n == null ? void 0 : n.setAspectRatio(l) }, l)) })
2672
2724
  ] }),
2673
- X === "party" && /* @__PURE__ */ d(_, { children: [
2674
- /* @__PURE__ */ e(K, { label: "Watch Party", onBack: () => D("main") }),
2675
- /* @__PURE__ */ d("div", { className: "p-4 space-y-3", children: [
2725
+ J === "videofit" && /* @__PURE__ */ c(Q, { children: [
2726
+ /* @__PURE__ */ e(Z, { label: "Video Fit", onBack: () => A("main") }),
2727
+ /* @__PURE__ */ e(L, { label: "Contain (Default)", value: "Fit", active: r.videoFit === "contain", onClick: () => n == null ? void 0 : n.setVideoFit("contain") }),
2728
+ /* @__PURE__ */ e(L, { label: "Cover", value: "Zoom", active: r.videoFit === "cover", onClick: () => n == null ? void 0 : n.setVideoFit("cover") }),
2729
+ /* @__PURE__ */ e(L, { label: "Fill", value: "Stretch", active: r.videoFit === "fill", onClick: () => n == null ? void 0 : n.setVideoFit("fill") }),
2730
+ /* @__PURE__ */ e(L, { label: "None", value: "Original", active: r.videoFit === "none", onClick: () => n == null ? void 0 : n.setVideoFit("none") })
2731
+ ] }),
2732
+ J === "party" && /* @__PURE__ */ c(Q, { children: [
2733
+ /* @__PURE__ */ e(Z, { label: "Watch Party", onBack: () => A("main") }),
2734
+ /* @__PURE__ */ c("div", { className: "p-4 space-y-3", children: [
2676
2735
  /* @__PURE__ */ e("p", { className: "text-xs text-zinc-400 leading-relaxed", children: "Create a synchronized room on WatchParty.me to watch together." }),
2677
- /* @__PURE__ */ e("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((he = a.sources[a.currentSourceIndex]) == null ? void 0 : he.url) || t || "")}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs", style: { borderRadius: "var(--radius)" }, children: "Create Room" })
2736
+ /* @__PURE__ */ e("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((ae = r.sources[r.currentSourceIndex]) == null ? void 0 : ae.url) || t || "")}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs", style: { borderRadius: "var(--radius)" }, children: "Create Room" })
2678
2737
  ] })
2679
2738
  ] }),
2680
- X === "appearance" && /* @__PURE__ */ d(_, { children: [
2681
- /* @__PURE__ */ e(K, { label: "Appearance", onBack: () => D("main") }),
2682
- /* @__PURE__ */ d("div", { className: "pb-1", children: [
2683
- /* @__PURE__ */ e(me, { title: "Theme", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 px-3", children: xn.map((l) => /* @__PURE__ */ e("button", { onClick: () => s == null ? void 0 : s.setAppearance({ theme: l.value, themeColor: l.color }), className: `py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${a.theme === l.value ? "bg-[var(--accent)] text-white" : "bg-white/5 text-zinc-400 hover:text-white"}`, style: { borderRadius: "var(--radius)" }, children: l.label }, l.value)) }) }),
2684
- /* @__PURE__ */ e(me, { title: "Icon Size", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1 px-3", children: ["small", "medium", "large"].map((l) => /* @__PURE__ */ e("button", { onClick: () => s == null ? void 0 : s.setAppearance({ iconSize: l }), className: `py-1.5 text-xs font-medium transition-colors ${a.iconSize === l ? "bg-white text-black" : "bg-white/5 text-zinc-400 hover:text-zinc-200"}`, style: { borderRadius: "var(--radius)" }, children: l.charAt(0).toUpperCase() + l.slice(1) }, l)) }) }),
2685
- /* @__PURE__ */ d(me, { title: "Theme Color", children: [
2686
- /* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 px-3", children: vn.map((l) => /* @__PURE__ */ e("button", { title: l.label, onClick: () => s == null ? void 0 : s.setAppearance({ themeColor: l.value }), className: `w-6 h-6 transition-transform hover:scale-110 ${a.themeColor === l.value ? "ring-2 ring-white scale-110" : "ring-1 ring-white/10"}`, style: { backgroundColor: l.value, borderRadius: "var(--radius-full)" }, children: a.themeColor === l.value && /* @__PURE__ */ e(Be, { className: "w-3 h-3 text-white mx-auto stroke-[3]" }) }, l.value)) }),
2687
- /* @__PURE__ */ e("div", { className: "px-3 pt-4", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group", style: { borderRadius: "var(--radius)" }, children: [
2688
- /* @__PURE__ */ e("div", { className: "relative w-6 h-6 overflow-hidden ring-1 ring-white/20", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("input", { type: "color", value: a.themeColor, onChange: (l) => s == null ? void 0 : s.setAppearance({ themeColor: l.target.value }), className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0" }) }),
2739
+ J === "appearance" && /* @__PURE__ */ c(Q, { children: [
2740
+ /* @__PURE__ */ e(Z, { label: "Appearance", onBack: () => A("main") }),
2741
+ /* @__PURE__ */ c("div", { className: "pb-1", children: [
2742
+ /* @__PURE__ */ e("div", { className: "px-1 pt-1", children: /* @__PURE__ */ e(
2743
+ xe,
2744
+ {
2745
+ label: "Brightness",
2746
+ icon: /* @__PURE__ */ e(Gt, { className: "w-4 h-4" }),
2747
+ value: r.brightness,
2748
+ min: 0,
2749
+ max: 2,
2750
+ step: 0.1,
2751
+ onChange: (l) => n == null ? void 0 : n.setBrightness(l),
2752
+ formatValue: (l) => `${Math.round(l * 100)}%`
2753
+ }
2754
+ ) }),
2755
+ /* @__PURE__ */ e(pe, { title: "Theme", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 px-3", children: Ms.map((l) => /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.setAppearance({ theme: l.value, themeColor: l.color }), className: `py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${r.theme === l.value ? "bg-[var(--accent)] text-white" : "bg-white/5 text-zinc-400 hover:text-white"}`, style: { borderRadius: "var(--radius)" }, children: l.label }, l.value)) }) }),
2756
+ /* @__PURE__ */ e(pe, { title: "Icon Size", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1 px-3", children: ["small", "medium", "large"].map((l) => /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.setAppearance({ iconSize: l }), className: `py-1.5 text-xs font-medium transition-colors ${r.iconSize === l ? "bg-white text-black" : "bg-white/5 text-zinc-400 hover:text-zinc-200"}`, style: { borderRadius: "var(--radius)" }, children: l.charAt(0).toUpperCase() + l.slice(1) }, l)) }) }),
2757
+ /* @__PURE__ */ c(pe, { title: "Theme Color", children: [
2758
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 px-3", children: Ns.map((l) => /* @__PURE__ */ e("button", { title: l.label, onClick: () => n == null ? void 0 : n.setAppearance({ themeColor: l.value }), className: `w-6 h-6 transition-transform hover:scale-110 ${r.themeColor === l.value ? "ring-2 ring-white scale-110" : "ring-1 ring-white/10"}`, style: { backgroundColor: l.value, borderRadius: "var(--radius-full)" }, children: r.themeColor === l.value && /* @__PURE__ */ e(He, { className: "w-3 h-3 text-white mx-auto stroke-[3]" }) }, l.value)) }),
2759
+ /* @__PURE__ */ e("div", { className: "px-3 pt-4", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group", style: { borderRadius: "var(--radius)" }, children: [
2760
+ /* @__PURE__ */ e("div", { className: "relative w-6 h-6 overflow-hidden ring-1 ring-white/20", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("input", { type: "color", value: r.themeColor, onChange: (l) => n == null ? void 0 : n.setAppearance({ themeColor: l.target.value }), className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0" }) }),
2689
2761
  /* @__PURE__ */ e("span", { className: "text-xs text-zinc-400 font-medium group-hover:text-zinc-200", children: "Custom Color" }),
2690
- /* @__PURE__ */ e("span", { className: "text-[10px] font-mono text-zinc-500 ml-auto uppercase", children: a.themeColor })
2762
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-mono text-zinc-500 ml-auto uppercase", children: r.themeColor })
2691
2763
  ] }) })
2692
2764
  ] })
2693
2765
  ] })
@@ -2698,68 +2770,73 @@ const vn = [
2698
2770
  default:
2699
2771
  return null;
2700
2772
  }
2701
- }, ui = xe(() => {
2702
- const c = [
2773
+ }, wi = Ce(() => {
2774
+ const d = [
2703
2775
  // Loop (Playback Group)
2704
2776
  { html: "Playback", isLabel: !0 },
2705
2777
  {
2706
2778
  html: "Loop",
2707
- checked: a.isLooping,
2708
- onClick: () => s == null ? void 0 : s.toggleLoop()
2779
+ checked: r.isLooping,
2780
+ onClick: () => n == null ? void 0 : n.toggleLoop()
2709
2781
  },
2710
2782
  { separator: !0 },
2711
2783
  // Flip (Transform Group)
2712
2784
  { html: "Transform", isLabel: !0 },
2713
- { html: "Flip Horizontal", onClick: () => s == null ? void 0 : s.setFlip("horizontal") },
2714
- { html: "Flip Vertical", onClick: () => s == null ? void 0 : s.setFlip("vertical") },
2785
+ { html: "Flip Horizontal", onClick: () => n == null ? void 0 : n.setFlip("horizontal") },
2786
+ { html: "Flip Vertical", onClick: () => n == null ? void 0 : n.setFlip("vertical") },
2715
2787
  { separator: !0 },
2716
2788
  // Aspect Ratio Group
2717
2789
  { html: "Aspect Ratio", isLabel: !0 },
2718
- { html: "Default", checked: a.aspectRatio === "default", onClick: () => s == null ? void 0 : s.setAspectRatio("default") },
2719
- { html: "16:9", checked: a.aspectRatio === "16:9", onClick: () => s == null ? void 0 : s.setAspectRatio("16:9") },
2720
- { html: "4:3", checked: a.aspectRatio === "4:3", onClick: () => s == null ? void 0 : s.setAspectRatio("4:3") },
2790
+ { html: "Default", checked: r.aspectRatio === "default", onClick: () => n == null ? void 0 : n.setAspectRatio("default") },
2791
+ { html: "16:9", checked: r.aspectRatio === "16:9", onClick: () => n == null ? void 0 : n.setAspectRatio("16:9") },
2792
+ { html: "21:9", checked: r.aspectRatio === "21:9", onClick: () => n == null ? void 0 : n.setAspectRatio("21:9") },
2793
+ { separator: !0 },
2794
+ // Video Fit Group
2795
+ { html: "Video Fit", isLabel: !0 },
2796
+ { html: "Contain", checked: r.videoFit === "contain", onClick: () => n == null ? void 0 : n.setVideoFit("contain") },
2797
+ { html: "Cover", checked: r.videoFit === "cover", onClick: () => n == null ? void 0 : n.setVideoFit("cover") },
2721
2798
  { separator: !0 },
2722
2799
  // Stats
2723
2800
  {
2724
2801
  html: "Video Info",
2725
- icon: /* @__PURE__ */ e(Zi, { className: "w-3.5 h-3.5" }),
2726
- onClick: () => ct(!0)
2802
+ icon: /* @__PURE__ */ e(as, { className: "w-3.5 h-3.5" }),
2803
+ onClick: () => mt(!0)
2727
2804
  },
2728
2805
  { separator: !0 }
2729
2806
  ];
2730
- return p.contextmenu && c.push(...p.contextmenu), c.push({
2807
+ return m.contextmenu && d.push(...m.contextmenu), d.push({
2731
2808
  html: /* @__PURE__ */ e("span", { className: "text-zinc-500 text-xs font-semibold tracking-wide", children: "StrataPlayer" }),
2732
2809
  disabled: !0
2733
- }), c.push({
2810
+ }), d.push({
2734
2811
  html: "Close",
2735
- onClick: (v) => v(),
2812
+ onClick: (w) => w(),
2736
2813
  // Wrapper handles close
2737
- icon: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */ d("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [
2814
+ icon: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */ c("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [
2738
2815
  /* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
2739
2816
  /* @__PURE__ */ e("path", { d: "m6 6 12 12" })
2740
2817
  ] }) })
2741
- }), c;
2742
- }, [p.contextmenu, a.aspectRatio, a.isLooping, s]), hi = a.isWebFullscreen, Pt = /* @__PURE__ */ d(
2818
+ }), d;
2819
+ }, [m.contextmenu, r.aspectRatio, r.isLooping, r.videoFit, n]), yi = r.isWebFullscreen, Bt = /* @__PURE__ */ c(
2743
2820
  "div",
2744
2821
  {
2745
- id: p.id,
2746
- ref: P,
2747
- className: `group bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none text-zinc-100 strata-player-reset flex items-center justify-center ${hi ? "fixed inset-0 z-[2147483647] w-screen h-screen rounded-none" : "relative w-full h-full rounded-[var(--radius)]"} ${p.container || ""}`,
2748
- style: { touchAction: "manipulation", "--accent": a.themeColor, "--accent-contrast": Xt },
2749
- onMouseMove: St,
2822
+ id: m.id,
2823
+ ref: T,
2824
+ className: `group bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none text-zinc-100 strata-player-reset flex items-center justify-center ${yi ? "fixed inset-0 z-[2147483647] w-screen h-screen rounded-none" : "relative w-full h-full rounded-[var(--radius-player)]"} ${m.container || ""}`,
2825
+ style: { touchAction: "manipulation", "--accent": r.themeColor, "--accent-contrast": si },
2826
+ onMouseMove: Rt,
2750
2827
  onMouseLeave: () => {
2751
- a.isPlaying && !B && !V && !E && s && s.setControlsVisible(!1);
2828
+ r.isPlaying && !V && !B && !E && n && n.setControlsVisible(!1);
2752
2829
  },
2753
- onMouseDown: Ct,
2754
- onMouseUp: qe,
2755
- onTouchStart: ei,
2756
- onTouchMove: ti,
2757
- onTouchEnd: ii,
2758
- onContextMenu: oi,
2830
+ onMouseDown: Pt,
2831
+ onMouseUp: Ze,
2832
+ onTouchStart: ci,
2833
+ onTouchMove: di,
2834
+ onTouchEnd: ui,
2835
+ onContextMenu: pi,
2759
2836
  tabIndex: 0,
2760
2837
  role: "region",
2761
2838
  "aria-label": "Video Player",
2762
- "data-theme": a.theme,
2839
+ "data-theme": r.theme,
2763
2840
  children: [
2764
2841
  /* @__PURE__ */ e("style", { children: `
2765
2842
  [data-theme="default"] {
@@ -2767,6 +2844,7 @@ const vn = [
2767
2844
  --radius-lg: 0.75rem;
2768
2845
  --radius-sm: 0.375rem;
2769
2846
  --radius-full: 9999px;
2847
+ --radius-player: 0.25rem;
2770
2848
  --font-main: "Inter", sans-serif;
2771
2849
  --border-width: 0px;
2772
2850
  --bg-panel: rgba(9, 9, 11, 0.95);
@@ -2779,6 +2857,7 @@ const vn = [
2779
2857
  --radius-lg: 0px;
2780
2858
  --radius-sm: 0px;
2781
2859
  --radius-full: 0px;
2860
+ --radius-player: 0px;
2782
2861
  --font-main: "Press Start 2P", cursive;
2783
2862
  --border-width: 2px;
2784
2863
  --bg-panel: #000000;
@@ -2792,6 +2871,7 @@ const vn = [
2792
2871
  --radius-lg: 6px;
2793
2872
  --radius-sm: 2px;
2794
2873
  --radius-full: 4px;
2874
+ --radius-player: 4px;
2795
2875
  --font-main: "Cinzel", serif;
2796
2876
  --border-width: 1px;
2797
2877
  --bg-panel: #0a0a0a;
@@ -2804,6 +2884,7 @@ const vn = [
2804
2884
  --radius-lg: 0px;
2805
2885
  --radius-sm: 0px;
2806
2886
  --radius-full: 0px;
2887
+ --radius-player: 0px;
2807
2888
  --font-main: "JetBrains Mono", monospace;
2808
2889
  --border-width: 1px;
2809
2890
  --bg-panel: #000000;
@@ -2855,136 +2936,152 @@ const vn = [
2855
2936
  [data-theme="pixel"] .strata-backdrop { backdrop-filter: none; background: #000; }
2856
2937
  [data-theme="hacker"] .strata-backdrop { backdrop-filter: none; background: #000; }
2857
2938
  ` }),
2858
- a.theme === "hacker" && /* @__PURE__ */ e("div", { className: "strata-scanlines" }),
2859
- !s && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-zinc-950 z-50", children: /* @__PURE__ */ e(Fe, { className: "w-10 h-10 text-[var(--accent)] animate-spin" }) }),
2860
- s && /* @__PURE__ */ d(_, { children: [
2861
- (Lt = p.layers) == null ? void 0 : Lt.map((c, v) => /* @__PURE__ */ e(
2939
+ r.theme === "hacker" && /* @__PURE__ */ e("div", { className: "strata-scanlines" }),
2940
+ !n && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-zinc-950 z-50", children: /* @__PURE__ */ e(De, { className: "w-10 h-10 text-[var(--accent)] animate-spin" }) }),
2941
+ n && /* @__PURE__ */ c(Q, { children: [
2942
+ (Dt = m.layers) == null ? void 0 : Dt.map((d, w) => /* @__PURE__ */ e(
2862
2943
  "div",
2863
2944
  {
2864
- className: `absolute inset-0 pointer-events-none z-10 ${c.className || ""}`,
2865
- style: c.style,
2866
- children: /* @__PURE__ */ e(Dt, { content: c.html || "", className: "w-full h-full" })
2945
+ className: `absolute inset-0 pointer-events-none z-10 ${d.className || ""}`,
2946
+ style: d.style,
2947
+ children: /* @__PURE__ */ e(Qt, { content: d.html || "", className: "w-full h-full" })
2867
2948
  },
2868
- v
2949
+ w
2869
2950
  )),
2870
- /* @__PURE__ */ e(un, { notifications: a.notifications }),
2871
- /* @__PURE__ */ e(hn, { cues: a.activeCues, settings: a.subtitleSettings }),
2951
+ /* @__PURE__ */ e(vs, { notifications: r.notifications }),
2952
+ /* @__PURE__ */ e(xs, { cues: r.activeCues, settings: r.subtitleSettings }),
2872
2953
  /* @__PURE__ */ e(
2873
2954
  "div",
2874
2955
  {
2875
2956
  className: "absolute inset-0 z-[1] cursor-pointer",
2876
- onClick: si,
2957
+ onClick: mi,
2877
2958
  "aria-hidden": "true",
2878
2959
  role: "button",
2879
2960
  tabIndex: -1
2880
2961
  }
2881
2962
  ),
2882
- r && !ne && /* @__PURE__ */ e(
2963
+ a && !_ && /* @__PURE__ */ e(
2883
2964
  "div",
2884
2965
  {
2885
2966
  className: "absolute inset-0 bg-cover bg-center z-[5] pointer-events-none strata-poster",
2886
- style: { backgroundImage: `url(${r})` }
2967
+ style: { backgroundImage: `url(${a})` }
2887
2968
  }
2888
2969
  ),
2889
- se.visible && /* @__PURE__ */ e(
2890
- fn,
2970
+ oe.visible && /* @__PURE__ */ e(
2971
+ ks,
2891
2972
  {
2892
- x: se.x,
2893
- y: se.y,
2894
- items: ui,
2895
- onClose: C,
2896
- containerWidth: nt,
2897
- containerHeight: ce
2973
+ x: oe.x,
2974
+ y: oe.y,
2975
+ items: wi,
2976
+ onClose: z,
2977
+ containerWidth: ge,
2978
+ containerHeight: re
2898
2979
  }
2899
2980
  ),
2900
- Qt && s && /* @__PURE__ */ e(bn, { player: s, onClose: () => ct(!1) }),
2901
- je && /* @__PURE__ */ d("div", { className: "absolute top-8 left-1/2 -translate-x-1/2 bg-black/50 backdrop-blur-md px-4 py-2 rounded-full flex items-center gap-2 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
2902
- /* @__PURE__ */ e(Yi, { className: "w-4 h-4 text-[var(--accent)] fill-current" }),
2981
+ ni && n && /* @__PURE__ */ e(Ss, { player: n, onClose: () => mt(!1) }),
2982
+ Qe && /* @__PURE__ */ c("div", { className: "absolute top-8 left-1/2 -translate-x-1/2 bg-black/50 backdrop-blur-md px-4 py-2 rounded-full flex items-center gap-2 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
2983
+ /* @__PURE__ */ e(os, { className: "w-4 h-4 text-[var(--accent)] fill-current" }),
2903
2984
  /* @__PURE__ */ e("span", { className: "text-xs font-bold tracking-wider", children: "2x Speed" })
2904
2985
  ] }),
2905
- Y && st && a.controlsVisible && /* @__PURE__ */ e(
2986
+ Pe && /* @__PURE__ */ c("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-black/60 backdrop-blur-md p-6 rounded-2xl flex flex-col items-center gap-4 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
2987
+ r.isMuted || r.volume === 0 ? /* @__PURE__ */ e(Ut, { className: "w-10 h-10 text-white/80" }) : /* @__PURE__ */ e(jt, { className: "w-10 h-10 text-white/80" }),
2988
+ /* @__PURE__ */ e("div", { className: "w-32 h-1.5 bg-white/20 rounded-full overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full bg-[var(--accent)]", style: { width: `${r.isMuted ? 0 : r.volume * 100}%` } }) }),
2989
+ /* @__PURE__ */ c("span", { className: "text-xl font-bold font-mono", children: [
2990
+ Math.round(r.volume * 100),
2991
+ "%"
2992
+ ] })
2993
+ ] }),
2994
+ vt && /* @__PURE__ */ c("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-black/60 backdrop-blur-md p-6 rounded-2xl flex flex-col items-center gap-4 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
2995
+ /* @__PURE__ */ e(Gt, { className: "w-10 h-10 text-white/80" }),
2996
+ /* @__PURE__ */ e("div", { className: "w-32 h-1.5 bg-white/20 rounded-full overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full bg-[var(--accent)]", style: { width: `${Math.min(100, r.brightness * 100)}%` } }) }),
2997
+ /* @__PURE__ */ c("span", { className: "text-xl font-bold font-mono", children: [
2998
+ Math.round(r.brightness * 100),
2999
+ "%"
3000
+ ] })
3001
+ ] }),
3002
+ H && We && r.controlsVisible && /* @__PURE__ */ e(
2906
3003
  "button",
2907
3004
  {
2908
- onMouseDown: (c) => c.stopPropagation(),
2909
- onTouchStart: (c) => c.stopPropagation(),
2910
- onClick: (c) => {
2911
- c.stopPropagation(), s.toggleLock();
3005
+ onMouseDown: (d) => d.stopPropagation(),
3006
+ onTouchStart: (d) => d.stopPropagation(),
3007
+ onClick: (d) => {
3008
+ d.stopPropagation(), n.toggleLock();
2912
3009
  },
2913
- className: `absolute left-4 md:left-6 bottom-24 md:bottom-28 z-50 p-3 rounded-full bg-black/50 backdrop-blur-md border border-white/10 text-white transition-all active:scale-95 ${a.isLocked ? "text-[var(--accent)] bg-white/10" : "hover:bg-white/10"}`,
2914
- children: a.isLocked ? /* @__PURE__ */ e(Qi, { className: "w-5 h-5" }) : /* @__PURE__ */ e(Ji, { className: "w-5 h-5" })
3010
+ className: `absolute left-4 md:left-6 bottom-24 md:bottom-28 z-50 p-3 rounded-full bg-black/50 backdrop-blur-md border border-white/10 text-white transition-all active:scale-95 ${r.isLocked ? "text-[var(--accent)] bg-white/10" : "hover:bg-white/10"}`,
3011
+ children: r.isLocked ? /* @__PURE__ */ e(is, { className: "w-5 h-5" }) : /* @__PURE__ */ e(ss, { className: "w-5 h-5" })
2915
3012
  }
2916
3013
  ),
2917
- de && /* @__PURE__ */ e(
3014
+ ue && /* @__PURE__ */ e(
2918
3015
  "div",
2919
3016
  {
2920
- className: `absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 fill-mode-forwards pointer-events-none ${de.type === "rewind" ? "left-0 rounded-r-[4rem]" : "right-0 rounded-l-[4rem]"}`,
2921
- onAnimationEnd: () => Ie(null),
2922
- children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center text-white drop-shadow-lg", children: [
2923
- de.type === "rewind" ? /* @__PURE__ */ e(At, { className: "w-12 h-12 animate-pulse" }) : /* @__PURE__ */ e(Bt, { className: "w-12 h-12 animate-pulse" }),
2924
- /* @__PURE__ */ e("span", { className: "font-bold text-sm mt-2 font-mono", children: de.type === "rewind" ? "-10s" : "+10s" })
3017
+ className: `absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 fill-mode-forwards pointer-events-none ${ue.type === "rewind" ? "left-0 rounded-r-[4rem]" : "right-0 rounded-l-[4rem]"}`,
3018
+ onAnimationEnd: () => Le(null),
3019
+ children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center text-white drop-shadow-lg", children: [
3020
+ ue.type === "rewind" ? /* @__PURE__ */ e(_t, { className: "w-12 h-12 animate-pulse" }) : /* @__PURE__ */ e(qt, { className: "w-12 h-12 animate-pulse" }),
3021
+ /* @__PURE__ */ e("span", { className: "font-bold text-sm mt-2 font-mono", children: ue.type === "rewind" ? "-10s" : "+10s" })
2925
3022
  ] })
2926
3023
  },
2927
- de.id
3024
+ ue.id
2928
3025
  ),
2929
- a.isBuffering && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-20 pointer-events-none", children: /* @__PURE__ */ e(Fe, { className: "w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg" }) }),
2930
- a.error && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-30 bg-black/90 backdrop-blur-md animate-in fade-in", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-4 text-red-500 p-8 max-w-md text-center", children: [
3026
+ r.isBuffering && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-20 pointer-events-none", children: /* @__PURE__ */ e(De, { className: "w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg" }) }),
3027
+ r.error && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-30 bg-black/90 backdrop-blur-md animate-in fade-in", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-4 text-red-500 p-8 max-w-md text-center", children: [
2931
3028
  /* @__PURE__ */ e("span", { className: "text-5xl mb-2", children: "⚠️" }),
2932
3029
  /* @__PURE__ */ e("h3", { className: "text-xl font-bold text-white", children: "Playback Error" }),
2933
- /* @__PURE__ */ e("p", { className: "text-zinc-400 text-sm", children: a.error }),
2934
- /* @__PURE__ */ e("button", { onClick: () => s.load(s.store.get().sources[s.store.get().currentSourceIndex] || { url: t || "", type: i || "auto" }, f), className: "px-6 py-2 bg-[var(--accent)] text-white font-medium rounded-full hover:opacity-90 transition-opacity mt-4 shadow-lg", children: "Try Again" })
3030
+ /* @__PURE__ */ e("p", { className: "text-zinc-400 text-sm", children: r.error }),
3031
+ /* @__PURE__ */ e("button", { onClick: () => n.load(n.store.get().sources[n.store.get().currentSourceIndex] || { url: t || "", type: i || "auto" }, f), className: "px-6 py-2 bg-[var(--accent)] text-white font-medium rounded-full hover:opacity-90 transition-opacity mt-4 shadow-lg", children: "Try Again" })
2935
3032
  ] }) }),
2936
- j && !a.isLocked && (!a.isPlaying && !a.isBuffering && !a.error || a.controlsVisible) && !a.isBuffering ? /* @__PURE__ */ e(
3033
+ j && !r.isLocked && (!r.isPlaying && !r.isBuffering && !r.error || r.controlsVisible) && !r.isBuffering ? /* @__PURE__ */ e(
2937
3034
  "div",
2938
3035
  {
2939
- className: `absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${a.controlsVisible || !a.isPlaying ? "opacity-100" : "opacity-0"}`,
2940
- children: /* @__PURE__ */ d("div", { className: "flex items-center gap-8 md:gap-16 pointer-events-auto", children: [
2941
- /* @__PURE__ */ e("button", { onMouseDown: (c) => c.stopPropagation(), onTouchStart: (c) => c.stopPropagation(), onClick: (c) => {
2942
- c.stopPropagation(), C(), Re("rewind");
2943
- }, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${ue.skipBtn}`, children: /* @__PURE__ */ e(At, { className: ue.skipIcon }) }),
2944
- /* @__PURE__ */ e("button", { onMouseDown: (c) => c.stopPropagation(), onTouchStart: (c) => c.stopPropagation(), onClick: (c) => {
2945
- c.stopPropagation(), C(), s.togglePlay();
2946
- }, className: `group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all duration-300 active:scale-90 active:opacity-80 focus:outline-none backdrop-blur-md ${ue.playBtn}`, children: a.isPlaying ? /* @__PURE__ */ e(Ft, { className: `${ue.playIcon} text-white fill-current` }) : /* @__PURE__ */ e(Et, { className: `${ue.playIcon} text-white ml-1 fill-current` }) }),
2947
- /* @__PURE__ */ e("button", { onMouseDown: (c) => c.stopPropagation(), onTouchStart: (c) => c.stopPropagation(), onClick: (c) => {
2948
- c.stopPropagation(), C(), Re("forward");
2949
- }, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${ue.skipBtn}`, children: /* @__PURE__ */ e(Bt, { className: ue.skipIcon }) })
3036
+ className: `absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${r.controlsVisible || !r.isPlaying ? "opacity-100" : "opacity-0"}`,
3037
+ children: /* @__PURE__ */ c("div", { className: "flex items-center gap-8 md:gap-16 pointer-events-auto", children: [
3038
+ /* @__PURE__ */ e("button", { onMouseDown: (d) => d.stopPropagation(), onTouchStart: (d) => d.stopPropagation(), onClick: (d) => {
3039
+ d.stopPropagation(), z(), $e("rewind");
3040
+ }, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${he.skipBtn}`, children: /* @__PURE__ */ e(_t, { className: he.skipIcon }) }),
3041
+ /* @__PURE__ */ e("button", { onMouseDown: (d) => d.stopPropagation(), onTouchStart: (d) => d.stopPropagation(), onClick: (d) => {
3042
+ d.stopPropagation(), z(), n.togglePlay();
3043
+ }, className: `group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all duration-300 active:scale-90 active:opacity-80 focus:outline-none backdrop-blur-md ${he.playBtn}`, children: r.isPlaying ? /* @__PURE__ */ e(Wt, { className: `${he.playIcon} text-white fill-current` }) : /* @__PURE__ */ e(Ht, { className: `${he.playIcon} text-white ml-1 fill-current` }) }),
3044
+ /* @__PURE__ */ e("button", { onMouseDown: (d) => d.stopPropagation(), onTouchStart: (d) => d.stopPropagation(), onClick: (d) => {
3045
+ d.stopPropagation(), z(), $e("forward");
3046
+ }, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${he.skipBtn}`, children: /* @__PURE__ */ e(qt, { className: he.skipIcon }) })
2950
3047
  ] })
2951
3048
  }
2952
3049
  ) : null,
2953
- /* @__PURE__ */ d(
3050
+ /* @__PURE__ */ c(
2954
3051
  "div",
2955
3052
  {
2956
- className: `absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 py-4 bg-gradient-to-t from-black/90 via-black/50 to-transparent ${di ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4 pointer-events-none"}`,
2957
- onClick: (c) => {
2958
- (B || V || E) && C(), c.target === c.currentTarget && ze(!1), c.stopPropagation();
3053
+ className: `absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 py-4 bg-gradient-to-t from-black/90 via-black/50 to-transparent ${xi ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4 pointer-events-none"}`,
3054
+ onClick: (d) => {
3055
+ (V || B || E) && z(), d.target === d.currentTarget && ve(!1), d.stopPropagation();
2959
3056
  },
2960
3057
  children: [
2961
- !p.isLive && /* @__PURE__ */ d(
3058
+ !m.isLive && /* @__PURE__ */ c(
2962
3059
  "div",
2963
3060
  {
2964
- ref: Ge,
3061
+ ref: Je,
2965
3062
  className: "relative w-full h-3 group/slider mb-3 cursor-pointer touch-none flex items-center",
2966
- onMouseMove: ni,
3063
+ onMouseMove: hi,
2967
3064
  onMouseLeave: () => {
2968
- gt(null), vt(null);
3065
+ kt(null), St(null);
2969
3066
  },
2970
- onMouseDown: Nt,
2971
- onTouchStart: Nt,
3067
+ onMouseDown: Lt,
3068
+ onTouchStart: Lt,
2972
3069
  children: [
2973
- ($t = p.highlight) == null ? void 0 : $t.map((c, v) => /* @__PURE__ */ e("div", { className: "absolute top-1/2 -translate-y-1/2 w-1.5 h-1.5 bg-yellow-400 rounded-full z-10 pointer-events-none", style: { left: `${c.time / a.duration * 100}%` }, title: c.text }, v)),
2974
- bt !== null && /* @__PURE__ */ d("div", { className: "absolute bottom-full mb-1.5 flex flex-col items-center transform -translate-x-1/2 z-40 pointer-events-none transition-opacity duration-150", style: { left: `clamp(70px, ${Yt}%, calc(100% - 70px))` }, children: [
2975
- re && /* @__PURE__ */ e("div", { className: "bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm", style: { width: `${re.w * 0.5}px`, height: `${re.h * 0.5}px`, borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("div", { style: { backgroundImage: `url("${re.url}")`, width: `${re.w}px`, height: `${re.h}px`, backgroundPosition: `-${re.x}px -${re.y}px`, backgroundRepeat: "no-repeat", transform: "scale(0.5)", transformOrigin: "top left" } }) }),
2976
- /* @__PURE__ */ e("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children: Je(bt) })
3070
+ (Ot = m.highlight) == null ? void 0 : Ot.map((d, w) => /* @__PURE__ */ e("div", { className: "absolute top-1/2 -translate-y-1/2 w-1.5 h-1.5 bg-yellow-400 rounded-full z-10 pointer-events-none", style: { left: `${d.time / r.duration * 100}%` }, title: d.text }, w)),
3071
+ yt !== null && /* @__PURE__ */ c("div", { className: "absolute bottom-full mb-1.5 flex flex-col items-center transform -translate-x-1/2 z-40 pointer-events-none transition-opacity duration-150", style: { left: `clamp(70px, ${ri}%, calc(100% - 70px))` }, children: [
3072
+ ce && /* @__PURE__ */ e("div", { className: "bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm", style: { width: `${ce.w * 0.5}px`, height: `${ce.h * 0.5}px`, borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("div", { style: { backgroundImage: `url("${ce.url}")`, width: `${ce.w}px`, height: `${ce.h}px`, backgroundPosition: `-${ce.x}px -${ce.y}px`, backgroundRepeat: "no-repeat", transform: "scale(0.5)", transformOrigin: "top left" } }) }),
3073
+ /* @__PURE__ */ e("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children: it(yt) })
2977
3074
  ] }),
2978
- /* @__PURE__ */ d("div", { className: "w-full h-1 bg-white/20 overflow-hidden relative backdrop-blur-sm border-[length:var(--border-width)] border-white/10", style: { borderRadius: "var(--radius-full)" }, children: [
2979
- a.duration > 0 && a.buffered.map((c, v) => /* @__PURE__ */ e("div", { className: "absolute top-0 bottom-0 bg-white/20", style: { left: `${c.start / a.duration * 100}%`, width: `${(c.end - c.start) / a.duration * 100}%` } }, v)),
2980
- /* @__PURE__ */ e("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(Oe ? Te : a.currentTime) / a.duration * 100}%` } })
3075
+ /* @__PURE__ */ c("div", { className: "w-full h-1 bg-white/20 overflow-hidden relative backdrop-blur-sm border-[length:var(--border-width)] border-white/10", style: { borderRadius: "var(--radius-full)" }, children: [
3076
+ r.duration > 0 && r.buffered.map((d, w) => /* @__PURE__ */ e("div", { className: "absolute top-0 bottom-0 bg-white/20", style: { left: `${d.start / r.duration * 100}%`, width: `${(d.end - d.start) / r.duration * 100}%` } }, w)),
3077
+ /* @__PURE__ */ e("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(_e ? Re : r.currentTime) / r.duration * 100}%` } })
2981
3078
  ] }),
2982
3079
  /* @__PURE__ */ e(
2983
3080
  "div",
2984
3081
  {
2985
3082
  className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3.5 h-3.5 bg-white shadow-md scale-0 group-hover/slider:scale-100 transition-transform duration-100 z-10",
2986
3083
  style: {
2987
- left: `${(Oe ? Te : a.currentTime) / a.duration * 100}%`,
3084
+ left: `${(_e ? Re : r.currentTime) / r.duration * 100}%`,
2988
3085
  borderRadius: "var(--radius-full)"
2989
3086
  }
2990
3087
  }
@@ -2992,9 +3089,9 @@ const vn = [
2992
3089
  ]
2993
3090
  }
2994
3091
  ),
2995
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between pointer-events-auto", children: [
2996
- /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: It.filter((c) => c.position === "left" || c.position === "center").map(Rt) }),
2997
- /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: It.filter((c) => c.position === "right").map(Rt) })
3092
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between pointer-events-auto", children: [
3093
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: At.filter((d) => d.position === "left" || d.position === "center").map(Vt) }),
3094
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: At.filter((d) => d.position === "right").map(Vt) })
2998
3095
  ] })
2999
3096
  ]
3000
3097
  }
@@ -3003,21 +3100,21 @@ const vn = [
3003
3100
  ]
3004
3101
  }
3005
3102
  );
3006
- return a.isWebFullscreen && typeof document < "u" ? vi(Pt, document.body) : Pt;
3007
- }, Tn = (n, t) => {
3008
- const i = gi(n);
3009
- return i.render(ke.createElement(Ot, t)), {
3103
+ return r.isWebFullscreen && typeof document < "u" ? Ti(Bt, document.body) : Bt;
3104
+ }, $s = (s, t) => {
3105
+ const i = Mi(s);
3106
+ return i.render(Me.createElement(Yt, t)), {
3010
3107
  unmount: () => {
3011
3108
  i.unmount();
3012
3109
  },
3013
3110
  update: (o) => {
3014
- i.render(ke.createElement(Ot, { ...t, ...o }));
3111
+ i.render(Me.createElement(Yt, { ...t, ...o }));
3015
3112
  }
3016
3113
  };
3017
3114
  };
3018
3115
  export {
3019
- Ni as StrataCore,
3020
- Ot as StrataPlayer,
3021
- Tn as mountStrataPlayer
3116
+ $i as StrataCore,
3117
+ Yt as StrataPlayer,
3118
+ $s as mountStrataPlayer
3022
3119
  };
3023
3120
  //# sourceMappingURL=strataplayer.es.js.map