@prose-reader/react-reader 1.270.0 → 1.272.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,62 +1,32 @@
1
- import { jsx as e, jsxs as s, Fragment as de } from "react/jsx-runtime";
2
- import { IconButton as k, Portal as ve, Dialog as z, List as B, Link as xe, Stack as O, Text as b, Tabs as P, Button as W, Presence as ue, Box as _, createToaster as en, Toaster as nn, Toast as J, Spinner as tn, RadioGroup as ie, Slider as M, HStack as F, For as on, Fieldset as N, Heading as me, Kbd as we, Popover as ee, Progress as le, chakra as rn, Collapsible as be, Field as oe, Input as an } from "@chakra-ui/react";
3
- import * as A from "react";
4
- import ln, { createContext as sn, useContext as Fe, memo as g, useState as w, useEffect as $, useCallback as T, useMemo as cn, useLayoutEffect as dn, useRef as un } from "react";
5
- import { LuX as hn, LuNotebookPen as pe, LuBookmark as pn, LuCheck as gn, LuArrowBigRight as fn, LuArrowBigLeft as mn, LuChevronDown as bn, LuCircleHelp as Sn, LuTableOfContents as Cn, LuSearch as vn, LuZoomOut as xn, LuZoomIn as kn, LuGalleryHorizontal as In, LuCircleCheck as ye } from "react-icons/lu";
6
- import { signal as ne, useObserve as S, isDefined as _e, useSubscribe as H, useConstant as he, useSignalValue as Se, useMemoCompare as On, useLiveRef as Rn, useSignalState as Tn } from "reactjrx";
7
- import { Subject as zn, map as E, filter as se, switchMap as V, EMPTY as Pe, of as ge, withLatestFrom as ke, NEVER as Ie, startWith as Mn, distinctUntilChanged as De, throttleTime as Le, tap as $e, first as Ne, combineLatest as wn, mergeMap as yn, Observable as Pn, skip as En, merge as Ve, timer as We, finalize as An, BehaviorSubject as Bn, animationFrameScheduler as Fn } from "rxjs";
8
- import { createPortal as _n } from "react-dom";
9
- import { isPositionInArea as Dn } from "@prose-reader/enhancer-gestures";
10
- import { isShallowEqual as Ln } from "@prose-reader/shared";
11
- import { isShallowEqual as $n, observeIntersection as Nn, isHtmlTagElement as Vn } from "@prose-reader/core";
12
- import { BiFontSize as Wn } from "react-icons/bi";
13
- import { BsBookmarks as Hn } from "react-icons/bs";
14
- import { MdOutlineFitScreen as Gn, MdFullscreenExit as qn, MdFullscreen as jn } from "react-icons/md";
15
- import { RiGalleryView2 as Un } from "react-icons/ri";
16
- import { RxDoubleArrowUp as Qn, RxDoubleArrowLeft as Yn, RxDoubleArrowDown as Zn, RxDoubleArrowRight as Xn } from "react-icons/rx";
17
- import { HiOutlineInformationCircle as Kn } from "react-icons/hi";
18
- import Jn from "rc-slider";
1
+ import { jsx as e, jsxs as s, Fragment as ge } from "react/jsx-runtime";
2
+ import { Presence as pe, Button as D, IconButton as R, Portal as Ce, Drawer as _, Stack as T, Box as L, Text as C, Textarea as ln, Dialog as A, List as H, Link as ze, Tabs as $, createToaster as sn, Toaster as cn, Toast as ee, Spinner as dn, RadioGroup as le, Slider as B, HStack as N, For as un, Fieldset as G, Heading as xe, Kbd as Fe, Popover as ne, Progress as ce, chakra as hn, Collapsible as ke, Field as re, Input as gn } from "@chakra-ui/react";
3
+ import * as E from "react";
4
+ import pn, { createContext as fn, useContext as Ne, memo as p, useState as y, useEffect as F, useCallback as P, useMemo as mn, useLayoutEffect as bn, useRef as Sn } from "react";
5
+ import { FaEdit as Cn } from "react-icons/fa";
6
+ import { LuNotebookPen as de, LuX as vn, LuBookmark as xn, LuCheck as kn, LuArrowBigRight as In, LuArrowBigLeft as On, LuChevronDown as Tn, LuCircleHelp as Rn, LuTableOfContents as zn, LuSearch as Mn, LuZoomOut as wn, LuZoomIn as yn, LuGalleryHorizontal as Pn, LuCircleCheck as _e } from "react-icons/lu";
7
+ import { signal as te, useObserve as v, useSignalValue as Oe, useSubscribe as V, isDefined as Ve, useConstant as me, useMemoCompare as An, useLiveRef as En, useSignalState as Bn } from "reactjrx";
8
+ import { Subject as Dn, EMPTY as Te, switchMap as W, map as z, startWith as We, tap as Me, filter as ue, of as be, withLatestFrom as we, distinctUntilChanged as Se, combineLatest as Ge, NEVER as ye, throttleTime as qe, first as Ue, mergeMap as Fn, Observable as _n, skip as $n, merge as je, timer as Qe, finalize as Ln, BehaviorSubject as Hn, animationFrameScheduler as Nn } from "rxjs";
9
+ import { createPortal as Vn } from "react-dom";
10
+ import { isPositionInArea as Wn } from "@prose-reader/enhancer-gestures";
11
+ import { isShallowEqual as Gn } from "@prose-reader/shared";
12
+ import { isShallowEqual as qn, observeIntersection as Un, isHtmlTagElement as jn } from "@prose-reader/core";
13
+ import { BiFontSize as Qn } from "react-icons/bi";
14
+ import { BsBookmarks as Yn } from "react-icons/bs";
15
+ import { MdOutlineFitScreen as Zn, MdFullscreenExit as Xn, MdFullscreen as Kn } from "react-icons/md";
16
+ import { RiGalleryView2 as Jn } from "react-icons/ri";
17
+ import { RxDoubleArrowUp as et, RxDoubleArrowLeft as nt, RxDoubleArrowDown as tt, RxDoubleArrowRight as ot } from "react-icons/rx";
18
+ import { HiOutlineInformationCircle as it } from "react-icons/hi";
19
+ import rt from "rc-slider";
19
20
  import "rc-slider/assets/index.css";
20
- import { IoIosArrowBack as et, IoMdMore as nt } from "react-icons/io";
21
- const tt = "data-bookmark-area", He = 5, ot = A.forwardRef(function(t, o) {
22
- return /* @__PURE__ */ e(k, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(hn, {}) });
23
- }), G = A.forwardRef(function(t, o) {
24
- const {
25
- children: r,
26
- portalled: i = !0,
27
- portalRef: a,
28
- backdrop: l = !0,
29
- ...c
30
- } = t;
31
- return /* @__PURE__ */ s(ve, { disabled: !i, container: a, children: [
32
- l && /* @__PURE__ */ e(z.Backdrop, {}),
33
- /* @__PURE__ */ e(z.Positioner, { children: /* @__PURE__ */ e(z.Content, { ref: o, ...c, asChild: !1, children: r }) })
34
- ] });
35
- }), q = A.forwardRef(function(t, o) {
36
- return /* @__PURE__ */ e(
37
- z.CloseTrigger,
38
- {
39
- position: "absolute",
40
- top: "2",
41
- insetEnd: "2",
42
- ...t,
43
- asChild: !0,
44
- children: /* @__PURE__ */ e(ot, { size: "sm", ref: o, children: t.children })
45
- }
46
- );
47
- }), j = z.Root, U = z.Footer, Q = z.Header, Y = z.Body;
48
- z.Backdrop;
49
- const Z = z.Title;
50
- z.Description;
51
- z.Trigger;
52
- const X = z.ActionTrigger, Ge = () => ({
21
+ import { IoIosArrowBack as at, IoMdMore as lt } from "react-icons/io";
22
+ const st = "data-bookmark-area", Ye = 5, Ze = () => ({
53
23
  _quickMenuOpen: !1,
54
24
  _onQuickMenuOpenChange: (n) => n,
55
25
  reader: void 0,
56
- quickMenuBottomBarBoundingBoxSignal: ne({
26
+ quickMenuBottomBarBoundingBoxSignal: te({
57
27
  default: void 0
58
28
  }),
59
- notificationsSubject: new zn(),
29
+ notificationsSubject: new Dn(),
60
30
  refitMenuOpen: !1,
61
31
  onRefitMenuOpenChange: () => {
62
32
  },
@@ -66,94 +36,348 @@ const X = z.ActionTrigger, Ge = () => ({
66
36
  fontSizeMin: 0.2,
67
37
  fontSizeMax: 5,
68
38
  uncontrolledFontSize: 1,
69
- enableFloatingProgress: !0
70
- }), Oe = sn(
71
- ne({ default: Ge() })
72
- ), y = (n) => {
73
- const t = Fe(Oe);
74
- return S(t, n);
75
- }, qe = () => Fe(Oe), m = () => {
76
- const { reader: n } = y(["reader"]);
39
+ enableFloatingProgress: !0,
40
+ selectedHighlight: void 0
41
+ }), Pe = fn(
42
+ te({ default: Ze() })
43
+ ), M = (n) => {
44
+ const t = Ne(Pe);
45
+ return v(t, n);
46
+ }, oe = () => Ne(Pe), ct = 24, Xe = p(
47
+ ({
48
+ children: n,
49
+ ...t
50
+ }) => {
51
+ const { quickMenuBottomBarBoundingBoxSignal: o } = M([
52
+ "quickMenuBottomBarBoundingBoxSignal",
53
+ "zoomMaxScale"
54
+ ]), r = Oe(
55
+ o
56
+ )?.borderBoxSize?.[0]?.blockSize || ct;
57
+ return /* @__PURE__ */ e(
58
+ pe,
59
+ {
60
+ animationName: { _open: "fade-in", _closed: "fade-out" },
61
+ animationDuration: "moderate",
62
+ position: "absolute",
63
+ bottom: `calc(${r}px + var(--chakra-spacing-4))`,
64
+ right: 4,
65
+ backgroundColor: "bg.panel",
66
+ shadow: "sm",
67
+ borderRadius: "md",
68
+ p: 2,
69
+ display: "flex",
70
+ flexDirection: "row",
71
+ gap: 2,
72
+ ...t,
73
+ children: n
74
+ }
75
+ );
76
+ }
77
+ ), x = () => {
78
+ const { reader: n } = M(["reader"]);
77
79
  return n;
78
- }, je = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, ce = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, Ue = (n) => !!n && "__PROSE_READER_ENHANCER_GALLERY" in n, Qe = (n) => !!n && "__PROSE_READER_ENHANCER_REFIT" in n, rt = (n) => {
79
- const t = m(), o = ce(t) ? t : void 0;
80
- return { data: S(
80
+ }, Ke = (n) => !!n && "__PROSE_READER_ENHANCER_SEARCH" in n, he = (n) => !!n && "__PROSE_READER_ENHANCER_ANNOTATIONS" in n, Je = (n) => !!n && "__PROSE_READER_ENHANCER_GALLERY" in n, en = (n) => !!n && "__PROSE_READER_ENHANCER_REFIT" in n, fe = () => {
81
+ const n = x();
82
+ return he(n) ? n : void 0;
83
+ }, dt = () => {
84
+ const n = fe(), t = oe(), { selectedHighlight: o } = M(["selectedHighlight"]), i = v(
85
+ () => n?.selection.selectionOver$.pipe(
86
+ W(
87
+ () => n.selection.selectionEnd$.pipe(
88
+ z(() => !1),
89
+ We(!0)
90
+ )
91
+ )
92
+ ) ?? Te,
93
+ { defaultValue: !1 },
94
+ [n]
95
+ );
96
+ return /* @__PURE__ */ s(Xe, { present: i && !o, children: [
97
+ /* @__PURE__ */ s(
98
+ D,
99
+ {
100
+ variant: "outline",
101
+ size: "sm",
102
+ onClick: () => {
103
+ const r = n?.selection.getSelection();
104
+ r && t.update((a) => ({
105
+ ...a,
106
+ selectedHighlight: {
107
+ selection: r
108
+ }
109
+ }));
110
+ },
111
+ children: [
112
+ /* @__PURE__ */ e(Cn, {}),
113
+ "Annotate"
114
+ ]
115
+ }
116
+ ),
117
+ /* @__PURE__ */ s(D, { variant: "outline", size: "sm", disabled: !0, children: [
118
+ /* @__PURE__ */ e(de, {}),
119
+ "Bookmark"
120
+ ] })
121
+ ] });
122
+ }, ut = (n, t = 50) => n.length <= t ? n : `${n.slice(0, t)}...`, nn = E.forwardRef(function(t, o) {
123
+ return /* @__PURE__ */ e(R, { variant: "ghost", "aria-label": "Close", ref: o, ...t, children: t.children ?? /* @__PURE__ */ e(vn, {}) });
124
+ }), ht = E.forwardRef(function(t, o) {
125
+ const { children: i, portalled: r = !0, portalRef: a, offset: l, ...c } = t;
126
+ return /* @__PURE__ */ e(Ce, { disabled: !r, container: a, children: /* @__PURE__ */ e(_.Positioner, { padding: l, children: /* @__PURE__ */ e(_.Content, { ref: o, ...c, asChild: !1, children: i }) }) });
127
+ });
128
+ E.forwardRef(function(t, o) {
129
+ return /* @__PURE__ */ e(
130
+ _.CloseTrigger,
131
+ {
132
+ position: "absolute",
133
+ top: "2",
134
+ insetEnd: "2",
135
+ ...t,
136
+ asChild: !0,
137
+ children: /* @__PURE__ */ e(nn, { size: "sm", ref: o })
138
+ }
139
+ );
140
+ });
141
+ _.Trigger;
142
+ const gt = _.Root;
143
+ _.Footer;
144
+ const pt = _.Header, ft = _.Body, mt = _.Backdrop;
145
+ _.Description;
146
+ _.Title;
147
+ _.ActionTrigger;
148
+ const Ie = [
149
+ "rgba(216, 191, 216, 1)",
150
+ // Light purple
151
+ "rgba(255, 225, 125, 1)",
152
+ // Soft yellow
153
+ "rgba(144, 238, 144, 1)",
154
+ // Light green
155
+ "rgba(173, 216, 230, 1)",
156
+ // Light blue
157
+ "rgba(255, 182, 193, 1)"
158
+ // Light pink
159
+ ], bt = p(() => {
160
+ const n = fe(), {
161
+ selectedHighlight: t,
162
+ onAnnotationCreate: o,
163
+ onAnnotationUpdate: i,
164
+ onAnnotationDelete: r
165
+ } = M([
166
+ "selectedHighlight",
167
+ "onAnnotationCreate",
168
+ "onAnnotationUpdate",
169
+ "onAnnotationDelete"
170
+ ]), a = oe(), { highlight: l, selection: c } = t ?? {}, [u, d] = y(
171
+ Ie[0]
172
+ ), [g, h] = y(""), m = !!(c ?? l), b = () => {
173
+ a.update((S) => ({
174
+ ...S,
175
+ selectedHighlight: void 0
176
+ }));
177
+ }, w = (S) => {
178
+ S.open || b();
179
+ }, I = l?.highlightColor, k = l?.notes;
180
+ return F(() => {
181
+ h("");
182
+ }, [m]), F(() => {
183
+ h(k ?? "");
184
+ }, [k]), F(() => {
185
+ d(I || Ie[0]);
186
+ }, [I, m]), V(
187
+ function() {
188
+ return n?.annotations.highlightTap$.pipe(
189
+ Me(({ highlight: O }) => {
190
+ a.update((f) => ({
191
+ ...f,
192
+ selectedHighlight: {
193
+ highlight: O
194
+ }
195
+ }));
196
+ })
197
+ );
198
+ },
199
+ [n]
200
+ ), /* @__PURE__ */ s(gt, { placement: "bottom", onOpenChange: w, open: m, children: [
201
+ /* @__PURE__ */ e(mt, {}),
202
+ /* @__PURE__ */ s(ht, { children: [
203
+ /* @__PURE__ */ e(pt, { borderBottomWidth: "1px", children: l ? "Highlight" : `Selection: "${ut(c?.selection?.toString() ?? "", 10)}"` }),
204
+ /* @__PURE__ */ s(ft, { gap: 4, display: "flex", flexDirection: "column", pb: 4, children: [
205
+ /* @__PURE__ */ s(T, { children: [
206
+ /* @__PURE__ */ e(T, { gap: 2, flexDirection: "row", children: Ie.map((S) => /* @__PURE__ */ e(
207
+ L,
208
+ {
209
+ bgColor: S,
210
+ height: 10,
211
+ width: 10,
212
+ borderRadius: "50%",
213
+ cursor: "pointer",
214
+ ...u === S && {
215
+ border: "4px solid white"
216
+ },
217
+ onClick: () => d(S)
218
+ },
219
+ S
220
+ )) }),
221
+ /* @__PURE__ */ e(C, { children: "Annotation:" }),
222
+ /* @__PURE__ */ e(
223
+ ln,
224
+ {
225
+ value: g,
226
+ onChange: (S) => h(S.target.value)
227
+ }
228
+ )
229
+ ] }),
230
+ !!c && /* @__PURE__ */ e(
231
+ D,
232
+ {
233
+ onClick: () => {
234
+ b();
235
+ const S = n?.annotations.createAnnotation({
236
+ ...c,
237
+ highlightColor: u,
238
+ notes: g
239
+ });
240
+ S && o?.(S);
241
+ },
242
+ children: "Highlight"
243
+ }
244
+ ),
245
+ !!l && /* @__PURE__ */ s(T, { direction: "row", children: [
246
+ /* @__PURE__ */ e(
247
+ D,
248
+ {
249
+ flex: 1,
250
+ onClick: () => {
251
+ b(), i?.({
252
+ id: l.id,
253
+ highlightColor: u,
254
+ notes: g
255
+ });
256
+ },
257
+ children: "Update"
258
+ }
259
+ ),
260
+ /* @__PURE__ */ e(
261
+ D,
262
+ {
263
+ flex: 1,
264
+ variant: "surface",
265
+ onClick: () => {
266
+ b(), r?.(l.id);
267
+ },
268
+ children: "Remove"
269
+ }
270
+ )
271
+ ] })
272
+ ] })
273
+ ] })
274
+ ] });
275
+ }), q = E.forwardRef(function(t, o) {
276
+ const {
277
+ children: i,
278
+ portalled: r = !0,
279
+ portalRef: a,
280
+ backdrop: l = !0,
281
+ ...c
282
+ } = t;
283
+ return /* @__PURE__ */ s(Ce, { disabled: !r, container: a, children: [
284
+ l && /* @__PURE__ */ e(A.Backdrop, {}),
285
+ /* @__PURE__ */ e(A.Positioner, { children: /* @__PURE__ */ e(A.Content, { ref: o, ...c, asChild: !1, children: i }) })
286
+ ] });
287
+ }), U = E.forwardRef(function(t, o) {
288
+ return /* @__PURE__ */ e(
289
+ A.CloseTrigger,
290
+ {
291
+ position: "absolute",
292
+ top: "2",
293
+ insetEnd: "2",
294
+ ...t,
295
+ asChild: !0,
296
+ children: /* @__PURE__ */ e(nn, { size: "sm", ref: o, children: t.children })
297
+ }
298
+ );
299
+ }), j = A.Root, Q = A.Footer, Y = A.Header, Z = A.Body;
300
+ A.Backdrop;
301
+ const X = A.Title;
302
+ A.Description;
303
+ A.Trigger;
304
+ const K = A.ActionTrigger, St = (n) => {
305
+ const t = x(), o = he(t) ? t : void 0;
306
+ return { data: v(
81
307
  () => o?.annotations.annotations$.pipe(
82
- E((i) => i.find((a) => a.id === n)),
83
- se(_e),
84
- V((i) => o.locateResource(i))
308
+ z((r) => r.find((a) => a.id === n)),
309
+ ue(Ve),
310
+ W((r) => o.locateResource(r))
85
311
  ),
86
312
  [o]
87
313
  ) };
88
- }, Ye = ({
314
+ }, tn = ({
89
315
  id: n,
90
316
  onNavigate: t,
91
317
  allowLeftIcon: o = !0
92
318
  }) => {
93
- const r = m(), { data: i } = rt(n), a = i?.meta.range?.toString() || i?.meta.node?.textContent;
94
- return /* @__PURE__ */ e(B.Item, { children: /* @__PURE__ */ s(
95
- xe,
319
+ const i = x(), { data: r } = St(n), a = r?.meta.range?.toString() || r?.meta.node?.textContent;
320
+ return /* @__PURE__ */ e(H.Item, { children: /* @__PURE__ */ s(
321
+ ze,
96
322
  {
97
323
  href: "#",
98
324
  onClick: () => {
99
- t(), r?.navigation.goToCfi(i?.meta.cfi ?? "");
325
+ t(), i?.navigation.goToCfi(r?.meta.cfi ?? "");
100
326
  },
101
327
  children: [
102
- i?.resource?.notes ? /* @__PURE__ */ e(B.Indicator, { asChild: !0, children: /* @__PURE__ */ e(pe, {}) }) : o ? /* @__PURE__ */ e(B.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(pe, {}) }) : null,
103
- /* @__PURE__ */ s(O, { gap: 0, children: [
104
- a ? /* @__PURE__ */ e(b, { lineClamp: 2, fontSize: "md", children: a }) : /* @__PURE__ */ s(b, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
328
+ r?.resource?.notes ? /* @__PURE__ */ e(H.Indicator, { asChild: !0, children: /* @__PURE__ */ e(de, {}) }) : o ? /* @__PURE__ */ e(H.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(de, {}) }) : null,
329
+ /* @__PURE__ */ s(T, { gap: 0, children: [
330
+ a ? /* @__PURE__ */ e(C, { lineClamp: 2, fontSize: "md", children: a }) : /* @__PURE__ */ s(C, { lineClamp: 2, fontSize: "md", fontStyle: "italic", children: [
105
331
  "Page ",
106
- (i?.meta.absolutePageIndex ?? 0) + 1
332
+ (r?.meta.absolutePageIndex ?? 0) + 1
107
333
  ] }),
108
334
  /* @__PURE__ */ e(
109
- b,
335
+ C,
110
336
  {
111
337
  fontStyle: "italic",
112
338
  fontWeight: "bold",
113
339
  fontSize: "sm",
114
- children: `Book page: ${i?.meta?.absolutePageIndex !== void 0 ? i.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
340
+ children: `Book page: ${r?.meta?.absolutePageIndex !== void 0 ? r.meta.absolutePageIndex + 1 : "unknown (not loaded)"}`
115
341
  }
116
342
  )
117
343
  ] })
118
344
  ]
119
345
  }
120
346
  ) });
121
- }, fe = () => {
122
- const n = m(), t = ce(n) ? n : void 0;
123
- return { data: S(
347
+ }, ve = () => {
348
+ const n = x(), t = he(n) ? n : void 0;
349
+ return { data: v(
124
350
  () => t?.annotations.annotations$.pipe(
125
- V(
126
- (r) => t.locateResource(r)
127
- )
351
+ W((i) => t.locateResource(i))
128
352
  ),
129
353
  [t]
130
354
  ) };
131
- }, it = () => {
132
- const { data: n } = fe();
355
+ }, Ct = () => {
356
+ const { data: n } = ve();
133
357
  return {
134
358
  data: n?.filter((t) => t.meta.isCfiRange)
135
359
  };
136
- }, at = ({ onNavigate: n }) => {
137
- const { data: t } = it();
138
- return /* @__PURE__ */ e(B.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
139
- Ye,
360
+ }, vt = ({ onNavigate: n }) => {
361
+ const { data: t } = Ct();
362
+ return /* @__PURE__ */ e(H.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
363
+ tn,
140
364
  {
141
365
  id: o.resource.id,
142
366
  onNavigate: n
143
367
  },
144
368
  o.resource.id
145
369
  )) });
146
- }, lt = () => {
147
- const { data: n } = fe();
370
+ }, xt = () => {
371
+ const { data: n } = ve();
148
372
  return {
149
373
  data: n?.filter(
150
374
  (t) => !t.meta.isCfiRange && !t.resource.notes
151
375
  )
152
376
  };
153
- }, st = ({ onNavigate: n }) => {
154
- const { data: t } = lt();
155
- return /* @__PURE__ */ e(B.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
156
- Ye,
377
+ }, kt = ({ onNavigate: n }) => {
378
+ const { data: t } = xt();
379
+ return /* @__PURE__ */ e(H.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: t?.map((o) => /* @__PURE__ */ e(
380
+ tn,
157
381
  {
158
382
  id: o.resource.id,
159
383
  onNavigate: n,
@@ -161,36 +385,36 @@ const X = z.ActionTrigger, Ge = () => ({
161
385
  },
162
386
  o.resource.id
163
387
  )) });
164
- }, ct = g(
388
+ }, It = p(
165
389
  ({
166
390
  onNavigate: n,
167
391
  defaultTab: t
168
392
  }) => {
169
- const [o, r] = w(t ?? "bookmarks");
393
+ const [o, i] = y(t ?? "bookmarks");
170
394
  return /* @__PURE__ */ s(
171
- P.Root,
395
+ $.Root,
172
396
  {
173
397
  value: o,
174
- onValueChange: (i) => r(i.value),
398
+ onValueChange: (r) => i(r.value),
175
399
  children: [
176
- /* @__PURE__ */ s(P.List, { children: [
177
- /* @__PURE__ */ s(P.Trigger, { value: "bookmarks", children: [
178
- /* @__PURE__ */ e(pn, {}),
400
+ /* @__PURE__ */ s($.List, { children: [
401
+ /* @__PURE__ */ s($.Trigger, { value: "bookmarks", children: [
402
+ /* @__PURE__ */ e(xn, {}),
179
403
  "Bookmarks"
180
404
  ] }),
181
- /* @__PURE__ */ s(P.Trigger, { value: "annotations", children: [
182
- /* @__PURE__ */ e(pe, {}),
405
+ /* @__PURE__ */ s($.Trigger, { value: "annotations", children: [
406
+ /* @__PURE__ */ e(de, {}),
183
407
  "Annotations"
184
408
  ] }),
185
- /* @__PURE__ */ e(P.Indicator, {})
409
+ /* @__PURE__ */ e($.Indicator, {})
186
410
  ] }),
187
- /* @__PURE__ */ e(P.Content, { value: "bookmarks", children: /* @__PURE__ */ e(st, { onNavigate: n }) }),
188
- /* @__PURE__ */ e(P.Content, { value: "annotations", children: /* @__PURE__ */ e(at, { onNavigate: n }) })
411
+ /* @__PURE__ */ e($.Content, { value: "bookmarks", children: /* @__PURE__ */ e(kt, { onNavigate: n }) }),
412
+ /* @__PURE__ */ e($.Content, { value: "annotations", children: /* @__PURE__ */ e(vt, { onNavigate: n }) })
189
413
  ]
190
414
  }
191
415
  );
192
416
  }
193
- ), dt = g(
417
+ ), Ot = p(
194
418
  ({
195
419
  openWith: n,
196
420
  setOpen: t,
@@ -201,72 +425,72 @@ const X = z.ActionTrigger, Ge = () => ({
201
425
  lazyMount: !0,
202
426
  placement: "center",
203
427
  open: !!n,
204
- onOpenChange: (r) => t(r.open),
428
+ onOpenChange: (i) => t(i.open),
205
429
  size: { mdDown: "full", md: "lg" },
206
430
  scrollBehavior: "inside",
207
- children: /* @__PURE__ */ s(G, { height: "100%", children: [
208
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Annotations" }) }),
209
- /* @__PURE__ */ e(Y, { flex: 1, children: /* @__PURE__ */ e(
210
- ct,
431
+ children: /* @__PURE__ */ s(q, { height: "100%", children: [
432
+ /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Annotations" }) }),
433
+ /* @__PURE__ */ e(Z, { flex: 1, children: /* @__PURE__ */ e(
434
+ It,
211
435
  {
212
436
  onNavigate: o,
213
437
  defaultTab: n
214
438
  }
215
439
  ) }),
216
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
217
- /* @__PURE__ */ e(q, {})
440
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(D, { variant: "outline", children: "Cancel" }) }) }),
441
+ /* @__PURE__ */ e(U, {})
218
442
  ] })
219
443
  }
220
444
  )
221
- ), ut = g(({ children: n }) => {
222
- const t = m(), o = S(() => t?.spine.element$, [t]);
223
- return o ? /* @__PURE__ */ e(de, { children: _n(n, o) }) : null;
224
- }), ht = ({
445
+ ), Tt = p(({ children: n }) => {
446
+ const t = x(), o = v(() => t?.spine.element$, [t]);
447
+ return o ? /* @__PURE__ */ e(ge, { children: Vn(n, o) }) : null;
448
+ }), Rt = ({
225
449
  absolutePageIndex: n,
226
450
  itemIndex: t
227
451
  }) => {
228
- const o = m();
452
+ const o = x();
229
453
  return {
230
- spineItem: S(() => o ? t !== void 0 ? ge(o.spine.spineItemsManager.get(t)) : n !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(n).pipe(
231
- E((i) => o.spine.spineItemsManager.get(i?.itemIndex))
232
- ) : Pe : Pe, [t, n, o])
454
+ spineItem: v(() => o ? t !== void 0 ? be(o.spine.spineItemsManager.get(t)) : n !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(n).pipe(
455
+ z((r) => o.spine.spineItemsManager.get(r?.itemIndex))
456
+ ) : Te : Te, [t, n, o])
233
457
  };
234
- }, pt = ({
458
+ }, zt = ({
235
459
  absolutePageIndex: n,
236
460
  itemIndex: t
237
461
  }) => {
238
- const { spineItem: o } = ht({ absolutePageIndex: n, itemIndex: t }), r = S(
239
- () => o?.isReady$ ?? ge(!1),
462
+ const { spineItem: o } = Rt({ absolutePageIndex: n, itemIndex: t }), i = v(
463
+ () => o?.isReady$ ?? be(!1),
240
464
  [o]
241
465
  );
242
- return { spineItem: o, isReady: r };
243
- }, gt = g(
466
+ return { spineItem: o, isReady: i };
467
+ }, Mt = p(
244
468
  ({
245
469
  absolutePageIndex: n,
246
470
  left: t,
247
471
  top: o,
248
- width: r
472
+ width: i
249
473
  }) => {
250
- const { isReady: i } = pt({
474
+ const { isReady: r } = zt({
251
475
  absolutePageIndex: n
252
- }), { data: a } = fe(), l = a?.find(
253
- (d) => d?.meta?.absolutePageIndex === n && !d.meta.isCfiRange
476
+ }), { data: a } = ve(), l = a?.find(
477
+ (u) => u?.meta?.absolutePageIndex === n && !u.meta.isCfiRange
254
478
  );
255
- if (!i) return null;
256
- const c = r * 0.1 / 2;
479
+ if (!r) return null;
480
+ const c = i * 0.1 / 2;
257
481
  return /* @__PURE__ */ e(
258
- ue,
482
+ pe,
259
483
  {
260
484
  present: !!l,
261
485
  lazyMount: !0,
262
486
  animationName: { _open: "fade-in", _closed: "fade-out" },
263
487
  animationDuration: "moderate",
264
488
  children: /* @__PURE__ */ e(
265
- _,
489
+ L,
266
490
  {
267
- "data-bookmark-area": tt,
491
+ "data-bookmark-area": st,
268
492
  position: "absolute",
269
- left: t + r,
493
+ left: t + i,
270
494
  transform: "translateX(-100%)",
271
495
  pointerEvents: "none",
272
496
  top: o,
@@ -287,38 +511,35 @@ const X = z.ActionTrigger, Ge = () => ({
287
511
  }
288
512
  );
289
513
  }
290
- ), ft = g(() => {
291
- const n = m(), t = S(() => n?.layoutInfo$, [n]);
292
- return /* @__PURE__ */ e(ut, { children: t?.pages.map(
293
- ({ absoluteLayout: { left: o, top: r, width: i } }, a) => /* @__PURE__ */ e(
294
- gt,
514
+ ), wt = p(() => {
515
+ const n = x(), t = v(() => n?.layoutInfo$, [n]);
516
+ return /* @__PURE__ */ e(Tt, { children: t?.pages.map(
517
+ ({ absoluteLayout: { left: o, top: i, width: r } }, a) => /* @__PURE__ */ e(
518
+ Mt,
295
519
  {
296
520
  absolutePageIndex: a,
297
521
  left: o,
298
- top: r,
299
- width: i
522
+ top: i,
523
+ width: r
300
524
  },
301
525
  a
302
526
  )
303
527
  ) });
304
- }), Ze = () => {
305
- const n = m();
306
- return ce(n) ? n : void 0;
307
- }, re = !0, mt = () => {
308
- const n = Ze(), { data: t } = fe();
309
- $(() => n ? n.gestures.hooks.register(
528
+ }), ae = !0, yt = () => {
529
+ const n = fe(), { data: t } = ve(), o = oe();
530
+ F(() => n ? n.gestures.hooks.register(
310
531
  "beforeTapGesture",
311
532
  ({ event$: r }) => r.pipe(
312
- ke(n?.annotations.candidates$),
313
- E(([i, a]) => {
314
- if (!i.page) return re;
533
+ we(n?.annotations.candidates$),
534
+ z(([a, l]) => {
535
+ if (!a.page) return ae;
315
536
  const {
316
- spineItem: l,
317
- spineItemPageIndex: c,
537
+ spineItem: c,
538
+ spineItemPageIndex: u,
318
539
  spineItemPagePosition: d,
319
- pageSize: u
320
- } = i.page;
321
- if (Dn(
540
+ pageSize: g
541
+ } = a.page;
542
+ if (Wn(
322
543
  d,
323
544
  {
324
545
  type: "corner",
@@ -326,30 +547,34 @@ const X = z.ActionTrigger, Ge = () => ({
326
547
  size: 10,
327
548
  unit: "%"
328
549
  },
329
- u
550
+ g
330
551
  )) {
331
- const h = n.spine.pages.fromSpineItemPageIndex(
332
- l,
333
- c
552
+ const m = n.spine.pages.fromSpineItemPageIndex(
553
+ c,
554
+ u
334
555
  );
335
- if (!h) return re;
336
- const C = t?.find(
337
- (R) => R?.meta?.absolutePageIndex === h.absolutePageIndex && R.meta.range === void 0
556
+ if (!m) return ae;
557
+ const b = t?.find(
558
+ (I) => I?.meta?.absolutePageIndex === m.absolutePageIndex && I.meta.range === void 0
338
559
  );
339
- if (C)
340
- return n?.annotations.delete(C.resource.id), !re;
341
- if (a?.[h.absolutePageIndex])
342
- return n?.annotations.annotateAbsolutePage({
343
- absolutePageIndex: h.absolutePageIndex
344
- }), !re;
560
+ if (b)
561
+ return o.value.onAnnotationDelete?.(
562
+ b.resource.id
563
+ ), !ae;
564
+ if (l?.[m.absolutePageIndex]) {
565
+ const I = n?.annotations.createAnnotation({
566
+ absolutePageIndex: m.absolutePageIndex
567
+ });
568
+ return I && o.value.onAnnotationCreate?.(I), !ae;
569
+ }
345
570
  }
346
- return re;
571
+ return ae;
347
572
  })
348
573
  )
349
- ) : void 0, [n, t]);
350
- }, bt = () => {
351
- const n = Ze();
352
- H(
574
+ ) : void 0, [n, t, o]);
575
+ }, Pt = () => {
576
+ const n = fe();
577
+ V(
353
578
  () => (
354
579
  /**
355
580
  * Hook used to prevent some gestures from being handled.
@@ -357,122 +582,146 @@ const X = z.ActionTrigger, Ge = () => ({
357
582
  n?.gestures.hooks.register(
358
583
  "beforeTapGesture",
359
584
  ({ event$: t }) => t.pipe(
360
- ke(n.selection.lastSelectionOnPointerdown$),
361
- E(([{ event: o }, r]) => {
362
- const i = o.event.target;
363
- return !(i && n.annotations.isTargetWithinHighlight(i) || r);
585
+ we(n.selection.lastSelectionOnPointerdown$),
586
+ z(([{ event: o }, i]) => {
587
+ const r = o.event.target;
588
+ return !(r && n.annotations.isTargetWithinHighlight(r) || i);
364
589
  })
365
590
  )
366
591
  )
367
592
  ),
368
593
  [n]
369
594
  );
370
- }, Ce = en({
595
+ }, At = () => {
596
+ const n = fe(), t = oe();
597
+ V(() => {
598
+ if (n) {
599
+ const o = t.pipe(
600
+ z((a) => a.selectedHighlight?.highlight?.id),
601
+ Se()
602
+ ), i = t.pipe(
603
+ z((a) => a.annotations ?? []),
604
+ Se()
605
+ ), r = Ge([
606
+ i,
607
+ o
608
+ ]).pipe(
609
+ z(
610
+ ([a, l]) => a.map((c) => ({
611
+ ...c,
612
+ selected: c.id === l
613
+ }))
614
+ )
615
+ );
616
+ n.annotations.update({ annotations$: r });
617
+ }
618
+ }, [n, t]);
619
+ }, Re = sn({
371
620
  placement: "bottom-end",
372
621
  pauseOnPageIdle: !0
373
- }), St = () => /* @__PURE__ */ e(ve, { children: /* @__PURE__ */ e(nn, { toaster: Ce, insetInline: { mdDown: "4" }, children: (n) => /* @__PURE__ */ s(J.Root, { width: { md: "sm" }, children: [
374
- n.type === "loading" ? /* @__PURE__ */ e(tn, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e(J.Indicator, {}),
375
- /* @__PURE__ */ s(O, { gap: "1", flex: "1", maxWidth: "100%", children: [
376
- n.title && /* @__PURE__ */ e(J.Title, { children: n.title }),
377
- n.description && /* @__PURE__ */ e(J.Description, { children: n.description })
622
+ }), Et = () => /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(cn, { toaster: Re, insetInline: { mdDown: "4" }, children: (n) => /* @__PURE__ */ s(ee.Root, { width: { md: "sm" }, children: [
623
+ n.type === "loading" ? /* @__PURE__ */ e(dn, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ e(ee.Indicator, {}),
624
+ /* @__PURE__ */ s(T, { gap: "1", flex: "1", maxWidth: "100%", children: [
625
+ n.title && /* @__PURE__ */ e(ee.Title, { children: n.title }),
626
+ n.description && /* @__PURE__ */ e(ee.Description, { children: n.description })
378
627
  ] }),
379
- n.action && /* @__PURE__ */ e(J.ActionTrigger, { children: n.action.label }),
380
- n.meta?.closable && /* @__PURE__ */ e(J.CloseTrigger, {})
381
- ] }) }) }), Ct = ({
628
+ n.action && /* @__PURE__ */ e(ee.ActionTrigger, { children: n.action.label }),
629
+ n.meta?.closable && /* @__PURE__ */ e(ee.CloseTrigger, {})
630
+ ] }) }) }), Bt = ({
382
631
  children: n,
383
632
  ...t
384
633
  }) => {
385
- const o = he(() => ne({ default: Ge() })), r = he(
386
- () => ne({ default: o.value.fontSizeMenuOpen })
387
- ), i = Se(
388
- r
389
- ), a = T(
634
+ const o = me(() => te({ default: Ze() })), i = me(
635
+ () => te({ default: o.value.fontSizeMenuOpen })
636
+ ), r = Oe(
637
+ i
638
+ ), a = P(
390
639
  (h) => {
391
- r.update(h);
640
+ i.update(h);
392
641
  },
393
- [r]
394
- ), l = T(
642
+ [i]
643
+ ), l = P(
395
644
  (h) => {
396
- o.update((C) => ({
397
- ...C,
398
- _quickMenuOpen: typeof h == "function" ? h(C._quickMenuOpen) : h
645
+ o.update((m) => ({
646
+ ...m,
647
+ _quickMenuOpen: typeof h == "function" ? h(m._quickMenuOpen) : h
399
648
  }));
400
649
  },
401
650
  [o]
402
- ), c = he(
403
- () => ne({ default: o.value.refitMenuOpen })
404
- ), d = T(
651
+ ), c = me(
652
+ () => te({ default: o.value.refitMenuOpen })
653
+ ), u = P(
405
654
  (h) => {
406
655
  c.update(h);
407
656
  },
408
657
  [c]
409
- ), u = Se(
658
+ ), d = Oe(
410
659
  c
411
- ), p = On(t, Ln);
412
- return $(() => {
660
+ ), g = An(t, Gn);
661
+ return F(() => {
413
662
  o.update((h) => ({
414
663
  ...h,
415
- ...p,
664
+ ...g,
416
665
  onFontSizeMenuOpenChange: a,
417
- fontSizeMenuOpen: i,
418
- onRefitMenuOpenChange: d,
419
- refitMenuOpen: u,
666
+ fontSizeMenuOpen: r,
667
+ onRefitMenuOpenChange: u,
668
+ refitMenuOpen: d,
420
669
  _onQuickMenuOpenChange: l
421
670
  }));
422
671
  }, [
423
- p,
672
+ g,
424
673
  l,
425
674
  o,
426
- i,
675
+ r,
427
676
  a,
428
- u,
429
- d
430
- ]), /* @__PURE__ */ e(Oe.Provider, { value: o, children: n });
431
- }, vt = g(
432
- ({ children: n, ...t }) => /* @__PURE__ */ e(Ct, { ...t, children: n })
433
- ), ae = A.forwardRef(
677
+ d,
678
+ u
679
+ ]), /* @__PURE__ */ e(Pe.Provider, { value: o, children: n });
680
+ }, Dt = p(
681
+ ({ children: n, ...t }) => /* @__PURE__ */ e(Bt, { ...t, children: n })
682
+ ), se = E.forwardRef(
434
683
  function(t, o) {
435
- const { children: r, inputProps: i, rootRef: a, ...l } = t;
436
- return /* @__PURE__ */ s(ie.Item, { ref: a, ...l, children: [
437
- /* @__PURE__ */ e(ie.ItemHiddenInput, { ref: o, ...i }),
438
- /* @__PURE__ */ e(ie.ItemIndicator, {}),
439
- r && /* @__PURE__ */ e(ie.ItemText, { children: r })
684
+ const { children: i, inputProps: r, rootRef: a, ...l } = t;
685
+ return /* @__PURE__ */ s(le.Item, { ref: a, ...l, children: [
686
+ /* @__PURE__ */ e(le.ItemHiddenInput, { ref: o, ...r }),
687
+ /* @__PURE__ */ e(le.ItemIndicator, {}),
688
+ i && /* @__PURE__ */ e(le.ItemText, { children: i })
440
689
  ] });
441
690
  }
442
- ), Xe = ie.Root, Re = A.memo(function({
691
+ ), on = le.Root, Ae = E.memo(function({
443
692
  ref: t,
444
693
  ...o
445
694
  }) {
446
- const { marks: r, label: i, showValue: a, ...l } = o, c = o.defaultValue ?? o.value, d = r?.map((p) => typeof p == "number" ? { value: p, label: void 0 } : p), u = !!d?.some((p) => p.label);
447
- return /* @__PURE__ */ s(M.Root, { ref: t, thumbAlignment: "center", ...l, children: [
448
- i && !a && /* @__PURE__ */ e(M.Label, { children: i }),
449
- i && a && /* @__PURE__ */ s(F, { justify: "space-between", children: [
450
- /* @__PURE__ */ e(M.Label, { children: i }),
451
- /* @__PURE__ */ e(M.ValueText, {})
695
+ const { marks: i, label: r, showValue: a, ...l } = o, c = o.defaultValue ?? o.value, u = i?.map((g) => typeof g == "number" ? { value: g, label: void 0 } : g), d = !!u?.some((g) => g.label);
696
+ return /* @__PURE__ */ s(B.Root, { ref: t, thumbAlignment: "center", ...l, children: [
697
+ r && !a && /* @__PURE__ */ e(B.Label, { children: r }),
698
+ r && a && /* @__PURE__ */ s(N, { justify: "space-between", children: [
699
+ /* @__PURE__ */ e(B.Label, { children: r }),
700
+ /* @__PURE__ */ e(B.ValueText, {})
452
701
  ] }),
453
- /* @__PURE__ */ s(M.Control, { "data-has-mark-label": u || void 0, children: [
454
- /* @__PURE__ */ e(M.Track, { children: /* @__PURE__ */ e(M.Range, {}) }),
455
- /* @__PURE__ */ e(xt, { value: c }),
456
- /* @__PURE__ */ e(kt, { marks: d })
702
+ /* @__PURE__ */ s(B.Control, { "data-has-mark-label": d || void 0, children: [
703
+ /* @__PURE__ */ e(B.Track, { children: /* @__PURE__ */ e(B.Range, {}) }),
704
+ /* @__PURE__ */ e(Ft, { value: c }),
705
+ /* @__PURE__ */ e(_t, { marks: u })
457
706
  ] })
458
707
  ] });
459
708
  });
460
- function xt(n) {
709
+ function Ft(n) {
461
710
  const { value: t } = n;
462
- return /* @__PURE__ */ e(on, { each: t, children: (o, r) => /* @__PURE__ */ e(M.Thumb, { index: r, children: /* @__PURE__ */ e(M.HiddenInput, {}) }, r) });
711
+ return /* @__PURE__ */ e(un, { each: t, children: (o, i) => /* @__PURE__ */ e(B.Thumb, { index: i, children: /* @__PURE__ */ e(B.HiddenInput, {}) }, i) });
463
712
  }
464
- const kt = A.forwardRef(
713
+ const _t = E.forwardRef(
465
714
  function(t, o) {
466
- const { marks: r } = t;
467
- return r?.length ? /* @__PURE__ */ e(M.MarkerGroup, { ref: o, children: r.map((i, a) => {
468
- const l = typeof i == "number" ? i : i.value, c = typeof i == "number" ? void 0 : i.label;
469
- return /* @__PURE__ */ s(M.Marker, { value: l, children: [
470
- /* @__PURE__ */ e(M.MarkerIndicator, {}),
715
+ const { marks: i } = t;
716
+ return i?.length ? /* @__PURE__ */ e(B.MarkerGroup, { ref: o, children: i.map((r, a) => {
717
+ const l = typeof r == "number" ? r : r.value, c = typeof r == "number" ? void 0 : r.label;
718
+ return /* @__PURE__ */ s(B.Marker, { value: l, children: [
719
+ /* @__PURE__ */ e(B.MarkerIndicator, {}),
471
720
  c
472
721
  ] }, a);
473
722
  }) }) : null;
474
723
  }
475
- ), Te = [
724
+ ), Ee = [
476
725
  {
477
726
  value: "global",
478
727
  references: ["global"]
@@ -485,26 +734,26 @@ const kt = A.forwardRef(
485
734
  value: "screen",
486
735
  references: ["mobile", "tablet", "desktop"]
487
736
  }
488
- ], It = Te.map((n) => n.value), Ee = Te.flatMap(
737
+ ], $t = Ee.map((n) => n.value), $e = Ee.flatMap(
489
738
  (n) => n.references
490
- ), Ot = (n) => {
739
+ ), Lt = (n) => {
491
740
  if (n)
492
- return Te.find(
741
+ return Ee.find(
493
742
  (t) => t.references.includes(n)
494
743
  )?.value;
495
- }, Rt = g(() => {
496
- const n = qe(), {
744
+ }, Ht = p(() => {
745
+ const n = oe(), {
497
746
  fontSizeMenuOpen: t,
498
747
  onFontSizeMenuOpenChange: o,
499
- uncontrolledFontSize: r,
500
- fontSize: i = r,
748
+ uncontrolledFontSize: i,
749
+ fontSize: r = i,
501
750
  fontSizeMin: a,
502
751
  fontSizeMax: l,
503
752
  fontSizeScope: c,
504
- fontSizeValues: d,
505
- onFontSizeChange: u,
506
- onFontSizeScopeChange: p
507
- } = y([
753
+ fontSizeValues: u,
754
+ onFontSizeChange: d,
755
+ onFontSizeScopeChange: g
756
+ } = M([
508
757
  "fontSizeMenuOpen",
509
758
  "onFontSizeMenuOpenChange",
510
759
  "fontSize",
@@ -515,37 +764,37 @@ const kt = A.forwardRef(
515
764
  "onFontSizeScopeChange",
516
765
  "uncontrolledFontSize",
517
766
  "fontSizeValues"
518
- ]), h = Rn(u), [C, v] = w(
767
+ ]), h = En(d), [m, b] = y(
519
768
  c ?? "global"
520
- ), R = T(
521
- (f, K) => {
522
- h.current ? h.current(f, K) : n.update((Je) => ({
523
- ...Je,
524
- uncontrolledFontSize: K
769
+ ), w = P(
770
+ (f, J) => {
771
+ h.current ? h.current(f, J) : n.update((an) => ({
772
+ ...an,
773
+ uncontrolledFontSize: J
525
774
  }));
526
775
  },
527
776
  [h, n]
528
- ), D = T(
529
- (f) => d?.[f] ?? i,
530
- [i, d]
531
- ), x = T(
777
+ ), I = P(
778
+ (f) => u?.[f] ?? r,
779
+ [r, u]
780
+ ), k = P(
532
781
  (f) => {
533
- const K = f.value;
534
- p?.(K);
782
+ const J = f.value;
783
+ g?.(J);
535
784
  },
536
- [p]
537
- ), L = T((f) => {
538
- v(f.value);
539
- }, []), I = T(
785
+ [g]
786
+ ), S = P((f) => {
787
+ b(f.value);
788
+ }, []), O = P(
540
789
  (f) => {
541
- const K = f.value[0] ?? 0;
542
- R(C, K / 100);
790
+ const J = f.value[0] ?? 0;
791
+ w(m, J / 100);
543
792
  },
544
- [R, C]
793
+ [w, m]
545
794
  );
546
- return $(
795
+ return F(
547
796
  function() {
548
- v(c ?? "global");
797
+ b(c ?? "global");
549
798
  },
550
799
  [c]
551
800
  ), /* @__PURE__ */ e(
@@ -557,49 +806,49 @@ const kt = A.forwardRef(
557
806
  o(f.open);
558
807
  },
559
808
  placement: "center",
560
- children: /* @__PURE__ */ s(G, { maxH: "40vh", overflow: "auto", children: [
561
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Font size" }) }),
562
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ s(O, { gap: 4, flex: 1, children: [
563
- /* @__PURE__ */ s(N.Root, { children: [
564
- /* @__PURE__ */ e(N.Legend, { children: "Scope" }),
565
- /* @__PURE__ */ e(N.HelperText, { children: "The scope to which apply the font size for this book." }),
566
- /* @__PURE__ */ e(N.Content, { children: /* @__PURE__ */ e(
567
- Xe,
809
+ children: /* @__PURE__ */ s(q, { maxH: "40vh", overflow: "auto", children: [
810
+ /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Font size" }) }),
811
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ s(T, { gap: 4, flex: 1, children: [
812
+ /* @__PURE__ */ s(G.Root, { children: [
813
+ /* @__PURE__ */ e(G.Legend, { children: "Scope" }),
814
+ /* @__PURE__ */ e(G.HelperText, { children: "The scope to which apply the font size for this book." }),
815
+ /* @__PURE__ */ e(G.Content, { children: /* @__PURE__ */ e(
816
+ on,
568
817
  {
569
- onValueChange: x,
570
- value: Ot(c) ?? "global",
571
- disabled: !p,
572
- children: /* @__PURE__ */ e(F, { gap: 2, children: It.map((f) => /* @__PURE__ */ e(ae, { value: f, children: f }, f)) })
818
+ onValueChange: k,
819
+ value: Lt(c) ?? "global",
820
+ disabled: !g,
821
+ children: /* @__PURE__ */ e(N, { gap: 2, children: $t.map((f) => /* @__PURE__ */ e(se, { value: f, children: f }, f)) })
573
822
  }
574
823
  ) })
575
824
  ] }),
576
825
  /* @__PURE__ */ s(
577
- P.Root,
826
+ $.Root,
578
827
  {
579
- value: C,
580
- onValueChange: L,
828
+ value: m,
829
+ onValueChange: S,
581
830
  fitted: !1,
582
831
  size: "sm",
583
832
  children: [
584
- /* @__PURE__ */ e(P.List, { children: Ee.map((f) => /* @__PURE__ */ s(
585
- P.Trigger,
833
+ /* @__PURE__ */ e($.List, { children: $e.map((f) => /* @__PURE__ */ s(
834
+ $.Trigger,
586
835
  {
587
836
  value: f,
588
837
  textTransform: "capitalize",
589
838
  disabled: f !== "global" && !c,
590
839
  children: [
591
- c === f && /* @__PURE__ */ e(gn, {}),
840
+ c === f && /* @__PURE__ */ e(kn, {}),
592
841
  f
593
842
  ]
594
843
  },
595
844
  f
596
845
  )) }),
597
- Ee.map((f) => /* @__PURE__ */ e(P.Content, { value: f, children: /* @__PURE__ */ e(
598
- Re,
846
+ $e.map((f) => /* @__PURE__ */ e($.Content, { value: f, children: /* @__PURE__ */ e(
847
+ Ae,
599
848
  {
600
849
  label: "%",
601
- value: [(D(f) ?? 1) * 100],
602
- onValueChange: I,
850
+ value: [(I(f) ?? 1) * 100],
851
+ onValueChange: O,
603
852
  showValue: !0,
604
853
  marks: [
605
854
  { value: 100, label: "Publisher" },
@@ -622,42 +871,42 @@ const kt = A.forwardRef(
622
871
  }
623
872
  )
624
873
  ] }) }),
625
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Close" }) }) }),
626
- /* @__PURE__ */ e(q, {})
874
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(D, { variant: "outline", children: "Close" }) }) }),
875
+ /* @__PURE__ */ e(U, {})
627
876
  ] })
628
877
  }
629
878
  );
630
- }), Tt = () => {
631
- const n = m(), t = qe(), { fontSize: o, uncontrolledFontSize: r } = y([
879
+ }), Nt = () => {
880
+ const n = x(), t = oe(), { fontSize: o, uncontrolledFontSize: i } = M([
632
881
  "fontSize",
633
882
  "uncontrolledFontSize",
634
883
  "onFontSizeChange"
635
- ]), i = o ?? r;
636
- return $(
884
+ ]), r = o ?? i;
885
+ return F(
637
886
  function() {
638
- if (n && i) {
887
+ if (n && r) {
639
888
  const l = setTimeout(() => {
640
889
  n.settings.update({
641
- fontScale: i
890
+ fontScale: r
642
891
  });
643
892
  }, 200);
644
893
  return () => clearTimeout(l);
645
894
  }
646
895
  },
647
- [n, i]
648
- ), H(
896
+ [n, r]
897
+ ), V(
649
898
  function() {
650
- return n?.settings.values$.pipe(E((l) => l.fontScale)).subscribe((l) => {
899
+ return n?.settings.values$.pipe(z((l) => l.fontScale)).subscribe((l) => {
651
900
  const c = t.value.fontSize ?? t.value.uncontrolledFontSize;
652
- l !== c && (t.value.onFontSizeChange?.("internal", l), t.update((d) => ({
653
- ...d,
901
+ l !== c && (t.value.onFontSizeChange?.("internal", l), t.update((u) => ({
902
+ ...u,
654
903
  uncontrolledFontSize: l
655
904
  })));
656
905
  });
657
906
  },
658
907
  [n, t]
659
908
  ), null;
660
- }, zt = {
909
+ }, Vt = {
661
910
  x: 0,
662
911
  y: 0,
663
912
  width: 0,
@@ -667,60 +916,60 @@ const kt = A.forwardRef(
667
916
  bottom: 0,
668
917
  right: 0
669
918
  };
670
- function Mt() {
671
- const [n, t] = w(null), [o, r] = w(zt), i = cn(
919
+ function Wt() {
920
+ const [n, t] = y(null), [o, i] = y(Vt), r = mn(
672
921
  () => new ResizeObserver((a) => {
673
922
  if (a[0]) {
674
- const { x: l, y: c, width: d, height: u, top: p, left: h, bottom: C, right: v } = a[0].contentRect;
675
- r({ x: l, y: c, width: d, height: u, top: p, left: h, bottom: C, right: v });
923
+ const { x: l, y: c, width: u, height: d, top: g, left: h, bottom: m, right: b } = a[0].contentRect;
924
+ i({ x: l, y: c, width: u, height: d, top: g, left: h, bottom: m, right: b });
676
925
  }
677
926
  }),
678
927
  []
679
928
  );
680
- return dn(() => {
929
+ return bn(() => {
681
930
  if (n)
682
- return i.observe(n), () => {
683
- i.disconnect();
931
+ return r.observe(n), () => {
932
+ r.disconnect();
684
933
  };
685
- }, [n, i]), [t, o, n];
934
+ }, [n, r]), [t, o, n];
686
935
  }
687
- const wt = (n, t, o) => {
688
- const r = m(), i = Ue(r) ? r : void 0;
689
- H(() => {
690
- if (!i || !n) return Ie;
691
- const a = t.layout.layout$.pipe(
692
- Mn(t.layout.layoutInfo),
693
- De($n)
694
- ), l = Nn(
936
+ const Gt = (n, t, o) => {
937
+ const i = x(), r = Je(i) ? i : void 0;
938
+ V(() => {
939
+ if (!r || !n) return ye;
940
+ const a = t.didLayout$.pipe(
941
+ We(t.layoutInfo),
942
+ Se(qn)
943
+ ), l = Un(
695
944
  n
696
- ).pipe(E((c) => c.some((d) => d.isIntersecting)));
945
+ ).pipe(z((c) => c.some((u) => u.isIntersecting)));
697
946
  return a.pipe(
698
- Le(100, void 0, { trailing: !0 }),
699
- V(() => l.pipe(
700
- $e((c) => {
947
+ qe(100, void 0, { trailing: !0 }),
948
+ W(() => l.pipe(
949
+ Me((c) => {
701
950
  c || (n.innerHTML = "");
702
951
  }),
703
- se((c) => c),
704
- Ne()
952
+ ue((c) => c),
953
+ Ue()
705
954
  ).pipe(
706
- V(() => (n.innerHTML = "", i?.gallery.snapshot(
955
+ W(() => (n.innerHTML = "", r?.gallery.snapshot(
707
956
  t,
708
957
  n,
709
958
  o
710
959
  )))
711
960
  ))
712
961
  );
713
- }, [i, t, o, n]);
714
- }, yt = g(
962
+ }, [r, t, o, n]);
963
+ }, qt = p(
715
964
  ({ item: n, onNavigated: t }) => {
716
- const [o, r, i] = Mt(), a = m();
717
- wt(i, n, r);
718
- const l = S(
965
+ const [o, i, r] = Wt(), a = x();
966
+ Gt(r, n, i);
967
+ const l = v(
719
968
  () => a?.locateResource(n, { mode: "shallow" }),
720
969
  [a, n]
721
970
  );
722
971
  return /* @__PURE__ */ s(
723
- _,
972
+ L,
724
973
  {
725
974
  width: "100%",
726
975
  aspectRatio: "2/3",
@@ -736,7 +985,7 @@ const wt = (n, t, o) => {
736
985
  },
737
986
  children: [
738
987
  /* @__PURE__ */ e(
739
- _,
988
+ L,
740
989
  {
741
990
  height: "100%",
742
991
  width: "100%",
@@ -746,7 +995,7 @@ const wt = (n, t, o) => {
746
995
  }
747
996
  ),
748
997
  /* @__PURE__ */ s(
749
- b,
998
+ C,
750
999
  {
751
1000
  position: "absolute",
752
1001
  bottom: 0,
@@ -766,22 +1015,22 @@ const wt = (n, t, o) => {
766
1015
  }
767
1016
  );
768
1017
  }
769
- ), Pt = g(
1018
+ ), Ut = p(
770
1019
  ({ open: n, setOpen: t }) => {
771
- const o = m(), r = S(() => o?.spineItemsManager.items$, [o]);
1020
+ const o = x(), i = v(() => o?.spineItemsManager.items$, [o]);
772
1021
  return /* @__PURE__ */ e(
773
1022
  j,
774
1023
  {
775
1024
  lazyMount: !0,
776
1025
  placement: "center",
777
1026
  open: n,
778
- onOpenChange: (i) => t(i.open),
1027
+ onOpenChange: (r) => t(r.open),
779
1028
  size: { mdDown: "full", md: "lg" },
780
1029
  scrollBehavior: "inside",
781
- children: /* @__PURE__ */ s(G, { height: "100%", children: [
782
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Gallery" }) }),
783
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(
784
- _,
1030
+ children: /* @__PURE__ */ s(q, { height: "100%", children: [
1031
+ /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Gallery" }) }),
1032
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(
1033
+ L,
785
1034
  {
786
1035
  gridTemplateColumns: [
787
1036
  "repeat(2, minmax(0, 1fr))",
@@ -791,25 +1040,25 @@ const wt = (n, t, o) => {
791
1040
  gap: [2, 4],
792
1041
  pt: 2,
793
1042
  "data-grid": !0,
794
- children: r?.map((i) => /* @__PURE__ */ e(
795
- yt,
1043
+ children: i?.map((r) => /* @__PURE__ */ e(
1044
+ qt,
796
1045
  {
797
- item: i,
1046
+ item: r,
798
1047
  onNavigated: () => {
799
1048
  t(!1);
800
1049
  }
801
1050
  },
802
- i.item.id
1051
+ r.item.id
803
1052
  ))
804
1053
  }
805
1054
  ) }),
806
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
807
- /* @__PURE__ */ e(q, {})
1055
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(D, { variant: "outline", children: "Cancel" }) }) }),
1056
+ /* @__PURE__ */ e(U, {})
808
1057
  ] })
809
1058
  }
810
1059
  );
811
1060
  }
812
- ), Et = "@prose-reader/react-reader", At = "1.269.0", Bt = g(
1061
+ ), jt = "@prose-reader/react-reader", Qt = "1.271.0", Yt = p(
813
1062
  ({ open: n, setOpen: t }) => /* @__PURE__ */ e(
814
1063
  j,
815
1064
  {
@@ -819,10 +1068,10 @@ const wt = (n, t, o) => {
819
1068
  onOpenChange: (o) => t(o.open),
820
1069
  size: { mdDown: "full", md: "lg" },
821
1070
  scrollBehavior: "inside",
822
- children: /* @__PURE__ */ s(G, { children: [
823
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Help" }) }),
1071
+ children: /* @__PURE__ */ s(q, { children: [
1072
+ /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Help" }) }),
824
1073
  /* @__PURE__ */ s(
825
- Y,
1074
+ Z,
826
1075
  {
827
1076
  overflowY: "auto",
828
1077
  flex: 1,
@@ -830,70 +1079,70 @@ const wt = (n, t, o) => {
830
1079
  flexDirection: "column",
831
1080
  gap: 4,
832
1081
  children: [
833
- /* @__PURE__ */ s(O, { children: [
834
- /* @__PURE__ */ e(me, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
835
- /* @__PURE__ */ s(F, { mb: 1, children: [
836
- /* @__PURE__ */ e(we, { children: /* @__PURE__ */ e(fn, {}) }),
1082
+ /* @__PURE__ */ s(T, { children: [
1083
+ /* @__PURE__ */ e(xe, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
1084
+ /* @__PURE__ */ s(N, { mb: 1, children: [
1085
+ /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(In, {}) }),
837
1086
  " ",
838
- /* @__PURE__ */ e(b, { children: "Navigate to right page" })
1087
+ /* @__PURE__ */ e(C, { children: "Navigate to right page" })
839
1088
  ] }),
840
- /* @__PURE__ */ s(F, { mb: 1, children: [
841
- /* @__PURE__ */ e(we, { children: /* @__PURE__ */ e(mn, {}) }),
1089
+ /* @__PURE__ */ s(N, { mb: 1, children: [
1090
+ /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(On, {}) }),
842
1091
  " ",
843
- /* @__PURE__ */ e(b, { children: "Navigate to left page" })
1092
+ /* @__PURE__ */ e(C, { children: "Navigate to left page" })
844
1093
  ] })
845
1094
  ] }),
846
- /* @__PURE__ */ s(O, { children: [
847
- /* @__PURE__ */ e(me, { mb: 2, as: "h3", size: "lg", children: "Bookmarks" }),
848
- /* @__PURE__ */ e(F, { mb: 1, children: /* @__PURE__ */ e(b, { children: "Tap on the top right corner of a page bookmark it" }) })
1095
+ /* @__PURE__ */ s(T, { children: [
1096
+ /* @__PURE__ */ e(xe, { mb: 2, as: "h3", size: "lg", children: "Bookmarks" }),
1097
+ /* @__PURE__ */ e(N, { mb: 1, children: /* @__PURE__ */ e(C, { children: "Tap on the top right corner of a page bookmark it" }) })
849
1098
  ] }),
850
- /* @__PURE__ */ s(O, { children: [
851
- /* @__PURE__ */ e(me, { mb: 2, as: "h3", size: "lg", children: "About" }),
852
- /* @__PURE__ */ s(b, { children: [
853
- Et,
1099
+ /* @__PURE__ */ s(T, { children: [
1100
+ /* @__PURE__ */ e(xe, { mb: 2, as: "h3", size: "lg", children: "About" }),
1101
+ /* @__PURE__ */ s(C, { children: [
1102
+ jt,
854
1103
  " version: ",
855
- At
1104
+ Qt
856
1105
  ] })
857
1106
  ] })
858
1107
  ]
859
1108
  }
860
1109
  ),
861
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
862
- /* @__PURE__ */ e(q, {})
1110
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(D, { variant: "outline", children: "Cancel" }) }) }),
1111
+ /* @__PURE__ */ e(U, {})
863
1112
  ] })
864
1113
  }
865
1114
  )
866
- ), te = () => {
867
- const n = m();
868
- return S(
869
- () => n ? wn([n.pagination.state$, n.context]).pipe(
870
- E(([t, o]) => {
871
- const r = o.manifest?.spineItems.every(
872
- (i) => i.mediaType?.startsWith("image/")
1115
+ ), ie = () => {
1116
+ const n = x();
1117
+ return v(
1118
+ () => n ? Ge([n.pagination.state$, n.context]).pipe(
1119
+ z(([t, o]) => {
1120
+ const i = o.manifest?.spineItems.every(
1121
+ (r) => r.mediaType?.startsWith("image/")
873
1122
  );
874
1123
  return {
875
1124
  ...t,
876
- hasChapters: !o.isFullyPrePaginated && !r
1125
+ hasChapters: !o.isFullyPrePaginated && !i
877
1126
  };
878
1127
  })
879
- ) : Ie,
1128
+ ) : ye,
880
1129
  [n]
881
1130
  );
882
- }, Ft = { _open: "fade-in", _closed: "fade-out" }, _t = () => {
883
- const { enableFloatingProgress: n, quickMenuOpen: t } = y([
1131
+ }, Zt = { _open: "fade-in", _closed: "fade-out" }, Xt = () => {
1132
+ const { enableFloatingProgress: n, quickMenuOpen: t } = M([
884
1133
  "enableFloatingProgress",
885
1134
  "quickMenuOpen"
886
- ]), o = te(), r = Math.floor(
1135
+ ]), o = ie(), i = Math.floor(
887
1136
  (o?.percentageEstimateOfBook ?? 0) * 100
888
- ), i = r > 0 ? r : 1;
1137
+ ), r = i > 0 ? i : 1;
889
1138
  return o?.percentageEstimateOfBook === void 0 || !n ? null : /* @__PURE__ */ e(
890
- ue,
1139
+ pe,
891
1140
  {
892
1141
  present: !t,
893
- animationName: Ft,
1142
+ animationName: Zt,
894
1143
  animationDuration: "moderate",
895
1144
  children: /* @__PURE__ */ e(
896
- _,
1145
+ L,
897
1146
  {
898
1147
  position: "absolute",
899
1148
  right: 0,
@@ -904,30 +1153,30 @@ const wt = (n, t, o) => {
904
1153
  pointerEvents: "none",
905
1154
  letterSpacing: 1,
906
1155
  color: "white",
907
- children: /* @__PURE__ */ s(b, { fontSize: "md", children: [
908
- i,
1156
+ children: /* @__PURE__ */ s(C, { fontSize: "sm", children: [
1157
+ r,
909
1158
  " %"
910
1159
  ] })
911
1160
  }
912
1161
  )
913
1162
  }
914
1163
  );
915
- }, Dt = () => {
916
- const [n, t] = w(/* @__PURE__ */ new Date());
917
- return $(() => {
1164
+ }, Kt = () => {
1165
+ const [n, t] = y(/* @__PURE__ */ new Date());
1166
+ return F(() => {
918
1167
  const o = setInterval(() => {
919
1168
  t(/* @__PURE__ */ new Date());
920
1169
  }, 6e4);
921
1170
  return () => clearInterval(o);
922
1171
  }, []), n;
923
- }, Lt = (n) => {
924
- const t = Dt();
925
- return /* @__PURE__ */ e(b, { fontSize: "md", ...n, children: t.toLocaleTimeString(navigator.language, {
1172
+ }, Jt = (n) => {
1173
+ const t = Kt();
1174
+ return /* @__PURE__ */ e(C, { fontSize: "sm", ...n, children: t.toLocaleTimeString(navigator.language, {
926
1175
  hour: "2-digit",
927
1176
  minute: "2-digit"
928
1177
  }) });
929
- }, $t = g(() => /* @__PURE__ */ e(
930
- _,
1178
+ }, eo = p(() => /* @__PURE__ */ e(
1179
+ L,
931
1180
  {
932
1181
  position: "absolute",
933
1182
  left: 0,
@@ -938,13 +1187,13 @@ const wt = (n, t, o) => {
938
1187
  paintOrder: "stroke fill",
939
1188
  pointerEvents: "none",
940
1189
  letterSpacing: 1,
941
- children: /* @__PURE__ */ e(Lt, {})
1190
+ children: /* @__PURE__ */ e(Jt, {})
942
1191
  }
943
- )), Nt = () => {
944
- const n = m();
945
- H(
1192
+ )), no = () => {
1193
+ const n = x();
1194
+ V(
946
1195
  () => n?.links$.subscribe((t) => {
947
- if (t.type === "click" && Vn(t.target, "a")) {
1196
+ if (t.type === "click" && jn(t.target, "a")) {
948
1197
  if (!t.target.href) return;
949
1198
  const o = new URL(t.target.href);
950
1199
  window.location.host !== o.host && confirm(
@@ -954,18 +1203,18 @@ const wt = (n, t, o) => {
954
1203
  }),
955
1204
  [n]
956
1205
  );
957
- }, Vt = () => {
958
- const { notificationsSubject: n } = y([
1206
+ }, to = () => {
1207
+ const { notificationsSubject: n } = M([
959
1208
  "notificationsSubject"
960
1209
  ]);
961
- H(
1210
+ V(
962
1211
  () => n.pipe(
963
- se(_e),
964
- yn((t) => {
965
- const o = t.duration ?? 3e3, r = new Pn((a) => {
1212
+ ue(Ve),
1213
+ Fn((t) => {
1214
+ const o = t.duration ?? 3e3, i = new _n((a) => {
966
1215
  try {
967
1216
  queueMicrotask(() => {
968
- const l = Ce.create({
1217
+ const l = Re.create({
969
1218
  title: t.title,
970
1219
  description: t.description,
971
1220
  duration: o
@@ -975,21 +1224,21 @@ const wt = (n, t, o) => {
975
1224
  } catch (l) {
976
1225
  a.error(l);
977
1226
  }
978
- }), i = n.pipe(
979
- En(1),
980
- se((a) => !!t.key && a?.key === t.key)
1227
+ }), r = n.pipe(
1228
+ $n(1),
1229
+ ue((a) => !!t.key && a?.key === t.key)
981
1230
  );
982
- return r.pipe(
983
- V(
984
- (a) => Ve(
985
- We(o),
986
- t.abort ?? Ie,
987
- i
1231
+ return i.pipe(
1232
+ W(
1233
+ (a) => je(
1234
+ Qe(o),
1235
+ t.abort ?? ye,
1236
+ r
988
1237
  ).pipe(
989
- Ne(),
990
- An(() => {
1238
+ Ue(),
1239
+ Ln(() => {
991
1240
  queueMicrotask(() => {
992
- Ce.dismiss(a);
1241
+ Re.dismiss(a);
993
1242
  });
994
1243
  })
995
1244
  )
@@ -999,25 +1248,25 @@ const wt = (n, t, o) => {
999
1248
  ),
1000
1249
  [n]
1001
1250
  );
1002
- }, Wt = A.forwardRef(
1251
+ }, oo = E.forwardRef(
1003
1252
  function(t, o) {
1004
1253
  const {
1005
- showArrow: r,
1006
- children: i,
1254
+ showArrow: i,
1255
+ children: r,
1007
1256
  portalled: a = !0,
1008
1257
  content: l,
1009
1258
  portalRef: c,
1010
- ...d
1259
+ ...u
1011
1260
  } = t;
1012
1261
  return /* @__PURE__ */ s(
1013
- ee.Root,
1262
+ ne.Root,
1014
1263
  {
1015
- ...d,
1016
- positioning: { ...d.positioning, gutter: 4 },
1264
+ ...u,
1265
+ positioning: { ...u.positioning, gutter: 4 },
1017
1266
  children: [
1018
- /* @__PURE__ */ e(ee.Trigger, { asChild: !0, children: i }),
1019
- /* @__PURE__ */ e(ve, { disabled: !a, container: c, children: /* @__PURE__ */ e(ee.Positioner, { children: /* @__PURE__ */ s(
1020
- ee.Content,
1267
+ /* @__PURE__ */ e(ne.Trigger, { asChild: !0, children: r }),
1268
+ /* @__PURE__ */ e(Ce, { disabled: !a, container: c, children: /* @__PURE__ */ e(ne.Positioner, { children: /* @__PURE__ */ s(
1269
+ ne.Content,
1021
1270
  {
1022
1271
  width: "auto",
1023
1272
  px: "2",
@@ -1026,7 +1275,7 @@ const wt = (n, t, o) => {
1026
1275
  rounded: "sm",
1027
1276
  ref: o,
1028
1277
  children: [
1029
- r && /* @__PURE__ */ e(ee.Arrow, { children: /* @__PURE__ */ e(ee.ArrowTip, {}) }),
1278
+ i && /* @__PURE__ */ e(ne.Arrow, { children: /* @__PURE__ */ e(ne.ArrowTip, {}) }),
1030
1279
  l
1031
1280
  ]
1032
1281
  }
@@ -1035,63 +1284,63 @@ const wt = (n, t, o) => {
1035
1284
  }
1036
1285
  );
1037
1286
  }
1038
- ), Ht = A.forwardRef(function(t, o) {
1039
- const { children: r, ...i } = t;
1040
- return /* @__PURE__ */ e(Wt, { content: r, ...i, ref: o, children: /* @__PURE__ */ e(
1041
- k,
1287
+ ), io = E.forwardRef(function(t, o) {
1288
+ const { children: i, ...r } = t;
1289
+ return /* @__PURE__ */ e(oo, { content: i, ...r, ref: o, children: /* @__PURE__ */ e(
1290
+ R,
1042
1291
  {
1043
1292
  variant: "ghost",
1044
1293
  "aria-label": "info",
1045
1294
  size: "2xs",
1046
1295
  colorPalette: "gray",
1047
- children: /* @__PURE__ */ e(Kn, {})
1296
+ children: /* @__PURE__ */ e(it, {})
1048
1297
  }
1049
1298
  ) });
1050
- }), Gt = A.forwardRef(function(t, o) {
1051
- return /* @__PURE__ */ e(le.Track, { ...t, ref: o, children: /* @__PURE__ */ e(le.Range, {}) });
1299
+ }), ro = E.forwardRef(function(t, o) {
1300
+ return /* @__PURE__ */ e(ce.Track, { ...t, ref: o, children: /* @__PURE__ */ e(ce.Range, {}) });
1052
1301
  });
1053
- A.forwardRef(function(t, o) {
1054
- const { children: r, info: i, ...a } = t;
1055
- return /* @__PURE__ */ s(le.Label, { ...a, ref: o, children: [
1056
- r,
1057
- i && /* @__PURE__ */ e(Ht, { children: i })
1302
+ E.forwardRef(function(t, o) {
1303
+ const { children: i, info: r, ...a } = t;
1304
+ return /* @__PURE__ */ s(ce.Label, { ...a, ref: o, children: [
1305
+ i,
1306
+ r && /* @__PURE__ */ e(io, { children: r })
1058
1307
  ] });
1059
1308
  });
1060
- const qt = le.Root, jt = le.ValueText, ze = () => {
1061
- const n = te(), t = n?.numberOfTotalPages === 1, o = (n?.beginNumberOfPagesInSpineItem ?? 0) > 1, r = (n?.endNumberOfPagesInSpineItem ?? 0) > 1, i = (n?.hasChapters ? n?.beginPageIndexInSpineItem : n?.beginAbsolutePageIndex) ?? 0, a = (n?.hasChapters ? n?.endPageIndexInSpineItem : n?.endAbsolutePageIndex) ?? 0, [l = 0, c = 0] = [
1062
- i,
1309
+ const ao = ce.Root, lo = ce.ValueText, Be = () => {
1310
+ const n = ie(), t = n?.numberOfTotalPages === 1, o = (n?.beginNumberOfPagesInSpineItem ?? 0) > 1, i = (n?.endNumberOfPagesInSpineItem ?? 0) > 1, r = (n?.hasChapters ? n?.beginPageIndexInSpineItem : n?.beginAbsolutePageIndex) ?? 0, a = (n?.hasChapters ? n?.endPageIndexInSpineItem : n?.endAbsolutePageIndex) ?? 0, [l = 0, c = 0] = [
1311
+ r,
1063
1312
  a
1064
- ].sort((p, h) => p - h), d = n?.beginPageIndexInSpineItem !== n?.endPageIndexInSpineItem || n?.beginSpineItemIndex !== n?.endSpineItemIndex, u = n?.hasChapters ? n?.beginNumberOfPagesInSpineItem : n?.numberOfTotalPages;
1313
+ ].sort((g, h) => g - h), u = n?.beginPageIndexInSpineItem !== n?.endPageIndexInSpineItem || n?.beginSpineItemIndex !== n?.endSpineItemIndex, d = n?.hasChapters ? n?.beginNumberOfPagesInSpineItem : n?.numberOfTotalPages;
1065
1314
  return {
1066
1315
  hasOnlyOnePage: t,
1067
- beginPageIndex: i,
1316
+ beginPageIndex: r,
1068
1317
  endPageIndex: a,
1069
1318
  isBeginWithinChapter: o,
1070
- isEndWithinChapter: r,
1071
- beginAndEndAreDifferent: d,
1072
- totalApproximatePages: u,
1319
+ isEndWithinChapter: i,
1320
+ beginAndEndAreDifferent: u,
1321
+ totalApproximatePages: d,
1073
1322
  leftPageIndex: l,
1074
1323
  rightPageIndex: c
1075
1324
  };
1076
- }, Ut = () => {
1077
- const n = te(), {
1325
+ }, so = () => {
1326
+ const n = ie(), {
1078
1327
  hasOnlyOnePage: t,
1079
1328
  leftPageIndex: o,
1080
- rightPageIndex: r,
1081
- totalApproximatePages: i,
1329
+ rightPageIndex: i,
1330
+ totalApproximatePages: r,
1082
1331
  beginAndEndAreDifferent: a
1083
- } = ze(), l = Math.round((n?.percentageEstimateOfBook ?? 0) * 100), c = (u) => u?.subChapter ? `${u.title} / ${c(u.subChapter)}` : u?.title || "", d = c(n?.beginChapterInfo);
1084
- return /* @__PURE__ */ s(O, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
1085
- /* @__PURE__ */ e(qt, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(F, { justifyContent: "space-between", children: [
1086
- /* @__PURE__ */ e(Gt, { width: 110 }),
1087
- /* @__PURE__ */ e(jt, { children: `${l}%` })
1332
+ } = Be(), l = Math.round((n?.percentageEstimateOfBook ?? 0) * 100), c = (d) => d?.subChapter ? `${d.title} / ${c(d.subChapter)}` : d?.title || "", u = c(n?.beginChapterInfo);
1333
+ return /* @__PURE__ */ s(T, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
1334
+ /* @__PURE__ */ e(ao, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ s(N, { justifyContent: "space-between", children: [
1335
+ /* @__PURE__ */ e(ro, { width: 110 }),
1336
+ /* @__PURE__ */ e(lo, { children: `${l}%` })
1088
1337
  ] }) }),
1089
- /* @__PURE__ */ e(b, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: d ? `Chapter: ${d}` : " " }),
1090
- !t && /* @__PURE__ */ s(F, { children: [
1091
- /* @__PURE__ */ e(b, { fontSize: "xs", children: a ? `${o + 1} - ${r + 1} of ${i}` : `${o + 1} of ${i}` }),
1092
- !!n?.hasChapters && /* @__PURE__ */ s(de, { children: [
1093
- /* @__PURE__ */ e(b, { children: "-" }),
1094
- /* @__PURE__ */ s(b, { fontSize: "xs", children: [
1338
+ /* @__PURE__ */ e(C, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
1339
+ !t && /* @__PURE__ */ s(N, { children: [
1340
+ /* @__PURE__ */ e(C, { fontSize: "xs", children: a ? `${o + 1} - ${i + 1} of ${r}` : `${o + 1} of ${r}` }),
1341
+ !!n?.hasChapters && /* @__PURE__ */ s(ge, { children: [
1342
+ /* @__PURE__ */ e(C, { children: "-" }),
1343
+ /* @__PURE__ */ s(C, { fontSize: "xs", children: [
1095
1344
  "(",
1096
1345
  (n?.beginAbsolutePageIndex ?? 0) + 1,
1097
1346
  ")"
@@ -1099,13 +1348,13 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1099
1348
  ] })
1100
1349
  ] })
1101
1350
  ] });
1102
- }, Ke = g(
1351
+ }, rn = p(
1103
1352
  ({
1104
1353
  children: n,
1105
1354
  position: t,
1106
1355
  ...o
1107
1356
  }) => /* @__PURE__ */ e(
1108
- ue,
1357
+ pe,
1109
1358
  {
1110
1359
  display: "flex",
1111
1360
  flexDirection: "row",
@@ -1129,8 +1378,8 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1129
1378
  children: n
1130
1379
  }
1131
1380
  )
1132
- ), Qt = rn(Jn), Yt = g((n) => /* @__PURE__ */ e(
1133
- _,
1381
+ ), co = hn(rt), uo = p((n) => /* @__PURE__ */ e(
1382
+ L,
1134
1383
  {
1135
1384
  display: "contents",
1136
1385
  css: {
@@ -1139,7 +1388,7 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1139
1388
  "--color-solid": "colors.colorPalette.solid"
1140
1389
  },
1141
1390
  children: /* @__PURE__ */ e(
1142
- Qt,
1391
+ co,
1143
1392
  {
1144
1393
  keyboard: !1,
1145
1394
  style: {
@@ -1183,90 +1432,90 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1183
1432
  }
1184
1433
  )
1185
1434
  }
1186
- )), Zt = () => {
1187
- const t = te()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = ze(), i = t ? Math.floor((o || 0) / 2) : o, [a, l] = Tn(
1188
- () => ne({
1189
- default: i || 0
1435
+ )), ho = () => {
1436
+ const t = ie()?.isUsingSpread, { beginPageIndex: o, totalApproximatePages: i = 0 } = Be(), r = t ? Math.floor((o || 0) / 2) : o, [a, l] = Bn(
1437
+ () => te({
1438
+ default: r || 0
1190
1439
  })
1191
- ), c = 0, d = Math.max(
1440
+ ), c = 0, u = Math.max(
1192
1441
  0,
1193
- t ? Math.floor((r - 1) / 2) : r - 1
1442
+ t ? Math.floor((i - 1) / 2) : i - 1
1194
1443
  );
1195
- return $(() => {
1196
- l.update(i || 0);
1197
- }, [i, l]), {
1444
+ return F(() => {
1445
+ l.update(r || 0);
1446
+ }, [r, l]), {
1198
1447
  value: a,
1199
1448
  valueSignal: l,
1200
1449
  min: c,
1201
- max: d
1450
+ max: u
1202
1451
  };
1203
- }, Xt = (n) => {
1204
- const t = m(), o = te(), { manifest: r } = S(() => t?.context, [t]) ?? {}, i = r?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: l = 0, isBeginWithinChapter: c } = ze(), d = 1, u = c, { value: p, valueSignal: h, min: C, max: v } = Zt(), R = T(
1205
- (x) => {
1206
- const [L = 0] = Array.isArray(x) ? x : [x];
1207
- h.update(L);
1208
- const I = a ? Math.floor(L) * 2 : Math.floor(L);
1209
- u ? t?.navigation.goToPageOfSpineItem({
1210
- pageIndex: I,
1452
+ }, go = (n) => {
1453
+ const t = x(), o = ie(), { manifest: i } = v(() => t?.context, [t]) ?? {}, r = i?.readingDirection === "rtl", a = o?.isUsingSpread, { totalApproximatePages: l = 0, isBeginWithinChapter: c } = Be(), u = 1, d = c, { value: g, valueSignal: h, min: m, max: b } = ho(), w = P(
1454
+ (k) => {
1455
+ const [S = 0] = Array.isArray(k) ? k : [k];
1456
+ h.update(S);
1457
+ const O = a ? Math.floor(S) * 2 : Math.floor(S);
1458
+ d ? t?.navigation.goToPageOfSpineItem({
1459
+ pageIndex: O,
1211
1460
  spineItemId: t.pagination.state.beginSpineItemIndex ?? 0,
1212
1461
  animation: !1
1213
1462
  }) : t?.navigation.goToAbsolutePageIndex({
1214
- absolutePageIndex: I,
1463
+ absolutePageIndex: O,
1215
1464
  animation: !1
1216
1465
  });
1217
1466
  },
1218
- [t, a, h, u]
1467
+ [t, a, h, d]
1219
1468
  );
1220
- return H(
1469
+ return V(
1221
1470
  () => t?.navigation.throttleLock({
1222
1471
  duration: 100,
1223
1472
  trigger: h.subject
1224
1473
  }),
1225
1474
  [t, h]
1226
- ), l === 1 || a && l === 2 ? /* @__PURE__ */ e(_, { style: n.style }) : /* @__PURE__ */ e(
1227
- Yt,
1475
+ ), l === 1 || a && l === 2 ? /* @__PURE__ */ e(L, { style: n.style }) : /* @__PURE__ */ e(
1476
+ uo,
1228
1477
  {
1229
- value: [p],
1230
- max: v,
1231
- min: C,
1232
- reverse: i,
1233
- step: d,
1234
- onChange: R,
1478
+ value: [g],
1479
+ max: b,
1480
+ min: m,
1481
+ reverse: r,
1482
+ step: u,
1483
+ onChange: w,
1235
1484
  ...n
1236
1485
  }
1237
1486
  );
1238
- }, Kt = g(
1487
+ }, po = p(
1239
1488
  ({
1240
1489
  open: n,
1241
1490
  onItemClick: t
1242
1491
  }) => {
1243
- const o = un(null), r = m(), {
1244
- quickMenuBottomBarBoundingBoxSignal: i,
1492
+ const o = Sn(null), i = x(), {
1493
+ quickMenuBottomBarBoundingBoxSignal: r,
1245
1494
  onFontSizeMenuOpenChange: a,
1246
1495
  onRefitMenuOpenChange: l
1247
- } = y([
1496
+ } = M([
1248
1497
  "quickMenuBottomBarBoundingBoxSignal",
1249
1498
  "onFontSizeMenuOpenChange",
1250
1499
  "onRefitMenuOpenChange"
1251
- ]), c = S(() => r?.navigation.state$, [r]), d = S(() => r?.settings.values$, [r]), u = S(
1252
- () => r?.zoom.state$.pipe(
1253
- E(
1254
- (x) => x.currentScale > 1 ? "in" : x.currentScale < 1 ? "out" : void 0
1500
+ ]), c = v(() => i?.navigation.state$, [i]), u = v(() => i?.settings.values$, [i]), d = v(
1501
+ () => i?.zoom.state$.pipe(
1502
+ z(
1503
+ (k) => k.currentScale > 1 ? "in" : k.currentScale < 1 ? "out" : void 0
1255
1504
  )
1256
1505
  ),
1257
- [r]
1258
- ), p = u === "in", h = u === "out", C = d?.computedPageTurnMode === "scrollable", v = d?.computedPageTurnDirection === "vertical", [R, D] = w(!0);
1259
- return $(() => {
1506
+ [i]
1507
+ ), g = d === "in", h = d === "out", m = u?.computedPageTurnMode === "scrollable", b = u?.computedPageTurnDirection === "vertical", [w, I] = y(!0);
1508
+ return F(() => {
1260
1509
  if (!o.current) return;
1261
- const x = new ResizeObserver((L) => {
1262
- for (const I of L)
1263
- i.update(I);
1510
+ const k = new ResizeObserver((S) => {
1511
+ for (const O of S)
1512
+ r.update(O);
1264
1513
  });
1265
- return x.observe(o.current), () => {
1266
- x.disconnect();
1514
+ return k.observe(o.current), () => {
1515
+ k.disconnect();
1267
1516
  };
1268
- }, [i]), /* @__PURE__ */ s(
1269
- Ke,
1517
+ }, [r]), /* @__PURE__ */ s(
1518
+ rn,
1270
1519
  {
1271
1520
  present: n,
1272
1521
  position: "bottom",
@@ -1278,7 +1527,7 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1278
1527
  ref: o,
1279
1528
  children: [
1280
1529
  /* @__PURE__ */ s(
1281
- F,
1530
+ N,
1282
1531
  {
1283
1532
  flex: 1,
1284
1533
  alignItems: "center",
@@ -1287,19 +1536,19 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1287
1536
  px: 4,
1288
1537
  children: [
1289
1538
  /* @__PURE__ */ e(
1290
- k,
1539
+ R,
1291
1540
  {
1292
1541
  "aria-label": "left",
1293
1542
  size: "lg",
1294
1543
  variant: "ghost",
1295
1544
  flexShrink: 0,
1296
- onClick: () => r?.navigation.goToLeftOrTopSpineItem(),
1545
+ onClick: () => i?.navigation.goToLeftOrTopSpineItem(),
1297
1546
  disabled: !c?.canGoLeftSpineItem && !c?.canGoTopSpineItem,
1298
- children: v ? /* @__PURE__ */ e(Qn, {}) : /* @__PURE__ */ e(Yn, {})
1547
+ children: b ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ e(nt, {})
1299
1548
  }
1300
1549
  ),
1301
1550
  /* @__PURE__ */ s(
1302
- O,
1551
+ T,
1303
1552
  {
1304
1553
  flex: 1,
1305
1554
  maxW: 400,
@@ -1308,9 +1557,9 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1308
1557
  overflow: "auto",
1309
1558
  px: 4,
1310
1559
  children: [
1311
- /* @__PURE__ */ e(Ut, {}),
1560
+ /* @__PURE__ */ e(so, {}),
1312
1561
  /* @__PURE__ */ e(
1313
- Xt,
1562
+ go,
1314
1563
  {
1315
1564
  style: {
1316
1565
  width: "100%",
@@ -1323,7 +1572,7 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1323
1572
  }
1324
1573
  ),
1325
1574
  /* @__PURE__ */ e(
1326
- k,
1575
+ R,
1327
1576
  {
1328
1577
  "aria-label": "right",
1329
1578
  size: "lg",
@@ -1331,89 +1580,89 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1331
1580
  variant: "ghost",
1332
1581
  disabled: !c?.canGoRightSpineItem && !c?.canGoBottomSpineItem,
1333
1582
  onClick: () => {
1334
- r?.navigation.goToRightOrBottomSpineItem();
1583
+ i?.navigation.goToRightOrBottomSpineItem();
1335
1584
  },
1336
- children: v ? /* @__PURE__ */ e(Zn, {}) : /* @__PURE__ */ e(Xn, {})
1585
+ children: b ? /* @__PURE__ */ e(tt, {}) : /* @__PURE__ */ e(ot, {})
1337
1586
  }
1338
1587
  )
1339
1588
  ]
1340
1589
  }
1341
1590
  ),
1342
- /* @__PURE__ */ e(F, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ s(
1343
- be.Root,
1591
+ /* @__PURE__ */ e(N, { alignSelf: "stretch", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ s(
1592
+ ke.Root,
1344
1593
  {
1345
- open: R,
1594
+ open: w,
1346
1595
  flex: 1,
1347
- onOpenChange: ({ open: x }) => {
1348
- D(x);
1596
+ onOpenChange: ({ open: k }) => {
1597
+ I(k);
1349
1598
  },
1350
1599
  width: "100%",
1351
1600
  children: [
1352
1601
  /* @__PURE__ */ e(
1353
- be.Trigger,
1602
+ ke.Trigger,
1354
1603
  {
1355
1604
  paddingY: "3",
1356
1605
  width: "100%",
1357
1606
  display: "flex",
1358
1607
  justifyContent: "center",
1359
1608
  children: /* @__PURE__ */ e(
1360
- bn,
1609
+ Tn,
1361
1610
  {
1362
1611
  style: {
1363
- transform: R ? "rotate(0deg)" : "rotate(180deg)"
1612
+ transform: w ? "rotate(0deg)" : "rotate(180deg)"
1364
1613
  }
1365
1614
  }
1366
1615
  )
1367
1616
  }
1368
1617
  ),
1369
- /* @__PURE__ */ e(be.Content, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ s(_, { display: "flex", overflowX: "auto", px: 4, pb: 1, children: [
1618
+ /* @__PURE__ */ e(ke.Content, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ s(L, { display: "flex", overflowX: "auto", px: 4, pb: 1, children: [
1370
1619
  /* @__PURE__ */ e(
1371
- k,
1620
+ R,
1372
1621
  {
1373
1622
  "aria-label": "Help",
1374
1623
  size: "lg",
1375
1624
  variant: "ghost",
1376
1625
  onClick: () => t("help"),
1377
- children: /* @__PURE__ */ e(Sn, {})
1626
+ children: /* @__PURE__ */ e(Rn, {})
1378
1627
  }
1379
1628
  ),
1380
1629
  /* @__PURE__ */ e(
1381
- k,
1630
+ R,
1382
1631
  {
1383
1632
  "aria-label": "Table of contents",
1384
1633
  size: "lg",
1385
1634
  variant: "ghost",
1386
1635
  onClick: () => t("toc"),
1387
- children: /* @__PURE__ */ e(Cn, {})
1636
+ children: /* @__PURE__ */ e(zn, {})
1388
1637
  }
1389
1638
  ),
1390
- je(r) && /* @__PURE__ */ e(
1391
- k,
1639
+ Ke(i) && /* @__PURE__ */ e(
1640
+ R,
1392
1641
  {
1393
1642
  "aria-label": "Search",
1394
1643
  size: "lg",
1395
1644
  variant: "ghost",
1396
1645
  onClick: () => t("search"),
1397
- children: /* @__PURE__ */ e(vn, {})
1646
+ children: /* @__PURE__ */ e(Mn, {})
1398
1647
  }
1399
1648
  ),
1400
1649
  /* @__PURE__ */ e(
1401
- k,
1650
+ R,
1402
1651
  {
1403
1652
  "aria-label": "Zoom",
1404
1653
  size: "lg",
1405
- variant: p ? "solid" : "ghost",
1654
+ variant: g ? "solid" : "ghost",
1406
1655
  onClick: () => {
1407
- p ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
1656
+ g ? i?.zoom.exit({ animate: !0 }) : i?.zoom.enter({
1408
1657
  animate: !0,
1409
1658
  scale: 2
1410
1659
  });
1411
1660
  },
1412
- children: p ? /* @__PURE__ */ e(xn, {}) : /* @__PURE__ */ e(kn, {})
1661
+ children: g ? /* @__PURE__ */ e(wn, {}) : /* @__PURE__ */ e(yn, {})
1413
1662
  }
1414
1663
  ),
1415
1664
  /* @__PURE__ */ e(
1416
- k,
1665
+ R,
1417
1666
  {
1418
1667
  "aria-label": "font size",
1419
1668
  size: "lg",
@@ -1421,31 +1670,31 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1421
1670
  a(!0);
1422
1671
  },
1423
1672
  variant: "ghost",
1424
- children: /* @__PURE__ */ e(Wn, {})
1673
+ children: /* @__PURE__ */ e(Qn, {})
1425
1674
  }
1426
1675
  ),
1427
- ce(r) && /* @__PURE__ */ e(
1428
- k,
1676
+ he(i) && /* @__PURE__ */ e(
1677
+ R,
1429
1678
  {
1430
1679
  "aria-label": "Bookmarks",
1431
1680
  size: "lg",
1432
1681
  variant: "ghost",
1433
1682
  onClick: () => t("bookmarks"),
1434
- children: /* @__PURE__ */ e(Hn, {})
1683
+ children: /* @__PURE__ */ e(Yn, {})
1435
1684
  }
1436
1685
  ),
1437
- ce(r) && /* @__PURE__ */ e(
1438
- k,
1686
+ he(i) && /* @__PURE__ */ e(
1687
+ R,
1439
1688
  {
1440
1689
  "aria-label": "Annotations",
1441
1690
  size: "lg",
1442
1691
  variant: "ghost",
1443
1692
  onClick: () => t("annotations"),
1444
- children: /* @__PURE__ */ e(pe, {})
1693
+ children: /* @__PURE__ */ e(de, {})
1445
1694
  }
1446
1695
  ),
1447
- Qe(r) && /* @__PURE__ */ e(
1448
- k,
1696
+ en(i) && /* @__PURE__ */ e(
1697
+ R,
1449
1698
  {
1450
1699
  "aria-label": "Refit",
1451
1700
  size: "lg",
@@ -1453,33 +1702,33 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1453
1702
  onClick: () => {
1454
1703
  l(!0);
1455
1704
  },
1456
- disabled: !C,
1457
- children: /* @__PURE__ */ e(Gn, {})
1705
+ disabled: !m,
1706
+ children: /* @__PURE__ */ e(Zn, {})
1458
1707
  }
1459
1708
  ),
1460
1709
  /* @__PURE__ */ e(
1461
- k,
1710
+ R,
1462
1711
  {
1463
1712
  "aria-label": "Thumbnails",
1464
1713
  size: "lg",
1465
1714
  variant: h ? "solid" : "ghost",
1466
1715
  onClick: () => {
1467
- h ? r?.zoom.exit({ animate: !0 }) : r?.zoom.enter({
1716
+ h ? i?.zoom.exit({ animate: !0 }) : i?.zoom.enter({
1468
1717
  animate: !0,
1469
1718
  scale: 0.5
1470
1719
  });
1471
1720
  },
1472
- children: /* @__PURE__ */ e(In, {})
1721
+ children: /* @__PURE__ */ e(Pn, {})
1473
1722
  }
1474
1723
  ),
1475
- Ue(r) && /* @__PURE__ */ e(
1476
- k,
1724
+ Je(i) && /* @__PURE__ */ e(
1725
+ R,
1477
1726
  {
1478
1727
  "aria-label": "Gallery",
1479
1728
  size: "lg",
1480
1729
  variant: "ghost",
1481
1730
  onClick: () => t("gallery"),
1482
- children: /* @__PURE__ */ e(Un, {})
1731
+ children: /* @__PURE__ */ e(Jn, {})
1483
1732
  }
1484
1733
  )
1485
1734
  ] }) })
@@ -1490,31 +1739,31 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1490
1739
  }
1491
1740
  );
1492
1741
  }
1493
- ), Jt = () => {
1494
- const [n, t] = w(!1), o = T(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1742
+ ), fo = () => {
1743
+ const [n, t] = y(!1), o = P(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
1495
1744
  t(!1);
1496
1745
  }) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
1497
1746
  t(!0);
1498
1747
  }), []);
1499
- return $(() => {
1500
- function r() {
1748
+ return F(() => {
1749
+ function i() {
1501
1750
  t(!!document.fullscreenElement);
1502
1751
  }
1503
- return document.addEventListener("fullscreenchange", r), () => {
1504
- document.removeEventListener("fullscreenchange", r);
1752
+ return document.addEventListener("fullscreenchange", i), () => {
1753
+ document.removeEventListener("fullscreenchange", i);
1505
1754
  };
1506
1755
  }, []), {
1507
1756
  isFullscreen: n,
1508
1757
  onToggleFullscreenClick: o
1509
1758
  };
1510
- }, eo = g(
1759
+ }, mo = p(
1511
1760
  ({
1512
1761
  open: n,
1513
1762
  onItemClick: t
1514
1763
  }) => {
1515
- const o = m(), r = S(() => o?.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: a } = Jt();
1764
+ const o = x(), i = v(() => o?.context.manifest$, [o]), { isFullscreen: r, onToggleFullscreenClick: a } = fo();
1516
1765
  return /* @__PURE__ */ s(
1517
- Ke,
1766
+ rn,
1518
1767
  {
1519
1768
  present: n,
1520
1769
  position: "top",
@@ -1522,18 +1771,18 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1522
1771
  justifyContent: "space-between",
1523
1772
  children: [
1524
1773
  /* @__PURE__ */ e(
1525
- k,
1774
+ R,
1526
1775
  {
1527
1776
  "aria-label": "left",
1528
1777
  size: "lg",
1529
1778
  variant: "ghost",
1530
1779
  flexShrink: 0,
1531
1780
  onClick: () => t("back"),
1532
- children: /* @__PURE__ */ e(et, {})
1781
+ children: /* @__PURE__ */ e(at, {})
1533
1782
  }
1534
1783
  ),
1535
1784
  /* @__PURE__ */ e(
1536
- O,
1785
+ T,
1537
1786
  {
1538
1787
  flex: 1,
1539
1788
  maxW: 600,
@@ -1541,30 +1790,30 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1541
1790
  alignItems: "center",
1542
1791
  overflow: "auto",
1543
1792
  px: 4,
1544
- children: /* @__PURE__ */ e(b, { truncate: !0, maxWidth: "100%", children: r?.title })
1793
+ children: /* @__PURE__ */ e(C, { truncate: !0, maxWidth: "100%", children: i?.title })
1545
1794
  }
1546
1795
  ),
1547
- /* @__PURE__ */ s(F, { children: [
1796
+ /* @__PURE__ */ s(N, { children: [
1548
1797
  /* @__PURE__ */ e(
1549
- k,
1798
+ R,
1550
1799
  {
1551
1800
  "aria-label": "right",
1552
1801
  size: "lg",
1553
1802
  flexShrink: 0,
1554
1803
  variant: "ghost",
1555
1804
  onClick: () => t("more"),
1556
- children: /* @__PURE__ */ e(nt, {})
1805
+ children: /* @__PURE__ */ e(lt, {})
1557
1806
  }
1558
1807
  ),
1559
1808
  /* @__PURE__ */ e(
1560
- k,
1809
+ R,
1561
1810
  {
1562
1811
  "aria-label": "right",
1563
1812
  size: "lg",
1564
1813
  flexShrink: 0,
1565
1814
  variant: "ghost",
1566
1815
  onClick: a,
1567
- children: i ? /* @__PURE__ */ e(qn, {}) : /* @__PURE__ */ e(jn, {})
1816
+ children: r ? /* @__PURE__ */ e(Xn, {}) : /* @__PURE__ */ e(Kn, {})
1568
1817
  }
1569
1818
  )
1570
1819
  ] })
@@ -1572,13 +1821,13 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1572
1821
  }
1573
1822
  );
1574
1823
  }
1575
- ), Me = () => {
1824
+ ), De = () => {
1576
1825
  const {
1577
1826
  quickMenuOpen: n,
1578
1827
  onQuickMenuOpenChange: t,
1579
1828
  _quickMenuOpen: o,
1580
- _onQuickMenuOpenChange: r
1581
- } = y([
1829
+ _onQuickMenuOpenChange: i
1830
+ } = M([
1582
1831
  "quickMenuOpen",
1583
1832
  "onQuickMenuOpenChange",
1584
1833
  "_quickMenuOpen",
@@ -1586,65 +1835,66 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1586
1835
  ]);
1587
1836
  return [
1588
1837
  n ?? o,
1589
- t ?? r
1838
+ t ?? i
1590
1839
  ];
1591
- }, no = g(
1840
+ }, bo = p(
1592
1841
  ({
1593
1842
  onItemClick: n
1594
1843
  }) => {
1595
- const [t] = Me(), { refitMenuOpen: o, fontSizeMenuOpen: r } = y([
1844
+ const [t] = De(), { refitMenuOpen: o, fontSizeMenuOpen: i, selectedHighlight: r } = M([
1596
1845
  "refitMenuOpen",
1597
- "fontSizeMenuOpen"
1846
+ "fontSizeMenuOpen",
1847
+ "selectedHighlight"
1598
1848
  ]);
1599
- return /* @__PURE__ */ s(de, { children: [
1849
+ return /* @__PURE__ */ s(ge, { children: [
1600
1850
  /* @__PURE__ */ e(
1601
- eo,
1851
+ mo,
1602
1852
  {
1603
- open: t && !o && !r,
1853
+ open: t && !o && !i && !r,
1604
1854
  onItemClick: n
1605
1855
  }
1606
1856
  ),
1607
1857
  /* @__PURE__ */ e(
1608
- Kt,
1858
+ po,
1609
1859
  {
1610
- open: t && !o && !r,
1860
+ open: t && !o && !i,
1611
1861
  onItemClick: n
1612
1862
  }
1613
1863
  )
1614
1864
  ] });
1615
1865
  }
1616
- ), to = () => {
1617
- const [n, t] = Me(), o = m();
1618
- H(() => o?.gestures.gestures$.pipe(
1619
- se((r) => r.type === "tap" && !r.handled),
1620
- ke(
1866
+ ), So = () => {
1867
+ const [n, t] = De(), o = x();
1868
+ V(() => o?.gestures.gestures$.pipe(
1869
+ ue((i) => i.type === "tap" && !i.handled),
1870
+ we(
1621
1871
  o.selection.selection$,
1622
1872
  o.selection.lastSelectionOnPointerdown$
1623
1873
  ),
1624
- $e(([, r, i]) => {
1625
- t(r || i ? !1 : (a) => !a);
1874
+ Me(([, i, r]) => {
1875
+ t(i || r ? !1 : (a) => !a);
1626
1876
  })
1627
1877
  ), [o]);
1628
- }, oo = A.forwardRef(
1878
+ }, Co = E.forwardRef(
1629
1879
  function(t, o) {
1630
- const { label: r, children: i, helperText: a, errorText: l, optionalText: c, ...d } = t;
1631
- return /* @__PURE__ */ s(oe.Root, { ref: o, ...d, children: [
1632
- r && /* @__PURE__ */ s(oe.Label, { children: [
1633
- r,
1634
- /* @__PURE__ */ e(oe.RequiredIndicator, { fallback: c })
1880
+ const { label: i, children: r, helperText: a, errorText: l, optionalText: c, ...u } = t;
1881
+ return /* @__PURE__ */ s(re.Root, { ref: o, ...u, children: [
1882
+ i && /* @__PURE__ */ s(re.Label, { children: [
1883
+ i,
1884
+ /* @__PURE__ */ e(re.RequiredIndicator, { fallback: c })
1635
1885
  ] }),
1636
- i,
1637
- a && /* @__PURE__ */ e(oe.HelperText, { children: a }),
1638
- l && /* @__PURE__ */ e(oe.ErrorText, { children: l })
1886
+ r,
1887
+ a && /* @__PURE__ */ e(re.HelperText, { children: a }),
1888
+ l && /* @__PURE__ */ e(re.ErrorText, { children: l })
1639
1889
  ] });
1640
1890
  }
1641
- ), ro = g(() => {
1642
- const { refitMenuOpen: t, onRefitMenuOpenChange: o } = y([
1891
+ ), vo = p(() => {
1892
+ const { refitMenuOpen: t, onRefitMenuOpenChange: o } = M([
1643
1893
  "refitMenuOpen",
1644
1894
  "onRefitMenuOpenChange"
1645
- ]), r = m(), i = Qe(r) ? r : void 0, a = S(
1646
- () => i?.refit.settings$,
1647
- [i]
1895
+ ]), i = x(), r = en(i) ? i : void 0, a = v(
1896
+ () => r?.refit.settings$,
1897
+ [r]
1648
1898
  );
1649
1899
  return /* @__PURE__ */ e(
1650
1900
  j,
@@ -1653,33 +1903,33 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1653
1903
  open: t,
1654
1904
  onOpenChange: (l) => o(l.open),
1655
1905
  placement: "center",
1656
- children: /* @__PURE__ */ s(G, { children: [
1657
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Viewport fit" }) }),
1658
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ s(N.Root, { children: [
1659
- /* @__PURE__ */ e(N.HelperText, { children: "Adjust the viewport for a more comfortable reading experience." }),
1660
- /* @__PURE__ */ s(N.Content, { children: [
1661
- /* @__PURE__ */ e(oo, { label: "Profile", children: /* @__PURE__ */ e(
1662
- Xe,
1906
+ children: /* @__PURE__ */ s(q, { children: [
1907
+ /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Viewport fit" }) }),
1908
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ s(G.Root, { children: [
1909
+ /* @__PURE__ */ e(G.HelperText, { children: "Adjust the viewport for a more comfortable reading experience." }),
1910
+ /* @__PURE__ */ s(G.Content, { children: [
1911
+ /* @__PURE__ */ e(Co, { label: "Profile", children: /* @__PURE__ */ e(
1912
+ on,
1663
1913
  {
1664
1914
  defaultValue: "fit",
1665
1915
  onValueChange: (l) => {
1666
1916
  const c = l.value;
1667
- i?.refit.update({
1917
+ r?.refit.update({
1668
1918
  viewportFit: c,
1669
1919
  customWidth: 60
1670
1920
  });
1671
1921
  },
1672
1922
  value: a?.viewportFit ?? "fit",
1673
- children: /* @__PURE__ */ s(O, { gap: 2, children: [
1674
- /* @__PURE__ */ e(ae, { value: "desktop", children: "Desktop" }),
1675
- /* @__PURE__ */ e(ae, { value: "tablet", children: "Tablet" }),
1676
- /* @__PURE__ */ e(ae, { value: "fit", children: "Full width (default)" }),
1677
- /* @__PURE__ */ e(ae, { value: "custom", children: "Custom" })
1923
+ children: /* @__PURE__ */ s(T, { gap: 2, children: [
1924
+ /* @__PURE__ */ e(se, { value: "desktop", children: "Desktop" }),
1925
+ /* @__PURE__ */ e(se, { value: "tablet", children: "Tablet" }),
1926
+ /* @__PURE__ */ e(se, { value: "fit", children: "Full width (default)" }),
1927
+ /* @__PURE__ */ e(se, { value: "custom", children: "Custom" })
1678
1928
  ] })
1679
1929
  }
1680
1930
  ) }),
1681
1931
  /* @__PURE__ */ e(
1682
- Re,
1932
+ Ae,
1683
1933
  {
1684
1934
  label: "Maximum width (%)",
1685
1935
  showValue: !0,
@@ -1690,7 +1940,7 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1690
1940
  value: [a?.customWidth ?? 60],
1691
1941
  onValueChange: (l) => {
1692
1942
  const c = l.value[0] ?? 0;
1693
- i?.refit.update({
1943
+ r?.refit.update({
1694
1944
  customWidth: c
1695
1945
  });
1696
1946
  }
@@ -1698,24 +1948,24 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1698
1948
  )
1699
1949
  ] })
1700
1950
  ] }) }),
1701
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Close" }) }) }),
1702
- /* @__PURE__ */ e(q, {})
1951
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(D, { variant: "outline", children: "Close" }) }) }),
1952
+ /* @__PURE__ */ e(U, {})
1703
1953
  ] })
1704
1954
  }
1705
1955
  );
1706
- }), io = g(
1956
+ }), xo = p(
1707
1957
  ({
1708
1958
  contextText: n = "",
1709
1959
  startOffset: t = 0,
1710
1960
  text: o,
1711
- cfi: r = "#",
1712
- onClick: i,
1961
+ cfi: i = "#",
1962
+ onClick: r,
1713
1963
  absolutePageIndex: a
1714
1964
  }) => {
1715
1965
  const c = n.substring(
1716
1966
  Math.max(t - 15, 0),
1717
1967
  Math.max(t, 0)
1718
- ), d = n.substring(
1968
+ ), u = n.substring(
1719
1969
  Math.min(t + o.length, n.length - 1),
1720
1970
  Math.min(
1721
1971
  t + o.length + 15,
@@ -1723,68 +1973,68 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1723
1973
  )
1724
1974
  );
1725
1975
  return /* @__PURE__ */ s(
1726
- xe,
1976
+ ze,
1727
1977
  {
1728
- href: r,
1978
+ href: i,
1729
1979
  style: { margin: 5, overflow: "hidden" },
1730
- onClick: (u) => {
1731
- u.preventDefault(), i(r);
1980
+ onClick: (d) => {
1981
+ d.preventDefault(), r(i);
1732
1982
  },
1733
1983
  display: "flex",
1734
1984
  flexDirection: "column",
1735
1985
  alignItems: "flex-start",
1736
1986
  gap: 0,
1737
1987
  children: [
1738
- /* @__PURE__ */ s(b, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1988
+ /* @__PURE__ */ s(C, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
1739
1989
  '"',
1740
1990
  c,
1741
1991
  /* @__PURE__ */ e("b", { children: o }),
1742
- d,
1992
+ u,
1743
1993
  '"'
1744
1994
  ] }),
1745
- /* @__PURE__ */ e(b, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${a !== void 0 ? a + 1 : "unknown (not loaded)"}` })
1995
+ /* @__PURE__ */ e(C, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${a !== void 0 ? a + 1 : "unknown (not loaded)"}` })
1746
1996
  ]
1747
1997
  }
1748
1998
  );
1749
1999
  }
1750
- ), ao = 500, lo = () => {
1751
- const n = he(() => new Bn("")), t = S(n), o = m(), r = je(o) ? o : void 0, i = S(() => n.pipe(
1752
- De(),
1753
- V(
1754
- (a) => a === "" || !r ? ge(void 0) : Ve(
1755
- ge({
2000
+ ), ko = 500, Io = () => {
2001
+ const n = me(() => new Hn("")), t = v(n), o = x(), i = Ke(o) ? o : void 0, r = v(() => n.pipe(
2002
+ Se(),
2003
+ W(
2004
+ (a) => a === "" || !i ? be(void 0) : je(
2005
+ be({
1756
2006
  type: "start",
1757
2007
  data: void 0
1758
2008
  }),
1759
- We(ao).pipe(
1760
- V(() => r.search.search(a)),
1761
- E((l) => ({ type: "end", data: l }))
2009
+ Qe(ko).pipe(
2010
+ W(() => i.search.search(a)),
2011
+ z((l) => ({ type: "end", data: l }))
1762
2012
  )
1763
2013
  )
1764
2014
  )
1765
- ), [r, n]);
2015
+ ), [i, n]);
1766
2016
  return {
1767
2017
  value: t,
1768
2018
  setValue: n.next.bind(n),
1769
- status: i?.type ?? "idle",
1770
- data: i?.data
2019
+ status: r?.type ?? "idle",
2020
+ data: r?.data
1771
2021
  };
1772
- }, so = g(
2022
+ }, Oo = p(
1773
2023
  ({ onNavigate: n }) => {
1774
- const t = m(), { value: o, setValue: r, status: i, data: a } = lo(), l = (u) => {
1775
- r(u.target.value);
1776
- }, c = T(
1777
- (u) => {
1778
- n(), t?.navigation.goToCfi(u);
2024
+ const t = x(), { value: o, setValue: i, status: r, data: a } = Io(), l = (d) => {
2025
+ i(d.target.value);
2026
+ }, c = P(
2027
+ (d) => {
2028
+ n(), t?.navigation.goToCfi(d);
1779
2029
  },
1780
2030
  [t, n]
1781
- ), d = S(
2031
+ ), u = v(
1782
2032
  () => t?.locateResource(a?.slice(0, 100) ?? []),
1783
2033
  [a]
1784
2034
  );
1785
- return /* @__PURE__ */ s(O, { flex: 1, height: "100%", gap: 2, children: [
2035
+ return /* @__PURE__ */ s(T, { flex: 1, height: "100%", gap: 2, children: [
1786
2036
  /* @__PURE__ */ e(
1787
- an,
2037
+ gn,
1788
2038
  {
1789
2039
  placeholder: "Type something...",
1790
2040
  value: o,
@@ -1799,32 +2049,32 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1799
2049
  }
1800
2050
  ),
1801
2051
  /* @__PURE__ */ s(
1802
- O,
2052
+ T,
1803
2053
  {
1804
2054
  style: { overflow: "hidden", overflowY: "auto" },
1805
2055
  overflow: "auto",
1806
2056
  px: 4,
1807
2057
  flex: 1,
1808
2058
  children: [
1809
- i === "start" && /* @__PURE__ */ e(b, { children: "Searching ..." }),
1810
- a?.length === 0 && /* @__PURE__ */ e(b, { children: "No results" }),
1811
- i === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ s(O, { children: [
1812
- /* @__PURE__ */ s(b, { fontSize: "md", children: [
2059
+ r === "start" && /* @__PURE__ */ e(C, { children: "Searching ..." }),
2060
+ a?.length === 0 && /* @__PURE__ */ e(C, { children: "No results" }),
2061
+ r === "end" && (a?.length ?? 0) > 0 && /* @__PURE__ */ s(T, { children: [
2062
+ /* @__PURE__ */ s(C, { fontSize: "md", children: [
1813
2063
  a?.length,
1814
2064
  " result(s)"
1815
2065
  ] }),
1816
- /* @__PURE__ */ e(O, { gap: 0, children: d?.map((u, p) => /* @__PURE__ */ e(
1817
- io,
2066
+ /* @__PURE__ */ e(T, { gap: 0, children: u?.map((d, g) => /* @__PURE__ */ e(
2067
+ xo,
1818
2068
  {
1819
- contextText: u.meta?.range?.startContainer.parentElement?.textContent ?? "",
1820
- pageIndex: u.meta?.itemPageIndex,
1821
- startOffset: u.meta?.range?.startOffset ?? 0,
2069
+ contextText: d.meta?.range?.startContainer.parentElement?.textContent ?? "",
2070
+ pageIndex: d.meta?.itemPageIndex,
2071
+ startOffset: d.meta?.range?.startOffset ?? 0,
1822
2072
  text: o,
1823
- cfi: u.meta.cfi,
2073
+ cfi: d.meta.cfi,
1824
2074
  onClick: c,
1825
- absolutePageIndex: u.meta?.absolutePageIndex
2075
+ absolutePageIndex: d.meta?.absolutePageIndex
1826
2076
  },
1827
- p
2077
+ g
1828
2078
  )) })
1829
2079
  ] })
1830
2080
  ]
@@ -1832,7 +2082,7 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1832
2082
  )
1833
2083
  ] });
1834
2084
  }
1835
- ), co = g(
2085
+ ), To = p(
1836
2086
  ({
1837
2087
  open: n,
1838
2088
  setOpen: t,
@@ -1843,53 +2093,53 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1843
2093
  lazyMount: !0,
1844
2094
  placement: "center",
1845
2095
  open: n,
1846
- onOpenChange: (r) => t(r.open),
2096
+ onOpenChange: (i) => t(i.open),
1847
2097
  size: { mdDown: "full", md: "lg" },
1848
2098
  scrollBehavior: "inside",
1849
- children: /* @__PURE__ */ s(G, { height: "100%", children: [
1850
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Search" }) }),
1851
- /* @__PURE__ */ e(Y, { flex: 1, p: 0, children: /* @__PURE__ */ e(so, { onNavigate: o }) }),
1852
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
1853
- /* @__PURE__ */ e(q, {})
2099
+ children: /* @__PURE__ */ s(q, { height: "100%", children: [
2100
+ /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Search" }) }),
2101
+ /* @__PURE__ */ e(Z, { flex: 1, p: 0, children: /* @__PURE__ */ e(Oo, { onNavigate: o }) }),
2102
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(D, { variant: "outline", children: "Cancel" }) }) }),
2103
+ /* @__PURE__ */ e(U, {})
1854
2104
  ] })
1855
2105
  }
1856
2106
  )
1857
- ), uo = g(
2107
+ ), Ro = p(
1858
2108
  ({ onNavigate: n }) => {
1859
- const t = m(), { manifest: o, assumedRenditionLayout: r } = S(() => t?.context, [t]) ?? {}, { nav: i } = o ?? {}, a = te();
1860
- i?.toc;
1861
- const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, d = (r === "reflowable" ? c : l) || 0;
1862
- let u = a?.beginChapterInfo;
1863
- for (; u?.subChapter; )
1864
- u = u?.subChapter;
1865
- const p = (h, C, v) => /* @__PURE__ */ s(ln.Fragment, { children: [
2109
+ const t = x(), { manifest: o, assumedRenditionLayout: i } = v(() => t?.context, [t]) ?? {}, { nav: r } = o ?? {}, a = ie();
2110
+ r?.toc;
2111
+ const { beginSpineItemIndex: l, beginPageIndexInSpineItem: c } = a ?? {}, u = (i === "reflowable" ? c : l) || 0;
2112
+ let d = a?.beginChapterInfo;
2113
+ for (; d?.subChapter; )
2114
+ d = d?.subChapter;
2115
+ const g = (h, m, b) => /* @__PURE__ */ s(pn.Fragment, { children: [
1866
2116
  /* @__PURE__ */ e(
1867
- B.Item,
2117
+ H.Item,
1868
2118
  {
1869
- pl: 4 * (v + 1),
2119
+ pl: 4 * (b + 1),
1870
2120
  style: {
1871
2121
  display: "flex",
1872
2122
  alignItems: "center"
1873
2123
  },
1874
2124
  children: /* @__PURE__ */ s(
1875
- xe,
2125
+ ze,
1876
2126
  {
1877
2127
  onClick: () => {
1878
2128
  n(), t?.navigation.goToUrl(h.href);
1879
2129
  },
1880
2130
  href: "#",
1881
2131
  children: [
1882
- u?.path === h.path && /* @__PURE__ */ e(B.Indicator, { asChild: !0, children: /* @__PURE__ */ e(ye, {}) }),
1883
- u?.path !== h.path && /* @__PURE__ */ e(B.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(ye, {}) }),
1884
- /* @__PURE__ */ s(O, { gap: 0, children: [
1885
- /* @__PURE__ */ e(b, { fontSize: "md", children: h.title || h.path }),
1886
- u?.path === h.path && /* @__PURE__ */ e(
1887
- b,
2132
+ d?.path === h.path && /* @__PURE__ */ e(H.Indicator, { asChild: !0, children: /* @__PURE__ */ e(_e, {}) }),
2133
+ d?.path !== h.path && /* @__PURE__ */ e(H.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ e(_e, {}) }),
2134
+ /* @__PURE__ */ s(T, { gap: 0, children: [
2135
+ /* @__PURE__ */ e(C, { fontSize: "md", children: h.title || h.path }),
2136
+ d?.path === h.path && /* @__PURE__ */ e(
2137
+ C,
1888
2138
  {
1889
2139
  fontStyle: "italic",
1890
2140
  fontWeight: "bold",
1891
2141
  fontSize: "sm",
1892
- children: `Currently on page ${d + 1}`
2142
+ children: `Currently on page ${u + 1}`
1893
2143
  }
1894
2144
  )
1895
2145
  ] })
@@ -1898,13 +2148,13 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1898
2148
  )
1899
2149
  }
1900
2150
  ),
1901
- h.contents.length > 0 && /* @__PURE__ */ e(B.Root, { as: "div", gap: 2, children: h.contents.map(
1902
- (R, D) => p(R, D, v + 1)
2151
+ h.contents.length > 0 && /* @__PURE__ */ e(H.Root, { as: "div", gap: 2, children: h.contents.map(
2152
+ (w, I) => g(w, I, b + 1)
1903
2153
  ) })
1904
- ] }, C);
1905
- return /* @__PURE__ */ e(B.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i?.toc.map((h, C) => p(h, C, 0)) });
2154
+ ] }, m);
2155
+ return /* @__PURE__ */ e(H.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: r?.toc.map((h, m) => g(h, m, 0)) });
1906
2156
  }
1907
- ), ho = g(
2157
+ ), zo = p(
1908
2158
  ({
1909
2159
  open: n,
1910
2160
  setOpen: t,
@@ -1915,110 +2165,92 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
1915
2165
  lazyMount: !0,
1916
2166
  placement: "center",
1917
2167
  open: n,
1918
- onOpenChange: (r) => t(r.open),
2168
+ onOpenChange: (i) => t(i.open),
1919
2169
  size: { mdDown: "full", md: "lg" },
1920
2170
  scrollBehavior: "inside",
1921
- children: /* @__PURE__ */ s(G, { children: [
1922
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(Z, { children: "Table of Contents" }) }),
1923
- /* @__PURE__ */ e(Y, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(uo, { onNavigate: o }) }),
1924
- /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(W, { variant: "outline", children: "Cancel" }) }) }),
1925
- /* @__PURE__ */ e(q, {})
2171
+ children: /* @__PURE__ */ s(q, { children: [
2172
+ /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Table of Contents" }) }),
2173
+ /* @__PURE__ */ e(Z, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ e(Ro, { onNavigate: o }) }),
2174
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(D, { variant: "outline", children: "Cancel" }) }) }),
2175
+ /* @__PURE__ */ e(U, {})
1926
2176
  ] })
1927
2177
  }
1928
2178
  )
1929
- ), po = () => {
1930
- const n = m(), { zoomMaxScale: t } = y(["zoomMaxScale"]);
1931
- $(
2179
+ ), Mo = () => {
2180
+ const n = x(), { zoomMaxScale: t } = M(["zoomMaxScale"]);
2181
+ F(
1932
2182
  function() {
1933
2183
  n?.gestures.settings.update({
1934
- zoomMaxScale: t ?? He
2184
+ zoomMaxScale: t ?? Ye
1935
2185
  });
1936
2186
  },
1937
2187
  [n, t]
1938
2188
  );
1939
- }, Ae = 0.5, Be = 1, go = (n, t, o, r) => {
1940
- if (n > t && n < t + r)
1941
- return t + r;
1942
- const i = Math.min(Math.max(n, t), o), a = Math.round((i - t) / r) * r + t;
2189
+ }, Le = 0.5, He = 1, wo = (n, t, o, i) => {
2190
+ if (n > t && n < t + i)
2191
+ return t + i;
2192
+ const r = Math.min(Math.max(n, t), o), a = Math.round((r - t) / i) * i + t;
1943
2193
  return Math.round(a * 100) / 100;
1944
- }, fo = g(() => {
1945
- const { quickMenuBottomBarBoundingBoxSignal: n, zoomMaxScale: t = He } = y([
1946
- "quickMenuBottomBarBoundingBoxSignal",
2194
+ }, yo = p(() => {
2195
+ const { zoomMaxScale: n = Ye } = M([
1947
2196
  "zoomMaxScale"
1948
- ]), o = Se(
1949
- n
1950
- ), r = m(), i = S(
1951
- () => r?.zoom.state$.pipe(
1952
- E((d) => d.currentScale),
1953
- Le(100, Fn, {
2197
+ ]), t = x(), o = v(
2198
+ () => t?.zoom.state$.pipe(
2199
+ z((a) => a.currentScale),
2200
+ qe(100, Nn, {
1954
2201
  leading: !0,
1955
2202
  trailing: !0
1956
2203
  })
1957
2204
  ),
1958
- [r]
1959
- ) ?? 1, a = S(
1960
- () => r?.zoom.state$.pipe(E((d) => d.isZooming)),
1961
- [r]
1962
- ) ?? !1, l = go(
1963
- i,
1964
- Be,
1965
- t,
1966
- Ae
1967
- ), c = o?.borderBoxSize?.[0]?.blockSize ?? 1;
1968
- return /* @__PURE__ */ e(
1969
- ue,
2205
+ [t]
2206
+ ) ?? 1, i = v(
2207
+ () => t?.zoom.state$.pipe(z((a) => a.isZooming)),
2208
+ [t]
2209
+ ) ?? !1, r = wo(
2210
+ o,
2211
+ He,
2212
+ n,
2213
+ Le
2214
+ );
2215
+ return /* @__PURE__ */ e(Xe, { present: i && o > 1, children: /* @__PURE__ */ e(
2216
+ Ae,
1970
2217
  {
1971
- present: a && i > 1,
1972
- animationName: { _open: "fade-in", _closed: "fade-out" },
1973
- animationDuration: "moderate",
1974
- position: "absolute",
1975
- bottom: `calc(${c}px + var(--chakra-spacing-4))`,
1976
- right: 4,
1977
- backgroundColor: "bg.panel",
1978
- shadow: "sm",
1979
- borderRadius: "md",
1980
- p: 4,
1981
- children: /* @__PURE__ */ e(
1982
- Re,
1983
- {
1984
- value: [l],
1985
- min: Be,
1986
- max: t,
1987
- step: Ae,
1988
- minWidth: 200,
1989
- onValueChange: (d) => {
1990
- const u = d.value?.[0] ?? 1;
1991
- u === 1 ? r?.zoom.exit() : r?.zoom.scaleAt(u, {
1992
- constrain: "within-viewport"
1993
- });
1994
- }
1995
- }
1996
- )
2218
+ value: [r],
2219
+ min: He,
2220
+ max: n,
2221
+ step: Le,
2222
+ minWidth: 200,
2223
+ onValueChange: (a) => {
2224
+ const l = a.value?.[0] ?? 1;
2225
+ l === 1 ? t?.zoom.exit() : t?.zoom.scaleAt(l, {
2226
+ constrain: "within-viewport"
2227
+ });
2228
+ }
1997
2229
  }
1998
- );
1999
- }), mo = { _open: "fade-in", _closed: "fade-out" }, bo = g(() => (mt(), null)), So = g(() => (po(), Nt(), Vt(), to(), bt(), /* @__PURE__ */ s(de, { children: [
2000
- /* @__PURE__ */ e(Tt, {}),
2001
- /* @__PURE__ */ e(bo, {})
2002
- ] }))), Co = g(
2230
+ ) });
2231
+ }), Po = { _open: "fade-in", _closed: "fade-out" }, Ao = p(() => (yt(), null)), Eo = p(() => (Mo(), no(), to(), So(), Pt(), At(), /* @__PURE__ */ s(ge, { children: [
2232
+ /* @__PURE__ */ e(Nt, {}),
2233
+ /* @__PURE__ */ e(Ao, {})
2234
+ ] }))), Bo = p(
2003
2235
  ({
2004
2236
  children: n,
2005
2237
  ...t
2006
2238
  }) => {
2007
- const { enableFloatingTime: o, onItemClick: r } = y([
2239
+ const { enableFloatingTime: o, onItemClick: i } = M([
2008
2240
  "enableFloatingTime",
2009
2241
  "onItemClick"
2010
- ]), [i, a] = w(!1), [l, c] = w(!1), [d, u] = w(!1), [p, h] = w(void 0), [C, v] = w(!1), [R, D] = Me(), x = T(() => {
2011
- a(!1), c(!1), u(!1), h(void 0), D(!1), v(!1);
2012
- }, [D]), L = T(
2013
- (I) => {
2014
- I === "annotations" ? h("annotations") : I === "search" ? u(!0) : I === "help" ? c(!0) : I === "toc" ? a(!0) : I === "bookmarks" ? h("bookmarks") : I === "gallery" && v(!0), r?.(I);
2242
+ ]), [r, a] = y(!1), [l, c] = y(!1), [u, d] = y(!1), [g, h] = y(void 0), [m, b] = y(!1), [w, I] = De(), k = P(() => {
2243
+ a(!1), c(!1), d(!1), h(void 0), I(!1), b(!1);
2244
+ }, [I]), S = P(
2245
+ (O) => {
2246
+ O === "annotations" ? h("annotations") : O === "search" ? d(!0) : O === "help" ? c(!0) : O === "toc" ? a(!0) : O === "bookmarks" ? h("bookmarks") : O === "gallery" && b(!0), i?.(O);
2015
2247
  },
2016
- [r]
2248
+ [i]
2017
2249
  );
2018
- return /* @__PURE__ */ s(de, { children: [
2019
- /* @__PURE__ */ e(So, {}),
2250
+ return /* @__PURE__ */ s(ge, { children: [
2251
+ /* @__PURE__ */ e(Eo, {}),
2020
2252
  /* @__PURE__ */ s(
2021
- _,
2253
+ L,
2022
2254
  {
2023
2255
  position: "absolute",
2024
2256
  top: 0,
@@ -2030,67 +2262,69 @@ const qt = le.Root, jt = le.ValueText, ze = () => {
2030
2262
  ...t,
2031
2263
  children: [
2032
2264
  n,
2033
- /* @__PURE__ */ e(_t, {}),
2034
- /* @__PURE__ */ e(Pt, { open: C, setOpen: v }),
2035
- /* @__PURE__ */ e(ro, {}),
2036
- /* @__PURE__ */ e(no, { onItemClick: L }),
2037
- /* @__PURE__ */ e(fo, {}),
2038
- /* @__PURE__ */ e(Rt, {}),
2039
- /* @__PURE__ */ e(ft, {}),
2040
- /* @__PURE__ */ e(Bt, { open: l, setOpen: c }),
2265
+ /* @__PURE__ */ e(Xt, {}),
2266
+ /* @__PURE__ */ e(Ut, { open: m, setOpen: b }),
2267
+ /* @__PURE__ */ e(vo, {}),
2268
+ /* @__PURE__ */ e(bo, { onItemClick: S }),
2269
+ /* @__PURE__ */ e(yo, {}),
2270
+ /* @__PURE__ */ e(dt, {}),
2271
+ /* @__PURE__ */ e(bt, {}),
2272
+ /* @__PURE__ */ e(Ht, {}),
2273
+ /* @__PURE__ */ e(wt, {}),
2274
+ /* @__PURE__ */ e(Yt, { open: l, setOpen: c }),
2041
2275
  /* @__PURE__ */ e(
2042
- ho,
2276
+ zo,
2043
2277
  {
2044
- open: i,
2278
+ open: r,
2045
2279
  setOpen: a,
2046
- onNavigate: x
2280
+ onNavigate: k
2047
2281
  }
2048
2282
  ),
2049
2283
  /* @__PURE__ */ e(
2050
- co,
2284
+ To,
2051
2285
  {
2052
- open: d,
2053
- setOpen: u,
2054
- onNavigate: x
2286
+ open: u,
2287
+ setOpen: d,
2288
+ onNavigate: k
2055
2289
  }
2056
2290
  ),
2057
2291
  /* @__PURE__ */ e(
2058
- dt,
2292
+ Ot,
2059
2293
  {
2060
- openWith: p,
2061
- setOpen: (I) => h(I ? "annotations" : void 0),
2062
- onNavigate: x
2294
+ openWith: g,
2295
+ setOpen: (O) => h(O ? "annotations" : void 0),
2296
+ onNavigate: k
2063
2297
  }
2064
2298
  ),
2065
2299
  /* @__PURE__ */ e(
2066
- ue,
2300
+ pe,
2067
2301
  {
2068
- present: o || R,
2069
- animationName: mo,
2302
+ present: o || w,
2303
+ animationName: Po,
2070
2304
  animationDuration: "slow",
2071
2305
  overflow: "hidden",
2072
- children: /* @__PURE__ */ e($t, {})
2306
+ children: /* @__PURE__ */ e(eo, {})
2073
2307
  }
2074
2308
  ),
2075
- /* @__PURE__ */ e(St, {})
2309
+ /* @__PURE__ */ e(Et, {})
2076
2310
  ]
2077
2311
  }
2078
2312
  )
2079
2313
  ] });
2080
2314
  }
2081
- ), $o = g(
2315
+ ), ni = p(
2082
2316
  ({
2083
2317
  children: n,
2084
2318
  slots: t,
2085
2319
  ...o
2086
2320
  }) => {
2087
- const { container: { props: r = {} } = {} } = t ?? {};
2088
- return /* @__PURE__ */ e(vt, { ...o, children: /* @__PURE__ */ e(Co, { ...r, children: n }) });
2321
+ const { container: { props: i = {} } = {} } = t ?? {};
2322
+ return /* @__PURE__ */ e(Dt, { ...o, children: /* @__PURE__ */ e(Bo, { ...i, children: n }) });
2089
2323
  }
2090
2324
  );
2091
2325
  export {
2092
- tt as BOOKMARK_AREA_DATA_ATTRIBUTE,
2093
- He as MAX_ZOOM_SCALE,
2094
- $o as ReactReader
2326
+ st as BOOKMARK_AREA_DATA_ATTRIBUTE,
2327
+ Ye as MAX_ZOOM_SCALE,
2328
+ ni as ReactReader
2095
2329
  };
2096
2330
  //# sourceMappingURL=index.js.map