@pdf-viewer/react 1.4.1 → 1.5.0-beta.1

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