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