@prose-reader/react-reader 1.187.0 → 1.189.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 (58) hide show
  1. package/dist/{src/ReactReader.d.ts → ReactReader.d.ts} +2 -3
  2. package/dist/annotations/AnnotationsDialog.d.ts +5 -0
  3. package/dist/annotations/AnnotationsDialogContent.d.ts +3 -0
  4. package/dist/bookmarks/Bookmarks.d.ts +1 -0
  5. package/dist/bookmarks/BookmarksDialog.d.ts +5 -0
  6. package/dist/bookmarks/BookmarksDialogContent.d.ts +3 -0
  7. package/dist/context/useReader.d.ts +8 -0
  8. package/dist/index.js +790 -589
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.umd.cjs +1 -1
  11. package/dist/index.umd.cjs.map +1 -1
  12. package/dist/quickmenu/BottomBar.d.ts +4 -0
  13. package/dist/quickmenu/QuickMenu.d.ts +3 -0
  14. package/dist/quickmenu/Scrubber.d.ts +3 -0
  15. package/dist/quickmenu/TopBar.d.ts +4 -0
  16. package/dist/theme/config.d.ts +1 -0
  17. package/package.json +11 -2
  18. package/dist/src/context/useReader.d.ts +0 -4
  19. package/dist/src/navigation/QuickMenu/BottomBar.d.ts +0 -6
  20. package/dist/src/navigation/QuickMenu/QuickMenu.d.ts +0 -7
  21. package/dist/src/navigation/QuickMenu/Scrubber.d.ts +0 -1
  22. package/dist/src/navigation/QuickMenu/TopBar.d.ts +0 -5
  23. /package/dist/{src/common → common}/useFullscreen.d.ts +0 -0
  24. /package/dist/{src/components → components}/ui/accordion.d.ts +0 -0
  25. /package/dist/{src/components → components}/ui/avatar.d.ts +0 -0
  26. /package/dist/{src/components → components}/ui/checkbox.d.ts +0 -0
  27. /package/dist/{src/components → components}/ui/close-button.d.ts +0 -0
  28. /package/dist/{src/components → components}/ui/color-mode.d.ts +0 -0
  29. /package/dist/{src/components → components}/ui/dialog.d.ts +0 -0
  30. /package/dist/{src/components → components}/ui/drawer.d.ts +0 -0
  31. /package/dist/{src/components → components}/ui/field.d.ts +0 -0
  32. /package/dist/{src/components → components}/ui/input-group.d.ts +0 -0
  33. /package/dist/{src/components → components}/ui/popover.d.ts +0 -0
  34. /package/dist/{src/components → components}/ui/progress.d.ts +0 -0
  35. /package/dist/{src/components → components}/ui/provider.d.ts +0 -0
  36. /package/dist/{src/components → components}/ui/radio.d.ts +0 -0
  37. /package/dist/{src/components → components}/ui/slider.d.ts +0 -0
  38. /package/dist/{src/components → components}/ui/toggle-tip.d.ts +0 -0
  39. /package/dist/{src/components → components}/ui/tooltip.d.ts +0 -0
  40. /package/dist/{src/context → context}/ReactReaderProvider.d.ts +0 -0
  41. /package/dist/{src/context → context}/context.d.ts +0 -0
  42. /package/dist/{src/help → help}/HelpDialog.d.ts +0 -0
  43. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  44. /package/dist/{src/navigation → navigation}/FloatingProgress.d.ts +0 -0
  45. /package/dist/{src/navigation → navigation}/FloatingTime.d.ts +0 -0
  46. /package/dist/{src/navigation → navigation}/useNavigationContext.d.ts +0 -0
  47. /package/dist/{src/pagination → pagination}/usePagination.d.ts +0 -0
  48. /package/dist/{src/navigation/QuickMenu → quickmenu}/PaginationInfoSection.d.ts +0 -0
  49. /package/dist/{src/navigation/QuickMenu → quickmenu}/QuickBar.d.ts +0 -0
  50. /package/dist/{src/navigation/QuickMenu → quickmenu}/ThemedSlider.d.ts +0 -0
  51. /package/dist/{src/navigation/QuickMenu → quickmenu}/TimeIndicator.d.ts +0 -0
  52. /package/dist/{src/navigation/QuickMenu → quickmenu}/useQuickMenu.d.ts +0 -0
  53. /package/dist/{src/search → search}/SearchDialog.d.ts +0 -0
  54. /package/dist/{src/search → search}/SearchDialogContent.d.ts +0 -0
  55. /package/dist/{src/search → search}/SearchListItem.d.ts +0 -0
  56. /package/dist/{src/settings → settings}/useSettings.d.ts +0 -0
  57. /package/dist/{src/toc → toc}/TableOfContentsDialog.d.ts +0 -0
  58. /package/dist/{src/toc → toc}/TableOfContentsDialogContent.d.ts +0 -0
package/dist/index.js CHANGED
@@ -1,202 +1,411 @@
1
- import { jsx as t, jsxs as a, Fragment as F } from "react/jsx-runtime";
2
- import * as w from "react";
3
- import he, { createContext as ue, memo as p, useMemo as ge, useEffect as M, useContext as oe, useState as T, useCallback as H } from "react";
4
- import { signal as me, useSignal as re, useLiveRef as fe, useSubscribe as le, useObserve as I, useSignalValue as pe } from "reactjrx";
5
- import { tap as be, NEVER as xe, combineLatest as Ce, map as ie, startWith as ve } from "rxjs";
6
- import { IconButton as b, Portal as se, Dialog as f, Heading as L, HStack as k, Kbd as te, Text as m, Button as _, Box as R, Popover as y, Progress as B, Stack as v, Presence as $, chakra as Ie, Collapsible as E, Link as ae, Input as Se, List as z } from "@chakra-ui/react";
7
- import { LuX as Pe, LuArrowBigRight as Te, LuArrowBigLeft as ke, LuChevronDown as we, LuCircleHelp as ye, LuTableOfContents as Re, LuSearch as Oe, LuCircleCheck as ne } from "react-icons/lu";
8
- import { RxDoubleArrowUp as De, RxDoubleArrowLeft as Ae, RxDoubleArrowDown as ze, RxDoubleArrowRight as Be } from "react-icons/rx";
9
- import { HiOutlineInformationCircle as Me } from "react-icons/hi";
10
- import Ee from "rc-slider";
1
+ import { jsx as e, jsxs as c, Fragment as U } from "react/jsx-runtime";
2
+ import * as D from "react";
3
+ import fe, { createContext as me, memo as f, useMemo as be, useEffect as Q, useContext as le, useState as w, useCallback as M } from "react";
4
+ import { signal as xe, useSignal as se, useLiveRef as Ce, useSubscribe as ae, useObserve as b, useSignalValue as ve } from "reactjrx";
5
+ import { tap as ke, switchMap as ce, NEVER as Ie, combineLatest as Se, map as de, startWith as Pe } from "rxjs";
6
+ import { IconButton as m, Portal as he, Dialog as k, List as S, Link as G, Stack as P, Text as p, Button as E, Presence as q, Box as A, Heading as W, HStack as O, Kbd as re, Popover as z, Progress as _, chakra as Te, Collapsible as K, Input as we } from "@chakra-ui/react";
7
+ import { LuX as ye, LuNotebookPen as X, LuArrowBigRight as Re, LuArrowBigLeft as Oe, LuChevronDown as De, LuCircleHelp as ze, LuTableOfContents as Ae, LuSearch as Ee, LuCircleCheck as ie } from "react-icons/lu";
8
+ import { createPortal as Be } from "react-dom";
9
+ import { BsBookmarkPlus as Me, BsBookmarkXFill as _e, BsBookmarks as Le } from "react-icons/bs";
10
+ import { RxDoubleArrowUp as $e, RxDoubleArrowLeft as Ne, RxDoubleArrowDown as Fe, RxDoubleArrowRight as He } from "react-icons/rx";
11
+ import { HiOutlineInformationCircle as je } from "react-icons/hi";
12
+ import Ve from "rc-slider";
11
13
  import "rc-slider/assets/index.css";
12
- import { IoIosArrowBack as Le, IoMdMore as $e } from "react-icons/io";
13
- import { MdFullscreenExit as Fe, MdFullscreen as He } from "react-icons/md";
14
- const N = ue({
14
+ import { IoIosArrowBack as Ye, IoMdMore as qe } from "react-icons/io";
15
+ import { MdFullscreenExit as Ue, MdFullscreen as Qe } from "react-icons/md";
16
+ const J = me({
15
17
  reader: void 0,
16
- quickMenuSignal: me({ default: !1 })
17
- }), kt = p(
18
+ quickMenuSignal: xe({ default: !1 })
19
+ }), Hn = f(
18
20
  ({
19
- children: e,
20
- reader: n,
21
- quickMenuOpen: r,
22
- onQuickMenuOpenChange: l
21
+ children: n,
22
+ reader: t,
23
+ quickMenuOpen: o,
24
+ onQuickMenuOpenChange: r
23
25
  }) => {
24
- const [, o] = re({
25
- default: r
26
- }), i = fe(l), c = ge(
26
+ const [, l] = se({
27
+ default: o
28
+ }), i = Ce(r), a = be(
27
29
  () => ({
28
- quickMenuSignal: o,
29
- reader: n
30
+ quickMenuSignal: l,
31
+ reader: t
30
32
  }),
31
- [o, n]
33
+ [l, t]
32
34
  );
33
- return M(() => {
34
- o.setValue(r);
35
- }, [r, o]), le(
36
- () => o.subject.pipe(be(i.current)),
37
- [o, i]
38
- ), /* @__PURE__ */ t(N.Provider, { value: c, children: e });
35
+ return Q(() => {
36
+ l.setValue(o);
37
+ }, [o, l]), ae(
38
+ () => l.subject.pipe(ke(i.current)),
39
+ [l, i]
40
+ ), /* @__PURE__ */ e(J.Provider, { value: a, children: n });
39
41
  }
40
- ), _e = "@prose-reader/react-reader", Ne = "1.186.0", We = w.forwardRef(function(n, r) {
41
- return /* @__PURE__ */ t(b, { variant: "ghost", "aria-label": "Close", ref: r, ...n, children: n.children ?? /* @__PURE__ */ t(Pe, {}) });
42
- }), W = w.forwardRef(function(n, r) {
42
+ ), Ge = D.forwardRef(function(t, o) {
43
+ return /* @__PURE__ */ e(m, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(ye, {}) });
44
+ }), L = D.forwardRef(function(t, o) {
43
45
  const {
44
- children: l,
45
- portalled: o = !0,
46
+ children: r,
47
+ portalled: l = !0,
46
48
  portalRef: i,
47
- backdrop: c = !0,
48
- ...d
49
- } = n;
50
- return /* @__PURE__ */ a(se, { disabled: !o, container: i, children: [
51
- c && /* @__PURE__ */ t(f.Backdrop, {}),
52
- /* @__PURE__ */ t(f.Positioner, { children: /* @__PURE__ */ t(f.Content, { ref: r, ...d, asChild: !1, children: l }) })
49
+ backdrop: a = !0,
50
+ ...h
51
+ } = t;
52
+ return /* @__PURE__ */ c(he, { disabled: !l, container: i, children: [
53
+ a && /* @__PURE__ */ e(k.Backdrop, {}),
54
+ /* @__PURE__ */ e(k.Positioner, { children: /* @__PURE__ */ e(k.Content, { ref: o, ...h, asChild: !1, children: r }) })
53
55
  ] });
54
- }), j = w.forwardRef(function(n, r) {
55
- return /* @__PURE__ */ t(
56
- f.CloseTrigger,
56
+ }), $ = D.forwardRef(function(t, o) {
57
+ return /* @__PURE__ */ e(
58
+ k.CloseTrigger,
57
59
  {
58
60
  position: "absolute",
59
61
  top: "2",
60
62
  insetEnd: "2",
61
- ...n,
63
+ ...t,
62
64
  asChild: !0,
63
- children: /* @__PURE__ */ t(We, { size: "sm", ref: r, children: n.children })
65
+ children: /* @__PURE__ */ e(Ge, { size: "sm", ref: o, children: t.children })
64
66
  }
65
67
  );
66
- }), V = f.Root, q = f.Footer, U = f.Header, Y = f.Body;
67
- f.Backdrop;
68
- const Q = f.Title;
69
- f.Description;
70
- f.Trigger;
71
- const G = f.ActionTrigger, je = p(
68
+ }), N = k.Root, F = k.Footer, H = k.Header, j = k.Body;
69
+ k.Backdrop;
70
+ const V = k.Title;
71
+ k.Description;
72
+ k.Trigger;
73
+ const Y = k.ActionTrigger, y = () => {
74
+ const { reader: n } = le(J);
75
+ return n;
76
+ }, ue = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, Z = (n) => !!n && "__PROSE_READER_ENHANCER_BOOKMARKS" in n, ge = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, Ke = f(
77
+ ({ onNavigate: n }) => {
78
+ const t = y(), o = ge(t) ? t : void 0, r = b(
79
+ () => o == null ? void 0 : o.annotations.highlights$.pipe(
80
+ ce(
81
+ (i) => o.pagination.locate(i)
82
+ )
83
+ ),
84
+ [o]
85
+ ), l = (i, a) => {
86
+ var h;
87
+ return /* @__PURE__ */ e(S.Item, { children: /* @__PURE__ */ c(
88
+ G,
89
+ {
90
+ href: "#",
91
+ onClick: () => {
92
+ n(), t == null || t.navigation.goToCfi(i.cfi ?? "");
93
+ },
94
+ children: [
95
+ (i.contents ?? [])[0] ? /* @__PURE__ */ e(S.Indicator, { asChild: !0, children: /* @__PURE__ */ e(X, {}) }) : /* @__PURE__ */ e(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(X, {}) }),
96
+ /* @__PURE__ */ c(P, { gap: 0, children: [
97
+ /* @__PURE__ */ e(p, { lineClamp: 2, fontSize: "md", children: i.selectionAsText ? i.selectionAsText ?? "" : /* @__PURE__ */ e("i", { children: /* @__PURE__ */ e("b", { children: "unknown (not loaded)" }) }) }),
98
+ /* @__PURE__ */ e(
99
+ p,
100
+ {
101
+ fontStyle: "italic",
102
+ fontWeight: "bold",
103
+ fontSize: "sm",
104
+ children: `Book page: ${((h = i.meta) == null ? void 0 : h.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
105
+ }
106
+ )
107
+ ] })
108
+ ]
109
+ }
110
+ ) }, a);
111
+ };
112
+ return /* @__PURE__ */ e(S.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: r == null ? void 0 : r.map(
113
+ (i, a) => l(i, a)
114
+ ) });
115
+ }
116
+ ), We = f(
117
+ ({
118
+ open: n,
119
+ setOpen: t,
120
+ onNavigate: o
121
+ }) => /* @__PURE__ */ e(
122
+ N,
123
+ {
124
+ lazyMount: !0,
125
+ placement: "center",
126
+ open: n,
127
+ onOpenChange: (r) => t(r.open),
128
+ size: { mdDown: "full", md: "lg" },
129
+ scrollBehavior: "inside",
130
+ children: /* @__PURE__ */ c(L, { height: "100%", children: [
131
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Annotations" }) }),
132
+ /* @__PURE__ */ e(j, { flex: 1, children: /* @__PURE__ */ e(Ke, { onNavigate: o }) }),
133
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(E, { variant: "outline", children: "Cancel" }) }) }),
134
+ /* @__PURE__ */ e($, {})
135
+ ] })
136
+ }
137
+ )
138
+ ), Xe = f(() => {
139
+ const n = y(), t = Z(n) ? n : void 0, o = b(() => n == null ? void 0 : n.spine.element$, [n]), r = b(
140
+ () => t == null ? void 0 : t.bookmarks.pages$,
141
+ [t]
142
+ ), l = b(
143
+ () => t == null ? void 0 : t.bookmarks.bookmarks$,
144
+ [t]
145
+ ), i = b(
146
+ () => n == null ? void 0 : n.pagination.locate(l ?? []),
147
+ [n, l]
148
+ );
149
+ return o ? /* @__PURE__ */ e(U, { children: Be(
150
+ r == null ? void 0 : r.map(
151
+ ({ isBookmarkable: a, absolutePosition: { left: h, top: u, width: s } }, g) => {
152
+ const d = i == null ? void 0 : i.find(
153
+ (x) => {
154
+ var C;
155
+ return ((C = x.meta) == null ? void 0 : C.absolutePageIndex) === g;
156
+ }
157
+ );
158
+ return a ? /* @__PURE__ */ e(
159
+ q,
160
+ {
161
+ present: !0,
162
+ lazyMount: !0,
163
+ animationName: { _open: "fade-in", _closed: "fade-out" },
164
+ animationDuration: "moderate",
165
+ children: /* @__PURE__ */ e(
166
+ A,
167
+ {
168
+ "data-bookmark-area": !0,
169
+ position: "absolute",
170
+ left: h + s,
171
+ transform: "translateX(-100%)",
172
+ top: u,
173
+ p: 2,
174
+ children: d ? /* @__PURE__ */ e(
175
+ m,
176
+ {
177
+ "aria-label": "bookmark",
178
+ onClick: () => {
179
+ d && (t == null || t.bookmarks.delete(
180
+ d == null ? void 0 : d.id
181
+ ));
182
+ },
183
+ size: "lg",
184
+ variant: "ghost",
185
+ _icon: { boxSize: "36px" },
186
+ children: /* @__PURE__ */ e(_e, {})
187
+ }
188
+ ) : /* @__PURE__ */ e(
189
+ m,
190
+ {
191
+ "aria-label": "bookmark",
192
+ onClick: () => {
193
+ t == null || t.bookmarks.bookmark(g);
194
+ },
195
+ size: "lg",
196
+ variant: "ghost",
197
+ _icon: { boxSize: "36px" },
198
+ children: /* @__PURE__ */ e(Me, {})
199
+ }
200
+ )
201
+ }
202
+ )
203
+ },
204
+ g
205
+ ) : null;
206
+ }
207
+ ),
208
+ o
209
+ ) }) : null;
210
+ }), Je = f(
211
+ ({ onNavigate: n }) => {
212
+ const t = y(), o = Z(t) ? t : void 0, r = b(
213
+ () => o == null ? void 0 : o.bookmarks.bookmarks$.pipe(
214
+ ce((i) => o.pagination.locate(i))
215
+ ),
216
+ [o]
217
+ ), l = (i, a) => {
218
+ var h, u, s, g, d;
219
+ return /* @__PURE__ */ c(S.Item, { justifyContent: "space-between", alignItems: "center", children: [
220
+ /* @__PURE__ */ e(
221
+ G,
222
+ {
223
+ href: "#",
224
+ onClick: () => {
225
+ n(), t == null || t.navigation.goToCfi(i.cfi ?? "");
226
+ },
227
+ children: /* @__PURE__ */ c(P, { gap: 0, children: [
228
+ /* @__PURE__ */ e(p, { fontSize: "md", children: `Book page: ${((h = i.meta) == null ? void 0 : h.absolutePageIndex) !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown"}` }),
229
+ /* @__PURE__ */ e(
230
+ p,
231
+ {
232
+ fontStyle: "italic",
233
+ fontWeight: "bold",
234
+ fontSize: "sm",
235
+ truncate: !0,
236
+ lineClamp: 2,
237
+ children: (s = (u = i.meta) == null ? void 0 : u.startNode) != null && s.textContent ? (d = (g = i.meta) == null ? void 0 : g.startNode) == null ? void 0 : d.textContent : "..."
238
+ }
239
+ )
240
+ ] })
241
+ }
242
+ ),
243
+ /* @__PURE__ */ e(
244
+ E,
245
+ {
246
+ colorPalette: "red",
247
+ variant: "solid",
248
+ size: "xs",
249
+ onClick: () => {
250
+ o == null || o.bookmarks.delete(i.id);
251
+ },
252
+ children: "Delete"
253
+ }
254
+ )
255
+ ] }, a);
256
+ };
257
+ return /* @__PURE__ */ e(S.Root, { overflowY: "auto", gap: 3, variant: "plain", overflow: "auto", children: r == null ? void 0 : r.map(
258
+ (i, a) => l(i, a)
259
+ ) });
260
+ }
261
+ ), Ze = f(
72
262
  ({
73
- open: e,
74
- setOpen: n
75
- }) => /* @__PURE__ */ t(
76
- V,
263
+ open: n,
264
+ setOpen: t,
265
+ onNavigate: o
266
+ }) => /* @__PURE__ */ e(
267
+ N,
77
268
  {
78
269
  lazyMount: !0,
79
270
  placement: "center",
80
- open: e,
81
- onOpenChange: (r) => n(r.open),
271
+ open: n,
272
+ onOpenChange: (r) => t(r.open),
82
273
  size: { mdDown: "full", md: "lg" },
83
274
  scrollBehavior: "inside",
84
- children: /* @__PURE__ */ a(W, { children: [
85
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Help" }) }),
86
- /* @__PURE__ */ a(Y, { overflowY: "auto", flex: 1, children: [
87
- /* @__PURE__ */ t(L, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
88
- /* @__PURE__ */ a(k, { mb: 1, children: [
89
- /* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(Te, {}) }),
275
+ children: /* @__PURE__ */ c(L, { height: "100%", children: [
276
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Bookmarks" }) }),
277
+ /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(Je, { onNavigate: o }) }),
278
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(E, { variant: "outline", children: "Cancel" }) }) }),
279
+ /* @__PURE__ */ e($, {})
280
+ ] })
281
+ }
282
+ )
283
+ ), en = "@prose-reader/react-reader", nn = "1.188.0", tn = f(
284
+ ({
285
+ open: n,
286
+ setOpen: t
287
+ }) => /* @__PURE__ */ e(
288
+ N,
289
+ {
290
+ lazyMount: !0,
291
+ placement: "center",
292
+ open: n,
293
+ onOpenChange: (o) => t(o.open),
294
+ size: { mdDown: "full", md: "lg" },
295
+ scrollBehavior: "inside",
296
+ children: /* @__PURE__ */ c(L, { children: [
297
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Help" }) }),
298
+ /* @__PURE__ */ c(j, { overflowY: "auto", flex: 1, children: [
299
+ /* @__PURE__ */ e(W, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
300
+ /* @__PURE__ */ c(O, { mb: 1, children: [
301
+ /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(Re, {}) }),
90
302
  " ",
91
- /* @__PURE__ */ t(m, { children: "Navigate to right page" })
303
+ /* @__PURE__ */ e(p, { children: "Navigate to right page" })
92
304
  ] }),
93
- /* @__PURE__ */ a(k, { mb: 1, children: [
94
- /* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(ke, {}) }),
305
+ /* @__PURE__ */ c(O, { mb: 1, children: [
306
+ /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(Oe, {}) }),
95
307
  " ",
96
- /* @__PURE__ */ t(m, { children: "Navigate to left page" })
308
+ /* @__PURE__ */ e(p, { children: "Navigate to left page" })
97
309
  ] }),
98
- /* @__PURE__ */ t(L, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
99
- /* @__PURE__ */ a(m, { children: [
100
- _e,
310
+ /* @__PURE__ */ e(W, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
311
+ /* @__PURE__ */ c(p, { children: [
312
+ en,
101
313
  " version: ",
102
- Ne
314
+ nn
103
315
  ] })
104
316
  ] }),
105
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
106
- /* @__PURE__ */ t(j, {})
317
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(E, { variant: "outline", children: "Cancel" }) }) }),
318
+ /* @__PURE__ */ e($, {})
107
319
  ] })
108
320
  }
109
321
  )
110
- ), O = () => {
111
- const { reader: e } = oe(N);
112
- return e;
113
- }, ce = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, D = () => {
114
- const e = O();
115
- return I(
116
- () => e ? Ce([e.pagination.state$, e.context.state$]).pipe(
117
- ie(([n, r]) => {
118
- var o;
119
- const l = (o = r.manifest) == null ? void 0 : o.spineItems.every(
322
+ ), B = () => {
323
+ const n = y();
324
+ return b(
325
+ () => n ? Se([n.pagination.state$, n.context.state$]).pipe(
326
+ de(([t, o]) => {
327
+ var l;
328
+ const r = (l = o.manifest) == null ? void 0 : l.spineItems.every(
120
329
  (i) => {
121
- var c;
122
- return (c = i.mediaType) == null ? void 0 : c.startsWith("image/");
330
+ var a;
331
+ return (a = i.mediaType) == null ? void 0 : a.startsWith("image/");
123
332
  }
124
333
  );
125
334
  return {
126
- ...n,
127
- hasChapters: !r.isFullyPrePaginated && !l
335
+ ...t,
336
+ hasChapters: !o.isFullyPrePaginated && !r
128
337
  };
129
338
  })
130
- ) : xe,
131
- [e]
339
+ ) : Ie,
340
+ [n]
132
341
  );
133
- }, Ve = () => {
134
- const e = D(), n = Math.floor(
135
- ((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100
136
- ), r = n > 0 ? n : 1;
137
- return (e == null ? void 0 : e.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ t(R, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ a(m, { fontSize: "sm", children: [
138
- r,
342
+ }, on = () => {
343
+ const n = B(), t = Math.floor(
344
+ ((n == null ? void 0 : n.percentageEstimateOfBook) ?? 0) * 100
345
+ ), o = t > 0 ? t : 1;
346
+ return (n == null ? void 0 : n.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ e(A, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ c(p, { fontSize: "sm", children: [
347
+ o,
139
348
  " %"
140
349
  ] }) });
141
- }, qe = () => {
142
- const [e, n] = T(/* @__PURE__ */ new Date());
143
- return M(() => {
144
- const r = setInterval(() => {
145
- n(/* @__PURE__ */ new Date());
350
+ }, rn = () => {
351
+ const [n, t] = w(/* @__PURE__ */ new Date());
352
+ return Q(() => {
353
+ const o = setInterval(() => {
354
+ t(/* @__PURE__ */ new Date());
146
355
  }, 6e4);
147
- return () => clearInterval(r);
148
- }, []), e;
149
- }, Ue = (e) => {
150
- const n = qe();
151
- return /* @__PURE__ */ t(m, { fontSize: "xs", ...e, children: n.toLocaleTimeString(navigator.language, {
356
+ return () => clearInterval(o);
357
+ }, []), n;
358
+ }, ln = (n) => {
359
+ const t = rn();
360
+ return /* @__PURE__ */ e(p, { fontSize: "xs", ...n, children: t.toLocaleTimeString(navigator.language, {
152
361
  hour: "2-digit",
153
362
  minute: "2-digit"
154
363
  }) });
155
- }, K = () => {
156
- const { quickMenuSignal: e } = oe(N);
157
- return [pe(e), e.setValue, e];
158
- }, Ye = () => {
159
- const [e] = K();
160
- return /* @__PURE__ */ t(
161
- R,
364
+ }, ee = () => {
365
+ const { quickMenuSignal: n } = le(J);
366
+ return [ve(n), n.setValue, n];
367
+ }, sn = () => {
368
+ const [n] = ee();
369
+ return /* @__PURE__ */ e(
370
+ A,
162
371
  {
163
372
  position: "absolute",
164
373
  left: 0,
165
374
  bottom: 0,
166
375
  p: 2,
167
- color: e ? void 0 : "colorPalette.contrast",
168
- children: /* @__PURE__ */ t(Ue, {})
376
+ color: n ? void 0 : "colorPalette.contrast",
377
+ children: /* @__PURE__ */ e(ln, {})
169
378
  }
170
379
  );
171
- }, Qe = w.forwardRef(
172
- function(n, r) {
380
+ }, an = D.forwardRef(
381
+ function(t, o) {
173
382
  const {
174
- showArrow: l,
175
- children: o,
383
+ showArrow: r,
384
+ children: l,
176
385
  portalled: i = !0,
177
- content: c,
178
- portalRef: d,
386
+ content: a,
387
+ portalRef: h,
179
388
  ...u
180
- } = n;
181
- return /* @__PURE__ */ a(
182
- y.Root,
389
+ } = t;
390
+ return /* @__PURE__ */ c(
391
+ z.Root,
183
392
  {
184
393
  ...u,
185
394
  positioning: { ...u.positioning, gutter: 4 },
186
395
  children: [
187
- /* @__PURE__ */ t(y.Trigger, { asChild: !0, children: o }),
188
- /* @__PURE__ */ t(se, { disabled: !i, container: d, children: /* @__PURE__ */ t(y.Positioner, { children: /* @__PURE__ */ a(
189
- y.Content,
396
+ /* @__PURE__ */ e(z.Trigger, { asChild: !0, children: l }),
397
+ /* @__PURE__ */ e(he, { disabled: !i, container: h, children: /* @__PURE__ */ e(z.Positioner, { children: /* @__PURE__ */ c(
398
+ z.Content,
190
399
  {
191
400
  width: "auto",
192
401
  px: "2",
193
402
  py: "1",
194
403
  textStyle: "xs",
195
404
  rounded: "sm",
196
- ref: r,
405
+ ref: o,
197
406
  children: [
198
- l && /* @__PURE__ */ t(y.Arrow, { children: /* @__PURE__ */ t(y.ArrowTip, {}) }),
199
- c
407
+ r && /* @__PURE__ */ e(z.Arrow, { children: /* @__PURE__ */ e(z.ArrowTip, {}) }),
408
+ a
200
409
  ]
201
410
  }
202
411
  ) }) })
@@ -204,84 +413,84 @@ const G = f.ActionTrigger, je = p(
204
413
  }
205
414
  );
206
415
  }
207
- ), Ge = w.forwardRef(function(n, r) {
208
- const { children: l, ...o } = n;
209
- return /* @__PURE__ */ t(Qe, { content: l, ...o, ref: r, children: /* @__PURE__ */ t(
210
- b,
416
+ ), cn = D.forwardRef(function(t, o) {
417
+ const { children: r, ...l } = t;
418
+ return /* @__PURE__ */ e(an, { content: r, ...l, ref: o, children: /* @__PURE__ */ e(
419
+ m,
211
420
  {
212
421
  variant: "ghost",
213
422
  "aria-label": "info",
214
423
  size: "2xs",
215
424
  colorPalette: "gray",
216
- children: /* @__PURE__ */ t(Me, {})
425
+ children: /* @__PURE__ */ e(je, {})
217
426
  }
218
427
  ) });
219
- }), Ke = w.forwardRef(function(n, r) {
220
- return /* @__PURE__ */ t(B.Track, { ...n, ref: r, children: /* @__PURE__ */ t(B.Range, {}) });
428
+ }), dn = D.forwardRef(function(t, o) {
429
+ return /* @__PURE__ */ e(_.Track, { ...t, ref: o, children: /* @__PURE__ */ e(_.Range, {}) });
221
430
  });
222
- w.forwardRef(function(n, r) {
223
- const { children: l, info: o, ...i } = n;
224
- return /* @__PURE__ */ a(B.Label, { ...i, ref: r, children: [
225
- l,
226
- o && /* @__PURE__ */ t(Ge, { children: o })
431
+ D.forwardRef(function(t, o) {
432
+ const { children: r, info: l, ...i } = t;
433
+ return /* @__PURE__ */ c(_.Label, { ...i, ref: o, children: [
434
+ r,
435
+ l && /* @__PURE__ */ e(cn, { children: l })
227
436
  ] });
228
437
  });
229
- const Xe = B.Root, Je = B.ValueText, X = () => {
230
- const e = D(), n = (e == null ? void 0 : e.numberOfTotalPages) === 1, r = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, l = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, o = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, i = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [c = 0, d = 0] = [
231
- o,
438
+ const hn = _.Root, un = _.ValueText, ne = () => {
439
+ const n = B(), t = (n == null ? void 0 : n.numberOfTotalPages) === 1, o = ((n == null ? void 0 : n.beginNumberOfPagesInSpineItem) ?? 0) > 1, r = ((n == null ? void 0 : n.endNumberOfPagesInSpineItem) ?? 0) > 1, l = (n != null && n.hasChapters ? n == null ? void 0 : n.beginPageIndexInSpineItem : n == null ? void 0 : n.beginAbsolutePageIndex) ?? 0, i = (n != null && n.hasChapters ? n == null ? void 0 : n.endPageIndexInSpineItem : n == null ? void 0 : n.endAbsolutePageIndex) ?? 0, [a = 0, h = 0] = [
440
+ l,
232
441
  i
233
- ].sort((g, h) => g - h), u = (e == null ? void 0 : e.beginPageIndexInSpineItem) !== (e == null ? void 0 : e.endPageIndexInSpineItem) || (e == null ? void 0 : e.beginSpineItemIndex) !== (e == null ? void 0 : e.endSpineItemIndex), s = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
442
+ ].sort((g, d) => g - d), u = (n == null ? void 0 : n.beginPageIndexInSpineItem) !== (n == null ? void 0 : n.endPageIndexInSpineItem) || (n == null ? void 0 : n.beginSpineItemIndex) !== (n == null ? void 0 : n.endSpineItemIndex), s = n != null && n.hasChapters ? n == null ? void 0 : n.beginNumberOfPagesInSpineItem : n == null ? void 0 : n.numberOfTotalPages;
234
443
  return {
235
- hasOnlyOnePage: n,
236
- beginPageIndex: o,
444
+ hasOnlyOnePage: t,
445
+ beginPageIndex: l,
237
446
  endPageIndex: i,
238
- isBeginWithinChapter: r,
239
- isEndWithinChapter: l,
447
+ isBeginWithinChapter: o,
448
+ isEndWithinChapter: r,
240
449
  beginAndEndAreDifferent: u,
241
450
  totalApproximatePages: s,
242
- leftPageIndex: c,
243
- rightPageIndex: d
451
+ leftPageIndex: a,
452
+ rightPageIndex: h
244
453
  };
245
- }, Ze = () => {
246
- const e = D(), {
247
- hasOnlyOnePage: n,
248
- leftPageIndex: r,
249
- rightPageIndex: l,
250
- totalApproximatePages: o,
454
+ }, gn = () => {
455
+ const n = B(), {
456
+ hasOnlyOnePage: t,
457
+ leftPageIndex: o,
458
+ rightPageIndex: r,
459
+ totalApproximatePages: l,
251
460
  beginAndEndAreDifferent: i
252
- } = X(), c = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), d = (s) => s != null && s.subChapter ? `${s.title} / ${d(s.subChapter)}` : (s == null ? void 0 : s.title) || "", u = d(e == null ? void 0 : e.beginChapterInfo);
253
- return /* @__PURE__ */ a(v, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
254
- /* @__PURE__ */ t(Xe, { value: c, size: "xs", width: 150, children: /* @__PURE__ */ a(k, { justifyContent: "space-between", children: [
255
- /* @__PURE__ */ t(Ke, { width: 110 }),
256
- /* @__PURE__ */ t(Je, { children: `${c}%` })
461
+ } = ne(), a = Math.round(((n == null ? void 0 : n.percentageEstimateOfBook) ?? 0) * 100), h = (s) => s != null && s.subChapter ? `${s.title} / ${h(s.subChapter)}` : (s == null ? void 0 : s.title) || "", u = h(n == null ? void 0 : n.beginChapterInfo);
462
+ return /* @__PURE__ */ c(P, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
463
+ /* @__PURE__ */ e(hn, { value: a, size: "xs", width: 150, children: /* @__PURE__ */ c(O, { justifyContent: "space-between", children: [
464
+ /* @__PURE__ */ e(dn, { width: 110 }),
465
+ /* @__PURE__ */ e(un, { children: `${a}%` })
257
466
  ] }) }),
258
- /* @__PURE__ */ t(m, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
259
- !n && /* @__PURE__ */ a(k, { children: [
260
- /* @__PURE__ */ t(m, { fontSize: "xs", children: i ? `${r + 1} - ${l + 1} of ${o}` : `${r + 1} of ${o}` }),
261
- !!(e != null && e.hasChapters) && /* @__PURE__ */ a(F, { children: [
262
- /* @__PURE__ */ t(m, { children: "-" }),
263
- /* @__PURE__ */ a(m, { fontSize: "xs", children: [
467
+ /* @__PURE__ */ e(p, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
468
+ !t && /* @__PURE__ */ c(O, { children: [
469
+ /* @__PURE__ */ e(p, { fontSize: "xs", children: i ? `${o + 1} - ${r + 1} of ${l}` : `${o + 1} of ${l}` }),
470
+ !!(n != null && n.hasChapters) && /* @__PURE__ */ c(U, { children: [
471
+ /* @__PURE__ */ e(p, { children: "-" }),
472
+ /* @__PURE__ */ c(p, { fontSize: "xs", children: [
264
473
  "(",
265
- ((e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0) + 1,
474
+ ((n == null ? void 0 : n.beginAbsolutePageIndex) ?? 0) + 1,
266
475
  ")"
267
476
  ] })
268
477
  ] })
269
478
  ] })
270
479
  ] });
271
- }, de = p(
480
+ }, pe = f(
272
481
  ({
273
- children: e,
274
- position: n,
275
- ...r
276
- }) => /* @__PURE__ */ t(
277
- $,
482
+ children: n,
483
+ position: t,
484
+ ...o
485
+ }) => /* @__PURE__ */ e(
486
+ q,
278
487
  {
279
488
  display: "flex",
280
489
  flexDirection: "row",
281
490
  width: "100%",
282
491
  position: "absolute",
283
- ...n === "bottom" ? { bottom: 0 } : { top: 0 },
284
- animationName: n === "bottom" ? {
492
+ ...t === "bottom" ? { bottom: 0 } : { top: 0 },
493
+ animationName: t === "bottom" ? {
285
494
  _open: "slide-from-bottom, fade-in",
286
495
  _closed: "slide-to-bottom, fade-out"
287
496
  } : {
@@ -294,12 +503,12 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
294
503
  justifyContent: "center",
295
504
  shadow: "md",
296
505
  p: 4,
297
- ...r,
298
- children: e
506
+ ...o,
507
+ children: n
299
508
  }
300
509
  )
301
- ), et = Ie(Ee), tt = p((e) => /* @__PURE__ */ t(
302
- R,
510
+ ), pn = Te(Ve), fn = f((n) => /* @__PURE__ */ e(
511
+ A,
303
512
  {
304
513
  display: "contents",
305
514
  css: {
@@ -307,8 +516,8 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
307
516
  "--bg-emphasized": "colors.bg.emphasized",
308
517
  "--color-solid": "colors.colorPalette.solid"
309
518
  },
310
- children: /* @__PURE__ */ t(
311
- et,
519
+ children: /* @__PURE__ */ e(
520
+ pn,
312
521
  {
313
522
  keyboard: !1,
314
523
  style: {
@@ -343,394 +552,376 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
343
552
  height: "24px",
344
553
  top: "50%",
345
554
  borderColor: "var(--color-solid)",
346
- transform: `translate(${e.reverse ? "50%" : "-50%"}, -50%)`,
555
+ transform: `translate(${n.reverse ? "50%" : "-50%"}, -50%)`,
347
556
  backgroundColor: "var(--bg)",
348
557
  marginTop: "0px"
349
558
  }
350
559
  },
351
- ...e
560
+ ...n
352
561
  }
353
562
  )
354
563
  }
355
- )), nt = () => {
356
- const e = D(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: r, totalApproximatePages: l = 0 } = X(), o = n ? Math.floor((r || 0) / 2) : r, [i, c] = re({
357
- default: o || 0
358
- }), d = 0, u = Math.max(
564
+ )), mn = () => {
565
+ const n = B(), t = n == null ? void 0 : n.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = ne(), l = t ? Math.floor((o || 0) / 2) : o, [i, a] = se({
566
+ default: l || 0
567
+ }), h = 0, u = Math.max(
359
568
  0,
360
- n ? Math.floor((l - 1) / 2) : l - 1
569
+ t ? Math.floor((r - 1) / 2) : r - 1
361
570
  );
362
- return M(() => {
363
- c.setValue(o || 0);
364
- }, [o, c]), {
571
+ return Q(() => {
572
+ a.setValue(l || 0);
573
+ }, [l, a]), {
365
574
  value: i,
366
- valueSignal: c,
367
- min: d,
575
+ valueSignal: a,
576
+ min: h,
368
577
  max: u
369
578
  };
370
- }, ot = () => {
371
- const e = O(), n = D(), { manifest: r } = I(() => e == null ? void 0 : e.context.state$, []) ?? {}, l = (r == null ? void 0 : r.readingDirection) === "rtl", o = n == null ? void 0 : n.isUsingSpread, { totalApproximatePages: i = 0, isBeginWithinChapter: c } = X(), d = 1, u = c, { value: s, valueSignal: g, min: h, max: S } = nt(), P = H(
372
- (x) => {
373
- const [C = 0] = Array.isArray(x) ? x : [x];
374
- g.setValue(C);
375
- const A = o ? Math.floor(C) * 2 : Math.floor(C);
376
- u ? e == null || e.navigation.goToPageOfSpineItem({
377
- pageIndex: A,
378
- spineItemId: e.pagination.getState().beginSpineItemIndex ?? 0,
579
+ }, bn = (n) => {
580
+ const t = y(), o = B(), { manifest: r } = b(() => t == null ? void 0 : t.context.state$, []) ?? {}, l = (r == null ? void 0 : r.readingDirection) === "rtl", i = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: a = 0, isBeginWithinChapter: h } = ne(), u = 1, s = h, { value: g, valueSignal: d, min: x, max: C } = mn(), T = M(
581
+ (v) => {
582
+ const [R = 0] = Array.isArray(v) ? v : [v];
583
+ d.setValue(R);
584
+ const I = i ? Math.floor(R) * 2 : Math.floor(R);
585
+ s ? t == null || t.navigation.goToPageOfSpineItem({
586
+ pageIndex: I,
587
+ spineItemId: t.pagination.getState().beginSpineItemIndex ?? 0,
379
588
  animation: !1
380
- }) : e == null || e.navigation.goToAbsolutePageIndex({
381
- absolutePageIndex: A,
589
+ }) : t == null || t.navigation.goToAbsolutePageIndex({
590
+ absolutePageIndex: I,
382
591
  animation: !1
383
592
  });
384
593
  },
385
- [e, o, g, u]
594
+ [t, i, d, s]
386
595
  );
387
- return le(
388
- () => e == null ? void 0 : e.navigation.throttleLock({
596
+ return ae(
597
+ () => t == null ? void 0 : t.navigation.throttleLock({
389
598
  duration: 100,
390
- trigger: g.subject
599
+ trigger: d.subject
391
600
  }),
392
- [e, g]
393
- ), i === 1 || o && i === 2 ? null : /* @__PURE__ */ t(
394
- tt,
601
+ [t, d]
602
+ ), a === 1 || i && a === 2 ? null : /* @__PURE__ */ e(
603
+ fn,
395
604
  {
396
- value: [s],
397
- max: S,
398
- min: h,
605
+ value: [g],
606
+ max: C,
607
+ min: x,
399
608
  reverse: l,
400
- step: d,
401
- onChange: P
609
+ step: u,
610
+ onChange: T,
611
+ ...n
402
612
  }
403
613
  );
404
- }, rt = p(
614
+ }, xn = f(
405
615
  ({
406
- open: e,
407
- onTableOfContentsClick: n,
408
- onHelpClick: r,
409
- onSearchClick: l
616
+ open: n,
617
+ onItemClick: t
410
618
  }) => {
411
- const o = O(), i = I(() => o == null ? void 0 : o.navigation.state$, [o]), c = I(() => o == null ? void 0 : o.settings.values$, [o]), d = (c == null ? void 0 : c.computedPageTurnDirection) === "vertical", [u, s] = T(!0);
412
- return /* @__PURE__ */ t(
413
- de,
414
- {
415
- present: e,
416
- position: "bottom",
417
- children: /* @__PURE__ */ a(
418
- v,
619
+ const o = y(), r = b(() => o == null ? void 0 : o.navigation.state$, [o]), l = b(() => o == null ? void 0 : o.settings.values$, [o]), i = (l == null ? void 0 : l.computedPageTurnDirection) === "vertical", [a, h] = w(!0);
620
+ return /* @__PURE__ */ e(pe, { present: n, position: "bottom", children: /* @__PURE__ */ c(P, { flex: 1, overflow: "auto", children: [
621
+ /* @__PURE__ */ c(O, { flex: 1, alignItems: "center", justifyContent: "center", children: [
622
+ /* @__PURE__ */ e(
623
+ m,
624
+ {
625
+ "aria-label": "left",
626
+ size: "lg",
627
+ variant: "ghost",
628
+ flexShrink: 0,
629
+ onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
630
+ disabled: !(r != null && r.canGoLeftSpineItem) && !(r != null && r.canGoTopSpineItem),
631
+ children: i ? /* @__PURE__ */ e($e, {}) : /* @__PURE__ */ e(Ne, {})
632
+ }
633
+ ),
634
+ /* @__PURE__ */ c(
635
+ P,
419
636
  {
420
637
  flex: 1,
638
+ maxW: 400,
639
+ gap: 2,
640
+ alignItems: "center",
641
+ overflow: "auto",
642
+ px: 4,
421
643
  children: [
422
- /* @__PURE__ */ a(k, { flex: 1, alignItems: "center", justifyContent: "center", children: [
423
- /* @__PURE__ */ t(
424
- b,
425
- {
426
- "aria-label": "left",
427
- size: "lg",
428
- variant: "ghost",
429
- flexShrink: 0,
430
- onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
431
- disabled: !(i != null && i.canGoLeftSpineItem) && !(i != null && i.canGoTopSpineItem),
432
- children: d ? /* @__PURE__ */ t(De, {}) : /* @__PURE__ */ t(Ae, {})
433
- }
434
- ),
435
- /* @__PURE__ */ a(
436
- v,
437
- {
438
- flex: 1,
439
- maxW: 400,
440
- gap: 2,
441
- alignItems: "center",
442
- overflow: "visible",
443
- px: 4,
444
- children: [
445
- /* @__PURE__ */ t(Ze, {}),
446
- /* @__PURE__ */ t(R, { height: 5, maxW: 300, width: "100%", overflow: "visible", children: /* @__PURE__ */ t(ot, {}) })
447
- ]
644
+ /* @__PURE__ */ e(gn, {}),
645
+ /* @__PURE__ */ e(
646
+ bn,
647
+ {
648
+ style: {
649
+ width: "100%",
650
+ maxWidth: "300px",
651
+ height: "35px"
448
652
  }
449
- ),
450
- /* @__PURE__ */ t(
451
- b,
653
+ }
654
+ )
655
+ ]
656
+ }
657
+ ),
658
+ /* @__PURE__ */ e(
659
+ m,
660
+ {
661
+ "aria-label": "right",
662
+ size: "lg",
663
+ flexShrink: 0,
664
+ variant: "ghost",
665
+ disabled: !(r != null && r.canGoRightSpineItem) && !(r != null && r.canGoBottomSpineItem),
666
+ onClick: () => {
667
+ o == null || o.navigation.goToRightOrBottomSpineItem();
668
+ },
669
+ children: i ? /* @__PURE__ */ e(Fe, {}) : /* @__PURE__ */ e(He, {})
670
+ }
671
+ )
672
+ ] }),
673
+ /* @__PURE__ */ e(O, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ c(
674
+ K.Root,
675
+ {
676
+ open: a,
677
+ flex: 1,
678
+ onOpenChange: ({ open: u }) => {
679
+ h(u);
680
+ },
681
+ children: [
682
+ /* @__PURE__ */ e(
683
+ K.Trigger,
684
+ {
685
+ paddingY: "3",
686
+ width: "100%",
687
+ display: "flex",
688
+ justifyContent: "center",
689
+ children: /* @__PURE__ */ e(
690
+ De,
452
691
  {
453
- "aria-label": "right",
454
- size: "lg",
455
- flexShrink: 0,
456
- variant: "ghost",
457
- disabled: !(i != null && i.canGoRightSpineItem) && !(i != null && i.canGoBottomSpineItem),
458
- onClick: () => {
459
- o == null || o.navigation.goToRightOrBottomSpineItem();
460
- },
461
- children: d ? /* @__PURE__ */ t(ze, {}) : /* @__PURE__ */ t(Be, {})
692
+ style: {
693
+ transform: a ? "rotate(0deg)" : "rotate(180deg)"
694
+ }
462
695
  }
463
696
  )
464
- ] }),
465
- /* @__PURE__ */ t(
466
- k,
697
+ }
698
+ ),
699
+ /* @__PURE__ */ c(K.Content, { display: "flex", justifyContent: "center", children: [
700
+ /* @__PURE__ */ e(
701
+ m,
467
702
  {
468
- alignItems: "center",
469
- justifyContent: "center",
470
- children: /* @__PURE__ */ a(
471
- E.Root,
472
- {
473
- open: u,
474
- flex: 1,
475
- onOpenChange: ({ open: g }) => {
476
- s(g);
477
- },
478
- children: [
479
- /* @__PURE__ */ t(
480
- E.Trigger,
481
- {
482
- paddingY: "3",
483
- width: "100%",
484
- display: "flex",
485
- justifyContent: "center",
486
- children: /* @__PURE__ */ t(
487
- we,
488
- {
489
- style: {
490
- transform: u ? "rotate(0deg)" : "rotate(180deg)"
491
- }
492
- }
493
- )
494
- }
495
- ),
496
- /* @__PURE__ */ a(
497
- E.Content,
498
- {
499
- display: "flex",
500
- justifyContent: "center",
501
- gap: 2,
502
- children: [
503
- /* @__PURE__ */ t(
504
- b,
505
- {
506
- "aria-label": "Help",
507
- size: "lg",
508
- variant: "ghost",
509
- onClick: r,
510
- children: /* @__PURE__ */ t(ye, {})
511
- }
512
- ),
513
- /* @__PURE__ */ t(
514
- b,
515
- {
516
- "aria-label": "Table of contents",
517
- size: "lg",
518
- variant: "ghost",
519
- onClick: n,
520
- children: /* @__PURE__ */ t(Re, {})
521
- }
522
- ),
523
- ce(o) && /* @__PURE__ */ t(
524
- b,
525
- {
526
- "aria-label": "Search",
527
- size: "lg",
528
- variant: "ghost",
529
- onClick: l,
530
- children: /* @__PURE__ */ t(Oe, {})
531
- }
532
- )
533
- ]
534
- }
535
- )
536
- ]
537
- }
538
- )
703
+ "aria-label": "Help",
704
+ size: "lg",
705
+ variant: "ghost",
706
+ onClick: () => t("help"),
707
+ children: /* @__PURE__ */ e(ze, {})
708
+ }
709
+ ),
710
+ /* @__PURE__ */ e(
711
+ m,
712
+ {
713
+ "aria-label": "Table of contents",
714
+ size: "lg",
715
+ variant: "ghost",
716
+ onClick: () => t("toc"),
717
+ children: /* @__PURE__ */ e(Ae, {})
718
+ }
719
+ ),
720
+ ue(o) && /* @__PURE__ */ e(
721
+ m,
722
+ {
723
+ "aria-label": "Search",
724
+ size: "lg",
725
+ variant: "ghost",
726
+ onClick: () => t("search"),
727
+ children: /* @__PURE__ */ e(Ee, {})
728
+ }
729
+ ),
730
+ Z(o) && /* @__PURE__ */ e(
731
+ m,
732
+ {
733
+ "aria-label": "Search",
734
+ size: "lg",
735
+ variant: "ghost",
736
+ onClick: () => t("bookmarks"),
737
+ children: /* @__PURE__ */ e(Le, {})
738
+ }
739
+ ),
740
+ ge(o) && /* @__PURE__ */ e(
741
+ m,
742
+ {
743
+ "aria-label": "Search",
744
+ size: "lg",
745
+ variant: "ghost",
746
+ onClick: () => t("annotations"),
747
+ children: /* @__PURE__ */ e(X, {})
539
748
  }
540
749
  )
541
- ]
542
- }
543
- )
544
- }
545
- );
750
+ ] })
751
+ ]
752
+ }
753
+ ) })
754
+ ] }) });
546
755
  }
547
- ), lt = () => {
548
- const [e, n] = T(!1), r = H(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
549
- n(!1);
756
+ ), Cn = () => {
757
+ const [n, t] = w(!1), o = M(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
758
+ t(!1);
550
759
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
551
- n(!0);
760
+ t(!0);
552
761
  }), []);
553
- return M(() => {
554
- function l() {
555
- n(!!document.fullscreenElement);
762
+ return Q(() => {
763
+ function r() {
764
+ t(!!document.fullscreenElement);
556
765
  }
557
- return document.addEventListener("fullscreenchange", l), () => {
558
- document.removeEventListener("fullscreenchange", l);
766
+ return document.addEventListener("fullscreenchange", r), () => {
767
+ document.removeEventListener("fullscreenchange", r);
559
768
  };
560
769
  }, []), {
561
- isFullscreen: e,
562
- onToggleFullscreenClick: r
770
+ isFullscreen: n,
771
+ onToggleFullscreenClick: o
563
772
  };
564
- }, it = ({
565
- open: e,
566
- onBackClick: n,
567
- onMoreClick: r
568
- }) => {
569
- const l = O(), o = I(() => l == null ? void 0 : l.context.manifest$, [l]), { isFullscreen: i, onToggleFullscreenClick: c } = lt();
570
- return /* @__PURE__ */ a(
571
- de,
572
- {
573
- present: e,
574
- position: "top",
575
- height: "80px",
576
- justifyContent: "space-between",
577
- children: [
578
- /* @__PURE__ */ t(
579
- b,
580
- {
581
- "aria-label": "left",
582
- size: "lg",
583
- variant: "ghost",
584
- flexShrink: 0,
585
- onClick: n,
586
- children: /* @__PURE__ */ t(Le, {})
587
- }
588
- ),
589
- /* @__PURE__ */ t(
590
- v,
591
- {
592
- flex: 1,
593
- maxW: 600,
594
- gap: 1,
595
- alignItems: "center",
596
- overflow: "auto",
597
- px: 4,
598
- children: /* @__PURE__ */ t(m, { truncate: !0, maxWidth: "100%", children: o == null ? void 0 : o.title })
599
- }
600
- ),
601
- /* @__PURE__ */ a(k, { children: [
602
- /* @__PURE__ */ t(
603
- b,
773
+ }, vn = f(
774
+ ({
775
+ open: n,
776
+ onItemClick: t
777
+ }) => {
778
+ const o = y(), r = b(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: l, onToggleFullscreenClick: i } = Cn();
779
+ return /* @__PURE__ */ c(
780
+ pe,
781
+ {
782
+ present: n,
783
+ position: "top",
784
+ height: "80px",
785
+ justifyContent: "space-between",
786
+ children: [
787
+ /* @__PURE__ */ e(
788
+ m,
604
789
  {
605
- "aria-label": "right",
790
+ "aria-label": "left",
606
791
  size: "lg",
607
- flexShrink: 0,
608
792
  variant: "ghost",
609
- onClick: r,
610
- children: /* @__PURE__ */ t($e, {})
793
+ flexShrink: 0,
794
+ onClick: () => t("back"),
795
+ children: /* @__PURE__ */ e(Ye, {})
611
796
  }
612
797
  ),
613
- /* @__PURE__ */ t(
614
- b,
798
+ /* @__PURE__ */ e(
799
+ P,
615
800
  {
616
- "aria-label": "right",
617
- size: "lg",
618
- flexShrink: 0,
619
- variant: "ghost",
620
- onClick: c,
621
- children: i ? /* @__PURE__ */ t(Fe, {}) : /* @__PURE__ */ t(He, {})
801
+ flex: 1,
802
+ maxW: 600,
803
+ gap: 1,
804
+ alignItems: "center",
805
+ overflow: "auto",
806
+ px: 4,
807
+ children: /* @__PURE__ */ e(p, { truncate: !0, maxWidth: "100%", children: r == null ? void 0 : r.title })
622
808
  }
623
- )
624
- ] })
625
- ]
626
- }
627
- );
628
- }, st = p(
809
+ ),
810
+ /* @__PURE__ */ c(O, { children: [
811
+ /* @__PURE__ */ e(
812
+ m,
813
+ {
814
+ "aria-label": "right",
815
+ size: "lg",
816
+ flexShrink: 0,
817
+ variant: "ghost",
818
+ onClick: () => t("more"),
819
+ children: /* @__PURE__ */ e(qe, {})
820
+ }
821
+ ),
822
+ /* @__PURE__ */ e(
823
+ m,
824
+ {
825
+ "aria-label": "right",
826
+ size: "lg",
827
+ flexShrink: 0,
828
+ variant: "ghost",
829
+ onClick: i,
830
+ children: l ? /* @__PURE__ */ e(Ue, {}) : /* @__PURE__ */ e(Qe, {})
831
+ }
832
+ )
833
+ ] })
834
+ ]
835
+ }
836
+ );
837
+ }
838
+ ), kn = f(
629
839
  ({
630
- onBackClick: e,
631
- onMoreClick: n,
632
- onTableOfContentsClick: r,
633
- onHelpClick: l,
634
- onSearchClick: o
840
+ onItemClick: n
635
841
  }) => {
636
- const [i] = K();
637
- return /* @__PURE__ */ a(F, { children: [
638
- /* @__PURE__ */ t(
639
- it,
640
- {
641
- open: i,
642
- onBackClick: e,
643
- onMoreClick: n
644
- }
645
- ),
646
- /* @__PURE__ */ t(
647
- rt,
648
- {
649
- open: i,
650
- onTableOfContentsClick: r,
651
- onHelpClick: l,
652
- onSearchClick: o
653
- }
654
- )
842
+ const [t] = ee();
843
+ return /* @__PURE__ */ c(U, { children: [
844
+ /* @__PURE__ */ e(vn, { open: t, onItemClick: n }),
845
+ /* @__PURE__ */ e(xn, { open: t, onItemClick: n })
655
846
  ] });
656
847
  }
657
- ), at = p(
848
+ ), In = f(
658
849
  ({
659
- contextText: e = "",
660
- startOffset: n = 0,
661
- text: r,
662
- cfi: l = "#",
663
- onClick: o,
850
+ contextText: n = "",
851
+ startOffset: t = 0,
852
+ text: o,
853
+ cfi: r = "#",
854
+ onClick: l,
664
855
  absolutePageIndex: i
665
856
  }) => {
666
- const d = e.substring(
667
- Math.max(n - 15, 0),
668
- Math.max(n, 0)
669
- ), u = e.substring(
670
- Math.min(n + r.length, e.length - 1),
857
+ const h = n.substring(
858
+ Math.max(t - 15, 0),
859
+ Math.max(t, 0)
860
+ ), u = n.substring(
861
+ Math.min(t + o.length, n.length - 1),
671
862
  Math.min(
672
- n + r.length + 15,
673
- e.length - 1
863
+ t + o.length + 15,
864
+ n.length - 1
674
865
  )
675
866
  );
676
- return /* @__PURE__ */ a(
677
- ae,
867
+ return /* @__PURE__ */ c(
868
+ G,
678
869
  {
679
- href: l,
870
+ href: r,
680
871
  style: { margin: 5, overflow: "hidden" },
681
872
  onClick: (s) => {
682
- s.preventDefault(), o(l);
873
+ s.preventDefault(), l(r);
683
874
  },
684
875
  display: "flex",
685
876
  flexDirection: "column",
686
877
  alignItems: "flex-start",
687
878
  gap: 0,
688
879
  children: [
689
- /* @__PURE__ */ a(m, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
880
+ /* @__PURE__ */ c(p, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
690
881
  '"',
691
- d,
692
- /* @__PURE__ */ t("b", { children: r }),
882
+ h,
883
+ /* @__PURE__ */ e("b", { children: o }),
693
884
  u,
694
885
  '"'
695
886
  ] }),
696
- /* @__PURE__ */ t(m, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${i !== void 0 ? i + 1 : "unknown (not loaded)"}` })
887
+ /* @__PURE__ */ e(p, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${i !== void 0 ? i + 1 : "unknown (not loaded)"}` })
697
888
  ]
698
889
  }
699
890
  );
700
891
  }
701
- ), ct = p(
892
+ ), Sn = f(
702
893
  ({
703
- onNavigate: e
894
+ onNavigate: n
704
895
  }) => {
705
- const [n, r] = T(""), l = O(), o = ce(l) ? l : void 0, i = (h) => {
706
- r(h.target.value);
707
- }, c = H(
708
- (h) => {
709
- e(), l == null || l.navigation.goToCfi(h);
896
+ const [t, o] = w(""), r = y(), l = ue(r) ? r : void 0, i = (d) => {
897
+ o(d.target.value);
898
+ }, a = M(
899
+ (d) => {
900
+ n(), r == null || r.navigation.goToCfi(d);
710
901
  },
711
- [l, e]
712
- ), d = I(
713
- () => o == null ? void 0 : o.search.search(n).pipe(
714
- ie((h) => ({ type: "end", data: h })),
715
- ve({ type: "start" })
902
+ [r, n]
903
+ ), h = b(
904
+ () => l == null ? void 0 : l.search.search(t).pipe(
905
+ de((d) => ({ type: "end", data: d })),
906
+ Pe({ type: "start" })
716
907
  ),
717
- [l, n]
718
- ), u = (d == null ? void 0 : d.type) === "start", s = (d == null ? void 0 : d.type) === "end" ? d.data : [], g = I(
719
- () => l == null ? void 0 : l.pagination.locate(s.slice(0, 100)),
908
+ [r, t]
909
+ ), u = (h == null ? void 0 : h.type) === "start", s = (h == null ? void 0 : h.type) === "end" ? h.data : [], g = b(
910
+ () => r == null ? void 0 : r.pagination.locate(s.slice(0, 100)),
720
911
  [s]
721
912
  );
722
- return /* @__PURE__ */ a(v, { flex: 1, height: "100%", children: [
723
- /* @__PURE__ */ t(R, { px: 4, children: /* @__PURE__ */ t(
724
- Se,
913
+ return /* @__PURE__ */ c(P, { flex: 1, height: "100%", children: [
914
+ /* @__PURE__ */ e(A, { px: 4, children: /* @__PURE__ */ e(
915
+ we,
725
916
  {
726
917
  placeholder: "Type something...",
727
- value: n,
918
+ value: t,
728
919
  onChange: i,
729
920
  borderRadius: 0
730
921
  }
731
922
  ) }),
732
- /* @__PURE__ */ a(
733
- R,
923
+ /* @__PURE__ */ c(
924
+ A,
734
925
  {
735
926
  px: 4,
736
927
  pb: 4,
@@ -738,27 +929,27 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
738
929
  flex: 1,
739
930
  style: { overflow: "hidden", overflowY: "auto" },
740
931
  children: [
741
- u && /* @__PURE__ */ t(m, { children: "Searching ..." }),
742
- !u && s.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
743
- !u && s.length >= 0 && /* @__PURE__ */ a(v, { children: [
744
- /* @__PURE__ */ a(L, { as: "h2", size: "md", children: [
932
+ u && /* @__PURE__ */ e(p, { children: "Searching ..." }),
933
+ !u && s.length === 0 && /* @__PURE__ */ e("p", { children: "There are no results" }),
934
+ !u && s.length >= 0 && /* @__PURE__ */ c(P, { children: [
935
+ /* @__PURE__ */ c(W, { as: "h2", size: "md", children: [
745
936
  s.length,
746
937
  " result(s)"
747
938
  ] }),
748
- /* @__PURE__ */ t(v, { gap: 0, children: g == null ? void 0 : g.map((h, S) => {
749
- var P, x, C, A, J, Z, ee;
750
- return /* @__PURE__ */ t(
751
- at,
939
+ /* @__PURE__ */ e(P, { gap: 0, children: g == null ? void 0 : g.map((d, x) => {
940
+ var C, T, v, R, I, te, oe;
941
+ return /* @__PURE__ */ e(
942
+ In,
752
943
  {
753
- contextText: ((C = (x = (P = h.meta) == null ? void 0 : P.range) == null ? void 0 : x.startContainer.parentElement) == null ? void 0 : C.textContent) ?? "",
754
- pageIndex: (A = h.meta) == null ? void 0 : A.itemPageIndex,
755
- startOffset: ((Z = (J = h.meta) == null ? void 0 : J.range) == null ? void 0 : Z.startOffset) ?? 0,
756
- text: n,
757
- cfi: h.cfi,
758
- onClick: c,
759
- absolutePageIndex: (ee = h.meta) == null ? void 0 : ee.absolutePageIndex
944
+ contextText: ((v = (T = (C = d.meta) == null ? void 0 : C.range) == null ? void 0 : T.startContainer.parentElement) == null ? void 0 : v.textContent) ?? "",
945
+ pageIndex: (R = d.meta) == null ? void 0 : R.itemPageIndex,
946
+ startOffset: ((te = (I = d.meta) == null ? void 0 : I.range) == null ? void 0 : te.startOffset) ?? 0,
947
+ text: t,
948
+ cfi: d.cfi,
949
+ onClick: a,
950
+ absolutePageIndex: (oe = d.meta) == null ? void 0 : oe.absolutePageIndex
760
951
  },
761
- S
952
+ x
762
953
  );
763
954
  }) })
764
955
  ] })
@@ -767,62 +958,62 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
767
958
  )
768
959
  ] });
769
960
  }
770
- ), dt = p(
961
+ ), Pn = f(
771
962
  ({
772
- open: e,
773
- setOpen: n,
774
- onNavigate: r
775
- }) => /* @__PURE__ */ t(
776
- V,
963
+ open: n,
964
+ setOpen: t,
965
+ onNavigate: o
966
+ }) => /* @__PURE__ */ e(
967
+ N,
777
968
  {
778
969
  lazyMount: !0,
779
970
  placement: "center",
780
- open: e,
781
- onOpenChange: (l) => n(l.open),
971
+ open: n,
972
+ onOpenChange: (r) => t(r.open),
782
973
  size: { mdDown: "full", md: "lg" },
783
974
  scrollBehavior: "inside",
784
- children: /* @__PURE__ */ a(W, { height: "100%", children: [
785
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Search" }) }),
786
- /* @__PURE__ */ t(Y, { flex: 1, children: /* @__PURE__ */ t(ct, { onNavigate: r }) }),
787
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
788
- /* @__PURE__ */ t(j, {})
975
+ children: /* @__PURE__ */ c(L, { height: "100%", children: [
976
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Search" }) }),
977
+ /* @__PURE__ */ e(j, { flex: 1, children: /* @__PURE__ */ e(Sn, { onNavigate: o }) }),
978
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(E, { variant: "outline", children: "Cancel" }) }) }),
979
+ /* @__PURE__ */ e($, {})
789
980
  ] })
790
981
  }
791
982
  )
792
- ), ht = p(
983
+ ), Tn = f(
793
984
  ({
794
- onNavigate: e
985
+ onNavigate: n
795
986
  }) => {
796
- const n = O(), { manifest: r, assumedRenditionLayout: l } = I(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, { nav: o } = r ?? {}, i = D();
797
- o != null && o.toc;
798
- const { beginSpineItemIndex: c, beginPageIndexInSpineItem: d } = i ?? {}, u = (l === "reflowable" ? d : c) || 0;
799
- console.log({ assumedRenditionLayout: l, currentSpineItemOrChapterPageIndex: u });
987
+ const t = y(), { manifest: o, assumedRenditionLayout: r } = b(() => t == null ? void 0 : t.context.state$, [t]) ?? {}, { nav: l } = o ?? {}, i = B();
988
+ l != null && l.toc;
989
+ const { beginSpineItemIndex: a, beginPageIndexInSpineItem: h } = i ?? {}, u = (r === "reflowable" ? h : a) || 0;
990
+ console.log({ assumedRenditionLayout: r, currentSpineItemOrChapterPageIndex: u });
800
991
  let s = i == null ? void 0 : i.beginChapterInfo;
801
992
  for (; s != null && s.subChapter; )
802
993
  s = s == null ? void 0 : s.subChapter;
803
- const g = (h, S, P) => /* @__PURE__ */ a(he.Fragment, { children: [
804
- /* @__PURE__ */ t(
805
- z.Item,
994
+ const g = (d, x, C) => /* @__PURE__ */ c(fe.Fragment, { children: [
995
+ /* @__PURE__ */ e(
996
+ S.Item,
806
997
  {
807
- pl: 4 * (P + 1),
998
+ pl: 4 * (C + 1),
808
999
  style: {
809
1000
  display: "flex",
810
1001
  alignItems: "center"
811
1002
  },
812
- children: /* @__PURE__ */ a(
813
- ae,
1003
+ children: /* @__PURE__ */ c(
1004
+ G,
814
1005
  {
815
1006
  onClick: () => {
816
- e(), n == null || n.navigation.goToUrl(h.href);
1007
+ n(), t == null || t.navigation.goToUrl(d.href);
817
1008
  },
818
1009
  href: "#",
819
1010
  children: [
820
- (s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ t(z.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ne, {}) }),
821
- (s == null ? void 0 : s.path) !== h.path && /* @__PURE__ */ t(z.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ne, {}) }),
822
- /* @__PURE__ */ a(v, { gap: 0, children: [
823
- /* @__PURE__ */ t(m, { fontSize: "md", children: h.title || h.path }),
824
- (s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ t(
825
- m,
1011
+ (s == null ? void 0 : s.path) === d.path && /* @__PURE__ */ e(S.Indicator, { asChild: !0, children: /* @__PURE__ */ e(ie, {}) }),
1012
+ (s == null ? void 0 : s.path) !== d.path && /* @__PURE__ */ e(S.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(ie, {}) }),
1013
+ /* @__PURE__ */ c(P, { gap: 0, children: [
1014
+ /* @__PURE__ */ e(p, { fontSize: "md", children: d.title || d.path }),
1015
+ (s == null ? void 0 : s.path) === d.path && /* @__PURE__ */ e(
1016
+ p,
826
1017
  {
827
1018
  fontStyle: "italic",
828
1019
  fontWeight: "bold",
@@ -836,96 +1027,106 @@ const Xe = B.Root, Je = B.ValueText, X = () => {
836
1027
  )
837
1028
  }
838
1029
  ),
839
- h.contents.length > 0 && /* @__PURE__ */ t(z.Root, { as: "div", gap: 2, children: h.contents.map(
840
- (x, C) => g(x, C, P + 1)
1030
+ d.contents.length > 0 && /* @__PURE__ */ e(S.Root, { as: "div", gap: 2, children: d.contents.map(
1031
+ (T, v) => g(T, v, C + 1)
841
1032
  ) })
842
- ] }, S);
843
- return /* @__PURE__ */ t(z.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: o == null ? void 0 : o.toc.map((h, S) => g(h, S, 0)) });
1033
+ ] }, x);
1034
+ return /* @__PURE__ */ e(S.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: l == null ? void 0 : l.toc.map((d, x) => g(d, x, 0)) });
844
1035
  }
845
- ), ut = p(
1036
+ ), wn = f(
846
1037
  ({
847
- open: e,
848
- setOpen: n,
849
- onNavigate: r
850
- }) => /* @__PURE__ */ t(
851
- V,
1038
+ open: n,
1039
+ setOpen: t,
1040
+ onNavigate: o
1041
+ }) => /* @__PURE__ */ e(
1042
+ N,
852
1043
  {
853
1044
  lazyMount: !0,
854
1045
  placement: "center",
855
- open: e,
856
- onOpenChange: (l) => n(l.open),
1046
+ open: n,
1047
+ onOpenChange: (r) => t(r.open),
857
1048
  size: { mdDown: "full", md: "lg" },
858
1049
  scrollBehavior: "inside",
859
- children: /* @__PURE__ */ a(W, { children: [
860
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Table of Contents" }) }),
861
- /* @__PURE__ */ t(Y, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(ht, { onNavigate: r }) }),
862
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
863
- /* @__PURE__ */ t(j, {})
1050
+ children: /* @__PURE__ */ c(L, { children: [
1051
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { children: "Table of Contents" }) }),
1052
+ /* @__PURE__ */ e(j, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(Tn, { onNavigate: o }) }),
1053
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(E, { variant: "outline", children: "Cancel" }) }) }),
1054
+ /* @__PURE__ */ e($, {})
864
1055
  ] })
865
1056
  }
866
1057
  )
867
- ), wt = ({
868
- enableFloatingTime: e = !0,
869
- enableFloatingProgress: n = !0,
870
- onBackClick: r,
871
- onMoreClick: l
1058
+ ), jn = ({
1059
+ enableFloatingTime: n = !0,
1060
+ enableFloatingProgress: t = !0,
1061
+ onItemClick: o
872
1062
  }) => {
873
- const [o, i] = T(!1), [c, d] = T(!1), [u, s] = T(!1), [g, h] = K();
874
- return /* @__PURE__ */ a(F, { children: [
875
- n && /* @__PURE__ */ t(
876
- $,
1063
+ const [r, l] = w(!1), [i, a] = w(!1), [h, u] = w(!1), [s, g] = w(!1), [d, x] = w(!1), [C, T] = ee(), v = M(() => {
1064
+ l(!1), a(!1), u(!1), g(!1), x(!1), T(!1);
1065
+ }, [T]), R = M(
1066
+ (I) => {
1067
+ I === "annotations" ? g(!0) : I === "search" ? u(!0) : I === "help" ? a(!0) : I === "toc" ? l(!0) : I === "bookmarks" && x(!0), o == null || o(I);
1068
+ },
1069
+ [o]
1070
+ );
1071
+ return /* @__PURE__ */ c(U, { children: [
1072
+ t && /* @__PURE__ */ e(
1073
+ q,
877
1074
  {
878
- present: !g,
1075
+ present: !C,
879
1076
  animationName: { _open: "fade-in", _closed: "fade-out" },
880
1077
  animationDuration: "moderate",
881
- children: /* @__PURE__ */ t(Ve, {})
1078
+ children: /* @__PURE__ */ e(on, {})
882
1079
  }
883
1080
  ),
884
- /* @__PURE__ */ t(
885
- st,
1081
+ /* @__PURE__ */ e(kn, { onItemClick: R }),
1082
+ /* @__PURE__ */ e(Xe, {}),
1083
+ /* @__PURE__ */ e(tn, { open: i, setOpen: a }),
1084
+ /* @__PURE__ */ e(
1085
+ wn,
886
1086
  {
887
- onBackClick: r,
888
- onMoreClick: l,
889
- onTableOfContentsClick: () => i(!0),
890
- onHelpClick: () => d(!0),
891
- onSearchClick: () => s(!0)
1087
+ open: r,
1088
+ setOpen: l,
1089
+ onNavigate: v
892
1090
  }
893
1091
  ),
894
- /* @__PURE__ */ t(je, { open: c, setOpen: d }),
895
- /* @__PURE__ */ t(
896
- ut,
1092
+ /* @__PURE__ */ e(
1093
+ Pn,
897
1094
  {
898
- open: o,
899
- setOpen: i,
900
- onNavigate: () => {
901
- i(!1), h(!1);
902
- }
1095
+ open: h,
1096
+ setOpen: u,
1097
+ onNavigate: v
903
1098
  }
904
1099
  ),
905
- /* @__PURE__ */ t(
906
- dt,
1100
+ /* @__PURE__ */ e(
1101
+ We,
907
1102
  {
908
- open: u,
909
- setOpen: s,
910
- onNavigate: () => {
911
- s(!1), h(!1);
912
- }
1103
+ open: s,
1104
+ setOpen: g,
1105
+ onNavigate: v
1106
+ }
1107
+ ),
1108
+ /* @__PURE__ */ e(
1109
+ Ze,
1110
+ {
1111
+ open: d,
1112
+ setOpen: x,
1113
+ onNavigate: v
913
1114
  }
914
1115
  ),
915
- /* @__PURE__ */ t(
916
- $,
1116
+ /* @__PURE__ */ e(
1117
+ q,
917
1118
  {
918
- present: e || g,
1119
+ present: n || C,
919
1120
  animationName: { _open: "fade-in", _closed: "fade-out" },
920
1121
  animationDuration: "slow",
921
1122
  overflow: "hidden",
922
- children: /* @__PURE__ */ t(Ye, {})
1123
+ children: /* @__PURE__ */ e(sn, {})
923
1124
  }
924
1125
  )
925
1126
  ] });
926
1127
  };
927
1128
  export {
928
- wt as ReactReader,
929
- kt as ReactReaderProvider
1129
+ jn as ReactReader,
1130
+ Hn as ReactReaderProvider
930
1131
  };
931
1132
  //# sourceMappingURL=index.js.map