@pdf-viewer/react 0.0.0-experimental.6 → 0.0.0-experimental.7

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