@prose-reader/react-reader 1.232.0 → 1.234.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,121 +1,125 @@
1
- import { jsx as t, jsxs as c, Fragment as oe } from "react/jsx-runtime";
2
- import * as z from "react";
3
- import ze, { createContext as Ee, memo as g, useMemo as ce, useEffect as j, useContext as Be, useState as k, useLayoutEffect as Me, useCallback as N } from "react";
4
- import { signal as de, useSignalState as Ce, useConstant as Le, useLiveRef as $e, useSubscribe as E, useObserve as v, isDefined as Ie, useSignalValue as _e } from "reactjrx";
5
- import { Subject as he, tap as ue, map as L, filter as ee, switchMap as F, of as Ne, withLatestFrom as Fe, NEVER as re, startWith as ye, distinctUntilChanged as Se, throttleTime as He, first as Te, combineLatest as We, EMPTY as je, finalize as ke, mergeMap as Ge, skip as we, merge as Ve, timer as Ye } from "rxjs";
6
- import { IconButton as I, Portal as ge, Dialog as S, List as w, Link as pe, Stack as R, Text as f, Tabs as O, Button as G, Presence as te, Box as P, createToaster as Ue, Toaster as qe, Toast as B, Spinner as Qe, Heading as le, HStack as D, Kbd as xe, Popover as M, Progress as H, chakra as Ke, Collapsible as se, Input as Ze } from "@chakra-ui/react";
7
- import { LuX as Xe, LuNotebookPen as ne, LuBookmark as Je, LuArrowBigRight as et, LuArrowBigLeft as tt, LuChevronDown as nt, LuCircleHelp as ot, LuTableOfContents as rt, LuSearch as it, LuGalleryHorizontal as st, LuCircleCheck as ve } from "react-icons/lu";
1
+ import { jsx as n, jsxs as c, Fragment as oe } from "react/jsx-runtime";
2
+ import * as E from "react";
3
+ import Me, { createContext as Le, memo as f, useMemo as Ie, useEffect as W, useContext as $e, useState as T, useLayoutEffect as _e, useCallback as N } from "react";
4
+ import { signal as ce, useSignalState as Se, useConstant as ye, useLiveRef as Ne, useSubscribe as B, useObserve as b, isDefined as ke, useSignalValue as He } from "reactjrx";
5
+ import { Subject as de, tap as ue, map as M, filter as J, switchMap as D, EMPTY as le, of as ee, withLatestFrom as Fe, NEVER as re, startWith as We, distinctUntilChanged as he, throttleTime as je, first as Te, combineLatest as Ve, finalize as we, mergeMap as Ge, skip as Pe, merge as Re, timer as Ae, BehaviorSubject as Ye } from "rxjs";
6
+ import { IconButton as I, Portal as ge, Dialog as y, List as w, Link as pe, Stack as P, Text as g, Tabs as O, Button as j, Presence as te, Box as A, createToaster as Ue, Toaster as qe, Toast as L, Spinner as Qe, Heading as xe, HStack as z, Kbd as ve, Popover as $, Progress as H, chakra as Ke, Collapsible as se, Input as Ze } from "@chakra-ui/react";
7
+ import { LuX as Xe, LuNotebookPen as ne, LuBookmark as Je, LuArrowBigRight as et, LuArrowBigLeft as tt, LuChevronDown as nt, LuCircleHelp as ot, LuTableOfContents as rt, LuSearch as it, LuGalleryHorizontal as st, LuCircleCheck as Ce } from "react-icons/lu";
8
8
  import { createPortal as lt } from "react-dom";
9
9
  import { isPositionInArea as at } from "@prose-reader/enhancer-gestures";
10
- import { isShallowEqual as ct, observeIntersection as dt, isHtmlTagElement as ht } from "@prose-reader/core";
11
- import { BsBookmarks as ut } from "react-icons/bs";
10
+ import { isShallowEqual as ct, observeIntersection as dt, isHtmlTagElement as ut } from "@prose-reader/core";
11
+ import { BsBookmarks as ht } from "react-icons/bs";
12
12
  import { RiGalleryView2 as gt } from "react-icons/ri";
13
- import { RxDoubleArrowUp as pt, RxDoubleArrowLeft as mt, RxDoubleArrowDown as ft, RxDoubleArrowRight as bt } from "react-icons/rx";
13
+ import { RxDoubleArrowUp as pt, RxDoubleArrowLeft as ft, RxDoubleArrowDown as mt, RxDoubleArrowRight as bt } from "react-icons/rx";
14
14
  import { HiOutlineInformationCircle as xt } from "react-icons/hi";
15
15
  import vt from "rc-slider";
16
16
  import "rc-slider/assets/index.css";
17
17
  import { IoIosArrowBack as Ct, IoMdMore as It } from "react-icons/io";
18
- import { MdFullscreenExit as yt, MdFullscreen as St } from "react-icons/md";
19
- const Pe = Ee({
18
+ import { MdFullscreenExit as St, MdFullscreen as yt } from "react-icons/md";
19
+ const Oe = Le({
20
20
  reader: void 0,
21
- quickMenuSignal: de({ default: !1 }),
22
- notificationsSubject: new he()
23
- }), Nn = g(
21
+ quickMenuSignal: ce({ default: !1 }),
22
+ notificationsSubject: new de()
23
+ }), Wn = f(
24
24
  ({
25
25
  children: e,
26
- reader: n,
26
+ reader: t,
27
27
  quickMenuOpen: o,
28
- onQuickMenuOpenChange: r
28
+ onQuickMenuOpenChange: i
29
29
  }) => {
30
- const [, i] = Ce(
31
- () => de({
30
+ const [, r] = Se(
31
+ () => ce({
32
32
  default: o
33
33
  })
34
- ), s = Le(
35
- () => new he()
36
- ), d = $e(r), l = ce(
34
+ ), s = ye(
35
+ () => new de()
36
+ ), a = Ne(i), d = Ie(
37
37
  () => ({
38
- quickMenuSignal: i,
39
- reader: n,
38
+ quickMenuSignal: r,
39
+ reader: t,
40
40
  notificationsSubject: s
41
41
  }),
42
- [i, n, s]
42
+ [r, t, s]
43
43
  );
44
- return j(() => {
45
- i.setValue(o);
46
- }, [o, i]), E(
47
- () => i.pipe(ue(d.current)),
48
- [i, d]
49
- ), /* @__PURE__ */ t(Pe.Provider, { value: l, children: e });
44
+ return W(() => {
45
+ r.setValue(o);
46
+ }, [o, r]), B(
47
+ () => r.pipe(ue(a.current)),
48
+ [r, a]
49
+ ), /* @__PURE__ */ n(Oe.Provider, { value: d, children: e });
50
50
  }
51
- ), Tt = z.forwardRef(function(n, o) {
52
- return /* @__PURE__ */ t(I, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ t(Xe, {}) });
53
- }), V = z.forwardRef(function(n, o) {
51
+ ), kt = E.forwardRef(function(t, o) {
52
+ return /* @__PURE__ */ n(I, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ n(Xe, {}) });
53
+ }), V = E.forwardRef(function(t, o) {
54
54
  const {
55
- children: r,
56
- portalled: i = !0,
55
+ children: i,
56
+ portalled: r = !0,
57
57
  portalRef: s,
58
- backdrop: d = !0,
59
- ...l
60
- } = n;
61
- return /* @__PURE__ */ c(ge, { disabled: !i, container: s, children: [
62
- d && /* @__PURE__ */ t(S.Backdrop, {}),
63
- /* @__PURE__ */ t(S.Positioner, { children: /* @__PURE__ */ t(S.Content, { ref: o, ...l, asChild: !1, children: r }) })
58
+ backdrop: a = !0,
59
+ ...d
60
+ } = t;
61
+ return /* @__PURE__ */ c(ge, { disabled: !r, container: s, children: [
62
+ a && /* @__PURE__ */ n(y.Backdrop, {}),
63
+ /* @__PURE__ */ n(y.Positioner, { children: /* @__PURE__ */ n(y.Content, { ref: o, ...d, asChild: !1, children: i }) })
64
64
  ] });
65
- }), Y = z.forwardRef(function(n, o) {
66
- return /* @__PURE__ */ t(
67
- S.CloseTrigger,
65
+ }), G = E.forwardRef(function(t, o) {
66
+ return /* @__PURE__ */ n(
67
+ y.CloseTrigger,
68
68
  {
69
69
  position: "absolute",
70
70
  top: "2",
71
71
  insetEnd: "2",
72
- ...n,
72
+ ...t,
73
73
  asChild: !0,
74
- children: /* @__PURE__ */ t(Tt, { size: "sm", ref: o, children: n.children })
74
+ children: /* @__PURE__ */ n(kt, { size: "sm", ref: o, children: t.children })
75
75
  }
76
76
  );
77
- }), U = S.Root, q = S.Footer, Q = S.Header, K = S.Body;
78
- S.Backdrop;
79
- const Z = S.Title;
80
- S.Description;
81
- S.Trigger;
82
- const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
83
- const { reader: e } = J();
77
+ }), Y = y.Root, U = y.Footer, q = y.Header, Q = y.Body;
78
+ y.Backdrop;
79
+ const K = y.Title;
80
+ y.Description;
81
+ y.Trigger;
82
+ const Z = y.ActionTrigger, X = () => $e(Oe), p = () => {
83
+ const { reader: e } = X();
84
84
  return e;
85
- }, Re = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, W = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, Ae = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, kt = (e) => {
86
- const n = p(), o = W(n) ? n : void 0;
87
- return { data: v(
85
+ }, De = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, F = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, ze = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, Tt = (e) => {
86
+ const t = p(), o = F(t) ? t : void 0;
87
+ return { data: b(
88
88
  () => o == null ? void 0 : o.annotations.annotations$.pipe(
89
- L((i) => i.find((s) => s.id === e)),
90
- ee(Ie),
91
- F((i) => o.locateResource(i))
89
+ M((r) => r.find((s) => s.id === e)),
90
+ J(ke),
91
+ D((r) => o.locateResource(r))
92
92
  ),
93
93
  [o]
94
94
  ) };
95
- }, Oe = ({
95
+ }, Ee = ({
96
96
  id: e,
97
- onNavigate: n
97
+ onNavigate: t,
98
+ allowLeftIcon: o = !0
98
99
  }) => {
99
- var i, s;
100
- const o = p(), { data: r } = kt(e);
101
- return /* @__PURE__ */ t(w.Item, { children: /* @__PURE__ */ c(
100
+ var a, d, u, l;
101
+ const i = p(), { data: r } = Tt(e), s = ((a = r == null ? void 0 : r.meta.range) == null ? void 0 : a.toString()) || ((d = r == null ? void 0 : r.meta.node) == null ? void 0 : d.textContent);
102
+ return /* @__PURE__ */ n(w.Item, { children: /* @__PURE__ */ c(
102
103
  pe,
103
104
  {
104
105
  href: "#",
105
106
  onClick: () => {
106
- n(), o == null || o.navigation.goToCfi((r == null ? void 0 : r.meta.cfi) ?? "");
107
+ t(), i == null || i.navigation.goToCfi((r == null ? void 0 : r.meta.cfi) ?? "");
107
108
  },
108
109
  children: [
109
- (i = r == null ? void 0 : r.resource) != null && i.notes ? /* @__PURE__ */ t(w.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ne, {}) }) : /* @__PURE__ */ t(w.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ne, {}) }),
110
- /* @__PURE__ */ c(R, { gap: 0, children: [
111
- /* @__PURE__ */ t(f, { lineClamp: 2, fontSize: "md", children: r != null && r.meta.range ? r == null ? void 0 : r.meta.range.toString() : /* @__PURE__ */ t("i", { children: /* @__PURE__ */ t("b", { children: "unknown (not loaded)" }) }) }),
112
- /* @__PURE__ */ t(
113
- f,
110
+ (u = r == null ? void 0 : r.resource) != null && u.notes ? /* @__PURE__ */ n(w.Indicator, { asChild: !0, children: /* @__PURE__ */ n(ne, {}) }) : o ? /* @__PURE__ */ n(w.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ n(ne, {}) }) : null,
111
+ /* @__PURE__ */ c(P, { gap: 0, children: [
112
+ s ? /* @__PURE__ */ n(g, { lineClamp: 2, fontSize: "md", children: s }) : /* @__PURE__ */ c(g, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
113
+ "Page ",
114
+ ((r == null ? void 0 : r.meta.absolutePageIndex) ?? 0) + 1
115
+ ] }),
116
+ /* @__PURE__ */ n(
117
+ g,
114
118
  {
115
119
  fontStyle: "italic",
116
120
  fontWeight: "bold",
117
121
  fontSize: "sm",
118
- children: `Book page: ${((s = r == null ? void 0 : r.meta) == null ? void 0 : s.absolutePageIndex) !== void 0 ? r.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
122
+ children: `Book page: ${((l = r == null ? void 0 : r.meta) == null ? void 0 : l.absolutePageIndex) !== void 0 ? r.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
119
123
  }
120
124
  )
121
125
  ] })
@@ -123,162 +127,162 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
123
127
  }
124
128
  ) });
125
129
  }, ie = () => {
126
- const e = p(), n = W(e) ? e : void 0;
127
- return { data: v(
128
- () => n == null ? void 0 : n.annotations.annotations$.pipe(
129
- F(
130
- (r) => n.locateResource(r)
130
+ const e = p(), t = F(e) ? e : void 0;
131
+ return { data: b(
132
+ () => t == null ? void 0 : t.annotations.annotations$.pipe(
133
+ D(
134
+ (i) => t.locateResource(i)
131
135
  )
132
136
  ),
133
- [n]
137
+ [t]
134
138
  ) };
135
- }, wt = ({ onNavigate: e }) => {
136
- const { data: n } = ie();
137
- return /* @__PURE__ */ t(w.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ t(
138
- Oe,
139
+ }, wt = () => {
140
+ const { data: e } = ie();
141
+ return {
142
+ data: e == null ? void 0 : e.filter((t) => t.meta.isCfiRange)
143
+ };
144
+ }, Pt = ({ onNavigate: e }) => {
145
+ const { data: t } = wt();
146
+ return /* @__PURE__ */ n(w.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t == null ? void 0 : t.map((o) => /* @__PURE__ */ n(
147
+ Ee,
139
148
  {
140
149
  id: o.resource.id,
141
150
  onNavigate: e
142
151
  },
143
152
  o.resource.id
144
153
  )) });
145
- }, Pt = () => {
154
+ }, Rt = () => {
146
155
  const { data: e } = ie();
147
156
  return {
148
- data: e == null ? void 0 : e.filter((n) => !n.meta.range)
157
+ data: e == null ? void 0 : e.filter(
158
+ (t) => !t.meta.isCfiRange && !t.resource.notes
159
+ )
149
160
  };
150
- }, Rt = ({ onNavigate: e }) => {
151
- const { data: n } = Pt();
152
- return /* @__PURE__ */ t(w.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ t(
153
- Oe,
161
+ }, At = ({ onNavigate: e }) => {
162
+ const { data: t } = Rt();
163
+ return /* @__PURE__ */ n(w.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t == null ? void 0 : t.map((o) => /* @__PURE__ */ n(
164
+ Ee,
154
165
  {
155
166
  id: o.resource.id,
156
- onNavigate: e
167
+ onNavigate: e,
168
+ allowLeftIcon: !1
157
169
  },
158
170
  o.resource.id
159
171
  )) });
160
- }, At = g(
172
+ }, Ot = f(
161
173
  ({
162
174
  onNavigate: e,
163
- defaultTab: n
175
+ defaultTab: t
164
176
  }) => {
165
- const [o, r] = k(n ?? "bookmarks");
177
+ const [o, i] = T(t ?? "bookmarks");
166
178
  return /* @__PURE__ */ c(
167
179
  O.Root,
168
180
  {
169
181
  value: o,
170
- onValueChange: (i) => r(i.value),
182
+ onValueChange: (r) => i(r.value),
171
183
  children: [
172
184
  /* @__PURE__ */ c(O.List, { children: [
173
185
  /* @__PURE__ */ c(O.Trigger, { value: "bookmarks", children: [
174
- /* @__PURE__ */ t(Je, {}),
186
+ /* @__PURE__ */ n(Je, {}),
175
187
  "Bookmarks"
176
188
  ] }),
177
189
  /* @__PURE__ */ c(O.Trigger, { value: "annotations", children: [
178
- /* @__PURE__ */ t(ne, {}),
190
+ /* @__PURE__ */ n(ne, {}),
179
191
  "Annotations"
180
192
  ] }),
181
- /* @__PURE__ */ t(O.Indicator, {})
193
+ /* @__PURE__ */ n(O.Indicator, {})
182
194
  ] }),
183
- /* @__PURE__ */ t(O.Content, { value: "bookmarks", children: /* @__PURE__ */ t(Rt, { onNavigate: e }) }),
184
- /* @__PURE__ */ t(O.Content, { value: "annotations", children: /* @__PURE__ */ t(wt, { onNavigate: e }) })
195
+ /* @__PURE__ */ n(O.Content, { value: "bookmarks", children: /* @__PURE__ */ n(At, { onNavigate: e }) }),
196
+ /* @__PURE__ */ n(O.Content, { value: "annotations", children: /* @__PURE__ */ n(Pt, { onNavigate: e }) })
185
197
  ]
186
198
  }
187
199
  );
188
200
  }
189
- ), Ot = g(
201
+ ), Dt = f(
190
202
  ({
191
203
  openWith: e,
192
- setOpen: n,
204
+ setOpen: t,
193
205
  onNavigate: o
194
- }) => /* @__PURE__ */ t(
195
- U,
206
+ }) => /* @__PURE__ */ n(
207
+ Y,
196
208
  {
197
209
  lazyMount: !0,
198
210
  placement: "center",
199
211
  open: !!e,
200
- onOpenChange: (r) => n(r.open),
212
+ onOpenChange: (i) => t(i.open),
201
213
  size: { mdDown: "full", md: "lg" },
202
214
  scrollBehavior: "inside",
203
215
  children: /* @__PURE__ */ c(V, { height: "100%", children: [
204
- /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Annotations" }) }),
205
- /* @__PURE__ */ t(K, { flex: 1, children: /* @__PURE__ */ t(
206
- At,
216
+ /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Annotations" }) }),
217
+ /* @__PURE__ */ n(Q, { flex: 1, children: /* @__PURE__ */ n(
218
+ Ot,
207
219
  {
208
220
  onNavigate: o,
209
221
  defaultTab: e
210
222
  }
211
223
  ) }),
212
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
213
- /* @__PURE__ */ t(Y, {})
224
+ /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(j, { variant: "outline", children: "Cancel" }) }) }),
225
+ /* @__PURE__ */ n(G, {})
214
226
  ] })
215
227
  }
216
228
  )
217
- ), Dt = g(({ children: e }) => {
218
- const n = p(), o = v(() => n == null ? void 0 : n.spine.element$, [n]);
219
- return o ? /* @__PURE__ */ t(oe, { children: lt(e, o) }) : null;
220
- }), zt = ({
229
+ ), zt = f(({ children: e }) => {
230
+ const t = p(), o = b(() => t == null ? void 0 : t.spine.element$, [t]);
231
+ return o ? /* @__PURE__ */ n(oe, { children: lt(e, o) }) : null;
232
+ }), Et = ({
221
233
  absolutePageIndex: e,
222
- itemIndex: n
234
+ itemIndex: t
223
235
  }) => {
224
- const o = p(), r = v(
225
- () => o == null ? void 0 : o.spine.spineItemsManager.items$,
226
- [o]
227
- );
236
+ const o = p();
228
237
  return {
229
- spineItem: ce(() => {
230
- if (n !== void 0)
231
- return o == null ? void 0 : o.spine.spineItemsManager.get(n);
232
- if (e !== void 0) {
233
- const { itemIndex: s } = (o == null ? void 0 : o.spine.locator.getSpineInfoFromAbsolutePageIndex({
234
- absolutePageIndex: e
235
- })) ?? {};
236
- return o == null ? void 0 : o.spine.spineItemsManager.get(s);
237
- }
238
- }, [n, e, o, r])
238
+ spineItem: b(() => o ? t !== void 0 ? ee(o.spine.spineItemsManager.get(t)) : e !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(e).pipe(
239
+ M((r) => o.spine.spineItemsManager.get(r == null ? void 0 : r.itemIndex))
240
+ ) : le : le, [t, e, o])
239
241
  };
240
- }, Et = ({
242
+ }, Bt = ({
241
243
  absolutePageIndex: e,
242
- itemIndex: n
244
+ itemIndex: t
243
245
  }) => {
244
- const { spineItem: o } = zt({ absolutePageIndex: e, itemIndex: n });
245
- return v(
246
- () => (o == null ? void 0 : o.isReady$) ?? Ne(!1),
246
+ const { spineItem: o } = Et({ absolutePageIndex: e, itemIndex: t }), i = b(
247
+ () => (o == null ? void 0 : o.isReady$) ?? ee(!1),
247
248
  [o]
248
249
  );
249
- }, Bt = "data-bookmark-area", Mt = g(
250
+ return { spineItem: o, isReady: i };
251
+ }, Mt = "data-bookmark-area", Lt = f(
250
252
  ({
251
253
  absolutePageIndex: e,
252
- left: n,
254
+ left: t,
253
255
  top: o,
254
- width: r
256
+ width: i
255
257
  }) => {
256
- const i = Et({ absolutePageIndex: e }), { data: s } = ie(), d = s == null ? void 0 : s.find(
258
+ const { isReady: r } = Bt({
259
+ absolutePageIndex: e
260
+ }), { data: s } = ie(), a = s == null ? void 0 : s.find(
257
261
  (u) => {
258
- var a;
259
- return ((a = u == null ? void 0 : u.meta) == null ? void 0 : a.absolutePageIndex) === e && u.meta.range === void 0;
262
+ var l;
263
+ return ((l = u == null ? void 0 : u.meta) == null ? void 0 : l.absolutePageIndex) === e && u.meta.range === void 0;
260
264
  }
261
265
  );
262
- if (!i) return null;
263
- const l = r * 0.1 / 2;
264
- return /* @__PURE__ */ t(
266
+ if (!r) return null;
267
+ const d = i * 0.1 / 2;
268
+ return /* @__PURE__ */ n(
265
269
  te,
266
270
  {
267
- present: !!d,
271
+ present: !!a,
268
272
  lazyMount: !0,
269
273
  animationName: { _open: "fade-in", _closed: "fade-out" },
270
274
  animationDuration: "moderate",
271
- children: /* @__PURE__ */ t(
272
- P,
275
+ children: /* @__PURE__ */ n(
276
+ A,
273
277
  {
274
- "data-bookmark-area": Bt,
278
+ "data-bookmark-area": Mt,
275
279
  position: "absolute",
276
- left: n + r,
280
+ left: t + i,
277
281
  transform: "translateX(-100%)",
278
282
  pointerEvents: "none",
279
283
  top: o,
280
- width: l,
281
- height: l,
284
+ width: d,
285
+ height: d,
282
286
  _before: {
283
287
  content: '""',
284
288
  position: "absolute",
@@ -286,45 +290,45 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
286
290
  left: 0,
287
291
  width: 0,
288
292
  height: 0,
289
- borderTop: `${l}px solid #03030373`,
290
- borderLeft: `${l}px solid transparent`
293
+ borderTop: `${d}px solid #03030373`,
294
+ borderLeft: `${d}px solid transparent`
291
295
  }
292
296
  }
293
297
  )
294
298
  }
295
299
  );
296
300
  }
297
- ), Lt = g(() => {
298
- const e = p(), n = v(() => e == null ? void 0 : e.layoutInfo$, [e]);
299
- return /* @__PURE__ */ t(Dt, { children: n == null ? void 0 : n.pages.map(
300
- ({ absoluteLayout: { left: o, top: r, width: i } }, s) => /* @__PURE__ */ t(
301
- Mt,
301
+ ), $t = f(() => {
302
+ const e = p(), t = b(() => e == null ? void 0 : e.layoutInfo$, [e]);
303
+ return /* @__PURE__ */ n(zt, { children: t == null ? void 0 : t.pages.map(
304
+ ({ absoluteLayout: { left: o, top: i, width: r } }, s) => /* @__PURE__ */ n(
305
+ Lt,
302
306
  {
303
307
  absolutePageIndex: s,
304
308
  left: o,
305
- top: r,
306
- width: i
309
+ top: i,
310
+ width: r
307
311
  },
308
312
  s
309
313
  )
310
314
  ) });
311
- }), $t = () => {
315
+ }), _t = () => {
312
316
  const e = p();
313
- return W(e) ? e : void 0;
314
- }, _t = () => {
315
- const e = $t(), { data: n } = ie();
316
- j(() => e ? e.gestures.hooks.register(
317
+ return F(e) ? e : void 0;
318
+ }, Nt = () => {
319
+ const e = _t(), { data: t } = ie();
320
+ W(() => e ? e.gestures.hooks.register(
317
321
  "beforeTapGesture",
318
- ({ event$: r }) => r.pipe(
322
+ ({ event$: i }) => i.pipe(
319
323
  Fe(e == null ? void 0 : e.annotations.candidates$),
320
- L(([i, s]) => {
321
- if (!i.page) return !0;
324
+ M(([r, s]) => {
325
+ if (!r.page) return !0;
322
326
  const {
323
- spineItem: d,
324
- spineItemPageIndex: l,
327
+ spineItem: a,
328
+ spineItemPageIndex: d,
325
329
  spineItemPagePosition: u,
326
- pageSize: a
327
- } = i.page;
330
+ pageSize: l
331
+ } = r.page;
328
332
  if (at(
329
333
  u,
330
334
  {
@@ -333,21 +337,21 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
333
337
  size: 10,
334
338
  unit: "%"
335
339
  },
336
- a
340
+ l
337
341
  )) {
338
342
  const h = e.spine.pages.fromSpineItemPageIndex(
339
- d,
340
- l
343
+ a,
344
+ d
341
345
  );
342
346
  if (!h) return !0;
343
- const b = n == null ? void 0 : n.find(
347
+ const m = t == null ? void 0 : t.find(
344
348
  (C) => {
345
- var T;
346
- return ((T = C == null ? void 0 : C.meta) == null ? void 0 : T.absolutePageIndex) === h.absolutePageIndex && C.meta.range === void 0;
349
+ var k;
350
+ return ((k = C == null ? void 0 : C.meta) == null ? void 0 : k.absolutePageIndex) === h.absolutePageIndex && C.meta.range === void 0;
347
351
  }
348
352
  );
349
- if (b)
350
- return e == null || e.annotations.delete(b.resource.id), !1;
353
+ if (m)
354
+ return e == null || e.annotations.delete(m.resource.id), !1;
351
355
  if (s == null ? void 0 : s[h.absolutePageIndex])
352
356
  return e == null || e.annotations.annotateAbsolutePage({
353
357
  absolutePageIndex: h.absolutePageIndex
@@ -356,20 +360,20 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
356
360
  return !0;
357
361
  })
358
362
  )
359
- ) : void 0, [e, n]);
363
+ ) : void 0, [e, t]);
360
364
  }, ae = Ue({
361
365
  placement: "bottom-end",
362
366
  pauseOnPageIdle: !0
363
- }), Nt = () => /* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(qe, { toaster: ae, insetInline: { mdDown: "4" }, children: (e) => {
364
- var n;
365
- return /* @__PURE__ */ c(B.Root, { width: { md: "sm" }, children: [
366
- e.type === "loading" ? /* @__PURE__ */ t(Qe, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ t(B.Indicator, {}),
367
- /* @__PURE__ */ c(R, { gap: "1", flex: "1", maxWidth: "100%", children: [
368
- e.title && /* @__PURE__ */ t(B.Title, { children: e.title }),
369
- e.description && /* @__PURE__ */ t(B.Description, { children: e.description })
367
+ }), Ht = () => /* @__PURE__ */ n(ge, { children: /* @__PURE__ */ n(qe, { toaster: ae, insetInline: { mdDown: "4" }, children: (e) => {
368
+ var t;
369
+ return /* @__PURE__ */ c(L.Root, { width: { md: "sm" }, children: [
370
+ e.type === "loading" ? /* @__PURE__ */ n(Qe, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ n(L.Indicator, {}),
371
+ /* @__PURE__ */ c(P, { gap: "1", flex: "1", maxWidth: "100%", children: [
372
+ e.title && /* @__PURE__ */ n(L.Title, { children: e.title }),
373
+ e.description && /* @__PURE__ */ n(L.Description, { children: e.description })
370
374
  ] }),
371
- e.action && /* @__PURE__ */ t(B.ActionTrigger, { children: e.action.label }),
372
- ((n = e.meta) == null ? void 0 : n.closable) && /* @__PURE__ */ t(B.CloseTrigger, {})
375
+ e.action && /* @__PURE__ */ n(L.ActionTrigger, { children: e.action.label }),
376
+ ((t = e.meta) == null ? void 0 : t.closable) && /* @__PURE__ */ n(L.CloseTrigger, {})
373
377
  ] });
374
378
  } }) }), Ft = {
375
379
  x: 0,
@@ -381,64 +385,64 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
381
385
  bottom: 0,
382
386
  right: 0
383
387
  };
384
- function Ht() {
385
- const [e, n] = k(null), [o, r] = k(Ft), i = ce(
388
+ function Wt() {
389
+ const [e, t] = T(null), [o, i] = T(Ft), r = Ie(
386
390
  () => new ResizeObserver((s) => {
387
391
  if (s[0]) {
388
- const { x: d, y: l, width: u, height: a, top: m, left: h, bottom: b, right: y } = s[0].contentRect;
389
- r({ x: d, y: l, width: u, height: a, top: m, left: h, bottom: b, right: y });
392
+ const { x: a, y: d, width: u, height: l, top: x, left: h, bottom: m, right: S } = s[0].contentRect;
393
+ i({ x: a, y: d, width: u, height: l, top: x, left: h, bottom: m, right: S });
390
394
  }
391
395
  }),
392
396
  []
393
397
  );
394
- return Me(() => {
398
+ return _e(() => {
395
399
  if (e)
396
- return i.observe(e), () => {
397
- i.disconnect();
400
+ return r.observe(e), () => {
401
+ r.disconnect();
398
402
  };
399
- }, [e, i]), [n, o, e];
403
+ }, [e, r]), [t, o, e];
400
404
  }
401
- const Wt = (e, n, o) => {
402
- const r = p(), i = Ae(r) ? r : void 0;
403
- E(() => {
404
- if (!i || !e) return re;
405
- const s = n.layout.layout$.pipe(
406
- ye(n.layout.layoutInfo),
407
- Se(ct)
408
- ), d = dt(
405
+ const jt = (e, t, o) => {
406
+ const i = p(), r = ze(i) ? i : void 0;
407
+ B(() => {
408
+ if (!r || !e) return re;
409
+ const s = t.layout.layout$.pipe(
410
+ We(t.layout.layoutInfo),
411
+ he(ct)
412
+ ), a = dt(
409
413
  e
410
- ).pipe(L((l) => l.some((u) => u.isIntersecting)));
414
+ ).pipe(M((d) => d.some((u) => u.isIntersecting)));
411
415
  return s.pipe(
412
- He(100, void 0, { trailing: !0 }),
413
- F(() => d.pipe(
414
- ue((l) => {
415
- l || (e.innerHTML = "");
416
+ je(100, void 0, { trailing: !0 }),
417
+ D(() => a.pipe(
418
+ ue((d) => {
419
+ d || (e.innerHTML = "");
416
420
  }),
417
- ee((l) => l),
421
+ J((d) => d),
418
422
  Te()
419
423
  ).pipe(
420
- F(() => (e.innerHTML = "", i == null ? void 0 : i.gallery.snapshot(
421
- n,
424
+ D(() => (e.innerHTML = "", r == null ? void 0 : r.gallery.snapshot(
425
+ t,
422
426
  e,
423
427
  o
424
428
  )))
425
429
  ))
426
430
  );
427
- }, [i, n, o, e]);
428
- }, jt = g(
431
+ }, [r, t, o, e]);
432
+ }, Vt = f(
429
433
  ({
430
434
  item: e,
431
- onNavigated: n
435
+ onNavigated: t
432
436
  }) => {
433
- var l;
434
- const [o, r, i] = Ht(), s = p();
435
- Wt(i, e, r);
436
- const d = v(
437
+ var d;
438
+ const [o, i, r] = Wt(), s = p();
439
+ jt(r, e, i);
440
+ const a = b(
437
441
  () => s == null ? void 0 : s.locateResource(e, { mode: "shallow" }),
438
442
  [s, e]
439
443
  );
440
444
  return /* @__PURE__ */ c(
441
- P,
445
+ A,
442
446
  {
443
447
  width: "100%",
444
448
  aspectRatio: "2/3",
@@ -450,11 +454,11 @@ const Wt = (e, n, o) => {
450
454
  position: "relative",
451
455
  overflow: "hidden",
452
456
  onClick: () => {
453
- n(), s == null || s.navigation.goToSpineItem({ indexOrId: e });
457
+ t(), s == null || s.navigation.goToSpineItem({ indexOrId: e });
454
458
  },
455
459
  children: [
456
- /* @__PURE__ */ t(
457
- P,
460
+ /* @__PURE__ */ n(
461
+ A,
458
462
  {
459
463
  height: "100%",
460
464
  width: "100%",
@@ -464,7 +468,7 @@ const Wt = (e, n, o) => {
464
468
  }
465
469
  ),
466
470
  /* @__PURE__ */ c(
467
- f,
471
+ g,
468
472
  {
469
473
  position: "absolute",
470
474
  bottom: 0,
@@ -476,7 +480,7 @@ const Wt = (e, n, o) => {
476
480
  fontSize: "xs",
477
481
  children: [
478
482
  "Page ",
479
- (((l = d == null ? void 0 : d.meta) == null ? void 0 : l.absolutePageIndex) ?? 0) + 1
483
+ (((d = a == null ? void 0 : a.meta) == null ? void 0 : d.absolutePageIndex) ?? 0) + 1
480
484
  ]
481
485
  }
482
486
  )
@@ -484,25 +488,25 @@ const Wt = (e, n, o) => {
484
488
  }
485
489
  );
486
490
  }
487
- ), Gt = g(
491
+ ), Gt = f(
488
492
  ({
489
493
  open: e,
490
- setOpen: n
494
+ setOpen: t
491
495
  }) => {
492
- const o = p(), r = v(() => o == null ? void 0 : o.spineItemsManager.items$, [o]);
493
- return /* @__PURE__ */ t(
494
- U,
496
+ const o = p(), i = b(() => o == null ? void 0 : o.spineItemsManager.items$, [o]);
497
+ return /* @__PURE__ */ n(
498
+ Y,
495
499
  {
496
500
  lazyMount: !0,
497
501
  placement: "center",
498
502
  open: e,
499
- onOpenChange: (i) => n(i.open),
503
+ onOpenChange: (r) => t(r.open),
500
504
  size: { mdDown: "full", md: "lg" },
501
505
  scrollBehavior: "inside",
502
506
  children: /* @__PURE__ */ c(V, { height: "100%", children: [
503
- /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Gallery" }) }),
504
- /* @__PURE__ */ t(K, { children: /* @__PURE__ */ t(
505
- P,
507
+ /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Gallery" }) }),
508
+ /* @__PURE__ */ n(Q, { children: /* @__PURE__ */ n(
509
+ A,
506
510
  {
507
511
  gridTemplateColumns: [
508
512
  "repeat(2, minmax(0, 1fr))",
@@ -512,220 +516,220 @@ const Wt = (e, n, o) => {
512
516
  gap: [2, 4],
513
517
  pt: 2,
514
518
  "data-grid": !0,
515
- children: r == null ? void 0 : r.map((i) => /* @__PURE__ */ t(
516
- jt,
519
+ children: i == null ? void 0 : i.map((r) => /* @__PURE__ */ n(
520
+ Vt,
517
521
  {
518
- item: i,
522
+ item: r,
519
523
  onNavigated: () => {
520
- n(!1);
524
+ t(!1);
521
525
  }
522
526
  },
523
- i.item.id
527
+ r.item.id
524
528
  ))
525
529
  }
526
530
  ) }),
527
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
528
- /* @__PURE__ */ t(Y, {})
531
+ /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(j, { variant: "outline", children: "Cancel" }) }) }),
532
+ /* @__PURE__ */ n(G, {})
529
533
  ] })
530
534
  }
531
535
  );
532
536
  }
533
- ), Vt = "@prose-reader/react-reader", Yt = "1.231.0", Ut = g(
537
+ ), Yt = "@prose-reader/react-reader", Ut = "1.233.0", qt = f(
534
538
  ({
535
539
  open: e,
536
- setOpen: n
537
- }) => /* @__PURE__ */ t(
538
- U,
540
+ setOpen: t
541
+ }) => /* @__PURE__ */ n(
542
+ Y,
539
543
  {
540
544
  lazyMount: !0,
541
545
  placement: "center",
542
546
  open: e,
543
- onOpenChange: (o) => n(o.open),
547
+ onOpenChange: (o) => t(o.open),
544
548
  size: { mdDown: "full", md: "lg" },
545
549
  scrollBehavior: "inside",
546
550
  children: /* @__PURE__ */ c(V, { children: [
547
- /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Help" }) }),
548
- /* @__PURE__ */ c(K, { overflowY: "auto", flex: 1, children: [
549
- /* @__PURE__ */ t(le, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
550
- /* @__PURE__ */ c(D, { mb: 1, children: [
551
- /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ t(et, {}) }),
551
+ /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Help" }) }),
552
+ /* @__PURE__ */ c(Q, { overflowY: "auto", flex: 1, children: [
553
+ /* @__PURE__ */ n(xe, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
554
+ /* @__PURE__ */ c(z, { mb: 1, children: [
555
+ /* @__PURE__ */ n(ve, { children: /* @__PURE__ */ n(et, {}) }),
552
556
  " ",
553
- /* @__PURE__ */ t(f, { children: "Navigate to right page" })
557
+ /* @__PURE__ */ n(g, { children: "Navigate to right page" })
554
558
  ] }),
555
- /* @__PURE__ */ c(D, { mb: 1, children: [
556
- /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ t(tt, {}) }),
559
+ /* @__PURE__ */ c(z, { mb: 1, children: [
560
+ /* @__PURE__ */ n(ve, { children: /* @__PURE__ */ n(tt, {}) }),
557
561
  " ",
558
- /* @__PURE__ */ t(f, { children: "Navigate to left page" })
562
+ /* @__PURE__ */ n(g, { children: "Navigate to left page" })
559
563
  ] }),
560
- /* @__PURE__ */ t(le, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
561
- /* @__PURE__ */ c(f, { children: [
562
- Vt,
564
+ /* @__PURE__ */ n(xe, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
565
+ /* @__PURE__ */ c(g, { children: [
566
+ Yt,
563
567
  " version: ",
564
- Yt
568
+ Ut
565
569
  ] })
566
570
  ] }),
567
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
568
- /* @__PURE__ */ t(Y, {})
571
+ /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(j, { variant: "outline", children: "Cancel" }) }) }),
572
+ /* @__PURE__ */ n(G, {})
569
573
  ] })
570
574
  }
571
575
  )
572
- ), $ = () => {
576
+ ), _ = () => {
573
577
  const e = p();
574
- return v(
575
- () => e ? We([e.pagination.state$, e.context.state$]).pipe(
576
- L(([n, o]) => {
577
- var i;
578
- const r = (i = o.manifest) == null ? void 0 : i.spineItems.every(
578
+ return b(
579
+ () => e ? Ve([e.pagination.state$, e.context.state$]).pipe(
580
+ M(([t, o]) => {
581
+ var r;
582
+ const i = (r = o.manifest) == null ? void 0 : r.spineItems.every(
579
583
  (s) => {
580
- var d;
581
- return (d = s.mediaType) == null ? void 0 : d.startsWith("image/");
584
+ var a;
585
+ return (a = s.mediaType) == null ? void 0 : a.startsWith("image/");
582
586
  }
583
587
  );
584
588
  return {
585
- ...n,
586
- hasChapters: !o.isFullyPrePaginated && !r
589
+ ...t,
590
+ hasChapters: !o.isFullyPrePaginated && !i
587
591
  };
588
592
  })
589
593
  ) : re,
590
594
  [e]
591
595
  );
592
- }, qt = () => {
593
- const e = $(), n = Math.floor(
596
+ }, Qt = () => {
597
+ const e = _(), t = Math.floor(
594
598
  ((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100
595
- ), o = n > 0 ? n : 1;
596
- return (e == null ? void 0 : e.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ t(P, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ c(f, { fontSize: "sm", children: [
599
+ ), o = t > 0 ? t : 1;
600
+ return (e == null ? void 0 : e.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ n(A, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ c(g, { fontSize: "sm", children: [
597
601
  o,
598
602
  " %"
599
603
  ] }) });
600
- }, Qt = () => {
601
- const [e, n] = k(/* @__PURE__ */ new Date());
602
- return j(() => {
604
+ }, Kt = () => {
605
+ const [e, t] = T(/* @__PURE__ */ new Date());
606
+ return W(() => {
603
607
  const o = setInterval(() => {
604
- n(/* @__PURE__ */ new Date());
608
+ t(/* @__PURE__ */ new Date());
605
609
  }, 6e4);
606
610
  return () => clearInterval(o);
607
611
  }, []), e;
608
- }, Kt = (e) => {
609
- const n = Qt();
610
- return /* @__PURE__ */ t(f, { fontSize: "xs", ...e, children: n.toLocaleTimeString(navigator.language, {
612
+ }, Zt = (e) => {
613
+ const t = Kt();
614
+ return /* @__PURE__ */ n(g, { fontSize: "xs", ...e, children: t.toLocaleTimeString(navigator.language, {
611
615
  hour: "2-digit",
612
616
  minute: "2-digit"
613
617
  }) });
614
- }, me = () => {
615
- const { quickMenuSignal: e } = J();
616
- return [_e(e), e.setValue, e];
617
- }, Zt = () => {
618
- const [e] = me();
619
- return /* @__PURE__ */ t(
620
- P,
618
+ }, fe = () => {
619
+ const { quickMenuSignal: e } = X();
620
+ return [He(e), e.setValue, e];
621
+ }, Xt = () => {
622
+ const [e] = fe();
623
+ return /* @__PURE__ */ n(
624
+ A,
621
625
  {
622
626
  position: "absolute",
623
627
  left: 0,
624
628
  bottom: 0,
625
629
  p: 2,
626
630
  color: e ? void 0 : "colorPalette.contrast",
627
- children: /* @__PURE__ */ t(Kt, {})
631
+ children: /* @__PURE__ */ n(Zt, {})
628
632
  }
629
633
  );
630
- }, Xt = () => {
634
+ }, Jt = () => {
631
635
  const e = p();
632
- E(
633
- () => e == null ? void 0 : e.links$.subscribe((n) => {
634
- if (n.type === "click" && ht(n.target, "a")) {
635
- if (!n.target.href) return;
636
- const o = new URL(n.target.href);
636
+ B(
637
+ () => e == null ? void 0 : e.links$.subscribe((t) => {
638
+ if (t.type === "click" && ut(t.target, "a")) {
639
+ if (!t.target.href) return;
640
+ const o = new URL(t.target.href);
637
641
  window.location.host !== o.host && confirm(
638
642
  "You are going to be redirected to external link"
639
- ) && window.open(n.target.href, "__blank");
643
+ ) && window.open(t.target.href, "__blank");
640
644
  }
641
645
  }),
642
646
  [e]
643
647
  );
644
- }, Jt = () => {
645
- const e = p(), { notificationsSubject: n } = J();
646
- E(
648
+ }, en = () => {
649
+ const e = p(), { notificationsSubject: t } = X();
650
+ B(
647
651
  () => e == null ? void 0 : e.zoom.isZooming$.pipe(
648
- F((o) => {
649
- if (!o) return je;
650
- const r = new he();
651
- return n.next({
652
+ D((o) => {
653
+ if (!o) return le;
654
+ const i = new de();
655
+ return t.next({
652
656
  key: "zoom",
653
657
  title: "Zooming",
654
658
  duration: 999999,
655
- abort: r
659
+ abort: i
656
660
  }), re.pipe(
657
- ke(() => {
658
- r.next(), r.complete();
661
+ we(() => {
662
+ i.next(), i.complete();
659
663
  })
660
664
  );
661
665
  })
662
666
  ),
663
667
  [e]
664
668
  );
665
- }, en = () => {
666
- const e = p(), { notificationsSubject: n } = J();
667
- E(
669
+ }, tn = () => {
670
+ const e = p(), { notificationsSubject: t } = X();
671
+ B(
668
672
  () => e == null ? void 0 : e.settings.values$.pipe(
669
- L(({ fontScale: o }) => o),
670
- Se(),
671
- we(1),
673
+ M(({ fontScale: o }) => o),
674
+ he(),
675
+ Pe(1),
672
676
  ue((o) => {
673
- n.next({
677
+ t.next({
674
678
  key: "fontScaleChange",
675
679
  title: "Font size changed",
676
680
  description: `${o * 100} %`
677
681
  });
678
682
  })
679
683
  ),
680
- [e, n]
684
+ [e, t]
681
685
  );
682
- }, tn = () => {
683
- const { notificationsSubject: e } = J();
684
- en(), Jt(), E(
686
+ }, nn = () => {
687
+ const { notificationsSubject: e } = X();
688
+ tn(), en(), B(
685
689
  () => e.pipe(
686
- ee(Ie),
687
- Ge((n) => {
688
- const o = n.duration ?? 3e3, r = ae.create({
689
- title: n.title,
690
- description: n.description,
690
+ J(ke),
691
+ Ge((t) => {
692
+ const o = t.duration ?? 3e3, i = ae.create({
693
+ title: t.title,
694
+ description: t.description,
691
695
  duration: o
692
- }), i = e.pipe(
693
- we(1),
694
- ee((s) => !!n.key && (s == null ? void 0 : s.key) === n.key)
696
+ }), r = e.pipe(
697
+ Pe(1),
698
+ J((s) => !!t.key && (s == null ? void 0 : s.key) === t.key)
695
699
  );
696
- return Ve(
697
- Ye(o),
698
- n.abort ?? re,
699
- i
700
+ return Re(
701
+ Ae(o),
702
+ t.abort ?? re,
703
+ r
700
704
  ).pipe(
701
705
  Te(),
702
- ke(() => {
703
- ae.dismiss(r);
706
+ we(() => {
707
+ ae.dismiss(i);
704
708
  })
705
709
  );
706
710
  })
707
711
  ),
708
712
  [e]
709
713
  );
710
- }, nn = z.forwardRef(
711
- function(n, o) {
714
+ }, on = E.forwardRef(
715
+ function(t, o) {
712
716
  const {
713
- showArrow: r,
714
- children: i,
717
+ showArrow: i,
718
+ children: r,
715
719
  portalled: s = !0,
716
- content: d,
717
- portalRef: l,
720
+ content: a,
721
+ portalRef: d,
718
722
  ...u
719
- } = n;
723
+ } = t;
720
724
  return /* @__PURE__ */ c(
721
- M.Root,
725
+ $.Root,
722
726
  {
723
727
  ...u,
724
728
  positioning: { ...u.positioning, gutter: 4 },
725
729
  children: [
726
- /* @__PURE__ */ t(M.Trigger, { asChild: !0, children: i }),
727
- /* @__PURE__ */ t(ge, { disabled: !s, container: l, children: /* @__PURE__ */ t(M.Positioner, { children: /* @__PURE__ */ c(
728
- M.Content,
730
+ /* @__PURE__ */ n($.Trigger, { asChild: !0, children: r }),
731
+ /* @__PURE__ */ n(ge, { disabled: !s, container: d, children: /* @__PURE__ */ n($.Positioner, { children: /* @__PURE__ */ c(
732
+ $.Content,
729
733
  {
730
734
  width: "auto",
731
735
  px: "2",
@@ -734,8 +738,8 @@ const Wt = (e, n, o) => {
734
738
  rounded: "sm",
735
739
  ref: o,
736
740
  children: [
737
- r && /* @__PURE__ */ t(M.Arrow, { children: /* @__PURE__ */ t(M.ArrowTip, {}) }),
738
- d
741
+ i && /* @__PURE__ */ n($.Arrow, { children: /* @__PURE__ */ n($.ArrowTip, {}) }),
742
+ a
739
743
  ]
740
744
  }
741
745
  ) }) })
@@ -743,63 +747,63 @@ const Wt = (e, n, o) => {
743
747
  }
744
748
  );
745
749
  }
746
- ), on = z.forwardRef(function(n, o) {
747
- const { children: r, ...i } = n;
748
- return /* @__PURE__ */ t(nn, { content: r, ...i, ref: o, children: /* @__PURE__ */ t(
750
+ ), rn = E.forwardRef(function(t, o) {
751
+ const { children: i, ...r } = t;
752
+ return /* @__PURE__ */ n(on, { content: i, ...r, ref: o, children: /* @__PURE__ */ n(
749
753
  I,
750
754
  {
751
755
  variant: "ghost",
752
756
  "aria-label": "info",
753
757
  size: "2xs",
754
758
  colorPalette: "gray",
755
- children: /* @__PURE__ */ t(xt, {})
759
+ children: /* @__PURE__ */ n(xt, {})
756
760
  }
757
761
  ) });
758
- }), rn = z.forwardRef(function(n, o) {
759
- return /* @__PURE__ */ t(H.Track, { ...n, ref: o, children: /* @__PURE__ */ t(H.Range, {}) });
762
+ }), sn = E.forwardRef(function(t, o) {
763
+ return /* @__PURE__ */ n(H.Track, { ...t, ref: o, children: /* @__PURE__ */ n(H.Range, {}) });
760
764
  });
761
- z.forwardRef(function(n, o) {
762
- const { children: r, info: i, ...s } = n;
765
+ E.forwardRef(function(t, o) {
766
+ const { children: i, info: r, ...s } = t;
763
767
  return /* @__PURE__ */ c(H.Label, { ...s, ref: o, children: [
764
- r,
765
- i && /* @__PURE__ */ t(on, { children: i })
768
+ i,
769
+ r && /* @__PURE__ */ n(rn, { children: r })
766
770
  ] });
767
771
  });
768
- const sn = H.Root, ln = H.ValueText, fe = () => {
769
- const e = $(), n = (e == null ? void 0 : e.numberOfTotalPages) === 1, o = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, r = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, i = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, s = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [d = 0, l = 0] = [
770
- i,
772
+ const ln = H.Root, an = H.ValueText, me = () => {
773
+ const e = _(), t = (e == null ? void 0 : e.numberOfTotalPages) === 1, o = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, i = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, r = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, s = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [a = 0, d = 0] = [
774
+ r,
771
775
  s
772
- ].sort((m, h) => m - h), u = (e == null ? void 0 : e.beginPageIndexInSpineItem) !== (e == null ? void 0 : e.endPageIndexInSpineItem) || (e == null ? void 0 : e.beginSpineItemIndex) !== (e == null ? void 0 : e.endSpineItemIndex), a = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
776
+ ].sort((x, h) => x - h), u = (e == null ? void 0 : e.beginPageIndexInSpineItem) !== (e == null ? void 0 : e.endPageIndexInSpineItem) || (e == null ? void 0 : e.beginSpineItemIndex) !== (e == null ? void 0 : e.endSpineItemIndex), l = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
773
777
  return {
774
- hasOnlyOnePage: n,
775
- beginPageIndex: i,
778
+ hasOnlyOnePage: t,
779
+ beginPageIndex: r,
776
780
  endPageIndex: s,
777
781
  isBeginWithinChapter: o,
778
- isEndWithinChapter: r,
782
+ isEndWithinChapter: i,
779
783
  beginAndEndAreDifferent: u,
780
- totalApproximatePages: a,
781
- leftPageIndex: d,
782
- rightPageIndex: l
784
+ totalApproximatePages: l,
785
+ leftPageIndex: a,
786
+ rightPageIndex: d
783
787
  };
784
- }, an = () => {
785
- const e = $(), {
786
- hasOnlyOnePage: n,
788
+ }, cn = () => {
789
+ const e = _(), {
790
+ hasOnlyOnePage: t,
787
791
  leftPageIndex: o,
788
- rightPageIndex: r,
789
- totalApproximatePages: i,
792
+ rightPageIndex: i,
793
+ totalApproximatePages: r,
790
794
  beginAndEndAreDifferent: s
791
- } = fe(), d = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), l = (a) => a != null && a.subChapter ? `${a.title} / ${l(a.subChapter)}` : (a == null ? void 0 : a.title) || "", u = l(e == null ? void 0 : e.beginChapterInfo);
792
- return /* @__PURE__ */ c(R, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
793
- /* @__PURE__ */ t(sn, { value: d, size: "xs", width: 150, children: /* @__PURE__ */ c(D, { justifyContent: "space-between", children: [
794
- /* @__PURE__ */ t(rn, { width: 110 }),
795
- /* @__PURE__ */ t(ln, { children: `${d}%` })
795
+ } = me(), a = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), d = (l) => l != null && l.subChapter ? `${l.title} / ${d(l.subChapter)}` : (l == null ? void 0 : l.title) || "", u = d(e == null ? void 0 : e.beginChapterInfo);
796
+ return /* @__PURE__ */ c(P, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
797
+ /* @__PURE__ */ n(ln, { value: a, size: "xs", width: 150, children: /* @__PURE__ */ c(z, { justifyContent: "space-between", children: [
798
+ /* @__PURE__ */ n(sn, { width: 110 }),
799
+ /* @__PURE__ */ n(an, { children: `${a}%` })
796
800
  ] }) }),
797
- /* @__PURE__ */ t(f, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
798
- !n && /* @__PURE__ */ c(D, { children: [
799
- /* @__PURE__ */ t(f, { fontSize: "xs", children: s ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
801
+ /* @__PURE__ */ n(g, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
802
+ !t && /* @__PURE__ */ c(z, { children: [
803
+ /* @__PURE__ */ n(g, { fontSize: "xs", children: s ? `${o + 1} - ${i + 1} of ${r}` : `${o + 1} of ${r}` }),
800
804
  !!(e != null && e.hasChapters) && /* @__PURE__ */ c(oe, { children: [
801
- /* @__PURE__ */ t(f, { children: "-" }),
802
- /* @__PURE__ */ c(f, { fontSize: "xs", children: [
805
+ /* @__PURE__ */ n(g, { children: "-" }),
806
+ /* @__PURE__ */ c(g, { fontSize: "xs", children: [
803
807
  "(",
804
808
  ((e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0) + 1,
805
809
  ")"
@@ -807,20 +811,20 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
807
811
  ] })
808
812
  ] })
809
813
  ] });
810
- }, De = g(
814
+ }, Be = f(
811
815
  ({
812
816
  children: e,
813
- position: n,
817
+ position: t,
814
818
  ...o
815
- }) => /* @__PURE__ */ t(
819
+ }) => /* @__PURE__ */ n(
816
820
  te,
817
821
  {
818
822
  display: "flex",
819
823
  flexDirection: "row",
820
824
  width: "100%",
821
825
  position: "absolute",
822
- ...n === "bottom" ? { bottom: 0 } : { top: 0 },
823
- animationName: n === "bottom" ? {
826
+ ...t === "bottom" ? { bottom: 0 } : { top: 0 },
827
+ animationName: t === "bottom" ? {
824
828
  _open: "slide-from-bottom, fade-in",
825
829
  _closed: "slide-to-bottom, fade-out"
826
830
  } : {
@@ -837,8 +841,8 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
837
841
  children: e
838
842
  }
839
843
  )
840
- ), cn = Ke(vt), dn = g((e) => /* @__PURE__ */ t(
841
- P,
844
+ ), dn = Ke(vt), un = f((e) => /* @__PURE__ */ n(
845
+ A,
842
846
  {
843
847
  display: "contents",
844
848
  css: {
@@ -846,8 +850,8 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
846
850
  "--bg-emphasized": "colors.bg.emphasized",
847
851
  "--color-solid": "colors.colorPalette.solid"
848
852
  },
849
- children: /* @__PURE__ */ t(
850
- cn,
853
+ children: /* @__PURE__ */ n(
854
+ dn,
851
855
  {
852
856
  keyboard: !1,
853
857
  style: {
@@ -892,65 +896,65 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
892
896
  )
893
897
  }
894
898
  )), hn = () => {
895
- const e = $(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = fe(), i = n ? Math.floor((o || 0) / 2) : o, [s, d] = Ce(
896
- () => de({
897
- default: i || 0
899
+ const e = _(), t = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: i = 0 } = me(), r = t ? Math.floor((o || 0) / 2) : o, [s, a] = Se(
900
+ () => ce({
901
+ default: r || 0
898
902
  })
899
- ), l = 0, u = Math.max(
903
+ ), d = 0, u = Math.max(
900
904
  0,
901
- n ? Math.floor((r - 1) / 2) : r - 1
905
+ t ? Math.floor((i - 1) / 2) : i - 1
902
906
  );
903
- return j(() => {
904
- d.update(i || 0);
905
- }, [i, d]), {
907
+ return W(() => {
908
+ a.update(r || 0);
909
+ }, [r, a]), {
906
910
  value: s,
907
- valueSignal: d,
908
- min: l,
911
+ valueSignal: a,
912
+ min: d,
909
913
  max: u
910
914
  };
911
- }, un = (e) => {
912
- const n = p(), o = $(), { manifest: r } = v(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, i = (r == null ? void 0 : r.readingDirection) === "rtl", s = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: d = 0, isBeginWithinChapter: l } = fe(), u = 1, a = l, { value: m, valueSignal: h, min: b, max: y } = hn(), C = N(
913
- (A) => {
914
- const [x = 0] = Array.isArray(A) ? A : [A];
915
- h.setValue(x);
916
- const _ = s ? Math.floor(x) * 2 : Math.floor(x);
917
- a ? n == null || n.navigation.goToPageOfSpineItem({
918
- pageIndex: _,
919
- spineItemId: n.pagination.state.beginSpineItemIndex ?? 0,
915
+ }, gn = (e) => {
916
+ const t = p(), o = _(), { manifest: i } = b(() => t == null ? void 0 : t.context.state$, [t]) ?? {}, r = (i == null ? void 0 : i.readingDirection) === "rtl", s = o == null ? void 0 : o.isUsingSpread, { totalApproximatePages: a = 0, isBeginWithinChapter: d } = me(), u = 1, l = d, { value: x, valueSignal: h, min: m, max: S } = hn(), C = N(
917
+ (R) => {
918
+ const [v = 0] = Array.isArray(R) ? R : [R];
919
+ h.setValue(v);
920
+ const be = s ? Math.floor(v) * 2 : Math.floor(v);
921
+ l ? t == null || t.navigation.goToPageOfSpineItem({
922
+ pageIndex: be,
923
+ spineItemId: t.pagination.state.beginSpineItemIndex ?? 0,
920
924
  animation: !1
921
- }) : n == null || n.navigation.goToAbsolutePageIndex({
922
- absolutePageIndex: _,
925
+ }) : t == null || t.navigation.goToAbsolutePageIndex({
926
+ absolutePageIndex: be,
923
927
  animation: !1
924
928
  });
925
929
  },
926
- [n, s, h, a]
930
+ [t, s, h, l]
927
931
  );
928
- return E(
929
- () => n == null ? void 0 : n.navigation.throttleLock({
932
+ return B(
933
+ () => t == null ? void 0 : t.navigation.throttleLock({
930
934
  duration: 100,
931
935
  trigger: h.subject
932
936
  }),
933
- [n, h]
934
- ), d === 1 || s && d === 2 ? /* @__PURE__ */ t(P, { style: e.style }) : /* @__PURE__ */ t(
935
- dn,
937
+ [t, h]
938
+ ), a === 1 || s && a === 2 ? /* @__PURE__ */ n(A, { style: e.style }) : /* @__PURE__ */ n(
939
+ un,
936
940
  {
937
- value: [m],
938
- max: y,
939
- min: b,
940
- reverse: i,
941
+ value: [x],
942
+ max: S,
943
+ min: m,
944
+ reverse: r,
941
945
  step: u,
942
946
  onChange: C,
943
947
  ...e
944
948
  }
945
949
  );
946
- }, gn = g(
950
+ }, pn = f(
947
951
  ({
948
952
  open: e,
949
- onItemClick: n
953
+ onItemClick: t
950
954
  }) => {
951
- const o = p(), r = v(() => o == null ? void 0 : o.navigation.state$, [o]), i = v(() => o == null ? void 0 : o.settings.values$, [o]), s = (i == null ? void 0 : i.computedPageTurnDirection) === "vertical", [d, l] = k(!0);
955
+ const o = p(), i = b(() => o == null ? void 0 : o.navigation.state$, [o]), r = b(() => o == null ? void 0 : o.settings.values$, [o]), s = (r == null ? void 0 : r.computedPageTurnDirection) === "vertical", [a, d] = T(!0);
952
956
  return /* @__PURE__ */ c(
953
- De,
957
+ Be,
954
958
  {
955
959
  present: e,
956
960
  position: "bottom",
@@ -960,14 +964,14 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
960
964
  pb: 8,
961
965
  children: [
962
966
  /* @__PURE__ */ c(
963
- D,
967
+ z,
964
968
  {
965
969
  flex: 1,
966
970
  alignItems: "center",
967
971
  justifyContent: "center",
968
972
  maxWidth: "100%",
969
973
  children: [
970
- /* @__PURE__ */ t(
974
+ /* @__PURE__ */ n(
971
975
  I,
972
976
  {
973
977
  "aria-label": "left",
@@ -975,12 +979,12 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
975
979
  variant: "ghost",
976
980
  flexShrink: 0,
977
981
  onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
978
- disabled: !(r != null && r.canGoLeftSpineItem) && !(r != null && r.canGoTopSpineItem),
979
- children: s ? /* @__PURE__ */ t(pt, {}) : /* @__PURE__ */ t(mt, {})
982
+ disabled: !(i != null && i.canGoLeftSpineItem) && !(i != null && i.canGoTopSpineItem),
983
+ children: s ? /* @__PURE__ */ n(pt, {}) : /* @__PURE__ */ n(ft, {})
980
984
  }
981
985
  ),
982
986
  /* @__PURE__ */ c(
983
- R,
987
+ P,
984
988
  {
985
989
  flex: 1,
986
990
  maxW: 400,
@@ -989,9 +993,9 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
989
993
  overflow: "auto",
990
994
  px: 4,
991
995
  children: [
992
- /* @__PURE__ */ t(an, {}),
993
- /* @__PURE__ */ t(
994
- un,
996
+ /* @__PURE__ */ n(cn, {}),
997
+ /* @__PURE__ */ n(
998
+ gn,
995
999
  {
996
1000
  style: {
997
1001
  width: "100%",
@@ -1003,101 +1007,101 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1003
1007
  ]
1004
1008
  }
1005
1009
  ),
1006
- /* @__PURE__ */ t(
1010
+ /* @__PURE__ */ n(
1007
1011
  I,
1008
1012
  {
1009
1013
  "aria-label": "right",
1010
1014
  size: "lg",
1011
1015
  flexShrink: 0,
1012
1016
  variant: "ghost",
1013
- disabled: !(r != null && r.canGoRightSpineItem) && !(r != null && r.canGoBottomSpineItem),
1017
+ disabled: !(i != null && i.canGoRightSpineItem) && !(i != null && i.canGoBottomSpineItem),
1014
1018
  onClick: () => {
1015
1019
  o == null || o.navigation.goToRightOrBottomSpineItem();
1016
1020
  },
1017
- children: s ? /* @__PURE__ */ t(ft, {}) : /* @__PURE__ */ t(bt, {})
1021
+ children: s ? /* @__PURE__ */ n(mt, {}) : /* @__PURE__ */ n(bt, {})
1018
1022
  }
1019
1023
  )
1020
1024
  ]
1021
1025
  }
1022
1026
  ),
1023
- /* @__PURE__ */ t(D, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ c(
1027
+ /* @__PURE__ */ n(z, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ c(
1024
1028
  se.Root,
1025
1029
  {
1026
- open: d,
1030
+ open: a,
1027
1031
  flex: 1,
1028
1032
  onOpenChange: ({ open: u }) => {
1029
- l(u);
1033
+ d(u);
1030
1034
  },
1031
1035
  children: [
1032
- /* @__PURE__ */ t(
1036
+ /* @__PURE__ */ n(
1033
1037
  se.Trigger,
1034
1038
  {
1035
1039
  paddingY: "3",
1036
1040
  width: "100%",
1037
1041
  display: "flex",
1038
1042
  justifyContent: "center",
1039
- children: /* @__PURE__ */ t(
1043
+ children: /* @__PURE__ */ n(
1040
1044
  nt,
1041
1045
  {
1042
1046
  style: {
1043
- transform: d ? "rotate(0deg)" : "rotate(180deg)"
1047
+ transform: a ? "rotate(0deg)" : "rotate(180deg)"
1044
1048
  }
1045
1049
  }
1046
1050
  )
1047
1051
  }
1048
1052
  ),
1049
1053
  /* @__PURE__ */ c(se.Content, { display: "flex", justifyContent: "center", children: [
1050
- /* @__PURE__ */ t(
1054
+ /* @__PURE__ */ n(
1051
1055
  I,
1052
1056
  {
1053
1057
  "aria-label": "Help",
1054
1058
  size: "lg",
1055
1059
  variant: "ghost",
1056
- onClick: () => n("help"),
1057
- children: /* @__PURE__ */ t(ot, {})
1060
+ onClick: () => t("help"),
1061
+ children: /* @__PURE__ */ n(ot, {})
1058
1062
  }
1059
1063
  ),
1060
- /* @__PURE__ */ t(
1064
+ /* @__PURE__ */ n(
1061
1065
  I,
1062
1066
  {
1063
1067
  "aria-label": "Table of contents",
1064
1068
  size: "lg",
1065
1069
  variant: "ghost",
1066
- onClick: () => n("toc"),
1067
- children: /* @__PURE__ */ t(rt, {})
1070
+ onClick: () => t("toc"),
1071
+ children: /* @__PURE__ */ n(rt, {})
1068
1072
  }
1069
1073
  ),
1070
- Re(o) && /* @__PURE__ */ t(
1074
+ De(o) && /* @__PURE__ */ n(
1071
1075
  I,
1072
1076
  {
1073
1077
  "aria-label": "Search",
1074
1078
  size: "lg",
1075
1079
  variant: "ghost",
1076
- onClick: () => n("search"),
1077
- children: /* @__PURE__ */ t(it, {})
1080
+ onClick: () => t("search"),
1081
+ children: /* @__PURE__ */ n(it, {})
1078
1082
  }
1079
1083
  ),
1080
- W(o) && /* @__PURE__ */ t(
1084
+ F(o) && /* @__PURE__ */ n(
1081
1085
  I,
1082
1086
  {
1083
1087
  "aria-label": "Bookmarks",
1084
1088
  size: "lg",
1085
1089
  variant: "ghost",
1086
- onClick: () => n("bookmarks"),
1087
- children: /* @__PURE__ */ t(ut, {})
1090
+ onClick: () => t("bookmarks"),
1091
+ children: /* @__PURE__ */ n(ht, {})
1088
1092
  }
1089
1093
  ),
1090
- W(o) && /* @__PURE__ */ t(
1094
+ F(o) && /* @__PURE__ */ n(
1091
1095
  I,
1092
1096
  {
1093
1097
  "aria-label": "Annotations",
1094
1098
  size: "lg",
1095
1099
  variant: "ghost",
1096
- onClick: () => n("annotations"),
1097
- children: /* @__PURE__ */ t(ne, {})
1100
+ onClick: () => t("annotations"),
1101
+ children: /* @__PURE__ */ n(ne, {})
1098
1102
  }
1099
1103
  ),
1100
- /* @__PURE__ */ t(
1104
+ /* @__PURE__ */ n(
1101
1105
  I,
1102
1106
  {
1103
1107
  "aria-label": "Thumbnails",
@@ -1108,17 +1112,17 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1108
1112
  viewportMode: (o == null ? void 0 : o.settings.values.viewportMode) === "normal" ? "thumbnails" : "normal"
1109
1113
  });
1110
1114
  },
1111
- children: /* @__PURE__ */ t(st, {})
1115
+ children: /* @__PURE__ */ n(st, {})
1112
1116
  }
1113
1117
  ),
1114
- Ae(o) && /* @__PURE__ */ t(
1118
+ ze(o) && /* @__PURE__ */ n(
1115
1119
  I,
1116
1120
  {
1117
1121
  "aria-label": "Gallery",
1118
1122
  size: "lg",
1119
1123
  variant: "ghost",
1120
- onClick: () => n("gallery"),
1121
- children: /* @__PURE__ */ t(gt, {})
1124
+ onClick: () => t("gallery"),
1125
+ children: /* @__PURE__ */ n(gt, {})
1122
1126
  }
1123
1127
  )
1124
1128
  ] })
@@ -1129,50 +1133,50 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1129
1133
  }
1130
1134
  );
1131
1135
  }
1132
- ), pn = () => {
1133
- const [e, n] = k(!1), o = N(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1134
- n(!1);
1136
+ ), fn = () => {
1137
+ const [e, t] = T(!1), o = N(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1138
+ t(!1);
1135
1139
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
1136
- n(!0);
1140
+ t(!0);
1137
1141
  }), []);
1138
- return j(() => {
1139
- function r() {
1140
- n(!!document.fullscreenElement);
1142
+ return W(() => {
1143
+ function i() {
1144
+ t(!!document.fullscreenElement);
1141
1145
  }
1142
- return document.addEventListener("fullscreenchange", r), () => {
1143
- document.removeEventListener("fullscreenchange", r);
1146
+ return document.addEventListener("fullscreenchange", i), () => {
1147
+ document.removeEventListener("fullscreenchange", i);
1144
1148
  };
1145
1149
  }, []), {
1146
1150
  isFullscreen: e,
1147
1151
  onToggleFullscreenClick: o
1148
1152
  };
1149
- }, mn = g(
1153
+ }, mn = f(
1150
1154
  ({
1151
1155
  open: e,
1152
- onItemClick: n
1156
+ onItemClick: t
1153
1157
  }) => {
1154
- const o = p(), r = v(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: s } = pn();
1158
+ const o = p(), i = b(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: r, onToggleFullscreenClick: s } = fn();
1155
1159
  return /* @__PURE__ */ c(
1156
- De,
1160
+ Be,
1157
1161
  {
1158
1162
  present: e,
1159
1163
  position: "top",
1160
1164
  height: "80px",
1161
1165
  justifyContent: "space-between",
1162
1166
  children: [
1163
- /* @__PURE__ */ t(
1167
+ /* @__PURE__ */ n(
1164
1168
  I,
1165
1169
  {
1166
1170
  "aria-label": "left",
1167
1171
  size: "lg",
1168
1172
  variant: "ghost",
1169
1173
  flexShrink: 0,
1170
- onClick: () => n("back"),
1171
- children: /* @__PURE__ */ t(Ct, {})
1174
+ onClick: () => t("back"),
1175
+ children: /* @__PURE__ */ n(Ct, {})
1172
1176
  }
1173
1177
  ),
1174
- /* @__PURE__ */ t(
1175
- R,
1178
+ /* @__PURE__ */ n(
1179
+ P,
1176
1180
  {
1177
1181
  flex: 1,
1178
1182
  maxW: 600,
@@ -1180,22 +1184,22 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1180
1184
  alignItems: "center",
1181
1185
  overflow: "auto",
1182
1186
  px: 4,
1183
- children: /* @__PURE__ */ t(f, { truncate: !0, maxWidth: "100%", children: r == null ? void 0 : r.title })
1187
+ children: /* @__PURE__ */ n(g, { truncate: !0, maxWidth: "100%", children: i == null ? void 0 : i.title })
1184
1188
  }
1185
1189
  ),
1186
- /* @__PURE__ */ c(D, { children: [
1187
- /* @__PURE__ */ t(
1190
+ /* @__PURE__ */ c(z, { children: [
1191
+ /* @__PURE__ */ n(
1188
1192
  I,
1189
1193
  {
1190
1194
  "aria-label": "right",
1191
1195
  size: "lg",
1192
1196
  flexShrink: 0,
1193
1197
  variant: "ghost",
1194
- onClick: () => n("more"),
1195
- children: /* @__PURE__ */ t(It, {})
1198
+ onClick: () => t("more"),
1199
+ children: /* @__PURE__ */ n(It, {})
1196
1200
  }
1197
1201
  ),
1198
- /* @__PURE__ */ t(
1202
+ /* @__PURE__ */ n(
1199
1203
  I,
1200
1204
  {
1201
1205
  "aria-label": "right",
@@ -1203,7 +1207,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1203
1207
  flexShrink: 0,
1204
1208
  variant: "ghost",
1205
1209
  onClick: s,
1206
- children: i ? /* @__PURE__ */ t(yt, {}) : /* @__PURE__ */ t(St, {})
1210
+ children: r ? /* @__PURE__ */ n(St, {}) : /* @__PURE__ */ n(yt, {})
1207
1211
  }
1208
1212
  )
1209
1213
  ] })
@@ -1211,121 +1215,142 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1211
1215
  }
1212
1216
  );
1213
1217
  }
1214
- ), fn = g(
1218
+ ), bn = f(
1215
1219
  ({
1216
1220
  onItemClick: e
1217
1221
  }) => {
1218
- const [n] = me();
1222
+ const [t] = fe();
1219
1223
  return /* @__PURE__ */ c(oe, { children: [
1220
- /* @__PURE__ */ t(mn, { open: n, onItemClick: e }),
1221
- /* @__PURE__ */ t(gn, { open: n, onItemClick: e })
1224
+ /* @__PURE__ */ n(mn, { open: t, onItemClick: e }),
1225
+ /* @__PURE__ */ n(pn, { open: t, onItemClick: e })
1222
1226
  ] });
1223
1227
  }
1224
- ), bn = g(
1228
+ ), xn = f(
1225
1229
  ({
1226
1230
  contextText: e = "",
1227
- startOffset: n = 0,
1231
+ startOffset: t = 0,
1228
1232
  text: o,
1229
- cfi: r = "#",
1230
- onClick: i,
1233
+ cfi: i = "#",
1234
+ onClick: r,
1231
1235
  absolutePageIndex: s
1232
1236
  }) => {
1233
- const l = e.substring(
1234
- Math.max(n - 15, 0),
1235
- Math.max(n, 0)
1237
+ const d = e.substring(
1238
+ Math.max(t - 15, 0),
1239
+ Math.max(t, 0)
1236
1240
  ), u = e.substring(
1237
- Math.min(n + o.length, e.length - 1),
1241
+ Math.min(t + o.length, e.length - 1),
1238
1242
  Math.min(
1239
- n + o.length + 15,
1243
+ t + o.length + 15,
1240
1244
  e.length - 1
1241
1245
  )
1242
1246
  );
1243
1247
  return /* @__PURE__ */ c(
1244
1248
  pe,
1245
1249
  {
1246
- href: r,
1250
+ href: i,
1247
1251
  style: { margin: 5, overflow: "hidden" },
1248
- onClick: (a) => {
1249
- a.preventDefault(), i(r);
1252
+ onClick: (l) => {
1253
+ l.preventDefault(), r(i);
1250
1254
  },
1251
1255
  display: "flex",
1252
1256
  flexDirection: "column",
1253
1257
  alignItems: "flex-start",
1254
1258
  gap: 0,
1255
1259
  children: [
1256
- /* @__PURE__ */ c(f, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1260
+ /* @__PURE__ */ c(g, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1257
1261
  '"',
1258
- l,
1259
- /* @__PURE__ */ t("b", { children: o }),
1262
+ d,
1263
+ /* @__PURE__ */ n("b", { children: o }),
1260
1264
  u,
1261
1265
  '"'
1262
1266
  ] }),
1263
- /* @__PURE__ */ t(f, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${s !== void 0 ? s + 1 : "unknown (not loaded)"}` })
1267
+ /* @__PURE__ */ n(g, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${s !== void 0 ? s + 1 : "unknown (not loaded)"}` })
1264
1268
  ]
1265
1269
  }
1266
1270
  );
1267
1271
  }
1268
- ), xn = g(
1272
+ ), vn = 500, Cn = () => {
1273
+ const e = ye(() => new Ye("")), t = b(e), o = p(), i = De(o) ? o : void 0, r = b(() => e.pipe(
1274
+ he(),
1275
+ D(
1276
+ (s) => s === "" || !i ? ee(void 0) : Re(
1277
+ ee({
1278
+ type: "start",
1279
+ data: void 0
1280
+ }),
1281
+ Ae(vn).pipe(
1282
+ D(() => i.search.search(s)),
1283
+ M((a) => ({ type: "end", data: a }))
1284
+ )
1285
+ )
1286
+ )
1287
+ ), [i, e]);
1288
+ return {
1289
+ value: t,
1290
+ setValue: e.next.bind(e),
1291
+ status: (r == null ? void 0 : r.type) ?? "idle",
1292
+ data: r == null ? void 0 : r.data
1293
+ };
1294
+ }, In = f(
1269
1295
  ({
1270
1296
  onNavigate: e
1271
1297
  }) => {
1272
- const [n, o] = k(""), r = p(), i = Re(r) ? r : void 0, s = (h) => {
1273
- o(h.target.value);
1298
+ const t = p(), { value: o, setValue: i, status: r, data: s } = Cn(), a = (l) => {
1299
+ i(l.target.value);
1274
1300
  }, d = N(
1275
- (h) => {
1276
- e(), r == null || r.navigation.goToCfi(h);
1301
+ (l) => {
1302
+ e(), t == null || t.navigation.goToCfi(l);
1277
1303
  },
1278
- [r, e]
1279
- ), l = v(
1280
- () => i == null ? void 0 : i.search.search(n).pipe(
1281
- L((h) => ({ type: "end", data: h })),
1282
- ye({ type: "start" })
1283
- ),
1284
- [r, n]
1285
- ), u = (l == null ? void 0 : l.type) === "start", a = (l == null ? void 0 : l.type) === "end" ? l.data : [], m = v(
1286
- () => r == null ? void 0 : r.locateResource(a.slice(0, 100)),
1287
- [a]
1304
+ [t, e]
1305
+ ), u = b(
1306
+ () => t == null ? void 0 : t.locateResource((s == null ? void 0 : s.slice(0, 100)) ?? []),
1307
+ [s]
1288
1308
  );
1289
- return /* @__PURE__ */ c(R, { flex: 1, height: "100%", children: [
1290
- /* @__PURE__ */ t(P, { px: 4, children: /* @__PURE__ */ t(
1309
+ return /* @__PURE__ */ c(P, { flex: 1, height: "100%", gap: 2, children: [
1310
+ /* @__PURE__ */ n(
1291
1311
  Ze,
1292
1312
  {
1293
1313
  placeholder: "Type something...",
1294
- value: n,
1295
- onChange: s,
1296
- borderRadius: 0
1314
+ value: o,
1315
+ onChange: a,
1316
+ flexShrink: 0,
1317
+ variant: "subtle",
1318
+ name: "search",
1319
+ focusRing: "none",
1320
+ focusVisibleRing: "none",
1321
+ outline: "none",
1322
+ focusRingColor: "transparent"
1297
1323
  }
1298
- ) }),
1324
+ ),
1299
1325
  /* @__PURE__ */ c(
1300
1326
  P,
1301
1327
  {
1328
+ style: { overflow: "hidden", overflowY: "auto" },
1329
+ overflow: "auto",
1302
1330
  px: 4,
1303
- pb: 4,
1304
- mt: 2,
1305
1331
  flex: 1,
1306
- style: { overflow: "hidden", overflowY: "auto" },
1307
1332
  children: [
1308
- u && /* @__PURE__ */ t(f, { children: "Searching ..." }),
1309
- !u && a.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
1310
- !u && a.length >= 0 && /* @__PURE__ */ c(R, { children: [
1311
- /* @__PURE__ */ c(le, { as: "h2", size: "md", children: [
1312
- a.length,
1333
+ r === "start" && /* @__PURE__ */ n(g, { children: "Searching ..." }),
1334
+ (s == null ? void 0 : s.length) === 0 && /* @__PURE__ */ n(g, { children: "No results" }),
1335
+ r === "end" && ((s == null ? void 0 : s.length) ?? 0) > 0 && /* @__PURE__ */ c(P, { children: [
1336
+ /* @__PURE__ */ c(g, { fontSize: "md", children: [
1337
+ s == null ? void 0 : s.length,
1313
1338
  " result(s)"
1314
1339
  ] }),
1315
- /* @__PURE__ */ t(R, { gap: 0, children: m == null ? void 0 : m.map((h, b) => {
1316
- var y, C, T, A, x, _, be;
1317
- return /* @__PURE__ */ t(
1318
- bn,
1340
+ /* @__PURE__ */ n(P, { gap: 0, children: u == null ? void 0 : u.map((l, x) => {
1341
+ var h, m, S, C, k, R, v;
1342
+ return /* @__PURE__ */ n(
1343
+ xn,
1319
1344
  {
1320
- contextText: ((T = (C = (y = h.meta) == null ? void 0 : y.range) == null ? void 0 : C.startContainer.parentElement) == null ? void 0 : T.textContent) ?? "",
1321
- pageIndex: (A = h.meta) == null ? void 0 : A.itemPageIndex,
1322
- startOffset: ((_ = (x = h.meta) == null ? void 0 : x.range) == null ? void 0 : _.startOffset) ?? 0,
1323
- text: n,
1324
- cfi: h.meta.cfi,
1345
+ contextText: ((S = (m = (h = l.meta) == null ? void 0 : h.range) == null ? void 0 : m.startContainer.parentElement) == null ? void 0 : S.textContent) ?? "",
1346
+ pageIndex: (C = l.meta) == null ? void 0 : C.itemPageIndex,
1347
+ startOffset: ((R = (k = l.meta) == null ? void 0 : k.range) == null ? void 0 : R.startOffset) ?? 0,
1348
+ text: o,
1349
+ cfi: l.meta.cfi,
1325
1350
  onClick: d,
1326
- absolutePageIndex: (be = h.meta) == null ? void 0 : be.absolutePageIndex
1351
+ absolutePageIndex: (v = l.meta) == null ? void 0 : v.absolutePageIndex
1327
1352
  },
1328
- b
1353
+ x
1329
1354
  );
1330
1355
  }) })
1331
1356
  ] })
@@ -1334,43 +1359,43 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1334
1359
  )
1335
1360
  ] });
1336
1361
  }
1337
- ), vn = g(
1362
+ ), Sn = f(
1338
1363
  ({
1339
1364
  open: e,
1340
- setOpen: n,
1365
+ setOpen: t,
1341
1366
  onNavigate: o
1342
- }) => /* @__PURE__ */ t(
1343
- U,
1367
+ }) => /* @__PURE__ */ n(
1368
+ Y,
1344
1369
  {
1345
1370
  lazyMount: !0,
1346
1371
  placement: "center",
1347
1372
  open: e,
1348
- onOpenChange: (r) => n(r.open),
1373
+ onOpenChange: (i) => t(i.open),
1349
1374
  size: { mdDown: "full", md: "lg" },
1350
1375
  scrollBehavior: "inside",
1351
1376
  children: /* @__PURE__ */ c(V, { height: "100%", children: [
1352
- /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Search" }) }),
1353
- /* @__PURE__ */ t(K, { flex: 1, children: /* @__PURE__ */ t(xn, { onNavigate: o }) }),
1354
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
1355
- /* @__PURE__ */ t(Y, {})
1377
+ /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Search" }) }),
1378
+ /* @__PURE__ */ n(Q, { flex: 1, p: 0, children: /* @__PURE__ */ n(In, { onNavigate: o }) }),
1379
+ /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(j, { variant: "outline", children: "Cancel" }) }) }),
1380
+ /* @__PURE__ */ n(G, {})
1356
1381
  ] })
1357
1382
  }
1358
1383
  )
1359
- ), Cn = g(
1384
+ ), yn = f(
1360
1385
  ({
1361
1386
  onNavigate: e
1362
1387
  }) => {
1363
- const n = p(), { manifest: o, assumedRenditionLayout: r } = v(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, { nav: i } = o ?? {}, s = $();
1364
- i != null && i.toc;
1365
- const { beginSpineItemIndex: d, beginPageIndexInSpineItem: l } = s ?? {}, u = (r === "reflowable" ? l : d) || 0;
1366
- let a = s == null ? void 0 : s.beginChapterInfo;
1367
- for (; a != null && a.subChapter; )
1368
- a = a == null ? void 0 : a.subChapter;
1369
- const m = (h, b, y) => /* @__PURE__ */ c(ze.Fragment, { children: [
1370
- /* @__PURE__ */ t(
1388
+ const t = p(), { manifest: o, assumedRenditionLayout: i } = b(() => t == null ? void 0 : t.context.state$, [t]) ?? {}, { nav: r } = o ?? {}, s = _();
1389
+ r != null && r.toc;
1390
+ const { beginSpineItemIndex: a, beginPageIndexInSpineItem: d } = s ?? {}, u = (i === "reflowable" ? d : a) || 0;
1391
+ let l = s == null ? void 0 : s.beginChapterInfo;
1392
+ for (; l != null && l.subChapter; )
1393
+ l = l == null ? void 0 : l.subChapter;
1394
+ const x = (h, m, S) => /* @__PURE__ */ c(Me.Fragment, { children: [
1395
+ /* @__PURE__ */ n(
1371
1396
  w.Item,
1372
1397
  {
1373
- pl: 4 * (y + 1),
1398
+ pl: 4 * (S + 1),
1374
1399
  style: {
1375
1400
  display: "flex",
1376
1401
  alignItems: "center"
@@ -1379,16 +1404,16 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1379
1404
  pe,
1380
1405
  {
1381
1406
  onClick: () => {
1382
- e(), n == null || n.navigation.goToUrl(h.href);
1407
+ e(), t == null || t.navigation.goToUrl(h.href);
1383
1408
  },
1384
1409
  href: "#",
1385
1410
  children: [
1386
- (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(w.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ve, {}) }),
1387
- (a == null ? void 0 : a.path) !== h.path && /* @__PURE__ */ t(w.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ve, {}) }),
1388
- /* @__PURE__ */ c(R, { gap: 0, children: [
1389
- /* @__PURE__ */ t(f, { fontSize: "md", children: h.title || h.path }),
1390
- (a == null ? void 0 : a.path) === h.path && /* @__PURE__ */ t(
1391
- f,
1411
+ (l == null ? void 0 : l.path) === h.path && /* @__PURE__ */ n(w.Indicator, { asChild: !0, children: /* @__PURE__ */ n(Ce, {}) }),
1412
+ (l == null ? void 0 : l.path) !== h.path && /* @__PURE__ */ n(w.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ n(Ce, {}) }),
1413
+ /* @__PURE__ */ c(P, { gap: 0, children: [
1414
+ /* @__PURE__ */ n(g, { fontSize: "md", children: h.title || h.path }),
1415
+ (l == null ? void 0 : l.path) === h.path && /* @__PURE__ */ n(
1416
+ g,
1392
1417
  {
1393
1418
  fontStyle: "italic",
1394
1419
  fontWeight: "bold",
@@ -1402,101 +1427,101 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
1402
1427
  )
1403
1428
  }
1404
1429
  ),
1405
- h.contents.length > 0 && /* @__PURE__ */ t(w.Root, { as: "div", gap: 2, children: h.contents.map(
1406
- (C, T) => m(C, T, y + 1)
1430
+ h.contents.length > 0 && /* @__PURE__ */ n(w.Root, { as: "div", gap: 2, children: h.contents.map(
1431
+ (C, k) => x(C, k, S + 1)
1407
1432
  ) })
1408
- ] }, b);
1409
- return /* @__PURE__ */ t(w.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i == null ? void 0 : i.toc.map((h, b) => m(h, b, 0)) });
1433
+ ] }, m);
1434
+ return /* @__PURE__ */ n(w.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: r == null ? void 0 : r.toc.map((h, m) => x(h, m, 0)) });
1410
1435
  }
1411
- ), In = g(
1436
+ ), kn = f(
1412
1437
  ({
1413
1438
  open: e,
1414
- setOpen: n,
1439
+ setOpen: t,
1415
1440
  onNavigate: o
1416
- }) => /* @__PURE__ */ t(
1417
- U,
1441
+ }) => /* @__PURE__ */ n(
1442
+ Y,
1418
1443
  {
1419
1444
  lazyMount: !0,
1420
1445
  placement: "center",
1421
1446
  open: e,
1422
- onOpenChange: (r) => n(r.open),
1447
+ onOpenChange: (i) => t(i.open),
1423
1448
  size: { mdDown: "full", md: "lg" },
1424
1449
  scrollBehavior: "inside",
1425
1450
  children: /* @__PURE__ */ c(V, { children: [
1426
- /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Table of Contents" }) }),
1427
- /* @__PURE__ */ t(K, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(Cn, { onNavigate: o }) }),
1428
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
1429
- /* @__PURE__ */ t(Y, {})
1451
+ /* @__PURE__ */ n(q, { children: /* @__PURE__ */ n(K, { children: "Table of Contents" }) }),
1452
+ /* @__PURE__ */ n(Q, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ n(yn, { onNavigate: o }) }),
1453
+ /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(j, { variant: "outline", children: "Cancel" }) }) }),
1454
+ /* @__PURE__ */ n(G, {})
1430
1455
  ] })
1431
1456
  }
1432
1457
  )
1433
- ), Fn = ({
1458
+ ), jn = ({
1434
1459
  enableFloatingTime: e = !0,
1435
- enableFloatingProgress: n = !0,
1460
+ enableFloatingProgress: t = !0,
1436
1461
  onItemClick: o
1437
1462
  }) => {
1438
- const [r, i] = k(!1), [s, d] = k(!1), [l, u] = k(!1), [a, m] = k(void 0), [h, b] = k(!1), [y, C] = me(), T = N(() => {
1439
- i(!1), d(!1), u(!1), m(void 0), C(!1), b(!1);
1440
- }, [C]), A = N(
1441
- (x) => {
1442
- x === "annotations" ? m("annotations") : x === "search" ? u(!0) : x === "help" ? d(!0) : x === "toc" ? i(!0) : x === "bookmarks" ? m("bookmarks") : x === "gallery" && b(!0), o == null || o(x);
1463
+ const [i, r] = T(!1), [s, a] = T(!1), [d, u] = T(!1), [l, x] = T(void 0), [h, m] = T(!1), [S, C] = fe(), k = N(() => {
1464
+ r(!1), a(!1), u(!1), x(void 0), C(!1), m(!1);
1465
+ }, [C]), R = N(
1466
+ (v) => {
1467
+ v === "annotations" ? x("annotations") : v === "search" ? u(!0) : v === "help" ? a(!0) : v === "toc" ? r(!0) : v === "bookmarks" ? x("bookmarks") : v === "gallery" && m(!0), o == null || o(v);
1443
1468
  },
1444
1469
  [o]
1445
1470
  );
1446
- return Xt(), tn(), _t(), /* @__PURE__ */ c(oe, { children: [
1447
- n && /* @__PURE__ */ t(
1471
+ return Jt(), nn(), Nt(), /* @__PURE__ */ c(oe, { children: [
1472
+ t && /* @__PURE__ */ n(
1448
1473
  te,
1449
1474
  {
1450
- present: !y,
1475
+ present: !S,
1451
1476
  animationName: { _open: "fade-in", _closed: "fade-out" },
1452
1477
  animationDuration: "moderate",
1453
- children: /* @__PURE__ */ t(qt, {})
1478
+ children: /* @__PURE__ */ n(Qt, {})
1454
1479
  }
1455
1480
  ),
1456
- /* @__PURE__ */ t(Gt, { open: h, setOpen: b }),
1457
- /* @__PURE__ */ t(fn, { onItemClick: A }),
1458
- /* @__PURE__ */ t(Lt, {}),
1459
- /* @__PURE__ */ t(Ut, { open: s, setOpen: d }),
1460
- /* @__PURE__ */ t(
1461
- In,
1481
+ /* @__PURE__ */ n(Gt, { open: h, setOpen: m }),
1482
+ /* @__PURE__ */ n(bn, { onItemClick: R }),
1483
+ /* @__PURE__ */ n($t, {}),
1484
+ /* @__PURE__ */ n(qt, { open: s, setOpen: a }),
1485
+ /* @__PURE__ */ n(
1486
+ kn,
1462
1487
  {
1463
- open: r,
1464
- setOpen: i,
1465
- onNavigate: T
1488
+ open: i,
1489
+ setOpen: r,
1490
+ onNavigate: k
1466
1491
  }
1467
1492
  ),
1468
- /* @__PURE__ */ t(
1469
- vn,
1493
+ /* @__PURE__ */ n(
1494
+ Sn,
1470
1495
  {
1471
- open: l,
1496
+ open: d,
1472
1497
  setOpen: u,
1473
- onNavigate: T
1498
+ onNavigate: k
1474
1499
  }
1475
1500
  ),
1476
- /* @__PURE__ */ t(
1477
- Ot,
1501
+ /* @__PURE__ */ n(
1502
+ Dt,
1478
1503
  {
1479
- openWith: a,
1480
- setOpen: (x) => m(x ? "annotations" : void 0),
1481
- onNavigate: T
1504
+ openWith: l,
1505
+ setOpen: (v) => x(v ? "annotations" : void 0),
1506
+ onNavigate: k
1482
1507
  }
1483
1508
  ),
1484
- /* @__PURE__ */ t(
1509
+ /* @__PURE__ */ n(
1485
1510
  te,
1486
1511
  {
1487
- present: e || y,
1512
+ present: e || S,
1488
1513
  animationName: { _open: "fade-in", _closed: "fade-out" },
1489
1514
  animationDuration: "slow",
1490
1515
  overflow: "hidden",
1491
- children: /* @__PURE__ */ t(Zt, {})
1516
+ children: /* @__PURE__ */ n(Xt, {})
1492
1517
  }
1493
1518
  ),
1494
- /* @__PURE__ */ t(Nt, {})
1519
+ /* @__PURE__ */ n(Ht, {})
1495
1520
  ] });
1496
1521
  };
1497
1522
  export {
1498
- Bt as BOOKMARK_AREA_DATA_ATTRIBUTE,
1499
- Fn as ReactReader,
1500
- Nn as ReactReaderProvider
1523
+ Mt as BOOKMARK_AREA_DATA_ATTRIBUTE,
1524
+ jn as ReactReader,
1525
+ Wn as ReactReaderProvider
1501
1526
  };
1502
1527
  //# sourceMappingURL=index.js.map