@react-pdf-kit/viewer 2.0.0-beta.0

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 (458) hide show
  1. package/README.md +204 -0
  2. package/dist/LayoutWrapper-a871c161.js +19 -0
  3. package/dist/RotateTool.module-03987eba.js +6 -0
  4. package/dist/SearchCloseButton-cbf182aa.js +33 -0
  5. package/dist/ToolbarLayout.module-c588d36b.js +3411 -0
  6. package/dist/ZoomTool.module-6c5eabbb.js +12 -0
  7. package/dist/assets/Button.css +1 -0
  8. package/dist/assets/Checkbox.css +1 -0
  9. package/dist/assets/Container.css +1 -0
  10. package/dist/assets/DropDown.css +1 -0
  11. package/dist/assets/Input.css +1 -0
  12. package/dist/assets/LayoutWrapper.css +1 -0
  13. package/dist/assets/LoaderIcon.css +1 -0
  14. package/dist/assets/MenuItem.css +1 -0
  15. package/dist/assets/MenuSeparator.css +1 -0
  16. package/dist/assets/PasswordModal.css +1 -0
  17. package/dist/assets/PropertyItem.css +1 -0
  18. package/dist/assets/RPDropFileZone.css +1 -0
  19. package/dist/assets/RPSplitter.css +1 -0
  20. package/dist/assets/RPTooltip.css +1 -0
  21. package/dist/assets/RotateTool.css +1 -0
  22. package/dist/assets/SearchCloseButton.css +1 -0
  23. package/dist/assets/ToolbarLayout.css +1 -0
  24. package/dist/assets/WrapperLayout.css +1 -0
  25. package/dist/assets/ZoomTool.css +1 -0
  26. package/dist/clsx-0c6e471a.js +22 -0
  27. package/dist/components/RPConfig.js +1492 -0
  28. package/dist/components/RPController.js +92 -0
  29. package/dist/components/RPDropFileZone.js +39 -0
  30. package/dist/components/RPPages.js +66 -0
  31. package/dist/components/RPProvider.js +27 -0
  32. package/dist/components/RPTheme.js +21 -0
  33. package/dist/components/icons/CheckIcon.js +22 -0
  34. package/dist/components/icons/ChevronDownIcon.js +23 -0
  35. package/dist/components/icons/ChevronUpIcon.js +22 -0
  36. package/dist/components/icons/ClearIcon.js +25 -0
  37. package/dist/components/icons/ClockwiseIcon.js +22 -0
  38. package/dist/components/icons/CloseIcon.js +22 -0
  39. package/dist/components/icons/DarkPdfIcon.js +15 -0
  40. package/dist/components/icons/DualPageIcon.js +22 -0
  41. package/dist/components/icons/FileDownloadDefaultIcon.js +23 -0
  42. package/dist/components/icons/FileUploadDefaultIcon.js +23 -0
  43. package/dist/components/icons/FullScreenIcon.js +22 -0
  44. package/dist/components/icons/GoToDownIcon.js +22 -0
  45. package/dist/components/icons/HandModeDefaultIcon.js +22 -0
  46. package/dist/components/icons/HorizontalScrollingIcon.js +24 -0
  47. package/dist/components/icons/InfoIcon.js +22 -0
  48. package/dist/components/icons/LightPdfIcon.js +15 -0
  49. package/dist/components/icons/LoaderIcon.js +17 -0
  50. package/dist/components/icons/MoonIcon.js +22 -0
  51. package/dist/components/icons/PageScrollingIcon.js +24 -0
  52. package/dist/components/icons/PrintDefaultIcon.js +23 -0
  53. package/dist/components/icons/SearchIcon.js +22 -0
  54. package/dist/components/icons/SinglePageIcon.js +22 -0
  55. package/dist/components/icons/SunIcon.js +25 -0
  56. package/dist/components/icons/TextSelectionDefaultIcon.js +23 -0
  57. package/dist/components/icons/ThreeDotIcon.js +22 -0
  58. package/dist/components/icons/Thumbnail.js +54 -0
  59. package/dist/components/icons/VerticalScrollingIcon.js +24 -0
  60. package/dist/components/icons/WrappedScrollingIcon.js +24 -0
  61. package/dist/components/icons/ZoomInIcon.js +22 -0
  62. package/dist/components/icons/ZoomOutIcon.js +22 -0
  63. package/dist/components/layout/Container.js +21 -0
  64. package/dist/components/layout/LayoutContainer.js +60 -0
  65. package/dist/components/layout/LayoutWrapper.js +6 -0
  66. package/dist/components/layout/RPDefaultLayout.js +16 -0
  67. package/dist/components/layout/RPLayout.js +107 -0
  68. package/dist/components/layout/WrapperLayout.js +13 -0
  69. package/dist/components/layout/sidebar/RPSidebar.js +15 -0
  70. package/dist/components/layout/sidebar/RPSplitter.js +61 -0
  71. package/dist/components/layout/sidebar/Thumbnail.js +59 -0
  72. package/dist/components/layout/sidebar/Thumbnails.js +8 -0
  73. package/dist/components/layout/toolbar/DarkModeTool.js +27 -0
  74. package/dist/components/layout/toolbar/DocumentDialog.js +59 -0
  75. package/dist/components/layout/toolbar/DocumentProperties.js +27 -0
  76. package/dist/components/layout/toolbar/FileDownloadTool.js +15 -0
  77. package/dist/components/layout/toolbar/FileUploadTool.js +25 -0
  78. package/dist/components/layout/toolbar/FullScreenTool.js +59 -0
  79. package/dist/components/layout/toolbar/MenuItem.js +12 -0
  80. package/dist/components/layout/toolbar/MenuSeparator.js +8 -0
  81. package/dist/components/layout/toolbar/MostPageTool.js +60 -0
  82. package/dist/components/layout/toolbar/OtherTool.js +24 -0
  83. package/dist/components/layout/toolbar/Paginate.js +19 -0
  84. package/dist/components/layout/toolbar/PrintTool.js +15 -0
  85. package/dist/components/layout/toolbar/PropertyItem.js +12 -0
  86. package/dist/components/layout/toolbar/RPMenuItem.js +23 -0
  87. package/dist/components/layout/toolbar/RPMoreOptions.js +147 -0
  88. package/dist/components/layout/toolbar/RPToolbar.js +10 -0
  89. package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -0
  90. package/dist/components/layout/toolbar/RotateTool.js +36 -0
  91. package/dist/components/layout/toolbar/ScrollModeTool.js +56 -0
  92. package/dist/components/layout/toolbar/SearchCloseButton.js +9 -0
  93. package/dist/components/layout/toolbar/SearchResultNavigator.js +10 -0
  94. package/dist/components/layout/toolbar/SearchTool.js +61 -0
  95. package/dist/components/layout/toolbar/SelectionModeTool.js +40 -0
  96. package/dist/components/layout/toolbar/ThumbnailTool.js +17 -0
  97. package/dist/components/layout/toolbar/ToolbarCustom.js +95 -0
  98. package/dist/components/layout/toolbar/ToolbarDefault.js +97 -0
  99. package/dist/components/layout/toolbar/ToolbarLayout.js +10 -0
  100. package/dist/components/layout/toolbar/ViewModeTool.js +42 -0
  101. package/dist/components/layout/toolbar/ZoomTool.js +130 -0
  102. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +28 -0
  103. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +13 -0
  104. package/dist/components/layout/toolbar/tools/FileUploadTool.js +13 -0
  105. package/dist/components/layout/toolbar/tools/FullScreenTool.js +21 -0
  106. package/dist/components/layout/toolbar/tools/InputPageTool.js +45 -0
  107. package/dist/components/layout/toolbar/tools/NextPageTool.js +72 -0
  108. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +21 -0
  109. package/dist/components/layout/toolbar/tools/PrintTool.js +13 -0
  110. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +17 -0
  111. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +25 -0
  112. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +17 -0
  113. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +23 -0
  114. package/dist/components/layout/toolbar/tools/ZoomInTool.js +28 -0
  115. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +65 -0
  116. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +28 -0
  117. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +70 -0
  118. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -0
  119. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +16 -0
  120. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +20 -0
  121. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +69 -0
  122. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +20 -0
  123. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +78 -0
  124. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +20 -0
  125. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +26 -0
  126. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +43 -0
  127. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +30 -0
  128. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +32 -0
  129. package/dist/components/page/AnnotationLayer.js +62 -0
  130. package/dist/components/page/CanvasLayer.js +58 -0
  131. package/dist/components/page/CustomElement.js +22 -0
  132. package/dist/components/page/DualPage.js +6 -0
  133. package/dist/components/page/RPPage.js +60 -0
  134. package/dist/components/page/SinglePage.js +6 -0
  135. package/dist/components/page/TextHighlightLayer.js +60 -0
  136. package/dist/components/page/TextLayer.js +60 -0
  137. package/dist/components/page/searchHighlight.js +37 -0
  138. package/dist/components/ui/Button.js +22 -0
  139. package/dist/components/ui/Checkbox.js +264 -0
  140. package/dist/components/ui/DropDown.js +29 -0
  141. package/dist/components/ui/Input.js +26 -0
  142. package/dist/components/ui/LoadingIndicator.js +7 -0
  143. package/dist/components/ui/PasswordModal.js +58 -0
  144. package/dist/components/ui/RPTooltip.js +568 -0
  145. package/dist/contexts/ConfigContext.js +13 -0
  146. package/dist/contexts/DarkModeContext.js +28 -0
  147. package/dist/contexts/DimensionPagesContext.js +42 -0
  148. package/dist/contexts/DocumentPasswordContext.js +40 -0
  149. package/dist/contexts/DownloadContext.js +21 -0
  150. package/dist/contexts/DropFileZoneContext.js +52 -0
  151. package/dist/contexts/ElementPageContext.js +76 -0
  152. package/dist/contexts/FileInputContext.js +39 -0
  153. package/dist/contexts/FullScreenContext.js +18 -0
  154. package/dist/contexts/GlobalCurrentPage.js +16 -0
  155. package/dist/contexts/HighlightContext.js +18 -0
  156. package/dist/contexts/IconContext.js +11 -0
  157. package/dist/contexts/IconToolContext.js +13 -0
  158. package/dist/contexts/InitialStateContext.js +13 -0
  159. package/dist/contexts/LayerContext.js +8 -0
  160. package/dist/contexts/LayoutContainerContext.js +16 -0
  161. package/dist/contexts/LicenseContext.js +15 -0
  162. package/dist/contexts/LoaderContext.js +26 -0
  163. package/dist/contexts/LocalizationContext.js +38 -0
  164. package/dist/contexts/OtherToolContext.js +18 -0
  165. package/dist/contexts/PageViewportContext.js +8 -0
  166. package/dist/contexts/PagesRotateContext.js +25 -0
  167. package/dist/contexts/PaginationContext.js +11 -0
  168. package/dist/contexts/PrintContext.js +8 -0
  169. package/dist/contexts/RPDocumentContext.js +51 -0
  170. package/dist/contexts/RenderQueueProvider.js +10 -0
  171. package/dist/contexts/RenderedPagesCache.js +14 -0
  172. package/dist/contexts/RotationContext.js +28 -0
  173. package/dist/contexts/ScrollModeContext.js +21 -0
  174. package/dist/contexts/SearchContext.js +8 -0
  175. package/dist/contexts/SelectionModeContext.js +23 -0
  176. package/dist/contexts/SmoothScrollContext.js +12 -0
  177. package/dist/contexts/ThemeContext.js +7 -0
  178. package/dist/contexts/ThumbnailsContext.js +8 -0
  179. package/dist/contexts/ToolComponentContext.js +52 -0
  180. package/dist/contexts/ToolbarComponentContext.js +48 -0
  181. package/dist/contexts/ViewModeContext.js +28 -0
  182. package/dist/contexts/ViewportContext.js +85 -0
  183. package/dist/contexts/VirtualGridContext.js +15 -0
  184. package/dist/contexts/VirtualScrollContext.js +53 -0
  185. package/dist/contexts/ZoomContext.js +97 -0
  186. package/dist/floating-ui.react-dom-6b2fe0df.js +1474 -0
  187. package/dist/index-35c7f4a2.js +332 -0
  188. package/dist/index-f563c6f0.js +1889 -0
  189. package/dist/main.js +86 -0
  190. package/dist/th_TH-d627cd51.js +398 -0
  191. package/dist/types/components/RPConfig.d.ts +3 -0
  192. package/dist/types/components/RPController.d.ts +3 -0
  193. package/dist/types/components/RPDropFileZone.d.ts +2 -0
  194. package/dist/types/components/RPPages.d.ts +2 -0
  195. package/dist/types/components/RPProvider.d.ts +3 -0
  196. package/dist/types/components/RPTheme.d.ts +3 -0
  197. package/dist/types/components/icons/CheckIcon.d.ts +2 -0
  198. package/dist/types/components/icons/ChevronDownIcon.d.ts +2 -0
  199. package/dist/types/components/icons/ChevronUpIcon.d.ts +2 -0
  200. package/dist/types/components/icons/ClearIcon.d.ts +2 -0
  201. package/dist/types/components/icons/ClockwiseIcon.d.ts +2 -0
  202. package/dist/types/components/icons/CloseIcon.d.ts +2 -0
  203. package/dist/types/components/icons/DarkPdfIcon.d.ts +2 -0
  204. package/dist/types/components/icons/DualPageIcon.d.ts +2 -0
  205. package/dist/types/components/icons/FileDownloadDefaultIcon.d.ts +2 -0
  206. package/dist/types/components/icons/FileUploadDefaultIcon.d.ts +2 -0
  207. package/dist/types/components/icons/FullScreenIcon.d.ts +2 -0
  208. package/dist/types/components/icons/GoToDownIcon.d.ts +2 -0
  209. package/dist/types/components/icons/HandModeDefaultIcon.d.ts +2 -0
  210. package/dist/types/components/icons/HorizontalScrollingIcon.d.ts +2 -0
  211. package/dist/types/components/icons/InfoIcon.d.ts +2 -0
  212. package/dist/types/components/icons/LightPdfIcon.d.ts +2 -0
  213. package/dist/types/components/icons/LoaderIcon.d.ts +2 -0
  214. package/dist/types/components/icons/MoonIcon.d.ts +2 -0
  215. package/dist/types/components/icons/PageScrollingIcon.d.ts +2 -0
  216. package/dist/types/components/icons/PrintDefaultIcon.d.ts +2 -0
  217. package/dist/types/components/icons/SearchIcon.d.ts +2 -0
  218. package/dist/types/components/icons/SinglePageIcon.d.ts +2 -0
  219. package/dist/types/components/icons/SunIcon.d.ts +2 -0
  220. package/dist/types/components/icons/TextSelectionDefaultIcon.d.ts +2 -0
  221. package/dist/types/components/icons/ThreeDotIcon.d.ts +2 -0
  222. package/dist/types/components/icons/Thumbnail.d.ts +2 -0
  223. package/dist/types/components/icons/VerticalScrollingIcon.d.ts +2 -0
  224. package/dist/types/components/icons/WrappedScrollingIcon.d.ts +2 -0
  225. package/dist/types/components/icons/ZoomInIcon.d.ts +2 -0
  226. package/dist/types/components/icons/ZoomOutIcon.d.ts +2 -0
  227. package/dist/types/components/layout/Container.d.ts +8 -0
  228. package/dist/types/components/layout/LayoutContainer.d.ts +14 -0
  229. package/dist/types/components/layout/LayoutWrapper.d.ts +12 -0
  230. package/dist/types/components/layout/RPDefaultLayout.d.ts +2 -0
  231. package/dist/types/components/layout/RPLayout.d.ts +3 -0
  232. package/dist/types/components/layout/WrapperLayout.d.ts +2 -0
  233. package/dist/types/components/layout/sidebar/RPSidebar.d.ts +1 -0
  234. package/dist/types/components/layout/sidebar/RPSplitter.d.ts +9 -0
  235. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +11 -0
  236. package/dist/types/components/layout/sidebar/Thumbnails.d.ts +8 -0
  237. package/dist/types/components/layout/toolbar/DarkModeTool.d.ts +1 -0
  238. package/dist/types/components/layout/toolbar/DocumentDialog.d.ts +2 -0
  239. package/dist/types/components/layout/toolbar/DocumentProperties.d.ts +1 -0
  240. package/dist/types/components/layout/toolbar/FileDownloadTool.d.ts +2 -0
  241. package/dist/types/components/layout/toolbar/FileUploadTool.d.ts +2 -0
  242. package/dist/types/components/layout/toolbar/FullScreenTool.d.ts +1 -0
  243. package/dist/types/components/layout/toolbar/MenuItem.d.ts +6 -0
  244. package/dist/types/components/layout/toolbar/MenuSeparator.d.ts +1 -0
  245. package/dist/types/components/layout/toolbar/MostPageTool.d.ts +1 -0
  246. package/dist/types/components/layout/toolbar/OtherTool.d.ts +1 -0
  247. package/dist/types/components/layout/toolbar/Paginate.d.ts +1 -0
  248. package/dist/types/components/layout/toolbar/PrintTool.d.ts +1 -0
  249. package/dist/types/components/layout/toolbar/PropertyItem.d.ts +7 -0
  250. package/dist/types/components/layout/toolbar/RPMenuItem.d.ts +11 -0
  251. package/dist/types/components/layout/toolbar/RPMoreOptions.d.ts +3 -0
  252. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +3 -0
  253. package/dist/types/components/layout/toolbar/RPToolbarEnd.d.ts +1 -0
  254. package/dist/types/components/layout/toolbar/RotateTool.d.ts +1 -0
  255. package/dist/types/components/layout/toolbar/ScrollModeTool.d.ts +1 -0
  256. package/dist/types/components/layout/toolbar/SearchCloseButton.d.ts +7 -0
  257. package/dist/types/components/layout/toolbar/SearchResultNavigator.d.ts +1 -0
  258. package/dist/types/components/layout/toolbar/SearchTool.d.ts +3 -0
  259. package/dist/types/components/layout/toolbar/SelectionModeTool.d.ts +1 -0
  260. package/dist/types/components/layout/toolbar/ThumbnailTool.d.ts +2 -0
  261. package/dist/types/components/layout/toolbar/ToolbarCustom.d.ts +3 -0
  262. package/dist/types/components/layout/toolbar/ToolbarDefault.d.ts +4 -0
  263. package/dist/types/components/layout/toolbar/ToolbarLayout.d.ts +3 -0
  264. package/dist/types/components/layout/toolbar/ViewModeTool.d.ts +1 -0
  265. package/dist/types/components/layout/toolbar/ZoomTool.d.ts +1 -0
  266. package/dist/types/components/layout/toolbar/tools/DocumentPropertiesTool.d.ts +3 -0
  267. package/dist/types/components/layout/toolbar/tools/FileDownloadTool.d.ts +3 -0
  268. package/dist/types/components/layout/toolbar/tools/FileUploadTool.d.ts +3 -0
  269. package/dist/types/components/layout/toolbar/tools/FullScreenTool.d.ts +3 -0
  270. package/dist/types/components/layout/toolbar/tools/InputPageTool.d.ts +2 -0
  271. package/dist/types/components/layout/toolbar/tools/NextPageTool.d.ts +3 -0
  272. package/dist/types/components/layout/toolbar/tools/PreviousPageTool.d.ts +3 -0
  273. package/dist/types/components/layout/toolbar/tools/PrintTool.d.ts +3 -0
  274. package/dist/types/components/layout/toolbar/tools/RotateClockwiseTool.d.ts +3 -0
  275. package/dist/types/components/layout/toolbar/tools/RotateCounterclockwiseTool.d.ts +3 -0
  276. package/dist/types/components/layout/toolbar/tools/ThemeSwitcherTool.d.ts +3 -0
  277. package/dist/types/components/layout/toolbar/tools/ThumbnailTool.d.ts +3 -0
  278. package/dist/types/components/layout/toolbar/tools/ZoomInTool.d.ts +3 -0
  279. package/dist/types/components/layout/toolbar/tools/ZoomLevelTool.d.ts +3 -0
  280. package/dist/types/components/layout/toolbar/tools/ZoomOutTool.d.ts +3 -0
  281. package/dist/types/components/layout/toolbar/tools/defaults/RPHorizontalBar.d.ts +3 -0
  282. package/dist/types/components/layout/toolbar/tools/defaults/RPVerticalBar.d.ts +3 -0
  283. package/dist/types/components/layout/toolbar/tools/more-options/DocumentProperties.d.ts +3 -0
  284. package/dist/types/components/layout/toolbar/tools/more-options/FileDownloadTool.d.ts +3 -0
  285. package/dist/types/components/layout/toolbar/tools/more-options/FileUploadTool.d.ts +3 -0
  286. package/dist/types/components/layout/toolbar/tools/more-options/FullScreenTool.d.ts +3 -0
  287. package/dist/types/components/layout/toolbar/tools/more-options/MostPageTool.d.ts +3 -0
  288. package/dist/types/components/layout/toolbar/tools/more-options/PrintTool.d.ts +3 -0
  289. package/dist/types/components/layout/toolbar/tools/more-options/RotateTool.d.ts +3 -0
  290. package/dist/types/components/layout/toolbar/tools/more-options/ScrollModeTool.d.ts +3 -0
  291. package/dist/types/components/layout/toolbar/tools/more-options/SelectionModeTool.d.ts +3 -0
  292. package/dist/types/components/layout/toolbar/tools/more-options/ViewModeTool.d.ts +3 -0
  293. package/dist/types/components/page/AnnotationLayer.d.ts +6 -0
  294. package/dist/types/components/page/CanvasLayer.d.ts +8 -0
  295. package/dist/types/components/page/CustomElement.d.ts +6 -0
  296. package/dist/types/components/page/DualPage.d.ts +5 -0
  297. package/dist/types/components/page/RPPage.d.ts +7 -0
  298. package/dist/types/components/page/SinglePage.d.ts +5 -0
  299. package/dist/types/components/page/TextHighlightLayer.d.ts +10 -0
  300. package/dist/types/components/page/TextLayer.d.ts +6 -0
  301. package/dist/types/components/page/searchHighlight.d.ts +5 -0
  302. package/dist/types/components/ui/Button.d.ts +8 -0
  303. package/dist/types/components/ui/Checkbox.d.ts +9 -0
  304. package/dist/types/components/ui/DropDown.d.ts +10 -0
  305. package/dist/types/components/ui/Input.d.ts +8 -0
  306. package/dist/types/components/ui/LoadingIndicator.d.ts +6 -0
  307. package/dist/types/components/ui/PasswordModal.d.ts +3 -0
  308. package/dist/types/components/ui/RPTooltip.d.ts +11 -0
  309. package/dist/types/contexts/ConfigContext.d.ts +5 -0
  310. package/dist/types/contexts/DarkModeContext.d.ts +5 -0
  311. package/dist/types/contexts/DimensionPagesContext.d.ts +4 -0
  312. package/dist/types/contexts/DocumentPasswordContext.d.ts +14 -0
  313. package/dist/types/contexts/DownloadContext.d.ts +11 -0
  314. package/dist/types/contexts/DropFileZoneContext.d.ts +5 -0
  315. package/dist/types/contexts/ElementPageContext.d.ts +6 -0
  316. package/dist/types/contexts/FileInputContext.d.ts +7 -0
  317. package/dist/types/contexts/FullScreenContext.d.ts +7 -0
  318. package/dist/types/contexts/GlobalCurrentPage.d.ts +11 -0
  319. package/dist/types/contexts/HighlightContext.d.ts +8 -0
  320. package/dist/types/contexts/IconContext.d.ts +7 -0
  321. package/dist/types/contexts/IconToolContext.d.ts +9 -0
  322. package/dist/types/contexts/InitialStateContext.d.ts +5 -0
  323. package/dist/types/contexts/LayerContext.d.ts +5 -0
  324. package/dist/types/contexts/LayoutContainerContext.d.ts +12 -0
  325. package/dist/types/contexts/LicenseContext.d.ts +7 -0
  326. package/dist/types/contexts/LoaderContext.d.ts +12 -0
  327. package/dist/types/contexts/LocalizationContext.d.ts +5 -0
  328. package/dist/types/contexts/OtherToolContext.d.ts +9 -0
  329. package/dist/types/contexts/PageViewportContext.d.ts +4 -0
  330. package/dist/types/contexts/PagesRotateContext.d.ts +15 -0
  331. package/dist/types/contexts/PaginationContext.d.ts +5 -0
  332. package/dist/types/contexts/PrintContext.d.ts +7 -0
  333. package/dist/types/contexts/RPDocumentContext.d.ts +12 -0
  334. package/dist/types/contexts/RenderQueueProvider.d.ts +16 -0
  335. package/dist/types/contexts/RenderedPagesCache.d.ts +10 -0
  336. package/dist/types/contexts/RotationContext.d.ts +5 -0
  337. package/dist/types/contexts/ScrollModeContext.d.ts +5 -0
  338. package/dist/types/contexts/SearchContext.d.ts +7 -0
  339. package/dist/types/contexts/SelectionModeContext.d.ts +5 -0
  340. package/dist/types/contexts/SmoothScrollContext.d.ts +8 -0
  341. package/dist/types/contexts/ThemeContext.d.ts +4 -0
  342. package/dist/types/contexts/ThumbnailsContext.d.ts +7 -0
  343. package/dist/types/contexts/ToolComponentContext.d.ts +12 -0
  344. package/dist/types/contexts/ToolbarComponentContext.d.ts +9 -0
  345. package/dist/types/contexts/ViewModeContext.d.ts +5 -0
  346. package/dist/types/contexts/ViewportContext.d.ts +28 -0
  347. package/dist/types/contexts/VirtualGridContext.d.ts +9 -0
  348. package/dist/types/contexts/VirtualScrollContext.d.ts +30 -0
  349. package/dist/types/contexts/ZoomContext.d.ts +5 -0
  350. package/dist/types/locales/en_US.json.d.ts +81 -0
  351. package/dist/types/locales/it_IT.json.d.ts +81 -0
  352. package/dist/types/locales/pt_PT.json.d.ts +81 -0
  353. package/dist/types/locales/th_TH.json.d.ts +81 -0
  354. package/dist/types/locales/zh_CN.json.d.ts +81 -0
  355. package/dist/types/main.d.ts +45 -0
  356. package/dist/types/utils/Queue.d.ts +18 -0
  357. package/dist/types/utils/annotations.d.ts +9 -0
  358. package/dist/types/utils/appConsole.d.ts +24 -0
  359. package/dist/types/utils/calculatePage.d.ts +12 -0
  360. package/dist/types/utils/charators.d.ts +12 -0
  361. package/dist/types/utils/const.d.ts +3 -0
  362. package/dist/types/utils/constants.d.ts +5 -0
  363. package/dist/types/utils/convertPdfDate.d.ts +1 -0
  364. package/dist/types/utils/dateFormatter.d.ts +1 -0
  365. package/dist/types/utils/elementPagePosition.d.ts +17 -0
  366. package/dist/types/utils/formatFileSize.d.ts +1 -0
  367. package/dist/types/utils/getScrollDistance.d.ts +1 -0
  368. package/dist/types/utils/getThumbnailViewport.d.ts +5 -0
  369. package/dist/types/utils/getWordPositionInPage.d.ts +8 -0
  370. package/dist/types/utils/getZoomLevel.d.ts +2 -0
  371. package/dist/types/utils/highlight.d.ts +14 -0
  372. package/dist/types/utils/hooks/useDarkMode.d.ts +2 -0
  373. package/dist/types/utils/hooks/useDarkModeProps.d.ts +2 -0
  374. package/dist/types/utils/hooks/useDebounce.d.ts +1 -0
  375. package/dist/types/utils/hooks/useElementSize.d.ts +8 -0
  376. package/dist/types/utils/hooks/useFileDownload.d.ts +3 -0
  377. package/dist/types/utils/hooks/useFlickerSelectText.d.ts +1 -0
  378. package/dist/types/utils/hooks/useFullScreen.d.ts +6 -0
  379. package/dist/types/utils/hooks/useGrabScroll.d.ts +11 -0
  380. package/dist/types/utils/hooks/useHighlight.d.ts +10 -0
  381. package/dist/types/utils/hooks/useInfiniteScroll.d.ts +6 -0
  382. package/dist/types/utils/hooks/useLicense.d.ts +2 -0
  383. package/dist/types/utils/hooks/useLoadPdf.d.ts +11 -0
  384. package/dist/types/utils/hooks/useLoadWorker.d.ts +3 -0
  385. package/dist/types/utils/hooks/useLocalization.d.ts +10 -0
  386. package/dist/types/utils/hooks/useMousePressed.d.ts +7 -0
  387. package/dist/types/utils/hooks/usePageRotateContext.d.ts +3 -0
  388. package/dist/types/utils/hooks/usePaginate.d.ts +2 -0
  389. package/dist/types/utils/hooks/usePdfProperties.d.ts +9 -0
  390. package/dist/types/utils/hooks/usePinch.d.ts +1 -0
  391. package/dist/types/utils/hooks/usePresentPage.d.ts +1 -0
  392. package/dist/types/utils/hooks/usePrint.d.ts +11 -0
  393. package/dist/types/utils/hooks/useRequestAnimationFrame.d.ts +5 -0
  394. package/dist/types/utils/hooks/useResizeObserver.d.ts +6 -0
  395. package/dist/types/utils/hooks/useRotate.d.ts +4 -0
  396. package/dist/types/utils/hooks/useScrollToPage.d.ts +3 -0
  397. package/dist/types/utils/hooks/useSearch.d.ts +14 -0
  398. package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
  399. package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +17 -0
  400. package/dist/types/utils/hooks/useWatermark.d.ts +1 -0
  401. package/dist/types/utils/link_service.d.ts +71 -0
  402. package/dist/types/utils/renderPage.d.ts +3 -0
  403. package/dist/types/utils/sanitizeExternalUrl.d.ts +1 -0
  404. package/dist/types/utils/smoothScrollTo.d.ts +2 -0
  405. package/dist/types/utils/types.d.ts +856 -0
  406. package/dist/types/utils/withRef.d.ts +4 -0
  407. package/dist/utils/Queue.js +47 -0
  408. package/dist/utils/annotations.js +306 -0
  409. package/dist/utils/appConsole.js +42 -0
  410. package/dist/utils/calculatePage.js +15 -0
  411. package/dist/utils/charators.js +48 -0
  412. package/dist/utils/const.js +9 -0
  413. package/dist/utils/constants.js +8 -0
  414. package/dist/utils/convertPdfDate.js +25 -0
  415. package/dist/utils/dateFormatter.js +7 -0
  416. package/dist/utils/elementPagePosition.js +11 -0
  417. package/dist/utils/formatFileSize.js +9 -0
  418. package/dist/utils/getScrollDistance.js +4 -0
  419. package/dist/utils/getThumbnailViewport.js +7 -0
  420. package/dist/utils/getWordPositionInPage.js +25 -0
  421. package/dist/utils/getZoomLevel.js +23 -0
  422. package/dist/utils/highlight.js +221 -0
  423. package/dist/utils/hooks/useDarkMode.js +11 -0
  424. package/dist/utils/hooks/useDarkModeProps.js +11 -0
  425. package/dist/utils/hooks/useDebounce.js +19 -0
  426. package/dist/utils/hooks/useElementSize.js +21 -0
  427. package/dist/utils/hooks/useFileDownload.js +58 -0
  428. package/dist/utils/hooks/useFlickerSelectText.js +25 -0
  429. package/dist/utils/hooks/useFullScreen.js +29 -0
  430. package/dist/utils/hooks/useGrabScroll.js +52 -0
  431. package/dist/utils/hooks/useHighlight.js +54 -0
  432. package/dist/utils/hooks/useInfiniteScroll.js +19 -0
  433. package/dist/utils/hooks/useLicense.js +110 -0
  434. package/dist/utils/hooks/useLoadPdf.js +77 -0
  435. package/dist/utils/hooks/useLoadWorker.js +13 -0
  436. package/dist/utils/hooks/useLocalization.js +25 -0
  437. package/dist/utils/hooks/useMousePressed.js +20 -0
  438. package/dist/utils/hooks/usePageRotateContext.js +26 -0
  439. package/dist/utils/hooks/usePaginate.js +60 -0
  440. package/dist/utils/hooks/usePdfProperties.js +37 -0
  441. package/dist/utils/hooks/usePinch.js +79 -0
  442. package/dist/utils/hooks/usePresentPage.js +60 -0
  443. package/dist/utils/hooks/usePrint.js +59 -0
  444. package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
  445. package/dist/utils/hooks/useResizeObserver.js +22 -0
  446. package/dist/utils/hooks/useRotate.js +13 -0
  447. package/dist/utils/hooks/useScrollToPage.js +62 -0
  448. package/dist/utils/hooks/useSearch.js +62 -0
  449. package/dist/utils/hooks/useThumbnail.js +59 -0
  450. package/dist/utils/hooks/useVirtualReactWindow.js +60 -0
  451. package/dist/utils/hooks/useWatermark.js +91 -0
  452. package/dist/utils/link_service.js +98 -0
  453. package/dist/utils/renderPage.js +17 -0
  454. package/dist/utils/sanitizeExternalUrl.js +16 -0
  455. package/dist/utils/smoothScrollTo.js +6 -0
  456. package/dist/utils/types.js +21 -0
  457. package/dist/utils/withRef.js +8 -0
  458. package/package.json +91 -0
@@ -0,0 +1,1492 @@
1
+ var St = (e, t, s) => {
2
+ if (!t.has(e))
3
+ throw TypeError("Cannot " + s);
4
+ };
5
+ var i = (e, t, s) => (St(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => {
6
+ if (t.has(e))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ t instanceof WeakSet ? t.add(e) : t.set(e, s);
9
+ }, o = (e, t, s, r) => (St(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s);
10
+ var bt = (e, t, s, r) => ({
11
+ set _(n) {
12
+ o(e, t, n, s);
13
+ },
14
+ get _() {
15
+ return i(e, t, r);
16
+ }
17
+ }), F = (e, t, s) => (St(e, t, "access private method"), s);
18
+ import { jsx as dt } from "react/jsx-runtime";
19
+ import { RPTheme as ee } from "./RPTheme.js";
20
+ import { ConfigContextProvider as se } from "../contexts/ConfigContext.js";
21
+ import { useLoadWorker as re } from "../utils/hooks/useLoadWorker.js";
22
+ import * as Jt from "react";
23
+ import { LicenseProvider as ie } from "../contexts/LicenseContext.js";
24
+ var Ct = class {
25
+ constructor() {
26
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
27
+ }
28
+ subscribe(e) {
29
+ return this.listeners.add(e), this.onSubscribe(), () => {
30
+ this.listeners.delete(e), this.onUnsubscribe();
31
+ };
32
+ }
33
+ hasListeners() {
34
+ return this.listeners.size > 0;
35
+ }
36
+ onSubscribe() {
37
+ }
38
+ onUnsubscribe() {
39
+ }
40
+ }, ne = {
41
+ // We need the wrapper function syntax below instead of direct references to
42
+ // global setTimeout etc.
43
+ //
44
+ // BAD: `setTimeout: setTimeout`
45
+ // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
46
+ //
47
+ // If we use direct references here, then anything that wants to spy on or
48
+ // replace the global setTimeout (like tests) won't work since we'll already
49
+ // have a hard reference to the original implementation at the time when this
50
+ // file was imported.
51
+ setTimeout: (e, t) => setTimeout(e, t),
52
+ clearTimeout: (e) => clearTimeout(e),
53
+ setInterval: (e, t) => setInterval(e, t),
54
+ clearInterval: (e) => clearInterval(e)
55
+ }, x, W, Nt, ae = (Nt = class {
56
+ constructor() {
57
+ // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
58
+ // type at app boot; and if we leave that type, then any new timer provider
59
+ // would need to support ReturnType<typeof setTimeout>, which is infeasible.
60
+ //
61
+ // We settle for type safety for the TimeoutProvider type, and accept that
62
+ // this class is unsafe internally to allow for extension.
63
+ c(this, x, ne);
64
+ c(this, W, !1);
65
+ }
66
+ setTimeoutProvider(e) {
67
+ process.env.NODE_ENV !== "production" && i(this, W) && e !== i(this, x) && console.error(
68
+ "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
69
+ { previous: i(this, x), provider: e }
70
+ ), o(this, x, e), process.env.NODE_ENV !== "production" && o(this, W, !1);
71
+ }
72
+ setTimeout(e, t) {
73
+ return process.env.NODE_ENV !== "production" && o(this, W, !0), i(this, x).setTimeout(e, t);
74
+ }
75
+ clearTimeout(e) {
76
+ i(this, x).clearTimeout(e);
77
+ }
78
+ setInterval(e, t) {
79
+ return process.env.NODE_ENV !== "production" && o(this, W, !0), i(this, x).setInterval(e, t);
80
+ }
81
+ clearInterval(e) {
82
+ i(this, x).clearInterval(e);
83
+ }
84
+ }, x = new WeakMap(), W = new WeakMap(), Nt), Et = new ae();
85
+ function oe(e) {
86
+ setTimeout(e, 0);
87
+ }
88
+ var Ft = typeof window > "u" || "Deno" in globalThis;
89
+ function R() {
90
+ }
91
+ function ue(e, t) {
92
+ return typeof e == "function" ? e(t) : e;
93
+ }
94
+ function he(e) {
95
+ return typeof e == "number" && e >= 0 && e !== 1 / 0;
96
+ }
97
+ function ce(e, t) {
98
+ return Math.max(e + (t || 0) - Date.now(), 0);
99
+ }
100
+ function qt(e, t) {
101
+ return typeof e == "function" ? e(t) : e;
102
+ }
103
+ function le(e, t) {
104
+ return typeof e == "function" ? e(t) : e;
105
+ }
106
+ function Tt(e, t) {
107
+ const {
108
+ type: s = "all",
109
+ exact: r,
110
+ fetchStatus: n,
111
+ predicate: a,
112
+ queryKey: l,
113
+ stale: u
114
+ } = e;
115
+ if (l) {
116
+ if (r) {
117
+ if (t.queryHash !== Mt(l, t.options))
118
+ return !1;
119
+ } else if (!yt(t.queryKey, l))
120
+ return !1;
121
+ }
122
+ if (s !== "all") {
123
+ const f = t.isActive();
124
+ if (s === "active" && !f || s === "inactive" && f)
125
+ return !1;
126
+ }
127
+ return !(typeof u == "boolean" && t.isStale() !== u || n && n !== t.state.fetchStatus || a && !a(t));
128
+ }
129
+ function Rt(e, t) {
130
+ const { exact: s, status: r, predicate: n, mutationKey: a } = e;
131
+ if (a) {
132
+ if (!t.options.mutationKey)
133
+ return !1;
134
+ if (s) {
135
+ if (ft(t.options.mutationKey) !== ft(a))
136
+ return !1;
137
+ } else if (!yt(t.options.mutationKey, a))
138
+ return !1;
139
+ }
140
+ return !(r && t.state.status !== r || n && !n(t));
141
+ }
142
+ function Mt(e, t) {
143
+ return ((t == null ? void 0 : t.queryKeyHashFn) || ft)(e);
144
+ }
145
+ function ft(e) {
146
+ return JSON.stringify(
147
+ e,
148
+ (t, s) => At(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
149
+ );
150
+ }
151
+ function yt(e, t) {
152
+ return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => yt(e[s], t[s])) : !1;
153
+ }
154
+ var de = Object.prototype.hasOwnProperty;
155
+ function Dt(e, t) {
156
+ if (e === t)
157
+ return e;
158
+ const s = It(e) && It(t);
159
+ if (!s && !(At(e) && At(t)))
160
+ return t;
161
+ const n = (s ? e : Object.keys(e)).length, a = s ? t : Object.keys(t), l = a.length, u = s ? new Array(l) : {};
162
+ let f = 0;
163
+ for (let O = 0; O < l; O++) {
164
+ const v = s ? O : a[O], C = e[v], g = t[v];
165
+ if (C === g) {
166
+ u[v] = C, (s ? O < n : de.call(e, v)) && f++;
167
+ continue;
168
+ }
169
+ if (C === null || g === null || typeof C != "object" || typeof g != "object") {
170
+ u[v] = g;
171
+ continue;
172
+ }
173
+ const D = Dt(C, g);
174
+ u[v] = D, D === C && f++;
175
+ }
176
+ return n === l && f === n ? e : u;
177
+ }
178
+ function It(e) {
179
+ return Array.isArray(e) && e.length === Object.keys(e).length;
180
+ }
181
+ function At(e) {
182
+ if (!jt(e))
183
+ return !1;
184
+ const t = e.constructor;
185
+ if (t === void 0)
186
+ return !0;
187
+ const s = t.prototype;
188
+ return !(!jt(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
189
+ }
190
+ function jt(e) {
191
+ return Object.prototype.toString.call(e) === "[object Object]";
192
+ }
193
+ function fe(e) {
194
+ return new Promise((t) => {
195
+ Et.setTimeout(t, e);
196
+ });
197
+ }
198
+ function ye(e, t, s) {
199
+ if (typeof s.structuralSharing == "function")
200
+ return s.structuralSharing(e, t);
201
+ if (s.structuralSharing !== !1) {
202
+ if (process.env.NODE_ENV !== "production")
203
+ try {
204
+ return Dt(e, t);
205
+ } catch (r) {
206
+ throw console.error(
207
+ `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
208
+ ), r;
209
+ }
210
+ return Dt(e, t);
211
+ }
212
+ return t;
213
+ }
214
+ function pe(e, t, s = 0) {
215
+ const r = [...e, t];
216
+ return s && r.length > s ? r.slice(1) : r;
217
+ }
218
+ function me(e, t, s = 0) {
219
+ const r = [t, ...e];
220
+ return s && r.length > s ? r.slice(0, -1) : r;
221
+ }
222
+ var Pt = Symbol();
223
+ function Wt(e, t) {
224
+ return process.env.NODE_ENV !== "production" && e.queryFn === Pt && console.error(
225
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
226
+ ), !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === Pt ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
227
+ }
228
+ var Z, G, rt, Ht, ve = (Ht = class extends Ct {
229
+ constructor() {
230
+ super();
231
+ c(this, Z, void 0);
232
+ c(this, G, void 0);
233
+ c(this, rt, void 0);
234
+ o(this, rt, (t) => {
235
+ if (!Ft && window.addEventListener) {
236
+ const s = () => t();
237
+ return window.addEventListener("visibilitychange", s, !1), () => {
238
+ window.removeEventListener("visibilitychange", s);
239
+ };
240
+ }
241
+ });
242
+ }
243
+ onSubscribe() {
244
+ i(this, G) || this.setEventListener(i(this, rt));
245
+ }
246
+ onUnsubscribe() {
247
+ var t;
248
+ this.hasListeners() || ((t = i(this, G)) == null || t.call(this), o(this, G, void 0));
249
+ }
250
+ setEventListener(t) {
251
+ var s;
252
+ o(this, rt, t), (s = i(this, G)) == null || s.call(this), o(this, G, t((r) => {
253
+ typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
254
+ }));
255
+ }
256
+ setFocused(t) {
257
+ i(this, Z) !== t && (o(this, Z, t), this.onFocus());
258
+ }
259
+ onFocus() {
260
+ const t = this.isFocused();
261
+ this.listeners.forEach((s) => {
262
+ s(t);
263
+ });
264
+ }
265
+ isFocused() {
266
+ var t;
267
+ return typeof i(this, Z) == "boolean" ? i(this, Z) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
268
+ }
269
+ }, Z = new WeakMap(), G = new WeakMap(), rt = new WeakMap(), Ht), Zt = new ve();
270
+ function ge() {
271
+ let e, t;
272
+ const s = new Promise((n, a) => {
273
+ e = n, t = a;
274
+ });
275
+ s.status = "pending", s.catch(() => {
276
+ });
277
+ function r(n) {
278
+ Object.assign(s, n), delete s.resolve, delete s.reject;
279
+ }
280
+ return s.resolve = (n) => {
281
+ r({
282
+ status: "fulfilled",
283
+ value: n
284
+ }), e(n);
285
+ }, s.reject = (n) => {
286
+ r({
287
+ status: "rejected",
288
+ reason: n
289
+ }), t(n);
290
+ }, s;
291
+ }
292
+ var be = oe;
293
+ function we() {
294
+ let e = [], t = 0, s = (u) => {
295
+ u();
296
+ }, r = (u) => {
297
+ u();
298
+ }, n = be;
299
+ const a = (u) => {
300
+ t ? e.push(u) : n(() => {
301
+ s(u);
302
+ });
303
+ }, l = () => {
304
+ const u = e;
305
+ e = [], u.length && n(() => {
306
+ r(() => {
307
+ u.forEach((f) => {
308
+ s(f);
309
+ });
310
+ });
311
+ });
312
+ };
313
+ return {
314
+ batch: (u) => {
315
+ let f;
316
+ t++;
317
+ try {
318
+ f = u();
319
+ } finally {
320
+ t--, t || l();
321
+ }
322
+ return f;
323
+ },
324
+ /**
325
+ * All calls to the wrapped function will be batched.
326
+ */
327
+ batchCalls: (u) => (...f) => {
328
+ a(() => {
329
+ u(...f);
330
+ });
331
+ },
332
+ schedule: a,
333
+ /**
334
+ * Use this method to set a custom notify function.
335
+ * This can be used to for example wrap notifications with `React.act` while running tests.
336
+ */
337
+ setNotifyFunction: (u) => {
338
+ s = u;
339
+ },
340
+ /**
341
+ * Use this method to set a custom function to batch notifications together into a single tick.
342
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
343
+ */
344
+ setBatchNotifyFunction: (u) => {
345
+ r = u;
346
+ },
347
+ setScheduler: (u) => {
348
+ n = u;
349
+ }
350
+ };
351
+ }
352
+ var q = we(), it, _, nt, Lt, Pe = (Lt = class extends Ct {
353
+ constructor() {
354
+ super();
355
+ c(this, it, !0);
356
+ c(this, _, void 0);
357
+ c(this, nt, void 0);
358
+ o(this, nt, (t) => {
359
+ if (!Ft && window.addEventListener) {
360
+ const s = () => t(!0), r = () => t(!1);
361
+ return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
362
+ window.removeEventListener("online", s), window.removeEventListener("offline", r);
363
+ };
364
+ }
365
+ });
366
+ }
367
+ onSubscribe() {
368
+ i(this, _) || this.setEventListener(i(this, nt));
369
+ }
370
+ onUnsubscribe() {
371
+ var t;
372
+ this.hasListeners() || ((t = i(this, _)) == null || t.call(this), o(this, _, void 0));
373
+ }
374
+ setEventListener(t) {
375
+ var s;
376
+ o(this, nt, t), (s = i(this, _)) == null || s.call(this), o(this, _, t(this.setOnline.bind(this)));
377
+ }
378
+ setOnline(t) {
379
+ i(this, it) !== t && (o(this, it, t), this.listeners.forEach((r) => {
380
+ r(t);
381
+ }));
382
+ }
383
+ isOnline() {
384
+ return i(this, it);
385
+ }
386
+ }, it = new WeakMap(), _ = new WeakMap(), nt = new WeakMap(), Lt), Ot = new Pe();
387
+ function Oe(e) {
388
+ return Math.min(1e3 * 2 ** e, 3e4);
389
+ }
390
+ function Xt(e) {
391
+ return (e ?? "online") === "online" ? Ot.isOnline() : !0;
392
+ }
393
+ var Qt = class extends Error {
394
+ constructor(e) {
395
+ super("CancelledError"), this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
396
+ }
397
+ };
398
+ function Yt(e) {
399
+ let t = !1, s = 0, r;
400
+ const n = ge(), a = () => n.status !== "pending", l = (d) => {
401
+ var b;
402
+ if (!a()) {
403
+ const m = new Qt(d);
404
+ g(m), (b = e.onCancel) == null || b.call(e, m);
405
+ }
406
+ }, u = () => {
407
+ t = !0;
408
+ }, f = () => {
409
+ t = !1;
410
+ }, O = () => Zt.isFocused() && (e.networkMode === "always" || Ot.isOnline()) && e.canRun(), v = () => Xt(e.networkMode) && e.canRun(), C = (d) => {
411
+ a() || (r == null || r(), n.resolve(d));
412
+ }, g = (d) => {
413
+ a() || (r == null || r(), n.reject(d));
414
+ }, D = () => new Promise((d) => {
415
+ var b;
416
+ r = (m) => {
417
+ (a() || O()) && d(m);
418
+ }, (b = e.onPause) == null || b.call(e);
419
+ }).then(() => {
420
+ var d;
421
+ r = void 0, a() || (d = e.onContinue) == null || d.call(e);
422
+ }), Q = () => {
423
+ if (a())
424
+ return;
425
+ let d;
426
+ const b = s === 0 ? e.initialPromise : void 0;
427
+ try {
428
+ d = b ?? e.fn();
429
+ } catch (m) {
430
+ d = Promise.reject(m);
431
+ }
432
+ Promise.resolve(d).then(C).catch((m) => {
433
+ var T;
434
+ if (a())
435
+ return;
436
+ const A = e.retry ?? (Ft ? 0 : 3), p = e.retryDelay ?? Oe, h = typeof p == "function" ? p(s, m) : p, S = A === !0 || typeof A == "number" && s < A || typeof A == "function" && A(s, m);
437
+ if (t || !S) {
438
+ g(m);
439
+ return;
440
+ }
441
+ s++, (T = e.onFail) == null || T.call(e, s, m), fe(h).then(() => O() ? void 0 : D()).then(() => {
442
+ t ? g(m) : Q();
443
+ });
444
+ });
445
+ };
446
+ return {
447
+ promise: n,
448
+ status: () => n.status,
449
+ cancel: l,
450
+ continue: () => (r == null || r(), n),
451
+ cancelRetry: u,
452
+ continueRetry: f,
453
+ canStart: v,
454
+ start: () => (v() ? Q() : D().then(Q), n)
455
+ };
456
+ }
457
+ var X, Gt, te = (Gt = class {
458
+ constructor() {
459
+ c(this, X, void 0);
460
+ }
461
+ destroy() {
462
+ this.clearGcTimeout();
463
+ }
464
+ scheduleGc() {
465
+ this.clearGcTimeout(), he(this.gcTime) && o(this, X, Et.setTimeout(() => {
466
+ this.optionalRemove();
467
+ }, this.gcTime));
468
+ }
469
+ updateGcTime(e) {
470
+ this.gcTime = Math.max(
471
+ this.gcTime || 0,
472
+ e ?? (Ft ? 1 / 0 : 5 * 60 * 1e3)
473
+ );
474
+ }
475
+ clearGcTimeout() {
476
+ i(this, X) && (Et.clearTimeout(i(this, X)), o(this, X, void 0));
477
+ }
478
+ }, X = new WeakMap(), Gt), Y, at, M, tt, P, pt, et, I, N, _t, Ce = (_t = class extends te {
479
+ constructor(t) {
480
+ super();
481
+ c(this, I);
482
+ c(this, Y, void 0);
483
+ c(this, at, void 0);
484
+ c(this, M, void 0);
485
+ c(this, tt, void 0);
486
+ c(this, P, void 0);
487
+ c(this, pt, void 0);
488
+ c(this, et, void 0);
489
+ o(this, et, !1), o(this, pt, t.defaultOptions), this.setOptions(t.options), this.observers = [], o(this, tt, t.client), o(this, M, i(this, tt).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, o(this, Y, kt(this.options)), this.state = t.state ?? i(this, Y), this.scheduleGc();
490
+ }
491
+ get meta() {
492
+ return this.options.meta;
493
+ }
494
+ get promise() {
495
+ var t;
496
+ return (t = i(this, P)) == null ? void 0 : t.promise;
497
+ }
498
+ setOptions(t) {
499
+ if (this.options = { ...i(this, pt), ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
500
+ const s = kt(this.options);
501
+ s.data !== void 0 && (this.setState(
502
+ xt(s.data, s.dataUpdatedAt)
503
+ ), o(this, Y, s));
504
+ }
505
+ }
506
+ optionalRemove() {
507
+ !this.observers.length && this.state.fetchStatus === "idle" && i(this, M).remove(this);
508
+ }
509
+ setData(t, s) {
510
+ const r = ye(this.state.data, t, this.options);
511
+ return F(this, I, N).call(this, {
512
+ data: r,
513
+ type: "success",
514
+ dataUpdatedAt: s == null ? void 0 : s.updatedAt,
515
+ manual: s == null ? void 0 : s.manual
516
+ }), r;
517
+ }
518
+ setState(t, s) {
519
+ F(this, I, N).call(this, { type: "setState", state: t, setStateOptions: s });
520
+ }
521
+ cancel(t) {
522
+ var r, n;
523
+ const s = (r = i(this, P)) == null ? void 0 : r.promise;
524
+ return (n = i(this, P)) == null || n.cancel(t), s ? s.then(R).catch(R) : Promise.resolve();
525
+ }
526
+ destroy() {
527
+ super.destroy(), this.cancel({ silent: !0 });
528
+ }
529
+ reset() {
530
+ this.destroy(), this.setState(i(this, Y));
531
+ }
532
+ isActive() {
533
+ return this.observers.some(
534
+ (t) => le(t.options.enabled, this) !== !1
535
+ );
536
+ }
537
+ isDisabled() {
538
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === Pt || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
539
+ }
540
+ isStatic() {
541
+ return this.getObserversCount() > 0 ? this.observers.some(
542
+ (t) => qt(t.options.staleTime, this) === "static"
543
+ ) : !1;
544
+ }
545
+ isStale() {
546
+ return this.getObserversCount() > 0 ? this.observers.some(
547
+ (t) => t.getCurrentResult().isStale
548
+ ) : this.state.data === void 0 || this.state.isInvalidated;
549
+ }
550
+ isStaleByTime(t = 0) {
551
+ return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !ce(this.state.dataUpdatedAt, t);
552
+ }
553
+ onFocus() {
554
+ var s;
555
+ const t = this.observers.find((r) => r.shouldFetchOnWindowFocus());
556
+ t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, P)) == null || s.continue();
557
+ }
558
+ onOnline() {
559
+ var s;
560
+ const t = this.observers.find((r) => r.shouldFetchOnReconnect());
561
+ t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, P)) == null || s.continue();
562
+ }
563
+ addObserver(t) {
564
+ this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), i(this, M).notify({ type: "observerAdded", query: this, observer: t }));
565
+ }
566
+ removeObserver(t) {
567
+ this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (i(this, P) && (i(this, et) ? i(this, P).cancel({ revert: !0 }) : i(this, P).cancelRetry()), this.scheduleGc()), i(this, M).notify({ type: "observerRemoved", query: this, observer: t }));
568
+ }
569
+ getObserversCount() {
570
+ return this.observers.length;
571
+ }
572
+ invalidate() {
573
+ this.state.isInvalidated || F(this, I, N).call(this, { type: "invalidate" });
574
+ }
575
+ async fetch(t, s) {
576
+ var f, O, v, C, g, D, Q, d, b, m, A, p;
577
+ if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
578
+ // re-start the fetch; there is a chance that the query is still in a
579
+ // pending state when that happens
580
+ ((f = i(this, P)) == null ? void 0 : f.status()) !== "rejected") {
581
+ if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
582
+ this.cancel({ silent: !0 });
583
+ else if (i(this, P))
584
+ return i(this, P).continueRetry(), i(this, P).promise;
585
+ }
586
+ if (t && this.setOptions(t), !this.options.queryFn) {
587
+ const h = this.observers.find((S) => S.options.queryFn);
588
+ h && this.setOptions(h.options);
589
+ }
590
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
591
+ "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
592
+ ));
593
+ const r = new AbortController(), n = (h) => {
594
+ Object.defineProperty(h, "signal", {
595
+ enumerable: !0,
596
+ get: () => (o(this, et, !0), r.signal)
597
+ });
598
+ }, a = () => {
599
+ const h = Wt(this.options, s), T = (() => {
600
+ const B = {
601
+ client: i(this, tt),
602
+ queryKey: this.queryKey,
603
+ meta: this.meta
604
+ };
605
+ return n(B), B;
606
+ })();
607
+ return o(this, et, !1), this.options.persister ? this.options.persister(
608
+ h,
609
+ T,
610
+ this
611
+ ) : h(T);
612
+ }, u = (() => {
613
+ const h = {
614
+ fetchOptions: s,
615
+ options: this.options,
616
+ queryKey: this.queryKey,
617
+ client: i(this, tt),
618
+ state: this.state,
619
+ fetchFn: a
620
+ };
621
+ return n(h), h;
622
+ })();
623
+ (O = this.options.behavior) == null || O.onFetch(u, this), o(this, at, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((v = u.fetchOptions) == null ? void 0 : v.meta)) && F(this, I, N).call(this, { type: "fetch", meta: (C = u.fetchOptions) == null ? void 0 : C.meta }), o(this, P, Yt({
624
+ initialPromise: s == null ? void 0 : s.initialPromise,
625
+ fn: u.fetchFn,
626
+ onCancel: (h) => {
627
+ h instanceof Qt && h.revert && this.setState({
628
+ ...i(this, at),
629
+ fetchStatus: "idle"
630
+ }), r.abort();
631
+ },
632
+ onFail: (h, S) => {
633
+ F(this, I, N).call(this, { type: "failed", failureCount: h, error: S });
634
+ },
635
+ onPause: () => {
636
+ F(this, I, N).call(this, { type: "pause" });
637
+ },
638
+ onContinue: () => {
639
+ F(this, I, N).call(this, { type: "continue" });
640
+ },
641
+ retry: u.options.retry,
642
+ retryDelay: u.options.retryDelay,
643
+ networkMode: u.options.networkMode,
644
+ canRun: () => !0
645
+ }));
646
+ try {
647
+ const h = await i(this, P).start();
648
+ if (h === void 0)
649
+ throw process.env.NODE_ENV !== "production" && console.error(
650
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
651
+ ), new Error(`${this.queryHash} data is undefined`);
652
+ return this.setData(h), (D = (g = i(this, M).config).onSuccess) == null || D.call(g, h, this), (d = (Q = i(this, M).config).onSettled) == null || d.call(
653
+ Q,
654
+ h,
655
+ this.state.error,
656
+ this
657
+ ), h;
658
+ } catch (h) {
659
+ if (h instanceof Qt) {
660
+ if (h.silent)
661
+ return i(this, P).promise;
662
+ if (h.revert) {
663
+ if (this.state.data === void 0)
664
+ throw h;
665
+ return this.state.data;
666
+ }
667
+ }
668
+ throw F(this, I, N).call(this, {
669
+ type: "error",
670
+ error: h
671
+ }), (m = (b = i(this, M).config).onError) == null || m.call(
672
+ b,
673
+ h,
674
+ this
675
+ ), (p = (A = i(this, M).config).onSettled) == null || p.call(
676
+ A,
677
+ this.state.data,
678
+ h,
679
+ this
680
+ ), h;
681
+ } finally {
682
+ this.scheduleGc();
683
+ }
684
+ }
685
+ }, Y = new WeakMap(), at = new WeakMap(), M = new WeakMap(), tt = new WeakMap(), P = new WeakMap(), pt = new WeakMap(), et = new WeakMap(), I = new WeakSet(), N = function(t) {
686
+ const s = (r) => {
687
+ switch (t.type) {
688
+ case "failed":
689
+ return {
690
+ ...r,
691
+ fetchFailureCount: t.failureCount,
692
+ fetchFailureReason: t.error
693
+ };
694
+ case "pause":
695
+ return {
696
+ ...r,
697
+ fetchStatus: "paused"
698
+ };
699
+ case "continue":
700
+ return {
701
+ ...r,
702
+ fetchStatus: "fetching"
703
+ };
704
+ case "fetch":
705
+ return {
706
+ ...r,
707
+ ...Fe(r.data, this.options),
708
+ fetchMeta: t.meta ?? null
709
+ };
710
+ case "success":
711
+ const n = {
712
+ ...r,
713
+ ...xt(t.data, t.dataUpdatedAt),
714
+ dataUpdateCount: r.dataUpdateCount + 1,
715
+ ...!t.manual && {
716
+ fetchStatus: "idle",
717
+ fetchFailureCount: 0,
718
+ fetchFailureReason: null
719
+ }
720
+ };
721
+ return o(this, at, t.manual ? n : void 0), n;
722
+ case "error":
723
+ const a = t.error;
724
+ return {
725
+ ...r,
726
+ error: a,
727
+ errorUpdateCount: r.errorUpdateCount + 1,
728
+ errorUpdatedAt: Date.now(),
729
+ fetchFailureCount: r.fetchFailureCount + 1,
730
+ fetchFailureReason: a,
731
+ fetchStatus: "idle",
732
+ status: "error"
733
+ };
734
+ case "invalidate":
735
+ return {
736
+ ...r,
737
+ isInvalidated: !0
738
+ };
739
+ case "setState":
740
+ return {
741
+ ...r,
742
+ ...t.state
743
+ };
744
+ }
745
+ };
746
+ this.state = s(this.state), q.batch(() => {
747
+ this.observers.forEach((r) => {
748
+ r.onQueryUpdate();
749
+ }), i(this, M).notify({ query: this, type: "updated", action: t });
750
+ });
751
+ }, _t);
752
+ function Fe(e, t) {
753
+ return {
754
+ fetchFailureCount: 0,
755
+ fetchFailureReason: null,
756
+ fetchStatus: Xt(t.networkMode) ? "fetching" : "paused",
757
+ ...e === void 0 && {
758
+ error: null,
759
+ status: "pending"
760
+ }
761
+ };
762
+ }
763
+ function xt(e, t) {
764
+ return {
765
+ data: e,
766
+ dataUpdatedAt: t ?? Date.now(),
767
+ error: null,
768
+ isInvalidated: !1,
769
+ status: "success"
770
+ };
771
+ }
772
+ function kt(e) {
773
+ const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
774
+ return {
775
+ data: t,
776
+ dataUpdateCount: 0,
777
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
778
+ error: null,
779
+ errorUpdateCount: 0,
780
+ errorUpdatedAt: 0,
781
+ fetchFailureCount: 0,
782
+ fetchFailureReason: null,
783
+ fetchMeta: null,
784
+ isInvalidated: !1,
785
+ status: s ? "success" : "pending",
786
+ fetchStatus: "idle"
787
+ };
788
+ }
789
+ function Kt(e) {
790
+ return {
791
+ onFetch: (t, s) => {
792
+ var v, C, g, D, Q;
793
+ const r = t.options, n = (g = (C = (v = t.fetchOptions) == null ? void 0 : v.meta) == null ? void 0 : C.fetchMore) == null ? void 0 : g.direction, a = ((D = t.state.data) == null ? void 0 : D.pages) || [], l = ((Q = t.state.data) == null ? void 0 : Q.pageParams) || [];
794
+ let u = { pages: [], pageParams: [] }, f = 0;
795
+ const O = async () => {
796
+ let d = !1;
797
+ const b = (p) => {
798
+ Object.defineProperty(p, "signal", {
799
+ enumerable: !0,
800
+ get: () => (t.signal.aborted ? d = !0 : t.signal.addEventListener("abort", () => {
801
+ d = !0;
802
+ }), t.signal)
803
+ });
804
+ }, m = Wt(t.options, t.fetchOptions), A = async (p, h, S) => {
805
+ if (d)
806
+ return Promise.reject();
807
+ if (h == null && p.pages.length)
808
+ return Promise.resolve(p);
809
+ const B = (() => {
810
+ const J = {
811
+ client: t.client,
812
+ queryKey: t.queryKey,
813
+ pageParam: h,
814
+ direction: S ? "backward" : "forward",
815
+ meta: t.options.meta
816
+ };
817
+ return b(J), J;
818
+ })(), gt = await m(B), { maxPages: lt } = t.options, w = S ? me : pe;
819
+ return {
820
+ pages: w(p.pages, gt, lt),
821
+ pageParams: w(p.pageParams, h, lt)
822
+ };
823
+ };
824
+ if (n && a.length) {
825
+ const p = n === "backward", h = p ? Se : Ut, S = {
826
+ pages: a,
827
+ pageParams: l
828
+ }, T = h(r, S);
829
+ u = await A(S, T, p);
830
+ } else {
831
+ const p = e ?? a.length;
832
+ do {
833
+ const h = f === 0 ? l[0] ?? r.initialPageParam : Ut(r, u);
834
+ if (f > 0 && h == null)
835
+ break;
836
+ u = await A(u, h), f++;
837
+ } while (f < p);
838
+ }
839
+ return u;
840
+ };
841
+ t.options.persister ? t.fetchFn = () => {
842
+ var d, b;
843
+ return (b = (d = t.options).persister) == null ? void 0 : b.call(
844
+ d,
845
+ O,
846
+ {
847
+ client: t.client,
848
+ queryKey: t.queryKey,
849
+ meta: t.options.meta,
850
+ signal: t.signal
851
+ },
852
+ s
853
+ );
854
+ } : t.fetchFn = O;
855
+ }
856
+ };
857
+ }
858
+ function Ut(e, { pages: t, pageParams: s }) {
859
+ const r = t.length - 1;
860
+ return t.length > 0 ? e.getNextPageParam(
861
+ t[r],
862
+ t,
863
+ s[r],
864
+ s
865
+ ) : void 0;
866
+ }
867
+ function Se(e, { pages: t, pageParams: s }) {
868
+ var r;
869
+ return t.length > 0 ? (r = e.getPreviousPageParam) == null ? void 0 : r.call(e, t[0], t, s[0], s) : void 0;
870
+ }
871
+ var mt, k, E, st, K, L, Vt, Ee = (Vt = class extends te {
872
+ constructor(t) {
873
+ super();
874
+ c(this, K);
875
+ c(this, mt, void 0);
876
+ c(this, k, void 0);
877
+ c(this, E, void 0);
878
+ c(this, st, void 0);
879
+ o(this, mt, t.client), this.mutationId = t.mutationId, o(this, E, t.mutationCache), o(this, k, []), this.state = t.state || qe(), this.setOptions(t.options), this.scheduleGc();
880
+ }
881
+ setOptions(t) {
882
+ this.options = t, this.updateGcTime(this.options.gcTime);
883
+ }
884
+ get meta() {
885
+ return this.options.meta;
886
+ }
887
+ addObserver(t) {
888
+ i(this, k).includes(t) || (i(this, k).push(t), this.clearGcTimeout(), i(this, E).notify({
889
+ type: "observerAdded",
890
+ mutation: this,
891
+ observer: t
892
+ }));
893
+ }
894
+ removeObserver(t) {
895
+ o(this, k, i(this, k).filter((s) => s !== t)), this.scheduleGc(), i(this, E).notify({
896
+ type: "observerRemoved",
897
+ mutation: this,
898
+ observer: t
899
+ });
900
+ }
901
+ optionalRemove() {
902
+ i(this, k).length || (this.state.status === "pending" ? this.scheduleGc() : i(this, E).remove(this));
903
+ }
904
+ continue() {
905
+ var t;
906
+ return ((t = i(this, st)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
907
+ this.execute(this.state.variables);
908
+ }
909
+ async execute(t) {
910
+ var l, u, f, O, v, C, g, D, Q, d, b, m, A, p, h, S, T, B, gt, lt;
911
+ const s = () => {
912
+ F(this, K, L).call(this, { type: "continue" });
913
+ }, r = {
914
+ client: i(this, mt),
915
+ meta: this.options.meta,
916
+ mutationKey: this.options.mutationKey
917
+ };
918
+ o(this, st, Yt({
919
+ fn: () => this.options.mutationFn ? this.options.mutationFn(t, r) : Promise.reject(new Error("No mutationFn found")),
920
+ onFail: (w, J) => {
921
+ F(this, K, L).call(this, { type: "failed", failureCount: w, error: J });
922
+ },
923
+ onPause: () => {
924
+ F(this, K, L).call(this, { type: "pause" });
925
+ },
926
+ onContinue: s,
927
+ retry: this.options.retry ?? 0,
928
+ retryDelay: this.options.retryDelay,
929
+ networkMode: this.options.networkMode,
930
+ canRun: () => i(this, E).canRun(this)
931
+ }));
932
+ const n = this.state.status === "pending", a = !i(this, st).canStart();
933
+ try {
934
+ if (n)
935
+ s();
936
+ else {
937
+ F(this, K, L).call(this, { type: "pending", variables: t, isPaused: a }), await ((u = (l = i(this, E).config).onMutate) == null ? void 0 : u.call(
938
+ l,
939
+ t,
940
+ this,
941
+ r
942
+ ));
943
+ const J = await ((O = (f = this.options).onMutate) == null ? void 0 : O.call(
944
+ f,
945
+ t,
946
+ r
947
+ ));
948
+ J !== this.state.context && F(this, K, L).call(this, {
949
+ type: "pending",
950
+ context: J,
951
+ variables: t,
952
+ isPaused: a
953
+ });
954
+ }
955
+ const w = await i(this, st).start();
956
+ return await ((C = (v = i(this, E).config).onSuccess) == null ? void 0 : C.call(
957
+ v,
958
+ w,
959
+ t,
960
+ this.state.context,
961
+ this,
962
+ r
963
+ )), await ((D = (g = this.options).onSuccess) == null ? void 0 : D.call(
964
+ g,
965
+ w,
966
+ t,
967
+ this.state.context,
968
+ r
969
+ )), await ((d = (Q = i(this, E).config).onSettled) == null ? void 0 : d.call(
970
+ Q,
971
+ w,
972
+ null,
973
+ this.state.variables,
974
+ this.state.context,
975
+ this,
976
+ r
977
+ )), await ((m = (b = this.options).onSettled) == null ? void 0 : m.call(
978
+ b,
979
+ w,
980
+ null,
981
+ t,
982
+ this.state.context,
983
+ r
984
+ )), F(this, K, L).call(this, { type: "success", data: w }), w;
985
+ } catch (w) {
986
+ try {
987
+ throw await ((p = (A = i(this, E).config).onError) == null ? void 0 : p.call(
988
+ A,
989
+ w,
990
+ t,
991
+ this.state.context,
992
+ this,
993
+ r
994
+ )), await ((S = (h = this.options).onError) == null ? void 0 : S.call(
995
+ h,
996
+ w,
997
+ t,
998
+ this.state.context,
999
+ r
1000
+ )), await ((B = (T = i(this, E).config).onSettled) == null ? void 0 : B.call(
1001
+ T,
1002
+ void 0,
1003
+ w,
1004
+ this.state.variables,
1005
+ this.state.context,
1006
+ this,
1007
+ r
1008
+ )), await ((lt = (gt = this.options).onSettled) == null ? void 0 : lt.call(
1009
+ gt,
1010
+ void 0,
1011
+ w,
1012
+ t,
1013
+ this.state.context,
1014
+ r
1015
+ )), w;
1016
+ } finally {
1017
+ F(this, K, L).call(this, { type: "error", error: w });
1018
+ }
1019
+ } finally {
1020
+ i(this, E).runNext(this);
1021
+ }
1022
+ }
1023
+ }, mt = new WeakMap(), k = new WeakMap(), E = new WeakMap(), st = new WeakMap(), K = new WeakSet(), L = function(t) {
1024
+ const s = (r) => {
1025
+ switch (t.type) {
1026
+ case "failed":
1027
+ return {
1028
+ ...r,
1029
+ failureCount: t.failureCount,
1030
+ failureReason: t.error
1031
+ };
1032
+ case "pause":
1033
+ return {
1034
+ ...r,
1035
+ isPaused: !0
1036
+ };
1037
+ case "continue":
1038
+ return {
1039
+ ...r,
1040
+ isPaused: !1
1041
+ };
1042
+ case "pending":
1043
+ return {
1044
+ ...r,
1045
+ context: t.context,
1046
+ data: void 0,
1047
+ failureCount: 0,
1048
+ failureReason: null,
1049
+ error: null,
1050
+ isPaused: t.isPaused,
1051
+ status: "pending",
1052
+ variables: t.variables,
1053
+ submittedAt: Date.now()
1054
+ };
1055
+ case "success":
1056
+ return {
1057
+ ...r,
1058
+ data: t.data,
1059
+ failureCount: 0,
1060
+ failureReason: null,
1061
+ error: null,
1062
+ status: "success",
1063
+ isPaused: !1
1064
+ };
1065
+ case "error":
1066
+ return {
1067
+ ...r,
1068
+ data: void 0,
1069
+ error: t.error,
1070
+ failureCount: r.failureCount + 1,
1071
+ failureReason: t.error,
1072
+ isPaused: !1,
1073
+ status: "error"
1074
+ };
1075
+ }
1076
+ };
1077
+ this.state = s(this.state), q.batch(() => {
1078
+ i(this, k).forEach((r) => {
1079
+ r.onMutationUpdate(t);
1080
+ }), i(this, E).notify({
1081
+ mutation: this,
1082
+ type: "updated",
1083
+ action: t
1084
+ });
1085
+ });
1086
+ }, Vt);
1087
+ function qe() {
1088
+ return {
1089
+ context: void 0,
1090
+ data: void 0,
1091
+ error: null,
1092
+ failureCount: 0,
1093
+ failureReason: null,
1094
+ isPaused: !1,
1095
+ status: "idle",
1096
+ variables: void 0,
1097
+ submittedAt: 0
1098
+ };
1099
+ }
1100
+ var H, j, vt, $t, De = ($t = class extends Ct {
1101
+ constructor(t = {}) {
1102
+ super();
1103
+ c(this, H, void 0);
1104
+ c(this, j, void 0);
1105
+ c(this, vt, void 0);
1106
+ this.config = t, o(this, H, /* @__PURE__ */ new Set()), o(this, j, /* @__PURE__ */ new Map()), o(this, vt, 0);
1107
+ }
1108
+ build(t, s, r) {
1109
+ const n = new Ee({
1110
+ client: t,
1111
+ mutationCache: this,
1112
+ mutationId: ++bt(this, vt)._,
1113
+ options: t.defaultMutationOptions(s),
1114
+ state: r
1115
+ });
1116
+ return this.add(n), n;
1117
+ }
1118
+ add(t) {
1119
+ i(this, H).add(t);
1120
+ const s = wt(t);
1121
+ if (typeof s == "string") {
1122
+ const r = i(this, j).get(s);
1123
+ r ? r.push(t) : i(this, j).set(s, [t]);
1124
+ }
1125
+ this.notify({ type: "added", mutation: t });
1126
+ }
1127
+ remove(t) {
1128
+ if (i(this, H).delete(t)) {
1129
+ const s = wt(t);
1130
+ if (typeof s == "string") {
1131
+ const r = i(this, j).get(s);
1132
+ if (r)
1133
+ if (r.length > 1) {
1134
+ const n = r.indexOf(t);
1135
+ n !== -1 && r.splice(n, 1);
1136
+ } else
1137
+ r[0] === t && i(this, j).delete(s);
1138
+ }
1139
+ }
1140
+ this.notify({ type: "removed", mutation: t });
1141
+ }
1142
+ canRun(t) {
1143
+ const s = wt(t);
1144
+ if (typeof s == "string") {
1145
+ const r = i(this, j).get(s), n = r == null ? void 0 : r.find(
1146
+ (a) => a.state.status === "pending"
1147
+ );
1148
+ return !n || n === t;
1149
+ } else
1150
+ return !0;
1151
+ }
1152
+ runNext(t) {
1153
+ var r;
1154
+ const s = wt(t);
1155
+ if (typeof s == "string") {
1156
+ const n = (r = i(this, j).get(s)) == null ? void 0 : r.find((a) => a !== t && a.state.isPaused);
1157
+ return (n == null ? void 0 : n.continue()) ?? Promise.resolve();
1158
+ } else
1159
+ return Promise.resolve();
1160
+ }
1161
+ clear() {
1162
+ q.batch(() => {
1163
+ i(this, H).forEach((t) => {
1164
+ this.notify({ type: "removed", mutation: t });
1165
+ }), i(this, H).clear(), i(this, j).clear();
1166
+ });
1167
+ }
1168
+ getAll() {
1169
+ return Array.from(i(this, H));
1170
+ }
1171
+ find(t) {
1172
+ const s = { exact: !0, ...t };
1173
+ return this.getAll().find(
1174
+ (r) => Rt(s, r)
1175
+ );
1176
+ }
1177
+ findAll(t = {}) {
1178
+ return this.getAll().filter((s) => Rt(t, s));
1179
+ }
1180
+ notify(t) {
1181
+ q.batch(() => {
1182
+ this.listeners.forEach((s) => {
1183
+ s(t);
1184
+ });
1185
+ });
1186
+ }
1187
+ resumePausedMutations() {
1188
+ const t = this.getAll().filter((s) => s.state.isPaused);
1189
+ return q.batch(
1190
+ () => Promise.all(
1191
+ t.map((s) => s.continue().catch(R))
1192
+ )
1193
+ );
1194
+ }
1195
+ }, H = new WeakMap(), j = new WeakMap(), vt = new WeakMap(), $t);
1196
+ function wt(e) {
1197
+ var t;
1198
+ return (t = e.options.scope) == null ? void 0 : t.id;
1199
+ }
1200
+ var U, zt, Ae = (zt = class extends Ct {
1201
+ constructor(t = {}) {
1202
+ super();
1203
+ c(this, U, void 0);
1204
+ this.config = t, o(this, U, /* @__PURE__ */ new Map());
1205
+ }
1206
+ build(t, s, r) {
1207
+ const n = s.queryKey, a = s.queryHash ?? Mt(n, s);
1208
+ let l = this.get(a);
1209
+ return l || (l = new Ce({
1210
+ client: t,
1211
+ queryKey: n,
1212
+ queryHash: a,
1213
+ options: t.defaultQueryOptions(s),
1214
+ state: r,
1215
+ defaultOptions: t.getQueryDefaults(n)
1216
+ }), this.add(l)), l;
1217
+ }
1218
+ add(t) {
1219
+ i(this, U).has(t.queryHash) || (i(this, U).set(t.queryHash, t), this.notify({
1220
+ type: "added",
1221
+ query: t
1222
+ }));
1223
+ }
1224
+ remove(t) {
1225
+ const s = i(this, U).get(t.queryHash);
1226
+ s && (t.destroy(), s === t && i(this, U).delete(t.queryHash), this.notify({ type: "removed", query: t }));
1227
+ }
1228
+ clear() {
1229
+ q.batch(() => {
1230
+ this.getAll().forEach((t) => {
1231
+ this.remove(t);
1232
+ });
1233
+ });
1234
+ }
1235
+ get(t) {
1236
+ return i(this, U).get(t);
1237
+ }
1238
+ getAll() {
1239
+ return [...i(this, U).values()];
1240
+ }
1241
+ find(t) {
1242
+ const s = { exact: !0, ...t };
1243
+ return this.getAll().find(
1244
+ (r) => Tt(s, r)
1245
+ );
1246
+ }
1247
+ findAll(t = {}) {
1248
+ const s = this.getAll();
1249
+ return Object.keys(t).length > 0 ? s.filter((r) => Tt(t, r)) : s;
1250
+ }
1251
+ notify(t) {
1252
+ q.batch(() => {
1253
+ this.listeners.forEach((s) => {
1254
+ s(t);
1255
+ });
1256
+ });
1257
+ }
1258
+ onFocus() {
1259
+ q.batch(() => {
1260
+ this.getAll().forEach((t) => {
1261
+ t.onFocus();
1262
+ });
1263
+ });
1264
+ }
1265
+ onOnline() {
1266
+ q.batch(() => {
1267
+ this.getAll().forEach((t) => {
1268
+ t.onOnline();
1269
+ });
1270
+ });
1271
+ }
1272
+ }, U = new WeakMap(), zt), y, V, $, ot, ut, z, ht, ct, Bt, Qe = (Bt = class {
1273
+ constructor(e = {}) {
1274
+ c(this, y, void 0);
1275
+ c(this, V, void 0);
1276
+ c(this, $, void 0);
1277
+ c(this, ot, void 0);
1278
+ c(this, ut, void 0);
1279
+ c(this, z, void 0);
1280
+ c(this, ht, void 0);
1281
+ c(this, ct, void 0);
1282
+ o(this, y, e.queryCache || new Ae()), o(this, V, e.mutationCache || new De()), o(this, $, e.defaultOptions || {}), o(this, ot, /* @__PURE__ */ new Map()), o(this, ut, /* @__PURE__ */ new Map()), o(this, z, 0);
1283
+ }
1284
+ mount() {
1285
+ bt(this, z)._++, i(this, z) === 1 && (o(this, ht, Zt.subscribe(async (e) => {
1286
+ e && (await this.resumePausedMutations(), i(this, y).onFocus());
1287
+ })), o(this, ct, Ot.subscribe(async (e) => {
1288
+ e && (await this.resumePausedMutations(), i(this, y).onOnline());
1289
+ })));
1290
+ }
1291
+ unmount() {
1292
+ var e, t;
1293
+ bt(this, z)._--, i(this, z) === 0 && ((e = i(this, ht)) == null || e.call(this), o(this, ht, void 0), (t = i(this, ct)) == null || t.call(this), o(this, ct, void 0));
1294
+ }
1295
+ isFetching(e) {
1296
+ return i(this, y).findAll({ ...e, fetchStatus: "fetching" }).length;
1297
+ }
1298
+ isMutating(e) {
1299
+ return i(this, V).findAll({ ...e, status: "pending" }).length;
1300
+ }
1301
+ /**
1302
+ * Imperative (non-reactive) way to retrieve data for a QueryKey.
1303
+ * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
1304
+ *
1305
+ * Hint: Do not use this function inside a component, because it won't receive updates.
1306
+ * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
1307
+ */
1308
+ getQueryData(e) {
1309
+ var s;
1310
+ const t = this.defaultQueryOptions({ queryKey: e });
1311
+ return (s = i(this, y).get(t.queryHash)) == null ? void 0 : s.state.data;
1312
+ }
1313
+ ensureQueryData(e) {
1314
+ const t = this.defaultQueryOptions(e), s = i(this, y).build(this, t), r = s.state.data;
1315
+ return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(qt(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(r));
1316
+ }
1317
+ getQueriesData(e) {
1318
+ return i(this, y).findAll(e).map(({ queryKey: t, state: s }) => {
1319
+ const r = s.data;
1320
+ return [t, r];
1321
+ });
1322
+ }
1323
+ setQueryData(e, t, s) {
1324
+ const r = this.defaultQueryOptions({ queryKey: e }), n = i(this, y).get(
1325
+ r.queryHash
1326
+ ), a = n == null ? void 0 : n.state.data, l = ue(t, a);
1327
+ if (l !== void 0)
1328
+ return i(this, y).build(this, r).setData(l, { ...s, manual: !0 });
1329
+ }
1330
+ setQueriesData(e, t, s) {
1331
+ return q.batch(
1332
+ () => i(this, y).findAll(e).map(({ queryKey: r }) => [
1333
+ r,
1334
+ this.setQueryData(r, t, s)
1335
+ ])
1336
+ );
1337
+ }
1338
+ getQueryState(e) {
1339
+ var s;
1340
+ const t = this.defaultQueryOptions({ queryKey: e });
1341
+ return (s = i(this, y).get(
1342
+ t.queryHash
1343
+ )) == null ? void 0 : s.state;
1344
+ }
1345
+ removeQueries(e) {
1346
+ const t = i(this, y);
1347
+ q.batch(() => {
1348
+ t.findAll(e).forEach((s) => {
1349
+ t.remove(s);
1350
+ });
1351
+ });
1352
+ }
1353
+ resetQueries(e, t) {
1354
+ const s = i(this, y);
1355
+ return q.batch(() => (s.findAll(e).forEach((r) => {
1356
+ r.reset();
1357
+ }), this.refetchQueries(
1358
+ {
1359
+ type: "active",
1360
+ ...e
1361
+ },
1362
+ t
1363
+ )));
1364
+ }
1365
+ cancelQueries(e, t = {}) {
1366
+ const s = { revert: !0, ...t }, r = q.batch(
1367
+ () => i(this, y).findAll(e).map((n) => n.cancel(s))
1368
+ );
1369
+ return Promise.all(r).then(R).catch(R);
1370
+ }
1371
+ invalidateQueries(e, t = {}) {
1372
+ return q.batch(() => (i(this, y).findAll(e).forEach((s) => {
1373
+ s.invalidate();
1374
+ }), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
1375
+ {
1376
+ ...e,
1377
+ type: (e == null ? void 0 : e.refetchType) ?? (e == null ? void 0 : e.type) ?? "active"
1378
+ },
1379
+ t
1380
+ )));
1381
+ }
1382
+ refetchQueries(e, t = {}) {
1383
+ const s = {
1384
+ ...t,
1385
+ cancelRefetch: t.cancelRefetch ?? !0
1386
+ }, r = q.batch(
1387
+ () => i(this, y).findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
1388
+ let a = n.fetch(void 0, s);
1389
+ return s.throwOnError || (a = a.catch(R)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
1390
+ })
1391
+ );
1392
+ return Promise.all(r).then(R);
1393
+ }
1394
+ fetchQuery(e) {
1395
+ const t = this.defaultQueryOptions(e);
1396
+ t.retry === void 0 && (t.retry = !1);
1397
+ const s = i(this, y).build(this, t);
1398
+ return s.isStaleByTime(
1399
+ qt(t.staleTime, s)
1400
+ ) ? s.fetch(t) : Promise.resolve(s.state.data);
1401
+ }
1402
+ prefetchQuery(e) {
1403
+ return this.fetchQuery(e).then(R).catch(R);
1404
+ }
1405
+ fetchInfiniteQuery(e) {
1406
+ return e.behavior = Kt(e.pages), this.fetchQuery(e);
1407
+ }
1408
+ prefetchInfiniteQuery(e) {
1409
+ return this.fetchInfiniteQuery(e).then(R).catch(R);
1410
+ }
1411
+ ensureInfiniteQueryData(e) {
1412
+ return e.behavior = Kt(e.pages), this.ensureQueryData(e);
1413
+ }
1414
+ resumePausedMutations() {
1415
+ return Ot.isOnline() ? i(this, V).resumePausedMutations() : Promise.resolve();
1416
+ }
1417
+ getQueryCache() {
1418
+ return i(this, y);
1419
+ }
1420
+ getMutationCache() {
1421
+ return i(this, V);
1422
+ }
1423
+ getDefaultOptions() {
1424
+ return i(this, $);
1425
+ }
1426
+ setDefaultOptions(e) {
1427
+ o(this, $, e);
1428
+ }
1429
+ setQueryDefaults(e, t) {
1430
+ i(this, ot).set(ft(e), {
1431
+ queryKey: e,
1432
+ defaultOptions: t
1433
+ });
1434
+ }
1435
+ getQueryDefaults(e) {
1436
+ const t = [...i(this, ot).values()], s = {};
1437
+ return t.forEach((r) => {
1438
+ yt(e, r.queryKey) && Object.assign(s, r.defaultOptions);
1439
+ }), s;
1440
+ }
1441
+ setMutationDefaults(e, t) {
1442
+ i(this, ut).set(ft(e), {
1443
+ mutationKey: e,
1444
+ defaultOptions: t
1445
+ });
1446
+ }
1447
+ getMutationDefaults(e) {
1448
+ const t = [...i(this, ut).values()], s = {};
1449
+ return t.forEach((r) => {
1450
+ yt(e, r.mutationKey) && Object.assign(s, r.defaultOptions);
1451
+ }), s;
1452
+ }
1453
+ defaultQueryOptions(e) {
1454
+ if (e._defaulted)
1455
+ return e;
1456
+ const t = {
1457
+ ...i(this, $).queries,
1458
+ ...this.getQueryDefaults(e.queryKey),
1459
+ ...e,
1460
+ _defaulted: !0
1461
+ };
1462
+ return t.queryHash || (t.queryHash = Mt(
1463
+ t.queryKey,
1464
+ t
1465
+ )), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === Pt && (t.enabled = !1), t;
1466
+ }
1467
+ defaultMutationOptions(e) {
1468
+ return e != null && e._defaulted ? e : {
1469
+ ...i(this, $).mutations,
1470
+ ...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
1471
+ ...e,
1472
+ _defaulted: !0
1473
+ };
1474
+ }
1475
+ clear() {
1476
+ i(this, y).clear(), i(this, V).clear();
1477
+ }
1478
+ }, y = new WeakMap(), V = new WeakMap(), $ = new WeakMap(), ot = new WeakMap(), ut = new WeakMap(), z = new WeakMap(), ht = new WeakMap(), ct = new WeakMap(), Bt), Me = Jt.createContext(
1479
+ void 0
1480
+ ), Te = ({
1481
+ client: e,
1482
+ children: t
1483
+ }) => (Jt.useEffect(() => (e.mount(), () => {
1484
+ e.unmount();
1485
+ }), [e]), /* @__PURE__ */ dt(Me.Provider, { value: e, children: t }));
1486
+ const Re = new Qe(), Ne = (e) => {
1487
+ const { children: t, customVariables: s, customDarkVariables: r, workerUrl: n, licenseKey: a, ...l } = e, { workerUrlAdded: u } = re(n);
1488
+ return /* @__PURE__ */ dt(Te, { client: Re, children: /* @__PURE__ */ dt(ie, { licenseKey: a, children: /* @__PURE__ */ dt(se, { workerUrlAdded: u, ...l, children: /* @__PURE__ */ dt(ee, { customDarkVariables: r, customVariables: s, children: t }) }) }) });
1489
+ };
1490
+ export {
1491
+ Ne as RPConfig
1492
+ };