@pdf-viewer/react 1.10.0-beta.3 → 1.10.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ToolbarLayout.module-8fc14845.js → ToolbarLayout.module-1968d75e.js} +305 -305
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPMoreOptions.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +1 -1
- package/dist/components/layout/toolbar/ToolbarDefault.js +1 -1
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a, Fragment as pe, jsxs as H } from "react/jsx-runtime";
|
|
2
2
|
import * as X from "react";
|
|
3
|
-
import { useRef as W, useEffect as
|
|
3
|
+
import { useRef as W, useEffect as A, useCallback as N, useState as q, useMemo as F, createContext as $e, useContext as qe, useImperativeHandle as on, createElement as Ve, PureComponent as oo, Component as ro, memo as rn, forwardRef as io } from "react";
|
|
4
4
|
import { ChevronUpIcon as Ze } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as ge } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as an } from "./components/ui/Input.js";
|
|
@@ -12,7 +12,7 @@ import { useDarkModeContext as lo } from "./contexts/DarkModeContext.js";
|
|
|
12
12
|
import "./contexts/RotationContext.js";
|
|
13
13
|
import { useLayerContext as uo } from "./contexts/LayerContext.js";
|
|
14
14
|
import { useZoomContext as wt } from "./contexts/ZoomContext.js";
|
|
15
|
-
import { useViewModeContext as
|
|
15
|
+
import { useViewModeContext as Me } from "./contexts/ViewModeContext.js";
|
|
16
16
|
import { useVirtualScrollContext as Ye } from "./contexts/VirtualScrollContext.js";
|
|
17
17
|
import { useVirtualGridContext as sn } from "./contexts/VirtualGridContext.js";
|
|
18
18
|
import { useSelectionModeContext as po } from "./contexts/SelectionModeContext.js";
|
|
@@ -57,16 +57,16 @@ import { UIDropDown as dn } from "./components/ui/DropDown.js";
|
|
|
57
57
|
import "./ZoomTool.module-6c5eabbb.js";
|
|
58
58
|
import { MenuItem as Xe } from "./components/layout/toolbar/MenuItem.js";
|
|
59
59
|
import { MenuSeparator as un } from "./components/layout/toolbar/MenuSeparator.js";
|
|
60
|
-
import { dateFormatter as
|
|
60
|
+
import { dateFormatter as Mt } from "./utils/dateFormatter.js";
|
|
61
61
|
import { PropertyItem as zo } from "./components/layout/toolbar/PropertyItem.js";
|
|
62
62
|
import "./RotateTool.module-03987eba.js";
|
|
63
63
|
import { withRef as et } from "./utils/withRef.js";
|
|
64
|
-
import { useInfiniteScroll as
|
|
65
|
-
import { THUMBNAIL_MIN_WIDTH as
|
|
64
|
+
import { useInfiniteScroll as Mo } from "./utils/hooks/useInfiniteScroll.js";
|
|
65
|
+
import { THUMBNAIL_MIN_WIDTH as Fo } from "./utils/constants.js";
|
|
66
66
|
import * as ko from "pdfjs-dist";
|
|
67
67
|
import { PixelsPerInch as Wo, AnnotationMode as Ho, RenderingCancelledException as $o, AnnotationLayer as qo } from "pdfjs-dist";
|
|
68
68
|
import { SimpleLinkService as Go } from "./utils/link_service.js";
|
|
69
|
-
import { annotationsEvents as Uo, annotationEventsHandler as Vo, handleClick as
|
|
69
|
+
import { annotationsEvents as Uo, annotationEventsHandler as Vo, handleClick as Ft, handleAnnotationWidget as Bo, handleAnnotationLink as jo, bindLayerEvents as Ko, unbindLayerEvents as kt } from "./utils/annotations.js";
|
|
70
70
|
import { normalizeSingleKeyword as Zo, sortHighlightPosition as Xo, unwrap as Qo } from "./components/page/searchHighlight.js";
|
|
71
71
|
import { CustomElement as Yo } from "./components/page/CustomElement.js";
|
|
72
72
|
import { getGridDimension as bt, getPositionFromPage as Jo, getPageFromPosition as er } from "./utils/calculatePage.js";
|
|
@@ -101,13 +101,13 @@ import { SearchIcon as gn } from "./components/icons/SearchIcon.js";
|
|
|
101
101
|
import { ClearIcon as Lr } from "./components/icons/ClearIcon.js";
|
|
102
102
|
import { InfoIcon as Wt } from "./components/icons/InfoIcon.js";
|
|
103
103
|
import './assets/ToolbarLayout.css';const vn = () => {
|
|
104
|
-
const { viewMode: t } =
|
|
105
|
-
|
|
104
|
+
const { viewMode: t } = Me(), { scrollMode: e } = Ee(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = Ye(), { setFocusedPage: i } = le(), c = W(), { columnCount: l } = sn(), { widths: d, heights: f } = Ge(), m = W(e), P = W(t), h = W(l), { targetScrollPage: T } = cn();
|
|
105
|
+
A(() => {
|
|
106
106
|
n != null && n.scrollToItem && (c.current = n);
|
|
107
|
-
}, [n]),
|
|
107
|
+
}, [n]), A(() => {
|
|
108
108
|
m.current = e, P.current = t;
|
|
109
109
|
}, [e, t]);
|
|
110
|
-
const C =
|
|
110
|
+
const C = N(
|
|
111
111
|
(v, y) => {
|
|
112
112
|
if (!o)
|
|
113
113
|
return;
|
|
@@ -132,11 +132,11 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
132
132
|
},
|
|
133
133
|
[o, d, it]
|
|
134
134
|
);
|
|
135
|
-
return
|
|
135
|
+
return A(() => {
|
|
136
136
|
m.current = e, P.current = t;
|
|
137
|
-
}, [e, t]),
|
|
137
|
+
}, [e, t]), A(() => {
|
|
138
138
|
h.current = l;
|
|
139
|
-
}, [l]), { scrollToPage:
|
|
139
|
+
}, [l]), { scrollToPage: N(
|
|
140
140
|
(v, y = "smooth") => {
|
|
141
141
|
i(v);
|
|
142
142
|
const g = v - 1;
|
|
@@ -159,32 +159,32 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
159
159
|
);
|
|
160
160
|
if (m.current === ne.HORIZONTAL_SCROLLING) {
|
|
161
161
|
u = g;
|
|
162
|
-
const S = {
|
|
163
|
-
left:
|
|
162
|
+
const S = ze(_, u), I = {
|
|
163
|
+
left: Math.floor(S),
|
|
164
164
|
top: 0
|
|
165
165
|
};
|
|
166
166
|
return s.scrollTo({
|
|
167
|
-
...
|
|
167
|
+
...I,
|
|
168
168
|
behavior: y
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
if (P.current === Re.DUAL_PAGE) {
|
|
172
172
|
u = g % 2, p = Math.floor(g / 2);
|
|
173
|
-
const
|
|
174
|
-
left:
|
|
175
|
-
top:
|
|
173
|
+
const I = ze(_, u), E = ze(w, p), D = {
|
|
174
|
+
left: Math.floor(I),
|
|
175
|
+
top: Math.floor(E)
|
|
176
176
|
};
|
|
177
177
|
return s.scrollTo({
|
|
178
|
-
...
|
|
178
|
+
...D,
|
|
179
179
|
behavior: y
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
const x = {
|
|
182
|
+
const x = ze(w, p), R = {
|
|
183
183
|
left: 0,
|
|
184
|
-
top:
|
|
184
|
+
top: Math.floor(x)
|
|
185
185
|
};
|
|
186
186
|
return s.scrollTo({
|
|
187
|
-
...
|
|
187
|
+
...R,
|
|
188
188
|
behavior: y
|
|
189
189
|
});
|
|
190
190
|
},
|
|
@@ -199,7 +199,7 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
199
199
|
]
|
|
200
200
|
) };
|
|
201
201
|
}, Er = (t = 1) => {
|
|
202
|
-
const [e, n] = q(t), [r, o] = q(0), { scrollToPage: i } = vn(), c = W(1), { viewMode: l } =
|
|
202
|
+
const [e, n] = q(t), [r, o] = q(0), { scrollToPage: i } = vn(), c = W(1), { viewMode: l } = Me(), { scrollMode: d } = Ee(), { widths: f } = Ge(), { pagesRef: m } = _e(), P = Tt(e, 100), h = N(
|
|
203
203
|
(p) => {
|
|
204
204
|
if (!/^[0-9]*$/g.test(p.toString()) || !p)
|
|
205
205
|
return { success: !1, currentPage: c.current };
|
|
@@ -207,22 +207,22 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
207
207
|
return s < 0 || s > r ? { success: !1, currentPage: c.current } : (n(s), c.current = s, { success: !0, currentPage: +p });
|
|
208
208
|
},
|
|
209
209
|
[r]
|
|
210
|
-
), T =
|
|
210
|
+
), T = N(h, [h]), C = N(
|
|
211
211
|
(p) => {
|
|
212
212
|
const u = h(p);
|
|
213
213
|
return u.success && i(u.currentPage), u;
|
|
214
214
|
},
|
|
215
215
|
[h, i]
|
|
216
|
-
), b =
|
|
216
|
+
), b = N((p) => {
|
|
217
217
|
const u = p % 2 === 1;
|
|
218
218
|
if (!m || u)
|
|
219
219
|
return !1;
|
|
220
220
|
const s = u ? f[p] : f[p - 1], _ = u ? f[p + 1] : f[p];
|
|
221
221
|
return l === Re.DUAL_PAGE && s + _ < m.clientWidth;
|
|
222
|
-
}, [l, f, m, r]), v =
|
|
222
|
+
}, [l, f, m, r]), v = N(() => {
|
|
223
223
|
let p = e - 1;
|
|
224
224
|
b(p) && (p = e - 2), C(p);
|
|
225
|
-
}, [C, e, l, d, b]), y =
|
|
225
|
+
}, [C, e, l, d, b]), y = F(() => l === Re.DUAL_PAGE && d === ne.PAGE_SCROLLING ? e === r - 1 : e === r, [e, r, l, d]), g = N(() => {
|
|
226
226
|
if (y)
|
|
227
227
|
return;
|
|
228
228
|
let p = e + 1;
|
|
@@ -254,9 +254,9 @@ import './assets/ToolbarLayout.css';const vn = () => {
|
|
|
254
254
|
return typeof (t == null ? void 0 : t.focusedPage) > "u" && sr.error("Please use this hooks inside children component of RPProvider"), t;
|
|
255
255
|
}, Ks = ({ children: t }) => {
|
|
256
256
|
const { pdf: e } = oe(), { setCurrentPage: n } = Po(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: c, goToPage: l, nextPage: d, prevPage: f } = Er();
|
|
257
|
-
return
|
|
257
|
+
return A(() => {
|
|
258
258
|
e != null && e.numPages && (c(e.numPages), i(1));
|
|
259
|
-
}, [e, c, i]),
|
|
259
|
+
}, [e, c, i]), A(() => {
|
|
260
260
|
n(r);
|
|
261
261
|
}, [r, n]), /* @__PURE__ */ a(
|
|
262
262
|
wn.Provider,
|
|
@@ -280,14 +280,14 @@ const Nr = () => {
|
|
|
280
280
|
totalPages: 0,
|
|
281
281
|
percentage: 0
|
|
282
282
|
}), [o, i] = q(!1), [c, l] = q(!1), [d, f] = q(null), m = W(!1);
|
|
283
|
-
|
|
283
|
+
A(() => {
|
|
284
284
|
m.current;
|
|
285
285
|
}, [m]);
|
|
286
|
-
const P =
|
|
286
|
+
const P = N(() => {
|
|
287
287
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
288
288
|
const p = document.querySelector(".rp-print-zone");
|
|
289
289
|
p && p.remove();
|
|
290
|
-
}, []), h =
|
|
290
|
+
}, []), h = N(() => {
|
|
291
291
|
m.current = !1, i(!1), l(!1), f(null), r({
|
|
292
292
|
loadedPages: 0,
|
|
293
293
|
totalPages: 0,
|
|
@@ -302,7 +302,7 @@ const Nr = () => {
|
|
|
302
302
|
viewerPdfPage: _,
|
|
303
303
|
printResolution: w,
|
|
304
304
|
optionalContentConfigPromise: x,
|
|
305
|
-
printAnnotationStoragePromise:
|
|
305
|
+
printAnnotationStoragePromise: R
|
|
306
306
|
}) => {
|
|
307
307
|
if (m.current) {
|
|
308
308
|
h();
|
|
@@ -310,31 +310,31 @@ const Nr = () => {
|
|
|
310
310
|
}
|
|
311
311
|
const S = w / Wo.PDF;
|
|
312
312
|
p.width = Math.floor(_.width * S), p.height = Math.floor(_.height * S);
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
const [
|
|
313
|
+
const I = p.getContext("2d");
|
|
314
|
+
I.save(), I.fillStyle = "rgb(255, 255, 255)", I.fillRect(0, 0, p.width, p.height), I.restore();
|
|
315
|
+
const [E, D] = await Promise.all([
|
|
316
316
|
u.getPage(s),
|
|
317
|
-
|
|
317
|
+
R
|
|
318
318
|
]);
|
|
319
319
|
if (m.current) {
|
|
320
320
|
h();
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
323
|
const z = {
|
|
324
|
-
canvasContext:
|
|
324
|
+
canvasContext: I,
|
|
325
325
|
transform: [S, 0, 0, S, 0, 0],
|
|
326
|
-
viewport:
|
|
326
|
+
viewport: E.getViewport({ scale: 1, rotation: _.rotation }),
|
|
327
327
|
intent: "print",
|
|
328
328
|
annotationMode: Ho.ENABLE_STORAGE,
|
|
329
329
|
optionalContentConfigPromise: x,
|
|
330
|
-
printAnnotationStorage:
|
|
330
|
+
printAnnotationStorage: D
|
|
331
331
|
};
|
|
332
332
|
try {
|
|
333
|
-
return
|
|
333
|
+
return E.render(z).promise;
|
|
334
334
|
} catch (L) {
|
|
335
335
|
throw L instanceof $o || console.error(L), L;
|
|
336
336
|
}
|
|
337
|
-
}, b =
|
|
337
|
+
}, b = N(() => {
|
|
338
338
|
const p = window.print;
|
|
339
339
|
return new Promise((u) => {
|
|
340
340
|
const s = (x) => {
|
|
@@ -366,11 +366,11 @@ const Nr = () => {
|
|
|
366
366
|
s.classList.add("rp-print-zone");
|
|
367
367
|
const _ = document.createElement("style"), w = u.get(1);
|
|
368
368
|
if (w) {
|
|
369
|
-
const { width: x, height:
|
|
370
|
-
_.innerHTML = `@page { size: ${x}px ${
|
|
369
|
+
const { width: x, height: R } = w == null ? void 0 : w.page.getViewport({ scale: 1 });
|
|
370
|
+
_.innerHTML = `@page { size: ${x}px ${R}px }`;
|
|
371
371
|
}
|
|
372
372
|
return s.appendChild(_), s.append(...p), s;
|
|
373
|
-
}, g =
|
|
373
|
+
}, g = N(async () => {
|
|
374
374
|
if (!t)
|
|
375
375
|
return;
|
|
376
376
|
h();
|
|
@@ -380,17 +380,17 @@ const Nr = () => {
|
|
|
380
380
|
const _ = t.getOptionalContentConfig({ intent: "print" }), w = Promise.resolve(
|
|
381
381
|
t.annotationStorage.print ?? void 0
|
|
382
382
|
), x = e.size;
|
|
383
|
-
for (const [S,
|
|
383
|
+
for (const [S, I] of e) {
|
|
384
384
|
if (m.current) {
|
|
385
385
|
h();
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
|
-
const
|
|
388
|
+
const E = I.page.getViewport({ scale: 1 });
|
|
389
389
|
if (await C({
|
|
390
390
|
scratchCanvas: p,
|
|
391
391
|
pdfDocument: t,
|
|
392
392
|
pageNumber: S,
|
|
393
|
-
viewerPdfPage:
|
|
393
|
+
viewerPdfPage: E,
|
|
394
394
|
printResolution: 150,
|
|
395
395
|
optionalContentConfigPromise: _,
|
|
396
396
|
printAnnotationStoragePromise: w
|
|
@@ -398,8 +398,8 @@ const Nr = () => {
|
|
|
398
398
|
h();
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
|
-
const
|
|
402
|
-
u.push(
|
|
401
|
+
const D = await v(p);
|
|
402
|
+
u.push(D);
|
|
403
403
|
const z = parseFloat((u.length / x * 100).toFixed(2));
|
|
404
404
|
r({
|
|
405
405
|
loadedPages: S,
|
|
@@ -411,15 +411,15 @@ const Nr = () => {
|
|
|
411
411
|
h();
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
|
-
const
|
|
415
|
-
document.body.appendChild(
|
|
414
|
+
const R = y(u, e);
|
|
415
|
+
document.body.appendChild(R), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await b();
|
|
416
416
|
} catch (s) {
|
|
417
417
|
l(!0), s instanceof Error && f(s);
|
|
418
418
|
} finally {
|
|
419
419
|
p.height = 0, p.width = 0;
|
|
420
420
|
}
|
|
421
421
|
}, [t, e, m]);
|
|
422
|
-
return
|
|
422
|
+
return A(() => {
|
|
423
423
|
const p = () => {
|
|
424
424
|
h(), P();
|
|
425
425
|
};
|
|
@@ -452,23 +452,23 @@ const Nr = () => {
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
}), Zs = ({ children: t }) => {
|
|
455
|
-
const [e, n] = q(null), [r, o] = q(null), { print: i, cancel: c, progress: l, isComplete: d, isError: f, error: m } = Nr(), P =
|
|
455
|
+
const [e, n] = q(null), [r, o] = q(null), { print: i, cancel: c, progress: l, isComplete: d, isError: f, error: m } = Nr(), P = N((v) => {
|
|
456
456
|
v && typeof v == "function" && o(() => v);
|
|
457
457
|
}, []), h = (v) => {
|
|
458
458
|
m && v(m);
|
|
459
|
-
}, T =
|
|
459
|
+
}, T = N(
|
|
460
460
|
(v) => {
|
|
461
461
|
n(() => v);
|
|
462
462
|
},
|
|
463
463
|
[l, e]
|
|
464
464
|
);
|
|
465
|
-
|
|
465
|
+
A(() => {
|
|
466
466
|
d && r && C();
|
|
467
|
-
}, [d, r]),
|
|
467
|
+
}, [d, r]), A(() => {
|
|
468
468
|
f && h((v) => {
|
|
469
469
|
console.error(v);
|
|
470
470
|
});
|
|
471
|
-
}, [f]),
|
|
471
|
+
}, [f]), A(() => {
|
|
472
472
|
l && e && e(l);
|
|
473
473
|
}, [l, e]);
|
|
474
474
|
const C = () => {
|
|
@@ -488,7 +488,7 @@ const Nr = () => {
|
|
|
488
488
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
489
489
|
return t;
|
|
490
490
|
}, Or = () => {
|
|
491
|
-
const [t, e] = q({}), { pages: n } = oe(), r =
|
|
491
|
+
const [t, e] = q({}), { pages: n } = oe(), r = F(() => Object.keys(t).length, [t]), o = N(
|
|
492
492
|
(c) => {
|
|
493
493
|
if (!n.size)
|
|
494
494
|
return;
|
|
@@ -506,10 +506,10 @@ const Nr = () => {
|
|
|
506
506
|
},
|
|
507
507
|
[n]
|
|
508
508
|
);
|
|
509
|
-
|
|
509
|
+
A(() => {
|
|
510
510
|
o(10);
|
|
511
511
|
}, [o]);
|
|
512
|
-
const i =
|
|
512
|
+
const i = N(
|
|
513
513
|
(c) => {
|
|
514
514
|
if (!n)
|
|
515
515
|
return;
|
|
@@ -551,8 +551,8 @@ const Nr = () => {
|
|
|
551
551
|
}
|
|
552
552
|
);
|
|
553
553
|
}, Dr = (t = {}, e = "") => {
|
|
554
|
-
const [n, r] = q(e), [o, i] = q(!1), { pdf: c, pages: l } = oe(), { widths: d, heights: f } = Ge(), m = W(!n), { currentZoom: P } = wt(), [h, T] = q([]), { setFocusedPage: C } = le(), { columnCount: b } =
|
|
555
|
-
|
|
554
|
+
const [n, r] = q(e), [o, i] = q(!1), { pdf: c, pages: l } = oe(), { widths: d, heights: f } = Ge(), m = W(!n), { currentZoom: P } = wt(), [h, T] = q([]), { setFocusedPage: C } = le(), { columnCount: b } = Me(), { pageRotate: v } = Je(), [y, g] = q(0), { pageScrollElementRef: p, virtualScrollableElementRef: u } = Ye(), { scrollMode: s } = Ee(), { pagesRef: _ } = _e(), [w, x] = q(null), R = W({}), S = F(() => y === 0 ? null : h[y - 1], [y, h]), I = F(() => h.length, [h]);
|
|
555
|
+
A(() => {
|
|
556
556
|
if (!S || !l)
|
|
557
557
|
return;
|
|
558
558
|
const L = u || p;
|
|
@@ -561,10 +561,10 @@ const Nr = () => {
|
|
|
561
561
|
const O = l.get(S.page);
|
|
562
562
|
if (s === ne.PAGE_SCROLLING && C(S.page), !O)
|
|
563
563
|
return;
|
|
564
|
-
let
|
|
564
|
+
let M = 0, $ = 0;
|
|
565
565
|
if (s === ne.VERTICAL_SCROLLING) {
|
|
566
566
|
const J = S.page - 1, ee = b, re = J % ee, ve = Math.floor(J / ee);
|
|
567
|
-
|
|
567
|
+
M = ze(f, ve), $ = ze(d, re);
|
|
568
568
|
}
|
|
569
569
|
s === ne.HORIZONTAL_SCROLLING && ($ = d.slice(0, S.page - 1).reduce((J, ee) => J + ee, 0));
|
|
570
570
|
const k = {
|
|
@@ -579,7 +579,7 @@ const Nr = () => {
|
|
|
579
579
|
S.rect,
|
|
580
580
|
P,
|
|
581
581
|
Z
|
|
582
|
-
), G = $ + U, K =
|
|
582
|
+
), G = $ + U, K = M + ie, Y = {
|
|
583
583
|
left: Math.max(G, 0),
|
|
584
584
|
top: Math.max(K, 0)
|
|
585
585
|
};
|
|
@@ -598,30 +598,30 @@ const Nr = () => {
|
|
|
598
598
|
p,
|
|
599
599
|
_
|
|
600
600
|
]);
|
|
601
|
-
const
|
|
602
|
-
g((L) =>
|
|
603
|
-
}, [
|
|
604
|
-
g((L) =>
|
|
605
|
-
}, [
|
|
601
|
+
const E = N(() => {
|
|
602
|
+
g((L) => I ? L + 1 > I ? 1 : L + 1 : 0);
|
|
603
|
+
}, [I]), D = N(() => {
|
|
604
|
+
g((L) => I ? L - 1 <= 0 ? I : L - 1 : 0);
|
|
605
|
+
}, [I]), z = N(async (L) => {
|
|
606
606
|
if (!L)
|
|
607
607
|
return {};
|
|
608
|
-
const O = L.numPages,
|
|
608
|
+
const O = L.numPages, M = {};
|
|
609
609
|
for (let $ = 1; $ <= O; $++) {
|
|
610
610
|
if (m.current)
|
|
611
611
|
throw "close pop over";
|
|
612
612
|
const k = await L.getPage($);
|
|
613
|
-
|
|
613
|
+
M[$.toString()] = await k.getTextContent();
|
|
614
614
|
}
|
|
615
|
-
return
|
|
615
|
+
return M;
|
|
616
616
|
}, []);
|
|
617
|
-
return
|
|
617
|
+
return A(() => {
|
|
618
618
|
if (!n) {
|
|
619
619
|
m.current = !0, T([]), g(0);
|
|
620
620
|
return;
|
|
621
621
|
}
|
|
622
622
|
m.current = !1, i(!0), T([]), g(0), z(c).then((L) => {
|
|
623
|
-
|
|
624
|
-
const
|
|
623
|
+
R.current = L;
|
|
624
|
+
const M = Object.keys(L).reduce(($, k) => {
|
|
625
625
|
const B = mo(
|
|
626
626
|
[n],
|
|
627
627
|
L[k],
|
|
@@ -630,7 +630,7 @@ const Nr = () => {
|
|
|
630
630
|
).map((Z, U) => ({ ...Z, page: Number(k), pageMatchIdx: U }));
|
|
631
631
|
return [...$, ...B];
|
|
632
632
|
}, []);
|
|
633
|
-
T(
|
|
633
|
+
T(M), g(M.length ? 1 : 0);
|
|
634
634
|
}).catch(() => {
|
|
635
635
|
T([]), g(0);
|
|
636
636
|
}).finally(() => i(!1));
|
|
@@ -639,11 +639,11 @@ const Nr = () => {
|
|
|
639
639
|
setSearch: r,
|
|
640
640
|
loading: o,
|
|
641
641
|
matches: h,
|
|
642
|
-
totalMatches:
|
|
642
|
+
totalMatches: I,
|
|
643
643
|
currentMatchPosition: y,
|
|
644
644
|
currentMatch: S,
|
|
645
|
-
nextMatch:
|
|
646
|
-
prevMatch:
|
|
645
|
+
nextMatch: E,
|
|
646
|
+
prevMatch: D,
|
|
647
647
|
currentMatchElement: w,
|
|
648
648
|
setCurrentMatchElement: x
|
|
649
649
|
};
|
|
@@ -704,9 +704,9 @@ const Nr = () => {
|
|
|
704
704
|
}
|
|
705
705
|
);
|
|
706
706
|
}, yt = () => qe(Cn), Pn = $e(null), Ys = ({ children: t }) => {
|
|
707
|
-
const e = W(!1), [n, r] = q([]), o =
|
|
707
|
+
const e = W(!1), [n, r] = q([]), o = N((d) => {
|
|
708
708
|
r((f) => [...f, { id: d.page.pageNumber.toString(), data: d, priority: 0 }]);
|
|
709
|
-
}, []), i =
|
|
709
|
+
}, []), i = F(() => new To(o), [o]), { focusedPage: c } = le(), l = N((d) => (e.current = !0, Co(
|
|
710
710
|
d.data.page,
|
|
711
711
|
d.data.canvasElem,
|
|
712
712
|
d.data.options
|
|
@@ -715,9 +715,9 @@ const Nr = () => {
|
|
|
715
715
|
}).finally(() => {
|
|
716
716
|
d.data.onLoaded && d.data.onLoaded();
|
|
717
717
|
})), []);
|
|
718
|
-
return
|
|
718
|
+
return A(() => {
|
|
719
719
|
c && (i.changePagePriority(`^page-${c}`, 0), i.changePagePriority(`^thumbnail-${c}`, 1));
|
|
720
|
-
}, [c]),
|
|
720
|
+
}, [c]), A(() => {
|
|
721
721
|
if (i.isEmpty() || e.current)
|
|
722
722
|
return;
|
|
723
723
|
const d = () => {
|
|
@@ -750,7 +750,7 @@ const Nr = () => {
|
|
|
750
750
|
"rp-loader-wrapper": "_rp-loader-wrapper_14ohm_15"
|
|
751
751
|
}, Ar = (t) => {
|
|
752
752
|
const { pageNumber: e, onLoaded: n, onLoading: r } = t, o = W(null), { pages: i } = oe(), { pageRotate: c } = Je(), l = W(), { currentZoom: d } = wt(), f = yn(), m = W(`page-${e}`);
|
|
753
|
-
return
|
|
753
|
+
return A(() => {
|
|
754
754
|
if (!i || d === 0)
|
|
755
755
|
return;
|
|
756
756
|
const P = i.get(e);
|
|
@@ -777,15 +777,15 @@ const Nr = () => {
|
|
|
777
777
|
f.removeQueue(m.current);
|
|
778
778
|
};
|
|
779
779
|
}, [i, e, c, d, r, n, f]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${e}-canvas`, ref: o });
|
|
780
|
-
}, zr = "_selecting_1uik2_10",
|
|
780
|
+
}, zr = "_selecting_1uik2_10", Mr = "_markedContent_1uik2_33", fe = {
|
|
781
781
|
"rp-text-layer": "_rp-text-layer_1uik2_1",
|
|
782
782
|
selecting: zr,
|
|
783
|
-
markedContent:
|
|
783
|
+
markedContent: Mr,
|
|
784
784
|
"rp-text-layer-text": "_rp-text-layer-text_1uik2_52"
|
|
785
|
-
},
|
|
785
|
+
}, Fr = (t) => {
|
|
786
786
|
const { pageNumber: e } = t, { pages: n } = oe(), r = W(null), { matches: o, currentMatch: i, setCurrentMatchElement: c } = yt(), [l, d] = q(
|
|
787
787
|
[]
|
|
788
|
-
), f = W(), m = W(), P = W([]), h =
|
|
788
|
+
), f = W(), m = W(), P = W([]), h = F(() => o.filter((p) => p.pageIndex === e - 1), [o, e]), T = N(
|
|
789
789
|
(p, u, s = !1) => {
|
|
790
790
|
if (s && go(p, u), !h.length) {
|
|
791
791
|
P.current = [], d([]);
|
|
@@ -795,8 +795,8 @@ const Nr = () => {
|
|
|
795
795
|
d(_);
|
|
796
796
|
},
|
|
797
797
|
[h]
|
|
798
|
-
), C = W(), b = W(!1), v =
|
|
799
|
-
|
|
798
|
+
), C = W(), b = W(!1), v = N(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
799
|
+
A(() => ((() => {
|
|
800
800
|
if (C.current)
|
|
801
801
|
return;
|
|
802
802
|
C.current = new AbortController();
|
|
@@ -845,26 +845,26 @@ const Nr = () => {
|
|
|
845
845
|
}
|
|
846
846
|
const x = /* @__PURE__ */ new Set();
|
|
847
847
|
for (let O = 0; O < w.rangeCount; O++) {
|
|
848
|
-
const
|
|
848
|
+
const M = w.getRangeAt(O);
|
|
849
849
|
v().forEach(($) => {
|
|
850
|
-
|
|
850
|
+
M.intersectsNode($) && !x.has($) && x.add($);
|
|
851
851
|
});
|
|
852
852
|
}
|
|
853
853
|
v().forEach((O) => {
|
|
854
854
|
if (x.has(O))
|
|
855
855
|
O.classList.add(fe.selecting);
|
|
856
856
|
else {
|
|
857
|
-
const
|
|
858
|
-
|
|
857
|
+
const M = O.querySelector(".endOfContent");
|
|
858
|
+
M && (O.appendChild(M), M.style.width = "", M.style.height = "", O.classList.remove(fe.selecting));
|
|
859
859
|
}
|
|
860
860
|
});
|
|
861
|
-
const
|
|
862
|
-
let
|
|
863
|
-
|
|
864
|
-
const
|
|
861
|
+
const R = w.getRangeAt(0);
|
|
862
|
+
let I = _ && (R.compareBoundaryPoints(Range.END_TO_END, _) === 0 || R.compareBoundaryPoints(Range.START_TO_END, _) === 0) ? R.startContainer : R.endContainer;
|
|
863
|
+
I.nodeType === Node.TEXT_NODE && (I = I.parentNode);
|
|
864
|
+
const E = (z = I.parentElement) == null ? void 0 : z.closest(
|
|
865
865
|
fe["rp-text-layer"]
|
|
866
|
-
),
|
|
867
|
-
|
|
866
|
+
), D = E == null ? void 0 : E.querySelector(".endOfContent");
|
|
867
|
+
D && E && (D.style.width = E.style.width, D.style.height = E.style.height, (L = I.parentElement) == null || L.insertBefore(D, I.nextSibling)), _ = R.cloneRange();
|
|
868
868
|
},
|
|
869
869
|
{ signal: u }
|
|
870
870
|
);
|
|
@@ -872,12 +872,12 @@ const Nr = () => {
|
|
|
872
872
|
var u;
|
|
873
873
|
(u = C.current) == null || u.abort(), C.current = void 0;
|
|
874
874
|
}), [v]);
|
|
875
|
-
const y =
|
|
875
|
+
const y = N(() => {
|
|
876
876
|
r.current && r.current.classList.add(fe.selecting);
|
|
877
|
-
}, []), g =
|
|
877
|
+
}, []), g = N(() => {
|
|
878
878
|
r.current && r.current.classList.remove(fe.selecting);
|
|
879
879
|
}, []);
|
|
880
|
-
return
|
|
880
|
+
return A(() => {
|
|
881
881
|
if (P.current.forEach((s) => {
|
|
882
882
|
s.classList.remove("selected");
|
|
883
883
|
}), !l.length || !i || i.pageIndex !== e - 1)
|
|
@@ -891,7 +891,7 @@ const Nr = () => {
|
|
|
891
891
|
u.length && (P.current = u.map((s) => s.element), c(u[0].element), u.forEach((s) => {
|
|
892
892
|
s.element.classList.add("selected");
|
|
893
893
|
}));
|
|
894
|
-
}, [i, l, h]),
|
|
894
|
+
}, [i, l, h]), A(() => {
|
|
895
895
|
const p = n.get(e);
|
|
896
896
|
if (!p || !r.current)
|
|
897
897
|
return;
|
|
@@ -904,20 +904,20 @@ const Nr = () => {
|
|
|
904
904
|
container: u
|
|
905
905
|
}), m.current = s, u && (u.innerText = ""), f.current.render();
|
|
906
906
|
}).then(() => {
|
|
907
|
-
var x,
|
|
907
|
+
var x, R;
|
|
908
908
|
[].slice.call(u.children).forEach((S) => {
|
|
909
909
|
S.classList.add(fe["rp-text-layer-text"]), S.setAttribute("data-rp", "rp-text-layer-text");
|
|
910
910
|
});
|
|
911
911
|
const _ = (x = f.current) == null ? void 0 : x.textDivs;
|
|
912
912
|
_ && m.current && T(m.current, _);
|
|
913
913
|
const w = document.createElement("div");
|
|
914
|
-
w.className = "endOfContent", (
|
|
914
|
+
w.className = "endOfContent", (R = r.current) == null || R.appendChild(w);
|
|
915
915
|
}).catch(() => {
|
|
916
916
|
}), () => {
|
|
917
917
|
var s;
|
|
918
918
|
(s = f.current) == null || s.cancel();
|
|
919
919
|
};
|
|
920
|
-
}, [n, e]),
|
|
920
|
+
}, [n, e]), A(() => {
|
|
921
921
|
var s;
|
|
922
922
|
[].slice.call(r.current.children).forEach((_) => {
|
|
923
923
|
_.classList.add(fe["rp-text-layer-text"]);
|
|
@@ -940,24 +940,24 @@ const Nr = () => {
|
|
|
940
940
|
};
|
|
941
941
|
let Wr = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
942
942
|
const Hr = (t) => {
|
|
943
|
-
const { pageNumber: e } = t, n = W(null), { pages: r, pdf: o } = oe(), i = W(), [c, l] = q(), { setFocusedPage: d, goToPage: f } = le(), { scrollMode: m } = Ee(), { print: P } = tt(), { download: h } = Gn(), T =
|
|
944
|
-
|
|
943
|
+
const { pageNumber: e } = t, n = W(null), { pages: r, pdf: o } = oe(), i = W(), [c, l] = q(), { setFocusedPage: d, goToPage: f } = le(), { scrollMode: m } = Ee(), { print: P } = tt(), { download: h } = Gn(), T = F(() => r.get(e), [r, e]), C = F(() => T == null ? void 0 : T.page.getViewport(), [T]);
|
|
944
|
+
A(() => {
|
|
945
945
|
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
946
|
-
}, [o]),
|
|
946
|
+
}, [o]), A(() => {
|
|
947
947
|
T && T.page.getAnnotations().then((v) => {
|
|
948
948
|
i.current = void 0, l(v), n.current && (n.current.innerText = "");
|
|
949
949
|
});
|
|
950
950
|
}, [T]);
|
|
951
|
-
const b =
|
|
951
|
+
const b = N(
|
|
952
952
|
(v) => {
|
|
953
953
|
!c || !o || (Uo(v), Vo(v, o, c).then((y) => {
|
|
954
954
|
var g, p;
|
|
955
955
|
((g = y == null ? void 0 : y.data) == null ? void 0 : g.action) === "Print" ? P() : ((p = y == null ? void 0 : y.data) == null ? void 0 : p.action) === "SaveAs" && h();
|
|
956
|
-
}), m === ne.PAGE_SCROLLING ?
|
|
956
|
+
}), m === ne.PAGE_SCROLLING ? Ft(v, c, o, (y) => d(y.pageIndex + 1)) : Ft(v, c, o, (y) => f(y.pageIndex + 1)));
|
|
957
957
|
},
|
|
958
958
|
[o, c, f, d, m, P, h]
|
|
959
959
|
);
|
|
960
|
-
return
|
|
960
|
+
return A(() => {
|
|
961
961
|
if (!T || !c)
|
|
962
962
|
return;
|
|
963
963
|
const v = T.page.getViewport();
|
|
@@ -1029,9 +1029,9 @@ const Hr = (t) => {
|
|
|
1029
1029
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1030
1030
|
}, qr = ({ pageNumber: t, viewport: e }) => {
|
|
1031
1031
|
const [n, r] = q(), { pages: o } = oe(), { highlightKeywords: i } = _o(), c = !0, l = W(null), [d, f] = q(null), [m, P] = q([]);
|
|
1032
|
-
|
|
1032
|
+
A(() => {
|
|
1033
1033
|
l.current && f(l.current.parentElement);
|
|
1034
|
-
}, [l]),
|
|
1034
|
+
}, [l]), A(() => {
|
|
1035
1035
|
(async () => {
|
|
1036
1036
|
const p = o.get(t);
|
|
1037
1037
|
if (!p || !l.current)
|
|
@@ -1040,7 +1040,7 @@ const Hr = (t) => {
|
|
|
1040
1040
|
r(u);
|
|
1041
1041
|
})();
|
|
1042
1042
|
}, [o, t]);
|
|
1043
|
-
const h =
|
|
1043
|
+
const h = F(() => i ? i.map((g) => {
|
|
1044
1044
|
var p, u;
|
|
1045
1045
|
return {
|
|
1046
1046
|
...Zo(g.keyword, (p = g.options) == null ? void 0 : p.matchCase, (u = g.options) == null ? void 0 : u.wholeWords),
|
|
@@ -1057,9 +1057,9 @@ const Hr = (t) => {
|
|
|
1057
1057
|
s(_);
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
|
-
new MutationObserver((x,
|
|
1060
|
+
new MutationObserver((x, R) => {
|
|
1061
1061
|
const S = g.querySelector(u);
|
|
1062
|
-
S && (s(S),
|
|
1062
|
+
S && (s(S), R.disconnect());
|
|
1063
1063
|
}).observe(g, { childList: !0, subtree: !0 });
|
|
1064
1064
|
});
|
|
1065
1065
|
}
|
|
@@ -1085,17 +1085,17 @@ const Hr = (t) => {
|
|
|
1085
1085
|
const _ = document.createRange(), w = u.firstChild;
|
|
1086
1086
|
if (!w || w.nodeType !== Node.TEXT_NODE)
|
|
1087
1087
|
return null;
|
|
1088
|
-
const x = ((B = w.textContent) == null ? void 0 : B.length) ?? 0,
|
|
1089
|
-
if (
|
|
1088
|
+
const x = ((B = w.textContent) == null ? void 0 : B.length) ?? 0, R = s[0].charIdxInSpan, S = s.length === 1 ? R : s[s.length - 1].charIdxInSpan;
|
|
1089
|
+
if (R > x || S + 1 > x)
|
|
1090
1090
|
return null;
|
|
1091
|
-
_.setStart(w,
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
const
|
|
1095
|
-
return Qo(
|
|
1091
|
+
_.setStart(w, R), _.setEnd(w, S + 1);
|
|
1092
|
+
const I = document.createElement("span");
|
|
1093
|
+
I.style.width = "auto", _.surroundContents(I);
|
|
1094
|
+
const E = I.getBoundingClientRect(), D = g.getBoundingClientRect(), z = D.height, L = D.width, O = 100 * (E.left - D.left) / L, M = 100 * (E.top - D.top) / z, $ = 100 * E.height / z, k = 100 * E.width / L;
|
|
1095
|
+
return Qo(I), {
|
|
1096
1096
|
keywordStr: p,
|
|
1097
1097
|
left: O,
|
|
1098
|
-
top:
|
|
1098
|
+
top: M,
|
|
1099
1099
|
height: $,
|
|
1100
1100
|
width: k,
|
|
1101
1101
|
pageHeight: z,
|
|
@@ -1109,10 +1109,10 @@ const Hr = (t) => {
|
|
|
1109
1109
|
const s = await C(u);
|
|
1110
1110
|
if (s.length) {
|
|
1111
1111
|
const _ = s.map((x) => x.tagName === "BR" ? " " : x.textContent).reduce(
|
|
1112
|
-
(x,
|
|
1113
|
-
|
|
1114
|
-
char:
|
|
1115
|
-
charIdxInSpan:
|
|
1112
|
+
(x, R, S) => x.concat(
|
|
1113
|
+
R.split("").map((I, E) => ({
|
|
1114
|
+
char: I,
|
|
1115
|
+
charIdxInSpan: E,
|
|
1116
1116
|
spanIdx: S
|
|
1117
1117
|
}))
|
|
1118
1118
|
),
|
|
@@ -1131,24 +1131,24 @@ const Hr = (t) => {
|
|
|
1131
1131
|
const _ = p.length;
|
|
1132
1132
|
if (!s.length || !_)
|
|
1133
1133
|
return [];
|
|
1134
|
-
const w = [], x = s.map((
|
|
1135
|
-
return h.forEach((
|
|
1136
|
-
const { keyword: S, regExp:
|
|
1134
|
+
const w = [], x = s.map((R) => R.char).join("");
|
|
1135
|
+
return h.forEach((R) => {
|
|
1136
|
+
const { keyword: S, regExp: I, wholeWords: E, color: D } = R, z = S;
|
|
1137
1137
|
if (!z.trim())
|
|
1138
1138
|
return;
|
|
1139
|
-
const L =
|
|
1139
|
+
const L = I.flags.indexOf("g") === -1 ? new RegExp(I, `${I.flags}g`) : I;
|
|
1140
1140
|
let O;
|
|
1141
|
-
const
|
|
1141
|
+
const M = [];
|
|
1142
1142
|
for (; (O = L.exec(x)) !== null; )
|
|
1143
|
-
|
|
1143
|
+
E && !wo(x, O.index, O[0].length) || M.push({
|
|
1144
1144
|
keyword: L,
|
|
1145
1145
|
startIndex: O.index,
|
|
1146
1146
|
endIndex: L.lastIndex
|
|
1147
1147
|
});
|
|
1148
|
-
const $ =
|
|
1148
|
+
const $ = M.map((k) => ({
|
|
1149
1149
|
keyword: k.keyword,
|
|
1150
1150
|
indexes: s.slice(k.startIndex, k.endIndex),
|
|
1151
|
-
color:
|
|
1151
|
+
color: D
|
|
1152
1152
|
}));
|
|
1153
1153
|
for (const k of $) {
|
|
1154
1154
|
const B = k.indexes.reduce(
|
|
@@ -1173,7 +1173,7 @@ const Hr = (t) => {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
}), w.sort(Xo), w;
|
|
1175
1175
|
};
|
|
1176
|
-
return
|
|
1176
|
+
return A(() => {
|
|
1177
1177
|
(async () => {
|
|
1178
1178
|
if (!(!i || i.length === 0))
|
|
1179
1179
|
try {
|
|
@@ -1202,8 +1202,8 @@ const Hr = (t) => {
|
|
|
1202
1202
|
height: 0
|
|
1203
1203
|
});
|
|
1204
1204
|
on(e, () => T.current);
|
|
1205
|
-
const v =
|
|
1206
|
-
|
|
1205
|
+
const v = F(() => m.current ? c[n] : 0, [n, c]);
|
|
1206
|
+
A(() => {
|
|
1207
1207
|
if (i && (m.current = i.get(n), m.current)) {
|
|
1208
1208
|
const u = m.current.page.getViewport({
|
|
1209
1209
|
scale: d,
|
|
@@ -1212,7 +1212,7 @@ const Hr = (t) => {
|
|
|
1212
1212
|
b(u);
|
|
1213
1213
|
}
|
|
1214
1214
|
}, [i, n, v, d]);
|
|
1215
|
-
const y =
|
|
1215
|
+
const y = F(() => {
|
|
1216
1216
|
switch (v) {
|
|
1217
1217
|
case 90:
|
|
1218
1218
|
return `${C.width / 2}px ${C.width / 2}px`;
|
|
@@ -1222,9 +1222,9 @@ const Hr = (t) => {
|
|
|
1222
1222
|
default:
|
|
1223
1223
|
return "center";
|
|
1224
1224
|
}
|
|
1225
|
-
}, [v, C]), g =
|
|
1225
|
+
}, [v, C]), g = N(() => {
|
|
1226
1226
|
h(!0);
|
|
1227
|
-
}, []), p =
|
|
1227
|
+
}, []), p = N(() => {
|
|
1228
1228
|
h(!1);
|
|
1229
1229
|
}, []);
|
|
1230
1230
|
return /* @__PURE__ */ a(
|
|
@@ -1253,7 +1253,7 @@ const Hr = (t) => {
|
|
|
1253
1253
|
/* @__PURE__ */ a(Ar, { onLoading: g, onLoaded: p, pageNumber: n }),
|
|
1254
1254
|
P && f && /* @__PURE__ */ a("div", { className: st["rp-loader-wrapper"], children: /* @__PURE__ */ a(f, {}) }),
|
|
1255
1255
|
/* @__PURE__ */ a(Yo, { pageNumber: n }),
|
|
1256
|
-
l && /* @__PURE__ */ a(
|
|
1256
|
+
l && /* @__PURE__ */ a(Fr, { pageNumber: n }),
|
|
1257
1257
|
/* @__PURE__ */ a(qr, { pageNumber: n, viewport: C }),
|
|
1258
1258
|
/* @__PURE__ */ a(Hr, { pageNumber: n })
|
|
1259
1259
|
]
|
|
@@ -1378,32 +1378,32 @@ function Qr(t) {
|
|
|
1378
1378
|
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1379
1379
|
scrollUpdateWasRequested: !1,
|
|
1380
1380
|
verticalScrollDirection: "forward"
|
|
1381
|
-
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = ct(function(_, w, x,
|
|
1381
|
+
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = ct(function(_, w, x, R, S, I, E, D) {
|
|
1382
1382
|
return s.props.onItemsRendered({
|
|
1383
1383
|
overscanColumnStartIndex: _,
|
|
1384
1384
|
overscanColumnStopIndex: w,
|
|
1385
1385
|
overscanRowStartIndex: x,
|
|
1386
|
-
overscanRowStopIndex:
|
|
1386
|
+
overscanRowStopIndex: R,
|
|
1387
1387
|
visibleColumnStartIndex: S,
|
|
1388
|
-
visibleColumnStopIndex:
|
|
1389
|
-
visibleRowStartIndex:
|
|
1390
|
-
visibleRowStopIndex:
|
|
1388
|
+
visibleColumnStopIndex: I,
|
|
1389
|
+
visibleRowStartIndex: E,
|
|
1390
|
+
visibleRowStopIndex: D
|
|
1391
1391
|
});
|
|
1392
|
-
}), s._callOnScroll = void 0, s._callOnScroll = ct(function(_, w, x,
|
|
1392
|
+
}), s._callOnScroll = void 0, s._callOnScroll = ct(function(_, w, x, R, S) {
|
|
1393
1393
|
return s.props.onScroll({
|
|
1394
1394
|
horizontalScrollDirection: x,
|
|
1395
1395
|
scrollLeft: _,
|
|
1396
1396
|
scrollTop: w,
|
|
1397
|
-
verticalScrollDirection:
|
|
1397
|
+
verticalScrollDirection: R,
|
|
1398
1398
|
scrollUpdateWasRequested: S
|
|
1399
1399
|
});
|
|
1400
1400
|
}), s._getItemStyle = void 0, s._getItemStyle = function(_, w) {
|
|
1401
|
-
var x = s.props,
|
|
1402
|
-
if (
|
|
1403
|
-
z =
|
|
1401
|
+
var x = s.props, R = x.columnWidth, S = x.direction, I = x.rowHeight, E = s._getItemStyleCache(b && R, b && S, b && I), D = _ + ":" + w, z;
|
|
1402
|
+
if (E.hasOwnProperty(D))
|
|
1403
|
+
z = E[D];
|
|
1404
1404
|
else {
|
|
1405
1405
|
var L = n(s.props, w, s._instanceProps), O = S === "rtl";
|
|
1406
|
-
|
|
1406
|
+
E[D] = z = {
|
|
1407
1407
|
position: "absolute",
|
|
1408
1408
|
left: O ? void 0 : L,
|
|
1409
1409
|
right: O ? L : void 0,
|
|
@@ -1416,9 +1416,9 @@ function Qr(t) {
|
|
|
1416
1416
|
}, s._getItemStyleCache = void 0, s._getItemStyleCache = ct(function(_, w, x) {
|
|
1417
1417
|
return {};
|
|
1418
1418
|
}), s._onScroll = function(_) {
|
|
1419
|
-
var w = _.currentTarget, x = w.clientHeight,
|
|
1419
|
+
var w = _.currentTarget, x = w.clientHeight, R = w.clientWidth, S = w.scrollLeft, I = w.scrollTop, E = w.scrollHeight, D = w.scrollWidth;
|
|
1420
1420
|
s.setState(function(z) {
|
|
1421
|
-
if (z.scrollLeft === S && z.scrollTop ===
|
|
1421
|
+
if (z.scrollLeft === S && z.scrollTop === I)
|
|
1422
1422
|
return null;
|
|
1423
1423
|
var L = s.props.direction, O = S;
|
|
1424
1424
|
if (L === "rtl")
|
|
@@ -1427,17 +1427,17 @@ function Qr(t) {
|
|
|
1427
1427
|
O = -S;
|
|
1428
1428
|
break;
|
|
1429
1429
|
case "positive-descending":
|
|
1430
|
-
O =
|
|
1430
|
+
O = D - R - S;
|
|
1431
1431
|
break;
|
|
1432
1432
|
}
|
|
1433
|
-
O = Math.max(0, Math.min(O,
|
|
1434
|
-
var
|
|
1433
|
+
O = Math.max(0, Math.min(O, D - R));
|
|
1434
|
+
var M = Math.max(0, Math.min(I, E - x));
|
|
1435
1435
|
return {
|
|
1436
1436
|
isScrolling: !0,
|
|
1437
1437
|
horizontalScrollDirection: z.scrollLeft < S ? "forward" : "backward",
|
|
1438
1438
|
scrollLeft: O,
|
|
1439
|
-
scrollTop:
|
|
1440
|
-
verticalScrollDirection: z.scrollTop <
|
|
1439
|
+
scrollTop: M,
|
|
1440
|
+
verticalScrollDirection: z.scrollTop < I ? "forward" : "backward",
|
|
1441
1441
|
scrollUpdateWasRequested: !1
|
|
1442
1442
|
};
|
|
1443
1443
|
}, s._resetIsScrollingDebounced);
|
|
@@ -1470,12 +1470,12 @@ function Qr(t) {
|
|
|
1470
1470
|
};
|
|
1471
1471
|
}, this._resetIsScrollingDebounced);
|
|
1472
1472
|
}, p.scrollToItem = function(s) {
|
|
1473
|
-
var _ = s.align, w = _ === void 0 ? "auto" : _, x = s.columnIndex,
|
|
1474
|
-
x !== void 0 && (x = Math.max(0, Math.min(x,
|
|
1475
|
-
var k = c(this.props, this._instanceProps), B = l(this.props, this._instanceProps), Z = B > z ? $ : 0, U = k >
|
|
1473
|
+
var _ = s.align, w = _ === void 0 ? "auto" : _, x = s.columnIndex, R = s.rowIndex, S = this.props, I = S.columnCount, E = S.height, D = S.rowCount, z = S.width, L = this.state, O = L.scrollLeft, M = L.scrollTop, $ = Kr();
|
|
1474
|
+
x !== void 0 && (x = Math.max(0, Math.min(x, I - 1))), R !== void 0 && (R = Math.max(0, Math.min(R, D - 1)));
|
|
1475
|
+
var k = c(this.props, this._instanceProps), B = l(this.props, this._instanceProps), Z = B > z ? $ : 0, U = k > E ? $ : 0;
|
|
1476
1476
|
this.scrollTo({
|
|
1477
1477
|
scrollLeft: x !== void 0 ? d(this.props, x, w, O, this._instanceProps, U) : O,
|
|
1478
|
-
scrollTop:
|
|
1478
|
+
scrollTop: R !== void 0 ? f(this.props, R, w, M, this._instanceProps, Z) : M
|
|
1479
1479
|
});
|
|
1480
1480
|
}, p.componentDidMount = function() {
|
|
1481
1481
|
var s = this.props, _ = s.initialScrollLeft, w = s.initialScrollTop;
|
|
@@ -1485,8 +1485,8 @@ function Qr(t) {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
this._callPropsCallbacks();
|
|
1487
1487
|
}, p.componentDidUpdate = function() {
|
|
1488
|
-
var s = this.props.direction, _ = this.state, w = _.scrollLeft, x = _.scrollTop,
|
|
1489
|
-
if (
|
|
1488
|
+
var s = this.props.direction, _ = this.state, w = _.scrollLeft, x = _.scrollTop, R = _.scrollUpdateWasRequested;
|
|
1489
|
+
if (R && this._outerRef != null) {
|
|
1490
1490
|
var S = this._outerRef;
|
|
1491
1491
|
if (s === "rtl")
|
|
1492
1492
|
switch (Vt()) {
|
|
@@ -1497,8 +1497,8 @@ function Qr(t) {
|
|
|
1497
1497
|
S.scrollLeft = w;
|
|
1498
1498
|
break;
|
|
1499
1499
|
default:
|
|
1500
|
-
var
|
|
1501
|
-
S.scrollLeft =
|
|
1500
|
+
var I = S.clientWidth, E = S.scrollWidth;
|
|
1501
|
+
S.scrollLeft = E - I - w;
|
|
1502
1502
|
break;
|
|
1503
1503
|
}
|
|
1504
1504
|
else
|
|
@@ -1509,7 +1509,7 @@ function Qr(t) {
|
|
|
1509
1509
|
}, p.componentWillUnmount = function() {
|
|
1510
1510
|
this._resetIsScrollingTimeoutId !== null && Ut(this._resetIsScrollingTimeoutId);
|
|
1511
1511
|
}, p.render = function() {
|
|
1512
|
-
var s = this.props, _ = s.children, w = s.className, x = s.columnCount,
|
|
1512
|
+
var s = this.props, _ = s.children, w = s.className, x = s.columnCount, R = s.direction, S = s.height, I = s.innerRef, E = s.innerElementType, D = s.innerTagName, z = s.itemData, L = s.itemKey, O = L === void 0 ? Xr : L, M = s.outerElementType, $ = s.outerTagName, k = s.rowCount, B = s.style, Z = s.useIsScrolling, U = s.width, ie = this.state.isScrolling, G = this._getHorizontalRangeToRender(), K = G[0], Y = G[1], J = this._getVerticalRangeToRender(), ee = J[0], re = J[1], ve = [];
|
|
1513
1513
|
if (x > 0 && k)
|
|
1514
1514
|
for (var de = ee; de <= re; de++)
|
|
1515
1515
|
for (var Pe = K; Pe <= Y; Pe++)
|
|
@@ -1525,8 +1525,8 @@ function Qr(t) {
|
|
|
1525
1525
|
rowIndex: de,
|
|
1526
1526
|
style: this._getItemStyle(de, Pe)
|
|
1527
1527
|
}));
|
|
1528
|
-
var
|
|
1529
|
-
return Ve(
|
|
1528
|
+
var Fe = c(this.props, this._instanceProps), nt = l(this.props, this._instanceProps);
|
|
1529
|
+
return Ve(M || $ || "div", {
|
|
1530
1530
|
className: w,
|
|
1531
1531
|
onScroll: this._onScroll,
|
|
1532
1532
|
ref: this._outerRefSetter,
|
|
@@ -1537,39 +1537,39 @@ function Qr(t) {
|
|
|
1537
1537
|
overflow: "auto",
|
|
1538
1538
|
WebkitOverflowScrolling: "touch",
|
|
1539
1539
|
willChange: "transform",
|
|
1540
|
-
direction:
|
|
1540
|
+
direction: R
|
|
1541
1541
|
}, B)
|
|
1542
|
-
}, Ve(
|
|
1542
|
+
}, Ve(E || D || "div", {
|
|
1543
1543
|
children: ve,
|
|
1544
|
-
ref:
|
|
1544
|
+
ref: I,
|
|
1545
1545
|
style: {
|
|
1546
|
-
height:
|
|
1546
|
+
height: Fe,
|
|
1547
1547
|
pointerEvents: ie ? "none" : void 0,
|
|
1548
1548
|
width: nt
|
|
1549
1549
|
}
|
|
1550
1550
|
}));
|
|
1551
1551
|
}, p._callPropsCallbacks = function() {
|
|
1552
|
-
var s = this.props, _ = s.columnCount, w = s.onItemsRendered, x = s.onScroll,
|
|
1553
|
-
if (typeof w == "function" && _ > 0 &&
|
|
1554
|
-
var S = this._getHorizontalRangeToRender(),
|
|
1555
|
-
this._callOnItemsRendered(
|
|
1552
|
+
var s = this.props, _ = s.columnCount, w = s.onItemsRendered, x = s.onScroll, R = s.rowCount;
|
|
1553
|
+
if (typeof w == "function" && _ > 0 && R > 0) {
|
|
1554
|
+
var S = this._getHorizontalRangeToRender(), I = S[0], E = S[1], D = S[2], z = S[3], L = this._getVerticalRangeToRender(), O = L[0], M = L[1], $ = L[2], k = L[3];
|
|
1555
|
+
this._callOnItemsRendered(I, E, O, M, D, z, $, k);
|
|
1556
1556
|
}
|
|
1557
1557
|
if (typeof x == "function") {
|
|
1558
1558
|
var B = this.state, Z = B.horizontalScrollDirection, U = B.scrollLeft, ie = B.scrollTop, G = B.scrollUpdateWasRequested, K = B.verticalScrollDirection;
|
|
1559
1559
|
this._callOnScroll(U, ie, Z, K, G);
|
|
1560
1560
|
}
|
|
1561
1561
|
}, p._getHorizontalRangeToRender = function() {
|
|
1562
|
-
var s = this.props, _ = s.columnCount, w = s.overscanColumnCount, x = s.overscanColumnsCount,
|
|
1562
|
+
var s = this.props, _ = s.columnCount, w = s.overscanColumnCount, x = s.overscanColumnsCount, R = s.overscanCount, S = s.rowCount, I = this.state, E = I.horizontalScrollDirection, D = I.isScrolling, z = I.scrollLeft, L = w || x || R || 1;
|
|
1563
1563
|
if (_ === 0 || S === 0)
|
|
1564
1564
|
return [0, 0, 0, 0];
|
|
1565
|
-
var O = r(this.props, z, this._instanceProps),
|
|
1566
|
-
return [Math.max(0, O - $), Math.max(0, Math.min(_ - 1,
|
|
1565
|
+
var O = r(this.props, z, this._instanceProps), M = o(this.props, O, z, this._instanceProps), $ = !D || E === "backward" ? Math.max(1, L) : 1, k = !D || E === "forward" ? Math.max(1, L) : 1;
|
|
1566
|
+
return [Math.max(0, O - $), Math.max(0, Math.min(_ - 1, M + k)), O, M];
|
|
1567
1567
|
}, p._getVerticalRangeToRender = function() {
|
|
1568
|
-
var s = this.props, _ = s.columnCount, w = s.overscanCount, x = s.overscanRowCount,
|
|
1568
|
+
var s = this.props, _ = s.columnCount, w = s.overscanCount, x = s.overscanRowCount, R = s.overscanRowsCount, S = s.rowCount, I = this.state, E = I.isScrolling, D = I.verticalScrollDirection, z = I.scrollTop, L = x || R || w || 1;
|
|
1569
1569
|
if (_ === 0 || S === 0)
|
|
1570
1570
|
return [0, 0, 0, 0];
|
|
1571
|
-
var O = h(this.props, z, this._instanceProps),
|
|
1572
|
-
return [Math.max(0, O - $), Math.max(0, Math.min(S - 1,
|
|
1571
|
+
var O = h(this.props, z, this._instanceProps), M = T(this.props, O, z, this._instanceProps), $ = !E || D === "backward" ? Math.max(1, L) : 1, k = !E || D === "forward" ? Math.max(1, L) : 1;
|
|
1572
|
+
return [Math.max(0, O - $), Math.max(0, Math.min(S - 1, M + k)), O, M];
|
|
1573
1573
|
}, g;
|
|
1574
1574
|
}(oo), e.defaultProps = {
|
|
1575
1575
|
direction: "ltr",
|
|
@@ -1746,16 +1746,16 @@ function oi(t, e) {
|
|
|
1746
1746
|
return !Zt(n, o) && !Zt(r, i);
|
|
1747
1747
|
}
|
|
1748
1748
|
const ri = () => {
|
|
1749
|
-
const { viewMode: t } =
|
|
1749
|
+
const { viewMode: t } = Me(), { scrollMode: e } = Ee(), { setColumnCount: n } = sn(), { virtualScrollableElementRef: r } = Ye(), o = Ge(), i = F(() => o.heights.length, [o.heights]), c = F(() => e === ne.HORIZONTAL_SCROLLING ? i : t === Re.DUAL_PAGE ? 2 : 1, [t, e, e, i, r]), l = F(() => o.widths.reduce((v, y, g) => {
|
|
1750
1750
|
const p = g % c;
|
|
1751
1751
|
return (!v[p] || y > v[p]) && (v[p] = y), v;
|
|
1752
|
-
}, []), [o.widths, c]), d =
|
|
1752
|
+
}, []), [o.widths, c]), d = N(
|
|
1753
1753
|
(b) => {
|
|
1754
1754
|
const v = b % l.length;
|
|
1755
1755
|
return l[v] || 0;
|
|
1756
1756
|
},
|
|
1757
1757
|
[l]
|
|
1758
|
-
), f =
|
|
1758
|
+
), f = N(
|
|
1759
1759
|
(b) => {
|
|
1760
1760
|
const v = Array.from({ length: c }, (y, g) => {
|
|
1761
1761
|
const p = b * c + g;
|
|
@@ -1765,16 +1765,16 @@ const ri = () => {
|
|
|
1765
1765
|
},
|
|
1766
1766
|
[o.heights, c]
|
|
1767
1767
|
);
|
|
1768
|
-
|
|
1768
|
+
A(() => {
|
|
1769
1769
|
n(c);
|
|
1770
1770
|
}, [c, n]);
|
|
1771
|
-
const m =
|
|
1771
|
+
const m = F(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / c), [c, i, e]), P = F(() => o.heights.reduce((b, v) => b + v, 0) / o.heights.length || 0, [o]), h = F(() => o.widths.reduce((b, v) => b + v, 0) / o.widths.length || 0, [o]), T = F(() => {
|
|
1772
1772
|
const { rowsHeight: b, columnsWidth: v } = bt(o, c);
|
|
1773
1773
|
return {
|
|
1774
1774
|
rowsHeight: b,
|
|
1775
1775
|
columnsWidth: v
|
|
1776
1776
|
};
|
|
1777
|
-
}, [o, c]), C =
|
|
1777
|
+
}, [o, c]), C = F(() => ({
|
|
1778
1778
|
width: T.columnsWidth.reduce((b, v) => b + v, 0),
|
|
1779
1779
|
height: T.rowsHeight.reduce((b, v) => b + v, 0)
|
|
1780
1780
|
}), [T]);
|
|
@@ -1958,14 +1958,14 @@ class ai extends ro {
|
|
|
1958
1958
|
}
|
|
1959
1959
|
}
|
|
1960
1960
|
const si = rn(({ widths: t, heights: e }) => {
|
|
1961
|
-
const { focusedPage: n, totalPages: r } = le(), o =
|
|
1961
|
+
const { focusedPage: n, totalPages: r } = le(), o = F(() => {
|
|
1962
1962
|
const l = [], d = Math.ceil(n / 2) * 2 - 1;
|
|
1963
1963
|
if (l.push(d), d + 1 <= r) {
|
|
1964
1964
|
const f = d + 1;
|
|
1965
1965
|
l.push(f);
|
|
1966
1966
|
}
|
|
1967
1967
|
return l;
|
|
1968
|
-
}, [n, r]), i =
|
|
1968
|
+
}, [n, r]), i = F(() => {
|
|
1969
1969
|
const l = n % 2 === 1 ? n - 1 : n - 2, d = Math.floor(l / 2), f = e(d), m = t(l), P = t(l + 1);
|
|
1970
1970
|
return [
|
|
1971
1971
|
{
|
|
@@ -1981,14 +1981,14 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
1981
1981
|
height: f
|
|
1982
1982
|
}
|
|
1983
1983
|
];
|
|
1984
|
-
}, [t, e, o]), c =
|
|
1984
|
+
}, [t, e, o]), c = F(() => i.reduce((l, d) => l + Number(d.width || 0), 0), [i]);
|
|
1985
1985
|
return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: o.map((l, d) => /* @__PURE__ */ a(xt, { style: i[d], pageNumber: l }, l)) });
|
|
1986
1986
|
}), ci = ({ widths: t, heights: e }) => {
|
|
1987
|
-
const { focusedPage: n } = le(), r =
|
|
1987
|
+
const { focusedPage: n } = le(), r = F(() => ({
|
|
1988
1988
|
position: "absolute",
|
|
1989
1989
|
width: t(n - 1),
|
|
1990
1990
|
height: e(n - 1)
|
|
1991
|
-
}), [t, e, n]), o =
|
|
1991
|
+
}), [t, e, n]), o = F(() => t(n - 1), [t]);
|
|
1992
1992
|
return /* @__PURE__ */ a(
|
|
1993
1993
|
"div",
|
|
1994
1994
|
{
|
|
@@ -2000,10 +2000,10 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2000
2000
|
}
|
|
2001
2001
|
);
|
|
2002
2002
|
}, li = (t, e, n) => {
|
|
2003
|
-
const r = W(), { contentRef: o } = _e(), { heights: i, widths: c } = Ge(), { setFocusedPage: l } = le(), [d, f] = q([]), { targetScrollPage: m } = cn(), P = Tt(d, 0, 500), h =
|
|
2003
|
+
const r = W(), { contentRef: o } = _e(), { heights: i, widths: c } = Ge(), { setFocusedPage: l } = le(), [d, f] = q([]), { targetScrollPage: m } = cn(), P = Tt(d, 0, 500), h = F(() => {
|
|
2004
2004
|
const { rowsHeight: C, columnsWidth: b } = bt({ heights: i, widths: c }, t);
|
|
2005
2005
|
return i.map((v, y) => {
|
|
2006
|
-
const g = c[y], p = Jo(y + 1, t), u = b.slice(0, p.columnIndex).reduce((x,
|
|
2006
|
+
const g = c[y], p = Jo(y + 1, t), u = b.slice(0, p.columnIndex).reduce((x, R) => x + R, 0), s = C.slice(0, p.rowIndex).reduce((x, R) => x + R, 0), _ = u + g, w = s + v;
|
|
2007
2007
|
return {
|
|
2008
2008
|
pageNumber: y + 1,
|
|
2009
2009
|
...p,
|
|
@@ -2016,13 +2016,13 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2016
2016
|
};
|
|
2017
2017
|
});
|
|
2018
2018
|
}, [i, c, t, e]);
|
|
2019
|
-
|
|
2019
|
+
A(() => {
|
|
2020
2020
|
var b;
|
|
2021
2021
|
P.length > 0 && !m.current && l(P[0].pageNumber), ((b = P[0]) == null ? void 0 : b.ratio) && P.some((v) => v.pageNumber === m.current) && setTimeout(() => {
|
|
2022
2022
|
m.current = void 0;
|
|
2023
2023
|
}, 500);
|
|
2024
2024
|
}, [P, l]);
|
|
2025
|
-
const T =
|
|
2025
|
+
const T = N(
|
|
2026
2026
|
(C) => {
|
|
2027
2027
|
r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
2028
2028
|
const b = C.target, v = {
|
|
@@ -2045,7 +2045,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2045
2045
|
},
|
|
2046
2046
|
[o, h]
|
|
2047
2047
|
);
|
|
2048
|
-
|
|
2048
|
+
A(() => {
|
|
2049
2049
|
if (n)
|
|
2050
2050
|
return n == null || n.addEventListener("scroll", T), () => {
|
|
2051
2051
|
n == null || n.removeEventListener("scroll", T);
|
|
@@ -2086,14 +2086,14 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2086
2086
|
virtualScrollableElementRef: h,
|
|
2087
2087
|
totalInnerDimensions: T,
|
|
2088
2088
|
pageScrollElementRef: C
|
|
2089
|
-
} = Ye(), b = W(!0), { nextPage: v, prevPage: y, setFocusedPage: g, focusedPage: p } = le(), { scrollMode: u } = Ee(), { viewMode: s } =
|
|
2089
|
+
} = Ye(), b = W(!0), { nextPage: v, prevPage: y, setFocusedPage: g, focusedPage: p } = le(), { scrollMode: u } = Ee(), { viewMode: s } = Me(), _ = W(null), { loading: w, error: x } = oe(), { passwordRequired: R } = co(), { LoaderImageComponent: S } = _t(), I = W(
|
|
2090
2090
|
T
|
|
2091
|
-
),
|
|
2091
|
+
), E = W({
|
|
2092
2092
|
viewMode: s,
|
|
2093
2093
|
scrollMode: u
|
|
2094
|
-
}),
|
|
2094
|
+
}), D = W(!1), z = W(), { isFullScreen: L } = fo(), {
|
|
2095
2095
|
pageDimension: O,
|
|
2096
|
-
rowCount:
|
|
2096
|
+
rowCount: M,
|
|
2097
2097
|
rowHeight: $,
|
|
2098
2098
|
columnCount: k,
|
|
2099
2099
|
columnWidth: B,
|
|
@@ -2101,7 +2101,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2101
2101
|
estimatedRowHeight: U,
|
|
2102
2102
|
totalDimension: ie
|
|
2103
2103
|
} = ri(), G = Tt(T, 100), K = W();
|
|
2104
|
-
li(k,
|
|
2104
|
+
li(k, M, h);
|
|
2105
2105
|
const Y = W({
|
|
2106
2106
|
scrollTop: 0,
|
|
2107
2107
|
scrollLeft: 0
|
|
@@ -2109,28 +2109,28 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2109
2109
|
or(r);
|
|
2110
2110
|
const { isPressed: J } = tr(), { selectionMode: ee } = po(), { initializeGrabScroll: re, resetGrabState: ve } = nr({
|
|
2111
2111
|
isPressed: J
|
|
2112
|
-
}), de =
|
|
2112
|
+
}), de = F(() => ee === ao.HAND, [ee]), Pe = F(() => ({
|
|
2113
2113
|
columnCount: k
|
|
2114
|
-
}), [k]),
|
|
2114
|
+
}), [k]), Fe = N(
|
|
2115
2115
|
(V) => {
|
|
2116
2116
|
const j = document.activeElement !== r;
|
|
2117
2117
|
!L && j || (["ArrowUp", "ArrowLeft"].includes(V.key) ? (V.preventDefault(), y()) : ["ArrowDown", "ArrowRight"].includes(V.key) && (V.preventDefault(), v()));
|
|
2118
2118
|
},
|
|
2119
2119
|
[v, y, L, u]
|
|
2120
2120
|
);
|
|
2121
|
-
|
|
2122
|
-
window.removeEventListener("keydown",
|
|
2123
|
-
}), [
|
|
2121
|
+
A(() => (window.addEventListener("keydown", Fe), () => {
|
|
2122
|
+
window.removeEventListener("keydown", Fe);
|
|
2123
|
+
}), [Fe]), A(() => {
|
|
2124
2124
|
if (_.current && (_.current.style.position = "relative"), !!l)
|
|
2125
|
-
for (let V = 0; V <
|
|
2125
|
+
for (let V = 0; V < M; V++)
|
|
2126
2126
|
for (let j = 0; j < k; j++)
|
|
2127
2127
|
l.resetAfterIndices({
|
|
2128
2128
|
columnIndex: j,
|
|
2129
2129
|
rowIndex: V,
|
|
2130
2130
|
shouldForceUpdate: !0
|
|
2131
2131
|
});
|
|
2132
|
-
}, [
|
|
2133
|
-
const nt =
|
|
2132
|
+
}, [M, k, O, l]);
|
|
2133
|
+
const nt = N(
|
|
2134
2134
|
(V, j) => {
|
|
2135
2135
|
if (!h)
|
|
2136
2136
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
@@ -2141,12 +2141,12 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2141
2141
|
};
|
|
2142
2142
|
},
|
|
2143
2143
|
[h]
|
|
2144
|
-
), Et =
|
|
2144
|
+
), Et = N(
|
|
2145
2145
|
(V, j) => {
|
|
2146
|
-
if (
|
|
2147
|
-
K.current && clearTimeout(K.current),
|
|
2146
|
+
if (E.current.viewMode !== s || E.current.scrollMode !== u) {
|
|
2147
|
+
K.current && clearTimeout(K.current), D.current = !0, c(p, "auto"), K.current = setTimeout(() => {
|
|
2148
2148
|
requestAnimationFrame(() => {
|
|
2149
|
-
|
|
2149
|
+
E.current = { viewMode: s, scrollMode: u };
|
|
2150
2150
|
});
|
|
2151
2151
|
}, 100);
|
|
2152
2152
|
return;
|
|
@@ -2154,8 +2154,8 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2154
2154
|
const xe = V.scrollTop, ot = V.scrollLeft;
|
|
2155
2155
|
if (!j.height || !j.width)
|
|
2156
2156
|
return;
|
|
2157
|
-
|
|
2158
|
-
const { height: Se, width: rt } = j, { height: Nt, width: Ot } =
|
|
2157
|
+
D.current = !0;
|
|
2158
|
+
const { height: Se, width: rt } = j, { height: Nt, width: Ot } = I.current;
|
|
2159
2159
|
if (Nt === Se && Ot === rt)
|
|
2160
2160
|
return;
|
|
2161
2161
|
const Jn = xe / Nt * Se, eo = ot / Ot * rt, to = Math.round(Math.min(Jn, Se)) || 0, no = Math.round(Math.min(eo, rt)) || 0;
|
|
@@ -2167,16 +2167,16 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2167
2167
|
behavior: "auto"
|
|
2168
2168
|
});
|
|
2169
2169
|
});
|
|
2170
|
-
}, 0),
|
|
2170
|
+
}, 0), I.current = {
|
|
2171
2171
|
height: j.height,
|
|
2172
2172
|
width: j.width
|
|
2173
2173
|
};
|
|
2174
2174
|
},
|
|
2175
2175
|
[h, s, u, c]
|
|
2176
2176
|
);
|
|
2177
|
-
|
|
2177
|
+
A(() => {
|
|
2178
2178
|
clearTimeout(z.current);
|
|
2179
|
-
const V = Array.from({ length:
|
|
2179
|
+
const V = Array.from({ length: M }).reduce(
|
|
2180
2180
|
(xe, ot, Se) => xe + $(Se),
|
|
2181
2181
|
0
|
|
2182
2182
|
), j = Array.from({ length: k }).reduce(
|
|
@@ -2187,8 +2187,8 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2187
2187
|
height: V,
|
|
2188
2188
|
width: j
|
|
2189
2189
|
});
|
|
2190
|
-
}, [O,
|
|
2191
|
-
const Xn =
|
|
2190
|
+
}, [O, M, k, Et]);
|
|
2191
|
+
const Xn = N(
|
|
2192
2192
|
(V) => {
|
|
2193
2193
|
Y.current = {
|
|
2194
2194
|
scrollTop: V.scrollTop,
|
|
@@ -2197,13 +2197,13 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2197
2197
|
},
|
|
2198
2198
|
[h]
|
|
2199
2199
|
);
|
|
2200
|
-
|
|
2200
|
+
A(() => () => {
|
|
2201
2201
|
K.current && clearTimeout(K.current);
|
|
2202
2202
|
}, []);
|
|
2203
|
-
const Qn =
|
|
2203
|
+
const Qn = F(() => se(ae["rp-pages-container"], {
|
|
2204
2204
|
[ae["rp-cursor-grab"]]: de && !J,
|
|
2205
2205
|
[ae["rp-cursor-grabbing"]]: de && J
|
|
2206
|
-
}), [de, J]), Yn =
|
|
2206
|
+
}), [de, J]), Yn = N(
|
|
2207
2207
|
(V) => {
|
|
2208
2208
|
if (de && V) {
|
|
2209
2209
|
const j = se(ae["rp-pages"]), ye = document.querySelector(`.${j}`);
|
|
@@ -2212,9 +2212,9 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2212
2212
|
},
|
|
2213
2213
|
[de, re, ae]
|
|
2214
2214
|
);
|
|
2215
|
-
return
|
|
2215
|
+
return A(() => {
|
|
2216
2216
|
w && ve();
|
|
2217
|
-
}, [w]),
|
|
2217
|
+
}, [w]), A(() => {
|
|
2218
2218
|
if (!(G.height === 0 || !b.current)) {
|
|
2219
2219
|
if (e === ne.PAGE_SCROLLING) {
|
|
2220
2220
|
t !== p && C && g(t), b.current = !1;
|
|
@@ -2259,7 +2259,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2259
2259
|
width: V,
|
|
2260
2260
|
estimatedColumnWidth: Z,
|
|
2261
2261
|
estimatedRowHeight: U,
|
|
2262
|
-
rowCount:
|
|
2262
|
+
rowCount: M,
|
|
2263
2263
|
className: se(
|
|
2264
2264
|
ae["rp-pages"],
|
|
2265
2265
|
u === ne.HORIZONTAL_SCROLLING ? ae["rp-pages-horizontal-scroll"] : ""
|
|
@@ -2267,7 +2267,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2267
2267
|
style: {
|
|
2268
2268
|
"--rp-page-height": `${ie.height}px`,
|
|
2269
2269
|
"--rp-page-width": `${ie.width}px`,
|
|
2270
|
-
"--rp-row-count": `${
|
|
2270
|
+
"--rp-row-count": `${M}`,
|
|
2271
2271
|
"--rp-column-count": `${k}`
|
|
2272
2272
|
},
|
|
2273
2273
|
children: di
|
|
@@ -2298,7 +2298,7 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2298
2298
|
] }) }) : null }) })
|
|
2299
2299
|
}
|
|
2300
2300
|
) }),
|
|
2301
|
-
|
|
2301
|
+
R && /* @__PURE__ */ a(rr, {})
|
|
2302
2302
|
] });
|
|
2303
2303
|
}, ke = {
|
|
2304
2304
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
@@ -2317,24 +2317,24 @@ const si = rn(({ widths: t, heights: e }) => {
|
|
|
2317
2317
|
const { nextIcon: t } = Ce(), { nextIcon: e } = be();
|
|
2318
2318
|
return t || e || /* @__PURE__ */ a(Ze, { style: { transform: "rotate(180deg" } });
|
|
2319
2319
|
}, hi = () => {
|
|
2320
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = le(), [c, l] = q(t.toString()), { pageNavigationTool: d = !0 } = Te(), { pageNavigationTool: f = !0 } = Ne(), { isSmallScreen: m } = Oe(), { viewMode: P } =
|
|
2321
|
-
|
|
2320
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = le(), [c, l] = q(t.toString()), { pageNavigationTool: d = !0 } = Te(), { pageNavigationTool: f = !0 } = Ne(), { isSmallScreen: m } = Oe(), { viewMode: P } = Me(), { scrollMode: h } = Ee(), { localeMessages: T } = he();
|
|
2321
|
+
A(() => {
|
|
2322
2322
|
l(t.toString());
|
|
2323
2323
|
}, [t]);
|
|
2324
|
-
const C =
|
|
2324
|
+
const C = N((p) => {
|
|
2325
2325
|
const u = p.target.value;
|
|
2326
2326
|
l(u);
|
|
2327
|
-
}, []), b =
|
|
2327
|
+
}, []), b = N(async () => {
|
|
2328
2328
|
const p = i(c);
|
|
2329
2329
|
p.success || l(p.currentPage.toString());
|
|
2330
|
-
}, [i, c, e]), v =
|
|
2330
|
+
}, [i, c, e]), v = N(() => {
|
|
2331
2331
|
l(t.toString());
|
|
2332
|
-
}, [t]), y =
|
|
2332
|
+
}, [t]), y = N(
|
|
2333
2333
|
(p) => {
|
|
2334
2334
|
p.key === "Enter" && b();
|
|
2335
2335
|
},
|
|
2336
2336
|
[b]
|
|
2337
|
-
), g =
|
|
2337
|
+
), g = F(() => P === Re.DUAL_PAGE && h === ne.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, P, h]);
|
|
2338
2338
|
return !d || !f ? null : typeof d != "boolean" ? /* @__PURE__ */ a(
|
|
2339
2339
|
d,
|
|
2340
2340
|
{
|
|
@@ -2488,7 +2488,7 @@ var wi = X.forwardRef(
|
|
|
2488
2488
|
if (i)
|
|
2489
2489
|
return gr(i);
|
|
2490
2490
|
}, []), /* @__PURE__ */ a(
|
|
2491
|
-
|
|
2491
|
+
Mn,
|
|
2492
2492
|
{
|
|
2493
2493
|
...t,
|
|
2494
2494
|
ref: o,
|
|
@@ -2513,7 +2513,7 @@ var wi = X.forwardRef(
|
|
|
2513
2513
|
(t, e) => {
|
|
2514
2514
|
const n = ue(Le, t.__scopeDialog), r = X.useRef(!1), o = X.useRef(!1);
|
|
2515
2515
|
return /* @__PURE__ */ a(
|
|
2516
|
-
|
|
2516
|
+
Mn,
|
|
2517
2517
|
{
|
|
2518
2518
|
...t,
|
|
2519
2519
|
ref: e,
|
|
@@ -2532,7 +2532,7 @@ var wi = X.forwardRef(
|
|
|
2532
2532
|
}
|
|
2533
2533
|
);
|
|
2534
2534
|
}
|
|
2535
|
-
),
|
|
2535
|
+
), Mn = X.forwardRef(
|
|
2536
2536
|
(t, e) => {
|
|
2537
2537
|
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...c } = t, l = ue(Le, n), d = X.useRef(null), f = Ct(e, d);
|
|
2538
2538
|
return vr(), /* @__PURE__ */ H(pe, { children: [
|
|
@@ -2565,13 +2565,13 @@ var wi = X.forwardRef(
|
|
|
2565
2565
|
] })
|
|
2566
2566
|
] });
|
|
2567
2567
|
}
|
|
2568
|
-
), Rt = "DialogTitle",
|
|
2568
|
+
), Rt = "DialogTitle", Fn = X.forwardRef(
|
|
2569
2569
|
(t, e) => {
|
|
2570
2570
|
const { __scopeDialog: n, ...r } = t, o = ue(Rt, n);
|
|
2571
2571
|
return /* @__PURE__ */ a(Ue.h2, { id: o.titleId, ...r, ref: e });
|
|
2572
2572
|
}
|
|
2573
2573
|
);
|
|
2574
|
-
|
|
2574
|
+
Fn.displayName = Rt;
|
|
2575
2575
|
var kn = "DialogDescription", bi = X.forwardRef(
|
|
2576
2576
|
(t, e) => {
|
|
2577
2577
|
const { __scopeDialog: n, ...r } = t, o = ue(kn, n);
|
|
@@ -2617,7 +2617,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2617
2617
|
const o = (i = t.current) == null ? void 0 : i.getAttribute("aria-describedby");
|
|
2618
2618
|
e && o && (document.getElementById(e) || console.warn(r));
|
|
2619
2619
|
}, [r, t, e]), null;
|
|
2620
|
-
}, yi = En, xi = Dn, Si = An, Ii = zn, Ri =
|
|
2620
|
+
}, yi = En, xi = Dn, Si = An, Ii = zn, Ri = Fn, Li = Hn;
|
|
2621
2621
|
const Ie = {
|
|
2622
2622
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2623
2623
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2627,7 +2627,7 @@ const Ie = {
|
|
|
2627
2627
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2628
2628
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2629
2629
|
}, Ei = () => {
|
|
2630
|
-
const { pdfProperties: t } = oe(), { container: e } = _e(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = yo(), { localeMessages: o } = he(), i =
|
|
2630
|
+
const { pdfProperties: t } = oe(), { container: e } = _e(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = yo(), { localeMessages: o } = he(), i = F(() => {
|
|
2631
2631
|
if (!t)
|
|
2632
2632
|
return [];
|
|
2633
2633
|
const {
|
|
@@ -2655,11 +2655,11 @@ const Ie = {
|
|
|
2655
2655
|
{ label: o == null ? void 0 : o.propertiesCreatorLabel, value: h },
|
|
2656
2656
|
{
|
|
2657
2657
|
label: o == null ? void 0 : o.propertiesCreateOnLabel,
|
|
2658
|
-
value: P ?
|
|
2658
|
+
value: P ? Mt(P) : ""
|
|
2659
2659
|
},
|
|
2660
2660
|
{
|
|
2661
2661
|
label: o == null ? void 0 : o.propertiesModifiedOnLabel,
|
|
2662
|
-
value: C ?
|
|
2662
|
+
value: C ? Mt(C) : ""
|
|
2663
2663
|
},
|
|
2664
2664
|
{ separate: !0 },
|
|
2665
2665
|
{ label: o == null ? void 0 : o.propertiesPDFProducerLabel, value: b },
|
|
@@ -2685,7 +2685,7 @@ const Ie = {
|
|
|
2685
2685
|
const c = n || i;
|
|
2686
2686
|
return c.endsWith(Jt) ? c : `${c}${Jt}`;
|
|
2687
2687
|
};
|
|
2688
|
-
return { download:
|
|
2688
|
+
return { download: N(async () => {
|
|
2689
2689
|
if (!t || !e)
|
|
2690
2690
|
throw new Error("There is no PDF source to download");
|
|
2691
2691
|
const i = document.createElement("a");
|
|
@@ -2703,12 +2703,12 @@ const Ie = {
|
|
|
2703
2703
|
}, jn = () => {
|
|
2704
2704
|
const { printIcon: t } = Ce(), { printIcon: e } = be();
|
|
2705
2705
|
return t || e || /* @__PURE__ */ a(Sr, {});
|
|
2706
|
-
}, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }),
|
|
2706
|
+
}, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Mi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Kn, { localeMessages: e, children: /* @__PURE__ */ a(ge, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(jn, {}) }) }), Fi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */ H(Kn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2707
2707
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(jn, {}) }),
|
|
2708
2708
|
e == null ? void 0 : e.printLabel
|
|
2709
2709
|
] }) }), Zn = () => {
|
|
2710
2710
|
const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: i } = tt(), { printTool: c = !0 } = Te(), { printTool: l = !0 } = Ne(), { isSmallScreen: d } = Oe(), { localeMessages: f } = he(), m = f == null ? void 0 : f.printTooltip;
|
|
2711
|
-
return !c || !l ? null : d ? /* @__PURE__ */ a(
|
|
2711
|
+
return !c || !l ? null : d ? /* @__PURE__ */ a(Fi, { print: t, localeMessages: f }) : typeof c == "function" ? /* @__PURE__ */ a(Q, { content: m, children: /* @__PURE__ */ a(
|
|
2712
2712
|
c,
|
|
2713
2713
|
{
|
|
2714
2714
|
print: t,
|
|
@@ -2728,7 +2728,7 @@ const Ie = {
|
|
|
2728
2728
|
setOnComplete: r,
|
|
2729
2729
|
progress: i
|
|
2730
2730
|
}
|
|
2731
|
-
) }) : /* @__PURE__ */ a(
|
|
2731
|
+
) }) : /* @__PURE__ */ a(Mi, { print: t, localeMessages: f });
|
|
2732
2732
|
}, ki = {
|
|
2733
2733
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2734
2734
|
}, Wi = () => {
|
|
@@ -2738,9 +2738,9 @@ const Ie = {
|
|
|
2738
2738
|
const { goToLastPageIcon: t } = Ce(), { goToLastPageIcon: e } = be();
|
|
2739
2739
|
return t || e || /* @__PURE__ */ a(mn, {});
|
|
2740
2740
|
}, en = { width: "100%" }, $i = () => {
|
|
2741
|
-
const { goToPage: t, totalPages: e, focusedPage: n } = le(), { jumpNavigationTool: r = !0 } = Te(), { jumpNavigationTool: o = !0 } = Ne(), { localeMessages: i } = he(), c =
|
|
2741
|
+
const { goToPage: t, totalPages: e, focusedPage: n } = le(), { jumpNavigationTool: r = !0 } = Te(), { jumpNavigationTool: o = !0 } = Ne(), { localeMessages: i } = he(), c = F(() => n === 1, [n]), l = F(() => n === e, [n, e]), d = N(() => {
|
|
2742
2742
|
t(1);
|
|
2743
|
-
}, [t]), f =
|
|
2743
|
+
}, [t]), f = N(() => {
|
|
2744
2744
|
t(e);
|
|
2745
2745
|
}, [t, e]);
|
|
2746
2746
|
return !r || !o ? null : /* @__PURE__ */ H(hn, { children: [
|
|
@@ -2777,11 +2777,11 @@ const Ie = {
|
|
|
2777
2777
|
printTool: _,
|
|
2778
2778
|
fullscreenTool: w,
|
|
2779
2779
|
viewModeTool: x
|
|
2780
|
-
} = Ne(), { localeMessages:
|
|
2780
|
+
} = Ne(), { localeMessages: R } = he(), [S, I] = q(0), E = W(
|
|
2781
2781
|
new ResizeObserver((L) => {
|
|
2782
|
-
|
|
2782
|
+
I(L[0].contentRect.height);
|
|
2783
2783
|
})
|
|
2784
|
-
),
|
|
2784
|
+
), D = F(() => P || f || m || d || l || C || o && (i || c || h || T), [
|
|
2785
2785
|
i,
|
|
2786
2786
|
c,
|
|
2787
2787
|
h,
|
|
@@ -2792,7 +2792,7 @@ const Ie = {
|
|
|
2792
2792
|
m,
|
|
2793
2793
|
P,
|
|
2794
2794
|
o
|
|
2795
|
-
]), z =
|
|
2795
|
+
]), z = F(() => s || p || u || g || y || x || o && (b || v || _ || w), [
|
|
2796
2796
|
b,
|
|
2797
2797
|
v,
|
|
2798
2798
|
_,
|
|
@@ -2804,15 +2804,15 @@ const Ie = {
|
|
|
2804
2804
|
s,
|
|
2805
2805
|
o
|
|
2806
2806
|
]);
|
|
2807
|
-
return
|
|
2808
|
-
|
|
2809
|
-
}), [r]), !
|
|
2807
|
+
return A(() => (r && E.current.observe(r), () => {
|
|
2808
|
+
E.current.disconnect();
|
|
2809
|
+
}), [r]), !D || !z ? null : /* @__PURE__ */ H(pe, { children: [
|
|
2810
2810
|
/* @__PURE__ */ a(
|
|
2811
2811
|
dn,
|
|
2812
2812
|
{
|
|
2813
2813
|
container: n,
|
|
2814
2814
|
onOpenChange: e,
|
|
2815
|
-
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content:
|
|
2815
|
+
triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content: R == null ? void 0 : R.moreOptionTooltip, children: /* @__PURE__ */ a(ge, { active: t, "aria-label": R == null ? void 0 : R.moreOptionTooltip, children: /* @__PURE__ */ a(lr, {}) }) }) }),
|
|
2816
2816
|
side: "bottom",
|
|
2817
2817
|
avoidCollisions: !1,
|
|
2818
2818
|
children: /* @__PURE__ */ H(
|
|
@@ -2901,56 +2901,56 @@ const Ie = {
|
|
|
2901
2901
|
nextMatch: T,
|
|
2902
2902
|
prevMatch: C,
|
|
2903
2903
|
search: b
|
|
2904
|
-
} = yt(), { searchTool: v = !0 } = Te(), { searchTool: y = !0 } = Ne(), [g, p] = q(b), { localeMessages: u } = he(), { isSmallScreen: s } = Oe(), [_, w] = q(null), [x,
|
|
2904
|
+
} = yt(), { searchTool: v = !0 } = Te(), { searchTool: y = !0 } = Ne(), [g, p] = q(b), { localeMessages: u } = he(), { isSmallScreen: s } = Oe(), [_, w] = q(null), [x, R] = q(!1), S = N(() => {
|
|
2905
2905
|
r(!0);
|
|
2906
|
-
}, []),
|
|
2906
|
+
}, []), I = N(() => {
|
|
2907
2907
|
m(""), p(""), r(!1);
|
|
2908
|
-
}, [m]),
|
|
2908
|
+
}, [m]), E = (G) => {
|
|
2909
2909
|
const K = G.key === "Enter", Y = G.key === " ";
|
|
2910
|
-
(K || Y) &&
|
|
2911
|
-
},
|
|
2910
|
+
(K || Y) && I();
|
|
2911
|
+
}, D = N(
|
|
2912
2912
|
(G) => {
|
|
2913
|
-
G.key === "Escape" && n &&
|
|
2913
|
+
G.key === "Escape" && n && I();
|
|
2914
2914
|
},
|
|
2915
2915
|
[n]
|
|
2916
|
-
), z =
|
|
2916
|
+
), z = N(
|
|
2917
2917
|
(G) => {
|
|
2918
2918
|
G.shiftKey && G.key === "Enter" ? C() : G.key === "Enter" && b !== g ? m(g) : G.key === "Enter" && T();
|
|
2919
2919
|
},
|
|
2920
2920
|
[g, C, T, m, b]
|
|
2921
2921
|
);
|
|
2922
|
-
|
|
2922
|
+
A(() => {
|
|
2923
2923
|
p(b);
|
|
2924
|
-
}, [b]),
|
|
2925
|
-
b && o &&
|
|
2926
|
-
}, [b, o]),
|
|
2924
|
+
}, [b]), A(() => {
|
|
2925
|
+
b && o && R(!0);
|
|
2926
|
+
}, [b, o]), A(() => {
|
|
2927
2927
|
b && b.trim() !== "" && (p(b), m(b));
|
|
2928
|
-
}, []),
|
|
2929
|
-
window.removeEventListener("keydown",
|
|
2930
|
-
}), [
|
|
2928
|
+
}, []), A(() => (window.addEventListener("keydown", D), () => {
|
|
2929
|
+
window.removeEventListener("keydown", D);
|
|
2930
|
+
}), [D]), A(() => {
|
|
2931
2931
|
i && setTimeout(() => {
|
|
2932
2932
|
i.focus();
|
|
2933
2933
|
}, 0);
|
|
2934
2934
|
}, [i]);
|
|
2935
|
-
const L =
|
|
2935
|
+
const L = N((G) => {
|
|
2936
2936
|
p(G.target.value);
|
|
2937
|
-
}, []), O =
|
|
2937
|
+
}, []), O = N(() => {
|
|
2938
2938
|
p(""), m("");
|
|
2939
|
-
}, [m]),
|
|
2939
|
+
}, [m]), M = F(() => `${h} / ${P}`, [h, P]), { wholeWords: $, matchCase: k } = F(() => l, [l]), B = N(
|
|
2940
2940
|
(G) => {
|
|
2941
2941
|
d((K) => ({ ...K, matchCase: G }));
|
|
2942
2942
|
},
|
|
2943
2943
|
[d]
|
|
2944
|
-
), Z =
|
|
2944
|
+
), Z = N(
|
|
2945
2945
|
(G) => {
|
|
2946
2946
|
d((K) => ({ ...K, wholeWords: G }));
|
|
2947
2947
|
},
|
|
2948
2948
|
[d]
|
|
2949
2949
|
);
|
|
2950
|
-
|
|
2951
|
-
o && x &&
|
|
2952
|
-
}, [o,
|
|
2953
|
-
const U =
|
|
2950
|
+
A(() => {
|
|
2951
|
+
o && x && I();
|
|
2952
|
+
}, [o, I]);
|
|
2953
|
+
const U = F(() => (_ == null ? void 0 : _.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [_]), ie = N(
|
|
2954
2954
|
(G) => {
|
|
2955
2955
|
if (G.key === "Tab") {
|
|
2956
2956
|
const K = document.activeElement;
|
|
@@ -3018,8 +3018,8 @@ const Ie = {
|
|
|
3018
3018
|
children: !!g && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: O, children: /* @__PURE__ */ a(Lr, {}) })
|
|
3019
3019
|
}
|
|
3020
3020
|
) }),
|
|
3021
|
-
f ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(ln, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children:
|
|
3022
|
-
s && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(At, { onKeyPress:
|
|
3021
|
+
f ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(ln, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: M }),
|
|
3022
|
+
s && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(At, { onKeyPress: E, handleClose: I }) })
|
|
3023
3023
|
] }),
|
|
3024
3024
|
/* @__PURE__ */ H("div", { className: te["rp-search-tool-input-checkboxes"], children: [
|
|
3025
3025
|
s && /* @__PURE__ */ a(tn, {}),
|
|
@@ -3049,7 +3049,7 @@ const Ie = {
|
|
|
3049
3049
|
] }),
|
|
3050
3050
|
!s && /* @__PURE__ */ H("div", { className: te["rp-search-tool-controls"], children: [
|
|
3051
3051
|
/* @__PURE__ */ a(tn, {}),
|
|
3052
|
-
/* @__PURE__ */ a(At, { onKeyPress:
|
|
3052
|
+
/* @__PURE__ */ a(At, { onKeyPress: E, handleClose: I })
|
|
3053
3053
|
] })
|
|
3054
3054
|
]
|
|
3055
3055
|
}
|
|
@@ -3107,16 +3107,16 @@ const Ie = {
|
|
|
3107
3107
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3108
3108
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3109
3109
|
}, Zi = (t) => {
|
|
3110
|
-
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = le(), { pageRotate: i } = Je(), c = W(null), l = yn(), { pages: d } = oe(), [f, m] = q(null), P = W(!1), h = W(), T =
|
|
3110
|
+
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = le(), { pageRotate: i } = Je(), c = W(null), l = yn(), { pages: d } = oe(), [f, m] = q(null), P = W(!1), h = W(), T = F(() => n ? We["rp-thumbnail-active"] : "", [n]), C = F(() => ({
|
|
3111
3111
|
width: Math.round(r.width),
|
|
3112
3112
|
height: Math.round(r.height)
|
|
3113
|
-
}), [r]), b =
|
|
3113
|
+
}), [r]), b = N(() => {
|
|
3114
3114
|
e && o(e);
|
|
3115
3115
|
}, [o, e]);
|
|
3116
|
-
return
|
|
3116
|
+
return A(() => {
|
|
3117
3117
|
const v = d.get(e);
|
|
3118
3118
|
h.current === v || (m(null), h.current = v);
|
|
3119
|
-
}, [d, e]),
|
|
3119
|
+
}, [d, e]), A(() => {
|
|
3120
3120
|
const v = d.get(e);
|
|
3121
3121
|
if (!c.current || !e || !v || f)
|
|
3122
3122
|
return;
|
|
@@ -3202,13 +3202,13 @@ const Ie = {
|
|
|
3202
3202
|
}, Yi = et((t, e) => {
|
|
3203
3203
|
const { show: n, width: r } = t, { focusedPage: o, totalPages: i } = le(), { thumbnailPages: c, addPage: l, thumbnailLength: d, addToPage: f } = Tn(), m = W(null), P = W(1);
|
|
3204
3204
|
on(e, () => m.current);
|
|
3205
|
-
const h =
|
|
3205
|
+
const h = F(() => Object.values(c), [c]), T = N(() => {
|
|
3206
3206
|
const C = d + 1;
|
|
3207
3207
|
C <= i && l(C);
|
|
3208
3208
|
}, [l, i, d]);
|
|
3209
|
-
return
|
|
3209
|
+
return A(() => {
|
|
3210
3210
|
o > d && i > d ? f(o) : n && P.current !== o && (Qi(m.current, o), P.current = o);
|
|
3211
|
-
}, [o, d, f, n, h]),
|
|
3211
|
+
}, [o, d, f, n, h]), Mo(m.current, T), /* @__PURE__ */ a("div", { ref: m, className: nn["rp-thumbnails-container"], style: { width: r }, children: /* @__PURE__ */ a("div", { className: nn["rp-thumbnails"], children: n ? h.map((C, b) => {
|
|
3212
3212
|
var v, y;
|
|
3213
3213
|
return /* @__PURE__ */ a(
|
|
3214
3214
|
Zi,
|
|
@@ -3226,9 +3226,9 @@ const Ie = {
|
|
|
3226
3226
|
const { thumbnailIcon: t } = Ce(), { thumbnailIcon: e } = be();
|
|
3227
3227
|
return t || e || /* @__PURE__ */ a(xo, {});
|
|
3228
3228
|
}, ea = () => {
|
|
3229
|
-
const { active: t, setActive: e } = Tn(), [n, r] = q(
|
|
3229
|
+
const { active: t, setActive: e } = Tn(), [n, r] = q(Fo), o = W(null), i = W(null), { thumbnailTool: c, sidebarEnable: l } = Te(), { localeMessages: d } = he(), f = N(() => {
|
|
3230
3230
|
e((P) => !P);
|
|
3231
|
-
}, []), m =
|
|
3231
|
+
}, []), m = F(() => typeof c != "boolean" && c ? /* @__PURE__ */ a(c, { onClick: f, active: t }) : c ? /* @__PURE__ */ a(Q, { content: d == null ? void 0 : d.thumbnailTooltip, children: /* @__PURE__ */ a(
|
|
3232
3232
|
ge,
|
|
3233
3233
|
{
|
|
3234
3234
|
onClick: f,
|
|
@@ -3279,7 +3279,7 @@ const Ie = {
|
|
|
3279
3279
|
cleanupOnLoaded: f,
|
|
3280
3280
|
onLayoutWidthChange: m
|
|
3281
3281
|
} = t, [P, h] = q(null), { setContainer: T, setContentRef: C } = _e(), { loading: b } = oe(), { LoaderImageComponent: v } = _t();
|
|
3282
|
-
return
|
|
3282
|
+
return A(() => (d && d(), () => {
|
|
3283
3283
|
f && f();
|
|
3284
3284
|
}), [d, f]), // TODO: deprecated in v2.0.0, remove later ~
|
|
3285
3285
|
/* @__PURE__ */ a(Rn, { toolbarRef: P, ref: e, children: /* @__PURE__ */ a(Io, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Ro, { slots: r, children: /* @__PURE__ */ a(Ao, { icons: o, children: /* @__PURE__ */ H(So, { getContainerRef: T, style: i, className: c, children: [
|
|
@@ -3341,7 +3341,7 @@ export {
|
|
|
3341
3341
|
yn as C,
|
|
3342
3342
|
Ei as D,
|
|
3343
3343
|
Ar as E,
|
|
3344
|
-
|
|
3344
|
+
Fr as F,
|
|
3345
3345
|
Hr as G,
|
|
3346
3346
|
qr as H,
|
|
3347
3347
|
xt as I,
|