@zinejs/core 0.9.2 → 1.0.1
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/{cssRenderer-CTaM4cAj.js → cssRenderer-DAW29lU2.js} +39 -22
- package/dist/cssRenderer-DAW29lU2.js.map +1 -0
- package/dist/engine/gutter.d.ts +12 -0
- package/dist/gutter-C3H2CDT2.js +43 -0
- package/dist/gutter-C3H2CDT2.js.map +1 -0
- package/dist/index.js +550 -526
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +14 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/renderer/cssRenderer.d.ts +1 -1
- package/dist/renderer/types.d.ts +13 -0
- package/dist/renderer/webglRenderer.d.ts +1 -1
- package/dist/types-DYqgosP1.js +9 -0
- package/dist/types-DYqgosP1.js.map +1 -0
- package/dist/{webglRenderer-DQn4pc1S.js → webglRenderer-9RcNHAy-.js} +74 -49
- package/dist/webglRenderer-9RcNHAy-.js.map +1 -0
- package/dist/zine.d.ts +6 -0
- package/options.schema.json +8 -0
- package/package.json +1 -1
- package/dist/cssRenderer-CTaM4cAj.js.map +0 -1
- package/dist/webglRenderer-DQn4pc1S.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -281,8 +281,8 @@ function ee(e, t) {
|
|
|
281
281
|
//#endregion
|
|
282
282
|
//#region src/renderer/select.ts
|
|
283
283
|
var te = {
|
|
284
|
-
css: async () => new (await (import("./cssRenderer-
|
|
285
|
-
webgl2: async () => new (await (import("./webglRenderer-
|
|
284
|
+
css: async () => new (await (import("./cssRenderer-DAW29lU2.js"))).CssRenderer(),
|
|
285
|
+
webgl2: async () => new (await (import("./webglRenderer-9RcNHAy-.js"))).WebglRenderer()
|
|
286
286
|
}, w = !0;
|
|
287
287
|
function T(e) {
|
|
288
288
|
return typeof e == "object" && !!e && !Array.isArray(e) && typeof e.mount == "function";
|
|
@@ -483,101 +483,104 @@ var Y = class {
|
|
|
483
483
|
#u;
|
|
484
484
|
#d;
|
|
485
485
|
#f;
|
|
486
|
-
#p;
|
|
487
|
-
#m;
|
|
488
|
-
#h
|
|
489
|
-
#g
|
|
486
|
+
#p = null;
|
|
487
|
+
#m = /* @__PURE__ */ new Map();
|
|
488
|
+
#h;
|
|
489
|
+
#g;
|
|
490
490
|
#_;
|
|
491
|
-
#v;
|
|
492
|
-
#y;
|
|
491
|
+
#v = null;
|
|
492
|
+
#y = null;
|
|
493
493
|
#b;
|
|
494
|
-
#x
|
|
495
|
-
#S
|
|
496
|
-
#C
|
|
497
|
-
#w =
|
|
498
|
-
#T =
|
|
494
|
+
#x;
|
|
495
|
+
#S;
|
|
496
|
+
#C;
|
|
497
|
+
#w = null;
|
|
498
|
+
#T = !1;
|
|
499
|
+
#E = !1;
|
|
500
|
+
#D = !1;
|
|
501
|
+
#O = {
|
|
499
502
|
turn: !1,
|
|
500
503
|
zoom: !1,
|
|
501
504
|
pan: !1
|
|
502
505
|
};
|
|
503
|
-
#E = null;
|
|
504
|
-
#D = null;
|
|
505
|
-
#O = null;
|
|
506
506
|
#k = null;
|
|
507
507
|
#A = null;
|
|
508
508
|
#j = null;
|
|
509
|
-
#M =
|
|
510
|
-
#N =
|
|
511
|
-
#P;
|
|
512
|
-
#F;
|
|
513
|
-
#I;
|
|
514
|
-
#L
|
|
515
|
-
#R
|
|
516
|
-
#z
|
|
517
|
-
#B;
|
|
509
|
+
#M = null;
|
|
510
|
+
#N = null;
|
|
511
|
+
#P = null;
|
|
512
|
+
#F = !1;
|
|
513
|
+
#I = "";
|
|
514
|
+
#L;
|
|
515
|
+
#R;
|
|
516
|
+
#z;
|
|
517
|
+
#B = !1;
|
|
518
518
|
#V = null;
|
|
519
|
-
#H;
|
|
519
|
+
#H = !1;
|
|
520
520
|
#U;
|
|
521
|
-
#W;
|
|
522
|
-
#G
|
|
523
|
-
#K
|
|
524
|
-
#q
|
|
525
|
-
#J =
|
|
526
|
-
#Y =
|
|
527
|
-
#X =
|
|
521
|
+
#W = null;
|
|
522
|
+
#G;
|
|
523
|
+
#K;
|
|
524
|
+
#q;
|
|
525
|
+
#J = null;
|
|
526
|
+
#Y = null;
|
|
527
|
+
#X = [];
|
|
528
|
+
#Z = 0;
|
|
529
|
+
#Q = 0;
|
|
530
|
+
#$ = {
|
|
528
531
|
left: null,
|
|
529
532
|
right: null
|
|
530
533
|
};
|
|
531
|
-
#Z;
|
|
532
|
-
#Q;
|
|
533
|
-
#$;
|
|
534
534
|
#ee;
|
|
535
535
|
#te;
|
|
536
|
-
#ne
|
|
537
|
-
#re
|
|
538
|
-
#ie
|
|
539
|
-
#ae =
|
|
540
|
-
#oe =
|
|
541
|
-
#se =
|
|
542
|
-
#ce =
|
|
543
|
-
#le =
|
|
536
|
+
#ne;
|
|
537
|
+
#re;
|
|
538
|
+
#ie;
|
|
539
|
+
#ae = null;
|
|
540
|
+
#oe = !1;
|
|
541
|
+
#se = 1;
|
|
542
|
+
#ce = 0;
|
|
543
|
+
#le = 0;
|
|
544
544
|
#ue = null;
|
|
545
|
-
#de =
|
|
546
|
-
#fe =
|
|
545
|
+
#de = !1;
|
|
546
|
+
#fe = !1;
|
|
547
547
|
#pe = null;
|
|
548
548
|
#me = null;
|
|
549
549
|
#he = null;
|
|
550
550
|
#ge = null;
|
|
551
|
-
#_e =
|
|
551
|
+
#_e = null;
|
|
552
552
|
#ve = null;
|
|
553
|
-
#ye =
|
|
554
|
-
#be =
|
|
555
|
-
#xe =
|
|
556
|
-
#Se =
|
|
557
|
-
#Ce =
|
|
558
|
-
#we =
|
|
553
|
+
#ye = null;
|
|
554
|
+
#be = 0;
|
|
555
|
+
#xe = null;
|
|
556
|
+
#Se = !1;
|
|
557
|
+
#Ce = 1;
|
|
558
|
+
#we = !1;
|
|
559
559
|
#Te = null;
|
|
560
560
|
#Ee = null;
|
|
561
561
|
#De = null;
|
|
562
|
-
#Oe =
|
|
562
|
+
#Oe = null;
|
|
563
563
|
#ke = null;
|
|
564
564
|
#Ae = null;
|
|
565
|
-
#je =
|
|
566
|
-
#Me;
|
|
565
|
+
#je = -Infinity;
|
|
566
|
+
#Me = null;
|
|
567
567
|
#Ne = null;
|
|
568
|
-
#Pe;
|
|
569
|
-
#Fe
|
|
570
|
-
#Ie;
|
|
568
|
+
#Pe = /* @__PURE__ */ new Set();
|
|
569
|
+
#Fe;
|
|
570
|
+
#Ie = null;
|
|
571
571
|
#Le;
|
|
572
572
|
#Re = null;
|
|
573
|
-
#ze
|
|
574
|
-
#Be
|
|
575
|
-
#Ve =
|
|
576
|
-
#He =
|
|
577
|
-
#Ue =
|
|
578
|
-
#We;
|
|
573
|
+
#ze;
|
|
574
|
+
#Be;
|
|
575
|
+
#Ve = null;
|
|
576
|
+
#He = null;
|
|
577
|
+
#Ue = "download";
|
|
578
|
+
#We = 1;
|
|
579
|
+
#Ge = 0;
|
|
580
|
+
#Ke = null;
|
|
581
|
+
#qe;
|
|
579
582
|
debug = { setFlipProgress: (e, t) => {
|
|
580
|
-
this.#
|
|
583
|
+
this.#ue?.setFlipProgress(e, t);
|
|
581
584
|
} };
|
|
582
585
|
constructor(e, t) {
|
|
583
586
|
fe(e, t), this.#e = e, t.width !== void 0 && (e.style.width = `${t.width}px`), t.height !== void 0 && (e.style.height = `${t.height}px`), this.#t = re(t.source, {
|
|
@@ -586,40 +589,40 @@ var Y = class {
|
|
|
586
589
|
pages: t.pages
|
|
587
590
|
});
|
|
588
591
|
let n = t.direction ?? "ltr";
|
|
589
|
-
this.#a = n, this.#
|
|
592
|
+
this.#a = n, this.#K = (t.deepLink ?? !0) && b(), this.#q = t.disableContextMenu ?? !1, this.#o = t.spreadMode ?? "cover", this.#s = this.#o, this.#c = t.curl ?? "cone", this.#u = t.clickToFlip ?? "edge", this.#d = t.fit ?? "contain", this.#f = t.gutterOverlap ?? 0, this.#f === "auto" && (this.#p = import("./gutter-C3H2CDT2.js").then((e) => e.detectOverlap, () => null)), this.#h = oe(t.strings), this.#g = t.clickZoneSize ?? 64, this.#_ = t.cursorHints ?? !0;
|
|
590
593
|
let r = t.hints ?? !0;
|
|
591
|
-
this.#
|
|
594
|
+
this.#b = r === !0 || r !== !1 && (r.enabled ?? !0), this.#x = r !== !0 && r !== !1 && (r.persist ?? !1), this.#x && this.#wt();
|
|
592
595
|
let i = t.sound ?? !1;
|
|
593
|
-
this.#
|
|
596
|
+
this.#S = i !== !1, this.#C = i === !0 || i === !1 ? {} : i, this.#T = typeof i == "object" && i ? i.muted ?? !1 : !1, this.#E = typeof i == "object" && i ? i.persist ?? !1 : !1, this.#S && this.#E && this.#et(), this.#z = t.singlePageThreshold ?? 640, this.#U = t.responsiveSpread ?? !0, this.#Fe = t.controls ?? !0, this.#Le = t.contextMenu ?? !t.disableContextMenu, this.#ze = new Set(t.hideControls ?? []), this.#Be = t.loading ?? !0, this.#G = t.startPage, typeof this.#t.open != "function" && this.#An(), this.#ee = t.flipDuration ?? 800, this.#te = t.zoom?.enabled ?? !0, this.#ne = t.zoom?.wheel ?? !0;
|
|
594
597
|
let a = t.zoom?.doubleClick, o = a === !1 ? [] : [...a ?? [
|
|
595
598
|
1,
|
|
596
599
|
2,
|
|
597
600
|
4
|
|
598
601
|
]].sort((e, t) => e - t);
|
|
599
|
-
this.#
|
|
600
|
-
let s = this.#
|
|
601
|
-
this.#
|
|
602
|
+
this.#re = o.length > 0 ? o : null, this.#ie = t.zoom?.max ?? 4;
|
|
603
|
+
let s = this.#te && this.#re !== null, c = t.zoom?.doubleClickInFlipZone ?? this.#u === "half";
|
|
604
|
+
this.#L = this.#u !== "off" && s && c && t.clickFlipDelay !== 0, this.#R = this.#L ? t.clickFlipDelay ?? N : 0, this.#qe = this.#Jt(t.renderer ?? "auto");
|
|
602
605
|
}
|
|
603
606
|
get ready() {
|
|
604
|
-
return this.#
|
|
607
|
+
return this.#qe;
|
|
605
608
|
}
|
|
606
609
|
getPageCount() {
|
|
607
610
|
return this.#t.pageCount;
|
|
608
611
|
}
|
|
609
612
|
getPage() {
|
|
610
|
-
return this.#
|
|
613
|
+
return this.#Q;
|
|
611
614
|
}
|
|
612
615
|
get container() {
|
|
613
616
|
return this.#e;
|
|
614
617
|
}
|
|
615
618
|
getPageBox() {
|
|
616
|
-
return this.#
|
|
619
|
+
return this.#ue?.measure().book ?? null;
|
|
617
620
|
}
|
|
618
621
|
getSpreads() {
|
|
619
|
-
return this.#
|
|
622
|
+
return this.#X;
|
|
620
623
|
}
|
|
621
624
|
getSpreadIndex() {
|
|
622
|
-
return this.#
|
|
625
|
+
return this.#Z;
|
|
623
626
|
}
|
|
624
627
|
getDirection() {
|
|
625
628
|
return this.#a;
|
|
@@ -628,44 +631,44 @@ var Y = class {
|
|
|
628
631
|
return this.#o;
|
|
629
632
|
}
|
|
630
633
|
isSinglePage() {
|
|
631
|
-
return this.#
|
|
634
|
+
return this.#B;
|
|
632
635
|
}
|
|
633
636
|
setSpreadMode(e) {
|
|
634
|
-
e !== this.#o && (this.#o = e, this.#
|
|
637
|
+
e !== this.#o && (this.#o = e, this.#H = !1, this.#pn(), this.#mn());
|
|
635
638
|
}
|
|
636
639
|
toggleSpreadMode() {
|
|
637
640
|
this.setSpreadMode(this.#o === "single" ? this.#s === "single" ? "double" : this.#s : "single");
|
|
638
641
|
}
|
|
639
642
|
getResponsiveSpread() {
|
|
640
|
-
return this.#
|
|
643
|
+
return this.#U;
|
|
641
644
|
}
|
|
642
645
|
isResponsiveSingle() {
|
|
643
|
-
return this.#
|
|
646
|
+
return this.#H && this.#o !== "single";
|
|
644
647
|
}
|
|
645
648
|
setResponsiveSpread(e) {
|
|
646
|
-
if (e !== this.#
|
|
647
|
-
if (this.#
|
|
648
|
-
let e = this.#
|
|
649
|
+
if (e !== this.#U) {
|
|
650
|
+
if (this.#U = e, e) {
|
|
651
|
+
let e = this.#ue?.measure().containerWidth;
|
|
649
652
|
if (e === void 0) return;
|
|
650
|
-
this.#
|
|
653
|
+
this.#H = !1, this.#fn(e);
|
|
651
654
|
} else {
|
|
652
|
-
if (!this.#
|
|
653
|
-
this.#
|
|
655
|
+
if (!this.#H) return;
|
|
656
|
+
this.#H = !1, this.#pn();
|
|
654
657
|
}
|
|
655
|
-
this.#
|
|
658
|
+
this.#mn();
|
|
656
659
|
}
|
|
657
660
|
}
|
|
658
661
|
getPageImage(e) {
|
|
659
|
-
return this.#
|
|
662
|
+
return this.#Dn(e);
|
|
660
663
|
}
|
|
661
664
|
canFlipNext() {
|
|
662
|
-
return this.#
|
|
665
|
+
return this.#Z + 1 < this.#X.length;
|
|
663
666
|
}
|
|
664
667
|
canFlipPrev() {
|
|
665
|
-
return this.#
|
|
668
|
+
return this.#Z > 0;
|
|
666
669
|
}
|
|
667
670
|
getMaxZoom() {
|
|
668
|
-
return this.#
|
|
671
|
+
return this.#ie;
|
|
669
672
|
}
|
|
670
673
|
canSearch() {
|
|
671
674
|
return typeof this.#t.getText == "function";
|
|
@@ -682,7 +685,7 @@ var Y = class {
|
|
|
682
685
|
async print() {
|
|
683
686
|
let e = await this.getSourceFile(), t = this.#e.ownerDocument;
|
|
684
687
|
if (!e || !t) return !1;
|
|
685
|
-
let { url: n, revoke: r } = await this.#
|
|
688
|
+
let { url: n, revoke: r } = await this.#Je(e, t), i = t.createElement("iframe");
|
|
686
689
|
return i.style.cssText = "position:fixed;right:0;bottom:0;width:1px;height:1px;opacity:0;border:0;", i.setAttribute("aria-hidden", "true"), i.src = n, new Promise((e) => {
|
|
687
690
|
let a = !1, o = (t) => {
|
|
688
691
|
a || (a = !0, setTimeout(() => {
|
|
@@ -704,11 +707,11 @@ var Y = class {
|
|
|
704
707
|
return typeof this.#t.getOutline == "function";
|
|
705
708
|
}
|
|
706
709
|
getOutline() {
|
|
707
|
-
if (!this.#
|
|
710
|
+
if (!this.#Ne) {
|
|
708
711
|
let e = this.#t.getOutline;
|
|
709
|
-
this.#
|
|
712
|
+
this.#Ne = typeof e == "function" ? Promise.resolve(e.call(this.#t)).catch(() => []) : Promise.resolve([]);
|
|
710
713
|
}
|
|
711
|
-
return this.#
|
|
714
|
+
return this.#Ne;
|
|
712
715
|
}
|
|
713
716
|
async getSourceFile() {
|
|
714
717
|
let e = this.#t.getDownload;
|
|
@@ -719,11 +722,11 @@ var Y = class {
|
|
|
719
722
|
if (!e) return !1;
|
|
720
723
|
let t = this.#e.ownerDocument;
|
|
721
724
|
if (!t) return !1;
|
|
722
|
-
let { url: n, revoke: r } = await this.#
|
|
725
|
+
let { url: n, revoke: r } = await this.#Je(e, t), i = t.createElement("a");
|
|
723
726
|
return i.href = n, i.download = e.filename, i.rel = "noopener", t.body.appendChild(i), i.click(), i.remove(), r && setTimeout(() => URL.revokeObjectURL(n), 1e4), !0;
|
|
724
727
|
}
|
|
725
|
-
async #
|
|
726
|
-
if (e.revoke || !this.#
|
|
728
|
+
async #Je(e, t) {
|
|
729
|
+
if (e.revoke || !this.#Ye(e.url, t)) return {
|
|
727
730
|
url: e.url,
|
|
728
731
|
revoke: e.revoke ?? !1
|
|
729
732
|
};
|
|
@@ -740,7 +743,7 @@ var Y = class {
|
|
|
740
743
|
};
|
|
741
744
|
}
|
|
742
745
|
}
|
|
743
|
-
#
|
|
746
|
+
#Ye(e, t) {
|
|
744
747
|
let n = t.defaultView?.location?.href;
|
|
745
748
|
if (!n) return !1;
|
|
746
749
|
try {
|
|
@@ -773,79 +776,79 @@ var Y = class {
|
|
|
773
776
|
return a;
|
|
774
777
|
}
|
|
775
778
|
flipNext() {
|
|
776
|
-
this.#
|
|
779
|
+
this.#Xe(1);
|
|
777
780
|
}
|
|
778
781
|
flipPrev() {
|
|
779
|
-
this.#
|
|
782
|
+
this.#Xe(-1);
|
|
780
783
|
}
|
|
781
|
-
#
|
|
782
|
-
this.#
|
|
784
|
+
#Xe(e) {
|
|
785
|
+
this.#Ze(() => this.#it(this.#Z + e));
|
|
783
786
|
}
|
|
784
787
|
flipTo(e) {
|
|
785
788
|
let t = X(e, 0, Math.max(0, this.#t.pageCount - 1));
|
|
786
|
-
this.#
|
|
789
|
+
this.#Ze(() => this.#it(this.#kn(t)));
|
|
787
790
|
}
|
|
788
|
-
#
|
|
789
|
-
this.#i.state === "idle" ? e() : this.#
|
|
791
|
+
#Ze(e) {
|
|
792
|
+
this.#i.state === "idle" ? e() : this.#ye ? (this.#ve = null, this.#Qe(), e()) : this.#ve = e;
|
|
790
793
|
}
|
|
791
|
-
#
|
|
792
|
-
let e = this.#
|
|
793
|
-
e && (this.#
|
|
794
|
+
#Qe() {
|
|
795
|
+
let e = this.#ye;
|
|
796
|
+
e && (this.#ye = null, this.#pe !== null && (cancelAnimationFrame(this.#pe), this.#pe = null), this.#ue?.setFlipProgress(e.toT, e.direction), e.onDone());
|
|
794
797
|
}
|
|
795
|
-
|
|
796
|
-
let e = this.#
|
|
798
|
+
#$e() {
|
|
799
|
+
let e = this.#ve;
|
|
797
800
|
if (!e) {
|
|
798
|
-
this.#
|
|
801
|
+
this.#Sn();
|
|
799
802
|
return;
|
|
800
803
|
}
|
|
801
|
-
this.#
|
|
804
|
+
this.#ve = null, e();
|
|
802
805
|
}
|
|
803
806
|
getZoom() {
|
|
804
|
-
return this.#
|
|
807
|
+
return this.#se;
|
|
805
808
|
}
|
|
806
809
|
setZoom(e, t) {
|
|
807
|
-
if (!this.#
|
|
808
|
-
this.#
|
|
809
|
-
let n = X(e, 1, this.#
|
|
810
|
-
x: i.x + this.#
|
|
811
|
-
y: i.y + this.#
|
|
810
|
+
if (!this.#ue || !this.#te) return;
|
|
811
|
+
this.#kt(), this.#Mt();
|
|
812
|
+
let n = X(e, 1, this.#ie), r = this.#ue.measure(), i = r.screenAt?.(this.#se), a = t ?? (i ? {
|
|
813
|
+
x: i.x + this.#ce + i.width / 2,
|
|
814
|
+
y: i.y + this.#le + i.height / 2
|
|
812
815
|
} : null) ?? {
|
|
813
816
|
x: r.containerWidth / 2,
|
|
814
817
|
y: r.containerHeight / 2
|
|
815
|
-
}, o = this.#
|
|
816
|
-
[s, c] = this.#
|
|
818
|
+
}, o = this.#se, s = n === 1 ? 0 : a.x - n / o * (a.x - this.#ce), c = n === 1 ? 0 : a.y - n / o * (a.y - this.#le);
|
|
819
|
+
[s, c] = this.#rt(s, c, n, r.containerWidth, r.containerHeight), this.#se = n, this.#ce = s, this.#le = c, this.#ue.setViewTransform(n, s, c), o > 1 != n > 1 && this.#nt(), this.#vn(), this.#St(), o <= 1 && n > 1 && (this.#Tt("zoom"), this.#Nt()), this.#n.emit("zoomChanged", { scale: n });
|
|
817
820
|
}
|
|
818
821
|
resetZoom() {
|
|
819
822
|
this.setZoom(1);
|
|
820
823
|
}
|
|
821
824
|
get strings() {
|
|
822
|
-
return this.#
|
|
825
|
+
return this.#h;
|
|
823
826
|
}
|
|
824
827
|
isSoundEnabled() {
|
|
825
|
-
return this.#
|
|
828
|
+
return this.#S;
|
|
826
829
|
}
|
|
827
830
|
isSoundMuted() {
|
|
828
|
-
return this.#
|
|
831
|
+
return this.#S && this.#T;
|
|
829
832
|
}
|
|
830
833
|
setSoundMuted(e) {
|
|
831
|
-
this.#
|
|
834
|
+
this.#S && (this.#T = e, this.#w?.setMuted(e), this.#E && this.#tt(e), e || this.#Yt());
|
|
832
835
|
}
|
|
833
|
-
#
|
|
836
|
+
#et() {
|
|
834
837
|
try {
|
|
835
838
|
let e = localStorage.getItem(J);
|
|
836
|
-
(e === "true" || e === "false") && (this.#
|
|
839
|
+
(e === "true" || e === "false") && (this.#T = e === "true");
|
|
837
840
|
} catch {}
|
|
838
841
|
}
|
|
839
|
-
#
|
|
842
|
+
#tt(e) {
|
|
840
843
|
try {
|
|
841
844
|
localStorage.setItem(J, String(e));
|
|
842
845
|
} catch {}
|
|
843
846
|
}
|
|
844
|
-
|
|
845
|
-
this.#e.style.touchAction = this.#
|
|
847
|
+
#nt() {
|
|
848
|
+
this.#e.style.touchAction = this.#se > 1 ? "none" : "pan-y";
|
|
846
849
|
}
|
|
847
|
-
#
|
|
848
|
-
let a = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, o = (e) => Math.round(e * a) / a || 0, s = this.#
|
|
850
|
+
#rt(e, t, n, r, i) {
|
|
851
|
+
let a = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, o = (e) => Math.round(e * a) / a || 0, s = this.#ue?.measure().screenAt?.(n) ?? {
|
|
849
852
|
x: 0,
|
|
850
853
|
y: 0,
|
|
851
854
|
width: r * n,
|
|
@@ -857,32 +860,32 @@ var Y = class {
|
|
|
857
860
|
return this.#n.on(e, t);
|
|
858
861
|
}
|
|
859
862
|
destroy() {
|
|
860
|
-
this.#
|
|
863
|
+
this.#fe = !0, this.#pe !== null && cancelAnimationFrame(this.#pe), this.#ye = null, this.#ve = null, this.#zt(), this.#Dt(), this.#kt(), this.#Mt(), this.#Rt(), this.#Ft(), this.#w?.destroy(), this.#w = null, this.#ae?.disconnect(), this.#J?.stop(), this.#J = null, this.#Y?.(), this.#K && x(), this.#Ie?.(), this.#Re?.(), this.#en(), this.#Me?.(), this.#De?.(), this.#ke?.(), this.#Oe?.(), this.#y?.(), this.#Ee?.(), this.#Ke !== null && clearTimeout(this.#Ke), this.#Ge++, this.#ue?.destroy(), this.#ue = null, this.#t.destroy(), this.#n.clear();
|
|
861
864
|
}
|
|
862
|
-
#
|
|
863
|
-
if (e < 0 || e >= this.#
|
|
864
|
-
let t = e > this.#
|
|
865
|
+
#it(e) {
|
|
866
|
+
if (e < 0 || e >= this.#X.length || e === this.#Z || (this.#kt(), this.#Mt(), this.#i.send("flip") === null)) return;
|
|
867
|
+
let t = e > this.#Z ? "forward" : "backward", n = this.#lt(e);
|
|
865
868
|
this.#n.emit("flipStart", {
|
|
866
|
-
from: this.#
|
|
869
|
+
from: this.#Q,
|
|
867
870
|
to: n
|
|
868
|
-
}), this.#
|
|
871
|
+
}), this.#Xt(), this.#at(e, t, n, ++this.#be);
|
|
869
872
|
}
|
|
870
|
-
async #
|
|
871
|
-
let i = this.#
|
|
873
|
+
async #at(e, t, n, r) {
|
|
874
|
+
let i = this.#X[e], a = i ? await this.#Tn(i) : {
|
|
872
875
|
left: null,
|
|
873
876
|
right: null
|
|
874
877
|
};
|
|
875
|
-
r === this.#
|
|
876
|
-
fill: this.#
|
|
878
|
+
r === this.#be && (this.#ue?.beginFlip(this.#$, a, t, {
|
|
879
|
+
fill: this.#B,
|
|
877
880
|
fit: this.#d,
|
|
878
|
-
curl: this.#
|
|
881
|
+
curl: this.#un(),
|
|
879
882
|
anchor: { y: this.#l }
|
|
880
|
-
}), this.#
|
|
883
|
+
}), this.#ot(0, 1, t, () => this.#ct(e, n, a), () => this.#st(n)));
|
|
881
884
|
}
|
|
882
|
-
#
|
|
883
|
-
let a = this.#
|
|
885
|
+
#ot(e, t, n, r, i) {
|
|
886
|
+
let a = this.#ln() * Math.abs(t - e);
|
|
884
887
|
if (a <= 0) {
|
|
885
|
-
this.#
|
|
888
|
+
this.#ue?.setFlipProgress(t, n), r();
|
|
886
889
|
return;
|
|
887
890
|
}
|
|
888
891
|
let o = {
|
|
@@ -890,60 +893,60 @@ var Y = class {
|
|
|
890
893
|
direction: n,
|
|
891
894
|
onDone: r
|
|
892
895
|
};
|
|
893
|
-
this.#
|
|
896
|
+
this.#ye = o;
|
|
894
897
|
let s = performance.now(), c = !1, l = (u) => {
|
|
895
|
-
if (this.#
|
|
898
|
+
if (this.#ye !== o) return;
|
|
896
899
|
let d = Math.min(1, (u - s) / a), f = de(d);
|
|
897
|
-
i && !c && f >= (this.#
|
|
900
|
+
i && !c && f >= (this.#B ? U : H) && (c = !0, i()), d < 1 ? (this.#ue?.setFlipProgress(e + (t - e) * f, n), this.#pe = requestAnimationFrame(l)) : (this.#ue?.setFlipProgress(t, n), this.#pe = null, this.#ye = null, r());
|
|
898
901
|
};
|
|
899
|
-
this.#
|
|
902
|
+
this.#pe = requestAnimationFrame(l);
|
|
900
903
|
}
|
|
901
|
-
#
|
|
902
|
-
this.#
|
|
904
|
+
#st(e) {
|
|
905
|
+
this.#Q !== e && (this.#Q = e, this.#cn(), this.#n.emit("pageChanged", { page: e }));
|
|
903
906
|
}
|
|
904
|
-
#
|
|
905
|
-
let r = this.#
|
|
906
|
-
this.#
|
|
907
|
+
#ct(e, t, n) {
|
|
908
|
+
let r = this.#X[e];
|
|
909
|
+
this.#Z = e, this.#$ = n, r && this.#hn(r, n), this.#On(), this.#i.send("settle"), this.#je = performance.now(), this.#st(t), this.#Tt("turn"), this.#St(), this.#n.emit("flipEnd", { page: t }), this.#$e();
|
|
907
910
|
}
|
|
908
|
-
#
|
|
909
|
-
let t = this.#
|
|
910
|
-
if (!t) return this.#
|
|
911
|
+
#lt(e) {
|
|
912
|
+
let t = this.#X[e];
|
|
913
|
+
if (!t) return this.#Q;
|
|
911
914
|
let n = [t.left, t.right].filter((e) => e !== null);
|
|
912
|
-
return n.length > 0 ? Math.min(...n) : this.#
|
|
915
|
+
return n.length > 0 ? Math.min(...n) : this.#Q;
|
|
913
916
|
}
|
|
914
|
-
#
|
|
915
|
-
if (this.#
|
|
916
|
-
if (this.#
|
|
917
|
+
#ut(e, t) {
|
|
918
|
+
if (this.#Se || !this.#ue) return;
|
|
919
|
+
if (this.#Mt(), this.#zt(), this.#se > 1) {
|
|
917
920
|
if (this.#i.send("panStart") === null) return;
|
|
918
|
-
this.#
|
|
919
|
-
baseTx: this.#
|
|
920
|
-
baseTy: this.#
|
|
921
|
+
this.#xe = {
|
|
922
|
+
baseTx: this.#ce,
|
|
923
|
+
baseTy: this.#le
|
|
921
924
|
};
|
|
922
925
|
return;
|
|
923
926
|
}
|
|
924
|
-
let n = this.#
|
|
925
|
-
this.#
|
|
927
|
+
let n = this.#_t(), r = this.#vt(e, t);
|
|
928
|
+
this.#ge = r;
|
|
926
929
|
let i = Math.min(n.width, n.height) * A, a = r.x >= 0 && r.x <= n.width && r.y >= 0 && r.y <= n.height, o = r.x <= i || r.x >= n.width - i, s = a && o;
|
|
927
930
|
if (this.#i.state !== "idle") {
|
|
928
|
-
if (!this.#
|
|
929
|
-
this.#
|
|
931
|
+
if (!this.#ye || !s) {
|
|
932
|
+
this.#he = null;
|
|
930
933
|
return;
|
|
931
934
|
}
|
|
932
|
-
this.#
|
|
935
|
+
this.#Qe();
|
|
933
936
|
}
|
|
934
937
|
if (!s) return;
|
|
935
938
|
this.#l = X(r.y / n.height, 0, 1);
|
|
936
|
-
let c = r.x > n.width / 2, l = this.#a === "rtl" ? !c : c, u = this.#
|
|
937
|
-
u < 0 || u >= this.#
|
|
939
|
+
let c = r.x > n.width / 2, l = this.#a === "rtl" ? !c : c, u = this.#Z + (l ? 1 : -1);
|
|
940
|
+
u < 0 || u >= this.#X.length || (this.#he = {
|
|
938
941
|
direction: l ? "forward" : "backward",
|
|
939
942
|
targetIndex: u,
|
|
940
|
-
toPage: this.#
|
|
943
|
+
toPage: this.#lt(u),
|
|
941
944
|
width: n.width
|
|
942
945
|
});
|
|
943
946
|
}
|
|
944
|
-
#
|
|
945
|
-
let e = this.#
|
|
946
|
-
e && (this.#
|
|
947
|
+
#dt() {
|
|
948
|
+
let e = this.#he;
|
|
949
|
+
e && (this.#he = null, this.#i.send("grab") !== null && (this.#me = {
|
|
947
950
|
direction: e.direction,
|
|
948
951
|
targetIndex: e.targetIndex,
|
|
949
952
|
toPage: e.toPage,
|
|
@@ -954,76 +957,76 @@ var Y = class {
|
|
|
954
957
|
width: e.width,
|
|
955
958
|
t: 0
|
|
956
959
|
}, this.#n.emit("flipStart", {
|
|
957
|
-
from: this.#
|
|
960
|
+
from: this.#Q,
|
|
958
961
|
to: e.toPage
|
|
959
|
-
}), this.#
|
|
962
|
+
}), this.#ft(e.targetIndex, e.direction)));
|
|
960
963
|
}
|
|
961
|
-
async #
|
|
962
|
-
let n = this.#
|
|
964
|
+
async #ft(e, t) {
|
|
965
|
+
let n = this.#X[e], r = n ? await this.#Tn(n) : {
|
|
963
966
|
left: null,
|
|
964
967
|
right: null
|
|
965
968
|
};
|
|
966
|
-
this.#
|
|
967
|
-
fill: this.#
|
|
969
|
+
this.#me?.targetIndex === e && (this.#me.toContent = r, this.#ue?.beginFlip(this.#$, r, t, {
|
|
970
|
+
fill: this.#B,
|
|
968
971
|
fit: this.#d,
|
|
969
|
-
curl: this.#
|
|
972
|
+
curl: this.#un(),
|
|
970
973
|
anchor: { y: this.#l }
|
|
971
|
-
}), this.#
|
|
972
|
-
}
|
|
973
|
-
#
|
|
974
|
-
if (this.#
|
|
975
|
-
if (this.#
|
|
976
|
-
if (!this.#
|
|
977
|
-
let n = this.#
|
|
978
|
-
this.#
|
|
974
|
+
}), this.#ue?.setFlipProgress(this.#me.t, t));
|
|
975
|
+
}
|
|
976
|
+
#pt(e, t) {
|
|
977
|
+
if (this.#Se) return;
|
|
978
|
+
if (this.#xe) {
|
|
979
|
+
if (!this.#ue) return;
|
|
980
|
+
let n = this.#ue.measure(), [r, i] = this.#rt(this.#xe.baseTx + e, this.#xe.baseTy + t, this.#se, n.containerWidth, n.containerHeight);
|
|
981
|
+
this.#ce = r, this.#le = i, this.#ue.setViewTransform(this.#se, r, i), this.#vn(), this.#Tt("pan"), this.#Ft();
|
|
979
982
|
return;
|
|
980
983
|
}
|
|
981
|
-
this.#
|
|
982
|
-
let n = this.#
|
|
983
|
-
n && (n.t = X((n.direction === "forward" ? -e : e) / n.width, 0, 1), this.#
|
|
984
|
-
}
|
|
985
|
-
#
|
|
986
|
-
if (this.#
|
|
987
|
-
if (this.#
|
|
988
|
-
this.#
|
|
984
|
+
this.#he && Math.hypot(e, t) > M && this.#dt();
|
|
985
|
+
let n = this.#me;
|
|
986
|
+
n && (n.t = X((n.direction === "forward" ? -e : e) / n.width, 0, 1), this.#ue?.setFlipProgress(n.t, n.direction));
|
|
987
|
+
}
|
|
988
|
+
#mt(e) {
|
|
989
|
+
if (this.#Se) return;
|
|
990
|
+
if (this.#xe) {
|
|
991
|
+
this.#xe = null, this.#i.send("panEnd"), this.#St();
|
|
989
992
|
return;
|
|
990
993
|
}
|
|
991
|
-
let t = this.#
|
|
994
|
+
let t = this.#me;
|
|
992
995
|
if (!t) {
|
|
993
|
-
this.#
|
|
996
|
+
this.#he = null, this.#ht(e) || this.#gt(e);
|
|
994
997
|
return;
|
|
995
998
|
}
|
|
996
|
-
this.#
|
|
999
|
+
this.#me = null, this.#i.send("release");
|
|
997
1000
|
let n = e.swipe && Math.abs(e.vx) > Math.abs(e.vy), r = t.direction === "forward" ? e.vx < 0 : e.vx > 0, i = n && r, a = n && !r;
|
|
998
|
-
i || t.t >= .5 && !a ? (this.#
|
|
1001
|
+
i || t.t >= .5 && !a ? (this.#Xt(), this.#ot(t.t, 1, t.direction, () => this.#ct(t.targetIndex, t.toPage, t.toContent), () => this.#st(t.toPage))) : this.#ot(t.t, 0, t.direction, () => this.#Bt());
|
|
999
1002
|
}
|
|
1000
|
-
#
|
|
1001
|
-
if (this.#
|
|
1003
|
+
#ht(e) {
|
|
1004
|
+
if (this.#se > 1 || !e.swipe || Math.abs(e.dx) <= Math.abs(e.dy)) return !1;
|
|
1002
1005
|
let t = this.#a === "rtl" ? e.dx > 0 : e.dx < 0, n = t ? "forward" : "backward";
|
|
1003
|
-
if (!this.#
|
|
1006
|
+
if (!this.#bt(n)) return this.#jt(n), !1;
|
|
1004
1007
|
let r = t ? 1 : -1;
|
|
1005
|
-
return this.#
|
|
1008
|
+
return this.#Ze(() => this.#it(this.#Z + r)), !0;
|
|
1006
1009
|
}
|
|
1007
|
-
#
|
|
1008
|
-
if (this.#u === "off" || this.#
|
|
1009
|
-
let t = this.#
|
|
1010
|
+
#gt(e) {
|
|
1011
|
+
if (this.#u === "off" || this.#se > 1 || !this.#ge || Math.abs(e.dx) > M || Math.abs(e.dy) > M) return;
|
|
1012
|
+
let t = this.#yt(this.#ge);
|
|
1010
1013
|
if (!t) return;
|
|
1011
|
-
if (!this.#
|
|
1012
|
-
this.#
|
|
1014
|
+
if (!this.#bt(t)) {
|
|
1015
|
+
this.#jt(t);
|
|
1013
1016
|
return;
|
|
1014
1017
|
}
|
|
1015
|
-
this.#l = X(this.#
|
|
1016
|
-
let n = t === "forward" ? 1 : -1, r = () => this.#
|
|
1017
|
-
if (this.#
|
|
1018
|
-
this.#
|
|
1018
|
+
this.#l = X(this.#ge.y / this.#_t().height, 0, 1);
|
|
1019
|
+
let n = t === "forward" ? 1 : -1, r = () => this.#it(this.#Z + n);
|
|
1020
|
+
if (this.#zt(), this.#R <= 0) {
|
|
1021
|
+
this.#Ze(r);
|
|
1019
1022
|
return;
|
|
1020
1023
|
}
|
|
1021
|
-
this.#
|
|
1022
|
-
this.#
|
|
1023
|
-
}, this.#
|
|
1024
|
+
this.#_e = setTimeout(() => {
|
|
1025
|
+
this.#_e = null, this.#Ze(r);
|
|
1026
|
+
}, this.#R);
|
|
1024
1027
|
}
|
|
1025
|
-
#
|
|
1026
|
-
let e = this.#
|
|
1028
|
+
#_t() {
|
|
1029
|
+
let e = this.#ue.measure();
|
|
1027
1030
|
return e.content ?? e.book ?? {
|
|
1028
1031
|
x: 0,
|
|
1029
1032
|
y: 0,
|
|
@@ -1031,365 +1034,365 @@ var Y = class {
|
|
|
1031
1034
|
height: e.containerHeight
|
|
1032
1035
|
};
|
|
1033
1036
|
}
|
|
1034
|
-
#
|
|
1035
|
-
let n = this.#e.getBoundingClientRect(), r = this.#
|
|
1037
|
+
#vt(e, t) {
|
|
1038
|
+
let n = this.#e.getBoundingClientRect(), r = this.#_t();
|
|
1036
1039
|
return {
|
|
1037
1040
|
x: e - n.left - r.x,
|
|
1038
1041
|
y: t - n.top - r.y
|
|
1039
1042
|
};
|
|
1040
1043
|
}
|
|
1041
|
-
#
|
|
1042
|
-
if (!this.#
|
|
1043
|
-
let t = this.#
|
|
1044
|
-
if (n = this.#u === "half" ? e.x > t / 2 ? "right" : "left" : e.x <= this.#
|
|
1044
|
+
#yt(e) {
|
|
1045
|
+
if (!this.#ue) return null;
|
|
1046
|
+
let t = this.#_t().width, n;
|
|
1047
|
+
if (n = this.#u === "half" ? e.x > t / 2 ? "right" : "left" : e.x <= this.#g ? "left" : e.x >= t - this.#g ? "right" : null, !n) return null;
|
|
1045
1048
|
let r = this.#a === "rtl" ? "left" : "right";
|
|
1046
1049
|
return n === r ? "forward" : "backward";
|
|
1047
1050
|
}
|
|
1048
|
-
#
|
|
1049
|
-
let t = this.#
|
|
1050
|
-
return t >= 0 && t < this.#
|
|
1051
|
+
#bt(e) {
|
|
1052
|
+
let t = this.#Z + (e === "forward" ? 1 : -1);
|
|
1053
|
+
return t >= 0 && t < this.#X.length;
|
|
1051
1054
|
}
|
|
1052
|
-
#
|
|
1055
|
+
#xt() {
|
|
1053
1056
|
let e = (e) => {
|
|
1054
1057
|
let t = e;
|
|
1055
|
-
this.#
|
|
1058
|
+
this.#v = {
|
|
1056
1059
|
x: t.clientX,
|
|
1057
1060
|
y: t.clientY
|
|
1058
|
-
}, this.#
|
|
1061
|
+
}, this.#St();
|
|
1059
1062
|
}, t = () => {
|
|
1060
|
-
this.#
|
|
1063
|
+
this.#v = null, this.#St();
|
|
1061
1064
|
};
|
|
1062
|
-
this.#e.addEventListener("pointermove", e), this.#e.addEventListener("pointerleave", t), this.#
|
|
1065
|
+
this.#e.addEventListener("pointermove", e), this.#e.addEventListener("pointerleave", t), this.#y = () => {
|
|
1063
1066
|
this.#e.removeEventListener("pointermove", e), this.#e.removeEventListener("pointerleave", t);
|
|
1064
1067
|
};
|
|
1065
1068
|
}
|
|
1066
|
-
#
|
|
1067
|
-
if (!this.#
|
|
1069
|
+
#St() {
|
|
1070
|
+
if (!this.#_ || !this.#ue) return;
|
|
1068
1071
|
let e = "";
|
|
1069
|
-
this.#
|
|
1072
|
+
this.#me || this.#xe ? e = "grabbing" : this.#v && (e = this.#Ct(this.#v.x, this.#v.y)), this.#e.style.cursor = e;
|
|
1070
1073
|
}
|
|
1071
|
-
#
|
|
1072
|
-
if (!this.#
|
|
1073
|
-
let n = this.#
|
|
1074
|
+
#Ct(e, t) {
|
|
1075
|
+
if (!this.#ue) return "";
|
|
1076
|
+
let n = this.#_t(), r = this.#vt(e, t);
|
|
1074
1077
|
if (r.x < 0 || r.y < 0 || r.x > n.width || r.y > n.height) return "";
|
|
1075
|
-
if (this.#
|
|
1076
|
-
let i = this.#
|
|
1077
|
-
return i && this.#
|
|
1078
|
+
if (this.#se > 1) return "grab";
|
|
1079
|
+
let i = this.#yt(r);
|
|
1080
|
+
return i && this.#bt(i) ? "pointer" : this.#te && this.#re !== null ? "zoom-in" : "";
|
|
1078
1081
|
}
|
|
1079
|
-
#
|
|
1082
|
+
#wt() {
|
|
1080
1083
|
try {
|
|
1081
1084
|
let e = localStorage.getItem(q);
|
|
1082
1085
|
if (!e) return;
|
|
1083
1086
|
let t = JSON.parse(e);
|
|
1084
|
-
this.#
|
|
1087
|
+
this.#O = {
|
|
1085
1088
|
turn: t.turn === !0,
|
|
1086
1089
|
zoom: t.zoom === !0,
|
|
1087
1090
|
pan: t.pan === !0
|
|
1088
1091
|
};
|
|
1089
1092
|
} catch {}
|
|
1090
1093
|
}
|
|
1091
|
-
#
|
|
1092
|
-
if (!this.#
|
|
1093
|
-
localStorage.setItem(q, JSON.stringify(this.#
|
|
1094
|
+
#Tt(e) {
|
|
1095
|
+
if (!this.#O[e] && (this.#O[e] = !0, e === "turn" && this.#Dt(), e === "zoom" && this.#Rt(), this.#x)) try {
|
|
1096
|
+
localStorage.setItem(q, JSON.stringify(this.#O));
|
|
1094
1097
|
} catch {}
|
|
1095
1098
|
}
|
|
1096
|
-
#
|
|
1097
|
-
!this.#
|
|
1098
|
-
this.#
|
|
1099
|
+
#Et() {
|
|
1100
|
+
!this.#b || this.#we || this.#O.turn || (this.#Dt(), this.#k = setTimeout(() => {
|
|
1101
|
+
this.#k = null, this.#Ot();
|
|
1099
1102
|
}, ce));
|
|
1100
1103
|
}
|
|
1101
|
-
#
|
|
1102
|
-
this.#
|
|
1104
|
+
#Dt() {
|
|
1105
|
+
this.#k !== null && (clearTimeout(this.#k), this.#k = null);
|
|
1103
1106
|
}
|
|
1104
|
-
async #
|
|
1105
|
-
if (!this.#
|
|
1106
|
-
let e = this.#
|
|
1107
|
+
async #Ot() {
|
|
1108
|
+
if (!this.#b || this.#we || this.#O.turn || !this.#ue || typeof requestAnimationFrame != "function" || this.#i.state !== "idle") return;
|
|
1109
|
+
let e = this.#Z + 1, t = this.#X[e];
|
|
1107
1110
|
if (!t) return;
|
|
1108
|
-
let n = await this.#
|
|
1109
|
-
if (this.#
|
|
1110
|
-
this.#l = 1, this.#
|
|
1111
|
-
fill: this.#
|
|
1111
|
+
let n = await this.#Tn(t);
|
|
1112
|
+
if (this.#fe || this.#O.turn || this.#i.state !== "idle" || this.#A) return;
|
|
1113
|
+
this.#l = 1, this.#ue.beginFlip(this.#$, n, "forward", {
|
|
1114
|
+
fill: this.#B,
|
|
1112
1115
|
fit: this.#d,
|
|
1113
|
-
curl: this.#
|
|
1116
|
+
curl: this.#un(),
|
|
1114
1117
|
anchor: { y: this.#l }
|
|
1115
1118
|
});
|
|
1116
1119
|
let r = {};
|
|
1117
|
-
this.#
|
|
1120
|
+
this.#A = r;
|
|
1118
1121
|
let i = performance.now(), a = G * 2, o = () => {
|
|
1119
|
-
if (this.#
|
|
1122
|
+
if (this.#A !== r) return;
|
|
1120
1123
|
let e = Math.min(1, (performance.now() - i) / a), t = W * Math.sin(e * Math.PI);
|
|
1121
|
-
this.#
|
|
1124
|
+
this.#ue?.setFlipProgress(Math.max(0, t), "forward"), e < 1 ? this.#pe = requestAnimationFrame(o) : (this.#pe = null, this.#A = null, this.#At());
|
|
1122
1125
|
};
|
|
1123
|
-
this.#
|
|
1126
|
+
this.#pe = requestAnimationFrame(o);
|
|
1124
1127
|
}
|
|
1125
|
-
#
|
|
1126
|
-
this.#
|
|
1128
|
+
#kt() {
|
|
1129
|
+
this.#A && (this.#A = null, this.#pe !== null && (cancelAnimationFrame(this.#pe), this.#pe = null), this.#At());
|
|
1127
1130
|
}
|
|
1128
|
-
#
|
|
1129
|
-
let e = this.#
|
|
1130
|
-
e && this.#i.state === "idle" && this.#
|
|
1131
|
+
#At() {
|
|
1132
|
+
let e = this.#X[this.#Z];
|
|
1133
|
+
e && this.#i.state === "idle" && this.#hn(e, this.#$);
|
|
1131
1134
|
}
|
|
1132
|
-
#
|
|
1133
|
-
if (!this.#
|
|
1135
|
+
#jt(e) {
|
|
1136
|
+
if (!this.#ue || typeof requestAnimationFrame != "function" || this.#we || this.#i.state !== "idle" || this.#se > 1 || this.#j) return;
|
|
1134
1137
|
let t = e === "forward", n = (this.#a === "rtl" ? !t : t) ? -1 : 1, r = {};
|
|
1135
|
-
this.#
|
|
1138
|
+
this.#j = r;
|
|
1136
1139
|
let i = performance.now(), a = () => {
|
|
1137
|
-
if (this.#
|
|
1140
|
+
if (this.#j !== r) return;
|
|
1138
1141
|
let e = Math.min(1, (performance.now() - i) / K), t = se * Math.sin(e * Math.PI);
|
|
1139
|
-
this.#
|
|
1142
|
+
this.#ue?.setViewTransform(1, n * t, 0), e < 1 ? this.#pe = requestAnimationFrame(a) : (this.#pe = null, this.#j = null, this.#ue?.setViewTransform(1, 0, 0));
|
|
1140
1143
|
};
|
|
1141
|
-
this.#
|
|
1144
|
+
this.#pe = requestAnimationFrame(a);
|
|
1142
1145
|
}
|
|
1143
|
-
#
|
|
1144
|
-
this.#
|
|
1146
|
+
#Mt() {
|
|
1147
|
+
this.#j && (this.#j = null, this.#pe !== null && (cancelAnimationFrame(this.#pe), this.#pe = null), this.#ue?.setViewTransform(1, 0, 0));
|
|
1145
1148
|
}
|
|
1146
|
-
#
|
|
1147
|
-
this.#
|
|
1149
|
+
#Nt() {
|
|
1150
|
+
this.#O.pan || this.#Pt(this.#h.panHint);
|
|
1148
1151
|
}
|
|
1149
|
-
#
|
|
1150
|
-
if (!this.#
|
|
1152
|
+
#Pt(e) {
|
|
1153
|
+
if (!this.#b) return;
|
|
1151
1154
|
let t = this.#e.ownerDocument;
|
|
1152
1155
|
if (!t || typeof this.#e.appendChild != "function") return;
|
|
1153
|
-
this.#
|
|
1156
|
+
this.#Ft();
|
|
1154
1157
|
let n = t.createElement("div");
|
|
1155
1158
|
n.className = "zine-hint-caption", n.setAttribute("aria-hidden", "true"), n.textContent = e, n.style.cssText = "position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:3;pointer-events:none;padding:6px 12px;border-radius:999px;font:500 13px/1.2 system-ui,sans-serif;color:#fff;background:rgba(24,24,27,0.82);box-shadow:0 1px 4px rgba(0,0,0,0.35);white-space:nowrap;opacity:0;";
|
|
1156
|
-
let r = !this.#
|
|
1157
|
-
r && (n.style.transition = "opacity 200ms ease"), this.#e.appendChild(n), this.#
|
|
1158
|
-
this.#
|
|
1159
|
-
}) : n.style.opacity = "1", this.#
|
|
1159
|
+
let r = !this.#we && typeof requestAnimationFrame == "function";
|
|
1160
|
+
r && (n.style.transition = "opacity 200ms ease"), this.#e.appendChild(n), this.#M = n, r ? requestAnimationFrame(() => {
|
|
1161
|
+
this.#M === n && (n.style.opacity = "1");
|
|
1162
|
+
}) : n.style.opacity = "1", this.#N = setTimeout(() => this.#Ft(), le);
|
|
1160
1163
|
}
|
|
1161
|
-
#
|
|
1162
|
-
this.#
|
|
1164
|
+
#Ft() {
|
|
1165
|
+
this.#N !== null && (clearTimeout(this.#N), this.#N = null), this.#M?.remove(), this.#M = null;
|
|
1163
1166
|
}
|
|
1164
|
-
#
|
|
1165
|
-
!this.#
|
|
1166
|
-
this.#
|
|
1167
|
+
#It(e, t) {
|
|
1168
|
+
!this.#b || this.#O.zoom || this.#F || this.#I === "mouse" && this.#Ct(e, t) === "zoom-in" && (this.#i.state === "animating" || performance.now() - this.#je <= F || (this.#Rt(), this.#P = setTimeout(() => {
|
|
1169
|
+
this.#P = null, !(this.#O.zoom || this.#F) && (this.#F = !0, this.#Pt(this.#Lt()));
|
|
1167
1170
|
}, N)));
|
|
1168
1171
|
}
|
|
1169
|
-
#
|
|
1172
|
+
#Lt() {
|
|
1170
1173
|
let e = this.#e.ownerDocument?.defaultView?.navigator, t = /Mac|iPhone|iPad/.test(e?.platform ?? "");
|
|
1171
|
-
return this.#
|
|
1172
|
-
doubleClick: this.#
|
|
1173
|
-
wheel: this
|
|
1174
|
+
return this.#h.zoomHint({
|
|
1175
|
+
doubleClick: this.#re !== null,
|
|
1176
|
+
wheel: this.#ne,
|
|
1174
1177
|
mac: t
|
|
1175
1178
|
});
|
|
1176
1179
|
}
|
|
1177
|
-
#
|
|
1178
|
-
this.#
|
|
1180
|
+
#Rt() {
|
|
1181
|
+
this.#P !== null && (clearTimeout(this.#P), this.#P = null);
|
|
1179
1182
|
}
|
|
1180
|
-
#
|
|
1181
|
-
this.#
|
|
1183
|
+
#zt() {
|
|
1184
|
+
this.#_e !== null && (clearTimeout(this.#_e), this.#_e = null);
|
|
1182
1185
|
}
|
|
1183
|
-
#
|
|
1184
|
-
let e = this.#
|
|
1185
|
-
e && this.#
|
|
1186
|
+
#Bt() {
|
|
1187
|
+
let e = this.#X[this.#Z];
|
|
1188
|
+
e && this.#hn(e, this.#$), this.#i.send("settle"), this.#St(), this.#n.emit("flipEnd", { page: this.#Q }), this.#$e();
|
|
1186
1189
|
}
|
|
1187
|
-
#
|
|
1188
|
-
if (this.#
|
|
1189
|
-
this.#
|
|
1190
|
-
let e = this.#
|
|
1191
|
-
e && this.#
|
|
1192
|
-
} else this.#
|
|
1193
|
-
this.#
|
|
1194
|
-
}
|
|
1195
|
-
#
|
|
1196
|
-
if (!this.#
|
|
1190
|
+
#Vt() {
|
|
1191
|
+
if (this.#he = null, this.#zt(), this.#me) {
|
|
1192
|
+
this.#me = null, this.#i.send("release"), this.#i.send("settle");
|
|
1193
|
+
let e = this.#X[this.#Z];
|
|
1194
|
+
e && this.#hn(e, this.#$);
|
|
1195
|
+
} else this.#xe && (this.#xe = null, this.#i.send("panEnd"));
|
|
1196
|
+
this.#Se = !0, this.#Ce = this.#se;
|
|
1197
|
+
}
|
|
1198
|
+
#Ht(e, t, n) {
|
|
1199
|
+
if (!this.#Se) return;
|
|
1197
1200
|
let r = this.#e.getBoundingClientRect();
|
|
1198
|
-
this.setZoom(this.#
|
|
1201
|
+
this.setZoom(this.#Ce * n, {
|
|
1199
1202
|
x: e - r.left,
|
|
1200
1203
|
y: t - r.top
|
|
1201
1204
|
});
|
|
1202
1205
|
}
|
|
1203
|
-
#
|
|
1204
|
-
this.#
|
|
1206
|
+
#Ut() {
|
|
1207
|
+
this.#Se = !1;
|
|
1205
1208
|
}
|
|
1206
|
-
#
|
|
1207
|
-
if (!this.#
|
|
1209
|
+
#Wt() {
|
|
1210
|
+
if (!this.#q) return;
|
|
1208
1211
|
let e = (e) => e.preventDefault();
|
|
1209
|
-
this.#e.addEventListener("contextmenu", e), this.#
|
|
1212
|
+
this.#e.addEventListener("contextmenu", e), this.#Oe = () => this.#e.removeEventListener("contextmenu", e);
|
|
1210
1213
|
}
|
|
1211
|
-
#
|
|
1214
|
+
#Gt() {
|
|
1212
1215
|
let e = (e) => {
|
|
1213
|
-
if (!this
|
|
1216
|
+
if (!this.#ne || !this.#te || !(e.ctrlKey || e.metaKey)) return;
|
|
1214
1217
|
e.preventDefault();
|
|
1215
1218
|
let t = this.#e.getBoundingClientRect(), n = Math.exp(-e.deltaY * j);
|
|
1216
|
-
this.setZoom(this.#
|
|
1219
|
+
this.setZoom(this.#se * n, {
|
|
1217
1220
|
x: e.clientX - t.left,
|
|
1218
1221
|
y: e.clientY - t.top
|
|
1219
1222
|
});
|
|
1220
1223
|
};
|
|
1221
|
-
this.#e.addEventListener("wheel", e, { passive: !1 }), this.#
|
|
1224
|
+
this.#e.addEventListener("wheel", e, { passive: !1 }), this.#De = () => this.#e.removeEventListener("wheel", e);
|
|
1222
1225
|
}
|
|
1223
|
-
#
|
|
1226
|
+
#Kt() {
|
|
1224
1227
|
let e = (e) => {
|
|
1225
|
-
this.#
|
|
1228
|
+
this.#I = e.pointerType;
|
|
1226
1229
|
}, t = (e) => {
|
|
1227
|
-
let t = this.#
|
|
1228
|
-
if (!this.#
|
|
1229
|
-
let n = performance.now(), r = this.#
|
|
1230
|
+
let t = this.#re;
|
|
1231
|
+
if (!this.#te || t === null || !this.#ue) return;
|
|
1232
|
+
let n = performance.now(), r = this.#Ae;
|
|
1230
1233
|
if (!(r !== null && n - r.t <= N && Math.hypot(e.clientX - r.x, e.clientY - r.y) <= P)) {
|
|
1231
|
-
this.#
|
|
1234
|
+
this.#Ae = {
|
|
1232
1235
|
t: n,
|
|
1233
1236
|
x: e.clientX,
|
|
1234
1237
|
y: e.clientY
|
|
1235
|
-
}, this.#
|
|
1238
|
+
}, this.#It(e.clientX, e.clientY);
|
|
1236
1239
|
return;
|
|
1237
1240
|
}
|
|
1238
|
-
this.#
|
|
1241
|
+
this.#Ae = null, this.#Rt(), this.#qt(e.clientX, e.clientY, t);
|
|
1239
1242
|
};
|
|
1240
|
-
this.#e.addEventListener("pointerdown", e), this.#e.addEventListener("click", t), this.#
|
|
1243
|
+
this.#e.addEventListener("pointerdown", e), this.#e.addEventListener("click", t), this.#ke = () => {
|
|
1241
1244
|
this.#e.removeEventListener("pointerdown", e), this.#e.removeEventListener("click", t);
|
|
1242
1245
|
};
|
|
1243
1246
|
}
|
|
1244
|
-
#
|
|
1245
|
-
if (this.#
|
|
1246
|
-
let n = this.#
|
|
1247
|
-
if (r !== null && this.#
|
|
1247
|
+
#qt(e, t, n) {
|
|
1248
|
+
if (this.#se <= 1 && this.#u !== "off" && !this.#L) {
|
|
1249
|
+
let n = this.#vt(e, t), r = this.#yt(n);
|
|
1250
|
+
if (r !== null && this.#bt(r) || this.#i.state === "animating" || performance.now() - this.#je <= F) return;
|
|
1248
1251
|
}
|
|
1249
|
-
this.#
|
|
1250
|
-
let r = n.find((e) => e > this.#
|
|
1252
|
+
this.#zt();
|
|
1253
|
+
let r = n.find((e) => e > this.#se + 1e-6) ?? n[0] ?? this.#se, i = this.#e.getBoundingClientRect();
|
|
1251
1254
|
this.setZoom(r, {
|
|
1252
1255
|
x: e - i.left,
|
|
1253
1256
|
y: t - i.top
|
|
1254
1257
|
});
|
|
1255
1258
|
}
|
|
1256
|
-
async #
|
|
1259
|
+
async #Jt(e) {
|
|
1257
1260
|
let t = O(e);
|
|
1258
|
-
if (this.#t.onProgress?.((e) => this.#
|
|
1259
|
-
this.#
|
|
1261
|
+
if (this.#t.onProgress?.((e) => this.#Zt(e)), typeof this.#t.open == "function") {
|
|
1262
|
+
this.#Qt();
|
|
1260
1263
|
try {
|
|
1261
|
-
await this.#t.open(), this.#
|
|
1264
|
+
await this.#t.open(), this.#An();
|
|
1262
1265
|
} catch (e) {
|
|
1263
|
-
throw this.#
|
|
1266
|
+
throw this.#en(), e;
|
|
1264
1267
|
}
|
|
1265
|
-
this
|
|
1268
|
+
this.#$t("preparing");
|
|
1266
1269
|
}
|
|
1267
|
-
this.#t.prefetch([this.#
|
|
1268
|
-
let n = await t, r = await this.#
|
|
1269
|
-
this.#
|
|
1270
|
+
this.#t.prefetch([this.#Q]);
|
|
1271
|
+
let n = await t, r = await this.#tn(n);
|
|
1272
|
+
this.#ue = r, this.#t.onPageUpdate?.((e) => this.#_n(e)), this.#fn(r.measure().containerWidth);
|
|
1270
1273
|
let i = new m({
|
|
1271
|
-
onStart: (e) => this.#
|
|
1272
|
-
onMove: (e) => this.#
|
|
1273
|
-
onEnd: (e) => this.#
|
|
1274
|
+
onStart: (e) => this.#ut(e.x, e.y),
|
|
1275
|
+
onMove: (e) => this.#pt(e.dx, e.dy),
|
|
1276
|
+
onEnd: (e) => this.#mt(e)
|
|
1274
1277
|
}), a = new _({
|
|
1275
|
-
onPinchStart: () => this.#
|
|
1276
|
-
onPinchMove: (e) => this.#
|
|
1277
|
-
onPinchEnd: () => this.#
|
|
1278
|
+
onPinchStart: () => this.#Vt(),
|
|
1279
|
+
onPinchMove: (e) => this.#Ht(e.centerX, e.centerY, e.scale),
|
|
1280
|
+
onPinchEnd: () => this.#Ut()
|
|
1278
1281
|
});
|
|
1279
|
-
this.#
|
|
1282
|
+
this.#Ee = h(this.#e, {
|
|
1280
1283
|
pointer: i,
|
|
1281
1284
|
pinch: a
|
|
1282
|
-
}), this
|
|
1285
|
+
}), this.#nt(), this.#Gt(), this.#Kt(), this.#Wt(), this.#xt(), this.#rn(), this.#Me = this.#on(), await this.#mn(), this.#en(), this.#Cn(), this.#On(), this.#cn(), this.#an(), await this.#in(), this.#Yt(), this.#n.emit("ready"), this.#Ot(), this.#Et();
|
|
1283
1286
|
}
|
|
1284
|
-
async #
|
|
1285
|
-
if (!(!this.#
|
|
1286
|
-
this.#
|
|
1287
|
+
async #Yt() {
|
|
1288
|
+
if (!(!this.#S || this.#T || this.#D || this.#fe)) {
|
|
1289
|
+
this.#D = !0;
|
|
1287
1290
|
try {
|
|
1288
1291
|
let { FlipSound: e } = await import("./flipSound-BFXSkWBo.js");
|
|
1289
|
-
if (this.#
|
|
1290
|
-
this.#
|
|
1292
|
+
if (this.#fe) return;
|
|
1293
|
+
this.#w = new e(this.#C), this.#w.setMuted(this.#T);
|
|
1291
1294
|
} catch {}
|
|
1292
1295
|
}
|
|
1293
1296
|
}
|
|
1294
|
-
#
|
|
1295
|
-
this.#
|
|
1297
|
+
#Xt() {
|
|
1298
|
+
this.#w?.play();
|
|
1296
1299
|
}
|
|
1297
|
-
#
|
|
1298
|
-
this.#
|
|
1300
|
+
#Zt(e) {
|
|
1301
|
+
this.#He = e, this.#n.emit("progress", e), this.#Ve?.update(e);
|
|
1299
1302
|
}
|
|
1300
|
-
async #
|
|
1301
|
-
if (this.#
|
|
1303
|
+
async #Qt() {
|
|
1304
|
+
if (this.#Be === !1 || this.#fe) return;
|
|
1302
1305
|
let e = this.#e;
|
|
1303
1306
|
if (!(!e.ownerDocument || typeof e.appendChild != "function")) try {
|
|
1304
1307
|
let { mountLoading: t } = await import("./loading-BgbqJz5k.js");
|
|
1305
|
-
if (this.#
|
|
1306
|
-
this.#
|
|
1308
|
+
if (this.#Ue === "done" || this.#fe) return;
|
|
1309
|
+
this.#Ve = t(e, this.#h), this.#He && this.#Ve.update(this.#He), this.#Ue === "preparing" && this.#Ve.preparing();
|
|
1307
1310
|
} catch {}
|
|
1308
1311
|
}
|
|
1309
|
-
|
|
1310
|
-
this.#
|
|
1312
|
+
#$t(e) {
|
|
1313
|
+
this.#Ue !== "done" && (this.#Ue = e, this.#Ve?.preparing());
|
|
1311
1314
|
}
|
|
1312
|
-
#
|
|
1313
|
-
this.#
|
|
1315
|
+
#en() {
|
|
1316
|
+
this.#Ue = "done", this.#Ve?.destroy(), this.#Ve = null;
|
|
1314
1317
|
}
|
|
1315
|
-
async #
|
|
1318
|
+
async #tn(e) {
|
|
1316
1319
|
try {
|
|
1317
1320
|
return await e.mount(this.#e), e.onFatal?.(() => {
|
|
1318
|
-
this
|
|
1321
|
+
this.#nn();
|
|
1319
1322
|
}), e;
|
|
1320
1323
|
} catch {
|
|
1321
1324
|
e.destroy();
|
|
1322
1325
|
let t = await O("css");
|
|
1323
|
-
return await t.mount(this.#e), this.#
|
|
1326
|
+
return await t.mount(this.#e), this.#de = !0, this.#n.emit("rendererFallback", {
|
|
1324
1327
|
from: "webgl2",
|
|
1325
1328
|
to: "css"
|
|
1326
1329
|
}), t;
|
|
1327
1330
|
}
|
|
1328
1331
|
}
|
|
1329
|
-
async
|
|
1330
|
-
if (this.#
|
|
1331
|
-
this.#
|
|
1332
|
+
async #nn() {
|
|
1333
|
+
if (this.#de || this.#fe) return;
|
|
1334
|
+
this.#de = !0, this.#ue?.destroy(), this.#ue = null;
|
|
1332
1335
|
let e = await O("css");
|
|
1333
|
-
if (this.#
|
|
1336
|
+
if (this.#fe) {
|
|
1334
1337
|
e.destroy();
|
|
1335
1338
|
return;
|
|
1336
1339
|
}
|
|
1337
|
-
await e.mount(this.#e), this.#
|
|
1340
|
+
await e.mount(this.#e), this.#ue = e, this.#fn(e.measure().containerWidth), await this.#mn(), this.#n.emit("rendererFallback", {
|
|
1338
1341
|
from: "webgl2",
|
|
1339
1342
|
to: "css"
|
|
1340
1343
|
});
|
|
1341
1344
|
}
|
|
1342
|
-
#
|
|
1345
|
+
#rn() {
|
|
1343
1346
|
if (typeof matchMedia != "function") return;
|
|
1344
1347
|
let e = matchMedia("(prefers-reduced-motion: reduce)");
|
|
1345
|
-
this.#
|
|
1346
|
-
this.#
|
|
1348
|
+
this.#we = e.matches, e.addEventListener?.("change", (e) => {
|
|
1349
|
+
this.#we = e.matches;
|
|
1347
1350
|
});
|
|
1348
1351
|
}
|
|
1349
|
-
async #
|
|
1350
|
-
let e = this.#
|
|
1351
|
-
if (!e && !t || this.#
|
|
1352
|
+
async #in() {
|
|
1353
|
+
let e = this.#Fe !== !1, t = this.#Le !== !1;
|
|
1354
|
+
if (!e && !t || this.#fe) return;
|
|
1352
1355
|
let n = this.#e;
|
|
1353
1356
|
if (!(!n.ownerDocument || typeof n.appendChild != "function")) try {
|
|
1354
1357
|
let { mountControls: e, mountContextMenu: t } = await import("./controls-Dh1okIx6.js");
|
|
1355
|
-
if (this.#
|
|
1356
|
-
if (this.#
|
|
1357
|
-
let t = this.#
|
|
1358
|
-
this.#
|
|
1358
|
+
if (this.#fe) return;
|
|
1359
|
+
if (this.#Fe !== !1) {
|
|
1360
|
+
let t = this.#Fe === !0 ? {} : this.#Fe;
|
|
1361
|
+
this.#Ie = e(this, n, t, this.#ze);
|
|
1359
1362
|
}
|
|
1360
|
-
if (this.#
|
|
1361
|
-
let e = this.#
|
|
1362
|
-
this.#
|
|
1363
|
+
if (this.#Le !== !1) {
|
|
1364
|
+
let e = this.#Le === !0 ? {} : this.#Le;
|
|
1365
|
+
this.#Re = t(this, n, e, this.#ze);
|
|
1363
1366
|
}
|
|
1364
1367
|
} catch {}
|
|
1365
1368
|
}
|
|
1366
|
-
#
|
|
1367
|
-
if (!this.#
|
|
1369
|
+
#an() {
|
|
1370
|
+
if (!this.#K || globalThis.location === void 0) return;
|
|
1368
1371
|
let e = globalThis;
|
|
1369
|
-
this.#
|
|
1370
|
-
e !== this.#
|
|
1371
|
-
}), this.#
|
|
1372
|
-
this.#
|
|
1372
|
+
this.#J = ee(e, (e) => {
|
|
1373
|
+
e !== this.#Q && this.flipTo(e);
|
|
1374
|
+
}), this.#J.push(this.#Q), this.#Y = this.#n.on("pageChanged", ({ page: e }) => {
|
|
1375
|
+
this.#J?.push(e);
|
|
1373
1376
|
});
|
|
1374
1377
|
}
|
|
1375
|
-
pageLink(e = this.#
|
|
1378
|
+
pageLink(e = this.#Q) {
|
|
1376
1379
|
let t = globalThis.location?.href ?? "";
|
|
1377
1380
|
if (!t) return "";
|
|
1378
1381
|
let n = new URL(t);
|
|
1379
1382
|
return n.hash = C(n.hash, X(e, 0, Math.max(0, this.#t.pageCount - 1))), n.toString();
|
|
1380
1383
|
}
|
|
1381
|
-
#
|
|
1384
|
+
#on() {
|
|
1382
1385
|
let e = this.#e, t = e.ownerDocument;
|
|
1383
1386
|
if (!t || typeof e.setAttribute != "function") return null;
|
|
1384
|
-
e.hasAttribute("tabindex") || (e.tabIndex = 0), e.setAttribute("aria-roledescription", this.#
|
|
1385
|
-
let n = (e) => this.#
|
|
1387
|
+
e.hasAttribute("tabindex") || (e.tabIndex = 0), e.setAttribute("aria-roledescription", this.#h.roledescription);
|
|
1388
|
+
let n = (e) => this.#sn(e);
|
|
1386
1389
|
e.addEventListener("keydown", n);
|
|
1387
1390
|
let r = t.createElement("div");
|
|
1388
|
-
return r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.cssText = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;", e.appendChild(r), this.#
|
|
1389
|
-
e.removeEventListener("keydown", n), r.remove(), this.#
|
|
1391
|
+
return r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.cssText = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;", e.appendChild(r), this.#Te = r, () => {
|
|
1392
|
+
e.removeEventListener("keydown", n), r.remove(), this.#Te = null;
|
|
1390
1393
|
};
|
|
1391
1394
|
}
|
|
1392
|
-
#
|
|
1395
|
+
#sn(e) {
|
|
1393
1396
|
let t = this.#a === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
1394
1397
|
switch (e.key) {
|
|
1395
1398
|
case "ArrowRight":
|
|
@@ -1405,104 +1408,104 @@ var Y = class {
|
|
|
1405
1408
|
default: break;
|
|
1406
1409
|
}
|
|
1407
1410
|
}
|
|
1408
|
-
#
|
|
1409
|
-
this.#
|
|
1411
|
+
#cn() {
|
|
1412
|
+
this.#Te && (this.#Te.textContent = this.#h.pageAnnounce(this.#Q + 1, this.#t.pageCount));
|
|
1410
1413
|
}
|
|
1411
|
-
#
|
|
1412
|
-
return this.#
|
|
1414
|
+
#ln() {
|
|
1415
|
+
return this.#we ? V : this.#ee * (this.#B ? I : 1);
|
|
1413
1416
|
}
|
|
1414
|
-
#
|
|
1415
|
-
return this.#
|
|
1417
|
+
#un() {
|
|
1418
|
+
return this.#we ? "simple" : this.#c;
|
|
1416
1419
|
}
|
|
1417
1420
|
update() {
|
|
1418
|
-
!this.#
|
|
1421
|
+
!this.#ue || this.#i.state !== "idle" || (this.#fn(this.#ue.measure().containerWidth), this.#mn(), this.#St());
|
|
1419
1422
|
}
|
|
1420
|
-
#
|
|
1421
|
-
return this.#
|
|
1423
|
+
#dn() {
|
|
1424
|
+
return this.#H || this.#o === "single" ? "single" : this.#o;
|
|
1422
1425
|
}
|
|
1423
|
-
#
|
|
1424
|
-
let t = this.#
|
|
1425
|
-
t !== this.#
|
|
1426
|
+
#fn(e) {
|
|
1427
|
+
let t = this.#U && o(e, this.#z);
|
|
1428
|
+
t !== this.#H && (this.#H = t, this.#pn());
|
|
1426
1429
|
}
|
|
1427
|
-
#
|
|
1428
|
-
let e = this.#
|
|
1429
|
-
this.#
|
|
1430
|
+
#pn() {
|
|
1431
|
+
let e = this.#dn(), t = e !== this.#V;
|
|
1432
|
+
this.#V = e, this.#B = e === "single", this.#X = a(this.#t.pageCount, {
|
|
1430
1433
|
direction: this.#a,
|
|
1431
1434
|
mode: e
|
|
1432
|
-
}), this.#
|
|
1435
|
+
}), this.#Z = this.#kn(this.#Q), t && this.#n.emit("spreadChanged", {
|
|
1433
1436
|
mode: e,
|
|
1434
|
-
singlePage: this.#
|
|
1437
|
+
singlePage: this.#B
|
|
1435
1438
|
});
|
|
1436
1439
|
}
|
|
1437
|
-
async #
|
|
1438
|
-
let e = this.#
|
|
1439
|
-
!e || !this.#
|
|
1440
|
+
async #mn() {
|
|
1441
|
+
let e = this.#X[this.#Z];
|
|
1442
|
+
!e || !this.#ue || (this.#$ = await this.#Tn(e), this.#hn(e, this.#$));
|
|
1440
1443
|
}
|
|
1441
|
-
#
|
|
1442
|
-
this.#
|
|
1443
|
-
fill: this.#
|
|
1444
|
+
#hn(e, t) {
|
|
1445
|
+
this.#ue?.renderSpread(e, t, {
|
|
1446
|
+
fill: this.#B,
|
|
1444
1447
|
fit: this.#d
|
|
1445
|
-
}), this.#
|
|
1448
|
+
}), this.#gn(), this.#We = 1, this.#vn();
|
|
1446
1449
|
}
|
|
1447
|
-
#
|
|
1448
|
-
let e = this.#
|
|
1450
|
+
#gn() {
|
|
1451
|
+
let e = this.#ue?.measure(), t = e?.containerAspect;
|
|
1449
1452
|
if (t === void 0) {
|
|
1450
1453
|
let n = e?.book;
|
|
1451
1454
|
if (!n || n.width <= 0 || n.height <= 0) return;
|
|
1452
1455
|
t = n.width / n.height;
|
|
1453
1456
|
}
|
|
1454
|
-
t <= 0 || this.#
|
|
1457
|
+
t <= 0 || this.#W !== null && Math.abs(t - this.#W) < .005 || (this.#W = t, this.#e.style.aspectRatio = t.toFixed(4));
|
|
1455
1458
|
}
|
|
1456
|
-
#
|
|
1459
|
+
#_n(e) {
|
|
1457
1460
|
if (this.#i.state !== "idle") {
|
|
1458
|
-
this.#
|
|
1461
|
+
this.#Pe.add(e);
|
|
1459
1462
|
return;
|
|
1460
1463
|
}
|
|
1461
|
-
let t = this.#
|
|
1464
|
+
let t = this.#X[this.#Z];
|
|
1462
1465
|
if (!(!t || !(t.left === e || t.right === e))) {
|
|
1463
|
-
if (this.#
|
|
1464
|
-
this.#
|
|
1466
|
+
if (this.#se > 1) {
|
|
1467
|
+
this.#vn();
|
|
1465
1468
|
return;
|
|
1466
1469
|
}
|
|
1467
|
-
this.#
|
|
1470
|
+
this.#mn();
|
|
1468
1471
|
}
|
|
1469
1472
|
}
|
|
1470
|
-
#
|
|
1471
|
-
this.#
|
|
1472
|
-
let e = this.#
|
|
1473
|
-
if (e !== this.#
|
|
1473
|
+
#vn() {
|
|
1474
|
+
this.#Ke !== null && clearTimeout(this.#Ke);
|
|
1475
|
+
let e = this.#bn();
|
|
1476
|
+
if (e !== this.#We) {
|
|
1474
1477
|
if (e === 1) {
|
|
1475
|
-
this.#
|
|
1478
|
+
this.#Ge++, this.#We = 1, this.#mn();
|
|
1476
1479
|
return;
|
|
1477
1480
|
}
|
|
1478
|
-
this.#
|
|
1479
|
-
this.#
|
|
1481
|
+
this.#Ke = setTimeout(() => {
|
|
1482
|
+
this.#Ke = null, this.#xn();
|
|
1480
1483
|
}, R);
|
|
1481
1484
|
}
|
|
1482
1485
|
}
|
|
1483
|
-
#
|
|
1484
|
-
let e = this.#
|
|
1486
|
+
#yn() {
|
|
1487
|
+
let e = this.#ue?.measure(), t = e?.content ?? e?.book;
|
|
1485
1488
|
if (!t || t.width <= 0) return 1;
|
|
1486
|
-
let n = this
|
|
1489
|
+
let n = this.#$, r = +!!n.left + +!!n.right;
|
|
1487
1490
|
if (r === 0) return 1;
|
|
1488
1491
|
let i = t.width / r, a = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, o = 0;
|
|
1489
1492
|
for (let e of [n.left, n.right]) {
|
|
1490
1493
|
if (!e || e.width <= 0) continue;
|
|
1491
|
-
let t = e.width / this.#
|
|
1494
|
+
let t = e.width / this.#We;
|
|
1492
1495
|
o = Math.max(o, i * a / t);
|
|
1493
1496
|
}
|
|
1494
1497
|
return o === 0 ? 1 : o;
|
|
1495
1498
|
}
|
|
1496
|
-
#
|
|
1497
|
-
let e = Math.max(1, B / (typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1)), t = this.#
|
|
1499
|
+
#bn() {
|
|
1500
|
+
let e = Math.max(1, B / (typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1)), t = this.#se <= 1 ? 1 : this.#se, n = this.#yn() * Math.max(t, e);
|
|
1498
1501
|
return n <= 1.001 ? 1 : Math.min(Math.ceil(n * 2) / 2, z);
|
|
1499
1502
|
}
|
|
1500
|
-
async #
|
|
1501
|
-
let e = this.#
|
|
1502
|
-
if (!this.#
|
|
1503
|
-
let t = this.#
|
|
1504
|
-
if (t === 1 || t === this.#
|
|
1505
|
-
let n = ++this.#
|
|
1503
|
+
async #xn() {
|
|
1504
|
+
let e = this.#X[this.#Z];
|
|
1505
|
+
if (!this.#ue || !e) return;
|
|
1506
|
+
let t = this.#bn();
|
|
1507
|
+
if (t === 1 || t === this.#We || this.#i.state !== "idle") return;
|
|
1508
|
+
let n = ++this.#Ge, r = {
|
|
1506
1509
|
x: 0,
|
|
1507
1510
|
y: 0,
|
|
1508
1511
|
width: 1,
|
|
@@ -1513,7 +1516,7 @@ var Y = class {
|
|
|
1513
1516
|
return await this.#t.get(e, {
|
|
1514
1517
|
scale: t,
|
|
1515
1518
|
region: r,
|
|
1516
|
-
maxSize: this.#
|
|
1519
|
+
maxSize: this.#ue?.maxTextureSize
|
|
1517
1520
|
});
|
|
1518
1521
|
} catch (t) {
|
|
1519
1522
|
return this.#n.emit("sourceError", {
|
|
@@ -1522,37 +1525,56 @@ var Y = class {
|
|
|
1522
1525
|
}), null;
|
|
1523
1526
|
}
|
|
1524
1527
|
}));
|
|
1525
|
-
if (n !== this.#
|
|
1526
|
-
let a = i[0] ?? this
|
|
1527
|
-
a === this
|
|
1528
|
+
if (n !== this.#Ge || this.#bn() !== t || this.#i.state !== "idle") return;
|
|
1529
|
+
let a = i[0] ?? this.#$.left, o = i[1] ?? this.#$.right;
|
|
1530
|
+
a === this.#$.left && o === this.#$.right || (this.#We = t, this.#$ = {
|
|
1528
1531
|
left: a,
|
|
1529
1532
|
right: o
|
|
1530
|
-
}, this.#
|
|
1531
|
-
fill: this.#
|
|
1533
|
+
}, this.#ue.renderSpread(e, this.#$, {
|
|
1534
|
+
fill: this.#B,
|
|
1532
1535
|
fit: this.#d
|
|
1533
1536
|
}));
|
|
1534
1537
|
}
|
|
1535
|
-
#
|
|
1536
|
-
if (this.#
|
|
1537
|
-
let e = this.#
|
|
1538
|
-
this.#
|
|
1538
|
+
#Sn() {
|
|
1539
|
+
if (this.#Pe.size === 0) return;
|
|
1540
|
+
let e = this.#X[this.#Z], t = e !== void 0 && [e.left, e.right].some((e) => e !== null && this.#Pe.has(e));
|
|
1541
|
+
this.#Pe.clear(), t && (this.#se > 1 ? this.#vn() : this.#mn());
|
|
1539
1542
|
}
|
|
1540
|
-
#
|
|
1541
|
-
typeof ResizeObserver > "u" || (this.#
|
|
1543
|
+
#Cn() {
|
|
1544
|
+
typeof ResizeObserver > "u" || (this.#ae = new ResizeObserver(() => this.#wn()), this.#ae.observe(this.#e));
|
|
1542
1545
|
}
|
|
1543
|
-
#
|
|
1544
|
-
this.#
|
|
1545
|
-
this.#
|
|
1546
|
+
#wn() {
|
|
1547
|
+
this.#oe || (this.#oe = !0, requestAnimationFrame(() => {
|
|
1548
|
+
this.#oe = !1, this.update();
|
|
1546
1549
|
}));
|
|
1547
1550
|
}
|
|
1548
|
-
async #
|
|
1549
|
-
let [t, n] = await Promise.all([this.#
|
|
1550
|
-
return {
|
|
1551
|
+
async #Tn(e) {
|
|
1552
|
+
let [t, n] = await Promise.all([this.#Dn(e.left), this.#Dn(e.right)]), r = await this.#En(e, t, n);
|
|
1553
|
+
return r > 0 ? {
|
|
1554
|
+
left: t,
|
|
1555
|
+
right: n,
|
|
1556
|
+
spineTrim: r
|
|
1557
|
+
} : {
|
|
1551
1558
|
left: t,
|
|
1552
1559
|
right: n
|
|
1553
1560
|
};
|
|
1554
1561
|
}
|
|
1555
|
-
async #
|
|
1562
|
+
async #En(e, t, n) {
|
|
1563
|
+
let r = this.#f;
|
|
1564
|
+
if (r === 0 || t === null || n === null) return 0;
|
|
1565
|
+
if (r !== "auto") return r / 2;
|
|
1566
|
+
let i = `${e.left}:${e.right}`, a = this.#m.get(i);
|
|
1567
|
+
if (t.width !== n.width || t.height !== n.height) return (a?.overlap ?? 0) / 2;
|
|
1568
|
+
if (a !== void 0 && a.width >= t.width) return a.overlap / 2;
|
|
1569
|
+
let o = await this.#p;
|
|
1570
|
+
if (!o) return 0;
|
|
1571
|
+
let s = o(t, n);
|
|
1572
|
+
return this.#m.set(i, {
|
|
1573
|
+
overlap: s,
|
|
1574
|
+
width: t.width
|
|
1575
|
+
}), s / 2;
|
|
1576
|
+
}
|
|
1577
|
+
async #Dn(e) {
|
|
1556
1578
|
if (e === null) return null;
|
|
1557
1579
|
try {
|
|
1558
1580
|
return await this.#t.get(e);
|
|
@@ -1563,30 +1585,30 @@ var Y = class {
|
|
|
1563
1585
|
}), null;
|
|
1564
1586
|
}
|
|
1565
1587
|
}
|
|
1566
|
-
#
|
|
1567
|
-
let { toMount: e } = this.#r.update(this.#
|
|
1588
|
+
#On() {
|
|
1589
|
+
let { toMount: e } = this.#r.update(this.#Z, this.#X.length), t = [];
|
|
1568
1590
|
for (let n of e) {
|
|
1569
|
-
let e = this.#
|
|
1591
|
+
let e = this.#X[n];
|
|
1570
1592
|
e?.left != null && t.push(e.left), e?.right != null && t.push(e.right);
|
|
1571
1593
|
}
|
|
1572
1594
|
this.#t.prefetch(t);
|
|
1573
1595
|
}
|
|
1574
|
-
#
|
|
1575
|
-
let t = this.#
|
|
1596
|
+
#kn(e) {
|
|
1597
|
+
let t = this.#X.findIndex((t) => t.left === e || t.right === e);
|
|
1576
1598
|
return t === -1 ? 0 : t;
|
|
1577
1599
|
}
|
|
1578
|
-
#
|
|
1600
|
+
#An() {
|
|
1579
1601
|
let e = this.#t.pageCount;
|
|
1580
1602
|
if (!Number.isInteger(e) || e < 1) throw Error(`Zine: source has ${e} pages; a Source must have at least 1 page.`);
|
|
1581
|
-
let t = this.#
|
|
1603
|
+
let t = this.#G;
|
|
1582
1604
|
if (t !== void 0 && (!Number.isInteger(t) || t < 0 || t >= e)) throw Error(`Zine: startPage ${JSON.stringify(t)} is out of range for a ${e}-page book (valid 0..${e - 1}).`);
|
|
1583
|
-
let n = this.#
|
|
1584
|
-
this.#
|
|
1605
|
+
let n = this.#dn();
|
|
1606
|
+
this.#B = n === "single", this.#X = a(e, {
|
|
1585
1607
|
direction: this.#a,
|
|
1586
1608
|
mode: n
|
|
1587
1609
|
});
|
|
1588
|
-
let r = this.#
|
|
1589
|
-
this.#
|
|
1610
|
+
let r = this.#K ? S(globalThis.location?.hash ?? "") : null;
|
|
1611
|
+
this.#Q = X(r ?? t ?? 0, 0, e - 1), this.#Z = this.#kn(this.#Q);
|
|
1590
1612
|
}
|
|
1591
1613
|
};
|
|
1592
1614
|
function X(e, t, n) {
|
|
@@ -1622,14 +1644,16 @@ function fe(n, r) {
|
|
|
1622
1644
|
].includes(c)) throw Error(`Zine: clickToFlip must be 'edge', 'half', or 'off'; got ${JSON.stringify(c)}.`);
|
|
1623
1645
|
let l = i.fit;
|
|
1624
1646
|
if (l !== void 0 && l !== "contain" && l !== "fill") throw Error(`Zine: fit must be 'contain' or 'fill'; got ${JSON.stringify(l)}.`);
|
|
1625
|
-
let u = i.
|
|
1626
|
-
if (u !== void 0 && (typeof u
|
|
1627
|
-
let d = i.
|
|
1628
|
-
if (d !== void 0) {
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1647
|
+
let u = i.gutterOverlap;
|
|
1648
|
+
if (u !== void 0 && u !== "auto" && !(typeof u == "number" && u >= 0 && u <= .5)) throw Error(`Zine: gutterOverlap must be 'auto' or a number from 0 to 0.5 (a fraction of page width); got ${JSON.stringify(u)}.`);
|
|
1649
|
+
let d = i.strings;
|
|
1650
|
+
if (d !== void 0 && (typeof d != "object" || !d)) throw Error(`Zine: strings must be an object of text overrides; got ${Q(d)}.`);
|
|
1651
|
+
let f = i.curl;
|
|
1652
|
+
if (f !== void 0) {
|
|
1653
|
+
if (typeof f == "object" && f) {
|
|
1654
|
+
if (typeof f.deform != "function") throw Error("Zine: a curl model must have a deform() function.");
|
|
1655
|
+
} else if (e.includes(f)) throw Error(`Zine: the '${String(f)}' curl is not bundled. Import it and pass the model: import { ${String(f)} } from '@zinejs/core/curls' → curl: ${String(f)}`);
|
|
1656
|
+
else if (!t.includes(f)) throw Error(`Zine: curl must be ${t.join(" or ")}, or a model imported from '@zinejs/core/curls' (${e.join(", ")}); got ${JSON.stringify(f)}.`);
|
|
1633
1657
|
}
|
|
1634
1658
|
for (let e of [
|
|
1635
1659
|
"deepLink",
|
|
@@ -1637,56 +1661,56 @@ function fe(n, r) {
|
|
|
1637
1661
|
"responsiveSpread",
|
|
1638
1662
|
"loading"
|
|
1639
1663
|
]) if (i[e] !== void 0 && typeof i[e] != "boolean") throw Error(`Zine: ${e} must be a boolean; got ${Q(i[e])}.`);
|
|
1640
|
-
let
|
|
1641
|
-
if (
|
|
1642
|
-
let
|
|
1643
|
-
if (
|
|
1664
|
+
let p = i.controls;
|
|
1665
|
+
if (p !== void 0 && typeof p != "boolean" && (typeof p != "object" || !p)) throw Error(`Zine: controls must be a boolean or an options object; got ${Q(p)}.`);
|
|
1666
|
+
let m = p?.position;
|
|
1667
|
+
if (m !== void 0 && ![
|
|
1644
1668
|
"top",
|
|
1645
1669
|
"bottom",
|
|
1646
1670
|
"left",
|
|
1647
1671
|
"right"
|
|
1648
|
-
].includes(
|
|
1649
|
-
let
|
|
1650
|
-
if (
|
|
1672
|
+
].includes(m)) throw Error(`Zine: controls.position must be 'top', 'bottom', 'left', or 'right'; got ${JSON.stringify(m)}.`);
|
|
1673
|
+
let h = p?.colorScheme;
|
|
1674
|
+
if (h !== void 0 && ![
|
|
1651
1675
|
"light",
|
|
1652
1676
|
"dark",
|
|
1653
1677
|
"auto"
|
|
1654
|
-
].includes(
|
|
1655
|
-
let
|
|
1656
|
-
if (
|
|
1657
|
-
let
|
|
1658
|
-
if (
|
|
1659
|
-
let
|
|
1660
|
-
if (
|
|
1678
|
+
].includes(h)) throw Error(`Zine: controls.colorScheme must be 'light', 'dark', or 'auto'; got ${JSON.stringify(h)}.`);
|
|
1679
|
+
let g = p?.arrows;
|
|
1680
|
+
if (g !== void 0 && typeof g != "boolean" && !["desktop", "mobile"].includes(g)) throw Error(`Zine: controls.arrows must be a boolean, 'desktop', or 'mobile'; got ${JSON.stringify(g)}.`);
|
|
1681
|
+
let _ = i.contextMenu;
|
|
1682
|
+
if (_ !== void 0 && typeof _ != "boolean" && (typeof _ != "object" || !_)) throw Error(`Zine: contextMenu must be a boolean or an options object; got ${Q(_)}.`);
|
|
1683
|
+
let v = _?.colorScheme;
|
|
1684
|
+
if (v !== void 0 && ![
|
|
1661
1685
|
"light",
|
|
1662
1686
|
"dark",
|
|
1663
1687
|
"auto"
|
|
1664
|
-
].includes(
|
|
1665
|
-
if (i.disableContextMenu === !0 &&
|
|
1666
|
-
let
|
|
1667
|
-
if (
|
|
1668
|
-
let
|
|
1669
|
-
if (
|
|
1670
|
-
if (typeof
|
|
1671
|
-
let e =
|
|
1688
|
+
].includes(v)) throw Error(`Zine: contextMenu.colorScheme must be 'light', 'dark', or 'auto'; got ${JSON.stringify(v)}.`);
|
|
1689
|
+
if (i.disableContextMenu === !0 && _ !== void 0 && _ !== !1) throw Error("Zine: disableContextMenu and contextMenu are mutually exclusive — one removes the browser's right-click menu, the other replaces it. Enable only one.");
|
|
1690
|
+
let y = i.hideControls;
|
|
1691
|
+
if (y !== void 0 && (!Array.isArray(y) || y.some((e) => typeof e != "string"))) throw Error(`Zine: hideControls must be an array of control-id strings; got ${Q(y)}.`);
|
|
1692
|
+
let b = i.sound;
|
|
1693
|
+
if (b !== void 0 && typeof b != "boolean" && (typeof b != "object" || !b)) throw Error(`Zine: sound must be a boolean or an options object; got ${Q(b)}.`);
|
|
1694
|
+
if (typeof b == "object" && b) {
|
|
1695
|
+
let e = b;
|
|
1672
1696
|
if (e.url !== void 0 && typeof e.url != "string") throw Error(`Zine: sound.url must be a string URL; got ${Q(e.url)}.`);
|
|
1673
1697
|
if (e.volume !== void 0 && (typeof e.volume != "number" || e.volume < 0 || e.volume > 1)) throw Error(`Zine: sound.volume must be a number between 0 and 1; got ${JSON.stringify(e.volume)}.`);
|
|
1674
1698
|
if (e.muted !== void 0 && typeof e.muted != "boolean") throw Error(`Zine: sound.muted must be a boolean; got ${Q(e.muted)}.`);
|
|
1675
1699
|
if (e.persist !== void 0 && typeof e.persist != "boolean") throw Error(`Zine: sound.persist must be a boolean; got ${Q(e.persist)}.`);
|
|
1676
1700
|
}
|
|
1677
|
-
let
|
|
1678
|
-
if (
|
|
1701
|
+
let x = i.spreadMode;
|
|
1702
|
+
if (x !== void 0 && ![
|
|
1679
1703
|
"double",
|
|
1680
1704
|
"single",
|
|
1681
1705
|
"cover",
|
|
1682
1706
|
"book"
|
|
1683
|
-
].includes(
|
|
1707
|
+
].includes(x)) throw Error(`Zine: spreadMode must be 'double', 'single', 'cover', or 'book'; got ${JSON.stringify(x)}.`);
|
|
1684
1708
|
for (let e of ["frontCover", "backCover"]) {
|
|
1685
1709
|
let t = i[e];
|
|
1686
1710
|
if (t !== void 0 && typeof t != "string") throw Error(`Zine: ${e} must be an image URL string; got ${JSON.stringify(t)}.`);
|
|
1687
1711
|
}
|
|
1688
|
-
let
|
|
1689
|
-
if (
|
|
1712
|
+
let S = i.pages;
|
|
1713
|
+
if (S !== void 0 && (typeof S != "object" || !S || Array.isArray(S))) throw Error("Zine: pages must be an object mapping page indices to image URLs.");
|
|
1690
1714
|
$(i.width, "width", 1), $(i.height, "height", 1), $(i.flipDuration, "flipDuration", 0), $(i.clickZoneSize, "clickZoneSize", 0), $(i.clickFlipDelay, "clickFlipDelay", 0), $(i.singlePageThreshold, "singlePageThreshold", 0), pe(i.zoom), me(i.renderer);
|
|
1691
1715
|
}
|
|
1692
1716
|
function $(e, t, n) {
|