@pdf-viewer/react 1.7.0-beta.4 → 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-77fbc282.js → RPDefaultLayout-e3550bd7.js} +495 -492
- 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,130 +771,133 @@ 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
|
-
|
|
868
|
-
|
|
867
|
+
if (b.current.forEach((s) => {
|
|
868
|
+
s.classList.remove("selected");
|
|
869
|
+
}), !c.length || !a || a.pageIndex !== e - 1)
|
|
869
870
|
return;
|
|
870
871
|
const f = h.findIndex(
|
|
871
|
-
(
|
|
872
|
+
(s) => JSON.stringify(s) === JSON.stringify(a)
|
|
872
873
|
);
|
|
873
874
|
if (f === -1)
|
|
874
875
|
return;
|
|
875
|
-
const g = c.
|
|
876
|
-
g && (
|
|
876
|
+
const g = c.filter((s) => s.index === f);
|
|
877
|
+
g.length && (b.current = g.map((s) => s.element), l(g[0].element), g.forEach((s) => {
|
|
878
|
+
s.element.classList.add("selected");
|
|
879
|
+
}));
|
|
877
880
|
}, [a, c, h]), k(() => {
|
|
878
881
|
const f = n.get(e);
|
|
879
882
|
if (!f || !o.current)
|
|
880
883
|
return;
|
|
881
884
|
const g = o.current;
|
|
882
885
|
return p.current && p.current.cancel(), f.page.getTextContent().then((s) => {
|
|
883
|
-
const
|
|
886
|
+
const C = f.page.getViewport({ scale: 1 });
|
|
884
887
|
return p.current = new Sr.TextLayer({
|
|
885
|
-
viewport:
|
|
888
|
+
viewport: C,
|
|
886
889
|
textContentSource: s,
|
|
887
890
|
container: g
|
|
888
891
|
}), m.current = s, g && (g.innerText = ""), p.current.render();
|
|
889
892
|
}).then(() => {
|
|
890
|
-
var
|
|
893
|
+
var y, E;
|
|
891
894
|
[].slice.call(g.children).forEach((x) => {
|
|
892
895
|
x.classList.add(he["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
893
896
|
});
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
const
|
|
897
|
-
|
|
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);
|
|
898
901
|
}).catch(() => {
|
|
899
902
|
}), () => {
|
|
900
903
|
var s;
|
|
@@ -902,18 +905,18 @@ const So = () => {
|
|
|
902
905
|
};
|
|
903
906
|
}, [n, e]), k(() => {
|
|
904
907
|
var s;
|
|
905
|
-
[].slice.call(o.current.children).forEach((
|
|
906
|
-
|
|
908
|
+
[].slice.call(o.current.children).forEach((C) => {
|
|
909
|
+
C.classList.add(he["rp-text-layer-text"]);
|
|
907
910
|
});
|
|
908
911
|
const g = (s = p.current) == null ? void 0 : s.textDivs;
|
|
909
|
-
g && m.current &&
|
|
910
|
-
}, [
|
|
912
|
+
g && m.current && v(m.current, g, !0);
|
|
913
|
+
}, [v]), /* @__PURE__ */ i(
|
|
911
914
|
"div",
|
|
912
915
|
{
|
|
913
916
|
"data-rp": `page-${e}-textLayer`,
|
|
914
917
|
className: he["rp-text-layer"],
|
|
915
918
|
ref: o,
|
|
916
|
-
onMouseDown:
|
|
919
|
+
onMouseDown: S,
|
|
917
920
|
onMouseUp: u
|
|
918
921
|
}
|
|
919
922
|
);
|
|
@@ -922,34 +925,34 @@ const So = () => {
|
|
|
922
925
|
};
|
|
923
926
|
let Oo = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
924
927
|
const Do = (t) => {
|
|
925
|
-
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]);
|
|
926
929
|
k(() => {
|
|
927
930
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
928
931
|
}, [r]), k(() => {
|
|
929
|
-
|
|
932
|
+
v && v.page.getAnnotations().then((P) => {
|
|
930
933
|
a.current = void 0, c(P), n.current && (n.current.innerText = "");
|
|
931
934
|
});
|
|
932
|
-
}, [
|
|
933
|
-
const
|
|
935
|
+
}, [v]);
|
|
936
|
+
const T = N(
|
|
934
937
|
(P) => {
|
|
935
|
-
!l || !r || (Er(P), Nr(P, r, l).then((
|
|
938
|
+
!l || !r || (Er(P), Nr(P, r, l).then((S) => {
|
|
936
939
|
var u, f;
|
|
937
|
-
((u =
|
|
938
|
-
}), 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)));
|
|
939
942
|
},
|
|
940
|
-
[r, l, p, d, m,
|
|
943
|
+
[r, l, p, d, m, b, h]
|
|
941
944
|
);
|
|
942
945
|
return k(() => {
|
|
943
|
-
if (!
|
|
946
|
+
if (!v || !l)
|
|
944
947
|
return;
|
|
945
|
-
const P =
|
|
948
|
+
const P = v.page.getViewport();
|
|
946
949
|
if (a.current) {
|
|
947
950
|
a.current.update({
|
|
948
951
|
viewport: P.clone({ dontFlip: !0 })
|
|
949
952
|
});
|
|
950
953
|
return;
|
|
951
954
|
}
|
|
952
|
-
const
|
|
955
|
+
const S = /* @__PURE__ */ new Map([]);
|
|
953
956
|
for (const g of l) {
|
|
954
957
|
const { annotationType: s } = g;
|
|
955
958
|
switch (s) {
|
|
@@ -957,33 +960,33 @@ const Do = (t) => {
|
|
|
957
960
|
Dr(g);
|
|
958
961
|
break;
|
|
959
962
|
case At.Widget:
|
|
960
|
-
Or(g, P,
|
|
963
|
+
Or(g, P, S);
|
|
961
964
|
break;
|
|
962
965
|
}
|
|
963
966
|
}
|
|
964
967
|
const u = new AbortController();
|
|
965
968
|
return (async () => {
|
|
966
|
-
var
|
|
969
|
+
var C;
|
|
967
970
|
a.current && (a.current.div.replaceChildren(), a.current = void 0), n.current && (n.current.innerText = ""), a.current = new Lr({
|
|
968
971
|
div: n.current,
|
|
969
972
|
accessibilityManager: void 0,
|
|
970
973
|
annotationCanvasMap: void 0,
|
|
971
974
|
annotationEditorUIManager: void 0,
|
|
972
975
|
structTreeLayer: null,
|
|
973
|
-
page:
|
|
976
|
+
page: v.page,
|
|
974
977
|
viewport: P.clone({ dontFlip: !0 })
|
|
975
|
-
}), n.current && Ft(n.current,
|
|
978
|
+
}), n.current && Ft(n.current, T);
|
|
976
979
|
const g = await (r == null ? void 0 : r.hasJSActions()), s = await (r == null ? void 0 : r.getFieldObjects());
|
|
977
980
|
if (u.signal.aborted)
|
|
978
981
|
throw "abort";
|
|
979
|
-
return (
|
|
982
|
+
return (C = a.current) == null ? void 0 : C.render({
|
|
980
983
|
annotations: l,
|
|
981
984
|
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
982
985
|
hasJSActions: g,
|
|
983
986
|
fieldObjects: s,
|
|
984
987
|
div: n.current,
|
|
985
988
|
viewport: P.clone({ dontFlip: !0 }),
|
|
986
|
-
page:
|
|
989
|
+
page: v.page,
|
|
987
990
|
imageResourcesPath: Oo,
|
|
988
991
|
renderForms: !0,
|
|
989
992
|
linkService: new Rr(),
|
|
@@ -991,18 +994,18 @@ const Do = (t) => {
|
|
|
991
994
|
enableScripting: !1
|
|
992
995
|
});
|
|
993
996
|
})().then(() => {
|
|
994
|
-
n.current && Ar(n.current,
|
|
997
|
+
n.current && Ar(n.current, T);
|
|
995
998
|
}).catch((g) => {
|
|
996
999
|
if (g !== "abort")
|
|
997
1000
|
throw g;
|
|
998
1001
|
}), () => {
|
|
999
|
-
u.abort("clear"), n.current && Ft(n.current,
|
|
1002
|
+
u.abort("clear"), n.current && Ft(n.current, T);
|
|
1000
1003
|
};
|
|
1001
|
-
}, [r, l,
|
|
1004
|
+
}, [r, l, T]), /* @__PURE__ */ i(
|
|
1002
1005
|
"div",
|
|
1003
1006
|
{
|
|
1004
1007
|
"data-rp": `page-${e}-annotationLayer`,
|
|
1005
|
-
style: { width: `${
|
|
1008
|
+
style: { width: `${_ == null ? void 0 : _.width}px`, height: `${_ == null ? void 0 : _.height}px` },
|
|
1006
1009
|
className: No["rp-annotation-layer"],
|
|
1007
1010
|
ref: n
|
|
1008
1011
|
}
|
|
@@ -1010,7 +1013,7 @@ const Do = (t) => {
|
|
|
1010
1013
|
}, Ao = {
|
|
1011
1014
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1012
1015
|
}, zo = ({ pageNumber: t, viewport: e }) => {
|
|
1013
|
-
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] = $([]);
|
|
1014
1017
|
k(() => {
|
|
1015
1018
|
c.current && p(c.current.parentElement);
|
|
1016
1019
|
}, [c]), k(() => {
|
|
@@ -1029,23 +1032,23 @@ const Do = (t) => {
|
|
|
1029
1032
|
color: u.highlightColor
|
|
1030
1033
|
};
|
|
1031
1034
|
}) : [], [a]);
|
|
1032
|
-
function
|
|
1035
|
+
function v(u, f) {
|
|
1033
1036
|
if (!u)
|
|
1034
1037
|
return;
|
|
1035
1038
|
const g = `[data-rp="page-${f}-textLayer"]`;
|
|
1036
1039
|
return new Promise((s) => {
|
|
1037
|
-
const
|
|
1038
|
-
if (
|
|
1039
|
-
s(
|
|
1040
|
+
const C = u.querySelector(g);
|
|
1041
|
+
if (C) {
|
|
1042
|
+
s(C);
|
|
1040
1043
|
return;
|
|
1041
1044
|
}
|
|
1042
|
-
new MutationObserver((
|
|
1045
|
+
new MutationObserver((y, E) => {
|
|
1043
1046
|
const x = u.querySelector(g);
|
|
1044
1047
|
x && (s(x), E.disconnect());
|
|
1045
1048
|
}).observe(u, { childList: !0, subtree: !0 });
|
|
1046
1049
|
});
|
|
1047
1050
|
}
|
|
1048
|
-
function
|
|
1051
|
+
function _(u) {
|
|
1049
1052
|
return new Promise((f) => {
|
|
1050
1053
|
const g = u.querySelectorAll(
|
|
1051
1054
|
'[data-rp="rp-text-layer-text"]'
|
|
@@ -1054,25 +1057,25 @@ const Do = (t) => {
|
|
|
1054
1057
|
f(Array.from(g));
|
|
1055
1058
|
return;
|
|
1056
1059
|
}
|
|
1057
|
-
new MutationObserver((
|
|
1058
|
-
const
|
|
1060
|
+
new MutationObserver((C, w) => {
|
|
1061
|
+
const y = u.querySelectorAll(
|
|
1059
1062
|
".vpv-text-layer-text"
|
|
1060
1063
|
);
|
|
1061
|
-
|
|
1064
|
+
y.length && (f(Array.from(y)), w.disconnect());
|
|
1062
1065
|
}).observe(u, { childList: !0, subtree: !0 });
|
|
1063
1066
|
});
|
|
1064
1067
|
}
|
|
1065
|
-
const
|
|
1068
|
+
const T = (u, f, g, s) => {
|
|
1066
1069
|
var Z;
|
|
1067
|
-
const
|
|
1068
|
-
if (!
|
|
1070
|
+
const C = document.createRange(), w = g.firstChild;
|
|
1071
|
+
if (!w || w.nodeType !== Node.TEXT_NODE)
|
|
1069
1072
|
return null;
|
|
1070
|
-
const
|
|
1071
|
-
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)
|
|
1072
1075
|
return null;
|
|
1073
|
-
|
|
1076
|
+
C.setStart(w, E), C.setEnd(w, x + 1);
|
|
1074
1077
|
const L = document.createElement("span");
|
|
1075
|
-
L.style.width = "auto",
|
|
1078
|
+
L.style.width = "auto", C.surroundContents(L);
|
|
1076
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;
|
|
1077
1080
|
return kr(L), {
|
|
1078
1081
|
keywordStr: f,
|
|
@@ -1085,13 +1088,13 @@ const Do = (t) => {
|
|
|
1085
1088
|
};
|
|
1086
1089
|
};
|
|
1087
1090
|
async function P(u, f) {
|
|
1088
|
-
const g = await
|
|
1091
|
+
const g = await v(d, u);
|
|
1089
1092
|
if (!g)
|
|
1090
1093
|
return;
|
|
1091
|
-
const s = await
|
|
1094
|
+
const s = await _(g);
|
|
1092
1095
|
if (s.length) {
|
|
1093
|
-
const
|
|
1094
|
-
(
|
|
1096
|
+
const C = s.map((y) => y.tagName === "BR" ? " " : y.textContent).reduce(
|
|
1097
|
+
(y, E, x) => y.concat(
|
|
1095
1098
|
E.split("").map((L, D) => ({
|
|
1096
1099
|
char: L,
|
|
1097
1100
|
charIdxInSpan: D,
|
|
@@ -1105,15 +1108,15 @@ const Do = (t) => {
|
|
|
1105
1108
|
spanIdx: 0
|
|
1106
1109
|
}
|
|
1107
1110
|
]
|
|
1108
|
-
).slice(1),
|
|
1109
|
-
|
|
1111
|
+
).slice(1), w = S(g, f, s, C);
|
|
1112
|
+
b(w);
|
|
1110
1113
|
}
|
|
1111
1114
|
}
|
|
1112
|
-
const
|
|
1113
|
-
const
|
|
1114
|
-
if (!s.length || !
|
|
1115
|
+
const S = (u, f, g, s) => {
|
|
1116
|
+
const C = f.length;
|
|
1117
|
+
if (!s.length || !C)
|
|
1115
1118
|
return [];
|
|
1116
|
-
const
|
|
1119
|
+
const w = [], y = s.map((E) => E.char).join("");
|
|
1117
1120
|
return h.forEach((E) => {
|
|
1118
1121
|
const { keyword: x, regExp: L, wholeWords: D, color: A } = E, z = x;
|
|
1119
1122
|
if (!z.trim())
|
|
@@ -1121,8 +1124,8 @@ const Do = (t) => {
|
|
|
1121
1124
|
const R = L.flags.indexOf("g") === -1 ? new RegExp(L, `${L.flags}g`) : L;
|
|
1122
1125
|
let I;
|
|
1123
1126
|
const O = [];
|
|
1124
|
-
for (; (I = R.exec(
|
|
1125
|
-
D && !ur(
|
|
1127
|
+
for (; (I = R.exec(y)) !== null; )
|
|
1128
|
+
D && !ur(y, I.index, I[0].length) || O.push({
|
|
1126
1129
|
keyword: R,
|
|
1127
1130
|
startIndex: I.index,
|
|
1128
1131
|
endIndex: R.lastIndex
|
|
@@ -1139,7 +1142,7 @@ const Do = (t) => {
|
|
|
1139
1142
|
);
|
|
1140
1143
|
for (const j of Object.values(Z))
|
|
1141
1144
|
if (j.length !== 1 || j[0].char.trim() !== "") {
|
|
1142
|
-
const V = j, ee = g[V[0].spanIdx], X =
|
|
1145
|
+
const V = j, ee = g[V[0].spanIdx], X = T(
|
|
1143
1146
|
u,
|
|
1144
1147
|
z,
|
|
1145
1148
|
ee,
|
|
@@ -1147,13 +1150,13 @@ const Do = (t) => {
|
|
|
1147
1150
|
);
|
|
1148
1151
|
if (X) {
|
|
1149
1152
|
const { left: le, top: ae } = X;
|
|
1150
|
-
if (
|
|
1153
|
+
if (w.find((te) => te.left === le && te.top === ae))
|
|
1151
1154
|
continue;
|
|
1152
|
-
|
|
1155
|
+
w.push({ ...X, highlightColor: G.color });
|
|
1153
1156
|
}
|
|
1154
1157
|
}
|
|
1155
1158
|
}
|
|
1156
|
-
}),
|
|
1159
|
+
}), w.sort(Fr), w;
|
|
1157
1160
|
};
|
|
1158
1161
|
return k(() => {
|
|
1159
1162
|
(async () => {
|
|
@@ -1179,30 +1182,30 @@ const Do = (t) => {
|
|
|
1179
1182
|
f
|
|
1180
1183
|
)) }) });
|
|
1181
1184
|
}, It = $e((t, e) => {
|
|
1182
|
-
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, _] = $({
|
|
1183
1186
|
width: 0,
|
|
1184
1187
|
height: 0
|
|
1185
1188
|
});
|
|
1186
1189
|
cn(e, () => h.current), k(() => {
|
|
1187
1190
|
if (a && (p.current = a.get(n), p.current)) {
|
|
1188
1191
|
const u = p.current.page.getViewport({ scale: d, rotation: l });
|
|
1189
|
-
|
|
1192
|
+
_(u);
|
|
1190
1193
|
}
|
|
1191
1194
|
}, [a, n, l, d]);
|
|
1192
|
-
const
|
|
1195
|
+
const T = W(() => {
|
|
1193
1196
|
switch (l) {
|
|
1194
1197
|
case 90:
|
|
1195
|
-
return `${
|
|
1198
|
+
return `${v.width / 2}px ${v.width / 2}px`;
|
|
1196
1199
|
case -90:
|
|
1197
1200
|
case 270:
|
|
1198
|
-
return `${
|
|
1201
|
+
return `${v.height / 2}px ${v.height / 2}px`;
|
|
1199
1202
|
default:
|
|
1200
1203
|
return "center";
|
|
1201
1204
|
}
|
|
1202
|
-
}, [l,
|
|
1203
|
-
|
|
1204
|
-
}, []),
|
|
1205
|
-
|
|
1205
|
+
}, [l, v]), P = N(() => {
|
|
1206
|
+
b(!0);
|
|
1207
|
+
}, []), S = N(() => {
|
|
1208
|
+
b(!1);
|
|
1206
1209
|
}, []);
|
|
1207
1210
|
return /* @__PURE__ */ i(
|
|
1208
1211
|
"div",
|
|
@@ -1214,7 +1217,7 @@ const Do = (t) => {
|
|
|
1214
1217
|
style: {
|
|
1215
1218
|
...o,
|
|
1216
1219
|
"--rp-rotate": `${l}deg`,
|
|
1217
|
-
"--rp-page-rotate-translate": `${
|
|
1220
|
+
"--rp-page-rotate-translate": `${T}`,
|
|
1218
1221
|
"--scale-factor": d
|
|
1219
1222
|
},
|
|
1220
1223
|
className: lt["rp-page-wrapper"],
|
|
@@ -1222,15 +1225,15 @@ const Do = (t) => {
|
|
|
1222
1225
|
"div",
|
|
1223
1226
|
{
|
|
1224
1227
|
style: {
|
|
1225
|
-
width: `${
|
|
1226
|
-
height: `${
|
|
1228
|
+
width: `${v.width}px`,
|
|
1229
|
+
height: `${v.height}px`
|
|
1227
1230
|
},
|
|
1228
1231
|
className: lt["rp-page"],
|
|
1229
1232
|
children: [
|
|
1230
|
-
/* @__PURE__ */ i(Io, { onLoading: P, onLoaded:
|
|
1233
|
+
/* @__PURE__ */ i(Io, { onLoading: P, onLoaded: S, pageNumber: n }),
|
|
1231
1234
|
m && /* @__PURE__ */ i("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ i(Ct, {}) }),
|
|
1232
1235
|
c && /* @__PURE__ */ i(Eo, { pageNumber: n }),
|
|
1233
|
-
/* @__PURE__ */ i(zo, { pageNumber: n, viewport:
|
|
1236
|
+
/* @__PURE__ */ i(zo, { pageNumber: n, viewport: v }),
|
|
1234
1237
|
/* @__PURE__ */ i(Do, { pageNumber: n })
|
|
1235
1238
|
]
|
|
1236
1239
|
}
|
|
@@ -1331,12 +1334,12 @@ var Go = 150, qo = function(e) {
|
|
|
1331
1334
|
}, Be = null, Ze = null, je = null;
|
|
1332
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());
|
|
1333
1336
|
function Uo(t) {
|
|
1334
|
-
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,
|
|
1335
|
-
return e = /* @__PURE__ */ function(
|
|
1336
|
-
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);
|
|
1337
1340
|
function u(g) {
|
|
1338
1341
|
var s;
|
|
1339
|
-
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 = {
|
|
1340
1343
|
instance: qt(s),
|
|
1341
1344
|
isScrolling: !1,
|
|
1342
1345
|
horizontalScrollDirection: "forward",
|
|
@@ -1344,45 +1347,45 @@ function Uo(t) {
|
|
|
1344
1347
|
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1345
1348
|
scrollUpdateWasRequested: !1,
|
|
1346
1349
|
verticalScrollDirection: "forward"
|
|
1347
|
-
}, 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) {
|
|
1348
1351
|
return s.props.onItemsRendered({
|
|
1349
|
-
overscanColumnStartIndex:
|
|
1350
|
-
overscanColumnStopIndex:
|
|
1351
|
-
overscanRowStartIndex:
|
|
1352
|
+
overscanColumnStartIndex: C,
|
|
1353
|
+
overscanColumnStopIndex: w,
|
|
1354
|
+
overscanRowStartIndex: y,
|
|
1352
1355
|
overscanRowStopIndex: E,
|
|
1353
1356
|
visibleColumnStartIndex: x,
|
|
1354
1357
|
visibleColumnStopIndex: L,
|
|
1355
1358
|
visibleRowStartIndex: D,
|
|
1356
1359
|
visibleRowStopIndex: A
|
|
1357
1360
|
});
|
|
1358
|
-
}), s._callOnScroll = void 0, s._callOnScroll = dt(function(
|
|
1361
|
+
}), s._callOnScroll = void 0, s._callOnScroll = dt(function(C, w, y, E, x) {
|
|
1359
1362
|
return s.props.onScroll({
|
|
1360
|
-
horizontalScrollDirection:
|
|
1361
|
-
scrollLeft:
|
|
1362
|
-
scrollTop:
|
|
1363
|
+
horizontalScrollDirection: y,
|
|
1364
|
+
scrollLeft: C,
|
|
1365
|
+
scrollTop: w,
|
|
1363
1366
|
verticalScrollDirection: E,
|
|
1364
1367
|
scrollUpdateWasRequested: x
|
|
1365
1368
|
});
|
|
1366
|
-
}), s._getItemStyle = void 0, s._getItemStyle = function(
|
|
1367
|
-
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;
|
|
1368
1371
|
if (D.hasOwnProperty(A))
|
|
1369
1372
|
z = D[A];
|
|
1370
1373
|
else {
|
|
1371
|
-
var R = n(s.props,
|
|
1374
|
+
var R = n(s.props, w, s._instanceProps), I = x === "rtl";
|
|
1372
1375
|
D[A] = z = {
|
|
1373
1376
|
position: "absolute",
|
|
1374
1377
|
left: I ? void 0 : R,
|
|
1375
1378
|
right: I ? R : void 0,
|
|
1376
|
-
top:
|
|
1377
|
-
height: m(s.props,
|
|
1378
|
-
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)
|
|
1379
1382
|
};
|
|
1380
1383
|
}
|
|
1381
1384
|
return z;
|
|
1382
|
-
}, s._getItemStyleCache = void 0, s._getItemStyleCache = dt(function(
|
|
1385
|
+
}, s._getItemStyleCache = void 0, s._getItemStyleCache = dt(function(C, w, y) {
|
|
1383
1386
|
return {};
|
|
1384
|
-
}), s._onScroll = function(
|
|
1385
|
-
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;
|
|
1386
1389
|
s.setState(function(z) {
|
|
1387
1390
|
if (z.scrollLeft === x && z.scrollTop === L)
|
|
1388
1391
|
return null;
|
|
@@ -1397,7 +1400,7 @@ function Uo(t) {
|
|
|
1397
1400
|
break;
|
|
1398
1401
|
}
|
|
1399
1402
|
I = Math.max(0, Math.min(I, A - E));
|
|
1400
|
-
var O = Math.max(0, Math.min(L, D -
|
|
1403
|
+
var O = Math.max(0, Math.min(L, D - y));
|
|
1401
1404
|
return {
|
|
1402
1405
|
isScrolling: !0,
|
|
1403
1406
|
horizontalScrollDirection: z.scrollLeft < x ? "forward" : "backward",
|
|
@@ -1407,9 +1410,9 @@ function Uo(t) {
|
|
|
1407
1410
|
scrollUpdateWasRequested: !1
|
|
1408
1411
|
};
|
|
1409
1412
|
}, s._resetIsScrollingDebounced);
|
|
1410
|
-
}, s._outerRefSetter = function(
|
|
1411
|
-
var
|
|
1412
|
-
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);
|
|
1413
1416
|
}, s._resetIsScrollingDebounced = function() {
|
|
1414
1417
|
s._resetIsScrollingTimeoutId !== null && Zt(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId = Ho(s._resetIsScrolling, Go);
|
|
1415
1418
|
}, s._resetIsScrolling = function() {
|
|
@@ -1420,66 +1423,66 @@ function Uo(t) {
|
|
|
1420
1423
|
});
|
|
1421
1424
|
}, s;
|
|
1422
1425
|
}
|
|
1423
|
-
u.getDerivedStateFromProps = function(s,
|
|
1424
|
-
return Vo(s,
|
|
1426
|
+
u.getDerivedStateFromProps = function(s, C) {
|
|
1427
|
+
return Vo(s, C), P(s), null;
|
|
1425
1428
|
};
|
|
1426
1429
|
var f = u.prototype;
|
|
1427
1430
|
return f.scrollTo = function(s) {
|
|
1428
|
-
var
|
|
1429
|
-
|
|
1430
|
-
return
|
|
1431
|
-
horizontalScrollDirection:
|
|
1432
|
-
scrollLeft:
|
|
1433
|
-
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,
|
|
1434
1437
|
scrollUpdateWasRequested: !0,
|
|
1435
|
-
verticalScrollDirection:
|
|
1438
|
+
verticalScrollDirection: y.scrollTop < w ? "forward" : "backward"
|
|
1436
1439
|
};
|
|
1437
1440
|
}, this._resetIsScrollingDebounced);
|
|
1438
1441
|
}, f.scrollToItem = function(s) {
|
|
1439
|
-
var
|
|
1440
|
-
|
|
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)));
|
|
1441
1444
|
var G = l(this.props, this._instanceProps), Z = c(this.props, this._instanceProps), j = Z > z ? M : 0, V = G > D ? M : 0;
|
|
1442
1445
|
this.scrollTo({
|
|
1443
|
-
scrollLeft:
|
|
1444
|
-
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
|
|
1445
1448
|
});
|
|
1446
1449
|
}, f.componentDidMount = function() {
|
|
1447
|
-
var s = this.props,
|
|
1450
|
+
var s = this.props, C = s.initialScrollLeft, w = s.initialScrollTop;
|
|
1448
1451
|
if (this._outerRef != null) {
|
|
1449
|
-
var
|
|
1450
|
-
typeof
|
|
1452
|
+
var y = this._outerRef;
|
|
1453
|
+
typeof C == "number" && (y.scrollLeft = C), typeof w == "number" && (y.scrollTop = w);
|
|
1451
1454
|
}
|
|
1452
1455
|
this._callPropsCallbacks();
|
|
1453
1456
|
}, f.componentDidUpdate = function() {
|
|
1454
|
-
var s = this.props.direction,
|
|
1457
|
+
var s = this.props.direction, C = this.state, w = C.scrollLeft, y = C.scrollTop, E = C.scrollUpdateWasRequested;
|
|
1455
1458
|
if (E && this._outerRef != null) {
|
|
1456
1459
|
var x = this._outerRef;
|
|
1457
1460
|
if (s === "rtl")
|
|
1458
1461
|
switch (jt()) {
|
|
1459
1462
|
case "negative":
|
|
1460
|
-
x.scrollLeft = -
|
|
1463
|
+
x.scrollLeft = -w;
|
|
1461
1464
|
break;
|
|
1462
1465
|
case "positive-ascending":
|
|
1463
|
-
x.scrollLeft =
|
|
1466
|
+
x.scrollLeft = w;
|
|
1464
1467
|
break;
|
|
1465
1468
|
default:
|
|
1466
1469
|
var L = x.clientWidth, D = x.scrollWidth;
|
|
1467
|
-
x.scrollLeft = D - L -
|
|
1470
|
+
x.scrollLeft = D - L - w;
|
|
1468
1471
|
break;
|
|
1469
1472
|
}
|
|
1470
1473
|
else
|
|
1471
|
-
x.scrollLeft = Math.max(0,
|
|
1472
|
-
x.scrollTop = Math.max(0,
|
|
1474
|
+
x.scrollLeft = Math.max(0, w);
|
|
1475
|
+
x.scrollTop = Math.max(0, y);
|
|
1473
1476
|
}
|
|
1474
1477
|
this._callPropsCallbacks();
|
|
1475
1478
|
}, f.componentWillUnmount = function() {
|
|
1476
1479
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1477
1480
|
}, f.render = function() {
|
|
1478
|
-
var s = this.props,
|
|
1479
|
-
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)
|
|
1480
1483
|
for (var Pe = te; Pe <= Fe; Pe++)
|
|
1481
1484
|
for (var we = le; we <= ae; we++)
|
|
1482
|
-
Ne.push(Ve(
|
|
1485
|
+
Ne.push(Ve(C, {
|
|
1483
1486
|
columnIndex: we,
|
|
1484
1487
|
data: z,
|
|
1485
1488
|
isScrolling: j ? ee : void 0,
|
|
@@ -1493,7 +1496,7 @@ function Uo(t) {
|
|
|
1493
1496
|
}));
|
|
1494
1497
|
var nt = l(this.props, this._instanceProps), rt = c(this.props, this._instanceProps);
|
|
1495
1498
|
return Ve(O || M || "div", {
|
|
1496
|
-
className:
|
|
1499
|
+
className: w,
|
|
1497
1500
|
onScroll: this._onScroll,
|
|
1498
1501
|
ref: this._outerRefSetter,
|
|
1499
1502
|
style: Wr({
|
|
@@ -1515,26 +1518,26 @@ function Uo(t) {
|
|
|
1515
1518
|
}
|
|
1516
1519
|
}));
|
|
1517
1520
|
}, f._callPropsCallbacks = function() {
|
|
1518
|
-
var s = this.props,
|
|
1519
|
-
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) {
|
|
1520
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];
|
|
1521
1524
|
this._callOnItemsRendered(L, D, I, O, A, z, M, G);
|
|
1522
1525
|
}
|
|
1523
|
-
if (typeof
|
|
1526
|
+
if (typeof y == "function") {
|
|
1524
1527
|
var Z = this.state, j = Z.horizontalScrollDirection, V = Z.scrollLeft, ee = Z.scrollTop, X = Z.scrollUpdateWasRequested, le = Z.verticalScrollDirection;
|
|
1525
1528
|
this._callOnScroll(V, ee, j, le, X);
|
|
1526
1529
|
}
|
|
1527
1530
|
}, f._getHorizontalRangeToRender = function() {
|
|
1528
|
-
var s = this.props,
|
|
1529
|
-
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)
|
|
1530
1533
|
return [0, 0, 0, 0];
|
|
1531
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;
|
|
1532
|
-
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];
|
|
1533
1536
|
}, f._getVerticalRangeToRender = function() {
|
|
1534
|
-
var s = this.props,
|
|
1535
|
-
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)
|
|
1536
1539
|
return [0, 0, 0, 0];
|
|
1537
|
-
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;
|
|
1538
1541
|
return [Math.max(0, I - M), Math.max(0, Math.min(x - 1, O + G)), I, O];
|
|
1539
1542
|
}, u;
|
|
1540
1543
|
}(Qn), e.defaultProps = {
|
|
@@ -1544,7 +1547,7 @@ function Uo(t) {
|
|
|
1544
1547
|
}, e;
|
|
1545
1548
|
}
|
|
1546
1549
|
var Vo = function(e, n) {
|
|
1547
|
-
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;
|
|
1548
1551
|
if (process.env.NODE_ENV !== "production") {
|
|
1549
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)
|
|
1550
1553
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
@@ -1555,8 +1558,8 @@ var Vo = function(e, n) {
|
|
|
1555
1558
|
default:
|
|
1556
1559
|
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + r + '" was specified.'));
|
|
1557
1560
|
}
|
|
1558
|
-
if (typeof
|
|
1559
|
-
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.'));
|
|
1560
1563
|
if (typeof a != "number")
|
|
1561
1564
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
|
|
1562
1565
|
}
|
|
@@ -1585,11 +1588,11 @@ var Vo = function(e, n) {
|
|
|
1585
1588
|
d = p.offset + p.size;
|
|
1586
1589
|
}
|
|
1587
1590
|
for (var m = c + 1; m <= o; m++) {
|
|
1588
|
-
var
|
|
1591
|
+
var b = l(m);
|
|
1589
1592
|
a[m] = {
|
|
1590
1593
|
offset: d,
|
|
1591
|
-
size:
|
|
1592
|
-
}, d +=
|
|
1594
|
+
size: b
|
|
1595
|
+
}, d += b;
|
|
1593
1596
|
}
|
|
1594
1597
|
e === "column" ? r.lastMeasuredColumnIndex = o : r.lastMeasuredRowIndex = o;
|
|
1595
1598
|
}
|
|
@@ -1612,17 +1615,17 @@ var Vo = function(e, n) {
|
|
|
1612
1615
|
r += c, c *= 2;
|
|
1613
1616
|
return xn(e, n, o, Math.min(r, l - 1), Math.floor(r / 2), a);
|
|
1614
1617
|
}, Yt = function(e, n, o, r, a, l, c) {
|
|
1615
|
-
var d = e === "column" ? n.width : n.height, p = fe(e, n, o, l), m = e === "column" ? yn(n, l) : Sn(n, l),
|
|
1616
|
-
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) {
|
|
1617
1620
|
case "start":
|
|
1618
|
-
return
|
|
1621
|
+
return b;
|
|
1619
1622
|
case "end":
|
|
1620
1623
|
return h;
|
|
1621
1624
|
case "center":
|
|
1622
|
-
return Math.round(h + (
|
|
1625
|
+
return Math.round(h + (b - h) / 2);
|
|
1623
1626
|
case "auto":
|
|
1624
1627
|
default:
|
|
1625
|
-
return a >= h && a <=
|
|
1628
|
+
return a >= h && a <= b ? a : h > b || a < h ? h : b;
|
|
1626
1629
|
}
|
|
1627
1630
|
}, Zo = /* @__PURE__ */ Uo({
|
|
1628
1631
|
getColumnOffset: function(e, n, o) {
|
|
@@ -1681,8 +1684,8 @@ var Vo = function(e, n) {
|
|
|
1681
1684
|
shouldForceUpdate: d
|
|
1682
1685
|
});
|
|
1683
1686
|
}, n.resetAfterIndices = function(c) {
|
|
1684
|
-
var d = c.columnIndex, p = c.rowIndex, m = c.shouldForceUpdate,
|
|
1685
|
-
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();
|
|
1686
1689
|
}, l;
|
|
1687
1690
|
},
|
|
1688
1691
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
@@ -1712,30 +1715,30 @@ function Xo(t, e) {
|
|
|
1712
1715
|
return !Jt(n, r) && !Jt(o, a);
|
|
1713
1716
|
}
|
|
1714
1717
|
const Yo = () => {
|
|
1715
|
-
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((
|
|
1716
|
-
const
|
|
1717
|
-
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), _;
|
|
1718
1721
|
}, []), [r.widths, l]), d = N(
|
|
1719
|
-
(
|
|
1720
|
-
const
|
|
1721
|
-
return c[
|
|
1722
|
+
(v) => {
|
|
1723
|
+
const _ = v % c.length;
|
|
1724
|
+
return c[_] || 0;
|
|
1722
1725
|
},
|
|
1723
1726
|
[c]
|
|
1724
1727
|
), p = N(
|
|
1725
|
-
(
|
|
1728
|
+
(v) => r.heights[v] || 0,
|
|
1726
1729
|
[r.heights]
|
|
1727
1730
|
);
|
|
1728
1731
|
k(() => {
|
|
1729
1732
|
n(l);
|
|
1730
1733
|
}, [l, n]);
|
|
1731
|
-
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]);
|
|
1732
1735
|
return {
|
|
1733
1736
|
rowCount: m,
|
|
1734
1737
|
rowHeight: p,
|
|
1735
1738
|
columnCount: l,
|
|
1736
1739
|
columnWidth: d,
|
|
1737
1740
|
pageDimension: r,
|
|
1738
|
-
estimatedRowHeight:
|
|
1741
|
+
estimatedRowHeight: b,
|
|
1739
1742
|
estimatedColumnWidth: h
|
|
1740
1743
|
};
|
|
1741
1744
|
};
|
|
@@ -1759,65 +1762,65 @@ function Jo(t) {
|
|
|
1759
1762
|
let e, n, o, r, a, l, c;
|
|
1760
1763
|
const d = typeof document < "u" && document.attachEvent;
|
|
1761
1764
|
if (!d) {
|
|
1762
|
-
l = function(
|
|
1763
|
-
const u =
|
|
1765
|
+
l = function(S) {
|
|
1766
|
+
const u = S.__resizeTriggers__, f = u.firstElementChild, g = u.lastElementChild, s = f.firstElementChild;
|
|
1764
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;
|
|
1765
|
-
}, a = function(
|
|
1766
|
-
return
|
|
1767
|
-
}, c = function(
|
|
1768
|
-
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)
|
|
1769
1772
|
return;
|
|
1770
1773
|
const u = this;
|
|
1771
1774
|
l(this), this.__resizeRAF__ && _t(this.__resizeRAF__), this.__resizeRAF__ = bt(function() {
|
|
1772
1775
|
a(u) && (u.__resizeLast__.width = u.offsetWidth, u.__resizeLast__.height = u.offsetHeight, u.__resizeListeners__.forEach(function(s) {
|
|
1773
|
-
s.call(u,
|
|
1776
|
+
s.call(u, S);
|
|
1774
1777
|
}));
|
|
1775
1778
|
});
|
|
1776
1779
|
};
|
|
1777
|
-
let h = !1,
|
|
1780
|
+
let h = !1, v = "";
|
|
1778
1781
|
o = "animationstart";
|
|
1779
|
-
const
|
|
1780
|
-
let
|
|
1782
|
+
const _ = "Webkit Moz O ms".split(" ");
|
|
1783
|
+
let T = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), P = "";
|
|
1781
1784
|
{
|
|
1782
|
-
const
|
|
1783
|
-
if (
|
|
1784
|
-
for (let u = 0; u <
|
|
1785
|
-
if (
|
|
1786
|
-
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;
|
|
1787
1790
|
break;
|
|
1788
1791
|
}
|
|
1789
1792
|
}
|
|
1790
1793
|
}
|
|
1791
|
-
n = "resizeanim", e = "@" +
|
|
1794
|
+
n = "resizeanim", e = "@" + v + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = v + "animation: 1ms " + n + "; ";
|
|
1792
1795
|
}
|
|
1793
1796
|
const p = function(h) {
|
|
1794
1797
|
if (!h.getElementById("detectElementResize")) {
|
|
1795
|
-
const
|
|
1796
|
-
|
|
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);
|
|
1797
1800
|
}
|
|
1798
1801
|
};
|
|
1799
1802
|
return {
|
|
1800
|
-
addResizeListener: function(h,
|
|
1803
|
+
addResizeListener: function(h, v) {
|
|
1801
1804
|
if (d)
|
|
1802
|
-
h.attachEvent("onresize",
|
|
1805
|
+
h.attachEvent("onresize", v);
|
|
1803
1806
|
else {
|
|
1804
1807
|
if (!h.__resizeTriggers__) {
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1807
|
-
const P =
|
|
1808
|
-
P.className = "expand-trigger", P.appendChild(
|
|
1809
|
-
const
|
|
1810
|
-
|
|
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) {
|
|
1811
1814
|
f.animationName === n && l(h);
|
|
1812
1815
|
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1813
1816
|
}
|
|
1814
|
-
h.__resizeListeners__.push(
|
|
1817
|
+
h.__resizeListeners__.push(v);
|
|
1815
1818
|
}
|
|
1816
1819
|
},
|
|
1817
|
-
removeResizeListener: function(h,
|
|
1820
|
+
removeResizeListener: function(h, v) {
|
|
1818
1821
|
if (d)
|
|
1819
|
-
h.detachEvent("onresize",
|
|
1820
|
-
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) {
|
|
1821
1824
|
h.removeEventListener("scroll", c, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(o, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
|
|
1822
1825
|
try {
|
|
1823
1826
|
h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
|
|
@@ -1842,17 +1845,17 @@ class Qo extends er {
|
|
|
1842
1845
|
onResize: r
|
|
1843
1846
|
} = this.props;
|
|
1844
1847
|
if (this._parentNode) {
|
|
1845
|
-
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(),
|
|
1846
|
-
(!n && (this.state.height !==
|
|
1847
|
-
height:
|
|
1848
|
-
width:
|
|
1849
|
-
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,
|
|
1850
1853
|
scaledWidth: h
|
|
1851
1854
|
}), typeof r == "function" && r({
|
|
1852
|
-
height:
|
|
1853
|
-
scaledHeight:
|
|
1855
|
+
height: v,
|
|
1856
|
+
scaledHeight: b,
|
|
1854
1857
|
scaledWidth: h,
|
|
1855
|
-
width:
|
|
1858
|
+
width: _
|
|
1856
1859
|
}));
|
|
1857
1860
|
}
|
|
1858
1861
|
}, this._setRef = (n) => {
|
|
@@ -1886,24 +1889,24 @@ class Qo extends er {
|
|
|
1886
1889
|
onResize: d,
|
|
1887
1890
|
style: p = {},
|
|
1888
1891
|
tagName: m = "div",
|
|
1889
|
-
...
|
|
1892
|
+
...b
|
|
1890
1893
|
} = this.props, {
|
|
1891
1894
|
height: h,
|
|
1892
|
-
scaledHeight:
|
|
1893
|
-
scaledWidth:
|
|
1894
|
-
width:
|
|
1895
|
+
scaledHeight: v,
|
|
1896
|
+
scaledWidth: _,
|
|
1897
|
+
width: T
|
|
1895
1898
|
} = this.state, P = {
|
|
1896
1899
|
overflow: "visible"
|
|
1897
|
-
},
|
|
1900
|
+
}, S = {};
|
|
1898
1901
|
let u = !1;
|
|
1899
|
-
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, {
|
|
1900
1903
|
ref: this._setRef,
|
|
1901
1904
|
style: {
|
|
1902
1905
|
...P,
|
|
1903
1906
|
...p
|
|
1904
1907
|
},
|
|
1905
|
-
...
|
|
1906
|
-
}, !u && e(
|
|
1908
|
+
...b
|
|
1909
|
+
}, !u && e(S));
|
|
1907
1910
|
}
|
|
1908
1911
|
}
|
|
1909
1912
|
const ei = ln(({ widths: t, heights: e }) => {
|
|
@@ -1915,19 +1918,19 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
1915
1918
|
}
|
|
1916
1919
|
return c;
|
|
1917
1920
|
}, [n, o]), a = W(() => {
|
|
1918
|
-
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;
|
|
1919
1922
|
return [
|
|
1920
1923
|
{
|
|
1921
1924
|
position: "absolute",
|
|
1922
1925
|
left: 0,
|
|
1923
|
-
top:
|
|
1926
|
+
top: b === d ? 0 : v,
|
|
1924
1927
|
width: c,
|
|
1925
1928
|
height: d
|
|
1926
1929
|
},
|
|
1927
1930
|
{
|
|
1928
1931
|
position: "absolute",
|
|
1929
1932
|
left: c,
|
|
1930
|
-
top:
|
|
1933
|
+
top: b === m ? 0 : v,
|
|
1931
1934
|
width: p,
|
|
1932
1935
|
height: m
|
|
1933
1936
|
}
|
|
@@ -1951,13 +1954,13 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
1951
1954
|
}
|
|
1952
1955
|
);
|
|
1953
1956
|
}, ni = (t, e, n) => {
|
|
1954
|
-
const o = H(), { contentRef: r } = ge(), { heights: a, widths: l } = qe(), { setFocusedPage: c } = ie(), [d, p] = $([]), { targetScrollPage: m } = pn(),
|
|
1955
|
-
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 + _;
|
|
1956
1959
|
return {
|
|
1957
|
-
pageNumber:
|
|
1958
|
-
...
|
|
1960
|
+
pageNumber: T + 1,
|
|
1961
|
+
...S,
|
|
1959
1962
|
width: P,
|
|
1960
|
-
height:
|
|
1963
|
+
height: _,
|
|
1961
1964
|
startX: u,
|
|
1962
1965
|
startY: f,
|
|
1963
1966
|
endX: g,
|
|
@@ -1965,42 +1968,42 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
1965
1968
|
};
|
|
1966
1969
|
}), [a, l, t, e]);
|
|
1967
1970
|
k(() => {
|
|
1968
|
-
var
|
|
1969
|
-
|
|
1970
|
-
let
|
|
1971
|
-
|
|
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(() => {
|
|
1972
1975
|
m.current = void 0;
|
|
1973
1976
|
}, 500);
|
|
1974
|
-
}, [
|
|
1975
|
-
const
|
|
1976
|
-
(
|
|
1977
|
+
}, [b, c]);
|
|
1978
|
+
const v = N(
|
|
1979
|
+
(_) => {
|
|
1977
1980
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
1978
|
-
const
|
|
1979
|
-
startTop:
|
|
1980
|
-
startLeft:
|
|
1981
|
-
endTop:
|
|
1982
|
-
endLeft:
|
|
1983
|
-
},
|
|
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) => {
|
|
1984
1987
|
const f = u.endX >= P.startLeft && u.endY >= P.startTop, g = u.startX <= P.endLeft && u.startY <= P.endTop;
|
|
1985
1988
|
return f && g;
|
|
1986
1989
|
}).map((u) => {
|
|
1987
|
-
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);
|
|
1988
1991
|
return {
|
|
1989
1992
|
pageNumber: u.pageNumber,
|
|
1990
1993
|
ratio: x
|
|
1991
1994
|
};
|
|
1992
1995
|
}).sort((u, f) => f.ratio - u.ratio);
|
|
1993
|
-
p(
|
|
1996
|
+
p(S);
|
|
1994
1997
|
});
|
|
1995
1998
|
},
|
|
1996
1999
|
[r, h]
|
|
1997
2000
|
);
|
|
1998
2001
|
k(() => {
|
|
1999
2002
|
if (n)
|
|
2000
|
-
return n == null || n.addEventListener("scroll",
|
|
2001
|
-
n == null || n.removeEventListener("scroll",
|
|
2003
|
+
return n == null || n.addEventListener("scroll", v), () => {
|
|
2004
|
+
n == null || n.removeEventListener("scroll", v);
|
|
2002
2005
|
};
|
|
2003
|
-
}, [n,
|
|
2006
|
+
}, [n, v]);
|
|
2004
2007
|
}, ri = ln(({ columnIndex: t, rowIndex: e, data: n, style: o }) => {
|
|
2005
2008
|
const r = Vr(e, t, n.columnCount);
|
|
2006
2009
|
return /* @__PURE__ */ i(It, { style: o, pageNumber: r }, r);
|
|
@@ -2011,10 +2014,10 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2011
2014
|
getPageScrollElementRef: d,
|
|
2012
2015
|
getVirtualScrollableElementRef: p,
|
|
2013
2016
|
setTotalInnerDimensions: m,
|
|
2014
|
-
virtualScrollableElementRef:
|
|
2017
|
+
virtualScrollableElementRef: b,
|
|
2015
2018
|
totalInnerDimensions: h,
|
|
2016
|
-
pageScrollElementRef:
|
|
2017
|
-
} = 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(
|
|
2018
2021
|
h
|
|
2019
2022
|
), x = H({
|
|
2020
2023
|
viewMode: g,
|
|
@@ -2028,7 +2031,7 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2028
2031
|
estimatedColumnWidth: G,
|
|
2029
2032
|
estimatedRowHeight: Z
|
|
2030
2033
|
} = Yo(), j = Pt(h, 100), V = H();
|
|
2031
|
-
ni(O, R,
|
|
2034
|
+
ni(O, R, b);
|
|
2032
2035
|
const ee = H({
|
|
2033
2036
|
scrollTop: 0,
|
|
2034
2037
|
scrollLeft: 0
|
|
@@ -2041,9 +2044,9 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2041
2044
|
}), [O]), Ne = N(
|
|
2042
2045
|
(q) => {
|
|
2043
2046
|
const U = document.activeElement !== o;
|
|
2044
|
-
!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()));
|
|
2045
2048
|
},
|
|
2046
|
-
[
|
|
2049
|
+
[T, P, A, f]
|
|
2047
2050
|
);
|
|
2048
2051
|
k(() => (window.addEventListener("keydown", Ne), () => {
|
|
2049
2052
|
window.removeEventListener("keydown", Ne);
|
|
@@ -2059,15 +2062,15 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2059
2062
|
}, [R, O, z, l]);
|
|
2060
2063
|
const Pe = N(
|
|
2061
2064
|
(q, U) => {
|
|
2062
|
-
if (!
|
|
2065
|
+
if (!b)
|
|
2063
2066
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
2064
2067
|
const Te = ee.current.scrollTop > U, Se = ee.current.scrollLeft > q;
|
|
2065
2068
|
return Te || Se ? ee.current : {
|
|
2066
|
-
scrollTop:
|
|
2067
|
-
scrollLeft:
|
|
2069
|
+
scrollTop: b.scrollTop,
|
|
2070
|
+
scrollLeft: b.scrollLeft
|
|
2068
2071
|
};
|
|
2069
2072
|
},
|
|
2070
|
-
[
|
|
2073
|
+
[b]
|
|
2071
2074
|
), we = N(
|
|
2072
2075
|
(q, U) => {
|
|
2073
2076
|
if (x.current.viewMode !== g || x.current.scrollMode !== f) {
|
|
@@ -2121,7 +2124,7 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2121
2124
|
scrollLeft: q.scrollLeft
|
|
2122
2125
|
};
|
|
2123
2126
|
},
|
|
2124
|
-
[
|
|
2127
|
+
[b]
|
|
2125
2128
|
);
|
|
2126
2129
|
k(() => () => {
|
|
2127
2130
|
V.current && clearTimeout(V.current);
|
|
@@ -2139,20 +2142,20 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2139
2142
|
[te, ae, ue]
|
|
2140
2143
|
);
|
|
2141
2144
|
return k(() => {
|
|
2142
|
-
|
|
2143
|
-
}, [
|
|
2144
|
-
if (!(j.height === 0 || !
|
|
2145
|
+
C && de();
|
|
2146
|
+
}, [C]), k(() => {
|
|
2147
|
+
if (!(j.height === 0 || !_.current)) {
|
|
2145
2148
|
if (e === J.PAGE_SCROLLING) {
|
|
2146
|
-
t !== u &&
|
|
2149
|
+
t !== u && v && S(t), _.current = !1;
|
|
2147
2150
|
return;
|
|
2148
2151
|
}
|
|
2149
|
-
a(t, "auto"),
|
|
2152
|
+
a(t, "auto"), S(t), _.current = !1;
|
|
2150
2153
|
}
|
|
2151
2154
|
}, [
|
|
2152
2155
|
a,
|
|
2153
2156
|
e,
|
|
2154
|
-
|
|
2155
|
-
|
|
2157
|
+
v,
|
|
2158
|
+
S,
|
|
2156
2159
|
j
|
|
2157
2160
|
]), /* @__PURE__ */ F(me, { children: [
|
|
2158
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(
|
|
@@ -2185,7 +2188,7 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2185
2188
|
),
|
|
2186
2189
|
children: ri
|
|
2187
2190
|
}
|
|
2188
|
-
) :
|
|
2191
|
+
) : C ? null : /* @__PURE__ */ i(
|
|
2189
2192
|
"div",
|
|
2190
2193
|
{
|
|
2191
2194
|
className: ue["rp-loader"],
|
|
@@ -2196,10 +2199,10 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2196
2199
|
height: "100%",
|
|
2197
2200
|
width: "100%"
|
|
2198
2201
|
},
|
|
2199
|
-
children:
|
|
2202
|
+
children: y && /* @__PURE__ */ i(y, {})
|
|
2200
2203
|
}
|
|
2201
2204
|
) }) }) }),
|
|
2202
|
-
|
|
2205
|
+
w && /* @__PURE__ */ i(qr, {})
|
|
2203
2206
|
] });
|
|
2204
2207
|
}, ke = {
|
|
2205
2208
|
"rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
|
|
@@ -2218,24 +2221,24 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2218
2221
|
const { nextIcon: t } = pe();
|
|
2219
2222
|
return t || /* @__PURE__ */ i(He, { style: { transform: "rotate(180deg" } });
|
|
2220
2223
|
}, ai = () => {
|
|
2221
|
-
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();
|
|
2222
2225
|
k(() => {
|
|
2223
2226
|
c(t.toString());
|
|
2224
2227
|
}, [t]);
|
|
2225
|
-
const
|
|
2228
|
+
const v = N((u) => {
|
|
2226
2229
|
const f = u.target.value;
|
|
2227
2230
|
c(f);
|
|
2228
|
-
}, []),
|
|
2231
|
+
}, []), _ = N(async () => {
|
|
2229
2232
|
const u = a(l);
|
|
2230
2233
|
u.success || c(u.currentPage.toString());
|
|
2231
|
-
}, [a, l, e]),
|
|
2234
|
+
}, [a, l, e]), T = N(() => {
|
|
2232
2235
|
c(t.toString());
|
|
2233
2236
|
}, [t]), P = N(
|
|
2234
2237
|
(u) => {
|
|
2235
|
-
u.key === "Enter" &&
|
|
2238
|
+
u.key === "Enter" && _();
|
|
2236
2239
|
},
|
|
2237
|
-
[
|
|
2238
|
-
),
|
|
2240
|
+
[_]
|
|
2241
|
+
), S = W(() => b === Ie.DUAL_PAGE && h === J.PAGE_SCROLLING ? t === e - 1 : t === e, [t, e, b, h]);
|
|
2239
2242
|
return typeof d != "boolean" ? /* @__PURE__ */ i(
|
|
2240
2243
|
d,
|
|
2241
2244
|
{
|
|
@@ -2260,8 +2263,8 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2260
2263
|
dn,
|
|
2261
2264
|
{
|
|
2262
2265
|
onKeyDown: P,
|
|
2263
|
-
onBlur:
|
|
2264
|
-
onChange:
|
|
2266
|
+
onBlur: T,
|
|
2267
|
+
onChange: v,
|
|
2265
2268
|
value: l,
|
|
2266
2269
|
className: ft["rp-page-input"]
|
|
2267
2270
|
}
|
|
@@ -2275,7 +2278,7 @@ const ei = ln(({ widths: t, heights: e }) => {
|
|
|
2275
2278
|
{
|
|
2276
2279
|
onClick: o,
|
|
2277
2280
|
"aria-label": m == null ? void 0 : m.nextPageTooltip,
|
|
2278
|
-
"aria-disabled":
|
|
2281
|
+
"aria-disabled": S,
|
|
2279
2282
|
children: /* @__PURE__ */ i(ii, {})
|
|
2280
2283
|
}
|
|
2281
2284
|
) })
|
|
@@ -2305,7 +2308,7 @@ var Lt = "Dialog", [In, Us] = Xr(Lt), [si, ce] = In(Lt), Ln = (t) => {
|
|
|
2305
2308
|
descriptionId: ct(),
|
|
2306
2309
|
open: p,
|
|
2307
2310
|
onOpenChange: m,
|
|
2308
|
-
onOpenToggle: B.useCallback(() => m((
|
|
2311
|
+
onOpenToggle: B.useCallback(() => m((b) => !b), [m]),
|
|
2309
2312
|
modal: l,
|
|
2310
2313
|
children: n
|
|
2311
2314
|
}
|
|
@@ -2525,13 +2528,13 @@ const xe = {
|
|
|
2525
2528
|
title: d,
|
|
2526
2529
|
author: p,
|
|
2527
2530
|
subject: m,
|
|
2528
|
-
createdOn:
|
|
2531
|
+
createdOn: b,
|
|
2529
2532
|
creator: h,
|
|
2530
|
-
keywords:
|
|
2531
|
-
modifiedOn:
|
|
2532
|
-
pdfProducer:
|
|
2533
|
+
keywords: v,
|
|
2534
|
+
modifiedOn: _,
|
|
2535
|
+
pdfProducer: T,
|
|
2533
2536
|
pdfVersion: P,
|
|
2534
|
-
pageCount:
|
|
2537
|
+
pageCount: S
|
|
2535
2538
|
} = t;
|
|
2536
2539
|
return [
|
|
2537
2540
|
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: c },
|
|
@@ -2540,20 +2543,20 @@ const xe = {
|
|
|
2540
2543
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: d },
|
|
2541
2544
|
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: p },
|
|
2542
2545
|
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2543
|
-
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value:
|
|
2546
|
+
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: v },
|
|
2544
2547
|
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2545
2548
|
{
|
|
2546
2549
|
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
2547
|
-
value:
|
|
2550
|
+
value: b ? Wt(b) : ""
|
|
2548
2551
|
},
|
|
2549
2552
|
{
|
|
2550
2553
|
label: r == null ? void 0 : r.propertiesModifiedOnLabel,
|
|
2551
|
-
value:
|
|
2554
|
+
value: _ ? Wt(_) : ""
|
|
2552
2555
|
},
|
|
2553
2556
|
{ separate: !0 },
|
|
2554
|
-
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value:
|
|
2557
|
+
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: T },
|
|
2555
2558
|
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: P },
|
|
2556
|
-
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value:
|
|
2559
|
+
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: S }
|
|
2557
2560
|
];
|
|
2558
2561
|
}, [t, r]);
|
|
2559
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: [
|
|
@@ -2644,11 +2647,11 @@ const xe = {
|
|
|
2644
2647
|
jumpNavigationTool: d,
|
|
2645
2648
|
printTool: p,
|
|
2646
2649
|
fullscreenTool: m
|
|
2647
|
-
} = ve(), { localeMessages:
|
|
2650
|
+
} = ve(), { localeMessages: b } = se();
|
|
2648
2651
|
return W(() => {
|
|
2649
|
-
const
|
|
2650
|
-
let
|
|
2651
|
-
return e && (
|
|
2652
|
+
const v = d || l || c || a || r;
|
|
2653
|
+
let _ = !1;
|
|
2654
|
+
return e && (_ = !(!n && !o && !p && !m)), v || _;
|
|
2652
2655
|
}, [
|
|
2653
2656
|
n,
|
|
2654
2657
|
o,
|
|
@@ -2663,7 +2666,7 @@ const xe = {
|
|
|
2663
2666
|
mn,
|
|
2664
2667
|
{
|
|
2665
2668
|
container: t,
|
|
2666
|
-
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, {}) }) }) }),
|
|
2667
2670
|
children: /* @__PURE__ */ F("div", { className: Si["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
|
|
2668
2671
|
e && /* @__PURE__ */ F(Ke, { children: [
|
|
2669
2672
|
/* @__PURE__ */ i(fn, {}),
|
|
@@ -2708,7 +2711,7 @@ const xe = {
|
|
|
2708
2711
|
const { zoomOutIcon: t } = pe();
|
|
2709
2712
|
return t || /* @__PURE__ */ i(_o, {});
|
|
2710
2713
|
}, $i = () => {
|
|
2711
|
-
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(() => {
|
|
2712
2715
|
e((u) => {
|
|
2713
2716
|
const f = Math.floor(u / 25) * 25;
|
|
2714
2717
|
return Math.min(f + 25, mt);
|
|
@@ -2718,23 +2721,23 @@ const xe = {
|
|
|
2718
2721
|
const f = Math.ceil(u / 25) * 25;
|
|
2719
2722
|
return Math.min(f - 25, mt);
|
|
2720
2723
|
});
|
|
2721
|
-
}, [e]),
|
|
2724
|
+
}, [e]), v = W(() => t === ki, [t]), _ = W(() => t === mt, [t]), T = W(() => {
|
|
2722
2725
|
var u;
|
|
2723
2726
|
return (u = c.get(a)) == null ? void 0 : u.page.getViewport({ scale: 1, rotation: l });
|
|
2724
2727
|
}, [c, a, l]), P = N(
|
|
2725
2728
|
(u) => {
|
|
2726
|
-
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(
|
|
2727
2730
|
u,
|
|
2728
2731
|
s,
|
|
2729
|
-
|
|
2732
|
+
C,
|
|
2730
2733
|
f,
|
|
2731
2734
|
g,
|
|
2732
2735
|
m
|
|
2733
2736
|
);
|
|
2734
|
-
e(
|
|
2737
|
+
e(w);
|
|
2735
2738
|
},
|
|
2736
|
-
[e,
|
|
2737
|
-
),
|
|
2739
|
+
[e, T]
|
|
2740
|
+
), S = N(
|
|
2738
2741
|
(u) => {
|
|
2739
2742
|
typeof u == "number" ? e(u) : P(u);
|
|
2740
2743
|
},
|
|
@@ -2744,7 +2747,7 @@ const xe = {
|
|
|
2744
2747
|
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomOutTooltip, children: /* @__PURE__ */ i(
|
|
2745
2748
|
re,
|
|
2746
2749
|
{
|
|
2747
|
-
disabled:
|
|
2750
|
+
disabled: v,
|
|
2748
2751
|
onClick: h,
|
|
2749
2752
|
"aria-label": p == null ? void 0 : p.zoomOutTooltip,
|
|
2750
2753
|
children: /* @__PURE__ */ i(Hi, {})
|
|
@@ -2770,12 +2773,12 @@ const xe = {
|
|
|
2770
2773
|
align: "center",
|
|
2771
2774
|
children: /* @__PURE__ */ F("div", { className: De["rp-zoom-dropdown-content"], children: [
|
|
2772
2775
|
/* @__PURE__ */ F(Ke, { children: [
|
|
2773
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2774
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2775
|
-
/* @__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 })
|
|
2776
2779
|
] }),
|
|
2777
2780
|
/* @__PURE__ */ i(yt, {}),
|
|
2778
|
-
/* @__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: [
|
|
2779
2782
|
u,
|
|
2780
2783
|
" %"
|
|
2781
2784
|
] }, u)) })
|
|
@@ -2785,8 +2788,8 @@ const xe = {
|
|
|
2785
2788
|
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomInTooltip, children: /* @__PURE__ */ i(
|
|
2786
2789
|
re,
|
|
2787
2790
|
{
|
|
2788
|
-
disabled:
|
|
2789
|
-
onClick:
|
|
2791
|
+
disabled: _,
|
|
2792
|
+
onClick: b,
|
|
2790
2793
|
"aria-label": p == null ? void 0 : p.zoomInTooltip,
|
|
2791
2794
|
children: /* @__PURE__ */ i(Mi, {})
|
|
2792
2795
|
}
|
|
@@ -2825,38 +2828,38 @@ const xe = {
|
|
|
2825
2828
|
loading: d,
|
|
2826
2829
|
setSearch: p,
|
|
2827
2830
|
totalMatches: m,
|
|
2828
|
-
currentMatchPosition:
|
|
2831
|
+
currentMatchPosition: b,
|
|
2829
2832
|
nextMatch: h,
|
|
2830
|
-
prevMatch:
|
|
2831
|
-
search:
|
|
2832
|
-
} = xt(), { searchTool:
|
|
2833
|
+
prevMatch: v,
|
|
2834
|
+
search: _
|
|
2835
|
+
} = xt(), { searchTool: T = !0 } = ve(), [P, S] = $(_), { localeMessages: u } = se(), { isSmallScreen: f } = Ce(), g = N(() => {
|
|
2833
2836
|
n(!0);
|
|
2834
2837
|
}, []), s = N(() => {
|
|
2835
|
-
p(""),
|
|
2836
|
-
}, [p]),
|
|
2838
|
+
p(""), S(""), n(!1);
|
|
2839
|
+
}, [p]), C = (I) => {
|
|
2837
2840
|
const O = I.key === "Enter", M = I.key === " ";
|
|
2838
2841
|
(O || M) && s();
|
|
2839
|
-
},
|
|
2842
|
+
}, w = N(
|
|
2840
2843
|
(I) => {
|
|
2841
2844
|
I.key === "Escape" && e && s();
|
|
2842
2845
|
},
|
|
2843
2846
|
[e]
|
|
2844
|
-
),
|
|
2847
|
+
), y = N(
|
|
2845
2848
|
(I) => {
|
|
2846
|
-
I.shiftKey && I.key === "Enter" ?
|
|
2849
|
+
I.shiftKey && I.key === "Enter" ? v() : I.key === "Enter" && _ !== P ? p(P) : I.key === "Enter" && h();
|
|
2847
2850
|
},
|
|
2848
|
-
[P,
|
|
2851
|
+
[P, v, h, p, _]
|
|
2849
2852
|
);
|
|
2850
|
-
k(() => (window.addEventListener("keydown",
|
|
2851
|
-
window.removeEventListener("keydown",
|
|
2852
|
-
}), [
|
|
2853
|
+
k(() => (window.addEventListener("keydown", w), () => {
|
|
2854
|
+
window.removeEventListener("keydown", w);
|
|
2855
|
+
}), [w]), k(() => {
|
|
2853
2856
|
r && r.focus();
|
|
2854
2857
|
}, [r]);
|
|
2855
2858
|
const E = N((I) => {
|
|
2856
|
-
|
|
2859
|
+
S(I.target.value);
|
|
2857
2860
|
}, []), x = N(() => {
|
|
2858
|
-
|
|
2859
|
-
}, [p]), L = W(() => `${
|
|
2861
|
+
S(""), p("");
|
|
2862
|
+
}, [p]), L = W(() => `${b} / ${m}`, [b, m]), { wholeWords: D, matchCase: A } = W(() => l, [l]), z = N(
|
|
2860
2863
|
(I) => {
|
|
2861
2864
|
c((O) => ({ ...O, matchCase: I }));
|
|
2862
2865
|
},
|
|
@@ -2869,7 +2872,7 @@ const xe = {
|
|
|
2869
2872
|
);
|
|
2870
2873
|
return k(() => {
|
|
2871
2874
|
s();
|
|
2872
|
-
}, [o, s]),
|
|
2875
|
+
}, [o, s]), T ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i(
|
|
2873
2876
|
Mr,
|
|
2874
2877
|
{
|
|
2875
2878
|
open: e,
|
|
@@ -2882,7 +2885,7 @@ const xe = {
|
|
|
2882
2885
|
dn,
|
|
2883
2886
|
{
|
|
2884
2887
|
value: P,
|
|
2885
|
-
onKeyDown:
|
|
2888
|
+
onKeyDown: y,
|
|
2886
2889
|
onChange: E,
|
|
2887
2890
|
icon: /* @__PURE__ */ i(an, {}),
|
|
2888
2891
|
placeholder: u == null ? void 0 : u.searchInputPlaceholder,
|
|
@@ -2892,7 +2895,7 @@ const xe = {
|
|
|
2892
2895
|
}
|
|
2893
2896
|
) }),
|
|
2894
2897
|
d ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(Ct, { className: Y["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: L }),
|
|
2895
|
-
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 }) })
|
|
2896
2899
|
] }),
|
|
2897
2900
|
/* @__PURE__ */ F("div", { className: Y["rp-search-tool-input-checkboxes"], children: [
|
|
2898
2901
|
f && /* @__PURE__ */ i(on, {}),
|
|
@@ -2904,7 +2907,7 @@ const xe = {
|
|
|
2904
2907
|
] }),
|
|
2905
2908
|
!f && /* @__PURE__ */ F("div", { className: Y["rp-search-tool-controls"], children: [
|
|
2906
2909
|
/* @__PURE__ */ i(on, {}),
|
|
2907
|
-
/* @__PURE__ */ i(Ht, { onKeyPress:
|
|
2910
|
+
/* @__PURE__ */ i(Ht, { onKeyPress: C, handleClose: s })
|
|
2908
2911
|
] })
|
|
2909
2912
|
] })
|
|
2910
2913
|
}
|
|
@@ -3003,24 +3006,24 @@ const xe = {
|
|
|
3003
3006
|
}, Ki = $e((t, e) => {
|
|
3004
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);
|
|
3005
3008
|
cn(e, () => p.current);
|
|
3006
|
-
const
|
|
3007
|
-
const
|
|
3008
|
-
|
|
3009
|
+
const b = W(() => Object.values(a), [a]), h = N(() => {
|
|
3010
|
+
const v = c + 1;
|
|
3011
|
+
v <= r && l(v);
|
|
3009
3012
|
}, [l, r, c]);
|
|
3010
3013
|
return k(() => {
|
|
3011
3014
|
o > c ? d(o) : n && m.current !== o && (ji(p.current, o), m.current = o);
|
|
3012
|
-
}, [o, c, d, n,
|
|
3013
|
-
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;
|
|
3014
3017
|
return /* @__PURE__ */ i(
|
|
3015
3018
|
Bi,
|
|
3016
3019
|
{
|
|
3017
|
-
isFocused: o === ((
|
|
3018
|
-
pageNumber: (P =
|
|
3019
|
-
thumbnailSrc:
|
|
3020
|
-
loading:
|
|
3021
|
-
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
|
|
3022
3025
|
},
|
|
3023
|
-
|
|
3026
|
+
_
|
|
3024
3027
|
);
|
|
3025
3028
|
}) : null }) });
|
|
3026
3029
|
}), Xi = () => {
|
|
@@ -3103,21 +3106,21 @@ const xe = {
|
|
|
3103
3106
|
onLoaded: d,
|
|
3104
3107
|
cleanupOnLoaded: p,
|
|
3105
3108
|
onLayoutWidthChange: m
|
|
3106
|
-
} = t, [
|
|
3109
|
+
} = t, [b, h] = $(null), { setContainer: v, setContentRef: _ } = ge(), { loading: T } = Q(), { LoaderImageComponent: P } = hn();
|
|
3107
3110
|
return k(() => (d && d(), () => {
|
|
3108
3111
|
p && p();
|
|
3109
|
-
}), [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: [
|
|
3110
3113
|
/* @__PURE__ */ F(br, { children: [
|
|
3111
3114
|
/* @__PURE__ */ F("div", { className: _e["rp-layout"], children: [
|
|
3112
3115
|
/* @__PURE__ */ i(Vi, { ref: h }),
|
|
3113
3116
|
/* @__PURE__ */ F("div", { className: _e["rp-content"], children: [
|
|
3114
3117
|
/* @__PURE__ */ i("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ i(Yi, {}) }),
|
|
3115
|
-
/* @__PURE__ */ i("div", { ref:
|
|
3118
|
+
/* @__PURE__ */ i("div", { ref: _, className: _e["rp-pages"], children: n })
|
|
3116
3119
|
] })
|
|
3117
3120
|
] }),
|
|
3118
3121
|
/* @__PURE__ */ i(Cr, {})
|
|
3119
3122
|
] }),
|
|
3120
|
-
|
|
3123
|
+
T ? /* @__PURE__ */ i(
|
|
3121
3124
|
"div",
|
|
3122
3125
|
{
|
|
3123
3126
|
className: _e["rp-loader"],
|