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