@prose-reader/react-reader 1.236.0 → 1.238.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,25 +1,25 @@
1
1
  import { jsx as n, jsxs as s, Fragment as oe } from "react/jsx-runtime";
2
- import * as E from "react";
3
- import Me, { createContext as Le, memo as m, useMemo as Ie, useEffect as F, useContext as $e, useState as k, useLayoutEffect as _e, useCallback as N } from "react";
4
- import { signal as ce, useSignalState as ke, useConstant as Se, useLiveRef as Ne, useSubscribe as D, useObserve as f, isDefined as ye, useSignalValue as He } from "reactjrx";
5
- import { Subject as de, tap as ue, map as z, filter as J, switchMap as A, EMPTY as se, of as ee, withLatestFrom as We, NEVER as re, startWith as Fe, distinctUntilChanged as he, throttleTime as je, first as Te, combineLatest as Ve, finalize as we, mergeMap as Ge, skip as Re, merge as Pe, timer as Ae, BehaviorSubject as Ye } from "rxjs";
6
- import { IconButton as v, Portal as ge, Dialog as I, List as y, Link as pe, Stack as T, Text as g, Tabs as P, Button as j, Presence as ne, Box as R, createToaster as Ue, Toaster as qe, Toast as M, Spinner as Qe, Heading as xe, HStack as O, Kbd as ve, Popover as L, Progress as H, chakra as Ke, Collapsible as ae, Input as Ze } from "@chakra-ui/react";
2
+ import * as D from "react";
3
+ import Me, { createContext as Le, memo as m, useMemo as ke, useEffect as F, useContext as $e, useState as S, useLayoutEffect as _e, useCallback as N } from "react";
4
+ import { signal as de, useSignalState as Ie, useConstant as Se, useLiveRef as Ne, useSubscribe as E, useObserve as f, isDefined as ye, useSignalValue as He } from "reactjrx";
5
+ import { Subject as he, tap as ue, map as z, filter as J, switchMap as O, EMPTY as le, of as ee, withLatestFrom as We, NEVER as re, startWith as Fe, distinctUntilChanged as ge, throttleTime as je, first as Te, combineLatest as Ve, finalize as we, mergeMap as Ge, skip as Re, merge as Pe, timer as Ae, BehaviorSubject as Ye } from "rxjs";
6
+ import { IconButton as v, Portal as pe, Dialog as I, List as T, Link as me, Stack as k, Text as g, Tabs as A, Button as j, Presence as ne, Box as P, createToaster as Ue, Toaster as qe, Toast as M, Spinner as Qe, Heading as ae, HStack as R, Kbd as ve, Popover as L, Progress as H, chakra as Ke, Collapsible as se, Input as Ze } from "@chakra-ui/react";
7
7
  import { LuX as Xe, LuNotebookPen as te, LuBookmark as Je, LuArrowBigRight as en, LuArrowBigLeft as nn, LuChevronDown as tn, LuCircleHelp as on, LuTableOfContents as rn, LuSearch as an, LuGalleryHorizontal as sn, LuCircleCheck as Ce } from "react-icons/lu";
8
8
  import { createPortal as ln } from "react-dom";
9
9
  import { isPositionInArea as cn } from "@prose-reader/enhancer-gestures";
10
- import { isShallowEqual as dn, observeIntersection as un, isHtmlTagElement as hn } from "@prose-reader/core";
10
+ import { isShallowEqual as dn, observeIntersection as hn, isHtmlTagElement as un } from "@prose-reader/core";
11
11
  import { BsBookmarks as gn } from "react-icons/bs";
12
12
  import { RiGalleryView2 as pn } from "react-icons/ri";
13
13
  import { RxDoubleArrowUp as mn, RxDoubleArrowLeft as fn, RxDoubleArrowDown as bn, RxDoubleArrowRight as xn } from "react-icons/rx";
14
14
  import { HiOutlineInformationCircle as vn } from "react-icons/hi";
15
15
  import Cn from "rc-slider";
16
16
  import "rc-slider/assets/index.css";
17
- import { IoIosArrowBack as In, IoMdMore as kn } from "react-icons/io";
17
+ import { IoIosArrowBack as kn, IoMdMore as In } from "react-icons/io";
18
18
  import { MdFullscreenExit as Sn, MdFullscreen as yn } from "react-icons/md";
19
19
  const Oe = Le({
20
20
  reader: void 0,
21
- quickMenuSignal: ce({ default: !1 }),
22
- notificationsSubject: new de()
21
+ quickMenuSignal: de({ default: !1 }),
22
+ notificationsSubject: new he()
23
23
  }), Ft = m(
24
24
  ({
25
25
  children: e,
@@ -27,13 +27,13 @@ const Oe = Le({
27
27
  quickMenuOpen: o,
28
28
  onQuickMenuOpenChange: i
29
29
  }) => {
30
- const [, r] = ke(
31
- () => ce({
30
+ const [, r] = Ie(
31
+ () => de({
32
32
  default: o
33
33
  })
34
34
  ), a = Se(
35
- () => new de()
36
- ), l = Ne(i), c = Ie(
35
+ () => new he()
36
+ ), l = Ne(i), c = ke(
37
37
  () => ({
38
38
  quickMenuSignal: r,
39
39
  reader: t,
@@ -43,14 +43,14 @@ const Oe = Le({
43
43
  );
44
44
  return F(() => {
45
45
  r.setValue(o);
46
- }, [o, r]), D(
46
+ }, [o, r]), E(
47
47
  () => r.pipe(ue(l.current)),
48
48
  [r, l]
49
49
  ), /* @__PURE__ */ n(Oe.Provider, { value: c, children: e });
50
50
  }
51
- ), Tn = E.forwardRef(function(t, o) {
51
+ ), Tn = D.forwardRef(function(t, o) {
52
52
  return /* @__PURE__ */ n(v, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ n(Xe, {}) });
53
- }), V = E.forwardRef(function(t, o) {
53
+ }), V = D.forwardRef(function(t, o) {
54
54
  const {
55
55
  children: i,
56
56
  portalled: r = !0,
@@ -58,11 +58,11 @@ const Oe = Le({
58
58
  backdrop: l = !0,
59
59
  ...c
60
60
  } = t;
61
- return /* @__PURE__ */ s(ge, { disabled: !r, container: a, children: [
61
+ return /* @__PURE__ */ s(pe, { disabled: !r, container: a, children: [
62
62
  l && /* @__PURE__ */ n(I.Backdrop, {}),
63
63
  /* @__PURE__ */ n(I.Positioner, { children: /* @__PURE__ */ n(I.Content, { ref: o, ...c, asChild: !1, children: i }) })
64
64
  ] });
65
- }), G = E.forwardRef(function(t, o) {
65
+ }), G = D.forwardRef(function(t, o) {
66
66
  return /* @__PURE__ */ n(
67
67
  I.CloseTrigger,
68
68
  {
@@ -82,13 +82,13 @@ I.Trigger;
82
82
  const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
83
83
  const { reader: e } = X();
84
84
  return e;
85
- }, Ee = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, W = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, De = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, wn = (e) => {
85
+ }, De = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, W = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, Ee = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, wn = (e) => {
86
86
  const t = p(), o = W(t) ? t : void 0;
87
87
  return { data: f(
88
88
  () => o?.annotations.annotations$.pipe(
89
89
  z((r) => r.find((a) => a.id === e)),
90
90
  J(ye),
91
- A((r) => o.locateResource(r))
91
+ O((r) => o.locateResource(r))
92
92
  ),
93
93
  [o]
94
94
  ) };
@@ -98,16 +98,16 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
98
98
  allowLeftIcon: o = !0
99
99
  }) => {
100
100
  const i = p(), { data: r } = wn(e), a = r?.meta.range?.toString() || r?.meta.node?.textContent;
101
- return /* @__PURE__ */ n(y.Item, { children: /* @__PURE__ */ s(
102
- pe,
101
+ return /* @__PURE__ */ n(T.Item, { children: /* @__PURE__ */ s(
102
+ me,
103
103
  {
104
104
  href: "#",
105
105
  onClick: () => {
106
106
  t(), i?.navigation.goToCfi(r?.meta.cfi ?? "");
107
107
  },
108
108
  children: [
109
- r?.resource?.notes ? /* @__PURE__ */ n(y.Indicator, { asChild: !0, children: /* @__PURE__ */ n(te, {}) }) : o ? /* @__PURE__ */ n(y.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ n(te, {}) }) : null,
110
- /* @__PURE__ */ s(T, { gap: 0, children: [
109
+ r?.resource?.notes ? /* @__PURE__ */ n(T.Indicator, { asChild: !0, children: /* @__PURE__ */ n(te, {}) }) : o ? /* @__PURE__ */ n(T.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ n(te, {}) }) : null,
110
+ /* @__PURE__ */ s(k, { gap: 0, children: [
111
111
  a ? /* @__PURE__ */ n(g, { lineClamp: 2, fontSize: "md", children: a }) : /* @__PURE__ */ s(g, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
112
112
  "Page ",
113
113
  (r?.meta.absolutePageIndex ?? 0) + 1
@@ -129,7 +129,7 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
129
129
  const e = p(), t = W(e) ? e : void 0;
130
130
  return { data: f(
131
131
  () => t?.annotations.annotations$.pipe(
132
- A(
132
+ O(
133
133
  (i) => t.locateResource(i)
134
134
  )
135
135
  ),
@@ -142,7 +142,7 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
142
142
  };
143
143
  }, Pn = ({ onNavigate: e }) => {
144
144
  const { data: t } = Rn();
145
- return /* @__PURE__ */ n(y.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ n(
145
+ return /* @__PURE__ */ n(T.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ n(
146
146
  ze,
147
147
  {
148
148
  id: o.resource.id,
@@ -159,7 +159,7 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
159
159
  };
160
160
  }, On = ({ onNavigate: e }) => {
161
161
  const { data: t } = An();
162
- return /* @__PURE__ */ n(y.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ n(
162
+ return /* @__PURE__ */ n(T.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ n(
163
163
  ze,
164
164
  {
165
165
  id: o.resource.id,
@@ -168,36 +168,36 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
168
168
  },
169
169
  o.resource.id
170
170
  )) });
171
- }, En = m(
171
+ }, Dn = m(
172
172
  ({
173
173
  onNavigate: e,
174
174
  defaultTab: t
175
175
  }) => {
176
- const [o, i] = k(t ?? "bookmarks");
176
+ const [o, i] = S(t ?? "bookmarks");
177
177
  return /* @__PURE__ */ s(
178
- P.Root,
178
+ A.Root,
179
179
  {
180
180
  value: o,
181
181
  onValueChange: (r) => i(r.value),
182
182
  children: [
183
- /* @__PURE__ */ s(P.List, { children: [
184
- /* @__PURE__ */ s(P.Trigger, { value: "bookmarks", children: [
183
+ /* @__PURE__ */ s(A.List, { children: [
184
+ /* @__PURE__ */ s(A.Trigger, { value: "bookmarks", children: [
185
185
  /* @__PURE__ */ n(Je, {}),
186
186
  "Bookmarks"
187
187
  ] }),
188
- /* @__PURE__ */ s(P.Trigger, { value: "annotations", children: [
188
+ /* @__PURE__ */ s(A.Trigger, { value: "annotations", children: [
189
189
  /* @__PURE__ */ n(te, {}),
190
190
  "Annotations"
191
191
  ] }),
192
- /* @__PURE__ */ n(P.Indicator, {})
192
+ /* @__PURE__ */ n(A.Indicator, {})
193
193
  ] }),
194
- /* @__PURE__ */ n(P.Content, { value: "bookmarks", children: /* @__PURE__ */ n(On, { onNavigate: e }) }),
195
- /* @__PURE__ */ n(P.Content, { value: "annotations", children: /* @__PURE__ */ n(Pn, { onNavigate: e }) })
194
+ /* @__PURE__ */ n(A.Content, { value: "bookmarks", children: /* @__PURE__ */ n(On, { onNavigate: e }) }),
195
+ /* @__PURE__ */ n(A.Content, { value: "annotations", children: /* @__PURE__ */ n(Pn, { onNavigate: e }) })
196
196
  ]
197
197
  }
198
198
  );
199
199
  }
200
- ), Dn = m(
200
+ ), En = m(
201
201
  ({
202
202
  openWith: e,
203
203
  setOpen: t,
@@ -214,7 +214,7 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
214
214
  children: /* @__PURE__ */ s(V, { height: "100%", children: [
215
215
  /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Annotations" }) }),
216
216
  /* @__PURE__ */ n(Q, { flex: 1, children: /* @__PURE__ */ n(
217
- En,
217
+ Dn,
218
218
  {
219
219
  onNavigate: o,
220
220
  defaultTab: e
@@ -236,7 +236,7 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
236
236
  return {
237
237
  spineItem: f(() => o ? t !== void 0 ? ee(o.spine.spineItemsManager.get(t)) : e !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(e).pipe(
238
238
  z((r) => o.spine.spineItemsManager.get(r?.itemIndex))
239
- ) : se : se, [t, e, o])
239
+ ) : le : le, [t, e, o])
240
240
  };
241
241
  }, Mn = ({
242
242
  absolutePageIndex: e,
@@ -257,7 +257,7 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
257
257
  const { isReady: r } = Mn({
258
258
  absolutePageIndex: e
259
259
  }), { data: a } = ie(), l = a?.find(
260
- (u) => u?.meta?.absolutePageIndex === e && u.meta.range === void 0
260
+ (h) => h?.meta?.absolutePageIndex === e && h.meta.range === void 0
261
261
  );
262
262
  if (!r) return null;
263
263
  const c = i * 0.1 / 2;
@@ -269,7 +269,7 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
269
269
  animationName: { _open: "fade-in", _closed: "fade-out" },
270
270
  animationDuration: "moderate",
271
271
  children: /* @__PURE__ */ n(
272
- R,
272
+ P,
273
273
  {
274
274
  "data-bookmark-area": Ln,
275
275
  position: "absolute",
@@ -322,11 +322,11 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
322
322
  const {
323
323
  spineItem: l,
324
324
  spineItemPageIndex: c,
325
- spineItemPagePosition: u,
325
+ spineItemPagePosition: h,
326
326
  pageSize: d
327
327
  } = r.page;
328
328
  if (cn(
329
- u,
329
+ h,
330
330
  {
331
331
  type: "corner",
332
332
  corner: "top-right",
@@ -335,31 +335,31 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
335
335
  },
336
336
  d
337
337
  )) {
338
- const h = e.spine.pages.fromSpineItemPageIndex(
338
+ const u = e.spine.pages.fromSpineItemPageIndex(
339
339
  l,
340
340
  c
341
341
  );
342
- if (!h) return !0;
342
+ if (!u) return !0;
343
343
  const x = t?.find(
344
- (w) => w?.meta?.absolutePageIndex === h.absolutePageIndex && w.meta.range === void 0
344
+ (w) => w?.meta?.absolutePageIndex === u.absolutePageIndex && w.meta.range === void 0
345
345
  );
346
346
  if (x)
347
347
  return e?.annotations.delete(x.resource.id), !1;
348
- if (a?.[h.absolutePageIndex])
348
+ if (a?.[u.absolutePageIndex])
349
349
  return e?.annotations.annotateAbsolutePage({
350
- absolutePageIndex: h.absolutePageIndex
350
+ absolutePageIndex: u.absolutePageIndex
351
351
  }), !1;
352
352
  }
353
353
  return !0;
354
354
  })
355
355
  )
356
356
  ) : void 0, [e, t]);
357
- }, le = Ue({
357
+ }, ce = Ue({
358
358
  placement: "bottom-end",
359
359
  pauseOnPageIdle: !0
360
- }), Wn = () => /* @__PURE__ */ n(ge, { children: /* @__PURE__ */ n(qe, { toaster: le, insetInline: { mdDown: "4" }, children: (e) => /* @__PURE__ */ s(M.Root, { width: { md: "sm" }, children: [
360
+ }), Wn = () => /* @__PURE__ */ n(pe, { children: /* @__PURE__ */ n(qe, { toaster: ce, insetInline: { mdDown: "4" }, children: (e) => /* @__PURE__ */ s(M.Root, { width: { md: "sm" }, children: [
361
361
  e.type === "loading" ? /* @__PURE__ */ n(Qe, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ n(M.Indicator, {}),
362
- /* @__PURE__ */ s(T, { gap: "1", flex: "1", maxWidth: "100%", children: [
362
+ /* @__PURE__ */ s(k, { gap: "1", flex: "1", maxWidth: "100%", children: [
363
363
  e.title && /* @__PURE__ */ n(M.Title, { children: e.title }),
364
364
  e.description && /* @__PURE__ */ n(M.Description, { children: e.description })
365
365
  ] }),
@@ -376,11 +376,11 @@ const Z = I.ActionTrigger, X = () => $e(Oe), p = () => {
376
376
  right: 0
377
377
  };
378
378
  function jn() {
379
- const [e, t] = k(null), [o, i] = k(Fn), r = Ie(
379
+ const [e, t] = S(null), [o, i] = S(Fn), r = ke(
380
380
  () => new ResizeObserver((a) => {
381
381
  if (a[0]) {
382
- const { x: l, y: c, width: u, height: d, top: b, left: h, bottom: x, right: S } = a[0].contentRect;
383
- i({ x: l, y: c, width: u, height: d, top: b, left: h, bottom: x, right: S });
382
+ const { x: l, y: c, width: h, height: d, top: b, left: u, bottom: x, right: y } = a[0].contentRect;
383
+ i({ x: l, y: c, width: h, height: d, top: b, left: u, bottom: x, right: y });
384
384
  }
385
385
  }),
386
386
  []
@@ -393,25 +393,25 @@ function jn() {
393
393
  }, [e, r]), [t, o, e];
394
394
  }
395
395
  const Vn = (e, t, o) => {
396
- const i = p(), r = De(i) ? i : void 0;
397
- D(() => {
396
+ const i = p(), r = Ee(i) ? i : void 0;
397
+ E(() => {
398
398
  if (!r || !e) return re;
399
399
  const a = t.layout.layout$.pipe(
400
400
  Fe(t.layout.layoutInfo),
401
- he(dn)
402
- ), l = un(
401
+ ge(dn)
402
+ ), l = hn(
403
403
  e
404
- ).pipe(z((c) => c.some((u) => u.isIntersecting)));
404
+ ).pipe(z((c) => c.some((h) => h.isIntersecting)));
405
405
  return a.pipe(
406
406
  je(100, void 0, { trailing: !0 }),
407
- A(() => l.pipe(
407
+ O(() => l.pipe(
408
408
  ue((c) => {
409
409
  c || (e.innerHTML = "");
410
410
  }),
411
411
  J((c) => c),
412
412
  Te()
413
413
  ).pipe(
414
- A(() => (e.innerHTML = "", r?.gallery.snapshot(
414
+ O(() => (e.innerHTML = "", r?.gallery.snapshot(
415
415
  t,
416
416
  e,
417
417
  o
@@ -428,7 +428,7 @@ const Vn = (e, t, o) => {
428
428
  [a, e]
429
429
  );
430
430
  return /* @__PURE__ */ s(
431
- R,
431
+ P,
432
432
  {
433
433
  width: "100%",
434
434
  aspectRatio: "2/3",
@@ -444,7 +444,7 @@ const Vn = (e, t, o) => {
444
444
  },
445
445
  children: [
446
446
  /* @__PURE__ */ n(
447
- R,
447
+ P,
448
448
  {
449
449
  height: "100%",
450
450
  width: "100%",
@@ -489,7 +489,7 @@ const Vn = (e, t, o) => {
489
489
  children: /* @__PURE__ */ s(V, { height: "100%", children: [
490
490
  /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Gallery" }) }),
491
491
  /* @__PURE__ */ n(Q, { children: /* @__PURE__ */ n(
492
- R,
492
+ P,
493
493
  {
494
494
  gridTemplateColumns: [
495
495
  "repeat(2, minmax(0, 1fr))",
@@ -517,7 +517,7 @@ const Vn = (e, t, o) => {
517
517
  }
518
518
  );
519
519
  }
520
- ), Un = "@prose-reader/react-reader", qn = "1.235.0", Qn = m(
520
+ ), Un = "@prose-reader/react-reader", qn = "1.237.0", Qn = m(
521
521
  ({ open: e, setOpen: t }) => /* @__PURE__ */ n(
522
522
  Y,
523
523
  {
@@ -529,25 +529,43 @@ const Vn = (e, t, o) => {
529
529
  scrollBehavior: "inside",
530
530
  children: /* @__PURE__ */ s(V, { children: [
531
531
  /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Help" }) }),
532
- /* @__PURE__ */ s(Q, { overflowY: "auto", flex: 1, children: [
533
- /* @__PURE__ */ n(xe, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
534
- /* @__PURE__ */ s(O, { mb: 1, children: [
535
- /* @__PURE__ */ n(ve, { children: /* @__PURE__ */ n(en, {}) }),
536
- " ",
537
- /* @__PURE__ */ n(g, { children: "Navigate to right page" })
538
- ] }),
539
- /* @__PURE__ */ s(O, { mb: 1, children: [
540
- /* @__PURE__ */ n(ve, { children: /* @__PURE__ */ n(nn, {}) }),
541
- " ",
542
- /* @__PURE__ */ n(g, { children: "Navigate to left page" })
543
- ] }),
544
- /* @__PURE__ */ n(xe, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
545
- /* @__PURE__ */ s(g, { children: [
546
- Un,
547
- " version: ",
548
- qn
549
- ] })
550
- ] }),
532
+ /* @__PURE__ */ s(
533
+ Q,
534
+ {
535
+ overflowY: "auto",
536
+ flex: 1,
537
+ display: "flex",
538
+ flexDirection: "column",
539
+ gap: 4,
540
+ children: [
541
+ /* @__PURE__ */ s(k, { children: [
542
+ /* @__PURE__ */ n(ae, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
543
+ /* @__PURE__ */ s(R, { mb: 1, children: [
544
+ /* @__PURE__ */ n(ve, { children: /* @__PURE__ */ n(en, {}) }),
545
+ " ",
546
+ /* @__PURE__ */ n(g, { children: "Navigate to right page" })
547
+ ] }),
548
+ /* @__PURE__ */ s(R, { mb: 1, children: [
549
+ /* @__PURE__ */ n(ve, { children: /* @__PURE__ */ n(nn, {}) }),
550
+ " ",
551
+ /* @__PURE__ */ n(g, { children: "Navigate to left page" })
552
+ ] })
553
+ ] }),
554
+ /* @__PURE__ */ s(k, { children: [
555
+ /* @__PURE__ */ n(ae, { mb: 2, as: "h3", size: "lg", children: "Bookmarks" }),
556
+ /* @__PURE__ */ n(R, { mb: 1, children: /* @__PURE__ */ n(g, { children: "Tap on the top right corner of a page bookmark it" }) })
557
+ ] }),
558
+ /* @__PURE__ */ s(k, { children: [
559
+ /* @__PURE__ */ n(ae, { mb: 2, as: "h3", size: "lg", children: "About" }),
560
+ /* @__PURE__ */ s(g, { children: [
561
+ Un,
562
+ " version: ",
563
+ qn
564
+ ] })
565
+ ] })
566
+ ]
567
+ }
568
+ ),
551
569
  /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(j, { variant: "outline", children: "Cancel" }) }) }),
552
570
  /* @__PURE__ */ n(G, {})
553
571
  ] })
@@ -573,12 +591,12 @@ const Vn = (e, t, o) => {
573
591
  const e = $(), t = Math.floor(
574
592
  (e?.percentageEstimateOfBook ?? 0) * 100
575
593
  ), o = t > 0 ? t : 1;
576
- return e?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ n(R, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ s(g, { fontSize: "sm", children: [
594
+ return e?.percentageEstimateOfBook === void 0 ? null : /* @__PURE__ */ n(P, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ s(g, { fontSize: "sm", children: [
577
595
  o,
578
596
  " %"
579
597
  ] }) });
580
598
  }, Zn = () => {
581
- const [e, t] = k(/* @__PURE__ */ new Date());
599
+ const [e, t] = S(/* @__PURE__ */ new Date());
582
600
  return F(() => {
583
601
  const o = setInterval(() => {
584
602
  t(/* @__PURE__ */ new Date());
@@ -591,13 +609,13 @@ const Vn = (e, t, o) => {
591
609
  hour: "2-digit",
592
610
  minute: "2-digit"
593
611
  }) });
594
- }, me = () => {
612
+ }, fe = () => {
595
613
  const { quickMenuSignal: e } = X();
596
614
  return [He(e), e.setValue, e];
597
615
  }, Jn = () => {
598
- const [e] = me();
616
+ const [e] = fe();
599
617
  return /* @__PURE__ */ n(
600
- R,
618
+ P,
601
619
  {
602
620
  position: "absolute",
603
621
  left: 0,
@@ -609,9 +627,9 @@ const Vn = (e, t, o) => {
609
627
  );
610
628
  }, et = () => {
611
629
  const e = p();
612
- D(
630
+ E(
613
631
  () => e?.links$.subscribe((t) => {
614
- if (t.type === "click" && hn(t.target, "a")) {
632
+ if (t.type === "click" && un(t.target, "a")) {
615
633
  if (!t.target.href) return;
616
634
  const o = new URL(t.target.href);
617
635
  window.location.host !== o.host && confirm(
@@ -623,11 +641,11 @@ const Vn = (e, t, o) => {
623
641
  );
624
642
  }, nt = () => {
625
643
  const e = p(), { notificationsSubject: t } = X();
626
- D(
644
+ E(
627
645
  () => e?.zoom.isZooming$.pipe(
628
- A((o) => {
629
- if (!o) return se;
630
- const i = new de();
646
+ O((o) => {
647
+ if (!o) return le;
648
+ const i = new he();
631
649
  return t.next({
632
650
  key: "zoom",
633
651
  title: "Zooming",
@@ -644,10 +662,10 @@ const Vn = (e, t, o) => {
644
662
  );
645
663
  }, tt = () => {
646
664
  const e = p(), { notificationsSubject: t } = X();
647
- D(
665
+ E(
648
666
  () => e?.settings.values$.pipe(
649
667
  z(({ fontScale: o }) => o),
650
- he(),
668
+ ge(),
651
669
  Re(1),
652
670
  ue((o) => {
653
671
  t.next({
@@ -661,11 +679,11 @@ const Vn = (e, t, o) => {
661
679
  );
662
680
  }, ot = () => {
663
681
  const { notificationsSubject: e } = X();
664
- tt(), nt(), D(
682
+ tt(), nt(), E(
665
683
  () => e.pipe(
666
684
  J(ye),
667
685
  Ge((t) => {
668
- const o = t.duration ?? 3e3, i = le.create({
686
+ const o = t.duration ?? 3e3, i = ce.create({
669
687
  title: t.title,
670
688
  description: t.description,
671
689
  duration: o
@@ -680,14 +698,14 @@ const Vn = (e, t, o) => {
680
698
  ).pipe(
681
699
  Te(),
682
700
  we(() => {
683
- le.dismiss(i);
701
+ ce.dismiss(i);
684
702
  })
685
703
  );
686
704
  })
687
705
  ),
688
706
  [e]
689
707
  );
690
- }, rt = E.forwardRef(
708
+ }, rt = D.forwardRef(
691
709
  function(t, o) {
692
710
  const {
693
711
  showArrow: i,
@@ -695,16 +713,16 @@ const Vn = (e, t, o) => {
695
713
  portalled: a = !0,
696
714
  content: l,
697
715
  portalRef: c,
698
- ...u
716
+ ...h
699
717
  } = t;
700
718
  return /* @__PURE__ */ s(
701
719
  L.Root,
702
720
  {
703
- ...u,
704
- positioning: { ...u.positioning, gutter: 4 },
721
+ ...h,
722
+ positioning: { ...h.positioning, gutter: 4 },
705
723
  children: [
706
724
  /* @__PURE__ */ n(L.Trigger, { asChild: !0, children: r }),
707
- /* @__PURE__ */ n(ge, { disabled: !a, container: c, children: /* @__PURE__ */ n(L.Positioner, { children: /* @__PURE__ */ s(
725
+ /* @__PURE__ */ n(pe, { disabled: !a, container: c, children: /* @__PURE__ */ n(L.Positioner, { children: /* @__PURE__ */ s(
708
726
  L.Content,
709
727
  {
710
728
  width: "auto",
@@ -723,7 +741,7 @@ const Vn = (e, t, o) => {
723
741
  }
724
742
  );
725
743
  }
726
- ), it = E.forwardRef(function(t, o) {
744
+ ), it = D.forwardRef(function(t, o) {
727
745
  const { children: i, ...r } = t;
728
746
  return /* @__PURE__ */ n(rt, { content: i, ...r, ref: o, children: /* @__PURE__ */ n(
729
747
  v,
@@ -735,28 +753,28 @@ const Vn = (e, t, o) => {
735
753
  children: /* @__PURE__ */ n(vn, {})
736
754
  }
737
755
  ) });
738
- }), at = E.forwardRef(function(t, o) {
756
+ }), at = D.forwardRef(function(t, o) {
739
757
  return /* @__PURE__ */ n(H.Track, { ...t, ref: o, children: /* @__PURE__ */ n(H.Range, {}) });
740
758
  });
741
- E.forwardRef(function(t, o) {
759
+ D.forwardRef(function(t, o) {
742
760
  const { children: i, info: r, ...a } = t;
743
761
  return /* @__PURE__ */ s(H.Label, { ...a, ref: o, children: [
744
762
  i,
745
763
  r && /* @__PURE__ */ n(it, { children: r })
746
764
  ] });
747
765
  });
748
- const st = H.Root, lt = H.ValueText, fe = () => {
766
+ const st = H.Root, lt = H.ValueText, be = () => {
749
767
  const e = $(), t = e?.numberOfTotalPages === 1, o = (e?.beginNumberOfPagesInSpineItem ?? 0) > 1, i = (e?.endNumberOfPagesInSpineItem ?? 0) > 1, r = (e?.hasChapters ? e?.beginPageIndexInSpineItem : e?.beginAbsolutePageIndex) ?? 0, a = (e?.hasChapters ? e?.endPageIndexInSpineItem : e?.endAbsolutePageIndex) ?? 0, [l = 0, c = 0] = [
750
768
  r,
751
769
  a
752
- ].sort((b, h) => b - h), u = e?.beginPageIndexInSpineItem !== e?.endPageIndexInSpineItem || e?.beginSpineItemIndex !== e?.endSpineItemIndex, d = e?.hasChapters ? e?.beginNumberOfPagesInSpineItem : e?.numberOfTotalPages;
770
+ ].sort((b, u) => b - u), h = e?.beginPageIndexInSpineItem !== e?.endPageIndexInSpineItem || e?.beginSpineItemIndex !== e?.endSpineItemIndex, d = e?.hasChapters ? e?.beginNumberOfPagesInSpineItem : e?.numberOfTotalPages;
753
771
  return {
754
772
  hasOnlyOnePage: t,
755
773
  beginPageIndex: r,
756
774
  endPageIndex: a,
757
775
  isBeginWithinChapter: o,
758
776
  isEndWithinChapter: i,
759
- beginAndEndAreDifferent: u,
777
+ beginAndEndAreDifferent: h,
760
778
  totalApproximatePages: d,
761
779
  leftPageIndex: l,
762
780
  rightPageIndex: c
@@ -768,14 +786,14 @@ const st = H.Root, lt = H.ValueText, fe = () => {
768
786
  rightPageIndex: i,
769
787
  totalApproximatePages: r,
770
788
  beginAndEndAreDifferent: a
771
- } = fe(), l = Math.round((e?.percentageEstimateOfBook ?? 0) * 100), c = (d) => d?.subChapter ? `${d.title} / ${c(d.subChapter)}` : d?.title || "", u = c(e?.beginChapterInfo);
772
- return /* @__PURE__ */ s(T, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
773
- /* @__PURE__ */ n(st, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(O, { justifyContent: "space-between", children: [
789
+ } = be(), l = Math.round((e?.percentageEstimateOfBook ?? 0) * 100), c = (d) => d?.subChapter ? `${d.title} / ${c(d.subChapter)}` : d?.title || "", h = c(e?.beginChapterInfo);
790
+ return /* @__PURE__ */ s(k, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
791
+ /* @__PURE__ */ n(st, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(R, { justifyContent: "space-between", children: [
774
792
  /* @__PURE__ */ n(at, { width: 110 }),
775
793
  /* @__PURE__ */ n(lt, { children: `${l}%` })
776
794
  ] }) }),
777
- /* @__PURE__ */ n(g, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
778
- !t && /* @__PURE__ */ s(O, { children: [
795
+ /* @__PURE__ */ n(g, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: h ? `Chapter: ${h}` : " " }),
796
+ !t && /* @__PURE__ */ s(R, { children: [
779
797
  /* @__PURE__ */ n(g, { fontSize: "xs", children: a ? `${o + 1} - ${i + 1} of ${r}` : `${o + 1} of ${r}` }),
780
798
  !!e?.hasChapters && /* @__PURE__ */ s(oe, { children: [
781
799
  /* @__PURE__ */ n(g, { children: "-" }),
@@ -817,8 +835,8 @@ const st = H.Root, lt = H.ValueText, fe = () => {
817
835
  children: e
818
836
  }
819
837
  )
820
- ), dt = Ke(Cn), ut = m((e) => /* @__PURE__ */ n(
821
- R,
838
+ ), dt = Ke(Cn), ht = m((e) => /* @__PURE__ */ n(
839
+ P,
822
840
  {
823
841
  display: "contents",
824
842
  css: {
@@ -871,12 +889,12 @@ const st = H.Root, lt = H.ValueText, fe = () => {
871
889
  }
872
890
  )
873
891
  }
874
- )), ht = () => {
875
- const t = $()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: i = 0 } = fe(), r = t ? Math.floor((o || 0) / 2) : o, [a, l] = ke(
876
- () => ce({
892
+ )), ut = () => {
893
+ const t = $()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: i = 0 } = be(), r = t ? Math.floor((o || 0) / 2) : o, [a, l] = Ie(
894
+ () => de({
877
895
  default: r || 0
878
896
  })
879
- ), c = 0, u = Math.max(
897
+ ), c = 0, h = Math.max(
880
898
  0,
881
899
  t ? Math.floor((i - 1) / 2) : i - 1
882
900
  );
@@ -886,39 +904,39 @@ const st = H.Root, lt = H.ValueText, fe = () => {
886
904
  value: a,
887
905
  valueSignal: l,
888
906
  min: c,
889
- max: u
907
+ max: h
890
908
  };
891
909
  }, gt = (e) => {
892
- const t = p(), o = $(), { manifest: i } = f(() => t?.context.state$, [t]) ?? {}, r = i?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: l = 0, isBeginWithinChapter: c } = fe(), u = 1, d = c, { value: b, valueSignal: h, min: x, max: S } = ht(), w = N(
910
+ const t = p(), o = $(), { manifest: i } = f(() => t?.context.state$, [t]) ?? {}, r = i?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: l = 0, isBeginWithinChapter: c } = be(), h = 1, d = c, { value: b, valueSignal: u, min: x, max: y } = ut(), w = N(
893
911
  (_) => {
894
912
  const [C = 0] = Array.isArray(_) ? _ : [_];
895
- h.setValue(C);
896
- const be = a ? Math.floor(C) * 2 : Math.floor(C);
913
+ u.setValue(C);
914
+ const xe = a ? Math.floor(C) * 2 : Math.floor(C);
897
915
  d ? t?.navigation.goToPageOfSpineItem({
898
- pageIndex: be,
916
+ pageIndex: xe,
899
917
  spineItemId: t.pagination.state.beginSpineItemIndex ?? 0,
900
918
  animation: !1
901
919
  }) : t?.navigation.goToAbsolutePageIndex({
902
- absolutePageIndex: be,
920
+ absolutePageIndex: xe,
903
921
  animation: !1
904
922
  });
905
923
  },
906
- [t, a, h, d]
924
+ [t, a, u, d]
907
925
  );
908
- return D(
926
+ return E(
909
927
  () => t?.navigation.throttleLock({
910
928
  duration: 100,
911
- trigger: h.subject
929
+ trigger: u.subject
912
930
  }),
913
- [t, h]
914
- ), l === 1 || a && l === 2 ? /* @__PURE__ */ n(R, { style: e.style }) : /* @__PURE__ */ n(
915
- ut,
931
+ [t, u]
932
+ ), l === 1 || a && l === 2 ? /* @__PURE__ */ n(P, { style: e.style }) : /* @__PURE__ */ n(
933
+ ht,
916
934
  {
917
935
  value: [b],
918
- max: S,
936
+ max: y,
919
937
  min: x,
920
938
  reverse: r,
921
- step: u,
939
+ step: h,
922
940
  onChange: w,
923
941
  ...e
924
942
  }
@@ -928,7 +946,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
928
946
  open: e,
929
947
  onItemClick: t
930
948
  }) => {
931
- const o = p(), i = f(() => o?.navigation.state$, [o]), a = f(() => o?.settings.values$, [o])?.computedPageTurnDirection === "vertical", [l, c] = k(!0);
949
+ const o = p(), i = f(() => o?.navigation.state$, [o]), a = f(() => o?.settings.values$, [o])?.computedPageTurnDirection === "vertical", [l, c] = S(!0);
932
950
  return /* @__PURE__ */ s(
933
951
  Be,
934
952
  {
@@ -940,7 +958,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
940
958
  pb: 8,
941
959
  children: [
942
960
  /* @__PURE__ */ s(
943
- O,
961
+ R,
944
962
  {
945
963
  flex: 1,
946
964
  alignItems: "center",
@@ -960,7 +978,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
960
978
  }
961
979
  ),
962
980
  /* @__PURE__ */ s(
963
- T,
981
+ k,
964
982
  {
965
983
  flex: 1,
966
984
  maxW: 400,
@@ -1000,17 +1018,17 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1000
1018
  ]
1001
1019
  }
1002
1020
  ),
1003
- /* @__PURE__ */ n(O, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ s(
1004
- ae.Root,
1021
+ /* @__PURE__ */ n(R, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ s(
1022
+ se.Root,
1005
1023
  {
1006
1024
  open: l,
1007
1025
  flex: 1,
1008
- onOpenChange: ({ open: u }) => {
1009
- c(u);
1026
+ onOpenChange: ({ open: h }) => {
1027
+ c(h);
1010
1028
  },
1011
1029
  children: [
1012
1030
  /* @__PURE__ */ n(
1013
- ae.Trigger,
1031
+ se.Trigger,
1014
1032
  {
1015
1033
  paddingY: "3",
1016
1034
  width: "100%",
@@ -1026,7 +1044,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1026
1044
  )
1027
1045
  }
1028
1046
  ),
1029
- /* @__PURE__ */ s(ae.Content, { display: "flex", justifyContent: "center", children: [
1047
+ /* @__PURE__ */ s(se.Content, { display: "flex", justifyContent: "center", children: [
1030
1048
  /* @__PURE__ */ n(
1031
1049
  v,
1032
1050
  {
@@ -1047,7 +1065,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1047
1065
  children: /* @__PURE__ */ n(rn, {})
1048
1066
  }
1049
1067
  ),
1050
- Ee(o) && /* @__PURE__ */ n(
1068
+ De(o) && /* @__PURE__ */ n(
1051
1069
  v,
1052
1070
  {
1053
1071
  "aria-label": "Search",
@@ -1091,7 +1109,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1091
1109
  children: /* @__PURE__ */ n(sn, {})
1092
1110
  }
1093
1111
  ),
1094
- De(o) && /* @__PURE__ */ n(
1112
+ Ee(o) && /* @__PURE__ */ n(
1095
1113
  v,
1096
1114
  {
1097
1115
  "aria-label": "Gallery",
@@ -1110,7 +1128,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1110
1128
  );
1111
1129
  }
1112
1130
  ), mt = () => {
1113
- const [e, t] = k(!1), o = N(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1131
+ const [e, t] = S(!1), o = N(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1114
1132
  t(!1);
1115
1133
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
1116
1134
  t(!0);
@@ -1148,11 +1166,11 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1148
1166
  variant: "ghost",
1149
1167
  flexShrink: 0,
1150
1168
  onClick: () => t("back"),
1151
- children: /* @__PURE__ */ n(In, {})
1169
+ children: /* @__PURE__ */ n(kn, {})
1152
1170
  }
1153
1171
  ),
1154
1172
  /* @__PURE__ */ n(
1155
- T,
1173
+ k,
1156
1174
  {
1157
1175
  flex: 1,
1158
1176
  maxW: 600,
@@ -1163,7 +1181,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1163
1181
  children: /* @__PURE__ */ n(g, { truncate: !0, maxWidth: "100%", children: i?.title })
1164
1182
  }
1165
1183
  ),
1166
- /* @__PURE__ */ s(O, { children: [
1184
+ /* @__PURE__ */ s(R, { children: [
1167
1185
  /* @__PURE__ */ n(
1168
1186
  v,
1169
1187
  {
@@ -1172,7 +1190,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1172
1190
  flexShrink: 0,
1173
1191
  variant: "ghost",
1174
1192
  onClick: () => t("more"),
1175
- children: /* @__PURE__ */ n(kn, {})
1193
+ children: /* @__PURE__ */ n(In, {})
1176
1194
  }
1177
1195
  ),
1178
1196
  /* @__PURE__ */ n(
@@ -1195,7 +1213,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1195
1213
  ({
1196
1214
  onItemClick: e
1197
1215
  }) => {
1198
- const [t] = me();
1216
+ const [t] = fe();
1199
1217
  return /* @__PURE__ */ s(oe, { children: [
1200
1218
  /* @__PURE__ */ n(ft, { open: t, onItemClick: e }),
1201
1219
  /* @__PURE__ */ n(pt, { open: t, onItemClick: e })
@@ -1213,7 +1231,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1213
1231
  const c = e.substring(
1214
1232
  Math.max(t - 15, 0),
1215
1233
  Math.max(t, 0)
1216
- ), u = e.substring(
1234
+ ), h = e.substring(
1217
1235
  Math.min(t + o.length, e.length - 1),
1218
1236
  Math.min(
1219
1237
  t + o.length + 15,
@@ -1221,7 +1239,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1221
1239
  )
1222
1240
  );
1223
1241
  return /* @__PURE__ */ s(
1224
- pe,
1242
+ me,
1225
1243
  {
1226
1244
  href: i,
1227
1245
  style: { margin: 5, overflow: "hidden" },
@@ -1237,7 +1255,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1237
1255
  '"',
1238
1256
  c,
1239
1257
  /* @__PURE__ */ n("b", { children: o }),
1240
- u,
1258
+ h,
1241
1259
  '"'
1242
1260
  ] }),
1243
1261
  /* @__PURE__ */ n(g, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${a !== void 0 ? a + 1 : "unknown (not loaded)"}` })
@@ -1246,16 +1264,16 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1246
1264
  );
1247
1265
  }
1248
1266
  ), vt = 500, Ct = () => {
1249
- const e = Se(() => new Ye("")), t = f(e), o = p(), i = Ee(o) ? o : void 0, r = f(() => e.pipe(
1250
- he(),
1251
- A(
1267
+ const e = Se(() => new Ye("")), t = f(e), o = p(), i = De(o) ? o : void 0, r = f(() => e.pipe(
1268
+ ge(),
1269
+ O(
1252
1270
  (a) => a === "" || !i ? ee(void 0) : Pe(
1253
1271
  ee({
1254
1272
  type: "start",
1255
1273
  data: void 0
1256
1274
  }),
1257
1275
  Ae(vt).pipe(
1258
- A(() => i.search.search(a)),
1276
+ O(() => i.search.search(a)),
1259
1277
  z((l) => ({ type: "end", data: l }))
1260
1278
  )
1261
1279
  )
@@ -1267,7 +1285,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1267
1285
  status: r?.type ?? "idle",
1268
1286
  data: r?.data
1269
1287
  };
1270
- }, It = m(
1288
+ }, kt = m(
1271
1289
  ({ onNavigate: e }) => {
1272
1290
  const t = p(), { value: o, setValue: i, status: r, data: a } = Ct(), l = (d) => {
1273
1291
  i(d.target.value);
@@ -1276,11 +1294,11 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1276
1294
  e(), t?.navigation.goToCfi(d);
1277
1295
  },
1278
1296
  [t, e]
1279
- ), u = f(
1297
+ ), h = f(
1280
1298
  () => t?.locateResource(a?.slice(0, 100) ?? []),
1281
1299
  [a]
1282
1300
  );
1283
- return /* @__PURE__ */ s(T, { flex: 1, height: "100%", gap: 2, children: [
1301
+ return /* @__PURE__ */ s(k, { flex: 1, height: "100%", gap: 2, children: [
1284
1302
  /* @__PURE__ */ n(
1285
1303
  Ze,
1286
1304
  {
@@ -1297,7 +1315,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1297
1315
  }
1298
1316
  ),
1299
1317
  /* @__PURE__ */ s(
1300
- T,
1318
+ k,
1301
1319
  {
1302
1320
  style: { overflow: "hidden", overflowY: "auto" },
1303
1321
  overflow: "auto",
@@ -1306,12 +1324,12 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1306
1324
  children: [
1307
1325
  r === "start" && /* @__PURE__ */ n(g, { children: "Searching ..." }),
1308
1326
  a?.length === 0 && /* @__PURE__ */ n(g, { children: "No results" }),
1309
- r === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ s(T, { children: [
1327
+ r === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ s(k, { children: [
1310
1328
  /* @__PURE__ */ s(g, { fontSize: "md", children: [
1311
1329
  a?.length,
1312
1330
  " result(s)"
1313
1331
  ] }),
1314
- /* @__PURE__ */ n(T, { gap: 0, children: u?.map((d, b) => /* @__PURE__ */ n(
1332
+ /* @__PURE__ */ n(k, { gap: 0, children: h?.map((d, b) => /* @__PURE__ */ n(
1315
1333
  xt,
1316
1334
  {
1317
1335
  contextText: d.meta?.range?.startContainer.parentElement?.textContent ?? "",
@@ -1330,7 +1348,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1330
1348
  )
1331
1349
  ] });
1332
1350
  }
1333
- ), kt = m(
1351
+ ), It = m(
1334
1352
  ({
1335
1353
  open: e,
1336
1354
  setOpen: t,
@@ -1346,7 +1364,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1346
1364
  scrollBehavior: "inside",
1347
1365
  children: /* @__PURE__ */ s(V, { height: "100%", children: [
1348
1366
  /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Search" }) }),
1349
- /* @__PURE__ */ n(Q, { flex: 1, p: 0, children: /* @__PURE__ */ n(It, { onNavigate: o }) }),
1367
+ /* @__PURE__ */ n(Q, { flex: 1, p: 0, children: /* @__PURE__ */ n(kt, { onNavigate: o }) }),
1350
1368
  /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(j, { variant: "outline", children: "Cancel" }) }) }),
1351
1369
  /* @__PURE__ */ n(G, {})
1352
1370
  ] })
@@ -1356,38 +1374,38 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1356
1374
  ({ onNavigate: e }) => {
1357
1375
  const t = p(), { manifest: o, assumedRenditionLayout: i } = f(() => t?.context.state$, [t]) ?? {}, { nav: r } = o ?? {}, a = $();
1358
1376
  r?.toc;
1359
- const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, u = (i === "reflowable" ? c : l) || 0;
1377
+ const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, h = (i === "reflowable" ? c : l) || 0;
1360
1378
  let d = a?.beginChapterInfo;
1361
1379
  for (; d?.subChapter; )
1362
1380
  d = d?.subChapter;
1363
- const b = (h, x, S) => /* @__PURE__ */ s(Me.Fragment, { children: [
1381
+ const b = (u, x, y) => /* @__PURE__ */ s(Me.Fragment, { children: [
1364
1382
  /* @__PURE__ */ n(
1365
- y.Item,
1383
+ T.Item,
1366
1384
  {
1367
- pl: 4 * (S + 1),
1385
+ pl: 4 * (y + 1),
1368
1386
  style: {
1369
1387
  display: "flex",
1370
1388
  alignItems: "center"
1371
1389
  },
1372
1390
  children: /* @__PURE__ */ s(
1373
- pe,
1391
+ me,
1374
1392
  {
1375
1393
  onClick: () => {
1376
- e(), t?.navigation.goToUrl(h.href);
1394
+ e(), t?.navigation.goToUrl(u.href);
1377
1395
  },
1378
1396
  href: "#",
1379
1397
  children: [
1380
- d?.path === h.path && /* @__PURE__ */ n(y.Indicator, { asChild: !0, children: /* @__PURE__ */ n(Ce, {}) }),
1381
- d?.path !== h.path && /* @__PURE__ */ n(y.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ n(Ce, {}) }),
1382
- /* @__PURE__ */ s(T, { gap: 0, children: [
1383
- /* @__PURE__ */ n(g, { fontSize: "md", children: h.title || h.path }),
1384
- d?.path === h.path && /* @__PURE__ */ n(
1398
+ d?.path === u.path && /* @__PURE__ */ n(T.Indicator, { asChild: !0, children: /* @__PURE__ */ n(Ce, {}) }),
1399
+ d?.path !== u.path && /* @__PURE__ */ n(T.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ n(Ce, {}) }),
1400
+ /* @__PURE__ */ s(k, { gap: 0, children: [
1401
+ /* @__PURE__ */ n(g, { fontSize: "md", children: u.title || u.path }),
1402
+ d?.path === u.path && /* @__PURE__ */ n(
1385
1403
  g,
1386
1404
  {
1387
1405
  fontStyle: "italic",
1388
1406
  fontWeight: "bold",
1389
1407
  fontSize: "sm",
1390
- children: `Currently on page ${u + 1}`
1408
+ children: `Currently on page ${h + 1}`
1391
1409
  }
1392
1410
  )
1393
1411
  ] })
@@ -1396,11 +1414,11 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1396
1414
  )
1397
1415
  }
1398
1416
  ),
1399
- h.contents.length > 0 && /* @__PURE__ */ n(y.Root, { as: "div", gap: 2, children: h.contents.map(
1400
- (w, B) => b(w, B, S + 1)
1417
+ u.contents.length > 0 && /* @__PURE__ */ n(T.Root, { as: "div", gap: 2, children: u.contents.map(
1418
+ (w, B) => b(w, B, y + 1)
1401
1419
  ) })
1402
1420
  ] }, x);
1403
- return /* @__PURE__ */ n(y.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: r?.toc.map((h, x) => b(h, x, 0)) });
1421
+ return /* @__PURE__ */ n(T.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: r?.toc.map((u, x) => b(u, x, 0)) });
1404
1422
  }
1405
1423
  ), yt = m(
1406
1424
  ({
@@ -1429,11 +1447,11 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1429
1447
  enableFloatingProgress: t = !0,
1430
1448
  onItemClick: o
1431
1449
  }) => {
1432
- const [i, r] = k(!1), [a, l] = k(!1), [c, u] = k(!1), [d, b] = k(void 0), [h, x] = k(!1), [S, w] = me(), B = N(() => {
1433
- r(!1), l(!1), u(!1), b(void 0), w(!1), x(!1);
1450
+ const [i, r] = S(!1), [a, l] = S(!1), [c, h] = S(!1), [d, b] = S(void 0), [u, x] = S(!1), [y, w] = fe(), B = N(() => {
1451
+ r(!1), l(!1), h(!1), b(void 0), w(!1), x(!1);
1434
1452
  }, [w]), _ = N(
1435
1453
  (C) => {
1436
- C === "annotations" ? b("annotations") : C === "search" ? u(!0) : C === "help" ? l(!0) : C === "toc" ? r(!0) : C === "bookmarks" ? b("bookmarks") : C === "gallery" && x(!0), o?.(C);
1454
+ C === "annotations" ? b("annotations") : C === "search" ? h(!0) : C === "help" ? l(!0) : C === "toc" ? r(!0) : C === "bookmarks" ? b("bookmarks") : C === "gallery" && x(!0), o?.(C);
1437
1455
  },
1438
1456
  [o]
1439
1457
  );
@@ -1441,13 +1459,13 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1441
1459
  t && /* @__PURE__ */ n(
1442
1460
  ne,
1443
1461
  {
1444
- present: !S,
1462
+ present: !y,
1445
1463
  animationName: { _open: "fade-in", _closed: "fade-out" },
1446
1464
  animationDuration: "moderate",
1447
1465
  children: /* @__PURE__ */ n(Kn, {})
1448
1466
  }
1449
1467
  ),
1450
- /* @__PURE__ */ n(Yn, { open: h, setOpen: x }),
1468
+ /* @__PURE__ */ n(Yn, { open: u, setOpen: x }),
1451
1469
  /* @__PURE__ */ n(bt, { onItemClick: _ }),
1452
1470
  /* @__PURE__ */ n(_n, {}),
1453
1471
  /* @__PURE__ */ n(Qn, { open: a, setOpen: l }),
@@ -1460,15 +1478,15 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1460
1478
  }
1461
1479
  ),
1462
1480
  /* @__PURE__ */ n(
1463
- kt,
1481
+ It,
1464
1482
  {
1465
1483
  open: c,
1466
- setOpen: u,
1484
+ setOpen: h,
1467
1485
  onNavigate: B
1468
1486
  }
1469
1487
  ),
1470
1488
  /* @__PURE__ */ n(
1471
- Dn,
1489
+ En,
1472
1490
  {
1473
1491
  openWith: d,
1474
1492
  setOpen: (C) => b(C ? "annotations" : void 0),
@@ -1478,7 +1496,7 @@ const st = H.Root, lt = H.ValueText, fe = () => {
1478
1496
  /* @__PURE__ */ n(
1479
1497
  ne,
1480
1498
  {
1481
- present: e || S,
1499
+ present: e || y,
1482
1500
  animationName: { _open: "fade-in", _closed: "fade-out" },
1483
1501
  animationDuration: "slow",
1484
1502
  overflow: "hidden",