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