@pdf-viewer/react 1.7.0-beta.5 → 1.7.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPDefaultLayout-45eb04c1.js → RPDefaultLayout-e3550bd7.js} +489 -489
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/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/SearchResultNavigator.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/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/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/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +1 -1
|
@@ -94,14 +94,14 @@ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
|
94
94
|
import { ClearIcon as Po } from "./components/icons/ClearIcon.js";
|
|
95
95
|
import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
|
|
96
96
|
import './assets/RPDefaultLayout.css';const wn = () => {
|
|
97
|
-
const { viewMode: t } = Ee(), { scrollMode: e } = Re(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: a } = ie(), l = H(), { columnCount: c } = un(), { widths: d, heights: p } = qe(), m = H(e),
|
|
97
|
+
const { viewMode: t } = Ee(), { scrollMode: e } = Re(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: a } = ie(), l = H(), { columnCount: c } = un(), { widths: d, heights: p } = qe(), m = H(e), b = H(t), h = H(c), { targetScrollPage: v } = pn();
|
|
98
98
|
k(() => {
|
|
99
99
|
n != null && n.scrollToItem && (l.current = n);
|
|
100
100
|
}, [n]), k(() => {
|
|
101
|
-
m.current = e,
|
|
101
|
+
m.current = e, b.current = t;
|
|
102
102
|
}, [e, t]);
|
|
103
|
-
const
|
|
104
|
-
(P,
|
|
103
|
+
const _ = N(
|
|
104
|
+
(P, S) => {
|
|
105
105
|
if (!r)
|
|
106
106
|
return;
|
|
107
107
|
const u = Math.ceil(P / 2) * 2 - 1;
|
|
@@ -120,22 +120,22 @@ import './assets/RPDefaultLayout.css';const wn = () => {
|
|
|
120
120
|
};
|
|
121
121
|
return r == null ? void 0 : r.scrollTo({
|
|
122
122
|
...f,
|
|
123
|
-
behavior:
|
|
123
|
+
behavior: S
|
|
124
124
|
});
|
|
125
125
|
},
|
|
126
126
|
[r, d, st]
|
|
127
127
|
);
|
|
128
128
|
return k(() => {
|
|
129
|
-
m.current = e,
|
|
129
|
+
m.current = e, b.current = t;
|
|
130
130
|
}, [e, t]), k(() => {
|
|
131
131
|
h.current = c;
|
|
132
132
|
}, [c]), { scrollToPage: N(
|
|
133
|
-
(P,
|
|
133
|
+
(P, S = "smooth") => {
|
|
134
134
|
a(P);
|
|
135
135
|
const u = P - 1;
|
|
136
136
|
let f = u, g = 0;
|
|
137
|
-
if (
|
|
138
|
-
|
|
137
|
+
if (b.current === Ie.DUAL_PAGE && m.current === J.PAGE_SCROLLING) {
|
|
138
|
+
_(P, S);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
if (m.current === J.PAGE_SCROLLING) {
|
|
@@ -145,41 +145,41 @@ import './assets/RPDefaultLayout.css';const wn = () => {
|
|
|
145
145
|
if (!l.current || !o)
|
|
146
146
|
return;
|
|
147
147
|
const s = o;
|
|
148
|
-
if (
|
|
148
|
+
if (v.current = P, m.current === J.HORIZONTAL_SCROLLING) {
|
|
149
149
|
g = u;
|
|
150
|
-
const
|
|
150
|
+
const y = {
|
|
151
151
|
left: ze(d, g),
|
|
152
152
|
top: 0
|
|
153
153
|
};
|
|
154
154
|
return s.scrollTo({
|
|
155
|
-
...
|
|
156
|
-
behavior:
|
|
155
|
+
...y,
|
|
156
|
+
behavior: S
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
-
if (
|
|
159
|
+
if (b.current === Ie.DUAL_PAGE) {
|
|
160
160
|
g = u % 2, f = Math.floor(u / 2);
|
|
161
|
-
const
|
|
161
|
+
const y = {
|
|
162
162
|
left: ze(d, g),
|
|
163
163
|
top: ze(p, f)
|
|
164
164
|
};
|
|
165
165
|
return s.scrollTo({
|
|
166
|
-
...
|
|
167
|
-
behavior:
|
|
166
|
+
...y,
|
|
167
|
+
behavior: S
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const C = {
|
|
171
171
|
left: 0,
|
|
172
172
|
top: ze(p, f)
|
|
173
173
|
};
|
|
174
174
|
return s.scrollTo({
|
|
175
|
-
...
|
|
176
|
-
behavior:
|
|
175
|
+
...C,
|
|
176
|
+
behavior: S
|
|
177
177
|
});
|
|
178
178
|
},
|
|
179
179
|
[
|
|
180
180
|
o,
|
|
181
181
|
c,
|
|
182
|
-
|
|
182
|
+
_,
|
|
183
183
|
a,
|
|
184
184
|
st,
|
|
185
185
|
p,
|
|
@@ -187,7 +187,7 @@ import './assets/RPDefaultLayout.css';const wn = () => {
|
|
|
187
187
|
]
|
|
188
188
|
) };
|
|
189
189
|
}, To = (t = 1) => {
|
|
190
|
-
const [e, n] = $(t), [o, r] = $(0), { scrollToPage: a } = wn(), l = H(1), { viewMode: c } = Ee(), { scrollMode: d } = Re(), { widths: p } = qe(), { pagesRef: m } = ge(),
|
|
190
|
+
const [e, n] = $(t), [o, r] = $(0), { scrollToPage: a } = wn(), l = H(1), { viewMode: c } = Ee(), { scrollMode: d } = Re(), { widths: p } = qe(), { pagesRef: m } = ge(), b = Pt(e, 100), h = N(
|
|
191
191
|
(f) => {
|
|
192
192
|
if (!/^[0-9]*$/g.test(f.toString()) || !f)
|
|
193
193
|
return { success: !1, currentPage: l.current };
|
|
@@ -195,35 +195,35 @@ import './assets/RPDefaultLayout.css';const wn = () => {
|
|
|
195
195
|
return s < 0 || s > o ? { success: !1, currentPage: l.current } : (n(s), l.current = s, { success: !0, currentPage: +f });
|
|
196
196
|
},
|
|
197
197
|
[o]
|
|
198
|
-
),
|
|
198
|
+
), v = N(h, [h]), _ = N(
|
|
199
199
|
(f) => {
|
|
200
200
|
const g = h(f);
|
|
201
201
|
return g.success && a(g.currentPage), g;
|
|
202
202
|
},
|
|
203
203
|
[h, a]
|
|
204
|
-
),
|
|
204
|
+
), T = N((f) => {
|
|
205
205
|
const g = f % 2 === 1;
|
|
206
206
|
if (!m || g)
|
|
207
207
|
return !1;
|
|
208
|
-
const s = g ? p[f] : p[f - 1],
|
|
209
|
-
return c === Ie.DUAL_PAGE && s +
|
|
208
|
+
const s = g ? p[f] : p[f - 1], C = g ? p[f + 1] : p[f];
|
|
209
|
+
return c === Ie.DUAL_PAGE && s + C < m.clientWidth;
|
|
210
210
|
}, [c, p, m, o]), P = N(() => {
|
|
211
211
|
let f = e - 1;
|
|
212
|
-
|
|
213
|
-
}, [
|
|
214
|
-
if (
|
|
212
|
+
T(f) && (f = e - 2), _(f);
|
|
213
|
+
}, [_, e, c, d, T]), S = W(() => c === Ie.DUAL_PAGE && d === J.PAGE_SCROLLING ? e === o - 1 : e === o, [e, o, c, d]), u = N(() => {
|
|
214
|
+
if (S)
|
|
215
215
|
return;
|
|
216
216
|
let f = e + 1;
|
|
217
|
-
|
|
218
|
-
}, [
|
|
217
|
+
T(f) && (f = e + 2), _(f);
|
|
218
|
+
}, [_, e, T, c, d, S]);
|
|
219
219
|
return {
|
|
220
|
-
focusedPage:
|
|
220
|
+
focusedPage: b,
|
|
221
221
|
totalPages: o,
|
|
222
|
-
setFocusedPage:
|
|
222
|
+
setFocusedPage: v,
|
|
223
223
|
setTotalPages: r,
|
|
224
224
|
nextPage: u,
|
|
225
225
|
prevPage: P,
|
|
226
|
-
goToPage:
|
|
226
|
+
goToPage: _
|
|
227
227
|
};
|
|
228
228
|
}, _n = Ye({
|
|
229
229
|
focusedPage: 0,
|
|
@@ -269,7 +269,7 @@ const So = () => {
|
|
|
269
269
|
k(() => {
|
|
270
270
|
m.current;
|
|
271
271
|
}, [m]);
|
|
272
|
-
const
|
|
272
|
+
const b = N(() => {
|
|
273
273
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
274
274
|
const f = document.querySelector(".rp-print-zone");
|
|
275
275
|
f && f.remove();
|
|
@@ -279,23 +279,23 @@ const So = () => {
|
|
|
279
279
|
totalPages: 0,
|
|
280
280
|
percentage: 0
|
|
281
281
|
});
|
|
282
|
-
}, []),
|
|
282
|
+
}, []), v = () => {
|
|
283
283
|
m.current = !0;
|
|
284
|
-
},
|
|
284
|
+
}, _ = async ({
|
|
285
285
|
scratchCanvas: f,
|
|
286
286
|
pdfDocument: g,
|
|
287
287
|
pageNumber: s,
|
|
288
|
-
viewerPdfPage:
|
|
289
|
-
printResolution:
|
|
290
|
-
optionalContentConfigPromise:
|
|
288
|
+
viewerPdfPage: C,
|
|
289
|
+
printResolution: w,
|
|
290
|
+
optionalContentConfigPromise: y,
|
|
291
291
|
printAnnotationStoragePromise: E
|
|
292
292
|
}) => {
|
|
293
293
|
if (m.current) {
|
|
294
294
|
h();
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
|
-
const x =
|
|
298
|
-
f.width = Math.floor(
|
|
297
|
+
const x = w / yr.PDF;
|
|
298
|
+
f.width = Math.floor(C.width * x), f.height = Math.floor(C.height * x);
|
|
299
299
|
const L = f.getContext("2d");
|
|
300
300
|
L.save(), L.fillStyle = "rgb(255, 255, 255)", L.fillRect(0, 0, f.width, f.height), L.restore();
|
|
301
301
|
const [D, A] = await Promise.all([
|
|
@@ -309,10 +309,10 @@ const So = () => {
|
|
|
309
309
|
const z = {
|
|
310
310
|
canvasContext: L,
|
|
311
311
|
transform: [x, 0, 0, x, 0, 0],
|
|
312
|
-
viewport: D.getViewport({ scale: 1, rotation:
|
|
312
|
+
viewport: D.getViewport({ scale: 1, rotation: C.rotation }),
|
|
313
313
|
intent: "print",
|
|
314
314
|
annotationMode: xr.ENABLE_STORAGE,
|
|
315
|
-
optionalContentConfigPromise:
|
|
315
|
+
optionalContentConfigPromise: y,
|
|
316
316
|
printAnnotationStorage: A
|
|
317
317
|
};
|
|
318
318
|
try {
|
|
@@ -320,42 +320,42 @@ const So = () => {
|
|
|
320
320
|
} catch (R) {
|
|
321
321
|
throw R instanceof Ir || console.error(R), R;
|
|
322
322
|
}
|
|
323
|
-
},
|
|
323
|
+
}, T = N(() => {
|
|
324
324
|
const f = window.print;
|
|
325
325
|
return new Promise((g) => {
|
|
326
|
-
const s = (
|
|
326
|
+
const s = (y) => {
|
|
327
327
|
setTimeout(() => {
|
|
328
|
-
f.call(window), setTimeout(() =>
|
|
328
|
+
f.call(window), setTimeout(() => y(), 20);
|
|
329
329
|
}, 0);
|
|
330
330
|
};
|
|
331
331
|
if (document.querySelector(".rp-print-zone")) {
|
|
332
332
|
s(g);
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
|
-
const
|
|
336
|
-
document.querySelector(".rp-print-zone") && (s(g),
|
|
335
|
+
const w = new MutationObserver(() => {
|
|
336
|
+
document.querySelector(".rp-print-zone") && (s(g), w.disconnect());
|
|
337
337
|
});
|
|
338
|
-
|
|
338
|
+
w.observe(document.body, { childList: !0, subtree: !0 });
|
|
339
339
|
});
|
|
340
340
|
}, []), P = async (f) => {
|
|
341
341
|
const g = document.createElement("img"), s = document.createElement("div");
|
|
342
|
-
return s.classList.add("rp-print-page"), await new Promise((
|
|
343
|
-
f.toBlob((
|
|
344
|
-
|
|
345
|
-
URL.revokeObjectURL(g.src),
|
|
346
|
-
}, g.onerror =
|
|
342
|
+
return s.classList.add("rp-print-page"), await new Promise((C, w) => {
|
|
343
|
+
f.toBlob((y) => {
|
|
344
|
+
y ? (g.src = URL.createObjectURL(y), g.onload = () => {
|
|
345
|
+
URL.revokeObjectURL(g.src), C();
|
|
346
|
+
}, g.onerror = w) : w(new Error("Failed to create blob"));
|
|
347
347
|
});
|
|
348
348
|
}).catch(() => {
|
|
349
349
|
}), s.appendChild(g), s;
|
|
350
|
-
},
|
|
350
|
+
}, S = (f, g) => {
|
|
351
351
|
const s = document.createElement("div");
|
|
352
352
|
s.classList.add("rp-print-zone");
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
355
|
-
const { width:
|
|
356
|
-
|
|
353
|
+
const C = document.createElement("style"), w = g.get(1);
|
|
354
|
+
if (w) {
|
|
355
|
+
const { width: y, height: E } = w == null ? void 0 : w.page.getViewport({ scale: 1 });
|
|
356
|
+
C.innerHTML = `@page { size: ${y}px ${E}px }`;
|
|
357
357
|
}
|
|
358
|
-
return s.appendChild(
|
|
358
|
+
return s.appendChild(C), s.append(...f), s;
|
|
359
359
|
}, u = N(async () => {
|
|
360
360
|
if (!t)
|
|
361
361
|
return;
|
|
@@ -363,33 +363,33 @@ const So = () => {
|
|
|
363
363
|
const f = document.createElement("canvas"), g = [];
|
|
364
364
|
try {
|
|
365
365
|
t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
366
|
-
const
|
|
366
|
+
const C = t.getOptionalContentConfig({ intent: "print" }), w = Promise.resolve(
|
|
367
367
|
t.annotationStorage.print ?? void 0
|
|
368
|
-
),
|
|
368
|
+
), y = e.size;
|
|
369
369
|
for (const [x, L] of e) {
|
|
370
370
|
if (m.current) {
|
|
371
371
|
h();
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
374
|
const D = L.page.getViewport({ scale: 1 });
|
|
375
|
-
if (await
|
|
375
|
+
if (await _({
|
|
376
376
|
scratchCanvas: f,
|
|
377
377
|
pdfDocument: t,
|
|
378
378
|
pageNumber: x,
|
|
379
379
|
viewerPdfPage: D,
|
|
380
380
|
printResolution: 150,
|
|
381
|
-
optionalContentConfigPromise:
|
|
382
|
-
printAnnotationStoragePromise:
|
|
381
|
+
optionalContentConfigPromise: C,
|
|
382
|
+
printAnnotationStoragePromise: w
|
|
383
383
|
}), m.current) {
|
|
384
384
|
h();
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
387
|
const A = await P(f);
|
|
388
388
|
g.push(A);
|
|
389
|
-
const z = parseFloat((g.length /
|
|
389
|
+
const z = parseFloat((g.length / y * 100).toFixed(2));
|
|
390
390
|
o({
|
|
391
391
|
loadedPages: x,
|
|
392
|
-
totalPages:
|
|
392
|
+
totalPages: y,
|
|
393
393
|
percentage: z
|
|
394
394
|
});
|
|
395
395
|
}
|
|
@@ -397,8 +397,8 @@ const So = () => {
|
|
|
397
397
|
h();
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
400
|
-
const E =
|
|
401
|
-
document.body.appendChild(E), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await
|
|
400
|
+
const E = S(g, e);
|
|
401
|
+
document.body.appendChild(E), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await T();
|
|
402
402
|
} catch (s) {
|
|
403
403
|
c(!0), s instanceof Error && p(s);
|
|
404
404
|
} finally {
|
|
@@ -407,14 +407,14 @@ const So = () => {
|
|
|
407
407
|
}, [t, e, m]);
|
|
408
408
|
return k(() => {
|
|
409
409
|
const f = () => {
|
|
410
|
-
h(),
|
|
410
|
+
h(), b();
|
|
411
411
|
};
|
|
412
412
|
return window.addEventListener("afterprint", f, !0), () => {
|
|
413
413
|
window.removeEventListener("afterprint", f, !0);
|
|
414
414
|
};
|
|
415
|
-
}, [
|
|
415
|
+
}, [b, h]), {
|
|
416
416
|
print: u,
|
|
417
|
-
cancel:
|
|
417
|
+
cancel: v,
|
|
418
418
|
progress: n,
|
|
419
419
|
isComplete: r,
|
|
420
420
|
isError: l,
|
|
@@ -438,18 +438,18 @@ const So = () => {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
}), Hs = ({ children: t }) => {
|
|
441
|
-
const [e, n] = $(null), [o, r] = $(null), { print: a, cancel: l, progress: c, isComplete: d, isError: p, error: m } = So(),
|
|
441
|
+
const [e, n] = $(null), [o, r] = $(null), { print: a, cancel: l, progress: c, isComplete: d, isError: p, error: m } = So(), b = N((P) => {
|
|
442
442
|
P && typeof P == "function" && r(() => P);
|
|
443
443
|
}, []), h = (P) => {
|
|
444
444
|
m && P(m);
|
|
445
|
-
},
|
|
445
|
+
}, v = N(
|
|
446
446
|
(P) => {
|
|
447
447
|
n(() => P);
|
|
448
448
|
},
|
|
449
449
|
[c, e]
|
|
450
450
|
);
|
|
451
451
|
k(() => {
|
|
452
|
-
d && o &&
|
|
452
|
+
d && o && _();
|
|
453
453
|
}, [d, o]), k(() => {
|
|
454
454
|
p && h((P) => {
|
|
455
455
|
console.error(P);
|
|
@@ -457,17 +457,17 @@ const So = () => {
|
|
|
457
457
|
}, [p]), k(() => {
|
|
458
458
|
c && e && e(c);
|
|
459
459
|
}, [c, e]);
|
|
460
|
-
const
|
|
460
|
+
const _ = () => {
|
|
461
461
|
o && (o(), r(null));
|
|
462
|
-
},
|
|
462
|
+
}, T = {
|
|
463
463
|
print: a,
|
|
464
464
|
cancel: l,
|
|
465
|
-
setOnProgress:
|
|
466
|
-
setOnComplete:
|
|
465
|
+
setOnProgress: v,
|
|
466
|
+
setOnComplete: b,
|
|
467
467
|
setOnError: h,
|
|
468
468
|
progress: c
|
|
469
469
|
};
|
|
470
|
-
return /* @__PURE__ */ i(bn.Provider, { value:
|
|
470
|
+
return /* @__PURE__ */ i(bn.Provider, { value: T, children: t });
|
|
471
471
|
}, tt = () => {
|
|
472
472
|
const t = Je(bn);
|
|
473
473
|
if (!t)
|
|
@@ -476,39 +476,39 @@ const So = () => {
|
|
|
476
476
|
}, yo = () => {
|
|
477
477
|
const [t, e] = $({}), { pages: n } = Q(), { rotate: o } = Ge(), r = W(() => Object.keys(t).length, [t]), a = N(
|
|
478
478
|
(c) => {
|
|
479
|
-
if (!n.size
|
|
479
|
+
if (!n.size)
|
|
480
480
|
return;
|
|
481
|
-
const d = Array.from(n.values()).slice(0,
|
|
482
|
-
const { thumbnailViewport:
|
|
481
|
+
const d = c > n.size ? n.size : c, p = Array.from(n.values()).slice(0, d).map((h) => {
|
|
482
|
+
const { thumbnailViewport: v, scale: _ } = kt(h.page, o);
|
|
483
483
|
return {
|
|
484
|
-
scale:
|
|
485
|
-
page:
|
|
484
|
+
scale: _,
|
|
485
|
+
page: h.page,
|
|
486
486
|
loading: !0,
|
|
487
|
-
viewport:
|
|
487
|
+
viewport: v
|
|
488
488
|
};
|
|
489
|
-
}),
|
|
490
|
-
e(
|
|
491
|
-
const
|
|
492
|
-
for (const
|
|
493
|
-
const
|
|
494
|
-
scale:
|
|
489
|
+
}), m = p.reduce((h, v) => (h[v.page.pageNumber] = v, h), {});
|
|
490
|
+
e(m);
|
|
491
|
+
const b = [];
|
|
492
|
+
for (const h of p) {
|
|
493
|
+
const v = document.createElement("canvas"), _ = vt(h.page, v, {
|
|
494
|
+
scale: h.scale,
|
|
495
495
|
rotate: o
|
|
496
496
|
}).promise.then(() => {
|
|
497
|
-
const
|
|
497
|
+
const T = v.toDataURL();
|
|
498
498
|
return {
|
|
499
|
-
...
|
|
500
|
-
thumbnailSrc:
|
|
499
|
+
...h,
|
|
500
|
+
thumbnailSrc: T,
|
|
501
501
|
loading: !1
|
|
502
502
|
};
|
|
503
503
|
});
|
|
504
|
-
|
|
504
|
+
b.push(_);
|
|
505
505
|
}
|
|
506
|
-
Promise.all(
|
|
507
|
-
const
|
|
508
|
-
(
|
|
506
|
+
Promise.all(b).then((h) => {
|
|
507
|
+
const v = h.reduce(
|
|
508
|
+
(_, T) => (_[T.page.pageNumber] = T, _),
|
|
509
509
|
{}
|
|
510
510
|
);
|
|
511
|
-
e((
|
|
511
|
+
e((_) => ({ ..._, ...v }));
|
|
512
512
|
}).catch(() => {
|
|
513
513
|
});
|
|
514
514
|
},
|
|
@@ -535,16 +535,16 @@ const So = () => {
|
|
|
535
535
|
}));
|
|
536
536
|
const p = document.createElement("canvas");
|
|
537
537
|
vt(d.page, p, { scale: d.thumbnailScale, rotate: o }).promise.then(() => {
|
|
538
|
-
const m = p.toDataURL(), { thumbnailViewport:
|
|
538
|
+
const m = p.toDataURL(), { thumbnailViewport: b, scale: h } = kt(d.page, o);
|
|
539
539
|
return {
|
|
540
540
|
scale: h,
|
|
541
541
|
thumbnailSrc: m,
|
|
542
542
|
page: d.page,
|
|
543
543
|
loading: !1,
|
|
544
|
-
viewport:
|
|
544
|
+
viewport: b
|
|
545
545
|
};
|
|
546
546
|
}).then((m) => {
|
|
547
|
-
e((
|
|
547
|
+
e((b) => ({ ...b, [c]: m }));
|
|
548
548
|
});
|
|
549
549
|
},
|
|
550
550
|
[n, o]
|
|
@@ -573,25 +573,25 @@ const So = () => {
|
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
575
|
}, xo = (t = {}, e = "") => {
|
|
576
|
-
const [n, o] = $(e), [r, a] = $(!1), { pdf: l, pages: c } = Q(), { widths: d, heights: p } = qe(), m = H(!n), { currentZoom:
|
|
576
|
+
const [n, o] = $(e), [r, a] = $(!1), { pdf: l, pages: c } = Q(), { widths: d, heights: p } = qe(), m = H(!n), { currentZoom: b } = Qe(), [h, v] = $([]), { setFocusedPage: _ } = ie(), { columnCount: T } = Ee(), { rotate: P } = Ge(), [S, u] = $(0), { pageScrollElementRef: f, virtualScrollableElementRef: g } = et(), { scrollMode: s } = Re(), { pagesRef: C } = ge(), [w, y] = $(null), E = H({}), x = W(() => S === 0 ? null : h[S - 1], [S, h]), L = W(() => h.length, [h]);
|
|
577
577
|
k(() => {
|
|
578
578
|
if (!x || !c)
|
|
579
579
|
return;
|
|
580
580
|
const R = g || f;
|
|
581
|
-
if (!R || !
|
|
581
|
+
if (!R || !C)
|
|
582
582
|
return;
|
|
583
583
|
const I = c.get(x.page);
|
|
584
|
-
if (s === J.PAGE_SCROLLING &&
|
|
584
|
+
if (s === J.PAGE_SCROLLING && _(x.page), !I)
|
|
585
585
|
return;
|
|
586
586
|
let O = 0, M = 0;
|
|
587
587
|
if (s === J.VERTICAL_SCROLLING) {
|
|
588
|
-
const ae = x.page - 1, de =
|
|
588
|
+
const ae = x.page - 1, de = T, te = ae % de, Fe = Math.floor(ae / de);
|
|
589
589
|
O = ze(p, Fe), M = ze(d, te);
|
|
590
590
|
}
|
|
591
591
|
s === J.HORIZONTAL_SCROLLING && (M = d.slice(0, x.page - 1).reduce((ae, de) => ae + de, 0));
|
|
592
592
|
const G = {
|
|
593
|
-
top:
|
|
594
|
-
left:
|
|
593
|
+
top: C.clientHeight / 2,
|
|
594
|
+
left: C.clientWidth / 2
|
|
595
595
|
}, Z = {
|
|
596
596
|
height: p[x.page - 1],
|
|
597
597
|
width: d[x.page - 1]
|
|
@@ -599,7 +599,7 @@ const So = () => {
|
|
|
599
599
|
Z,
|
|
600
600
|
G,
|
|
601
601
|
x.rect,
|
|
602
|
-
|
|
602
|
+
b,
|
|
603
603
|
P
|
|
604
604
|
), ee = M + j, X = O + V, le = {
|
|
605
605
|
left: Math.max(ee, 0),
|
|
@@ -610,14 +610,14 @@ const So = () => {
|
|
|
610
610
|
});
|
|
611
611
|
}, [
|
|
612
612
|
c,
|
|
613
|
-
|
|
613
|
+
_,
|
|
614
614
|
d,
|
|
615
615
|
p,
|
|
616
616
|
x,
|
|
617
617
|
s,
|
|
618
618
|
g,
|
|
619
619
|
f,
|
|
620
|
-
|
|
620
|
+
C
|
|
621
621
|
]);
|
|
622
622
|
const D = N(() => {
|
|
623
623
|
u((R) => L ? R + 1 > L ? 1 : R + 1 : 0);
|
|
@@ -637,10 +637,10 @@ const So = () => {
|
|
|
637
637
|
}, []);
|
|
638
638
|
return k(() => {
|
|
639
639
|
if (!n) {
|
|
640
|
-
m.current = !0,
|
|
640
|
+
m.current = !0, v([]), u(0);
|
|
641
641
|
return;
|
|
642
642
|
}
|
|
643
|
-
m.current = !1, a(!0),
|
|
643
|
+
m.current = !1, a(!0), v([]), u(0), z(l).then((R) => {
|
|
644
644
|
E.current = R;
|
|
645
645
|
const O = Object.keys(R).reduce((M, G) => {
|
|
646
646
|
const Z = cr(
|
|
@@ -651,9 +651,9 @@ const So = () => {
|
|
|
651
651
|
).map((j, V) => ({ ...j, page: Number(G), pageMatchIdx: V }));
|
|
652
652
|
return [...M, ...Z];
|
|
653
653
|
}, []);
|
|
654
|
-
|
|
654
|
+
v(O), u(O.length ? 1 : 0);
|
|
655
655
|
}).catch(() => {
|
|
656
|
-
|
|
656
|
+
v([]), u(0);
|
|
657
657
|
}).finally(() => a(!1));
|
|
658
658
|
}, [n, z, l, t]), {
|
|
659
659
|
search: n,
|
|
@@ -661,12 +661,12 @@ const So = () => {
|
|
|
661
661
|
loading: r,
|
|
662
662
|
matches: h,
|
|
663
663
|
totalMatches: L,
|
|
664
|
-
currentMatchPosition:
|
|
664
|
+
currentMatchPosition: S,
|
|
665
665
|
currentMatch: x,
|
|
666
666
|
nextMatch: D,
|
|
667
667
|
prevMatch: A,
|
|
668
|
-
currentMatchElement:
|
|
669
|
-
setCurrentMatchElement:
|
|
668
|
+
currentMatchElement: w,
|
|
669
|
+
setCurrentMatchElement: y
|
|
670
670
|
};
|
|
671
671
|
}, Tn = Ye({
|
|
672
672
|
search: "",
|
|
@@ -698,10 +698,10 @@ const So = () => {
|
|
|
698
698
|
currentMatch: d,
|
|
699
699
|
search: p,
|
|
700
700
|
matches: m,
|
|
701
|
-
nextMatch:
|
|
701
|
+
nextMatch: b,
|
|
702
702
|
prevMatch: h,
|
|
703
|
-
currentMatchElement:
|
|
704
|
-
setCurrentMatchElement:
|
|
703
|
+
currentMatchElement: v,
|
|
704
|
+
setCurrentMatchElement: _
|
|
705
705
|
} = xo(n, e);
|
|
706
706
|
return /* @__PURE__ */ i(
|
|
707
707
|
Tn.Provider,
|
|
@@ -714,12 +714,12 @@ const So = () => {
|
|
|
714
714
|
totalMatches: l,
|
|
715
715
|
currentMatchPosition: c,
|
|
716
716
|
currentMatch: d,
|
|
717
|
-
nextMatch:
|
|
717
|
+
nextMatch: b,
|
|
718
718
|
prevMatch: h,
|
|
719
719
|
search: p,
|
|
720
720
|
matches: m,
|
|
721
|
-
currentMatchElement:
|
|
722
|
-
setCurrentMatchElement:
|
|
721
|
+
currentMatchElement: v,
|
|
722
|
+
setCurrentMatchElement: _
|
|
723
723
|
},
|
|
724
724
|
children: t
|
|
725
725
|
}
|
|
@@ -746,8 +746,8 @@ const So = () => {
|
|
|
746
746
|
if (r.current && p) {
|
|
747
747
|
const m = r.current;
|
|
748
748
|
m.hidden = !0;
|
|
749
|
-
const
|
|
750
|
-
|
|
749
|
+
const b = c.current;
|
|
750
|
+
b && b.cancel(), o && o(), c.current = vt(p.page, m, {
|
|
751
751
|
scale: d,
|
|
752
752
|
rotate: l,
|
|
753
753
|
renderForms: !0
|
|
@@ -771,100 +771,100 @@ const So = () => {
|
|
|
771
771
|
}, Eo = (t) => {
|
|
772
772
|
const { pageNumber: e } = t, { pages: n } = Q(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement: l } = xt(), [c, d] = $(
|
|
773
773
|
[]
|
|
774
|
-
), p = H(), m = H(),
|
|
774
|
+
), p = H(), m = H(), b = H([]), h = W(() => r.filter((f) => f.pageIndex === e - 1), [r, e]), v = N(
|
|
775
775
|
(f, g, s = !1) => {
|
|
776
776
|
if (s && lr(f, g), !h.length) {
|
|
777
|
-
|
|
777
|
+
b.current = [], d([]);
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
|
-
const
|
|
781
|
-
d(
|
|
780
|
+
const C = dr(h, f, g);
|
|
781
|
+
d(C);
|
|
782
782
|
},
|
|
783
783
|
[h]
|
|
784
|
-
),
|
|
784
|
+
), _ = H(), T = H(!1), P = N(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
785
785
|
k(() => ((() => {
|
|
786
|
-
if (
|
|
786
|
+
if (_.current)
|
|
787
787
|
return;
|
|
788
|
-
|
|
789
|
-
const { signal: g } =
|
|
790
|
-
P().forEach((
|
|
791
|
-
const
|
|
792
|
-
|
|
788
|
+
_.current = new AbortController();
|
|
789
|
+
const { signal: g } = _.current, s = () => {
|
|
790
|
+
P().forEach((w) => {
|
|
791
|
+
const y = w.querySelector(".endOfContent");
|
|
792
|
+
y && (w.appendChild(y), y.style.width = "", y.style.height = "", w.classList.remove(he.selecting));
|
|
793
793
|
});
|
|
794
794
|
};
|
|
795
795
|
document.addEventListener(
|
|
796
796
|
"pointerdown",
|
|
797
797
|
() => {
|
|
798
|
-
|
|
798
|
+
T.current = !0;
|
|
799
799
|
},
|
|
800
800
|
{ signal: g }
|
|
801
801
|
), document.addEventListener(
|
|
802
802
|
"pointerup",
|
|
803
803
|
() => {
|
|
804
|
-
|
|
804
|
+
T.current = !1, s();
|
|
805
805
|
},
|
|
806
806
|
{ signal: g }
|
|
807
807
|
), window.addEventListener(
|
|
808
808
|
"blur",
|
|
809
809
|
() => {
|
|
810
|
-
|
|
810
|
+
T.current = !1, s();
|
|
811
811
|
},
|
|
812
812
|
{ signal: g }
|
|
813
813
|
), document.addEventListener(
|
|
814
814
|
"keyup",
|
|
815
815
|
() => {
|
|
816
|
-
|
|
816
|
+
T.current || s();
|
|
817
817
|
},
|
|
818
818
|
{ signal: g }
|
|
819
819
|
);
|
|
820
|
-
let
|
|
820
|
+
let C = null;
|
|
821
821
|
document.addEventListener(
|
|
822
822
|
"selectionchange",
|
|
823
823
|
() => {
|
|
824
824
|
var z, R;
|
|
825
|
-
const
|
|
826
|
-
if (!
|
|
825
|
+
const w = document.getSelection();
|
|
826
|
+
if (!w)
|
|
827
827
|
return;
|
|
828
|
-
if (
|
|
828
|
+
if (w.rangeCount === 0) {
|
|
829
829
|
s();
|
|
830
830
|
return;
|
|
831
831
|
}
|
|
832
|
-
const
|
|
833
|
-
for (let I = 0; I <
|
|
834
|
-
const O =
|
|
832
|
+
const y = /* @__PURE__ */ new Set();
|
|
833
|
+
for (let I = 0; I < w.rangeCount; I++) {
|
|
834
|
+
const O = w.getRangeAt(I);
|
|
835
835
|
P().forEach((M) => {
|
|
836
|
-
O.intersectsNode(M) && !
|
|
836
|
+
O.intersectsNode(M) && !y.has(M) && y.add(M);
|
|
837
837
|
});
|
|
838
838
|
}
|
|
839
839
|
P().forEach((I) => {
|
|
840
|
-
if (
|
|
840
|
+
if (y.has(I))
|
|
841
841
|
I.classList.add(he.selecting);
|
|
842
842
|
else {
|
|
843
843
|
const O = I.querySelector(".endOfContent");
|
|
844
844
|
O && (I.appendChild(O), O.style.width = "", O.style.height = "", I.classList.remove(he.selecting));
|
|
845
845
|
}
|
|
846
846
|
});
|
|
847
|
-
const E =
|
|
848
|
-
let L =
|
|
847
|
+
const E = w.getRangeAt(0);
|
|
848
|
+
let L = C && (E.compareBoundaryPoints(Range.END_TO_END, C) === 0 || E.compareBoundaryPoints(Range.START_TO_END, C) === 0) ? E.startContainer : E.endContainer;
|
|
849
849
|
L.nodeType === Node.TEXT_NODE && (L = L.parentNode);
|
|
850
850
|
const D = (z = L.parentElement) == null ? void 0 : z.closest(
|
|
851
851
|
he["rp-text-layer"]
|
|
852
852
|
), A = D == null ? void 0 : D.querySelector(".endOfContent");
|
|
853
|
-
A && D && (A.style.width = D.style.width, A.style.height = D.style.height, (R = L.parentElement) == null || R.insertBefore(A, L.nextSibling)),
|
|
853
|
+
A && D && (A.style.width = D.style.width, A.style.height = D.style.height, (R = L.parentElement) == null || R.insertBefore(A, L.nextSibling)), C = E.cloneRange();
|
|
854
854
|
},
|
|
855
855
|
{ signal: g }
|
|
856
856
|
);
|
|
857
857
|
})(), () => {
|
|
858
858
|
var g;
|
|
859
|
-
(g =
|
|
859
|
+
(g = _.current) == null || g.abort(), _.current = void 0;
|
|
860
860
|
}), [P]);
|
|
861
|
-
const
|
|
861
|
+
const S = N(() => {
|
|
862
862
|
o.current && o.current.classList.add(he.selecting);
|
|
863
863
|
}, []), u = N(() => {
|
|
864
864
|
o.current && o.current.classList.remove(he.selecting);
|
|
865
865
|
}, []);
|
|
866
866
|
return k(() => {
|
|
867
|
-
if (
|
|
867
|
+
if (b.current.forEach((s) => {
|
|
868
868
|
s.classList.remove("selected");
|
|
869
869
|
}), !c.length || !a || a.pageIndex !== e - 1)
|
|
870
870
|
return;
|
|
@@ -874,7 +874,7 @@ const So = () => {
|
|
|
874
874
|
if (f === -1)
|
|
875
875
|
return;
|
|
876
876
|
const g = c.filter((s) => s.index === f);
|
|
877
|
-
g.length && (
|
|
877
|
+
g.length && (b.current = g.map((s) => s.element), l(g[0].element), g.forEach((s) => {
|
|
878
878
|
s.element.classList.add("selected");
|
|
879
879
|
}));
|
|
880
880
|
}, [a, c, h]), k(() => {
|
|
@@ -883,21 +883,21 @@ const So = () => {
|
|
|
883
883
|
return;
|
|
884
884
|
const g = o.current;
|
|
885
885
|
return p.current && p.current.cancel(), f.page.getTextContent().then((s) => {
|
|
886
|
-
const
|
|
886
|
+
const C = f.page.getViewport({ scale: 1 });
|
|
887
887
|
return p.current = new Sr.TextLayer({
|
|
888
|
-
viewport:
|
|
888
|
+
viewport: C,
|
|
889
889
|
textContentSource: s,
|
|
890
890
|
container: g
|
|
891
891
|
}), m.current = s, g && (g.innerText = ""), p.current.render();
|
|
892
892
|
}).then(() => {
|
|
893
|
-
var
|
|
893
|
+
var y, E;
|
|
894
894
|
[].slice.call(g.children).forEach((x) => {
|
|
895
895
|
x.classList.add(he["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
896
896
|
});
|
|
897
|
-
const
|
|
898
|
-
|
|
899
|
-
const
|
|
900
|
-
|
|
897
|
+
const C = (y = p.current) == null ? void 0 : y.textDivs;
|
|
898
|
+
C && m.current && v(m.current, C);
|
|
899
|
+
const w = document.createElement("div");
|
|
900
|
+
w.className = "endOfContent", (E = o.current) == null || E.appendChild(w);
|
|
901
901
|
}).catch(() => {
|
|
902
902
|
}), () => {
|
|
903
903
|
var s;
|
|
@@ -905,18 +905,18 @@ const So = () => {
|
|
|
905
905
|
};
|
|
906
906
|
}, [n, e]), k(() => {
|
|
907
907
|
var s;
|
|
908
|
-
[].slice.call(o.current.children).forEach((
|
|
909
|
-
|
|
908
|
+
[].slice.call(o.current.children).forEach((C) => {
|
|
909
|
+
C.classList.add(he["rp-text-layer-text"]);
|
|
910
910
|
});
|
|
911
911
|
const g = (s = p.current) == null ? void 0 : s.textDivs;
|
|
912
|
-
g && m.current &&
|
|
913
|
-
}, [
|
|
912
|
+
g && m.current && v(m.current, g, !0);
|
|
913
|
+
}, [v]), /* @__PURE__ */ i(
|
|
914
914
|
"div",
|
|
915
915
|
{
|
|
916
916
|
"data-rp": `page-${e}-textLayer`,
|
|
917
917
|
className: he["rp-text-layer"],
|
|
918
918
|
ref: o,
|
|
919
|
-
onMouseDown:
|
|
919
|
+
onMouseDown: S,
|
|
920
920
|
onMouseUp: u
|
|
921
921
|
}
|
|
922
922
|
);
|
|
@@ -925,34 +925,34 @@ const So = () => {
|
|
|
925
925
|
};
|
|
926
926
|
let Oo = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
927
927
|
const Do = (t) => {
|
|
928
|
-
const { pageNumber: e } = t, n = H(null), { pages: o, pdf: r } = Q(), a = H(), [l, c] = $(), { setFocusedPage: d, goToPage: p } = ie(), { scrollMode: m } = Re(), { print:
|
|
928
|
+
const { pageNumber: e } = t, n = H(null), { pages: o, pdf: r } = Q(), a = H(), [l, c] = $(), { setFocusedPage: d, goToPage: p } = ie(), { scrollMode: m } = Re(), { print: b } = tt(), { download: h } = $n(), v = W(() => o.get(e), [o, e]), _ = W(() => v == null ? void 0 : v.page.getViewport(), [v]);
|
|
929
929
|
k(() => {
|
|
930
930
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
931
931
|
}, [r]), k(() => {
|
|
932
|
-
|
|
932
|
+
v && v.page.getAnnotations().then((P) => {
|
|
933
933
|
a.current = void 0, c(P), n.current && (n.current.innerText = "");
|
|
934
934
|
});
|
|
935
|
-
}, [
|
|
936
|
-
const
|
|
935
|
+
}, [v]);
|
|
936
|
+
const T = N(
|
|
937
937
|
(P) => {
|
|
938
|
-
!l || !r || (Er(P), Nr(P, r, l).then((
|
|
938
|
+
!l || !r || (Er(P), Nr(P, r, l).then((S) => {
|
|
939
939
|
var u, f;
|
|
940
|
-
((u =
|
|
941
|
-
}), m === J.PAGE_SCROLLING ? zt(P, l, r, (
|
|
940
|
+
((u = S == null ? void 0 : S.data) == null ? void 0 : u.action) === "Print" ? b() : ((f = S == null ? void 0 : S.data) == null ? void 0 : f.action) === "SaveAs" && h();
|
|
941
|
+
}), m === J.PAGE_SCROLLING ? zt(P, l, r, (S) => d(S.pageIndex + 1)) : zt(P, l, r, (S) => p(S.pageIndex + 1)));
|
|
942
942
|
},
|
|
943
|
-
[r, l, p, d, m,
|
|
943
|
+
[r, l, p, d, m, b, h]
|
|
944
944
|
);
|
|
945
945
|
return k(() => {
|
|
946
|
-
if (!
|
|
946
|
+
if (!v || !l)
|
|
947
947
|
return;
|
|
948
|
-
const P =
|
|
948
|
+
const P = v.page.getViewport();
|
|
949
949
|
if (a.current) {
|
|
950
950
|
a.current.update({
|
|
951
951
|
viewport: P.clone({ dontFlip: !0 })
|
|
952
952
|
});
|
|
953
953
|
return;
|
|
954
954
|
}
|
|
955
|
-
const
|
|
955
|
+
const S = /* @__PURE__ */ new Map([]);
|
|
956
956
|
for (const g of l) {
|
|
957
957
|
const { annotationType: s } = g;
|
|
958
958
|
switch (s) {
|
|
@@ -960,33 +960,33 @@ const Do = (t) => {
|
|
|
960
960
|
Dr(g);
|
|
961
961
|
break;
|
|
962
962
|
case At.Widget:
|
|
963
|
-
Or(g, P,
|
|
963
|
+
Or(g, P, S);
|
|
964
964
|
break;
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
967
|
const u = new AbortController();
|
|
968
968
|
return (async () => {
|
|
969
|
-
var
|
|
969
|
+
var C;
|
|
970
970
|
a.current && (a.current.div.replaceChildren(), a.current = void 0), n.current && (n.current.innerText = ""), a.current = new Lr({
|
|
971
971
|
div: n.current,
|
|
972
972
|
accessibilityManager: void 0,
|
|
973
973
|
annotationCanvasMap: void 0,
|
|
974
974
|
annotationEditorUIManager: void 0,
|
|
975
975
|
structTreeLayer: null,
|
|
976
|
-
page:
|
|
976
|
+
page: v.page,
|
|
977
977
|
viewport: P.clone({ dontFlip: !0 })
|
|
978
|
-
}), n.current && Ft(n.current,
|
|
978
|
+
}), n.current && Ft(n.current, T);
|
|
979
979
|
const g = await (r == null ? void 0 : r.hasJSActions()), s = await (r == null ? void 0 : r.getFieldObjects());
|
|
980
980
|
if (u.signal.aborted)
|
|
981
981
|
throw "abort";
|
|
982
|
-
return (
|
|
982
|
+
return (C = a.current) == null ? void 0 : C.render({
|
|
983
983
|
annotations: l,
|
|
984
984
|
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
985
985
|
hasJSActions: g,
|
|
986
986
|
fieldObjects: s,
|
|
987
987
|
div: n.current,
|
|
988
988
|
viewport: P.clone({ dontFlip: !0 }),
|
|
989
|
-
page:
|
|
989
|
+
page: v.page,
|
|
990
990
|
imageResourcesPath: Oo,
|
|
991
991
|
renderForms: !0,
|
|
992
992
|
linkService: new Rr(),
|
|
@@ -994,18 +994,18 @@ const Do = (t) => {
|
|
|
994
994
|
enableScripting: !1
|
|
995
995
|
});
|
|
996
996
|
})().then(() => {
|
|
997
|
-
n.current && Ar(n.current,
|
|
997
|
+
n.current && Ar(n.current, T);
|
|
998
998
|
}).catch((g) => {
|
|
999
999
|
if (g !== "abort")
|
|
1000
1000
|
throw g;
|
|
1001
1001
|
}), () => {
|
|
1002
|
-
u.abort("clear"), n.current && Ft(n.current,
|
|
1002
|
+
u.abort("clear"), n.current && Ft(n.current, T);
|
|
1003
1003
|
};
|
|
1004
|
-
}, [r, l,
|
|
1004
|
+
}, [r, l, T]), /* @__PURE__ */ i(
|
|
1005
1005
|
"div",
|
|
1006
1006
|
{
|
|
1007
1007
|
"data-rp": `page-${e}-annotationLayer`,
|
|
1008
|
-
style: { width: `${
|
|
1008
|
+
style: { width: `${_ == null ? void 0 : _.width}px`, height: `${_ == null ? void 0 : _.height}px` },
|
|
1009
1009
|
className: No["rp-annotation-layer"],
|
|
1010
1010
|
ref: n
|
|
1011
1011
|
}
|
|
@@ -1013,7 +1013,7 @@ const Do = (t) => {
|
|
|
1013
1013
|
}, Ao = {
|
|
1014
1014
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1015
1015
|
}, zo = ({ pageNumber: t, viewport: e }) => {
|
|
1016
|
-
const [n, o] = $(), { pages: r } = Q(), { highlightKeywords: a } = pr(), l = !0, c = H(null), [d, p] = $(null), [m,
|
|
1016
|
+
const [n, o] = $(), { pages: r } = Q(), { highlightKeywords: a } = pr(), l = !0, c = H(null), [d, p] = $(null), [m, b] = $([]);
|
|
1017
1017
|
k(() => {
|
|
1018
1018
|
c.current && p(c.current.parentElement);
|
|
1019
1019
|
}, [c]), k(() => {
|
|
@@ -1032,23 +1032,23 @@ const Do = (t) => {
|
|
|
1032
1032
|
color: u.highlightColor
|
|
1033
1033
|
};
|
|
1034
1034
|
}) : [], [a]);
|
|
1035
|
-
function
|
|
1035
|
+
function v(u, f) {
|
|
1036
1036
|
if (!u)
|
|
1037
1037
|
return;
|
|
1038
1038
|
const g = `[data-rp="page-${f}-textLayer"]`;
|
|
1039
1039
|
return new Promise((s) => {
|
|
1040
|
-
const
|
|
1041
|
-
if (
|
|
1042
|
-
s(
|
|
1040
|
+
const C = u.querySelector(g);
|
|
1041
|
+
if (C) {
|
|
1042
|
+
s(C);
|
|
1043
1043
|
return;
|
|
1044
1044
|
}
|
|
1045
|
-
new MutationObserver((
|
|
1045
|
+
new MutationObserver((y, E) => {
|
|
1046
1046
|
const x = u.querySelector(g);
|
|
1047
1047
|
x && (s(x), E.disconnect());
|
|
1048
1048
|
}).observe(u, { childList: !0, subtree: !0 });
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function _(u) {
|
|
1052
1052
|
return new Promise((f) => {
|
|
1053
1053
|
const g = u.querySelectorAll(
|
|
1054
1054
|
'[data-rp="rp-text-layer-text"]'
|
|
@@ -1057,25 +1057,25 @@ const Do = (t) => {
|
|
|
1057
1057
|
f(Array.from(g));
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
|
-
new MutationObserver((
|
|
1061
|
-
const
|
|
1060
|
+
new MutationObserver((C, w) => {
|
|
1061
|
+
const y = u.querySelectorAll(
|
|
1062
1062
|
".vpv-text-layer-text"
|
|
1063
1063
|
);
|
|
1064
|
-
|
|
1064
|
+
y.length && (f(Array.from(y)), w.disconnect());
|
|
1065
1065
|
}).observe(u, { childList: !0, subtree: !0 });
|
|
1066
1066
|
});
|
|
1067
1067
|
}
|
|
1068
|
-
const
|
|
1068
|
+
const T = (u, f, g, s) => {
|
|
1069
1069
|
var Z;
|
|
1070
|
-
const
|
|
1071
|
-
if (!
|
|
1070
|
+
const C = document.createRange(), w = g.firstChild;
|
|
1071
|
+
if (!w || w.nodeType !== Node.TEXT_NODE)
|
|
1072
1072
|
return null;
|
|
1073
|
-
const
|
|
1074
|
-
if (E >
|
|
1073
|
+
const y = ((Z = w.textContent) == null ? void 0 : Z.length) ?? 0, E = s[0].charIdxInSpan, x = s.length === 1 ? E : s[s.length - 1].charIdxInSpan;
|
|
1074
|
+
if (E > y || x + 1 > y)
|
|
1075
1075
|
return null;
|
|
1076
|
-
|
|
1076
|
+
C.setStart(w, E), C.setEnd(w, x + 1);
|
|
1077
1077
|
const L = document.createElement("span");
|
|
1078
|
-
L.style.width = "auto",
|
|
1078
|
+
L.style.width = "auto", C.surroundContents(L);
|
|
1079
1079
|
const D = L.getBoundingClientRect(), A = u.getBoundingClientRect(), z = A.height, R = A.width, I = 100 * (D.left - A.left) / R, O = 100 * (D.top - A.top) / z, M = 100 * D.height / z, G = 100 * D.width / R;
|
|
1080
1080
|
return kr(L), {
|
|
1081
1081
|
keywordStr: f,
|
|
@@ -1088,13 +1088,13 @@ const Do = (t) => {
|
|
|
1088
1088
|
};
|
|
1089
1089
|
};
|
|
1090
1090
|
async function P(u, f) {
|
|
1091
|
-
const g = await
|
|
1091
|
+
const g = await v(d, u);
|
|
1092
1092
|
if (!g)
|
|
1093
1093
|
return;
|
|
1094
|
-
const s = await
|
|
1094
|
+
const s = await _(g);
|
|
1095
1095
|
if (s.length) {
|
|
1096
|
-
const
|
|
1097
|
-
(
|
|
1096
|
+
const C = s.map((y) => y.tagName === "BR" ? " " : y.textContent).reduce(
|
|
1097
|
+
(y, E, x) => y.concat(
|
|
1098
1098
|
E.split("").map((L, D) => ({
|
|
1099
1099
|
char: L,
|
|
1100
1100
|
charIdxInSpan: D,
|
|
@@ -1108,15 +1108,15 @@ const Do = (t) => {
|
|
|
1108
1108
|
spanIdx: 0
|
|
1109
1109
|
}
|
|
1110
1110
|
]
|
|
1111
|
-
).slice(1),
|
|
1112
|
-
|
|
1111
|
+
).slice(1), w = S(g, f, s, C);
|
|
1112
|
+
b(w);
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
|
-
const
|
|
1116
|
-
const
|
|
1117
|
-
if (!s.length || !
|
|
1115
|
+
const S = (u, f, g, s) => {
|
|
1116
|
+
const C = f.length;
|
|
1117
|
+
if (!s.length || !C)
|
|
1118
1118
|
return [];
|
|
1119
|
-
const
|
|
1119
|
+
const w = [], y = s.map((E) => E.char).join("");
|
|
1120
1120
|
return h.forEach((E) => {
|
|
1121
1121
|
const { keyword: x, regExp: L, wholeWords: D, color: A } = E, z = x;
|
|
1122
1122
|
if (!z.trim())
|
|
@@ -1124,8 +1124,8 @@ const Do = (t) => {
|
|
|
1124
1124
|
const R = L.flags.indexOf("g") === -1 ? new RegExp(L, `${L.flags}g`) : L;
|
|
1125
1125
|
let I;
|
|
1126
1126
|
const O = [];
|
|
1127
|
-
for (; (I = R.exec(
|
|
1128
|
-
D && !ur(
|
|
1127
|
+
for (; (I = R.exec(y)) !== null; )
|
|
1128
|
+
D && !ur(y, I.index, I[0].length) || O.push({
|
|
1129
1129
|
keyword: R,
|
|
1130
1130
|
startIndex: I.index,
|
|
1131
1131
|
endIndex: R.lastIndex
|
|
@@ -1142,7 +1142,7 @@ const Do = (t) => {
|
|
|
1142
1142
|
);
|
|
1143
1143
|
for (const j of Object.values(Z))
|
|
1144
1144
|
if (j.length !== 1 || j[0].char.trim() !== "") {
|
|
1145
|
-
const V = j, ee = g[V[0].spanIdx], X =
|
|
1145
|
+
const V = j, ee = g[V[0].spanIdx], X = T(
|
|
1146
1146
|
u,
|
|
1147
1147
|
z,
|
|
1148
1148
|
ee,
|
|
@@ -1150,13 +1150,13 @@ const Do = (t) => {
|
|
|
1150
1150
|
);
|
|
1151
1151
|
if (X) {
|
|
1152
1152
|
const { left: le, top: ae } = X;
|
|
1153
|
-
if (
|
|
1153
|
+
if (w.find((te) => te.left === le && te.top === ae))
|
|
1154
1154
|
continue;
|
|
1155
|
-
|
|
1155
|
+
w.push({ ...X, highlightColor: G.color });
|
|
1156
1156
|
}
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
|
-
}),
|
|
1159
|
+
}), w.sort(Fr), w;
|
|
1160
1160
|
};
|
|
1161
1161
|
return k(() => {
|
|
1162
1162
|
(async () => {
|
|
@@ -1182,30 +1182,30 @@ const Do = (t) => {
|
|
|
1182
1182
|
f
|
|
1183
1183
|
)) }) });
|
|
1184
1184
|
}, It = $e((t, e) => {
|
|
1185
|
-
const { pageNumber: n, style: o, ...r } = t, { pages: a } = Q(), { rotate: l } = Ge(), { textLayer: c } = or(), { currentZoom: d } = Qe(), p = H(a.get(n)), [m,
|
|
1185
|
+
const { pageNumber: n, style: o, ...r } = t, { pages: a } = Q(), { rotate: l } = Ge(), { textLayer: c } = or(), { currentZoom: d } = Qe(), p = H(a.get(n)), [m, b] = $(!1), h = H(null), [v, _] = $({
|
|
1186
1186
|
width: 0,
|
|
1187
1187
|
height: 0
|
|
1188
1188
|
});
|
|
1189
1189
|
cn(e, () => h.current), k(() => {
|
|
1190
1190
|
if (a && (p.current = a.get(n), p.current)) {
|
|
1191
1191
|
const u = p.current.page.getViewport({ scale: d, rotation: l });
|
|
1192
|
-
|
|
1192
|
+
_(u);
|
|
1193
1193
|
}
|
|
1194
1194
|
}, [a, n, l, d]);
|
|
1195
|
-
const
|
|
1195
|
+
const T = W(() => {
|
|
1196
1196
|
switch (l) {
|
|
1197
1197
|
case 90:
|
|
1198
|
-
return `${
|
|
1198
|
+
return `${v.width / 2}px ${v.width / 2}px`;
|
|
1199
1199
|
case -90:
|
|
1200
1200
|
case 270:
|
|
1201
|
-
return `${
|
|
1201
|
+
return `${v.height / 2}px ${v.height / 2}px`;
|
|
1202
1202
|
default:
|
|
1203
1203
|
return "center";
|
|
1204
1204
|
}
|
|
1205
|
-
}, [l,
|
|
1206
|
-
|
|
1207
|
-
}, []),
|
|
1208
|
-
|
|
1205
|
+
}, [l, v]), P = N(() => {
|
|
1206
|
+
b(!0);
|
|
1207
|
+
}, []), S = N(() => {
|
|
1208
|
+
b(!1);
|
|
1209
1209
|
}, []);
|
|
1210
1210
|
return /* @__PURE__ */ i(
|
|
1211
1211
|
"div",
|
|
@@ -1217,7 +1217,7 @@ const Do = (t) => {
|
|
|
1217
1217
|
style: {
|
|
1218
1218
|
...o,
|
|
1219
1219
|
"--rp-rotate": `${l}deg`,
|
|
1220
|
-
"--rp-page-rotate-translate": `${
|
|
1220
|
+
"--rp-page-rotate-translate": `${T}`,
|
|
1221
1221
|
"--scale-factor": d
|
|
1222
1222
|
},
|
|
1223
1223
|
className: lt["rp-page-wrapper"],
|
|
@@ -1225,15 +1225,15 @@ const Do = (t) => {
|
|
|
1225
1225
|
"div",
|
|
1226
1226
|
{
|
|
1227
1227
|
style: {
|
|
1228
|
-
width: `${
|
|
1229
|
-
height: `${
|
|
1228
|
+
width: `${v.width}px`,
|
|
1229
|
+
height: `${v.height}px`
|
|
1230
1230
|
},
|
|
1231
1231
|
className: lt["rp-page"],
|
|
1232
1232
|
children: [
|
|
1233
|
-
/* @__PURE__ */ i(Io, { onLoading: P, onLoaded:
|
|
1233
|
+
/* @__PURE__ */ i(Io, { onLoading: P, onLoaded: S, pageNumber: n }),
|
|
1234
1234
|
m && /* @__PURE__ */ i("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ i(Ct, {}) }),
|
|
1235
1235
|
c && /* @__PURE__ */ i(Eo, { pageNumber: n }),
|
|
1236
|
-
/* @__PURE__ */ i(zo, { pageNumber: n, viewport:
|
|
1236
|
+
/* @__PURE__ */ i(zo, { pageNumber: n, viewport: v }),
|
|
1237
1237
|
/* @__PURE__ */ i(Do, { pageNumber: n })
|
|
1238
1238
|
]
|
|
1239
1239
|
}
|
|
@@ -1334,12 +1334,12 @@ var Go = 150, qo = function(e) {
|
|
|
1334
1334
|
}, Be = null, Ze = null, je = null;
|
|
1335
1335
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Be = /* @__PURE__ */ new WeakSet(), Ze = /* @__PURE__ */ new WeakSet(), je = /* @__PURE__ */ new WeakSet());
|
|
1336
1336
|
function Uo(t) {
|
|
1337
|
-
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, a = t.getColumnWidth, l = t.getEstimatedTotalHeight, c = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, p = t.getOffsetForRowAndAlignment, m = t.getRowHeight,
|
|
1338
|
-
return e = /* @__PURE__ */ function(
|
|
1339
|
-
Fo(u,
|
|
1337
|
+
var e, n = t.getColumnOffset, o = t.getColumnStartIndexForOffset, r = t.getColumnStopIndexForStartIndex, a = t.getColumnWidth, l = t.getEstimatedTotalHeight, c = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, p = t.getOffsetForRowAndAlignment, m = t.getRowHeight, b = t.getRowOffset, h = t.getRowStartIndexForOffset, v = t.getRowStopIndexForStartIndex, _ = t.initInstanceProps, T = t.shouldResetStyleCacheOnItemSizeChange, P = t.validateProps;
|
|
1338
|
+
return e = /* @__PURE__ */ function(S) {
|
|
1339
|
+
Fo(u, S);
|
|
1340
1340
|
function u(g) {
|
|
1341
1341
|
var s;
|
|
1342
|
-
return s =
|
|
1342
|
+
return s = S.call(this, g) || this, s._instanceProps = _(s.props, qt(s)), s._resetIsScrollingTimeoutId = null, s._outerRef = void 0, s.state = {
|
|
1343
1343
|
instance: qt(s),
|
|
1344
1344
|
isScrolling: !1,
|
|
1345
1345
|
horizontalScrollDirection: "forward",
|
|
@@ -1347,45 +1347,45 @@ function Uo(t) {
|
|
|
1347
1347
|
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1348
1348
|
scrollUpdateWasRequested: !1,
|
|
1349
1349
|
verticalScrollDirection: "forward"
|
|
1350
|
-
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = dt(function(
|
|
1350
|
+
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = dt(function(C, w, y, E, x, L, D, A) {
|
|
1351
1351
|
return s.props.onItemsRendered({
|
|
1352
|
-
overscanColumnStartIndex:
|
|
1353
|
-
overscanColumnStopIndex:
|
|
1354
|
-
overscanRowStartIndex:
|
|
1352
|
+
overscanColumnStartIndex: C,
|
|
1353
|
+
overscanColumnStopIndex: w,
|
|
1354
|
+
overscanRowStartIndex: y,
|
|
1355
1355
|
overscanRowStopIndex: E,
|
|
1356
1356
|
visibleColumnStartIndex: x,
|
|
1357
1357
|
visibleColumnStopIndex: L,
|
|
1358
1358
|
visibleRowStartIndex: D,
|
|
1359
1359
|
visibleRowStopIndex: A
|
|
1360
1360
|
});
|
|
1361
|
-
}), s._callOnScroll = void 0, s._callOnScroll = dt(function(
|
|
1361
|
+
}), s._callOnScroll = void 0, s._callOnScroll = dt(function(C, w, y, E, x) {
|
|
1362
1362
|
return s.props.onScroll({
|
|
1363
|
-
horizontalScrollDirection:
|
|
1364
|
-
scrollLeft:
|
|
1365
|
-
scrollTop:
|
|
1363
|
+
horizontalScrollDirection: y,
|
|
1364
|
+
scrollLeft: C,
|
|
1365
|
+
scrollTop: w,
|
|
1366
1366
|
verticalScrollDirection: E,
|
|
1367
1367
|
scrollUpdateWasRequested: x
|
|
1368
1368
|
});
|
|
1369
|
-
}), s._getItemStyle = void 0, s._getItemStyle = function(
|
|
1370
|
-
var
|
|
1369
|
+
}), s._getItemStyle = void 0, s._getItemStyle = function(C, w) {
|
|
1370
|
+
var y = s.props, E = y.columnWidth, x = y.direction, L = y.rowHeight, D = s._getItemStyleCache(T && E, T && x, T && L), A = C + ":" + w, z;
|
|
1371
1371
|
if (D.hasOwnProperty(A))
|
|
1372
1372
|
z = D[A];
|
|
1373
1373
|
else {
|
|
1374
|
-
var R = n(s.props,
|
|
1374
|
+
var R = n(s.props, w, s._instanceProps), I = x === "rtl";
|
|
1375
1375
|
D[A] = z = {
|
|
1376
1376
|
position: "absolute",
|
|
1377
1377
|
left: I ? void 0 : R,
|
|
1378
1378
|
right: I ? R : void 0,
|
|
1379
|
-
top:
|
|
1380
|
-
height: m(s.props,
|
|
1381
|
-
width: a(s.props,
|
|
1379
|
+
top: b(s.props, C, s._instanceProps),
|
|
1380
|
+
height: m(s.props, C, s._instanceProps),
|
|
1381
|
+
width: a(s.props, w, s._instanceProps)
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
1384
|
return z;
|
|
1385
|
-
}, s._getItemStyleCache = void 0, s._getItemStyleCache = dt(function(
|
|
1385
|
+
}, s._getItemStyleCache = void 0, s._getItemStyleCache = dt(function(C, w, y) {
|
|
1386
1386
|
return {};
|
|
1387
|
-
}), s._onScroll = function(
|
|
1388
|
-
var
|
|
1387
|
+
}), s._onScroll = function(C) {
|
|
1388
|
+
var w = C.currentTarget, y = w.clientHeight, E = w.clientWidth, x = w.scrollLeft, L = w.scrollTop, D = w.scrollHeight, A = w.scrollWidth;
|
|
1389
1389
|
s.setState(function(z) {
|
|
1390
1390
|
if (z.scrollLeft === x && z.scrollTop === L)
|
|
1391
1391
|
return null;
|
|
@@ -1400,7 +1400,7 @@ function Uo(t) {
|
|
|
1400
1400
|
break;
|
|
1401
1401
|
}
|
|
1402
1402
|
I = Math.max(0, Math.min(I, A - E));
|
|
1403
|
-
var O = Math.max(0, Math.min(L, D -
|
|
1403
|
+
var O = Math.max(0, Math.min(L, D - y));
|
|
1404
1404
|
return {
|
|
1405
1405
|
isScrolling: !0,
|
|
1406
1406
|
horizontalScrollDirection: z.scrollLeft < x ? "forward" : "backward",
|
|
@@ -1410,9 +1410,9 @@ function Uo(t) {
|
|
|
1410
1410
|
scrollUpdateWasRequested: !1
|
|
1411
1411
|
};
|
|
1412
1412
|
}, s._resetIsScrollingDebounced);
|
|
1413
|
-
}, s._outerRefSetter = function(
|
|
1414
|
-
var
|
|
1415
|
-
s._outerRef =
|
|
1413
|
+
}, s._outerRefSetter = function(C) {
|
|
1414
|
+
var w = s.props.outerRef;
|
|
1415
|
+
s._outerRef = C, typeof w == "function" ? w(C) : w != null && typeof w == "object" && w.hasOwnProperty("current") && (w.current = C);
|
|
1416
1416
|
}, s._resetIsScrollingDebounced = function() {
|
|
1417
1417
|
s._resetIsScrollingTimeoutId !== null && Zt(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId = Ho(s._resetIsScrolling, Go);
|
|
1418
1418
|
}, s._resetIsScrolling = function() {
|
|
@@ -1423,66 +1423,66 @@ function Uo(t) {
|
|
|
1423
1423
|
});
|
|
1424
1424
|
}, s;
|
|
1425
1425
|
}
|
|
1426
|
-
u.getDerivedStateFromProps = function(s,
|
|
1427
|
-
return Vo(s,
|
|
1426
|
+
u.getDerivedStateFromProps = function(s, C) {
|
|
1427
|
+
return Vo(s, C), P(s), null;
|
|
1428
1428
|
};
|
|
1429
1429
|
var f = u.prototype;
|
|
1430
1430
|
return f.scrollTo = function(s) {
|
|
1431
|
-
var
|
|
1432
|
-
|
|
1433
|
-
return
|
|
1434
|
-
horizontalScrollDirection:
|
|
1435
|
-
scrollLeft:
|
|
1436
|
-
scrollTop:
|
|
1431
|
+
var C = s.scrollLeft, w = s.scrollTop;
|
|
1432
|
+
C !== void 0 && (C = Math.max(0, C)), w !== void 0 && (w = Math.max(0, w)), this.setState(function(y) {
|
|
1433
|
+
return C === void 0 && (C = y.scrollLeft), w === void 0 && (w = y.scrollTop), y.scrollLeft === C && y.scrollTop === w ? null : {
|
|
1434
|
+
horizontalScrollDirection: y.scrollLeft < C ? "forward" : "backward",
|
|
1435
|
+
scrollLeft: C,
|
|
1436
|
+
scrollTop: w,
|
|
1437
1437
|
scrollUpdateWasRequested: !0,
|
|
1438
|
-
verticalScrollDirection:
|
|
1438
|
+
verticalScrollDirection: y.scrollTop < w ? "forward" : "backward"
|
|
1439
1439
|
};
|
|
1440
1440
|
}, this._resetIsScrollingDebounced);
|
|
1441
1441
|
}, f.scrollToItem = function(s) {
|
|
1442
|
-
var
|
|
1443
|
-
|
|
1442
|
+
var C = s.align, w = C === void 0 ? "auto" : C, y = s.columnIndex, E = s.rowIndex, x = this.props, L = x.columnCount, D = x.height, A = x.rowCount, z = x.width, R = this.state, I = R.scrollLeft, O = R.scrollTop, M = $o();
|
|
1443
|
+
y !== void 0 && (y = Math.max(0, Math.min(y, L - 1))), E !== void 0 && (E = Math.max(0, Math.min(E, A - 1)));
|
|
1444
1444
|
var G = l(this.props, this._instanceProps), Z = c(this.props, this._instanceProps), j = Z > z ? M : 0, V = G > D ? M : 0;
|
|
1445
1445
|
this.scrollTo({
|
|
1446
|
-
scrollLeft:
|
|
1447
|
-
scrollTop: E !== void 0 ? p(this.props, E,
|
|
1446
|
+
scrollLeft: y !== void 0 ? d(this.props, y, w, I, this._instanceProps, V) : I,
|
|
1447
|
+
scrollTop: E !== void 0 ? p(this.props, E, w, O, this._instanceProps, j) : O
|
|
1448
1448
|
});
|
|
1449
1449
|
}, f.componentDidMount = function() {
|
|
1450
|
-
var s = this.props,
|
|
1450
|
+
var s = this.props, C = s.initialScrollLeft, w = s.initialScrollTop;
|
|
1451
1451
|
if (this._outerRef != null) {
|
|
1452
|
-
var
|
|
1453
|
-
typeof
|
|
1452
|
+
var y = this._outerRef;
|
|
1453
|
+
typeof C == "number" && (y.scrollLeft = C), typeof w == "number" && (y.scrollTop = w);
|
|
1454
1454
|
}
|
|
1455
1455
|
this._callPropsCallbacks();
|
|
1456
1456
|
}, f.componentDidUpdate = function() {
|
|
1457
|
-
var s = this.props.direction,
|
|
1457
|
+
var s = this.props.direction, C = this.state, w = C.scrollLeft, y = C.scrollTop, E = C.scrollUpdateWasRequested;
|
|
1458
1458
|
if (E && this._outerRef != null) {
|
|
1459
1459
|
var x = this._outerRef;
|
|
1460
1460
|
if (s === "rtl")
|
|
1461
1461
|
switch (jt()) {
|
|
1462
1462
|
case "negative":
|
|
1463
|
-
x.scrollLeft = -
|
|
1463
|
+
x.scrollLeft = -w;
|
|
1464
1464
|
break;
|
|
1465
1465
|
case "positive-ascending":
|
|
1466
|
-
x.scrollLeft =
|
|
1466
|
+
x.scrollLeft = w;
|
|
1467
1467
|
break;
|
|
1468
1468
|
default:
|
|
1469
1469
|
var L = x.clientWidth, D = x.scrollWidth;
|
|
1470
|
-
x.scrollLeft = D - L -
|
|
1470
|
+
x.scrollLeft = D - L - w;
|
|
1471
1471
|
break;
|
|
1472
1472
|
}
|
|
1473
1473
|
else
|
|
1474
|
-
x.scrollLeft = Math.max(0,
|
|
1475
|
-
x.scrollTop = Math.max(0,
|
|
1474
|
+
x.scrollLeft = Math.max(0, w);
|
|
1475
|
+
x.scrollTop = Math.max(0, y);
|
|
1476
1476
|
}
|
|
1477
1477
|
this._callPropsCallbacks();
|
|
1478
1478
|
}, f.componentWillUnmount = function() {
|
|
1479
1479
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1480
1480
|
}, f.render = function() {
|
|
1481
|
-
var s = this.props,
|
|
1482
|
-
if (
|
|
1481
|
+
var s = this.props, C = s.children, w = s.className, y = s.columnCount, E = s.direction, x = s.height, L = s.innerRef, D = s.innerElementType, A = s.innerTagName, z = s.itemData, R = s.itemKey, I = R === void 0 ? qo : R, O = s.outerElementType, M = s.outerTagName, G = s.rowCount, Z = s.style, j = s.useIsScrolling, V = s.width, ee = this.state.isScrolling, X = this._getHorizontalRangeToRender(), le = X[0], ae = X[1], de = this._getVerticalRangeToRender(), te = de[0], Fe = de[1], Ne = [];
|
|
1482
|
+
if (y > 0 && G)
|
|
1483
1483
|
for (var Pe = te; Pe <= Fe; Pe++)
|
|
1484
1484
|
for (var we = le; we <= ae; we++)
|
|
1485
|
-
Ne.push(Ve(
|
|
1485
|
+
Ne.push(Ve(C, {
|
|
1486
1486
|
columnIndex: we,
|
|
1487
1487
|
data: z,
|
|
1488
1488
|
isScrolling: j ? ee : void 0,
|
|
@@ -1496,7 +1496,7 @@ function Uo(t) {
|
|
|
1496
1496
|
}));
|
|
1497
1497
|
var nt = l(this.props, this._instanceProps), rt = c(this.props, this._instanceProps);
|
|
1498
1498
|
return Ve(O || M || "div", {
|
|
1499
|
-
className:
|
|
1499
|
+
className: w,
|
|
1500
1500
|
onScroll: this._onScroll,
|
|
1501
1501
|
ref: this._outerRefSetter,
|
|
1502
1502
|
style: Wr({
|
|
@@ -1518,26 +1518,26 @@ function Uo(t) {
|
|
|
1518
1518
|
}
|
|
1519
1519
|
}));
|
|
1520
1520
|
}, f._callPropsCallbacks = function() {
|
|
1521
|
-
var s = this.props,
|
|
1522
|
-
if (typeof
|
|
1521
|
+
var s = this.props, C = s.columnCount, w = s.onItemsRendered, y = s.onScroll, E = s.rowCount;
|
|
1522
|
+
if (typeof w == "function" && C > 0 && E > 0) {
|
|
1523
1523
|
var x = this._getHorizontalRangeToRender(), L = x[0], D = x[1], A = x[2], z = x[3], R = this._getVerticalRangeToRender(), I = R[0], O = R[1], M = R[2], G = R[3];
|
|
1524
1524
|
this._callOnItemsRendered(L, D, I, O, A, z, M, G);
|
|
1525
1525
|
}
|
|
1526
|
-
if (typeof
|
|
1526
|
+
if (typeof y == "function") {
|
|
1527
1527
|
var Z = this.state, j = Z.horizontalScrollDirection, V = Z.scrollLeft, ee = Z.scrollTop, X = Z.scrollUpdateWasRequested, le = Z.verticalScrollDirection;
|
|
1528
1528
|
this._callOnScroll(V, ee, j, le, X);
|
|
1529
1529
|
}
|
|
1530
1530
|
}, f._getHorizontalRangeToRender = function() {
|
|
1531
|
-
var s = this.props,
|
|
1532
|
-
if (
|
|
1531
|
+
var s = this.props, C = s.columnCount, w = s.overscanColumnCount, y = s.overscanColumnsCount, E = s.overscanCount, x = s.rowCount, L = this.state, D = L.horizontalScrollDirection, A = L.isScrolling, z = L.scrollLeft, R = w || y || E || 1;
|
|
1532
|
+
if (C === 0 || x === 0)
|
|
1533
1533
|
return [0, 0, 0, 0];
|
|
1534
1534
|
var I = o(this.props, z, this._instanceProps), O = r(this.props, I, z, this._instanceProps), M = !A || D === "backward" ? Math.max(1, R) : 1, G = !A || D === "forward" ? Math.max(1, R) : 1;
|
|
1535
|
-
return [Math.max(0, I - M), Math.max(0, Math.min(
|
|
1535
|
+
return [Math.max(0, I - M), Math.max(0, Math.min(C - 1, O + G)), I, O];
|
|
1536
1536
|
}, f._getVerticalRangeToRender = function() {
|
|
1537
|
-
var s = this.props,
|
|
1538
|
-
if (
|
|
1537
|
+
var s = this.props, C = s.columnCount, w = s.overscanCount, y = s.overscanRowCount, E = s.overscanRowsCount, x = s.rowCount, L = this.state, D = L.isScrolling, A = L.verticalScrollDirection, z = L.scrollTop, R = y || E || w || 1;
|
|
1538
|
+
if (C === 0 || x === 0)
|
|
1539
1539
|
return [0, 0, 0, 0];
|
|
1540
|
-
var I = h(this.props, z, this._instanceProps), O =
|
|
1540
|
+
var I = h(this.props, z, this._instanceProps), O = v(this.props, I, z, this._instanceProps), M = !D || A === "backward" ? Math.max(1, R) : 1, G = !D || A === "forward" ? Math.max(1, R) : 1;
|
|
1541
1541
|
return [Math.max(0, I - M), Math.max(0, Math.min(x - 1, O + G)), I, O];
|
|
1542
1542
|
}, u;
|
|
1543
1543
|
}(Qn), e.defaultProps = {
|
|
@@ -1547,7 +1547,7 @@ function Uo(t) {
|
|
|
1547
1547
|
}, e;
|
|
1548
1548
|
}
|
|
1549
1549
|
var Vo = function(e, n) {
|
|
1550
|
-
var o = e.children, r = e.direction, a = e.height, l = e.innerTagName, c = e.outerTagName, d = e.overscanColumnsCount, p = e.overscanCount, m = e.overscanRowsCount,
|
|
1550
|
+
var o = e.children, r = e.direction, a = e.height, l = e.innerTagName, c = e.outerTagName, d = e.overscanColumnsCount, p = e.overscanCount, m = e.overscanRowsCount, b = e.width, h = n.instance;
|
|
1551
1551
|
if (process.env.NODE_ENV !== "production") {
|
|
1552
1552
|
if (typeof p == "number" && Be && !Be.has(h) && (Be.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof m == "number") && Ze && !Ze.has(h) && (Ze.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (l != null || c != null) && je && !je.has(h) && (je.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1553
1553
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
@@ -1558,8 +1558,8 @@ var Vo = function(e, n) {
|
|
|
1558
1558
|
default:
|
|
1559
1559
|
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + r + '" was specified.'));
|
|
1560
1560
|
}
|
|
1561
|
-
if (typeof
|
|
1562
|
-
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (
|
|
1561
|
+
if (typeof b != "number")
|
|
1562
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (b === null ? "null" : typeof b) + '" was specified.'));
|
|
1563
1563
|
if (typeof a != "number")
|
|
1564
1564
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
|
|
1565
1565
|
}
|
|
@@ -1588,11 +1588,11 @@ var Vo = function(e, n) {
|
|
|
1588
1588
|
d = p.offset + p.size;
|
|
1589
1589
|
}
|
|
1590
1590
|
for (var m = c + 1; m <= o; m++) {
|
|
1591
|
-
var
|
|
1591
|
+
var b = l(m);
|
|
1592
1592
|
a[m] = {
|
|
1593
1593
|
offset: d,
|
|
1594
|
-
size:
|
|
1595
|
-
}, d +=
|
|
1594
|
+
size: b
|
|
1595
|
+
}, d += b;
|
|
1596
1596
|
}
|
|
1597
1597
|
e === "column" ? r.lastMeasuredColumnIndex = o : r.lastMeasuredRowIndex = o;
|
|
1598
1598
|
}
|
|
@@ -1615,17 +1615,17 @@ var Vo = function(e, n) {
|
|
|
1615
1615
|
r += c, c *= 2;
|
|
1616
1616
|
return xn(e, n, o, Math.min(r, l - 1), Math.floor(r / 2), a);
|
|
1617
1617
|
}, Yt = function(e, n, o, r, a, l, c) {
|
|
1618
|
-
var d = e === "column" ? n.width : n.height, p = fe(e, n, o, l), m = e === "column" ? yn(n, l) : Sn(n, l),
|
|
1619
|
-
switch (r === "smart" && (a >= h - d && a <=
|
|
1618
|
+
var d = e === "column" ? n.width : n.height, p = fe(e, n, o, l), m = e === "column" ? yn(n, l) : Sn(n, l), b = Math.max(0, Math.min(m - d, p.offset)), h = Math.max(0, p.offset - d + c + p.size);
|
|
1619
|
+
switch (r === "smart" && (a >= h - d && a <= b + d ? r = "auto" : r = "center"), r) {
|
|
1620
1620
|
case "start":
|
|
1621
|
-
return
|
|
1621
|
+
return b;
|
|
1622
1622
|
case "end":
|
|
1623
1623
|
return h;
|
|
1624
1624
|
case "center":
|
|
1625
|
-
return Math.round(h + (
|
|
1625
|
+
return Math.round(h + (b - h) / 2);
|
|
1626
1626
|
case "auto":
|
|
1627
1627
|
default:
|
|
1628
|
-
return a >= h && a <=
|
|
1628
|
+
return a >= h && a <= b ? a : h > b || a < h ? h : b;
|
|
1629
1629
|
}
|
|
1630
1630
|
}, Zo = /* @__PURE__ */ Uo({
|
|
1631
1631
|
getColumnOffset: function(e, n, o) {
|
|
@@ -1684,8 +1684,8 @@ var Vo = function(e, n) {
|
|
|
1684
1684
|
shouldForceUpdate: d
|
|
1685
1685
|
});
|
|
1686
1686
|
}, n.resetAfterIndices = function(c) {
|
|
1687
|
-
var d = c.columnIndex, p = c.rowIndex, m = c.shouldForceUpdate,
|
|
1688
|
-
typeof d == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, d - 1)), typeof p == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, p - 1)), n._getItemStyleCache(-1),
|
|
1687
|
+
var d = c.columnIndex, p = c.rowIndex, m = c.shouldForceUpdate, b = m === void 0 ? !0 : m;
|
|
1688
|
+
typeof d == "number" && (l.lastMeasuredColumnIndex = Math.min(l.lastMeasuredColumnIndex, d - 1)), typeof p == "number" && (l.lastMeasuredRowIndex = Math.min(l.lastMeasuredRowIndex, p - 1)), n._getItemStyleCache(-1), b && n.forceUpdate();
|
|
1689
1689
|
}, l;
|
|
1690
1690
|
},
|
|
1691
1691
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
@@ -1715,30 +1715,30 @@ function Xo(t, e) {
|
|
|
1715
1715
|
return !Jt(n, r) && !Jt(o, a);
|
|
1716
1716
|
}
|
|
1717
1717
|
const Yo = () => {
|
|
1718
|
-
const { viewMode: t } = Ee(), { scrollMode: e } = Re(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = qe(), a = W(() => r.heights.length, [r.heights]), l = W(() => e === J.HORIZONTAL_SCROLLING ? a : t === Ie.DUAL_PAGE ? 2 : 1, [t, e, e, a, o]), c = W(() => r.widths.reduce((
|
|
1719
|
-
const
|
|
1720
|
-
return (!
|
|
1718
|
+
const { viewMode: t } = Ee(), { scrollMode: e } = Re(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = qe(), a = W(() => r.heights.length, [r.heights]), l = W(() => e === J.HORIZONTAL_SCROLLING ? a : t === Ie.DUAL_PAGE ? 2 : 1, [t, e, e, a, o]), c = W(() => r.widths.reduce((_, T, P) => {
|
|
1719
|
+
const S = P % l;
|
|
1720
|
+
return (!_[S] || T > _[S]) && (_[S] = T), _;
|
|
1721
1721
|
}, []), [r.widths, l]), d = N(
|
|
1722
|
-
(
|
|
1723
|
-
const
|
|
1724
|
-
return c[
|
|
1722
|
+
(v) => {
|
|
1723
|
+
const _ = v % c.length;
|
|
1724
|
+
return c[_] || 0;
|
|
1725
1725
|
},
|
|
1726
1726
|
[c]
|
|
1727
1727
|
), p = N(
|
|
1728
|
-
(
|
|
1728
|
+
(v) => r.heights[v] || 0,
|
|
1729
1729
|
[r.heights]
|
|
1730
1730
|
);
|
|
1731
1731
|
k(() => {
|
|
1732
1732
|
n(l);
|
|
1733
1733
|
}, [l, n]);
|
|
1734
|
-
const m = W(() => e === J.HORIZONTAL_SCROLLING || e === J.PAGE_SCROLLING ? 1 : Math.round(a / l), [l, a, e]),
|
|
1734
|
+
const m = W(() => e === J.HORIZONTAL_SCROLLING || e === J.PAGE_SCROLLING ? 1 : Math.round(a / l), [l, a, e]), b = W(() => r.heights.reduce((v, _) => v + _, 0) / r.heights.length || 0, [r]), h = W(() => r.widths.reduce((v, _) => v + _, 0) / r.heights.length || 0, [r]);
|
|
1735
1735
|
return {
|
|
1736
1736
|
rowCount: m,
|
|
1737
1737
|
rowHeight: p,
|
|
1738
1738
|
columnCount: l,
|
|
1739
1739
|
columnWidth: d,
|
|
1740
1740
|
pageDimension: r,
|
|
1741
|
-
estimatedRowHeight:
|
|
1741
|
+
estimatedRowHeight: b,
|
|
1742
1742
|
estimatedColumnWidth: h
|
|
1743
1743
|
};
|
|
1744
1744
|
};
|
|
@@ -1762,65 +1762,65 @@ function Jo(t) {
|
|
|
1762
1762
|
let e, n, o, r, a, l, c;
|
|
1763
1763
|
const d = typeof document < "u" && document.attachEvent;
|
|
1764
1764
|
if (!d) {
|
|
1765
|
-
l = function(
|
|
1766
|
-
const u =
|
|
1765
|
+
l = function(S) {
|
|
1766
|
+
const u = S.__resizeTriggers__, f = u.firstElementChild, g = u.lastElementChild, s = f.firstElementChild;
|
|
1767
1767
|
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, s.style.width = f.offsetWidth + 1 + "px", s.style.height = f.offsetHeight + 1 + "px", f.scrollLeft = f.scrollWidth, f.scrollTop = f.scrollHeight;
|
|
1768
|
-
}, a = function(
|
|
1769
|
-
return
|
|
1770
|
-
}, c = function(
|
|
1771
|
-
if (
|
|
1768
|
+
}, a = function(S) {
|
|
1769
|
+
return S.offsetWidth !== S.__resizeLast__.width || S.offsetHeight !== S.__resizeLast__.height;
|
|
1770
|
+
}, c = function(S) {
|
|
1771
|
+
if (S.target.className && typeof S.target.className.indexOf == "function" && S.target.className.indexOf("contract-trigger") < 0 && S.target.className.indexOf("expand-trigger") < 0)
|
|
1772
1772
|
return;
|
|
1773
1773
|
const u = this;
|
|
1774
1774
|
l(this), this.__resizeRAF__ && _t(this.__resizeRAF__), this.__resizeRAF__ = bt(function() {
|
|
1775
1775
|
a(u) && (u.__resizeLast__.width = u.offsetWidth, u.__resizeLast__.height = u.offsetHeight, u.__resizeListeners__.forEach(function(s) {
|
|
1776
|
-
s.call(u,
|
|
1776
|
+
s.call(u, S);
|
|
1777
1777
|
}));
|
|
1778
1778
|
});
|
|
1779
1779
|
};
|
|
1780
|
-
let h = !1,
|
|
1780
|
+
let h = !1, v = "";
|
|
1781
1781
|
o = "animationstart";
|
|
1782
|
-
const
|
|
1783
|
-
let
|
|
1782
|
+
const _ = "Webkit Moz O ms".split(" ");
|
|
1783
|
+
let T = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), P = "";
|
|
1784
1784
|
{
|
|
1785
|
-
const
|
|
1786
|
-
if (
|
|
1787
|
-
for (let u = 0; u <
|
|
1788
|
-
if (
|
|
1789
|
-
P =
|
|
1785
|
+
const S = document.createElement("fakeelement");
|
|
1786
|
+
if (S.style.animationName !== void 0 && (h = !0), h === !1) {
|
|
1787
|
+
for (let u = 0; u < _.length; u++)
|
|
1788
|
+
if (S.style[_[u] + "AnimationName"] !== void 0) {
|
|
1789
|
+
P = _[u], v = "-" + P.toLowerCase() + "-", o = T[u], h = !0;
|
|
1790
1790
|
break;
|
|
1791
1791
|
}
|
|
1792
1792
|
}
|
|
1793
1793
|
}
|
|
1794
|
-
n = "resizeanim", e = "@" +
|
|
1794
|
+
n = "resizeanim", e = "@" + v + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = v + "animation: 1ms " + n + "; ";
|
|
1795
1795
|
}
|
|
1796
1796
|
const p = function(h) {
|
|
1797
1797
|
if (!h.getElementById("detectElementResize")) {
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1798
|
+
const v = (e || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', _ = h.head || h.getElementsByTagName("head")[0], T = h.createElement("style");
|
|
1799
|
+
T.id = "detectElementResize", T.type = "text/css", t != null && T.setAttribute("nonce", t), T.styleSheet ? T.styleSheet.cssText = v : T.appendChild(h.createTextNode(v)), _.appendChild(T);
|
|
1800
1800
|
}
|
|
1801
1801
|
};
|
|
1802
1802
|
return {
|
|
1803
|
-
addResizeListener: function(h,
|
|
1803
|
+
addResizeListener: function(h, v) {
|
|
1804
1804
|
if (d)
|
|
1805
|
-
h.attachEvent("onresize",
|
|
1805
|
+
h.attachEvent("onresize", v);
|
|
1806
1806
|
else {
|
|
1807
1807
|
if (!h.__resizeTriggers__) {
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1810
|
-
const P =
|
|
1811
|
-
P.className = "expand-trigger", P.appendChild(
|
|
1812
|
-
const
|
|
1813
|
-
|
|
1808
|
+
const _ = h.ownerDocument, T = oe.getComputedStyle(h);
|
|
1809
|
+
T && T.position === "static" && (h.style.position = "relative"), p(_), h.__resizeLast__ = {}, h.__resizeListeners__ = [], (h.__resizeTriggers__ = _.createElement("div")).className = "resize-triggers";
|
|
1810
|
+
const P = _.createElement("div");
|
|
1811
|
+
P.className = "expand-trigger", P.appendChild(_.createElement("div"));
|
|
1812
|
+
const S = _.createElement("div");
|
|
1813
|
+
S.className = "contract-trigger", h.__resizeTriggers__.appendChild(P), h.__resizeTriggers__.appendChild(S), h.appendChild(h.__resizeTriggers__), l(h), h.addEventListener("scroll", c, !0), o && (h.__resizeTriggers__.__animationListener__ = function(f) {
|
|
1814
1814
|
f.animationName === n && l(h);
|
|
1815
1815
|
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1816
1816
|
}
|
|
1817
|
-
h.__resizeListeners__.push(
|
|
1817
|
+
h.__resizeListeners__.push(v);
|
|
1818
1818
|
}
|
|
1819
1819
|
},
|
|
1820
|
-
removeResizeListener: function(h,
|
|
1820
|
+
removeResizeListener: function(h, v) {
|
|
1821
1821
|
if (d)
|
|
1822
|
-
h.detachEvent("onresize",
|
|
1823
|
-
else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(
|
|
1822
|
+
h.detachEvent("onresize", v);
|
|
1823
|
+
else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(v), 1), !h.__resizeListeners__.length) {
|
|
1824
1824
|
h.removeEventListener("scroll", c, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(o, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
|
|
1825
1825
|
try {
|
|
1826
1826
|
h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
|
|
@@ -1845,17 +1845,17 @@ class Qo extends er {
|
|
|
1845
1845
|
onResize: r
|
|
1846
1846
|
} = this.props;
|
|
1847
1847
|
if (this._parentNode) {
|
|
1848
|
-
const a = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(a.paddingLeft || "0"), c = parseFloat(a.paddingRight || "0"), d = parseFloat(a.paddingTop || "0"), p = parseFloat(a.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(),
|
|
1849
|
-
(!n && (this.state.height !==
|
|
1850
|
-
height:
|
|
1851
|
-
width:
|
|
1852
|
-
scaledHeight:
|
|
1848
|
+
const a = window.getComputedStyle(this._parentNode) || {}, l = parseFloat(a.paddingLeft || "0"), c = parseFloat(a.paddingRight || "0"), d = parseFloat(a.paddingTop || "0"), p = parseFloat(a.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), b = m.height - d - p, h = m.width - l - c, v = this._parentNode.offsetHeight - d - p, _ = this._parentNode.offsetWidth - l - c;
|
|
1849
|
+
(!n && (this.state.height !== v || this.state.scaledHeight !== b) || !o && (this.state.width !== _ || this.state.scaledWidth !== h)) && (this.setState({
|
|
1850
|
+
height: v,
|
|
1851
|
+
width: _,
|
|
1852
|
+
scaledHeight: b,
|
|
1853
1853
|
scaledWidth: h
|
|
1854
1854
|
}), typeof r == "function" && r({
|
|
1855
|
-
height:
|
|
1856
|
-
scaledHeight:
|
|
1855
|
+
height: v,
|
|
1856
|
+
scaledHeight: b,
|
|
1857
1857
|
scaledWidth: h,
|
|
1858
|
-
width:
|
|
1858
|
+
width: _
|
|
1859
1859
|
}));
|
|
1860
1860
|
}
|
|
1861
1861
|
}, this._setRef = (n) => {
|
|
@@ -1889,24 +1889,24 @@ class Qo extends er {
|
|
|
1889
1889
|
onResize: d,
|
|
1890
1890
|
style: p = {},
|
|
1891
1891
|
tagName: m = "div",
|
|
1892
|
-
...
|
|
1892
|
+
...b
|
|
1893
1893
|
} = this.props, {
|
|
1894
1894
|
height: h,
|
|
1895
|
-
scaledHeight:
|
|
1896
|
-
scaledWidth:
|
|
1897
|
-
width:
|
|
1895
|
+
scaledHeight: v,
|
|
1896
|
+
scaledWidth: _,
|
|
1897
|
+
width: T
|
|
1898
1898
|
} = this.state, P = {
|
|
1899
1899
|
overflow: "visible"
|
|
1900
|
-
},
|
|
1900
|
+
}, S = {};
|
|
1901
1901
|
let u = !1;
|
|
1902
|
-
return r || (h === 0 && (u = !0), P.height = 0,
|
|
1902
|
+
return r || (h === 0 && (u = !0), P.height = 0, S.height = h, S.scaledHeight = v), a || (T === 0 && (u = !0), P.width = 0, S.width = T, S.scaledWidth = _), l && (u = !1), Ve(m, {
|
|
1903
1903
|
ref: this._setRef,
|
|
1904
1904
|
style: {
|
|
1905
1905
|
...P,
|
|
1906
1906
|
...p
|
|
1907
1907
|
},
|
|
1908
|
-
...
|
|
1909
|
-
}, !u && e(
|
|
1908
|
+
...b
|
|
1909
|
+
}, !u && e(S));
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
1912
|
const ei = ln(({ widths: t, heights: e }) => {
|
|
@@ -1918,19 +1918,19 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
1918
1918
|
}
|
|
1919
1919
|
return c;
|
|
1920
1920
|
}, [n, o]), a = W(() => {
|
|
1921
|
-
const c = t(n - 1), d = e(n - 1), p = t(n), m = e(n),
|
|
1921
|
+
const c = t(n - 1), d = e(n - 1), p = t(n), m = e(n), b = d > m ? d : m, h = d < m ? d : m, v = b / 2 - h / 2;
|
|
1922
1922
|
return [
|
|
1923
1923
|
{
|
|
1924
1924
|
position: "absolute",
|
|
1925
1925
|
left: 0,
|
|
1926
|
-
top:
|
|
1926
|
+
top: b === d ? 0 : v,
|
|
1927
1927
|
width: c,
|
|
1928
1928
|
height: d
|
|
1929
1929
|
},
|
|
1930
1930
|
{
|
|
1931
1931
|
position: "absolute",
|
|
1932
1932
|
left: c,
|
|
1933
|
-
top:
|
|
1933
|
+
top: b === m ? 0 : v,
|
|
1934
1934
|
width: p,
|
|
1935
1935
|
height: m
|
|
1936
1936
|
}
|
|
@@ -1954,13 +1954,13 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
1954
1954
|
}
|
|
1955
1955
|
);
|
|
1956
1956
|
}, ni = (t, e, n) => {
|
|
1957
|
-
const o = H(), { contentRef: r } = ge(), { heights: a, widths: l } = qe(), { setFocusedPage: c } = ie(), [d, p] = $([]), { targetScrollPage: m } = pn(),
|
|
1958
|
-
const P = l[
|
|
1957
|
+
const o = H(), { contentRef: r } = ge(), { heights: a, widths: l } = qe(), { setFocusedPage: c } = ie(), [d, p] = $([]), { targetScrollPage: m } = pn(), b = Pt(d, 0, 500), h = W(() => a.map((_, T) => {
|
|
1958
|
+
const P = l[T], S = Ur(T + 1, t), u = P * S.columnIndex, f = _ * S.rowIndex, g = u + P, s = f + _;
|
|
1959
1959
|
return {
|
|
1960
|
-
pageNumber:
|
|
1961
|
-
...
|
|
1960
|
+
pageNumber: T + 1,
|
|
1961
|
+
...S,
|
|
1962
1962
|
width: P,
|
|
1963
|
-
height:
|
|
1963
|
+
height: _,
|
|
1964
1964
|
startX: u,
|
|
1965
1965
|
startY: f,
|
|
1966
1966
|
endX: g,
|
|
@@ -1968,42 +1968,42 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
1968
1968
|
};
|
|
1969
1969
|
}), [a, l, t, e]);
|
|
1970
1970
|
k(() => {
|
|
1971
|
-
var
|
|
1972
|
-
|
|
1973
|
-
let
|
|
1974
|
-
|
|
1971
|
+
var T;
|
|
1972
|
+
b.length > 0 && !m.current && c(b[0].pageNumber);
|
|
1973
|
+
let _ = (T = b[0]) == null ? void 0 : T.ratio;
|
|
1974
|
+
_ && b.filter((P) => Math.round(P.ratio) === Math.round(_)).some((P) => P.pageNumber === m.current) && setTimeout(() => {
|
|
1975
1975
|
m.current = void 0;
|
|
1976
1976
|
}, 500);
|
|
1977
|
-
}, [
|
|
1978
|
-
const
|
|
1979
|
-
(
|
|
1977
|
+
}, [b, c]);
|
|
1978
|
+
const v = N(
|
|
1979
|
+
(_) => {
|
|
1980
1980
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
1981
|
-
const
|
|
1982
|
-
startTop:
|
|
1983
|
-
startLeft:
|
|
1984
|
-
endTop:
|
|
1985
|
-
endLeft:
|
|
1986
|
-
},
|
|
1981
|
+
const T = _.target, P = {
|
|
1982
|
+
startTop: T.scrollTop,
|
|
1983
|
+
startLeft: T.scrollLeft,
|
|
1984
|
+
endTop: T.scrollTop + T.clientHeight,
|
|
1985
|
+
endLeft: T.scrollLeft + T.clientWidth
|
|
1986
|
+
}, S = h.filter((u) => {
|
|
1987
1987
|
const f = u.endX >= P.startLeft && u.endY >= P.startTop, g = u.startX <= P.endLeft && u.startY <= P.endTop;
|
|
1988
1988
|
return f && g;
|
|
1989
1989
|
}).map((u) => {
|
|
1990
|
-
const f = P.startLeft > u.startX ? P.startLeft : u.startX, g = P.startTop > u.startY ? P.startTop : u.startY, s = P.endLeft < u.endX ? P.endLeft : u.endX,
|
|
1990
|
+
const f = P.startLeft > u.startX ? P.startLeft : u.startX, g = P.startTop > u.startY ? P.startTop : u.startY, s = P.endLeft < u.endX ? P.endLeft : u.endX, C = P.endTop < u.endY ? P.endTop : u.endY, w = s - f, y = C - g, x = +(w * y / (u.width * u.height) * 100).toFixed(2);
|
|
1991
1991
|
return {
|
|
1992
1992
|
pageNumber: u.pageNumber,
|
|
1993
1993
|
ratio: x
|
|
1994
1994
|
};
|
|
1995
1995
|
}).sort((u, f) => f.ratio - u.ratio);
|
|
1996
|
-
p(
|
|
1996
|
+
p(S);
|
|
1997
1997
|
});
|
|
1998
1998
|
},
|
|
1999
1999
|
[r, h]
|
|
2000
2000
|
);
|
|
2001
2001
|
k(() => {
|
|
2002
2002
|
if (n)
|
|
2003
|
-
return n == null || n.addEventListener("scroll",
|
|
2004
|
-
n == null || n.removeEventListener("scroll",
|
|
2003
|
+
return n == null || n.addEventListener("scroll", v), () => {
|
|
2004
|
+
n == null || n.removeEventListener("scroll", v);
|
|
2005
2005
|
};
|
|
2006
|
-
}, [n,
|
|
2006
|
+
}, [n, v]);
|
|
2007
2007
|
}, ri = ln(({ columnIndex: t, rowIndex: e, data: n, style: o }) => {
|
|
2008
2008
|
const r = Vr(e, t, n.columnCount);
|
|
2009
2009
|
return /* @__PURE__ */ i(It, { style: o, pageNumber: r }, r);
|
|
@@ -2014,10 +2014,10 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2014
2014
|
getPageScrollElementRef: d,
|
|
2015
2015
|
getVirtualScrollableElementRef: p,
|
|
2016
2016
|
setTotalInnerDimensions: m,
|
|
2017
|
-
virtualScrollableElementRef:
|
|
2017
|
+
virtualScrollableElementRef: b,
|
|
2018
2018
|
totalInnerDimensions: h,
|
|
2019
|
-
pageScrollElementRef:
|
|
2020
|
-
} = et(),
|
|
2019
|
+
pageScrollElementRef: v
|
|
2020
|
+
} = et(), _ = H(!0), { nextPage: T, prevPage: P, setFocusedPage: S, focusedPage: u } = ie(), { scrollMode: f } = Re(), { viewMode: g } = Ee(), s = H(null), { loading: C } = Q(), { passwordRequired: w } = nr(), { LoaderImageComponent: y } = hn(), E = H(
|
|
2021
2021
|
h
|
|
2022
2022
|
), x = H({
|
|
2023
2023
|
viewMode: g,
|
|
@@ -2031,7 +2031,7 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2031
2031
|
estimatedColumnWidth: G,
|
|
2032
2032
|
estimatedRowHeight: Z
|
|
2033
2033
|
} = Yo(), j = Pt(h, 100), V = H();
|
|
2034
|
-
ni(O, R,
|
|
2034
|
+
ni(O, R, b);
|
|
2035
2035
|
const ee = H({
|
|
2036
2036
|
scrollTop: 0,
|
|
2037
2037
|
scrollLeft: 0
|
|
@@ -2044,9 +2044,9 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2044
2044
|
}), [O]), Ne = N(
|
|
2045
2045
|
(q) => {
|
|
2046
2046
|
const U = document.activeElement !== o;
|
|
2047
|
-
!A && U || (["ArrowUp", "ArrowLeft"].includes(q.key) ? (q.preventDefault(), P()) : ["ArrowDown", "ArrowRight"].includes(q.key) && (q.preventDefault(),
|
|
2047
|
+
!A && U || (["ArrowUp", "ArrowLeft"].includes(q.key) ? (q.preventDefault(), P()) : ["ArrowDown", "ArrowRight"].includes(q.key) && (q.preventDefault(), T()));
|
|
2048
2048
|
},
|
|
2049
|
-
[
|
|
2049
|
+
[T, P, A, f]
|
|
2050
2050
|
);
|
|
2051
2051
|
k(() => (window.addEventListener("keydown", Ne), () => {
|
|
2052
2052
|
window.removeEventListener("keydown", Ne);
|
|
@@ -2062,15 +2062,15 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2062
2062
|
}, [R, O, z, l]);
|
|
2063
2063
|
const Pe = N(
|
|
2064
2064
|
(q, U) => {
|
|
2065
|
-
if (!
|
|
2065
|
+
if (!b)
|
|
2066
2066
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
2067
2067
|
const Te = ee.current.scrollTop > U, Se = ee.current.scrollLeft > q;
|
|
2068
2068
|
return Te || Se ? ee.current : {
|
|
2069
|
-
scrollTop:
|
|
2070
|
-
scrollLeft:
|
|
2069
|
+
scrollTop: b.scrollTop,
|
|
2070
|
+
scrollLeft: b.scrollLeft
|
|
2071
2071
|
};
|
|
2072
2072
|
},
|
|
2073
|
-
[
|
|
2073
|
+
[b]
|
|
2074
2074
|
), we = N(
|
|
2075
2075
|
(q, U) => {
|
|
2076
2076
|
if (x.current.viewMode !== g || x.current.scrollMode !== f) {
|
|
@@ -2124,7 +2124,7 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2124
2124
|
scrollLeft: q.scrollLeft
|
|
2125
2125
|
};
|
|
2126
2126
|
},
|
|
2127
|
-
[
|
|
2127
|
+
[b]
|
|
2128
2128
|
);
|
|
2129
2129
|
k(() => () => {
|
|
2130
2130
|
V.current && clearTimeout(V.current);
|
|
@@ -2142,20 +2142,20 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2142
2142
|
[te, ae, ue]
|
|
2143
2143
|
);
|
|
2144
2144
|
return k(() => {
|
|
2145
|
-
|
|
2146
|
-
}, [
|
|
2147
|
-
if (!(j.height === 0 || !
|
|
2145
|
+
C && de();
|
|
2146
|
+
}, [C]), k(() => {
|
|
2147
|
+
if (!(j.height === 0 || !_.current)) {
|
|
2148
2148
|
if (e === J.PAGE_SCROLLING) {
|
|
2149
|
-
t !== u &&
|
|
2149
|
+
t !== u && v && S(t), _.current = !1;
|
|
2150
2150
|
return;
|
|
2151
2151
|
}
|
|
2152
|
-
a(t, "auto"),
|
|
2152
|
+
a(t, "auto"), S(t), _.current = !1;
|
|
2153
2153
|
}
|
|
2154
2154
|
}, [
|
|
2155
2155
|
a,
|
|
2156
2156
|
e,
|
|
2157
|
-
|
|
2158
|
-
|
|
2157
|
+
v,
|
|
2158
|
+
S,
|
|
2159
2159
|
j
|
|
2160
2160
|
]), /* @__PURE__ */ F(me, { children: [
|
|
2161
2161
|
/* @__PURE__ */ i("div", { id: n, ref: r, tabIndex: -1, className: rt, children: /* @__PURE__ */ i(Qo, { style: { minHeight: "50px" }, children: ({ width: q, height: U }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: jn, style: { width: q, height: U }, children: f === J.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
@@ -2188,7 +2188,7 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2188
2188
|
),
|
|
2189
2189
|
children: ri
|
|
2190
2190
|
}
|
|
2191
|
-
) :
|
|
2191
|
+
) : C ? null : /* @__PURE__ */ i(
|
|
2192
2192
|
"div",
|
|
2193
2193
|
{
|
|
2194
2194
|
className: ue["rp-loader"],
|
|
@@ -2199,10 +2199,10 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2199
2199
|
height: "100%",
|
|
2200
2200
|
width: "100%"
|
|
2201
2201
|
},
|
|
2202
|
-
children:
|
|
2202
|
+
children: y && /* @__PURE__ */ i(y, {})
|
|
2203
2203
|
}
|
|
2204
2204
|
) }) }) }),
|
|
2205
|
-
|
|
2205
|
+
w && /* @__PURE__ */ i(qr, {})
|
|
2206
2206
|
] });
|
|
2207
2207
|
}, ke = {
|
|
2208
2208
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
@@ -2221,24 +2221,24 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2221
2221
|
const { nextIcon: t } = pe();
|
|
2222
2222
|
return t || /* @__PURE__ */ i(He, { style: { transform: "rotate(180deg" } });
|
|
2223
2223
|
}, ai = () => {
|
|
2224
|
-
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [l, c] = $(t.toString()), { pageNavigationTool: d = !0 } = ve(), { isSmallScreen: p } = Ce(), { localeMessages: m } = se(), { viewMode:
|
|
2224
|
+
const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [l, c] = $(t.toString()), { pageNavigationTool: d = !0 } = ve(), { isSmallScreen: p } = Ce(), { localeMessages: m } = se(), { viewMode: b } = Ee(), { scrollMode: h } = Re();
|
|
2225
2225
|
k(() => {
|
|
2226
2226
|
c(t.toString());
|
|
2227
2227
|
}, [t]);
|
|
2228
|
-
const
|
|
2228
|
+
const v = N((u) => {
|
|
2229
2229
|
const f = u.target.value;
|
|
2230
2230
|
c(f);
|
|
2231
|
-
}, []),
|
|
2231
|
+
}, []), _ = N(async () => {
|
|
2232
2232
|
const u = a(l);
|
|
2233
2233
|
u.success || c(u.currentPage.toString());
|
|
2234
|
-
}, [a, l, e]),
|
|
2234
|
+
}, [a, l, e]), T = N(() => {
|
|
2235
2235
|
c(t.toString());
|
|
2236
2236
|
}, [t]), P = N(
|
|
2237
2237
|
(u) => {
|
|
2238
|
-
u.key === "Enter" &&
|
|
2238
|
+
u.key === "Enter" && _();
|
|
2239
2239
|
},
|
|
2240
|
-
[
|
|
2241
|
-
),
|
|
2240
|
+
[_]
|
|
2241
|
+
), S = W(() => b === Ie.DUAL_PAGE && h === J.PAGE_SCROLLING ? t === e - 1 : t === e, [t, e, b, h]);
|
|
2242
2242
|
return typeof d != "boolean" ? /* @__PURE__ */ i(
|
|
2243
2243
|
d,
|
|
2244
2244
|
{
|
|
@@ -2263,8 +2263,8 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2263
2263
|
dn,
|
|
2264
2264
|
{
|
|
2265
2265
|
onKeyDown: P,
|
|
2266
|
-
onBlur:
|
|
2267
|
-
onChange:
|
|
2266
|
+
onBlur: T,
|
|
2267
|
+
onChange: v,
|
|
2268
2268
|
value: l,
|
|
2269
2269
|
className: ft["rp-page-input"]
|
|
2270
2270
|
}
|
|
@@ -2278,7 +2278,7 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2278
2278
|
{
|
|
2279
2279
|
onClick: o,
|
|
2280
2280
|
"aria-label": m == null ? void 0 : m.nextPageTooltip,
|
|
2281
|
-
"aria-disabled":
|
|
2281
|
+
"aria-disabled": S,
|
|
2282
2282
|
children: /* @__PURE__ */ i(ii, {})
|
|
2283
2283
|
}
|
|
2284
2284
|
) })
|
|
@@ -2308,7 +2308,7 @@ var Lt = "Dialog", [In, Us] = Xr(Lt), [si, ce] = In(Lt), Ln = (t) => {
|
|
|
2308
2308
|
descriptionId: ct(),
|
|
2309
2309
|
open: p,
|
|
2310
2310
|
onOpenChange: m,
|
|
2311
|
-
onOpenToggle: B.useCallback(() => m((
|
|
2311
|
+
onOpenToggle: B.useCallback(() => m((b) => !b), [m]),
|
|
2312
2312
|
modal: l,
|
|
2313
2313
|
children: n
|
|
2314
2314
|
}
|
|
@@ -2528,13 +2528,13 @@ const xe = {
|
|
|
2528
2528
|
title: d,
|
|
2529
2529
|
author: p,
|
|
2530
2530
|
subject: m,
|
|
2531
|
-
createdOn:
|
|
2531
|
+
createdOn: b,
|
|
2532
2532
|
creator: h,
|
|
2533
|
-
keywords:
|
|
2534
|
-
modifiedOn:
|
|
2535
|
-
pdfProducer:
|
|
2533
|
+
keywords: v,
|
|
2534
|
+
modifiedOn: _,
|
|
2535
|
+
pdfProducer: T,
|
|
2536
2536
|
pdfVersion: P,
|
|
2537
|
-
pageCount:
|
|
2537
|
+
pageCount: S
|
|
2538
2538
|
} = t;
|
|
2539
2539
|
return [
|
|
2540
2540
|
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: c },
|
|
@@ -2543,20 +2543,20 @@ const xe = {
|
|
|
2543
2543
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: d },
|
|
2544
2544
|
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: p },
|
|
2545
2545
|
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2546
|
-
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value:
|
|
2546
|
+
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: v },
|
|
2547
2547
|
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2548
2548
|
{
|
|
2549
2549
|
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
2550
|
-
value:
|
|
2550
|
+
value: b ? Wt(b) : ""
|
|
2551
2551
|
},
|
|
2552
2552
|
{
|
|
2553
2553
|
label: r == null ? void 0 : r.propertiesModifiedOnLabel,
|
|
2554
|
-
value:
|
|
2554
|
+
value: _ ? Wt(_) : ""
|
|
2555
2555
|
},
|
|
2556
2556
|
{ separate: !0 },
|
|
2557
|
-
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value:
|
|
2557
|
+
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: T },
|
|
2558
2558
|
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: P },
|
|
2559
|
-
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value:
|
|
2559
|
+
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: S }
|
|
2560
2560
|
];
|
|
2561
2561
|
}, [t, r]);
|
|
2562
2562
|
return /* @__PURE__ */ i(vi, { open: n, onOpenChange: o, children: /* @__PURE__ */ i(wi, { container: e, children: /* @__PURE__ */ F("div", { className: xe["rp-dialog-wrapper"], children: [
|
|
@@ -2647,11 +2647,11 @@ const xe = {
|
|
|
2647
2647
|
jumpNavigationTool: d,
|
|
2648
2648
|
printTool: p,
|
|
2649
2649
|
fullscreenTool: m
|
|
2650
|
-
} = ve(), { localeMessages:
|
|
2650
|
+
} = ve(), { localeMessages: b } = se();
|
|
2651
2651
|
return W(() => {
|
|
2652
|
-
const
|
|
2653
|
-
let
|
|
2654
|
-
return e && (
|
|
2652
|
+
const v = d || l || c || a || r;
|
|
2653
|
+
let _ = !1;
|
|
2654
|
+
return e && (_ = !(!n && !o && !p && !m)), v || _;
|
|
2655
2655
|
}, [
|
|
2656
2656
|
n,
|
|
2657
2657
|
o,
|
|
@@ -2666,7 +2666,7 @@ const xe = {
|
|
|
2666
2666
|
mn,
|
|
2667
2667
|
{
|
|
2668
2668
|
container: t,
|
|
2669
|
-
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content:
|
|
2669
|
+
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: b == null ? void 0 : b.moreOptionTooltip, children: /* @__PURE__ */ i(re, { "aria-label": b == null ? void 0 : b.moreOptionTooltip, children: /* @__PURE__ */ i(Kr, {}) }) }) }),
|
|
2670
2670
|
children: /* @__PURE__ */ F("div", { className: Si["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
|
|
2671
2671
|
e && /* @__PURE__ */ F(Ke, { children: [
|
|
2672
2672
|
/* @__PURE__ */ i(fn, {}),
|
|
@@ -2711,7 +2711,7 @@ const xe = {
|
|
|
2711
2711
|
const { zoomOutIcon: t } = pe();
|
|
2712
2712
|
return t || /* @__PURE__ */ i(_o, {});
|
|
2713
2713
|
}, $i = () => {
|
|
2714
|
-
const { zoomLevel: t, setZoomLevel: e } = Qe(), { container: n, contentRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate: l } = Ge(), { pages: c } = Q(), { isSmallScreen: d } = Ce(), { localeMessages: p } = se(), { viewMode: m } = Ee(),
|
|
2714
|
+
const { zoomLevel: t, setZoomLevel: e } = Qe(), { container: n, contentRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate: l } = Ge(), { pages: c } = Q(), { isSmallScreen: d } = Ce(), { localeMessages: p } = se(), { viewMode: m } = Ee(), b = N(() => {
|
|
2715
2715
|
e((u) => {
|
|
2716
2716
|
const f = Math.floor(u / 25) * 25;
|
|
2717
2717
|
return Math.min(f + 25, mt);
|
|
@@ -2721,23 +2721,23 @@ const xe = {
|
|
|
2721
2721
|
const f = Math.ceil(u / 25) * 25;
|
|
2722
2722
|
return Math.min(f - 25, mt);
|
|
2723
2723
|
});
|
|
2724
|
-
}, [e]),
|
|
2724
|
+
}, [e]), v = W(() => t === ki, [t]), _ = W(() => t === mt, [t]), T = W(() => {
|
|
2725
2725
|
var u;
|
|
2726
2726
|
return (u = c.get(a)) == null ? void 0 : u.page.getViewport({ scale: 1, rotation: l });
|
|
2727
2727
|
}, [c, a, l]), P = N(
|
|
2728
2728
|
(u) => {
|
|
2729
|
-
const f = ((
|
|
2729
|
+
const f = ((T == null ? void 0 : T.width) || 0) + 2 * Mt, g = ((T == null ? void 0 : T.height) || 0) + 2 * Mt, s = (o == null ? void 0 : o.clientWidth) || 0, C = (o == null ? void 0 : o.clientHeight) || 0, w = bo(
|
|
2730
2730
|
u,
|
|
2731
2731
|
s,
|
|
2732
|
-
|
|
2732
|
+
C,
|
|
2733
2733
|
f,
|
|
2734
2734
|
g,
|
|
2735
2735
|
m
|
|
2736
2736
|
);
|
|
2737
|
-
e(
|
|
2737
|
+
e(w);
|
|
2738
2738
|
},
|
|
2739
|
-
[e,
|
|
2740
|
-
),
|
|
2739
|
+
[e, T]
|
|
2740
|
+
), S = N(
|
|
2741
2741
|
(u) => {
|
|
2742
2742
|
typeof u == "number" ? e(u) : P(u);
|
|
2743
2743
|
},
|
|
@@ -2747,7 +2747,7 @@ const xe = {
|
|
|
2747
2747
|
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomOutTooltip, children: /* @__PURE__ */ i(
|
|
2748
2748
|
re,
|
|
2749
2749
|
{
|
|
2750
|
-
disabled:
|
|
2750
|
+
disabled: v,
|
|
2751
2751
|
onClick: h,
|
|
2752
2752
|
"aria-label": p == null ? void 0 : p.zoomOutTooltip,
|
|
2753
2753
|
children: /* @__PURE__ */ i(Hi, {})
|
|
@@ -2773,12 +2773,12 @@ const xe = {
|
|
|
2773
2773
|
align: "center",
|
|
2774
2774
|
children: /* @__PURE__ */ F("div", { className: De["rp-zoom-dropdown-content"], children: [
|
|
2775
2775
|
/* @__PURE__ */ F(Ke, { children: [
|
|
2776
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2777
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2778
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2776
|
+
/* @__PURE__ */ i(be, { onClick: () => S(at.ACTUAL), children: p == null ? void 0 : p.zoomActualSize }),
|
|
2777
|
+
/* @__PURE__ */ i(be, { onClick: () => S(at.PAGE_FIT), children: p == null ? void 0 : p.zoomPageFit }),
|
|
2778
|
+
/* @__PURE__ */ i(be, { onClick: () => S(at.PAGE_WIDTH), children: p == null ? void 0 : p.zoomPageWidth })
|
|
2779
2779
|
] }),
|
|
2780
2780
|
/* @__PURE__ */ i(yt, {}),
|
|
2781
|
-
/* @__PURE__ */ i(Ke, { children: Wi.map((u) => /* @__PURE__ */ F(be, { onClick: () =>
|
|
2781
|
+
/* @__PURE__ */ i(Ke, { children: Wi.map((u) => /* @__PURE__ */ F(be, { onClick: () => S(u), children: [
|
|
2782
2782
|
u,
|
|
2783
2783
|
" %"
|
|
2784
2784
|
] }, u)) })
|
|
@@ -2788,8 +2788,8 @@ const xe = {
|
|
|
2788
2788
|
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomInTooltip, children: /* @__PURE__ */ i(
|
|
2789
2789
|
re,
|
|
2790
2790
|
{
|
|
2791
|
-
disabled:
|
|
2792
|
-
onClick:
|
|
2791
|
+
disabled: _,
|
|
2792
|
+
onClick: b,
|
|
2793
2793
|
"aria-label": p == null ? void 0 : p.zoomInTooltip,
|
|
2794
2794
|
children: /* @__PURE__ */ i(Mi, {})
|
|
2795
2795
|
}
|
|
@@ -2828,38 +2828,38 @@ const xe = {
|
|
|
2828
2828
|
loading: d,
|
|
2829
2829
|
setSearch: p,
|
|
2830
2830
|
totalMatches: m,
|
|
2831
|
-
currentMatchPosition:
|
|
2831
|
+
currentMatchPosition: b,
|
|
2832
2832
|
nextMatch: h,
|
|
2833
|
-
prevMatch:
|
|
2834
|
-
search:
|
|
2835
|
-
} = xt(), { searchTool:
|
|
2833
|
+
prevMatch: v,
|
|
2834
|
+
search: _
|
|
2835
|
+
} = xt(), { searchTool: T = !0 } = ve(), [P, S] = $(_), { localeMessages: u } = se(), { isSmallScreen: f } = Ce(), g = N(() => {
|
|
2836
2836
|
n(!0);
|
|
2837
2837
|
}, []), s = N(() => {
|
|
2838
|
-
p(""),
|
|
2839
|
-
}, [p]),
|
|
2838
|
+
p(""), S(""), n(!1);
|
|
2839
|
+
}, [p]), C = (I) => {
|
|
2840
2840
|
const O = I.key === "Enter", M = I.key === " ";
|
|
2841
2841
|
(O || M) && s();
|
|
2842
|
-
},
|
|
2842
|
+
}, w = N(
|
|
2843
2843
|
(I) => {
|
|
2844
2844
|
I.key === "Escape" && e && s();
|
|
2845
2845
|
},
|
|
2846
2846
|
[e]
|
|
2847
|
-
),
|
|
2847
|
+
), y = N(
|
|
2848
2848
|
(I) => {
|
|
2849
|
-
I.shiftKey && I.key === "Enter" ?
|
|
2849
|
+
I.shiftKey && I.key === "Enter" ? v() : I.key === "Enter" && _ !== P ? p(P) : I.key === "Enter" && h();
|
|
2850
2850
|
},
|
|
2851
|
-
[P,
|
|
2851
|
+
[P, v, h, p, _]
|
|
2852
2852
|
);
|
|
2853
|
-
k(() => (window.addEventListener("keydown",
|
|
2854
|
-
window.removeEventListener("keydown",
|
|
2855
|
-
}), [
|
|
2853
|
+
k(() => (window.addEventListener("keydown", w), () => {
|
|
2854
|
+
window.removeEventListener("keydown", w);
|
|
2855
|
+
}), [w]), k(() => {
|
|
2856
2856
|
r && r.focus();
|
|
2857
2857
|
}, [r]);
|
|
2858
2858
|
const E = N((I) => {
|
|
2859
|
-
|
|
2859
|
+
S(I.target.value);
|
|
2860
2860
|
}, []), x = N(() => {
|
|
2861
|
-
|
|
2862
|
-
}, [p]), L = W(() => `${
|
|
2861
|
+
S(""), p("");
|
|
2862
|
+
}, [p]), L = W(() => `${b} / ${m}`, [b, m]), { wholeWords: D, matchCase: A } = W(() => l, [l]), z = N(
|
|
2863
2863
|
(I) => {
|
|
2864
2864
|
c((O) => ({ ...O, matchCase: I }));
|
|
2865
2865
|
},
|
|
@@ -2872,7 +2872,7 @@ const xe = {
|
|
|
2872
2872
|
);
|
|
2873
2873
|
return k(() => {
|
|
2874
2874
|
s();
|
|
2875
|
-
}, [o, s]),
|
|
2875
|
+
}, [o, s]), T ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i(
|
|
2876
2876
|
Mr,
|
|
2877
2877
|
{
|
|
2878
2878
|
open: e,
|
|
@@ -2885,7 +2885,7 @@ const xe = {
|
|
|
2885
2885
|
dn,
|
|
2886
2886
|
{
|
|
2887
2887
|
value: P,
|
|
2888
|
-
onKeyDown:
|
|
2888
|
+
onKeyDown: y,
|
|
2889
2889
|
onChange: E,
|
|
2890
2890
|
icon: /* @__PURE__ */ i(an, {}),
|
|
2891
2891
|
placeholder: u == null ? void 0 : u.searchInputPlaceholder,
|
|
@@ -2895,7 +2895,7 @@ const xe = {
|
|
|
2895
2895
|
}
|
|
2896
2896
|
) }),
|
|
2897
2897
|
d ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(Ct, { className: Y["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: L }),
|
|
2898
|
-
f && /* @__PURE__ */ i("div", { className: Y["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ht, { onKeyPress:
|
|
2898
|
+
f && /* @__PURE__ */ i("div", { className: Y["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ht, { onKeyPress: C, handleClose: s }) })
|
|
2899
2899
|
] }),
|
|
2900
2900
|
/* @__PURE__ */ F("div", { className: Y["rp-search-tool-input-checkboxes"], children: [
|
|
2901
2901
|
f && /* @__PURE__ */ i(on, {}),
|
|
@@ -2907,7 +2907,7 @@ const xe = {
|
|
|
2907
2907
|
] }),
|
|
2908
2908
|
!f && /* @__PURE__ */ F("div", { className: Y["rp-search-tool-controls"], children: [
|
|
2909
2909
|
/* @__PURE__ */ i(on, {}),
|
|
2910
|
-
/* @__PURE__ */ i(Ht, { onKeyPress:
|
|
2910
|
+
/* @__PURE__ */ i(Ht, { onKeyPress: C, handleClose: s })
|
|
2911
2911
|
] })
|
|
2912
2912
|
] })
|
|
2913
2913
|
}
|
|
@@ -3006,24 +3006,24 @@ const xe = {
|
|
|
3006
3006
|
}, Ki = $e((t, e) => {
|
|
3007
3007
|
const { show: n } = t, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage: l, thumbnailLength: c, addToPage: d } = Pn(), p = H(null), m = H(1);
|
|
3008
3008
|
cn(e, () => p.current);
|
|
3009
|
-
const
|
|
3010
|
-
const
|
|
3011
|
-
|
|
3009
|
+
const b = W(() => Object.values(a), [a]), h = N(() => {
|
|
3010
|
+
const v = c + 1;
|
|
3011
|
+
v <= r && l(v);
|
|
3012
3012
|
}, [l, r, c]);
|
|
3013
3013
|
return k(() => {
|
|
3014
3014
|
o > c ? d(o) : n && m.current !== o && (ji(p.current, o), m.current = o);
|
|
3015
|
-
}, [o, c, d, n,
|
|
3016
|
-
var
|
|
3015
|
+
}, [o, c, d, n, b]), mr(p.current, h), /* @__PURE__ */ i("div", { ref: p, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ i("div", { className: sn["rp-thumbnails"], children: n ? b.map((v, _) => {
|
|
3016
|
+
var T, P;
|
|
3017
3017
|
return /* @__PURE__ */ i(
|
|
3018
3018
|
Bi,
|
|
3019
3019
|
{
|
|
3020
|
-
isFocused: o === ((
|
|
3021
|
-
pageNumber: (P =
|
|
3022
|
-
thumbnailSrc:
|
|
3023
|
-
loading:
|
|
3024
|
-
viewport:
|
|
3020
|
+
isFocused: o === ((T = v.page) == null ? void 0 : T.pageNumber),
|
|
3021
|
+
pageNumber: (P = v.page) == null ? void 0 : P.pageNumber,
|
|
3022
|
+
thumbnailSrc: v.thumbnailSrc,
|
|
3023
|
+
loading: v.loading,
|
|
3024
|
+
viewport: v.viewport
|
|
3025
3025
|
},
|
|
3026
|
-
|
|
3026
|
+
_
|
|
3027
3027
|
);
|
|
3028
3028
|
}) : null }) });
|
|
3029
3029
|
}), Xi = () => {
|
|
@@ -3106,21 +3106,21 @@ const xe = {
|
|
|
3106
3106
|
onLoaded: d,
|
|
3107
3107
|
cleanupOnLoaded: p,
|
|
3108
3108
|
onLayoutWidthChange: m
|
|
3109
|
-
} = t, [
|
|
3109
|
+
} = t, [b, h] = $(null), { setContainer: v, setContentRef: _ } = ge(), { loading: T } = Q(), { LoaderImageComponent: P } = hn();
|
|
3110
3110
|
return k(() => (d && d(), () => {
|
|
3111
3111
|
p && p();
|
|
3112
|
-
}), [d, p]), /* @__PURE__ */ i(Ji, { toolbarRef:
|
|
3112
|
+
}), [d, p]), /* @__PURE__ */ i(Ji, { toolbarRef: b, ref: e, children: /* @__PURE__ */ i(Pr, { mobileWidth: c, onLayoutWidthChange: m, children: /* @__PURE__ */ i(vr, { slots: o, children: /* @__PURE__ */ i(wr, { icons: r, children: /* @__PURE__ */ F(_r, { getContainerRef: v, style: a, className: l, children: [
|
|
3113
3113
|
/* @__PURE__ */ F(br, { children: [
|
|
3114
3114
|
/* @__PURE__ */ F("div", { className: _e["rp-layout"], children: [
|
|
3115
3115
|
/* @__PURE__ */ i(Vi, { ref: h }),
|
|
3116
3116
|
/* @__PURE__ */ F("div", { className: _e["rp-content"], children: [
|
|
3117
3117
|
/* @__PURE__ */ i("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ i(Yi, {}) }),
|
|
3118
|
-
/* @__PURE__ */ i("div", { ref:
|
|
3118
|
+
/* @__PURE__ */ i("div", { ref: _, className: _e["rp-pages"], children: n })
|
|
3119
3119
|
] })
|
|
3120
3120
|
] }),
|
|
3121
3121
|
/* @__PURE__ */ i(Cr, {})
|
|
3122
3122
|
] }),
|
|
3123
|
-
|
|
3123
|
+
T ? /* @__PURE__ */ i(
|
|
3124
3124
|
"div",
|
|
3125
3125
|
{
|
|
3126
3126
|
className: _e["rp-loader"],
|