@pdf-viewer/react 0.5.0-beta.1 → 0.5.0-beta.2
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-f99f3c29.js → RPLayout-fab108d3.js} +603 -603
- 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
|
@@ -90,14 +90,14 @@ import './assets/RPLayout.css';const ae = {
|
|
|
90
90
|
return A(() => {
|
|
91
91
|
if (!i || c === 0)
|
|
92
92
|
return;
|
|
93
|
-
const
|
|
94
|
-
if (o.current &&
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}).catch((
|
|
93
|
+
const p = i.get(t);
|
|
94
|
+
if (o.current && p) {
|
|
95
|
+
const h = o.current;
|
|
96
|
+
h.hidden = !0;
|
|
97
|
+
const m = s.current;
|
|
98
|
+
m && m.cancel(), r && r(), s.current = ot(p.page, h, c, l), s.current.promise.then(() => {
|
|
99
|
+
h.hidden = !1;
|
|
100
|
+
}).catch((u) => {
|
|
101
101
|
}).finally(() => {
|
|
102
102
|
n && n();
|
|
103
103
|
});
|
|
@@ -107,69 +107,69 @@ 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 } = ee(), i = $(), { columnCount: l } = Bt(), s = Xt(), c = $(t),
|
|
110
|
+
const { viewMode: e } = Ge(), { scrollMode: t } = Pe(), { virtualScrollRef: n, pageScrollElementRef: r } = Ue(), { setFocusedPage: o } = ee(), i = $(), { columnCount: l } = Bt(), s = Xt(), c = $(t), p = $(e);
|
|
111
111
|
A(() => {
|
|
112
112
|
n != null && n.scrollToItem && (i.current = n);
|
|
113
113
|
}, [n]);
|
|
114
|
-
const
|
|
115
|
-
(
|
|
114
|
+
const h = M(
|
|
115
|
+
(u) => {
|
|
116
116
|
if (!r)
|
|
117
117
|
return;
|
|
118
|
-
const f = Math.ceil(
|
|
119
|
-
|
|
118
|
+
const f = Math.ceil(u / 2) * 2 - 1;
|
|
119
|
+
u === 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
123
|
return A(() => {
|
|
124
|
-
c.current = t,
|
|
124
|
+
c.current = t, p.current = e;
|
|
125
125
|
}, [t, e]), { scrollToPage: M(
|
|
126
|
-
(
|
|
127
|
-
const v =
|
|
128
|
-
let _ = v,
|
|
129
|
-
if (
|
|
130
|
-
|
|
126
|
+
(u, f = "start") => {
|
|
127
|
+
const v = u - 1;
|
|
128
|
+
let _ = v, g = 0;
|
|
129
|
+
if (p.current === ze.DUAL_PAGE && c.current === Q.PAGE_SCROLLING) {
|
|
130
|
+
h(u);
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
if (c.current === Q.PAGE_SCROLLING) {
|
|
134
|
-
o(
|
|
134
|
+
o(u);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
i.current && (c.current === Q.HORIZONTAL_SCROLLING ?
|
|
137
|
+
i.current && (c.current === Q.HORIZONTAL_SCROLLING ? g = v : p.current === ze.DUAL_PAGE && (g = v % 2, _ = Math.floor(v / 2)), i.current.scrollToItem({ rowIndex: _, columnIndex: g, align: f }));
|
|
138
138
|
},
|
|
139
|
-
[l,
|
|
139
|
+
[l, h, o]
|
|
140
140
|
) };
|
|
141
141
|
}, eo = (e = {}, t = "") => {
|
|
142
|
-
const [n, r] = F(t), [o, i] = F(!1), { pdf: l } = Y(), s = $(!n), [c,
|
|
142
|
+
const [n, r] = F(t), [o, i] = F(!1), { pdf: l } = Y(), s = $(!n), [c, p] = F([]), [h, m] = F(0), { focusedPage: u } = ee(), { scrollToPage: f } = _t(), { virtualScrollRef: v, pageScrollElementRef: _, virtualScrollableElementRef: g } = Ue(), { scrollMode: b } = Pe(), [S, P] = F(null), T = D(() => h === 0 ? null : c[h - 1], [h, c]), d = D(() => c.length, [c]);
|
|
143
143
|
A(() => {
|
|
144
|
-
if (
|
|
145
|
-
const y =
|
|
146
|
-
f(
|
|
144
|
+
if (T && u !== T.page) {
|
|
145
|
+
const y = u < T.page ? "start" : "end";
|
|
146
|
+
f(T.page, y);
|
|
147
147
|
}
|
|
148
|
-
}, [
|
|
149
|
-
if (!
|
|
148
|
+
}, [T, f]), A(() => {
|
|
149
|
+
if (!T || u !== T.page || !S || !S.classList.contains("selected"))
|
|
150
150
|
return;
|
|
151
|
-
const y =
|
|
151
|
+
const y = g || _;
|
|
152
152
|
if (!y)
|
|
153
153
|
return;
|
|
154
|
-
const R =
|
|
154
|
+
const R = S.getBoundingClientRect(), L = y.clientHeight / 2, N = y.clientWidth / 2, x = y.scrollTop + R.top - L, E = y.scrollLeft + R.left - N;
|
|
155
155
|
y.scrollTo({
|
|
156
156
|
top: x,
|
|
157
157
|
left: E,
|
|
158
158
|
behavior: "smooth"
|
|
159
159
|
});
|
|
160
160
|
}, [
|
|
161
|
-
|
|
161
|
+
u,
|
|
162
162
|
v,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
S,
|
|
164
|
+
b,
|
|
165
|
+
g,
|
|
166
166
|
_
|
|
167
167
|
]);
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
}, [
|
|
171
|
-
|
|
172
|
-
}, [
|
|
168
|
+
const C = M(() => {
|
|
169
|
+
m((y) => d ? y + 1 > d ? 1 : y + 1 : 0);
|
|
170
|
+
}, [d]), w = M(() => {
|
|
171
|
+
m((y) => d ? y - 1 <= 0 ? d : y - 1 : 0);
|
|
172
|
+
}, [d]), I = M(async (y) => {
|
|
173
173
|
if (!y)
|
|
174
174
|
return {};
|
|
175
175
|
const R = y.numPages, L = {};
|
|
@@ -183,10 +183,10 @@ import './assets/RPLayout.css';const ae = {
|
|
|
183
183
|
}, []);
|
|
184
184
|
return A(() => {
|
|
185
185
|
if (!n) {
|
|
186
|
-
s.current = !0,
|
|
186
|
+
s.current = !0, p([]), m(0);
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
-
s.current = !1, i(!0),
|
|
189
|
+
s.current = !1, i(!0), p([]), m(0), I(l).then((y) => {
|
|
190
190
|
const L = Object.keys(y).reduce((N, x) => {
|
|
191
191
|
const E = Kn(
|
|
192
192
|
[n],
|
|
@@ -196,22 +196,22 @@ import './assets/RPLayout.css';const ae = {
|
|
|
196
196
|
).map((z, k) => ({ ...z, page: Number(x), pageMatchIdx: k }));
|
|
197
197
|
return [...N, ...E];
|
|
198
198
|
}, []);
|
|
199
|
-
|
|
199
|
+
p(L), m(L.length ? 1 : 0);
|
|
200
200
|
}).catch(() => {
|
|
201
|
-
|
|
201
|
+
p([]), m(0);
|
|
202
202
|
}).finally(() => i(!1));
|
|
203
203
|
}, [n, I, l, e]), {
|
|
204
204
|
search: n,
|
|
205
205
|
setSearch: r,
|
|
206
206
|
loading: o,
|
|
207
207
|
matches: c,
|
|
208
|
-
totalMatches:
|
|
209
|
-
currentMatchPosition:
|
|
210
|
-
currentMatch:
|
|
211
|
-
nextMatch:
|
|
212
|
-
prevMatch:
|
|
213
|
-
currentMatchElement:
|
|
214
|
-
setCurrentMatchElement:
|
|
208
|
+
totalMatches: d,
|
|
209
|
+
currentMatchPosition: h,
|
|
210
|
+
currentMatch: T,
|
|
211
|
+
nextMatch: C,
|
|
212
|
+
prevMatch: w,
|
|
213
|
+
currentMatchElement: S,
|
|
214
|
+
setCurrentMatchElement: P
|
|
215
215
|
};
|
|
216
216
|
}, tn = We({
|
|
217
217
|
search: "",
|
|
@@ -241,10 +241,10 @@ import './assets/RPLayout.css';const ae = {
|
|
|
241
241
|
totalMatches: l,
|
|
242
242
|
currentMatchPosition: s,
|
|
243
243
|
currentMatch: c,
|
|
244
|
-
search:
|
|
245
|
-
matches:
|
|
246
|
-
nextMatch:
|
|
247
|
-
prevMatch:
|
|
244
|
+
search: p,
|
|
245
|
+
matches: h,
|
|
246
|
+
nextMatch: m,
|
|
247
|
+
prevMatch: u,
|
|
248
248
|
currentMatchElement: f,
|
|
249
249
|
setCurrentMatchElement: v
|
|
250
250
|
} = eo(n, t);
|
|
@@ -259,10 +259,10 @@ import './assets/RPLayout.css';const ae = {
|
|
|
259
259
|
totalMatches: l,
|
|
260
260
|
currentMatchPosition: s,
|
|
261
261
|
currentMatch: c,
|
|
262
|
-
nextMatch:
|
|
263
|
-
prevMatch:
|
|
264
|
-
search:
|
|
265
|
-
matches:
|
|
262
|
+
nextMatch: m,
|
|
263
|
+
prevMatch: u,
|
|
264
|
+
search: p,
|
|
265
|
+
matches: h,
|
|
266
266
|
currentMatchElement: f,
|
|
267
267
|
setCurrentMatchElement: v
|
|
268
268
|
},
|
|
@@ -272,57 +272,57 @@ import './assets/RPLayout.css';const ae = {
|
|
|
272
272
|
}, nn = () => He(tn), no = (e) => {
|
|
273
273
|
const { pageNumber: t } = e, { pages: n } = Y(), r = $(null), { matches: o, currentMatch: i, setCurrentMatchElement: l } = nn(), [s, c] = F(
|
|
274
274
|
[]
|
|
275
|
-
),
|
|
276
|
-
(v, _,
|
|
277
|
-
if (
|
|
278
|
-
|
|
275
|
+
), p = $(), h = $(), m = $(), u = D(() => o.filter((v) => v.pageIndex === t - 1), [o, t]), f = M(
|
|
276
|
+
(v, _, g = !1) => {
|
|
277
|
+
if (g && Xn(v, _), !u.length) {
|
|
278
|
+
m.current = void 0, c([]);
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
|
-
const
|
|
282
|
-
c(
|
|
281
|
+
const b = Jn(u, v, _);
|
|
282
|
+
c(b);
|
|
283
283
|
},
|
|
284
|
-
[
|
|
284
|
+
[u]
|
|
285
285
|
);
|
|
286
286
|
return A(() => {
|
|
287
|
-
var
|
|
288
|
-
if ((
|
|
287
|
+
var g;
|
|
288
|
+
if ((g = m.current) == null || g.classList.remove("selected"), !s.length || !i || i.pageIndex !== t - 1)
|
|
289
289
|
return;
|
|
290
|
-
const v =
|
|
291
|
-
(
|
|
290
|
+
const v = u.findIndex(
|
|
291
|
+
(b) => JSON.stringify(b) === JSON.stringify(i)
|
|
292
292
|
);
|
|
293
293
|
if (v === -1)
|
|
294
294
|
return;
|
|
295
|
-
const _ = s.find((
|
|
296
|
-
_ && (
|
|
297
|
-
}, [i, s,
|
|
295
|
+
const _ = s.find((b) => b.index === v);
|
|
296
|
+
_ && (m.current = _.element, l(_.element), _.element.classList.add("selected"));
|
|
297
|
+
}, [i, s, u]), A(() => {
|
|
298
298
|
const v = n.get(t);
|
|
299
299
|
if (!(!v || !r.current))
|
|
300
|
-
return
|
|
301
|
-
const
|
|
302
|
-
return
|
|
303
|
-
viewport:
|
|
300
|
+
return p.current && p.current.cancel(), v.page.getTextContent().then((_) => {
|
|
301
|
+
const g = v.page.getViewport({ scale: 1 });
|
|
302
|
+
return p.current = new Qn.TextLayer({
|
|
303
|
+
viewport: g,
|
|
304
304
|
textContentSource: _,
|
|
305
305
|
container: r.current
|
|
306
|
-
}),
|
|
306
|
+
}), h.current = _, r.current && (r.current.innerText = ""), p.current.render();
|
|
307
307
|
}).then(() => {
|
|
308
|
-
var
|
|
309
|
-
[].slice.call(r.current.children).forEach((
|
|
310
|
-
|
|
308
|
+
var b;
|
|
309
|
+
[].slice.call(r.current.children).forEach((S) => {
|
|
310
|
+
S.classList.add(Xe["rp-text-layer-text"]);
|
|
311
311
|
});
|
|
312
|
-
const
|
|
313
|
-
|
|
312
|
+
const g = (b = p.current) == null ? void 0 : b.textDivs;
|
|
313
|
+
g && h.current && f(h.current, g);
|
|
314
314
|
}).catch(() => {
|
|
315
315
|
}), () => {
|
|
316
316
|
var _;
|
|
317
|
-
(_ =
|
|
317
|
+
(_ = p.current) == null || _.cancel();
|
|
318
318
|
};
|
|
319
319
|
}, [n, t]), A(() => {
|
|
320
|
-
var
|
|
321
|
-
[].slice.call(r.current.children).forEach((
|
|
322
|
-
|
|
320
|
+
var g;
|
|
321
|
+
[].slice.call(r.current.children).forEach((b) => {
|
|
322
|
+
b.classList.add(Xe["rp-text-layer-text"]);
|
|
323
323
|
});
|
|
324
|
-
const _ = (
|
|
325
|
-
_ &&
|
|
324
|
+
const _ = (g = p.current) == null ? void 0 : g.textDivs;
|
|
325
|
+
_ && h.current && f(h.current, _, !0);
|
|
326
326
|
}, [f]), /* @__PURE__ */ a(
|
|
327
327
|
"div",
|
|
328
328
|
{
|
|
@@ -445,91 +445,91 @@ function uo(e, t) {
|
|
|
445
445
|
e.removeEventListener(n, t);
|
|
446
446
|
}
|
|
447
447
|
const po = (e) => {
|
|
448
|
-
const { pageNumber: t } = e, n = $(null), { pages: r, pdf: o } = Y(), i = $(), [l, s] = F(),
|
|
448
|
+
const { pageNumber: t } = e, n = $(null), { pages: r, pdf: o } = Y(), i = $(), [l, s] = F(), { setFocusedPage: c, goToPage: p } = ee(), { scrollMode: h } = Pe(), m = D(() => r.get(t), [r, t]), u = D(() => m == null ? void 0 : m.page.getViewport(), [m]);
|
|
449
449
|
A(() => {
|
|
450
|
-
|
|
451
|
-
s(w);
|
|
452
|
-
}), o == null || o.getFieldObjects().then((w) => {
|
|
453
|
-
h(w);
|
|
454
|
-
}), i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
450
|
+
i.current && (i.current.div.replaceChildren(), i.current = void 0);
|
|
455
451
|
}, [o]);
|
|
456
|
-
const
|
|
452
|
+
const f = D(() => o == null ? void 0 : o.annotationStorage, [o]);
|
|
457
453
|
A(() => {
|
|
458
|
-
|
|
459
|
-
i.current = void 0,
|
|
454
|
+
m && m.page.getAnnotations().then((_) => {
|
|
455
|
+
i.current = void 0, s(_), n.current && (n.current.innerText = "");
|
|
460
456
|
});
|
|
461
|
-
}, [
|
|
462
|
-
const
|
|
463
|
-
(
|
|
464
|
-
lo(
|
|
457
|
+
}, [m]);
|
|
458
|
+
const v = M(
|
|
459
|
+
(_) => {
|
|
460
|
+
lo(_), !(!l || !o) && (h === Q.PAGE_SCROLLING ? Mt(_, l, o, (g) => c(g.pageIndex + 1)) : Mt(_, l, o, (g) => p(g.pageIndex + 1)));
|
|
465
461
|
},
|
|
466
|
-
[o,
|
|
462
|
+
[o, l, p, c, h]
|
|
467
463
|
);
|
|
468
464
|
return A(() => {
|
|
469
|
-
if (!
|
|
465
|
+
if (!m || !l)
|
|
470
466
|
return;
|
|
471
|
-
const
|
|
467
|
+
const _ = m.page.getViewport();
|
|
472
468
|
if (i.current) {
|
|
473
469
|
i.current.update({
|
|
474
|
-
viewport:
|
|
470
|
+
viewport: _.clone({ dontFlip: !0 })
|
|
475
471
|
});
|
|
476
472
|
return;
|
|
477
473
|
}
|
|
478
|
-
for (const
|
|
479
|
-
const { annotationType:
|
|
480
|
-
switch (
|
|
474
|
+
for (const b of l) {
|
|
475
|
+
const { annotationType: S } = b;
|
|
476
|
+
switch (S) {
|
|
481
477
|
case at.Link:
|
|
482
|
-
so(
|
|
478
|
+
so(b);
|
|
483
479
|
break;
|
|
484
480
|
case at.Widget:
|
|
485
481
|
break;
|
|
486
482
|
}
|
|
487
483
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
484
|
+
(async () => {
|
|
485
|
+
i.current = new er({
|
|
486
|
+
div: n.current,
|
|
487
|
+
accessibilityManager: void 0,
|
|
488
|
+
annotationCanvasMap: void 0,
|
|
489
|
+
annotationEditorUIManager: void 0,
|
|
490
|
+
structTreeLayer: void 0,
|
|
491
|
+
page: m.page,
|
|
492
|
+
viewport: _.clone({ dontFlip: !0 })
|
|
493
|
+
}), n.current && uo(n.current, v);
|
|
494
|
+
const b = await (o == null ? void 0 : o.hasJSActions()), S = await (o == null ? void 0 : o.getFieldObjects());
|
|
495
|
+
return i.current.render({
|
|
496
|
+
annotations: l,
|
|
497
|
+
annotationStorage: f,
|
|
498
|
+
hasJSActions: b,
|
|
499
|
+
fieldObjects: S,
|
|
500
|
+
div: n.current,
|
|
501
|
+
viewport: _.clone({ dontFlip: !0 }),
|
|
502
|
+
page: m.page,
|
|
503
|
+
imageResourcesPath: oo,
|
|
504
|
+
renderForms: !1,
|
|
505
|
+
linkService: new Cr(),
|
|
506
|
+
downloadManager: null,
|
|
507
|
+
enableScripting: !1
|
|
508
|
+
});
|
|
509
|
+
})().then(() => {
|
|
510
|
+
n.current && co(n.current, v);
|
|
511
511
|
});
|
|
512
|
-
}, [
|
|
512
|
+
}, [o, l, v]), /* @__PURE__ */ a(
|
|
513
513
|
"div",
|
|
514
514
|
{
|
|
515
515
|
"data-rp": `page-${t}-annotationLayer`,
|
|
516
|
-
style: { width: `${
|
|
516
|
+
style: { width: `${u == null ? void 0 : u.width}px`, height: `${u == null ? void 0 : u.height}px` },
|
|
517
517
|
className: ro["rp-annotation-layer"],
|
|
518
518
|
ref: n
|
|
519
519
|
}
|
|
520
520
|
);
|
|
521
521
|
}, ho = Array.from({ length: 21 }, (e, t) => Number((t * 0.05).toFixed(2))), wt = $e((e, t) => {
|
|
522
|
-
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...i } = e, { pages: l } = Y(), { rotate: s } = Ve(), { textLayer: c } = cr(), { currentZoom:
|
|
522
|
+
const { pageNumber: n, style: r, onIntersectRatioChange: o, ...i } = e, { pages: l } = Y(), { rotate: s } = Ve(), { textLayer: c } = cr(), { currentZoom: p } = ht(), h = $(l.get(n)), [m, u] = F(!1), f = $(null), [v, _] = F({
|
|
523
523
|
width: 0,
|
|
524
524
|
height: 0
|
|
525
525
|
});
|
|
526
526
|
qt(t, () => f.current), A(() => {
|
|
527
|
-
if (l && (
|
|
528
|
-
const
|
|
529
|
-
_(
|
|
527
|
+
if (l && (h.current = l.get(n), h.current)) {
|
|
528
|
+
const P = h.current.page.getViewport({ scale: p, rotation: s });
|
|
529
|
+
_(P);
|
|
530
530
|
}
|
|
531
|
-
}, [l, n, s,
|
|
532
|
-
const
|
|
531
|
+
}, [l, n, s, p]);
|
|
532
|
+
const g = D(() => {
|
|
533
533
|
switch (s) {
|
|
534
534
|
case 90:
|
|
535
535
|
return `${v.width / 2}px ${v.width / 2}px`;
|
|
@@ -539,20 +539,20 @@ const po = (e) => {
|
|
|
539
539
|
default:
|
|
540
540
|
return "center";
|
|
541
541
|
}
|
|
542
|
-
}, [s, v]),
|
|
543
|
-
|
|
544
|
-
}, []),
|
|
545
|
-
|
|
542
|
+
}, [s, v]), b = M(() => {
|
|
543
|
+
u(!0);
|
|
544
|
+
}, []), S = M(() => {
|
|
545
|
+
u(!1);
|
|
546
546
|
}, []);
|
|
547
547
|
return A(() => {
|
|
548
|
-
const
|
|
549
|
-
(
|
|
550
|
-
o && o(n,
|
|
548
|
+
const P = new IntersectionObserver(
|
|
549
|
+
(T) => {
|
|
550
|
+
o && o(n, T[0].intersectionRatio);
|
|
551
551
|
},
|
|
552
552
|
{ threshold: ho }
|
|
553
553
|
);
|
|
554
|
-
return f.current &&
|
|
555
|
-
|
|
554
|
+
return f.current && P.observe(f.current), () => {
|
|
555
|
+
P.disconnect(), o && o(n, -1);
|
|
556
556
|
};
|
|
557
557
|
}, [o, n, s]), /* @__PURE__ */ a(
|
|
558
558
|
"div",
|
|
@@ -564,8 +564,8 @@ const po = (e) => {
|
|
|
564
564
|
style: {
|
|
565
565
|
...r,
|
|
566
566
|
"--rp-rotate": `${s}deg`,
|
|
567
|
-
"--rp-page-rotate-translate": `${
|
|
568
|
-
"--scale-factor":
|
|
567
|
+
"--rp-page-rotate-translate": `${g}`,
|
|
568
|
+
"--scale-factor": p
|
|
569
569
|
},
|
|
570
570
|
className: Ke["rp-page-wrapper"],
|
|
571
571
|
children: /* @__PURE__ */ O(
|
|
@@ -577,8 +577,8 @@ const po = (e) => {
|
|
|
577
577
|
},
|
|
578
578
|
className: Ke["rp-page"],
|
|
579
579
|
children: [
|
|
580
|
-
/* @__PURE__ */ a(Qr, { onLoading:
|
|
581
|
-
|
|
580
|
+
/* @__PURE__ */ a(Qr, { onLoading: b, onLoaded: S, pageNumber: n }),
|
|
581
|
+
m && /* @__PURE__ */ a("div", { className: Ke["rp-loader-wrapper"], children: /* @__PURE__ */ a(pt, {}) }),
|
|
582
582
|
c && /* @__PURE__ */ a(no, { pageNumber: n }),
|
|
583
583
|
/* @__PURE__ */ a(po, { pageNumber: n })
|
|
584
584
|
]
|
|
@@ -690,23 +690,23 @@ var bo = 150, Co = function(t) {
|
|
|
690
690
|
}, Ee = null, Oe = null, De = null;
|
|
691
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());
|
|
692
692
|
function Po(e) {
|
|
693
|
-
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment,
|
|
694
|
-
return t = /* @__PURE__ */ function(
|
|
695
|
-
fo(
|
|
696
|
-
function T
|
|
697
|
-
var
|
|
698
|
-
return
|
|
699
|
-
instance: Lt(
|
|
693
|
+
var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, o = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, l = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, h = e.getRowHeight, m = e.getRowOffset, u = e.getRowStartIndexForOffset, f = e.getRowStopIndexForStartIndex, v = e.initInstanceProps, _ = e.shouldResetStyleCacheOnItemSizeChange, g = e.validateProps;
|
|
694
|
+
return t = /* @__PURE__ */ function(b) {
|
|
695
|
+
fo(S, b);
|
|
696
|
+
function S(T) {
|
|
697
|
+
var d;
|
|
698
|
+
return d = b.call(this, T) || this, d._instanceProps = v(d.props, Lt(d)), d._resetIsScrollingTimeoutId = null, d._outerRef = void 0, d.state = {
|
|
699
|
+
instance: Lt(d),
|
|
700
700
|
isScrolling: !1,
|
|
701
701
|
horizontalScrollDirection: "forward",
|
|
702
|
-
scrollLeft: typeof
|
|
703
|
-
scrollTop: typeof
|
|
702
|
+
scrollLeft: typeof d.props.initialScrollLeft == "number" ? d.props.initialScrollLeft : 0,
|
|
703
|
+
scrollTop: typeof d.props.initialScrollTop == "number" ? d.props.initialScrollTop : 0,
|
|
704
704
|
scrollUpdateWasRequested: !1,
|
|
705
705
|
verticalScrollDirection: "forward"
|
|
706
|
-
},
|
|
707
|
-
return
|
|
708
|
-
overscanColumnStartIndex:
|
|
709
|
-
overscanColumnStopIndex:
|
|
706
|
+
}, d._callOnItemsRendered = void 0, d._callOnItemsRendered = Je(function(C, w, I, y, R, L, N, x) {
|
|
707
|
+
return d.props.onItemsRendered({
|
|
708
|
+
overscanColumnStartIndex: C,
|
|
709
|
+
overscanColumnStopIndex: w,
|
|
710
710
|
overscanRowStartIndex: I,
|
|
711
711
|
overscanRowStopIndex: y,
|
|
712
712
|
visibleColumnStartIndex: R,
|
|
@@ -714,38 +714,38 @@ function Po(e) {
|
|
|
714
714
|
visibleRowStartIndex: N,
|
|
715
715
|
visibleRowStopIndex: x
|
|
716
716
|
});
|
|
717
|
-
}),
|
|
718
|
-
return
|
|
717
|
+
}), d._callOnScroll = void 0, d._callOnScroll = Je(function(C, w, I, y, R) {
|
|
718
|
+
return d.props.onScroll({
|
|
719
719
|
horizontalScrollDirection: I,
|
|
720
|
-
scrollLeft:
|
|
721
|
-
scrollTop:
|
|
720
|
+
scrollLeft: C,
|
|
721
|
+
scrollTop: w,
|
|
722
722
|
verticalScrollDirection: y,
|
|
723
723
|
scrollUpdateWasRequested: R
|
|
724
724
|
});
|
|
725
|
-
}),
|
|
726
|
-
var I =
|
|
725
|
+
}), d._getItemStyle = void 0, d._getItemStyle = function(C, w) {
|
|
726
|
+
var I = d.props, y = I.columnWidth, R = I.direction, L = I.rowHeight, N = d._getItemStyleCache(_ && y, _ && R, _ && L), x = C + ":" + w, E;
|
|
727
727
|
if (N.hasOwnProperty(x))
|
|
728
728
|
E = N[x];
|
|
729
729
|
else {
|
|
730
|
-
var z = n(
|
|
730
|
+
var z = n(d.props, w, d._instanceProps), k = R === "rtl";
|
|
731
731
|
N[x] = E = {
|
|
732
732
|
position: "absolute",
|
|
733
733
|
left: k ? void 0 : z,
|
|
734
734
|
right: k ? z : void 0,
|
|
735
|
-
top:
|
|
736
|
-
height:
|
|
737
|
-
width: i(
|
|
735
|
+
top: m(d.props, C, d._instanceProps),
|
|
736
|
+
height: h(d.props, C, d._instanceProps),
|
|
737
|
+
width: i(d.props, w, d._instanceProps)
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
740
|
return E;
|
|
741
|
-
},
|
|
741
|
+
}, d._getItemStyleCache = void 0, d._getItemStyleCache = Je(function(C, w, I) {
|
|
742
742
|
return {};
|
|
743
|
-
}),
|
|
744
|
-
var
|
|
745
|
-
|
|
743
|
+
}), d._onScroll = function(C) {
|
|
744
|
+
var w = C.currentTarget, I = w.clientHeight, y = w.clientWidth, R = w.scrollLeft, L = w.scrollTop, N = w.scrollHeight, x = w.scrollWidth;
|
|
745
|
+
d.setState(function(E) {
|
|
746
746
|
if (E.scrollLeft === R && E.scrollTop === L)
|
|
747
747
|
return null;
|
|
748
|
-
var z =
|
|
748
|
+
var z = d.props.direction, k = R;
|
|
749
749
|
if (z === "rtl")
|
|
750
750
|
switch (At()) {
|
|
751
751
|
case "negative":
|
|
@@ -765,80 +765,80 @@ function Po(e) {
|
|
|
765
765
|
verticalScrollDirection: E.scrollTop < L ? "forward" : "backward",
|
|
766
766
|
scrollUpdateWasRequested: !1
|
|
767
767
|
};
|
|
768
|
-
},
|
|
769
|
-
},
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
},
|
|
773
|
-
|
|
774
|
-
},
|
|
775
|
-
|
|
768
|
+
}, d._resetIsScrollingDebounced);
|
|
769
|
+
}, d._outerRefSetter = function(C) {
|
|
770
|
+
var w = d.props.outerRef;
|
|
771
|
+
d._outerRef = C, typeof w == "function" ? w(C) : w != null && typeof w == "object" && w.hasOwnProperty("current") && (w.current = C);
|
|
772
|
+
}, d._resetIsScrollingDebounced = function() {
|
|
773
|
+
d._resetIsScrollingTimeoutId !== null && Dt(d._resetIsScrollingTimeoutId), d._resetIsScrollingTimeoutId = _o(d._resetIsScrolling, bo);
|
|
774
|
+
}, d._resetIsScrolling = function() {
|
|
775
|
+
d._resetIsScrollingTimeoutId = null, d.setState({
|
|
776
776
|
isScrolling: !1
|
|
777
777
|
}, function() {
|
|
778
|
-
|
|
778
|
+
d._getItemStyleCache(-1);
|
|
779
779
|
});
|
|
780
|
-
},
|
|
780
|
+
}, d;
|
|
781
781
|
}
|
|
782
|
-
|
|
783
|
-
return So(
|
|
782
|
+
S.getDerivedStateFromProps = function(d, C) {
|
|
783
|
+
return So(d, C), g(d), null;
|
|
784
784
|
};
|
|
785
|
-
var
|
|
786
|
-
return
|
|
787
|
-
var
|
|
788
|
-
|
|
789
|
-
return
|
|
790
|
-
horizontalScrollDirection: I.scrollLeft <
|
|
791
|
-
scrollLeft:
|
|
792
|
-
scrollTop:
|
|
785
|
+
var P = S.prototype;
|
|
786
|
+
return P.scrollTo = function(d) {
|
|
787
|
+
var C = d.scrollLeft, w = d.scrollTop;
|
|
788
|
+
C !== void 0 && (C = Math.max(0, C)), w !== void 0 && (w = Math.max(0, w)), this.setState(function(I) {
|
|
789
|
+
return C === void 0 && (C = I.scrollLeft), w === void 0 && (w = I.scrollTop), I.scrollLeft === C && I.scrollTop === w ? null : {
|
|
790
|
+
horizontalScrollDirection: I.scrollLeft < C ? "forward" : "backward",
|
|
791
|
+
scrollLeft: C,
|
|
792
|
+
scrollTop: w,
|
|
793
793
|
scrollUpdateWasRequested: !0,
|
|
794
|
-
verticalScrollDirection: I.scrollTop <
|
|
794
|
+
verticalScrollDirection: I.scrollTop < w ? "forward" : "backward"
|
|
795
795
|
};
|
|
796
796
|
}, this._resetIsScrollingDebounced);
|
|
797
|
-
},
|
|
798
|
-
var
|
|
797
|
+
}, P.scrollToItem = function(d) {
|
|
798
|
+
var C = d.align, w = C === void 0 ? "auto" : C, I = d.columnIndex, y = d.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
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
800
|
var U = l(this.props, this._instanceProps), K = s(this.props, this._instanceProps), ue = K > E ? Z : 0, oe = U > N ? Z : 0;
|
|
801
801
|
this.scrollTo({
|
|
802
|
-
scrollLeft: I !== void 0 ? c(this.props, I,
|
|
803
|
-
scrollTop: y !== void 0 ?
|
|
802
|
+
scrollLeft: I !== void 0 ? c(this.props, I, w, k, this._instanceProps, oe) : k,
|
|
803
|
+
scrollTop: y !== void 0 ? p(this.props, y, w, G, this._instanceProps, ue) : G
|
|
804
804
|
});
|
|
805
|
-
},
|
|
806
|
-
var
|
|
805
|
+
}, P.componentDidMount = function() {
|
|
806
|
+
var d = this.props, C = d.initialScrollLeft, w = d.initialScrollTop;
|
|
807
807
|
if (this._outerRef != null) {
|
|
808
808
|
var I = this._outerRef;
|
|
809
|
-
typeof
|
|
809
|
+
typeof C == "number" && (I.scrollLeft = C), typeof w == "number" && (I.scrollTop = w);
|
|
810
810
|
}
|
|
811
811
|
this._callPropsCallbacks();
|
|
812
|
-
},
|
|
813
|
-
var
|
|
812
|
+
}, P.componentDidUpdate = function() {
|
|
813
|
+
var d = this.props.direction, C = this.state, w = C.scrollLeft, I = C.scrollTop, y = C.scrollUpdateWasRequested;
|
|
814
814
|
if (y && this._outerRef != null) {
|
|
815
815
|
var R = this._outerRef;
|
|
816
|
-
if (
|
|
816
|
+
if (d === "rtl")
|
|
817
817
|
switch (At()) {
|
|
818
818
|
case "negative":
|
|
819
|
-
R.scrollLeft = -
|
|
819
|
+
R.scrollLeft = -w;
|
|
820
820
|
break;
|
|
821
821
|
case "positive-ascending":
|
|
822
|
-
R.scrollLeft =
|
|
822
|
+
R.scrollLeft = w;
|
|
823
823
|
break;
|
|
824
824
|
default:
|
|
825
825
|
var L = R.clientWidth, N = R.scrollWidth;
|
|
826
|
-
R.scrollLeft = N - L -
|
|
826
|
+
R.scrollLeft = N - L - w;
|
|
827
827
|
break;
|
|
828
828
|
}
|
|
829
829
|
else
|
|
830
|
-
R.scrollLeft = Math.max(0,
|
|
830
|
+
R.scrollLeft = Math.max(0, w);
|
|
831
831
|
R.scrollTop = Math.max(0, I);
|
|
832
832
|
}
|
|
833
833
|
this._callPropsCallbacks();
|
|
834
|
-
},
|
|
834
|
+
}, P.componentWillUnmount = function() {
|
|
835
835
|
this._resetIsScrollingTimeoutId !== null && Dt(this._resetIsScrollingTimeoutId);
|
|
836
|
-
},
|
|
837
|
-
var
|
|
836
|
+
}, P.render = function() {
|
|
837
|
+
var d = this.props, C = d.children, w = d.className, I = d.columnCount, y = d.direction, R = d.height, L = d.innerRef, N = d.innerElementType, x = d.innerTagName, E = d.itemData, z = d.itemKey, k = z === void 0 ? Co : z, G = d.outerElementType, Z = d.outerTagName, U = d.rowCount, K = d.style, ue = d.useIsScrolling, oe = d.width, ve = this.state.isScrolling, _e = this._getHorizontalRangeToRender(), Se = _e[0], W = _e[1], H = this._getVerticalRangeToRender(), q = H[0], le = H[1], Te = [];
|
|
838
838
|
if (I > 0 && U)
|
|
839
839
|
for (var de = q; de <= le; de++)
|
|
840
840
|
for (var pe = Se; pe <= W; pe++)
|
|
841
|
-
Te.push(Ne(
|
|
841
|
+
Te.push(Ne(C, {
|
|
842
842
|
columnIndex: pe,
|
|
843
843
|
data: E,
|
|
844
844
|
isScrolling: ue ? ve : void 0,
|
|
@@ -852,7 +852,7 @@ function Po(e) {
|
|
|
852
852
|
}));
|
|
853
853
|
var Ze = l(this.props, this._instanceProps), je = s(this.props, this._instanceProps);
|
|
854
854
|
return Ne(G || Z || "div", {
|
|
855
|
-
className:
|
|
855
|
+
className: w,
|
|
856
856
|
onScroll: this._onScroll,
|
|
857
857
|
ref: this._outerRefSetter,
|
|
858
858
|
style: lt({
|
|
@@ -873,9 +873,9 @@ function Po(e) {
|
|
|
873
873
|
width: je
|
|
874
874
|
}
|
|
875
875
|
}));
|
|
876
|
-
},
|
|
877
|
-
var
|
|
878
|
-
if (typeof
|
|
876
|
+
}, P._callPropsCallbacks = function() {
|
|
877
|
+
var d = this.props, C = d.columnCount, w = d.onItemsRendered, I = d.onScroll, y = d.rowCount;
|
|
878
|
+
if (typeof w == "function" && C > 0 && y > 0) {
|
|
879
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
880
|
this._callOnItemsRendered(L, N, k, G, x, E, Z, U);
|
|
881
881
|
}
|
|
@@ -883,19 +883,19 @@ function Po(e) {
|
|
|
883
883
|
var K = this.state, ue = K.horizontalScrollDirection, oe = K.scrollLeft, ve = K.scrollTop, _e = K.scrollUpdateWasRequested, Se = K.verticalScrollDirection;
|
|
884
884
|
this._callOnScroll(oe, ve, ue, Se, _e);
|
|
885
885
|
}
|
|
886
|
-
},
|
|
887
|
-
var
|
|
888
|
-
if (
|
|
886
|
+
}, P._getHorizontalRangeToRender = function() {
|
|
887
|
+
var d = this.props, C = d.columnCount, w = d.overscanColumnCount, I = d.overscanColumnsCount, y = d.overscanCount, R = d.rowCount, L = this.state, N = L.horizontalScrollDirection, x = L.isScrolling, E = L.scrollLeft, z = w || I || y || 1;
|
|
888
|
+
if (C === 0 || R === 0)
|
|
889
889
|
return [0, 0, 0, 0];
|
|
890
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(
|
|
892
|
-
},
|
|
893
|
-
var
|
|
894
|
-
if (
|
|
891
|
+
return [Math.max(0, k - Z), Math.max(0, Math.min(C - 1, G + U)), k, G];
|
|
892
|
+
}, P._getVerticalRangeToRender = function() {
|
|
893
|
+
var d = this.props, C = d.columnCount, w = d.overscanCount, I = d.overscanRowCount, y = d.overscanRowsCount, R = d.rowCount, L = this.state, N = L.isScrolling, x = L.verticalScrollDirection, E = L.scrollTop, z = I || y || w || 1;
|
|
894
|
+
if (C === 0 || R === 0)
|
|
895
895
|
return [0, 0, 0, 0];
|
|
896
|
-
var k =
|
|
896
|
+
var k = u(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
897
|
return [Math.max(0, k - Z), Math.max(0, Math.min(R - 1, G + U)), k, G];
|
|
898
|
-
},
|
|
898
|
+
}, S;
|
|
899
899
|
}(zn), t.defaultProps = {
|
|
900
900
|
direction: "ltr",
|
|
901
901
|
itemData: void 0,
|
|
@@ -903,9 +903,9 @@ function Po(e) {
|
|
|
903
903
|
}, t;
|
|
904
904
|
}
|
|
905
905
|
var So = function(t, n) {
|
|
906
|
-
var r = t.children, o = t.direction, i = t.height, l = t.innerTagName, s = t.outerTagName, c = t.overscanColumnsCount,
|
|
906
|
+
var r = t.children, o = t.direction, i = t.height, l = t.innerTagName, s = t.outerTagName, c = t.overscanColumnsCount, p = t.overscanCount, h = t.overscanRowsCount, m = t.width, u = n.instance;
|
|
907
907
|
if (process.env.NODE_ENV !== "production") {
|
|
908
|
-
if (typeof
|
|
908
|
+
if (typeof p == "number" && Ee && !Ee.has(u) && (Ee.add(u), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof c == "number" || typeof h == "number") && Oe && !Oe.has(u) && (Oe.add(u), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || s != null) && De && !De.has(u) && (De.add(u), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
909
909
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
910
910
|
switch (o) {
|
|
911
911
|
case "ltr":
|
|
@@ -914,8 +914,8 @@ var So = function(t, n) {
|
|
|
914
914
|
default:
|
|
915
915
|
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + o + '" was specified.'));
|
|
916
916
|
}
|
|
917
|
-
if (typeof
|
|
918
|
-
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (
|
|
917
|
+
if (typeof m != "number")
|
|
918
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (m === null ? "null" : typeof m) + '" was specified.'));
|
|
919
919
|
if (typeof i != "number")
|
|
920
920
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (i === null ? "null" : typeof i) + '" was specified.'));
|
|
921
921
|
}
|
|
@@ -925,30 +925,30 @@ var So = function(t, n) {
|
|
|
925
925
|
var c = o[l];
|
|
926
926
|
s = c.offset + c.size;
|
|
927
927
|
}
|
|
928
|
-
var
|
|
929
|
-
return s +
|
|
928
|
+
var p = r - l - 1, h = p * i;
|
|
929
|
+
return s + h;
|
|
930
930
|
}, ln = function(t, n) {
|
|
931
931
|
var r = t.columnCount, o = n.columnMetadataMap, i = n.estimatedColumnWidth, l = n.lastMeasuredColumnIndex, s = 0;
|
|
932
932
|
if (l >= r && (l = r - 1), l >= 0) {
|
|
933
933
|
var c = o[l];
|
|
934
934
|
s = c.offset + c.size;
|
|
935
935
|
}
|
|
936
|
-
var
|
|
937
|
-
return s +
|
|
936
|
+
var p = r - l - 1, h = p * i;
|
|
937
|
+
return s + h;
|
|
938
938
|
}, ie = function(t, n, r, o) {
|
|
939
939
|
var i, l, s;
|
|
940
940
|
if (t === "column" ? (i = o.columnMetadataMap, l = n.columnWidth, s = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, l = n.rowHeight, s = o.lastMeasuredRowIndex), r > s) {
|
|
941
941
|
var c = 0;
|
|
942
942
|
if (s >= 0) {
|
|
943
|
-
var
|
|
944
|
-
c =
|
|
943
|
+
var p = i[s];
|
|
944
|
+
c = p.offset + p.size;
|
|
945
945
|
}
|
|
946
|
-
for (var
|
|
947
|
-
var
|
|
948
|
-
i[
|
|
946
|
+
for (var h = s + 1; h <= r; h++) {
|
|
947
|
+
var m = l(h);
|
|
948
|
+
i[h] = {
|
|
949
949
|
offset: c,
|
|
950
|
-
size:
|
|
951
|
-
}, c +=
|
|
950
|
+
size: m
|
|
951
|
+
}, c += m;
|
|
952
952
|
}
|
|
953
953
|
t === "column" ? o.lastMeasuredColumnIndex = r : o.lastMeasuredRowIndex = r;
|
|
954
954
|
}
|
|
@@ -971,17 +971,17 @@ var So = function(t, n) {
|
|
|
971
971
|
o += s, s *= 2;
|
|
972
972
|
return cn(t, n, r, Math.min(o, l - 1), Math.floor(o / 2), i);
|
|
973
973
|
}, kt = function(t, n, r, o, i, l, s) {
|
|
974
|
-
var c = t === "column" ? n.width : n.height,
|
|
975
|
-
switch (o === "smart" && (i >=
|
|
974
|
+
var c = t === "column" ? n.width : n.height, p = ie(t, n, r, l), h = t === "column" ? ln(n, l) : sn(n, l), m = Math.max(0, Math.min(h - c, p.offset)), u = Math.max(0, p.offset - c + s + p.size);
|
|
975
|
+
switch (o === "smart" && (i >= u - c && i <= m + c ? o = "auto" : o = "center"), o) {
|
|
976
976
|
case "start":
|
|
977
|
-
return
|
|
977
|
+
return m;
|
|
978
978
|
case "end":
|
|
979
|
-
return
|
|
979
|
+
return u;
|
|
980
980
|
case "center":
|
|
981
|
-
return Math.round(
|
|
981
|
+
return Math.round(u + (m - u) / 2);
|
|
982
982
|
case "auto":
|
|
983
983
|
default:
|
|
984
|
-
return i >=
|
|
984
|
+
return i >= u && i <= m ? i : u > m || i < u ? u : m;
|
|
985
985
|
}
|
|
986
986
|
}, Io = /* @__PURE__ */ Po({
|
|
987
987
|
getColumnOffset: function(t, n, r) {
|
|
@@ -991,9 +991,9 @@ var So = function(t, n) {
|
|
|
991
991
|
return Ft("column", t, r, n);
|
|
992
992
|
},
|
|
993
993
|
getColumnStopIndexForStartIndex: function(t, n, r, o) {
|
|
994
|
-
for (var i = t.columnCount, l = t.width, s = ie("column", t, n, o), c = r + l,
|
|
995
|
-
|
|
996
|
-
return
|
|
994
|
+
for (var i = t.columnCount, l = t.width, s = ie("column", t, n, o), c = r + l, p = s.offset + s.size, h = n; h < i - 1 && p < c; )
|
|
995
|
+
h++, p += ie("column", t, h, o).size;
|
|
996
|
+
return h;
|
|
997
997
|
},
|
|
998
998
|
getColumnWidth: function(t, n, r) {
|
|
999
999
|
return r.columnMetadataMap[n].size;
|
|
@@ -1016,9 +1016,9 @@ var So = function(t, n) {
|
|
|
1016
1016
|
return Ft("row", t, r, n);
|
|
1017
1017
|
},
|
|
1018
1018
|
getRowStopIndexForStartIndex: function(t, n, r, o) {
|
|
1019
|
-
for (var i = t.rowCount, l = t.height, s = ie("row", t, n, o), c = r + l,
|
|
1020
|
-
|
|
1021
|
-
return
|
|
1019
|
+
for (var i = t.rowCount, l = t.height, s = ie("row", t, n, o), c = r + l, p = s.offset + s.size, h = n; h < i - 1 && p < c; )
|
|
1020
|
+
h++, p += ie("row", t, h, o).size;
|
|
1021
|
+
return h;
|
|
1022
1022
|
},
|
|
1023
1023
|
initInstanceProps: function(t, n) {
|
|
1024
1024
|
var r = t, o = r.estimatedColumnWidth, i = r.estimatedRowHeight, l = {
|
|
@@ -1040,8 +1040,8 @@ var So = function(t, n) {
|
|
|
1040
1040
|
shouldForceUpdate: c
|
|
1041
1041
|
});
|
|
1042
1042
|
}, n.resetAfterIndices = function(s) {
|
|
1043
|
-
var c = s.columnIndex,
|
|
1044
|
-
typeof c == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, c - 1)), typeof
|
|
1043
|
+
var c = s.columnIndex, p = s.rowIndex, h = s.shouldForceUpdate, m = h === void 0 ? !0 : h;
|
|
1044
|
+
typeof c == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, c - 1)), typeof p == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, p - 1)), n._getItemStyleCache(-1), m && n.forceUpdate();
|
|
1045
1045
|
}, l;
|
|
1046
1046
|
},
|
|
1047
1047
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
@@ -1077,19 +1077,19 @@ const Mo = () => {
|
|
|
1077
1077
|
), l = M(
|
|
1078
1078
|
(f) => o.heights[f] || 0,
|
|
1079
1079
|
[o]
|
|
1080
|
-
), s = D(() => o.heights.length, [o]), c = D(() => Math.max(...o.widths), [o]),
|
|
1080
|
+
), s = D(() => o.heights.length, [o]), c = D(() => Math.max(...o.widths), [o]), p = D(() => t === Q.HORIZONTAL_SCROLLING ? s : e === ze.DUAL_PAGE ? 2 : 1, [e, t, t, s, r, c]);
|
|
1081
1081
|
A(() => {
|
|
1082
|
-
n(
|
|
1083
|
-
}, [
|
|
1084
|
-
const
|
|
1082
|
+
n(p);
|
|
1083
|
+
}, [p, n]);
|
|
1084
|
+
const h = D(() => t === Q.HORIZONTAL_SCROLLING || t === Q.PAGE_SCROLLING ? 1 : Math.round(s / p), [p, s, t]), m = D(() => o.heights.reduce((f, v) => f + v, 0) / o.heights.length || 0, [o]), u = D(() => o.widths.reduce((f, v) => f + v, 0) / o.heights.length || 0, [o]);
|
|
1085
1085
|
return {
|
|
1086
|
-
rowCount:
|
|
1086
|
+
rowCount: h,
|
|
1087
1087
|
rowHeight: l,
|
|
1088
|
-
columnCount:
|
|
1088
|
+
columnCount: p,
|
|
1089
1089
|
columnWidth: i,
|
|
1090
1090
|
pageDimension: o,
|
|
1091
|
-
estimatedRowHeight:
|
|
1092
|
-
estimatedColumnWidth:
|
|
1091
|
+
estimatedRowHeight: m,
|
|
1092
|
+
estimatedColumnWidth: u
|
|
1093
1093
|
};
|
|
1094
1094
|
};
|
|
1095
1095
|
let J;
|
|
@@ -1112,68 +1112,68 @@ function Lo(e) {
|
|
|
1112
1112
|
let t, n, r, o, i, l, s;
|
|
1113
1113
|
const c = typeof document < "u" && document.attachEvent;
|
|
1114
1114
|
if (!c) {
|
|
1115
|
-
l = function(
|
|
1116
|
-
const
|
|
1117
|
-
|
|
1118
|
-
}, i = function(
|
|
1119
|
-
return
|
|
1120
|
-
}, s = function(
|
|
1121
|
-
if (
|
|
1115
|
+
l = function(b) {
|
|
1116
|
+
const S = b.__resizeTriggers__, P = S.firstElementChild, T = S.lastElementChild, d = P.firstElementChild;
|
|
1117
|
+
T.scrollLeft = T.scrollWidth, T.scrollTop = T.scrollHeight, d.style.width = P.offsetWidth + 1 + "px", d.style.height = P.offsetHeight + 1 + "px", P.scrollLeft = P.scrollWidth, P.scrollTop = P.scrollHeight;
|
|
1118
|
+
}, i = function(b) {
|
|
1119
|
+
return b.offsetWidth !== b.__resizeLast__.width || b.offsetHeight !== b.__resizeLast__.height;
|
|
1120
|
+
}, s = function(b) {
|
|
1121
|
+
if (b.target.className && typeof b.target.className.indexOf == "function" && b.target.className.indexOf("contract-trigger") < 0 && b.target.className.indexOf("expand-trigger") < 0)
|
|
1122
1122
|
return;
|
|
1123
|
-
const
|
|
1123
|
+
const S = this;
|
|
1124
1124
|
l(this), this.__resizeRAF__ && ut(this.__resizeRAF__), this.__resizeRAF__ = dt(function() {
|
|
1125
|
-
i(
|
|
1126
|
-
|
|
1125
|
+
i(S) && (S.__resizeLast__.width = S.offsetWidth, S.__resizeLast__.height = S.offsetHeight, S.__resizeListeners__.forEach(function(d) {
|
|
1126
|
+
d.call(S, b);
|
|
1127
1127
|
}));
|
|
1128
1128
|
});
|
|
1129
1129
|
};
|
|
1130
|
-
let
|
|
1130
|
+
let u = !1, f = "";
|
|
1131
1131
|
r = "animationstart";
|
|
1132
1132
|
const v = "Webkit Moz O ms".split(" ");
|
|
1133
|
-
let _ = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),
|
|
1133
|
+
let _ = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), g = "";
|
|
1134
1134
|
{
|
|
1135
|
-
const
|
|
1136
|
-
if (
|
|
1137
|
-
for (let
|
|
1138
|
-
if (
|
|
1139
|
-
|
|
1135
|
+
const b = document.createElement("fakeelement");
|
|
1136
|
+
if (b.style.animationName !== void 0 && (u = !0), u === !1) {
|
|
1137
|
+
for (let S = 0; S < v.length; S++)
|
|
1138
|
+
if (b.style[v[S] + "AnimationName"] !== void 0) {
|
|
1139
|
+
g = v[S], f = "-" + g.toLowerCase() + "-", r = _[S], u = !0;
|
|
1140
1140
|
break;
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
n = "resizeanim", t = "@" + f + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", o = f + "animation: 1ms " + n + "; ";
|
|
1145
1145
|
}
|
|
1146
|
-
const
|
|
1147
|
-
if (!
|
|
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 =
|
|
1149
|
-
_.id = "detectElementResize", _.type = "text/css", e != null && _.setAttribute("nonce", e), _.styleSheet ? _.styleSheet.cssText = f : _.appendChild(
|
|
1146
|
+
const p = function(u) {
|
|
1147
|
+
if (!u.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 = u.head || u.getElementsByTagName("head")[0], _ = u.createElement("style");
|
|
1149
|
+
_.id = "detectElementResize", _.type = "text/css", e != null && _.setAttribute("nonce", e), _.styleSheet ? _.styleSheet.cssText = f : _.appendChild(u.createTextNode(f)), v.appendChild(_);
|
|
1150
1150
|
}
|
|
1151
1151
|
};
|
|
1152
1152
|
return {
|
|
1153
|
-
addResizeListener: function(
|
|
1153
|
+
addResizeListener: function(u, f) {
|
|
1154
1154
|
if (c)
|
|
1155
|
-
|
|
1155
|
+
u.attachEvent("onresize", f);
|
|
1156
1156
|
else {
|
|
1157
|
-
if (!
|
|
1158
|
-
const v =
|
|
1159
|
-
_ && _.position === "static" && (
|
|
1160
|
-
const
|
|
1161
|
-
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
},
|
|
1157
|
+
if (!u.__resizeTriggers__) {
|
|
1158
|
+
const v = u.ownerDocument, _ = J.getComputedStyle(u);
|
|
1159
|
+
_ && _.position === "static" && (u.style.position = "relative"), p(v), u.__resizeLast__ = {}, u.__resizeListeners__ = [], (u.__resizeTriggers__ = v.createElement("div")).className = "resize-triggers";
|
|
1160
|
+
const g = v.createElement("div");
|
|
1161
|
+
g.className = "expand-trigger", g.appendChild(v.createElement("div"));
|
|
1162
|
+
const b = v.createElement("div");
|
|
1163
|
+
b.className = "contract-trigger", u.__resizeTriggers__.appendChild(g), u.__resizeTriggers__.appendChild(b), u.appendChild(u.__resizeTriggers__), l(u), u.addEventListener("scroll", s, !0), r && (u.__resizeTriggers__.__animationListener__ = function(P) {
|
|
1164
|
+
P.animationName === n && l(u);
|
|
1165
|
+
}, u.__resizeTriggers__.addEventListener(r, u.__resizeTriggers__.__animationListener__));
|
|
1166
1166
|
}
|
|
1167
|
-
|
|
1167
|
+
u.__resizeListeners__.push(f);
|
|
1168
1168
|
}
|
|
1169
1169
|
},
|
|
1170
|
-
removeResizeListener: function(
|
|
1170
|
+
removeResizeListener: function(u, f) {
|
|
1171
1171
|
if (c)
|
|
1172
|
-
|
|
1173
|
-
else if (
|
|
1174
|
-
|
|
1172
|
+
u.detachEvent("onresize", f);
|
|
1173
|
+
else if (u.__resizeListeners__.splice(u.__resizeListeners__.indexOf(f), 1), !u.__resizeListeners__.length) {
|
|
1174
|
+
u.removeEventListener("scroll", s, !0), u.__resizeTriggers__.__animationListener__ && (u.__resizeTriggers__.removeEventListener(r, u.__resizeTriggers__.__animationListener__), u.__resizeTriggers__.__animationListener__ = null);
|
|
1175
1175
|
try {
|
|
1176
|
-
|
|
1176
|
+
u.__resizeTriggers__ = !u.removeChild(u.__resizeTriggers__);
|
|
1177
1177
|
} catch {
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
@@ -1195,16 +1195,16 @@ class No extends Fn {
|
|
|
1195
1195
|
onResize: o
|
|
1196
1196
|
} = this.props;
|
|
1197
1197
|
if (this._parentNode) {
|
|
1198
|
-
const i = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(i.paddingLeft || "0"), s = parseFloat(i.paddingRight || "0"), c = parseFloat(i.paddingTop || "0"),
|
|
1199
|
-
(!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"), p = parseFloat(i.paddingBottom || "0"), h = this._parentNode.getBoundingClientRect(), m = h.height - c - p, u = h.width - l - s, f = this._parentNode.offsetHeight - c - p, v = this._parentNode.offsetWidth - l - s;
|
|
1199
|
+
(!n && (this.state.height !== f || this.state.scaledHeight !== m) || !r && (this.state.width !== v || this.state.scaledWidth !== u)) && (this.setState({
|
|
1200
1200
|
height: f,
|
|
1201
1201
|
width: v,
|
|
1202
|
-
scaledHeight:
|
|
1203
|
-
scaledWidth:
|
|
1202
|
+
scaledHeight: m,
|
|
1203
|
+
scaledWidth: u
|
|
1204
1204
|
}), typeof o == "function" && o({
|
|
1205
1205
|
height: f,
|
|
1206
|
-
scaledHeight:
|
|
1207
|
-
scaledWidth:
|
|
1206
|
+
scaledHeight: m,
|
|
1207
|
+
scaledWidth: u,
|
|
1208
1208
|
width: v
|
|
1209
1209
|
}));
|
|
1210
1210
|
}
|
|
@@ -1237,54 +1237,54 @@ class No extends Fn {
|
|
|
1237
1237
|
doNotBailOutOnEmptyChildren: l = !1,
|
|
1238
1238
|
nonce: s,
|
|
1239
1239
|
onResize: c,
|
|
1240
|
-
style:
|
|
1241
|
-
tagName:
|
|
1242
|
-
...
|
|
1240
|
+
style: p = {},
|
|
1241
|
+
tagName: h = "div",
|
|
1242
|
+
...m
|
|
1243
1243
|
} = this.props, {
|
|
1244
|
-
height:
|
|
1244
|
+
height: u,
|
|
1245
1245
|
scaledHeight: f,
|
|
1246
1246
|
scaledWidth: v,
|
|
1247
1247
|
width: _
|
|
1248
|
-
} = this.state,
|
|
1248
|
+
} = this.state, g = {
|
|
1249
1249
|
overflow: "visible"
|
|
1250
|
-
},
|
|
1251
|
-
let
|
|
1252
|
-
return o || (
|
|
1250
|
+
}, b = {};
|
|
1251
|
+
let S = !1;
|
|
1252
|
+
return o || (u === 0 && (S = !0), g.height = 0, b.height = u, b.scaledHeight = f), i || (_ === 0 && (S = !0), g.width = 0, b.width = _, b.scaledWidth = v), l && (S = !1), Ne(h, {
|
|
1253
1253
|
ref: this._setRef,
|
|
1254
1254
|
style: {
|
|
1255
|
-
...
|
|
1256
|
-
...
|
|
1255
|
+
...g,
|
|
1256
|
+
...p
|
|
1257
1257
|
},
|
|
1258
|
-
...
|
|
1259
|
-
}, !
|
|
1258
|
+
...m
|
|
1259
|
+
}, !S && t(b));
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
1262
|
const Eo = (e = 1) => {
|
|
1263
|
-
const [t, n] = F(e), [r, o] = F(0), { scrollToPage: i } = _t(), l = $(1), { isScrolling: s } = Kt(), { viewMode: c } = Ge(), { scrollMode:
|
|
1264
|
-
(
|
|
1265
|
-
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: p } = Pe(), h = yr(t, 100), m = M(
|
|
1264
|
+
(g) => {
|
|
1265
|
+
if (!/^[0-9]*$/g.test(g.toString()) || !g)
|
|
1266
1266
|
return { success: !1, currentPage: l.current };
|
|
1267
|
-
const
|
|
1268
|
-
return
|
|
1267
|
+
const S = +g;
|
|
1268
|
+
return S < 0 || S > r ? { success: !1, currentPage: l.current } : (n(S), l.current = S, { success: !0, currentPage: +g });
|
|
1269
1269
|
},
|
|
1270
1270
|
[r]
|
|
1271
|
-
),
|
|
1272
|
-
(
|
|
1273
|
-
const
|
|
1274
|
-
return
|
|
1271
|
+
), u = M(m, [m]), f = M(
|
|
1272
|
+
(g) => {
|
|
1273
|
+
const b = m(g);
|
|
1274
|
+
return b.success && (s.current = !0, i(b.currentPage)), b;
|
|
1275
1275
|
},
|
|
1276
|
-
[
|
|
1276
|
+
[m, i]
|
|
1277
1277
|
), v = M(() => {
|
|
1278
|
-
let
|
|
1279
|
-
f(
|
|
1280
|
-
}, [f, t, c,
|
|
1281
|
-
let
|
|
1282
|
-
f(
|
|
1283
|
-
}, [f, t, c,
|
|
1278
|
+
let g = t - 1;
|
|
1279
|
+
f(g);
|
|
1280
|
+
}, [f, t, c, p]), _ = M(() => {
|
|
1281
|
+
let g = t + 1;
|
|
1282
|
+
f(g);
|
|
1283
|
+
}, [f, t, c, p]);
|
|
1284
1284
|
return {
|
|
1285
|
-
focusedPage:
|
|
1285
|
+
focusedPage: h,
|
|
1286
1286
|
totalPages: r,
|
|
1287
|
-
setFocusedPage:
|
|
1287
|
+
setFocusedPage: u,
|
|
1288
1288
|
setTotalPages: o,
|
|
1289
1289
|
nextPage: _,
|
|
1290
1290
|
prevPage: v,
|
|
@@ -1306,7 +1306,7 @@ const Eo = (e = 1) => {
|
|
|
1306
1306
|
const e = He(un);
|
|
1307
1307
|
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Rr.error("Please use this hooks inside children component of RPController or RPLayout"), e;
|
|
1308
1308
|
}, Oo = ({ children: e }) => {
|
|
1309
|
-
const { initialPage: t = 1 } = gr(), { pdf: n } = Y(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: l, goToPage: s, nextPage: c, prevPage:
|
|
1309
|
+
const { initialPage: t = 1 } = gr(), { pdf: n } = Y(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: l, goToPage: s, nextPage: c, prevPage: p } = Eo(t);
|
|
1310
1310
|
return A(() => {
|
|
1311
1311
|
n != null && n.numPages && l(n.numPages);
|
|
1312
1312
|
}, [n, l, o, t]), A(() => {
|
|
@@ -1322,7 +1322,7 @@ const Eo = (e = 1) => {
|
|
|
1322
1322
|
setFocusedPage: i,
|
|
1323
1323
|
setTotalPages: l,
|
|
1324
1324
|
nextPage: c,
|
|
1325
|
-
prevPage:
|
|
1325
|
+
prevPage: p,
|
|
1326
1326
|
goToPage: s
|
|
1327
1327
|
},
|
|
1328
1328
|
children: e
|
|
@@ -1332,8 +1332,8 @@ const Eo = (e = 1) => {
|
|
|
1332
1332
|
const { focusedPage: n, totalPages: r } = ee(), o = D(() => {
|
|
1333
1333
|
const s = [], c = Math.ceil(n / 2) * 2 - 1;
|
|
1334
1334
|
if (s.push(c), c + 1 < r) {
|
|
1335
|
-
const
|
|
1336
|
-
s.push(
|
|
1335
|
+
const p = c + 1;
|
|
1336
|
+
s.push(p);
|
|
1337
1337
|
}
|
|
1338
1338
|
return s;
|
|
1339
1339
|
}, [n, r]), i = D(() => [
|
|
@@ -1387,18 +1387,18 @@ const Eo = (e = 1) => {
|
|
|
1387
1387
|
getVirtualScrollableElementRef: l,
|
|
1388
1388
|
setTotalInnerDimensions: s,
|
|
1389
1389
|
totalInnerDimensions: c
|
|
1390
|
-
} = Ue(), { nextPage:
|
|
1390
|
+
} = Ue(), { nextPage: p, prevPage: h, setFocusedPage: m, focusedPage: u } = ee(), { scrollMode: f } = Pe(), { viewMode: v } = Ge(), _ = $(null), g = $({
|
|
1391
1391
|
height: 0,
|
|
1392
1392
|
width: 0
|
|
1393
|
-
}),
|
|
1393
|
+
}), b = $({
|
|
1394
1394
|
viewMode: v,
|
|
1395
1395
|
scrollMode: f
|
|
1396
|
-
}), { isFullScreen:
|
|
1397
|
-
pageDimension:
|
|
1398
|
-
rowCount:
|
|
1399
|
-
rowHeight:
|
|
1400
|
-
columnCount:
|
|
1401
|
-
columnWidth:
|
|
1396
|
+
}), { isFullScreen: S } = _r(), {
|
|
1397
|
+
pageDimension: P,
|
|
1398
|
+
rowCount: T,
|
|
1399
|
+
rowHeight: d,
|
|
1400
|
+
columnCount: C,
|
|
1401
|
+
columnWidth: w,
|
|
1402
1402
|
estimatedColumnWidth: I,
|
|
1403
1403
|
estimatedRowHeight: y
|
|
1404
1404
|
} = Mo(), [R, L] = F({}), { isScrolling: N } = Kt(), x = $(), E = $({
|
|
@@ -1409,14 +1409,14 @@ const Eo = (e = 1) => {
|
|
|
1409
1409
|
}), U = D(() => k === jt.HAND, [k]), K = M((W, H) => {
|
|
1410
1410
|
L((q) => ({ ...q, [W]: Math.round(H * 100) }));
|
|
1411
1411
|
}, []), ue = D(() => ({
|
|
1412
|
-
columnCount:
|
|
1412
|
+
columnCount: C,
|
|
1413
1413
|
handleIntersectRatioChange: K
|
|
1414
|
-
}), [
|
|
1414
|
+
}), [C, K]), oe = M(
|
|
1415
1415
|
(W) => {
|
|
1416
1416
|
const H = document.activeElement !== t;
|
|
1417
|
-
!
|
|
1417
|
+
!S && H || (["ArrowUp", "ArrowLeft"].includes(W.key) ? (W.preventDefault(), h()) : ["ArrowDown", "ArrowRight"].includes(W.key) && (W.preventDefault(), p()));
|
|
1418
1418
|
},
|
|
1419
|
-
[
|
|
1419
|
+
[p, h, S, f]
|
|
1420
1420
|
), ve = M((W) => {
|
|
1421
1421
|
E.current = {
|
|
1422
1422
|
scrollTop: W.scrollTop,
|
|
@@ -1427,40 +1427,40 @@ const Eo = (e = 1) => {
|
|
|
1427
1427
|
window.removeEventListener("keydown", oe);
|
|
1428
1428
|
}), [oe]), A(() => {
|
|
1429
1429
|
if (_.current && (_.current.style.position = "relative"), !!r) {
|
|
1430
|
-
|
|
1431
|
-
height: Array.from({ length:
|
|
1432
|
-
(W, H, q) => W +
|
|
1430
|
+
g.current = c, s({
|
|
1431
|
+
height: Array.from({ length: T }).reduce(
|
|
1432
|
+
(W, H, q) => W + d(q),
|
|
1433
1433
|
0
|
|
1434
1434
|
),
|
|
1435
|
-
width: Array.from({ length:
|
|
1436
|
-
(W, H, q) => W +
|
|
1435
|
+
width: Array.from({ length: C }).reduce(
|
|
1436
|
+
(W, H, q) => W + w(q),
|
|
1437
1437
|
0
|
|
1438
1438
|
)
|
|
1439
1439
|
});
|
|
1440
|
-
for (let W = 0; W <
|
|
1441
|
-
for (let H = 0; H <
|
|
1440
|
+
for (let W = 0; W < T; W++)
|
|
1441
|
+
for (let H = 0; H < C; H++)
|
|
1442
1442
|
r.resetAfterIndices({
|
|
1443
1443
|
columnIndex: H,
|
|
1444
1444
|
rowIndex: W,
|
|
1445
1445
|
shouldForceUpdate: !0
|
|
1446
1446
|
});
|
|
1447
1447
|
}
|
|
1448
|
-
}, [
|
|
1448
|
+
}, [T, C, P, r, n]), A(() => {
|
|
1449
1449
|
if (N.current)
|
|
1450
1450
|
return;
|
|
1451
|
-
if (
|
|
1452
|
-
x.current && clearTimeout(x.current), L({}), n(
|
|
1451
|
+
if (b.current.viewMode !== v || b.current.scrollMode !== f) {
|
|
1452
|
+
x.current && clearTimeout(x.current), L({}), n(u), f === Q.HORIZONTAL_SCROLLING && (r == null || r.scrollTo({
|
|
1453
1453
|
scrollTop: 0
|
|
1454
1454
|
})), x.current = setTimeout(() => {
|
|
1455
1455
|
requestAnimationFrame(() => {
|
|
1456
|
-
|
|
1456
|
+
b.current = { viewMode: v, scrollMode: f };
|
|
1457
1457
|
});
|
|
1458
1458
|
}, 100);
|
|
1459
1459
|
return;
|
|
1460
1460
|
}
|
|
1461
1461
|
const H = E.current.scrollTop, q = E.current.scrollLeft;
|
|
1462
1462
|
if (c.height !== 0 && c.width !== 0) {
|
|
1463
|
-
const { height: le, width: Te } = c, { height: de, width: pe } =
|
|
1463
|
+
const { height: le, width: Te } = c, { height: de, width: pe } = g.current, Ze = H / de * le, je = q / pe * Te, Dn = Math.min(Ze, le) || 0, An = Math.min(je, Te) || 0;
|
|
1464
1464
|
r == null || r.scrollTo({
|
|
1465
1465
|
scrollTop: Dn,
|
|
1466
1466
|
scrollLeft: An
|
|
@@ -1475,8 +1475,8 @@ const Eo = (e = 1) => {
|
|
|
1475
1475
|
let H = 0, q = -1;
|
|
1476
1476
|
W.forEach((le) => {
|
|
1477
1477
|
q < le[1] && (H = Number(le[0]), q = le[1]);
|
|
1478
|
-
}), H &&
|
|
1479
|
-
}, [R,
|
|
1478
|
+
}), H && m(H);
|
|
1479
|
+
}, [R, m]), A(() => () => {
|
|
1480
1480
|
x.current && clearTimeout(x.current);
|
|
1481
1481
|
}, []);
|
|
1482
1482
|
const _e = D(() => j(ae["rp-pages-container"], {
|
|
@@ -1503,7 +1503,7 @@ const Eo = (e = 1) => {
|
|
|
1503
1503
|
ref: i,
|
|
1504
1504
|
style: { width: W, height: H },
|
|
1505
1505
|
className: j(ae["rp-pages"], ae["rp-page-scrolling-wrapper"]),
|
|
1506
|
-
children: v === ze.DUAL_PAGE ? /* @__PURE__ */ a(Do, { widths:
|
|
1506
|
+
children: v === ze.DUAL_PAGE ? /* @__PURE__ */ a(Do, { widths: w, heights: d }) : /* @__PURE__ */ a(Ao, { widths: w, heights: d })
|
|
1507
1507
|
}
|
|
1508
1508
|
) : I ? /* @__PURE__ */ a(
|
|
1509
1509
|
Io,
|
|
@@ -1513,14 +1513,14 @@ const Eo = (e = 1) => {
|
|
|
1513
1513
|
outerRef: l,
|
|
1514
1514
|
innerRef: _,
|
|
1515
1515
|
onScroll: ve,
|
|
1516
|
-
columnCount:
|
|
1517
|
-
columnWidth:
|
|
1518
|
-
rowHeight:
|
|
1516
|
+
columnCount: C,
|
|
1517
|
+
columnWidth: w,
|
|
1518
|
+
rowHeight: d,
|
|
1519
1519
|
height: H,
|
|
1520
1520
|
width: W,
|
|
1521
1521
|
estimatedColumnWidth: I,
|
|
1522
1522
|
estimatedRowHeight: y,
|
|
1523
|
-
rowCount:
|
|
1523
|
+
rowCount: T,
|
|
1524
1524
|
className: j(
|
|
1525
1525
|
ae["rp-pages"],
|
|
1526
1526
|
f === Q.HORIZONTAL_SCROLLING ? ae["rp-pages-horizontal-scroll"] : ""
|
|
@@ -1548,23 +1548,23 @@ const Eo = (e = 1) => {
|
|
|
1548
1548
|
const { nextIcon: e } = re();
|
|
1549
1549
|
return e || /* @__PURE__ */ a(Me, { style: { transform: "rotate(180deg" } });
|
|
1550
1550
|
}, Wo = () => {
|
|
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:
|
|
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: p } = ge();
|
|
1552
1552
|
A(() => {
|
|
1553
1553
|
s(e.toString());
|
|
1554
1554
|
}, [e]);
|
|
1555
|
-
const
|
|
1555
|
+
const h = M((v) => {
|
|
1556
1556
|
const _ = v.target.value;
|
|
1557
1557
|
s(_);
|
|
1558
|
-
}, []),
|
|
1558
|
+
}, []), m = M(() => {
|
|
1559
1559
|
const v = i(l);
|
|
1560
1560
|
v.success || s(v.currentPage.toString());
|
|
1561
|
-
}, [i, l, t]),
|
|
1561
|
+
}, [i, l, t]), u = M(() => {
|
|
1562
1562
|
s(e.toString());
|
|
1563
1563
|
}, [e]), f = M(
|
|
1564
1564
|
(v) => {
|
|
1565
|
-
v.key === "Enter" &&
|
|
1565
|
+
v.key === "Enter" && m();
|
|
1566
1566
|
},
|
|
1567
|
-
[
|
|
1567
|
+
[m]
|
|
1568
1568
|
);
|
|
1569
1569
|
return typeof c != "boolean" ? /* @__PURE__ */ a(
|
|
1570
1570
|
c,
|
|
@@ -1577,13 +1577,13 @@ const Eo = (e = 1) => {
|
|
|
1577
1577
|
changePage: n
|
|
1578
1578
|
}
|
|
1579
1579
|
) : c ? /* @__PURE__ */ O("div", { className: tt["rp-paginate"], children: [
|
|
1580
|
-
!
|
|
1580
|
+
!p && /* @__PURE__ */ a(X, { content: "Previous page", children: /* @__PURE__ */ a(B, { onClick: o, disabled: e === 1, children: /* @__PURE__ */ a(Fo, {}) }) }),
|
|
1581
1581
|
/* @__PURE__ */ a(
|
|
1582
1582
|
Zt,
|
|
1583
1583
|
{
|
|
1584
1584
|
onKeyDown: f,
|
|
1585
|
-
onBlur:
|
|
1586
|
-
onChange:
|
|
1585
|
+
onBlur: u,
|
|
1586
|
+
onChange: h,
|
|
1587
1587
|
value: l,
|
|
1588
1588
|
className: tt["rp-page-input"]
|
|
1589
1589
|
}
|
|
@@ -1592,7 +1592,7 @@ const Eo = (e = 1) => {
|
|
|
1592
1592
|
"/",
|
|
1593
1593
|
t
|
|
1594
1594
|
] }),
|
|
1595
|
-
!
|
|
1595
|
+
!p && /* @__PURE__ */ a(X, { content: "Next page", children: /* @__PURE__ */ a(B, { onClick: r, disabled: e === t, children: /* @__PURE__ */ a(ko, {}) }) })
|
|
1596
1596
|
] }) : null;
|
|
1597
1597
|
};
|
|
1598
1598
|
var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, te] = dn(bt), pn = (e) => {
|
|
@@ -1603,7 +1603,7 @@ var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, te] = dn(bt), pn = (e) => {
|
|
|
1603
1603
|
defaultOpen: o,
|
|
1604
1604
|
onOpenChange: i,
|
|
1605
1605
|
modal: l = !0
|
|
1606
|
-
} = e, s = V.useRef(null), c = V.useRef(null), [
|
|
1606
|
+
} = e, s = V.useRef(null), c = V.useRef(null), [p = !1, h] = kr({
|
|
1607
1607
|
prop: r,
|
|
1608
1608
|
defaultProp: o,
|
|
1609
1609
|
onChange: i
|
|
@@ -1617,9 +1617,9 @@ var bt = "Dialog", [dn, ts] = Lr(bt), [Ho, te] = dn(bt), pn = (e) => {
|
|
|
1617
1617
|
contentId: Be(),
|
|
1618
1618
|
titleId: Be(),
|
|
1619
1619
|
descriptionId: Be(),
|
|
1620
|
-
open:
|
|
1621
|
-
onOpenChange:
|
|
1622
|
-
onOpenToggle: V.useCallback(() =>
|
|
1620
|
+
open: p,
|
|
1621
|
+
onOpenChange: h,
|
|
1622
|
+
onOpenToggle: V.useCallback(() => h((m) => !m), [h]),
|
|
1623
1623
|
modal: l,
|
|
1624
1624
|
children: n
|
|
1625
1625
|
}
|
|
@@ -1727,17 +1727,17 @@ var Uo = V.forwardRef(
|
|
|
1727
1727
|
(l = e.onCloseAutoFocus) == null || l.call(e, i), i.defaultPrevented || (r.current || (s = n.triggerRef.current) == null || s.focus(), i.preventDefault()), r.current = !1, o.current = !1;
|
|
1728
1728
|
},
|
|
1729
1729
|
onInteractOutside: (i) => {
|
|
1730
|
-
var c,
|
|
1730
|
+
var c, p;
|
|
1731
1731
|
(c = e.onInteractOutside) == null || c.call(e, i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
1732
1732
|
const l = i.target;
|
|
1733
|
-
((
|
|
1733
|
+
((p = n.triggerRef.current) == null ? void 0 : p.contains(l)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
1736
|
);
|
|
1737
1737
|
}
|
|
1738
1738
|
), _n = V.forwardRef(
|
|
1739
1739
|
(e, t) => {
|
|
1740
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...l } = e, s = te(me, n), c = V.useRef(null),
|
|
1740
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...l } = e, s = te(me, n), c = V.useRef(null), p = mt(t, c);
|
|
1741
1741
|
return Dr(), /* @__PURE__ */ O(Ae, { children: [
|
|
1742
1742
|
/* @__PURE__ */ a(
|
|
1743
1743
|
Ar,
|
|
@@ -1756,7 +1756,7 @@ var Uo = V.forwardRef(
|
|
|
1756
1756
|
"aria-labelledby": s.titleId,
|
|
1757
1757
|
"data-state": St(s.open),
|
|
1758
1758
|
...l,
|
|
1759
|
-
ref:
|
|
1759
|
+
ref: p,
|
|
1760
1760
|
onDismiss: () => s.onOpenChange(!1)
|
|
1761
1761
|
}
|
|
1762
1762
|
)
|
|
@@ -1838,14 +1838,14 @@ const fe = {
|
|
|
1838
1838
|
filename: l,
|
|
1839
1839
|
title: s,
|
|
1840
1840
|
author: c,
|
|
1841
|
-
subject:
|
|
1842
|
-
createdOn:
|
|
1843
|
-
creator:
|
|
1844
|
-
keywords:
|
|
1841
|
+
subject: p,
|
|
1842
|
+
createdOn: h,
|
|
1843
|
+
creator: m,
|
|
1844
|
+
keywords: u,
|
|
1845
1845
|
modifierOn: f,
|
|
1846
1846
|
pdfProducer: v,
|
|
1847
1847
|
pdfVersion: _,
|
|
1848
|
-
pageCount:
|
|
1848
|
+
pageCount: g
|
|
1849
1849
|
} = e;
|
|
1850
1850
|
return [
|
|
1851
1851
|
{ label: "File name", value: l },
|
|
@@ -1853,12 +1853,12 @@ const fe = {
|
|
|
1853
1853
|
{ separate: !0 },
|
|
1854
1854
|
{ label: "Title", value: s },
|
|
1855
1855
|
{ label: "Author", value: c },
|
|
1856
|
-
{ label: "Subject", value:
|
|
1857
|
-
{ label: "Keywords", value:
|
|
1858
|
-
{ label: "Creator", value:
|
|
1856
|
+
{ label: "Subject", value: p },
|
|
1857
|
+
{ label: "Keywords", value: u },
|
|
1858
|
+
{ label: "Creator", value: m },
|
|
1859
1859
|
{
|
|
1860
1860
|
label: "Created on",
|
|
1861
|
-
value:
|
|
1861
|
+
value: h ? it(h) : ""
|
|
1862
1862
|
},
|
|
1863
1863
|
{
|
|
1864
1864
|
label: "Modified on",
|
|
@@ -1867,7 +1867,7 @@ const fe = {
|
|
|
1867
1867
|
{ separate: !0 },
|
|
1868
1868
|
{ label: "PDF producer", value: v },
|
|
1869
1869
|
{ label: "PDF version", value: _ },
|
|
1870
|
-
{ label: "Page count", value:
|
|
1870
|
+
{ label: "Page count", value: g }
|
|
1871
1871
|
];
|
|
1872
1872
|
}, [e]);
|
|
1873
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: [
|
|
@@ -1903,51 +1903,51 @@ const sa = () => {
|
|
|
1903
1903
|
loadedPages: 0,
|
|
1904
1904
|
totalPages: 0,
|
|
1905
1905
|
percentage: 0
|
|
1906
|
-
}), [o, i] = F(!1), [l, s] = F(!1), [c,
|
|
1906
|
+
}), [o, i] = F(!1), [l, s] = F(!1), [c, p] = F(null), h = $(!1);
|
|
1907
1907
|
A(() => {
|
|
1908
|
-
|
|
1909
|
-
}, [
|
|
1910
|
-
const
|
|
1908
|
+
h.current;
|
|
1909
|
+
}, [h]);
|
|
1910
|
+
const m = M(() => {
|
|
1911
1911
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
1912
|
-
const
|
|
1913
|
-
|
|
1914
|
-
}, []),
|
|
1915
|
-
|
|
1912
|
+
const P = document.querySelector(".rp-print-zone");
|
|
1913
|
+
P && P.remove();
|
|
1914
|
+
}, []), u = M(() => {
|
|
1915
|
+
h.current = !1, i(!1), s(!1), p(null), r({
|
|
1916
1916
|
loadedPages: 0,
|
|
1917
1917
|
totalPages: 0,
|
|
1918
1918
|
percentage: 0
|
|
1919
1919
|
});
|
|
1920
1920
|
}, []), f = () => {
|
|
1921
|
-
|
|
1921
|
+
h.current = !0;
|
|
1922
1922
|
}, v = async ({
|
|
1923
|
-
scratchCanvas:
|
|
1924
|
-
pdfDocument:
|
|
1925
|
-
pageNumber:
|
|
1926
|
-
viewerPdfPage:
|
|
1927
|
-
printResolution:
|
|
1923
|
+
scratchCanvas: P,
|
|
1924
|
+
pdfDocument: T,
|
|
1925
|
+
pageNumber: d,
|
|
1926
|
+
viewerPdfPage: C,
|
|
1927
|
+
printResolution: w,
|
|
1928
1928
|
optionalContentConfigPromise: I,
|
|
1929
1929
|
printAnnotationStoragePromise: y
|
|
1930
1930
|
}) => {
|
|
1931
|
-
if (
|
|
1932
|
-
|
|
1931
|
+
if (h.current) {
|
|
1932
|
+
u();
|
|
1933
1933
|
return;
|
|
1934
1934
|
}
|
|
1935
|
-
const R =
|
|
1936
|
-
|
|
1937
|
-
const L =
|
|
1938
|
-
L.save(), L.fillStyle = "rgb(255, 255, 255)", L.fillRect(0, 0,
|
|
1935
|
+
const R = w / tr.PDF;
|
|
1936
|
+
P.width = Math.floor(C.width * R), P.height = Math.floor(C.height * R);
|
|
1937
|
+
const L = P.getContext("2d");
|
|
1938
|
+
L.save(), L.fillStyle = "rgb(255, 255, 255)", L.fillRect(0, 0, P.width, P.height), L.restore();
|
|
1939
1939
|
const [N, x] = await Promise.all([
|
|
1940
|
-
|
|
1940
|
+
T.getPage(d),
|
|
1941
1941
|
y
|
|
1942
1942
|
]);
|
|
1943
|
-
if (
|
|
1944
|
-
|
|
1943
|
+
if (h.current) {
|
|
1944
|
+
u();
|
|
1945
1945
|
return;
|
|
1946
1946
|
}
|
|
1947
1947
|
const E = {
|
|
1948
1948
|
canvasContext: L,
|
|
1949
1949
|
transform: [R, 0, 0, R, 0, 0],
|
|
1950
|
-
viewport: N.getViewport({ scale: 1, rotation:
|
|
1950
|
+
viewport: N.getViewport({ scale: 1, rotation: C.rotation }),
|
|
1951
1951
|
intent: "print",
|
|
1952
1952
|
annotationMode: nr.ENABLE_STORAGE,
|
|
1953
1953
|
optionalContentConfigPromise: I,
|
|
@@ -1959,99 +1959,99 @@ const sa = () => {
|
|
|
1959
1959
|
throw z instanceof rr || console.error(z), z;
|
|
1960
1960
|
}
|
|
1961
1961
|
}, _ = M(() => {
|
|
1962
|
-
const
|
|
1963
|
-
return new Promise((
|
|
1964
|
-
const
|
|
1962
|
+
const P = window.print;
|
|
1963
|
+
return new Promise((T) => {
|
|
1964
|
+
const d = (I) => {
|
|
1965
1965
|
setTimeout(() => {
|
|
1966
|
-
|
|
1966
|
+
P.call(window), setTimeout(() => I(), 20);
|
|
1967
1967
|
}, 0);
|
|
1968
1968
|
};
|
|
1969
1969
|
if (document.querySelector(".rp-print-zone")) {
|
|
1970
|
-
|
|
1970
|
+
d(T);
|
|
1971
1971
|
return;
|
|
1972
1972
|
}
|
|
1973
|
-
const
|
|
1974
|
-
document.querySelector(".rp-print-zone") && (
|
|
1973
|
+
const w = new MutationObserver(() => {
|
|
1974
|
+
document.querySelector(".rp-print-zone") && (d(T), w.disconnect());
|
|
1975
1975
|
});
|
|
1976
|
-
|
|
1976
|
+
w.observe(document.body, { childList: !0, subtree: !0 });
|
|
1977
1977
|
});
|
|
1978
|
-
}, []),
|
|
1979
|
-
const
|
|
1980
|
-
return
|
|
1981
|
-
|
|
1982
|
-
I ? (
|
|
1983
|
-
URL.revokeObjectURL(
|
|
1984
|
-
},
|
|
1978
|
+
}, []), g = async (P) => {
|
|
1979
|
+
const T = document.createElement("img"), d = document.createElement("div");
|
|
1980
|
+
return d.classList.add("rp-print-page"), await new Promise((C, w) => {
|
|
1981
|
+
P.toBlob((I) => {
|
|
1982
|
+
I ? (T.src = URL.createObjectURL(I), T.onload = () => {
|
|
1983
|
+
URL.revokeObjectURL(T.src), C();
|
|
1984
|
+
}, T.onerror = w) : w(new Error("Failed to create blob"));
|
|
1985
1985
|
});
|
|
1986
1986
|
}).catch(() => {
|
|
1987
|
-
}),
|
|
1988
|
-
},
|
|
1989
|
-
const
|
|
1990
|
-
|
|
1991
|
-
const
|
|
1992
|
-
if (
|
|
1993
|
-
const { width: I, height: y } =
|
|
1994
|
-
|
|
1987
|
+
}), d.appendChild(T), d;
|
|
1988
|
+
}, b = (P, T) => {
|
|
1989
|
+
const d = document.createElement("div");
|
|
1990
|
+
d.classList.add("rp-print-zone");
|
|
1991
|
+
const C = document.createElement("style"), w = T.get(1);
|
|
1992
|
+
if (w) {
|
|
1993
|
+
const { width: I, height: y } = w == null ? void 0 : w.page.getViewport({ scale: 1 });
|
|
1994
|
+
C.innerHTML = `@page { size: ${I}px ${y}px }`;
|
|
1995
1995
|
}
|
|
1996
|
-
return
|
|
1997
|
-
},
|
|
1996
|
+
return d.appendChild(C), d.append(...P), d;
|
|
1997
|
+
}, S = M(async () => {
|
|
1998
1998
|
if (!e)
|
|
1999
1999
|
return;
|
|
2000
|
-
|
|
2001
|
-
const
|
|
2000
|
+
u();
|
|
2001
|
+
const P = document.createElement("canvas"), T = [];
|
|
2002
2002
|
try {
|
|
2003
2003
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
2004
|
-
const
|
|
2004
|
+
const C = e.getOptionalContentConfig({ intent: "print" }), w = Promise.resolve(
|
|
2005
2005
|
e.annotationStorage.print ?? void 0
|
|
2006
2006
|
), I = t.size;
|
|
2007
2007
|
for (const [R, L] of t) {
|
|
2008
|
-
if (
|
|
2009
|
-
|
|
2008
|
+
if (h.current) {
|
|
2009
|
+
u();
|
|
2010
2010
|
return;
|
|
2011
2011
|
}
|
|
2012
2012
|
const N = L.page.getViewport({ scale: 1 });
|
|
2013
2013
|
if (await v({
|
|
2014
|
-
scratchCanvas:
|
|
2014
|
+
scratchCanvas: P,
|
|
2015
2015
|
pdfDocument: e,
|
|
2016
2016
|
pageNumber: R,
|
|
2017
2017
|
viewerPdfPage: N,
|
|
2018
2018
|
printResolution: 150,
|
|
2019
|
-
optionalContentConfigPromise:
|
|
2020
|
-
printAnnotationStoragePromise:
|
|
2021
|
-
}),
|
|
2022
|
-
|
|
2019
|
+
optionalContentConfigPromise: C,
|
|
2020
|
+
printAnnotationStoragePromise: w
|
|
2021
|
+
}), h.current) {
|
|
2022
|
+
u();
|
|
2023
2023
|
return;
|
|
2024
2024
|
}
|
|
2025
|
-
const x = await
|
|
2026
|
-
|
|
2027
|
-
const E = parseFloat((
|
|
2025
|
+
const x = await g(P);
|
|
2026
|
+
T.push(x);
|
|
2027
|
+
const E = parseFloat((T.length / I * 100).toFixed(2));
|
|
2028
2028
|
r({
|
|
2029
2029
|
loadedPages: R,
|
|
2030
2030
|
totalPages: I,
|
|
2031
2031
|
percentage: E
|
|
2032
2032
|
});
|
|
2033
2033
|
}
|
|
2034
|
-
if (
|
|
2035
|
-
|
|
2034
|
+
if (h.current) {
|
|
2035
|
+
u();
|
|
2036
2036
|
return;
|
|
2037
2037
|
}
|
|
2038
|
-
const y =
|
|
2038
|
+
const y = b(T, t);
|
|
2039
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 (
|
|
2041
|
-
s(!0),
|
|
2040
|
+
} catch (d) {
|
|
2041
|
+
s(!0), d instanceof Error && p(d);
|
|
2042
2042
|
} finally {
|
|
2043
|
-
|
|
2043
|
+
P.height = 0, P.width = 0;
|
|
2044
2044
|
}
|
|
2045
|
-
}, [e, t,
|
|
2045
|
+
}, [e, t, h]);
|
|
2046
2046
|
return A(() => {
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2047
|
+
const P = () => {
|
|
2048
|
+
u(), m();
|
|
2049
2049
|
};
|
|
2050
|
-
return window.addEventListener("afterprint",
|
|
2051
|
-
window.removeEventListener("afterprint",
|
|
2050
|
+
return window.addEventListener("afterprint", P, !0), () => {
|
|
2051
|
+
window.removeEventListener("afterprint", P, !0);
|
|
2052
2052
|
};
|
|
2053
|
-
}, [
|
|
2054
|
-
print:
|
|
2053
|
+
}, [m, u]), {
|
|
2054
|
+
print: S,
|
|
2055
2055
|
cancel: f,
|
|
2056
2056
|
progress: n,
|
|
2057
2057
|
isComplete: o,
|
|
@@ -2076,23 +2076,23 @@ const sa = () => {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
}
|
|
2078
2078
|
}), la = ({ children: e }) => {
|
|
2079
|
-
const [t, n] = F(null), [r, o] = F(null), { print: i, cancel: l, progress: s, isComplete: c, isError:
|
|
2080
|
-
|
|
2081
|
-
}, []),
|
|
2082
|
-
|
|
2079
|
+
const [t, n] = F(null), [r, o] = F(null), { print: i, cancel: l, progress: s, isComplete: c, isError: p, error: h } = sa(), m = M((g) => {
|
|
2080
|
+
g && typeof g == "function" && o(() => g);
|
|
2081
|
+
}, []), u = (g) => {
|
|
2082
|
+
h && g(h);
|
|
2083
2083
|
}, f = M(
|
|
2084
|
-
(
|
|
2085
|
-
n(() =>
|
|
2084
|
+
(g) => {
|
|
2085
|
+
n(() => g);
|
|
2086
2086
|
},
|
|
2087
2087
|
[s, t]
|
|
2088
2088
|
);
|
|
2089
2089
|
A(() => {
|
|
2090
2090
|
c && r && v();
|
|
2091
2091
|
}, [c, r]), A(() => {
|
|
2092
|
-
|
|
2093
|
-
console.error(
|
|
2092
|
+
p && u((g) => {
|
|
2093
|
+
console.error(g);
|
|
2094
2094
|
});
|
|
2095
|
-
}, [
|
|
2095
|
+
}, [p]), A(() => {
|
|
2096
2096
|
s && t && t(s);
|
|
2097
2097
|
}, [s, t]);
|
|
2098
2098
|
const v = () => {
|
|
@@ -2101,8 +2101,8 @@ const sa = () => {
|
|
|
2101
2101
|
print: i,
|
|
2102
2102
|
cancel: l,
|
|
2103
2103
|
setOnProgress: f,
|
|
2104
|
-
setOnComplete:
|
|
2105
|
-
setOnError:
|
|
2104
|
+
setOnComplete: m,
|
|
2105
|
+
setOnError: u,
|
|
2106
2106
|
progress: s
|
|
2107
2107
|
};
|
|
2108
2108
|
return /* @__PURE__ */ a(xn.Provider, { value: _, children: e });
|
|
@@ -2164,13 +2164,13 @@ const sa = () => {
|
|
|
2164
2164
|
rotateTool: l,
|
|
2165
2165
|
selectionModeTool: s,
|
|
2166
2166
|
jumpNavigationTool: c,
|
|
2167
|
-
printTool:
|
|
2168
|
-
fullscreenTool:
|
|
2167
|
+
printTool: p,
|
|
2168
|
+
fullscreenTool: h
|
|
2169
2169
|
} = se();
|
|
2170
2170
|
return D(() => {
|
|
2171
|
-
const
|
|
2171
|
+
const u = c || l || s || i || o;
|
|
2172
2172
|
let f = !1;
|
|
2173
|
-
return t && (f = !(!n && !r && !
|
|
2173
|
+
return t && (f = !(!n && !r && !p && !h)), u || f;
|
|
2174
2174
|
}, [
|
|
2175
2175
|
n,
|
|
2176
2176
|
r,
|
|
@@ -2228,47 +2228,47 @@ const sa = () => {
|
|
|
2228
2228
|
const { zoomOutIcon: e } = re();
|
|
2229
2229
|
return e || /* @__PURE__ */ a(Xr, {});
|
|
2230
2230
|
}, Ca = () => {
|
|
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(),
|
|
2232
|
-
t((
|
|
2233
|
-
const
|
|
2234
|
-
return Math.min(
|
|
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(), p = M(() => {
|
|
2232
|
+
t((g) => {
|
|
2233
|
+
const b = Math.floor(g / 25) * 25;
|
|
2234
|
+
return Math.min(b + 25, nt);
|
|
2235
2235
|
});
|
|
2236
|
-
}, [t]),
|
|
2237
|
-
t((
|
|
2238
|
-
const
|
|
2239
|
-
return Math.min(
|
|
2236
|
+
}, [t]), h = M(() => {
|
|
2237
|
+
t((g) => {
|
|
2238
|
+
const b = Math.ceil(g / 25) * 25;
|
|
2239
|
+
return Math.min(b - 25, nt);
|
|
2240
2240
|
});
|
|
2241
|
-
}, [t]),
|
|
2242
|
-
var
|
|
2243
|
-
return (
|
|
2241
|
+
}, [t]), m = D(() => e === va, [e]), u = D(() => e === nt, [e]), f = D(() => {
|
|
2242
|
+
var g;
|
|
2243
|
+
return (g = s.get(i)) == null ? void 0 : g.page.getViewport({ scale: 1, rotation: l });
|
|
2244
2244
|
}, [s, i, l]), v = M(
|
|
2245
|
-
(
|
|
2246
|
-
const
|
|
2247
|
-
switch (
|
|
2245
|
+
(g) => {
|
|
2246
|
+
const b = ((f == null ? void 0 : f.width) || 0) + 2 * yt, S = ((f == null ? void 0 : f.height) || 0) + 2 * yt, P = (r == null ? void 0 : r.clientWidth) || 0, T = (r == null ? void 0 : r.clientHeight) || 0;
|
|
2247
|
+
switch (g) {
|
|
2248
2248
|
case we.ACTUAL:
|
|
2249
2249
|
t(100);
|
|
2250
2250
|
break;
|
|
2251
2251
|
case we.PAGE_FIT:
|
|
2252
|
-
let
|
|
2253
|
-
const
|
|
2254
|
-
|
|
2255
|
-
const
|
|
2256
|
-
t(
|
|
2252
|
+
let d = 0;
|
|
2253
|
+
const C = P > T;
|
|
2254
|
+
S > b && C ? d = T / S : d = P / b;
|
|
2255
|
+
const w = Math.floor(d * 100);
|
|
2256
|
+
t(w);
|
|
2257
2257
|
break;
|
|
2258
2258
|
case we.PAGE_WIDTH:
|
|
2259
|
-
t(Math.floor(
|
|
2259
|
+
t(Math.floor(P / b * 100));
|
|
2260
2260
|
break;
|
|
2261
2261
|
}
|
|
2262
2262
|
},
|
|
2263
2263
|
[t, f]
|
|
2264
2264
|
), _ = M(
|
|
2265
|
-
(
|
|
2266
|
-
typeof
|
|
2265
|
+
(g) => {
|
|
2266
|
+
typeof g == "number" ? t(g) : v(g);
|
|
2267
2267
|
},
|
|
2268
2268
|
[t, v]
|
|
2269
2269
|
);
|
|
2270
2270
|
return typeof o != "boolean" ? /* @__PURE__ */ a(o, { zoomLevel: e, setZoomLevel: t }) : o ? /* @__PURE__ */ O("div", { className: ye["rp-zoom-wrapper"], children: [
|
|
2271
|
-
/* @__PURE__ */ a(X, { content: "Zoom out", children: /* @__PURE__ */ a(B, { disabled:
|
|
2271
|
+
/* @__PURE__ */ a(X, { content: "Zoom out", children: /* @__PURE__ */ a(B, { disabled: m, onClick: h, children: /* @__PURE__ */ a(ba, {}) }) }),
|
|
2272
2272
|
!c && /* @__PURE__ */ a(X, { content: "Select zoom level", children: /* @__PURE__ */ a(
|
|
2273
2273
|
ft,
|
|
2274
2274
|
{
|
|
@@ -2289,14 +2289,14 @@ const sa = () => {
|
|
|
2289
2289
|
/* @__PURE__ */ a(ce, { onClick: () => _(we.PAGE_WIDTH), children: "Page width" })
|
|
2290
2290
|
] }),
|
|
2291
2291
|
/* @__PURE__ */ a(vt, {}),
|
|
2292
|
-
/* @__PURE__ */ a(Fe, { children: _a.map((
|
|
2293
|
-
|
|
2292
|
+
/* @__PURE__ */ a(Fe, { children: _a.map((g) => /* @__PURE__ */ O(ce, { onClick: () => _(g), children: [
|
|
2293
|
+
g,
|
|
2294
2294
|
" %"
|
|
2295
|
-
] },
|
|
2295
|
+
] }, g)) })
|
|
2296
2296
|
] })
|
|
2297
2297
|
}
|
|
2298
2298
|
) }),
|
|
2299
|
-
/* @__PURE__ */ a(X, { content: "Zoom in", children: /* @__PURE__ */ a(B, { disabled:
|
|
2299
|
+
/* @__PURE__ */ a(X, { content: "Zoom in", children: /* @__PURE__ */ a(B, { disabled: u, onClick: p, children: /* @__PURE__ */ a(wa, {}) }) })
|
|
2300
2300
|
] }) : null;
|
|
2301
2301
|
}, ne = {
|
|
2302
2302
|
"rp-search-tool-content": "_rp-search-tool-content_1vxow_1",
|
|
@@ -2315,37 +2315,37 @@ const sa = () => {
|
|
|
2315
2315
|
searchOptions: l,
|
|
2316
2316
|
setSearchOptions: s,
|
|
2317
2317
|
loading: c,
|
|
2318
|
-
setSearch:
|
|
2319
|
-
totalMatches:
|
|
2320
|
-
currentMatchPosition:
|
|
2321
|
-
nextMatch:
|
|
2318
|
+
setSearch: p,
|
|
2319
|
+
totalMatches: h,
|
|
2320
|
+
currentMatchPosition: m,
|
|
2321
|
+
nextMatch: u,
|
|
2322
2322
|
prevMatch: f,
|
|
2323
2323
|
search: v
|
|
2324
|
-
} = nn(), { searchTool: _ = !0 } = se(), [
|
|
2324
|
+
} = nn(), { searchTool: _ = !0 } = se(), [g, b] = F(v), S = M(() => {
|
|
2325
2325
|
n(!0);
|
|
2326
|
-
}, []),
|
|
2327
|
-
|
|
2328
|
-
}, [
|
|
2326
|
+
}, []), P = M(() => {
|
|
2327
|
+
p(""), b(""), n(!1);
|
|
2328
|
+
}, [p]), T = M(
|
|
2329
2329
|
(x) => {
|
|
2330
|
-
x.key === "Escape" && t &&
|
|
2330
|
+
x.key === "Escape" && t && P();
|
|
2331
2331
|
},
|
|
2332
2332
|
[t]
|
|
2333
|
-
),
|
|
2333
|
+
), d = M(
|
|
2334
2334
|
(x) => {
|
|
2335
|
-
x.shiftKey && x.key === "Enter" ? f() : x.key === "Enter" &&
|
|
2335
|
+
x.shiftKey && x.key === "Enter" ? f() : x.key === "Enter" && p((E) => (g === E && u(), g));
|
|
2336
2336
|
},
|
|
2337
|
-
[
|
|
2337
|
+
[g, f, u, p]
|
|
2338
2338
|
);
|
|
2339
|
-
A(() => (window.addEventListener("keydown",
|
|
2340
|
-
window.removeEventListener("keydown",
|
|
2341
|
-
}), [
|
|
2339
|
+
A(() => (window.addEventListener("keydown", T), () => {
|
|
2340
|
+
window.removeEventListener("keydown", T);
|
|
2341
|
+
}), [T]), A(() => {
|
|
2342
2342
|
o && o.focus();
|
|
2343
2343
|
}, [o]);
|
|
2344
|
-
const
|
|
2345
|
-
|
|
2346
|
-
}, []),
|
|
2347
|
-
|
|
2348
|
-
}, [
|
|
2344
|
+
const C = M((x) => {
|
|
2345
|
+
b(x.target.value);
|
|
2346
|
+
}, []), w = M(() => {
|
|
2347
|
+
b(""), p("");
|
|
2348
|
+
}, [p]), I = D(() => `${m} / ${h}`, [m, h]), { wholeWords: y, matchCase: R } = D(() => l, [l]), L = M(
|
|
2349
2349
|
(x) => {
|
|
2350
2350
|
s((E) => ({ ...E, matchCase: x }));
|
|
2351
2351
|
},
|
|
@@ -2357,28 +2357,28 @@ const sa = () => {
|
|
|
2357
2357
|
[s]
|
|
2358
2358
|
);
|
|
2359
2359
|
return A(() => {
|
|
2360
|
-
|
|
2361
|
-
}, [r,
|
|
2360
|
+
P();
|
|
2361
|
+
}, [r, P]), _ ? /* @__PURE__ */ a(
|
|
2362
2362
|
ft,
|
|
2363
2363
|
{
|
|
2364
2364
|
open: t,
|
|
2365
2365
|
container: e,
|
|
2366
2366
|
align: "start",
|
|
2367
|
-
triggerComponent: /* @__PURE__ */ a(X, { content: "Search in Document", children: /* @__PURE__ */ a(B, { onClick:
|
|
2367
|
+
triggerComponent: /* @__PURE__ */ a(X, { content: "Search in Document", children: /* @__PURE__ */ a(B, { onClick: S, children: /* @__PURE__ */ a(Gt, {}) }) }),
|
|
2368
2368
|
children: /* @__PURE__ */ O("div", { className: ne["rp-search-tool-content"], children: [
|
|
2369
2369
|
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-input-wrapper"], children: [
|
|
2370
2370
|
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-input"], children: [
|
|
2371
2371
|
/* @__PURE__ */ a(
|
|
2372
2372
|
Zt,
|
|
2373
2373
|
{
|
|
2374
|
-
value:
|
|
2375
|
-
onKeyDown:
|
|
2376
|
-
onChange:
|
|
2374
|
+
value: g,
|
|
2375
|
+
onKeyDown: d,
|
|
2376
|
+
onChange: C,
|
|
2377
2377
|
icon: /* @__PURE__ */ a(Gt, {}),
|
|
2378
2378
|
placeholder: "Enter to Search",
|
|
2379
2379
|
className: ne["rp-search-input"],
|
|
2380
2380
|
ref: i,
|
|
2381
|
-
children: !!
|
|
2381
|
+
children: !!g && /* @__PURE__ */ a("span", { className: ne["rp-search-tool-input-clear"], onClick: w, children: /* @__PURE__ */ a(Yr, {}) })
|
|
2382
2382
|
}
|
|
2383
2383
|
),
|
|
2384
2384
|
c ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(pt, {}) }) : /* @__PURE__ */ a("span", { children: I })
|
|
@@ -2390,14 +2390,14 @@ const sa = () => {
|
|
|
2390
2390
|
] }),
|
|
2391
2391
|
/* @__PURE__ */ O("div", { className: ne["rp-search-tool-controls"], children: [
|
|
2392
2392
|
/* @__PURE__ */ a(B, { onClick: f, children: /* @__PURE__ */ a(Me, { className: ne["rp-search-tool-input-icon"] }) }),
|
|
2393
|
-
/* @__PURE__ */ a(B, { onClick:
|
|
2393
|
+
/* @__PURE__ */ a(B, { onClick: u, children: /* @__PURE__ */ a(
|
|
2394
2394
|
Me,
|
|
2395
2395
|
{
|
|
2396
2396
|
style: { transform: "rotate(180deg" },
|
|
2397
2397
|
className: ne["rp-search-tool-input-icon"]
|
|
2398
2398
|
}
|
|
2399
2399
|
) }),
|
|
2400
|
-
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(Yt, { onClick:
|
|
2400
|
+
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(Yt, { onClick: P, className: ne["rp-search-tool-input-icon"] }) })
|
|
2401
2401
|
] })
|
|
2402
2402
|
] })
|
|
2403
2403
|
}
|
|
@@ -2492,39 +2492,39 @@ const sa = () => {
|
|
|
2492
2492
|
(s) => {
|
|
2493
2493
|
if (!n.size)
|
|
2494
2494
|
return;
|
|
2495
|
-
const c = Array.from(n.values()).slice(0, s).map((
|
|
2496
|
-
const { thumbnailViewport:
|
|
2495
|
+
const c = Array.from(n.values()).slice(0, s).map((m) => {
|
|
2496
|
+
const { thumbnailViewport: u, scale: f } = It(m.page, r);
|
|
2497
2497
|
return {
|
|
2498
2498
|
scale: f,
|
|
2499
|
-
page:
|
|
2499
|
+
page: m.page,
|
|
2500
2500
|
loading: !0,
|
|
2501
|
-
viewport:
|
|
2501
|
+
viewport: u
|
|
2502
2502
|
};
|
|
2503
|
-
}),
|
|
2504
|
-
t(
|
|
2505
|
-
const
|
|
2506
|
-
for (const
|
|
2507
|
-
const
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2503
|
+
}), p = c.reduce((m, u) => (m[u.page.pageNumber] = u, m), {});
|
|
2504
|
+
t(p);
|
|
2505
|
+
const h = [];
|
|
2506
|
+
for (const m of c) {
|
|
2507
|
+
const u = document.createElement("canvas"), f = ot(
|
|
2508
|
+
m.page,
|
|
2509
|
+
u,
|
|
2510
|
+
m.scale,
|
|
2511
2511
|
r
|
|
2512
2512
|
).promise.then(() => {
|
|
2513
|
-
const v =
|
|
2513
|
+
const v = u.toDataURL();
|
|
2514
2514
|
return {
|
|
2515
|
-
...
|
|
2515
|
+
...m,
|
|
2516
2516
|
thumbnailSrc: v,
|
|
2517
2517
|
loading: !1
|
|
2518
2518
|
};
|
|
2519
2519
|
});
|
|
2520
|
-
|
|
2520
|
+
h.push(f);
|
|
2521
2521
|
}
|
|
2522
|
-
Promise.all(
|
|
2523
|
-
const
|
|
2522
|
+
Promise.all(h).then((m) => {
|
|
2523
|
+
const u = m.reduce(
|
|
2524
2524
|
(f, v) => (f[v.page.pageNumber] = v, f),
|
|
2525
2525
|
{}
|
|
2526
2526
|
);
|
|
2527
|
-
t((f) => ({ ...f, ...
|
|
2527
|
+
t((f) => ({ ...f, ...u }));
|
|
2528
2528
|
});
|
|
2529
2529
|
},
|
|
2530
2530
|
[n, r]
|
|
@@ -2539,8 +2539,8 @@ const sa = () => {
|
|
|
2539
2539
|
const c = n.get(s);
|
|
2540
2540
|
if (!c)
|
|
2541
2541
|
return;
|
|
2542
|
-
t((
|
|
2543
|
-
...
|
|
2542
|
+
t((h) => ({
|
|
2543
|
+
...h,
|
|
2544
2544
|
[s]: {
|
|
2545
2545
|
loading: !0,
|
|
2546
2546
|
page: c.page,
|
|
@@ -2548,18 +2548,18 @@ const sa = () => {
|
|
|
2548
2548
|
scale: c.thumbnailScale
|
|
2549
2549
|
}
|
|
2550
2550
|
}));
|
|
2551
|
-
const
|
|
2552
|
-
ot(c.page,
|
|
2553
|
-
const
|
|
2551
|
+
const p = document.createElement("canvas");
|
|
2552
|
+
ot(c.page, p, c.thumbnailScale, r).promise.then(() => {
|
|
2553
|
+
const h = p.toDataURL(), { thumbnailViewport: m, scale: u } = It(c.page, r);
|
|
2554
2554
|
return {
|
|
2555
|
-
scale:
|
|
2556
|
-
thumbnailSrc:
|
|
2555
|
+
scale: u,
|
|
2556
|
+
thumbnailSrc: h,
|
|
2557
2557
|
page: c.page,
|
|
2558
2558
|
loading: !1,
|
|
2559
|
-
viewport:
|
|
2559
|
+
viewport: m
|
|
2560
2560
|
};
|
|
2561
|
-
}).then((
|
|
2562
|
-
t((
|
|
2561
|
+
}).then((h) => {
|
|
2562
|
+
t((m) => ({ ...m, [s]: h }));
|
|
2563
2563
|
});
|
|
2564
2564
|
},
|
|
2565
2565
|
[n, r]
|
|
@@ -2591,21 +2591,21 @@ const sa = () => {
|
|
|
2591
2591
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2592
2592
|
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Ma);
|
|
2593
2593
|
}, Na = $e((e, t) => {
|
|
2594
|
-
const { show: n } = e, { focusedPage: r, totalPages: o } = ee(), { thumbnailPages: i, addPage: l, thumbnailLength: s, addToPage: c } = On(),
|
|
2595
|
-
qt(t, () =>
|
|
2596
|
-
const
|
|
2594
|
+
const { show: n } = e, { focusedPage: r, totalPages: o } = ee(), { thumbnailPages: i, addPage: l, thumbnailLength: s, addToPage: c } = On(), p = $(null), h = $(1);
|
|
2595
|
+
qt(t, () => p.current);
|
|
2596
|
+
const m = D(() => Object.values(i), [i]), u = M(() => {
|
|
2597
2597
|
const f = s + 1;
|
|
2598
2598
|
f <= o && l(f);
|
|
2599
2599
|
}, [l, o, s]);
|
|
2600
2600
|
return A(() => {
|
|
2601
|
-
r > s ? c(r) : n &&
|
|
2602
|
-
}, [r, s, c, n,
|
|
2603
|
-
var _,
|
|
2601
|
+
r > s ? c(r) : n && h.current !== r && (La(p.current, r), h.current = r);
|
|
2602
|
+
}, [r, s, c, n, m]), or(p.current, u), /* @__PURE__ */ a("div", { ref: p, className: Ut["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: Ut["rp-thumbnails"], children: n ? m.map((f, v) => {
|
|
2603
|
+
var _, g;
|
|
2604
2604
|
return /* @__PURE__ */ a(
|
|
2605
2605
|
ya,
|
|
2606
2606
|
{
|
|
2607
2607
|
isFocused: r === ((_ = f.page) == null ? void 0 : _.pageNumber),
|
|
2608
|
-
pageNumber: (
|
|
2608
|
+
pageNumber: (g = f.page) == null ? void 0 : g.pageNumber,
|
|
2609
2609
|
thumbnailSrc: f.thumbnailSrc,
|
|
2610
2610
|
loading: f.loading,
|
|
2611
2611
|
viewport: f.viewport
|
|
@@ -2646,7 +2646,7 @@ const sa = () => {
|
|
|
2646
2646
|
// initialViewMode = ViewMode.SINGLE_PAGE,
|
|
2647
2647
|
initialScale: s,
|
|
2648
2648
|
initialScrollMode: c = Q.VERTICAL_SCROLLING,
|
|
2649
|
-
mobileWidth:
|
|
2649
|
+
mobileWidth: p
|
|
2650
2650
|
} = e;
|
|
2651
2651
|
return /* @__PURE__ */ a(
|
|
2652
2652
|
vr,
|
|
@@ -2655,7 +2655,7 @@ const sa = () => {
|
|
|
2655
2655
|
initialPage: l,
|
|
2656
2656
|
initialScrollMode: c,
|
|
2657
2657
|
initialRotate: o,
|
|
2658
|
-
children: /* @__PURE__ */ a(hr, { mobileWidth:
|
|
2658
|
+
children: /* @__PURE__ */ a(hr, { mobileWidth: p, children: /* @__PURE__ */ a(dr, { children: /* @__PURE__ */ a(Yn, { children: /* @__PURE__ */ a(Zn, { children: /* @__PURE__ */ a(Wn, { children: /* @__PURE__ */ a(mr, { initialSelectionMode: jt.TEXT, children: /* @__PURE__ */ a(pr, { children: /* @__PURE__ */ a(Oo, { children: /* @__PURE__ */ a(qn, { children: /* @__PURE__ */ a(ur, { textLayer: i, children: /* @__PURE__ */ a(Bn, { children: /* @__PURE__ */ a(
|
|
2659
2659
|
Gn,
|
|
2660
2660
|
{
|
|
2661
2661
|
darkMode: n,
|
|
@@ -2674,26 +2674,26 @@ const sa = () => {
|
|
|
2674
2674
|
initialSearch: l,
|
|
2675
2675
|
showToolbar: s = !0,
|
|
2676
2676
|
style: c,
|
|
2677
|
-
className:
|
|
2678
|
-
onLoaded:
|
|
2679
|
-
cleanupOnLoaded:
|
|
2680
|
-
...
|
|
2681
|
-
} = e, [f, v] = F(null), [_,
|
|
2682
|
-
return A(() => (
|
|
2683
|
-
|
|
2684
|
-
}), [
|
|
2677
|
+
className: p,
|
|
2678
|
+
onLoaded: h,
|
|
2679
|
+
cleanupOnLoaded: m,
|
|
2680
|
+
...u
|
|
2681
|
+
} = e, [f, v] = F(null), [_, g] = F(null), [b, S] = F(null);
|
|
2682
|
+
return A(() => (h && h(), () => {
|
|
2683
|
+
m && m();
|
|
2684
|
+
}), [h, m]), /* @__PURE__ */ a("div", { ref: t, className: j(he["rp-theme-variables"], he["rp-container"]), children: /* @__PURE__ */ a(lr, { container: _, contentRef: b, children: /* @__PURE__ */ a(Da, { ...u, 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: b, children: /* @__PURE__ */ a(la, { children: /* @__PURE__ */ a(jn, { children: s ? /* @__PURE__ */ a(
|
|
2685
2685
|
sr,
|
|
2686
2686
|
{
|
|
2687
|
-
getContainerRef:
|
|
2687
|
+
getContainerRef: g,
|
|
2688
2688
|
toolbarRef: f,
|
|
2689
2689
|
style: c,
|
|
2690
|
-
className:
|
|
2690
|
+
className: p,
|
|
2691
2691
|
children: /* @__PURE__ */ O(br, { children: [
|
|
2692
2692
|
/* @__PURE__ */ O("div", { className: he["rp-layout"], children: [
|
|
2693
2693
|
/* @__PURE__ */ a(Ia, { ref: v }),
|
|
2694
2694
|
/* @__PURE__ */ O("div", { className: he["rp-content"], children: [
|
|
2695
2695
|
/* @__PURE__ */ a("div", { className: he["rp-sidebar"], children: /* @__PURE__ */ a(Oa, {}) }),
|
|
2696
|
-
/* @__PURE__ */ a("div", { ref:
|
|
2696
|
+
/* @__PURE__ */ a("div", { ref: S, className: he["rp-pages"], children: n })
|
|
2697
2697
|
] })
|
|
2698
2698
|
] }),
|
|
2699
2699
|
/* @__PURE__ */ a($n, {})
|
|
@@ -2702,8 +2702,8 @@ const sa = () => {
|
|
|
2702
2702
|
) : /* @__PURE__ */ a(
|
|
2703
2703
|
"div",
|
|
2704
2704
|
{
|
|
2705
|
-
ref:
|
|
2706
|
-
className: j(he["rp-pages"],
|
|
2705
|
+
ref: S,
|
|
2706
|
+
className: j(he["rp-pages"], p),
|
|
2707
2707
|
style: c,
|
|
2708
2708
|
children: n
|
|
2709
2709
|
}
|