@pdf-viewer/react 0.4.0-beta.2 → 0.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Container-337e1b18.js +37 -0
- package/dist/{RPLayout-608b83dd.js → RPLayout-88110444.js} +942 -941
- package/dist/assets/Container.css +1 -1
- package/dist/assets/RPLayout.css +1 -1
- package/dist/assets/RPTooltip.css +1 -0
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPViewer.js +1 -1
- package/dist/components/layout/Container.js +1 -1
- package/dist/components/layout/RPLayout.js +2 -2
- package/dist/components/layout/sidebar/RPSidebar.js +3 -2
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DarkModeTool.js +13 -12
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/DocumentProperties.js +7 -6
- package/dist/components/layout/toolbar/FileDownloadTool.js +3 -2
- package/dist/components/layout/toolbar/FileUploadTool.js +16 -15
- package/dist/components/layout/toolbar/FullScreenTool.js +30 -32
- package/dist/components/layout/toolbar/MostPageTool.js +3 -2
- package/dist/components/layout/toolbar/OtherTool.js +3 -2
- package/dist/components/layout/toolbar/Paginate.js +3 -2
- package/dist/components/layout/toolbar/PrintTool.js +3 -2
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +24 -23
- package/dist/components/layout/toolbar/ScrollModeTool.js +34 -33
- package/dist/components/layout/toolbar/SearchTool.js +3 -2
- package/dist/components/layout/toolbar/SelectionModeTool.js +27 -26
- package/dist/components/layout/toolbar/ZoomTool.js +3 -2
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/Checkbox.js +130 -242
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +2397 -0
- package/dist/contexts/PaginateContext.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/index-2b077daa.js +122 -0
- package/dist/main.js +1 -1
- package/dist/types/components/ui/RPTooltip.d.ts +8 -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/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +2 -1
- package/dist/Container-cea98fc1.js +0 -37
|
@@ -1,151 +1,152 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as O, Fragment as Ae } from "react/jsx-runtime";
|
|
2
2
|
import * as V from "react";
|
|
3
|
-
import { useRef as $, useEffect as
|
|
4
|
-
import { ChevronUpIcon as
|
|
3
|
+
import { useRef as $, useEffect as z, useCallback as x, useState as F, useMemo as D, createContext as We, useContext as He, forwardRef as $e, useImperativeHandle as qt, createElement as Ne, PureComponent as zn, Component as Fn, memo as kn } from "react";
|
|
4
|
+
import { ChevronUpIcon as Me } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as B } from "./components/ui/Button.js";
|
|
6
|
-
import { UIInput as
|
|
7
|
-
import { useScrollModeContext as
|
|
8
|
-
import { useDocumentContext as
|
|
6
|
+
import { UIInput as Zt } from "./components/ui/Input.js";
|
|
7
|
+
import { useScrollModeContext as Pe, ScrollModeProvider as Wn } from "./contexts/ScrollModeContext.js";
|
|
8
|
+
import { useDocumentContext as Y } from "./contexts/RPDocumentContext.js";
|
|
9
9
|
import "./components/RPConfig.js";
|
|
10
|
-
import { ThumbnailIcon as
|
|
10
|
+
import { ThumbnailIcon as Hn } from "./components/icons/Thumbnail.js";
|
|
11
11
|
import { c as j } from "./clsx-0c6e471a.js";
|
|
12
|
-
import { LoaderIcon as
|
|
13
|
-
import { renderPage as
|
|
12
|
+
import { LoaderIcon as pt } from "./components/icons/LoaderIcon.js";
|
|
13
|
+
import { renderPage as ot } from "./utils/renderPage.js";
|
|
14
14
|
import "./contexts/ThemeContext.js";
|
|
15
|
-
import { RPDropFileZone as
|
|
16
|
-
import { DropFileZoneProvider as
|
|
17
|
-
import { DarkModeProvider as
|
|
18
|
-
import { useToolbarComponentContext as se, ToolbarComponentProvider as
|
|
19
|
-
import { useRotateContext as
|
|
20
|
-
import { useViewModeContext as
|
|
21
|
-
import { FileInputProvider as
|
|
22
|
-
import { useZoomContext as
|
|
23
|
-
import { findMatches as
|
|
24
|
-
import { useVirtualScrollContext as
|
|
25
|
-
import * as
|
|
26
|
-
import { AnnotationLayer as
|
|
27
|
-
import { getThumbnailViewport as
|
|
28
|
-
import { useInfiniteScroll as
|
|
29
|
-
import { RPSplitter as
|
|
30
|
-
import { useIconContext as
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import
|
|
76
|
-
|
|
77
|
-
"rp-pages
|
|
78
|
-
"rp-pages-
|
|
79
|
-
"rp-
|
|
80
|
-
"rp-
|
|
81
|
-
"rp-
|
|
82
|
-
"rp-cursor-
|
|
83
|
-
|
|
15
|
+
import { RPDropFileZone as $n } from "./components/RPDropFileZone.js";
|
|
16
|
+
import { DropFileZoneProvider as Vn } from "./contexts/DropFileZoneContext.js";
|
|
17
|
+
import { DarkModeProvider as Gn } from "./contexts/DarkModeContext.js";
|
|
18
|
+
import { useToolbarComponentContext as se, ToolbarComponentProvider as Un } from "./contexts/ToolbarComponentContext.js";
|
|
19
|
+
import { useRotateContext as Ve, RotateProvider as qn } from "./contexts/RotateContext.js";
|
|
20
|
+
import { useViewModeContext as Ge, ViewModeProvider as Zn } from "./contexts/ViewModeContext.js";
|
|
21
|
+
import { FileInputProvider as jn } from "./contexts/FileInputContext.js";
|
|
22
|
+
import { useZoomContext as ht, ZoomProvider as Bn } from "./contexts/ZoomContext.js";
|
|
23
|
+
import { findMatches as Kn, resetDivs as Xn, highlightMatches as Jn } from "./utils/highlight.js";
|
|
24
|
+
import { useVirtualScrollContext as Ue, VirtualScrollProvider as Yn } from "./contexts/VirtualScrollContext.js";
|
|
25
|
+
import * as Qn from "pdfjs-dist";
|
|
26
|
+
import { AnnotationLayer as er, PixelsPerInch as tr, AnnotationMode as nr, RenderingCancelledException as rr } from "pdfjs-dist";
|
|
27
|
+
import { getThumbnailViewport as It } from "./utils/getThumbnailViewport.js";
|
|
28
|
+
import { useInfiniteScroll as or } from "./utils/hooks/useInfiniteScroll.js";
|
|
29
|
+
import { RPSplitter as ar } from "./components/layout/sidebar/RPSplitter.js";
|
|
30
|
+
import { useIconContext as ne, IconProvider as ir } from "./contexts/IconContext.js";
|
|
31
|
+
import X from "./components/ui/RPTooltip.js";
|
|
32
|
+
import { c as he, C as sr } from "./Container-337e1b18.js";
|
|
33
|
+
import { useLayoutContainer as qe, LayoutContainerProvider as lr } from "./contexts/LayoutContainerContext.js";
|
|
34
|
+
import { ViewMode as ze, ScrollMode as Q, AnnotationSubType as at, SelectionMode as jt, ZoomLevel as we } from "./utils/types.js";
|
|
35
|
+
import { useLayerContext as cr, LayerProvider as ur } from "./contexts/LayerContext.js";
|
|
36
|
+
import { useVirtualGridContext as Bt, VirtualGridProvider as dr } from "./contexts/VirtualGridContext.js";
|
|
37
|
+
import { useScrollStateContext as Kt, ScrollStateProvider as pr } from "./contexts/ScrollStateContext.js";
|
|
38
|
+
import { useViewportContext as ge, ViewportProvider as hr } from "./contexts/ViewportContext.js";
|
|
39
|
+
import { useSelectionModeContext as fr, SelectionModeProvider as mr } from "./contexts/SelectionModeContext.js";
|
|
40
|
+
import { useInitialStateContext as gr, InitialStateProvider as vr } from "./contexts/InitialStateContext.js";
|
|
41
|
+
import { useFullScreenContext as _r, FullScreenProvider as wr } from "./contexts/FullScreenContext.js";
|
|
42
|
+
import { WrapperLayout as br } from "./components/layout/WrapperLayout.js";
|
|
43
|
+
import { SimpleLinkService as Cr } from "./utils/link_service.js";
|
|
44
|
+
import { dateFormatter as it } from "./utils/dateFormatter.js";
|
|
45
|
+
import { sanitizeExternalUrl as Pr } from "./utils/sanitizeExternalUrl.js";
|
|
46
|
+
import { useWatermark as Sr } from "./utils/hooks/useWatermark.js";
|
|
47
|
+
import { usePageDimension as Xt } from "./utils/hooks/usePageDimension.js";
|
|
48
|
+
import { useMousePressed as Tr } from "./utils/hooks/useMousePressed.js";
|
|
49
|
+
import { useGrabScroll as Ir } from "./utils/hooks/useGrabScroll.js";
|
|
50
|
+
import { useDebounce as yr } from "./utils/hooks/useDebounce.js";
|
|
51
|
+
import { appConsole as xr } from "./utils/appConsole.js";
|
|
52
|
+
import { FileUploadTool as Jt } from "./components/layout/toolbar/FileUploadTool.js";
|
|
53
|
+
import { DarkModeTool as Rr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
54
|
+
import { ThreeDotIcon as Mr } from "./components/icons/ThreeDotIcon.js";
|
|
55
|
+
import { UIDropDown as ft } from "./components/ui/DropDown.js";
|
|
56
|
+
import { c as Lr, u as mt, a as Le, b as Re, d as gt, e as Nr, f as Er, h as Or, g as Dr, F as Ar, D as zr, i as Fr, j as kr, k as Be, l as Wr, G as Fe } from "./index-8049287f.js";
|
|
57
|
+
import { CloseIcon as Yt } from "./components/icons/CloseIcon.js";
|
|
58
|
+
import { PropertyItem as Hr } from "./components/layout/toolbar/PropertyItem.js";
|
|
59
|
+
import { useOtherToolContext as $r, OtherToolProvider as Vr } from "./contexts/OtherToolContext.js";
|
|
60
|
+
import { DocumentProperties as Gr } from "./components/layout/toolbar/DocumentProperties.js";
|
|
61
|
+
import { RotateTool as Ur } from "./components/layout/toolbar/RotateTool.js";
|
|
62
|
+
import { ScrollModeTool as qr } from "./components/layout/toolbar/ScrollModeTool.js";
|
|
63
|
+
import { MenuSeparator as vt } from "./components/layout/toolbar/MenuSeparator.js";
|
|
64
|
+
import { FileDownloadDefaultIcon as Zr } from "./components/icons/FileDownloadDefaultIcon.js";
|
|
65
|
+
import { MenuItem as ce } from "./components/layout/toolbar/MenuItem.js";
|
|
66
|
+
import { PrintDefaultTool as jr } from "./components/icons/PrintDefaultIcon.js";
|
|
67
|
+
import { FullScreenTool as Qt } from "./components/layout/toolbar/FullScreenTool.js";
|
|
68
|
+
import { GoToDownIcon as en } from "./components/icons/GoToDownIcon.js";
|
|
69
|
+
import { SelectionModeTool as Br } from "./components/layout/toolbar/SelectionModeTool.js";
|
|
70
|
+
import { ZoomInIcon as Kr } from "./components/icons/ZoomInIcon.js";
|
|
71
|
+
import { ZoomOutIcon as Xr } from "./components/icons/ZoomOutIcon.js";
|
|
72
|
+
import { PAGE_PADDING as yt } from "./utils/constants.js";
|
|
73
|
+
import { SearchIcon as Jr } from "./components/icons/SearchIcon.js";
|
|
74
|
+
import { UICheckbox as xt } from "./components/ui/Checkbox.js";
|
|
75
|
+
import { ClearIcon as Yr } from "./components/icons/ClearIcon.js";
|
|
76
|
+
import './assets/RPLayout.css';const ae = {
|
|
77
|
+
"rp-pages": "_rp-pages_34orh_1",
|
|
78
|
+
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_34orh_7",
|
|
79
|
+
"rp-pages-container": "_rp-pages-container_34orh_11",
|
|
80
|
+
"rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_34orh_17",
|
|
81
|
+
"rp-viewer": "_rp-viewer_34orh_22",
|
|
82
|
+
"rp-cursor-grab": "_rp-cursor-grab_34orh_27",
|
|
83
|
+
"rp-cursor-grabbing": "_rp-cursor-grabbing_34orh_35"
|
|
84
|
+
}, Ke = {
|
|
84
85
|
"rp-page-wrapper": "_rp-page-wrapper_h7a2q_1",
|
|
85
86
|
"rp-page": "_rp-page_h7a2q_1",
|
|
86
87
|
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
87
|
-
},
|
|
88
|
-
const { pageNumber: t, onLoaded: n, onLoading: r } = e, o = $(null), { pages:
|
|
89
|
-
return
|
|
90
|
-
if (!
|
|
88
|
+
}, Qr = (e) => {
|
|
89
|
+
const { pageNumber: t, onLoaded: n, onLoading: r } = e, o = $(null), { pages: i } = Y(), { rotate: l } = Ve(), s = $(), { currentZoom: c } = ht();
|
|
90
|
+
return z(() => {
|
|
91
|
+
if (!i || c === 0)
|
|
91
92
|
return;
|
|
92
|
-
const h =
|
|
93
|
+
const h = i.get(t);
|
|
93
94
|
if (o.current && h) {
|
|
94
95
|
const p = o.current;
|
|
95
96
|
p.hidden = !0;
|
|
96
|
-
const m =
|
|
97
|
-
m && m.cancel(), r && r(),
|
|
97
|
+
const m = s.current;
|
|
98
|
+
m && m.cancel(), r && r(), s.current = ot(h.page, p, c, l), s.current.promise.then(() => {
|
|
98
99
|
p.hidden = !1;
|
|
99
100
|
}).catch((u) => {
|
|
100
101
|
}).finally(() => {
|
|
101
102
|
n && n();
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
|
-
}, [
|
|
105
|
-
},
|
|
105
|
+
}, [i, t, l, c, r, n]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${t}-canvas`, ref: o });
|
|
106
|
+
}, Xe = {
|
|
106
107
|
"rp-text-layer": "_rp-text-layer_1mgyz_1",
|
|
107
108
|
"rp-text-layer-text": "_rp-text-layer-text_1mgyz_9"
|
|
108
|
-
},
|
|
109
|
-
const { viewMode: e } =
|
|
110
|
-
|
|
111
|
-
n != null && n.scrollToItem && (
|
|
109
|
+
}, _t = () => {
|
|
110
|
+
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { virtualScrollRef: n, pageScrollElementRef: r } = Ue(), { setFocusedPage: o } = re(), i = $(), { columnCount: l } = Bt(), s = Xt(), c = $(t), h = $(e);
|
|
111
|
+
z(() => {
|
|
112
|
+
n != null && n.scrollToItem && (i.current = n);
|
|
112
113
|
}, [n]);
|
|
113
114
|
const p = x(
|
|
114
115
|
(u) => {
|
|
115
116
|
if (!r)
|
|
116
117
|
return;
|
|
117
118
|
const f = Math.ceil(u / 2) * 2 - 1;
|
|
118
|
-
u === f + 1 ? r.scrollTo({ left:
|
|
119
|
+
u === f + 1 ? r.scrollTo({ left: s.widths[f], top: 0 }) : r.scrollTo({ left: 0, top: 0 });
|
|
119
120
|
},
|
|
120
|
-
[r,
|
|
121
|
+
[r, s]
|
|
121
122
|
);
|
|
122
|
-
return
|
|
123
|
+
return z(() => {
|
|
123
124
|
c.current = t, h.current = e;
|
|
124
125
|
}, [t, e]), { scrollToPage: x(
|
|
125
126
|
(u, f = "start") => {
|
|
126
127
|
const v = u - 1;
|
|
127
|
-
if (h.current ===
|
|
128
|
+
if (h.current === ze.DUAL_PAGE && c.current === Q.PAGE_SCROLLING) {
|
|
128
129
|
p(u);
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
|
-
if (c.current ===
|
|
132
|
+
if (c.current === Q.PAGE_SCROLLING) {
|
|
132
133
|
o(u);
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
135
|
-
if (
|
|
136
|
-
if (c.current ===
|
|
137
|
-
|
|
138
|
-
else if (h.current ===
|
|
136
|
+
if (i.current)
|
|
137
|
+
if (c.current === Q.HORIZONTAL_SCROLLING)
|
|
138
|
+
i.current.scrollToItem({ columnIndex: v, align: f });
|
|
139
|
+
else if (h.current === ze.DUAL_PAGE) {
|
|
139
140
|
const g = v % 2, C = Math.floor(v / 2);
|
|
140
|
-
|
|
141
|
+
i.current.scrollToItem({ columnIndex: g, rowIndex: C, align: f });
|
|
141
142
|
} else
|
|
142
|
-
|
|
143
|
+
i.current.scrollToItem({ rowIndex: v, align: f });
|
|
143
144
|
},
|
|
144
145
|
[l, p, o]
|
|
145
146
|
) };
|
|
146
|
-
},
|
|
147
|
-
const [n, r] = F(t), [o,
|
|
148
|
-
|
|
147
|
+
}, eo = (e = {}, t = "") => {
|
|
148
|
+
const [n, r] = F(t), [o, i] = F(!1), { pdf: l } = Y(), s = $(!n), [c, h] = F([]), [p, m] = F(0), { scrollToPage: u } = _t(), { virtualScrollRef: f, pageScrollElementRef: v, virtualScrollableElementRef: _ } = Ue(), { scrollMode: g } = Pe(), [C, y] = F(null), w = D(() => p === 0 ? null : c[p - 1], [p, c]), T = D(() => c.length, [c]);
|
|
149
|
+
z(() => {
|
|
149
150
|
if (!w || (u(w.page), !C || !C.classList.contains("selected")))
|
|
150
151
|
return;
|
|
151
152
|
const P = _ || v;
|
|
@@ -174,32 +175,32 @@ import './assets/RPLayout.css';const oe = {
|
|
|
174
175
|
return {};
|
|
175
176
|
const N = P.numPages, I = {};
|
|
176
177
|
for (let M = 1; M <= N; M++) {
|
|
177
|
-
if (
|
|
178
|
+
if (s.current)
|
|
178
179
|
throw "close pop over";
|
|
179
180
|
const L = await P.getPage(M);
|
|
180
181
|
I[M.toString()] = await L.getTextContent();
|
|
181
182
|
}
|
|
182
183
|
return I;
|
|
183
184
|
}, []);
|
|
184
|
-
return
|
|
185
|
+
return z(() => {
|
|
185
186
|
if (!n) {
|
|
186
|
-
|
|
187
|
+
s.current = !0, h([]), m(0);
|
|
187
188
|
return;
|
|
188
189
|
}
|
|
189
|
-
|
|
190
|
+
s.current = !1, i(!0), h([]), m(0), b(l).then((P) => {
|
|
190
191
|
const I = Object.keys(P).reduce((M, L) => {
|
|
191
|
-
const R =
|
|
192
|
+
const R = Kn(
|
|
192
193
|
[n],
|
|
193
194
|
P[L],
|
|
194
195
|
Number(L) - 1,
|
|
195
196
|
e
|
|
196
|
-
).map((E,
|
|
197
|
+
).map((E, A) => ({ ...E, page: Number(L), pageMatchIdx: A }));
|
|
197
198
|
return [...M, ...R];
|
|
198
199
|
}, []);
|
|
199
200
|
h(I), m(I.length ? 1 : 0);
|
|
200
201
|
}).catch(() => {
|
|
201
202
|
h([]), m(0);
|
|
202
|
-
}).finally(() =>
|
|
203
|
+
}).finally(() => i(!1));
|
|
203
204
|
}, [n, b, l, e]), {
|
|
204
205
|
search: n,
|
|
205
206
|
setSearch: r,
|
|
@@ -213,7 +214,7 @@ import './assets/RPLayout.css';const oe = {
|
|
|
213
214
|
currentMatchElement: C,
|
|
214
215
|
setCurrentMatchElement: y
|
|
215
216
|
};
|
|
216
|
-
},
|
|
217
|
+
}, tn = We({
|
|
217
218
|
search: "",
|
|
218
219
|
setSearch: (e) => {
|
|
219
220
|
},
|
|
@@ -231,15 +232,15 @@ import './assets/RPLayout.css';const oe = {
|
|
|
231
232
|
currentMatchElement: null,
|
|
232
233
|
setCurrentMatchElement: (e) => {
|
|
233
234
|
}
|
|
234
|
-
}),
|
|
235
|
+
}), to = ({
|
|
235
236
|
children: e,
|
|
236
237
|
initialSearch: t
|
|
237
238
|
}) => {
|
|
238
239
|
const [n, r] = F({}), {
|
|
239
240
|
loading: o,
|
|
240
|
-
setSearch:
|
|
241
|
+
setSearch: i,
|
|
241
242
|
totalMatches: l,
|
|
242
|
-
currentMatchPosition:
|
|
243
|
+
currentMatchPosition: s,
|
|
243
244
|
currentMatch: c,
|
|
244
245
|
search: h,
|
|
245
246
|
matches: p,
|
|
@@ -247,17 +248,17 @@ import './assets/RPLayout.css';const oe = {
|
|
|
247
248
|
prevMatch: u,
|
|
248
249
|
currentMatchElement: f,
|
|
249
250
|
setCurrentMatchElement: v
|
|
250
|
-
} =
|
|
251
|
-
return /* @__PURE__ */
|
|
252
|
-
|
|
251
|
+
} = eo(n, t);
|
|
252
|
+
return /* @__PURE__ */ a(
|
|
253
|
+
tn.Provider,
|
|
253
254
|
{
|
|
254
255
|
value: {
|
|
255
256
|
searchOptions: n,
|
|
256
257
|
setSearchOptions: r,
|
|
257
258
|
loading: o,
|
|
258
|
-
setSearch:
|
|
259
|
+
setSearch: i,
|
|
259
260
|
totalMatches: l,
|
|
260
|
-
currentMatchPosition:
|
|
261
|
+
currentMatchPosition: s,
|
|
261
262
|
currentMatch: c,
|
|
262
263
|
nextMatch: m,
|
|
263
264
|
prevMatch: u,
|
|
@@ -269,37 +270,37 @@ import './assets/RPLayout.css';const oe = {
|
|
|
269
270
|
children: e
|
|
270
271
|
}
|
|
271
272
|
);
|
|
272
|
-
},
|
|
273
|
-
const { pageNumber: t } = e, { pages: n } =
|
|
273
|
+
}, nn = () => He(tn), no = (e) => {
|
|
274
|
+
const { pageNumber: t } = e, { pages: n } = Y(), r = $(null), { matches: o, currentMatch: i, setCurrentMatchElement: l } = nn(), [s, c] = F(
|
|
274
275
|
[]
|
|
275
276
|
), h = $(), p = $(), m = $(), u = D(() => o.filter((v) => v.pageIndex === t - 1), [o, t]), f = x(
|
|
276
277
|
(v, _, g = !1) => {
|
|
277
|
-
if (g &&
|
|
278
|
+
if (g && Xn(v, _), !u.length) {
|
|
278
279
|
m.current = void 0, c([]);
|
|
279
280
|
return;
|
|
280
281
|
}
|
|
281
|
-
const C =
|
|
282
|
+
const C = Jn(u, v, _);
|
|
282
283
|
c(C);
|
|
283
284
|
},
|
|
284
285
|
[u]
|
|
285
286
|
);
|
|
286
|
-
return
|
|
287
|
+
return z(() => {
|
|
287
288
|
var g;
|
|
288
|
-
if ((g = m.current) == null || g.classList.remove("selected"), !
|
|
289
|
+
if ((g = m.current) == null || g.classList.remove("selected"), !s.length || !i || i.pageIndex !== t - 1)
|
|
289
290
|
return;
|
|
290
291
|
const v = u.findIndex(
|
|
291
|
-
(C) => JSON.stringify(C) === JSON.stringify(
|
|
292
|
+
(C) => JSON.stringify(C) === JSON.stringify(i)
|
|
292
293
|
);
|
|
293
294
|
if (v === -1)
|
|
294
295
|
return;
|
|
295
|
-
const _ =
|
|
296
|
+
const _ = s.find((C) => C.index === v);
|
|
296
297
|
_ && (m.current = _.element, l(_.element), _.element.classList.add("selected"));
|
|
297
|
-
}, [
|
|
298
|
+
}, [i, s, u]), z(() => {
|
|
298
299
|
const v = n.get(t);
|
|
299
300
|
if (!(!v || !r.current))
|
|
300
301
|
return h.current && h.current.cancel(), v.page.getTextContent().then((_) => {
|
|
301
302
|
const g = v.page.getViewport({ scale: 1 });
|
|
302
|
-
return h.current = new
|
|
303
|
+
return h.current = new Qn.TextLayer({
|
|
303
304
|
viewport: g,
|
|
304
305
|
textContentSource: _,
|
|
305
306
|
container: r.current
|
|
@@ -307,7 +308,7 @@ import './assets/RPLayout.css';const oe = {
|
|
|
307
308
|
}).then(() => {
|
|
308
309
|
var C;
|
|
309
310
|
[].slice.call(r.current.children).forEach((y) => {
|
|
310
|
-
y.classList.add(
|
|
311
|
+
y.classList.add(Xe["rp-text-layer-text"]);
|
|
311
312
|
});
|
|
312
313
|
const g = (C = h.current) == null ? void 0 : C.textDivs;
|
|
313
314
|
g && p.current && f(p.current, g);
|
|
@@ -316,33 +317,33 @@ import './assets/RPLayout.css';const oe = {
|
|
|
316
317
|
var _;
|
|
317
318
|
(_ = h.current) == null || _.cancel();
|
|
318
319
|
};
|
|
319
|
-
}, [n, t]),
|
|
320
|
+
}, [n, t]), z(() => {
|
|
320
321
|
var g;
|
|
321
322
|
[].slice.call(r.current.children).forEach((C) => {
|
|
322
|
-
C.classList.add(
|
|
323
|
+
C.classList.add(Xe["rp-text-layer-text"]);
|
|
323
324
|
});
|
|
324
325
|
const _ = (g = h.current) == null ? void 0 : g.textDivs;
|
|
325
326
|
_ && p.current && f(p.current, _, !0);
|
|
326
|
-
}, [f]), /* @__PURE__ */
|
|
327
|
+
}, [f]), /* @__PURE__ */ a(
|
|
327
328
|
"div",
|
|
328
329
|
{
|
|
329
330
|
"data-rp": `page-${t}-textLayer`,
|
|
330
|
-
className:
|
|
331
|
+
className: Xe["rp-text-layer"],
|
|
331
332
|
ref: r
|
|
332
333
|
}
|
|
333
334
|
);
|
|
334
|
-
},
|
|
335
|
+
}, ro = {
|
|
335
336
|
"rp-annotation-layer": "_rp-annotation-layer_o0ksd_1"
|
|
336
|
-
},
|
|
337
|
-
let
|
|
338
|
-
const st = /* @__PURE__ */ new Map(),
|
|
339
|
-
function
|
|
340
|
-
const n =
|
|
337
|
+
}, rn = ["click", "dblclick", "mouseover", "input", "change"];
|
|
338
|
+
let oo = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
339
|
+
const st = /* @__PURE__ */ new Map(), on = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
|
|
340
|
+
function ao(e, t) {
|
|
341
|
+
const n = on(e, t);
|
|
341
342
|
return st.has(n) ? st.get(n) ?? null : null;
|
|
342
343
|
}
|
|
343
|
-
const
|
|
344
|
-
st.set(
|
|
345
|
-
},
|
|
344
|
+
const io = (e, t, n) => {
|
|
345
|
+
st.set(on(e, t), n);
|
|
346
|
+
}, Rt = (e, t) => {
|
|
346
347
|
switch (t[1].name) {
|
|
347
348
|
case "XYZ":
|
|
348
349
|
return {
|
|
@@ -376,29 +377,29 @@ const ro = (e, t, n) => {
|
|
|
376
377
|
};
|
|
377
378
|
}
|
|
378
379
|
};
|
|
379
|
-
async function
|
|
380
|
+
async function an(e, t) {
|
|
380
381
|
let n;
|
|
381
382
|
if (typeof t == "string" ? n = await e.getDestination(t) : n = t, n && typeof n[0] == "object" && n[0] !== null) {
|
|
382
|
-
const r = n[0], o =
|
|
383
|
+
const r = n[0], o = ao(e, r);
|
|
383
384
|
if (o === null) {
|
|
384
|
-
const
|
|
385
|
-
return
|
|
385
|
+
const i = await e.getPageIndex(r);
|
|
386
|
+
return io(e, r, i), await an(e, n);
|
|
386
387
|
} else
|
|
387
|
-
return
|
|
388
|
+
return Rt(o, n);
|
|
388
389
|
} else
|
|
389
|
-
return
|
|
390
|
+
return Rt(n[0], n);
|
|
390
391
|
}
|
|
391
|
-
function
|
|
392
|
-
const { id: t, url: n, unsafeUrl: r } = e, o = new MutationObserver((
|
|
392
|
+
function so(e) {
|
|
393
|
+
const { id: t, url: n, unsafeUrl: r } = e, o = new MutationObserver((i) => {
|
|
393
394
|
const l = document.querySelector(`[data-annotation-id="${t}"]`);
|
|
394
395
|
if (l) {
|
|
395
|
-
const
|
|
396
|
-
|
|
396
|
+
const s = l.querySelector("a"), c = Pr((n || r) ?? "", "");
|
|
397
|
+
s && (s.setAttribute("target", "_blank"), s.setAttribute("href", c), s.setAttribute("rel", "noopener noreferrer")), o.disconnect();
|
|
397
398
|
}
|
|
398
399
|
});
|
|
399
400
|
o.observe(document.body, { childList: !0, subtree: !0 });
|
|
400
401
|
}
|
|
401
|
-
const
|
|
402
|
+
const lo = (e) => {
|
|
402
403
|
const n = e.target.parentNode;
|
|
403
404
|
if (!n)
|
|
404
405
|
return;
|
|
@@ -407,11 +408,11 @@ const ao = (e) => {
|
|
|
407
408
|
n.querySelectorAll(
|
|
408
409
|
'[data-l10n-id="pdfjs-annotation-date-time-string"]'
|
|
409
410
|
).forEach((l) => {
|
|
410
|
-
const
|
|
411
|
-
if (
|
|
411
|
+
const s = l.getAttribute("data-l10n-args");
|
|
412
|
+
if (s)
|
|
412
413
|
try {
|
|
413
|
-
const { dateObj: c } = JSON.parse(
|
|
414
|
-
l.textContent =
|
|
414
|
+
const { dateObj: c } = JSON.parse(s);
|
|
415
|
+
l.textContent = it(c);
|
|
415
416
|
} catch {
|
|
416
417
|
}
|
|
417
418
|
});
|
|
@@ -425,52 +426,52 @@ const ao = (e) => {
|
|
|
425
426
|
attributes: !0
|
|
426
427
|
// Watch for changes to attributes
|
|
427
428
|
}), () => r.disconnect();
|
|
428
|
-
},
|
|
429
|
+
}, Mt = (e, t, n, r) => {
|
|
429
430
|
if (e.type !== "click")
|
|
430
431
|
return;
|
|
431
|
-
const o = e.target,
|
|
432
|
+
const o = e.target, i = o.getAttribute("data-element-id");
|
|
432
433
|
if (o.getAttribute("href"))
|
|
433
434
|
return;
|
|
434
|
-
const
|
|
435
|
-
!
|
|
435
|
+
const s = t.find((c) => c.id === i);
|
|
436
|
+
!s || s.annotationType !== at.Link || s.dest && an(n, s.dest).then((c) => {
|
|
436
437
|
console.log(">>> AnnotationLayer handleClick", c), r(c);
|
|
437
438
|
});
|
|
438
439
|
};
|
|
439
|
-
function
|
|
440
|
-
for (const n of
|
|
440
|
+
function co(e, t) {
|
|
441
|
+
for (const n of rn)
|
|
441
442
|
e.addEventListener(n, t);
|
|
442
443
|
}
|
|
443
|
-
function
|
|
444
|
-
for (const n of
|
|
444
|
+
function uo(e, t) {
|
|
445
|
+
for (const n of rn)
|
|
445
446
|
e.removeEventListener(n, t);
|
|
446
447
|
}
|
|
447
|
-
const
|
|
448
|
-
const { pageNumber: t } = e, n = $(null), { pages: r, pdf: o } =
|
|
449
|
-
|
|
448
|
+
const po = (e) => {
|
|
449
|
+
const { pageNumber: t } = e, n = $(null), { pages: r, pdf: o } = Y(), i = $(), [l, s] = F(), [c, h] = F(null), [p, m] = F(), { setFocusedPage: u, goToPage: f } = re(), { scrollMode: v } = Pe(), _ = D(() => r.get(t), [r, t]), g = D(() => _ == null ? void 0 : _.page.getViewport(), [_]);
|
|
450
|
+
z(() => {
|
|
450
451
|
o == null || o.hasJSActions().then((w) => {
|
|
451
|
-
|
|
452
|
+
s(w);
|
|
452
453
|
}), o == null || o.getFieldObjects().then((w) => {
|
|
453
454
|
h(w);
|
|
454
|
-
}),
|
|
455
|
+
}), i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
455
456
|
}, [o]);
|
|
456
457
|
const C = D(() => o == null ? void 0 : o.annotationStorage, [o]);
|
|
457
|
-
|
|
458
|
+
z(() => {
|
|
458
459
|
_ && _.page.getAnnotations().then((w) => {
|
|
459
|
-
|
|
460
|
+
i.current = void 0, m(w), n.current && (n.current.innerText = "");
|
|
460
461
|
});
|
|
461
462
|
}, [_]);
|
|
462
463
|
const y = x(
|
|
463
464
|
(w) => {
|
|
464
|
-
|
|
465
|
+
lo(w), !(!p || !o) && (v === Q.PAGE_SCROLLING ? Mt(w, p, o, (T) => u(T.pageIndex + 1)) : Mt(w, p, o, (T) => f(T.pageIndex + 1)));
|
|
465
466
|
},
|
|
466
467
|
[o, p, f, u, v]
|
|
467
468
|
);
|
|
468
|
-
return
|
|
469
|
+
return z(() => {
|
|
469
470
|
if (!_ || !p)
|
|
470
471
|
return;
|
|
471
472
|
const w = _.page.getViewport();
|
|
472
|
-
if (
|
|
473
|
-
|
|
473
|
+
if (i.current) {
|
|
474
|
+
i.current.update({
|
|
474
475
|
viewport: w.clone({ dontFlip: !0 })
|
|
475
476
|
});
|
|
476
477
|
return;
|
|
@@ -479,14 +480,14 @@ const lo = (e) => {
|
|
|
479
480
|
for (const T of p) {
|
|
480
481
|
const { annotationType: d } = T;
|
|
481
482
|
switch (d) {
|
|
482
|
-
case
|
|
483
|
-
|
|
483
|
+
case at.Link:
|
|
484
|
+
so(T);
|
|
484
485
|
break;
|
|
485
|
-
case
|
|
486
|
+
case at.Widget:
|
|
486
487
|
break;
|
|
487
488
|
}
|
|
488
489
|
}
|
|
489
|
-
|
|
490
|
+
i.current = new er({
|
|
490
491
|
div: n.current,
|
|
491
492
|
accessibilityManager: void 0,
|
|
492
493
|
annotationCanvasMap: void 0,
|
|
@@ -494,7 +495,7 @@ const lo = (e) => {
|
|
|
494
495
|
structTreeLayer: void 0,
|
|
495
496
|
page: _.page,
|
|
496
497
|
viewport: w.clone({ dontFlip: !0 })
|
|
497
|
-
}), n.current &&
|
|
498
|
+
}), n.current && uo(n.current, y), i.current.render({
|
|
498
499
|
annotations: p,
|
|
499
500
|
annotationStorage: C,
|
|
500
501
|
hasJSActions: l,
|
|
@@ -502,36 +503,36 @@ const lo = (e) => {
|
|
|
502
503
|
div: n.current,
|
|
503
504
|
viewport: w.clone({ dontFlip: !0 }),
|
|
504
505
|
page: _.page,
|
|
505
|
-
imageResourcesPath:
|
|
506
|
+
imageResourcesPath: oo,
|
|
506
507
|
renderForms: !1,
|
|
507
|
-
linkService: new
|
|
508
|
+
linkService: new Cr(),
|
|
508
509
|
downloadManager: null,
|
|
509
510
|
enableScripting: !1
|
|
510
511
|
}).then(() => {
|
|
511
|
-
n.current &&
|
|
512
|
+
n.current && co(n.current, y);
|
|
512
513
|
});
|
|
513
|
-
}, [p, l, c, y]), /* @__PURE__ */
|
|
514
|
+
}, [p, l, c, y]), /* @__PURE__ */ a(
|
|
514
515
|
"div",
|
|
515
516
|
{
|
|
516
517
|
"data-rp": `page-${t}-annotationLayer`,
|
|
517
518
|
style: { width: `${g == null ? void 0 : g.width}px`, height: `${g == null ? void 0 : g.height}px` },
|
|
518
|
-
className:
|
|
519
|
+
className: ro["rp-annotation-layer"],
|
|
519
520
|
ref: n
|
|
520
521
|
}
|
|
521
522
|
);
|
|
522
|
-
},
|
|
523
|
-
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...
|
|
523
|
+
}, ho = Array.from({ length: 21 }, (e, t) => Number((t * 0.05).toFixed(2))), wt = $e((e, t) => {
|
|
524
|
+
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...i } = e, { pages: l } = Y(), { rotate: s } = Ve(), { textLayer: c } = cr(), { currentZoom: h } = ht(), p = $(l.get(n)), [m, u] = F(!1), f = $(null), [v, _] = F({
|
|
524
525
|
width: 0,
|
|
525
526
|
height: 0
|
|
526
527
|
});
|
|
527
|
-
|
|
528
|
+
qt(t, () => f.current), z(() => {
|
|
528
529
|
if (l && (p.current = l.get(n), p.current)) {
|
|
529
|
-
const w = p.current.page.getViewport({ scale: h, rotation:
|
|
530
|
+
const w = p.current.page.getViewport({ scale: h, rotation: s });
|
|
530
531
|
_(w);
|
|
531
532
|
}
|
|
532
|
-
}, [l, n,
|
|
533
|
+
}, [l, n, s, h]);
|
|
533
534
|
const g = D(() => {
|
|
534
|
-
switch (
|
|
535
|
+
switch (s) {
|
|
535
536
|
case 90:
|
|
536
537
|
return `${v.width / 2}px ${v.width / 2}px`;
|
|
537
538
|
case -90:
|
|
@@ -540,35 +541,35 @@ const lo = (e) => {
|
|
|
540
541
|
default:
|
|
541
542
|
return "center";
|
|
542
543
|
}
|
|
543
|
-
}, [
|
|
544
|
+
}, [s, v]), C = x(() => {
|
|
544
545
|
u(!0);
|
|
545
546
|
}, []), y = x(() => {
|
|
546
547
|
u(!1);
|
|
547
548
|
}, []);
|
|
548
|
-
return
|
|
549
|
+
return z(() => {
|
|
549
550
|
const w = new IntersectionObserver(
|
|
550
551
|
(T) => {
|
|
551
552
|
o && o(n, T[0].intersectionRatio);
|
|
552
553
|
},
|
|
553
|
-
{ threshold:
|
|
554
|
+
{ threshold: ho }
|
|
554
555
|
);
|
|
555
556
|
return f.current && w.observe(f.current), () => {
|
|
556
557
|
w.disconnect(), o && o(n, -1);
|
|
557
558
|
};
|
|
558
|
-
}, [o, n,
|
|
559
|
+
}, [o, n, s]), /* @__PURE__ */ a(
|
|
559
560
|
"div",
|
|
560
561
|
{
|
|
561
562
|
ref: f,
|
|
562
563
|
id: `page-${n}`,
|
|
563
564
|
"data-rp": `page-${n}`,
|
|
564
|
-
...
|
|
565
|
+
...i,
|
|
565
566
|
style: {
|
|
566
567
|
...r,
|
|
567
|
-
"--rp-rotate": `${
|
|
568
|
+
"--rp-rotate": `${s}deg`,
|
|
568
569
|
"--rp-page-rotate-translate": `${g}`,
|
|
569
570
|
"--scale-factor": h
|
|
570
571
|
},
|
|
571
|
-
className:
|
|
572
|
+
className: Ke["rp-page-wrapper"],
|
|
572
573
|
children: /* @__PURE__ */ O(
|
|
573
574
|
"div",
|
|
574
575
|
{
|
|
@@ -576,66 +577,66 @@ const lo = (e) => {
|
|
|
576
577
|
width: `${v.width}px`,
|
|
577
578
|
height: `${v.height}px`
|
|
578
579
|
},
|
|
579
|
-
className:
|
|
580
|
+
className: Ke["rp-page"],
|
|
580
581
|
children: [
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
m && /* @__PURE__ */
|
|
583
|
-
c && /* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ a(Qr, { onLoading: C, onLoaded: y, pageNumber: n }),
|
|
583
|
+
m && /* @__PURE__ */ a("div", { className: Ke["rp-loader-wrapper"], children: /* @__PURE__ */ a(pt, {}) }),
|
|
584
|
+
c && /* @__PURE__ */ a(no, { pageNumber: n }),
|
|
585
|
+
/* @__PURE__ */ a(po, { pageNumber: n })
|
|
585
586
|
]
|
|
586
587
|
}
|
|
587
588
|
)
|
|
588
589
|
}
|
|
589
590
|
);
|
|
590
591
|
});
|
|
591
|
-
function
|
|
592
|
-
return
|
|
592
|
+
function lt() {
|
|
593
|
+
return lt = Object.assign ? Object.assign.bind() : function(e) {
|
|
593
594
|
for (var t = 1; t < arguments.length; t++) {
|
|
594
595
|
var n = arguments[t];
|
|
595
596
|
for (var r in n)
|
|
596
597
|
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
597
598
|
}
|
|
598
599
|
return e;
|
|
599
|
-
},
|
|
600
|
+
}, lt.apply(null, arguments);
|
|
600
601
|
}
|
|
601
|
-
function
|
|
602
|
+
function Lt(e) {
|
|
602
603
|
if (e === void 0)
|
|
603
604
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
604
605
|
return e;
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
-
return
|
|
607
|
+
function ct(e, t) {
|
|
608
|
+
return ct = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
608
609
|
return n.__proto__ = r, n;
|
|
609
|
-
},
|
|
610
|
+
}, ct(e, t);
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
-
e.prototype = Object.create(t.prototype), e.prototype.constructor = e,
|
|
612
|
+
function fo(e, t) {
|
|
613
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ct(e, t);
|
|
613
614
|
}
|
|
614
|
-
var
|
|
615
|
+
var Nt = Number.isNaN || function(t) {
|
|
615
616
|
return typeof t == "number" && t !== t;
|
|
616
617
|
};
|
|
617
|
-
function
|
|
618
|
-
return !!(e === t ||
|
|
618
|
+
function mo(e, t) {
|
|
619
|
+
return !!(e === t || Nt(e) && Nt(t));
|
|
619
620
|
}
|
|
620
|
-
function
|
|
621
|
+
function go(e, t) {
|
|
621
622
|
if (e.length !== t.length)
|
|
622
623
|
return !1;
|
|
623
624
|
for (var n = 0; n < e.length; n++)
|
|
624
|
-
if (!
|
|
625
|
+
if (!mo(e[n], t[n]))
|
|
625
626
|
return !1;
|
|
626
627
|
return !0;
|
|
627
628
|
}
|
|
628
|
-
function
|
|
629
|
-
t === void 0 && (t =
|
|
630
|
-
var n, r = [], o,
|
|
629
|
+
function Je(e, t) {
|
|
630
|
+
t === void 0 && (t = go);
|
|
631
|
+
var n, r = [], o, i = !1;
|
|
631
632
|
function l() {
|
|
632
|
-
for (var
|
|
633
|
-
|
|
634
|
-
return
|
|
633
|
+
for (var s = [], c = 0; c < arguments.length; c++)
|
|
634
|
+
s[c] = arguments[c];
|
|
635
|
+
return i && n === this && t(s, r) || (o = e.apply(this, s), i = !0, n = this, r = s), o;
|
|
635
636
|
}
|
|
636
637
|
return l;
|
|
637
638
|
}
|
|
638
|
-
function
|
|
639
|
+
function Et(e, t) {
|
|
639
640
|
if (e == null)
|
|
640
641
|
return {};
|
|
641
642
|
var n = {};
|
|
@@ -647,64 +648,64 @@ function Nt(e, t) {
|
|
|
647
648
|
}
|
|
648
649
|
return n;
|
|
649
650
|
}
|
|
650
|
-
var
|
|
651
|
+
var vo = typeof performance == "object" && typeof performance.now == "function", Ot = vo ? function() {
|
|
651
652
|
return performance.now();
|
|
652
653
|
} : function() {
|
|
653
654
|
return Date.now();
|
|
654
655
|
};
|
|
655
|
-
function
|
|
656
|
+
function Dt(e) {
|
|
656
657
|
cancelAnimationFrame(e.id);
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
-
var n =
|
|
659
|
+
function _o(e, t) {
|
|
660
|
+
var n = Ot();
|
|
660
661
|
function r() {
|
|
661
|
-
|
|
662
|
+
Ot() - n >= t ? e.call(null) : o.id = requestAnimationFrame(r);
|
|
662
663
|
}
|
|
663
664
|
var o = {
|
|
664
665
|
id: requestAnimationFrame(r)
|
|
665
666
|
};
|
|
666
667
|
return o;
|
|
667
668
|
}
|
|
668
|
-
var
|
|
669
|
-
function
|
|
670
|
-
if (e === void 0 && (e = !1),
|
|
669
|
+
var Ye = -1;
|
|
670
|
+
function wo(e) {
|
|
671
|
+
if (e === void 0 && (e = !1), Ye === -1 || e) {
|
|
671
672
|
var t = document.createElement("div"), n = t.style;
|
|
672
|
-
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t),
|
|
673
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), Ye = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
673
674
|
}
|
|
674
|
-
return
|
|
675
|
+
return Ye;
|
|
675
676
|
}
|
|
676
|
-
var
|
|
677
|
-
function
|
|
678
|
-
if (e === void 0 && (e = !1),
|
|
677
|
+
var be = null;
|
|
678
|
+
function At(e) {
|
|
679
|
+
if (e === void 0 && (e = !1), be === null || e) {
|
|
679
680
|
var t = document.createElement("div"), n = t.style;
|
|
680
681
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
681
682
|
var r = document.createElement("div"), o = r.style;
|
|
682
|
-
return o.width = "100px", o.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ?
|
|
683
|
+
return o.width = "100px", o.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? be = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? be = "negative" : be = "positive-ascending"), document.body.removeChild(t), be;
|
|
683
684
|
}
|
|
684
|
-
return
|
|
685
|
+
return be;
|
|
685
686
|
}
|
|
686
|
-
var
|
|
687
|
+
var bo = 150, Co = function(t) {
|
|
687
688
|
var n = t.columnIndex;
|
|
688
689
|
t.data;
|
|
689
690
|
var r = t.rowIndex;
|
|
690
691
|
return r + ":" + n;
|
|
691
|
-
},
|
|
692
|
-
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (
|
|
693
|
-
function
|
|
694
|
-
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex,
|
|
692
|
+
}, Ee = null, Oe = null, De = null;
|
|
693
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Ee = /* @__PURE__ */ new WeakSet(), Oe = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakSet());
|
|
694
|
+
function Po(e) {
|
|
695
|
+
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment, h = e.getOffsetForRowAndAlignment, p = e.getRowHeight, m = e.getRowOffset, u = e.getRowStartIndexForOffset, f = e.getRowStopIndexForStartIndex, v = e.initInstanceProps, _ = e.shouldResetStyleCacheOnItemSizeChange, g = e.validateProps;
|
|
695
696
|
return t = /* @__PURE__ */ function(C) {
|
|
696
|
-
|
|
697
|
+
fo(y, C);
|
|
697
698
|
function y(T) {
|
|
698
699
|
var d;
|
|
699
|
-
return d = C.call(this, T) || this, d._instanceProps = v(d.props,
|
|
700
|
-
instance:
|
|
700
|
+
return d = C.call(this, T) || this, d._instanceProps = v(d.props, Lt(d)), d._resetIsScrollingTimeoutId = null, d._outerRef = void 0, d.state = {
|
|
701
|
+
instance: Lt(d),
|
|
701
702
|
isScrolling: !1,
|
|
702
703
|
horizontalScrollDirection: "forward",
|
|
703
704
|
scrollLeft: typeof d.props.initialScrollLeft == "number" ? d.props.initialScrollLeft : 0,
|
|
704
705
|
scrollTop: typeof d.props.initialScrollTop == "number" ? d.props.initialScrollTop : 0,
|
|
705
706
|
scrollUpdateWasRequested: !1,
|
|
706
707
|
verticalScrollDirection: "forward"
|
|
707
|
-
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered =
|
|
708
|
+
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered = Je(function(S, b, P, N, I, M, L, R) {
|
|
708
709
|
return d.props.onItemsRendered({
|
|
709
710
|
overscanColumnStartIndex: S,
|
|
710
711
|
overscanColumnStopIndex: b,
|
|
@@ -715,7 +716,7 @@ function wo(e) {
|
|
|
715
716
|
visibleRowStartIndex: L,
|
|
716
717
|
visibleRowStopIndex: R
|
|
717
718
|
});
|
|
718
|
-
}), d._callOnScroll = void 0, d._callOnScroll =
|
|
719
|
+
}), d._callOnScroll = void 0, d._callOnScroll = Je(function(S, b, P, N, I) {
|
|
719
720
|
return d.props.onScroll({
|
|
720
721
|
horizontalScrollDirection: P,
|
|
721
722
|
scrollLeft: S,
|
|
@@ -728,27 +729,27 @@ function wo(e) {
|
|
|
728
729
|
if (L.hasOwnProperty(R))
|
|
729
730
|
E = L[R];
|
|
730
731
|
else {
|
|
731
|
-
var
|
|
732
|
+
var A = n(d.props, b, d._instanceProps), W = I === "rtl";
|
|
732
733
|
L[R] = E = {
|
|
733
734
|
position: "absolute",
|
|
734
|
-
left: W ? void 0 :
|
|
735
|
-
right: W ?
|
|
735
|
+
left: W ? void 0 : A,
|
|
736
|
+
right: W ? A : void 0,
|
|
736
737
|
top: m(d.props, S, d._instanceProps),
|
|
737
738
|
height: p(d.props, S, d._instanceProps),
|
|
738
|
-
width:
|
|
739
|
+
width: i(d.props, b, d._instanceProps)
|
|
739
740
|
};
|
|
740
741
|
}
|
|
741
742
|
return E;
|
|
742
|
-
}, d._getItemStyleCache = void 0, d._getItemStyleCache =
|
|
743
|
+
}, d._getItemStyleCache = void 0, d._getItemStyleCache = Je(function(S, b, P) {
|
|
743
744
|
return {};
|
|
744
745
|
}), d._onScroll = function(S) {
|
|
745
746
|
var b = S.currentTarget, P = b.clientHeight, N = b.clientWidth, I = b.scrollLeft, M = b.scrollTop, L = b.scrollHeight, R = b.scrollWidth;
|
|
746
747
|
d.setState(function(E) {
|
|
747
748
|
if (E.scrollLeft === I && E.scrollTop === M)
|
|
748
749
|
return null;
|
|
749
|
-
var
|
|
750
|
-
if (
|
|
751
|
-
switch (
|
|
750
|
+
var A = d.props.direction, W = I;
|
|
751
|
+
if (A === "rtl")
|
|
752
|
+
switch (At()) {
|
|
752
753
|
case "negative":
|
|
753
754
|
W = -I;
|
|
754
755
|
break;
|
|
@@ -771,7 +772,7 @@ function wo(e) {
|
|
|
771
772
|
var b = d.props.outerRef;
|
|
772
773
|
d._outerRef = S, typeof b == "function" ? b(S) : b != null && typeof b == "object" && b.hasOwnProperty("current") && (b.current = S);
|
|
773
774
|
}, d._resetIsScrollingDebounced = function() {
|
|
774
|
-
d._resetIsScrollingTimeoutId !== null &&
|
|
775
|
+
d._resetIsScrollingTimeoutId !== null && Dt(d._resetIsScrollingTimeoutId), d._resetIsScrollingTimeoutId = _o(d._resetIsScrolling, bo);
|
|
775
776
|
}, d._resetIsScrolling = function() {
|
|
776
777
|
d._resetIsScrollingTimeoutId = null, d.setState({
|
|
777
778
|
isScrolling: !1
|
|
@@ -781,7 +782,7 @@ function wo(e) {
|
|
|
781
782
|
}, d;
|
|
782
783
|
}
|
|
783
784
|
y.getDerivedStateFromProps = function(d, S) {
|
|
784
|
-
return
|
|
785
|
+
return So(d, S), g(d), null;
|
|
785
786
|
};
|
|
786
787
|
var w = y.prototype;
|
|
787
788
|
return w.scrollTo = function(d) {
|
|
@@ -796,12 +797,12 @@ function wo(e) {
|
|
|
796
797
|
};
|
|
797
798
|
}, this._resetIsScrollingDebounced);
|
|
798
799
|
}, w.scrollToItem = function(d) {
|
|
799
|
-
var S = d.align, b = S === void 0 ? "auto" : S, P = d.columnIndex, N = d.rowIndex, I = this.props, M = I.columnCount, L = I.height, R = I.rowCount, E = I.width,
|
|
800
|
+
var S = d.align, b = S === void 0 ? "auto" : S, P = d.columnIndex, N = d.rowIndex, I = this.props, M = I.columnCount, L = I.height, R = I.rowCount, E = I.width, A = this.state, W = A.scrollLeft, G = A.scrollTop, Z = wo();
|
|
800
801
|
P !== void 0 && (P = Math.max(0, Math.min(P, M - 1))), N !== void 0 && (N = Math.max(0, Math.min(N, R - 1)));
|
|
801
|
-
var U = l(this.props, this._instanceProps), K =
|
|
802
|
+
var U = l(this.props, this._instanceProps), K = s(this.props, this._instanceProps), ue = K > E ? Z : 0, oe = U > L ? Z : 0;
|
|
802
803
|
this.scrollTo({
|
|
803
|
-
scrollLeft: P !== void 0 ? c(this.props, P, b, W, this._instanceProps,
|
|
804
|
-
scrollTop: N !== void 0 ? h(this.props, N, b, G, this._instanceProps,
|
|
804
|
+
scrollLeft: P !== void 0 ? c(this.props, P, b, W, this._instanceProps, oe) : W,
|
|
805
|
+
scrollTop: N !== void 0 ? h(this.props, N, b, G, this._instanceProps, ue) : G
|
|
805
806
|
});
|
|
806
807
|
}, w.componentDidMount = function() {
|
|
807
808
|
var d = this.props, S = d.initialScrollLeft, b = d.initialScrollTop;
|
|
@@ -815,7 +816,7 @@ function wo(e) {
|
|
|
815
816
|
if (N && this._outerRef != null) {
|
|
816
817
|
var I = this._outerRef;
|
|
817
818
|
if (d === "rtl")
|
|
818
|
-
switch (
|
|
819
|
+
switch (At()) {
|
|
819
820
|
case "negative":
|
|
820
821
|
I.scrollLeft = -b;
|
|
821
822
|
break;
|
|
@@ -833,80 +834,80 @@ function wo(e) {
|
|
|
833
834
|
}
|
|
834
835
|
this._callPropsCallbacks();
|
|
835
836
|
}, w.componentWillUnmount = function() {
|
|
836
|
-
this._resetIsScrollingTimeoutId !== null &&
|
|
837
|
+
this._resetIsScrollingTimeoutId !== null && Dt(this._resetIsScrollingTimeoutId);
|
|
837
838
|
}, w.render = function() {
|
|
838
|
-
var d = this.props, S = d.children, b = d.className, P = d.columnCount, N = d.direction, I = d.height, M = d.innerRef, L = d.innerElementType, R = d.innerTagName, E = d.itemData,
|
|
839
|
+
var d = this.props, S = d.children, b = d.className, P = d.columnCount, N = d.direction, I = d.height, M = d.innerRef, L = d.innerElementType, R = d.innerTagName, E = d.itemData, A = d.itemKey, W = A === void 0 ? Co : A, G = d.outerElementType, Z = d.outerTagName, U = d.rowCount, K = d.style, ue = d.useIsScrolling, oe = d.width, ve = this.state.isScrolling, _e = this._getHorizontalRangeToRender(), Se = _e[0], k = _e[1], H = this._getVerticalRangeToRender(), q = H[0], le = H[1], Te = [];
|
|
839
840
|
if (P > 0 && U)
|
|
840
|
-
for (var
|
|
841
|
-
for (var
|
|
842
|
-
|
|
843
|
-
columnIndex:
|
|
841
|
+
for (var de = q; de <= le; de++)
|
|
842
|
+
for (var pe = Se; pe <= k; pe++)
|
|
843
|
+
Te.push(Ne(S, {
|
|
844
|
+
columnIndex: pe,
|
|
844
845
|
data: E,
|
|
845
|
-
isScrolling:
|
|
846
|
+
isScrolling: ue ? ve : void 0,
|
|
846
847
|
key: W({
|
|
847
|
-
columnIndex:
|
|
848
|
+
columnIndex: pe,
|
|
848
849
|
data: E,
|
|
849
|
-
rowIndex:
|
|
850
|
+
rowIndex: de
|
|
850
851
|
}),
|
|
851
|
-
rowIndex:
|
|
852
|
-
style: this._getItemStyle(
|
|
852
|
+
rowIndex: de,
|
|
853
|
+
style: this._getItemStyle(de, pe)
|
|
853
854
|
}));
|
|
854
|
-
var
|
|
855
|
-
return
|
|
855
|
+
var Ze = l(this.props, this._instanceProps), je = s(this.props, this._instanceProps);
|
|
856
|
+
return Ne(G || Z || "div", {
|
|
856
857
|
className: b,
|
|
857
858
|
onScroll: this._onScroll,
|
|
858
859
|
ref: this._outerRefSetter,
|
|
859
|
-
style:
|
|
860
|
+
style: lt({
|
|
860
861
|
position: "relative",
|
|
861
862
|
height: I,
|
|
862
|
-
width:
|
|
863
|
+
width: oe,
|
|
863
864
|
overflow: "auto",
|
|
864
865
|
WebkitOverflowScrolling: "touch",
|
|
865
866
|
willChange: "transform",
|
|
866
867
|
direction: N
|
|
867
868
|
}, K)
|
|
868
|
-
},
|
|
869
|
-
children:
|
|
869
|
+
}, Ne(L || R || "div", {
|
|
870
|
+
children: Te,
|
|
870
871
|
ref: M,
|
|
871
872
|
style: {
|
|
872
|
-
height:
|
|
873
|
-
pointerEvents:
|
|
874
|
-
width:
|
|
873
|
+
height: Ze,
|
|
874
|
+
pointerEvents: ve ? "none" : void 0,
|
|
875
|
+
width: je
|
|
875
876
|
}
|
|
876
877
|
}));
|
|
877
878
|
}, w._callPropsCallbacks = function() {
|
|
878
879
|
var d = this.props, S = d.columnCount, b = d.onItemsRendered, P = d.onScroll, N = d.rowCount;
|
|
879
880
|
if (typeof b == "function" && S > 0 && N > 0) {
|
|
880
|
-
var I = this._getHorizontalRangeToRender(), M = I[0], L = I[1], R = I[2], E = I[3],
|
|
881
|
+
var I = this._getHorizontalRangeToRender(), M = I[0], L = I[1], R = I[2], E = I[3], A = this._getVerticalRangeToRender(), W = A[0], G = A[1], Z = A[2], U = A[3];
|
|
881
882
|
this._callOnItemsRendered(M, L, W, G, R, E, Z, U);
|
|
882
883
|
}
|
|
883
884
|
if (typeof P == "function") {
|
|
884
|
-
var K = this.state,
|
|
885
|
-
this._callOnScroll(
|
|
885
|
+
var K = this.state, ue = K.horizontalScrollDirection, oe = K.scrollLeft, ve = K.scrollTop, _e = K.scrollUpdateWasRequested, Se = K.verticalScrollDirection;
|
|
886
|
+
this._callOnScroll(oe, ve, ue, Se, _e);
|
|
886
887
|
}
|
|
887
888
|
}, w._getHorizontalRangeToRender = function() {
|
|
888
|
-
var d = this.props, S = d.columnCount, b = d.overscanColumnCount, P = d.overscanColumnsCount, N = d.overscanCount, I = d.rowCount, M = this.state, L = M.horizontalScrollDirection, R = M.isScrolling, E = M.scrollLeft,
|
|
889
|
+
var d = this.props, S = d.columnCount, b = d.overscanColumnCount, P = d.overscanColumnsCount, N = d.overscanCount, I = d.rowCount, M = this.state, L = M.horizontalScrollDirection, R = M.isScrolling, E = M.scrollLeft, A = b || P || N || 1;
|
|
889
890
|
if (S === 0 || I === 0)
|
|
890
891
|
return [0, 0, 0, 0];
|
|
891
|
-
var W = r(this.props, E, this._instanceProps), G = o(this.props, W, E, this._instanceProps), Z = !R || L === "backward" ? Math.max(1,
|
|
892
|
+
var W = r(this.props, E, this._instanceProps), G = o(this.props, W, E, this._instanceProps), Z = !R || L === "backward" ? Math.max(1, A) : 1, U = !R || L === "forward" ? Math.max(1, A) : 1;
|
|
892
893
|
return [Math.max(0, W - Z), Math.max(0, Math.min(S - 1, G + U)), W, G];
|
|
893
894
|
}, w._getVerticalRangeToRender = function() {
|
|
894
|
-
var d = this.props, S = d.columnCount, b = d.overscanCount, P = d.overscanRowCount, N = d.overscanRowsCount, I = d.rowCount, M = this.state, L = M.isScrolling, R = M.verticalScrollDirection, E = M.scrollTop,
|
|
895
|
+
var d = this.props, S = d.columnCount, b = d.overscanCount, P = d.overscanRowCount, N = d.overscanRowsCount, I = d.rowCount, M = this.state, L = M.isScrolling, R = M.verticalScrollDirection, E = M.scrollTop, A = P || N || b || 1;
|
|
895
896
|
if (S === 0 || I === 0)
|
|
896
897
|
return [0, 0, 0, 0];
|
|
897
|
-
var W = u(this.props, E, this._instanceProps), G = f(this.props, W, E, this._instanceProps), Z = !L || R === "backward" ? Math.max(1,
|
|
898
|
+
var W = u(this.props, E, this._instanceProps), G = f(this.props, W, E, this._instanceProps), Z = !L || R === "backward" ? Math.max(1, A) : 1, U = !L || R === "forward" ? Math.max(1, A) : 1;
|
|
898
899
|
return [Math.max(0, W - Z), Math.max(0, Math.min(I - 1, G + U)), W, G];
|
|
899
900
|
}, y;
|
|
900
|
-
}(
|
|
901
|
+
}(zn), t.defaultProps = {
|
|
901
902
|
direction: "ltr",
|
|
902
903
|
itemData: void 0,
|
|
903
904
|
useIsScrolling: !1
|
|
904
905
|
}, t;
|
|
905
906
|
}
|
|
906
|
-
var
|
|
907
|
-
var r = t.children, o = t.direction,
|
|
907
|
+
var So = function(t, n) {
|
|
908
|
+
var r = t.children, o = t.direction, i = t.height, l = t.innerTagName, s = t.outerTagName, c = t.overscanColumnsCount, h = t.overscanCount, p = t.overscanRowsCount, m = t.width, u = n.instance;
|
|
908
909
|
if (process.env.NODE_ENV !== "production") {
|
|
909
|
-
if (typeof h == "number" &&
|
|
910
|
+
if (typeof h == "number" && Ee && !Ee.has(u) && (Ee.add(u), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof c == "number" || typeof p == "number") && Oe && !Oe.has(u) && (Oe.add(u), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || s != null) && De && !De.has(u) && (De.add(u), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
910
911
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
911
912
|
switch (o) {
|
|
912
913
|
case "ltr":
|
|
@@ -917,63 +918,63 @@ var bo = function(t, n) {
|
|
|
917
918
|
}
|
|
918
919
|
if (typeof m != "number")
|
|
919
920
|
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (m === null ? "null" : typeof m) + '" was specified.'));
|
|
920
|
-
if (typeof
|
|
921
|
-
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (
|
|
921
|
+
if (typeof i != "number")
|
|
922
|
+
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (i === null ? "null" : typeof i) + '" was specified.'));
|
|
922
923
|
}
|
|
923
|
-
},
|
|
924
|
-
var r = t.rowCount, o = n.rowMetadataMap,
|
|
924
|
+
}, zt = 50, sn = function(t, n) {
|
|
925
|
+
var r = t.rowCount, o = n.rowMetadataMap, i = n.estimatedRowHeight, l = n.lastMeasuredRowIndex, s = 0;
|
|
925
926
|
if (l >= r && (l = r - 1), l >= 0) {
|
|
926
927
|
var c = o[l];
|
|
927
|
-
|
|
928
|
+
s = c.offset + c.size;
|
|
928
929
|
}
|
|
929
|
-
var h = r - l - 1, p = h *
|
|
930
|
-
return
|
|
931
|
-
},
|
|
932
|
-
var r = t.columnCount, o = n.columnMetadataMap,
|
|
930
|
+
var h = r - l - 1, p = h * i;
|
|
931
|
+
return s + p;
|
|
932
|
+
}, ln = function(t, n) {
|
|
933
|
+
var r = t.columnCount, o = n.columnMetadataMap, i = n.estimatedColumnWidth, l = n.lastMeasuredColumnIndex, s = 0;
|
|
933
934
|
if (l >= r && (l = r - 1), l >= 0) {
|
|
934
935
|
var c = o[l];
|
|
935
|
-
|
|
936
|
+
s = c.offset + c.size;
|
|
936
937
|
}
|
|
937
|
-
var h = r - l - 1, p = h *
|
|
938
|
-
return
|
|
939
|
-
},
|
|
940
|
-
var
|
|
941
|
-
if (t === "column" ? (
|
|
938
|
+
var h = r - l - 1, p = h * i;
|
|
939
|
+
return s + p;
|
|
940
|
+
}, ie = function(t, n, r, o) {
|
|
941
|
+
var i, l, s;
|
|
942
|
+
if (t === "column" ? (i = o.columnMetadataMap, l = n.columnWidth, s = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, l = n.rowHeight, s = o.lastMeasuredRowIndex), r > s) {
|
|
942
943
|
var c = 0;
|
|
943
|
-
if (
|
|
944
|
-
var h =
|
|
944
|
+
if (s >= 0) {
|
|
945
|
+
var h = i[s];
|
|
945
946
|
c = h.offset + h.size;
|
|
946
947
|
}
|
|
947
|
-
for (var p =
|
|
948
|
+
for (var p = s + 1; p <= r; p++) {
|
|
948
949
|
var m = l(p);
|
|
949
|
-
|
|
950
|
+
i[p] = {
|
|
950
951
|
offset: c,
|
|
951
952
|
size: m
|
|
952
953
|
}, c += m;
|
|
953
954
|
}
|
|
954
955
|
t === "column" ? o.lastMeasuredColumnIndex = r : o.lastMeasuredRowIndex = r;
|
|
955
956
|
}
|
|
956
|
-
return
|
|
957
|
-
},
|
|
958
|
-
var
|
|
959
|
-
t === "column" ? (
|
|
960
|
-
var
|
|
961
|
-
return
|
|
962
|
-
},
|
|
963
|
-
for (;
|
|
964
|
-
var
|
|
957
|
+
return i[r];
|
|
958
|
+
}, Ft = function(t, n, r, o) {
|
|
959
|
+
var i, l;
|
|
960
|
+
t === "column" ? (i = r.columnMetadataMap, l = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, l = r.lastMeasuredRowIndex);
|
|
961
|
+
var s = l > 0 ? i[l].offset : 0;
|
|
962
|
+
return s >= o ? cn(t, n, r, l, 0, o) : To(t, n, r, Math.max(0, l), o);
|
|
963
|
+
}, cn = function(t, n, r, o, i, l) {
|
|
964
|
+
for (; i <= o; ) {
|
|
965
|
+
var s = i + Math.floor((o - i) / 2), c = ie(t, n, s, r).offset;
|
|
965
966
|
if (c === l)
|
|
966
|
-
return
|
|
967
|
-
c < l ?
|
|
967
|
+
return s;
|
|
968
|
+
c < l ? i = s + 1 : c > l && (o = s - 1);
|
|
968
969
|
}
|
|
969
|
-
return
|
|
970
|
-
},
|
|
971
|
-
for (var l = t === "column" ? n.columnCount : n.rowCount,
|
|
972
|
-
o +=
|
|
973
|
-
return
|
|
974
|
-
},
|
|
975
|
-
var c = t === "column" ? n.width : n.height, h =
|
|
976
|
-
switch (o === "smart" && (
|
|
970
|
+
return i > 0 ? i - 1 : 0;
|
|
971
|
+
}, To = function(t, n, r, o, i) {
|
|
972
|
+
for (var l = t === "column" ? n.columnCount : n.rowCount, s = 1; o < l && ie(t, n, o, r).offset < i; )
|
|
973
|
+
o += s, s *= 2;
|
|
974
|
+
return cn(t, n, r, Math.min(o, l - 1), Math.floor(o / 2), i);
|
|
975
|
+
}, kt = function(t, n, r, o, i, l, s) {
|
|
976
|
+
var c = t === "column" ? n.width : n.height, h = ie(t, n, r, l), p = t === "column" ? ln(n, l) : sn(n, l), m = Math.max(0, Math.min(p - c, h.offset)), u = Math.max(0, h.offset - c + s + h.size);
|
|
977
|
+
switch (o === "smart" && (i >= u - c && i <= m + c ? o = "auto" : o = "center"), o) {
|
|
977
978
|
case "start":
|
|
978
979
|
return m;
|
|
979
980
|
case "end":
|
|
@@ -982,66 +983,66 @@ var bo = function(t, n) {
|
|
|
982
983
|
return Math.round(u + (m - u) / 2);
|
|
983
984
|
case "auto":
|
|
984
985
|
default:
|
|
985
|
-
return
|
|
986
|
+
return i >= u && i <= m ? i : u > m || i < u ? u : m;
|
|
986
987
|
}
|
|
987
|
-
},
|
|
988
|
+
}, Io = /* @__PURE__ */ Po({
|
|
988
989
|
getColumnOffset: function(t, n, r) {
|
|
989
|
-
return
|
|
990
|
+
return ie("column", t, n, r).offset;
|
|
990
991
|
},
|
|
991
992
|
getColumnStartIndexForOffset: function(t, n, r) {
|
|
992
|
-
return
|
|
993
|
+
return Ft("column", t, r, n);
|
|
993
994
|
},
|
|
994
995
|
getColumnStopIndexForStartIndex: function(t, n, r, o) {
|
|
995
|
-
for (var
|
|
996
|
-
p++, h +=
|
|
996
|
+
for (var i = t.columnCount, l = t.width, s = ie("column", t, n, o), c = r + l, h = s.offset + s.size, p = n; p < i - 1 && h < c; )
|
|
997
|
+
p++, h += ie("column", t, p, o).size;
|
|
997
998
|
return p;
|
|
998
999
|
},
|
|
999
1000
|
getColumnWidth: function(t, n, r) {
|
|
1000
1001
|
return r.columnMetadataMap[n].size;
|
|
1001
1002
|
},
|
|
1002
|
-
getEstimatedTotalHeight:
|
|
1003
|
-
getEstimatedTotalWidth:
|
|
1004
|
-
getOffsetForColumnAndAlignment: function(t, n, r, o,
|
|
1005
|
-
return
|
|
1003
|
+
getEstimatedTotalHeight: sn,
|
|
1004
|
+
getEstimatedTotalWidth: ln,
|
|
1005
|
+
getOffsetForColumnAndAlignment: function(t, n, r, o, i, l) {
|
|
1006
|
+
return kt("column", t, n, r, o, i, l);
|
|
1006
1007
|
},
|
|
1007
|
-
getOffsetForRowAndAlignment: function(t, n, r, o,
|
|
1008
|
-
return
|
|
1008
|
+
getOffsetForRowAndAlignment: function(t, n, r, o, i, l) {
|
|
1009
|
+
return kt("row", t, n, r, o, i, l);
|
|
1009
1010
|
},
|
|
1010
1011
|
getRowOffset: function(t, n, r) {
|
|
1011
|
-
return
|
|
1012
|
+
return ie("row", t, n, r).offset;
|
|
1012
1013
|
},
|
|
1013
1014
|
getRowHeight: function(t, n, r) {
|
|
1014
1015
|
return r.rowMetadataMap[n].size;
|
|
1015
1016
|
},
|
|
1016
1017
|
getRowStartIndexForOffset: function(t, n, r) {
|
|
1017
|
-
return
|
|
1018
|
+
return Ft("row", t, r, n);
|
|
1018
1019
|
},
|
|
1019
1020
|
getRowStopIndexForStartIndex: function(t, n, r, o) {
|
|
1020
|
-
for (var
|
|
1021
|
-
p++, h +=
|
|
1021
|
+
for (var i = t.rowCount, l = t.height, s = ie("row", t, n, o), c = r + l, h = s.offset + s.size, p = n; p < i - 1 && h < c; )
|
|
1022
|
+
p++, h += ie("row", t, p, o).size;
|
|
1022
1023
|
return p;
|
|
1023
1024
|
},
|
|
1024
1025
|
initInstanceProps: function(t, n) {
|
|
1025
|
-
var r = t, o = r.estimatedColumnWidth,
|
|
1026
|
+
var r = t, o = r.estimatedColumnWidth, i = r.estimatedRowHeight, l = {
|
|
1026
1027
|
columnMetadataMap: {},
|
|
1027
|
-
estimatedColumnWidth: o ||
|
|
1028
|
-
estimatedRowHeight:
|
|
1028
|
+
estimatedColumnWidth: o || zt,
|
|
1029
|
+
estimatedRowHeight: i || zt,
|
|
1029
1030
|
lastMeasuredColumnIndex: -1,
|
|
1030
1031
|
lastMeasuredRowIndex: -1,
|
|
1031
1032
|
rowMetadataMap: {}
|
|
1032
1033
|
};
|
|
1033
|
-
return n.resetAfterColumnIndex = function(
|
|
1034
|
+
return n.resetAfterColumnIndex = function(s, c) {
|
|
1034
1035
|
c === void 0 && (c = !0), n.resetAfterIndices({
|
|
1035
|
-
columnIndex:
|
|
1036
|
+
columnIndex: s,
|
|
1036
1037
|
shouldForceUpdate: c
|
|
1037
1038
|
});
|
|
1038
|
-
}, n.resetAfterRowIndex = function(
|
|
1039
|
+
}, n.resetAfterRowIndex = function(s, c) {
|
|
1039
1040
|
c === void 0 && (c = !0), n.resetAfterIndices({
|
|
1040
|
-
rowIndex:
|
|
1041
|
+
rowIndex: s,
|
|
1041
1042
|
shouldForceUpdate: c
|
|
1042
1043
|
});
|
|
1043
|
-
}, n.resetAfterIndices = function(
|
|
1044
|
-
var c =
|
|
1044
|
+
}, n.resetAfterIndices = function(s) {
|
|
1045
|
+
var c = s.columnIndex, h = s.rowIndex, p = s.shouldForceUpdate, m = p === void 0 ? !0 : p;
|
|
1045
1046
|
typeof c == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, c - 1)), typeof h == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, h - 1)), n._getItemStyleCache(-1), m && n.forceUpdate();
|
|
1046
1047
|
}, l;
|
|
1047
1048
|
},
|
|
@@ -1057,7 +1058,7 @@ var bo = function(t, n) {
|
|
|
1057
1058
|
}
|
|
1058
1059
|
});
|
|
1059
1060
|
process.env.NODE_ENV;
|
|
1060
|
-
function
|
|
1061
|
+
function Wt(e, t) {
|
|
1061
1062
|
for (var n in e)
|
|
1062
1063
|
if (!(n in t))
|
|
1063
1064
|
return !0;
|
|
@@ -1066,64 +1067,64 @@ function kt(e, t) {
|
|
|
1066
1067
|
return !0;
|
|
1067
1068
|
return !1;
|
|
1068
1069
|
}
|
|
1069
|
-
var
|
|
1070
|
-
function
|
|
1071
|
-
var n = e.style, r =
|
|
1072
|
-
return !
|
|
1070
|
+
var yo = ["style"], xo = ["style"];
|
|
1071
|
+
function Ro(e, t) {
|
|
1072
|
+
var n = e.style, r = Et(e, yo), o = t.style, i = Et(t, xo);
|
|
1073
|
+
return !Wt(n, o) && !Wt(r, i);
|
|
1073
1074
|
}
|
|
1074
|
-
const
|
|
1075
|
-
const { viewMode: e } =
|
|
1075
|
+
const Mo = () => {
|
|
1076
|
+
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { setColumnCount: n } = Bt(), { virtualScrollableElementRef: r } = Ue(), o = Xt(), i = x(
|
|
1076
1077
|
(f) => o.widths[f] || 0,
|
|
1077
1078
|
[o]
|
|
1078
1079
|
), l = x(
|
|
1079
1080
|
(f) => o.heights[f] || 0,
|
|
1080
1081
|
[o]
|
|
1081
|
-
),
|
|
1082
|
-
|
|
1082
|
+
), s = D(() => o.heights.length, [o]), c = D(() => Math.max(...o.widths), [o]), h = D(() => t === Q.HORIZONTAL_SCROLLING ? s : e === ze.DUAL_PAGE ? 2 : 1, [e, t, t, s, r, c]);
|
|
1083
|
+
z(() => {
|
|
1083
1084
|
n(h);
|
|
1084
1085
|
}, [h, n]);
|
|
1085
|
-
const p = D(() => t ===
|
|
1086
|
+
const p = D(() => t === Q.HORIZONTAL_SCROLLING || t === Q.PAGE_SCROLLING ? 1 : Math.round(s / h), [h, s, t]), m = D(() => o.heights.reduce((f, v) => f + v, 0) / o.heights.length || 0, [o]), u = D(() => o.widths.reduce((f, v) => f + v, 0) / o.heights.length || 0, [o]);
|
|
1086
1087
|
return {
|
|
1087
1088
|
rowCount: p,
|
|
1088
1089
|
rowHeight: l,
|
|
1089
1090
|
columnCount: h,
|
|
1090
|
-
columnWidth:
|
|
1091
|
+
columnWidth: i,
|
|
1091
1092
|
pageDimension: o,
|
|
1092
1093
|
estimatedRowHeight: m,
|
|
1093
1094
|
estimatedColumnWidth: u
|
|
1094
1095
|
};
|
|
1095
1096
|
};
|
|
1096
|
-
let
|
|
1097
|
-
typeof window < "u" ?
|
|
1098
|
-
let
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1101
|
-
return
|
|
1102
|
-
}) : (
|
|
1103
|
-
|
|
1104
|
-
},
|
|
1105
|
-
const n =
|
|
1106
|
-
|
|
1107
|
-
}), r =
|
|
1108
|
-
|
|
1109
|
-
},
|
|
1097
|
+
let J;
|
|
1098
|
+
typeof window < "u" ? J = window : typeof self < "u" ? J = self : J = global;
|
|
1099
|
+
let ut = null, dt = null;
|
|
1100
|
+
const Ht = 20, Qe = J.clearTimeout, $t = J.setTimeout, et = J.cancelAnimationFrame || J.mozCancelAnimationFrame || J.webkitCancelAnimationFrame, Vt = J.requestAnimationFrame || J.mozRequestAnimationFrame || J.webkitRequestAnimationFrame;
|
|
1101
|
+
et == null || Vt == null ? (ut = Qe, dt = function(t) {
|
|
1102
|
+
return $t(t, Ht);
|
|
1103
|
+
}) : (ut = function([t, n]) {
|
|
1104
|
+
et(t), Qe(n);
|
|
1105
|
+
}, dt = function(t) {
|
|
1106
|
+
const n = Vt(function() {
|
|
1107
|
+
Qe(r), t();
|
|
1108
|
+
}), r = $t(function() {
|
|
1109
|
+
et(n), t();
|
|
1110
|
+
}, Ht);
|
|
1110
1111
|
return [n, r];
|
|
1111
1112
|
});
|
|
1112
|
-
function
|
|
1113
|
-
let t, n, r, o,
|
|
1113
|
+
function Lo(e) {
|
|
1114
|
+
let t, n, r, o, i, l, s;
|
|
1114
1115
|
const c = typeof document < "u" && document.attachEvent;
|
|
1115
1116
|
if (!c) {
|
|
1116
1117
|
l = function(C) {
|
|
1117
1118
|
const y = C.__resizeTriggers__, w = y.firstElementChild, T = y.lastElementChild, d = w.firstElementChild;
|
|
1118
1119
|
T.scrollLeft = T.scrollWidth, T.scrollTop = T.scrollHeight, d.style.width = w.offsetWidth + 1 + "px", d.style.height = w.offsetHeight + 1 + "px", w.scrollLeft = w.scrollWidth, w.scrollTop = w.scrollHeight;
|
|
1119
|
-
}, a = function(C) {
|
|
1120
|
-
return C.offsetWidth !== C.__resizeLast__.width || C.offsetHeight !== C.__resizeLast__.height;
|
|
1121
1120
|
}, i = function(C) {
|
|
1121
|
+
return C.offsetWidth !== C.__resizeLast__.width || C.offsetHeight !== C.__resizeLast__.height;
|
|
1122
|
+
}, s = function(C) {
|
|
1122
1123
|
if (C.target.className && typeof C.target.className.indexOf == "function" && C.target.className.indexOf("contract-trigger") < 0 && C.target.className.indexOf("expand-trigger") < 0)
|
|
1123
1124
|
return;
|
|
1124
1125
|
const y = this;
|
|
1125
|
-
l(this), this.__resizeRAF__ &&
|
|
1126
|
-
|
|
1126
|
+
l(this), this.__resizeRAF__ && ut(this.__resizeRAF__), this.__resizeRAF__ = dt(function() {
|
|
1127
|
+
i(y) && (y.__resizeLast__.width = y.offsetWidth, y.__resizeLast__.height = y.offsetHeight, y.__resizeListeners__.forEach(function(d) {
|
|
1127
1128
|
d.call(y, C);
|
|
1128
1129
|
}));
|
|
1129
1130
|
});
|
|
@@ -1156,12 +1157,12 @@ function xo(e) {
|
|
|
1156
1157
|
u.attachEvent("onresize", f);
|
|
1157
1158
|
else {
|
|
1158
1159
|
if (!u.__resizeTriggers__) {
|
|
1159
|
-
const v = u.ownerDocument, _ =
|
|
1160
|
+
const v = u.ownerDocument, _ = J.getComputedStyle(u);
|
|
1160
1161
|
_ && _.position === "static" && (u.style.position = "relative"), h(v), u.__resizeLast__ = {}, u.__resizeListeners__ = [], (u.__resizeTriggers__ = v.createElement("div")).className = "resize-triggers";
|
|
1161
1162
|
const g = v.createElement("div");
|
|
1162
1163
|
g.className = "expand-trigger", g.appendChild(v.createElement("div"));
|
|
1163
1164
|
const C = v.createElement("div");
|
|
1164
|
-
C.className = "contract-trigger", u.__resizeTriggers__.appendChild(g), u.__resizeTriggers__.appendChild(C), u.appendChild(u.__resizeTriggers__), l(u), u.addEventListener("scroll",
|
|
1165
|
+
C.className = "contract-trigger", u.__resizeTriggers__.appendChild(g), u.__resizeTriggers__.appendChild(C), u.appendChild(u.__resizeTriggers__), l(u), u.addEventListener("scroll", s, !0), r && (u.__resizeTriggers__.__animationListener__ = function(w) {
|
|
1165
1166
|
w.animationName === n && l(u);
|
|
1166
1167
|
}, u.__resizeTriggers__.addEventListener(r, u.__resizeTriggers__.__animationListener__));
|
|
1167
1168
|
}
|
|
@@ -1172,7 +1173,7 @@ function xo(e) {
|
|
|
1172
1173
|
if (c)
|
|
1173
1174
|
u.detachEvent("onresize", f);
|
|
1174
1175
|
else if (u.__resizeListeners__.splice(u.__resizeListeners__.indexOf(f), 1), !u.__resizeListeners__.length) {
|
|
1175
|
-
u.removeEventListener("scroll",
|
|
1176
|
+
u.removeEventListener("scroll", s, !0), u.__resizeTriggers__.__animationListener__ && (u.__resizeTriggers__.removeEventListener(r, u.__resizeTriggers__.__animationListener__), u.__resizeTriggers__.__animationListener__ = null);
|
|
1176
1177
|
try {
|
|
1177
1178
|
u.__resizeTriggers__ = !u.removeChild(u.__resizeTriggers__);
|
|
1178
1179
|
} catch {
|
|
@@ -1181,7 +1182,7 @@ function xo(e) {
|
|
|
1181
1182
|
}
|
|
1182
1183
|
};
|
|
1183
1184
|
}
|
|
1184
|
-
class
|
|
1185
|
+
class No extends Fn {
|
|
1185
1186
|
constructor(...t) {
|
|
1186
1187
|
super(...t), this.state = {
|
|
1187
1188
|
height: this.props.defaultHeight || 0,
|
|
@@ -1196,7 +1197,7 @@ class Ro extends Dn {
|
|
|
1196
1197
|
onResize: o
|
|
1197
1198
|
} = this.props;
|
|
1198
1199
|
if (this._parentNode) {
|
|
1199
|
-
const
|
|
1200
|
+
const i = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(i.paddingLeft || "0"), s = parseFloat(i.paddingRight || "0"), c = parseFloat(i.paddingTop || "0"), h = parseFloat(i.paddingBottom || "0"), p = this._parentNode.getBoundingClientRect(), m = p.height - c - h, u = p.width - l - s, f = this._parentNode.offsetHeight - c - h, v = this._parentNode.offsetWidth - l - s;
|
|
1200
1201
|
(!n && (this.state.height !== f || this.state.scaledHeight !== m) || !r && (this.state.width !== v || this.state.scaledWidth !== u)) && (this.setState({
|
|
1201
1202
|
height: f,
|
|
1202
1203
|
width: v,
|
|
@@ -1222,7 +1223,7 @@ class Ro extends Dn {
|
|
|
1222
1223
|
const r = n.ownerDocument.defaultView.ResizeObserver;
|
|
1223
1224
|
r != null ? (this._resizeObserver = new r(() => {
|
|
1224
1225
|
this._timeoutId = setTimeout(this._onResize, 0);
|
|
1225
|
-
}), this._resizeObserver.observe(n)) : (this._detectElementResize =
|
|
1226
|
+
}), this._resizeObserver.observe(n)) : (this._detectElementResize = Lo(t), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
|
|
1226
1227
|
}
|
|
1227
1228
|
}
|
|
1228
1229
|
componentWillUnmount() {
|
|
@@ -1234,9 +1235,9 @@ class Ro extends Dn {
|
|
|
1234
1235
|
defaultHeight: n,
|
|
1235
1236
|
defaultWidth: r,
|
|
1236
1237
|
disableHeight: o = !1,
|
|
1237
|
-
disableWidth:
|
|
1238
|
+
disableWidth: i = !1,
|
|
1238
1239
|
doNotBailOutOnEmptyChildren: l = !1,
|
|
1239
|
-
nonce:
|
|
1240
|
+
nonce: s,
|
|
1240
1241
|
onResize: c,
|
|
1241
1242
|
style: h = {},
|
|
1242
1243
|
tagName: p = "div",
|
|
@@ -1250,7 +1251,7 @@ class Ro extends Dn {
|
|
|
1250
1251
|
overflow: "visible"
|
|
1251
1252
|
}, C = {};
|
|
1252
1253
|
let y = !1;
|
|
1253
|
-
return o || (u === 0 && (y = !0), g.height = 0, C.height = u, C.scaledHeight = f),
|
|
1254
|
+
return o || (u === 0 && (y = !0), g.height = 0, C.height = u, C.scaledHeight = f), i || (_ === 0 && (y = !0), g.width = 0, C.width = _, C.scaledWidth = v), l && (y = !1), Ne(p, {
|
|
1254
1255
|
ref: this._setRef,
|
|
1255
1256
|
style: {
|
|
1256
1257
|
...g,
|
|
@@ -1260,8 +1261,8 @@ class Ro extends Dn {
|
|
|
1260
1261
|
}, !y && t(C));
|
|
1261
1262
|
}
|
|
1262
1263
|
}
|
|
1263
|
-
const
|
|
1264
|
-
const [t, n] = F(e), [r, o] = F(0), { scrollToPage:
|
|
1264
|
+
const Eo = (e = 1) => {
|
|
1265
|
+
const [t, n] = F(e), [r, o] = F(0), { scrollToPage: i } = _t(), l = $(1), { isScrolling: s } = Kt(), { viewMode: c } = Ge(), { scrollMode: h } = Pe(), p = yr(t, 100), m = x(
|
|
1265
1266
|
(g) => {
|
|
1266
1267
|
if (!/^[0-9]*$/g.test(g.toString()) || !g)
|
|
1267
1268
|
return { success: !1, currentPage: l.current };
|
|
@@ -1272,9 +1273,9 @@ const Mo = (e = 1) => {
|
|
|
1272
1273
|
), u = x(m, [m]), f = x(
|
|
1273
1274
|
(g) => {
|
|
1274
1275
|
const C = m(g);
|
|
1275
|
-
return C.success && (
|
|
1276
|
+
return C.success && (s.current = !0, i(C.currentPage)), C;
|
|
1276
1277
|
},
|
|
1277
|
-
[m,
|
|
1278
|
+
[m, i]
|
|
1278
1279
|
), v = x(() => {
|
|
1279
1280
|
let g = t - 1;
|
|
1280
1281
|
f(g);
|
|
@@ -1291,7 +1292,7 @@ const Mo = (e = 1) => {
|
|
|
1291
1292
|
prevPage: v,
|
|
1292
1293
|
goToPage: f
|
|
1293
1294
|
};
|
|
1294
|
-
},
|
|
1295
|
+
}, un = We({
|
|
1295
1296
|
focusedPage: 0,
|
|
1296
1297
|
setFocusedPage: (e) => {
|
|
1297
1298
|
},
|
|
@@ -1303,41 +1304,41 @@ const Mo = (e = 1) => {
|
|
|
1303
1304
|
},
|
|
1304
1305
|
nextPage: () => {
|
|
1305
1306
|
}
|
|
1306
|
-
}),
|
|
1307
|
-
const e =
|
|
1308
|
-
return typeof (e == null ? void 0 : e.focusedPage) > "u" &&
|
|
1309
|
-
},
|
|
1310
|
-
const { initialPage: t = 1 } =
|
|
1311
|
-
return
|
|
1307
|
+
}), re = () => {
|
|
1308
|
+
const e = He(un);
|
|
1309
|
+
return typeof (e == null ? void 0 : e.focusedPage) > "u" && xr.error("Please use this hooks inside children component of RPController or RPLayout"), e;
|
|
1310
|
+
}, Oo = ({ children: e }) => {
|
|
1311
|
+
const { initialPage: t = 1 } = gr(), { pdf: n } = Y(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: l, goToPage: s, nextPage: c, prevPage: h } = Eo(t);
|
|
1312
|
+
return z(() => {
|
|
1312
1313
|
n != null && n.numPages && l(n.numPages);
|
|
1313
|
-
}, [n, l, o, t]),
|
|
1314
|
+
}, [n, l, o, t]), z(() => {
|
|
1314
1315
|
requestAnimationFrame(() => {
|
|
1315
|
-
|
|
1316
|
+
s(t);
|
|
1316
1317
|
});
|
|
1317
|
-
}, [
|
|
1318
|
-
|
|
1318
|
+
}, [s, t]), /* @__PURE__ */ a(
|
|
1319
|
+
un.Provider,
|
|
1319
1320
|
{
|
|
1320
1321
|
value: {
|
|
1321
1322
|
focusedPage: r,
|
|
1322
1323
|
totalPages: o,
|
|
1323
|
-
setFocusedPage:
|
|
1324
|
+
setFocusedPage: i,
|
|
1324
1325
|
setTotalPages: l,
|
|
1325
1326
|
nextPage: c,
|
|
1326
1327
|
prevPage: h,
|
|
1327
|
-
goToPage:
|
|
1328
|
+
goToPage: s
|
|
1328
1329
|
},
|
|
1329
1330
|
children: e
|
|
1330
1331
|
}
|
|
1331
1332
|
);
|
|
1332
|
-
},
|
|
1333
|
-
const { focusedPage: n, totalPages: r } =
|
|
1334
|
-
const
|
|
1335
|
-
if (
|
|
1333
|
+
}, Do = ({ widths: e, heights: t }) => {
|
|
1334
|
+
const { focusedPage: n, totalPages: r } = re(), o = D(() => {
|
|
1335
|
+
const s = [], c = Math.ceil(n / 2) * 2 - 1;
|
|
1336
|
+
if (s.push(c), c + 1 < r) {
|
|
1336
1337
|
const h = c + 1;
|
|
1337
|
-
|
|
1338
|
+
s.push(h);
|
|
1338
1339
|
}
|
|
1339
|
-
return
|
|
1340
|
-
}, [n, r]),
|
|
1340
|
+
return s;
|
|
1341
|
+
}, [n, r]), i = D(() => [
|
|
1341
1342
|
{
|
|
1342
1343
|
position: "absolute",
|
|
1343
1344
|
left: 0,
|
|
@@ -1351,28 +1352,28 @@ const Mo = (e = 1) => {
|
|
|
1351
1352
|
width: e(n),
|
|
1352
1353
|
height: t(n)
|
|
1353
1354
|
}
|
|
1354
|
-
], [e, t, o]), l = D(() =>
|
|
1355
|
-
return /* @__PURE__ */
|
|
1356
|
-
},
|
|
1357
|
-
const { focusedPage: n } =
|
|
1355
|
+
], [e, t, o]), l = D(() => i.reduce((s, c) => s + Number(c.width || 0), 0), [i]);
|
|
1356
|
+
return /* @__PURE__ */ a("div", { style: { width: l, position: "relative" }, children: o.map((s, c) => /* @__PURE__ */ a(wt, { style: i[c], pageNumber: s }, s)) });
|
|
1357
|
+
}, Ao = ({ widths: e, heights: t }) => {
|
|
1358
|
+
const { focusedPage: n } = re(), r = D(() => ({
|
|
1358
1359
|
position: "absolute",
|
|
1359
1360
|
width: e(n - 1),
|
|
1360
1361
|
height: t(n - 1)
|
|
1361
1362
|
}), [e, t, n]), o = D(() => e(n - 1), [e]);
|
|
1362
|
-
return /* @__PURE__ */
|
|
1363
|
+
return /* @__PURE__ */ a(
|
|
1363
1364
|
"div",
|
|
1364
1365
|
{
|
|
1365
1366
|
style: {
|
|
1366
1367
|
width: o,
|
|
1367
1368
|
position: "relative"
|
|
1368
1369
|
},
|
|
1369
|
-
children: /* @__PURE__ */
|
|
1370
|
+
children: /* @__PURE__ */ a(wt, { style: r, pageNumber: n }, n)
|
|
1370
1371
|
}
|
|
1371
1372
|
);
|
|
1372
|
-
},
|
|
1373
|
+
}, zo = kn(({ columnIndex: e, rowIndex: t, data: n, style: r }) => {
|
|
1373
1374
|
const o = D(() => e + 1 + t * n.columnCount, [e, t, n]);
|
|
1374
|
-
return /* @__PURE__ */
|
|
1375
|
-
|
|
1375
|
+
return /* @__PURE__ */ a(
|
|
1376
|
+
wt,
|
|
1376
1377
|
{
|
|
1377
1378
|
style: r,
|
|
1378
1379
|
onIntersectRatioChange: n.handleIntersectRatioChange,
|
|
@@ -1380,21 +1381,21 @@ const Mo = (e = 1) => {
|
|
|
1380
1381
|
},
|
|
1381
1382
|
o
|
|
1382
1383
|
);
|
|
1383
|
-
},
|
|
1384
|
-
const { getContainer: e, container: t } =
|
|
1384
|
+
}, Ro), es = () => {
|
|
1385
|
+
const { getContainer: e, container: t } = Sr(), { scrollToPage: n } = _t(), {
|
|
1385
1386
|
virtualScrollRef: r,
|
|
1386
1387
|
getVirtualScrollRef: o,
|
|
1387
|
-
getPageScrollElementRef:
|
|
1388
|
+
getPageScrollElementRef: i,
|
|
1388
1389
|
getVirtualScrollableElementRef: l,
|
|
1389
|
-
setTotalInnerDimensions:
|
|
1390
|
+
setTotalInnerDimensions: s,
|
|
1390
1391
|
totalInnerDimensions: c
|
|
1391
|
-
} =
|
|
1392
|
+
} = Ue(), { nextPage: h, prevPage: p, setFocusedPage: m, focusedPage: u } = re(), { scrollMode: f } = Pe(), { viewMode: v } = Ge(), _ = $(null), g = $({
|
|
1392
1393
|
height: 0,
|
|
1393
1394
|
width: 0
|
|
1394
1395
|
}), C = $({
|
|
1395
1396
|
viewMode: v,
|
|
1396
1397
|
scrollMode: f
|
|
1397
|
-
}), { isFullScreen: y } =
|
|
1398
|
+
}), { isFullScreen: y } = _r(), {
|
|
1398
1399
|
pageDimension: w,
|
|
1399
1400
|
rowCount: T,
|
|
1400
1401
|
rowHeight: d,
|
|
@@ -1402,33 +1403,33 @@ const Mo = (e = 1) => {
|
|
|
1402
1403
|
columnWidth: b,
|
|
1403
1404
|
estimatedColumnWidth: P,
|
|
1404
1405
|
estimatedRowHeight: N
|
|
1405
|
-
} =
|
|
1406
|
+
} = Mo(), [I, M] = F({}), { isScrolling: L } = Kt(), R = $(), E = $({
|
|
1406
1407
|
scrollTop: 0,
|
|
1407
1408
|
scrollLeft: 0
|
|
1408
|
-
}), { isPressed:
|
|
1409
|
-
isPressed:
|
|
1410
|
-
}), U = D(() => W ===
|
|
1409
|
+
}), { isPressed: A } = Tr(), { selectionMode: W } = fr(), { initializeGrabScroll: G, scrollBehavior: Z } = Ir({
|
|
1410
|
+
isPressed: A
|
|
1411
|
+
}), U = D(() => W === jt.HAND, [W]), K = x((k, H) => {
|
|
1411
1412
|
M((q) => ({ ...q, [k]: Math.round(H * 100) }));
|
|
1412
|
-
}, []),
|
|
1413
|
+
}, []), ue = D(() => ({
|
|
1413
1414
|
columnCount: S,
|
|
1414
1415
|
handleIntersectRatioChange: K
|
|
1415
|
-
}), [S, K]),
|
|
1416
|
+
}), [S, K]), oe = x(
|
|
1416
1417
|
(k) => {
|
|
1417
1418
|
const H = document.activeElement !== t;
|
|
1418
1419
|
!y && H || (["ArrowUp", "ArrowLeft"].includes(k.key) ? (k.preventDefault(), p()) : ["ArrowDown", "ArrowRight"].includes(k.key) && (k.preventDefault(), h()));
|
|
1419
1420
|
},
|
|
1420
1421
|
[h, p, y, f]
|
|
1421
|
-
),
|
|
1422
|
+
), ve = x((k) => {
|
|
1422
1423
|
E.current = {
|
|
1423
1424
|
scrollTop: k.scrollTop,
|
|
1424
1425
|
scrollLeft: k.scrollLeft
|
|
1425
1426
|
};
|
|
1426
1427
|
}, []);
|
|
1427
|
-
|
|
1428
|
-
window.removeEventListener("keydown",
|
|
1429
|
-
}), [
|
|
1428
|
+
z(() => (window.addEventListener("keydown", oe), () => {
|
|
1429
|
+
window.removeEventListener("keydown", oe);
|
|
1430
|
+
}), [oe]), z(() => {
|
|
1430
1431
|
if (_.current && (_.current.style.position = "relative"), !!r) {
|
|
1431
|
-
g.current = c,
|
|
1432
|
+
g.current = c, s({
|
|
1432
1433
|
height: Array.from({ length: T }).reduce(
|
|
1433
1434
|
(k, H, q) => k + d(q),
|
|
1434
1435
|
0
|
|
@@ -1446,11 +1447,11 @@ const Mo = (e = 1) => {
|
|
|
1446
1447
|
shouldForceUpdate: !0
|
|
1447
1448
|
});
|
|
1448
1449
|
}
|
|
1449
|
-
}, [T, S, w, r, n]),
|
|
1450
|
+
}, [T, S, w, r, n]), z(() => {
|
|
1450
1451
|
if (L.current)
|
|
1451
1452
|
return;
|
|
1452
1453
|
if (C.current.viewMode !== v || C.current.scrollMode !== f) {
|
|
1453
|
-
R.current && clearTimeout(R.current), M({}), n(u), f ===
|
|
1454
|
+
R.current && clearTimeout(R.current), M({}), n(u), f === Q.HORIZONTAL_SCROLLING && (r == null || r.scrollTo({
|
|
1454
1455
|
scrollTop: 0
|
|
1455
1456
|
})), R.current = setTimeout(() => {
|
|
1456
1457
|
requestAnimationFrame(() => {
|
|
@@ -1461,59 +1462,59 @@ const Mo = (e = 1) => {
|
|
|
1461
1462
|
}
|
|
1462
1463
|
const H = E.current.scrollTop, q = E.current.scrollLeft;
|
|
1463
1464
|
if (c.height !== 0 && c.width !== 0) {
|
|
1464
|
-
const { height:
|
|
1465
|
+
const { height: le, width: Te } = c, { height: de, width: pe } = g.current, Ze = H / de * le, je = q / pe * Te, Dn = Math.min(Ze, le) || 0, An = Math.min(je, Te) || 0;
|
|
1465
1466
|
r == null || r.scrollTo({
|
|
1466
|
-
scrollTop:
|
|
1467
|
-
scrollLeft:
|
|
1467
|
+
scrollTop: Dn,
|
|
1468
|
+
scrollLeft: An
|
|
1468
1469
|
});
|
|
1469
1470
|
}
|
|
1470
|
-
}, [c, v, f]),
|
|
1471
|
+
}, [c, v, f]), z(() => {
|
|
1471
1472
|
const k = Object.entries(I);
|
|
1472
1473
|
if (L.current) {
|
|
1473
1474
|
L.current && (L.current = !1);
|
|
1474
1475
|
return;
|
|
1475
1476
|
}
|
|
1476
1477
|
let H = 0, q = -1;
|
|
1477
|
-
k.forEach((
|
|
1478
|
-
q <
|
|
1478
|
+
k.forEach((le) => {
|
|
1479
|
+
q < le[1] && (H = Number(le[0]), q = le[1]);
|
|
1479
1480
|
}), H && m(H);
|
|
1480
|
-
}, [I, m]),
|
|
1481
|
+
}, [I, m]), z(() => () => {
|
|
1481
1482
|
R.current && clearTimeout(R.current);
|
|
1482
1483
|
}, []);
|
|
1483
|
-
const
|
|
1484
|
-
[
|
|
1485
|
-
[
|
|
1486
|
-
}), [U,
|
|
1484
|
+
const _e = D(() => j(ae["rp-pages-container"], {
|
|
1485
|
+
[ae["rp-cursor-grab"]]: U && !A,
|
|
1486
|
+
[ae["rp-cursor-grabbing"]]: U && A
|
|
1487
|
+
}), [U, A]), Se = x(
|
|
1487
1488
|
(k) => {
|
|
1488
1489
|
if (U && k) {
|
|
1489
|
-
const H = j(
|
|
1490
|
+
const H = j(ae["rp-pages"]), q = document.querySelector(`.${H}`);
|
|
1490
1491
|
G(q);
|
|
1491
1492
|
}
|
|
1492
1493
|
},
|
|
1493
|
-
[U, G,
|
|
1494
|
+
[U, G, ae]
|
|
1494
1495
|
);
|
|
1495
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ a("div", { ref: e, tabIndex: -1, className: _e, children: /* @__PURE__ */ a(No, { children: ({ width: k, height: H }) => /* @__PURE__ */ a(
|
|
1496
1497
|
"div",
|
|
1497
1498
|
{
|
|
1498
1499
|
"data-rp": "pagesWrapper",
|
|
1499
|
-
ref:
|
|
1500
|
+
ref: Se,
|
|
1500
1501
|
style: { width: k, height: H, scrollBehavior: Z },
|
|
1501
|
-
children: f ===
|
|
1502
|
+
children: f === Q.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
1502
1503
|
"div",
|
|
1503
1504
|
{
|
|
1504
|
-
ref:
|
|
1505
|
+
ref: i,
|
|
1505
1506
|
style: { width: k, height: H },
|
|
1506
|
-
className: j(
|
|
1507
|
-
children: v ===
|
|
1507
|
+
className: j(ae["rp-pages"], ae["rp-page-scrolling-wrapper"]),
|
|
1508
|
+
children: v === ze.DUAL_PAGE ? /* @__PURE__ */ a(Do, { widths: b, heights: d }) : /* @__PURE__ */ a(Ao, { widths: b, heights: d })
|
|
1508
1509
|
}
|
|
1509
|
-
) : P ? /* @__PURE__ */
|
|
1510
|
-
|
|
1510
|
+
) : P ? /* @__PURE__ */ a(
|
|
1511
|
+
Io,
|
|
1511
1512
|
{
|
|
1512
1513
|
ref: o,
|
|
1513
|
-
itemData:
|
|
1514
|
+
itemData: ue,
|
|
1514
1515
|
outerRef: l,
|
|
1515
1516
|
innerRef: _,
|
|
1516
|
-
onScroll:
|
|
1517
|
+
onScroll: ve,
|
|
1517
1518
|
columnCount: S,
|
|
1518
1519
|
columnWidth: b,
|
|
1519
1520
|
rowHeight: d,
|
|
@@ -1523,101 +1524,101 @@ const Mo = (e = 1) => {
|
|
|
1523
1524
|
estimatedRowHeight: N,
|
|
1524
1525
|
rowCount: T,
|
|
1525
1526
|
className: j(
|
|
1526
|
-
|
|
1527
|
-
f ===
|
|
1527
|
+
ae["rp-pages"],
|
|
1528
|
+
f === Q.HORIZONTAL_SCROLLING ? ae["rp-pages-horizontal-scroll"] : ""
|
|
1528
1529
|
),
|
|
1529
1530
|
style: { scrollBehavior: Z },
|
|
1530
|
-
children:
|
|
1531
|
+
children: zo
|
|
1531
1532
|
}
|
|
1532
1533
|
) : null
|
|
1533
1534
|
}
|
|
1534
1535
|
) }) });
|
|
1535
|
-
},
|
|
1536
|
+
}, Ie = {
|
|
1536
1537
|
"rp-toolbar-content": "_rp-toolbar-content_16hg5_1",
|
|
1537
1538
|
"rp-toolbar-wrapper": "_rp-toolbar-wrapper_16hg5_9",
|
|
1538
1539
|
"rp-toolbar-start": "_rp-toolbar-start_16hg5_17",
|
|
1539
1540
|
"rp-toolbar-middle": "_rp-toolbar-middle_16hg5_23",
|
|
1540
1541
|
"rp-toolbar-end": "_rp-toolbar-end_16hg5_30"
|
|
1541
|
-
},
|
|
1542
|
+
}, tt = {
|
|
1542
1543
|
"rp-paginate": "_rp-paginate_1vu6o_1",
|
|
1543
1544
|
"rp-page-input": "_rp-page-input_1vu6o_6",
|
|
1544
1545
|
"rp-total-page": "_rp-total-page_1vu6o_12"
|
|
1545
|
-
},
|
|
1546
|
-
const { prevIcon: e } =
|
|
1547
|
-
return e || /* @__PURE__ */
|
|
1548
|
-
},
|
|
1549
|
-
const { nextIcon: e } =
|
|
1550
|
-
return e || /* @__PURE__ */
|
|
1551
|
-
},
|
|
1552
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage:
|
|
1553
|
-
|
|
1554
|
-
|
|
1546
|
+
}, Fo = () => {
|
|
1547
|
+
const { prevIcon: e } = ne();
|
|
1548
|
+
return e || /* @__PURE__ */ a(Me, {});
|
|
1549
|
+
}, ko = () => {
|
|
1550
|
+
const { nextIcon: e } = ne();
|
|
1551
|
+
return e || /* @__PURE__ */ a(Me, { style: { transform: "rotate(180deg" } });
|
|
1552
|
+
}, Wo = () => {
|
|
1553
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = re(), [l, s] = F(e.toString()), { pageNavigationTool: c = !0 } = se(), { isSmallScreen: h } = ge();
|
|
1554
|
+
z(() => {
|
|
1555
|
+
s(e.toString());
|
|
1555
1556
|
}, [e]);
|
|
1556
1557
|
const p = x((v) => {
|
|
1557
1558
|
const _ = v.target.value;
|
|
1558
|
-
|
|
1559
|
+
s(_);
|
|
1559
1560
|
}, []), m = x(() => {
|
|
1560
|
-
const v =
|
|
1561
|
-
v.success ||
|
|
1562
|
-
}, [
|
|
1563
|
-
|
|
1561
|
+
const v = i(l);
|
|
1562
|
+
v.success || s(v.currentPage.toString());
|
|
1563
|
+
}, [i, l, t]), u = x(() => {
|
|
1564
|
+
s(e.toString());
|
|
1564
1565
|
}, [e]), f = x(
|
|
1565
1566
|
(v) => {
|
|
1566
1567
|
v.key === "Enter" && m();
|
|
1567
1568
|
},
|
|
1568
1569
|
[m]
|
|
1569
1570
|
);
|
|
1570
|
-
return typeof c != "boolean" ? /* @__PURE__ */
|
|
1571
|
+
return typeof c != "boolean" ? /* @__PURE__ */ a(
|
|
1571
1572
|
c,
|
|
1572
1573
|
{
|
|
1573
1574
|
total: t,
|
|
1574
1575
|
current: e,
|
|
1575
1576
|
nextPage: r,
|
|
1576
1577
|
prevPage: o,
|
|
1577
|
-
goToPage:
|
|
1578
|
+
goToPage: i,
|
|
1578
1579
|
changePage: n
|
|
1579
1580
|
}
|
|
1580
|
-
) : c ? /* @__PURE__ */ O("div", { className:
|
|
1581
|
-
!h && /* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
|
|
1581
|
+
) : c ? /* @__PURE__ */ O("div", { className: tt["rp-paginate"], children: [
|
|
1582
|
+
!h && /* @__PURE__ */ a(X, { content: "Previous page", children: /* @__PURE__ */ a(B, { onClick: o, disabled: e === 1, children: /* @__PURE__ */ a(Fo, {}) }) }),
|
|
1583
|
+
/* @__PURE__ */ a(
|
|
1584
|
+
Zt,
|
|
1584
1585
|
{
|
|
1585
1586
|
onKeyDown: f,
|
|
1586
1587
|
onBlur: u,
|
|
1587
1588
|
onChange: p,
|
|
1588
1589
|
value: l,
|
|
1589
|
-
className:
|
|
1590
|
+
className: tt["rp-page-input"]
|
|
1590
1591
|
}
|
|
1591
1592
|
),
|
|
1592
|
-
/* @__PURE__ */ O("span", { className:
|
|
1593
|
+
/* @__PURE__ */ O("span", { className: tt["rp-total-page"], children: [
|
|
1593
1594
|
"/",
|
|
1594
1595
|
t
|
|
1595
1596
|
] }),
|
|
1596
|
-
!h && /* @__PURE__ */
|
|
1597
|
+
!h && /* @__PURE__ */ a(X, { content: "Next page", children: /* @__PURE__ */ a(B, { onClick: r, disabled: e === t, children: /* @__PURE__ */ a(ko, {}) }) })
|
|
1597
1598
|
] }) : null;
|
|
1598
1599
|
};
|
|
1599
|
-
var
|
|
1600
|
+
var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, ee] = dn(bt), pn = (e) => {
|
|
1600
1601
|
const {
|
|
1601
1602
|
__scopeDialog: t,
|
|
1602
1603
|
children: n,
|
|
1603
1604
|
open: r,
|
|
1604
1605
|
defaultOpen: o,
|
|
1605
|
-
onOpenChange:
|
|
1606
|
+
onOpenChange: i,
|
|
1606
1607
|
modal: l = !0
|
|
1607
|
-
} = e,
|
|
1608
|
+
} = e, s = V.useRef(null), c = V.useRef(null), [h = !1, p] = kr({
|
|
1608
1609
|
prop: r,
|
|
1609
1610
|
defaultProp: o,
|
|
1610
|
-
onChange:
|
|
1611
|
+
onChange: i
|
|
1611
1612
|
});
|
|
1612
|
-
return /* @__PURE__ */
|
|
1613
|
-
|
|
1613
|
+
return /* @__PURE__ */ a(
|
|
1614
|
+
Ho,
|
|
1614
1615
|
{
|
|
1615
1616
|
scope: t,
|
|
1616
|
-
triggerRef:
|
|
1617
|
+
triggerRef: s,
|
|
1617
1618
|
contentRef: c,
|
|
1618
|
-
contentId:
|
|
1619
|
-
titleId:
|
|
1620
|
-
descriptionId:
|
|
1619
|
+
contentId: Be(),
|
|
1620
|
+
titleId: Be(),
|
|
1621
|
+
descriptionId: Be(),
|
|
1621
1622
|
open: h,
|
|
1622
1623
|
onOpenChange: p,
|
|
1623
1624
|
onOpenToggle: V.useCallback(() => p((m) => !m), [p]),
|
|
@@ -1626,50 +1627,50 @@ var wt = "Dialog", [un, Js] = xr(wt), [Fo, Q] = un(wt), dn = (e) => {
|
|
|
1626
1627
|
}
|
|
1627
1628
|
);
|
|
1628
1629
|
};
|
|
1629
|
-
|
|
1630
|
-
var
|
|
1630
|
+
pn.displayName = bt;
|
|
1631
|
+
var hn = "DialogTrigger", $o = V.forwardRef(
|
|
1631
1632
|
(e, t) => {
|
|
1632
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1633
|
-
return /* @__PURE__ */
|
|
1634
|
-
|
|
1633
|
+
const { __scopeDialog: n, ...r } = e, o = ee(hn, n), i = mt(t, o.triggerRef);
|
|
1634
|
+
return /* @__PURE__ */ a(
|
|
1635
|
+
Le.button,
|
|
1635
1636
|
{
|
|
1636
1637
|
type: "button",
|
|
1637
1638
|
"aria-haspopup": "dialog",
|
|
1638
1639
|
"aria-expanded": o.open,
|
|
1639
1640
|
"aria-controls": o.contentId,
|
|
1640
|
-
"data-state":
|
|
1641
|
+
"data-state": St(o.open),
|
|
1641
1642
|
...r,
|
|
1642
|
-
ref:
|
|
1643
|
-
onClick:
|
|
1643
|
+
ref: i,
|
|
1644
|
+
onClick: Re(e.onClick, o.onOpenToggle)
|
|
1644
1645
|
}
|
|
1645
1646
|
);
|
|
1646
1647
|
}
|
|
1647
1648
|
);
|
|
1648
|
-
|
|
1649
|
-
var
|
|
1649
|
+
$o.displayName = hn;
|
|
1650
|
+
var Ct = "DialogPortal", [Vo, fn] = dn(Ct, {
|
|
1650
1651
|
forceMount: void 0
|
|
1651
|
-
}),
|
|
1652
|
-
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e,
|
|
1653
|
-
return /* @__PURE__ */
|
|
1652
|
+
}), mn = (e) => {
|
|
1653
|
+
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, i = ee(Ct, t);
|
|
1654
|
+
return /* @__PURE__ */ a(Vo, { scope: t, forceMount: n, children: V.Children.map(r, (l) => /* @__PURE__ */ a(gt, { present: n || i.open, children: /* @__PURE__ */ a(Wr, { asChild: !0, container: o, children: l }) })) });
|
|
1654
1655
|
};
|
|
1655
|
-
|
|
1656
|
-
var
|
|
1656
|
+
mn.displayName = Ct;
|
|
1657
|
+
var ke = "DialogOverlay", gn = V.forwardRef(
|
|
1657
1658
|
(e, t) => {
|
|
1658
|
-
const n =
|
|
1659
|
-
return
|
|
1659
|
+
const n = fn(ke, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = ee(ke, e.__scopeDialog);
|
|
1660
|
+
return i.modal ? /* @__PURE__ */ a(gt, { present: r || i.open, children: /* @__PURE__ */ a(Go, { ...o, ref: t }) }) : null;
|
|
1660
1661
|
}
|
|
1661
1662
|
);
|
|
1662
|
-
|
|
1663
|
-
var
|
|
1663
|
+
gn.displayName = ke;
|
|
1664
|
+
var Go = V.forwardRef(
|
|
1664
1665
|
(e, t) => {
|
|
1665
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1666
|
+
const { __scopeDialog: n, ...r } = e, o = ee(ke, n);
|
|
1666
1667
|
return (
|
|
1667
1668
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1668
1669
|
// ie. when `Overlay` and `Content` are siblings
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
|
|
1670
|
+
/* @__PURE__ */ a(Nr, { as: Er, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ a(
|
|
1671
|
+
Le.div,
|
|
1671
1672
|
{
|
|
1672
|
-
"data-state":
|
|
1673
|
+
"data-state": St(o.open),
|
|
1673
1674
|
...r,
|
|
1674
1675
|
ref: t,
|
|
1675
1676
|
style: { pointerEvents: "auto", ...r.style }
|
|
@@ -1677,136 +1678,136 @@ var Ho = V.forwardRef(
|
|
|
1677
1678
|
) })
|
|
1678
1679
|
);
|
|
1679
1680
|
}
|
|
1680
|
-
),
|
|
1681
|
+
), me = "DialogContent", vn = V.forwardRef(
|
|
1681
1682
|
(e, t) => {
|
|
1682
|
-
const n =
|
|
1683
|
-
return /* @__PURE__ */
|
|
1683
|
+
const n = fn(me, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = ee(me, e.__scopeDialog);
|
|
1684
|
+
return /* @__PURE__ */ a(gt, { present: r || i.open, children: i.modal ? /* @__PURE__ */ a(Uo, { ...o, ref: t }) : /* @__PURE__ */ a(qo, { ...o, ref: t }) });
|
|
1684
1685
|
}
|
|
1685
1686
|
);
|
|
1686
|
-
|
|
1687
|
-
var
|
|
1687
|
+
vn.displayName = me;
|
|
1688
|
+
var Uo = V.forwardRef(
|
|
1688
1689
|
(e, t) => {
|
|
1689
|
-
const n =
|
|
1690
|
+
const n = ee(me, e.__scopeDialog), r = V.useRef(null), o = mt(t, n.contentRef, r);
|
|
1690
1691
|
return V.useEffect(() => {
|
|
1691
|
-
const
|
|
1692
|
-
if (
|
|
1693
|
-
return
|
|
1694
|
-
}, []), /* @__PURE__ */
|
|
1695
|
-
|
|
1692
|
+
const i = r.current;
|
|
1693
|
+
if (i)
|
|
1694
|
+
return Or(i);
|
|
1695
|
+
}, []), /* @__PURE__ */ a(
|
|
1696
|
+
_n,
|
|
1696
1697
|
{
|
|
1697
1698
|
...e,
|
|
1698
1699
|
ref: o,
|
|
1699
1700
|
trapFocus: n.open,
|
|
1700
1701
|
disableOutsidePointerEvents: !0,
|
|
1701
|
-
onCloseAutoFocus:
|
|
1702
|
+
onCloseAutoFocus: Re(e.onCloseAutoFocus, (i) => {
|
|
1702
1703
|
var l;
|
|
1703
|
-
|
|
1704
|
+
i.preventDefault(), (l = n.triggerRef.current) == null || l.focus();
|
|
1704
1705
|
}),
|
|
1705
|
-
onPointerDownOutside:
|
|
1706
|
-
const l =
|
|
1707
|
-
(l.button === 2 ||
|
|
1706
|
+
onPointerDownOutside: Re(e.onPointerDownOutside, (i) => {
|
|
1707
|
+
const l = i.detail.originalEvent, s = l.button === 0 && l.ctrlKey === !0;
|
|
1708
|
+
(l.button === 2 || s) && i.preventDefault();
|
|
1708
1709
|
}),
|
|
1709
|
-
onFocusOutside:
|
|
1710
|
+
onFocusOutside: Re(
|
|
1710
1711
|
e.onFocusOutside,
|
|
1711
|
-
(
|
|
1712
|
+
(i) => i.preventDefault()
|
|
1712
1713
|
)
|
|
1713
1714
|
}
|
|
1714
1715
|
);
|
|
1715
1716
|
}
|
|
1716
|
-
),
|
|
1717
|
+
), qo = V.forwardRef(
|
|
1717
1718
|
(e, t) => {
|
|
1718
|
-
const n =
|
|
1719
|
-
return /* @__PURE__ */
|
|
1720
|
-
|
|
1719
|
+
const n = ee(me, e.__scopeDialog), r = V.useRef(!1), o = V.useRef(!1);
|
|
1720
|
+
return /* @__PURE__ */ a(
|
|
1721
|
+
_n,
|
|
1721
1722
|
{
|
|
1722
1723
|
...e,
|
|
1723
1724
|
ref: t,
|
|
1724
1725
|
trapFocus: !1,
|
|
1725
1726
|
disableOutsidePointerEvents: !1,
|
|
1726
|
-
onCloseAutoFocus: (
|
|
1727
|
-
var l,
|
|
1728
|
-
(l = e.onCloseAutoFocus) == null || l.call(e,
|
|
1727
|
+
onCloseAutoFocus: (i) => {
|
|
1728
|
+
var l, s;
|
|
1729
|
+
(l = e.onCloseAutoFocus) == null || l.call(e, i), i.defaultPrevented || (r.current || (s = n.triggerRef.current) == null || s.focus(), i.preventDefault()), r.current = !1, o.current = !1;
|
|
1729
1730
|
},
|
|
1730
|
-
onInteractOutside: (
|
|
1731
|
+
onInteractOutside: (i) => {
|
|
1731
1732
|
var c, h;
|
|
1732
|
-
(c = e.onInteractOutside) == null || c.call(e,
|
|
1733
|
-
const l =
|
|
1734
|
-
((h = n.triggerRef.current) == null ? void 0 : h.contains(l)) &&
|
|
1733
|
+
(c = e.onInteractOutside) == null || c.call(e, i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
1734
|
+
const l = i.target;
|
|
1735
|
+
((h = n.triggerRef.current) == null ? void 0 : h.contains(l)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
|
|
1735
1736
|
}
|
|
1736
1737
|
}
|
|
1737
1738
|
);
|
|
1738
1739
|
}
|
|
1739
|
-
),
|
|
1740
|
+
), _n = V.forwardRef(
|
|
1740
1741
|
(e, t) => {
|
|
1741
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus:
|
|
1742
|
-
return
|
|
1743
|
-
/* @__PURE__ */
|
|
1744
|
-
|
|
1742
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...l } = e, s = ee(me, n), c = V.useRef(null), h = mt(t, c);
|
|
1743
|
+
return Dr(), /* @__PURE__ */ O(Ae, { children: [
|
|
1744
|
+
/* @__PURE__ */ a(
|
|
1745
|
+
Ar,
|
|
1745
1746
|
{
|
|
1746
1747
|
asChild: !0,
|
|
1747
1748
|
loop: !0,
|
|
1748
1749
|
trapped: r,
|
|
1749
1750
|
onMountAutoFocus: o,
|
|
1750
|
-
onUnmountAutoFocus:
|
|
1751
|
-
children: /* @__PURE__ */
|
|
1752
|
-
|
|
1751
|
+
onUnmountAutoFocus: i,
|
|
1752
|
+
children: /* @__PURE__ */ a(
|
|
1753
|
+
zr,
|
|
1753
1754
|
{
|
|
1754
1755
|
role: "dialog",
|
|
1755
|
-
id:
|
|
1756
|
-
"aria-describedby":
|
|
1757
|
-
"aria-labelledby":
|
|
1758
|
-
"data-state":
|
|
1756
|
+
id: s.contentId,
|
|
1757
|
+
"aria-describedby": s.descriptionId,
|
|
1758
|
+
"aria-labelledby": s.titleId,
|
|
1759
|
+
"data-state": St(s.open),
|
|
1759
1760
|
...l,
|
|
1760
1761
|
ref: h,
|
|
1761
|
-
onDismiss: () =>
|
|
1762
|
+
onDismiss: () => s.onOpenChange(!1)
|
|
1762
1763
|
}
|
|
1763
1764
|
)
|
|
1764
1765
|
}
|
|
1765
1766
|
),
|
|
1766
|
-
/* @__PURE__ */ O(
|
|
1767
|
-
/* @__PURE__ */
|
|
1768
|
-
/* @__PURE__ */
|
|
1767
|
+
/* @__PURE__ */ O(Ae, { children: [
|
|
1768
|
+
/* @__PURE__ */ a(jo, { titleId: s.titleId }),
|
|
1769
|
+
/* @__PURE__ */ a(Ko, { contentRef: c, descriptionId: s.descriptionId })
|
|
1769
1770
|
] })
|
|
1770
1771
|
] });
|
|
1771
1772
|
}
|
|
1772
|
-
),
|
|
1773
|
+
), Pt = "DialogTitle", wn = V.forwardRef(
|
|
1773
1774
|
(e, t) => {
|
|
1774
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1775
|
-
return /* @__PURE__ */
|
|
1775
|
+
const { __scopeDialog: n, ...r } = e, o = ee(Pt, n);
|
|
1776
|
+
return /* @__PURE__ */ a(Le.h2, { id: o.titleId, ...r, ref: t });
|
|
1776
1777
|
}
|
|
1777
1778
|
);
|
|
1778
|
-
|
|
1779
|
-
var
|
|
1779
|
+
wn.displayName = Pt;
|
|
1780
|
+
var bn = "DialogDescription", Zo = V.forwardRef(
|
|
1780
1781
|
(e, t) => {
|
|
1781
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1782
|
-
return /* @__PURE__ */
|
|
1782
|
+
const { __scopeDialog: n, ...r } = e, o = ee(bn, n);
|
|
1783
|
+
return /* @__PURE__ */ a(Le.p, { id: o.descriptionId, ...r, ref: t });
|
|
1783
1784
|
}
|
|
1784
1785
|
);
|
|
1785
|
-
|
|
1786
|
-
var
|
|
1786
|
+
Zo.displayName = bn;
|
|
1787
|
+
var Cn = "DialogClose", Pn = V.forwardRef(
|
|
1787
1788
|
(e, t) => {
|
|
1788
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1789
|
-
return /* @__PURE__ */
|
|
1790
|
-
|
|
1789
|
+
const { __scopeDialog: n, ...r } = e, o = ee(Cn, n);
|
|
1790
|
+
return /* @__PURE__ */ a(
|
|
1791
|
+
Le.button,
|
|
1791
1792
|
{
|
|
1792
1793
|
type: "button",
|
|
1793
1794
|
...r,
|
|
1794
1795
|
ref: t,
|
|
1795
|
-
onClick:
|
|
1796
|
+
onClick: Re(e.onClick, () => o.onOpenChange(!1))
|
|
1796
1797
|
}
|
|
1797
1798
|
);
|
|
1798
1799
|
}
|
|
1799
1800
|
);
|
|
1800
|
-
|
|
1801
|
-
function
|
|
1801
|
+
Pn.displayName = Cn;
|
|
1802
|
+
function St(e) {
|
|
1802
1803
|
return e ? "open" : "closed";
|
|
1803
1804
|
}
|
|
1804
|
-
var
|
|
1805
|
-
contentName:
|
|
1806
|
-
titleName:
|
|
1805
|
+
var Sn = "DialogTitleWarning", [ns, Tn] = Fr(Sn, {
|
|
1806
|
+
contentName: me,
|
|
1807
|
+
titleName: Pt,
|
|
1807
1808
|
docsSlug: "dialog"
|
|
1808
|
-
}),
|
|
1809
|
-
const t = Sn
|
|
1809
|
+
}), jo = ({ titleId: e }) => {
|
|
1810
|
+
const t = Tn(Sn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1810
1811
|
|
|
1811
1812
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
1812
1813
|
|
|
@@ -1814,15 +1815,15 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
1814
1815
|
return V.useEffect(() => {
|
|
1815
1816
|
e && (document.getElementById(e) || console.error(n));
|
|
1816
1817
|
}, [n, e]), null;
|
|
1817
|
-
},
|
|
1818
|
-
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
1818
|
+
}, Bo = "DialogDescriptionWarning", Ko = ({ contentRef: e, descriptionId: t }) => {
|
|
1819
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tn(Bo).contentName}}.`;
|
|
1819
1820
|
return V.useEffect(() => {
|
|
1820
|
-
var
|
|
1821
|
-
const o = (
|
|
1821
|
+
var i;
|
|
1822
|
+
const o = (i = e.current) == null ? void 0 : i.getAttribute("aria-describedby");
|
|
1822
1823
|
t && o && (document.getElementById(t) || console.warn(r));
|
|
1823
1824
|
}, [r, e, t]), null;
|
|
1824
|
-
},
|
|
1825
|
-
const
|
|
1825
|
+
}, Xo = pn, Jo = mn, Yo = gn, Qo = vn, ea = wn, ta = Pn;
|
|
1826
|
+
const fe = {
|
|
1826
1827
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
1827
1828
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
1828
1829
|
"rp-document-dialog": "_rp-document-dialog_slqo7_13",
|
|
@@ -1830,14 +1831,14 @@ const he = {
|
|
|
1830
1831
|
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
1831
1832
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
1832
1833
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
1833
|
-
},
|
|
1834
|
-
const { pdfProperties: e } =
|
|
1834
|
+
}, na = () => {
|
|
1835
|
+
const { pdfProperties: e } = Y(), { container: t } = qe(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = $r(), o = D(() => {
|
|
1835
1836
|
if (!e)
|
|
1836
1837
|
return [];
|
|
1837
1838
|
const {
|
|
1838
|
-
fileSize:
|
|
1839
|
+
fileSize: i,
|
|
1839
1840
|
filename: l,
|
|
1840
|
-
title:
|
|
1841
|
+
title: s,
|
|
1841
1842
|
author: c,
|
|
1842
1843
|
subject: h,
|
|
1843
1844
|
createdOn: p,
|
|
@@ -1850,20 +1851,20 @@ const he = {
|
|
|
1850
1851
|
} = e;
|
|
1851
1852
|
return [
|
|
1852
1853
|
{ label: "File name", value: l },
|
|
1853
|
-
{ label: "File size", value:
|
|
1854
|
+
{ label: "File size", value: i },
|
|
1854
1855
|
{ separate: !0 },
|
|
1855
|
-
{ label: "Title", value:
|
|
1856
|
+
{ label: "Title", value: s },
|
|
1856
1857
|
{ label: "Author", value: c },
|
|
1857
1858
|
{ label: "Subject", value: h },
|
|
1858
1859
|
{ label: "Keywords", value: u },
|
|
1859
1860
|
{ label: "Creator", value: m },
|
|
1860
1861
|
{
|
|
1861
1862
|
label: "Created on",
|
|
1862
|
-
value: p ?
|
|
1863
|
+
value: p ? it(p) : ""
|
|
1863
1864
|
},
|
|
1864
1865
|
{
|
|
1865
1866
|
label: "Modified on",
|
|
1866
|
-
value: f ?
|
|
1867
|
+
value: f ? it(f) : ""
|
|
1867
1868
|
},
|
|
1868
1869
|
{ separate: !0 },
|
|
1869
1870
|
{ label: "PDF producer", value: v },
|
|
@@ -1871,41 +1872,41 @@ const he = {
|
|
|
1871
1872
|
{ label: "Page count", value: g }
|
|
1872
1873
|
];
|
|
1873
1874
|
}, [e]);
|
|
1874
|
-
return /* @__PURE__ */
|
|
1875
|
-
/* @__PURE__ */
|
|
1876
|
-
/* @__PURE__ */ O(
|
|
1877
|
-
/* @__PURE__ */
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
1875
|
+
return /* @__PURE__ */ a(Xo, { open: n, onOpenChange: r, children: /* @__PURE__ */ a(Jo, { container: t, children: /* @__PURE__ */ O("div", { className: fe["rp-dialog-wrapper"], children: [
|
|
1876
|
+
/* @__PURE__ */ a(Yo, { className: fe["rp-dialog-overlay"] }),
|
|
1877
|
+
/* @__PURE__ */ O(Qo, { className: fe["rp-document-dialog"], children: [
|
|
1878
|
+
/* @__PURE__ */ a(ea, { className: fe["rp-dialog-title"], children: "Document Properties" }),
|
|
1879
|
+
/* @__PURE__ */ a("div", { className: fe["rp-document-properties"], children: o.map((i, l) => /* @__PURE__ */ a("div", { children: i.separate ? /* @__PURE__ */ a("div", { className: fe["rp-properties-divider"] }) : /* @__PURE__ */ a(Hr, { label: i.label, value: i.value }) }, l)) }),
|
|
1880
|
+
/* @__PURE__ */ a(ta, { asChild: !0, className: fe["rp-dialog-close"], children: /* @__PURE__ */ a(Yt, {}) })
|
|
1880
1881
|
] })
|
|
1881
1882
|
] }) }) });
|
|
1882
|
-
},
|
|
1883
|
+
}, ra = {
|
|
1883
1884
|
"rp-other-tool-content": "_rp-other-tool-content_su718_1"
|
|
1884
|
-
},
|
|
1885
|
-
const { filename: e, pdfSrc: t } =
|
|
1885
|
+
}, oa = () => {
|
|
1886
|
+
const { filename: e, pdfSrc: t } = Y();
|
|
1886
1887
|
return { downloadFile: () => {
|
|
1887
1888
|
if (!e)
|
|
1888
1889
|
return;
|
|
1889
1890
|
const r = document.createElement("a");
|
|
1890
1891
|
r.href = t, r.download = e, document.body.appendChild(r), r.click(), document.body.removeChild(r);
|
|
1891
1892
|
} };
|
|
1892
|
-
},
|
|
1893
|
-
const { downloadIcon: e } =
|
|
1894
|
-
return e || /* @__PURE__ */
|
|
1895
|
-
},
|
|
1896
|
-
/* @__PURE__ */
|
|
1893
|
+
}, In = () => {
|
|
1894
|
+
const { downloadIcon: e } = ne();
|
|
1895
|
+
return e || /* @__PURE__ */ a(Zr, {});
|
|
1896
|
+
}, yn = ({ children: e }) => /* @__PURE__ */ a(X, { content: "Download file", children: e }), aa = ({ downloadFile: e }) => /* @__PURE__ */ a(yn, { children: /* @__PURE__ */ a(B, { onClick: e, children: /* @__PURE__ */ a(In, {}) }) }), ia = ({ downloadFile: e }) => /* @__PURE__ */ a(yn, { children: /* @__PURE__ */ O(ce, { onClick: e, children: [
|
|
1897
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(In, {}) }),
|
|
1897
1898
|
"Download file"
|
|
1898
|
-
] }),
|
|
1899
|
-
const { downloadFile: e } =
|
|
1900
|
-
return t ? n ? /* @__PURE__ */
|
|
1899
|
+
] }) }), xn = () => {
|
|
1900
|
+
const { downloadFile: e } = oa(), { downloadTool: t = !0 } = se(), { isSmallScreen: n } = ge();
|
|
1901
|
+
return t ? n ? /* @__PURE__ */ a(ia, { downloadFile: e }) : typeof t == "function" ? /* @__PURE__ */ a(t, { downloadFile: e }) : t ? /* @__PURE__ */ a(aa, { downloadFile: e }) : null : null;
|
|
1901
1902
|
};
|
|
1902
|
-
const
|
|
1903
|
-
const { pdf: e, pages: t } =
|
|
1903
|
+
const sa = () => {
|
|
1904
|
+
const { pdf: e, pages: t } = Y(), [n, r] = F({
|
|
1904
1905
|
loadedPages: 0,
|
|
1905
1906
|
totalPages: 0,
|
|
1906
1907
|
percentage: 0
|
|
1907
|
-
}), [o,
|
|
1908
|
-
|
|
1908
|
+
}), [o, i] = F(!1), [l, s] = F(!1), [c, h] = F(null), p = $(!1);
|
|
1909
|
+
z(() => {
|
|
1909
1910
|
p.current;
|
|
1910
1911
|
}, [p]);
|
|
1911
1912
|
const m = x(() => {
|
|
@@ -1913,7 +1914,7 @@ const oa = () => {
|
|
|
1913
1914
|
const w = document.querySelector(".rp-print-zone");
|
|
1914
1915
|
w && w.remove();
|
|
1915
1916
|
}, []), u = x(() => {
|
|
1916
|
-
p.current = !1,
|
|
1917
|
+
p.current = !1, i(!1), s(!1), h(null), r({
|
|
1917
1918
|
loadedPages: 0,
|
|
1918
1919
|
totalPages: 0,
|
|
1919
1920
|
percentage: 0
|
|
@@ -1933,7 +1934,7 @@ const oa = () => {
|
|
|
1933
1934
|
u();
|
|
1934
1935
|
return;
|
|
1935
1936
|
}
|
|
1936
|
-
const I = b /
|
|
1937
|
+
const I = b / tr.PDF;
|
|
1937
1938
|
w.width = Math.floor(S.width * I), w.height = Math.floor(S.height * I);
|
|
1938
1939
|
const M = w.getContext("2d");
|
|
1939
1940
|
M.save(), M.fillStyle = "rgb(255, 255, 255)", M.fillRect(0, 0, w.width, w.height), M.restore();
|
|
@@ -1950,14 +1951,14 @@ const oa = () => {
|
|
|
1950
1951
|
transform: [I, 0, 0, I, 0, 0],
|
|
1951
1952
|
viewport: L.getViewport({ scale: 1, rotation: S.rotation }),
|
|
1952
1953
|
intent: "print",
|
|
1953
|
-
annotationMode:
|
|
1954
|
+
annotationMode: nr.ENABLE_STORAGE,
|
|
1954
1955
|
optionalContentConfigPromise: P,
|
|
1955
1956
|
printAnnotationStorage: R
|
|
1956
1957
|
};
|
|
1957
1958
|
try {
|
|
1958
1959
|
return L.render(E).promise;
|
|
1959
|
-
} catch (
|
|
1960
|
-
throw
|
|
1960
|
+
} catch (A) {
|
|
1961
|
+
throw A instanceof rr || console.error(A), A;
|
|
1961
1962
|
}
|
|
1962
1963
|
}, _ = x(() => {
|
|
1963
1964
|
const w = window.print;
|
|
@@ -2037,14 +2038,14 @@ const oa = () => {
|
|
|
2037
2038
|
return;
|
|
2038
2039
|
}
|
|
2039
2040
|
const N = C(T, t);
|
|
2040
|
-
document.body.appendChild(N), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"),
|
|
2041
|
+
document.body.appendChild(N), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await _();
|
|
2041
2042
|
} catch (d) {
|
|
2042
|
-
|
|
2043
|
+
s(!0), d instanceof Error && h(d);
|
|
2043
2044
|
} finally {
|
|
2044
2045
|
w.height = 0, w.width = 0;
|
|
2045
2046
|
}
|
|
2046
2047
|
}, [e, t, p]);
|
|
2047
|
-
return
|
|
2048
|
+
return z(() => {
|
|
2048
2049
|
const w = () => {
|
|
2049
2050
|
u(), m();
|
|
2050
2051
|
};
|
|
@@ -2059,7 +2060,7 @@ const oa = () => {
|
|
|
2059
2060
|
isError: l,
|
|
2060
2061
|
error: c
|
|
2061
2062
|
};
|
|
2062
|
-
},
|
|
2063
|
+
}, Rn = We({
|
|
2063
2064
|
print: () => {
|
|
2064
2065
|
},
|
|
2065
2066
|
cancel: () => {
|
|
@@ -2076,8 +2077,8 @@ const oa = () => {
|
|
|
2076
2077
|
console.error("Error in setOnError callback:", t);
|
|
2077
2078
|
}
|
|
2078
2079
|
}
|
|
2079
|
-
}),
|
|
2080
|
-
const [t, n] = F(null), [r, o] = F(null), { print:
|
|
2080
|
+
}), la = ({ children: e }) => {
|
|
2081
|
+
const [t, n] = F(null), [r, o] = F(null), { print: i, cancel: l, progress: s, isComplete: c, isError: h, error: p } = sa(), m = x((g) => {
|
|
2081
2082
|
g && typeof g == "function" && o(() => g);
|
|
2082
2083
|
}, []), u = (g) => {
|
|
2083
2084
|
p && g(p);
|
|
@@ -2085,42 +2086,42 @@ const oa = () => {
|
|
|
2085
2086
|
(g) => {
|
|
2086
2087
|
n(() => g);
|
|
2087
2088
|
},
|
|
2088
|
-
[
|
|
2089
|
+
[s, t]
|
|
2089
2090
|
);
|
|
2090
|
-
|
|
2091
|
+
z(() => {
|
|
2091
2092
|
c && r && v();
|
|
2092
|
-
}, [c, r]),
|
|
2093
|
+
}, [c, r]), z(() => {
|
|
2093
2094
|
h && u((g) => {
|
|
2094
2095
|
console.error(g);
|
|
2095
2096
|
});
|
|
2096
|
-
}, [h]),
|
|
2097
|
-
|
|
2098
|
-
}, [
|
|
2097
|
+
}, [h]), z(() => {
|
|
2098
|
+
s && t && t(s);
|
|
2099
|
+
}, [s, t]);
|
|
2099
2100
|
const v = () => {
|
|
2100
2101
|
r && (r(), o(null));
|
|
2101
2102
|
}, _ = {
|
|
2102
|
-
print:
|
|
2103
|
+
print: i,
|
|
2103
2104
|
cancel: l,
|
|
2104
2105
|
setOnProgress: f,
|
|
2105
2106
|
setOnComplete: m,
|
|
2106
2107
|
setOnError: u,
|
|
2107
|
-
progress:
|
|
2108
|
+
progress: s
|
|
2108
2109
|
};
|
|
2109
|
-
return /* @__PURE__ */
|
|
2110
|
-
},
|
|
2111
|
-
const e =
|
|
2110
|
+
return /* @__PURE__ */ a(Rn.Provider, { value: _, children: e });
|
|
2111
|
+
}, Tt = () => {
|
|
2112
|
+
const e = He(Rn);
|
|
2112
2113
|
if (!e)
|
|
2113
2114
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
2114
2115
|
return e;
|
|
2115
|
-
},
|
|
2116
|
-
const { printIcon: e } =
|
|
2117
|
-
return e || /* @__PURE__ */
|
|
2118
|
-
},
|
|
2119
|
-
/* @__PURE__ */
|
|
2116
|
+
}, Mn = () => {
|
|
2117
|
+
const { printIcon: e } = ne();
|
|
2118
|
+
return e || /* @__PURE__ */ a(jr, {});
|
|
2119
|
+
}, Ln = ({ children: e }) => /* @__PURE__ */ a(X, { content: "Print", children: e }), ca = ({ print: e }) => /* @__PURE__ */ a(Ln, { children: /* @__PURE__ */ a(B, { onClick: e, children: /* @__PURE__ */ a(Mn, {}) }) }), ua = ({ print: e }) => /* @__PURE__ */ a(Ln, { children: /* @__PURE__ */ O(ce, { onClick: e, children: [
|
|
2120
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Mn, {}) }),
|
|
2120
2121
|
"Print"
|
|
2121
|
-
] }),
|
|
2122
|
-
const { print: e, cancel: t, setOnProgress: n, setOnComplete: r, setOnError: o, progress:
|
|
2123
|
-
return l ?
|
|
2122
|
+
] }) }), Nn = () => {
|
|
2123
|
+
const { print: e, cancel: t, setOnProgress: n, setOnComplete: r, setOnError: o, progress: i } = Tt(), { printTool: l = !0 } = se(), { isSmallScreen: s } = ge();
|
|
2124
|
+
return l ? s ? /* @__PURE__ */ a(ua, { print: e }) : typeof l == "function" ? /* @__PURE__ */ a(
|
|
2124
2125
|
l,
|
|
2125
2126
|
{
|
|
2126
2127
|
print: e,
|
|
@@ -2128,135 +2129,135 @@ const oa = () => {
|
|
|
2128
2129
|
setOnProgress: n,
|
|
2129
2130
|
setOnError: o,
|
|
2130
2131
|
setOnComplete: r,
|
|
2131
|
-
progress:
|
|
2132
|
+
progress: i
|
|
2132
2133
|
}
|
|
2133
|
-
) : l ? /* @__PURE__ */
|
|
2134
|
-
},
|
|
2134
|
+
) : l ? /* @__PURE__ */ a(ca, { print: e }) : null : null;
|
|
2135
|
+
}, da = {
|
|
2135
2136
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2136
|
-
},
|
|
2137
|
-
const { goToFirstPageIcon: e } =
|
|
2138
|
-
return e || /* @__PURE__ */
|
|
2139
|
-
},
|
|
2140
|
-
const { goToLastPageIcon: e } =
|
|
2141
|
-
return e || /* @__PURE__ */
|
|
2142
|
-
},
|
|
2143
|
-
const { goToPage: e, totalPages: t, focusedPage: n } =
|
|
2137
|
+
}, pa = () => {
|
|
2138
|
+
const { goToFirstPageIcon: e } = ne();
|
|
2139
|
+
return e || /* @__PURE__ */ a(en, { className: da["rp-go-to-Top"] });
|
|
2140
|
+
}, ha = () => {
|
|
2141
|
+
const { goToLastPageIcon: e } = ne();
|
|
2142
|
+
return e || /* @__PURE__ */ a(en, {});
|
|
2143
|
+
}, fa = () => {
|
|
2144
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = re(), { jumpNavigationTool: r = !0 } = se(), o = D(() => n === 1, [n]), i = D(() => n === t, [n, t]), l = x(() => {
|
|
2144
2145
|
e(1);
|
|
2145
|
-
}, [e]),
|
|
2146
|
+
}, [e]), s = x(() => {
|
|
2146
2147
|
e(t);
|
|
2147
2148
|
}, [e, t]);
|
|
2148
|
-
return r ? /* @__PURE__ */ O(
|
|
2149
|
-
/* @__PURE__ */ O(
|
|
2150
|
-
/* @__PURE__ */
|
|
2149
|
+
return r ? /* @__PURE__ */ O(Fe, { children: [
|
|
2150
|
+
/* @__PURE__ */ a(X, { content: "Go to first page", children: /* @__PURE__ */ O(ce, { disabled: o, onClick: l, children: [
|
|
2151
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(pa, {}) }),
|
|
2151
2152
|
"First page"
|
|
2152
|
-
] }),
|
|
2153
|
-
/* @__PURE__ */ O(
|
|
2154
|
-
/* @__PURE__ */
|
|
2153
|
+
] }) }),
|
|
2154
|
+
/* @__PURE__ */ a(X, { content: "Go to last page", children: /* @__PURE__ */ O(ce, { disabled: i, onClick: s, children: [
|
|
2155
|
+
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(ha, {}) }),
|
|
2155
2156
|
"Last page"
|
|
2156
|
-
] }),
|
|
2157
|
-
/* @__PURE__ */
|
|
2157
|
+
] }) }),
|
|
2158
|
+
/* @__PURE__ */ a(vt, {})
|
|
2158
2159
|
] }) : null;
|
|
2159
|
-
},
|
|
2160
|
-
const { container: e } =
|
|
2160
|
+
}, ma = () => {
|
|
2161
|
+
const { container: e } = qe(), { isSmallScreen: t } = ge(), {
|
|
2161
2162
|
openFileTool: n,
|
|
2162
2163
|
downloadTool: r,
|
|
2163
2164
|
documentProperties: o,
|
|
2164
|
-
scrollModeTool:
|
|
2165
|
+
scrollModeTool: i,
|
|
2165
2166
|
rotateTool: l,
|
|
2166
|
-
selectionModeTool:
|
|
2167
|
+
selectionModeTool: s,
|
|
2167
2168
|
jumpNavigationTool: c,
|
|
2168
2169
|
printTool: h,
|
|
2169
2170
|
fullscreenTool: p
|
|
2170
2171
|
} = se();
|
|
2171
2172
|
return D(() => {
|
|
2172
|
-
const u = c || l ||
|
|
2173
|
+
const u = c || l || s || i || o;
|
|
2173
2174
|
let f = !1;
|
|
2174
2175
|
return t && (f = !(!n && !r && !h && !p)), u || f;
|
|
2175
2176
|
}, [
|
|
2176
2177
|
n,
|
|
2177
2178
|
r,
|
|
2178
2179
|
o,
|
|
2179
|
-
a,
|
|
2180
|
-
l,
|
|
2181
2180
|
i,
|
|
2181
|
+
l,
|
|
2182
|
+
s,
|
|
2182
2183
|
c
|
|
2183
|
-
]) ? /* @__PURE__ */ O(
|
|
2184
|
-
/* @__PURE__ */
|
|
2185
|
-
|
|
2184
|
+
]) ? /* @__PURE__ */ O(Vr, { children: [
|
|
2185
|
+
/* @__PURE__ */ a(
|
|
2186
|
+
ft,
|
|
2186
2187
|
{
|
|
2187
2188
|
container: e,
|
|
2188
|
-
triggerComponent: /* @__PURE__ */
|
|
2189
|
-
children: /* @__PURE__ */ O("div", { className:
|
|
2190
|
-
t && /* @__PURE__ */ O(
|
|
2191
|
-
/* @__PURE__ */
|
|
2192
|
-
/* @__PURE__ */
|
|
2193
|
-
/* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
/* @__PURE__ */
|
|
2189
|
+
triggerComponent: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(X, { content: "More options", children: /* @__PURE__ */ a(Mr, {}) }) }),
|
|
2190
|
+
children: /* @__PURE__ */ O("div", { className: ra["rp-other-tool-content"], children: [
|
|
2191
|
+
t && /* @__PURE__ */ O(Fe, { children: [
|
|
2192
|
+
/* @__PURE__ */ a(Jt, {}),
|
|
2193
|
+
/* @__PURE__ */ a(xn, {}),
|
|
2194
|
+
/* @__PURE__ */ a(Nn, {}),
|
|
2195
|
+
/* @__PURE__ */ a(Qt, {}),
|
|
2196
|
+
/* @__PURE__ */ a(vt, {})
|
|
2196
2197
|
] }),
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2201
|
-
/* @__PURE__ */
|
|
2198
|
+
/* @__PURE__ */ a(fa, {}),
|
|
2199
|
+
/* @__PURE__ */ a(Ur, {}),
|
|
2200
|
+
/* @__PURE__ */ a(Br, {}),
|
|
2201
|
+
/* @__PURE__ */ a(qr, {}),
|
|
2202
|
+
/* @__PURE__ */ a(Gr, {})
|
|
2202
2203
|
] })
|
|
2203
2204
|
}
|
|
2204
2205
|
),
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
+
/* @__PURE__ */ a(na, {})
|
|
2206
2207
|
] }) : null;
|
|
2207
|
-
},
|
|
2208
|
-
const { isSmallScreen: e } =
|
|
2209
|
-
return /* @__PURE__ */ O(
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
!e && /* @__PURE__ */ O(
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2208
|
+
}, ga = () => {
|
|
2209
|
+
const { isSmallScreen: e } = ge();
|
|
2210
|
+
return /* @__PURE__ */ O(Ae, { children: [
|
|
2211
|
+
/* @__PURE__ */ a(Rr, {}),
|
|
2212
|
+
!e && /* @__PURE__ */ O(Ae, { children: [
|
|
2213
|
+
/* @__PURE__ */ a(Jt, {}),
|
|
2214
|
+
/* @__PURE__ */ a(xn, {}),
|
|
2215
|
+
/* @__PURE__ */ a(Nn, {}),
|
|
2216
|
+
/* @__PURE__ */ a(Qt, {})
|
|
2216
2217
|
] }),
|
|
2217
|
-
/* @__PURE__ */
|
|
2218
|
+
/* @__PURE__ */ a(ma, {})
|
|
2218
2219
|
] });
|
|
2219
|
-
},
|
|
2220
|
+
}, ye = {
|
|
2220
2221
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_163s9_1",
|
|
2221
2222
|
"rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_163s9_6",
|
|
2222
2223
|
"rp-current-zoom-icon": "_rp-current-zoom-icon_163s9_11",
|
|
2223
2224
|
"rp-current-zoom": "_rp-current-zoom_163s9_6",
|
|
2224
2225
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_163s9_20"
|
|
2225
|
-
},
|
|
2226
|
-
const { zoomInIcon: e } =
|
|
2227
|
-
return e || /* @__PURE__ */
|
|
2228
|
-
},
|
|
2229
|
-
const { zoomOutIcon: e } =
|
|
2230
|
-
return e || /* @__PURE__ */
|
|
2231
|
-
},
|
|
2232
|
-
const { zoomLevel: e, setZoomLevel: t } =
|
|
2226
|
+
}, va = 25, nt = 1e3, _a = [50, 75, 100, 125, 150, 200, 300, 400], wa = () => {
|
|
2227
|
+
const { zoomInIcon: e } = ne();
|
|
2228
|
+
return e || /* @__PURE__ */ a(Kr, {});
|
|
2229
|
+
}, ba = () => {
|
|
2230
|
+
const { zoomOutIcon: e } = ne();
|
|
2231
|
+
return e || /* @__PURE__ */ a(Xr, {});
|
|
2232
|
+
}, Ca = () => {
|
|
2233
|
+
const { zoomLevel: e, setZoomLevel: t } = ht(), { container: n, contentRef: r } = qe(), { zoomTool: o = !0 } = se(), { focusedPage: i } = re(), { rotate: l } = Ve(), { pages: s } = Y(), { isSmallScreen: c } = ge(), h = x(() => {
|
|
2233
2234
|
t((g) => {
|
|
2234
2235
|
const C = Math.floor(g / 25) * 25;
|
|
2235
|
-
return Math.min(C + 25,
|
|
2236
|
+
return Math.min(C + 25, nt);
|
|
2236
2237
|
});
|
|
2237
2238
|
}, [t]), p = x(() => {
|
|
2238
2239
|
t((g) => {
|
|
2239
2240
|
const C = Math.ceil(g / 25) * 25;
|
|
2240
|
-
return Math.min(C - 25,
|
|
2241
|
+
return Math.min(C - 25, nt);
|
|
2241
2242
|
});
|
|
2242
|
-
}, [t]), m = D(() => e ===
|
|
2243
|
+
}, [t]), m = D(() => e === va, [e]), u = D(() => e === nt, [e]), f = D(() => {
|
|
2243
2244
|
var g;
|
|
2244
|
-
return (g =
|
|
2245
|
-
}, [
|
|
2245
|
+
return (g = s.get(i)) == null ? void 0 : g.page.getViewport({ scale: 1, rotation: l });
|
|
2246
|
+
}, [s, i, l]), v = x(
|
|
2246
2247
|
(g) => {
|
|
2247
|
-
const C = ((f == null ? void 0 : f.width) || 0) + 2 *
|
|
2248
|
+
const C = ((f == null ? void 0 : f.width) || 0) + 2 * yt, y = ((f == null ? void 0 : f.height) || 0) + 2 * yt, w = (r == null ? void 0 : r.clientWidth) || 0, T = (r == null ? void 0 : r.clientHeight) || 0;
|
|
2248
2249
|
switch (g) {
|
|
2249
|
-
case
|
|
2250
|
+
case we.ACTUAL:
|
|
2250
2251
|
t(100);
|
|
2251
2252
|
break;
|
|
2252
|
-
case
|
|
2253
|
+
case we.PAGE_FIT:
|
|
2253
2254
|
let d = 0;
|
|
2254
2255
|
const S = w > T;
|
|
2255
2256
|
y > C && S ? d = T / y : d = w / C;
|
|
2256
2257
|
const b = Math.floor(d * 100);
|
|
2257
2258
|
t(b);
|
|
2258
2259
|
break;
|
|
2259
|
-
case
|
|
2260
|
+
case we.PAGE_WIDTH:
|
|
2260
2261
|
t(Math.floor(w / C * 100));
|
|
2261
2262
|
break;
|
|
2262
2263
|
}
|
|
@@ -2268,38 +2269,38 @@ const oa = () => {
|
|
|
2268
2269
|
},
|
|
2269
2270
|
[t, v]
|
|
2270
2271
|
);
|
|
2271
|
-
return typeof o != "boolean" ? /* @__PURE__ */
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
!c && /* @__PURE__ */
|
|
2274
|
-
|
|
2272
|
+
return typeof o != "boolean" ? /* @__PURE__ */ a(o, { zoomLevel: e, setZoomLevel: t }) : o ? /* @__PURE__ */ O("div", { className: ye["rp-zoom-wrapper"], children: [
|
|
2273
|
+
/* @__PURE__ */ a(X, { content: "Zoom out", children: /* @__PURE__ */ a(B, { disabled: m, onClick: p, children: /* @__PURE__ */ a(ba, {}) }) }),
|
|
2274
|
+
!c && /* @__PURE__ */ a(X, { content: "Select zoom level", children: /* @__PURE__ */ a(
|
|
2275
|
+
ft,
|
|
2275
2276
|
{
|
|
2276
2277
|
container: n,
|
|
2277
|
-
triggerComponent: /* @__PURE__ */ O(B, { className:
|
|
2278
|
-
/* @__PURE__ */ O("span", { className:
|
|
2278
|
+
triggerComponent: /* @__PURE__ */ O(B, { className: ye["rp-current-zoom-wrapper"], children: [
|
|
2279
|
+
/* @__PURE__ */ O("span", { className: ye["rp-current-zoom"], children: [
|
|
2279
2280
|
e,
|
|
2280
2281
|
" %"
|
|
2281
2282
|
] }),
|
|
2282
|
-
/* @__PURE__ */
|
|
2283
|
+
/* @__PURE__ */ a(Me, { className: ye["rp-current-zoom-icon"] })
|
|
2283
2284
|
] }),
|
|
2284
2285
|
style: { minWidth: "200px" },
|
|
2285
2286
|
align: "center",
|
|
2286
|
-
children: /* @__PURE__ */ O("div", { className:
|
|
2287
|
-
/* @__PURE__ */ O(
|
|
2288
|
-
/* @__PURE__ */
|
|
2289
|
-
/* @__PURE__ */
|
|
2290
|
-
/* @__PURE__ */
|
|
2287
|
+
children: /* @__PURE__ */ O("div", { className: ye["rp-zoom-dropdown-content"], children: [
|
|
2288
|
+
/* @__PURE__ */ O(Fe, { children: [
|
|
2289
|
+
/* @__PURE__ */ a(ce, { onClick: () => _(we.ACTUAL), children: "Actual size" }),
|
|
2290
|
+
/* @__PURE__ */ a(ce, { onClick: () => _(we.PAGE_FIT), children: "Page fit" }),
|
|
2291
|
+
/* @__PURE__ */ a(ce, { onClick: () => _(we.PAGE_WIDTH), children: "Page width" })
|
|
2291
2292
|
] }),
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ a(vt, {}),
|
|
2294
|
+
/* @__PURE__ */ a(Fe, { children: _a.map((g) => /* @__PURE__ */ O(ce, { onClick: () => _(g), children: [
|
|
2294
2295
|
g,
|
|
2295
2296
|
" %"
|
|
2296
2297
|
] }, g)) })
|
|
2297
2298
|
] })
|
|
2298
2299
|
}
|
|
2299
|
-
),
|
|
2300
|
-
/* @__PURE__ */
|
|
2300
|
+
) }),
|
|
2301
|
+
/* @__PURE__ */ a(X, { content: "Zoom in", children: /* @__PURE__ */ a(B, { disabled: u, onClick: h, children: /* @__PURE__ */ a(wa, {}) }) })
|
|
2301
2302
|
] }) : null;
|
|
2302
|
-
},
|
|
2303
|
+
}, te = {
|
|
2303
2304
|
"rp-search-tool-content": "_rp-search-tool-content_1vxow_1",
|
|
2304
2305
|
"rp-search-tool-input": "_rp-search-tool-input_1vxow_6",
|
|
2305
2306
|
"rp-search-tool-input-icon": "_rp-search-tool-input-icon_1vxow_12",
|
|
@@ -2308,13 +2309,13 @@ const oa = () => {
|
|
|
2308
2309
|
"rp-search-tool-input-checkboxes": "_rp-search-tool-input-checkboxes_1vxow_30",
|
|
2309
2310
|
"rp-search-tool-input-clear": "_rp-search-tool-input-clear_1vxow_35",
|
|
2310
2311
|
"rp-search-input": "_rp-search-input_1vxow_49"
|
|
2311
|
-
},
|
|
2312
|
-
const { searchIcon: e } =
|
|
2313
|
-
return e || /* @__PURE__ */
|
|
2314
|
-
},
|
|
2315
|
-
const { container: e } =
|
|
2312
|
+
}, Gt = () => {
|
|
2313
|
+
const { searchIcon: e } = ne();
|
|
2314
|
+
return e || /* @__PURE__ */ a(Jr, {});
|
|
2315
|
+
}, Pa = () => {
|
|
2316
|
+
const { container: e } = qe(), [t, n] = F(!1), { pdf: r } = Y(), [o, i] = F(null), {
|
|
2316
2317
|
searchOptions: l,
|
|
2317
|
-
setSearchOptions:
|
|
2318
|
+
setSearchOptions: s,
|
|
2318
2319
|
loading: c,
|
|
2319
2320
|
setSearch: h,
|
|
2320
2321
|
totalMatches: p,
|
|
@@ -2322,7 +2323,7 @@ const oa = () => {
|
|
|
2322
2323
|
nextMatch: u,
|
|
2323
2324
|
prevMatch: f,
|
|
2324
2325
|
search: v
|
|
2325
|
-
} =
|
|
2326
|
+
} = nn(), { searchTool: _ } = se(), [g, C] = F(v), y = x(() => {
|
|
2326
2327
|
n(!0);
|
|
2327
2328
|
}, []), w = x(() => {
|
|
2328
2329
|
h(""), C(""), n(!1);
|
|
@@ -2337,9 +2338,9 @@ const oa = () => {
|
|
|
2337
2338
|
},
|
|
2338
2339
|
[g, f, u, h]
|
|
2339
2340
|
);
|
|
2340
|
-
|
|
2341
|
+
z(() => (window.addEventListener("keydown", T), () => {
|
|
2341
2342
|
window.removeEventListener("keydown", T);
|
|
2342
|
-
}), [T]),
|
|
2343
|
+
}), [T]), z(() => {
|
|
2343
2344
|
o && o.focus();
|
|
2344
2345
|
}, [o]);
|
|
2345
2346
|
const S = x((R) => {
|
|
@@ -2348,153 +2349,153 @@ const oa = () => {
|
|
|
2348
2349
|
C(""), h("");
|
|
2349
2350
|
}, [h]), P = D(() => `${m} / ${p}`, [m, p]), { wholeWords: N, matchCase: I } = D(() => l, [l]), M = x(
|
|
2350
2351
|
(R) => {
|
|
2351
|
-
|
|
2352
|
+
s((E) => ({ ...E, matchCase: R }));
|
|
2352
2353
|
},
|
|
2353
|
-
[
|
|
2354
|
+
[s]
|
|
2354
2355
|
), L = x(
|
|
2355
2356
|
(R) => {
|
|
2356
|
-
|
|
2357
|
+
s((E) => ({ ...E, wholeWords: R }));
|
|
2357
2358
|
},
|
|
2358
|
-
[
|
|
2359
|
+
[s]
|
|
2359
2360
|
);
|
|
2360
|
-
return
|
|
2361
|
+
return z(() => {
|
|
2361
2362
|
w();
|
|
2362
|
-
}, [r, w]), _ ? /* @__PURE__ */
|
|
2363
|
-
|
|
2363
|
+
}, [r, w]), _ ? /* @__PURE__ */ a(
|
|
2364
|
+
ft,
|
|
2364
2365
|
{
|
|
2365
2366
|
open: t,
|
|
2366
2367
|
container: e,
|
|
2367
2368
|
align: "start",
|
|
2368
|
-
triggerComponent: /* @__PURE__ */
|
|
2369
|
-
children: /* @__PURE__ */ O("div", { className:
|
|
2370
|
-
/* @__PURE__ */ O("div", { className:
|
|
2371
|
-
/* @__PURE__ */ O("div", { className:
|
|
2372
|
-
/* @__PURE__ */
|
|
2373
|
-
|
|
2369
|
+
triggerComponent: /* @__PURE__ */ a(X, { content: "Search in Document", children: /* @__PURE__ */ a(B, { onClick: y, children: /* @__PURE__ */ a(Gt, {}) }) }),
|
|
2370
|
+
children: /* @__PURE__ */ O("div", { className: te["rp-search-tool-content"], children: [
|
|
2371
|
+
/* @__PURE__ */ O("div", { className: te["rp-search-tool-input-wrapper"], children: [
|
|
2372
|
+
/* @__PURE__ */ O("div", { className: te["rp-search-tool-input"], children: [
|
|
2373
|
+
/* @__PURE__ */ a(
|
|
2374
|
+
Zt,
|
|
2374
2375
|
{
|
|
2375
2376
|
value: g,
|
|
2376
2377
|
onKeyDown: d,
|
|
2377
2378
|
onChange: S,
|
|
2378
|
-
icon: /* @__PURE__ */
|
|
2379
|
+
icon: /* @__PURE__ */ a(Gt, {}),
|
|
2379
2380
|
placeholder: "Enter to Search",
|
|
2380
|
-
className:
|
|
2381
|
-
ref:
|
|
2382
|
-
children: !!g && /* @__PURE__ */
|
|
2381
|
+
className: te["rp-search-input"],
|
|
2382
|
+
ref: i,
|
|
2383
|
+
children: !!g && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: b, children: /* @__PURE__ */ a(Yr, {}) })
|
|
2383
2384
|
}
|
|
2384
2385
|
),
|
|
2385
|
-
c ? /* @__PURE__ */
|
|
2386
|
+
c ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(pt, {}) }) : /* @__PURE__ */ a("span", { children: P })
|
|
2386
2387
|
] }),
|
|
2387
|
-
/* @__PURE__ */ O("div", { className:
|
|
2388
|
-
/* @__PURE__ */
|
|
2389
|
-
/* @__PURE__ */
|
|
2388
|
+
/* @__PURE__ */ O("div", { className: te["rp-search-tool-input-checkboxes"], children: [
|
|
2389
|
+
/* @__PURE__ */ a(xt, { name: "matchCase", value: I, onChange: M, children: "Match Case" }),
|
|
2390
|
+
/* @__PURE__ */ a(xt, { name: "wholeWord", value: N, onChange: L, children: "Whole Word" })
|
|
2390
2391
|
] })
|
|
2391
2392
|
] }),
|
|
2392
|
-
/* @__PURE__ */ O("div", { className:
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
|
|
2393
|
+
/* @__PURE__ */ O("div", { className: te["rp-search-tool-controls"], children: [
|
|
2394
|
+
/* @__PURE__ */ a(B, { onClick: f, children: /* @__PURE__ */ a(Me, { className: te["rp-search-tool-input-icon"] }) }),
|
|
2395
|
+
/* @__PURE__ */ a(B, { onClick: u, children: /* @__PURE__ */ a(
|
|
2396
|
+
Me,
|
|
2396
2397
|
{
|
|
2397
2398
|
style: { transform: "rotate(180deg" },
|
|
2398
|
-
className:
|
|
2399
|
+
className: te["rp-search-tool-input-icon"]
|
|
2399
2400
|
}
|
|
2400
2401
|
) }),
|
|
2401
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(Yt, { onClick: w, className: te["rp-search-tool-input-icon"] }) })
|
|
2402
2403
|
] })
|
|
2403
2404
|
] })
|
|
2404
2405
|
}
|
|
2405
2406
|
) : null;
|
|
2406
|
-
},
|
|
2407
|
+
}, Sa = "_loading_1snj5_1", Ce = {
|
|
2407
2408
|
"rp-loading-overlay": "_rp-loading-overlay_1snj5_1",
|
|
2408
2409
|
"rp-loading-modal": "_rp-loading-modal_1snj5_14",
|
|
2409
2410
|
"rp-loading-title": "_rp-loading-title_1snj5_27",
|
|
2410
2411
|
"rp-loading-progress-bar": "_rp-loading-progress-bar_1snj5_35",
|
|
2411
2412
|
"rp-loading-progress": "_rp-loading-progress_1snj5_35",
|
|
2412
2413
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_1snj5_52",
|
|
2413
|
-
loading:
|
|
2414
|
-
},
|
|
2415
|
-
const { cancel: t } =
|
|
2416
|
-
return e < 1 ? null : /* @__PURE__ */
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2414
|
+
loading: Sa
|
|
2415
|
+
}, Ta = ({ percentage: e }) => {
|
|
2416
|
+
const { cancel: t } = Tt();
|
|
2417
|
+
return e < 1 ? null : /* @__PURE__ */ a("div", { className: j(Ce["rp-loading-overlay"]), children: /* @__PURE__ */ O("div", { className: j(Ce["rp-loading-modal"]), children: [
|
|
2418
|
+
/* @__PURE__ */ a("div", { className: j(Ce["rp-loading-title"]), children: "Preparing document..." }),
|
|
2419
|
+
/* @__PURE__ */ a("div", { className: j(Ce["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
|
|
2419
2420
|
"div",
|
|
2420
2421
|
{
|
|
2421
|
-
className: j(
|
|
2422
|
+
className: j(Ce["rp-loading-progress"]),
|
|
2422
2423
|
style: { width: `${e}%` }
|
|
2423
2424
|
}
|
|
2424
2425
|
) }),
|
|
2425
|
-
/* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ a("button", { className: j(Ce["rp-loading-cancel-button"]), onClick: t, children: "Cancel" })
|
|
2426
2427
|
] }) });
|
|
2427
|
-
},
|
|
2428
|
-
const { showPrintProgress: n } = se(), { progress: r } =
|
|
2428
|
+
}, Ia = $e((e, t) => {
|
|
2429
|
+
const { showPrintProgress: n } = se(), { progress: r } = Tt(), { isSmallScreen: o } = ge(), { percentage: i } = r || {}, l = () => o ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
2429
2430
|
return /* @__PURE__ */ O("div", { children: [
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
/* @__PURE__ */ O("div", { "data-rp": "topBarStart", className:
|
|
2432
|
-
/* @__PURE__ */
|
|
2433
|
-
/* @__PURE__ */
|
|
2431
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarWrapper", ref: t, className: Ie["rp-toolbar-content"], children: /* @__PURE__ */ O("div", { "data-rp": "topBar", className: Ie["rp-toolbar-wrapper"], style: l(), children: [
|
|
2432
|
+
/* @__PURE__ */ O("div", { "data-rp": "topBarStart", className: Ie["rp-toolbar-start"], children: [
|
|
2433
|
+
/* @__PURE__ */ a(Pa, {}),
|
|
2434
|
+
/* @__PURE__ */ a(Wo, {})
|
|
2434
2435
|
] }),
|
|
2435
|
-
/* @__PURE__ */
|
|
2436
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarMiddle", className: Ie["rp-toolbar-middle"], children: /* @__PURE__ */ a(Ca, {}) }),
|
|
2437
|
+
/* @__PURE__ */ a("div", { "data-rp": "topBarEnd", className: Ie["rp-toolbar-end"], children: /* @__PURE__ */ a(ga, {}) })
|
|
2437
2438
|
] }) }),
|
|
2438
|
-
n &&
|
|
2439
|
+
n && i ? /* @__PURE__ */ a(Ta, { percentage: i }) : null
|
|
2439
2440
|
] });
|
|
2440
|
-
}),
|
|
2441
|
+
}), rt = {
|
|
2441
2442
|
"rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_p2vax_1",
|
|
2442
2443
|
"rp-sidebar-content": "_rp-sidebar-content_p2vax_1",
|
|
2443
2444
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_p2vax_16",
|
|
2444
2445
|
"rp-thumbnail-dragging": "_rp-thumbnail-dragging_p2vax_21"
|
|
2445
|
-
},
|
|
2446
|
+
}, xe = {
|
|
2446
2447
|
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
2447
2448
|
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
2448
2449
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
2449
2450
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2450
2451
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2451
|
-
},
|
|
2452
|
-
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage:
|
|
2452
|
+
}, ya = (e) => {
|
|
2453
|
+
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage: i } = re(), l = D(() => r ? xe["rp-thumbnail-active"] : "", [r]), s = D(() => ({
|
|
2453
2454
|
width: Math.round(o.width),
|
|
2454
2455
|
height: Math.round(o.height)
|
|
2455
2456
|
}), [o]), c = x(() => {
|
|
2456
|
-
n &&
|
|
2457
|
-
}, [
|
|
2457
|
+
n && i(n);
|
|
2458
|
+
}, [i, n]);
|
|
2458
2459
|
return /* @__PURE__ */ O(
|
|
2459
2460
|
"div",
|
|
2460
2461
|
{
|
|
2461
2462
|
onClick: c,
|
|
2462
2463
|
id: `page-${n}`,
|
|
2463
|
-
className:
|
|
2464
|
+
className: xe["rp-thumbnail-wrapper"],
|
|
2464
2465
|
children: [
|
|
2465
|
-
/* @__PURE__ */
|
|
2466
|
+
/* @__PURE__ */ a("div", { className: j(l, xe["rp-thumbnail"]), children: t ? /* @__PURE__ */ a(
|
|
2466
2467
|
"img",
|
|
2467
2468
|
{
|
|
2468
2469
|
src: t,
|
|
2469
|
-
width:
|
|
2470
|
-
height:
|
|
2470
|
+
width: s.width,
|
|
2471
|
+
height: s.height,
|
|
2471
2472
|
alt: "thumbnail"
|
|
2472
2473
|
}
|
|
2473
|
-
) : /* @__PURE__ */
|
|
2474
|
+
) : /* @__PURE__ */ a(
|
|
2474
2475
|
"div",
|
|
2475
2476
|
{
|
|
2476
|
-
className:
|
|
2477
|
+
className: xe["rp-thumbnail-loader"],
|
|
2477
2478
|
style: {
|
|
2478
|
-
width: `${
|
|
2479
|
-
height: `${
|
|
2479
|
+
width: `${s.width}px`,
|
|
2480
|
+
height: `${s.height}px`
|
|
2480
2481
|
},
|
|
2481
|
-
children: /* @__PURE__ */
|
|
2482
|
+
children: /* @__PURE__ */ a(pt, {})
|
|
2482
2483
|
}
|
|
2483
2484
|
) }),
|
|
2484
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ a("div", { className: xe["rp-thumbnail-text"], children: n })
|
|
2485
2486
|
]
|
|
2486
2487
|
}
|
|
2487
2488
|
);
|
|
2488
|
-
},
|
|
2489
|
+
}, Ut = {
|
|
2489
2490
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
2490
2491
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
2491
|
-
},
|
|
2492
|
-
const [e, t] = F({}), { pages: n } =
|
|
2493
|
-
(
|
|
2492
|
+
}, xa = () => {
|
|
2493
|
+
const [e, t] = F({}), { pages: n } = Y(), { rotate: r } = Ve(), o = D(() => Object.keys(e).length, [e]), i = x(
|
|
2494
|
+
(s) => {
|
|
2494
2495
|
if (!n.size)
|
|
2495
2496
|
return;
|
|
2496
|
-
const c = Array.from(n.values()).slice(0,
|
|
2497
|
-
const { thumbnailViewport: u, scale: f } =
|
|
2497
|
+
const c = Array.from(n.values()).slice(0, s).map((m) => {
|
|
2498
|
+
const { thumbnailViewport: u, scale: f } = It(m.page, r);
|
|
2498
2499
|
return {
|
|
2499
2500
|
scale: f,
|
|
2500
2501
|
page: m.page,
|
|
@@ -2505,7 +2506,7 @@ const oa = () => {
|
|
|
2505
2506
|
t(h);
|
|
2506
2507
|
const p = [];
|
|
2507
2508
|
for (const m of c) {
|
|
2508
|
-
const u = document.createElement("canvas"), f =
|
|
2509
|
+
const u = document.createElement("canvas"), f = ot(
|
|
2509
2510
|
m.page,
|
|
2510
2511
|
u,
|
|
2511
2512
|
m.scale,
|
|
@@ -2530,19 +2531,19 @@ const oa = () => {
|
|
|
2530
2531
|
},
|
|
2531
2532
|
[n, r]
|
|
2532
2533
|
);
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
}, [
|
|
2534
|
+
z(() => {
|
|
2535
|
+
i(10);
|
|
2536
|
+
}, [i]);
|
|
2536
2537
|
const l = x(
|
|
2537
|
-
(
|
|
2538
|
+
(s) => {
|
|
2538
2539
|
if (!n)
|
|
2539
2540
|
return;
|
|
2540
|
-
const c = n.get(
|
|
2541
|
+
const c = n.get(s);
|
|
2541
2542
|
if (!c)
|
|
2542
2543
|
return;
|
|
2543
2544
|
t((p) => ({
|
|
2544
2545
|
...p,
|
|
2545
|
-
[
|
|
2546
|
+
[s]: {
|
|
2546
2547
|
loading: !0,
|
|
2547
2548
|
page: c.page,
|
|
2548
2549
|
viewport: c.thumbnailViewport,
|
|
@@ -2550,8 +2551,8 @@ const oa = () => {
|
|
|
2550
2551
|
}
|
|
2551
2552
|
}));
|
|
2552
2553
|
const h = document.createElement("canvas");
|
|
2553
|
-
|
|
2554
|
-
const p = h.toDataURL(), { thumbnailViewport: m, scale: u } =
|
|
2554
|
+
ot(c.page, h, c.thumbnailScale, r).promise.then(() => {
|
|
2555
|
+
const p = h.toDataURL(), { thumbnailViewport: m, scale: u } = It(c.page, r);
|
|
2555
2556
|
return {
|
|
2556
2557
|
scale: u,
|
|
2557
2558
|
thumbnailSrc: p,
|
|
@@ -2560,13 +2561,13 @@ const oa = () => {
|
|
|
2560
2561
|
viewport: m
|
|
2561
2562
|
};
|
|
2562
2563
|
}).then((p) => {
|
|
2563
|
-
t((m) => ({ ...m, [
|
|
2564
|
+
t((m) => ({ ...m, [s]: p }));
|
|
2564
2565
|
});
|
|
2565
2566
|
},
|
|
2566
2567
|
[n, r]
|
|
2567
2568
|
);
|
|
2568
|
-
return { thumbnailPages: e, addPage: l, addToPage:
|
|
2569
|
-
},
|
|
2569
|
+
return { thumbnailPages: e, addPage: l, addToPage: i, thumbnailLength: o };
|
|
2570
|
+
}, En = We({
|
|
2570
2571
|
thumbnailPages: {},
|
|
2571
2572
|
addPage: (e) => {
|
|
2572
2573
|
},
|
|
@@ -2576,34 +2577,34 @@ const oa = () => {
|
|
|
2576
2577
|
setActive: (e) => {
|
|
2577
2578
|
},
|
|
2578
2579
|
active: !1
|
|
2579
|
-
}),
|
|
2580
|
+
}), On = () => He(En), Ra = ({
|
|
2580
2581
|
children: e,
|
|
2581
2582
|
initialThumbnailsVisible: t
|
|
2582
2583
|
}) => {
|
|
2583
|
-
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength:
|
|
2584
|
-
return /* @__PURE__ */
|
|
2585
|
-
|
|
2584
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } = xa(), [l, s] = F(t);
|
|
2585
|
+
return /* @__PURE__ */ a(
|
|
2586
|
+
En.Provider,
|
|
2586
2587
|
{
|
|
2587
|
-
value: { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength:
|
|
2588
|
+
value: { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i, active: l, setActive: s },
|
|
2588
2589
|
children: e
|
|
2589
2590
|
}
|
|
2590
2591
|
);
|
|
2591
|
-
},
|
|
2592
|
+
}, Ma = 16, La = (e, t) => {
|
|
2592
2593
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2593
|
-
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) -
|
|
2594
|
-
},
|
|
2595
|
-
const { show: n } = e, { focusedPage: r, totalPages: o } =
|
|
2596
|
-
|
|
2597
|
-
const m = D(() => Object.values(
|
|
2598
|
-
const f =
|
|
2594
|
+
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Ma);
|
|
2595
|
+
}, Na = $e((e, t) => {
|
|
2596
|
+
const { show: n } = e, { focusedPage: r, totalPages: o } = re(), { thumbnailPages: i, addPage: l, thumbnailLength: s, addToPage: c } = On(), h = $(null), p = $(1);
|
|
2597
|
+
qt(t, () => h.current);
|
|
2598
|
+
const m = D(() => Object.values(i), [i]), u = x(() => {
|
|
2599
|
+
const f = s + 1;
|
|
2599
2600
|
f <= o && l(f);
|
|
2600
|
-
}, [l, o,
|
|
2601
|
-
return
|
|
2602
|
-
r >
|
|
2603
|
-
}, [r,
|
|
2601
|
+
}, [l, o, s]);
|
|
2602
|
+
return z(() => {
|
|
2603
|
+
r > s ? c(r) : n && p.current !== r && (La(h.current, r), p.current = r);
|
|
2604
|
+
}, [r, s, c, n, m]), or(h.current, u), /* @__PURE__ */ a("div", { ref: h, className: Ut["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: Ut["rp-thumbnails"], children: n ? m.map((f, v) => {
|
|
2604
2605
|
var _, g;
|
|
2605
|
-
return /* @__PURE__ */
|
|
2606
|
-
|
|
2606
|
+
return /* @__PURE__ */ a(
|
|
2607
|
+
ya,
|
|
2607
2608
|
{
|
|
2608
2609
|
isFocused: r === ((_ = f.page) == null ? void 0 : _.pageNumber),
|
|
2609
2610
|
pageNumber: (g = f.page) == null ? void 0 : g.pageNumber,
|
|
@@ -2614,50 +2615,50 @@ const oa = () => {
|
|
|
2614
2615
|
v
|
|
2615
2616
|
);
|
|
2616
2617
|
}) : null }) });
|
|
2617
|
-
}),
|
|
2618
|
-
const { thumbnailIcon: e } =
|
|
2619
|
-
return e || /* @__PURE__ */
|
|
2620
|
-
},
|
|
2621
|
-
const { active: e, setActive: t } =
|
|
2618
|
+
}), Ea = () => {
|
|
2619
|
+
const { thumbnailIcon: e } = ne();
|
|
2620
|
+
return e || /* @__PURE__ */ a(Hn, {});
|
|
2621
|
+
}, Oa = () => {
|
|
2622
|
+
const { active: e, setActive: t } = On(), [n, r] = F(200), o = $(null), { thumbnailTool: i } = se(), l = x(() => {
|
|
2622
2623
|
t((c) => !c);
|
|
2623
|
-
}, []),
|
|
2624
|
+
}, []), s = D(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: l, active: e }) : i ? /* @__PURE__ */ a(X, { content: "Thumbnail", children: /* @__PURE__ */ a(B, { onClick: l, active: e, children: /* @__PURE__ */ a(Ea, {}) }) }) : null, [i, e, l]);
|
|
2624
2625
|
return /* @__PURE__ */ O(
|
|
2625
2626
|
"div",
|
|
2626
2627
|
{
|
|
2627
2628
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
2628
|
-
className:
|
|
2629
|
+
className: rt["rp-sidebar-content-wrapper"],
|
|
2629
2630
|
"data-rp": "sidebar",
|
|
2630
2631
|
children: [
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
/* @__PURE__ */ O("div", { "data-rp": "thumbnails", hidden: !e, className:
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ a("div", { "data-rp": "thumbnailButton", className: rt["rp-sidebar-content"], children: s }),
|
|
2633
|
+
/* @__PURE__ */ O("div", { "data-rp": "thumbnails", hidden: !e, className: rt["rp-thumbnails-wrapper"], children: [
|
|
2634
|
+
/* @__PURE__ */ a(Na, { show: e, ref: o }),
|
|
2635
|
+
/* @__PURE__ */ a(ar, { onWidthChange: r, thumbnailRef: o })
|
|
2635
2636
|
] })
|
|
2636
2637
|
]
|
|
2637
2638
|
}
|
|
2638
2639
|
);
|
|
2639
|
-
},
|
|
2640
|
+
}, Da = (e) => {
|
|
2640
2641
|
const {
|
|
2641
2642
|
children: t,
|
|
2642
2643
|
darkMode: n = !1,
|
|
2643
2644
|
onDarkModeChange: r,
|
|
2644
2645
|
initialRotate: o = 0,
|
|
2645
|
-
textLayer:
|
|
2646
|
+
textLayer: i = !0,
|
|
2646
2647
|
initialPage: l = 1,
|
|
2647
2648
|
// initialViewMode = ViewMode.SINGLE_PAGE,
|
|
2648
|
-
initialScale:
|
|
2649
|
-
initialScrollMode: c =
|
|
2649
|
+
initialScale: s,
|
|
2650
|
+
initialScrollMode: c = Q.VERTICAL_SCROLLING,
|
|
2650
2651
|
mobileWidth: h
|
|
2651
2652
|
} = e;
|
|
2652
|
-
return /* @__PURE__ */
|
|
2653
|
-
|
|
2653
|
+
return /* @__PURE__ */ a(
|
|
2654
|
+
vr,
|
|
2654
2655
|
{
|
|
2655
|
-
initialScale:
|
|
2656
|
+
initialScale: s,
|
|
2656
2657
|
initialPage: l,
|
|
2657
2658
|
initialScrollMode: c,
|
|
2658
2659
|
initialRotate: o,
|
|
2659
|
-
children: /* @__PURE__ */
|
|
2660
|
-
|
|
2660
|
+
children: /* @__PURE__ */ a(hr, { mobileWidth: h, children: /* @__PURE__ */ a(dr, { children: /* @__PURE__ */ a(Yn, { children: /* @__PURE__ */ a(Zn, { children: /* @__PURE__ */ a(Wn, { children: /* @__PURE__ */ a(mr, { initialSelectionMode: jt.TEXT, children: /* @__PURE__ */ a(pr, { children: /* @__PURE__ */ a(Oo, { children: /* @__PURE__ */ a(qn, { children: /* @__PURE__ */ a(ur, { textLayer: i, children: /* @__PURE__ */ a(Bn, { children: /* @__PURE__ */ a(
|
|
2661
|
+
Gn,
|
|
2661
2662
|
{
|
|
2662
2663
|
darkMode: n,
|
|
2663
2664
|
onDarkModeChange: r,
|
|
@@ -2666,91 +2667,91 @@ const oa = () => {
|
|
|
2666
2667
|
) }) }) }) }) }) }) }) }) }) }) })
|
|
2667
2668
|
}
|
|
2668
2669
|
);
|
|
2669
|
-
},
|
|
2670
|
+
}, rs = $e((e, t) => {
|
|
2670
2671
|
const {
|
|
2671
2672
|
children: n,
|
|
2672
2673
|
slots: r,
|
|
2673
2674
|
icons: o,
|
|
2674
|
-
initialThumbnailsVisible:
|
|
2675
|
+
initialThumbnailsVisible: i = !1,
|
|
2675
2676
|
initialSearch: l,
|
|
2676
|
-
showToolbar:
|
|
2677
|
+
showToolbar: s = !0,
|
|
2677
2678
|
style: c,
|
|
2678
2679
|
className: h,
|
|
2679
2680
|
onLoaded: p,
|
|
2680
2681
|
cleanupOnLoaded: m,
|
|
2681
2682
|
...u
|
|
2682
2683
|
} = e, [f, v] = F(null), [_, g] = F(null), [C, y] = F(null);
|
|
2683
|
-
return
|
|
2684
|
+
return z(() => (p && p(), () => {
|
|
2684
2685
|
m && m();
|
|
2685
|
-
}), [p, m]), /* @__PURE__ */
|
|
2686
|
-
|
|
2686
|
+
}), [p, m]), /* @__PURE__ */ a("div", { ref: t, className: j(he["rp-theme-variables"], he["rp-container"]), children: /* @__PURE__ */ a(lr, { container: _, contentRef: C, children: /* @__PURE__ */ a(Da, { ...u, children: /* @__PURE__ */ a(to, { initialSearch: l, children: /* @__PURE__ */ a(Ra, { initialThumbnailsVisible: i, children: /* @__PURE__ */ a(Un, { slots: r, children: /* @__PURE__ */ a(Vn, { children: /* @__PURE__ */ a(ir, { icons: o, children: /* @__PURE__ */ a(wr, { elementRef: C, children: /* @__PURE__ */ a(la, { children: /* @__PURE__ */ a(jn, { children: s ? /* @__PURE__ */ a(
|
|
2687
|
+
sr,
|
|
2687
2688
|
{
|
|
2688
2689
|
getContainerRef: g,
|
|
2689
2690
|
toolbarRef: f,
|
|
2690
2691
|
style: c,
|
|
2691
2692
|
className: h,
|
|
2692
|
-
children: /* @__PURE__ */ O(
|
|
2693
|
-
/* @__PURE__ */ O("div", { className:
|
|
2694
|
-
/* @__PURE__ */
|
|
2695
|
-
/* @__PURE__ */ O("div", { className:
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2693
|
+
children: /* @__PURE__ */ O(br, { children: [
|
|
2694
|
+
/* @__PURE__ */ O("div", { className: he["rp-layout"], children: [
|
|
2695
|
+
/* @__PURE__ */ a(Ia, { ref: v }),
|
|
2696
|
+
/* @__PURE__ */ O("div", { className: he["rp-content"], children: [
|
|
2697
|
+
/* @__PURE__ */ a("div", { className: he["rp-sidebar"], children: /* @__PURE__ */ a(Oa, {}) }),
|
|
2698
|
+
/* @__PURE__ */ a("div", { ref: y, className: he["rp-pages"], children: n })
|
|
2698
2699
|
] })
|
|
2699
2700
|
] }),
|
|
2700
|
-
/* @__PURE__ */
|
|
2701
|
+
/* @__PURE__ */ a($n, {})
|
|
2701
2702
|
] })
|
|
2702
2703
|
}
|
|
2703
|
-
) : /* @__PURE__ */
|
|
2704
|
+
) : /* @__PURE__ */ a(
|
|
2704
2705
|
"div",
|
|
2705
2706
|
{
|
|
2706
2707
|
ref: y,
|
|
2707
|
-
className: j(
|
|
2708
|
+
className: j(he["rp-pages"], h),
|
|
2708
2709
|
style: c,
|
|
2709
2710
|
children: n
|
|
2710
2711
|
}
|
|
2711
2712
|
) }) }) }) }) }) }) }) }) }) }) });
|
|
2712
2713
|
});
|
|
2713
2714
|
export {
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2715
|
+
po as A,
|
|
2716
|
+
Ra as B,
|
|
2717
|
+
Qr as C,
|
|
2718
|
+
Do as D,
|
|
2719
|
+
Na as E,
|
|
2720
|
+
xn as F,
|
|
2721
|
+
Oa as G,
|
|
2722
|
+
Da as H,
|
|
2723
|
+
Ta as L,
|
|
2724
|
+
fa as M,
|
|
2725
|
+
ma as O,
|
|
2726
|
+
un as P,
|
|
2727
|
+
es as R,
|
|
2728
|
+
tn as S,
|
|
2729
|
+
no as T,
|
|
2730
|
+
Ca as Z,
|
|
2731
|
+
rs as a,
|
|
2732
|
+
oa as b,
|
|
2733
|
+
Tt as c,
|
|
2734
|
+
nn as d,
|
|
2735
|
+
_t as e,
|
|
2736
|
+
eo as f,
|
|
2737
|
+
to as g,
|
|
2738
|
+
wt as h,
|
|
2739
|
+
Mo as i,
|
|
2740
|
+
Eo as j,
|
|
2741
|
+
Oo as k,
|
|
2742
|
+
Ao as l,
|
|
2743
|
+
Wo as m,
|
|
2744
|
+
na as n,
|
|
2745
|
+
sa as o,
|
|
2746
|
+
Rn as p,
|
|
2747
|
+
la as q,
|
|
2748
|
+
Nn as r,
|
|
2749
|
+
ga as s,
|
|
2750
|
+
Pa as t,
|
|
2751
|
+
re as u,
|
|
2752
|
+
Ia as v,
|
|
2753
|
+
ya as w,
|
|
2754
|
+
xa as x,
|
|
2755
|
+
En as y,
|
|
2756
|
+
On as z
|
|
2756
2757
|
};
|