@prose-reader/core 1.214.0 → 1.216.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,32 +1,32 @@
1
- import { switchMap as v, of as w, fromEvent as G, take as pe, map as b, from as W, takeUntil as F, Observable as st, defer as Nt, Subject as U, combineLatest as q, merge as x, EMPTY as K, withLatestFrom as D, NEVER as gt, tap as T, share as V, BehaviorSubject as k, filter as R, first as H, mergeMap as $t, endWith as pt, finalize as ut, catchError as he, lastValueFrom as qe, scheduled as Ye, animationFrameScheduler as at, shareReplay as et, distinctUntilChanged as E, throttleTime as Ze, debounceTime as St, startWith as nt, switchScan as Ge, forkJoin as Je, delay as wt, ReplaySubject as Gt, skip as me, identity as Pt, exhaustMap as Vt, timer as Jt, reduce as Ke, concatMap as Kt } from "rxjs";
2
- import { Report as Qe, isShallowEqual as N, shallowMergeIfDefined as vt, getParentPath as ti, parseContentType as ei, detectMimeTypeFromName as Lt, arrayEqual as ii } from "@prose-reader/shared";
1
+ import { switchMap as v, of as w, fromEvent as G, take as me, map as b, from as W, takeUntil as F, Observable as st, defer as Nt, Subject as U, combineLatest as q, merge as x, EMPTY as K, withLatestFrom as D, NEVER as gt, tap as T, share as V, BehaviorSubject as k, filter as R, first as H, mergeMap as $t, endWith as pt, finalize as ut, catchError as fe, lastValueFrom as Ye, scheduled as Ze, animationFrameScheduler as at, shareReplay as et, distinctUntilChanged as E, throttleTime as Ge, debounceTime as St, startWith as nt, switchScan as Je, forkJoin as Ke, delay as wt, ReplaySubject as Jt, skip as ye, identity as Pt, exhaustMap as Vt, timer as Kt, reduce as Qe, concatMap as Qt } from "rxjs";
2
+ import { Report as ti, isShallowEqual as N, shallowMergeIfDefined as vt, getParentPath as ei, parseContentType as ii, detectMimeTypeFromName as Lt, arrayEqual as ni } from "@prose-reader/shared";
3
3
  import { isShallowEqual as Ts } from "@prose-reader/shared";
4
- import { switchMap as _, first as fe, map as X, distinctUntilChanged as Z, startWith as ye, shareReplay as Mt, tap as z, pairwise as ni, take as oi, takeUntil as J, filter as tt, debounceTime as si, skip as ri, mergeMap as ai, catchError as Qt, withLatestFrom as ci } from "rxjs/operators";
5
- import { serialize as ui, generate as di, parse as Se, resolveExtensions as gi, isParsedCfiRange as li, resolve as pi } from "@prose-reader/cfi";
6
- const te = (e, t) => {
4
+ import { switchMap as _, first as Se, map as X, distinctUntilChanged as Z, startWith as be, shareReplay as Mt, tap as z, pairwise as oi, take as si, takeUntil as J, filter as tt, debounceTime as ri, skip as ai, mergeMap as ci, catchError as te, withLatestFrom as ui } from "rxjs/operators";
5
+ import { generate as Ie, parse as we, isParsedCfiRange as di, isIndirectionOnly as gi, resolve as li } from "@prose-reader/cfi";
6
+ const ee = (e, t) => {
7
7
  const i = new RegExp(`${t}\\s*=\\s*([0-9.]+)`, "i"), n = e.match(i) || [], o = n[1] || "0";
8
8
  return n && Number.parseFloat(o) || 0;
9
- }, hi = (e, t, i, n) => {
9
+ }, pi = (e, t, i, n) => {
10
10
  var o;
11
11
  if ((o = e == null ? void 0 : e.contentDocument) != null && o.head) {
12
12
  const s = e.contentDocument.createElement("style");
13
13
  s.id = t, s.innerHTML = i, n ? e.contentDocument.head.prepend(s) : e.contentDocument.head.appendChild(s);
14
14
  }
15
- }, mi = (e, t) => {
15
+ }, hi = (e, t) => {
16
16
  var i;
17
17
  if ((i = e == null ? void 0 : e.contentDocument) != null && i.head) {
18
18
  const n = e.contentDocument.getElementById(t);
19
19
  n && n.remove();
20
20
  }
21
21
  }, ot = (e, t, i, n) => {
22
- e && (mi(e, t), hi(e, t, i, n));
22
+ e && (hi(e, t), pi(e, t, i, n));
23
23
  }, Bt = (e) => {
24
24
  if (e != null && e.contentDocument) {
25
25
  const i = e.contentDocument.querySelector("meta[name='viewport']");
26
26
  if (i) {
27
27
  const n = i.getAttribute("content");
28
28
  if (n) {
29
- const o = te(n, "width"), s = te(n, "height");
29
+ const o = ee(n, "width"), s = ee(n, "height");
30
30
  return o > 0 && s > 0 ? {
31
31
  hasViewport: !0,
32
32
  width: o,
@@ -36,15 +36,15 @@ const te = (e, t) => {
36
36
  }
37
37
  }
38
38
  return { hasViewport: !1 };
39
- }, fi = (e) => e.pipe(
39
+ }, mi = (e) => e.pipe(
40
40
  v((t) => {
41
41
  var i;
42
42
  return t.src === "about:blank" && ((i = t.contentDocument) == null ? void 0 : i.readyState) === "complete" && t.contentDocument.body ? w(t) : G(t, "load").pipe(
43
- pe(1),
43
+ me(1),
44
44
  b(() => t)
45
45
  );
46
46
  })
47
- ), yi = (e) => e.pipe(
47
+ ), fi = (e) => e.pipe(
48
48
  v(
49
49
  (t) => {
50
50
  var i;
@@ -53,7 +53,7 @@ const te = (e, t) => {
53
53
  );
54
54
  }
55
55
  )
56
- ), Si = (e) => (t) => {
56
+ ), yi = (e) => (t) => {
57
57
  const i = e(t), n = new IntersectionObserver((o) => {
58
58
  o.forEach((s) => {
59
59
  s.isIntersecting ? s.target.removeAttribute("tab-index") : s.target.setAttribute("tab-index", "-1");
@@ -89,7 +89,7 @@ const te = (e, t) => {
89
89
  ), {
90
90
  ...i
91
91
  };
92
- }, bi = (e) => (t) => {
92
+ }, Si = (e) => (t) => {
93
93
  const i = e(t);
94
94
  return i.context.state$.pipe(F(i.$.destroy$)).subscribe(({ containerElement: n }) => {
95
95
  if (!n) return;
@@ -102,7 +102,7 @@ const te = (e, t) => {
102
102
  const o = i.spineItemsManager.get(n), s = o == null ? void 0 : o.renderer.getDocumentFrame();
103
103
  s && ((r = s.contentDocument) == null || r.body.setAttribute("tabindex", "-1"));
104
104
  }), i;
105
- }, Ii = "@prose-reader/core", j = Qe.namespace(Ii), wi = [
105
+ }, bi = "@prose-reader/core", j = ti.namespace(bi), Ii = [
106
106
  "pointercancel",
107
107
  "pointerdown",
108
108
  "pointerenter",
@@ -113,25 +113,25 @@ const te = (e, t) => {
113
113
  "pointerup"
114
114
  // `touchstart` as const,
115
115
  // `touchend` as const,
116
- ], be = (e) => typeof e == "object" && !!e && "nodeType" in e && (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE;
117
- function Pi(e, t, i) {
116
+ ], Pe = (e) => typeof e == "object" && !!e && "nodeType" in e && (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE;
117
+ function wi(e, t, i) {
118
118
  if ("caretPositionFromPoint" in e)
119
119
  return e.caretPositionFromPoint(t, i);
120
120
  if ("caretRangeFromPoint" in e && // @ts-expect-error limited availability
121
121
  typeof e.caretRangeFromPoint < "u")
122
122
  return e.caretRangeFromPoint(t, i);
123
123
  }
124
- const vi = (e, t) => {
124
+ const Pi = (e, t) => {
125
125
  const i = "body" in e ? jt(e.body, t) : jt(e, t), n = "createRange" in e ? e : e.ownerDocument;
126
126
  if (i) {
127
127
  let o, s = 0;
128
128
  const r = n.createRange();
129
129
  return Array.from(i.childNodes).some((a) => {
130
130
  r.selectNodeContents(a);
131
- const c = r.getClientRects(), u = xi(c, t);
131
+ const c = r.getClientRects(), u = vi(c, t);
132
132
  if (u) {
133
133
  o = r.cloneRange();
134
- const d = Pi(
134
+ const d = wi(
135
135
  n,
136
136
  Math.ceil(u.left),
137
137
  Math.ceil(u.top)
@@ -143,7 +143,7 @@ const vi = (e, t) => {
143
143
  }
144
144
  }, jt = (e, t) => {
145
145
  let i;
146
- const n = Ie(
146
+ const n = ve(
147
147
  e.getBoundingClientRect(),
148
148
  t
149
149
  );
@@ -152,16 +152,16 @@ const vi = (e, t) => {
152
152
  return s ? (i = s, !0) : !1;
153
153
  }), i;
154
154
  };
155
- function Ie(e, { left: t, right: i }) {
155
+ function ve(e, { left: t, right: i }) {
156
156
  return e.left <= t && e.right <= t ? "before" : e.left <= t && e.right > t && e.right <= i ? "partially-before" : e.left <= i && e.right > i ? "partially-after" : e.left > i ? "after" : "within";
157
157
  }
158
- function xi(e, t) {
158
+ function vi(e, t) {
159
159
  return Array.from(e).find((i) => {
160
- const n = Ie(i, t);
160
+ const n = ve(i, t);
161
161
  return n !== "before" && n !== "after";
162
162
  });
163
163
  }
164
- const $i = (e, t) => {
164
+ const xi = (e, t) => {
165
165
  var i;
166
166
  if (e.nodeType !== Node.CDATA_SECTION_NODE && e.nodeType !== Node.DOCUMENT_TYPE_NODE) {
167
167
  const n = (i = e.ownerDocument) == null ? void 0 : i.createRange();
@@ -185,8 +185,8 @@ const $i = (e, t) => {
185
185
  if (r.PointerEvent && e instanceof r.PointerEvent)
186
186
  return !0;
187
187
  }
188
- return !!wi.includes(e.type);
189
- }, Ti = (e) => {
188
+ return !!Ii.includes(e.type);
189
+ }, $i = (e) => {
190
190
  var t, i, n, o, s;
191
191
  if (_t(e)) return !1;
192
192
  if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
@@ -200,7 +200,7 @@ const $i = (e, t) => {
200
200
  return e instanceof r.MouseEvent;
201
201
  }
202
202
  return !1;
203
- }, Fi = (e) => {
203
+ }, Ti = (e) => {
204
204
  var t, i, n, o, s;
205
205
  if (e != null && e.target && ((i = (t = e == null ? void 0 : e.target) == null ? void 0 : t.ownerDocument) != null && i.defaultView)) {
206
206
  const r = (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.ownerDocument) == null ? void 0 : o.defaultView;
@@ -213,7 +213,7 @@ const $i = (e, t) => {
213
213
  return e instanceof r.TouchEvent;
214
214
  }
215
215
  return !1;
216
- }, Li = () => document.createElement("div"), we = (e) => {
216
+ }, Fi = () => document.createElement("div"), xe = (e) => {
217
217
  const t = [
218
218
  "img",
219
219
  // Images
@@ -229,8 +229,8 @@ const $i = (e, t) => {
229
229
  // JavaScript files
230
230
  ].join(",");
231
231
  return Array.from((e == null ? void 0 : e.querySelectorAll(t)) || []);
232
- }, Mi = (e) => {
233
- if (we(e).forEach((i) => {
232
+ }, Li = (e) => {
233
+ if (xe(e).forEach((i) => {
234
234
  var o;
235
235
  const n = i.getAttribute("src") || i.getAttribute("href");
236
236
  n != null && n.startsWith("blob:") && ((o = e == null ? void 0 : e.defaultView) == null || o.URL.revokeObjectURL(n));
@@ -249,8 +249,8 @@ const $i = (e, t) => {
249
249
  }
250
250
  }
251
251
  };
252
- function Ci(e, t) {
253
- return be(e) && e.tagName.toLowerCase() === t.toLowerCase();
252
+ function Mi(e, t) {
253
+ return Pe(e) && e.tagName.toLowerCase() === t.toLowerCase();
254
254
  }
255
255
  const Rt = ({
256
256
  position: e,
@@ -261,7 +261,7 @@ const Rt = ({
261
261
  clientX: a,
262
262
  clientY: c
263
263
  };
264
- }, Ri = (e, t, i, n) => {
264
+ }, Ci = (e, t, i, n) => {
265
265
  var u;
266
266
  const o = (u = t == null ? void 0 : t.view) == null ? void 0 : u.frameElement;
267
267
  if (!t || !o) return e;
@@ -282,7 +282,7 @@ const Rt = ({
282
282
  enumerable: !0
283
283
  }), l;
284
284
  }
285
- if (Ti(e)) {
285
+ if ($i(e)) {
286
286
  const { clientX: d, clientY: g } = Rt({
287
287
  position: e,
288
288
  frameElement: r
@@ -296,7 +296,7 @@ const Rt = ({
296
296
  enumerable: !0
297
297
  }), l;
298
298
  }
299
- if (Fi(e)) {
299
+ if (Ti(e)) {
300
300
  const d = Array.from(e.touches).map((l) => {
301
301
  const { clientX: p, clientY: h } = Rt({
302
302
  position: l,
@@ -319,7 +319,7 @@ const Rt = ({
319
319
  }), g;
320
320
  }
321
321
  return e;
322
- }, Ai = [
322
+ }, Ri = [
323
323
  "pointercancel",
324
324
  "pointerdown",
325
325
  "pointerenter",
@@ -328,23 +328,23 @@ const Rt = ({
328
328
  "pointerout",
329
329
  "pointerover",
330
330
  "pointerup"
331
- ], Oi = [
332
- ...Ai
331
+ ], Ai = [
332
+ ...Ri
333
333
  /*, ...mouseEvents*/
334
- ], Di = (e) => (t) => {
334
+ ], Oi = (e) => (t) => {
335
335
  const i = e(t);
336
336
  return i.hookManager.register(
337
337
  "item.onDocumentLoad",
338
338
  ({ destroy: n, itemId: o }) => {
339
339
  const s = i.spineItemsManager.get(o), r = s == null ? void 0 : s.renderer.getDocumentFrame();
340
340
  if (!r || !s) return;
341
- const a = Oi.map((c) => {
341
+ const a = Ai.map((c) => {
342
342
  var d;
343
343
  const u = (g) => {
344
344
  var p;
345
345
  let l = g;
346
346
  if (_t(g) && (l = new PointerEvent(g.type, g)), l !== g) {
347
- const h = Ri(
347
+ const h = Ci(
348
348
  l,
349
349
  g,
350
350
  i.spine.locator,
@@ -365,14 +365,14 @@ const Rt = ({
365
365
  });
366
366
  }
367
367
  ), i;
368
- }, Pe = (e) => X((t) => Object.entries(t).reduce(
368
+ }, $e = (e) => X((t) => Object.entries(t).reduce(
369
369
  (i, [n, o]) => e.includes(n) ? {
370
370
  ...i,
371
371
  [n]: o
372
372
  } : i,
373
373
  {}
374
- )), Xt = (e) => (t) => t.pipe(Pe(e), Z(N));
375
- function ve(e) {
374
+ )), Xt = (e) => (t) => t.pipe($e(e), Z(N));
375
+ function Te(e) {
376
376
  return new st((t) => {
377
377
  const i = new ResizeObserver((n) => {
378
378
  t.next(n);
@@ -385,18 +385,18 @@ function ve(e) {
385
385
  const Ct = (e) => (t) => t.pipe(
386
386
  _(
387
387
  (i) => e.pipe(
388
- fe(),
388
+ Se(),
389
389
  X(() => i)
390
390
  )
391
391
  )
392
- ), Ni = (e) => {
392
+ ), Di = (e) => {
393
393
  let t;
394
394
  const i = e.subscribe((n) => {
395
395
  t = { result: n };
396
396
  });
397
397
  return () => (i.unsubscribe(), t ? w(t.result) : e);
398
398
  };
399
- function xe() {
399
+ function Fe() {
400
400
  return new st((e) => {
401
401
  if (window.requestIdleCallback) {
402
402
  const i = window.requestIdleCallback(() => {
@@ -410,10 +410,10 @@ function xe() {
410
410
  return () => clearTimeout(t);
411
411
  });
412
412
  }
413
- function ee(e) {
414
- return Nt(() => xe().pipe(_(e)));
413
+ function ie(e) {
414
+ return Nt(() => Fe().pipe(_(e)));
415
415
  }
416
- const ie = (e, t) => new st((i) => {
416
+ const ne = (e, t) => new st((i) => {
417
417
  const n = new MutationObserver((o) => {
418
418
  i.next(o);
419
419
  });
@@ -429,7 +429,7 @@ function Is(e, t) {
429
429
  };
430
430
  });
431
431
  }
432
- class $e {
432
+ class Le {
433
433
  constructor(t, i) {
434
434
  this.settingsManager = i;
435
435
  const n = vt(
@@ -441,7 +441,7 @@ class $e {
441
441
  t
442
442
  ), this.outputSettingsUpdateSubject = new U(), this.values$ = q([
443
443
  this.settingsManager.values$,
444
- this.outputSettingsUpdateSubject.pipe(ye(this.outputSettings))
444
+ this.outputSettingsUpdateSubject.pipe(be(this.outputSettings))
445
445
  ]).pipe(
446
446
  X(([o, s]) => ({ ...o, ...s })),
447
447
  Mt(1)
@@ -477,7 +477,7 @@ class $e {
477
477
  this.outputSettingsUpdateSubject.complete();
478
478
  }
479
479
  }
480
- const Vi = (e) => {
480
+ const Ni = (e) => {
481
481
  const t = new FileReader();
482
482
  return new Promise((i) => {
483
483
  t.addEventListener(
@@ -489,7 +489,7 @@ const Vi = (e) => {
489
489
  ), t.readAsDataURL(e);
490
490
  });
491
491
  };
492
- let ji = class extends $e {
492
+ let Vi = class extends Le {
493
493
  computeOutputSettings(t) {
494
494
  return t;
495
495
  }
@@ -509,8 +509,8 @@ let ji = class extends $e {
509
509
  };
510
510
  }
511
511
  };
512
- const ki = (e) => (t) => {
513
- const { fontScale: i, lineHeight: n, fontWeight: o, fontJustification: s } = t, r = new U(), a = e(t), c = new ji(
512
+ const ji = (e) => (t) => {
513
+ const { fontScale: i, lineHeight: n, fontWeight: o, fontJustification: s } = t, r = new U(), a = e(t), c = new Vi(
514
514
  {
515
515
  fontScale: i,
516
516
  lineHeight: n,
@@ -542,7 +542,7 @@ const ki = (e) => (t) => {
542
542
  }
543
543
  });
544
544
  const g = (l) => l.pipe(
545
- ni(),
545
+ oi(),
546
546
  b(([p, h]) => h.fontScale !== p.fontScale || h.lineHeight !== p.lineHeight)
547
547
  );
548
548
  return c.values$.pipe(
@@ -556,7 +556,7 @@ const ki = (e) => (t) => {
556
556
  },
557
557
  settings: c
558
558
  };
559
- }, Wi = (e) => (t) => {
559
+ }, ki = (e) => (t) => {
560
560
  const i = e(t), n = (o) => G(o, "keyup").pipe(
561
561
  D(i.settings.values$),
562
562
  b(([s, { pageTurnDirection: r }]) => {
@@ -590,7 +590,7 @@ const ki = (e) => (t) => {
590
590
  ),
591
591
  F(i.$.destroy$)
592
592
  ).subscribe(), i;
593
- }, zi = (e) => e.spine.spineItemsManager.items$.pipe(
593
+ }, Wi = (e) => e.spine.spineItemsManager.items$.pipe(
594
594
  v(
595
595
  (t) => x(
596
596
  ...t.map((i) => i.loaded$.pipe(
@@ -730,7 +730,7 @@ const Ft = class Ft extends Y {
730
730
  ut(() => {
731
731
  t.complete();
732
732
  }),
733
- he((i) => (j.error(i), w(void 0)))
733
+ fe((i) => (j.error(i), w(void 0)))
734
734
  );
735
735
  }
736
736
  layout(t) {
@@ -760,26 +760,26 @@ const Ft = class Ft extends Y {
760
760
  };
761
761
  Ft.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
762
762
  let ht = Ft;
763
- const Ui = (e) => new URL(e.href);
763
+ const zi = (e) => new URL(e.href);
764
764
  class qt {
765
765
  constructor(t, i) {
766
766
  this.item = t, this.settings = i;
767
767
  }
768
768
  async getResource() {
769
769
  var i, n;
770
- return await qe(
770
+ return await Ye(
771
771
  ((n = (i = this.settings.values).getResource) == null ? void 0 : n.call(i, this.item)) ?? w(void 0)
772
- ) ?? Ui(this.item);
772
+ ) ?? zi(this.item);
773
773
  }
774
774
  async fetchResource() {
775
775
  const t = await this.getResource();
776
776
  return t instanceof Response ? t : t instanceof URL ? fetch(t) : t;
777
777
  }
778
778
  }
779
- const Te = (e, t) => {
779
+ const Me = (e, t) => {
780
780
  const i = e.startsWith("file://"), n = i ? e.replace("file://", "http://") : e, o = new URL(t, n).toString();
781
781
  return i ? o.replace("http://", "file://") : o;
782
- }, Hi = async (e, t, i, n, o) => {
782
+ }, Ui = async (e, t, i, n, o) => {
783
783
  if (!e || !e.defaultView) return;
784
784
  const s = t.sheet;
785
785
  if (s)
@@ -797,7 +797,7 @@ const Te = (e, t) => {
797
797
  return h;
798
798
  const m = h.match(/url\(['"]?([^'"]+)['"]?\)/);
799
799
  if (!m) return h;
800
- const S = m[1] ?? "", f = (y = n.manifest) == null ? void 0 : y.items.find(({ href: P }) => `${Te(i, S).toLowerCase()}`.endsWith(
800
+ const S = m[1] ?? "", f = (y = n.manifest) == null ? void 0 : y.items.find(({ href: P }) => `${Me(i, S).toLowerCase()}`.endsWith(
801
801
  `${P.toLowerCase()}`
802
802
  ));
803
803
  if (f) {
@@ -828,11 +828,11 @@ const Te = (e, t) => {
828
828
  } catch (r) {
829
829
  console.error("Could not access stylesheet rules:", r);
830
830
  }
831
- }, Ei = (e, t, i, n, o) => {
831
+ }, Hi = (e, t, i, n, o) => {
832
832
  var c;
833
833
  const s = t.getAttribute("src") || t.getAttribute("href");
834
834
  if (!s) return w(null);
835
- const r = (c = n.manifest) == null ? void 0 : c.items.find(({ href: u }) => `${Te(i, s).toLowerCase()}`.endsWith(
835
+ const r = (c = n.manifest) == null ? void 0 : c.items.find(({ href: u }) => `${Me(i, s).toLowerCase()}`.endsWith(
836
836
  `${u.toLowerCase()}`
837
837
  ));
838
838
  if (!r) return w(null);
@@ -852,7 +852,7 @@ const Te = (e, t) => {
852
852
  return new st((l) => {
853
853
  t.onload = async () => {
854
854
  try {
855
- t.sheet && await Hi(
855
+ t.sheet && await Ui(
856
856
  e,
857
857
  t,
858
858
  i,
@@ -867,16 +867,16 @@ const Te = (e, t) => {
867
867
  return w(null);
868
868
  })
869
869
  );
870
- }, Bi = ({
870
+ }, Ei = ({
871
871
  settings: e,
872
872
  item: t,
873
873
  context: i
874
874
  }) => (n) => n.pipe(
875
875
  v((o) => {
876
- const s = we(
876
+ const s = xe(
877
877
  o.contentDocument
878
- ), r = ti(t.href), a = s.map(
879
- (c) => Ei(
878
+ ), r = ei(t.href), a = s.map(
879
+ (c) => Hi(
880
880
  o.contentDocument,
881
881
  c,
882
882
  r,
@@ -886,20 +886,20 @@ const Te = (e, t) => {
886
886
  );
887
887
  return q(a).pipe(b(() => o));
888
888
  })
889
- ), _i = (e) => {
890
- Mi(e == null ? void 0 : e.contentDocument);
891
- }, Xi = [".xhtml", ".html", ".htm"], lt = "prose-reader", qi = (e) => new Promise((t, i) => {
889
+ ), Bi = (e) => {
890
+ Li(e == null ? void 0 : e.contentDocument);
891
+ }, _i = [".xhtml", ".html", ".htm"], lt = "prose-reader", Xi = (e) => new Promise((t, i) => {
892
892
  const n = new Image();
893
893
  n.src = e, n.onload = () => {
894
894
  t({ height: n.naturalHeight, width: n.naturalWidth });
895
895
  }, n.onerror = i;
896
- }), Yi = async (e, t) => {
896
+ }), qi = async (e, t) => {
897
897
  if (typeof e == "string") return e;
898
- const i = ei(e.headers.get("Content-Type") || "") || Lt(t.href);
898
+ const i = ii(e.headers.get("Content-Type") || "") || Lt(t.href);
899
899
  if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
900
900
  (o) => o === i
901
901
  )) {
902
- const o = await Vi(await e.blob()), { height: s, width: r } = await qi(o);
902
+ const o = await Ni(await e.blob()), { height: s, width: r } = await Xi(o);
903
903
  return `
904
904
  <html>
905
905
  <head>
@@ -931,11 +931,11 @@ const Te = (e, t) => {
931
931
  </body>
932
932
  </html>
933
933
  ` : await e.text();
934
- }, Zi = ({
934
+ }, Yi = ({
935
935
  item: e,
936
936
  resourcesHandler: t
937
937
  }) => {
938
- const i = (n) => Yi(n, e);
938
+ const i = (n) => qi(n, e);
939
939
  return (n) => n.pipe(
940
940
  v((o) => W(t.getResource()).pipe(
941
941
  v((s) => s instanceof URL && e.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
@@ -945,7 +945,7 @@ const Te = (e, t) => {
945
945
  "text/html",
946
946
  "text/xml"
947
947
  ].includes(e.mediaType) || // no encoding ? then try to detect html
948
- !e.mediaType && Xi.some(
948
+ !e.mediaType && _i.some(
949
949
  (a) => e.href.endsWith(a)
950
950
  )) ? (o == null || o.setAttribute("src", e.href), w(o)) : (s instanceof URL ? W(t.fetchResource()) : s instanceof Response ? w(s) : K).pipe(
951
951
  R((a) => a instanceof Response),
@@ -957,13 +957,13 @@ const Te = (e, t) => {
957
957
  }
958
958
  }),
959
959
  b(() => o),
960
- he((a) => (j.error(
960
+ fe((a) => (j.error(
961
961
  `Error while trying to fetch or load resource for item ${e.id}`
962
962
  ), j.error(a), w(o)))
963
963
  ))
964
964
  ))
965
965
  );
966
- }, Gi = () => {
966
+ }, Zi = () => {
967
967
  const e = document.createElement("iframe");
968
968
  return e.frameBorder = "no", e.tabIndex = 0, e.setAttribute(
969
969
  "sandbox",
@@ -978,12 +978,12 @@ const Te = (e, t) => {
978
978
  border: 0px none transparent;
979
979
  padding: 0px;
980
980
  `, e.setAttribute("role", "main"), e;
981
- }, Fe = () => `
981
+ }, Ce = () => `
982
982
  body {
983
983
  margin: 0;
984
984
  }
985
985
  }
986
- `, Le = ({
986
+ `, Re = ({
987
987
  pageHeight: e,
988
988
  pageWidth: t,
989
989
  frameElement: i
@@ -996,12 +996,12 @@ const Te = (e, t) => {
996
996
  e / (n.height ?? 1)
997
997
  ), computedWidthScale: o, viewportDimensions: n };
998
998
  }
999
- }, Ji = ({
999
+ }, Gi = ({
1000
1000
  columnWidth: e,
1001
1001
  enableTouch: t,
1002
1002
  spreadPosition: i
1003
1003
  }, n) => `
1004
- ${Fe()}
1004
+ ${Ce()}
1005
1005
  body {
1006
1006
  ${n ? "" : `
1007
1007
  display: flex;
@@ -1041,12 +1041,12 @@ const Te = (e, t) => {
1041
1041
  object-fit:contain;
1042
1042
  `}
1043
1043
  }
1044
- `, Ki = ({
1044
+ `, Ji = ({
1045
1045
  pageHeight: e,
1046
1046
  pageWidth: t
1047
- }) => ({ columnHeight: e, columnWidth: t }), ne = (e, t) => {
1047
+ }) => ({ columnHeight: e, columnWidth: t }), oe = (e, t) => {
1048
1048
  e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
1049
- }, Qi = ({
1049
+ }, Ki = ({
1050
1050
  minPageSpread: e,
1051
1051
  blankPagePosition: t,
1052
1052
  spreadPosition: i,
@@ -1058,18 +1058,18 @@ const Te = (e, t) => {
1058
1058
  }) => {
1059
1059
  const c = e * o;
1060
1060
  if (s != null && s.contentDocument && (s != null && s.contentWindow)) {
1061
- const { viewportDimensions: u, computedScale: d = 1 } = Le({ frameElement: s, pageHeight: n, pageWidth: o }) ?? {}, g = o, l = n, p = Ji(
1061
+ const { viewportDimensions: u, computedScale: d = 1 } = Re({ frameElement: s, pageHeight: n, pageWidth: o }) ?? {}, g = o, l = n, p = Gi(
1062
1062
  {
1063
- ...Ki({ pageHeight: n, pageWidth: o }),
1063
+ ...Ji({ pageHeight: n, pageWidth: o }),
1064
1064
  enableTouch: a,
1065
1065
  spreadPosition: i
1066
1066
  },
1067
1067
  u
1068
1068
  );
1069
- if (ot(s, "prose-reader-css", p), u ? ne(s, {
1069
+ if (ot(s, "prose-reader-css", p), u ? oe(s, {
1070
1070
  width: u.width ?? 1,
1071
1071
  height: u.height ?? 1
1072
- }) : ne(s, {
1072
+ }) : oe(s, {
1073
1073
  width: g,
1074
1074
  height: l
1075
1075
  }), u) {
@@ -1090,8 +1090,8 @@ const Te = (e, t) => {
1090
1090
  return { width: c, height: l };
1091
1091
  }
1092
1092
  return { width: c, height: n };
1093
- }, tn = () => `
1094
- ${Fe()}
1093
+ }, Qi = () => `
1094
+ ${Ce()}
1095
1095
  html {
1096
1096
  width: 100%;
1097
1097
  height: 100%;
@@ -1105,7 +1105,7 @@ const Te = (e, t) => {
1105
1105
  html, body {
1106
1106
  touch-action: none;
1107
1107
  }
1108
- `, en = ({
1108
+ `, tn = ({
1109
1109
  isScrollable: e,
1110
1110
  enableTouch: t
1111
1111
  }) => `
@@ -1130,7 +1130,7 @@ const Te = (e, t) => {
1130
1130
  display: block;
1131
1131
  }
1132
1132
  ` : ""}
1133
- `, nn = ({
1133
+ `, en = ({
1134
1134
  width: e,
1135
1135
  columnHeight: t,
1136
1136
  columnWidth: i
@@ -1198,7 +1198,7 @@ const Te = (e, t) => {
1198
1198
  td {
1199
1199
  max-width: ${i}px;
1200
1200
  }
1201
- `, on = ({
1201
+ `, nn = ({
1202
1202
  isUsingVerticalWriting: e,
1203
1203
  minimumWidth: t,
1204
1204
  pageHeight: i,
@@ -1214,7 +1214,7 @@ const Te = (e, t) => {
1214
1214
  };
1215
1215
  }, It = (e, t) => {
1216
1216
  e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
1217
- }, sn = ({
1217
+ }, on = ({
1218
1218
  pageHeight: e,
1219
1219
  pageWidth: t,
1220
1220
  frameElement: i,
@@ -1231,7 +1231,7 @@ const Te = (e, t) => {
1231
1231
  let l = o;
1232
1232
  const p = (n == null ? void 0 : n.renditionLayout) === "reflowable" && (n == null ? void 0 : n.renditionFlow) === "scrolled-continuous", h = p ? Math.min(400, e) : e;
1233
1233
  i == null || i.style.setProperty("width", `${t}px`), p || i == null || i.style.setProperty("height", `${h}px`);
1234
- const { viewportDimensions: m, computedScale: S = 1 } = Le({
1234
+ const { viewportDimensions: m, computedScale: S = 1 } = Re({
1235
1235
  frameElement: i,
1236
1236
  pageHeight: h,
1237
1237
  pageWidth: t
@@ -1242,7 +1242,7 @@ const Te = (e, t) => {
1242
1242
  ot(
1243
1243
  i,
1244
1244
  "prose-reader-html-renderer-framce-css",
1245
- tn()
1245
+ Qi()
1246
1246
  ), It(i, {
1247
1247
  width: m.width ?? 1,
1248
1248
  height: m.height ?? 1
@@ -1254,11 +1254,11 @@ const Te = (e, t) => {
1254
1254
  `translate(-50%, -50%) scale(${S})`
1255
1255
  ), i == null || i.style.setProperty("transform-origin", "center center");
1256
1256
  else {
1257
- const L = c ? en({
1257
+ const L = c ? tn({
1258
1258
  isScrollable: (n == null ? void 0 : n.renditionFlow) === "scrolled-continuous",
1259
1259
  enableTouch: u
1260
- }) : nn(
1261
- on({
1260
+ }) : en(
1261
+ nn({
1262
1262
  isUsingVerticalWriting: d,
1263
1263
  minimumWidth: g,
1264
1264
  pageHeight: h,
@@ -1295,7 +1295,7 @@ const Te = (e, t) => {
1295
1295
  latestContentHeightWhenLoaded: l
1296
1296
  };
1297
1297
  };
1298
- class rn extends ht {
1298
+ class sn extends ht {
1299
1299
  constructor() {
1300
1300
  super(...arguments), this.isImageType = () => {
1301
1301
  const t = this.item.mediaType ?? Lt(this.item.href);
@@ -1303,14 +1303,14 @@ class rn extends ht {
1303
1303
  };
1304
1304
  }
1305
1305
  onCreateDocument() {
1306
- const t = Gi();
1306
+ const t = Zi();
1307
1307
  return this.setDocumentContainer(t), w(t);
1308
1308
  }
1309
1309
  onLoadDocument() {
1310
1310
  const t = this.getFrameElement();
1311
1311
  if (!t) throw new Error("invalid frame");
1312
1312
  return w(t).pipe(
1313
- Zi({
1313
+ Yi({
1314
1314
  item: this.item,
1315
1315
  resourcesHandler: this.resourcesHandler,
1316
1316
  settings: this.settings
@@ -1319,17 +1319,17 @@ class rn extends ht {
1319
1319
  T(() => {
1320
1320
  this.attach();
1321
1321
  }),
1322
- fi,
1323
- Bi({
1322
+ mi,
1323
+ Ei({
1324
1324
  context: this.context,
1325
1325
  item: this.item,
1326
1326
  settings: this.settings
1327
1327
  }),
1328
- yi
1328
+ fi
1329
1329
  );
1330
1330
  }
1331
1331
  onUnload() {
1332
- return _i(this.getFrameElement()), this.detach(), K;
1332
+ return Bi(this.getFrameElement()), this.detach(), K;
1333
1333
  }
1334
1334
  onLayout({
1335
1335
  minPageSpread: t,
@@ -1341,7 +1341,7 @@ class rn extends ht {
1341
1341
  if (!r) return w(void 0);
1342
1342
  const a = !!((d = this.writingMode) != null && d.startsWith("vertical"));
1343
1343
  if (this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && ((g = this.context.manifest) == null ? void 0 : g.renditionLayout) === "pre-paginated") {
1344
- const l = Qi({
1344
+ const l = Ki({
1345
1345
  blankPagePosition: i,
1346
1346
  enableTouch: this.settings.values.computedPageTurnMode !== "scrollable",
1347
1347
  frameElement: r,
@@ -1353,7 +1353,7 @@ class rn extends ht {
1353
1353
  });
1354
1354
  return w(l);
1355
1355
  }
1356
- const { latestContentHeightWhenLoaded: c, ...u } = sn({
1356
+ const { latestContentHeightWhenLoaded: c, ...u } = on({
1357
1357
  pageHeight: s,
1358
1358
  pageWidth: o,
1359
1359
  frameElement: r,
@@ -1425,14 +1425,14 @@ class rn extends ht {
1425
1425
  return this.getFrameElement();
1426
1426
  }
1427
1427
  }
1428
- const an = (e) => (t) => {
1428
+ const rn = (e) => (t) => {
1429
1429
  const i = e({
1430
1430
  ...t,
1431
1431
  getRenderer(o) {
1432
1432
  var r;
1433
- return ((r = t.getRenderer) == null ? void 0 : r.call(t, o)) ?? ((a) => new rn(a));
1433
+ return ((r = t.getRenderer) == null ? void 0 : r.call(t, o)) ?? ((a) => new sn(a));
1434
1434
  }
1435
- }), n = zi(i);
1435
+ }), n = Wi(i);
1436
1436
  return n.pipe(F(i.$.destroy$)).subscribe(), {
1437
1437
  ...i,
1438
1438
  links$: n
@@ -1441,7 +1441,7 @@ const an = (e) => (t) => {
1441
1441
  function ct(e) {
1442
1442
  return e != null;
1443
1443
  }
1444
- let cn = class extends $e {
1444
+ let an = class extends Le {
1445
1445
  computeOutputSettings(t) {
1446
1446
  return t;
1447
1447
  }
@@ -1469,7 +1469,7 @@ let cn = class extends $e {
1469
1469
  };
1470
1470
  }
1471
1471
  };
1472
- const un = (e) => {
1472
+ const cn = (e) => {
1473
1473
  let t;
1474
1474
  const i = e.context.state$.pipe(
1475
1475
  _(({ containerElement: c }) => c ? new st(() => (t = c.ownerDocument.createElement("div"), t.style.cssText = `
@@ -1482,7 +1482,7 @@ const un = (e) => {
1482
1482
  `, c.appendChild(t), () => {
1483
1483
  t == null || t.remove(), t = void 0;
1484
1484
  })) : gt)
1485
- ), n = (c) => Ye(c, at).pipe(
1485
+ ), n = (c) => Ze(c, at).pipe(
1486
1486
  z(() => {
1487
1487
  t == null || t.style.setProperty(
1488
1488
  "visibility",
@@ -1497,7 +1497,7 @@ const un = (e) => {
1497
1497
  );
1498
1498
  })
1499
1499
  ), s = n(e.viewportFree$).pipe(
1500
- oi(1)
1500
+ si(1)
1501
1501
  ), a = e.settings.values$.pipe(
1502
1502
  X(() => e.settings.values.computedPageTurnMode),
1503
1503
  Z()
@@ -1508,7 +1508,7 @@ const un = (e) => {
1508
1508
  J(e.$.destroy$)
1509
1509
  );
1510
1510
  return x(i, a);
1511
- }, dn = (e) => {
1511
+ }, un = (e) => {
1512
1512
  e.hookManager.register(
1513
1513
  "item.onAfterLayout",
1514
1514
  ({ item: t, blankPagePosition: i, minimumWidth: n }) => {
@@ -1526,17 +1526,17 @@ const un = (e) => {
1526
1526
  }
1527
1527
  );
1528
1528
  };
1529
- class Me {
1529
+ class Ae {
1530
1530
  constructor(t) {
1531
1531
  this.left = t.left, this.right = t.right, this.top = t.top, this.bottom = t.bottom, this.width = t.width, this.height = t.height, this.x = t.x, this.y = t.y;
1532
1532
  }
1533
1533
  }
1534
- class kt extends Me {
1534
+ class kt extends Ae {
1535
1535
  constructor() {
1536
1536
  super(...arguments), this.__symbol = "SpineItemSpineLayout";
1537
1537
  }
1538
1538
  }
1539
- class gn extends Me {
1539
+ class dn extends Ae {
1540
1540
  constructor() {
1541
1541
  super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
1542
1542
  }
@@ -1554,10 +1554,10 @@ class Yt {
1554
1554
  return new Yt(t);
1555
1555
  }
1556
1556
  }
1557
- const ln = ({
1557
+ const gn = ({
1558
1558
  position: e,
1559
1559
  pageSize: t
1560
- }) => new gn({
1560
+ }) => new dn({
1561
1561
  x: e.x,
1562
1562
  y: e.y,
1563
1563
  left: e.x,
@@ -1566,7 +1566,7 @@ const ln = ({
1566
1566
  height: t.height,
1567
1567
  bottom: e.y + t.height,
1568
1568
  right: e.x + t.width
1569
- }), pn = (e) => {
1569
+ }), ln = (e) => {
1570
1570
  const t = e.spine.spineLayout.layout$.pipe(
1571
1571
  b(() => ({
1572
1572
  pages: e.spine.spineItemsManager.items.reduce((s, r, a) => {
@@ -1578,7 +1578,7 @@ const ln = ({
1578
1578
  spineItem: r,
1579
1579
  spineItemPosition: p
1580
1580
  });
1581
- return ln({
1581
+ return gn({
1582
1582
  pageSize: e.context.getPageSize(),
1583
1583
  position: h
1584
1584
  });
@@ -1596,17 +1596,17 @@ const ln = ({
1596
1596
  V()
1597
1597
  ), i = t.pipe(et({ refCount: !0, bufferSize: 1 }));
1598
1598
  return i.pipe(F(e.$.destroy$)).subscribe(), { layout$: t, info$: i };
1599
- }, hn = (e, t) => t.pipe(
1599
+ }, pn = (e, t) => t.pipe(
1600
1600
  T((i) => {
1601
1601
  e.viewport.value.element.style.transition = "transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275)", e.settings.values.computedPageTurnMode === "scrollable" ? e.viewport.value.element.style.transformOrigin = "top" : e.viewport.value.element.style.transformOrigin = "center", i === "thumbnails" ? e.viewport.value.element.style.transform = "scale(0.5)" : e.viewport.value.element.style.transform = "scale(1)", e.layout();
1602
1602
  })
1603
- ), mn = (e) => (t) => {
1603
+ ), hn = (e) => (t) => {
1604
1604
  const {
1605
1605
  pageHorizontalMargin: i,
1606
1606
  pageVerticalMargin: n,
1607
1607
  layoutAutoResize: o,
1608
1608
  layoutLayerTransition: s
1609
- } = t, r = e(t), a = new cn(
1609
+ } = t, r = e(t), a = new an(
1610
1610
  {
1611
1611
  pageHorizontalMargin: i,
1612
1612
  pageVerticalMargin: n,
@@ -1653,7 +1653,7 @@ const ln = ({
1653
1653
  `
1654
1654
  );
1655
1655
  }
1656
- }), dn(r), r.hookManager.register(
1656
+ }), un(r), r.hookManager.register(
1657
1657
  "item.onDocumentCreated",
1658
1658
  ({ documentContainer: S }) => {
1659
1659
  S.style.opacity = "0", a.values.layoutLayerTransition && (S.style.transition = "opacity 300ms");
@@ -1680,13 +1680,13 @@ const ln = ({
1680
1680
  _(() => r.context.containerElement$),
1681
1681
  tt(ct),
1682
1682
  _((S) => u(S)),
1683
- si(100),
1683
+ ri(100),
1684
1684
  z(() => {
1685
1685
  r == null || r.layout();
1686
1686
  })
1687
- ), g = un(r);
1687
+ ), g = cn(r);
1688
1688
  a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
1689
- ri(1),
1689
+ ai(1),
1690
1690
  z(() => {
1691
1691
  r.layout();
1692
1692
  }),
@@ -1697,7 +1697,7 @@ const ln = ({
1697
1697
  const y = "prose-spineItem-ready";
1698
1698
  f ? S.containerElement.classList.add(y) : S.containerElement.classList.remove(y);
1699
1699
  })
1700
- ), { layout$: p, info$: h } = pn(r), m = hn(
1700
+ ), { layout$: p, info$: h } = ln(r), m = pn(
1701
1701
  r,
1702
1702
  a.watch("viewportMode")
1703
1703
  );
@@ -1716,9 +1716,9 @@ const ln = ({
1716
1716
  layout$: p,
1717
1717
  layoutInfo$: h
1718
1718
  };
1719
- }, fn = `${lt}-enhancer-loading`, Ce = `${fn}-container`, yn = (e, t) => {
1719
+ }, mn = `${lt}-enhancer-loading`, Oe = `${mn}-container`, fn = (e, t) => {
1720
1720
  const i = e.ownerDocument.createElement("div");
1721
- return i.classList.add(Ce), i.style.cssText = `
1721
+ return i.classList.add(Oe), i.style.cssText = `
1722
1722
  height: 100%;
1723
1723
  width: 100%;
1724
1724
  max-width: ${t.state.visibleAreaRect.width}px;
@@ -1734,7 +1734,7 @@ const ln = ({
1734
1734
  background-color: white;
1735
1735
  z-index: 1;
1736
1736
  `, i;
1737
- }, Sn = ({
1737
+ }, yn = ({
1738
1738
  container: e,
1739
1739
  item: t
1740
1740
  }) => {
@@ -1751,17 +1751,17 @@ const ln = ({
1751
1751
  max-width: 300px;
1752
1752
  width: 80%;
1753
1753
  `, e.appendChild(i), e.appendChild(n), e;
1754
- }, bn = (e) => (t) => {
1755
- const { loadingElementCreate: i = Sn } = t, n = e(t), o = (c) => w(
1754
+ }, Sn = (e) => (t) => {
1755
+ const { loadingElementCreate: i = yn } = t, n = e(t), o = (c) => w(
1756
1756
  c.reduce((u, { item: d, element: g }) => {
1757
1757
  g.style.zIndex = "0";
1758
1758
  const l = g.querySelector(
1759
- `.${Ce}`
1759
+ `.${Oe}`
1760
1760
  );
1761
1761
  if (l instanceof HTMLElement)
1762
1762
  return u[d.id] = l, u;
1763
1763
  const p = i({
1764
- container: yn(g, n.context),
1764
+ container: fn(g, n.context),
1765
1765
  item: d
1766
1766
  });
1767
1767
  return g.appendChild(p), u[d.id] = p, u;
@@ -1816,7 +1816,7 @@ const ln = ({
1816
1816
  }
1817
1817
  };
1818
1818
  };
1819
- class In extends ht {
1819
+ class bn extends ht {
1820
1820
  getImageElement() {
1821
1821
  const t = this.documentContainer;
1822
1822
  if (t instanceof HTMLImageElement)
@@ -1868,13 +1868,13 @@ class In extends ht {
1868
1868
  getDocumentFrame() {
1869
1869
  }
1870
1870
  }
1871
- const wn = (e) => (t) => {
1871
+ const In = (e) => (t) => {
1872
1872
  const i = e({
1873
1873
  ...t,
1874
1874
  getRenderer(r) {
1875
1875
  var d;
1876
1876
  const a = (d = t.getRenderer) == null ? void 0 : d.call(t, r), c = r.mediaType ?? Lt(r.href), u = !!(c != null && c.startsWith("image/"));
1877
- return !a && u ? (g) => new In(g) : a;
1877
+ return !a && u ? (g) => new bn(g) : a;
1878
1878
  }
1879
1879
  }), n = new IntersectionObserver(
1880
1880
  (r) => {
@@ -1924,10 +1924,10 @@ const wn = (e) => (t) => {
1924
1924
  n.disconnect(), o.disconnect(), i.destroy();
1925
1925
  }
1926
1926
  };
1927
- }, Pn = (e, t) => e.links$.pipe(
1927
+ }, wn = (e, t) => e.links$.pipe(
1928
1928
  T((i) => {
1929
1929
  var r;
1930
- if (!Ci(i.target, "a") || i.type !== "click") return;
1930
+ if (!Mi(i.target, "a") || i.type !== "click") return;
1931
1931
  const n = new URL(i.target.href), o = `${n.origin}${n.pathname}`;
1932
1932
  ((r = e.context.manifest) == null ? void 0 : r.spineItems.some(
1933
1933
  (a) => a.href === o
@@ -1939,7 +1939,7 @@ class A {
1939
1939
  this.__symbol = Symbol("SpineItemPosition"), this.x = t.x, this.y = t.y;
1940
1940
  }
1941
1941
  }
1942
- const vn = ({
1942
+ const Pn = ({
1943
1943
  position: e,
1944
1944
  spineItem: t,
1945
1945
  pageHeight: i,
@@ -1957,7 +1957,7 @@ const vn = ({
1957
1957
  s,
1958
1958
  t
1959
1959
  );
1960
- }, oe = ({
1960
+ }, se = ({
1961
1961
  position: e,
1962
1962
  navigationResolver: t,
1963
1963
  computedPageTurnDirection: i,
@@ -1971,7 +1971,7 @@ const vn = ({
1971
1971
  const u = o.getSpineItemPositionFromSpinePosition(
1972
1972
  e,
1973
1973
  a
1974
- ), d = vn({
1974
+ ), d = Pn({
1975
1975
  position: u,
1976
1976
  spineItem: a,
1977
1977
  pageHeight: s.getPageSize().height,
@@ -1993,7 +1993,7 @@ const vn = ({
1993
1993
  x: 0
1994
1994
  })
1995
1995
  );
1996
- }, xn = ({
1996
+ }, vn = ({
1997
1997
  position: e,
1998
1998
  spineItem: t,
1999
1999
  context: i,
@@ -2002,7 +2002,7 @@ const vn = ({
2002
2002
  spineLocator: s,
2003
2003
  computedPageTurnDirection: r
2004
2004
  }) => {
2005
- const a = oe({
2005
+ const a = se({
2006
2006
  position: e,
2007
2007
  context: i,
2008
2008
  navigationResolver: n,
@@ -2024,7 +2024,7 @@ const vn = ({
2024
2024
  );
2025
2025
  if (r === "vertical" && e.y !== a.y)
2026
2026
  return n.getAdjustedPositionForSpread(a);
2027
- const c = oe({
2027
+ const c = se({
2028
2028
  position: a,
2029
2029
  context: i,
2030
2030
  navigationResolver: n,
@@ -2035,7 +2035,7 @@ const vn = ({
2035
2035
  return n.getAdjustedPositionForSpread(c);
2036
2036
  }
2037
2037
  return n.getAdjustedPositionForSpread(a);
2038
- }, $n = ({
2038
+ }, xn = ({
2039
2039
  position: e,
2040
2040
  spineItem: t,
2041
2041
  pageHeight: i,
@@ -2053,7 +2053,7 @@ const vn = ({
2053
2053
  s,
2054
2054
  t
2055
2055
  );
2056
- }, se = ({
2056
+ }, re = ({
2057
2057
  position: e,
2058
2058
  navigationResolver: t,
2059
2059
  computedPageTurnDirection: i,
@@ -2067,7 +2067,7 @@ const vn = ({
2067
2067
  const u = o.getSpineItemPositionFromSpinePosition(
2068
2068
  e,
2069
2069
  a
2070
- ), d = $n({
2070
+ ), d = xn({
2071
2071
  position: u,
2072
2072
  spineItem: a,
2073
2073
  pageHeight: s.getPageSize().height,
@@ -2089,7 +2089,7 @@ const vn = ({
2089
2089
  x: 0
2090
2090
  })
2091
2091
  );
2092
- }, Tn = ({
2092
+ }, $n = ({
2093
2093
  position: e,
2094
2094
  spineItem: t,
2095
2095
  context: i,
@@ -2098,7 +2098,7 @@ const vn = ({
2098
2098
  spineLocator: s,
2099
2099
  computedPageTurnDirection: r
2100
2100
  }) => {
2101
- const a = se({
2101
+ const a = re({
2102
2102
  position: e,
2103
2103
  context: i,
2104
2104
  navigationResolver: n,
@@ -2123,7 +2123,7 @@ const vn = ({
2123
2123
  );
2124
2124
  if (r === "vertical" && e.y !== a.y)
2125
2125
  return n.getAdjustedPositionForSpread(a);
2126
- const c = se({
2126
+ const c = re({
2127
2127
  position: a,
2128
2128
  context: i,
2129
2129
  navigationResolver: n,
@@ -2135,7 +2135,7 @@ const vn = ({
2135
2135
  }
2136
2136
  return n.getAdjustedPositionForSpread(a);
2137
2137
  };
2138
- class Fn {
2138
+ class Tn {
2139
2139
  constructor(t) {
2140
2140
  this.reader = t, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2141
2141
  }
@@ -2154,7 +2154,7 @@ class Fn {
2154
2154
  turnRightOrBottom() {
2155
2155
  const t = this.reader.navigation.getNavigation(), i = this.reader.spineItemsManager.get(t.spineItem);
2156
2156
  if (!i) return;
2157
- const n = Tn({
2157
+ const n = $n({
2158
2158
  context: this.reader.context,
2159
2159
  navigationResolver: this.reader.navigation.navigationResolver,
2160
2160
  position: t.position,
@@ -2170,7 +2170,7 @@ class Fn {
2170
2170
  turnLeftOrTop() {
2171
2171
  const t = this.reader.navigation.getNavigation(), i = this.reader.spineItemsManager.get(t.spineItem);
2172
2172
  if (!i) return;
2173
- const n = xn({
2173
+ const n = vn({
2174
2174
  context: this.reader.context,
2175
2175
  navigationResolver: this.reader.navigation.navigationResolver,
2176
2176
  position: t.position,
@@ -2312,7 +2312,7 @@ class Fn {
2312
2312
  }
2313
2313
  }
2314
2314
  }
2315
- class Ln {
2315
+ class Fn {
2316
2316
  constructor(t) {
2317
2317
  this.reader = t, this.lastDelta = { x: 0, y: 0 }, this.lastPosition = new M({ x: 0, y: 0 }), this.lastStartPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
2318
2318
  }
@@ -2352,7 +2352,7 @@ class Ln {
2352
2352
  });
2353
2353
  }
2354
2354
  }
2355
- const Mn = (e) => e.pagination.state$.pipe(
2355
+ const Ln = (e) => e.pagination.state$.pipe(
2356
2356
  D(e.context.manifest$, e.settings.values$),
2357
2357
  b(
2358
2358
  ([
@@ -2372,7 +2372,7 @@ const Mn = (e) => e.pagination.state$.pipe(
2372
2372
  }
2373
2373
  ),
2374
2374
  E(N)
2375
- ), Cn = ({ reader: e, duration: t }) => (i) => {
2375
+ ), Mn = ({ reader: e, duration: t }) => (i) => {
2376
2376
  let n;
2377
2377
  const o = () => {
2378
2378
  n == null || n(), n = void 0;
@@ -2381,25 +2381,25 @@ const Mn = (e) => e.pagination.state$.pipe(
2381
2381
  T(() => {
2382
2382
  n || (n = e == null ? void 0 : e.navigation.lock());
2383
2383
  }),
2384
- Ze(t, at, {
2384
+ Ge(t, at, {
2385
2385
  trailing: !0,
2386
2386
  leading: !0
2387
2387
  }),
2388
2388
  T(o),
2389
2389
  ut(o)
2390
2390
  );
2391
- }, Rn = (e) => (t) => {
2392
- const i = e(t), n = Mn(i), o = new Fn(i), s = new Ln(i), r = (c) => {
2391
+ }, Cn = (e) => (t) => {
2392
+ const i = e(t), n = Ln(i), o = new Tn(i), s = new Fn(i), r = (c) => {
2393
2393
  const { cfi: u, ...d } = c;
2394
2394
  i.load(d), u && o.goToCfi(u, { animate: !1 });
2395
2395
  };
2396
- return Pn(i, o).pipe(F(i.$.destroy$)).subscribe(), {
2396
+ return wn(i, o).pipe(F(i.$.destroy$)).subscribe(), {
2397
2397
  ...i,
2398
2398
  load: r,
2399
2399
  navigation: {
2400
2400
  ...i.navigation,
2401
2401
  state$: n,
2402
- throttleLock: ({ duration: c, trigger: u }) => u.pipe(Cn({ duration: c, reader: i })),
2402
+ throttleLock: ({ duration: c, trigger: u }) => u.pipe(Mn({ duration: c, reader: i })),
2403
2403
  moveTo: s.moveTo.bind(s),
2404
2404
  turnBottom: o.turnBottom.bind(o),
2405
2405
  turnTop: o.turnTop.bind(o),
@@ -2422,21 +2422,12 @@ const Mn = (e) => e.pagination.state$.pipe(
2422
2422
  goToAbsolutePageIndex: o.goToAbsolutePageIndex.bind(o)
2423
2423
  }
2424
2424
  };
2425
- }, mt = (e) => {
2426
- const t = Re(e);
2427
- return ui([
2428
- [{ index: 0, extensions: { "vnd.prose.anchor": t } }]
2429
- ]);
2430
- }, ft = (e, t, i) => {
2425
+ }, mt = (e) => Ie({
2426
+ spineIndex: e.index,
2427
+ spineId: e.id
2428
+ }), ft = (e, t, i) => {
2431
2429
  var n;
2432
- return !e.ownerDocument || !((n = e.ownerDocument) != null && n.documentElement) || e === e.ownerDocument ? mt(i) : di(
2433
- { node: e, offset: t },
2434
- {
2435
- extensions: {
2436
- "vnd.prose.anchor": Re(i)
2437
- }
2438
- }
2439
- );
2430
+ return !e.ownerDocument || !((n = e.ownerDocument) != null && n.documentElement) || e === e.ownerDocument ? mt(i) : Ie({ node: e, offset: t, spineIndex: i.index, spineId: i.id });
2440
2431
  }, Wt = ({
2441
2432
  pageIndex: e,
2442
2433
  spineItem: t,
@@ -2452,10 +2443,10 @@ const Mn = (e) => e.pagination.state$.pipe(
2452
2443
  n.offset,
2453
2444
  t.item
2454
2445
  ).trim() : mt(t.item);
2455
- }, An = (e, t) => {
2446
+ }, Rn = (e, t) => {
2456
2447
  const i = ft(e.startContainer, e.startOffset, t), n = ft(e.endContainer, e.endOffset, t);
2457
2448
  return { start: i, end: n };
2458
- }, On = ({
2449
+ }, An = ({
2459
2450
  item: e,
2460
2451
  selection: t
2461
2452
  }) => {
@@ -2464,51 +2455,50 @@ const Mn = (e) => e.pagination.state$.pipe(
2464
2455
  anchorCfi: i,
2465
2456
  focusCfi: n
2466
2457
  };
2467
- }, Re = (e) => e.index.toString(), zt = (e) => {
2468
- var i, n, o;
2469
- const t = Se(e);
2470
- if (Array.isArray(t)) {
2471
- const s = t.at(-1);
2472
- return ((i = s == null ? void 0 : s[0]) == null ? void 0 : i.index) === 0;
2473
- }
2474
- return ((o = (n = t.parent.at(-1)) == null ? void 0 : n[0]) == null ? void 0 : o.index) === 0;
2475
- }, Ae = (e) => {
2476
- var s, r, a, c;
2477
- const t = Se(e), i = gi(t), n = Number.parseInt((i == null ? void 0 : i["vnd.prose.anchor"]) || ""), o = li(t) ? (r = (s = t.end.at(-1)) == null ? void 0 : s.at(-1)) == null ? void 0 : r.offset : (c = (a = t.at(-1)) == null ? void 0 : a.at(-1)) == null ? void 0 : c.offset;
2458
+ }, ae = (e) => {
2459
+ var t;
2460
+ return ((t = e[0]) == null ? void 0 : t.index) === 6 && e.length > 1;
2461
+ }, zt = (e) => {
2462
+ const t = we(e);
2463
+ return gi(t);
2464
+ }, On = (e) => Array.isArray(e) ? e[0] && ae(e[0]) ? e[0] : void 0 : e.parent[0] && ae(e.parent[0]) ? e.parent[0] : void 0, Zt = (e) => {
2465
+ var a, c, u, d;
2466
+ const t = we(e), n = (On(t) ?? [])[1], s = ((n == null ? void 0 : n.index) ?? 2) / 2 - 1, r = di(t) ? (c = (a = t.end.at(-1)) == null ? void 0 : a.at(-1)) == null ? void 0 : c.offset : (d = (u = t.at(-1)) == null ? void 0 : u.at(-1)) == null ? void 0 : d.offset;
2478
2467
  return {
2479
2468
  cleanedCfi: e,
2480
- itemIndex: Number.isNaN(n) ? void 0 : n,
2481
- offset: o ?? 0
2469
+ itemIndex: s,
2470
+ offset: r ?? 0
2482
2471
  };
2483
- }, Oe = ({
2472
+ }, De = ({
2484
2473
  cfi: e,
2485
2474
  spineItemsManager: t
2486
2475
  }) => {
2487
- var o, s;
2476
+ var s, r;
2488
2477
  if (!e) return;
2489
- const i = t.getSpineItemFromCfi(e);
2490
- if (!i) return;
2491
- const n = i.renderer.getDocumentFrame();
2492
- if (n instanceof HTMLIFrameElement) {
2493
- const r = (o = n.contentWindow) == null ? void 0 : o.document;
2494
- if (r)
2478
+ const { itemIndex: i } = Zt(e), n = t.get(i);
2479
+ if (!n) return;
2480
+ const o = n.renderer.getDocumentFrame();
2481
+ if (o instanceof HTMLIFrameElement) {
2482
+ console.log("FIII", e);
2483
+ const a = (s = o.contentWindow) == null ? void 0 : s.document;
2484
+ if (a)
2495
2485
  try {
2496
- const a = pi(e, r, {
2486
+ const c = li(e, a, {
2497
2487
  throwOnError: !0
2498
2488
  });
2499
2489
  return {
2500
- node: a.isRange ? (s = a.node) == null ? void 0 : s.startContainer : a.node,
2501
- offset: Array.isArray(a.offset) ? a.offset.at(-1) : a.offset,
2502
- spineItem: i
2490
+ node: c.isRange ? (r = c.node) == null ? void 0 : r.startContainer : c.node,
2491
+ offset: Array.isArray(c.offset) ? c.offset.at(-1) : c.offset,
2492
+ spineItem: n
2503
2493
  };
2504
- } catch (a) {
2505
- return j.error(a), {
2506
- spineItem: i
2494
+ } catch (c) {
2495
+ return j.error(c), {
2496
+ spineItem: n
2507
2497
  };
2508
2498
  }
2509
2499
  }
2510
2500
  return {
2511
- spineItem: i
2501
+ spineItem: n
2512
2502
  };
2513
2503
  }, Dn = (e, t) => {
2514
2504
  if ("cfi" in t)
@@ -2522,7 +2512,7 @@ const Mn = (e) => e.pagination.state$.pipe(
2522
2512
  }, Nn = (e, t) => {
2523
2513
  let i = e == null ? void 0 : e.itemPageIndex;
2524
2514
  const { itemIndex: n } = t.cfi.parseCfi(e.cfi), o = t.spineItemsManager.get(n);
2525
- return o ? xe().pipe(
2515
+ return o ? Fe().pipe(
2526
2516
  D(o.isReady$),
2527
2517
  b(([, s]) => {
2528
2518
  var g;
@@ -2559,12 +2549,12 @@ class Vn {
2559
2549
  resource: i,
2560
2550
  meta: Dn(this.reader, i)
2561
2551
  };
2562
- return ee(() => {
2552
+ return ie(() => {
2563
2553
  var d;
2564
2554
  const s = this.reader.spine.spineLayout.layout$.pipe(
2565
2555
  St(10),
2566
2556
  nt(o),
2567
- Ge((g) => Nn(g.meta, this.reader).pipe(
2557
+ Je((g) => Nn(g.meta, this.reader).pipe(
2568
2558
  b((l) => ({
2569
2559
  ...g,
2570
2560
  meta: l
@@ -2585,12 +2575,12 @@ class Vn {
2585
2575
  };
2586
2576
  }
2587
2577
  locateResource(t, i) {
2588
- return Array.isArray(t) ? ee(
2578
+ return Array.isArray(t) ? ie(
2589
2579
  () => q(t.map((n) => this.locate(n, i ?? {})))
2590
2580
  ) : this.locate(t, i ?? {});
2591
2581
  }
2592
2582
  }
2593
- const De = (e, t, i) => {
2583
+ const Ne = (e, t, i) => {
2594
2584
  const n = i.spineItems.findIndex(
2595
2585
  (o) => o.href === e
2596
2586
  );
@@ -2607,7 +2597,7 @@ const De = (e, t, i) => {
2607
2597
  const m = {
2608
2598
  title: s.title,
2609
2599
  path: s.path
2610
- }, S = De(e, s.contents, i);
2600
+ }, S = Ne(e, s.contents, i);
2611
2601
  return S ? {
2612
2602
  ...m,
2613
2603
  subChapter: S
@@ -2618,7 +2608,7 @@ const De = (e, t, i) => {
2618
2608
  }, jn = (e, t) => {
2619
2609
  var n;
2620
2610
  const { href: i } = t;
2621
- return De(i, ((n = e.nav) == null ? void 0 : n.toc) ?? [], e);
2611
+ return Ne(i, ((n = e.nav) == null ? void 0 : n.toc) ?? [], e);
2622
2612
  }, kn = (e) => {
2623
2613
  const t = e.context.manifest, i = e.spineItemsManager.items;
2624
2614
  return t ? i.reduce(
@@ -2887,13 +2877,13 @@ const De = (e, t, i) => {
2887
2877
  i.next({ id: c, data: u });
2888
2878
  };
2889
2879
  i.asObservable().pipe(
2890
- ai(({ id: c, data: u }) => {
2880
+ ci(({ id: c, data: u }) => {
2891
2881
  const d = n(c);
2892
2882
  return d ? W(
2893
- Je([At("prose-reader"), W(u.blob())])
2883
+ Ke([At("prose-reader"), W(u.blob())])
2894
2884
  ).pipe(
2895
2885
  _(([g, l]) => W(g.put(`${t}_${d.id}`, l))),
2896
- Qt((g) => (j.error(g), K))
2886
+ te((g) => (j.error(g), K))
2897
2887
  ) : K;
2898
2888
  }),
2899
2889
  J(e.destroy$)
@@ -2916,7 +2906,7 @@ const De = (e, t, i) => {
2916
2906
  })
2917
2907
  )
2918
2908
  ),
2919
- Qt((c) => (j.error(c), K))
2909
+ te((c) => (j.error(c), K))
2920
2910
  ))),
2921
2911
  J(e.destroy$)
2922
2912
  ).subscribe(), {
@@ -2986,14 +2976,14 @@ class Qn extends Y {
2986
2976
  if (!i)
2987
2977
  this.selectionChange$ = gt, this.selectionOver$ = gt;
2988
2978
  else {
2989
- const o = ie(i.body, {
2979
+ const o = ne(i.body, {
2990
2980
  childList: !0,
2991
2981
  subtree: !0
2992
2982
  }).pipe(
2993
2983
  R(
2994
2984
  (r) => !!r.find((a) => a.type === "childList" && a.removedNodes.length)
2995
2985
  )
2996
- ), s = t.parentElement ? ie(t.parentElement, {
2986
+ ), s = t.parentElement ? ne(t.parentElement, {
2997
2987
  childList: !0
2998
2988
  }).pipe(
2999
2989
  R(
@@ -3123,7 +3113,7 @@ const to = (e) => e.loaded$.pipe(
3123
3113
  createOrderedRangeFromSelection: Kn
3124
3114
  }
3125
3115
  };
3126
- }, re = [
3116
+ }, ce = [
3127
3117
  {
3128
3118
  name: "bright",
3129
3119
  backgroundColor: "white"
@@ -3142,7 +3132,7 @@ const to = (e) => e.loaded$.pipe(
3142
3132
  const i = e(t), n = new k(
3143
3133
  t.theme ?? "bright"
3144
3134
  ), o = () => {
3145
- const a = re.find(
3135
+ const a = ce.find(
3146
3136
  (c) => c.name === n.value
3147
3137
  );
3148
3138
  return `
@@ -3159,7 +3149,7 @@ const to = (e) => e.loaded$.pipe(
3159
3149
  }, s = ({
3160
3150
  container: a
3161
3151
  }) => {
3162
- const c = re.find(
3152
+ const c = ce.find(
3163
3153
  (u) => u.name === n.value
3164
3154
  );
3165
3155
  return c && a.style.setProperty(
@@ -3207,7 +3197,7 @@ const to = (e) => e.loaded$.pipe(
3207
3197
  ...e(t),
3208
3198
  utils: {
3209
3199
  isOrIsWithinValidLink: (o) => {
3210
- if (be(o)) {
3200
+ if (Pe(o)) {
3211
3201
  const s = o.nodeName === "a" ? o : o.closest("a");
3212
3202
  if (s != null && s.getAttribute("href"))
3213
3203
  return !0;
@@ -3218,12 +3208,12 @@ const to = (e) => e.loaded$.pipe(
3218
3208
  });
3219
3209
  navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
3220
3210
  const oo = (e) => (t) => e(t);
3221
- class Ne {
3211
+ class Ve {
3222
3212
  constructor(t) {
3223
3213
  this.reader = t;
3224
3214
  }
3225
3215
  }
3226
- class so extends Ne {
3216
+ class so extends Ve {
3227
3217
  constructor() {
3228
3218
  super(...arguments), this.isZooming$ = new k(!1), this.currentScale = 1, this.currentPosition = { x: 0, y: 0 };
3229
3219
  }
@@ -3280,7 +3270,7 @@ const Tt = ({
3280
3270
  const o = i * e / 2 - i + i / 2, s = i * t / 2 - i + i / 2, r = e / t, a = n - s;
3281
3271
  return Math.max(o + a * r, 0);
3282
3272
  };
3283
- class ro extends Ne {
3273
+ class ro extends Ve {
3284
3274
  constructor() {
3285
3275
  super(...arguments), this.isZooming$ = new k(!1), this.currentScale = 1, this.currentPosition = { x: 0, y: 0 };
3286
3276
  }
@@ -3345,7 +3335,7 @@ const ao = (e) => (t) => {
3345
3335
  }
3346
3336
  }
3347
3337
  };
3348
- }, Ve = (e) => (e == null ? void 0 : e.renditionLayout) === "pre-paginated" || (e == null ? void 0 : e.spineItems.every((t) => t.renditionLayout === "pre-paginated"));
3338
+ }, je = (e) => (e == null ? void 0 : e.renditionLayout) === "pre-paginated" || (e == null ? void 0 : e.spineItems.every((t) => t.renditionLayout === "pre-paginated"));
3349
3339
  class bt extends st {
3350
3340
  constructor(t) {
3351
3341
  super((i) => this.stateSubject.pipe(F(this.destroy$)).subscribe(i)), this.destroy$ = new U(), this.stateSubject = new k(t);
@@ -3375,7 +3365,7 @@ class bt extends st {
3375
3365
  }
3376
3366
  class co {
3377
3367
  constructor() {
3378
- this.navigationSubject = new Gt(1), this.viewportStateSubject = new k("free"), this.paginationSubject = new Gt(), this.navigationIsLockedSubject = new k(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
3368
+ this.navigationSubject = new Jt(1), this.viewportStateSubject = new k("free"), this.paginationSubject = new Jt(), this.navigationIsLockedSubject = new k(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
3379
3369
  E(),
3380
3370
  R((t) => !t)
3381
3371
  ), this.viewportState$ = this.viewportStateSubject.asObservable(), this.viewportFree$ = this.viewportState$.pipe(
@@ -3438,7 +3428,7 @@ class go extends bt {
3438
3428
  height: t.visibleAreaRect.height - r - a
3439
3429
  },
3440
3430
  ...t.manifest && {
3441
- isFullyPrePaginated: Ve(n),
3431
+ isFullyPrePaginated: je(n),
3442
3432
  assumedRenditionLayout: (n == null ? void 0 : n.renditionLayout) ?? "reflowable"
3443
3433
  },
3444
3434
  isUsingSpreadMode: uo({
@@ -3571,7 +3561,7 @@ class po {
3571
3561
  return q(s);
3572
3562
  }
3573
3563
  }
3574
- class je {
3564
+ class ke {
3575
3565
  constructor() {
3576
3566
  this.isLockedSubject = new k(0), this.isLocked$ = this.isLockedSubject.pipe(
3577
3567
  b((t) => !!t),
@@ -3709,7 +3699,7 @@ const ho = () => (e) => e.pipe(
3709
3699
  ...o
3710
3700
  };
3711
3701
  })
3712
- ), ae = ({
3702
+ ), ue = ({
3713
3703
  settings: e,
3714
3704
  spineItemsManager: t,
3715
3705
  navigationResolver: i,
@@ -3768,7 +3758,7 @@ const ho = () => (e) => e.pipe(
3768
3758
  };
3769
3759
  })
3770
3760
  );
3771
- }, ce = ({ spine: e }) => (t) => t.pipe(
3761
+ }, de = ({ spine: e }) => (t) => t.pipe(
3772
3762
  v(({ navigation: i, ...n }) => {
3773
3763
  const o = e.spineLayout.getSpineItemSpineLayoutInfo(i.spineItem), s = e.spineItemsManager.get(i.spineItem);
3774
3764
  return ((s == null ? void 0 : s.isReady$) ?? w(!1)).pipe(
@@ -4000,7 +3990,7 @@ const ho = () => (e) => e.pipe(
4000
3990
  navigationResolver: o,
4001
3991
  spineItemsManager: t,
4002
3992
  spineLayout: s
4003
- }), ue = ({
3993
+ }), ge = ({
4004
3994
  settings: e,
4005
3995
  navigationResolver: t,
4006
3996
  context: i,
@@ -4035,7 +4025,7 @@ class Fo extends Y {
4035
4025
  spineItemIsReady: !1,
4036
4026
  type: "api",
4037
4027
  id: Symbol()
4038
- }), this.navigated$ = this.navigationSubject.pipe(me(1)), this.navigation$ = this.navigationSubject.pipe(
4028
+ }), this.navigated$ = this.navigationSubject.pipe(ye(1)), this.navigation$ = this.navigationSubject.pipe(
4039
4029
  b(({ position: f, id: y }) => ({
4040
4030
  position: f,
4041
4031
  id: y
@@ -4044,7 +4034,7 @@ class Fo extends Y {
4044
4034
  ({ position: f, ...y }, { position: I, ...P }) => N(y, P) && N(f, I)
4045
4035
  ),
4046
4036
  et(1)
4047
- ), this.locker = new je();
4037
+ ), this.locker = new ke();
4048
4038
  const u = n.pipe(
4049
4039
  D(this.navigationSubject),
4050
4040
  fo,
@@ -4063,7 +4053,7 @@ class Fo extends Y {
4063
4053
  navigationResolver: r
4064
4054
  }),
4065
4055
  bo({ context: i, settings: t }),
4066
- ae({
4056
+ ue({
4067
4057
  navigationResolver: r,
4068
4058
  settings: t,
4069
4059
  spineItemsManager: a.spineItemsManager,
@@ -4075,7 +4065,7 @@ class Fo extends Y {
4075
4065
  spineItemsManager: a.spineItemsManager,
4076
4066
  spineLocator: a.locator
4077
4067
  }),
4078
- ce({
4068
+ de({
4079
4069
  spine: a
4080
4070
  })
4081
4071
  ).pipe(
@@ -4087,7 +4077,7 @@ class Fo extends Y {
4087
4077
  v(([f, y]) => {
4088
4078
  const I = f.navigation.cfi || f.navigation.url || t.values.computedPageTurnMode === "scrollable" || y;
4089
4079
  return w(f).pipe(
4090
- I ? Pt : ue({
4080
+ I ? Pt : ge({
4091
4081
  navigationResolver: r,
4092
4082
  settings: t,
4093
4083
  spine: a,
@@ -4155,7 +4145,7 @@ class Fo extends Y {
4155
4145
  d
4156
4146
  ).pipe(
4157
4147
  b((f) => ({ navigation: f })),
4158
- ue({
4148
+ ge({
4159
4149
  navigationResolver: r,
4160
4150
  settings: t,
4161
4151
  context: i,
@@ -4178,13 +4168,13 @@ class Fo extends Y {
4178
4168
  * eg: after the reader load and the user has never navigated
4179
4169
  * yet.
4180
4170
  */
4181
- ae({
4171
+ ue({
4182
4172
  navigationResolver: r,
4183
4173
  settings: t,
4184
4174
  spineItemsManager: a.spineItemsManager,
4185
4175
  spineLocator: a.locator
4186
4176
  }),
4187
- ce({
4177
+ de({
4188
4178
  spine: a
4189
4179
  }),
4190
4180
  Ot({
@@ -4246,7 +4236,7 @@ class Fo extends Y {
4246
4236
  return this.navigationSubject.getValue();
4247
4237
  }
4248
4238
  }
4249
- const ke = ({
4239
+ const We = ({
4250
4240
  position: { x: e, y: t },
4251
4241
  spineElement: i,
4252
4242
  element: n
@@ -4286,7 +4276,7 @@ class Mo extends Y {
4286
4276
  ),
4287
4277
  H(),
4288
4278
  T(() => {
4289
- const u = a.target, d = ke({
4279
+ const u = a.target, d = We({
4290
4280
  element: u,
4291
4281
  position: new M({
4292
4282
  x: u.scrollLeft ?? 0,
@@ -4318,7 +4308,7 @@ const Co = (e) => ({
4318
4308
  }) : new M({
4319
4309
  x: -e.x,
4320
4310
  y: -e.y
4321
- }), Ao = "navigation/ViewportNavigator", de = j.namespace(Ao);
4311
+ }), Ao = "navigation/ViewportNavigator", le = j.namespace(Ao);
4322
4312
  class Oo extends Y {
4323
4313
  constructor(t, i, n, o, s) {
4324
4314
  super(), this.settings = t, this.hookManager = i, this.context = n, this.spine = o, this.viewport = s, this.navigateSubject = new U(), this.element$ = new k(
@@ -4347,13 +4337,13 @@ class Oo extends Y {
4347
4337
  );
4348
4338
  this.layout$ = c.pipe(
4349
4339
  T(() => {
4350
- de.info("layout", t.values);
4340
+ le.info("layout", t.values);
4351
4341
  }),
4352
4342
  V()
4353
4343
  );
4354
4344
  const u = this.navigateSubject.pipe(
4355
4345
  T((d) => {
4356
- de.info("Navigation requested", d);
4346
+ le.info("Navigation requested", d);
4357
4347
  })
4358
4348
  );
4359
4349
  this.isNavigating$ = u.pipe(
@@ -4458,11 +4448,11 @@ class Do extends bt {
4458
4448
  left: g.x,
4459
4449
  top: g.y,
4460
4450
  behavior: "instant"
4461
- }), Jt(1).pipe(
4451
+ }), Kt(1).pipe(
4462
4452
  T(() => {
4463
4453
  this.scrollingSubject.next(!1);
4464
4454
  }),
4465
- F(x(this.scrollingSubject.pipe(me(1)), this.destroy$))
4455
+ F(x(this.scrollingSubject.pipe(ye(1)), this.destroy$))
4466
4456
  ).subscribe(), this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
4467
4457
  };
4468
4458
  const r = this.context.pipe(
@@ -4492,12 +4482,12 @@ class Do extends bt {
4492
4482
  et(1)
4493
4483
  );
4494
4484
  const u = x(
4495
- o.element$.pipe(v((g) => ve(g))),
4485
+ o.element$.pipe(v((g) => Te(g))),
4496
4486
  o.element$.pipe(v((g) => G(g, "scroll"))),
4497
4487
  o.spineItemsObserver.itemResize$
4498
4488
  ).pipe(
4499
4489
  v(
4500
- () => Jt(10).pipe(
4490
+ () => Kt(10).pipe(
4501
4491
  b(() => !1),
4502
4492
  nt(!0)
4503
4493
  )
@@ -4539,7 +4529,7 @@ class Do extends bt {
4539
4529
  }
4540
4530
  get viewportPosition() {
4541
4531
  const t = this.value.element;
4542
- return t ? ke({
4532
+ return t ? We({
4543
4533
  element: t,
4544
4534
  position: new M({
4545
4535
  x: (t == null ? void 0 : t.scrollLeft) ?? 0,
@@ -4549,13 +4539,13 @@ class Do extends bt {
4549
4539
  }) : new M({ x: 0, y: 0 });
4550
4540
  }
4551
4541
  }
4552
- const ge = (e, t, i) => {
4542
+ const pe = (e, t, i) => {
4553
4543
  const n = i - e, o = i * (t * e) / (i || 1);
4554
4544
  return Math.max(0, Math.min(n, o));
4555
4545
  }, Ut = (e, t) => (t || 0) === 0 || (e || 0) === 0 ? 1 : Math.floor(Math.max(1, e / t)), xt = (e, t, i) => {
4556
4546
  const n = Ut(i, t), o = [...Array(n)].map((s, r) => r * t);
4557
4547
  return e >= n * t ? o[o.length - 1] || 0 : o.find((s) => e < s + t) || 0;
4558
- }, Zt = ({
4548
+ }, Gt = ({
4559
4549
  itemHeight: e,
4560
4550
  itemWidth: t,
4561
4551
  isUsingVerticalWriting: i,
@@ -4574,7 +4564,7 @@ const ge = (e, t, i) => {
4574
4564
  isUsingVerticalWriting: n
4575
4565
  }) => {
4576
4566
  if (n) {
4577
- const s = ge(
4567
+ const s = pe(
4578
4568
  i.getPageSize().height,
4579
4569
  e,
4580
4570
  t.height
@@ -4584,7 +4574,7 @@ const ge = (e, t, i) => {
4584
4574
  y: s
4585
4575
  });
4586
4576
  }
4587
- const o = ge(
4577
+ const o = pe(
4588
4578
  i.getPageSize().width,
4589
4579
  e,
4590
4580
  t.width
@@ -4602,7 +4592,7 @@ const ge = (e, t, i) => {
4602
4592
  settings: i,
4603
4593
  itemLayout: n
4604
4594
  }) => {
4605
- const o = Zt({
4595
+ const o = Gt({
4606
4596
  context: e,
4607
4597
  isUsingVerticalWriting: t,
4608
4598
  itemHeight: n.height,
@@ -4617,7 +4607,7 @@ const ge = (e, t, i) => {
4617
4607
  pageIndex: r
4618
4608
  })
4619
4609
  );
4620
- }, We = ({
4610
+ }, ze = ({
4621
4611
  context: e,
4622
4612
  settings: t
4623
4613
  }) => {
@@ -4638,7 +4628,7 @@ const ge = (e, t, i) => {
4638
4628
  spineItemPosition: g,
4639
4629
  itemHeight: d,
4640
4630
  itemWidth: u
4641
- }), S = e.isRTL() ? u - m.x - e.getPageSize().width : m.x, f = Zt({
4631
+ }), S = e.isRTL() ? u - m.x - e.getPageSize().width : m.x, f = Gt({
4642
4632
  isUsingVerticalWriting: l,
4643
4633
  itemHeight: d,
4644
4634
  itemWidth: u,
@@ -4652,7 +4642,7 @@ const ge = (e, t, i) => {
4652
4642
  if ((u == null ? void 0 : u.nodeName) === "img" || (u == null ? void 0 : u.textContent) === "" && u.nodeType === Node.ELEMENT_NODE)
4653
4643
  l = u.getBoundingClientRect().x;
4654
4644
  else if (u) {
4655
- const S = u ? $i(u, d) : void 0;
4645
+ const S = u ? xi(u, d) : void 0;
4656
4646
  l = (S == null ? void 0 : S.getBoundingClientRect().x) || l;
4657
4647
  }
4658
4648
  const p = ((m = g.layout.layoutInfo) == null ? void 0 : m.width) || 0, h = e.getPageSize().width;
@@ -4679,7 +4669,7 @@ const ge = (e, t, i) => {
4679
4669
  right: m + g.width,
4680
4670
  bottom: S + g.height
4681
4671
  };
4682
- return vi(
4672
+ return Pi(
4683
4673
  l.contentWindow.document,
4684
4674
  f
4685
4675
  );
@@ -4739,7 +4729,7 @@ const ge = (e, t, i) => {
4739
4729
  context: e,
4740
4730
  settings: t
4741
4731
  }) => {
4742
- const i = We({ context: e, settings: t });
4732
+ const i = ze({ context: e, settings: t });
4743
4733
  return {
4744
4734
  getNavigationForLastPage: (r) => {
4745
4735
  const a = r.numberOfPages;
@@ -4765,7 +4755,7 @@ const ge = (e, t, i) => {
4765
4755
  }) => {
4766
4756
  const s = e % n !== 0 ? e - i : e;
4767
4757
  return new M({ x: s, y: t });
4768
- }, le = ({
4758
+ }, he = ({
4769
4759
  position: e,
4770
4760
  isRTL: t,
4771
4761
  pageSizeHeight: i,
@@ -4978,7 +4968,7 @@ const ge = (e, t, i) => {
4978
4968
  context: e
4979
4969
  }),
4980
4970
  getNavigationForCfi: (l) => {
4981
- const p = t.getSpineItemFromCfi(l), { node: h, offset: m = 0 } = Oe({
4971
+ const p = t.getSpineItemFromCfi(l), { node: h, offset: m = 0 } = De({
4982
4972
  cfi: l,
4983
4973
  spineItemsManager: t
4984
4974
  }) || {};
@@ -5026,7 +5016,7 @@ const ge = (e, t, i) => {
5026
5016
  spineLocator: i
5027
5017
  }),
5028
5018
  getMostPredominantNavigationForPosition: (l) => {
5029
- const p = n.values.computedPageTurnDirection, h = 0.5, m = p === "horizontal" ? l.x + e.state.visibleAreaRect.width * h : 0, S = p === "horizontal" ? 0 : l.y + e.state.visibleAreaRect.height * h, f = le({
5019
+ const p = n.values.computedPageTurnDirection, h = 0.5, m = p === "horizontal" ? l.x + e.state.visibleAreaRect.width * h : 0, S = p === "horizontal" ? 0 : l.y + e.state.visibleAreaRect.height * h, f = he({
5030
5020
  position: new M({
5031
5021
  x: m,
5032
5022
  y: S
@@ -5044,7 +5034,7 @@ const ge = (e, t, i) => {
5044
5034
  viewportPosition: f
5045
5035
  });
5046
5036
  },
5047
- getAdjustedPositionWithSafeEdge: (l) => le({
5037
+ getAdjustedPositionWithSafeEdge: (l) => he({
5048
5038
  position: l,
5049
5039
  isRTL: e.isRTL(),
5050
5040
  pageSizeHeight: e.getPageSize().height,
@@ -5069,7 +5059,7 @@ const ge = (e, t, i) => {
5069
5059
  settings: o,
5070
5060
  viewport: s
5071
5061
  }) => {
5072
- const r = new U(), a = new je(), c = Bo({
5062
+ const r = new U(), a = new ke(), c = Bo({
5073
5063
  context: t,
5074
5064
  settings: o,
5075
5065
  spineItemsManager: e,
@@ -5170,7 +5160,7 @@ class qo extends Y {
5170
5160
  threshold: 0.5
5171
5161
  });
5172
5162
  return this.context.bridgeEvent.navigationUnlocked$.pipe(
5173
- pe(1),
5163
+ me(1),
5174
5164
  D(this.context.bridgeEvent.navigation$),
5175
5165
  T(([, u]) => {
5176
5166
  const { position: d } = u, g = this.pagination.value, {
@@ -5268,7 +5258,7 @@ class Yo extends Y {
5268
5258
  }
5269
5259
  watch(t) {
5270
5260
  return this.values$.pipe(
5271
- Pe(t),
5261
+ $e(t),
5272
5262
  E(N)
5273
5263
  );
5274
5264
  }
@@ -5352,7 +5342,7 @@ class Go extends Y {
5352
5342
  }), { width: y, height: I };
5353
5343
  })
5354
5344
  ), this.layout = (a) => {
5355
- const c = Ni(this.layout$.pipe(H()));
5345
+ const c = Di(this.layout$.pipe(H()));
5356
5346
  return this.layoutTriggerSubject.next(a), c();
5357
5347
  }, this.adjustPositionOfElement = ({
5358
5348
  right: a,
@@ -5426,7 +5416,7 @@ class Jo extends ht {
5426
5416
  getDocumentFrame() {
5427
5417
  }
5428
5418
  }
5429
- class ze extends Y {
5419
+ class Ue extends Y {
5430
5420
  constructor(t, i, n, o, s, r) {
5431
5421
  var u, d;
5432
5422
  super(), this.item = t, this.parentElement = i, this.context = n, this.settings = o, this.hookManager = s, this.index = r, this.getBoundingRectOfElementFromSelector = (g) => {
@@ -5466,9 +5456,9 @@ class ze extends Y {
5466
5456
  this.renderer,
5467
5457
  this.settings
5468
5458
  ), this.isReady$ = this.layout.layoutProcess$.pipe(
5469
- ci(this.renderer.isLoaded$),
5459
+ ui(this.renderer.isLoaded$),
5470
5460
  X(([g, l]) => !!(g.type === "end" && l)),
5471
- ye(!1),
5461
+ be(!1),
5472
5462
  Z(),
5473
5463
  z((g) => {
5474
5464
  this.containerElement.dataset.isReady = g.toString();
@@ -5512,7 +5502,7 @@ class ze extends Y {
5512
5502
  _(
5513
5503
  () => this.renderer.state$.pipe(
5514
5504
  tt((t) => t === "idle"),
5515
- fe()
5505
+ Se()
5516
5506
  )
5517
5507
  )
5518
5508
  );
@@ -5521,7 +5511,7 @@ class ze extends Y {
5521
5511
  return this.renderer.renditionLayout;
5522
5512
  }
5523
5513
  get numberOfPages() {
5524
- return Zt({
5514
+ return Gt({
5525
5515
  isUsingVerticalWriting: !!this.isUsingVerticalWriting(),
5526
5516
  itemHeight: this.layout.layoutInfo.height,
5527
5517
  itemWidth: this.layout.layoutInfo.width,
@@ -5550,7 +5540,7 @@ class Qo extends Y {
5550
5540
  ), this.itemResize$ = this.spineItemsManager.items$.pipe(
5551
5541
  v((n) => {
5552
5542
  const o = n.map(
5553
- (s) => ve(s.element).pipe(
5543
+ (s) => Te(s.element).pipe(
5554
5544
  b((r) => ({ entries: r, item: s }))
5555
5545
  )
5556
5546
  );
@@ -5676,11 +5666,11 @@ class es extends Y {
5676
5666
  ),
5677
5667
  Vt(() => {
5678
5668
  s.next(!0);
5679
- const r = this.context.manifest, a = Ve(r) ?? !1;
5669
+ const r = this.context.manifest, a = je(r) ?? !1;
5680
5670
  return W(this.spineItemsManager.items).pipe(
5681
- Ke(
5671
+ Qe(
5682
5672
  (u, d, g) => u.pipe(
5683
- Kt(
5673
+ Qt(
5684
5674
  ({ horizontalOffset: l, verticalOffset: p, pages: h }) => ts({
5685
5675
  context: this.context,
5686
5676
  horizontalOffset: l,
@@ -5708,7 +5698,7 @@ class es extends Y {
5708
5698
  ),
5709
5699
  w({ horizontalOffset: 0, verticalOffset: 0, pages: [] })
5710
5700
  ),
5711
- Kt((u) => u),
5701
+ Qt((u) => u),
5712
5702
  ut(() => {
5713
5703
  s.next(!1);
5714
5704
  })
@@ -5745,7 +5735,7 @@ class is extends Y {
5745
5735
  super(), this.context = t, this.spineItemsManager = i, this.spineLocator = n, this.settings = o, this.spineLayout = s, this.forcedOpenSubject = new k([]);
5746
5736
  const r = this.forcedOpenSubject.pipe(
5747
5737
  b((u) => [...new Set(u.flat())].sort()),
5748
- E(ii),
5738
+ E(ni),
5749
5739
  et({ bufferSize: 1, refCount: !0 })
5750
5740
  );
5751
5741
  x(
@@ -5791,7 +5781,7 @@ class is extends Y {
5791
5781
  super.destroy(), this.forcedOpenSubject.complete();
5792
5782
  }
5793
5783
  }
5794
- const Ue = (e, t, i) => {
5784
+ const He = (e, t, i) => {
5795
5785
  const n = (i.width - t.width) / 2, o = (i.height - t.height) / 2;
5796
5786
  return new Yt({
5797
5787
  x: e.x - n,
@@ -5865,7 +5855,7 @@ const ss = ({
5865
5855
  }) => {
5866
5856
  const o = e / n.width;
5867
5857
  return t / n.height >= i && o >= i;
5868
- }, He = ({
5858
+ }, Ee = ({
5869
5859
  itemPosition: {
5870
5860
  bottom: e,
5871
5861
  left: t,
@@ -5930,7 +5920,7 @@ const ss = ({
5930
5920
  itemIndex: t.getSpineItemIndex(n.item) ?? 0,
5931
5921
  currentAbsolutePage: o
5932
5922
  };
5933
- }, Ee = ({
5923
+ }, Be = ({
5934
5924
  position: e,
5935
5925
  spineItemsManager: t,
5936
5926
  spineLayout: i,
@@ -5957,21 +5947,21 @@ const ss = ({
5957
5947
  useAbsoluteViewport: r = !0,
5958
5948
  viewport: a
5959
5949
  }) => {
5960
- const c = Ee({
5950
+ const c = Be({
5961
5951
  position: e,
5962
5952
  settings: o,
5963
5953
  spineItemsManager: n,
5964
5954
  spineLayout: s
5965
5955
  }) || n.get(0), u = n.items.reduce(
5966
5956
  (h, m) => {
5967
- const S = s.getSpineItemSpineLayoutInfo(m), f = r ? a.absoluteViewport : a.relativeViewport, y = Ue(
5957
+ const S = s.getSpineItemSpineLayoutInfo(m), f = r ? a.absoluteViewport : a.relativeViewport, y = He(
5968
5958
  e,
5969
5959
  a.absoluteViewport,
5970
5960
  f
5971
5961
  ), I = yt.from(
5972
5962
  y,
5973
5963
  f
5974
- ), { visible: P } = He({
5964
+ ), { visible: P } = Ee({
5975
5965
  itemPosition: S,
5976
5966
  threshold: t,
5977
5967
  viewportPosition: I,
@@ -6054,20 +6044,20 @@ const ss = ({
6054
6044
  };
6055
6045
  }).reduce(
6056
6046
  (O, { absolutePosition: B, index: dt }) => {
6057
- const Q = f ? y.absoluteViewport : y.relativeViewport, Be = Ue(
6047
+ const Q = f ? y.absoluteViewport : y.relativeViewport, _e = He(
6058
6048
  p,
6059
6049
  y.absoluteViewport,
6060
6050
  Q
6061
- ), _e = yt.from(
6062
- Be,
6051
+ ), Xe = yt.from(
6052
+ _e,
6063
6053
  Q
6064
- ), { visible: Xe } = He({
6065
- viewportPosition: _e,
6054
+ ), { visible: qe } = Ee({
6055
+ viewportPosition: Xe,
6066
6056
  restrictToScreen: S,
6067
6057
  threshold: h,
6068
6058
  itemPosition: B
6069
6059
  });
6070
- return Xe ? [...O, dt] : O;
6060
+ return qe ? [...O, dt] : O;
6071
6061
  },
6072
6062
  []
6073
6063
  ), L = $[0], C = $[$.length - 1] ?? L;
@@ -6098,7 +6088,7 @@ const ss = ({
6098
6088
  }),
6099
6089
  getSpinePositionFromSpineItem: a,
6100
6090
  getSpineItemPositionFromSpinePosition: r,
6101
- getSpineItemFromPosition: (p) => Ee({
6091
+ getSpineItemFromPosition: (p) => Be({
6102
6092
  position: p,
6103
6093
  settings: n,
6104
6094
  spineItemsManager: e,
@@ -6133,7 +6123,7 @@ const ss = ({
6133
6123
  };
6134
6124
  class gs extends Y {
6135
6125
  constructor(t, i, n, o, s, r, a, c) {
6136
- super(), this.parentElement$ = t, this.context = i, this.pagination = n, this.spineItemsManager = o, this.spineItemLocator = s, this.settings = r, this.hookManager = a, this.viewport = c, this.elementSubject = new k(Li()), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new es(
6126
+ super(), this.parentElement$ = t, this.context = i, this.pagination = n, this.spineItemsManager = o, this.spineItemLocator = s, this.settings = r, this.hookManager = a, this.viewport = c, this.elementSubject = new k(Fi()), this.element$ = this.elementSubject.asObservable(), this.spineLayout = new es(
6137
6127
  o,
6138
6128
  i,
6139
6129
  r,
@@ -6159,7 +6149,7 @@ class gs extends Y {
6159
6149
  z((g) => {
6160
6150
  this.spineItemsManager.destroyItems();
6161
6151
  const l = g.spineItems.map(
6162
- (p, h) => new ze(
6152
+ (p, h) => new Ue(
6163
6153
  p,
6164
6154
  this.elementSubject.getValue(),
6165
6155
  this.context,
@@ -6205,7 +6195,7 @@ class ls extends Y {
6205
6195
  return n > o ? "after" : n === o ? "same" : "before";
6206
6196
  }
6207
6197
  getSpineItemIndex(t) {
6208
- const i = t instanceof ze ? t : this.get(t);
6198
+ const i = t instanceof Ue ? t : this.get(t);
6209
6199
  if (!i) return;
6210
6200
  const n = this.orderedSpineItemsSubject.value.indexOf(i);
6211
6201
  return n < 0 ? void 0 : n;
@@ -6218,7 +6208,7 @@ class ls extends Y {
6218
6208
  }
6219
6209
  // @todo move
6220
6210
  getSpineItemFromCfi(t) {
6221
- const { itemIndex: i } = Ae(t);
6211
+ const { itemIndex: i } = Zt(t);
6222
6212
  if (i !== void 0)
6223
6213
  return this.get(i);
6224
6214
  }
@@ -6290,7 +6280,7 @@ class ps extends bt {
6290
6280
  const hs = (e) => {
6291
6281
  const t = new U(), i = new po(), n = new go(), o = new Zo(e, n), s = new lo(n, o), r = new ls(n, o), a = new k(
6292
6282
  void 0
6293
- ), c = new ps(n), u = a.pipe(tt(ct)), d = We({
6283
+ ), c = new ps(n), u = a.pipe(tt(ct)), d = ze({
6294
6284
  context: n,
6295
6285
  settings: o
6296
6286
  }), g = new Xo(n, r), l = new gs(
@@ -6361,14 +6351,14 @@ const hs = (e) => {
6361
6351
  spine: l,
6362
6352
  hookManager: i,
6363
6353
  cfi: {
6364
- generateCfiFromRange: An,
6365
- generateCfiFromSelection: On,
6366
- parseCfi: Ae,
6354
+ generateCfiFromRange: Rn,
6355
+ generateCfiFromSelection: An,
6356
+ parseCfi: Zt,
6367
6357
  generateCfiForSpineItemPage: (y) => Wt({
6368
6358
  ...y,
6369
6359
  spineItemLocator: d
6370
6360
  }),
6371
- resolveCfi: (y) => Oe({ ...y, spineItemsManager: r })
6361
+ resolveCfi: (y) => De({ ...y, spineItemsManager: r })
6372
6362
  },
6373
6363
  navigation: p,
6374
6364
  spineItemsObserver: l.spineItemsObserver,
@@ -6412,22 +6402,22 @@ const hs = (e) => {
6412
6402
  }, vs = (
6413
6403
  //__
6414
6404
  eo(
6415
- Wi(
6416
- bn(
6405
+ ki(
6406
+ Sn(
6417
6407
  oo(
6418
- ki(
6419
- Si(
6408
+ ji(
6409
+ yi(
6420
6410
  Gn(
6421
6411
  no(
6422
6412
  ao(
6423
- Rn(
6424
- an(
6425
- wn(
6426
- bi(
6413
+ Cn(
6414
+ rn(
6415
+ In(
6416
+ Si(
6427
6417
  io(
6428
6418
  qn(
6429
- mn(
6430
- Di(
6419
+ hn(
6420
+ Oi(
6431
6421
  // __
6432
6422
  hs
6433
6423
  )
@@ -6454,25 +6444,25 @@ export {
6454
6444
  po as HookManager,
6455
6445
  qt as ResourceHandler,
6456
6446
  Yo as SettingsManager,
6457
- ze as SpineItem,
6447
+ Ue as SpineItem,
6458
6448
  vs as createReader,
6459
- ee as deferIdle,
6460
- Ni as deferNextResult,
6461
- te as getAttributeValueFromString,
6449
+ ie as deferIdle,
6450
+ Di as deferNextResult,
6451
+ ee as getAttributeValueFromString,
6462
6452
  Bt as getFrameViewportInfo,
6463
- xe as idle,
6464
- hi as injectCSS,
6465
- be as isHtmlElement,
6466
- Ci as isHtmlTagElement,
6453
+ Fe as idle,
6454
+ pi as injectCSS,
6455
+ Pe as isHtmlElement,
6456
+ Mi as isHtmlTagElement,
6467
6457
  Ts as isShallowEqual,
6468
- Pe as mapKeysTo,
6458
+ $e as mapKeysTo,
6469
6459
  Is as observeIntersection,
6470
- ie as observeMutation,
6471
- ve as observeResize,
6472
- mi as removeCSS,
6460
+ ne as observeMutation,
6461
+ Te as observeResize,
6462
+ hi as removeCSS,
6473
6463
  ot as upsertCSSToFrame,
6474
- fi as waitForFrameLoad,
6475
- yi as waitForFrameReady,
6464
+ mi as waitForFrameLoad,
6465
+ fi as waitForFrameReady,
6476
6466
  Ct as waitForSwitch,
6477
6467
  Xt as watchKeys
6478
6468
  };