@pdf-viewer/react 1.8.4-rc.1 → 1.8.4-rc.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/{RPDefaultLayout-9f6b57bc.js → RPDefaultLayout-77e14344.js} +241 -238
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a, Fragment as me, jsxs as M } from "react/jsx-runtime";
|
|
2
2
|
import * as j from "react";
|
|
3
|
-
import { useRef as
|
|
3
|
+
import { useRef as H, useEffect as z, useCallback as E, useState as G, useMemo as W, createContext as $e, useContext as Ge, useImperativeHandle as cn, createElement as Ze, PureComponent as tr, Component as nr, memo as ln } from "react";
|
|
4
4
|
import { ChevronUpIcon as He } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as ie } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as dn } from "./components/ui/Input.js";
|
|
@@ -97,7 +97,7 @@ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
|
97
97
|
import { ClearIcon as xo } from "./components/icons/ClearIcon.js";
|
|
98
98
|
import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
|
|
99
99
|
import './assets/RPDefaultLayout.css';const vn = () => {
|
|
100
|
-
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: i } = oe(), s =
|
|
100
|
+
const { viewMode: t } = Oe(), { scrollMode: e } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: i } = oe(), s = H(), { columnCount: l } = un(), { widths: d, heights: u } = qe(), m = H(e), P = H(t), h = H(l), { targetScrollPage: b } = pn();
|
|
101
101
|
z(() => {
|
|
102
102
|
n != null && n.scrollToItem && (s.current = n);
|
|
103
103
|
}, [n]), z(() => {
|
|
@@ -148,7 +148,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
148
148
|
if (!s.current || !o)
|
|
149
149
|
return;
|
|
150
150
|
const c = o;
|
|
151
|
-
if (
|
|
151
|
+
if (b.current = w, m.current === ne.HORIZONTAL_SCROLLING) {
|
|
152
152
|
g = f;
|
|
153
153
|
const T = {
|
|
154
154
|
left: Ae(d, g),
|
|
@@ -170,12 +170,12 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
170
170
|
behavior: S
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
const
|
|
173
|
+
const _ = {
|
|
174
174
|
left: 0,
|
|
175
175
|
top: Ae(u, p)
|
|
176
176
|
};
|
|
177
177
|
return c.scrollTo({
|
|
178
|
-
...
|
|
178
|
+
..._,
|
|
179
179
|
behavior: S
|
|
180
180
|
});
|
|
181
181
|
},
|
|
@@ -190,7 +190,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
190
190
|
]
|
|
191
191
|
) };
|
|
192
192
|
}, Io = (t = 1) => {
|
|
193
|
-
const [e, n] = G(t), [o, r] = G(0), { scrollToPage: i } = vn(), s =
|
|
193
|
+
const [e, n] = G(t), [o, r] = G(0), { scrollToPage: i } = vn(), s = H(1), { viewMode: l } = Oe(), { scrollMode: d } = Ne(), { widths: u } = qe(), { pagesRef: m } = ge(), P = Tt(e, 100), h = E(
|
|
194
194
|
(p) => {
|
|
195
195
|
if (!/^[0-9]*$/g.test(p.toString()) || !p)
|
|
196
196
|
return { success: !1, currentPage: s.current };
|
|
@@ -198,7 +198,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
198
198
|
return c < 0 || c > o ? { success: !1, currentPage: s.current } : (n(c), s.current = c, { success: !0, currentPage: +p });
|
|
199
199
|
},
|
|
200
200
|
[o]
|
|
201
|
-
),
|
|
201
|
+
), b = E(h, [h]), C = E(
|
|
202
202
|
(p) => {
|
|
203
203
|
const g = h(p);
|
|
204
204
|
return g.success && i(g.currentPage), g;
|
|
@@ -208,8 +208,8 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
208
208
|
const g = p % 2 === 1;
|
|
209
209
|
if (!m || g)
|
|
210
210
|
return !1;
|
|
211
|
-
const c = g ? u[p] : u[p - 1],
|
|
212
|
-
return l === Le.DUAL_PAGE && c +
|
|
211
|
+
const c = g ? u[p] : u[p - 1], _ = g ? u[p + 1] : u[p];
|
|
212
|
+
return l === Le.DUAL_PAGE && c + _ < m.clientWidth;
|
|
213
213
|
}, [l, u, m, o]), w = E(() => {
|
|
214
214
|
let p = e - 1;
|
|
215
215
|
y(p) && (p = e - 2), C(p);
|
|
@@ -222,7 +222,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
222
222
|
return {
|
|
223
223
|
focusedPage: P,
|
|
224
224
|
totalPages: o,
|
|
225
|
-
setFocusedPage:
|
|
225
|
+
setFocusedPage: b,
|
|
226
226
|
setTotalPages: r,
|
|
227
227
|
nextPage: f,
|
|
228
228
|
prevPage: w,
|
|
@@ -268,7 +268,7 @@ const Ro = () => {
|
|
|
268
268
|
loadedPages: 0,
|
|
269
269
|
totalPages: 0,
|
|
270
270
|
percentage: 0
|
|
271
|
-
}), [r, i] = G(!1), [s, l] = G(!1), [d, u] = G(null), m =
|
|
271
|
+
}), [r, i] = G(!1), [s, l] = G(!1), [d, u] = G(null), m = H(!1);
|
|
272
272
|
z(() => {
|
|
273
273
|
m.current;
|
|
274
274
|
}, [m]);
|
|
@@ -282,13 +282,13 @@ const Ro = () => {
|
|
|
282
282
|
totalPages: 0,
|
|
283
283
|
percentage: 0
|
|
284
284
|
});
|
|
285
|
-
}, []),
|
|
285
|
+
}, []), b = () => {
|
|
286
286
|
m.current = !0;
|
|
287
287
|
}, C = async ({
|
|
288
288
|
scratchCanvas: p,
|
|
289
289
|
pdfDocument: g,
|
|
290
290
|
pageNumber: c,
|
|
291
|
-
viewerPdfPage:
|
|
291
|
+
viewerPdfPage: _,
|
|
292
292
|
printResolution: v,
|
|
293
293
|
optionalContentConfigPromise: T,
|
|
294
294
|
printAnnotationStoragePromise: R
|
|
@@ -298,7 +298,7 @@ const Ro = () => {
|
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
const x = v / Lr.PDF;
|
|
301
|
-
p.width = Math.floor(
|
|
301
|
+
p.width = Math.floor(_.width * x), p.height = Math.floor(_.height * x);
|
|
302
302
|
const I = p.getContext("2d");
|
|
303
303
|
I.save(), I.fillStyle = "rgb(255, 255, 255)", I.fillRect(0, 0, p.width, p.height), I.restore();
|
|
304
304
|
const [O, A] = await Promise.all([
|
|
@@ -312,7 +312,7 @@ const Ro = () => {
|
|
|
312
312
|
const F = {
|
|
313
313
|
canvasContext: I,
|
|
314
314
|
transform: [x, 0, 0, x, 0, 0],
|
|
315
|
-
viewport: O.getViewport({ scale: 1, rotation:
|
|
315
|
+
viewport: O.getViewport({ scale: 1, rotation: _.rotation }),
|
|
316
316
|
intent: "print",
|
|
317
317
|
annotationMode: Er.ENABLE_STORAGE,
|
|
318
318
|
optionalContentConfigPromise: T,
|
|
@@ -342,10 +342,10 @@ const Ro = () => {
|
|
|
342
342
|
});
|
|
343
343
|
}, []), w = async (p) => {
|
|
344
344
|
const g = document.createElement("img"), c = document.createElement("div");
|
|
345
|
-
return c.classList.add("rp-print-page"), await new Promise((
|
|
345
|
+
return c.classList.add("rp-print-page"), await new Promise((_, v) => {
|
|
346
346
|
p.toBlob((T) => {
|
|
347
347
|
T ? (g.src = URL.createObjectURL(T), g.onload = () => {
|
|
348
|
-
URL.revokeObjectURL(g.src),
|
|
348
|
+
URL.revokeObjectURL(g.src), _();
|
|
349
349
|
}, g.onerror = v) : v(new Error("Failed to create blob"));
|
|
350
350
|
});
|
|
351
351
|
}).catch(() => {
|
|
@@ -353,12 +353,12 @@ const Ro = () => {
|
|
|
353
353
|
}, S = (p, g) => {
|
|
354
354
|
const c = document.createElement("div");
|
|
355
355
|
c.classList.add("rp-print-zone");
|
|
356
|
-
const
|
|
356
|
+
const _ = document.createElement("style"), v = g.get(1);
|
|
357
357
|
if (v) {
|
|
358
358
|
const { width: T, height: R } = v == null ? void 0 : v.page.getViewport({ scale: 1 });
|
|
359
|
-
|
|
359
|
+
_.innerHTML = `@page { size: ${T}px ${R}px }`;
|
|
360
360
|
}
|
|
361
|
-
return c.appendChild(
|
|
361
|
+
return c.appendChild(_), c.append(...p), c;
|
|
362
362
|
}, f = E(async () => {
|
|
363
363
|
if (!t)
|
|
364
364
|
return;
|
|
@@ -366,7 +366,7 @@ const Ro = () => {
|
|
|
366
366
|
const p = document.createElement("canvas"), g = [];
|
|
367
367
|
try {
|
|
368
368
|
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
369
|
-
const
|
|
369
|
+
const _ = t.getOptionalContentConfig({ intent: "print" }), v = Promise.resolve(
|
|
370
370
|
t.annotationStorage.print ?? void 0
|
|
371
371
|
), T = e.size;
|
|
372
372
|
for (const [x, I] of e) {
|
|
@@ -381,7 +381,7 @@ const Ro = () => {
|
|
|
381
381
|
pageNumber: x,
|
|
382
382
|
viewerPdfPage: O,
|
|
383
383
|
printResolution: 150,
|
|
384
|
-
optionalContentConfigPromise:
|
|
384
|
+
optionalContentConfigPromise: _,
|
|
385
385
|
printAnnotationStoragePromise: v
|
|
386
386
|
}), m.current) {
|
|
387
387
|
h();
|
|
@@ -417,7 +417,7 @@ const Ro = () => {
|
|
|
417
417
|
};
|
|
418
418
|
}, [P, h]), {
|
|
419
419
|
print: f,
|
|
420
|
-
cancel:
|
|
420
|
+
cancel: b,
|
|
421
421
|
progress: n,
|
|
422
422
|
isComplete: r,
|
|
423
423
|
isError: s,
|
|
@@ -445,7 +445,7 @@ const Ro = () => {
|
|
|
445
445
|
w && typeof w == "function" && r(() => w);
|
|
446
446
|
}, []), h = (w) => {
|
|
447
447
|
m && w(m);
|
|
448
|
-
},
|
|
448
|
+
}, b = E(
|
|
449
449
|
(w) => {
|
|
450
450
|
n(() => w);
|
|
451
451
|
},
|
|
@@ -465,7 +465,7 @@ const Ro = () => {
|
|
|
465
465
|
}, y = {
|
|
466
466
|
print: i,
|
|
467
467
|
cancel: s,
|
|
468
|
-
setOnProgress:
|
|
468
|
+
setOnProgress: b,
|
|
469
469
|
setOnComplete: P,
|
|
470
470
|
setOnError: h,
|
|
471
471
|
progress: l
|
|
@@ -540,12 +540,12 @@ const Ro = () => {
|
|
|
540
540
|
}
|
|
541
541
|
);
|
|
542
542
|
}, Eo = (t = {}, e = "") => {
|
|
543
|
-
const [n, o] = G(e), [r, i] = G(!1), { pdf: s, pages: l } = J(), { widths: d, heights: u } = qe(), m =
|
|
543
|
+
const [n, o] = G(e), [r, i] = G(!1), { pdf: s, pages: l } = J(), { widths: d, heights: u } = qe(), m = H(!n), { currentZoom: P } = Je(), [h, b] = G([]), { setFocusedPage: C } = oe(), { columnCount: y } = Oe(), { pageRotate: w } = Ue(), [S, f] = G(0), { pageScrollElementRef: p, virtualScrollableElementRef: g } = et(), { scrollMode: c } = Ne(), { pagesRef: _ } = ge(), [v, T] = G(null), R = H({}), x = W(() => S === 0 ? null : h[S - 1], [S, h]), I = W(() => h.length, [h]);
|
|
544
544
|
z(() => {
|
|
545
545
|
if (!x || !l)
|
|
546
546
|
return;
|
|
547
547
|
const L = g || p;
|
|
548
|
-
if (!L || !
|
|
548
|
+
if (!L || !_)
|
|
549
549
|
return;
|
|
550
550
|
const N = l.get(x.page);
|
|
551
551
|
if (c === ne.PAGE_SCROLLING && C(x.page), !N)
|
|
@@ -559,12 +559,12 @@ const Ro = () => {
|
|
|
559
559
|
const q = {
|
|
560
560
|
height: u[x.page - 1],
|
|
561
561
|
width: d[x.page - 1]
|
|
562
|
-
},
|
|
562
|
+
}, $ = {
|
|
563
563
|
top: q.height / 2,
|
|
564
564
|
left: q.width / 2
|
|
565
565
|
}, U = w[x.page], { leftInPage: V, topInPage: K } = Kr(
|
|
566
566
|
q,
|
|
567
|
-
|
|
567
|
+
$,
|
|
568
568
|
x.rect,
|
|
569
569
|
P,
|
|
570
570
|
U
|
|
@@ -585,7 +585,7 @@ const Ro = () => {
|
|
|
585
585
|
c,
|
|
586
586
|
g,
|
|
587
587
|
p,
|
|
588
|
-
|
|
588
|
+
_
|
|
589
589
|
]);
|
|
590
590
|
const O = E(() => {
|
|
591
591
|
f((L) => I ? L + 1 > I ? 1 : L + 1 : 0);
|
|
@@ -605,23 +605,23 @@ const Ro = () => {
|
|
|
605
605
|
}, []);
|
|
606
606
|
return z(() => {
|
|
607
607
|
if (!n) {
|
|
608
|
-
m.current = !0,
|
|
608
|
+
m.current = !0, b([]), f(0);
|
|
609
609
|
return;
|
|
610
610
|
}
|
|
611
|
-
m.current = !1, i(!0),
|
|
611
|
+
m.current = !1, i(!0), b([]), f(0), F(s).then((L) => {
|
|
612
612
|
R.current = L;
|
|
613
613
|
const D = Object.keys(L).reduce((k, q) => {
|
|
614
|
-
const
|
|
614
|
+
const $ = dr(
|
|
615
615
|
[n],
|
|
616
616
|
L[q],
|
|
617
617
|
Number(q) - 1,
|
|
618
618
|
t
|
|
619
619
|
).map((U, V) => ({ ...U, page: Number(q), pageMatchIdx: V }));
|
|
620
|
-
return [...k,
|
|
620
|
+
return [...k, ...$];
|
|
621
621
|
}, []);
|
|
622
|
-
|
|
622
|
+
b(D), f(D.length ? 1 : 0);
|
|
623
623
|
}).catch(() => {
|
|
624
|
-
|
|
624
|
+
b([]), f(0);
|
|
625
625
|
}).finally(() => i(!1));
|
|
626
626
|
}, [n, F, s, t]), {
|
|
627
627
|
search: n,
|
|
@@ -668,7 +668,7 @@ const Ro = () => {
|
|
|
668
668
|
matches: m,
|
|
669
669
|
nextMatch: P,
|
|
670
670
|
prevMatch: h,
|
|
671
|
-
currentMatchElement:
|
|
671
|
+
currentMatchElement: b,
|
|
672
672
|
setCurrentMatchElement: C
|
|
673
673
|
} = Eo(n, e);
|
|
674
674
|
return /* @__PURE__ */ a(
|
|
@@ -686,14 +686,14 @@ const Ro = () => {
|
|
|
686
686
|
prevMatch: h,
|
|
687
687
|
search: u,
|
|
688
688
|
matches: m,
|
|
689
|
-
currentMatchElement:
|
|
689
|
+
currentMatchElement: b,
|
|
690
690
|
setCurrentMatchElement: C
|
|
691
691
|
},
|
|
692
692
|
children: t
|
|
693
693
|
}
|
|
694
694
|
);
|
|
695
695
|
}, Rt = () => Ge(Pn), Tn = $e(null), Xs = ({ children: t }) => {
|
|
696
|
-
const e =
|
|
696
|
+
const e = H(!1), [n, o] = G([]), r = E((d) => {
|
|
697
697
|
o((u) => [...u, { id: d.page.pageNumber.toString(), data: d, priority: 0 }]);
|
|
698
698
|
}, []), i = W(() => new gr(r), [r]), { focusedPage: s } = oe(), l = E((d) => (e.current = !0, vr(
|
|
699
699
|
d.data.page,
|
|
@@ -736,7 +736,7 @@ const Ro = () => {
|
|
|
736
736
|
"rp-page": "_rp-page_14ohm_1",
|
|
737
737
|
"rp-loader-wrapper": "_rp-loader-wrapper_14ohm_15"
|
|
738
738
|
}, No = (t) => {
|
|
739
|
-
const { pageNumber: e, onLoaded: n, onLoading: o } = t, r =
|
|
739
|
+
const { pageNumber: e, onLoaded: n, onLoading: o } = t, r = H(null), { pages: i } = J(), { pageRotate: s } = Ue(), l = H(), { currentZoom: d } = Je(), u = yn(), m = H(`page-${e}`);
|
|
740
740
|
return z(() => {
|
|
741
741
|
if (!i || d === 0)
|
|
742
742
|
return;
|
|
@@ -744,8 +744,8 @@ const Ro = () => {
|
|
|
744
744
|
if (r.current && P) {
|
|
745
745
|
const h = r.current;
|
|
746
746
|
h.hidden = !0;
|
|
747
|
-
const
|
|
748
|
-
|
|
747
|
+
const b = l.current;
|
|
748
|
+
b && b.cancel(), o && o(), u.enqueue(
|
|
749
749
|
m.current,
|
|
750
750
|
{
|
|
751
751
|
page: P.page,
|
|
@@ -769,19 +769,19 @@ const Ro = () => {
|
|
|
769
769
|
selecting: Oo,
|
|
770
770
|
"rp-text-layer-text": "_rp-text-layer-text_usdup_39"
|
|
771
771
|
}, Do = (t) => {
|
|
772
|
-
const { pageNumber: e } = t, { pages: n } = J(), o =
|
|
772
|
+
const { pageNumber: e } = t, { pages: n } = J(), o = H(null), { matches: r, currentMatch: i, setCurrentMatchElement: s } = Rt(), [l, d] = G(
|
|
773
773
|
[]
|
|
774
|
-
), u =
|
|
774
|
+
), u = H(), m = H(), P = H([]), h = W(() => r.filter((p) => p.pageIndex === e - 1), [r, e]), b = E(
|
|
775
775
|
(p, g, c = !1) => {
|
|
776
776
|
if (c && ur(p, g), !h.length) {
|
|
777
777
|
P.current = [], d([]);
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
|
-
const
|
|
781
|
-
d(
|
|
780
|
+
const _ = pr(h, p, g);
|
|
781
|
+
d(_);
|
|
782
782
|
},
|
|
783
783
|
[h]
|
|
784
|
-
), C =
|
|
784
|
+
), C = H(), y = H(!1), w = E(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
785
785
|
z(() => ((() => {
|
|
786
786
|
if (C.current)
|
|
787
787
|
return;
|
|
@@ -817,7 +817,7 @@ const Ro = () => {
|
|
|
817
817
|
},
|
|
818
818
|
{ signal: g }
|
|
819
819
|
);
|
|
820
|
-
let
|
|
820
|
+
let _ = null;
|
|
821
821
|
document.addEventListener(
|
|
822
822
|
"selectionchange",
|
|
823
823
|
() => {
|
|
@@ -845,12 +845,12 @@ const Ro = () => {
|
|
|
845
845
|
}
|
|
846
846
|
});
|
|
847
847
|
const R = v.getRangeAt(0);
|
|
848
|
-
let I =
|
|
848
|
+
let I = _ && (R.compareBoundaryPoints(Range.END_TO_END, _) === 0 || R.compareBoundaryPoints(Range.START_TO_END, _) === 0) ? R.startContainer : R.endContainer;
|
|
849
849
|
I.nodeType === Node.TEXT_NODE && (I = I.parentNode);
|
|
850
850
|
const O = (F = I.parentElement) == null ? void 0 : F.closest(
|
|
851
851
|
he["rp-text-layer"]
|
|
852
852
|
), A = O == null ? void 0 : O.querySelector(".endOfContent");
|
|
853
|
-
A && O && (A.style.width = O.style.width, A.style.height = O.style.height, (L = I.parentElement) == null || L.insertBefore(A, I.nextSibling)),
|
|
853
|
+
A && O && (A.style.width = O.style.width, A.style.height = O.style.height, (L = I.parentElement) == null || L.insertBefore(A, I.nextSibling)), _ = R.cloneRange();
|
|
854
854
|
},
|
|
855
855
|
{ signal: g }
|
|
856
856
|
);
|
|
@@ -883,9 +883,9 @@ const Ro = () => {
|
|
|
883
883
|
return;
|
|
884
884
|
const g = o.current;
|
|
885
885
|
return u.current && u.current.cancel(), p.page.getTextContent().then((c) => {
|
|
886
|
-
const
|
|
886
|
+
const _ = p.page.getViewport({ scale: 1 });
|
|
887
887
|
return u.current = new Rr.TextLayer({
|
|
888
|
-
viewport:
|
|
888
|
+
viewport: _,
|
|
889
889
|
textContentSource: c,
|
|
890
890
|
container: g
|
|
891
891
|
}), m.current = c, g && (g.innerText = ""), u.current.render();
|
|
@@ -894,8 +894,8 @@ const Ro = () => {
|
|
|
894
894
|
[].slice.call(g.children).forEach((x) => {
|
|
895
895
|
x.classList.add(he["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
896
896
|
});
|
|
897
|
-
const
|
|
898
|
-
|
|
897
|
+
const _ = (T = u.current) == null ? void 0 : T.textDivs;
|
|
898
|
+
_ && m.current && b(m.current, _);
|
|
899
899
|
const v = document.createElement("div");
|
|
900
900
|
v.className = "endOfContent", (R = o.current) == null || R.appendChild(v);
|
|
901
901
|
}).catch(() => {
|
|
@@ -905,12 +905,12 @@ const Ro = () => {
|
|
|
905
905
|
};
|
|
906
906
|
}, [n, e]), z(() => {
|
|
907
907
|
var c;
|
|
908
|
-
[].slice.call(o.current.children).forEach((
|
|
909
|
-
|
|
908
|
+
[].slice.call(o.current.children).forEach((_) => {
|
|
909
|
+
_.classList.add(he["rp-text-layer-text"]);
|
|
910
910
|
});
|
|
911
911
|
const g = (c = u.current) == null ? void 0 : c.textDivs;
|
|
912
|
-
g && m.current &&
|
|
913
|
-
}, [
|
|
912
|
+
g && m.current && b(m.current, g, !0);
|
|
913
|
+
}, [b]), /* @__PURE__ */ a(
|
|
914
914
|
"div",
|
|
915
915
|
{
|
|
916
916
|
"data-rp": `page-${e}-textLayer`,
|
|
@@ -925,14 +925,14 @@ const Ro = () => {
|
|
|
925
925
|
};
|
|
926
926
|
let Ao = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
927
927
|
const Fo = (t) => {
|
|
928
|
-
const { pageNumber: e } = t, n =
|
|
928
|
+
const { pageNumber: e } = t, n = H(null), { pages: o, pdf: r } = J(), i = H(), [s, l] = G(), { setFocusedPage: d, goToPage: u } = oe(), { scrollMode: m } = Ne(), { print: P } = tt(), { download: h } = qn(), b = W(() => o.get(e), [o, e]), C = W(() => b == null ? void 0 : b.page.getViewport(), [b]);
|
|
929
929
|
z(() => {
|
|
930
930
|
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
931
931
|
}, [r]), z(() => {
|
|
932
|
-
|
|
932
|
+
b && b.page.getAnnotations().then((w) => {
|
|
933
933
|
i.current = void 0, l(w), n.current && (n.current.innerText = "");
|
|
934
934
|
});
|
|
935
|
-
}, [
|
|
935
|
+
}, [b]);
|
|
936
936
|
const y = E(
|
|
937
937
|
(w) => {
|
|
938
938
|
!s || !r || (zr(w), Ar(w, r, s).then((S) => {
|
|
@@ -943,9 +943,9 @@ const Fo = (t) => {
|
|
|
943
943
|
[r, s, u, d, m, P, h]
|
|
944
944
|
);
|
|
945
945
|
return z(() => {
|
|
946
|
-
if (!
|
|
946
|
+
if (!b || !s)
|
|
947
947
|
return;
|
|
948
|
-
const w =
|
|
948
|
+
const w = b.page.getViewport();
|
|
949
949
|
if (i.current) {
|
|
950
950
|
i.current.update({
|
|
951
951
|
viewport: w.clone({ dontFlip: !0 })
|
|
@@ -966,27 +966,27 @@ const Fo = (t) => {
|
|
|
966
966
|
}
|
|
967
967
|
const f = new AbortController();
|
|
968
968
|
return (async () => {
|
|
969
|
-
var
|
|
969
|
+
var _;
|
|
970
970
|
i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new Or({
|
|
971
971
|
div: n.current,
|
|
972
972
|
accessibilityManager: void 0,
|
|
973
973
|
annotationCanvasMap: void 0,
|
|
974
974
|
annotationEditorUIManager: void 0,
|
|
975
975
|
structTreeLayer: null,
|
|
976
|
-
page:
|
|
976
|
+
page: b.page,
|
|
977
977
|
viewport: w.clone({ dontFlip: !0 })
|
|
978
978
|
}), n.current && kt(n.current, y);
|
|
979
979
|
const g = await (r == null ? void 0 : r.hasJSActions()), c = await (r == null ? void 0 : r.getFieldObjects());
|
|
980
980
|
if (f.signal.aborted)
|
|
981
981
|
throw "abort";
|
|
982
|
-
return (
|
|
982
|
+
return (_ = i.current) == null ? void 0 : _.render({
|
|
983
983
|
annotations: s,
|
|
984
984
|
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
985
985
|
hasJSActions: g,
|
|
986
986
|
fieldObjects: c,
|
|
987
987
|
div: n.current,
|
|
988
988
|
viewport: w.clone({ dontFlip: !0 }),
|
|
989
|
-
page:
|
|
989
|
+
page: b.page,
|
|
990
990
|
imageResourcesPath: Ao,
|
|
991
991
|
renderForms: !0,
|
|
992
992
|
linkService: new Dr(),
|
|
@@ -1013,7 +1013,7 @@ const Fo = (t) => {
|
|
|
1013
1013
|
}, ko = {
|
|
1014
1014
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1015
1015
|
}, Wo = ({ pageNumber: t, viewport: e }) => {
|
|
1016
|
-
const [n, o] = G(), { pages: r } = J(), { highlightKeywords: i } = fr(), s = !0, l =
|
|
1016
|
+
const [n, o] = G(), { pages: r } = J(), { highlightKeywords: i } = fr(), s = !0, l = H(null), [d, u] = G(null), [m, P] = G([]);
|
|
1017
1017
|
z(() => {
|
|
1018
1018
|
l.current && u(l.current.parentElement);
|
|
1019
1019
|
}, [l]), z(() => {
|
|
@@ -1032,14 +1032,14 @@ const Fo = (t) => {
|
|
|
1032
1032
|
color: f.highlightColor
|
|
1033
1033
|
};
|
|
1034
1034
|
}) : [], [i]);
|
|
1035
|
-
function
|
|
1035
|
+
function b(f, p) {
|
|
1036
1036
|
if (!f)
|
|
1037
1037
|
return;
|
|
1038
1038
|
const g = `[data-rp="page-${p}-textLayer"]`;
|
|
1039
1039
|
return new Promise((c) => {
|
|
1040
|
-
const
|
|
1041
|
-
if (
|
|
1042
|
-
c(
|
|
1040
|
+
const _ = f.querySelector(g);
|
|
1041
|
+
if (_) {
|
|
1042
|
+
c(_);
|
|
1043
1043
|
return;
|
|
1044
1044
|
}
|
|
1045
1045
|
new MutationObserver((T, R) => {
|
|
@@ -1057,7 +1057,7 @@ const Fo = (t) => {
|
|
|
1057
1057
|
p(Array.from(g));
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
|
-
new MutationObserver((
|
|
1060
|
+
new MutationObserver((_, v) => {
|
|
1061
1061
|
const T = f.querySelectorAll(
|
|
1062
1062
|
".rp-text-layer-text"
|
|
1063
1063
|
);
|
|
@@ -1066,16 +1066,16 @@ const Fo = (t) => {
|
|
|
1066
1066
|
});
|
|
1067
1067
|
}
|
|
1068
1068
|
const y = (f, p, g, c) => {
|
|
1069
|
-
var
|
|
1070
|
-
const
|
|
1069
|
+
var $;
|
|
1070
|
+
const _ = document.createRange(), v = g.firstChild;
|
|
1071
1071
|
if (!v || v.nodeType !== Node.TEXT_NODE)
|
|
1072
1072
|
return null;
|
|
1073
|
-
const T = ((
|
|
1073
|
+
const T = (($ = v.textContent) == null ? void 0 : $.length) ?? 0, R = c[0].charIdxInSpan, x = c.length === 1 ? R : c[c.length - 1].charIdxInSpan;
|
|
1074
1074
|
if (R > T || x + 1 > T)
|
|
1075
1075
|
return null;
|
|
1076
|
-
|
|
1076
|
+
_.setStart(v, R), _.setEnd(v, x + 1);
|
|
1077
1077
|
const I = document.createElement("span");
|
|
1078
|
-
I.style.width = "auto",
|
|
1078
|
+
I.style.width = "auto", _.surroundContents(I);
|
|
1079
1079
|
const O = I.getBoundingClientRect(), A = f.getBoundingClientRect(), F = A.height, L = A.width, N = 100 * (O.left - A.left) / L, D = 100 * (O.top - A.top) / F, k = 100 * O.height / F, q = 100 * O.width / L;
|
|
1080
1080
|
return $r(I), {
|
|
1081
1081
|
keywordStr: p,
|
|
@@ -1088,12 +1088,12 @@ const Fo = (t) => {
|
|
|
1088
1088
|
};
|
|
1089
1089
|
};
|
|
1090
1090
|
async function w(f, p) {
|
|
1091
|
-
const g = await
|
|
1091
|
+
const g = await b(d, f);
|
|
1092
1092
|
if (!g)
|
|
1093
1093
|
return;
|
|
1094
1094
|
const c = await C(g);
|
|
1095
1095
|
if (c.length) {
|
|
1096
|
-
const
|
|
1096
|
+
const _ = c.map((T) => T.tagName === "BR" ? " " : T.textContent).reduce(
|
|
1097
1097
|
(T, R, x) => T.concat(
|
|
1098
1098
|
R.split("").map((I, O) => ({
|
|
1099
1099
|
char: I,
|
|
@@ -1108,13 +1108,13 @@ const Fo = (t) => {
|
|
|
1108
1108
|
spanIdx: 0
|
|
1109
1109
|
}
|
|
1110
1110
|
]
|
|
1111
|
-
).slice(1), v = S(g, p, c,
|
|
1111
|
+
).slice(1), v = S(g, p, c, _);
|
|
1112
1112
|
P(v);
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
1115
|
const S = (f, p, g, c) => {
|
|
1116
|
-
const
|
|
1117
|
-
if (!c.length || !
|
|
1116
|
+
const _ = p.length;
|
|
1117
|
+
if (!c.length || !_)
|
|
1118
1118
|
return [];
|
|
1119
1119
|
const v = [], T = c.map((R) => R.char).join("");
|
|
1120
1120
|
return h.forEach((R) => {
|
|
@@ -1136,11 +1136,11 @@ const Fo = (t) => {
|
|
|
1136
1136
|
color: A
|
|
1137
1137
|
}));
|
|
1138
1138
|
for (const q of k) {
|
|
1139
|
-
const
|
|
1139
|
+
const $ = q.indexes.reduce(
|
|
1140
1140
|
(U, V) => (U[V.spanIdx] = (U[V.spanIdx] || []).concat([V]), U),
|
|
1141
1141
|
{}
|
|
1142
1142
|
);
|
|
1143
|
-
for (const U of Object.values(
|
|
1143
|
+
for (const U of Object.values($))
|
|
1144
1144
|
if (U.length !== 1 || U[0].char.trim() !== "") {
|
|
1145
1145
|
const V = U, K = g[V[0].spanIdx], X = y(
|
|
1146
1146
|
f,
|
|
@@ -1182,7 +1182,7 @@ const Fo = (t) => {
|
|
|
1182
1182
|
p
|
|
1183
1183
|
)) }) });
|
|
1184
1184
|
}, Lt = Ve((t, e) => {
|
|
1185
|
-
const { pageNumber: n, style: o, ...r } = t, { pages: i } = J(), { pageRotate: s } = Ue(), { textLayer: l } = ar(), { currentZoom: d } = Je(), u =
|
|
1185
|
+
const { pageNumber: n, style: o, ...r } = t, { pages: i } = J(), { pageRotate: s } = Ue(), { textLayer: l } = ar(), { currentZoom: d } = Je(), u = H(i.get(n)), [m, P] = G(!1), h = H(null), [b, C] = G({
|
|
1186
1186
|
width: 0,
|
|
1187
1187
|
height: 0
|
|
1188
1188
|
});
|
|
@@ -1200,14 +1200,14 @@ const Fo = (t) => {
|
|
|
1200
1200
|
const w = W(() => {
|
|
1201
1201
|
switch (y) {
|
|
1202
1202
|
case 90:
|
|
1203
|
-
return `${
|
|
1203
|
+
return `${b.width / 2}px ${b.width / 2}px`;
|
|
1204
1204
|
case -90:
|
|
1205
1205
|
case 270:
|
|
1206
|
-
return `${
|
|
1206
|
+
return `${b.height / 2}px ${b.height / 2}px`;
|
|
1207
1207
|
default:
|
|
1208
1208
|
return "center";
|
|
1209
1209
|
}
|
|
1210
|
-
}, [y,
|
|
1210
|
+
}, [y, b]), S = E(() => {
|
|
1211
1211
|
P(!0);
|
|
1212
1212
|
}, []), f = E(() => {
|
|
1213
1213
|
P(!1);
|
|
@@ -1230,8 +1230,8 @@ const Fo = (t) => {
|
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
1232
1232
|
style: {
|
|
1233
|
-
width: `${
|
|
1234
|
-
height: `${
|
|
1233
|
+
width: `${b.width}px`,
|
|
1234
|
+
height: `${b.height}px`
|
|
1235
1235
|
},
|
|
1236
1236
|
className: dt["rp-page"],
|
|
1237
1237
|
children: [
|
|
@@ -1239,7 +1239,7 @@ const Fo = (t) => {
|
|
|
1239
1239
|
m && /* @__PURE__ */ a("div", { className: dt["rp-loader-wrapper"], children: /* @__PURE__ */ a(Pt, {}) }),
|
|
1240
1240
|
/* @__PURE__ */ a(Gr, { pageNumber: n }),
|
|
1241
1241
|
l && /* @__PURE__ */ a(Do, { pageNumber: n }),
|
|
1242
|
-
/* @__PURE__ */ a(Wo, { pageNumber: n, viewport:
|
|
1242
|
+
/* @__PURE__ */ a(Wo, { pageNumber: n, viewport: b }),
|
|
1243
1243
|
/* @__PURE__ */ a(Fo, { pageNumber: n })
|
|
1244
1244
|
]
|
|
1245
1245
|
}
|
|
@@ -1350,7 +1350,7 @@ var Vo = 150, Bo = function(e) {
|
|
|
1350
1350
|
}, je = null, Ke = null, Xe = null;
|
|
1351
1351
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (je = /* @__PURE__ */ new WeakSet(), Ke = /* @__PURE__ */ new WeakSet(), Xe = /* @__PURE__ */ new WeakSet());
|
|
1352
1352
|
function Zo(t) {
|
|
1353
|
-
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, s = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, u = t.getOffsetForRowAndAlignment, m = t.getRowHeight, P = t.getRowOffset, h = t.getRowStartIndexForOffset,
|
|
1353
|
+
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, s = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, u = t.getOffsetForRowAndAlignment, m = t.getRowHeight, P = t.getRowOffset, h = t.getRowStartIndexForOffset, b = t.getRowStopIndexForStartIndex, C = t.initInstanceProps, y = t.shouldResetStyleCacheOnItemSizeChange, w = t.validateProps;
|
|
1354
1354
|
return e = /* @__PURE__ */ function(S) {
|
|
1355
1355
|
Mo(f, S);
|
|
1356
1356
|
function f(g) {
|
|
@@ -1363,9 +1363,9 @@ function Zo(t) {
|
|
|
1363
1363
|
scrollTop: typeof c.props.initialScrollTop == "number" ? c.props.initialScrollTop : 0,
|
|
1364
1364
|
scrollUpdateWasRequested: !1,
|
|
1365
1365
|
verticalScrollDirection: "forward"
|
|
1366
|
-
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = ut(function(
|
|
1366
|
+
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = ut(function(_, v, T, R, x, I, O, A) {
|
|
1367
1367
|
return c.props.onItemsRendered({
|
|
1368
|
-
overscanColumnStartIndex:
|
|
1368
|
+
overscanColumnStartIndex: _,
|
|
1369
1369
|
overscanColumnStopIndex: v,
|
|
1370
1370
|
overscanRowStartIndex: T,
|
|
1371
1371
|
overscanRowStopIndex: R,
|
|
@@ -1374,16 +1374,16 @@ function Zo(t) {
|
|
|
1374
1374
|
visibleRowStartIndex: O,
|
|
1375
1375
|
visibleRowStopIndex: A
|
|
1376
1376
|
});
|
|
1377
|
-
}), c._callOnScroll = void 0, c._callOnScroll = ut(function(
|
|
1377
|
+
}), c._callOnScroll = void 0, c._callOnScroll = ut(function(_, v, T, R, x) {
|
|
1378
1378
|
return c.props.onScroll({
|
|
1379
1379
|
horizontalScrollDirection: T,
|
|
1380
|
-
scrollLeft:
|
|
1380
|
+
scrollLeft: _,
|
|
1381
1381
|
scrollTop: v,
|
|
1382
1382
|
verticalScrollDirection: R,
|
|
1383
1383
|
scrollUpdateWasRequested: x
|
|
1384
1384
|
});
|
|
1385
|
-
}), c._getItemStyle = void 0, c._getItemStyle = function(
|
|
1386
|
-
var T = c.props, R = T.columnWidth, x = T.direction, I = T.rowHeight, O = c._getItemStyleCache(y && R, y && x, y && I), A =
|
|
1385
|
+
}), c._getItemStyle = void 0, c._getItemStyle = function(_, v) {
|
|
1386
|
+
var T = c.props, R = T.columnWidth, x = T.direction, I = T.rowHeight, O = c._getItemStyleCache(y && R, y && x, y && I), A = _ + ":" + v, F;
|
|
1387
1387
|
if (O.hasOwnProperty(A))
|
|
1388
1388
|
F = O[A];
|
|
1389
1389
|
else {
|
|
@@ -1392,16 +1392,16 @@ function Zo(t) {
|
|
|
1392
1392
|
position: "absolute",
|
|
1393
1393
|
left: N ? void 0 : L,
|
|
1394
1394
|
right: N ? L : void 0,
|
|
1395
|
-
top: P(c.props,
|
|
1396
|
-
height: m(c.props,
|
|
1395
|
+
top: P(c.props, _, c._instanceProps),
|
|
1396
|
+
height: m(c.props, _, c._instanceProps),
|
|
1397
1397
|
width: i(c.props, v, c._instanceProps)
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
1400
1400
|
return F;
|
|
1401
|
-
}, c._getItemStyleCache = void 0, c._getItemStyleCache = ut(function(
|
|
1401
|
+
}, c._getItemStyleCache = void 0, c._getItemStyleCache = ut(function(_, v, T) {
|
|
1402
1402
|
return {};
|
|
1403
|
-
}), c._onScroll = function(
|
|
1404
|
-
var v =
|
|
1403
|
+
}), c._onScroll = function(_) {
|
|
1404
|
+
var v = _.currentTarget, T = v.clientHeight, R = v.clientWidth, x = v.scrollLeft, I = v.scrollTop, O = v.scrollHeight, A = v.scrollWidth;
|
|
1405
1405
|
c.setState(function(F) {
|
|
1406
1406
|
if (F.scrollLeft === x && F.scrollTop === I)
|
|
1407
1407
|
return null;
|
|
@@ -1426,9 +1426,9 @@ function Zo(t) {
|
|
|
1426
1426
|
scrollUpdateWasRequested: !1
|
|
1427
1427
|
};
|
|
1428
1428
|
}, c._resetIsScrollingDebounced);
|
|
1429
|
-
}, c._outerRefSetter = function(
|
|
1429
|
+
}, c._outerRefSetter = function(_) {
|
|
1430
1430
|
var v = c.props.outerRef;
|
|
1431
|
-
c._outerRef =
|
|
1431
|
+
c._outerRef = _, typeof v == "function" ? v(_) : v != null && typeof v == "object" && v.hasOwnProperty("current") && (v.current = _);
|
|
1432
1432
|
}, c._resetIsScrollingDebounced = function() {
|
|
1433
1433
|
c._resetIsScrollingTimeoutId !== null && Zt(c._resetIsScrollingTimeoutId), c._resetIsScrollingTimeoutId = qo(c._resetIsScrolling, Vo);
|
|
1434
1434
|
}, c._resetIsScrolling = function() {
|
|
@@ -1439,38 +1439,38 @@ function Zo(t) {
|
|
|
1439
1439
|
});
|
|
1440
1440
|
}, c;
|
|
1441
1441
|
}
|
|
1442
|
-
f.getDerivedStateFromProps = function(c,
|
|
1443
|
-
return jo(c,
|
|
1442
|
+
f.getDerivedStateFromProps = function(c, _) {
|
|
1443
|
+
return jo(c, _), w(c), null;
|
|
1444
1444
|
};
|
|
1445
1445
|
var p = f.prototype;
|
|
1446
1446
|
return p.scrollTo = function(c) {
|
|
1447
|
-
var
|
|
1448
|
-
|
|
1449
|
-
return
|
|
1450
|
-
horizontalScrollDirection: T.scrollLeft <
|
|
1451
|
-
scrollLeft:
|
|
1447
|
+
var _ = c.scrollLeft, v = c.scrollTop;
|
|
1448
|
+
_ !== void 0 && (_ = Math.max(0, _)), v !== void 0 && (v = Math.max(0, v)), this.setState(function(T) {
|
|
1449
|
+
return _ === void 0 && (_ = T.scrollLeft), v === void 0 && (v = T.scrollTop), T.scrollLeft === _ && T.scrollTop === v ? null : {
|
|
1450
|
+
horizontalScrollDirection: T.scrollLeft < _ ? "forward" : "backward",
|
|
1451
|
+
scrollLeft: _,
|
|
1452
1452
|
scrollTop: v,
|
|
1453
1453
|
scrollUpdateWasRequested: !0,
|
|
1454
1454
|
verticalScrollDirection: T.scrollTop < v ? "forward" : "backward"
|
|
1455
1455
|
};
|
|
1456
1456
|
}, this._resetIsScrollingDebounced);
|
|
1457
1457
|
}, p.scrollToItem = function(c) {
|
|
1458
|
-
var
|
|
1458
|
+
var _ = c.align, v = _ === void 0 ? "auto" : _, T = c.columnIndex, R = c.rowIndex, x = this.props, I = x.columnCount, O = x.height, A = x.rowCount, F = x.width, L = this.state, N = L.scrollLeft, D = L.scrollTop, k = Uo();
|
|
1459
1459
|
T !== void 0 && (T = Math.max(0, Math.min(T, I - 1))), R !== void 0 && (R = Math.max(0, Math.min(R, A - 1)));
|
|
1460
|
-
var q = s(this.props, this._instanceProps),
|
|
1460
|
+
var q = s(this.props, this._instanceProps), $ = l(this.props, this._instanceProps), U = $ > F ? k : 0, V = q > O ? k : 0;
|
|
1461
1461
|
this.scrollTo({
|
|
1462
1462
|
scrollLeft: T !== void 0 ? d(this.props, T, v, N, this._instanceProps, V) : N,
|
|
1463
1463
|
scrollTop: R !== void 0 ? u(this.props, R, v, D, this._instanceProps, U) : D
|
|
1464
1464
|
});
|
|
1465
1465
|
}, p.componentDidMount = function() {
|
|
1466
|
-
var c = this.props,
|
|
1466
|
+
var c = this.props, _ = c.initialScrollLeft, v = c.initialScrollTop;
|
|
1467
1467
|
if (this._outerRef != null) {
|
|
1468
1468
|
var T = this._outerRef;
|
|
1469
|
-
typeof
|
|
1469
|
+
typeof _ == "number" && (T.scrollLeft = _), typeof v == "number" && (T.scrollTop = v);
|
|
1470
1470
|
}
|
|
1471
1471
|
this._callPropsCallbacks();
|
|
1472
1472
|
}, p.componentDidUpdate = function() {
|
|
1473
|
-
var c = this.props.direction,
|
|
1473
|
+
var c = this.props.direction, _ = this.state, v = _.scrollLeft, T = _.scrollTop, R = _.scrollUpdateWasRequested;
|
|
1474
1474
|
if (R && this._outerRef != null) {
|
|
1475
1475
|
var x = this._outerRef;
|
|
1476
1476
|
if (c === "rtl")
|
|
@@ -1494,11 +1494,11 @@ function Zo(t) {
|
|
|
1494
1494
|
}, p.componentWillUnmount = function() {
|
|
1495
1495
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1496
1496
|
}, p.render = function() {
|
|
1497
|
-
var c = this.props,
|
|
1497
|
+
var c = this.props, _ = c.children, v = c.className, T = c.columnCount, R = c.direction, x = c.height, I = c.innerRef, O = c.innerElementType, A = c.innerTagName, F = c.itemData, L = c.itemKey, N = L === void 0 ? Bo : L, D = c.outerElementType, k = c.outerTagName, q = c.rowCount, $ = c.style, U = c.useIsScrolling, V = c.width, K = this.state.isScrolling, X = this._getHorizontalRangeToRender(), Q = X[0], le = X[1], de = this._getVerticalRangeToRender(), ee = de[0], Fe = de[1], we = [];
|
|
1498
1498
|
if (T > 0 && q)
|
|
1499
1499
|
for (var Te = ee; Te <= Fe; Te++)
|
|
1500
1500
|
for (var _e = Q; _e <= le; _e++)
|
|
1501
|
-
we.push(Ze(
|
|
1501
|
+
we.push(Ze(_, {
|
|
1502
1502
|
columnIndex: _e,
|
|
1503
1503
|
data: F,
|
|
1504
1504
|
isScrolling: U ? K : void 0,
|
|
@@ -1523,7 +1523,7 @@ function Zo(t) {
|
|
|
1523
1523
|
WebkitOverflowScrolling: "touch",
|
|
1524
1524
|
willChange: "transform",
|
|
1525
1525
|
direction: R
|
|
1526
|
-
},
|
|
1526
|
+
}, $)
|
|
1527
1527
|
}, Ze(O || A || "div", {
|
|
1528
1528
|
children: we,
|
|
1529
1529
|
ref: I,
|
|
@@ -1534,26 +1534,26 @@ function Zo(t) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
}));
|
|
1536
1536
|
}, p._callPropsCallbacks = function() {
|
|
1537
|
-
var c = this.props,
|
|
1538
|
-
if (typeof v == "function" &&
|
|
1537
|
+
var c = this.props, _ = c.columnCount, v = c.onItemsRendered, T = c.onScroll, R = c.rowCount;
|
|
1538
|
+
if (typeof v == "function" && _ > 0 && R > 0) {
|
|
1539
1539
|
var x = this._getHorizontalRangeToRender(), I = x[0], O = x[1], A = x[2], F = x[3], L = this._getVerticalRangeToRender(), N = L[0], D = L[1], k = L[2], q = L[3];
|
|
1540
1540
|
this._callOnItemsRendered(I, O, N, D, A, F, k, q);
|
|
1541
1541
|
}
|
|
1542
1542
|
if (typeof T == "function") {
|
|
1543
|
-
var
|
|
1543
|
+
var $ = this.state, U = $.horizontalScrollDirection, V = $.scrollLeft, K = $.scrollTop, X = $.scrollUpdateWasRequested, Q = $.verticalScrollDirection;
|
|
1544
1544
|
this._callOnScroll(V, K, U, Q, X);
|
|
1545
1545
|
}
|
|
1546
1546
|
}, p._getHorizontalRangeToRender = function() {
|
|
1547
|
-
var c = this.props,
|
|
1548
|
-
if (
|
|
1547
|
+
var c = this.props, _ = c.columnCount, v = c.overscanColumnCount, T = c.overscanColumnsCount, R = c.overscanCount, x = c.rowCount, I = this.state, O = I.horizontalScrollDirection, A = I.isScrolling, F = I.scrollLeft, L = v || T || R || 1;
|
|
1548
|
+
if (_ === 0 || x === 0)
|
|
1549
1549
|
return [0, 0, 0, 0];
|
|
1550
1550
|
var N = o(this.props, F, this._instanceProps), D = r(this.props, N, F, this._instanceProps), k = !A || O === "backward" ? Math.max(1, L) : 1, q = !A || O === "forward" ? Math.max(1, L) : 1;
|
|
1551
|
-
return [Math.max(0, N - k), Math.max(0, Math.min(
|
|
1551
|
+
return [Math.max(0, N - k), Math.max(0, Math.min(_ - 1, D + q)), N, D];
|
|
1552
1552
|
}, p._getVerticalRangeToRender = function() {
|
|
1553
|
-
var c = this.props,
|
|
1554
|
-
if (
|
|
1553
|
+
var c = this.props, _ = c.columnCount, v = c.overscanCount, T = c.overscanRowCount, R = c.overscanRowsCount, x = c.rowCount, I = this.state, O = I.isScrolling, A = I.verticalScrollDirection, F = I.scrollTop, L = T || R || v || 1;
|
|
1554
|
+
if (_ === 0 || x === 0)
|
|
1555
1555
|
return [0, 0, 0, 0];
|
|
1556
|
-
var N = h(this.props, F, this._instanceProps), D =
|
|
1556
|
+
var N = h(this.props, F, this._instanceProps), D = b(this.props, N, F, this._instanceProps), k = !O || A === "backward" ? Math.max(1, L) : 1, q = !O || A === "forward" ? Math.max(1, L) : 1;
|
|
1557
1557
|
return [Math.max(0, N - k), Math.max(0, Math.min(x - 1, D + q)), N, D];
|
|
1558
1558
|
}, f;
|
|
1559
1559
|
}(tr), e.defaultProps = {
|
|
@@ -1735,15 +1735,15 @@ const ei = () => {
|
|
|
1735
1735
|
const S = w % s;
|
|
1736
1736
|
return (!C[S] || y > C[S]) && (C[S] = y), C;
|
|
1737
1737
|
}, []), [r.widths, s]), d = E(
|
|
1738
|
-
(
|
|
1739
|
-
const C =
|
|
1738
|
+
(b) => {
|
|
1739
|
+
const C = b % l.length;
|
|
1740
1740
|
return l[C] || 0;
|
|
1741
1741
|
},
|
|
1742
1742
|
[l]
|
|
1743
1743
|
), u = E(
|
|
1744
|
-
(
|
|
1744
|
+
(b) => {
|
|
1745
1745
|
const C = Array.from({ length: s }, (y, w) => {
|
|
1746
|
-
const S =
|
|
1746
|
+
const S = b * s + w;
|
|
1747
1747
|
return r.heights[S] || 0;
|
|
1748
1748
|
});
|
|
1749
1749
|
return Math.max(...C);
|
|
@@ -1753,7 +1753,7 @@ const ei = () => {
|
|
|
1753
1753
|
z(() => {
|
|
1754
1754
|
n(s);
|
|
1755
1755
|
}, [s, n]);
|
|
1756
|
-
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / s), [s, i, e]), P = W(() => r.heights.reduce((
|
|
1756
|
+
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / s), [s, i, e]), P = W(() => r.heights.reduce((b, C) => b + C, 0) / r.heights.length || 0, [r]), h = W(() => r.widths.reduce((b, C) => b + C, 0) / r.heights.length || 0, [r]);
|
|
1757
1757
|
return {
|
|
1758
1758
|
rowCount: m,
|
|
1759
1759
|
rowHeight: u,
|
|
@@ -1799,7 +1799,7 @@ function ti(t) {
|
|
|
1799
1799
|
}));
|
|
1800
1800
|
});
|
|
1801
1801
|
};
|
|
1802
|
-
let h = !1,
|
|
1802
|
+
let h = !1, b = "";
|
|
1803
1803
|
o = "animationstart";
|
|
1804
1804
|
const C = "Webkit Moz O ms".split(" ");
|
|
1805
1805
|
let y = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), w = "";
|
|
@@ -1808,23 +1808,23 @@ function ti(t) {
|
|
|
1808
1808
|
if (S.style.animationName !== void 0 && (h = !0), h === !1) {
|
|
1809
1809
|
for (let f = 0; f < C.length; f++)
|
|
1810
1810
|
if (S.style[C[f] + "AnimationName"] !== void 0) {
|
|
1811
|
-
w = C[f],
|
|
1811
|
+
w = C[f], b = "-" + w.toLowerCase() + "-", o = y[f], h = !0;
|
|
1812
1812
|
break;
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
|
-
n = "resizeanim", e = "@" +
|
|
1816
|
+
n = "resizeanim", e = "@" + b + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = b + "animation: 1ms " + n + "; ";
|
|
1817
1817
|
}
|
|
1818
1818
|
const u = function(h) {
|
|
1819
1819
|
if (!h.getElementById("detectElementResize")) {
|
|
1820
|
-
const
|
|
1821
|
-
y.id = "detectElementResize", y.type = "text/css", t != null && y.setAttribute("nonce", t), y.styleSheet ? y.styleSheet.cssText =
|
|
1820
|
+
const b = (e || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', C = h.head || h.getElementsByTagName("head")[0], y = h.createElement("style");
|
|
1821
|
+
y.id = "detectElementResize", y.type = "text/css", t != null && y.setAttribute("nonce", t), y.styleSheet ? y.styleSheet.cssText = b : y.appendChild(h.createTextNode(b)), C.appendChild(y);
|
|
1822
1822
|
}
|
|
1823
1823
|
};
|
|
1824
1824
|
return {
|
|
1825
|
-
addResizeListener: function(h,
|
|
1825
|
+
addResizeListener: function(h, b) {
|
|
1826
1826
|
if (d)
|
|
1827
|
-
h.attachEvent("onresize",
|
|
1827
|
+
h.attachEvent("onresize", b);
|
|
1828
1828
|
else {
|
|
1829
1829
|
if (!h.__resizeTriggers__) {
|
|
1830
1830
|
const C = h.ownerDocument, y = ae.getComputedStyle(h);
|
|
@@ -1836,13 +1836,13 @@ function ti(t) {
|
|
|
1836
1836
|
p.animationName === n && s(h);
|
|
1837
1837
|
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1838
1838
|
}
|
|
1839
|
-
h.__resizeListeners__.push(
|
|
1839
|
+
h.__resizeListeners__.push(b);
|
|
1840
1840
|
}
|
|
1841
1841
|
},
|
|
1842
|
-
removeResizeListener: function(h,
|
|
1842
|
+
removeResizeListener: function(h, b) {
|
|
1843
1843
|
if (d)
|
|
1844
|
-
h.detachEvent("onresize",
|
|
1845
|
-
else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(
|
|
1844
|
+
h.detachEvent("onresize", b);
|
|
1845
|
+
else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(b), 1), !h.__resizeListeners__.length) {
|
|
1846
1846
|
h.removeEventListener("scroll", l, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(o, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
|
|
1847
1847
|
try {
|
|
1848
1848
|
h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
|
|
@@ -1871,7 +1871,7 @@ class ni extends nr {
|
|
|
1871
1871
|
height: P,
|
|
1872
1872
|
width: h
|
|
1873
1873
|
});
|
|
1874
|
-
const
|
|
1874
|
+
const b = () => {
|
|
1875
1875
|
this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
|
|
1876
1876
|
};
|
|
1877
1877
|
typeof r == "function" && r({
|
|
@@ -1879,10 +1879,10 @@ class ni extends nr {
|
|
|
1879
1879
|
width: h,
|
|
1880
1880
|
// TODO Remove these params in the next major release
|
|
1881
1881
|
get scaledHeight() {
|
|
1882
|
-
return
|
|
1882
|
+
return b(), P;
|
|
1883
1883
|
},
|
|
1884
1884
|
get scaledWidth() {
|
|
1885
|
-
return
|
|
1885
|
+
return b(), h;
|
|
1886
1886
|
}
|
|
1887
1887
|
});
|
|
1888
1888
|
}
|
|
@@ -1921,12 +1921,12 @@ class ni extends nr {
|
|
|
1921
1921
|
...P
|
|
1922
1922
|
} = this.props, {
|
|
1923
1923
|
height: h,
|
|
1924
|
-
width:
|
|
1924
|
+
width: b
|
|
1925
1925
|
} = this.state, C = {
|
|
1926
1926
|
overflow: "visible"
|
|
1927
1927
|
}, y = {};
|
|
1928
1928
|
let w = !1;
|
|
1929
|
-
return r || (h === 0 && (w = !0), C.height = 0, y.height = h, y.scaledHeight = h), i || (
|
|
1929
|
+
return r || (h === 0 && (w = !0), C.height = 0, y.height = h, y.scaledHeight = h), i || (b === 0 && (w = !0), C.width = 0, y.width = b, y.scaledWidth = b), s && (w = !1), Ze(m, {
|
|
1930
1930
|
ref: this._setRef,
|
|
1931
1931
|
style: {
|
|
1932
1932
|
...C,
|
|
@@ -1979,7 +1979,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
1979
1979
|
}
|
|
1980
1980
|
);
|
|
1981
1981
|
}, ii = (t, e, n) => {
|
|
1982
|
-
const o =
|
|
1982
|
+
const o = H(), { contentRef: r } = ge(), { heights: i, widths: s } = qe(), { setFocusedPage: l } = oe(), [d, u] = G([]), { targetScrollPage: m } = pn(), P = Tt(d, 0, 500), h = W(() => i.map((C, y) => {
|
|
1983
1983
|
const w = s[y], S = Zr(y + 1, t), f = w * S.columnIndex, p = C * S.rowIndex, g = f + w, c = p + C;
|
|
1984
1984
|
return {
|
|
1985
1985
|
pageNumber: y + 1,
|
|
@@ -2000,7 +2000,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2000
2000
|
m.current = void 0;
|
|
2001
2001
|
}, 500);
|
|
2002
2002
|
}, [P, l]);
|
|
2003
|
-
const
|
|
2003
|
+
const b = E(
|
|
2004
2004
|
(C) => {
|
|
2005
2005
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
2006
2006
|
const y = C.target, w = {
|
|
@@ -2012,7 +2012,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2012
2012
|
const p = f.endX >= w.startLeft && f.endY >= w.startTop, g = f.startX <= w.endLeft && f.startY <= w.endTop;
|
|
2013
2013
|
return p && g;
|
|
2014
2014
|
}).map((f) => {
|
|
2015
|
-
const p = w.startLeft > f.startX ? w.startLeft : f.startX, g = w.startTop > f.startY ? w.startTop : f.startY, c = w.endLeft < f.endX ? w.endLeft : f.endX,
|
|
2015
|
+
const p = w.startLeft > f.startX ? w.startLeft : f.startX, g = w.startTop > f.startY ? w.startTop : f.startY, c = w.endLeft < f.endX ? w.endLeft : f.endX, _ = w.endTop < f.endY ? w.endTop : f.endY, v = c - p, T = _ - g, x = +(v * T / (f.width * f.height) * 100).toFixed(2);
|
|
2016
2016
|
return {
|
|
2017
2017
|
pageNumber: f.pageNumber,
|
|
2018
2018
|
ratio: x
|
|
@@ -2025,10 +2025,10 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2025
2025
|
);
|
|
2026
2026
|
z(() => {
|
|
2027
2027
|
if (n)
|
|
2028
|
-
return n == null || n.addEventListener("scroll",
|
|
2029
|
-
n == null || n.removeEventListener("scroll",
|
|
2028
|
+
return n == null || n.addEventListener("scroll", b), () => {
|
|
2029
|
+
n == null || n.removeEventListener("scroll", b);
|
|
2030
2030
|
};
|
|
2031
|
-
}, [n,
|
|
2031
|
+
}, [n, b]);
|
|
2032
2032
|
}, be = {
|
|
2033
2033
|
"rp-layout": "_rp-layout_1g4ff_1",
|
|
2034
2034
|
"rp-content": "_rp-content_1g4ff_5",
|
|
@@ -2071,23 +2071,23 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2071
2071
|
setTotalInnerDimensions: m,
|
|
2072
2072
|
virtualScrollableElementRef: P,
|
|
2073
2073
|
totalInnerDimensions: h,
|
|
2074
|
-
pageScrollElementRef:
|
|
2075
|
-
} = et(), C =
|
|
2074
|
+
pageScrollElementRef: b
|
|
2075
|
+
} = et(), C = H(!0), { nextPage: y, prevPage: w, setFocusedPage: S, focusedPage: f } = oe(), { scrollMode: p } = Ne(), { viewMode: g } = Oe(), c = H(null), { loading: _ } = J(), { passwordRequired: v } = or(), { LoaderImageComponent: T } = hn(), R = H(
|
|
2076
2076
|
h
|
|
2077
|
-
), x =
|
|
2077
|
+
), x = H({
|
|
2078
2078
|
viewMode: g,
|
|
2079
2079
|
scrollMode: p
|
|
2080
|
-
}), I =
|
|
2080
|
+
}), I = H(!1), O = H(), { isFullScreen: A } = lr(), {
|
|
2081
2081
|
pageDimension: F,
|
|
2082
2082
|
rowCount: L,
|
|
2083
2083
|
rowHeight: N,
|
|
2084
2084
|
columnCount: D,
|
|
2085
2085
|
columnWidth: k,
|
|
2086
2086
|
estimatedColumnWidth: q,
|
|
2087
|
-
estimatedRowHeight:
|
|
2088
|
-
} = ei(), U = Tt(h, 100), V =
|
|
2087
|
+
estimatedRowHeight: $
|
|
2088
|
+
} = ei(), U = Tt(h, 100), V = H();
|
|
2089
2089
|
ii(D, L, P);
|
|
2090
|
-
const K =
|
|
2090
|
+
const K = H({
|
|
2091
2091
|
scrollTop: 0,
|
|
2092
2092
|
scrollLeft: 0
|
|
2093
2093
|
});
|
|
@@ -2197,11 +2197,11 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2197
2197
|
[ee, le, ue]
|
|
2198
2198
|
);
|
|
2199
2199
|
return z(() => {
|
|
2200
|
-
|
|
2201
|
-
}, [
|
|
2200
|
+
_ && de();
|
|
2201
|
+
}, [_]), z(() => {
|
|
2202
2202
|
if (!(U.height === 0 || !C.current)) {
|
|
2203
2203
|
if (e === ne.PAGE_SCROLLING) {
|
|
2204
|
-
t !== f &&
|
|
2204
|
+
t !== f && b && S(t), C.current = !1;
|
|
2205
2205
|
return;
|
|
2206
2206
|
}
|
|
2207
2207
|
i(t, "auto"), S(t), C.current = !1;
|
|
@@ -2209,7 +2209,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2209
2209
|
}, [
|
|
2210
2210
|
i,
|
|
2211
2211
|
e,
|
|
2212
|
-
|
|
2212
|
+
b,
|
|
2213
2213
|
S,
|
|
2214
2214
|
U
|
|
2215
2215
|
]), /* @__PURE__ */ M(me, { children: [
|
|
@@ -2235,7 +2235,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2235
2235
|
height: Z,
|
|
2236
2236
|
width: B,
|
|
2237
2237
|
estimatedColumnWidth: q,
|
|
2238
|
-
estimatedRowHeight:
|
|
2238
|
+
estimatedRowHeight: $,
|
|
2239
2239
|
rowCount: L,
|
|
2240
2240
|
className: re(
|
|
2241
2241
|
ue["rp-pages"],
|
|
@@ -2243,7 +2243,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2243
2243
|
),
|
|
2244
2244
|
children: ai
|
|
2245
2245
|
}
|
|
2246
|
-
) :
|
|
2246
|
+
) : _ ? null : /* @__PURE__ */ a(
|
|
2247
2247
|
"div",
|
|
2248
2248
|
{
|
|
2249
2249
|
className: ue["rp-loader"],
|
|
@@ -2280,7 +2280,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2280
2280
|
z(() => {
|
|
2281
2281
|
l(t.toString());
|
|
2282
2282
|
}, [t]);
|
|
2283
|
-
const
|
|
2283
|
+
const b = E((f) => {
|
|
2284
2284
|
const p = f.target.value;
|
|
2285
2285
|
l(p);
|
|
2286
2286
|
}, []), C = E(async () => {
|
|
@@ -2319,7 +2319,7 @@ const ri = ln(({ widths: t, heights: e }) => {
|
|
|
2319
2319
|
{
|
|
2320
2320
|
onKeyDown: w,
|
|
2321
2321
|
onBlur: y,
|
|
2322
|
-
onChange:
|
|
2322
|
+
onChange: b,
|
|
2323
2323
|
value: s,
|
|
2324
2324
|
className: mt["rp-page-input"],
|
|
2325
2325
|
id: "page-input",
|
|
@@ -2588,7 +2588,7 @@ const Ie = {
|
|
|
2588
2588
|
subject: m,
|
|
2589
2589
|
createdOn: P,
|
|
2590
2590
|
creator: h,
|
|
2591
|
-
keywords:
|
|
2591
|
+
keywords: b,
|
|
2592
2592
|
modifiedOn: C,
|
|
2593
2593
|
pdfProducer: y,
|
|
2594
2594
|
pdfVersion: w,
|
|
@@ -2601,7 +2601,7 @@ const Ie = {
|
|
|
2601
2601
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: d },
|
|
2602
2602
|
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: u },
|
|
2603
2603
|
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2604
|
-
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value:
|
|
2604
|
+
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: b },
|
|
2605
2605
|
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2606
2606
|
{
|
|
2607
2607
|
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
@@ -2704,15 +2704,15 @@ const Ie = {
|
|
|
2704
2704
|
selectionModeTool: m,
|
|
2705
2705
|
jumpNavigationTool: P,
|
|
2706
2706
|
printTool: h,
|
|
2707
|
-
fullscreenTool:
|
|
2708
|
-
} = ve(), { localeMessages: C } = se(), [y, w] = G(0), S =
|
|
2707
|
+
fullscreenTool: b
|
|
2708
|
+
} = ve(), { localeMessages: C } = se(), [y, w] = G(0), S = H(
|
|
2709
2709
|
new ResizeObserver((p) => {
|
|
2710
2710
|
w(p[0].contentRect.height);
|
|
2711
2711
|
})
|
|
2712
2712
|
), f = W(() => {
|
|
2713
2713
|
const p = P || u || m || d || l;
|
|
2714
2714
|
let g = !1;
|
|
2715
|
-
return r && (g = !(!i && !s && !h && !
|
|
2715
|
+
return r && (g = !(!i && !s && !h && !b)), p || g;
|
|
2716
2716
|
}, [
|
|
2717
2717
|
i,
|
|
2718
2718
|
s,
|
|
@@ -2787,7 +2787,7 @@ const Ie = {
|
|
|
2787
2787
|
const { zoomOutIcon: t } = pe();
|
|
2788
2788
|
return t || /* @__PURE__ */ a(To, {});
|
|
2789
2789
|
}, Bi = () => {
|
|
2790
|
-
const { zoomLevel: t, setZoomLevel: e } = Je(), { container: n, pagesRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: i } = oe(), { pageRotate: s } = Ue(), { pages: l } = J(), { isSmallScreen: d } = Pe(), { localeMessages: u } = se(), { viewMode: m } = Oe(), [P, h] = G(0), [
|
|
2790
|
+
const { zoomLevel: t, setZoomLevel: e } = Je(), { container: n, pagesRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: i } = oe(), { pageRotate: s } = Ue(), { pages: l } = J(), { isSmallScreen: d } = Pe(), { localeMessages: u } = se(), { viewMode: m } = Oe(), [P, h] = G(0), [b, C] = G(!1), y = H(
|
|
2791
2791
|
new ResizeObserver((v) => {
|
|
2792
2792
|
h(v[0].contentRect.height);
|
|
2793
2793
|
})
|
|
@@ -2817,7 +2817,7 @@ const Ie = {
|
|
|
2817
2817
|
e(O);
|
|
2818
2818
|
},
|
|
2819
2819
|
[e, g, o]
|
|
2820
|
-
),
|
|
2820
|
+
), _ = E(
|
|
2821
2821
|
(v) => {
|
|
2822
2822
|
typeof v == "number" ? e(v) : c(v);
|
|
2823
2823
|
},
|
|
@@ -2839,14 +2839,14 @@ const Ie = {
|
|
|
2839
2839
|
yt,
|
|
2840
2840
|
{
|
|
2841
2841
|
container: n,
|
|
2842
|
-
open:
|
|
2842
|
+
open: b,
|
|
2843
2843
|
onOpenChange: C,
|
|
2844
2844
|
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Y, { content: u == null ? void 0 : u.zoomSelectTooltip, children: /* @__PURE__ */ M(
|
|
2845
2845
|
ie,
|
|
2846
2846
|
{
|
|
2847
2847
|
className: re(
|
|
2848
2848
|
Re["rp-current-zoom-wrapper"],
|
|
2849
|
-
|
|
2849
|
+
b && Re.active
|
|
2850
2850
|
),
|
|
2851
2851
|
"aria-label": u == null ? void 0 : u.zoomSelectTooltip,
|
|
2852
2852
|
children: [
|
|
@@ -2867,12 +2867,12 @@ const Ie = {
|
|
|
2867
2867
|
className: Re["rp-zoom-dropdown-content"],
|
|
2868
2868
|
children: [
|
|
2869
2869
|
/* @__PURE__ */ M(Qe, { children: [
|
|
2870
|
-
/* @__PURE__ */ a(Ce, { onClick: () =>
|
|
2871
|
-
/* @__PURE__ */ a(Ce, { onClick: () =>
|
|
2872
|
-
/* @__PURE__ */ a(Ce, { onClick: () =>
|
|
2870
|
+
/* @__PURE__ */ a(Ce, { onClick: () => _(st.ACTUAL), children: u == null ? void 0 : u.zoomActualSize }),
|
|
2871
|
+
/* @__PURE__ */ a(Ce, { onClick: () => _(st.PAGE_FIT), children: u == null ? void 0 : u.zoomPageFit }),
|
|
2872
|
+
/* @__PURE__ */ a(Ce, { onClick: () => _(st.PAGE_WIDTH), children: u == null ? void 0 : u.zoomPageWidth })
|
|
2873
2873
|
] }),
|
|
2874
2874
|
/* @__PURE__ */ a(It, {}),
|
|
2875
|
-
/* @__PURE__ */ a(Qe, { children: qi.map((v) => /* @__PURE__ */ M(Ce, { onClick: () =>
|
|
2875
|
+
/* @__PURE__ */ a(Qe, { children: qi.map((v) => /* @__PURE__ */ M(Ce, { onClick: () => _(v), children: [
|
|
2876
2876
|
v,
|
|
2877
2877
|
" %"
|
|
2878
2878
|
] }, v)) })
|
|
@@ -2936,25 +2936,25 @@ const Ie = {
|
|
|
2936
2936
|
totalMatches: m,
|
|
2937
2937
|
currentMatchPosition: P,
|
|
2938
2938
|
nextMatch: h,
|
|
2939
|
-
prevMatch:
|
|
2939
|
+
prevMatch: b,
|
|
2940
2940
|
search: C
|
|
2941
|
-
} = Rt(), { searchTool: y = !0 } = ve(), [w, S] = G(C), { localeMessages: f } = se(), { isSmallScreen: p } = Pe(), [g, c] = G(null),
|
|
2941
|
+
} = Rt(), { searchTool: y = !0 } = ve(), [w, S] = G(C), { localeMessages: f } = se(), { isSmallScreen: p } = Pe(), [g, c] = G(null), _ = E(() => {
|
|
2942
2942
|
n(!0);
|
|
2943
2943
|
}, []), v = E(() => {
|
|
2944
2944
|
u(""), S(""), n(!1);
|
|
2945
|
-
}, [u]), T = (
|
|
2946
|
-
const U =
|
|
2945
|
+
}, [u]), T = ($) => {
|
|
2946
|
+
const U = $.key === "Enter", V = $.key === " ";
|
|
2947
2947
|
(U || V) && v();
|
|
2948
2948
|
}, R = E(
|
|
2949
|
-
(
|
|
2950
|
-
|
|
2949
|
+
($) => {
|
|
2950
|
+
$.key === "Escape" && e && v();
|
|
2951
2951
|
},
|
|
2952
2952
|
[e]
|
|
2953
2953
|
), x = E(
|
|
2954
|
-
(
|
|
2955
|
-
|
|
2954
|
+
($) => {
|
|
2955
|
+
$.shiftKey && $.key === "Enter" ? b() : $.key === "Enter" && C !== w ? u(w) : $.key === "Enter" && h();
|
|
2956
2956
|
},
|
|
2957
|
-
[w,
|
|
2957
|
+
[w, b, h, u, C]
|
|
2958
2958
|
);
|
|
2959
2959
|
z(() => (window.addEventListener("keydown", R), () => {
|
|
2960
2960
|
window.removeEventListener("keydown", R);
|
|
@@ -2963,18 +2963,18 @@ const Ie = {
|
|
|
2963
2963
|
r.focus();
|
|
2964
2964
|
}, 0);
|
|
2965
2965
|
}, [r]);
|
|
2966
|
-
const I = E((
|
|
2967
|
-
S(
|
|
2966
|
+
const I = E(($) => {
|
|
2967
|
+
S($.target.value);
|
|
2968
2968
|
}, []), O = E(() => {
|
|
2969
2969
|
S(""), u("");
|
|
2970
2970
|
}, [u]), A = W(() => `${P} / ${m}`, [P, m]), { wholeWords: F, matchCase: L } = W(() => s, [s]), N = E(
|
|
2971
|
-
(
|
|
2972
|
-
l((U) => ({ ...U, matchCase:
|
|
2971
|
+
($) => {
|
|
2972
|
+
l((U) => ({ ...U, matchCase: $ }));
|
|
2973
2973
|
},
|
|
2974
2974
|
[l]
|
|
2975
2975
|
), D = E(
|
|
2976
|
-
(
|
|
2977
|
-
l((U) => ({ ...U, wholeWords:
|
|
2976
|
+
($) => {
|
|
2977
|
+
l((U) => ({ ...U, wholeWords: $ }));
|
|
2978
2978
|
},
|
|
2979
2979
|
[l]
|
|
2980
2980
|
);
|
|
@@ -2982,15 +2982,15 @@ const Ie = {
|
|
|
2982
2982
|
v();
|
|
2983
2983
|
}, [o, v]);
|
|
2984
2984
|
const k = W(() => (g == null ? void 0 : g.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [g]), q = E(
|
|
2985
|
-
(
|
|
2986
|
-
if (
|
|
2985
|
+
($) => {
|
|
2986
|
+
if ($.key === "Tab") {
|
|
2987
2987
|
const U = document.activeElement;
|
|
2988
2988
|
let V = 0;
|
|
2989
2989
|
k.forEach((Q, le) => {
|
|
2990
2990
|
Q === U && (V = le);
|
|
2991
2991
|
});
|
|
2992
2992
|
let K = V + 1;
|
|
2993
|
-
|
|
2993
|
+
$.shiftKey && (K = V - 1);
|
|
2994
2994
|
const X = k[K];
|
|
2995
2995
|
if (X)
|
|
2996
2996
|
X.focus();
|
|
@@ -3017,7 +3017,7 @@ const Ie = {
|
|
|
3017
3017
|
triggerComponent: /* @__PURE__ */ a(Y, { content: f == null ? void 0 : f.searchButtonTooltip, children: /* @__PURE__ */ a(
|
|
3018
3018
|
ie,
|
|
3019
3019
|
{
|
|
3020
|
-
onClick:
|
|
3020
|
+
onClick: _,
|
|
3021
3021
|
active: e,
|
|
3022
3022
|
"aria-label": f == null ? void 0 : f.searchButtonTooltip,
|
|
3023
3023
|
children: /* @__PURE__ */ a(an, {})
|
|
@@ -3136,38 +3136,41 @@ const Ie = {
|
|
|
3136
3136
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3137
3137
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3138
3138
|
}, Qi = (t) => {
|
|
3139
|
-
const { pageNumber: e, isFocused: n, viewport: o } = t, { goToPage: r } = oe(), { pageRotate: i } = Ue(), s =
|
|
3139
|
+
const { pageNumber: e, isFocused: n, viewport: o } = t, { goToPage: r } = oe(), { pageRotate: i } = Ue(), s = H(null), l = yn(), { pages: d } = J(), [u, m] = G(null), P = H(!1), h = H(), b = W(() => n ? We["rp-thumbnail-active"] : "", [n]), C = W(() => ({
|
|
3140
3140
|
width: Math.round(o.width),
|
|
3141
3141
|
height: Math.round(o.height)
|
|
3142
|
-
}), [o]),
|
|
3142
|
+
}), [o]), y = E(() => {
|
|
3143
3143
|
e && r(e);
|
|
3144
3144
|
}, [r, e]);
|
|
3145
3145
|
return z(() => {
|
|
3146
|
-
const
|
|
3147
|
-
|
|
3146
|
+
const w = d.get(e);
|
|
3147
|
+
h.current === w || (m(null), h.current = w);
|
|
3148
|
+
}, [d, e]), z(() => {
|
|
3149
|
+
const w = d.get(e);
|
|
3150
|
+
if (!s.current || !e || !w || u)
|
|
3148
3151
|
return;
|
|
3149
|
-
const
|
|
3150
|
-
|
|
3152
|
+
const S = new IntersectionObserver((f) => {
|
|
3153
|
+
f.forEach((p) => {
|
|
3151
3154
|
if (P.current) {
|
|
3152
3155
|
P.current = !1, l.removeQueue(`thumbnail-${e}`);
|
|
3153
3156
|
return;
|
|
3154
3157
|
}
|
|
3155
|
-
if (
|
|
3156
|
-
const
|
|
3158
|
+
if (p.isIntersecting) {
|
|
3159
|
+
const g = document.createElement("canvas");
|
|
3157
3160
|
P.current = !0, l.enqueue(
|
|
3158
3161
|
`thumbnail-${e}`,
|
|
3159
3162
|
{
|
|
3160
|
-
page:
|
|
3161
|
-
canvasElem:
|
|
3163
|
+
page: w.page,
|
|
3164
|
+
canvasElem: g,
|
|
3162
3165
|
options: {
|
|
3163
3166
|
scale: 1
|
|
3164
3167
|
},
|
|
3165
3168
|
onLoaded: () => {
|
|
3166
|
-
|
|
3167
|
-
if (!
|
|
3169
|
+
g.toBlob((c) => {
|
|
3170
|
+
if (!c)
|
|
3168
3171
|
return;
|
|
3169
|
-
const
|
|
3170
|
-
m(
|
|
3172
|
+
const _ = URL.createObjectURL(c);
|
|
3173
|
+
m(_);
|
|
3171
3174
|
});
|
|
3172
3175
|
}
|
|
3173
3176
|
},
|
|
@@ -3176,13 +3179,13 @@ const Ie = {
|
|
|
3176
3179
|
}
|
|
3177
3180
|
});
|
|
3178
3181
|
});
|
|
3179
|
-
return s.current &&
|
|
3180
|
-
|
|
3182
|
+
return s.current && S.observe(s.current), () => {
|
|
3183
|
+
S.disconnect(), l.removeQueue(`thumbnail-${e}`);
|
|
3181
3184
|
};
|
|
3182
3185
|
}, [l, e, d, u]), /* @__PURE__ */ M(
|
|
3183
3186
|
"div",
|
|
3184
3187
|
{
|
|
3185
|
-
onClick:
|
|
3188
|
+
onClick: y,
|
|
3186
3189
|
id: `page-${e}`,
|
|
3187
3190
|
className: We["rp-thumbnail-wrapper"],
|
|
3188
3191
|
ref: s,
|
|
@@ -3193,13 +3196,13 @@ const Ie = {
|
|
|
3193
3196
|
style: {
|
|
3194
3197
|
transform: `rotate(${i[e || 0]}deg)`
|
|
3195
3198
|
},
|
|
3196
|
-
className: re(
|
|
3199
|
+
className: re(b, We["rp-thumbnail"]),
|
|
3197
3200
|
children: u ? /* @__PURE__ */ a(
|
|
3198
3201
|
"img",
|
|
3199
3202
|
{
|
|
3200
3203
|
src: u,
|
|
3201
|
-
width:
|
|
3202
|
-
height:
|
|
3204
|
+
width: C.width,
|
|
3205
|
+
height: C.height,
|
|
3203
3206
|
alt: "thumbnail"
|
|
3204
3207
|
}
|
|
3205
3208
|
) : /* @__PURE__ */ a(
|
|
@@ -3207,8 +3210,8 @@ const Ie = {
|
|
|
3207
3210
|
{
|
|
3208
3211
|
className: We["rp-thumbnail-loader"],
|
|
3209
3212
|
style: {
|
|
3210
|
-
width: `${
|
|
3211
|
-
height: `${
|
|
3213
|
+
width: `${C.width}px`,
|
|
3214
|
+
height: `${C.height}px`
|
|
3212
3215
|
},
|
|
3213
3216
|
children: /* @__PURE__ */ a(Pt, {})
|
|
3214
3217
|
}
|
|
@@ -3226,24 +3229,24 @@ const Ie = {
|
|
|
3226
3229
|
const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
|
|
3227
3230
|
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - Yi);
|
|
3228
3231
|
}, ea = Ve((t, e) => {
|
|
3229
|
-
const { show: n } = t, { focusedPage: o, totalPages: r } = oe(), { thumbnailPages: i, addPage: s, thumbnailLength: l, addToPage: d } = Cn(), u =
|
|
3232
|
+
const { show: n } = t, { focusedPage: o, totalPages: r } = oe(), { thumbnailPages: i, addPage: s, thumbnailLength: l, addToPage: d } = Cn(), u = H(null), m = H(1);
|
|
3230
3233
|
cn(e, () => u.current);
|
|
3231
3234
|
const P = W(() => Object.values(i), [i]), h = E(() => {
|
|
3232
|
-
const
|
|
3233
|
-
|
|
3235
|
+
const b = l + 1;
|
|
3236
|
+
b <= r && s(b);
|
|
3234
3237
|
}, [s, r, l]);
|
|
3235
3238
|
return z(() => {
|
|
3236
3239
|
o > l ? d(o) : n && m.current !== o && (Ji(u.current, o), m.current = o);
|
|
3237
|
-
}, [o, l, d, n, P]), Pr(u.current, h), /* @__PURE__ */ a("div", { ref: u, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: sn["rp-thumbnails"], children: n ? P.map((
|
|
3240
|
+
}, [o, l, d, n, P]), Pr(u.current, h), /* @__PURE__ */ a("div", { ref: u, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: sn["rp-thumbnails"], children: n ? P.map((b, C) => {
|
|
3238
3241
|
var y, w;
|
|
3239
3242
|
return /* @__PURE__ */ a(
|
|
3240
3243
|
Qi,
|
|
3241
3244
|
{
|
|
3242
|
-
isFocused: o === ((y =
|
|
3243
|
-
pageNumber: (w =
|
|
3244
|
-
loading:
|
|
3245
|
-
viewport:
|
|
3246
|
-
defaultRotation:
|
|
3245
|
+
isFocused: o === ((y = b.page) == null ? void 0 : y.pageNumber),
|
|
3246
|
+
pageNumber: (w = b.page) == null ? void 0 : w.pageNumber,
|
|
3247
|
+
loading: b.loading,
|
|
3248
|
+
viewport: b.viewport,
|
|
3249
|
+
defaultRotation: b.defaultRotation
|
|
3247
3250
|
},
|
|
3248
3251
|
C
|
|
3249
3252
|
);
|
|
@@ -3252,7 +3255,7 @@ const Ie = {
|
|
|
3252
3255
|
const { thumbnailIcon: t } = pe();
|
|
3253
3256
|
return t || /* @__PURE__ */ a(wr, {});
|
|
3254
3257
|
}, na = () => {
|
|
3255
|
-
const { active: t, setActive: e } = Cn(), [n, o] = G(200), r =
|
|
3258
|
+
const { active: t, setActive: e } = Cn(), [n, o] = G(200), r = H(null), { thumbnailTool: i, sidebarEnable: s } = ve(), { localeMessages: l } = se(), d = E(() => {
|
|
3256
3259
|
e((m) => !m);
|
|
3257
3260
|
}, []), u = W(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: d, active: t }) : i ? /* @__PURE__ */ a(Y, { content: l == null ? void 0 : l.thumbnailTooltip, children: /* @__PURE__ */ a(
|
|
3258
3261
|
ie,
|
|
@@ -3297,10 +3300,10 @@ const Ie = {
|
|
|
3297
3300
|
onLoaded: d,
|
|
3298
3301
|
cleanupOnLoaded: u,
|
|
3299
3302
|
onLayoutWidthChange: m
|
|
3300
|
-
} = t, [P, h] = G(null), { setContainer:
|
|
3303
|
+
} = t, [P, h] = G(null), { setContainer: b, setContentRef: C } = ge(), { loading: y } = J(), { LoaderImageComponent: w } = hn();
|
|
3301
3304
|
return z(() => (d && d(), () => {
|
|
3302
3305
|
u && u();
|
|
3303
|
-
}), [d, u]), /* @__PURE__ */ a(Rn, { toolbarRef: P, ref: e, children: /* @__PURE__ */ a(Ir, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Cr, { slots: o, children: /* @__PURE__ */ a(yr, { icons: r, children: /* @__PURE__ */ M(Sr, { getContainerRef:
|
|
3306
|
+
}), [d, u]), /* @__PURE__ */ a(Rn, { toolbarRef: P, ref: e, children: /* @__PURE__ */ a(Ir, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Cr, { slots: o, children: /* @__PURE__ */ a(yr, { icons: r, children: /* @__PURE__ */ M(Sr, { getContainerRef: b, style: i, className: s, children: [
|
|
3304
3307
|
/* @__PURE__ */ M(xr, { children: [
|
|
3305
3308
|
/* @__PURE__ */ M("div", { className: be["rp-layout"], children: [
|
|
3306
3309
|
/* @__PURE__ */ a(Xi, { ref: h }),
|