@eternalheart/react-file-preview 1.3.9 → 1.3.10

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.
Files changed (61) hide show
  1. package/README.md +10 -0
  2. package/README.zh-CN.md +10 -0
  3. package/lib/FilePreviewContent.d.ts.map +1 -1
  4. package/lib/chunks/{index-B-H9HQiI.mjs → index-B0JUZ5rS.mjs} +10 -10
  5. package/lib/chunks/{index-B-H9HQiI.mjs.map → index-B0JUZ5rS.mjs.map} +1 -1
  6. package/lib/chunks/{index-r3q2xCCI.mjs → index-BAYc4aBz.mjs} +2 -2
  7. package/lib/chunks/{index-r3q2xCCI.mjs.map → index-BAYc4aBz.mjs.map} +1 -1
  8. package/lib/chunks/{index-BNUiNUWa.mjs → index-BOQJNL71.mjs} +2 -2
  9. package/lib/chunks/{index-BNUiNUWa.mjs.map → index-BOQJNL71.mjs.map} +1 -1
  10. package/lib/chunks/{index-BdYkTSTt.mjs → index-BkU8rK-0.mjs} +3 -3
  11. package/lib/chunks/{index-BdYkTSTt.mjs.map → index-BkU8rK-0.mjs.map} +1 -1
  12. package/lib/chunks/{index-CgV8T0G5.mjs → index-BnDoXBnH.mjs} +2 -2
  13. package/lib/chunks/{index-CgV8T0G5.mjs.map → index-BnDoXBnH.mjs.map} +1 -1
  14. package/lib/chunks/index-C5YHI0Zs.mjs +160 -0
  15. package/lib/chunks/index-C5YHI0Zs.mjs.map +1 -0
  16. package/lib/chunks/{index-Bv93wiEK.mjs → index-CGNWXFy3.mjs} +716 -666
  17. package/lib/chunks/index-CGNWXFy3.mjs.map +1 -0
  18. package/lib/chunks/{index-DdOEWhrk.mjs → index-CwmZQ-JO.mjs} +16 -16
  19. package/lib/chunks/{index-DdOEWhrk.mjs.map → index-CwmZQ-JO.mjs.map} +1 -1
  20. package/lib/chunks/{index-CKirCT35.mjs → index-CzflrElZ.mjs} +5 -5
  21. package/lib/chunks/{index-CKirCT35.mjs.map → index-CzflrElZ.mjs.map} +1 -1
  22. package/lib/chunks/{index-D8GtNeDn.mjs → index-CztCCF7q.mjs} +2 -2
  23. package/lib/chunks/{index-D8GtNeDn.mjs.map → index-CztCCF7q.mjs.map} +1 -1
  24. package/lib/chunks/{index-BGeyzo6u.mjs → index-DKEcGewg.mjs} +2 -2
  25. package/lib/chunks/{index-BGeyzo6u.mjs.map → index-DKEcGewg.mjs.map} +1 -1
  26. package/lib/chunks/{index-DV5Jd7Qe.mjs → index-DN8BQIqo.mjs} +2 -2
  27. package/lib/chunks/{index-DV5Jd7Qe.mjs.map → index-DN8BQIqo.mjs.map} +1 -1
  28. package/lib/chunks/{index-zEVVgWCH.mjs → index-DPpUj8Yy.mjs} +2 -2
  29. package/lib/chunks/{index-zEVVgWCH.mjs.map → index-DPpUj8Yy.mjs.map} +1 -1
  30. package/lib/chunks/{index-BSD3w5eG.mjs → index-DSAXdrgU.mjs} +2 -2
  31. package/lib/chunks/{index-BSD3w5eG.mjs.map → index-DSAXdrgU.mjs.map} +1 -1
  32. package/lib/chunks/{index-DGuiWJr7.mjs → index-DveR0rOk.mjs} +15 -15
  33. package/lib/chunks/{index-DGuiWJr7.mjs.map → index-DveR0rOk.mjs.map} +1 -1
  34. package/lib/chunks/{index-BqEuP_8r.mjs → index-QfO-sASN.mjs} +2 -2
  35. package/lib/chunks/{index-BqEuP_8r.mjs.map → index-QfO-sASN.mjs.map} +1 -1
  36. package/lib/chunks/{index-BcBe6KW7.mjs → index-h9bO9wmq.mjs} +4 -4
  37. package/lib/chunks/{index-BcBe6KW7.mjs.map → index-h9bO9wmq.mjs.map} +1 -1
  38. package/lib/chunks/index-mvSVNKlQ.mjs +228 -0
  39. package/lib/chunks/index-mvSVNKlQ.mjs.map +1 -0
  40. package/lib/chunks/{index-U3w45GW8.mjs → index-tecGXW2S.mjs} +43 -43
  41. package/lib/chunks/{index-U3w45GW8.mjs.map → index-tecGXW2S.mjs.map} +1 -1
  42. package/lib/chunks/{useShikiHighlight-DzEAK0S7.mjs → useShikiHighlight-DHFYu0BU.mjs} +3 -3
  43. package/lib/chunks/{useShikiHighlight-DzEAK0S7.mjs.map → useShikiHighlight-DHFYu0BU.mjs.map} +1 -1
  44. package/lib/index.cjs +22 -18
  45. package/lib/index.cjs.map +1 -1
  46. package/lib/index.css +1 -1
  47. package/lib/index.d.ts +1 -0
  48. package/lib/index.d.ts.map +1 -1
  49. package/lib/index.mjs +13 -12
  50. package/lib/renderers/Font/index.d.ts +6 -0
  51. package/lib/renderers/Font/index.d.ts.map +1 -0
  52. package/lib/renderers/Pdf/index.d.ts +0 -1
  53. package/lib/renderers/Pdf/index.d.ts.map +1 -1
  54. package/lib/renderers/lazy.d.ts +2 -0
  55. package/lib/renderers/lazy.d.ts.map +1 -1
  56. package/lib/utils/pdfConfig.d.ts +2 -2
  57. package/lib/utils/pdfConfig.d.ts.map +1 -1
  58. package/package.json +3 -2
  59. package/lib/chunks/index-Bv93wiEK.mjs.map +0 -1
  60. package/lib/chunks/index-DmepcY31.mjs +0 -96
  61. package/lib/chunks/index-DmepcY31.mjs.map +0 -1
@@ -1,13 +1,32 @@
1
- import { jsx as l, jsxs as z, Fragment as Te } from "react/jsx-runtime";
2
- import Pe, { createContext as pt, useContext as J, useMemo as B, useState as y, useRef as V, useEffect as L, lazy as N, useCallback as P, Suspense as ze } from "react";
3
- import { createPortal as Ee } from "react-dom";
4
- import { motion as et, AnimatePresence as je } from "framer-motion";
5
- import { ZoomOut as At, ZoomIn as Ut, Scan as Se, RotateCcw as Le, RotateCw as We, RefreshCw as It, List as Ht, ChevronLeft as ct, ChevronRight as ft, Minimize2 as Vt, Maximize2 as Bt, WrapText as $e, Code as qt, Eye as Gt, FileQuestion as De, Download as Xt, X as Oe } from "lucide-react";
6
- import Ze from "jszip";
7
- import { pdfjs as X } from "react-pdf";
8
- const Ae = "1.3.9", Ue = {
1
+ import { jsx as s, jsxs as z, Fragment as Me } from "react/jsx-runtime";
2
+ import Te, { createContext as lt, useContext as X, useMemo as B, useState as y, useRef as H, useEffect as S, lazy as R, useCallback as P, Suspense as Pe } from "react";
3
+ import { createPortal as ze } from "react-dom";
4
+ import { motion as tt, AnimatePresence as je } from "framer-motion";
5
+ import { ZoomOut as Zt, ZoomIn as At, Scan as Ee, RotateCcw as Le, RotateCw as Se, RefreshCw as Ut, List as It, ChevronLeft as pt, ChevronRight as ft, Minimize2 as Vt, Maximize2 as Ht, WrapText as We, Code as Bt, Eye as qt, FileQuestion as $e, Download as Gt, X as De } from "lucide-react";
6
+ import Oe from "jszip";
7
+ import * as Ze from "pdfjs-dist/build/pdf.mjs";
8
+ const Ae = "1.3.10", Ue = {
9
9
  version: Ae
10
- };
10
+ }, fo = [
11
+ "image",
12
+ "pdf",
13
+ "docx",
14
+ "xlsx",
15
+ "pptx",
16
+ "msg",
17
+ "epub",
18
+ "mobi",
19
+ "video",
20
+ "audio",
21
+ "markdown",
22
+ "json",
23
+ "csv",
24
+ "xml",
25
+ "subtitle",
26
+ "zip",
27
+ "text",
28
+ "font"
29
+ ];
11
30
  function Ie(t) {
12
31
  try {
13
32
  const e = new URL(t).pathname.split("/").pop() || "file";
@@ -17,7 +36,7 @@ function Ie(t) {
17
36
  return decodeURIComponent(e);
18
37
  }
19
38
  }
20
- function at(t) {
39
+ function nt(t) {
21
40
  var e;
22
41
  const r = ((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "";
23
42
  return {
@@ -94,13 +113,13 @@ function at(t) {
94
113
  zip: "application/zip"
95
114
  }[r] || "application/octet-stream";
96
115
  }
97
- function He(t, e = 0) {
116
+ function Ve(t, e = 0) {
98
117
  if (t instanceof File)
99
118
  return {
100
119
  id: `file-${Date.now()}-${e}`,
101
120
  name: t.name,
102
121
  url: URL.createObjectURL(t),
103
- type: t.type || at(t.name),
122
+ type: t.type || nt(t.name),
104
123
  size: t.size
105
124
  };
106
125
  if (typeof t == "string") {
@@ -109,54 +128,56 @@ function He(t, e = 0) {
109
128
  id: `url-${Date.now()}-${e}`,
110
129
  name: r,
111
130
  url: t,
112
- type: at(r)
131
+ type: nt(r)
113
132
  };
114
133
  }
115
134
  return {
116
135
  id: t.id || `link-${Date.now()}-${e}`,
117
136
  name: t.name,
118
137
  url: t.url,
119
- type: t.type || at(t.name),
138
+ type: t.type || nt(t.name),
120
139
  size: t.size
121
140
  };
122
141
  }
123
- function Ve(t) {
124
- return t.map((e, r) => He(e, r));
142
+ function He(t) {
143
+ return t.map((e, r) => Ve(e, r));
125
144
  }
126
145
  function Be(t) {
127
146
  var e;
128
- const r = ((e = t.name.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "", n = t.type.toLowerCase();
129
- if (n.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(r))
147
+ const r = ((e = t.name.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "", o = t.type.toLowerCase();
148
+ if (o.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(r))
130
149
  return "image";
131
- if (n.includes("pdf") || r === "pdf")
150
+ if (o.includes("pdf") || r === "pdf")
132
151
  return "pdf";
133
- if (n.includes("wordprocessingml") || r === "docx")
152
+ if (o.includes("wordprocessingml") || r === "docx")
134
153
  return "docx";
135
- if (n.includes("spreadsheetml") || r === "xlsx")
154
+ if (o.includes("spreadsheetml") || r === "xlsx")
136
155
  return "xlsx";
137
- if (n.includes("presentationml") || r === "pptx" || r === "ppt")
156
+ if (o.includes("presentationml") || r === "pptx" || r === "ppt")
138
157
  return "pptx";
139
- if (n.includes("ms-outlook") || r === "msg")
158
+ if (o.includes("ms-outlook") || r === "msg")
140
159
  return "msg";
141
- if (n.includes("epub") || r === "epub")
160
+ if (o.includes("epub") || r === "epub")
142
161
  return "epub";
143
- if (["mobi", "azw", "azw3", "kf8"].includes(r) || n === "application/x-mobipocket-ebook" || n === "application/vnd.amazon.ebook")
162
+ if (["mobi", "azw", "azw3", "kf8"].includes(r) || o === "application/x-mobipocket-ebook" || o === "application/vnd.amazon.ebook")
144
163
  return "mobi";
145
- if (["csv", "tsv"].includes(r) || n === "text/csv" || n === "text/tab-separated-values")
164
+ if (["csv", "tsv"].includes(r) || o === "text/csv" || o === "text/tab-separated-values")
146
165
  return "csv";
147
- if (r === "xml" || n === "application/xml" || n === "text/xml")
166
+ if (r === "xml" || o === "application/xml" || o === "text/xml")
148
167
  return "xml";
149
- if (["srt", "vtt", "lrc", "elrc", "ass", "ssa", "ttml", "dfxp"].includes(r) || n === "text/vtt" || n === "application/x-subrip" || n === "application/ttml+xml")
168
+ if (["srt", "vtt", "lrc", "elrc", "ass", "ssa", "ttml", "dfxp"].includes(r) || o === "text/vtt" || o === "application/x-subrip" || o === "application/ttml+xml")
150
169
  return "subtitle";
151
- if (r === "zip" || n === "application/zip" || n === "application/x-zip-compressed")
170
+ if (r === "zip" || o === "application/zip" || o === "application/x-zip-compressed")
152
171
  return "zip";
153
- if (n.startsWith("video/") || ["mp4", "webm", "ogg", "ogv", "mov", "avi", "mkv", "m4v", "3gp", "flv"].includes(r))
172
+ if (["ttf", "otf", "woff", "woff2"].includes(r) || o.startsWith("font/") || o === "application/font-woff" || o === "application/font-woff2" || o === "application/x-font-ttf" || o === "application/x-font-otf" || o === "application/font-sfnt")
173
+ return "font";
174
+ if (o.startsWith("video/") || ["mp4", "webm", "ogg", "ogv", "mov", "avi", "mkv", "m4v", "3gp", "flv"].includes(r))
154
175
  return "video";
155
- if (n.startsWith("audio/") || ["mp3", "wav", "ogg", "m4a", "flac", "aac"].includes(r))
176
+ if (o.startsWith("audio/") || ["mp3", "wav", "ogg", "m4a", "flac", "aac"].includes(r))
156
177
  return "audio";
157
178
  if (r === "md" || r === "markdown")
158
179
  return "markdown";
159
- if (n === "application/json" || r === "json")
180
+ if (o === "application/json" || r === "json")
160
181
  return "json";
161
182
  const a = [
162
183
  "txt",
@@ -199,7 +220,7 @@ function Be(t) {
199
220
  "zsh",
200
221
  "sql"
201
222
  ];
202
- return n.startsWith("text/") || a.includes(r) ? "text" : "unsupported";
223
+ return o.startsWith("text/") || a.includes(r) ? "text" : "unsupported";
203
224
  }
204
225
  function co(t) {
205
226
  var e;
@@ -251,66 +272,66 @@ function co(t) {
251
272
  function qe(t) {
252
273
  return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
253
274
  }
254
- function fo(t) {
275
+ function uo(t) {
255
276
  var e;
256
277
  return (((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "") === "tsv" ? " " : ",";
257
278
  }
258
- function uo(t, e = {}) {
259
- const r = e.delimiter ?? ",", n = e.firstRowAsHeader ?? !0, a = [];
260
- let o = [], i = "", s = !1, p = 0;
261
- const c = t.length;
262
- for (; p < c; ) {
279
+ function mo(t, e = {}) {
280
+ const r = e.delimiter ?? ",", o = e.firstRowAsHeader ?? !0, a = [];
281
+ let n = [], i = "", l = !1, p = 0;
282
+ const f = t.length;
283
+ for (; p < f; ) {
263
284
  const u = t[p];
264
- if (s) {
285
+ if (l) {
265
286
  if (u === '"') {
266
287
  if (t[p + 1] === '"') {
267
288
  i += '"', p += 2;
268
289
  continue;
269
290
  }
270
- s = !1, p += 1;
291
+ l = !1, p += 1;
271
292
  continue;
272
293
  }
273
294
  i += u, p += 1;
274
295
  continue;
275
296
  }
276
297
  if (u === '"') {
277
- s = !0, p += 1;
298
+ l = !0, p += 1;
278
299
  continue;
279
300
  }
280
301
  if (u === r) {
281
- o.push(i), i = "", p += 1;
302
+ n.push(i), i = "", p += 1;
282
303
  continue;
283
304
  }
284
305
  if (u === "\r") {
285
306
  t[p + 1] === `
286
- ` && (p += 1), o.push(i), a.push(o), o = [], i = "", p += 1;
307
+ ` && (p += 1), n.push(i), a.push(n), n = [], i = "", p += 1;
287
308
  continue;
288
309
  }
289
310
  if (u === `
290
311
  `) {
291
- o.push(i), a.push(o), o = [], i = "", p += 1;
312
+ n.push(i), a.push(n), n = [], i = "", p += 1;
292
313
  continue;
293
314
  }
294
315
  i += u, p += 1;
295
316
  }
296
- for ((i.length > 0 || o.length > 0) && (o.push(i), a.push(o)); a.length > 0; ) {
317
+ for ((i.length > 0 || n.length > 0) && (n.push(i), a.push(n)); a.length > 0; ) {
297
318
  const u = a[a.length - 1];
298
319
  if (u.length === 1 && u[0] === "")
299
320
  a.pop();
300
321
  else
301
322
  break;
302
323
  }
303
- let f = [], d = a;
304
- n && a.length > 0 && (f = a[0], d = a.slice(1));
324
+ let c = [], d = a;
325
+ o && a.length > 0 && (c = a[0], d = a.slice(1));
305
326
  const h = Math.max(
306
- f.length,
327
+ c.length,
307
328
  ...d.map((u) => u.length),
308
329
  0
309
330
  );
310
331
  for (const u of d)
311
332
  for (; u.length < h; ) u.push("");
312
333
  return {
313
- header: f,
334
+ header: c,
314
335
  rows: d,
315
336
  columnCount: h,
316
337
  delimiter: r
@@ -334,10 +355,10 @@ function Ge(t) {
334
355
  }
335
356
  return new TextDecoder("utf-8", { fatal: !1 }).decode(e);
336
357
  }
337
- async function mo(t, e) {
338
- const r = !!e && ("fetcher" in e || "init" in e), n = r ? e.fetcher ?? fetch : fetch, a = r ? e.init : e, o = await n(t, a);
339
- if (!o.ok) throw new Error(`请求失败: ${o.status}`);
340
- const i = await o.arrayBuffer();
358
+ async function ho(t, e) {
359
+ const r = !!e && ("fetcher" in e || "init" in e), o = r ? e.fetcher ?? fetch : fetch, a = r ? e.init : e, n = await o(t, a);
360
+ if (!n.ok) throw new Error(`请求失败: ${n.status}`);
361
+ const i = await n.arrayBuffer();
341
362
  return Ge(i);
342
363
  }
343
364
  async function Xe(t, e) {
@@ -349,8 +370,8 @@ function Je(t, e) {
349
370
  if (!t) return e;
350
371
  if (!e) return t;
351
372
  const r = new Headers(t.headers || {});
352
- return e.headers && new Headers(e.headers).forEach((n, a) => {
353
- r.set(a, n);
373
+ return e.headers && new Headers(e.headers).forEach((o, a) => {
374
+ r.set(a, o);
354
375
  }), {
355
376
  ...t,
356
377
  ...e,
@@ -358,221 +379,221 @@ function Je(t, e) {
358
379
  };
359
380
  }
360
381
  function Ke(t) {
361
- const e = (t == null ? void 0 : t.requestHandler) ?? ((n, a) => fetch(n, a)), r = t == null ? void 0 : t.requestInit;
362
- return async (n, a) => {
363
- const o = await Xe(r, n), i = Je(o, a);
364
- return e(n, i);
382
+ const e = (t == null ? void 0 : t.requestHandler) ?? ((o, a) => fetch(o, a)), r = t == null ? void 0 : t.requestInit;
383
+ return async (o, a) => {
384
+ const n = await Xe(r, o), i = Je(n, a);
385
+ return e(o, i);
365
386
  };
366
387
  }
367
388
  async function Ye(t, e = fetch, r) {
368
- const n = await e(t, r);
369
- if (!n.ok) throw new Error(`请求失败: ${n.status}`);
370
- const a = await n.blob();
389
+ const o = await e(t, r);
390
+ if (!o.ok) throw new Error(`请求失败: ${o.status}`);
391
+ const a = await o.blob();
371
392
  return URL.createObjectURL(a);
372
393
  }
373
- async function Qe(t, e, r = fetch, n) {
374
- const a = await r(t, n);
394
+ async function Qe(t, e, r = fetch, o) {
395
+ const a = await r(t, o);
375
396
  if (!a.ok) throw new Error(`请求失败: ${a.status}`);
376
- const o = await a.blob(), i = URL.createObjectURL(o);
397
+ const n = await a.blob(), i = URL.createObjectURL(n);
377
398
  try {
378
- const s = document.createElement("a");
379
- s.href = i, s.download = e, s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s);
399
+ const l = document.createElement("a");
400
+ l.href = i, l.download = e, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l);
380
401
  } finally {
381
402
  setTimeout(() => URL.revokeObjectURL(i), 1e3);
382
403
  }
383
404
  }
384
- function St(t) {
385
- const e = t.trim().replace(",", "."), r = e.split(":").map((n) => n.trim());
405
+ function Et(t) {
406
+ const e = t.trim().replace(",", "."), r = e.split(":").map((o) => o.trim());
386
407
  if (r.length === 3) {
387
- const [n, a, o] = r;
388
- return Number(n) * 3600 + Number(a) * 60 + Number(o);
408
+ const [o, a, n] = r;
409
+ return Number(o) * 3600 + Number(a) * 60 + Number(n);
389
410
  }
390
411
  if (r.length === 2) {
391
- const [n, a] = r;
392
- return Number(n) * 60 + Number(a);
412
+ const [o, a] = r;
413
+ return Number(o) * 60 + Number(a);
393
414
  }
394
415
  return Number(e) || 0;
395
416
  }
396
- function ho(t) {
417
+ function bo(t) {
397
418
  if (!isFinite(t) || t < 0) return "00:00:00.000";
398
- const e = Math.floor(t * 1e3), r = e % 1e3, n = Math.floor(e / 1e3) % 60, a = Math.floor(e / 6e4) % 60, o = Math.floor(e / 36e5), i = (s, p = 2) => s.toString().padStart(p, "0");
399
- return `${i(o)}:${i(a)}:${i(n)}.${i(r, 3)}`;
419
+ const e = Math.floor(t * 1e3), r = e % 1e3, o = Math.floor(e / 1e3) % 60, a = Math.floor(e / 6e4) % 60, n = Math.floor(e / 36e5), i = (l, p = 2) => l.toString().padStart(p, "0");
420
+ return `${i(n)}:${i(a)}:${i(o)}.${i(r, 3)}`;
400
421
  }
401
422
  const Lt = /(\d{1,2}:)?\d{1,2}:\d{1,2}[.,]\d{1,3}\s*-->\s*(\d{1,2}:)?\d{1,2}:\d{1,2}[.,]\d{1,3}/, tr = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
402
423
  function er(t) {
403
424
  const e = t.replace(/^\uFEFF/, "").trimStart();
404
425
  return /^WEBVTT/.test(e) ? "vtt" : /^<\?xml/i.test(e) || /<tt\b[^>]*>/i.test(e) ? "ttml" : /^\[Script Info\]/im.test(e) || /^Dialogue:/m.test(e) ? /ScriptType:\s*v4\.00\s*$/im.test(e) ? "ssa" : "ass" : tr.test(e) || /^\[(ti|ar|al|au|by|length|offset|re|ve):/im.test(e) ? /<\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?>/.test(e) ? "elrc" : "lrc" : "srt";
405
426
  }
406
- function Wt(t, e) {
427
+ function St(t, e) {
407
428
  const r = t.replace(/\r\n?/g, `
408
429
  `).replace(/^\uFEFF/, "").split(`
409
- `), n = [];
410
- let a, o = 0;
430
+ `), o = [];
431
+ let a, n = 0;
411
432
  if (e === "vtt") {
412
433
  const i = [];
413
- for (; o < r.length && r[o].trim() !== ""; )
414
- i.push(r[o]), o++;
434
+ for (; n < r.length && r[n].trim() !== ""; )
435
+ i.push(r[n]), n++;
415
436
  for (a = i.join(`
416
- `); o < r.length && r[o].trim() === ""; ) o++;
437
+ `); n < r.length && r[n].trim() === ""; ) n++;
417
438
  }
418
- for (; o < r.length; ) {
419
- for (; o < r.length && r[o].trim() === ""; ) o++;
420
- if (o >= r.length) break;
421
- let i, s = null;
422
- if (Lt.test(r[o]))
423
- s = r[o], o++;
424
- else if (i = r[o].trim() || void 0, o++, o < r.length && Lt.test(r[o]))
425
- s = r[o], o++;
439
+ for (; n < r.length; ) {
440
+ for (; n < r.length && r[n].trim() === ""; ) n++;
441
+ if (n >= r.length) break;
442
+ let i, l = null;
443
+ if (Lt.test(r[n]))
444
+ l = r[n], n++;
445
+ else if (i = r[n].trim() || void 0, n++, n < r.length && Lt.test(r[n]))
446
+ l = r[n], n++;
426
447
  else
427
448
  continue;
428
- if (!s) continue;
429
- const p = s.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
449
+ if (!l) continue;
450
+ const p = l.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
430
451
  if (!p) continue;
431
- const c = St(p[1]), f = St(p[2]), d = [];
432
- for (; o < r.length && r[o].trim() !== ""; )
433
- d.push(r[o]), o++;
434
- n.push({ id: i, start: c, end: f, text: d.join(`
452
+ const f = Et(p[1]), c = Et(p[2]), d = [];
453
+ for (; n < r.length && r[n].trim() !== ""; )
454
+ d.push(r[n]), n++;
455
+ o.push({ id: i, start: f, end: c, text: d.join(`
435
456
  `) });
436
457
  }
437
- return { format: e, cues: n, header: a };
458
+ return { format: e, cues: o, header: a };
438
459
  }
439
- function lt(t, e, r) {
440
- const n = Number(t), a = Number(e);
441
- let o = 0;
460
+ function st(t, e, r) {
461
+ const o = Number(t), a = Number(e);
462
+ let n = 0;
442
463
  if (r) {
443
464
  const i = (r + "000").slice(0, 3);
444
- o = Number(i);
465
+ n = Number(i);
445
466
  }
446
- return n * 60 + a + o / 1e3;
467
+ return o * 60 + a + n / 1e3;
447
468
  }
448
- function Jt(t, e) {
469
+ function Xt(t, e) {
449
470
  const r = /^\[(ti|ar|al|au|by|length|offset|re|ve):(.*)\]$/i.exec(t.trim());
450
471
  if (!r) return !1;
451
- const n = r[1].toLowerCase(), a = r[2].trim();
452
- if (e.metadata[n] = a, n === "offset") {
453
- const o = Number(a);
454
- isNaN(o) || (e.offsetMs = o);
472
+ const o = r[1].toLowerCase(), a = r[2].trim();
473
+ if (e.metadata[o] = a, o === "offset") {
474
+ const n = Number(a);
475
+ isNaN(n) || (e.offsetMs = n);
455
476
  }
456
477
  return !0;
457
478
  }
458
479
  function rr(t) {
459
480
  const e = t.replace(/\r\n?/g, `
460
481
  `).replace(/^\uFEFF/, "").split(`
461
- `), r = { metadata: {}, offsetMs: 0 }, n = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = [];
482
+ `), r = { metadata: {}, offsetMs: 0 }, o = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = [];
462
483
  for (const i of e) {
463
- const s = i.trim();
464
- if (!s || Jt(s, r)) continue;
484
+ const l = i.trim();
485
+ if (!l || Xt(l, r)) continue;
465
486
  const p = [];
466
- let c = 0;
467
- n.lastIndex = 0;
468
- let f;
469
- for (; (f = n.exec(s)) !== null && f.index === c; )
470
- p.push(lt(f[1], f[2], f[3])), c = f.index + f[0].length;
487
+ let f = 0;
488
+ o.lastIndex = 0;
489
+ let c;
490
+ for (; (c = o.exec(l)) !== null && c.index === f; )
491
+ p.push(st(c[1], c[2], c[3])), f = c.index + c[0].length;
471
492
  if (p.length === 0) continue;
472
- const d = s.slice(c).trim();
493
+ const d = l.slice(f).trim();
473
494
  for (const h of p)
474
495
  a.push({ start: h, text: d });
475
496
  }
476
- a.sort((i, s) => i.start - s.start);
477
- const o = r.offsetMs / 1e3;
478
- return { format: "lrc", cues: a.map((i, s) => {
479
- const p = Math.max(0, i.start - o), c = a[s + 1], f = c ? Math.max(p, c.start - o) : p + 5;
480
- return { start: p, end: f, text: i.text };
497
+ a.sort((i, l) => i.start - l.start);
498
+ const n = r.offsetMs / 1e3;
499
+ return { format: "lrc", cues: a.map((i, l) => {
500
+ const p = Math.max(0, i.start - n), f = a[l + 1], c = f ? Math.max(p, f.start - n) : p + 5;
501
+ return { start: p, end: c, text: i.text };
481
502
  }), metadata: r.metadata };
482
503
  }
483
504
  function or(t) {
484
505
  const e = t.replace(/\r\n?/g, `
485
506
  `).replace(/^\uFEFF/, "").split(`
486
- `), r = { metadata: {}, offsetMs: 0 }, n = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = /<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>/g, o = [];
487
- for (const s of e) {
488
- const p = s.trim();
489
- if (!p || Jt(p, r)) continue;
490
- const c = [];
491
- let f = 0;
492
- n.lastIndex = 0;
507
+ `), r = { metadata: {}, offsetMs: 0 }, o = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = /<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>/g, n = [];
508
+ for (const l of e) {
509
+ const p = l.trim();
510
+ if (!p || Xt(p, r)) continue;
511
+ const f = [];
512
+ let c = 0;
513
+ o.lastIndex = 0;
493
514
  let d;
494
- for (; (d = n.exec(p)) !== null && d.index === f; )
495
- c.push(lt(d[1], d[2], d[3])), f = d.index + d[0].length;
496
- if (c.length === 0) continue;
497
- const h = p.slice(f);
498
- for (const u of c)
499
- o.push({ start: u, raw: h });
515
+ for (; (d = o.exec(p)) !== null && d.index === c; )
516
+ f.push(st(d[1], d[2], d[3])), c = d.index + d[0].length;
517
+ if (f.length === 0) continue;
518
+ const h = p.slice(c);
519
+ for (const u of f)
520
+ n.push({ start: u, raw: h });
500
521
  }
501
- o.sort((s, p) => s.start - p.start);
522
+ n.sort((l, p) => l.start - p.start);
502
523
  const i = r.offsetMs / 1e3;
503
- return { format: "elrc", cues: o.map((s, p) => {
504
- const c = [];
505
- let f = "", d = 0, h = null;
524
+ return { format: "elrc", cues: n.map((l, p) => {
525
+ const f = [];
526
+ let c = "", d = 0, h = null;
506
527
  a.lastIndex = 0;
507
528
  let u;
508
- for (; (u = a.exec(s.raw)) !== null; ) {
509
- const T = s.raw.slice(d, u.index);
510
- h !== null && T && c.push({ start: Math.max(0, h - i), text: T }), f += T, h = lt(u[1], u[2], u[3]), d = u.index + u[0].length;
529
+ for (; (u = a.exec(l.raw)) !== null; ) {
530
+ const T = l.raw.slice(d, u.index);
531
+ h !== null && T && f.push({ start: Math.max(0, h - i), text: T }), c += T, h = st(u[1], u[2], u[3]), d = u.index + u[0].length;
511
532
  }
512
- const _ = s.raw.slice(d);
513
- h !== null && _ && c.push({ start: Math.max(0, h - i), text: _ }), f += _;
514
- const M = Math.max(0, s.start - i), v = o[p + 1], F = v ? Math.max(M, v.start - i) : M + 5;
533
+ const _ = l.raw.slice(d);
534
+ h !== null && _ && f.push({ start: Math.max(0, h - i), text: _ }), c += _;
535
+ const M = Math.max(0, l.start - i), x = n[p + 1], F = x ? Math.max(M, x.start - i) : M + 5;
515
536
  return {
516
537
  start: M,
517
538
  end: F,
518
- text: f.trim(),
519
- words: c.length ? c : void 0
539
+ text: c.trim(),
540
+ words: f.length ? f : void 0
520
541
  };
521
542
  }), metadata: r.metadata };
522
543
  }
523
- function $t(t) {
544
+ function Wt(t) {
524
545
  const e = t.trim().split(":");
525
546
  return e.length !== 3 ? 0 : Number(e[0]) * 3600 + Number(e[1]) * 60 + Number(e[2].replace(",", "."));
526
547
  }
527
- function Dt(t, e) {
548
+ function $t(t, e) {
528
549
  const r = t.replace(/\r\n?/g, `
529
550
  `).replace(/^\uFEFF/, "").split(`
530
551
  `);
531
- let n = "", a = [];
532
- const o = [], i = [];
533
- for (const s of r) {
534
- const p = s.replace(/\s+$/, ""), c = p.trim(), f = /^\[([^\]]+)\]\s*$/.exec(c);
535
- if (f) {
536
- n = f[1].toLowerCase(), i.push(p);
552
+ let o = "", a = [];
553
+ const n = [], i = [];
554
+ for (const l of r) {
555
+ const p = l.replace(/\s+$/, ""), f = p.trim(), c = /^\[([^\]]+)\]\s*$/.exec(f);
556
+ if (c) {
557
+ o = c[1].toLowerCase(), i.push(p);
537
558
  continue;
538
559
  }
539
- if (n !== "events") {
560
+ if (o !== "events") {
540
561
  i.push(p);
541
562
  continue;
542
563
  }
543
- const d = /^Format:\s*(.+)$/i.exec(c);
564
+ const d = /^Format:\s*(.+)$/i.exec(f);
544
565
  if (d) {
545
- a = d[1].split(",").map((x) => x.trim());
566
+ a = d[1].split(",").map((v) => v.trim());
546
567
  continue;
547
568
  }
548
- const h = /^(Dialogue|Comment):\s*(.+)$/i.exec(c);
569
+ const h = /^(Dialogue|Comment):\s*(.+)$/i.exec(f);
549
570
  if (!h || h[1].toLowerCase() === "comment" || a.length === 0) continue;
550
- const u = a.length, _ = h[2].split(","), M = _.slice(0, u - 1), v = _.slice(u - 1).join(","), F = {};
551
- a.forEach((x, S) => {
552
- F[x] = S === u - 1 ? v : M[S] ?? "";
571
+ const u = a.length, _ = h[2].split(","), M = _.slice(0, u - 1), x = _.slice(u - 1).join(","), F = {};
572
+ a.forEach((v, L) => {
573
+ F[v] = L === u - 1 ? x : M[L] ?? "";
553
574
  });
554
- const T = $t(F.Start || ""), k = $t(F.End || ""), R = (F.Text || "").replace(/\\N/g, `
575
+ const T = Wt(F.Start || ""), k = Wt(F.End || ""), N = (F.Text || "").replace(/\\N/g, `
555
576
  `).replace(/\\n/g, `
556
577
  `).replace(/\\h/g, " ").replace(/\{[^}]*\}/g, "");
557
- o.push({ start: T, end: k, text: R, style: F.Style });
578
+ n.push({ start: T, end: k, text: N, style: F.Style });
558
579
  }
559
- return o.sort((s, p) => s.start - p.start), {
580
+ return n.sort((l, p) => l.start - p.start), {
560
581
  format: e,
561
- cues: o,
582
+ cues: n,
562
583
  header: i.join(`
563
584
  `).trim() || void 0
564
585
  };
565
586
  }
566
- function it(t) {
587
+ function at(t) {
567
588
  const e = t.trim();
568
589
  if (!e) return 0;
569
590
  const r = /^(\d+(?:\.\d+)?)(h|m|s|ms|f|t)$/i.exec(e);
570
591
  if (r) {
571
- const a = Number(r[1]), o = r[2].toLowerCase();
572
- return o === "h" ? a * 3600 : o === "m" ? a * 60 : o === "ms" ? a / 1e3 : a;
592
+ const a = Number(r[1]), n = r[2].toLowerCase();
593
+ return n === "h" ? a * 3600 : n === "m" ? a * 60 : n === "ms" ? a / 1e3 : a;
573
594
  }
574
- const n = e.split(":");
575
- return n.length === 3 ? Number(n[0]) * 3600 + Number(n[1]) * 60 + Number(n[2]) : n.length === 2 ? Number(n[0]) * 60 + Number(n[1]) : Number(e) || 0;
595
+ const o = e.split(":");
596
+ return o.length === 3 ? Number(o[0]) * 3600 + Number(o[1]) * 60 + Number(o[2]) : o.length === 2 ? Number(o[0]) * 60 + Number(o[1]) : Number(e) || 0;
576
597
  }
577
598
  function nr(t) {
578
599
  if (typeof DOMParser > "u")
@@ -580,13 +601,13 @@ function nr(t) {
580
601
  const e = new DOMParser().parseFromString(t, "application/xml");
581
602
  if (e.getElementsByTagName("parsererror").length > 0)
582
603
  throw new Error("TTML XML parse error");
583
- const r = e.getElementsByTagName("p"), n = [];
604
+ const r = e.getElementsByTagName("p"), o = [];
584
605
  for (let a = 0; a < r.length; a++) {
585
- const o = r[a], i = o.getAttribute("begin") || "", s = o.getAttribute("end") || "", p = o.getAttribute("dur") || "", c = it(i);
586
- let f;
587
- s ? f = it(s) : p ? f = c + it(p) : f = c + 5;
606
+ const n = r[a], i = n.getAttribute("begin") || "", l = n.getAttribute("end") || "", p = n.getAttribute("dur") || "", f = at(i);
607
+ let c;
608
+ l ? c = at(l) : p ? c = f + at(p) : c = f + 5;
588
609
  let d = "";
589
- o.childNodes.forEach((u) => {
610
+ n.childNodes.forEach((u) => {
590
611
  if (u.nodeType === 3)
591
612
  d += u.nodeValue || "";
592
613
  else if (u.nodeType === 1) {
@@ -597,85 +618,85 @@ function nr(t) {
597
618
  });
598
619
  const h = d.replace(/[ \t]+/g, " ").replace(/\n /g, `
599
620
  `).trim();
600
- (h || c || f) && n.push({ start: c, end: f, text: h });
621
+ (h || f || c) && o.push({ start: f, end: c, text: h });
601
622
  }
602
- return n.sort((a, o) => a.start - o.start), { format: "ttml", cues: n };
623
+ return o.sort((a, n) => a.start - n.start), { format: "ttml", cues: o };
603
624
  }
604
- function bo(t, e) {
625
+ function go(t, e) {
605
626
  switch (e ?? er(t)) {
606
627
  case "lrc":
607
628
  return rr(t);
608
629
  case "elrc":
609
630
  return or(t);
610
631
  case "ass":
611
- return Dt(t, "ass");
632
+ return $t(t, "ass");
612
633
  case "ssa":
613
- return Dt(t, "ssa");
634
+ return $t(t, "ssa");
614
635
  case "ttml":
615
636
  return nr(t);
616
637
  case "vtt":
617
- return Wt(t, "vtt");
638
+ return St(t, "vtt");
618
639
  case "srt":
619
640
  default:
620
- return Wt(t, "srt");
641
+ return St(t, "srt");
621
642
  }
622
643
  }
623
- async function go(t) {
624
- return Ze.loadAsync(t);
644
+ async function wo(t) {
645
+ return Oe.loadAsync(t);
625
646
  }
626
- function wo(t) {
647
+ function xo(t) {
627
648
  const e = [];
628
- return t.forEach((r, n) => {
649
+ return t.forEach((r, o) => {
629
650
  var a;
630
- const o = n.dir, i = o && !r.endsWith("/") ? r + "/" : r, s = o ? i.replace(/\/$/, "") : i, p = s.lastIndexOf("/"), c = p >= 0 ? s.slice(p + 1) : s, f = p >= 0 ? s.slice(0, p) : "", d = o ? 0 : ((a = n._data) == null ? void 0 : a.uncompressedSize) ?? 0;
651
+ const n = o.dir, i = n && !r.endsWith("/") ? r + "/" : r, l = n ? i.replace(/\/$/, "") : i, p = l.lastIndexOf("/"), f = p >= 0 ? l.slice(p + 1) : l, c = p >= 0 ? l.slice(0, p) : "", d = n ? 0 : ((a = o._data) == null ? void 0 : a.uncompressedSize) ?? 0;
631
652
  e.push({
632
653
  path: i,
633
- name: c,
634
- dir: f,
635
- isDir: o,
654
+ name: f,
655
+ dir: c,
656
+ isDir: n,
636
657
  size: d,
637
- date: n.date
658
+ date: o.date
638
659
  });
639
660
  }), e;
640
661
  }
641
662
  function vo(t) {
642
663
  const e = { name: "", path: "", isDir: !0, children: [], size: 0 }, r = /* @__PURE__ */ new Map();
643
664
  r.set("", e);
644
- const n = (o) => {
645
- if (r.has(o)) return r.get(o);
646
- const i = o.split("/").filter(Boolean);
647
- let s = e, p = "";
648
- for (const c of i) {
649
- p = p ? `${p}/${c}` : c;
650
- let f = r.get(p);
651
- f || (f = { name: c, path: p + "/", isDir: !0, children: [], size: 0 }, s.children.push(f), r.set(p, f)), s = f;
665
+ const o = (n) => {
666
+ if (r.has(n)) return r.get(n);
667
+ const i = n.split("/").filter(Boolean);
668
+ let l = e, p = "";
669
+ for (const f of i) {
670
+ p = p ? `${p}/${f}` : f;
671
+ let c = r.get(p);
672
+ c || (c = { name: f, path: p + "/", isDir: !0, children: [], size: 0 }, l.children.push(c), r.set(p, c)), l = c;
652
673
  }
653
- return s;
674
+ return l;
654
675
  };
655
- for (const o of t) {
656
- if (o.isDir) {
657
- n(o.path.replace(/\/$/, ""));
676
+ for (const n of t) {
677
+ if (n.isDir) {
678
+ o(n.path.replace(/\/$/, ""));
658
679
  continue;
659
680
  }
660
- n(o.dir).children.push({
661
- name: o.name,
662
- path: o.path,
681
+ o(n.dir).children.push({
682
+ name: n.name,
683
+ path: n.path,
663
684
  isDir: !1,
664
- size: o.size
685
+ size: n.size
665
686
  });
666
687
  }
667
- const a = (o) => {
668
- if (o.children) {
669
- o.children.sort((i, s) => i.isDir !== s.isDir ? i.isDir ? -1 : 1 : i.name.localeCompare(s.name));
670
- for (const i of o.children) a(i);
688
+ const a = (n) => {
689
+ if (n.children) {
690
+ n.children.sort((i, l) => i.isDir !== l.isDir ? i.isDir ? -1 : 1 : i.name.localeCompare(l.name));
691
+ for (const i of n.children) a(i);
671
692
  }
672
693
  };
673
694
  return a(e), e;
674
695
  }
675
- async function xo(t, e, r) {
676
- const n = t.file(e);
677
- if (!n) throw new Error(`ZIP entry not found: ${e}`);
678
- const a = await n.async("arraybuffer");
696
+ async function yo(t, e, r) {
697
+ const o = t.file(e);
698
+ if (!o) throw new Error(`ZIP entry not found: ${e}`);
699
+ const a = await o.async("arraybuffer");
679
700
  return new Blob([a], r ? { type: r } : void 0);
680
701
  }
681
702
  function ar(t) {
@@ -759,17 +780,17 @@ const ir = [
759
780
  "333333"
760
781
  ];
761
782
  function lr(t, e) {
762
- const r = parseInt(t.substring(0, 2), 16), n = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16), o = (c) => e < 0 ? Math.round(c * (1 + e)) : Math.round(c + (255 - c) * e), i = Math.min(255, Math.max(0, o(r))), s = Math.min(255, Math.max(0, o(n))), p = Math.min(255, Math.max(0, o(a)));
763
- return i.toString(16).padStart(2, "0") + s.toString(16).padStart(2, "0") + p.toString(16).padStart(2, "0");
783
+ const r = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16), n = (f) => e < 0 ? Math.round(f * (1 + e)) : Math.round(f + (255 - f) * e), i = Math.min(255, Math.max(0, n(r))), l = Math.min(255, Math.max(0, n(o))), p = Math.min(255, Math.max(0, n(a)));
784
+ return i.toString(16).padStart(2, "0") + l.toString(16).padStart(2, "0") + p.toString(16).padStart(2, "0");
764
785
  }
765
786
  function pr(t) {
766
787
  if (t && t.type === "pattern" && t.pattern === "solid") {
767
788
  const e = t.fgColor;
768
789
  if (e)
769
- return dt(e);
790
+ return ct(e);
770
791
  }
771
792
  }
772
- function dt(t) {
793
+ function ct(t) {
773
794
  if (t) {
774
795
  if ("argb" in t && typeof t.argb == "string" && t.argb)
775
796
  return ar(t.argb);
@@ -783,36 +804,36 @@ function dt(t) {
783
804
  }
784
805
  }
785
806
  }
786
- function cr(t) {
807
+ function fr(t) {
787
808
  if (!t || !t.style) return;
788
- const e = dt(t.color) || "#000000";
809
+ const e = ct(t.color) || "#000000";
789
810
  return [t.style, e];
790
811
  }
791
- function fr(t) {
812
+ function cr(t) {
792
813
  const e = {};
793
814
  let r = !1;
794
815
  if (t.font) {
795
816
  const a = t.font;
796
817
  if ((a.name || a.size || a.bold || a.italic) && (r = !0, e.font = {}, a.name && (e.font.name = a.name), a.size && (e.font.size = a.size), a.bold && (e.font.bold = !0), a.italic && (e.font.italic = !0)), a.color) {
797
- const o = dt(a.color);
798
- o && (r = !0, e.color = o);
818
+ const n = ct(a.color);
819
+ n && (r = !0, e.color = n);
799
820
  }
800
821
  a.underline && (r = !0, e.underline = !0), a.strike && (r = !0, e.strike = !0);
801
822
  }
802
- const n = pr(t.fill);
803
- if (n && (r = !0, e.bgcolor = n), t.alignment) {
823
+ const o = pr(t.fill);
824
+ if (o && (r = !0, e.bgcolor = o), t.alignment) {
804
825
  const a = t.alignment;
805
826
  a.horizontal && (r = !0, e.align = a.horizontal), a.vertical && (r = !0, e.valign = a.vertical), a.wrapText && (r = !0, e.textwrap = !0);
806
827
  }
807
828
  if (t.border) {
808
829
  const a = {};
809
- let o = !1;
830
+ let n = !1;
810
831
  const i = ["top", "bottom", "left", "right"];
811
- for (const s of i) {
812
- const p = cr(t.border[s]);
813
- p && (a[s] = p, o = !0);
832
+ for (const l of i) {
833
+ const p = fr(t.border[l]);
834
+ p && (a[l] = p, n = !0);
814
835
  }
815
- o && (r = !0, e.border = a);
836
+ n && (r = !0, e.border = a);
816
837
  }
817
838
  return r ? e : null;
818
839
  }
@@ -820,12 +841,12 @@ function dr(t) {
820
841
  return JSON.stringify(t);
821
842
  }
822
843
  function ur(t, e, r) {
823
- const n = fr(t);
824
- if (!n) return -1;
825
- const a = dr(n), o = r.get(a);
826
- if (o !== void 0) return o;
844
+ const o = cr(t);
845
+ if (!o) return -1;
846
+ const a = dr(o), n = r.get(a);
847
+ if (n !== void 0) return n;
827
848
  const i = e.length;
828
- return e.push(n), r.set(a, i), i;
849
+ return e.push(o), r.set(a, i), i;
829
850
  }
830
851
  function mr(t) {
831
852
  const e = t.value;
@@ -842,76 +863,86 @@ function mr(t) {
842
863
  return typeof e == "object" && "richText" in e ? e.richText.map((r) => r.text).join("") : typeof e == "object" && "hyperlink" in e ? e.text || "" : typeof e == "object" && "error" in e ? String(e.error) : String(e);
843
864
  }
844
865
  function hr(t) {
845
- const e = t.split(":"), r = Ot(e[0]), n = e[1] ? Ot(e[1]) : r;
866
+ const e = t.split(":"), r = Dt(e[0]), o = e[1] ? Dt(e[1]) : r;
846
867
  return {
847
868
  top: r.row,
848
869
  left: r.col,
849
- bottom: n.row,
850
- right: n.col
870
+ bottom: o.row,
871
+ right: o.col
851
872
  };
852
873
  }
853
- function Ot(t) {
874
+ function Dt(t) {
854
875
  const e = t.match(/^([A-Z]+)(\d+)$/);
855
876
  if (!e) return { row: 1, col: 1 };
856
- const r = e[1], n = parseInt(e[2], 10);
877
+ const r = e[1], o = parseInt(e[2], 10);
857
878
  let a = 0;
858
- for (let o = 0; o < r.length; o++)
859
- a = a * 26 + (r.charCodeAt(o) - 64);
860
- return { row: n, col: a };
879
+ for (let n = 0; n < r.length; n++)
880
+ a = a * 26 + (r.charCodeAt(n) - 64);
881
+ return { row: o, col: a };
861
882
  }
862
- function yo(t) {
883
+ function Fo(t) {
863
884
  const e = [];
864
885
  return t.eachSheet((r) => {
865
- const n = [], a = /* @__PURE__ */ new Map(), o = [], i = {}, s = {}, p = r.columnCount;
886
+ const o = [], a = /* @__PURE__ */ new Map(), n = [], i = {}, l = {}, p = r.columnCount;
866
887
  for (let h = 1; h <= p; h++) {
867
888
  const u = r.getColumn(h);
868
- u.width && (s[String(h - 1)] = { width: Math.round(u.width * 7.5) });
889
+ u.width && (l[String(h - 1)] = { width: Math.round(u.width * 7.5) });
869
890
  }
870
- s.len = Math.max(p, 26);
871
- const c = /* @__PURE__ */ new Map(), f = r.model, d = (f == null ? void 0 : f.merges) || [];
891
+ l.len = Math.max(p, 26);
892
+ const f = /* @__PURE__ */ new Map(), c = r.model, d = (c == null ? void 0 : c.merges) || [];
872
893
  for (const h of d) {
873
- o.push(h);
874
- const { top: u, left: _, bottom: M, right: v } = hr(h), F = M - u, T = v - _;
875
- c.set(`${u - 1},${_ - 1}`, [F, T]);
894
+ n.push(h);
895
+ const { top: u, left: _, bottom: M, right: x } = hr(h), F = M - u, T = x - _;
896
+ f.set(`${u - 1},${_ - 1}`, [F, T]);
876
897
  }
877
898
  r.eachRow({ includeEmpty: !0 }, (h, u) => {
878
899
  const _ = u - 1, M = {};
879
900
  h.eachCell({ includeEmpty: !1 }, (F, T) => {
880
901
  const k = T - 1;
881
902
  if (F.isMerged && F.master !== F) return;
882
- const R = mr(F), x = ur(F, n, a), S = { text: R };
883
- x !== -1 && (S.style = x);
903
+ const N = mr(F), v = ur(F, o, a), L = { text: N };
904
+ v !== -1 && (L.style = v);
884
905
  const W = `${_},${k}`;
885
- c.has(W) && (S.merge = c.get(W)), M[String(k)] = S;
906
+ f.has(W) && (L.merge = f.get(W)), M[String(k)] = L;
886
907
  });
887
- const v = { cells: M };
888
- h.height && (v.height = Math.round(h.height * 1.333)), i[String(_)] = v;
908
+ const x = { cells: M };
909
+ h.height && (x.height = Math.round(h.height * 1.333)), i[String(_)] = x;
889
910
  }), e.push({
890
911
  name: r.name,
891
- styles: n,
892
- merges: o,
912
+ styles: o,
913
+ merges: n,
893
914
  rows: i,
894
- cols: s
915
+ cols: l
895
916
  });
896
917
  }), e;
897
918
  }
898
- function Fo(t, e, r = "Sheet1") {
899
- const n = t.length > 0, a = n ? [{ font: { bold: !0 } }] : [], o = {};
900
- if (n) {
901
- const s = {};
902
- t.forEach((p, c) => {
903
- s[String(c)] = { text: p, style: 0 };
904
- }), o[0] = { cells: s };
919
+ function _o(t, e, r = "Sheet1") {
920
+ const o = t.length > 0, a = o ? [{ font: { bold: !0 } }] : [], n = {};
921
+ if (o) {
922
+ const l = {};
923
+ t.forEach((p, f) => {
924
+ l[String(f)] = { text: p, style: 0 };
925
+ }), n[0] = { cells: l };
905
926
  }
906
- const i = n ? 1 : 0;
907
- return e.forEach((s, p) => {
908
- const c = {};
909
- s.forEach((f, d) => {
910
- f !== void 0 && f !== "" && (c[String(d)] = { text: f });
911
- }), o[String(p + i)] = { cells: c };
912
- }), [{ name: r, styles: a, rows: o }];
927
+ const i = o ? 1 : 0;
928
+ return e.forEach((l, p) => {
929
+ const f = {};
930
+ l.forEach((c, d) => {
931
+ c !== void 0 && c !== "" && (f[String(d)] = { text: c });
932
+ }), n[String(p + i)] = { cells: f };
933
+ }), [{ name: r, styles: a, rows: n }];
913
934
  }
914
- const br = {
935
+ function br(t, e) {
936
+ var r;
937
+ if (typeof window > "u") return;
938
+ const o = (t == null ? void 0 : t.version) || ((r = t == null ? void 0 : t.GlobalWorkerOptions) == null ? void 0 : r.version) || "", {
939
+ workerSrc: a = `https://unpkg.com/pdfjs-dist@${o}/build/pdf.worker.min.mjs`,
940
+ cMapUrl: n = `https://unpkg.com/pdfjs-dist@${o}/cmaps/`,
941
+ cMapPacked: i = !0
942
+ } = e || {};
943
+ t.GlobalWorkerOptions && (t.GlobalWorkerOptions.workerSrc = a, t.GlobalWorkerOptions.cMapUrl = n, t.GlobalWorkerOptions.cMapPacked = i);
944
+ }
945
+ const gr = {
915
946
  // ─────── common ───────
916
947
  "common.download": "下载",
917
948
  "common.close": "关闭",
@@ -1009,8 +1040,19 @@ const br = {
1009
1040
  "zip.load_failed": "ZIP 文件加载失败",
1010
1041
  "zip.parse_failed": "ZIP 解析失败",
1011
1042
  // ─────── text ───────
1012
- "text.load_failed": "文本文件加载失败"
1013
- }, gr = {
1043
+ "text.load_failed": "文本文件加载失败",
1044
+ // ─────── font ───────
1045
+ "font.loading": "加载字体中...",
1046
+ "font.load_failed": "字体文件加载失败",
1047
+ "font.parse_failed": "字体解析失败",
1048
+ "font.meta.family": "字体家族",
1049
+ "font.meta.subfamily": "子系列",
1050
+ "font.meta.version": "版本",
1051
+ "font.meta.designer": "设计师",
1052
+ "font.meta.glyphs": "字形数量",
1053
+ "font.meta.format": "格式",
1054
+ "font.sample_text_placeholder": "输入自定义文本..."
1055
+ }, wr = {
1014
1056
  // ─────── common ───────
1015
1057
  "common.download": "Download",
1016
1058
  "common.close": "Close",
@@ -1108,53 +1150,64 @@ const br = {
1108
1150
  "zip.load_failed": "Failed to load ZIP",
1109
1151
  "zip.parse_failed": "Failed to parse ZIP",
1110
1152
  // ─────── text ───────
1111
- "text.load_failed": "Failed to load text file"
1112
- }, tt = {
1113
- "zh-CN": br,
1114
- "en-US": gr
1115
- }, wr = /\{(\w+)\}/g;
1153
+ "text.load_failed": "Failed to load text file",
1154
+ // ─────── font ───────
1155
+ "font.loading": "Loading font...",
1156
+ "font.load_failed": "Failed to load font",
1157
+ "font.parse_failed": "Failed to parse font",
1158
+ "font.meta.family": "Family",
1159
+ "font.meta.subfamily": "Subfamily",
1160
+ "font.meta.version": "Version",
1161
+ "font.meta.designer": "Designer",
1162
+ "font.meta.glyphs": "Glyphs",
1163
+ "font.meta.format": "Format",
1164
+ "font.sample_text_placeholder": "Type custom text..."
1165
+ }, Q = {
1166
+ "zh-CN": gr,
1167
+ "en-US": wr
1168
+ }, xr = /\{(\w+)\}/g;
1116
1169
  function vr(t, e) {
1117
- return e ? t.replace(wr, (r, n) => {
1118
- const a = e[n];
1119
- return a === void 0 ? `{${n}}` : String(a);
1170
+ return e ? t.replace(xr, (r, o) => {
1171
+ const a = e[o];
1172
+ return a === void 0 ? `{${o}}` : String(a);
1120
1173
  }) : t;
1121
1174
  }
1122
- function ut(t) {
1175
+ function dt(t) {
1123
1176
  var e;
1124
- const r = t.fallbackLocale ?? "zh-CN", n = tt[t.locale] ?? tt[r] ?? tt["zh-CN"], a = (e = t.messages) == null ? void 0 : e[t.locale], o = a ? { ...n, ...a } : n, i = tt["zh-CN"];
1125
- return (s, p) => {
1126
- const c = o[s] ?? i[s] ?? s;
1127
- return vr(c, p);
1177
+ const r = t.fallbackLocale ?? "zh-CN", o = Q[t.locale] ?? Q[r] ?? Q["zh-CN"], a = (e = t.messages) == null ? void 0 : e[t.locale], n = a ? { ...o, ...a } : o, i = Q["zh-CN"];
1178
+ return (l, p) => {
1179
+ const f = n[l] ?? i[l] ?? l;
1180
+ return vr(f, p);
1128
1181
  };
1129
1182
  }
1130
- const mt = pt(null), xr = ({
1183
+ const ut = lt(null), yr = ({
1131
1184
  locale: t = "zh-CN",
1132
1185
  messages: e,
1133
1186
  children: r
1134
1187
  }) => {
1135
- const n = B(() => {
1136
- const a = ut({ locale: t, messages: e });
1188
+ const o = B(() => {
1189
+ const a = dt({ locale: t, messages: e });
1137
1190
  return { locale: t, t: a };
1138
1191
  }, [t, e]);
1139
- return /* @__PURE__ */ l(mt.Provider, { value: n, children: r });
1192
+ return /* @__PURE__ */ s(ut.Provider, { value: o, children: r });
1140
1193
  };
1141
- let st = null;
1142
- function yr() {
1143
- return st || (st = ut({ locale: "zh-CN" })), st;
1194
+ let it = null;
1195
+ function Fr() {
1196
+ return it || (it = dt({ locale: "zh-CN" })), it;
1144
1197
  }
1145
- function Kt() {
1146
- const t = J(mt);
1147
- return (t == null ? void 0 : t.t) ?? yr();
1198
+ function Jt() {
1199
+ const t = X(ut);
1200
+ return (t == null ? void 0 : t.t) ?? Fr();
1148
1201
  }
1149
- function _o() {
1150
- const t = J(mt);
1202
+ function ko() {
1203
+ const t = X(ut);
1151
1204
  return (t == null ? void 0 : t.locale) ?? "zh-CN";
1152
1205
  }
1153
- const Yt = pt(null), Fr = ({ theme: t, children: e }) => /* @__PURE__ */ l(Yt.Provider, { value: t, children: e });
1154
- function ko() {
1155
- return J(Yt) ?? "dark";
1206
+ const Kt = lt(null), _r = ({ theme: t, children: e }) => /* @__PURE__ */ s(Kt.Provider, { value: t, children: e });
1207
+ function Co() {
1208
+ return X(Kt) ?? "dark";
1156
1209
  }
1157
- const _r = ({ className: t }) => /* @__PURE__ */ l(
1210
+ const kr = ({ className: t }) => /* @__PURE__ */ s(
1158
1211
  "svg",
1159
1212
  {
1160
1213
  xmlns: "http://www.w3.org/2000/svg",
@@ -1165,49 +1218,49 @@ const _r = ({ className: t }) => /* @__PURE__ */ l(
1165
1218
  strokeLinecap: "round",
1166
1219
  strokeLinejoin: "round",
1167
1220
  className: t,
1168
- children: /* @__PURE__ */ l("text", { x: "12", y: "17.5", textAnchor: "middle", fontSize: "20", fontWeight: "bold", fill: "currentColor", stroke: "none", children: "1:1" })
1221
+ children: /* @__PURE__ */ s("text", { x: "12", y: "17.5", textAnchor: "middle", fontSize: "20", fontWeight: "bold", fill: "currentColor", stroke: "none", children: "1:1" })
1169
1222
  }
1170
1223
  );
1171
- function kr(t) {
1224
+ function Cr(t) {
1172
1225
  return [
1173
1226
  {
1174
1227
  items: [
1175
- { type: "button", icon: /* @__PURE__ */ l(At, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
1228
+ { type: "button", icon: /* @__PURE__ */ s(Zt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
1176
1229
  { type: "text", content: `${Math.round(t.zoom * 100)}%`, minWidth: "3rem" },
1177
- { type: "button", icon: /* @__PURE__ */ l(Ut, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
1230
+ { type: "button", icon: /* @__PURE__ */ s(At, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
1178
1231
  ]
1179
1232
  },
1180
1233
  {
1181
1234
  items: [
1182
- { type: "button", icon: /* @__PURE__ */ l(Se, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.fit_to_window"), action: t.onFitToWidth },
1183
- { type: "button", icon: /* @__PURE__ */ l(_r, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.original_size"), action: t.onOriginalSize }
1235
+ { type: "button", icon: /* @__PURE__ */ s(Ee, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.fit_to_window"), action: t.onFitToWidth },
1236
+ { type: "button", icon: /* @__PURE__ */ s(kr, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.original_size"), action: t.onOriginalSize }
1184
1237
  ]
1185
1238
  },
1186
1239
  {
1187
1240
  items: [
1188
- { type: "button", icon: /* @__PURE__ */ l(Le, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_left"), action: t.onRotateLeft },
1189
- { type: "button", icon: /* @__PURE__ */ l(We, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_right"), action: t.onRotateRight }
1241
+ { type: "button", icon: /* @__PURE__ */ s(Le, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_left"), action: t.onRotateLeft },
1242
+ { type: "button", icon: /* @__PURE__ */ s(Se, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_right"), action: t.onRotateRight }
1190
1243
  ]
1191
1244
  },
1192
1245
  {
1193
1246
  items: [
1194
- { type: "button", icon: /* @__PURE__ */ l(It, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
1247
+ { type: "button", icon: /* @__PURE__ */ s(Ut, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
1195
1248
  ]
1196
1249
  }
1197
1250
  ];
1198
1251
  }
1199
- function Cr(t) {
1252
+ function Rr(t) {
1200
1253
  return [
1201
1254
  {
1202
1255
  items: [
1203
- { type: "button", icon: /* @__PURE__ */ l(At, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
1256
+ { type: "button", icon: /* @__PURE__ */ s(Zt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
1204
1257
  { type: "text", content: `${Math.round(t.zoom * 100)}%`, minWidth: "3rem" },
1205
- { type: "button", icon: /* @__PURE__ */ l(Ut, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
1258
+ { type: "button", icon: /* @__PURE__ */ s(At, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
1206
1259
  ]
1207
1260
  },
1208
1261
  {
1209
1262
  items: [
1210
- { type: "button", icon: /* @__PURE__ */ l(It, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
1263
+ { type: "button", icon: /* @__PURE__ */ s(Ut, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
1211
1264
  ]
1212
1265
  }
1213
1266
  ];
@@ -1216,7 +1269,7 @@ function Nr(t) {
1216
1269
  return [
1217
1270
  {
1218
1271
  items: [
1219
- { type: "button", icon: /* @__PURE__ */ l(Ht, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.toc"), action: () => {
1272
+ { type: "button", icon: /* @__PURE__ */ s(It, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.toc"), action: () => {
1220
1273
  var e;
1221
1274
  return (e = t.epubRef.current) == null ? void 0 : e.toggleToc();
1222
1275
  } }
@@ -1224,12 +1277,12 @@ function Nr(t) {
1224
1277
  },
1225
1278
  {
1226
1279
  items: [
1227
- { type: "button", icon: /* @__PURE__ */ l(ct, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.prev_page"), action: () => {
1280
+ { type: "button", icon: /* @__PURE__ */ s(pt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.prev_page"), action: () => {
1228
1281
  var e;
1229
1282
  return (e = t.epubRef.current) == null ? void 0 : e.prevPage();
1230
1283
  } },
1231
1284
  { type: "text", content: `${t.current} / ${t.total}`, minWidth: "4rem" },
1232
- { type: "button", icon: /* @__PURE__ */ l(ft, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.next_page"), action: () => {
1285
+ { type: "button", icon: /* @__PURE__ */ s(ft, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.next_page"), action: () => {
1233
1286
  var e;
1234
1287
  return (e = t.epubRef.current) == null ? void 0 : e.nextPage();
1235
1288
  } }
@@ -1239,7 +1292,7 @@ function Nr(t) {
1239
1292
  items: [
1240
1293
  {
1241
1294
  type: "button",
1242
- icon: t.fullWidth ? /* @__PURE__ */ l(Vt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ l(Bt, { className: "rfp-w-4 rfp-h-4" }),
1295
+ icon: t.fullWidth ? /* @__PURE__ */ s(Vt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ s(Ht, { className: "rfp-w-4 rfp-h-4" }),
1243
1296
  tooltip: t.fullWidth ? t.t("toolbar.normal_width") : t.t("toolbar.full_width"),
1244
1297
  action: () => {
1245
1298
  var e;
@@ -1250,13 +1303,13 @@ function Nr(t) {
1250
1303
  }
1251
1304
  ];
1252
1305
  }
1253
- function Rr(t) {
1306
+ function Mr(t) {
1254
1307
  return [
1255
1308
  {
1256
1309
  items: [
1257
1310
  {
1258
1311
  type: "button",
1259
- icon: /* @__PURE__ */ l(Ht, { className: "rfp-w-4 rfp-h-4" }),
1312
+ icon: /* @__PURE__ */ s(It, { className: "rfp-w-4 rfp-h-4" }),
1260
1313
  tooltip: t.t("toolbar.toc"),
1261
1314
  action: () => {
1262
1315
  var e;
@@ -1269,7 +1322,7 @@ function Rr(t) {
1269
1322
  items: [
1270
1323
  {
1271
1324
  type: "button",
1272
- icon: /* @__PURE__ */ l(ct, { className: "rfp-w-4 rfp-h-4" }),
1325
+ icon: /* @__PURE__ */ s(pt, { className: "rfp-w-4 rfp-h-4" }),
1273
1326
  tooltip: t.t("toolbar.prev_page"),
1274
1327
  action: () => {
1275
1328
  var e;
@@ -1283,7 +1336,7 @@ function Rr(t) {
1283
1336
  },
1284
1337
  {
1285
1338
  type: "button",
1286
- icon: /* @__PURE__ */ l(ft, { className: "rfp-w-4 rfp-h-4" }),
1339
+ icon: /* @__PURE__ */ s(ft, { className: "rfp-w-4 rfp-h-4" }),
1287
1340
  tooltip: t.t("toolbar.next_page"),
1288
1341
  action: () => {
1289
1342
  var e;
@@ -1296,7 +1349,7 @@ function Rr(t) {
1296
1349
  items: [
1297
1350
  {
1298
1351
  type: "button",
1299
- icon: t.fullWidth ? /* @__PURE__ */ l(Vt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ l(Bt, { className: "rfp-w-4 rfp-h-4" }),
1352
+ icon: t.fullWidth ? /* @__PURE__ */ s(Vt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ s(Ht, { className: "rfp-w-4 rfp-h-4" }),
1300
1353
  tooltip: t.fullWidth ? t.t("toolbar.normal_width") : t.t("toolbar.full_width"),
1301
1354
  action: () => {
1302
1355
  var e;
@@ -1307,7 +1360,7 @@ function Rr(t) {
1307
1360
  }
1308
1361
  ];
1309
1362
  }
1310
- function Mr({ stats: t }) {
1363
+ function Tr({ stats: t }) {
1311
1364
  return t ? [
1312
1365
  {
1313
1366
  items: [
@@ -1320,13 +1373,13 @@ function Mr({ stats: t }) {
1320
1373
  }
1321
1374
  ] : [];
1322
1375
  }
1323
- function Tr(t) {
1376
+ function Pr(t) {
1324
1377
  const e = [
1325
1378
  {
1326
1379
  items: [
1327
1380
  {
1328
1381
  type: "button",
1329
- icon: /* @__PURE__ */ l($e, { className: "rfp-w-4 rfp-h-4" }),
1382
+ icon: /* @__PURE__ */ s(We, { className: "rfp-w-4 rfp-h-4" }),
1330
1383
  tooltip: t.wordWrap ? t.t("toolbar.wrap_off") : t.t("toolbar.wrap_on"),
1331
1384
  action: t.onToggleWrap
1332
1385
  }
@@ -1337,20 +1390,20 @@ function Tr(t) {
1337
1390
  items: [
1338
1391
  {
1339
1392
  type: "button",
1340
- icon: t.htmlPreview ? /* @__PURE__ */ l(qt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ l(Gt, { className: "rfp-w-4 rfp-h-4" }),
1393
+ icon: t.htmlPreview ? /* @__PURE__ */ s(Bt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ s(qt, { className: "rfp-w-4 rfp-h-4" }),
1341
1394
  tooltip: t.htmlPreview ? t.t("toolbar.source") : t.t("toolbar.preview"),
1342
1395
  action: t.onToggleHtmlPreview
1343
1396
  }
1344
1397
  ]
1345
1398
  }), e;
1346
1399
  }
1347
- function Pr(t) {
1400
+ function zr(t) {
1348
1401
  return [
1349
1402
  {
1350
1403
  items: [
1351
1404
  {
1352
1405
  type: "button",
1353
- icon: t.viewMode === "preview" ? /* @__PURE__ */ l(qt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ l(Gt, { className: "rfp-w-4 rfp-h-4" }),
1406
+ icon: t.viewMode === "preview" ? /* @__PURE__ */ s(Bt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ s(qt, { className: "rfp-w-4 rfp-h-4" }),
1354
1407
  tooltip: t.viewMode === "preview" ? t.t("toolbar.source") : t.t("toolbar.preview"),
1355
1408
  action: t.onToggleViewMode
1356
1409
  }
@@ -1358,13 +1411,13 @@ function Pr(t) {
1358
1411
  }
1359
1412
  ];
1360
1413
  }
1361
- const zr = {
1414
+ const jr = {
1362
1415
  fetcher: (t, e) => fetch(t, e)
1363
- }, ht = pt(zr), Er = ({
1416
+ }, mt = lt(jr), Er = ({
1364
1417
  requestInit: t,
1365
1418
  requestHandler: e,
1366
1419
  shouldFetchAsBlob: r,
1367
- children: n
1420
+ children: o
1368
1421
  }) => {
1369
1422
  const a = B(
1370
1423
  () => ({
@@ -1373,85 +1426,87 @@ const zr = {
1373
1426
  }),
1374
1427
  [t, e, r]
1375
1428
  );
1376
- return /* @__PURE__ */ l(ht.Provider, { value: a, children: n });
1429
+ return /* @__PURE__ */ s(mt.Provider, { value: a, children: o });
1377
1430
  };
1378
- function jr() {
1379
- return J(ht).fetcher;
1431
+ function Lr() {
1432
+ return X(mt).fetcher;
1380
1433
  }
1381
1434
  function Sr(t) {
1382
- const { fetcher: e, shouldFetchAsBlob: r } = J(ht), n = !!(t && (r != null && r(t))), [a, o] = y(
1383
- () => t ? n ? "" : t.url : ""
1384
- ), i = V(null);
1385
- return L(() => {
1435
+ const { fetcher: e, shouldFetchAsBlob: r } = X(mt), o = !!(t && (r != null && r(t))), [a, n] = y(
1436
+ () => t ? o ? "" : t.url : ""
1437
+ ), i = H(null);
1438
+ return S(() => {
1386
1439
  if (!t) {
1387
- o("");
1440
+ n("");
1388
1441
  return;
1389
1442
  }
1390
- if (!n) {
1391
- o(t.url);
1443
+ if (!o) {
1444
+ n(t.url);
1392
1445
  return;
1393
1446
  }
1394
- let s = !1;
1395
- return o(""), Ye(t.url, e).then((p) => {
1396
- if (s) {
1447
+ let l = !1;
1448
+ return n(""), Ye(t.url, e).then((p) => {
1449
+ if (l) {
1397
1450
  URL.revokeObjectURL(p);
1398
1451
  return;
1399
1452
  }
1400
- i.current && URL.revokeObjectURL(i.current), i.current = p, o(p);
1453
+ i.current && URL.revokeObjectURL(i.current), i.current = p, n(p);
1401
1454
  }).catch((p) => {
1402
- s || (console.error("[file-preview] resolve blob url failed:", p), o(t.url));
1455
+ l || (console.error("[file-preview] resolve blob url failed:", p), n(t.url));
1403
1456
  }), () => {
1404
- s = !0;
1457
+ l = !0;
1405
1458
  };
1406
- }, [t == null ? void 0 : t.id, t == null ? void 0 : t.url, n, e]), L(() => () => {
1459
+ }, [t == null ? void 0 : t.id, t == null ? void 0 : t.url, o, e]), S(() => () => {
1407
1460
  i.current && (URL.revokeObjectURL(i.current), i.current = null);
1408
1461
  }, []), a;
1409
1462
  }
1410
- const Lr = N(
1411
- () => import("./index-D8GtNeDn.mjs").then((t) => ({ default: t.ImageRenderer }))
1412
- ), Wr = N(
1413
- () => import("./index-DmepcY31.mjs").then((t) => ({ default: t.PdfRenderer }))
1414
- ), $r = N(
1415
- () => import("./index-BNUiNUWa.mjs").then((t) => ({ default: t.DocxRenderer }))
1416
- ), Dr = N(
1417
- () => import("./index-r3q2xCCI.mjs").then((t) => ({ default: t.XlsxRenderer }))
1418
- ), Or = N(
1419
- () => import("./index-BqEuP_8r.mjs").then((t) => ({ default: t.PptxRenderer }))
1420
- ), Zr = N(
1421
- () => import("./index-CgV8T0G5.mjs").then((t) => ({ default: t.MsgRenderer }))
1422
- ), Ar = N(
1423
- () => import("./index-BSD3w5eG.mjs").then((t) => ({ default: t.EpubRenderer }))
1424
- ), Ur = N(
1425
- () => import("./index-DV5Jd7Qe.mjs").then((t) => ({ default: t.MobiRenderer }))
1426
- ), Ir = N(
1427
- () => import("./index-BGeyzo6u.mjs").then((t) => ({ default: t.VideoRenderer }))
1428
- ), Hr = N(
1429
- () => import("./index-zEVVgWCH.mjs").then((t) => ({ default: t.AudioRenderer }))
1430
- ), Vr = N(
1431
- () => import("./index-DdOEWhrk.mjs").then((t) => ({ default: t.MarkdownRenderer }))
1432
- ), Br = N(
1433
- () => import("./index-B-H9HQiI.mjs").then((t) => ({ default: t.JsonRenderer }))
1434
- ), qr = N(
1435
- () => import("./index-BcBe6KW7.mjs").then((t) => ({ default: t.CsvRenderer }))
1436
- ), Gr = N(
1437
- () => import("./index-BdYkTSTt.mjs").then((t) => ({ default: t.XmlRenderer }))
1438
- ), Xr = N(
1439
- () => import("./index-DGuiWJr7.mjs").then((t) => ({ default: t.SubtitleRenderer }))
1440
- ), Jr = N(
1441
- () => import("./index-U3w45GW8.mjs").then((t) => ({ default: t.ZipRenderer }))
1442
- ), Kr = N(
1443
- () => import("./index-CKirCT35.mjs").then((t) => ({ default: t.TextRenderer }))
1444
- ), Zt = ({
1463
+ const Wr = R(
1464
+ () => import("./index-CztCCF7q.mjs").then((t) => ({ default: t.ImageRenderer }))
1465
+ ), $r = R(
1466
+ () => import("./index-C5YHI0Zs.mjs").then((t) => ({ default: t.PdfRenderer }))
1467
+ ), Dr = R(
1468
+ () => import("./index-BOQJNL71.mjs").then((t) => ({ default: t.DocxRenderer }))
1469
+ ), Or = R(
1470
+ () => import("./index-BAYc4aBz.mjs").then((t) => ({ default: t.XlsxRenderer }))
1471
+ ), Zr = R(
1472
+ () => import("./index-QfO-sASN.mjs").then((t) => ({ default: t.PptxRenderer }))
1473
+ ), Ar = R(
1474
+ () => import("./index-BnDoXBnH.mjs").then((t) => ({ default: t.MsgRenderer }))
1475
+ ), Ur = R(
1476
+ () => import("./index-DSAXdrgU.mjs").then((t) => ({ default: t.EpubRenderer }))
1477
+ ), Ir = R(
1478
+ () => import("./index-DN8BQIqo.mjs").then((t) => ({ default: t.MobiRenderer }))
1479
+ ), Vr = R(
1480
+ () => import("./index-DKEcGewg.mjs").then((t) => ({ default: t.VideoRenderer }))
1481
+ ), Hr = R(
1482
+ () => import("./index-DPpUj8Yy.mjs").then((t) => ({ default: t.AudioRenderer }))
1483
+ ), Br = R(
1484
+ () => import("./index-CwmZQ-JO.mjs").then((t) => ({ default: t.MarkdownRenderer }))
1485
+ ), qr = R(
1486
+ () => import("./index-B0JUZ5rS.mjs").then((t) => ({ default: t.JsonRenderer }))
1487
+ ), Gr = R(
1488
+ () => import("./index-h9bO9wmq.mjs").then((t) => ({ default: t.CsvRenderer }))
1489
+ ), Xr = R(
1490
+ () => import("./index-BkU8rK-0.mjs").then((t) => ({ default: t.XmlRenderer }))
1491
+ ), Jr = R(
1492
+ () => import("./index-DveR0rOk.mjs").then((t) => ({ default: t.SubtitleRenderer }))
1493
+ ), Kr = R(
1494
+ () => import("./index-tecGXW2S.mjs").then((t) => ({ default: t.ZipRenderer }))
1495
+ ), Yr = R(
1496
+ () => import("./index-CzflrElZ.mjs").then((t) => ({ default: t.TextRenderer }))
1497
+ ), Qr = R(
1498
+ () => import("./index-mvSVNKlQ.mjs").then((t) => ({ default: t.FontRenderer }))
1499
+ ), Ot = ({
1445
1500
  fileName: t,
1446
1501
  fileType: e,
1447
1502
  onDownload: r
1448
1503
  }) => {
1449
- const n = Kt();
1504
+ const o = Jt();
1450
1505
  return /* @__PURE__ */ z("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-p-8 rfp-gap-6", children: [
1451
- /* @__PURE__ */ l("div", { className: "rfp-w-32 rfp-h-32 rfp-rounded-full rfp-bg-surface-2 rfp-flex rfp-items-center rfp-justify-center", children: /* @__PURE__ */ l(De, { className: "rfp-w-16 rfp-h-16 rfp-text-fg-secondary" }) }),
1506
+ /* @__PURE__ */ s("div", { className: "rfp-w-32 rfp-h-32 rfp-rounded-full rfp-bg-surface-2 rfp-flex rfp-items-center rfp-justify-center", children: /* @__PURE__ */ s($e, { className: "rfp-w-16 rfp-h-16 rfp-text-fg-secondary" }) }),
1452
1507
  /* @__PURE__ */ z("div", { className: "rfp-text-fg-primary rfp-text-center", children: [
1453
- /* @__PURE__ */ l("p", { className: "rfp-text-xl rfp-font-medium rfp-mb-2", children: t }),
1454
- /* @__PURE__ */ l("p", { className: "rfp-text-fg-secondary", children: n("common.unsupported_preview", { type: e }) })
1508
+ /* @__PURE__ */ s("p", { className: "rfp-text-xl rfp-font-medium rfp-mb-2", children: t }),
1509
+ /* @__PURE__ */ s("p", { className: "rfp-text-fg-secondary", children: o("common.unsupported_preview", { type: e }) })
1455
1510
  ] }),
1456
1511
  /* @__PURE__ */ z(
1457
1512
  "button",
@@ -1459,41 +1514,41 @@ const Lr = N(
1459
1514
  onClick: r,
1460
1515
  className: "rfp-flex rfp-items-center rfp-gap-2 rfp-px-6 rfp-py-3 rfp-bg-surface-2 hover:rfp-bg-surface-3 rfp-backdrop-blur-sm rfp-rounded-lg rfp-text-fg-primary rfp-font-medium rfp-transition-all",
1461
1516
  children: [
1462
- /* @__PURE__ */ l(Xt, { className: "rfp-w-5 rfp-h-5" }),
1463
- n("common.download")
1517
+ /* @__PURE__ */ s(Gt, { className: "rfp-w-5 rfp-h-5" }),
1518
+ o("common.download")
1464
1519
  ]
1465
1520
  }
1466
1521
  )
1467
1522
  ] });
1468
- }, Yr = () => {
1469
- const t = Kt();
1470
- return /* @__PURE__ */ l("div", { className: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted", children: /* @__PURE__ */ z("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-3", children: [
1471
- /* @__PURE__ */ l("div", { className: "rfp-w-8 rfp-h-8 rfp-rounded-full rfp-border-2 rfp-border-fg-muted rfp-border-t-transparent rfp-animate-spin" }),
1472
- /* @__PURE__ */ l("span", { className: "rfp-text-sm", children: t("common.loading") ?? "Loading..." })
1523
+ }, to = () => {
1524
+ const t = Jt();
1525
+ return /* @__PURE__ */ s("div", { className: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted", children: /* @__PURE__ */ z("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-3", children: [
1526
+ /* @__PURE__ */ s("div", { className: "rfp-w-8 rfp-h-8 rfp-rounded-full rfp-border-2 rfp-border-fg-muted rfp-border-t-transparent rfp-animate-spin" }),
1527
+ /* @__PURE__ */ s("span", { className: "rfp-text-sm", children: t("common.loading") ?? "Loading..." })
1473
1528
  ] }) });
1474
- }, Qr = 3, bt = (t) => {
1475
- const { requestInit: e, requestHandler: r, shouldFetchAsBlob: n } = t;
1476
- return /* @__PURE__ */ l(
1529
+ }, eo = 3, ht = (t) => {
1530
+ const { requestInit: e, requestHandler: r, shouldFetchAsBlob: o } = t;
1531
+ return /* @__PURE__ */ s(
1477
1532
  Er,
1478
1533
  {
1479
1534
  requestInit: e,
1480
1535
  requestHandler: r,
1481
- shouldFetchAsBlob: n,
1482
- children: /* @__PURE__ */ l(to, { ...t })
1536
+ shouldFetchAsBlob: o,
1537
+ children: /* @__PURE__ */ s(ro, { ...t })
1483
1538
  }
1484
1539
  );
1485
- }, to = ({
1540
+ }, ro = ({
1486
1541
  files: t,
1487
1542
  currentIndex: e,
1488
1543
  onNavigate: r,
1489
- customRenderers: n = [],
1544
+ customRenderers: o = [],
1490
1545
  mode: a = "modal",
1491
- onClose: o,
1546
+ onClose: n,
1492
1547
  zipNestingDepth: i = 0,
1493
- locale: s = "zh-CN",
1548
+ locale: l = "zh-CN",
1494
1549
  messages: p,
1495
- headless: c = !1,
1496
- theme: f = "dark",
1550
+ headless: f = !1,
1551
+ theme: c = "dark",
1497
1552
  onCustomEvent: d,
1498
1553
  onDownload: h,
1499
1554
  // 以下三项已由外层 RequestProvider 消费,Inner 内不再直接使用
@@ -1501,49 +1556,49 @@ const Lr = N(
1501
1556
  requestHandler: _,
1502
1557
  shouldFetchAsBlob: M
1503
1558
  }) => {
1504
- const v = B(
1505
- () => ut({ locale: s, messages: p }),
1506
- [s, p]
1559
+ const x = B(
1560
+ () => dt({ locale: l, messages: p }),
1561
+ [l, p]
1507
1562
  ), [F, T] = y(
1508
1563
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1509
1564
  );
1510
- L(() => {
1511
- if (f !== "auto") return;
1512
- const m = window.matchMedia("(prefers-color-scheme: dark)"), w = (E) => T(E.matches);
1565
+ S(() => {
1566
+ if (c !== "auto") return;
1567
+ const m = window.matchMedia("(prefers-color-scheme: dark)"), w = (j) => T(j.matches);
1513
1568
  return m.addEventListener("change", w), () => m.removeEventListener("change", w);
1514
- }, [f]);
1515
- const k = f === "auto" ? F ? "dark" : "light" : f, [R, x] = y(1), [S, W] = y(0), [Qt, gt] = y(1), [, wt] = y(1), [A, rt] = y(0), [U, vt] = y(0), [te, ot] = y(0), D = V(null), xt = V(null), yt = V(null), [ee, re] = y(0), [oe, ne] = y(0), [ae, ie] = y(!1), Ft = V(null), [se, le] = y(0), [pe, ce] = y(0), [fe, de] = y(!1), [ue, me] = y(null), [_t, he] = y(!0), [kt, be] = y(!1), [Ct, ge] = y("preview"), [I, q] = y(!0), O = V(null), we = 2e3, K = P(() => {
1569
+ }, [c]);
1570
+ const k = c === "auto" ? F ? "dark" : "light" : c, [N, v] = y(1), [L, W] = y(0), [Yt, bt] = y(1), [, gt] = y(1), [A, et] = y(0), [U, wt] = y(0), [Qt, rt] = y(0), D = H(null), xt = H(null), vt = H(null), [te, ee] = y(0), [re, oe] = y(0), [ne, ae] = y(!1), yt = H(null), [ie, se] = y(0), [le, pe] = y(0), [fe, ce] = y(!1), [de, ue] = y(null), [Ft, me] = y(!0), [_t, he] = y(!1), [kt, be] = y("preview"), [I, q] = y(!0), O = H(null), ge = 2e3, J = P(() => {
1516
1571
  q(!0), O.current && clearTimeout(O.current), O.current = window.setTimeout(() => {
1517
1572
  q(!1);
1518
- }, we);
1519
- }, []), ve = P(() => {
1520
- K();
1521
- }, [K]), $ = B(() => Ve(t), [t]), b = $[e], C = Sr(b), H = B(() => b ? n.find((m) => m.test(b)) : null, [b, n]), g = b ? Be(b) : "unsupported", Nt = P(
1573
+ }, ge);
1574
+ }, []), we = P(() => {
1575
+ J();
1576
+ }, [J]), $ = B(() => He(t), [t]), b = $[e], C = Sr(b), V = B(() => b ? o.find((m) => m.test(b)) : null, [b, o]), g = b ? Be(b) : "unsupported", Ct = P(
1522
1577
  (m, w) => {
1523
1578
  b && (d == null || d({ name: m, payload: w, file: b }));
1524
1579
  },
1525
1580
  [b, d]
1526
1581
  ), Rt = B(
1527
1582
  () => ({
1528
- emit: Nt,
1529
- t: v,
1583
+ emit: Ct,
1584
+ t: x,
1530
1585
  theme: k,
1531
- locale: s
1586
+ locale: l
1532
1587
  }),
1533
- [Nt, v, k, s]
1588
+ [Ct, x, k, l]
1534
1589
  );
1535
- L(() => {
1536
- x(1), W(0), gt(1), wt(1), rt(0), vt(0), q(!0), O.current && clearTimeout(O.current);
1537
- }, [e]), L(() => {
1590
+ S(() => {
1591
+ v(1), W(0), bt(1), gt(1), et(0), wt(0), q(!0), O.current && clearTimeout(O.current);
1592
+ }, [e]), S(() => {
1538
1593
  if (g === "image" && A > 0 && U > 0 && D.current) {
1539
- const m = D.current.clientWidth, w = D.current.clientHeight, E = m / A, j = w / U, G = Math.min(E, j);
1540
- x(Math.max(0.01, Math.min(10, G)));
1594
+ const m = D.current.clientWidth, w = D.current.clientHeight, j = m / A, E = w / U, G = Math.min(j, E);
1595
+ v(Math.max(0.01, Math.min(10, G)));
1541
1596
  }
1542
- }, [g, A, U]), L(() => ($.length > 1 && K(), () => {
1597
+ }, [g, A, U]), S(() => ($.length > 1 && J(), () => {
1543
1598
  O.current && clearTimeout(O.current);
1544
- }), [$.length, K]), L(() => {
1599
+ }), [$.length, J]), S(() => {
1545
1600
  const m = (w) => {
1546
- w.key === "Escape" && a === "modal" ? o == null || o() : w.key === "ArrowLeft" && e > 0 ? r == null || r(e - 1) : w.key === "ArrowRight" && e < $.length - 1 && (r == null || r(e + 1));
1601
+ w.key === "Escape" && a === "modal" ? n == null || n() : w.key === "ArrowLeft" && e > 0 ? r == null || r(e - 1) : w.key === "ArrowRight" && e < $.length - 1 && (r == null || r(e + 1));
1547
1602
  };
1548
1603
  if (a === "modal")
1549
1604
  return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
@@ -1551,141 +1606,141 @@ const Lr = N(
1551
1606
  const w = xt.current;
1552
1607
  return w ? (w.addEventListener("keydown", m), () => w.removeEventListener("keydown", m)) : void 0;
1553
1608
  }
1554
- }, [a, e, $.length, o, r]);
1555
- const Mt = P(() => {
1556
- x((m) => Math.min(m + 0.1, 10));
1557
- }, []), Tt = P(() => {
1558
- x((m) => Math.max(m - 0.1, 0.01));
1609
+ }, [a, e, $.length, n, r]);
1610
+ const Nt = P(() => {
1611
+ v((m) => Math.min(m + 0.1, 10));
1612
+ }, []), Mt = P(() => {
1613
+ v((m) => Math.max(m - 0.1, 0.01));
1559
1614
  }, []), xe = P(() => {
1560
1615
  W((m) => m + 90);
1561
- }, []), ye = P(() => {
1616
+ }, []), ve = P(() => {
1562
1617
  W((m) => m - 90);
1563
- }, []), Fe = P(() => {
1618
+ }, []), ye = P(() => {
1564
1619
  if (D.current && A > 0 && U > 0) {
1565
- const m = D.current.clientWidth, w = D.current.clientHeight, E = m / A, j = w / U, G = Math.min(E, j);
1566
- x(Math.max(0.01, Math.min(10, G)));
1620
+ const m = D.current.clientWidth, w = D.current.clientHeight, j = m / A, E = w / U, G = Math.min(j, E);
1621
+ v(Math.max(0.01, Math.min(10, G)));
1567
1622
  } else
1568
- x(1);
1569
- W(0), ot((m) => m + 1);
1570
- }, [A, U]), _e = P(() => {
1571
- x(1), W(0), ot((m) => m + 1);
1572
- }, []), ke = P((m) => {
1573
- x(m);
1574
- }, []), Pt = P(() => {
1575
- x(1), W(0), ot((m) => m + 1);
1576
- }, []), zt = jr(), nt = P(async () => {
1623
+ v(1);
1624
+ W(0), rt((m) => m + 1);
1625
+ }, [A, U]), Fe = P(() => {
1626
+ v(1), W(0), rt((m) => m + 1);
1627
+ }, []), _e = P((m) => {
1628
+ v(m);
1629
+ }, []), Tt = P(() => {
1630
+ v(1), W(0), rt((m) => m + 1);
1631
+ }, []), Pt = Lr(), ot = P(async () => {
1577
1632
  if (b) {
1578
1633
  if (h) {
1579
1634
  await h(b);
1580
1635
  return;
1581
1636
  }
1582
1637
  try {
1583
- await Qe(b.url, b.name, zt);
1638
+ await Qe(b.url, b.name, Pt);
1584
1639
  } catch (m) {
1585
1640
  console.error("[file-preview] download failed:", m);
1586
1641
  }
1587
1642
  }
1588
- }, [b, h, zt]), Ce = P((m, w) => {
1589
- re(m), ne(w);
1590
- }, []), Ne = P((m, w) => {
1591
- le(m), ce(w);
1643
+ }, [b, h, Pt]), ke = P((m, w) => {
1644
+ ee(m), oe(w);
1645
+ }, []), Ce = P((m, w) => {
1646
+ se(m), pe(w);
1592
1647
  }, []), Re = P((m) => {
1593
- me(m);
1648
+ ue(m);
1594
1649
  }, []);
1595
1650
  if (!b) return null;
1596
- const Me = a === "modal" && !!o, Y = (() => {
1651
+ const Ne = a === "modal" && !!n, K = (() => {
1597
1652
  var m, w;
1598
- if (H)
1599
- return ((m = H.getToolbarGroups) == null ? void 0 : m.call(H, b, Rt)) ?? [];
1653
+ if (V)
1654
+ return ((m = V.getToolbarGroups) == null ? void 0 : m.call(V, b, Rt)) ?? [];
1600
1655
  if (g === "image")
1601
- return kr({
1602
- zoom: R,
1603
- onZoomIn: Mt,
1604
- onZoomOut: Tt,
1605
- onFitToWidth: Fe,
1606
- onOriginalSize: _e,
1607
- onRotateLeft: ye,
1656
+ return Cr({
1657
+ zoom: N,
1658
+ onZoomIn: Nt,
1659
+ onZoomOut: Mt,
1660
+ onFitToWidth: ye,
1661
+ onOriginalSize: Fe,
1662
+ onRotateLeft: ve,
1608
1663
  onRotateRight: xe,
1609
- onReset: Pt,
1610
- t: v
1664
+ onReset: Tt,
1665
+ t: x
1611
1666
  });
1612
1667
  if (g === "pdf")
1613
- return Cr({
1614
- zoom: R,
1615
- onZoomIn: Mt,
1616
- onZoomOut: Tt,
1617
- onReset: Pt,
1618
- t: v
1668
+ return Rr({
1669
+ zoom: N,
1670
+ onZoomIn: Nt,
1671
+ onZoomOut: Mt,
1672
+ onReset: Tt,
1673
+ t: x
1619
1674
  });
1620
1675
  if (g === "epub")
1621
1676
  return Nr({
1622
- epubRef: yt,
1623
- current: ee,
1624
- total: oe,
1625
- fullWidth: ae,
1626
- t: v
1677
+ epubRef: vt,
1678
+ current: te,
1679
+ total: re,
1680
+ fullWidth: ne,
1681
+ t: x
1627
1682
  });
1628
1683
  if (g === "mobi")
1629
- return Rr({
1630
- mobiRef: Ft,
1631
- current: se,
1632
- total: pe,
1684
+ return Mr({
1685
+ mobiRef: yt,
1686
+ current: ie,
1687
+ total: le,
1633
1688
  fullWidth: fe,
1634
- t: v
1689
+ t: x
1635
1690
  });
1636
1691
  if (g === "zip")
1637
- return Mr({ stats: ue });
1692
+ return Tr({ stats: de });
1638
1693
  if (g === "text") {
1639
- const E = ((w = b.name.split(".").pop()) == null ? void 0 : w.toLowerCase()) || "";
1640
- return Tr({
1641
- wordWrap: _t,
1642
- onToggleWrap: () => he((j) => !j),
1643
- isHtml: E === "html" || E === "htm",
1644
- htmlPreview: kt,
1645
- onToggleHtmlPreview: () => be((j) => !j),
1646
- t: v
1694
+ const j = ((w = b.name.split(".").pop()) == null ? void 0 : w.toLowerCase()) || "";
1695
+ return Pr({
1696
+ wordWrap: Ft,
1697
+ onToggleWrap: () => me((E) => !E),
1698
+ isHtml: j === "html" || j === "htm",
1699
+ htmlPreview: _t,
1700
+ onToggleHtmlPreview: () => he((E) => !E),
1701
+ t: x
1647
1702
  });
1648
1703
  }
1649
- return g === "markdown" ? Pr({
1650
- viewMode: Ct,
1651
- onToggleViewMode: () => ge((E) => E === "preview" ? "source" : "preview"),
1652
- t: v
1704
+ return g === "markdown" ? zr({
1705
+ viewMode: kt,
1706
+ onToggleViewMode: () => be((j) => j === "preview" ? "source" : "preview"),
1707
+ t: x
1653
1708
  }) : [];
1654
- })(), Et = [
1709
+ })(), zt = [
1655
1710
  {
1656
1711
  items: [
1657
- { type: "button", icon: /* @__PURE__ */ l(Xt, { className: "rfp-w-4 rfp-h-4" }), tooltip: v("common.download"), action: nt }
1712
+ { type: "button", icon: /* @__PURE__ */ s(Gt, { className: "rfp-w-4 rfp-h-4" }), tooltip: x("common.download"), action: ot }
1658
1713
  ]
1659
1714
  },
1660
- ...Me ? [{
1715
+ ...Ne ? [{
1661
1716
  items: [
1662
- { type: "button", icon: /* @__PURE__ */ l(Oe, { className: "rfp-w-4 rfp-h-4" }), tooltip: v("common.close"), action: o }
1717
+ { type: "button", icon: /* @__PURE__ */ s(De, { className: "rfp-w-4 rfp-h-4" }), tooltip: x("common.close"), action: n }
1663
1718
  ]
1664
1719
  }] : []
1665
- ], Q = (m, w) => m.map((E, j, G) => /* @__PURE__ */ z(Pe.Fragment, { children: [
1666
- E.items.map(
1667
- (Z, jt) => Z.type === "button" ? /* @__PURE__ */ l(
1668
- eo,
1720
+ ], Y = (m, w) => m.map((j, E, G) => /* @__PURE__ */ z(Te.Fragment, { children: [
1721
+ j.items.map(
1722
+ (Z, jt) => Z.type === "button" ? /* @__PURE__ */ s(
1723
+ oo,
1669
1724
  {
1670
1725
  icon: Z.icon,
1671
1726
  label: Z.tooltip,
1672
1727
  onClick: Z.action,
1673
1728
  disabled: Z.disabled
1674
1729
  },
1675
- `${j}-${jt}`
1676
- ) : /* @__PURE__ */ l(
1730
+ `${E}-${jt}`
1731
+ ) : /* @__PURE__ */ s(
1677
1732
  "span",
1678
1733
  {
1679
1734
  className: "rfp-text-xs rfp-text-center rfp-font-medium rfp-tabular-nums rfp-text-fg-tertiary",
1680
1735
  style: { minWidth: Z.minWidth || "auto" },
1681
1736
  children: Z.content
1682
1737
  },
1683
- `${j}-${jt}`
1738
+ `${E}-${jt}`
1684
1739
  )
1685
1740
  ),
1686
- j < G.length - 1 && /* @__PURE__ */ l("div", { className: `rfp-w-px rfp-h-4 rfp-bg-divide ${w}` })
1687
- ] }, j));
1688
- return /* @__PURE__ */ l(xr, { locale: s, messages: p, children: /* @__PURE__ */ l(Fr, { theme: k, children: /* @__PURE__ */ z(
1741
+ E < G.length - 1 && /* @__PURE__ */ s("div", { className: `rfp-w-px rfp-h-4 rfp-bg-divide ${w}` })
1742
+ ] }, E));
1743
+ return /* @__PURE__ */ s(yr, { locale: l, messages: p, children: /* @__PURE__ */ s(_r, { theme: k, children: /* @__PURE__ */ z(
1689
1744
  "div",
1690
1745
  {
1691
1746
  ref: xt,
@@ -1693,8 +1748,8 @@ const Lr = N(
1693
1748
  "data-theme": k,
1694
1749
  className: "rfp-relative rfp-w-full rfp-h-full rfp-flex rfp-flex-col rfp-overflow-hidden rfp-outline-none",
1695
1750
  children: [
1696
- !c && /* @__PURE__ */ z(
1697
- et.div,
1751
+ !f && /* @__PURE__ */ z(
1752
+ tt.div,
1698
1753
  {
1699
1754
  initial: { opacity: 0 },
1700
1755
  animate: { opacity: 1 },
@@ -1704,115 +1759,116 @@ const Lr = N(
1704
1759
  children: [
1705
1760
  /* @__PURE__ */ z("div", { className: "rfp-flex rfp-items-center rfp-justify-between rfp-px-3 md:rfp-px-5 rfp-py-1.5 md:rfp-py-2.5", children: [
1706
1761
  /* @__PURE__ */ z("div", { className: "rfp-flex rfp-items-center rfp-flex-1 rfp-min-w-0 rfp-mr-2 md:rfp-mr-3", children: [
1707
- /* @__PURE__ */ l("h2", { className: "rfp-font-medium rfp-text-xs md:rfp-text-sm rfp-truncate rfp-text-fg-primary", children: b.name }),
1762
+ /* @__PURE__ */ s("h2", { className: "rfp-font-medium rfp-text-xs md:rfp-text-sm rfp-truncate rfp-text-fg-primary", children: b.name }),
1708
1763
  /* @__PURE__ */ z("span", { className: "rfp-text-xs rfp-ml-2 rfp-flex-shrink-0 rfp-text-fg-muted", children: [
1709
1764
  e + 1,
1710
1765
  "/",
1711
1766
  $.length
1712
1767
  ] })
1713
1768
  ] }),
1714
- /* @__PURE__ */ l("div", { className: "rfp-flex rfp-items-center rfp-gap-1 md:rfp-hidden rfp-flex-shrink-0", children: Q(Et, "rfp-mx-0.5") }),
1769
+ /* @__PURE__ */ s("div", { className: "rfp-flex rfp-items-center rfp-gap-1 md:rfp-hidden rfp-flex-shrink-0", children: Y(zt, "rfp-mx-0.5") }),
1715
1770
  /* @__PURE__ */ z("div", { className: "rfp-hidden md:rfp-flex rfp-items-center rfp-gap-1 rfp-flex-shrink-0", children: [
1716
- Q(Y, "rfp-mx-1"),
1717
- Y.length > 0 && /* @__PURE__ */ l("div", { className: "rfp-w-px rfp-h-4 rfp-mx-1 rfp-bg-divide" }),
1718
- Q(Et, "rfp-mx-1")
1771
+ Y(K, "rfp-mx-1"),
1772
+ K.length > 0 && /* @__PURE__ */ s("div", { className: "rfp-w-px rfp-h-4 rfp-mx-1 rfp-bg-divide" }),
1773
+ Y(zt, "rfp-mx-1")
1719
1774
  ] })
1720
1775
  ] }),
1721
- Y.length > 0 && /* @__PURE__ */ l("div", { className: "rfp-flex rfp-items-center rfp-gap-1 rfp-px-3 rfp-pb-1.5 rfp-overflow-x-auto scrollbar-hide md:rfp-hidden", children: Q(Y, "rfp-mx-0.5") })
1776
+ K.length > 0 && /* @__PURE__ */ s("div", { className: "rfp-flex rfp-items-center rfp-gap-1 rfp-px-3 rfp-pb-1.5 rfp-overflow-x-auto scrollbar-hide md:rfp-hidden", children: Y(K, "rfp-mx-0.5") })
1722
1777
  ]
1723
1778
  }
1724
1779
  ),
1725
- /* @__PURE__ */ l(
1780
+ /* @__PURE__ */ s(
1726
1781
  "div",
1727
1782
  {
1728
1783
  ref: D,
1729
1784
  className: "rfp-flex-1 rfp-flex rfp-items-center rfp-justify-center rfp-overflow-auto",
1730
- onMouseMove: ve,
1731
- children: H ? H.render(b, Rt) : /* @__PURE__ */ z(ze, { fallback: /* @__PURE__ */ l(Yr, {}), children: [
1732
- g === "image" && /* @__PURE__ */ l(
1733
- Lr,
1785
+ onMouseMove: we,
1786
+ children: V ? V.render(b, Rt) : /* @__PURE__ */ z(Pe, { fallback: /* @__PURE__ */ s(to, {}), children: [
1787
+ g === "image" && /* @__PURE__ */ s(
1788
+ Wr,
1734
1789
  {
1735
1790
  url: C,
1736
- zoom: R,
1737
- rotation: S,
1738
- resetKey: te,
1791
+ zoom: N,
1792
+ rotation: L,
1793
+ resetKey: Qt,
1739
1794
  fileSize: b.size,
1740
- onZoomChange: ke,
1741
- onNaturalWidthChange: rt,
1742
- onNaturalHeightChange: vt
1795
+ onZoomChange: _e,
1796
+ onNaturalWidthChange: et,
1797
+ onNaturalHeightChange: wt
1743
1798
  }
1744
1799
  ),
1745
- g === "pdf" && /* @__PURE__ */ l(
1746
- Wr,
1800
+ g === "pdf" && /* @__PURE__ */ s(
1801
+ $r,
1747
1802
  {
1748
1803
  url: C,
1749
- zoom: R,
1750
- currentPage: Qt,
1751
- onPageChange: gt,
1752
- onTotalPagesChange: wt,
1753
- onPageWidthChange: rt
1804
+ zoom: N,
1805
+ currentPage: Yt,
1806
+ onPageChange: bt,
1807
+ onTotalPagesChange: gt,
1808
+ onPageWidthChange: et
1754
1809
  }
1755
1810
  ),
1756
- g === "docx" && /* @__PURE__ */ l($r, { url: C }),
1757
- g === "xlsx" && /* @__PURE__ */ l(Dr, { url: C }),
1758
- g === "pptx" && /* @__PURE__ */ l(Or, { url: C }),
1759
- g === "msg" && /* @__PURE__ */ l(Zr, { url: C }),
1760
- g === "epub" && /* @__PURE__ */ l(
1761
- Ar,
1811
+ g === "docx" && /* @__PURE__ */ s(Dr, { url: C }),
1812
+ g === "xlsx" && /* @__PURE__ */ s(Or, { url: C }),
1813
+ g === "pptx" && /* @__PURE__ */ s(Zr, { url: C }),
1814
+ g === "msg" && /* @__PURE__ */ s(Ar, { url: C }),
1815
+ g === "epub" && /* @__PURE__ */ s(
1816
+ Ur,
1762
1817
  {
1763
- ref: yt,
1818
+ ref: vt,
1764
1819
  url: C,
1765
- onChapterChange: Ce,
1766
- onFullWidthChange: ie
1820
+ onChapterChange: ke,
1821
+ onFullWidthChange: ae
1767
1822
  }
1768
1823
  ),
1769
- g === "mobi" && /* @__PURE__ */ l(
1770
- Ur,
1824
+ g === "mobi" && /* @__PURE__ */ s(
1825
+ Ir,
1771
1826
  {
1772
- ref: Ft,
1827
+ ref: yt,
1773
1828
  url: C,
1774
- onChapterChange: Ne,
1775
- onFullWidthChange: de
1829
+ onChapterChange: Ce,
1830
+ onFullWidthChange: ce
1776
1831
  }
1777
1832
  ),
1778
- g === "video" && /* @__PURE__ */ l(Ir, { url: C }),
1779
- g === "audio" && /* @__PURE__ */ l(Hr, { url: C, fileName: b.name }),
1780
- g === "markdown" && /* @__PURE__ */ l(Vr, { url: C, viewMode: Ct }),
1781
- g === "json" && /* @__PURE__ */ l(Br, { url: C, fileName: b.name }),
1782
- g === "csv" && /* @__PURE__ */ l(qr, { url: C, fileName: b.name }),
1783
- g === "xml" && /* @__PURE__ */ l(Gr, { url: C, fileName: b.name }),
1784
- g === "subtitle" && /* @__PURE__ */ l(Xr, { url: C, fileName: b.name }),
1785
- g === "zip" && (i >= Qr ? /* @__PURE__ */ l(
1786
- Zt,
1833
+ g === "video" && /* @__PURE__ */ s(Vr, { url: C }),
1834
+ g === "audio" && /* @__PURE__ */ s(Hr, { url: C, fileName: b.name }),
1835
+ g === "markdown" && /* @__PURE__ */ s(Br, { url: C, viewMode: kt }),
1836
+ g === "json" && /* @__PURE__ */ s(qr, { url: C, fileName: b.name }),
1837
+ g === "csv" && /* @__PURE__ */ s(Gr, { url: C, fileName: b.name }),
1838
+ g === "xml" && /* @__PURE__ */ s(Xr, { url: C, fileName: b.name }),
1839
+ g === "subtitle" && /* @__PURE__ */ s(Jr, { url: C, fileName: b.name }),
1840
+ g === "zip" && (i >= eo ? /* @__PURE__ */ s(
1841
+ Ot,
1787
1842
  {
1788
1843
  fileName: b.name,
1789
1844
  fileType: b.type,
1790
- onDownload: nt
1845
+ onDownload: ot
1791
1846
  }
1792
- ) : /* @__PURE__ */ l(Jr, { url: C, onStatsChange: Re, nestingDepth: i })),
1793
- g === "text" && /* @__PURE__ */ l(
1794
- Kr,
1847
+ ) : /* @__PURE__ */ s(Kr, { url: C, onStatsChange: Re, nestingDepth: i })),
1848
+ g === "text" && /* @__PURE__ */ s(
1849
+ Yr,
1795
1850
  {
1796
1851
  url: C,
1797
1852
  fileName: b.name,
1798
- wordWrap: _t,
1799
- htmlPreview: kt
1853
+ wordWrap: Ft,
1854
+ htmlPreview: _t
1800
1855
  }
1801
1856
  ),
1802
- g === "unsupported" && /* @__PURE__ */ l(
1803
- Zt,
1857
+ g === "font" && /* @__PURE__ */ s(Qr, { url: C }),
1858
+ g === "unsupported" && /* @__PURE__ */ s(
1859
+ Ot,
1804
1860
  {
1805
1861
  fileName: b.name,
1806
1862
  fileType: b.type,
1807
- onDownload: nt
1863
+ onDownload: ot
1808
1864
  }
1809
1865
  )
1810
1866
  ] })
1811
1867
  }
1812
1868
  ),
1813
- !c && $.length > 1 && /* @__PURE__ */ z(Te, { children: [
1814
- e > 0 && /* @__PURE__ */ l(
1815
- et.button,
1869
+ !f && $.length > 1 && /* @__PURE__ */ z(Me, { children: [
1870
+ e > 0 && /* @__PURE__ */ s(
1871
+ tt.button,
1816
1872
  {
1817
1873
  initial: { opacity: 0 },
1818
1874
  animate: { opacity: I ? 1 : 0, x: I ? 0 : -20 },
@@ -1821,11 +1877,11 @@ const Lr = N(
1821
1877
  onMouseEnter: () => q(!0),
1822
1878
  style: { pointerEvents: I ? "auto" : "none" },
1823
1879
  className: "rfp-absolute rfp-z-20 rfp-left-2 md:rfp-left-4 rfp-top-1/2 -rfp-translate-y-1/2 rfp-w-10 rfp-h-10 md:rfp-w-12 md:rfp-h-12 rfp-rounded-full rfp-backdrop-blur-xl rfp-border rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-shadow-2xl rfp-bg-surface-nav rfp-border-line hover:rfp-bg-surface-nav-hover rfp-text-fg-primary",
1824
- children: /* @__PURE__ */ l(ct, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
1880
+ children: /* @__PURE__ */ s(pt, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
1825
1881
  }
1826
1882
  ),
1827
- e < $.length - 1 && /* @__PURE__ */ l(
1828
- et.button,
1883
+ e < $.length - 1 && /* @__PURE__ */ s(
1884
+ tt.button,
1829
1885
  {
1830
1886
  initial: { opacity: 0 },
1831
1887
  animate: { opacity: I ? 1 : 0, x: I ? 0 : 20 },
@@ -1834,92 +1890,92 @@ const Lr = N(
1834
1890
  onMouseEnter: () => q(!0),
1835
1891
  style: { pointerEvents: I ? "auto" : "none" },
1836
1892
  className: "rfp-absolute rfp-z-20 rfp-right-2 md:rfp-right-4 rfp-top-1/2 -rfp-translate-y-1/2 rfp-w-10 rfp-h-10 md:rfp-w-12 md:rfp-h-12 rfp-rounded-full rfp-backdrop-blur-xl rfp-border rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-shadow-2xl rfp-bg-surface-nav rfp-border-line hover:rfp-bg-surface-nav-hover rfp-text-fg-primary",
1837
- children: /* @__PURE__ */ l(ft, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
1893
+ children: /* @__PURE__ */ s(ft, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
1838
1894
  }
1839
1895
  )
1840
1896
  ] })
1841
1897
  ]
1842
1898
  }
1843
1899
  ) }) });
1844
- }, eo = ({ icon: t, label: e, onClick: r, disabled: n }) => /* @__PURE__ */ z(
1900
+ }, oo = ({ icon: t, label: e, onClick: r, disabled: o }) => /* @__PURE__ */ z(
1845
1901
  "button",
1846
1902
  {
1847
1903
  onClick: r,
1848
- disabled: n,
1849
- className: `rfp-relative rfp-group rfp-p-2 md:rfp-p-1.5 rfp-rounded-md rfp-transition-all rfp-select-none ${n ? "rfp-text-fg-disabled rfp-cursor-not-allowed" : "rfp-text-fg-primary hover:rfp-bg-surface-2 active:rfp-bg-surface-3"}`,
1904
+ disabled: o,
1905
+ className: `rfp-relative rfp-group rfp-p-2 md:rfp-p-1.5 rfp-rounded-md rfp-transition-all rfp-select-none ${o ? "rfp-text-fg-disabled rfp-cursor-not-allowed" : "rfp-text-fg-primary hover:rfp-bg-surface-2 active:rfp-bg-surface-3"}`,
1850
1906
  children: [
1851
1907
  t,
1852
1908
  /* @__PURE__ */ z("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 rfp-top-full rfp-mt-1.5 rfp-px-2 rfp-py-1 rfp-text-xs rfp-rounded rfp-whitespace-nowrap rfp-pointer-events-none rfp-opacity-0 rfp-invisible group-hover:rfp-opacity-100 group-hover:rfp-visible rfp-transition-opacity rfp-duration-200 rfp-z-50 rfp-bg-fg-primary rfp-text-fg-inverse", children: [
1853
- /* @__PURE__ */ l("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 -rfp-top-1 rfp-w-2 rfp-h-2 rfp-rotate-45 rfp-bg-fg-primary" }),
1854
- /* @__PURE__ */ l("span", { className: "rfp-relative", children: e })
1909
+ /* @__PURE__ */ s("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 -rfp-top-1 rfp-w-2 rfp-h-2 rfp-rotate-45 rfp-bg-fg-primary" }),
1910
+ /* @__PURE__ */ s("span", { className: "rfp-relative", children: e })
1855
1911
  ] })
1856
1912
  ]
1857
1913
  }
1858
- ), Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1914
+ ), Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1859
1915
  __proto__: null,
1860
- FilePreviewContent: bt
1916
+ FilePreviewContent: ht
1861
1917
  }, Symbol.toStringTag, { value: "Module" })), No = ({
1862
1918
  files: t,
1863
1919
  currentIndex: e,
1864
1920
  isOpen: r,
1865
- onClose: n,
1921
+ onClose: o,
1866
1922
  onNavigate: a,
1867
- customRenderers: o = [],
1923
+ customRenderers: n = [],
1868
1924
  locale: i,
1869
- messages: s,
1925
+ messages: l,
1870
1926
  headless: p,
1871
- theme: c = "dark",
1872
- onCustomEvent: f,
1927
+ theme: f = "dark",
1928
+ onCustomEvent: c,
1873
1929
  requestInit: d,
1874
1930
  requestHandler: h,
1875
1931
  shouldFetchAsBlob: u,
1876
1932
  onDownload: _
1877
1933
  }) => {
1878
- const [M, v] = y(
1934
+ const [M, x] = y(
1879
1935
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1880
1936
  );
1881
- L(() => {
1882
- if (c !== "auto") return;
1883
- const k = window.matchMedia("(prefers-color-scheme: dark)"), R = (x) => v(x.matches);
1884
- return k.addEventListener("change", R), () => k.removeEventListener("change", R);
1885
- }, [c]);
1886
- const F = c === "auto" ? M ? "dark" : "light" : c;
1887
- if (L(() => {
1937
+ S(() => {
1938
+ if (f !== "auto") return;
1939
+ const k = window.matchMedia("(prefers-color-scheme: dark)"), N = (v) => x(v.matches);
1940
+ return k.addEventListener("change", N), () => k.removeEventListener("change", N);
1941
+ }, [f]);
1942
+ const F = f === "auto" ? M ? "dark" : "light" : f;
1943
+ if (S(() => {
1888
1944
  if (r) {
1889
- const k = document.body.style.overflow, R = document.body.style.paddingRight, x = window.innerWidth - document.documentElement.clientWidth;
1890
- return document.body.style.overflow = "hidden", x > 0 && (document.body.style.paddingRight = `${x}px`), () => {
1891
- document.body.style.overflow = k, document.body.style.paddingRight = R;
1945
+ const k = document.body.style.overflow, N = document.body.style.paddingRight, v = window.innerWidth - document.documentElement.clientWidth;
1946
+ return document.body.style.overflow = "hidden", v > 0 && (document.body.style.paddingRight = `${v}px`), () => {
1947
+ document.body.style.overflow = k, document.body.style.paddingRight = N;
1892
1948
  };
1893
1949
  }
1894
1950
  }, [r]), !r) return null;
1895
- const T = /* @__PURE__ */ l("div", { className: "rfp-root", "data-theme": F, children: /* @__PURE__ */ l(je, { children: r && /* @__PURE__ */ l(
1896
- et.div,
1951
+ const T = /* @__PURE__ */ s("div", { className: "rfp-root", "data-theme": F, children: /* @__PURE__ */ s(je, { children: r && /* @__PURE__ */ s(
1952
+ tt.div,
1897
1953
  {
1898
1954
  initial: { opacity: 0 },
1899
1955
  animate: { opacity: 1 },
1900
1956
  exit: { opacity: 0 },
1901
1957
  className: "rfp-fixed rfp-inset-0 rfp-z-[9999] rfp-flex rfp-items-center rfp-justify-center rfp-backdrop-blur-md rfp-overflow-hidden rfp-bg-surface-overlay",
1902
- onClick: n,
1958
+ onClick: o,
1903
1959
  onWheel: (k) => k.stopPropagation(),
1904
- children: /* @__PURE__ */ l(
1960
+ children: /* @__PURE__ */ s(
1905
1961
  "div",
1906
1962
  {
1907
1963
  className: "rfp-relative rfp-w-full rfp-h-full",
1908
1964
  onClick: (k) => k.stopPropagation(),
1909
- children: /* @__PURE__ */ l(
1910
- bt,
1965
+ children: /* @__PURE__ */ s(
1966
+ ht,
1911
1967
  {
1912
1968
  mode: "modal",
1913
1969
  files: t,
1914
1970
  currentIndex: e,
1915
- onClose: n,
1971
+ onClose: o,
1916
1972
  onNavigate: a,
1917
- customRenderers: o,
1973
+ customRenderers: n,
1918
1974
  locale: i,
1919
- messages: s,
1975
+ messages: l,
1920
1976
  headless: p,
1921
- theme: c,
1922
- onCustomEvent: f,
1977
+ theme: f,
1978
+ onCustomEvent: c,
1923
1979
  requestInit: d,
1924
1980
  requestHandler: h,
1925
1981
  shouldFetchAsBlob: u,
@@ -1930,102 +1986,96 @@ const Lr = N(
1930
1986
  )
1931
1987
  }
1932
1988
  ) }) });
1933
- return Ee(T, document.body);
1934
- }, Ro = ({
1989
+ return ze(T, document.body);
1990
+ }, Mo = ({
1935
1991
  files: t,
1936
1992
  currentIndex: e = 0,
1937
1993
  onNavigate: r,
1938
- customRenderers: n = [],
1994
+ customRenderers: o = [],
1939
1995
  width: a = "100%",
1940
- height: o = "100%",
1996
+ height: n = "100%",
1941
1997
  className: i,
1942
- style: s,
1998
+ style: l,
1943
1999
  locale: p,
1944
- messages: c,
1945
- headless: f,
2000
+ messages: f,
2001
+ headless: c,
1946
2002
  theme: d = "dark",
1947
2003
  onCustomEvent: h,
1948
2004
  requestInit: u,
1949
2005
  requestHandler: _,
1950
2006
  shouldFetchAsBlob: M,
1951
- onDownload: v
2007
+ onDownload: x
1952
2008
  }) => {
1953
2009
  const [F, T] = y(
1954
2010
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1955
2011
  );
1956
- L(() => {
2012
+ S(() => {
1957
2013
  if (d !== "auto") return;
1958
- const R = window.matchMedia("(prefers-color-scheme: dark)"), x = (S) => T(S.matches);
1959
- return R.addEventListener("change", x), () => R.removeEventListener("change", x);
2014
+ const N = window.matchMedia("(prefers-color-scheme: dark)"), v = (L) => T(L.matches);
2015
+ return N.addEventListener("change", v), () => N.removeEventListener("change", v);
1960
2016
  }, [d]);
1961
2017
  const k = d === "auto" ? F ? "dark" : "light" : d;
1962
- return /* @__PURE__ */ l(
2018
+ return /* @__PURE__ */ s(
1963
2019
  "div",
1964
2020
  {
1965
2021
  className: `rfp-root ${i ?? ""}`,
1966
- style: { width: a, height: o, ...s },
2022
+ style: { width: a, height: n, ...l },
1967
2023
  "data-theme": k,
1968
- children: /* @__PURE__ */ l("div", { className: "rfp-relative rfp-w-full rfp-h-full rfp-overflow-hidden rfp-bg-surface-overlay", children: /* @__PURE__ */ l(
1969
- bt,
2024
+ children: /* @__PURE__ */ s("div", { className: "rfp-relative rfp-w-full rfp-h-full rfp-overflow-hidden rfp-bg-surface-overlay", children: /* @__PURE__ */ s(
2025
+ ht,
1970
2026
  {
1971
2027
  mode: "embed",
1972
2028
  files: t,
1973
2029
  currentIndex: e,
1974
2030
  onNavigate: r,
1975
- customRenderers: n,
2031
+ customRenderers: o,
1976
2032
  locale: p,
1977
- messages: c,
1978
- headless: f,
2033
+ messages: f,
2034
+ headless: c,
1979
2035
  theme: d,
1980
2036
  onCustomEvent: h,
1981
2037
  requestInit: u,
1982
2038
  requestHandler: _,
1983
2039
  shouldFetchAsBlob: M,
1984
- onDownload: v
2040
+ onDownload: x
1985
2041
  }
1986
2042
  ) })
1987
2043
  }
1988
2044
  );
1989
2045
  };
1990
- function ro(t) {
1991
- if (typeof window > "u") return;
1992
- const {
1993
- workerSrc: e = `https://unpkg.com/pdfjs-dist@${X.version}/build/pdf.worker.min.mjs`,
1994
- cMapUrl: r = `https://unpkg.com/pdfjs-dist@${X.version}/cmaps/`,
1995
- cMapPacked: n = !0
1996
- } = t || {};
1997
- X.GlobalWorkerOptions.workerSrc = e, X.GlobalWorkerOptions.cMapUrl = r, X.GlobalWorkerOptions.cMapPacked = n;
2046
+ function To(t) {
2047
+ br(Ze, t);
1998
2048
  }
1999
- ro();
2000
- const Mo = Ue.version;
2049
+ const Po = Ue.version;
2001
2050
  export {
2051
+ Ve as A,
2002
2052
  go as C,
2003
- Fo as E,
2004
- bt as F,
2005
- xr as L,
2006
- xo as M,
2007
- vo as S,
2008
- He as U,
2009
- Mo as V,
2053
+ yo as E,
2054
+ ho as F,
2055
+ _o as L,
2056
+ xo as S,
2057
+ vo as T,
2058
+ Po as V,
2010
2059
  bo as _,
2011
- jr as a,
2012
- mo as b,
2013
- ko as c,
2060
+ Lr as a,
2061
+ Co as b,
2062
+ mo as c,
2014
2063
  wo as d,
2015
2064
  Be as e,
2016
- co as f,
2017
- fo as g,
2018
- Ro as h,
2065
+ ht as f,
2066
+ Mo as g,
2067
+ qe as h,
2019
2068
  No as i,
2020
- ro as j,
2021
- at as k,
2022
- Ve as l,
2023
- qe as m,
2024
- _o as n,
2025
- Co as o,
2026
- Kt as u,
2069
+ yr as j,
2070
+ nt as k,
2071
+ fo as l,
2072
+ To as m,
2073
+ He as n,
2074
+ ko as o,
2075
+ co as p,
2076
+ Ro as q,
2077
+ Jt as u,
2027
2078
  uo as x,
2028
- ho as y,
2029
- yo as z
2079
+ Fo as z
2030
2080
  };
2031
- //# sourceMappingURL=index-Bv93wiEK.mjs.map
2081
+ //# sourceMappingURL=index-CGNWXFy3.mjs.map