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