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