@pdf-viewer/react 1.6.0-beta.11 → 1.6.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPDefaultLayout-9c364eae.js → RPDefaultLayout-39b107c5.js} +335 -335
- package/dist/assets/PasswordModal.css +1 -1
- package/dist/assets/RPDefaultLayout.css +1 -1
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/PasswordModal.js +22 -22
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.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/types/utils/types.d.ts +9 -6
- 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/dist/utils/types.js +3 -3
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as i, Fragment as
|
|
1
|
+
import { jsx as i, Fragment as fe, jsxs as F } from "react/jsx-runtime";
|
|
2
2
|
import * as B from "react";
|
|
3
3
|
import { useRef as H, useEffect as k, useCallback as N, useState as $, useMemo as W, createContext as Ye, useContext as Je, forwardRef as $e, useImperativeHandle as cn, createElement as Ue, PureComponent as Jn, Component as Qn, memo as er } from "react";
|
|
4
4
|
import { ChevronUpIcon as Me } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as re } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as ln } from "./components/ui/Input.js";
|
|
7
|
-
import { ViewMode as He, ScrollMode as ee, AnnotationSubType as
|
|
7
|
+
import { ViewMode as He, ScrollMode as ee, AnnotationSubType as zt, SelectionMode as tr, ZoomLevel as at } from "./utils/types.js";
|
|
8
8
|
import { useScrollModeContext as De } from "./contexts/ScrollModeContext.js";
|
|
9
9
|
import { useDocumentContext as J } from "./contexts/RPDocumentContext.js";
|
|
10
10
|
import { useDocumentPasswordContext as nr } from "./contexts/DocumentPasswordContext.js";
|
|
@@ -12,7 +12,7 @@ import { useDarkModeContext as rr } from "./contexts/DarkModeContext.js";
|
|
|
12
12
|
import { useRotationContext as Ge } from "./contexts/RotationContext.js";
|
|
13
13
|
import { useLayerContext as or } from "./contexts/LayerContext.js";
|
|
14
14
|
import { useZoomContext as Qe } from "./contexts/ZoomContext.js";
|
|
15
|
-
import { useViewModeContext as
|
|
15
|
+
import { useViewModeContext as ze } from "./contexts/ViewModeContext.js";
|
|
16
16
|
import { useVirtualScrollContext as et } from "./contexts/VirtualScrollContext.js";
|
|
17
17
|
import { useVirtualGridContext as dn } from "./contexts/VirtualGridContext.js";
|
|
18
18
|
import { useSelectionModeContext as ir } from "./contexts/SelectionModeContext.js";
|
|
@@ -31,10 +31,10 @@ import { useDownloadContext as hr } from "./contexts/DownloadContext.js";
|
|
|
31
31
|
import { useSmoothScrollContext as un } from "./contexts/SmoothScrollContext.js";
|
|
32
32
|
import { useLoaderContext as pn } from "./contexts/LoaderContext.js";
|
|
33
33
|
import "./components/RPConfig.js";
|
|
34
|
-
import { ThumbnailIcon as
|
|
34
|
+
import { ThumbnailIcon as mr } from "./components/icons/Thumbnail.js";
|
|
35
35
|
import { c as ne } from "./clsx-0c6e471a.js";
|
|
36
36
|
import { LoaderIcon as Ct } from "./components/icons/LoaderIcon.js";
|
|
37
|
-
import { useInfiniteScroll as
|
|
37
|
+
import { useInfiniteScroll as fr } from "./utils/hooks/useInfiniteScroll.js";
|
|
38
38
|
import { RPSplitter as gr } from "./components/layout/sidebar/RPSplitter.js";
|
|
39
39
|
import { useToolbarComponentContext as ve, ToolbarComponentProvider as vr } from "./contexts/ToolbarComponentContext.js";
|
|
40
40
|
import { useIconContext as pe, IconProvider as wr } from "./contexts/IconContext.js";
|
|
@@ -47,8 +47,8 @@ import { useThemeContext as Pr } from "./contexts/ThemeContext.js";
|
|
|
47
47
|
import * as Sr from "pdfjs-dist";
|
|
48
48
|
import { PixelsPerInch as yr, AnnotationMode as xr, RenderingCancelledException as Ir, AnnotationLayer as Rr } from "pdfjs-dist";
|
|
49
49
|
import { SimpleLinkService as Lr } from "./utils/link_service.js";
|
|
50
|
-
import { annotationsEvents as Er, annotationEventsHandler as Nr, handleClick as
|
|
51
|
-
import { normalizeSingleKeyword as
|
|
50
|
+
import { annotationsEvents as Er, annotationEventsHandler as Nr, handleClick as At, handleAnnotationWidget as Or, handleAnnotationLink as Dr, bindLayerEvents as zr, unbindLayerEvents as Ft } from "./utils/annotations.js";
|
|
51
|
+
import { normalizeSingleKeyword as Ar, sortHighlightPosition as Fr, unwrap as kr } from "./components/page/searchHighlight.js";
|
|
52
52
|
import { _ as Wr, U as Mr } from "./Popover-b7402893.js";
|
|
53
53
|
import { useMousePressed as Hr } from "./utils/hooks/useMousePressed.js";
|
|
54
54
|
import { useGrabScroll as $r } from "./utils/hooks/useGrabScroll.js";
|
|
@@ -64,7 +64,7 @@ import { appConsole as Zr } from "./utils/appConsole.js";
|
|
|
64
64
|
import { FileUploadTool as hn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
65
65
|
import { DarkModeTool as jr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
66
66
|
import { ThreeDotIcon as Kr } from "./components/icons/ThreeDotIcon.js";
|
|
67
|
-
import { UIDropDown as
|
|
67
|
+
import { UIDropDown as mn } from "./components/ui/DropDown.js";
|
|
68
68
|
import { e as Xr, a as Pt, P as Ve, c as We, g as St, i as Yr, k as Jr, f as Qr } from "./index-1cb41342.js";
|
|
69
69
|
import { D as eo, u as ct } from "./index-aa2d3884.js";
|
|
70
70
|
import { a as to, u as no, F as ro, b as oo, G as Ke } from "./index-7279fb4e.js";
|
|
@@ -77,10 +77,10 @@ import { DocumentProperties as uo } from "./components/layout/toolbar/DocumentPr
|
|
|
77
77
|
import { RotateTool as po } from "./components/layout/toolbar/RotateTool.js";
|
|
78
78
|
import { ScrollModeTool as ho } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
79
79
|
import { MenuSeparator as yt } from "./components/layout/toolbar/MenuSeparator.js";
|
|
80
|
-
import { FileDownloadDefaultIcon as
|
|
80
|
+
import { FileDownloadDefaultIcon as mo } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
81
81
|
import { MenuItem as be } from "./components/layout/toolbar/MenuItem.js";
|
|
82
|
-
import { PrintDefaultTool as
|
|
83
|
-
import { FullScreenTool as
|
|
82
|
+
import { PrintDefaultTool as fo } from "./components/icons/PrintDefaultIcon.js";
|
|
83
|
+
import { FullScreenTool as fn } from "./components/layout/toolbar/FullScreenTool.js";
|
|
84
84
|
import { GoToDownIcon as gn } from "./components/icons/GoToDownIcon.js";
|
|
85
85
|
import { SelectionModeTool as go } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
86
86
|
import { ZoomInIcon as vo } from "./components/icons/ZoomInIcon.js";
|
|
@@ -93,11 +93,11 @@ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
|
93
93
|
import { ClearIcon as Co } from "./components/icons/ClearIcon.js";
|
|
94
94
|
import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
|
|
95
95
|
import './assets/RPDefaultLayout.css';const vn = () => {
|
|
96
|
-
const { viewMode: e } =
|
|
96
|
+
const { viewMode: e } = ze(), { scrollMode: t } = De(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: a } = ie(), l = H(), { columnCount: s } = dn(), { widths: u, heights: p } = qe(), m = H(t), v = H(e), h = H(s), { targetScrollPage: _ } = un();
|
|
97
97
|
k(() => {
|
|
98
98
|
n != null && n.scrollToItem && (l.current = n);
|
|
99
99
|
}, [n]), k(() => {
|
|
100
|
-
|
|
100
|
+
m.current = t, v.current = e;
|
|
101
101
|
}, [t, e]);
|
|
102
102
|
const T = N(
|
|
103
103
|
(C, y) => {
|
|
@@ -113,38 +113,38 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
113
113
|
(c) => st(r, g, c)
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
|
-
const
|
|
116
|
+
const f = {
|
|
117
117
|
left: 0,
|
|
118
118
|
top: 0
|
|
119
119
|
};
|
|
120
120
|
return r == null ? void 0 : r.scrollTo({
|
|
121
|
-
...
|
|
121
|
+
...f,
|
|
122
122
|
behavior: y
|
|
123
123
|
});
|
|
124
124
|
},
|
|
125
125
|
[r, u, st]
|
|
126
126
|
);
|
|
127
127
|
return k(() => {
|
|
128
|
-
|
|
128
|
+
m.current = t, v.current = e;
|
|
129
129
|
}, [t, e]), k(() => {
|
|
130
130
|
h.current = s;
|
|
131
131
|
}, [s]), { scrollToPage: N(
|
|
132
132
|
(C, y = "smooth") => {
|
|
133
133
|
a(C);
|
|
134
134
|
const d = C - 1;
|
|
135
|
-
let
|
|
136
|
-
if (v.current === He.DUAL_PAGE &&
|
|
135
|
+
let f = d, g = 0;
|
|
136
|
+
if (v.current === He.DUAL_PAGE && m.current === ee.PAGE_SCROLLING) {
|
|
137
137
|
T(C, y);
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
|
-
if (
|
|
140
|
+
if (m.current === ee.PAGE_SCROLLING) {
|
|
141
141
|
a(C);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
if (!l.current || !o)
|
|
145
145
|
return;
|
|
146
146
|
const c = o;
|
|
147
|
-
if (_.current = C,
|
|
147
|
+
if (_.current = C, m.current === ee.HORIZONTAL_SCROLLING) {
|
|
148
148
|
g = d;
|
|
149
149
|
const P = {
|
|
150
150
|
left: Oe(u, g),
|
|
@@ -156,10 +156,10 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
if (v.current === He.DUAL_PAGE) {
|
|
159
|
-
g = d % 2,
|
|
159
|
+
g = d % 2, f = Math.floor(d / 2);
|
|
160
160
|
const P = {
|
|
161
161
|
left: Oe(u, g),
|
|
162
|
-
top: Oe(p,
|
|
162
|
+
top: Oe(p, f)
|
|
163
163
|
};
|
|
164
164
|
return c.scrollTo({
|
|
165
165
|
...P,
|
|
@@ -168,7 +168,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
168
168
|
}
|
|
169
169
|
const b = {
|
|
170
170
|
left: 0,
|
|
171
|
-
top: Oe(p,
|
|
171
|
+
top: Oe(p, f)
|
|
172
172
|
};
|
|
173
173
|
return c.scrollTo({
|
|
174
174
|
...b,
|
|
@@ -186,7 +186,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
186
186
|
]
|
|
187
187
|
) };
|
|
188
188
|
}, To = (e = 1) => {
|
|
189
|
-
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: a } = vn(), l = H(1), { viewMode: s } =
|
|
189
|
+
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: a } = vn(), l = H(1), { viewMode: s } = ze(), { scrollMode: u } = De(), { widths: p } = qe(), { pagesRef: m } = ge(), v = Tt(t, 100), h = N(
|
|
190
190
|
(d) => {
|
|
191
191
|
if (!/^[0-9]*$/g.test(d.toString()) || !d)
|
|
192
192
|
return { success: !1, currentPage: l.current };
|
|
@@ -196,19 +196,19 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
196
196
|
[o]
|
|
197
197
|
), _ = N(h, [h]), T = N(
|
|
198
198
|
(d) => {
|
|
199
|
-
const
|
|
200
|
-
return
|
|
199
|
+
const f = h(d);
|
|
200
|
+
return f.success && a(f.currentPage), f;
|
|
201
201
|
},
|
|
202
202
|
[h, a]
|
|
203
203
|
), S = N(() => {
|
|
204
204
|
let d = t - 1;
|
|
205
205
|
T(d);
|
|
206
206
|
}, [T, t, s, u]), C = W(() => {
|
|
207
|
-
if (!
|
|
207
|
+
if (!m)
|
|
208
208
|
return !1;
|
|
209
209
|
const d = t + 1;
|
|
210
|
-
return t % 2 === 1 && s === He.DUAL_PAGE && d <= o ? p[t] + p[d] <
|
|
211
|
-
}, [t, p,
|
|
210
|
+
return t % 2 === 1 && s === He.DUAL_PAGE && d <= o ? p[t] + p[d] < m.clientWidth : !1;
|
|
211
|
+
}, [t, p, m, o]), y = N(() => {
|
|
212
212
|
let d = t + 1;
|
|
213
213
|
C && (d = t + 2), T(d);
|
|
214
214
|
}, [T, t, C, s, u]);
|
|
@@ -261,24 +261,24 @@ const Po = () => {
|
|
|
261
261
|
loadedPages: 0,
|
|
262
262
|
totalPages: 0,
|
|
263
263
|
percentage: 0
|
|
264
|
-
}), [r, a] = $(!1), [l, s] = $(!1), [u, p] = $(null),
|
|
264
|
+
}), [r, a] = $(!1), [l, s] = $(!1), [u, p] = $(null), m = H(!1);
|
|
265
265
|
k(() => {
|
|
266
|
-
|
|
267
|
-
}, [
|
|
266
|
+
m.current;
|
|
267
|
+
}, [m]);
|
|
268
268
|
const v = N(() => {
|
|
269
269
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
270
|
-
const
|
|
271
|
-
|
|
270
|
+
const f = document.querySelector(".rp-print-zone");
|
|
271
|
+
f && f.remove();
|
|
272
272
|
}, []), h = N(() => {
|
|
273
|
-
|
|
273
|
+
m.current = !1, a(!1), s(!1), p(null), o({
|
|
274
274
|
loadedPages: 0,
|
|
275
275
|
totalPages: 0,
|
|
276
276
|
percentage: 0
|
|
277
277
|
});
|
|
278
278
|
}, []), _ = () => {
|
|
279
|
-
|
|
279
|
+
m.current = !0;
|
|
280
280
|
}, T = async ({
|
|
281
|
-
scratchCanvas:
|
|
281
|
+
scratchCanvas: f,
|
|
282
282
|
pdfDocument: g,
|
|
283
283
|
pageNumber: c,
|
|
284
284
|
viewerPdfPage: b,
|
|
@@ -286,42 +286,42 @@ const Po = () => {
|
|
|
286
286
|
optionalContentConfigPromise: P,
|
|
287
287
|
printAnnotationStoragePromise: E
|
|
288
288
|
}) => {
|
|
289
|
-
if (
|
|
289
|
+
if (m.current) {
|
|
290
290
|
h();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
293
|
const x = w / yr.PDF;
|
|
294
|
-
|
|
295
|
-
const R =
|
|
296
|
-
R.save(), R.fillStyle = "rgb(255, 255, 255)", R.fillRect(0, 0,
|
|
297
|
-
const [D,
|
|
294
|
+
f.width = Math.floor(b.width * x), f.height = Math.floor(b.height * x);
|
|
295
|
+
const R = f.getContext("2d");
|
|
296
|
+
R.save(), R.fillStyle = "rgb(255, 255, 255)", R.fillRect(0, 0, f.width, f.height), R.restore();
|
|
297
|
+
const [D, z] = await Promise.all([
|
|
298
298
|
g.getPage(c),
|
|
299
299
|
E
|
|
300
300
|
]);
|
|
301
|
-
if (
|
|
301
|
+
if (m.current) {
|
|
302
302
|
h();
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
const
|
|
305
|
+
const A = {
|
|
306
306
|
canvasContext: R,
|
|
307
307
|
transform: [x, 0, 0, x, 0, 0],
|
|
308
308
|
viewport: D.getViewport({ scale: 1, rotation: b.rotation }),
|
|
309
309
|
intent: "print",
|
|
310
310
|
annotationMode: xr.ENABLE_STORAGE,
|
|
311
311
|
optionalContentConfigPromise: P,
|
|
312
|
-
printAnnotationStorage:
|
|
312
|
+
printAnnotationStorage: z
|
|
313
313
|
};
|
|
314
314
|
try {
|
|
315
|
-
return D.render(
|
|
315
|
+
return D.render(A).promise;
|
|
316
316
|
} catch (L) {
|
|
317
317
|
throw L instanceof Ir || console.error(L), L;
|
|
318
318
|
}
|
|
319
319
|
}, S = N(() => {
|
|
320
|
-
const
|
|
320
|
+
const f = window.print;
|
|
321
321
|
return new Promise((g) => {
|
|
322
322
|
const c = (P) => {
|
|
323
323
|
setTimeout(() => {
|
|
324
|
-
|
|
324
|
+
f.call(window), setTimeout(() => P(), 20);
|
|
325
325
|
}, 0);
|
|
326
326
|
};
|
|
327
327
|
if (document.querySelector(".rp-print-zone")) {
|
|
@@ -333,17 +333,17 @@ const Po = () => {
|
|
|
333
333
|
});
|
|
334
334
|
w.observe(document.body, { childList: !0, subtree: !0 });
|
|
335
335
|
});
|
|
336
|
-
}, []), C = async (
|
|
336
|
+
}, []), C = async (f) => {
|
|
337
337
|
const g = document.createElement("img"), c = document.createElement("div");
|
|
338
338
|
return c.classList.add("rp-print-page"), await new Promise((b, w) => {
|
|
339
|
-
|
|
339
|
+
f.toBlob((P) => {
|
|
340
340
|
P ? (g.src = URL.createObjectURL(P), g.onload = () => {
|
|
341
341
|
URL.revokeObjectURL(g.src), b();
|
|
342
342
|
}, g.onerror = w) : w(new Error("Failed to create blob"));
|
|
343
343
|
});
|
|
344
344
|
}).catch(() => {
|
|
345
345
|
}), c.appendChild(g), c;
|
|
346
|
-
}, y = (
|
|
346
|
+
}, y = (f, g) => {
|
|
347
347
|
const c = document.createElement("div");
|
|
348
348
|
c.classList.add("rp-print-zone");
|
|
349
349
|
const b = document.createElement("style"), w = g.get(1);
|
|
@@ -351,45 +351,45 @@ const Po = () => {
|
|
|
351
351
|
const { width: P, height: E } = w == null ? void 0 : w.page.getViewport({ scale: 1 });
|
|
352
352
|
b.innerHTML = `@page { size: ${P}px ${E}px }`;
|
|
353
353
|
}
|
|
354
|
-
return c.appendChild(b), c.append(...
|
|
354
|
+
return c.appendChild(b), c.append(...f), c;
|
|
355
355
|
}, d = N(async () => {
|
|
356
356
|
if (!e)
|
|
357
357
|
return;
|
|
358
358
|
h();
|
|
359
|
-
const
|
|
359
|
+
const f = document.createElement("canvas"), g = [];
|
|
360
360
|
try {
|
|
361
361
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
362
362
|
const b = e.getOptionalContentConfig({ intent: "print" }), w = Promise.resolve(
|
|
363
363
|
e.annotationStorage.print ?? void 0
|
|
364
364
|
), P = t.size;
|
|
365
365
|
for (const [x, R] of t) {
|
|
366
|
-
if (
|
|
366
|
+
if (m.current) {
|
|
367
367
|
h();
|
|
368
368
|
return;
|
|
369
369
|
}
|
|
370
370
|
const D = R.page.getViewport({ scale: 1 });
|
|
371
371
|
if (await T({
|
|
372
|
-
scratchCanvas:
|
|
372
|
+
scratchCanvas: f,
|
|
373
373
|
pdfDocument: e,
|
|
374
374
|
pageNumber: x,
|
|
375
375
|
viewerPdfPage: D,
|
|
376
376
|
printResolution: 150,
|
|
377
377
|
optionalContentConfigPromise: b,
|
|
378
378
|
printAnnotationStoragePromise: w
|
|
379
|
-
}),
|
|
379
|
+
}), m.current) {
|
|
380
380
|
h();
|
|
381
381
|
return;
|
|
382
382
|
}
|
|
383
|
-
const
|
|
384
|
-
g.push(
|
|
385
|
-
const
|
|
383
|
+
const z = await C(f);
|
|
384
|
+
g.push(z);
|
|
385
|
+
const A = parseFloat((g.length / P * 100).toFixed(2));
|
|
386
386
|
o({
|
|
387
387
|
loadedPages: x,
|
|
388
388
|
totalPages: P,
|
|
389
|
-
percentage:
|
|
389
|
+
percentage: A
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
if (
|
|
392
|
+
if (m.current) {
|
|
393
393
|
h();
|
|
394
394
|
return;
|
|
395
395
|
}
|
|
@@ -398,15 +398,15 @@ const Po = () => {
|
|
|
398
398
|
} catch (c) {
|
|
399
399
|
s(!0), c instanceof Error && p(c);
|
|
400
400
|
} finally {
|
|
401
|
-
|
|
401
|
+
f.height = 0, f.width = 0;
|
|
402
402
|
}
|
|
403
|
-
}, [e, t,
|
|
403
|
+
}, [e, t, m]);
|
|
404
404
|
return k(() => {
|
|
405
|
-
const
|
|
405
|
+
const f = () => {
|
|
406
406
|
h(), v();
|
|
407
407
|
};
|
|
408
|
-
return window.addEventListener("afterprint",
|
|
409
|
-
window.removeEventListener("afterprint",
|
|
408
|
+
return window.addEventListener("afterprint", f, !0), () => {
|
|
409
|
+
window.removeEventListener("afterprint", f, !0);
|
|
410
410
|
};
|
|
411
411
|
}, [v, h]), {
|
|
412
412
|
print: d,
|
|
@@ -434,10 +434,10 @@ const Po = () => {
|
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
}), Ws = ({ children: e }) => {
|
|
437
|
-
const [t, n] = $(null), [o, r] = $(null), { print: a, cancel: l, progress: s, isComplete: u, isError: p, error:
|
|
437
|
+
const [t, n] = $(null), [o, r] = $(null), { print: a, cancel: l, progress: s, isComplete: u, isError: p, error: m } = Po(), v = N((C) => {
|
|
438
438
|
C && typeof C == "function" && r(() => C);
|
|
439
439
|
}, []), h = (C) => {
|
|
440
|
-
|
|
440
|
+
m && C(m);
|
|
441
441
|
}, _ = N(
|
|
442
442
|
(C) => {
|
|
443
443
|
n(() => C);
|
|
@@ -484,7 +484,7 @@ const Po = () => {
|
|
|
484
484
|
};
|
|
485
485
|
}), p = u.reduce((v, h) => (v[h.page.pageNumber] = h, v), {});
|
|
486
486
|
t(p);
|
|
487
|
-
const
|
|
487
|
+
const m = [];
|
|
488
488
|
for (const v of u) {
|
|
489
489
|
const h = document.createElement("canvas"), _ = vt(v.page, h, {
|
|
490
490
|
scale: v.scale,
|
|
@@ -497,9 +497,9 @@ const Po = () => {
|
|
|
497
497
|
loading: !1
|
|
498
498
|
};
|
|
499
499
|
});
|
|
500
|
-
|
|
500
|
+
m.push(_);
|
|
501
501
|
}
|
|
502
|
-
Promise.all(
|
|
502
|
+
Promise.all(m).then((v) => {
|
|
503
503
|
const h = v.reduce(
|
|
504
504
|
(_, T) => (_[T.page.pageNumber] = T, _),
|
|
505
505
|
{}
|
|
@@ -520,8 +520,8 @@ const Po = () => {
|
|
|
520
520
|
const u = n.get(s);
|
|
521
521
|
if (!u)
|
|
522
522
|
return;
|
|
523
|
-
t((
|
|
524
|
-
...
|
|
523
|
+
t((m) => ({
|
|
524
|
+
...m,
|
|
525
525
|
[s]: {
|
|
526
526
|
loading: !0,
|
|
527
527
|
page: u.page,
|
|
@@ -531,16 +531,16 @@ const Po = () => {
|
|
|
531
531
|
}));
|
|
532
532
|
const p = document.createElement("canvas");
|
|
533
533
|
vt(u.page, p, { scale: u.thumbnailScale, rotate: o }).promise.then(() => {
|
|
534
|
-
const
|
|
534
|
+
const m = p.toDataURL(), { thumbnailViewport: v, scale: h } = kt(u.page, o);
|
|
535
535
|
return {
|
|
536
536
|
scale: h,
|
|
537
|
-
thumbnailSrc:
|
|
537
|
+
thumbnailSrc: m,
|
|
538
538
|
page: u.page,
|
|
539
539
|
loading: !1,
|
|
540
540
|
viewport: v
|
|
541
541
|
};
|
|
542
|
-
}).then((
|
|
543
|
-
t((v) => ({ ...v, [s]:
|
|
542
|
+
}).then((m) => {
|
|
543
|
+
t((v) => ({ ...v, [s]: m }));
|
|
544
544
|
});
|
|
545
545
|
},
|
|
546
546
|
[n, o]
|
|
@@ -569,11 +569,11 @@ const Po = () => {
|
|
|
569
569
|
}
|
|
570
570
|
);
|
|
571
571
|
}, yo = (e = {}, t = "") => {
|
|
572
|
-
const [n, o] = $(t), [r, a] = $(!1), { pdf: l, pages: s } = J(), { widths: u, heights: p } = qe(),
|
|
572
|
+
const [n, o] = $(t), [r, a] = $(!1), { pdf: l, pages: s } = J(), { widths: u, heights: p } = qe(), m = H(!n), { currentZoom: v } = Qe(), [h, _] = $([]), { setFocusedPage: T } = ie(), { columnCount: S } = ze(), { rotate: C } = Ge(), [y, d] = $(0), { pageScrollElementRef: f, virtualScrollableElementRef: g } = et(), { scrollMode: c } = De(), { pagesRef: b } = ge(), [w, P] = $(null), E = H({}), x = W(() => y === 0 ? null : h[y - 1], [y, h]), R = W(() => h.length, [h]);
|
|
573
573
|
k(() => {
|
|
574
574
|
if (!x || !s)
|
|
575
575
|
return;
|
|
576
|
-
const L = g ||
|
|
576
|
+
const L = g || f;
|
|
577
577
|
if (!L || !b)
|
|
578
578
|
return;
|
|
579
579
|
const I = s.get(x.page);
|
|
@@ -581,8 +581,8 @@ const Po = () => {
|
|
|
581
581
|
return;
|
|
582
582
|
let O = 0, M = 0;
|
|
583
583
|
if (c === ee.VERTICAL_SCROLLING) {
|
|
584
|
-
const ae = x.page - 1, de = S, te = ae % de,
|
|
585
|
-
O = Oe(p,
|
|
584
|
+
const ae = x.page - 1, de = S, te = ae % de, Ae = Math.floor(ae / de);
|
|
585
|
+
O = Oe(p, Ae), M = Oe(u, te);
|
|
586
586
|
}
|
|
587
587
|
c === ee.HORIZONTAL_SCROLLING && (M = u.slice(0, x.page - 1).reduce((ae, de) => ae + de, 0));
|
|
588
588
|
const G = {
|
|
@@ -612,19 +612,19 @@ const Po = () => {
|
|
|
612
612
|
x,
|
|
613
613
|
c,
|
|
614
614
|
g,
|
|
615
|
-
|
|
615
|
+
f,
|
|
616
616
|
b
|
|
617
617
|
]);
|
|
618
618
|
const D = N(() => {
|
|
619
619
|
d((L) => R ? L + 1 > R ? 1 : L + 1 : 0);
|
|
620
|
-
}, [R]),
|
|
620
|
+
}, [R]), z = N(() => {
|
|
621
621
|
d((L) => R ? L - 1 <= 0 ? R : L - 1 : 0);
|
|
622
|
-
}, [R]),
|
|
622
|
+
}, [R]), A = N(async (L) => {
|
|
623
623
|
if (!L)
|
|
624
624
|
return {};
|
|
625
625
|
const I = L.numPages, O = {};
|
|
626
626
|
for (let M = 1; M <= I; M++) {
|
|
627
|
-
if (
|
|
627
|
+
if (m.current)
|
|
628
628
|
throw "close pop over";
|
|
629
629
|
const G = await L.getPage(M);
|
|
630
630
|
O[M.toString()] = await G.getTextContent();
|
|
@@ -633,10 +633,10 @@ const Po = () => {
|
|
|
633
633
|
}, []);
|
|
634
634
|
return k(() => {
|
|
635
635
|
if (!n) {
|
|
636
|
-
|
|
636
|
+
m.current = !0, _([]), d(0);
|
|
637
637
|
return;
|
|
638
638
|
}
|
|
639
|
-
|
|
639
|
+
m.current = !1, a(!0), _([]), d(0), A(l).then((L) => {
|
|
640
640
|
E.current = L;
|
|
641
641
|
const O = Object.keys(L).reduce((M, G) => {
|
|
642
642
|
const Z = cr(
|
|
@@ -651,7 +651,7 @@ const Po = () => {
|
|
|
651
651
|
}).catch(() => {
|
|
652
652
|
_([]), d(0);
|
|
653
653
|
}).finally(() => a(!1));
|
|
654
|
-
}, [n,
|
|
654
|
+
}, [n, A, l, e]), {
|
|
655
655
|
search: n,
|
|
656
656
|
setSearch: o,
|
|
657
657
|
loading: r,
|
|
@@ -660,7 +660,7 @@ const Po = () => {
|
|
|
660
660
|
currentMatchPosition: y,
|
|
661
661
|
currentMatch: x,
|
|
662
662
|
nextMatch: D,
|
|
663
|
-
prevMatch:
|
|
663
|
+
prevMatch: z,
|
|
664
664
|
currentMatchElement: w,
|
|
665
665
|
setCurrentMatchElement: P
|
|
666
666
|
};
|
|
@@ -693,7 +693,7 @@ const Po = () => {
|
|
|
693
693
|
currentMatchPosition: s,
|
|
694
694
|
currentMatch: u,
|
|
695
695
|
search: p,
|
|
696
|
-
matches:
|
|
696
|
+
matches: m,
|
|
697
697
|
nextMatch: v,
|
|
698
698
|
prevMatch: h,
|
|
699
699
|
currentMatchElement: _,
|
|
@@ -713,7 +713,7 @@ const Po = () => {
|
|
|
713
713
|
nextMatch: v,
|
|
714
714
|
prevMatch: h,
|
|
715
715
|
search: p,
|
|
716
|
-
matches:
|
|
716
|
+
matches: m,
|
|
717
717
|
currentMatchElement: _,
|
|
718
718
|
setCurrentMatchElement: T
|
|
719
719
|
},
|
|
@@ -740,23 +740,23 @@ const Po = () => {
|
|
|
740
740
|
return;
|
|
741
741
|
const p = a.get(t);
|
|
742
742
|
if (r.current && p) {
|
|
743
|
-
const
|
|
744
|
-
|
|
743
|
+
const m = r.current;
|
|
744
|
+
m.hidden = !0;
|
|
745
745
|
const v = s.current;
|
|
746
|
-
v && v.cancel(), o && o(), s.current = vt(p.page,
|
|
746
|
+
v && v.cancel(), o && o(), s.current = vt(p.page, m, {
|
|
747
747
|
scale: u,
|
|
748
748
|
rotate: l,
|
|
749
749
|
renderForms: !0
|
|
750
750
|
}), s.current.promise.then(() => {
|
|
751
|
-
|
|
751
|
+
m.hidden = !1;
|
|
752
752
|
}).catch(() => {
|
|
753
753
|
}).finally(() => {
|
|
754
754
|
n && n();
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
757
|
return () => {
|
|
758
|
-
var
|
|
759
|
-
(
|
|
758
|
+
var m;
|
|
759
|
+
(m = s.current) == null || m.cancel();
|
|
760
760
|
};
|
|
761
761
|
}, [a, t, l, u, o, n]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${t}-canvas`, ref: r });
|
|
762
762
|
}, Io = "_selecting_1x8te_9", Ro = "_endOfContent_1x8te_24", he = {
|
|
@@ -767,13 +767,13 @@ const Po = () => {
|
|
|
767
767
|
}, Lo = (e) => {
|
|
768
768
|
const { pageNumber: t } = e, { pages: n } = J(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement: l } = xt(), [s, u] = $(
|
|
769
769
|
[]
|
|
770
|
-
), p = H(),
|
|
771
|
-
(
|
|
772
|
-
if (c && lr(
|
|
770
|
+
), p = H(), m = H(), v = H(), h = W(() => r.filter((f) => f.pageIndex === t - 1), [r, t]), _ = N(
|
|
771
|
+
(f, g, c = !1) => {
|
|
772
|
+
if (c && lr(f, g), !h.length) {
|
|
773
773
|
v.current = void 0, u([]);
|
|
774
774
|
return;
|
|
775
775
|
}
|
|
776
|
-
const b = dr(h,
|
|
776
|
+
const b = dr(h, f, g);
|
|
777
777
|
u(b);
|
|
778
778
|
},
|
|
779
779
|
[h]
|
|
@@ -817,7 +817,7 @@ const Po = () => {
|
|
|
817
817
|
document.addEventListener(
|
|
818
818
|
"selectionchange",
|
|
819
819
|
() => {
|
|
820
|
-
var
|
|
820
|
+
var A, L;
|
|
821
821
|
const w = document.getSelection();
|
|
822
822
|
if (!w)
|
|
823
823
|
return;
|
|
@@ -843,10 +843,10 @@ const Po = () => {
|
|
|
843
843
|
const E = w.getRangeAt(0);
|
|
844
844
|
let R = b && (E.compareBoundaryPoints(Range.END_TO_END, b) === 0 || E.compareBoundaryPoints(Range.START_TO_END, b) === 0) ? E.startContainer : E.endContainer;
|
|
845
845
|
R.nodeType === Node.TEXT_NODE && (R = R.parentNode);
|
|
846
|
-
const D = (
|
|
846
|
+
const D = (A = R.parentElement) == null ? void 0 : A.closest(
|
|
847
847
|
he["rp-text-layer"]
|
|
848
|
-
),
|
|
849
|
-
|
|
848
|
+
), z = D == null ? void 0 : D.querySelector(".endOfContent");
|
|
849
|
+
z && D && (z.style.width = D.style.width, z.style.height = D.style.height, (L = R.parentElement) == null || L.insertBefore(z, R.nextSibling)), b = E.cloneRange();
|
|
850
850
|
},
|
|
851
851
|
{ signal: g }
|
|
852
852
|
);
|
|
@@ -863,32 +863,32 @@ const Po = () => {
|
|
|
863
863
|
var c;
|
|
864
864
|
if ((c = v.current) == null || c.classList.remove("selected"), !s.length || !a || a.pageIndex !== t - 1)
|
|
865
865
|
return;
|
|
866
|
-
const
|
|
866
|
+
const f = h.findIndex(
|
|
867
867
|
(b) => JSON.stringify(b) === JSON.stringify(a)
|
|
868
868
|
);
|
|
869
|
-
if (
|
|
869
|
+
if (f === -1)
|
|
870
870
|
return;
|
|
871
|
-
const g = s.find((b) => b.index ===
|
|
871
|
+
const g = s.find((b) => b.index === f);
|
|
872
872
|
g && (v.current = g.element, l(g.element), g.element.classList.add("selected"));
|
|
873
873
|
}, [a, s, h]), k(() => {
|
|
874
|
-
const
|
|
875
|
-
if (!
|
|
874
|
+
const f = n.get(t);
|
|
875
|
+
if (!f || !o.current)
|
|
876
876
|
return;
|
|
877
877
|
const g = o.current;
|
|
878
|
-
return p.current && p.current.cancel(),
|
|
879
|
-
const b =
|
|
878
|
+
return p.current && p.current.cancel(), f.page.getTextContent().then((c) => {
|
|
879
|
+
const b = f.page.getViewport({ scale: 1 });
|
|
880
880
|
return p.current = new Sr.TextLayer({
|
|
881
881
|
viewport: b,
|
|
882
882
|
textContentSource: c,
|
|
883
883
|
container: g
|
|
884
|
-
}),
|
|
884
|
+
}), m.current = c, g && (g.innerText = ""), p.current.render();
|
|
885
885
|
}).then(() => {
|
|
886
886
|
var P, E;
|
|
887
887
|
[].slice.call(g.children).forEach((x) => {
|
|
888
888
|
x.classList.add(he["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
889
889
|
});
|
|
890
890
|
const b = (P = p.current) == null ? void 0 : P.textDivs;
|
|
891
|
-
b &&
|
|
891
|
+
b && m.current && _(m.current, b);
|
|
892
892
|
const w = document.createElement("div");
|
|
893
893
|
w.className = "endOfContent", (E = o.current) == null || E.appendChild(w);
|
|
894
894
|
}).catch(() => {
|
|
@@ -902,7 +902,7 @@ const Po = () => {
|
|
|
902
902
|
b.classList.add(he["rp-text-layer-text"]);
|
|
903
903
|
});
|
|
904
904
|
const g = (c = p.current) == null ? void 0 : c.textDivs;
|
|
905
|
-
g &&
|
|
905
|
+
g && m.current && _(m.current, g, !0);
|
|
906
906
|
}, [_]), /* @__PURE__ */ i(
|
|
907
907
|
"div",
|
|
908
908
|
{
|
|
@@ -918,7 +918,7 @@ const Po = () => {
|
|
|
918
918
|
};
|
|
919
919
|
let No = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
920
920
|
const Oo = (e) => {
|
|
921
|
-
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = J(), a = H(), [l, s] = $(), { setFocusedPage: u, goToPage: p } = ie(), { scrollMode:
|
|
921
|
+
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = J(), a = H(), [l, s] = $(), { setFocusedPage: u, goToPage: p } = ie(), { scrollMode: m } = De(), { print: v } = tt(), { download: h } = Hn(), _ = W(() => o.get(t), [o, t]), T = W(() => _ == null ? void 0 : _.page.getViewport(), [_]);
|
|
922
922
|
k(() => {
|
|
923
923
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
924
924
|
}, [r]), k(() => {
|
|
@@ -929,11 +929,11 @@ const Oo = (e) => {
|
|
|
929
929
|
const S = N(
|
|
930
930
|
(C) => {
|
|
931
931
|
!l || !r || (Er(C), Nr(C, r, l).then((y) => {
|
|
932
|
-
var d,
|
|
933
|
-
((d = y == null ? void 0 : y.data) == null ? void 0 : d.action) === "Print" ? v() : ((
|
|
934
|
-
}),
|
|
932
|
+
var d, f;
|
|
933
|
+
((d = y == null ? void 0 : y.data) == null ? void 0 : d.action) === "Print" ? v() : ((f = y == null ? void 0 : y.data) == null ? void 0 : f.action) === "SaveAs" && h();
|
|
934
|
+
}), m === ee.PAGE_SCROLLING ? At(C, l, r, (y) => u(y.pageIndex + 1)) : At(C, l, r, (y) => p(y.pageIndex + 1)));
|
|
935
935
|
},
|
|
936
|
-
[r, l, p, u,
|
|
936
|
+
[r, l, p, u, m, v, h]
|
|
937
937
|
);
|
|
938
938
|
return k(() => {
|
|
939
939
|
if (!_ || !l)
|
|
@@ -949,10 +949,10 @@ const Oo = (e) => {
|
|
|
949
949
|
for (const g of l) {
|
|
950
950
|
const { annotationType: c } = g;
|
|
951
951
|
switch (c) {
|
|
952
|
-
case
|
|
952
|
+
case zt.Link:
|
|
953
953
|
Dr(g);
|
|
954
954
|
break;
|
|
955
|
-
case
|
|
955
|
+
case zt.Widget:
|
|
956
956
|
Or(g, C, y);
|
|
957
957
|
break;
|
|
958
958
|
}
|
|
@@ -987,7 +987,7 @@ const Oo = (e) => {
|
|
|
987
987
|
enableScripting: !1
|
|
988
988
|
});
|
|
989
989
|
})().then(() => {
|
|
990
|
-
n.current &&
|
|
990
|
+
n.current && zr(n.current, S);
|
|
991
991
|
}).catch((g) => {
|
|
992
992
|
if (g !== "abort")
|
|
993
993
|
throw g;
|
|
@@ -1005,30 +1005,30 @@ const Oo = (e) => {
|
|
|
1005
1005
|
);
|
|
1006
1006
|
}, Do = {
|
|
1007
1007
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1008
|
-
},
|
|
1009
|
-
const [n, o] = $(), { pages: r } = J(), { highlightKeywords: a } = pr(), l = !0, s = H(null), [u, p] = $(null), [
|
|
1008
|
+
}, zo = ({ pageNumber: e, viewport: t }) => {
|
|
1009
|
+
const [n, o] = $(), { pages: r } = J(), { highlightKeywords: a } = pr(), l = !0, s = H(null), [u, p] = $(null), [m, v] = $([]);
|
|
1010
1010
|
k(() => {
|
|
1011
1011
|
s.current && p(s.current.parentElement);
|
|
1012
1012
|
}, [s]), k(() => {
|
|
1013
1013
|
(async () => {
|
|
1014
|
-
const
|
|
1015
|
-
if (!
|
|
1014
|
+
const f = r.get(e);
|
|
1015
|
+
if (!f || !s.current)
|
|
1016
1016
|
return;
|
|
1017
|
-
const g = await
|
|
1017
|
+
const g = await f.page.getTextContent();
|
|
1018
1018
|
o(g);
|
|
1019
1019
|
})();
|
|
1020
1020
|
}, [r, e]);
|
|
1021
1021
|
const h = W(() => a ? a.map((d) => {
|
|
1022
|
-
var
|
|
1022
|
+
var f, g;
|
|
1023
1023
|
return {
|
|
1024
|
-
...
|
|
1024
|
+
...Ar(d.keyword, (f = d.options) == null ? void 0 : f.matchCase, (g = d.options) == null ? void 0 : g.wholeWords),
|
|
1025
1025
|
color: d.highlightColor
|
|
1026
1026
|
};
|
|
1027
1027
|
}) : [], [a]);
|
|
1028
|
-
function _(d,
|
|
1028
|
+
function _(d, f) {
|
|
1029
1029
|
if (!d)
|
|
1030
1030
|
return;
|
|
1031
|
-
const g = `[data-rp="page-${
|
|
1031
|
+
const g = `[data-rp="page-${f}-textLayer"]`;
|
|
1032
1032
|
return new Promise((c) => {
|
|
1033
1033
|
const b = d.querySelector(g);
|
|
1034
1034
|
if (b) {
|
|
@@ -1042,23 +1042,23 @@ const Oo = (e) => {
|
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
1044
|
function T(d) {
|
|
1045
|
-
return new Promise((
|
|
1045
|
+
return new Promise((f) => {
|
|
1046
1046
|
const g = d.querySelectorAll(
|
|
1047
1047
|
'[data-rp="rp-text-layer-text"]'
|
|
1048
1048
|
);
|
|
1049
1049
|
if (g.length) {
|
|
1050
|
-
|
|
1050
|
+
f(Array.from(g));
|
|
1051
1051
|
return;
|
|
1052
1052
|
}
|
|
1053
1053
|
new MutationObserver((b, w) => {
|
|
1054
1054
|
const P = d.querySelectorAll(
|
|
1055
1055
|
".vpv-text-layer-text"
|
|
1056
1056
|
);
|
|
1057
|
-
P.length && (
|
|
1057
|
+
P.length && (f(Array.from(P)), w.disconnect());
|
|
1058
1058
|
}).observe(d, { childList: !0, subtree: !0 });
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
1061
|
-
const S = (d,
|
|
1061
|
+
const S = (d, f, g, c) => {
|
|
1062
1062
|
var Z;
|
|
1063
1063
|
const b = document.createRange(), w = g.firstChild;
|
|
1064
1064
|
if (!w || w.nodeType !== Node.TEXT_NODE)
|
|
@@ -1069,18 +1069,18 @@ const Oo = (e) => {
|
|
|
1069
1069
|
b.setStart(w, E), b.setEnd(w, x + 1);
|
|
1070
1070
|
const R = document.createElement("span");
|
|
1071
1071
|
R.style.width = "auto", b.surroundContents(R);
|
|
1072
|
-
const D = R.getBoundingClientRect(),
|
|
1072
|
+
const D = R.getBoundingClientRect(), z = d.getBoundingClientRect(), A = z.height, L = z.width, I = 100 * (D.left - z.left) / L, O = 100 * (D.top - z.top) / A, M = 100 * D.height / A, G = 100 * D.width / L;
|
|
1073
1073
|
return kr(R), {
|
|
1074
|
-
keywordStr:
|
|
1074
|
+
keywordStr: f,
|
|
1075
1075
|
left: I,
|
|
1076
1076
|
top: O,
|
|
1077
1077
|
height: M,
|
|
1078
1078
|
width: G,
|
|
1079
|
-
pageHeight:
|
|
1079
|
+
pageHeight: A,
|
|
1080
1080
|
pageWidth: L
|
|
1081
1081
|
};
|
|
1082
1082
|
};
|
|
1083
|
-
async function C(d,
|
|
1083
|
+
async function C(d, f) {
|
|
1084
1084
|
const g = await _(u, d);
|
|
1085
1085
|
if (!g)
|
|
1086
1086
|
return;
|
|
@@ -1101,18 +1101,18 @@ const Oo = (e) => {
|
|
|
1101
1101
|
spanIdx: 0
|
|
1102
1102
|
}
|
|
1103
1103
|
]
|
|
1104
|
-
).slice(1), w = y(g,
|
|
1104
|
+
).slice(1), w = y(g, f, c, b);
|
|
1105
1105
|
v(w);
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
const y = (d,
|
|
1109
|
-
const b =
|
|
1108
|
+
const y = (d, f, g, c) => {
|
|
1109
|
+
const b = f.length;
|
|
1110
1110
|
if (!c.length || !b)
|
|
1111
1111
|
return [];
|
|
1112
1112
|
const w = [], P = c.map((E) => E.char).join("");
|
|
1113
1113
|
return h.forEach((E) => {
|
|
1114
|
-
const { keyword: x, regExp: R, wholeWords: D, color:
|
|
1115
|
-
if (!
|
|
1114
|
+
const { keyword: x, regExp: R, wholeWords: D, color: z } = E, A = x;
|
|
1115
|
+
if (!A.trim())
|
|
1116
1116
|
return;
|
|
1117
1117
|
const L = R.flags.indexOf("g") === -1 ? new RegExp(R, `${R.flags}g`) : R;
|
|
1118
1118
|
let I;
|
|
@@ -1126,7 +1126,7 @@ const Oo = (e) => {
|
|
|
1126
1126
|
const M = O.map((G) => ({
|
|
1127
1127
|
keyword: G.keyword,
|
|
1128
1128
|
indexes: c.slice(G.startIndex, G.endIndex),
|
|
1129
|
-
color:
|
|
1129
|
+
color: z
|
|
1130
1130
|
}));
|
|
1131
1131
|
for (const G of M) {
|
|
1132
1132
|
const Z = G.indexes.reduce(
|
|
@@ -1137,7 +1137,7 @@ const Oo = (e) => {
|
|
|
1137
1137
|
if (j.length !== 1 || j[0].char.trim() !== "") {
|
|
1138
1138
|
const U = j, Q = g[U[0].spanIdx], X = S(
|
|
1139
1139
|
d,
|
|
1140
|
-
|
|
1140
|
+
A,
|
|
1141
1141
|
Q,
|
|
1142
1142
|
U
|
|
1143
1143
|
);
|
|
@@ -1156,11 +1156,11 @@ const Oo = (e) => {
|
|
|
1156
1156
|
if (!(!a || a.length === 0))
|
|
1157
1157
|
try {
|
|
1158
1158
|
await C(e, a);
|
|
1159
|
-
} catch (
|
|
1160
|
-
console.error(
|
|
1159
|
+
} catch (f) {
|
|
1160
|
+
console.error(f);
|
|
1161
1161
|
}
|
|
1162
1162
|
})();
|
|
1163
|
-
}, [l, a, e, n, t]), /* @__PURE__ */ i(
|
|
1163
|
+
}, [l, a, e, n, t]), /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i("div", { ref: s, "data-rp": `page-${e}-textHighlightLayer`, children: m.map((d, f) => /* @__PURE__ */ i(
|
|
1164
1164
|
"div",
|
|
1165
1165
|
{
|
|
1166
1166
|
className: Do["rp-text-highlight"],
|
|
@@ -1172,10 +1172,10 @@ const Oo = (e) => {
|
|
|
1172
1172
|
backgroundColor: d.highlightColor
|
|
1173
1173
|
}
|
|
1174
1174
|
},
|
|
1175
|
-
|
|
1175
|
+
f
|
|
1176
1176
|
)) }) });
|
|
1177
1177
|
}, It = $e((e, t) => {
|
|
1178
|
-
const { pageNumber: n, style: o, ...r } = e, { pages: a } = J(), { rotate: l } = Ge(), { textLayer: s } = or(), { currentZoom: u } = Qe(), p = H(a.get(n)), [
|
|
1178
|
+
const { pageNumber: n, style: o, ...r } = e, { pages: a } = J(), { rotate: l } = Ge(), { textLayer: s } = or(), { currentZoom: u } = Qe(), p = H(a.get(n)), [m, v] = $(!1), h = H(null), [_, T] = $({
|
|
1179
1179
|
width: 0,
|
|
1180
1180
|
height: 0
|
|
1181
1181
|
});
|
|
@@ -1224,9 +1224,9 @@ const Oo = (e) => {
|
|
|
1224
1224
|
className: lt["rp-page"],
|
|
1225
1225
|
children: [
|
|
1226
1226
|
/* @__PURE__ */ i(xo, { onLoading: C, onLoaded: y, pageNumber: n }),
|
|
1227
|
-
|
|
1227
|
+
m && /* @__PURE__ */ i("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ i(Ct, {}) }),
|
|
1228
1228
|
s && /* @__PURE__ */ i(Lo, { pageNumber: n }),
|
|
1229
|
-
/* @__PURE__ */ i(
|
|
1229
|
+
/* @__PURE__ */ i(zo, { pageNumber: n, viewport: _ }),
|
|
1230
1230
|
/* @__PURE__ */ i(Oo, { pageNumber: n })
|
|
1231
1231
|
]
|
|
1232
1232
|
}
|
|
@@ -1244,7 +1244,7 @@ function wt(e, t) {
|
|
|
1244
1244
|
return n.__proto__ = o, n;
|
|
1245
1245
|
}, wt(e, t);
|
|
1246
1246
|
}
|
|
1247
|
-
function
|
|
1247
|
+
function Ao(e, t) {
|
|
1248
1248
|
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, wt(e, t);
|
|
1249
1249
|
}
|
|
1250
1250
|
var Vt = Number.isNaN || function(t) {
|
|
@@ -1327,9 +1327,9 @@ var $o = 150, Go = function(t) {
|
|
|
1327
1327
|
}, Be = null, Ze = null, je = null;
|
|
1328
1328
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Be = /* @__PURE__ */ new WeakSet(), Ze = /* @__PURE__ */ new WeakSet(), je = /* @__PURE__ */ new WeakSet());
|
|
1329
1329
|
function qo(e) {
|
|
1330
|
-
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, u = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment,
|
|
1330
|
+
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, u = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, m = e.getRowHeight, v = e.getRowOffset, h = e.getRowStartIndexForOffset, _ = e.getRowStopIndexForStartIndex, T = e.initInstanceProps, S = e.shouldResetStyleCacheOnItemSizeChange, C = e.validateProps;
|
|
1331
1331
|
return t = /* @__PURE__ */ function(y) {
|
|
1332
|
-
|
|
1332
|
+
Ao(d, y);
|
|
1333
1333
|
function d(g) {
|
|
1334
1334
|
var c;
|
|
1335
1335
|
return c = y.call(this, g) || this, c._instanceProps = T(c.props, qt(c)), c._resetIsScrollingTimeoutId = null, c._outerRef = void 0, c.state = {
|
|
@@ -1340,7 +1340,7 @@ function qo(e) {
|
|
|
1340
1340
|
scrollTop: typeof c.props.initialScrollTop == "number" ? c.props.initialScrollTop : 0,
|
|
1341
1341
|
scrollUpdateWasRequested: !1,
|
|
1342
1342
|
verticalScrollDirection: "forward"
|
|
1343
|
-
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = dt(function(b, w, P, E, x, R, D,
|
|
1343
|
+
}, c._callOnItemsRendered = void 0, c._callOnItemsRendered = dt(function(b, w, P, E, x, R, D, z) {
|
|
1344
1344
|
return c.props.onItemsRendered({
|
|
1345
1345
|
overscanColumnStartIndex: b,
|
|
1346
1346
|
overscanColumnStopIndex: w,
|
|
@@ -1349,7 +1349,7 @@ function qo(e) {
|
|
|
1349
1349
|
visibleColumnStartIndex: x,
|
|
1350
1350
|
visibleColumnStopIndex: R,
|
|
1351
1351
|
visibleRowStartIndex: D,
|
|
1352
|
-
visibleRowStopIndex:
|
|
1352
|
+
visibleRowStopIndex: z
|
|
1353
1353
|
});
|
|
1354
1354
|
}), c._callOnScroll = void 0, c._callOnScroll = dt(function(b, w, P, E, x) {
|
|
1355
1355
|
return c.props.onScroll({
|
|
@@ -1360,27 +1360,27 @@ function qo(e) {
|
|
|
1360
1360
|
scrollUpdateWasRequested: x
|
|
1361
1361
|
});
|
|
1362
1362
|
}), c._getItemStyle = void 0, c._getItemStyle = function(b, w) {
|
|
1363
|
-
var P = c.props, E = P.columnWidth, x = P.direction, R = P.rowHeight, D = c._getItemStyleCache(S && E, S && x, S && R),
|
|
1364
|
-
if (D.hasOwnProperty(
|
|
1365
|
-
|
|
1363
|
+
var P = c.props, E = P.columnWidth, x = P.direction, R = P.rowHeight, D = c._getItemStyleCache(S && E, S && x, S && R), z = b + ":" + w, A;
|
|
1364
|
+
if (D.hasOwnProperty(z))
|
|
1365
|
+
A = D[z];
|
|
1366
1366
|
else {
|
|
1367
1367
|
var L = n(c.props, w, c._instanceProps), I = x === "rtl";
|
|
1368
|
-
D[
|
|
1368
|
+
D[z] = A = {
|
|
1369
1369
|
position: "absolute",
|
|
1370
1370
|
left: I ? void 0 : L,
|
|
1371
1371
|
right: I ? L : void 0,
|
|
1372
1372
|
top: v(c.props, b, c._instanceProps),
|
|
1373
|
-
height:
|
|
1373
|
+
height: m(c.props, b, c._instanceProps),
|
|
1374
1374
|
width: a(c.props, w, c._instanceProps)
|
|
1375
1375
|
};
|
|
1376
1376
|
}
|
|
1377
|
-
return
|
|
1377
|
+
return A;
|
|
1378
1378
|
}, c._getItemStyleCache = void 0, c._getItemStyleCache = dt(function(b, w, P) {
|
|
1379
1379
|
return {};
|
|
1380
1380
|
}), c._onScroll = function(b) {
|
|
1381
|
-
var w = b.currentTarget, P = w.clientHeight, E = w.clientWidth, x = w.scrollLeft, R = w.scrollTop, D = w.scrollHeight,
|
|
1382
|
-
c.setState(function(
|
|
1383
|
-
if (
|
|
1381
|
+
var w = b.currentTarget, P = w.clientHeight, E = w.clientWidth, x = w.scrollLeft, R = w.scrollTop, D = w.scrollHeight, z = w.scrollWidth;
|
|
1382
|
+
c.setState(function(A) {
|
|
1383
|
+
if (A.scrollLeft === x && A.scrollTop === R)
|
|
1384
1384
|
return null;
|
|
1385
1385
|
var L = c.props.direction, I = x;
|
|
1386
1386
|
if (L === "rtl")
|
|
@@ -1389,17 +1389,17 @@ function qo(e) {
|
|
|
1389
1389
|
I = -x;
|
|
1390
1390
|
break;
|
|
1391
1391
|
case "positive-descending":
|
|
1392
|
-
I =
|
|
1392
|
+
I = z - E - x;
|
|
1393
1393
|
break;
|
|
1394
1394
|
}
|
|
1395
|
-
I = Math.max(0, Math.min(I,
|
|
1395
|
+
I = Math.max(0, Math.min(I, z - E));
|
|
1396
1396
|
var O = Math.max(0, Math.min(R, D - P));
|
|
1397
1397
|
return {
|
|
1398
1398
|
isScrolling: !0,
|
|
1399
|
-
horizontalScrollDirection:
|
|
1399
|
+
horizontalScrollDirection: A.scrollLeft < x ? "forward" : "backward",
|
|
1400
1400
|
scrollLeft: I,
|
|
1401
1401
|
scrollTop: O,
|
|
1402
|
-
verticalScrollDirection:
|
|
1402
|
+
verticalScrollDirection: A.scrollTop < R ? "forward" : "backward",
|
|
1403
1403
|
scrollUpdateWasRequested: !1
|
|
1404
1404
|
};
|
|
1405
1405
|
}, c._resetIsScrollingDebounced);
|
|
@@ -1419,8 +1419,8 @@ function qo(e) {
|
|
|
1419
1419
|
d.getDerivedStateFromProps = function(c, b) {
|
|
1420
1420
|
return Vo(c, b), C(c), null;
|
|
1421
1421
|
};
|
|
1422
|
-
var
|
|
1423
|
-
return
|
|
1422
|
+
var f = d.prototype;
|
|
1423
|
+
return f.scrollTo = function(c) {
|
|
1424
1424
|
var b = c.scrollLeft, w = c.scrollTop;
|
|
1425
1425
|
b !== void 0 && (b = Math.max(0, b)), w !== void 0 && (w = Math.max(0, w)), this.setState(function(P) {
|
|
1426
1426
|
return b === void 0 && (b = P.scrollLeft), w === void 0 && (w = P.scrollTop), P.scrollLeft === b && P.scrollTop === w ? null : {
|
|
@@ -1431,22 +1431,22 @@ function qo(e) {
|
|
|
1431
1431
|
verticalScrollDirection: P.scrollTop < w ? "forward" : "backward"
|
|
1432
1432
|
};
|
|
1433
1433
|
}, this._resetIsScrollingDebounced);
|
|
1434
|
-
},
|
|
1435
|
-
var b = c.align, w = b === void 0 ? "auto" : b, P = c.columnIndex, E = c.rowIndex, x = this.props, R = x.columnCount, D = x.height,
|
|
1436
|
-
P !== void 0 && (P = Math.max(0, Math.min(P, R - 1))), E !== void 0 && (E = Math.max(0, Math.min(E,
|
|
1437
|
-
var G = l(this.props, this._instanceProps), Z = s(this.props, this._instanceProps), j = Z >
|
|
1434
|
+
}, f.scrollToItem = function(c) {
|
|
1435
|
+
var b = c.align, w = b === void 0 ? "auto" : b, P = c.columnIndex, E = c.rowIndex, x = this.props, R = x.columnCount, D = x.height, z = x.rowCount, A = x.width, L = this.state, I = L.scrollLeft, O = L.scrollTop, M = Ho();
|
|
1436
|
+
P !== void 0 && (P = Math.max(0, Math.min(P, R - 1))), E !== void 0 && (E = Math.max(0, Math.min(E, z - 1)));
|
|
1437
|
+
var G = l(this.props, this._instanceProps), Z = s(this.props, this._instanceProps), j = Z > A ? M : 0, U = G > D ? M : 0;
|
|
1438
1438
|
this.scrollTo({
|
|
1439
1439
|
scrollLeft: P !== void 0 ? u(this.props, P, w, I, this._instanceProps, U) : I,
|
|
1440
1440
|
scrollTop: E !== void 0 ? p(this.props, E, w, O, this._instanceProps, j) : O
|
|
1441
1441
|
});
|
|
1442
|
-
},
|
|
1442
|
+
}, f.componentDidMount = function() {
|
|
1443
1443
|
var c = this.props, b = c.initialScrollLeft, w = c.initialScrollTop;
|
|
1444
1444
|
if (this._outerRef != null) {
|
|
1445
1445
|
var P = this._outerRef;
|
|
1446
1446
|
typeof b == "number" && (P.scrollLeft = b), typeof w == "number" && (P.scrollTop = w);
|
|
1447
1447
|
}
|
|
1448
1448
|
this._callPropsCallbacks();
|
|
1449
|
-
},
|
|
1449
|
+
}, f.componentDidUpdate = function() {
|
|
1450
1450
|
var c = this.props.direction, b = this.state, w = b.scrollLeft, P = b.scrollTop, E = b.scrollUpdateWasRequested;
|
|
1451
1451
|
if (E && this._outerRef != null) {
|
|
1452
1452
|
var x = this._outerRef;
|
|
@@ -1468,20 +1468,20 @@ function qo(e) {
|
|
|
1468
1468
|
x.scrollTop = Math.max(0, P);
|
|
1469
1469
|
}
|
|
1470
1470
|
this._callPropsCallbacks();
|
|
1471
|
-
},
|
|
1471
|
+
}, f.componentWillUnmount = function() {
|
|
1472
1472
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1473
|
-
},
|
|
1474
|
-
var c = this.props, b = c.children, w = c.className, P = c.columnCount, E = c.direction, x = c.height, R = c.innerRef, D = c.innerElementType,
|
|
1473
|
+
}, f.render = function() {
|
|
1474
|
+
var c = this.props, b = c.children, w = c.className, P = c.columnCount, E = c.direction, x = c.height, R = c.innerRef, D = c.innerElementType, z = c.innerTagName, A = c.itemData, L = c.itemKey, I = L === void 0 ? Go : L, O = c.outerElementType, M = c.outerTagName, G = c.rowCount, Z = c.style, j = c.useIsScrolling, U = c.width, Q = this.state.isScrolling, X = this._getHorizontalRangeToRender(), le = X[0], ae = X[1], de = this._getVerticalRangeToRender(), te = de[0], Ae = de[1], Re = [];
|
|
1475
1475
|
if (P > 0 && G)
|
|
1476
|
-
for (var Te = te; Te <=
|
|
1476
|
+
for (var Te = te; Te <= Ae; Te++)
|
|
1477
1477
|
for (var we = le; we <= ae; we++)
|
|
1478
1478
|
Re.push(Ue(b, {
|
|
1479
1479
|
columnIndex: we,
|
|
1480
|
-
data:
|
|
1480
|
+
data: A,
|
|
1481
1481
|
isScrolling: j ? Q : void 0,
|
|
1482
1482
|
key: I({
|
|
1483
1483
|
columnIndex: we,
|
|
1484
|
-
data:
|
|
1484
|
+
data: A,
|
|
1485
1485
|
rowIndex: Te
|
|
1486
1486
|
}),
|
|
1487
1487
|
rowIndex: Te,
|
|
@@ -1501,7 +1501,7 @@ function qo(e) {
|
|
|
1501
1501
|
willChange: "transform",
|
|
1502
1502
|
direction: E
|
|
1503
1503
|
}, Z)
|
|
1504
|
-
}, Ue(D ||
|
|
1504
|
+
}, Ue(D || z || "div", {
|
|
1505
1505
|
children: Re,
|
|
1506
1506
|
ref: R,
|
|
1507
1507
|
style: {
|
|
@@ -1510,27 +1510,27 @@ function qo(e) {
|
|
|
1510
1510
|
width: rt
|
|
1511
1511
|
}
|
|
1512
1512
|
}));
|
|
1513
|
-
},
|
|
1513
|
+
}, f._callPropsCallbacks = function() {
|
|
1514
1514
|
var c = this.props, b = c.columnCount, w = c.onItemsRendered, P = c.onScroll, E = c.rowCount;
|
|
1515
1515
|
if (typeof w == "function" && b > 0 && E > 0) {
|
|
1516
|
-
var x = this._getHorizontalRangeToRender(), R = x[0], D = x[1],
|
|
1517
|
-
this._callOnItemsRendered(R, D, I, O,
|
|
1516
|
+
var x = this._getHorizontalRangeToRender(), R = x[0], D = x[1], z = x[2], A = x[3], L = this._getVerticalRangeToRender(), I = L[0], O = L[1], M = L[2], G = L[3];
|
|
1517
|
+
this._callOnItemsRendered(R, D, I, O, z, A, M, G);
|
|
1518
1518
|
}
|
|
1519
1519
|
if (typeof P == "function") {
|
|
1520
1520
|
var Z = this.state, j = Z.horizontalScrollDirection, U = Z.scrollLeft, Q = Z.scrollTop, X = Z.scrollUpdateWasRequested, le = Z.verticalScrollDirection;
|
|
1521
1521
|
this._callOnScroll(U, Q, j, le, X);
|
|
1522
1522
|
}
|
|
1523
|
-
},
|
|
1524
|
-
var c = this.props, b = c.columnCount, w = c.overscanColumnCount, P = c.overscanColumnsCount, E = c.overscanCount, x = c.rowCount, R = this.state, D = R.horizontalScrollDirection,
|
|
1523
|
+
}, f._getHorizontalRangeToRender = function() {
|
|
1524
|
+
var c = this.props, b = c.columnCount, w = c.overscanColumnCount, P = c.overscanColumnsCount, E = c.overscanCount, x = c.rowCount, R = this.state, D = R.horizontalScrollDirection, z = R.isScrolling, A = R.scrollLeft, L = w || P || E || 1;
|
|
1525
1525
|
if (b === 0 || x === 0)
|
|
1526
1526
|
return [0, 0, 0, 0];
|
|
1527
|
-
var I = o(this.props,
|
|
1527
|
+
var I = o(this.props, A, this._instanceProps), O = r(this.props, I, A, this._instanceProps), M = !z || D === "backward" ? Math.max(1, L) : 1, G = !z || D === "forward" ? Math.max(1, L) : 1;
|
|
1528
1528
|
return [Math.max(0, I - M), Math.max(0, Math.min(b - 1, O + G)), I, O];
|
|
1529
|
-
},
|
|
1530
|
-
var c = this.props, b = c.columnCount, w = c.overscanCount, P = c.overscanRowCount, E = c.overscanRowsCount, x = c.rowCount, R = this.state, D = R.isScrolling,
|
|
1529
|
+
}, f._getVerticalRangeToRender = function() {
|
|
1530
|
+
var c = this.props, b = c.columnCount, w = c.overscanCount, P = c.overscanRowCount, E = c.overscanRowsCount, x = c.rowCount, R = this.state, D = R.isScrolling, z = R.verticalScrollDirection, A = R.scrollTop, L = P || E || w || 1;
|
|
1531
1531
|
if (b === 0 || x === 0)
|
|
1532
1532
|
return [0, 0, 0, 0];
|
|
1533
|
-
var I = h(this.props,
|
|
1533
|
+
var I = h(this.props, A, this._instanceProps), O = _(this.props, I, A, this._instanceProps), M = !D || z === "backward" ? Math.max(1, L) : 1, G = !D || z === "forward" ? Math.max(1, L) : 1;
|
|
1534
1534
|
return [Math.max(0, I - M), Math.max(0, Math.min(x - 1, O + G)), I, O];
|
|
1535
1535
|
}, d;
|
|
1536
1536
|
}(Jn), t.defaultProps = {
|
|
@@ -1540,9 +1540,9 @@ function qo(e) {
|
|
|
1540
1540
|
}, t;
|
|
1541
1541
|
}
|
|
1542
1542
|
var Vo = function(t, n) {
|
|
1543
|
-
var o = t.children, r = t.direction, a = t.height, l = t.innerTagName, s = t.outerTagName, u = t.overscanColumnsCount, p = t.overscanCount,
|
|
1543
|
+
var o = t.children, r = t.direction, a = t.height, l = t.innerTagName, s = t.outerTagName, u = t.overscanColumnsCount, p = t.overscanCount, m = t.overscanRowsCount, v = t.width, h = n.instance;
|
|
1544
1544
|
if (process.env.NODE_ENV !== "production") {
|
|
1545
|
-
if (typeof p == "number" && Be && !Be.has(h) && (Be.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof u == "number" || typeof
|
|
1545
|
+
if (typeof p == "number" && Be && !Be.has(h) && (Be.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof u == "number" || typeof m == "number") && Ze && !Ze.has(h) && (Ze.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || s != null) && je && !je.has(h) && (je.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1546
1546
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1547
1547
|
switch (r) {
|
|
1548
1548
|
case "ltr":
|
|
@@ -1562,17 +1562,17 @@ var Vo = function(t, n) {
|
|
|
1562
1562
|
var u = r[l];
|
|
1563
1563
|
s = u.offset + u.size;
|
|
1564
1564
|
}
|
|
1565
|
-
var p = o - l - 1,
|
|
1566
|
-
return s +
|
|
1565
|
+
var p = o - l - 1, m = p * a;
|
|
1566
|
+
return s + m;
|
|
1567
1567
|
}, Sn = function(t, n) {
|
|
1568
1568
|
var o = t.columnCount, r = n.columnMetadataMap, a = n.estimatedColumnWidth, l = n.lastMeasuredColumnIndex, s = 0;
|
|
1569
1569
|
if (l >= o && (l = o - 1), l >= 0) {
|
|
1570
1570
|
var u = r[l];
|
|
1571
1571
|
s = u.offset + u.size;
|
|
1572
1572
|
}
|
|
1573
|
-
var p = o - l - 1,
|
|
1574
|
-
return s +
|
|
1575
|
-
},
|
|
1573
|
+
var p = o - l - 1, m = p * a;
|
|
1574
|
+
return s + m;
|
|
1575
|
+
}, me = function(t, n, o, r) {
|
|
1576
1576
|
var a, l, s;
|
|
1577
1577
|
if (t === "column" ? (a = r.columnMetadataMap, l = n.columnWidth, s = r.lastMeasuredColumnIndex) : (a = r.rowMetadataMap, l = n.rowHeight, s = r.lastMeasuredRowIndex), o > s) {
|
|
1578
1578
|
var u = 0;
|
|
@@ -1580,9 +1580,9 @@ var Vo = function(t, n) {
|
|
|
1580
1580
|
var p = a[s];
|
|
1581
1581
|
u = p.offset + p.size;
|
|
1582
1582
|
}
|
|
1583
|
-
for (var
|
|
1584
|
-
var v = l(
|
|
1585
|
-
a[
|
|
1583
|
+
for (var m = s + 1; m <= o; m++) {
|
|
1584
|
+
var v = l(m);
|
|
1585
|
+
a[m] = {
|
|
1586
1586
|
offset: u,
|
|
1587
1587
|
size: v
|
|
1588
1588
|
}, u += v;
|
|
@@ -1597,18 +1597,18 @@ var Vo = function(t, n) {
|
|
|
1597
1597
|
return s >= r ? yn(t, n, o, l, 0, r) : Uo(t, n, o, Math.max(0, l), r);
|
|
1598
1598
|
}, yn = function(t, n, o, r, a, l) {
|
|
1599
1599
|
for (; a <= r; ) {
|
|
1600
|
-
var s = a + Math.floor((r - a) / 2), u =
|
|
1600
|
+
var s = a + Math.floor((r - a) / 2), u = me(t, n, s, o).offset;
|
|
1601
1601
|
if (u === l)
|
|
1602
1602
|
return s;
|
|
1603
1603
|
u < l ? a = s + 1 : u > l && (r = s - 1);
|
|
1604
1604
|
}
|
|
1605
1605
|
return a > 0 ? a - 1 : 0;
|
|
1606
1606
|
}, Uo = function(t, n, o, r, a) {
|
|
1607
|
-
for (var l = t === "column" ? n.columnCount : n.rowCount, s = 1; r < l &&
|
|
1607
|
+
for (var l = t === "column" ? n.columnCount : n.rowCount, s = 1; r < l && me(t, n, r, o).offset < a; )
|
|
1608
1608
|
r += s, s *= 2;
|
|
1609
1609
|
return yn(t, n, o, Math.min(r, l - 1), Math.floor(r / 2), a);
|
|
1610
1610
|
}, Yt = function(t, n, o, r, a, l, s) {
|
|
1611
|
-
var u = t === "column" ? n.width : n.height, p =
|
|
1611
|
+
var u = t === "column" ? n.width : n.height, p = me(t, n, o, l), m = t === "column" ? Sn(n, l) : Pn(n, l), v = Math.max(0, Math.min(m - u, p.offset)), h = Math.max(0, p.offset - u + s + p.size);
|
|
1612
1612
|
switch (r === "smart" && (a >= h - u && a <= v + u ? r = "auto" : r = "center"), r) {
|
|
1613
1613
|
case "start":
|
|
1614
1614
|
return v;
|
|
@@ -1622,15 +1622,15 @@ var Vo = function(t, n) {
|
|
|
1622
1622
|
}
|
|
1623
1623
|
}, Bo = /* @__PURE__ */ qo({
|
|
1624
1624
|
getColumnOffset: function(t, n, o) {
|
|
1625
|
-
return
|
|
1625
|
+
return me("column", t, n, o).offset;
|
|
1626
1626
|
},
|
|
1627
1627
|
getColumnStartIndexForOffset: function(t, n, o) {
|
|
1628
1628
|
return Xt("column", t, o, n);
|
|
1629
1629
|
},
|
|
1630
1630
|
getColumnStopIndexForStartIndex: function(t, n, o, r) {
|
|
1631
|
-
for (var a = t.columnCount, l = t.width, s =
|
|
1632
|
-
|
|
1633
|
-
return
|
|
1631
|
+
for (var a = t.columnCount, l = t.width, s = me("column", t, n, r), u = o + l, p = s.offset + s.size, m = n; m < a - 1 && p < u; )
|
|
1632
|
+
m++, p += me("column", t, m, r).size;
|
|
1633
|
+
return m;
|
|
1634
1634
|
},
|
|
1635
1635
|
getColumnWidth: function(t, n, o) {
|
|
1636
1636
|
return o.columnMetadataMap[n].size;
|
|
@@ -1644,7 +1644,7 @@ var Vo = function(t, n) {
|
|
|
1644
1644
|
return Yt("row", t, n, o, r, a, l);
|
|
1645
1645
|
},
|
|
1646
1646
|
getRowOffset: function(t, n, o) {
|
|
1647
|
-
return
|
|
1647
|
+
return me("row", t, n, o).offset;
|
|
1648
1648
|
},
|
|
1649
1649
|
getRowHeight: function(t, n, o) {
|
|
1650
1650
|
return o.rowMetadataMap[n].size;
|
|
@@ -1653,9 +1653,9 @@ var Vo = function(t, n) {
|
|
|
1653
1653
|
return Xt("row", t, o, n);
|
|
1654
1654
|
},
|
|
1655
1655
|
getRowStopIndexForStartIndex: function(t, n, o, r) {
|
|
1656
|
-
for (var a = t.rowCount, l = t.height, s =
|
|
1657
|
-
|
|
1658
|
-
return
|
|
1656
|
+
for (var a = t.rowCount, l = t.height, s = me("row", t, n, r), u = o + l, p = s.offset + s.size, m = n; m < a - 1 && p < u; )
|
|
1657
|
+
m++, p += me("row", t, m, r).size;
|
|
1658
|
+
return m;
|
|
1659
1659
|
},
|
|
1660
1660
|
initInstanceProps: function(t, n) {
|
|
1661
1661
|
var o = t, r = o.estimatedColumnWidth, a = o.estimatedRowHeight, l = {
|
|
@@ -1677,7 +1677,7 @@ var Vo = function(t, n) {
|
|
|
1677
1677
|
shouldForceUpdate: u
|
|
1678
1678
|
});
|
|
1679
1679
|
}, n.resetAfterIndices = function(s) {
|
|
1680
|
-
var u = s.columnIndex, p = s.rowIndex,
|
|
1680
|
+
var u = s.columnIndex, p = s.rowIndex, m = s.shouldForceUpdate, v = m === void 0 ? !0 : m;
|
|
1681
1681
|
typeof u == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, u - 1)), typeof p == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, p - 1)), n._getItemStyleCache(-1), v && n.forceUpdate();
|
|
1682
1682
|
}, l;
|
|
1683
1683
|
},
|
|
@@ -1708,7 +1708,7 @@ function Ko(e, t) {
|
|
|
1708
1708
|
return !Jt(n, r) && !Jt(o, a);
|
|
1709
1709
|
}
|
|
1710
1710
|
const Xo = () => {
|
|
1711
|
-
const { viewMode: e } =
|
|
1711
|
+
const { viewMode: e } = ze(), { scrollMode: t } = De(), { setColumnCount: n } = dn(), { virtualScrollableElementRef: o } = et(), r = qe(), a = N(
|
|
1712
1712
|
(_) => r.widths[_] || 0,
|
|
1713
1713
|
[r.widths]
|
|
1714
1714
|
), l = N(
|
|
@@ -1718,9 +1718,9 @@ const Xo = () => {
|
|
|
1718
1718
|
k(() => {
|
|
1719
1719
|
n(p);
|
|
1720
1720
|
}, [p, n]);
|
|
1721
|
-
const
|
|
1721
|
+
const m = W(() => t === ee.HORIZONTAL_SCROLLING || t === ee.PAGE_SCROLLING ? 1 : Math.round(s / p), [p, s, t]), v = W(() => r.heights.reduce((_, T) => _ + T, 0) / r.heights.length || 0, [r]), h = W(() => r.widths.reduce((_, T) => _ + T, 0) / r.heights.length || 0, [r]);
|
|
1722
1722
|
return {
|
|
1723
|
-
rowCount:
|
|
1723
|
+
rowCount: m,
|
|
1724
1724
|
rowHeight: l,
|
|
1725
1725
|
columnCount: p,
|
|
1726
1726
|
columnWidth: a,
|
|
@@ -1750,8 +1750,8 @@ function Yo(e) {
|
|
|
1750
1750
|
const u = typeof document < "u" && document.attachEvent;
|
|
1751
1751
|
if (!u) {
|
|
1752
1752
|
l = function(y) {
|
|
1753
|
-
const d = y.__resizeTriggers__,
|
|
1754
|
-
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, c.style.width =
|
|
1753
|
+
const d = y.__resizeTriggers__, f = d.firstElementChild, g = d.lastElementChild, c = f.firstElementChild;
|
|
1754
|
+
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, c.style.width = f.offsetWidth + 1 + "px", c.style.height = f.offsetHeight + 1 + "px", f.scrollLeft = f.scrollWidth, f.scrollTop = f.scrollHeight;
|
|
1755
1755
|
}, a = function(y) {
|
|
1756
1756
|
return y.offsetWidth !== y.__resizeLast__.width || y.offsetHeight !== y.__resizeLast__.height;
|
|
1757
1757
|
}, s = function(y) {
|
|
@@ -1797,8 +1797,8 @@ function Yo(e) {
|
|
|
1797
1797
|
const C = T.createElement("div");
|
|
1798
1798
|
C.className = "expand-trigger", C.appendChild(T.createElement("div"));
|
|
1799
1799
|
const y = T.createElement("div");
|
|
1800
|
-
y.className = "contract-trigger", h.__resizeTriggers__.appendChild(C), h.__resizeTriggers__.appendChild(y), h.appendChild(h.__resizeTriggers__), l(h), h.addEventListener("scroll", s, !0), o && (h.__resizeTriggers__.__animationListener__ = function(
|
|
1801
|
-
|
|
1800
|
+
y.className = "contract-trigger", h.__resizeTriggers__.appendChild(C), h.__resizeTriggers__.appendChild(y), h.appendChild(h.__resizeTriggers__), l(h), h.addEventListener("scroll", s, !0), o && (h.__resizeTriggers__.__animationListener__ = function(f) {
|
|
1801
|
+
f.animationName === n && l(h);
|
|
1802
1802
|
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1803
1803
|
}
|
|
1804
1804
|
h.__resizeListeners__.push(_);
|
|
@@ -1832,7 +1832,7 @@ class Jo extends Qn {
|
|
|
1832
1832
|
onResize: r
|
|
1833
1833
|
} = this.props;
|
|
1834
1834
|
if (this._parentNode) {
|
|
1835
|
-
const a = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(a.paddingLeft || "0"), s = parseFloat(a.paddingRight || "0"), u = parseFloat(a.paddingTop || "0"), p = parseFloat(a.paddingBottom || "0"),
|
|
1835
|
+
const a = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(a.paddingLeft || "0"), s = parseFloat(a.paddingRight || "0"), u = parseFloat(a.paddingTop || "0"), p = parseFloat(a.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), v = m.height - u - p, h = m.width - l - s, _ = this._parentNode.offsetHeight - u - p, T = this._parentNode.offsetWidth - l - s;
|
|
1836
1836
|
(!n && (this.state.height !== _ || this.state.scaledHeight !== v) || !o && (this.state.width !== T || this.state.scaledWidth !== h)) && (this.setState({
|
|
1837
1837
|
height: _,
|
|
1838
1838
|
width: T,
|
|
@@ -1875,7 +1875,7 @@ class Jo extends Qn {
|
|
|
1875
1875
|
nonce: s,
|
|
1876
1876
|
onResize: u,
|
|
1877
1877
|
style: p = {},
|
|
1878
|
-
tagName:
|
|
1878
|
+
tagName: m = "div",
|
|
1879
1879
|
...v
|
|
1880
1880
|
} = this.props, {
|
|
1881
1881
|
height: h,
|
|
@@ -1886,7 +1886,7 @@ class Jo extends Qn {
|
|
|
1886
1886
|
overflow: "visible"
|
|
1887
1887
|
}, y = {};
|
|
1888
1888
|
let d = !1;
|
|
1889
|
-
return r || (h === 0 && (d = !0), C.height = 0, y.height = h, y.scaledHeight = _), a || (S === 0 && (d = !0), C.width = 0, y.width = S, y.scaledWidth = T), l && (d = !1), Ue(
|
|
1889
|
+
return r || (h === 0 && (d = !0), C.height = 0, y.height = h, y.scaledHeight = _), a || (S === 0 && (d = !0), C.width = 0, y.width = S, y.scaledWidth = T), l && (d = !1), Ue(m, {
|
|
1890
1890
|
ref: this._setRef,
|
|
1891
1891
|
style: {
|
|
1892
1892
|
...C,
|
|
@@ -1937,25 +1937,25 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
1937
1937
|
}
|
|
1938
1938
|
);
|
|
1939
1939
|
}, ti = (e, t, n) => {
|
|
1940
|
-
const o = H(), { contentRef: r } = ge(), { heights: a, widths: l } = qe(), { setFocusedPage: s } = ie(), [u, p] = $([]), { targetScrollPage:
|
|
1941
|
-
const C = l[S], y = Vr(S + 1, e), d = C * y.columnIndex,
|
|
1940
|
+
const o = H(), { contentRef: r } = ge(), { heights: a, widths: l } = qe(), { setFocusedPage: s } = ie(), [u, p] = $([]), { targetScrollPage: m } = un(), v = Tt(u, 0, 500), h = W(() => a.map((T, S) => {
|
|
1941
|
+
const C = l[S], y = Vr(S + 1, e), d = C * y.columnIndex, f = T * y.rowIndex, g = d + C, c = f + T;
|
|
1942
1942
|
return {
|
|
1943
1943
|
pageNumber: S + 1,
|
|
1944
1944
|
...y,
|
|
1945
1945
|
width: C,
|
|
1946
1946
|
height: T,
|
|
1947
1947
|
startX: d,
|
|
1948
|
-
startY:
|
|
1948
|
+
startY: f,
|
|
1949
1949
|
endX: g,
|
|
1950
1950
|
endY: c
|
|
1951
1951
|
};
|
|
1952
1952
|
}), [a, l, e, t]);
|
|
1953
1953
|
k(() => {
|
|
1954
1954
|
var S;
|
|
1955
|
-
v.length > 0 && !
|
|
1955
|
+
v.length > 0 && !m.current && s(v[0].pageNumber);
|
|
1956
1956
|
let T = (S = v[0]) == null ? void 0 : S.ratio;
|
|
1957
|
-
T && v.filter((C) => Math.round(C.ratio) === Math.round(T)).some((C) => C.pageNumber ===
|
|
1958
|
-
|
|
1957
|
+
T && v.filter((C) => Math.round(C.ratio) === Math.round(T)).some((C) => C.pageNumber === m.current) && setTimeout(() => {
|
|
1958
|
+
m.current = void 0;
|
|
1959
1959
|
}, 500);
|
|
1960
1960
|
}, [v, s]);
|
|
1961
1961
|
const _ = N(
|
|
@@ -1967,15 +1967,15 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
1967
1967
|
endTop: S.scrollTop + S.clientHeight,
|
|
1968
1968
|
endLeft: S.scrollLeft + S.clientWidth
|
|
1969
1969
|
}, y = h.filter((d) => {
|
|
1970
|
-
const
|
|
1971
|
-
return
|
|
1970
|
+
const f = d.endX >= C.startLeft && d.endY >= C.startTop, g = d.startX <= C.endLeft && d.startY <= C.endTop;
|
|
1971
|
+
return f && g;
|
|
1972
1972
|
}).map((d) => {
|
|
1973
|
-
const
|
|
1973
|
+
const f = C.startLeft > d.startX ? C.startLeft : d.startX, g = C.startTop > d.startY ? C.startTop : d.startY, c = C.endLeft < d.endX ? C.endLeft : d.endX, b = C.endTop < d.endY ? C.endTop : d.endY, w = c - f, P = b - g, x = +(w * P / (d.width * d.height) * 100).toFixed(2);
|
|
1974
1974
|
return {
|
|
1975
1975
|
pageNumber: d.pageNumber,
|
|
1976
1976
|
ratio: x
|
|
1977
1977
|
};
|
|
1978
|
-
}).sort((d,
|
|
1978
|
+
}).sort((d, f) => f.ratio - d.ratio);
|
|
1979
1979
|
p(y);
|
|
1980
1980
|
});
|
|
1981
1981
|
},
|
|
@@ -1996,17 +1996,17 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
1996
1996
|
getVirtualScrollRef: s,
|
|
1997
1997
|
getPageScrollElementRef: u,
|
|
1998
1998
|
getVirtualScrollableElementRef: p,
|
|
1999
|
-
setTotalInnerDimensions:
|
|
1999
|
+
setTotalInnerDimensions: m,
|
|
2000
2000
|
virtualScrollableElementRef: v,
|
|
2001
2001
|
totalInnerDimensions: h,
|
|
2002
2002
|
pageScrollElementRef: _
|
|
2003
|
-
} = et(), T = H(!0), { nextPage: S, prevPage: C, setFocusedPage: y, focusedPage: d } = ie(), { scrollMode:
|
|
2003
|
+
} = et(), T = H(!0), { nextPage: S, prevPage: C, setFocusedPage: y, focusedPage: d } = ie(), { scrollMode: f } = De(), { viewMode: g } = ze(), c = H(null), { loading: b } = J(), { passwordRequired: w } = nr(), { LoaderImageComponent: P } = pn(), E = H(
|
|
2004
2004
|
h
|
|
2005
2005
|
), x = H({
|
|
2006
2006
|
viewMode: g,
|
|
2007
|
-
scrollMode:
|
|
2008
|
-
}), R = H(!1), D = H(), { isFullScreen:
|
|
2009
|
-
pageDimension:
|
|
2007
|
+
scrollMode: f
|
|
2008
|
+
}), R = H(!1), D = H(), { isFullScreen: z } = sr(), {
|
|
2009
|
+
pageDimension: A,
|
|
2010
2010
|
rowCount: L,
|
|
2011
2011
|
rowHeight: I,
|
|
2012
2012
|
columnCount: O,
|
|
@@ -2022,14 +2022,14 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2022
2022
|
Gr(o);
|
|
2023
2023
|
const { isPressed: X } = Hr(), { selectionMode: le } = ir(), { initializeGrabScroll: ae, resetGrabState: de } = $r({
|
|
2024
2024
|
isPressed: X
|
|
2025
|
-
}), te = W(() => le === tr.HAND, [le]),
|
|
2025
|
+
}), te = W(() => le === tr.HAND, [le]), Ae = W(() => ({
|
|
2026
2026
|
columnCount: O
|
|
2027
2027
|
}), [O]), Re = N(
|
|
2028
2028
|
(q) => {
|
|
2029
2029
|
const V = document.activeElement !== o;
|
|
2030
|
-
!
|
|
2030
|
+
!z && V || (["ArrowUp", "ArrowLeft"].includes(q.key) ? (q.preventDefault(), C()) : ["ArrowDown", "ArrowRight"].includes(q.key) && (q.preventDefault(), S()));
|
|
2031
2031
|
},
|
|
2032
|
-
[S, C,
|
|
2032
|
+
[S, C, z, f]
|
|
2033
2033
|
);
|
|
2034
2034
|
k(() => (window.addEventListener("keydown", Re), () => {
|
|
2035
2035
|
window.removeEventListener("keydown", Re);
|
|
@@ -2042,7 +2042,7 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2042
2042
|
rowIndex: q,
|
|
2043
2043
|
shouldForceUpdate: !0
|
|
2044
2044
|
});
|
|
2045
|
-
}, [L, O,
|
|
2045
|
+
}, [L, O, A, l]);
|
|
2046
2046
|
const Te = N(
|
|
2047
2047
|
(q, V) => {
|
|
2048
2048
|
if (!v)
|
|
@@ -2056,10 +2056,10 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2056
2056
|
[v]
|
|
2057
2057
|
), we = N(
|
|
2058
2058
|
(q, V) => {
|
|
2059
|
-
if (x.current.viewMode !== g || x.current.scrollMode !==
|
|
2059
|
+
if (x.current.viewMode !== g || x.current.scrollMode !== f) {
|
|
2060
2060
|
U.current && clearTimeout(U.current), R.current = !0, a(d, "auto"), U.current = setTimeout(() => {
|
|
2061
2061
|
requestAnimationFrame(() => {
|
|
2062
|
-
x.current = { viewMode: g, scrollMode:
|
|
2062
|
+
x.current = { viewMode: g, scrollMode: f };
|
|
2063
2063
|
});
|
|
2064
2064
|
}, 100);
|
|
2065
2065
|
return;
|
|
@@ -2084,7 +2084,7 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2084
2084
|
width: V.width
|
|
2085
2085
|
};
|
|
2086
2086
|
},
|
|
2087
|
-
[l, g,
|
|
2087
|
+
[l, g, f, a]
|
|
2088
2088
|
);
|
|
2089
2089
|
k(() => {
|
|
2090
2090
|
clearTimeout(D.current);
|
|
@@ -2095,11 +2095,11 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2095
2095
|
(Se, ot, ye) => Se + M(ye),
|
|
2096
2096
|
0
|
|
2097
2097
|
), Pe = Te(V, q);
|
|
2098
|
-
Q.current = Pe, we(Pe, { height: q, width: V }),
|
|
2098
|
+
Q.current = Pe, we(Pe, { height: q, width: V }), m({
|
|
2099
2099
|
height: q,
|
|
2100
2100
|
width: V
|
|
2101
2101
|
});
|
|
2102
|
-
}, [
|
|
2102
|
+
}, [A, L, O, we]);
|
|
2103
2103
|
const nt = N(
|
|
2104
2104
|
(q) => {
|
|
2105
2105
|
Q.current = {
|
|
@@ -2140,8 +2140,8 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2140
2140
|
_,
|
|
2141
2141
|
y,
|
|
2142
2142
|
j
|
|
2143
|
-
]), /* @__PURE__ */ F(
|
|
2144
|
-
/* @__PURE__ */ i("div", { id: n, ref: r, tabIndex: -1, className: rt, children: /* @__PURE__ */ i(Jo, { style: { minHeight: "50px" }, children: ({ width: q, height: V }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: Zn, style: { width: q, height: V }, children:
|
|
2143
|
+
]), /* @__PURE__ */ F(fe, { children: [
|
|
2144
|
+
/* @__PURE__ */ i("div", { id: n, ref: r, tabIndex: -1, className: rt, children: /* @__PURE__ */ i(Jo, { style: { minHeight: "50px" }, children: ({ width: q, height: V }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: Zn, style: { width: q, height: V }, children: f === ee.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
2145
2145
|
"div",
|
|
2146
2146
|
{
|
|
2147
2147
|
ref: u,
|
|
@@ -2153,7 +2153,7 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2153
2153
|
Bo,
|
|
2154
2154
|
{
|
|
2155
2155
|
ref: s,
|
|
2156
|
-
itemData:
|
|
2156
|
+
itemData: Ae,
|
|
2157
2157
|
outerRef: p,
|
|
2158
2158
|
innerRef: c,
|
|
2159
2159
|
onScroll: nt,
|
|
@@ -2167,7 +2167,7 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2167
2167
|
rowCount: L,
|
|
2168
2168
|
className: ne(
|
|
2169
2169
|
ue["rp-pages"],
|
|
2170
|
-
|
|
2170
|
+
f === ee.HORIZONTAL_SCROLLING ? ue["rp-pages-horizontal-scroll"] : ""
|
|
2171
2171
|
),
|
|
2172
2172
|
children: ni
|
|
2173
2173
|
}
|
|
@@ -2193,7 +2193,7 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2193
2193
|
"rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
|
|
2194
2194
|
"rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
|
|
2195
2195
|
"rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
|
|
2196
|
-
},
|
|
2196
|
+
}, mt = {
|
|
2197
2197
|
"rp-paginate": "_rp-paginate_1y9vo_1",
|
|
2198
2198
|
"rp-page-input": "_rp-page-input_1y9vo_6",
|
|
2199
2199
|
"rp-total-page": "_rp-total-page_1y9vo_11"
|
|
@@ -2204,7 +2204,7 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2204
2204
|
const { nextIcon: e } = pe();
|
|
2205
2205
|
return e || /* @__PURE__ */ i(Me, { style: { transform: "rotate(180deg" } });
|
|
2206
2206
|
}, ii = () => {
|
|
2207
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [l, s] = $(e.toString()), { pageNavigationTool: u = !0 } = ve(), { isSmallScreen: p } = Ce(), { localeMessages:
|
|
2207
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [l, s] = $(e.toString()), { pageNavigationTool: u = !0 } = ve(), { isSmallScreen: p } = Ce(), { localeMessages: m } = se();
|
|
2208
2208
|
k(() => {
|
|
2209
2209
|
s(e.toString());
|
|
2210
2210
|
}, [e]);
|
|
@@ -2232,35 +2232,35 @@ const Qo = ({ widths: e, heights: t }) => {
|
|
|
2232
2232
|
goToPage: a,
|
|
2233
2233
|
changePage: n
|
|
2234
2234
|
}
|
|
2235
|
-
) : u ? /* @__PURE__ */ F("div", { className:
|
|
2236
|
-
!p && /* @__PURE__ */ i(K, { content:
|
|
2235
|
+
) : u ? /* @__PURE__ */ F("div", { className: mt["rp-paginate"], children: [
|
|
2236
|
+
!p && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.previousPageTooltip, children: /* @__PURE__ */ i(
|
|
2237
2237
|
re,
|
|
2238
2238
|
{
|
|
2239
2239
|
onClick: r,
|
|
2240
|
-
"aria-label":
|
|
2240
|
+
"aria-label": m == null ? void 0 : m.previousPageTooltip,
|
|
2241
2241
|
"aria-disabled": e === 1,
|
|
2242
2242
|
children: /* @__PURE__ */ i(ri, {})
|
|
2243
2243
|
}
|
|
2244
2244
|
) }),
|
|
2245
|
-
/* @__PURE__ */ i(K, { content:
|
|
2245
|
+
/* @__PURE__ */ i(K, { content: m == null ? void 0 : m.currentPageTooltip, children: /* @__PURE__ */ i(
|
|
2246
2246
|
ln,
|
|
2247
2247
|
{
|
|
2248
2248
|
onKeyDown: T,
|
|
2249
2249
|
onBlur: _,
|
|
2250
2250
|
onChange: v,
|
|
2251
2251
|
value: l,
|
|
2252
|
-
className:
|
|
2252
|
+
className: mt["rp-page-input"]
|
|
2253
2253
|
}
|
|
2254
2254
|
) }),
|
|
2255
|
-
/* @__PURE__ */ F("span", { className:
|
|
2255
|
+
/* @__PURE__ */ F("span", { className: mt["rp-total-page"], children: [
|
|
2256
2256
|
"/",
|
|
2257
2257
|
t
|
|
2258
2258
|
] }),
|
|
2259
|
-
!p && /* @__PURE__ */ i(K, { content:
|
|
2259
|
+
!p && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.nextPageTooltip, children: /* @__PURE__ */ i(
|
|
2260
2260
|
re,
|
|
2261
2261
|
{
|
|
2262
2262
|
onClick: o,
|
|
2263
|
-
"aria-label":
|
|
2263
|
+
"aria-label": m == null ? void 0 : m.nextPageTooltip,
|
|
2264
2264
|
"aria-disabled": e === t,
|
|
2265
2265
|
children: /* @__PURE__ */ i(oi, {})
|
|
2266
2266
|
}
|
|
@@ -2275,7 +2275,7 @@ var Rt = "Dialog", [xn, Gs] = Xr(Rt), [ai, ce] = xn(Rt), In = (e) => {
|
|
|
2275
2275
|
defaultOpen: r,
|
|
2276
2276
|
onOpenChange: a,
|
|
2277
2277
|
modal: l = !0
|
|
2278
|
-
} = e, s = B.useRef(null), u = B.useRef(null), [p = !1,
|
|
2278
|
+
} = e, s = B.useRef(null), u = B.useRef(null), [p = !1, m] = Qr({
|
|
2279
2279
|
prop: o,
|
|
2280
2280
|
defaultProp: r,
|
|
2281
2281
|
onChange: a
|
|
@@ -2290,8 +2290,8 @@ var Rt = "Dialog", [xn, Gs] = Xr(Rt), [ai, ce] = xn(Rt), In = (e) => {
|
|
|
2290
2290
|
titleId: ct(),
|
|
2291
2291
|
descriptionId: ct(),
|
|
2292
2292
|
open: p,
|
|
2293
|
-
onOpenChange:
|
|
2294
|
-
onOpenToggle: B.useCallback(() =>
|
|
2293
|
+
onOpenChange: m,
|
|
2294
|
+
onOpenToggle: B.useCallback(() => m((v) => !v), [m]),
|
|
2295
2295
|
modal: l,
|
|
2296
2296
|
children: n
|
|
2297
2297
|
}
|
|
@@ -2410,7 +2410,7 @@ var di = B.forwardRef(
|
|
|
2410
2410
|
), Dn = B.forwardRef(
|
|
2411
2411
|
(e, t) => {
|
|
2412
2412
|
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...l } = e, s = ce(Ie, n), u = B.useRef(null), p = Pt(t, u);
|
|
2413
|
-
return no(), /* @__PURE__ */ F(
|
|
2413
|
+
return no(), /* @__PURE__ */ F(fe, { children: [
|
|
2414
2414
|
/* @__PURE__ */ i(
|
|
2415
2415
|
ro,
|
|
2416
2416
|
{
|
|
@@ -2434,26 +2434,26 @@ var di = B.forwardRef(
|
|
|
2434
2434
|
)
|
|
2435
2435
|
}
|
|
2436
2436
|
),
|
|
2437
|
-
/* @__PURE__ */ F(
|
|
2437
|
+
/* @__PURE__ */ F(fe, { children: [
|
|
2438
2438
|
/* @__PURE__ */ i(hi, { titleId: s.titleId }),
|
|
2439
|
-
/* @__PURE__ */ i(
|
|
2439
|
+
/* @__PURE__ */ i(fi, { contentRef: u, descriptionId: s.descriptionId })
|
|
2440
2440
|
] })
|
|
2441
2441
|
] });
|
|
2442
2442
|
}
|
|
2443
|
-
), Et = "DialogTitle",
|
|
2443
|
+
), Et = "DialogTitle", zn = B.forwardRef(
|
|
2444
2444
|
(e, t) => {
|
|
2445
2445
|
const { __scopeDialog: n, ...o } = e, r = ce(Et, n);
|
|
2446
2446
|
return /* @__PURE__ */ i(Ve.h2, { id: r.titleId, ...o, ref: t });
|
|
2447
2447
|
}
|
|
2448
2448
|
);
|
|
2449
|
-
|
|
2450
|
-
var
|
|
2449
|
+
zn.displayName = Et;
|
|
2450
|
+
var An = "DialogDescription", pi = B.forwardRef(
|
|
2451
2451
|
(e, t) => {
|
|
2452
|
-
const { __scopeDialog: n, ...o } = e, r = ce(
|
|
2452
|
+
const { __scopeDialog: n, ...o } = e, r = ce(An, n);
|
|
2453
2453
|
return /* @__PURE__ */ i(Ve.p, { id: r.descriptionId, ...o, ref: t });
|
|
2454
2454
|
}
|
|
2455
2455
|
);
|
|
2456
|
-
pi.displayName =
|
|
2456
|
+
pi.displayName = An;
|
|
2457
2457
|
var Fn = "DialogClose", kn = B.forwardRef(
|
|
2458
2458
|
(e, t) => {
|
|
2459
2459
|
const { __scopeDialog: n, ...o } = e, r = ce(Fn, n);
|
|
@@ -2485,14 +2485,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2485
2485
|
return B.useEffect(() => {
|
|
2486
2486
|
e && (document.getElementById(e) || console.error(n));
|
|
2487
2487
|
}, [n, e]), null;
|
|
2488
|
-
},
|
|
2489
|
-
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mn(
|
|
2488
|
+
}, mi = "DialogDescriptionWarning", fi = ({ contentRef: e, descriptionId: t }) => {
|
|
2489
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mn(mi).contentName}}.`;
|
|
2490
2490
|
return B.useEffect(() => {
|
|
2491
2491
|
var a;
|
|
2492
2492
|
const r = (a = e.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
2493
2493
|
t && r && (document.getElementById(t) || console.warn(o));
|
|
2494
2494
|
}, [o, e, t]), null;
|
|
2495
|
-
}, gi = In, vi = En, wi = Nn, _i = On, bi =
|
|
2495
|
+
}, gi = In, vi = En, wi = Nn, _i = On, bi = zn, Ci = kn;
|
|
2496
2496
|
const xe = {
|
|
2497
2497
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2498
2498
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2510,7 +2510,7 @@ const xe = {
|
|
|
2510
2510
|
filename: s,
|
|
2511
2511
|
title: u,
|
|
2512
2512
|
author: p,
|
|
2513
|
-
subject:
|
|
2513
|
+
subject: m,
|
|
2514
2514
|
createdOn: v,
|
|
2515
2515
|
creator: h,
|
|
2516
2516
|
keywords: _,
|
|
@@ -2525,7 +2525,7 @@ const xe = {
|
|
|
2525
2525
|
{ separate: !0 },
|
|
2526
2526
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: u },
|
|
2527
2527
|
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: p },
|
|
2528
|
-
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value:
|
|
2528
|
+
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2529
2529
|
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: _ },
|
|
2530
2530
|
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2531
2531
|
{
|
|
@@ -2568,7 +2568,7 @@ const xe = {
|
|
|
2568
2568
|
}, [e, t]) };
|
|
2569
2569
|
}, $n = () => {
|
|
2570
2570
|
const { downloadIcon: e } = pe();
|
|
2571
|
-
return e || /* @__PURE__ */ i(
|
|
2571
|
+
return e || /* @__PURE__ */ i(mo, {});
|
|
2572
2572
|
}, Gn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ i(K, { className: t, content: n == null ? void 0 : n.downloadFileTooltip, children: e }), xi = ({ download: e, localeMessages: t }) => /* @__PURE__ */ i(Gn, { localeMessages: t, children: /* @__PURE__ */ i(re, { onClick: e, "aria-label": t == null ? void 0 : t.downloadFileTooltip, children: /* @__PURE__ */ i($n, {}) }) }), Ii = ({ download: e, localeMessages: t }) => /* @__PURE__ */ i(be, { onClick: e, children: /* @__PURE__ */ F(Gn, { className: "rp-menu-item", localeMessages: t, children: [
|
|
2573
2573
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i($n, {}) }),
|
|
2574
2574
|
t == null ? void 0 : t.downloadFileLabel
|
|
@@ -2577,7 +2577,7 @@ const xe = {
|
|
|
2577
2577
|
return t ? n ? /* @__PURE__ */ i(Ii, { download: e, localeMessages: o }) : typeof t == "function" ? /* @__PURE__ */ i(t, { download: e }) : t ? /* @__PURE__ */ i(xi, { download: e, localeMessages: o }) : null : null;
|
|
2578
2578
|
}, Vn = () => {
|
|
2579
2579
|
const { printIcon: e } = pe();
|
|
2580
|
-
return e || /* @__PURE__ */ i(
|
|
2580
|
+
return e || /* @__PURE__ */ i(fo, {});
|
|
2581
2581
|
}, Un = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ i(K, { className: t, content: n == null ? void 0 : n.printTooltip, children: e }), Ri = ({ print: e, localeMessages: t }) => /* @__PURE__ */ i(Un, { localeMessages: t, children: /* @__PURE__ */ i(re, { onClick: e, "aria-label": t == null ? void 0 : t.printTooltip, children: /* @__PURE__ */ i(Vn, {}) }) }), Li = ({ print: e, localeMessages: t }) => /* @__PURE__ */ i(be, { onClick: e, children: /* @__PURE__ */ F(Un, { className: "rp-menu-item", localeMessages: t, children: [
|
|
2582
2582
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Vn, {}) }),
|
|
2583
2583
|
t == null ? void 0 : t.printLabel
|
|
@@ -2619,7 +2619,7 @@ const xe = {
|
|
|
2619
2619
|
] }) }) }),
|
|
2620
2620
|
/* @__PURE__ */ i(yt, {})
|
|
2621
2621
|
] }) : null;
|
|
2622
|
-
},
|
|
2622
|
+
}, zi = () => {
|
|
2623
2623
|
const { container: e } = ge(), { isSmallScreen: t } = Ce(), {
|
|
2624
2624
|
openFileTool: n,
|
|
2625
2625
|
downloadTool: o,
|
|
@@ -2629,12 +2629,12 @@ const xe = {
|
|
|
2629
2629
|
selectionModeTool: s,
|
|
2630
2630
|
jumpNavigationTool: u,
|
|
2631
2631
|
printTool: p,
|
|
2632
|
-
fullscreenTool:
|
|
2632
|
+
fullscreenTool: m
|
|
2633
2633
|
} = ve(), { localeMessages: v } = se();
|
|
2634
2634
|
return W(() => {
|
|
2635
2635
|
const _ = u || l || s || a || r;
|
|
2636
2636
|
let T = !1;
|
|
2637
|
-
return t && (T = !(!n && !o && !p && !
|
|
2637
|
+
return t && (T = !(!n && !o && !p && !m)), _ || T;
|
|
2638
2638
|
}, [
|
|
2639
2639
|
n,
|
|
2640
2640
|
o,
|
|
@@ -2646,7 +2646,7 @@ const xe = {
|
|
|
2646
2646
|
t
|
|
2647
2647
|
]) ? /* @__PURE__ */ F(lo, { children: [
|
|
2648
2648
|
/* @__PURE__ */ i(
|
|
2649
|
-
|
|
2649
|
+
mn,
|
|
2650
2650
|
{
|
|
2651
2651
|
container: e,
|
|
2652
2652
|
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: v == null ? void 0 : v.moreOptionTooltip, children: /* @__PURE__ */ i(re, { "aria-label": v == null ? void 0 : v.moreOptionTooltip, children: /* @__PURE__ */ i(Kr, {}) }) }) }),
|
|
@@ -2655,7 +2655,7 @@ const xe = {
|
|
|
2655
2655
|
/* @__PURE__ */ i(hn, {}),
|
|
2656
2656
|
/* @__PURE__ */ i(qn, {}),
|
|
2657
2657
|
/* @__PURE__ */ i(Bn, {}),
|
|
2658
|
-
/* @__PURE__ */ i(
|
|
2658
|
+
/* @__PURE__ */ i(fn, {}),
|
|
2659
2659
|
/* @__PURE__ */ i(yt, {})
|
|
2660
2660
|
] }),
|
|
2661
2661
|
/* @__PURE__ */ i(Di, {}),
|
|
@@ -2668,17 +2668,17 @@ const xe = {
|
|
|
2668
2668
|
),
|
|
2669
2669
|
/* @__PURE__ */ i(Ti, {})
|
|
2670
2670
|
] }) : null;
|
|
2671
|
-
},
|
|
2671
|
+
}, Ai = () => {
|
|
2672
2672
|
const { isSmallScreen: e } = Ce();
|
|
2673
|
-
return /* @__PURE__ */ F(
|
|
2673
|
+
return /* @__PURE__ */ F(fe, { children: [
|
|
2674
2674
|
/* @__PURE__ */ i(jr, {}),
|
|
2675
|
-
!e && /* @__PURE__ */ F(
|
|
2675
|
+
!e && /* @__PURE__ */ F(fe, { children: [
|
|
2676
2676
|
/* @__PURE__ */ i(hn, {}),
|
|
2677
2677
|
/* @__PURE__ */ i(qn, {}),
|
|
2678
2678
|
/* @__PURE__ */ i(Bn, {}),
|
|
2679
|
-
/* @__PURE__ */ i(
|
|
2679
|
+
/* @__PURE__ */ i(fn, {})
|
|
2680
2680
|
] }),
|
|
2681
|
-
/* @__PURE__ */ i(
|
|
2681
|
+
/* @__PURE__ */ i(zi, {})
|
|
2682
2682
|
] });
|
|
2683
2683
|
}, Ee = {
|
|
2684
2684
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_cocqs_1",
|
|
@@ -2686,35 +2686,35 @@ const xe = {
|
|
|
2686
2686
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_cocqs_11",
|
|
2687
2687
|
"rp-current-zoom-text": "_rp-current-zoom-text_cocqs_16",
|
|
2688
2688
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_cocqs_20"
|
|
2689
|
-
}, Fi = 25,
|
|
2689
|
+
}, Fi = 25, ft = 1e3, ki = [50, 75, 100, 125, 150, 200, 300, 400], Wi = () => {
|
|
2690
2690
|
const { zoomInIcon: e } = pe();
|
|
2691
2691
|
return e || /* @__PURE__ */ i(vo, {});
|
|
2692
2692
|
}, Mi = () => {
|
|
2693
2693
|
const { zoomOutIcon: e } = pe();
|
|
2694
2694
|
return e || /* @__PURE__ */ i(wo, {});
|
|
2695
2695
|
}, Hi = () => {
|
|
2696
|
-
const { zoomLevel: e, setZoomLevel: t } = Qe(), { container: n, contentRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate: l } = Ge(), { pages: s } = J(), { isSmallScreen: u } = Ce(), { localeMessages: p } = se(), { viewMode:
|
|
2696
|
+
const { zoomLevel: e, setZoomLevel: t } = Qe(), { container: n, contentRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate: l } = Ge(), { pages: s } = J(), { isSmallScreen: u } = Ce(), { localeMessages: p } = se(), { viewMode: m } = ze(), v = N(() => {
|
|
2697
2697
|
t((d) => {
|
|
2698
|
-
const
|
|
2699
|
-
return Math.min(
|
|
2698
|
+
const f = Math.floor(d / 25) * 25;
|
|
2699
|
+
return Math.min(f + 25, ft);
|
|
2700
2700
|
});
|
|
2701
2701
|
}, [t]), h = N(() => {
|
|
2702
2702
|
t((d) => {
|
|
2703
|
-
const
|
|
2704
|
-
return Math.min(
|
|
2703
|
+
const f = Math.ceil(d / 25) * 25;
|
|
2704
|
+
return Math.min(f - 25, ft);
|
|
2705
2705
|
});
|
|
2706
|
-
}, [t]), _ = W(() => e === Fi, [e]), T = W(() => e ===
|
|
2706
|
+
}, [t]), _ = W(() => e === Fi, [e]), T = W(() => e === ft, [e]), S = W(() => {
|
|
2707
2707
|
var d;
|
|
2708
2708
|
return (d = s.get(a)) == null ? void 0 : d.page.getViewport({ scale: 1, rotation: l });
|
|
2709
2709
|
}, [s, a, l]), C = N(
|
|
2710
2710
|
(d) => {
|
|
2711
|
-
const
|
|
2711
|
+
const f = ((S == null ? void 0 : S.width) || 0) + 2 * Mt, g = ((S == null ? void 0 : S.height) || 0) + 2 * Mt, c = (o == null ? void 0 : o.clientWidth) || 0, b = (o == null ? void 0 : o.clientHeight) || 0, w = _o(
|
|
2712
2712
|
d,
|
|
2713
2713
|
c,
|
|
2714
2714
|
b,
|
|
2715
|
-
|
|
2715
|
+
f,
|
|
2716
2716
|
g,
|
|
2717
|
-
|
|
2717
|
+
m
|
|
2718
2718
|
);
|
|
2719
2719
|
t(w);
|
|
2720
2720
|
},
|
|
@@ -2736,7 +2736,7 @@ const xe = {
|
|
|
2736
2736
|
}
|
|
2737
2737
|
) }),
|
|
2738
2738
|
!u && /* @__PURE__ */ i(
|
|
2739
|
-
|
|
2739
|
+
mn,
|
|
2740
2740
|
{
|
|
2741
2741
|
container: n,
|
|
2742
2742
|
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomSelectTooltip, children: /* @__PURE__ */ F(
|
|
@@ -2783,7 +2783,7 @@ const xe = {
|
|
|
2783
2783
|
nextMatch: t,
|
|
2784
2784
|
prevMatch: n
|
|
2785
2785
|
} = xt(), { localeMessages: o } = se();
|
|
2786
|
-
return /* @__PURE__ */ F(
|
|
2786
|
+
return /* @__PURE__ */ F(fe, { children: [
|
|
2787
2787
|
/* @__PURE__ */ i(K, { content: o == null ? void 0 : o.searchPrevTooltip, className: Y["rp-search-tool-result-navigator"], children: /* @__PURE__ */ i(re, { onClick: n, "aria-label": o == null ? void 0 : o.searchPrevTooltip, children: /* @__PURE__ */ i(
|
|
2788
2788
|
Me,
|
|
2789
2789
|
{
|
|
@@ -2809,12 +2809,12 @@ const xe = {
|
|
|
2809
2809
|
setSearchOptions: s,
|
|
2810
2810
|
loading: u,
|
|
2811
2811
|
setSearch: p,
|
|
2812
|
-
totalMatches:
|
|
2812
|
+
totalMatches: m,
|
|
2813
2813
|
currentMatchPosition: v,
|
|
2814
2814
|
nextMatch: h,
|
|
2815
2815
|
prevMatch: _,
|
|
2816
2816
|
search: T
|
|
2817
|
-
} = xt(), { searchTool: S = !0 } = ve(), [C, y] = $(T), { localeMessages: d } = se(), { isSmallScreen:
|
|
2817
|
+
} = xt(), { searchTool: S = !0 } = ve(), [C, y] = $(T), { localeMessages: d } = se(), { isSmallScreen: f } = Ce(), g = N(() => {
|
|
2818
2818
|
n(!0);
|
|
2819
2819
|
}, []), c = N(() => {
|
|
2820
2820
|
p(""), y(""), n(!1);
|
|
@@ -2841,7 +2841,7 @@ const xe = {
|
|
|
2841
2841
|
y(I.target.value);
|
|
2842
2842
|
}, []), x = N(() => {
|
|
2843
2843
|
y(""), p("");
|
|
2844
|
-
}, [p]), R = W(() => `${v} / ${
|
|
2844
|
+
}, [p]), R = W(() => `${v} / ${m}`, [v, m]), { wholeWords: D, matchCase: z } = W(() => l, [l]), A = N(
|
|
2845
2845
|
(I) => {
|
|
2846
2846
|
s((O) => ({ ...O, matchCase: I }));
|
|
2847
2847
|
},
|
|
@@ -2854,7 +2854,7 @@ const xe = {
|
|
|
2854
2854
|
);
|
|
2855
2855
|
return k(() => {
|
|
2856
2856
|
c();
|
|
2857
|
-
}, [o, c]), S ? /* @__PURE__ */ i(
|
|
2857
|
+
}, [o, c]), S ? /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(
|
|
2858
2858
|
Mr,
|
|
2859
2859
|
{
|
|
2860
2860
|
open: t,
|
|
@@ -2877,17 +2877,17 @@ const xe = {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
) }),
|
|
2879
2879
|
u ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(Ct, { className: Y["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: R }),
|
|
2880
|
-
|
|
2880
|
+
f && /* @__PURE__ */ i("div", { className: Y["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ht, { onKeyPress: b, handleClose: c }) })
|
|
2881
2881
|
] }),
|
|
2882
2882
|
/* @__PURE__ */ F("div", { className: Y["rp-search-tool-input-checkboxes"], children: [
|
|
2883
|
-
|
|
2884
|
-
/* @__PURE__ */ i($t, { name: "matchCase", value:
|
|
2885
|
-
!
|
|
2883
|
+
f && /* @__PURE__ */ i(on, {}),
|
|
2884
|
+
/* @__PURE__ */ i($t, { name: "matchCase", value: z, onChange: A, children: d == null ? void 0 : d.searchMatchCaseLabel }),
|
|
2885
|
+
!f && /* @__PURE__ */ i(K, { content: d == null ? void 0 : d.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: Y["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Gt, {}) }) }),
|
|
2886
2886
|
/* @__PURE__ */ i($t, { name: "wholeWord", value: D, onChange: L, children: d == null ? void 0 : d.searchWholeWordsLabel }),
|
|
2887
|
-
!
|
|
2887
|
+
!f && /* @__PURE__ */ i(K, { content: d == null ? void 0 : d.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { className: Y["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Gt, {}) }) })
|
|
2888
2888
|
] })
|
|
2889
2889
|
] }),
|
|
2890
|
-
!
|
|
2890
|
+
!f && /* @__PURE__ */ F("div", { className: Y["rp-search-tool-controls"], children: [
|
|
2891
2891
|
/* @__PURE__ */ i(on, {}),
|
|
2892
2892
|
/* @__PURE__ */ i(Ht, { onKeyPress: b, handleClose: c })
|
|
2893
2893
|
] })
|
|
@@ -2927,7 +2927,7 @@ const xe = {
|
|
|
2927
2927
|
/* @__PURE__ */ i(ii, {})
|
|
2928
2928
|
] }),
|
|
2929
2929
|
/* @__PURE__ */ i("div", { "data-rp": "topBarCenter", className: Fe["rp-toolbar-middle"], children: /* @__PURE__ */ i(Hi, {}) }),
|
|
2930
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBarRight", className: Fe["rp-toolbar-end"], children: /* @__PURE__ */ i(
|
|
2930
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBarRight", className: Fe["rp-toolbar-end"], children: /* @__PURE__ */ i(Ai, {}) })
|
|
2931
2931
|
] }) }),
|
|
2932
2932
|
n && a ? /* @__PURE__ */ i(qi, { percentage: a }) : null
|
|
2933
2933
|
] });
|
|
@@ -2986,15 +2986,15 @@ const xe = {
|
|
|
2986
2986
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2987
2987
|
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Bi);
|
|
2988
2988
|
}, ji = $e((e, t) => {
|
|
2989
|
-
const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage: l, thumbnailLength: s, addToPage: u } = Cn(), p = H(null),
|
|
2989
|
+
const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage: l, thumbnailLength: s, addToPage: u } = Cn(), p = H(null), m = H(1);
|
|
2990
2990
|
cn(t, () => p.current);
|
|
2991
2991
|
const v = W(() => Object.values(a), [a]), h = N(() => {
|
|
2992
2992
|
const _ = s + 1;
|
|
2993
2993
|
_ <= r && l(_);
|
|
2994
2994
|
}, [l, r, s]);
|
|
2995
2995
|
return k(() => {
|
|
2996
|
-
o > s ? u(o) : n &&
|
|
2997
|
-
}, [o, s, u, n, v]),
|
|
2996
|
+
o > s ? u(o) : n && m.current !== o && (Zi(p.current, o), m.current = o);
|
|
2997
|
+
}, [o, s, u, n, v]), fr(p.current, h), /* @__PURE__ */ i("div", { ref: p, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ i("div", { className: sn["rp-thumbnails"], children: n ? v.map((_, T) => {
|
|
2998
2998
|
var S, C;
|
|
2999
2999
|
return /* @__PURE__ */ i(
|
|
3000
3000
|
Ui,
|
|
@@ -3010,10 +3010,10 @@ const xe = {
|
|
|
3010
3010
|
}) : null }) });
|
|
3011
3011
|
}), Ki = () => {
|
|
3012
3012
|
const { thumbnailIcon: e } = pe();
|
|
3013
|
-
return e || /* @__PURE__ */ i(
|
|
3013
|
+
return e || /* @__PURE__ */ i(mr, {});
|
|
3014
3014
|
}, Xi = () => {
|
|
3015
3015
|
const { active: e, setActive: t } = Cn(), [n, o] = $(200), r = H(null), { thumbnailTool: a, sidebarEnable: l } = ve(), { localeMessages: s } = se(), u = N(() => {
|
|
3016
|
-
t((
|
|
3016
|
+
t((m) => !m);
|
|
3017
3017
|
}, []), p = W(() => typeof a != "boolean" && a ? /* @__PURE__ */ i(a, { onClick: u, active: e }) : a ? /* @__PURE__ */ i(K, { content: s == null ? void 0 : s.thumbnailTooltip, children: /* @__PURE__ */ i(
|
|
3018
3018
|
re,
|
|
3019
3019
|
{
|
|
@@ -3023,7 +3023,7 @@ const xe = {
|
|
|
3023
3023
|
children: /* @__PURE__ */ i(Ki, {})
|
|
3024
3024
|
}
|
|
3025
3025
|
) }) : null, [a, e, u, s]);
|
|
3026
|
-
return /* @__PURE__ */ i(
|
|
3026
|
+
return /* @__PURE__ */ i(fe, { children: l && /* @__PURE__ */ F(
|
|
3027
3027
|
"div",
|
|
3028
3028
|
{
|
|
3029
3029
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
@@ -3047,13 +3047,13 @@ const xe = {
|
|
|
3047
3047
|
}
|
|
3048
3048
|
) });
|
|
3049
3049
|
}, _e = {
|
|
3050
|
-
"rp-layout": "_rp-
|
|
3051
|
-
"rp-content": "_rp-
|
|
3052
|
-
"rp-pages": "_rp-
|
|
3053
|
-
"rp-container": "_rp-
|
|
3054
|
-
"rp-loader": "_rp-
|
|
3055
|
-
"rp-theme-variables": "_rp-theme-
|
|
3056
|
-
"rp-dark-mode": "_rp-dark-
|
|
3050
|
+
"rp-layout": "_rp-layout_gz5nb_1",
|
|
3051
|
+
"rp-content": "_rp-content_gz5nb_5",
|
|
3052
|
+
"rp-pages": "_rp-pages_gz5nb_11",
|
|
3053
|
+
"rp-container": "_rp-container_gz5nb_16",
|
|
3054
|
+
"rp-loader": "_rp-loader_gz5nb_52",
|
|
3055
|
+
"rp-theme-variables": "_rp-theme-variables_gz5nb_56",
|
|
3056
|
+
"rp-dark-mode": "_rp-dark-mode_gz5nb_161"
|
|
3057
3057
|
}, Yi = $e(
|
|
3058
3058
|
(e, t) => {
|
|
3059
3059
|
const { children: n, toolbarRef: o, style: r, className: a } = e, { customVariables: l, customDarkVariables: s } = Pr(), { darkMode: u } = rr();
|
|
@@ -3087,11 +3087,11 @@ const xe = {
|
|
|
3087
3087
|
mobileWidth: s,
|
|
3088
3088
|
onLoaded: u,
|
|
3089
3089
|
cleanupOnLoaded: p,
|
|
3090
|
-
onLayoutWidthChange:
|
|
3090
|
+
onLayoutWidthChange: m
|
|
3091
3091
|
} = e, [v, h] = $(null), { setContainer: _, setContentRef: T } = ge(), { loading: S } = J(), { LoaderImageComponent: C } = pn();
|
|
3092
3092
|
return k(() => (u && u(), () => {
|
|
3093
3093
|
p && p();
|
|
3094
|
-
}), [u, p]), /* @__PURE__ */ i(Yi, { toolbarRef: v, ref: t, children: /* @__PURE__ */ i(Tr, { mobileWidth: s, onLayoutWidthChange:
|
|
3094
|
+
}), [u, p]), /* @__PURE__ */ i(Yi, { toolbarRef: v, ref: t, children: /* @__PURE__ */ i(Tr, { mobileWidth: s, onLayoutWidthChange: m, children: /* @__PURE__ */ i(vr, { slots: o, children: /* @__PURE__ */ i(wr, { icons: r, children: /* @__PURE__ */ F(_r, { getContainerRef: _, style: a, className: l, children: [
|
|
3095
3095
|
/* @__PURE__ */ F(br, { children: [
|
|
3096
3096
|
/* @__PURE__ */ F("div", { className: _e["rp-layout"], children: [
|
|
3097
3097
|
/* @__PURE__ */ i(Vi, { ref: h }),
|
|
@@ -3146,7 +3146,7 @@ export {
|
|
|
3146
3146
|
Yi as K,
|
|
3147
3147
|
qi as L,
|
|
3148
3148
|
Di as M,
|
|
3149
|
-
|
|
3149
|
+
zi as O,
|
|
3150
3150
|
ks as P,
|
|
3151
3151
|
$s as R,
|
|
3152
3152
|
Hs as S,
|
|
@@ -3168,7 +3168,7 @@ export {
|
|
|
3168
3168
|
yo as n,
|
|
3169
3169
|
Tn as o,
|
|
3170
3170
|
Lo as p,
|
|
3171
|
-
|
|
3171
|
+
zo as q,
|
|
3172
3172
|
It as r,
|
|
3173
3173
|
Xo as s,
|
|
3174
3174
|
ei as t,
|
|
@@ -3177,5 +3177,5 @@ export {
|
|
|
3177
3177
|
ii as w,
|
|
3178
3178
|
Ti as x,
|
|
3179
3179
|
Bn as y,
|
|
3180
|
-
|
|
3180
|
+
Ai as z
|
|
3181
3181
|
};
|