@prose-reader/core 1.271.0 → 1.273.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/cfi/generate.d.ts +4 -6
- package/dist/createReaderWithEnhancer.d.ts +4 -4
- package/dist/index.js +712 -715
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +21 -21
- package/dist/index.umd.cjs.map +1 -1
- package/dist/reader.d.ts +5 -5
- package/dist/utils/objects.d.ts +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { switchMap as w, of as v, fromEvent as X, take as $t, map as S, from as k, takeUntil as T, Observable as ce, defer as Tt, Subject as
|
|
1
|
+
import { switchMap as w, of as v, fromEvent as X, take as $t, map as S, from as k, takeUntil as T, Observable as ce, defer as Tt, Subject as N, combineLatest as j, merge as P, EMPTY as _, NEVER as he, tap as x, share as D, BehaviorSubject as q, distinctUntilChanged as R, filter as C, mergeMap as ge, first as U, endWith as fe, catchError as ze, finalize as me, lastValueFrom as nn, scheduled as on, animationFrameScheduler as re, exhaustMap as sn, debounceTime as Ie, withLatestFrom as z, throttleTime as rn, startWith as ne, shareReplay as J, switchScan as an, defaultIfEmpty as cn, forkJoin as un, delay as Pe, timer as Te, skip as Ft, ReplaySubject as ot, identity as xe, concatMap as ln } from "rxjs";
|
|
2
2
|
import { Report as dn, isShallowEqual as O, shallowMergeIfDefined as $e, getParentPath as pn, parseContentType as gn, detectMimeTypeFromName as Me, arrayEqual as hn } from "@prose-reader/shared";
|
|
3
|
-
import { isShallowEqual as
|
|
4
|
-
import { switchMap as Y, first as mn, map as ie, distinctUntilChanged as be, startWith as fn, shareReplay as Ge, tap as V, pairwise as yn, take as Sn, takeUntil as K, filter as
|
|
3
|
+
import { isShallowEqual as nr } from "@prose-reader/shared";
|
|
4
|
+
import { switchMap as Y, first as mn, map as ie, distinctUntilChanged as be, startWith as fn, shareReplay as Ge, tap as V, pairwise as yn, take as Sn, takeUntil as K, filter as pe, debounceTime as In, skip as Lt, mergeMap as bn, catchError as st, share as vn } from "rxjs/operators";
|
|
5
5
|
import { generate as We, parse as Mt, isIndirectionOnly as wn, isParsedCfiRange as Pn, resolve as xn } from "@prose-reader/cfi";
|
|
6
6
|
const $n = "@prose-reader/core", A = dn.namespace($n, void 0, {
|
|
7
7
|
color: "#98cde7"
|
|
@@ -136,7 +136,7 @@ const Cn = (n, e) => {
|
|
|
136
136
|
// JavaScript files
|
|
137
137
|
].join(",");
|
|
138
138
|
return Array.from(n?.querySelectorAll(e) || []);
|
|
139
|
-
},
|
|
139
|
+
}, Nn = (n) => {
|
|
140
140
|
if (Et(n).forEach((t) => {
|
|
141
141
|
const i = t.getAttribute("src") || t.getAttribute("href");
|
|
142
142
|
i?.startsWith("blob:") && n?.defaultView?.URL.revokeObjectURL(i);
|
|
@@ -171,7 +171,7 @@ function At(n) {
|
|
|
171
171
|
// biome-ignore lint/suspicious/noExplicitAny: TODO
|
|
172
172
|
) && n.nodeType === Node.ELEMENT_NODE;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Rn(n, e) {
|
|
175
175
|
return At(n) && n.tagName.toLowerCase() === e.toLowerCase();
|
|
176
176
|
}
|
|
177
177
|
function On(n) {
|
|
@@ -203,7 +203,7 @@ const Ce = (n, e, t, i) => {
|
|
|
203
203
|
return i && Number.parseFloat(o) || 0;
|
|
204
204
|
}, Vn = (n, e, t, i) => {
|
|
205
205
|
n?.contentDocument?.head && Ce(n.contentDocument, e, t, i);
|
|
206
|
-
},
|
|
206
|
+
}, _s = (n, e) => {
|
|
207
207
|
n?.contentDocument && Ee(n.contentDocument, e);
|
|
208
208
|
}, oe = (n, e, t, i) => {
|
|
209
209
|
if (!n) return;
|
|
@@ -288,7 +288,7 @@ const Ce = (n, e, t, i) => {
|
|
|
288
288
|
const s = t.spineItemsManager.get(i)?.renderer.getDocumentFrame();
|
|
289
289
|
s && s.contentDocument?.body.setAttribute("tabindex", "-1");
|
|
290
290
|
}), t;
|
|
291
|
-
},
|
|
291
|
+
}, Ne = ({
|
|
292
292
|
position: n,
|
|
293
293
|
frameElement: e
|
|
294
294
|
}) => {
|
|
@@ -303,7 +303,7 @@ const Ce = (n, e, t, i) => {
|
|
|
303
303
|
const s = t.getSpineItemFromIframe(o), r = o, { height: a, width: c } = i.pageSize;
|
|
304
304
|
if (!s || !(r instanceof HTMLIFrameElement)) return n;
|
|
305
305
|
if (Ze(n)) {
|
|
306
|
-
const { clientX: u, clientY: l } =
|
|
306
|
+
const { clientX: u, clientY: l } = Ne({
|
|
307
307
|
position: n,
|
|
308
308
|
frameElement: r
|
|
309
309
|
}), d = new PointerEvent(n.type, {
|
|
@@ -318,7 +318,7 @@ const Ce = (n, e, t, i) => {
|
|
|
318
318
|
}), d;
|
|
319
319
|
}
|
|
320
320
|
if (En(n)) {
|
|
321
|
-
const { clientX: u, clientY: l } =
|
|
321
|
+
const { clientX: u, clientY: l } = Ne({
|
|
322
322
|
position: n,
|
|
323
323
|
frameElement: r
|
|
324
324
|
}), d = new MouseEvent(n.type, {
|
|
@@ -333,15 +333,15 @@ const Ce = (n, e, t, i) => {
|
|
|
333
333
|
}
|
|
334
334
|
if (Dn(n)) {
|
|
335
335
|
const u = Array.from(n.touches).map((d) => {
|
|
336
|
-
const { clientX:
|
|
336
|
+
const { clientX: g, clientY: p } = Ne({
|
|
337
337
|
position: d,
|
|
338
338
|
frameElement: r
|
|
339
339
|
});
|
|
340
340
|
return new Touch({
|
|
341
341
|
identifier: d.identifier,
|
|
342
342
|
target: d.target,
|
|
343
|
-
clientX:
|
|
344
|
-
clientY:
|
|
343
|
+
clientX: g,
|
|
344
|
+
clientY: p
|
|
345
345
|
});
|
|
346
346
|
}), l = new TouchEvent(n.type, {
|
|
347
347
|
touches: u,
|
|
@@ -377,13 +377,13 @@ const Ce = (n, e, t, i) => {
|
|
|
377
377
|
const u = (l) => {
|
|
378
378
|
let d = l;
|
|
379
379
|
if (Ze(l) && (d = new PointerEvent(l.type, l)), d !== l) {
|
|
380
|
-
const
|
|
380
|
+
const g = Wn(
|
|
381
381
|
d,
|
|
382
382
|
l,
|
|
383
383
|
t.spine.locator,
|
|
384
384
|
t.viewport
|
|
385
385
|
);
|
|
386
|
-
t.context.value.rootElement?.dispatchEvent(
|
|
386
|
+
t.context.value.rootElement?.dispatchEvent(g);
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
389
|
return r.contentDocument?.addEventListener(c, u), () => {
|
|
@@ -397,13 +397,24 @@ const Ce = (n, e, t, i) => {
|
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
), t;
|
|
400
|
-
},
|
|
401
|
-
|
|
400
|
+
}, Hs = (n) => {
|
|
401
|
+
const e = new FileReader();
|
|
402
|
+
return new Promise((t) => {
|
|
403
|
+
e.addEventListener(
|
|
404
|
+
"load",
|
|
405
|
+
() => {
|
|
406
|
+
t(e.result);
|
|
407
|
+
},
|
|
408
|
+
!1
|
|
409
|
+
), e.readAsDataURL(n);
|
|
410
|
+
});
|
|
411
|
+
}, Xn = (n, e) => Object.entries(n).reduce(
|
|
412
|
+
(t, [i, o]) => e.includes(i) ? {
|
|
402
413
|
...t,
|
|
403
414
|
[i]: o
|
|
404
415
|
} : t,
|
|
405
416
|
{}
|
|
406
|
-
)), Ke = (n) => (e) => e.pipe(
|
|
417
|
+
), Nt = (n) => ie((e) => Xn(e, n)), Ke = (n) => (e) => e.pipe(Nt(n), be(O));
|
|
407
418
|
function Qe(n) {
|
|
408
419
|
return new ce((e) => {
|
|
409
420
|
const t = new ResizeObserver((i) => {
|
|
@@ -421,7 +432,7 @@ const De = (n) => (e) => e.pipe(
|
|
|
421
432
|
ie(() => t)
|
|
422
433
|
)
|
|
423
434
|
)
|
|
424
|
-
),
|
|
435
|
+
), Yn = (n) => {
|
|
425
436
|
let e;
|
|
426
437
|
const t = n.subscribe((i) => {
|
|
427
438
|
e = { result: i };
|
|
@@ -451,7 +462,7 @@ const ct = (n, e) => new ce((t) => {
|
|
|
451
462
|
});
|
|
452
463
|
return i.observe(n, e), () => i.disconnect();
|
|
453
464
|
});
|
|
454
|
-
function
|
|
465
|
+
function Bs(n, e) {
|
|
455
466
|
return new ce((t) => {
|
|
456
467
|
const i = new IntersectionObserver((o) => {
|
|
457
468
|
t.next(o);
|
|
@@ -461,7 +472,7 @@ function _s(n, e) {
|
|
|
461
472
|
};
|
|
462
473
|
});
|
|
463
474
|
}
|
|
464
|
-
class
|
|
475
|
+
class Rt {
|
|
465
476
|
constructor(e, t) {
|
|
466
477
|
this.settingsManager = t;
|
|
467
478
|
const i = $e(
|
|
@@ -471,7 +482,7 @@ class Nt {
|
|
|
471
482
|
this.outputSettings = this.computeOutputSettings(i), this.inputSettings = $e(
|
|
472
483
|
this.getDefaultSettings(),
|
|
473
484
|
e
|
|
474
|
-
), this.outputSettingsUpdateSubject = new
|
|
485
|
+
), this.outputSettingsUpdateSubject = new N(), this.values$ = j([
|
|
475
486
|
this.settingsManager.values$,
|
|
476
487
|
this.outputSettingsUpdateSubject.pipe(fn(this.outputSettings))
|
|
477
488
|
]).pipe(
|
|
@@ -509,19 +520,7 @@ class Nt {
|
|
|
509
520
|
this.outputSettingsUpdateSubject.complete();
|
|
510
521
|
}
|
|
511
522
|
}
|
|
512
|
-
|
|
513
|
-
const e = new FileReader();
|
|
514
|
-
return new Promise((t) => {
|
|
515
|
-
e.addEventListener(
|
|
516
|
-
"load",
|
|
517
|
-
() => {
|
|
518
|
-
t(e.result);
|
|
519
|
-
},
|
|
520
|
-
!1
|
|
521
|
-
), e.readAsDataURL(n);
|
|
522
|
-
});
|
|
523
|
-
};
|
|
524
|
-
let Yn = class extends Nt {
|
|
523
|
+
let qn = class extends Rt {
|
|
525
524
|
computeOutputSettings(e) {
|
|
526
525
|
return e;
|
|
527
526
|
}
|
|
@@ -547,8 +546,8 @@ let Yn = class extends Nt {
|
|
|
547
546
|
};
|
|
548
547
|
}
|
|
549
548
|
};
|
|
550
|
-
const
|
|
551
|
-
const { fontScale: t, lineHeight: i, fontWeight: o, fontJustification: s } = e, r = new
|
|
549
|
+
const Gn = (n) => (e) => {
|
|
550
|
+
const { fontScale: t, lineHeight: i, fontWeight: o, fontJustification: s } = e, r = new N(), a = n(e), c = new qn(
|
|
552
551
|
{
|
|
553
552
|
fontScale: t,
|
|
554
553
|
lineHeight: i,
|
|
@@ -564,24 +563,24 @@ const qn = (n) => (e) => {
|
|
|
564
563
|
${c.values.fontWeight !== "publisher" ? `font-weight: ${c.values.fontWeight} !important;` : ""}
|
|
565
564
|
${c.values.fontJustification !== "publisher" ? `text-align: ${c.values.fontJustification} !important;` : ""}
|
|
566
565
|
}
|
|
567
|
-
`, l = (
|
|
568
|
-
a.spineItemsManager.items.forEach((
|
|
569
|
-
if (
|
|
570
|
-
const h =
|
|
566
|
+
`, l = (g) => {
|
|
567
|
+
a.spineItemsManager.items.forEach((p) => {
|
|
568
|
+
if (p.renditionLayout !== "pre-paginated") {
|
|
569
|
+
const h = p.renderer.getDocumentFrame();
|
|
571
570
|
h && oe(h, "prose-reader-fonts", u());
|
|
572
571
|
}
|
|
573
|
-
}),
|
|
572
|
+
}), g && a.layout();
|
|
574
573
|
};
|
|
575
|
-
a.hookManager.register("item.onDocumentLoad", ({ itemId:
|
|
576
|
-
const
|
|
577
|
-
if (
|
|
578
|
-
const h =
|
|
574
|
+
a.hookManager.register("item.onDocumentLoad", ({ itemId: g }) => {
|
|
575
|
+
const p = a.spineItemsManager.get(g);
|
|
576
|
+
if (p?.renditionLayout !== "pre-paginated") {
|
|
577
|
+
const h = p?.renderer.getDocumentFrame();
|
|
579
578
|
h && oe(h, "prose-reader-fonts", u());
|
|
580
579
|
}
|
|
581
580
|
});
|
|
582
|
-
const d = (
|
|
581
|
+
const d = (g) => g.pipe(
|
|
583
582
|
yn(),
|
|
584
|
-
S(([
|
|
583
|
+
S(([p, h]) => h.fontScale !== p.fontScale || h.lineHeight !== p.lineHeight)
|
|
585
584
|
);
|
|
586
585
|
return c.values$.pipe(
|
|
587
586
|
d,
|
|
@@ -594,7 +593,7 @@ const qn = (n) => (e) => {
|
|
|
594
593
|
},
|
|
595
594
|
settings: c
|
|
596
595
|
};
|
|
597
|
-
},
|
|
596
|
+
}, Zn = (n) => (e) => {
|
|
598
597
|
const t = n(e), i = (o) => X(o, "keyup").pipe(
|
|
599
598
|
S((s) => {
|
|
600
599
|
const { pageTurnDirection: r, computedPageTurnMode: a } = t.settings.values;
|
|
@@ -630,13 +629,13 @@ const qn = (n) => (e) => {
|
|
|
630
629
|
),
|
|
631
630
|
T(t.$.destroy$)
|
|
632
631
|
).subscribe(), t;
|
|
633
|
-
},
|
|
632
|
+
}, Jn = (n) => n.spine.spineItemsManager.items$.pipe(
|
|
634
633
|
w(
|
|
635
634
|
(e) => P(
|
|
636
635
|
...e.map((t) => t.watch("isLoaded").pipe(
|
|
637
636
|
w(() => {
|
|
638
637
|
const i = t.renderer.getDocumentFrame();
|
|
639
|
-
if (!i || !i?.contentDocument) return
|
|
638
|
+
if (!i || !i?.contentDocument) return he;
|
|
640
639
|
const s = Array.from(
|
|
641
640
|
i.contentDocument.querySelectorAll("a")
|
|
642
641
|
).map(
|
|
@@ -647,14 +646,14 @@ const qn = (n) => (e) => {
|
|
|
647
646
|
))
|
|
648
647
|
)
|
|
649
648
|
),
|
|
650
|
-
|
|
649
|
+
x((e) => {
|
|
651
650
|
e.preventDefault();
|
|
652
651
|
}),
|
|
653
652
|
D()
|
|
654
653
|
);
|
|
655
654
|
class Q extends ce {
|
|
656
655
|
constructor(e) {
|
|
657
|
-
super((t) => this.stateSubject.pipe(T(this._destroy$)).subscribe(t)), this._destroy$ = new
|
|
656
|
+
super((t) => this.stateSubject.pipe(T(this._destroy$)).subscribe(t)), this._destroy$ = new N(), this.destroy$ = this._destroy$.asObservable(), this.stateSubject = new q(e);
|
|
658
657
|
}
|
|
659
658
|
next(e) {
|
|
660
659
|
this.stateSubject.next(e);
|
|
@@ -669,7 +668,7 @@ class Q extends ce {
|
|
|
669
668
|
watch(e) {
|
|
670
669
|
return Array.isArray(e) ? this.stateSubject.pipe(Ke(e)) : this.stateSubject.pipe(
|
|
671
670
|
S((t) => t[e]),
|
|
672
|
-
|
|
671
|
+
R(O)
|
|
673
672
|
);
|
|
674
673
|
}
|
|
675
674
|
get value() {
|
|
@@ -684,15 +683,15 @@ const Le = class Le extends Q {
|
|
|
684
683
|
super({
|
|
685
684
|
state: "idle",
|
|
686
685
|
error: void 0
|
|
687
|
-
}), this.triggerSubject = new
|
|
686
|
+
}), this.triggerSubject = new N(), this.context = e.context, this.settings = e.settings, this.hookManager = e.hookManager, this.item = e.item, this.containerElement = e.containerElement, this.resourcesHandler = e.resourcesHandler, this.viewport = e.viewport;
|
|
688
687
|
const t = this.triggerSubject.pipe(
|
|
689
688
|
C((o) => o.type === "unload")
|
|
690
689
|
), i = this.triggerSubject.pipe(
|
|
691
690
|
C((o) => o.type === "load")
|
|
692
691
|
);
|
|
693
692
|
this.loaded$ = i.pipe(
|
|
694
|
-
|
|
695
|
-
|
|
693
|
+
ge(() => this.value.state === "loaded" || this.value.state === "loading" ? _ : (this.next({ state: "loading", error: void 0 }), this.onCreateDocument().pipe(U()).pipe(
|
|
694
|
+
ge((r) => (this.hookManager.execute("item.onDocumentCreated", this.item.id, {
|
|
696
695
|
itemId: this.item.id,
|
|
697
696
|
documentContainer: r
|
|
698
697
|
}), this.onLoadDocument().pipe(
|
|
@@ -717,7 +716,7 @@ const Le = class Le extends Q {
|
|
|
717
716
|
))),
|
|
718
717
|
D()
|
|
719
718
|
), this.unloaded$ = t.pipe(
|
|
720
|
-
|
|
719
|
+
ge(() => this.value.state === "unloading" || this.value.state === "idle" ? _ : (this.next({ state: "unloading", error: void 0 }), this.context.bridgeEvent.viewportFree$.pipe(
|
|
721
720
|
U(),
|
|
722
721
|
w(() => (this.hookManager.destroy("item.onDocumentLoad", this.item.id), this.onUnload().pipe(fe(null), U()))),
|
|
723
722
|
S(() => {
|
|
@@ -758,7 +757,7 @@ const Le = class Le extends Q {
|
|
|
758
757
|
* Automatically release on complete or error.
|
|
759
758
|
*/
|
|
760
759
|
renderHeadless() {
|
|
761
|
-
const e = new
|
|
760
|
+
const e = new N();
|
|
762
761
|
return Tt(() => this.onRenderHeadless({ release: e })).pipe(
|
|
763
762
|
fe(void 0),
|
|
764
763
|
U(),
|
|
@@ -803,7 +802,7 @@ const Le = class Le extends Q {
|
|
|
803
802
|
};
|
|
804
803
|
Le.DOCUMENT_CONTAINER_CLASS_NAME = "prose-reader-document-container";
|
|
805
804
|
let ye = Le;
|
|
806
|
-
const
|
|
805
|
+
const Kn = (n) => new URL(n.href);
|
|
807
806
|
class tt {
|
|
808
807
|
constructor(e, t) {
|
|
809
808
|
this.item = e, this.settings = t;
|
|
@@ -811,7 +810,7 @@ class tt {
|
|
|
811
810
|
async getResource() {
|
|
812
811
|
return await nn(
|
|
813
812
|
this.settings.values.getResource?.(this.item) ?? v(void 0)
|
|
814
|
-
) ??
|
|
813
|
+
) ?? Kn(this.item);
|
|
815
814
|
}
|
|
816
815
|
async fetchResource() {
|
|
817
816
|
const e = await this.getResource();
|
|
@@ -821,7 +820,7 @@ class tt {
|
|
|
821
820
|
const Ot = (n, e) => {
|
|
822
821
|
const t = n.startsWith("file://"), i = t ? n.replace("file://", "http://") : n, o = new URL(e, i).toString();
|
|
823
822
|
return t ? o.replace("http://", "file://") : o;
|
|
824
|
-
},
|
|
823
|
+
}, Qn = async (n, e, t, i, o) => {
|
|
825
824
|
if (!n || !n.defaultView) return;
|
|
826
825
|
const s = e.sheet;
|
|
827
826
|
if (s)
|
|
@@ -832,7 +831,7 @@ const Ot = (n, e) => {
|
|
|
832
831
|
if (n.defaultView && c instanceof n.defaultView.CSSFontFaceRule) {
|
|
833
832
|
const u = c.style.getPropertyValue("src");
|
|
834
833
|
if (u.match(/url\(['"]?([^'"]+)['"]?\)/g)) {
|
|
835
|
-
const d = u.split(",").map((h) => h.trim()),
|
|
834
|
+
const d = u.split(",").map((h) => h.trim()), g = await Promise.all(
|
|
836
835
|
d.map(async (h) => {
|
|
837
836
|
if (h.startsWith("local("))
|
|
838
837
|
return h;
|
|
@@ -846,10 +845,10 @@ const Ot = (n, e) => {
|
|
|
846
845
|
try {
|
|
847
846
|
const b = await I.getResource();
|
|
848
847
|
if (b instanceof Response) {
|
|
849
|
-
const F = await b.blob(),
|
|
848
|
+
const F = await b.blob(), $ = n.defaultView?.URL.createObjectURL(F);
|
|
850
849
|
return h.replace(
|
|
851
850
|
m[0],
|
|
852
|
-
`url("${
|
|
851
|
+
`url("${$}")`
|
|
853
852
|
);
|
|
854
853
|
}
|
|
855
854
|
} catch (b) {
|
|
@@ -858,18 +857,18 @@ const Ot = (n, e) => {
|
|
|
858
857
|
}
|
|
859
858
|
return h;
|
|
860
859
|
})
|
|
861
|
-
),
|
|
860
|
+
), p = c.cssText.replace(
|
|
862
861
|
/src:\s*[^;]+;/,
|
|
863
|
-
`src: ${
|
|
862
|
+
`src: ${g.join(", ")};`
|
|
864
863
|
);
|
|
865
|
-
s.deleteRule(a), s.insertRule(
|
|
864
|
+
s.deleteRule(a), s.insertRule(p, a);
|
|
866
865
|
}
|
|
867
866
|
}
|
|
868
867
|
}
|
|
869
868
|
} catch (r) {
|
|
870
869
|
console.error("Could not access stylesheet rules:", r);
|
|
871
870
|
}
|
|
872
|
-
},
|
|
871
|
+
}, ei = (n, e, t, i, o) => {
|
|
873
872
|
const s = e.getAttribute("src") || e.getAttribute("href");
|
|
874
873
|
if (!s) return v(null);
|
|
875
874
|
const r = i.manifest?.items.find(({ href: c }) => `${Ot(t, s).toLowerCase()}`.endsWith(
|
|
@@ -878,10 +877,10 @@ const Ot = (n, e) => {
|
|
|
878
877
|
if (!r) return v(null);
|
|
879
878
|
const a = new tt(r, o);
|
|
880
879
|
return k(a.getResource()).pipe(
|
|
881
|
-
|
|
880
|
+
ge(
|
|
882
881
|
(c) => c instanceof Response ? k(c.blob()) : v(void 0)
|
|
883
882
|
),
|
|
884
|
-
|
|
883
|
+
ge((c) => {
|
|
885
884
|
if (!c)
|
|
886
885
|
return v(null);
|
|
887
886
|
const u = n?.defaultView?.URL.createObjectURL(c) ?? "";
|
|
@@ -891,7 +890,7 @@ const Ot = (n, e) => {
|
|
|
891
890
|
return new ce((l) => {
|
|
892
891
|
e.onload = async () => {
|
|
893
892
|
try {
|
|
894
|
-
e.sheet && await
|
|
893
|
+
e.sheet && await Qn(
|
|
895
894
|
n,
|
|
896
895
|
e,
|
|
897
896
|
t,
|
|
@@ -906,7 +905,7 @@ const Ot = (n, e) => {
|
|
|
906
905
|
return v(null);
|
|
907
906
|
})
|
|
908
907
|
);
|
|
909
|
-
},
|
|
908
|
+
}, ti = ({
|
|
910
909
|
settings: n,
|
|
911
910
|
item: e,
|
|
912
911
|
context: t
|
|
@@ -915,7 +914,7 @@ const Ot = (n, e) => {
|
|
|
915
914
|
const s = Et(
|
|
916
915
|
o.contentDocument
|
|
917
916
|
), r = pn(e.href), a = s.map(
|
|
918
|
-
(c) =>
|
|
917
|
+
(c) => ei(
|
|
919
918
|
o.contentDocument,
|
|
920
919
|
c,
|
|
921
920
|
r,
|
|
@@ -925,9 +924,9 @@ const Ot = (n, e) => {
|
|
|
925
924
|
);
|
|
926
925
|
return j(a).pipe(S(() => o));
|
|
927
926
|
})
|
|
928
|
-
),
|
|
929
|
-
|
|
930
|
-
},
|
|
927
|
+
), ni = (n) => {
|
|
928
|
+
Nn(n?.contentDocument);
|
|
929
|
+
}, Ys = "@prose-reader/core", qs = 0, Gs = 200, ii = [".xhtml", ".html", ".htm"], W = "prose-reader", Vt = `${W}-style`, oi = `data-${W}-id`, si = `${W}-viewport`, ri = `${W}-scroll-navigator`, ai = async (n, e) => {
|
|
931
930
|
if (typeof n == "string") return n;
|
|
932
931
|
const t = gn(n.headers.get("Content-Type") || "") || Me(e.href);
|
|
933
932
|
if (["image/jpg", "image/jpeg", "image/png", "image/webp"].some(
|
|
@@ -965,11 +964,11 @@ const Ot = (n, e) => {
|
|
|
965
964
|
</body>
|
|
966
965
|
</html>
|
|
967
966
|
` : await n.text();
|
|
968
|
-
},
|
|
967
|
+
}, ci = ({
|
|
969
968
|
item: n,
|
|
970
969
|
resourcesHandler: e
|
|
971
970
|
}) => {
|
|
972
|
-
const t = (i) =>
|
|
971
|
+
const t = (i) => ai(i, n);
|
|
973
972
|
return (i) => i.pipe(
|
|
974
973
|
w((o) => k(e.getResource()).pipe(
|
|
975
974
|
w((s) => s instanceof URL && n.href.startsWith(window.location.origin) && // we have an encoding and it's a valid html
|
|
@@ -979,7 +978,7 @@ const Ot = (n, e) => {
|
|
|
979
978
|
"text/html",
|
|
980
979
|
"text/xml"
|
|
981
980
|
].includes(n.mediaType) || // no encoding ? then try to detect html
|
|
982
|
-
!n.mediaType &&
|
|
981
|
+
!n.mediaType && ii.some(
|
|
983
982
|
(a) => n.href.endsWith(a)
|
|
984
983
|
)) ? (o?.setAttribute("src", n.href), v(o)) : (s instanceof URL ? k(e.fetchResource()) : v(s)).pipe(
|
|
985
984
|
w((a) => {
|
|
@@ -987,7 +986,7 @@ const Ot = (n, e) => {
|
|
|
987
986
|
throw new Error("Invalid resource");
|
|
988
987
|
return k(t(a));
|
|
989
988
|
}),
|
|
990
|
-
|
|
989
|
+
x((a) => {
|
|
991
990
|
if (a) {
|
|
992
991
|
const c = new Blob([a], { type: "text/html" }), u = URL.createObjectURL(c);
|
|
993
992
|
o?.setAttribute("src", u);
|
|
@@ -1001,7 +1000,7 @@ const Ot = (n, e) => {
|
|
|
1001
1000
|
))
|
|
1002
1001
|
))
|
|
1003
1002
|
);
|
|
1004
|
-
},
|
|
1003
|
+
}, ui = () => {
|
|
1005
1004
|
const n = document.createElement("iframe");
|
|
1006
1005
|
return n.frameBorder = "no", n.tabIndex = 0, n.setAttribute(
|
|
1007
1006
|
"sandbox",
|
|
@@ -1016,7 +1015,7 @@ const Ot = (n, e) => {
|
|
|
1016
1015
|
border: 0px none transparent;
|
|
1017
1016
|
padding: 0px;
|
|
1018
1017
|
`, n.setAttribute("role", "main"), n;
|
|
1019
|
-
},
|
|
1018
|
+
}, li = "body{margin:0}html,body{height:100%;width:100%}html[data-prose-reader-html-renderer-has-viewport-dimensions=false] body{display:flex}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=left] body{justify-content:flex-end}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=right] body{justify-content:flex-start}html[data-prose-reader-html-renderer-has-viewport-dimensions=false][data-prose-reader-html-renderer-spread-position=none] body{justify-content:center}:not(html.prose-reader-html-renderer-touch-enabled),:not(html.prose-reader-html-renderer-touch-enabled) body{touch-action:none}img{-webkit-user-select:none;user-select:none;-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;display:flex}html[data-prose-reader-html-renderer-has-viewport-dimensions=false] img{max-width:100%;height:100%;object-fit:contain}", jt = ({
|
|
1020
1019
|
pageHeight: n,
|
|
1021
1020
|
pageWidth: e,
|
|
1022
1021
|
frameElement: t
|
|
@@ -1031,7 +1030,7 @@ const Ot = (n, e) => {
|
|
|
1031
1030
|
}
|
|
1032
1031
|
}, ut = (n, e) => {
|
|
1033
1032
|
n.style.width = `${e.width}px`, n.style.height = `${e.height}px`;
|
|
1034
|
-
},
|
|
1033
|
+
}, di = ({
|
|
1035
1034
|
minPageSpread: n,
|
|
1036
1035
|
blankPagePosition: e,
|
|
1037
1036
|
spreadPosition: t,
|
|
@@ -1042,7 +1041,7 @@ const Ot = (n, e) => {
|
|
|
1042
1041
|
}) => {
|
|
1043
1042
|
const a = n * o;
|
|
1044
1043
|
if (s?.contentDocument && s?.contentWindow) {
|
|
1045
|
-
const { viewportDimensions: c, computedScale: u = 1 } = jt({ frameElement: s, pageHeight: i, pageWidth: o }) ?? {}, l = !!c, d = o,
|
|
1044
|
+
const { viewportDimensions: c, computedScale: u = 1 } = jt({ frameElement: s, pageHeight: i, pageWidth: o }) ?? {}, l = !!c, d = o, g = i;
|
|
1046
1045
|
if (s.contentDocument?.documentElement && s.contentDocument?.documentElement.setAttribute(
|
|
1047
1046
|
"data-prose-reader-html-renderer-has-viewport-dimensions",
|
|
1048
1047
|
l.toString()
|
|
@@ -1051,26 +1050,26 @@ const Ot = (n, e) => {
|
|
|
1051
1050
|
height: c.height ?? 1
|
|
1052
1051
|
}) : ut(s, {
|
|
1053
1052
|
width: d,
|
|
1054
|
-
height:
|
|
1053
|
+
height: g
|
|
1055
1054
|
}), c) {
|
|
1056
1055
|
s?.style.setProperty("position", "absolute"), s?.style.setProperty("top", "50%"), t === "left" ? (s?.style.setProperty("right", "0"), s?.style.removeProperty("left")) : e === "before" && r ? (s?.style.setProperty("right", "50%"), s?.style.removeProperty("left")) : t === "right" ? (s?.style.setProperty("left", "0"), s?.style.removeProperty("right")) : (s?.style.setProperty(
|
|
1057
1056
|
"left",
|
|
1058
1057
|
e === "before" ? r ? "25%" : "75%" : e === "after" ? r ? "75%" : "25%" : "50%"
|
|
1059
1058
|
), s?.style.removeProperty("right"));
|
|
1060
|
-
const
|
|
1059
|
+
const p = t !== "none" ? "0" : "-50%", h = t === "right" && e !== "before" ? "left" : t === "left" || e === "before" && r ? "right" : "center";
|
|
1061
1060
|
s?.style.setProperty(
|
|
1062
1061
|
"transform",
|
|
1063
|
-
`translate(${
|
|
1062
|
+
`translate(${p}, -50%) scale(${u})`
|
|
1064
1063
|
), s?.style.setProperty(
|
|
1065
1064
|
"transform-origin",
|
|
1066
1065
|
`${h} center`
|
|
1067
1066
|
);
|
|
1068
1067
|
} else
|
|
1069
1068
|
e === "before" ? r ? s?.style.setProperty("margin-right", `${o}px`) : s?.style.setProperty("margin-left", `${o}px`) : (s?.style.removeProperty("margin-left"), s?.style.removeProperty("margin-right"));
|
|
1070
|
-
return { width: a, height:
|
|
1069
|
+
return { width: a, height: g };
|
|
1071
1070
|
}
|
|
1072
1071
|
return { width: a, height: i };
|
|
1073
|
-
},
|
|
1072
|
+
}, pi = () => `
|
|
1074
1073
|
body {
|
|
1075
1074
|
margin: 0;
|
|
1076
1075
|
}
|
|
@@ -1087,7 +1086,7 @@ const Ot = (n, e) => {
|
|
|
1087
1086
|
html, body {
|
|
1088
1087
|
touch-action: none;
|
|
1089
1088
|
}
|
|
1090
|
-
`,
|
|
1089
|
+
`, gi = ({
|
|
1091
1090
|
isScrollable: n,
|
|
1092
1091
|
enableTouch: e
|
|
1093
1092
|
}) => `
|
|
@@ -1112,7 +1111,7 @@ const Ot = (n, e) => {
|
|
|
1112
1111
|
display: block;
|
|
1113
1112
|
}
|
|
1114
1113
|
` : ""}
|
|
1115
|
-
`,
|
|
1114
|
+
`, hi = ({
|
|
1116
1115
|
width: n,
|
|
1117
1116
|
columnHeight: e,
|
|
1118
1117
|
columnWidth: t
|
|
@@ -1180,7 +1179,7 @@ const Ot = (n, e) => {
|
|
|
1180
1179
|
td {
|
|
1181
1180
|
max-width: ${t}px;
|
|
1182
1181
|
}
|
|
1183
|
-
`,
|
|
1182
|
+
`, mi = ({
|
|
1184
1183
|
isUsingVerticalWriting: n,
|
|
1185
1184
|
minimumWidth: e,
|
|
1186
1185
|
pageHeight: t,
|
|
@@ -1196,7 +1195,7 @@ const Ot = (n, e) => {
|
|
|
1196
1195
|
};
|
|
1197
1196
|
}, ve = (n, e) => {
|
|
1198
1197
|
n.style.width = `${e.width}px`, n.style.height = `${e.height}px`;
|
|
1199
|
-
},
|
|
1198
|
+
}, fi = ({
|
|
1200
1199
|
pageHeight: n,
|
|
1201
1200
|
pageWidth: e,
|
|
1202
1201
|
frameElement: t,
|
|
@@ -1208,23 +1207,23 @@ const Ot = (n, e) => {
|
|
|
1208
1207
|
enableTouch: c,
|
|
1209
1208
|
isUsingVerticalWriting: u
|
|
1210
1209
|
}) => {
|
|
1211
|
-
const l = o * e, d = i?.renditionLayout === "reflowable" && i?.renditionFlow === "scrolled-continuous",
|
|
1212
|
-
t?.style.setProperty("width", `${e}px`), d ? t?.style.removeProperty("height") : t?.style.setProperty("height", `${
|
|
1213
|
-
const { viewportDimensions:
|
|
1210
|
+
const l = o * e, d = i?.renditionLayout === "reflowable" && i?.renditionFlow === "scrolled-continuous", g = d ? Math.min(400, n) : n;
|
|
1211
|
+
t?.style.setProperty("width", `${e}px`), d ? t?.style.removeProperty("height") : t?.style.setProperty("height", `${g}px`);
|
|
1212
|
+
const { viewportDimensions: p, computedScale: h = 1 } = jt({
|
|
1214
1213
|
frameElement: t,
|
|
1215
|
-
pageHeight:
|
|
1214
|
+
pageHeight: g,
|
|
1216
1215
|
pageWidth: e
|
|
1217
1216
|
}) ?? {}, m = i?.renditionLayout === "pre-paginated";
|
|
1218
1217
|
if (t?.contentDocument && t?.contentWindow && t.contentDocument.body) {
|
|
1219
|
-
let y = e, f =
|
|
1220
|
-
if (
|
|
1218
|
+
let y = e, f = g;
|
|
1219
|
+
if (p?.hasViewport)
|
|
1221
1220
|
oe(
|
|
1222
1221
|
t,
|
|
1223
1222
|
"prose-reader-html-renderer-framce-css",
|
|
1224
|
-
|
|
1223
|
+
pi()
|
|
1225
1224
|
), ve(t, {
|
|
1226
|
-
width:
|
|
1227
|
-
height:
|
|
1225
|
+
width: p.width ?? 1,
|
|
1226
|
+
height: p.height ?? 1
|
|
1228
1227
|
}), t?.style.setProperty("position", "absolute"), t?.style.setProperty("top", "50%"), t?.style.setProperty(
|
|
1229
1228
|
"left",
|
|
1230
1229
|
r === "before" ? s ? "25%" : "75%" : r === "after" ? s ? "75%" : "25%" : "50%"
|
|
@@ -1233,21 +1232,21 @@ const Ot = (n, e) => {
|
|
|
1233
1232
|
`translate(-50%, -50%) scale(${h})`
|
|
1234
1233
|
), t?.style.setProperty("transform-origin", "center center");
|
|
1235
1234
|
else {
|
|
1236
|
-
const b = a ?
|
|
1235
|
+
const b = a ? gi({
|
|
1237
1236
|
isScrollable: i?.renditionFlow === "scrolled-continuous",
|
|
1238
1237
|
enableTouch: c
|
|
1239
|
-
}) :
|
|
1240
|
-
|
|
1238
|
+
}) : hi(
|
|
1239
|
+
mi({
|
|
1241
1240
|
isUsingVerticalWriting: u,
|
|
1242
1241
|
minimumWidth: l,
|
|
1243
|
-
pageHeight:
|
|
1242
|
+
pageHeight: g,
|
|
1244
1243
|
pageWidth: e
|
|
1245
1244
|
})
|
|
1246
1245
|
);
|
|
1247
1246
|
if (oe(t, "prose-reader-css", b, !0), u)
|
|
1248
1247
|
f = Math.ceil(
|
|
1249
|
-
t.contentDocument.documentElement.scrollHeight /
|
|
1250
|
-
) *
|
|
1248
|
+
t.contentDocument.documentElement.scrollHeight / g
|
|
1249
|
+
) * g, ve(t, {
|
|
1251
1250
|
width: l,
|
|
1252
1251
|
height: f
|
|
1253
1252
|
});
|
|
@@ -1269,32 +1268,32 @@ const Ot = (n, e) => {
|
|
|
1269
1268
|
return y % l === 0 ? t?.style.setProperty("margin-left", "0px") : (y = y + e, s && !u && t?.style.setProperty("margin-left", `${e}px`)), { width: y, height: f };
|
|
1270
1269
|
}
|
|
1271
1270
|
};
|
|
1272
|
-
class
|
|
1271
|
+
class yi extends ye {
|
|
1273
1272
|
constructor() {
|
|
1274
1273
|
super(...arguments), this.isPrePaginated = () => this.item.renditionLayout === "pre-paginated" || !this.item.renditionLayout && this.context.manifest?.renditionLayout === "pre-paginated", this.isImageType = () => !!(this.item.mediaType ?? Me(this.item.href))?.startsWith("image/");
|
|
1275
1274
|
}
|
|
1276
1275
|
onCreateDocument() {
|
|
1277
|
-
const e =
|
|
1276
|
+
const e = ui();
|
|
1278
1277
|
return this.setDocumentContainer(e), v(e);
|
|
1279
1278
|
}
|
|
1280
1279
|
onLoadDocument() {
|
|
1281
1280
|
const e = this.getFrameElement();
|
|
1282
1281
|
if (!e) throw new Error("invalid frame");
|
|
1283
1282
|
return v(e).pipe(
|
|
1284
|
-
|
|
1283
|
+
ci({
|
|
1285
1284
|
item: this.item,
|
|
1286
1285
|
resourcesHandler: this.resourcesHandler,
|
|
1287
1286
|
settings: this.settings
|
|
1288
1287
|
}),
|
|
1289
1288
|
De(this.context.bridgeEvent.viewportFree$),
|
|
1290
|
-
|
|
1289
|
+
x(() => {
|
|
1291
1290
|
this.attach();
|
|
1292
1291
|
}),
|
|
1293
1292
|
jn,
|
|
1294
|
-
|
|
1295
|
-
this.isPrePaginated() ? oe(t, "prose-reader-css",
|
|
1293
|
+
x((t) => {
|
|
1294
|
+
this.isPrePaginated() ? oe(t, "prose-reader-css", li) : this.isImageType();
|
|
1296
1295
|
}),
|
|
1297
|
-
|
|
1296
|
+
ti({
|
|
1298
1297
|
context: this.context,
|
|
1299
1298
|
item: this.item,
|
|
1300
1299
|
settings: this.settings
|
|
@@ -1303,7 +1302,7 @@ class fi extends ye {
|
|
|
1303
1302
|
);
|
|
1304
1303
|
}
|
|
1305
1304
|
onUnload() {
|
|
1306
|
-
return
|
|
1305
|
+
return ni(this.getFrameElement()), this.detach(), _;
|
|
1307
1306
|
}
|
|
1308
1307
|
onLayout({
|
|
1309
1308
|
minPageSpread: e,
|
|
@@ -1321,7 +1320,7 @@ class fi extends ye {
|
|
|
1321
1320
|
) : r.contentDocument?.documentElement.classList.remove(
|
|
1322
1321
|
"prose-reader-html-renderer-touch-enabled"
|
|
1323
1322
|
)), this.isPrePaginated()) {
|
|
1324
|
-
const l =
|
|
1323
|
+
const l = di({
|
|
1325
1324
|
blankPagePosition: t,
|
|
1326
1325
|
frameElement: r,
|
|
1327
1326
|
isRTL: this.context.isRTL(),
|
|
@@ -1332,7 +1331,7 @@ class fi extends ye {
|
|
|
1332
1331
|
});
|
|
1333
1332
|
return v(l);
|
|
1334
1333
|
}
|
|
1335
|
-
const u =
|
|
1334
|
+
const u = fi({
|
|
1336
1335
|
pageHeight: s,
|
|
1337
1336
|
pageWidth: o,
|
|
1338
1337
|
frameElement: r,
|
|
@@ -1405,13 +1404,13 @@ class fi extends ye {
|
|
|
1405
1404
|
return this.getFrameElement();
|
|
1406
1405
|
}
|
|
1407
1406
|
}
|
|
1408
|
-
const
|
|
1407
|
+
const Si = (n) => (e) => {
|
|
1409
1408
|
const t = n({
|
|
1410
1409
|
...e,
|
|
1411
1410
|
getRenderer(o) {
|
|
1412
|
-
return e.getRenderer?.(o) ?? ((r) => new
|
|
1411
|
+
return e.getRenderer?.(o) ?? ((r) => new yi(r));
|
|
1413
1412
|
}
|
|
1414
|
-
}), i =
|
|
1413
|
+
}), i = Jn(t);
|
|
1415
1414
|
return i.pipe(T(t.$.destroy$)).subscribe(), {
|
|
1416
1415
|
...t,
|
|
1417
1416
|
links$: i
|
|
@@ -1430,12 +1429,12 @@ class E {
|
|
|
1430
1429
|
this.__symbol = /* @__PURE__ */ Symbol("SpineItemPosition"), this.x = e.x, this.y = e.y;
|
|
1431
1430
|
}
|
|
1432
1431
|
}
|
|
1433
|
-
class
|
|
1432
|
+
class Re {
|
|
1434
1433
|
constructor(e) {
|
|
1435
1434
|
this.__symbol = /* @__PURE__ */ Symbol("SpineItemPagePosition"), this.x = e.x, this.y = e.y;
|
|
1436
1435
|
}
|
|
1437
1436
|
}
|
|
1438
|
-
class
|
|
1437
|
+
class Ii extends nt {
|
|
1439
1438
|
constructor() {
|
|
1440
1439
|
super(...arguments), this.__symbol = "SpineItemPageLayout";
|
|
1441
1440
|
}
|
|
@@ -1445,7 +1444,7 @@ class Oe extends nt {
|
|
|
1445
1444
|
super(...arguments), this.__symbol = "SpineItemSpineLayout";
|
|
1446
1445
|
}
|
|
1447
1446
|
}
|
|
1448
|
-
class
|
|
1447
|
+
class bi extends nt {
|
|
1449
1448
|
constructor() {
|
|
1450
1449
|
super(...arguments), this.__symbol = "SpineItemPageSpineLayout";
|
|
1451
1450
|
}
|
|
@@ -1471,17 +1470,17 @@ class ae extends kt {
|
|
|
1471
1470
|
return new ae(e);
|
|
1472
1471
|
}
|
|
1473
1472
|
}
|
|
1474
|
-
const
|
|
1473
|
+
const vi = (n, e) => {
|
|
1475
1474
|
const t = e.getBoundingClientRect(), { x: i, y: o } = n, { left: s, top: r } = t, a = t.width / e.offsetWidth, c = t.height / e.offsetHeight, u = i - s, l = o - r;
|
|
1476
1475
|
return {
|
|
1477
1476
|
x: u / a,
|
|
1478
1477
|
y: l / c
|
|
1479
1478
|
};
|
|
1480
|
-
},
|
|
1481
|
-
|
|
1482
|
-
),
|
|
1483
|
-
getSpinePositionFromClientPosition: (e) => n.spine.element ?
|
|
1484
|
-
}),
|
|
1479
|
+
}, wi = (n, e) => new ae(
|
|
1480
|
+
vi(n, e)
|
|
1481
|
+
), Pi = (n) => ({
|
|
1482
|
+
getSpinePositionFromClientPosition: (e) => n.spine.element ? wi(e, n.spine.element) : void 0
|
|
1483
|
+
}), xi = (n) => {
|
|
1485
1484
|
let e;
|
|
1486
1485
|
const t = n.context.watch("rootElement").pipe(
|
|
1487
1486
|
Y((c) => c ? new ce(() => (e = c.ownerDocument.createElement("div"), e.style.cssText = `
|
|
@@ -1493,7 +1492,7 @@ const bi = (n, e) => {
|
|
|
1493
1492
|
visibility: hidden;
|
|
1494
1493
|
`, c.appendChild(e), () => {
|
|
1495
1494
|
e?.remove(), e = void 0;
|
|
1496
|
-
})) :
|
|
1495
|
+
})) : he)
|
|
1497
1496
|
), i = (c) => on(c, re).pipe(
|
|
1498
1497
|
V(() => {
|
|
1499
1498
|
e?.style.setProperty(
|
|
@@ -1520,7 +1519,7 @@ const bi = (n, e) => {
|
|
|
1520
1519
|
K(n.$.destroy$)
|
|
1521
1520
|
);
|
|
1522
1521
|
return P(t, a);
|
|
1523
|
-
},
|
|
1522
|
+
}, $i = `${W}-enhancer-loading`, Ut = `${$i}-container`, Ti = ({
|
|
1524
1523
|
container: n,
|
|
1525
1524
|
item: e,
|
|
1526
1525
|
viewport: t
|
|
@@ -1555,14 +1554,14 @@ const bi = (n, e) => {
|
|
|
1555
1554
|
max-width: 300px;
|
|
1556
1555
|
width: 80%;
|
|
1557
1556
|
`, i.appendChild(o), i.appendChild(s), i;
|
|
1558
|
-
},
|
|
1557
|
+
}, Fi = (n) => n.spineItemsManager.items$.pipe(
|
|
1559
1558
|
Y(
|
|
1560
1559
|
(e) => P(
|
|
1561
1560
|
...e.map((t) => {
|
|
1562
1561
|
t.containerElement.style.zIndex = "0";
|
|
1563
1562
|
const i = t.containerElement.querySelector(
|
|
1564
1563
|
`.${Ut}`
|
|
1565
|
-
), o = i instanceof HTMLElement ? i :
|
|
1564
|
+
), o = i instanceof HTMLElement ? i : Ti({
|
|
1566
1565
|
container: t.containerElement,
|
|
1567
1566
|
item: t.item,
|
|
1568
1567
|
viewport: n.viewport
|
|
@@ -1600,11 +1599,11 @@ const bi = (n, e) => {
|
|
|
1600
1599
|
})
|
|
1601
1600
|
)
|
|
1602
1601
|
)
|
|
1603
|
-
),
|
|
1602
|
+
), Li = (n) => {
|
|
1604
1603
|
n.hookManager.register("item.onDocumentLoad", ({ itemId: e }) => {
|
|
1605
1604
|
n.spineItemsManager.get(e)?.renderer.getDocumentFrame()?.setAttribute("scrolling", "no");
|
|
1606
1605
|
});
|
|
1607
|
-
},
|
|
1606
|
+
}, Mi = (n) => {
|
|
1608
1607
|
n.hookManager.register(
|
|
1609
1608
|
"item.onAfterLayout",
|
|
1610
1609
|
({ item: e, blankPagePosition: t, minimumWidth: i }) => {
|
|
@@ -1621,12 +1620,12 @@ const bi = (n, e) => {
|
|
|
1621
1620
|
}
|
|
1622
1621
|
}
|
|
1623
1622
|
);
|
|
1624
|
-
},
|
|
1625
|
-
|
|
1623
|
+
}, Ci = (n) => n.spineItemsObserver.states$.pipe(
|
|
1624
|
+
x(({ item: e, isReady: t, isDirty: i }) => {
|
|
1626
1625
|
e.containerElement.dataset.isDirty = i.toString(), e.containerElement.dataset.isReady = t.toString();
|
|
1627
1626
|
})
|
|
1628
1627
|
);
|
|
1629
|
-
let
|
|
1628
|
+
let Ei = class extends Rt {
|
|
1630
1629
|
computeOutputSettings(e) {
|
|
1631
1630
|
return e;
|
|
1632
1631
|
}
|
|
@@ -1652,21 +1651,21 @@ let Ci = class extends Nt {
|
|
|
1652
1651
|
};
|
|
1653
1652
|
}
|
|
1654
1653
|
};
|
|
1655
|
-
const
|
|
1654
|
+
const Di = (n) => j([
|
|
1656
1655
|
n.viewport.watch(["width", "height"]),
|
|
1657
1656
|
n.context.watch("manifest")
|
|
1658
1657
|
]).pipe(
|
|
1659
|
-
|
|
1658
|
+
x(([{ width: e, height: t }, i]) => {
|
|
1660
1659
|
const o = e > t;
|
|
1661
1660
|
return !o && i?.renditionSpread === "portrait" ? n.settings.update({ spreadMode: !0 }) : o && (i?.renditionSpread === void 0 || i?.renditionSpread === "auto" || i?.renditionSpread === "landscape" || i?.renditionSpread === "both") ? n.settings.update({ spreadMode: !0 }) : n.settings.update({ spreadMode: !1 });
|
|
1662
1661
|
})
|
|
1663
|
-
),
|
|
1662
|
+
), Ai = (n) => (e) => {
|
|
1664
1663
|
const {
|
|
1665
1664
|
pageHorizontalMargin: t,
|
|
1666
1665
|
pageVerticalMargin: i,
|
|
1667
1666
|
layoutAutoResize: o,
|
|
1668
1667
|
layoutLayerTransition: s
|
|
1669
|
-
} = e, r = n(e), a = new
|
|
1668
|
+
} = e, r = n(e), a = new Ei(
|
|
1670
1669
|
{
|
|
1671
1670
|
pageHorizontalMargin: t,
|
|
1672
1671
|
pageVerticalMargin: i,
|
|
@@ -1682,12 +1681,12 @@ const Ei = (n) => j([
|
|
|
1682
1681
|
!m && f && (f.getBoundingClientRect().left, m = !0);
|
|
1683
1682
|
});
|
|
1684
1683
|
}), r.hookManager.register("item.onBeforeLayout", ({ item: m }) => {
|
|
1685
|
-
const y = r.spineItemsManager.get(m.id), I = !!(m.mediaType ?? Me(m.href))?.startsWith("image/"), { pageHorizontalMargin: b = 0, pageVerticalMargin: F = 0 } = a.values,
|
|
1684
|
+
const y = r.spineItemsManager.get(m.id), I = !!(m.mediaType ?? Me(m.href))?.startsWith("image/"), { pageHorizontalMargin: b = 0, pageVerticalMargin: F = 0 } = a.values, $ = r.viewport.pageSize;
|
|
1686
1685
|
if (y?.renditionLayout === "reflowable" && !I) {
|
|
1687
|
-
let L =
|
|
1688
|
-
const H =
|
|
1689
|
-
let B =
|
|
1690
|
-
y.isUsingVerticalWriting() && (B =
|
|
1686
|
+
let L = $.width - b * 2;
|
|
1687
|
+
const H = $.height - F * 2;
|
|
1688
|
+
let B = $.width - b * 2, se = b * 2;
|
|
1689
|
+
y.isUsingVerticalWriting() && (B = $.width - b * 2, L = H, se = F * 2);
|
|
1691
1690
|
const ue = y?.renderer.getDocumentFrame();
|
|
1692
1691
|
ue && oe(
|
|
1693
1692
|
ue,
|
|
@@ -1713,7 +1712,7 @@ const Ei = (n) => j([
|
|
|
1713
1712
|
`
|
|
1714
1713
|
);
|
|
1715
1714
|
}
|
|
1716
|
-
}),
|
|
1715
|
+
}), Mi(r), Li(r), r.hookManager.register(
|
|
1717
1716
|
"item.onDocumentCreated",
|
|
1718
1717
|
({ documentContainer: m }) => {
|
|
1719
1718
|
m.style.opacity = "0", a.values.layoutLayerTransition && (m.style.transition = "opacity 300ms");
|
|
@@ -1723,22 +1722,22 @@ const Ei = (n) => j([
|
|
|
1723
1722
|
r.settings.values.computedPageTurnMode !== "scrollable" && f?.setAttribute("tab-index", "0");
|
|
1724
1723
|
});
|
|
1725
1724
|
const c = r.spineItemsObserver.states$.pipe(
|
|
1726
|
-
|
|
1725
|
+
pe(({ isReady: m }) => m),
|
|
1727
1726
|
V(({ item: m }) => {
|
|
1728
1727
|
const y = m.renderer.documentContainer;
|
|
1729
1728
|
y && (y.style.opacity = "1");
|
|
1730
1729
|
})
|
|
1731
1730
|
), u = a.values$.pipe(
|
|
1732
|
-
|
|
1731
|
+
pe(({ layoutAutoResize: m }) => m === "container"),
|
|
1733
1732
|
Y(() => r.context.watch("rootElement")),
|
|
1734
|
-
|
|
1733
|
+
pe(Z),
|
|
1735
1734
|
Y((m) => Qe(m)),
|
|
1736
1735
|
In(100),
|
|
1737
|
-
|
|
1736
|
+
pe(Z),
|
|
1738
1737
|
V(() => {
|
|
1739
1738
|
r?.layout();
|
|
1740
1739
|
})
|
|
1741
|
-
), l =
|
|
1740
|
+
), l = xi(r);
|
|
1742
1741
|
a.watch(["pageHorizontalMargin", "pageVerticalMargin"]).pipe(
|
|
1743
1742
|
Lt(1),
|
|
1744
1743
|
V(() => {
|
|
@@ -1748,14 +1747,14 @@ const Ei = (n) => j([
|
|
|
1748
1747
|
).subscribe();
|
|
1749
1748
|
const d = r.spine.pages.pipe(
|
|
1750
1749
|
Ge({ refCount: !0, bufferSize: 1 })
|
|
1751
|
-
),
|
|
1750
|
+
), g = Ci(r), p = Di(r), h = Fi(r);
|
|
1752
1751
|
return P(
|
|
1753
1752
|
c,
|
|
1754
1753
|
l,
|
|
1755
1754
|
u,
|
|
1756
1755
|
d,
|
|
1757
|
-
p,
|
|
1758
1756
|
g,
|
|
1757
|
+
p,
|
|
1759
1758
|
h
|
|
1760
1759
|
).pipe(K(r.$.destroy$)).subscribe(), {
|
|
1761
1760
|
...r,
|
|
@@ -1765,10 +1764,10 @@ const Ei = (n) => j([
|
|
|
1765
1764
|
settings: a,
|
|
1766
1765
|
layout$: r.spine.layout$,
|
|
1767
1766
|
layoutInfo$: d,
|
|
1768
|
-
coordinates:
|
|
1767
|
+
coordinates: Pi(r)
|
|
1769
1768
|
};
|
|
1770
1769
|
};
|
|
1771
|
-
class
|
|
1770
|
+
class Ni extends ye {
|
|
1772
1771
|
getImageElement() {
|
|
1773
1772
|
const e = this.documentContainer;
|
|
1774
1773
|
if (e instanceof HTMLImageElement)
|
|
@@ -1825,7 +1824,7 @@ const Ri = (n) => (e) => {
|
|
|
1825
1824
|
...e,
|
|
1826
1825
|
getRenderer(r) {
|
|
1827
1826
|
const a = e.getRenderer?.(r), u = !!(r.mediaType ?? Me(r.href))?.startsWith("image/");
|
|
1828
|
-
return !a && u ? (l) => new
|
|
1827
|
+
return !a && u ? (l) => new Ni(l) : a;
|
|
1829
1828
|
}
|
|
1830
1829
|
}), i = new IntersectionObserver(
|
|
1831
1830
|
(r) => {
|
|
@@ -1875,15 +1874,15 @@ const Ri = (n) => (e) => {
|
|
|
1875
1874
|
i.disconnect(), o.disconnect(), t.destroy();
|
|
1876
1875
|
}
|
|
1877
1876
|
};
|
|
1878
|
-
},
|
|
1879
|
-
|
|
1880
|
-
if (!
|
|
1877
|
+
}, Oi = (n, e) => n.links$.pipe(
|
|
1878
|
+
x((t) => {
|
|
1879
|
+
if (!Rn(t.target, "a") || t.type !== "click") return;
|
|
1881
1880
|
const i = new URL(t.target.href), o = `${i.origin}${i.pathname}`;
|
|
1882
1881
|
n.context.manifest?.spineItems.some(
|
|
1883
1882
|
(r) => r.href === o
|
|
1884
1883
|
) && e.goToUrl(i);
|
|
1885
1884
|
})
|
|
1886
|
-
), ee = A.namespace("navigation"),
|
|
1885
|
+
), ee = A.namespace("navigation"), Vi = ({
|
|
1887
1886
|
position: n,
|
|
1888
1887
|
spineItem: e,
|
|
1889
1888
|
pageHeight: t,
|
|
@@ -1915,7 +1914,7 @@ const Ri = (n) => (e) => {
|
|
|
1915
1914
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
1916
1915
|
n,
|
|
1917
1916
|
a
|
|
1918
|
-
), l =
|
|
1917
|
+
), l = Vi({
|
|
1919
1918
|
position: u,
|
|
1920
1919
|
spineItem: a,
|
|
1921
1920
|
pageHeight: s.pageSize.height,
|
|
@@ -1937,7 +1936,7 @@ const Ri = (n) => (e) => {
|
|
|
1937
1936
|
x: 0
|
|
1938
1937
|
})
|
|
1939
1938
|
);
|
|
1940
|
-
},
|
|
1939
|
+
}, ji = ({
|
|
1941
1940
|
position: n,
|
|
1942
1941
|
spineItem: e,
|
|
1943
1942
|
context: t,
|
|
@@ -1981,7 +1980,7 @@ const Ri = (n) => (e) => {
|
|
|
1981
1980
|
return i.getAdjustedPositionForSpread(l);
|
|
1982
1981
|
}
|
|
1983
1982
|
return i.getAdjustedPositionForSpread(u);
|
|
1984
|
-
},
|
|
1983
|
+
}, ki = ({
|
|
1985
1984
|
position: n,
|
|
1986
1985
|
spineItem: e,
|
|
1987
1986
|
pageHeight: t,
|
|
@@ -2013,7 +2012,7 @@ const Ri = (n) => (e) => {
|
|
|
2013
2012
|
const u = o.getSpineItemPositionFromSpinePosition(
|
|
2014
2013
|
n,
|
|
2015
2014
|
a
|
|
2016
|
-
), l =
|
|
2015
|
+
), l = ki({
|
|
2017
2016
|
position: u,
|
|
2018
2017
|
spineItem: a,
|
|
2019
2018
|
pageHeight: s.pageSize.height,
|
|
@@ -2035,7 +2034,7 @@ const Ri = (n) => (e) => {
|
|
|
2035
2034
|
x: 0
|
|
2036
2035
|
})
|
|
2037
2036
|
);
|
|
2038
|
-
},
|
|
2037
|
+
}, Ui = ({
|
|
2039
2038
|
position: n,
|
|
2040
2039
|
spineItem: e,
|
|
2041
2040
|
context: t,
|
|
@@ -2083,7 +2082,7 @@ const Ri = (n) => (e) => {
|
|
|
2083
2082
|
}
|
|
2084
2083
|
return i.getAdjustedPositionForSpread(u);
|
|
2085
2084
|
};
|
|
2086
|
-
class
|
|
2085
|
+
class zi {
|
|
2087
2086
|
constructor(e) {
|
|
2088
2087
|
this.reader = e, this.movingLastDelta = { x: 0, y: 0 }, this.movingLastPosition = new M({ x: 0, y: 0 }), this.unlock = void 0;
|
|
2089
2088
|
}
|
|
@@ -2102,7 +2101,7 @@ class Ui {
|
|
|
2102
2101
|
turnRightOrBottom() {
|
|
2103
2102
|
const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
|
|
2104
2103
|
if (!t) return;
|
|
2105
|
-
const i =
|
|
2104
|
+
const i = Ui({
|
|
2106
2105
|
context: this.reader.context,
|
|
2107
2106
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2108
2107
|
position: e.position,
|
|
@@ -2120,7 +2119,7 @@ class Ui {
|
|
|
2120
2119
|
turnLeftOrTop() {
|
|
2121
2120
|
const e = this.reader.navigation.getNavigation(), t = this.reader.spineItemsManager.get(e.spineItem);
|
|
2122
2121
|
if (!t) return;
|
|
2123
|
-
const i =
|
|
2122
|
+
const i = ji({
|
|
2124
2123
|
context: this.reader.context,
|
|
2125
2124
|
navigationResolver: this.reader.navigation.navigationResolver,
|
|
2126
2125
|
position: e.position,
|
|
@@ -2262,7 +2261,7 @@ class Ui {
|
|
|
2262
2261
|
}
|
|
2263
2262
|
}
|
|
2264
2263
|
}
|
|
2265
|
-
class
|
|
2264
|
+
class Wi extends Q {
|
|
2266
2265
|
constructor(e) {
|
|
2267
2266
|
super({
|
|
2268
2267
|
lastDelta: { x: 0, y: 0 },
|
|
@@ -2321,16 +2320,16 @@ class zi extends Q {
|
|
|
2321
2320
|
}
|
|
2322
2321
|
class G {
|
|
2323
2322
|
constructor() {
|
|
2324
|
-
this.isDestroyed = !1, this.destroySubject = new
|
|
2323
|
+
this.isDestroyed = !1, this.destroySubject = new N(), this.destroy$ = this.destroySubject.asObservable();
|
|
2325
2324
|
}
|
|
2326
2325
|
destroy() {
|
|
2327
2326
|
this.isDestroyed || (this.isDestroyed = !0, this.destroySubject.next(), this.destroySubject.complete());
|
|
2328
2327
|
}
|
|
2329
2328
|
}
|
|
2330
|
-
const
|
|
2331
|
-
class
|
|
2329
|
+
const _i = 500;
|
|
2330
|
+
class Hi extends G {
|
|
2332
2331
|
constructor(e, t) {
|
|
2333
|
-
super(), this.scrollNavigationController = e, this.locker = t, this.navigationSubject = new
|
|
2332
|
+
super(), this.scrollNavigationController = e, this.locker = t, this.navigationSubject = new N(), this.navigation$ = this.navigationSubject.asObservable();
|
|
2334
2333
|
const i = this.scrollNavigationController.userScroll$.pipe(
|
|
2335
2334
|
sn((o) => {
|
|
2336
2335
|
const s = this.locker.lock();
|
|
@@ -2339,11 +2338,11 @@ class _i extends G {
|
|
|
2339
2338
|
v(o)
|
|
2340
2339
|
).pipe(
|
|
2341
2340
|
Ie(
|
|
2342
|
-
|
|
2341
|
+
_i,
|
|
2343
2342
|
re
|
|
2344
2343
|
),
|
|
2345
2344
|
U(),
|
|
2346
|
-
|
|
2345
|
+
x(() => {
|
|
2347
2346
|
const r = this.scrollNavigationController.fromScrollPosition(
|
|
2348
2347
|
this.scrollNavigationController.scrollPosition
|
|
2349
2348
|
);
|
|
@@ -2362,7 +2361,7 @@ class _i extends G {
|
|
|
2362
2361
|
P(i).pipe(T(this.destroy$)).subscribe();
|
|
2363
2362
|
}
|
|
2364
2363
|
}
|
|
2365
|
-
const
|
|
2364
|
+
const Bi = (n) => n.pagination.state$.pipe(
|
|
2366
2365
|
z(n.context.manifest$, n.settings.values$),
|
|
2367
2366
|
S(
|
|
2368
2367
|
([
|
|
@@ -2381,37 +2380,37 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2381
2380
|
};
|
|
2382
2381
|
}
|
|
2383
2382
|
),
|
|
2384
|
-
|
|
2385
|
-
),
|
|
2383
|
+
R(O)
|
|
2384
|
+
), Xi = ({ reader: n, duration: e }) => (t) => {
|
|
2386
2385
|
let i;
|
|
2387
2386
|
const o = () => {
|
|
2388
2387
|
i?.(), i = void 0;
|
|
2389
2388
|
};
|
|
2390
2389
|
return t.pipe(
|
|
2391
|
-
|
|
2390
|
+
x(() => {
|
|
2392
2391
|
i || (i = n?.navigation.lock());
|
|
2393
2392
|
}),
|
|
2394
2393
|
rn(e, re, {
|
|
2395
2394
|
trailing: !0,
|
|
2396
2395
|
leading: !0
|
|
2397
2396
|
}),
|
|
2398
|
-
|
|
2397
|
+
x(o),
|
|
2399
2398
|
me(o)
|
|
2400
2399
|
);
|
|
2401
|
-
},
|
|
2402
|
-
const t = n(e), i =
|
|
2400
|
+
}, Yi = (n) => (e) => {
|
|
2401
|
+
const t = n(e), i = Bi(t), o = new zi(t), s = new Wi(t), r = new Hi(
|
|
2403
2402
|
t.navigation.scrollNavigationController,
|
|
2404
2403
|
t.navigation.locker
|
|
2405
|
-
), a =
|
|
2406
|
-
|
|
2404
|
+
), a = Oi(t, o), c = r.navigation$.pipe(
|
|
2405
|
+
x((d) => {
|
|
2407
2406
|
t.navigation.navigate(d);
|
|
2408
2407
|
})
|
|
2409
2408
|
);
|
|
2410
2409
|
return P(a, c).pipe(T(t.$.destroy$)).subscribe(), {
|
|
2411
2410
|
...t,
|
|
2412
2411
|
load: (d) => {
|
|
2413
|
-
const { cfi:
|
|
2414
|
-
t.load(
|
|
2412
|
+
const { cfi: g, ...p } = d;
|
|
2413
|
+
t.load(p), g && o.goToCfi(g, { animate: !1 });
|
|
2415
2414
|
},
|
|
2416
2415
|
destroy: () => {
|
|
2417
2416
|
r.destroy(), t.destroy();
|
|
@@ -2419,7 +2418,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2419
2418
|
navigation: {
|
|
2420
2419
|
...t.navigation,
|
|
2421
2420
|
state$: i,
|
|
2422
|
-
throttleLock: ({ duration: d, trigger:
|
|
2421
|
+
throttleLock: ({ duration: d, trigger: g }) => g.pipe(Xi({ duration: d, reader: t })),
|
|
2423
2422
|
panNavigator: s,
|
|
2424
2423
|
turnBottom: o.turnBottom.bind(o),
|
|
2425
2424
|
turnTop: o.turnTop.bind(o),
|
|
@@ -2452,10 +2451,10 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2452
2451
|
a.lastIndexOf("/")
|
|
2453
2452
|
), u = n.substring(0, n.lastIndexOf("/")), l = n.endsWith(a), d = u !== "" && u.endsWith(c);
|
|
2454
2453
|
if (l || d) {
|
|
2455
|
-
const
|
|
2454
|
+
const p = t.spineItems.findIndex(
|
|
2456
2455
|
(f) => f.href === s.href
|
|
2457
2456
|
);
|
|
2458
|
-
if (i <
|
|
2457
|
+
if (i < p) return o;
|
|
2459
2458
|
const m = {
|
|
2460
2459
|
title: s.title,
|
|
2461
2460
|
path: s.path
|
|
@@ -2467,19 +2466,19 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2467
2466
|
}
|
|
2468
2467
|
return o;
|
|
2469
2468
|
}, void 0);
|
|
2470
|
-
},
|
|
2469
|
+
}, qi = (n, e) => {
|
|
2471
2470
|
const { href: t } = e;
|
|
2472
2471
|
return zt(t, n.nav?.toc ?? [], n);
|
|
2473
|
-
},
|
|
2472
|
+
}, Gi = (n) => {
|
|
2474
2473
|
const e = n.context.manifest, t = n.spineItemsManager.items;
|
|
2475
2474
|
return e ? t.reduce(
|
|
2476
|
-
(i, { item: o }) => (i[o.id] =
|
|
2475
|
+
(i, { item: o }) => (i[o.id] = qi(e, o), i),
|
|
2477
2476
|
{}
|
|
2478
2477
|
) : {};
|
|
2479
|
-
},
|
|
2478
|
+
}, Zi = (n) => n.spineItemsManager.items$.pipe(
|
|
2480
2479
|
ne([]),
|
|
2481
|
-
S(() =>
|
|
2482
|
-
),
|
|
2480
|
+
S(() => Gi(n))
|
|
2481
|
+
), Ji = (n, e, t) => n + e * t, Ki = (n, e, t) => {
|
|
2483
2482
|
const { height: i, width: o } = t.layoutInfo, { top: s, left: r } = n.spine.getSpineItemSpineLayoutInfo(t);
|
|
2484
2483
|
return n.settings.values.computedPageTurnDirection === "vertical" ? Math.max(
|
|
2485
2484
|
0,
|
|
@@ -2494,27 +2493,27 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2494
2493
|
(e.x - r + n.viewport.absoluteViewport.width) / o
|
|
2495
2494
|
)
|
|
2496
2495
|
);
|
|
2497
|
-
},
|
|
2496
|
+
}, Qi = (n, e, t, i, o) => o.isReady$.pipe(
|
|
2498
2497
|
U(),
|
|
2499
2498
|
z(n.layoutInfo$),
|
|
2500
2499
|
S(([s, r]) => {
|
|
2501
|
-
const a = n.context, c = a.manifest?.renditionLayout === "pre-paginated", u = a.manifest?.spineItems.length || 0, l = a.manifest?.spineItems.slice(0, e).reduce((f, I) => f + (I.progressionWeight ?? 0), 0) || 0, d = n.spineItemsManager.getSpineItemIndex(o) ?? 0,
|
|
2500
|
+
const a = n.context, c = a.manifest?.renditionLayout === "pre-paginated", u = a.manifest?.spineItems.length || 0, l = a.manifest?.spineItems.slice(0, e).reduce((f, I) => f + (I.progressionWeight ?? 0), 0) || 0, d = n.spineItemsManager.getSpineItemIndex(o) ?? 0, g = n.context.manifest?.spineItems.length ?? 0, p = r.pages.filter((f) => f.itemIndex === d).length ?? 0, h = a.manifest?.spineItems[e]?.progressionWeight ?? // if no progressionWeight is defined we "assume" the document weight to be
|
|
2502
2501
|
// relative to the total number of documents
|
|
2503
|
-
(d + 1) /
|
|
2504
|
-
let m = (t + 1) * (h /
|
|
2502
|
+
(d + 1) / g;
|
|
2503
|
+
let m = (t + 1) * (h / p);
|
|
2505
2504
|
!c && o.renditionLayout === "reflowable" && !s && (m = 0);
|
|
2506
2505
|
let y = l + m;
|
|
2507
|
-
return a.manifest?.renditionFlow === "scrolled-continuous" && (s ? m =
|
|
2506
|
+
return a.manifest?.renditionFlow === "scrolled-continuous" && (s ? m = Ki(
|
|
2508
2507
|
n,
|
|
2509
2508
|
i,
|
|
2510
2509
|
o
|
|
2511
|
-
) : m = 0, y =
|
|
2510
|
+
) : m = 0, y = Ji(
|
|
2512
2511
|
l,
|
|
2513
2512
|
h,
|
|
2514
2513
|
m
|
|
2515
|
-
)), e === u - 1 && t ===
|
|
2514
|
+
)), e === u - 1 && t === p - 1 && y > 0.99 ? 1 : y;
|
|
2516
2515
|
})
|
|
2517
|
-
),
|
|
2516
|
+
), eo = (n) => n.spine.layout$.pipe(
|
|
2518
2517
|
Ie(10, re),
|
|
2519
2518
|
z(n.pagination.state$),
|
|
2520
2519
|
S(() => ({
|
|
@@ -2527,12 +2526,12 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2527
2526
|
*/
|
|
2528
2527
|
numberOfTotalPages: n.spine.pages.value.pages.length
|
|
2529
2528
|
})),
|
|
2530
|
-
|
|
2529
|
+
R(O),
|
|
2531
2530
|
ne({
|
|
2532
2531
|
numberOfPagesPerItems: [],
|
|
2533
2532
|
numberOfTotalPages: 0
|
|
2534
2533
|
})
|
|
2535
|
-
),
|
|
2534
|
+
), to = (n, e, t, i) => {
|
|
2536
2535
|
const o = e.beginSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.beginSpineItemIndex) : void 0, s = e.endSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.endSpineItemIndex) : void 0;
|
|
2537
2536
|
return v({
|
|
2538
2537
|
...e,
|
|
@@ -2563,7 +2562,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2563
2562
|
// hasPreviousChapter: (reader.spine.spineItemIndex || 0) < (manifest.readingOrder.length - 1),
|
|
2564
2563
|
// numberOfSpineItems: context.manifest?.readingOrder.length,
|
|
2565
2564
|
});
|
|
2566
|
-
},
|
|
2565
|
+
}, no = (n) => j([
|
|
2567
2566
|
n.pagination.state$,
|
|
2568
2567
|
// Usually pagination change if layout changes (number of pages) however it is especially
|
|
2569
2568
|
// useful for like webtoon where you still have one page but only the layout will give you the final size
|
|
@@ -2572,7 +2571,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2572
2571
|
]).pipe(
|
|
2573
2572
|
w(([e]) => {
|
|
2574
2573
|
const t = e.endSpineItemIndex !== void 0 ? n.spineItemsManager.get(e.endSpineItemIndex) : void 0;
|
|
2575
|
-
return t ?
|
|
2574
|
+
return t ? Qi(
|
|
2576
2575
|
n,
|
|
2577
2576
|
e.endSpineItemIndex ?? 0,
|
|
2578
2577
|
e.endPageIndexInSpineItem || 0,
|
|
@@ -2580,8 +2579,8 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2580
2579
|
t
|
|
2581
2580
|
) : v(0);
|
|
2582
2581
|
})
|
|
2583
|
-
),
|
|
2584
|
-
const e =
|
|
2582
|
+
), io = (n) => {
|
|
2583
|
+
const e = Zi(n), t = eo(n), i = new q({
|
|
2585
2584
|
...n.pagination.state,
|
|
2586
2585
|
beginChapterInfo: void 0,
|
|
2587
2586
|
beginCfi: void 0,
|
|
@@ -2599,10 +2598,10 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2599
2598
|
}), o = j([
|
|
2600
2599
|
n.pagination.state$,
|
|
2601
2600
|
e,
|
|
2602
|
-
|
|
2601
|
+
no(n)
|
|
2603
2602
|
]).pipe(
|
|
2604
2603
|
w(
|
|
2605
|
-
([r, a, c]) =>
|
|
2604
|
+
([r, a, c]) => to(
|
|
2606
2605
|
n,
|
|
2607
2606
|
r,
|
|
2608
2607
|
a,
|
|
@@ -2614,7 +2613,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2614
2613
|
}))
|
|
2615
2614
|
)
|
|
2616
2615
|
),
|
|
2617
|
-
|
|
2616
|
+
R(O)
|
|
2618
2617
|
);
|
|
2619
2618
|
return { paginationInfo$: j([
|
|
2620
2619
|
o,
|
|
@@ -2632,12 +2631,12 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2632
2631
|
r.endPageIndexInSpineItem ?? 0
|
|
2633
2632
|
)
|
|
2634
2633
|
})),
|
|
2635
|
-
|
|
2634
|
+
x((r) => {
|
|
2636
2635
|
i.next(r);
|
|
2637
2636
|
}),
|
|
2638
2637
|
J(1)
|
|
2639
2638
|
), getPaginationInfo: () => i.value };
|
|
2640
|
-
},
|
|
2639
|
+
}, de = (n) => We({
|
|
2641
2640
|
spineIndex: n.index,
|
|
2642
2641
|
spineId: n.id
|
|
2643
2642
|
}), Wt = ({
|
|
@@ -2646,7 +2645,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2646
2645
|
item: t
|
|
2647
2646
|
}) => {
|
|
2648
2647
|
const i = "ownerDocument" in n ? n.ownerDocument : n.startContainer.ownerDocument;
|
|
2649
|
-
return !i || !i?.documentElement || n === i ?
|
|
2648
|
+
return !i || !i?.documentElement || n === i ? de(t) : On(n) ? We({
|
|
2650
2649
|
start: {
|
|
2651
2650
|
node: n.startContainer,
|
|
2652
2651
|
offset: n.startOffset,
|
|
@@ -2666,26 +2665,20 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2666
2665
|
spineId: t.id
|
|
2667
2666
|
});
|
|
2668
2667
|
}, He = ({
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
return o && s instanceof HTMLIFrameElement && s.contentWindow?.document ? Wt({
|
|
2677
|
-
nodeOrRange: o.node,
|
|
2678
|
-
offset: o.offset,
|
|
2679
|
-
item: e.item
|
|
2680
|
-
}).trim() : he(e.item);
|
|
2681
|
-
}, io = (n, e) => Wt({
|
|
2668
|
+
spineItem: n,
|
|
2669
|
+
pageNode: e
|
|
2670
|
+
}) => Wt({
|
|
2671
|
+
nodeOrRange: e.node,
|
|
2672
|
+
offset: e.offset,
|
|
2673
|
+
item: n
|
|
2674
|
+
}).trim(), oo = (n, e) => Wt({
|
|
2682
2675
|
nodeOrRange: n,
|
|
2683
2676
|
item: e
|
|
2684
|
-
}),
|
|
2677
|
+
}), Js = (n) => n.index.toString(), pt = (n) => n[0]?.index === 6 && n.length > 1, Be = (n) => {
|
|
2685
2678
|
const e = Mt(n);
|
|
2686
2679
|
return wn(e);
|
|
2687
|
-
},
|
|
2688
|
-
const e = Mt(n), s = ((
|
|
2680
|
+
}, so = (n) => Array.isArray(n) ? n[0] && pt(n[0]) ? n[0] : void 0 : n.parent[0] && pt(n.parent[0]) ? n.parent[0] : void 0, it = (n) => {
|
|
2681
|
+
const e = Mt(n), s = ((so(e) ?? [])[1]?.index ?? 2) / 2 - 1, r = Pn(e), a = r ? e.end.at(-1)?.at(-1)?.offset : e.at(-1)?.at(-1)?.offset;
|
|
2689
2682
|
return {
|
|
2690
2683
|
isCfiRange: r,
|
|
2691
2684
|
itemIndex: s,
|
|
@@ -2734,7 +2727,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2734
2727
|
spineItem: o,
|
|
2735
2728
|
node: null
|
|
2736
2729
|
};
|
|
2737
|
-
},
|
|
2730
|
+
}, ro = (n, e) => {
|
|
2738
2731
|
if ("cfi" in e) {
|
|
2739
2732
|
const { itemIndex: s, ...r } = n.cfi.parseCfi(e.cfi);
|
|
2740
2733
|
return {
|
|
@@ -2747,14 +2740,14 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2747
2740
|
const t = n.spineItemsManager.get(e);
|
|
2748
2741
|
if (!t)
|
|
2749
2742
|
throw new Error("Spine item not found");
|
|
2750
|
-
const i =
|
|
2743
|
+
const i = de(t.item);
|
|
2751
2744
|
return {
|
|
2752
2745
|
...n.cfi.parseCfi(i),
|
|
2753
|
-
cfi:
|
|
2746
|
+
cfi: de(t.item),
|
|
2754
2747
|
itemIndex: t.index,
|
|
2755
2748
|
node: null
|
|
2756
2749
|
};
|
|
2757
|
-
},
|
|
2750
|
+
}, ao = (n, e) => {
|
|
2758
2751
|
let t = n?.itemPageIndex;
|
|
2759
2752
|
const { itemIndex: i, ...o } = e.cfi.parseCfi(n.cfi), s = e.spineItemsManager.get(i);
|
|
2760
2753
|
return s ? et().pipe(
|
|
@@ -2787,7 +2780,7 @@ const Hi = (n) => n.pagination.state$.pipe(
|
|
|
2787
2780
|
})
|
|
2788
2781
|
) : v({ ...n, itemIndex: i, ...o });
|
|
2789
2782
|
};
|
|
2790
|
-
class
|
|
2783
|
+
class co {
|
|
2791
2784
|
constructor(e) {
|
|
2792
2785
|
this.reader = e, this.locatorsByKey = /* @__PURE__ */ new Map(), this.deregisterMemoizedStream = (t) => {
|
|
2793
2786
|
const i = this.locatorsByKey.get(t);
|
|
@@ -2795,13 +2788,13 @@ class ao {
|
|
|
2795
2788
|
}, this.locate = (t, i) => {
|
|
2796
2789
|
const o = {
|
|
2797
2790
|
resource: t,
|
|
2798
|
-
meta:
|
|
2791
|
+
meta: ro(this.reader, t)
|
|
2799
2792
|
};
|
|
2800
2793
|
return at(() => {
|
|
2801
2794
|
const s = this.reader.spineItemsManager.get(
|
|
2802
2795
|
o.meta.itemIndex ?? 0
|
|
2803
2796
|
), r = s?.renditionLayout === "reflowable", a = i.mode === "shallow" || !r || !s ? () => {
|
|
2804
|
-
} : this.reader.spine.spineItemsLoader.forceOpen([s.index]), c = "cfi" in t ? t.cfi : void 0, u = c ? this.locatorsByKey.get(c) : void 0, l = (
|
|
2797
|
+
} : this.reader.spine.spineItemsLoader.forceOpen([s.index]), c = "cfi" in t ? t.cfi : void 0, u = c ? this.locatorsByKey.get(c) : void 0, l = (g) => g.pipe(
|
|
2805
2798
|
me(() => {
|
|
2806
2799
|
c && this.deregisterMemoizedStream(c), setTimeout(() => {
|
|
2807
2800
|
a();
|
|
@@ -2811,19 +2804,19 @@ class ao {
|
|
|
2811
2804
|
if (c && u)
|
|
2812
2805
|
return u.observerCount++, l(
|
|
2813
2806
|
u.consolidate$.pipe(
|
|
2814
|
-
S(({ resource:
|
|
2815
|
-
resource:
|
|
2816
|
-
meta:
|
|
2807
|
+
S(({ resource: g, meta: p }) => ({
|
|
2808
|
+
resource: g,
|
|
2809
|
+
meta: p
|
|
2817
2810
|
}))
|
|
2818
2811
|
)
|
|
2819
2812
|
);
|
|
2820
2813
|
const d = this.reader.spine.layout$.pipe(
|
|
2821
2814
|
Ie(10),
|
|
2822
2815
|
ne(o),
|
|
2823
|
-
an((
|
|
2824
|
-
S((
|
|
2825
|
-
...
|
|
2826
|
-
meta:
|
|
2816
|
+
an((g) => ao(g.meta, this.reader).pipe(
|
|
2817
|
+
S((p) => ({
|
|
2818
|
+
...g,
|
|
2819
|
+
meta: p
|
|
2827
2820
|
}))
|
|
2828
2821
|
), o),
|
|
2829
2822
|
J({ refCount: !0, bufferSize: 1 })
|
|
@@ -2843,10 +2836,10 @@ class ao {
|
|
|
2843
2836
|
) : this.locate(e, t ?? {});
|
|
2844
2837
|
}
|
|
2845
2838
|
}
|
|
2846
|
-
const
|
|
2847
|
-
const t = n(e), { paginationInfo$: i, getPaginationInfo: o } =
|
|
2839
|
+
const uo = (n) => (e) => {
|
|
2840
|
+
const t = n(e), { paginationInfo$: i, getPaginationInfo: o } = io(t);
|
|
2848
2841
|
i.pipe(T(t.$.destroy$)).subscribe();
|
|
2849
|
-
const s = new
|
|
2842
|
+
const s = new co(t);
|
|
2850
2843
|
return {
|
|
2851
2844
|
...t,
|
|
2852
2845
|
locateResource: s.locateResource.bind(s),
|
|
@@ -2860,19 +2853,19 @@ const co = (n) => (e) => {
|
|
|
2860
2853
|
}
|
|
2861
2854
|
}
|
|
2862
2855
|
};
|
|
2863
|
-
},
|
|
2856
|
+
}, lo = (n) => ({
|
|
2864
2857
|
put: (s, r) => new Promise((a, c) => {
|
|
2865
2858
|
const u = n.transaction(["store"], "readwrite");
|
|
2866
|
-
u.onerror = (
|
|
2867
|
-
c(
|
|
2859
|
+
u.onerror = (g) => {
|
|
2860
|
+
c(g);
|
|
2868
2861
|
}, u.oncomplete = () => {
|
|
2869
2862
|
a();
|
|
2870
2863
|
};
|
|
2871
2864
|
const d = u.objectStore("store").put(r, s);
|
|
2872
2865
|
d.onsuccess = () => {
|
|
2873
2866
|
a();
|
|
2874
|
-
}, d.onerror = (
|
|
2875
|
-
c(
|
|
2867
|
+
}, d.onerror = (g) => {
|
|
2868
|
+
c(g);
|
|
2876
2869
|
};
|
|
2877
2870
|
}),
|
|
2878
2871
|
keys: () => new Promise((s, r) => {
|
|
@@ -2917,13 +2910,13 @@ const co = (n) => (e) => {
|
|
|
2917
2910
|
i.onerror = (o) => {
|
|
2918
2911
|
t(o);
|
|
2919
2912
|
}, i.onsuccess = () => {
|
|
2920
|
-
e(
|
|
2913
|
+
e(lo(i.result));
|
|
2921
2914
|
}, i.onupgradeneeded = () => {
|
|
2922
2915
|
i.result.createObjectStore("store");
|
|
2923
2916
|
};
|
|
2924
|
-
}),
|
|
2917
|
+
}), po = (n) => {
|
|
2925
2918
|
let e = Date.now().toString();
|
|
2926
|
-
const t = new
|
|
2919
|
+
const t = new N(), i = (c) => {
|
|
2927
2920
|
if (typeof c == "string" || typeof c == "object") {
|
|
2928
2921
|
const u = typeof c == "object" ? c.id : c;
|
|
2929
2922
|
return n.manifest?.spineItems.find((l) => l.id === u);
|
|
@@ -2932,11 +2925,11 @@ const co = (n) => (e) => {
|
|
|
2932
2925
|
}, o = async (c, u) => {
|
|
2933
2926
|
const l = i(c);
|
|
2934
2927
|
if (!l) return new Response("Item not found", { status: 404 });
|
|
2935
|
-
const
|
|
2936
|
-
if (
|
|
2937
|
-
return new Response(
|
|
2938
|
-
const
|
|
2939
|
-
return s(l,
|
|
2928
|
+
const g = await (await Ve("prose-reader")).get(`${e}_${l.id}`);
|
|
2929
|
+
if (g)
|
|
2930
|
+
return new Response(g, { status: 200 });
|
|
2931
|
+
const p = u && await u(l) || await fetch(l.href);
|
|
2932
|
+
return s(l, p.clone()), p;
|
|
2940
2933
|
}, s = (c, u) => {
|
|
2941
2934
|
t.next({ id: c, data: u });
|
|
2942
2935
|
};
|
|
@@ -2946,7 +2939,7 @@ const co = (n) => (e) => {
|
|
|
2946
2939
|
return l ? k(
|
|
2947
2940
|
un([Ve("prose-reader"), k(u.blob())])
|
|
2948
2941
|
).pipe(
|
|
2949
|
-
Y(([d,
|
|
2942
|
+
Y(([d, g]) => k(d.put(`${e}_${l.id}`, g))),
|
|
2950
2943
|
st((d) => (A.error(d), _))
|
|
2951
2944
|
) : _;
|
|
2952
2945
|
}),
|
|
@@ -2979,8 +2972,8 @@ const co = (n) => (e) => {
|
|
|
2979
2972
|
t.complete();
|
|
2980
2973
|
}
|
|
2981
2974
|
};
|
|
2982
|
-
},
|
|
2983
|
-
const t = n(e), i =
|
|
2975
|
+
}, go = (n) => (e) => {
|
|
2976
|
+
const t = n(e), i = po(t.context);
|
|
2984
2977
|
return {
|
|
2985
2978
|
...t,
|
|
2986
2979
|
// $: {
|
|
@@ -2992,7 +2985,7 @@ const co = (n) => (e) => {
|
|
|
2992
2985
|
}
|
|
2993
2986
|
// load,
|
|
2994
2987
|
};
|
|
2995
|
-
},
|
|
2988
|
+
}, ho = (n, e) => {
|
|
2996
2989
|
const t = n.node.ownerDocument?.createRange(), i = n.node.compareDocumentPosition(e.node);
|
|
2997
2990
|
if (t) {
|
|
2998
2991
|
try {
|
|
@@ -3012,14 +3005,14 @@ const co = (n) => (e) => {
|
|
|
3012
3005
|
}
|
|
3013
3006
|
return t;
|
|
3014
3007
|
}
|
|
3015
|
-
},
|
|
3008
|
+
}, mo = ({
|
|
3016
3009
|
selection: n,
|
|
3017
3010
|
spineItem: e
|
|
3018
3011
|
}) => {
|
|
3019
3012
|
const { anchorNode: t, anchorOffset: i, focusNode: o, focusOffset: s } = n;
|
|
3020
3013
|
if (!(!t || !o))
|
|
3021
3014
|
try {
|
|
3022
|
-
return
|
|
3015
|
+
return ho(
|
|
3023
3016
|
{ node: t, offset: i },
|
|
3024
3017
|
{ node: o, offset: s }
|
|
3025
3018
|
);
|
|
@@ -3031,12 +3024,12 @@ const co = (n) => (e) => {
|
|
|
3031
3024
|
return;
|
|
3032
3025
|
}
|
|
3033
3026
|
};
|
|
3034
|
-
class
|
|
3027
|
+
class fo extends G {
|
|
3035
3028
|
constructor(e) {
|
|
3036
3029
|
super();
|
|
3037
3030
|
const t = e.contentDocument || e.contentWindow?.document;
|
|
3038
3031
|
if (!t)
|
|
3039
|
-
this.selectionChange$ =
|
|
3032
|
+
this.selectionChange$ = he, this.selectionOver$ = he;
|
|
3040
3033
|
else {
|
|
3041
3034
|
const i = ct(t.body, {
|
|
3042
3035
|
childList: !0,
|
|
@@ -3086,11 +3079,11 @@ class mo extends G {
|
|
|
3086
3079
|
}
|
|
3087
3080
|
}
|
|
3088
3081
|
}
|
|
3089
|
-
const
|
|
3082
|
+
const yo = (n) => n.watch("isLoaded").pipe(
|
|
3090
3083
|
w(() => {
|
|
3091
3084
|
const e = n.renderer.getDocumentFrame(), t = e?.contentDocument || e?.contentWindow?.document;
|
|
3092
|
-
if (!e || !t) return
|
|
3093
|
-
const i = new
|
|
3085
|
+
if (!e || !t) return he;
|
|
3086
|
+
const i = new fo(e);
|
|
3094
3087
|
return P(
|
|
3095
3088
|
i.selectionChange$.pipe(
|
|
3096
3089
|
S((o) => {
|
|
@@ -3116,20 +3109,20 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3116
3109
|
})
|
|
3117
3110
|
);
|
|
3118
3111
|
}),
|
|
3119
|
-
|
|
3120
|
-
),
|
|
3112
|
+
R()
|
|
3113
|
+
), So = (n) => (e) => {
|
|
3121
3114
|
const t = n(e);
|
|
3122
3115
|
let i;
|
|
3123
3116
|
const o = t.spineItemsManager.items$.pipe(
|
|
3124
3117
|
w((l) => {
|
|
3125
|
-
const d = l.map((
|
|
3126
|
-
const
|
|
3127
|
-
return
|
|
3118
|
+
const d = l.map((g) => {
|
|
3119
|
+
const p = t.spineItemsManager.getSpineItemIndex(g) ?? 0;
|
|
3120
|
+
return yo(g).pipe(
|
|
3128
3121
|
S((h) => {
|
|
3129
3122
|
if (h)
|
|
3130
3123
|
return {
|
|
3131
3124
|
...h,
|
|
3132
|
-
itemIndex:
|
|
3125
|
+
itemIndex: p
|
|
3133
3126
|
};
|
|
3134
3127
|
})
|
|
3135
3128
|
);
|
|
@@ -3137,19 +3130,19 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3137
3130
|
return P(...d);
|
|
3138
3131
|
}),
|
|
3139
3132
|
ne(void 0),
|
|
3140
|
-
|
|
3141
|
-
|
|
3133
|
+
R(),
|
|
3134
|
+
x((l) => {
|
|
3142
3135
|
i = l;
|
|
3143
3136
|
}),
|
|
3144
3137
|
J({ refCount: !0, bufferSize: 1 })
|
|
3145
3138
|
), s = o, r = o.pipe(
|
|
3146
3139
|
S((l) => !!l),
|
|
3147
|
-
|
|
3140
|
+
R(),
|
|
3148
3141
|
C((l) => l),
|
|
3149
3142
|
D()
|
|
3150
3143
|
), a = r.pipe(
|
|
3151
3144
|
w(() => s),
|
|
3152
|
-
|
|
3145
|
+
R(),
|
|
3153
3146
|
C((l) => !l),
|
|
3154
3147
|
D()
|
|
3155
3148
|
), c = o.pipe(
|
|
@@ -3172,7 +3165,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3172
3165
|
selectionOver$: c,
|
|
3173
3166
|
lastSelectionOnPointerdown$: u,
|
|
3174
3167
|
getSelection: () => i,
|
|
3175
|
-
createOrderedRangeFromSelection:
|
|
3168
|
+
createOrderedRangeFromSelection: mo
|
|
3176
3169
|
}
|
|
3177
3170
|
};
|
|
3178
3171
|
}, gt = [
|
|
@@ -3190,7 +3183,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3190
3183
|
backgroundColor: "#191717",
|
|
3191
3184
|
foregroundColor: "#f1ebeb"
|
|
3192
3185
|
}
|
|
3193
|
-
],
|
|
3186
|
+
], Io = (n) => (e) => {
|
|
3194
3187
|
const t = n(e), i = new q(
|
|
3195
3188
|
e.theme ?? "bright"
|
|
3196
3189
|
), o = () => {
|
|
@@ -3255,7 +3248,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3255
3248
|
}
|
|
3256
3249
|
}
|
|
3257
3250
|
};
|
|
3258
|
-
},
|
|
3251
|
+
}, bo = (n) => (e) => {
|
|
3259
3252
|
const t = n(e);
|
|
3260
3253
|
return {
|
|
3261
3254
|
...t,
|
|
@@ -3269,7 +3262,7 @@ const fo = (n) => n.watch("isLoaded").pipe(
|
|
|
3269
3262
|
};
|
|
3270
3263
|
};
|
|
3271
3264
|
navigator.userAgent.indexOf("") > -1 && navigator.userAgent.indexOf("Chrome") <= -1;
|
|
3272
|
-
const
|
|
3265
|
+
const vo = (n) => (e) => n(e), wo = "[data-prose-reader-scroll-navigator][data-prose-reader-zooming=true]{overflow:scroll}[data-prose-reader-scroll-navigator][data-prose-reader-zooming=true][data-prose-reader-zooming-direction=down]{overflow-x:auto}", ht = (n, e, t) => {
|
|
3273
3266
|
const { clientWidth: i, clientHeight: o } = t.value.element, s = {
|
|
3274
3267
|
maxX: 0,
|
|
3275
3268
|
minX: i * (1 - e),
|
|
@@ -3280,11 +3273,11 @@ const bo = (n) => (e) => n(e), vo = "[data-prose-reader-scroll-navigator][data-p
|
|
|
3280
3273
|
x: Math.min(Math.max(n.x, s.minX), s.maxX),
|
|
3281
3274
|
y: Math.min(Math.max(n.y, s.minY), s.maxY)
|
|
3282
3275
|
};
|
|
3283
|
-
},
|
|
3276
|
+
}, Po = (n, e, t) => {
|
|
3284
3277
|
t.style.transformOrigin = "0 0";
|
|
3285
3278
|
const i = `translate3d(${e.x}px, ${e.y}px, 0px)`, o = `scale(${n})`;
|
|
3286
3279
|
t.style.transform = `${i} ${o}`;
|
|
3287
|
-
},
|
|
3280
|
+
}, xo = (n, e, t, i) => {
|
|
3288
3281
|
const o = e / n, s = t.clientWidth, r = t.clientHeight, a = s / 2 - i.x, c = r / 2 - i.y;
|
|
3289
3282
|
return {
|
|
3290
3283
|
x: i.x + a * (1 - o),
|
|
@@ -3298,27 +3291,27 @@ class Ht {
|
|
|
3298
3291
|
}
|
|
3299
3292
|
class mt extends Ht {
|
|
3300
3293
|
}
|
|
3301
|
-
class
|
|
3294
|
+
class $o extends Ht {
|
|
3302
3295
|
constructor() {
|
|
3303
3296
|
super(...arguments), this.__symbol = /* @__PURE__ */ Symbol("UnboundScrollPosition");
|
|
3304
3297
|
}
|
|
3305
3298
|
}
|
|
3306
|
-
class
|
|
3299
|
+
class To extends Q {
|
|
3307
3300
|
constructor(e, t, i, o, s) {
|
|
3308
3301
|
super({
|
|
3309
3302
|
element: void 0
|
|
3310
|
-
}), this.viewport = e, this.settings = t, this.hookManager = i, this.spine = o, this.context = s, this.navigateSubject = new
|
|
3303
|
+
}), this.viewport = e, this.settings = t, this.hookManager = i, this.spine = o, this.context = s, this.navigateSubject = new N(), this.scrollingSubject = new q(!1), this.isScrolling$ = this.scrollingSubject.asObservable(), this.setViewportPosition = ({
|
|
3311
3304
|
position: d
|
|
3312
3305
|
}) => {
|
|
3313
|
-
const
|
|
3306
|
+
const g = this.value.element;
|
|
3314
3307
|
this.scrollingSubject.next(!0);
|
|
3315
|
-
const
|
|
3316
|
-
|
|
3317
|
-
left:
|
|
3318
|
-
top:
|
|
3308
|
+
const p = this.fromSpinePosition(d);
|
|
3309
|
+
g?.scrollTo({
|
|
3310
|
+
left: p.x,
|
|
3311
|
+
top: p.y,
|
|
3319
3312
|
behavior: "instant"
|
|
3320
3313
|
}), Te(1).pipe(
|
|
3321
|
-
|
|
3314
|
+
x(() => {
|
|
3322
3315
|
this.scrollingSubject.next(!1);
|
|
3323
3316
|
}),
|
|
3324
3317
|
T(P(this.scrollingSubject.pipe(Ft(1)), this.destroy$))
|
|
@@ -3326,19 +3319,19 @@ class $o extends Q {
|
|
|
3326
3319
|
};
|
|
3327
3320
|
const r = this.context.pipe(
|
|
3328
3321
|
Ke(["rootElement"]),
|
|
3329
|
-
|
|
3322
|
+
x(({ rootElement: d }) => {
|
|
3330
3323
|
if (!d) return;
|
|
3331
|
-
const
|
|
3332
|
-
|
|
3324
|
+
const g = document.createElement("div");
|
|
3325
|
+
g.setAttribute(`data-${ri}`, ""), g.appendChild(this.viewport.value.element), d.appendChild(g), this.update({ element: g });
|
|
3333
3326
|
})
|
|
3334
3327
|
), a = j([
|
|
3335
3328
|
t.watch(["computedPageTurnMode"]),
|
|
3336
3329
|
this.watch("element")
|
|
3337
3330
|
]).pipe(
|
|
3338
|
-
|
|
3339
|
-
|
|
3331
|
+
x(([{ computedPageTurnMode: d }, g]) => {
|
|
3332
|
+
g && (d === "scrollable" ? g.style.display = "block" : g.style.display = "contents");
|
|
3340
3333
|
})
|
|
3341
|
-
), c = this.navigateSubject.pipe(
|
|
3334
|
+
), c = this.navigateSubject.pipe(x(this.setViewportPosition));
|
|
3342
3335
|
this.isNavigating$ = this.navigateSubject.pipe(
|
|
3343
3336
|
ne(!1),
|
|
3344
3337
|
w(() => P(v(!0), v(!1))),
|
|
@@ -3361,14 +3354,14 @@ class $o extends Q {
|
|
|
3361
3354
|
ne(!0)
|
|
3362
3355
|
)
|
|
3363
3356
|
),
|
|
3364
|
-
|
|
3357
|
+
R(),
|
|
3365
3358
|
ne(!1)
|
|
3366
3359
|
), l = j([
|
|
3367
3360
|
u,
|
|
3368
3361
|
this.isScrolling$
|
|
3369
3362
|
]).pipe(
|
|
3370
3363
|
S(
|
|
3371
|
-
([d,
|
|
3364
|
+
([d, g]) => d || g
|
|
3372
3365
|
),
|
|
3373
3366
|
J(1)
|
|
3374
3367
|
);
|
|
@@ -3377,12 +3370,12 @@ class $o extends Q {
|
|
|
3377
3370
|
w(
|
|
3378
3371
|
(d) => t.watch(["computedPageTurnMode"]).pipe(
|
|
3379
3372
|
w(
|
|
3380
|
-
({ computedPageTurnMode:
|
|
3373
|
+
({ computedPageTurnMode: g }) => g === "controlled" ? he : X(d, "scroll").pipe(
|
|
3381
3374
|
z(l),
|
|
3382
3375
|
C(
|
|
3383
|
-
([,
|
|
3376
|
+
([, p]) => !p
|
|
3384
3377
|
),
|
|
3385
|
-
S(([
|
|
3378
|
+
S(([p]) => p)
|
|
3386
3379
|
)
|
|
3387
3380
|
)
|
|
3388
3381
|
)
|
|
@@ -3418,14 +3411,14 @@ class $o extends Q {
|
|
|
3418
3411
|
});
|
|
3419
3412
|
}
|
|
3420
3413
|
}
|
|
3421
|
-
const
|
|
3422
|
-
const s = n.clientWidth, r = n.clientHeight, a = n.scrollLeft, c = n.scrollTop, u = a + s / 2 - i, l = c + r / 2 - o, d = t / e,
|
|
3423
|
-
return new
|
|
3414
|
+
const Fo = (n, e, t, i, o) => {
|
|
3415
|
+
const s = n.clientWidth, r = n.clientHeight, a = n.scrollLeft, c = n.scrollTop, u = a + s / 2 - i, l = c + r / 2 - o, d = t / e, g = u * d, p = l * d, h = g - s / 2 + i, m = p - r / 2 + o;
|
|
3416
|
+
return new $o({
|
|
3424
3417
|
x: h,
|
|
3425
3418
|
y: m
|
|
3426
3419
|
});
|
|
3427
|
-
},
|
|
3428
|
-
const t = e.viewport, i = e.navigation.scrollNavigationController, o = t.value.element, s = i.value.element, r = i.value.element, a = Math.round(t.scaleFactor * 100) / 100, c = o.offsetLeft, u = o.offsetTop, l =
|
|
3420
|
+
}, Lo = (n, e) => {
|
|
3421
|
+
const t = e.viewport, i = e.navigation.scrollNavigationController, o = t.value.element, s = i.value.element, r = i.value.element, a = Math.round(t.scaleFactor * 100) / 100, c = o.offsetLeft, u = o.offsetTop, l = Fo(
|
|
3429
3422
|
s ?? An(),
|
|
3430
3423
|
a,
|
|
3431
3424
|
n,
|
|
@@ -3436,20 +3429,20 @@ const To = (n, e, t, i, o) => {
|
|
|
3436
3429
|
`data-${W}-zooming-direction`,
|
|
3437
3430
|
d
|
|
3438
3431
|
), n < 1 ? o.style.transformOrigin = "top" : n > 1 && (o.style.transformOrigin = `${c}px ${u}px`), o.style.transform = `scale(${n})`;
|
|
3439
|
-
const
|
|
3432
|
+
const g = i.fromScrollPosition(
|
|
3440
3433
|
l
|
|
3441
3434
|
);
|
|
3442
3435
|
e.navigation.navigate({
|
|
3443
|
-
position:
|
|
3436
|
+
position: g
|
|
3444
3437
|
});
|
|
3445
3438
|
}, we = 200;
|
|
3446
|
-
class
|
|
3439
|
+
class Mo extends Q {
|
|
3447
3440
|
constructor(e) {
|
|
3448
3441
|
super({
|
|
3449
3442
|
isZooming: !1,
|
|
3450
3443
|
currentScale: 1,
|
|
3451
3444
|
currentPosition: { x: 0, y: 0 }
|
|
3452
|
-
}), this.reader = e, this.enterSubject = new
|
|
3445
|
+
}), this.reader = e, this.enterSubject = new N(), this.exitSubject = new N();
|
|
3453
3446
|
const t = this.enterSubject.pipe(
|
|
3454
3447
|
w((o) => {
|
|
3455
3448
|
const { scale: s = 1, animate: r = !1 } = o ?? {}, a = this.reader.viewport.value.element;
|
|
@@ -3464,7 +3457,7 @@ class Lo extends Q {
|
|
|
3464
3457
|
currentScale: 1,
|
|
3465
3458
|
currentPosition: { x: 0, y: 0 }
|
|
3466
3459
|
}), this.updateZoom(s), s !== 1 && this.isControlled ? Te(o?.animate ? we : 0).pipe(
|
|
3467
|
-
|
|
3460
|
+
x(() => {
|
|
3468
3461
|
this.reader.layout();
|
|
3469
3462
|
})
|
|
3470
3463
|
) : _;
|
|
@@ -3483,7 +3476,7 @@ class Lo extends Q {
|
|
|
3483
3476
|
), o?.animate && this.isControlled && (s.style.transition = `transform ${we}ms`), this.updateZoom(1, { x: 0, y: 0 }), s.style.transform = "", this.mergeCompare({
|
|
3484
3477
|
isZooming: !1
|
|
3485
3478
|
}), Te(o?.animate ? we : 0).pipe(
|
|
3486
|
-
|
|
3479
|
+
x(() => {
|
|
3487
3480
|
const r = this.reader.viewport.value.element;
|
|
3488
3481
|
r.style.transformOrigin = "", r.style.transition = "", this.isControlled && this.reader.layout();
|
|
3489
3482
|
}),
|
|
@@ -3513,7 +3506,7 @@ class Lo extends Q {
|
|
|
3513
3506
|
}
|
|
3514
3507
|
updateZoom(e, t, i) {
|
|
3515
3508
|
if (this.isControlled) {
|
|
3516
|
-
const o = t ||
|
|
3509
|
+
const o = t || xo(
|
|
3517
3510
|
this.value.currentScale,
|
|
3518
3511
|
e,
|
|
3519
3512
|
this.viewport.element,
|
|
@@ -3529,11 +3522,11 @@ class Lo extends Q {
|
|
|
3529
3522
|
});
|
|
3530
3523
|
}
|
|
3531
3524
|
applyZoom(e, t) {
|
|
3532
|
-
this.isControlled ?
|
|
3525
|
+
this.isControlled ? Po(
|
|
3533
3526
|
e,
|
|
3534
3527
|
t,
|
|
3535
3528
|
this.viewport.element
|
|
3536
|
-
) :
|
|
3529
|
+
) : Lo(e, this.reader);
|
|
3537
3530
|
}
|
|
3538
3531
|
get isControlled() {
|
|
3539
3532
|
return this.reader.settings.values.computedPageTurnMode === "controlled";
|
|
@@ -3545,9 +3538,9 @@ class Lo extends Q {
|
|
|
3545
3538
|
return this.reader.viewport.value;
|
|
3546
3539
|
}
|
|
3547
3540
|
}
|
|
3548
|
-
const ft = `${Vt}-enhancer-zoom`,
|
|
3549
|
-
const t = n(e), i = new
|
|
3550
|
-
Ce(document, ft,
|
|
3541
|
+
const ft = `${Vt}-enhancer-zoom`, Co = (n) => (e) => {
|
|
3542
|
+
const t = n(e), i = new Mo(t);
|
|
3543
|
+
Ce(document, ft, wo);
|
|
3551
3544
|
const o = () => {
|
|
3552
3545
|
Ee(document, ft), i.destroy(), t.destroy();
|
|
3553
3546
|
}, s = i;
|
|
@@ -3566,10 +3559,10 @@ const ft = `${Vt}-enhancer-zoom`, Mo = (n) => (e) => {
|
|
|
3566
3559
|
}
|
|
3567
3560
|
};
|
|
3568
3561
|
}, Bt = (n) => n?.renditionLayout === "pre-paginated" || n?.spineItems.every((e) => e.renditionLayout === "pre-paginated");
|
|
3569
|
-
class
|
|
3562
|
+
class Eo {
|
|
3570
3563
|
constructor() {
|
|
3571
3564
|
this.navigationSubject = new ot(1), this.viewportStateSubject = new q("free"), this.paginationSubject = new ot(), this.navigationIsLockedSubject = new q(!1), this.pagination$ = this.paginationSubject.asObservable(), this.navigationUnlocked$ = this.navigationIsLockedSubject.pipe(
|
|
3572
|
-
|
|
3565
|
+
R(),
|
|
3573
3566
|
C((e) => !e)
|
|
3574
3567
|
), this.viewportState$ = this.viewportStateSubject.asObservable(), this.viewportFree$ = this.viewportState$.pipe(
|
|
3575
3568
|
C((e) => e === "free")
|
|
@@ -3578,13 +3571,13 @@ class Co {
|
|
|
3578
3571
|
), this.navigation$ = this.navigationSubject.asObservable();
|
|
3579
3572
|
}
|
|
3580
3573
|
}
|
|
3581
|
-
class
|
|
3574
|
+
class Do extends Q {
|
|
3582
3575
|
constructor() {
|
|
3583
3576
|
super({
|
|
3584
3577
|
assumedRenditionLayout: "reflowable"
|
|
3585
|
-
}), this.bridgeEvent = new
|
|
3578
|
+
}), this.bridgeEvent = new Eo(), this.manifest$ = this.pipe(
|
|
3586
3579
|
ie((e) => e.manifest),
|
|
3587
|
-
|
|
3580
|
+
pe(Z),
|
|
3588
3581
|
be()
|
|
3589
3582
|
), this.isRTL = () => this.value.manifest?.readingDirection === "rtl";
|
|
3590
3583
|
}
|
|
@@ -3606,7 +3599,7 @@ class Eo extends Q {
|
|
|
3606
3599
|
return this.manifest?.readingDirection;
|
|
3607
3600
|
}
|
|
3608
3601
|
}
|
|
3609
|
-
class
|
|
3602
|
+
class Ao extends Q {
|
|
3610
3603
|
constructor(e, t) {
|
|
3611
3604
|
super({
|
|
3612
3605
|
supportedPageTurnAnimation: ["fade", "none", "slide"],
|
|
@@ -3623,7 +3616,7 @@ class Do extends Q {
|
|
|
3623
3616
|
renditionLayout: i?.renditionLayout,
|
|
3624
3617
|
computedPageTurnMode: s
|
|
3625
3618
|
})),
|
|
3626
|
-
|
|
3619
|
+
R(O),
|
|
3627
3620
|
S(
|
|
3628
3621
|
({
|
|
3629
3622
|
hasVerticalWriting: i,
|
|
@@ -3641,7 +3634,7 @@ class Do extends Q {
|
|
|
3641
3634
|
).subscribe(this.next.bind(this));
|
|
3642
3635
|
}
|
|
3643
3636
|
}
|
|
3644
|
-
class
|
|
3637
|
+
class No {
|
|
3645
3638
|
constructor() {
|
|
3646
3639
|
this._hooks = [], this._hookExecutions = [];
|
|
3647
3640
|
}
|
|
@@ -3672,8 +3665,8 @@ class Ao {
|
|
|
3672
3665
|
(r) => e === r.name
|
|
3673
3666
|
).map((r) => {
|
|
3674
3667
|
let a = () => v(void 0);
|
|
3675
|
-
const c = new
|
|
3676
|
-
a =
|
|
3668
|
+
const c = new N(), u = (g) => {
|
|
3669
|
+
a = g;
|
|
3677
3670
|
}, l = () => (c.next(), c.complete(), a() ?? v(void 0)), d = r.runFn({
|
|
3678
3671
|
// biome-ignore lint/suspicious/noExplicitAny: TODO
|
|
3679
3672
|
...i,
|
|
@@ -3703,25 +3696,25 @@ class Ao {
|
|
|
3703
3696
|
return j(s);
|
|
3704
3697
|
}
|
|
3705
3698
|
}
|
|
3706
|
-
const Ro = "[data-prose-reader-scroll-navigator]{height:100%;width:100%;position:relative;overflow-y:scroll;overflow-x:hidden}[data-prose-reader-viewport]{background-color:#fff;position:relative;height:100%;width:100%}",
|
|
3699
|
+
const Ro = "[data-prose-reader-scroll-navigator]{height:100%;width:100%;position:relative;overflow-y:scroll;overflow-x:hidden}[data-prose-reader-viewport]{background-color:#fff;position:relative;height:100%;width:100%}", Oo = (n) => ({
|
|
3707
3700
|
x: -n.x,
|
|
3708
3701
|
y: -n.y
|
|
3709
|
-
}),
|
|
3702
|
+
}), Vo = (n) => n instanceof DOMMatrix ? new M({
|
|
3710
3703
|
x: -n.e,
|
|
3711
3704
|
y: -n.f
|
|
3712
3705
|
}) : new M({
|
|
3713
3706
|
x: -n.x,
|
|
3714
3707
|
y: -n.y
|
|
3715
|
-
}),
|
|
3716
|
-
class
|
|
3708
|
+
}), jo = "navigation/ViewportNavigator", yt = A.namespace(jo);
|
|
3709
|
+
class ko extends G {
|
|
3717
3710
|
constructor(e, t, i, o, s) {
|
|
3718
|
-
super(), this.settings = e, this.hookManager = t, this.context = i, this.spine = o, this.viewport = s, this.navigateSubject = new
|
|
3711
|
+
super(), this.settings = e, this.hookManager = t, this.context = i, this.spine = o, this.viewport = s, this.navigateSubject = new N(), this.element$ = new q(
|
|
3719
3712
|
document.createElement("div")
|
|
3720
3713
|
);
|
|
3721
3714
|
const r = this.spine.element$.pipe(
|
|
3722
3715
|
C(Z),
|
|
3723
3716
|
z(this.element$),
|
|
3724
|
-
|
|
3717
|
+
x(([l, d]) => {
|
|
3725
3718
|
d.style.cssText = `
|
|
3726
3719
|
height: 100%;
|
|
3727
3720
|
width: 100%;
|
|
@@ -3736,18 +3729,18 @@ class jo extends G {
|
|
|
3736
3729
|
a,
|
|
3737
3730
|
this.element$
|
|
3738
3731
|
]).pipe(
|
|
3739
|
-
|
|
3732
|
+
x(([, l]) => {
|
|
3740
3733
|
e.values.computedPageTurnMode === "scrollable" ? l.style.display = "contents" : l.style.display = "block";
|
|
3741
3734
|
})
|
|
3742
3735
|
);
|
|
3743
3736
|
this.layout$ = c.pipe(
|
|
3744
|
-
|
|
3737
|
+
x(() => {
|
|
3745
3738
|
yt.info("layout", e.values);
|
|
3746
3739
|
}),
|
|
3747
3740
|
D()
|
|
3748
3741
|
);
|
|
3749
3742
|
const u = this.navigateSubject.pipe(
|
|
3750
|
-
|
|
3743
|
+
x((l) => {
|
|
3751
3744
|
yt.info("Navigation requested", l);
|
|
3752
3745
|
})
|
|
3753
3746
|
);
|
|
@@ -3763,9 +3756,9 @@ class jo extends G {
|
|
|
3763
3756
|
return d.style.setProperty("transition", "none"), d.style.setProperty("opacity", "1"), P(
|
|
3764
3757
|
v(!0),
|
|
3765
3758
|
v(null).pipe(
|
|
3766
|
-
|
|
3759
|
+
ge(() => {
|
|
3767
3760
|
if (l?.type !== "manualAdjust") return v(!1);
|
|
3768
|
-
const
|
|
3761
|
+
const g = l.animation === "snap" ? e.values.snapAnimationDuration : e.values.computedPageTurnAnimationDuration, p = l.animation === "snap" ? "slide" : e.values.computedPageTurnAnimation;
|
|
3769
3762
|
return v(l).pipe(
|
|
3770
3763
|
/**
|
|
3771
3764
|
* @important
|
|
@@ -3776,14 +3769,14 @@ class jo extends G {
|
|
|
3776
3769
|
* However when user is repeatedly turning page, we can improve smoothness by delaying a bit the adjustment
|
|
3777
3770
|
*/
|
|
3778
3771
|
l.shouldAnimate ? Pe(1, re) : xe,
|
|
3779
|
-
|
|
3772
|
+
x((h) => {
|
|
3780
3773
|
const m = this.element$.getValue();
|
|
3781
|
-
h.shouldAnimate ?
|
|
3774
|
+
h.shouldAnimate ? p === "fade" ? (m.style.setProperty(
|
|
3782
3775
|
"transition",
|
|
3783
|
-
`opacity ${
|
|
3784
|
-
), m.style.setProperty("opacity", "0")) : (l.animation === "snap" ||
|
|
3776
|
+
`opacity ${g / 2}ms`
|
|
3777
|
+
), m.style.setProperty("opacity", "0")) : (l.animation === "snap" || p === "slide") && (m.style.setProperty(
|
|
3785
3778
|
"transition",
|
|
3786
|
-
`transform ${
|
|
3779
|
+
`transform ${g}ms`
|
|
3787
3780
|
), m.style.setProperty("opacity", "1")) : (m.style.setProperty("transition", "none"), m.style.setProperty("opacity", "1"));
|
|
3788
3781
|
}),
|
|
3789
3782
|
/**
|
|
@@ -3794,17 +3787,17 @@ class jo extends G {
|
|
|
3794
3787
|
* need to adjust to anchor to the payload position. This is because we use viewport computed position,
|
|
3795
3788
|
* not the value set by `setProperty`
|
|
3796
3789
|
*/
|
|
3797
|
-
|
|
3798
|
-
|
|
3790
|
+
x((h) => {
|
|
3791
|
+
p !== "fade" && this.setViewportPosition(h.position);
|
|
3799
3792
|
}),
|
|
3800
|
-
l.shouldAnimate ? Pe(
|
|
3801
|
-
|
|
3793
|
+
l.shouldAnimate ? Pe(g / 2, re) : xe,
|
|
3794
|
+
x((h) => {
|
|
3802
3795
|
const m = this.element$.getValue();
|
|
3803
|
-
|
|
3796
|
+
p === "fade" && (this.setViewportPosition(h.position), m.style.setProperty("opacity", "1"));
|
|
3804
3797
|
}),
|
|
3805
|
-
l.shouldAnimate ? Pe(
|
|
3806
|
-
|
|
3807
|
-
|
|
3798
|
+
l.shouldAnimate ? Pe(g / 2, re) : xe,
|
|
3799
|
+
x((h) => {
|
|
3800
|
+
p === "fade" && this.setViewportPosition(h.position);
|
|
3808
3801
|
})
|
|
3809
3802
|
);
|
|
3810
3803
|
}),
|
|
@@ -3825,7 +3818,7 @@ class jo extends G {
|
|
|
3825
3818
|
* for remark about flicker / fonts smoothing
|
|
3826
3819
|
*/
|
|
3827
3820
|
setViewportPosition(e) {
|
|
3828
|
-
const t = this.element$.getValue(), i =
|
|
3821
|
+
const t = this.element$.getValue(), i = Oo(e);
|
|
3829
3822
|
t.style.transform = `translate(${i.x}px, ${i.y}px)`, this.hookManager.execute("onViewportOffsetAdjust", void 0, {});
|
|
3830
3823
|
}
|
|
3831
3824
|
navigate(e) {
|
|
@@ -3840,10 +3833,10 @@ class jo extends G {
|
|
|
3840
3833
|
if (!i || i === "none")
|
|
3841
3834
|
return new M({ x: 0, y: 0 });
|
|
3842
3835
|
const o = new DOMMatrix(i);
|
|
3843
|
-
return
|
|
3836
|
+
return Vo(o);
|
|
3844
3837
|
}
|
|
3845
3838
|
}
|
|
3846
|
-
const
|
|
3839
|
+
const Uo = () => (n) => n.pipe(
|
|
3847
3840
|
S(({ navigation: e, pagination: t, ...i }) => ({
|
|
3848
3841
|
navigation: {
|
|
3849
3842
|
...e,
|
|
@@ -3851,7 +3844,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3851
3844
|
},
|
|
3852
3845
|
...i
|
|
3853
3846
|
}))
|
|
3854
|
-
),
|
|
3847
|
+
), zo = (n, e, t) => n.bridgeEvent.pagination$.pipe(
|
|
3855
3848
|
z(e),
|
|
3856
3849
|
C(
|
|
3857
3850
|
([i, o]) => i.navigationId === o.id
|
|
@@ -3868,8 +3861,8 @@ const ko = () => (n) => n.pipe(
|
|
|
3868
3861
|
navigation: o
|
|
3869
3862
|
}))
|
|
3870
3863
|
)),
|
|
3871
|
-
|
|
3872
|
-
|
|
3864
|
+
Uo(),
|
|
3865
|
+
R(
|
|
3873
3866
|
(i, o) => i.navigation.paginationBeginCfi === o.navigation.paginationBeginCfi
|
|
3874
3867
|
),
|
|
3875
3868
|
S(
|
|
@@ -3880,7 +3873,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3880
3873
|
}
|
|
3881
3874
|
})
|
|
3882
3875
|
)
|
|
3883
|
-
),
|
|
3876
|
+
), Wo = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
3884
3877
|
S(([t, i]) => {
|
|
3885
3878
|
const o = {
|
|
3886
3879
|
type: "api",
|
|
@@ -3917,7 +3910,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3917
3910
|
navigation: o
|
|
3918
3911
|
};
|
|
3919
3912
|
})
|
|
3920
|
-
),
|
|
3913
|
+
), _o = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
3921
3914
|
S((t) => {
|
|
3922
3915
|
if (t.navigation.cfi) {
|
|
3923
3916
|
const i = n.getNavigationForCfi(
|
|
@@ -3934,16 +3927,16 @@ const ko = () => (n) => n.pipe(
|
|
|
3934
3927
|
}
|
|
3935
3928
|
return t;
|
|
3936
3929
|
})
|
|
3937
|
-
),
|
|
3930
|
+
), Ho = ({
|
|
3938
3931
|
navigation: n,
|
|
3939
3932
|
previousNavigation: e,
|
|
3940
3933
|
settings: t
|
|
3941
|
-
}) => n.directionFromLastNavigation ? n.directionFromLastNavigation : n.url !== void 0 || n.cfi !== void 0 ? "anchor" : e.spineItem === void 0 || n.spineItem || !n.position ? "forward" : t.values.computedPageTurnDirection === "vertical" ? n.position.y > e.position.y || n.position.y === e.position.y && e.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(n.position.x) > Math.abs(e.position.x) || n.position.x === e.position.x && e.directionFromLastNavigation !== "backward" ? "forward" : "backward",
|
|
3934
|
+
}) => n.directionFromLastNavigation ? n.directionFromLastNavigation : n.url !== void 0 || n.cfi !== void 0 ? "anchor" : e.spineItem === void 0 || n.spineItem || !n.position ? "forward" : t.values.computedPageTurnDirection === "vertical" ? n.position.y > e.position.y || n.position.y === e.position.y && e.directionFromLastNavigation !== "backward" ? "forward" : "backward" : Math.abs(n.position.x) > Math.abs(e.position.x) || n.position.x === e.position.x && e.directionFromLastNavigation !== "backward" ? "forward" : "backward", Bo = ({
|
|
3942
3935
|
context: n,
|
|
3943
3936
|
settings: e
|
|
3944
3937
|
}) => (t) => t.pipe(
|
|
3945
3938
|
S(({ navigation: i, previousNavigation: o }) => {
|
|
3946
|
-
const s =
|
|
3939
|
+
const s = Ho({
|
|
3947
3940
|
navigation: i,
|
|
3948
3941
|
previousNavigation: o,
|
|
3949
3942
|
settings: e
|
|
@@ -3957,7 +3950,7 @@ const ko = () => (n) => n.pipe(
|
|
|
3957
3950
|
direction: s
|
|
3958
3951
|
};
|
|
3959
3952
|
})
|
|
3960
|
-
),
|
|
3953
|
+
), Xo = ({
|
|
3961
3954
|
spineItemsManager: n,
|
|
3962
3955
|
navigationResolver: e,
|
|
3963
3956
|
settings: t
|
|
@@ -4012,23 +4005,23 @@ const ko = () => (n) => n.pipe(
|
|
|
4012
4005
|
spineItem: c,
|
|
4013
4006
|
cfi: u,
|
|
4014
4007
|
directionFromLastNavigation: l
|
|
4015
|
-
} = r, { navigationSnapThreshold: d, computedPageTurnMode:
|
|
4008
|
+
} = r, { navigationSnapThreshold: d, computedPageTurnMode: g } = n.values;
|
|
4016
4009
|
if (c !== void 0) {
|
|
4017
|
-
const
|
|
4018
|
-
if (
|
|
4010
|
+
const p = e.get(c);
|
|
4011
|
+
if (p) return p;
|
|
4019
4012
|
}
|
|
4020
4013
|
if (typeof c == "number")
|
|
4021
4014
|
return c > e.items.length - 1 ? e.get(e.items.length - 1) : e.get(0);
|
|
4022
4015
|
if (u) {
|
|
4023
|
-
const
|
|
4024
|
-
if (
|
|
4016
|
+
const p = e.getSpineItemFromCfi(u);
|
|
4017
|
+
if (p) return p;
|
|
4025
4018
|
}
|
|
4026
|
-
if (a &&
|
|
4027
|
-
const { beginIndex:
|
|
4019
|
+
if (a && g === "controlled") {
|
|
4020
|
+
const { beginIndex: p, endIndex: h } = i.getVisibleSpineItemsFromPosition({
|
|
4028
4021
|
position: a,
|
|
4029
4022
|
threshold: d,
|
|
4030
4023
|
restrictToScreen: !1
|
|
4031
|
-
}) ?? {}, m = (l === "forward" || l === "anchor" ? h :
|
|
4024
|
+
}) ?? {}, m = (l === "forward" || l === "anchor" ? h : p) ?? p, y = e.get(m);
|
|
4032
4025
|
if (!y) return;
|
|
4033
4026
|
const { endPageIndex: f, beginPageIndex: I } = i.getVisiblePagesFromViewportPosition({
|
|
4034
4027
|
position: a,
|
|
@@ -4038,14 +4031,14 @@ const ko = () => (n) => n.pipe(
|
|
|
4038
4031
|
}) ?? {}, b = (l === "forward" || l === "anchor" ? f : I) ?? 0, F = t.getNavigationForSpineItemPage({
|
|
4039
4032
|
pageIndex: b,
|
|
4040
4033
|
spineItemId: y
|
|
4041
|
-
}),
|
|
4034
|
+
}), $ = i.getVisibleSpineItemsFromPosition({
|
|
4042
4035
|
position: F,
|
|
4043
4036
|
threshold: d,
|
|
4044
4037
|
restrictToScreen: !1
|
|
4045
|
-
}), L = l === "forward" || l === "anchor" ?
|
|
4038
|
+
}), L = l === "forward" || l === "anchor" ? $?.beginIndex : $?.endIndex;
|
|
4046
4039
|
return e.get(L);
|
|
4047
4040
|
}
|
|
4048
|
-
return a &&
|
|
4041
|
+
return a && g === "scrollable" ? i.getSpineItemFromPosition(a) : e.get(0);
|
|
4049
4042
|
};
|
|
4050
4043
|
return o.pipe(
|
|
4051
4044
|
S(({ navigation: r, ...a }) => {
|
|
@@ -4097,11 +4090,11 @@ const ko = () => (n) => n.pipe(
|
|
|
4097
4090
|
spineItem: u,
|
|
4098
4091
|
threshold: a,
|
|
4099
4092
|
restrictToScreen: !1
|
|
4100
|
-
}) ?? {},
|
|
4101
|
-
pageIndex:
|
|
4093
|
+
}) ?? {}, g = (r.directionFromLastNavigation === "forward" || r.directionFromLastNavigation === "anchor" ? l : d) ?? 0, p = i.getNavigationForSpineItemPage({
|
|
4094
|
+
pageIndex: g,
|
|
4102
4095
|
spineItemId: u
|
|
4103
4096
|
}), h = t.getVisiblePagesFromViewportPosition({
|
|
4104
|
-
position:
|
|
4097
|
+
position: p,
|
|
4105
4098
|
spineItem: u,
|
|
4106
4099
|
threshold: { type: "percentage", value: 0 },
|
|
4107
4100
|
restrictToScreen: !0
|
|
@@ -4126,7 +4119,7 @@ const ko = () => (n) => n.pipe(
|
|
|
4126
4119
|
...a
|
|
4127
4120
|
}))
|
|
4128
4121
|
);
|
|
4129
|
-
},
|
|
4122
|
+
}, Yo = ({ navigationResolver: n }) => (e) => e.pipe(
|
|
4130
4123
|
S((t) => {
|
|
4131
4124
|
if (t.navigation.url) {
|
|
4132
4125
|
const i = n.getNavigationForUrl(
|
|
@@ -4149,7 +4142,7 @@ class Xt {
|
|
|
4149
4142
|
constructor() {
|
|
4150
4143
|
this.isLockedSubject = new q(0), this.isLocked$ = this.isLockedSubject.pipe(
|
|
4151
4144
|
S((e) => !!e),
|
|
4152
|
-
|
|
4145
|
+
R()
|
|
4153
4146
|
);
|
|
4154
4147
|
}
|
|
4155
4148
|
lock() {
|
|
@@ -4159,7 +4152,7 @@ class Xt {
|
|
|
4159
4152
|
};
|
|
4160
4153
|
}
|
|
4161
4154
|
}
|
|
4162
|
-
const
|
|
4155
|
+
const qo = ({
|
|
4163
4156
|
spineLocator: n,
|
|
4164
4157
|
navigation: e,
|
|
4165
4158
|
navigationResolver: t,
|
|
@@ -4177,46 +4170,46 @@ const Yo = ({
|
|
|
4177
4170
|
if (e.url !== void 0 && (u || l || // when spine item is ready dimensions may have not changed but the position
|
|
4178
4171
|
// of dom elements may have!
|
|
4179
4172
|
r && !e.spineItemIsReady)) {
|
|
4180
|
-
const
|
|
4173
|
+
const p = t.getNavigationForUrl(
|
|
4181
4174
|
e.url
|
|
4182
4175
|
);
|
|
4183
|
-
if (
|
|
4184
|
-
return
|
|
4176
|
+
if (p)
|
|
4177
|
+
return p.position;
|
|
4185
4178
|
}
|
|
4186
|
-
const
|
|
4187
|
-
if (
|
|
4179
|
+
const g = e.cfi ?? e.paginationBeginCfi;
|
|
4180
|
+
if (g !== void 0 && !Be(g) && (u || l || // when spine item is ready dimensions may have not changed but the position
|
|
4188
4181
|
// of dom elements may have!
|
|
4189
4182
|
r && !e.spineItemIsReady)) {
|
|
4190
|
-
const
|
|
4191
|
-
if (
|
|
4192
|
-
return
|
|
4183
|
+
const p = t.getNavigationForCfi(g);
|
|
4184
|
+
if (p)
|
|
4185
|
+
return p;
|
|
4193
4186
|
}
|
|
4194
4187
|
if (c && d && e.directionFromLastNavigation === "backward") {
|
|
4195
|
-
const
|
|
4188
|
+
const p = new E({
|
|
4196
4189
|
x: (e.positionInSpineItem?.x ?? 0) + u,
|
|
4197
4190
|
y: (e.positionInSpineItem?.y ?? 0) + l
|
|
4198
4191
|
});
|
|
4199
4192
|
return t.getNavigationFromSpineItemPosition({
|
|
4200
4193
|
spineItem: s,
|
|
4201
|
-
spineItemPosition:
|
|
4194
|
+
spineItemPosition: p
|
|
4202
4195
|
});
|
|
4203
4196
|
}
|
|
4204
4197
|
if (e.positionInSpineItem && e.spineItemHeight && e.spineItemWidth) {
|
|
4205
|
-
const
|
|
4198
|
+
const p = n.spineItemLocator.getSpineItemPageIndexFromPosition({
|
|
4206
4199
|
itemWidth: e.spineItemWidth,
|
|
4207
4200
|
itemHeight: e.spineItemHeight,
|
|
4208
4201
|
isUsingVerticalWriting: !!e.spineItemIsUsingVerticalWriting,
|
|
4209
4202
|
position: e.positionInSpineItem
|
|
4210
4203
|
});
|
|
4211
4204
|
return t.getNavigationForSpineItemPage({
|
|
4212
|
-
pageIndex:
|
|
4205
|
+
pageIndex: p,
|
|
4213
4206
|
spineItemId: s
|
|
4214
4207
|
});
|
|
4215
4208
|
}
|
|
4216
4209
|
return c ? t.getNavigationForPosition(e.position) : t.getNavigationForSpineIndexOrId(s);
|
|
4217
4210
|
})
|
|
4218
4211
|
) : v(new M({ x: 0, y: 0 }));
|
|
4219
|
-
},
|
|
4212
|
+
}, Go = ({
|
|
4220
4213
|
navigation: n,
|
|
4221
4214
|
spineLocator: e,
|
|
4222
4215
|
spineItemsManager: t,
|
|
@@ -4239,7 +4232,7 @@ const Yo = ({
|
|
|
4239
4232
|
if (u === n.spineItemTop && c === n.spineItemHeight && !l)
|
|
4240
4233
|
return o.getNavigationForSpineIndexOrId(a);
|
|
4241
4234
|
if (u !== n.spineItemTop) {
|
|
4242
|
-
const
|
|
4235
|
+
const g = e.getSafeSpineItemPositionFromUnsafeSpineItemPosition(
|
|
4243
4236
|
n.positionInSpineItem ?? new E({
|
|
4244
4237
|
x: 0,
|
|
4245
4238
|
y: 0
|
|
@@ -4247,18 +4240,18 @@ const Yo = ({
|
|
|
4247
4240
|
a
|
|
4248
4241
|
);
|
|
4249
4242
|
return e.getSpinePositionFromSpineItemPosition({
|
|
4250
|
-
spineItemPosition:
|
|
4243
|
+
spineItemPosition: g,
|
|
4251
4244
|
spineItem: a
|
|
4252
4245
|
});
|
|
4253
4246
|
}
|
|
4254
4247
|
if (u === n.spineItemTop && c !== n.spineItemHeight) {
|
|
4255
|
-
const
|
|
4256
|
-
y: n.directionFromLastNavigation === "backward" ? c -
|
|
4248
|
+
const g = (n.spineItemHeight ?? d.y) - d.y, p = new E({
|
|
4249
|
+
y: n.directionFromLastNavigation === "backward" ? c - g : d.y,
|
|
4257
4250
|
x: n.position.x
|
|
4258
4251
|
});
|
|
4259
4252
|
if (l) {
|
|
4260
4253
|
const h = e.getSafeSpineItemPositionFromUnsafeSpineItemPosition(
|
|
4261
|
-
|
|
4254
|
+
p,
|
|
4262
4255
|
a
|
|
4263
4256
|
);
|
|
4264
4257
|
return e.getSpinePositionFromSpineItemPosition({
|
|
@@ -4269,7 +4262,7 @@ const Yo = ({
|
|
|
4269
4262
|
if (!l) {
|
|
4270
4263
|
if (!(n.position.y < u)) {
|
|
4271
4264
|
const m = new E({
|
|
4272
|
-
y: c -
|
|
4265
|
+
y: c - g,
|
|
4273
4266
|
x: n.position.x
|
|
4274
4267
|
});
|
|
4275
4268
|
return e.getSpinePositionFromSpineItemPosition({
|
|
@@ -4285,7 +4278,7 @@ const Yo = ({
|
|
|
4285
4278
|
}
|
|
4286
4279
|
}
|
|
4287
4280
|
return n.position;
|
|
4288
|
-
},
|
|
4281
|
+
}, Zo = ({
|
|
4289
4282
|
navigation: n,
|
|
4290
4283
|
spineItemsManager: e,
|
|
4291
4284
|
settings: t,
|
|
@@ -4293,7 +4286,7 @@ const Yo = ({
|
|
|
4293
4286
|
navigationResolver: o,
|
|
4294
4287
|
spine: s
|
|
4295
4288
|
}) => t.values.computedPageTurnMode === "scrollable" ? v(
|
|
4296
|
-
|
|
4289
|
+
Go({
|
|
4297
4290
|
navigation: n,
|
|
4298
4291
|
spineLocator: i,
|
|
4299
4292
|
navigationResolver: o,
|
|
@@ -4301,7 +4294,7 @@ const Yo = ({
|
|
|
4301
4294
|
spineItemsManager: e,
|
|
4302
4295
|
spine: s
|
|
4303
4296
|
})
|
|
4304
|
-
) :
|
|
4297
|
+
) : qo({
|
|
4305
4298
|
navigation: n,
|
|
4306
4299
|
spineLocator: i,
|
|
4307
4300
|
navigationResolver: o,
|
|
@@ -4313,7 +4306,7 @@ const Yo = ({
|
|
|
4313
4306
|
context: t,
|
|
4314
4307
|
spine: i
|
|
4315
4308
|
}) => (o) => o.pipe(
|
|
4316
|
-
w((s) =>
|
|
4309
|
+
w((s) => Zo({
|
|
4317
4310
|
spineLocator: i.locator,
|
|
4318
4311
|
navigation: s.navigation,
|
|
4319
4312
|
navigationResolver: e,
|
|
@@ -4330,8 +4323,8 @@ const Yo = ({
|
|
|
4330
4323
|
}
|
|
4331
4324
|
}))
|
|
4332
4325
|
))
|
|
4333
|
-
),
|
|
4334
|
-
class
|
|
4326
|
+
), Jo = "navigation/InternalNavigator", Ko = A.namespace(Jo);
|
|
4327
|
+
class Qo extends G {
|
|
4335
4328
|
constructor(e, t, i, o, s, r, a, c) {
|
|
4336
4329
|
super(), this.settings = e, this.context = t, this.userNavigation$ = i, this.controlledNavigationController = o, this.scrollNavigationController = s, this.navigationResolver = r, this.spine = a, this.isRestorationLocked$ = c, this.navigationSubject = new q({
|
|
4337
4330
|
animation: !1,
|
|
@@ -4347,31 +4340,31 @@ class Ko extends G {
|
|
|
4347
4340
|
position: f,
|
|
4348
4341
|
id: I
|
|
4349
4342
|
})),
|
|
4350
|
-
|
|
4343
|
+
R(
|
|
4351
4344
|
({ position: f, ...I }, { position: b, ...F }) => O(I, F) && O(f, b)
|
|
4352
4345
|
),
|
|
4353
4346
|
J(1)
|
|
4354
4347
|
), this.locker = new Xt();
|
|
4355
4348
|
const u = i.pipe(
|
|
4356
4349
|
z(this.navigationSubject),
|
|
4357
|
-
|
|
4350
|
+
Wo({
|
|
4358
4351
|
navigationResolver: r
|
|
4359
4352
|
}),
|
|
4360
4353
|
/**
|
|
4361
4354
|
* Url lookup is heavier so we start with it to fill
|
|
4362
4355
|
* as much information as needed to reduce later lookup
|
|
4363
4356
|
*/
|
|
4364
|
-
|
|
4357
|
+
Yo({
|
|
4365
4358
|
navigationResolver: r
|
|
4366
4359
|
}),
|
|
4367
4360
|
/**
|
|
4368
4361
|
* Cfi lookup is heavier so we start with it to fill
|
|
4369
4362
|
* as much information as needed to reduce later lookup
|
|
4370
4363
|
*/
|
|
4371
|
-
|
|
4364
|
+
_o({
|
|
4372
4365
|
navigationResolver: r
|
|
4373
4366
|
}),
|
|
4374
|
-
|
|
4367
|
+
Bo({ context: t, settings: e }),
|
|
4375
4368
|
St({
|
|
4376
4369
|
navigationResolver: r,
|
|
4377
4370
|
settings: e,
|
|
@@ -4388,7 +4381,7 @@ class Ko extends G {
|
|
|
4388
4381
|
spine: a
|
|
4389
4382
|
})
|
|
4390
4383
|
).pipe(
|
|
4391
|
-
|
|
4384
|
+
Xo({
|
|
4392
4385
|
navigationResolver: r,
|
|
4393
4386
|
spineItemsManager: a.spineItemsManager,
|
|
4394
4387
|
settings: e
|
|
@@ -4460,7 +4453,7 @@ class Ko extends G {
|
|
|
4460
4453
|
P(l, u)
|
|
4461
4454
|
)
|
|
4462
4455
|
))
|
|
4463
|
-
),
|
|
4456
|
+
), g = P(
|
|
4464
4457
|
d,
|
|
4465
4458
|
l
|
|
4466
4459
|
).pipe(
|
|
@@ -4505,17 +4498,17 @@ class Ko extends G {
|
|
|
4505
4498
|
}),
|
|
4506
4499
|
S(({ navigation: f }) => f),
|
|
4507
4500
|
D()
|
|
4508
|
-
),
|
|
4501
|
+
), p = zo(
|
|
4509
4502
|
t,
|
|
4510
4503
|
this.navigationSubject,
|
|
4511
4504
|
a
|
|
4512
4505
|
), h = P(
|
|
4513
|
-
|
|
4506
|
+
g,
|
|
4514
4507
|
u,
|
|
4515
|
-
|
|
4508
|
+
p
|
|
4516
4509
|
), m = (f) => f.pipe(
|
|
4517
|
-
|
|
4518
|
-
|
|
4510
|
+
x(([I, b]) => {
|
|
4511
|
+
Ko.info(
|
|
4519
4512
|
`navigation updated from ${I.meta.triggeredBy} of type ${I.type}`,
|
|
4520
4513
|
{
|
|
4521
4514
|
previousNavigation: b,
|
|
@@ -4524,12 +4517,12 @@ class Ko extends G {
|
|
|
4524
4517
|
), this.navigationSubject.next(I);
|
|
4525
4518
|
})
|
|
4526
4519
|
), y = (f) => f.pipe(
|
|
4527
|
-
|
|
4528
|
-
const F = I.type === "scroll",
|
|
4520
|
+
x(([I, b]) => {
|
|
4521
|
+
const F = I.type === "scroll", $ = I.meta.triggeredBy === "pagination", L = I.meta.triggeredBy === "restoration", H = O(
|
|
4529
4522
|
b.position,
|
|
4530
4523
|
I.position
|
|
4531
4524
|
);
|
|
4532
|
-
if (F && !L ||
|
|
4525
|
+
if (F && !L || $ || H)
|
|
4533
4526
|
return;
|
|
4534
4527
|
const B = {
|
|
4535
4528
|
position: I.position,
|
|
@@ -4573,7 +4566,7 @@ const Fe = (n, e, t) => {
|
|
|
4573
4566
|
}, vt = (n, e, t) => {
|
|
4574
4567
|
const i = [...Array(t)].map((o, s) => s * e);
|
|
4575
4568
|
return n <= 0 || t === 0 ? 0 : n >= t * e ? t - 1 : i.findIndex((o) => n < o + e) ?? 0;
|
|
4576
|
-
},
|
|
4569
|
+
}, es = ({
|
|
4577
4570
|
itemWidth: n,
|
|
4578
4571
|
itemHeight: e,
|
|
4579
4572
|
spineItemPosition: t
|
|
@@ -4599,7 +4592,7 @@ const Fe = (n, e, t) => {
|
|
|
4599
4592
|
pageTurnMode: a,
|
|
4600
4593
|
isRTL: c
|
|
4601
4594
|
}) => {
|
|
4602
|
-
const l =
|
|
4595
|
+
const l = es({
|
|
4603
4596
|
spineItemPosition: t,
|
|
4604
4597
|
itemHeight: e,
|
|
4605
4598
|
itemWidth: n
|
|
@@ -4614,9 +4607,9 @@ const Fe = (n, e, t) => {
|
|
|
4614
4607
|
});
|
|
4615
4608
|
if (i)
|
|
4616
4609
|
return vt(t.y, s, d);
|
|
4617
|
-
const
|
|
4618
|
-
return c ? d - 1 -
|
|
4619
|
-
},
|
|
4610
|
+
const g = vt(l, o, d);
|
|
4611
|
+
return c ? d - 1 - g : g;
|
|
4612
|
+
}, ts = ({
|
|
4620
4613
|
pageIndex: n,
|
|
4621
4614
|
itemLayout: e,
|
|
4622
4615
|
context: t,
|
|
@@ -4654,14 +4647,14 @@ const Fe = (n, e, t) => {
|
|
|
4654
4647
|
const i = (a, c, u) => {
|
|
4655
4648
|
let l;
|
|
4656
4649
|
a?.nodeName === "img" || a?.textContent === "" && a.nodeType === Node.ELEMENT_NODE ? l = a.getBoundingClientRect().x : a && (l = (a ? Cn(a, c) : void 0)?.getBoundingClientRect().x || l);
|
|
4657
|
-
const d = u.layoutInfo?.width || 0,
|
|
4650
|
+
const d = u.layoutInfo?.width || 0, g = t.pageSize.width;
|
|
4658
4651
|
if (l !== void 0) {
|
|
4659
|
-
const
|
|
4652
|
+
const p = ke(
|
|
4660
4653
|
l,
|
|
4661
|
-
|
|
4654
|
+
g,
|
|
4662
4655
|
d
|
|
4663
4656
|
);
|
|
4664
|
-
return new E({ x:
|
|
4657
|
+
return new E({ x: p, y: 0 });
|
|
4665
4658
|
}
|
|
4666
4659
|
};
|
|
4667
4660
|
return {
|
|
@@ -4669,7 +4662,7 @@ const Fe = (n, e, t) => {
|
|
|
4669
4662
|
getSpineItemPositionFromPageIndex: ({
|
|
4670
4663
|
pageIndex: a,
|
|
4671
4664
|
spineItem: c
|
|
4672
|
-
}) =>
|
|
4665
|
+
}) => ts({
|
|
4673
4666
|
context: n,
|
|
4674
4667
|
isUsingVerticalWriting: !!c.isUsingVerticalWriting(),
|
|
4675
4668
|
itemLayout: c.layoutInfo,
|
|
@@ -4685,12 +4678,12 @@ const Fe = (n, e, t) => {
|
|
|
4685
4678
|
pageTurnMode: e.values.pageTurnMode
|
|
4686
4679
|
}),
|
|
4687
4680
|
getSpineItemPageIndexFromNode: (a, c, u) => {
|
|
4688
|
-
const l = i(a, c, u), { height: d, width:
|
|
4681
|
+
const l = i(a, c, u), { height: d, width: g } = u.layoutInfo;
|
|
4689
4682
|
return l ? wt({
|
|
4690
4683
|
isUsingVerticalWriting: !!u.isUsingVerticalWriting(),
|
|
4691
4684
|
position: l,
|
|
4692
4685
|
itemHeight: d,
|
|
4693
|
-
itemWidth:
|
|
4686
|
+
itemWidth: g,
|
|
4694
4687
|
isRTL: n.isRTL(),
|
|
4695
4688
|
pageWidth: t.pageSize.width,
|
|
4696
4689
|
pageHeight: t.pageSize.height,
|
|
@@ -4714,33 +4707,33 @@ const Fe = (n, e, t) => {
|
|
|
4714
4707
|
});
|
|
4715
4708
|
},
|
|
4716
4709
|
getSpineItemPagePositionFromSpineItemPosition: (a, c, u) => {
|
|
4717
|
-
const { width: l, height: d } = u.layoutInfo,
|
|
4710
|
+
const { width: l, height: d } = u.layoutInfo, g = t.pageSize.width, p = t.pageSize.height;
|
|
4718
4711
|
if (!!u.isUsingVerticalWriting()) {
|
|
4719
4712
|
const y = Fe(
|
|
4720
|
-
|
|
4713
|
+
p,
|
|
4721
4714
|
c,
|
|
4722
4715
|
d
|
|
4723
4716
|
);
|
|
4724
|
-
return new
|
|
4717
|
+
return new Re({
|
|
4725
4718
|
x: a.x,
|
|
4726
4719
|
y: a.y - y
|
|
4727
4720
|
});
|
|
4728
4721
|
}
|
|
4729
|
-
const m = Fe(
|
|
4722
|
+
const m = Fe(g, c, l);
|
|
4730
4723
|
if (n.isRTL()) {
|
|
4731
|
-
const y = l - (c + 1) *
|
|
4732
|
-
return new
|
|
4724
|
+
const y = l - (c + 1) * g;
|
|
4725
|
+
return new Re({
|
|
4733
4726
|
x: a.x - Math.max(0, y),
|
|
4734
4727
|
y: a.y
|
|
4735
4728
|
});
|
|
4736
4729
|
}
|
|
4737
|
-
return new
|
|
4730
|
+
return new Re({
|
|
4738
4731
|
x: a.x - m,
|
|
4739
4732
|
y: a.y
|
|
4740
4733
|
});
|
|
4741
4734
|
}
|
|
4742
4735
|
};
|
|
4743
|
-
},
|
|
4736
|
+
}, ns = ({
|
|
4744
4737
|
context: n,
|
|
4745
4738
|
settings: e,
|
|
4746
4739
|
viewport: t
|
|
@@ -4782,15 +4775,15 @@ function Gt({
|
|
|
4782
4775
|
s || 0
|
|
4783
4776
|
), a = r.bottom - 1, c = Math.max(0, n.y), u = Math.min(c, a);
|
|
4784
4777
|
if (e) {
|
|
4785
|
-
const
|
|
4778
|
+
const p = Math.min(o, n.x), h = Math.max(p, r.left);
|
|
4786
4779
|
return new M({
|
|
4787
4780
|
x: h,
|
|
4788
4781
|
y: u
|
|
4789
4782
|
});
|
|
4790
4783
|
}
|
|
4791
|
-
const l = r.right - 1, d = Math.max(0, n.x),
|
|
4784
|
+
const l = r.right - 1, d = Math.max(0, n.x), g = Math.min(d, l);
|
|
4792
4785
|
return new M({
|
|
4793
|
-
x:
|
|
4786
|
+
x: g,
|
|
4794
4787
|
y: u
|
|
4795
4788
|
});
|
|
4796
4789
|
}
|
|
@@ -4812,9 +4805,9 @@ const Pt = ({
|
|
|
4812
4805
|
i.items.length - 1
|
|
4813
4806
|
), c = s.getSpineItemSpineLayoutInfo(a), u = c.bottom - t, l = Math.min(r.y, u);
|
|
4814
4807
|
if (e) {
|
|
4815
|
-
const
|
|
4808
|
+
const g = Math.min(0, r.x);
|
|
4816
4809
|
return new M({
|
|
4817
|
-
x:
|
|
4810
|
+
x: g,
|
|
4818
4811
|
y: l
|
|
4819
4812
|
});
|
|
4820
4813
|
}
|
|
@@ -4855,7 +4848,7 @@ const Pt = ({
|
|
|
4855
4848
|
});
|
|
4856
4849
|
}
|
|
4857
4850
|
return new M({ x: 0, y: 0 });
|
|
4858
|
-
},
|
|
4851
|
+
}, is = ({
|
|
4859
4852
|
pageIndex: n,
|
|
4860
4853
|
spineItemsManager: e,
|
|
4861
4854
|
spineItemId: t,
|
|
@@ -4885,28 +4878,28 @@ const Pt = ({
|
|
|
4885
4878
|
pageSizeWidth: s.pageSize.width,
|
|
4886
4879
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
4887
4880
|
});
|
|
4888
|
-
},
|
|
4881
|
+
}, os = (n, e) => {
|
|
4889
4882
|
if (e && e instanceof HTMLIFrameElement)
|
|
4890
4883
|
return n.startsWith("#") ? e.contentDocument?.getElementById(
|
|
4891
4884
|
n.replace("#", "")
|
|
4892
4885
|
) : e.contentDocument?.querySelector(n);
|
|
4893
|
-
},
|
|
4886
|
+
}, ss = ({
|
|
4894
4887
|
anchor: n,
|
|
4895
4888
|
spineItem: e,
|
|
4896
4889
|
spine: t
|
|
4897
4890
|
}) => {
|
|
4898
|
-
const i =
|
|
4891
|
+
const i = os(
|
|
4899
4892
|
n,
|
|
4900
4893
|
e.renderer.getDocumentFrame()
|
|
4901
4894
|
);
|
|
4902
4895
|
return i ? t.spineItemLocator.getSpineItemPositionFromNode(i, 0, e)?.x ?? 0 : 0;
|
|
4903
|
-
},
|
|
4896
|
+
}, rs = ({
|
|
4904
4897
|
anchor: n,
|
|
4905
4898
|
spineItem: e,
|
|
4906
4899
|
spineLocator: t,
|
|
4907
4900
|
spine: i
|
|
4908
4901
|
}) => {
|
|
4909
|
-
const o =
|
|
4902
|
+
const o = ss({
|
|
4910
4903
|
anchor: n,
|
|
4911
4904
|
spineItem: e,
|
|
4912
4905
|
spine: i
|
|
@@ -4915,7 +4908,7 @@ const Pt = ({
|
|
|
4915
4908
|
spineItemPosition: new E({ x: o, y: 0 }),
|
|
4916
4909
|
spineItem: e
|
|
4917
4910
|
});
|
|
4918
|
-
},
|
|
4911
|
+
}, as = ({
|
|
4919
4912
|
anchor: n,
|
|
4920
4913
|
spineItem: e,
|
|
4921
4914
|
spineLocator: t,
|
|
@@ -4923,7 +4916,7 @@ const Pt = ({
|
|
|
4923
4916
|
pageSizeWidth: o,
|
|
4924
4917
|
visibleAreaRectWidth: s
|
|
4925
4918
|
}) => {
|
|
4926
|
-
const r =
|
|
4919
|
+
const r = rs({
|
|
4927
4920
|
anchor: n,
|
|
4928
4921
|
spineItem: e,
|
|
4929
4922
|
spineLocator: t,
|
|
@@ -4934,7 +4927,7 @@ const Pt = ({
|
|
|
4934
4927
|
pageSizeWidth: o,
|
|
4935
4928
|
visibleAreaRectWidth: s
|
|
4936
4929
|
});
|
|
4937
|
-
},
|
|
4930
|
+
}, cs = ({
|
|
4938
4931
|
spine: n,
|
|
4939
4932
|
spineItemsManager: e,
|
|
4940
4933
|
spineLocator: t,
|
|
@@ -4950,7 +4943,7 @@ const Pt = ({
|
|
|
4950
4943
|
if (u) {
|
|
4951
4944
|
const l = e.get(u.id);
|
|
4952
4945
|
if (l) {
|
|
4953
|
-
const d =
|
|
4946
|
+
const d = as({
|
|
4954
4947
|
anchor: a.hash,
|
|
4955
4948
|
spineItem: l,
|
|
4956
4949
|
spine: n,
|
|
@@ -4973,7 +4966,7 @@ const Pt = ({
|
|
|
4973
4966
|
console.error(a);
|
|
4974
4967
|
return;
|
|
4975
4968
|
}
|
|
4976
|
-
},
|
|
4969
|
+
}, us = ({
|
|
4977
4970
|
spineItem: n,
|
|
4978
4971
|
spineItemPosition: e,
|
|
4979
4972
|
spineLocator: t,
|
|
@@ -4992,7 +4985,7 @@ const Pt = ({
|
|
|
4992
4985
|
pageSizeWidth: o.pageSize.width,
|
|
4993
4986
|
visibleAreaRectWidth: o.absoluteViewport.width
|
|
4994
4987
|
});
|
|
4995
|
-
},
|
|
4988
|
+
}, ls = "spineNavigator", ds = ({
|
|
4996
4989
|
context: n,
|
|
4997
4990
|
spineItemsManager: e,
|
|
4998
4991
|
locator: t,
|
|
@@ -5000,41 +4993,41 @@ const Pt = ({
|
|
|
5000
4993
|
spine: o,
|
|
5001
4994
|
viewport: s
|
|
5002
4995
|
}) => {
|
|
5003
|
-
const r =
|
|
4996
|
+
const r = ns({
|
|
5004
4997
|
context: n,
|
|
5005
4998
|
settings: i,
|
|
5006
4999
|
viewport: s
|
|
5007
5000
|
});
|
|
5008
5001
|
return {
|
|
5009
|
-
getNavigationForUrl: (
|
|
5002
|
+
getNavigationForUrl: (p) => cs({
|
|
5010
5003
|
context: n,
|
|
5011
5004
|
spineItemsManager: e,
|
|
5012
5005
|
spineLocator: t,
|
|
5013
|
-
url:
|
|
5006
|
+
url: p,
|
|
5014
5007
|
pageSizeWidth: s.pageSize.width,
|
|
5015
5008
|
visibleAreaRectWidth: s.absoluteViewport.width,
|
|
5016
5009
|
spine: o
|
|
5017
5010
|
}),
|
|
5018
|
-
getNavigationForSpineItemPage: (
|
|
5019
|
-
...
|
|
5011
|
+
getNavigationForSpineItemPage: (p) => is({
|
|
5012
|
+
...p,
|
|
5020
5013
|
spineItemsManager: e,
|
|
5021
5014
|
spineItemNavigationResolver: r,
|
|
5022
5015
|
spineLocator: t,
|
|
5023
5016
|
viewport: s
|
|
5024
5017
|
}),
|
|
5025
|
-
getNavigationFromSpineItemPosition: (
|
|
5026
|
-
...
|
|
5018
|
+
getNavigationFromSpineItemPosition: (p) => us({
|
|
5019
|
+
...p,
|
|
5027
5020
|
spineItemLocator: t.spineItemLocator,
|
|
5028
5021
|
spineLocator: t,
|
|
5029
5022
|
viewport: s
|
|
5030
5023
|
}),
|
|
5031
|
-
getNavigationForCfi: (
|
|
5032
|
-
const h = e.getSpineItemFromCfi(
|
|
5033
|
-
cfi:
|
|
5024
|
+
getNavigationForCfi: (p) => {
|
|
5025
|
+
const h = e.getSpineItemFromCfi(p), { node: m, offset: y = 0 } = _t({
|
|
5026
|
+
cfi: p,
|
|
5034
5027
|
spineItemsManager: e
|
|
5035
5028
|
});
|
|
5036
5029
|
if (!h) {
|
|
5037
|
-
A.warn(
|
|
5030
|
+
A.warn(ls, `unable to detect item id from cfi ${p}`);
|
|
5038
5031
|
return;
|
|
5039
5032
|
}
|
|
5040
5033
|
const f = m ? r.getNavigationFromNode(h, m, y) : new E({ x: 0, y: 0 }), I = t.getSpinePositionFromSpineItemPosition({
|
|
@@ -5047,10 +5040,10 @@ const Pt = ({
|
|
|
5047
5040
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
5048
5041
|
});
|
|
5049
5042
|
},
|
|
5050
|
-
getNavigationForLastPage: (
|
|
5051
|
-
const h = r.getNavigationForLastPage(
|
|
5043
|
+
getNavigationForLastPage: (p) => {
|
|
5044
|
+
const h = r.getNavigationForLastPage(p), m = t.getSpinePositionFromSpineItemPosition({
|
|
5052
5045
|
spineItemPosition: h,
|
|
5053
|
-
spineItem:
|
|
5046
|
+
spineItem: p
|
|
5054
5047
|
});
|
|
5055
5048
|
return te({
|
|
5056
5049
|
position: m,
|
|
@@ -5058,8 +5051,8 @@ const Pt = ({
|
|
|
5058
5051
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
5059
5052
|
});
|
|
5060
5053
|
},
|
|
5061
|
-
getNavigationForSpineIndexOrId: (
|
|
5062
|
-
const h = e.get(
|
|
5054
|
+
getNavigationForSpineIndexOrId: (p) => {
|
|
5055
|
+
const h = e.get(p);
|
|
5063
5056
|
if (h) {
|
|
5064
5057
|
const m = t.getSpinePositionFromSpineItem(h);
|
|
5065
5058
|
return te({
|
|
@@ -5070,14 +5063,14 @@ const Pt = ({
|
|
|
5070
5063
|
}
|
|
5071
5064
|
return new M({ x: 0, y: 0 });
|
|
5072
5065
|
},
|
|
5073
|
-
getNavigationForPosition: (
|
|
5074
|
-
viewportPosition:
|
|
5066
|
+
getNavigationForPosition: (p) => Ye({
|
|
5067
|
+
viewportPosition: p,
|
|
5075
5068
|
spineItemNavigationResolver: r,
|
|
5076
5069
|
spineLocator: t,
|
|
5077
5070
|
viewport: s
|
|
5078
5071
|
}),
|
|
5079
|
-
getMostPredominantNavigationForPosition: (
|
|
5080
|
-
const h = i.values.computedPageTurnDirection, m = 0.5, y = h === "horizontal" ?
|
|
5072
|
+
getMostPredominantNavigationForPosition: (p) => {
|
|
5073
|
+
const h = i.values.computedPageTurnDirection, m = 0.5, y = h === "horizontal" ? p.x + s.absoluteViewport.width * m : 0, f = h === "horizontal" ? 0 : p.y + s.absoluteViewport.height * m, I = Pt({
|
|
5081
5074
|
position: new M({
|
|
5082
5075
|
x: y,
|
|
5083
5076
|
y: f
|
|
@@ -5095,31 +5088,31 @@ const Pt = ({
|
|
|
5095
5088
|
viewport: s
|
|
5096
5089
|
});
|
|
5097
5090
|
},
|
|
5098
|
-
fromUnboundSpinePosition: (
|
|
5099
|
-
position:
|
|
5091
|
+
fromUnboundSpinePosition: (p) => Pt({
|
|
5092
|
+
position: p,
|
|
5100
5093
|
isRTL: n.isRTL(),
|
|
5101
5094
|
pageSizeHeight: s.pageSize.height,
|
|
5102
5095
|
visibleAreaRectWidth: s.absoluteViewport.width,
|
|
5103
5096
|
spineItemsManager: e,
|
|
5104
5097
|
spine: o
|
|
5105
5098
|
}),
|
|
5106
|
-
fromOutOfBoundsSpinePosition: (
|
|
5107
|
-
position:
|
|
5099
|
+
fromOutOfBoundsSpinePosition: (p) => Gt({
|
|
5100
|
+
position: p,
|
|
5108
5101
|
isRTL: n.isRTL(),
|
|
5109
5102
|
spineItemsManager: e,
|
|
5110
5103
|
spine: o,
|
|
5111
5104
|
viewportWidth: s.absoluteViewport.width
|
|
5112
5105
|
}),
|
|
5113
|
-
isNavigationGoingForwardFrom: (
|
|
5114
|
-
arePositionsDifferent: (
|
|
5115
|
-
getAdjustedPositionForSpread: (
|
|
5116
|
-
position:
|
|
5106
|
+
isNavigationGoingForwardFrom: (p, h) => i.values.computedPageTurnDirection === "vertical" ? p.y > h.y : p.x > h.x,
|
|
5107
|
+
arePositionsDifferent: (p, h) => p.x !== h.x || p.y !== h.y,
|
|
5108
|
+
getAdjustedPositionForSpread: (p) => te({
|
|
5109
|
+
position: p,
|
|
5117
5110
|
pageSizeWidth: s.pageSize.width,
|
|
5118
5111
|
visibleAreaRectWidth: s.absoluteViewport.width
|
|
5119
5112
|
}),
|
|
5120
5113
|
spineItemNavigator: r
|
|
5121
5114
|
};
|
|
5122
|
-
},
|
|
5115
|
+
}, ps = ({
|
|
5123
5116
|
spineItemsManager: n,
|
|
5124
5117
|
context: e,
|
|
5125
5118
|
hookManager: t,
|
|
@@ -5127,26 +5120,26 @@ const Pt = ({
|
|
|
5127
5120
|
settings: o,
|
|
5128
5121
|
viewport: s
|
|
5129
5122
|
}) => {
|
|
5130
|
-
const r = new
|
|
5123
|
+
const r = new N(), a = r.asObservable(), c = new Xt(), u = ds({
|
|
5131
5124
|
context: e,
|
|
5132
5125
|
settings: o,
|
|
5133
5126
|
spineItemsManager: n,
|
|
5134
5127
|
locator: i.locator,
|
|
5135
5128
|
spine: i,
|
|
5136
5129
|
viewport: s
|
|
5137
|
-
}), l = new
|
|
5130
|
+
}), l = new ko(
|
|
5138
5131
|
o,
|
|
5139
5132
|
t,
|
|
5140
5133
|
e,
|
|
5141
5134
|
i,
|
|
5142
5135
|
s
|
|
5143
|
-
), d = new
|
|
5136
|
+
), d = new To(
|
|
5144
5137
|
s,
|
|
5145
5138
|
o,
|
|
5146
5139
|
t,
|
|
5147
5140
|
i,
|
|
5148
5141
|
e
|
|
5149
|
-
),
|
|
5142
|
+
), g = new Qo(
|
|
5150
5143
|
o,
|
|
5151
5144
|
e,
|
|
5152
5145
|
a,
|
|
@@ -5155,11 +5148,11 @@ const Pt = ({
|
|
|
5155
5148
|
u,
|
|
5156
5149
|
i,
|
|
5157
5150
|
c.isLocked$
|
|
5158
|
-
),
|
|
5151
|
+
), p = j([
|
|
5159
5152
|
l.isNavigating$,
|
|
5160
5153
|
d.isNavigating$,
|
|
5161
5154
|
c.isLocked$,
|
|
5162
|
-
|
|
5155
|
+
g.locker.isLocked$
|
|
5163
5156
|
]).pipe(
|
|
5164
5157
|
ie((y) => y.some((f) => f) ? "busy" : "free"),
|
|
5165
5158
|
be(),
|
|
@@ -5167,14 +5160,14 @@ const Pt = ({
|
|
|
5167
5160
|
);
|
|
5168
5161
|
return {
|
|
5169
5162
|
destroy: () => {
|
|
5170
|
-
l.destroy(),
|
|
5163
|
+
l.destroy(), g.destroy();
|
|
5171
5164
|
},
|
|
5172
|
-
getNavigation: () =>
|
|
5173
|
-
internalNavigator:
|
|
5165
|
+
getNavigation: () => g.navigation,
|
|
5166
|
+
internalNavigator: g,
|
|
5174
5167
|
scrollNavigationController: d,
|
|
5175
5168
|
controlledNavigationController: l,
|
|
5176
5169
|
locker: c,
|
|
5177
|
-
navigationState$:
|
|
5170
|
+
navigationState$: p,
|
|
5178
5171
|
navigate: (y) => {
|
|
5179
5172
|
r.next(y);
|
|
5180
5173
|
},
|
|
@@ -5186,10 +5179,10 @@ const Pt = ({
|
|
|
5186
5179
|
return c.lock();
|
|
5187
5180
|
},
|
|
5188
5181
|
navigationResolver: u,
|
|
5189
|
-
navigation$:
|
|
5182
|
+
navigation$: g.navigation$
|
|
5190
5183
|
};
|
|
5191
5184
|
};
|
|
5192
|
-
class
|
|
5185
|
+
class gs extends Q {
|
|
5193
5186
|
constructor(e, t) {
|
|
5194
5187
|
super({
|
|
5195
5188
|
beginPageIndexInSpineItem: void 0,
|
|
@@ -5207,7 +5200,7 @@ class ps extends Q {
|
|
|
5207
5200
|
this.mergeCompare(e);
|
|
5208
5201
|
}
|
|
5209
5202
|
}
|
|
5210
|
-
class
|
|
5203
|
+
class hs extends G {
|
|
5211
5204
|
constructor(e, t, i, o, s) {
|
|
5212
5205
|
super(), this.context = e, this.pagination = t, this.spineItemsManager = i, this.spine = o, this.spineItemLocator = s;
|
|
5213
5206
|
const r = P(
|
|
@@ -5226,14 +5219,14 @@ class gs extends G {
|
|
|
5226
5219
|
return this.context.bridgeEvent.navigationUnlocked$.pipe(
|
|
5227
5220
|
$t(1),
|
|
5228
5221
|
z(this.context.bridgeEvent.navigation$),
|
|
5229
|
-
|
|
5222
|
+
x(([, u]) => {
|
|
5230
5223
|
const { position: l } = u, d = this.pagination.value, {
|
|
5231
|
-
beginIndex:
|
|
5232
|
-
endIndex:
|
|
5224
|
+
beginIndex: g,
|
|
5225
|
+
endIndex: p
|
|
5233
5226
|
} = this.spine.locator.getVisibleSpineItemsFromPosition({
|
|
5234
5227
|
position: l,
|
|
5235
5228
|
threshold: { type: "percentage", value: 0.5 }
|
|
5236
|
-
}) ?? {}, h = this.spineItemsManager.get(
|
|
5229
|
+
}) ?? {}, h = this.spineItemsManager.get(g), m = this.spineItemsManager.get(p);
|
|
5237
5230
|
if (!h || !m) return;
|
|
5238
5231
|
const y = d.beginCfi, f = d.endCfi, { beginPageIndex: I = 0 } = c({
|
|
5239
5232
|
spineItem: h,
|
|
@@ -5241,16 +5234,16 @@ class gs extends G {
|
|
|
5241
5234
|
}) ?? {}, { endPageIndex: b = 0 } = c({
|
|
5242
5235
|
spineItem: m,
|
|
5243
5236
|
position: l
|
|
5244
|
-
}) ?? {}, F = y === void 0 || Be(y) || d.beginSpineItemIndex !==
|
|
5237
|
+
}) ?? {}, F = y === void 0 || Be(y) || d.beginSpineItemIndex !== g, $ = d.endSpineItemIndex !== p || f === void 0 || Be(f), L = F ? de(h.item) : y, H = $ ? de(m.item) : f, B = h.numberOfPages, se = m.numberOfPages;
|
|
5245
5238
|
this.pagination.update({
|
|
5246
5239
|
beginCfi: L,
|
|
5247
5240
|
beginNumberOfPagesInSpineItem: B,
|
|
5248
5241
|
beginPageIndexInSpineItem: I,
|
|
5249
|
-
beginSpineItemIndex:
|
|
5242
|
+
beginSpineItemIndex: g,
|
|
5250
5243
|
endCfi: H,
|
|
5251
5244
|
endNumberOfPagesInSpineItem: se,
|
|
5252
5245
|
endPageIndexInSpineItem: b,
|
|
5253
|
-
endSpineItemIndex:
|
|
5246
|
+
endSpineItemIndex: p,
|
|
5254
5247
|
navigationId: u.id
|
|
5255
5248
|
});
|
|
5256
5249
|
})
|
|
@@ -5258,7 +5251,7 @@ class gs extends G {
|
|
|
5258
5251
|
})
|
|
5259
5252
|
), a = r.pipe(
|
|
5260
5253
|
De(this.context.bridgeEvent.viewportFree$),
|
|
5261
|
-
|
|
5254
|
+
x(() => {
|
|
5262
5255
|
const {
|
|
5263
5256
|
beginSpineItemIndex: c,
|
|
5264
5257
|
endSpineItemIndex: u,
|
|
@@ -5267,36 +5260,42 @@ class gs extends G {
|
|
|
5267
5260
|
} = this.pagination.value;
|
|
5268
5261
|
if (l === void 0 || d === void 0 || c === void 0 || u === void 0)
|
|
5269
5262
|
return;
|
|
5270
|
-
const
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5263
|
+
const g = this.spineItemsManager.get(c), p = this.spineItemsManager.get(u);
|
|
5264
|
+
if (g === void 0 || p === void 0) return;
|
|
5265
|
+
const h = this.spine.pages.fromSpineItemPageIndex(
|
|
5266
|
+
g,
|
|
5267
|
+
l
|
|
5268
|
+
), m = this.spine.pages.fromSpineItemPageIndex(
|
|
5269
|
+
p,
|
|
5270
|
+
d
|
|
5271
|
+
);
|
|
5272
|
+
this.pagination.update({
|
|
5273
|
+
beginCfi: h?.firstVisibleNode ? He({
|
|
5274
|
+
spineItem: g.item,
|
|
5275
|
+
pageNode: h?.firstVisibleNode
|
|
5276
|
+
}) : de(g.item),
|
|
5277
|
+
endCfi: m?.firstVisibleNode ? He({
|
|
5278
|
+
spineItem: p.item,
|
|
5279
|
+
pageNode: m?.firstVisibleNode
|
|
5280
|
+
}) : de(p.item)
|
|
5282
5281
|
});
|
|
5283
5282
|
})
|
|
5284
5283
|
);
|
|
5285
5284
|
P(r, a).pipe(T(this.destroy$)).subscribe();
|
|
5286
5285
|
}
|
|
5287
5286
|
}
|
|
5288
|
-
const
|
|
5287
|
+
const ms = ({
|
|
5289
5288
|
manifest: n,
|
|
5290
5289
|
spreadMode: e
|
|
5291
5290
|
}) => n?.renditionFlow === "scrolled-continuous" ? !1 : e;
|
|
5292
|
-
class
|
|
5291
|
+
class fs extends G {
|
|
5293
5292
|
constructor(e) {
|
|
5294
5293
|
super();
|
|
5295
5294
|
const t = {
|
|
5296
5295
|
...this.getDefaultSettings(),
|
|
5297
5296
|
...e
|
|
5298
5297
|
};
|
|
5299
|
-
this.inputSettings = t, this.outputSettingsUpdateSubject = new
|
|
5298
|
+
this.inputSettings = t, this.outputSettingsUpdateSubject = new N(), this._settings$ = this.outputSettingsUpdateSubject.asObservable().pipe(J(1)), this._settings$.subscribe();
|
|
5300
5299
|
}
|
|
5301
5300
|
_prepareUpdate(e) {
|
|
5302
5301
|
const t = $e(this.inputSettings, e), i = this.getOutputSettings(t), o = !O(this.outputSettings, i);
|
|
@@ -5326,18 +5325,18 @@ class ms extends G {
|
|
|
5326
5325
|
}
|
|
5327
5326
|
watch(e) {
|
|
5328
5327
|
return this.values$.pipe(
|
|
5329
|
-
|
|
5330
|
-
|
|
5328
|
+
Nt(e),
|
|
5329
|
+
R(O)
|
|
5331
5330
|
);
|
|
5332
5331
|
}
|
|
5333
5332
|
destroy() {
|
|
5334
5333
|
super.destroy(), this.outputSettingsUpdateSubject.complete();
|
|
5335
5334
|
}
|
|
5336
5335
|
}
|
|
5337
|
-
class
|
|
5336
|
+
class ys extends fs {
|
|
5338
5337
|
constructor(e, t) {
|
|
5339
5338
|
super(e), this.context = t, t.watch(["manifest", "hasVerticalWriting"]).pipe(
|
|
5340
|
-
|
|
5339
|
+
x(() => this.update(this.values)),
|
|
5341
5340
|
T(this.destroy$)
|
|
5342
5341
|
).subscribe();
|
|
5343
5342
|
}
|
|
@@ -5347,7 +5346,7 @@ class fs extends ms {
|
|
|
5347
5346
|
computedPageTurnAnimation: e.pageTurnAnimation,
|
|
5348
5347
|
computedPageTurnMode: e.pageTurnMode,
|
|
5349
5348
|
computedPageTurnAnimationDuration: 0,
|
|
5350
|
-
computedSpreadMode:
|
|
5349
|
+
computedSpreadMode: ms({
|
|
5351
5350
|
spreadMode: e.spreadMode,
|
|
5352
5351
|
manifest: t
|
|
5353
5352
|
})
|
|
@@ -5373,7 +5372,7 @@ class fs extends ms {
|
|
|
5373
5372
|
};
|
|
5374
5373
|
}
|
|
5375
5374
|
}
|
|
5376
|
-
class
|
|
5375
|
+
class Ss extends ye {
|
|
5377
5376
|
onUnload() {
|
|
5378
5377
|
return _;
|
|
5379
5378
|
}
|
|
@@ -5392,22 +5391,22 @@ class ys extends ye {
|
|
|
5392
5391
|
getDocumentFrame() {
|
|
5393
5392
|
}
|
|
5394
5393
|
}
|
|
5395
|
-
class
|
|
5394
|
+
class Is extends G {
|
|
5396
5395
|
constructor(e, t, i, o, s, r, a) {
|
|
5397
|
-
super(), this.item = e, this.containerElement = t, this.context = i, this.hookManager = o, this.renderer = s, this.settings = r, this.viewport = a, this.layoutTriggerSubject = new
|
|
5396
|
+
super(), this.item = e, this.containerElement = t, this.context = i, this.hookManager = o, this.renderer = s, this.settings = r, this.viewport = a, this.layoutTriggerSubject = new N(), this.lastLayout = null, this.computeLayoutInformation = ({
|
|
5398
5397
|
isLastItem: u,
|
|
5399
5398
|
horizontalOffset: l
|
|
5400
5399
|
}) => {
|
|
5401
|
-
let d = this.viewport.value.pageSize.width,
|
|
5402
|
-
const
|
|
5400
|
+
let d = this.viewport.value.pageSize.width, g = "none";
|
|
5401
|
+
const p = l % this.viewport.absoluteViewport.width === 0, h = this.context.manifest, m = Bt(h) ?? !1;
|
|
5403
5402
|
if (this.settings.values.computedSpreadMode) {
|
|
5404
|
-
!m && this.renderer.renditionLayout === "reflowable" && !u && (d = this.viewport.value.pageSize.width * 2), !m && this.renderer.renditionLayout === "reflowable" && u &&
|
|
5405
|
-
const y =
|
|
5406
|
-
this.item.pageSpreadRight &&
|
|
5403
|
+
!m && this.renderer.renditionLayout === "reflowable" && !u && (d = this.viewport.value.pageSize.width * 2), !m && this.renderer.renditionLayout === "reflowable" && u && p && (d = this.viewport.value.pageSize.width * 2);
|
|
5404
|
+
const y = p && u && m;
|
|
5405
|
+
this.item.pageSpreadRight && p && !this.context.isRTL() ? (g = "before", d = this.viewport.value.pageSize.width * 2) : this.item.pageSpreadLeft && p && this.context.isRTL() ? (g = "before", d = this.viewport.value.pageSize.width * 2) : y && (this.context.isRTL() ? g = "before" : g = "after", d = this.viewport.value.pageSize.width * 2);
|
|
5407
5406
|
}
|
|
5408
5407
|
return {
|
|
5409
5408
|
minimumWidth: d,
|
|
5410
|
-
blankPagePosition:
|
|
5409
|
+
blankPagePosition: g
|
|
5411
5410
|
};
|
|
5412
5411
|
}, this.adjustPositionOfElement = ({
|
|
5413
5412
|
right: u,
|
|
@@ -5419,12 +5418,12 @@ class Ss extends G {
|
|
|
5419
5418
|
minimumWidth: u,
|
|
5420
5419
|
edgeX: l,
|
|
5421
5420
|
edgeY: d
|
|
5422
|
-
}) => (
|
|
5423
|
-
S((
|
|
5421
|
+
}) => (g) => g.pipe(
|
|
5422
|
+
S((p) => {
|
|
5424
5423
|
const h = O(
|
|
5425
5424
|
this.lastLayout?.pageSize,
|
|
5426
5425
|
this.viewport.pageSize
|
|
5427
|
-
) ? this.lastLayout : void 0, { width: m, height: y } = h ?? {}, { width: f = m, height: I = y } =
|
|
5426
|
+
) ? this.lastLayout : void 0, { width: m, height: y } = h ?? {}, { width: f = m, height: I = y } = p ?? {}, { width: b, height: F } = this.viewport.pageSize, $ = this.validateDimension(
|
|
5428
5427
|
f ?? b,
|
|
5429
5428
|
b,
|
|
5430
5429
|
u
|
|
@@ -5434,23 +5433,23 @@ class Ss extends G {
|
|
|
5434
5433
|
F
|
|
5435
5434
|
);
|
|
5436
5435
|
return this.lastLayout = {
|
|
5437
|
-
width:
|
|
5436
|
+
width: $,
|
|
5438
5437
|
height: L,
|
|
5439
5438
|
pageSize: this.viewport.pageSize
|
|
5440
|
-
}, this.containerElement.style.width = `${
|
|
5439
|
+
}, this.containerElement.style.width = `${$}px`, this.containerElement.style.height = `${L}px`, this.settings.values.computedPageTurnDirection === "vertical" ? (this.adjustPositionOfElement({
|
|
5441
5440
|
top: d,
|
|
5442
5441
|
left: l
|
|
5443
|
-
}), { width:
|
|
5442
|
+
}), { width: $, height: L }) : (this.adjustPositionOfElement(
|
|
5444
5443
|
this.context.isRTL() ? { right: l, top: 0 } : { left: l, top: 0 }
|
|
5445
|
-
), { width:
|
|
5444
|
+
), { width: $, height: L });
|
|
5446
5445
|
})
|
|
5447
5446
|
), this.layout = (u) => {
|
|
5448
|
-
const l =
|
|
5447
|
+
const l = Yn(this.didLayout$.pipe(U()));
|
|
5449
5448
|
return this.layoutTriggerSubject.next(u), l();
|
|
5450
5449
|
};
|
|
5451
5450
|
const c = this.layoutTriggerSubject.pipe(
|
|
5452
5451
|
w(
|
|
5453
|
-
({ spreadPosition: u, horizontalOffset: l, isLastItem: d, edgeX:
|
|
5452
|
+
({ spreadPosition: u, horizontalOffset: l, isLastItem: d, edgeX: g, edgeY: p }) => {
|
|
5454
5453
|
const { blankPagePosition: h, minimumWidth: m } = this.computeLayoutInformation({ horizontalOffset: l, isLastItem: d });
|
|
5455
5454
|
this.hookManager.execute("item.onBeforeLayout", void 0, {
|
|
5456
5455
|
blankPagePosition: h,
|
|
@@ -5472,8 +5471,8 @@ class Ss extends G {
|
|
|
5472
5471
|
*/
|
|
5473
5472
|
this.updateContainerLayout({
|
|
5474
5473
|
minimumWidth: m,
|
|
5475
|
-
edgeX:
|
|
5476
|
-
edgeY:
|
|
5474
|
+
edgeX: g,
|
|
5475
|
+
edgeY: p
|
|
5477
5476
|
}),
|
|
5478
5477
|
S((f) => (this.hookManager.execute("item.onAfterLayout", void 0, {
|
|
5479
5478
|
blankPagePosition: h,
|
|
@@ -5526,7 +5525,7 @@ class Zt extends Q {
|
|
|
5526
5525
|
});
|
|
5527
5526
|
}, this.destroy = () => {
|
|
5528
5527
|
super.destroy(), this.containerElement.remove(), this.renderer.destroy();
|
|
5529
|
-
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.layout = (d) => this._layout.layout(d), this.containerElement =
|
|
5528
|
+
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.layout = (d) => this._layout.layout(d), this.containerElement = bs(
|
|
5530
5529
|
t,
|
|
5531
5530
|
e,
|
|
5532
5531
|
s
|
|
@@ -5542,7 +5541,7 @@ class Zt extends Q {
|
|
|
5542
5541
|
resourcesHandler: this.resourcesHandler,
|
|
5543
5542
|
viewport: this.viewport
|
|
5544
5543
|
};
|
|
5545
|
-
this.renderer = c ? c(u) : new
|
|
5544
|
+
this.renderer = c ? c(u) : new Ss(u), this._layout = new Is(
|
|
5546
5545
|
e,
|
|
5547
5546
|
this.containerElement,
|
|
5548
5547
|
i,
|
|
@@ -5552,11 +5551,11 @@ class Zt extends Q {
|
|
|
5552
5551
|
this.viewport
|
|
5553
5552
|
);
|
|
5554
5553
|
const l = this.renderer.state$.pipe(
|
|
5555
|
-
V(({ state: d, error:
|
|
5554
|
+
V(({ state: d, error: g }) => {
|
|
5556
5555
|
this.mergeCompare({
|
|
5557
5556
|
isLoaded: d === "loaded",
|
|
5558
5557
|
isError: d === "error",
|
|
5559
|
-
error: d === "error" ?
|
|
5558
|
+
error: d === "error" ? g : void 0
|
|
5560
5559
|
});
|
|
5561
5560
|
})
|
|
5562
5561
|
);
|
|
@@ -5630,21 +5629,21 @@ class Zt extends Q {
|
|
|
5630
5629
|
});
|
|
5631
5630
|
}
|
|
5632
5631
|
}
|
|
5633
|
-
const
|
|
5632
|
+
const bs = (n, e, t) => {
|
|
5634
5633
|
const i = n.ownerDocument.createElement("div");
|
|
5635
5634
|
return i.classList.add("spineItem"), i.classList.add(`spineItem-${e.renditionLayout ?? "reflowable"}`), i.style.cssText = `
|
|
5636
5635
|
position: absolute;
|
|
5637
5636
|
overflow: hidden;
|
|
5638
5637
|
`, i.dataset.isReady = "false", t.execute("item.onBeforeContainerCreated", void 0, { element: i }), i;
|
|
5639
5638
|
};
|
|
5640
|
-
class
|
|
5639
|
+
class vs extends G {
|
|
5641
5640
|
constructor(e, t, i, o, s) {
|
|
5642
5641
|
super(), this.context = e, this.spineItemsManager = t, this.spineLocator = i, this.settings = o, this.spineLayout = s, this.forcedOpenSubject = new q(
|
|
5643
5642
|
/* @__PURE__ */ new Map()
|
|
5644
5643
|
);
|
|
5645
5644
|
const r = this.forcedOpenSubject.pipe(
|
|
5646
5645
|
S((u) => Array.from(u.keys()).sort((l, d) => l - d)),
|
|
5647
|
-
|
|
5646
|
+
R(hn),
|
|
5648
5647
|
J({ bufferSize: 1, refCount: !0 })
|
|
5649
5648
|
);
|
|
5650
5649
|
P(
|
|
@@ -5660,11 +5659,11 @@ class bs extends G {
|
|
|
5660
5659
|
De(this.context.bridgeEvent.viewportFree$),
|
|
5661
5660
|
z(this.context.bridgeEvent.navigation$, r),
|
|
5662
5661
|
S(([, u, l]) => {
|
|
5663
|
-
const { numberOfAdjacentSpineItemToPreLoad: d } = o.values, { beginIndex:
|
|
5662
|
+
const { numberOfAdjacentSpineItemToPreLoad: d } = o.values, { beginIndex: g = 0, endIndex: p = 0 } = i.getVisibleSpineItemsFromPosition({
|
|
5664
5663
|
position: u.position,
|
|
5665
5664
|
threshold: { type: "percentage", value: 0 },
|
|
5666
5665
|
useAbsoluteViewport: !1
|
|
5667
|
-
}) || {}, h = d === 1 / 0 ? 0 :
|
|
5666
|
+
}) || {}, h = d === 1 / 0 ? 0 : g - d, m = d === 1 / 0 ? t.items.length - 1 : p + d, y = Array.from(
|
|
5668
5667
|
{ length: m - h + 1 },
|
|
5669
5668
|
(I, b) => h + b
|
|
5670
5669
|
), f = [...l, ...y];
|
|
@@ -5717,17 +5716,17 @@ class Se extends DOMRect {
|
|
|
5717
5716
|
return new Se(i.x, i.y, i.width, i.height);
|
|
5718
5717
|
}
|
|
5719
5718
|
}
|
|
5720
|
-
class
|
|
5719
|
+
class ws {
|
|
5721
5720
|
constructor({ width: e, height: t }) {
|
|
5722
5721
|
this.__symbol = /* @__PURE__ */ Symbol("AbsoluteViewport"), this.width = e, this.height = t;
|
|
5723
5722
|
}
|
|
5724
5723
|
}
|
|
5725
|
-
class
|
|
5724
|
+
class Ps {
|
|
5726
5725
|
constructor({ width: e, height: t }) {
|
|
5727
5726
|
this.__symbol = /* @__PURE__ */ Symbol("RelativeViewport"), this.width = e, this.height = t;
|
|
5728
5727
|
}
|
|
5729
5728
|
}
|
|
5730
|
-
const
|
|
5729
|
+
const xs = ({
|
|
5731
5730
|
pageIndex: n,
|
|
5732
5731
|
spineItemOrId: e,
|
|
5733
5732
|
spineItemsManager: t
|
|
@@ -5749,7 +5748,7 @@ const Ps = ({
|
|
|
5749
5748
|
{ currentAbsolutePage: 0, found: !1 }
|
|
5750
5749
|
);
|
|
5751
5750
|
return s;
|
|
5752
|
-
},
|
|
5751
|
+
}, $s = ({
|
|
5753
5752
|
itemHeight: n,
|
|
5754
5753
|
itemWidth: e,
|
|
5755
5754
|
visibleWidthOfItem: t,
|
|
@@ -5758,7 +5757,7 @@ const Ps = ({
|
|
|
5758
5757
|
}) => {
|
|
5759
5758
|
const s = t / e, r = i / n;
|
|
5760
5759
|
return o.type === "percentage" ? s >= o.value && r >= o.value : t >= o.value && i >= o.value;
|
|
5761
|
-
},
|
|
5760
|
+
}, Ts = ({
|
|
5762
5761
|
visibleWidthOfItem: n,
|
|
5763
5762
|
visibleHeightOfItem: e,
|
|
5764
5763
|
threshold: t,
|
|
@@ -5779,30 +5778,30 @@ const Ps = ({
|
|
|
5779
5778
|
viewportPosition: a,
|
|
5780
5779
|
restrictToScreen: c
|
|
5781
5780
|
}) => {
|
|
5782
|
-
const u = a.x, l = a.x + (a.width - 1), d = a.y,
|
|
5781
|
+
const u = a.x, l = a.x + (a.width - 1), d = a.y, g = Math.max(
|
|
5783
5782
|
a.y + (a.height - 1),
|
|
5784
5783
|
0
|
|
5785
|
-
),
|
|
5784
|
+
), p = Math.max(
|
|
5786
5785
|
0,
|
|
5787
5786
|
Math.min(t, l) - Math.max(e, u)
|
|
5788
5787
|
), h = Math.max(
|
|
5789
5788
|
0,
|
|
5790
|
-
Math.min(n,
|
|
5789
|
+
Math.min(n, g) - Math.max(i, d)
|
|
5791
5790
|
);
|
|
5792
|
-
if (
|
|
5793
|
-
const y =
|
|
5791
|
+
if (p <= 0 || h <= 0) return { visible: !1 };
|
|
5792
|
+
const y = Ts({
|
|
5794
5793
|
threshold: r,
|
|
5795
5794
|
visibleHeightOfItem: h,
|
|
5796
|
-
visibleWidthOfItem:
|
|
5795
|
+
visibleWidthOfItem: p,
|
|
5797
5796
|
viewportPosition: a
|
|
5798
5797
|
});
|
|
5799
5798
|
return c ? { visible: y } : {
|
|
5800
|
-
visible:
|
|
5799
|
+
visible: $s({
|
|
5801
5800
|
itemHeight: s,
|
|
5802
5801
|
itemWidth: o,
|
|
5803
5802
|
threshold: r,
|
|
5804
5803
|
visibleHeightOfItem: h,
|
|
5805
|
-
visibleWidthOfItem:
|
|
5804
|
+
visibleWidthOfItem: p
|
|
5806
5805
|
}) || y
|
|
5807
5806
|
};
|
|
5808
5807
|
}, qe = ({
|
|
@@ -5821,7 +5820,7 @@ const Ps = ({
|
|
|
5821
5820
|
}) => new M({
|
|
5822
5821
|
x: e + n.x,
|
|
5823
5822
|
y: t + n.y
|
|
5824
|
-
}),
|
|
5823
|
+
}), Fs = ({
|
|
5825
5824
|
position: n,
|
|
5826
5825
|
threshold: e,
|
|
5827
5826
|
restrictToScreen: t,
|
|
@@ -5835,7 +5834,7 @@ const Ps = ({
|
|
|
5835
5834
|
spineItemsManager: i,
|
|
5836
5835
|
spineLayout: o
|
|
5837
5836
|
}) || i.get(0), c = i.items.reduce(
|
|
5838
|
-
(
|
|
5837
|
+
(p, h) => {
|
|
5839
5838
|
const m = o.getSpineItemSpineLayoutInfo(h), y = s ? r.absoluteViewport : r.relativeViewport, f = Jt(
|
|
5840
5839
|
n,
|
|
5841
5840
|
r.absoluteViewport,
|
|
@@ -5849,17 +5848,17 @@ const Ps = ({
|
|
|
5849
5848
|
viewportPosition: I,
|
|
5850
5849
|
restrictToScreen: t
|
|
5851
5850
|
});
|
|
5852
|
-
return b ? [...
|
|
5851
|
+
return b ? [...p, h] : p;
|
|
5853
5852
|
},
|
|
5854
5853
|
[]
|
|
5855
5854
|
), u = c[0] ?? a, l = c[c.length - 1] ?? u;
|
|
5856
5855
|
if (!u || !l) return;
|
|
5857
|
-
const d = i.getSpineItemIndex(u),
|
|
5856
|
+
const d = i.getSpineItemIndex(u), g = i.getSpineItemIndex(l);
|
|
5858
5857
|
return {
|
|
5859
5858
|
beginIndex: d ?? 0,
|
|
5860
|
-
endIndex:
|
|
5859
|
+
endIndex: g ?? 0
|
|
5861
5860
|
};
|
|
5862
|
-
},
|
|
5861
|
+
}, Ls = ({
|
|
5863
5862
|
spineItemsManager: n,
|
|
5864
5863
|
context: e,
|
|
5865
5864
|
spineItemLocator: t,
|
|
@@ -5963,7 +5962,7 @@ const Ps = ({
|
|
|
5963
5962
|
/**
|
|
5964
5963
|
* @deprecated use Pages
|
|
5965
5964
|
*/
|
|
5966
|
-
_getAbsolutePageIndexFromPageIndex: (h) =>
|
|
5965
|
+
_getAbsolutePageIndexFromPageIndex: (h) => xs({
|
|
5967
5966
|
...h,
|
|
5968
5967
|
spineItemsManager: n
|
|
5969
5968
|
}),
|
|
@@ -6004,7 +6003,7 @@ const Ps = ({
|
|
|
6004
6003
|
}),
|
|
6005
6004
|
getSpineItemFromIframe: c,
|
|
6006
6005
|
getSpineItemPageIndexFromNode: u,
|
|
6007
|
-
getVisibleSpineItemsFromPosition: (h) =>
|
|
6006
|
+
getVisibleSpineItemsFromPosition: (h) => Fs({
|
|
6008
6007
|
spineItemsManager: n,
|
|
6009
6008
|
spineLayout: o,
|
|
6010
6009
|
viewport: s,
|
|
@@ -6027,10 +6026,10 @@ const Ps = ({
|
|
|
6027
6026
|
});
|
|
6028
6027
|
}
|
|
6029
6028
|
};
|
|
6030
|
-
},
|
|
6029
|
+
}, Ms = A.namespace("spine"), Cs = ({
|
|
6031
6030
|
position: n,
|
|
6032
6031
|
pageSize: e
|
|
6033
|
-
}) => new
|
|
6032
|
+
}) => new bi({
|
|
6034
6033
|
...n,
|
|
6035
6034
|
left: n.x,
|
|
6036
6035
|
top: n.y,
|
|
@@ -6039,7 +6038,7 @@ const Ps = ({
|
|
|
6039
6038
|
bottom: n.y + e.height,
|
|
6040
6039
|
right: n.x + e.width
|
|
6041
6040
|
});
|
|
6042
|
-
class
|
|
6041
|
+
class Es extends Q {
|
|
6043
6042
|
constructor(e, t, i, o, s, r) {
|
|
6044
6043
|
super({ pages: [] }), this.spineLayout = e, this.spineItemsManager = t, this.spineItemLocator = i, this.context = o, this.locator = s, this.viewport = r, this.fromSpineItemPageIndex = (a, c) => this.value.pages.find(
|
|
6045
6044
|
(u) => u.itemIndex === a.index && u.pageIndex === c
|
|
@@ -6049,7 +6048,7 @@ class Cs extends Q {
|
|
|
6049
6048
|
z(r),
|
|
6050
6049
|
w(([, { pageSize: a }]) => {
|
|
6051
6050
|
const c = t.items.reduce(
|
|
6052
|
-
(l, d,
|
|
6051
|
+
(l, d, g) => {
|
|
6053
6052
|
const h = new Array(d.numberOfPages).fill(void 0).map((m, y) => {
|
|
6054
6053
|
const f = i.getSpineItemPositionFromPageIndex({
|
|
6055
6054
|
spineItem: d,
|
|
@@ -6059,11 +6058,11 @@ class Cs extends Q {
|
|
|
6059
6058
|
spineItemPosition: f
|
|
6060
6059
|
});
|
|
6061
6060
|
return {
|
|
6062
|
-
absoluteLayout:
|
|
6061
|
+
absoluteLayout: Cs({
|
|
6063
6062
|
pageSize: a,
|
|
6064
6063
|
position: I
|
|
6065
6064
|
}),
|
|
6066
|
-
layout: new
|
|
6065
|
+
layout: new Ii({
|
|
6067
6066
|
left: f.x,
|
|
6068
6067
|
right: f.x + a.width,
|
|
6069
6068
|
top: f.y,
|
|
@@ -6073,7 +6072,7 @@ class Cs extends Q {
|
|
|
6073
6072
|
x: f.x,
|
|
6074
6073
|
y: f.y
|
|
6075
6074
|
}),
|
|
6076
|
-
itemIndex:
|
|
6075
|
+
itemIndex: g,
|
|
6077
6076
|
absolutePageIndex: l.length + y,
|
|
6078
6077
|
spineItem: d,
|
|
6079
6078
|
pageIndex: y
|
|
@@ -6085,11 +6084,11 @@ class Cs extends Q {
|
|
|
6085
6084
|
);
|
|
6086
6085
|
return j(
|
|
6087
6086
|
c.map((l) => {
|
|
6088
|
-
const { spineItem: d, ...
|
|
6087
|
+
const { spineItem: d, ...g } = l;
|
|
6089
6088
|
if (l.spineItem.value.isLoaded) {
|
|
6090
|
-
const
|
|
6091
|
-
if (
|
|
6092
|
-
const h =
|
|
6089
|
+
const p = l.spineItem.renderer?.getDocumentFrame();
|
|
6090
|
+
if (p && p?.contentWindow?.document && p.contentWindow.document.body !== null) {
|
|
6091
|
+
const h = p.contentWindow.document;
|
|
6093
6092
|
return et().pipe(
|
|
6094
6093
|
S(() => {
|
|
6095
6094
|
const m = Ln(
|
|
@@ -6097,30 +6096,30 @@ class Cs extends Q {
|
|
|
6097
6096
|
l.layout
|
|
6098
6097
|
);
|
|
6099
6098
|
return {
|
|
6100
|
-
...
|
|
6099
|
+
...g,
|
|
6101
6100
|
firstVisibleNode: m
|
|
6102
6101
|
};
|
|
6103
6102
|
})
|
|
6104
6103
|
);
|
|
6105
6104
|
}
|
|
6106
6105
|
}
|
|
6107
|
-
return v({ ...
|
|
6106
|
+
return v({ ...g, firstVisibleNode: void 0 });
|
|
6108
6107
|
})
|
|
6109
6108
|
);
|
|
6110
6109
|
}),
|
|
6111
|
-
S((a) => (
|
|
6110
|
+
S((a) => (Ms.info("Pages layout", a), { pages: a })),
|
|
6112
6111
|
D()
|
|
6113
6112
|
), this.layout$.pipe(T(this.destroy$)).subscribe(this.next.bind(this));
|
|
6114
6113
|
}
|
|
6115
6114
|
}
|
|
6116
|
-
class
|
|
6115
|
+
class Ds extends G {
|
|
6117
6116
|
constructor(e) {
|
|
6118
6117
|
super(), this.spineItemsManager = e, this.states$ = this.spineItemsManager.items$.pipe(
|
|
6119
6118
|
w((t) => P(
|
|
6120
6119
|
...t.map(
|
|
6121
6120
|
(i) => i.pipe(
|
|
6122
6121
|
S((o) => ({ item: i, ...o })),
|
|
6123
|
-
|
|
6122
|
+
R(O)
|
|
6124
6123
|
)
|
|
6125
6124
|
)
|
|
6126
6125
|
)),
|
|
@@ -6146,9 +6145,9 @@ class Es extends G {
|
|
|
6146
6145
|
);
|
|
6147
6146
|
}
|
|
6148
6147
|
}
|
|
6149
|
-
class
|
|
6148
|
+
class As extends G {
|
|
6150
6149
|
constructor(e, t, i, o, s) {
|
|
6151
|
-
super(), this.spineItemsManager = e, this.spineItemsObserver = t, this.context = i, this.settings = o, this.viewport = s, this.externalLayoutTrigger = new
|
|
6150
|
+
super(), this.spineItemsManager = e, this.spineItemsObserver = t, this.context = i, this.settings = o, this.viewport = s, this.externalLayoutTrigger = new N(), this.spineItemsRelativeLayouts = [];
|
|
6152
6151
|
const r = P(
|
|
6153
6152
|
t.itemLoad$,
|
|
6154
6153
|
t.itemUnload$
|
|
@@ -6157,7 +6156,7 @@ class Ds extends G {
|
|
|
6157
6156
|
r
|
|
6158
6157
|
);
|
|
6159
6158
|
this.layout$ = a.pipe(
|
|
6160
|
-
|
|
6159
|
+
x(() => {
|
|
6161
6160
|
this.spineItemsManager.items.forEach((c) => {
|
|
6162
6161
|
c.markDirty();
|
|
6163
6162
|
});
|
|
@@ -6166,15 +6165,15 @@ class Ds extends G {
|
|
|
6166
6165
|
w(
|
|
6167
6166
|
() => this.spineItemsManager.items.reduce(
|
|
6168
6167
|
(c, u, l) => c.pipe(
|
|
6169
|
-
ln(({ horizontalOffset: d, verticalOffset:
|
|
6170
|
-
const
|
|
6171
|
-
|
|
6168
|
+
ln(({ horizontalOffset: d, verticalOffset: g }) => {
|
|
6169
|
+
const p = d % s.absoluteViewport.width === 0, h = l === e.items.length - 1, m = o.values.computedPageTurnDirection === "vertical", y = i.isRTL(), f = this.getSpreadPosition(
|
|
6170
|
+
p,
|
|
6172
6171
|
y
|
|
6173
6172
|
), { edgeX: I, edgeY: b } = this.getStartEdges(
|
|
6174
6173
|
m,
|
|
6175
|
-
g,
|
|
6176
|
-
d,
|
|
6177
6174
|
p,
|
|
6175
|
+
d,
|
|
6176
|
+
g,
|
|
6178
6177
|
s.absoluteViewport.height
|
|
6179
6178
|
);
|
|
6180
6179
|
return u.layout({
|
|
@@ -6184,19 +6183,19 @@ class Ds extends G {
|
|
|
6184
6183
|
edgeX: I,
|
|
6185
6184
|
edgeY: b
|
|
6186
6185
|
}).pipe(
|
|
6187
|
-
S(({ width: F, height:
|
|
6186
|
+
S(({ width: F, height: $ }) => {
|
|
6188
6187
|
const L = this.createSpineItemLayout(
|
|
6189
6188
|
m,
|
|
6190
6189
|
y,
|
|
6191
6190
|
I,
|
|
6192
6191
|
b,
|
|
6193
6192
|
F,
|
|
6194
|
-
|
|
6193
|
+
$,
|
|
6195
6194
|
s.absoluteViewport.width
|
|
6196
6195
|
);
|
|
6197
6196
|
return this.spineItemsRelativeLayouts[l] = L, {
|
|
6198
6197
|
horizontalOffset: I + F,
|
|
6199
|
-
verticalOffset: m ? b +
|
|
6198
|
+
verticalOffset: m ? b + $ : 0
|
|
6200
6199
|
};
|
|
6201
6200
|
})
|
|
6202
6201
|
);
|
|
@@ -6211,7 +6210,7 @@ class Ds extends G {
|
|
|
6211
6210
|
}
|
|
6212
6211
|
watchForVerticalWritingUpdate() {
|
|
6213
6212
|
this.spineItemsObserver.itemLoad$.pipe(
|
|
6214
|
-
|
|
6213
|
+
x((e) => {
|
|
6215
6214
|
this.context.update({
|
|
6216
6215
|
hasVerticalWriting: e.isUsingVerticalWriting()
|
|
6217
6216
|
});
|
|
@@ -6280,30 +6279,30 @@ class Ds extends G {
|
|
|
6280
6279
|
});
|
|
6281
6280
|
}
|
|
6282
6281
|
}
|
|
6283
|
-
class
|
|
6282
|
+
class Ns extends G {
|
|
6284
6283
|
constructor(e, t, i, o, s, r, a) {
|
|
6285
6284
|
super(), this.context = e, this.pagination = t, this.spineItemsManager = i, this.spineItemLocator = o, this.settings = s, this.hookManager = r, this.viewport = a, this.elementSubject = new q(
|
|
6286
6285
|
void 0
|
|
6287
|
-
), this.element$ = this.elementSubject.asObservable(), this.spineItemsObserver = new
|
|
6286
|
+
), this.element$ = this.elementSubject.asObservable(), this.spineItemsObserver = new Ds(i), this.spineLayout = new As(
|
|
6288
6287
|
i,
|
|
6289
6288
|
this.spineItemsObserver,
|
|
6290
6289
|
e,
|
|
6291
6290
|
s,
|
|
6292
6291
|
a
|
|
6293
|
-
), this.locator =
|
|
6292
|
+
), this.locator = Ls({
|
|
6294
6293
|
context: e,
|
|
6295
6294
|
spineItemsManager: i,
|
|
6296
6295
|
spineItemLocator: o,
|
|
6297
6296
|
settings: s,
|
|
6298
6297
|
spineLayout: this.spineLayout,
|
|
6299
6298
|
viewport: a
|
|
6300
|
-
}), this.spineItemsLoader = new
|
|
6299
|
+
}), this.spineItemsLoader = new vs(
|
|
6301
6300
|
this.context,
|
|
6302
6301
|
i,
|
|
6303
6302
|
this.locator,
|
|
6304
6303
|
s,
|
|
6305
6304
|
this.spineLayout
|
|
6306
|
-
), this.pages = new
|
|
6305
|
+
), this.pages = new Es(
|
|
6307
6306
|
this.spineLayout,
|
|
6308
6307
|
this.spineItemsManager,
|
|
6309
6308
|
this.spineItemLocator,
|
|
@@ -6312,7 +6311,7 @@ class As extends G {
|
|
|
6312
6311
|
this.viewport
|
|
6313
6312
|
);
|
|
6314
6313
|
const c = e.watch("rootElement").pipe(
|
|
6315
|
-
|
|
6314
|
+
pe(Z),
|
|
6316
6315
|
V((l) => {
|
|
6317
6316
|
const d = l.ownerDocument.createElement("div");
|
|
6318
6317
|
d.style.cssText = `
|
|
@@ -6327,9 +6326,9 @@ class As extends G {
|
|
|
6327
6326
|
V(([l, d]) => {
|
|
6328
6327
|
if (!d) return;
|
|
6329
6328
|
this.spineItemsManager.destroyItems();
|
|
6330
|
-
const
|
|
6331
|
-
(
|
|
6332
|
-
|
|
6329
|
+
const g = l.spineItems.map(
|
|
6330
|
+
(p, h) => new Zt(
|
|
6331
|
+
p,
|
|
6333
6332
|
d,
|
|
6334
6333
|
this.context,
|
|
6335
6334
|
this.settings,
|
|
@@ -6338,7 +6337,7 @@ class As extends G {
|
|
|
6338
6337
|
this.viewport
|
|
6339
6338
|
)
|
|
6340
6339
|
);
|
|
6341
|
-
this.spineItemsManager.addMany(
|
|
6340
|
+
this.spineItemsManager.addMany(g);
|
|
6342
6341
|
})
|
|
6343
6342
|
);
|
|
6344
6343
|
P(u, c).pipe(K(this.destroy$)).subscribe();
|
|
@@ -6402,10 +6401,10 @@ class Rs extends G {
|
|
|
6402
6401
|
});
|
|
6403
6402
|
}
|
|
6404
6403
|
}
|
|
6405
|
-
class
|
|
6404
|
+
class Os extends Q {
|
|
6406
6405
|
constructor(e, t) {
|
|
6407
6406
|
const i = document.createElement("div");
|
|
6408
|
-
i.setAttribute(`data-${
|
|
6407
|
+
i.setAttribute(`data-${si}`, ""), super({
|
|
6409
6408
|
element: i,
|
|
6410
6409
|
pageSize: {
|
|
6411
6410
|
width: 1,
|
|
@@ -6415,13 +6414,13 @@ class Ns extends Q {
|
|
|
6415
6414
|
height: 1
|
|
6416
6415
|
}), this.context = e, this.settingsManager = t;
|
|
6417
6416
|
const o = this.settingsManager.watch(["computedSpreadMode"]).pipe(
|
|
6418
|
-
|
|
6417
|
+
x(() => {
|
|
6419
6418
|
this.mergeCompare({
|
|
6420
6419
|
pageSize: this.calculatePageSize(this.value)
|
|
6421
6420
|
});
|
|
6422
6421
|
})
|
|
6423
6422
|
), s = this.context.watch("rootElement").pipe(
|
|
6424
|
-
|
|
6423
|
+
x(() => {
|
|
6425
6424
|
this.layout();
|
|
6426
6425
|
})
|
|
6427
6426
|
);
|
|
@@ -6445,7 +6444,7 @@ class Ns extends Q {
|
|
|
6445
6444
|
});
|
|
6446
6445
|
}
|
|
6447
6446
|
get absoluteViewport() {
|
|
6448
|
-
return new
|
|
6447
|
+
return new ws({
|
|
6449
6448
|
width: this.value.width,
|
|
6450
6449
|
height: this.value.height
|
|
6451
6450
|
});
|
|
@@ -6473,18 +6472,18 @@ class Ns extends Q {
|
|
|
6473
6472
|
*/
|
|
6474
6473
|
get relativeViewport() {
|
|
6475
6474
|
const e = this.absoluteViewport, t = this.scaleFactor;
|
|
6476
|
-
return new
|
|
6475
|
+
return new Ps({
|
|
6477
6476
|
width: e.width / t,
|
|
6478
6477
|
height: e.height / t
|
|
6479
6478
|
});
|
|
6480
6479
|
}
|
|
6481
6480
|
}
|
|
6482
|
-
const xt = `${Vt}-core`,
|
|
6483
|
-
const e = crypto.randomUUID(), t = new
|
|
6481
|
+
const xt = `${Vt}-core`, Vs = (n) => {
|
|
6482
|
+
const e = crypto.randomUUID(), t = new N(), i = new N(), o = new No(), s = new Do(), r = new ys(n, s), a = new Ao(s, r), c = new Rs(s, r), u = new Os(s, r), l = qt({
|
|
6484
6483
|
context: s,
|
|
6485
6484
|
settings: r,
|
|
6486
6485
|
viewport: u
|
|
6487
|
-
}), d = new
|
|
6486
|
+
}), d = new gs(s, c), g = new Ns(
|
|
6488
6487
|
s,
|
|
6489
6488
|
d,
|
|
6490
6489
|
c,
|
|
@@ -6492,64 +6491,61 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6492
6491
|
r,
|
|
6493
6492
|
o,
|
|
6494
6493
|
u
|
|
6495
|
-
),
|
|
6494
|
+
), p = ps({
|
|
6496
6495
|
context: s,
|
|
6497
6496
|
spineItemsManager: c,
|
|
6498
6497
|
hookManager: o,
|
|
6499
|
-
spine:
|
|
6498
|
+
spine: g,
|
|
6500
6499
|
settings: r,
|
|
6501
6500
|
viewport: u
|
|
6502
|
-
}), h = new
|
|
6501
|
+
}), h = new hs(
|
|
6503
6502
|
s,
|
|
6504
6503
|
d,
|
|
6505
6504
|
c,
|
|
6506
|
-
|
|
6505
|
+
g,
|
|
6507
6506
|
l
|
|
6508
6507
|
);
|
|
6509
|
-
|
|
6508
|
+
p.navigationState$.subscribe(s.bridgeEvent.viewportStateSubject), p.navigation$.subscribe(s.bridgeEvent.navigationSubject), p.locker.isLocked$.subscribe(
|
|
6510
6509
|
s.bridgeEvent.navigationIsLockedSubject
|
|
6511
6510
|
), d.subscribe(s.bridgeEvent.paginationSubject);
|
|
6512
6511
|
const m = () => {
|
|
6513
6512
|
t.next();
|
|
6514
|
-
}, y = (
|
|
6515
|
-
const { containerElement: L, manifest: H } =
|
|
6513
|
+
}, y = ($) => {
|
|
6514
|
+
const { containerElement: L, manifest: H } = $;
|
|
6516
6515
|
if (s.manifest) {
|
|
6517
6516
|
A.warn("loading a new book is not supported yet");
|
|
6518
6517
|
return;
|
|
6519
6518
|
}
|
|
6520
|
-
A.log("load", { options:
|
|
6521
|
-
const B =
|
|
6519
|
+
A.log("load", { options: $ });
|
|
6520
|
+
const B = js(L, e);
|
|
6522
6521
|
s.update({
|
|
6523
6522
|
manifest: H,
|
|
6524
6523
|
rootElement: B
|
|
6525
6524
|
}), m();
|
|
6526
6525
|
}, f = r.watch(["computedSpreadMode"]).pipe(Lt(1), V(m)), I = t.pipe(
|
|
6527
6526
|
V(() => {
|
|
6528
|
-
const
|
|
6529
|
-
|
|
6527
|
+
const $ = s.value.rootElement;
|
|
6528
|
+
$ && ($.style.setProperty("overflow", "hidden"), u.layout(), g.layout());
|
|
6530
6529
|
}),
|
|
6531
6530
|
K(i)
|
|
6532
6531
|
), b = P(I, f).subscribe();
|
|
6533
6532
|
Ce(document, xt, Ro);
|
|
6534
6533
|
const F = () => {
|
|
6535
|
-
Ee(document, xt), b.unsubscribe(), c.destroy(), h.destroy(), r.destroy(), d.destroy(), s.destroy(),
|
|
6534
|
+
Ee(document, xt), b.unsubscribe(), c.destroy(), h.destroy(), r.destroy(), d.destroy(), s.destroy(), p.destroy(), g.destroy(), a.destroy(), i.next(), i.complete(), u.destroy();
|
|
6536
6535
|
};
|
|
6537
6536
|
return {
|
|
6538
6537
|
id: e,
|
|
6539
6538
|
context: s,
|
|
6540
|
-
spine:
|
|
6539
|
+
spine: g,
|
|
6541
6540
|
hookManager: o,
|
|
6542
6541
|
cfi: {
|
|
6543
|
-
generateCfiFromRange:
|
|
6542
|
+
generateCfiFromRange: oo,
|
|
6544
6543
|
parseCfi: it,
|
|
6545
|
-
generateCfiForSpineItemPage:
|
|
6546
|
-
|
|
6547
|
-
spine: p
|
|
6548
|
-
}),
|
|
6549
|
-
resolveCfi: (x) => _t({ ...x, spineItemsManager: c })
|
|
6544
|
+
generateCfiForSpineItemPage: He,
|
|
6545
|
+
resolveCfi: ($) => _t({ ...$, spineItemsManager: c })
|
|
6550
6546
|
},
|
|
6551
|
-
navigation:
|
|
6552
|
-
spineItemsObserver:
|
|
6547
|
+
navigation: p,
|
|
6548
|
+
spineItemsObserver: g.spineItemsObserver,
|
|
6553
6549
|
spineItemsManager: c,
|
|
6554
6550
|
layout: m,
|
|
6555
6551
|
load: y,
|
|
@@ -6563,7 +6559,7 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6563
6559
|
}
|
|
6564
6560
|
},
|
|
6565
6561
|
settings: r,
|
|
6566
|
-
renderHeadless: (
|
|
6562
|
+
renderHeadless: ($) => c.get($)?.renderer.renderHeadless() ?? v(void 0),
|
|
6567
6563
|
viewport: u,
|
|
6568
6564
|
viewportState$: s.bridgeEvent.viewportState$,
|
|
6569
6565
|
viewportFree$: s.bridgeEvent.viewportFree$,
|
|
@@ -6574,37 +6570,37 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6574
6570
|
* It can typically be used to hide a loading indicator.
|
|
6575
6571
|
*/
|
|
6576
6572
|
state$: s.manifest$.pipe(
|
|
6577
|
-
ie((
|
|
6573
|
+
ie(($) => $ ? "ready" : "idle")
|
|
6578
6574
|
),
|
|
6579
6575
|
features: a,
|
|
6580
6576
|
$: {
|
|
6581
6577
|
destroy$: i
|
|
6582
6578
|
}
|
|
6583
6579
|
};
|
|
6584
|
-
},
|
|
6580
|
+
}, js = (n, e) => (n.style.cssText = `
|
|
6585
6581
|
${n.style.cssText}
|
|
6586
6582
|
background-color: white;
|
|
6587
6583
|
position: relative;
|
|
6588
|
-
`, n.classList.add(`${W}-reader`), n.setAttribute(
|
|
6584
|
+
`, n.classList.add(`${W}-reader`), n.setAttribute(oi, e), n.setAttribute("data-prose-reader-container", e), n), Ks = (
|
|
6589
6585
|
//__
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6586
|
+
So(
|
|
6587
|
+
Zn(
|
|
6588
|
+
vo(
|
|
6589
|
+
Gn(
|
|
6594
6590
|
Un(
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6591
|
+
go(
|
|
6592
|
+
bo(
|
|
6593
|
+
Co(
|
|
6594
|
+
Yi(
|
|
6595
|
+
Si(
|
|
6600
6596
|
Ri(
|
|
6601
6597
|
zn(
|
|
6602
6598
|
Bn(
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6599
|
+
uo(
|
|
6600
|
+
Ai(
|
|
6601
|
+
Io(
|
|
6606
6602
|
// __
|
|
6607
|
-
|
|
6603
|
+
Vs
|
|
6608
6604
|
)
|
|
6609
6605
|
)
|
|
6610
6606
|
)
|
|
@@ -6621,79 +6617,80 @@ const xt = `${Vt}-core`, Os = (n) => {
|
|
|
6621
6617
|
)
|
|
6622
6618
|
)
|
|
6623
6619
|
)
|
|
6624
|
-
),
|
|
6620
|
+
), Qs = (n) => (e) => n(e);
|
|
6625
6621
|
export {
|
|
6626
6622
|
kt as AbstractSpinePosition,
|
|
6627
|
-
|
|
6628
|
-
|
|
6623
|
+
Do as Context,
|
|
6624
|
+
ko as ControlledNavigationController,
|
|
6629
6625
|
G as DestroyableClass,
|
|
6630
6626
|
ye as DocumentRenderer,
|
|
6631
|
-
|
|
6632
|
-
|
|
6627
|
+
Ao as Features,
|
|
6628
|
+
oi as HTML_ATTRIBUTE_DATA_READER_ID,
|
|
6633
6629
|
W as HTML_PREFIX,
|
|
6634
|
-
|
|
6635
|
-
|
|
6630
|
+
ri as HTML_PREFIX_SCROLL_NAVIGATOR,
|
|
6631
|
+
si as HTML_PREFIX_VIEWPORT,
|
|
6636
6632
|
Vt as HTML_STYLE_PREFIX,
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6633
|
+
No as HookManager,
|
|
6634
|
+
ii as ITEM_EXTENSION_VALID_FOR_FRAME_SRC,
|
|
6635
|
+
Qo as InternalNavigator,
|
|
6640
6636
|
nt as LayoutEntry,
|
|
6641
6637
|
Xt as Locker,
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6638
|
+
Gs as PAGINATION_UPDATE_AFTER_VIEWPORT_ADJUSTMENT_DEBOUNCE,
|
|
6639
|
+
Ys as PROSE_READER_NAMESPACE,
|
|
6640
|
+
Es as Pages,
|
|
6641
|
+
gs as Pagination,
|
|
6642
|
+
hs as PaginationController,
|
|
6647
6643
|
Q as ReactiveEntity,
|
|
6648
6644
|
tt as ResourceHandler,
|
|
6649
|
-
|
|
6650
|
-
|
|
6645
|
+
co as ResourcesLocator,
|
|
6646
|
+
To as ScrollNavigationController,
|
|
6651
6647
|
mt as ScrollPosition,
|
|
6652
|
-
|
|
6653
|
-
|
|
6648
|
+
fs as SettingsManager,
|
|
6649
|
+
Ns as Spine,
|
|
6654
6650
|
Zt as SpineItem,
|
|
6655
|
-
|
|
6656
|
-
|
|
6651
|
+
Ii as SpineItemPageLayout,
|
|
6652
|
+
bi as SpineItemPageSpineLayout,
|
|
6657
6653
|
E as SpineItemPosition,
|
|
6658
6654
|
Oe as SpineItemSpineLayout,
|
|
6659
6655
|
Rs as SpineItemsManager,
|
|
6660
|
-
|
|
6656
|
+
Ds as SpineItemsObserver,
|
|
6661
6657
|
M as SpinePosition,
|
|
6662
|
-
|
|
6663
|
-
|
|
6658
|
+
$o as UnboundScrollPosition,
|
|
6659
|
+
Re as UnboundSpineItemPagePosition,
|
|
6664
6660
|
ae as UnboundSpinePosition,
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6661
|
+
qs as VIEWPORT_ADJUSTMENT_THROTTLE,
|
|
6662
|
+
Os as Viewport,
|
|
6663
|
+
ao as consolidate,
|
|
6664
|
+
Ks as createReader,
|
|
6669
6665
|
at as deferIdle,
|
|
6670
|
-
|
|
6666
|
+
Yn as deferNextResult,
|
|
6671
6667
|
He as generateCfiForSpineItemPage,
|
|
6672
|
-
|
|
6673
|
-
|
|
6668
|
+
oo as generateCfiFromRange,
|
|
6669
|
+
de as generateRootCfi,
|
|
6674
6670
|
rt as getAttributeValueFromString,
|
|
6675
6671
|
Hs as getBase64FromBlob,
|
|
6676
6672
|
Je as getFrameViewportInfo,
|
|
6677
|
-
|
|
6678
|
-
|
|
6673
|
+
Js as getItemAnchor,
|
|
6674
|
+
Si as htmlEnhancer,
|
|
6679
6675
|
et as idle,
|
|
6680
6676
|
Vn as injectCSSToFrame,
|
|
6681
6677
|
Z as isDefined,
|
|
6682
6678
|
At as isHtmlElement,
|
|
6683
|
-
|
|
6679
|
+
Rn as isHtmlTagElement,
|
|
6684
6680
|
Be as isRootCfi,
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6681
|
+
nr as isShallowEqual,
|
|
6682
|
+
Ai as layoutEnhancer,
|
|
6683
|
+
Nt as mapKeysTo,
|
|
6684
|
+
Bs as observeIntersection,
|
|
6689
6685
|
ct as observeMutation,
|
|
6690
6686
|
Qe as observeResize,
|
|
6691
|
-
|
|
6687
|
+
uo as paginationEnhancer,
|
|
6692
6688
|
it as parseCfi,
|
|
6693
|
-
|
|
6689
|
+
Xn as pick,
|
|
6690
|
+
_s as removeCSS,
|
|
6694
6691
|
_t as resolveCfi,
|
|
6695
|
-
|
|
6696
|
-
|
|
6692
|
+
Qs as rootEnhancer,
|
|
6693
|
+
Cs as spinePositionToSpineItemSpineLayout,
|
|
6697
6694
|
oe as upsertCSSToFrame,
|
|
6698
6695
|
jn as waitForFrameLoad,
|
|
6699
6696
|
kn as waitForFrameReady,
|