@peeekpage/viewer 0.4.1 → 0.4.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.
- package/dist/index.js +425 -404
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as y, jsx as o, Fragment as qe } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, useRef as E, useEffect as C, useCallback as L, useMemo as Je } from "react";
|
|
3
|
+
const Qe = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
4
4
|
function G(t) {
|
|
5
5
|
if (typeof t != "string") return null;
|
|
6
6
|
const e = t.trim();
|
|
@@ -12,23 +12,23 @@ function G(t) {
|
|
|
12
12
|
} catch {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return Qe.has(a.protocol) ? a.href : null;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
17
|
+
const et = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, tt = /^rgba?\([ \t]*\d{1,3}[ \t]*,[ \t]*\d{1,3}[ \t]*,[ \t]*\d{1,3}[ \t]*(?:,[ \t]*(?:0|1|0?\.\d+)[ \t]*)?\)$/;
|
|
18
|
+
function ce(t) {
|
|
19
19
|
if (typeof t != "string") return null;
|
|
20
20
|
const e = t.trim();
|
|
21
|
-
return
|
|
21
|
+
return et.test(e) || tt.test(e) ? e : null;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const nt = /url\(|image\(|image-set\(|element\(|expression|@|\/\*|;|\{|\}|<|>|\\/i, at = /^(repeating-)?(linear|radial|conic)-gradient\([a-z0-9#.,%()\/\s-]*\)$/i, ot = /^hsla?\([a-z0-9.,%\/\s-]*\)$/i;
|
|
24
|
+
function rt(t) {
|
|
25
25
|
if (typeof t != "string") return null;
|
|
26
26
|
const e = t.trim();
|
|
27
|
-
if (e === "" ||
|
|
28
|
-
const n =
|
|
29
|
-
return n !== null ? n :
|
|
27
|
+
if (e === "" || nt.test(e)) return null;
|
|
28
|
+
const n = ce(e);
|
|
29
|
+
return n !== null ? n : ot.test(e) || at.test(e) ? e : null;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const lt = ["en", "pt-BR"], Te = {
|
|
32
32
|
prev: "Previous page",
|
|
33
33
|
next: "Next page",
|
|
34
34
|
zoom: "Zoom level",
|
|
@@ -50,7 +50,7 @@ const rt = ["en", "pt-BR"], ye = {
|
|
|
50
50
|
rotate: "Rotate page",
|
|
51
51
|
singlePage: "Single page",
|
|
52
52
|
doublePage: "Two pages"
|
|
53
|
-
},
|
|
53
|
+
}, it = {
|
|
54
54
|
prev: "Página anterior",
|
|
55
55
|
next: "Próxima página",
|
|
56
56
|
zoom: "Nível de zoom",
|
|
@@ -72,34 +72,34 @@ const rt = ["en", "pt-BR"], ye = {
|
|
|
72
72
|
rotate: "Girar página",
|
|
73
73
|
singlePage: "Página única",
|
|
74
74
|
doublePage: "Duas páginas"
|
|
75
|
-
},
|
|
76
|
-
function
|
|
77
|
-
return
|
|
75
|
+
}, st = { en: Te, "pt-BR": it };
|
|
76
|
+
function ct(t) {
|
|
77
|
+
return st[t] ?? Te;
|
|
78
78
|
}
|
|
79
|
-
const
|
|
79
|
+
const ut = "#6E79D6";
|
|
80
80
|
function I(t, e) {
|
|
81
81
|
return typeof t == "boolean" ? t : e;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function J(t, e, n) {
|
|
84
84
|
return e.includes(t) ? t : n;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function dt(t) {
|
|
87
87
|
return {
|
|
88
88
|
src: typeof t.src == "string" ? t.src : "",
|
|
89
|
-
mode:
|
|
89
|
+
mode: J(t.mode, ["flip", "coverflow"], "flip"),
|
|
90
90
|
logo: G(t.logo),
|
|
91
91
|
logoLink: G(t.logoLink),
|
|
92
|
-
accentColor:
|
|
93
|
-
background:
|
|
94
|
-
backgroundColor:
|
|
92
|
+
accentColor: ce(t.accentColor) ?? ut,
|
|
93
|
+
background: J(t.background, ["color", "image", "transparent"], "color"),
|
|
94
|
+
backgroundColor: rt(t.backgroundColor),
|
|
95
95
|
backgroundImage: G(t.backgroundImage),
|
|
96
|
-
layout:
|
|
96
|
+
layout: J(t.layout, ["single", "double"], "double"),
|
|
97
97
|
fillHeight: I(t.fillHeight, !1),
|
|
98
98
|
pageShadows: I(t.pageShadows, !0),
|
|
99
99
|
rtl: I(t.rtl, !1),
|
|
100
100
|
animateInteractions: I(t.animateInteractions, !0),
|
|
101
|
-
skin:
|
|
102
|
-
language:
|
|
101
|
+
skin: J(t.skin, ["classic", "minimal", "showcase"], "classic"),
|
|
102
|
+
language: J(t.language, lt, "en"),
|
|
103
103
|
autoTransition: I(t.autoTransition, !1),
|
|
104
104
|
autoTransitionInterval: typeof t.autoTransitionInterval == "number" && t.autoTransitionInterval > 0 ? t.autoTransitionInterval : 5e3,
|
|
105
105
|
navigationControls: I(t.navigationControls, !0),
|
|
@@ -114,52 +114,52 @@ function ut(t) {
|
|
|
114
114
|
layoutToggle: I(t.layoutToggle, !0),
|
|
115
115
|
loadingImage: G(t.loadingImage),
|
|
116
116
|
loadingCaption: typeof t.loadingCaption == "string" && t.loadingCaption.length > 0 ? t.loadingCaption : null,
|
|
117
|
-
loadingColor:
|
|
117
|
+
loadingColor: ce(t.loadingColor),
|
|
118
118
|
pollInterval: typeof t.pollInterval == "number" && t.pollInterval > 0 ? t.pollInterval : 2e3,
|
|
119
119
|
className: typeof t.className == "string" ? t.className : ""
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
function
|
|
122
|
+
const ue = 5e3;
|
|
123
|
+
function Q(t) {
|
|
124
124
|
return typeof t == "string" ? t : "";
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function gt(t) {
|
|
127
127
|
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
128
128
|
return { ok: !1, error: "manifest is not an object" };
|
|
129
129
|
const e = t;
|
|
130
130
|
if (!Array.isArray(e.pages))
|
|
131
131
|
return { ok: !1, error: "manifest.pages is missing or not an array" };
|
|
132
|
-
if (e.pages.length >
|
|
132
|
+
if (e.pages.length > ue)
|
|
133
133
|
return { ok: !1, error: "manifest.pages exceeds the maximum" };
|
|
134
134
|
const n = e.total_pages, a = typeof n == "number" && Number.isFinite(n) && n >= 0 ? n : e.pages.length;
|
|
135
|
-
if (a >
|
|
135
|
+
if (a > ue)
|
|
136
136
|
return { ok: !1, error: "manifest.total_pages exceeds the maximum" };
|
|
137
|
-
const
|
|
138
|
-
for (const
|
|
139
|
-
if (
|
|
140
|
-
const s = G(
|
|
141
|
-
s &&
|
|
137
|
+
const i = [];
|
|
138
|
+
for (const f of e.pages) {
|
|
139
|
+
if (f === null || typeof f != "object") continue;
|
|
140
|
+
const s = G(f.url);
|
|
141
|
+
s && i.push(s);
|
|
142
142
|
}
|
|
143
|
-
if (
|
|
143
|
+
if (i.length === 0)
|
|
144
144
|
return { ok: !1, error: "manifest has no usable pages" };
|
|
145
|
-
const
|
|
146
|
-
fileId:
|
|
147
|
-
filename:
|
|
148
|
-
creationDate:
|
|
149
|
-
fileSize:
|
|
150
|
-
mimeType:
|
|
145
|
+
const u = e.status === "wip" ? "wip" : "done", _ = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, h = {
|
|
146
|
+
fileId: Q(_.file_id),
|
|
147
|
+
filename: Q(_.filename),
|
|
148
|
+
creationDate: Q(_.creation_date),
|
|
149
|
+
fileSize: Q(_.file_size),
|
|
150
|
+
mimeType: Q(_.mime_type)
|
|
151
151
|
};
|
|
152
152
|
return {
|
|
153
153
|
ok: !0,
|
|
154
|
-
value: { status:
|
|
154
|
+
value: { status: u, totalPages: a, pages: i, metadata: h }
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
if (!Array.isArray(t) || t.length >
|
|
157
|
+
function ft(t, e) {
|
|
158
|
+
if (!Array.isArray(t) || t.length > ue) return null;
|
|
159
159
|
const n = [];
|
|
160
|
-
for (const
|
|
161
|
-
const
|
|
162
|
-
|
|
160
|
+
for (const i of t) {
|
|
161
|
+
const u = G(i);
|
|
162
|
+
u && n.push(u);
|
|
163
163
|
}
|
|
164
164
|
return n.length === 0 ? null : {
|
|
165
165
|
status: "done",
|
|
@@ -174,70 +174,70 @@ function gt(t, e) {
|
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
const [n, a] =
|
|
177
|
+
function mt(t, e) {
|
|
178
|
+
const [n, a] = N("loading"), [i, u] = N(null), [_, h] = N(null), f = E(null);
|
|
179
179
|
return C(() => {
|
|
180
180
|
let s = !1;
|
|
181
|
-
if (a("loading"),
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
},
|
|
181
|
+
if (a("loading"), u(null), h(null), !t) return;
|
|
182
|
+
const v = () => {
|
|
183
|
+
f.current !== null && (clearTimeout(f.current), f.current = null);
|
|
184
|
+
}, k = async () => {
|
|
185
185
|
let d;
|
|
186
186
|
try {
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
189
|
-
d = await
|
|
190
|
-
} catch (
|
|
187
|
+
const l = await fetch(t);
|
|
188
|
+
if (!l.ok) throw new Error(`HTTP ${l.status}`);
|
|
189
|
+
d = await l.json();
|
|
190
|
+
} catch (l) {
|
|
191
191
|
if (s) return;
|
|
192
|
-
|
|
192
|
+
h(l instanceof Error ? l.message : "fetch failed"), a("error");
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
if (s) return;
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
198
|
-
|
|
196
|
+
const c = gt(d);
|
|
197
|
+
if (!c.ok) {
|
|
198
|
+
h(c.error), a("error");
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
c
|
|
201
|
+
u(c.value), a("ready"), c.value.status === "wip" && (f.current = setTimeout(k, e));
|
|
202
202
|
};
|
|
203
|
-
return
|
|
204
|
-
s = !0,
|
|
203
|
+
return k(), () => {
|
|
204
|
+
s = !0, v();
|
|
205
205
|
};
|
|
206
|
-
}, [t, e]), { state: n, manifest:
|
|
206
|
+
}, [t, e]), { state: n, manifest: i, error: _ };
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
const [e, n] =
|
|
208
|
+
function pt(t) {
|
|
209
|
+
const [e, n] = N(!1);
|
|
210
210
|
C(() => {
|
|
211
|
-
const
|
|
212
|
-
return document.addEventListener("fullscreenchange",
|
|
211
|
+
const i = () => n(document.fullscreenElement != null);
|
|
212
|
+
return document.addEventListener("fullscreenchange", i), () => document.removeEventListener("fullscreenchange", i);
|
|
213
213
|
}, []);
|
|
214
|
-
const a =
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
214
|
+
const a = L(async () => {
|
|
215
|
+
const i = t.current;
|
|
216
|
+
if (i)
|
|
217
217
|
try {
|
|
218
|
-
document.fullscreenElement ? await document.exitFullscreen() : await
|
|
218
|
+
document.fullscreenElement ? await document.exitFullscreen() : await i.requestFullscreen();
|
|
219
219
|
} catch {
|
|
220
220
|
}
|
|
221
221
|
}, [t]);
|
|
222
222
|
return { isFullscreen: e, toggle: a };
|
|
223
223
|
}
|
|
224
|
-
const
|
|
225
|
-
function
|
|
226
|
-
const [t, e] =
|
|
224
|
+
const ve = "(prefers-reduced-motion: reduce)";
|
|
225
|
+
function Ne() {
|
|
226
|
+
const [t, e] = N(() => {
|
|
227
227
|
var n;
|
|
228
|
-
return ((n = matchMedia == null ? void 0 : matchMedia(
|
|
228
|
+
return ((n = matchMedia == null ? void 0 : matchMedia(ve)) == null ? void 0 : n.matches) ?? !1;
|
|
229
229
|
});
|
|
230
230
|
return C(() => {
|
|
231
|
-
const n = typeof matchMedia == "function" ? matchMedia(
|
|
231
|
+
const n = typeof matchMedia == "function" ? matchMedia(ve) : void 0;
|
|
232
232
|
if (!(n != null && n.addEventListener)) return;
|
|
233
233
|
const a = () => e(n.matches);
|
|
234
234
|
return n.addEventListener("change", a), () => n.removeEventListener("change", a);
|
|
235
235
|
}, []), t;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return { onKeyDown:
|
|
239
|
-
(
|
|
240
|
-
switch (
|
|
237
|
+
function Ce({ go: t, jump: e, total: n, rtl: a }) {
|
|
238
|
+
return { onKeyDown: L(
|
|
239
|
+
(u) => {
|
|
240
|
+
switch (u.key) {
|
|
241
241
|
case "ArrowRight":
|
|
242
242
|
t(a ? -1 : 1);
|
|
243
243
|
break;
|
|
@@ -245,123 +245,123 @@ function we({ go: t, jump: e, total: n, rtl: a }) {
|
|
|
245
245
|
t(a ? 1 : -1);
|
|
246
246
|
break;
|
|
247
247
|
case "Home":
|
|
248
|
-
|
|
248
|
+
u.preventDefault(), n > 0 && e(0);
|
|
249
249
|
break;
|
|
250
250
|
case "End":
|
|
251
|
-
|
|
251
|
+
u.preventDefault(), n > 0 && e(n - 1);
|
|
252
252
|
break;
|
|
253
253
|
case " ":
|
|
254
254
|
case "Spacebar":
|
|
255
|
-
|
|
255
|
+
u.preventDefault(), t(u.shiftKey ? -1 : 1);
|
|
256
256
|
break;
|
|
257
257
|
case "PageDown":
|
|
258
|
-
|
|
258
|
+
u.preventDefault(), t(1);
|
|
259
259
|
break;
|
|
260
260
|
case "PageUp":
|
|
261
|
-
|
|
261
|
+
u.preventDefault(), t(-1);
|
|
262
262
|
break;
|
|
263
263
|
}
|
|
264
264
|
},
|
|
265
265
|
[t, e, n, a]
|
|
266
266
|
) };
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Pe(t, e) {
|
|
269
269
|
if (e <= 0) return null;
|
|
270
270
|
const n = t.trim();
|
|
271
271
|
if (!/^\d+$/.test(n)) return null;
|
|
272
272
|
const a = Number(n);
|
|
273
273
|
return Number.isFinite(a) ? Math.max(1, Math.min(e, a)) - 1 : null;
|
|
274
274
|
}
|
|
275
|
-
const
|
|
276
|
-
function
|
|
277
|
-
const [n, a] =
|
|
275
|
+
const bt = 640;
|
|
276
|
+
function ht(t, e) {
|
|
277
|
+
const [n, a] = N("auto"), [i, u] = N(null);
|
|
278
278
|
C(() => {
|
|
279
279
|
const s = t.current;
|
|
280
|
-
if (!s || (s.clientWidth > 0 &&
|
|
281
|
-
const
|
|
282
|
-
var
|
|
283
|
-
const d = (
|
|
284
|
-
typeof d == "number" && d > 0 &&
|
|
280
|
+
if (!s || (s.clientWidth > 0 && u(s.clientWidth), typeof ResizeObserver > "u")) return;
|
|
281
|
+
const v = new ResizeObserver((k) => {
|
|
282
|
+
var c;
|
|
283
|
+
const d = (c = k[0]) == null ? void 0 : c.contentRect.width;
|
|
284
|
+
typeof d == "number" && d > 0 && u(d);
|
|
285
285
|
});
|
|
286
|
-
return
|
|
286
|
+
return v.observe(s), () => v.disconnect();
|
|
287
287
|
}, [t]);
|
|
288
|
-
const
|
|
289
|
-
a(
|
|
290
|
-
}, [
|
|
291
|
-
return { layout:
|
|
288
|
+
const _ = i != null && i < bt ? "single" : e, h = n === "auto" ? _ : n, f = L(() => {
|
|
289
|
+
a(h === "single" ? "double" : "single");
|
|
290
|
+
}, [h]);
|
|
291
|
+
return { layout: h, toggle: f };
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function ge(t, e) {
|
|
294
294
|
return t <= 0 ? 0 : e === "single" ? t : 1 + Math.ceil((t - 1) / 2);
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function _t(t, e) {
|
|
297
297
|
return e === "single" ? t : t <= 0 ? 0 : Math.floor((t - 1) / 2) + 1;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function oe(t, e, n) {
|
|
300
300
|
if (e <= 0) return { left: -1, right: -1 };
|
|
301
301
|
if (n === "single")
|
|
302
302
|
return { left: -1, right: t >= 0 && t < e ? t : -1 };
|
|
303
303
|
if (t <= 0)
|
|
304
304
|
return { left: -1, right: 0 };
|
|
305
|
-
const a = 2 * t - 1,
|
|
306
|
-
return { left: a < e ? a : -1, right:
|
|
305
|
+
const a = 2 * t - 1, i = 2 * t;
|
|
306
|
+
return { left: a < e ? a : -1, right: i < e ? i : -1 };
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
const { left: a, right:
|
|
310
|
-
return a >= 0 &&
|
|
308
|
+
function de(t, e, n) {
|
|
309
|
+
const { left: a, right: i } = oe(t, e, n), u = [];
|
|
310
|
+
return a >= 0 && u.push(a), i >= 0 && u.push(i), u;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
const a =
|
|
312
|
+
function ne(t, e, n) {
|
|
313
|
+
const a = ge(e, n) - 1;
|
|
314
314
|
return t < 0 ? 0 : t > a ? a : t;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function kt(t) {
|
|
317
317
|
const {
|
|
318
318
|
strings: e,
|
|
319
319
|
label: n,
|
|
320
320
|
progress: a,
|
|
321
|
-
zoom:
|
|
322
|
-
minZoom:
|
|
323
|
-
maxZoom:
|
|
324
|
-
total:
|
|
325
|
-
currentPage:
|
|
321
|
+
zoom: i,
|
|
322
|
+
minZoom: u,
|
|
323
|
+
maxZoom: _,
|
|
324
|
+
total: h,
|
|
325
|
+
currentPage: f,
|
|
326
326
|
layout: s,
|
|
327
|
-
thumbsOpen:
|
|
328
|
-
isFullscreen:
|
|
327
|
+
thumbsOpen: v,
|
|
328
|
+
isFullscreen: k,
|
|
329
329
|
downloadUrl: d,
|
|
330
|
-
show:
|
|
331
|
-
onZoomIn:
|
|
332
|
-
onZoomOut:
|
|
333
|
-
onZoomSet:
|
|
334
|
-
onJump:
|
|
335
|
-
onRotate:
|
|
330
|
+
show: c,
|
|
331
|
+
onZoomIn: l,
|
|
332
|
+
onZoomOut: D,
|
|
333
|
+
onZoomSet: O,
|
|
334
|
+
onJump: A,
|
|
335
|
+
onRotate: R,
|
|
336
336
|
onToggleLayout: x,
|
|
337
|
-
onToggleThumbs:
|
|
338
|
-
onToggleFullscreen:
|
|
339
|
-
onAbout:
|
|
340
|
-
} = t, [
|
|
341
|
-
C(() =>
|
|
342
|
-
const
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
|
|
337
|
+
onToggleThumbs: M,
|
|
338
|
+
onToggleFullscreen: Z,
|
|
339
|
+
onAbout: j
|
|
340
|
+
} = t, [F, $] = N(String(f));
|
|
341
|
+
C(() => $(String(f)), [f]);
|
|
342
|
+
const B = () => {
|
|
343
|
+
const P = Pe(F, h);
|
|
344
|
+
if (P === null) {
|
|
345
|
+
$(String(f));
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
A(P), $(String(P + 1));
|
|
349
349
|
};
|
|
350
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ y("div", { className: "peeek__toolbar", children: [
|
|
351
351
|
/* @__PURE__ */ o("span", { className: "peeek__label", children: n }),
|
|
352
|
-
|
|
353
|
-
|
|
352
|
+
c.bar && /* @__PURE__ */ o("div", { className: "peeek__scrubber", "aria-hidden": !0, children: /* @__PURE__ */ o("div", { className: "peeek__scrubber-fill", style: { width: `${a}%` } }) }),
|
|
353
|
+
c.goto && /* @__PURE__ */ o(
|
|
354
354
|
"input",
|
|
355
355
|
{
|
|
356
356
|
className: "peeek__goto",
|
|
357
357
|
type: "text",
|
|
358
358
|
inputMode: "numeric",
|
|
359
359
|
"aria-label": e.goToPage,
|
|
360
|
-
value:
|
|
361
|
-
onChange: (
|
|
362
|
-
onBlur:
|
|
363
|
-
onKeyDown: (
|
|
364
|
-
|
|
360
|
+
value: F,
|
|
361
|
+
onChange: (P) => $(P.target.value),
|
|
362
|
+
onBlur: B,
|
|
363
|
+
onKeyDown: (P) => {
|
|
364
|
+
P.key === "Enter" && (P.preventDefault(), B());
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
),
|
|
@@ -371,8 +371,8 @@ function _t(t) {
|
|
|
371
371
|
type: "button",
|
|
372
372
|
className: "peeek__btn",
|
|
373
373
|
"aria-label": e.zoomOut,
|
|
374
|
-
disabled:
|
|
375
|
-
onClick:
|
|
374
|
+
disabled: i <= u,
|
|
375
|
+
onClick: D,
|
|
376
376
|
children: "−"
|
|
377
377
|
}
|
|
378
378
|
),
|
|
@@ -381,11 +381,11 @@ function _t(t) {
|
|
|
381
381
|
{
|
|
382
382
|
type: "range",
|
|
383
383
|
"aria-label": e.zoom,
|
|
384
|
-
min:
|
|
385
|
-
max:
|
|
384
|
+
min: u,
|
|
385
|
+
max: _,
|
|
386
386
|
step: 0.25,
|
|
387
|
-
value:
|
|
388
|
-
onChange: (
|
|
387
|
+
value: i,
|
|
388
|
+
onChange: (P) => O(Number(P.target.value))
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
391
|
/* @__PURE__ */ o(
|
|
@@ -394,22 +394,22 @@ function _t(t) {
|
|
|
394
394
|
type: "button",
|
|
395
395
|
className: "peeek__btn",
|
|
396
396
|
"aria-label": e.zoomIn,
|
|
397
|
-
disabled:
|
|
398
|
-
onClick:
|
|
397
|
+
disabled: i >= _,
|
|
398
|
+
onClick: l,
|
|
399
399
|
children: "+"
|
|
400
400
|
}
|
|
401
401
|
),
|
|
402
|
-
|
|
402
|
+
c.rotate && /* @__PURE__ */ o(
|
|
403
403
|
"button",
|
|
404
404
|
{
|
|
405
405
|
type: "button",
|
|
406
406
|
className: "peeek__btn",
|
|
407
407
|
"aria-label": e.rotate,
|
|
408
|
-
onClick:
|
|
408
|
+
onClick: R,
|
|
409
409
|
children: "⟳"
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
|
-
|
|
412
|
+
c.layoutToggle && /* @__PURE__ */ o(
|
|
413
413
|
"button",
|
|
414
414
|
{
|
|
415
415
|
type: "button",
|
|
@@ -420,14 +420,14 @@ function _t(t) {
|
|
|
420
420
|
children: s === "single" ? "▭" : "▥"
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
|
-
|
|
423
|
+
c.thumbnails && /* @__PURE__ */ o(
|
|
424
424
|
"button",
|
|
425
425
|
{
|
|
426
426
|
type: "button",
|
|
427
|
-
className: `peeek__btn${
|
|
427
|
+
className: `peeek__btn${v ? " peeek__btn--active" : ""}`,
|
|
428
428
|
"aria-label": e.thumbnails,
|
|
429
|
-
"aria-pressed":
|
|
430
|
-
onClick:
|
|
429
|
+
"aria-pressed": v,
|
|
430
|
+
onClick: M,
|
|
431
431
|
children: "▦"
|
|
432
432
|
}
|
|
433
433
|
),
|
|
@@ -443,160 +443,171 @@ function _t(t) {
|
|
|
443
443
|
children: "↓"
|
|
444
444
|
}
|
|
445
445
|
),
|
|
446
|
-
|
|
446
|
+
c.fullscreen && /* @__PURE__ */ o(
|
|
447
447
|
"button",
|
|
448
448
|
{
|
|
449
449
|
type: "button",
|
|
450
|
-
className: `peeek__btn${
|
|
450
|
+
className: `peeek__btn${k ? " peeek__btn--active" : ""}`,
|
|
451
451
|
"aria-label": e.fullscreen,
|
|
452
|
-
"aria-pressed":
|
|
453
|
-
onClick:
|
|
452
|
+
"aria-pressed": k,
|
|
453
|
+
onClick: Z,
|
|
454
454
|
children: "⛶"
|
|
455
455
|
}
|
|
456
456
|
),
|
|
457
|
-
|
|
457
|
+
c.about && /* @__PURE__ */ o(
|
|
458
458
|
"button",
|
|
459
459
|
{
|
|
460
460
|
type: "button",
|
|
461
461
|
className: "peeek__btn",
|
|
462
462
|
"aria-label": e.about,
|
|
463
|
-
onClick:
|
|
463
|
+
onClick: j,
|
|
464
464
|
children: "?"
|
|
465
465
|
}
|
|
466
466
|
)
|
|
467
467
|
] });
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
const
|
|
471
|
-
return /* @__PURE__ */ o("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length:
|
|
472
|
-
const
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
|
|
475
|
-
let
|
|
476
|
-
return
|
|
469
|
+
function yt({ pages: t, layout: e, rtl: n, activePages: a, onJump: i }) {
|
|
470
|
+
const u = t.length, _ = new Set(a), h = ge(u, e);
|
|
471
|
+
return /* @__PURE__ */ o("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length: h }, (f, s) => {
|
|
472
|
+
const v = de(s, u, e), k = v.length === 2;
|
|
473
|
+
return /* @__PURE__ */ y("div", { className: "peeek__thumb-group", children: [
|
|
474
|
+
v.map((d, c) => {
|
|
475
|
+
let l = "";
|
|
476
|
+
return k && (l = (n ? c === 1 : c === 0) ? " peeek__thumb--flat-right" : " peeek__thumb--flat-left"), /* @__PURE__ */ o(
|
|
477
477
|
"button",
|
|
478
478
|
{
|
|
479
479
|
type: "button",
|
|
480
480
|
"aria-label": `Go to page ${d + 1}`,
|
|
481
|
-
"aria-current":
|
|
482
|
-
className: `peeek__thumb${
|
|
483
|
-
onClick: () =>
|
|
481
|
+
"aria-current": _.has(d),
|
|
482
|
+
className: `peeek__thumb${_.has(d) ? " peeek__thumb--active" : ""}${l}`,
|
|
483
|
+
onClick: () => i(d),
|
|
484
484
|
children: /* @__PURE__ */ o("img", { src: t[d], alt: "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
485
485
|
},
|
|
486
486
|
d
|
|
487
487
|
);
|
|
488
488
|
}),
|
|
489
|
-
/* @__PURE__ */ o("span", { className: "peeek__thumb-badge", "aria-hidden": !0, children:
|
|
489
|
+
/* @__PURE__ */ o("span", { className: "peeek__thumb-badge", "aria-hidden": !0, children: v.map((d) => d + 1).join("-") })
|
|
490
490
|
] }, s);
|
|
491
491
|
}) });
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
function
|
|
493
|
+
const ee = 1, ae = 2, we = 0.25;
|
|
494
|
+
function vt(t) {
|
|
495
495
|
const {
|
|
496
496
|
pages: e,
|
|
497
497
|
strings: n,
|
|
498
498
|
layout: a,
|
|
499
|
-
rtl:
|
|
500
|
-
pageShadows:
|
|
501
|
-
animateInteractions:
|
|
502
|
-
autoTransition:
|
|
503
|
-
autoTransitionInterval:
|
|
499
|
+
rtl: i,
|
|
500
|
+
pageShadows: u,
|
|
501
|
+
animateInteractions: _,
|
|
502
|
+
autoTransition: h,
|
|
503
|
+
autoTransitionInterval: f,
|
|
504
504
|
show: s,
|
|
505
|
-
downloadUrl:
|
|
506
|
-
isFullscreen:
|
|
505
|
+
downloadUrl: v,
|
|
506
|
+
isFullscreen: k,
|
|
507
507
|
onToggleFullscreen: d,
|
|
508
|
-
onAbout:
|
|
509
|
-
} = t,
|
|
508
|
+
onAbout: c
|
|
509
|
+
} = t, l = e.length, O = Ne() || !_, [A, R] = N(0), [x, M] = N(1), [Z, j] = N(!1), [F, $] = N({ x: 0, y: 0 }), [B, P] = N(!1), [X, m] = N(0), p = E(null), z = E(null), { layout: b, toggle: K } = ht(z, a), re = ge(l, b), [w, fe] = N(null), me = E(null), [pe, Ie] = N(0.707);
|
|
510
510
|
C(() => {
|
|
511
511
|
if (!e[0]) return;
|
|
512
512
|
const r = new globalThis.Image();
|
|
513
513
|
r.onload = () => {
|
|
514
|
-
r.naturalWidth && r.naturalHeight &&
|
|
514
|
+
r.naturalWidth && r.naturalHeight && Ie(r.naturalWidth / r.naturalHeight);
|
|
515
515
|
}, r.src = e[0];
|
|
516
516
|
}, [e]);
|
|
517
|
-
const
|
|
517
|
+
const S = ne(A, l, b), xe = S <= 0, le = S >= re - 1, be = E(/* @__PURE__ */ new Set());
|
|
518
|
+
C(() => {
|
|
519
|
+
const r = [S - 1, S + 1, S + 2].map((g) => ne(g, l, b)).flatMap((g) => de(g, l, b)).filter((g) => g >= 0);
|
|
520
|
+
for (const g of r) {
|
|
521
|
+
const T = e[g];
|
|
522
|
+
if (!T || be.current.has(T)) continue;
|
|
523
|
+
be.current.add(T);
|
|
524
|
+
const q = new globalThis.Image();
|
|
525
|
+
q.src = T;
|
|
526
|
+
}
|
|
527
|
+
}, [S, l, b, e]);
|
|
528
|
+
const W = L(
|
|
518
529
|
(r) => {
|
|
519
|
-
w ||
|
|
520
|
-
const
|
|
521
|
-
return
|
|
530
|
+
w || R((g) => {
|
|
531
|
+
const T = ne(g + r, l, b);
|
|
532
|
+
return T === g ? g : O ? T : (fe({ dir: r, to: T }), g);
|
|
522
533
|
});
|
|
523
534
|
},
|
|
524
|
-
[
|
|
525
|
-
),
|
|
526
|
-
|
|
535
|
+
[l, b, O, w]
|
|
536
|
+
), ze = L(() => {
|
|
537
|
+
fe((r) => (r && R(r.to), null));
|
|
527
538
|
}, []);
|
|
528
539
|
C(() => {
|
|
529
540
|
if (!w) return;
|
|
530
|
-
const r =
|
|
541
|
+
const r = me.current;
|
|
531
542
|
if (!r) return;
|
|
532
543
|
r.style.transform = "rotateY(0deg)";
|
|
533
|
-
let
|
|
534
|
-
const
|
|
535
|
-
|
|
544
|
+
let g = 0;
|
|
545
|
+
const T = requestAnimationFrame(() => {
|
|
546
|
+
g = requestAnimationFrame(() => {
|
|
536
547
|
r.style.transform = `rotateY(${w.dir === 1 ? -180 : 180}deg)`;
|
|
537
548
|
});
|
|
538
549
|
});
|
|
539
550
|
return () => {
|
|
540
|
-
cancelAnimationFrame(
|
|
551
|
+
cancelAnimationFrame(T), cancelAnimationFrame(g);
|
|
541
552
|
};
|
|
542
553
|
}, [w]);
|
|
543
|
-
const
|
|
554
|
+
const ie = L(
|
|
544
555
|
(r) => {
|
|
545
|
-
|
|
556
|
+
R(ne(_t(r, b), l, b));
|
|
546
557
|
},
|
|
547
|
-
[
|
|
548
|
-
), { onKeyDown:
|
|
558
|
+
[l, b]
|
|
559
|
+
), { onKeyDown: Se } = Ce({ go: W, jump: ie, total: l, rtl: i });
|
|
549
560
|
C(() => {
|
|
550
|
-
if (!
|
|
551
|
-
const r = setTimeout(() =>
|
|
561
|
+
if (!h || le) return;
|
|
562
|
+
const r = setTimeout(() => W(1), f);
|
|
552
563
|
return () => clearTimeout(r);
|
|
553
|
-
}, [
|
|
554
|
-
const
|
|
555
|
-
w ||
|
|
556
|
-
}, Fe = () =>
|
|
557
|
-
const
|
|
558
|
-
if (!
|
|
559
|
-
const
|
|
560
|
-
return { x: Math.max(-
|
|
564
|
+
}, [h, f, le, S, W]);
|
|
565
|
+
const $e = () => M((r) => Math.min(ae, r + we)), Me = () => M((r) => Math.max(ee, r - we)), Ae = () => {
|
|
566
|
+
w || M((r) => r > ee ? ee : ae);
|
|
567
|
+
}, Fe = () => m((r) => (r + 90) % 360), Ee = X === 90 || X === 270 ? pe : 1, se = L((r, g, T) => {
|
|
568
|
+
const q = z.current;
|
|
569
|
+
if (!q || T <= 1) return { x: 0, y: 0 };
|
|
570
|
+
const ke = (T - 1) * q.clientWidth / 2, ye = (T - 1) * q.clientHeight / 2;
|
|
571
|
+
return { x: Math.max(-ke, Math.min(ke, r)), y: Math.max(-ye, Math.min(ye, g)) };
|
|
561
572
|
}, []);
|
|
562
|
-
C(() =>
|
|
563
|
-
const
|
|
564
|
-
var
|
|
565
|
-
x <= 1 || (
|
|
566
|
-
},
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
},
|
|
570
|
-
if (
|
|
571
|
-
|
|
573
|
+
C(() => $((r) => se(r.x, r.y, x)), [x, se]), C(() => $({ x: 0, y: 0 }), [S]);
|
|
574
|
+
const Le = (r) => {
|
|
575
|
+
var g, T;
|
|
576
|
+
x <= 1 || (p.current = { x: r.clientX, y: r.clientY, px: F.x, py: F.y }, P(!0), (T = (g = r.currentTarget).setPointerCapture) == null || T.call(g, r.pointerId));
|
|
577
|
+
}, De = (r) => {
|
|
578
|
+
const g = p.current;
|
|
579
|
+
g && $(se(g.px + (r.clientX - g.x), g.py + (r.clientY - g.y), x));
|
|
580
|
+
}, he = (r) => {
|
|
581
|
+
if (p.current) {
|
|
582
|
+
p.current = null, P(!1);
|
|
572
583
|
try {
|
|
573
584
|
r.currentTarget.releasePointerCapture(r.pointerId);
|
|
574
585
|
} catch {
|
|
575
586
|
}
|
|
576
587
|
}
|
|
577
|
-
},
|
|
578
|
-
["left",
|
|
579
|
-
["right",
|
|
588
|
+
}, Y = de(S, l, b), te = Y[0] ?? 0, Oe = b === "double" && Y.length === 2 ? `${Y[0] + 1} - ${Y[1] + 1} / ${l}` : `${te + 1} / ${l}`, Re = re <= 1 ? 100 : S / (re - 1) * 100, Be = n.prev, Ue = n.next, Ze = w ? w.to : S, H = oe(Ze, l, b), He = H.left < 0 && H.right >= 0, Ge = H.left >= 0 && H.right < 0, je = H.left >= 0 && H.right >= 0, Ve = He ? "-25%" : Ge ? "25%" : "0%", U = oe(S, l, b), V = w ? oe(w.to, l, b) : U, Xe = w ? w.dir === 1 ? U.right >= 0 ? U.right : U.left : U.left >= 0 ? U.left : U.right : te, Ke = w ? w.dir === 1 ? V.left >= 0 ? V.left : V.right : V.right >= 0 ? V.right : V.left : te, We = w ? w.dir === 1 ? "left" : "right" : null, _e = (r) => r === We ? U[r] : H[r], Ye = [
|
|
589
|
+
["left", _e("left")],
|
|
590
|
+
["right", _e("right")]
|
|
580
591
|
];
|
|
581
|
-
return /* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ y(qe, { children: [
|
|
593
|
+
/* @__PURE__ */ y(
|
|
583
594
|
"div",
|
|
584
595
|
{
|
|
585
|
-
ref:
|
|
596
|
+
ref: z,
|
|
586
597
|
className: "peeek__stage",
|
|
587
|
-
"data-layout":
|
|
598
|
+
"data-layout": b,
|
|
588
599
|
tabIndex: 0,
|
|
589
|
-
onKeyDown:
|
|
590
|
-
style: { "--peeek-aspect": `${
|
|
600
|
+
onKeyDown: Se,
|
|
601
|
+
style: { "--peeek-aspect": `${pe}` },
|
|
591
602
|
children: [
|
|
592
603
|
s.arrows && /* @__PURE__ */ o(
|
|
593
604
|
"button",
|
|
594
605
|
{
|
|
595
606
|
type: "button",
|
|
596
607
|
className: "peeek__arrow peeek__arrow--prev",
|
|
597
|
-
"aria-label":
|
|
598
|
-
disabled:
|
|
599
|
-
onClick: () =>
|
|
608
|
+
"aria-label": Be,
|
|
609
|
+
disabled: xe,
|
|
610
|
+
onClick: () => W(-1),
|
|
600
611
|
children: "‹"
|
|
601
612
|
}
|
|
602
613
|
),
|
|
@@ -605,49 +616,49 @@ function yt(t) {
|
|
|
605
616
|
{
|
|
606
617
|
className: `peeek__zoom${x > 1 ? " peeek__zoom--pannable" : ""}`,
|
|
607
618
|
style: {
|
|
608
|
-
transform: `translate(${
|
|
609
|
-
transition:
|
|
619
|
+
transform: `translate(${F.x}px, ${F.y}px) scale(${x * Ee}) rotate(${X}deg)`,
|
|
620
|
+
transition: O || B ? "none" : void 0
|
|
610
621
|
},
|
|
611
622
|
onDoubleClick: Ae,
|
|
612
|
-
onPointerDown:
|
|
613
|
-
onPointerMove:
|
|
614
|
-
onPointerUp:
|
|
615
|
-
onPointerCancel:
|
|
616
|
-
children: /* @__PURE__ */
|
|
623
|
+
onPointerDown: Le,
|
|
624
|
+
onPointerMove: De,
|
|
625
|
+
onPointerUp: he,
|
|
626
|
+
onPointerCancel: he,
|
|
627
|
+
children: /* @__PURE__ */ y(
|
|
617
628
|
"div",
|
|
618
629
|
{
|
|
619
|
-
className: `peeek__spread${
|
|
620
|
-
style: { transform: `translateX(${
|
|
630
|
+
className: `peeek__spread${u ? " peeek--shadows" : ""}${je ? " peeek__spread--pair" : ""}`,
|
|
631
|
+
style: { transform: `translateX(${Ve})` },
|
|
621
632
|
children: [
|
|
622
|
-
|
|
623
|
-
const
|
|
633
|
+
Ye.map(([r, g]) => {
|
|
634
|
+
const T = g >= 0 && s.fullscreen && !k && !w && x === 1;
|
|
624
635
|
return /* @__PURE__ */ o(
|
|
625
636
|
"div",
|
|
626
637
|
{
|
|
627
|
-
className: `peeek__page peeek__page--${r}${
|
|
628
|
-
children:
|
|
638
|
+
className: `peeek__page peeek__page--${r}${g < 0 ? " peeek__page--empty" : ""}`,
|
|
639
|
+
children: g >= 0 && (T ? /* @__PURE__ */ o(
|
|
629
640
|
"button",
|
|
630
641
|
{
|
|
631
642
|
type: "button",
|
|
632
643
|
className: "peeek__page-btn",
|
|
633
644
|
"aria-label": n.openFullscreen,
|
|
634
645
|
onClick: d,
|
|
635
|
-
children: /* @__PURE__ */ o("img", { src: e[
|
|
646
|
+
children: /* @__PURE__ */ o("img", { src: e[g], alt: `Page ${g + 1}`, loading: "lazy", referrerPolicy: "no-referrer" })
|
|
636
647
|
}
|
|
637
|
-
) : /* @__PURE__ */ o("img", { src: e[
|
|
648
|
+
) : /* @__PURE__ */ o("img", { src: e[g], alt: `Page ${g + 1}`, loading: "lazy", referrerPolicy: "no-referrer" }))
|
|
638
649
|
},
|
|
639
650
|
r
|
|
640
651
|
);
|
|
641
652
|
}),
|
|
642
|
-
w && /* @__PURE__ */
|
|
653
|
+
w && /* @__PURE__ */ y(
|
|
643
654
|
"div",
|
|
644
655
|
{
|
|
645
|
-
ref:
|
|
656
|
+
ref: me,
|
|
646
657
|
className: `peeek__leaf peeek__leaf--${w.dir === 1 ? "fwd" : "back"}`,
|
|
647
|
-
onTransitionEnd:
|
|
658
|
+
onTransitionEnd: ze,
|
|
648
659
|
children: [
|
|
649
|
-
/* @__PURE__ */ o("div", { className: "peeek__leaf-face peeek__leaf-face--front", children: /* @__PURE__ */ o("img", { src: e[
|
|
650
|
-
/* @__PURE__ */ o("div", { className: "peeek__leaf-face peeek__leaf-face--back", children: /* @__PURE__ */ o("img", { src: e[
|
|
660
|
+
/* @__PURE__ */ o("div", { className: "peeek__leaf-face peeek__leaf-face--front", children: /* @__PURE__ */ o("img", { src: e[Xe], alt: "", referrerPolicy: "no-referrer" }) }),
|
|
661
|
+
/* @__PURE__ */ o("div", { className: "peeek__leaf-face peeek__leaf-face--back", children: /* @__PURE__ */ o("img", { src: e[Ke], alt: "", referrerPolicy: "no-referrer" }) })
|
|
651
662
|
]
|
|
652
663
|
}
|
|
653
664
|
)
|
|
@@ -661,9 +672,9 @@ function yt(t) {
|
|
|
661
672
|
{
|
|
662
673
|
type: "button",
|
|
663
674
|
className: "peeek__arrow peeek__arrow--next",
|
|
664
|
-
"aria-label":
|
|
665
|
-
disabled:
|
|
666
|
-
onClick: () =>
|
|
675
|
+
"aria-label": Ue,
|
|
676
|
+
disabled: le,
|
|
677
|
+
onClick: () => W(1),
|
|
667
678
|
children: "›"
|
|
668
679
|
}
|
|
669
680
|
)
|
|
@@ -671,20 +682,20 @@ function yt(t) {
|
|
|
671
682
|
}
|
|
672
683
|
),
|
|
673
684
|
s.toolbar && /* @__PURE__ */ o(
|
|
674
|
-
|
|
685
|
+
kt,
|
|
675
686
|
{
|
|
676
687
|
strings: n,
|
|
677
|
-
label:
|
|
678
|
-
progress:
|
|
688
|
+
label: Oe,
|
|
689
|
+
progress: Re,
|
|
679
690
|
zoom: x,
|
|
680
|
-
minZoom:
|
|
681
|
-
maxZoom:
|
|
682
|
-
total:
|
|
683
|
-
currentPage:
|
|
684
|
-
layout:
|
|
685
|
-
thumbsOpen:
|
|
686
|
-
isFullscreen:
|
|
687
|
-
downloadUrl:
|
|
691
|
+
minZoom: ee,
|
|
692
|
+
maxZoom: ae,
|
|
693
|
+
total: l,
|
|
694
|
+
currentPage: te + 1,
|
|
695
|
+
layout: b,
|
|
696
|
+
thumbsOpen: Z,
|
|
697
|
+
isFullscreen: k,
|
|
698
|
+
downloadUrl: v,
|
|
688
699
|
show: {
|
|
689
700
|
bar: s.bar,
|
|
690
701
|
fullscreen: s.fullscreen,
|
|
@@ -694,21 +705,21 @@ function yt(t) {
|
|
|
694
705
|
rotate: s.rotate,
|
|
695
706
|
layoutToggle: s.layoutToggle
|
|
696
707
|
},
|
|
697
|
-
onZoomIn:
|
|
698
|
-
onZoomOut:
|
|
699
|
-
onZoomSet: (r) =>
|
|
700
|
-
onJump:
|
|
708
|
+
onZoomIn: $e,
|
|
709
|
+
onZoomOut: Me,
|
|
710
|
+
onZoomSet: (r) => M(Math.min(ae, Math.max(ee, r))),
|
|
711
|
+
onJump: ie,
|
|
701
712
|
onRotate: Fe,
|
|
702
|
-
onToggleLayout:
|
|
703
|
-
onToggleThumbs: () =>
|
|
713
|
+
onToggleLayout: K,
|
|
714
|
+
onToggleThumbs: () => j((r) => !r),
|
|
704
715
|
onToggleFullscreen: d,
|
|
705
|
-
onAbout:
|
|
716
|
+
onAbout: c
|
|
706
717
|
}
|
|
707
718
|
),
|
|
708
|
-
s.overview &&
|
|
719
|
+
s.overview && Z && /* @__PURE__ */ o(yt, { pages: e, layout: b, rtl: i, activePages: Y, onJump: ie })
|
|
709
720
|
] });
|
|
710
721
|
}
|
|
711
|
-
function
|
|
722
|
+
function wt(t, e) {
|
|
712
723
|
const n = e.toLowerCase();
|
|
713
724
|
if (n.includes("pdf")) return "PDF";
|
|
714
725
|
if (n.includes("wordprocessingml")) return "DOCX";
|
|
@@ -716,7 +727,7 @@ function vt(t, e) {
|
|
|
716
727
|
const a = t.toLowerCase().split(".").pop() ?? "";
|
|
717
728
|
return a ? a.toUpperCase().slice(0, 4) : "FILE";
|
|
718
729
|
}
|
|
719
|
-
function
|
|
730
|
+
function Tt(t, e) {
|
|
720
731
|
if (t === 0) return { transform: "translateX(0) scale(1)", zIndex: 30, opacity: 1 };
|
|
721
732
|
const n = t < 0 ? -1 : 1, a = e ? -1 : 1;
|
|
722
733
|
return {
|
|
@@ -725,60 +736,70 @@ function wt(t, e) {
|
|
|
725
736
|
opacity: 0.55
|
|
726
737
|
};
|
|
727
738
|
}
|
|
728
|
-
function
|
|
739
|
+
function Nt(t) {
|
|
729
740
|
const {
|
|
730
741
|
pages: e,
|
|
731
742
|
strings: n,
|
|
732
743
|
filename: a,
|
|
733
|
-
mimeType:
|
|
734
|
-
rtl:
|
|
735
|
-
autoTransition:
|
|
736
|
-
autoTransitionInterval:
|
|
737
|
-
downloadUrl:
|
|
744
|
+
mimeType: i,
|
|
745
|
+
rtl: u,
|
|
746
|
+
autoTransition: _,
|
|
747
|
+
autoTransitionInterval: h,
|
|
748
|
+
downloadUrl: f,
|
|
738
749
|
isFullscreen: s,
|
|
739
|
-
onToggleFullscreen:
|
|
740
|
-
onAbout:
|
|
750
|
+
onToggleFullscreen: v,
|
|
751
|
+
onAbout: k,
|
|
741
752
|
show: d
|
|
742
|
-
} = t,
|
|
743
|
-
(
|
|
744
|
-
[
|
|
745
|
-
),
|
|
746
|
-
(
|
|
747
|
-
[
|
|
748
|
-
), x =
|
|
753
|
+
} = t, c = e.length, [l, D] = N(0), O = Ne(), A = L(
|
|
754
|
+
(m) => D((p) => Math.max(0, Math.min(c - 1, p + m))),
|
|
755
|
+
[c]
|
|
756
|
+
), R = L(
|
|
757
|
+
(m) => D(Math.max(0, Math.min(c - 1, m))),
|
|
758
|
+
[c]
|
|
759
|
+
), x = l <= 0, M = l >= c - 1, Z = E(/* @__PURE__ */ new Set());
|
|
760
|
+
C(() => {
|
|
761
|
+
for (const m of [l - 2, l - 1, l + 1, l + 2]) {
|
|
762
|
+
const p = m >= 0 && m < c ? e[m] : void 0;
|
|
763
|
+
if (!p || Z.current.has(p)) continue;
|
|
764
|
+
Z.current.add(p);
|
|
765
|
+
const z = new globalThis.Image();
|
|
766
|
+
z.src = p;
|
|
767
|
+
}
|
|
768
|
+
}, [l, c, e]);
|
|
769
|
+
const j = E([]);
|
|
749
770
|
C(() => {
|
|
750
|
-
var
|
|
751
|
-
(
|
|
752
|
-
}, [
|
|
753
|
-
if (!
|
|
754
|
-
const
|
|
755
|
-
return () => clearTimeout(
|
|
756
|
-
}, [
|
|
757
|
-
const { onKeyDown:
|
|
758
|
-
C(() =>
|
|
759
|
-
const
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
762
|
-
|
|
771
|
+
var m, p;
|
|
772
|
+
(p = (m = j.current[l]) == null ? void 0 : m.scrollIntoView) == null || p.call(m, { behavior: "smooth", inline: "center", block: "nearest" });
|
|
773
|
+
}, [l]), C(() => {
|
|
774
|
+
if (!_ || O || M) return;
|
|
775
|
+
const m = setTimeout(() => A(1), h);
|
|
776
|
+
return () => clearTimeout(m);
|
|
777
|
+
}, [_, h, O, M, l, A]);
|
|
778
|
+
const { onKeyDown: F } = Ce({ go: A, jump: R, total: c, rtl: u }), [$, B] = N(String(l + 1));
|
|
779
|
+
C(() => B(String(l + 1)), [l]);
|
|
780
|
+
const P = () => {
|
|
781
|
+
const m = Pe($, c);
|
|
782
|
+
if (m === null) {
|
|
783
|
+
B(String(l + 1));
|
|
763
784
|
return;
|
|
764
785
|
}
|
|
765
|
-
|
|
766
|
-
},
|
|
767
|
-
return /* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */ o("span", { className: "peeek__cf-badge", children:
|
|
770
|
-
/* @__PURE__ */
|
|
786
|
+
R(m);
|
|
787
|
+
}, X = wt(a, i);
|
|
788
|
+
return /* @__PURE__ */ y("div", { className: "peeek__cf", children: [
|
|
789
|
+
/* @__PURE__ */ y("div", { className: "peeek__cf-header", children: [
|
|
790
|
+
/* @__PURE__ */ o("span", { className: "peeek__cf-badge", children: X }),
|
|
791
|
+
/* @__PURE__ */ y("div", { className: "peeek__cf-meta", children: [
|
|
771
792
|
/* @__PURE__ */ o("span", { className: "peeek__cf-name", children: a }),
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
|
|
793
|
+
/* @__PURE__ */ y("span", { className: "peeek__cf-count", children: [
|
|
794
|
+
c,
|
|
774
795
|
" ",
|
|
775
|
-
|
|
796
|
+
c === 1 ? n.page : n.pages
|
|
776
797
|
] })
|
|
777
798
|
] }),
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
|
|
799
|
+
/* @__PURE__ */ y("span", { className: "peeek__cf-indicator", children: [
|
|
800
|
+
l + 1,
|
|
780
801
|
" / ",
|
|
781
|
-
|
|
802
|
+
c
|
|
782
803
|
] }),
|
|
783
804
|
d.goto && /* @__PURE__ */ o(
|
|
784
805
|
"input",
|
|
@@ -787,19 +808,19 @@ function Tt(t) {
|
|
|
787
808
|
type: "text",
|
|
788
809
|
inputMode: "numeric",
|
|
789
810
|
"aria-label": n.goToPage,
|
|
790
|
-
value:
|
|
791
|
-
onChange: (
|
|
792
|
-
onBlur:
|
|
793
|
-
onKeyDown: (
|
|
794
|
-
|
|
811
|
+
value: $,
|
|
812
|
+
onChange: (m) => B(m.target.value),
|
|
813
|
+
onBlur: P,
|
|
814
|
+
onKeyDown: (m) => {
|
|
815
|
+
m.key === "Enter" && (m.preventDefault(), P());
|
|
795
816
|
}
|
|
796
817
|
}
|
|
797
818
|
),
|
|
798
|
-
|
|
819
|
+
f && /* @__PURE__ */ o(
|
|
799
820
|
"a",
|
|
800
821
|
{
|
|
801
822
|
className: "peeek__btn",
|
|
802
|
-
href:
|
|
823
|
+
href: f,
|
|
803
824
|
"aria-label": n.download,
|
|
804
825
|
target: "_blank",
|
|
805
826
|
rel: "noopener noreferrer",
|
|
@@ -814,7 +835,7 @@ function Tt(t) {
|
|
|
814
835
|
className: `peeek__btn${s ? " peeek__btn--active" : ""}`,
|
|
815
836
|
"aria-label": n.fullscreen,
|
|
816
837
|
"aria-pressed": s,
|
|
817
|
-
onClick:
|
|
838
|
+
onClick: v,
|
|
818
839
|
children: "⛶"
|
|
819
840
|
}
|
|
820
841
|
),
|
|
@@ -824,17 +845,17 @@ function Tt(t) {
|
|
|
824
845
|
type: "button",
|
|
825
846
|
className: "peeek__btn",
|
|
826
847
|
"aria-label": n.about,
|
|
827
|
-
onClick:
|
|
848
|
+
onClick: k,
|
|
828
849
|
children: "?"
|
|
829
850
|
}
|
|
830
851
|
)
|
|
831
852
|
] }),
|
|
832
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ y(
|
|
833
854
|
"div",
|
|
834
855
|
{
|
|
835
856
|
className: "peeek__cf-stage",
|
|
836
857
|
tabIndex: 0,
|
|
837
|
-
onKeyDown:
|
|
858
|
+
onKeyDown: F,
|
|
838
859
|
children: [
|
|
839
860
|
d.arrows && /* @__PURE__ */ o(
|
|
840
861
|
"button",
|
|
@@ -843,26 +864,26 @@ function Tt(t) {
|
|
|
843
864
|
className: "peeek__arrow peeek__arrow--prev",
|
|
844
865
|
"aria-label": n.prev,
|
|
845
866
|
disabled: x,
|
|
846
|
-
onClick: () =>
|
|
867
|
+
onClick: () => A(-1),
|
|
847
868
|
children: "‹"
|
|
848
869
|
}
|
|
849
870
|
),
|
|
850
|
-
e.map((
|
|
851
|
-
const
|
|
852
|
-
if (Math.abs(
|
|
853
|
-
const
|
|
871
|
+
e.map((m, p) => {
|
|
872
|
+
const z = p - l;
|
|
873
|
+
if (Math.abs(z) > 1) return null;
|
|
874
|
+
const b = z === 0, K = b && d.fullscreen;
|
|
854
875
|
return /* @__PURE__ */ o(
|
|
855
876
|
"button",
|
|
856
877
|
{
|
|
857
878
|
type: "button",
|
|
858
|
-
className: `peeek__cf-card${
|
|
859
|
-
style:
|
|
860
|
-
tabIndex:
|
|
861
|
-
"aria-label":
|
|
862
|
-
onClick: () =>
|
|
863
|
-
children: /* @__PURE__ */ o("img", { src:
|
|
879
|
+
className: `peeek__cf-card${b ? " peeek__cf-card--center" : ""}${K ? " peeek__cf-card--zoom" : ""}`,
|
|
880
|
+
style: Tt(z, u),
|
|
881
|
+
tabIndex: b ? 0 : -1,
|
|
882
|
+
"aria-label": K ? n.openFullscreen : `Go to page ${p + 1}`,
|
|
883
|
+
onClick: () => K ? v() : D(p),
|
|
884
|
+
children: /* @__PURE__ */ o("img", { src: m, alt: b ? `Page ${p + 1}` : "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
864
885
|
},
|
|
865
|
-
|
|
886
|
+
p
|
|
866
887
|
);
|
|
867
888
|
}),
|
|
868
889
|
d.arrows && /* @__PURE__ */ o(
|
|
@@ -871,43 +892,43 @@ function Tt(t) {
|
|
|
871
892
|
type: "button",
|
|
872
893
|
className: "peeek__arrow peeek__arrow--next",
|
|
873
894
|
"aria-label": n.next,
|
|
874
|
-
disabled:
|
|
875
|
-
onClick: () =>
|
|
895
|
+
disabled: M,
|
|
896
|
+
onClick: () => A(1),
|
|
876
897
|
children: "›"
|
|
877
898
|
}
|
|
878
899
|
)
|
|
879
900
|
]
|
|
880
901
|
}
|
|
881
902
|
),
|
|
882
|
-
d.thumbnails && /* @__PURE__ */ o("div", { className: "peeek__cf-thumbs", role: "group", "aria-label": "Pages", children: e.map((
|
|
883
|
-
const
|
|
884
|
-
return /* @__PURE__ */
|
|
903
|
+
d.thumbnails && /* @__PURE__ */ o("div", { className: "peeek__cf-thumbs", role: "group", "aria-label": "Pages", children: e.map((m, p) => {
|
|
904
|
+
const z = p === l;
|
|
905
|
+
return /* @__PURE__ */ y(
|
|
885
906
|
"button",
|
|
886
907
|
{
|
|
887
|
-
ref: (
|
|
888
|
-
|
|
908
|
+
ref: (b) => {
|
|
909
|
+
j.current[p] = b;
|
|
889
910
|
},
|
|
890
911
|
type: "button",
|
|
891
|
-
className: `peeek__cf-thumb${
|
|
892
|
-
"aria-label": `Go to page ${
|
|
893
|
-
"aria-current":
|
|
894
|
-
onClick: () =>
|
|
912
|
+
className: `peeek__cf-thumb${z ? " peeek__cf-thumb--active" : ""}`,
|
|
913
|
+
"aria-label": `Go to page ${p + 1}`,
|
|
914
|
+
"aria-current": z ? "page" : void 0,
|
|
915
|
+
onClick: () => D(p),
|
|
895
916
|
children: [
|
|
896
|
-
/* @__PURE__ */ o("img", { src:
|
|
897
|
-
/* @__PURE__ */ o("span", { className: "peeek__cf-thumb-num", children: String(
|
|
917
|
+
/* @__PURE__ */ o("img", { src: m, alt: "", loading: "lazy", referrerPolicy: "no-referrer" }),
|
|
918
|
+
/* @__PURE__ */ o("span", { className: "peeek__cf-thumb-num", children: String(p + 1).padStart(2, "0") })
|
|
898
919
|
]
|
|
899
920
|
},
|
|
900
|
-
|
|
921
|
+
p
|
|
901
922
|
);
|
|
902
923
|
}) })
|
|
903
924
|
] });
|
|
904
925
|
}
|
|
905
|
-
function
|
|
926
|
+
function Ct({ logo: t, logoLink: e }) {
|
|
906
927
|
if (!t) return null;
|
|
907
928
|
const n = /* @__PURE__ */ o("img", { src: t, alt: "Logo", loading: "lazy", referrerPolicy: "no-referrer" });
|
|
908
929
|
return /* @__PURE__ */ o("div", { className: "peeek__branding", children: e ? /* @__PURE__ */ o("a", { href: e, target: "_blank", rel: "noopener noreferrer", children: n }) : n });
|
|
909
930
|
}
|
|
910
|
-
const
|
|
931
|
+
const Pt = [
|
|
911
932
|
{ top: "12%", left: "10%", size: 3, v: "A", dur: 13, delay: 0 },
|
|
912
933
|
{ top: "22%", left: "82%", size: 2, v: "B", dur: 16, delay: 2 },
|
|
913
934
|
{ top: "40%", left: "16%", size: 2, v: "C", dur: 12, delay: 1 },
|
|
@@ -921,17 +942,17 @@ const Ct = [
|
|
|
921
942
|
{ top: "16%", left: "50%", size: 2, v: "B", dur: 14, delay: 3 },
|
|
922
943
|
{ top: "62%", left: "34%", size: 2, v: "C", dur: 12, delay: 2 }
|
|
923
944
|
];
|
|
924
|
-
function
|
|
925
|
-
const n =
|
|
945
|
+
function It({ strings: t, onClose: e }) {
|
|
946
|
+
const n = E(null);
|
|
926
947
|
return C(() => {
|
|
927
948
|
var a;
|
|
928
949
|
(a = n.current) == null || a.focus();
|
|
929
950
|
}, []), C(() => {
|
|
930
|
-
const a = (
|
|
931
|
-
|
|
951
|
+
const a = (i) => {
|
|
952
|
+
i.key === "Escape" && e();
|
|
932
953
|
};
|
|
933
954
|
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
934
|
-
}, [e]), /* @__PURE__ */ o("div", { className: "peeek__about-backdrop", onClick: e, children: /* @__PURE__ */
|
|
955
|
+
}, [e]), /* @__PURE__ */ o("div", { className: "peeek__about-backdrop", onClick: e, children: /* @__PURE__ */ y(
|
|
935
956
|
"div",
|
|
936
957
|
{
|
|
937
958
|
role: "dialog",
|
|
@@ -940,7 +961,7 @@ function Pt({ strings: t, onClose: e }) {
|
|
|
940
961
|
className: "peeek__about",
|
|
941
962
|
onClick: (a) => a.stopPropagation(),
|
|
942
963
|
children: [
|
|
943
|
-
/* @__PURE__ */ o("span", { className: "peeek__about-particles", "aria-hidden": "true", children:
|
|
964
|
+
/* @__PURE__ */ o("span", { className: "peeek__about-particles", "aria-hidden": "true", children: Pt.map((a, i) => /* @__PURE__ */ o(
|
|
944
965
|
"span",
|
|
945
966
|
{
|
|
946
967
|
className: "peeek__about-particle",
|
|
@@ -952,7 +973,7 @@ function Pt({ strings: t, onClose: e }) {
|
|
|
952
973
|
animation: `peeekAboutDrift${a.v} ${a.dur}s ease-in-out ${a.delay}s infinite`
|
|
953
974
|
}
|
|
954
975
|
},
|
|
955
|
-
|
|
976
|
+
i
|
|
956
977
|
)) }),
|
|
957
978
|
/* @__PURE__ */ o(
|
|
958
979
|
"button",
|
|
@@ -965,10 +986,10 @@ function Pt({ strings: t, onClose: e }) {
|
|
|
965
986
|
children: "×"
|
|
966
987
|
}
|
|
967
988
|
),
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
/* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ y("div", { className: "peeek__about-content", children: [
|
|
990
|
+
/* @__PURE__ */ y("div", { className: "peeek__about-orbwrap", children: [
|
|
970
991
|
/* @__PURE__ */ o("span", { className: "peeek__about-ring", "aria-hidden": "true" }),
|
|
971
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ y(
|
|
972
993
|
"svg",
|
|
973
994
|
{
|
|
974
995
|
className: "peeek__about-mark",
|
|
@@ -977,7 +998,7 @@ function Pt({ strings: t, onClose: e }) {
|
|
|
977
998
|
viewBox: "0 0 256 256",
|
|
978
999
|
"aria-hidden": "true",
|
|
979
1000
|
children: [
|
|
980
|
-
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ y("radialGradient", { id: "peeek-about-orb", cx: "38%", cy: "30%", r: "80%", children: [
|
|
981
1002
|
/* @__PURE__ */ o("stop", { offset: "0%", stopColor: "#9aa2e6" }),
|
|
982
1003
|
/* @__PURE__ */ o("stop", { offset: "55%", stopColor: "#6E79D6" }),
|
|
983
1004
|
/* @__PURE__ */ o("stop", { offset: "100%", stopColor: "#535cc0" })
|
|
@@ -1000,9 +1021,9 @@ function Pt({ strings: t, onClose: e }) {
|
|
|
1000
1021
|
] }),
|
|
1001
1022
|
/* @__PURE__ */ o("div", { className: "peeek__about-name", children: "Peeek Viewer" }),
|
|
1002
1023
|
/* @__PURE__ */ o("div", { className: "peeek__about-tagline", children: t.aboutTagline }),
|
|
1003
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ y("div", { className: "peeek__about-version", children: [
|
|
1004
1025
|
"v",
|
|
1005
|
-
"0.4.
|
|
1026
|
+
"0.4.2"
|
|
1006
1027
|
] }),
|
|
1007
1028
|
/* @__PURE__ */ o("p", { className: "peeek__about-desc", children: t.aboutDescription })
|
|
1008
1029
|
] })
|
|
@@ -1010,15 +1031,15 @@ function Pt({ strings: t, onClose: e }) {
|
|
|
1010
1031
|
}
|
|
1011
1032
|
) });
|
|
1012
1033
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const e =
|
|
1015
|
-
() =>
|
|
1016
|
-
[
|
|
1017
|
-
),
|
|
1034
|
+
function $t(t) {
|
|
1035
|
+
const e = dt(t), n = ct(e.language), a = E(null), { isFullscreen: i, toggle: u } = pt(a), [_, h] = N(!1), f = t.pages !== void 0, s = Je(
|
|
1036
|
+
() => f ? ft(t.pages, { filename: t.filename, mimeType: t.mimeType }) : null,
|
|
1037
|
+
[f, t.pages, t.filename, t.mimeType]
|
|
1038
|
+
), v = mt(f ? null : e.src, e.pollInterval), k = f ? s : v.manifest, d = f ? s ? "ready" : "loading" : v.state, c = {
|
|
1018
1039
|
"--peeek-accent": e.accentColor
|
|
1019
1040
|
};
|
|
1020
|
-
e.background === "transparent" ?
|
|
1021
|
-
const
|
|
1041
|
+
e.background === "transparent" ? c["--peeek-bg"] = "transparent" : e.background === "color" && e.backgroundColor ? c["--peeek-bg"] = e.backgroundColor : e.background === "image" && e.backgroundImage && (c["--peeek-bg"] = `center / cover no-repeat url("${e.backgroundImage}")`);
|
|
1042
|
+
const l = {
|
|
1022
1043
|
toolbar: e.navigationControls,
|
|
1023
1044
|
bar: e.navigationBar,
|
|
1024
1045
|
fullscreen: e.fullscreen,
|
|
@@ -1030,7 +1051,7 @@ function St(t) {
|
|
|
1030
1051
|
rotate: e.rotateControl,
|
|
1031
1052
|
layoutToggle: e.layoutToggle
|
|
1032
1053
|
};
|
|
1033
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ y(
|
|
1034
1055
|
"div",
|
|
1035
1056
|
{
|
|
1036
1057
|
ref: a,
|
|
@@ -1038,35 +1059,35 @@ function St(t) {
|
|
|
1038
1059
|
"data-skin": e.skin,
|
|
1039
1060
|
"data-layout": e.layout,
|
|
1040
1061
|
dir: e.rtl ? "rtl" : void 0,
|
|
1041
|
-
style:
|
|
1062
|
+
style: c,
|
|
1042
1063
|
children: [
|
|
1043
|
-
/* @__PURE__ */ o(
|
|
1044
|
-
d === "loading" && /* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ o(Ct, { logo: e.logo, logoLink: e.logoLink }),
|
|
1065
|
+
d === "loading" && /* @__PURE__ */ y("div", { className: "peeek__state", style: e.loadingColor ? { color: e.loadingColor } : void 0, children: [
|
|
1045
1066
|
e.loadingImage && /* @__PURE__ */ o("img", { className: "peeek__state-img", src: e.loadingImage, alt: "", referrerPolicy: "no-referrer" }),
|
|
1046
1067
|
/* @__PURE__ */ o("span", { children: e.loadingCaption ?? n.loading })
|
|
1047
1068
|
] }),
|
|
1048
1069
|
d === "error" && /* @__PURE__ */ o("div", { className: "peeek__state", children: n.error }),
|
|
1049
|
-
d === "ready" &&
|
|
1050
|
-
|
|
1070
|
+
d === "ready" && k && e.mode === "coverflow" && /* @__PURE__ */ o(
|
|
1071
|
+
Nt,
|
|
1051
1072
|
{
|
|
1052
|
-
pages:
|
|
1073
|
+
pages: k.pages,
|
|
1053
1074
|
strings: n,
|
|
1054
|
-
filename:
|
|
1055
|
-
mimeType:
|
|
1075
|
+
filename: k.metadata.filename,
|
|
1076
|
+
mimeType: k.metadata.mimeType,
|
|
1056
1077
|
rtl: e.rtl,
|
|
1057
1078
|
autoTransition: e.autoTransition,
|
|
1058
1079
|
autoTransitionInterval: e.autoTransitionInterval,
|
|
1059
1080
|
downloadUrl: e.downloadUrl,
|
|
1060
|
-
isFullscreen:
|
|
1061
|
-
onToggleFullscreen:
|
|
1062
|
-
onAbout: () =>
|
|
1081
|
+
isFullscreen: i,
|
|
1082
|
+
onToggleFullscreen: u,
|
|
1083
|
+
onAbout: () => h(!0),
|
|
1063
1084
|
show: { arrows: e.arrows, thumbnails: e.pagesOverview, fullscreen: e.fullscreen, about: e.aboutButton, goto: e.goToPage }
|
|
1064
1085
|
}
|
|
1065
1086
|
),
|
|
1066
|
-
d === "ready" &&
|
|
1067
|
-
|
|
1087
|
+
d === "ready" && k && e.mode === "flip" && /* @__PURE__ */ o(
|
|
1088
|
+
vt,
|
|
1068
1089
|
{
|
|
1069
|
-
pages:
|
|
1090
|
+
pages: k.pages,
|
|
1070
1091
|
strings: n,
|
|
1071
1092
|
layout: e.layout,
|
|
1072
1093
|
rtl: e.rtl,
|
|
@@ -1074,18 +1095,18 @@ function St(t) {
|
|
|
1074
1095
|
animateInteractions: e.animateInteractions,
|
|
1075
1096
|
autoTransition: e.autoTransition,
|
|
1076
1097
|
autoTransitionInterval: e.autoTransitionInterval,
|
|
1077
|
-
show:
|
|
1098
|
+
show: l,
|
|
1078
1099
|
downloadUrl: e.downloadUrl,
|
|
1079
|
-
isFullscreen:
|
|
1080
|
-
onToggleFullscreen:
|
|
1081
|
-
onAbout: () =>
|
|
1100
|
+
isFullscreen: i,
|
|
1101
|
+
onToggleFullscreen: u,
|
|
1102
|
+
onAbout: () => h(!0)
|
|
1082
1103
|
}
|
|
1083
1104
|
),
|
|
1084
|
-
|
|
1105
|
+
_ && /* @__PURE__ */ o(It, { strings: n, onClose: () => h(!1) })
|
|
1085
1106
|
]
|
|
1086
1107
|
}
|
|
1087
1108
|
);
|
|
1088
1109
|
}
|
|
1089
1110
|
export {
|
|
1090
|
-
|
|
1111
|
+
$t as PeeekViewer
|
|
1091
1112
|
};
|