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