@pdf-viewer/react 0.5.0-beta.0 → 0.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPLayout-88110444.js → RPLayout-f99f3c29.js} +653 -655
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPViewer.js +1 -1
- package/dist/components/layout/RPLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +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/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/PaginateContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a, jsxs as O, Fragment as Ae } from "react/jsx-runtime";
|
|
2
2
|
import * as V from "react";
|
|
3
|
-
import { useRef as $, useEffect as
|
|
3
|
+
import { useRef as $, useEffect as A, useCallback as M, useState as F, useMemo as D, createContext as We, useContext as He, forwardRef as $e, useImperativeHandle as qt, createElement as Ne, PureComponent as zn, Component as Fn, memo as kn } from "react";
|
|
4
4
|
import { ChevronUpIcon as Me } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as B } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as Zt } from "./components/ui/Input.js";
|
|
@@ -27,7 +27,7 @@ import { AnnotationLayer as er, PixelsPerInch as tr, AnnotationMode as nr, Rende
|
|
|
27
27
|
import { getThumbnailViewport as It } from "./utils/getThumbnailViewport.js";
|
|
28
28
|
import { useInfiniteScroll as or } from "./utils/hooks/useInfiniteScroll.js";
|
|
29
29
|
import { RPSplitter as ar } from "./components/layout/sidebar/RPSplitter.js";
|
|
30
|
-
import { useIconContext as
|
|
30
|
+
import { useIconContext as re, IconProvider as ir } from "./contexts/IconContext.js";
|
|
31
31
|
import X from "./components/ui/RPTooltip.js";
|
|
32
32
|
import { c as he, C as sr } from "./Container-337e1b18.js";
|
|
33
33
|
import { useLayoutContainer as qe, LayoutContainerProvider as lr } from "./contexts/LayoutContainerContext.js";
|
|
@@ -48,12 +48,12 @@ import { usePageDimension as Xt } from "./utils/hooks/usePageDimension.js";
|
|
|
48
48
|
import { useMousePressed as Tr } from "./utils/hooks/useMousePressed.js";
|
|
49
49
|
import { useGrabScroll as Ir } from "./utils/hooks/useGrabScroll.js";
|
|
50
50
|
import { useDebounce as yr } from "./utils/hooks/useDebounce.js";
|
|
51
|
-
import { appConsole as
|
|
51
|
+
import { appConsole as Rr } from "./utils/appConsole.js";
|
|
52
52
|
import { FileUploadTool as Jt } from "./components/layout/toolbar/FileUploadTool.js";
|
|
53
|
-
import { DarkModeTool as
|
|
53
|
+
import { DarkModeTool as xr } from "./components/layout/toolbar/DarkModeTool.js";
|
|
54
54
|
import { ThreeDotIcon as Mr } from "./components/icons/ThreeDotIcon.js";
|
|
55
55
|
import { UIDropDown as ft } from "./components/ui/DropDown.js";
|
|
56
|
-
import { c as Lr, u as mt, a as Le, b as
|
|
56
|
+
import { c as Lr, u as mt, a as Le, b as xe, d as gt, e as Nr, f as Er, h as Or, g as Dr, F as Ar, D as zr, i as Fr, j as kr, k as Be, l as Wr, G as Fe } from "./index-8049287f.js";
|
|
57
57
|
import { CloseIcon as Yt } from "./components/icons/CloseIcon.js";
|
|
58
58
|
import { PropertyItem as Hr } from "./components/layout/toolbar/PropertyItem.js";
|
|
59
59
|
import { useOtherToolContext as $r, OtherToolProvider as Vr } from "./contexts/OtherToolContext.js";
|
|
@@ -71,7 +71,7 @@ import { ZoomInIcon as Kr } from "./components/icons/ZoomInIcon.js";
|
|
|
71
71
|
import { ZoomOutIcon as Xr } from "./components/icons/ZoomOutIcon.js";
|
|
72
72
|
import { PAGE_PADDING as yt } from "./utils/constants.js";
|
|
73
73
|
import { SearchIcon as Jr } from "./components/icons/SearchIcon.js";
|
|
74
|
-
import { UICheckbox as
|
|
74
|
+
import { UICheckbox as Rt } from "./components/ui/Checkbox.js";
|
|
75
75
|
import { ClearIcon as Yr } from "./components/icons/ClearIcon.js";
|
|
76
76
|
import './assets/RPLayout.css';const ae = {
|
|
77
77
|
"rp-pages": "_rp-pages_34orh_1",
|
|
@@ -87,17 +87,17 @@ import './assets/RPLayout.css';const ae = {
|
|
|
87
87
|
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
88
88
|
}, Qr = (e) => {
|
|
89
89
|
const { pageNumber: t, onLoaded: n, onLoading: r } = e, o = $(null), { pages: i } = Y(), { rotate: l } = Ve(), s = $(), { currentZoom: c } = ht();
|
|
90
|
-
return
|
|
90
|
+
return A(() => {
|
|
91
91
|
if (!i || c === 0)
|
|
92
92
|
return;
|
|
93
93
|
const h = i.get(t);
|
|
94
94
|
if (o.current && h) {
|
|
95
95
|
const p = o.current;
|
|
96
96
|
p.hidden = !0;
|
|
97
|
-
const
|
|
98
|
-
|
|
97
|
+
const g = s.current;
|
|
98
|
+
g && g.cancel(), r && r(), s.current = ot(h.page, p, c, l), s.current.promise.then(() => {
|
|
99
99
|
p.hidden = !1;
|
|
100
|
-
}).catch((
|
|
100
|
+
}).catch((d) => {
|
|
101
101
|
}).finally(() => {
|
|
102
102
|
n && n();
|
|
103
103
|
});
|
|
@@ -107,112 +107,111 @@ import './assets/RPLayout.css';const ae = {
|
|
|
107
107
|
"rp-text-layer": "_rp-text-layer_1mgyz_1",
|
|
108
108
|
"rp-text-layer-text": "_rp-text-layer-text_1mgyz_9"
|
|
109
109
|
}, _t = () => {
|
|
110
|
-
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { virtualScrollRef: n, pageScrollElementRef: r } = Ue(), { setFocusedPage: o } =
|
|
111
|
-
|
|
110
|
+
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { virtualScrollRef: n, pageScrollElementRef: r } = Ue(), { setFocusedPage: o } = ee(), i = $(), { columnCount: l } = Bt(), s = Xt(), c = $(t), h = $(e);
|
|
111
|
+
A(() => {
|
|
112
112
|
n != null && n.scrollToItem && (i.current = n);
|
|
113
113
|
}, [n]);
|
|
114
|
-
const p =
|
|
115
|
-
(
|
|
114
|
+
const p = M(
|
|
115
|
+
(d) => {
|
|
116
116
|
if (!r)
|
|
117
117
|
return;
|
|
118
|
-
const f = Math.ceil(
|
|
119
|
-
|
|
118
|
+
const f = Math.ceil(d / 2) * 2 - 1;
|
|
119
|
+
d === f + 1 ? r.scrollTo({ left: s.widths[f], top: 0 }) : r.scrollTo({ left: 0, top: 0 });
|
|
120
120
|
},
|
|
121
121
|
[r, s]
|
|
122
122
|
);
|
|
123
|
-
return
|
|
123
|
+
return A(() => {
|
|
124
124
|
c.current = t, h.current = e;
|
|
125
|
-
}, [t, e]), { scrollToPage:
|
|
126
|
-
(
|
|
127
|
-
const v =
|
|
125
|
+
}, [t, e]), { scrollToPage: M(
|
|
126
|
+
(d, f = "start") => {
|
|
127
|
+
const v = d - 1;
|
|
128
|
+
let _ = v, m = 0;
|
|
128
129
|
if (h.current === ze.DUAL_PAGE && c.current === Q.PAGE_SCROLLING) {
|
|
129
|
-
p(
|
|
130
|
+
p(d);
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
132
133
|
if (c.current === Q.PAGE_SCROLLING) {
|
|
133
|
-
o(
|
|
134
|
+
o(d);
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
136
|
-
|
|
137
|
-
if (c.current === Q.HORIZONTAL_SCROLLING)
|
|
138
|
-
i.current.scrollToItem({ columnIndex: v, align: f });
|
|
139
|
-
else if (h.current === ze.DUAL_PAGE) {
|
|
140
|
-
const g = v % 2, C = Math.floor(v / 2);
|
|
141
|
-
i.current.scrollToItem({ columnIndex: g, rowIndex: C, align: f });
|
|
142
|
-
} else
|
|
143
|
-
i.current.scrollToItem({ rowIndex: v, align: f });
|
|
137
|
+
i.current && (c.current === Q.HORIZONTAL_SCROLLING ? m = v : h.current === ze.DUAL_PAGE && (m = v % 2, _ = Math.floor(v / 2)), i.current.scrollToItem({ rowIndex: _, columnIndex: m, align: f }));
|
|
144
138
|
},
|
|
145
139
|
[l, p, o]
|
|
146
140
|
) };
|
|
147
141
|
}, eo = (e = {}, t = "") => {
|
|
148
|
-
const [n, r] = F(t), [o, i] = F(!1), { pdf: l } = Y(), s = $(!n), [c, h] = F([]), [p,
|
|
149
|
-
|
|
150
|
-
if (
|
|
142
|
+
const [n, r] = F(t), [o, i] = F(!1), { pdf: l } = Y(), s = $(!n), [c, h] = F([]), [p, g] = F(0), { focusedPage: d } = ee(), { scrollToPage: f } = _t(), { virtualScrollRef: v, pageScrollElementRef: _, virtualScrollableElementRef: m } = Ue(), { scrollMode: C } = Pe(), [T, w] = F(null), S = D(() => p === 0 ? null : c[p - 1], [p, c]), u = D(() => c.length, [c]);
|
|
143
|
+
A(() => {
|
|
144
|
+
if (S && d !== S.page) {
|
|
145
|
+
const y = d < S.page ? "start" : "end";
|
|
146
|
+
f(S.page, y);
|
|
147
|
+
}
|
|
148
|
+
}, [S, f]), A(() => {
|
|
149
|
+
if (!S || d !== S.page || !T || !T.classList.contains("selected"))
|
|
151
150
|
return;
|
|
152
|
-
const
|
|
153
|
-
if (!
|
|
151
|
+
const y = m || _;
|
|
152
|
+
if (!y)
|
|
154
153
|
return;
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
top:
|
|
158
|
-
left:
|
|
154
|
+
const R = T.getBoundingClientRect(), L = y.clientHeight / 2, N = y.clientWidth / 2, x = y.scrollTop + R.top - L, E = y.scrollLeft + R.left - N;
|
|
155
|
+
y.scrollTo({
|
|
156
|
+
top: x,
|
|
157
|
+
left: E,
|
|
158
|
+
behavior: "smooth"
|
|
159
159
|
});
|
|
160
160
|
}, [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
d,
|
|
162
|
+
v,
|
|
163
|
+
T,
|
|
164
164
|
C,
|
|
165
|
-
|
|
166
|
-
_
|
|
167
|
-
v
|
|
165
|
+
m,
|
|
166
|
+
_
|
|
168
167
|
]);
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
}, [
|
|
172
|
-
|
|
173
|
-
}, [
|
|
174
|
-
if (!
|
|
168
|
+
const P = M(() => {
|
|
169
|
+
g((y) => u ? y + 1 > u ? 1 : y + 1 : 0);
|
|
170
|
+
}, [u]), b = M(() => {
|
|
171
|
+
g((y) => u ? y - 1 <= 0 ? u : y - 1 : 0);
|
|
172
|
+
}, [u]), I = M(async (y) => {
|
|
173
|
+
if (!y)
|
|
175
174
|
return {};
|
|
176
|
-
const
|
|
177
|
-
for (let
|
|
175
|
+
const R = y.numPages, L = {};
|
|
176
|
+
for (let N = 1; N <= R; N++) {
|
|
178
177
|
if (s.current)
|
|
179
178
|
throw "close pop over";
|
|
180
|
-
const
|
|
181
|
-
|
|
179
|
+
const x = await y.getPage(N);
|
|
180
|
+
L[N.toString()] = await x.getTextContent();
|
|
182
181
|
}
|
|
183
|
-
return
|
|
182
|
+
return L;
|
|
184
183
|
}, []);
|
|
185
|
-
return
|
|
184
|
+
return A(() => {
|
|
186
185
|
if (!n) {
|
|
187
|
-
s.current = !0, h([]),
|
|
186
|
+
s.current = !0, h([]), g(0);
|
|
188
187
|
return;
|
|
189
188
|
}
|
|
190
|
-
s.current = !1, i(!0), h([]),
|
|
191
|
-
const
|
|
192
|
-
const
|
|
189
|
+
s.current = !1, i(!0), h([]), g(0), I(l).then((y) => {
|
|
190
|
+
const L = Object.keys(y).reduce((N, x) => {
|
|
191
|
+
const E = Kn(
|
|
193
192
|
[n],
|
|
194
|
-
|
|
195
|
-
Number(
|
|
193
|
+
y[x],
|
|
194
|
+
Number(x) - 1,
|
|
196
195
|
e
|
|
197
|
-
).map((
|
|
198
|
-
return [...
|
|
196
|
+
).map((z, k) => ({ ...z, page: Number(x), pageMatchIdx: k }));
|
|
197
|
+
return [...N, ...E];
|
|
199
198
|
}, []);
|
|
200
|
-
h(
|
|
199
|
+
h(L), g(L.length ? 1 : 0);
|
|
201
200
|
}).catch(() => {
|
|
202
|
-
h([]),
|
|
201
|
+
h([]), g(0);
|
|
203
202
|
}).finally(() => i(!1));
|
|
204
|
-
}, [n,
|
|
203
|
+
}, [n, I, l, e]), {
|
|
205
204
|
search: n,
|
|
206
205
|
setSearch: r,
|
|
207
206
|
loading: o,
|
|
208
207
|
matches: c,
|
|
209
|
-
totalMatches:
|
|
208
|
+
totalMatches: u,
|
|
210
209
|
currentMatchPosition: p,
|
|
211
|
-
currentMatch:
|
|
212
|
-
nextMatch:
|
|
213
|
-
prevMatch:
|
|
214
|
-
currentMatchElement:
|
|
215
|
-
setCurrentMatchElement:
|
|
210
|
+
currentMatch: S,
|
|
211
|
+
nextMatch: P,
|
|
212
|
+
prevMatch: b,
|
|
213
|
+
currentMatchElement: T,
|
|
214
|
+
setCurrentMatchElement: w
|
|
216
215
|
};
|
|
217
216
|
}, tn = We({
|
|
218
217
|
search: "",
|
|
@@ -244,8 +243,8 @@ import './assets/RPLayout.css';const ae = {
|
|
|
244
243
|
currentMatch: c,
|
|
245
244
|
search: h,
|
|
246
245
|
matches: p,
|
|
247
|
-
nextMatch:
|
|
248
|
-
prevMatch:
|
|
246
|
+
nextMatch: g,
|
|
247
|
+
prevMatch: d,
|
|
249
248
|
currentMatchElement: f,
|
|
250
249
|
setCurrentMatchElement: v
|
|
251
250
|
} = eo(n, t);
|
|
@@ -260,8 +259,8 @@ import './assets/RPLayout.css';const ae = {
|
|
|
260
259
|
totalMatches: l,
|
|
261
260
|
currentMatchPosition: s,
|
|
262
261
|
currentMatch: c,
|
|
263
|
-
nextMatch:
|
|
264
|
-
prevMatch:
|
|
262
|
+
nextMatch: g,
|
|
263
|
+
prevMatch: d,
|
|
265
264
|
search: h,
|
|
266
265
|
matches: p,
|
|
267
266
|
currentMatchElement: f,
|
|
@@ -273,56 +272,56 @@ import './assets/RPLayout.css';const ae = {
|
|
|
273
272
|
}, nn = () => He(tn), no = (e) => {
|
|
274
273
|
const { pageNumber: t } = e, { pages: n } = Y(), r = $(null), { matches: o, currentMatch: i, setCurrentMatchElement: l } = nn(), [s, c] = F(
|
|
275
274
|
[]
|
|
276
|
-
), h = $(), p = $(),
|
|
277
|
-
(v, _,
|
|
278
|
-
if (
|
|
279
|
-
|
|
275
|
+
), h = $(), p = $(), g = $(), d = D(() => o.filter((v) => v.pageIndex === t - 1), [o, t]), f = M(
|
|
276
|
+
(v, _, m = !1) => {
|
|
277
|
+
if (m && Xn(v, _), !d.length) {
|
|
278
|
+
g.current = void 0, c([]);
|
|
280
279
|
return;
|
|
281
280
|
}
|
|
282
|
-
const C = Jn(
|
|
281
|
+
const C = Jn(d, v, _);
|
|
283
282
|
c(C);
|
|
284
283
|
},
|
|
285
|
-
[
|
|
284
|
+
[d]
|
|
286
285
|
);
|
|
287
|
-
return
|
|
288
|
-
var
|
|
289
|
-
if ((
|
|
286
|
+
return A(() => {
|
|
287
|
+
var m;
|
|
288
|
+
if ((m = g.current) == null || m.classList.remove("selected"), !s.length || !i || i.pageIndex !== t - 1)
|
|
290
289
|
return;
|
|
291
|
-
const v =
|
|
290
|
+
const v = d.findIndex(
|
|
292
291
|
(C) => JSON.stringify(C) === JSON.stringify(i)
|
|
293
292
|
);
|
|
294
293
|
if (v === -1)
|
|
295
294
|
return;
|
|
296
295
|
const _ = s.find((C) => C.index === v);
|
|
297
|
-
_ && (
|
|
298
|
-
}, [i, s,
|
|
296
|
+
_ && (g.current = _.element, l(_.element), _.element.classList.add("selected"));
|
|
297
|
+
}, [i, s, d]), A(() => {
|
|
299
298
|
const v = n.get(t);
|
|
300
299
|
if (!(!v || !r.current))
|
|
301
300
|
return h.current && h.current.cancel(), v.page.getTextContent().then((_) => {
|
|
302
|
-
const
|
|
301
|
+
const m = v.page.getViewport({ scale: 1 });
|
|
303
302
|
return h.current = new Qn.TextLayer({
|
|
304
|
-
viewport:
|
|
303
|
+
viewport: m,
|
|
305
304
|
textContentSource: _,
|
|
306
305
|
container: r.current
|
|
307
306
|
}), p.current = _, r.current && (r.current.innerText = ""), h.current.render();
|
|
308
307
|
}).then(() => {
|
|
309
308
|
var C;
|
|
310
|
-
[].slice.call(r.current.children).forEach((
|
|
311
|
-
|
|
309
|
+
[].slice.call(r.current.children).forEach((T) => {
|
|
310
|
+
T.classList.add(Xe["rp-text-layer-text"]);
|
|
312
311
|
});
|
|
313
|
-
const
|
|
314
|
-
|
|
312
|
+
const m = (C = h.current) == null ? void 0 : C.textDivs;
|
|
313
|
+
m && p.current && f(p.current, m);
|
|
315
314
|
}).catch(() => {
|
|
316
315
|
}), () => {
|
|
317
316
|
var _;
|
|
318
317
|
(_ = h.current) == null || _.cancel();
|
|
319
318
|
};
|
|
320
|
-
}, [n, t]),
|
|
321
|
-
var
|
|
319
|
+
}, [n, t]), A(() => {
|
|
320
|
+
var m;
|
|
322
321
|
[].slice.call(r.current.children).forEach((C) => {
|
|
323
322
|
C.classList.add(Xe["rp-text-layer-text"]);
|
|
324
323
|
});
|
|
325
|
-
const _ = (
|
|
324
|
+
const _ = (m = h.current) == null ? void 0 : m.textDivs;
|
|
326
325
|
_ && p.current && f(p.current, _, !0);
|
|
327
326
|
}, [f]), /* @__PURE__ */ a(
|
|
328
327
|
"div",
|
|
@@ -343,7 +342,7 @@ function ao(e, t) {
|
|
|
343
342
|
}
|
|
344
343
|
const io = (e, t, n) => {
|
|
345
344
|
st.set(on(e, t), n);
|
|
346
|
-
},
|
|
345
|
+
}, xt = (e, t) => {
|
|
347
346
|
switch (t[1].name) {
|
|
348
347
|
case "XYZ":
|
|
349
348
|
return {
|
|
@@ -385,9 +384,9 @@ async function an(e, t) {
|
|
|
385
384
|
const i = await e.getPageIndex(r);
|
|
386
385
|
return io(e, r, i), await an(e, n);
|
|
387
386
|
} else
|
|
388
|
-
return
|
|
387
|
+
return xt(o, n);
|
|
389
388
|
} else
|
|
390
|
-
return
|
|
389
|
+
return xt(n[0], n);
|
|
391
390
|
}
|
|
392
391
|
function so(e) {
|
|
393
392
|
const { id: t, url: n, unsafeUrl: r } = e, o = new MutationObserver((i) => {
|
|
@@ -434,7 +433,7 @@ const lo = (e) => {
|
|
|
434
433
|
return;
|
|
435
434
|
const s = t.find((c) => c.id === i);
|
|
436
435
|
!s || s.annotationType !== at.Link || s.dest && an(n, s.dest).then((c) => {
|
|
437
|
-
|
|
436
|
+
r(c);
|
|
438
437
|
});
|
|
439
438
|
};
|
|
440
439
|
function co(e, t) {
|
|
@@ -446,8 +445,8 @@ function uo(e, t) {
|
|
|
446
445
|
e.removeEventListener(n, t);
|
|
447
446
|
}
|
|
448
447
|
const po = (e) => {
|
|
449
|
-
const { pageNumber: t } = e, n = $(null), { pages: r, pdf: o } = Y(), i = $(), [l, s] = F(), [c, h] = F(null), [p,
|
|
450
|
-
|
|
448
|
+
const { pageNumber: t } = e, n = $(null), { pages: r, pdf: o } = Y(), i = $(), [l, s] = F(), [c, h] = F(null), [p, g] = F(), { setFocusedPage: d, goToPage: f } = ee(), { scrollMode: v } = Pe(), _ = D(() => r.get(t), [r, t]), m = D(() => _ == null ? void 0 : _.page.getViewport(), [_]);
|
|
449
|
+
A(() => {
|
|
451
450
|
o == null || o.hasJSActions().then((w) => {
|
|
452
451
|
s(w);
|
|
453
452
|
}), o == null || o.getFieldObjects().then((w) => {
|
|
@@ -455,18 +454,18 @@ const po = (e) => {
|
|
|
455
454
|
}), i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
456
455
|
}, [o]);
|
|
457
456
|
const C = D(() => o == null ? void 0 : o.annotationStorage, [o]);
|
|
458
|
-
|
|
457
|
+
A(() => {
|
|
459
458
|
_ && _.page.getAnnotations().then((w) => {
|
|
460
|
-
i.current = void 0,
|
|
459
|
+
i.current = void 0, g(w), n.current && (n.current.innerText = "");
|
|
461
460
|
});
|
|
462
461
|
}, [_]);
|
|
463
|
-
const
|
|
462
|
+
const T = M(
|
|
464
463
|
(w) => {
|
|
465
|
-
lo(w), !(!p || !o) && (v === Q.PAGE_SCROLLING ? Mt(w, p, o, (
|
|
464
|
+
lo(w), !(!p || !o) && (v === Q.PAGE_SCROLLING ? Mt(w, p, o, (S) => d(S.pageIndex + 1)) : Mt(w, p, o, (S) => f(S.pageIndex + 1)));
|
|
466
465
|
},
|
|
467
|
-
[o, p, f,
|
|
466
|
+
[o, p, f, d, v]
|
|
468
467
|
);
|
|
469
|
-
return
|
|
468
|
+
return A(() => {
|
|
470
469
|
if (!_ || !p)
|
|
471
470
|
return;
|
|
472
471
|
const w = _.page.getViewport();
|
|
@@ -476,12 +475,11 @@ const po = (e) => {
|
|
|
476
475
|
});
|
|
477
476
|
return;
|
|
478
477
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
switch (d) {
|
|
478
|
+
for (const S of p) {
|
|
479
|
+
const { annotationType: u } = S;
|
|
480
|
+
switch (u) {
|
|
483
481
|
case at.Link:
|
|
484
|
-
so(
|
|
482
|
+
so(S);
|
|
485
483
|
break;
|
|
486
484
|
case at.Widget:
|
|
487
485
|
break;
|
|
@@ -495,7 +493,7 @@ const po = (e) => {
|
|
|
495
493
|
structTreeLayer: void 0,
|
|
496
494
|
page: _.page,
|
|
497
495
|
viewport: w.clone({ dontFlip: !0 })
|
|
498
|
-
}), n.current && uo(n.current,
|
|
496
|
+
}), n.current && uo(n.current, T), i.current.render({
|
|
499
497
|
annotations: p,
|
|
500
498
|
annotationStorage: C,
|
|
501
499
|
hasJSActions: l,
|
|
@@ -509,29 +507,29 @@ const po = (e) => {
|
|
|
509
507
|
downloadManager: null,
|
|
510
508
|
enableScripting: !1
|
|
511
509
|
}).then(() => {
|
|
512
|
-
n.current && co(n.current,
|
|
510
|
+
n.current && co(n.current, T);
|
|
513
511
|
});
|
|
514
|
-
}, [p, l, c,
|
|
512
|
+
}, [p, l, c, T]), /* @__PURE__ */ a(
|
|
515
513
|
"div",
|
|
516
514
|
{
|
|
517
515
|
"data-rp": `page-${t}-annotationLayer`,
|
|
518
|
-
style: { width: `${
|
|
516
|
+
style: { width: `${m == null ? void 0 : m.width}px`, height: `${m == null ? void 0 : m.height}px` },
|
|
519
517
|
className: ro["rp-annotation-layer"],
|
|
520
518
|
ref: n
|
|
521
519
|
}
|
|
522
520
|
);
|
|
523
521
|
}, ho = Array.from({ length: 21 }, (e, t) => Number((t * 0.05).toFixed(2))), wt = $e((e, t) => {
|
|
524
|
-
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...i } = e, { pages: l } = Y(), { rotate: s } = Ve(), { textLayer: c } = cr(), { currentZoom: h } = ht(), p = $(l.get(n)), [
|
|
522
|
+
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...i } = e, { pages: l } = Y(), { rotate: s } = Ve(), { textLayer: c } = cr(), { currentZoom: h } = ht(), p = $(l.get(n)), [g, d] = F(!1), f = $(null), [v, _] = F({
|
|
525
523
|
width: 0,
|
|
526
524
|
height: 0
|
|
527
525
|
});
|
|
528
|
-
qt(t, () => f.current),
|
|
526
|
+
qt(t, () => f.current), A(() => {
|
|
529
527
|
if (l && (p.current = l.get(n), p.current)) {
|
|
530
528
|
const w = p.current.page.getViewport({ scale: h, rotation: s });
|
|
531
529
|
_(w);
|
|
532
530
|
}
|
|
533
531
|
}, [l, n, s, h]);
|
|
534
|
-
const
|
|
532
|
+
const m = D(() => {
|
|
535
533
|
switch (s) {
|
|
536
534
|
case 90:
|
|
537
535
|
return `${v.width / 2}px ${v.width / 2}px`;
|
|
@@ -541,15 +539,15 @@ const po = (e) => {
|
|
|
541
539
|
default:
|
|
542
540
|
return "center";
|
|
543
541
|
}
|
|
544
|
-
}, [s, v]), C =
|
|
545
|
-
|
|
546
|
-
}, []),
|
|
547
|
-
|
|
542
|
+
}, [s, v]), C = M(() => {
|
|
543
|
+
d(!0);
|
|
544
|
+
}, []), T = M(() => {
|
|
545
|
+
d(!1);
|
|
548
546
|
}, []);
|
|
549
|
-
return
|
|
547
|
+
return A(() => {
|
|
550
548
|
const w = new IntersectionObserver(
|
|
551
|
-
(
|
|
552
|
-
o && o(n,
|
|
549
|
+
(S) => {
|
|
550
|
+
o && o(n, S[0].intersectionRatio);
|
|
553
551
|
},
|
|
554
552
|
{ threshold: ho }
|
|
555
553
|
);
|
|
@@ -566,7 +564,7 @@ const po = (e) => {
|
|
|
566
564
|
style: {
|
|
567
565
|
...r,
|
|
568
566
|
"--rp-rotate": `${s}deg`,
|
|
569
|
-
"--rp-page-rotate-translate": `${
|
|
567
|
+
"--rp-page-rotate-translate": `${m}`,
|
|
570
568
|
"--scale-factor": h
|
|
571
569
|
},
|
|
572
570
|
className: Ke["rp-page-wrapper"],
|
|
@@ -579,8 +577,8 @@ const po = (e) => {
|
|
|
579
577
|
},
|
|
580
578
|
className: Ke["rp-page"],
|
|
581
579
|
children: [
|
|
582
|
-
/* @__PURE__ */ a(Qr, { onLoading: C, onLoaded:
|
|
583
|
-
|
|
580
|
+
/* @__PURE__ */ a(Qr, { onLoading: C, onLoaded: T, pageNumber: n }),
|
|
581
|
+
g && /* @__PURE__ */ a("div", { className: Ke["rp-loader-wrapper"], children: /* @__PURE__ */ a(pt, {}) }),
|
|
584
582
|
c && /* @__PURE__ */ a(no, { pageNumber: n }),
|
|
585
583
|
/* @__PURE__ */ a(po, { pageNumber: n })
|
|
586
584
|
]
|
|
@@ -692,159 +690,159 @@ var bo = 150, Co = function(t) {
|
|
|
692
690
|
}, Ee = null, Oe = null, De = null;
|
|
693
691
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Ee = /* @__PURE__ */ new WeakSet(), Oe = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakSet());
|
|
694
692
|
function Po(e) {
|
|
695
|
-
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment, h = e.getOffsetForRowAndAlignment, p = e.getRowHeight,
|
|
693
|
+
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment, h = e.getOffsetForRowAndAlignment, p = e.getRowHeight, g = e.getRowOffset, d = e.getRowStartIndexForOffset, f = e.getRowStopIndexForStartIndex, v = e.initInstanceProps, _ = e.shouldResetStyleCacheOnItemSizeChange, m = e.validateProps;
|
|
696
694
|
return t = /* @__PURE__ */ function(C) {
|
|
697
|
-
fo(
|
|
698
|
-
function
|
|
699
|
-
var
|
|
700
|
-
return
|
|
701
|
-
instance: Lt(
|
|
695
|
+
fo(T, C);
|
|
696
|
+
function T(S) {
|
|
697
|
+
var u;
|
|
698
|
+
return u = C.call(this, S) || this, u._instanceProps = v(u.props, Lt(u)), u._resetIsScrollingTimeoutId = null, u._outerRef = void 0, u.state = {
|
|
699
|
+
instance: Lt(u),
|
|
702
700
|
isScrolling: !1,
|
|
703
701
|
horizontalScrollDirection: "forward",
|
|
704
|
-
scrollLeft: typeof
|
|
705
|
-
scrollTop: typeof
|
|
702
|
+
scrollLeft: typeof u.props.initialScrollLeft == "number" ? u.props.initialScrollLeft : 0,
|
|
703
|
+
scrollTop: typeof u.props.initialScrollTop == "number" ? u.props.initialScrollTop : 0,
|
|
706
704
|
scrollUpdateWasRequested: !1,
|
|
707
705
|
verticalScrollDirection: "forward"
|
|
708
|
-
},
|
|
709
|
-
return
|
|
710
|
-
overscanColumnStartIndex:
|
|
706
|
+
}, u._callOnItemsRendered = void 0, u._callOnItemsRendered = Je(function(P, b, I, y, R, L, N, x) {
|
|
707
|
+
return u.props.onItemsRendered({
|
|
708
|
+
overscanColumnStartIndex: P,
|
|
711
709
|
overscanColumnStopIndex: b,
|
|
712
|
-
overscanRowStartIndex:
|
|
713
|
-
overscanRowStopIndex:
|
|
714
|
-
visibleColumnStartIndex:
|
|
715
|
-
visibleColumnStopIndex:
|
|
716
|
-
visibleRowStartIndex:
|
|
717
|
-
visibleRowStopIndex:
|
|
710
|
+
overscanRowStartIndex: I,
|
|
711
|
+
overscanRowStopIndex: y,
|
|
712
|
+
visibleColumnStartIndex: R,
|
|
713
|
+
visibleColumnStopIndex: L,
|
|
714
|
+
visibleRowStartIndex: N,
|
|
715
|
+
visibleRowStopIndex: x
|
|
718
716
|
});
|
|
719
|
-
}),
|
|
720
|
-
return
|
|
721
|
-
horizontalScrollDirection:
|
|
722
|
-
scrollLeft:
|
|
717
|
+
}), u._callOnScroll = void 0, u._callOnScroll = Je(function(P, b, I, y, R) {
|
|
718
|
+
return u.props.onScroll({
|
|
719
|
+
horizontalScrollDirection: I,
|
|
720
|
+
scrollLeft: P,
|
|
723
721
|
scrollTop: b,
|
|
724
|
-
verticalScrollDirection:
|
|
725
|
-
scrollUpdateWasRequested:
|
|
722
|
+
verticalScrollDirection: y,
|
|
723
|
+
scrollUpdateWasRequested: R
|
|
726
724
|
});
|
|
727
|
-
}),
|
|
728
|
-
var
|
|
729
|
-
if (
|
|
730
|
-
E =
|
|
725
|
+
}), u._getItemStyle = void 0, u._getItemStyle = function(P, b) {
|
|
726
|
+
var I = u.props, y = I.columnWidth, R = I.direction, L = I.rowHeight, N = u._getItemStyleCache(_ && y, _ && R, _ && L), x = P + ":" + b, E;
|
|
727
|
+
if (N.hasOwnProperty(x))
|
|
728
|
+
E = N[x];
|
|
731
729
|
else {
|
|
732
|
-
var
|
|
733
|
-
|
|
730
|
+
var z = n(u.props, b, u._instanceProps), k = R === "rtl";
|
|
731
|
+
N[x] = E = {
|
|
734
732
|
position: "absolute",
|
|
735
|
-
left:
|
|
736
|
-
right:
|
|
737
|
-
top:
|
|
738
|
-
height: p(
|
|
739
|
-
width: i(
|
|
733
|
+
left: k ? void 0 : z,
|
|
734
|
+
right: k ? z : void 0,
|
|
735
|
+
top: g(u.props, P, u._instanceProps),
|
|
736
|
+
height: p(u.props, P, u._instanceProps),
|
|
737
|
+
width: i(u.props, b, u._instanceProps)
|
|
740
738
|
};
|
|
741
739
|
}
|
|
742
740
|
return E;
|
|
743
|
-
},
|
|
741
|
+
}, u._getItemStyleCache = void 0, u._getItemStyleCache = Je(function(P, b, I) {
|
|
744
742
|
return {};
|
|
745
|
-
}),
|
|
746
|
-
var b =
|
|
747
|
-
|
|
748
|
-
if (E.scrollLeft ===
|
|
743
|
+
}), u._onScroll = function(P) {
|
|
744
|
+
var b = P.currentTarget, I = b.clientHeight, y = b.clientWidth, R = b.scrollLeft, L = b.scrollTop, N = b.scrollHeight, x = b.scrollWidth;
|
|
745
|
+
u.setState(function(E) {
|
|
746
|
+
if (E.scrollLeft === R && E.scrollTop === L)
|
|
749
747
|
return null;
|
|
750
|
-
var
|
|
751
|
-
if (
|
|
748
|
+
var z = u.props.direction, k = R;
|
|
749
|
+
if (z === "rtl")
|
|
752
750
|
switch (At()) {
|
|
753
751
|
case "negative":
|
|
754
|
-
|
|
752
|
+
k = -R;
|
|
755
753
|
break;
|
|
756
754
|
case "positive-descending":
|
|
757
|
-
|
|
755
|
+
k = x - y - R;
|
|
758
756
|
break;
|
|
759
757
|
}
|
|
760
|
-
|
|
761
|
-
var G = Math.max(0, Math.min(
|
|
758
|
+
k = Math.max(0, Math.min(k, x - y));
|
|
759
|
+
var G = Math.max(0, Math.min(L, N - I));
|
|
762
760
|
return {
|
|
763
761
|
isScrolling: !0,
|
|
764
|
-
horizontalScrollDirection: E.scrollLeft <
|
|
765
|
-
scrollLeft:
|
|
762
|
+
horizontalScrollDirection: E.scrollLeft < R ? "forward" : "backward",
|
|
763
|
+
scrollLeft: k,
|
|
766
764
|
scrollTop: G,
|
|
767
|
-
verticalScrollDirection: E.scrollTop <
|
|
765
|
+
verticalScrollDirection: E.scrollTop < L ? "forward" : "backward",
|
|
768
766
|
scrollUpdateWasRequested: !1
|
|
769
767
|
};
|
|
770
|
-
},
|
|
771
|
-
},
|
|
772
|
-
var b =
|
|
773
|
-
|
|
774
|
-
},
|
|
775
|
-
|
|
776
|
-
},
|
|
777
|
-
|
|
768
|
+
}, u._resetIsScrollingDebounced);
|
|
769
|
+
}, u._outerRefSetter = function(P) {
|
|
770
|
+
var b = u.props.outerRef;
|
|
771
|
+
u._outerRef = P, typeof b == "function" ? b(P) : b != null && typeof b == "object" && b.hasOwnProperty("current") && (b.current = P);
|
|
772
|
+
}, u._resetIsScrollingDebounced = function() {
|
|
773
|
+
u._resetIsScrollingTimeoutId !== null && Dt(u._resetIsScrollingTimeoutId), u._resetIsScrollingTimeoutId = _o(u._resetIsScrolling, bo);
|
|
774
|
+
}, u._resetIsScrolling = function() {
|
|
775
|
+
u._resetIsScrollingTimeoutId = null, u.setState({
|
|
778
776
|
isScrolling: !1
|
|
779
777
|
}, function() {
|
|
780
|
-
|
|
778
|
+
u._getItemStyleCache(-1);
|
|
781
779
|
});
|
|
782
|
-
},
|
|
780
|
+
}, u;
|
|
783
781
|
}
|
|
784
|
-
|
|
785
|
-
return So(
|
|
782
|
+
T.getDerivedStateFromProps = function(u, P) {
|
|
783
|
+
return So(u, P), m(u), null;
|
|
786
784
|
};
|
|
787
|
-
var w =
|
|
788
|
-
return w.scrollTo = function(
|
|
789
|
-
var
|
|
790
|
-
|
|
791
|
-
return
|
|
792
|
-
horizontalScrollDirection:
|
|
793
|
-
scrollLeft:
|
|
785
|
+
var w = T.prototype;
|
|
786
|
+
return w.scrollTo = function(u) {
|
|
787
|
+
var P = u.scrollLeft, b = u.scrollTop;
|
|
788
|
+
P !== void 0 && (P = Math.max(0, P)), b !== void 0 && (b = Math.max(0, b)), this.setState(function(I) {
|
|
789
|
+
return P === void 0 && (P = I.scrollLeft), b === void 0 && (b = I.scrollTop), I.scrollLeft === P && I.scrollTop === b ? null : {
|
|
790
|
+
horizontalScrollDirection: I.scrollLeft < P ? "forward" : "backward",
|
|
791
|
+
scrollLeft: P,
|
|
794
792
|
scrollTop: b,
|
|
795
793
|
scrollUpdateWasRequested: !0,
|
|
796
|
-
verticalScrollDirection:
|
|
794
|
+
verticalScrollDirection: I.scrollTop < b ? "forward" : "backward"
|
|
797
795
|
};
|
|
798
796
|
}, this._resetIsScrollingDebounced);
|
|
799
|
-
}, w.scrollToItem = function(
|
|
800
|
-
var
|
|
801
|
-
|
|
802
|
-
var U = l(this.props, this._instanceProps), K = s(this.props, this._instanceProps), ue = K > E ? Z : 0, oe = U >
|
|
797
|
+
}, w.scrollToItem = function(u) {
|
|
798
|
+
var P = u.align, b = P === void 0 ? "auto" : P, I = u.columnIndex, y = u.rowIndex, R = this.props, L = R.columnCount, N = R.height, x = R.rowCount, E = R.width, z = this.state, k = z.scrollLeft, G = z.scrollTop, Z = wo();
|
|
799
|
+
I !== void 0 && (I = Math.max(0, Math.min(I, L - 1))), y !== void 0 && (y = Math.max(0, Math.min(y, x - 1)));
|
|
800
|
+
var U = l(this.props, this._instanceProps), K = s(this.props, this._instanceProps), ue = K > E ? Z : 0, oe = U > N ? Z : 0;
|
|
803
801
|
this.scrollTo({
|
|
804
|
-
scrollLeft:
|
|
805
|
-
scrollTop:
|
|
802
|
+
scrollLeft: I !== void 0 ? c(this.props, I, b, k, this._instanceProps, oe) : k,
|
|
803
|
+
scrollTop: y !== void 0 ? h(this.props, y, b, G, this._instanceProps, ue) : G
|
|
806
804
|
});
|
|
807
805
|
}, w.componentDidMount = function() {
|
|
808
|
-
var
|
|
806
|
+
var u = this.props, P = u.initialScrollLeft, b = u.initialScrollTop;
|
|
809
807
|
if (this._outerRef != null) {
|
|
810
|
-
var
|
|
811
|
-
typeof
|
|
808
|
+
var I = this._outerRef;
|
|
809
|
+
typeof P == "number" && (I.scrollLeft = P), typeof b == "number" && (I.scrollTop = b);
|
|
812
810
|
}
|
|
813
811
|
this._callPropsCallbacks();
|
|
814
812
|
}, w.componentDidUpdate = function() {
|
|
815
|
-
var
|
|
816
|
-
if (
|
|
817
|
-
var
|
|
818
|
-
if (
|
|
813
|
+
var u = this.props.direction, P = this.state, b = P.scrollLeft, I = P.scrollTop, y = P.scrollUpdateWasRequested;
|
|
814
|
+
if (y && this._outerRef != null) {
|
|
815
|
+
var R = this._outerRef;
|
|
816
|
+
if (u === "rtl")
|
|
819
817
|
switch (At()) {
|
|
820
818
|
case "negative":
|
|
821
|
-
|
|
819
|
+
R.scrollLeft = -b;
|
|
822
820
|
break;
|
|
823
821
|
case "positive-ascending":
|
|
824
|
-
|
|
822
|
+
R.scrollLeft = b;
|
|
825
823
|
break;
|
|
826
824
|
default:
|
|
827
|
-
var
|
|
828
|
-
|
|
825
|
+
var L = R.clientWidth, N = R.scrollWidth;
|
|
826
|
+
R.scrollLeft = N - L - b;
|
|
829
827
|
break;
|
|
830
828
|
}
|
|
831
829
|
else
|
|
832
|
-
|
|
833
|
-
|
|
830
|
+
R.scrollLeft = Math.max(0, b);
|
|
831
|
+
R.scrollTop = Math.max(0, I);
|
|
834
832
|
}
|
|
835
833
|
this._callPropsCallbacks();
|
|
836
834
|
}, w.componentWillUnmount = function() {
|
|
837
835
|
this._resetIsScrollingTimeoutId !== null && Dt(this._resetIsScrollingTimeoutId);
|
|
838
836
|
}, w.render = function() {
|
|
839
|
-
var
|
|
840
|
-
if (
|
|
837
|
+
var u = this.props, P = u.children, b = u.className, I = u.columnCount, y = u.direction, R = u.height, L = u.innerRef, N = u.innerElementType, x = u.innerTagName, E = u.itemData, z = u.itemKey, k = z === void 0 ? Co : z, G = u.outerElementType, Z = u.outerTagName, U = u.rowCount, K = u.style, ue = u.useIsScrolling, oe = u.width, ve = this.state.isScrolling, _e = this._getHorizontalRangeToRender(), Se = _e[0], W = _e[1], H = this._getVerticalRangeToRender(), q = H[0], le = H[1], Te = [];
|
|
838
|
+
if (I > 0 && U)
|
|
841
839
|
for (var de = q; de <= le; de++)
|
|
842
|
-
for (var pe = Se; pe <=
|
|
843
|
-
Te.push(Ne(
|
|
840
|
+
for (var pe = Se; pe <= W; pe++)
|
|
841
|
+
Te.push(Ne(P, {
|
|
844
842
|
columnIndex: pe,
|
|
845
843
|
data: E,
|
|
846
844
|
isScrolling: ue ? ve : void 0,
|
|
847
|
-
key:
|
|
845
|
+
key: k({
|
|
848
846
|
columnIndex: pe,
|
|
849
847
|
data: E,
|
|
850
848
|
rowIndex: de
|
|
@@ -859,16 +857,16 @@ function Po(e) {
|
|
|
859
857
|
ref: this._outerRefSetter,
|
|
860
858
|
style: lt({
|
|
861
859
|
position: "relative",
|
|
862
|
-
height:
|
|
860
|
+
height: R,
|
|
863
861
|
width: oe,
|
|
864
862
|
overflow: "auto",
|
|
865
863
|
WebkitOverflowScrolling: "touch",
|
|
866
864
|
willChange: "transform",
|
|
867
|
-
direction:
|
|
865
|
+
direction: y
|
|
868
866
|
}, K)
|
|
869
|
-
}, Ne(
|
|
867
|
+
}, Ne(N || x || "div", {
|
|
870
868
|
children: Te,
|
|
871
|
-
ref:
|
|
869
|
+
ref: L,
|
|
872
870
|
style: {
|
|
873
871
|
height: Ze,
|
|
874
872
|
pointerEvents: ve ? "none" : void 0,
|
|
@@ -876,28 +874,28 @@ function Po(e) {
|
|
|
876
874
|
}
|
|
877
875
|
}));
|
|
878
876
|
}, w._callPropsCallbacks = function() {
|
|
879
|
-
var
|
|
880
|
-
if (typeof b == "function" &&
|
|
881
|
-
var
|
|
882
|
-
this._callOnItemsRendered(
|
|
877
|
+
var u = this.props, P = u.columnCount, b = u.onItemsRendered, I = u.onScroll, y = u.rowCount;
|
|
878
|
+
if (typeof b == "function" && P > 0 && y > 0) {
|
|
879
|
+
var R = this._getHorizontalRangeToRender(), L = R[0], N = R[1], x = R[2], E = R[3], z = this._getVerticalRangeToRender(), k = z[0], G = z[1], Z = z[2], U = z[3];
|
|
880
|
+
this._callOnItemsRendered(L, N, k, G, x, E, Z, U);
|
|
883
881
|
}
|
|
884
|
-
if (typeof
|
|
882
|
+
if (typeof I == "function") {
|
|
885
883
|
var K = this.state, ue = K.horizontalScrollDirection, oe = K.scrollLeft, ve = K.scrollTop, _e = K.scrollUpdateWasRequested, Se = K.verticalScrollDirection;
|
|
886
884
|
this._callOnScroll(oe, ve, ue, Se, _e);
|
|
887
885
|
}
|
|
888
886
|
}, w._getHorizontalRangeToRender = function() {
|
|
889
|
-
var
|
|
890
|
-
if (
|
|
887
|
+
var u = this.props, P = u.columnCount, b = u.overscanColumnCount, I = u.overscanColumnsCount, y = u.overscanCount, R = u.rowCount, L = this.state, N = L.horizontalScrollDirection, x = L.isScrolling, E = L.scrollLeft, z = b || I || y || 1;
|
|
888
|
+
if (P === 0 || R === 0)
|
|
891
889
|
return [0, 0, 0, 0];
|
|
892
|
-
var
|
|
893
|
-
return [Math.max(0,
|
|
890
|
+
var k = r(this.props, E, this._instanceProps), G = o(this.props, k, E, this._instanceProps), Z = !x || N === "backward" ? Math.max(1, z) : 1, U = !x || N === "forward" ? Math.max(1, z) : 1;
|
|
891
|
+
return [Math.max(0, k - Z), Math.max(0, Math.min(P - 1, G + U)), k, G];
|
|
894
892
|
}, w._getVerticalRangeToRender = function() {
|
|
895
|
-
var
|
|
896
|
-
if (
|
|
893
|
+
var u = this.props, P = u.columnCount, b = u.overscanCount, I = u.overscanRowCount, y = u.overscanRowsCount, R = u.rowCount, L = this.state, N = L.isScrolling, x = L.verticalScrollDirection, E = L.scrollTop, z = I || y || b || 1;
|
|
894
|
+
if (P === 0 || R === 0)
|
|
897
895
|
return [0, 0, 0, 0];
|
|
898
|
-
var
|
|
899
|
-
return [Math.max(0,
|
|
900
|
-
},
|
|
896
|
+
var k = d(this.props, E, this._instanceProps), G = f(this.props, k, E, this._instanceProps), Z = !N || x === "backward" ? Math.max(1, z) : 1, U = !N || x === "forward" ? Math.max(1, z) : 1;
|
|
897
|
+
return [Math.max(0, k - Z), Math.max(0, Math.min(R - 1, G + U)), k, G];
|
|
898
|
+
}, T;
|
|
901
899
|
}(zn), t.defaultProps = {
|
|
902
900
|
direction: "ltr",
|
|
903
901
|
itemData: void 0,
|
|
@@ -905,9 +903,9 @@ function Po(e) {
|
|
|
905
903
|
}, t;
|
|
906
904
|
}
|
|
907
905
|
var So = function(t, n) {
|
|
908
|
-
var r = t.children, o = t.direction, i = t.height, l = t.innerTagName, s = t.outerTagName, c = t.overscanColumnsCount, h = t.overscanCount, p = t.overscanRowsCount,
|
|
906
|
+
var r = t.children, o = t.direction, i = t.height, l = t.innerTagName, s = t.outerTagName, c = t.overscanColumnsCount, h = t.overscanCount, p = t.overscanRowsCount, g = t.width, d = n.instance;
|
|
909
907
|
if (process.env.NODE_ENV !== "production") {
|
|
910
|
-
if (typeof h == "number" && Ee && !Ee.has(
|
|
908
|
+
if (typeof h == "number" && Ee && !Ee.has(d) && (Ee.add(d), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof c == "number" || typeof p == "number") && Oe && !Oe.has(d) && (Oe.add(d), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || s != null) && De && !De.has(d) && (De.add(d), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
911
909
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
912
910
|
switch (o) {
|
|
913
911
|
case "ltr":
|
|
@@ -916,8 +914,8 @@ var So = function(t, n) {
|
|
|
916
914
|
default:
|
|
917
915
|
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + o + '" was specified.'));
|
|
918
916
|
}
|
|
919
|
-
if (typeof
|
|
920
|
-
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (
|
|
917
|
+
if (typeof g != "number")
|
|
918
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (g === null ? "null" : typeof g) + '" was specified.'));
|
|
921
919
|
if (typeof i != "number")
|
|
922
920
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (i === null ? "null" : typeof i) + '" was specified.'));
|
|
923
921
|
}
|
|
@@ -946,11 +944,11 @@ var So = function(t, n) {
|
|
|
946
944
|
c = h.offset + h.size;
|
|
947
945
|
}
|
|
948
946
|
for (var p = s + 1; p <= r; p++) {
|
|
949
|
-
var
|
|
947
|
+
var g = l(p);
|
|
950
948
|
i[p] = {
|
|
951
949
|
offset: c,
|
|
952
|
-
size:
|
|
953
|
-
}, c +=
|
|
950
|
+
size: g
|
|
951
|
+
}, c += g;
|
|
954
952
|
}
|
|
955
953
|
t === "column" ? o.lastMeasuredColumnIndex = r : o.lastMeasuredRowIndex = r;
|
|
956
954
|
}
|
|
@@ -973,17 +971,17 @@ var So = function(t, n) {
|
|
|
973
971
|
o += s, s *= 2;
|
|
974
972
|
return cn(t, n, r, Math.min(o, l - 1), Math.floor(o / 2), i);
|
|
975
973
|
}, kt = function(t, n, r, o, i, l, s) {
|
|
976
|
-
var c = t === "column" ? n.width : n.height, h = ie(t, n, r, l), p = t === "column" ? ln(n, l) : sn(n, l),
|
|
977
|
-
switch (o === "smart" && (i >=
|
|
974
|
+
var c = t === "column" ? n.width : n.height, h = ie(t, n, r, l), p = t === "column" ? ln(n, l) : sn(n, l), g = Math.max(0, Math.min(p - c, h.offset)), d = Math.max(0, h.offset - c + s + h.size);
|
|
975
|
+
switch (o === "smart" && (i >= d - c && i <= g + c ? o = "auto" : o = "center"), o) {
|
|
978
976
|
case "start":
|
|
979
|
-
return
|
|
977
|
+
return g;
|
|
980
978
|
case "end":
|
|
981
|
-
return
|
|
979
|
+
return d;
|
|
982
980
|
case "center":
|
|
983
|
-
return Math.round(
|
|
981
|
+
return Math.round(d + (g - d) / 2);
|
|
984
982
|
case "auto":
|
|
985
983
|
default:
|
|
986
|
-
return i >=
|
|
984
|
+
return i >= d && i <= g ? i : d > g || i < d ? d : g;
|
|
987
985
|
}
|
|
988
986
|
}, Io = /* @__PURE__ */ Po({
|
|
989
987
|
getColumnOffset: function(t, n, r) {
|
|
@@ -1042,8 +1040,8 @@ var So = function(t, n) {
|
|
|
1042
1040
|
shouldForceUpdate: c
|
|
1043
1041
|
});
|
|
1044
1042
|
}, n.resetAfterIndices = function(s) {
|
|
1045
|
-
var c = s.columnIndex, h = s.rowIndex, p = s.shouldForceUpdate,
|
|
1046
|
-
typeof c == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, c - 1)), typeof h == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, h - 1)), n._getItemStyleCache(-1),
|
|
1043
|
+
var c = s.columnIndex, h = s.rowIndex, p = s.shouldForceUpdate, g = p === void 0 ? !0 : p;
|
|
1044
|
+
typeof c == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, c - 1)), typeof h == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, h - 1)), n._getItemStyleCache(-1), g && n.forceUpdate();
|
|
1047
1045
|
}, l;
|
|
1048
1046
|
},
|
|
1049
1047
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
@@ -1067,31 +1065,31 @@ function Wt(e, t) {
|
|
|
1067
1065
|
return !0;
|
|
1068
1066
|
return !1;
|
|
1069
1067
|
}
|
|
1070
|
-
var yo = ["style"],
|
|
1071
|
-
function
|
|
1072
|
-
var n = e.style, r = Et(e, yo), o = t.style, i = Et(t,
|
|
1068
|
+
var yo = ["style"], Ro = ["style"];
|
|
1069
|
+
function xo(e, t) {
|
|
1070
|
+
var n = e.style, r = Et(e, yo), o = t.style, i = Et(t, Ro);
|
|
1073
1071
|
return !Wt(n, o) && !Wt(r, i);
|
|
1074
1072
|
}
|
|
1075
1073
|
const Mo = () => {
|
|
1076
|
-
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { setColumnCount: n } = Bt(), { virtualScrollableElementRef: r } = Ue(), o = Xt(), i =
|
|
1074
|
+
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { setColumnCount: n } = Bt(), { virtualScrollableElementRef: r } = Ue(), o = Xt(), i = M(
|
|
1077
1075
|
(f) => o.widths[f] || 0,
|
|
1078
1076
|
[o]
|
|
1079
|
-
), l =
|
|
1077
|
+
), l = M(
|
|
1080
1078
|
(f) => o.heights[f] || 0,
|
|
1081
1079
|
[o]
|
|
1082
1080
|
), s = D(() => o.heights.length, [o]), c = D(() => Math.max(...o.widths), [o]), h = D(() => t === Q.HORIZONTAL_SCROLLING ? s : e === ze.DUAL_PAGE ? 2 : 1, [e, t, t, s, r, c]);
|
|
1083
|
-
|
|
1081
|
+
A(() => {
|
|
1084
1082
|
n(h);
|
|
1085
1083
|
}, [h, n]);
|
|
1086
|
-
const p = D(() => t === Q.HORIZONTAL_SCROLLING || t === Q.PAGE_SCROLLING ? 1 : Math.round(s / h), [h, s, t]),
|
|
1084
|
+
const p = D(() => t === Q.HORIZONTAL_SCROLLING || t === Q.PAGE_SCROLLING ? 1 : Math.round(s / h), [h, s, t]), g = D(() => o.heights.reduce((f, v) => f + v, 0) / o.heights.length || 0, [o]), d = D(() => o.widths.reduce((f, v) => f + v, 0) / o.heights.length || 0, [o]);
|
|
1087
1085
|
return {
|
|
1088
1086
|
rowCount: p,
|
|
1089
1087
|
rowHeight: l,
|
|
1090
1088
|
columnCount: h,
|
|
1091
1089
|
columnWidth: i,
|
|
1092
1090
|
pageDimension: o,
|
|
1093
|
-
estimatedRowHeight:
|
|
1094
|
-
estimatedColumnWidth:
|
|
1091
|
+
estimatedRowHeight: g,
|
|
1092
|
+
estimatedColumnWidth: d
|
|
1095
1093
|
};
|
|
1096
1094
|
};
|
|
1097
1095
|
let J;
|
|
@@ -1115,67 +1113,67 @@ function Lo(e) {
|
|
|
1115
1113
|
const c = typeof document < "u" && document.attachEvent;
|
|
1116
1114
|
if (!c) {
|
|
1117
1115
|
l = function(C) {
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1116
|
+
const T = C.__resizeTriggers__, w = T.firstElementChild, S = T.lastElementChild, u = w.firstElementChild;
|
|
1117
|
+
S.scrollLeft = S.scrollWidth, S.scrollTop = S.scrollHeight, u.style.width = w.offsetWidth + 1 + "px", u.style.height = w.offsetHeight + 1 + "px", w.scrollLeft = w.scrollWidth, w.scrollTop = w.scrollHeight;
|
|
1120
1118
|
}, i = function(C) {
|
|
1121
1119
|
return C.offsetWidth !== C.__resizeLast__.width || C.offsetHeight !== C.__resizeLast__.height;
|
|
1122
1120
|
}, s = function(C) {
|
|
1123
1121
|
if (C.target.className && typeof C.target.className.indexOf == "function" && C.target.className.indexOf("contract-trigger") < 0 && C.target.className.indexOf("expand-trigger") < 0)
|
|
1124
1122
|
return;
|
|
1125
|
-
const
|
|
1123
|
+
const T = this;
|
|
1126
1124
|
l(this), this.__resizeRAF__ && ut(this.__resizeRAF__), this.__resizeRAF__ = dt(function() {
|
|
1127
|
-
i(
|
|
1128
|
-
|
|
1125
|
+
i(T) && (T.__resizeLast__.width = T.offsetWidth, T.__resizeLast__.height = T.offsetHeight, T.__resizeListeners__.forEach(function(u) {
|
|
1126
|
+
u.call(T, C);
|
|
1129
1127
|
}));
|
|
1130
1128
|
});
|
|
1131
1129
|
};
|
|
1132
|
-
let
|
|
1130
|
+
let d = !1, f = "";
|
|
1133
1131
|
r = "animationstart";
|
|
1134
1132
|
const v = "Webkit Moz O ms".split(" ");
|
|
1135
|
-
let _ = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),
|
|
1133
|
+
let _ = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), m = "";
|
|
1136
1134
|
{
|
|
1137
1135
|
const C = document.createElement("fakeelement");
|
|
1138
|
-
if (C.style.animationName !== void 0 && (
|
|
1139
|
-
for (let
|
|
1140
|
-
if (C.style[v[
|
|
1141
|
-
|
|
1136
|
+
if (C.style.animationName !== void 0 && (d = !0), d === !1) {
|
|
1137
|
+
for (let T = 0; T < v.length; T++)
|
|
1138
|
+
if (C.style[v[T] + "AnimationName"] !== void 0) {
|
|
1139
|
+
m = v[T], f = "-" + m.toLowerCase() + "-", r = _[T], d = !0;
|
|
1142
1140
|
break;
|
|
1143
1141
|
}
|
|
1144
1142
|
}
|
|
1145
1143
|
}
|
|
1146
1144
|
n = "resizeanim", t = "@" + f + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", o = f + "animation: 1ms " + n + "; ";
|
|
1147
1145
|
}
|
|
1148
|
-
const h = function(
|
|
1149
|
-
if (!
|
|
1150
|
-
const f = (t || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', v =
|
|
1151
|
-
_.id = "detectElementResize", _.type = "text/css", e != null && _.setAttribute("nonce", e), _.styleSheet ? _.styleSheet.cssText = f : _.appendChild(
|
|
1146
|
+
const h = function(d) {
|
|
1147
|
+
if (!d.getElementById("detectElementResize")) {
|
|
1148
|
+
const f = (t || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', v = d.head || d.getElementsByTagName("head")[0], _ = d.createElement("style");
|
|
1149
|
+
_.id = "detectElementResize", _.type = "text/css", e != null && _.setAttribute("nonce", e), _.styleSheet ? _.styleSheet.cssText = f : _.appendChild(d.createTextNode(f)), v.appendChild(_);
|
|
1152
1150
|
}
|
|
1153
1151
|
};
|
|
1154
1152
|
return {
|
|
1155
|
-
addResizeListener: function(
|
|
1153
|
+
addResizeListener: function(d, f) {
|
|
1156
1154
|
if (c)
|
|
1157
|
-
|
|
1155
|
+
d.attachEvent("onresize", f);
|
|
1158
1156
|
else {
|
|
1159
|
-
if (!
|
|
1160
|
-
const v =
|
|
1161
|
-
_ && _.position === "static" && (
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1157
|
+
if (!d.__resizeTriggers__) {
|
|
1158
|
+
const v = d.ownerDocument, _ = J.getComputedStyle(d);
|
|
1159
|
+
_ && _.position === "static" && (d.style.position = "relative"), h(v), d.__resizeLast__ = {}, d.__resizeListeners__ = [], (d.__resizeTriggers__ = v.createElement("div")).className = "resize-triggers";
|
|
1160
|
+
const m = v.createElement("div");
|
|
1161
|
+
m.className = "expand-trigger", m.appendChild(v.createElement("div"));
|
|
1164
1162
|
const C = v.createElement("div");
|
|
1165
|
-
C.className = "contract-trigger",
|
|
1166
|
-
w.animationName === n && l(
|
|
1167
|
-
},
|
|
1163
|
+
C.className = "contract-trigger", d.__resizeTriggers__.appendChild(m), d.__resizeTriggers__.appendChild(C), d.appendChild(d.__resizeTriggers__), l(d), d.addEventListener("scroll", s, !0), r && (d.__resizeTriggers__.__animationListener__ = function(w) {
|
|
1164
|
+
w.animationName === n && l(d);
|
|
1165
|
+
}, d.__resizeTriggers__.addEventListener(r, d.__resizeTriggers__.__animationListener__));
|
|
1168
1166
|
}
|
|
1169
|
-
|
|
1167
|
+
d.__resizeListeners__.push(f);
|
|
1170
1168
|
}
|
|
1171
1169
|
},
|
|
1172
|
-
removeResizeListener: function(
|
|
1170
|
+
removeResizeListener: function(d, f) {
|
|
1173
1171
|
if (c)
|
|
1174
|
-
|
|
1175
|
-
else if (
|
|
1176
|
-
|
|
1172
|
+
d.detachEvent("onresize", f);
|
|
1173
|
+
else if (d.__resizeListeners__.splice(d.__resizeListeners__.indexOf(f), 1), !d.__resizeListeners__.length) {
|
|
1174
|
+
d.removeEventListener("scroll", s, !0), d.__resizeTriggers__.__animationListener__ && (d.__resizeTriggers__.removeEventListener(r, d.__resizeTriggers__.__animationListener__), d.__resizeTriggers__.__animationListener__ = null);
|
|
1177
1175
|
try {
|
|
1178
|
-
|
|
1176
|
+
d.__resizeTriggers__ = !d.removeChild(d.__resizeTriggers__);
|
|
1179
1177
|
} catch {
|
|
1180
1178
|
}
|
|
1181
1179
|
}
|
|
@@ -1197,16 +1195,16 @@ class No extends Fn {
|
|
|
1197
1195
|
onResize: o
|
|
1198
1196
|
} = this.props;
|
|
1199
1197
|
if (this._parentNode) {
|
|
1200
|
-
const i = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(i.paddingLeft || "0"), s = parseFloat(i.paddingRight || "0"), c = parseFloat(i.paddingTop || "0"), h = parseFloat(i.paddingBottom || "0"), p = this._parentNode.getBoundingClientRect(),
|
|
1201
|
-
(!n && (this.state.height !== f || this.state.scaledHeight !==
|
|
1198
|
+
const i = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(i.paddingLeft || "0"), s = parseFloat(i.paddingRight || "0"), c = parseFloat(i.paddingTop || "0"), h = parseFloat(i.paddingBottom || "0"), p = this._parentNode.getBoundingClientRect(), g = p.height - c - h, d = p.width - l - s, f = this._parentNode.offsetHeight - c - h, v = this._parentNode.offsetWidth - l - s;
|
|
1199
|
+
(!n && (this.state.height !== f || this.state.scaledHeight !== g) || !r && (this.state.width !== v || this.state.scaledWidth !== d)) && (this.setState({
|
|
1202
1200
|
height: f,
|
|
1203
1201
|
width: v,
|
|
1204
|
-
scaledHeight:
|
|
1205
|
-
scaledWidth:
|
|
1202
|
+
scaledHeight: g,
|
|
1203
|
+
scaledWidth: d
|
|
1206
1204
|
}), typeof o == "function" && o({
|
|
1207
1205
|
height: f,
|
|
1208
|
-
scaledHeight:
|
|
1209
|
-
scaledWidth:
|
|
1206
|
+
scaledHeight: g,
|
|
1207
|
+
scaledWidth: d,
|
|
1210
1208
|
width: v
|
|
1211
1209
|
}));
|
|
1212
1210
|
}
|
|
@@ -1241,52 +1239,52 @@ class No extends Fn {
|
|
|
1241
1239
|
onResize: c,
|
|
1242
1240
|
style: h = {},
|
|
1243
1241
|
tagName: p = "div",
|
|
1244
|
-
...
|
|
1242
|
+
...g
|
|
1245
1243
|
} = this.props, {
|
|
1246
|
-
height:
|
|
1244
|
+
height: d,
|
|
1247
1245
|
scaledHeight: f,
|
|
1248
1246
|
scaledWidth: v,
|
|
1249
1247
|
width: _
|
|
1250
|
-
} = this.state,
|
|
1248
|
+
} = this.state, m = {
|
|
1251
1249
|
overflow: "visible"
|
|
1252
1250
|
}, C = {};
|
|
1253
|
-
let
|
|
1254
|
-
return o || (
|
|
1251
|
+
let T = !1;
|
|
1252
|
+
return o || (d === 0 && (T = !0), m.height = 0, C.height = d, C.scaledHeight = f), i || (_ === 0 && (T = !0), m.width = 0, C.width = _, C.scaledWidth = v), l && (T = !1), Ne(p, {
|
|
1255
1253
|
ref: this._setRef,
|
|
1256
1254
|
style: {
|
|
1257
|
-
...
|
|
1255
|
+
...m,
|
|
1258
1256
|
...h
|
|
1259
1257
|
},
|
|
1260
|
-
...
|
|
1261
|
-
}, !
|
|
1258
|
+
...g
|
|
1259
|
+
}, !T && t(C));
|
|
1262
1260
|
}
|
|
1263
1261
|
}
|
|
1264
1262
|
const Eo = (e = 1) => {
|
|
1265
|
-
const [t, n] = F(e), [r, o] = F(0), { scrollToPage: i } = _t(), l = $(1), { isScrolling: s } = Kt(), { viewMode: c } = Ge(), { scrollMode: h } = Pe(), p = yr(t, 100),
|
|
1266
|
-
(
|
|
1267
|
-
if (!/^[0-9]*$/g.test(
|
|
1263
|
+
const [t, n] = F(e), [r, o] = F(0), { scrollToPage: i } = _t(), l = $(1), { isScrolling: s } = Kt(), { viewMode: c } = Ge(), { scrollMode: h } = Pe(), p = yr(t, 100), g = M(
|
|
1264
|
+
(m) => {
|
|
1265
|
+
if (!/^[0-9]*$/g.test(m.toString()) || !m)
|
|
1268
1266
|
return { success: !1, currentPage: l.current };
|
|
1269
|
-
const
|
|
1270
|
-
return
|
|
1267
|
+
const T = +m;
|
|
1268
|
+
return T < 0 || T > r ? { success: !1, currentPage: l.current } : (n(T), l.current = T, { success: !0, currentPage: +m });
|
|
1271
1269
|
},
|
|
1272
1270
|
[r]
|
|
1273
|
-
),
|
|
1274
|
-
(
|
|
1275
|
-
const C = m
|
|
1271
|
+
), d = M(g, [g]), f = M(
|
|
1272
|
+
(m) => {
|
|
1273
|
+
const C = g(m);
|
|
1276
1274
|
return C.success && (s.current = !0, i(C.currentPage)), C;
|
|
1277
1275
|
},
|
|
1278
|
-
[
|
|
1279
|
-
), v =
|
|
1280
|
-
let
|
|
1281
|
-
f(
|
|
1282
|
-
}, [f, t, c, h]), _ =
|
|
1283
|
-
let
|
|
1284
|
-
f(
|
|
1276
|
+
[g, i]
|
|
1277
|
+
), v = M(() => {
|
|
1278
|
+
let m = t - 1;
|
|
1279
|
+
f(m);
|
|
1280
|
+
}, [f, t, c, h]), _ = M(() => {
|
|
1281
|
+
let m = t + 1;
|
|
1282
|
+
f(m);
|
|
1285
1283
|
}, [f, t, c, h]);
|
|
1286
1284
|
return {
|
|
1287
1285
|
focusedPage: p,
|
|
1288
1286
|
totalPages: r,
|
|
1289
|
-
setFocusedPage:
|
|
1287
|
+
setFocusedPage: d,
|
|
1290
1288
|
setTotalPages: o,
|
|
1291
1289
|
nextPage: _,
|
|
1292
1290
|
prevPage: v,
|
|
@@ -1304,14 +1302,14 @@ const Eo = (e = 1) => {
|
|
|
1304
1302
|
},
|
|
1305
1303
|
nextPage: () => {
|
|
1306
1304
|
}
|
|
1307
|
-
}),
|
|
1305
|
+
}), ee = () => {
|
|
1308
1306
|
const e = He(un);
|
|
1309
|
-
return typeof (e == null ? void 0 : e.focusedPage) > "u" &&
|
|
1307
|
+
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Rr.error("Please use this hooks inside children component of RPController or RPLayout"), e;
|
|
1310
1308
|
}, Oo = ({ children: e }) => {
|
|
1311
1309
|
const { initialPage: t = 1 } = gr(), { pdf: n } = Y(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: l, goToPage: s, nextPage: c, prevPage: h } = Eo(t);
|
|
1312
|
-
return
|
|
1310
|
+
return A(() => {
|
|
1313
1311
|
n != null && n.numPages && l(n.numPages);
|
|
1314
|
-
}, [n, l, o, t]),
|
|
1312
|
+
}, [n, l, o, t]), A(() => {
|
|
1315
1313
|
requestAnimationFrame(() => {
|
|
1316
1314
|
s(t);
|
|
1317
1315
|
});
|
|
@@ -1331,7 +1329,7 @@ const Eo = (e = 1) => {
|
|
|
1331
1329
|
}
|
|
1332
1330
|
);
|
|
1333
1331
|
}, Do = ({ widths: e, heights: t }) => {
|
|
1334
|
-
const { focusedPage: n, totalPages: r } =
|
|
1332
|
+
const { focusedPage: n, totalPages: r } = ee(), o = D(() => {
|
|
1335
1333
|
const s = [], c = Math.ceil(n / 2) * 2 - 1;
|
|
1336
1334
|
if (s.push(c), c + 1 < r) {
|
|
1337
1335
|
const h = c + 1;
|
|
@@ -1355,7 +1353,7 @@ const Eo = (e = 1) => {
|
|
|
1355
1353
|
], [e, t, o]), l = D(() => i.reduce((s, c) => s + Number(c.width || 0), 0), [i]);
|
|
1356
1354
|
return /* @__PURE__ */ a("div", { style: { width: l, position: "relative" }, children: o.map((s, c) => /* @__PURE__ */ a(wt, { style: i[c], pageNumber: s }, s)) });
|
|
1357
1355
|
}, Ao = ({ widths: e, heights: t }) => {
|
|
1358
|
-
const { focusedPage: n } =
|
|
1356
|
+
const { focusedPage: n } = ee(), r = D(() => ({
|
|
1359
1357
|
position: "absolute",
|
|
1360
1358
|
width: e(n - 1),
|
|
1361
1359
|
height: t(n - 1)
|
|
@@ -1381,7 +1379,7 @@ const Eo = (e = 1) => {
|
|
|
1381
1379
|
},
|
|
1382
1380
|
o
|
|
1383
1381
|
);
|
|
1384
|
-
},
|
|
1382
|
+
}, xo), es = () => {
|
|
1385
1383
|
const { getContainer: e, container: t } = Sr(), { scrollToPage: n } = _t(), {
|
|
1386
1384
|
virtualScrollRef: r,
|
|
1387
1385
|
getVirtualScrollRef: o,
|
|
@@ -1389,71 +1387,71 @@ const Eo = (e = 1) => {
|
|
|
1389
1387
|
getVirtualScrollableElementRef: l,
|
|
1390
1388
|
setTotalInnerDimensions: s,
|
|
1391
1389
|
totalInnerDimensions: c
|
|
1392
|
-
} = Ue(), { nextPage: h, prevPage: p, setFocusedPage:
|
|
1390
|
+
} = Ue(), { nextPage: h, prevPage: p, setFocusedPage: g, focusedPage: d } = ee(), { scrollMode: f } = Pe(), { viewMode: v } = Ge(), _ = $(null), m = $({
|
|
1393
1391
|
height: 0,
|
|
1394
1392
|
width: 0
|
|
1395
1393
|
}), C = $({
|
|
1396
1394
|
viewMode: v,
|
|
1397
1395
|
scrollMode: f
|
|
1398
|
-
}), { isFullScreen:
|
|
1396
|
+
}), { isFullScreen: T } = _r(), {
|
|
1399
1397
|
pageDimension: w,
|
|
1400
|
-
rowCount:
|
|
1401
|
-
rowHeight:
|
|
1402
|
-
columnCount:
|
|
1398
|
+
rowCount: S,
|
|
1399
|
+
rowHeight: u,
|
|
1400
|
+
columnCount: P,
|
|
1403
1401
|
columnWidth: b,
|
|
1404
|
-
estimatedColumnWidth:
|
|
1405
|
-
estimatedRowHeight:
|
|
1406
|
-
} = Mo(), [
|
|
1402
|
+
estimatedColumnWidth: I,
|
|
1403
|
+
estimatedRowHeight: y
|
|
1404
|
+
} = Mo(), [R, L] = F({}), { isScrolling: N } = Kt(), x = $(), E = $({
|
|
1407
1405
|
scrollTop: 0,
|
|
1408
1406
|
scrollLeft: 0
|
|
1409
|
-
}), { isPressed:
|
|
1410
|
-
isPressed:
|
|
1411
|
-
}), U = D(() =>
|
|
1412
|
-
|
|
1407
|
+
}), { isPressed: z } = Tr(), { selectionMode: k } = fr(), { initializeGrabScroll: G, scrollBehavior: Z } = Ir({
|
|
1408
|
+
isPressed: z
|
|
1409
|
+
}), U = D(() => k === jt.HAND, [k]), K = M((W, H) => {
|
|
1410
|
+
L((q) => ({ ...q, [W]: Math.round(H * 100) }));
|
|
1413
1411
|
}, []), ue = D(() => ({
|
|
1414
|
-
columnCount:
|
|
1412
|
+
columnCount: P,
|
|
1415
1413
|
handleIntersectRatioChange: K
|
|
1416
|
-
}), [
|
|
1417
|
-
(
|
|
1414
|
+
}), [P, K]), oe = M(
|
|
1415
|
+
(W) => {
|
|
1418
1416
|
const H = document.activeElement !== t;
|
|
1419
|
-
!
|
|
1417
|
+
!T && H || (["ArrowUp", "ArrowLeft"].includes(W.key) ? (W.preventDefault(), p()) : ["ArrowDown", "ArrowRight"].includes(W.key) && (W.preventDefault(), h()));
|
|
1420
1418
|
},
|
|
1421
|
-
[h, p,
|
|
1422
|
-
), ve =
|
|
1419
|
+
[h, p, T, f]
|
|
1420
|
+
), ve = M((W) => {
|
|
1423
1421
|
E.current = {
|
|
1424
|
-
scrollTop:
|
|
1425
|
-
scrollLeft:
|
|
1422
|
+
scrollTop: W.scrollTop,
|
|
1423
|
+
scrollLeft: W.scrollLeft
|
|
1426
1424
|
};
|
|
1427
1425
|
}, []);
|
|
1428
|
-
|
|
1426
|
+
A(() => (window.addEventListener("keydown", oe), () => {
|
|
1429
1427
|
window.removeEventListener("keydown", oe);
|
|
1430
|
-
}), [oe]),
|
|
1428
|
+
}), [oe]), A(() => {
|
|
1431
1429
|
if (_.current && (_.current.style.position = "relative"), !!r) {
|
|
1432
|
-
|
|
1433
|
-
height: Array.from({ length:
|
|
1434
|
-
(
|
|
1430
|
+
m.current = c, s({
|
|
1431
|
+
height: Array.from({ length: S }).reduce(
|
|
1432
|
+
(W, H, q) => W + u(q),
|
|
1435
1433
|
0
|
|
1436
1434
|
),
|
|
1437
|
-
width: Array.from({ length:
|
|
1438
|
-
(
|
|
1435
|
+
width: Array.from({ length: P }).reduce(
|
|
1436
|
+
(W, H, q) => W + b(q),
|
|
1439
1437
|
0
|
|
1440
1438
|
)
|
|
1441
1439
|
});
|
|
1442
|
-
for (let
|
|
1443
|
-
for (let H = 0; H <
|
|
1440
|
+
for (let W = 0; W < S; W++)
|
|
1441
|
+
for (let H = 0; H < P; H++)
|
|
1444
1442
|
r.resetAfterIndices({
|
|
1445
1443
|
columnIndex: H,
|
|
1446
|
-
rowIndex:
|
|
1444
|
+
rowIndex: W,
|
|
1447
1445
|
shouldForceUpdate: !0
|
|
1448
1446
|
});
|
|
1449
1447
|
}
|
|
1450
|
-
}, [
|
|
1451
|
-
if (
|
|
1448
|
+
}, [S, P, w, r, n]), A(() => {
|
|
1449
|
+
if (N.current)
|
|
1452
1450
|
return;
|
|
1453
1451
|
if (C.current.viewMode !== v || C.current.scrollMode !== f) {
|
|
1454
|
-
|
|
1452
|
+
x.current && clearTimeout(x.current), L({}), n(d), f === Q.HORIZONTAL_SCROLLING && (r == null || r.scrollTo({
|
|
1455
1453
|
scrollTop: 0
|
|
1456
|
-
})),
|
|
1454
|
+
})), x.current = setTimeout(() => {
|
|
1457
1455
|
requestAnimationFrame(() => {
|
|
1458
1456
|
C.current = { viewMode: v, scrollMode: f };
|
|
1459
1457
|
});
|
|
@@ -1462,52 +1460,52 @@ const Eo = (e = 1) => {
|
|
|
1462
1460
|
}
|
|
1463
1461
|
const H = E.current.scrollTop, q = E.current.scrollLeft;
|
|
1464
1462
|
if (c.height !== 0 && c.width !== 0) {
|
|
1465
|
-
const { height: le, width: Te } = c, { height: de, width: pe } =
|
|
1463
|
+
const { height: le, width: Te } = c, { height: de, width: pe } = m.current, Ze = H / de * le, je = q / pe * Te, Dn = Math.min(Ze, le) || 0, An = Math.min(je, Te) || 0;
|
|
1466
1464
|
r == null || r.scrollTo({
|
|
1467
1465
|
scrollTop: Dn,
|
|
1468
1466
|
scrollLeft: An
|
|
1469
1467
|
});
|
|
1470
1468
|
}
|
|
1471
|
-
}, [c, v, f]),
|
|
1472
|
-
const
|
|
1473
|
-
if (
|
|
1474
|
-
|
|
1469
|
+
}, [c, v, f]), A(() => {
|
|
1470
|
+
const W = Object.entries(R);
|
|
1471
|
+
if (N.current) {
|
|
1472
|
+
N.current && (N.current = !1);
|
|
1475
1473
|
return;
|
|
1476
1474
|
}
|
|
1477
1475
|
let H = 0, q = -1;
|
|
1478
|
-
|
|
1476
|
+
W.forEach((le) => {
|
|
1479
1477
|
q < le[1] && (H = Number(le[0]), q = le[1]);
|
|
1480
|
-
}), H &&
|
|
1481
|
-
}, [
|
|
1482
|
-
|
|
1478
|
+
}), H && g(H);
|
|
1479
|
+
}, [R, g]), A(() => () => {
|
|
1480
|
+
x.current && clearTimeout(x.current);
|
|
1483
1481
|
}, []);
|
|
1484
1482
|
const _e = D(() => j(ae["rp-pages-container"], {
|
|
1485
|
-
[ae["rp-cursor-grab"]]: U && !
|
|
1486
|
-
[ae["rp-cursor-grabbing"]]: U &&
|
|
1487
|
-
}), [U,
|
|
1488
|
-
(
|
|
1489
|
-
if (U &&
|
|
1483
|
+
[ae["rp-cursor-grab"]]: U && !z,
|
|
1484
|
+
[ae["rp-cursor-grabbing"]]: U && z
|
|
1485
|
+
}), [U, z]), Se = M(
|
|
1486
|
+
(W) => {
|
|
1487
|
+
if (U && W) {
|
|
1490
1488
|
const H = j(ae["rp-pages"]), q = document.querySelector(`.${H}`);
|
|
1491
1489
|
G(q);
|
|
1492
1490
|
}
|
|
1493
1491
|
},
|
|
1494
1492
|
[U, G, ae]
|
|
1495
1493
|
);
|
|
1496
|
-
return /* @__PURE__ */ a("div", { ref: e, tabIndex: -1, className: _e, children: /* @__PURE__ */ a(No, { children: ({ width:
|
|
1494
|
+
return /* @__PURE__ */ a("div", { ref: e, tabIndex: -1, className: _e, children: /* @__PURE__ */ a(No, { children: ({ width: W, height: H }) => /* @__PURE__ */ a(
|
|
1497
1495
|
"div",
|
|
1498
1496
|
{
|
|
1499
1497
|
"data-rp": "pagesWrapper",
|
|
1500
1498
|
ref: Se,
|
|
1501
|
-
style: { width:
|
|
1499
|
+
style: { width: W, height: H, scrollBehavior: Z },
|
|
1502
1500
|
children: f === Q.PAGE_SCROLLING ? /* @__PURE__ */ a(
|
|
1503
1501
|
"div",
|
|
1504
1502
|
{
|
|
1505
1503
|
ref: i,
|
|
1506
|
-
style: { width:
|
|
1504
|
+
style: { width: W, height: H },
|
|
1507
1505
|
className: j(ae["rp-pages"], ae["rp-page-scrolling-wrapper"]),
|
|
1508
|
-
children: v === ze.DUAL_PAGE ? /* @__PURE__ */ a(Do, { widths: b, heights:
|
|
1506
|
+
children: v === ze.DUAL_PAGE ? /* @__PURE__ */ a(Do, { widths: b, heights: u }) : /* @__PURE__ */ a(Ao, { widths: b, heights: u })
|
|
1509
1507
|
}
|
|
1510
|
-
) :
|
|
1508
|
+
) : I ? /* @__PURE__ */ a(
|
|
1511
1509
|
Io,
|
|
1512
1510
|
{
|
|
1513
1511
|
ref: o,
|
|
@@ -1515,14 +1513,14 @@ const Eo = (e = 1) => {
|
|
|
1515
1513
|
outerRef: l,
|
|
1516
1514
|
innerRef: _,
|
|
1517
1515
|
onScroll: ve,
|
|
1518
|
-
columnCount:
|
|
1516
|
+
columnCount: P,
|
|
1519
1517
|
columnWidth: b,
|
|
1520
|
-
rowHeight:
|
|
1518
|
+
rowHeight: u,
|
|
1521
1519
|
height: H,
|
|
1522
|
-
width:
|
|
1523
|
-
estimatedColumnWidth:
|
|
1524
|
-
estimatedRowHeight:
|
|
1525
|
-
rowCount:
|
|
1520
|
+
width: W,
|
|
1521
|
+
estimatedColumnWidth: I,
|
|
1522
|
+
estimatedRowHeight: y,
|
|
1523
|
+
rowCount: S,
|
|
1526
1524
|
className: j(
|
|
1527
1525
|
ae["rp-pages"],
|
|
1528
1526
|
f === Q.HORIZONTAL_SCROLLING ? ae["rp-pages-horizontal-scroll"] : ""
|
|
@@ -1544,29 +1542,29 @@ const Eo = (e = 1) => {
|
|
|
1544
1542
|
"rp-page-input": "_rp-page-input_1vu6o_6",
|
|
1545
1543
|
"rp-total-page": "_rp-total-page_1vu6o_12"
|
|
1546
1544
|
}, Fo = () => {
|
|
1547
|
-
const { prevIcon: e } =
|
|
1545
|
+
const { prevIcon: e } = re();
|
|
1548
1546
|
return e || /* @__PURE__ */ a(Me, {});
|
|
1549
1547
|
}, ko = () => {
|
|
1550
|
-
const { nextIcon: e } =
|
|
1548
|
+
const { nextIcon: e } = re();
|
|
1551
1549
|
return e || /* @__PURE__ */ a(Me, { style: { transform: "rotate(180deg" } });
|
|
1552
1550
|
}, Wo = () => {
|
|
1553
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } =
|
|
1554
|
-
|
|
1551
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = ee(), [l, s] = F(e.toString()), { pageNavigationTool: c = !0 } = se(), { isSmallScreen: h } = ge();
|
|
1552
|
+
A(() => {
|
|
1555
1553
|
s(e.toString());
|
|
1556
1554
|
}, [e]);
|
|
1557
|
-
const p =
|
|
1555
|
+
const p = M((v) => {
|
|
1558
1556
|
const _ = v.target.value;
|
|
1559
1557
|
s(_);
|
|
1560
|
-
}, []),
|
|
1558
|
+
}, []), g = M(() => {
|
|
1561
1559
|
const v = i(l);
|
|
1562
1560
|
v.success || s(v.currentPage.toString());
|
|
1563
|
-
}, [i, l, t]),
|
|
1561
|
+
}, [i, l, t]), d = M(() => {
|
|
1564
1562
|
s(e.toString());
|
|
1565
|
-
}, [e]), f =
|
|
1563
|
+
}, [e]), f = M(
|
|
1566
1564
|
(v) => {
|
|
1567
|
-
v.key === "Enter" &&
|
|
1565
|
+
v.key === "Enter" && g();
|
|
1568
1566
|
},
|
|
1569
|
-
[
|
|
1567
|
+
[g]
|
|
1570
1568
|
);
|
|
1571
1569
|
return typeof c != "boolean" ? /* @__PURE__ */ a(
|
|
1572
1570
|
c,
|
|
@@ -1584,7 +1582,7 @@ const Eo = (e = 1) => {
|
|
|
1584
1582
|
Zt,
|
|
1585
1583
|
{
|
|
1586
1584
|
onKeyDown: f,
|
|
1587
|
-
onBlur:
|
|
1585
|
+
onBlur: d,
|
|
1588
1586
|
onChange: p,
|
|
1589
1587
|
value: l,
|
|
1590
1588
|
className: tt["rp-page-input"]
|
|
@@ -1597,7 +1595,7 @@ const Eo = (e = 1) => {
|
|
|
1597
1595
|
!h && /* @__PURE__ */ a(X, { content: "Next page", children: /* @__PURE__ */ a(B, { onClick: r, disabled: e === t, children: /* @__PURE__ */ a(ko, {}) }) })
|
|
1598
1596
|
] }) : null;
|
|
1599
1597
|
};
|
|
1600
|
-
var bt = "Dialog", [dn, ts] = Lr(bt), [Ho,
|
|
1598
|
+
var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, te] = dn(bt), pn = (e) => {
|
|
1601
1599
|
const {
|
|
1602
1600
|
__scopeDialog: t,
|
|
1603
1601
|
children: n,
|
|
@@ -1621,7 +1619,7 @@ var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, ee] = dn(bt), pn = (e) => {
|
|
|
1621
1619
|
descriptionId: Be(),
|
|
1622
1620
|
open: h,
|
|
1623
1621
|
onOpenChange: p,
|
|
1624
|
-
onOpenToggle: V.useCallback(() => p((
|
|
1622
|
+
onOpenToggle: V.useCallback(() => p((g) => !g), [p]),
|
|
1625
1623
|
modal: l,
|
|
1626
1624
|
children: n
|
|
1627
1625
|
}
|
|
@@ -1630,7 +1628,7 @@ var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, ee] = dn(bt), pn = (e) => {
|
|
|
1630
1628
|
pn.displayName = bt;
|
|
1631
1629
|
var hn = "DialogTrigger", $o = V.forwardRef(
|
|
1632
1630
|
(e, t) => {
|
|
1633
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1631
|
+
const { __scopeDialog: n, ...r } = e, o = te(hn, n), i = mt(t, o.triggerRef);
|
|
1634
1632
|
return /* @__PURE__ */ a(
|
|
1635
1633
|
Le.button,
|
|
1636
1634
|
{
|
|
@@ -1641,7 +1639,7 @@ var hn = "DialogTrigger", $o = V.forwardRef(
|
|
|
1641
1639
|
"data-state": St(o.open),
|
|
1642
1640
|
...r,
|
|
1643
1641
|
ref: i,
|
|
1644
|
-
onClick:
|
|
1642
|
+
onClick: xe(e.onClick, o.onOpenToggle)
|
|
1645
1643
|
}
|
|
1646
1644
|
);
|
|
1647
1645
|
}
|
|
@@ -1650,20 +1648,20 @@ $o.displayName = hn;
|
|
|
1650
1648
|
var Ct = "DialogPortal", [Vo, fn] = dn(Ct, {
|
|
1651
1649
|
forceMount: void 0
|
|
1652
1650
|
}), mn = (e) => {
|
|
1653
|
-
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, i =
|
|
1651
|
+
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, i = te(Ct, t);
|
|
1654
1652
|
return /* @__PURE__ */ a(Vo, { scope: t, forceMount: n, children: V.Children.map(r, (l) => /* @__PURE__ */ a(gt, { present: n || i.open, children: /* @__PURE__ */ a(Wr, { asChild: !0, container: o, children: l }) })) });
|
|
1655
1653
|
};
|
|
1656
1654
|
mn.displayName = Ct;
|
|
1657
1655
|
var ke = "DialogOverlay", gn = V.forwardRef(
|
|
1658
1656
|
(e, t) => {
|
|
1659
|
-
const n = fn(ke, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i =
|
|
1657
|
+
const n = fn(ke, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = te(ke, e.__scopeDialog);
|
|
1660
1658
|
return i.modal ? /* @__PURE__ */ a(gt, { present: r || i.open, children: /* @__PURE__ */ a(Go, { ...o, ref: t }) }) : null;
|
|
1661
1659
|
}
|
|
1662
1660
|
);
|
|
1663
1661
|
gn.displayName = ke;
|
|
1664
1662
|
var Go = V.forwardRef(
|
|
1665
1663
|
(e, t) => {
|
|
1666
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1664
|
+
const { __scopeDialog: n, ...r } = e, o = te(ke, n);
|
|
1667
1665
|
return (
|
|
1668
1666
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1669
1667
|
// ie. when `Overlay` and `Content` are siblings
|
|
@@ -1680,14 +1678,14 @@ var Go = V.forwardRef(
|
|
|
1680
1678
|
}
|
|
1681
1679
|
), me = "DialogContent", vn = V.forwardRef(
|
|
1682
1680
|
(e, t) => {
|
|
1683
|
-
const n = fn(me, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i =
|
|
1681
|
+
const n = fn(me, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = te(me, e.__scopeDialog);
|
|
1684
1682
|
return /* @__PURE__ */ a(gt, { present: r || i.open, children: i.modal ? /* @__PURE__ */ a(Uo, { ...o, ref: t }) : /* @__PURE__ */ a(qo, { ...o, ref: t }) });
|
|
1685
1683
|
}
|
|
1686
1684
|
);
|
|
1687
1685
|
vn.displayName = me;
|
|
1688
1686
|
var Uo = V.forwardRef(
|
|
1689
1687
|
(e, t) => {
|
|
1690
|
-
const n =
|
|
1688
|
+
const n = te(me, e.__scopeDialog), r = V.useRef(null), o = mt(t, n.contentRef, r);
|
|
1691
1689
|
return V.useEffect(() => {
|
|
1692
1690
|
const i = r.current;
|
|
1693
1691
|
if (i)
|
|
@@ -1699,15 +1697,15 @@ var Uo = V.forwardRef(
|
|
|
1699
1697
|
ref: o,
|
|
1700
1698
|
trapFocus: n.open,
|
|
1701
1699
|
disableOutsidePointerEvents: !0,
|
|
1702
|
-
onCloseAutoFocus:
|
|
1700
|
+
onCloseAutoFocus: xe(e.onCloseAutoFocus, (i) => {
|
|
1703
1701
|
var l;
|
|
1704
1702
|
i.preventDefault(), (l = n.triggerRef.current) == null || l.focus();
|
|
1705
1703
|
}),
|
|
1706
|
-
onPointerDownOutside:
|
|
1704
|
+
onPointerDownOutside: xe(e.onPointerDownOutside, (i) => {
|
|
1707
1705
|
const l = i.detail.originalEvent, s = l.button === 0 && l.ctrlKey === !0;
|
|
1708
1706
|
(l.button === 2 || s) && i.preventDefault();
|
|
1709
1707
|
}),
|
|
1710
|
-
onFocusOutside:
|
|
1708
|
+
onFocusOutside: xe(
|
|
1711
1709
|
e.onFocusOutside,
|
|
1712
1710
|
(i) => i.preventDefault()
|
|
1713
1711
|
)
|
|
@@ -1716,7 +1714,7 @@ var Uo = V.forwardRef(
|
|
|
1716
1714
|
}
|
|
1717
1715
|
), qo = V.forwardRef(
|
|
1718
1716
|
(e, t) => {
|
|
1719
|
-
const n =
|
|
1717
|
+
const n = te(me, e.__scopeDialog), r = V.useRef(!1), o = V.useRef(!1);
|
|
1720
1718
|
return /* @__PURE__ */ a(
|
|
1721
1719
|
_n,
|
|
1722
1720
|
{
|
|
@@ -1739,7 +1737,7 @@ var Uo = V.forwardRef(
|
|
|
1739
1737
|
}
|
|
1740
1738
|
), _n = V.forwardRef(
|
|
1741
1739
|
(e, t) => {
|
|
1742
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...l } = e, s =
|
|
1740
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...l } = e, s = te(me, n), c = V.useRef(null), h = mt(t, c);
|
|
1743
1741
|
return Dr(), /* @__PURE__ */ O(Ae, { children: [
|
|
1744
1742
|
/* @__PURE__ */ a(
|
|
1745
1743
|
Ar,
|
|
@@ -1772,28 +1770,28 @@ var Uo = V.forwardRef(
|
|
|
1772
1770
|
}
|
|
1773
1771
|
), Pt = "DialogTitle", wn = V.forwardRef(
|
|
1774
1772
|
(e, t) => {
|
|
1775
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1773
|
+
const { __scopeDialog: n, ...r } = e, o = te(Pt, n);
|
|
1776
1774
|
return /* @__PURE__ */ a(Le.h2, { id: o.titleId, ...r, ref: t });
|
|
1777
1775
|
}
|
|
1778
1776
|
);
|
|
1779
1777
|
wn.displayName = Pt;
|
|
1780
1778
|
var bn = "DialogDescription", Zo = V.forwardRef(
|
|
1781
1779
|
(e, t) => {
|
|
1782
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1780
|
+
const { __scopeDialog: n, ...r } = e, o = te(bn, n);
|
|
1783
1781
|
return /* @__PURE__ */ a(Le.p, { id: o.descriptionId, ...r, ref: t });
|
|
1784
1782
|
}
|
|
1785
1783
|
);
|
|
1786
1784
|
Zo.displayName = bn;
|
|
1787
1785
|
var Cn = "DialogClose", Pn = V.forwardRef(
|
|
1788
1786
|
(e, t) => {
|
|
1789
|
-
const { __scopeDialog: n, ...r } = e, o =
|
|
1787
|
+
const { __scopeDialog: n, ...r } = e, o = te(Cn, n);
|
|
1790
1788
|
return /* @__PURE__ */ a(
|
|
1791
1789
|
Le.button,
|
|
1792
1790
|
{
|
|
1793
1791
|
type: "button",
|
|
1794
1792
|
...r,
|
|
1795
1793
|
ref: t,
|
|
1796
|
-
onClick:
|
|
1794
|
+
onClick: xe(e.onClick, () => o.onOpenChange(!1))
|
|
1797
1795
|
}
|
|
1798
1796
|
);
|
|
1799
1797
|
}
|
|
@@ -1842,12 +1840,12 @@ const fe = {
|
|
|
1842
1840
|
author: c,
|
|
1843
1841
|
subject: h,
|
|
1844
1842
|
createdOn: p,
|
|
1845
|
-
creator:
|
|
1846
|
-
keywords:
|
|
1843
|
+
creator: g,
|
|
1844
|
+
keywords: d,
|
|
1847
1845
|
modifierOn: f,
|
|
1848
1846
|
pdfProducer: v,
|
|
1849
1847
|
pdfVersion: _,
|
|
1850
|
-
pageCount:
|
|
1848
|
+
pageCount: m
|
|
1851
1849
|
} = e;
|
|
1852
1850
|
return [
|
|
1853
1851
|
{ label: "File name", value: l },
|
|
@@ -1856,8 +1854,8 @@ const fe = {
|
|
|
1856
1854
|
{ label: "Title", value: s },
|
|
1857
1855
|
{ label: "Author", value: c },
|
|
1858
1856
|
{ label: "Subject", value: h },
|
|
1859
|
-
{ label: "Keywords", value:
|
|
1860
|
-
{ label: "Creator", value:
|
|
1857
|
+
{ label: "Keywords", value: d },
|
|
1858
|
+
{ label: "Creator", value: g },
|
|
1861
1859
|
{
|
|
1862
1860
|
label: "Created on",
|
|
1863
1861
|
value: p ? it(p) : ""
|
|
@@ -1869,7 +1867,7 @@ const fe = {
|
|
|
1869
1867
|
{ separate: !0 },
|
|
1870
1868
|
{ label: "PDF producer", value: v },
|
|
1871
1869
|
{ label: "PDF version", value: _ },
|
|
1872
|
-
{ label: "Page count", value:
|
|
1870
|
+
{ label: "Page count", value: m }
|
|
1873
1871
|
];
|
|
1874
1872
|
}, [e]);
|
|
1875
1873
|
return /* @__PURE__ */ a(Xo, { open: n, onOpenChange: r, children: /* @__PURE__ */ a(Jo, { container: t, children: /* @__PURE__ */ O("div", { className: fe["rp-dialog-wrapper"], children: [
|
|
@@ -1891,12 +1889,12 @@ const fe = {
|
|
|
1891
1889
|
r.href = t, r.download = e, document.body.appendChild(r), r.click(), document.body.removeChild(r);
|
|
1892
1890
|
} };
|
|
1893
1891
|
}, In = () => {
|
|
1894
|
-
const { downloadIcon: e } =
|
|
1892
|
+
const { downloadIcon: e } = re();
|
|
1895
1893
|
return e || /* @__PURE__ */ a(Zr, {});
|
|
1896
1894
|
}, yn = ({ children: e }) => /* @__PURE__ */ a(X, { content: "Download file", children: e }), aa = ({ downloadFile: e }) => /* @__PURE__ */ a(yn, { children: /* @__PURE__ */ a(B, { onClick: e, children: /* @__PURE__ */ a(In, {}) }) }), ia = ({ downloadFile: e }) => /* @__PURE__ */ a(yn, { children: /* @__PURE__ */ O(ce, { onClick: e, children: [
|
|
1897
1895
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(In, {}) }),
|
|
1898
1896
|
"Download file"
|
|
1899
|
-
] }) }),
|
|
1897
|
+
] }) }), Rn = () => {
|
|
1900
1898
|
const { downloadFile: e } = oa(), { downloadTool: t = !0 } = se(), { isSmallScreen: n } = ge();
|
|
1901
1899
|
return t ? n ? /* @__PURE__ */ a(ia, { downloadFile: e }) : typeof t == "function" ? /* @__PURE__ */ a(t, { downloadFile: e }) : t ? /* @__PURE__ */ a(aa, { downloadFile: e }) : null : null;
|
|
1902
1900
|
};
|
|
@@ -1906,14 +1904,14 @@ const sa = () => {
|
|
|
1906
1904
|
totalPages: 0,
|
|
1907
1905
|
percentage: 0
|
|
1908
1906
|
}), [o, i] = F(!1), [l, s] = F(!1), [c, h] = F(null), p = $(!1);
|
|
1909
|
-
|
|
1907
|
+
A(() => {
|
|
1910
1908
|
p.current;
|
|
1911
1909
|
}, [p]);
|
|
1912
|
-
const
|
|
1910
|
+
const g = M(() => {
|
|
1913
1911
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
1914
1912
|
const w = document.querySelector(".rp-print-zone");
|
|
1915
1913
|
w && w.remove();
|
|
1916
|
-
}, []),
|
|
1914
|
+
}, []), d = M(() => {
|
|
1917
1915
|
p.current = !1, i(!1), s(!1), h(null), r({
|
|
1918
1916
|
loadedPages: 0,
|
|
1919
1917
|
totalPages: 0,
|
|
@@ -1923,144 +1921,144 @@ const sa = () => {
|
|
|
1923
1921
|
p.current = !0;
|
|
1924
1922
|
}, v = async ({
|
|
1925
1923
|
scratchCanvas: w,
|
|
1926
|
-
pdfDocument:
|
|
1927
|
-
pageNumber:
|
|
1928
|
-
viewerPdfPage:
|
|
1924
|
+
pdfDocument: S,
|
|
1925
|
+
pageNumber: u,
|
|
1926
|
+
viewerPdfPage: P,
|
|
1929
1927
|
printResolution: b,
|
|
1930
|
-
optionalContentConfigPromise:
|
|
1931
|
-
printAnnotationStoragePromise:
|
|
1928
|
+
optionalContentConfigPromise: I,
|
|
1929
|
+
printAnnotationStoragePromise: y
|
|
1932
1930
|
}) => {
|
|
1933
1931
|
if (p.current) {
|
|
1934
|
-
|
|
1932
|
+
d();
|
|
1935
1933
|
return;
|
|
1936
1934
|
}
|
|
1937
|
-
const
|
|
1938
|
-
w.width = Math.floor(
|
|
1939
|
-
const
|
|
1940
|
-
|
|
1941
|
-
const [
|
|
1942
|
-
|
|
1943
|
-
|
|
1935
|
+
const R = b / tr.PDF;
|
|
1936
|
+
w.width = Math.floor(P.width * R), w.height = Math.floor(P.height * R);
|
|
1937
|
+
const L = w.getContext("2d");
|
|
1938
|
+
L.save(), L.fillStyle = "rgb(255, 255, 255)", L.fillRect(0, 0, w.width, w.height), L.restore();
|
|
1939
|
+
const [N, x] = await Promise.all([
|
|
1940
|
+
S.getPage(u),
|
|
1941
|
+
y
|
|
1944
1942
|
]);
|
|
1945
1943
|
if (p.current) {
|
|
1946
|
-
|
|
1944
|
+
d();
|
|
1947
1945
|
return;
|
|
1948
1946
|
}
|
|
1949
1947
|
const E = {
|
|
1950
|
-
canvasContext:
|
|
1951
|
-
transform: [
|
|
1952
|
-
viewport:
|
|
1948
|
+
canvasContext: L,
|
|
1949
|
+
transform: [R, 0, 0, R, 0, 0],
|
|
1950
|
+
viewport: N.getViewport({ scale: 1, rotation: P.rotation }),
|
|
1953
1951
|
intent: "print",
|
|
1954
1952
|
annotationMode: nr.ENABLE_STORAGE,
|
|
1955
|
-
optionalContentConfigPromise:
|
|
1956
|
-
printAnnotationStorage:
|
|
1953
|
+
optionalContentConfigPromise: I,
|
|
1954
|
+
printAnnotationStorage: x
|
|
1957
1955
|
};
|
|
1958
1956
|
try {
|
|
1959
|
-
return
|
|
1960
|
-
} catch (
|
|
1961
|
-
throw
|
|
1957
|
+
return N.render(E).promise;
|
|
1958
|
+
} catch (z) {
|
|
1959
|
+
throw z instanceof rr || console.error(z), z;
|
|
1962
1960
|
}
|
|
1963
|
-
}, _ =
|
|
1961
|
+
}, _ = M(() => {
|
|
1964
1962
|
const w = window.print;
|
|
1965
|
-
return new Promise((
|
|
1966
|
-
const
|
|
1963
|
+
return new Promise((S) => {
|
|
1964
|
+
const u = (I) => {
|
|
1967
1965
|
setTimeout(() => {
|
|
1968
|
-
w.call(window), setTimeout(() =>
|
|
1966
|
+
w.call(window), setTimeout(() => I(), 20);
|
|
1969
1967
|
}, 0);
|
|
1970
1968
|
};
|
|
1971
1969
|
if (document.querySelector(".rp-print-zone")) {
|
|
1972
|
-
|
|
1970
|
+
u(S);
|
|
1973
1971
|
return;
|
|
1974
1972
|
}
|
|
1975
1973
|
const b = new MutationObserver(() => {
|
|
1976
|
-
document.querySelector(".rp-print-zone") && (
|
|
1974
|
+
document.querySelector(".rp-print-zone") && (u(S), b.disconnect());
|
|
1977
1975
|
});
|
|
1978
1976
|
b.observe(document.body, { childList: !0, subtree: !0 });
|
|
1979
1977
|
});
|
|
1980
|
-
}, []),
|
|
1981
|
-
const
|
|
1982
|
-
return
|
|
1983
|
-
w.toBlob((
|
|
1984
|
-
|
|
1985
|
-
URL.revokeObjectURL(
|
|
1986
|
-
},
|
|
1978
|
+
}, []), m = async (w) => {
|
|
1979
|
+
const S = document.createElement("img"), u = document.createElement("div");
|
|
1980
|
+
return u.classList.add("rp-print-page"), await new Promise((P, b) => {
|
|
1981
|
+
w.toBlob((I) => {
|
|
1982
|
+
I ? (S.src = URL.createObjectURL(I), S.onload = () => {
|
|
1983
|
+
URL.revokeObjectURL(S.src), P();
|
|
1984
|
+
}, S.onerror = b) : b(new Error("Failed to create blob"));
|
|
1987
1985
|
});
|
|
1988
1986
|
}).catch(() => {
|
|
1989
|
-
}),
|
|
1990
|
-
}, C = (w,
|
|
1991
|
-
const
|
|
1992
|
-
|
|
1993
|
-
const
|
|
1987
|
+
}), u.appendChild(S), u;
|
|
1988
|
+
}, C = (w, S) => {
|
|
1989
|
+
const u = document.createElement("div");
|
|
1990
|
+
u.classList.add("rp-print-zone");
|
|
1991
|
+
const P = document.createElement("style"), b = S.get(1);
|
|
1994
1992
|
if (b) {
|
|
1995
|
-
const { width:
|
|
1996
|
-
|
|
1993
|
+
const { width: I, height: y } = b == null ? void 0 : b.page.getViewport({ scale: 1 });
|
|
1994
|
+
P.innerHTML = `@page { size: ${I}px ${y}px }`;
|
|
1997
1995
|
}
|
|
1998
|
-
return
|
|
1999
|
-
},
|
|
1996
|
+
return u.appendChild(P), u.append(...w), u;
|
|
1997
|
+
}, T = M(async () => {
|
|
2000
1998
|
if (!e)
|
|
2001
1999
|
return;
|
|
2002
|
-
|
|
2003
|
-
const w = document.createElement("canvas"),
|
|
2000
|
+
d();
|
|
2001
|
+
const w = document.createElement("canvas"), S = [];
|
|
2004
2002
|
try {
|
|
2005
2003
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
2006
|
-
const
|
|
2004
|
+
const P = e.getOptionalContentConfig({ intent: "print" }), b = Promise.resolve(
|
|
2007
2005
|
e.annotationStorage.print ?? void 0
|
|
2008
|
-
),
|
|
2009
|
-
for (const [
|
|
2006
|
+
), I = t.size;
|
|
2007
|
+
for (const [R, L] of t) {
|
|
2010
2008
|
if (p.current) {
|
|
2011
|
-
|
|
2009
|
+
d();
|
|
2012
2010
|
return;
|
|
2013
2011
|
}
|
|
2014
|
-
const
|
|
2012
|
+
const N = L.page.getViewport({ scale: 1 });
|
|
2015
2013
|
if (await v({
|
|
2016
2014
|
scratchCanvas: w,
|
|
2017
2015
|
pdfDocument: e,
|
|
2018
|
-
pageNumber:
|
|
2019
|
-
viewerPdfPage:
|
|
2016
|
+
pageNumber: R,
|
|
2017
|
+
viewerPdfPage: N,
|
|
2020
2018
|
printResolution: 150,
|
|
2021
|
-
optionalContentConfigPromise:
|
|
2019
|
+
optionalContentConfigPromise: P,
|
|
2022
2020
|
printAnnotationStoragePromise: b
|
|
2023
2021
|
}), p.current) {
|
|
2024
|
-
|
|
2022
|
+
d();
|
|
2025
2023
|
return;
|
|
2026
2024
|
}
|
|
2027
|
-
const
|
|
2028
|
-
|
|
2029
|
-
const E = parseFloat((
|
|
2025
|
+
const x = await m(w);
|
|
2026
|
+
S.push(x);
|
|
2027
|
+
const E = parseFloat((S.length / I * 100).toFixed(2));
|
|
2030
2028
|
r({
|
|
2031
|
-
loadedPages:
|
|
2032
|
-
totalPages:
|
|
2029
|
+
loadedPages: R,
|
|
2030
|
+
totalPages: I,
|
|
2033
2031
|
percentage: E
|
|
2034
2032
|
});
|
|
2035
2033
|
}
|
|
2036
2034
|
if (p.current) {
|
|
2037
|
-
|
|
2035
|
+
d();
|
|
2038
2036
|
return;
|
|
2039
2037
|
}
|
|
2040
|
-
const
|
|
2041
|
-
document.body.appendChild(
|
|
2042
|
-
} catch (
|
|
2043
|
-
s(!0),
|
|
2038
|
+
const y = C(S, t);
|
|
2039
|
+
document.body.appendChild(y), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await _();
|
|
2040
|
+
} catch (u) {
|
|
2041
|
+
s(!0), u instanceof Error && h(u);
|
|
2044
2042
|
} finally {
|
|
2045
2043
|
w.height = 0, w.width = 0;
|
|
2046
2044
|
}
|
|
2047
2045
|
}, [e, t, p]);
|
|
2048
|
-
return
|
|
2046
|
+
return A(() => {
|
|
2049
2047
|
const w = () => {
|
|
2050
|
-
|
|
2048
|
+
d(), g();
|
|
2051
2049
|
};
|
|
2052
2050
|
return window.addEventListener("afterprint", w, !0), () => {
|
|
2053
2051
|
window.removeEventListener("afterprint", w, !0);
|
|
2054
2052
|
};
|
|
2055
|
-
}, [
|
|
2056
|
-
print:
|
|
2053
|
+
}, [g, d]), {
|
|
2054
|
+
print: T,
|
|
2057
2055
|
cancel: f,
|
|
2058
2056
|
progress: n,
|
|
2059
2057
|
isComplete: o,
|
|
2060
2058
|
isError: l,
|
|
2061
2059
|
error: c
|
|
2062
2060
|
};
|
|
2063
|
-
},
|
|
2061
|
+
}, xn = We({
|
|
2064
2062
|
print: () => {
|
|
2065
2063
|
},
|
|
2066
2064
|
cancel: () => {
|
|
@@ -2078,23 +2076,23 @@ const sa = () => {
|
|
|
2078
2076
|
}
|
|
2079
2077
|
}
|
|
2080
2078
|
}), la = ({ children: e }) => {
|
|
2081
|
-
const [t, n] = F(null), [r, o] = F(null), { print: i, cancel: l, progress: s, isComplete: c, isError: h, error: p } = sa(),
|
|
2082
|
-
|
|
2083
|
-
}, []),
|
|
2084
|
-
p &&
|
|
2085
|
-
}, f =
|
|
2086
|
-
(
|
|
2087
|
-
n(() =>
|
|
2079
|
+
const [t, n] = F(null), [r, o] = F(null), { print: i, cancel: l, progress: s, isComplete: c, isError: h, error: p } = sa(), g = M((m) => {
|
|
2080
|
+
m && typeof m == "function" && o(() => m);
|
|
2081
|
+
}, []), d = (m) => {
|
|
2082
|
+
p && m(p);
|
|
2083
|
+
}, f = M(
|
|
2084
|
+
(m) => {
|
|
2085
|
+
n(() => m);
|
|
2088
2086
|
},
|
|
2089
2087
|
[s, t]
|
|
2090
2088
|
);
|
|
2091
|
-
|
|
2089
|
+
A(() => {
|
|
2092
2090
|
c && r && v();
|
|
2093
|
-
}, [c, r]),
|
|
2094
|
-
h &&
|
|
2095
|
-
console.error(
|
|
2091
|
+
}, [c, r]), A(() => {
|
|
2092
|
+
h && d((m) => {
|
|
2093
|
+
console.error(m);
|
|
2096
2094
|
});
|
|
2097
|
-
}, [h]),
|
|
2095
|
+
}, [h]), A(() => {
|
|
2098
2096
|
s && t && t(s);
|
|
2099
2097
|
}, [s, t]);
|
|
2100
2098
|
const v = () => {
|
|
@@ -2103,18 +2101,18 @@ const sa = () => {
|
|
|
2103
2101
|
print: i,
|
|
2104
2102
|
cancel: l,
|
|
2105
2103
|
setOnProgress: f,
|
|
2106
|
-
setOnComplete:
|
|
2107
|
-
setOnError:
|
|
2104
|
+
setOnComplete: g,
|
|
2105
|
+
setOnError: d,
|
|
2108
2106
|
progress: s
|
|
2109
2107
|
};
|
|
2110
|
-
return /* @__PURE__ */ a(
|
|
2108
|
+
return /* @__PURE__ */ a(xn.Provider, { value: _, children: e });
|
|
2111
2109
|
}, Tt = () => {
|
|
2112
|
-
const e = He(
|
|
2110
|
+
const e = He(xn);
|
|
2113
2111
|
if (!e)
|
|
2114
2112
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
2115
2113
|
return e;
|
|
2116
2114
|
}, Mn = () => {
|
|
2117
|
-
const { printIcon: e } =
|
|
2115
|
+
const { printIcon: e } = re();
|
|
2118
2116
|
return e || /* @__PURE__ */ a(jr, {});
|
|
2119
2117
|
}, Ln = ({ children: e }) => /* @__PURE__ */ a(X, { content: "Print", children: e }), ca = ({ print: e }) => /* @__PURE__ */ a(Ln, { children: /* @__PURE__ */ a(B, { onClick: e, children: /* @__PURE__ */ a(Mn, {}) }) }), ua = ({ print: e }) => /* @__PURE__ */ a(Ln, { children: /* @__PURE__ */ O(ce, { onClick: e, children: [
|
|
2120
2118
|
/* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Mn, {}) }),
|
|
@@ -2135,15 +2133,15 @@ const sa = () => {
|
|
|
2135
2133
|
}, da = {
|
|
2136
2134
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2137
2135
|
}, pa = () => {
|
|
2138
|
-
const { goToFirstPageIcon: e } =
|
|
2136
|
+
const { goToFirstPageIcon: e } = re();
|
|
2139
2137
|
return e || /* @__PURE__ */ a(en, { className: da["rp-go-to-Top"] });
|
|
2140
2138
|
}, ha = () => {
|
|
2141
|
-
const { goToLastPageIcon: e } =
|
|
2139
|
+
const { goToLastPageIcon: e } = re();
|
|
2142
2140
|
return e || /* @__PURE__ */ a(en, {});
|
|
2143
2141
|
}, fa = () => {
|
|
2144
|
-
const { goToPage: e, totalPages: t, focusedPage: n } =
|
|
2142
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = ee(), { jumpNavigationTool: r = !0 } = se(), o = D(() => n === 1, [n]), i = D(() => n === t, [n, t]), l = M(() => {
|
|
2145
2143
|
e(1);
|
|
2146
|
-
}, [e]), s =
|
|
2144
|
+
}, [e]), s = M(() => {
|
|
2147
2145
|
e(t);
|
|
2148
2146
|
}, [e, t]);
|
|
2149
2147
|
return r ? /* @__PURE__ */ O(Fe, { children: [
|
|
@@ -2170,9 +2168,9 @@ const sa = () => {
|
|
|
2170
2168
|
fullscreenTool: p
|
|
2171
2169
|
} = se();
|
|
2172
2170
|
return D(() => {
|
|
2173
|
-
const
|
|
2171
|
+
const d = c || l || s || i || o;
|
|
2174
2172
|
let f = !1;
|
|
2175
|
-
return t && (f = !(!n && !r && !h && !p)),
|
|
2173
|
+
return t && (f = !(!n && !r && !h && !p)), d || f;
|
|
2176
2174
|
}, [
|
|
2177
2175
|
n,
|
|
2178
2176
|
r,
|
|
@@ -2190,7 +2188,7 @@ const sa = () => {
|
|
|
2190
2188
|
children: /* @__PURE__ */ O("div", { className: ra["rp-other-tool-content"], children: [
|
|
2191
2189
|
t && /* @__PURE__ */ O(Fe, { children: [
|
|
2192
2190
|
/* @__PURE__ */ a(Jt, {}),
|
|
2193
|
-
/* @__PURE__ */ a(
|
|
2191
|
+
/* @__PURE__ */ a(Rn, {}),
|
|
2194
2192
|
/* @__PURE__ */ a(Nn, {}),
|
|
2195
2193
|
/* @__PURE__ */ a(Qt, {}),
|
|
2196
2194
|
/* @__PURE__ */ a(vt, {})
|
|
@@ -2208,10 +2206,10 @@ const sa = () => {
|
|
|
2208
2206
|
}, ga = () => {
|
|
2209
2207
|
const { isSmallScreen: e } = ge();
|
|
2210
2208
|
return /* @__PURE__ */ O(Ae, { children: [
|
|
2211
|
-
/* @__PURE__ */ a(
|
|
2209
|
+
/* @__PURE__ */ a(xr, {}),
|
|
2212
2210
|
!e && /* @__PURE__ */ O(Ae, { children: [
|
|
2213
2211
|
/* @__PURE__ */ a(Jt, {}),
|
|
2214
|
-
/* @__PURE__ */ a(
|
|
2212
|
+
/* @__PURE__ */ a(Rn, {}),
|
|
2215
2213
|
/* @__PURE__ */ a(Nn, {}),
|
|
2216
2214
|
/* @__PURE__ */ a(Qt, {})
|
|
2217
2215
|
] }),
|
|
@@ -2224,37 +2222,37 @@ const sa = () => {
|
|
|
2224
2222
|
"rp-current-zoom": "_rp-current-zoom_163s9_6",
|
|
2225
2223
|
"rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_163s9_20"
|
|
2226
2224
|
}, va = 25, nt = 1e3, _a = [50, 75, 100, 125, 150, 200, 300, 400], wa = () => {
|
|
2227
|
-
const { zoomInIcon: e } =
|
|
2225
|
+
const { zoomInIcon: e } = re();
|
|
2228
2226
|
return e || /* @__PURE__ */ a(Kr, {});
|
|
2229
2227
|
}, ba = () => {
|
|
2230
|
-
const { zoomOutIcon: e } =
|
|
2228
|
+
const { zoomOutIcon: e } = re();
|
|
2231
2229
|
return e || /* @__PURE__ */ a(Xr, {});
|
|
2232
2230
|
}, Ca = () => {
|
|
2233
|
-
const { zoomLevel: e, setZoomLevel: t } = ht(), { container: n, contentRef: r } = qe(), { zoomTool: o = !0 } = se(), { focusedPage: i } =
|
|
2234
|
-
t((
|
|
2235
|
-
const C = Math.floor(
|
|
2231
|
+
const { zoomLevel: e, setZoomLevel: t } = ht(), { container: n, contentRef: r } = qe(), { zoomTool: o = !0 } = se(), { focusedPage: i } = ee(), { rotate: l } = Ve(), { pages: s } = Y(), { isSmallScreen: c } = ge(), h = M(() => {
|
|
2232
|
+
t((m) => {
|
|
2233
|
+
const C = Math.floor(m / 25) * 25;
|
|
2236
2234
|
return Math.min(C + 25, nt);
|
|
2237
2235
|
});
|
|
2238
|
-
}, [t]), p =
|
|
2239
|
-
t((
|
|
2240
|
-
const C = Math.ceil(
|
|
2236
|
+
}, [t]), p = M(() => {
|
|
2237
|
+
t((m) => {
|
|
2238
|
+
const C = Math.ceil(m / 25) * 25;
|
|
2241
2239
|
return Math.min(C - 25, nt);
|
|
2242
2240
|
});
|
|
2243
|
-
}, [t]),
|
|
2244
|
-
var
|
|
2245
|
-
return (
|
|
2246
|
-
}, [s, i, l]), v =
|
|
2247
|
-
(
|
|
2248
|
-
const C = ((f == null ? void 0 : f.width) || 0) + 2 * yt,
|
|
2249
|
-
switch (
|
|
2241
|
+
}, [t]), g = D(() => e === va, [e]), d = D(() => e === nt, [e]), f = D(() => {
|
|
2242
|
+
var m;
|
|
2243
|
+
return (m = s.get(i)) == null ? void 0 : m.page.getViewport({ scale: 1, rotation: l });
|
|
2244
|
+
}, [s, i, l]), v = M(
|
|
2245
|
+
(m) => {
|
|
2246
|
+
const C = ((f == null ? void 0 : f.width) || 0) + 2 * yt, T = ((f == null ? void 0 : f.height) || 0) + 2 * yt, w = (r == null ? void 0 : r.clientWidth) || 0, S = (r == null ? void 0 : r.clientHeight) || 0;
|
|
2247
|
+
switch (m) {
|
|
2250
2248
|
case we.ACTUAL:
|
|
2251
2249
|
t(100);
|
|
2252
2250
|
break;
|
|
2253
2251
|
case we.PAGE_FIT:
|
|
2254
|
-
let
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2257
|
-
const b = Math.floor(
|
|
2252
|
+
let u = 0;
|
|
2253
|
+
const P = w > S;
|
|
2254
|
+
T > C && P ? u = S / T : u = w / C;
|
|
2255
|
+
const b = Math.floor(u * 100);
|
|
2258
2256
|
t(b);
|
|
2259
2257
|
break;
|
|
2260
2258
|
case we.PAGE_WIDTH:
|
|
@@ -2263,14 +2261,14 @@ const sa = () => {
|
|
|
2263
2261
|
}
|
|
2264
2262
|
},
|
|
2265
2263
|
[t, f]
|
|
2266
|
-
), _ =
|
|
2267
|
-
(
|
|
2268
|
-
typeof
|
|
2264
|
+
), _ = M(
|
|
2265
|
+
(m) => {
|
|
2266
|
+
typeof m == "number" ? t(m) : v(m);
|
|
2269
2267
|
},
|
|
2270
2268
|
[t, v]
|
|
2271
2269
|
);
|
|
2272
2270
|
return typeof o != "boolean" ? /* @__PURE__ */ a(o, { zoomLevel: e, setZoomLevel: t }) : o ? /* @__PURE__ */ O("div", { className: ye["rp-zoom-wrapper"], children: [
|
|
2273
|
-
/* @__PURE__ */ a(X, { content: "Zoom out", children: /* @__PURE__ */ a(B, { disabled:
|
|
2271
|
+
/* @__PURE__ */ a(X, { content: "Zoom out", children: /* @__PURE__ */ a(B, { disabled: g, onClick: p, children: /* @__PURE__ */ a(ba, {}) }) }),
|
|
2274
2272
|
!c && /* @__PURE__ */ a(X, { content: "Select zoom level", children: /* @__PURE__ */ a(
|
|
2275
2273
|
ft,
|
|
2276
2274
|
{
|
|
@@ -2291,16 +2289,16 @@ const sa = () => {
|
|
|
2291
2289
|
/* @__PURE__ */ a(ce, { onClick: () => _(we.PAGE_WIDTH), children: "Page width" })
|
|
2292
2290
|
] }),
|
|
2293
2291
|
/* @__PURE__ */ a(vt, {}),
|
|
2294
|
-
/* @__PURE__ */ a(Fe, { children: _a.map((
|
|
2295
|
-
|
|
2292
|
+
/* @__PURE__ */ a(Fe, { children: _a.map((m) => /* @__PURE__ */ O(ce, { onClick: () => _(m), children: [
|
|
2293
|
+
m,
|
|
2296
2294
|
" %"
|
|
2297
|
-
] },
|
|
2295
|
+
] }, m)) })
|
|
2298
2296
|
] })
|
|
2299
2297
|
}
|
|
2300
2298
|
) }),
|
|
2301
|
-
/* @__PURE__ */ a(X, { content: "Zoom in", children: /* @__PURE__ */ a(B, { disabled:
|
|
2299
|
+
/* @__PURE__ */ a(X, { content: "Zoom in", children: /* @__PURE__ */ a(B, { disabled: d, onClick: h, children: /* @__PURE__ */ a(wa, {}) }) })
|
|
2302
2300
|
] }) : null;
|
|
2303
|
-
},
|
|
2301
|
+
}, ne = {
|
|
2304
2302
|
"rp-search-tool-content": "_rp-search-tool-content_1vxow_1",
|
|
2305
2303
|
"rp-search-tool-input": "_rp-search-tool-input_1vxow_6",
|
|
2306
2304
|
"rp-search-tool-input-icon": "_rp-search-tool-input-icon_1vxow_12",
|
|
@@ -2310,7 +2308,7 @@ const sa = () => {
|
|
|
2310
2308
|
"rp-search-tool-input-clear": "_rp-search-tool-input-clear_1vxow_35",
|
|
2311
2309
|
"rp-search-input": "_rp-search-input_1vxow_49"
|
|
2312
2310
|
}, Gt = () => {
|
|
2313
|
-
const { searchIcon: e } =
|
|
2311
|
+
const { searchIcon: e } = re();
|
|
2314
2312
|
return e || /* @__PURE__ */ a(Jr, {});
|
|
2315
2313
|
}, Pa = () => {
|
|
2316
2314
|
const { container: e } = qe(), [t, n] = F(!1), { pdf: r } = Y(), [o, i] = F(null), {
|
|
@@ -2319,46 +2317,46 @@ const sa = () => {
|
|
|
2319
2317
|
loading: c,
|
|
2320
2318
|
setSearch: h,
|
|
2321
2319
|
totalMatches: p,
|
|
2322
|
-
currentMatchPosition:
|
|
2323
|
-
nextMatch:
|
|
2320
|
+
currentMatchPosition: g,
|
|
2321
|
+
nextMatch: d,
|
|
2324
2322
|
prevMatch: f,
|
|
2325
2323
|
search: v
|
|
2326
|
-
} = nn(), { searchTool: _ } = se(), [
|
|
2324
|
+
} = nn(), { searchTool: _ = !0 } = se(), [m, C] = F(v), T = M(() => {
|
|
2327
2325
|
n(!0);
|
|
2328
|
-
}, []), w =
|
|
2326
|
+
}, []), w = M(() => {
|
|
2329
2327
|
h(""), C(""), n(!1);
|
|
2330
|
-
}, [h]),
|
|
2331
|
-
(
|
|
2332
|
-
|
|
2328
|
+
}, [h]), S = M(
|
|
2329
|
+
(x) => {
|
|
2330
|
+
x.key === "Escape" && t && w();
|
|
2333
2331
|
},
|
|
2334
2332
|
[t]
|
|
2335
|
-
),
|
|
2336
|
-
(
|
|
2337
|
-
|
|
2333
|
+
), u = M(
|
|
2334
|
+
(x) => {
|
|
2335
|
+
x.shiftKey && x.key === "Enter" ? f() : x.key === "Enter" && h((E) => (m === E && d(), m));
|
|
2338
2336
|
},
|
|
2339
|
-
[
|
|
2337
|
+
[m, f, d, h]
|
|
2340
2338
|
);
|
|
2341
|
-
|
|
2342
|
-
window.removeEventListener("keydown",
|
|
2343
|
-
}), [
|
|
2339
|
+
A(() => (window.addEventListener("keydown", S), () => {
|
|
2340
|
+
window.removeEventListener("keydown", S);
|
|
2341
|
+
}), [S]), A(() => {
|
|
2344
2342
|
o && o.focus();
|
|
2345
2343
|
}, [o]);
|
|
2346
|
-
const
|
|
2347
|
-
C(
|
|
2348
|
-
}, []), b =
|
|
2344
|
+
const P = M((x) => {
|
|
2345
|
+
C(x.target.value);
|
|
2346
|
+
}, []), b = M(() => {
|
|
2349
2347
|
C(""), h("");
|
|
2350
|
-
}, [h]),
|
|
2351
|
-
(
|
|
2352
|
-
s((E) => ({ ...E, matchCase:
|
|
2348
|
+
}, [h]), I = D(() => `${g} / ${p}`, [g, p]), { wholeWords: y, matchCase: R } = D(() => l, [l]), L = M(
|
|
2349
|
+
(x) => {
|
|
2350
|
+
s((E) => ({ ...E, matchCase: x }));
|
|
2353
2351
|
},
|
|
2354
2352
|
[s]
|
|
2355
|
-
),
|
|
2356
|
-
(
|
|
2357
|
-
s((E) => ({ ...E, wholeWords:
|
|
2353
|
+
), N = M(
|
|
2354
|
+
(x) => {
|
|
2355
|
+
s((E) => ({ ...E, wholeWords: x }));
|
|
2358
2356
|
},
|
|
2359
2357
|
[s]
|
|
2360
2358
|
);
|
|
2361
|
-
return
|
|
2359
|
+
return A(() => {
|
|
2362
2360
|
w();
|
|
2363
2361
|
}, [r, w]), _ ? /* @__PURE__ */ a(
|
|
2364
2362
|
ft,
|
|
@@ -2366,40 +2364,40 @@ const sa = () => {
|
|
|
2366
2364
|
open: t,
|
|
2367
2365
|
container: e,
|
|
2368
2366
|
align: "start",
|
|
2369
|
-
triggerComponent: /* @__PURE__ */ a(X, { content: "Search in Document", children: /* @__PURE__ */ a(B, { onClick:
|
|
2370
|
-
children: /* @__PURE__ */ O("div", { className:
|
|
2371
|
-
/* @__PURE__ */ O("div", { className:
|
|
2372
|
-
/* @__PURE__ */ O("div", { className:
|
|
2367
|
+
triggerComponent: /* @__PURE__ */ a(X, { content: "Search in Document", children: /* @__PURE__ */ a(B, { onClick: T, children: /* @__PURE__ */ a(Gt, {}) }) }),
|
|
2368
|
+
children: /* @__PURE__ */ O("div", { className: ne["rp-search-tool-content"], children: [
|
|
2369
|
+
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-input-wrapper"], children: [
|
|
2370
|
+
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-input"], children: [
|
|
2373
2371
|
/* @__PURE__ */ a(
|
|
2374
2372
|
Zt,
|
|
2375
2373
|
{
|
|
2376
|
-
value:
|
|
2377
|
-
onKeyDown:
|
|
2378
|
-
onChange:
|
|
2374
|
+
value: m,
|
|
2375
|
+
onKeyDown: u,
|
|
2376
|
+
onChange: P,
|
|
2379
2377
|
icon: /* @__PURE__ */ a(Gt, {}),
|
|
2380
2378
|
placeholder: "Enter to Search",
|
|
2381
|
-
className:
|
|
2379
|
+
className: ne["rp-search-input"],
|
|
2382
2380
|
ref: i,
|
|
2383
|
-
children: !!
|
|
2381
|
+
children: !!m && /* @__PURE__ */ a("span", { className: ne["rp-search-tool-input-clear"], onClick: b, children: /* @__PURE__ */ a(Yr, {}) })
|
|
2384
2382
|
}
|
|
2385
2383
|
),
|
|
2386
|
-
c ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(pt, {}) }) : /* @__PURE__ */ a("span", { children:
|
|
2384
|
+
c ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(pt, {}) }) : /* @__PURE__ */ a("span", { children: I })
|
|
2387
2385
|
] }),
|
|
2388
|
-
/* @__PURE__ */ O("div", { className:
|
|
2389
|
-
/* @__PURE__ */ a(
|
|
2390
|
-
/* @__PURE__ */ a(
|
|
2386
|
+
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-input-checkboxes"], children: [
|
|
2387
|
+
/* @__PURE__ */ a(Rt, { name: "matchCase", value: R, onChange: L, children: "Match Case" }),
|
|
2388
|
+
/* @__PURE__ */ a(Rt, { name: "wholeWord", value: y, onChange: N, children: "Whole Word" })
|
|
2391
2389
|
] })
|
|
2392
2390
|
] }),
|
|
2393
|
-
/* @__PURE__ */ O("div", { className:
|
|
2394
|
-
/* @__PURE__ */ a(B, { onClick: f, children: /* @__PURE__ */ a(Me, { className:
|
|
2395
|
-
/* @__PURE__ */ a(B, { onClick:
|
|
2391
|
+
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-controls"], children: [
|
|
2392
|
+
/* @__PURE__ */ a(B, { onClick: f, children: /* @__PURE__ */ a(Me, { className: ne["rp-search-tool-input-icon"] }) }),
|
|
2393
|
+
/* @__PURE__ */ a(B, { onClick: d, children: /* @__PURE__ */ a(
|
|
2396
2394
|
Me,
|
|
2397
2395
|
{
|
|
2398
2396
|
style: { transform: "rotate(180deg" },
|
|
2399
|
-
className:
|
|
2397
|
+
className: ne["rp-search-tool-input-icon"]
|
|
2400
2398
|
}
|
|
2401
2399
|
) }),
|
|
2402
|
-
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(Yt, { onClick: w, className:
|
|
2400
|
+
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(Yt, { onClick: w, className: ne["rp-search-tool-input-icon"] }) })
|
|
2403
2401
|
] })
|
|
2404
2402
|
] })
|
|
2405
2403
|
}
|
|
@@ -2443,17 +2441,17 @@ const sa = () => {
|
|
|
2443
2441
|
"rp-sidebar-content": "_rp-sidebar-content_p2vax_1",
|
|
2444
2442
|
"rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_p2vax_16",
|
|
2445
2443
|
"rp-thumbnail-dragging": "_rp-thumbnail-dragging_p2vax_21"
|
|
2446
|
-
},
|
|
2444
|
+
}, Re = {
|
|
2447
2445
|
"rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
|
|
2448
2446
|
"rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
|
|
2449
2447
|
"rp-thumbnail": "_rp-thumbnail_3fenb_1",
|
|
2450
2448
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2451
2449
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2452
2450
|
}, ya = (e) => {
|
|
2453
|
-
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage: i } =
|
|
2451
|
+
const { thumbnailSrc: t, pageNumber: n, isFocused: r, viewport: o } = e, { goToPage: i } = ee(), l = D(() => r ? Re["rp-thumbnail-active"] : "", [r]), s = D(() => ({
|
|
2454
2452
|
width: Math.round(o.width),
|
|
2455
2453
|
height: Math.round(o.height)
|
|
2456
|
-
}), [o]), c =
|
|
2454
|
+
}), [o]), c = M(() => {
|
|
2457
2455
|
n && i(n);
|
|
2458
2456
|
}, [i, n]);
|
|
2459
2457
|
return /* @__PURE__ */ O(
|
|
@@ -2461,9 +2459,9 @@ const sa = () => {
|
|
|
2461
2459
|
{
|
|
2462
2460
|
onClick: c,
|
|
2463
2461
|
id: `page-${n}`,
|
|
2464
|
-
className:
|
|
2462
|
+
className: Re["rp-thumbnail-wrapper"],
|
|
2465
2463
|
children: [
|
|
2466
|
-
/* @__PURE__ */ a("div", { className: j(l,
|
|
2464
|
+
/* @__PURE__ */ a("div", { className: j(l, Re["rp-thumbnail"]), children: t ? /* @__PURE__ */ a(
|
|
2467
2465
|
"img",
|
|
2468
2466
|
{
|
|
2469
2467
|
src: t,
|
|
@@ -2474,7 +2472,7 @@ const sa = () => {
|
|
|
2474
2472
|
) : /* @__PURE__ */ a(
|
|
2475
2473
|
"div",
|
|
2476
2474
|
{
|
|
2477
|
-
className:
|
|
2475
|
+
className: Re["rp-thumbnail-loader"],
|
|
2478
2476
|
style: {
|
|
2479
2477
|
width: `${s.width}px`,
|
|
2480
2478
|
height: `${s.height}px`
|
|
@@ -2482,59 +2480,59 @@ const sa = () => {
|
|
|
2482
2480
|
children: /* @__PURE__ */ a(pt, {})
|
|
2483
2481
|
}
|
|
2484
2482
|
) }),
|
|
2485
|
-
/* @__PURE__ */ a("div", { className:
|
|
2483
|
+
/* @__PURE__ */ a("div", { className: Re["rp-thumbnail-text"], children: n })
|
|
2486
2484
|
]
|
|
2487
2485
|
}
|
|
2488
2486
|
);
|
|
2489
2487
|
}, Ut = {
|
|
2490
2488
|
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
2491
2489
|
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
2492
|
-
},
|
|
2493
|
-
const [e, t] = F({}), { pages: n } = Y(), { rotate: r } = Ve(), o = D(() => Object.keys(e).length, [e]), i =
|
|
2490
|
+
}, Ra = () => {
|
|
2491
|
+
const [e, t] = F({}), { pages: n } = Y(), { rotate: r } = Ve(), o = D(() => Object.keys(e).length, [e]), i = M(
|
|
2494
2492
|
(s) => {
|
|
2495
2493
|
if (!n.size)
|
|
2496
2494
|
return;
|
|
2497
|
-
const c = Array.from(n.values()).slice(0, s).map((
|
|
2498
|
-
const { thumbnailViewport:
|
|
2495
|
+
const c = Array.from(n.values()).slice(0, s).map((g) => {
|
|
2496
|
+
const { thumbnailViewport: d, scale: f } = It(g.page, r);
|
|
2499
2497
|
return {
|
|
2500
2498
|
scale: f,
|
|
2501
|
-
page:
|
|
2499
|
+
page: g.page,
|
|
2502
2500
|
loading: !0,
|
|
2503
|
-
viewport:
|
|
2501
|
+
viewport: d
|
|
2504
2502
|
};
|
|
2505
|
-
}), h = c.reduce((
|
|
2503
|
+
}), h = c.reduce((g, d) => (g[d.page.pageNumber] = d, g), {});
|
|
2506
2504
|
t(h);
|
|
2507
2505
|
const p = [];
|
|
2508
|
-
for (const
|
|
2509
|
-
const
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2506
|
+
for (const g of c) {
|
|
2507
|
+
const d = document.createElement("canvas"), f = ot(
|
|
2508
|
+
g.page,
|
|
2509
|
+
d,
|
|
2510
|
+
g.scale,
|
|
2513
2511
|
r
|
|
2514
2512
|
).promise.then(() => {
|
|
2515
|
-
const v =
|
|
2513
|
+
const v = d.toDataURL();
|
|
2516
2514
|
return {
|
|
2517
|
-
...
|
|
2515
|
+
...g,
|
|
2518
2516
|
thumbnailSrc: v,
|
|
2519
2517
|
loading: !1
|
|
2520
2518
|
};
|
|
2521
2519
|
});
|
|
2522
2520
|
p.push(f);
|
|
2523
2521
|
}
|
|
2524
|
-
Promise.all(p).then((
|
|
2525
|
-
const
|
|
2522
|
+
Promise.all(p).then((g) => {
|
|
2523
|
+
const d = g.reduce(
|
|
2526
2524
|
(f, v) => (f[v.page.pageNumber] = v, f),
|
|
2527
2525
|
{}
|
|
2528
2526
|
);
|
|
2529
|
-
t((f) => ({ ...f, ...
|
|
2527
|
+
t((f) => ({ ...f, ...d }));
|
|
2530
2528
|
});
|
|
2531
2529
|
},
|
|
2532
2530
|
[n, r]
|
|
2533
2531
|
);
|
|
2534
|
-
|
|
2532
|
+
A(() => {
|
|
2535
2533
|
i(10);
|
|
2536
2534
|
}, [i]);
|
|
2537
|
-
const l =
|
|
2535
|
+
const l = M(
|
|
2538
2536
|
(s) => {
|
|
2539
2537
|
if (!n)
|
|
2540
2538
|
return;
|
|
@@ -2552,16 +2550,16 @@ const sa = () => {
|
|
|
2552
2550
|
}));
|
|
2553
2551
|
const h = document.createElement("canvas");
|
|
2554
2552
|
ot(c.page, h, c.thumbnailScale, r).promise.then(() => {
|
|
2555
|
-
const p = h.toDataURL(), { thumbnailViewport:
|
|
2553
|
+
const p = h.toDataURL(), { thumbnailViewport: g, scale: d } = It(c.page, r);
|
|
2556
2554
|
return {
|
|
2557
|
-
scale:
|
|
2555
|
+
scale: d,
|
|
2558
2556
|
thumbnailSrc: p,
|
|
2559
2557
|
page: c.page,
|
|
2560
2558
|
loading: !1,
|
|
2561
|
-
viewport:
|
|
2559
|
+
viewport: g
|
|
2562
2560
|
};
|
|
2563
2561
|
}).then((p) => {
|
|
2564
|
-
t((
|
|
2562
|
+
t((g) => ({ ...g, [s]: p }));
|
|
2565
2563
|
});
|
|
2566
2564
|
},
|
|
2567
2565
|
[n, r]
|
|
@@ -2577,11 +2575,11 @@ const sa = () => {
|
|
|
2577
2575
|
setActive: (e) => {
|
|
2578
2576
|
},
|
|
2579
2577
|
active: !1
|
|
2580
|
-
}), On = () => He(En),
|
|
2578
|
+
}), On = () => He(En), xa = ({
|
|
2581
2579
|
children: e,
|
|
2582
2580
|
initialThumbnailsVisible: t
|
|
2583
2581
|
}) => {
|
|
2584
|
-
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } =
|
|
2582
|
+
const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } = Ra(), [l, s] = F(t);
|
|
2585
2583
|
return /* @__PURE__ */ a(
|
|
2586
2584
|
En.Provider,
|
|
2587
2585
|
{
|
|
@@ -2593,21 +2591,21 @@ const sa = () => {
|
|
|
2593
2591
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2594
2592
|
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Ma);
|
|
2595
2593
|
}, Na = $e((e, t) => {
|
|
2596
|
-
const { show: n } = e, { focusedPage: r, totalPages: o } =
|
|
2594
|
+
const { show: n } = e, { focusedPage: r, totalPages: o } = ee(), { thumbnailPages: i, addPage: l, thumbnailLength: s, addToPage: c } = On(), h = $(null), p = $(1);
|
|
2597
2595
|
qt(t, () => h.current);
|
|
2598
|
-
const
|
|
2596
|
+
const g = D(() => Object.values(i), [i]), d = M(() => {
|
|
2599
2597
|
const f = s + 1;
|
|
2600
2598
|
f <= o && l(f);
|
|
2601
2599
|
}, [l, o, s]);
|
|
2602
|
-
return
|
|
2600
|
+
return A(() => {
|
|
2603
2601
|
r > s ? c(r) : n && p.current !== r && (La(h.current, r), p.current = r);
|
|
2604
|
-
}, [r, s, c, n,
|
|
2605
|
-
var _,
|
|
2602
|
+
}, [r, s, c, n, g]), or(h.current, d), /* @__PURE__ */ a("div", { ref: h, className: Ut["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: Ut["rp-thumbnails"], children: n ? g.map((f, v) => {
|
|
2603
|
+
var _, m;
|
|
2606
2604
|
return /* @__PURE__ */ a(
|
|
2607
2605
|
ya,
|
|
2608
2606
|
{
|
|
2609
2607
|
isFocused: r === ((_ = f.page) == null ? void 0 : _.pageNumber),
|
|
2610
|
-
pageNumber: (
|
|
2608
|
+
pageNumber: (m = f.page) == null ? void 0 : m.pageNumber,
|
|
2611
2609
|
thumbnailSrc: f.thumbnailSrc,
|
|
2612
2610
|
loading: f.loading,
|
|
2613
2611
|
viewport: f.viewport
|
|
@@ -2616,10 +2614,10 @@ const sa = () => {
|
|
|
2616
2614
|
);
|
|
2617
2615
|
}) : null }) });
|
|
2618
2616
|
}), Ea = () => {
|
|
2619
|
-
const { thumbnailIcon: e } =
|
|
2617
|
+
const { thumbnailIcon: e } = re();
|
|
2620
2618
|
return e || /* @__PURE__ */ a(Hn, {});
|
|
2621
2619
|
}, Oa = () => {
|
|
2622
|
-
const { active: e, setActive: t } = On(), [n, r] = F(200), o = $(null), { thumbnailTool: i } = se(), l =
|
|
2620
|
+
const { active: e, setActive: t } = On(), [n, r] = F(200), o = $(null), { thumbnailTool: i } = se(), l = M(() => {
|
|
2623
2621
|
t((c) => !c);
|
|
2624
2622
|
}, []), s = D(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: l, active: e }) : i ? /* @__PURE__ */ a(X, { content: "Thumbnail", children: /* @__PURE__ */ a(B, { onClick: l, active: e, children: /* @__PURE__ */ a(Ea, {}) }) }) : null, [i, e, l]);
|
|
2625
2623
|
return /* @__PURE__ */ O(
|
|
@@ -2678,15 +2676,15 @@ const sa = () => {
|
|
|
2678
2676
|
style: c,
|
|
2679
2677
|
className: h,
|
|
2680
2678
|
onLoaded: p,
|
|
2681
|
-
cleanupOnLoaded:
|
|
2682
|
-
...
|
|
2683
|
-
} = e, [f, v] = F(null), [_,
|
|
2684
|
-
return
|
|
2685
|
-
|
|
2686
|
-
}), [p,
|
|
2679
|
+
cleanupOnLoaded: g,
|
|
2680
|
+
...d
|
|
2681
|
+
} = e, [f, v] = F(null), [_, m] = F(null), [C, T] = F(null);
|
|
2682
|
+
return A(() => (p && p(), () => {
|
|
2683
|
+
g && g();
|
|
2684
|
+
}), [p, g]), /* @__PURE__ */ a("div", { ref: t, className: j(he["rp-theme-variables"], he["rp-container"]), children: /* @__PURE__ */ a(lr, { container: _, contentRef: C, children: /* @__PURE__ */ a(Da, { ...d, children: /* @__PURE__ */ a(to, { initialSearch: l, children: /* @__PURE__ */ a(xa, { initialThumbnailsVisible: i, children: /* @__PURE__ */ a(Un, { slots: r, children: /* @__PURE__ */ a(Vn, { children: /* @__PURE__ */ a(ir, { icons: o, children: /* @__PURE__ */ a(wr, { elementRef: C, children: /* @__PURE__ */ a(la, { children: /* @__PURE__ */ a(jn, { children: s ? /* @__PURE__ */ a(
|
|
2687
2685
|
sr,
|
|
2688
2686
|
{
|
|
2689
|
-
getContainerRef:
|
|
2687
|
+
getContainerRef: m,
|
|
2690
2688
|
toolbarRef: f,
|
|
2691
2689
|
style: c,
|
|
2692
2690
|
className: h,
|
|
@@ -2695,7 +2693,7 @@ const sa = () => {
|
|
|
2695
2693
|
/* @__PURE__ */ a(Ia, { ref: v }),
|
|
2696
2694
|
/* @__PURE__ */ O("div", { className: he["rp-content"], children: [
|
|
2697
2695
|
/* @__PURE__ */ a("div", { className: he["rp-sidebar"], children: /* @__PURE__ */ a(Oa, {}) }),
|
|
2698
|
-
/* @__PURE__ */ a("div", { ref:
|
|
2696
|
+
/* @__PURE__ */ a("div", { ref: T, className: he["rp-pages"], children: n })
|
|
2699
2697
|
] })
|
|
2700
2698
|
] }),
|
|
2701
2699
|
/* @__PURE__ */ a($n, {})
|
|
@@ -2704,7 +2702,7 @@ const sa = () => {
|
|
|
2704
2702
|
) : /* @__PURE__ */ a(
|
|
2705
2703
|
"div",
|
|
2706
2704
|
{
|
|
2707
|
-
ref:
|
|
2705
|
+
ref: T,
|
|
2708
2706
|
className: j(he["rp-pages"], h),
|
|
2709
2707
|
style: c,
|
|
2710
2708
|
children: n
|
|
@@ -2713,11 +2711,11 @@ const sa = () => {
|
|
|
2713
2711
|
});
|
|
2714
2712
|
export {
|
|
2715
2713
|
po as A,
|
|
2716
|
-
|
|
2714
|
+
xa as B,
|
|
2717
2715
|
Qr as C,
|
|
2718
2716
|
Do as D,
|
|
2719
2717
|
Na as E,
|
|
2720
|
-
|
|
2718
|
+
Rn as F,
|
|
2721
2719
|
Oa as G,
|
|
2722
2720
|
Da as H,
|
|
2723
2721
|
Ta as L,
|
|
@@ -2743,15 +2741,15 @@ export {
|
|
|
2743
2741
|
Wo as m,
|
|
2744
2742
|
na as n,
|
|
2745
2743
|
sa as o,
|
|
2746
|
-
|
|
2744
|
+
xn as p,
|
|
2747
2745
|
la as q,
|
|
2748
2746
|
Nn as r,
|
|
2749
2747
|
ga as s,
|
|
2750
2748
|
Pa as t,
|
|
2751
|
-
|
|
2749
|
+
ee as u,
|
|
2752
2750
|
Ia as v,
|
|
2753
2751
|
ya as w,
|
|
2754
|
-
|
|
2752
|
+
Ra as x,
|
|
2755
2753
|
En as y,
|
|
2756
2754
|
On as z
|
|
2757
2755
|
};
|