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