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