@pdf-viewer/react 1.11.0-rc.0 → 1.11.0-rc.1
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/{ToolbarLayout.module-882e61e6.js → ToolbarLayout.module-e774f3e1.js} +491 -491
- 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/RPLayout.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/RPMoreOptions.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/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +1 -1
- package/dist/components/layout/toolbar/ToolbarDefault.js +1 -1
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.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,18 +1,18 @@
|
|
|
1
|
-
import { jsx as a, Fragment as he, jsxs as
|
|
1
|
+
import { jsx as a, Fragment as he, jsxs as $ } from "react/jsx-runtime";
|
|
2
2
|
import * as X from "react";
|
|
3
|
-
import { useRef as k, useEffect as z, useCallback as
|
|
3
|
+
import { useRef as k, useEffect as z, useCallback as E, useState as q, useMemo as W, createContext as $e, useContext as qe, useImperativeHandle as on, createElement as Ve, PureComponent as oo, Component as ro, memo as rn, forwardRef as io } from "react";
|
|
4
4
|
import { ChevronUpIcon as Ze } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as we } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as an } from "./components/ui/Input.js";
|
|
7
|
-
import { ViewMode as
|
|
8
|
-
import { useScrollModeContext as
|
|
7
|
+
import { ViewMode as Le, ScrollMode as ne, AnnotationSubType as Dt, SelectionMode as ao, ErrorType as so } from "./utils/types.js";
|
|
8
|
+
import { useScrollModeContext as Ne } from "./contexts/ScrollModeContext.js";
|
|
9
9
|
import { useDocumentContext as oe } from "./contexts/RPDocumentContext.js";
|
|
10
10
|
import { useDocumentPasswordContext as co } from "./contexts/DocumentPasswordContext.js";
|
|
11
11
|
import { useDarkModeContext as lo } from "./contexts/DarkModeContext.js";
|
|
12
12
|
import "./contexts/RotationContext.js";
|
|
13
13
|
import { useLayerContext as uo } from "./contexts/LayerContext.js";
|
|
14
14
|
import { useZoomContext as _t } from "./contexts/ZoomContext.js";
|
|
15
|
-
import { useViewModeContext as
|
|
15
|
+
import { useViewModeContext as Fe } from "./contexts/ViewModeContext.js";
|
|
16
16
|
import { useVirtualScrollContext as Ye } from "./contexts/VirtualScrollContext.js";
|
|
17
17
|
import { useVirtualGridContext as sn } from "./contexts/VirtualGridContext.js";
|
|
18
18
|
import { useSelectionModeContext as po } from "./contexts/SelectionModeContext.js";
|
|
@@ -34,7 +34,7 @@ import { Queue as To } from "./utils/Queue.js";
|
|
|
34
34
|
import { renderPage as Co } from "./utils/renderPage.js";
|
|
35
35
|
import { useGlobalCurrentPage as Po } from "./contexts/GlobalCurrentPage.js";
|
|
36
36
|
import { useLoaderContext as bt } from "./contexts/LoaderContext.js";
|
|
37
|
-
import { useToolComponentContext as
|
|
37
|
+
import { useToolComponentContext as Oe } from "./contexts/ToolComponentContext.js";
|
|
38
38
|
import { useIconToolContext as Te } from "./contexts/IconToolContext.js";
|
|
39
39
|
import { useOtherToolContext as yo } from "./contexts/OtherToolContext.js";
|
|
40
40
|
import "./components/RPConfig.js";
|
|
@@ -42,7 +42,7 @@ import { ThumbnailIcon as So } from "./components/icons/Thumbnail.js";
|
|
|
42
42
|
import { c as ce } from "./clsx-0c6e471a.js";
|
|
43
43
|
import { LoaderIcon as ln } from "./components/icons/LoaderIcon.js";
|
|
44
44
|
import { Container as Io } from "./components/layout/Container.js";
|
|
45
|
-
import { useViewportContext as
|
|
45
|
+
import { useViewportContext as De, ViewportProvider as xo } from "./contexts/ViewportContext.js";
|
|
46
46
|
import { useToolbarComponentContext as Ce, ToolbarComponentProvider as Ro } from "./contexts/ToolbarComponentContext.js";
|
|
47
47
|
import { RPSplitter as Lo } from "./components/layout/sidebar/RPSplitter.js";
|
|
48
48
|
import { WrapperLayout as Eo } from "./components/layout/WrapperLayout.js";
|
|
@@ -75,7 +75,7 @@ import { useGrabScroll as nr } from "./utils/hooks/useGrabScroll.js";
|
|
|
75
75
|
import { usePinch as or } from "./utils/hooks/usePinch.js";
|
|
76
76
|
import { useDebounce as Ct } from "./utils/hooks/useDebounce.js";
|
|
77
77
|
import rr from "./components/ui/PasswordModal.js";
|
|
78
|
-
import { getScrollDistance as
|
|
78
|
+
import { getScrollDistance as Me } from "./utils/getScrollDistance.js";
|
|
79
79
|
import { getWordPositionInPage as ir } from "./utils/getWordPositionInPage.js";
|
|
80
80
|
import { getThumbnailViewport as ar } from "./utils/getThumbnailViewport.js";
|
|
81
81
|
import { smoothScrollTo as at } from "./utils/smoothScrollTo.js";
|
|
@@ -101,13 +101,13 @@ import { SearchIcon as gn } from "./components/icons/SearchIcon.js";
|
|
|
101
101
|
import { ClearIcon as Lr } from "./components/icons/ClearIcon.js";
|
|
102
102
|
import { InfoIcon as Wt } from "./components/icons/InfoIcon.js";
|
|
103
103
|
import './assets/ToolbarLayout.css';const vn = () => {
|
|
104
|
-
const { viewMode: t } =
|
|
104
|
+
const { viewMode: t } = Fe(), { scrollMode: e } = Ne(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = Ye(), { setFocusedPage: i } = de(), c = k(), { columnCount: l } = sn(), { widths: d, heights: f } = Ge(), m = k(e), C = k(t), p = k(l), { targetScrollPage: T } = cn();
|
|
105
105
|
z(() => {
|
|
106
106
|
n != null && n.scrollToItem && (c.current = n);
|
|
107
107
|
}, [n]), z(() => {
|
|
108
108
|
m.current = e, C.current = t;
|
|
109
109
|
}, [e, t]);
|
|
110
|
-
const P =
|
|
110
|
+
const P = E(
|
|
111
111
|
(g, S) => {
|
|
112
112
|
if (!o)
|
|
113
113
|
return;
|
|
@@ -136,12 +136,12 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
136
136
|
m.current = e, C.current = t;
|
|
137
137
|
}, [e, t]), z(() => {
|
|
138
138
|
p.current = l;
|
|
139
|
-
}, [l]), { scrollToPage:
|
|
139
|
+
}, [l]), { scrollToPage: E(
|
|
140
140
|
(g, S = "smooth") => {
|
|
141
141
|
i(g);
|
|
142
142
|
const v = g - 1;
|
|
143
143
|
let h = v, u = 0;
|
|
144
|
-
if (C.current ===
|
|
144
|
+
if (C.current === Le.DUAL_PAGE && m.current === ne.PAGE_SCROLLING) {
|
|
145
145
|
P(g, S);
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
@@ -159,32 +159,32 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
159
159
|
);
|
|
160
160
|
if (m.current === ne.HORIZONTAL_SCROLLING) {
|
|
161
161
|
u = v;
|
|
162
|
-
const
|
|
163
|
-
left: Math.floor(
|
|
162
|
+
const I = Me(w, u), R = {
|
|
163
|
+
left: Math.floor(I),
|
|
164
164
|
top: 0
|
|
165
165
|
};
|
|
166
166
|
return s.scrollTo({
|
|
167
|
-
...
|
|
167
|
+
...R,
|
|
168
168
|
behavior: S
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
if (C.current ===
|
|
171
|
+
if (C.current === Le.DUAL_PAGE) {
|
|
172
172
|
u = v % 2, h = Math.floor(v / 2);
|
|
173
|
-
const
|
|
174
|
-
left: Math.floor(
|
|
175
|
-
top: Math.floor(
|
|
173
|
+
const R = Me(w, u), L = Me(_, h), N = {
|
|
174
|
+
left: Math.floor(R),
|
|
175
|
+
top: Math.floor(L)
|
|
176
176
|
};
|
|
177
177
|
return s.scrollTo({
|
|
178
|
-
...
|
|
178
|
+
...N,
|
|
179
179
|
behavior: S
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
const y =
|
|
182
|
+
const y = Me(_, h), x = {
|
|
183
183
|
left: 0,
|
|
184
184
|
top: Math.floor(y)
|
|
185
185
|
};
|
|
186
186
|
return s.scrollTo({
|
|
187
|
-
...
|
|
187
|
+
...x,
|
|
188
188
|
behavior: S
|
|
189
189
|
});
|
|
190
190
|
},
|
|
@@ -199,7 +199,7 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
199
199
|
]
|
|
200
200
|
) };
|
|
201
201
|
}, Er = (t = 1) => {
|
|
202
|
-
const [e, n] =
|
|
202
|
+
const [e, n] = q(t), [r, o] = q(0), { scrollToPage: i } = vn(), c = k(1), { viewMode: l } = Fe(), { scrollMode: d } = Ne(), { widths: f } = Ge(), { pagesRef: m } = be(), C = Ct(e, 100), p = E(
|
|
203
203
|
(h) => {
|
|
204
204
|
if (!/^[0-9]*$/g.test(h.toString()) || !h)
|
|
205
205
|
return { success: !1, currentPage: c.current };
|
|
@@ -207,22 +207,22 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
207
207
|
return s < 0 || s > r ? { success: !1, currentPage: c.current } : (n(s), c.current = s, { success: !0, currentPage: +h });
|
|
208
208
|
},
|
|
209
209
|
[r]
|
|
210
|
-
), T =
|
|
210
|
+
), T = E(p, [p]), P = E(
|
|
211
211
|
(h) => {
|
|
212
212
|
const u = p(h);
|
|
213
213
|
return u.success && i(u.currentPage), u;
|
|
214
214
|
},
|
|
215
215
|
[p, i]
|
|
216
|
-
), b =
|
|
216
|
+
), b = E((h) => {
|
|
217
217
|
const u = h % 2 === 1;
|
|
218
218
|
if (!m || u)
|
|
219
219
|
return !1;
|
|
220
220
|
const s = u ? f[h] : f[h - 1], w = u ? f[h + 1] : f[h];
|
|
221
|
-
return l ===
|
|
222
|
-
}, [l, f, m, r]), g =
|
|
221
|
+
return l === Le.DUAL_PAGE && s + w < m.clientWidth;
|
|
222
|
+
}, [l, f, m, r]), g = E(() => {
|
|
223
223
|
let h = e - 1;
|
|
224
224
|
b(h) && (h = e - 2), P(h);
|
|
225
|
-
}, [P, e, l, d, b]), S =
|
|
225
|
+
}, [P, e, l, d, b]), S = W(() => l === Le.DUAL_PAGE && d === ne.PAGE_SCROLLING ? e === r - 1 : e === r, [e, r, l, d]), v = E(() => {
|
|
226
226
|
if (S)
|
|
227
227
|
return;
|
|
228
228
|
let h = e + 1;
|
|
@@ -275,19 +275,19 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
277
|
const Nr = () => {
|
|
278
|
-
const { pdf: t, pages: e } = oe(), [n, r] =
|
|
278
|
+
const { pdf: t, pages: e } = oe(), [n, r] = q({
|
|
279
279
|
loadedPages: 0,
|
|
280
280
|
totalPages: 0,
|
|
281
281
|
percentage: 0
|
|
282
|
-
}), [o, i] =
|
|
282
|
+
}), [o, i] = q(!1), [c, l] = q(!1), [d, f] = q(null), m = k(!1);
|
|
283
283
|
z(() => {
|
|
284
284
|
m.current;
|
|
285
285
|
}, [m]);
|
|
286
|
-
const C =
|
|
286
|
+
const C = E(() => {
|
|
287
287
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
288
288
|
const h = document.querySelector(".rp-print-zone");
|
|
289
289
|
h && h.remove();
|
|
290
|
-
}, []), p =
|
|
290
|
+
}, []), p = E(() => {
|
|
291
291
|
m.current = !1, i(!1), l(!1), f(null), r({
|
|
292
292
|
loadedPages: 0,
|
|
293
293
|
totalPages: 0,
|
|
@@ -302,39 +302,39 @@ const Nr = () => {
|
|
|
302
302
|
viewerPdfPage: w,
|
|
303
303
|
printResolution: _,
|
|
304
304
|
optionalContentConfigPromise: y,
|
|
305
|
-
printAnnotationStoragePromise:
|
|
305
|
+
printAnnotationStoragePromise: x
|
|
306
306
|
}) => {
|
|
307
307
|
if (m.current) {
|
|
308
308
|
p();
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
|
-
const
|
|
312
|
-
h.width = Math.floor(w.width *
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
const [
|
|
311
|
+
const I = _ / Wo.PDF;
|
|
312
|
+
h.width = Math.floor(w.width * I), h.height = Math.floor(w.height * I);
|
|
313
|
+
const R = h.getContext("2d");
|
|
314
|
+
R.save(), R.fillStyle = "rgb(255, 255, 255)", R.fillRect(0, 0, h.width, h.height), R.restore();
|
|
315
|
+
const [L, N] = await Promise.all([
|
|
316
316
|
u.getPage(s),
|
|
317
|
-
|
|
317
|
+
x
|
|
318
318
|
]);
|
|
319
319
|
if (m.current) {
|
|
320
320
|
p();
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
const
|
|
324
|
-
canvasContext:
|
|
325
|
-
transform: [
|
|
326
|
-
viewport:
|
|
323
|
+
const F = {
|
|
324
|
+
canvasContext: R,
|
|
325
|
+
transform: [I, 0, 0, I, 0, 0],
|
|
326
|
+
viewport: L.getViewport({ scale: 1, rotation: w.rotation }),
|
|
327
327
|
intent: "print",
|
|
328
328
|
annotationMode: Ho.ENABLE_STORAGE,
|
|
329
329
|
optionalContentConfigPromise: y,
|
|
330
|
-
printAnnotationStorage:
|
|
330
|
+
printAnnotationStorage: N
|
|
331
331
|
};
|
|
332
332
|
try {
|
|
333
|
-
return
|
|
334
|
-
} catch (
|
|
335
|
-
throw
|
|
333
|
+
return L.render(F).promise;
|
|
334
|
+
} catch (M) {
|
|
335
|
+
throw M instanceof $o || console.error(M), M;
|
|
336
336
|
}
|
|
337
|
-
}, b =
|
|
337
|
+
}, b = E(() => {
|
|
338
338
|
const h = window.print;
|
|
339
339
|
return new Promise((u) => {
|
|
340
340
|
const s = (y) => {
|
|
@@ -366,11 +366,11 @@ const Nr = () => {
|
|
|
366
366
|
s.classList.add("rp-print-zone");
|
|
367
367
|
const w = document.createElement("style"), _ = u.get(1);
|
|
368
368
|
if (_) {
|
|
369
|
-
const { width: y, height:
|
|
370
|
-
w.innerHTML = `@page { size: ${y}px ${
|
|
369
|
+
const { width: y, height: x } = _ == null ? void 0 : _.page.getViewport({ scale: 1 });
|
|
370
|
+
w.innerHTML = `@page { size: ${y}px ${x}px }`;
|
|
371
371
|
}
|
|
372
372
|
return s.appendChild(w), s.append(...h), s;
|
|
373
|
-
}, v =
|
|
373
|
+
}, v = E(async () => {
|
|
374
374
|
if (!t)
|
|
375
375
|
return;
|
|
376
376
|
p();
|
|
@@ -380,17 +380,17 @@ const Nr = () => {
|
|
|
380
380
|
const w = t.getOptionalContentConfig({ intent: "print" }), _ = Promise.resolve(
|
|
381
381
|
t.annotationStorage.print ?? void 0
|
|
382
382
|
), y = e.size;
|
|
383
|
-
for (const [
|
|
383
|
+
for (const [I, R] of e) {
|
|
384
384
|
if (m.current) {
|
|
385
385
|
p();
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
|
-
const
|
|
388
|
+
const L = R.page.getViewport({ scale: 1 });
|
|
389
389
|
if (await P({
|
|
390
390
|
scratchCanvas: h,
|
|
391
391
|
pdfDocument: t,
|
|
392
|
-
pageNumber:
|
|
393
|
-
viewerPdfPage:
|
|
392
|
+
pageNumber: I,
|
|
393
|
+
viewerPdfPage: L,
|
|
394
394
|
printResolution: 150,
|
|
395
395
|
optionalContentConfigPromise: w,
|
|
396
396
|
printAnnotationStoragePromise: _
|
|
@@ -398,21 +398,21 @@ const Nr = () => {
|
|
|
398
398
|
p();
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
|
-
const
|
|
402
|
-
u.push(
|
|
403
|
-
const
|
|
401
|
+
const N = await g(h);
|
|
402
|
+
u.push(N);
|
|
403
|
+
const F = parseFloat((u.length / y * 100).toFixed(2));
|
|
404
404
|
r({
|
|
405
|
-
loadedPages:
|
|
405
|
+
loadedPages: I,
|
|
406
406
|
totalPages: y,
|
|
407
|
-
percentage:
|
|
407
|
+
percentage: F
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
if (m.current) {
|
|
411
411
|
p();
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
|
-
const
|
|
415
|
-
document.body.appendChild(
|
|
414
|
+
const x = S(u, e);
|
|
415
|
+
document.body.appendChild(x), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await b();
|
|
416
416
|
} catch (s) {
|
|
417
417
|
l(!0), s instanceof Error && f(s);
|
|
418
418
|
} finally {
|
|
@@ -452,11 +452,11 @@ const Nr = () => {
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
}), Xs = ({ children: t }) => {
|
|
455
|
-
const [e, n] =
|
|
455
|
+
const [e, n] = q(null), [r, o] = q(null), { print: i, cancel: c, progress: l, isComplete: d, isError: f, error: m } = Nr(), C = E((g) => {
|
|
456
456
|
g && typeof g == "function" && o(() => g);
|
|
457
457
|
}, []), p = (g) => {
|
|
458
458
|
m && g(m);
|
|
459
|
-
}, T =
|
|
459
|
+
}, T = E(
|
|
460
460
|
(g) => {
|
|
461
461
|
n(() => g);
|
|
462
462
|
},
|
|
@@ -488,7 +488,7 @@ const Nr = () => {
|
|
|
488
488
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
489
489
|
return t;
|
|
490
490
|
}, Or = () => {
|
|
491
|
-
const [t, e] =
|
|
491
|
+
const [t, e] = q({}), { pages: n } = oe(), r = W(() => Object.keys(t).length, [t]), o = E(
|
|
492
492
|
(c) => {
|
|
493
493
|
if (!n.size)
|
|
494
494
|
return;
|
|
@@ -509,7 +509,7 @@ const Nr = () => {
|
|
|
509
509
|
z(() => {
|
|
510
510
|
o(10);
|
|
511
511
|
}, [o]);
|
|
512
|
-
const i =
|
|
512
|
+
const i = E(
|
|
513
513
|
(c) => {
|
|
514
514
|
if (!n)
|
|
515
515
|
return;
|
|
@@ -542,7 +542,7 @@ const Nr = () => {
|
|
|
542
542
|
children: t,
|
|
543
543
|
initialThumbnailsVisible: e
|
|
544
544
|
}) => {
|
|
545
|
-
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } = Or(), [c, l] =
|
|
545
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } = Or(), [c, l] = q(e);
|
|
546
546
|
return /* @__PURE__ */ a(
|
|
547
547
|
bn.Provider,
|
|
548
548
|
{
|
|
@@ -551,40 +551,40 @@ const Nr = () => {
|
|
|
551
551
|
}
|
|
552
552
|
);
|
|
553
553
|
}, Dr = (t = {}, e = "") => {
|
|
554
|
-
const [n, r] =
|
|
555
|
-
(
|
|
556
|
-
if (
|
|
554
|
+
const [n, r] = q(e), [o, i] = q(!1), { pdf: c, pages: l } = oe(), { widths: d, heights: f } = Ge(), m = k(!n), { currentZoom: C } = _t(), [p, T] = q([]), { setFocusedPage: P } = de(), { columnCount: b } = Fe(), { pageRotate: g } = Je(), [S, v] = q(0), { pageScrollElementRef: h, virtualScrollableElementRef: u } = Ye(), { scrollMode: s } = Ne(), { pagesRef: w } = be(), [_, y] = q(null), x = k({}), I = k(0), R = W(() => S === 0 ? null : p[S - 1], [S, p]), L = W(() => p.length, [p]), N = E(
|
|
555
|
+
(O) => {
|
|
556
|
+
if (O === 0)
|
|
557
557
|
return;
|
|
558
|
-
const
|
|
559
|
-
if (!
|
|
558
|
+
const A = p[O - 1];
|
|
559
|
+
if (!A || !l)
|
|
560
560
|
return;
|
|
561
|
-
const
|
|
562
|
-
if (!
|
|
561
|
+
const H = u || h;
|
|
562
|
+
if (!H || !w)
|
|
563
563
|
return;
|
|
564
|
-
const
|
|
565
|
-
if (s === ne.PAGE_SCROLLING && P(
|
|
564
|
+
const U = l.get(A.page);
|
|
565
|
+
if (s === ne.PAGE_SCROLLING && P(A.page), !U)
|
|
566
566
|
return;
|
|
567
|
-
let
|
|
567
|
+
let B = 0, V = 0;
|
|
568
568
|
if (s === ne.VERTICAL_SCROLLING) {
|
|
569
|
-
const
|
|
570
|
-
|
|
569
|
+
const ue = A.page - 1, J = b, me = ue % J, ye = Math.floor(ue / J);
|
|
570
|
+
B = Me(f, ye), V = Me(d, me);
|
|
571
571
|
}
|
|
572
|
-
s === ne.HORIZONTAL_SCROLLING && (
|
|
573
|
-
const
|
|
574
|
-
height: f[
|
|
575
|
-
width: d[
|
|
576
|
-
},
|
|
577
|
-
|
|
572
|
+
s === ne.HORIZONTAL_SCROLLING && (V = d.slice(0, A.page - 1).reduce((ue, J) => ue + J, 0));
|
|
573
|
+
const ee = {
|
|
574
|
+
height: f[A.page - 1],
|
|
575
|
+
width: d[A.page - 1]
|
|
576
|
+
}, G = g[A.page], { leftInPage: Z, topInPage: Y } = ir(
|
|
577
|
+
ee,
|
|
578
578
|
w,
|
|
579
|
-
|
|
579
|
+
A.rect,
|
|
580
580
|
C,
|
|
581
|
-
|
|
582
|
-
),
|
|
583
|
-
left: Math.max(
|
|
584
|
-
top: Math.max(
|
|
581
|
+
G
|
|
582
|
+
), re = V + Z, ae = B + Y, ie = {
|
|
583
|
+
left: Math.max(re, 0),
|
|
584
|
+
top: Math.max(ae, 0)
|
|
585
585
|
};
|
|
586
|
-
|
|
587
|
-
...
|
|
586
|
+
H.scrollTo({
|
|
587
|
+
...ie,
|
|
588
588
|
behavior: "smooth"
|
|
589
589
|
});
|
|
590
590
|
},
|
|
@@ -601,59 +601,59 @@ const Nr = () => {
|
|
|
601
601
|
]
|
|
602
602
|
);
|
|
603
603
|
z(() => {
|
|
604
|
-
S
|
|
604
|
+
S && N(S);
|
|
605
605
|
}, [S]);
|
|
606
|
-
const
|
|
607
|
-
v((
|
|
608
|
-
let
|
|
609
|
-
return
|
|
610
|
-
});
|
|
611
|
-
}, [
|
|
612
|
-
v((
|
|
613
|
-
let
|
|
614
|
-
return
|
|
615
|
-
});
|
|
616
|
-
}, [
|
|
617
|
-
if (!
|
|
606
|
+
const F = E(() => {
|
|
607
|
+
v((O) => {
|
|
608
|
+
let A;
|
|
609
|
+
return L ? O + 1 > L ? A = 1 : A = O + 1 : A = 0, I.current = A, A;
|
|
610
|
+
}), I.current === 1 && N(I.current);
|
|
611
|
+
}, [L, N]), M = E(() => {
|
|
612
|
+
v((O) => {
|
|
613
|
+
let A;
|
|
614
|
+
return L ? O - 1 <= 0 ? A = L : A = O - 1 : A = 0, I.current = A, A;
|
|
615
|
+
}), I.current === 1 && N(I.current);
|
|
616
|
+
}, [L, N]), D = E(async (O) => {
|
|
617
|
+
if (!O)
|
|
618
618
|
return {};
|
|
619
|
-
const
|
|
620
|
-
for (let
|
|
619
|
+
const A = O.numPages, H = {};
|
|
620
|
+
for (let U = 1; U <= A; U++) {
|
|
621
621
|
if (m.current)
|
|
622
622
|
throw "close pop over";
|
|
623
|
-
const
|
|
624
|
-
|
|
623
|
+
const B = await O.getPage(U);
|
|
624
|
+
H[U.toString()] = await B.getTextContent();
|
|
625
625
|
}
|
|
626
|
-
return
|
|
626
|
+
return H;
|
|
627
627
|
}, []);
|
|
628
628
|
return z(() => {
|
|
629
629
|
if (!n) {
|
|
630
630
|
m.current = !0, T([]), v(0);
|
|
631
631
|
return;
|
|
632
632
|
}
|
|
633
|
-
m.current = !1, i(!0), T([]), v(0),
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
const
|
|
633
|
+
m.current = !1, i(!0), T([]), v(0), D(c).then((O) => {
|
|
634
|
+
x.current = O;
|
|
635
|
+
const H = Object.keys(O).reduce((U, B) => {
|
|
636
|
+
const V = mo(
|
|
637
637
|
[n],
|
|
638
|
-
|
|
639
|
-
Number(
|
|
638
|
+
O[B],
|
|
639
|
+
Number(B) - 1,
|
|
640
640
|
t
|
|
641
|
-
).map((
|
|
642
|
-
return [...
|
|
641
|
+
).map((ee, G) => ({ ...ee, page: Number(B), pageMatchIdx: G }));
|
|
642
|
+
return [...U, ...V];
|
|
643
643
|
}, []);
|
|
644
|
-
T(
|
|
644
|
+
T(H), v(H.length ? 1 : 0);
|
|
645
645
|
}).catch(() => {
|
|
646
646
|
T([]), v(0);
|
|
647
647
|
}).finally(() => i(!1));
|
|
648
|
-
}, [n,
|
|
648
|
+
}, [n, D, c, t]), {
|
|
649
649
|
search: n,
|
|
650
650
|
setSearch: r,
|
|
651
651
|
loading: o,
|
|
652
652
|
matches: p,
|
|
653
|
-
totalMatches:
|
|
653
|
+
totalMatches: L,
|
|
654
654
|
currentMatchPosition: S,
|
|
655
|
-
currentMatch:
|
|
656
|
-
nextMatch:
|
|
655
|
+
currentMatch: R,
|
|
656
|
+
nextMatch: F,
|
|
657
657
|
prevMatch: M,
|
|
658
658
|
currentMatchElement: _,
|
|
659
659
|
setCurrentMatchElement: y
|
|
@@ -680,7 +680,7 @@ const Nr = () => {
|
|
|
680
680
|
children: t,
|
|
681
681
|
initialSearch: e
|
|
682
682
|
}) => {
|
|
683
|
-
const [n, r] =
|
|
683
|
+
const [n, r] = q({}), {
|
|
684
684
|
loading: o,
|
|
685
685
|
setSearch: i,
|
|
686
686
|
totalMatches: c,
|
|
@@ -715,9 +715,9 @@ const Nr = () => {
|
|
|
715
715
|
}
|
|
716
716
|
);
|
|
717
717
|
}, St = () => qe(Cn), Pn = $e(null), Js = ({ children: t }) => {
|
|
718
|
-
const e = k(!1), [n, r] =
|
|
718
|
+
const e = k(!1), [n, r] = q([]), o = E((d) => {
|
|
719
719
|
r((f) => [...f, { id: d.page.pageNumber.toString(), data: d, priority: 0 }]);
|
|
720
|
-
}, []), i =
|
|
720
|
+
}, []), i = W(() => new To(o), [o]), { focusedPage: c } = de(), l = E((d) => (e.current = !0, Co(
|
|
721
721
|
d.data.page,
|
|
722
722
|
d.data.canvasElem,
|
|
723
723
|
d.data.options
|
|
@@ -794,9 +794,9 @@ const Nr = () => {
|
|
|
794
794
|
markedContent: Mr,
|
|
795
795
|
"rp-text-layer-text": "_rp-text-layer-text_ppr5g_52"
|
|
796
796
|
}, Fr = (t) => {
|
|
797
|
-
const { pageNumber: e } = t, { pages: n } = oe(), r = k(null), { matches: o, currentMatch: i, setCurrentMatchElement: c } = St(), [l, d] =
|
|
797
|
+
const { pageNumber: e } = t, { pages: n } = oe(), r = k(null), { matches: o, currentMatch: i, setCurrentMatchElement: c } = St(), [l, d] = q(
|
|
798
798
|
[]
|
|
799
|
-
), f = k(), m = k(), C = k([]), p =
|
|
799
|
+
), f = k(), m = k(), C = k([]), p = W(() => o.filter((h) => h.pageIndex === e - 1), [o, e]), T = E(
|
|
800
800
|
(h, u, s = !1) => {
|
|
801
801
|
if (s && go(h, u), !p.length) {
|
|
802
802
|
C.current = [], d([]);
|
|
@@ -806,7 +806,7 @@ const Nr = () => {
|
|
|
806
806
|
d(w);
|
|
807
807
|
},
|
|
808
808
|
[p]
|
|
809
|
-
), P = k(), b = k(!1), g =
|
|
809
|
+
), P = k(), b = k(!1), g = E(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
810
810
|
z(() => ((() => {
|
|
811
811
|
if (P.current)
|
|
812
812
|
return;
|
|
@@ -846,7 +846,7 @@ const Nr = () => {
|
|
|
846
846
|
document.addEventListener(
|
|
847
847
|
"selectionchange",
|
|
848
848
|
() => {
|
|
849
|
-
var
|
|
849
|
+
var F, M;
|
|
850
850
|
const _ = document.getSelection();
|
|
851
851
|
if (!_)
|
|
852
852
|
return;
|
|
@@ -855,27 +855,27 @@ const Nr = () => {
|
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
857
|
const y = /* @__PURE__ */ new Set();
|
|
858
|
-
for (let
|
|
859
|
-
const
|
|
860
|
-
g().forEach((
|
|
861
|
-
|
|
858
|
+
for (let D = 0; D < _.rangeCount; D++) {
|
|
859
|
+
const O = _.getRangeAt(D);
|
|
860
|
+
g().forEach((A) => {
|
|
861
|
+
O.intersectsNode(A) && !y.has(A) && y.add(A);
|
|
862
862
|
});
|
|
863
863
|
}
|
|
864
|
-
g().forEach((
|
|
865
|
-
if (y.has(
|
|
866
|
-
|
|
864
|
+
g().forEach((D) => {
|
|
865
|
+
if (y.has(D))
|
|
866
|
+
D.classList.add(ge.selecting);
|
|
867
867
|
else {
|
|
868
|
-
const
|
|
869
|
-
|
|
868
|
+
const O = D.querySelector(".endOfContent");
|
|
869
|
+
O && (D.appendChild(O), O.style.width = "", O.style.height = "", D.classList.remove(ge.selecting));
|
|
870
870
|
}
|
|
871
871
|
});
|
|
872
|
-
const
|
|
873
|
-
let
|
|
874
|
-
|
|
875
|
-
const
|
|
872
|
+
const x = _.getRangeAt(0);
|
|
873
|
+
let R = w && (x.compareBoundaryPoints(Range.END_TO_END, w) === 0 || x.compareBoundaryPoints(Range.START_TO_END, w) === 0) ? x.startContainer : x.endContainer;
|
|
874
|
+
R.nodeType === Node.TEXT_NODE && (R = R.parentNode);
|
|
875
|
+
const L = (F = R.parentElement) == null ? void 0 : F.closest(
|
|
876
876
|
ge["rp-text-layer"]
|
|
877
|
-
),
|
|
878
|
-
|
|
877
|
+
), N = L == null ? void 0 : L.querySelector(".endOfContent");
|
|
878
|
+
N && L && (N.style.width = L.style.width, N.style.height = L.style.height, (M = R.parentElement) == null || M.insertBefore(N, R.nextSibling)), w = x.cloneRange();
|
|
879
879
|
},
|
|
880
880
|
{ signal: u }
|
|
881
881
|
);
|
|
@@ -883,9 +883,9 @@ const Nr = () => {
|
|
|
883
883
|
var u;
|
|
884
884
|
(u = P.current) == null || u.abort(), P.current = void 0;
|
|
885
885
|
}), [g]);
|
|
886
|
-
const S =
|
|
886
|
+
const S = E(() => {
|
|
887
887
|
r.current && r.current.classList.add(ge.selecting);
|
|
888
|
-
}, []), v =
|
|
888
|
+
}, []), v = E(() => {
|
|
889
889
|
r.current && r.current.classList.remove(ge.selecting);
|
|
890
890
|
}, []);
|
|
891
891
|
return z(() => {
|
|
@@ -915,14 +915,14 @@ const Nr = () => {
|
|
|
915
915
|
container: u
|
|
916
916
|
}), m.current = s, u && (u.innerText = ""), f.current.render();
|
|
917
917
|
}).then(() => {
|
|
918
|
-
var y,
|
|
919
|
-
[].slice.call(u.children).forEach((
|
|
920
|
-
|
|
918
|
+
var y, x;
|
|
919
|
+
[].slice.call(u.children).forEach((I) => {
|
|
920
|
+
I.classList.add(ge["rp-text-layer-text"]), I.setAttribute("data-rp", "rp-text-layer-text");
|
|
921
921
|
});
|
|
922
922
|
const w = (y = f.current) == null ? void 0 : y.textDivs;
|
|
923
923
|
w && m.current && T(m.current, w);
|
|
924
924
|
const _ = document.createElement("div");
|
|
925
|
-
_.className = "endOfContent", (
|
|
925
|
+
_.className = "endOfContent", (x = r.current) == null || x.appendChild(_);
|
|
926
926
|
}).catch(() => {
|
|
927
927
|
}), () => {
|
|
928
928
|
var s;
|
|
@@ -951,7 +951,7 @@ const Nr = () => {
|
|
|
951
951
|
};
|
|
952
952
|
let Wr = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
953
953
|
const Hr = (t) => {
|
|
954
|
-
const { pageNumber: e } = t, n = k(null), { pages: r, pdf: o } = oe(), i = k(), [c, l] =
|
|
954
|
+
const { pageNumber: e } = t, n = k(null), { pages: r, pdf: o } = oe(), i = k(), [c, l] = q(), { setFocusedPage: d, goToPage: f } = de(), { scrollMode: m } = Ne(), { print: C } = tt(), { download: p } = Gn(), T = W(() => r.get(e), [r, e]), P = W(() => T == null ? void 0 : T.page.getViewport(), [T]);
|
|
955
955
|
z(() => {
|
|
956
956
|
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
957
957
|
}, [o]), z(() => {
|
|
@@ -959,7 +959,7 @@ const Hr = (t) => {
|
|
|
959
959
|
i.current = void 0, l(g), n.current && (n.current.innerText = "");
|
|
960
960
|
});
|
|
961
961
|
}, [T]);
|
|
962
|
-
const b =
|
|
962
|
+
const b = E(
|
|
963
963
|
(g) => {
|
|
964
964
|
!c || !o || (Uo(g), Vo(g, o, c).then((S) => {
|
|
965
965
|
var v, h;
|
|
@@ -1039,7 +1039,7 @@ const Hr = (t) => {
|
|
|
1039
1039
|
}, $r = {
|
|
1040
1040
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1041
1041
|
}, qr = ({ pageNumber: t, viewport: e }) => {
|
|
1042
|
-
const [n, r] =
|
|
1042
|
+
const [n, r] = q(), { pages: o } = oe(), { highlightKeywords: i } = _o(), c = !0, l = k(null), [d, f] = q(null), [m, C] = q([]);
|
|
1043
1043
|
z(() => {
|
|
1044
1044
|
l.current && f(l.current.parentElement);
|
|
1045
1045
|
}, [l]), z(() => {
|
|
@@ -1051,7 +1051,7 @@ const Hr = (t) => {
|
|
|
1051
1051
|
r(u);
|
|
1052
1052
|
})();
|
|
1053
1053
|
}, [o, t]);
|
|
1054
|
-
const p =
|
|
1054
|
+
const p = W(() => i ? i.map((v) => {
|
|
1055
1055
|
var h, u;
|
|
1056
1056
|
return {
|
|
1057
1057
|
...Zo(v.keyword, (h = v.options) == null ? void 0 : h.matchCase, (u = v.options) == null ? void 0 : u.wholeWords),
|
|
@@ -1068,9 +1068,9 @@ const Hr = (t) => {
|
|
|
1068
1068
|
s(w);
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
|
-
new MutationObserver((y,
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1071
|
+
new MutationObserver((y, x) => {
|
|
1072
|
+
const I = v.querySelector(u);
|
|
1073
|
+
I && (s(I), x.disconnect());
|
|
1074
1074
|
}).observe(v, { childList: !0, subtree: !0 });
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
@@ -1096,21 +1096,21 @@ const Hr = (t) => {
|
|
|
1096
1096
|
const w = document.createRange(), _ = u.firstChild;
|
|
1097
1097
|
if (!_ || _.nodeType !== Node.TEXT_NODE)
|
|
1098
1098
|
return null;
|
|
1099
|
-
const y = ((U = _.textContent) == null ? void 0 : U.length) ?? 0,
|
|
1100
|
-
if (
|
|
1099
|
+
const y = ((U = _.textContent) == null ? void 0 : U.length) ?? 0, x = s[0].charIdxInSpan, I = s.length === 1 ? x : s[s.length - 1].charIdxInSpan;
|
|
1100
|
+
if (x > y || I + 1 > y)
|
|
1101
1101
|
return null;
|
|
1102
|
-
w.setStart(_,
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1105
|
-
const
|
|
1106
|
-
return Qo(
|
|
1102
|
+
w.setStart(_, x), w.setEnd(_, I + 1);
|
|
1103
|
+
const R = document.createElement("span");
|
|
1104
|
+
R.style.width = "auto", w.surroundContents(R);
|
|
1105
|
+
const L = R.getBoundingClientRect(), N = v.getBoundingClientRect(), F = N.height, M = N.width, D = 100 * (L.left - N.left) / M, O = 100 * (L.top - N.top) / F, A = 100 * L.height / F, H = 100 * L.width / M;
|
|
1106
|
+
return Qo(R), {
|
|
1107
1107
|
keywordStr: h,
|
|
1108
|
-
left:
|
|
1109
|
-
top:
|
|
1110
|
-
height:
|
|
1111
|
-
width:
|
|
1112
|
-
pageHeight:
|
|
1113
|
-
pageWidth:
|
|
1108
|
+
left: D,
|
|
1109
|
+
top: O,
|
|
1110
|
+
height: A,
|
|
1111
|
+
width: H,
|
|
1112
|
+
pageHeight: F,
|
|
1113
|
+
pageWidth: M
|
|
1114
1114
|
};
|
|
1115
1115
|
};
|
|
1116
1116
|
async function g(v, h) {
|
|
@@ -1120,11 +1120,11 @@ const Hr = (t) => {
|
|
|
1120
1120
|
const s = await P(u);
|
|
1121
1121
|
if (s.length) {
|
|
1122
1122
|
const w = s.map((y) => y.tagName === "BR" ? " " : y.textContent).reduce(
|
|
1123
|
-
(y,
|
|
1124
|
-
|
|
1125
|
-
char:
|
|
1126
|
-
charIdxInSpan:
|
|
1127
|
-
spanIdx:
|
|
1123
|
+
(y, x, I) => y.concat(
|
|
1124
|
+
x.split("").map((R, L) => ({
|
|
1125
|
+
char: R,
|
|
1126
|
+
charIdxInSpan: L,
|
|
1127
|
+
spanIdx: I
|
|
1128
1128
|
}))
|
|
1129
1129
|
),
|
|
1130
1130
|
[
|
|
@@ -1142,35 +1142,35 @@ const Hr = (t) => {
|
|
|
1142
1142
|
const w = h.length;
|
|
1143
1143
|
if (!s.length || !w)
|
|
1144
1144
|
return [];
|
|
1145
|
-
const _ = [], y = s.map((
|
|
1146
|
-
return p.forEach((
|
|
1147
|
-
const { keyword:
|
|
1148
|
-
if (!
|
|
1145
|
+
const _ = [], y = s.map((x) => x.char).join("");
|
|
1146
|
+
return p.forEach((x) => {
|
|
1147
|
+
const { keyword: I, regExp: R, wholeWords: L, color: N } = x, F = I;
|
|
1148
|
+
if (!F.trim())
|
|
1149
1149
|
return;
|
|
1150
|
-
const
|
|
1151
|
-
let
|
|
1152
|
-
const
|
|
1153
|
-
for (; (
|
|
1154
|
-
|
|
1155
|
-
keyword:
|
|
1156
|
-
startIndex:
|
|
1157
|
-
endIndex:
|
|
1150
|
+
const M = R.flags.indexOf("g") === -1 ? new RegExp(R, `${R.flags}g`) : R;
|
|
1151
|
+
let D;
|
|
1152
|
+
const O = [];
|
|
1153
|
+
for (; (D = M.exec(y)) !== null; )
|
|
1154
|
+
L && !wo(y, D.index, D[0].length) || O.push({
|
|
1155
|
+
keyword: M,
|
|
1156
|
+
startIndex: D.index,
|
|
1157
|
+
endIndex: M.lastIndex
|
|
1158
1158
|
});
|
|
1159
|
-
const
|
|
1160
|
-
keyword:
|
|
1161
|
-
indexes: s.slice(
|
|
1162
|
-
color:
|
|
1159
|
+
const A = O.map((H) => ({
|
|
1160
|
+
keyword: H.keyword,
|
|
1161
|
+
indexes: s.slice(H.startIndex, H.endIndex),
|
|
1162
|
+
color: N
|
|
1163
1163
|
}));
|
|
1164
|
-
for (const
|
|
1165
|
-
const U =
|
|
1166
|
-
(
|
|
1164
|
+
for (const H of A) {
|
|
1165
|
+
const U = H.indexes.reduce(
|
|
1166
|
+
(B, V) => (B[V.spanIdx] = (B[V.spanIdx] || []).concat([V]), B),
|
|
1167
1167
|
{}
|
|
1168
1168
|
);
|
|
1169
|
-
for (const
|
|
1170
|
-
if (
|
|
1171
|
-
const V =
|
|
1169
|
+
for (const B of Object.values(U))
|
|
1170
|
+
if (B.length !== 1 || B[0].char.trim() !== "") {
|
|
1171
|
+
const V = B, ee = u[V[0].spanIdx], G = b(
|
|
1172
1172
|
v,
|
|
1173
|
-
|
|
1173
|
+
F,
|
|
1174
1174
|
ee,
|
|
1175
1175
|
V
|
|
1176
1176
|
);
|
|
@@ -1178,7 +1178,7 @@ const Hr = (t) => {
|
|
|
1178
1178
|
const { left: Z, top: Y } = G;
|
|
1179
1179
|
if (_.find((ae) => ae.left === Z && ae.top === Y))
|
|
1180
1180
|
continue;
|
|
1181
|
-
_.push({ ...G, highlightColor:
|
|
1181
|
+
_.push({ ...G, highlightColor: H.color });
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
1184
|
}
|
|
@@ -1211,12 +1211,12 @@ const Hr = (t) => {
|
|
|
1211
1211
|
h
|
|
1212
1212
|
)) }) });
|
|
1213
1213
|
}, It = et((t, e) => {
|
|
1214
|
-
const { pageNumber: n, style: r, ...o } = t, { pages: i } = oe(), { pageRotate: c } = Je(), { textLayer: l } = uo(), { currentZoom: d } = _t(), { LoaderImageComponent: f } = bt(), m = k(i.get(n)), [C, p] =
|
|
1214
|
+
const { pageNumber: n, style: r, ...o } = t, { pages: i } = oe(), { pageRotate: c } = Je(), { textLayer: l } = uo(), { currentZoom: d } = _t(), { LoaderImageComponent: f } = bt(), m = k(i.get(n)), [C, p] = q(!1), T = k(null), [P, b] = q({
|
|
1215
1215
|
width: 0,
|
|
1216
1216
|
height: 0
|
|
1217
1217
|
});
|
|
1218
1218
|
on(e, () => T.current);
|
|
1219
|
-
const g =
|
|
1219
|
+
const g = W(() => m.current ? c[n] : 0, [n, c]);
|
|
1220
1220
|
z(() => {
|
|
1221
1221
|
if (i && (m.current = i.get(n), m.current)) {
|
|
1222
1222
|
const u = m.current.page.getViewport({
|
|
@@ -1226,7 +1226,7 @@ const Hr = (t) => {
|
|
|
1226
1226
|
b(u);
|
|
1227
1227
|
}
|
|
1228
1228
|
}, [i, n, g, d]);
|
|
1229
|
-
const S =
|
|
1229
|
+
const S = W(() => {
|
|
1230
1230
|
switch (g) {
|
|
1231
1231
|
case 90:
|
|
1232
1232
|
return `${P.width / 2}px ${P.width / 2}px`;
|
|
@@ -1236,9 +1236,9 @@ const Hr = (t) => {
|
|
|
1236
1236
|
default:
|
|
1237
1237
|
return "center";
|
|
1238
1238
|
}
|
|
1239
|
-
}, [g, P]), v =
|
|
1239
|
+
}, [g, P]), v = E(() => {
|
|
1240
1240
|
p(!0);
|
|
1241
|
-
}, []), h =
|
|
1241
|
+
}, []), h = E(() => {
|
|
1242
1242
|
p(!1);
|
|
1243
1243
|
}, []);
|
|
1244
1244
|
return /* @__PURE__ */ a(
|
|
@@ -1255,7 +1255,7 @@ const Hr = (t) => {
|
|
|
1255
1255
|
"--scale-factor": d
|
|
1256
1256
|
},
|
|
1257
1257
|
className: ct["rp-page-wrapper"],
|
|
1258
|
-
children: /* @__PURE__ */
|
|
1258
|
+
children: /* @__PURE__ */ $(
|
|
1259
1259
|
"div",
|
|
1260
1260
|
{
|
|
1261
1261
|
style: {
|
|
@@ -1361,15 +1361,15 @@ function Kr(t) {
|
|
|
1361
1361
|
}
|
|
1362
1362
|
return dt;
|
|
1363
1363
|
}
|
|
1364
|
-
var
|
|
1364
|
+
var Ae = null;
|
|
1365
1365
|
function Vt(t) {
|
|
1366
|
-
if (t === void 0 && (t = !1),
|
|
1366
|
+
if (t === void 0 && (t = !1), Ae === null || t) {
|
|
1367
1367
|
var e = document.createElement("div"), n = e.style;
|
|
1368
1368
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
1369
1369
|
var r = document.createElement("div"), o = r.style;
|
|
1370
|
-
return o.width = "100px", o.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1370
|
+
return o.width = "100px", o.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ? Ae = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? Ae = "negative" : Ae = "positive-ascending"), document.body.removeChild(e), Ae;
|
|
1371
1371
|
}
|
|
1372
|
-
return
|
|
1372
|
+
return Ae;
|
|
1373
1373
|
}
|
|
1374
1374
|
var Zr = 150, Xr = function(e) {
|
|
1375
1375
|
var n = e.columnIndex;
|
|
@@ -1392,66 +1392,66 @@ function Qr(t) {
|
|
|
1392
1392
|
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1393
1393
|
scrollUpdateWasRequested: !1,
|
|
1394
1394
|
verticalScrollDirection: "forward"
|
|
1395
|
-
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = lt(function(w, _, y,
|
|
1395
|
+
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = lt(function(w, _, y, x, I, R, L, N) {
|
|
1396
1396
|
return s.props.onItemsRendered({
|
|
1397
1397
|
overscanColumnStartIndex: w,
|
|
1398
1398
|
overscanColumnStopIndex: _,
|
|
1399
1399
|
overscanRowStartIndex: y,
|
|
1400
|
-
overscanRowStopIndex:
|
|
1401
|
-
visibleColumnStartIndex:
|
|
1402
|
-
visibleColumnStopIndex:
|
|
1403
|
-
visibleRowStartIndex:
|
|
1404
|
-
visibleRowStopIndex:
|
|
1400
|
+
overscanRowStopIndex: x,
|
|
1401
|
+
visibleColumnStartIndex: I,
|
|
1402
|
+
visibleColumnStopIndex: R,
|
|
1403
|
+
visibleRowStartIndex: L,
|
|
1404
|
+
visibleRowStopIndex: N
|
|
1405
1405
|
});
|
|
1406
|
-
}), s._callOnScroll = void 0, s._callOnScroll = lt(function(w, _, y,
|
|
1406
|
+
}), s._callOnScroll = void 0, s._callOnScroll = lt(function(w, _, y, x, I) {
|
|
1407
1407
|
return s.props.onScroll({
|
|
1408
1408
|
horizontalScrollDirection: y,
|
|
1409
1409
|
scrollLeft: w,
|
|
1410
1410
|
scrollTop: _,
|
|
1411
|
-
verticalScrollDirection:
|
|
1412
|
-
scrollUpdateWasRequested:
|
|
1411
|
+
verticalScrollDirection: x,
|
|
1412
|
+
scrollUpdateWasRequested: I
|
|
1413
1413
|
});
|
|
1414
1414
|
}), s._getItemStyle = void 0, s._getItemStyle = function(w, _) {
|
|
1415
|
-
var y = s.props,
|
|
1416
|
-
if (
|
|
1417
|
-
|
|
1415
|
+
var y = s.props, x = y.columnWidth, I = y.direction, R = y.rowHeight, L = s._getItemStyleCache(b && x, b && I, b && R), N = w + ":" + _, F;
|
|
1416
|
+
if (L.hasOwnProperty(N))
|
|
1417
|
+
F = L[N];
|
|
1418
1418
|
else {
|
|
1419
|
-
var
|
|
1420
|
-
N
|
|
1419
|
+
var M = n(s.props, _, s._instanceProps), D = I === "rtl";
|
|
1420
|
+
L[N] = F = {
|
|
1421
1421
|
position: "absolute",
|
|
1422
|
-
left:
|
|
1423
|
-
right:
|
|
1422
|
+
left: D ? void 0 : M,
|
|
1423
|
+
right: D ? M : void 0,
|
|
1424
1424
|
top: C(s.props, w, s._instanceProps),
|
|
1425
1425
|
height: m(s.props, w, s._instanceProps),
|
|
1426
1426
|
width: i(s.props, _, s._instanceProps)
|
|
1427
1427
|
};
|
|
1428
1428
|
}
|
|
1429
|
-
return
|
|
1429
|
+
return F;
|
|
1430
1430
|
}, s._getItemStyleCache = void 0, s._getItemStyleCache = lt(function(w, _, y) {
|
|
1431
1431
|
return {};
|
|
1432
1432
|
}), s._onScroll = function(w) {
|
|
1433
|
-
var _ = w.currentTarget, y = _.clientHeight,
|
|
1434
|
-
s.setState(function(
|
|
1435
|
-
if (
|
|
1433
|
+
var _ = w.currentTarget, y = _.clientHeight, x = _.clientWidth, I = _.scrollLeft, R = _.scrollTop, L = _.scrollHeight, N = _.scrollWidth;
|
|
1434
|
+
s.setState(function(F) {
|
|
1435
|
+
if (F.scrollLeft === I && F.scrollTop === R)
|
|
1436
1436
|
return null;
|
|
1437
|
-
var
|
|
1438
|
-
if (
|
|
1437
|
+
var M = s.props.direction, D = I;
|
|
1438
|
+
if (M === "rtl")
|
|
1439
1439
|
switch (Vt()) {
|
|
1440
1440
|
case "negative":
|
|
1441
|
-
|
|
1441
|
+
D = -I;
|
|
1442
1442
|
break;
|
|
1443
1443
|
case "positive-descending":
|
|
1444
|
-
|
|
1444
|
+
D = N - x - I;
|
|
1445
1445
|
break;
|
|
1446
1446
|
}
|
|
1447
|
-
|
|
1448
|
-
var
|
|
1447
|
+
D = Math.max(0, Math.min(D, N - x));
|
|
1448
|
+
var O = Math.max(0, Math.min(R, L - y));
|
|
1449
1449
|
return {
|
|
1450
1450
|
isScrolling: !0,
|
|
1451
|
-
horizontalScrollDirection:
|
|
1452
|
-
scrollLeft:
|
|
1453
|
-
scrollTop:
|
|
1454
|
-
verticalScrollDirection:
|
|
1451
|
+
horizontalScrollDirection: F.scrollLeft < I ? "forward" : "backward",
|
|
1452
|
+
scrollLeft: D,
|
|
1453
|
+
scrollTop: O,
|
|
1454
|
+
verticalScrollDirection: F.scrollTop < R ? "forward" : "backward",
|
|
1455
1455
|
scrollUpdateWasRequested: !1
|
|
1456
1456
|
};
|
|
1457
1457
|
}, s._resetIsScrollingDebounced);
|
|
@@ -1484,12 +1484,12 @@ function Qr(t) {
|
|
|
1484
1484
|
};
|
|
1485
1485
|
}, this._resetIsScrollingDebounced);
|
|
1486
1486
|
}, h.scrollToItem = function(s) {
|
|
1487
|
-
var w = s.align, _ = w === void 0 ? "auto" : w, y = s.columnIndex,
|
|
1488
|
-
y !== void 0 && (y = Math.max(0, Math.min(y,
|
|
1489
|
-
var
|
|
1487
|
+
var w = s.align, _ = w === void 0 ? "auto" : w, y = s.columnIndex, x = s.rowIndex, I = this.props, R = I.columnCount, L = I.height, N = I.rowCount, F = I.width, M = this.state, D = M.scrollLeft, O = M.scrollTop, A = Kr();
|
|
1488
|
+
y !== void 0 && (y = Math.max(0, Math.min(y, R - 1))), x !== void 0 && (x = Math.max(0, Math.min(x, N - 1)));
|
|
1489
|
+
var H = c(this.props, this._instanceProps), U = l(this.props, this._instanceProps), B = U > F ? A : 0, V = H > L ? A : 0;
|
|
1490
1490
|
this.scrollTo({
|
|
1491
|
-
scrollLeft: y !== void 0 ? d(this.props, y, _,
|
|
1492
|
-
scrollTop:
|
|
1491
|
+
scrollLeft: y !== void 0 ? d(this.props, y, _, D, this._instanceProps, V) : D,
|
|
1492
|
+
scrollTop: x !== void 0 ? f(this.props, x, _, O, this._instanceProps, B) : O
|
|
1493
1493
|
});
|
|
1494
1494
|
}, h.componentDidMount = function() {
|
|
1495
1495
|
var s = this.props, w = s.initialScrollLeft, _ = s.initialScrollTop;
|
|
@@ -1499,91 +1499,91 @@ function Qr(t) {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
this._callPropsCallbacks();
|
|
1501
1501
|
}, h.componentDidUpdate = function() {
|
|
1502
|
-
var s = this.props.direction, w = this.state, _ = w.scrollLeft, y = w.scrollTop,
|
|
1503
|
-
if (
|
|
1504
|
-
var
|
|
1502
|
+
var s = this.props.direction, w = this.state, _ = w.scrollLeft, y = w.scrollTop, x = w.scrollUpdateWasRequested;
|
|
1503
|
+
if (x && this._outerRef != null) {
|
|
1504
|
+
var I = this._outerRef;
|
|
1505
1505
|
if (s === "rtl")
|
|
1506
1506
|
switch (Vt()) {
|
|
1507
1507
|
case "negative":
|
|
1508
|
-
|
|
1508
|
+
I.scrollLeft = -_;
|
|
1509
1509
|
break;
|
|
1510
1510
|
case "positive-ascending":
|
|
1511
|
-
|
|
1511
|
+
I.scrollLeft = _;
|
|
1512
1512
|
break;
|
|
1513
1513
|
default:
|
|
1514
|
-
var
|
|
1515
|
-
|
|
1514
|
+
var R = I.clientWidth, L = I.scrollWidth;
|
|
1515
|
+
I.scrollLeft = L - R - _;
|
|
1516
1516
|
break;
|
|
1517
1517
|
}
|
|
1518
1518
|
else
|
|
1519
|
-
|
|
1520
|
-
|
|
1519
|
+
I.scrollLeft = Math.max(0, _);
|
|
1520
|
+
I.scrollTop = Math.max(0, y);
|
|
1521
1521
|
}
|
|
1522
1522
|
this._callPropsCallbacks();
|
|
1523
1523
|
}, h.componentWillUnmount = function() {
|
|
1524
1524
|
this._resetIsScrollingTimeoutId !== null && Ut(this._resetIsScrollingTimeoutId);
|
|
1525
1525
|
}, h.render = function() {
|
|
1526
|
-
var s = this.props, w = s.children, _ = s.className, y = s.columnCount,
|
|
1527
|
-
if (y > 0 &&
|
|
1528
|
-
for (var
|
|
1526
|
+
var s = this.props, w = s.children, _ = s.className, y = s.columnCount, x = s.direction, I = s.height, R = s.innerRef, L = s.innerElementType, N = s.innerTagName, F = s.itemData, M = s.itemKey, D = M === void 0 ? Xr : M, O = s.outerElementType, A = s.outerTagName, H = s.rowCount, U = s.style, B = s.useIsScrolling, V = s.width, ee = this.state.isScrolling, G = this._getHorizontalRangeToRender(), Z = G[0], Y = G[1], re = this._getVerticalRangeToRender(), ae = re[0], ie = re[1], ue = [];
|
|
1527
|
+
if (y > 0 && H)
|
|
1528
|
+
for (var J = ae; J <= ie; J++)
|
|
1529
1529
|
for (var me = Z; me <= Y; me++)
|
|
1530
1530
|
ue.push(Ve(w, {
|
|
1531
1531
|
columnIndex: me,
|
|
1532
|
-
data:
|
|
1533
|
-
isScrolling:
|
|
1534
|
-
key:
|
|
1532
|
+
data: F,
|
|
1533
|
+
isScrolling: B ? ee : void 0,
|
|
1534
|
+
key: D({
|
|
1535
1535
|
columnIndex: me,
|
|
1536
|
-
data:
|
|
1537
|
-
rowIndex:
|
|
1536
|
+
data: F,
|
|
1537
|
+
rowIndex: J
|
|
1538
1538
|
}),
|
|
1539
|
-
rowIndex:
|
|
1540
|
-
style: this._getItemStyle(
|
|
1539
|
+
rowIndex: J,
|
|
1540
|
+
style: this._getItemStyle(J, me)
|
|
1541
1541
|
}));
|
|
1542
|
-
var
|
|
1543
|
-
return Ve(
|
|
1542
|
+
var ye = c(this.props, this._instanceProps), ot = l(this.props, this._instanceProps);
|
|
1543
|
+
return Ve(O || A || "div", {
|
|
1544
1544
|
className: _,
|
|
1545
1545
|
onScroll: this._onScroll,
|
|
1546
1546
|
ref: this._outerRefSetter,
|
|
1547
1547
|
style: mt({
|
|
1548
1548
|
position: "relative",
|
|
1549
|
-
height:
|
|
1549
|
+
height: I,
|
|
1550
1550
|
width: V,
|
|
1551
1551
|
overflow: "auto",
|
|
1552
1552
|
WebkitOverflowScrolling: "touch",
|
|
1553
1553
|
willChange: "transform",
|
|
1554
|
-
direction:
|
|
1554
|
+
direction: x
|
|
1555
1555
|
}, U)
|
|
1556
|
-
}, Ve(
|
|
1556
|
+
}, Ve(L || N || "div", {
|
|
1557
1557
|
children: ue,
|
|
1558
|
-
ref:
|
|
1558
|
+
ref: R,
|
|
1559
1559
|
style: {
|
|
1560
|
-
height:
|
|
1560
|
+
height: ye,
|
|
1561
1561
|
pointerEvents: ee ? "none" : void 0,
|
|
1562
1562
|
width: ot
|
|
1563
1563
|
}
|
|
1564
1564
|
}));
|
|
1565
1565
|
}, h._callPropsCallbacks = function() {
|
|
1566
|
-
var s = this.props, w = s.columnCount, _ = s.onItemsRendered, y = s.onScroll,
|
|
1567
|
-
if (typeof _ == "function" && w > 0 &&
|
|
1568
|
-
var
|
|
1569
|
-
this._callOnItemsRendered(
|
|
1566
|
+
var s = this.props, w = s.columnCount, _ = s.onItemsRendered, y = s.onScroll, x = s.rowCount;
|
|
1567
|
+
if (typeof _ == "function" && w > 0 && x > 0) {
|
|
1568
|
+
var I = this._getHorizontalRangeToRender(), R = I[0], L = I[1], N = I[2], F = I[3], M = this._getVerticalRangeToRender(), D = M[0], O = M[1], A = M[2], H = M[3];
|
|
1569
|
+
this._callOnItemsRendered(R, L, D, O, N, F, A, H);
|
|
1570
1570
|
}
|
|
1571
1571
|
if (typeof y == "function") {
|
|
1572
|
-
var U = this.state,
|
|
1573
|
-
this._callOnScroll(V, ee,
|
|
1572
|
+
var U = this.state, B = U.horizontalScrollDirection, V = U.scrollLeft, ee = U.scrollTop, G = U.scrollUpdateWasRequested, Z = U.verticalScrollDirection;
|
|
1573
|
+
this._callOnScroll(V, ee, B, Z, G);
|
|
1574
1574
|
}
|
|
1575
1575
|
}, h._getHorizontalRangeToRender = function() {
|
|
1576
|
-
var s = this.props, w = s.columnCount, _ = s.overscanColumnCount, y = s.overscanColumnsCount,
|
|
1577
|
-
if (w === 0 ||
|
|
1576
|
+
var s = this.props, w = s.columnCount, _ = s.overscanColumnCount, y = s.overscanColumnsCount, x = s.overscanCount, I = s.rowCount, R = this.state, L = R.horizontalScrollDirection, N = R.isScrolling, F = R.scrollLeft, M = _ || y || x || 1;
|
|
1577
|
+
if (w === 0 || I === 0)
|
|
1578
1578
|
return [0, 0, 0, 0];
|
|
1579
|
-
var
|
|
1580
|
-
return [Math.max(0,
|
|
1579
|
+
var D = r(this.props, F, this._instanceProps), O = o(this.props, D, F, this._instanceProps), A = !N || L === "backward" ? Math.max(1, M) : 1, H = !N || L === "forward" ? Math.max(1, M) : 1;
|
|
1580
|
+
return [Math.max(0, D - A), Math.max(0, Math.min(w - 1, O + H)), D, O];
|
|
1581
1581
|
}, h._getVerticalRangeToRender = function() {
|
|
1582
|
-
var s = this.props, w = s.columnCount, _ = s.overscanCount, y = s.overscanRowCount,
|
|
1583
|
-
if (w === 0 ||
|
|
1582
|
+
var s = this.props, w = s.columnCount, _ = s.overscanCount, y = s.overscanRowCount, x = s.overscanRowsCount, I = s.rowCount, R = this.state, L = R.isScrolling, N = R.verticalScrollDirection, F = R.scrollTop, M = y || x || _ || 1;
|
|
1583
|
+
if (w === 0 || I === 0)
|
|
1584
1584
|
return [0, 0, 0, 0];
|
|
1585
|
-
var
|
|
1586
|
-
return [Math.max(0,
|
|
1585
|
+
var D = p(this.props, F, this._instanceProps), O = T(this.props, D, F, this._instanceProps), A = !L || N === "backward" ? Math.max(1, M) : 1, H = !L || N === "forward" ? Math.max(1, M) : 1;
|
|
1586
|
+
return [Math.max(0, D - A), Math.max(0, Math.min(I - 1, O + H)), D, O];
|
|
1587
1587
|
}, v;
|
|
1588
1588
|
}(oo), e.defaultProps = {
|
|
1589
1589
|
direction: "ltr",
|
|
@@ -1760,16 +1760,16 @@ function oi(t, e) {
|
|
|
1760
1760
|
return !Zt(n, o) && !Zt(r, i);
|
|
1761
1761
|
}
|
|
1762
1762
|
const ri = () => {
|
|
1763
|
-
const { viewMode: t } =
|
|
1763
|
+
const { viewMode: t } = Fe(), { scrollMode: e } = Ne(), { setColumnCount: n } = sn(), { virtualScrollableElementRef: r } = Ye(), o = Ge(), i = W(() => o.heights.length, [o.heights]), c = W(() => e === ne.HORIZONTAL_SCROLLING ? i : t === Le.DUAL_PAGE ? 2 : 1, [t, e, e, i, r]), l = W(() => o.widths.reduce((g, S, v) => {
|
|
1764
1764
|
const h = v % c;
|
|
1765
1765
|
return (!g[h] || S > g[h]) && (g[h] = S), g;
|
|
1766
|
-
}, []), [o.widths, c]), d =
|
|
1766
|
+
}, []), [o.widths, c]), d = E(
|
|
1767
1767
|
(b) => {
|
|
1768
1768
|
const g = b % l.length;
|
|
1769
1769
|
return l[g] || 0;
|
|
1770
1770
|
},
|
|
1771
1771
|
[l]
|
|
1772
|
-
), f =
|
|
1772
|
+
), f = E(
|
|
1773
1773
|
(b) => {
|
|
1774
1774
|
const g = Array.from({ length: c }, (S, v) => {
|
|
1775
1775
|
const h = b * c + v;
|
|
@@ -1782,13 +1782,13 @@ const ri = () => {
|
|
|
1782
1782
|
z(() => {
|
|
1783
1783
|
n(c);
|
|
1784
1784
|
}, [c, n]);
|
|
1785
|
-
const m =
|
|
1785
|
+
const m = W(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / c), [c, i, e]), C = W(() => o.heights.reduce((b, g) => b + g, 0) / o.heights.length || 0, [o]), p = W(() => o.widths.reduce((b, g) => b + g, 0) / o.widths.length || 0, [o]), T = W(() => {
|
|
1786
1786
|
const { rowsHeight: b, columnsWidth: g } = Tt(o, c);
|
|
1787
1787
|
return {
|
|
1788
1788
|
rowsHeight: b,
|
|
1789
1789
|
columnsWidth: g
|
|
1790
1790
|
};
|
|
1791
|
-
}, [o, c]), P =
|
|
1791
|
+
}, [o, c]), P = W(() => ({
|
|
1792
1792
|
width: T.columnsWidth.reduce((b, g) => b + g, 0),
|
|
1793
1793
|
height: T.rowsHeight.reduce((b, g) => b + g, 0)
|
|
1794
1794
|
}), [T]);
|
|
@@ -1977,14 +1977,14 @@ class ai extends ro {
|
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
1979
|
const si = rn(({ widths: t, heights: e }) => {
|
|
1980
|
-
const { focusedPage: n, totalPages: r } = de(), o =
|
|
1980
|
+
const { focusedPage: n, totalPages: r } = de(), o = W(() => {
|
|
1981
1981
|
const l = [], d = Math.ceil(n / 2) * 2 - 1;
|
|
1982
1982
|
if (l.push(d), d + 1 <= r) {
|
|
1983
1983
|
const f = d + 1;
|
|
1984
1984
|
l.push(f);
|
|
1985
1985
|
}
|
|
1986
1986
|
return l;
|
|
1987
|
-
}, [n, r]), i =
|
|
1987
|
+
}, [n, r]), i = W(() => {
|
|
1988
1988
|
const l = n % 2 === 1 ? n - 1 : n - 2, d = Math.floor(l / 2), f = e(d), m = t(l), C = t(l + 1);
|
|
1989
1989
|
return [
|
|
1990
1990
|
{
|
|
@@ -2000,14 +2000,14 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2000
2000
|
height: f
|
|
2001
2001
|
}
|
|
2002
2002
|
];
|
|
2003
|
-
}, [t, e, o]), c =
|
|
2003
|
+
}, [t, e, o]), c = W(() => i.reduce((l, d) => l + Number(d.width || 0), 0), [i]);
|
|
2004
2004
|
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: o.map((l, d) => /* @__PURE__ */ a(It, { style: i[d], pageNumber: l }, l)) });
|
|
2005
2005
|
}), ci = ({ widths: t, heights: e }) => {
|
|
2006
|
-
const { focusedPage: n } = de(), r =
|
|
2006
|
+
const { focusedPage: n } = de(), r = W(() => ({
|
|
2007
2007
|
position: "absolute",
|
|
2008
2008
|
width: t(n - 1),
|
|
2009
2009
|
height: e(n - 1)
|
|
2010
|
-
}), [t, e, n]), o =
|
|
2010
|
+
}), [t, e, n]), o = W(() => t(n - 1), [t]);
|
|
2011
2011
|
return /* @__PURE__ */ a(
|
|
2012
2012
|
"div",
|
|
2013
2013
|
{
|
|
@@ -2019,10 +2019,10 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2019
2019
|
}
|
|
2020
2020
|
);
|
|
2021
2021
|
}, li = (t, e, n) => {
|
|
2022
|
-
const r = k(), { contentRef: o } = be(), { heights: i, widths: c } = Ge(), { setFocusedPage: l } = de(), [d, f] =
|
|
2022
|
+
const r = k(), { contentRef: o } = be(), { heights: i, widths: c } = Ge(), { setFocusedPage: l } = de(), [d, f] = q([]), { targetScrollPage: m } = cn(), C = Ct(d, 0, 500), p = W(() => {
|
|
2023
2023
|
const { rowsHeight: P, columnsWidth: b } = Tt({ heights: i, widths: c }, t);
|
|
2024
2024
|
return i.map((g, S) => {
|
|
2025
|
-
const v = c[S], h = Jo(S + 1, t), u = b.slice(0, h.columnIndex).reduce((y,
|
|
2025
|
+
const v = c[S], h = Jo(S + 1, t), u = b.slice(0, h.columnIndex).reduce((y, x) => y + x, 0), s = P.slice(0, h.rowIndex).reduce((y, x) => y + x, 0), w = u + v, _ = s + g;
|
|
2026
2026
|
return {
|
|
2027
2027
|
pageNumber: S + 1,
|
|
2028
2028
|
...h,
|
|
@@ -2041,7 +2041,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2041
2041
|
m.current = void 0;
|
|
2042
2042
|
}, 500);
|
|
2043
2043
|
}, [C, l]);
|
|
2044
|
-
const T =
|
|
2044
|
+
const T = E(
|
|
2045
2045
|
(P) => {
|
|
2046
2046
|
r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
2047
2047
|
const b = P.target, g = {
|
|
@@ -2053,10 +2053,10 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2053
2053
|
const h = v.endX >= g.startLeft && v.endY >= g.startTop, u = v.startX <= g.endLeft && v.startY <= g.endTop;
|
|
2054
2054
|
return h && u;
|
|
2055
2055
|
}).map((v) => {
|
|
2056
|
-
const h = g.startLeft > v.startX ? g.startLeft : v.startX, u = g.startTop > v.startY ? g.startTop : v.startY, s = g.endLeft < v.endX ? g.endLeft : v.endX, w = g.endTop < v.endY ? g.endTop : v.endY, _ = s - h, y = w - u,
|
|
2056
|
+
const h = g.startLeft > v.startX ? g.startLeft : v.startX, u = g.startTop > v.startY ? g.startTop : v.startY, s = g.endLeft < v.endX ? g.endLeft : v.endX, w = g.endTop < v.endY ? g.endTop : v.endY, _ = s - h, y = w - u, I = +(_ * y / (v.width * v.height) * 100).toFixed(2);
|
|
2057
2057
|
return {
|
|
2058
2058
|
pageNumber: v.pageNumber,
|
|
2059
|
-
ratio:
|
|
2059
|
+
ratio: I
|
|
2060
2060
|
};
|
|
2061
2061
|
}).sort((v, h) => h.ratio - v.ratio);
|
|
2062
2062
|
f(S);
|
|
@@ -2105,80 +2105,80 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2105
2105
|
virtualScrollableElementRef: p,
|
|
2106
2106
|
totalInnerDimensions: T,
|
|
2107
2107
|
pageScrollElementRef: P
|
|
2108
|
-
} = Ye(), b = k(!0), { nextPage: g, prevPage: S, setFocusedPage: v, focusedPage: h } = de(), { scrollMode: u } =
|
|
2108
|
+
} = Ye(), b = k(!0), { nextPage: g, prevPage: S, setFocusedPage: v, focusedPage: h } = de(), { scrollMode: u } = Ne(), { viewMode: s } = Fe(), w = k(null), { loading: _, error: y } = oe(), { passwordRequired: x } = co(), { LoaderImageComponent: I } = bt(), R = k(
|
|
2109
2109
|
T
|
|
2110
|
-
),
|
|
2110
|
+
), L = k({
|
|
2111
2111
|
viewMode: s,
|
|
2112
2112
|
scrollMode: u
|
|
2113
|
-
}),
|
|
2114
|
-
pageDimension:
|
|
2115
|
-
rowCount:
|
|
2116
|
-
rowHeight:
|
|
2117
|
-
columnCount:
|
|
2113
|
+
}), N = k(!1), F = k(), { isFullScreen: M } = fo(), {
|
|
2114
|
+
pageDimension: D,
|
|
2115
|
+
rowCount: O,
|
|
2116
|
+
rowHeight: A,
|
|
2117
|
+
columnCount: H,
|
|
2118
2118
|
columnWidth: U,
|
|
2119
|
-
estimatedColumnWidth:
|
|
2119
|
+
estimatedColumnWidth: B,
|
|
2120
2120
|
estimatedRowHeight: V,
|
|
2121
2121
|
totalDimension: ee
|
|
2122
2122
|
} = ri(), G = Ct(T, 100), Z = k();
|
|
2123
|
-
li(
|
|
2123
|
+
li(H, O, p);
|
|
2124
2124
|
const Y = k({
|
|
2125
2125
|
scrollTop: 0,
|
|
2126
2126
|
scrollLeft: 0
|
|
2127
2127
|
});
|
|
2128
2128
|
or(r);
|
|
2129
|
-
const { isPressed: re } = tr(), { selectionMode: ae } = po(), { initializeGrabScroll:
|
|
2129
|
+
const { isPressed: re } = tr(), { selectionMode: ae } = po(), { initializeGrabScroll: ie, resetGrabState: ue } = nr({
|
|
2130
2130
|
isPressed: re
|
|
2131
|
-
}),
|
|
2132
|
-
columnCount:
|
|
2133
|
-
}), [
|
|
2134
|
-
(
|
|
2131
|
+
}), J = W(() => ae === ao.HAND, [ae]), me = W(() => ({
|
|
2132
|
+
columnCount: H
|
|
2133
|
+
}), [H]), ye = E(
|
|
2134
|
+
(j) => {
|
|
2135
2135
|
const K = document.activeElement !== r;
|
|
2136
|
-
!
|
|
2136
|
+
!M && K || (["ArrowUp", "ArrowLeft"].includes(j.key) ? (j.preventDefault(), S()) : ["ArrowDown", "ArrowRight"].includes(j.key) && (j.preventDefault(), g()));
|
|
2137
2137
|
},
|
|
2138
|
-
[g, S,
|
|
2138
|
+
[g, S, M, u]
|
|
2139
2139
|
);
|
|
2140
|
-
z(() => (window.addEventListener("keydown",
|
|
2141
|
-
window.removeEventListener("keydown",
|
|
2142
|
-
}), [
|
|
2140
|
+
z(() => (window.addEventListener("keydown", ye), () => {
|
|
2141
|
+
window.removeEventListener("keydown", ye);
|
|
2142
|
+
}), [ye]), z(() => {
|
|
2143
2143
|
if (w.current && (w.current.style.position = "relative"), !!l)
|
|
2144
|
-
for (let
|
|
2145
|
-
for (let K = 0; K <
|
|
2144
|
+
for (let j = 0; j < O; j++)
|
|
2145
|
+
for (let K = 0; K < H; K++)
|
|
2146
2146
|
l.resetAfterIndices({
|
|
2147
2147
|
columnIndex: K,
|
|
2148
|
-
rowIndex:
|
|
2148
|
+
rowIndex: j,
|
|
2149
2149
|
shouldForceUpdate: !0
|
|
2150
2150
|
});
|
|
2151
|
-
}, [
|
|
2152
|
-
const ot =
|
|
2153
|
-
(
|
|
2151
|
+
}, [O, H, D, l]);
|
|
2152
|
+
const ot = E(
|
|
2153
|
+
(j, K) => {
|
|
2154
2154
|
if (!p)
|
|
2155
2155
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
2156
|
-
const
|
|
2157
|
-
return
|
|
2156
|
+
const Se = Y.current.scrollTop > K, Ie = Y.current.scrollLeft > j;
|
|
2157
|
+
return Se || Ie ? Y.current : {
|
|
2158
2158
|
scrollTop: p.scrollTop,
|
|
2159
2159
|
scrollLeft: p.scrollLeft
|
|
2160
2160
|
};
|
|
2161
2161
|
},
|
|
2162
2162
|
[p]
|
|
2163
|
-
), Et =
|
|
2164
|
-
(
|
|
2165
|
-
if (
|
|
2166
|
-
Z.current && clearTimeout(Z.current),
|
|
2163
|
+
), Et = E(
|
|
2164
|
+
(j, K) => {
|
|
2165
|
+
if (L.current.viewMode !== s || L.current.scrollMode !== u) {
|
|
2166
|
+
Z.current && clearTimeout(Z.current), N.current = !0, c(h, "auto"), Z.current = setTimeout(() => {
|
|
2167
2167
|
requestAnimationFrame(() => {
|
|
2168
|
-
|
|
2168
|
+
L.current = { viewMode: s, scrollMode: u };
|
|
2169
2169
|
});
|
|
2170
2170
|
}, 100);
|
|
2171
2171
|
return;
|
|
2172
2172
|
}
|
|
2173
|
-
const
|
|
2173
|
+
const Ie = j.scrollTop, rt = j.scrollLeft;
|
|
2174
2174
|
if (!K.height || !K.width)
|
|
2175
2175
|
return;
|
|
2176
|
-
|
|
2177
|
-
const { height:
|
|
2178
|
-
if (Nt ===
|
|
2176
|
+
N.current = !0;
|
|
2177
|
+
const { height: xe, width: it } = K, { height: Nt, width: Ot } = R.current;
|
|
2178
|
+
if (Nt === xe && Ot === it)
|
|
2179
2179
|
return;
|
|
2180
|
-
const Jn =
|
|
2181
|
-
|
|
2180
|
+
const Jn = Ie / Nt * xe, eo = rt / Ot * it, to = Math.round(Math.min(Jn, xe)) || 0, no = Math.round(Math.min(eo, it)) || 0;
|
|
2181
|
+
F.current = setTimeout(() => {
|
|
2182
2182
|
requestAnimationFrame(() => {
|
|
2183
2183
|
p == null || p.scrollTo({
|
|
2184
2184
|
top: to,
|
|
@@ -2186,7 +2186,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2186
2186
|
behavior: "auto"
|
|
2187
2187
|
});
|
|
2188
2188
|
});
|
|
2189
|
-
}, 0),
|
|
2189
|
+
}, 0), R.current = {
|
|
2190
2190
|
height: K.height,
|
|
2191
2191
|
width: K.width
|
|
2192
2192
|
};
|
|
@@ -2194,24 +2194,24 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2194
2194
|
[p, s, u, c]
|
|
2195
2195
|
);
|
|
2196
2196
|
z(() => {
|
|
2197
|
-
clearTimeout(
|
|
2198
|
-
const
|
|
2199
|
-
(
|
|
2197
|
+
clearTimeout(F.current);
|
|
2198
|
+
const j = Array.from({ length: O }).reduce(
|
|
2199
|
+
(Ie, rt, xe) => Ie + A(xe),
|
|
2200
2200
|
0
|
|
2201
|
-
), K = Array.from({ length:
|
|
2202
|
-
(
|
|
2201
|
+
), K = Array.from({ length: H }).reduce(
|
|
2202
|
+
(Ie, rt, xe) => Ie + U(xe),
|
|
2203
2203
|
0
|
|
2204
|
-
),
|
|
2205
|
-
Y.current =
|
|
2206
|
-
height:
|
|
2204
|
+
), Se = ot(K, j);
|
|
2205
|
+
Y.current = Se, Et(Se, { height: j, width: K }), C({
|
|
2206
|
+
height: j,
|
|
2207
2207
|
width: K
|
|
2208
2208
|
});
|
|
2209
|
-
}, [
|
|
2210
|
-
const Xn =
|
|
2211
|
-
(
|
|
2209
|
+
}, [D, O, H, Et]);
|
|
2210
|
+
const Xn = E(
|
|
2211
|
+
(j) => {
|
|
2212
2212
|
Y.current = {
|
|
2213
|
-
scrollTop:
|
|
2214
|
-
scrollLeft:
|
|
2213
|
+
scrollTop: j.scrollTop,
|
|
2214
|
+
scrollLeft: j.scrollLeft
|
|
2215
2215
|
};
|
|
2216
2216
|
},
|
|
2217
2217
|
[p]
|
|
@@ -2219,17 +2219,17 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2219
2219
|
z(() => () => {
|
|
2220
2220
|
Z.current && clearTimeout(Z.current);
|
|
2221
2221
|
}, []);
|
|
2222
|
-
const Qn =
|
|
2223
|
-
[se["rp-cursor-grab"]]:
|
|
2224
|
-
[se["rp-cursor-grabbing"]]:
|
|
2225
|
-
}), [
|
|
2226
|
-
(
|
|
2227
|
-
if (
|
|
2228
|
-
const K = ce(se["rp-pages"]),
|
|
2229
|
-
|
|
2222
|
+
const Qn = W(() => ce(se["rp-pages-container"], {
|
|
2223
|
+
[se["rp-cursor-grab"]]: J && !re,
|
|
2224
|
+
[se["rp-cursor-grabbing"]]: J && re
|
|
2225
|
+
}), [J, re]), Yn = E(
|
|
2226
|
+
(j) => {
|
|
2227
|
+
if (J && j) {
|
|
2228
|
+
const K = ce(se["rp-pages"]), Se = document.querySelector(`.${K}`);
|
|
2229
|
+
ie(Se);
|
|
2230
2230
|
}
|
|
2231
2231
|
},
|
|
2232
|
-
[
|
|
2232
|
+
[J, ie, se]
|
|
2233
2233
|
);
|
|
2234
2234
|
return z(() => {
|
|
2235
2235
|
_ && ue();
|
|
@@ -2247,7 +2247,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2247
2247
|
P,
|
|
2248
2248
|
v,
|
|
2249
2249
|
G
|
|
2250
|
-
]), /* @__PURE__ */
|
|
2250
|
+
]), /* @__PURE__ */ $(he, { children: [
|
|
2251
2251
|
/* @__PURE__ */ a(No, { ref: i, children: /* @__PURE__ */ a(
|
|
2252
2252
|
Rn,
|
|
2253
2253
|
{
|
|
@@ -2255,13 +2255,13 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2255
2255
|
ref: o,
|
|
2256
2256
|
tabIndex: -1,
|
|
2257
2257
|
className: Qn,
|
|
2258
|
-
children: /* @__PURE__ */ a(ai, { style: { minHeight: "50px" }, children: ({ width:
|
|
2258
|
+
children: /* @__PURE__ */ a(ai, { style: { minHeight: "50px" }, children: ({ width: j, height: K }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Yn, style: { width: j, height: K }, children: u === ne.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
2259
2259
|
"div",
|
|
2260
2260
|
{
|
|
2261
2261
|
ref: f,
|
|
2262
|
-
style: { width:
|
|
2262
|
+
style: { width: j, height: K },
|
|
2263
2263
|
className: ce(se["rp-pages"], se["rp-page-scrolling-wrapper"]),
|
|
2264
|
-
children: s ===
|
|
2264
|
+
children: s === Le.DUAL_PAGE ? /* @__PURE__ */ a(si, { widths: U, heights: A }) : /* @__PURE__ */ a(ci, { widths: U, heights: A })
|
|
2265
2265
|
}
|
|
2266
2266
|
) : V ? /* @__PURE__ */ a(
|
|
2267
2267
|
ei,
|
|
@@ -2271,14 +2271,14 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2271
2271
|
outerRef: m,
|
|
2272
2272
|
innerRef: w,
|
|
2273
2273
|
onScroll: Xn,
|
|
2274
|
-
columnCount:
|
|
2274
|
+
columnCount: H,
|
|
2275
2275
|
columnWidth: U,
|
|
2276
|
-
rowHeight:
|
|
2276
|
+
rowHeight: A,
|
|
2277
2277
|
height: K,
|
|
2278
|
-
width:
|
|
2279
|
-
estimatedColumnWidth:
|
|
2278
|
+
width: j,
|
|
2279
|
+
estimatedColumnWidth: B,
|
|
2280
2280
|
estimatedRowHeight: V,
|
|
2281
|
-
rowCount:
|
|
2281
|
+
rowCount: O,
|
|
2282
2282
|
className: ce(
|
|
2283
2283
|
se["rp-pages"],
|
|
2284
2284
|
u === ne.HORIZONTAL_SCROLLING ? se["rp-pages-horizontal-scroll"] : ""
|
|
@@ -2286,8 +2286,8 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2286
2286
|
style: {
|
|
2287
2287
|
"--rp-pages-height": `${ee.height}px`,
|
|
2288
2288
|
"--rp-pages-width": `${ee.width}px`,
|
|
2289
|
-
"--rp-row-count": `${
|
|
2290
|
-
"--rp-column-count": `${
|
|
2289
|
+
"--rp-row-count": `${O}`,
|
|
2290
|
+
"--rp-column-count": `${H}`
|
|
2291
2291
|
},
|
|
2292
2292
|
children: di
|
|
2293
2293
|
}
|
|
@@ -2302,11 +2302,11 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2302
2302
|
height: "100%",
|
|
2303
2303
|
width: "100%"
|
|
2304
2304
|
},
|
|
2305
|
-
children:
|
|
2305
|
+
children: I && /* @__PURE__ */ a(I, {})
|
|
2306
2306
|
}
|
|
2307
|
-
) : y === so.NOT_SUPPORTED ? /* @__PURE__ */ a("div", { className: se["rp-not-supported"], children: /* @__PURE__ */
|
|
2307
|
+
) : y === so.NOT_SUPPORTED ? /* @__PURE__ */ a("div", { className: se["rp-not-supported"], children: /* @__PURE__ */ $("div", { className: se["rp-not-supported-content"], children: [
|
|
2308
2308
|
"React PDF is unable to render on this browser. Please use the supported browsers from the list below:",
|
|
2309
|
-
/* @__PURE__ */ a("div", { children: /* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ $("ul", { children: [
|
|
2310
2310
|
/* @__PURE__ */ a("li", { children: "Chrome 110+" }),
|
|
2311
2311
|
/* @__PURE__ */ a("li", { children: "Edge 115+" }),
|
|
2312
2312
|
/* @__PURE__ */ a("li", { children: "Firefox 115+" }),
|
|
@@ -2317,7 +2317,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2317
2317
|
] }) }) : null }) })
|
|
2318
2318
|
}
|
|
2319
2319
|
) }),
|
|
2320
|
-
|
|
2320
|
+
x && /* @__PURE__ */ a(rr, {})
|
|
2321
2321
|
] });
|
|
2322
2322
|
}, ke = {
|
|
2323
2323
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
@@ -2336,24 +2336,24 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2336
2336
|
const { nextIcon: t } = Pe(), { nextIcon: e } = Te();
|
|
2337
2337
|
return t || e || /* @__PURE__ */ a(Ze, { style: { transform: "rotate(180deg" } });
|
|
2338
2338
|
}, hi = () => {
|
|
2339
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = de(), [c, l] =
|
|
2339
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = de(), [c, l] = q(t.toString()), { pageNavigationTool: d = !0 } = Ce(), { pageNavigationTool: f = !0 } = Oe(), { isSmallScreen: m } = De(), { viewMode: C } = Fe(), { scrollMode: p } = Ne(), { localeMessages: T } = fe();
|
|
2340
2340
|
z(() => {
|
|
2341
2341
|
l(t.toString());
|
|
2342
2342
|
}, [t]);
|
|
2343
|
-
const P =
|
|
2343
|
+
const P = E((h) => {
|
|
2344
2344
|
const u = h.target.value;
|
|
2345
2345
|
l(u);
|
|
2346
|
-
}, []), b =
|
|
2346
|
+
}, []), b = E(async () => {
|
|
2347
2347
|
const h = i(c);
|
|
2348
2348
|
h.success || l(h.currentPage.toString());
|
|
2349
|
-
}, [i, c, e]), g =
|
|
2349
|
+
}, [i, c, e]), g = E(() => {
|
|
2350
2350
|
l(t.toString());
|
|
2351
|
-
}, [t]), S =
|
|
2351
|
+
}, [t]), S = E(
|
|
2352
2352
|
(h) => {
|
|
2353
2353
|
h.key === "Enter" && b();
|
|
2354
2354
|
},
|
|
2355
2355
|
[b]
|
|
2356
|
-
), v =
|
|
2356
|
+
), v = W(() => C === Le.DUAL_PAGE && p === ne.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, C, p]);
|
|
2357
2357
|
return !d || !f ? null : typeof d != "boolean" ? /* @__PURE__ */ a(
|
|
2358
2358
|
d,
|
|
2359
2359
|
{
|
|
@@ -2374,7 +2374,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2374
2374
|
goToPage: i,
|
|
2375
2375
|
changePage: n
|
|
2376
2376
|
}
|
|
2377
|
-
) : /* @__PURE__ */
|
|
2377
|
+
) : /* @__PURE__ */ $("div", { className: ht["rp-paginate"], children: [
|
|
2378
2378
|
!m && /* @__PURE__ */ a(Q, { content: T == null ? void 0 : T.previousPageTooltip, children: /* @__PURE__ */ a(
|
|
2379
2379
|
we,
|
|
2380
2380
|
{
|
|
@@ -2396,7 +2396,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2396
2396
|
name: "page-input"
|
|
2397
2397
|
}
|
|
2398
2398
|
) }),
|
|
2399
|
-
/* @__PURE__ */
|
|
2399
|
+
/* @__PURE__ */ $("span", { className: ht["rp-total-page"], children: [
|
|
2400
2400
|
"/",
|
|
2401
2401
|
e
|
|
2402
2402
|
] }),
|
|
@@ -2493,16 +2493,16 @@ var vi = hr("DialogOverlay.RemoveScroll"), wi = X.forwardRef(
|
|
|
2493
2493
|
) })
|
|
2494
2494
|
);
|
|
2495
2495
|
}
|
|
2496
|
-
),
|
|
2496
|
+
), Ee = "DialogContent", zn = X.forwardRef(
|
|
2497
2497
|
(t, e) => {
|
|
2498
|
-
const n = On(
|
|
2498
|
+
const n = On(Ee, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, i = pe(Ee, t.__scopeDialog);
|
|
2499
2499
|
return /* @__PURE__ */ a(yt, { present: r || i.open, children: i.modal ? /* @__PURE__ */ a(_i, { ...o, ref: e }) : /* @__PURE__ */ a(bi, { ...o, ref: e }) });
|
|
2500
2500
|
}
|
|
2501
2501
|
);
|
|
2502
|
-
zn.displayName =
|
|
2502
|
+
zn.displayName = Ee;
|
|
2503
2503
|
var _i = X.forwardRef(
|
|
2504
2504
|
(t, e) => {
|
|
2505
|
-
const n = pe(
|
|
2505
|
+
const n = pe(Ee, t.__scopeDialog), r = X.useRef(null), o = Pt(e, n.contentRef, r);
|
|
2506
2506
|
return X.useEffect(() => {
|
|
2507
2507
|
const i = r.current;
|
|
2508
2508
|
if (i)
|
|
@@ -2531,7 +2531,7 @@ var _i = X.forwardRef(
|
|
|
2531
2531
|
}
|
|
2532
2532
|
), bi = X.forwardRef(
|
|
2533
2533
|
(t, e) => {
|
|
2534
|
-
const n = pe(
|
|
2534
|
+
const n = pe(Ee, t.__scopeDialog), r = X.useRef(!1), o = X.useRef(!1);
|
|
2535
2535
|
return /* @__PURE__ */ a(
|
|
2536
2536
|
Mn,
|
|
2537
2537
|
{
|
|
@@ -2554,8 +2554,8 @@ var _i = X.forwardRef(
|
|
|
2554
2554
|
}
|
|
2555
2555
|
), Mn = X.forwardRef(
|
|
2556
2556
|
(t, e) => {
|
|
2557
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...c } = t, l = pe(
|
|
2558
|
-
return vr(), /* @__PURE__ */
|
|
2557
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...c } = t, l = pe(Ee, n), d = X.useRef(null), f = Pt(e, d);
|
|
2558
|
+
return vr(), /* @__PURE__ */ $(he, { children: [
|
|
2559
2559
|
/* @__PURE__ */ a(
|
|
2560
2560
|
wr,
|
|
2561
2561
|
{
|
|
@@ -2579,7 +2579,7 @@ var _i = X.forwardRef(
|
|
|
2579
2579
|
)
|
|
2580
2580
|
}
|
|
2581
2581
|
),
|
|
2582
|
-
/* @__PURE__ */
|
|
2582
|
+
/* @__PURE__ */ $(he, { children: [
|
|
2583
2583
|
/* @__PURE__ */ a(Ci, { titleId: l.titleId }),
|
|
2584
2584
|
/* @__PURE__ */ a(yi, { contentRef: d, descriptionId: l.descriptionId })
|
|
2585
2585
|
] })
|
|
@@ -2618,7 +2618,7 @@ function Lt(t) {
|
|
|
2618
2618
|
return t ? "open" : "closed";
|
|
2619
2619
|
}
|
|
2620
2620
|
var $n = "DialogTitleWarning", [nc, qn] = ur($n, {
|
|
2621
|
-
contentName:
|
|
2621
|
+
contentName: Ee,
|
|
2622
2622
|
titleName: Rt,
|
|
2623
2623
|
docsSlug: "dialog"
|
|
2624
2624
|
}), Ci = ({ titleId: t }) => {
|
|
@@ -2638,7 +2638,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2638
2638
|
e && o && (document.getElementById(e) || console.warn(r));
|
|
2639
2639
|
}, [r, t, e]), null;
|
|
2640
2640
|
}, Si = En, Ii = Dn, xi = An, Ri = zn, Li = Fn, Ei = Hn;
|
|
2641
|
-
const
|
|
2641
|
+
const Re = {
|
|
2642
2642
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2643
2643
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
2644
2644
|
"rp-document-dialog": "_rp-document-dialog_slqo7_13",
|
|
@@ -2647,7 +2647,7 @@ const xe = {
|
|
|
2647
2647
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2648
2648
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2649
2649
|
}, Ni = () => {
|
|
2650
|
-
const { pdfProperties: t } = oe(), { container: e } = be(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = yo(), { localeMessages: o } = fe(), i =
|
|
2650
|
+
const { pdfProperties: t } = oe(), { container: e } = be(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = yo(), { localeMessages: o } = fe(), i = W(() => {
|
|
2651
2651
|
if (!t)
|
|
2652
2652
|
return [];
|
|
2653
2653
|
const {
|
|
@@ -2687,12 +2687,12 @@ const xe = {
|
|
|
2687
2687
|
{ label: o == null ? void 0 : o.propertiesPageCountLabel, value: S }
|
|
2688
2688
|
];
|
|
2689
2689
|
}, [t, o]);
|
|
2690
|
-
return /* @__PURE__ */ a(Si, { open: n, onOpenChange: r, children: /* @__PURE__ */ a(Ii, { container: e, children: /* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */ a(xi, { className:
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */ a(Li, { className:
|
|
2694
|
-
/* @__PURE__ */ a("div", { className:
|
|
2695
|
-
/* @__PURE__ */ a(Ei, { asChild: !0, className:
|
|
2690
|
+
return /* @__PURE__ */ a(Si, { open: n, onOpenChange: r, children: /* @__PURE__ */ a(Ii, { container: e, children: /* @__PURE__ */ $("div", { className: Re["rp-dialog-wrapper"], children: [
|
|
2691
|
+
/* @__PURE__ */ a(xi, { className: Re["rp-dialog-overlay"] }),
|
|
2692
|
+
/* @__PURE__ */ $(Ri, { className: Re["rp-document-dialog"], children: [
|
|
2693
|
+
/* @__PURE__ */ a(Li, { className: Re["rp-dialog-title"], children: o == null ? void 0 : o.documentPropertiesLabel }),
|
|
2694
|
+
/* @__PURE__ */ a("div", { className: Re["rp-document-properties"], children: i.map((c, l) => /* @__PURE__ */ a("div", { children: c.separate ? /* @__PURE__ */ a("div", { className: Re["rp-properties-divider"] }) : /* @__PURE__ */ a(zo, { label: c.label, value: c.value }) }, l)) }),
|
|
2695
|
+
/* @__PURE__ */ a(Ei, { asChild: !0, className: Re["rp-dialog-close"], children: /* @__PURE__ */ a(br, {}) })
|
|
2696
2696
|
] })
|
|
2697
2697
|
] }) }) });
|
|
2698
2698
|
}, Oi = {
|
|
@@ -2705,7 +2705,7 @@ const xe = {
|
|
|
2705
2705
|
const c = n || i;
|
|
2706
2706
|
return c.endsWith(Jt) ? c : `${c}${Jt}`;
|
|
2707
2707
|
};
|
|
2708
|
-
return { download:
|
|
2708
|
+
return { download: E(async () => {
|
|
2709
2709
|
if (!t || !e)
|
|
2710
2710
|
throw new Error("There is no PDF source to download");
|
|
2711
2711
|
const i = document.createElement("a");
|
|
@@ -2714,20 +2714,20 @@ const xe = {
|
|
|
2714
2714
|
}, Un = () => {
|
|
2715
2715
|
const { downloadIcon: t } = Pe(), { downloadIcon: e } = Te();
|
|
2716
2716
|
return t || e || /* @__PURE__ */ a(Sr, {});
|
|
2717
|
-
}, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), zi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Vn, { localeMessages: e, children: /* @__PURE__ */ a(we, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ a(Un, {}) }) }), Mi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */
|
|
2717
|
+
}, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), zi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Vn, { localeMessages: e, children: /* @__PURE__ */ a(we, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ a(Un, {}) }) }), Mi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */ $(Vn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2718
2718
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Un, {}) }),
|
|
2719
2719
|
e == null ? void 0 : e.downloadFileLabel
|
|
2720
2720
|
] }) }), Bn = () => {
|
|
2721
|
-
const { download: t } = Gn(), { downloadTool: e = !0 } = Ce(), { downloadTool: n = !0 } =
|
|
2721
|
+
const { download: t } = Gn(), { downloadTool: e = !0 } = Ce(), { downloadTool: n = !0 } = Oe(), { isSmallScreen: r } = De(), { localeMessages: o } = fe(), i = o == null ? void 0 : o.downloadFileTooltip;
|
|
2722
2722
|
return !e || !n ? null : r ? /* @__PURE__ */ a(Mi, { download: t, localeMessages: o }) : typeof e == "function" ? /* @__PURE__ */ a(Q, { content: i, children: /* @__PURE__ */ a(e, { download: t }) }) : typeof n == "function" ? /* @__PURE__ */ a(Q, { content: i, children: /* @__PURE__ */ a(n, { download: t }) }) : /* @__PURE__ */ a(zi, { download: t, localeMessages: o });
|
|
2723
2723
|
}, jn = () => {
|
|
2724
2724
|
const { printIcon: t } = Pe(), { printIcon: e } = Te();
|
|
2725
2725
|
return t || e || /* @__PURE__ */ a(Ir, {});
|
|
2726
|
-
}, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Fi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Kn, { localeMessages: e, children: /* @__PURE__ */ a(we, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(jn, {}) }) }), ki = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */
|
|
2726
|
+
}, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Fi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Kn, { localeMessages: e, children: /* @__PURE__ */ a(we, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(jn, {}) }) }), ki = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */ $(Kn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2727
2727
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(jn, {}) }),
|
|
2728
2728
|
e == null ? void 0 : e.printLabel
|
|
2729
2729
|
] }) }), Zn = () => {
|
|
2730
|
-
const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: i } = tt(), { printTool: c = !0 } = Ce(), { printTool: l = !0 } =
|
|
2730
|
+
const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: i } = tt(), { printTool: c = !0 } = Ce(), { printTool: l = !0 } = Oe(), { isSmallScreen: d } = De(), { localeMessages: f } = fe(), m = f == null ? void 0 : f.printTooltip;
|
|
2731
2731
|
return !c || !l ? null : d ? /* @__PURE__ */ a(ki, { print: t, localeMessages: f }) : typeof c == "function" ? /* @__PURE__ */ a(Q, { content: m, children: /* @__PURE__ */ a(
|
|
2732
2732
|
c,
|
|
2733
2733
|
{
|
|
@@ -2758,24 +2758,24 @@ const xe = {
|
|
|
2758
2758
|
const { goToLastPageIcon: t } = Pe(), { goToLastPageIcon: e } = Te();
|
|
2759
2759
|
return t || e || /* @__PURE__ */ a(mn, {});
|
|
2760
2760
|
}, en = { width: "100%" }, qi = () => {
|
|
2761
|
-
const { goToPage: t, totalPages: e, focusedPage: n } = de(), { jumpNavigationTool: r = !0 } = Ce(), { jumpNavigationTool: o = !0 } =
|
|
2761
|
+
const { goToPage: t, totalPages: e, focusedPage: n } = de(), { jumpNavigationTool: r = !0 } = Ce(), { jumpNavigationTool: o = !0 } = Oe(), { localeMessages: i } = fe(), c = W(() => n === 1, [n]), l = W(() => n === e, [n, e]), d = E(() => {
|
|
2762
2762
|
t(1);
|
|
2763
|
-
}, [t]), f =
|
|
2763
|
+
}, [t]), f = E(() => {
|
|
2764
2764
|
t(e);
|
|
2765
2765
|
}, [t, e]);
|
|
2766
|
-
return !r || !o ? null : /* @__PURE__ */
|
|
2767
|
-
/* @__PURE__ */ a(Xe, { onClick: d, children: /* @__PURE__ */ a(Q, { content: i == null ? void 0 : i.firstPageTooltip, style: en, children: /* @__PURE__ */
|
|
2766
|
+
return !r || !o ? null : /* @__PURE__ */ $(hn, { children: [
|
|
2767
|
+
/* @__PURE__ */ a(Xe, { onClick: d, children: /* @__PURE__ */ a(Q, { content: i == null ? void 0 : i.firstPageTooltip, style: en, children: /* @__PURE__ */ $("div", { className: "rp-menu-item", "aria-disabled": c, children: [
|
|
2768
2768
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Hi, {}) }),
|
|
2769
2769
|
/* @__PURE__ */ a("span", { children: i == null ? void 0 : i.firstPageLabel })
|
|
2770
2770
|
] }) }) }),
|
|
2771
|
-
/* @__PURE__ */ a(Xe, { onClick: f, children: /* @__PURE__ */ a(Q, { content: i == null ? void 0 : i.lastPageTooltip, style: en, children: /* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ a(Xe, { onClick: f, children: /* @__PURE__ */ a(Q, { content: i == null ? void 0 : i.lastPageTooltip, style: en, children: /* @__PURE__ */ $("div", { className: "rp-menu-item", "aria-disabled": l, children: [
|
|
2772
2772
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a($i, {}) }),
|
|
2773
2773
|
/* @__PURE__ */ a("span", { children: i == null ? void 0 : i.lastPageLabel })
|
|
2774
2774
|
] }) }) }),
|
|
2775
2775
|
/* @__PURE__ */ a(un, {})
|
|
2776
2776
|
] });
|
|
2777
2777
|
}, Gi = () => {
|
|
2778
|
-
const [t, e] =
|
|
2778
|
+
const [t, e] = q(!1), { container: n, pagesRef: r } = be(), { isSmallScreen: o } = De(), {
|
|
2779
2779
|
openFileTool: i,
|
|
2780
2780
|
downloadTool: c,
|
|
2781
2781
|
documentProperties: l,
|
|
@@ -2797,11 +2797,11 @@ const xe = {
|
|
|
2797
2797
|
printTool: w,
|
|
2798
2798
|
fullscreenTool: _,
|
|
2799
2799
|
viewModeTool: y
|
|
2800
|
-
} =
|
|
2801
|
-
new ResizeObserver((
|
|
2802
|
-
|
|
2800
|
+
} = Oe(), { localeMessages: x } = fe(), [I, R] = q(0), L = k(
|
|
2801
|
+
new ResizeObserver((M) => {
|
|
2802
|
+
R(M[0].contentRect.height);
|
|
2803
2803
|
})
|
|
2804
|
-
),
|
|
2804
|
+
), N = W(() => C || f || m || d || l || P || o && (i || c || p || T), [
|
|
2805
2805
|
i,
|
|
2806
2806
|
c,
|
|
2807
2807
|
p,
|
|
@@ -2812,7 +2812,7 @@ const xe = {
|
|
|
2812
2812
|
m,
|
|
2813
2813
|
C,
|
|
2814
2814
|
o
|
|
2815
|
-
]),
|
|
2815
|
+
]), F = W(() => s || h || u || v || S || y || o && (b || g || w || _), [
|
|
2816
2816
|
b,
|
|
2817
2817
|
g,
|
|
2818
2818
|
w,
|
|
@@ -2824,25 +2824,25 @@ const xe = {
|
|
|
2824
2824
|
s,
|
|
2825
2825
|
o
|
|
2826
2826
|
]);
|
|
2827
|
-
return z(() => (r &&
|
|
2828
|
-
|
|
2829
|
-
}), [r]), !
|
|
2827
|
+
return z(() => (r && L.current.observe(r), () => {
|
|
2828
|
+
L.current.disconnect();
|
|
2829
|
+
}), [r]), !N || !F ? null : /* @__PURE__ */ $(he, { children: [
|
|
2830
2830
|
/* @__PURE__ */ a(
|
|
2831
2831
|
dn,
|
|
2832
2832
|
{
|
|
2833
2833
|
container: n,
|
|
2834
2834
|
onOpenChange: e,
|
|
2835
|
-
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content:
|
|
2835
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content: x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ a(we, { active: t, "aria-label": x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ a(lr, {}) }) }) }),
|
|
2836
2836
|
side: "bottom",
|
|
2837
2837
|
avoidCollisions: !1,
|
|
2838
|
-
children: /* @__PURE__ */
|
|
2838
|
+
children: /* @__PURE__ */ $(
|
|
2839
2839
|
"div",
|
|
2840
2840
|
{
|
|
2841
|
-
style: { maxHeight: `${
|
|
2841
|
+
style: { maxHeight: `${I}px`, overflow: "auto" },
|
|
2842
2842
|
className: Oi["rp-other-tool-content"],
|
|
2843
2843
|
"data-rp": "moreOptionsDropdown",
|
|
2844
2844
|
children: [
|
|
2845
|
-
o && /* @__PURE__ */
|
|
2845
|
+
o && /* @__PURE__ */ $(hn, { children: [
|
|
2846
2846
|
/* @__PURE__ */ a(pn, {}),
|
|
2847
2847
|
/* @__PURE__ */ a(Bn, {}),
|
|
2848
2848
|
/* @__PURE__ */ a(Zn, {}),
|
|
@@ -2863,10 +2863,10 @@ const xe = {
|
|
|
2863
2863
|
/* @__PURE__ */ a(Ni, {})
|
|
2864
2864
|
] });
|
|
2865
2865
|
}, Ui = () => {
|
|
2866
|
-
const { isSmallScreen: t } =
|
|
2867
|
-
return /* @__PURE__ */
|
|
2866
|
+
const { isSmallScreen: t } = De();
|
|
2867
|
+
return /* @__PURE__ */ $(he, { children: [
|
|
2868
2868
|
/* @__PURE__ */ a(cr, {}),
|
|
2869
|
-
!t && /* @__PURE__ */
|
|
2869
|
+
!t && /* @__PURE__ */ $(he, { children: [
|
|
2870
2870
|
/* @__PURE__ */ a(pn, {}),
|
|
2871
2871
|
/* @__PURE__ */ a(Bn, {}),
|
|
2872
2872
|
/* @__PURE__ */ a(Zn, {}),
|
|
@@ -2876,7 +2876,7 @@ const xe = {
|
|
|
2876
2876
|
] });
|
|
2877
2877
|
}, tn = () => {
|
|
2878
2878
|
const { totalMatches: t, nextMatch: e, prevMatch: n } = St(), { localeMessages: r } = fe();
|
|
2879
|
-
return /* @__PURE__ */
|
|
2879
|
+
return /* @__PURE__ */ $(he, { children: [
|
|
2880
2880
|
/* @__PURE__ */ a(
|
|
2881
2881
|
Q,
|
|
2882
2882
|
{
|
|
@@ -2911,7 +2911,7 @@ const xe = {
|
|
|
2911
2911
|
const { searchIcon: t } = Pe(), { searchIcon: e } = Te();
|
|
2912
2912
|
return t || e || /* @__PURE__ */ a(gn, {});
|
|
2913
2913
|
}, Bi = ({ icon: t }) => {
|
|
2914
|
-
const { container: e } = be(), [n, r] =
|
|
2914
|
+
const { container: e } = be(), [n, r] = q(!1), { pdf: o } = oe(), [i, c] = q(null), {
|
|
2915
2915
|
searchOptions: l,
|
|
2916
2916
|
setSearchOptions: d,
|
|
2917
2917
|
loading: f,
|
|
@@ -2921,19 +2921,19 @@ const xe = {
|
|
|
2921
2921
|
nextMatch: T,
|
|
2922
2922
|
prevMatch: P,
|
|
2923
2923
|
search: b
|
|
2924
|
-
} = St(), { searchTool: g = !0 } = Ce(), { searchTool: S = !0 } =
|
|
2924
|
+
} = St(), { searchTool: g = !0 } = Ce(), { searchTool: S = !0 } = Oe(), [v, h] = q(b), { localeMessages: u } = fe(), { isSmallScreen: s } = De(), [w, _] = q(null), [y, x] = q(!1), I = E(() => {
|
|
2925
2925
|
r(!0);
|
|
2926
|
-
}, []),
|
|
2926
|
+
}, []), R = E(() => {
|
|
2927
2927
|
m(""), h(""), r(!1);
|
|
2928
|
-
}, [m]),
|
|
2928
|
+
}, [m]), L = (G) => {
|
|
2929
2929
|
const Z = G.key === "Enter", Y = G.key === " ";
|
|
2930
|
-
(Z || Y) &&
|
|
2931
|
-
},
|
|
2930
|
+
(Z || Y) && R();
|
|
2931
|
+
}, N = E(
|
|
2932
2932
|
(G) => {
|
|
2933
|
-
G.key === "Escape" && n &&
|
|
2933
|
+
G.key === "Escape" && n && R();
|
|
2934
2934
|
},
|
|
2935
2935
|
[n]
|
|
2936
|
-
),
|
|
2936
|
+
), F = E(
|
|
2937
2937
|
(G) => {
|
|
2938
2938
|
G.shiftKey && G.key === "Enter" ? P() : G.key === "Enter" && b !== v ? m(v) : G.key === "Enter" && T();
|
|
2939
2939
|
},
|
|
@@ -2942,41 +2942,41 @@ const xe = {
|
|
|
2942
2942
|
z(() => {
|
|
2943
2943
|
h(b);
|
|
2944
2944
|
}, [b]), z(() => {
|
|
2945
|
-
b && o &&
|
|
2945
|
+
b && o && x(!0);
|
|
2946
2946
|
}, [b, o]), z(() => {
|
|
2947
2947
|
b && b.trim() !== "" && (h(b), m(b));
|
|
2948
|
-
}, []), z(() => (window.addEventListener("keydown",
|
|
2949
|
-
window.removeEventListener("keydown",
|
|
2950
|
-
}), [
|
|
2948
|
+
}, []), z(() => (window.addEventListener("keydown", N), () => {
|
|
2949
|
+
window.removeEventListener("keydown", N);
|
|
2950
|
+
}), [N]), z(() => {
|
|
2951
2951
|
i && setTimeout(() => {
|
|
2952
2952
|
i.focus();
|
|
2953
2953
|
}, 0);
|
|
2954
2954
|
}, [i]);
|
|
2955
|
-
const
|
|
2955
|
+
const M = E((G) => {
|
|
2956
2956
|
h(G.target.value);
|
|
2957
|
-
}, []),
|
|
2957
|
+
}, []), D = E(() => {
|
|
2958
2958
|
h(""), m("");
|
|
2959
|
-
}, [m]),
|
|
2959
|
+
}, [m]), O = W(() => `${p} / ${C}`, [p, C]), { wholeWords: A, matchCase: H } = W(() => l, [l]), U = E(
|
|
2960
2960
|
(G) => {
|
|
2961
2961
|
d((Z) => ({ ...Z, matchCase: G }));
|
|
2962
2962
|
},
|
|
2963
2963
|
[d]
|
|
2964
|
-
),
|
|
2964
|
+
), B = E(
|
|
2965
2965
|
(G) => {
|
|
2966
2966
|
d((Z) => ({ ...Z, wholeWords: G }));
|
|
2967
2967
|
},
|
|
2968
2968
|
[d]
|
|
2969
2969
|
);
|
|
2970
2970
|
z(() => {
|
|
2971
|
-
o && y &&
|
|
2972
|
-
}, [o,
|
|
2973
|
-
const V =
|
|
2971
|
+
o && y && R();
|
|
2972
|
+
}, [o, R]);
|
|
2973
|
+
const V = W(() => (w == null ? void 0 : w.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [w]), ee = E(
|
|
2974
2974
|
(G) => {
|
|
2975
2975
|
if (G.key === "Tab") {
|
|
2976
2976
|
const Z = document.activeElement;
|
|
2977
2977
|
let Y = 0;
|
|
2978
|
-
V.forEach((
|
|
2979
|
-
|
|
2978
|
+
V.forEach((ie, ue) => {
|
|
2979
|
+
ie === Z && (Y = ue);
|
|
2980
2980
|
});
|
|
2981
2981
|
let re = Y + 1;
|
|
2982
2982
|
G.shiftKey && (re = Y - 1);
|
|
@@ -2984,11 +2984,11 @@ const xe = {
|
|
|
2984
2984
|
if (ae)
|
|
2985
2985
|
ae.focus();
|
|
2986
2986
|
else if (re > V.length - 1) {
|
|
2987
|
-
const
|
|
2988
|
-
|
|
2987
|
+
const ie = V[0];
|
|
2988
|
+
ie && ie.focus();
|
|
2989
2989
|
} else {
|
|
2990
|
-
const
|
|
2991
|
-
|
|
2990
|
+
const ie = V[V.length - 1];
|
|
2991
|
+
ie && ie.focus();
|
|
2992
2992
|
}
|
|
2993
2993
|
}
|
|
2994
2994
|
},
|
|
@@ -3007,12 +3007,12 @@ const xe = {
|
|
|
3007
3007
|
we,
|
|
3008
3008
|
{
|
|
3009
3009
|
active: n,
|
|
3010
|
-
onClick:
|
|
3010
|
+
onClick: I,
|
|
3011
3011
|
"aria-label": u == null ? void 0 : u.searchButtonTooltip,
|
|
3012
3012
|
children: t || /* @__PURE__ */ a(Vi, {})
|
|
3013
3013
|
}
|
|
3014
3014
|
) }),
|
|
3015
|
-
children: /* @__PURE__ */
|
|
3015
|
+
children: /* @__PURE__ */ $(
|
|
3016
3016
|
"div",
|
|
3017
3017
|
{
|
|
3018
3018
|
ref: _,
|
|
@@ -3020,14 +3020,14 @@ const xe = {
|
|
|
3020
3020
|
tabIndex: 0,
|
|
3021
3021
|
onKeyDown: ee,
|
|
3022
3022
|
children: [
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */
|
|
3023
|
+
/* @__PURE__ */ $("div", { className: te["rp-search-tool-input-wrapper"], children: [
|
|
3024
|
+
/* @__PURE__ */ $("div", { className: te["rp-search-tool-input"], children: [
|
|
3025
3025
|
/* @__PURE__ */ a(Q, { content: u == null ? void 0 : u.searchInputTooltip, children: /* @__PURE__ */ a(
|
|
3026
3026
|
an,
|
|
3027
3027
|
{
|
|
3028
3028
|
value: v,
|
|
3029
|
-
onKeyDown:
|
|
3030
|
-
onChange:
|
|
3029
|
+
onKeyDown: F,
|
|
3030
|
+
onChange: M,
|
|
3031
3031
|
icon: /* @__PURE__ */ a(gn, {}),
|
|
3032
3032
|
placeholder: u == null ? void 0 : u.searchInputPlaceholder,
|
|
3033
3033
|
className: te["rp-search-input"],
|
|
@@ -3035,20 +3035,20 @@ const xe = {
|
|
|
3035
3035
|
id: "search-input",
|
|
3036
3036
|
name: "search-input",
|
|
3037
3037
|
tabIndex: 0,
|
|
3038
|
-
children: !!v && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick:
|
|
3038
|
+
children: !!v && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: D, children: /* @__PURE__ */ a(Lr, {}) })
|
|
3039
3039
|
}
|
|
3040
3040
|
) }),
|
|
3041
|
-
f ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(ln, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children:
|
|
3042
|
-
s && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(At, { onKeyPress:
|
|
3041
|
+
f ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(ln, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: O }),
|
|
3042
|
+
s && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(At, { onKeyPress: L, handleClose: R }) })
|
|
3043
3043
|
] }),
|
|
3044
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ $("div", { className: te["rp-search-tool-input-checkboxes"], children: [
|
|
3045
3045
|
s && /* @__PURE__ */ a(tn, {}),
|
|
3046
3046
|
/* @__PURE__ */ a(
|
|
3047
3047
|
zt,
|
|
3048
3048
|
{
|
|
3049
3049
|
tabIndex: 0,
|
|
3050
3050
|
name: "matchCase",
|
|
3051
|
-
value:
|
|
3051
|
+
value: H,
|
|
3052
3052
|
onChange: U,
|
|
3053
3053
|
children: u == null ? void 0 : u.searchMatchCaseLabel
|
|
3054
3054
|
}
|
|
@@ -3059,24 +3059,24 @@ const xe = {
|
|
|
3059
3059
|
{
|
|
3060
3060
|
tabIndex: 0,
|
|
3061
3061
|
name: "wholeWord",
|
|
3062
|
-
value:
|
|
3063
|
-
onChange:
|
|
3062
|
+
value: A,
|
|
3063
|
+
onChange: B,
|
|
3064
3064
|
children: u == null ? void 0 : u.searchWholeWordsLabel
|
|
3065
3065
|
}
|
|
3066
3066
|
),
|
|
3067
3067
|
!s && /* @__PURE__ */ a(Q, { content: u == null ? void 0 : u.searchWholeWordsTooltip, children: /* @__PURE__ */ a("div", { tabIndex: 0, className: te["rp-search-icon-info"], children: /* @__PURE__ */ a(Wt, {}) }) })
|
|
3068
3068
|
] })
|
|
3069
3069
|
] }),
|
|
3070
|
-
!s && /* @__PURE__ */
|
|
3070
|
+
!s && /* @__PURE__ */ $("div", { className: te["rp-search-tool-controls"], children: [
|
|
3071
3071
|
/* @__PURE__ */ a(tn, {}),
|
|
3072
|
-
/* @__PURE__ */ a(At, { onKeyPress:
|
|
3072
|
+
/* @__PURE__ */ a(At, { onKeyPress: L, handleClose: R })
|
|
3073
3073
|
] })
|
|
3074
3074
|
]
|
|
3075
3075
|
}
|
|
3076
3076
|
)
|
|
3077
3077
|
}
|
|
3078
3078
|
) });
|
|
3079
|
-
}, ji = "_loading_wazy2_1",
|
|
3079
|
+
}, ji = "_loading_wazy2_1", ze = {
|
|
3080
3080
|
"rp-loading-overlay": "_rp-loading-overlay_wazy2_1",
|
|
3081
3081
|
"rp-loading-modal": "_rp-loading-modal_wazy2_14",
|
|
3082
3082
|
"rp-loading-title": "_rp-loading-title_wazy2_27",
|
|
@@ -3086,28 +3086,28 @@ const xe = {
|
|
|
3086
3086
|
loading: ji
|
|
3087
3087
|
}, Ki = ({ percentage: t }) => {
|
|
3088
3088
|
const { cancel: e } = tt(), { localeMessages: n } = fe();
|
|
3089
|
-
return t < 1 ? null : /* @__PURE__ */ a("div", { className: ce(
|
|
3090
|
-
/* @__PURE__ */
|
|
3089
|
+
return t < 1 ? null : /* @__PURE__ */ a("div", { className: ce(ze["rp-loading-overlay"]), children: /* @__PURE__ */ $("div", { className: ce(ze["rp-loading-modal"]), children: [
|
|
3090
|
+
/* @__PURE__ */ $("div", { className: ce(ze["rp-loading-title"]), children: [
|
|
3091
3091
|
n == null ? void 0 : n.printLoadingMessage,
|
|
3092
3092
|
"..."
|
|
3093
3093
|
] }),
|
|
3094
|
-
/* @__PURE__ */ a("div", { className: ce(
|
|
3094
|
+
/* @__PURE__ */ a("div", { className: ce(ze["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
3095
3095
|
"div",
|
|
3096
3096
|
{
|
|
3097
|
-
className: ce(
|
|
3097
|
+
className: ce(ze["rp-loading-progress"]),
|
|
3098
3098
|
style: { width: `${t}%` }
|
|
3099
3099
|
}
|
|
3100
3100
|
) }),
|
|
3101
|
-
/* @__PURE__ */ a("button", { className: ce(
|
|
3101
|
+
/* @__PURE__ */ a("button", { className: ce(ze["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
|
|
3102
3102
|
] }) });
|
|
3103
3103
|
}, Zi = et((t, e) => {
|
|
3104
|
-
const { showPrintProgress: n = !0 } = Ce(), { showPrintProgress: r = !0 } =
|
|
3104
|
+
const { showPrintProgress: n = !0 } = Ce(), { showPrintProgress: r = !0 } = Oe(), { progress: o } = tt(), { isSmallScreen: i } = De(), { percentage: c } = o || {}, l = () => i ? { gridTemplateColumns: "25% 60% 15%" } : void 0, d = () => {
|
|
3105
3105
|
if (!(!n || !r || !c))
|
|
3106
3106
|
return /* @__PURE__ */ a(Ki, { percentage: c });
|
|
3107
3107
|
};
|
|
3108
|
-
return /* @__PURE__ */
|
|
3109
|
-
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: e, className: ke["rp-toolbar-content"], children: /* @__PURE__ */
|
|
3110
|
-
/* @__PURE__ */
|
|
3108
|
+
return /* @__PURE__ */ $("div", { children: [
|
|
3109
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBar", ref: e, className: ke["rp-toolbar-content"], children: /* @__PURE__ */ $("div", { className: ke["rp-toolbar-wrapper"], style: l(), children: [
|
|
3110
|
+
/* @__PURE__ */ $("div", { "data-rp": "topBarLeft", className: ke["rp-toolbar-start"], children: [
|
|
3111
3111
|
/* @__PURE__ */ a(Bi, {}),
|
|
3112
3112
|
/* @__PURE__ */ a(hi, {})
|
|
3113
3113
|
] }),
|
|
@@ -3127,10 +3127,10 @@ const xe = {
|
|
|
3127
3127
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3128
3128
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3129
3129
|
}, Xi = (t) => {
|
|
3130
|
-
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = de(), { pageRotate: i } = Je(), c = k(null), l = yn(), { pages: d } = oe(), [f, m] =
|
|
3130
|
+
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = de(), { pageRotate: i } = Je(), c = k(null), l = yn(), { pages: d } = oe(), [f, m] = q(null), C = k(!1), p = k(), T = W(() => n ? We["rp-thumbnail-active"] : "", [n]), P = W(() => ({
|
|
3131
3131
|
width: Math.round(r.width),
|
|
3132
3132
|
height: Math.round(r.height)
|
|
3133
|
-
}), [r]), b =
|
|
3133
|
+
}), [r]), b = E(() => {
|
|
3134
3134
|
e && o(e);
|
|
3135
3135
|
}, [o, e]);
|
|
3136
3136
|
return z(() => {
|
|
@@ -3173,7 +3173,7 @@ const xe = {
|
|
|
3173
3173
|
return c.current && S.observe(c.current), () => {
|
|
3174
3174
|
S.disconnect(), l.removeQueue(`thumbnail-${e}`);
|
|
3175
3175
|
};
|
|
3176
|
-
}, [l, e, d, f]), /* @__PURE__ */
|
|
3176
|
+
}, [l, e, d, f]), /* @__PURE__ */ $(
|
|
3177
3177
|
"div",
|
|
3178
3178
|
{
|
|
3179
3179
|
onClick: b,
|
|
@@ -3222,7 +3222,7 @@ const xe = {
|
|
|
3222
3222
|
}, Ji = et((t, e) => {
|
|
3223
3223
|
const { show: n, width: r } = t, { focusedPage: o, totalPages: i } = de(), { thumbnailPages: c, addPage: l, thumbnailLength: d, addToPage: f } = Tn(), m = k(null), C = k(1);
|
|
3224
3224
|
on(e, () => m.current);
|
|
3225
|
-
const p =
|
|
3225
|
+
const p = W(() => Object.values(c), [c]), T = E(() => {
|
|
3226
3226
|
const P = d + 1;
|
|
3227
3227
|
P <= i && l(P);
|
|
3228
3228
|
}, [l, i, d]);
|
|
@@ -3246,9 +3246,9 @@ const xe = {
|
|
|
3246
3246
|
const { thumbnailIcon: t } = Pe(), { thumbnailIcon: e } = Te();
|
|
3247
3247
|
return t || e || /* @__PURE__ */ a(So, {});
|
|
3248
3248
|
}, ta = () => {
|
|
3249
|
-
const { active: t, setActive: e } = Tn(), [n, r] =
|
|
3249
|
+
const { active: t, setActive: e } = Tn(), [n, r] = q(Fo), o = k(null), i = k(null), { thumbnailTool: c, sidebarEnable: l } = Ce(), { localeMessages: d } = fe(), f = E(() => {
|
|
3250
3250
|
e((C) => !C);
|
|
3251
|
-
}, []), m =
|
|
3251
|
+
}, []), m = W(() => typeof c != "boolean" && c ? /* @__PURE__ */ a(c, { onClick: f, active: t }) : c ? /* @__PURE__ */ a(Q, { content: d == null ? void 0 : d.thumbnailTooltip, children: /* @__PURE__ */ a(
|
|
3252
3252
|
we,
|
|
3253
3253
|
{
|
|
3254
3254
|
onClick: f,
|
|
@@ -3257,7 +3257,7 @@ const xe = {
|
|
|
3257
3257
|
children: /* @__PURE__ */ a(ea, {})
|
|
3258
3258
|
}
|
|
3259
3259
|
) }) : null, [c, t, f, d]);
|
|
3260
|
-
return /* @__PURE__ */ a(he, { children: l && /* @__PURE__ */
|
|
3260
|
+
return /* @__PURE__ */ a(he, { children: l && /* @__PURE__ */ $(
|
|
3261
3261
|
"div",
|
|
3262
3262
|
{
|
|
3263
3263
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
@@ -3265,7 +3265,7 @@ const xe = {
|
|
|
3265
3265
|
"data-rp": "sidebar",
|
|
3266
3266
|
children: [
|
|
3267
3267
|
/* @__PURE__ */ a("div", { ref: i, className: ft["rp-sidebar-content"], children: m }),
|
|
3268
|
-
/* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ $(
|
|
3269
3269
|
"div",
|
|
3270
3270
|
{
|
|
3271
3271
|
"data-rp": "thumbnailSidebar",
|
|
@@ -3298,20 +3298,20 @@ const xe = {
|
|
|
3298
3298
|
onLoaded: d,
|
|
3299
3299
|
cleanupOnLoaded: f,
|
|
3300
3300
|
onLayoutWidthChange: m
|
|
3301
|
-
} = t, [C, p] =
|
|
3301
|
+
} = t, [C, p] = q(null), { setContainer: T, setContentRef: P } = be(), { loading: b } = oe(), { LoaderImageComponent: g } = bt();
|
|
3302
3302
|
return z(() => (d && d(), () => {
|
|
3303
3303
|
f && f();
|
|
3304
3304
|
}), [d, f]), // TODO: deprecated in v2.0.0, remove later ~
|
|
3305
|
-
/* @__PURE__ */ a(Rn, { toolbarRef: C, ref: e, children: /* @__PURE__ */ a(xo, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Ro, { slots: r, children: /* @__PURE__ */ a(Ao, { icons: o, children: /* @__PURE__ */
|
|
3306
|
-
/* @__PURE__ */
|
|
3307
|
-
/* @__PURE__ */
|
|
3305
|
+
/* @__PURE__ */ a(Rn, { toolbarRef: C, ref: e, children: /* @__PURE__ */ a(xo, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Ro, { slots: r, children: /* @__PURE__ */ a(Ao, { icons: o, children: /* @__PURE__ */ $(Io, { getContainerRef: T, style: i, className: c, children: [
|
|
3306
|
+
/* @__PURE__ */ $(Eo, { children: [
|
|
3307
|
+
/* @__PURE__ */ $("div", { className: _e["rp-layout"], children: [
|
|
3308
3308
|
/* @__PURE__ */ a(
|
|
3309
3309
|
Zi,
|
|
3310
3310
|
{
|
|
3311
3311
|
ref: p
|
|
3312
3312
|
}
|
|
3313
3313
|
),
|
|
3314
|
-
/* @__PURE__ */
|
|
3314
|
+
/* @__PURE__ */ $("div", { className: _e["rp-content"], children: [
|
|
3315
3315
|
/* @__PURE__ */ a("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ a(ta, {}) }),
|
|
3316
3316
|
/* @__PURE__ */ a("div", { ref: P, className: _e["rp-pages"], children: n })
|
|
3317
3317
|
] })
|