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