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