@pdf-viewer/react 1.11.0-beta.0 → 1.11.0-beta.2

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