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