@pdf-viewer/react 1.5.0-beta.9 → 1.5.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/RPDefaultLayout-b003c6b4.js +2958 -0
  2. package/dist/assets/RPDefaultLayout.css +1 -1
  3. package/dist/components/RPController.js +1 -1
  4. package/dist/components/RPPages.js +1 -1
  5. package/dist/components/RPProvider.js +15 -18
  6. package/dist/components/layout/LayoutContainer.js +1 -1
  7. package/dist/components/layout/RPDefaultLayout.js +1 -1
  8. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  10. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  11. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  12. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  13. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  14. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  15. package/dist/components/layout/toolbar/MostPageTool.js +3 -3
  16. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  17. package/dist/components/layout/toolbar/Paginate.js +1 -1
  18. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  19. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  20. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  21. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  22. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  23. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  24. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  25. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  26. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  27. package/dist/components/page/AnnotationLayer.js +1 -1
  28. package/dist/components/page/CanvasLayer.js +1 -1
  29. package/dist/components/page/DualPage.js +1 -1
  30. package/dist/components/page/RPPage.js +1 -1
  31. package/dist/components/page/SinglePage.js +1 -1
  32. package/dist/components/page/TextHighlightLayer.js +1 -1
  33. package/dist/components/page/TextLayer.js +1 -1
  34. package/dist/components/ui/Checkbox.js +13 -14
  35. package/dist/components/ui/DropDown.js +1 -1
  36. package/dist/components/ui/LoadingIndicator.js +1 -1
  37. package/dist/components/ui/RPTooltip.js +331 -689
  38. package/dist/contexts/PaginationContext.js +1 -1
  39. package/dist/contexts/PrintContext.js +1 -1
  40. package/dist/contexts/SearchContext.js +1 -1
  41. package/dist/contexts/ThumbnailsContext.js +1 -1
  42. package/dist/index-1cb41342.js +307 -0
  43. package/dist/index-7279fb4e.js +1557 -0
  44. package/dist/index-aa2d3884.js +140 -0
  45. package/dist/main.js +1 -1
  46. package/dist/utils/hooks/useFileDownload.js +2 -2
  47. package/dist/utils/hooks/useLicense.js +1 -1
  48. package/dist/utils/hooks/useLoadWorker.js +1 -1
  49. package/dist/utils/hooks/usePaginate.js +1 -1
  50. package/dist/utils/hooks/usePresentPage.js +1 -1
  51. package/dist/utils/hooks/usePrint.js +1 -1
  52. package/dist/utils/hooks/useScrollToPage.js +1 -1
  53. package/dist/utils/hooks/useSearch.js +1 -1
  54. package/dist/utils/hooks/useThumbnail.js +1 -1
  55. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/RPDefaultLayout-e1e07d65.js +0 -2960
  58. package/dist/index-2e540713.js +0 -23
  59. package/dist/index-353ec0a6.js +0 -172
  60. package/dist/index-5ff5dbd0.js +0 -1675
  61. package/dist/index-71898eb9.js +0 -139
@@ -0,0 +1,2958 @@
1
+ import { jsx as i, Fragment as xe, jsxs as D } from "react/jsx-runtime";
2
+ import * as U from "react";
3
+ import { useRef as M, useEffect as A, useCallback as L, useState as $, createContext as Ke, useContext as Xe, useMemo as F, forwardRef as We, useImperativeHandle as ln, createElement as Ve, PureComponent as nr, Component as rr, memo as or } from "react";
4
+ import { ChevronUpIcon as Me } from "./components/icons/ChevronUpIcon.js";
5
+ import { UIButton as Q } from "./components/ui/Button.js";
6
+ import { UIInput as dn } from "./components/ui/Input.js";
7
+ import { useScrollModeContext as Ee } from "./contexts/ScrollModeContext.js";
8
+ import { useDocumentContext as K } from "./contexts/RPDocumentContext.js";
9
+ import { useDarkModeContext as ir } from "./contexts/DarkModeContext.js";
10
+ import { ViewMode as Ze, ScrollMode as ee, AnnotationSubType as kt, SelectionMode as ar, ZoomLevel as it } from "./utils/types.js";
11
+ import { useRotationContext as Ye } from "./contexts/RotationContext.js";
12
+ import { useLayerContext as sr } from "./contexts/LayerContext.js";
13
+ import { useZoomContext as Je } from "./contexts/ZoomContext.js";
14
+ import { useViewModeContext as Qe } from "./contexts/ViewModeContext.js";
15
+ import { useVirtualScrollContext as et } from "./contexts/VirtualScrollContext.js";
16
+ import { useVirtualGridContext as un } from "./contexts/VirtualGridContext.js";
17
+ import { useSelectionModeContext as cr } from "./contexts/SelectionModeContext.js";
18
+ import { useInitialStateContext as lr } from "./contexts/InitialStateContext.js";
19
+ import { useFullScreenContext as dr } from "./contexts/FullScreenContext.js";
20
+ import "./contexts/FileInputContext.js";
21
+ import "./contexts/DropFileZoneContext.js";
22
+ import { renderPage as wt } from "./utils/renderPage.js";
23
+ import { highlightMatches as pn, findMatches as ur, resetDivs as hn, highlightMultipleColorMatches as pr } from "./utils/highlight.js";
24
+ import * as Pt from "pdfjs-dist";
25
+ import { PixelsPerInch as hr, AnnotationMode as mr, RenderingCancelledException as fr, AnnotationLayer as gr } from "pdfjs-dist";
26
+ import { useLayoutContainer as Te } from "./contexts/LayoutContainerContext.js";
27
+ import { useDimensionPagesContext as tt } from "./contexts/DimensionPagesContext.js";
28
+ import { useLocalizationContext as ue } from "./contexts/LocalizationContext.js";
29
+ import { useHighlightContext as vr } from "./contexts/HighlightContext.js";
30
+ import { useDownloadContext as _r } from "./contexts/DownloadContext.js";
31
+ import { useSmoothScrollContext as St } from "./contexts/SmoothScrollContext.js";
32
+ import { useLoaderContext as mn } from "./contexts/LoaderContext.js";
33
+ import "./contexts/LicenseContext.js";
34
+ import "./components/RPConfig.js";
35
+ import { ThumbnailIcon as wr } from "./components/icons/Thumbnail.js";
36
+ import { c as re } from "./clsx-0c6e471a.js";
37
+ import { LoaderIcon as xt } from "./components/icons/LoaderIcon.js";
38
+ import { useInfiniteScroll as br } from "./utils/hooks/useInfiniteScroll.js";
39
+ import { RPSplitter as Cr } from "./components/layout/sidebar/RPSplitter.js";
40
+ import { useToolbarComponentContext as _e, ToolbarComponentProvider as Tr } from "./contexts/ToolbarComponentContext.js";
41
+ import { useIconContext as pe, IconProvider as Pr } from "./contexts/IconContext.js";
42
+ import q from "./components/ui/RPTooltip.js";
43
+ import { Container as Sr } from "./components/layout/Container.js";
44
+ import { WrapperLayout as xr } from "./components/layout/WrapperLayout.js";
45
+ import { RPDropFileZone as yr } from "./components/RPDropFileZone.js";
46
+ import { useViewportContext as Ie, ViewportProvider as Ir } from "./contexts/ViewportContext.js";
47
+ import { useThemeContext as Lr } from "./contexts/ThemeContext.js";
48
+ import { SimpleLinkService as Rr } from "./utils/link_service.js";
49
+ import { annotationsEvents as Nr, annotationEventsHandler as Er, handleClick as Mt, handleAnnotationWidget as Or, handleAnnotationLink as Dr, bindLayerEvents as zr, unbindLayerEvents as Wt } from "./utils/annotations.js";
50
+ import { _ as Ar, U as Fr } from "./Popover-b7402893.js";
51
+ import { useMousePressed as kr } from "./utils/hooks/useMousePressed.js";
52
+ import { useGrabScroll as Mr } from "./utils/hooks/useGrabScroll.js";
53
+ import { usePinch as Wr } from "./utils/hooks/usePinch.js";
54
+ import { useDebounce as yt } from "./utils/hooks/useDebounce.js";
55
+ import { getPositionFromPage as Hr, getPageFromPosition as $r } from "./utils/calculatePage.js";
56
+ import { getThumbnailViewport as Ht } from "./utils/getThumbnailViewport.js";
57
+ import { smoothScrollTo as at } from "./utils/smoothScrollTo.js";
58
+ import { appConsole as Vr } from "./utils/appConsole.js";
59
+ import { FileUploadTool as fn } from "./components/layout/toolbar/FileUploadTool.js";
60
+ import { DarkModeTool as Gr } from "./components/layout/toolbar/DarkModeTool.js";
61
+ import { ThreeDotIcon as Ur } from "./components/icons/ThreeDotIcon.js";
62
+ import { UIDropDown as gn } from "./components/ui/DropDown.js";
63
+ import { e as qr, a as It, P as He, c as ke, g as Lt, i as Zr, k as Br, f as jr } from "./index-1cb41342.js";
64
+ import { D as Kr, u as st } from "./index-aa2d3884.js";
65
+ import { a as Xr, u as Yr, F as Jr, b as Qr, G as Be } from "./index-7279fb4e.js";
66
+ import { h as eo } from "./component-1da194e8.js";
67
+ import { CloseIcon as vn } from "./components/icons/CloseIcon.js";
68
+ import { dateFormatter as $t } from "./utils/dateFormatter.js";
69
+ import { PropertyItem as to } from "./components/layout/toolbar/PropertyItem.js";
70
+ import { useOtherToolContext as no, OtherToolProvider as ro } from "./contexts/OtherToolContext.js";
71
+ import { DocumentProperties as oo } from "./components/layout/toolbar/DocumentProperties.js";
72
+ import { RotateTool as io } from "./components/layout/toolbar/RotateTool.js";
73
+ import { ScrollModeTool as ao } from "./components/layout/toolbar/ScrollModeTool.js";
74
+ import { MenuSeparator as Rt } from "./components/layout/toolbar/MenuSeparator.js";
75
+ import { FileDownloadDefaultIcon as so } from "./components/icons/FileDownloadDefaultIcon.js";
76
+ import { MenuItem as Ce } from "./components/layout/toolbar/MenuItem.js";
77
+ import { PrintDefaultTool as co } from "./components/icons/PrintDefaultIcon.js";
78
+ import { FullScreenTool as _n } from "./components/layout/toolbar/FullScreenTool.js";
79
+ import { GoToDownIcon as wn } from "./components/icons/GoToDownIcon.js";
80
+ import { SelectionModeTool as lo } from "./components/layout/toolbar/SelectionModeTool.js";
81
+ import { ZoomInIcon as uo } from "./components/icons/ZoomInIcon.js";
82
+ import { ZoomOutIcon as po } from "./components/icons/ZoomOutIcon.js";
83
+ import { PAGE_PADDING as Vt } from "./utils/constants.js";
84
+ import { getZoomLevel as ho } from "./utils/getZoomLevel.js";
85
+ import { SearchIcon as mo } from "./components/icons/SearchIcon.js";
86
+ import { UICheckbox as Gt } from "./components/ui/Checkbox.js";
87
+ import { ClearIcon as fo } from "./components/icons/ClearIcon.js";
88
+ import { InfoIcon as Ut } from "./components/icons/InfoIcon.js";
89
+ import './assets/RPDefaultLayout.css';const $e = (e, t) => e.reduce((n, o, r) => r < t ? n + o : n, 0), ct = (e, t) => {
90
+ const n = Math.round(e.left) === Math.round(t.left) && Math.round(e.top) === Math.round(t.top), o = Math.round(e.left) >= Math.round(t.left) && Math.round(e.top) >= Math.round(t.top);
91
+ return n || o;
92
+ }, bn = () => {
93
+ const { viewMode: e } = Qe(), { scrollMode: t } = Ee(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: a } = ie(), c = M(), { columnCount: s } = un(), { widths: l, heights: u } = tt(), d = M(t), f = M(e), h = M(s), { targetScrollPosition: g, smoothScrolling: w } = St();
94
+ A(() => {
95
+ n != null && n.scrollToItem && (c.current = n);
96
+ }, [n]), A(() => {
97
+ d.current = t, f.current = e;
98
+ }, [t, e]);
99
+ const b = L(
100
+ (_, m) => {
101
+ if (!r)
102
+ return;
103
+ const P = Math.ceil(_ / 2) * 2 - 1;
104
+ if (_ === P + 1) {
105
+ const p = {
106
+ left: l[P],
107
+ top: 0
108
+ };
109
+ return g.current = p, new Promise(
110
+ (T) => at(r, p, T)
111
+ );
112
+ }
113
+ const S = {
114
+ left: 0,
115
+ top: 0
116
+ };
117
+ return g.current = S, r == null ? void 0 : r.scrollTo({
118
+ ...S,
119
+ behavior: m
120
+ });
121
+ },
122
+ [r, l, at]
123
+ );
124
+ return A(() => {
125
+ d.current = t, f.current = e;
126
+ }, [t, e]), A(() => {
127
+ h.current = s;
128
+ }, [s]), { scrollToPage: L(
129
+ (_, m = "smooth") => {
130
+ const P = _ - 1;
131
+ let S = P, p = 0;
132
+ if (f.current === Ze.DUAL_PAGE && d.current === ee.PAGE_SCROLLING) {
133
+ b(_, m);
134
+ return;
135
+ }
136
+ if (d.current === ee.PAGE_SCROLLING) {
137
+ a(_);
138
+ return;
139
+ }
140
+ if (!c.current || !o)
141
+ return;
142
+ const T = o;
143
+ if (w.current = !0, d.current === ee.HORIZONTAL_SCROLLING) {
144
+ p = P;
145
+ const N = {
146
+ left: $e(l, p),
147
+ top: 0
148
+ };
149
+ return ct(N, {
150
+ left: T.scrollLeft,
151
+ top: T.scrollTop
152
+ }) && (w.current = !1), g.current = N, T.scrollTo({
153
+ ...N,
154
+ behavior: m
155
+ });
156
+ }
157
+ if (f.current === Ze.DUAL_PAGE) {
158
+ p = P % 2, S = Math.floor(P / 2);
159
+ const N = {
160
+ left: $e(l, p),
161
+ top: $e(u, S)
162
+ };
163
+ return ct(N, {
164
+ left: T.scrollLeft,
165
+ top: T.scrollTop
166
+ }) && (w.current = !1), g.current = N, T.scrollTo({
167
+ ...N,
168
+ behavior: m
169
+ });
170
+ }
171
+ const C = {
172
+ left: 0,
173
+ top: $e(u, S)
174
+ };
175
+ return g.current = C, ct(C, {
176
+ left: T.scrollLeft,
177
+ top: T.scrollTop
178
+ }) && (w.current = !1), T.scrollTo({
179
+ ...C,
180
+ behavior: m
181
+ });
182
+ },
183
+ [
184
+ o,
185
+ s,
186
+ b,
187
+ a,
188
+ at,
189
+ u,
190
+ l
191
+ ]
192
+ ) };
193
+ }, go = (e = 1) => {
194
+ const [t, n] = $(e), [o, r] = $(0), { scrollToPage: a } = bn(), c = M(1), { viewMode: s } = Qe(), { scrollMode: l } = Ee(), u = yt(t, 100), d = L(
195
+ (b) => {
196
+ if (!/^[0-9]*$/g.test(b.toString()) || !b)
197
+ return { success: !1, currentPage: c.current };
198
+ const _ = +b;
199
+ return _ < 0 || _ > o ? { success: !1, currentPage: c.current } : (n(_), c.current = _, { success: !0, currentPage: +b });
200
+ },
201
+ [o]
202
+ ), f = L(d, [d]), h = L(
203
+ (b) => {
204
+ const v = d(b);
205
+ return v.success && a(v.currentPage), v;
206
+ },
207
+ [d, a]
208
+ ), g = L(() => {
209
+ let b = t - 1;
210
+ h(b);
211
+ }, [h, t, s, l]), w = L(() => {
212
+ let b = t + 1;
213
+ h(b);
214
+ }, [h, t, s, l]);
215
+ return {
216
+ focusedPage: u,
217
+ totalPages: o,
218
+ setFocusedPage: f,
219
+ setTotalPages: r,
220
+ nextPage: w,
221
+ prevPage: g,
222
+ goToPage: h
223
+ };
224
+ }, Cn = Ke({
225
+ focusedPage: 0,
226
+ setFocusedPage: (e) => {
227
+ },
228
+ goToPage: (e) => ({ success: !!e, currentPage: +e }),
229
+ totalPages: 0,
230
+ setTotalPages: (e) => {
231
+ },
232
+ prevPage: () => {
233
+ },
234
+ nextPage: () => {
235
+ }
236
+ }), ie = () => {
237
+ const e = Xe(Cn);
238
+ return typeof (e == null ? void 0 : e.focusedPage) > "u" && Vr.error("Please use this hooks inside children component of RPProvider"), e;
239
+ }, Ts = ({ children: e }) => {
240
+ const { pdf: t } = K(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: a, goToPage: c, nextPage: s, prevPage: l } = go();
241
+ return A(() => {
242
+ t != null && t.numPages && (a(t.numPages), r(1));
243
+ }, [t, a, r]), /* @__PURE__ */ i(
244
+ Cn.Provider,
245
+ {
246
+ value: {
247
+ focusedPage: n,
248
+ totalPages: o,
249
+ setFocusedPage: r,
250
+ setTotalPages: a,
251
+ nextPage: s,
252
+ prevPage: l,
253
+ goToPage: c
254
+ },
255
+ children: e
256
+ }
257
+ );
258
+ };
259
+ const vo = () => {
260
+ const { pdf: e, pages: t } = K(), [n, o] = $({
261
+ loadedPages: 0,
262
+ totalPages: 0,
263
+ percentage: 0
264
+ }), [r, a] = $(!1), [c, s] = $(!1), [l, u] = $(null), d = M(!1);
265
+ A(() => {
266
+ d.current;
267
+ }, [d]);
268
+ const f = L(() => {
269
+ document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
270
+ const P = document.querySelector(".rp-print-zone");
271
+ P && P.remove();
272
+ }, []), h = L(() => {
273
+ d.current = !1, a(!1), s(!1), u(null), o({
274
+ loadedPages: 0,
275
+ totalPages: 0,
276
+ percentage: 0
277
+ });
278
+ }, []), g = () => {
279
+ d.current = !0;
280
+ }, w = async ({
281
+ scratchCanvas: P,
282
+ pdfDocument: S,
283
+ pageNumber: p,
284
+ viewerPdfPage: T,
285
+ printResolution: C,
286
+ optionalContentConfigPromise: x,
287
+ printAnnotationStoragePromise: N
288
+ }) => {
289
+ if (d.current) {
290
+ h();
291
+ return;
292
+ }
293
+ const I = C / hr.PDF;
294
+ P.width = Math.floor(T.width * I), P.height = Math.floor(T.height * I);
295
+ const O = P.getContext("2d");
296
+ O.save(), O.fillStyle = "rgb(255, 255, 255)", O.fillRect(0, 0, P.width, P.height), O.restore();
297
+ const [R, k] = await Promise.all([
298
+ S.getPage(p),
299
+ N
300
+ ]);
301
+ if (d.current) {
302
+ h();
303
+ return;
304
+ }
305
+ const z = {
306
+ canvasContext: O,
307
+ transform: [I, 0, 0, I, 0, 0],
308
+ viewport: R.getViewport({ scale: 1, rotation: T.rotation }),
309
+ intent: "print",
310
+ annotationMode: mr.ENABLE_STORAGE,
311
+ optionalContentConfigPromise: x,
312
+ printAnnotationStorage: k
313
+ };
314
+ try {
315
+ return R.render(z).promise;
316
+ } catch (y) {
317
+ throw y instanceof fr || console.error(y), y;
318
+ }
319
+ }, b = L(() => {
320
+ const P = window.print;
321
+ return new Promise((S) => {
322
+ const p = (x) => {
323
+ setTimeout(() => {
324
+ P.call(window), setTimeout(() => x(), 20);
325
+ }, 0);
326
+ };
327
+ if (document.querySelector(".rp-print-zone")) {
328
+ p(S);
329
+ return;
330
+ }
331
+ const C = new MutationObserver(() => {
332
+ document.querySelector(".rp-print-zone") && (p(S), C.disconnect());
333
+ });
334
+ C.observe(document.body, { childList: !0, subtree: !0 });
335
+ });
336
+ }, []), v = async (P) => {
337
+ const S = document.createElement("img"), p = document.createElement("div");
338
+ return p.classList.add("rp-print-page"), await new Promise((T, C) => {
339
+ P.toBlob((x) => {
340
+ x ? (S.src = URL.createObjectURL(x), S.onload = () => {
341
+ URL.revokeObjectURL(S.src), T();
342
+ }, S.onerror = C) : C(new Error("Failed to create blob"));
343
+ });
344
+ }).catch(() => {
345
+ }), p.appendChild(S), p;
346
+ }, _ = (P, S) => {
347
+ const p = document.createElement("div");
348
+ p.classList.add("rp-print-zone");
349
+ const T = document.createElement("style"), C = S.get(1);
350
+ if (C) {
351
+ const { width: x, height: N } = C == null ? void 0 : C.page.getViewport({ scale: 1 });
352
+ T.innerHTML = `@page { size: ${x}px ${N}px }`;
353
+ }
354
+ return p.appendChild(T), p.append(...P), p;
355
+ }, m = L(async () => {
356
+ if (!e)
357
+ return;
358
+ h();
359
+ const P = document.createElement("canvas"), S = [];
360
+ try {
361
+ e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
362
+ const T = e.getOptionalContentConfig({ intent: "print" }), C = Promise.resolve(
363
+ e.annotationStorage.print ?? void 0
364
+ ), x = t.size;
365
+ for (const [I, O] of t) {
366
+ if (d.current) {
367
+ h();
368
+ return;
369
+ }
370
+ const R = O.page.getViewport({ scale: 1 });
371
+ if (await w({
372
+ scratchCanvas: P,
373
+ pdfDocument: e,
374
+ pageNumber: I,
375
+ viewerPdfPage: R,
376
+ printResolution: 150,
377
+ optionalContentConfigPromise: T,
378
+ printAnnotationStoragePromise: C
379
+ }), d.current) {
380
+ h();
381
+ return;
382
+ }
383
+ const k = await v(P);
384
+ S.push(k);
385
+ const z = parseFloat((S.length / x * 100).toFixed(2));
386
+ o({
387
+ loadedPages: I,
388
+ totalPages: x,
389
+ percentage: z
390
+ });
391
+ }
392
+ if (d.current) {
393
+ h();
394
+ return;
395
+ }
396
+ const N = _(S, t);
397
+ document.body.appendChild(N), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await b();
398
+ } catch (p) {
399
+ s(!0), p instanceof Error && u(p);
400
+ } finally {
401
+ P.height = 0, P.width = 0;
402
+ }
403
+ }, [e, t, d]);
404
+ return A(() => {
405
+ const P = () => {
406
+ h(), f();
407
+ };
408
+ return window.addEventListener("afterprint", P, !0), () => {
409
+ window.removeEventListener("afterprint", P, !0);
410
+ };
411
+ }, [f, h]), {
412
+ print: m,
413
+ cancel: g,
414
+ progress: n,
415
+ isComplete: r,
416
+ isError: c,
417
+ error: l
418
+ };
419
+ }, Tn = Ke({
420
+ print: () => {
421
+ },
422
+ cancel: () => {
423
+ },
424
+ setOnProgress: (e) => {
425
+ },
426
+ progress: {},
427
+ setOnComplete: (e) => e(),
428
+ setOnError: (e) => {
429
+ try {
430
+ const t = new Error("Print error occurred");
431
+ e(t);
432
+ } catch (t) {
433
+ console.error("Error in setOnError callback:", t);
434
+ }
435
+ }
436
+ }), Ps = ({ children: e }) => {
437
+ const [t, n] = $(null), [o, r] = $(null), { print: a, cancel: c, progress: s, isComplete: l, isError: u, error: d } = vo(), f = L((v) => {
438
+ v && typeof v == "function" && r(() => v);
439
+ }, []), h = (v) => {
440
+ d && v(d);
441
+ }, g = L(
442
+ (v) => {
443
+ n(() => v);
444
+ },
445
+ [s, t]
446
+ );
447
+ A(() => {
448
+ l && o && w();
449
+ }, [l, o]), A(() => {
450
+ u && h((v) => {
451
+ console.error(v);
452
+ });
453
+ }, [u]), A(() => {
454
+ s && t && t(s);
455
+ }, [s, t]);
456
+ const w = () => {
457
+ o && (o(), r(null));
458
+ }, b = {
459
+ print: a,
460
+ cancel: c,
461
+ setOnProgress: g,
462
+ setOnComplete: f,
463
+ setOnError: h,
464
+ progress: s
465
+ };
466
+ return /* @__PURE__ */ i(Tn.Provider, { value: b, children: e });
467
+ }, nt = () => {
468
+ const e = Xe(Tn);
469
+ if (!e)
470
+ throw new Error("usePrintContext must be used within a PrintProvider");
471
+ return e;
472
+ }, _o = () => {
473
+ const [e, t] = $({}), { pages: n } = K(), { rotate: o } = Ye(), r = F(() => Object.keys(e).length, [e]), a = L(
474
+ (s) => {
475
+ if (!n.size || s > n.size)
476
+ return;
477
+ const l = Array.from(n.values()).slice(0, s).map((f) => {
478
+ const { thumbnailViewport: h, scale: g } = Ht(f.page, o);
479
+ return {
480
+ scale: g,
481
+ page: f.page,
482
+ loading: !0,
483
+ viewport: h
484
+ };
485
+ }), u = l.reduce((f, h) => (f[h.page.pageNumber] = h, f), {});
486
+ t(u);
487
+ const d = [];
488
+ for (const f of l) {
489
+ const h = document.createElement("canvas"), g = wt(f.page, h, {
490
+ scale: f.scale,
491
+ rotate: o
492
+ }).promise.then(() => {
493
+ const w = h.toDataURL();
494
+ return {
495
+ ...f,
496
+ thumbnailSrc: w,
497
+ loading: !1
498
+ };
499
+ });
500
+ d.push(g);
501
+ }
502
+ Promise.all(d).then((f) => {
503
+ const h = f.reduce(
504
+ (g, w) => (g[w.page.pageNumber] = w, g),
505
+ {}
506
+ );
507
+ t((g) => ({ ...g, ...h }));
508
+ }).catch(() => {
509
+ });
510
+ },
511
+ [n, o]
512
+ );
513
+ A(() => {
514
+ a(10);
515
+ }, [a]);
516
+ const c = L(
517
+ (s) => {
518
+ if (!n)
519
+ return;
520
+ const l = n.get(s);
521
+ if (!l)
522
+ return;
523
+ t((d) => ({
524
+ ...d,
525
+ [s]: {
526
+ loading: !0,
527
+ page: l.page,
528
+ viewport: l.thumbnailViewport,
529
+ scale: l.thumbnailScale
530
+ }
531
+ }));
532
+ const u = document.createElement("canvas");
533
+ wt(l.page, u, { scale: l.thumbnailScale, rotate: o }).promise.then(() => {
534
+ const d = u.toDataURL(), { thumbnailViewport: f, scale: h } = Ht(l.page, o);
535
+ return {
536
+ scale: h,
537
+ thumbnailSrc: d,
538
+ page: l.page,
539
+ loading: !1,
540
+ viewport: f
541
+ };
542
+ }).then((d) => {
543
+ t((f) => ({ ...f, [s]: d }));
544
+ });
545
+ },
546
+ [n, o]
547
+ );
548
+ return { thumbnailPages: e, addPage: c, addToPage: a, thumbnailLength: r };
549
+ }, Pn = Ke({
550
+ thumbnailPages: {},
551
+ addPage: (e) => {
552
+ },
553
+ addToPage: (e) => {
554
+ },
555
+ thumbnailLength: 0,
556
+ setActive: (e) => {
557
+ },
558
+ active: !1
559
+ }), Sn = () => Xe(Pn), Ss = ({
560
+ children: e,
561
+ initialThumbnailsVisible: t
562
+ }) => {
563
+ const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a } = _o(), [c, s] = $(t);
564
+ return /* @__PURE__ */ i(
565
+ Pn.Provider,
566
+ {
567
+ value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a, active: c, setActive: s },
568
+ children: e
569
+ }
570
+ );
571
+ }, wo = (e = {}, t = "") => {
572
+ const [n, o] = $(t), [r, a] = $(!1), { pdf: c, pages: s } = K(), l = tt(), u = M(!n), { currentZoom: d } = Je(), [f, h] = $([]), { setFocusedPage: g } = ie(), [w, b] = $(0), { pageScrollElementRef: v, virtualScrollableElementRef: _ } = et(), { scrollMode: m } = Ee(), { pagesRef: P } = Te(), [S, p] = $(null), T = M({}), C = F(() => w === 0 ? null : f[w - 1], [w, f]), x = F(() => f.length, [f]);
573
+ A(() => {
574
+ if (!C || !s)
575
+ return;
576
+ const R = _ || v;
577
+ if (!R || !P)
578
+ return;
579
+ const k = s.get(C.page), z = P.clientHeight / 2, y = P.clientWidth / 2;
580
+ let E = 0, W = 0;
581
+ m === ee.PAGE_SCROLLING && g(C.page), m === ee.VERTICAL_SCROLLING && (E = l.heights.slice(0, C.page - 1).reduce((j, B) => j + B, 0)), m === ee.HORIZONTAL_SCROLLING && (W = l.widths.slice(0, C.page - 1).reduce((j, B) => j + B, 0));
582
+ let G;
583
+ if (!k)
584
+ return;
585
+ const Z = T.current[C.page], X = k.page.getViewport({ scale: 1 });
586
+ G = new Pt.TextLayer({
587
+ viewport: X,
588
+ textContentSource: Z,
589
+ container: document.createElement("div")
590
+ }), G.render().then(() => {
591
+ const j = G.textDivs[C.start.idx], [B] = pn([C], Z, G.textDivs), te = l.widths[C.page - 1], ae = l.heights[C.page - 1], Y = document.createElement("div"), ne = document.createElement("div");
592
+ j.style.position = "absolute", j.style.color = "transparent", ne.style.position = "absolute", ne.style.top = "0", ne.style.setProperty("--scale-factor", `${d}`), Y.style.position = "relative", Y.style.width = `${te}px`, Y.style.height = `${ae}px`, Y.style.zIndex = "-1", Y.appendChild(j), ne.appendChild(Y), P.prepend(ne);
593
+ const he = B.element.getBoundingClientRect(), ce = ne.getBoundingClientRect(), Oe = he.top - ce.top, we = he.left - ce.left, me = E + Oe - z + he.height / 2, le = W + we - y + he.width / 2, De = {
594
+ left: Math.max(le, 0),
595
+ top: Math.max(me, 0)
596
+ };
597
+ P.removeChild(ne), R.scrollTo({
598
+ ...De
599
+ });
600
+ });
601
+ }, [
602
+ s,
603
+ g,
604
+ l,
605
+ C,
606
+ m,
607
+ _,
608
+ v,
609
+ P
610
+ ]);
611
+ const N = L(() => {
612
+ b((R) => x ? R + 1 > x ? 1 : R + 1 : 0);
613
+ }, [x]), I = L(() => {
614
+ b((R) => x ? R - 1 <= 0 ? x : R - 1 : 0);
615
+ }, [x]), O = L(async (R) => {
616
+ if (!R)
617
+ return {};
618
+ const k = R.numPages, z = {};
619
+ for (let y = 1; y <= k; y++) {
620
+ if (u.current)
621
+ throw "close pop over";
622
+ const E = await R.getPage(y);
623
+ z[y.toString()] = await E.getTextContent();
624
+ }
625
+ return z;
626
+ }, []);
627
+ return A(() => {
628
+ if (!n) {
629
+ u.current = !0, h([]), b(0);
630
+ return;
631
+ }
632
+ u.current = !1, a(!0), h([]), b(0), O(c).then((R) => {
633
+ T.current = R;
634
+ const z = Object.keys(R).reduce((y, E) => {
635
+ const W = ur(
636
+ [n],
637
+ R[E],
638
+ Number(E) - 1,
639
+ e
640
+ ).map((G, Z) => ({ ...G, page: Number(E), pageMatchIdx: Z }));
641
+ return [...y, ...W];
642
+ }, []);
643
+ h(z), b(z.length ? 1 : 0);
644
+ }).catch(() => {
645
+ h([]), b(0);
646
+ }).finally(() => a(!1));
647
+ }, [n, O, c, e]), {
648
+ search: n,
649
+ setSearch: o,
650
+ loading: r,
651
+ matches: f,
652
+ totalMatches: x,
653
+ currentMatchPosition: w,
654
+ currentMatch: C,
655
+ nextMatch: N,
656
+ prevMatch: I,
657
+ currentMatchElement: S,
658
+ setCurrentMatchElement: p
659
+ };
660
+ }, xn = Ke({
661
+ search: "",
662
+ setSearch: (e) => {
663
+ },
664
+ loading: !1,
665
+ matches: [],
666
+ totalMatches: 0,
667
+ currentMatchPosition: 0,
668
+ currentMatch: null,
669
+ nextMatch: () => {
670
+ },
671
+ prevMatch: () => {
672
+ },
673
+ searchOptions: {},
674
+ setSearchOptions: (e) => e,
675
+ currentMatchElement: null,
676
+ setCurrentMatchElement: (e) => {
677
+ }
678
+ }), xs = ({
679
+ children: e,
680
+ initialSearch: t
681
+ }) => {
682
+ const [n, o] = $({}), {
683
+ loading: r,
684
+ setSearch: a,
685
+ totalMatches: c,
686
+ currentMatchPosition: s,
687
+ currentMatch: l,
688
+ search: u,
689
+ matches: d,
690
+ nextMatch: f,
691
+ prevMatch: h,
692
+ currentMatchElement: g,
693
+ setCurrentMatchElement: w
694
+ } = wo(n, t);
695
+ return /* @__PURE__ */ i(
696
+ xn.Provider,
697
+ {
698
+ value: {
699
+ searchOptions: n,
700
+ setSearchOptions: o,
701
+ loading: r,
702
+ setSearch: a,
703
+ totalMatches: c,
704
+ currentMatchPosition: s,
705
+ currentMatch: l,
706
+ nextMatch: f,
707
+ prevMatch: h,
708
+ search: u,
709
+ matches: d,
710
+ currentMatchElement: g,
711
+ setCurrentMatchElement: w
712
+ },
713
+ children: e
714
+ }
715
+ );
716
+ }, yn = () => Xe(xn), de = {
717
+ "rp-pages": "_rp-pages_1776r_1",
718
+ "rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_1776r_7",
719
+ "rp-pages-container": "_rp-pages-container_1776r_11",
720
+ "rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_1776r_17",
721
+ "rp-viewer": "_rp-viewer_1776r_22",
722
+ "rp-cursor-grab": "_rp-cursor-grab_1776r_27",
723
+ "rp-cursor-grabbing": "_rp-cursor-grabbing_1776r_35",
724
+ "rp-loader": "_rp-loader_1776r_43"
725
+ }, lt = {
726
+ "rp-page-wrapper": "_rp-page-wrapper_h7a2q_1",
727
+ "rp-page": "_rp-page_h7a2q_1",
728
+ "rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
729
+ }, bo = (e) => {
730
+ const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = M(null), { pages: a } = K(), { rotate: c } = Ye(), s = M(), { currentZoom: l } = Je();
731
+ return A(() => {
732
+ if (!a || l === 0)
733
+ return;
734
+ const u = a.get(t);
735
+ if (r.current && u) {
736
+ const d = r.current;
737
+ d.hidden = !0;
738
+ const f = s.current;
739
+ f && f.cancel(), o && o(), s.current = wt(u.page, d, {
740
+ scale: l,
741
+ rotate: c,
742
+ renderForms: !0
743
+ }), s.current.promise.then(() => {
744
+ d.hidden = !1;
745
+ }).catch(() => {
746
+ }).finally(() => {
747
+ n && n();
748
+ });
749
+ }
750
+ return () => {
751
+ var d;
752
+ (d = s.current) == null || d.cancel();
753
+ };
754
+ }, [a, t, c, l, o, n]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${t}-canvas`, ref: r });
755
+ }, dt = {
756
+ "rp-text-layer": "_rp-text-layer_kwwfn_1",
757
+ "rp-text-layer-text": "_rp-text-layer-text_kwwfn_9"
758
+ }, Co = (e) => {
759
+ const { pageNumber: t } = e, { pages: n } = K(), o = M(null), { matches: r, currentMatch: a, setCurrentMatchElement: c } = yn(), [s, l] = $(
760
+ []
761
+ ), u = M(), d = M(), f = M(), h = F(() => r.filter((w) => w.pageIndex === t - 1), [r, t]), g = L(
762
+ (w, b, v = !1) => {
763
+ if (v && hn(w, b), !h.length) {
764
+ f.current = void 0, l([]);
765
+ return;
766
+ }
767
+ const _ = pn(h, w, b);
768
+ l(_);
769
+ },
770
+ [h]
771
+ );
772
+ return A(() => {
773
+ var v;
774
+ if ((v = f.current) == null || v.classList.remove("selected"), !s.length || !a || a.pageIndex !== t - 1)
775
+ return;
776
+ const w = h.findIndex(
777
+ (_) => JSON.stringify(_) === JSON.stringify(a)
778
+ );
779
+ if (w === -1)
780
+ return;
781
+ const b = s.find((_) => _.index === w);
782
+ b && (f.current = b.element, c(b.element), b.element.classList.add("selected"));
783
+ }, [a, s, h]), A(() => {
784
+ const w = n.get(t);
785
+ if (!w || !o.current)
786
+ return;
787
+ const b = o.current;
788
+ return u.current && u.current.cancel(), w.page.getTextContent().then((v) => {
789
+ const _ = w.page.getViewport({ scale: 1 });
790
+ return u.current = new Pt.TextLayer({
791
+ viewport: _,
792
+ textContentSource: v,
793
+ container: b
794
+ }), d.current = v, b && (b.innerText = ""), u.current.render();
795
+ }).then(() => {
796
+ var m;
797
+ [].slice.call(b.children).forEach((P) => {
798
+ P.classList.add(dt["rp-text-layer-text"]);
799
+ });
800
+ const _ = (m = u.current) == null ? void 0 : m.textDivs;
801
+ _ && d.current && g(d.current, _);
802
+ }).catch(() => {
803
+ }), () => {
804
+ var v;
805
+ (v = u.current) == null || v.cancel();
806
+ };
807
+ }, [n, t]), A(() => {
808
+ var v;
809
+ [].slice.call(o.current.children).forEach((_) => {
810
+ _.classList.add(dt["rp-text-layer-text"]);
811
+ });
812
+ const b = (v = u.current) == null ? void 0 : v.textDivs;
813
+ b && d.current && g(d.current, b, !0);
814
+ }, [g]), /* @__PURE__ */ i(
815
+ "div",
816
+ {
817
+ "data-rp": `page-${t}-textLayer`,
818
+ className: dt["rp-text-layer"],
819
+ ref: o
820
+ }
821
+ );
822
+ }, To = {
823
+ "rp-annotation-layer": "_rp-annotation-layer_o0ksd_1"
824
+ };
825
+ let Po = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
826
+ const So = (e) => {
827
+ const { pageNumber: t } = e, n = M(null), { pages: o, pdf: r } = K(), a = M(), [c, s] = $(), { setFocusedPage: l, goToPage: u } = ie(), { scrollMode: d } = Ee(), { print: f } = nt(), { download: h } = Un(), g = F(() => o.get(t), [o, t]), w = F(() => g == null ? void 0 : g.page.getViewport(), [g]);
828
+ A(() => {
829
+ a.current && (a.current.div.replaceChildren(), a.current = void 0);
830
+ }, [r]), A(() => {
831
+ g && g.page.getAnnotations().then((v) => {
832
+ a.current = void 0, s(v), n.current && (n.current.innerText = "");
833
+ });
834
+ }, [g]);
835
+ const b = L(
836
+ (v) => {
837
+ !c || !r || (Nr(v), Er(v, r, c).then((_) => {
838
+ var m, P;
839
+ ((m = _ == null ? void 0 : _.data) == null ? void 0 : m.action) === "Print" ? f() : ((P = _ == null ? void 0 : _.data) == null ? void 0 : P.action) === "SaveAs" && h();
840
+ }), d === ee.PAGE_SCROLLING ? Mt(v, c, r, (_) => l(_.pageIndex + 1)) : Mt(v, c, r, (_) => u(_.pageIndex + 1)));
841
+ },
842
+ [r, c, u, l, d, f, h]
843
+ );
844
+ return A(() => {
845
+ if (!g || !c)
846
+ return;
847
+ const v = g.page.getViewport();
848
+ if (a.current) {
849
+ a.current.update({
850
+ viewport: v.clone({ dontFlip: !0 })
851
+ });
852
+ return;
853
+ }
854
+ const _ = /* @__PURE__ */ new Map([]);
855
+ for (const S of c) {
856
+ const { annotationType: p } = S;
857
+ switch (p) {
858
+ case kt.Link:
859
+ Dr(S);
860
+ break;
861
+ case kt.Widget:
862
+ Or(S, v, _);
863
+ break;
864
+ }
865
+ }
866
+ const m = new AbortController();
867
+ return (async () => {
868
+ var T;
869
+ a.current && (a.current.div.replaceChildren(), a.current = void 0), n.current && (n.current.innerText = ""), a.current = new gr({
870
+ div: n.current,
871
+ accessibilityManager: void 0,
872
+ annotationCanvasMap: void 0,
873
+ annotationEditorUIManager: void 0,
874
+ structTreeLayer: null,
875
+ page: g.page,
876
+ viewport: v.clone({ dontFlip: !0 })
877
+ }), n.current && Wt(n.current, b);
878
+ const S = await (r == null ? void 0 : r.hasJSActions()), p = await (r == null ? void 0 : r.getFieldObjects());
879
+ if (m.signal.aborted)
880
+ throw "abort";
881
+ return (T = a.current) == null ? void 0 : T.render({
882
+ annotations: c,
883
+ annotationStorage: r == null ? void 0 : r.annotationStorage,
884
+ hasJSActions: S,
885
+ fieldObjects: p,
886
+ div: n.current,
887
+ viewport: v.clone({ dontFlip: !0 }),
888
+ page: g.page,
889
+ imageResourcesPath: Po,
890
+ renderForms: !0,
891
+ linkService: new Rr(),
892
+ downloadManager: null,
893
+ enableScripting: !1
894
+ });
895
+ })().then(() => {
896
+ n.current && zr(n.current, b);
897
+ }).catch((S) => {
898
+ if (S !== "abort")
899
+ throw S;
900
+ }), () => {
901
+ m.abort("clear"), n.current && Wt(n.current, b);
902
+ };
903
+ }, [r, c, b]), /* @__PURE__ */ i(
904
+ "div",
905
+ {
906
+ "data-rp": `page-${t}-annotationLayer`,
907
+ style: { width: `${w == null ? void 0 : w.width}px`, height: `${w == null ? void 0 : w.height}px` },
908
+ className: To["rp-annotation-layer"],
909
+ ref: n
910
+ }
911
+ );
912
+ }, ut = {
913
+ "rp-text-highlight-layer": "_rp-text-highlight-layer_1470i_1",
914
+ "rp-text-highlight-layer-text": "_rp-text-highlight-layer-text_1470i_9"
915
+ }, xo = ({ pageNumber: e }) => {
916
+ const t = M(null), n = M(), o = M(), { pages: r } = K(), { highlightMatches: a } = vr(), c = F(() => a.filter((u) => u.pageIndex === e - 1), [a]), s = L(
917
+ (l, u, d = !1) => {
918
+ d && hn(l, u), pr(c, l, u);
919
+ },
920
+ [c, r, e]
921
+ );
922
+ return A(() => {
923
+ const l = r.get(e);
924
+ if (!l || !t.current)
925
+ return;
926
+ const u = t.current;
927
+ return n.current && n.current.cancel(), l.page.getTextContent().then((d) => {
928
+ const f = l.page.getViewport({ scale: 1 });
929
+ return n.current = new Pt.TextLayer({
930
+ viewport: f,
931
+ textContentSource: d,
932
+ container: u
933
+ }), o.current = d, u && (u.innerText = ""), n.current.render();
934
+ }).then(() => {
935
+ var h;
936
+ [].slice.call(u.children).forEach((g) => {
937
+ g.classList.add(ut["rp-text-highlight-layer-text"]);
938
+ });
939
+ const f = (h = n.current) == null ? void 0 : h.textDivs;
940
+ f && o.current && s(o.current, f);
941
+ }).catch(() => {
942
+ }), () => {
943
+ var d;
944
+ (d = n.current) == null || d.cancel();
945
+ };
946
+ }, [r, e]), A(() => {
947
+ var d;
948
+ [].slice.call(t.current.children).forEach((f) => {
949
+ f.classList.add(ut["rp-text-highlight-layer-text"]);
950
+ });
951
+ const u = (d = n.current) == null ? void 0 : d.textDivs;
952
+ u && o.current && s(o.current, u, !0);
953
+ }, [s]), /* @__PURE__ */ i(xe, { children: /* @__PURE__ */ i(
954
+ "div",
955
+ {
956
+ "data-rp": `page-${e}-textHighlightLayer`,
957
+ className: ut["rp-text-highlight-layer"],
958
+ ref: t
959
+ }
960
+ ) });
961
+ }, Nt = We((e, t) => {
962
+ const { pageNumber: n, style: o, ...r } = e, { pages: a } = K(), { rotate: c } = Ye(), { textLayer: s } = sr(), { currentZoom: l } = Je(), u = M(a.get(n)), [d, f] = $(!1), h = M(null), [g, w] = $({
963
+ width: 0,
964
+ height: 0
965
+ });
966
+ ln(t, () => h.current), A(() => {
967
+ if (a && (u.current = a.get(n), u.current)) {
968
+ const m = u.current.page.getViewport({ scale: l, rotation: c });
969
+ w(m);
970
+ }
971
+ }, [a, n, c, l]);
972
+ const b = F(() => {
973
+ switch (c) {
974
+ case 90:
975
+ return `${g.width / 2}px ${g.width / 2}px`;
976
+ case -90:
977
+ case 270:
978
+ return `${g.height / 2}px ${g.height / 2}px`;
979
+ default:
980
+ return "center";
981
+ }
982
+ }, [c, g]), v = L(() => {
983
+ f(!0);
984
+ }, []), _ = L(() => {
985
+ f(!1);
986
+ }, []);
987
+ return /* @__PURE__ */ i(
988
+ "div",
989
+ {
990
+ ref: h,
991
+ id: `page-${n}`,
992
+ "data-rp": `page-${n}`,
993
+ ...r,
994
+ style: {
995
+ ...o,
996
+ "--rp-rotate": `${c}deg`,
997
+ "--rp-page-rotate-translate": `${b}`,
998
+ "--scale-factor": l
999
+ },
1000
+ className: lt["rp-page-wrapper"],
1001
+ children: /* @__PURE__ */ D(
1002
+ "div",
1003
+ {
1004
+ style: {
1005
+ width: `${g.width}px`,
1006
+ height: `${g.height}px`
1007
+ },
1008
+ className: lt["rp-page"],
1009
+ children: [
1010
+ /* @__PURE__ */ i(bo, { onLoading: v, onLoaded: _, pageNumber: n }),
1011
+ d && /* @__PURE__ */ i("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ i(xt, {}) }),
1012
+ s && /* @__PURE__ */ i(Co, { pageNumber: n }),
1013
+ /* @__PURE__ */ i(xo, { pageNumber: n }),
1014
+ /* @__PURE__ */ i(So, { pageNumber: n })
1015
+ ]
1016
+ }
1017
+ )
1018
+ }
1019
+ );
1020
+ });
1021
+ function qt(e) {
1022
+ if (e === void 0)
1023
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1024
+ return e;
1025
+ }
1026
+ function bt(e, t) {
1027
+ return bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
1028
+ return n.__proto__ = o, n;
1029
+ }, bt(e, t);
1030
+ }
1031
+ function yo(e, t) {
1032
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, bt(e, t);
1033
+ }
1034
+ var Zt = Number.isNaN || function(t) {
1035
+ return typeof t == "number" && t !== t;
1036
+ };
1037
+ function Io(e, t) {
1038
+ return !!(e === t || Zt(e) && Zt(t));
1039
+ }
1040
+ function Lo(e, t) {
1041
+ if (e.length !== t.length)
1042
+ return !1;
1043
+ for (var n = 0; n < e.length; n++)
1044
+ if (!Io(e[n], t[n]))
1045
+ return !1;
1046
+ return !0;
1047
+ }
1048
+ function pt(e, t) {
1049
+ t === void 0 && (t = Lo);
1050
+ var n, o = [], r, a = !1;
1051
+ function c() {
1052
+ for (var s = [], l = 0; l < arguments.length; l++)
1053
+ s[l] = arguments[l];
1054
+ return a && n === this && t(s, o) || (r = e.apply(this, s), a = !0, n = this, o = s), r;
1055
+ }
1056
+ return c;
1057
+ }
1058
+ function Bt(e, t) {
1059
+ if (e == null)
1060
+ return {};
1061
+ var n = {};
1062
+ for (var o in e)
1063
+ if ({}.hasOwnProperty.call(e, o)) {
1064
+ if (t.indexOf(o) !== -1)
1065
+ continue;
1066
+ n[o] = e[o];
1067
+ }
1068
+ return n;
1069
+ }
1070
+ var Ro = typeof performance == "object" && typeof performance.now == "function", jt = Ro ? function() {
1071
+ return performance.now();
1072
+ } : function() {
1073
+ return Date.now();
1074
+ };
1075
+ function Kt(e) {
1076
+ cancelAnimationFrame(e.id);
1077
+ }
1078
+ function No(e, t) {
1079
+ var n = jt();
1080
+ function o() {
1081
+ jt() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);
1082
+ }
1083
+ var r = {
1084
+ id: requestAnimationFrame(o)
1085
+ };
1086
+ return r;
1087
+ }
1088
+ var ht = -1;
1089
+ function Eo(e) {
1090
+ if (e === void 0 && (e = !1), ht === -1 || e) {
1091
+ var t = document.createElement("div"), n = t.style;
1092
+ n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), ht = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
1093
+ }
1094
+ return ht;
1095
+ }
1096
+ var Le = null;
1097
+ function Xt(e) {
1098
+ if (e === void 0 && (e = !1), Le === null || e) {
1099
+ var t = document.createElement("div"), n = t.style;
1100
+ n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
1101
+ var o = document.createElement("div"), r = o.style;
1102
+ return r.width = "100px", r.height = "100px", t.appendChild(o), document.body.appendChild(t), t.scrollLeft > 0 ? Le = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? Le = "negative" : Le = "positive-ascending"), document.body.removeChild(t), Le;
1103
+ }
1104
+ return Le;
1105
+ }
1106
+ var Oo = 150, Do = function(t) {
1107
+ var n = t.columnIndex;
1108
+ t.data;
1109
+ var o = t.rowIndex;
1110
+ return o + ":" + n;
1111
+ }, Ge = null, Ue = null, qe = null;
1112
+ process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Ge = /* @__PURE__ */ new WeakSet(), Ue = /* @__PURE__ */ new WeakSet(), qe = /* @__PURE__ */ new WeakSet());
1113
+ function zo(e) {
1114
+ var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, c = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, l = e.getOffsetForColumnAndAlignment, u = e.getOffsetForRowAndAlignment, d = e.getRowHeight, f = e.getRowOffset, h = e.getRowStartIndexForOffset, g = e.getRowStopIndexForStartIndex, w = e.initInstanceProps, b = e.shouldResetStyleCacheOnItemSizeChange, v = e.validateProps;
1115
+ return t = /* @__PURE__ */ function(_) {
1116
+ yo(m, _);
1117
+ function m(S) {
1118
+ var p;
1119
+ return p = _.call(this, S) || this, p._instanceProps = w(p.props, qt(p)), p._resetIsScrollingTimeoutId = null, p._outerRef = void 0, p.state = {
1120
+ instance: qt(p),
1121
+ isScrolling: !1,
1122
+ horizontalScrollDirection: "forward",
1123
+ scrollLeft: typeof p.props.initialScrollLeft == "number" ? p.props.initialScrollLeft : 0,
1124
+ scrollTop: typeof p.props.initialScrollTop == "number" ? p.props.initialScrollTop : 0,
1125
+ scrollUpdateWasRequested: !1,
1126
+ verticalScrollDirection: "forward"
1127
+ }, p._callOnItemsRendered = void 0, p._callOnItemsRendered = pt(function(T, C, x, N, I, O, R, k) {
1128
+ return p.props.onItemsRendered({
1129
+ overscanColumnStartIndex: T,
1130
+ overscanColumnStopIndex: C,
1131
+ overscanRowStartIndex: x,
1132
+ overscanRowStopIndex: N,
1133
+ visibleColumnStartIndex: I,
1134
+ visibleColumnStopIndex: O,
1135
+ visibleRowStartIndex: R,
1136
+ visibleRowStopIndex: k
1137
+ });
1138
+ }), p._callOnScroll = void 0, p._callOnScroll = pt(function(T, C, x, N, I) {
1139
+ return p.props.onScroll({
1140
+ horizontalScrollDirection: x,
1141
+ scrollLeft: T,
1142
+ scrollTop: C,
1143
+ verticalScrollDirection: N,
1144
+ scrollUpdateWasRequested: I
1145
+ });
1146
+ }), p._getItemStyle = void 0, p._getItemStyle = function(T, C) {
1147
+ var x = p.props, N = x.columnWidth, I = x.direction, O = x.rowHeight, R = p._getItemStyleCache(b && N, b && I, b && O), k = T + ":" + C, z;
1148
+ if (R.hasOwnProperty(k))
1149
+ z = R[k];
1150
+ else {
1151
+ var y = n(p.props, C, p._instanceProps), E = I === "rtl";
1152
+ R[k] = z = {
1153
+ position: "absolute",
1154
+ left: E ? void 0 : y,
1155
+ right: E ? y : void 0,
1156
+ top: f(p.props, T, p._instanceProps),
1157
+ height: d(p.props, T, p._instanceProps),
1158
+ width: a(p.props, C, p._instanceProps)
1159
+ };
1160
+ }
1161
+ return z;
1162
+ }, p._getItemStyleCache = void 0, p._getItemStyleCache = pt(function(T, C, x) {
1163
+ return {};
1164
+ }), p._onScroll = function(T) {
1165
+ var C = T.currentTarget, x = C.clientHeight, N = C.clientWidth, I = C.scrollLeft, O = C.scrollTop, R = C.scrollHeight, k = C.scrollWidth;
1166
+ p.setState(function(z) {
1167
+ if (z.scrollLeft === I && z.scrollTop === O)
1168
+ return null;
1169
+ var y = p.props.direction, E = I;
1170
+ if (y === "rtl")
1171
+ switch (Xt()) {
1172
+ case "negative":
1173
+ E = -I;
1174
+ break;
1175
+ case "positive-descending":
1176
+ E = k - N - I;
1177
+ break;
1178
+ }
1179
+ E = Math.max(0, Math.min(E, k - N));
1180
+ var W = Math.max(0, Math.min(O, R - x));
1181
+ return {
1182
+ isScrolling: !0,
1183
+ horizontalScrollDirection: z.scrollLeft < I ? "forward" : "backward",
1184
+ scrollLeft: E,
1185
+ scrollTop: W,
1186
+ verticalScrollDirection: z.scrollTop < O ? "forward" : "backward",
1187
+ scrollUpdateWasRequested: !1
1188
+ };
1189
+ }, p._resetIsScrollingDebounced);
1190
+ }, p._outerRefSetter = function(T) {
1191
+ var C = p.props.outerRef;
1192
+ p._outerRef = T, typeof C == "function" ? C(T) : C != null && typeof C == "object" && C.hasOwnProperty("current") && (C.current = T);
1193
+ }, p._resetIsScrollingDebounced = function() {
1194
+ p._resetIsScrollingTimeoutId !== null && Kt(p._resetIsScrollingTimeoutId), p._resetIsScrollingTimeoutId = No(p._resetIsScrolling, Oo);
1195
+ }, p._resetIsScrolling = function() {
1196
+ p._resetIsScrollingTimeoutId = null, p.setState({
1197
+ isScrolling: !1
1198
+ }, function() {
1199
+ p._getItemStyleCache(-1);
1200
+ });
1201
+ }, p;
1202
+ }
1203
+ m.getDerivedStateFromProps = function(p, T) {
1204
+ return Ao(p, T), v(p), null;
1205
+ };
1206
+ var P = m.prototype;
1207
+ return P.scrollTo = function(p) {
1208
+ var T = p.scrollLeft, C = p.scrollTop;
1209
+ T !== void 0 && (T = Math.max(0, T)), C !== void 0 && (C = Math.max(0, C)), this.setState(function(x) {
1210
+ return T === void 0 && (T = x.scrollLeft), C === void 0 && (C = x.scrollTop), x.scrollLeft === T && x.scrollTop === C ? null : {
1211
+ horizontalScrollDirection: x.scrollLeft < T ? "forward" : "backward",
1212
+ scrollLeft: T,
1213
+ scrollTop: C,
1214
+ scrollUpdateWasRequested: !0,
1215
+ verticalScrollDirection: x.scrollTop < C ? "forward" : "backward"
1216
+ };
1217
+ }, this._resetIsScrollingDebounced);
1218
+ }, P.scrollToItem = function(p) {
1219
+ var T = p.align, C = T === void 0 ? "auto" : T, x = p.columnIndex, N = p.rowIndex, I = this.props, O = I.columnCount, R = I.height, k = I.rowCount, z = I.width, y = this.state, E = y.scrollLeft, W = y.scrollTop, G = Eo();
1220
+ x !== void 0 && (x = Math.max(0, Math.min(x, O - 1))), N !== void 0 && (N = Math.max(0, Math.min(N, k - 1)));
1221
+ var Z = c(this.props, this._instanceProps), X = s(this.props, this._instanceProps), j = X > z ? G : 0, B = Z > R ? G : 0;
1222
+ this.scrollTo({
1223
+ scrollLeft: x !== void 0 ? l(this.props, x, C, E, this._instanceProps, B) : E,
1224
+ scrollTop: N !== void 0 ? u(this.props, N, C, W, this._instanceProps, j) : W
1225
+ });
1226
+ }, P.componentDidMount = function() {
1227
+ var p = this.props, T = p.initialScrollLeft, C = p.initialScrollTop;
1228
+ if (this._outerRef != null) {
1229
+ var x = this._outerRef;
1230
+ typeof T == "number" && (x.scrollLeft = T), typeof C == "number" && (x.scrollTop = C);
1231
+ }
1232
+ this._callPropsCallbacks();
1233
+ }, P.componentDidUpdate = function() {
1234
+ var p = this.props.direction, T = this.state, C = T.scrollLeft, x = T.scrollTop, N = T.scrollUpdateWasRequested;
1235
+ if (N && this._outerRef != null) {
1236
+ var I = this._outerRef;
1237
+ if (p === "rtl")
1238
+ switch (Xt()) {
1239
+ case "negative":
1240
+ I.scrollLeft = -C;
1241
+ break;
1242
+ case "positive-ascending":
1243
+ I.scrollLeft = C;
1244
+ break;
1245
+ default:
1246
+ var O = I.clientWidth, R = I.scrollWidth;
1247
+ I.scrollLeft = R - O - C;
1248
+ break;
1249
+ }
1250
+ else
1251
+ I.scrollLeft = Math.max(0, C);
1252
+ I.scrollTop = Math.max(0, x);
1253
+ }
1254
+ this._callPropsCallbacks();
1255
+ }, P.componentWillUnmount = function() {
1256
+ this._resetIsScrollingTimeoutId !== null && Kt(this._resetIsScrollingTimeoutId);
1257
+ }, P.render = function() {
1258
+ var p = this.props, T = p.children, C = p.className, x = p.columnCount, N = p.direction, I = p.height, O = p.innerRef, R = p.innerElementType, k = p.innerTagName, z = p.itemData, y = p.itemKey, E = y === void 0 ? Do : y, W = p.outerElementType, G = p.outerTagName, Z = p.rowCount, X = p.style, j = p.useIsScrolling, B = p.width, te = this.state.isScrolling, ae = this._getHorizontalRangeToRender(), Y = ae[0], ne = ae[1], he = this._getVerticalRangeToRender(), ce = he[0], Oe = he[1], we = [];
1259
+ if (x > 0 && Z)
1260
+ for (var me = ce; me <= Oe; me++)
1261
+ for (var le = Y; le <= ne; le++)
1262
+ we.push(Ve(T, {
1263
+ columnIndex: le,
1264
+ data: z,
1265
+ isScrolling: j ? te : void 0,
1266
+ key: E({
1267
+ columnIndex: le,
1268
+ data: z,
1269
+ rowIndex: me
1270
+ }),
1271
+ rowIndex: me,
1272
+ style: this._getItemStyle(me, le)
1273
+ }));
1274
+ var De = c(this.props, this._instanceProps), rt = s(this.props, this._instanceProps);
1275
+ return Ve(W || G || "div", {
1276
+ className: C,
1277
+ onScroll: this._onScroll,
1278
+ ref: this._outerRefSetter,
1279
+ style: Ar({
1280
+ position: "relative",
1281
+ height: I,
1282
+ width: B,
1283
+ overflow: "auto",
1284
+ WebkitOverflowScrolling: "touch",
1285
+ willChange: "transform",
1286
+ direction: N
1287
+ }, X)
1288
+ }, Ve(R || k || "div", {
1289
+ children: we,
1290
+ ref: O,
1291
+ style: {
1292
+ height: De,
1293
+ pointerEvents: te ? "none" : void 0,
1294
+ width: rt
1295
+ }
1296
+ }));
1297
+ }, P._callPropsCallbacks = function() {
1298
+ var p = this.props, T = p.columnCount, C = p.onItemsRendered, x = p.onScroll, N = p.rowCount;
1299
+ if (typeof C == "function" && T > 0 && N > 0) {
1300
+ var I = this._getHorizontalRangeToRender(), O = I[0], R = I[1], k = I[2], z = I[3], y = this._getVerticalRangeToRender(), E = y[0], W = y[1], G = y[2], Z = y[3];
1301
+ this._callOnItemsRendered(O, R, E, W, k, z, G, Z);
1302
+ }
1303
+ if (typeof x == "function") {
1304
+ var X = this.state, j = X.horizontalScrollDirection, B = X.scrollLeft, te = X.scrollTop, ae = X.scrollUpdateWasRequested, Y = X.verticalScrollDirection;
1305
+ this._callOnScroll(B, te, j, Y, ae);
1306
+ }
1307
+ }, P._getHorizontalRangeToRender = function() {
1308
+ var p = this.props, T = p.columnCount, C = p.overscanColumnCount, x = p.overscanColumnsCount, N = p.overscanCount, I = p.rowCount, O = this.state, R = O.horizontalScrollDirection, k = O.isScrolling, z = O.scrollLeft, y = C || x || N || 1;
1309
+ if (T === 0 || I === 0)
1310
+ return [0, 0, 0, 0];
1311
+ var E = o(this.props, z, this._instanceProps), W = r(this.props, E, z, this._instanceProps), G = !k || R === "backward" ? Math.max(1, y) : 1, Z = !k || R === "forward" ? Math.max(1, y) : 1;
1312
+ return [Math.max(0, E - G), Math.max(0, Math.min(T - 1, W + Z)), E, W];
1313
+ }, P._getVerticalRangeToRender = function() {
1314
+ var p = this.props, T = p.columnCount, C = p.overscanCount, x = p.overscanRowCount, N = p.overscanRowsCount, I = p.rowCount, O = this.state, R = O.isScrolling, k = O.verticalScrollDirection, z = O.scrollTop, y = x || N || C || 1;
1315
+ if (T === 0 || I === 0)
1316
+ return [0, 0, 0, 0];
1317
+ var E = h(this.props, z, this._instanceProps), W = g(this.props, E, z, this._instanceProps), G = !R || k === "backward" ? Math.max(1, y) : 1, Z = !R || k === "forward" ? Math.max(1, y) : 1;
1318
+ return [Math.max(0, E - G), Math.max(0, Math.min(I - 1, W + Z)), E, W];
1319
+ }, m;
1320
+ }(nr), t.defaultProps = {
1321
+ direction: "ltr",
1322
+ itemData: void 0,
1323
+ useIsScrolling: !1
1324
+ }, t;
1325
+ }
1326
+ var Ao = function(t, n) {
1327
+ var o = t.children, r = t.direction, a = t.height, c = t.innerTagName, s = t.outerTagName, l = t.overscanColumnsCount, u = t.overscanCount, d = t.overscanRowsCount, f = t.width, h = n.instance;
1328
+ if (process.env.NODE_ENV !== "production") {
1329
+ if (typeof u == "number" && Ge && !Ge.has(h) && (Ge.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof l == "number" || typeof d == "number") && Ue && !Ue.has(h) && (Ue.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || s != null) && qe && !qe.has(h) && (qe.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
1330
+ throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
1331
+ switch (r) {
1332
+ case "ltr":
1333
+ case "rtl":
1334
+ break;
1335
+ default:
1336
+ throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + r + '" was specified.'));
1337
+ }
1338
+ if (typeof f != "number")
1339
+ throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (f === null ? "null" : typeof f) + '" was specified.'));
1340
+ if (typeof a != "number")
1341
+ throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
1342
+ }
1343
+ }, Yt = 50, In = function(t, n) {
1344
+ var o = t.rowCount, r = n.rowMetadataMap, a = n.estimatedRowHeight, c = n.lastMeasuredRowIndex, s = 0;
1345
+ if (c >= o && (c = o - 1), c >= 0) {
1346
+ var l = r[c];
1347
+ s = l.offset + l.size;
1348
+ }
1349
+ var u = o - c - 1, d = u * a;
1350
+ return s + d;
1351
+ }, Ln = function(t, n) {
1352
+ var o = t.columnCount, r = n.columnMetadataMap, a = n.estimatedColumnWidth, c = n.lastMeasuredColumnIndex, s = 0;
1353
+ if (c >= o && (c = o - 1), c >= 0) {
1354
+ var l = r[c];
1355
+ s = l.offset + l.size;
1356
+ }
1357
+ var u = o - c - 1, d = u * a;
1358
+ return s + d;
1359
+ }, ve = function(t, n, o, r) {
1360
+ var a, c, s;
1361
+ if (t === "column" ? (a = r.columnMetadataMap, c = n.columnWidth, s = r.lastMeasuredColumnIndex) : (a = r.rowMetadataMap, c = n.rowHeight, s = r.lastMeasuredRowIndex), o > s) {
1362
+ var l = 0;
1363
+ if (s >= 0) {
1364
+ var u = a[s];
1365
+ l = u.offset + u.size;
1366
+ }
1367
+ for (var d = s + 1; d <= o; d++) {
1368
+ var f = c(d);
1369
+ a[d] = {
1370
+ offset: l,
1371
+ size: f
1372
+ }, l += f;
1373
+ }
1374
+ t === "column" ? r.lastMeasuredColumnIndex = o : r.lastMeasuredRowIndex = o;
1375
+ }
1376
+ return a[o];
1377
+ }, Jt = function(t, n, o, r) {
1378
+ var a, c;
1379
+ t === "column" ? (a = o.columnMetadataMap, c = o.lastMeasuredColumnIndex) : (a = o.rowMetadataMap, c = o.lastMeasuredRowIndex);
1380
+ var s = c > 0 ? a[c].offset : 0;
1381
+ return s >= r ? Rn(t, n, o, c, 0, r) : Fo(t, n, o, Math.max(0, c), r);
1382
+ }, Rn = function(t, n, o, r, a, c) {
1383
+ for (; a <= r; ) {
1384
+ var s = a + Math.floor((r - a) / 2), l = ve(t, n, s, o).offset;
1385
+ if (l === c)
1386
+ return s;
1387
+ l < c ? a = s + 1 : l > c && (r = s - 1);
1388
+ }
1389
+ return a > 0 ? a - 1 : 0;
1390
+ }, Fo = function(t, n, o, r, a) {
1391
+ for (var c = t === "column" ? n.columnCount : n.rowCount, s = 1; r < c && ve(t, n, r, o).offset < a; )
1392
+ r += s, s *= 2;
1393
+ return Rn(t, n, o, Math.min(r, c - 1), Math.floor(r / 2), a);
1394
+ }, Qt = function(t, n, o, r, a, c, s) {
1395
+ var l = t === "column" ? n.width : n.height, u = ve(t, n, o, c), d = t === "column" ? Ln(n, c) : In(n, c), f = Math.max(0, Math.min(d - l, u.offset)), h = Math.max(0, u.offset - l + s + u.size);
1396
+ switch (r === "smart" && (a >= h - l && a <= f + l ? r = "auto" : r = "center"), r) {
1397
+ case "start":
1398
+ return f;
1399
+ case "end":
1400
+ return h;
1401
+ case "center":
1402
+ return Math.round(h + (f - h) / 2);
1403
+ case "auto":
1404
+ default:
1405
+ return a >= h && a <= f ? a : h > f || a < h ? h : f;
1406
+ }
1407
+ }, ko = /* @__PURE__ */ zo({
1408
+ getColumnOffset: function(t, n, o) {
1409
+ return ve("column", t, n, o).offset;
1410
+ },
1411
+ getColumnStartIndexForOffset: function(t, n, o) {
1412
+ return Jt("column", t, o, n);
1413
+ },
1414
+ getColumnStopIndexForStartIndex: function(t, n, o, r) {
1415
+ for (var a = t.columnCount, c = t.width, s = ve("column", t, n, r), l = o + c, u = s.offset + s.size, d = n; d < a - 1 && u < l; )
1416
+ d++, u += ve("column", t, d, r).size;
1417
+ return d;
1418
+ },
1419
+ getColumnWidth: function(t, n, o) {
1420
+ return o.columnMetadataMap[n].size;
1421
+ },
1422
+ getEstimatedTotalHeight: In,
1423
+ getEstimatedTotalWidth: Ln,
1424
+ getOffsetForColumnAndAlignment: function(t, n, o, r, a, c) {
1425
+ return Qt("column", t, n, o, r, a, c);
1426
+ },
1427
+ getOffsetForRowAndAlignment: function(t, n, o, r, a, c) {
1428
+ return Qt("row", t, n, o, r, a, c);
1429
+ },
1430
+ getRowOffset: function(t, n, o) {
1431
+ return ve("row", t, n, o).offset;
1432
+ },
1433
+ getRowHeight: function(t, n, o) {
1434
+ return o.rowMetadataMap[n].size;
1435
+ },
1436
+ getRowStartIndexForOffset: function(t, n, o) {
1437
+ return Jt("row", t, o, n);
1438
+ },
1439
+ getRowStopIndexForStartIndex: function(t, n, o, r) {
1440
+ for (var a = t.rowCount, c = t.height, s = ve("row", t, n, r), l = o + c, u = s.offset + s.size, d = n; d < a - 1 && u < l; )
1441
+ d++, u += ve("row", t, d, r).size;
1442
+ return d;
1443
+ },
1444
+ initInstanceProps: function(t, n) {
1445
+ var o = t, r = o.estimatedColumnWidth, a = o.estimatedRowHeight, c = {
1446
+ columnMetadataMap: {},
1447
+ estimatedColumnWidth: r || Yt,
1448
+ estimatedRowHeight: a || Yt,
1449
+ lastMeasuredColumnIndex: -1,
1450
+ lastMeasuredRowIndex: -1,
1451
+ rowMetadataMap: {}
1452
+ };
1453
+ return n.resetAfterColumnIndex = function(s, l) {
1454
+ l === void 0 && (l = !0), n.resetAfterIndices({
1455
+ columnIndex: s,
1456
+ shouldForceUpdate: l
1457
+ });
1458
+ }, n.resetAfterRowIndex = function(s, l) {
1459
+ l === void 0 && (l = !0), n.resetAfterIndices({
1460
+ rowIndex: s,
1461
+ shouldForceUpdate: l
1462
+ });
1463
+ }, n.resetAfterIndices = function(s) {
1464
+ var l = s.columnIndex, u = s.rowIndex, d = s.shouldForceUpdate, f = d === void 0 ? !0 : d;
1465
+ typeof l == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, l - 1)), typeof u == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, u - 1)), n._getItemStyleCache(-1), f && n.forceUpdate();
1466
+ }, c;
1467
+ },
1468
+ shouldResetStyleCacheOnItemSizeChange: !1,
1469
+ validateProps: function(t) {
1470
+ var n = t.columnWidth, o = t.rowHeight;
1471
+ if (process.env.NODE_ENV !== "production") {
1472
+ if (typeof n != "function")
1473
+ throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. ' + ('"' + (n === null ? "null" : typeof n) + '" was specified.'));
1474
+ if (typeof o != "function")
1475
+ throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
1476
+ }
1477
+ }
1478
+ });
1479
+ process.env.NODE_ENV;
1480
+ function en(e, t) {
1481
+ for (var n in e)
1482
+ if (!(n in t))
1483
+ return !0;
1484
+ for (var o in t)
1485
+ if (e[o] !== t[o])
1486
+ return !0;
1487
+ return !1;
1488
+ }
1489
+ var Mo = ["style"], Wo = ["style"];
1490
+ function Ho(e, t) {
1491
+ var n = e.style, o = Bt(e, Mo), r = t.style, a = Bt(t, Wo);
1492
+ return !en(n, r) && !en(o, a);
1493
+ }
1494
+ const $o = () => {
1495
+ const { viewMode: e } = Qe(), { scrollMode: t } = Ee(), { setColumnCount: n } = un(), { virtualScrollableElementRef: o } = et(), r = tt(), a = L(
1496
+ (g) => r.widths[g] || 0,
1497
+ [r.widths]
1498
+ ), c = L(
1499
+ (g) => r.heights[g] || 0,
1500
+ [r.heights]
1501
+ ), s = F(() => r.heights.length, [r.heights]), l = F(() => Math.max(...r.widths), [r.widths]), u = F(() => t === ee.HORIZONTAL_SCROLLING ? s : e === Ze.DUAL_PAGE ? 2 : 1, [e, t, t, s, o, l]);
1502
+ A(() => {
1503
+ n(u);
1504
+ }, [u, n]);
1505
+ const d = F(() => t === ee.HORIZONTAL_SCROLLING || t === ee.PAGE_SCROLLING ? 1 : Math.round(s / u), [u, s, t]), f = F(() => r.heights.reduce((g, w) => g + w, 0) / r.heights.length || 0, [r]), h = F(() => r.widths.reduce((g, w) => g + w, 0) / r.heights.length || 0, [r]);
1506
+ return {
1507
+ rowCount: d,
1508
+ rowHeight: c,
1509
+ columnCount: u,
1510
+ columnWidth: a,
1511
+ pageDimension: r,
1512
+ estimatedRowHeight: f,
1513
+ estimatedColumnWidth: h
1514
+ };
1515
+ };
1516
+ let oe;
1517
+ typeof window < "u" ? oe = window : typeof self < "u" ? oe = self : oe = global;
1518
+ let Ct = null, Tt = null;
1519
+ const tn = 20, mt = oe.clearTimeout, nn = oe.setTimeout, ft = oe.cancelAnimationFrame || oe.mozCancelAnimationFrame || oe.webkitCancelAnimationFrame, rn = oe.requestAnimationFrame || oe.mozRequestAnimationFrame || oe.webkitRequestAnimationFrame;
1520
+ ft == null || rn == null ? (Ct = mt, Tt = function(t) {
1521
+ return nn(t, tn);
1522
+ }) : (Ct = function([t, n]) {
1523
+ ft(t), mt(n);
1524
+ }, Tt = function(t) {
1525
+ const n = rn(function() {
1526
+ mt(o), t();
1527
+ }), o = nn(function() {
1528
+ ft(n), t();
1529
+ }, tn);
1530
+ return [n, o];
1531
+ });
1532
+ function Vo(e) {
1533
+ let t, n, o, r, a, c, s;
1534
+ const l = typeof document < "u" && document.attachEvent;
1535
+ if (!l) {
1536
+ c = function(_) {
1537
+ const m = _.__resizeTriggers__, P = m.firstElementChild, S = m.lastElementChild, p = P.firstElementChild;
1538
+ S.scrollLeft = S.scrollWidth, S.scrollTop = S.scrollHeight, p.style.width = P.offsetWidth + 1 + "px", p.style.height = P.offsetHeight + 1 + "px", P.scrollLeft = P.scrollWidth, P.scrollTop = P.scrollHeight;
1539
+ }, a = function(_) {
1540
+ return _.offsetWidth !== _.__resizeLast__.width || _.offsetHeight !== _.__resizeLast__.height;
1541
+ }, s = function(_) {
1542
+ if (_.target.className && typeof _.target.className.indexOf == "function" && _.target.className.indexOf("contract-trigger") < 0 && _.target.className.indexOf("expand-trigger") < 0)
1543
+ return;
1544
+ const m = this;
1545
+ c(this), this.__resizeRAF__ && Ct(this.__resizeRAF__), this.__resizeRAF__ = Tt(function() {
1546
+ a(m) && (m.__resizeLast__.width = m.offsetWidth, m.__resizeLast__.height = m.offsetHeight, m.__resizeListeners__.forEach(function(p) {
1547
+ p.call(m, _);
1548
+ }));
1549
+ });
1550
+ };
1551
+ let h = !1, g = "";
1552
+ o = "animationstart";
1553
+ const w = "Webkit Moz O ms".split(" ");
1554
+ let b = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), v = "";
1555
+ {
1556
+ const _ = document.createElement("fakeelement");
1557
+ if (_.style.animationName !== void 0 && (h = !0), h === !1) {
1558
+ for (let m = 0; m < w.length; m++)
1559
+ if (_.style[w[m] + "AnimationName"] !== void 0) {
1560
+ v = w[m], g = "-" + v.toLowerCase() + "-", o = b[m], h = !0;
1561
+ break;
1562
+ }
1563
+ }
1564
+ }
1565
+ n = "resizeanim", t = "@" + g + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = g + "animation: 1ms " + n + "; ";
1566
+ }
1567
+ const u = function(h) {
1568
+ if (!h.getElementById("detectElementResize")) {
1569
+ const g = (t || "") + ".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%; }', w = h.head || h.getElementsByTagName("head")[0], b = h.createElement("style");
1570
+ b.id = "detectElementResize", b.type = "text/css", e != null && b.setAttribute("nonce", e), b.styleSheet ? b.styleSheet.cssText = g : b.appendChild(h.createTextNode(g)), w.appendChild(b);
1571
+ }
1572
+ };
1573
+ return {
1574
+ addResizeListener: function(h, g) {
1575
+ if (l)
1576
+ h.attachEvent("onresize", g);
1577
+ else {
1578
+ if (!h.__resizeTriggers__) {
1579
+ const w = h.ownerDocument, b = oe.getComputedStyle(h);
1580
+ b && b.position === "static" && (h.style.position = "relative"), u(w), h.__resizeLast__ = {}, h.__resizeListeners__ = [], (h.__resizeTriggers__ = w.createElement("div")).className = "resize-triggers";
1581
+ const v = w.createElement("div");
1582
+ v.className = "expand-trigger", v.appendChild(w.createElement("div"));
1583
+ const _ = w.createElement("div");
1584
+ _.className = "contract-trigger", h.__resizeTriggers__.appendChild(v), h.__resizeTriggers__.appendChild(_), h.appendChild(h.__resizeTriggers__), c(h), h.addEventListener("scroll", s, !0), o && (h.__resizeTriggers__.__animationListener__ = function(P) {
1585
+ P.animationName === n && c(h);
1586
+ }, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
1587
+ }
1588
+ h.__resizeListeners__.push(g);
1589
+ }
1590
+ },
1591
+ removeResizeListener: function(h, g) {
1592
+ if (l)
1593
+ h.detachEvent("onresize", g);
1594
+ else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(g), 1), !h.__resizeListeners__.length) {
1595
+ h.removeEventListener("scroll", s, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(o, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
1596
+ try {
1597
+ h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
1598
+ } catch {
1599
+ }
1600
+ }
1601
+ }
1602
+ };
1603
+ }
1604
+ class Go extends rr {
1605
+ constructor(...t) {
1606
+ super(...t), this.state = {
1607
+ height: this.props.defaultHeight || 0,
1608
+ scaledHeight: this.props.defaultHeight || 0,
1609
+ scaledWidth: this.props.defaultWidth || 0,
1610
+ width: this.props.defaultWidth || 0
1611
+ }, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
1612
+ this._timeoutId = null;
1613
+ const {
1614
+ disableHeight: n,
1615
+ disableWidth: o,
1616
+ onResize: r
1617
+ } = this.props;
1618
+ if (this._parentNode) {
1619
+ const a = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(a.paddingLeft || "0"), s = parseFloat(a.paddingRight || "0"), l = parseFloat(a.paddingTop || "0"), u = parseFloat(a.paddingBottom || "0"), d = this._parentNode.getBoundingClientRect(), f = d.height - l - u, h = d.width - c - s, g = this._parentNode.offsetHeight - l - u, w = this._parentNode.offsetWidth - c - s;
1620
+ (!n && (this.state.height !== g || this.state.scaledHeight !== f) || !o && (this.state.width !== w || this.state.scaledWidth !== h)) && (this.setState({
1621
+ height: g,
1622
+ width: w,
1623
+ scaledHeight: f,
1624
+ scaledWidth: h
1625
+ }), typeof r == "function" && r({
1626
+ height: g,
1627
+ scaledHeight: f,
1628
+ scaledWidth: h,
1629
+ width: w
1630
+ }));
1631
+ }
1632
+ }, this._setRef = (n) => {
1633
+ this._autoSizer = n;
1634
+ };
1635
+ }
1636
+ componentDidMount() {
1637
+ const {
1638
+ nonce: t
1639
+ } = this.props, n = this._autoSizer ? this._autoSizer.parentNode : null;
1640
+ if (n != null && n.ownerDocument && n.ownerDocument.defaultView && n instanceof n.ownerDocument.defaultView.HTMLElement) {
1641
+ this._parentNode = n;
1642
+ const o = n.ownerDocument.defaultView.ResizeObserver;
1643
+ o != null ? (this._resizeObserver = new o(() => {
1644
+ this._timeoutId = setTimeout(this._onResize, 0);
1645
+ }), this._resizeObserver.observe(n)) : (this._detectElementResize = Vo(t), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
1646
+ }
1647
+ }
1648
+ componentWillUnmount() {
1649
+ this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && this._resizeObserver.disconnect());
1650
+ }
1651
+ render() {
1652
+ const {
1653
+ children: t,
1654
+ defaultHeight: n,
1655
+ defaultWidth: o,
1656
+ disableHeight: r = !1,
1657
+ disableWidth: a = !1,
1658
+ doNotBailOutOnEmptyChildren: c = !1,
1659
+ nonce: s,
1660
+ onResize: l,
1661
+ style: u = {},
1662
+ tagName: d = "div",
1663
+ ...f
1664
+ } = this.props, {
1665
+ height: h,
1666
+ scaledHeight: g,
1667
+ scaledWidth: w,
1668
+ width: b
1669
+ } = this.state, v = {
1670
+ overflow: "visible"
1671
+ }, _ = {};
1672
+ let m = !1;
1673
+ return r || (h === 0 && (m = !0), v.height = 0, _.height = h, _.scaledHeight = g), a || (b === 0 && (m = !0), v.width = 0, _.width = b, _.scaledWidth = w), c && (m = !1), Ve(d, {
1674
+ ref: this._setRef,
1675
+ style: {
1676
+ ...v,
1677
+ ...u
1678
+ },
1679
+ ...f
1680
+ }, !m && t(_));
1681
+ }
1682
+ }
1683
+ const Uo = ({ widths: e, heights: t }) => {
1684
+ const { focusedPage: n, totalPages: o } = ie(), r = F(() => {
1685
+ const s = [], l = Math.ceil(n / 2) * 2 - 1;
1686
+ if (s.push(l), l + 1 < o) {
1687
+ const u = l + 1;
1688
+ s.push(u);
1689
+ }
1690
+ return s;
1691
+ }, [n, o]), a = F(() => [
1692
+ {
1693
+ position: "absolute",
1694
+ left: 0,
1695
+ width: e(n - 1),
1696
+ height: t(n - 1)
1697
+ },
1698
+ {
1699
+ position: "absolute",
1700
+ left: e(n),
1701
+ top: 0,
1702
+ width: e(n),
1703
+ height: t(n)
1704
+ }
1705
+ ], [e, t, r]), c = F(() => a.reduce((s, l) => s + Number(l.width || 0), 0), [a]);
1706
+ return /* @__PURE__ */ i("div", { style: { width: c, position: "relative" }, children: r.map((s, l) => /* @__PURE__ */ i(Nt, { style: a[l], pageNumber: s }, s)) });
1707
+ }, qo = ({ widths: e, heights: t }) => {
1708
+ const { focusedPage: n } = ie(), o = F(() => ({
1709
+ position: "absolute",
1710
+ width: e(n - 1),
1711
+ height: t(n - 1)
1712
+ }), [e, t, n]), r = F(() => e(n - 1), [e]);
1713
+ return /* @__PURE__ */ i(
1714
+ "div",
1715
+ {
1716
+ style: {
1717
+ width: r,
1718
+ position: "relative"
1719
+ },
1720
+ children: /* @__PURE__ */ i(Nt, { style: o, pageNumber: n }, n)
1721
+ }
1722
+ );
1723
+ }, Zo = (e, t, n) => {
1724
+ const o = M(), { contentRef: r } = Te(), { heights: a, widths: c } = tt(), { setFocusedPage: s } = ie(), [l, u] = $([]), { smoothScrolling: d } = St(), f = yt(l, 0, 500), h = F(() => a.map((w, b) => {
1725
+ const v = c[b], _ = Hr(b + 1, e), m = v * _.columnIndex, P = w * _.rowIndex, S = m + v, p = P + w;
1726
+ return {
1727
+ pageNumber: b + 1,
1728
+ ..._,
1729
+ width: v,
1730
+ height: w,
1731
+ startX: m,
1732
+ startY: P,
1733
+ endX: S,
1734
+ endY: p
1735
+ };
1736
+ }), [a, c, e, t]);
1737
+ A(() => {
1738
+ f.length > 0 && !d.current && s(f[0].pageNumber);
1739
+ }, [f, s]);
1740
+ const g = L(
1741
+ (w) => {
1742
+ o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
1743
+ const b = w.target, v = {
1744
+ startTop: b.scrollTop,
1745
+ startLeft: b.scrollLeft,
1746
+ endTop: b.scrollTop + b.clientHeight,
1747
+ endLeft: b.scrollLeft + b.clientWidth
1748
+ }, _ = h.filter((m) => {
1749
+ const P = m.endX >= v.startLeft && m.endY >= v.startTop, S = m.startX <= v.endLeft && m.startY <= v.endTop;
1750
+ return P && S;
1751
+ }).map((m) => {
1752
+ const P = v.startLeft > m.startX ? v.startLeft : m.startX, S = v.startTop > m.startY ? v.startTop : m.startY, p = v.endLeft < m.endX ? v.endLeft : m.endX, T = v.endTop < m.endY ? v.endTop : m.endY, C = p - P, x = T - S, I = +(C * x / (m.width * m.height) * 100).toFixed(2);
1753
+ return {
1754
+ pageNumber: m.pageNumber,
1755
+ ratio: I
1756
+ };
1757
+ }).sort((m, P) => P.ratio - m.ratio);
1758
+ u(_);
1759
+ });
1760
+ },
1761
+ [r, h]
1762
+ );
1763
+ A(() => {
1764
+ if (n)
1765
+ return n == null || n.addEventListener("scroll", g), () => {
1766
+ n == null || n.removeEventListener("scroll", g);
1767
+ };
1768
+ }, [n, g]);
1769
+ }, Bo = or(({ columnIndex: e, rowIndex: t, data: n, style: o }) => {
1770
+ const r = $r(t, e, n.columnCount);
1771
+ return /* @__PURE__ */ i(Nt, { style: o, pageNumber: r }, r);
1772
+ }, Ho), ys = () => {
1773
+ const { initialPage: e = 1, initialScrollMode: t } = lr(), { pagesRef: n, setPagesRef: o } = Te(), { scrollToPage: r } = bn(), {
1774
+ virtualScrollRef: a,
1775
+ getVirtualScrollRef: c,
1776
+ getPageScrollElementRef: s,
1777
+ getVirtualScrollableElementRef: l,
1778
+ setTotalInnerDimensions: u,
1779
+ virtualScrollableElementRef: d,
1780
+ totalInnerDimensions: f,
1781
+ pageScrollElementRef: h
1782
+ } = et(), g = M(!0), { nextPage: w, prevPage: b, setFocusedPage: v, focusedPage: _ } = ie(), { scrollMode: m } = Ee(), { viewMode: P } = Qe(), S = M(null), { loading: p } = K(), { LoaderImageComponent: T } = mn(), { smoothScrolling: C, targetScrollPosition: x } = St(), N = M(
1783
+ f
1784
+ ), I = M({
1785
+ viewMode: P,
1786
+ scrollMode: m
1787
+ }), O = M(!1), R = M(), { isFullScreen: k } = dr(), {
1788
+ pageDimension: z,
1789
+ rowCount: y,
1790
+ rowHeight: E,
1791
+ columnCount: W,
1792
+ columnWidth: G,
1793
+ estimatedColumnWidth: Z,
1794
+ estimatedRowHeight: X
1795
+ } = $o(), j = yt(f, 100), B = M();
1796
+ Zo(W, y, d);
1797
+ const te = M({
1798
+ scrollTop: 0,
1799
+ scrollLeft: 0
1800
+ });
1801
+ Wr(n);
1802
+ const { isPressed: ae } = kr(), { selectionMode: Y } = cr(), { initializeGrabScroll: ne, resetGrabState: he } = Mr({
1803
+ isPressed: ae
1804
+ }), ce = F(() => Y === ar.HAND, [Y]), Oe = F(() => ({
1805
+ columnCount: W
1806
+ }), [W]), we = L(
1807
+ (H) => {
1808
+ const V = document.activeElement !== n;
1809
+ !k && V || (["ArrowUp", "ArrowLeft"].includes(H.key) ? (H.preventDefault(), b()) : ["ArrowDown", "ArrowRight"].includes(H.key) && (H.preventDefault(), w()));
1810
+ },
1811
+ [w, b, k, m]
1812
+ );
1813
+ A(() => (window.addEventListener("keydown", we), () => {
1814
+ window.removeEventListener("keydown", we);
1815
+ }), [we]), A(() => {
1816
+ if (S.current && (S.current.style.position = "relative"), !!a)
1817
+ for (let H = 0; H < y; H++)
1818
+ for (let V = 0; V < W; V++)
1819
+ a.resetAfterIndices({
1820
+ columnIndex: V,
1821
+ rowIndex: H,
1822
+ shouldForceUpdate: !0
1823
+ });
1824
+ }, [y, W, z, a]);
1825
+ const me = L(
1826
+ (H, V) => {
1827
+ if (!d)
1828
+ return { scrollTop: 0, scrollLeft: 0 };
1829
+ const fe = te.current.scrollTop > V, ge = te.current.scrollLeft > H;
1830
+ return fe || ge ? te.current : {
1831
+ scrollTop: d.scrollTop,
1832
+ scrollLeft: d.scrollLeft
1833
+ };
1834
+ },
1835
+ [d]
1836
+ ), le = L(
1837
+ (H, V) => {
1838
+ if (I.current.viewMode !== P || I.current.scrollMode !== m) {
1839
+ B.current && clearTimeout(B.current), O.current = !0, r(_, "auto"), B.current = setTimeout(() => {
1840
+ requestAnimationFrame(() => {
1841
+ I.current = { viewMode: P, scrollMode: m };
1842
+ });
1843
+ }, 100);
1844
+ return;
1845
+ }
1846
+ const ge = H.scrollTop, ze = H.scrollLeft;
1847
+ if (!V.height || !V.width)
1848
+ return;
1849
+ O.current = !0;
1850
+ const { height: Pe, width: ot } = V, { height: At, width: Ft } = N.current;
1851
+ if (At === Pe && Ft === ot)
1852
+ return;
1853
+ const Jn = ge / At * Pe, Qn = ze / Ft * ot, er = Math.round(Math.min(Jn, Pe)) || 0, tr = Math.round(Math.min(Qn, ot)) || 0;
1854
+ R.current = setTimeout(() => {
1855
+ requestAnimationFrame(() => {
1856
+ a == null || a.scrollTo({
1857
+ scrollTop: er,
1858
+ scrollLeft: tr
1859
+ });
1860
+ });
1861
+ }, 0), N.current = {
1862
+ height: V.height,
1863
+ width: V.width
1864
+ };
1865
+ },
1866
+ [a, P, m, r]
1867
+ );
1868
+ A(() => {
1869
+ clearTimeout(R.current);
1870
+ const H = Array.from({ length: y }).reduce(
1871
+ (ge, ze, Pe) => ge + E(Pe),
1872
+ 0
1873
+ ), V = Array.from({ length: W }).reduce(
1874
+ (ge, ze, Pe) => ge + G(Pe),
1875
+ 0
1876
+ ), fe = me(V, H);
1877
+ te.current = fe, le(fe, { height: H, width: V }), u({
1878
+ height: H,
1879
+ width: V
1880
+ });
1881
+ }, [z, y, W, le]);
1882
+ const De = L(
1883
+ (H) => {
1884
+ te.current = {
1885
+ scrollTop: H.scrollTop,
1886
+ scrollLeft: H.scrollLeft
1887
+ };
1888
+ const V = ((d == null ? void 0 : d.scrollHeight) || 0) - ((d == null ? void 0 : d.clientHeight) || 0), fe = ((d == null ? void 0 : d.scrollWidth) || 0) - ((d == null ? void 0 : d.clientWidth) || 0), ge = Math.round(x.current.left) === Math.round(H.scrollLeft) && Math.round(x.current.top) === Math.round(H.scrollTop), ze = Math.round(V) === Math.round(H.scrollTop) && Math.round(fe) === Math.round(H.scrollLeft);
1889
+ (ge || ze) && (C.current = !1);
1890
+ },
1891
+ [d]
1892
+ );
1893
+ A(() => () => {
1894
+ B.current && clearTimeout(B.current);
1895
+ }, []);
1896
+ const rt = F(() => re(de["rp-pages-container"], {
1897
+ [de["rp-cursor-grab"]]: ce && !ae,
1898
+ [de["rp-cursor-grabbing"]]: ce && ae
1899
+ }), [ce, ae]), Yn = L(
1900
+ (H) => {
1901
+ if (ce && H) {
1902
+ const V = re(de["rp-pages"]), fe = document.querySelector(`.${V}`);
1903
+ ne(fe);
1904
+ }
1905
+ },
1906
+ [ce, ne, de]
1907
+ );
1908
+ return A(() => {
1909
+ p && he();
1910
+ }, [p]), A(() => {
1911
+ if (!(j.height === 0 || !g.current)) {
1912
+ if (t === ee.PAGE_SCROLLING) {
1913
+ e !== _ && h && v(e), g.current = !1;
1914
+ return;
1915
+ }
1916
+ r(e, "auto"), v(e), g.current = !1;
1917
+ }
1918
+ }, [
1919
+ r,
1920
+ t,
1921
+ h,
1922
+ v,
1923
+ j
1924
+ ]), /* @__PURE__ */ i("div", { ref: o, tabIndex: -1, className: rt, children: /* @__PURE__ */ i(Go, { style: { minHeight: "50px" }, children: ({ width: H, height: V }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: Yn, style: { width: H, height: V }, children: m === ee.PAGE_SCROLLING ? /* @__PURE__ */ i(
1925
+ "div",
1926
+ {
1927
+ ref: s,
1928
+ style: { width: H, height: V },
1929
+ className: re(de["rp-pages"], de["rp-page-scrolling-wrapper"]),
1930
+ children: P === Ze.DUAL_PAGE ? /* @__PURE__ */ i(Uo, { widths: G, heights: E }) : /* @__PURE__ */ i(qo, { widths: G, heights: E })
1931
+ }
1932
+ ) : Z ? /* @__PURE__ */ i(
1933
+ ko,
1934
+ {
1935
+ ref: c,
1936
+ itemData: Oe,
1937
+ outerRef: l,
1938
+ innerRef: S,
1939
+ onScroll: De,
1940
+ columnCount: W,
1941
+ columnWidth: G,
1942
+ rowHeight: E,
1943
+ height: V,
1944
+ width: H,
1945
+ estimatedColumnWidth: Z,
1946
+ estimatedRowHeight: X,
1947
+ rowCount: y,
1948
+ className: re(
1949
+ de["rp-pages"],
1950
+ m === ee.HORIZONTAL_SCROLLING ? de["rp-pages-horizontal-scroll"] : ""
1951
+ ),
1952
+ children: Bo
1953
+ }
1954
+ ) : p ? null : /* @__PURE__ */ i(
1955
+ "div",
1956
+ {
1957
+ className: de["rp-loader"],
1958
+ style: {
1959
+ display: "flex",
1960
+ justifyContent: "center",
1961
+ alignItems: "center",
1962
+ height: "100%",
1963
+ width: "100%"
1964
+ },
1965
+ children: T && /* @__PURE__ */ i(T, {})
1966
+ }
1967
+ ) }) }) });
1968
+ }, Ae = {
1969
+ "rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
1970
+ "rp-toolbar-wrapper": "_rp-toolbar-wrapper_sz31z_10",
1971
+ "rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
1972
+ "rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
1973
+ "rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
1974
+ }, gt = {
1975
+ "rp-paginate": "_rp-paginate_1y9vo_1",
1976
+ "rp-page-input": "_rp-page-input_1y9vo_6",
1977
+ "rp-total-page": "_rp-total-page_1y9vo_11"
1978
+ }, jo = () => {
1979
+ const { prevIcon: e } = pe();
1980
+ return e || /* @__PURE__ */ i(Me, {});
1981
+ }, Ko = () => {
1982
+ const { nextIcon: e } = pe();
1983
+ return e || /* @__PURE__ */ i(Me, { style: { transform: "rotate(180deg" } });
1984
+ }, Xo = () => {
1985
+ const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [c, s] = $(e.toString()), { pageNavigationTool: l = !0 } = _e(), { isSmallScreen: u } = Ie(), { localeMessages: d } = ue();
1986
+ A(() => {
1987
+ s(e.toString());
1988
+ }, [e]);
1989
+ const f = L((b) => {
1990
+ const v = b.target.value;
1991
+ s(v);
1992
+ }, []), h = L(async () => {
1993
+ const b = a(c);
1994
+ b.success || s(b.currentPage.toString());
1995
+ }, [a, c, t]), g = L(() => {
1996
+ s(e.toString());
1997
+ }, [e]), w = L(
1998
+ (b) => {
1999
+ b.key === "Enter" && h();
2000
+ },
2001
+ [h]
2002
+ );
2003
+ return typeof l != "boolean" ? /* @__PURE__ */ i(
2004
+ l,
2005
+ {
2006
+ total: t,
2007
+ current: e,
2008
+ nextPage: o,
2009
+ prevPage: r,
2010
+ goToPage: a,
2011
+ changePage: n
2012
+ }
2013
+ ) : l ? /* @__PURE__ */ D("div", { className: gt["rp-paginate"], children: [
2014
+ !u && /* @__PURE__ */ i(q, { content: d == null ? void 0 : d.previousPageTooltip, children: /* @__PURE__ */ i(
2015
+ Q,
2016
+ {
2017
+ onClick: r,
2018
+ "aria-label": d == null ? void 0 : d.previousPageTooltip,
2019
+ "aria-disabled": e === 1,
2020
+ children: /* @__PURE__ */ i(jo, {})
2021
+ }
2022
+ ) }),
2023
+ /* @__PURE__ */ i(q, { content: d == null ? void 0 : d.currentPageTooltip, children: /* @__PURE__ */ i(
2024
+ dn,
2025
+ {
2026
+ onKeyDown: w,
2027
+ onBlur: g,
2028
+ onChange: f,
2029
+ value: c,
2030
+ className: gt["rp-page-input"]
2031
+ }
2032
+ ) }),
2033
+ /* @__PURE__ */ D("span", { className: gt["rp-total-page"], children: [
2034
+ "/",
2035
+ t
2036
+ ] }),
2037
+ !u && /* @__PURE__ */ i(q, { content: d == null ? void 0 : d.nextPageTooltip, children: /* @__PURE__ */ i(
2038
+ Q,
2039
+ {
2040
+ onClick: o,
2041
+ "aria-label": d == null ? void 0 : d.nextPageTooltip,
2042
+ "aria-disabled": e === t,
2043
+ children: /* @__PURE__ */ i(Ko, {})
2044
+ }
2045
+ ) })
2046
+ ] }) : null;
2047
+ };
2048
+ var Et = "Dialog", [Nn, Is] = qr(Et), [Yo, se] = Nn(Et), En = (e) => {
2049
+ const {
2050
+ __scopeDialog: t,
2051
+ children: n,
2052
+ open: o,
2053
+ defaultOpen: r,
2054
+ onOpenChange: a,
2055
+ modal: c = !0
2056
+ } = e, s = U.useRef(null), l = U.useRef(null), [u = !1, d] = jr({
2057
+ prop: o,
2058
+ defaultProp: r,
2059
+ onChange: a
2060
+ });
2061
+ return /* @__PURE__ */ i(
2062
+ Yo,
2063
+ {
2064
+ scope: t,
2065
+ triggerRef: s,
2066
+ contentRef: l,
2067
+ contentId: st(),
2068
+ titleId: st(),
2069
+ descriptionId: st(),
2070
+ open: u,
2071
+ onOpenChange: d,
2072
+ onOpenToggle: U.useCallback(() => d((f) => !f), [d]),
2073
+ modal: c,
2074
+ children: n
2075
+ }
2076
+ );
2077
+ };
2078
+ En.displayName = Et;
2079
+ var On = "DialogTrigger", Jo = U.forwardRef(
2080
+ (e, t) => {
2081
+ const { __scopeDialog: n, ...o } = e, r = se(On, n), a = It(t, r.triggerRef);
2082
+ return /* @__PURE__ */ i(
2083
+ He.button,
2084
+ {
2085
+ type: "button",
2086
+ "aria-haspopup": "dialog",
2087
+ "aria-expanded": r.open,
2088
+ "aria-controls": r.contentId,
2089
+ "data-state": zt(r.open),
2090
+ ...o,
2091
+ ref: a,
2092
+ onClick: ke(e.onClick, r.onOpenToggle)
2093
+ }
2094
+ );
2095
+ }
2096
+ );
2097
+ Jo.displayName = On;
2098
+ var Ot = "DialogPortal", [Qo, Dn] = Nn(Ot, {
2099
+ forceMount: void 0
2100
+ }), zn = (e) => {
2101
+ const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, a = se(Ot, t);
2102
+ return /* @__PURE__ */ i(Qo, { scope: t, forceMount: n, children: U.Children.map(o, (c) => /* @__PURE__ */ i(Lt, { present: n || a.open, children: /* @__PURE__ */ i(Qr, { asChild: !0, container: r, children: c }) })) });
2103
+ };
2104
+ zn.displayName = Ot;
2105
+ var je = "DialogOverlay", An = U.forwardRef(
2106
+ (e, t) => {
2107
+ const n = Dn(je, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, a = se(je, e.__scopeDialog);
2108
+ return a.modal ? /* @__PURE__ */ i(Lt, { present: o || a.open, children: /* @__PURE__ */ i(ei, { ...r, ref: t }) }) : null;
2109
+ }
2110
+ );
2111
+ An.displayName = je;
2112
+ var ei = U.forwardRef(
2113
+ (e, t) => {
2114
+ const { __scopeDialog: n, ...o } = e, r = se(je, n);
2115
+ return (
2116
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
2117
+ // ie. when `Overlay` and `Content` are siblings
2118
+ /* @__PURE__ */ i(Xr, { as: Zr, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
2119
+ He.div,
2120
+ {
2121
+ "data-state": zt(r.open),
2122
+ ...o,
2123
+ ref: t,
2124
+ style: { pointerEvents: "auto", ...o.style }
2125
+ }
2126
+ ) })
2127
+ );
2128
+ }
2129
+ ), ye = "DialogContent", Fn = U.forwardRef(
2130
+ (e, t) => {
2131
+ const n = Dn(ye, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, a = se(ye, e.__scopeDialog);
2132
+ return /* @__PURE__ */ i(Lt, { present: o || a.open, children: a.modal ? /* @__PURE__ */ i(ti, { ...r, ref: t }) : /* @__PURE__ */ i(ni, { ...r, ref: t }) });
2133
+ }
2134
+ );
2135
+ Fn.displayName = ye;
2136
+ var ti = U.forwardRef(
2137
+ (e, t) => {
2138
+ const n = se(ye, e.__scopeDialog), o = U.useRef(null), r = It(t, n.contentRef, o);
2139
+ return U.useEffect(() => {
2140
+ const a = o.current;
2141
+ if (a)
2142
+ return eo(a);
2143
+ }, []), /* @__PURE__ */ i(
2144
+ kn,
2145
+ {
2146
+ ...e,
2147
+ ref: r,
2148
+ trapFocus: n.open,
2149
+ disableOutsidePointerEvents: !0,
2150
+ onCloseAutoFocus: ke(e.onCloseAutoFocus, (a) => {
2151
+ var c;
2152
+ a.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
2153
+ }),
2154
+ onPointerDownOutside: ke(e.onPointerDownOutside, (a) => {
2155
+ const c = a.detail.originalEvent, s = c.button === 0 && c.ctrlKey === !0;
2156
+ (c.button === 2 || s) && a.preventDefault();
2157
+ }),
2158
+ onFocusOutside: ke(
2159
+ e.onFocusOutside,
2160
+ (a) => a.preventDefault()
2161
+ )
2162
+ }
2163
+ );
2164
+ }
2165
+ ), ni = U.forwardRef(
2166
+ (e, t) => {
2167
+ const n = se(ye, e.__scopeDialog), o = U.useRef(!1), r = U.useRef(!1);
2168
+ return /* @__PURE__ */ i(
2169
+ kn,
2170
+ {
2171
+ ...e,
2172
+ ref: t,
2173
+ trapFocus: !1,
2174
+ disableOutsidePointerEvents: !1,
2175
+ onCloseAutoFocus: (a) => {
2176
+ var c, s;
2177
+ (c = e.onCloseAutoFocus) == null || c.call(e, a), a.defaultPrevented || (o.current || (s = n.triggerRef.current) == null || s.focus(), a.preventDefault()), o.current = !1, r.current = !1;
2178
+ },
2179
+ onInteractOutside: (a) => {
2180
+ var l, u;
2181
+ (l = e.onInteractOutside) == null || l.call(e, a), a.defaultPrevented || (o.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
2182
+ const c = a.target;
2183
+ ((u = n.triggerRef.current) == null ? void 0 : u.contains(c)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
2184
+ }
2185
+ }
2186
+ );
2187
+ }
2188
+ ), kn = U.forwardRef(
2189
+ (e, t) => {
2190
+ const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...c } = e, s = se(ye, n), l = U.useRef(null), u = It(t, l);
2191
+ return Yr(), /* @__PURE__ */ D(xe, { children: [
2192
+ /* @__PURE__ */ i(
2193
+ Jr,
2194
+ {
2195
+ asChild: !0,
2196
+ loop: !0,
2197
+ trapped: o,
2198
+ onMountAutoFocus: r,
2199
+ onUnmountAutoFocus: a,
2200
+ children: /* @__PURE__ */ i(
2201
+ Kr,
2202
+ {
2203
+ role: "dialog",
2204
+ id: s.contentId,
2205
+ "aria-describedby": s.descriptionId,
2206
+ "aria-labelledby": s.titleId,
2207
+ "data-state": zt(s.open),
2208
+ ...c,
2209
+ ref: u,
2210
+ onDismiss: () => s.onOpenChange(!1)
2211
+ }
2212
+ )
2213
+ }
2214
+ ),
2215
+ /* @__PURE__ */ D(xe, { children: [
2216
+ /* @__PURE__ */ i(oi, { titleId: s.titleId }),
2217
+ /* @__PURE__ */ i(ai, { contentRef: l, descriptionId: s.descriptionId })
2218
+ ] })
2219
+ ] });
2220
+ }
2221
+ ), Dt = "DialogTitle", Mn = U.forwardRef(
2222
+ (e, t) => {
2223
+ const { __scopeDialog: n, ...o } = e, r = se(Dt, n);
2224
+ return /* @__PURE__ */ i(He.h2, { id: r.titleId, ...o, ref: t });
2225
+ }
2226
+ );
2227
+ Mn.displayName = Dt;
2228
+ var Wn = "DialogDescription", ri = U.forwardRef(
2229
+ (e, t) => {
2230
+ const { __scopeDialog: n, ...o } = e, r = se(Wn, n);
2231
+ return /* @__PURE__ */ i(He.p, { id: r.descriptionId, ...o, ref: t });
2232
+ }
2233
+ );
2234
+ ri.displayName = Wn;
2235
+ var Hn = "DialogClose", $n = U.forwardRef(
2236
+ (e, t) => {
2237
+ const { __scopeDialog: n, ...o } = e, r = se(Hn, n);
2238
+ return /* @__PURE__ */ i(
2239
+ He.button,
2240
+ {
2241
+ type: "button",
2242
+ ...o,
2243
+ ref: t,
2244
+ onClick: ke(e.onClick, () => r.onOpenChange(!1))
2245
+ }
2246
+ );
2247
+ }
2248
+ );
2249
+ $n.displayName = Hn;
2250
+ function zt(e) {
2251
+ return e ? "open" : "closed";
2252
+ }
2253
+ var Vn = "DialogTitleWarning", [Ls, Gn] = Br(Vn, {
2254
+ contentName: ye,
2255
+ titleName: Dt,
2256
+ docsSlug: "dialog"
2257
+ }), oi = ({ titleId: e }) => {
2258
+ const t = Gn(Vn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2259
+
2260
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
2261
+
2262
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
2263
+ return U.useEffect(() => {
2264
+ e && (document.getElementById(e) || console.error(n));
2265
+ }, [n, e]), null;
2266
+ }, ii = "DialogDescriptionWarning", ai = ({ contentRef: e, descriptionId: t }) => {
2267
+ const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gn(ii).contentName}}.`;
2268
+ return U.useEffect(() => {
2269
+ var a;
2270
+ const r = (a = e.current) == null ? void 0 : a.getAttribute("aria-describedby");
2271
+ t && r && (document.getElementById(t) || console.warn(o));
2272
+ }, [o, e, t]), null;
2273
+ }, si = En, ci = zn, li = An, di = Fn, ui = Mn, pi = $n;
2274
+ const Se = {
2275
+ "rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
2276
+ "rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
2277
+ "rp-document-dialog": "_rp-document-dialog_slqo7_13",
2278
+ "rp-document-properties": "_rp-document-properties_slqo7_35",
2279
+ "rp-dialog-title": "_rp-dialog-title_slqo7_39",
2280
+ "rp-dialog-close": "_rp-dialog-close_slqo7_47",
2281
+ "rp-properties-divider": "_rp-properties-divider_slqo7_55"
2282
+ }, hi = () => {
2283
+ const { pdfProperties: e } = K(), { container: t } = Te(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = no(), { localeMessages: r } = ue(), a = F(() => {
2284
+ if (!e)
2285
+ return [];
2286
+ const {
2287
+ fileSize: c,
2288
+ filename: s,
2289
+ title: l,
2290
+ author: u,
2291
+ subject: d,
2292
+ createdOn: f,
2293
+ creator: h,
2294
+ keywords: g,
2295
+ modifiedOn: w,
2296
+ pdfProducer: b,
2297
+ pdfVersion: v,
2298
+ pageCount: _
2299
+ } = e;
2300
+ return [
2301
+ { label: r == null ? void 0 : r.propertiesFilenameLabel, value: s },
2302
+ { label: r == null ? void 0 : r.propertiesFileSizeLabel, value: c },
2303
+ { separate: !0 },
2304
+ { label: r == null ? void 0 : r.propertiesTitleLabel, value: l },
2305
+ { label: r == null ? void 0 : r.propertiesAuthorLabel, value: u },
2306
+ { label: r == null ? void 0 : r.propertiesSubjectLabel, value: d },
2307
+ { label: r == null ? void 0 : r.propertiesKeywordLabel, value: g },
2308
+ { label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
2309
+ {
2310
+ label: r == null ? void 0 : r.propertiesCreateOnLabel,
2311
+ value: f ? $t(f) : ""
2312
+ },
2313
+ {
2314
+ label: r == null ? void 0 : r.propertiesModifiedOnLabel,
2315
+ value: w ? $t(w) : ""
2316
+ },
2317
+ { separate: !0 },
2318
+ { label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: b },
2319
+ { label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: v },
2320
+ { label: r == null ? void 0 : r.propertiesPageCountLabel, value: _ }
2321
+ ];
2322
+ }, [e, r]);
2323
+ return /* @__PURE__ */ i(si, { open: n, onOpenChange: o, children: /* @__PURE__ */ i(ci, { container: t, children: /* @__PURE__ */ D("div", { className: Se["rp-dialog-wrapper"], children: [
2324
+ /* @__PURE__ */ i(li, { className: Se["rp-dialog-overlay"] }),
2325
+ /* @__PURE__ */ D(di, { className: Se["rp-document-dialog"], children: [
2326
+ /* @__PURE__ */ i(ui, { className: Se["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
2327
+ /* @__PURE__ */ i("div", { className: Se["rp-document-properties"], children: a.map((c, s) => /* @__PURE__ */ i("div", { children: c.separate ? /* @__PURE__ */ i("div", { className: Se["rp-properties-divider"] }) : /* @__PURE__ */ i(to, { label: c.label, value: c.value }) }, s)) }),
2328
+ /* @__PURE__ */ i(pi, { asChild: !0, className: Se["rp-dialog-close"], children: /* @__PURE__ */ i(vn, {}) })
2329
+ ] })
2330
+ ] }) }) });
2331
+ }, mi = {
2332
+ "rp-other-tool-content": "_rp-other-tool-content_su718_1"
2333
+ }, on = ".pdf", fi = (e) => URL.createObjectURL(e), gi = async (e) => {
2334
+ const n = await (await fetch(e)).blob();
2335
+ return fi(n);
2336
+ }, Un = () => {
2337
+ const { filename: e, pdfSrc: t } = K(), { downloadFilename: n } = _r(), o = (a) => {
2338
+ const c = n || a;
2339
+ return c.endsWith(on) ? c : `${c}${on}`;
2340
+ };
2341
+ return { download: L(async () => {
2342
+ if (!e || !t)
2343
+ throw new Error("There is no PDF source to download");
2344
+ const a = document.createElement("a");
2345
+ a.href = await gi(t), a.download = o(e), document.body.appendChild(a), a.click(), document.body.removeChild(a);
2346
+ }, [e, t]) };
2347
+ }, qn = () => {
2348
+ const { downloadIcon: e } = pe();
2349
+ return e || /* @__PURE__ */ i(so, {});
2350
+ }, Zn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ i(q, { className: t, content: n == null ? void 0 : n.downloadFileTooltip, children: e }), vi = ({ download: e, localeMessages: t }) => /* @__PURE__ */ i(Zn, { localeMessages: t, children: /* @__PURE__ */ i(Q, { onClick: e, "aria-label": t == null ? void 0 : t.downloadFileTooltip, children: /* @__PURE__ */ i(qn, {}) }) }), _i = ({ download: e, localeMessages: t }) => /* @__PURE__ */ i(Ce, { onClick: e, children: /* @__PURE__ */ D(Zn, { className: "rp-menu-item", localeMessages: t, children: [
2351
+ /* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(qn, {}) }),
2352
+ t == null ? void 0 : t.downloadFileLabel
2353
+ ] }) }), Bn = () => {
2354
+ const { download: e } = Un(), { downloadTool: t = !0 } = _e(), { isSmallScreen: n } = Ie(), { localeMessages: o } = ue();
2355
+ return t ? n ? /* @__PURE__ */ i(_i, { download: e, localeMessages: o }) : typeof t == "function" ? /* @__PURE__ */ i(t, { download: e }) : t ? /* @__PURE__ */ i(vi, { download: e, localeMessages: o }) : null : null;
2356
+ }, jn = () => {
2357
+ const { printIcon: e } = pe();
2358
+ return e || /* @__PURE__ */ i(co, {});
2359
+ }, Kn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ i(q, { className: t, content: n == null ? void 0 : n.printTooltip, children: e }), wi = ({ print: e, localeMessages: t }) => /* @__PURE__ */ i(Kn, { localeMessages: t, children: /* @__PURE__ */ i(Q, { onClick: e, "aria-label": t == null ? void 0 : t.printTooltip, children: /* @__PURE__ */ i(jn, {}) }) }), bi = ({ print: e, localeMessages: t }) => /* @__PURE__ */ i(Ce, { onClick: e, children: /* @__PURE__ */ D(Kn, { className: "rp-menu-item", localeMessages: t, children: [
2360
+ /* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(jn, {}) }),
2361
+ t == null ? void 0 : t.printLabel
2362
+ ] }) }), Xn = () => {
2363
+ const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: a } = nt(), { printTool: c = !0 } = _e(), { isSmallScreen: s } = Ie(), { localeMessages: l } = ue();
2364
+ return c ? s ? /* @__PURE__ */ i(bi, { print: e, localeMessages: l }) : typeof c == "function" ? /* @__PURE__ */ i(
2365
+ c,
2366
+ {
2367
+ print: e,
2368
+ cancel: t,
2369
+ setOnProgress: n,
2370
+ setOnError: r,
2371
+ setOnComplete: o,
2372
+ progress: a
2373
+ }
2374
+ ) : c ? /* @__PURE__ */ i(wi, { print: e, localeMessages: l }) : null : null;
2375
+ }, Ci = {
2376
+ "rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
2377
+ }, Ti = () => {
2378
+ const { goToFirstPageIcon: e } = pe();
2379
+ return e || /* @__PURE__ */ i(wn, { className: Ci["rp-go-to-Top"] });
2380
+ }, Pi = () => {
2381
+ const { goToLastPageIcon: e } = pe();
2382
+ return e || /* @__PURE__ */ i(wn, {});
2383
+ }, an = { width: "100%" }, Si = () => {
2384
+ const { goToPage: e, totalPages: t, focusedPage: n } = ie(), { jumpNavigationTool: o = !0 } = _e(), { localeMessages: r } = ue(), a = F(() => n === 1, [n]), c = F(() => n === t, [n, t]), s = L(() => {
2385
+ e(1);
2386
+ }, [e]), l = L(() => {
2387
+ e(t);
2388
+ }, [e, t]);
2389
+ return o ? /* @__PURE__ */ D(Be, { children: [
2390
+ /* @__PURE__ */ i(Ce, { onClick: s, children: /* @__PURE__ */ i(q, { content: r == null ? void 0 : r.firstPageTooltip, style: an, children: /* @__PURE__ */ D("div", { className: "rp-menu-item", "aria-disabled": a, children: [
2391
+ /* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Ti, {}) }),
2392
+ /* @__PURE__ */ i("span", { children: r == null ? void 0 : r.firstPageLabel })
2393
+ ] }) }) }),
2394
+ /* @__PURE__ */ i(Ce, { onClick: l, children: /* @__PURE__ */ i(q, { content: r == null ? void 0 : r.lastPageTooltip, style: an, children: /* @__PURE__ */ D("div", { className: "rp-menu-item", "aria-disabled": c, children: [
2395
+ /* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Pi, {}) }),
2396
+ /* @__PURE__ */ i("span", { children: r == null ? void 0 : r.lastPageLabel })
2397
+ ] }) }) }),
2398
+ /* @__PURE__ */ i(Rt, {})
2399
+ ] }) : null;
2400
+ }, xi = () => {
2401
+ const { container: e } = Te(), { isSmallScreen: t } = Ie(), {
2402
+ openFileTool: n,
2403
+ downloadTool: o,
2404
+ documentProperties: r,
2405
+ scrollModeTool: a,
2406
+ rotateTool: c,
2407
+ selectionModeTool: s,
2408
+ jumpNavigationTool: l,
2409
+ printTool: u,
2410
+ fullscreenTool: d
2411
+ } = _e(), { localeMessages: f } = ue();
2412
+ return F(() => {
2413
+ const g = l || c || s || a || r;
2414
+ let w = !1;
2415
+ return t && (w = !(!n && !o && !u && !d)), g || w;
2416
+ }, [
2417
+ n,
2418
+ o,
2419
+ r,
2420
+ a,
2421
+ c,
2422
+ s,
2423
+ l,
2424
+ t
2425
+ ]) ? /* @__PURE__ */ D(ro, { children: [
2426
+ /* @__PURE__ */ i(
2427
+ gn,
2428
+ {
2429
+ container: e,
2430
+ triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(q, { content: f == null ? void 0 : f.moreOptionTooltip, children: /* @__PURE__ */ i(Q, { "aria-label": f == null ? void 0 : f.moreOptionTooltip, children: /* @__PURE__ */ i(Ur, {}) }) }) }),
2431
+ children: /* @__PURE__ */ D("div", { className: mi["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
2432
+ t && /* @__PURE__ */ D(Be, { children: [
2433
+ /* @__PURE__ */ i(fn, {}),
2434
+ /* @__PURE__ */ i(Bn, {}),
2435
+ /* @__PURE__ */ i(Xn, {}),
2436
+ /* @__PURE__ */ i(_n, {}),
2437
+ /* @__PURE__ */ i(Rt, {})
2438
+ ] }),
2439
+ /* @__PURE__ */ i(Si, {}),
2440
+ /* @__PURE__ */ i(io, {}),
2441
+ /* @__PURE__ */ i(lo, {}),
2442
+ /* @__PURE__ */ i(ao, {}),
2443
+ /* @__PURE__ */ i(oo, {})
2444
+ ] })
2445
+ }
2446
+ ),
2447
+ /* @__PURE__ */ i(hi, {})
2448
+ ] }) : null;
2449
+ }, yi = () => {
2450
+ const { isSmallScreen: e } = Ie();
2451
+ return /* @__PURE__ */ D(xe, { children: [
2452
+ /* @__PURE__ */ i(Gr, {}),
2453
+ !e && /* @__PURE__ */ D(xe, { children: [
2454
+ /* @__PURE__ */ i(fn, {}),
2455
+ /* @__PURE__ */ i(Bn, {}),
2456
+ /* @__PURE__ */ i(Xn, {}),
2457
+ /* @__PURE__ */ i(_n, {})
2458
+ ] }),
2459
+ /* @__PURE__ */ i(xi, {})
2460
+ ] });
2461
+ }, Re = {
2462
+ "rp-zoom-wrapper": "_rp-zoom-wrapper_cocqs_1",
2463
+ "rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_cocqs_6",
2464
+ "rp-current-zoom-icon": "_rp-current-zoom-icon_cocqs_11",
2465
+ "rp-current-zoom-text": "_rp-current-zoom-text_cocqs_16",
2466
+ "rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_cocqs_20"
2467
+ }, Ii = 25, vt = 1e3, Li = [50, 75, 100, 125, 150, 200, 300, 400], Ri = () => {
2468
+ const { zoomInIcon: e } = pe();
2469
+ return e || /* @__PURE__ */ i(uo, {});
2470
+ }, Ni = () => {
2471
+ const { zoomOutIcon: e } = pe();
2472
+ return e || /* @__PURE__ */ i(po, {});
2473
+ }, Ei = () => {
2474
+ const { zoomLevel: e, setZoomLevel: t } = Je(), { container: n, contentRef: o } = Te(), { zoomTool: r = !0 } = _e(), { focusedPage: a } = ie(), { rotate: c } = Ye(), { pages: s } = K(), { isSmallScreen: l } = Ie(), { localeMessages: u } = ue(), d = L(() => {
2475
+ t((_) => {
2476
+ const m = Math.floor(_ / 25) * 25;
2477
+ return Math.min(m + 25, vt);
2478
+ });
2479
+ }, [t]), f = L(() => {
2480
+ t((_) => {
2481
+ const m = Math.ceil(_ / 25) * 25;
2482
+ return Math.min(m - 25, vt);
2483
+ });
2484
+ }, [t]), h = F(() => e === Ii, [e]), g = F(() => e === vt, [e]), w = F(() => {
2485
+ var _;
2486
+ return (_ = s.get(a)) == null ? void 0 : _.page.getViewport({ scale: 1, rotation: c });
2487
+ }, [s, a, c]), b = L(
2488
+ (_) => {
2489
+ const m = ((w == null ? void 0 : w.width) || 0) + 2 * Vt, P = ((w == null ? void 0 : w.height) || 0) + 2 * Vt, S = (o == null ? void 0 : o.clientWidth) || 0, p = (o == null ? void 0 : o.clientHeight) || 0, T = ho(_, S, p, m, P);
2490
+ t(T);
2491
+ },
2492
+ [t, w]
2493
+ ), v = L(
2494
+ (_) => {
2495
+ typeof _ == "number" ? t(_) : b(_);
2496
+ },
2497
+ [t, b]
2498
+ );
2499
+ return typeof r != "boolean" ? /* @__PURE__ */ i(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */ D("div", { className: Re["rp-zoom-wrapper"], children: [
2500
+ /* @__PURE__ */ i(q, { content: u == null ? void 0 : u.zoomOutTooltip, children: /* @__PURE__ */ i(
2501
+ Q,
2502
+ {
2503
+ disabled: h,
2504
+ onClick: f,
2505
+ "aria-label": u == null ? void 0 : u.zoomOutTooltip,
2506
+ children: /* @__PURE__ */ i(Ni, {})
2507
+ }
2508
+ ) }),
2509
+ !l && /* @__PURE__ */ i(
2510
+ gn,
2511
+ {
2512
+ container: n,
2513
+ triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(q, { content: u == null ? void 0 : u.zoomSelectTooltip, children: /* @__PURE__ */ D(
2514
+ Q,
2515
+ {
2516
+ className: Re["rp-current-zoom-wrapper"],
2517
+ "aria-label": u == null ? void 0 : u.zoomSelectTooltip,
2518
+ children: [
2519
+ /* @__PURE__ */ i("span", { className: Re["rp-current-zoom-text"], children: e }),
2520
+ /* @__PURE__ */ i("span", { className: Re["rp-current-zoom-text"], children: "%" }),
2521
+ /* @__PURE__ */ i(Me, { className: Re["rp-current-zoom-icon"] })
2522
+ ]
2523
+ }
2524
+ ) }) }),
2525
+ style: { minWidth: "200px" },
2526
+ align: "center",
2527
+ children: /* @__PURE__ */ D("div", { className: Re["rp-zoom-dropdown-content"], children: [
2528
+ /* @__PURE__ */ D(Be, { children: [
2529
+ /* @__PURE__ */ i(Ce, { onClick: () => v(it.ACTUAL), children: u == null ? void 0 : u.zoomActualSize }),
2530
+ /* @__PURE__ */ i(Ce, { onClick: () => v(it.PAGE_FIT), children: u == null ? void 0 : u.zoomPageFit }),
2531
+ /* @__PURE__ */ i(Ce, { onClick: () => v(it.PAGE_WIDTH), children: u == null ? void 0 : u.zoomPageWidth })
2532
+ ] }),
2533
+ /* @__PURE__ */ i(Rt, {}),
2534
+ /* @__PURE__ */ i(Be, { children: Li.map((_) => /* @__PURE__ */ D(Ce, { onClick: () => v(_), children: [
2535
+ _,
2536
+ " %"
2537
+ ] }, _)) })
2538
+ ] })
2539
+ }
2540
+ ),
2541
+ /* @__PURE__ */ i(q, { content: u == null ? void 0 : u.zoomInTooltip, children: /* @__PURE__ */ i(
2542
+ Q,
2543
+ {
2544
+ disabled: g,
2545
+ onClick: d,
2546
+ "aria-label": u == null ? void 0 : u.zoomInTooltip,
2547
+ children: /* @__PURE__ */ i(Ri, {})
2548
+ }
2549
+ ) })
2550
+ ] }) : null;
2551
+ }, J = {
2552
+ "rp-search-tool-content": "_rp-search-tool-content_lnthn_1",
2553
+ "rp-search-tool-input": "_rp-search-tool-input_lnthn_10",
2554
+ "rp-search-tool-input-icon": "_rp-search-tool-input-icon_lnthn_17",
2555
+ "rp-search-tool-controls": "_rp-search-tool-controls_lnthn_27",
2556
+ "rp-search-tool-input-wrapper": "_rp-search-tool-input-wrapper_lnthn_35",
2557
+ "rp-search-tool-input-checkboxes": "_rp-search-tool-input-checkboxes_lnthn_41",
2558
+ "rp-search-tool-input-clear": "_rp-search-tool-input-clear_lnthn_46",
2559
+ "rp-search-input": "_rp-search-input_lnthn_60",
2560
+ "rp-search-icon-info": "_rp-search-icon-info_lnthn_65",
2561
+ "rp-search-loader-icon": "_rp-search-loader-icon_lnthn_74"
2562
+ }, sn = () => {
2563
+ const { searchIcon: e } = pe();
2564
+ return e || /* @__PURE__ */ i(mo, {});
2565
+ }, Oi = () => {
2566
+ const { container: e } = Te(), [t, n] = $(!1), { pdf: o } = K(), [r, a] = $(null), {
2567
+ searchOptions: c,
2568
+ setSearchOptions: s,
2569
+ loading: l,
2570
+ setSearch: u,
2571
+ totalMatches: d,
2572
+ currentMatchPosition: f,
2573
+ nextMatch: h,
2574
+ prevMatch: g,
2575
+ search: w
2576
+ } = yn(), { searchTool: b = !0 } = _e(), [v, _] = $(w), { localeMessages: m } = ue(), P = L(() => {
2577
+ n(!0);
2578
+ }, []), S = L(() => {
2579
+ u(""), _(""), n(!1);
2580
+ }, [u]), p = (y) => {
2581
+ const E = y.key === "Enter", W = y.key === " ";
2582
+ (E || W) && S();
2583
+ }, T = L(
2584
+ (y) => {
2585
+ y.key === "Escape" && t && S();
2586
+ },
2587
+ [t]
2588
+ ), C = L(
2589
+ (y) => {
2590
+ y.shiftKey && y.key === "Enter" ? g() : y.key === "Enter" && w !== v ? u(v) : y.key === "Enter" && h();
2591
+ },
2592
+ [v, g, h, u, w]
2593
+ );
2594
+ A(() => (window.addEventListener("keydown", T), () => {
2595
+ window.removeEventListener("keydown", T);
2596
+ }), [T]), A(() => {
2597
+ r && r.focus();
2598
+ }, [r]);
2599
+ const x = L((y) => {
2600
+ _(y.target.value);
2601
+ }, []), N = L(() => {
2602
+ _(""), u("");
2603
+ }, [u]), I = F(() => `${f} / ${d}`, [f, d]), { wholeWords: O, matchCase: R } = F(() => c, [c]), k = L(
2604
+ (y) => {
2605
+ s((E) => ({ ...E, matchCase: y }));
2606
+ },
2607
+ [s]
2608
+ ), z = L(
2609
+ (y) => {
2610
+ s((E) => ({ ...E, wholeWords: y }));
2611
+ },
2612
+ [s]
2613
+ );
2614
+ return A(() => {
2615
+ S();
2616
+ }, [o, S]), b ? /* @__PURE__ */ i(xe, { children: /* @__PURE__ */ i(
2617
+ Fr,
2618
+ {
2619
+ open: t,
2620
+ container: e,
2621
+ triggerComponent: /* @__PURE__ */ i(q, { content: m == null ? void 0 : m.searchButtonTooltip, children: /* @__PURE__ */ i(Q, { onClick: P, "aria-label": m == null ? void 0 : m.searchButtonTooltip, children: /* @__PURE__ */ i(sn, {}) }) }),
2622
+ children: /* @__PURE__ */ D("div", { className: J["rp-search-tool-content"], children: [
2623
+ /* @__PURE__ */ D("div", { className: J["rp-search-tool-input-wrapper"], children: [
2624
+ /* @__PURE__ */ D("div", { className: J["rp-search-tool-input"], children: [
2625
+ /* @__PURE__ */ i(q, { content: m == null ? void 0 : m.searchInputTooltip, children: /* @__PURE__ */ i(
2626
+ dn,
2627
+ {
2628
+ value: v,
2629
+ onKeyDown: C,
2630
+ onChange: x,
2631
+ icon: /* @__PURE__ */ i(sn, {}),
2632
+ placeholder: m == null ? void 0 : m.searchInputPlaceholder,
2633
+ className: J["rp-search-input"],
2634
+ ref: a,
2635
+ children: !!v && /* @__PURE__ */ i("span", { className: J["rp-search-tool-input-clear"], onClick: N, children: /* @__PURE__ */ i(fo, {}) })
2636
+ }
2637
+ ) }),
2638
+ l ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(xt, { className: J["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: I })
2639
+ ] }),
2640
+ /* @__PURE__ */ D("div", { className: J["rp-search-tool-input-checkboxes"], children: [
2641
+ /* @__PURE__ */ i(Gt, { name: "matchCase", value: R, onChange: k, children: m == null ? void 0 : m.searchMatchCaseLabel }),
2642
+ /* @__PURE__ */ i(q, { content: m == null ? void 0 : m.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: J["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Ut, {}) }) }),
2643
+ /* @__PURE__ */ i(Gt, { name: "wholeWord", value: O, onChange: z, children: m == null ? void 0 : m.searchWholeWordsLabel }),
2644
+ /* @__PURE__ */ i(q, { content: m == null ? void 0 : m.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { className: J["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Ut, {}) }) })
2645
+ ] })
2646
+ ] }),
2647
+ /* @__PURE__ */ D("div", { className: J["rp-search-tool-controls"], children: [
2648
+ /* @__PURE__ */ i(q, { content: m == null ? void 0 : m.searchPrevTooltip, children: /* @__PURE__ */ i(Q, { onClick: g, "aria-label": m == null ? void 0 : m.searchPrevTooltip, children: /* @__PURE__ */ i(
2649
+ Me,
2650
+ {
2651
+ className: J["rp-search-tool-input-icon"],
2652
+ "aria-disabled": !d
2653
+ }
2654
+ ) }) }),
2655
+ /* @__PURE__ */ i(q, { content: m == null ? void 0 : m.searchNextTooltip, children: /* @__PURE__ */ i(Q, { onClick: h, "aria-label": m == null ? void 0 : m.searchNextTooltip, children: /* @__PURE__ */ i(
2656
+ Me,
2657
+ {
2658
+ style: { transform: "rotate(180deg" },
2659
+ className: J["rp-search-tool-input-icon"],
2660
+ "aria-disabled": !d
2661
+ }
2662
+ ) }) }),
2663
+ /* @__PURE__ */ i(q, { content: m == null ? void 0 : m.searchCloseButtonTooltip, children: /* @__PURE__ */ i(
2664
+ Q,
2665
+ {
2666
+ onKeyDown: p,
2667
+ "aria-label": m == null ? void 0 : m.searchCloseButtonTooltip,
2668
+ children: /* @__PURE__ */ i(vn, { onClick: S, className: J["rp-search-tool-input-icon"] })
2669
+ }
2670
+ ) })
2671
+ ] })
2672
+ ] })
2673
+ }
2674
+ ) }) : null;
2675
+ }, Di = "_loading_vpexk_1", Ne = {
2676
+ "rp-loading-overlay": "_rp-loading-overlay_vpexk_1",
2677
+ "rp-loading-modal": "_rp-loading-modal_vpexk_14",
2678
+ "rp-loading-title": "_rp-loading-title_vpexk_27",
2679
+ "rp-loading-progress-bar": "_rp-loading-progress-bar_vpexk_35",
2680
+ "rp-loading-progress": "_rp-loading-progress_vpexk_35",
2681
+ "rp-loading-cancel-button": "_rp-loading-cancel-button_vpexk_55",
2682
+ loading: Di
2683
+ }, zi = ({ percentage: e }) => {
2684
+ const { cancel: t } = nt(), { localeMessages: n } = ue();
2685
+ return e < 1 ? null : /* @__PURE__ */ i("div", { className: re(Ne["rp-loading-overlay"]), children: /* @__PURE__ */ D("div", { className: re(Ne["rp-loading-modal"]), children: [
2686
+ /* @__PURE__ */ D("div", { className: re(Ne["rp-loading-title"]), children: [
2687
+ n == null ? void 0 : n.printLoadingMessage,
2688
+ "..."
2689
+ ] }),
2690
+ /* @__PURE__ */ i("div", { className: re(Ne["rp-loading-progress-bar"]), children: /* @__PURE__ */ i(
2691
+ "div",
2692
+ {
2693
+ className: re(Ne["rp-loading-progress"]),
2694
+ style: { width: `${e}%` }
2695
+ }
2696
+ ) }),
2697
+ /* @__PURE__ */ i("button", { className: re(Ne["rp-loading-cancel-button"]), onClick: t, children: n == null ? void 0 : n.printCancelLabel })
2698
+ ] }) });
2699
+ }, Ai = We((e, t) => {
2700
+ const { showPrintProgress: n } = _e(), { progress: o } = nt(), { isSmallScreen: r } = Ie(), { percentage: a } = o || {}, c = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
2701
+ return /* @__PURE__ */ D("div", { children: [
2702
+ /* @__PURE__ */ i("div", { "data-rp": "topBar", ref: t, className: Ae["rp-toolbar-content"], children: /* @__PURE__ */ D("div", { className: Ae["rp-toolbar-wrapper"], style: c(), children: [
2703
+ /* @__PURE__ */ D("div", { "data-rp": "topBarLeft", className: Ae["rp-toolbar-start"], children: [
2704
+ /* @__PURE__ */ i(Oi, {}),
2705
+ /* @__PURE__ */ i(Xo, {})
2706
+ ] }),
2707
+ /* @__PURE__ */ i("div", { "data-rp": "topBarCenter", className: Ae["rp-toolbar-middle"], children: /* @__PURE__ */ i(Ei, {}) }),
2708
+ /* @__PURE__ */ i("div", { "data-rp": "topBarRight", className: Ae["rp-toolbar-end"], children: /* @__PURE__ */ i(yi, {}) })
2709
+ ] }) }),
2710
+ n && a ? /* @__PURE__ */ i(zi, { percentage: a }) : null
2711
+ ] });
2712
+ }), _t = {
2713
+ "rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1sdl6_1",
2714
+ "rp-sidebar-content": "_rp-sidebar-content_1sdl6_1",
2715
+ "rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_1sdl6_16",
2716
+ "rp-thumbnail-dragging": "_rp-thumbnail-dragging_1sdl6_21"
2717
+ }, Fe = {
2718
+ "rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
2719
+ "rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
2720
+ "rp-thumbnail": "_rp-thumbnail_3fenb_1",
2721
+ "rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
2722
+ "rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
2723
+ }, Fi = (e) => {
2724
+ const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: a } = ie(), c = F(() => o ? Fe["rp-thumbnail-active"] : "", [o]), s = F(() => ({
2725
+ width: Math.round(r.width),
2726
+ height: Math.round(r.height)
2727
+ }), [r]), l = L(() => {
2728
+ n && a(n);
2729
+ }, [a, n]);
2730
+ return /* @__PURE__ */ D(
2731
+ "div",
2732
+ {
2733
+ onClick: l,
2734
+ id: `page-${n}`,
2735
+ className: Fe["rp-thumbnail-wrapper"],
2736
+ children: [
2737
+ /* @__PURE__ */ i("div", { className: re(c, Fe["rp-thumbnail"]), children: t ? /* @__PURE__ */ i(
2738
+ "img",
2739
+ {
2740
+ src: t,
2741
+ width: s.width,
2742
+ height: s.height,
2743
+ alt: "thumbnail"
2744
+ }
2745
+ ) : /* @__PURE__ */ i(
2746
+ "div",
2747
+ {
2748
+ className: Fe["rp-thumbnail-loader"],
2749
+ style: {
2750
+ width: `${s.width}px`,
2751
+ height: `${s.height}px`
2752
+ },
2753
+ children: /* @__PURE__ */ i(xt, {})
2754
+ }
2755
+ ) }),
2756
+ /* @__PURE__ */ i("div", { className: Fe["rp-thumbnail-text"], children: n })
2757
+ ]
2758
+ }
2759
+ );
2760
+ }, cn = {
2761
+ "rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
2762
+ "rp-thumbnails": "_rp-thumbnails_16vqr_1"
2763
+ }, ki = 16, Mi = (e, t) => {
2764
+ const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
2765
+ e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - ki);
2766
+ }, Wi = We((e, t) => {
2767
+ const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage: c, thumbnailLength: s, addToPage: l } = Sn(), u = M(null), d = M(1);
2768
+ ln(t, () => u.current);
2769
+ const f = F(() => Object.values(a), [a]), h = L(() => {
2770
+ const g = s + 1;
2771
+ g <= r && c(g);
2772
+ }, [c, r, s]);
2773
+ return A(() => {
2774
+ o > s ? l(o) : n && d.current !== o && (Mi(u.current, o), d.current = o);
2775
+ }, [o, s, l, n, f]), br(u.current, h), /* @__PURE__ */ i("div", { ref: u, className: cn["rp-thumbnails-container"], children: /* @__PURE__ */ i("div", { className: cn["rp-thumbnails"], children: n ? f.map((g, w) => {
2776
+ var b, v;
2777
+ return /* @__PURE__ */ i(
2778
+ Fi,
2779
+ {
2780
+ isFocused: o === ((b = g.page) == null ? void 0 : b.pageNumber),
2781
+ pageNumber: (v = g.page) == null ? void 0 : v.pageNumber,
2782
+ thumbnailSrc: g.thumbnailSrc,
2783
+ loading: g.loading,
2784
+ viewport: g.viewport
2785
+ },
2786
+ w
2787
+ );
2788
+ }) : null }) });
2789
+ }), Hi = () => {
2790
+ const { thumbnailIcon: e } = pe();
2791
+ return e || /* @__PURE__ */ i(wr, {});
2792
+ }, $i = () => {
2793
+ const { active: e, setActive: t } = Sn(), [n, o] = $(200), r = M(null), { thumbnailTool: a, sidebarEnable: c } = _e(), { localeMessages: s } = ue(), l = L(() => {
2794
+ t((d) => !d);
2795
+ }, []), u = F(() => typeof a != "boolean" && a ? /* @__PURE__ */ i(a, { onClick: l, active: e }) : a ? /* @__PURE__ */ i(q, { content: s == null ? void 0 : s.thumbnailTooltip, children: /* @__PURE__ */ i(
2796
+ Q,
2797
+ {
2798
+ onClick: l,
2799
+ active: e,
2800
+ "aria-label": s == null ? void 0 : s.thumbnailTooltip,
2801
+ children: /* @__PURE__ */ i(Hi, {})
2802
+ }
2803
+ ) }) : null, [a, e, l, s]);
2804
+ return /* @__PURE__ */ i(xe, { children: c && /* @__PURE__ */ D(
2805
+ "div",
2806
+ {
2807
+ style: { "--rp-thumbnail-width": `${n}px` },
2808
+ className: _t["rp-sidebar-content-wrapper"],
2809
+ "data-rp": "sidebar",
2810
+ children: [
2811
+ /* @__PURE__ */ i("div", { className: _t["rp-sidebar-content"], children: u }),
2812
+ /* @__PURE__ */ D(
2813
+ "div",
2814
+ {
2815
+ "data-rp": "thumbnailSidebar",
2816
+ hidden: !e,
2817
+ className: _t["rp-thumbnails-wrapper"],
2818
+ children: [
2819
+ /* @__PURE__ */ i(Wi, { show: e, ref: r }),
2820
+ /* @__PURE__ */ i(Cr, { onWidthChange: o, thumbnailRef: r })
2821
+ ]
2822
+ }
2823
+ )
2824
+ ]
2825
+ }
2826
+ ) });
2827
+ }, be = {
2828
+ "rp-layout": "_rp-layout_12d1x_1",
2829
+ "rp-content": "_rp-content_12d1x_5",
2830
+ "rp-pages": "_rp-pages_12d1x_11",
2831
+ "rp-container": "_rp-container_12d1x_16",
2832
+ "rp-loader": "_rp-loader_12d1x_52",
2833
+ "rp-theme-variables": "_rp-theme-variables_12d1x_56",
2834
+ "rp-dark-mode": "_rp-dark-mode_12d1x_147"
2835
+ }, Vi = We(
2836
+ (e, t) => {
2837
+ const { children: n, toolbarRef: o, style: r, className: a } = e, { customVariables: c, customDarkVariables: s } = Lr(), { darkMode: l } = ir();
2838
+ return /* @__PURE__ */ i(
2839
+ "div",
2840
+ {
2841
+ ref: t,
2842
+ className: re(
2843
+ be["rp-theme-variables"],
2844
+ be["rp-container"],
2845
+ l ? be["rp-dark-mode"] : "",
2846
+ a
2847
+ ),
2848
+ style: {
2849
+ "--rp-toolbar-height": `${(o == null ? void 0 : o.clientHeight) || 48}px`,
2850
+ ...c,
2851
+ ...l ? s : {},
2852
+ ...r
2853
+ },
2854
+ children: n
2855
+ }
2856
+ );
2857
+ }
2858
+ ), Rs = We((e, t) => {
2859
+ const {
2860
+ children: n,
2861
+ slots: o,
2862
+ icons: r,
2863
+ style: a,
2864
+ className: c,
2865
+ mobileWidth: s,
2866
+ onLoaded: l,
2867
+ cleanupOnLoaded: u,
2868
+ onLayoutWidthChange: d
2869
+ } = e, [f, h] = $(null), { setContainer: g, setContentRef: w } = Te(), { loading: b } = K(), { LoaderImageComponent: v } = mn();
2870
+ return A(() => (l && l(), () => {
2871
+ u && u();
2872
+ }), [l, u]), /* @__PURE__ */ i(Vi, { toolbarRef: f, ref: t, children: /* @__PURE__ */ i(Ir, { mobileWidth: s, onLayoutWidthChange: d, children: /* @__PURE__ */ i(Tr, { slots: o, children: /* @__PURE__ */ i(Pr, { icons: r, children: /* @__PURE__ */ D(Sr, { getContainerRef: g, style: a, className: c, children: [
2873
+ /* @__PURE__ */ D(xr, { children: [
2874
+ /* @__PURE__ */ D("div", { className: be["rp-layout"], children: [
2875
+ /* @__PURE__ */ i(Ai, { ref: h }),
2876
+ /* @__PURE__ */ D("div", { className: be["rp-content"], children: [
2877
+ /* @__PURE__ */ i("div", { className: be["rp-sidebar"], children: /* @__PURE__ */ i($i, {}) }),
2878
+ /* @__PURE__ */ i("div", { ref: w, className: be["rp-pages"], children: n })
2879
+ ] })
2880
+ ] }),
2881
+ /* @__PURE__ */ i(yr, {})
2882
+ ] }),
2883
+ b ? /* @__PURE__ */ i(
2884
+ "div",
2885
+ {
2886
+ className: be["rp-loader"],
2887
+ style: {
2888
+ position: "absolute",
2889
+ top: 0,
2890
+ left: 0,
2891
+ right: 0,
2892
+ bottom: 0,
2893
+ width: "100%",
2894
+ height: "100%"
2895
+ },
2896
+ children: /* @__PURE__ */ i(
2897
+ "div",
2898
+ {
2899
+ style: {
2900
+ display: "flex",
2901
+ justifyContent: "center",
2902
+ alignItems: "center",
2903
+ height: "100%",
2904
+ width: "100%"
2905
+ },
2906
+ children: v && /* @__PURE__ */ i(v, {})
2907
+ }
2908
+ )
2909
+ }
2910
+ ) : null
2911
+ ] }) }) }) }) });
2912
+ });
2913
+ export {
2914
+ So as A,
2915
+ Oi as B,
2916
+ bo as C,
2917
+ Uo as D,
2918
+ Ai as E,
2919
+ Bn as F,
2920
+ Fi as G,
2921
+ Wi as H,
2922
+ $i as I,
2923
+ Vi as J,
2924
+ zi as L,
2925
+ Si as M,
2926
+ xi as O,
2927
+ Ts as P,
2928
+ ys as R,
2929
+ xs as S,
2930
+ Ss as T,
2931
+ Ei as Z,
2932
+ Ps as a,
2933
+ Rs as b,
2934
+ Un as c,
2935
+ nt as d,
2936
+ yn as e,
2937
+ bn as f,
2938
+ go as g,
2939
+ Cn as h,
2940
+ vo as i,
2941
+ Tn as j,
2942
+ _o as k,
2943
+ Pn as l,
2944
+ Sn as m,
2945
+ wo as n,
2946
+ xn as o,
2947
+ Co as p,
2948
+ xo as q,
2949
+ Nt as r,
2950
+ $o as s,
2951
+ qo as t,
2952
+ ie as u,
2953
+ Zo as v,
2954
+ Xo as w,
2955
+ hi as x,
2956
+ Xn as y,
2957
+ yi as z
2958
+ };