@eternalheart/vue-file-preview 1.7.0 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +2 -0
  2. package/README.zh-CN.md +2 -0
  3. package/lib/FilePreviewContent.vue.d.ts +9 -1
  4. package/lib/FilePreviewEmbed.vue.d.ts +6 -1
  5. package/lib/FilePreviewModal.vue.d.ts +6 -1
  6. package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang--ZOobbGi.mjs → EmptyState.vue_vue_type_script_setup_true_lang-Dna6LmVT.mjs} +1 -1
  7. package/lib/chunks/{avifLoader-CAUzjn-d-CnJpGYJ2.mjs → avifLoader-CAUzjn-d-dPsP28D5.mjs} +1 -1
  8. package/lib/chunks/{heicLoader-D_9PukkA-g_dLrWLP.mjs → heicLoader-D_9PukkA-T-k1DSgY.mjs} +1 -1
  9. package/lib/chunks/{index-c-pYJEmH.mjs → index-B5hprvcF.mjs} +1747 -1709
  10. package/lib/chunks/index-BN__EwfT.mjs +333 -0
  11. package/lib/chunks/{index-z9RqL2wI.mjs → index-BPutNVAf.mjs} +453 -453
  12. package/lib/chunks/{index-BfOWoMpY.mjs → index-B_Spz6Wn.mjs} +77 -77
  13. package/lib/chunks/{index-D5IF9F-D.mjs → index-BjHEHkZ8.mjs} +22 -22
  14. package/lib/chunks/{index-LPGxJDnT.mjs → index-BlZ6RmeR.mjs} +18 -18
  15. package/lib/chunks/{index-CrVQPnFj.mjs → index-C95y29OL.mjs} +18 -18
  16. package/lib/chunks/{index-DFeKS8tR.mjs → index-CegPYMyO.mjs} +22 -22
  17. package/lib/chunks/{index-C4hIk6pa.mjs → index-CqOGKCyE.mjs} +2 -2
  18. package/lib/chunks/{index-6XZXYqbp.mjs → index-Cv3Sg87O.mjs} +29 -32
  19. package/lib/chunks/{index-zLQlyNR2.mjs → index-DHba2Axz.mjs} +62 -62
  20. package/lib/chunks/{index-CWPdNhoe.mjs → index-DInI3RTN.mjs} +60 -60
  21. package/lib/chunks/{index-C8lyQPe3.mjs → index-DXzvgRuo.mjs} +3 -3
  22. package/lib/chunks/{index-BPSzwMOC.mjs → index-DcvlMm9Q.mjs} +46 -46
  23. package/lib/chunks/index-Dnyl1HQk.mjs +51 -0
  24. package/lib/chunks/{index-aKiIuKKx.mjs → index-JjVQZbDt.mjs} +50 -50
  25. package/lib/chunks/{index-DZe0BxAB.mjs → index-QPk2c2Tl.mjs} +20 -20
  26. package/lib/chunks/{index-DM8Dfl-m.mjs → index-TZv0MqBH.mjs} +15 -15
  27. package/lib/chunks/{index-BzwJ0VWu.mjs → index-cRhwUlQN.mjs} +33 -33
  28. package/lib/chunks/{index-BYQ9S7Mk.mjs → index-dOxDeWYi.mjs} +30 -30
  29. package/lib/chunks/{index-Bg8poMIm.mjs → index-eNZr1h6f.mjs} +29 -29
  30. package/lib/chunks/{index-Bf94DwQu.mjs → index-oJF-hur2.mjs} +24 -24
  31. package/lib/chunks/{jp2Loader-Dig19xyo-fCO1knZ0.mjs → jp2Loader-Dig19xyo-hrIg_KJ3.mjs} +1 -1
  32. package/lib/chunks/{psdLoader-C0tKUXXl-DihMskai.mjs → psdLoader-C0tKUXXl-B2cJ4s7t.mjs} +1 -1
  33. package/lib/chunks/{rawLoader-C-tPeFAB-BSfDPl-z.mjs → rawLoader-C-tPeFAB-BNV-Wmzr.mjs} +1 -1
  34. package/lib/chunks/{tiffLoader-BlhByX8w-JY5DaTre.mjs → tiffLoader-BlhByX8w-BzSrLE9Y.mjs} +1 -1
  35. package/lib/chunks/{useShikiHighlight-C-ztcJBE.mjs → useShikiHighlight-CpL0RAQg.mjs} +1 -1
  36. package/lib/composables/usePreviewEvents.d.ts +2 -2
  37. package/lib/composables/useRequest.d.ts +8 -2
  38. package/lib/core/events.d.ts +18 -1
  39. package/lib/core/index.d.ts +1 -1
  40. package/lib/index.cjs +54 -54
  41. package/lib/index.css +1 -1
  42. package/lib/index.d.ts +1 -1
  43. package/lib/index.mjs +5 -5
  44. package/package.json +1 -1
  45. package/lib/chunks/index-C41YET0_.mjs +0 -51
  46. package/lib/chunks/index-GFcSJEwj.mjs +0 -330
@@ -1,5 +1,5 @@
1
- import { defineComponent as re, ref as z, onMounted as se, onUnmounted as ae, watch as le, openBlock as H, createElementBlock as U, createVNode as fe, createCommentVNode as q, createElementVNode as V, toDisplayString as ue, unref as de } from "vue";
2
- import { u as ce, a as pe, b as me, J as ve } from "./index-c-pYJEmH.mjs";
1
+ import { defineComponent as re, ref as z, onMounted as se, onUnmounted as ae, watch as le, openBlock as U, createElementBlock as V, createVNode as fe, createCommentVNode as q, createElementVNode as k, toDisplayString as ue, unref as de } from "vue";
2
+ import { u as ce, a as pe, b as me, J as ve } from "./index-B5hprvcF.mjs";
3
3
  import * as o from "three";
4
4
  import { OrbitControls as ge } from "three/examples/jsm/controls/OrbitControls";
5
5
  import { DXFLoader as he } from "three-dxf-loader";
@@ -84,7 +84,7 @@ const Ae = {
84
84
  } catch {
85
85
  return "";
86
86
  }
87
- }, k = (e, t, i, s) => {
87
+ }, W = (e, t, i, s) => {
88
88
  const c = Math.max(s.x, s.y, s.z), g = Number.isFinite(c) && c > 0 ? c : 1;
89
89
  if (e instanceof o.OrthographicCamera) {
90
90
  const l = (e.right - e.left) / (e.top - e.bottom), h = (Math.max(s.y, s.x / l) || g) * 0.55;
@@ -93,15 +93,15 @@ const Ae = {
93
93
  }
94
94
  const n = e.fov * (Math.PI / 180), a = Math.abs(g / 2 / Math.tan(n / 2)) * 1.5;
95
95
  e.near = Math.max(g * 1e-3, 1e-4), e.far = Math.max(a * 4, i.length() * 2 + g * 4, e.near * 100), e.position.set(i.x + a, i.y + a, i.z + a), e.lookAt(i), t.target.copy(i), t.update(), e.updateProjectionMatrix();
96
- }, v = m, { t: A } = ce(), Y = pe(), W = me(), x = z(null), P = z(!0), _ = z(null), T = z(!1), F = z(!0), G = z(!0);
96
+ }, v = m, { t: A } = ce(), Y = pe(), N = me(), x = z(null), P = z(!0), _ = z(null), T = z(!1), F = z(!0), G = z(!0);
97
97
  let r = null, f = null, d = null, u = null, C = null, p = null, w = null, R = null, D = null, S = null, M = !1, L = !0;
98
- const O = new xe(), N = (e, t, i) => {
98
+ const O = new xe(), H = (e, t, i) => {
99
99
  var s, c, g;
100
100
  return i != null && i.name ? ((s = i.name.split(".").pop()) == null ? void 0 : s.toLowerCase()) || "" : t ? ((c = t.split(".").pop()) == null ? void 0 : c.toLowerCase()) || "" : ((g = e.split(".").pop()) == null ? void 0 : g.toLowerCase().split("?")[0]) || "";
101
101
  }, Z = () => {
102
102
  if (!u || !f || !C) return;
103
103
  const e = new o.Box3().setFromObject(C), t = e.getCenter(new o.Vector3()), i = e.getSize(new o.Vector3());
104
- k(f, u, t, i), L = !0;
104
+ W(f, u, t, i), L = !0;
105
105
  }, $ = () => {
106
106
  T.value = !T.value, C && C.traverse((e) => {
107
107
  if (e instanceof o.Mesh) {
@@ -130,7 +130,7 @@ const Ae = {
130
130
  b({
131
131
  getToolbarGroups: () => _e({
132
132
  cadRef: { resetView: Z, toggleWireframe: $, toggleGrid: K, toggleAxes: Q },
133
- isDxf: N(v.url, v.fileName, v.file) === "dxf",
133
+ isDxf: H(v.url, v.fileName, v.file) === "dxf",
134
134
  wireframe: T.value,
135
135
  showGrid: F.value,
136
136
  showAxes: G.value,
@@ -151,7 +151,7 @@ const Ae = {
151
151
  M = !1, S = new AbortController();
152
152
  const e = x.value, t = e.clientWidth, i = e.clientHeight;
153
153
  r = new o.Scene(), r.background = new o.Color(1710618);
154
- const s = N(v.url, v.fileName, v.file) === "dxf", c = Math.max(t, 1) / Math.max(i, 1);
154
+ const s = H(v.url, v.fileName, v.file) === "dxf", c = Math.max(t, 1) / Math.max(i, 1);
155
155
  f = s ? new o.OrthographicCamera(-c, c, 1, -1, 0, 1e6) : new o.PerspectiveCamera(45, c, 0.01, 1e6), f.position.set(100, 100, 100), d = new o.WebGLRenderer({ antialias: !0 }), d.setSize(t, i), d.setPixelRatio(Math.min(window.devicePixelRatio, 2)), L = !0, e.appendChild(d.domElement), u = new ge(f, d.domElement), u.enableDamping = !0, u.dampingFactor = 0.05, s && (u.enableRotate = !1, u.screenSpacePanning = !0, u.mouseButtons.LEFT = o.MOUSE.PAN, u.touches.ONE = o.TOUCH.PAN, u.touches.TWO = o.TOUCH.DOLLY_PAN);
156
156
  const g = new o.AmbientLight(16777215, 0.6);
157
157
  r.add(g);
@@ -165,8 +165,8 @@ const Ae = {
165
165
  };
166
166
  l(), R = new ResizeObserver(ie), R.observe(e);
167
167
  }, oe = () => {
168
- if (W.begin(v.url), !r || !f || !u || M) return;
169
- const e = N(v.url, v.fileName, v.file);
168
+ if (N.begin(v.url), !r || !f || !u || M) return;
169
+ const e = H(v.url, v.fileName, v.file);
170
170
  let t;
171
171
  const i = new o.LoadingManager();
172
172
  if (e === "dxf")
@@ -214,9 +214,9 @@ const Ae = {
214
214
  }
215
215
  r.add(l), C = l;
216
216
  const y = h.getCenter(new o.Vector3()), B = h.getSize(new o.Vector3());
217
- ee(h), k(f, u, y, B), L = !0, P.value = !1, O.notify();
217
+ ee(h), W(f, u, y, B), L = !0, P.value = !1, O.notify(), N.ready();
218
218
  }, c = (n) => {
219
- M || n.name !== "AbortError" && (_.value = A.value("cad.load_failed"), P.value = !1, W.error(n));
219
+ M || n.name !== "AbortError" && (_.value = A.value("cad.load_failed"), P.value = !1, N.error(n));
220
220
  };
221
221
  (v.file ? v.file.arrayBuffer() : Y.value(v.url, { signal: S == null ? void 0 : S.signal }).then((n) => {
222
222
  if (!M) {
@@ -284,18 +284,18 @@ const Ae = {
284
284
  J();
285
285
  }), le(() => v.url, () => {
286
286
  J(), P.value = !0, _.value = null, x.value && I();
287
- }), (e, t) => (H(), U("div", {
287
+ }), (e, t) => (U(), V("div", {
288
288
  ref_key: "containerRef",
289
289
  ref: x,
290
290
  class: "vfp-relative vfp-w-full vfp-h-full vfp-bg-media-bg"
291
291
  }, [
292
- _.value ? (H(), U("div", Ae, [
292
+ _.value ? (U(), V("div", Ae, [
293
293
  fe(ye, { message: _.value }, null, 8, ["message"])
294
294
  ])) : q("", !0),
295
- P.value ? (H(), U("div", Re, [
296
- V("div", Se, [
297
- t[0] || (t[0] = V("div", { class: "vfp-renderer-spinner" }, null, -1)),
298
- V("p", ze, ue(de(A)("cad.loading")), 1)
295
+ P.value ? (U(), V("div", Re, [
296
+ k("div", Se, [
297
+ t[0] || (t[0] = k("div", { class: "vfp-renderer-spinner" }, null, -1)),
298
+ k("p", ze, ue(de(A)("cad.loading")), 1)
299
299
  ])
300
300
  ])) : q("", !0)
301
301
  ], 512));
@@ -1,24 +1,24 @@
1
- import { ref as f, watch as G, onUnmounted as O, defineComponent as W, toRef as X, computed as D, onMounted as K, onBeforeUnmount as Q, unref as e, openBlock as _, createBlock as N, createElementBlock as H, createElementVNode as a, normalizeClass as I, createVNode as T, toDisplayString as j, normalizeStyle as J, resolveDynamicComponent as Y, Transition as Z, withCtx as ee, createCommentVNode as te } from "vue";
1
+ import { ref as f, watch as G, onUnmounted as O, defineComponent as W, toRef as X, computed as B, onMounted as K, onBeforeUnmount as Q, unref as e, openBlock as _, createBlock as N, createElementBlock as H, createElementVNode as a, normalizeClass as I, createVNode as T, toDisplayString as j, normalizeStyle as J, resolveDynamicComponent as Y, Transition as Z, withCtx as ee, createCommentVNode as te } from "vue";
2
2
  import { VolumeX as ae, Volume1 as oe, Volume2 as ne, AudioLines as le, Pause as se, Play as re, SkipBack as ie, SkipForward as fe, Repeat as ve } from "lucide-vue-next";
3
- import { b as ue, B as pe, J as de, u as ce } from "./index-c-pYJEmH.mjs";
3
+ import { b as ue, D as pe, J as de, u as ce } from "./index-B5hprvcF.mjs";
4
4
  import { _ as me } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
5
  function ge(x) {
6
- const v = f(null), y = f(!1), p = f(!0), n = f(0), P = f(0), m = f(1), g = f(!1), h = f(!1), u = f(null), d = ue();
6
+ const v = f(null), y = f(!1), d = f(!0), n = f(0), P = f(0), m = f(1), g = f(!1), h = f(!1), u = f(null), p = ue();
7
7
  let r = null;
8
8
  const L = () => {
9
9
  const t = v.value;
10
10
  if (!t) return;
11
- d.begin(x.value), p.value = !0, u.value = null;
11
+ p.begin(x.value), d.value = !0, u.value = null;
12
12
  const l = () => {
13
13
  isNaN(t.currentTime) || (n.value = t.currentTime);
14
14
  }, s = () => {
15
15
  !isNaN(t.duration) && isFinite(t.duration) && (P.value = t.duration);
16
16
  }, b = () => {
17
- p.value = !1, s();
17
+ d.value = !1, s(), p.ready();
18
18
  }, w = () => {
19
- p.value = !0;
19
+ d.value = !0;
20
20
  }, c = () => {
21
- p.value = !1, y.value = !0;
21
+ d.value = !1, y.value = !0;
22
22
  }, k = () => {
23
23
  y.value = !0;
24
24
  }, M = () => {
@@ -26,9 +26,9 @@ function ge(x) {
26
26
  }, C = () => {
27
27
  y.value = !1;
28
28
  }, E = () => {
29
- u.value = "audio.load_failed", p.value = !1, d.error(new de("audio.load_failed"), "request");
29
+ u.value = "audio.load_failed", d.value = !1, p.error(new de("audio.load_failed"), "request");
30
30
  };
31
- t.addEventListener("timeupdate", l), t.addEventListener("loadedmetadata", s), t.addEventListener("durationchange", s), t.addEventListener("canplay", b), t.addEventListener("waiting", w), t.addEventListener("playing", c), t.addEventListener("play", k), t.addEventListener("pause", M), t.addEventListener("ended", C), t.addEventListener("error", E), t.readyState >= 3 ? (p.value = !1, s()) : t.readyState >= 1 && s(), r = () => {
31
+ t.addEventListener("timeupdate", l), t.addEventListener("loadedmetadata", s), t.addEventListener("durationchange", s), t.addEventListener("canplay", b), t.addEventListener("waiting", w), t.addEventListener("playing", c), t.addEventListener("play", k), t.addEventListener("pause", M), t.addEventListener("ended", C), t.addEventListener("error", E), t.readyState >= 3 ? (d.value = !1, s(), p.ready()) : t.readyState >= 1 && s(), r = () => {
32
32
  t.removeEventListener("timeupdate", l), t.removeEventListener("loadedmetadata", s), t.removeEventListener("durationchange", s), t.removeEventListener("canplay", b), t.removeEventListener("waiting", w), t.removeEventListener("playing", c), t.removeEventListener("play", k), t.removeEventListener("pause", M), t.removeEventListener("ended", C), t.removeEventListener("error", E);
33
33
  };
34
34
  };
@@ -49,7 +49,7 @@ function ge(x) {
49
49
  }), {
50
50
  audioRef: v,
51
51
  isPlaying: y,
52
- isLoading: p,
52
+ isLoading: d,
53
53
  isLoop: h,
54
54
  currentTime: n,
55
55
  duration: P,
@@ -97,7 +97,7 @@ const xe = {
97
97
  }, ye = { class: "vfp-w-full vfp-max-w-xl vfp-flex-shrink-0 vfp-rounded-lg vfp-border vfp-border-line-weak vfp-bg-surface-1 vfp-p-4" }, he = { class: "vfp-flex vfp-items-center vfp-gap-3 vfp-mb-4" }, be = { class: "vfp-min-w-0 vfp-flex-1 vfp-truncate vfp-text-sm vfp-font-medium vfp-text-fg-primary" }, we = { class: "vfp-flex vfp-items-center vfp-gap-3 vfp-mb-4" }, ke = { class: "vfp-w-9 vfp-flex-shrink-0 vfp-text-right vfp-text-[11px] vfp-text-fg-tertiary vfp-tabular-nums" }, _e = { class: "vfp-relative vfp-h-4 vfp-flex vfp-flex-1 vfp-items-center" }, Le = { class: "vfp-absolute vfp-left-[6px] vfp-right-[6px] vfp-h-[3px] vfp-rounded-full vfp-bg-surface-3" }, Ee = ["max", "value", "disabled", "aria-label"], Te = { class: "vfp-w-9 vfp-flex-shrink-0 vfp-text-[11px] vfp-text-fg-tertiary vfp-tabular-nums" }, Pe = { class: "vfp-flex vfp-items-center vfp-gap-1" }, Me = ["title", "aria-label"], Ce = ["title", "aria-label"], Ve = ["title", "aria-label"], Ne = ["title", "aria-label"], je = ["title", "aria-label"], Re = {
98
98
  class: "vfp-flex vfp-flex-col vfp-items-center vfp-gap-2",
99
99
  style: { height: "100px" }
100
- }, Be = {
100
+ }, De = {
101
101
  class: "vfp-relative vfp-flex vfp-items-center vfp-justify-center",
102
102
  style: { width: "24px", height: "80px" }
103
103
  }, Fe = ["value", "aria-label"], Se = { class: "vfp-text-[10px] vfp-tabular-nums vfp-text-fg-tertiary" }, $e = ["src"], ze = /* @__PURE__ */ W({
@@ -107,25 +107,25 @@ const xe = {
107
107
  fileName: {}
108
108
  },
109
109
  setup(x, { expose: v }) {
110
- const p = X(x, "url"), { t: n } = ce(), {
110
+ const d = X(x, "url"), { t: n } = ce(), {
111
111
  audioRef: P,
112
112
  isPlaying: m,
113
113
  isLoop: g,
114
114
  currentTime: h,
115
115
  duration: u,
116
- volume: d,
116
+ volume: p,
117
117
  isMuted: r,
118
118
  error: L,
119
119
  togglePlay: R,
120
- seek: B,
120
+ seek: D,
121
121
  skip: F,
122
122
  setVolume: A,
123
123
  toggleMute: S,
124
124
  toggleLoop: $,
125
125
  formatTime: t
126
- } = ge(p), l = f(!1), s = f(!1), b = f(0), w = f(null);
126
+ } = ge(d), l = f(!1), s = f(!1), b = f(0), w = f(null);
127
127
  let c = null;
128
- const k = D(() => s.value ? b.value : h.value), M = D(() => u.value > 0 ? k.value / u.value : 0), C = D(() => r.value || d.value === 0 ? ae : d.value < 0.5 ? oe : ne), E = (z) => {
128
+ const k = B(() => s.value ? b.value : h.value), M = B(() => u.value > 0 ? k.value / u.value : 0), C = B(() => r.value || p.value === 0 ? ae : p.value < 0.5 ? oe : ne), E = (z) => {
129
129
  w.value && !w.value.contains(z.target) && (l.value = !1);
130
130
  };
131
131
  K(() => {
@@ -186,11 +186,11 @@ const xe = {
186
186
  }),
187
187
  onInput: o[1] || (o[1] = (i) => {
188
188
  const V = parseFloat(i.target.value);
189
- s.value ? b.value = V : e(B)(V);
189
+ s.value ? b.value = V : e(D)(V);
190
190
  }),
191
191
  onPointerup: o[2] || (o[2] = (i) => {
192
192
  const V = parseFloat(i.target.value);
193
- e(B)(V), s.value = !1;
193
+ e(D)(V), s.value = !1;
194
194
  }),
195
195
  onPointercancel: o[3] || (o[3] = (i) => s.value = !1)
196
196
  }, null, 40, Ee)
@@ -280,7 +280,7 @@ const xe = {
280
280
  onMouseleave: q
281
281
  }, [
282
282
  a("div", Re, [
283
- a("div", Be, [
283
+ a("div", De, [
284
284
  o[10] || (o[10] = a("div", {
285
285
  class: "vfp-absolute vfp-rounded-full vfp-bg-surface-2",
286
286
  style: { width: "3px", height: "100%" }
@@ -289,7 +289,7 @@ const xe = {
289
289
  class: "vfp-absolute vfp-bottom-0 vfp-rounded-full vfp-pointer-events-none",
290
290
  style: J({
291
291
  width: "3px",
292
- height: `${(e(r) ? 0 : e(d)) * 100}%`,
292
+ height: `${(e(r) ? 0 : e(p)) * 100}%`,
293
293
  background: "var(--fp-player-progress)",
294
294
  transition: "height 0.1s linear"
295
295
  })
@@ -299,14 +299,14 @@ const xe = {
299
299
  min: "0",
300
300
  max: "1",
301
301
  step: "0.01",
302
- value: e(r) ? 0 : e(d),
302
+ value: e(r) ? 0 : e(p),
303
303
  "aria-label": e(n)("audio.aria.volume"),
304
304
  class: "volume-slider-vertical vfp-absolute",
305
305
  style: { width: "80px", height: "24px", transform: "rotate(-90deg)", "transform-origin": "center center" },
306
306
  onInput: o[9] || (o[9] = (i) => e(A)(parseFloat(i.target.value)))
307
307
  }, null, 40, Fe)
308
308
  ]),
309
- a("span", Se, j(Math.round((e(r) ? 0 : e(d)) * 100)), 1)
309
+ a("span", Se, j(Math.round((e(r) ? 0 : e(p)) * 100)), 1)
310
310
  ])
311
311
  ], 32)) : te("", !0)
312
312
  ]),
@@ -14,7 +14,7 @@ var _t = (u, e, t, s) => ({
14
14
  }
15
15
  });
16
16
  import { defineComponent as _b, ref as si, watch as aa, nextTick as wu, onMounted as Gb, onBeforeUnmount as zb, openBlock as zh, createElementBlock as Eu, normalizeStyle as Ep, createElementVNode as ii, toDisplayString as Pm, unref as Sp, createVNode as Vb, createCommentVNode as Su, createBlock as Wb } from "vue";
17
- import { c as Xb, u as Yb, b as Kb, R as Mm, n as Jb } from "./index-c-pYJEmH.mjs";
17
+ import { v as Xb, u as Yb, b as Kb, O as Mm, r as Jb } from "./index-B5hprvcF.mjs";
18
18
  import { _ as Qb } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
19
19
  import { X as Zb, Menu as qb, ChevronLeft as tA, ChevronRight as eA, ZoomOut as sA, ZoomIn as iA, RefreshCw as nA } from "lucide-vue-next";
20
20
  import { T as rA } from "./base.types-DaftHyg7.mjs";
@@ -22011,7 +22011,7 @@ const ew = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22011
22011
  viewport: F,
22012
22012
  transform: z === 1 ? void 0 : [z, 0, 0, z, 0, 0]
22013
22013
  });
22014
- O.renderTask = q, await q.promise, O.element.innerHTML = "", O.element.appendChild(Z), O.rendered = !0, B === 1 && (m.value = !0);
22014
+ O.renderTask = q, await q.promise, O.element.innerHTML = "", O.element.appendChild(Z), O.rendered = !0, B === 1 && (m.value = !0, o.ready());
22015
22015
  } catch (R) {
22016
22016
  (R == null ? void 0 : R.name) !== "RenderingCancelledException" && (console.error(a.value("pdf.page_render_failed", { page: B }) + ":", R), o.error(R, "render"));
22017
22017
  } finally {
@@ -1,23 +1,23 @@
1
- import { defineComponent as z, ref as y, watch as T, computed as v, openBlock as r, createElementBlock as o, createElementVNode as s, toDisplayString as a, unref as n, createBlock as A, normalizeClass as B, Fragment as w, renderList as C, createCommentVNode as E } from "vue";
2
- import { u as D, a as I, b as M, o as O, W as p, h as P, e as R } from "./index-c-pYJEmH.mjs";
1
+ import { defineComponent as A, ref as h, watch as T, computed as p, openBlock as r, createElementBlock as o, createElementVNode as s, toDisplayString as a, unref as n, createBlock as D, normalizeClass as B, Fragment as w, renderList as C, createCommentVNode as E } from "vue";
2
+ import { u as I, a as J, b as M, i as O, o as f, f as P, d as R } from "./index-B5hprvcF.mjs";
3
3
  import { _ as X } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
4
  const Y = {
5
5
  key: 0,
6
6
  class: "vfp-renderer-loading vfp-bg-[#0f0f12]"
7
- }, $ = { class: "vfp-renderer-loading-content" }, j = { class: "vfp-renderer-loading-text" }, q = { class: "content-scroll" }, H = { class: "timeline" }, J = { class: "cues" }, K = { class: "cue-meta" }, Q = { class: "cue-time" }, U = { class: "cue-time" }, Z = { class: "cue-id" }, ee = {
7
+ }, $ = { class: "vfp-renderer-loading-content" }, j = { class: "vfp-renderer-loading-text" }, q = { class: "content-scroll" }, H = { class: "timeline" }, K = { class: "cues" }, Q = { class: "cue-meta" }, U = { class: "cue-time" }, W = { class: "cue-time" }, Z = { class: "cue-id" }, ee = {
8
8
  key: 0,
9
9
  class: "cue-style"
10
10
  }, se = {
11
11
  key: 0,
12
12
  class: "cue-words"
13
- }, te = ["title"], le = { class: "cue-word-time" }, re = { class: "cue-word-text" }, ae = { class: "status-pill" }, oe = /* @__PURE__ */ z({
13
+ }, te = ["title"], le = { class: "cue-word-time" }, re = { class: "cue-word-text" }, ae = { class: "status-pill" }, oe = /* @__PURE__ */ A({
14
14
  __name: "index",
15
15
  props: {
16
16
  url: {},
17
17
  fileName: {}
18
18
  },
19
19
  setup(F, { expose: N }) {
20
- const i = F, { t: u } = D(), L = I(), f = M(), m = y(""), _ = y(!0), d = y(null), S = {
20
+ const i = F, { t: u } = I(), L = J(), d = M(), m = h(""), _ = h(!0), v = h(null), S = {
21
21
  srt: "srt",
22
22
  vtt: "vtt",
23
23
  lrc: "lrc",
@@ -32,16 +32,16 @@ const Y = {
32
32
  return S[t];
33
33
  };
34
34
  T(() => i.url, async () => {
35
- f.begin(i.url), _.value = !0, d.value = null;
35
+ d.begin(i.url), _.value = !0, v.value = null;
36
36
  try {
37
37
  m.value = await P(i.url, { fetcher: L.value });
38
38
  } catch (e) {
39
- console.error(e), d.value = u.value("subtitle.load_failed"), f.error(e);
39
+ console.error(e), v.value = u.value("subtitle.load_failed"), d.error(e);
40
40
  } finally {
41
41
  _.value = !1;
42
42
  }
43
43
  }, { immediate: !0 });
44
- const x = v(() => {
44
+ const x = p(() => {
45
45
  if (!m.value) return { value: null, error: null };
46
46
  try {
47
47
  return { value: O(m.value, G(i.fileName)), error: null };
@@ -49,19 +49,16 @@ const Y = {
49
49
  return console.error(e), { value: null, error: e };
50
50
  }
51
51
  });
52
- T(
53
- () => x.value.error,
54
- (e) => {
55
- e && f.error(e);
56
- }
57
- );
58
- const c = v(() => x.value.value), g = v(() => {
52
+ T(x, (e) => {
53
+ e.error ? d.error(e.error) : e.value && d.ready();
54
+ });
55
+ const c = p(() => x.value.value), y = p(() => {
59
56
  var e, t;
60
57
  return ((e = c.value) == null ? void 0 : e.format) === "lrc" || ((t = c.value) == null ? void 0 : t.format) === "elrc";
61
- }), b = v(() => {
58
+ }), b = p(() => {
62
59
  var e;
63
60
  return ((e = c.value) == null ? void 0 : e.metadata) ?? {};
64
- }), V = (e) => p(e).slice(3, 8);
61
+ }), V = (e) => f(e).slice(3, 8);
65
62
  return N({
66
63
  getToolbarGroups: () => []
67
64
  }), (e, t) => _.value ? (r(), o("div", Y, [
@@ -69,49 +66,49 @@ const Y = {
69
66
  t[0] || (t[0] = s("div", { class: "vfp-renderer-spinner" }, null, -1)),
70
67
  s("span", j, a(n(u)("common.loading")), 1)
71
68
  ])
72
- ])) : d.value || !c.value ? (r(), A(X, {
69
+ ])) : v.value || !c.value ? (r(), D(X, {
73
70
  key: 1,
74
- message: d.value || n(u)("subtitle.parse_failed"),
71
+ message: v.value || n(u)("subtitle.parse_failed"),
75
72
  class: "vfp-bg-[#0f0f12]"
76
73
  }, null, 8, ["message"])) : (r(), o("div", {
77
74
  key: 2,
78
- class: B(["vfp-relative vfp-w-full vfp-h-full vfp-bg-[#0f0f12]", g.value ? "flavor-lyric" : "flavor-subtitle"])
75
+ class: B(["vfp-relative vfp-w-full vfp-h-full vfp-bg-[#0f0f12]", y.value ? "flavor-lyric" : "flavor-subtitle"])
79
76
  }, [
80
77
  s("div", q, [
81
78
  s("div", H, [
82
79
  t[3] || (t[3] = s("div", { class: "timeline-line" }, null, -1)),
83
- s("ol", J, [
80
+ s("ol", K, [
84
81
  (r(!0), o(w, null, C(c.value.cues, (l, k) => (r(), o("li", {
85
82
  key: "cue-" + k,
86
83
  class: "cue-row"
87
84
  }, [
88
85
  t[2] || (t[2] = s("div", { class: "cue-dot" }, null, -1)),
89
- s("div", K, [
90
- s("span", Q, a(n(p)(l.start)), 1),
86
+ s("div", Q, [
87
+ s("span", U, a(n(f)(l.start)), 1),
91
88
  t[1] || (t[1] = s("span", { class: "cue-arrow" }, "→", -1)),
92
- s("span", U, a(n(p)(l.end)), 1),
89
+ s("span", W, a(n(f)(l.end)), 1),
93
90
  s("span", Z, "#" + a(l.id ?? k + 1), 1),
94
91
  l.style ? (r(), o("span", ee, a(l.style), 1)) : E("", !0)
95
92
  ]),
96
93
  l.words && l.words.length > 0 ? (r(), o("div", se, [
97
- (r(!0), o(w, null, C(l.words, (h, W) => (r(), o("span", {
98
- key: "w-" + W,
94
+ (r(!0), o(w, null, C(l.words, (g, z) => (r(), o("span", {
95
+ key: "w-" + z,
99
96
  class: "cue-word",
100
- title: n(p)(h.start)
97
+ title: n(f)(g.start)
101
98
  }, [
102
- s("span", le, a(V(h.start)), 1),
103
- s("span", re, a(h.text), 1)
99
+ s("span", le, a(V(g.start)), 1),
100
+ s("span", re, a(g.text), 1)
104
101
  ], 8, te))), 128))
105
102
  ])) : (r(), o("p", {
106
103
  key: 1,
107
- class: B(["cue-text", { lyric: g.value }])
104
+ class: B(["cue-text", { lyric: y.value }])
108
105
  }, a(l.text), 3))
109
106
  ]))), 128))
110
107
  ])
111
108
  ])
112
109
  ]),
113
110
  s("div", ae, [
114
- s("span", null, a(c.value.cues.length) + " " + a(g.value ? n(u)("subtitle.lines") : n(u)("subtitle.cues")), 1),
111
+ s("span", null, a(c.value.cues.length) + " " + a(y.value ? n(u)("subtitle.lines") : n(u)("subtitle.cues")), 1),
115
112
  b.value.length ? (r(), o(w, { key: 0 }, [
116
113
  t[4] || (t[4] = s("span", { class: "dot" }, "·", -1)),
117
114
  s("span", null, a(b.value.length), 1)
@@ -119,7 +116,7 @@ const Y = {
119
116
  ])
120
117
  ], 2));
121
118
  }
122
- }), ve = /* @__PURE__ */ R(oe, [["__scopeId", "data-v-4f53a8e5"]]);
119
+ }), ve = /* @__PURE__ */ R(oe, [["__scopeId", "data-v-f89221c5"]]);
123
120
  export {
124
121
  ve as default
125
122
  };