@pdf-viewer/react 1.1.0-beta.3 → 1.1.0-beta.4

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 (55) hide show
  1. package/dist/{RPDefaultLayout-528c99bf.js → RPDefaultLayout-e37d2a6d.js} +74 -74
  2. package/dist/components/RPConfig.js +340 -318
  3. package/dist/components/RPController.js +1 -1
  4. package/dist/components/RPPages.js +1 -1
  5. package/dist/components/RPProvider.js +1 -1
  6. package/dist/components/layout/RPDefaultLayout.js +1 -1
  7. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  8. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  10. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  11. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  12. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  13. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  14. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  15. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  16. package/dist/components/layout/toolbar/Paginate.js +1 -1
  17. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  18. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  19. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  20. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  21. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  22. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  23. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  24. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  25. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  26. package/dist/components/page/AnnotationLayer.js +1 -1
  27. package/dist/components/page/CanvasLayer.js +1 -1
  28. package/dist/components/page/DualPage.js +1 -1
  29. package/dist/components/page/RPPage.js +1 -1
  30. package/dist/components/page/SinglePage.js +1 -1
  31. package/dist/components/page/TextLayer.js +1 -1
  32. package/dist/components/ui/Checkbox.js +92 -252
  33. package/dist/components/ui/DropDown.js +1 -1
  34. package/dist/components/ui/LoadingIndicator.js +1 -1
  35. package/dist/components/ui/RPTooltip.js +224 -961
  36. package/dist/contexts/PaginationContext.js +1 -1
  37. package/dist/contexts/PrintContext.js +1 -1
  38. package/dist/contexts/SearchContext.js +1 -1
  39. package/dist/contexts/ThumbnailsContext.js +1 -1
  40. package/dist/index-1db49c1a.js +1664 -0
  41. package/dist/index-3dff3fa8.js +307 -0
  42. package/dist/index-4f17fe4d.js +1657 -0
  43. package/dist/main.js +1 -1
  44. package/dist/utils/hooks/useFileDownload.js +1 -1
  45. package/dist/utils/hooks/useLicense.js +32 -40
  46. package/dist/utils/hooks/usePaginate.js +1 -1
  47. package/dist/utils/hooks/usePrint.js +1 -1
  48. package/dist/utils/hooks/useScrollToPage.js +1 -1
  49. package/dist/utils/hooks/useSearch.js +1 -1
  50. package/dist/utils/hooks/useThumbnail.js +1 -1
  51. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  52. package/package.json +1 -1
  53. package/dist/floating-ui.react-dom-e6d5fe8f.js +0 -1327
  54. package/dist/index-316854c1.js +0 -2299
  55. package/dist/index-71898eb9.js +0 -139
@@ -1,6 +1,6 @@
1
1
  import { jsx as a, jsxs as D, Fragment as ke } from "react/jsx-runtime";
2
2
  import * as q from "react";
3
- import { useRef as W, useEffect as z, useCallback as R, useState as $, createContext as Ge, useContext as Ve, useMemo as A, forwardRef as Ue, useImperativeHandle as qt, createElement as De, PureComponent as Gn, Component as Vn, memo as Un } from "react";
3
+ import { useRef as W, useEffect as A, useCallback as R, useState as $, createContext as Ge, useContext as Ve, useMemo as z, forwardRef as Ue, useImperativeHandle as qt, createElement as De, PureComponent as Gn, Component as Vn, memo as Un } from "react";
4
4
  import { ChevronUpIcon as Re } from "./components/icons/ChevronUpIcon.js";
5
5
  import { UIButton as J } from "./components/ui/Button.js";
6
6
  import { UIInput as Zt } from "./components/ui/Input.js";
@@ -55,9 +55,9 @@ import { FileUploadTool as Yt } from "./components/layout/toolbar/FileUploadTool
55
55
  import { DarkModeTool as Co } from "./components/layout/toolbar/DarkModeTool.js";
56
56
  import { ThreeDotIcon as To } from "./components/icons/ThreeDotIcon.js";
57
57
  import { UIDropDown as mt } from "./components/ui/DropDown.js";
58
- import { u as ft, a as Me, c as xe, b as gt, d as Po, e as So, h as Io, f as yo, F as xo, D as Ro, g as Lo, G as He } from "./index-316854c1.js";
59
- import { c as No, e as Mo, b as Eo } from "./index-71898eb9.js";
60
- import { e as Xe } from "./floating-ui.react-dom-e6d5fe8f.js";
58
+ import { c as Po, a as ft, P as Me, b as xe, d as gt, i as So, k as Io, u as yo } from "./index-3dff3fa8.js";
59
+ import { D as xo, u as Xe } from "./index-4f17fe4d.js";
60
+ import { a as Ro, h as Lo, u as No, F as Mo, b as Eo, G as He } from "./index-1db49c1a.js";
61
61
  import { CloseIcon as Qt } from "./components/icons/CloseIcon.js";
62
62
  import { PropertyItem as Oo } from "./components/layout/toolbar/PropertyItem.js";
63
63
  import { useOtherToolContext as Do, OtherToolProvider as Ao } from "./contexts/OtherToolContext.js";
@@ -80,9 +80,9 @@ import { UICheckbox as yt } from "./components/ui/Checkbox.js";
80
80
  import { ClearIcon as Zo } from "./components/icons/ClearIcon.js";
81
81
  import './assets/RPDefaultLayout.css';const jo = (e) => e < 0.5 ? 2 * e * e : -1 + (4 - 2 * e) * e, nn = () => {
82
82
  const { viewMode: e } = je(), { scrollMode: t } = Pe(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = Be(), { setFocusedPage: s } = re(), c = W(), { columnCount: i } = jt(), { widths: l, heights: p } = _o(), h = W(t), m = W(e), u = W(i);
83
- z(() => {
83
+ A(() => {
84
84
  n != null && n.scrollToItem && (c.current = n);
85
- }, [n]), z(() => {
85
+ }, [n]), A(() => {
86
86
  h.current = t, m.current = e;
87
87
  }, [t, e]);
88
88
  const g = R((f, _, P) => {
@@ -109,9 +109,9 @@ import './assets/RPDefaultLayout.css';const jo = (e) => e < 0.5 ? 2 * e * e : -1
109
109
  },
110
110
  [r, l, g]
111
111
  );
112
- return z(() => {
112
+ return A(() => {
113
113
  h.current = t, m.current = e;
114
- }, [t, e]), z(() => {
114
+ }, [t, e]), A(() => {
115
115
  u.current = i;
116
116
  }, [i]), { scrollToPage: R(
117
117
  (f) => {
@@ -199,7 +199,7 @@ import './assets/RPDefaultLayout.css';const jo = (e) => e < 0.5 ? 2 * e * e : -1
199
199
  return typeof (e == null ? void 0 : e.focusedPage) > "u" && bo.error("Please use this hooks inside children component of RPProvider"), e;
200
200
  }, Ka = ({ children: e }) => {
201
201
  const { pdf: t } = Y(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: s, goToPage: c, nextPage: i, prevPage: l } = Bo();
202
- return z(() => {
202
+ return A(() => {
203
203
  t != null && t.numPages && s(t.numPages);
204
204
  }, [t, s]), /* @__PURE__ */ a(
205
205
  on.Provider,
@@ -223,7 +223,7 @@ const Ko = () => {
223
223
  totalPages: 0,
224
224
  percentage: 0
225
225
  }), [r, s] = $(!1), [c, i] = $(!1), [l, p] = $(null), h = W(!1);
226
- z(() => {
226
+ A(() => {
227
227
  h.current;
228
228
  }, [h]);
229
229
  const m = R(() => {
@@ -362,7 +362,7 @@ const Ko = () => {
362
362
  T.height = 0, T.width = 0;
363
363
  }
364
364
  }, [e, t, h]);
365
- return z(() => {
365
+ return A(() => {
366
366
  const T = () => {
367
367
  u(), m();
368
368
  };
@@ -405,13 +405,13 @@ const Ko = () => {
405
405
  },
406
406
  [i, t]
407
407
  );
408
- z(() => {
408
+ A(() => {
409
409
  l && o && v();
410
- }, [l, o]), z(() => {
410
+ }, [l, o]), A(() => {
411
411
  p && u((f) => {
412
412
  console.error(f);
413
413
  });
414
- }, [p]), z(() => {
414
+ }, [p]), A(() => {
415
415
  i && t && t(i);
416
416
  }, [i, t]);
417
417
  const v = () => {
@@ -431,7 +431,7 @@ const Ko = () => {
431
431
  throw new Error("usePrintContext must be used within a PrintProvider");
432
432
  return e;
433
433
  }, Xo = () => {
434
- const [e, t] = $({}), { pages: n } = Y(), { rotate: o } = qe(), r = A(() => Object.keys(e).length, [e]), s = R(
434
+ const [e, t] = $({}), { pages: n } = Y(), { rotate: o } = qe(), r = z(() => Object.keys(e).length, [e]), s = R(
435
435
  (i) => {
436
436
  if (!n.size)
437
437
  return;
@@ -472,7 +472,7 @@ const Ko = () => {
472
472
  },
473
473
  [n, o]
474
474
  );
475
- z(() => {
475
+ A(() => {
476
476
  s(10);
477
477
  }, [s]);
478
478
  const c = R(
@@ -531,8 +531,8 @@ const Ko = () => {
531
531
  }
532
532
  );
533
533
  }, Jo = (e = {}, t = "") => {
534
- const [n, o] = $(t), [r, s] = $(!1), { pdf: c, pages: i } = Y(), l = Jt(), p = W(!n), { currentZoom: h } = Ze(), [m, u] = $([]), { setFocusedPage: g } = re(), [v, b] = $(0), { pageScrollElementRef: f, virtualScrollableElementRef: _ } = Be(), { scrollMode: P } = Pe(), [T, x] = $(null), d = W({}), C = A(() => v === 0 ? null : m[v - 1], [v, m]), w = A(() => m.length, [m]);
535
- z(() => {
534
+ const [n, o] = $(t), [r, s] = $(!1), { pdf: c, pages: i } = Y(), l = Jt(), p = W(!n), { currentZoom: h } = Ze(), [m, u] = $([]), { setFocusedPage: g } = re(), [v, b] = $(0), { pageScrollElementRef: f, virtualScrollableElementRef: _ } = Be(), { scrollMode: P } = Pe(), [T, x] = $(null), d = W({}), C = z(() => v === 0 ? null : m[v - 1], [v, m]), w = z(() => m.length, [m]);
535
+ A(() => {
536
536
  if (!C || !i)
537
537
  return;
538
538
  const S = _ || f;
@@ -585,7 +585,7 @@ const Ko = () => {
585
585
  }
586
586
  return L;
587
587
  }, []);
588
- return z(() => {
588
+ return A(() => {
589
589
  if (!n) {
590
590
  p.current = !0, u([]), b(0);
591
591
  return;
@@ -688,7 +688,7 @@ const Ko = () => {
688
688
  "rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
689
689
  }, Yo = (e) => {
690
690
  const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = W(null), { pages: s } = Y(), { rotate: c } = qe(), i = W(), { currentZoom: l } = Ze();
691
- return z(() => {
691
+ return A(() => {
692
692
  if (!s || l === 0)
693
693
  return;
694
694
  const p = s.get(t);
@@ -710,7 +710,7 @@ const Ko = () => {
710
710
  }, Qo = (e) => {
711
711
  const { pageNumber: t } = e, { pages: n } = Y(), o = W(null), { matches: r, currentMatch: s, setCurrentMatchElement: c } = ln(), [i, l] = $(
712
712
  []
713
- ), p = W(), h = W(), m = W(), u = A(() => r.filter((v) => v.pageIndex === t - 1), [r, t]), g = R(
713
+ ), p = W(), h = W(), m = W(), u = z(() => r.filter((v) => v.pageIndex === t - 1), [r, t]), g = R(
714
714
  (v, b, f = !1) => {
715
715
  if (f && Jn(v, b), !u.length) {
716
716
  m.current = void 0, l([]);
@@ -721,7 +721,7 @@ const Ko = () => {
721
721
  },
722
722
  [u]
723
723
  );
724
- return z(() => {
724
+ return A(() => {
725
725
  var f;
726
726
  if ((f = m.current) == null || f.classList.remove("selected"), !i.length || !s || s.pageIndex !== t - 1)
727
727
  return;
@@ -732,7 +732,7 @@ const Ko = () => {
732
732
  return;
733
733
  const b = i.find((_) => _.index === v);
734
734
  b && (m.current = b.element, c(b.element), b.element.classList.add("selected"));
735
- }, [s, i, u]), z(() => {
735
+ }, [s, i, u]), A(() => {
736
736
  const v = n.get(t);
737
737
  if (!(!v || !o.current))
738
738
  return p.current && p.current.cancel(), v.page.getTextContent().then((b) => {
@@ -754,7 +754,7 @@ const Ko = () => {
754
754
  var b;
755
755
  (b = p.current) == null || b.cancel();
756
756
  };
757
- }, [n, t]), z(() => {
757
+ }, [n, t]), A(() => {
758
758
  var f;
759
759
  [].slice.call(o.current.children).forEach((_) => {
760
760
  _.classList.add(Ye["rp-text-layer-text"]);
@@ -883,12 +883,12 @@ function Lt(e, t) {
883
883
  e.removeEventListener(n, t);
884
884
  }
885
885
  const ir = (e) => {
886
- const { pageNumber: t } = e, n = W(null), { pages: o, pdf: r } = Y(), s = W(), [c, i] = $(), { setFocusedPage: l, goToPage: p } = re(), { scrollMode: h } = Pe(), m = A(() => o.get(t), [o, t]), u = A(() => m == null ? void 0 : m.page.getViewport(), [m]);
887
- z(() => {
886
+ const { pageNumber: t } = e, n = W(null), { pages: o, pdf: r } = Y(), s = W(), [c, i] = $(), { setFocusedPage: l, goToPage: p } = re(), { scrollMode: h } = Pe(), m = z(() => o.get(t), [o, t]), u = z(() => m == null ? void 0 : m.page.getViewport(), [m]);
887
+ A(() => {
888
888
  s.current && (s.current.div.replaceChildren(), s.current = void 0);
889
889
  }, [r]);
890
- const g = A(() => r == null ? void 0 : r.annotationStorage, [r]);
891
- z(() => {
890
+ const g = z(() => r == null ? void 0 : r.annotationStorage, [r]);
891
+ A(() => {
892
892
  m && m.page.getAnnotations().then((b) => {
893
893
  s.current = void 0, i(b), n.current && (n.current.innerText = "");
894
894
  });
@@ -899,7 +899,7 @@ const ir = (e) => {
899
899
  },
900
900
  [r, c, p, l, h]
901
901
  );
902
- return z(() => {
902
+ return A(() => {
903
903
  if (!m || !c)
904
904
  return;
905
905
  const b = m.page.getViewport();
@@ -963,13 +963,13 @@ const ir = (e) => {
963
963
  width: 0,
964
964
  height: 0
965
965
  });
966
- qt(t, () => g.current), z(() => {
966
+ qt(t, () => g.current), A(() => {
967
967
  if (c && (h.current = c.get(n), h.current)) {
968
968
  const T = h.current.page.getViewport({ scale: p, rotation: i });
969
969
  b(T);
970
970
  }
971
971
  }, [c, n, i, p]);
972
- const f = A(() => {
972
+ const f = z(() => {
973
973
  switch (i) {
974
974
  case 90:
975
975
  return `${v.width / 2}px ${v.width / 2}px`;
@@ -984,7 +984,7 @@ const ir = (e) => {
984
984
  }, []), P = R(() => {
985
985
  u(!1);
986
986
  }, []);
987
- return z(() => {
987
+ return A(() => {
988
988
  const T = new IntersectionObserver(
989
989
  (x) => {
990
990
  r && r(n, x[0].intersectionRatio);
@@ -1080,7 +1080,7 @@ function Et(e, t) {
1080
1080
  var n = {};
1081
1081
  for (var o in e)
1082
1082
  if ({}.hasOwnProperty.call(e, o)) {
1083
- if (t.includes(o))
1083
+ if (t.indexOf(o) !== -1)
1084
1084
  continue;
1085
1085
  n[o] = e[o];
1086
1086
  }
@@ -1517,11 +1517,11 @@ const Sr = () => {
1517
1517
  ), c = R(
1518
1518
  (g) => r.heights[g] || 0,
1519
1519
  [r.heights]
1520
- ), i = A(() => r.heights.length, [r.heights]), l = A(() => Math.max(...r.widths), [r.widths]), p = A(() => t === B.HORIZONTAL_SCROLLING ? i : e === We.DUAL_PAGE ? 2 : 1, [e, t, t, i, o, l]);
1521
- z(() => {
1520
+ ), i = z(() => r.heights.length, [r.heights]), l = z(() => Math.max(...r.widths), [r.widths]), p = z(() => t === B.HORIZONTAL_SCROLLING ? i : e === We.DUAL_PAGE ? 2 : 1, [e, t, t, i, o, l]);
1521
+ A(() => {
1522
1522
  n(p);
1523
1523
  }, [p, n]);
1524
- const h = A(() => t === B.HORIZONTAL_SCROLLING || t === B.PAGE_SCROLLING ? 1 : Math.round(i / p), [p, i, t]), m = A(() => r.heights.reduce((g, v) => g + v, 0) / r.heights.length || 0, [r]), u = A(() => r.widths.reduce((g, v) => g + v, 0) / r.heights.length || 0, [r]);
1524
+ const h = z(() => t === B.HORIZONTAL_SCROLLING || t === B.PAGE_SCROLLING ? 1 : Math.round(i / p), [p, i, t]), m = z(() => r.heights.reduce((g, v) => g + v, 0) / r.heights.length || 0, [r]), u = z(() => r.widths.reduce((g, v) => g + v, 0) / r.heights.length || 0, [r]);
1525
1525
  return {
1526
1526
  rowCount: h,
1527
1527
  rowHeight: c,
@@ -1700,14 +1700,14 @@ class yr extends Vn {
1700
1700
  }
1701
1701
  }
1702
1702
  const xr = ({ widths: e, heights: t }) => {
1703
- const { focusedPage: n, totalPages: o } = re(), r = A(() => {
1703
+ const { focusedPage: n, totalPages: o } = re(), r = z(() => {
1704
1704
  const i = [], l = Math.ceil(n / 2) * 2 - 1;
1705
1705
  if (i.push(l), l + 1 < o) {
1706
1706
  const p = l + 1;
1707
1707
  i.push(p);
1708
1708
  }
1709
1709
  return i;
1710
- }, [n, o]), s = A(() => [
1710
+ }, [n, o]), s = z(() => [
1711
1711
  {
1712
1712
  position: "absolute",
1713
1713
  left: 0,
@@ -1721,14 +1721,14 @@ const xr = ({ widths: e, heights: t }) => {
1721
1721
  width: e(n),
1722
1722
  height: t(n)
1723
1723
  }
1724
- ], [e, t, r]), c = A(() => s.reduce((i, l) => i + Number(l.width || 0), 0), [s]);
1724
+ ], [e, t, r]), c = z(() => s.reduce((i, l) => i + Number(l.width || 0), 0), [s]);
1725
1725
  return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: r.map((i, l) => /* @__PURE__ */ a(wt, { style: s[l], pageNumber: i }, i)) });
1726
1726
  }, Rr = ({ widths: e, heights: t }) => {
1727
- const { focusedPage: n } = re(), o = A(() => ({
1727
+ const { focusedPage: n } = re(), o = z(() => ({
1728
1728
  position: "absolute",
1729
1729
  width: e(n - 1),
1730
1730
  height: t(n - 1)
1731
- }), [e, t, n]), r = A(() => e(n - 1), [e]);
1731
+ }), [e, t, n]), r = z(() => e(n - 1), [e]);
1732
1732
  return /* @__PURE__ */ a(
1733
1733
  "div",
1734
1734
  {
@@ -1740,7 +1740,7 @@ const xr = ({ widths: e, heights: t }) => {
1740
1740
  }
1741
1741
  );
1742
1742
  }, Lr = Un(({ columnIndex: e, rowIndex: t, data: n, style: o }) => {
1743
- const r = A(() => e + 1 + t * n.columnCount, [e, t, n]);
1743
+ const r = e + 1 + t * n.columnCount;
1744
1744
  return /* @__PURE__ */ a(
1745
1745
  wt,
1746
1746
  {
@@ -1779,9 +1779,9 @@ const xr = ({ widths: e, heights: t }) => {
1779
1779
  vo(o);
1780
1780
  const { isPressed: V } = fo(), { selectionMode: K } = jn(), { initializeGrabScroll: ae } = go({
1781
1781
  isPressed: V
1782
- }), Q = A(() => K === qn.HAND, [K]), X = R((k, H) => {
1782
+ }), Q = z(() => K === qn.HAND, [K]), X = R((k, H) => {
1783
1783
  F((Z) => ({ ...Z, [k]: Math.round(H * 100) }));
1784
- }, []), ee = A(() => ({
1784
+ }, []), ee = z(() => ({
1785
1785
  columnCount: S,
1786
1786
  handleIntersectRatioChange: X
1787
1787
  }), [S, X]), ie = R(
@@ -1796,9 +1796,9 @@ const xr = ({ widths: e, heights: t }) => {
1796
1796
  scrollLeft: k.scrollLeft
1797
1797
  };
1798
1798
  }, []);
1799
- z(() => (window.addEventListener("keydown", ie), () => {
1799
+ A(() => (window.addEventListener("keydown", ie), () => {
1800
1800
  window.removeEventListener("keydown", ie);
1801
- }), [ie]), z(() => {
1801
+ }), [ie]), A(() => {
1802
1802
  if (P.current && (P.current.style.position = "relative"), !!s) {
1803
1803
  T.current = {
1804
1804
  height: h.height,
@@ -1821,7 +1821,7 @@ const xr = ({ widths: e, heights: t }) => {
1821
1821
  shouldForceUpdate: !0
1822
1822
  });
1823
1823
  }
1824
- }, [N, S, y, s, r]), z(() => {
1824
+ }, [N, S, y, s, r]), A(() => {
1825
1825
  if (G.current)
1826
1826
  return;
1827
1827
  if (x.current.viewMode !== _ || x.current.scrollMode !== f) {
@@ -1845,7 +1845,7 @@ const xr = ({ widths: e, heights: t }) => {
1845
1845
  d.current = !1;
1846
1846
  }, 100);
1847
1847
  }
1848
- }, [h, _, f]), z(() => {
1848
+ }, [h, _, f]), A(() => {
1849
1849
  const k = Object.entries(O);
1850
1850
  if (G.current || d.current) {
1851
1851
  G.current = !1;
@@ -1855,10 +1855,10 @@ const xr = ({ widths: e, heights: t }) => {
1855
1855
  k.forEach((he) => {
1856
1856
  Z < he[1] && (H = Number(he[0]), Z = he[1]);
1857
1857
  }), H && v(H);
1858
- }, [O, v]), z(() => () => {
1858
+ }, [O, v]), A(() => () => {
1859
1859
  U.current && clearTimeout(U.current), C.current && clearTimeout(C.current);
1860
1860
  }, []);
1861
- const Ee = A(() => te(ue["rp-pages-container"], {
1861
+ const Ee = z(() => te(ue["rp-pages-container"], {
1862
1862
  [ue["rp-cursor-grab"]]: Q && !V,
1863
1863
  [ue["rp-cursor-grabbing"]]: Q && V
1864
1864
  }), [Q, V]), Se = R(
@@ -1870,7 +1870,7 @@ const xr = ({ widths: e, heights: t }) => {
1870
1870
  },
1871
1871
  [Q, ae, ue]
1872
1872
  );
1873
- return z(() => {
1873
+ return A(() => {
1874
1874
  if (t === B.PAGE_SCROLLING) {
1875
1875
  e !== b && m && v(e);
1876
1876
  return;
@@ -1955,7 +1955,7 @@ const xr = ({ widths: e, heights: t }) => {
1955
1955
  return e || /* @__PURE__ */ a(Re, { style: { transform: "rotate(180deg" } });
1956
1956
  }, Er = () => {
1957
1957
  const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: s } = re(), [c, i] = $(e.toString()), { pageNavigationTool: l = !0 } = pe(), { isSmallScreen: p } = ve();
1958
- z(() => {
1958
+ A(() => {
1959
1959
  i(e.toString());
1960
1960
  }, [e]);
1961
1961
  const h = R((v) => {
@@ -2001,7 +2001,7 @@ const xr = ({ widths: e, heights: t }) => {
2001
2001
  !p && /* @__PURE__ */ a(ne, { content: "Next page", children: /* @__PURE__ */ a(J, { onClick: o, disabled: e === t, children: /* @__PURE__ */ a(Mr, {}) }) })
2002
2002
  ] }) : null;
2003
2003
  };
2004
- var bt = "Dialog", [gn, ei] = No(bt), [Or, se] = gn(bt), vn = (e) => {
2004
+ var bt = "Dialog", [gn, ei] = Po(bt), [Or, se] = gn(bt), vn = (e) => {
2005
2005
  const {
2006
2006
  __scopeDialog: t,
2007
2007
  children: n,
@@ -2009,7 +2009,7 @@ var bt = "Dialog", [gn, ei] = No(bt), [Or, se] = gn(bt), vn = (e) => {
2009
2009
  defaultOpen: r,
2010
2010
  onOpenChange: s,
2011
2011
  modal: c = !0
2012
- } = e, i = q.useRef(null), l = q.useRef(null), [p = !1, h] = Eo({
2012
+ } = e, i = q.useRef(null), l = q.useRef(null), [p = !1, h] = yo({
2013
2013
  prop: o,
2014
2014
  defaultProp: r,
2015
2015
  onChange: s
@@ -2055,7 +2055,7 @@ var Ct = "DialogPortal", [Ar, wn] = gn(Ct, {
2055
2055
  forceMount: void 0
2056
2056
  }), bn = (e) => {
2057
2057
  const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, s = se(Ct, t);
2058
- return /* @__PURE__ */ a(Ar, { scope: t, forceMount: n, children: q.Children.map(o, (c) => /* @__PURE__ */ a(gt, { present: n || s.open, children: /* @__PURE__ */ a(Lo, { asChild: !0, container: r, children: c }) })) });
2058
+ return /* @__PURE__ */ a(Ar, { scope: t, forceMount: n, children: q.Children.map(o, (c) => /* @__PURE__ */ a(gt, { present: n || s.open, children: /* @__PURE__ */ a(Eo, { asChild: !0, container: r, children: c }) })) });
2059
2059
  };
2060
2060
  bn.displayName = Ct;
2061
2061
  var $e = "DialogOverlay", Cn = q.forwardRef(
@@ -2071,7 +2071,7 @@ var zr = q.forwardRef(
2071
2071
  return (
2072
2072
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
2073
2073
  // ie. when `Overlay` and `Content` are siblings
2074
- /* @__PURE__ */ a(Po, { as: So, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
2074
+ /* @__PURE__ */ a(Ro, { as: So, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
2075
2075
  Me.div,
2076
2076
  {
2077
2077
  "data-state": Pt(r.open),
@@ -2095,7 +2095,7 @@ var Fr = q.forwardRef(
2095
2095
  return q.useEffect(() => {
2096
2096
  const s = o.current;
2097
2097
  if (s)
2098
- return Io(s);
2098
+ return Lo(s);
2099
2099
  }, []), /* @__PURE__ */ a(
2100
2100
  Pn,
2101
2101
  {
@@ -2144,9 +2144,9 @@ var Fr = q.forwardRef(
2144
2144
  ), Pn = q.forwardRef(
2145
2145
  (e, t) => {
2146
2146
  const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: s, ...c } = e, i = se(ge, n), l = q.useRef(null), p = ft(t, l);
2147
- return yo(), /* @__PURE__ */ D(ke, { children: [
2147
+ return No(), /* @__PURE__ */ D(ke, { children: [
2148
2148
  /* @__PURE__ */ a(
2149
- xo,
2149
+ Mo,
2150
2150
  {
2151
2151
  asChild: !0,
2152
2152
  loop: !0,
@@ -2154,7 +2154,7 @@ var Fr = q.forwardRef(
2154
2154
  onMountAutoFocus: r,
2155
2155
  onUnmountAutoFocus: s,
2156
2156
  children: /* @__PURE__ */ a(
2157
- Ro,
2157
+ xo,
2158
2158
  {
2159
2159
  role: "dialog",
2160
2160
  id: i.contentId,
@@ -2206,7 +2206,7 @@ xn.displayName = yn;
2206
2206
  function Pt(e) {
2207
2207
  return e ? "open" : "closed";
2208
2208
  }
2209
- var Rn = "DialogTitleWarning", [ti, Ln] = Mo(Rn, {
2209
+ var Rn = "DialogTitleWarning", [ti, Ln] = Io(Rn, {
2210
2210
  contentName: ge,
2211
2211
  titleName: Tt,
2212
2212
  docsSlug: "dialog"
@@ -2236,7 +2236,7 @@ const fe = {
2236
2236
  "rp-dialog-close": "_rp-dialog-close_slqo7_47",
2237
2237
  "rp-properties-divider": "_rp-properties-divider_slqo7_55"
2238
2238
  }, Kr = () => {
2239
- const { pdfProperties: e } = Y(), { container: t } = Le(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = Do(), r = A(() => {
2239
+ const { pdfProperties: e } = Y(), { container: t } = Le(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = Do(), r = z(() => {
2240
2240
  if (!e)
2241
2241
  return [];
2242
2242
  const {
@@ -2334,7 +2334,7 @@ const fe = {
2334
2334
  const { goToLastPageIcon: e } = le();
2335
2335
  return e || /* @__PURE__ */ a(tn, {});
2336
2336
  }, is = () => {
2337
- const { goToPage: e, totalPages: t, focusedPage: n } = re(), { jumpNavigationTool: o = !0 } = pe(), r = A(() => n === 1, [n]), s = A(() => n === t, [n, t]), c = R(() => {
2337
+ const { goToPage: e, totalPages: t, focusedPage: n } = re(), { jumpNavigationTool: o = !0 } = pe(), r = z(() => n === 1, [n]), s = z(() => n === t, [n, t]), c = R(() => {
2338
2338
  e(1);
2339
2339
  }, [e]), i = R(() => {
2340
2340
  e(t);
@@ -2362,7 +2362,7 @@ const fe = {
2362
2362
  printTool: p,
2363
2363
  fullscreenTool: h
2364
2364
  } = pe();
2365
- return A(() => {
2365
+ return z(() => {
2366
2366
  const u = l || c || i || s || r;
2367
2367
  let g = !1;
2368
2368
  return t && (g = !(!n && !o && !p && !h)), u || g;
@@ -2434,7 +2434,7 @@ const fe = {
2434
2434
  const _ = Math.ceil(f / 25) * 25;
2435
2435
  return Math.min(_ - 25, rt);
2436
2436
  });
2437
- }, [t]), m = A(() => e === us, [e]), u = A(() => e === rt, [e]), g = A(() => {
2437
+ }, [t]), m = z(() => e === us, [e]), u = z(() => e === rt, [e]), g = z(() => {
2438
2438
  var f;
2439
2439
  return (f = i.get(s)) == null ? void 0 : f.page.getViewport({ scale: 1, rotation: c });
2440
2440
  }, [i, s, c]), v = R(
@@ -2516,16 +2516,16 @@ const fe = {
2516
2516
  },
2517
2517
  [f, g, u, p, v]
2518
2518
  );
2519
- z(() => (window.addEventListener("keydown", x), () => {
2519
+ A(() => (window.addEventListener("keydown", x), () => {
2520
2520
  window.removeEventListener("keydown", x);
2521
- }), [x]), z(() => {
2521
+ }), [x]), A(() => {
2522
2522
  r && r.focus();
2523
2523
  }, [r]);
2524
2524
  const C = R((L) => {
2525
2525
  _(L.target.value);
2526
2526
  }, []), w = R(() => {
2527
2527
  _(""), p("");
2528
- }, [p]), y = A(() => `${m} / ${h}`, [m, h]), { wholeWords: N, matchCase: I } = A(() => c, [c]), S = R(
2528
+ }, [p]), y = z(() => `${m} / ${h}`, [m, h]), { wholeWords: N, matchCase: I } = z(() => c, [c]), S = R(
2529
2529
  (L) => {
2530
2530
  i((E) => ({ ...E, matchCase: L }));
2531
2531
  },
@@ -2536,7 +2536,7 @@ const fe = {
2536
2536
  },
2537
2537
  [i]
2538
2538
  );
2539
- return z(() => {
2539
+ return A(() => {
2540
2540
  T();
2541
2541
  }, [o, T]), b ? /* @__PURE__ */ a(
2542
2542
  mt,
@@ -2628,7 +2628,7 @@ const fe = {
2628
2628
  "rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
2629
2629
  "rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
2630
2630
  }, ws = (e) => {
2631
- const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: s } = re(), c = A(() => o ? ye["rp-thumbnail-active"] : "", [o]), i = A(() => ({
2631
+ const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: s } = re(), c = z(() => o ? ye["rp-thumbnail-active"] : "", [o]), i = z(() => ({
2632
2632
  width: Math.round(r.width),
2633
2633
  height: Math.round(r.height)
2634
2634
  }), [r]), l = R(() => {
@@ -2673,11 +2673,11 @@ const fe = {
2673
2673
  }, Ts = Ue((e, t) => {
2674
2674
  const { show: n } = e, { focusedPage: o, totalPages: r } = re(), { thumbnailPages: s, addPage: c, thumbnailLength: i, addToPage: l } = an(), p = W(null), h = W(1);
2675
2675
  qt(t, () => p.current);
2676
- const m = A(() => Object.values(s), [s]), u = R(() => {
2676
+ const m = z(() => Object.values(s), [s]), u = R(() => {
2677
2677
  const g = i + 1;
2678
2678
  g <= r && c(g);
2679
2679
  }, [c, r, i]);
2680
- return z(() => {
2680
+ return A(() => {
2681
2681
  o > i ? l(o) : n && h.current !== o && (Cs(p.current, o), h.current = o);
2682
2682
  }, [o, i, l, n, m]), oo(p.current, u), /* @__PURE__ */ a("div", { ref: p, className: Ut["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: Ut["rp-thumbnails"], children: n ? m.map((g, v) => {
2683
2683
  var b, f;
@@ -2699,7 +2699,7 @@ const fe = {
2699
2699
  }, Ss = () => {
2700
2700
  const { active: e, setActive: t } = an(), [n, o] = $(200), r = W(null), { thumbnailTool: s } = pe(), c = R(() => {
2701
2701
  t((l) => !l);
2702
- }, []), i = A(() => typeof s != "boolean" && s ? /* @__PURE__ */ a(s, { onClick: c, active: e }) : s ? /* @__PURE__ */ a(ne, { content: "Thumbnail", children: /* @__PURE__ */ a(J, { onClick: c, active: e, children: /* @__PURE__ */ a(Ps, {}) }) }) : null, [s, e, c]);
2702
+ }, []), i = z(() => typeof s != "boolean" && s ? /* @__PURE__ */ a(s, { onClick: c, active: e }) : s ? /* @__PURE__ */ a(ne, { content: "Thumbnail", children: /* @__PURE__ */ a(J, { onClick: c, active: e, children: /* @__PURE__ */ a(Ps, {}) }) }) : null, [s, e, c]);
2703
2703
  return /* @__PURE__ */ D(
2704
2704
  "div",
2705
2705
  {
@@ -2717,7 +2717,7 @@ const fe = {
2717
2717
  );
2718
2718
  }, ni = Ue((e, t) => {
2719
2719
  const { children: n, slots: o, icons: r, style: s, className: c, mobileWidth: i, onLoaded: l, cleanupOnLoaded: p } = e, [h, m] = $(null), { setContainer: u, setContentRef: g } = Le(), { loading: v } = Y();
2720
- return z(() => (l && l(), () => {
2720
+ return A(() => (l && l(), () => {
2721
2721
  p && p();
2722
2722
  }), [l, p]), /* @__PURE__ */ a("div", { ref: t, className: te(we["rp-theme-variables"], we["rp-container"]), children: /* @__PURE__ */ a(uo, { mobileWidth: i, children: /* @__PURE__ */ a(so, { slots: o, children: /* @__PURE__ */ a(ao, { icons: r, children: /* @__PURE__ */ D(
2723
2723
  io,