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