@pdf-viewer/react 0.0.0-experimental.4 → 0.0.0-experimental.6
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-21be1eac.js → ToolbarLayout.module-37619c4b.js} +1300 -1301
- 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/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/ToolbarLayout.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.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/ZoomLevelDisplay.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.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/types/utils/annotations.d.ts +1 -2
- package/dist/types/utils/link_service.d.ts +3 -1
- package/dist/utils/annotations.js +45 -56
- 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/link_service.js +40 -9
- package/package.json +1 -1
|
@@ -1,114 +1,114 @@
|
|
|
1
1
|
import { jsx as i, Fragment as fe, jsxs as W } from "react/jsx-runtime";
|
|
2
2
|
import * as X from "react";
|
|
3
|
-
import { useRef as H, useEffect as D, useCallback as E, useState as $, useMemo as
|
|
3
|
+
import { useRef as H, useEffect as D, useCallback as E, useState as $, useMemo as k, createContext as Ve, useContext as Be, useImperativeHandle as un, createElement as Ke, PureComponent as co, Component as lo, memo as pn, Fragment as uo, forwardRef as po } from "react";
|
|
4
4
|
import { ChevronUpIcon as Ue } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as de } from "./components/ui/Button.js";
|
|
6
|
-
import { UIInput as
|
|
7
|
-
import { ViewMode as Oe, ScrollMode as
|
|
6
|
+
import { UIInput as hn } from "./components/ui/Input.js";
|
|
7
|
+
import { ViewMode as Oe, ScrollMode as ie, AnnotationSubType as ho, SelectionMode as fo, ErrorType as mo, ZoomLevel as We } from "./utils/types.js";
|
|
8
8
|
import { useScrollModeContext as ze } from "./contexts/ScrollModeContext.js";
|
|
9
|
-
import { useDocumentContext as
|
|
10
|
-
import { useDocumentPasswordContext as
|
|
11
|
-
import { useDarkModeContext as
|
|
9
|
+
import { useDocumentContext as re } from "./contexts/RPDocumentContext.js";
|
|
10
|
+
import { useDocumentPasswordContext as go } from "./contexts/DocumentPasswordContext.js";
|
|
11
|
+
import { useDarkModeContext as vo } from "./contexts/DarkModeContext.js";
|
|
12
12
|
import "./contexts/RotationContext.js";
|
|
13
|
-
import { useLayerContext as
|
|
13
|
+
import { useLayerContext as wo } from "./contexts/LayerContext.js";
|
|
14
14
|
import { useZoomContext as tt } from "./contexts/ZoomContext.js";
|
|
15
15
|
import { useViewModeContext as He } from "./contexts/ViewModeContext.js";
|
|
16
16
|
import { useVirtualScrollContext as nt } from "./contexts/VirtualScrollContext.js";
|
|
17
|
-
import { useVirtualGridContext as
|
|
18
|
-
import { useSelectionModeContext as
|
|
19
|
-
import { useInitialStateContext as
|
|
20
|
-
import { useFullScreenContext as
|
|
17
|
+
import { useVirtualGridContext as fn } from "./contexts/VirtualGridContext.js";
|
|
18
|
+
import { useSelectionModeContext as _o } from "./contexts/SelectionModeContext.js";
|
|
19
|
+
import { useInitialStateContext as bo } from "./contexts/InitialStateContext.js";
|
|
20
|
+
import { useFullScreenContext as To } from "./contexts/FullScreenContext.js";
|
|
21
21
|
import "./contexts/FileInputContext.js";
|
|
22
22
|
import "./contexts/DropFileZoneContext.js";
|
|
23
|
-
import { findMatches as
|
|
23
|
+
import { findMatches as Co, resetDivs as Po, highlightMatches as yo, isMatchEntireWord as Io } from "./utils/highlight.js";
|
|
24
24
|
import { useLayoutContainer as Ce } from "./contexts/LayoutContainerContext.js";
|
|
25
25
|
import { useDimensionPagesContext as Ze } from "./contexts/DimensionPagesContext.js";
|
|
26
26
|
import { useLocalizationContext as pe } from "./contexts/LocalizationContext.js";
|
|
27
|
-
import { useHighlightContext as
|
|
27
|
+
import { useHighlightContext as So } from "./contexts/HighlightContext.js";
|
|
28
28
|
import "./contexts/LicenseContext.js";
|
|
29
|
-
import { useDownloadContext as
|
|
30
|
-
import { useSmoothScrollContext as
|
|
29
|
+
import { useDownloadContext as xo } from "./contexts/DownloadContext.js";
|
|
30
|
+
import { useSmoothScrollContext as mn } from "./contexts/SmoothScrollContext.js";
|
|
31
31
|
import "./contexts/ElementPageContext.js";
|
|
32
32
|
import { usePagesRotateContext as ot } from "./contexts/PagesRotateContext.js";
|
|
33
|
-
import { Queue as
|
|
34
|
-
import { renderPage as
|
|
35
|
-
import { useGlobalCurrentPage as
|
|
33
|
+
import { Queue as Ro } from "./utils/Queue.js";
|
|
34
|
+
import { renderPage as Lo } from "./utils/renderPage.js";
|
|
35
|
+
import { useGlobalCurrentPage as Eo } from "./contexts/GlobalCurrentPage.js";
|
|
36
36
|
import { useLoaderContext as yt } from "./contexts/LoaderContext.js";
|
|
37
37
|
import { useToolComponentContext as Se } from "./contexts/ToolComponentContext.js";
|
|
38
38
|
import { useIconToolContext as ge } from "./contexts/IconToolContext.js";
|
|
39
|
-
import { useOtherToolContext as
|
|
40
|
-
import { useEventCallbackContext as
|
|
39
|
+
import { useOtherToolContext as No } from "./contexts/OtherToolContext.js";
|
|
40
|
+
import { useEventCallbackContext as Oo } from "./contexts/EventCallbackContext.js";
|
|
41
41
|
import "./components/RPConfig.js";
|
|
42
|
-
import { ThumbnailIcon as
|
|
42
|
+
import { ThumbnailIcon as Do } from "./components/icons/Thumbnail.js";
|
|
43
43
|
import { c as se } from "./clsx-0c6e471a.js";
|
|
44
|
-
import { LoaderIcon as
|
|
45
|
-
import { Container as
|
|
46
|
-
import { useViewportContext as xe, ViewportProvider as
|
|
47
|
-
import { useToolbarComponentContext as Pe, ToolbarComponentProvider as
|
|
44
|
+
import { LoaderIcon as gn } from "./components/icons/LoaderIcon.js";
|
|
45
|
+
import { Container as zo } from "./components/layout/Container.js";
|
|
46
|
+
import { useViewportContext as xe, ViewportProvider as Ao } from "./contexts/ViewportContext.js";
|
|
47
|
+
import { useToolbarComponentContext as Pe, ToolbarComponentProvider as Fo } from "./contexts/ToolbarComponentContext.js";
|
|
48
48
|
import { RPSplitter as Mo } from "./components/layout/sidebar/RPSplitter.js";
|
|
49
|
-
import { WrapperLayout as
|
|
50
|
-
import { c as ye, L as
|
|
51
|
-
import { useThemeContext as
|
|
52
|
-
import { RPDropFileZone as
|
|
53
|
-
import { c as oe, S as
|
|
54
|
-
import { UICheckbox as
|
|
49
|
+
import { WrapperLayout as ko } from "./components/layout/WrapperLayout.js";
|
|
50
|
+
import { c as ye, L as Wo } from "./LayoutWrapper-6224491f.js";
|
|
51
|
+
import { useThemeContext as Ho } from "./contexts/ThemeContext.js";
|
|
52
|
+
import { RPDropFileZone as $o } from "./components/RPDropFileZone.js";
|
|
53
|
+
import { c as oe, S as Wt } from "./SearchCloseButton-08d57275.js";
|
|
54
|
+
import { UICheckbox as Ht } from "./components/ui/Checkbox.js";
|
|
55
55
|
import { useIconContext as ve, IconProvider as qo } from "./contexts/IconContext.js";
|
|
56
56
|
import K from "./components/ui/RPTooltip.js";
|
|
57
57
|
import { UIDropDown as It } from "./components/ui/DropDown.js";
|
|
58
58
|
import { MenuItem as Ie } from "./components/layout/toolbar/MenuItem.js";
|
|
59
59
|
import { MenuSeparator as St } from "./components/layout/toolbar/MenuSeparator.js";
|
|
60
|
-
import { dateFormatter as
|
|
61
|
-
import { PropertyItem as
|
|
60
|
+
import { dateFormatter as $t } from "./utils/dateFormatter.js";
|
|
61
|
+
import { PropertyItem as Go } from "./components/layout/toolbar/PropertyItem.js";
|
|
62
62
|
import "./RotateTool.module-67946714.js";
|
|
63
63
|
import { withRef as rt } from "./utils/withRef.js";
|
|
64
|
-
import { useInfiniteScroll as
|
|
65
|
-
import { MAX_ZOOM_SCALE as qt, THUMBNAIL_MIN_WIDTH as
|
|
66
|
-
import * as
|
|
67
|
-
import { PixelsPerInch as
|
|
68
|
-
import { SimpleLinkService as
|
|
69
|
-
import { annotationsEvents as
|
|
70
|
-
import { normalizeSingleKeyword as
|
|
71
|
-
import { CustomElement as
|
|
72
|
-
import { getGridDimension as xt, getPositionFromPage as
|
|
73
|
-
import { useMousePressed as
|
|
74
|
-
import { useGrabScroll as
|
|
75
|
-
import { usePinch as
|
|
64
|
+
import { useInfiniteScroll as Uo } from "./utils/hooks/useInfiniteScroll.js";
|
|
65
|
+
import { MAX_ZOOM_SCALE as qt, THUMBNAIL_MIN_WIDTH as Vo } from "./utils/constants.js";
|
|
66
|
+
import * as Bo from "pdfjs-dist";
|
|
67
|
+
import { PixelsPerInch as Zo, AnnotationMode as jo, RenderingCancelledException as Ko, AnnotationLayer as Xo, OutputScale as Qo } from "pdfjs-dist";
|
|
68
|
+
import { SimpleLinkService as Gt } from "./utils/link_service.js";
|
|
69
|
+
import { annotationsEvents as Yo, annotationEventsHandler as Jo, handleAnnotationWidget as er, bindLayerEvents as tr, unbindLayerEvents as Ut } from "./utils/annotations.js";
|
|
70
|
+
import { normalizeSingleKeyword as nr, sortHighlightPosition as or, unwrap as rr } from "./components/page/searchHighlight.js";
|
|
71
|
+
import { CustomElement as ir } from "./components/page/CustomElement.js";
|
|
72
|
+
import { getGridDimension as xt, getPositionFromPage as ar, getPageFromPosition as sr } from "./utils/calculatePage.js";
|
|
73
|
+
import { useMousePressed as cr } from "./utils/hooks/useMousePressed.js";
|
|
74
|
+
import { useGrabScroll as lr } from "./utils/hooks/useGrabScroll.js";
|
|
75
|
+
import { usePinch as dr } from "./utils/hooks/usePinch.js";
|
|
76
76
|
import { useDebounce as Rt } from "./utils/hooks/useDebounce.js";
|
|
77
|
-
import
|
|
78
|
-
import { approximateFraction as
|
|
79
|
-
import { getScrollDistance as
|
|
80
|
-
import { getWordPositionInPage as
|
|
81
|
-
import { getThumbnailViewport as
|
|
77
|
+
import ur from "./components/ui/PasswordModal.js";
|
|
78
|
+
import { approximateFraction as Vt } from "./utils/approximateFragtion.js";
|
|
79
|
+
import { getScrollDistance as ke } from "./utils/getScrollDistance.js";
|
|
80
|
+
import { getWordPositionInPage as pr } from "./utils/getWordPositionInPage.js";
|
|
81
|
+
import { getThumbnailViewport as hr } from "./utils/getThumbnailViewport.js";
|
|
82
82
|
import { smoothScrollTo as ut } from "./utils/smoothScrollTo.js";
|
|
83
|
-
import { appConsole as
|
|
84
|
-
import { FileUploadTool as
|
|
85
|
-
import { DarkModeTool as
|
|
86
|
-
import { ThreeDotIcon as
|
|
87
|
-
import { c as
|
|
88
|
-
import { D as
|
|
89
|
-
import { a as
|
|
90
|
-
import { CloseIcon as
|
|
91
|
-
import { DocumentProperties as
|
|
92
|
-
import { RotateTool as
|
|
93
|
-
import { ViewModeTool as
|
|
94
|
-
import { ScrollModeTool as
|
|
95
|
-
import { FileDownloadDefaultIcon as
|
|
96
|
-
import { PrintDefaultTool as
|
|
97
|
-
import { FullScreenTool as
|
|
98
|
-
import { GoToDownIcon as
|
|
99
|
-
import { SelectionModeTool as
|
|
100
|
-
import { ZoomInIcon as
|
|
101
|
-
import { ZoomOutIcon as
|
|
102
|
-
import { isZoomOutDisabled as
|
|
103
|
-
import { SearchIcon as
|
|
104
|
-
import { ClearIcon as
|
|
105
|
-
import { InfoIcon as
|
|
106
|
-
const
|
|
107
|
-
const { viewMode: t } = He(), { scrollMode: e } = ze(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = nt(), { setFocusedPage: a } = he(),
|
|
83
|
+
import { appConsole as fr } from "./utils/appConsole.js";
|
|
84
|
+
import { FileUploadTool as vn } from "./components/layout/toolbar/FileUploadTool.js";
|
|
85
|
+
import { DarkModeTool as mr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
86
|
+
import { ThreeDotIcon as gr } from "./components/icons/ThreeDotIcon.js";
|
|
87
|
+
import { c as vr, u as Lt, P as je, a as Ge, b as Et, k as wr, e as _r, i as br } from "./index-c9a2990a.js";
|
|
88
|
+
import { D as Tr, u as pt } from "./index-808ea7bf.js";
|
|
89
|
+
import { a as Cr, h as Pr, u as yr, F as Ir, b as Sr, G as Je } from "./index-a48ec088.js";
|
|
90
|
+
import { CloseIcon as xr } from "./components/icons/CloseIcon.js";
|
|
91
|
+
import { DocumentProperties as Rr } from "./components/layout/toolbar/DocumentProperties.js";
|
|
92
|
+
import { RotateTool as Lr } from "./components/layout/toolbar/RotateTool.js";
|
|
93
|
+
import { ViewModeTool as Er } from "./components/layout/toolbar/ViewModeTool.js";
|
|
94
|
+
import { ScrollModeTool as Nr } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
95
|
+
import { FileDownloadDefaultIcon as Or } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
96
|
+
import { PrintDefaultTool as Dr } from "./components/icons/PrintDefaultIcon.js";
|
|
97
|
+
import { FullScreenTool as wn } from "./components/layout/toolbar/FullScreenTool.js";
|
|
98
|
+
import { GoToDownIcon as _n } from "./components/icons/GoToDownIcon.js";
|
|
99
|
+
import { SelectionModeTool as zr } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
100
|
+
import { ZoomInIcon as Ar } from "./components/icons/ZoomInIcon.js";
|
|
101
|
+
import { ZoomOutIcon as Fr } from "./components/icons/ZoomOutIcon.js";
|
|
102
|
+
import { isZoomOutDisabled as Mr, isZoomInDisabled as kr } from "./utils/zoom.js";
|
|
103
|
+
import { SearchIcon as bn } from "./components/icons/SearchIcon.js";
|
|
104
|
+
import { ClearIcon as Wr } from "./components/icons/ClearIcon.js";
|
|
105
|
+
import { InfoIcon as Bt } from "./components/icons/InfoIcon.js";
|
|
106
|
+
const Tn = () => {
|
|
107
|
+
const { viewMode: t } = He(), { scrollMode: e } = ze(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = nt(), { setFocusedPage: a } = he(), l = H(), { columnCount: d } = fn(), { widths: c, heights: m } = Ze(), f = H(e), C = H(t), p = H(d), { targetScrollPage: _ } = mn();
|
|
108
108
|
D(() => {
|
|
109
|
-
n != null && n.scrollToItem && (
|
|
109
|
+
n != null && n.scrollToItem && (l.current = n);
|
|
110
110
|
}, [n]), D(() => {
|
|
111
|
-
|
|
111
|
+
f.current = e, C.current = t;
|
|
112
112
|
}, [e, t]);
|
|
113
113
|
const P = E(
|
|
114
114
|
(v, I) => {
|
|
@@ -116,12 +116,12 @@ const Pn = () => {
|
|
|
116
116
|
return;
|
|
117
117
|
const g = Math.ceil(v / 2) * 2 - 1;
|
|
118
118
|
if (v === g + 1) {
|
|
119
|
-
const
|
|
120
|
-
left:
|
|
119
|
+
const h = {
|
|
120
|
+
left: c[g],
|
|
121
121
|
top: 0
|
|
122
122
|
};
|
|
123
123
|
return new Promise(
|
|
124
|
-
(s) => ut(o,
|
|
124
|
+
(s) => ut(o, h, s)
|
|
125
125
|
);
|
|
126
126
|
}
|
|
127
127
|
const u = {
|
|
@@ -133,36 +133,36 @@ const Pn = () => {
|
|
|
133
133
|
behavior: I
|
|
134
134
|
});
|
|
135
135
|
},
|
|
136
|
-
[o,
|
|
136
|
+
[o, c, ut]
|
|
137
137
|
);
|
|
138
138
|
return D(() => {
|
|
139
|
-
|
|
139
|
+
f.current = e, C.current = t;
|
|
140
140
|
}, [e, t]), D(() => {
|
|
141
|
-
|
|
141
|
+
p.current = d;
|
|
142
142
|
}, [d]), { scrollToPage: E(
|
|
143
143
|
(v, I = "smooth") => {
|
|
144
144
|
a(v);
|
|
145
145
|
const g = v - 1;
|
|
146
|
-
let u = g,
|
|
147
|
-
if (C.current === Oe.DUAL_PAGE &&
|
|
146
|
+
let u = g, h = 0;
|
|
147
|
+
if (C.current === Oe.DUAL_PAGE && f.current === ie.PAGE_SCROLLING) {
|
|
148
148
|
P(v, I);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
if (
|
|
151
|
+
if (f.current === ie.PAGE_SCROLLING) {
|
|
152
152
|
a(v);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
if (!
|
|
155
|
+
if (!l.current || !r)
|
|
156
156
|
return;
|
|
157
157
|
const s = r;
|
|
158
|
-
I === "smooth" && (
|
|
159
|
-
const { columnsWidth:
|
|
160
|
-
{ widths:
|
|
158
|
+
I === "smooth" && (_.current = v);
|
|
159
|
+
const { columnsWidth: b, rowsHeight: T } = xt(
|
|
160
|
+
{ widths: c, heights: m },
|
|
161
161
|
d
|
|
162
162
|
);
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
const S =
|
|
163
|
+
if (f.current === ie.HORIZONTAL_SCROLLING) {
|
|
164
|
+
h = g;
|
|
165
|
+
const S = ke(b, h), R = {
|
|
166
166
|
left: Math.floor(S),
|
|
167
167
|
top: 0
|
|
168
168
|
};
|
|
@@ -172,8 +172,8 @@ const Pn = () => {
|
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
if (C.current === Oe.DUAL_PAGE) {
|
|
175
|
-
|
|
176
|
-
const R =
|
|
175
|
+
h = g % 2, u = Math.floor(g / 2);
|
|
176
|
+
const R = ke(b, h), L = ke(T, u), N = {
|
|
177
177
|
left: Math.floor(R),
|
|
178
178
|
top: Math.floor(L)
|
|
179
179
|
};
|
|
@@ -182,7 +182,7 @@ const Pn = () => {
|
|
|
182
182
|
behavior: I
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
const y =
|
|
185
|
+
const y = ke(T, u), x = {
|
|
186
186
|
left: 0,
|
|
187
187
|
top: Math.floor(y)
|
|
188
188
|
};
|
|
@@ -197,50 +197,50 @@ const Pn = () => {
|
|
|
197
197
|
P,
|
|
198
198
|
a,
|
|
199
199
|
ut,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
m,
|
|
201
|
+
c
|
|
202
202
|
]
|
|
203
203
|
) };
|
|
204
|
-
},
|
|
205
|
-
const [e, n] = $(t), [r, o] = $(0), { scrollToPage: a } =
|
|
204
|
+
}, Hr = (t = 1) => {
|
|
205
|
+
const [e, n] = $(t), [r, o] = $(0), { scrollToPage: a } = Tn(), l = H(1), { viewMode: d } = He(), { scrollMode: c } = ze(), { widths: m } = Ze(), { pagesRef: f } = Ce(), C = Rt(e, 100), p = E(
|
|
206
206
|
(u) => {
|
|
207
207
|
if (!/^[0-9]*$/g.test(u.toString()) || !u)
|
|
208
|
-
return { success: !1, currentPage:
|
|
208
|
+
return { success: !1, currentPage: l.current };
|
|
209
209
|
const s = +u;
|
|
210
|
-
return s < 0 || s > r ? { success: !1, currentPage:
|
|
210
|
+
return s < 0 || s > r ? { success: !1, currentPage: l.current } : (n(s), l.current = s, { success: !0, currentPage: +u });
|
|
211
211
|
},
|
|
212
212
|
[r]
|
|
213
|
-
),
|
|
213
|
+
), _ = E(p, [p]), P = E(
|
|
214
214
|
(u) => {
|
|
215
|
-
const
|
|
216
|
-
return
|
|
215
|
+
const h = p(u);
|
|
216
|
+
return h.success && a(h.currentPage), h;
|
|
217
217
|
},
|
|
218
|
-
[
|
|
219
|
-
),
|
|
220
|
-
const
|
|
221
|
-
if (!
|
|
218
|
+
[p, a]
|
|
219
|
+
), w = E((u) => {
|
|
220
|
+
const h = u % 2 === 1;
|
|
221
|
+
if (!f || h)
|
|
222
222
|
return !1;
|
|
223
|
-
const s =
|
|
224
|
-
return d === Oe.DUAL_PAGE && s +
|
|
225
|
-
}, [d,
|
|
223
|
+
const s = h ? m[u] : m[u - 1], b = h ? m[u + 1] : m[u];
|
|
224
|
+
return d === Oe.DUAL_PAGE && s + b < f.clientWidth;
|
|
225
|
+
}, [d, m, f, r]), v = E(() => {
|
|
226
226
|
let u = e - 1;
|
|
227
|
-
|
|
228
|
-
}, [P, e, d,
|
|
227
|
+
w(u) && (u = e - 2), P(u);
|
|
228
|
+
}, [P, e, d, c, w]), I = k(() => d === Oe.DUAL_PAGE && c === ie.PAGE_SCROLLING ? e === r - 1 : e === r, [e, r, d, c]), g = E(() => {
|
|
229
229
|
if (I)
|
|
230
230
|
return;
|
|
231
231
|
let u = e + 1;
|
|
232
|
-
|
|
233
|
-
}, [P, e,
|
|
232
|
+
w(u) && (u = e + 2), P(u);
|
|
233
|
+
}, [P, e, w, d, c, I]);
|
|
234
234
|
return {
|
|
235
235
|
focusedPage: C,
|
|
236
236
|
totalPages: r,
|
|
237
|
-
setFocusedPage:
|
|
237
|
+
setFocusedPage: _,
|
|
238
238
|
setTotalPages: o,
|
|
239
239
|
nextPage: g,
|
|
240
240
|
prevPage: v,
|
|
241
241
|
goToPage: P
|
|
242
242
|
};
|
|
243
|
-
},
|
|
243
|
+
}, Cn = Ve({
|
|
244
244
|
focusedPage: 0,
|
|
245
245
|
setFocusedPage: (t) => {
|
|
246
246
|
},
|
|
@@ -253,139 +253,139 @@ const Pn = () => {
|
|
|
253
253
|
nextPage: () => {
|
|
254
254
|
}
|
|
255
255
|
}), he = () => {
|
|
256
|
-
const t = Be(
|
|
257
|
-
return typeof (t == null ? void 0 : t.focusedPage) > "u" &&
|
|
258
|
-
},
|
|
259
|
-
const { pdf: e } =
|
|
256
|
+
const t = Be(Cn);
|
|
257
|
+
return typeof (t == null ? void 0 : t.focusedPage) > "u" && fr.error("Please use this hooks inside children component of RPProvider"), t;
|
|
258
|
+
}, fc = ({ children: t }) => {
|
|
259
|
+
const { pdf: e } = re(), { setCurrentPage: n } = Eo(), { focusedPage: r, totalPages: o, setFocusedPage: a, setTotalPages: l, goToPage: d, nextPage: c, prevPage: m } = Hr();
|
|
260
260
|
return D(() => {
|
|
261
|
-
e != null && e.numPages && (
|
|
262
|
-
}, [e,
|
|
261
|
+
e != null && e.numPages && (l(e.numPages), a(1));
|
|
262
|
+
}, [e, l, a]), D(() => {
|
|
263
263
|
n(r);
|
|
264
264
|
}, [r, n]), /* @__PURE__ */ i(
|
|
265
|
-
|
|
265
|
+
Cn.Provider,
|
|
266
266
|
{
|
|
267
267
|
value: {
|
|
268
268
|
focusedPage: r,
|
|
269
269
|
totalPages: o,
|
|
270
270
|
setFocusedPage: a,
|
|
271
|
-
setTotalPages:
|
|
272
|
-
nextPage:
|
|
273
|
-
prevPage:
|
|
271
|
+
setTotalPages: l,
|
|
272
|
+
nextPage: c,
|
|
273
|
+
prevPage: m,
|
|
274
274
|
goToPage: d
|
|
275
275
|
},
|
|
276
276
|
children: t
|
|
277
277
|
}
|
|
278
278
|
);
|
|
279
|
-
},
|
|
280
|
-
const { pdf: t, pages: e } =
|
|
279
|
+
}, $r = () => {
|
|
280
|
+
const { pdf: t, pages: e } = re(), [n, r] = $({
|
|
281
281
|
loadedPages: 0,
|
|
282
282
|
totalPages: 0,
|
|
283
283
|
percentage: 0
|
|
284
|
-
}), [o, a] = $(!1), [
|
|
284
|
+
}), [o, a] = $(!1), [l, d] = $(!1), [c, m] = $(null), f = H(!1);
|
|
285
285
|
D(() => {
|
|
286
|
-
|
|
287
|
-
}, [
|
|
286
|
+
f.current;
|
|
287
|
+
}, [f]);
|
|
288
288
|
const C = E(() => {
|
|
289
289
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
290
290
|
const u = document.querySelector(".rp-print-zone");
|
|
291
291
|
u && u.remove();
|
|
292
|
-
}, []),
|
|
293
|
-
|
|
292
|
+
}, []), p = E(() => {
|
|
293
|
+
f.current = !1, a(!1), d(!1), m(null), r({
|
|
294
294
|
loadedPages: 0,
|
|
295
295
|
totalPages: 0,
|
|
296
296
|
percentage: 0
|
|
297
297
|
});
|
|
298
|
-
}, []),
|
|
299
|
-
|
|
298
|
+
}, []), _ = () => {
|
|
299
|
+
f.current = !0;
|
|
300
300
|
}, P = async ({
|
|
301
301
|
scratchCanvas: u,
|
|
302
|
-
pdfDocument:
|
|
302
|
+
pdfDocument: h,
|
|
303
303
|
pageNumber: s,
|
|
304
|
-
viewerPdfPage:
|
|
305
|
-
printResolution:
|
|
304
|
+
viewerPdfPage: b,
|
|
305
|
+
printResolution: T,
|
|
306
306
|
optionalContentConfigPromise: y,
|
|
307
307
|
printAnnotationStoragePromise: x
|
|
308
308
|
}) => {
|
|
309
|
-
if (
|
|
310
|
-
|
|
309
|
+
if (f.current) {
|
|
310
|
+
p();
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
const S =
|
|
314
|
-
u.width = Math.floor(
|
|
313
|
+
const S = T / Zo.PDF;
|
|
314
|
+
u.width = Math.floor(b.width * S), u.height = Math.floor(b.height * S);
|
|
315
315
|
const R = u.getContext("2d");
|
|
316
316
|
R.save(), R.fillStyle = "rgb(255, 255, 255)", R.fillRect(0, 0, u.width, u.height), R.restore();
|
|
317
317
|
const [L, N] = await Promise.all([
|
|
318
|
-
|
|
318
|
+
h.getPage(s),
|
|
319
319
|
x
|
|
320
320
|
]);
|
|
321
|
-
if (
|
|
322
|
-
|
|
321
|
+
if (f.current) {
|
|
322
|
+
p();
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
const
|
|
325
|
+
const M = {
|
|
326
326
|
canvas: u,
|
|
327
327
|
canvasContext: R,
|
|
328
328
|
transform: [S, 0, 0, S, 0, 0],
|
|
329
|
-
viewport: L.getViewport({ scale: 1, rotation:
|
|
329
|
+
viewport: L.getViewport({ scale: 1, rotation: b.rotation }),
|
|
330
330
|
intent: "print",
|
|
331
|
-
annotationMode:
|
|
331
|
+
annotationMode: jo.ENABLE_STORAGE,
|
|
332
332
|
optionalContentConfigPromise: y,
|
|
333
333
|
printAnnotationStorage: N
|
|
334
334
|
};
|
|
335
335
|
try {
|
|
336
|
-
return L.render(
|
|
336
|
+
return L.render(M).promise;
|
|
337
337
|
} catch (A) {
|
|
338
|
-
throw A instanceof
|
|
338
|
+
throw A instanceof Ko || console.error(A), A;
|
|
339
339
|
}
|
|
340
|
-
},
|
|
340
|
+
}, w = E(() => {
|
|
341
341
|
const u = window.print;
|
|
342
|
-
return new Promise((
|
|
342
|
+
return new Promise((h) => {
|
|
343
343
|
const s = (y) => {
|
|
344
344
|
setTimeout(() => {
|
|
345
345
|
u.call(window), setTimeout(() => y(), 20);
|
|
346
346
|
}, 0);
|
|
347
347
|
};
|
|
348
348
|
if (document.querySelector(".rp-print-zone")) {
|
|
349
|
-
s(
|
|
349
|
+
s(h);
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
|
-
const
|
|
353
|
-
document.querySelector(".rp-print-zone") && (s(
|
|
352
|
+
const T = new MutationObserver(() => {
|
|
353
|
+
document.querySelector(".rp-print-zone") && (s(h), T.disconnect());
|
|
354
354
|
});
|
|
355
|
-
|
|
355
|
+
T.observe(document.body, { childList: !0, subtree: !0 });
|
|
356
356
|
});
|
|
357
357
|
}, []), v = async (u) => {
|
|
358
|
-
const
|
|
359
|
-
return s.classList.add("rp-print-page"), await new Promise((
|
|
358
|
+
const h = document.createElement("img"), s = document.createElement("div");
|
|
359
|
+
return s.classList.add("rp-print-page"), await new Promise((b, T) => {
|
|
360
360
|
u.toBlob((y) => {
|
|
361
|
-
y ? (
|
|
362
|
-
URL.revokeObjectURL(
|
|
363
|
-
},
|
|
361
|
+
y ? (h.src = URL.createObjectURL(y), h.onload = () => {
|
|
362
|
+
URL.revokeObjectURL(h.src), b();
|
|
363
|
+
}, h.onerror = T) : T(new Error("Failed to create blob"));
|
|
364
364
|
});
|
|
365
365
|
}).catch(() => {
|
|
366
|
-
}), s.appendChild(
|
|
367
|
-
}, I = (u,
|
|
366
|
+
}), s.appendChild(h), s;
|
|
367
|
+
}, I = (u, h) => {
|
|
368
368
|
const s = document.createElement("div");
|
|
369
369
|
s.classList.add("rp-print-zone");
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
372
|
-
const { width: y, height: x } =
|
|
373
|
-
|
|
370
|
+
const b = document.createElement("style"), T = h.get(1);
|
|
371
|
+
if (T) {
|
|
372
|
+
const { width: y, height: x } = T == null ? void 0 : T.page.getViewport({ scale: 1 });
|
|
373
|
+
b.innerHTML = `@page { size: ${y}px ${x}px }`;
|
|
374
374
|
}
|
|
375
|
-
return s.appendChild(
|
|
375
|
+
return s.appendChild(b), s.append(...u), s;
|
|
376
376
|
}, g = E(async () => {
|
|
377
377
|
if (!t)
|
|
378
378
|
return;
|
|
379
|
-
|
|
380
|
-
const u = document.createElement("canvas"),
|
|
379
|
+
p();
|
|
380
|
+
const u = document.createElement("canvas"), h = [];
|
|
381
381
|
try {
|
|
382
382
|
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
383
|
-
const
|
|
383
|
+
const b = t.getOptionalContentConfig({ intent: "print" }), T = Promise.resolve(
|
|
384
384
|
t.annotationStorage.print ?? void 0
|
|
385
385
|
), y = e.size;
|
|
386
386
|
for (const [S, R] of e) {
|
|
387
|
-
if (
|
|
388
|
-
|
|
387
|
+
if (f.current) {
|
|
388
|
+
p();
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
const L = R.page.getViewport({ scale: 1 });
|
|
@@ -395,49 +395,49 @@ const Pn = () => {
|
|
|
395
395
|
pageNumber: S,
|
|
396
396
|
viewerPdfPage: L,
|
|
397
397
|
printResolution: 150,
|
|
398
|
-
optionalContentConfigPromise:
|
|
399
|
-
printAnnotationStoragePromise:
|
|
400
|
-
}),
|
|
401
|
-
|
|
398
|
+
optionalContentConfigPromise: b,
|
|
399
|
+
printAnnotationStoragePromise: T
|
|
400
|
+
}), f.current) {
|
|
401
|
+
p();
|
|
402
402
|
return;
|
|
403
403
|
}
|
|
404
404
|
const N = await v(u);
|
|
405
|
-
|
|
406
|
-
const
|
|
405
|
+
h.push(N);
|
|
406
|
+
const M = parseFloat((h.length / y * 100).toFixed(2));
|
|
407
407
|
r({
|
|
408
408
|
loadedPages: S,
|
|
409
409
|
totalPages: y,
|
|
410
|
-
percentage:
|
|
410
|
+
percentage: M
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
|
-
if (
|
|
414
|
-
|
|
413
|
+
if (f.current) {
|
|
414
|
+
p();
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
const x = I(
|
|
418
|
-
document.body.appendChild(x), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await
|
|
417
|
+
const x = I(h, e);
|
|
418
|
+
document.body.appendChild(x), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await w();
|
|
419
419
|
} catch (s) {
|
|
420
|
-
d(!0), s instanceof Error &&
|
|
420
|
+
d(!0), s instanceof Error && m(s);
|
|
421
421
|
} finally {
|
|
422
422
|
u.height = 0, u.width = 0;
|
|
423
423
|
}
|
|
424
|
-
}, [t, e,
|
|
424
|
+
}, [t, e, f]);
|
|
425
425
|
return D(() => {
|
|
426
426
|
const u = () => {
|
|
427
|
-
|
|
427
|
+
p(), C();
|
|
428
428
|
};
|
|
429
429
|
return window.addEventListener("afterprint", u, !0), () => {
|
|
430
430
|
window.removeEventListener("afterprint", u, !0);
|
|
431
431
|
};
|
|
432
|
-
}, [C,
|
|
432
|
+
}, [C, p]), {
|
|
433
433
|
print: g,
|
|
434
|
-
cancel:
|
|
434
|
+
cancel: _,
|
|
435
435
|
progress: n,
|
|
436
436
|
isComplete: o,
|
|
437
|
-
isError:
|
|
438
|
-
error:
|
|
437
|
+
isError: l,
|
|
438
|
+
error: c
|
|
439
439
|
};
|
|
440
|
-
},
|
|
440
|
+
}, Pn = Ve({
|
|
441
441
|
print: () => {
|
|
442
442
|
},
|
|
443
443
|
cancel: () => {
|
|
@@ -454,58 +454,58 @@ const Pn = () => {
|
|
|
454
454
|
console.error("Error in setOnError callback:", e);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
-
}),
|
|
458
|
-
const [e, n] = $(null), [r, o] = $(null), { print: a, cancel:
|
|
457
|
+
}), mc = ({ children: t }) => {
|
|
458
|
+
const [e, n] = $(null), [r, o] = $(null), { print: a, cancel: l, progress: d, isComplete: c, isError: m, error: f } = $r(), C = E((v) => {
|
|
459
459
|
v && typeof v == "function" && o(() => v);
|
|
460
|
-
}, []),
|
|
461
|
-
|
|
462
|
-
},
|
|
460
|
+
}, []), p = (v) => {
|
|
461
|
+
f && v(f);
|
|
462
|
+
}, _ = E(
|
|
463
463
|
(v) => {
|
|
464
464
|
n(() => v);
|
|
465
465
|
},
|
|
466
466
|
[d, e]
|
|
467
467
|
);
|
|
468
468
|
D(() => {
|
|
469
|
-
|
|
470
|
-
}, [
|
|
471
|
-
|
|
469
|
+
c && r && P();
|
|
470
|
+
}, [c, r]), D(() => {
|
|
471
|
+
m && p((v) => {
|
|
472
472
|
console.error(v);
|
|
473
473
|
});
|
|
474
|
-
}, [
|
|
474
|
+
}, [m]), D(() => {
|
|
475
475
|
d && e && e(d);
|
|
476
476
|
}, [d, e]);
|
|
477
477
|
const P = () => {
|
|
478
478
|
r && (r(), o(null));
|
|
479
|
-
},
|
|
479
|
+
}, w = {
|
|
480
480
|
print: a,
|
|
481
|
-
cancel:
|
|
482
|
-
setOnProgress:
|
|
481
|
+
cancel: l,
|
|
482
|
+
setOnProgress: _,
|
|
483
483
|
setOnComplete: C,
|
|
484
|
-
setOnError:
|
|
484
|
+
setOnError: p,
|
|
485
485
|
progress: d
|
|
486
486
|
};
|
|
487
|
-
return /* @__PURE__ */ i(
|
|
487
|
+
return /* @__PURE__ */ i(Pn.Provider, { value: w, children: t });
|
|
488
488
|
}, it = () => {
|
|
489
|
-
const t = Be(
|
|
489
|
+
const t = Be(Pn);
|
|
490
490
|
if (!t)
|
|
491
491
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
492
492
|
return t;
|
|
493
|
-
},
|
|
494
|
-
const [t, e] = $({}), { pages: n } =
|
|
495
|
-
(
|
|
493
|
+
}, qr = () => {
|
|
494
|
+
const [t, e] = $({}), { pages: n } = re(), r = k(() => Object.keys(t).length, [t]), o = E(
|
|
495
|
+
(l) => {
|
|
496
496
|
if (!n.size)
|
|
497
497
|
return;
|
|
498
|
-
const d =
|
|
499
|
-
const { thumbnailViewport: C, scale:
|
|
498
|
+
const d = l > n.size ? n.size : l, m = Array.from(n.values()).slice(0, d).map((f) => {
|
|
499
|
+
const { thumbnailViewport: C, scale: p } = hr(f.page, f.defaultRotation);
|
|
500
500
|
return {
|
|
501
|
-
scale:
|
|
502
|
-
page:
|
|
501
|
+
scale: p,
|
|
502
|
+
page: f.page,
|
|
503
503
|
loading: !0,
|
|
504
504
|
viewport: C,
|
|
505
|
-
defaultRotation:
|
|
505
|
+
defaultRotation: f.defaultRotation
|
|
506
506
|
};
|
|
507
|
-
}).reduce((
|
|
508
|
-
e(
|
|
507
|
+
}).reduce((f, C) => (f[C.page.pageNumber] = C, f), {});
|
|
508
|
+
e(m);
|
|
509
509
|
},
|
|
510
510
|
[n]
|
|
511
511
|
);
|
|
@@ -513,13 +513,13 @@ const Pn = () => {
|
|
|
513
513
|
o(10);
|
|
514
514
|
}, [o]);
|
|
515
515
|
const a = E(
|
|
516
|
-
(
|
|
516
|
+
(l) => {
|
|
517
517
|
if (!n)
|
|
518
518
|
return;
|
|
519
|
-
const d = n.get(
|
|
520
|
-
d && e((
|
|
521
|
-
...
|
|
522
|
-
[
|
|
519
|
+
const d = n.get(l);
|
|
520
|
+
d && e((c) => ({
|
|
521
|
+
...c,
|
|
522
|
+
[l]: {
|
|
523
523
|
loading: !0,
|
|
524
524
|
page: d.page,
|
|
525
525
|
viewport: d.thumbnailViewport,
|
|
@@ -531,7 +531,7 @@ const Pn = () => {
|
|
|
531
531
|
[n]
|
|
532
532
|
);
|
|
533
533
|
return { thumbnailPages: t, addPage: a, addToPage: o, thumbnailLength: r };
|
|
534
|
-
},
|
|
534
|
+
}, yn = Ve({
|
|
535
535
|
thumbnailPages: {},
|
|
536
536
|
addPage: (t) => {
|
|
537
537
|
},
|
|
@@ -541,44 +541,44 @@ const Pn = () => {
|
|
|
541
541
|
setActive: (t) => {
|
|
542
542
|
},
|
|
543
543
|
active: !1
|
|
544
|
-
}),
|
|
544
|
+
}), In = () => Be(yn), gc = ({
|
|
545
545
|
children: t,
|
|
546
546
|
initialThumbnailsVisible: e
|
|
547
547
|
}) => {
|
|
548
|
-
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: a } =
|
|
548
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: a } = qr(), [l, d] = $(e);
|
|
549
549
|
return /* @__PURE__ */ i(
|
|
550
|
-
|
|
550
|
+
yn.Provider,
|
|
551
551
|
{
|
|
552
|
-
value: { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: a, active:
|
|
552
|
+
value: { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: a, active: l, setActive: d },
|
|
553
553
|
children: t
|
|
554
554
|
}
|
|
555
555
|
);
|
|
556
|
-
},
|
|
557
|
-
const [n, r] = $(e), [o, a] = $(!1), { pdf:
|
|
556
|
+
}, Gr = (t = {}, e = "") => {
|
|
557
|
+
const [n, r] = $(e), [o, a] = $(!1), { pdf: l, pages: d } = re(), { widths: c, heights: m } = Ze(), f = H(!n), { currentZoom: C } = tt(), [p, _] = $([]), { setFocusedPage: P } = he(), { columnCount: w } = He(), { pageRotate: v } = ot(), [I, g] = $(0), { pageScrollElementRef: u, virtualScrollableElementRef: h } = nt(), { scrollMode: s } = ze(), { pagesRef: b } = Ce(), [T, y] = $(null), x = H({}), S = H(0), R = k(() => I === 0 ? null : p[I - 1], [I, p]), L = k(() => p.length, [p]), N = E(
|
|
558
558
|
(F) => {
|
|
559
559
|
if (F === 0)
|
|
560
560
|
return;
|
|
561
|
-
const O =
|
|
561
|
+
const O = p[F - 1];
|
|
562
562
|
if (!O || !d)
|
|
563
563
|
return;
|
|
564
|
-
const
|
|
565
|
-
if (!
|
|
564
|
+
const G = h || u;
|
|
565
|
+
if (!G || !b)
|
|
566
566
|
return;
|
|
567
|
-
const
|
|
568
|
-
if (s ===
|
|
567
|
+
const q = d.get(O.page);
|
|
568
|
+
if (s === ie.PAGE_SCROLLING && P(O.page), !q)
|
|
569
569
|
return;
|
|
570
570
|
let V = 0, B = 0;
|
|
571
|
-
if (s ===
|
|
572
|
-
const ce = O.page - 1, ae =
|
|
573
|
-
V =
|
|
571
|
+
if (s === ie.VERTICAL_SCROLLING) {
|
|
572
|
+
const ce = O.page - 1, ae = w, we = ce % ae, _e = Math.floor(ce / ae);
|
|
573
|
+
V = ke(m, _e), B = ke(c, we);
|
|
574
574
|
}
|
|
575
|
-
s ===
|
|
575
|
+
s === ie.HORIZONTAL_SCROLLING && (B = c.slice(0, O.page - 1).reduce((ce, ae) => ce + ae, 0));
|
|
576
576
|
const ee = {
|
|
577
|
-
height:
|
|
578
|
-
width:
|
|
579
|
-
}, U = v[O.page], { leftInPage: Q, topInPage: Y } =
|
|
577
|
+
height: m[O.page - 1],
|
|
578
|
+
width: c[O.page - 1]
|
|
579
|
+
}, U = v[O.page], { leftInPage: Q, topInPage: Y } = pr(
|
|
580
580
|
ee,
|
|
581
|
-
|
|
581
|
+
b,
|
|
582
582
|
O.rect,
|
|
583
583
|
C,
|
|
584
584
|
U
|
|
@@ -586,7 +586,7 @@ const Pn = () => {
|
|
|
586
586
|
left: Math.max(te, 0),
|
|
587
587
|
top: Math.max(ne, 0)
|
|
588
588
|
};
|
|
589
|
-
|
|
589
|
+
G.scrollTo({
|
|
590
590
|
...J,
|
|
591
591
|
behavior: "smooth"
|
|
592
592
|
});
|
|
@@ -594,19 +594,19 @@ const Pn = () => {
|
|
|
594
594
|
[
|
|
595
595
|
d,
|
|
596
596
|
P,
|
|
597
|
-
|
|
598
|
-
|
|
597
|
+
c,
|
|
598
|
+
m,
|
|
599
599
|
s,
|
|
600
|
-
|
|
600
|
+
h,
|
|
601
601
|
u,
|
|
602
|
-
|
|
603
|
-
|
|
602
|
+
b,
|
|
603
|
+
p
|
|
604
604
|
]
|
|
605
605
|
);
|
|
606
606
|
D(() => {
|
|
607
607
|
I && N(I);
|
|
608
608
|
}, [I]);
|
|
609
|
-
const
|
|
609
|
+
const M = E(() => {
|
|
610
610
|
g((F) => {
|
|
611
611
|
let O;
|
|
612
612
|
return L ? F + 1 > L ? O = 1 : O = F + 1 : O = 0, S.current = O, O;
|
|
@@ -619,49 +619,49 @@ const Pn = () => {
|
|
|
619
619
|
}, [L, N]), z = E(async (F) => {
|
|
620
620
|
if (!F)
|
|
621
621
|
return {};
|
|
622
|
-
const O = F.numPages,
|
|
623
|
-
for (let
|
|
624
|
-
if (
|
|
622
|
+
const O = F.numPages, G = {};
|
|
623
|
+
for (let q = 1; q <= O; q++) {
|
|
624
|
+
if (f.current)
|
|
625
625
|
throw "close pop over";
|
|
626
|
-
const V = await F.getPage(
|
|
627
|
-
q
|
|
626
|
+
const V = await F.getPage(q);
|
|
627
|
+
G[q.toString()] = await V.getTextContent();
|
|
628
628
|
}
|
|
629
|
-
return
|
|
629
|
+
return G;
|
|
630
630
|
}, []);
|
|
631
631
|
return D(() => {
|
|
632
632
|
if (!n) {
|
|
633
|
-
|
|
633
|
+
f.current = !0, _([]), g(0);
|
|
634
634
|
return;
|
|
635
635
|
}
|
|
636
|
-
|
|
636
|
+
f.current = !1, a(!0), _([]), g(0), z(l).then((F) => {
|
|
637
637
|
x.current = F;
|
|
638
|
-
const
|
|
639
|
-
const B =
|
|
638
|
+
const G = Object.keys(F).reduce((q, V) => {
|
|
639
|
+
const B = Co(
|
|
640
640
|
[n],
|
|
641
641
|
F[V],
|
|
642
642
|
Number(V) - 1,
|
|
643
643
|
t
|
|
644
644
|
).map((ee, U) => ({ ...ee, page: Number(V), pageMatchIdx: U }));
|
|
645
|
-
return [...
|
|
645
|
+
return [...q, ...B];
|
|
646
646
|
}, []);
|
|
647
|
-
|
|
647
|
+
_(G), g(G.length ? 1 : 0);
|
|
648
648
|
}).catch(() => {
|
|
649
|
-
|
|
649
|
+
_([]), g(0);
|
|
650
650
|
}).finally(() => a(!1));
|
|
651
|
-
}, [n, z,
|
|
651
|
+
}, [n, z, l, t]), {
|
|
652
652
|
search: n,
|
|
653
653
|
setSearch: r,
|
|
654
654
|
loading: o,
|
|
655
|
-
matches:
|
|
655
|
+
matches: p,
|
|
656
656
|
totalMatches: L,
|
|
657
657
|
currentMatchPosition: I,
|
|
658
658
|
currentMatch: R,
|
|
659
|
-
nextMatch:
|
|
659
|
+
nextMatch: M,
|
|
660
660
|
prevMatch: A,
|
|
661
|
-
currentMatchElement:
|
|
661
|
+
currentMatchElement: T,
|
|
662
662
|
setCurrentMatchElement: y
|
|
663
663
|
};
|
|
664
|
-
},
|
|
664
|
+
}, Sn = Ve({
|
|
665
665
|
search: "",
|
|
666
666
|
setSearch: (t) => {
|
|
667
667
|
},
|
|
@@ -679,71 +679,71 @@ const Pn = () => {
|
|
|
679
679
|
currentMatchElement: null,
|
|
680
680
|
setCurrentMatchElement: (t) => {
|
|
681
681
|
}
|
|
682
|
-
}),
|
|
682
|
+
}), vc = ({
|
|
683
683
|
children: t,
|
|
684
684
|
initialSearch: e
|
|
685
685
|
}) => {
|
|
686
686
|
const [n, r] = $({}), {
|
|
687
687
|
loading: o,
|
|
688
688
|
setSearch: a,
|
|
689
|
-
totalMatches:
|
|
689
|
+
totalMatches: l,
|
|
690
690
|
currentMatchPosition: d,
|
|
691
|
-
currentMatch:
|
|
692
|
-
search:
|
|
693
|
-
matches:
|
|
691
|
+
currentMatch: c,
|
|
692
|
+
search: m,
|
|
693
|
+
matches: f,
|
|
694
694
|
nextMatch: C,
|
|
695
|
-
prevMatch:
|
|
696
|
-
currentMatchElement:
|
|
695
|
+
prevMatch: p,
|
|
696
|
+
currentMatchElement: _,
|
|
697
697
|
setCurrentMatchElement: P
|
|
698
|
-
} =
|
|
698
|
+
} = Gr(n, e);
|
|
699
699
|
return /* @__PURE__ */ i(
|
|
700
|
-
|
|
700
|
+
Sn.Provider,
|
|
701
701
|
{
|
|
702
702
|
value: {
|
|
703
703
|
searchOptions: n,
|
|
704
704
|
setSearchOptions: r,
|
|
705
705
|
loading: o,
|
|
706
706
|
setSearch: a,
|
|
707
|
-
totalMatches:
|
|
707
|
+
totalMatches: l,
|
|
708
708
|
currentMatchPosition: d,
|
|
709
|
-
currentMatch:
|
|
709
|
+
currentMatch: c,
|
|
710
710
|
nextMatch: C,
|
|
711
|
-
prevMatch:
|
|
712
|
-
search:
|
|
713
|
-
matches:
|
|
714
|
-
currentMatchElement:
|
|
711
|
+
prevMatch: p,
|
|
712
|
+
search: m,
|
|
713
|
+
matches: f,
|
|
714
|
+
currentMatchElement: _,
|
|
715
715
|
setCurrentMatchElement: P
|
|
716
716
|
},
|
|
717
717
|
children: t
|
|
718
718
|
}
|
|
719
719
|
);
|
|
720
|
-
}, Nt = () => Be(
|
|
721
|
-
const e = H(!1), [n, r] = $([]), o = E((
|
|
722
|
-
r((
|
|
723
|
-
}, []), a =
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
720
|
+
}, Nt = () => Be(Sn), xn = Ve(null), wc = ({ children: t }) => {
|
|
721
|
+
const e = H(!1), [n, r] = $([]), o = E((c) => {
|
|
722
|
+
r((m) => [...m, { id: c.page.pageNumber.toString(), data: c, priority: 0 }]);
|
|
723
|
+
}, []), a = k(() => new Ro(o), [o]), { focusedPage: l } = he(), d = E((c) => (e.current = !0, Lo(
|
|
724
|
+
c.data.page,
|
|
725
|
+
c.data.canvasElem,
|
|
726
|
+
c.data.options
|
|
727
727
|
).promise.then(() => {
|
|
728
|
-
|
|
728
|
+
c.data.canvasElem.hidden = !1;
|
|
729
729
|
}).finally(() => {
|
|
730
|
-
|
|
730
|
+
c.data.onLoaded && c.data.onLoaded();
|
|
731
731
|
})), []);
|
|
732
732
|
return D(() => {
|
|
733
|
-
|
|
734
|
-
}, [
|
|
733
|
+
l && (a.changePagePriority(`^page-${l}`, 0), a.changePagePriority(`^thumbnail-${l}`, 1));
|
|
734
|
+
}, [l]), D(() => {
|
|
735
735
|
if (a.isEmpty() || e.current)
|
|
736
736
|
return;
|
|
737
|
-
const
|
|
738
|
-
const
|
|
739
|
-
|
|
740
|
-
|
|
737
|
+
const c = () => {
|
|
738
|
+
const m = a.dequeue();
|
|
739
|
+
m ? d(m).finally(() => {
|
|
740
|
+
c();
|
|
741
741
|
}) : (e.current = !1, r(a.peekAll()));
|
|
742
742
|
};
|
|
743
|
-
|
|
744
|
-
}, [a, d, n]), /* @__PURE__ */ i(
|
|
745
|
-
},
|
|
746
|
-
const t = Be(
|
|
743
|
+
c();
|
|
744
|
+
}, [a, d, n]), /* @__PURE__ */ i(xn.Provider, { value: a, children: t });
|
|
745
|
+
}, Rn = () => {
|
|
746
|
+
const t = Be(xn);
|
|
747
747
|
if (!t)
|
|
748
748
|
throw new Error("RenderQueue not found");
|
|
749
749
|
return t;
|
|
@@ -762,24 +762,24 @@ const Pn = () => {
|
|
|
762
762
|
"rp-page-wrapper": "_rp-page-wrapper_ii91u_1",
|
|
763
763
|
"rp-page": "_rp-page_ii91u_1",
|
|
764
764
|
"rp-loader-wrapper": "_rp-loader-wrapper_ii91u_15"
|
|
765
|
-
},
|
|
766
|
-
const { pageNumber: e, onLoaded: n, onLoading: r } = t, o = H(null), { pages: a } =
|
|
765
|
+
}, Ur = (t) => {
|
|
766
|
+
const { pageNumber: e, onLoaded: n, onLoading: r } = t, o = H(null), { pages: a } = re(), { pageRotate: l } = ot(), d = H(), { currentZoom: c } = tt(), m = Rn(), f = H(`page-${e}`);
|
|
767
767
|
return D(() => {
|
|
768
|
-
if (!a ||
|
|
768
|
+
if (!a || c === 0)
|
|
769
769
|
return;
|
|
770
770
|
const C = a.get(e);
|
|
771
771
|
if (o.current && C) {
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
|
|
772
|
+
const p = o.current;
|
|
773
|
+
p.hidden = !0;
|
|
774
|
+
const _ = d.current;
|
|
775
|
+
_ && _.cancel(), r && r(), m.enqueue(
|
|
776
|
+
f.current,
|
|
777
777
|
{
|
|
778
778
|
page: C.page,
|
|
779
|
-
canvasElem:
|
|
779
|
+
canvasElem: p,
|
|
780
780
|
options: {
|
|
781
|
-
scale:
|
|
782
|
-
rotate:
|
|
781
|
+
scale: c,
|
|
782
|
+
rotate: l[e],
|
|
783
783
|
renderForms: !0
|
|
784
784
|
},
|
|
785
785
|
onLoaded: n
|
|
@@ -788,78 +788,78 @@ const Pn = () => {
|
|
|
788
788
|
);
|
|
789
789
|
}
|
|
790
790
|
return () => {
|
|
791
|
-
|
|
791
|
+
m.removeQueue(f.current);
|
|
792
792
|
};
|
|
793
|
-
}, [a, e,
|
|
794
|
-
},
|
|
793
|
+
}, [a, e, l, c, r, n, m]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${e}-canvas`, ref: o });
|
|
794
|
+
}, Vr = "_selecting_ppr5g_10", Br = "_markedContent_ppr5g_33", be = {
|
|
795
795
|
"rp-text-layer": "_rp-text-layer_ppr5g_1",
|
|
796
|
-
selecting:
|
|
797
|
-
markedContent:
|
|
796
|
+
selecting: Vr,
|
|
797
|
+
markedContent: Br,
|
|
798
798
|
"rp-text-layer-text": "_rp-text-layer-text_ppr5g_52"
|
|
799
|
-
},
|
|
800
|
-
const { pageNumber: e } = t, { pages: n } =
|
|
799
|
+
}, Zr = (t) => {
|
|
800
|
+
const { pageNumber: e } = t, { pages: n } = re(), r = H(null), { matches: o, currentMatch: a, setCurrentMatchElement: l } = Nt(), [d, c] = $(
|
|
801
801
|
[]
|
|
802
|
-
),
|
|
803
|
-
(u,
|
|
804
|
-
if (s &&
|
|
805
|
-
C.current = [],
|
|
802
|
+
), m = H(), f = H(), C = H([]), p = k(() => o.filter((u) => u.pageIndex === e - 1), [o, e]), _ = E(
|
|
803
|
+
(u, h, s = !1) => {
|
|
804
|
+
if (s && Po(u, h), !p.length) {
|
|
805
|
+
C.current = [], c([]);
|
|
806
806
|
return;
|
|
807
807
|
}
|
|
808
|
-
const
|
|
809
|
-
|
|
808
|
+
const b = yo(p, u, h);
|
|
809
|
+
c(b);
|
|
810
810
|
},
|
|
811
|
-
[
|
|
812
|
-
), P = H(),
|
|
811
|
+
[p]
|
|
812
|
+
), P = H(), w = H(!1), v = E(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
813
813
|
D(() => ((() => {
|
|
814
814
|
if (P.current)
|
|
815
815
|
return;
|
|
816
816
|
P.current = new AbortController();
|
|
817
|
-
const { signal:
|
|
818
|
-
v().forEach((
|
|
819
|
-
const y =
|
|
820
|
-
y && (
|
|
817
|
+
const { signal: h } = P.current, s = () => {
|
|
818
|
+
v().forEach((T) => {
|
|
819
|
+
const y = T.querySelector(".endOfContent");
|
|
820
|
+
y && (T.appendChild(y), y.style.width = "", y.style.height = "", T.classList.remove(be.selecting));
|
|
821
821
|
});
|
|
822
822
|
};
|
|
823
823
|
document.addEventListener(
|
|
824
824
|
"pointerdown",
|
|
825
825
|
() => {
|
|
826
|
-
|
|
826
|
+
w.current = !0;
|
|
827
827
|
},
|
|
828
|
-
{ signal:
|
|
828
|
+
{ signal: h }
|
|
829
829
|
), document.addEventListener(
|
|
830
830
|
"pointerup",
|
|
831
831
|
() => {
|
|
832
|
-
|
|
832
|
+
w.current = !1, s();
|
|
833
833
|
},
|
|
834
|
-
{ signal:
|
|
834
|
+
{ signal: h }
|
|
835
835
|
), window.addEventListener(
|
|
836
836
|
"blur",
|
|
837
837
|
() => {
|
|
838
|
-
|
|
838
|
+
w.current = !1, s();
|
|
839
839
|
},
|
|
840
|
-
{ signal:
|
|
840
|
+
{ signal: h }
|
|
841
841
|
), document.addEventListener(
|
|
842
842
|
"keyup",
|
|
843
843
|
() => {
|
|
844
|
-
|
|
844
|
+
w.current || s();
|
|
845
845
|
},
|
|
846
|
-
{ signal:
|
|
846
|
+
{ signal: h }
|
|
847
847
|
);
|
|
848
|
-
let
|
|
848
|
+
let b = null;
|
|
849
849
|
document.addEventListener(
|
|
850
850
|
"selectionchange",
|
|
851
851
|
() => {
|
|
852
|
-
var
|
|
853
|
-
const
|
|
854
|
-
if (!
|
|
852
|
+
var M, A;
|
|
853
|
+
const T = document.getSelection();
|
|
854
|
+
if (!T)
|
|
855
855
|
return;
|
|
856
|
-
if (
|
|
856
|
+
if (T.rangeCount === 0) {
|
|
857
857
|
s();
|
|
858
858
|
return;
|
|
859
859
|
}
|
|
860
860
|
const y = /* @__PURE__ */ new Set();
|
|
861
|
-
for (let z = 0; z <
|
|
862
|
-
const F =
|
|
861
|
+
for (let z = 0; z < T.rangeCount; z++) {
|
|
862
|
+
const F = T.getRangeAt(z);
|
|
863
863
|
v().forEach((O) => {
|
|
864
864
|
F.intersectsNode(O) && !y.has(O) && y.add(O);
|
|
865
865
|
});
|
|
@@ -872,19 +872,19 @@ const Pn = () => {
|
|
|
872
872
|
F && (z.appendChild(F), F.style.width = "", F.style.height = "", z.classList.remove(be.selecting));
|
|
873
873
|
}
|
|
874
874
|
});
|
|
875
|
-
const x =
|
|
876
|
-
let R =
|
|
875
|
+
const x = T.getRangeAt(0);
|
|
876
|
+
let R = b && (x.compareBoundaryPoints(Range.END_TO_END, b) === 0 || x.compareBoundaryPoints(Range.START_TO_END, b) === 0) ? x.startContainer : x.endContainer;
|
|
877
877
|
R.nodeType === Node.TEXT_NODE && (R = R.parentNode);
|
|
878
|
-
const L = (
|
|
878
|
+
const L = (M = R.parentElement) == null ? void 0 : M.closest(
|
|
879
879
|
be["rp-text-layer"]
|
|
880
880
|
), N = L == null ? void 0 : L.querySelector(".endOfContent");
|
|
881
|
-
N && L && (N.style.width = L.style.width, N.style.height = L.style.height, (A = R.parentElement) == null || A.insertBefore(N, R.nextSibling)),
|
|
881
|
+
N && L && (N.style.width = L.style.width, N.style.height = L.style.height, (A = R.parentElement) == null || A.insertBefore(N, R.nextSibling)), b = x.cloneRange();
|
|
882
882
|
},
|
|
883
|
-
{ signal:
|
|
883
|
+
{ signal: h }
|
|
884
884
|
);
|
|
885
885
|
})(), () => {
|
|
886
|
-
var
|
|
887
|
-
(
|
|
886
|
+
var h;
|
|
887
|
+
(h = P.current) == null || h.abort(), P.current = void 0;
|
|
888
888
|
}), [v]);
|
|
889
889
|
const I = E(() => {
|
|
890
890
|
r.current && r.current.classList.add(be.selecting);
|
|
@@ -896,49 +896,49 @@ const Pn = () => {
|
|
|
896
896
|
s.classList.remove("selected");
|
|
897
897
|
}), !d.length || !a || a.pageIndex !== e - 1)
|
|
898
898
|
return;
|
|
899
|
-
const u =
|
|
899
|
+
const u = p.findIndex(
|
|
900
900
|
(s) => JSON.stringify(s) === JSON.stringify(a)
|
|
901
901
|
);
|
|
902
902
|
if (u === -1)
|
|
903
903
|
return;
|
|
904
|
-
const
|
|
905
|
-
|
|
904
|
+
const h = d.filter((s) => s.index === u);
|
|
905
|
+
h.length && (C.current = h.map((s) => s.element), l(h[0].element), h.forEach((s) => {
|
|
906
906
|
s.element.classList.add("selected");
|
|
907
907
|
}));
|
|
908
|
-
}, [a, d,
|
|
908
|
+
}, [a, d, p]), D(() => {
|
|
909
909
|
const u = n.get(e);
|
|
910
910
|
if (!u || !r.current)
|
|
911
911
|
return;
|
|
912
|
-
const
|
|
913
|
-
return
|
|
914
|
-
const
|
|
915
|
-
return
|
|
916
|
-
viewport:
|
|
912
|
+
const h = r.current;
|
|
913
|
+
return m.current && m.current.cancel(), u.page.getTextContent().then((s) => {
|
|
914
|
+
const b = u.page.getViewport({ scale: 1 });
|
|
915
|
+
return m.current = new Bo.TextLayer({
|
|
916
|
+
viewport: b,
|
|
917
917
|
textContentSource: s,
|
|
918
|
-
container:
|
|
919
|
-
}),
|
|
918
|
+
container: h
|
|
919
|
+
}), f.current = s, h && (h.innerText = ""), m.current.render();
|
|
920
920
|
}).then(() => {
|
|
921
921
|
var y, x;
|
|
922
|
-
[].slice.call(
|
|
922
|
+
[].slice.call(h.children).forEach((S) => {
|
|
923
923
|
S.classList.add(be["rp-text-layer-text"]), S.setAttribute("data-rp", "rp-text-layer-text");
|
|
924
924
|
});
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
const
|
|
928
|
-
|
|
925
|
+
const b = (y = m.current) == null ? void 0 : y.textDivs;
|
|
926
|
+
b && f.current && _(f.current, b);
|
|
927
|
+
const T = document.createElement("div");
|
|
928
|
+
T.className = "endOfContent", (x = r.current) == null || x.appendChild(T);
|
|
929
929
|
}).catch(() => {
|
|
930
930
|
}), () => {
|
|
931
931
|
var s;
|
|
932
|
-
(s =
|
|
932
|
+
(s = m.current) == null || s.cancel();
|
|
933
933
|
};
|
|
934
934
|
}, [n, e]), D(() => {
|
|
935
935
|
var s;
|
|
936
|
-
[].slice.call(r.current.children).forEach((
|
|
937
|
-
|
|
936
|
+
[].slice.call(r.current.children).forEach((b) => {
|
|
937
|
+
b.classList.add(be["rp-text-layer-text"]);
|
|
938
938
|
});
|
|
939
|
-
const
|
|
940
|
-
|
|
941
|
-
}, [
|
|
939
|
+
const h = (s = m.current) == null ? void 0 : s.textDivs;
|
|
940
|
+
h && f.current && _(f.current, h, !0);
|
|
941
|
+
}, [_]), /* @__PURE__ */ i(
|
|
942
942
|
"div",
|
|
943
943
|
{
|
|
944
944
|
"data-rp-text-layer": !0,
|
|
@@ -949,182 +949,181 @@ const Pn = () => {
|
|
|
949
949
|
onMouseUp: g
|
|
950
950
|
}
|
|
951
951
|
);
|
|
952
|
-
},
|
|
952
|
+
}, jr = {
|
|
953
953
|
"rp-annotation-layer": "_rp-annotation-layer_smepy_1"
|
|
954
954
|
};
|
|
955
|
-
let
|
|
956
|
-
const
|
|
957
|
-
const { pageNumber: e } = t, n = H(null), { pages: r, pdf: o } =
|
|
955
|
+
let Kr = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
956
|
+
const Xr = (t) => {
|
|
957
|
+
const { pageNumber: e } = t, n = H(null), { pages: r, pdf: o } = re(), a = H(), [l, d] = $(), { goToPage: c } = he(), { scrollMode: m } = ze(), { print: f } = it(), { download: C } = Zn(), p = k(() => r.get(e), [r, e]), _ = k(() => p == null ? void 0 : p.page.getViewport(), [p]);
|
|
958
958
|
D(() => {
|
|
959
959
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
960
960
|
}, [o]), D(() => {
|
|
961
|
-
|
|
962
|
-
a.current = void 0, d(
|
|
961
|
+
p && p.page.getAnnotations().then((w) => {
|
|
962
|
+
a.current = void 0, d(w), n.current && (n.current.innerText = "");
|
|
963
963
|
});
|
|
964
|
-
}, [
|
|
965
|
-
const
|
|
966
|
-
(
|
|
967
|
-
!
|
|
968
|
-
var
|
|
969
|
-
((
|
|
970
|
-
})
|
|
964
|
+
}, [p]);
|
|
965
|
+
const P = E(
|
|
966
|
+
(w) => {
|
|
967
|
+
!l || !o || (Yo(w), Jo(w, o, l).then((v) => {
|
|
968
|
+
var I, g;
|
|
969
|
+
((I = v == null ? void 0 : v.data) == null ? void 0 : I.action) === "Print" ? f() : ((g = v == null ? void 0 : v.data) == null ? void 0 : g.action) === "SaveAs" && C();
|
|
970
|
+
}));
|
|
971
971
|
},
|
|
972
|
-
[o,
|
|
972
|
+
[o, l, m, f, C]
|
|
973
973
|
);
|
|
974
974
|
return D(() => {
|
|
975
|
-
if (!
|
|
975
|
+
if (!p || !l)
|
|
976
976
|
return;
|
|
977
|
-
const
|
|
977
|
+
const w = p.page.getViewport();
|
|
978
978
|
if (a.current) {
|
|
979
979
|
a.current.update({
|
|
980
|
-
viewport:
|
|
980
|
+
viewport: w.clone({ dontFlip: !0 })
|
|
981
981
|
});
|
|
982
982
|
return;
|
|
983
983
|
}
|
|
984
|
-
const
|
|
985
|
-
for (const
|
|
986
|
-
const { annotationType:
|
|
987
|
-
switch (
|
|
988
|
-
case
|
|
989
|
-
|
|
990
|
-
break;
|
|
991
|
-
case Wt.Widget:
|
|
992
|
-
tr(p, v, I);
|
|
984
|
+
const v = /* @__PURE__ */ new Map([]);
|
|
985
|
+
for (const u of l) {
|
|
986
|
+
const { annotationType: h } = u;
|
|
987
|
+
switch (h) {
|
|
988
|
+
case ho.Widget:
|
|
989
|
+
er(u, w, v);
|
|
993
990
|
break;
|
|
994
991
|
}
|
|
995
992
|
}
|
|
996
|
-
const
|
|
993
|
+
const I = new AbortController();
|
|
997
994
|
return (async () => {
|
|
998
|
-
var
|
|
999
|
-
if (a.current && (a.current.div.replaceChildren(), a.current = void 0), n.current && (n.current.innerText = ""), a.current = new
|
|
995
|
+
var s;
|
|
996
|
+
if (a.current && (a.current.div.replaceChildren(), a.current = void 0), n.current && (n.current.innerText = ""), a.current = new Xo({
|
|
1000
997
|
div: n.current,
|
|
1001
998
|
accessibilityManager: void 0,
|
|
1002
999
|
annotationCanvasMap: void 0,
|
|
1003
1000
|
annotationEditorUIManager: void 0,
|
|
1004
1001
|
structTreeLayer: null,
|
|
1005
|
-
page:
|
|
1006
|
-
viewport:
|
|
1002
|
+
page: p.page,
|
|
1003
|
+
viewport: w.clone({ dontFlip: !0 }),
|
|
1007
1004
|
commentManager: void 0,
|
|
1008
|
-
linkService: new
|
|
1005
|
+
linkService: new Gt(o, c),
|
|
1009
1006
|
annotationStorage: o == null ? void 0 : o.annotationStorage
|
|
1010
|
-
}), n.current &&
|
|
1007
|
+
}), n.current && Ut(n.current, P), I.signal.aborted)
|
|
1011
1008
|
throw "abort";
|
|
1012
|
-
const
|
|
1013
|
-
return (
|
|
1014
|
-
annotations:
|
|
1009
|
+
const u = await (o == null ? void 0 : o.hasJSActions()), h = await (o == null ? void 0 : o.getFieldObjects());
|
|
1010
|
+
return (s = a.current) == null ? void 0 : s.render({
|
|
1011
|
+
annotations: l,
|
|
1015
1012
|
annotationStorage: o == null ? void 0 : o.annotationStorage,
|
|
1016
|
-
hasJSActions:
|
|
1017
|
-
fieldObjects:
|
|
1013
|
+
hasJSActions: u,
|
|
1014
|
+
fieldObjects: h,
|
|
1018
1015
|
div: n.current,
|
|
1019
|
-
viewport:
|
|
1020
|
-
page:
|
|
1021
|
-
imageResourcesPath:
|
|
1016
|
+
viewport: w.clone({ dontFlip: !0 }),
|
|
1017
|
+
page: p.page,
|
|
1018
|
+
imageResourcesPath: Kr,
|
|
1022
1019
|
renderForms: !0,
|
|
1023
|
-
linkService: new
|
|
1020
|
+
linkService: new Gt(o, c),
|
|
1024
1021
|
downloadManager: null,
|
|
1025
1022
|
enableScripting: !1
|
|
1026
1023
|
});
|
|
1027
1024
|
})().then(() => {
|
|
1028
|
-
n.current &&
|
|
1029
|
-
}).catch((
|
|
1030
|
-
if (
|
|
1031
|
-
throw
|
|
1025
|
+
n.current && tr(n.current, P);
|
|
1026
|
+
}).catch((u) => {
|
|
1027
|
+
if (u !== "abort")
|
|
1028
|
+
throw u;
|
|
1029
|
+
}).finally(() => {
|
|
1030
|
+
a.current = void 0;
|
|
1032
1031
|
}), () => {
|
|
1033
|
-
|
|
1032
|
+
I.abort("clear"), n.current && Ut(n.current, P);
|
|
1034
1033
|
};
|
|
1035
|
-
}, [o,
|
|
1034
|
+
}, [o, l, P, c]), /* @__PURE__ */ i(
|
|
1036
1035
|
"div",
|
|
1037
1036
|
{
|
|
1038
1037
|
"data-rp": `page-${e}-annotationLayer`,
|
|
1039
|
-
style: { width: `${
|
|
1040
|
-
className:
|
|
1038
|
+
style: { width: `${_ == null ? void 0 : _.width}px`, height: `${_ == null ? void 0 : _.height}px` },
|
|
1039
|
+
className: jr["rp-annotation-layer"],
|
|
1041
1040
|
ref: n
|
|
1042
1041
|
}
|
|
1043
1042
|
);
|
|
1044
|
-
},
|
|
1043
|
+
}, Qr = {
|
|
1045
1044
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1046
|
-
},
|
|
1047
|
-
const [n, r] = $(), { pages: o } =
|
|
1045
|
+
}, Yr = ({ pageNumber: t, viewport: e }) => {
|
|
1046
|
+
const [n, r] = $(), { pages: o } = re(), { highlightKeywords: a } = So(), l = !0, d = H(null), [c, m] = $(null), [f, C] = $([]);
|
|
1048
1047
|
D(() => {
|
|
1049
|
-
d.current &&
|
|
1048
|
+
d.current && m(d.current.parentElement);
|
|
1050
1049
|
}, [d]), D(() => {
|
|
1051
1050
|
(async () => {
|
|
1052
1051
|
const u = o.get(t);
|
|
1053
1052
|
if (!u || !d.current)
|
|
1054
1053
|
return;
|
|
1055
|
-
const
|
|
1056
|
-
r(
|
|
1054
|
+
const h = await u.page.getTextContent();
|
|
1055
|
+
r(h);
|
|
1057
1056
|
})();
|
|
1058
1057
|
}, [o, t]);
|
|
1059
|
-
const
|
|
1060
|
-
var u,
|
|
1058
|
+
const p = k(() => a ? a.map((g) => {
|
|
1059
|
+
var u, h;
|
|
1061
1060
|
return {
|
|
1062
|
-
...
|
|
1061
|
+
...nr(g.keyword, (u = g.options) == null ? void 0 : u.matchCase, (h = g.options) == null ? void 0 : h.wholeWords),
|
|
1063
1062
|
color: g.highlightColor
|
|
1064
1063
|
};
|
|
1065
1064
|
}) : [], [a]);
|
|
1066
|
-
function
|
|
1065
|
+
function _(g, u) {
|
|
1067
1066
|
if (!g)
|
|
1068
1067
|
return;
|
|
1069
|
-
const
|
|
1068
|
+
const h = `[data-rp="page-${u}-textLayer"]`;
|
|
1070
1069
|
return new Promise((s) => {
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1073
|
-
s(
|
|
1070
|
+
const b = g.querySelector(h);
|
|
1071
|
+
if (b) {
|
|
1072
|
+
s(b);
|
|
1074
1073
|
return;
|
|
1075
1074
|
}
|
|
1076
1075
|
new MutationObserver((y, x) => {
|
|
1077
|
-
const S = g.querySelector(
|
|
1076
|
+
const S = g.querySelector(h);
|
|
1078
1077
|
S && (s(S), x.disconnect());
|
|
1079
1078
|
}).observe(g, { childList: !0, subtree: !0 });
|
|
1080
1079
|
});
|
|
1081
1080
|
}
|
|
1082
1081
|
function P(g) {
|
|
1083
1082
|
return new Promise((u) => {
|
|
1084
|
-
const
|
|
1083
|
+
const h = g.querySelectorAll(
|
|
1085
1084
|
'[data-rp="rp-text-layer-text"]'
|
|
1086
1085
|
);
|
|
1087
|
-
if (
|
|
1088
|
-
u(Array.from(
|
|
1086
|
+
if (h.length) {
|
|
1087
|
+
u(Array.from(h));
|
|
1089
1088
|
return;
|
|
1090
1089
|
}
|
|
1091
|
-
new MutationObserver((
|
|
1090
|
+
new MutationObserver((b, T) => {
|
|
1092
1091
|
const y = g.querySelectorAll(
|
|
1093
1092
|
".rp-text-layer-text"
|
|
1094
1093
|
);
|
|
1095
|
-
y.length && (u(Array.from(y)),
|
|
1094
|
+
y.length && (u(Array.from(y)), T.disconnect());
|
|
1096
1095
|
}).observe(g, { childList: !0, subtree: !0 });
|
|
1097
1096
|
});
|
|
1098
1097
|
}
|
|
1099
|
-
const
|
|
1100
|
-
var
|
|
1101
|
-
const
|
|
1102
|
-
if (!
|
|
1098
|
+
const w = (g, u, h, s) => {
|
|
1099
|
+
var q;
|
|
1100
|
+
const b = document.createRange(), T = h.firstChild;
|
|
1101
|
+
if (!T || T.nodeType !== Node.TEXT_NODE)
|
|
1103
1102
|
return null;
|
|
1104
|
-
const y = ((
|
|
1103
|
+
const y = ((q = T.textContent) == null ? void 0 : q.length) ?? 0, x = s[0].charIdxInSpan, S = s.length === 1 ? x : s[s.length - 1].charIdxInSpan;
|
|
1105
1104
|
if (x > y || S + 1 > y)
|
|
1106
1105
|
return null;
|
|
1107
|
-
|
|
1106
|
+
b.setStart(T, x), b.setEnd(T, S + 1);
|
|
1108
1107
|
const R = document.createElement("span");
|
|
1109
|
-
R.style.width = "auto",
|
|
1110
|
-
const L = R.getBoundingClientRect(), N = g.getBoundingClientRect(),
|
|
1111
|
-
return
|
|
1108
|
+
R.style.width = "auto", b.surroundContents(R);
|
|
1109
|
+
const L = R.getBoundingClientRect(), N = g.getBoundingClientRect(), M = N.height, A = N.width, z = 100 * (L.left - N.left) / A, F = 100 * (L.top - N.top) / M, O = 100 * L.height / M, G = 100 * L.width / A;
|
|
1110
|
+
return rr(R), {
|
|
1112
1111
|
keywordStr: u,
|
|
1113
1112
|
left: z,
|
|
1114
1113
|
top: F,
|
|
1115
1114
|
height: O,
|
|
1116
|
-
width:
|
|
1117
|
-
pageHeight:
|
|
1115
|
+
width: G,
|
|
1116
|
+
pageHeight: M,
|
|
1118
1117
|
pageWidth: A
|
|
1119
1118
|
};
|
|
1120
1119
|
};
|
|
1121
1120
|
async function v(g, u) {
|
|
1122
|
-
const
|
|
1123
|
-
if (!
|
|
1121
|
+
const h = await _(c, g);
|
|
1122
|
+
if (!h)
|
|
1124
1123
|
return;
|
|
1125
|
-
const s = await P(
|
|
1124
|
+
const s = await P(h);
|
|
1126
1125
|
if (s.length) {
|
|
1127
|
-
const
|
|
1126
|
+
const b = s.map((y) => y.tagName === "BR" ? " " : y.textContent).reduce(
|
|
1128
1127
|
(y, x, S) => y.concat(
|
|
1129
1128
|
x.split("").map((R, L) => ({
|
|
1130
1129
|
char: R,
|
|
@@ -1139,55 +1138,55 @@ const Yr = (t) => {
|
|
|
1139
1138
|
spanIdx: 0
|
|
1140
1139
|
}
|
|
1141
1140
|
]
|
|
1142
|
-
).slice(1),
|
|
1143
|
-
C(
|
|
1141
|
+
).slice(1), T = I(h, u, s, b);
|
|
1142
|
+
C(T);
|
|
1144
1143
|
}
|
|
1145
1144
|
}
|
|
1146
|
-
const I = (g, u,
|
|
1147
|
-
const
|
|
1148
|
-
if (!s.length || !
|
|
1145
|
+
const I = (g, u, h, s) => {
|
|
1146
|
+
const b = u.length;
|
|
1147
|
+
if (!s.length || !b)
|
|
1149
1148
|
return [];
|
|
1150
|
-
const
|
|
1151
|
-
return
|
|
1152
|
-
const { keyword: S, regExp: R, wholeWords: L, color: N } = x,
|
|
1153
|
-
if (!
|
|
1149
|
+
const T = [], y = s.map((x) => x.char).join("");
|
|
1150
|
+
return p.forEach((x) => {
|
|
1151
|
+
const { keyword: S, regExp: R, wholeWords: L, color: N } = x, M = S;
|
|
1152
|
+
if (!M.trim())
|
|
1154
1153
|
return;
|
|
1155
1154
|
const A = R.flags.indexOf("g") === -1 ? new RegExp(R, `${R.flags}g`) : R;
|
|
1156
1155
|
let z;
|
|
1157
1156
|
const F = [];
|
|
1158
1157
|
for (; (z = A.exec(y)) !== null; )
|
|
1159
|
-
L && !
|
|
1158
|
+
L && !Io(y, z.index, z[0].length) || F.push({
|
|
1160
1159
|
keyword: A,
|
|
1161
1160
|
startIndex: z.index,
|
|
1162
1161
|
endIndex: A.lastIndex
|
|
1163
1162
|
});
|
|
1164
|
-
const O = F.map((
|
|
1165
|
-
keyword:
|
|
1166
|
-
indexes: s.slice(
|
|
1163
|
+
const O = F.map((G) => ({
|
|
1164
|
+
keyword: G.keyword,
|
|
1165
|
+
indexes: s.slice(G.startIndex, G.endIndex),
|
|
1167
1166
|
color: N
|
|
1168
1167
|
}));
|
|
1169
|
-
for (const
|
|
1170
|
-
const
|
|
1168
|
+
for (const G of O) {
|
|
1169
|
+
const q = G.indexes.reduce(
|
|
1171
1170
|
(V, B) => (V[B.spanIdx] = (V[B.spanIdx] || []).concat([B]), V),
|
|
1172
1171
|
{}
|
|
1173
1172
|
);
|
|
1174
|
-
for (const V of Object.values(
|
|
1173
|
+
for (const V of Object.values(q))
|
|
1175
1174
|
if (V.length !== 1 || V[0].char.trim() !== "") {
|
|
1176
|
-
const B = V, ee =
|
|
1175
|
+
const B = V, ee = h[B[0].spanIdx], U = w(
|
|
1177
1176
|
g,
|
|
1178
|
-
|
|
1177
|
+
M,
|
|
1179
1178
|
ee,
|
|
1180
1179
|
B
|
|
1181
1180
|
);
|
|
1182
1181
|
if (U) {
|
|
1183
1182
|
const { left: Q, top: Y } = U;
|
|
1184
|
-
if (
|
|
1183
|
+
if (T.find((ne) => ne.left === Q && ne.top === Y))
|
|
1185
1184
|
continue;
|
|
1186
|
-
|
|
1185
|
+
T.push({ ...U, highlightColor: G.color });
|
|
1187
1186
|
}
|
|
1188
1187
|
}
|
|
1189
1188
|
}
|
|
1190
|
-
}),
|
|
1189
|
+
}), T.sort(or), T;
|
|
1191
1190
|
};
|
|
1192
1191
|
return D(() => {
|
|
1193
1192
|
(async () => {
|
|
@@ -1201,10 +1200,10 @@ const Yr = (t) => {
|
|
|
1201
1200
|
console.error(u);
|
|
1202
1201
|
}
|
|
1203
1202
|
})();
|
|
1204
|
-
}, [
|
|
1203
|
+
}, [l, a, t, n, e]), /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i("div", { ref: d, "data-rp": `page-${t}-textHighlightLayer`, children: f.map((g, u) => /* @__PURE__ */ i(
|
|
1205
1204
|
"div",
|
|
1206
1205
|
{
|
|
1207
|
-
className:
|
|
1206
|
+
className: Qr["rp-text-highlight"],
|
|
1208
1207
|
style: {
|
|
1209
1208
|
top: `${g.top}%`,
|
|
1210
1209
|
left: `${g.left}%`,
|
|
@@ -1216,22 +1215,22 @@ const Yr = (t) => {
|
|
|
1216
1215
|
u
|
|
1217
1216
|
)) }) });
|
|
1218
1217
|
}, Ot = rt((t, e) => {
|
|
1219
|
-
const { pageNumber: n, style: r, ...o } = t, { pages: a } =
|
|
1218
|
+
const { pageNumber: n, style: r, ...o } = t, { pages: a } = re(), { pageRotate: l } = ot(), { textLayer: d } = wo(), { currentZoom: c } = tt(), { LoaderImageComponent: m } = yt(), f = H(a.get(n)), [C, p] = $(!1), _ = H(null), [P, w] = $({
|
|
1220
1219
|
width: 0,
|
|
1221
1220
|
height: 0
|
|
1222
1221
|
});
|
|
1223
|
-
|
|
1224
|
-
const v =
|
|
1222
|
+
un(e, () => _.current);
|
|
1223
|
+
const v = k(() => f.current ? l[n] : 0, [n, l]);
|
|
1225
1224
|
D(() => {
|
|
1226
|
-
if (a && (
|
|
1227
|
-
const
|
|
1228
|
-
scale:
|
|
1225
|
+
if (a && (f.current = a.get(n), f.current)) {
|
|
1226
|
+
const h = f.current.page.getViewport({
|
|
1227
|
+
scale: c,
|
|
1229
1228
|
rotation: v
|
|
1230
1229
|
});
|
|
1231
|
-
|
|
1230
|
+
w(h);
|
|
1232
1231
|
}
|
|
1233
|
-
}, [a, n, v,
|
|
1234
|
-
const I =
|
|
1232
|
+
}, [a, n, v, c]);
|
|
1233
|
+
const I = k(() => {
|
|
1235
1234
|
switch (v) {
|
|
1236
1235
|
case 90:
|
|
1237
1236
|
return `${P.width / 2}px ${P.width / 2}px`;
|
|
@@ -1242,14 +1241,14 @@ const Yr = (t) => {
|
|
|
1242
1241
|
return "center";
|
|
1243
1242
|
}
|
|
1244
1243
|
}, [v, P]), g = E(() => {
|
|
1245
|
-
|
|
1244
|
+
p(!0);
|
|
1246
1245
|
}, []), u = E(() => {
|
|
1247
|
-
|
|
1246
|
+
p(!1);
|
|
1248
1247
|
}, []);
|
|
1249
1248
|
return /* @__PURE__ */ i(
|
|
1250
1249
|
"div",
|
|
1251
1250
|
{
|
|
1252
|
-
ref:
|
|
1251
|
+
ref: _,
|
|
1253
1252
|
id: `page-${n}`,
|
|
1254
1253
|
"data-rp": `page-${n}`,
|
|
1255
1254
|
...o,
|
|
@@ -1258,7 +1257,7 @@ const Yr = (t) => {
|
|
|
1258
1257
|
"--rp-rotate": `${v}deg`,
|
|
1259
1258
|
"--rp-page-rotate-translate": `${I}`,
|
|
1260
1259
|
"--user-unit": P.userUnit || 1,
|
|
1261
|
-
"--scale-factor":
|
|
1260
|
+
"--scale-factor": c,
|
|
1262
1261
|
"--total-scale-factor": "calc(var(--scale-factor) * var(--user-unit))"
|
|
1263
1262
|
},
|
|
1264
1263
|
className: ht["rp-page-wrapper"],
|
|
@@ -1271,12 +1270,12 @@ const Yr = (t) => {
|
|
|
1271
1270
|
},
|
|
1272
1271
|
className: ht["rp-page"],
|
|
1273
1272
|
children: [
|
|
1274
|
-
/* @__PURE__ */ i(
|
|
1275
|
-
C &&
|
|
1276
|
-
/* @__PURE__ */ i(
|
|
1277
|
-
d && /* @__PURE__ */ i(
|
|
1278
|
-
/* @__PURE__ */ i(
|
|
1279
|
-
/* @__PURE__ */ i(
|
|
1273
|
+
/* @__PURE__ */ i(Ur, { onLoading: g, onLoaded: u, pageNumber: n }),
|
|
1274
|
+
C && m && /* @__PURE__ */ i("div", { className: ht["rp-loader-wrapper"], children: /* @__PURE__ */ i(m, {}) }),
|
|
1275
|
+
/* @__PURE__ */ i(ir, { pageNumber: n }),
|
|
1276
|
+
d && /* @__PURE__ */ i(Zr, { pageNumber: n }),
|
|
1277
|
+
/* @__PURE__ */ i(Yr, { pageNumber: n, viewport: P }),
|
|
1278
|
+
/* @__PURE__ */ i(Xr, { pageNumber: n })
|
|
1280
1279
|
]
|
|
1281
1280
|
}
|
|
1282
1281
|
)
|
|
@@ -1293,7 +1292,7 @@ function bt() {
|
|
|
1293
1292
|
return t;
|
|
1294
1293
|
}, bt.apply(null, arguments);
|
|
1295
1294
|
}
|
|
1296
|
-
function
|
|
1295
|
+
function Zt(t) {
|
|
1297
1296
|
if (t === void 0)
|
|
1298
1297
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1299
1298
|
return t;
|
|
@@ -1303,34 +1302,34 @@ function Tt(t, e) {
|
|
|
1303
1302
|
return n.__proto__ = r, n;
|
|
1304
1303
|
}, Tt(t, e);
|
|
1305
1304
|
}
|
|
1306
|
-
function
|
|
1305
|
+
function Jr(t, e) {
|
|
1307
1306
|
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, Tt(t, e);
|
|
1308
1307
|
}
|
|
1309
|
-
var
|
|
1308
|
+
var jt = Number.isNaN || function(e) {
|
|
1310
1309
|
return typeof e == "number" && e !== e;
|
|
1311
1310
|
};
|
|
1312
|
-
function
|
|
1313
|
-
return !!(t === e ||
|
|
1311
|
+
function ei(t, e) {
|
|
1312
|
+
return !!(t === e || jt(t) && jt(e));
|
|
1314
1313
|
}
|
|
1315
|
-
function
|
|
1314
|
+
function ti(t, e) {
|
|
1316
1315
|
if (t.length !== e.length)
|
|
1317
1316
|
return !1;
|
|
1318
1317
|
for (var n = 0; n < t.length; n++)
|
|
1319
|
-
if (!
|
|
1318
|
+
if (!ei(t[n], e[n]))
|
|
1320
1319
|
return !1;
|
|
1321
1320
|
return !0;
|
|
1322
1321
|
}
|
|
1323
1322
|
function ft(t, e) {
|
|
1324
|
-
e === void 0 && (e =
|
|
1323
|
+
e === void 0 && (e = ti);
|
|
1325
1324
|
var n, r = [], o, a = !1;
|
|
1326
|
-
function
|
|
1327
|
-
for (var d = [],
|
|
1328
|
-
d[
|
|
1325
|
+
function l() {
|
|
1326
|
+
for (var d = [], c = 0; c < arguments.length; c++)
|
|
1327
|
+
d[c] = arguments[c];
|
|
1329
1328
|
return a && n === this && e(d, r) || (o = t.apply(this, d), a = !0, n = this, r = d), o;
|
|
1330
1329
|
}
|
|
1331
|
-
return
|
|
1330
|
+
return l;
|
|
1332
1331
|
}
|
|
1333
|
-
function
|
|
1332
|
+
function Kt(t, e) {
|
|
1334
1333
|
if (t == null)
|
|
1335
1334
|
return {};
|
|
1336
1335
|
var n = {};
|
|
@@ -1342,18 +1341,18 @@ function Qt(t, e) {
|
|
|
1342
1341
|
}
|
|
1343
1342
|
return n;
|
|
1344
1343
|
}
|
|
1345
|
-
var
|
|
1344
|
+
var ni = typeof performance == "object" && typeof performance.now == "function", Xt = ni ? function() {
|
|
1346
1345
|
return performance.now();
|
|
1347
1346
|
} : function() {
|
|
1348
1347
|
return Date.now();
|
|
1349
1348
|
};
|
|
1350
|
-
function
|
|
1349
|
+
function Qt(t) {
|
|
1351
1350
|
cancelAnimationFrame(t.id);
|
|
1352
1351
|
}
|
|
1353
|
-
function
|
|
1354
|
-
var n =
|
|
1352
|
+
function oi(t, e) {
|
|
1353
|
+
var n = Xt();
|
|
1355
1354
|
function r() {
|
|
1356
|
-
|
|
1355
|
+
Xt() - n >= e ? t.call(null) : o.id = requestAnimationFrame(r);
|
|
1357
1356
|
}
|
|
1358
1357
|
var o = {
|
|
1359
1358
|
id: requestAnimationFrame(r)
|
|
@@ -1361,7 +1360,7 @@ function ii(t, e) {
|
|
|
1361
1360
|
return o;
|
|
1362
1361
|
}
|
|
1363
1362
|
var mt = -1;
|
|
1364
|
-
function
|
|
1363
|
+
function ri(t) {
|
|
1365
1364
|
if (t === void 0 && (t = !1), mt === -1 || t) {
|
|
1366
1365
|
var e = document.createElement("div"), n = e.style;
|
|
1367
1366
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(e), mt = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
@@ -1369,7 +1368,7 @@ function ai(t) {
|
|
|
1369
1368
|
return mt;
|
|
1370
1369
|
}
|
|
1371
1370
|
var Ae = null;
|
|
1372
|
-
function
|
|
1371
|
+
function Yt(t) {
|
|
1373
1372
|
if (t === void 0 && (t = !1), Ae === null || t) {
|
|
1374
1373
|
var e = document.createElement("div"), n = e.style;
|
|
1375
1374
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
@@ -1378,31 +1377,31 @@ function en(t) {
|
|
|
1378
1377
|
}
|
|
1379
1378
|
return Ae;
|
|
1380
1379
|
}
|
|
1381
|
-
var
|
|
1380
|
+
var ii = 150, ai = function(e) {
|
|
1382
1381
|
var n = e.columnIndex;
|
|
1383
1382
|
e.data;
|
|
1384
1383
|
var r = e.rowIndex;
|
|
1385
1384
|
return r + ":" + n;
|
|
1386
1385
|
}, Xe = null, Qe = null, Ye = null;
|
|
1387
1386
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Xe = /* @__PURE__ */ new WeakSet(), Qe = /* @__PURE__ */ new WeakSet(), Ye = /* @__PURE__ */ new WeakSet());
|
|
1388
|
-
function
|
|
1389
|
-
var e, n = t.getColumnOffset, r = t.getColumnStartIndexForOffset, o = t.getColumnStopIndexForStartIndex, a = t.getColumnWidth,
|
|
1387
|
+
function si(t) {
|
|
1388
|
+
var e, n = t.getColumnOffset, r = t.getColumnStartIndexForOffset, o = t.getColumnStopIndexForStartIndex, a = t.getColumnWidth, l = t.getEstimatedTotalHeight, d = t.getEstimatedTotalWidth, c = t.getOffsetForColumnAndAlignment, m = t.getOffsetForRowAndAlignment, f = t.getRowHeight, C = t.getRowOffset, p = t.getRowStartIndexForOffset, _ = t.getRowStopIndexForStartIndex, P = t.initInstanceProps, w = t.shouldResetStyleCacheOnItemSizeChange, v = t.validateProps;
|
|
1390
1389
|
return e = /* @__PURE__ */ function(I) {
|
|
1391
|
-
|
|
1392
|
-
function g(
|
|
1390
|
+
Jr(g, I);
|
|
1391
|
+
function g(h) {
|
|
1393
1392
|
var s;
|
|
1394
|
-
return s = I.call(this,
|
|
1395
|
-
instance:
|
|
1393
|
+
return s = I.call(this, h) || this, s._instanceProps = P(s.props, Zt(s)), s._resetIsScrollingTimeoutId = null, s._outerRef = void 0, s.state = {
|
|
1394
|
+
instance: Zt(s),
|
|
1396
1395
|
isScrolling: !1,
|
|
1397
1396
|
horizontalScrollDirection: "forward",
|
|
1398
1397
|
scrollLeft: typeof s.props.initialScrollLeft == "number" ? s.props.initialScrollLeft : 0,
|
|
1399
1398
|
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1400
1399
|
scrollUpdateWasRequested: !1,
|
|
1401
1400
|
verticalScrollDirection: "forward"
|
|
1402
|
-
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = ft(function(
|
|
1401
|
+
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = ft(function(b, T, y, x, S, R, L, N) {
|
|
1403
1402
|
return s.props.onItemsRendered({
|
|
1404
|
-
overscanColumnStartIndex:
|
|
1405
|
-
overscanColumnStopIndex:
|
|
1403
|
+
overscanColumnStartIndex: b,
|
|
1404
|
+
overscanColumnStopIndex: T,
|
|
1406
1405
|
overscanRowStartIndex: y,
|
|
1407
1406
|
overscanRowStopIndex: x,
|
|
1408
1407
|
visibleColumnStartIndex: S,
|
|
@@ -1410,40 +1409,40 @@ function li(t) {
|
|
|
1410
1409
|
visibleRowStartIndex: L,
|
|
1411
1410
|
visibleRowStopIndex: N
|
|
1412
1411
|
});
|
|
1413
|
-
}), s._callOnScroll = void 0, s._callOnScroll = ft(function(
|
|
1412
|
+
}), s._callOnScroll = void 0, s._callOnScroll = ft(function(b, T, y, x, S) {
|
|
1414
1413
|
return s.props.onScroll({
|
|
1415
1414
|
horizontalScrollDirection: y,
|
|
1416
|
-
scrollLeft:
|
|
1417
|
-
scrollTop:
|
|
1415
|
+
scrollLeft: b,
|
|
1416
|
+
scrollTop: T,
|
|
1418
1417
|
verticalScrollDirection: x,
|
|
1419
1418
|
scrollUpdateWasRequested: S
|
|
1420
1419
|
});
|
|
1421
|
-
}), s._getItemStyle = void 0, s._getItemStyle = function(
|
|
1422
|
-
var y = s.props, x = y.columnWidth, S = y.direction, R = y.rowHeight, L = s._getItemStyleCache(
|
|
1420
|
+
}), s._getItemStyle = void 0, s._getItemStyle = function(b, T) {
|
|
1421
|
+
var y = s.props, x = y.columnWidth, S = y.direction, R = y.rowHeight, L = s._getItemStyleCache(w && x, w && S, w && R), N = b + ":" + T, M;
|
|
1423
1422
|
if (L.hasOwnProperty(N))
|
|
1424
|
-
|
|
1423
|
+
M = L[N];
|
|
1425
1424
|
else {
|
|
1426
|
-
var A = n(s.props,
|
|
1427
|
-
L[N] =
|
|
1425
|
+
var A = n(s.props, T, s._instanceProps), z = S === "rtl";
|
|
1426
|
+
L[N] = M = {
|
|
1428
1427
|
position: "absolute",
|
|
1429
1428
|
left: z ? void 0 : A,
|
|
1430
1429
|
right: z ? A : void 0,
|
|
1431
|
-
top: C(s.props,
|
|
1432
|
-
height:
|
|
1433
|
-
width: a(s.props,
|
|
1430
|
+
top: C(s.props, b, s._instanceProps),
|
|
1431
|
+
height: f(s.props, b, s._instanceProps),
|
|
1432
|
+
width: a(s.props, T, s._instanceProps)
|
|
1434
1433
|
};
|
|
1435
1434
|
}
|
|
1436
|
-
return
|
|
1437
|
-
}, s._getItemStyleCache = void 0, s._getItemStyleCache = ft(function(
|
|
1435
|
+
return M;
|
|
1436
|
+
}, s._getItemStyleCache = void 0, s._getItemStyleCache = ft(function(b, T, y) {
|
|
1438
1437
|
return {};
|
|
1439
|
-
}), s._onScroll = function(
|
|
1440
|
-
var
|
|
1441
|
-
s.setState(function(
|
|
1442
|
-
if (
|
|
1438
|
+
}), s._onScroll = function(b) {
|
|
1439
|
+
var T = b.currentTarget, y = T.clientHeight, x = T.clientWidth, S = T.scrollLeft, R = T.scrollTop, L = T.scrollHeight, N = T.scrollWidth;
|
|
1440
|
+
s.setState(function(M) {
|
|
1441
|
+
if (M.scrollLeft === S && M.scrollTop === R)
|
|
1443
1442
|
return null;
|
|
1444
1443
|
var A = s.props.direction, z = S;
|
|
1445
1444
|
if (A === "rtl")
|
|
1446
|
-
switch (
|
|
1445
|
+
switch (Yt()) {
|
|
1447
1446
|
case "negative":
|
|
1448
1447
|
z = -S;
|
|
1449
1448
|
break;
|
|
@@ -1455,18 +1454,18 @@ function li(t) {
|
|
|
1455
1454
|
var F = Math.max(0, Math.min(R, L - y));
|
|
1456
1455
|
return {
|
|
1457
1456
|
isScrolling: !0,
|
|
1458
|
-
horizontalScrollDirection:
|
|
1457
|
+
horizontalScrollDirection: M.scrollLeft < S ? "forward" : "backward",
|
|
1459
1458
|
scrollLeft: z,
|
|
1460
1459
|
scrollTop: F,
|
|
1461
|
-
verticalScrollDirection:
|
|
1460
|
+
verticalScrollDirection: M.scrollTop < R ? "forward" : "backward",
|
|
1462
1461
|
scrollUpdateWasRequested: !1
|
|
1463
1462
|
};
|
|
1464
1463
|
}, s._resetIsScrollingDebounced);
|
|
1465
|
-
}, s._outerRefSetter = function(
|
|
1466
|
-
var
|
|
1467
|
-
s._outerRef =
|
|
1464
|
+
}, s._outerRefSetter = function(b) {
|
|
1465
|
+
var T = s.props.outerRef;
|
|
1466
|
+
s._outerRef = b, typeof T == "function" ? T(b) : T != null && typeof T == "object" && T.hasOwnProperty("current") && (T.current = b);
|
|
1468
1467
|
}, s._resetIsScrollingDebounced = function() {
|
|
1469
|
-
s._resetIsScrollingTimeoutId !== null &&
|
|
1468
|
+
s._resetIsScrollingTimeoutId !== null && Qt(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId = oi(s._resetIsScrolling, ii);
|
|
1470
1469
|
}, s._resetIsScrolling = function() {
|
|
1471
1470
|
s._resetIsScrollingTimeoutId = null, s.setState({
|
|
1472
1471
|
isScrolling: !1
|
|
@@ -1475,80 +1474,80 @@ function li(t) {
|
|
|
1475
1474
|
});
|
|
1476
1475
|
}, s;
|
|
1477
1476
|
}
|
|
1478
|
-
g.getDerivedStateFromProps = function(s,
|
|
1479
|
-
return
|
|
1477
|
+
g.getDerivedStateFromProps = function(s, b) {
|
|
1478
|
+
return ci(s, b), v(s), null;
|
|
1480
1479
|
};
|
|
1481
1480
|
var u = g.prototype;
|
|
1482
1481
|
return u.scrollTo = function(s) {
|
|
1483
|
-
var
|
|
1484
|
-
|
|
1485
|
-
return
|
|
1486
|
-
horizontalScrollDirection: y.scrollLeft <
|
|
1487
|
-
scrollLeft:
|
|
1488
|
-
scrollTop:
|
|
1482
|
+
var b = s.scrollLeft, T = s.scrollTop;
|
|
1483
|
+
b !== void 0 && (b = Math.max(0, b)), T !== void 0 && (T = Math.max(0, T)), this.setState(function(y) {
|
|
1484
|
+
return b === void 0 && (b = y.scrollLeft), T === void 0 && (T = y.scrollTop), y.scrollLeft === b && y.scrollTop === T ? null : {
|
|
1485
|
+
horizontalScrollDirection: y.scrollLeft < b ? "forward" : "backward",
|
|
1486
|
+
scrollLeft: b,
|
|
1487
|
+
scrollTop: T,
|
|
1489
1488
|
scrollUpdateWasRequested: !0,
|
|
1490
|
-
verticalScrollDirection: y.scrollTop <
|
|
1489
|
+
verticalScrollDirection: y.scrollTop < T ? "forward" : "backward"
|
|
1491
1490
|
};
|
|
1492
1491
|
}, this._resetIsScrollingDebounced);
|
|
1493
1492
|
}, u.scrollToItem = function(s) {
|
|
1494
|
-
var
|
|
1493
|
+
var b = s.align, T = b === void 0 ? "auto" : b, y = s.columnIndex, x = s.rowIndex, S = this.props, R = S.columnCount, L = S.height, N = S.rowCount, M = S.width, A = this.state, z = A.scrollLeft, F = A.scrollTop, O = ri();
|
|
1495
1494
|
y !== void 0 && (y = Math.max(0, Math.min(y, R - 1))), x !== void 0 && (x = Math.max(0, Math.min(x, N - 1)));
|
|
1496
|
-
var
|
|
1495
|
+
var G = l(this.props, this._instanceProps), q = d(this.props, this._instanceProps), V = q > M ? O : 0, B = G > L ? O : 0;
|
|
1497
1496
|
this.scrollTo({
|
|
1498
|
-
scrollLeft: y !== void 0 ?
|
|
1499
|
-
scrollTop: x !== void 0 ?
|
|
1497
|
+
scrollLeft: y !== void 0 ? c(this.props, y, T, z, this._instanceProps, B) : z,
|
|
1498
|
+
scrollTop: x !== void 0 ? m(this.props, x, T, F, this._instanceProps, V) : F
|
|
1500
1499
|
});
|
|
1501
1500
|
}, u.componentDidMount = function() {
|
|
1502
|
-
var s = this.props,
|
|
1501
|
+
var s = this.props, b = s.initialScrollLeft, T = s.initialScrollTop;
|
|
1503
1502
|
if (this._outerRef != null) {
|
|
1504
1503
|
var y = this._outerRef;
|
|
1505
|
-
typeof
|
|
1504
|
+
typeof b == "number" && (y.scrollLeft = b), typeof T == "number" && (y.scrollTop = T);
|
|
1506
1505
|
}
|
|
1507
1506
|
this._callPropsCallbacks();
|
|
1508
1507
|
}, u.componentDidUpdate = function() {
|
|
1509
|
-
var s = this.props.direction,
|
|
1508
|
+
var s = this.props.direction, b = this.state, T = b.scrollLeft, y = b.scrollTop, x = b.scrollUpdateWasRequested;
|
|
1510
1509
|
if (x && this._outerRef != null) {
|
|
1511
1510
|
var S = this._outerRef;
|
|
1512
1511
|
if (s === "rtl")
|
|
1513
|
-
switch (
|
|
1512
|
+
switch (Yt()) {
|
|
1514
1513
|
case "negative":
|
|
1515
|
-
S.scrollLeft = -
|
|
1514
|
+
S.scrollLeft = -T;
|
|
1516
1515
|
break;
|
|
1517
1516
|
case "positive-ascending":
|
|
1518
|
-
S.scrollLeft =
|
|
1517
|
+
S.scrollLeft = T;
|
|
1519
1518
|
break;
|
|
1520
1519
|
default:
|
|
1521
1520
|
var R = S.clientWidth, L = S.scrollWidth;
|
|
1522
|
-
S.scrollLeft = L - R -
|
|
1521
|
+
S.scrollLeft = L - R - T;
|
|
1523
1522
|
break;
|
|
1524
1523
|
}
|
|
1525
1524
|
else
|
|
1526
|
-
S.scrollLeft = Math.max(0,
|
|
1525
|
+
S.scrollLeft = Math.max(0, T);
|
|
1527
1526
|
S.scrollTop = Math.max(0, y);
|
|
1528
1527
|
}
|
|
1529
1528
|
this._callPropsCallbacks();
|
|
1530
1529
|
}, u.componentWillUnmount = function() {
|
|
1531
|
-
this._resetIsScrollingTimeoutId !== null &&
|
|
1530
|
+
this._resetIsScrollingTimeoutId !== null && Qt(this._resetIsScrollingTimeoutId);
|
|
1532
1531
|
}, u.render = function() {
|
|
1533
|
-
var s = this.props,
|
|
1534
|
-
if (y > 0 &&
|
|
1532
|
+
var s = this.props, b = s.children, T = s.className, y = s.columnCount, x = s.direction, S = s.height, R = s.innerRef, L = s.innerElementType, N = s.innerTagName, M = s.itemData, A = s.itemKey, z = A === void 0 ? ai : A, F = s.outerElementType, O = s.outerTagName, G = s.rowCount, q = s.style, V = s.useIsScrolling, B = s.width, ee = this.state.isScrolling, U = this._getHorizontalRangeToRender(), Q = U[0], Y = U[1], te = this._getVerticalRangeToRender(), ne = te[0], J = te[1], ce = [];
|
|
1533
|
+
if (y > 0 && G)
|
|
1535
1534
|
for (var ae = ne; ae <= J; ae++)
|
|
1536
1535
|
for (var we = Q; we <= Y; we++)
|
|
1537
|
-
ce.push(Ke(
|
|
1536
|
+
ce.push(Ke(b, {
|
|
1538
1537
|
columnIndex: we,
|
|
1539
|
-
data:
|
|
1538
|
+
data: M,
|
|
1540
1539
|
isScrolling: V ? ee : void 0,
|
|
1541
1540
|
key: z({
|
|
1542
1541
|
columnIndex: we,
|
|
1543
|
-
data:
|
|
1542
|
+
data: M,
|
|
1544
1543
|
rowIndex: ae
|
|
1545
1544
|
}),
|
|
1546
1545
|
rowIndex: ae,
|
|
1547
1546
|
style: this._getItemStyle(ae, we)
|
|
1548
1547
|
}));
|
|
1549
|
-
var _e =
|
|
1548
|
+
var _e = l(this.props, this._instanceProps), st = d(this.props, this._instanceProps);
|
|
1550
1549
|
return Ke(F || O || "div", {
|
|
1551
|
-
className:
|
|
1550
|
+
className: T,
|
|
1552
1551
|
onScroll: this._onScroll,
|
|
1553
1552
|
ref: this._outerRefSetter,
|
|
1554
1553
|
style: bt({
|
|
@@ -1559,7 +1558,7 @@ function li(t) {
|
|
|
1559
1558
|
WebkitOverflowScrolling: "touch",
|
|
1560
1559
|
willChange: "transform",
|
|
1561
1560
|
direction: x
|
|
1562
|
-
},
|
|
1561
|
+
}, q)
|
|
1563
1562
|
}, Ke(L || N || "div", {
|
|
1564
1563
|
children: ce,
|
|
1565
1564
|
ref: R,
|
|
@@ -1570,38 +1569,38 @@ function li(t) {
|
|
|
1570
1569
|
}
|
|
1571
1570
|
}));
|
|
1572
1571
|
}, u._callPropsCallbacks = function() {
|
|
1573
|
-
var s = this.props,
|
|
1574
|
-
if (typeof
|
|
1575
|
-
var S = this._getHorizontalRangeToRender(), R = S[0], L = S[1], N = S[2],
|
|
1576
|
-
this._callOnItemsRendered(R, L, z, F, N,
|
|
1572
|
+
var s = this.props, b = s.columnCount, T = s.onItemsRendered, y = s.onScroll, x = s.rowCount;
|
|
1573
|
+
if (typeof T == "function" && b > 0 && x > 0) {
|
|
1574
|
+
var S = this._getHorizontalRangeToRender(), R = S[0], L = S[1], N = S[2], M = S[3], A = this._getVerticalRangeToRender(), z = A[0], F = A[1], O = A[2], G = A[3];
|
|
1575
|
+
this._callOnItemsRendered(R, L, z, F, N, M, O, G);
|
|
1577
1576
|
}
|
|
1578
1577
|
if (typeof y == "function") {
|
|
1579
|
-
var
|
|
1578
|
+
var q = this.state, V = q.horizontalScrollDirection, B = q.scrollLeft, ee = q.scrollTop, U = q.scrollUpdateWasRequested, Q = q.verticalScrollDirection;
|
|
1580
1579
|
this._callOnScroll(B, ee, V, Q, U);
|
|
1581
1580
|
}
|
|
1582
1581
|
}, u._getHorizontalRangeToRender = function() {
|
|
1583
|
-
var s = this.props,
|
|
1584
|
-
if (
|
|
1582
|
+
var s = this.props, b = s.columnCount, T = s.overscanColumnCount, y = s.overscanColumnsCount, x = s.overscanCount, S = s.rowCount, R = this.state, L = R.horizontalScrollDirection, N = R.isScrolling, M = R.scrollLeft, A = T || y || x || 1;
|
|
1583
|
+
if (b === 0 || S === 0)
|
|
1585
1584
|
return [0, 0, 0, 0];
|
|
1586
|
-
var z = r(this.props,
|
|
1587
|
-
return [Math.max(0, z - O), Math.max(0, Math.min(
|
|
1585
|
+
var z = r(this.props, M, this._instanceProps), F = o(this.props, z, M, this._instanceProps), O = !N || L === "backward" ? Math.max(1, A) : 1, G = !N || L === "forward" ? Math.max(1, A) : 1;
|
|
1586
|
+
return [Math.max(0, z - O), Math.max(0, Math.min(b - 1, F + G)), z, F];
|
|
1588
1587
|
}, u._getVerticalRangeToRender = function() {
|
|
1589
|
-
var s = this.props,
|
|
1590
|
-
if (
|
|
1588
|
+
var s = this.props, b = s.columnCount, T = s.overscanCount, y = s.overscanRowCount, x = s.overscanRowsCount, S = s.rowCount, R = this.state, L = R.isScrolling, N = R.verticalScrollDirection, M = R.scrollTop, A = y || x || T || 1;
|
|
1589
|
+
if (b === 0 || S === 0)
|
|
1591
1590
|
return [0, 0, 0, 0];
|
|
1592
|
-
var z =
|
|
1593
|
-
return [Math.max(0, z - O), Math.max(0, Math.min(S - 1, F +
|
|
1591
|
+
var z = p(this.props, M, this._instanceProps), F = _(this.props, z, M, this._instanceProps), O = !L || N === "backward" ? Math.max(1, A) : 1, G = !L || N === "forward" ? Math.max(1, A) : 1;
|
|
1592
|
+
return [Math.max(0, z - O), Math.max(0, Math.min(S - 1, F + G)), z, F];
|
|
1594
1593
|
}, g;
|
|
1595
|
-
}(
|
|
1594
|
+
}(co), e.defaultProps = {
|
|
1596
1595
|
direction: "ltr",
|
|
1597
1596
|
itemData: void 0,
|
|
1598
1597
|
useIsScrolling: !1
|
|
1599
1598
|
}, e;
|
|
1600
1599
|
}
|
|
1601
|
-
var
|
|
1602
|
-
var r = e.children, o = e.direction, a = e.height,
|
|
1600
|
+
var ci = function(e, n) {
|
|
1601
|
+
var r = e.children, o = e.direction, a = e.height, l = e.innerTagName, d = e.outerTagName, c = e.overscanColumnsCount, m = e.overscanCount, f = e.overscanRowsCount, C = e.width, p = n.instance;
|
|
1603
1602
|
if (process.env.NODE_ENV !== "production") {
|
|
1604
|
-
if (typeof
|
|
1603
|
+
if (typeof m == "number" && Xe && !Xe.has(p) && (Xe.add(p), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof c == "number" || typeof f == "number") && Qe && !Qe.has(p) && (Qe.add(p), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || d != null) && Ye && !Ye.has(p) && (Ye.add(p), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
1605
1604
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
1606
1605
|
switch (o) {
|
|
1607
1606
|
case "ltr":
|
|
@@ -1615,92 +1614,92 @@ var di = function(e, n) {
|
|
|
1615
1614
|
if (typeof a != "number")
|
|
1616
1615
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
|
|
1617
1616
|
}
|
|
1618
|
-
},
|
|
1619
|
-
var r = e.rowCount, o = n.rowMetadataMap, a = n.estimatedRowHeight,
|
|
1620
|
-
if (
|
|
1621
|
-
var
|
|
1622
|
-
d =
|
|
1617
|
+
}, Jt = 50, Ln = function(e, n) {
|
|
1618
|
+
var r = e.rowCount, o = n.rowMetadataMap, a = n.estimatedRowHeight, l = n.lastMeasuredRowIndex, d = 0;
|
|
1619
|
+
if (l >= r && (l = r - 1), l >= 0) {
|
|
1620
|
+
var c = o[l];
|
|
1621
|
+
d = c.offset + c.size;
|
|
1623
1622
|
}
|
|
1624
|
-
var
|
|
1625
|
-
return d +
|
|
1626
|
-
},
|
|
1627
|
-
var r = e.columnCount, o = n.columnMetadataMap, a = n.estimatedColumnWidth,
|
|
1628
|
-
if (
|
|
1629
|
-
var
|
|
1630
|
-
d =
|
|
1623
|
+
var m = r - l - 1, f = m * a;
|
|
1624
|
+
return d + f;
|
|
1625
|
+
}, En = function(e, n) {
|
|
1626
|
+
var r = e.columnCount, o = n.columnMetadataMap, a = n.estimatedColumnWidth, l = n.lastMeasuredColumnIndex, d = 0;
|
|
1627
|
+
if (l >= r && (l = r - 1), l >= 0) {
|
|
1628
|
+
var c = o[l];
|
|
1629
|
+
d = c.offset + c.size;
|
|
1631
1630
|
}
|
|
1632
|
-
var
|
|
1633
|
-
return d +
|
|
1631
|
+
var m = r - l - 1, f = m * a;
|
|
1632
|
+
return d + f;
|
|
1634
1633
|
}, Te = function(e, n, r, o) {
|
|
1635
|
-
var a,
|
|
1636
|
-
if (e === "column" ? (a = o.columnMetadataMap,
|
|
1637
|
-
var
|
|
1634
|
+
var a, l, d;
|
|
1635
|
+
if (e === "column" ? (a = o.columnMetadataMap, l = n.columnWidth, d = o.lastMeasuredColumnIndex) : (a = o.rowMetadataMap, l = n.rowHeight, d = o.lastMeasuredRowIndex), r > d) {
|
|
1636
|
+
var c = 0;
|
|
1638
1637
|
if (d >= 0) {
|
|
1639
|
-
var
|
|
1640
|
-
|
|
1638
|
+
var m = a[d];
|
|
1639
|
+
c = m.offset + m.size;
|
|
1641
1640
|
}
|
|
1642
|
-
for (var
|
|
1643
|
-
var C =
|
|
1644
|
-
a[
|
|
1645
|
-
offset:
|
|
1641
|
+
for (var f = d + 1; f <= r; f++) {
|
|
1642
|
+
var C = l(f);
|
|
1643
|
+
a[f] = {
|
|
1644
|
+
offset: c,
|
|
1646
1645
|
size: C
|
|
1647
|
-
},
|
|
1646
|
+
}, c += C;
|
|
1648
1647
|
}
|
|
1649
1648
|
e === "column" ? o.lastMeasuredColumnIndex = r : o.lastMeasuredRowIndex = r;
|
|
1650
1649
|
}
|
|
1651
1650
|
return a[r];
|
|
1652
|
-
},
|
|
1653
|
-
var a,
|
|
1654
|
-
e === "column" ? (a = r.columnMetadataMap,
|
|
1655
|
-
var d =
|
|
1656
|
-
return d >= o ?
|
|
1657
|
-
},
|
|
1651
|
+
}, en = function(e, n, r, o) {
|
|
1652
|
+
var a, l;
|
|
1653
|
+
e === "column" ? (a = r.columnMetadataMap, l = r.lastMeasuredColumnIndex) : (a = r.rowMetadataMap, l = r.lastMeasuredRowIndex);
|
|
1654
|
+
var d = l > 0 ? a[l].offset : 0;
|
|
1655
|
+
return d >= o ? Nn(e, n, r, l, 0, o) : li(e, n, r, Math.max(0, l), o);
|
|
1656
|
+
}, Nn = function(e, n, r, o, a, l) {
|
|
1658
1657
|
for (; a <= o; ) {
|
|
1659
|
-
var d = a + Math.floor((o - a) / 2),
|
|
1660
|
-
if (
|
|
1658
|
+
var d = a + Math.floor((o - a) / 2), c = Te(e, n, d, r).offset;
|
|
1659
|
+
if (c === l)
|
|
1661
1660
|
return d;
|
|
1662
|
-
|
|
1661
|
+
c < l ? a = d + 1 : c > l && (o = d - 1);
|
|
1663
1662
|
}
|
|
1664
1663
|
return a > 0 ? a - 1 : 0;
|
|
1665
|
-
},
|
|
1666
|
-
for (var
|
|
1664
|
+
}, li = function(e, n, r, o, a) {
|
|
1665
|
+
for (var l = e === "column" ? n.columnCount : n.rowCount, d = 1; o < l && Te(e, n, o, r).offset < a; )
|
|
1667
1666
|
o += d, d *= 2;
|
|
1668
|
-
return
|
|
1669
|
-
},
|
|
1670
|
-
var
|
|
1671
|
-
switch (o === "smart" && (a >=
|
|
1667
|
+
return Nn(e, n, r, Math.min(o, l - 1), Math.floor(o / 2), a);
|
|
1668
|
+
}, tn = function(e, n, r, o, a, l, d) {
|
|
1669
|
+
var c = e === "column" ? n.width : n.height, m = Te(e, n, r, l), f = e === "column" ? En(n, l) : Ln(n, l), C = Math.max(0, Math.min(f - c, m.offset)), p = Math.max(0, m.offset - c + d + m.size);
|
|
1670
|
+
switch (o === "smart" && (a >= p - c && a <= C + c ? o = "auto" : o = "center"), o) {
|
|
1672
1671
|
case "start":
|
|
1673
1672
|
return C;
|
|
1674
1673
|
case "end":
|
|
1675
|
-
return
|
|
1674
|
+
return p;
|
|
1676
1675
|
case "center":
|
|
1677
|
-
return Math.round(
|
|
1676
|
+
return Math.round(p + (C - p) / 2);
|
|
1678
1677
|
case "auto":
|
|
1679
1678
|
default:
|
|
1680
|
-
return a >=
|
|
1679
|
+
return a >= p && a <= C ? a : p > C || a < p ? p : C;
|
|
1681
1680
|
}
|
|
1682
|
-
},
|
|
1681
|
+
}, di = /* @__PURE__ */ si({
|
|
1683
1682
|
getColumnOffset: function(e, n, r) {
|
|
1684
1683
|
return Te("column", e, n, r).offset;
|
|
1685
1684
|
},
|
|
1686
1685
|
getColumnStartIndexForOffset: function(e, n, r) {
|
|
1687
|
-
return
|
|
1686
|
+
return en("column", e, r, n);
|
|
1688
1687
|
},
|
|
1689
1688
|
getColumnStopIndexForStartIndex: function(e, n, r, o) {
|
|
1690
|
-
for (var a = e.columnCount,
|
|
1691
|
-
|
|
1692
|
-
return
|
|
1689
|
+
for (var a = e.columnCount, l = e.width, d = Te("column", e, n, o), c = r + l, m = d.offset + d.size, f = n; f < a - 1 && m < c; )
|
|
1690
|
+
f++, m += Te("column", e, f, o).size;
|
|
1691
|
+
return f;
|
|
1693
1692
|
},
|
|
1694
1693
|
getColumnWidth: function(e, n, r) {
|
|
1695
1694
|
return r.columnMetadataMap[n].size;
|
|
1696
1695
|
},
|
|
1697
|
-
getEstimatedTotalHeight:
|
|
1698
|
-
getEstimatedTotalWidth:
|
|
1699
|
-
getOffsetForColumnAndAlignment: function(e, n, r, o, a,
|
|
1700
|
-
return
|
|
1696
|
+
getEstimatedTotalHeight: Ln,
|
|
1697
|
+
getEstimatedTotalWidth: En,
|
|
1698
|
+
getOffsetForColumnAndAlignment: function(e, n, r, o, a, l) {
|
|
1699
|
+
return tn("column", e, n, r, o, a, l);
|
|
1701
1700
|
},
|
|
1702
|
-
getOffsetForRowAndAlignment: function(e, n, r, o, a,
|
|
1703
|
-
return
|
|
1701
|
+
getOffsetForRowAndAlignment: function(e, n, r, o, a, l) {
|
|
1702
|
+
return tn("row", e, n, r, o, a, l);
|
|
1704
1703
|
},
|
|
1705
1704
|
getRowOffset: function(e, n, r) {
|
|
1706
1705
|
return Te("row", e, n, r).offset;
|
|
@@ -1709,36 +1708,36 @@ var di = function(e, n) {
|
|
|
1709
1708
|
return r.rowMetadataMap[n].size;
|
|
1710
1709
|
},
|
|
1711
1710
|
getRowStartIndexForOffset: function(e, n, r) {
|
|
1712
|
-
return
|
|
1711
|
+
return en("row", e, r, n);
|
|
1713
1712
|
},
|
|
1714
1713
|
getRowStopIndexForStartIndex: function(e, n, r, o) {
|
|
1715
|
-
for (var a = e.rowCount,
|
|
1716
|
-
|
|
1717
|
-
return
|
|
1714
|
+
for (var a = e.rowCount, l = e.height, d = Te("row", e, n, o), c = r + l, m = d.offset + d.size, f = n; f < a - 1 && m < c; )
|
|
1715
|
+
f++, m += Te("row", e, f, o).size;
|
|
1716
|
+
return f;
|
|
1718
1717
|
},
|
|
1719
1718
|
initInstanceProps: function(e, n) {
|
|
1720
|
-
var r = e, o = r.estimatedColumnWidth, a = r.estimatedRowHeight,
|
|
1719
|
+
var r = e, o = r.estimatedColumnWidth, a = r.estimatedRowHeight, l = {
|
|
1721
1720
|
columnMetadataMap: {},
|
|
1722
|
-
estimatedColumnWidth: o ||
|
|
1723
|
-
estimatedRowHeight: a ||
|
|
1721
|
+
estimatedColumnWidth: o || Jt,
|
|
1722
|
+
estimatedRowHeight: a || Jt,
|
|
1724
1723
|
lastMeasuredColumnIndex: -1,
|
|
1725
1724
|
lastMeasuredRowIndex: -1,
|
|
1726
1725
|
rowMetadataMap: {}
|
|
1727
1726
|
};
|
|
1728
|
-
return n.resetAfterColumnIndex = function(d,
|
|
1729
|
-
|
|
1727
|
+
return n.resetAfterColumnIndex = function(d, c) {
|
|
1728
|
+
c === void 0 && (c = !0), n.resetAfterIndices({
|
|
1730
1729
|
columnIndex: d,
|
|
1731
|
-
shouldForceUpdate:
|
|
1730
|
+
shouldForceUpdate: c
|
|
1732
1731
|
});
|
|
1733
|
-
}, n.resetAfterRowIndex = function(d,
|
|
1734
|
-
|
|
1732
|
+
}, n.resetAfterRowIndex = function(d, c) {
|
|
1733
|
+
c === void 0 && (c = !0), n.resetAfterIndices({
|
|
1735
1734
|
rowIndex: d,
|
|
1736
|
-
shouldForceUpdate:
|
|
1735
|
+
shouldForceUpdate: c
|
|
1737
1736
|
});
|
|
1738
1737
|
}, n.resetAfterIndices = function(d) {
|
|
1739
|
-
var
|
|
1740
|
-
typeof
|
|
1741
|
-
},
|
|
1738
|
+
var c = d.columnIndex, m = d.rowIndex, f = d.shouldForceUpdate, C = f === void 0 ? !0 : f;
|
|
1739
|
+
typeof c == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, c - 1)), typeof m == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, m - 1)), n._getItemStyleCache(-1), C && n.forceUpdate();
|
|
1740
|
+
}, l;
|
|
1742
1741
|
},
|
|
1743
1742
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
1744
1743
|
validateProps: function(e) {
|
|
@@ -1752,7 +1751,7 @@ var di = function(e, n) {
|
|
|
1752
1751
|
}
|
|
1753
1752
|
});
|
|
1754
1753
|
process.env.NODE_ENV;
|
|
1755
|
-
function
|
|
1754
|
+
function nn(t, e) {
|
|
1756
1755
|
for (var n in t)
|
|
1757
1756
|
if (!(n in e))
|
|
1758
1757
|
return !0;
|
|
@@ -1761,145 +1760,145 @@ function rn(t, e) {
|
|
|
1761
1760
|
return !0;
|
|
1762
1761
|
return !1;
|
|
1763
1762
|
}
|
|
1764
|
-
var
|
|
1765
|
-
function
|
|
1766
|
-
var n = t.style, r =
|
|
1767
|
-
return !
|
|
1763
|
+
var ui = ["style"], pi = ["style"];
|
|
1764
|
+
function hi(t, e) {
|
|
1765
|
+
var n = t.style, r = Kt(t, ui), o = e.style, a = Kt(e, pi);
|
|
1766
|
+
return !nn(n, o) && !nn(r, a);
|
|
1768
1767
|
}
|
|
1769
|
-
const
|
|
1770
|
-
const { viewMode: t } = He(), { scrollMode: e } = ze(), { setColumnCount: n } =
|
|
1771
|
-
const u = g %
|
|
1768
|
+
const fi = () => {
|
|
1769
|
+
const { viewMode: t } = He(), { scrollMode: e } = ze(), { setColumnCount: n } = fn(), { virtualScrollableElementRef: r } = nt(), o = Ze(), a = k(() => o.heights.length, [o.heights]), l = k(() => e === ie.HORIZONTAL_SCROLLING ? a : t === Oe.DUAL_PAGE ? 2 : 1, [t, e, e, a, r]), d = k(() => o.widths.reduce((v, I, g) => {
|
|
1770
|
+
const u = g % l;
|
|
1772
1771
|
return (!v[u] || I > v[u]) && (v[u] = I), v;
|
|
1773
|
-
}, []), [o.widths,
|
|
1774
|
-
(
|
|
1775
|
-
const v =
|
|
1772
|
+
}, []), [o.widths, l]), c = E(
|
|
1773
|
+
(w) => {
|
|
1774
|
+
const v = w % d.length;
|
|
1776
1775
|
return d[v] || 0;
|
|
1777
1776
|
},
|
|
1778
1777
|
[d]
|
|
1779
|
-
),
|
|
1780
|
-
(
|
|
1781
|
-
const v = Array.from({ length:
|
|
1782
|
-
const u =
|
|
1778
|
+
), m = E(
|
|
1779
|
+
(w) => {
|
|
1780
|
+
const v = Array.from({ length: l }, (I, g) => {
|
|
1781
|
+
const u = w * l + g;
|
|
1783
1782
|
return o.heights[u] || 0;
|
|
1784
1783
|
});
|
|
1785
1784
|
return Math.max(...v);
|
|
1786
1785
|
},
|
|
1787
|
-
[o.heights,
|
|
1786
|
+
[o.heights, l]
|
|
1788
1787
|
);
|
|
1789
1788
|
D(() => {
|
|
1790
|
-
n(
|
|
1791
|
-
}, [
|
|
1792
|
-
const
|
|
1793
|
-
const { rowsHeight:
|
|
1789
|
+
n(l);
|
|
1790
|
+
}, [l, n]);
|
|
1791
|
+
const f = k(() => e === ie.HORIZONTAL_SCROLLING || e === ie.PAGE_SCROLLING ? 1 : Math.round(a / l), [l, a, e]), C = k(() => o.heights.reduce((w, v) => w + v, 0) / o.heights.length || 0, [o]), p = k(() => o.widths.reduce((w, v) => w + v, 0) / o.widths.length || 0, [o]), _ = k(() => {
|
|
1792
|
+
const { rowsHeight: w, columnsWidth: v } = xt(o, l);
|
|
1794
1793
|
return {
|
|
1795
|
-
rowsHeight:
|
|
1794
|
+
rowsHeight: w,
|
|
1796
1795
|
columnsWidth: v
|
|
1797
1796
|
};
|
|
1798
|
-
}, [o,
|
|
1799
|
-
width:
|
|
1800
|
-
height:
|
|
1801
|
-
}), [
|
|
1797
|
+
}, [o, l]), P = k(() => ({
|
|
1798
|
+
width: _.columnsWidth.reduce((w, v) => w + v, 0),
|
|
1799
|
+
height: _.rowsHeight.reduce((w, v) => w + v, 0)
|
|
1800
|
+
}), [_]);
|
|
1802
1801
|
return {
|
|
1803
|
-
rowCount:
|
|
1804
|
-
rowHeight:
|
|
1805
|
-
columnCount:
|
|
1806
|
-
columnWidth:
|
|
1802
|
+
rowCount: f,
|
|
1803
|
+
rowHeight: m,
|
|
1804
|
+
columnCount: l,
|
|
1805
|
+
columnWidth: c,
|
|
1807
1806
|
pageDimension: o,
|
|
1808
1807
|
estimatedRowHeight: C,
|
|
1809
|
-
estimatedColumnWidth:
|
|
1810
|
-
gridDimension:
|
|
1808
|
+
estimatedColumnWidth: p,
|
|
1809
|
+
gridDimension: _,
|
|
1811
1810
|
totalDimension: P
|
|
1812
1811
|
};
|
|
1813
1812
|
};
|
|
1814
1813
|
let ue;
|
|
1815
1814
|
typeof window < "u" ? ue = window : typeof self < "u" ? ue = self : ue = global;
|
|
1816
1815
|
let Ct = null, Pt = null;
|
|
1817
|
-
const
|
|
1818
|
-
vt == null ||
|
|
1819
|
-
return
|
|
1816
|
+
const on = 20, gt = ue.clearTimeout, rn = ue.setTimeout, vt = ue.cancelAnimationFrame || ue.mozCancelAnimationFrame || ue.webkitCancelAnimationFrame, an = ue.requestAnimationFrame || ue.mozRequestAnimationFrame || ue.webkitRequestAnimationFrame;
|
|
1817
|
+
vt == null || an == null ? (Ct = gt, Pt = function(e) {
|
|
1818
|
+
return rn(e, on);
|
|
1820
1819
|
}) : (Ct = function([e, n]) {
|
|
1821
1820
|
vt(e), gt(n);
|
|
1822
1821
|
}, Pt = function(e) {
|
|
1823
|
-
const n =
|
|
1822
|
+
const n = an(function() {
|
|
1824
1823
|
gt(r), e();
|
|
1825
|
-
}), r =
|
|
1824
|
+
}), r = rn(function() {
|
|
1826
1825
|
vt(n), e();
|
|
1827
|
-
},
|
|
1826
|
+
}, on);
|
|
1828
1827
|
return [n, r];
|
|
1829
1828
|
});
|
|
1830
|
-
function
|
|
1831
|
-
let e, n, r, o, a,
|
|
1832
|
-
const
|
|
1833
|
-
if (!
|
|
1834
|
-
|
|
1835
|
-
const g = I.__resizeTriggers__, u = g.firstElementChild,
|
|
1836
|
-
|
|
1829
|
+
function mi(t) {
|
|
1830
|
+
let e, n, r, o, a, l, d;
|
|
1831
|
+
const c = typeof document < "u" && document.attachEvent;
|
|
1832
|
+
if (!c) {
|
|
1833
|
+
l = function(I) {
|
|
1834
|
+
const g = I.__resizeTriggers__, u = g.firstElementChild, h = g.lastElementChild, s = u.firstElementChild;
|
|
1835
|
+
h.scrollLeft = h.scrollWidth, h.scrollTop = h.scrollHeight, s.style.width = u.offsetWidth + 1 + "px", s.style.height = u.offsetHeight + 1 + "px", u.scrollLeft = u.scrollWidth, u.scrollTop = u.scrollHeight;
|
|
1837
1836
|
}, a = function(I) {
|
|
1838
1837
|
return I.offsetWidth !== I.__resizeLast__.width || I.offsetHeight !== I.__resizeLast__.height;
|
|
1839
1838
|
}, d = function(I) {
|
|
1840
1839
|
if (I.target.className && typeof I.target.className.indexOf == "function" && I.target.className.indexOf("contract-trigger") < 0 && I.target.className.indexOf("expand-trigger") < 0)
|
|
1841
1840
|
return;
|
|
1842
1841
|
const g = this;
|
|
1843
|
-
|
|
1842
|
+
l(this), this.__resizeRAF__ && Ct(this.__resizeRAF__), this.__resizeRAF__ = Pt(function() {
|
|
1844
1843
|
a(g) && (g.__resizeLast__.width = g.offsetWidth, g.__resizeLast__.height = g.offsetHeight, g.__resizeListeners__.forEach(function(s) {
|
|
1845
1844
|
s.call(g, I);
|
|
1846
1845
|
}));
|
|
1847
1846
|
});
|
|
1848
1847
|
};
|
|
1849
|
-
let
|
|
1848
|
+
let p = !1, _ = "";
|
|
1850
1849
|
r = "animationstart";
|
|
1851
1850
|
const P = "Webkit Moz O ms".split(" ");
|
|
1852
|
-
let
|
|
1851
|
+
let w = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), v = "";
|
|
1853
1852
|
{
|
|
1854
1853
|
const I = document.createElement("fakeelement");
|
|
1855
|
-
if (I.style.animationName !== void 0 && (
|
|
1854
|
+
if (I.style.animationName !== void 0 && (p = !0), p === !1) {
|
|
1856
1855
|
for (let g = 0; g < P.length; g++)
|
|
1857
1856
|
if (I.style[P[g] + "AnimationName"] !== void 0) {
|
|
1858
|
-
v = P[g],
|
|
1857
|
+
v = P[g], _ = "-" + v.toLowerCase() + "-", r = w[g], p = !0;
|
|
1859
1858
|
break;
|
|
1860
1859
|
}
|
|
1861
1860
|
}
|
|
1862
1861
|
}
|
|
1863
|
-
n = "resizeanim", e = "@" +
|
|
1862
|
+
n = "resizeanim", e = "@" + _ + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", o = _ + "animation: 1ms " + n + "; ";
|
|
1864
1863
|
}
|
|
1865
|
-
const
|
|
1866
|
-
if (!
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1864
|
+
const m = function(p) {
|
|
1865
|
+
if (!p.getElementById("detectElementResize")) {
|
|
1866
|
+
const _ = (e || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', P = p.head || p.getElementsByTagName("head")[0], w = p.createElement("style");
|
|
1867
|
+
w.id = "detectElementResize", w.type = "text/css", t != null && w.setAttribute("nonce", t), w.styleSheet ? w.styleSheet.cssText = _ : w.appendChild(p.createTextNode(_)), P.appendChild(w);
|
|
1869
1868
|
}
|
|
1870
1869
|
};
|
|
1871
1870
|
return {
|
|
1872
|
-
addResizeListener: function(
|
|
1873
|
-
if (
|
|
1874
|
-
|
|
1871
|
+
addResizeListener: function(p, _) {
|
|
1872
|
+
if (c)
|
|
1873
|
+
p.attachEvent("onresize", _);
|
|
1875
1874
|
else {
|
|
1876
|
-
if (!
|
|
1877
|
-
const P =
|
|
1878
|
-
|
|
1875
|
+
if (!p.__resizeTriggers__) {
|
|
1876
|
+
const P = p.ownerDocument, w = ue.getComputedStyle(p);
|
|
1877
|
+
w && w.position === "static" && (p.style.position = "relative"), m(P), p.__resizeLast__ = {}, p.__resizeListeners__ = [], (p.__resizeTriggers__ = P.createElement("div")).className = "resize-triggers";
|
|
1879
1878
|
const v = P.createElement("div");
|
|
1880
1879
|
v.className = "expand-trigger", v.appendChild(P.createElement("div"));
|
|
1881
1880
|
const I = P.createElement("div");
|
|
1882
|
-
I.className = "contract-trigger",
|
|
1883
|
-
u.animationName === n &&
|
|
1884
|
-
},
|
|
1881
|
+
I.className = "contract-trigger", p.__resizeTriggers__.appendChild(v), p.__resizeTriggers__.appendChild(I), p.appendChild(p.__resizeTriggers__), l(p), p.addEventListener("scroll", d, !0), r && (p.__resizeTriggers__.__animationListener__ = function(u) {
|
|
1882
|
+
u.animationName === n && l(p);
|
|
1883
|
+
}, p.__resizeTriggers__.addEventListener(r, p.__resizeTriggers__.__animationListener__));
|
|
1885
1884
|
}
|
|
1886
|
-
|
|
1885
|
+
p.__resizeListeners__.push(_);
|
|
1887
1886
|
}
|
|
1888
1887
|
},
|
|
1889
|
-
removeResizeListener: function(
|
|
1890
|
-
if (
|
|
1891
|
-
|
|
1892
|
-
else if (
|
|
1893
|
-
|
|
1888
|
+
removeResizeListener: function(p, _) {
|
|
1889
|
+
if (c)
|
|
1890
|
+
p.detachEvent("onresize", _);
|
|
1891
|
+
else if (p.__resizeListeners__.splice(p.__resizeListeners__.indexOf(_), 1), !p.__resizeListeners__.length) {
|
|
1892
|
+
p.removeEventListener("scroll", d, !0), p.__resizeTriggers__.__animationListener__ && (p.__resizeTriggers__.removeEventListener(r, p.__resizeTriggers__.__animationListener__), p.__resizeTriggers__.__animationListener__ = null);
|
|
1894
1893
|
try {
|
|
1895
|
-
|
|
1894
|
+
p.__resizeTriggers__ = !p.removeChild(p.__resizeTriggers__);
|
|
1896
1895
|
} catch {
|
|
1897
1896
|
}
|
|
1898
1897
|
}
|
|
1899
1898
|
}
|
|
1900
1899
|
};
|
|
1901
1900
|
}
|
|
1902
|
-
class
|
|
1901
|
+
class gi extends lo {
|
|
1903
1902
|
constructor(...e) {
|
|
1904
1903
|
super(...e), this.state = {
|
|
1905
1904
|
height: this.props.defaultHeight || 0,
|
|
@@ -1912,24 +1911,24 @@ class wi extends po {
|
|
|
1912
1911
|
onResize: o
|
|
1913
1912
|
} = this.props;
|
|
1914
1913
|
if (this._parentNode) {
|
|
1915
|
-
const a = window.getComputedStyle(this._parentNode) || {},
|
|
1916
|
-
if (!n && this.state.height !== C || !r && this.state.width !==
|
|
1914
|
+
const a = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(a.paddingLeft || "0"), d = parseFloat(a.paddingRight || "0"), c = parseFloat(a.paddingTop || "0"), m = parseFloat(a.paddingBottom || "0"), f = this._parentNode.getBoundingClientRect(), C = f.height - c - m, p = f.width - l - d;
|
|
1915
|
+
if (!n && this.state.height !== C || !r && this.state.width !== p) {
|
|
1917
1916
|
this.setState({
|
|
1918
1917
|
height: C,
|
|
1919
|
-
width:
|
|
1918
|
+
width: p
|
|
1920
1919
|
});
|
|
1921
|
-
const
|
|
1920
|
+
const _ = () => {
|
|
1922
1921
|
this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
|
|
1923
1922
|
};
|
|
1924
1923
|
typeof o == "function" && o({
|
|
1925
1924
|
height: C,
|
|
1926
|
-
width:
|
|
1925
|
+
width: p,
|
|
1927
1926
|
// TODO Remove these params in the next major release
|
|
1928
1927
|
get scaledHeight() {
|
|
1929
|
-
return
|
|
1928
|
+
return _(), C;
|
|
1930
1929
|
},
|
|
1931
1930
|
get scaledWidth() {
|
|
1932
|
-
return
|
|
1931
|
+
return _(), p;
|
|
1933
1932
|
}
|
|
1934
1933
|
});
|
|
1935
1934
|
}
|
|
@@ -1947,7 +1946,7 @@ class wi extends po {
|
|
|
1947
1946
|
const r = n.ownerDocument.defaultView.ResizeObserver;
|
|
1948
1947
|
r != null ? (this._resizeObserver = new r(() => {
|
|
1949
1948
|
this._timeoutId = setTimeout(this._onResize, 0);
|
|
1950
|
-
}), this._resizeObserver.observe(n)) : (this._detectElementResize =
|
|
1949
|
+
}), this._resizeObserver.observe(n)) : (this._detectElementResize = mi(e), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
|
|
1951
1950
|
}
|
|
1952
1951
|
}
|
|
1953
1952
|
componentWillUnmount() {
|
|
@@ -1960,61 +1959,61 @@ class wi extends po {
|
|
|
1960
1959
|
defaultWidth: r,
|
|
1961
1960
|
disableHeight: o = !1,
|
|
1962
1961
|
disableWidth: a = !1,
|
|
1963
|
-
doNotBailOutOnEmptyChildren:
|
|
1962
|
+
doNotBailOutOnEmptyChildren: l = !1,
|
|
1964
1963
|
nonce: d,
|
|
1965
|
-
onResize:
|
|
1966
|
-
style:
|
|
1967
|
-
tagName:
|
|
1964
|
+
onResize: c,
|
|
1965
|
+
style: m = {},
|
|
1966
|
+
tagName: f = "div",
|
|
1968
1967
|
...C
|
|
1969
1968
|
} = this.props, {
|
|
1970
|
-
height:
|
|
1971
|
-
width:
|
|
1969
|
+
height: p,
|
|
1970
|
+
width: _
|
|
1972
1971
|
} = this.state, P = {
|
|
1973
1972
|
overflow: "visible"
|
|
1974
|
-
},
|
|
1973
|
+
}, w = {};
|
|
1975
1974
|
let v = !1;
|
|
1976
|
-
return o || (
|
|
1975
|
+
return o || (p === 0 && (v = !0), P.height = 0, w.height = p, w.scaledHeight = p), a || (_ === 0 && (v = !0), P.width = 0, w.width = _, w.scaledWidth = _), l && (v = !1), Ke(f, {
|
|
1977
1976
|
ref: this._setRef,
|
|
1978
1977
|
style: {
|
|
1979
1978
|
...P,
|
|
1980
|
-
...
|
|
1979
|
+
...m
|
|
1981
1980
|
},
|
|
1982
1981
|
...C
|
|
1983
|
-
}, !v && e(
|
|
1982
|
+
}, !v && e(w));
|
|
1984
1983
|
}
|
|
1985
1984
|
}
|
|
1986
|
-
const
|
|
1987
|
-
const { focusedPage: n, totalPages: r } = he(), o =
|
|
1988
|
-
const d = [],
|
|
1989
|
-
if (d.push(
|
|
1990
|
-
const
|
|
1991
|
-
d.push(
|
|
1985
|
+
const vi = pn(({ widths: t, heights: e }) => {
|
|
1986
|
+
const { focusedPage: n, totalPages: r } = he(), o = k(() => {
|
|
1987
|
+
const d = [], c = Math.ceil(n / 2) * 2 - 1;
|
|
1988
|
+
if (d.push(c), c + 1 <= r) {
|
|
1989
|
+
const m = c + 1;
|
|
1990
|
+
d.push(m);
|
|
1992
1991
|
}
|
|
1993
1992
|
return d;
|
|
1994
|
-
}, [n, r]), a =
|
|
1995
|
-
const d = n % 2 === 1 ? n - 1 : n - 2,
|
|
1993
|
+
}, [n, r]), a = k(() => {
|
|
1994
|
+
const d = n % 2 === 1 ? n - 1 : n - 2, c = Math.floor(d / 2), m = e(c), f = t(d), C = t(d + 1);
|
|
1996
1995
|
return [
|
|
1997
1996
|
{
|
|
1998
1997
|
position: "absolute",
|
|
1999
1998
|
left: 0,
|
|
2000
|
-
width:
|
|
2001
|
-
height:
|
|
1999
|
+
width: f,
|
|
2000
|
+
height: m
|
|
2002
2001
|
},
|
|
2003
2002
|
{
|
|
2004
2003
|
position: "absolute",
|
|
2005
|
-
left:
|
|
2004
|
+
left: f,
|
|
2006
2005
|
width: C,
|
|
2007
|
-
height:
|
|
2006
|
+
height: m
|
|
2008
2007
|
}
|
|
2009
2008
|
];
|
|
2010
|
-
}, [t, e, o]),
|
|
2011
|
-
return /* @__PURE__ */ i("div", { style: { width:
|
|
2012
|
-
}),
|
|
2013
|
-
const { focusedPage: n } = he(), r =
|
|
2009
|
+
}, [t, e, o]), l = k(() => a.reduce((d, c) => d + Number(c.width || 0), 0), [a]);
|
|
2010
|
+
return /* @__PURE__ */ i("div", { style: { width: l, position: "relative" }, children: o.map((d, c) => /* @__PURE__ */ i(Ot, { style: a[c], pageNumber: d }, d)) });
|
|
2011
|
+
}), wi = ({ widths: t, heights: e }) => {
|
|
2012
|
+
const { focusedPage: n } = he(), r = k(() => ({
|
|
2014
2013
|
position: "absolute",
|
|
2015
2014
|
width: t(n - 1),
|
|
2016
2015
|
height: e(n - 1)
|
|
2017
|
-
}), [t, e, n]), o =
|
|
2016
|
+
}), [t, e, n]), o = k(() => t(n - 1), [t]);
|
|
2018
2017
|
return /* @__PURE__ */ i(
|
|
2019
2018
|
"div",
|
|
2020
2019
|
{
|
|
@@ -2025,119 +2024,119 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2025
2024
|
children: /* @__PURE__ */ i(Ot, { style: r, pageNumber: n }, n)
|
|
2026
2025
|
}
|
|
2027
2026
|
);
|
|
2028
|
-
},
|
|
2029
|
-
const r = H(), { contentRef: o } = Ce(), { heights: a, widths:
|
|
2030
|
-
const { rowsHeight: P, columnsWidth:
|
|
2027
|
+
}, _i = (t, e, n) => {
|
|
2028
|
+
const r = H(), { contentRef: o } = Ce(), { heights: a, widths: l } = Ze(), { setFocusedPage: d } = he(), [c, m] = $([]), { targetScrollPage: f } = mn(), C = Rt(c, 0, 500), p = k(() => {
|
|
2029
|
+
const { rowsHeight: P, columnsWidth: w } = xt({ heights: a, widths: l }, t);
|
|
2031
2030
|
return a.map((v, I) => {
|
|
2032
|
-
const g =
|
|
2031
|
+
const g = l[I], u = ar(I + 1, t), h = w.slice(0, u.columnIndex).reduce((y, x) => y + x, 0), s = P.slice(0, u.rowIndex).reduce((y, x) => y + x, 0), b = h + g, T = s + v;
|
|
2033
2032
|
return {
|
|
2034
2033
|
pageNumber: I + 1,
|
|
2035
2034
|
...u,
|
|
2036
2035
|
width: g,
|
|
2037
2036
|
height: v,
|
|
2038
|
-
startX:
|
|
2037
|
+
startX: h,
|
|
2039
2038
|
startY: s,
|
|
2040
|
-
endX:
|
|
2041
|
-
endY:
|
|
2039
|
+
endX: b,
|
|
2040
|
+
endY: T
|
|
2042
2041
|
};
|
|
2043
2042
|
});
|
|
2044
|
-
}, [a,
|
|
2043
|
+
}, [a, l, t, e]);
|
|
2045
2044
|
D(() => {
|
|
2046
|
-
var
|
|
2047
|
-
C.length > 0 && !
|
|
2048
|
-
|
|
2045
|
+
var w;
|
|
2046
|
+
C.length > 0 && !f.current && d(C[0].pageNumber), ((w = C[0]) == null ? void 0 : w.ratio) && C.some((v) => v.pageNumber === f.current) && setTimeout(() => {
|
|
2047
|
+
f.current = void 0;
|
|
2049
2048
|
}, 500);
|
|
2050
2049
|
}, [C, d]);
|
|
2051
|
-
const
|
|
2050
|
+
const _ = E(
|
|
2052
2051
|
(P) => {
|
|
2053
2052
|
r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
2054
|
-
const
|
|
2055
|
-
startTop:
|
|
2056
|
-
startLeft:
|
|
2057
|
-
endTop:
|
|
2058
|
-
endLeft:
|
|
2059
|
-
}, I =
|
|
2060
|
-
const u = g.endX >= v.startLeft && g.endY >= v.startTop,
|
|
2061
|
-
return u &&
|
|
2053
|
+
const w = P.target, v = {
|
|
2054
|
+
startTop: w.scrollTop,
|
|
2055
|
+
startLeft: w.scrollLeft,
|
|
2056
|
+
endTop: w.scrollTop + w.clientHeight,
|
|
2057
|
+
endLeft: w.scrollLeft + w.clientWidth
|
|
2058
|
+
}, I = p.filter((g) => {
|
|
2059
|
+
const u = g.endX >= v.startLeft && g.endY >= v.startTop, h = g.startX <= v.endLeft && g.startY <= v.endTop;
|
|
2060
|
+
return u && h;
|
|
2062
2061
|
}).map((g) => {
|
|
2063
|
-
const u = v.startLeft > g.startX ? v.startLeft : g.startX,
|
|
2062
|
+
const u = v.startLeft > g.startX ? v.startLeft : g.startX, h = v.startTop > g.startY ? v.startTop : g.startY, s = v.endLeft < g.endX ? v.endLeft : g.endX, b = v.endTop < g.endY ? v.endTop : g.endY, T = s - u, y = b - h, S = +(T * y / (g.width * g.height) * 100).toFixed(2);
|
|
2064
2063
|
return {
|
|
2065
2064
|
pageNumber: g.pageNumber,
|
|
2066
2065
|
ratio: S
|
|
2067
2066
|
};
|
|
2068
2067
|
}).sort((g, u) => u.ratio - g.ratio);
|
|
2069
|
-
|
|
2068
|
+
m(I);
|
|
2070
2069
|
});
|
|
2071
2070
|
},
|
|
2072
|
-
[o,
|
|
2071
|
+
[o, p]
|
|
2073
2072
|
);
|
|
2074
2073
|
D(() => {
|
|
2075
2074
|
if (n)
|
|
2076
|
-
return n == null || n.addEventListener("scroll",
|
|
2077
|
-
n == null || n.removeEventListener("scroll",
|
|
2075
|
+
return n == null || n.addEventListener("scroll", _), () => {
|
|
2076
|
+
n == null || n.removeEventListener("scroll", _);
|
|
2078
2077
|
};
|
|
2079
|
-
}, [n,
|
|
2080
|
-
},
|
|
2081
|
-
const { children: n, toolbarRef: r, style: o, className: a, ...
|
|
2078
|
+
}, [n, _]);
|
|
2079
|
+
}, On = rt((t, e) => {
|
|
2080
|
+
const { children: n, toolbarRef: r, style: o, className: a, ...l } = t, { customVariables: d, customDarkVariables: c } = Ho(), { darkMode: m } = vo();
|
|
2082
2081
|
return /* @__PURE__ */ i(
|
|
2083
2082
|
"div",
|
|
2084
2083
|
{
|
|
2085
2084
|
ref: e,
|
|
2086
|
-
...
|
|
2085
|
+
...l,
|
|
2087
2086
|
className: se(
|
|
2088
2087
|
ye["rp-theme-variables"],
|
|
2089
2088
|
ye["rp-container"],
|
|
2090
|
-
|
|
2089
|
+
m ? ye["rp-dark-mode"] : "",
|
|
2091
2090
|
a
|
|
2092
2091
|
),
|
|
2093
2092
|
style: {
|
|
2094
2093
|
"--rp-toolbar-height": `${(r == null ? void 0 : r.clientHeight) || 48}px`,
|
|
2095
2094
|
...d,
|
|
2096
|
-
...
|
|
2095
|
+
...m ? c : {},
|
|
2097
2096
|
...o
|
|
2098
2097
|
},
|
|
2099
2098
|
children: n
|
|
2100
2099
|
}
|
|
2101
2100
|
);
|
|
2102
|
-
}),
|
|
2103
|
-
const o =
|
|
2101
|
+
}), bi = pn(({ columnIndex: t, rowIndex: e, data: n, style: r }) => {
|
|
2102
|
+
const o = sr(e, t, n.columnCount);
|
|
2104
2103
|
return /* @__PURE__ */ i(Ot, { style: r, pageNumber: o }, o);
|
|
2105
|
-
},
|
|
2106
|
-
const t = H(new
|
|
2107
|
-
virtualScrollRef:
|
|
2108
|
-
getVirtualScrollRef:
|
|
2109
|
-
getPageScrollElementRef:
|
|
2104
|
+
}, hi), _c = () => {
|
|
2105
|
+
const t = H(new Qo()), { initialPage: e = 1, initialScrollMode: n, instanceId: r } = bo(), { pagesRef: o, setPagesRef: a, setContentRef: l } = Ce(), { scrollToPage: d } = Tn(), {
|
|
2106
|
+
virtualScrollRef: c,
|
|
2107
|
+
getVirtualScrollRef: m,
|
|
2108
|
+
getPageScrollElementRef: f,
|
|
2110
2109
|
getVirtualScrollableElementRef: C,
|
|
2111
|
-
setTotalInnerDimensions:
|
|
2112
|
-
virtualScrollableElementRef:
|
|
2110
|
+
setTotalInnerDimensions: p,
|
|
2111
|
+
virtualScrollableElementRef: _,
|
|
2113
2112
|
totalInnerDimensions: P,
|
|
2114
|
-
pageScrollElementRef:
|
|
2115
|
-
} = nt(), v = H(!0), { nextPage: I, prevPage: g, setFocusedPage: u, focusedPage:
|
|
2113
|
+
pageScrollElementRef: w
|
|
2114
|
+
} = nt(), v = H(!0), { nextPage: I, prevPage: g, setFocusedPage: u, focusedPage: h } = he(), { scrollMode: s } = ze(), { viewMode: b } = He(), T = H(null), { loading: y, error: x } = re(), { passwordRequired: S } = go(), { LoaderImageComponent: R } = yt(), L = H(
|
|
2116
2115
|
P
|
|
2117
2116
|
), N = H({
|
|
2118
|
-
viewMode:
|
|
2117
|
+
viewMode: b,
|
|
2119
2118
|
scrollMode: s
|
|
2120
|
-
}),
|
|
2119
|
+
}), M = H(!1), A = H(), { isFullScreen: z } = To(), {
|
|
2121
2120
|
pageDimension: F,
|
|
2122
2121
|
rowCount: O,
|
|
2123
|
-
rowHeight:
|
|
2124
|
-
columnCount:
|
|
2122
|
+
rowHeight: G,
|
|
2123
|
+
columnCount: q,
|
|
2125
2124
|
columnWidth: V,
|
|
2126
2125
|
estimatedColumnWidth: B,
|
|
2127
2126
|
estimatedRowHeight: ee,
|
|
2128
2127
|
totalDimension: U
|
|
2129
|
-
} =
|
|
2130
|
-
|
|
2128
|
+
} = fi(), Q = Rt(P, 100), { onScroll: Y } = Oo(), te = H();
|
|
2129
|
+
_i(q, O, _);
|
|
2131
2130
|
const ne = H({
|
|
2132
2131
|
scrollTop: 0,
|
|
2133
2132
|
scrollLeft: 0
|
|
2134
2133
|
});
|
|
2135
|
-
|
|
2136
|
-
const { isPressed: J } =
|
|
2134
|
+
dr(o);
|
|
2135
|
+
const { isPressed: J } = cr(), { selectionMode: ce } = _o(), { initializeGrabScroll: ae, resetGrabState: we } = lr({
|
|
2137
2136
|
isPressed: J
|
|
2138
|
-
}), _e =
|
|
2139
|
-
columnCount:
|
|
2140
|
-
}), [
|
|
2137
|
+
}), _e = k(() => ce === fo.HAND, [ce]), st = k(() => ({
|
|
2138
|
+
columnCount: q
|
|
2139
|
+
}), [q]), ct = E(
|
|
2141
2140
|
(Z) => {
|
|
2142
2141
|
const j = document.activeElement !== o;
|
|
2143
2142
|
!z && j || (["ArrowUp", "ArrowLeft"].includes(Z.key) ? (Z.preventDefault(), g()) : ["ArrowDown", "ArrowRight"].includes(Z.key) && (Z.preventDefault(), I()));
|
|
@@ -2147,32 +2146,32 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2147
2146
|
D(() => (window.addEventListener("keydown", ct), () => {
|
|
2148
2147
|
window.removeEventListener("keydown", ct);
|
|
2149
2148
|
}), [ct]), D(() => {
|
|
2150
|
-
if (
|
|
2149
|
+
if (T.current && (T.current.style.position = "relative"), !!c)
|
|
2151
2150
|
for (let Z = 0; Z < O; Z++)
|
|
2152
|
-
for (let j = 0; j <
|
|
2153
|
-
|
|
2151
|
+
for (let j = 0; j < q; j++)
|
|
2152
|
+
c.resetAfterIndices({
|
|
2154
2153
|
columnIndex: j,
|
|
2155
2154
|
rowIndex: Z,
|
|
2156
2155
|
shouldForceUpdate: !0
|
|
2157
2156
|
});
|
|
2158
|
-
}, [O,
|
|
2159
|
-
const
|
|
2157
|
+
}, [O, q, F, c]);
|
|
2158
|
+
const eo = E(
|
|
2160
2159
|
(Z, j) => {
|
|
2161
|
-
if (!
|
|
2160
|
+
if (!_)
|
|
2162
2161
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
2163
2162
|
const Re = ne.current.scrollTop > j, Le = ne.current.scrollLeft > Z;
|
|
2164
2163
|
return Re || Le ? ne.current : {
|
|
2165
|
-
scrollTop:
|
|
2166
|
-
scrollLeft:
|
|
2164
|
+
scrollTop: _.scrollTop,
|
|
2165
|
+
scrollLeft: _.scrollLeft
|
|
2167
2166
|
};
|
|
2168
2167
|
},
|
|
2169
|
-
[
|
|
2168
|
+
[_]
|
|
2170
2169
|
), Ft = E(
|
|
2171
2170
|
(Z, j) => {
|
|
2172
|
-
if (N.current.viewMode !==
|
|
2173
|
-
te.current && clearTimeout(te.current),
|
|
2171
|
+
if (N.current.viewMode !== b || N.current.scrollMode !== s) {
|
|
2172
|
+
te.current && clearTimeout(te.current), M.current = !0, d(h, "auto"), te.current = setTimeout(() => {
|
|
2174
2173
|
requestAnimationFrame(() => {
|
|
2175
|
-
N.current = { viewMode:
|
|
2174
|
+
N.current = { viewMode: b, scrollMode: s };
|
|
2176
2175
|
});
|
|
2177
2176
|
}, 100);
|
|
2178
2177
|
return;
|
|
@@ -2180,16 +2179,16 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2180
2179
|
const Le = Z.scrollTop, lt = Z.scrollLeft;
|
|
2181
2180
|
if (!j.height || !j.width)
|
|
2182
2181
|
return;
|
|
2183
|
-
|
|
2184
|
-
const { height: Ee, width: dt } = j, { height:
|
|
2185
|
-
if (
|
|
2182
|
+
M.current = !0;
|
|
2183
|
+
const { height: Ee, width: dt } = j, { height: Mt, width: kt } = L.current;
|
|
2184
|
+
if (Mt === Ee && kt === dt)
|
|
2186
2185
|
return;
|
|
2187
|
-
const
|
|
2186
|
+
const ro = Le / Mt * Ee, io = lt / kt * dt, ao = Math.round(Math.min(ro, Ee)) || 0, so = Math.round(Math.min(io, dt)) || 0;
|
|
2188
2187
|
A.current = setTimeout(() => {
|
|
2189
2188
|
requestAnimationFrame(() => {
|
|
2190
|
-
|
|
2191
|
-
top:
|
|
2192
|
-
left:
|
|
2189
|
+
_ == null || _.scrollTo({
|
|
2190
|
+
top: ao,
|
|
2191
|
+
left: so,
|
|
2193
2192
|
behavior: "auto"
|
|
2194
2193
|
});
|
|
2195
2194
|
});
|
|
@@ -2198,43 +2197,43 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2198
2197
|
width: j.width
|
|
2199
2198
|
};
|
|
2200
2199
|
},
|
|
2201
|
-
[
|
|
2200
|
+
[_, b, s, d]
|
|
2202
2201
|
);
|
|
2203
2202
|
D(() => {
|
|
2204
2203
|
clearTimeout(A.current);
|
|
2205
2204
|
const Z = Array.from({ length: O }).reduce(
|
|
2206
|
-
(Le, lt, Ee) => Le +
|
|
2205
|
+
(Le, lt, Ee) => Le + G(Ee),
|
|
2207
2206
|
0
|
|
2208
|
-
), j = Array.from({ length:
|
|
2207
|
+
), j = Array.from({ length: q }).reduce(
|
|
2209
2208
|
(Le, lt, Ee) => Le + V(Ee),
|
|
2210
2209
|
0
|
|
2211
|
-
), Re =
|
|
2212
|
-
ne.current = Re, Ft(Re, { height: Z, width: j }),
|
|
2210
|
+
), Re = eo(j, Z);
|
|
2211
|
+
ne.current = Re, Ft(Re, { height: Z, width: j }), p({
|
|
2213
2212
|
height: Z,
|
|
2214
2213
|
width: j
|
|
2215
2214
|
});
|
|
2216
|
-
}, [F, O,
|
|
2217
|
-
const
|
|
2215
|
+
}, [F, O, q, Ft]);
|
|
2216
|
+
const to = E(
|
|
2218
2217
|
(Z) => {
|
|
2219
2218
|
ne.current = {
|
|
2220
2219
|
scrollTop: Z.scrollTop,
|
|
2221
2220
|
scrollLeft: Z.scrollLeft
|
|
2222
2221
|
};
|
|
2223
2222
|
},
|
|
2224
|
-
[
|
|
2223
|
+
[_]
|
|
2225
2224
|
);
|
|
2226
2225
|
D(() => {
|
|
2227
2226
|
if (Y)
|
|
2228
|
-
return
|
|
2229
|
-
|
|
2227
|
+
return w && w.addEventListener("scroll", Y), _ && _.addEventListener("scroll", Y), () => {
|
|
2228
|
+
w == null || w.removeEventListener("scroll", Y), _ == null || _.removeEventListener("scroll", Y);
|
|
2230
2229
|
};
|
|
2231
|
-
}, [
|
|
2230
|
+
}, [_, w, Y]), D(() => () => {
|
|
2232
2231
|
te.current && clearTimeout(te.current);
|
|
2233
2232
|
}, []);
|
|
2234
|
-
const
|
|
2233
|
+
const no = k(() => se(le["rp-pages-container"], {
|
|
2235
2234
|
[le["rp-cursor-grab"]]: _e && !J,
|
|
2236
2235
|
[le["rp-cursor-grabbing"]]: _e && J
|
|
2237
|
-
}), [_e, J]),
|
|
2236
|
+
}), [_e, J]), oo = E(
|
|
2238
2237
|
(Z) => {
|
|
2239
2238
|
if (_e && Z) {
|
|
2240
2239
|
const j = se(le["rp-pages"]), Re = document.querySelector(`.${j}`);
|
|
@@ -2247,8 +2246,8 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2247
2246
|
y && we();
|
|
2248
2247
|
}, [y]), D(() => {
|
|
2249
2248
|
if (!(Q.height === 0 || !v.current)) {
|
|
2250
|
-
if (n ===
|
|
2251
|
-
e !==
|
|
2249
|
+
if (n === ie.PAGE_SCROLLING) {
|
|
2250
|
+
e !== h && w && u(e), v.current = !1;
|
|
2252
2251
|
return;
|
|
2253
2252
|
}
|
|
2254
2253
|
d(e, "auto"), u(e), v.current = !1;
|
|
@@ -2256,40 +2255,40 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2256
2255
|
}, [
|
|
2257
2256
|
d,
|
|
2258
2257
|
n,
|
|
2259
|
-
|
|
2258
|
+
w,
|
|
2260
2259
|
u,
|
|
2261
2260
|
Q
|
|
2262
2261
|
]), /* @__PURE__ */ W(fe, { children: [
|
|
2263
|
-
/* @__PURE__ */ i(
|
|
2264
|
-
|
|
2262
|
+
/* @__PURE__ */ i(Wo, { ref: l, children: /* @__PURE__ */ i(
|
|
2263
|
+
On,
|
|
2265
2264
|
{
|
|
2266
2265
|
id: r,
|
|
2267
2266
|
ref: a,
|
|
2268
2267
|
tabIndex: -1,
|
|
2269
|
-
className:
|
|
2268
|
+
className: no,
|
|
2270
2269
|
style: {
|
|
2271
|
-
"--scale-round-x": `${
|
|
2272
|
-
"--scale-round-y": `${
|
|
2270
|
+
"--scale-round-x": `${Vt(t.current.sx)[1]}px`,
|
|
2271
|
+
"--scale-round-y": `${Vt(t.current.sy)[1]}px`
|
|
2273
2272
|
},
|
|
2274
|
-
children: /* @__PURE__ */ i(
|
|
2273
|
+
children: /* @__PURE__ */ i(gi, { style: { minHeight: "50px" }, children: ({ width: Z, height: j }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: oo, style: { width: Z, height: j }, children: s === ie.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
2275
2274
|
"div",
|
|
2276
2275
|
{
|
|
2277
|
-
ref:
|
|
2276
|
+
ref: f,
|
|
2278
2277
|
style: { width: Z, height: j },
|
|
2279
2278
|
className: se(le["rp-pages"], le["rp-page-scrolling-wrapper"]),
|
|
2280
|
-
children:
|
|
2279
|
+
children: b === Oe.DUAL_PAGE ? /* @__PURE__ */ i(vi, { widths: V, heights: G }) : /* @__PURE__ */ i(wi, { widths: V, heights: G })
|
|
2281
2280
|
}
|
|
2282
2281
|
) : ee ? /* @__PURE__ */ i(
|
|
2283
|
-
|
|
2282
|
+
di,
|
|
2284
2283
|
{
|
|
2285
|
-
ref:
|
|
2284
|
+
ref: m,
|
|
2286
2285
|
itemData: st,
|
|
2287
2286
|
outerRef: C,
|
|
2288
|
-
innerRef:
|
|
2289
|
-
onScroll:
|
|
2290
|
-
columnCount:
|
|
2287
|
+
innerRef: T,
|
|
2288
|
+
onScroll: to,
|
|
2289
|
+
columnCount: q,
|
|
2291
2290
|
columnWidth: V,
|
|
2292
|
-
rowHeight:
|
|
2291
|
+
rowHeight: G,
|
|
2293
2292
|
height: j,
|
|
2294
2293
|
width: Z,
|
|
2295
2294
|
estimatedColumnWidth: B,
|
|
@@ -2297,15 +2296,15 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2297
2296
|
rowCount: O,
|
|
2298
2297
|
className: se(
|
|
2299
2298
|
le["rp-pages"],
|
|
2300
|
-
s ===
|
|
2299
|
+
s === ie.HORIZONTAL_SCROLLING ? le["rp-pages-horizontal-scroll"] : ""
|
|
2301
2300
|
),
|
|
2302
2301
|
style: {
|
|
2303
2302
|
"--rp-pages-height": `${U.height}px`,
|
|
2304
2303
|
"--rp-pages-width": `${U.width}px`,
|
|
2305
2304
|
"--rp-row-count": `${O}`,
|
|
2306
|
-
"--rp-column-count": `${
|
|
2305
|
+
"--rp-column-count": `${q}`
|
|
2307
2306
|
},
|
|
2308
|
-
children:
|
|
2307
|
+
children: bi
|
|
2309
2308
|
}
|
|
2310
2309
|
) : !y && !x ? /* @__PURE__ */ i(
|
|
2311
2310
|
"div",
|
|
@@ -2320,7 +2319,7 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2320
2319
|
},
|
|
2321
2320
|
children: R && /* @__PURE__ */ i(R, {})
|
|
2322
2321
|
}
|
|
2323
|
-
) : x ===
|
|
2322
|
+
) : x === mo.NOT_SUPPORTED ? /* @__PURE__ */ i("div", { className: le["rp-not-supported"], children: /* @__PURE__ */ W("div", { className: le["rp-not-supported-content"], children: [
|
|
2324
2323
|
"React PDF is unable to render on this browser. Please use the supported browsers from the list below:",
|
|
2325
2324
|
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ W("ul", { children: [
|
|
2326
2325
|
/* @__PURE__ */ i("li", { children: "Chrome 110+" }),
|
|
@@ -2333,7 +2332,7 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2333
2332
|
] }) }) : null }) })
|
|
2334
2333
|
}
|
|
2335
2334
|
) }),
|
|
2336
|
-
S && /* @__PURE__ */ i(
|
|
2335
|
+
S && /* @__PURE__ */ i(ur, {})
|
|
2337
2336
|
] });
|
|
2338
2337
|
}, $e = {
|
|
2339
2338
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
@@ -2345,33 +2344,33 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2345
2344
|
"rp-paginate": "_rp-paginate_1gck0_1",
|
|
2346
2345
|
"rp-page-input": "_rp-page-input_1gck0_6",
|
|
2347
2346
|
"rp-total-page": "_rp-total-page_1gck0_18"
|
|
2348
|
-
},
|
|
2347
|
+
}, Ti = () => {
|
|
2349
2348
|
const { prevIcon: t } = ve(), { prevIcon: e } = ge();
|
|
2350
2349
|
return t || e || /* @__PURE__ */ i(Ue, {});
|
|
2351
|
-
},
|
|
2350
|
+
}, Ci = () => {
|
|
2352
2351
|
const { nextIcon: t } = ve(), { nextIcon: e } = ge();
|
|
2353
2352
|
return t || e || /* @__PURE__ */ i(Ue, { style: { transform: "rotate(180deg" } });
|
|
2354
|
-
},
|
|
2355
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: a } = he(), [
|
|
2353
|
+
}, Pi = () => {
|
|
2354
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: a } = he(), [l, d] = $(t.toString()), { pageNavigationTool: c = !0 } = Pe(), { pageNavigationTool: m = !0 } = Se(), { isSmallScreen: f } = xe(), { viewMode: C } = He(), { scrollMode: p } = ze(), { localeMessages: _ } = pe();
|
|
2356
2355
|
D(() => {
|
|
2357
2356
|
d(t.toString());
|
|
2358
2357
|
}, [t]);
|
|
2359
2358
|
const P = E((u) => {
|
|
2360
|
-
const
|
|
2361
|
-
d(
|
|
2362
|
-
}, []),
|
|
2363
|
-
const u = a(
|
|
2359
|
+
const h = u.target.value;
|
|
2360
|
+
d(h);
|
|
2361
|
+
}, []), w = E(async () => {
|
|
2362
|
+
const u = a(l);
|
|
2364
2363
|
u.success || d(u.currentPage.toString());
|
|
2365
|
-
}, [a,
|
|
2364
|
+
}, [a, l, e]), v = E(() => {
|
|
2366
2365
|
d(t.toString());
|
|
2367
2366
|
}, [t]), I = E(
|
|
2368
2367
|
(u) => {
|
|
2369
|
-
u.key === "Enter" &&
|
|
2368
|
+
u.key === "Enter" && w();
|
|
2370
2369
|
},
|
|
2371
|
-
[
|
|
2372
|
-
), g =
|
|
2373
|
-
return !
|
|
2374
|
-
|
|
2370
|
+
[w]
|
|
2371
|
+
), g = k(() => C === Oe.DUAL_PAGE && p === ie.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, C, p]);
|
|
2372
|
+
return !c || !m ? null : typeof c != "boolean" ? /* @__PURE__ */ i(
|
|
2373
|
+
c,
|
|
2375
2374
|
{
|
|
2376
2375
|
total: e,
|
|
2377
2376
|
current: t,
|
|
@@ -2380,8 +2379,8 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2380
2379
|
goToPage: a,
|
|
2381
2380
|
changePage: n
|
|
2382
2381
|
}
|
|
2383
|
-
) : typeof
|
|
2384
|
-
|
|
2382
|
+
) : typeof m != "boolean" ? /* @__PURE__ */ i(
|
|
2383
|
+
m,
|
|
2385
2384
|
{
|
|
2386
2385
|
total: e,
|
|
2387
2386
|
current: t,
|
|
@@ -2391,22 +2390,22 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2391
2390
|
changePage: n
|
|
2392
2391
|
}
|
|
2393
2392
|
) : /* @__PURE__ */ W("div", { className: wt["rp-paginate"], children: [
|
|
2394
|
-
!
|
|
2393
|
+
!f && /* @__PURE__ */ i(K, { content: _ == null ? void 0 : _.previousPageTooltip, children: /* @__PURE__ */ i(
|
|
2395
2394
|
de,
|
|
2396
2395
|
{
|
|
2397
2396
|
onClick: o,
|
|
2398
|
-
"aria-label":
|
|
2397
|
+
"aria-label": _ == null ? void 0 : _.previousPageTooltip,
|
|
2399
2398
|
"aria-disabled": t === 1,
|
|
2400
|
-
children: /* @__PURE__ */ i(
|
|
2399
|
+
children: /* @__PURE__ */ i(Ti, {})
|
|
2401
2400
|
}
|
|
2402
2401
|
) }),
|
|
2403
|
-
/* @__PURE__ */ i(K, { content:
|
|
2404
|
-
|
|
2402
|
+
/* @__PURE__ */ i(K, { content: _ == null ? void 0 : _.currentPageTooltip, children: /* @__PURE__ */ i(
|
|
2403
|
+
hn,
|
|
2405
2404
|
{
|
|
2406
2405
|
onKeyDown: I,
|
|
2407
2406
|
onBlur: v,
|
|
2408
2407
|
onChange: P,
|
|
2409
|
-
value:
|
|
2408
|
+
value: l,
|
|
2410
2409
|
className: wt["rp-page-input"],
|
|
2411
2410
|
id: "page-input",
|
|
2412
2411
|
name: "page-input"
|
|
@@ -2416,52 +2415,52 @@ const _i = fn(({ widths: t, heights: e }) => {
|
|
|
2416
2415
|
"/",
|
|
2417
2416
|
e
|
|
2418
2417
|
] }),
|
|
2419
|
-
!
|
|
2418
|
+
!f && /* @__PURE__ */ i(K, { content: _ == null ? void 0 : _.nextPageTooltip, children: /* @__PURE__ */ i(
|
|
2420
2419
|
de,
|
|
2421
2420
|
{
|
|
2422
2421
|
onClick: r,
|
|
2423
|
-
"aria-label":
|
|
2422
|
+
"aria-label": _ == null ? void 0 : _.nextPageTooltip,
|
|
2424
2423
|
"aria-disabled": g,
|
|
2425
|
-
children: /* @__PURE__ */ i(
|
|
2424
|
+
children: /* @__PURE__ */ i(Ci, {})
|
|
2426
2425
|
}
|
|
2427
2426
|
) })
|
|
2428
2427
|
] });
|
|
2429
2428
|
};
|
|
2430
|
-
var at = "Dialog", [
|
|
2429
|
+
var at = "Dialog", [Dn, bc] = vr(at), [yi, me] = Dn(at), zn = (t) => {
|
|
2431
2430
|
const {
|
|
2432
2431
|
__scopeDialog: e,
|
|
2433
2432
|
children: n,
|
|
2434
2433
|
open: r,
|
|
2435
2434
|
defaultOpen: o,
|
|
2436
2435
|
onOpenChange: a,
|
|
2437
|
-
modal:
|
|
2438
|
-
} = t, d = X.useRef(null),
|
|
2436
|
+
modal: l = !0
|
|
2437
|
+
} = t, d = X.useRef(null), c = X.useRef(null), [m, f] = _r({
|
|
2439
2438
|
prop: r,
|
|
2440
2439
|
defaultProp: o ?? !1,
|
|
2441
2440
|
onChange: a,
|
|
2442
2441
|
caller: at
|
|
2443
2442
|
});
|
|
2444
2443
|
return /* @__PURE__ */ i(
|
|
2445
|
-
|
|
2444
|
+
yi,
|
|
2446
2445
|
{
|
|
2447
2446
|
scope: e,
|
|
2448
2447
|
triggerRef: d,
|
|
2449
|
-
contentRef:
|
|
2448
|
+
contentRef: c,
|
|
2450
2449
|
contentId: pt(),
|
|
2451
2450
|
titleId: pt(),
|
|
2452
2451
|
descriptionId: pt(),
|
|
2453
|
-
open:
|
|
2454
|
-
onOpenChange:
|
|
2455
|
-
onOpenToggle: X.useCallback(() =>
|
|
2456
|
-
modal:
|
|
2452
|
+
open: m,
|
|
2453
|
+
onOpenChange: f,
|
|
2454
|
+
onOpenToggle: X.useCallback(() => f((C) => !C), [f]),
|
|
2455
|
+
modal: l,
|
|
2457
2456
|
children: n
|
|
2458
2457
|
}
|
|
2459
2458
|
);
|
|
2460
2459
|
};
|
|
2461
|
-
|
|
2462
|
-
var
|
|
2460
|
+
zn.displayName = at;
|
|
2461
|
+
var An = "DialogTrigger", Ii = X.forwardRef(
|
|
2463
2462
|
(t, e) => {
|
|
2464
|
-
const { __scopeDialog: n, ...r } = t, o = me(
|
|
2463
|
+
const { __scopeDialog: n, ...r } = t, o = me(An, n), a = Lt(e, o.triggerRef);
|
|
2465
2464
|
return /* @__PURE__ */ i(
|
|
2466
2465
|
je.button,
|
|
2467
2466
|
{
|
|
@@ -2472,33 +2471,33 @@ var kn = "DialogTrigger", xi = X.forwardRef(
|
|
|
2472
2471
|
"data-state": At(o.open),
|
|
2473
2472
|
...r,
|
|
2474
2473
|
ref: a,
|
|
2475
|
-
onClick:
|
|
2474
|
+
onClick: Ge(t.onClick, o.onOpenToggle)
|
|
2476
2475
|
}
|
|
2477
2476
|
);
|
|
2478
2477
|
}
|
|
2479
2478
|
);
|
|
2480
|
-
|
|
2481
|
-
var Dt = "DialogPortal", [
|
|
2479
|
+
Ii.displayName = An;
|
|
2480
|
+
var Dt = "DialogPortal", [Si, Fn] = Dn(Dt, {
|
|
2482
2481
|
forceMount: void 0
|
|
2483
|
-
}),
|
|
2482
|
+
}), Mn = (t) => {
|
|
2484
2483
|
const { __scopeDialog: e, forceMount: n, children: r, container: o } = t, a = me(Dt, e);
|
|
2485
|
-
return /* @__PURE__ */ i(
|
|
2484
|
+
return /* @__PURE__ */ i(Si, { scope: e, forceMount: n, children: X.Children.map(r, (l) => /* @__PURE__ */ i(Et, { present: n || a.open, children: /* @__PURE__ */ i(Sr, { asChild: !0, container: o, children: l }) })) });
|
|
2486
2485
|
};
|
|
2487
|
-
|
|
2488
|
-
var et = "DialogOverlay",
|
|
2486
|
+
Mn.displayName = Dt;
|
|
2487
|
+
var et = "DialogOverlay", kn = X.forwardRef(
|
|
2489
2488
|
(t, e) => {
|
|
2490
|
-
const n =
|
|
2491
|
-
return a.modal ? /* @__PURE__ */ i(Et, { present: r || a.open, children: /* @__PURE__ */ i(
|
|
2489
|
+
const n = Fn(et, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, a = me(et, t.__scopeDialog);
|
|
2490
|
+
return a.modal ? /* @__PURE__ */ i(Et, { present: r || a.open, children: /* @__PURE__ */ i(Ri, { ...o, ref: e }) }) : null;
|
|
2492
2491
|
}
|
|
2493
2492
|
);
|
|
2494
|
-
|
|
2495
|
-
var
|
|
2493
|
+
kn.displayName = et;
|
|
2494
|
+
var xi = br("DialogOverlay.RemoveScroll"), Ri = X.forwardRef(
|
|
2496
2495
|
(t, e) => {
|
|
2497
2496
|
const { __scopeDialog: n, ...r } = t, o = me(et, n);
|
|
2498
2497
|
return (
|
|
2499
2498
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2500
2499
|
// ie. when `Overlay` and `Content` are siblings
|
|
2501
|
-
/* @__PURE__ */ i(
|
|
2500
|
+
/* @__PURE__ */ i(Cr, { as: xi, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ i(
|
|
2502
2501
|
je.div,
|
|
2503
2502
|
{
|
|
2504
2503
|
"data-state": At(o.open),
|
|
@@ -2509,71 +2508,71 @@ var Li = Cr("DialogOverlay.RemoveScroll"), Ei = X.forwardRef(
|
|
|
2509
2508
|
) })
|
|
2510
2509
|
);
|
|
2511
2510
|
}
|
|
2512
|
-
), De = "DialogContent",
|
|
2511
|
+
), De = "DialogContent", Wn = X.forwardRef(
|
|
2513
2512
|
(t, e) => {
|
|
2514
|
-
const n =
|
|
2515
|
-
return /* @__PURE__ */ i(Et, { present: r || a.open, children: a.modal ? /* @__PURE__ */ i(
|
|
2513
|
+
const n = Fn(De, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, a = me(De, t.__scopeDialog);
|
|
2514
|
+
return /* @__PURE__ */ i(Et, { present: r || a.open, children: a.modal ? /* @__PURE__ */ i(Li, { ...o, ref: e }) : /* @__PURE__ */ i(Ei, { ...o, ref: e }) });
|
|
2516
2515
|
}
|
|
2517
2516
|
);
|
|
2518
|
-
|
|
2519
|
-
var
|
|
2517
|
+
Wn.displayName = De;
|
|
2518
|
+
var Li = X.forwardRef(
|
|
2520
2519
|
(t, e) => {
|
|
2521
2520
|
const n = me(De, t.__scopeDialog), r = X.useRef(null), o = Lt(e, n.contentRef, r);
|
|
2522
2521
|
return X.useEffect(() => {
|
|
2523
2522
|
const a = r.current;
|
|
2524
2523
|
if (a)
|
|
2525
|
-
return
|
|
2524
|
+
return Pr(a);
|
|
2526
2525
|
}, []), /* @__PURE__ */ i(
|
|
2527
|
-
|
|
2526
|
+
Hn,
|
|
2528
2527
|
{
|
|
2529
2528
|
...t,
|
|
2530
2529
|
ref: o,
|
|
2531
2530
|
trapFocus: n.open,
|
|
2532
2531
|
disableOutsidePointerEvents: !0,
|
|
2533
|
-
onCloseAutoFocus:
|
|
2534
|
-
var
|
|
2535
|
-
a.preventDefault(), (
|
|
2532
|
+
onCloseAutoFocus: Ge(t.onCloseAutoFocus, (a) => {
|
|
2533
|
+
var l;
|
|
2534
|
+
a.preventDefault(), (l = n.triggerRef.current) == null || l.focus();
|
|
2536
2535
|
}),
|
|
2537
|
-
onPointerDownOutside:
|
|
2538
|
-
const
|
|
2539
|
-
(
|
|
2536
|
+
onPointerDownOutside: Ge(t.onPointerDownOutside, (a) => {
|
|
2537
|
+
const l = a.detail.originalEvent, d = l.button === 0 && l.ctrlKey === !0;
|
|
2538
|
+
(l.button === 2 || d) && a.preventDefault();
|
|
2540
2539
|
}),
|
|
2541
|
-
onFocusOutside:
|
|
2540
|
+
onFocusOutside: Ge(
|
|
2542
2541
|
t.onFocusOutside,
|
|
2543
2542
|
(a) => a.preventDefault()
|
|
2544
2543
|
)
|
|
2545
2544
|
}
|
|
2546
2545
|
);
|
|
2547
2546
|
}
|
|
2548
|
-
),
|
|
2547
|
+
), Ei = X.forwardRef(
|
|
2549
2548
|
(t, e) => {
|
|
2550
2549
|
const n = me(De, t.__scopeDialog), r = X.useRef(!1), o = X.useRef(!1);
|
|
2551
2550
|
return /* @__PURE__ */ i(
|
|
2552
|
-
|
|
2551
|
+
Hn,
|
|
2553
2552
|
{
|
|
2554
2553
|
...t,
|
|
2555
2554
|
ref: e,
|
|
2556
2555
|
trapFocus: !1,
|
|
2557
2556
|
disableOutsidePointerEvents: !1,
|
|
2558
2557
|
onCloseAutoFocus: (a) => {
|
|
2559
|
-
var
|
|
2560
|
-
(
|
|
2558
|
+
var l, d;
|
|
2559
|
+
(l = t.onCloseAutoFocus) == null || l.call(t, a), a.defaultPrevented || (r.current || (d = n.triggerRef.current) == null || d.focus(), a.preventDefault()), r.current = !1, o.current = !1;
|
|
2561
2560
|
},
|
|
2562
2561
|
onInteractOutside: (a) => {
|
|
2563
|
-
var
|
|
2564
|
-
(
|
|
2565
|
-
const
|
|
2566
|
-
((
|
|
2562
|
+
var c, m;
|
|
2563
|
+
(c = t.onInteractOutside) == null || c.call(t, a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
2564
|
+
const l = a.target;
|
|
2565
|
+
((m = n.triggerRef.current) == null ? void 0 : m.contains(l)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && o.current && a.preventDefault();
|
|
2567
2566
|
}
|
|
2568
2567
|
}
|
|
2569
2568
|
);
|
|
2570
2569
|
}
|
|
2571
|
-
),
|
|
2570
|
+
), Hn = X.forwardRef(
|
|
2572
2571
|
(t, e) => {
|
|
2573
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...
|
|
2574
|
-
return
|
|
2572
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...l } = t, d = me(De, n), c = X.useRef(null), m = Lt(e, c);
|
|
2573
|
+
return yr(), /* @__PURE__ */ W(fe, { children: [
|
|
2575
2574
|
/* @__PURE__ */ i(
|
|
2576
|
-
|
|
2575
|
+
Ir,
|
|
2577
2576
|
{
|
|
2578
2577
|
asChild: !0,
|
|
2579
2578
|
loop: !0,
|
|
@@ -2581,64 +2580,64 @@ var Ni = X.forwardRef(
|
|
|
2581
2580
|
onMountAutoFocus: o,
|
|
2582
2581
|
onUnmountAutoFocus: a,
|
|
2583
2582
|
children: /* @__PURE__ */ i(
|
|
2584
|
-
|
|
2583
|
+
Tr,
|
|
2585
2584
|
{
|
|
2586
2585
|
role: "dialog",
|
|
2587
2586
|
id: d.contentId,
|
|
2588
2587
|
"aria-describedby": d.descriptionId,
|
|
2589
2588
|
"aria-labelledby": d.titleId,
|
|
2590
2589
|
"data-state": At(d.open),
|
|
2591
|
-
...
|
|
2592
|
-
ref:
|
|
2590
|
+
...l,
|
|
2591
|
+
ref: m,
|
|
2593
2592
|
onDismiss: () => d.onOpenChange(!1)
|
|
2594
2593
|
}
|
|
2595
2594
|
)
|
|
2596
2595
|
}
|
|
2597
2596
|
),
|
|
2598
2597
|
/* @__PURE__ */ W(fe, { children: [
|
|
2599
|
-
/* @__PURE__ */ i(
|
|
2600
|
-
/* @__PURE__ */ i(
|
|
2598
|
+
/* @__PURE__ */ i(Oi, { titleId: d.titleId }),
|
|
2599
|
+
/* @__PURE__ */ i(zi, { contentRef: c, descriptionId: d.descriptionId })
|
|
2601
2600
|
] })
|
|
2602
2601
|
] });
|
|
2603
2602
|
}
|
|
2604
|
-
), zt = "DialogTitle",
|
|
2603
|
+
), zt = "DialogTitle", $n = X.forwardRef(
|
|
2605
2604
|
(t, e) => {
|
|
2606
2605
|
const { __scopeDialog: n, ...r } = t, o = me(zt, n);
|
|
2607
2606
|
return /* @__PURE__ */ i(je.h2, { id: o.titleId, ...r, ref: e });
|
|
2608
2607
|
}
|
|
2609
2608
|
);
|
|
2610
|
-
|
|
2611
|
-
var
|
|
2609
|
+
$n.displayName = zt;
|
|
2610
|
+
var qn = "DialogDescription", Ni = X.forwardRef(
|
|
2612
2611
|
(t, e) => {
|
|
2613
|
-
const { __scopeDialog: n, ...r } = t, o = me(
|
|
2612
|
+
const { __scopeDialog: n, ...r } = t, o = me(qn, n);
|
|
2614
2613
|
return /* @__PURE__ */ i(je.p, { id: o.descriptionId, ...r, ref: e });
|
|
2615
2614
|
}
|
|
2616
2615
|
);
|
|
2617
|
-
|
|
2618
|
-
var
|
|
2616
|
+
Ni.displayName = qn;
|
|
2617
|
+
var Gn = "DialogClose", Un = X.forwardRef(
|
|
2619
2618
|
(t, e) => {
|
|
2620
|
-
const { __scopeDialog: n, ...r } = t, o = me(
|
|
2619
|
+
const { __scopeDialog: n, ...r } = t, o = me(Gn, n);
|
|
2621
2620
|
return /* @__PURE__ */ i(
|
|
2622
2621
|
je.button,
|
|
2623
2622
|
{
|
|
2624
2623
|
type: "button",
|
|
2625
2624
|
...r,
|
|
2626
2625
|
ref: e,
|
|
2627
|
-
onClick:
|
|
2626
|
+
onClick: Ge(t.onClick, () => o.onOpenChange(!1))
|
|
2628
2627
|
}
|
|
2629
2628
|
);
|
|
2630
2629
|
}
|
|
2631
2630
|
);
|
|
2632
|
-
|
|
2631
|
+
Un.displayName = Gn;
|
|
2633
2632
|
function At(t) {
|
|
2634
2633
|
return t ? "open" : "closed";
|
|
2635
2634
|
}
|
|
2636
|
-
var
|
|
2635
|
+
var Vn = "DialogTitleWarning", [Tc, Bn] = wr(Vn, {
|
|
2637
2636
|
contentName: De,
|
|
2638
2637
|
titleName: zt,
|
|
2639
2638
|
docsSlug: "dialog"
|
|
2640
|
-
}),
|
|
2641
|
-
const e =
|
|
2639
|
+
}), Oi = ({ titleId: t }) => {
|
|
2640
|
+
const e = Bn(Vn), n = `\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
2642
2641
|
|
|
2643
2642
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2644
2643
|
|
|
@@ -2646,14 +2645,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
2646
2645
|
return X.useEffect(() => {
|
|
2647
2646
|
t && (document.getElementById(t) || console.error(n));
|
|
2648
2647
|
}, [n, t]), null;
|
|
2649
|
-
},
|
|
2650
|
-
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
2648
|
+
}, Di = "DialogDescriptionWarning", zi = ({ contentRef: t, descriptionId: e }) => {
|
|
2649
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bn(Di).contentName}}.`;
|
|
2651
2650
|
return X.useEffect(() => {
|
|
2652
2651
|
var a;
|
|
2653
2652
|
const o = (a = t.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
2654
2653
|
e && o && (document.getElementById(e) || console.warn(r));
|
|
2655
2654
|
}, [r, t, e]), null;
|
|
2656
|
-
},
|
|
2655
|
+
}, Ai = zn, Fi = Mn, Mi = kn, ki = Wn, Wi = $n, Hi = Un;
|
|
2657
2656
|
const Ne = {
|
|
2658
2657
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2659
2658
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2662,90 +2661,90 @@ const Ne = {
|
|
|
2662
2661
|
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
2663
2662
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2664
2663
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2665
|
-
},
|
|
2666
|
-
const { pdfProperties: t } =
|
|
2664
|
+
}, $i = () => {
|
|
2665
|
+
const { pdfProperties: t } = re(), { container: e } = Ce(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = No(), { localeMessages: o } = pe(), a = k(() => {
|
|
2667
2666
|
if (!t)
|
|
2668
2667
|
return [];
|
|
2669
2668
|
const {
|
|
2670
|
-
fileSize:
|
|
2669
|
+
fileSize: l,
|
|
2671
2670
|
filename: d,
|
|
2672
|
-
title:
|
|
2673
|
-
author:
|
|
2674
|
-
subject:
|
|
2671
|
+
title: c,
|
|
2672
|
+
author: m,
|
|
2673
|
+
subject: f,
|
|
2675
2674
|
createdOn: C,
|
|
2676
|
-
creator:
|
|
2677
|
-
keywords:
|
|
2675
|
+
creator: p,
|
|
2676
|
+
keywords: _,
|
|
2678
2677
|
modifiedOn: P,
|
|
2679
|
-
pdfProducer:
|
|
2678
|
+
pdfProducer: w,
|
|
2680
2679
|
pdfVersion: v,
|
|
2681
2680
|
pageCount: I
|
|
2682
2681
|
} = t;
|
|
2683
2682
|
return [
|
|
2684
2683
|
{ label: o == null ? void 0 : o.propertiesFilenameLabel, value: d },
|
|
2685
|
-
{ label: o == null ? void 0 : o.propertiesFileSizeLabel, value:
|
|
2684
|
+
{ label: o == null ? void 0 : o.propertiesFileSizeLabel, value: l },
|
|
2686
2685
|
{ separate: !0 },
|
|
2687
|
-
{ label: o == null ? void 0 : o.propertiesTitleLabel, value:
|
|
2688
|
-
{ label: o == null ? void 0 : o.propertiesAuthorLabel, value:
|
|
2689
|
-
{ label: o == null ? void 0 : o.propertiesSubjectLabel, value:
|
|
2690
|
-
{ label: o == null ? void 0 : o.propertiesKeywordLabel, value:
|
|
2691
|
-
{ label: o == null ? void 0 : o.propertiesCreatorLabel, value:
|
|
2686
|
+
{ label: o == null ? void 0 : o.propertiesTitleLabel, value: c },
|
|
2687
|
+
{ label: o == null ? void 0 : o.propertiesAuthorLabel, value: m },
|
|
2688
|
+
{ label: o == null ? void 0 : o.propertiesSubjectLabel, value: f },
|
|
2689
|
+
{ label: o == null ? void 0 : o.propertiesKeywordLabel, value: _ },
|
|
2690
|
+
{ label: o == null ? void 0 : o.propertiesCreatorLabel, value: p },
|
|
2692
2691
|
{
|
|
2693
2692
|
label: o == null ? void 0 : o.propertiesCreateOnLabel,
|
|
2694
|
-
value: C ?
|
|
2693
|
+
value: C ? $t(C) : ""
|
|
2695
2694
|
},
|
|
2696
2695
|
{
|
|
2697
2696
|
label: o == null ? void 0 : o.propertiesModifiedOnLabel,
|
|
2698
|
-
value: P ?
|
|
2697
|
+
value: P ? $t(P) : ""
|
|
2699
2698
|
},
|
|
2700
2699
|
{ separate: !0 },
|
|
2701
|
-
{ label: o == null ? void 0 : o.propertiesPDFProducerLabel, value:
|
|
2700
|
+
{ label: o == null ? void 0 : o.propertiesPDFProducerLabel, value: w },
|
|
2702
2701
|
{ label: o == null ? void 0 : o.propertiesPDFVersionLabel, value: v },
|
|
2703
2702
|
{ label: o == null ? void 0 : o.propertiesPageCountLabel, value: I }
|
|
2704
2703
|
];
|
|
2705
2704
|
}, [t, o]);
|
|
2706
|
-
return /* @__PURE__ */ i(
|
|
2707
|
-
/* @__PURE__ */ i(
|
|
2708
|
-
/* @__PURE__ */ W(
|
|
2709
|
-
/* @__PURE__ */ i(
|
|
2710
|
-
/* @__PURE__ */ i("div", { className: Ne["rp-document-properties"], children: a.map((
|
|
2711
|
-
/* @__PURE__ */ i(
|
|
2705
|
+
return /* @__PURE__ */ i(Ai, { open: n, onOpenChange: r, children: /* @__PURE__ */ i(Fi, { container: e, children: /* @__PURE__ */ W("div", { className: Ne["rp-dialog-wrapper"], children: [
|
|
2706
|
+
/* @__PURE__ */ i(Mi, { className: Ne["rp-dialog-overlay"] }),
|
|
2707
|
+
/* @__PURE__ */ W(ki, { className: Ne["rp-document-dialog"], children: [
|
|
2708
|
+
/* @__PURE__ */ i(Wi, { className: Ne["rp-dialog-title"], children: o == null ? void 0 : o.documentPropertiesLabel }),
|
|
2709
|
+
/* @__PURE__ */ i("div", { className: Ne["rp-document-properties"], children: a.map((l, d) => /* @__PURE__ */ i("div", { children: l.separate ? /* @__PURE__ */ i("div", { className: Ne["rp-properties-divider"] }) : /* @__PURE__ */ i(Go, { label: l.label, value: l.value }) }, d)) }),
|
|
2710
|
+
/* @__PURE__ */ i(Hi, { asChild: !0, className: Ne["rp-dialog-close"], children: /* @__PURE__ */ i(xr, {}) })
|
|
2712
2711
|
] })
|
|
2713
2712
|
] }) }) });
|
|
2714
|
-
},
|
|
2713
|
+
}, qi = {
|
|
2715
2714
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
2716
|
-
},
|
|
2715
|
+
}, sn = ".pdf", Gi = (t) => URL.createObjectURL(t), Ui = async (t) => {
|
|
2717
2716
|
const n = await (await fetch(t)).blob();
|
|
2718
|
-
return
|
|
2719
|
-
},
|
|
2720
|
-
const { filename: t, pdfSrc: e } =
|
|
2721
|
-
const
|
|
2722
|
-
return
|
|
2717
|
+
return Gi(n);
|
|
2718
|
+
}, Zn = () => {
|
|
2719
|
+
const { filename: t, pdfSrc: e } = re(), { downloadFilename: n } = xo(), r = (a) => {
|
|
2720
|
+
const l = n || a;
|
|
2721
|
+
return l.endsWith(sn) ? l : `${l}${sn}`;
|
|
2723
2722
|
};
|
|
2724
2723
|
return { download: E(async () => {
|
|
2725
2724
|
if (!t || !e)
|
|
2726
2725
|
throw new Error("There is no PDF source to download");
|
|
2727
2726
|
const a = document.createElement("a");
|
|
2728
|
-
a.href = await
|
|
2727
|
+
a.href = await Ui(e), a.download = r(t), document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
2729
2728
|
}, [t, e]) };
|
|
2730
|
-
},
|
|
2729
|
+
}, jn = () => {
|
|
2731
2730
|
const { downloadIcon: t } = ve(), { downloadIcon: e } = ge();
|
|
2732
|
-
return t || e || /* @__PURE__ */ i(
|
|
2733
|
-
},
|
|
2734
|
-
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(
|
|
2731
|
+
return t || e || /* @__PURE__ */ i(Or, {});
|
|
2732
|
+
}, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Vi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(Kn, { localeMessages: e, children: /* @__PURE__ */ i(de, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ i(jn, {}) }) }), Bi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ i(Ie, { onClick: t, children: /* @__PURE__ */ W(Kn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2733
|
+
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(jn, {}) }),
|
|
2735
2734
|
e == null ? void 0 : e.downloadFileLabel
|
|
2736
|
-
] }) }),
|
|
2737
|
-
const { download: t } =
|
|
2738
|
-
return !e || !n ? null : r ? /* @__PURE__ */ i(
|
|
2739
|
-
},
|
|
2735
|
+
] }) }), Xn = () => {
|
|
2736
|
+
const { download: t } = Zn(), { downloadTool: e = !0 } = Pe(), { downloadTool: n = !0 } = Se(), { isSmallScreen: r } = xe(), { localeMessages: o } = pe(), a = o == null ? void 0 : o.downloadFileTooltip;
|
|
2737
|
+
return !e || !n ? null : r ? /* @__PURE__ */ i(Bi, { download: t, localeMessages: o }) : typeof e == "function" ? /* @__PURE__ */ i(K, { content: a, children: /* @__PURE__ */ i(e, { download: t }) }) : typeof n == "function" ? /* @__PURE__ */ i(K, { content: a, children: /* @__PURE__ */ i(n, { download: t }) }) : /* @__PURE__ */ i(Vi, { download: t, localeMessages: o });
|
|
2738
|
+
}, Qn = () => {
|
|
2740
2739
|
const { printIcon: t } = ve(), { printIcon: e } = ge();
|
|
2741
|
-
return t || e || /* @__PURE__ */ i(
|
|
2742
|
-
},
|
|
2743
|
-
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(
|
|
2740
|
+
return t || e || /* @__PURE__ */ i(Dr, {});
|
|
2741
|
+
}, Yn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ i(K, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Zi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(Yn, { localeMessages: e, children: /* @__PURE__ */ i(de, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ i(Qn, {}) }) }), ji = ({ print: t, localeMessages: e }) => /* @__PURE__ */ i(Ie, { onClick: t, children: /* @__PURE__ */ W(Yn, { className: "rp-menu-item", localeMessages: e, children: [
|
|
2742
|
+
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Qn, {}) }),
|
|
2744
2743
|
e == null ? void 0 : e.printLabel
|
|
2745
|
-
] }) }),
|
|
2746
|
-
const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: a } = it(), { printTool:
|
|
2747
|
-
return !
|
|
2748
|
-
|
|
2744
|
+
] }) }), Jn = () => {
|
|
2745
|
+
const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: a } = it(), { printTool: l = !0 } = Pe(), { printTool: d = !0 } = Se(), { isSmallScreen: c } = xe(), { localeMessages: m } = pe(), f = m == null ? void 0 : m.printTooltip;
|
|
2746
|
+
return !l || !d ? null : c ? /* @__PURE__ */ i(ji, { print: t, localeMessages: m }) : typeof l == "function" ? /* @__PURE__ */ i(K, { content: f, children: /* @__PURE__ */ i(
|
|
2747
|
+
l,
|
|
2749
2748
|
{
|
|
2750
2749
|
print: t,
|
|
2751
2750
|
cancel: e,
|
|
@@ -2754,7 +2753,7 @@ const Ne = {
|
|
|
2754
2753
|
setOnComplete: r,
|
|
2755
2754
|
progress: a
|
|
2756
2755
|
}
|
|
2757
|
-
) }) : typeof d == "function" ? /* @__PURE__ */ i(K, { content:
|
|
2756
|
+
) }) : typeof d == "function" ? /* @__PURE__ */ i(K, { content: f, children: /* @__PURE__ */ i(
|
|
2758
2757
|
d,
|
|
2759
2758
|
{
|
|
2760
2759
|
print: t,
|
|
@@ -2764,142 +2763,142 @@ const Ne = {
|
|
|
2764
2763
|
setOnComplete: r,
|
|
2765
2764
|
progress: a
|
|
2766
2765
|
}
|
|
2767
|
-
) }) : /* @__PURE__ */ i(
|
|
2768
|
-
},
|
|
2766
|
+
) }) : /* @__PURE__ */ i(Zi, { print: t, localeMessages: m });
|
|
2767
|
+
}, Ki = {
|
|
2769
2768
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2770
|
-
},
|
|
2769
|
+
}, Xi = () => {
|
|
2771
2770
|
const { goToFirstPageIcon: t } = ve(), { goToFirstPageIcon: e } = ge();
|
|
2772
|
-
return t || e || /* @__PURE__ */ i(
|
|
2773
|
-
},
|
|
2771
|
+
return t || e || /* @__PURE__ */ i(_n, { className: Ki["rp-go-to-Top"] });
|
|
2772
|
+
}, Qi = () => {
|
|
2774
2773
|
const { goToLastPageIcon: t } = ve(), { goToLastPageIcon: e } = ge();
|
|
2775
|
-
return t || e || /* @__PURE__ */ i(
|
|
2776
|
-
},
|
|
2777
|
-
const { goToPage: t, totalPages: e, focusedPage: n } = he(), { jumpNavigationTool: r = !0 } = Pe(), { jumpNavigationTool: o = !0 } = Se(), { localeMessages: a } = pe(),
|
|
2774
|
+
return t || e || /* @__PURE__ */ i(_n, {});
|
|
2775
|
+
}, cn = { width: "100%" }, Yi = () => {
|
|
2776
|
+
const { goToPage: t, totalPages: e, focusedPage: n } = he(), { jumpNavigationTool: r = !0 } = Pe(), { jumpNavigationTool: o = !0 } = Se(), { localeMessages: a } = pe(), l = k(() => n === 1, [n]), d = k(() => n === e, [n, e]), c = E(() => {
|
|
2778
2777
|
t(1);
|
|
2779
|
-
}, [t]),
|
|
2778
|
+
}, [t]), m = E(() => {
|
|
2780
2779
|
t(e);
|
|
2781
2780
|
}, [t, e]);
|
|
2782
2781
|
return !r || !o ? null : /* @__PURE__ */ W(Je, { children: [
|
|
2783
|
-
/* @__PURE__ */ i(Ie, { onClick:
|
|
2784
|
-
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(
|
|
2782
|
+
/* @__PURE__ */ i(Ie, { onClick: c, children: /* @__PURE__ */ i(K, { content: a == null ? void 0 : a.firstPageTooltip, style: cn, children: /* @__PURE__ */ W("div", { className: "rp-menu-item", "aria-disabled": l, children: [
|
|
2783
|
+
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Xi, {}) }),
|
|
2785
2784
|
/* @__PURE__ */ i("span", { children: a == null ? void 0 : a.firstPageLabel })
|
|
2786
2785
|
] }) }) }),
|
|
2787
|
-
/* @__PURE__ */ i(Ie, { onClick:
|
|
2788
|
-
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(
|
|
2786
|
+
/* @__PURE__ */ i(Ie, { onClick: m, children: /* @__PURE__ */ i(K, { content: a == null ? void 0 : a.lastPageTooltip, style: cn, children: /* @__PURE__ */ W("div", { className: "rp-menu-item", "aria-disabled": d, children: [
|
|
2787
|
+
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Qi, {}) }),
|
|
2789
2788
|
/* @__PURE__ */ i("span", { children: a == null ? void 0 : a.lastPageLabel })
|
|
2790
2789
|
] }) }) }),
|
|
2791
2790
|
/* @__PURE__ */ i(St, {})
|
|
2792
2791
|
] });
|
|
2793
|
-
},
|
|
2792
|
+
}, Ji = () => {
|
|
2794
2793
|
const [t, e] = $(!1), { container: n, pagesRef: r } = Ce(), { isSmallScreen: o } = xe(), {
|
|
2795
2794
|
openFileTool: a,
|
|
2796
|
-
downloadTool:
|
|
2795
|
+
downloadTool: l,
|
|
2797
2796
|
documentProperties: d,
|
|
2798
|
-
scrollModeTool:
|
|
2799
|
-
rotateTool:
|
|
2800
|
-
selectionModeTool:
|
|
2797
|
+
scrollModeTool: c,
|
|
2798
|
+
rotateTool: m,
|
|
2799
|
+
selectionModeTool: f,
|
|
2801
2800
|
jumpNavigationTool: C,
|
|
2802
|
-
printTool:
|
|
2803
|
-
fullscreenTool:
|
|
2801
|
+
printTool: p,
|
|
2802
|
+
fullscreenTool: _,
|
|
2804
2803
|
viewModeTool: P
|
|
2805
2804
|
} = Pe(), {
|
|
2806
|
-
openFileTool:
|
|
2805
|
+
openFileTool: w,
|
|
2807
2806
|
downloadTool: v,
|
|
2808
2807
|
documentProperties: I,
|
|
2809
2808
|
scrollModeTool: g,
|
|
2810
2809
|
rotateTool: u,
|
|
2811
|
-
selectionModeTool:
|
|
2810
|
+
selectionModeTool: h,
|
|
2812
2811
|
jumpNavigationTool: s,
|
|
2813
|
-
printTool:
|
|
2814
|
-
fullscreenTool:
|
|
2812
|
+
printTool: b,
|
|
2813
|
+
fullscreenTool: T,
|
|
2815
2814
|
viewModeTool: y
|
|
2816
2815
|
} = Se(), { localeMessages: x } = pe(), [S, R] = $(0), L = H(
|
|
2817
2816
|
new ResizeObserver((A) => {
|
|
2818
2817
|
R(A[0].contentRect.height);
|
|
2819
2818
|
})
|
|
2820
|
-
), N =
|
|
2819
|
+
), N = k(() => C || m || f || c || d || P || o && (a || l || p || _), [
|
|
2821
2820
|
a,
|
|
2822
|
-
c,
|
|
2823
|
-
h,
|
|
2824
|
-
w,
|
|
2825
|
-
d,
|
|
2826
2821
|
l,
|
|
2827
|
-
|
|
2822
|
+
p,
|
|
2823
|
+
_,
|
|
2824
|
+
d,
|
|
2825
|
+
c,
|
|
2828
2826
|
m,
|
|
2827
|
+
f,
|
|
2829
2828
|
C,
|
|
2830
2829
|
o
|
|
2831
|
-
]),
|
|
2832
|
-
|
|
2830
|
+
]), M = k(() => s || u || h || g || I || y || o && (w || v || b || T), [
|
|
2831
|
+
w,
|
|
2833
2832
|
v,
|
|
2834
|
-
_,
|
|
2835
2833
|
b,
|
|
2834
|
+
T,
|
|
2836
2835
|
I,
|
|
2837
2836
|
g,
|
|
2838
2837
|
u,
|
|
2839
|
-
|
|
2838
|
+
h,
|
|
2840
2839
|
s,
|
|
2841
2840
|
o
|
|
2842
2841
|
]);
|
|
2843
2842
|
return D(() => (r && L.current.observe(r), () => {
|
|
2844
2843
|
L.current.disconnect();
|
|
2845
|
-
}), [r]), !N || !
|
|
2844
|
+
}), [r]), !N || !M ? null : /* @__PURE__ */ W(fe, { children: [
|
|
2846
2845
|
/* @__PURE__ */ i(
|
|
2847
2846
|
It,
|
|
2848
2847
|
{
|
|
2849
2848
|
container: n,
|
|
2850
2849
|
onOpenChange: e,
|
|
2851
|
-
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ i(de, { active: t, "aria-label": x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ i(
|
|
2850
|
+
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ i(de, { active: t, "aria-label": x == null ? void 0 : x.moreOptionTooltip, children: /* @__PURE__ */ i(gr, {}) }) }) }),
|
|
2852
2851
|
side: "bottom",
|
|
2853
2852
|
avoidCollisions: !1,
|
|
2854
2853
|
children: /* @__PURE__ */ W(
|
|
2855
2854
|
"div",
|
|
2856
2855
|
{
|
|
2857
2856
|
style: { maxHeight: `${S}px`, overflow: "auto" },
|
|
2858
|
-
className:
|
|
2857
|
+
className: qi["rp-other-tool-content"],
|
|
2859
2858
|
"data-rp": "moreOptionsDropdown",
|
|
2860
2859
|
children: [
|
|
2861
2860
|
o && /* @__PURE__ */ W(Je, { children: [
|
|
2862
|
-
/* @__PURE__ */ i(
|
|
2863
|
-
/* @__PURE__ */ i(
|
|
2864
|
-
/* @__PURE__ */ i(
|
|
2865
|
-
/* @__PURE__ */ i(
|
|
2861
|
+
/* @__PURE__ */ i(vn, {}),
|
|
2862
|
+
/* @__PURE__ */ i(Xn, {}),
|
|
2863
|
+
/* @__PURE__ */ i(Jn, {}),
|
|
2864
|
+
/* @__PURE__ */ i(wn, {}),
|
|
2866
2865
|
/* @__PURE__ */ i(St, {})
|
|
2867
2866
|
] }),
|
|
2868
|
-
/* @__PURE__ */ i(
|
|
2867
|
+
/* @__PURE__ */ i(Yi, {}),
|
|
2868
|
+
/* @__PURE__ */ i(Lr, {}),
|
|
2869
|
+
/* @__PURE__ */ i(zr, {}),
|
|
2870
|
+
/* @__PURE__ */ i(Er, {}),
|
|
2869
2871
|
/* @__PURE__ */ i(Nr, {}),
|
|
2870
|
-
/* @__PURE__ */ i(
|
|
2871
|
-
/* @__PURE__ */ i(Or, {}),
|
|
2872
|
-
/* @__PURE__ */ i(Dr, {}),
|
|
2873
|
-
/* @__PURE__ */ i(Er, {})
|
|
2872
|
+
/* @__PURE__ */ i(Rr, {})
|
|
2874
2873
|
]
|
|
2875
2874
|
}
|
|
2876
2875
|
)
|
|
2877
2876
|
}
|
|
2878
2877
|
),
|
|
2879
|
-
/* @__PURE__ */ i(
|
|
2878
|
+
/* @__PURE__ */ i($i, {})
|
|
2880
2879
|
] });
|
|
2881
|
-
},
|
|
2880
|
+
}, ea = () => {
|
|
2882
2881
|
const { isSmallScreen: t } = xe();
|
|
2883
2882
|
return /* @__PURE__ */ W(fe, { children: [
|
|
2884
|
-
/* @__PURE__ */ i(
|
|
2883
|
+
/* @__PURE__ */ i(mr, {}),
|
|
2885
2884
|
!t && /* @__PURE__ */ W(fe, { children: [
|
|
2886
|
-
/* @__PURE__ */ i(
|
|
2887
|
-
/* @__PURE__ */ i(
|
|
2888
|
-
/* @__PURE__ */ i(
|
|
2889
|
-
/* @__PURE__ */ i(
|
|
2885
|
+
/* @__PURE__ */ i(vn, {}),
|
|
2886
|
+
/* @__PURE__ */ i(Xn, {}),
|
|
2887
|
+
/* @__PURE__ */ i(Jn, {}),
|
|
2888
|
+
/* @__PURE__ */ i(wn, {})
|
|
2890
2889
|
] }),
|
|
2891
|
-
/* @__PURE__ */ i(
|
|
2890
|
+
/* @__PURE__ */ i(Ji, {})
|
|
2892
2891
|
] });
|
|
2893
|
-
},
|
|
2892
|
+
}, ta = "_active_1yldl_11", Fe = {
|
|
2894
2893
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_1yldl_1",
|
|
2895
2894
|
"rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_1yldl_6",
|
|
2896
|
-
active:
|
|
2895
|
+
active: ta,
|
|
2897
2896
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_1yldl_15",
|
|
2898
2897
|
"rp-zoom-level-icon": "_rp-zoom-level-icon_1yldl_20",
|
|
2899
2898
|
"rp-current-zoom-text": "_rp-current-zoom-text_1yldl_24",
|
|
2900
2899
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_1yldl_28"
|
|
2901
|
-
},
|
|
2902
|
-
const { localeMessages: n } = pe(), r =
|
|
2900
|
+
}, na = ({ zoomLevel: t, className: e }) => {
|
|
2901
|
+
const { localeMessages: n } = pe(), r = k(() => {
|
|
2903
2902
|
switch (t) {
|
|
2904
2903
|
case We.ACTUAL:
|
|
2905
2904
|
return n == null ? void 0 : n.zoomActualSize;
|
|
@@ -2910,42 +2909,42 @@ const Ne = {
|
|
|
2910
2909
|
}
|
|
2911
2910
|
return t.toString();
|
|
2912
2911
|
}, [t, n]);
|
|
2913
|
-
return /* @__PURE__ */ i(fe, { children: typeof t == "number" ? /* @__PURE__ */ W(
|
|
2912
|
+
return /* @__PURE__ */ i(fe, { children: typeof t == "number" ? /* @__PURE__ */ W(uo, { children: [
|
|
2914
2913
|
/* @__PURE__ */ i("span", { className: e, children: t }),
|
|
2915
2914
|
/* @__PURE__ */ i("span", { className: e, children: "%" })
|
|
2916
2915
|
] }) : /* @__PURE__ */ i("span", { className: e, children: r }) });
|
|
2917
|
-
},
|
|
2916
|
+
}, oa = [50, 75, 100, 125, 150, 200, 300, 400], ra = () => {
|
|
2918
2917
|
const { zoomInIcon: t } = ve(), { zoomInIcon: e } = ge();
|
|
2919
|
-
return t || e || /* @__PURE__ */ i(
|
|
2920
|
-
},
|
|
2918
|
+
return t || e || /* @__PURE__ */ i(Ar, {});
|
|
2919
|
+
}, ia = () => {
|
|
2921
2920
|
const { zoomOutIcon: t } = ve(), { zoomOutIcon: e } = ge();
|
|
2922
|
-
return t || e || /* @__PURE__ */ i(
|
|
2923
|
-
},
|
|
2924
|
-
const { zoomLevel: t, setZoomLevel: e, currentZoom: n } = tt(), { container: r, pagesRef: o } = Ce(), { zoomTool: a = !0 } = Pe(), { zoomTool:
|
|
2921
|
+
return t || e || /* @__PURE__ */ i(Fr, {});
|
|
2922
|
+
}, aa = () => {
|
|
2923
|
+
const { zoomLevel: t, setZoomLevel: e, currentZoom: n } = tt(), { container: r, pagesRef: o } = Ce(), { zoomTool: a = !0 } = Pe(), { zoomTool: l = !0 } = Se(), { isSmallScreen: d } = xe(), { localeMessages: c } = pe(), [m, f] = $(0), [C, p] = $(!1), _ = H(
|
|
2925
2924
|
new ResizeObserver((g) => {
|
|
2926
|
-
|
|
2925
|
+
f(g[0].contentRect.height);
|
|
2927
2926
|
})
|
|
2928
2927
|
), P = E(() => {
|
|
2929
2928
|
e(() => {
|
|
2930
2929
|
const g = Math.floor(n * 100 / 25) * 25;
|
|
2931
2930
|
return Math.min(g + 25, qt);
|
|
2932
2931
|
});
|
|
2933
|
-
}, [e, n]),
|
|
2932
|
+
}, [e, n]), w = E(() => {
|
|
2934
2933
|
e(() => {
|
|
2935
2934
|
const g = Math.ceil(n * 100 / 25) * 25;
|
|
2936
2935
|
return Math.min(g - 25, qt);
|
|
2937
2936
|
});
|
|
2938
|
-
}, [e, n]), v =
|
|
2939
|
-
return D(() => (o &&
|
|
2940
|
-
|
|
2941
|
-
}), [o]), !a || !
|
|
2942
|
-
/* @__PURE__ */ i(K, { content:
|
|
2937
|
+
}, [e, n]), v = k(() => Mr(n), [n]), I = k(() => kr(n), [n]);
|
|
2938
|
+
return D(() => (o && _.current.observe(o), () => {
|
|
2939
|
+
_.current.disconnect();
|
|
2940
|
+
}), [o]), !a || !l ? null : typeof a == "function" ? /* @__PURE__ */ i(a, { zoomLevel: t, setZoomLevel: e }) : typeof l == "function" ? /* @__PURE__ */ i(l, { zoomLevel: t, setZoomLevel: e }) : /* @__PURE__ */ W("div", { className: Fe["rp-zoom-wrapper"], children: [
|
|
2941
|
+
/* @__PURE__ */ i(K, { content: c == null ? void 0 : c.zoomOutTooltip, children: /* @__PURE__ */ i(
|
|
2943
2942
|
de,
|
|
2944
2943
|
{
|
|
2945
2944
|
disabled: v,
|
|
2946
|
-
onClick:
|
|
2947
|
-
"aria-label":
|
|
2948
|
-
children: /* @__PURE__ */ i(
|
|
2945
|
+
onClick: w,
|
|
2946
|
+
"aria-label": c == null ? void 0 : c.zoomOutTooltip,
|
|
2947
|
+
children: /* @__PURE__ */ i(ia, {})
|
|
2949
2948
|
}
|
|
2950
2949
|
) }),
|
|
2951
2950
|
!d && /* @__PURE__ */ i(
|
|
@@ -2953,18 +2952,18 @@ const Ne = {
|
|
|
2953
2952
|
{
|
|
2954
2953
|
container: r,
|
|
2955
2954
|
open: C,
|
|
2956
|
-
onOpenChange:
|
|
2957
|
-
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content:
|
|
2955
|
+
onOpenChange: p,
|
|
2956
|
+
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: c == null ? void 0 : c.zoomSelectTooltip, children: /* @__PURE__ */ W(
|
|
2958
2957
|
de,
|
|
2959
2958
|
{
|
|
2960
2959
|
className: se(
|
|
2961
2960
|
Fe["rp-current-zoom-wrapper"],
|
|
2962
2961
|
C && Fe.active
|
|
2963
2962
|
),
|
|
2964
|
-
"aria-label":
|
|
2963
|
+
"aria-label": c == null ? void 0 : c.zoomSelectTooltip,
|
|
2965
2964
|
children: [
|
|
2966
2965
|
/* @__PURE__ */ i(
|
|
2967
|
-
|
|
2966
|
+
na,
|
|
2968
2967
|
{
|
|
2969
2968
|
zoomLevel: t,
|
|
2970
2969
|
className: Fe["rp-current-zoom-text"]
|
|
@@ -2981,16 +2980,16 @@ const Ne = {
|
|
|
2981
2980
|
children: /* @__PURE__ */ W(
|
|
2982
2981
|
"div",
|
|
2983
2982
|
{
|
|
2984
|
-
style: { maxHeight: `${
|
|
2983
|
+
style: { maxHeight: `${m}px`, overflow: "auto" },
|
|
2985
2984
|
className: Fe["rp-zoom-dropdown-content"],
|
|
2986
2985
|
children: [
|
|
2987
2986
|
/* @__PURE__ */ W(Je, { children: [
|
|
2988
|
-
/* @__PURE__ */ i(Ie, { onClick: () => e(We.ACTUAL), children:
|
|
2989
|
-
/* @__PURE__ */ i(Ie, { onClick: () => e(We.PAGE_FIT), children:
|
|
2990
|
-
/* @__PURE__ */ i(Ie, { onClick: () => e(We.PAGE_WIDTH), children:
|
|
2987
|
+
/* @__PURE__ */ i(Ie, { onClick: () => e(We.ACTUAL), children: c == null ? void 0 : c.zoomActualSize }),
|
|
2988
|
+
/* @__PURE__ */ i(Ie, { onClick: () => e(We.PAGE_FIT), children: c == null ? void 0 : c.zoomPageFit }),
|
|
2989
|
+
/* @__PURE__ */ i(Ie, { onClick: () => e(We.PAGE_WIDTH), children: c == null ? void 0 : c.zoomPageWidth })
|
|
2991
2990
|
] }),
|
|
2992
2991
|
/* @__PURE__ */ i(St, {}),
|
|
2993
|
-
/* @__PURE__ */ i(Je, { children:
|
|
2992
|
+
/* @__PURE__ */ i(Je, { children: oa.map((g) => /* @__PURE__ */ W(Ie, { onClick: () => e(g), children: [
|
|
2994
2993
|
g,
|
|
2995
2994
|
" %"
|
|
2996
2995
|
] }, g)) })
|
|
@@ -2999,17 +2998,17 @@ const Ne = {
|
|
|
2999
2998
|
)
|
|
3000
2999
|
}
|
|
3001
3000
|
),
|
|
3002
|
-
/* @__PURE__ */ i(K, { content:
|
|
3001
|
+
/* @__PURE__ */ i(K, { content: c == null ? void 0 : c.zoomInTooltip, children: /* @__PURE__ */ i(
|
|
3003
3002
|
de,
|
|
3004
3003
|
{
|
|
3005
3004
|
disabled: I,
|
|
3006
3005
|
onClick: P,
|
|
3007
|
-
"aria-label":
|
|
3008
|
-
children: /* @__PURE__ */ i(
|
|
3006
|
+
"aria-label": c == null ? void 0 : c.zoomInTooltip,
|
|
3007
|
+
children: /* @__PURE__ */ i(ra, {})
|
|
3009
3008
|
}
|
|
3010
3009
|
) })
|
|
3011
3010
|
] });
|
|
3012
|
-
},
|
|
3011
|
+
}, ln = () => {
|
|
3013
3012
|
const { totalMatches: t, nextMatch: e, prevMatch: n } = Nt(), { localeMessages: r } = pe();
|
|
3014
3013
|
return /* @__PURE__ */ W(fe, { children: [
|
|
3015
3014
|
/* @__PURE__ */ i(
|
|
@@ -3042,25 +3041,25 @@ const Ne = {
|
|
|
3042
3041
|
}
|
|
3043
3042
|
)
|
|
3044
3043
|
] });
|
|
3045
|
-
},
|
|
3044
|
+
}, sa = () => {
|
|
3046
3045
|
const { searchIcon: t } = ve(), { searchIcon: e } = ge();
|
|
3047
|
-
return t || e || /* @__PURE__ */ i(
|
|
3048
|
-
},
|
|
3049
|
-
const { container: e } = Ce(), [n, r] = $(!1), { pdf: o } =
|
|
3046
|
+
return t || e || /* @__PURE__ */ i(bn, {});
|
|
3047
|
+
}, ca = ({ icon: t }) => {
|
|
3048
|
+
const { container: e } = Ce(), [n, r] = $(!1), { pdf: o } = re(), [a, l] = $(null), {
|
|
3050
3049
|
searchOptions: d,
|
|
3051
|
-
setSearchOptions:
|
|
3052
|
-
loading:
|
|
3053
|
-
setSearch:
|
|
3050
|
+
setSearchOptions: c,
|
|
3051
|
+
loading: m,
|
|
3052
|
+
setSearch: f,
|
|
3054
3053
|
totalMatches: C,
|
|
3055
|
-
currentMatchPosition:
|
|
3056
|
-
nextMatch:
|
|
3054
|
+
currentMatchPosition: p,
|
|
3055
|
+
nextMatch: _,
|
|
3057
3056
|
prevMatch: P,
|
|
3058
|
-
search:
|
|
3059
|
-
} = Nt(), { searchTool: v = !0 } = Pe(), { searchTool: I = !0 } = Se(), [g, u] = $(
|
|
3057
|
+
search: w
|
|
3058
|
+
} = Nt(), { searchTool: v = !0 } = Pe(), { searchTool: I = !0 } = Se(), [g, u] = $(w), { localeMessages: h } = pe(), { isSmallScreen: s } = xe(), [b, T] = $(null), [y, x] = $(!1), S = E(() => {
|
|
3060
3059
|
r(!0);
|
|
3061
3060
|
}, []), R = E(() => {
|
|
3062
|
-
|
|
3063
|
-
}, [
|
|
3061
|
+
f(""), u(""), r(!1);
|
|
3062
|
+
}, [f]), L = (U) => {
|
|
3064
3063
|
const Q = U.key === "Enter", Y = U.key === " ";
|
|
3065
3064
|
(Q || Y) && R();
|
|
3066
3065
|
}, N = E(
|
|
@@ -3068,18 +3067,18 @@ const Ne = {
|
|
|
3068
3067
|
U.key === "Escape" && n && R();
|
|
3069
3068
|
},
|
|
3070
3069
|
[n]
|
|
3071
|
-
),
|
|
3070
|
+
), M = E(
|
|
3072
3071
|
(U) => {
|
|
3073
|
-
U.shiftKey && U.key === "Enter" ? P() : U.key === "Enter" &&
|
|
3072
|
+
U.shiftKey && U.key === "Enter" ? P() : U.key === "Enter" && w !== g ? f(g) : U.key === "Enter" && _();
|
|
3074
3073
|
},
|
|
3075
|
-
[g, P,
|
|
3074
|
+
[g, P, _, f, w]
|
|
3076
3075
|
);
|
|
3077
3076
|
D(() => {
|
|
3078
|
-
u(
|
|
3079
|
-
}, [
|
|
3080
|
-
|
|
3081
|
-
}, [
|
|
3082
|
-
|
|
3077
|
+
u(w);
|
|
3078
|
+
}, [w]), D(() => {
|
|
3079
|
+
w && o && x(!0);
|
|
3080
|
+
}, [w, o]), D(() => {
|
|
3081
|
+
w && w.trim() !== "" && (u(w), f(w));
|
|
3083
3082
|
}, []), D(() => (window.addEventListener("keydown", N), () => {
|
|
3084
3083
|
window.removeEventListener("keydown", N);
|
|
3085
3084
|
}), [N]), D(() => {
|
|
@@ -3090,22 +3089,22 @@ const Ne = {
|
|
|
3090
3089
|
const A = E((U) => {
|
|
3091
3090
|
u(U.target.value);
|
|
3092
3091
|
}, []), z = E(() => {
|
|
3093
|
-
u(""),
|
|
3094
|
-
}, [
|
|
3092
|
+
u(""), f("");
|
|
3093
|
+
}, [f]), F = k(() => `${p} / ${C}`, [p, C]), { wholeWords: O, matchCase: G } = k(() => d, [d]), q = E(
|
|
3095
3094
|
(U) => {
|
|
3096
|
-
|
|
3095
|
+
c((Q) => ({ ...Q, matchCase: U }));
|
|
3097
3096
|
},
|
|
3098
|
-
[
|
|
3097
|
+
[c]
|
|
3099
3098
|
), V = E(
|
|
3100
3099
|
(U) => {
|
|
3101
|
-
|
|
3100
|
+
c((Q) => ({ ...Q, wholeWords: U }));
|
|
3102
3101
|
},
|
|
3103
|
-
[
|
|
3102
|
+
[c]
|
|
3104
3103
|
);
|
|
3105
3104
|
D(() => {
|
|
3106
3105
|
o && y && R();
|
|
3107
3106
|
}, [o, R]);
|
|
3108
|
-
const B =
|
|
3107
|
+
const B = k(() => (b == null ? void 0 : b.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [b]), ee = E(
|
|
3109
3108
|
(U) => {
|
|
3110
3109
|
if (U.key === "Tab") {
|
|
3111
3110
|
const Q = document.activeElement;
|
|
@@ -3138,142 +3137,142 @@ const Ne = {
|
|
|
3138
3137
|
align: "start",
|
|
3139
3138
|
tabIndex: 0,
|
|
3140
3139
|
avoidCollisions: !1,
|
|
3141
|
-
triggerComponent: /* @__PURE__ */ i(K, { content:
|
|
3140
|
+
triggerComponent: /* @__PURE__ */ i(K, { content: h == null ? void 0 : h.searchButtonTooltip, children: /* @__PURE__ */ i(
|
|
3142
3141
|
de,
|
|
3143
3142
|
{
|
|
3144
3143
|
active: n,
|
|
3145
3144
|
onClick: S,
|
|
3146
|
-
"aria-label":
|
|
3147
|
-
children: t || /* @__PURE__ */ i(
|
|
3145
|
+
"aria-label": h == null ? void 0 : h.searchButtonTooltip,
|
|
3146
|
+
children: t || /* @__PURE__ */ i(sa, {})
|
|
3148
3147
|
}
|
|
3149
3148
|
) }),
|
|
3150
3149
|
children: /* @__PURE__ */ W(
|
|
3151
3150
|
"div",
|
|
3152
3151
|
{
|
|
3153
|
-
ref:
|
|
3152
|
+
ref: T,
|
|
3154
3153
|
className: oe["rp-search-tool-content"],
|
|
3155
3154
|
tabIndex: 0,
|
|
3156
3155
|
onKeyDown: ee,
|
|
3157
3156
|
children: [
|
|
3158
3157
|
/* @__PURE__ */ W("div", { className: oe["rp-search-tool-input-wrapper"], children: [
|
|
3159
3158
|
/* @__PURE__ */ W("div", { className: oe["rp-search-tool-input"], children: [
|
|
3160
|
-
/* @__PURE__ */ i(K, { content:
|
|
3161
|
-
|
|
3159
|
+
/* @__PURE__ */ i(K, { content: h == null ? void 0 : h.searchInputTooltip, children: /* @__PURE__ */ i(
|
|
3160
|
+
hn,
|
|
3162
3161
|
{
|
|
3163
3162
|
value: g,
|
|
3164
|
-
onKeyDown:
|
|
3163
|
+
onKeyDown: M,
|
|
3165
3164
|
onChange: A,
|
|
3166
|
-
icon: /* @__PURE__ */ i(
|
|
3167
|
-
placeholder:
|
|
3165
|
+
icon: /* @__PURE__ */ i(bn, {}),
|
|
3166
|
+
placeholder: h == null ? void 0 : h.searchInputPlaceholder,
|
|
3168
3167
|
className: oe["rp-search-input"],
|
|
3169
|
-
ref:
|
|
3168
|
+
ref: l,
|
|
3170
3169
|
id: "search-input",
|
|
3171
3170
|
name: "search-input",
|
|
3172
3171
|
tabIndex: 0,
|
|
3173
|
-
children: !!g && /* @__PURE__ */ i("span", { className: oe["rp-search-tool-input-clear"], onClick: z, children: /* @__PURE__ */ i(
|
|
3172
|
+
children: !!g && /* @__PURE__ */ i("span", { className: oe["rp-search-tool-input-clear"], onClick: z, children: /* @__PURE__ */ i(Wr, {}) })
|
|
3174
3173
|
}
|
|
3175
3174
|
) }),
|
|
3176
|
-
|
|
3177
|
-
s && /* @__PURE__ */ i("div", { className: oe["rp-search-tool-controls"], children: /* @__PURE__ */ i(
|
|
3175
|
+
m ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(gn, { className: oe["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: F }),
|
|
3176
|
+
s && /* @__PURE__ */ i("div", { className: oe["rp-search-tool-controls"], children: /* @__PURE__ */ i(Wt, { onKeyPress: L, handleClose: R }) })
|
|
3178
3177
|
] }),
|
|
3179
3178
|
/* @__PURE__ */ W("div", { className: oe["rp-search-tool-input-checkboxes"], children: [
|
|
3180
|
-
s && /* @__PURE__ */ i(
|
|
3179
|
+
s && /* @__PURE__ */ i(ln, {}),
|
|
3181
3180
|
/* @__PURE__ */ i(
|
|
3182
|
-
|
|
3181
|
+
Ht,
|
|
3183
3182
|
{
|
|
3184
3183
|
tabIndex: 0,
|
|
3185
3184
|
name: "matchCase",
|
|
3186
|
-
value:
|
|
3187
|
-
onChange:
|
|
3188
|
-
children:
|
|
3185
|
+
value: G,
|
|
3186
|
+
onChange: q,
|
|
3187
|
+
children: h == null ? void 0 : h.searchMatchCaseLabel
|
|
3189
3188
|
}
|
|
3190
3189
|
),
|
|
3191
|
-
!s && /* @__PURE__ */ i(K, { content:
|
|
3190
|
+
!s && /* @__PURE__ */ i(K, { content: h == null ? void 0 : h.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: oe["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Bt, {}) }) }),
|
|
3192
3191
|
/* @__PURE__ */ i(
|
|
3193
|
-
|
|
3192
|
+
Ht,
|
|
3194
3193
|
{
|
|
3195
3194
|
tabIndex: 0,
|
|
3196
3195
|
name: "wholeWord",
|
|
3197
3196
|
value: O,
|
|
3198
3197
|
onChange: V,
|
|
3199
|
-
children:
|
|
3198
|
+
children: h == null ? void 0 : h.searchWholeWordsLabel
|
|
3200
3199
|
}
|
|
3201
3200
|
),
|
|
3202
|
-
!s && /* @__PURE__ */ i(K, { content:
|
|
3201
|
+
!s && /* @__PURE__ */ i(K, { content: h == null ? void 0 : h.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { tabIndex: 0, className: oe["rp-search-icon-info"], children: /* @__PURE__ */ i(Bt, {}) }) })
|
|
3203
3202
|
] })
|
|
3204
3203
|
] }),
|
|
3205
3204
|
!s && /* @__PURE__ */ W("div", { className: oe["rp-search-tool-controls"], children: [
|
|
3206
|
-
/* @__PURE__ */ i(
|
|
3207
|
-
/* @__PURE__ */ i(
|
|
3205
|
+
/* @__PURE__ */ i(ln, {}),
|
|
3206
|
+
/* @__PURE__ */ i(Wt, { onKeyPress: L, handleClose: R })
|
|
3208
3207
|
] })
|
|
3209
3208
|
]
|
|
3210
3209
|
}
|
|
3211
3210
|
)
|
|
3212
3211
|
}
|
|
3213
3212
|
) });
|
|
3214
|
-
},
|
|
3213
|
+
}, la = "_loading_wazy2_1", Me = {
|
|
3215
3214
|
"rp-loading-overlay": "_rp-loading-overlay_wazy2_1",
|
|
3216
3215
|
"rp-loading-modal": "_rp-loading-modal_wazy2_14",
|
|
3217
3216
|
"rp-loading-title": "_rp-loading-title_wazy2_27",
|
|
3218
3217
|
"rp-loading-progress-bar": "_rp-loading-progress-bar_wazy2_35",
|
|
3219
3218
|
"rp-loading-progress": "_rp-loading-progress_wazy2_35",
|
|
3220
3219
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
|
|
3221
|
-
loading:
|
|
3222
|
-
},
|
|
3220
|
+
loading: la
|
|
3221
|
+
}, da = ({ percentage: t }) => {
|
|
3223
3222
|
const { cancel: e } = it(), { localeMessages: n } = pe();
|
|
3224
|
-
return t < 1 ? null : /* @__PURE__ */ i("div", { className: se(
|
|
3225
|
-
/* @__PURE__ */ W("div", { className: se(
|
|
3223
|
+
return t < 1 ? null : /* @__PURE__ */ i("div", { className: se(Me["rp-loading-overlay"]), children: /* @__PURE__ */ W("div", { className: se(Me["rp-loading-modal"]), children: [
|
|
3224
|
+
/* @__PURE__ */ W("div", { className: se(Me["rp-loading-title"]), children: [
|
|
3226
3225
|
n == null ? void 0 : n.printLoadingMessage,
|
|
3227
3226
|
"..."
|
|
3228
3227
|
] }),
|
|
3229
|
-
/* @__PURE__ */ i("div", { className: se(
|
|
3228
|
+
/* @__PURE__ */ i("div", { className: se(Me["rp-loading-progress-bar"]), children: /* @__PURE__ */ i(
|
|
3230
3229
|
"div",
|
|
3231
3230
|
{
|
|
3232
|
-
className: se(
|
|
3231
|
+
className: se(Me["rp-loading-progress"]),
|
|
3233
3232
|
style: { width: `${t}%` }
|
|
3234
3233
|
}
|
|
3235
3234
|
) }),
|
|
3236
|
-
/* @__PURE__ */ i("button", { className: se(
|
|
3235
|
+
/* @__PURE__ */ i("button", { className: se(Me["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
|
|
3237
3236
|
] }) });
|
|
3238
|
-
},
|
|
3239
|
-
const { showPrintProgress: n = !0 } = Pe(), { showPrintProgress: r = !0 } = Se(), { progress: o } = it(), { isSmallScreen: a } = xe(), { percentage:
|
|
3240
|
-
if (!(!n || !r || !
|
|
3241
|
-
return /* @__PURE__ */ i(
|
|
3237
|
+
}, ua = rt((t, e) => {
|
|
3238
|
+
const { showPrintProgress: n = !0 } = Pe(), { showPrintProgress: r = !0 } = Se(), { progress: o } = it(), { isSmallScreen: a } = xe(), { percentage: l } = o || {}, d = () => a ? { gridTemplateColumns: "25% 60% 15%" } : void 0, c = () => {
|
|
3239
|
+
if (!(!n || !r || !l))
|
|
3240
|
+
return /* @__PURE__ */ i(da, { percentage: l });
|
|
3242
3241
|
};
|
|
3243
3242
|
return /* @__PURE__ */ W("div", { children: [
|
|
3244
3243
|
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: e, className: $e["rp-toolbar-content"], children: /* @__PURE__ */ W("div", { className: $e["rp-toolbar-wrapper"], style: d(), children: [
|
|
3245
3244
|
/* @__PURE__ */ W("div", { "data-rp": "topBarLeft", className: $e["rp-toolbar-start"], children: [
|
|
3246
|
-
/* @__PURE__ */ i(
|
|
3247
|
-
/* @__PURE__ */ i(
|
|
3245
|
+
/* @__PURE__ */ i(ca, {}),
|
|
3246
|
+
/* @__PURE__ */ i(Pi, {})
|
|
3248
3247
|
] }),
|
|
3249
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBarCenter", className: $e["rp-toolbar-middle"], children: /* @__PURE__ */ i(
|
|
3250
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBarRight", className: $e["rp-toolbar-end"], children: /* @__PURE__ */ i(
|
|
3248
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBarCenter", className: $e["rp-toolbar-middle"], children: /* @__PURE__ */ i(aa, {}) }),
|
|
3249
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBarRight", className: $e["rp-toolbar-end"], children: /* @__PURE__ */ i(ea, {}) })
|
|
3251
3250
|
] }) }),
|
|
3252
|
-
/* @__PURE__ */ i(
|
|
3251
|
+
/* @__PURE__ */ i(c, {})
|
|
3253
3252
|
] });
|
|
3254
3253
|
}), _t = {
|
|
3255
3254
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1bqgz_1",
|
|
3256
3255
|
"rp-sidebar-content": "_rp-sidebar-content_1bqgz_1",
|
|
3257
3256
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_1bqgz_16"
|
|
3258
|
-
},
|
|
3257
|
+
}, qe = {
|
|
3259
3258
|
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
3260
3259
|
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
3261
3260
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
3262
3261
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
3263
3262
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
3264
|
-
},
|
|
3265
|
-
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = he(), { pageRotate: a } = ot(),
|
|
3263
|
+
}, pa = (t) => {
|
|
3264
|
+
const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = he(), { pageRotate: a } = ot(), l = H(null), d = Rn(), { pages: c } = re(), [m, f] = $(null), C = H(!1), p = H(), _ = k(() => n ? qe["rp-thumbnail-active"] : "", [n]), P = k(() => ({
|
|
3266
3265
|
width: Math.round(r.width),
|
|
3267
3266
|
height: Math.round(r.height)
|
|
3268
|
-
}), [r]),
|
|
3267
|
+
}), [r]), w = E(() => {
|
|
3269
3268
|
e && o(e);
|
|
3270
3269
|
}, [o, e]);
|
|
3271
3270
|
return D(() => {
|
|
3272
|
-
const v =
|
|
3273
|
-
|
|
3274
|
-
}, [
|
|
3275
|
-
const v =
|
|
3276
|
-
if (!
|
|
3271
|
+
const v = c.get(e);
|
|
3272
|
+
p.current === v || (f(null), p.current = v);
|
|
3273
|
+
}, [c, e]), D(() => {
|
|
3274
|
+
const v = c.get(e);
|
|
3275
|
+
if (!l.current || !e || !v || m)
|
|
3277
3276
|
return;
|
|
3278
3277
|
const I = new IntersectionObserver((g) => {
|
|
3279
3278
|
g.forEach((u) => {
|
|
@@ -3282,21 +3281,21 @@ const Ne = {
|
|
|
3282
3281
|
return;
|
|
3283
3282
|
}
|
|
3284
3283
|
if (u.isIntersecting) {
|
|
3285
|
-
const
|
|
3284
|
+
const h = document.createElement("canvas");
|
|
3286
3285
|
C.current = !0, d.enqueue(
|
|
3287
3286
|
`thumbnail-${e}`,
|
|
3288
3287
|
{
|
|
3289
3288
|
page: v.page,
|
|
3290
|
-
canvasElem:
|
|
3289
|
+
canvasElem: h,
|
|
3291
3290
|
options: {
|
|
3292
3291
|
scale: 1
|
|
3293
3292
|
},
|
|
3294
3293
|
onLoaded: () => {
|
|
3295
|
-
|
|
3294
|
+
h.toBlob((s) => {
|
|
3296
3295
|
if (!s)
|
|
3297
3296
|
return;
|
|
3298
|
-
const
|
|
3299
|
-
|
|
3297
|
+
const b = URL.createObjectURL(s);
|
|
3298
|
+
f(b);
|
|
3300
3299
|
});
|
|
3301
3300
|
}
|
|
3302
3301
|
},
|
|
@@ -3305,16 +3304,16 @@ const Ne = {
|
|
|
3305
3304
|
}
|
|
3306
3305
|
});
|
|
3307
3306
|
});
|
|
3308
|
-
return
|
|
3307
|
+
return l.current && I.observe(l.current), () => {
|
|
3309
3308
|
I.disconnect(), d.removeQueue(`thumbnail-${e}`);
|
|
3310
3309
|
};
|
|
3311
|
-
}, [d, e,
|
|
3310
|
+
}, [d, e, c, m]), /* @__PURE__ */ W(
|
|
3312
3311
|
"div",
|
|
3313
3312
|
{
|
|
3314
|
-
onClick:
|
|
3313
|
+
onClick: w,
|
|
3315
3314
|
id: `page-${e}`,
|
|
3316
|
-
className:
|
|
3317
|
-
ref:
|
|
3315
|
+
className: qe["rp-thumbnail-wrapper"],
|
|
3316
|
+
ref: l,
|
|
3318
3317
|
children: [
|
|
3319
3318
|
/* @__PURE__ */ i(
|
|
3320
3319
|
"div",
|
|
@@ -3322,11 +3321,11 @@ const Ne = {
|
|
|
3322
3321
|
style: {
|
|
3323
3322
|
transform: `rotate(${a[e || 0]}deg)`
|
|
3324
3323
|
},
|
|
3325
|
-
className: se(
|
|
3326
|
-
children:
|
|
3324
|
+
className: se(_, qe["rp-thumbnail"]),
|
|
3325
|
+
children: m ? /* @__PURE__ */ i(
|
|
3327
3326
|
"img",
|
|
3328
3327
|
{
|
|
3329
|
-
src:
|
|
3328
|
+
src: m,
|
|
3330
3329
|
width: P.width,
|
|
3331
3330
|
height: P.height,
|
|
3332
3331
|
alt: "thumbnail"
|
|
@@ -3334,39 +3333,39 @@ const Ne = {
|
|
|
3334
3333
|
) : /* @__PURE__ */ i(
|
|
3335
3334
|
"div",
|
|
3336
3335
|
{
|
|
3337
|
-
className:
|
|
3336
|
+
className: qe["rp-thumbnail-loader"],
|
|
3338
3337
|
style: {
|
|
3339
3338
|
width: `${P.width}px`,
|
|
3340
3339
|
height: `${P.height}px`
|
|
3341
3340
|
},
|
|
3342
|
-
children: /* @__PURE__ */ i(
|
|
3341
|
+
children: /* @__PURE__ */ i(gn, {})
|
|
3343
3342
|
}
|
|
3344
3343
|
)
|
|
3345
3344
|
}
|
|
3346
3345
|
),
|
|
3347
|
-
/* @__PURE__ */ i("div", { className:
|
|
3346
|
+
/* @__PURE__ */ i("div", { className: qe["rp-thumbnail-text"], children: e })
|
|
3348
3347
|
]
|
|
3349
3348
|
}
|
|
3350
3349
|
);
|
|
3351
|
-
},
|
|
3350
|
+
}, dn = {
|
|
3352
3351
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
3353
3352
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
3354
|
-
},
|
|
3353
|
+
}, ha = 16, fa = (t, e) => {
|
|
3355
3354
|
const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
|
|
3356
|
-
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
3357
|
-
},
|
|
3358
|
-
const { show: n, width: r } = t, { focusedPage: o, totalPages: a } = he(), { thumbnailPages:
|
|
3359
|
-
|
|
3360
|
-
const
|
|
3361
|
-
const P =
|
|
3355
|
+
t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - ha);
|
|
3356
|
+
}, ma = rt((t, e) => {
|
|
3357
|
+
const { show: n, width: r } = t, { focusedPage: o, totalPages: a } = he(), { thumbnailPages: l, addPage: d, thumbnailLength: c, addToPage: m } = In(), f = H(null), C = H(1);
|
|
3358
|
+
un(e, () => f.current);
|
|
3359
|
+
const p = k(() => Object.values(l), [l]), _ = E(() => {
|
|
3360
|
+
const P = c + 1;
|
|
3362
3361
|
P <= a && d(P);
|
|
3363
|
-
}, [d, a,
|
|
3362
|
+
}, [d, a, c]);
|
|
3364
3363
|
return D(() => {
|
|
3365
|
-
o >
|
|
3366
|
-
}, [o,
|
|
3364
|
+
o > c && a > c ? m(o) : n && C.current !== o && (fa(f.current, o), C.current = o);
|
|
3365
|
+
}, [o, c, m, n, p]), Uo(f.current, _), /* @__PURE__ */ i("div", { ref: f, className: dn["rp-thumbnails-container"], style: { width: r }, children: /* @__PURE__ */ i("div", { className: dn["rp-thumbnails"], children: n ? p.map((P, w) => {
|
|
3367
3366
|
var v, I;
|
|
3368
3367
|
return /* @__PURE__ */ i(
|
|
3369
|
-
|
|
3368
|
+
pa,
|
|
3370
3369
|
{
|
|
3371
3370
|
isFocused: o === ((v = P.page) == null ? void 0 : v.pageNumber),
|
|
3372
3371
|
pageNumber: (I = P.page) == null ? void 0 : I.pageNumber,
|
|
@@ -3374,24 +3373,24 @@ const Ne = {
|
|
|
3374
3373
|
viewport: P.viewport,
|
|
3375
3374
|
defaultRotation: P.defaultRotation
|
|
3376
3375
|
},
|
|
3377
|
-
|
|
3376
|
+
w
|
|
3378
3377
|
);
|
|
3379
3378
|
}) : null }) });
|
|
3380
|
-
}),
|
|
3379
|
+
}), ga = () => {
|
|
3381
3380
|
const { thumbnailIcon: t } = ve(), { thumbnailIcon: e } = ge();
|
|
3382
|
-
return t || e || /* @__PURE__ */ i(
|
|
3383
|
-
},
|
|
3384
|
-
const { active: t, setActive: e } =
|
|
3381
|
+
return t || e || /* @__PURE__ */ i(Do, {});
|
|
3382
|
+
}, va = () => {
|
|
3383
|
+
const { active: t, setActive: e } = In(), [n, r] = $(Vo), o = H(null), a = H(null), { thumbnailTool: l, sidebarEnable: d } = Pe(), { localeMessages: c } = pe(), m = E(() => {
|
|
3385
3384
|
e((C) => !C);
|
|
3386
|
-
}, []),
|
|
3385
|
+
}, []), f = k(() => typeof l != "boolean" && l ? /* @__PURE__ */ i(l, { onClick: m, active: t }) : l ? /* @__PURE__ */ i(K, { content: c == null ? void 0 : c.thumbnailTooltip, children: /* @__PURE__ */ i(
|
|
3387
3386
|
de,
|
|
3388
3387
|
{
|
|
3389
|
-
onClick:
|
|
3388
|
+
onClick: m,
|
|
3390
3389
|
active: t,
|
|
3391
|
-
"aria-label":
|
|
3392
|
-
children: /* @__PURE__ */ i(
|
|
3390
|
+
"aria-label": c == null ? void 0 : c.thumbnailTooltip,
|
|
3391
|
+
children: /* @__PURE__ */ i(ga, {})
|
|
3393
3392
|
}
|
|
3394
|
-
) }) : null, [
|
|
3393
|
+
) }) : null, [l, t, m, c]);
|
|
3395
3394
|
return /* @__PURE__ */ i(fe, { children: d && /* @__PURE__ */ W(
|
|
3396
3395
|
"div",
|
|
3397
3396
|
{
|
|
@@ -3399,7 +3398,7 @@ const Ne = {
|
|
|
3399
3398
|
className: _t["rp-sidebar-content-wrapper"],
|
|
3400
3399
|
"data-rp": "sidebar",
|
|
3401
3400
|
children: [
|
|
3402
|
-
/* @__PURE__ */ i("div", { ref: a, className: _t["rp-sidebar-content"], children:
|
|
3401
|
+
/* @__PURE__ */ i("div", { ref: a, className: _t["rp-sidebar-content"], children: f }),
|
|
3403
3402
|
/* @__PURE__ */ W(
|
|
3404
3403
|
"div",
|
|
3405
3404
|
{
|
|
@@ -3407,7 +3406,7 @@ const Ne = {
|
|
|
3407
3406
|
hidden: !t,
|
|
3408
3407
|
className: _t["rp-thumbnails-wrapper"],
|
|
3409
3408
|
children: [
|
|
3410
|
-
/* @__PURE__ */ i(
|
|
3409
|
+
/* @__PURE__ */ i(ma, { show: t, ref: o }),
|
|
3411
3410
|
/* @__PURE__ */ i(
|
|
3412
3411
|
Mo,
|
|
3413
3412
|
{
|
|
@@ -3422,38 +3421,38 @@ const Ne = {
|
|
|
3422
3421
|
]
|
|
3423
3422
|
}
|
|
3424
3423
|
) });
|
|
3425
|
-
},
|
|
3424
|
+
}, Cc = po((t, e) => {
|
|
3426
3425
|
const {
|
|
3427
3426
|
children: n,
|
|
3428
3427
|
slots: r,
|
|
3429
3428
|
icons: o,
|
|
3430
3429
|
style: a,
|
|
3431
|
-
className:
|
|
3430
|
+
className: l,
|
|
3432
3431
|
mobileWidth: d,
|
|
3433
|
-
onLoaded:
|
|
3434
|
-
cleanupOnLoaded:
|
|
3435
|
-
onLayoutWidthChange:
|
|
3436
|
-
} = t, [C,
|
|
3437
|
-
return D(() => (
|
|
3438
|
-
|
|
3439
|
-
}), [
|
|
3440
|
-
/* @__PURE__ */ i(
|
|
3441
|
-
/* @__PURE__ */ W(
|
|
3432
|
+
onLoaded: c,
|
|
3433
|
+
cleanupOnLoaded: m,
|
|
3434
|
+
onLayoutWidthChange: f
|
|
3435
|
+
} = t, [C, p] = $(null), { setContainer: _, setContentRef: P } = Ce(), { loading: w } = re(), { LoaderImageComponent: v } = yt();
|
|
3436
|
+
return D(() => (c && c(), () => {
|
|
3437
|
+
m && m();
|
|
3438
|
+
}), [c, m]), // TODO: deprecated in v2.0.0, remove later ~
|
|
3439
|
+
/* @__PURE__ */ i(On, { toolbarRef: C, ref: e, children: /* @__PURE__ */ i(Ao, { mobileWidth: d, onLayoutWidthChange: f, children: /* @__PURE__ */ i(Fo, { slots: r, children: /* @__PURE__ */ i(qo, { icons: o, children: /* @__PURE__ */ W(zo, { getContainerRef: _, style: a, className: l, children: [
|
|
3440
|
+
/* @__PURE__ */ W(ko, { children: [
|
|
3442
3441
|
/* @__PURE__ */ W("div", { className: ye["rp-layout"], children: [
|
|
3443
3442
|
/* @__PURE__ */ i(
|
|
3444
|
-
|
|
3443
|
+
ua,
|
|
3445
3444
|
{
|
|
3446
|
-
ref:
|
|
3445
|
+
ref: p
|
|
3447
3446
|
}
|
|
3448
3447
|
),
|
|
3449
3448
|
/* @__PURE__ */ W("div", { className: ye["rp-content"], children: [
|
|
3450
|
-
/* @__PURE__ */ i("div", { className: ye["rp-sidebar"], children: /* @__PURE__ */ i(
|
|
3449
|
+
/* @__PURE__ */ i("div", { className: ye["rp-sidebar"], children: /* @__PURE__ */ i(va, {}) }),
|
|
3451
3450
|
/* @__PURE__ */ i("div", { ref: P, className: ye["rp-pages"], children: n })
|
|
3452
3451
|
] })
|
|
3453
3452
|
] }),
|
|
3454
|
-
/* @__PURE__ */ i(
|
|
3453
|
+
/* @__PURE__ */ i($o, {})
|
|
3455
3454
|
] }),
|
|
3456
|
-
|
|
3455
|
+
w ? /* @__PURE__ */ i(
|
|
3457
3456
|
"div",
|
|
3458
3457
|
{
|
|
3459
3458
|
className: ye["rp-loader"],
|
|
@@ -3482,7 +3481,7 @@ const Ne = {
|
|
|
3482
3481
|
}
|
|
3483
3482
|
) : null
|
|
3484
3483
|
] }) }) }) }) });
|
|
3485
|
-
}),
|
|
3484
|
+
}), Pc = {
|
|
3486
3485
|
"rp-toolbar-layout": "_rp-toolbar-layout_vwobs_1",
|
|
3487
3486
|
"rp-content": "_rp-content_vwobs_7",
|
|
3488
3487
|
"rp-topbar-content": "_rp-topbar-content_vwobs_13",
|
|
@@ -3491,59 +3490,59 @@ const Ne = {
|
|
|
3491
3490
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_vwobs_37"
|
|
3492
3491
|
};
|
|
3493
3492
|
export {
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3493
|
+
pa as $,
|
|
3494
|
+
yn as A,
|
|
3495
|
+
Gr as B,
|
|
3496
|
+
Sn as C,
|
|
3497
|
+
$i as D,
|
|
3498
|
+
xn as E,
|
|
3499
|
+
Rn as F,
|
|
3500
|
+
Ur as G,
|
|
3501
|
+
Zr as H,
|
|
3502
|
+
Xr as I,
|
|
3503
|
+
Yr as J,
|
|
3505
3504
|
Ot as K,
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3505
|
+
On as L,
|
|
3506
|
+
fi as M,
|
|
3507
|
+
vi as N,
|
|
3508
|
+
wi as O,
|
|
3509
|
+
fc as P,
|
|
3510
|
+
_i as Q,
|
|
3511
|
+
_c as R,
|
|
3512
|
+
ca as S,
|
|
3513
|
+
gc as T,
|
|
3514
|
+
Xn as U,
|
|
3515
|
+
Jn as V,
|
|
3516
|
+
Yi as W,
|
|
3517
|
+
Ji as X,
|
|
3518
|
+
ln as Y,
|
|
3519
|
+
na as Z,
|
|
3520
|
+
ua as _,
|
|
3521
|
+
Cc as a,
|
|
3522
|
+
va as a0,
|
|
3523
|
+
Zn as b,
|
|
3525
3524
|
it as c,
|
|
3526
3525
|
Nt as d,
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3526
|
+
vc as e,
|
|
3527
|
+
wc as f,
|
|
3528
|
+
mc as g,
|
|
3529
|
+
In as h,
|
|
3531
3530
|
wt as i,
|
|
3532
3531
|
Fe as j,
|
|
3533
3532
|
$e as k,
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3533
|
+
Pi as l,
|
|
3534
|
+
aa as m,
|
|
3535
|
+
ea as n,
|
|
3536
|
+
Pc as o,
|
|
3537
|
+
ma as p,
|
|
3538
|
+
da as q,
|
|
3539
|
+
qi as r,
|
|
3540
|
+
Ki as s,
|
|
3541
|
+
Tn as t,
|
|
3543
3542
|
he as u,
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3543
|
+
Hr as v,
|
|
3544
|
+
Cn as w,
|
|
3545
|
+
$r as x,
|
|
3546
|
+
Pn as y,
|
|
3547
|
+
qr as z
|
|
3549
3548
|
};
|