@readium/navigator 2.0.0-beta.11 → 2.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- let vA = class _e {
1
+ let VA = class qe {
2
2
  /**
3
3
  * Creates a [Encryption].
4
4
  */
@@ -10,7 +10,7 @@ let vA = class _e {
10
10
  */
11
11
  static deserialize(t) {
12
12
  if (t && t.algorithm)
13
- return new _e({
13
+ return new qe({
14
14
  algorithm: t.algorithm,
15
15
  compression: t.compression,
16
16
  originalLength: t.originalLength,
@@ -26,7 +26,7 @@ let vA = class _e {
26
26
  return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
27
27
  }
28
28
  };
29
- class R {
29
+ class y {
30
30
  constructor(t) {
31
31
  this.otherProperties = t;
32
32
  }
@@ -35,7 +35,7 @@ class R {
35
35
  */
36
36
  static deserialize(t) {
37
37
  if (t)
38
- return new R(t);
38
+ return new y(t);
39
39
  }
40
40
  /**
41
41
  * Serializes a [Properties] to its RWPM JSON representation.
@@ -50,22 +50,22 @@ class R {
50
50
  const e = Object.assign({}, this.otherProperties);
51
51
  for (const A in t)
52
52
  e[A] = t[A];
53
- return new R(e);
53
+ return new y(e);
54
54
  }
55
55
  }
56
- Object.defineProperty(R.prototype, "encryption", {
56
+ Object.defineProperty(y.prototype, "encryption", {
57
57
  get: function() {
58
- return vA.deserialize(this.otherProperties.encrypted);
58
+ return VA.deserialize(this.otherProperties.encrypted);
59
59
  }
60
60
  });
61
- var p = /* @__PURE__ */ ((n) => (n.fixed = "fixed", n.reflowable = "reflowable", n))(p || {}), rt = /* @__PURE__ */ ((n) => (n.auto = "auto", n.landscape = "landscape", n.portrait = "portrait", n))(rt || {}), W = /* @__PURE__ */ ((n) => (n.left = "left", n.right = "right", n.center = "center", n))(W || {}), Qt = /* @__PURE__ */ ((n) => (n.auto = "auto", n.both = "both", n.none = "none", n.landscape = "landscape", n))(Qt || {});
62
- R.prototype.getContains = function() {
61
+ var p = /* @__PURE__ */ ((n) => (n.fixed = "fixed", n.reflowable = "reflowable", n))(p || {}), it = /* @__PURE__ */ ((n) => (n.auto = "auto", n.landscape = "landscape", n.portrait = "portrait", n))(it || {}), J = /* @__PURE__ */ ((n) => (n.left = "left", n.right = "right", n.center = "center", n))(J || {}), Ut = /* @__PURE__ */ ((n) => (n.auto = "auto", n.both = "both", n.none = "none", n.landscape = "landscape", n))(Ut || {});
62
+ y.prototype.getContains = function() {
63
63
  return new Set(this.otherProperties.contains || []);
64
64
  };
65
- R.prototype.getLayout = function() {
65
+ y.prototype.getLayout = function() {
66
66
  return this.otherProperties.layout;
67
67
  };
68
- let zt = class u {
68
+ let Ct = class u {
69
69
  /** Creates a MediaType object. */
70
70
  constructor(t) {
71
71
  let e, A, i = t.mediaType.replace(/\s/g, "").split(";");
@@ -519,8 +519,7 @@ let zt = class u {
519
519
  fileExtension: "zip"
520
520
  });
521
521
  }
522
- };
523
- class pe {
522
+ }, Me = class {
524
523
  constructor(t) {
525
524
  this.uri = t, this.parameters = this.getParameters(t);
526
525
  }
@@ -547,27 +546,27 @@ class pe {
547
546
  }).join("&");
548
547
  return this.uri.replace(/\{(\??)([^}]+)\}/g, (...i) => i[1] ? A(i[2]) : e(i[2]));
549
548
  }
550
- }
551
- function bA(n) {
549
+ };
550
+ function PA(n) {
552
551
  return n && n instanceof Array ? n : void 0;
553
552
  }
554
- function $e(n) {
555
- return n && typeof n == "string" ? [n] : bA(n);
553
+ function _e(n) {
554
+ return n && typeof n == "string" ? [n] : PA(n);
556
555
  }
557
- function Be(n) {
556
+ function fe(n) {
558
557
  return typeof n == "string" ? new Date(n) : void 0;
559
558
  }
560
- function Ut(n) {
559
+ function Bt(n) {
561
560
  return isNaN(n) ? void 0 : n;
562
561
  }
563
- function P(n) {
564
- return Ut(n) !== void 0 && Math.sign(n) >= 0 ? n : void 0;
562
+ function V(n) {
563
+ return Bt(n) !== void 0 && Math.sign(n) >= 0 ? n : void 0;
565
564
  }
566
- function GA(n) {
565
+ function DA(n) {
567
566
  const t = new Array();
568
567
  return n.forEach((e) => t.push(e)), t;
569
568
  }
570
- let k = class tA {
569
+ let H = class $e {
571
570
  /**
572
571
  * Creates a [Locations].
573
572
  */
@@ -580,7 +579,7 @@ let k = class tA {
580
579
  static deserialize(t) {
581
580
  if (!t)
582
581
  return;
583
- const e = Ut(t.progression), A = Ut(t.totalProgression), i = Ut(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
582
+ const e = Bt(t.progression), A = Bt(t.totalProgression), i = Bt(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
584
583
  "fragment",
585
584
  "fragments",
586
585
  "progression",
@@ -589,8 +588,8 @@ let k = class tA {
589
588
  ]);
590
589
  return Object.entries(t).forEach(([o, a]) => {
591
590
  s.has(o) || r.set(o, a);
592
- }), new tA({
593
- fragments: $e(t.fragments || t.fragment),
591
+ }), new $e({
592
+ fragments: _e(t.fragments || t.fragment),
594
593
  progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
595
594
  totalProgression: A !== void 0 && A >= 0 && A <= 1 ? A : void 0,
596
595
  position: i !== void 0 && i > 0 ? i : void 0,
@@ -604,7 +603,7 @@ let k = class tA {
604
603
  const t = {};
605
604
  return this.fragments && (t.fragments = this.fragments), this.progression !== void 0 && (t.progression = this.progression), this.totalProgression !== void 0 && (t.totalProgression = this.totalProgression), this.position !== void 0 && (t.position = this.position), this.otherLocations && this.otherLocations.forEach((e, A) => t[A] = e), t;
606
605
  }
607
- }, HA = class eA {
606
+ }, vA = class tA {
608
607
  /**
609
608
  * Creates a [Text].
610
609
  */
@@ -616,7 +615,7 @@ let k = class tA {
616
615
  */
617
616
  static deserialize(t) {
618
617
  if (t)
619
- return new eA({
618
+ return new tA({
620
619
  after: t.after,
621
620
  before: t.before,
622
621
  highlight: t.highlight
@@ -629,24 +628,24 @@ let k = class tA {
629
628
  const t = {};
630
629
  return this.after !== void 0 && (t.after = this.after), this.before !== void 0 && (t.before = this.before), this.highlight !== void 0 && (t.highlight = this.highlight), t;
631
630
  }
632
- }, Zt = class Kt {
631
+ }, Wt = class Lt {
633
632
  /**
634
633
  * Creates a [Locator].
635
634
  */
636
635
  constructor(t) {
637
- this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new k({}), this.text = t.text;
636
+ this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new H({}), this.text = t.text;
638
637
  }
639
638
  /**
640
639
  * Parses a [Link] from its RWPM JSON representation.
641
640
  */
642
641
  static deserialize(t) {
643
642
  if (t && t.href && t.type)
644
- return new Kt({
643
+ return new Lt({
645
644
  href: t.href,
646
645
  type: t.type,
647
646
  title: t.title,
648
- locations: k.deserialize(t.locations),
649
- text: HA.deserialize(t.text)
647
+ locations: H.deserialize(t.locations),
648
+ text: vA.deserialize(t.text)
650
649
  });
651
650
  }
652
651
  /**
@@ -660,16 +659,16 @@ let k = class tA {
660
659
  * Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
661
660
  */
662
661
  copyWithLocations(t) {
663
- return new Kt({
662
+ return new Lt({
664
663
  href: this.href,
665
664
  type: this.type,
666
665
  title: this.title,
667
666
  text: this.text,
668
- locations: new k({ ...this.locations, ...t })
667
+ locations: new H({ ...this.locations, ...t })
669
668
  });
670
669
  }
671
670
  };
672
- class Z {
671
+ class X {
673
672
  /**
674
673
  * Creates a [Link].
675
674
  */
@@ -681,20 +680,20 @@ class Z {
681
680
  */
682
681
  static deserialize(t) {
683
682
  if (!(!t || typeof t.href != "string"))
684
- return new Z({
683
+ return new X({
685
684
  href: t.href,
686
685
  templated: t.templated,
687
686
  type: t.type,
688
687
  title: t.title,
689
688
  rels: t.rel ? t.rel instanceof Array ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
690
- properties: R.deserialize(t.properties),
691
- height: P(t.height),
692
- width: P(t.width),
693
- duration: P(t.duration),
694
- bitrate: P(t.bitrate),
695
- languages: $e(t.language),
696
- alternates: Ee.deserialize(t.alternate),
697
- children: Ee.deserialize(t.children)
689
+ properties: y.deserialize(t.properties),
690
+ height: V(t.height),
691
+ width: V(t.width),
692
+ duration: V(t.duration),
693
+ bitrate: V(t.bitrate),
694
+ languages: _e(t.language),
695
+ alternates: pe.deserialize(t.alternate),
696
+ children: pe.deserialize(t.children)
698
697
  });
699
698
  }
700
699
  /**
@@ -702,11 +701,11 @@ class Z {
702
701
  */
703
702
  serialize() {
704
703
  const t = { href: this.href };
705
- return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = GA(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
704
+ return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = DA(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
706
705
  }
707
706
  /** MediaType of the linked resource. */
708
707
  get mediaType() {
709
- return this.type !== void 0 ? zt.parse({ mediaType: this.type }) : zt.BINARY;
708
+ return this.type !== void 0 ? Ct.parse({ mediaType: this.type }) : Ct.BINARY;
710
709
  }
711
710
  /** Computes an absolute URL to the link, relative to the given `baseURL`.
712
711
  * If the link's `href` is already absolute, the `baseURL` is ignored.
@@ -720,14 +719,14 @@ class Z {
720
719
  }
721
720
  /** List of URI template parameter keys, if the `Link` is templated. */
722
721
  get templateParameters() {
723
- return this.templated ? new pe(this.href).parameters : /* @__PURE__ */ new Set();
722
+ return this.templated ? new Me(this.href).parameters : /* @__PURE__ */ new Set();
724
723
  }
725
724
  /** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
726
725
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
727
726
  */
728
727
  expandTemplate(t) {
729
- return new Z({
730
- href: new pe(this.href).expand(t),
728
+ return new X({
729
+ href: new Me(this.href).expand(t),
731
730
  templated: !1
732
731
  });
733
732
  }
@@ -736,25 +735,25 @@ class Z {
736
735
  */
737
736
  addProperties(t) {
738
737
  var e;
739
- const A = Z.deserialize(this.serialize());
740
- return A.properties = A.properties ? (e = A.properties) == null ? void 0 : e.add(t) : new R(t), A;
738
+ const A = X.deserialize(this.serialize());
739
+ return A.properties = A.properties ? (e = A.properties) == null ? void 0 : e.add(t) : new y(t), A;
741
740
  }
742
741
  /**
743
742
  * Creates a [Locator] from a reading order [Link].
744
743
  */
745
744
  get locator() {
746
745
  let t = this.href.split("#");
747
- return new Zt({
746
+ return new Wt({
748
747
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
749
748
  type: this.type ?? "",
750
749
  title: this.title,
751
- locations: new k({
750
+ locations: new H({
752
751
  fragments: t.length > 1 && t[1] !== void 0 ? [t[1]] : []
753
752
  })
754
753
  });
755
754
  }
756
755
  }
757
- let Ee = class AA {
756
+ let pe = class eA {
758
757
  /**
759
758
  * Creates a [Links].
760
759
  */
@@ -766,8 +765,8 @@ let Ee = class AA {
766
765
  */
767
766
  static deserialize(t) {
768
767
  if (t && t instanceof Array)
769
- return new AA(
770
- t.map((e) => Z.deserialize(e)).filter((e) => e !== void 0)
768
+ return new eA(
769
+ t.map((e) => X.deserialize(e)).filter((e) => e !== void 0)
771
770
  );
772
771
  }
773
772
  /**
@@ -847,7 +846,7 @@ let Ee = class AA {
847
846
  filterLinksHasType() {
848
847
  return this.items.filter((t) => t.type);
849
848
  }
850
- }, we = class iA {
849
+ }, Be = class AA {
851
850
  /**
852
851
  * Creates a [DomRange].
853
852
  */
@@ -860,11 +859,11 @@ let Ee = class AA {
860
859
  static deserialize(t) {
861
860
  if (!(t && t.cssSelector))
862
861
  return;
863
- let e = P(t.textNodeIndex);
862
+ let e = V(t.textNodeIndex);
864
863
  if (e === void 0)
865
864
  return;
866
- let A = P(t.charOffset);
867
- return A === void 0 && (A = P(t.offset)), new iA({
865
+ let A = V(t.charOffset);
866
+ return A === void 0 && (A = V(t.offset)), new AA({
868
867
  cssSelector: t.cssSelector,
869
868
  textNodeIndex: e,
870
869
  charOffset: A
@@ -880,7 +879,8 @@ let Ee = class AA {
880
879
  };
881
880
  return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
882
881
  }
883
- }, kA = class nA {
882
+ };
883
+ class te {
884
884
  /**
885
885
  * Creates a [DomRange].
886
886
  */
@@ -893,11 +893,11 @@ let Ee = class AA {
893
893
  static deserialize(t) {
894
894
  if (!t)
895
895
  return;
896
- let e = we.deserialize(t.start);
896
+ let e = Be.deserialize(t.start);
897
897
  if (e)
898
- return new nA({
898
+ return new te({
899
899
  start: e,
900
- end: we.deserialize(t.end)
900
+ end: Be.deserialize(t.end)
901
901
  });
902
902
  }
903
903
  /**
@@ -907,20 +907,20 @@ let Ee = class AA {
907
907
  const t = { start: this.start.serialize() };
908
908
  return this.end && (t.end = this.end.serialize()), t;
909
909
  }
910
- };
911
- k.prototype.getCssSelector = function() {
910
+ }
911
+ H.prototype.getCssSelector = function() {
912
912
  var n;
913
913
  return (n = this.otherLocations) == null ? void 0 : n.get("cssSelector");
914
914
  };
915
- k.prototype.getPartialCfi = function() {
915
+ H.prototype.getPartialCfi = function() {
916
916
  var n;
917
917
  return (n = this.otherLocations) == null ? void 0 : n.get("partialCfi");
918
918
  };
919
- k.prototype.getDomRange = function() {
919
+ H.prototype.getDomRange = function() {
920
920
  var n;
921
- return kA.deserialize((n = this.otherLocations) == null ? void 0 : n.get("domRange"));
921
+ return te.deserialize((n = this.otherLocations) == null ? void 0 : n.get("domRange"));
922
922
  };
923
- k.prototype.fragmentParameters = function() {
923
+ H.prototype.fragmentParameters = function() {
924
924
  return new Map(
925
925
  this.fragments.map((n) => n.startsWith("#") ? n.slice(1) : n).join("&").split("&").filter((n) => !n.startsWith("#")).map((n) => n.split("=")).filter((n) => n.length === 2).map((n) => [
926
926
  n[0].trim().toLowerCase(),
@@ -928,7 +928,7 @@ k.prototype.fragmentParameters = function() {
928
928
  ])
929
929
  );
930
930
  };
931
- k.prototype.htmlId = function() {
931
+ H.prototype.htmlId = function() {
932
932
  if (!this.fragments.length)
933
933
  return;
934
934
  let n = this.fragments.find((t) => t.length && !t.includes("="));
@@ -938,17 +938,17 @@ k.prototype.htmlId = function() {
938
938
  }
939
939
  return n != null && n.startsWith("#") ? n.slice(1) : n;
940
940
  };
941
- k.prototype.page = function() {
941
+ H.prototype.page = function() {
942
942
  const n = parseInt(this.fragmentParameters().get("page"));
943
943
  if (!isNaN(n) && n >= 0)
944
944
  return n;
945
945
  };
946
- k.prototype.time = function() {
946
+ H.prototype.time = function() {
947
947
  const n = parseInt(this.fragmentParameters().get("t"));
948
948
  if (!isNaN(n))
949
949
  return n;
950
950
  };
951
- k.prototype.space = function() {
951
+ H.prototype.space = function() {
952
952
  const n = this.fragmentParameters();
953
953
  if (!n.has("xywh"))
954
954
  return;
@@ -956,7 +956,7 @@ k.prototype.space = function() {
956
956
  if (t.length === 4 && !t.some(isNaN))
957
957
  return t;
958
958
  };
959
- let JA = class rA {
959
+ class ee {
960
960
  /** Creates a [Price]. */
961
961
  constructor(t) {
962
962
  this.currency = t.currency, this.value = t.value;
@@ -970,9 +970,9 @@ let JA = class rA {
970
970
  let e = t.currency;
971
971
  if (!(e && typeof e == "string" && e.length > 0))
972
972
  return;
973
- let A = P(t.value);
973
+ let A = V(t.value);
974
974
  if (A !== void 0)
975
- return new rA({ currency: e, value: A });
975
+ return new ee({ currency: e, value: A });
976
976
  }
977
977
  /**
978
978
  * Serializes a [Price] to its RWPM JSON representation.
@@ -980,8 +980,8 @@ let JA = class rA {
980
980
  serialize() {
981
981
  return { currency: this.currency, value: this.value };
982
982
  }
983
- };
984
- class ft {
983
+ }
984
+ let bA = class Et {
985
985
  /** Creates a [Acquisition]. */
986
986
  constructor(t) {
987
987
  this.type = t.type, this.children = t.children;
@@ -991,14 +991,14 @@ class ft {
991
991
  */
992
992
  static deserialize(t) {
993
993
  if (t && t.type)
994
- return new ft({
994
+ return new Et({
995
995
  type: t.type,
996
- children: ft.deserializeArray(t.children)
996
+ children: Et.deserializeArray(t.children)
997
997
  });
998
998
  }
999
999
  static deserializeArray(t) {
1000
1000
  if (t instanceof Array)
1001
- return t.map((e) => ft.deserialize(e)).filter((e) => e !== void 0);
1001
+ return t.map((e) => Et.deserialize(e)).filter((e) => e !== void 0);
1002
1002
  }
1003
1003
  /**
1004
1004
  * Serializes a [Acquisition] to its RWPM JSON representation.
@@ -1007,8 +1007,7 @@ class ft {
1007
1007
  const t = { type: this.type };
1008
1008
  return this.children && (t.children = this.children.map((e) => e.serialize())), t;
1009
1009
  }
1010
- }
1011
- class ne {
1010
+ }, GA = class iA {
1012
1011
  /** Creates a [Price]. */
1013
1012
  constructor(t) {
1014
1013
  this.total = t.total, this.position = t.position;
@@ -1018,9 +1017,9 @@ class ne {
1018
1017
  */
1019
1018
  static deserialize(t) {
1020
1019
  if (t)
1021
- return new ne({
1022
- total: P(t.total),
1023
- position: P(t.position)
1020
+ return new iA({
1021
+ total: V(t.total),
1022
+ position: V(t.position)
1024
1023
  });
1025
1024
  }
1026
1025
  /**
@@ -1030,8 +1029,8 @@ class ne {
1030
1029
  const t = {};
1031
1030
  return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
1032
1031
  }
1033
- }
1034
- let WA = class sA {
1032
+ };
1033
+ class Ae {
1035
1034
  /** Creates a [Copies]. */
1036
1035
  constructor(t) {
1037
1036
  this.total = t.total, this.available = t.available;
@@ -1041,9 +1040,9 @@ let WA = class sA {
1041
1040
  */
1042
1041
  static deserialize(t) {
1043
1042
  if (t)
1044
- return new sA({
1045
- total: P(t.total),
1046
- available: P(t.available)
1043
+ return new Ae({
1044
+ total: V(t.total),
1045
+ available: V(t.available)
1047
1046
  });
1048
1047
  }
1049
1048
  /**
@@ -1053,7 +1052,8 @@ let WA = class sA {
1053
1052
  const t = {};
1054
1053
  return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
1055
1054
  }
1056
- }, LA = class oA {
1055
+ }
1056
+ let HA = class nA {
1057
1057
  /** Creates a [Availability]. */
1058
1058
  constructor(t) {
1059
1059
  this.state = t.state, this.since = t.since, this.until = t.until;
@@ -1063,10 +1063,10 @@ let WA = class sA {
1063
1063
  */
1064
1064
  static deserialize(t) {
1065
1065
  if (t && t.state)
1066
- return new oA({
1066
+ return new nA({
1067
1067
  state: t.state,
1068
- since: Be(t.since),
1069
- until: Be(t.until)
1068
+ since: fe(t.since),
1069
+ until: fe(t.until)
1070
1070
  });
1071
1071
  }
1072
1072
  /**
@@ -1077,96 +1077,96 @@ let WA = class sA {
1077
1077
  return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
1078
1078
  }
1079
1079
  };
1080
- R.prototype.getNumberOfItems = function() {
1081
- return P(this.otherProperties.numberOfItems);
1080
+ y.prototype.getNumberOfItems = function() {
1081
+ return V(this.otherProperties.numberOfItems);
1082
1082
  };
1083
- R.prototype.getPrice = function() {
1084
- return JA.deserialize(this.otherProperties.price);
1083
+ y.prototype.getPrice = function() {
1084
+ return ee.deserialize(this.otherProperties.price);
1085
1085
  };
1086
- R.prototype.getIndirectAcquisitions = function() {
1086
+ y.prototype.getIndirectAcquisitions = function() {
1087
1087
  const n = this.otherProperties.indirectAcquisition;
1088
1088
  if (n && n instanceof Array)
1089
- return n.map((t) => ft.deserialize(t)).filter((t) => t !== void 0);
1089
+ return n.map((t) => bA.deserialize(t)).filter((t) => t !== void 0);
1090
1090
  };
1091
- R.prototype.getHolds = function() {
1092
- return ne.deserialize(this.otherProperties.holds);
1091
+ y.prototype.getHolds = function() {
1092
+ return GA.deserialize(this.otherProperties.holds);
1093
1093
  };
1094
- R.prototype.getCopies = function() {
1095
- return WA.deserialize(this.otherProperties.copies);
1094
+ y.prototype.getCopies = function() {
1095
+ return Ae.deserialize(this.otherProperties.copies);
1096
1096
  };
1097
- R.prototype.getAvailability = function() {
1098
- return LA.deserialize(this.otherProperties.availability);
1097
+ y.prototype.getAvailability = function() {
1098
+ return HA.deserialize(this.otherProperties.availability);
1099
1099
  };
1100
- R.prototype.getAuthenticate = function() {
1101
- return Z.deserialize(this.otherProperties.authenticate);
1100
+ y.prototype.getAuthenticate = function() {
1101
+ return X.deserialize(this.otherProperties.authenticate);
1102
1102
  };
1103
1103
  var w = /* @__PURE__ */ ((n) => (n.auto = "auto", n.btt = "btt", n.ltr = "ltr", n.rtl = "rtl", n.ttb = "ttb", n))(w || {});
1104
- R.prototype.getClipped = function() {
1104
+ y.prototype.getClipped = function() {
1105
1105
  return this.otherProperties.clipped;
1106
1106
  };
1107
- R.prototype.getFit = function() {
1107
+ y.prototype.getFit = function() {
1108
1108
  return this.otherProperties.fit;
1109
1109
  };
1110
- R.prototype.getOrientation = function() {
1110
+ y.prototype.getOrientation = function() {
1111
1111
  return this.otherProperties.orientation;
1112
1112
  };
1113
- R.prototype.getOverflow = function() {
1113
+ y.prototype.getOverflow = function() {
1114
1114
  return this.otherProperties.overflow;
1115
1115
  };
1116
- R.prototype.getPage = function() {
1116
+ y.prototype.getPage = function() {
1117
1117
  return this.otherProperties.page || void 0;
1118
1118
  };
1119
- R.prototype.getSpread = function() {
1119
+ y.prototype.getSpread = function() {
1120
1120
  return this.otherProperties.spread || void 0;
1121
1121
  };
1122
- var _;
1122
+ var K;
1123
1123
  (function(n) {
1124
1124
  n.NONE = "none", n.DESCENDANT = "descendant", n.CHILD = "child";
1125
- })(_ || (_ = {}));
1126
- var b;
1125
+ })(K || (K = {}));
1126
+ var v;
1127
1127
  (function(n) {
1128
1128
  n.id = "id", n.class = "class", n.tag = "tag", n.attribute = "attribute", n.nthchild = "nthchild", n.nthoftype = "nthoftype";
1129
- })(b || (b = {}));
1130
- const OA = "CssSelectorGenerator";
1131
- function Ie(n = "unknown problem", ...t) {
1132
- console.warn(`${OA}: ${n}`, ...t);
1129
+ })(v || (v = {}));
1130
+ const kA = "CssSelectorGenerator";
1131
+ function Ee(n = "unknown problem", ...t) {
1132
+ console.warn(`${kA}: ${n}`, ...t);
1133
1133
  }
1134
- b.id, b.class, b.tag, b.attribute, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY;
1135
- function XA(n) {
1134
+ v.id, v.class, v.tag, v.attribute, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY;
1135
+ function JA(n) {
1136
1136
  return n instanceof RegExp;
1137
1137
  }
1138
- function ZA(n) {
1138
+ function WA(n) {
1139
1139
  return n.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
1140
1140
  }
1141
- function KA(n) {
1141
+ function LA(n) {
1142
1142
  const t = n.map((e) => {
1143
- if (XA(e))
1143
+ if (JA(e))
1144
1144
  return (A) => e.test(A);
1145
1145
  if (typeof e == "function")
1146
1146
  return (A) => {
1147
1147
  const i = e(A);
1148
- return typeof i != "boolean" ? (Ie("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : i;
1148
+ return typeof i != "boolean" ? (Ee("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : i;
1149
1149
  };
1150
1150
  if (typeof e == "string") {
1151
- const A = new RegExp("^" + ZA(e) + "$");
1151
+ const A = new RegExp("^" + WA(e) + "$");
1152
1152
  return (i) => A.test(i);
1153
1153
  }
1154
- return Ie("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
1154
+ return Ee("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
1155
1155
  });
1156
1156
  return (e) => t.some((A) => A(e));
1157
1157
  }
1158
- const qA = "", _A = " > ", $A = " ";
1159
- _.NONE + "", _.NONE, _.DESCENDANT + "", _.DESCENDANT, _.CHILD + "", _.CHILD;
1160
- b.nthoftype, b.tag, b.id, b.class, b.attribute, b.nthchild;
1161
- KA([
1158
+ const OA = "", XA = " > ", ZA = " ";
1159
+ K.NONE + "", K.NONE, K.DESCENDANT + "", K.DESCENDANT, K.CHILD + "", K.CHILD;
1160
+ v.nthoftype, v.tag, v.id, v.class, v.attribute, v.nthchild;
1161
+ LA([
1162
1162
  "class",
1163
1163
  "id",
1164
1164
  // Angular attributes
1165
1165
  "ng-*"
1166
1166
  ]);
1167
- class ti {
1167
+ class KA {
1168
1168
  }
1169
- class ei extends ti {
1169
+ class qA extends KA {
1170
1170
  /**
1171
1171
  * Moves to the left content portion (eg. page) relative to the reading progression direction.
1172
1172
  */
@@ -1180,24 +1180,24 @@ class ei extends ti {
1180
1180
  this.readingProgression === w.ltr || this.readingProgression === w.ttb || this.readingProgression === w.auto ? this.goForward(t, e) : (this.readingProgression === w.rtl || this.readingProgression === w.btt) && this.goBackward(t, e);
1181
1181
  }
1182
1182
  }
1183
- const Ai = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__viewportWidth:100%;--RS__pageGutter:0;--RS__defaultLineLength:40rem;--RS__colGap:0;--RS__colCount:1;--RS__colWidth:100vw}@page{margin:0!important}:root{position:relative;-webkit-column-width:var(--RS__colWidth);-moz-column-width:var(--RS__colWidth);column-width:var(--RS__colWidth);-webkit-column-count:var(--RS__colCount);-moz-column-count:var(--RS__colCount);column-count:var(--RS__colCount);-webkit-column-gap:var(--RS__colGap);-moz-column-gap:var(--RS__colGap);column-gap:var(--RS__colGap);-moz-column-fill:auto;column-fill:auto;width:var(--RS__viewportWidth);height:100vh;max-width:var(--RS__viewportWidth);max-height:100vh;min-width:var(--RS__viewportWidth);min-height:100vh;padding:0!important;margin:0!important;font-size:1rem!important;box-sizing:border-box;-webkit-touch-callout:none}body{width:100%;max-width:var(--RS__defaultLineLength)!important;padding:0 var(--RS__pageGutter)!important;margin:0 auto!important;box-sizing:border-box}:root:not([style*=readium-noOverflow-on]) body{overflow:hidden}@supports (overflow: clip){:root:not([style*=readium-noOverflow-on]){overflow:clip}:root:not([style*=readium-noOverflow-on]) body{overflow:clip;overflow-clip-margin:content-box}}:root[style*=readium-scroll-on]{-webkit-columns:auto auto!important;-moz-columns:auto auto!important;columns:auto auto!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}:root[style*=readium-scroll-on] body{max-width:var(--RS__defaultLineLength)!important;box-sizing:border-box!important}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:auto}@supports (overflow: clip){:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]){overflow:auto}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:clip}}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingTop] body{padding-top:var(--RS__scrollPaddingTop)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingBottom] body{padding-bottom:var(--RS__scrollPaddingBottom)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingLeft] body{padding-left:var(--RS__scrollPaddingLeft)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingRight] body{padding-right:var(--RS__scrollPaddingRight)!important}:root[style*=readium-night-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#0099E5;--RS__linkColor:#63caff;--RS__textColor:#FEFEFE;--RS__backgroundColor:#000000}:root[style*=readium-night-on] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=readium-night-on] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=readium-night-on] a:link,:root[style*=readium-night-on] a:link *{color:var(--RS__linkColor)!important}:root[style*=readium-night-on] a:visited,:root[style*=readium-night-on] a:visited *{color:var(--RS__visitedColor)!important}:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-sepia-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#faf4e8}:root[style*=readium-sepia-on] *:not(a){color:inherit!important;background-color:transparent!important}:root[style*=readium-sepia-on] a:link,:root[style*=readium-sepia-on] a:link *{color:var(--RS__linkColor)}:root[style*=readium-sepia-on] a:visited,:root[style*=readium-sepia-on] a:visited *{color:var(--RS__visitedColor)}@media screen and (-ms-high-contrast: active){:root{color:windowText!important;background-color:window!important}:root :not(#\\#):not(#\\#):not(#\\#),:root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#){color:inherit!important;background-color:inherit!important}.readiumCSS-mo-active-default{color:highlightText!important;background-color:highlight!important}}@media screen and (-ms-high-contrast: white-on-black){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (inverted-colors){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}:root[style*=--USER__backgroundColor]{background-color:var(--USER__backgroundColor)!important}:root[style*=--USER__backgroundColor] *{background-color:transparent!important}:root[style*=--USER__textColor]{color:var(--USER__textColor)!important}:root[style*=--USER__textColor] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=--USER__textColor] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=--USER__linkColor] a:link,:root[style*=--USER__linkColor] a:link *{color:var(--USER__linkColor)!important}:root[style*=--USER__visitedColor] a:visited,:root[style*=--USER__visitedColor] a:visited *{color:var(--USER__visitedColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::-moz-selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__colCount]{-webkit-column-count:var(--USER__colCount);-moz-column-count:var(--USER__colCount);column-count:var(--USER__colCount);--RS__colWidth:auto}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"]{-webkit-column-count:1;-moz-column-count:1;column-count:1}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"],:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"]{--RS__colWidth:100vw}:root[style*=--USER__lineLength] body{max-width:var(--USER__lineLength)!important}:root[style*=--USER__textAlign]{text-align:var(--USER__textAlign)}:root[style*=--USER__textAlign] body,:root[style*=--USER__textAlign] p:not(blockquote p):not(figcaption p):not(hgroup p),:root[style*=--USER__textAlign] li,:root[style*=--USER__textAlign] dd{text-align:var(--USER__textAlign)!important;-moz-text-align-last:auto!important;-epub-text-align-last:auto!important;text-align-last:auto!important}:root[style*=--USER__bodyHyphens]{-webkit-hyphens:var(--USER__bodyHyphens)!important;-moz-hyphens:var(--USER__bodyHyphens)!important;-ms-hyphens:var(--USER__bodyHyphens)!important;-epub-hyphens:var(--USER__bodyHyphens)!important;hyphens:var(--USER__bodyHyphens)!important}:root[style*=--USER__bodyHyphens] body,:root[style*=--USER__bodyHyphens] p,:root[style*=--USER__bodyHyphens] li,:root[style*=--USER__bodyHyphens] div,:root[style*=--USER__bodyHyphens] dd{-webkit-hyphens:inherit;-moz-hyphens:inherit;-ms-hyphens:inherit;-epub-hyphens:inherit;hyphens:inherit}:root[style*=--USER__fontFamily]{font-family:var(--USER__fontFamily)!important}:root[style*=--USER__fontFamily] *{font-family:revert!important}:root[style*=AccessibleDfA]{font-family:AccessibleDfA,Verdana,Tahoma,Trebuchet MS,sans-serif!important}:root[style*="IA Writer Duospace"]{font-family:IA Writer Duospace,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace!important}:root[style*=AccessibleDfA],:root[style*="IA Writer Duospace"],:root[style*=readium-a11y-on]{font-style:normal!important;font-weight:400!important}:root[style*=AccessibleDfA] *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-a11y-on] *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=AccessibleDfA] *,:root[style*="IA Writer Duospace"] *,:root[style*=readium-a11y-on] *{text-decoration:none!important;font-variant-caps:normal!important;font-variant-numeric:normal!important;font-variant-position:normal!important}:root[style*=AccessibleDfA] sup,:root[style*="IA Writer Duospace"] sup,:root[style*=readium-a11y-on] sup,:root[style*=AccessibleDfA] sub,:root[style*="IA Writer Duospace"] sub,:root[style*=readium-a11y-on] sub{font-size:1rem!important;vertical-align:baseline!important}:root:not([style*=readium-deprecatedFontSize-on]):not([style*=readium-iOSPatch-on])[style*=--USER__fontSize] body{zoom:var(--USER__fontSize)!important}:root[style*=readium-iOSPatch-on][style*=--USER__fontSize] body{-webkit-text-size-adjust:var(--USER__fontSize)!important}@supports not (zoom: 1){:root[style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}}:root[style*=readium-deprecatedFontSize-on][style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}:root[style*=--USER__lineHeight]{line-height:var(--USER__lineHeight)!important}:root[style*=--USER__lineHeight] body,:root[style*=--USER__lineHeight] p,:root[style*=--USER__lineHeight] li,:root[style*=--USER__lineHeight] div{line-height:inherit}:root[style*=--USER__paraSpacing] p{margin-top:var(--USER__paraSpacing)!important;margin-bottom:var(--USER__paraSpacing)!important}:root[style*=--USER__paraIndent] p{text-indent:var(--USER__paraIndent)!important}:root[style*=--USER__paraIndent] p *,:root[style*=--USER__paraIndent] p:first-letter{text-indent:0!important}:root[style*=--USER__wordSpacing] h1,:root[style*=--USER__wordSpacing] h2,:root[style*=--USER__wordSpacing] h3,:root[style*=--USER__wordSpacing] h4,:root[style*=--USER__wordSpacing] h5,:root[style*=--USER__wordSpacing] h6,:root[style*=--USER__wordSpacing] p,:root[style*=--USER__wordSpacing] li,:root[style*=--USER__wordSpacing] div,:root[style*=--USER__wordSpacing] dt,:root[style*=--USER__wordSpacing] dd{word-spacing:var(--USER__wordSpacing)}:root[style*=--USER__letterSpacing] h1,:root[style*=--USER__letterSpacing] h2,:root[style*=--USER__letterSpacing] h3,:root[style*=--USER__letterSpacing] h4,:root[style*=--USER__letterSpacing] h5,:root[style*=--USER__letterSpacing] h6,:root[style*=--USER__letterSpacing] p,:root[style*=--USER__letterSpacing] li,:root[style*=--USER__letterSpacing] div,:root[style*=--USER__letterSpacing] dt,:root[style*=--USER__letterSpacing] dd{letter-spacing:var(--USER__letterSpacing);font-variant:none}:root[style*=--USER__fontWeight] body{font-weight:var(--USER__fontWeight)!important}:root[style*=--USER__fontWeight] b,:root[style*=--USER__fontWeight] strong{font-weight:bolder}:root[style*=--USER__fontWidth] body{font-stretch:var(--USER__fontWidth)!important}:root[style*=--USER__fontOpticalSizing] body{font-optical-sizing:var(--USER__fontOpticalSizing)!important}:root[style*=readium-blend-on] svg,:root[style*=readium-blend-on] img{background-color:transparent!important;mix-blend-mode:multiply!important}:root[style*=--USER__darkenImages] img{-webkit-filter:brightness(var(--USER__darkenImages))!important;filter:brightness(var(--USER__darkenImages))!important}:root[style*=readium-darken-on] img{-webkit-filter:brightness(80%)!important;filter:brightness(80%)!important}:root[style*=--USER__invertImages] img{-webkit-filter:invert(var(--USER__invertImages))!important;filter:invert(var(--USER__invertImages))!important}:root[style*=readium-invert-on] img{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=--USER__darkenImages][style*=--USER__invertImages] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important;filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important}:root[style*=readium-darken-on][style*=--USER__invertImages] img{-webkit-filter:brightness(80%) invert(var(--USER__invertImages))!important;filter:brightness(80%) invert(var(--USER__invertImages))!important}:root[style*=--USER__darkenImages][style*=readium-invert-on] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(100%)!important;filter:brightness(var(--USER__darkenImages)) invert(100%)!important}:root[style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%) invert(100%)!important;filter:brightness(80%) invert(100%)!important}:root[style*=--USER__invertGaiji] img[class*=gaiji]{-webkit-filter:invert(var(--USER__invertGaiji))!important;filter:invert(var(--USER__invertGaiji))!important}:root[style*=readium-invertGaiji-on] img[class*=gaiji]{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=readium-normalize-on]{--USER__typeScale:1.2}:root[style*=readium-normalize-on] p,:root[style*=readium-normalize-on] li,:root[style*=readium-normalize-on] div,:root[style*=readium-normalize-on] pre,:root[style*=readium-normalize-on] dd{font-size:1rem!important}:root[style*=readium-normalize-on] h1{font-size:1.75rem!important;font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h2{font-size:1.5rem!important;font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h3{font-size:1.25rem!important;font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h4,:root[style*=readium-normalize-on] h5,:root[style*=readium-normalize-on] h6{font-size:1rem!important}:root[style*=readium-normalize-on] small{font-size:smaller!important}:root[style*=readium-normalize-on] sub,:root[style*=readium-normalize-on] sup{font-size:67.5%!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h1{font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h2{font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h3{font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-iPadOSPatch-on] body{-webkit-text-size-adjust:none}:root[style*=readium-iPadOSPatch-on] p,:root[style*=readium-iPadOSPatch-on] h1,:root[style*=readium-iPadOSPatch-on] h2,:root[style*=readium-iPadOSPatch-on] h3,:root[style*=readium-iPadOSPatch-on] h4,:root[style*=readium-iPadOSPatch-on] h5,:root[style*=readium-iPadOSPatch-on] h6,:root[style*=readium-iPadOSPatch-on] li,:root[style*=readium-iPadOSPatch-on] th,:root[style*=readium-iPadOSPatch-on] td,:root[style*=readium-iPadOSPatch-on] dt,:root[style*=readium-iPadOSPatch-on] dd,:root[style*=readium-iPadOSPatch-on] pre,:root[style*=readium-iPadOSPatch-on] address,:root[style*=readium-iPadOSPatch-on] details,:root[style*=readium-iPadOSPatch-on] summary,:root[style*=readium-iPadOSPatch-on] figcaption,:root[style*=readium-iPadOSPatch-on] div:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)),:root[style*=readium-iPadOSPatch-on] aside:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)){-webkit-text-zoom:reset}:root[style*=readium-iPadOSPatch-on] abbr,:root[style*=readium-iPadOSPatch-on] b,:root[style*=readium-iPadOSPatch-on] bdi,:root[style*=readium-iPadOSPatch-on] bdo,:root[style*=readium-iPadOSPatch-on] cite,:root[style*=readium-iPadOSPatch-on] code,:root[style*=readium-iPadOSPatch-on] dfn,:root[style*=readium-iPadOSPatch-on] em,:root[style*=readium-iPadOSPatch-on] i,:root[style*=readium-iPadOSPatch-on] kbd,:root[style*=readium-iPadOSPatch-on] mark,:root[style*=readium-iPadOSPatch-on] q,:root[style*=readium-iPadOSPatch-on] rp,:root[style*=readium-iPadOSPatch-on] rt,:root[style*=readium-iPadOSPatch-on] ruby,:root[style*=readium-iPadOSPatch-on] s,:root[style*=readium-iPadOSPatch-on] samp,:root[style*=readium-iPadOSPatch-on] small,:root[style*=readium-iPadOSPatch-on] span,:root[style*=readium-iPadOSPatch-on] strong,:root[style*=readium-iPadOSPatch-on] sub,:root[style*=readium-iPadOSPatch-on] sup,:root[style*=readium-iPadOSPatch-on] time,:root[style*=readium-iPadOSPatch-on] u,:root[style*=readium-iPadOSPatch-on] var{-webkit-text-zoom:normal}:root[style*=readium-iPadOSPatch-on] p:not(:has(b,cite,em,i,q,s,small,span,strong)):first-line{-webkit-text-zoom:normal}
1184
- `, ii = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);@-ms-viewport{width:device-width}@viewport{width:device-width;zoom:1}:root{--RS__monospaceTf:ui-monospace, "Andale Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;--RS__humanistTf:Seravek, Calibri, "Gill Sans Nova", Roboto, Ubuntu, "DejaVu Sans", source-sans-pro, sans-serif;--RS__sansTf:-ui-sans-serif, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", "Arial Nova", "Liberation Sans", Arial, sans-serif;--RS__modernTf:Athelas, Constantia, Charter, "Bitstream Charter", Cambria, "Georgia Pro", Georgia, serif;--RS__oldStyleTf:"Iowan Old Style", Sitka, "Sitka Text", Palatino, "Book Antiqua", "URW Palladio L", P052, serif;--RS__baseFontFamily:var(--RS__oldStyleTf);--RS__lineHeightCompensation:1;--RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation));--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#FFFFFF;color:var(--RS__textColor)!important;background-color:var(--RS__backgroundColor)!important}::-moz-selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}::selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}html{font-family:var(--RS__baseFontFamily);line-height:1.6;line-height:var(--RS__baseLineHeight);text-rendering:optimizelegibility}h1,h2,h3{line-height:normal}:lang(ja),:lang(zh),:lang(ko){word-wrap:break-word;-webkit-line-break:strict;-epub-line-break:strict;line-break:strict}math{font-family:"Latin Modern Math","STIX Two Math","XITS Math","STIX Math","Libertinus Math","TeX Gyre Termes Math","TeX Gyre Bonum Math",TeX Gyre Schola,"DejaVu Math TeX Gyre","TeX Gyre Pagella Math","Asana Math","Cambria Math","Lucida Bright Math","Minion Math",STIXGeneral,STIXSizeOneSym,Symbol,Times New Roman,serif}:lang(am){--RS__baseFontFamily:kefa, nyala, roboto, noto, "Noto Sans Ethiopic", serif;--RS__lineHeightCompensation:1.167}:lang(ar){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(bn){--RS__baseFontFamily:"Kohinoor Bangla", "Bangla Sangam MN", vrinda, roboto, noto, "Noto Sans Bengali", sans-serif;--RS__lineHeightCompensation:1.067}:lang(bo){--RS__baseFontFamily:kailasa, "Microsoft Himalaya", roboto, noto, "Noto Sans Tibetan", sans-serif}:lang(chr){--RS__baseFontFamily:"Plantagenet Cherokee", roboto, noto, "Noto Sans Cherokee";--RS__lineHeightCompensation:1.167}:lang(fa){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(gu){--RS__baseFontFamily:"Gujarati Sangam MN", "Nirmala UI", shruti, roboto, noto, "Noto Sans Gujarati", sans-serif;--RS__lineHeightCompensation:1.167}:lang(he){--RS__baseFontFamily:"New Peninim MT", "Arial Hebrew", gisha, "Times New Roman", roboto, noto, "Noto Sans Hebrew" sans-serif;--RS__lineHeightCompensation:1.1}:lang(hi){--RS__baseFontFamily:"Kohinoor Devanagari", "Devanagari Sangam MN", kokila, "Nirmala UI", roboto, noto, "Noto Sans Devanagari", sans-serif;--RS__lineHeightCompensation:1.1}:lang(hy){--RS__baseFontFamily:mshtakan, sylfaen, roboto, noto, "Noto Serif Armenian", serif}:lang(iu){--RS__baseFontFamily:"Euphemia UCAS", euphemia, roboto, noto, "Noto Sans Canadian Aboriginal", sans-serif}:lang(ja){--RS__baseFontFamily:yugothic, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "MS Gothic", roboto, noto, "Noto Sans CJK JP", sans-serif;--RS__lineHeightCompensation:1.167;--RS__serif-ja:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDPMincho", "Yu Mincho", "MS P明朝", "MS PMincho", serif;--RS__sans-serif-ja:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDPGothic", "Yu Gothic", "MS Pゴシック", "MS PGothic", sans-serif;--RS__serif-ja-v:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDMincho", "Yu Mincho", "MS明朝", "MS Mincho", serif;--RS__sans-serif-ja-v:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDGothic", "Yu Gothic", "MSゴシック", "MS Gothic", sans-serif}:lang(km){--RS__baseFontFamily:"Khmer Sangam MN", "Leelawadee UI", "Khmer UI", roboto, noto, "Noto Sans Khmer", sans-serif;--RS__lineHeightCompensation:1.067}:lang(kn){--RS__baseFontFamily:"Kannada Sangam MN", "Nirmala UI", tunga, roboto, noto, "Noto Sans Kannada", sans-serif;--RS__lineHeightCompensation:1.1}:lang(ko){--RS__baseFontFamily:"Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", roboto, noto, "Noto Sans CJK KR", sans-serif;--RS__lineHeightCompensation:1.167}:lang(lo){--RS__baseFontFamily:"Lao Sangam MN", "Leelawadee UI", "Lao UI", roboto, noto, "Noto Sans Lao", sans-serif}:lang(ml){--RS__baseFontFamily:"Malayalam Sangam MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Malayalam", sans-serif;--RS__lineHeightCompensation:1.067}:lang(or){--RS__baseFontFamily:"Oriya Sangam MN", "Nirmala UI", kalinga, roboto, noto, "Noto Sans Oriya", sans-serif;--RS__lineHeightCompensation:1.167}:lang(pa){--RS__baseFontFamily:"Gurmukhi MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Gurmukhi", sans-serif;--RS__lineHeightCompensation:1.1}:lang(si){--RS__baseFontFamily:"Sinhala Sangam MN", "Nirmala UI", "Iskoola Pota", roboto, noto, "Noto Sans Sinhala", sans-serif;--RS__lineHeightCompensation:1.167}:lang(ta){--RS__baseFontFamily:"Tamil Sangam MN", "Nirmala UI", latha, roboto, noto, "Noto Sans Tamil", sans-serif;--RS__lineHeightCompensation:1.067}:lang(te){--RS__baseFontFamily:"Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", gautami, roboto, noto, "Noto Sans Telugu", sans-serif}:lang(th){--RS__baseFontFamily:"Thonburi", "Leelawadee UI", "Cordia New", roboto, noto, "Noto Sans Thai", sans-serif;--RS__lineHeightCompensation:1.067}:lang(zh){--RS__baseFontFamily:"方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK SC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-Hant),:lang(zh-TW){--RS__baseFontFamily:"方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-HK){--RS__baseFontFamily:"方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Regular.woff2) format("woff2"),url(./assets/AccessibleDfA-Regular.woff) format("woff")}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:700;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Bold.woff2) format("woff2")}@font-face{font-family:AccessibleDfA;font-style:italic;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Italic.woff2) format("woff2")}@font-face{font-family:IA Writer Duospace;font-style:normal;font-weight:400;src:local("iAWriterDuospace-Regular"),url(./assets/iAWriterDuospace-Regular.ttf) format("truetype")}body{widows:2;orphans:2}figcaption,th,td{widows:1;orphans:1}h2,h3,h4,h5,h6,dt,hr,caption{-webkit-column-break-after:avoid;page-break-after:avoid;break-after:avoid}h1,h2,h3,h4,h5,h6,dt,figure,tr{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}body{-webkit-hyphenate-character:"-";-moz-hyphenate-character:"-";-ms-hyphenate-character:"-";hyphenate-character:"-";-webkit-hyphenate-limit-lines:3;-ms-hyphenate-limit-lines:3;hyphenate-limit-lines:3}h1,h2,h3,h4,h5,h6,dt,figcaption,pre,caption,address,center,code,var{-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none;-epub-hyphens:none;hyphens:none}body{font-variant-numeric:oldstyle-nums proportional-nums}:lang(ja) body,:lang(zh) body,:lang(ko) body{font-variant-numeric:lining-nums proportional-nums}h1,h2,h3,h4,h5,h6,dt{font-variant-numeric:lining-nums proportional-nums}table{font-variant-numeric:lining-nums tabular-nums}code,var{font-variant-ligatures:none;font-variant-numeric:lining-nums tabular-nums slashed-zero}rt{font-variant-east-asian:ruby}:lang(ar){font-variant-ligatures:common-ligatures}:lang(ko){font-kerning:normal}hr{color:inherit;border-color:currentcolor}table,th,td{border-color:currentcolor}figure,blockquote{margin:1em 5%}ul,ol{padding-left:5%}dd{margin-left:5%}pre{white-space:pre-wrap;-ms-tab-size:2;-moz-tab-size:2;-webkit-tab-size:2;tab-size:2}abbr[title],acronym[title]{text-decoration:dotted underline}nobr wbr{white-space:normal}ruby>rt,ruby>rp{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}*:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)),*:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)),*:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)),:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) cite,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) dfn,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) em,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) i,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) cite,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) dfn,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) em,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) i,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) cite,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) dfn,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) em,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) i{font-style:normal}:lang(ja) a,:lang(zh) a,:lang(ko) a{text-decoration:none}:root{--RS__maxMediaWidth:100%;--RS__maxMediaHeight:95vh;--RS__boxSizingMedia:border-box;--RS__boxSizingTable:border-box}a,a span,span a,h1,h2,h3,h4,h5,h6{word-wrap:break-word}div{max-width:var(--RS__maxMediaWidth)}img,svg|svg,video{object-fit:contain;width:auto;height:auto;max-width:var(--RS__maxMediaWidth);max-height:var(--RS__maxMediaHeight)!important;box-sizing:var(--RS__boxSizingMedia);-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}audio{max-width:100%;-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}table{max-width:var(--RS__maxMediaWidth);box-sizing:var(--RS__boxSizingTable)}
1185
- `, ni = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__compFontFamily:var(--RS__baseFontFamily);--RS__codeFontFamily:var(--RS__monospaceTf);--RS__typeScale:1.125;--RS__baseFontSize:100%;--RS__flowSpacing:1.5rem;--RS__paraSpacing:0;--RS__paraIndent:1em;--RS__linkColor:#0000EE;--RS__visitedColor:#551A8B;--RS__primaryColor:;--RS__secondaryColor:}body{font-size:var(--RS__baseFontSize)}h1,h2,h3,h4,h5,h6{font-family:var(--RS__compFontFamily)}blockquote,figure,p,pre,aside,footer,form,hr{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}p{margin-top:var(--RS__paraSpacing);margin-bottom:var(--RS__paraSpacing);text-indent:var(--RS__paraIndent)}h1+p,h2+p,h3+p,h4+p,h5+p,h6+p,hr+p{text-indent:0}pre{font-family:var(--RS__codeFontFamily)}code,kbd,samp,tt{font-family:var(--RS__codeFontFamily)}sub,sup{position:relative;font-size:67.5%;line-height:1}sub{bottom:-.2ex}sup{bottom:0}:link{color:var(--RS__linkColor)}:visited{color:var(--RS__visitedColor)}h1{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:calc(var(--RS__flowSpacing) * 2);font-size:calc(((1em * var(--RS__typeScale)) * var(--RS__typeScale)) * var(--RS__typeScale))}h2{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:var(--RS__flowSpacing);font-size:calc((1em * var(--RS__typeScale)) * var(--RS__typeScale))}h3{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:calc(1em * var(--RS__typeScale))}h4{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em}h5{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em;font-variant:small-caps}h6{margin-top:var(--RS__flowSpacing);margin-bottom:0;font-size:1em;text-transform:lowercase;font-variant:small-caps}dl,ol,ul{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}table{margin:var(--RS__flowSpacing) 0;border:1px solid currentcolor;border-collapse:collapse;empty-cells:show}thead,tbody,tfoot,table>tr{vertical-align:top}th{text-align:left}th,td{padding:4px;border:1px solid currentcolor}
1186
- `, et = (n, t) => URL.createObjectURL(new Blob([n], { type: t })), aA = (n) => n.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ht = (n) => n.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/url\((?!(https?:)?\/\/)("?)\/([^\)]+)/g, `url($2${window.location.origin}/$3`), re = (n, t) => {
1183
+ const _A = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__viewportWidth:100%;--RS__pageGutter:0;--RS__defaultLineLength:40rem;--RS__colGap:0;--RS__colCount:1;--RS__colWidth:100vw}@page{margin:0!important}:root{position:relative;-webkit-column-width:var(--RS__colWidth);-moz-column-width:var(--RS__colWidth);column-width:var(--RS__colWidth);-webkit-column-count:var(--RS__colCount);-moz-column-count:var(--RS__colCount);column-count:var(--RS__colCount);-webkit-column-gap:var(--RS__colGap);-moz-column-gap:var(--RS__colGap);column-gap:var(--RS__colGap);-moz-column-fill:auto;column-fill:auto;width:var(--RS__viewportWidth);height:100vh;max-width:var(--RS__viewportWidth);max-height:100vh;min-width:var(--RS__viewportWidth);min-height:100vh;padding:0!important;margin:0!important;font-size:1rem!important;box-sizing:border-box;-webkit-touch-callout:none}body{width:100%;max-width:var(--RS__defaultLineLength)!important;padding:0 var(--RS__pageGutter)!important;margin:0 auto!important;box-sizing:border-box}:root:not([style*=readium-noOverflow-on]) body{overflow:hidden}@supports (overflow: clip){:root:not([style*=readium-noOverflow-on]){overflow:clip}:root:not([style*=readium-noOverflow-on]) body{overflow:clip;overflow-clip-margin:content-box}}:root[style*=readium-scroll-on]{-webkit-columns:auto auto!important;-moz-columns:auto auto!important;columns:auto auto!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}:root[style*=readium-scroll-on] body{max-width:var(--RS__defaultLineLength)!important;box-sizing:border-box!important}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:auto}@supports (overflow: clip){:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]){overflow:auto}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:clip}}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingTop] body{padding-top:var(--RS__scrollPaddingTop)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingBottom] body{padding-bottom:var(--RS__scrollPaddingBottom)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingLeft] body{padding-left:var(--RS__scrollPaddingLeft)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingRight] body{padding-right:var(--RS__scrollPaddingRight)!important}:root[style*=readium-night-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#0099E5;--RS__linkColor:#63caff;--RS__textColor:#FEFEFE;--RS__backgroundColor:#000000}:root[style*=readium-night-on] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=readium-night-on] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=readium-night-on] a:link,:root[style*=readium-night-on] a:link *{color:var(--RS__linkColor)!important}:root[style*=readium-night-on] a:visited,:root[style*=readium-night-on] a:visited *{color:var(--RS__visitedColor)!important}:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-sepia-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#faf4e8}:root[style*=readium-sepia-on] *:not(a){color:inherit!important;background-color:transparent!important}:root[style*=readium-sepia-on] a:link,:root[style*=readium-sepia-on] a:link *{color:var(--RS__linkColor)}:root[style*=readium-sepia-on] a:visited,:root[style*=readium-sepia-on] a:visited *{color:var(--RS__visitedColor)}@media screen and (-ms-high-contrast: active){:root{color:windowText!important;background-color:window!important}:root :not(#\\#):not(#\\#):not(#\\#),:root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#){color:inherit!important;background-color:inherit!important}.readiumCSS-mo-active-default{color:highlightText!important;background-color:highlight!important}}@media screen and (-ms-high-contrast: white-on-black){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (inverted-colors){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}:root[style*=--USER__backgroundColor]{background-color:var(--USER__backgroundColor)!important}:root[style*=--USER__backgroundColor] *{background-color:transparent!important}:root[style*=--USER__textColor]{color:var(--USER__textColor)!important}:root[style*=--USER__textColor] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=--USER__textColor] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=--USER__linkColor] a:link,:root[style*=--USER__linkColor] a:link *{color:var(--USER__linkColor)!important}:root[style*=--USER__visitedColor] a:visited,:root[style*=--USER__visitedColor] a:visited *{color:var(--USER__visitedColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::-moz-selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__colCount]{-webkit-column-count:var(--USER__colCount);-moz-column-count:var(--USER__colCount);column-count:var(--USER__colCount);--RS__colWidth:auto}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"]{-webkit-column-count:1;-moz-column-count:1;column-count:1}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"],:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"]{--RS__colWidth:100vw}:root[style*=--USER__lineLength] body{max-width:var(--USER__lineLength)!important}:root[style*=--USER__textAlign]{text-align:var(--USER__textAlign)}:root[style*=--USER__textAlign] body,:root[style*=--USER__textAlign] p:not(blockquote p):not(figcaption p):not(hgroup p),:root[style*=--USER__textAlign] li,:root[style*=--USER__textAlign] dd{text-align:var(--USER__textAlign)!important;-moz-text-align-last:auto!important;-epub-text-align-last:auto!important;text-align-last:auto!important}:root[style*=--USER__bodyHyphens]{-webkit-hyphens:var(--USER__bodyHyphens)!important;-moz-hyphens:var(--USER__bodyHyphens)!important;-ms-hyphens:var(--USER__bodyHyphens)!important;-epub-hyphens:var(--USER__bodyHyphens)!important;hyphens:var(--USER__bodyHyphens)!important}:root[style*=--USER__bodyHyphens] body,:root[style*=--USER__bodyHyphens] p,:root[style*=--USER__bodyHyphens] li,:root[style*=--USER__bodyHyphens] div,:root[style*=--USER__bodyHyphens] dd{-webkit-hyphens:inherit;-moz-hyphens:inherit;-ms-hyphens:inherit;-epub-hyphens:inherit;hyphens:inherit}:root[style*=--USER__fontFamily]{font-family:var(--USER__fontFamily)!important}:root[style*=--USER__fontFamily] *{font-family:revert!important}:root[style*=AccessibleDfA]{font-family:AccessibleDfA,Verdana,Tahoma,Trebuchet MS,sans-serif!important}:root[style*="IA Writer Duospace"]{font-family:IA Writer Duospace,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace!important}:root[style*=AccessibleDfA],:root[style*="IA Writer Duospace"],:root[style*=readium-a11y-on]{font-style:normal!important;font-weight:400!important}:root[style*=AccessibleDfA] *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-a11y-on] *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=AccessibleDfA] *,:root[style*="IA Writer Duospace"] *,:root[style*=readium-a11y-on] *{text-decoration:none!important;font-variant-caps:normal!important;font-variant-numeric:normal!important;font-variant-position:normal!important}:root[style*=AccessibleDfA] sup,:root[style*="IA Writer Duospace"] sup,:root[style*=readium-a11y-on] sup,:root[style*=AccessibleDfA] sub,:root[style*="IA Writer Duospace"] sub,:root[style*=readium-a11y-on] sub{font-size:1rem!important;vertical-align:baseline!important}:root:not([style*=readium-deprecatedFontSize-on]):not([style*=readium-iOSPatch-on])[style*=--USER__fontSize] body{zoom:var(--USER__fontSize)!important}:root[style*=readium-iOSPatch-on][style*=--USER__fontSize] body{-webkit-text-size-adjust:var(--USER__fontSize)!important}@supports not (zoom: 1){:root[style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}}:root[style*=readium-deprecatedFontSize-on][style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}:root[style*=--USER__lineHeight]{line-height:var(--USER__lineHeight)!important}:root[style*=--USER__lineHeight] body,:root[style*=--USER__lineHeight] p,:root[style*=--USER__lineHeight] li,:root[style*=--USER__lineHeight] div{line-height:inherit}:root[style*=--USER__paraSpacing] p{margin-top:var(--USER__paraSpacing)!important;margin-bottom:var(--USER__paraSpacing)!important}:root[style*=--USER__paraIndent] p{text-indent:var(--USER__paraIndent)!important}:root[style*=--USER__paraIndent] p *,:root[style*=--USER__paraIndent] p:first-letter{text-indent:0!important}:root[style*=--USER__wordSpacing] h1,:root[style*=--USER__wordSpacing] h2,:root[style*=--USER__wordSpacing] h3,:root[style*=--USER__wordSpacing] h4,:root[style*=--USER__wordSpacing] h5,:root[style*=--USER__wordSpacing] h6,:root[style*=--USER__wordSpacing] p,:root[style*=--USER__wordSpacing] li,:root[style*=--USER__wordSpacing] div,:root[style*=--USER__wordSpacing] dt,:root[style*=--USER__wordSpacing] dd{word-spacing:var(--USER__wordSpacing)}:root[style*=--USER__letterSpacing] h1,:root[style*=--USER__letterSpacing] h2,:root[style*=--USER__letterSpacing] h3,:root[style*=--USER__letterSpacing] h4,:root[style*=--USER__letterSpacing] h5,:root[style*=--USER__letterSpacing] h6,:root[style*=--USER__letterSpacing] p,:root[style*=--USER__letterSpacing] li,:root[style*=--USER__letterSpacing] div,:root[style*=--USER__letterSpacing] dt,:root[style*=--USER__letterSpacing] dd{letter-spacing:var(--USER__letterSpacing);font-variant:none}:root[style*=--USER__fontWeight] body{font-weight:var(--USER__fontWeight)!important}:root[style*=--USER__fontWeight] b,:root[style*=--USER__fontWeight] strong{font-weight:bolder}:root[style*=--USER__fontWidth] body{font-stretch:var(--USER__fontWidth)!important}:root[style*=--USER__fontOpticalSizing] body{font-optical-sizing:var(--USER__fontOpticalSizing)!important}:root[style*=readium-blend-on] svg,:root[style*=readium-blend-on] img{background-color:transparent!important;mix-blend-mode:multiply!important}:root[style*=--USER__darkenImages] img{-webkit-filter:brightness(var(--USER__darkenImages))!important;filter:brightness(var(--USER__darkenImages))!important}:root[style*=readium-darken-on] img{-webkit-filter:brightness(80%)!important;filter:brightness(80%)!important}:root[style*=--USER__invertImages] img{-webkit-filter:invert(var(--USER__invertImages))!important;filter:invert(var(--USER__invertImages))!important}:root[style*=readium-invert-on] img{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=--USER__darkenImages][style*=--USER__invertImages] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important;filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important}:root[style*=readium-darken-on][style*=--USER__invertImages] img{-webkit-filter:brightness(80%) invert(var(--USER__invertImages))!important;filter:brightness(80%) invert(var(--USER__invertImages))!important}:root[style*=--USER__darkenImages][style*=readium-invert-on] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(100%)!important;filter:brightness(var(--USER__darkenImages)) invert(100%)!important}:root[style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%) invert(100%)!important;filter:brightness(80%) invert(100%)!important}:root[style*=--USER__invertGaiji] img[class*=gaiji]{-webkit-filter:invert(var(--USER__invertGaiji))!important;filter:invert(var(--USER__invertGaiji))!important}:root[style*=readium-invertGaiji-on] img[class*=gaiji]{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=readium-normalize-on]{--USER__typeScale:1.2}:root[style*=readium-normalize-on] p,:root[style*=readium-normalize-on] li,:root[style*=readium-normalize-on] div,:root[style*=readium-normalize-on] pre,:root[style*=readium-normalize-on] dd{font-size:1rem!important}:root[style*=readium-normalize-on] h1{font-size:1.75rem!important;font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h2{font-size:1.5rem!important;font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h3{font-size:1.25rem!important;font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h4,:root[style*=readium-normalize-on] h5,:root[style*=readium-normalize-on] h6{font-size:1rem!important}:root[style*=readium-normalize-on] small{font-size:smaller!important}:root[style*=readium-normalize-on] sub,:root[style*=readium-normalize-on] sup{font-size:67.5%!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h1{font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h2{font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h3{font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-iPadOSPatch-on] body{-webkit-text-size-adjust:none}:root[style*=readium-iPadOSPatch-on] p,:root[style*=readium-iPadOSPatch-on] h1,:root[style*=readium-iPadOSPatch-on] h2,:root[style*=readium-iPadOSPatch-on] h3,:root[style*=readium-iPadOSPatch-on] h4,:root[style*=readium-iPadOSPatch-on] h5,:root[style*=readium-iPadOSPatch-on] h6,:root[style*=readium-iPadOSPatch-on] li,:root[style*=readium-iPadOSPatch-on] th,:root[style*=readium-iPadOSPatch-on] td,:root[style*=readium-iPadOSPatch-on] dt,:root[style*=readium-iPadOSPatch-on] dd,:root[style*=readium-iPadOSPatch-on] pre,:root[style*=readium-iPadOSPatch-on] address,:root[style*=readium-iPadOSPatch-on] details,:root[style*=readium-iPadOSPatch-on] summary,:root[style*=readium-iPadOSPatch-on] figcaption,:root[style*=readium-iPadOSPatch-on] div:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)),:root[style*=readium-iPadOSPatch-on] aside:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)){-webkit-text-zoom:reset}:root[style*=readium-iPadOSPatch-on] abbr,:root[style*=readium-iPadOSPatch-on] b,:root[style*=readium-iPadOSPatch-on] bdi,:root[style*=readium-iPadOSPatch-on] bdo,:root[style*=readium-iPadOSPatch-on] cite,:root[style*=readium-iPadOSPatch-on] code,:root[style*=readium-iPadOSPatch-on] dfn,:root[style*=readium-iPadOSPatch-on] em,:root[style*=readium-iPadOSPatch-on] i,:root[style*=readium-iPadOSPatch-on] kbd,:root[style*=readium-iPadOSPatch-on] mark,:root[style*=readium-iPadOSPatch-on] q,:root[style*=readium-iPadOSPatch-on] rp,:root[style*=readium-iPadOSPatch-on] rt,:root[style*=readium-iPadOSPatch-on] ruby,:root[style*=readium-iPadOSPatch-on] s,:root[style*=readium-iPadOSPatch-on] samp,:root[style*=readium-iPadOSPatch-on] small,:root[style*=readium-iPadOSPatch-on] span,:root[style*=readium-iPadOSPatch-on] strong,:root[style*=readium-iPadOSPatch-on] sub,:root[style*=readium-iPadOSPatch-on] sup,:root[style*=readium-iPadOSPatch-on] time,:root[style*=readium-iPadOSPatch-on] u,:root[style*=readium-iPadOSPatch-on] var{-webkit-text-zoom:normal}:root[style*=readium-iPadOSPatch-on] p:not(:has(b,cite,em,i,q,s,small,span,strong)):first-line{-webkit-text-zoom:normal}
1184
+ `, $A = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);@-ms-viewport{width:device-width}@viewport{width:device-width;zoom:1}:root{--RS__monospaceTf:ui-monospace, "Andale Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;--RS__humanistTf:Seravek, Calibri, "Gill Sans Nova", Roboto, Ubuntu, "DejaVu Sans", source-sans-pro, sans-serif;--RS__sansTf:-ui-sans-serif, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", "Arial Nova", "Liberation Sans", Arial, sans-serif;--RS__modernTf:Athelas, Constantia, Charter, "Bitstream Charter", Cambria, "Georgia Pro", Georgia, serif;--RS__oldStyleTf:"Iowan Old Style", Sitka, "Sitka Text", Palatino, "Book Antiqua", "URW Palladio L", P052, serif;--RS__baseFontFamily:var(--RS__oldStyleTf);--RS__lineHeightCompensation:1;--RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation));--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#FFFFFF;color:var(--RS__textColor)!important;background-color:var(--RS__backgroundColor)!important}::-moz-selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}::selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}html{font-family:var(--RS__baseFontFamily);line-height:1.6;line-height:var(--RS__baseLineHeight);text-rendering:optimizelegibility}h1,h2,h3{line-height:normal}:lang(ja),:lang(zh),:lang(ko){word-wrap:break-word;-webkit-line-break:strict;-epub-line-break:strict;line-break:strict}math{font-family:"Latin Modern Math","STIX Two Math","XITS Math","STIX Math","Libertinus Math","TeX Gyre Termes Math","TeX Gyre Bonum Math",TeX Gyre Schola,"DejaVu Math TeX Gyre","TeX Gyre Pagella Math","Asana Math","Cambria Math","Lucida Bright Math","Minion Math",STIXGeneral,STIXSizeOneSym,Symbol,Times New Roman,serif}:lang(am){--RS__baseFontFamily:kefa, nyala, roboto, noto, "Noto Sans Ethiopic", serif;--RS__lineHeightCompensation:1.167}:lang(ar){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(bn){--RS__baseFontFamily:"Kohinoor Bangla", "Bangla Sangam MN", vrinda, roboto, noto, "Noto Sans Bengali", sans-serif;--RS__lineHeightCompensation:1.067}:lang(bo){--RS__baseFontFamily:kailasa, "Microsoft Himalaya", roboto, noto, "Noto Sans Tibetan", sans-serif}:lang(chr){--RS__baseFontFamily:"Plantagenet Cherokee", roboto, noto, "Noto Sans Cherokee";--RS__lineHeightCompensation:1.167}:lang(fa){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(gu){--RS__baseFontFamily:"Gujarati Sangam MN", "Nirmala UI", shruti, roboto, noto, "Noto Sans Gujarati", sans-serif;--RS__lineHeightCompensation:1.167}:lang(he){--RS__baseFontFamily:"New Peninim MT", "Arial Hebrew", gisha, "Times New Roman", roboto, noto, "Noto Sans Hebrew" sans-serif;--RS__lineHeightCompensation:1.1}:lang(hi){--RS__baseFontFamily:"Kohinoor Devanagari", "Devanagari Sangam MN", kokila, "Nirmala UI", roboto, noto, "Noto Sans Devanagari", sans-serif;--RS__lineHeightCompensation:1.1}:lang(hy){--RS__baseFontFamily:mshtakan, sylfaen, roboto, noto, "Noto Serif Armenian", serif}:lang(iu){--RS__baseFontFamily:"Euphemia UCAS", euphemia, roboto, noto, "Noto Sans Canadian Aboriginal", sans-serif}:lang(ja){--RS__baseFontFamily:yugothic, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "MS Gothic", roboto, noto, "Noto Sans CJK JP", sans-serif;--RS__lineHeightCompensation:1.167;--RS__serif-ja:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDPMincho", "Yu Mincho", "MS P明朝", "MS PMincho", serif;--RS__sans-serif-ja:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDPGothic", "Yu Gothic", "MS Pゴシック", "MS PGothic", sans-serif;--RS__serif-ja-v:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDMincho", "Yu Mincho", "MS明朝", "MS Mincho", serif;--RS__sans-serif-ja-v:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDGothic", "Yu Gothic", "MSゴシック", "MS Gothic", sans-serif}:lang(km){--RS__baseFontFamily:"Khmer Sangam MN", "Leelawadee UI", "Khmer UI", roboto, noto, "Noto Sans Khmer", sans-serif;--RS__lineHeightCompensation:1.067}:lang(kn){--RS__baseFontFamily:"Kannada Sangam MN", "Nirmala UI", tunga, roboto, noto, "Noto Sans Kannada", sans-serif;--RS__lineHeightCompensation:1.1}:lang(ko){--RS__baseFontFamily:"Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", roboto, noto, "Noto Sans CJK KR", sans-serif;--RS__lineHeightCompensation:1.167}:lang(lo){--RS__baseFontFamily:"Lao Sangam MN", "Leelawadee UI", "Lao UI", roboto, noto, "Noto Sans Lao", sans-serif}:lang(ml){--RS__baseFontFamily:"Malayalam Sangam MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Malayalam", sans-serif;--RS__lineHeightCompensation:1.067}:lang(or){--RS__baseFontFamily:"Oriya Sangam MN", "Nirmala UI", kalinga, roboto, noto, "Noto Sans Oriya", sans-serif;--RS__lineHeightCompensation:1.167}:lang(pa){--RS__baseFontFamily:"Gurmukhi MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Gurmukhi", sans-serif;--RS__lineHeightCompensation:1.1}:lang(si){--RS__baseFontFamily:"Sinhala Sangam MN", "Nirmala UI", "Iskoola Pota", roboto, noto, "Noto Sans Sinhala", sans-serif;--RS__lineHeightCompensation:1.167}:lang(ta){--RS__baseFontFamily:"Tamil Sangam MN", "Nirmala UI", latha, roboto, noto, "Noto Sans Tamil", sans-serif;--RS__lineHeightCompensation:1.067}:lang(te){--RS__baseFontFamily:"Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", gautami, roboto, noto, "Noto Sans Telugu", sans-serif}:lang(th){--RS__baseFontFamily:"Thonburi", "Leelawadee UI", "Cordia New", roboto, noto, "Noto Sans Thai", sans-serif;--RS__lineHeightCompensation:1.067}:lang(zh){--RS__baseFontFamily:"方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK SC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-Hant),:lang(zh-TW){--RS__baseFontFamily:"方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-HK){--RS__baseFontFamily:"方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Regular.woff2) format("woff2"),url(./assets/AccessibleDfA-Regular.woff) format("woff")}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:700;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Bold.woff2) format("woff2")}@font-face{font-family:AccessibleDfA;font-style:italic;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Italic.woff2) format("woff2")}@font-face{font-family:IA Writer Duospace;font-style:normal;font-weight:400;src:local("iAWriterDuospace-Regular"),url(./assets/iAWriterDuospace-Regular.ttf) format("truetype")}body{widows:2;orphans:2}figcaption,th,td{widows:1;orphans:1}h2,h3,h4,h5,h6,dt,hr,caption{-webkit-column-break-after:avoid;page-break-after:avoid;break-after:avoid}h1,h2,h3,h4,h5,h6,dt,figure,tr{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}body{-webkit-hyphenate-character:"-";-moz-hyphenate-character:"-";-ms-hyphenate-character:"-";hyphenate-character:"-";-webkit-hyphenate-limit-lines:3;-ms-hyphenate-limit-lines:3;hyphenate-limit-lines:3}h1,h2,h3,h4,h5,h6,dt,figcaption,pre,caption,address,center,code,var{-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none;-epub-hyphens:none;hyphens:none}body{font-variant-numeric:oldstyle-nums proportional-nums}:lang(ja) body,:lang(zh) body,:lang(ko) body{font-variant-numeric:lining-nums proportional-nums}h1,h2,h3,h4,h5,h6,dt{font-variant-numeric:lining-nums proportional-nums}table{font-variant-numeric:lining-nums tabular-nums}code,var{font-variant-ligatures:none;font-variant-numeric:lining-nums tabular-nums slashed-zero}rt{font-variant-east-asian:ruby}:lang(ar){font-variant-ligatures:common-ligatures}:lang(ko){font-kerning:normal}hr{color:inherit;border-color:currentcolor}table,th,td{border-color:currentcolor}figure,blockquote{margin:1em 5%}ul,ol{padding-left:5%}dd{margin-left:5%}pre{white-space:pre-wrap;-ms-tab-size:2;-moz-tab-size:2;-webkit-tab-size:2;tab-size:2}abbr[title],acronym[title]{text-decoration:dotted underline}nobr wbr{white-space:normal}ruby>rt,ruby>rp{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}*:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)),*:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)),*:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)),:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) cite,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) dfn,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) em,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) i,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) cite,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) dfn,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) em,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) i,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) cite,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) dfn,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) em,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) i{font-style:normal}:lang(ja) a,:lang(zh) a,:lang(ko) a{text-decoration:none}:root{--RS__maxMediaWidth:100%;--RS__maxMediaHeight:95vh;--RS__boxSizingMedia:border-box;--RS__boxSizingTable:border-box}a,a span,span a,h1,h2,h3,h4,h5,h6{word-wrap:break-word}div{max-width:var(--RS__maxMediaWidth)}img,svg|svg,video{object-fit:contain;width:auto;height:auto;max-width:var(--RS__maxMediaWidth);max-height:var(--RS__maxMediaHeight)!important;box-sizing:var(--RS__boxSizingMedia);-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}audio{max-width:100%;-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}table{max-width:var(--RS__maxMediaWidth);box-sizing:var(--RS__boxSizingTable)}
1185
+ `, ti = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__compFontFamily:var(--RS__baseFontFamily);--RS__codeFontFamily:var(--RS__monospaceTf);--RS__typeScale:1.125;--RS__baseFontSize:100%;--RS__flowSpacing:1.5rem;--RS__paraSpacing:0;--RS__paraIndent:1em;--RS__linkColor:#0000EE;--RS__visitedColor:#551A8B;--RS__primaryColor:;--RS__secondaryColor:}body{font-size:var(--RS__baseFontSize)}h1,h2,h3,h4,h5,h6{font-family:var(--RS__compFontFamily)}blockquote,figure,p,pre,aside,footer,form,hr{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}p{margin-top:var(--RS__paraSpacing);margin-bottom:var(--RS__paraSpacing);text-indent:var(--RS__paraIndent)}h1+p,h2+p,h3+p,h4+p,h5+p,h6+p,hr+p{text-indent:0}pre{font-family:var(--RS__codeFontFamily)}code,kbd,samp,tt{font-family:var(--RS__codeFontFamily)}sub,sup{position:relative;font-size:67.5%;line-height:1}sub{bottom:-.2ex}sup{bottom:0}:link{color:var(--RS__linkColor)}:visited{color:var(--RS__visitedColor)}h1{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:calc(var(--RS__flowSpacing) * 2);font-size:calc(((1em * var(--RS__typeScale)) * var(--RS__typeScale)) * var(--RS__typeScale))}h2{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:var(--RS__flowSpacing);font-size:calc((1em * var(--RS__typeScale)) * var(--RS__typeScale))}h3{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:calc(1em * var(--RS__typeScale))}h4{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em}h5{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em;font-variant:small-caps}h6{margin-top:var(--RS__flowSpacing);margin-bottom:0;font-size:1em;text-transform:lowercase;font-variant:small-caps}dl,ol,ul{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}table{margin:var(--RS__flowSpacing) 0;border:1px solid currentcolor;border-collapse:collapse;empty-cells:show}thead,tbody,tfoot,table>tr{vertical-align:top}th{text-align:left}th,td{padding:4px;border:1px solid currentcolor}
1186
+ `, $ = (n, t) => URL.createObjectURL(new Blob([n], { type: t })), rA = (n) => n.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), vt = (n) => n.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/url\((?!(https?:)?\/\/)("?)\/([^\)]+)/g, `url($2${window.location.origin}/$3`), ie = (n, t) => {
1187
1187
  const e = n.createElement("script");
1188
- return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t : et(t, "text/javascript"), e;
1189
- }, kt = (n, t) => {
1188
+ return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t : $(t, "text/javascript"), e;
1189
+ }, bt = (n, t) => {
1190
1190
  const e = n.createElement("link");
1191
- return e.dataset.readium = "true", e.rel = "stylesheet", e.type = "text/css", e.href = t.startsWith("blob:") ? t : et(t, "text/css"), e;
1192
- }, Jt = /* @__PURE__ */ new Map(), lt = (n, t) => {
1193
- if (Jt.has(n))
1194
- return Jt.get(n);
1191
+ return e.dataset.readium = "true", e.rel = "stylesheet", e.type = "text/css", e.href = t.startsWith("blob:") ? t : $(t, "text/css"), e;
1192
+ }, Gt = /* @__PURE__ */ new Map(), st = (n, t) => {
1193
+ if (Gt.has(n))
1194
+ return Gt.get(n);
1195
1195
  const e = t();
1196
- return Jt.set(n, e), e;
1197
- }, ri = (n) => re(n, lt("css-selector-generator", () => et(
1196
+ return Gt.set(n, e), e;
1197
+ }, ei = (n) => ie(n, st("css-selector-generator", () => $(
1198
1198
  '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t,e,n={d:(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};function r(t){return t&&t instanceof Element}function i(t="unknown problem",...e){console.warn(`CssSelectorGenerator: ${t}`,...e)}n.r(o),n.d(o,{default:()=>z,getCssSelector:()=>U}),function(t){t.NONE="none",t.DESCENDANT="descendant",t.CHILD="child"}(t||(t={})),function(t){t.id="id",t.class="class",t.tag="tag",t.attribute="attribute",t.nthchild="nthchild",t.nthoftype="nthoftype"}(e||(e={}));const c={selectors:[e.id,e.class,e.tag,e.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function u(t){return t instanceof RegExp}function s(t){return["string","function"].includes(typeof t)||u(t)}function l(t){return Array.isArray(t)?t.filter(s):[]}function a(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function f(t,e){if(a(t))return t.contains(e)||i("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const n=e.getRootNode({composed:!1});return a(n)?(n!==document&&i("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):e.ownerDocument.querySelector(":root")}function d(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function m(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function p(t){return[].concat(...t)}function h(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(i("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return i("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function g(t,e,n){const o=Array.from(f(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const n=[];let o=t;for(;r(o)&&o!==e;)n.push(o),o=o.parentElement;return n}function b(t,e){return m(t.map((t=>y(t,e))))}const N={[t.NONE]:{type:t.NONE,value:""},[t.DESCENDANT]:{type:t.DESCENDANT,value:" > "},[t.CHILD]:{type:t.CHILD,value:" "}},S=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),w=[e.nthoftype,e.tag,e.id,e.class,e.attribute,e.nthchild],v=h(["class","id","ng-*"]);function C({nodeName:t}){return`[${t}]`}function O({nodeName:t,nodeValue:e}){return`[${t}=\'${L(e)}\']`}function T(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const n=e.tagName.toLowerCase();return!(["input","option"].includes(n)&&"value"===t||v(t))}(e,t)));return[...e.map(C),...e.map(O)]}function I(t){return(t.getAttribute("class")||"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${L(t)}`))}function x(t){const e=t.getAttribute("id")||"",n=`#${L(e)}`,o=t.getRootNode({composed:!1});return!S.test(e)&&g([t],n,o)?[n]:[]}function j(t){const e=t.parentNode;if(e){const n=Array.from(e.childNodes).filter(r).indexOf(t);if(n>-1)return[`:nth-child(${n+1})`]}return[]}function A(t){return[L(t.tagName.toLowerCase())]}function D(t){const e=[...new Set(p(t.map(A)))];return 0===e.length||e.length>1?[]:[e[0]]}function $(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${r+1})`]}return[]}function R(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){const n=[];let o=0,r=k(1);for(;r.length<=t.length&&o<e;)o+=1,n.push(r.map((e=>t[e]))),r=P(r,t.length-1);return n}function P(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return k(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?k(n+1):o}function k(t=1){return Array.from(Array(t).keys())}const _=":".charCodeAt(0).toString(16).toUpperCase(),M=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function L(t=""){var e,n;return null!==(n=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==n?n:function(t=""){return t.split("").map((t=>":"===t?`\\\\${_} `:M.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const q={tag:D,id:function(t){return 0===t.length||t.length>1?[]:x(t[0])},class:function(t){return m(t.map(I))},attribute:function(t){return m(t.map(T))},nthchild:function(t){return m(t.map(j))},nthoftype:function(t){return m(t.map($))}},F={tag:A,id:x,class:I,attribute:T,nthchild:j,nthoftype:$};function V(t){return t.includes(e.tag)||t.includes(e.nthoftype)?[...t]:[...t,e.tag]}function Y(t={}){const n=[...w];return t[e.tag]&&t[e.nthoftype]&&n.splice(n.indexOf(e.tag),1),n.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function B(t,e,n="",o){const r=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+" "+t)),...t.map((t=>e+" > "+t))]}(t,e)}(function(t,e,n){const o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=h(n),u=h(o);return function(t){const{selectors:e,includeTag:n}=t,o=[].concat(e);return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){var n;return(null!==(n=q[e])&&void 0!==n?n:()=>[])(t)}(t,n),s=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,u),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(s,u);return e[n]=r?R(l,{maxResults:i}):l.map((t=>[t])),e}),{})}(t,n),r=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?R(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(V):i}(e).map((e=>function(t,e){const n={};return t.forEach((t=>{const o=e[t];o.length>0&&(n[t]=o)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,n])=>{e=n.flatMap((n=>0===e.length?[{[t]:n}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:n})))))})),e}(n).map(Y)}(e,t))).filter((t=>t.length>0))}(o,n),i=p(r);return[...new Set(i)]}(t,o.root,o),n);for(const e of r)if(g(t,e,o.root))return e;return null}function G(t){return{value:t,include:!1}}function W({selectors:t,operator:n}){let o=[...w];t[e.tag]&&t[e.nthoftype]&&(o=o.filter((t=>t!==e.tag)));let r="";return o.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(r+=t)}))})),n.value+r}function H(n){return[":root",...y(n).reverse().map((n=>{const o=function(e,n,o=t.NONE){const r={};return n.forEach((t=>{Reflect.set(r,t,function(t,e){return F[e](t)}(e,t).map(G))})),{element:e,operator:N[o],selectors:r}}(n,[e.nthchild],t.DESCENDANT);return o.selectors.nthchild.forEach((t=>{t.include=!0})),o})).map(W)].join("")}function U(t,n={}){const o=function(t){const e=(Array.isArray(t)?t:[t]).filter(r);return[...new Set(e)]}(t),i=function(t,n={}){const o=Object.assign(Object.assign({},c),n);return{selectors:(r=o.selectors,Array.isArray(r)?r.filter((t=>{return n=e,o=t,Object.values(n).includes(o);var n,o})):[]),whitelist:l(o.whitelist),blacklist:l(o.blacklist),root:f(o.root,t),combineWithinSelector:!!o.combineWithinSelector,combineBetweenSelectors:!!o.combineBetweenSelectors,includeTag:!!o.includeTag,maxCombinations:d(o.maxCombinations),maxCandidates:d(o.maxCandidates)};var r}(o[0],n);let u="",s=i.root;function a(){return function(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r){const e=B(t,0,n,o);if(e)return{foundElements:t,selector:e}}return null}(o,s,u,i)}let m=a();for(;m;){const{foundElements:t,selector:e}=m;if(g(o,e,i.root))return e;s=t[0],u=e,m=a()}return o.length>1?o.map((t=>U(t,i))).join(", "):function(t){return t.map(H).join(", ")}(o)}const z=U;return o})()));',
1199
1199
  "text/javascript"
1200
- ))), si = (n) => re(n, lt("JS-Before", () => et(aA(
1200
+ ))), Ai = (n) => ie(n, st("JS-Before", () => $(rA(
1201
1201
  `
1202
1202
  window._readium_blockedEvents = [];
1203
1203
  window._readium_blockEvents = true;
@@ -1211,7 +1211,7 @@ const Ai = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(htt
1211
1211
  };
1212
1212
  window.addEventListener("DOMContentLoaded", window._readium_eventBlocker, true);
1213
1213
  window.addEventListener("load", window._readium_eventBlocker, true);`
1214
- ), "text/javascript"))), oi = (n) => re(n, lt("JS-After", () => et(aA(
1214
+ ), "text/javascript"))), ii = (n) => ie(n, st("JS-After", () => $(rA(
1215
1215
  `
1216
1216
  if(window.onload) window.onload = new Proxy(window.onload, {
1217
1217
  apply: function(target, receiver, args) {
@@ -1225,7 +1225,7 @@ const Ai = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(htt
1225
1225
  }
1226
1226
  });`
1227
1227
  ), "text/javascript")));
1228
- class lA {
1228
+ class sA {
1229
1229
  constructor(t, e, A, i) {
1230
1230
  this.pub = t, this.item = A, this.burl = A.toURL(e) || "", this.cssProperties = i;
1231
1231
  }
@@ -1275,25 +1275,25 @@ class lA {
1275
1275
  if (!t)
1276
1276
  return "";
1277
1277
  if (!i) {
1278
- const a = kt(t, lt("ReadiumCSS-before", () => et(Ht(ii), "text/css")));
1279
- t.head.firstChild ? t.head.firstChild.before(a) : t.head.appendChild(a), this.hasStyle(t) || a.after(kt(t, lt("ReadiumCSS-default", () => et(Ht(ni), "text/css")))), t.head.appendChild(kt(t, lt("ReadiumCSS-after", () => et(Ht(Ai), "text/css")))), r && this.setProperties(r, t);
1278
+ const a = bt(t, st("ReadiumCSS-before", () => $(vt($A), "text/css")));
1279
+ t.head.firstChild ? t.head.firstChild.before(a) : t.head.appendChild(a), this.hasStyle(t) || a.after(bt(t, st("ReadiumCSS-default", () => $(vt(ti), "text/css")))), t.head.appendChild(bt(t, st("ReadiumCSS-after", () => $(vt(_A), "text/css")))), r && this.setProperties(r, t);
1280
1280
  }
1281
1281
  if (t.body.querySelectorAll("img").forEach((a) => {
1282
1282
  a.setAttribute("fetchpriority", "high");
1283
1283
  }), A.isHTML && ((o = this.pub.metadata.languages) != null && o[0])) {
1284
1284
  const a = this.pub.metadata.languages[0];
1285
- if (A === zt.XHTML) {
1285
+ if (A === Ct.XHTML) {
1286
1286
  const l = document.documentElement.lang || document.documentElement.getAttribute("xml:lang"), h = document.body.lang || document.body.getAttribute("xml:lang");
1287
1287
  h && !l ? (document.documentElement.lang = h, document.documentElement.setAttribute("xml:lang", h), document.body.removeAttribute("xml:lang"), document.body.removeAttribute("lang")) : l || (document.documentElement.lang = a, document.documentElement.setAttribute("xml:lang", a));
1288
1288
  } else
1289
- A === zt.HTML && !document.documentElement.lang && (document.documentElement.lang = a);
1289
+ A === Ct.HTML && !document.documentElement.lang && (document.documentElement.lang = a);
1290
1290
  }
1291
1291
  if (e !== void 0) {
1292
1292
  const a = t.createElement("base");
1293
1293
  a.href = e, a.dataset.readium = "true", t.head.firstChild.before(a);
1294
1294
  }
1295
1295
  const s = this.hasExecutable(t);
1296
- return s && t.head.firstChild.before(si(t)), t.head.firstChild.before(ri(t)), s && t.head.appendChild(oi(t)), URL.createObjectURL(
1296
+ return s && t.head.firstChild.before(Ai(t)), t.head.firstChild.before(ei(t)), s && t.head.appendChild(ii(t)), URL.createObjectURL(
1297
1297
  new Blob([new XMLSerializer().serializeToString(t)], {
1298
1298
  type: A.isHTML ? A.string : "application/xhtml+xml"
1299
1299
  // Fallback to XHTML
@@ -1301,8 +1301,8 @@ class lA {
1301
1301
  );
1302
1302
  }
1303
1303
  }
1304
- const ai = Math.pow(2, 32), Fe = () => Math.round(Math.random() * ai).toString(36), qt = () => `${Math.round(performance.now())}-${Fe()}-${Fe()}`, ot = 1;
1305
- class li {
1304
+ const ni = Math.pow(2, 32), we = () => Math.round(Math.random() * ni).toString(36), Ot = () => `${Math.round(performance.now())}-${we()}-${we()}`, rt = 1;
1305
+ class ri {
1306
1306
  constructor(t) {
1307
1307
  this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = t, t.addEventListener("message", this.receiver);
1308
1308
  }
@@ -1315,8 +1315,8 @@ class li {
1315
1315
  if (!(!("_readium" in e) || !e._readium || e._readium <= 0)) {
1316
1316
  if (e.key === "_ping") {
1317
1317
  if (!this.destination) {
1318
- if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !== ot) {
1319
- e._readium > ot ? this.send("error", `received comms version ${e._readium} higher than ${ot}`) : this.send("error", `received comms version ${e._readium} lower than ${ot}`), this.destination = null, this.origin = "", this.channelId = "";
1318
+ if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !== rt) {
1319
+ e._readium > rt ? this.send("error", `received comms version ${e._readium} higher than ${rt}`) : this.send("error", `received comms version ${e._readium} lower than ${rt}`), this.destination = null, this.origin = "", this.channelId = "";
1320
1320
  return;
1321
1321
  }
1322
1322
  this.send("_pong", void 0), this.preLog.forEach((A) => this.send("log", A)), this.preLog = [];
@@ -1379,9 +1379,9 @@ class li {
1379
1379
  if (!this.destination)
1380
1380
  throw Error("Attempted to send comms message before destination has been initialized");
1381
1381
  const r = {
1382
- _readium: ot,
1382
+ _readium: rt,
1383
1383
  _channel: this.channelId,
1384
- id: A ?? qt(),
1384
+ id: A ?? Ot(),
1385
1385
  // scrict,
1386
1386
  key: t,
1387
1387
  data: e
@@ -1398,42 +1398,35 @@ class li {
1398
1398
  }
1399
1399
  }
1400
1400
  }
1401
- const K = class at {
1401
+ class ne {
1402
+ /**
1403
+ * Creates a [Encryption].
1404
+ */
1402
1405
  constructor(t) {
1403
- if (typeof t == "string") {
1404
- if (!at.VALID_MODES.has(t.toLowerCase()))
1405
- return;
1406
- this.value = t.toLowerCase();
1407
- } else {
1408
- const e = t.filter(
1409
- (A) => at.VALID_MODES.has(A.toLowerCase())
1410
- );
1411
- if (e.length === 0)
1412
- return;
1413
- this.value = Array.from(new Set(e));
1414
- }
1406
+ this.algorithm = t.algorithm, this.compression = t.compression, this.originalLength = t.originalLength, this.profile = t.profile, this.scheme = t.scheme;
1415
1407
  }
1408
+ /**
1409
+ * Parses a [Encryption] from its RWPM JSON representation.
1410
+ */
1416
1411
  static deserialize(t) {
1417
- if (!t)
1418
- return;
1419
- if (typeof t == "string")
1420
- return new at(t);
1421
- if (!Array.isArray(t))
1422
- return;
1423
- const e = t.filter((A) => A ? at.VALID_MODES.has(A.toLowerCase()) : !1);
1424
- if (e.length !== 0)
1425
- return new at(e);
1412
+ if (t && t.algorithm)
1413
+ return new ne({
1414
+ algorithm: t.algorithm,
1415
+ compression: t.compression,
1416
+ originalLength: t.originalLength,
1417
+ profile: t.profile,
1418
+ scheme: t.scheme
1419
+ });
1426
1420
  }
1421
+ /**
1422
+ * Serializes a [Encryption] to its RWPM JSON representation.
1423
+ */
1427
1424
  serialize() {
1428
- return this.value;
1425
+ const t = { algorithm: this.algorithm };
1426
+ return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
1429
1427
  }
1430
- };
1431
- K.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]);
1432
- K.AUDITORY = new K("auditory");
1433
- K.TACTILE = new K("tactile");
1434
- K.TEXTUAL = new K("textual");
1435
- K.VISUAL = new K("visual");
1436
- class Q {
1428
+ }
1429
+ class R {
1437
1430
  constructor(t) {
1438
1431
  this.otherProperties = t;
1439
1432
  }
@@ -1442,7 +1435,7 @@ class Q {
1442
1435
  */
1443
1436
  static deserialize(t) {
1444
1437
  if (t)
1445
- return new Q(t);
1438
+ return new R(t);
1446
1439
  }
1447
1440
  /**
1448
1441
  * Serializes a [Properties] to its RWPM JSON representation.
@@ -1457,13 +1450,18 @@ class Q {
1457
1450
  const e = Object.assign({}, this.otherProperties);
1458
1451
  for (const A in t)
1459
1452
  e[A] = t[A];
1460
- return new Q(e);
1453
+ return new R(e);
1461
1454
  }
1462
1455
  }
1463
- Q.prototype.getContains = function() {
1456
+ Object.defineProperty(R.prototype, "encryption", {
1457
+ get: function() {
1458
+ return ne.deserialize(this.otherProperties.encrypted);
1459
+ }
1460
+ });
1461
+ R.prototype.getContains = function() {
1464
1462
  return new Set(this.otherProperties.contains || []);
1465
1463
  };
1466
- Q.prototype.getLayout = function() {
1464
+ R.prototype.getLayout = function() {
1467
1465
  return this.otherProperties.layout;
1468
1466
  };
1469
1467
  class d {
@@ -1921,7 +1919,7 @@ class d {
1921
1919
  });
1922
1920
  }
1923
1921
  }
1924
- class Ue {
1922
+ class Ie {
1925
1923
  constructor(t) {
1926
1924
  this.uri = t, this.parameters = this.getParameters(t);
1927
1925
  }
@@ -1949,26 +1947,26 @@ class Ue {
1949
1947
  return this.uri.replace(/\{(\??)([^}]+)\}/g, (...i) => i[1] ? A(i[2]) : e(i[2]));
1950
1948
  }
1951
1949
  }
1952
- function hi(n) {
1950
+ function si(n) {
1953
1951
  return n && n instanceof Array ? n : void 0;
1954
1952
  }
1955
- function hA(n) {
1956
- return n && typeof n == "string" ? [n] : hi(n);
1953
+ function oA(n) {
1954
+ return n && typeof n == "string" ? [n] : si(n);
1957
1955
  }
1958
- function ye(n) {
1956
+ function Fe(n) {
1959
1957
  return typeof n == "string" ? new Date(n) : void 0;
1960
1958
  }
1961
- function yt(n) {
1959
+ function wt(n) {
1962
1960
  return isNaN(n) ? void 0 : n;
1963
1961
  }
1964
- function D(n) {
1965
- return yt(n) !== void 0 && Math.sign(n) >= 0 ? n : void 0;
1962
+ function P(n) {
1963
+ return wt(n) !== void 0 && Math.sign(n) >= 0 ? n : void 0;
1966
1964
  }
1967
- function ci(n) {
1965
+ function oi(n) {
1968
1966
  const t = new Array();
1969
1967
  return n.forEach((e) => t.push(e)), t;
1970
1968
  }
1971
- class Y {
1969
+ class z {
1972
1970
  /**
1973
1971
  * Creates a [Locations].
1974
1972
  */
@@ -1981,7 +1979,7 @@ class Y {
1981
1979
  static deserialize(t) {
1982
1980
  if (!t)
1983
1981
  return;
1984
- const e = yt(t.progression), A = yt(t.totalProgression), i = yt(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
1982
+ const e = wt(t.progression), A = wt(t.totalProgression), i = wt(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
1985
1983
  "fragment",
1986
1984
  "fragments",
1987
1985
  "progression",
@@ -1990,8 +1988,8 @@ class Y {
1990
1988
  ]);
1991
1989
  return Object.entries(t).forEach(([o, a]) => {
1992
1990
  s.has(o) || r.set(o, a);
1993
- }), new Y({
1994
- fragments: hA(t.fragments || t.fragment),
1991
+ }), new z({
1992
+ fragments: oA(t.fragments || t.fragment),
1995
1993
  progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
1996
1994
  totalProgression: A !== void 0 && A >= 0 && A <= 1 ? A : void 0,
1997
1995
  position: i !== void 0 && i > 0 ? i : void 0,
@@ -2006,7 +2004,7 @@ class Y {
2006
2004
  return this.fragments && (t.fragments = this.fragments), this.progression !== void 0 && (t.progression = this.progression), this.totalProgression !== void 0 && (t.totalProgression = this.totalProgression), this.position !== void 0 && (t.position = this.position), this.otherLocations && this.otherLocations.forEach((e, A) => t[A] = e), t;
2007
2005
  }
2008
2006
  }
2009
- class mt {
2007
+ class ct {
2010
2008
  /**
2011
2009
  * Creates a [Text].
2012
2010
  */
@@ -2018,7 +2016,7 @@ class mt {
2018
2016
  */
2019
2017
  static deserialize(t) {
2020
2018
  if (t)
2021
- return new mt({
2019
+ return new ct({
2022
2020
  after: t.after,
2023
2021
  before: t.before,
2024
2022
  highlight: t.highlight
@@ -2032,24 +2030,24 @@ class mt {
2032
2030
  return this.after !== void 0 && (t.after = this.after), this.before !== void 0 && (t.before = this.before), this.highlight !== void 0 && (t.highlight = this.highlight), t;
2033
2031
  }
2034
2032
  }
2035
- class At {
2033
+ class tt {
2036
2034
  /**
2037
2035
  * Creates a [Locator].
2038
2036
  */
2039
2037
  constructor(t) {
2040
- this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new Y({}), this.text = t.text;
2038
+ this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new z({}), this.text = t.text;
2041
2039
  }
2042
2040
  /**
2043
2041
  * Parses a [Link] from its RWPM JSON representation.
2044
2042
  */
2045
2043
  static deserialize(t) {
2046
2044
  if (t && t.href && t.type)
2047
- return new At({
2045
+ return new tt({
2048
2046
  href: t.href,
2049
2047
  type: t.type,
2050
2048
  title: t.title,
2051
- locations: Y.deserialize(t.locations),
2052
- text: mt.deserialize(t.text)
2049
+ locations: z.deserialize(t.locations),
2050
+ text: ct.deserialize(t.text)
2053
2051
  });
2054
2052
  }
2055
2053
  /**
@@ -2063,16 +2061,16 @@ class At {
2063
2061
  * Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
2064
2062
  */
2065
2063
  copyWithLocations(t) {
2066
- return new At({
2064
+ return new tt({
2067
2065
  href: this.href,
2068
2066
  type: this.type,
2069
2067
  title: this.title,
2070
2068
  text: this.text,
2071
- locations: new Y({ ...this.locations, ...t })
2069
+ locations: new z({ ...this.locations, ...t })
2072
2070
  });
2073
2071
  }
2074
2072
  }
2075
- class ht {
2073
+ class ot {
2076
2074
  /**
2077
2075
  * Creates a [Link].
2078
2076
  */
@@ -2084,20 +2082,20 @@ class ht {
2084
2082
  */
2085
2083
  static deserialize(t) {
2086
2084
  if (!(!t || typeof t.href != "string"))
2087
- return new ht({
2085
+ return new ot({
2088
2086
  href: t.href,
2089
2087
  templated: t.templated,
2090
2088
  type: t.type,
2091
2089
  title: t.title,
2092
2090
  rels: t.rel ? t.rel instanceof Array ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
2093
- properties: Q.deserialize(t.properties),
2094
- height: D(t.height),
2095
- width: D(t.width),
2096
- duration: D(t.duration),
2097
- bitrate: D(t.bitrate),
2098
- languages: hA(t.language),
2099
- alternates: Yt.deserialize(t.alternate),
2100
- children: Yt.deserialize(t.children)
2091
+ properties: R.deserialize(t.properties),
2092
+ height: P(t.height),
2093
+ width: P(t.width),
2094
+ duration: P(t.duration),
2095
+ bitrate: P(t.bitrate),
2096
+ languages: oA(t.language),
2097
+ alternates: yt.deserialize(t.alternate),
2098
+ children: yt.deserialize(t.children)
2101
2099
  });
2102
2100
  }
2103
2101
  /**
@@ -2105,7 +2103,7 @@ class ht {
2105
2103
  */
2106
2104
  serialize() {
2107
2105
  const t = { href: this.href };
2108
- return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = ci(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
2106
+ return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = oi(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
2109
2107
  }
2110
2108
  /** MediaType of the linked resource. */
2111
2109
  get mediaType() {
@@ -2123,14 +2121,14 @@ class ht {
2123
2121
  }
2124
2122
  /** List of URI template parameter keys, if the `Link` is templated. */
2125
2123
  get templateParameters() {
2126
- return this.templated ? new Ue(this.href).parameters : /* @__PURE__ */ new Set();
2124
+ return this.templated ? new Ie(this.href).parameters : /* @__PURE__ */ new Set();
2127
2125
  }
2128
2126
  /** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
2129
2127
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
2130
2128
  */
2131
2129
  expandTemplate(t) {
2132
- return new ht({
2133
- href: new Ue(this.href).expand(t),
2130
+ return new ot({
2131
+ href: new Ie(this.href).expand(t),
2134
2132
  templated: !1
2135
2133
  });
2136
2134
  }
@@ -2139,25 +2137,25 @@ class ht {
2139
2137
  */
2140
2138
  addProperties(t) {
2141
2139
  var e;
2142
- const A = ht.deserialize(this.serialize());
2143
- return A.properties = A.properties ? (e = A.properties) == null ? void 0 : e.add(t) : new Q(t), A;
2140
+ const A = ot.deserialize(this.serialize());
2141
+ return A.properties = A.properties ? (e = A.properties) == null ? void 0 : e.add(t) : new R(t), A;
2144
2142
  }
2145
2143
  /**
2146
2144
  * Creates a [Locator] from a reading order [Link].
2147
2145
  */
2148
2146
  get locator() {
2149
2147
  let t = this.href.split("#");
2150
- return new At({
2148
+ return new tt({
2151
2149
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
2152
2150
  type: this.type ?? "",
2153
2151
  title: this.title,
2154
- locations: new Y({
2152
+ locations: new z({
2155
2153
  fragments: t.length > 1 && t[1] !== void 0 ? [t[1]] : []
2156
2154
  })
2157
2155
  });
2158
2156
  }
2159
2157
  }
2160
- class Yt {
2158
+ class yt {
2161
2159
  /**
2162
2160
  * Creates a [Links].
2163
2161
  */
@@ -2169,8 +2167,8 @@ class Yt {
2169
2167
  */
2170
2168
  static deserialize(t) {
2171
2169
  if (t && t instanceof Array)
2172
- return new Yt(
2173
- t.map((e) => ht.deserialize(e)).filter((e) => e !== void 0)
2170
+ return new yt(
2171
+ t.map((e) => ot.deserialize(e)).filter((e) => e !== void 0)
2174
2172
  );
2175
2173
  }
2176
2174
  /**
@@ -2251,40 +2249,7 @@ class Yt {
2251
2249
  return this.items.filter((t) => t.type);
2252
2250
  }
2253
2251
  }
2254
- class se {
2255
- /**
2256
- * Creates a [Encryption].
2257
- */
2258
- constructor(t) {
2259
- this.algorithm = t.algorithm, this.compression = t.compression, this.originalLength = t.originalLength, this.profile = t.profile, this.scheme = t.scheme;
2260
- }
2261
- /**
2262
- * Parses a [Encryption] from its RWPM JSON representation.
2263
- */
2264
- static deserialize(t) {
2265
- if (t && t.algorithm)
2266
- return new se({
2267
- algorithm: t.algorithm,
2268
- compression: t.compression,
2269
- originalLength: t.originalLength,
2270
- profile: t.profile,
2271
- scheme: t.scheme
2272
- });
2273
- }
2274
- /**
2275
- * Serializes a [Encryption] to its RWPM JSON representation.
2276
- */
2277
- serialize() {
2278
- const t = { algorithm: this.algorithm };
2279
- return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
2280
- }
2281
- }
2282
- Object.defineProperty(Q.prototype, "encryption", {
2283
- get: function() {
2284
- return se.deserialize(this.otherProperties.encrypted);
2285
- }
2286
- });
2287
- class St {
2252
+ class Rt {
2288
2253
  /**
2289
2254
  * Creates a [DomRange].
2290
2255
  */
@@ -2297,11 +2262,11 @@ class St {
2297
2262
  static deserialize(t) {
2298
2263
  if (!(t && t.cssSelector))
2299
2264
  return;
2300
- let e = D(t.textNodeIndex);
2265
+ let e = P(t.textNodeIndex);
2301
2266
  if (e === void 0)
2302
2267
  return;
2303
- let A = D(t.charOffset);
2304
- return A === void 0 && (A = D(t.offset)), new St({
2268
+ let A = P(t.charOffset);
2269
+ return A === void 0 && (A = P(t.offset)), new Rt({
2305
2270
  cssSelector: t.cssSelector,
2306
2271
  textNodeIndex: e,
2307
2272
  charOffset: A
@@ -2318,7 +2283,7 @@ class St {
2318
2283
  return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
2319
2284
  }
2320
2285
  }
2321
- class oe {
2286
+ class re {
2322
2287
  /**
2323
2288
  * Creates a [DomRange].
2324
2289
  */
@@ -2331,11 +2296,11 @@ class oe {
2331
2296
  static deserialize(t) {
2332
2297
  if (!t)
2333
2298
  return;
2334
- let e = St.deserialize(t.start);
2299
+ let e = Rt.deserialize(t.start);
2335
2300
  if (e)
2336
- return new oe({
2301
+ return new re({
2337
2302
  start: e,
2338
- end: St.deserialize(t.end)
2303
+ end: Rt.deserialize(t.end)
2339
2304
  });
2340
2305
  }
2341
2306
  /**
@@ -2346,19 +2311,19 @@ class oe {
2346
2311
  return this.end && (t.end = this.end.serialize()), t;
2347
2312
  }
2348
2313
  }
2349
- Y.prototype.getCssSelector = function() {
2314
+ z.prototype.getCssSelector = function() {
2350
2315
  var n;
2351
2316
  return (n = this.otherLocations) == null ? void 0 : n.get("cssSelector");
2352
2317
  };
2353
- Y.prototype.getPartialCfi = function() {
2318
+ z.prototype.getPartialCfi = function() {
2354
2319
  var n;
2355
2320
  return (n = this.otherLocations) == null ? void 0 : n.get("partialCfi");
2356
2321
  };
2357
- Y.prototype.getDomRange = function() {
2322
+ z.prototype.getDomRange = function() {
2358
2323
  var n;
2359
- return oe.deserialize((n = this.otherLocations) == null ? void 0 : n.get("domRange"));
2324
+ return re.deserialize((n = this.otherLocations) == null ? void 0 : n.get("domRange"));
2360
2325
  };
2361
- Y.prototype.fragmentParameters = function() {
2326
+ z.prototype.fragmentParameters = function() {
2362
2327
  return new Map(
2363
2328
  this.fragments.map((n) => n.startsWith("#") ? n.slice(1) : n).join("&").split("&").filter((n) => !n.startsWith("#")).map((n) => n.split("=")).filter((n) => n.length === 2).map((n) => [
2364
2329
  n[0].trim().toLowerCase(),
@@ -2366,7 +2331,7 @@ Y.prototype.fragmentParameters = function() {
2366
2331
  ])
2367
2332
  );
2368
2333
  };
2369
- Y.prototype.htmlId = function() {
2334
+ z.prototype.htmlId = function() {
2370
2335
  if (!this.fragments.length)
2371
2336
  return;
2372
2337
  let n = this.fragments.find((t) => t.length && !t.includes("="));
@@ -2376,17 +2341,17 @@ Y.prototype.htmlId = function() {
2376
2341
  }
2377
2342
  return n != null && n.startsWith("#") ? n.slice(1) : n;
2378
2343
  };
2379
- Y.prototype.page = function() {
2344
+ z.prototype.page = function() {
2380
2345
  const n = parseInt(this.fragmentParameters().get("page"));
2381
2346
  if (!isNaN(n) && n >= 0)
2382
2347
  return n;
2383
2348
  };
2384
- Y.prototype.time = function() {
2349
+ z.prototype.time = function() {
2385
2350
  const n = parseInt(this.fragmentParameters().get("t"));
2386
2351
  if (!isNaN(n))
2387
2352
  return n;
2388
2353
  };
2389
- Y.prototype.space = function() {
2354
+ z.prototype.space = function() {
2390
2355
  const n = this.fragmentParameters();
2391
2356
  if (!n.has("xywh"))
2392
2357
  return;
@@ -2394,7 +2359,7 @@ Y.prototype.space = function() {
2394
2359
  if (t.length === 4 && !t.some(isNaN))
2395
2360
  return t;
2396
2361
  };
2397
- class ae {
2362
+ class se {
2398
2363
  /** Creates a [Price]. */
2399
2364
  constructor(t) {
2400
2365
  this.currency = t.currency, this.value = t.value;
@@ -2408,9 +2373,9 @@ class ae {
2408
2373
  let e = t.currency;
2409
2374
  if (!(e && typeof e == "string" && e.length > 0))
2410
2375
  return;
2411
- let A = D(t.value);
2376
+ let A = P(t.value);
2412
2377
  if (A !== void 0)
2413
- return new ae({ currency: e, value: A });
2378
+ return new se({ currency: e, value: A });
2414
2379
  }
2415
2380
  /**
2416
2381
  * Serializes a [Price] to its RWPM JSON representation.
@@ -2419,7 +2384,7 @@ class ae {
2419
2384
  return { currency: this.currency, value: this.value };
2420
2385
  }
2421
2386
  }
2422
- class pt {
2387
+ class dt {
2423
2388
  /** Creates a [Acquisition]. */
2424
2389
  constructor(t) {
2425
2390
  this.type = t.type, this.children = t.children;
@@ -2429,14 +2394,14 @@ class pt {
2429
2394
  */
2430
2395
  static deserialize(t) {
2431
2396
  if (t && t.type)
2432
- return new pt({
2397
+ return new dt({
2433
2398
  type: t.type,
2434
- children: pt.deserializeArray(t.children)
2399
+ children: dt.deserializeArray(t.children)
2435
2400
  });
2436
2401
  }
2437
2402
  static deserializeArray(t) {
2438
2403
  if (t instanceof Array)
2439
- return t.map((e) => pt.deserialize(e)).filter((e) => e !== void 0);
2404
+ return t.map((e) => dt.deserialize(e)).filter((e) => e !== void 0);
2440
2405
  }
2441
2406
  /**
2442
2407
  * Serializes a [Acquisition] to its RWPM JSON representation.
@@ -2446,7 +2411,7 @@ class pt {
2446
2411
  return this.children && (t.children = this.children.map((e) => e.serialize())), t;
2447
2412
  }
2448
2413
  }
2449
- class le {
2414
+ class oe {
2450
2415
  /** Creates a [Price]. */
2451
2416
  constructor(t) {
2452
2417
  this.total = t.total, this.position = t.position;
@@ -2456,9 +2421,9 @@ class le {
2456
2421
  */
2457
2422
  static deserialize(t) {
2458
2423
  if (t)
2459
- return new le({
2460
- total: D(t.total),
2461
- position: D(t.position)
2424
+ return new oe({
2425
+ total: P(t.total),
2426
+ position: P(t.position)
2462
2427
  });
2463
2428
  }
2464
2429
  /**
@@ -2469,7 +2434,7 @@ class le {
2469
2434
  return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
2470
2435
  }
2471
2436
  }
2472
- class he {
2437
+ class ae {
2473
2438
  /** Creates a [Copies]. */
2474
2439
  constructor(t) {
2475
2440
  this.total = t.total, this.available = t.available;
@@ -2479,9 +2444,9 @@ class he {
2479
2444
  */
2480
2445
  static deserialize(t) {
2481
2446
  if (t)
2482
- return new he({
2483
- total: D(t.total),
2484
- available: D(t.available)
2447
+ return new ae({
2448
+ total: P(t.total),
2449
+ available: P(t.available)
2485
2450
  });
2486
2451
  }
2487
2452
  /**
@@ -2492,7 +2457,7 @@ class he {
2492
2457
  return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
2493
2458
  }
2494
2459
  }
2495
- class ce {
2460
+ class le {
2496
2461
  /** Creates a [Availability]. */
2497
2462
  constructor(t) {
2498
2463
  this.state = t.state, this.since = t.since, this.until = t.until;
@@ -2502,10 +2467,10 @@ class ce {
2502
2467
  */
2503
2468
  static deserialize(t) {
2504
2469
  if (t && t.state)
2505
- return new ce({
2470
+ return new le({
2506
2471
  state: t.state,
2507
- since: ye(t.since),
2508
- until: ye(t.until)
2472
+ since: Fe(t.since),
2473
+ until: Fe(t.until)
2509
2474
  });
2510
2475
  }
2511
2476
  /**
@@ -2516,118 +2481,118 @@ class ce {
2516
2481
  return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
2517
2482
  }
2518
2483
  }
2519
- Q.prototype.getNumberOfItems = function() {
2520
- return D(this.otherProperties.numberOfItems);
2484
+ R.prototype.getNumberOfItems = function() {
2485
+ return P(this.otherProperties.numberOfItems);
2521
2486
  };
2522
- Q.prototype.getPrice = function() {
2523
- return ae.deserialize(this.otherProperties.price);
2487
+ R.prototype.getPrice = function() {
2488
+ return se.deserialize(this.otherProperties.price);
2524
2489
  };
2525
- Q.prototype.getIndirectAcquisitions = function() {
2490
+ R.prototype.getIndirectAcquisitions = function() {
2526
2491
  const n = this.otherProperties.indirectAcquisition;
2527
2492
  if (n && n instanceof Array)
2528
- return n.map((t) => pt.deserialize(t)).filter((t) => t !== void 0);
2493
+ return n.map((t) => dt.deserialize(t)).filter((t) => t !== void 0);
2529
2494
  };
2530
- Q.prototype.getHolds = function() {
2531
- return le.deserialize(this.otherProperties.holds);
2495
+ R.prototype.getHolds = function() {
2496
+ return oe.deserialize(this.otherProperties.holds);
2532
2497
  };
2533
- Q.prototype.getCopies = function() {
2534
- return he.deserialize(this.otherProperties.copies);
2498
+ R.prototype.getCopies = function() {
2499
+ return ae.deserialize(this.otherProperties.copies);
2535
2500
  };
2536
- Q.prototype.getAvailability = function() {
2537
- return ce.deserialize(this.otherProperties.availability);
2501
+ R.prototype.getAvailability = function() {
2502
+ return le.deserialize(this.otherProperties.availability);
2538
2503
  };
2539
- Q.prototype.getAuthenticate = function() {
2540
- return ht.deserialize(this.otherProperties.authenticate);
2504
+ R.prototype.getAuthenticate = function() {
2505
+ return ot.deserialize(this.otherProperties.authenticate);
2541
2506
  };
2542
- Q.prototype.getClipped = function() {
2507
+ R.prototype.getClipped = function() {
2543
2508
  return this.otherProperties.clipped;
2544
2509
  };
2545
- Q.prototype.getFit = function() {
2510
+ R.prototype.getFit = function() {
2546
2511
  return this.otherProperties.fit;
2547
2512
  };
2548
- Q.prototype.getOrientation = function() {
2513
+ R.prototype.getOrientation = function() {
2549
2514
  return this.otherProperties.orientation;
2550
2515
  };
2551
- Q.prototype.getOverflow = function() {
2516
+ R.prototype.getOverflow = function() {
2552
2517
  return this.otherProperties.overflow;
2553
2518
  };
2554
- Q.prototype.getPage = function() {
2519
+ R.prototype.getPage = function() {
2555
2520
  return this.otherProperties.page || void 0;
2556
2521
  };
2557
- Q.prototype.getSpread = function() {
2522
+ R.prototype.getSpread = function() {
2558
2523
  return this.otherProperties.spread || void 0;
2559
2524
  };
2560
- var $;
2525
+ var q;
2561
2526
  (function(n) {
2562
2527
  n.NONE = "none", n.DESCENDANT = "descendant", n.CHILD = "child";
2563
- })($ || ($ = {}));
2564
- var G;
2528
+ })(q || (q = {}));
2529
+ var b;
2565
2530
  (function(n) {
2566
2531
  n.id = "id", n.class = "class", n.tag = "tag", n.attribute = "attribute", n.nthchild = "nthchild", n.nthoftype = "nthoftype";
2567
- })(G || (G = {}));
2568
- const gi = "CssSelectorGenerator";
2569
- function Ce(n = "unknown problem", ...t) {
2570
- console.warn(`${gi}: ${n}`, ...t);
2532
+ })(b || (b = {}));
2533
+ const ai = "CssSelectorGenerator";
2534
+ function Ue(n = "unknown problem", ...t) {
2535
+ console.warn(`${ai}: ${n}`, ...t);
2571
2536
  }
2572
- G.id, G.class, G.tag, G.attribute;
2573
- function di(n) {
2537
+ b.id, b.class, b.tag, b.attribute;
2538
+ function li(n) {
2574
2539
  return n instanceof RegExp;
2575
2540
  }
2576
- function ui(n) {
2541
+ function hi(n) {
2577
2542
  return n.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
2578
2543
  }
2579
- function mi(n) {
2544
+ function ci(n) {
2580
2545
  const t = n.map((e) => {
2581
- if (di(e))
2546
+ if (li(e))
2582
2547
  return (A) => e.test(A);
2583
2548
  if (typeof e == "function")
2584
2549
  return (A) => {
2585
2550
  const i = e(A);
2586
- return typeof i != "boolean" ? (Ce("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : i;
2551
+ return typeof i != "boolean" ? (Ue("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : i;
2587
2552
  };
2588
2553
  if (typeof e == "string") {
2589
- const A = new RegExp("^" + ui(e) + "$");
2554
+ const A = new RegExp("^" + hi(e) + "$");
2590
2555
  return (i) => A.test(i);
2591
2556
  }
2592
- return Ce("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
2557
+ return Ue("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
2593
2558
  });
2594
2559
  return (e) => t.some((A) => A(e));
2595
2560
  }
2596
- $.NONE + "", $.NONE, $.DESCENDANT + "", $.DESCENDANT, $.CHILD + "", $.CHILD;
2597
- G.nthoftype, G.tag, G.id, G.class, G.attribute, G.nthchild;
2598
- mi([
2561
+ q.NONE + "", q.NONE, q.DESCENDANT + "", q.DESCENDANT, q.CHILD + "", q.CHILD;
2562
+ b.nthoftype, b.tag, b.id, b.class, b.attribute, b.nthchild;
2563
+ ci([
2599
2564
  "class",
2600
2565
  "id",
2601
2566
  // Angular attributes
2602
2567
  "ng-*"
2603
2568
  ]);
2604
- class vt {
2569
+ class Vt {
2605
2570
  }
2606
- function Re(n) {
2571
+ function Ce(n) {
2607
2572
  return n.split("").reverse().join("");
2608
2573
  }
2609
- function Mi(n, t, e) {
2610
- const A = Re(t);
2574
+ function gi(n, t, e) {
2575
+ const A = Ce(t);
2611
2576
  return e.map((i) => {
2612
- const r = Math.max(0, i.end - t.length - i.errors), s = Re(n.slice(r, i.end));
2577
+ const r = Math.max(0, i.end - t.length - i.errors), s = Ce(n.slice(r, i.end));
2613
2578
  return {
2614
- start: cA(s, A, i.errors).reduce((o, a) => i.end - a.end < o ? i.end - a.end : o, i.end),
2579
+ start: aA(s, A, i.errors).reduce((o, a) => i.end - a.end < o ? i.end - a.end : o, i.end),
2615
2580
  end: i.end,
2616
2581
  errors: i.errors
2617
2582
  };
2618
2583
  });
2619
2584
  }
2620
- function Wt(n) {
2585
+ function Ht(n) {
2621
2586
  return (n | -n) >> 31 & 1;
2622
2587
  }
2623
- function Qe(n, t, e, A) {
2588
+ function ye(n, t, e, A) {
2624
2589
  let i = n.P[e], r = n.M[e];
2625
2590
  const s = A >>> 31, o = t[e] | s, a = o | r, l = (o & i) + i ^ i | o;
2626
2591
  let h = r | ~(l | i), c = i & l;
2627
- const g = Wt(h & n.lastRowMask[e]) - Wt(c & n.lastRowMask[e]);
2628
- return h <<= 1, c <<= 1, c |= s, h |= Wt(A) - s, i = c | ~(a | h), r = h & a, n.P[e] = i, n.M[e] = r, g;
2592
+ const g = Ht(h & n.lastRowMask[e]) - Ht(c & n.lastRowMask[e]);
2593
+ return h <<= 1, c <<= 1, c |= s, h |= Ht(A) - s, i = c | ~(a | h), r = h & a, n.P[e] = i, n.M[e] = r, g;
2629
2594
  }
2630
- function cA(n, t, e) {
2595
+ function aA(n, t, e) {
2631
2596
  if (t.length === 0)
2632
2597
  return [];
2633
2598
  e = Math.min(e, t.length);
@@ -2667,7 +2632,7 @@ function cA(n, t, e) {
2667
2632
  m < l.length ? M = l[m] : (M = a.get(m), typeof M > "u" && (M = o));
2668
2633
  let B = 0;
2669
2634
  for (let f = 0; f <= h; f += 1)
2670
- B = Qe(s, M, f, B), c[f] += B;
2635
+ B = ye(s, M, f, B), c[f] += B;
2671
2636
  if (c[h] - B <= e && h < r && (M[h + 1] & 1 || B < 0)) {
2672
2637
  h += 1, s.P[h] = -1, s.M[h] = 0;
2673
2638
  let f;
@@ -2676,7 +2641,7 @@ function cA(n, t, e) {
2676
2641
  f = I === 0 ? i : I;
2677
2642
  } else
2678
2643
  f = i;
2679
- c[h] = c[h - 1] + f - B + Qe(s, M, h, B);
2644
+ c[h] = c[h - 1] + f - B + ye(s, M, h, B);
2680
2645
  } else
2681
2646
  for (; h > 0 && c[h] >= e + i; )
2682
2647
  h -= 1;
@@ -2688,11 +2653,11 @@ function cA(n, t, e) {
2688
2653
  }
2689
2654
  return A;
2690
2655
  }
2691
- function fi(n, t, e) {
2692
- const A = cA(n, t, e);
2693
- return Mi(n, t, A);
2656
+ function di(n, t, e) {
2657
+ const A = aA(n, t, e);
2658
+ return gi(n, t, A);
2694
2659
  }
2695
- function gA(n, t, e) {
2660
+ function lA(n, t, e) {
2696
2661
  let A = 0;
2697
2662
  const i = [];
2698
2663
  for (; A !== -1; )
@@ -2701,25 +2666,25 @@ function gA(n, t, e) {
2701
2666
  end: A + t.length,
2702
2667
  errors: 0
2703
2668
  }), A += 1);
2704
- return i.length > 0 ? i : fi(n, t, e);
2669
+ return i.length > 0 ? i : di(n, t, e);
2705
2670
  }
2706
- function ze(n, t) {
2707
- return t.length === 0 || n.length === 0 ? 0 : 1 - gA(n, t, t.length)[0].errors / t.length;
2671
+ function Re(n, t) {
2672
+ return t.length === 0 || n.length === 0 ? 0 : 1 - lA(n, t, t.length)[0].errors / t.length;
2708
2673
  }
2709
- function pi(n, t, e = {}) {
2674
+ function ui(n, t, e = {}) {
2710
2675
  if (t.length === 0)
2711
2676
  return null;
2712
- const A = Math.min(256, t.length / 2), i = gA(n, t, A);
2677
+ const A = Math.min(256, t.length / 2), i = lA(n, t, A);
2713
2678
  if (i.length === 0)
2714
2679
  return null;
2715
2680
  const r = (o) => {
2716
- const a = 1 - o.errors / t.length, l = e.prefix ? ze(
2681
+ const a = 1 - o.errors / t.length, l = e.prefix ? Re(
2717
2682
  n.slice(
2718
2683
  Math.max(0, o.start - e.prefix.length),
2719
2684
  o.start
2720
2685
  ),
2721
2686
  e.prefix
2722
- ) : 1, h = e.suffix ? ze(
2687
+ ) : 1, h = e.suffix ? Re(
2723
2688
  n.slice(o.end, o.end + e.suffix.length),
2724
2689
  e.suffix
2725
2690
  ) : 1;
@@ -2734,7 +2699,7 @@ function pi(n, t, e = {}) {
2734
2699
  }));
2735
2700
  return s.sort((o, a) => a.score - o.score), s[0];
2736
2701
  }
2737
- function _t(n, t, e) {
2702
+ function Xt(n, t, e) {
2738
2703
  const A = e === 1 ? t : t - 1;
2739
2704
  if (n.charAt(A).trim() !== "")
2740
2705
  return t;
@@ -2744,7 +2709,7 @@ function _t(n, t, e) {
2744
2709
  const s = i.length - r.length;
2745
2710
  return e === 2 ? t - s : t + s;
2746
2711
  }
2747
- function Ye(n, t) {
2712
+ function Qe(n, t) {
2748
2713
  const e = n.commonAncestorContainer.ownerDocument.createNodeIterator(
2749
2714
  n.commonAncestorContainer,
2750
2715
  NodeFilter.SHOW_TEXT
@@ -2757,7 +2722,7 @@ function Ye(n, t) {
2757
2722
  const o = () => {
2758
2723
  if (r = t === 1 ? e.nextNode() : e.previousNode(), r) {
2759
2724
  const a = r.textContent, l = t === 1 ? 0 : a.length;
2760
- s = _t(a, l, t);
2725
+ s = Xt(a, l, t);
2761
2726
  }
2762
2727
  };
2763
2728
  for (; r && s === -1 && r !== i; )
@@ -2766,7 +2731,7 @@ function Ye(n, t) {
2766
2731
  return { node: r, offset: s };
2767
2732
  throw new RangeError("No text nodes with non-whitespace text found in range");
2768
2733
  }
2769
- function Bi(n) {
2734
+ function mi(n) {
2770
2735
  if (!n.toString().trim().length)
2771
2736
  throw new RangeError("Range contains no non-whitespace text");
2772
2737
  if (n.startContainer.nodeType !== Node.TEXT_NODE)
@@ -2776,13 +2741,13 @@ function Bi(n) {
2776
2741
  const t = n.cloneRange();
2777
2742
  let e = !1, A = !1;
2778
2743
  const i = {
2779
- start: _t(
2744
+ start: Xt(
2780
2745
  n.startContainer.textContent,
2781
2746
  n.startOffset,
2782
2747
  1
2783
2748
  /* Forwards */
2784
2749
  ),
2785
- end: _t(
2750
+ end: Xt(
2786
2751
  n.endContainer.textContent,
2787
2752
  n.endOffset,
2788
2753
  2
@@ -2792,7 +2757,7 @@ function Bi(n) {
2792
2757
  if (i.start >= 0 && (t.setStart(n.startContainer, i.start), e = !0), i.end > 0 && (t.setEnd(n.endContainer, i.end), A = !0), e && A)
2793
2758
  return t;
2794
2759
  if (!e) {
2795
- const { node: r, offset: s } = Ye(
2760
+ const { node: r, offset: s } = Qe(
2796
2761
  t,
2797
2762
  1
2798
2763
  /* Forwards */
@@ -2800,7 +2765,7 @@ function Bi(n) {
2800
2765
  r && s >= 0 && t.setStart(r, s);
2801
2766
  }
2802
2767
  if (!A) {
2803
- const { node: r, offset: s } = Ye(
2768
+ const { node: r, offset: s } = Qe(
2804
2769
  t,
2805
2770
  2
2806
2771
  /* Backwards */
@@ -2809,7 +2774,7 @@ function Bi(n) {
2809
2774
  }
2810
2775
  return t;
2811
2776
  }
2812
- function dA(n) {
2777
+ function hA(n) {
2813
2778
  var t;
2814
2779
  switch (n.nodeType) {
2815
2780
  case Node.ELEMENT_NODE:
@@ -2819,13 +2784,13 @@ function dA(n) {
2819
2784
  return 0;
2820
2785
  }
2821
2786
  }
2822
- function Se(n) {
2787
+ function ze(n) {
2823
2788
  let t = n.previousSibling, e = 0;
2824
2789
  for (; t; )
2825
- e += dA(t), t = t.previousSibling;
2790
+ e += hA(t), t = t.previousSibling;
2826
2791
  return e;
2827
2792
  }
2828
- function uA(n, ...t) {
2793
+ function cA(n, ...t) {
2829
2794
  let e = t.shift();
2830
2795
  const A = n.ownerDocument.createNodeIterator(
2831
2796
  n,
@@ -2840,7 +2805,7 @@ function uA(n, ...t) {
2840
2805
  throw new RangeError("Offset exceeds text length");
2841
2806
  return i;
2842
2807
  }
2843
- class O {
2808
+ class L {
2844
2809
  constructor(t, e) {
2845
2810
  if (e < 0)
2846
2811
  throw new Error("Offset is invalid");
@@ -2857,8 +2822,8 @@ class O {
2857
2822
  throw new Error("Parent is not an ancestor of current element");
2858
2823
  let e = this.element, A = this.offset;
2859
2824
  for (; e !== t; )
2860
- A += Se(e), e = e.parentElement;
2861
- return new O(e, A);
2825
+ A += ze(e), e = e.parentElement;
2826
+ return new L(e, A);
2862
2827
  }
2863
2828
  /**
2864
2829
  * Resolve the position to a specific text node and offset within that node.
@@ -2879,7 +2844,7 @@ class O {
2879
2844
  */
2880
2845
  resolve(t = {}) {
2881
2846
  try {
2882
- return uA(this.element, this.offset)[0];
2847
+ return cA(this.element, this.offset)[0];
2883
2848
  } catch (e) {
2884
2849
  if (this.offset === 0 && t.direction !== void 0) {
2885
2850
  const A = document.createTreeWalker(
@@ -2902,9 +2867,9 @@ class O {
2902
2867
  static fromCharOffset(t, e) {
2903
2868
  switch (t.nodeType) {
2904
2869
  case Node.TEXT_NODE:
2905
- return O.fromPoint(t, e);
2870
+ return L.fromPoint(t, e);
2906
2871
  case Node.ELEMENT_NODE:
2907
- return new O(t, e);
2872
+ return new L(t, e);
2908
2873
  default:
2909
2874
  throw new Error("Node is not an element or text node");
2910
2875
  }
@@ -2922,23 +2887,23 @@ class O {
2922
2887
  throw new Error("Text node offset is out of range");
2923
2888
  if (!t.parentElement)
2924
2889
  throw new Error("Text node has no parent");
2925
- const A = Se(t) + e;
2926
- return new O(t.parentElement, A);
2890
+ const A = ze(t) + e;
2891
+ return new L(t.parentElement, A);
2927
2892
  }
2928
2893
  case Node.ELEMENT_NODE: {
2929
2894
  if (e < 0 || e > t.childNodes.length)
2930
2895
  throw new Error("Child node offset is out of range");
2931
2896
  let A = 0;
2932
2897
  for (let i = 0; i < e; i++)
2933
- A += dA(t.childNodes[i]);
2934
- return new O(t, A);
2898
+ A += hA(t.childNodes[i]);
2899
+ return new L(t, A);
2935
2900
  }
2936
2901
  default:
2937
2902
  throw new Error("Point is not in an element or text node");
2938
2903
  }
2939
2904
  }
2940
2905
  }
2941
- class tt {
2906
+ class _ {
2942
2907
  constructor(t, e) {
2943
2908
  this.start = t, this.end = e;
2944
2909
  }
@@ -2948,7 +2913,7 @@ class tt {
2948
2913
  * `end.element`.
2949
2914
  */
2950
2915
  relativeTo(t) {
2951
- return new tt(
2916
+ return new _(
2952
2917
  this.start.relativeTo(t),
2953
2918
  this.end.relativeTo(t)
2954
2919
  );
@@ -2964,7 +2929,7 @@ class tt {
2964
2929
  */
2965
2930
  toRange() {
2966
2931
  let t, e;
2967
- this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = uA(
2932
+ this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = cA(
2968
2933
  this.start.element,
2969
2934
  this.start.offset,
2970
2935
  this.end.offset
@@ -2982,20 +2947,20 @@ class tt {
2982
2947
  * Create a TextRange from a (DOM) Range
2983
2948
  */
2984
2949
  static fromRange(t) {
2985
- const e = O.fromPoint(
2950
+ const e = L.fromPoint(
2986
2951
  t.startContainer,
2987
2952
  t.startOffset
2988
- ), A = O.fromPoint(t.endContainer, t.endOffset);
2989
- return new tt(e, A);
2953
+ ), A = L.fromPoint(t.endContainer, t.endOffset);
2954
+ return new _(e, A);
2990
2955
  }
2991
2956
  /**
2992
2957
  * Create a TextRange representing the `start`th to `end`th characters in
2993
2958
  * `root`
2994
2959
  */
2995
2960
  static fromOffsets(t, e, A) {
2996
- return new tt(
2997
- new O(t, e),
2998
- new O(t, A)
2961
+ return new _(
2962
+ new L(t, e),
2963
+ new L(t, A)
2999
2964
  );
3000
2965
  }
3001
2966
  /**
@@ -3003,23 +2968,23 @@ class tt {
3003
2968
  * whitespace
3004
2969
  */
3005
2970
  static trimmedRange(t) {
3006
- return Bi(tt.fromRange(t).toRange());
2971
+ return mi(_.fromRange(t).toRange());
3007
2972
  }
3008
2973
  }
3009
- class Nt {
2974
+ class Qt {
3010
2975
  constructor(t, e, A) {
3011
2976
  this.root = t, this.start = e, this.end = A;
3012
2977
  }
3013
2978
  static fromRange(t, e) {
3014
- const A = tt.fromRange(e).relativeTo(t);
3015
- return new Nt(
2979
+ const A = _.fromRange(e).relativeTo(t);
2980
+ return new Qt(
3016
2981
  t,
3017
2982
  A.start.offset,
3018
2983
  A.end.offset
3019
2984
  );
3020
2985
  }
3021
2986
  static fromSelector(t, e) {
3022
- return new Nt(t, e.start, e.end);
2987
+ return new Qt(t, e.start, e.end);
3023
2988
  }
3024
2989
  toSelector() {
3025
2990
  return {
@@ -3029,10 +2994,10 @@ class Nt {
3029
2994
  };
3030
2995
  }
3031
2996
  toRange() {
3032
- return tt.fromOffsets(this.root, this.start, this.end).toRange();
2997
+ return _.fromOffsets(this.root, this.start, this.end).toRange();
3033
2998
  }
3034
2999
  }
3035
- class xt {
3000
+ class zt {
3036
3001
  /**
3037
3002
  * @param root - A root element from which to anchor.
3038
3003
  */
@@ -3045,15 +3010,15 @@ class xt {
3045
3010
  * Will throw if `range` does not contain any text nodes.
3046
3011
  */
3047
3012
  static fromRange(t, e) {
3048
- const A = t.textContent, i = tt.fromRange(e).relativeTo(t), r = i.start.offset, s = i.end.offset, o = 32;
3049
- return new xt(t, A.slice(r, s), {
3013
+ const A = t.textContent, i = _.fromRange(e).relativeTo(t), r = i.start.offset, s = i.end.offset, o = 32;
3014
+ return new zt(t, A.slice(r, s), {
3050
3015
  prefix: A.slice(Math.max(0, r - o), r),
3051
3016
  suffix: A.slice(s, Math.min(A.length, s + o))
3052
3017
  });
3053
3018
  }
3054
3019
  static fromSelector(t, e) {
3055
3020
  const { prefix: A, suffix: i } = e;
3056
- return new xt(t, e.exact, { prefix: A, suffix: i });
3021
+ return new zt(t, e.exact, { prefix: A, suffix: i });
3057
3022
  }
3058
3023
  toSelector() {
3059
3024
  return {
@@ -3067,26 +3032,26 @@ class xt {
3067
3032
  return this.toPositionAnchor(t).toRange();
3068
3033
  }
3069
3034
  toPositionAnchor(t = {}) {
3070
- const e = this.root.textContent, A = pi(e, this.exact, {
3035
+ const e = this.root.textContent, A = ui(e, this.exact, {
3071
3036
  ...this.context,
3072
3037
  hint: t.hint
3073
3038
  });
3074
3039
  if (!A)
3075
3040
  throw new Error("Quote not found");
3076
- return new Nt(this.root, A.start, A.end);
3041
+ return new Qt(this.root, A.start, A.end);
3077
3042
  }
3078
3043
  }
3079
- function Ei(n) {
3044
+ function Mi(n) {
3080
3045
  const t = n.tagName.toUpperCase();
3081
3046
  return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
3082
3047
  }
3083
- function ge(n, t) {
3048
+ function he(n, t) {
3084
3049
  try {
3085
3050
  const e = t.locations, A = t.text;
3086
3051
  if (A && A.highlight) {
3087
3052
  let i;
3088
3053
  e && e.getCssSelector() && (i = n.querySelector(e.getCssSelector())), i || (i = n.body);
3089
- const r = new xt(i, A.highlight, {
3054
+ const r = new zt(i, A.highlight, {
3090
3055
  prefix: A.before,
3091
3056
  suffix: A.after
3092
3057
  });
@@ -3105,7 +3070,7 @@ function ge(n, t) {
3105
3070
  }
3106
3071
  if (i) {
3107
3072
  const r = n.createRange();
3108
- return i.childNodes.length === 0 || Ei(i) ? (r.selectNode(i), r) : (r.setStartBefore(i), r.setEndAfter(i), r);
3073
+ return i.childNodes.length === 0 || Mi(i) ? (r.selectNode(i), r) : (r.setStartBefore(i), r.setEndAfter(i), r);
3109
3074
  }
3110
3075
  }
3111
3076
  } catch (e) {
@@ -3113,7 +3078,7 @@ function ge(n, t) {
3113
3078
  }
3114
3079
  return null;
3115
3080
  }
3116
- function wi(n, t) {
3081
+ function fi(n, t) {
3117
3082
  let e = n.getClientRects();
3118
3083
  e.length || n.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = n.commonAncestorContainer.getClientRects());
3119
3084
  const A = 1, i = [];
@@ -3126,11 +3091,11 @@ function wi(n, t) {
3126
3091
  top: l.top,
3127
3092
  width: l.width
3128
3093
  });
3129
- const r = mA(
3094
+ const r = gA(
3130
3095
  i,
3131
3096
  A,
3132
3097
  t
3133
- ), s = Fi(r, A), o = MA(s), a = 2 * 2;
3098
+ ), s = Bi(r, A), o = dA(s), a = 2 * 2;
3134
3099
  for (let l = o.length - 1; l >= 0; l--) {
3135
3100
  const h = o[l];
3136
3101
  if (!(h.width * h.height > a))
@@ -3141,16 +3106,16 @@ function wi(n, t) {
3141
3106
  }
3142
3107
  return o;
3143
3108
  }
3144
- function mA(n, t, e) {
3109
+ function gA(n, t, e) {
3145
3110
  for (let A = 0; A < n.length; A++)
3146
3111
  for (let i = A + 1; i < n.length; i++) {
3147
3112
  const r = n[A], s = n[i];
3148
3113
  if (r === s)
3149
3114
  continue;
3150
- const o = H(r.top, s.top, t) && H(r.bottom, s.bottom, t), a = H(r.left, s.left, t) && H(r.right, s.right, t);
3151
- if ((a && !e || o && !a) && fA(r, s, t)) {
3152
- const l = n.filter((c) => c !== r && c !== s), h = Ii(r, s);
3153
- return l.push(h), mA(
3115
+ const o = G(r.top, s.top, t) && G(r.bottom, s.bottom, t), a = G(r.left, s.left, t) && G(r.right, s.right, t);
3116
+ if ((a && !e || o && !a) && uA(r, s, t)) {
3117
+ const l = n.filter((c) => c !== r && c !== s), h = pi(r, s);
3118
+ return l.push(h), gA(
3154
3119
  l,
3155
3120
  t,
3156
3121
  e
@@ -3159,7 +3124,7 @@ function mA(n, t, e) {
3159
3124
  }
3160
3125
  return n;
3161
3126
  }
3162
- function Ii(n, t) {
3127
+ function pi(n, t) {
3163
3128
  const e = Math.min(n.left, t.left), A = Math.max(n.right, t.right), i = Math.min(n.top, t.top), r = Math.max(n.bottom, t.bottom);
3164
3129
  return {
3165
3130
  bottom: r,
@@ -3170,7 +3135,7 @@ function Ii(n, t) {
3170
3135
  width: A - e
3171
3136
  };
3172
3137
  }
3173
- function Fi(n, t) {
3138
+ function Bi(n, t) {
3174
3139
  const e = new Set(n);
3175
3140
  for (const A of n) {
3176
3141
  if (!(A.width > 1 && A.height > 1)) {
@@ -3178,40 +3143,40 @@ function Fi(n, t) {
3178
3143
  continue;
3179
3144
  }
3180
3145
  for (const i of n)
3181
- if (A !== i && e.has(i) && Ui(i, A, t)) {
3146
+ if (A !== i && e.has(i) && Ei(i, A, t)) {
3182
3147
  e.delete(A);
3183
3148
  break;
3184
3149
  }
3185
3150
  }
3186
3151
  return Array.from(e);
3187
3152
  }
3188
- function Ui(n, t, e) {
3189
- return Ft(n, t.left, t.top, e) && Ft(n, t.right, t.top, e) && Ft(n, t.left, t.bottom, e) && Ft(n, t.right, t.bottom, e);
3153
+ function Ei(n, t, e) {
3154
+ return pt(n, t.left, t.top, e) && pt(n, t.right, t.top, e) && pt(n, t.left, t.bottom, e) && pt(n, t.right, t.bottom, e);
3190
3155
  }
3191
- function Ft(n, t, e, A) {
3192
- return (n.left < t || H(n.left, t, A)) && (n.right > t || H(n.right, t, A)) && (n.top < e || H(n.top, e, A)) && (n.bottom > e || H(n.bottom, e, A));
3156
+ function pt(n, t, e, A) {
3157
+ return (n.left < t || G(n.left, t, A)) && (n.right > t || G(n.right, t, A)) && (n.top < e || G(n.top, e, A)) && (n.bottom > e || G(n.bottom, e, A));
3193
3158
  }
3194
- function MA(n) {
3159
+ function dA(n) {
3195
3160
  for (let t = 0; t < n.length; t++)
3196
3161
  for (let e = t + 1; e < n.length; e++) {
3197
3162
  const A = n[t], i = n[e];
3198
- if (A !== i && fA(A, i, -1)) {
3163
+ if (A !== i && uA(A, i, -1)) {
3199
3164
  let r = [], s;
3200
- const o = Ne(A, i);
3165
+ const o = Ye(A, i);
3201
3166
  if (o.length === 1)
3202
3167
  r = o, s = A;
3203
3168
  else {
3204
- const l = Ne(i, A);
3169
+ const l = Ye(i, A);
3205
3170
  o.length < l.length ? (r = o, s = A) : (r = l, s = i);
3206
3171
  }
3207
3172
  const a = n.filter((l) => l !== s);
3208
- return Array.prototype.push.apply(a, r), MA(a);
3173
+ return Array.prototype.push.apply(a, r), dA(a);
3209
3174
  }
3210
3175
  }
3211
3176
  return n;
3212
3177
  }
3213
- function Ne(n, t) {
3214
- const e = yi(t, n);
3178
+ function Ye(n, t) {
3179
+ const e = wi(t, n);
3215
3180
  if (e.height === 0 || e.width === 0)
3216
3181
  return [n];
3217
3182
  const A = [];
@@ -3261,7 +3226,7 @@ function Ne(n, t) {
3261
3226
  }
3262
3227
  return A;
3263
3228
  }
3264
- function yi(n, t) {
3229
+ function wi(n, t) {
3265
3230
  const e = Math.max(n.left, t.left), A = Math.min(n.right, t.right), i = Math.max(n.top, t.top), r = Math.min(n.bottom, t.bottom);
3266
3231
  return {
3267
3232
  bottom: r,
@@ -3272,36 +3237,36 @@ function yi(n, t) {
3272
3237
  width: Math.max(0, A - e)
3273
3238
  };
3274
3239
  }
3275
- function fA(n, t, e) {
3276
- return (n.left < t.right || e >= 0 && H(n.left, t.right, e)) && (t.left < n.right || e >= 0 && H(t.left, n.right, e)) && (n.top < t.bottom || e >= 0 && H(n.top, t.bottom, e)) && (t.top < n.bottom || e >= 0 && H(t.top, n.bottom, e));
3240
+ function uA(n, t, e) {
3241
+ return (n.left < t.right || e >= 0 && G(n.left, t.right, e)) && (t.left < n.right || e >= 0 && G(t.left, n.right, e)) && (n.top < t.bottom || e >= 0 && G(n.top, t.bottom, e)) && (t.top < n.bottom || e >= 0 && G(t.top, n.bottom, e));
3277
3242
  }
3278
- function H(n, t, e) {
3243
+ function G(n, t, e) {
3279
3244
  return Math.abs(n - t) <= e;
3280
3245
  }
3281
- function pA(n) {
3246
+ function mA(n) {
3282
3247
  const t = {}, e = n.document.documentElement.style;
3283
3248
  for (const A in n.document.documentElement.style)
3284
3249
  Object.hasOwn(e, A) && !Number.isNaN(Number.parseInt(A)) && (t[e[A]] = e.getPropertyValue(e[A]));
3285
3250
  return t;
3286
3251
  }
3287
- function Ci(n, t) {
3288
- const e = pA(n);
3252
+ function Ii(n, t) {
3253
+ const e = mA(n);
3289
3254
  Object.keys(e).forEach((A) => {
3290
- t.hasOwnProperty(A) || de(n, A);
3255
+ t.hasOwnProperty(A) || ce(n, A);
3291
3256
  }), Object.entries(t).forEach(([A, i]) => {
3292
- e[A] !== i && Tt(n, A, i);
3257
+ e[A] !== i && Yt(n, A, i);
3293
3258
  });
3294
3259
  }
3295
- function xe(n, t) {
3260
+ function Ne(n, t) {
3296
3261
  return n.document.documentElement.style.getPropertyValue(t);
3297
3262
  }
3298
- function Tt(n, t, e) {
3263
+ function Yt(n, t, e) {
3299
3264
  n.document.documentElement.style.setProperty(t, e);
3300
3265
  }
3301
- function de(n, t) {
3266
+ function ce(n, t) {
3302
3267
  n.document.documentElement.style.removeProperty(t);
3303
3268
  }
3304
- const Ri = (n) => {
3269
+ const Fi = (n) => {
3305
3270
  if (n.startsWith("rgb")) {
3306
3271
  const t = n.match(/rgb\((\d+),\s(\d+),\s(\d+)(?:,\s(\d+))?\)/);
3307
3272
  if (t)
@@ -3329,18 +3294,18 @@ const Ri = (n) => {
3329
3294
  };
3330
3295
  }
3331
3296
  return { r: 0, g: 0, b: 0, a: 1 };
3332
- }, Qi = (n) => 0.2126 * n.r * n.a + 0.7152 * n.g * n.a + 0.0722 * n.b * n.a, zi = (n) => {
3333
- const t = Ri(n);
3334
- return Qi(t) < 128;
3335
- }, Yi = () => "Highlight" in window, Te = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
3336
- class Si {
3297
+ }, Ui = (n) => 0.2126 * n.r * n.a + 0.7152 * n.g * n.a + 0.0722 * n.b * n.a, Ci = (n) => {
3298
+ const t = Fi(n);
3299
+ return Ui(t) < 128;
3300
+ }, yi = () => "Highlight" in window, Se = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
3301
+ class Ri {
3337
3302
  /**
3338
3303
  * Creates a DecorationGroup object
3339
3304
  * @param id Unique HTML ID-adhering name of the group
3340
3305
  * @param name Human-readable name of the group
3341
3306
  */
3342
3307
  constructor(t, e, A, i) {
3343
- this.wnd = t, this.comms = e, this.id = A, this.name = i, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Yi() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
3308
+ this.wnd = t, this.comms = e, this.id = A, this.name = i, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, yi() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
3344
3309
  }
3345
3310
  get activeable() {
3346
3311
  return this.activateable;
@@ -3354,13 +3319,13 @@ class Si {
3354
3319
  */
3355
3320
  add(t) {
3356
3321
  var e, A, i, r;
3357
- const s = `${this.id}-${this.lastItemId++}`, o = ge(this.wnd.document, t.locator);
3322
+ const s = `${this.id}-${this.lastItemId++}`, o = he(this.wnd.document, t.locator);
3358
3323
  if (!o) {
3359
3324
  this.comms.log("Can't locate DOM range for decoration", t);
3360
3325
  return;
3361
3326
  }
3362
3327
  const a = o.commonAncestorContainer;
3363
- a.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Te.includes(a.nodeName.toUpperCase()) && ((e = this.notTextFlag) == null || e.set(s, !0)), a.querySelector(Te.join(", ").toLowerCase()) && ((A = this.notTextFlag) == null || A.set(s, !0)), (((i = a.textContent) == null ? void 0 : i.trim()) || "").length === 0 && ((r = this.notTextFlag) == null || r.set(s, !0)));
3328
+ a.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Se.includes(a.nodeName.toUpperCase()) && ((e = this.notTextFlag) == null || e.set(s, !0)), a.querySelector(Se.join(", ").toLowerCase()) && ((A = this.notTextFlag) == null || A.set(s, !0)), (((i = a.textContent) == null ? void 0 : i.trim()) || "").length === 0 && ((r = this.notTextFlag) == null || r.set(s, !0)));
3364
3329
  const l = {
3365
3330
  decoration: t,
3366
3331
  id: s,
@@ -3428,23 +3393,23 @@ class Si {
3428
3393
  getComputedStyle(this.wnd.document.documentElement).getPropertyValue(
3429
3394
  "column-count"
3430
3395
  )
3431
- ), h = a / (l || 1), c = this.wnd.document.scrollingElement, g = c.scrollLeft, m = c.scrollTop, M = (E, F, j) => {
3432
- var It, Mt, ue, me, Me, fe;
3433
- if (E.style.position = "absolute", ((Mt = (It = t.decoration) == null ? void 0 : It.style) == null ? void 0 : Mt.width) === "viewport") {
3396
+ ), h = a / (l || 1), c = this.wnd.document.scrollingElement, g = c.scrollLeft, m = c.scrollTop, M = (E, F, T) => {
3397
+ var ft, gt, ge, de, ue, me;
3398
+ if (E.style.position = "absolute", ((gt = (ft = t.decoration) == null ? void 0 : ft.style) == null ? void 0 : gt.width) === "viewport") {
3434
3399
  E.style.width = `${a}px`, E.style.height = `${F.height}px`;
3435
- let Gt = Math.floor(F.left / a) * a;
3436
- E.style.left = `${Gt + g}px`, E.style.top = `${F.top + m}px`;
3437
- } else if (((me = (ue = t.decoration) == null ? void 0 : ue.style) == null ? void 0 : me.width) === "bounds")
3438
- E.style.width = `${j.width}px`, E.style.height = `${F.height}px`, E.style.left = `${j.left + g}px`, E.style.top = `${F.top + m}px`;
3439
- else if (((fe = (Me = t.decoration) == null ? void 0 : Me.style) == null ? void 0 : fe.width) === "page") {
3400
+ let Dt = Math.floor(F.left / a) * a;
3401
+ E.style.left = `${Dt + g}px`, E.style.top = `${F.top + m}px`;
3402
+ } else if (((de = (ge = t.decoration) == null ? void 0 : ge.style) == null ? void 0 : de.width) === "bounds")
3403
+ E.style.width = `${T.width}px`, E.style.height = `${F.height}px`, E.style.left = `${T.left + g}px`, E.style.top = `${F.top + m}px`;
3404
+ else if (((me = (ue = t.decoration) == null ? void 0 : ue.style) == null ? void 0 : me.width) === "page") {
3440
3405
  E.style.width = `${h}px`, E.style.height = `${F.height}px`;
3441
- let Gt = Math.floor(F.left / h) * h;
3442
- E.style.left = `${Gt + g}px`, E.style.top = `${F.top + m}px`;
3406
+ let Dt = Math.floor(F.left / h) * h;
3407
+ E.style.left = `${Dt + g}px`, E.style.top = `${F.top + m}px`;
3443
3408
  } else
3444
3409
  E.style.width = `${F.width}px`, E.style.height = `${F.height}px`, E.style.left = `${F.left + g}px`, E.style.top = `${F.top + m}px`;
3445
3410
  }, B = t.range.getBoundingClientRect();
3446
3411
  let f = this.wnd.document.createElement("template");
3447
- const I = xe(this.wnd, "--USER__appearance") === "readium-night-on" || zi(xe(this.wnd, "--USER__backgroundColor"));
3412
+ const I = Ne(this.wnd, "--USER__appearance") === "readium-night-on" || Ci(Ne(this.wnd, "--USER__backgroundColor"));
3448
3413
  f.innerHTML = `
3449
3414
  <div
3450
3415
  class="r2-highlight-0"
@@ -3463,15 +3428,15 @@ class Si {
3463
3428
  const E = C.cloneNode(!0);
3464
3429
  E.style.setProperty("pointer-events", "none"), M(E, B, B), o.append(E);
3465
3430
  } else {
3466
- let E = wi(
3431
+ let E = fi(
3467
3432
  t.range,
3468
3433
  !0
3469
3434
  // doNotMergeHorizontallyAlignedRects
3470
3435
  );
3471
- E = E.sort((F, j) => F.top < j.top ? -1 : F.top > j.top ? 1 : 0);
3436
+ E = E.sort((F, T) => F.top < T.top ? -1 : F.top > T.top ? 1 : 0);
3472
3437
  for (let F of E) {
3473
- const j = C.cloneNode(!0);
3474
- j.style.setProperty("pointer-events", "none"), M(j, F, B), o.append(j);
3438
+ const T = C.cloneNode(!0);
3439
+ T.style.setProperty("pointer-events", "none"), M(T, F, B), o.append(T);
3475
3440
  }
3476
3441
  }
3477
3442
  t.container = o, t.clickableElements = Array.from(
@@ -3506,7 +3471,7 @@ class Si {
3506
3471
  this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
3507
3472
  }
3508
3473
  }
3509
- const BA = class $t extends vt {
3474
+ const MA = class Zt extends Vt {
3510
3475
  constructor() {
3511
3476
  super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
3512
3477
  }
@@ -3521,9 +3486,9 @@ const BA = class $t extends vt {
3521
3486
  }, 50);
3522
3487
  }
3523
3488
  mount(t, e) {
3524
- return this.wnd = t, e.register("decorate", $t.moduleName, (A, i) => {
3489
+ return this.wnd = t, e.register("decorate", Zt.moduleName, (A, i) => {
3525
3490
  const r = A;
3526
- r.decoration && r.decoration.locator && (r.decoration.locator = At.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new Si(
3491
+ r.decoration && r.decoration.locator && (r.decoration.locator = tt.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new Ri(
3527
3492
  t,
3528
3493
  e,
3529
3494
  `readium-decoration-${this.lastGroupId++}`,
@@ -3548,12 +3513,12 @@ const BA = class $t extends vt {
3548
3513
  }), this.resizeObserver = new ResizeObserver(() => t.requestAnimationFrame(() => this.handleResize())), this.resizeObserver.observe(t.document.body), t.addEventListener("orientationchange", this.handleResizer), t.addEventListener("resize", this.handleResizer), e.log("Decorator Mounted"), !0;
3549
3514
  }
3550
3515
  unmount(t, e) {
3551
- return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll($t.moduleName), this.resizeObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
3516
+ return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(Zt.moduleName), this.resizeObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
3552
3517
  }
3553
3518
  };
3554
- BA.moduleName = "decorator";
3555
- let Ni = BA;
3556
- const je = "readium-snapper-style", EA = class te extends vt {
3519
+ MA.moduleName = "decorator";
3520
+ let Qi = MA;
3521
+ const xe = "readium-snapper-style", fA = class Kt extends Vt {
3557
3522
  constructor() {
3558
3523
  super(...arguments), this.protected = !1;
3559
3524
  }
@@ -3566,35 +3531,35 @@ const je = "readium-snapper-style", EA = class te extends vt {
3566
3531
  }
3567
3532
  mount(t, e) {
3568
3533
  const A = t.document.createElement("style");
3569
- return A.dataset.readium = "true", A.id = je, A.textContent = this.buildStyles(), t.document.head.appendChild(A), e.register("protect", te.moduleName, (i, r) => {
3534
+ return A.dataset.readium = "true", A.id = xe, A.textContent = this.buildStyles(), t.document.head.appendChild(A), e.register("protect", Kt.moduleName, (i, r) => {
3570
3535
  this.protected = !0, A.textContent = this.buildStyles(), r(!0);
3571
- }), e.register("unprotect", te.moduleName, (i, r) => {
3536
+ }), e.register("unprotect", Kt.moduleName, (i, r) => {
3572
3537
  this.protected = !1, A.textContent = this.buildStyles(), r(!0);
3573
3538
  }), e.log("Snapper Mounted"), !0;
3574
3539
  }
3575
3540
  unmount(t, e) {
3576
3541
  var A;
3577
- return (A = t.document.getElementById(je)) == null || A.remove(), e.log("Snapper Unmounted"), !0;
3542
+ return (A = t.document.getElementById(xe)) == null || A.remove(), e.log("Snapper Unmounted"), !0;
3578
3543
  }
3579
3544
  };
3580
- EA.moduleName = "snapper";
3581
- let wA = EA;
3582
- function it(n) {
3545
+ fA.moduleName = "snapper";
3546
+ let pA = fA;
3547
+ function et(n) {
3583
3548
  return n.document.body.dir.toLowerCase() === "rtl";
3584
3549
  }
3585
- function IA(n) {
3550
+ function BA(n) {
3586
3551
  return parseInt(
3587
3552
  n.getComputedStyle(
3588
3553
  n.document.documentElement
3589
3554
  ).getPropertyValue("column-count")
3590
3555
  );
3591
3556
  }
3592
- function xi(n) {
3557
+ function zi(n) {
3593
3558
  const t = getComputedStyle(n), e = parseFloat(t.paddingTop || "0"), A = parseFloat(t.paddingBottom || "0");
3594
3559
  return n.clientHeight - e - A;
3595
3560
  }
3596
- function Ve(n) {
3597
- const t = IA(n);
3561
+ function Te(n) {
3562
+ const t = BA(n);
3598
3563
  if (!t)
3599
3564
  return !1;
3600
3565
  const e = n.document.querySelectorAll("div[id^='readium-virtual-page']");
@@ -3604,22 +3569,22 @@ function Ve(n) {
3604
3569
  if (o > 0)
3605
3570
  for (let a = 0; a < o; a++) {
3606
3571
  const l = n.document.createElement("div");
3607
- l.setAttribute("id", `readium-virtual-page-${a}`), l.dataset.readium = "true", CSS.supports("break-before", "column") ? l.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (l.style.breakInside = "avoid-column"), l.style.height = xi(n.document.documentElement) + "px"), l.innerHTML = "&#8203;", n.document.body.appendChild(l);
3572
+ l.setAttribute("id", `readium-virtual-page-${a}`), l.dataset.readium = "true", CSS.supports("break-before", "column") ? l.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (l.style.breakInside = "avoid-column"), l.style.height = zi(n.document.documentElement) + "px"), l.innerHTML = "&#8203;", n.document.body.appendChild(l);
3608
3573
  }
3609
3574
  return A !== o;
3610
3575
  }
3611
- function Ti(n) {
3576
+ function Yi(n) {
3612
3577
  const t = n.document.createElement("style");
3613
3578
  t.appendChild(n.document.createTextNode("*{}")), n.document.body.appendChild(t), n.document.body.removeChild(t);
3614
3579
  }
3615
- function ji(n) {
3580
+ function Ni(n) {
3616
3581
  return n < 0.5 ? 2 * n * n : -1 + (4 - 2 * n) * n;
3617
3582
  }
3618
- function x(n) {
3583
+ function S(n) {
3619
3584
  const t = n.getSelection();
3620
3585
  t && t.removeAllRanges();
3621
3586
  }
3622
- const Vi = [
3587
+ const Si = [
3623
3588
  "a",
3624
3589
  "audio",
3625
3590
  "button",
@@ -3633,36 +3598,36 @@ const Vi = [
3633
3598
  "textarea",
3634
3599
  "video"
3635
3600
  ];
3636
- function FA(n) {
3601
+ function EA(n) {
3637
3602
  var t;
3638
- return Vi.indexOf(n.nodeName.toLowerCase()) !== -1 || n.hasAttribute("contenteditable") && ((t = n.getAttribute("contenteditable")) == null ? void 0 : t.toLowerCase()) !== "false" ? n : n.parentElement ? FA(n.parentElement) : null;
3603
+ return Si.indexOf(n.nodeName.toLowerCase()) !== -1 || n.hasAttribute("contenteditable") && ((t = n.getAttribute("contenteditable")) == null ? void 0 : t.toLowerCase()) !== "false" ? n : n.parentElement ? EA(n.parentElement) : null;
3639
3604
  }
3640
- function UA(n, t) {
3641
- const e = yA(n, n.document.body, t), A = n._readium_cssSelectorGenerator.getCssSelector(e, {
3605
+ function wA(n, t) {
3606
+ const e = IA(n, n.document.body, t), A = n._readium_cssSelectorGenerator.getCssSelector(e, {
3642
3607
  selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
3643
3608
  });
3644
- return new At({
3609
+ return new tt({
3645
3610
  href: "#",
3646
3611
  type: "application/xhtml+xml",
3647
- locations: new Y({
3612
+ locations: new z({
3648
3613
  otherLocations: /* @__PURE__ */ new Map([
3649
3614
  ["cssSelector", A]
3650
3615
  ])
3651
3616
  }),
3652
- text: new mt({
3617
+ text: new ct({
3653
3618
  highlight: e.textContent || void 0
3654
3619
  })
3655
3620
  });
3656
3621
  }
3657
- function yA(n, t, e) {
3622
+ function IA(n, t, e) {
3658
3623
  for (var A = 0; A < t.children.length; A++) {
3659
3624
  const i = t.children[A];
3660
- if (!vi(i) && Pi(n, i, e))
3661
- return Di(n, i) ? i : yA(n, i, e);
3625
+ if (!ji(i) && xi(n, i, e))
3626
+ return Ti(n, i) ? i : IA(n, i, e);
3662
3627
  }
3663
3628
  return t;
3664
3629
  }
3665
- function Pi(n, t, e) {
3630
+ function xi(n, t, e) {
3666
3631
  if (t === document.body || t === document.documentElement)
3667
3632
  return !0;
3668
3633
  if (!document || !document.documentElement || !document.body)
@@ -3670,11 +3635,11 @@ function Pi(n, t, e) {
3670
3635
  const A = t.getBoundingClientRect();
3671
3636
  return e ? A.bottom > 0 && A.top < n.innerHeight : A.right > 0 && A.left < n.innerWidth;
3672
3637
  }
3673
- function Di(n, t) {
3638
+ function Ti(n, t) {
3674
3639
  const e = t.getBoundingClientRect();
3675
3640
  return e.top >= 0 && e.left >= 0 && e.bottom <= n.innerHeight && e.right <= n.innerWidth;
3676
3641
  }
3677
- function vi(n) {
3642
+ function ji(n) {
3678
3643
  const t = getComputedStyle(n);
3679
3644
  if (t) {
3680
3645
  const e = t.getPropertyValue("display");
@@ -3683,7 +3648,7 @@ function vi(n) {
3683
3648
  }
3684
3649
  return !1;
3685
3650
  }
3686
- const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3651
+ const je = "readium-column-snapper-style", Vi = 200, FA = class j extends pA {
3687
3652
  constructor() {
3688
3653
  super(...arguments), this.shakeTimeout = 0, this.snappingCancelled = !1, this.alreadyScrollLeft = 0, this.overscroll = 0, this.cachedScrollWidth = 0, this.touchState = 0, this.startingX = void 0, this.endingX = void 0, this.onTouchStarter = this.onTouchStart.bind(this), this.onTouchEnder = this.onTouchEnd.bind(this), this.onWidthChanger = this.onWidthChange.bind(this), this.onTouchMover = this.onTouchMove.bind(this);
3689
3654
  }
@@ -3694,7 +3659,7 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3694
3659
  return this.doc().scrollLeft > 0 ? this.doc().scrollLeft : this.alreadyScrollLeft;
3695
3660
  }
3696
3661
  snapOffset(t) {
3697
- const e = t + (it(this.wnd) ? -1 : 1);
3662
+ const e = t + (et(this.wnd) ? -1 : 1);
3698
3663
  return e - e % this.wnd.innerWidth;
3699
3664
  }
3700
3665
  reportProgress() {
@@ -3708,7 +3673,7 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3708
3673
  if (this.overscroll !== 0 || this.shakeTimeout !== 0)
3709
3674
  return;
3710
3675
  const t = this.doc();
3711
- t.classList.add(it(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
3676
+ t.classList.add(et(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
3712
3677
  const e = this.scrollOffset();
3713
3678
  this.shakeTimeout = this.wnd.setTimeout(() => {
3714
3679
  t.classList.remove("readium-bounce-l"), t.classList.remove("readium-bounce-r"), this.shakeTimeout = 0, this.doc().scrollLeft = e;
@@ -3723,15 +3688,15 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3723
3688
  }
3724
3689
  // Snaps the current offset to the page width.
3725
3690
  snapCurrentOffset(t = !1, e = !1) {
3726
- const A = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, i = this.doc(), r = this.dragOffset(), s = IA(this.wnd), o = Math.min(Math.max(0, A), this.cachedScrollWidth), a = it(this.wnd) ? -1 : 1, l = (
3691
+ const A = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, i = this.doc(), r = this.dragOffset(), s = BA(this.wnd), o = Math.min(Math.max(0, A), this.cachedScrollWidth), a = et(this.wnd) ? -1 : 1, l = (
3727
3692
  // The hurdle to overcome in order to change pages
3728
3693
  a * (this.wnd.innerWidth / 3) * (a * r > 0 ? 2 : 1)
3729
3694
  ), h = this.snapOffset(o + l);
3730
3695
  if (t && h !== this.scrollOffset()) {
3731
3696
  this.snappingCancelled = !1;
3732
- const c = (B, f, I, C) => I > C ? f : B + (f - B) * ji(I / C), g = (
3697
+ const c = (B, f, I, C) => I > C ? f : B + (f - B) * Ni(I / C), g = (
3733
3698
  /*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
3734
- bi * s
3699
+ Vi * s
3735
3700
  );
3736
3701
  let m;
3737
3702
  const M = (B) => {
@@ -3780,7 +3745,7 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3780
3745
  onTouchMove(t) {
3781
3746
  if (this.touchState === 0)
3782
3747
  return;
3783
- this.touchState === 1 && (this.touchState = 2, x(this.wnd)), this.endingX = t.touches[0].clientX;
3748
+ this.touchState === 1 && (this.touchState = 2, S(this.wnd)), this.endingX = t.touches[0].clientX;
3784
3749
  const e = this.dragOffset(), A = this.alreadyScrollLeft + e;
3785
3750
  A < 0 ? (this.overscroll = A, this.doc().style.transform = `translate3d(${-this.overscroll}px, 0px, 0px)`) : A + this.wnd.innerWidth > this.cachedScrollWidth ? (this.overscroll = A, this.doc().style.transform = `translate3d(${-A}px, 0px, 0px)`) : (this.overscroll = 0, this.doc().style.removeProperty("transform"), this.doc().scrollLeft = this.alreadyScrollLeft + e);
3786
3751
  }
@@ -3789,7 +3754,7 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3789
3754
  return !1;
3790
3755
  t.navigator.epubReadingSystem.layoutStyle = "paginated";
3791
3756
  const A = t.document.createElement("style");
3792
- A.dataset.readium = "true", A.id = Pe, A.textContent = `
3757
+ A.dataset.readium = "true", A.id = je, A.textContent = `
3793
3758
  @keyframes readium-bounce-l-animation {
3794
3759
  0%, 100% {transform: translate3d(0, 0, 0);}
3795
3760
  50% {transform: translate3d(-50px, 0, 0);}
@@ -3825,14 +3790,14 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3825
3790
  }
3826
3791
  `, t.document.head.appendChild(A), this.resizeObserver = new ResizeObserver(() => {
3827
3792
  t.requestAnimationFrame(() => {
3828
- t && Ve(t);
3793
+ t && Te(t);
3829
3794
  }), this.onWidthChange();
3830
3795
  }), this.resizeObserver.observe(t.document.body), this.mutationObserver = new MutationObserver((r) => {
3831
3796
  for (const s of r)
3832
3797
  if (s.target === this.wnd.document.documentElement) {
3833
3798
  const o = s.oldValue, a = s.target.getAttribute("style"), l = /transform\s*:\s*([^;]+)/, h = o == null ? void 0 : o.match(l), c = a == null ? void 0 : a.match(l);
3834
3799
  (!h && !c || h && !c || h && c && h[1] !== c[1]) && (t.requestAnimationFrame(() => {
3835
- t && Ve(t);
3800
+ t && Te(t);
3836
3801
  }), this.onWidthChange());
3837
3802
  } else
3838
3803
  t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
@@ -3841,7 +3806,7 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3841
3806
  const s = this.doc().scrollLeft;
3842
3807
  return this.doc().scrollLeft = this.snapOffset(r), s !== this.doc().scrollLeft;
3843
3808
  };
3844
- return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression", V.moduleName, (r, s) => {
3809
+ return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression", j.moduleName, (r, s) => {
3845
3810
  const o = r;
3846
3811
  if (o < 0 || o > 1) {
3847
3812
  e.send("error", {
@@ -3851,26 +3816,26 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3851
3816
  }
3852
3817
  this.wnd.requestAnimationFrame(() => {
3853
3818
  this.cachedScrollWidth = this.doc().scrollWidth;
3854
- const a = this.cachedScrollWidth, l = it(t) ? -1 : 1, h = a * o * l;
3855
- this.doc().scrollLeft = this.snapOffset(h), this.reportProgress(), x(this.wnd), s(!0);
3819
+ const a = this.cachedScrollWidth, l = et(t) ? -1 : 1, h = a * o * l;
3820
+ this.doc().scrollLeft = this.snapOffset(h), this.reportProgress(), S(this.wnd), s(!0);
3856
3821
  });
3857
- }), e.register("go_id", V.moduleName, (r, s) => {
3822
+ }), e.register("go_id", j.moduleName, (r, s) => {
3858
3823
  const o = t.document.getElementById(r);
3859
3824
  if (!o) {
3860
3825
  s(!1);
3861
3826
  return;
3862
3827
  }
3863
3828
  this.wnd.requestAnimationFrame(() => {
3864
- this.doc().scrollLeft = this.snapOffset(o.getBoundingClientRect().left + t.scrollX), this.reportProgress(), x(this.wnd), s(!0);
3829
+ this.doc().scrollLeft = this.snapOffset(o.getBoundingClientRect().left + t.scrollX), this.reportProgress(), S(this.wnd), s(!0);
3865
3830
  });
3866
- }), e.register("go_text", V.moduleName, (r, s) => {
3831
+ }), e.register("go_text", j.moduleName, (r, s) => {
3867
3832
  let o;
3868
3833
  Array.isArray(r) && (r.length > 1 && (o = r[1]), r = r[0]);
3869
- const a = mt.deserialize(r), l = ge(this.wnd.document, new At({
3834
+ const a = ct.deserialize(r), l = he(this.wnd.document, new tt({
3870
3835
  href: t.location.href,
3871
3836
  type: "text/html",
3872
3837
  text: a,
3873
- locations: o ? new Y({
3838
+ locations: o ? new z({
3874
3839
  otherLocations: /* @__PURE__ */ new Map([
3875
3840
  ["cssSelector", o]
3876
3841
  ])
@@ -3881,57 +3846,57 @@ const Pe = "readium-column-snapper-style", bi = 200, CA = class V extends wA {
3881
3846
  return;
3882
3847
  }
3883
3848
  this.wnd.requestAnimationFrame(() => {
3884
- this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(), x(this.wnd), s(!0);
3849
+ this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(), S(this.wnd), s(!0);
3885
3850
  });
3886
- }), e.register("go_end", V.moduleName, (r, s) => {
3887
- const o = it(t) ? -1 : 1;
3851
+ }), e.register("go_end", j.moduleName, (r, s) => {
3852
+ const o = et(t) ? -1 : 1;
3888
3853
  this.wnd.requestAnimationFrame(() => {
3889
3854
  this.cachedScrollWidth = this.doc().scrollWidth;
3890
3855
  const a = this.cachedScrollWidth * o;
3891
3856
  if (this.doc().scrollLeft === a)
3892
3857
  return s(!1);
3893
- this.doc().scrollLeft = this.snapOffset(a), this.reportProgress(), x(this.wnd), s(!0);
3858
+ this.doc().scrollLeft = this.snapOffset(a), this.reportProgress(), S(this.wnd), s(!0);
3894
3859
  });
3895
- }), e.register("go_start", V.moduleName, (r, s) => {
3860
+ }), e.register("go_start", j.moduleName, (r, s) => {
3896
3861
  this.wnd.requestAnimationFrame(() => {
3897
3862
  if (this.doc().scrollLeft === 0)
3898
3863
  return s(!1);
3899
- this.doc().scrollLeft = 0, this.reportProgress(), x(this.wnd), s(!0);
3864
+ this.doc().scrollLeft = 0, this.reportProgress(), S(this.wnd), s(!0);
3900
3865
  });
3901
- }), e.register("go_prev", V.moduleName, (r, s) => {
3866
+ }), e.register("go_prev", j.moduleName, (r, s) => {
3902
3867
  this.wnd.requestAnimationFrame(() => {
3903
3868
  this.cachedScrollWidth = this.doc().scrollWidth;
3904
- const o = t.scrollX - t.innerWidth, a = it(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, l = i(Math.max(o, a));
3905
- l && (this.reportProgress(), x(this.wnd)), s(l);
3869
+ const o = t.scrollX - t.innerWidth, a = et(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, l = i(Math.max(o, a));
3870
+ l && (this.reportProgress(), S(this.wnd)), s(l);
3906
3871
  });
3907
- }), e.register("go_next", V.moduleName, (r, s) => {
3872
+ }), e.register("go_next", j.moduleName, (r, s) => {
3908
3873
  this.wnd.requestAnimationFrame(() => {
3909
3874
  this.cachedScrollWidth = this.doc().scrollWidth;
3910
- const o = t.scrollX + t.innerWidth, a = it(t) ? 0 : this.cachedScrollWidth - t.innerWidth, l = i(Math.min(o, a));
3911
- l && (this.reportProgress(), x(this.wnd)), s(l);
3875
+ const o = t.scrollX + t.innerWidth, a = et(t) ? 0 : this.cachedScrollWidth - t.innerWidth, l = i(Math.min(o, a));
3876
+ l && (this.reportProgress(), S(this.wnd)), s(l);
3912
3877
  });
3913
- }), e.register("unfocus", V.moduleName, (r, s) => {
3914
- this.snappingCancelled = !0, x(this.wnd), s(!0);
3915
- }), e.register("shake", V.moduleName, (r, s) => {
3878
+ }), e.register("unfocus", j.moduleName, (r, s) => {
3879
+ this.snappingCancelled = !0, S(this.wnd), s(!0);
3880
+ }), e.register("shake", j.moduleName, (r, s) => {
3916
3881
  this.shake(), s(!0);
3917
- }), e.register("focus", V.moduleName, (r, s) => {
3882
+ }), e.register("focus", j.moduleName, (r, s) => {
3918
3883
  this.wnd.requestAnimationFrame(() => {
3919
3884
  this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), s(!0);
3920
3885
  });
3921
- }), e.register("first_visible_locator", V.moduleName, (r, s) => {
3922
- const o = UA(t, !1);
3886
+ }), e.register("first_visible_locator", j.moduleName, (r, s) => {
3887
+ const o = wA(t, !1);
3923
3888
  this.comms.send("first_visible_locator", o.serialize()), s(!0);
3924
3889
  }), t.addEventListener("touchstart", this.onTouchStarter, { passive: !0 }), t.addEventListener("touchend", this.onTouchEnder, { passive: !0 }), t.addEventListener("touchmove", this.onTouchMover, { passive: !0 }), t.document.addEventListener("touchstart", () => {
3925
3890
  }), e.log("ColumnSnapper Mounted"), !0;
3926
3891
  }
3927
3892
  unmount(t, e) {
3928
3893
  var A;
3929
- return this.snappingCancelled = !0, e.unregisterAll(V.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), (A = t.document.getElementById(Pe)) == null || A.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
3894
+ return this.snappingCancelled = !0, e.unregisterAll(j.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), (A = t.document.getElementById(je)) == null || A.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
3930
3895
  }
3931
3896
  };
3932
- CA.moduleName = "column_snapper";
3933
- let Gi = CA;
3934
- const De = "readium-scroll-snapper-style", RA = class v extends wA {
3897
+ FA.moduleName = "column_snapper";
3898
+ let Pi = FA;
3899
+ const Ve = "readium-scroll-snapper-style", UA = class D extends pA {
3935
3900
  constructor() {
3936
3901
  super(...arguments), this.isScrolling = !1, this.handleScroll = () => {
3937
3902
  this.isScrolling || (this.isScrolling = !0, this.wnd.requestAnimationFrame(() => {
@@ -3943,16 +3908,16 @@ const De = "readium-scroll-snapper-style", RA = class v extends wA {
3943
3908
  return this.wnd.document.scrollingElement;
3944
3909
  }
3945
3910
  reportProgress() {
3946
- const t = this.doc().scrollTop, e = this.doc().scrollHeight, A = Math.max(0, Math.min(1, t / e)), i = Math.max(0, Math.min(1, (t + this.wnd.innerHeight) / e));
3911
+ const t = Math.ceil(this.doc().scrollTop), e = this.doc().scrollHeight, A = this.wnd.innerHeight, i = Math.max(0, Math.min(1, t / e)), r = Math.max(0, Math.min(1, (t + A) / e));
3947
3912
  this.comms.send("progress", {
3948
- start: A,
3949
- end: i
3913
+ start: i,
3914
+ end: r
3950
3915
  });
3951
3916
  }
3952
3917
  mount(t, e) {
3953
3918
  this.wnd = t, this.comms = e, t.navigator.epubReadingSystem.layoutStyle = "scrolling";
3954
3919
  const A = t.document.createElement("style");
3955
- return A.dataset.readium = "true", A.id = De, A.textContent = `
3920
+ return A.dataset.readium = "true", A.id = Ve, A.textContent = `
3956
3921
  * {
3957
3922
  scrollbar-width: none; /* for Firefox */
3958
3923
  }
@@ -3964,11 +3929,11 @@ const De = "readium-scroll-snapper-style", RA = class v extends wA {
3964
3929
  this.comms.ready && this.handleScroll();
3965
3930
  }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, {
3966
3931
  passive: !0
3967
- }), e.register("force_webkit_recalc", v.moduleName, () => {
3968
- Ti(this.wnd);
3932
+ }), e.register("force_webkit_recalc", D.moduleName, () => {
3933
+ Yi(this.wnd);
3969
3934
  const i = this.doc().scrollTop;
3970
- this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
3971
- }), e.register("go_progression", v.moduleName, (i, r) => {
3935
+ i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
3936
+ }), e.register("go_progression", D.moduleName, (i, r) => {
3972
3937
  const s = i;
3973
3938
  if (s < 0 || s > 1) {
3974
3939
  e.send("error", {
@@ -3977,25 +3942,25 @@ const De = "readium-scroll-snapper-style", RA = class v extends wA {
3977
3942
  return;
3978
3943
  }
3979
3944
  this.wnd.requestAnimationFrame(() => {
3980
- this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), x(this.wnd), r(!0);
3945
+ this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), S(this.wnd), r(!0);
3981
3946
  });
3982
- }), e.register("go_id", v.moduleName, (i, r) => {
3947
+ }), e.register("go_id", D.moduleName, (i, r) => {
3983
3948
  const s = t.document.getElementById(i);
3984
3949
  if (!s) {
3985
3950
  r(!1);
3986
3951
  return;
3987
3952
  }
3988
3953
  this.wnd.requestAnimationFrame(() => {
3989
- this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), x(this.wnd), r(!0);
3954
+ this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), S(this.wnd), r(!0);
3990
3955
  });
3991
- }), e.register("go_text", v.moduleName, (i, r) => {
3956
+ }), e.register("go_text", D.moduleName, (i, r) => {
3992
3957
  let s;
3993
3958
  Array.isArray(i) && (i.length > 1 && (s = i[1]), i = i[0]);
3994
- const o = mt.deserialize(i), a = ge(this.wnd.document, new At({
3959
+ const o = ct.deserialize(i), a = he(this.wnd.document, new tt({
3995
3960
  href: t.location.href,
3996
3961
  type: "text/html",
3997
3962
  text: o,
3998
- locations: s ? new Y({
3963
+ locations: s ? new z({
3999
3964
  otherLocations: /* @__PURE__ */ new Map([
4000
3965
  ["cssSelector", s]
4001
3966
  ])
@@ -4006,36 +3971,36 @@ const De = "readium-scroll-snapper-style", RA = class v extends wA {
4006
3971
  return;
4007
3972
  }
4008
3973
  this.wnd.requestAnimationFrame(() => {
4009
- this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), x(this.wnd), r(!0);
3974
+ this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), S(this.wnd), r(!0);
4010
3975
  });
4011
- }), e.register("go_start", v.moduleName, (i, r) => {
3976
+ }), e.register("go_start", D.moduleName, (i, r) => {
4012
3977
  if (this.doc().scrollTop === 0)
4013
3978
  return r(!1);
4014
3979
  this.doc().scrollTop = 0, this.reportProgress(), r(!0);
4015
- }), e.register("go_end", v.moduleName, (i, r) => {
3980
+ }), e.register("go_end", D.moduleName, (i, r) => {
4016
3981
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight)
4017
3982
  return r(!1);
4018
3983
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), r(!0);
4019
- }), e.register("unfocus", v.moduleName, (i, r) => {
4020
- x(this.wnd), r(!0);
3984
+ }), e.register("unfocus", D.moduleName, (i, r) => {
3985
+ S(this.wnd), r(!0);
4021
3986
  }), e.register([
4022
3987
  "go_next",
4023
3988
  "go_prev"
4024
- ], v.moduleName, (i, r) => r(!1)), e.register("focus", v.moduleName, (i, r) => {
3989
+ ], D.moduleName, (i, r) => r(!1)), e.register("focus", D.moduleName, (i, r) => {
4025
3990
  this.reportProgress(), r(!0);
4026
- }), e.register("first_visible_locator", v.moduleName, (i, r) => {
4027
- const s = UA(t, !0);
3991
+ }), e.register("first_visible_locator", D.moduleName, (i, r) => {
3992
+ const s = wA(t, !0);
4028
3993
  this.comms.send("first_visible_locator", s.serialize()), r(!0);
4029
3994
  }), e.log("ScrollSnapper Mounted"), !0;
4030
3995
  }
4031
3996
  unmount(t, e) {
4032
3997
  var A;
4033
- return e.unregisterAll(v.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), (A = t.document.getElementById(De)) == null || A.remove(), e.log("ScrollSnapper Unmounted"), !0;
3998
+ return e.unregisterAll(D.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), (A = t.document.getElementById(Ve)) == null || A.remove(), e.log("ScrollSnapper Unmounted"), !0;
4034
3999
  }
4035
4000
  };
4036
- RA.moduleName = "scroll_snapper";
4037
- let Hi = RA;
4038
- class QA extends vt {
4001
+ UA.moduleName = "scroll_snapper";
4002
+ let Di = UA;
4003
+ class CA extends Vt {
4039
4004
  constructor() {
4040
4005
  super(...arguments), this.pointerMoved = !1, this.onPointerUp = this.onPointUp.bind(this), this.onPointerMove = this.onPointMove.bind(this), this.onPointerDown = this.onPointDown.bind(this), this.onContextMenu = this.onContext.bind(this), this.onClicker = this.onClick.bind(this);
4041
4006
  }
@@ -4069,7 +4034,7 @@ class QA extends vt {
4069
4034
  y: t.clientY * a,
4070
4035
  targetFrameSrc: this.wnd.location.href,
4071
4036
  targetElement: t.target.outerHTML,
4072
- interactiveElement: (s = FA(t.target)) == null ? void 0 : s.outerHTML,
4037
+ interactiveElement: (s = EA(t.target)) == null ? void 0 : s.outerHTML,
4073
4038
  cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(t.target)
4074
4039
  }), this.pointerMoved = !1;
4075
4040
  }
@@ -4105,8 +4070,8 @@ class QA extends vt {
4105
4070
  return t.document.removeEventListener("pointerdown", this.onPointerDown), t.document.removeEventListener("pointerup", this.onPointerUp), t.document.removeEventListener("contextmenu", this.onContextMenu), t.document.removeEventListener("pointermove", this.onPointerMove), t.document.removeEventListener("click", this.onClicker), e.log("Peripherals Unmounted"), !0;
4106
4071
  }
4107
4072
  }
4108
- QA.moduleName = "peripherals";
4109
- const zA = class ee extends vt {
4073
+ CA.moduleName = "peripherals";
4074
+ const yA = class qt extends Vt {
4110
4075
  constructor() {
4111
4076
  super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
4112
4077
  }
@@ -4160,7 +4125,7 @@ const zA = class ee extends vt {
4160
4125
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
4161
4126
  value: {
4162
4127
  name: "readium-ts-toolkit",
4163
- version: "2.0.0-beta.4",
4128
+ version: "2.0.0-beta.5",
4164
4129
  hasFeature: (i, r = "") => {
4165
4130
  switch (i) {
4166
4131
  case "dom-manipulation":
@@ -4185,11 +4150,11 @@ const zA = class ee extends vt {
4185
4150
  writable: !1
4186
4151
  }), "getAnimations" in t.document && t.document.getAnimations().forEach((i) => {
4187
4152
  i.cancel(), this.allAnimations.add(i);
4188
- }), e.register("activate", ee.moduleName, (i, r) => {
4153
+ }), e.register("activate", qt.moduleName, (i, r) => {
4189
4154
  this.allAnimations.forEach((s) => {
4190
4155
  s.cancel(), s.play();
4191
4156
  }), r(!0);
4192
- }), e.register("unfocus", ee.moduleName, (i, r) => {
4157
+ }), e.register("unfocus", qt.moduleName, (i, r) => {
4193
4158
  this.pauseAllMedia(t), this.allAnimations.forEach((s) => s.pause()), r(!0);
4194
4159
  });
4195
4160
  const A = t.document.querySelectorAll("audio,video");
@@ -4207,49 +4172,49 @@ const zA = class ee extends vt {
4207
4172
  return t.removeEventListener("error", this.wndOnErr), t.removeEventListener("play", this.onMediaPlayEvent), t.removeEventListener("pause", this.onMediaPauseEvent), this.allAnimations.forEach((A) => A.cancel()), this.allAnimations.clear(), e.log("Setup Unmounted"), !0;
4208
4173
  }
4209
4174
  };
4210
- zA.moduleName = "setup";
4211
- let YA = zA;
4212
- const ve = "readium-viewport", SA = class nt extends YA {
4175
+ yA.moduleName = "setup";
4176
+ let RA = yA;
4177
+ const Pe = "readium-viewport", QA = class At extends RA {
4213
4178
  onViewportWidthChanged(t) {
4214
4179
  const e = t.target;
4215
- Tt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
4180
+ Yt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
4216
4181
  }
4217
4182
  mount(t, e) {
4218
4183
  if (!super.mount(t, e))
4219
4184
  return !1;
4220
4185
  const A = t.document.createElement("meta");
4221
- return A.dataset.readium = "true", A.setAttribute("name", "viewport"), A.setAttribute("id", ve), A.setAttribute(
4186
+ return A.dataset.readium = "true", A.setAttribute("name", "viewport"), A.setAttribute("id", Pe), A.setAttribute(
4222
4187
  "content",
4223
4188
  "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
4224
4189
  ), t.document.head.appendChild(A), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
4225
4190
  target: t
4226
- }), e.register("get_properties", nt.moduleName, (i, r) => {
4227
- pA(t), r(!0);
4228
- }), e.register("update_properties", nt.moduleName, (i, r) => {
4229
- i["--RS__viewportWidth"] = `${t.innerWidth}px`, Ci(t, i), r(!0);
4230
- }), e.register("set_property", nt.moduleName, (i, r) => {
4191
+ }), e.register("get_properties", At.moduleName, (i, r) => {
4192
+ mA(t), r(!0);
4193
+ }), e.register("update_properties", At.moduleName, (i, r) => {
4194
+ i["--RS__viewportWidth"] = `${t.innerWidth}px`, Ii(t, i), r(!0);
4195
+ }), e.register("set_property", At.moduleName, (i, r) => {
4231
4196
  const s = i;
4232
- Tt(t, s[0], s[1]), r(!0);
4233
- }), e.register("remove_property", nt.moduleName, (i, r) => {
4234
- de(t, i), r(!0);
4235
- }), e.register("activate", nt.moduleName, (i, r) => {
4197
+ Yt(t, s[0], s[1]), r(!0);
4198
+ }), e.register("remove_property", At.moduleName, (i, r) => {
4199
+ ce(t, i), r(!0);
4200
+ }), e.register("activate", At.moduleName, (i, r) => {
4236
4201
  this.unblock(t), r(!0);
4237
4202
  }), e.log("ReflowableSetup Mounted"), !0;
4238
4203
  }
4239
4204
  unmount(t, e) {
4240
4205
  var A;
4241
- return e.unregisterAll(nt.moduleName), (A = t.document.head.querySelector(`#${ve}`)) == null || A.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
4206
+ return e.unregisterAll(At.moduleName), (A = t.document.head.querySelector(`#${Pe}`)) == null || A.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
4242
4207
  }
4243
4208
  };
4244
- SA.moduleName = "reflowable_setup";
4245
- let ki = SA;
4246
- const be = "readium-fixed-style", NA = class q extends YA {
4209
+ QA.moduleName = "reflowable_setup";
4210
+ let vi = QA;
4211
+ const De = "readium-fixed-style", zA = class Z extends RA {
4247
4212
  mount(t, e) {
4248
4213
  if (!super.mount(t, e))
4249
4214
  return !1;
4250
4215
  t.navigator.epubReadingSystem.layoutStyle = "paginated";
4251
4216
  const A = t.document.createElement("style");
4252
- return A.id = be, A.dataset.readium = "true", A.textContent = `
4217
+ return A.id = De, A.dataset.readium = "true", A.textContent = `
4253
4218
  html, body {
4254
4219
  text-size-adjust: none;
4255
4220
  -ms-text-size-adjust: none;
@@ -4261,13 +4226,13 @@ const be = "readium-fixed-style", NA = class q extends YA {
4261
4226
  min-height: 100%;
4262
4227
 
4263
4228
  /*cursor: var() TODO*/
4264
- }`, t.document.head.appendChild(A), e.register("set_property", q.moduleName, (i, r) => {
4229
+ }`, t.document.head.appendChild(A), e.register("set_property", Z.moduleName, (i, r) => {
4265
4230
  const s = i;
4266
- Tt(t, s[0], s[1]), r(!0);
4267
- }), e.register("remove_property", q.moduleName, (i, r) => {
4268
- de(t, i), r(!0);
4269
- }), e.register("first_visible_locator", q.moduleName, (i, r) => r(!1)), e.register("unfocus", q.moduleName, (i, r) => {
4270
- x(t), r(!0);
4231
+ Yt(t, s[0], s[1]), r(!0);
4232
+ }), e.register("remove_property", Z.moduleName, (i, r) => {
4233
+ ce(t, i), r(!0);
4234
+ }), e.register("first_visible_locator", Z.moduleName, (i, r) => r(!1)), e.register("unfocus", Z.moduleName, (i, r) => {
4235
+ S(t), r(!0);
4271
4236
  }), e.register([
4272
4237
  "focus",
4273
4238
  "go_next",
@@ -4277,43 +4242,43 @@ const be = "readium-fixed-style", NA = class q extends YA {
4277
4242
  "go_start",
4278
4243
  "go_text",
4279
4244
  "go_progression"
4280
- ], q.moduleName, (i, r) => r(!0)), e.register("activate", q.moduleName, (i, r) => {
4245
+ ], Z.moduleName, (i, r) => r(!0)), e.register("activate", Z.moduleName, (i, r) => {
4281
4246
  this.unblock(t), r(!0);
4282
4247
  }), e.log("FixedSetup Mounted"), !0;
4283
4248
  }
4284
4249
  unmount(t, e) {
4285
4250
  var A;
4286
- return e.unregisterAll(q.moduleName), (A = t.document.getElementById(be)) == null || A.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
4251
+ return e.unregisterAll(Z.moduleName), (A = t.document.getElementById(De)) == null || A.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
4287
4252
  }
4288
4253
  };
4289
- NA.moduleName = "fixed_setup";
4290
- let Ji = NA;
4291
- const Wi = [
4254
+ zA.moduleName = "fixed_setup";
4255
+ let bi = zA;
4256
+ const Gi = [
4292
4257
  "fixed_setup",
4293
4258
  "decorator",
4294
4259
  "peripherals"
4295
- ], Li = [
4260
+ ], Hi = [
4296
4261
  "reflowable_setup",
4297
4262
  "decorator",
4298
4263
  "peripherals",
4299
4264
  "column_snapper",
4300
4265
  "scroll_snapper"
4301
- ], Ae = new Map([
4266
+ ], _t = new Map([
4302
4267
  // All modules go here
4303
- Ji,
4304
- ki,
4305
- QA,
4306
- Ni,
4307
- Gi,
4308
- Hi
4268
+ bi,
4269
+ vi,
4270
+ CA,
4271
+ Qi,
4272
+ Pi,
4273
+ Di
4309
4274
  ].map((n) => [n.moduleName, n]));
4310
- class jt {
4275
+ class Nt {
4311
4276
  /**
4312
4277
  * @param wnd Window instance to operate on
4313
4278
  * @param initialModules List of initial modules to load
4314
4279
  */
4315
4280
  constructor(t = window, e = []) {
4316
- this.loadedModules = [], this.wnd = t, this.comms = new li(t);
4281
+ this.loadedModules = [], this.wnd = t, this.comms = new ri(t);
4317
4282
  const A = [...new Set(e)];
4318
4283
  if (A.length) {
4319
4284
  if (typeof t > "u")
@@ -4326,7 +4291,7 @@ class jt {
4326
4291
  }
4327
4292
  }
4328
4293
  loadModule(t) {
4329
- const e = Ae.get(t);
4294
+ const e = _t.get(t);
4330
4295
  return e === void 0 ? (this.comms.log(`Module "${name}" does not exist in the library`), e) : new e();
4331
4296
  }
4332
4297
  /**
@@ -4344,7 +4309,7 @@ class jt {
4344
4309
  * @returns Success
4345
4310
  */
4346
4311
  removeModule(t) {
4347
- const e = Ae.get(t);
4312
+ const e = _t.get(t);
4348
4313
  if (e === void 0)
4349
4314
  return this.comms.log(`Module "${t}" does not exist in the library`), !1;
4350
4315
  const A = this.loadedModules.findIndex((i) => i instanceof e);
@@ -4357,18 +4322,18 @@ class jt {
4357
4322
  this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
4358
4323
  }
4359
4324
  }
4360
- const Oi = 1e4;
4361
- class ie {
4325
+ const ki = 1e4;
4326
+ class $t {
4362
4327
  constructor(t, e) {
4363
4328
  this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
4364
4329
  try {
4365
4330
  this.channelId = window.crypto.randomUUID();
4366
4331
  } catch {
4367
- this.channelId = qt();
4332
+ this.channelId = Ot();
4368
4333
  }
4369
4334
  this.gc = setInterval(() => {
4370
4335
  this.registry.forEach((A, i) => {
4371
- performance.now() - A.time > Oi && (console.warn(i, "event for", A.key, "was never handled!"), this.registry.delete(i));
4336
+ performance.now() - A.time > ki && (console.warn(i, "event for", A.key, "was never handled!"), this.registry.delete(i));
4372
4337
  });
4373
4338
  }, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
4374
4339
  }
@@ -4418,7 +4383,7 @@ class ie {
4418
4383
  * @returns Identifier associated with the message
4419
4384
  */
4420
4385
  send(t, e, A, i = !1, r = []) {
4421
- const s = qt();
4386
+ const s = Ot();
4422
4387
  return A && this.registry.set(s, {
4423
4388
  // Add callback to the registry
4424
4389
  cb: A,
@@ -4426,7 +4391,7 @@ class ie {
4426
4391
  key: t
4427
4392
  }), this.wnd.postMessage(
4428
4393
  {
4429
- _readium: ot,
4394
+ _readium: rt,
4430
4395
  _channel: this.channelId,
4431
4396
  id: s,
4432
4397
  data: e,
@@ -4439,16 +4404,16 @@ class ie {
4439
4404
  ), s;
4440
4405
  }
4441
4406
  }
4442
- const Xi = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Zi = "Athelas, Constantia, Charter, 'Bitstream Charter', Cambria, 'Georgia Pro', Georgia, serif", Ki = "-ui-sans-serif, -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Liberation Sans', Arial, sans-serif", qi = "Seravek, Calibri, 'Gill Sans Nova', Roboto, Ubuntu, 'DejaVu Sans', source-sans-pro, sans-serif", _i = "ui-monospace, 'Andale Mono', 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace", $i = {
4443
- RS__oldStyleTf: Xi,
4444
- RS__modernTf: Zi,
4445
- RS__sansTf: Ki,
4446
- RS__humanistTf: qi,
4447
- RS__monospaceTf: _i
4448
- }, tn = 16, Ge = $i.RS__oldStyleTf;
4449
- class Bt {
4407
+ const Ji = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Wi = "Athelas, Constantia, Charter, 'Bitstream Charter', Cambria, 'Georgia Pro', Georgia, serif", Li = "-ui-sans-serif, -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Liberation Sans', Arial, sans-serif", Oi = "Seravek, Calibri, 'Gill Sans Nova', Roboto, Ubuntu, 'DejaVu Sans', source-sans-pro, sans-serif", Xi = "ui-monospace, 'Andale Mono', 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace", Zi = {
4408
+ RS__oldStyleTf: Ji,
4409
+ RS__modernTf: Wi,
4410
+ RS__sansTf: Li,
4411
+ RS__humanistTf: Oi,
4412
+ RS__monospaceTf: Xi
4413
+ }, Ki = 16, ve = Zi.RS__oldStyleTf;
4414
+ class ut {
4450
4415
  constructor(t) {
4451
- this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || tn, this._fontFace = t.fontFace || Ge, this._sample = t.sample || null, this._pageGutter = t.pageGutter || 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._padding = this._pageGutter * 2, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = Bt.approximateWordSpaces(this._optimalChars, this._sample);
4416
+ this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Ki, this._fontFace = t.fontFace || ve, this._sample = t.sample || null, this._pageGutter = t.pageGutter || 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._padding = this._pageGutter * 2, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = ut.approximateWordSpaces(this._optimalChars, this._sample);
4452
4417
  }
4453
4418
  updateMultipliers() {
4454
4419
  this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1;
@@ -4457,7 +4422,7 @@ class Bt {
4457
4422
  // Not filtering because pretty much everything can
4458
4423
  // trigger a recomputation anyway.
4459
4424
  update(t) {
4460
- t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || Ge), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.pageGutter && (this._pageGutter = t.pageGutter), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces = Bt.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
4425
+ t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || ve), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.pageGutter && (this._pageGutter = t.pageGutter), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces = ut.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
4461
4426
  }
4462
4427
  get baseFontSize() {
4463
4428
  return this._baseFontSize;
@@ -4513,7 +4478,7 @@ class Bt {
4513
4478
  if (e.font = `${this._baseFontSize}px ${t}`, this._sample && this._sample.length >= this._optimalChars && (A = this._sample.slice(0, this._optimalChars)), Object.hasOwn(e, "letterSpacing") && Object.hasOwn(e, "wordSpacing"))
4514
4479
  return e.letterSpacing = this._letterSpacing.toString() + "px", e.wordSpacing = this._wordSpacing.toString() + "px", e.measureText(A).width;
4515
4480
  {
4516
- const i = this._letterSpacing * (this._optimalChars - 1), r = this._wordSpacing * Bt.approximateWordSpaces(this._optimalChars, this._sample);
4481
+ const i = this._letterSpacing * (this._optimalChars - 1), r = this._wordSpacing * ut.approximateWordSpaces(this._optimalChars, this._sample);
4517
4482
  return e.measureText(A).width + i + r;
4518
4483
  }
4519
4484
  } else
@@ -4530,10 +4495,10 @@ class Bt {
4530
4495
  * Portions of this code come from the sML library
4531
4496
  * Current version: 1.0.36
4532
4497
  */
4533
- const xA = () => typeof navigator > "u" ? "" : navigator.userAgent || "", TA = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
4534
- class jA {
4498
+ const YA = () => typeof navigator > "u" ? "" : navigator.userAgent || "", NA = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
4499
+ class SA {
4535
4500
  constructor() {
4536
- const t = TA(), e = xA(), A = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((s) => parseInt(s) || 0) : [], i = (r = "") => {
4501
+ const t = NA(), e = YA(), A = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((s) => parseInt(s) || 0) : [], i = (r = "") => {
4537
4502
  if (!r)
4538
4503
  return [];
4539
4504
  const s = new RegExp("^.*" + r + "[ :\\/]?(\\d+([\\._]\\d+)*).*$");
@@ -4574,17 +4539,17 @@ class jA {
4574
4539
  }, []) };
4575
4540
  }
4576
4541
  }
4577
- class en extends jA {
4542
+ class qi extends SA {
4578
4543
  get iOSRequest() {
4579
- const t = TA(), e = xA();
4544
+ const t = NA(), e = YA();
4580
4545
  if (this.OS.iOS && !this.OS.iPadOS)
4581
4546
  return "mobile";
4582
4547
  if (this.OS.iPadOS)
4583
4548
  return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
4584
4549
  }
4585
4550
  }
4586
- const Ct = new jA(), X = new en();
4587
- class An {
4551
+ const It = new SA(), O = new qi();
4552
+ class _i {
4588
4553
  constructor(t) {
4589
4554
  this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t;
4590
4555
  }
@@ -4600,7 +4565,7 @@ class An {
4600
4565
  }
4601
4566
  return;
4602
4567
  }
4603
- (i = this.comms) == null || i.halt(), this.loader.destroy(), this.loader = new jt(r, t), this.currModules = t, this.comms = void 0;
4568
+ (i = this.comms) == null || i.halt(), this.loader.destroy(), this.loader = new Nt(r, t), this.currModules = t, this.comms = void 0;
4604
4569
  try {
4605
4570
  e(r);
4606
4571
  } catch {
@@ -4609,7 +4574,7 @@ class An {
4609
4574
  }
4610
4575
  this.frame.onload = () => {
4611
4576
  const r = this.frame.contentWindow;
4612
- this.loader = new jt(r, t), this.currModules = t;
4577
+ this.loader = new Nt(r, t), this.currModules = t;
4613
4578
  try {
4614
4579
  e(r);
4615
4580
  } catch {
@@ -4645,7 +4610,7 @@ class An {
4645
4610
  throw Error("Trying to show frame when it doesn't exist");
4646
4611
  if (!this.frame.parentElement)
4647
4612
  throw Error("Trying to show frame that is not attached to the DOM");
4648
- return this.comms ? this.comms.resume() : this.comms = new ie(this.frame.contentWindow, this.source), new Promise((e, A) => {
4613
+ return this.comms ? this.comms.resume() : this.comms = new $t(this.frame.contentWindow, this.source), new Promise((e, A) => {
4649
4614
  var i;
4650
4615
  (i = this.comms) == null || i.send("activate", void 0, () => {
4651
4616
  var r;
@@ -4653,7 +4618,7 @@ class An {
4653
4618
  var o;
4654
4619
  const s = () => {
4655
4620
  var a;
4656
- this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("aria-hidden"), this.frame.style.removeProperty("opacity"), this.frame.style.removeProperty("pointer-events"), this.hidden = !1, Ct.UA.WebKit && ((a = this.comms) == null || a.send("force_webkit_recalc", void 0)), e();
4621
+ this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("aria-hidden"), this.frame.style.removeProperty("opacity"), this.frame.style.removeProperty("pointer-events"), this.hidden = !1, It.UA.WebKit && ((a = this.comms) == null || a.send("force_webkit_recalc", void 0)), e();
4657
4622
  };
4658
4623
  t !== void 0 ? (o = this.comms) == null || o.send("go_progression", t, s) : s();
4659
4624
  });
@@ -4662,7 +4627,7 @@ class An {
4662
4627
  }
4663
4628
  setCSSProperties(t) {
4664
4629
  var e, A, i;
4665
- this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? (e = this.comms) == null || e.resume() : this.comms = new ie(this.frame.contentWindow, this.source)), (A = this.comms) == null || A.send("update_properties", t), this.hidden && ((i = this.comms) == null || i.halt()));
4630
+ this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? (e = this.comms) == null || e.resume() : this.comms = new $t(this.frame.contentWindow, this.source)), (A = this.comms) == null || A.send("update_properties", t), this.hidden && ((i = this.comms) == null || i.halt()));
4666
4631
  }
4667
4632
  get iframe() {
4668
4633
  if (this.destroyed)
@@ -4692,8 +4657,8 @@ class An {
4692
4657
  return this.loader;
4693
4658
  }
4694
4659
  }
4695
- const He = 5, ke = 3;
4696
- class nn {
4660
+ const be = 5, Ge = 3;
4661
+ class $i {
4697
4662
  constructor(t, e, A) {
4698
4663
  this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.container = t, this.positions = e, this.currentCssProperties = A;
4699
4664
  }
@@ -4720,7 +4685,7 @@ class nn {
4720
4685
  var M, B;
4721
4686
  const h = [], c = [];
4722
4687
  this.positions.forEach((f, I) => {
4723
- (I > r + He || I < r - He) && (h.includes(f.href) || h.push(f.href)), I < r + ke && I > r - ke && (c.includes(f.href) || c.push(f.href));
4688
+ (I > r + be || I < r - be) && (h.includes(f.href) || h.push(f.href)), I < r + Ge && I > r - Ge && (c.includes(f.href) || c.push(f.href));
4724
4689
  }), h.forEach(async (f) => {
4725
4690
  var I;
4726
4691
  c.includes(f) || this.pool.has(f) && (await ((I = this.pool.get(f)) == null ? void 0 : I.destroy()), this.pool.delete(f), this.pendingUpdates.has(f) && this.pendingUpdates.set(f, { inPool: !1 }));
@@ -4744,10 +4709,10 @@ class nn {
4744
4709
  if (!I)
4745
4710
  return;
4746
4711
  if (!this.blobs.has(f)) {
4747
- const j = await new lA(t, this.currentBaseURL || "", I, this.currentCssProperties).build();
4748
- this.blobs.set(f, j);
4712
+ const T = await new sA(t, this.currentBaseURL || "", I, this.currentCssProperties).build();
4713
+ this.blobs.set(f, T);
4749
4714
  }
4750
- const C = new An(this.blobs.get(f));
4715
+ const C = new _i(this.blobs.get(f));
4751
4716
  f !== s && await C.hide(), this.container.appendChild(C.iframe), await C.load(A), this.pool.set(f, C);
4752
4717
  };
4753
4718
  try {
@@ -4802,7 +4767,7 @@ class nn {
4802
4767
  }), t;
4803
4768
  }
4804
4769
  }
4805
- class rn {
4770
+ class tn {
4806
4771
  constructor(t, e, A) {
4807
4772
  this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = A, this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = A, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === w.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
4808
4773
  }
@@ -4818,7 +4783,7 @@ class rn {
4818
4783
  }
4819
4784
  return;
4820
4785
  }
4821
- (r = this.comms) == null || r.halt(), this.loader.destroy(), this.loader = new jt(s, t), this.currModules = t, this.comms = void 0;
4786
+ (r = this.comms) == null || r.halt(), this.loader.destroy(), this.loader = new Nt(s, t), this.currModules = t, this.comms = void 0;
4822
4787
  try {
4823
4788
  A(s), this.loadPromise = void 0;
4824
4789
  } catch {
@@ -4827,7 +4792,7 @@ class rn {
4827
4792
  }
4828
4793
  this.frame.addEventListener("load", () => {
4829
4794
  const s = this.frame.contentWindow;
4830
- this.loader = new jt(s, t), this.currModules = t, this.peripherals.observe(this.wrapper), this.peripherals.observe(s);
4795
+ this.loader = new Nt(s, t), this.currModules = t, this.peripherals.observe(this.wrapper), this.peripherals.observe(s);
4831
4796
  try {
4832
4797
  A(s);
4833
4798
  } catch {
@@ -4866,10 +4831,10 @@ class rn {
4866
4831
  const A = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
4867
4832
  this.frame.style.transform = `scale(${A})`;
4868
4833
  const i = this.frame.getBoundingClientRect(), r = this.wrapper.clientHeight - i.height;
4869
- if (this.frame.style.top = `${r / 2}px`, t === W.left) {
4834
+ if (this.frame.style.top = `${r / 2}px`, t === J.left) {
4870
4835
  const s = this.wrapper.clientWidth - i.width;
4871
4836
  this.frame.style.left = `${s}px`;
4872
- } else if (t === W.center) {
4837
+ } else if (t === J.center) {
4873
4838
  const s = this.wrapper.clientWidth - i.width;
4874
4839
  this.frame.style.left = `${s / 2}px`;
4875
4840
  } else
@@ -4922,7 +4887,7 @@ class rn {
4922
4887
  this.showPromise = void 0;
4923
4888
  return;
4924
4889
  }
4925
- return this.showPromise ? (this.cachedPage !== t && (this.update(t), this.cachedPage = t), this.showPromise) : (this.cachedPage = t, this.comms ? this.comms.resume() : this.comms = new ie(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, A) => {
4890
+ return this.showPromise ? (this.cachedPage !== t && (this.update(t), this.cachedPage = t), this.showPromise) : (this.cachedPage = t, this.comms ? this.comms.resume() : this.comms = new $t(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, A) => {
4926
4891
  this.comms.send("focus", void 0, (i) => {
4927
4892
  this.update(this.cachedPage), e();
4928
4893
  });
@@ -4976,13 +4941,13 @@ class rn {
4976
4941
  return this.loader;
4977
4942
  }
4978
4943
  }
4979
- var sn = /* @__PURE__ */ ((n) => (n[n.Left = 0] = "Left", n[n.Center = 1] = "Center", n[n.Right = 2] = "Right", n))(sn || {}), on = /* @__PURE__ */ ((n) => (n[n.Top = 0] = "Top", n[n.Middle = 1] = "Middle", n[n.Bottom = 2] = "Bottom", n))(on || {});
4980
- class an {
4944
+ var en = /* @__PURE__ */ ((n) => (n[n.Left = 0] = "Left", n[n.Center = 1] = "Center", n[n.Right = 2] = "Right", n))(en || {}), An = /* @__PURE__ */ ((n) => (n[n.Top = 0] = "Top", n[n.Middle = 1] = "Middle", n[n.Bottom = 2] = "Bottom", n))(An || {});
4945
+ class nn {
4981
4946
  constructor() {
4982
4947
  this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
4983
4948
  }
4984
4949
  refreshOuterPixels(t) {
4985
- Ct.OS.iOS || (this.outerHeight = window.outerHeight - window.innerHeight, Ct.OS.Android && Ct.UA.Chrome && window.screen.height > window.innerHeight && (this.outerHeight = (window.screen.height - window.innerHeight) / 1.5), this.outerWidth = window.outerWidth - window.innerWidth);
4950
+ It.OS.iOS || (this.outerHeight = window.outerHeight - window.innerHeight, It.OS.Android && It.UA.Chrome && window.screen.height > window.innerHeight && (this.outerHeight = (window.screen.height - window.innerHeight) / 1.5), this.outerWidth = window.outerWidth - window.innerWidth);
4986
4951
  }
4987
4952
  getBibiEventCoord(t, e = 0) {
4988
4953
  var i;
@@ -5029,7 +4994,7 @@ class an {
5029
4994
  };
5030
4995
  }
5031
4996
  }
5032
- class ln {
4997
+ class rn {
5033
4998
  constructor() {
5034
4999
  this._DOM = {
5035
5000
  show: !1,
@@ -5047,8 +5012,8 @@ class ln {
5047
5012
  return this._DOM;
5048
5013
  }
5049
5014
  }
5050
- const Je = 6, Lt = 1.02, We = 50;
5051
- class hn {
5015
+ const He = 6, kt = 1.02, ke = 50;
5016
+ class sn {
5052
5017
  constructor(t, e = !1) {
5053
5018
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
5054
5019
  startX: 0,
@@ -5067,14 +5032,14 @@ class hn {
5067
5032
  target: { X: 0, Y: 0 },
5068
5033
  touchN: 0,
5069
5034
  startTranslate: { X: 0, Y: 0 }
5070
- }, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new an(), this.attachEvents(), e && (this.debugger = new ln());
5035
+ }, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new nn(), this.attachEvents(), e && (this.debugger = new rn());
5071
5036
  }
5072
5037
  get scale() {
5073
5038
  return this._scale;
5074
5039
  }
5075
5040
  set scale(t) {
5076
5041
  isNaN(t) && (t = 1), window.clearTimeout(this.scaleDebouncer), this.scaleDebouncer = window.setTimeout(() => {
5077
- this.dragState === 0 && this.scale < Lt && (this.pan.translateX = 0, this.pan.translateY = 0, this.clearPan(), this.manager.updateBookStyle()), this.manager.listener("zoom", t);
5042
+ this.dragState === 0 && this.scale < kt && (this.pan.translateX = 0, this.pan.translateY = 0, this.clearPan(), this.manager.updateBookStyle()), this.manager.listener("zoom", t);
5078
5043
  }, 100), this._scale = t;
5079
5044
  }
5080
5045
  /**
@@ -5163,14 +5128,14 @@ class hn {
5163
5128
  touchendHandler(t) {
5164
5129
  var e, A;
5165
5130
  if (t.stopPropagation(), !t.touches || t.touches.length === 0)
5166
- this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > We && Math.abs(this.pan.overscrollY) < We / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), (e = this.debugger) != null && e.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
5131
+ this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > ke && Math.abs(this.pan.overscrollY) < ke / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), (e = this.debugger) != null && e.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
5167
5132
  else if (t.touches.length === 1) {
5168
5133
  this.dragState = 1, t.touches[0].identifier !== this.pan.touchID && (this.pan.touchID = t.touches[0].identifier), (A = this.debugger) != null && A.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch2.style.display = "none", this.debugger.DOM.pinchTarget.style.display = "none");
5169
5134
  const i = this.startTouch(t);
5170
5135
  this.pan.startX = i.X, this.pan.startY = i.Y;
5171
5136
  }
5172
5137
  window.setTimeout(() => {
5173
- this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale < Lt && (this.pan.translateX = 0, this.pan.translateY = 0), this.clearPan()), this.manager.updateBookStyle(!0);
5138
+ this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale < kt && (this.pan.translateX = 0, this.pan.translateY = 0), this.clearPan()), this.manager.updateBookStyle(!0);
5174
5139
  }, 50);
5175
5140
  }
5176
5141
  /**
@@ -5188,7 +5153,7 @@ class hn {
5188
5153
  if (this.pinch.touchN++, this.pinch.touchN < 4)
5189
5154
  return;
5190
5155
  let c = A / this.pinch.startDistance * this.scale;
5191
- c >= Je && (c = Je), c <= Lt && (c = 1), this.scale = c, this.pinch.startDistance = A, i = !0;
5156
+ c >= He && (c = He), c <= kt && (c = 1), this.scale = c, this.pinch.startDistance = A, i = !0;
5192
5157
  }
5193
5158
  if (this.pan.letItGo === !1 && (this.pan.letItGo = Math.abs(this.pan.startY - e.Y) < Math.abs(this.pan.startX - e.X)), (o = this.debugger) != null && o.show && (this.debugger.DOM.touch1.style.top = `${e.Y - 10}px`, this.debugger.DOM.touch1.style.left = `${e.X - 10}px`, this.debugger.DOM.touch1.innerText = `${e.X.toFixed(2)},${e.Y.toFixed(2)}`), this.dragState > 0 && this.isScaled || this.dragState > 1) {
5194
5159
  if (this.dragState === 1) {
@@ -5270,7 +5235,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
5270
5235
  t > 0 && e > this.manager.threshold && this.manager.slength > this.manager.perPage ? this.manager.listener("no_less", void 0) : t < 0 && e > this.manager.threshold && this.manager.slength > this.manager.perPage && this.manager.listener("no_more", void 0), this.manager.slideToCurrent(!0, !0);
5271
5236
  }
5272
5237
  }
5273
- class cn {
5238
+ class on {
5274
5239
  // TODO getter
5275
5240
  constructor(t) {
5276
5241
  this.shift = !0, this.spreads = [], this.nLandscape = 0, this.index(t), this.testShift(t), console.log(`Indexed ${this.spreads.length} spreads for ${t.readingOrder.items.length} items`);
@@ -5282,7 +5247,7 @@ class cn {
5282
5247
  number: i + 1,
5283
5248
  isImage: ((s = A.type) == null ? void 0 : s.indexOf("image/")) === 0
5284
5249
  }));
5285
- const r = ((o = A.properties) == null ? void 0 : o.getOrientation()) === rt.landscape;
5250
+ const r = ((o = A.properties) == null ? void 0 : o.getOrientation()) === it.landscape;
5286
5251
  (!((a = A.properties) != null && a.getPage()) || e) && (A.properties = (l = A.properties) == null ? void 0 : l.add({
5287
5252
  page: r ? (
5288
5253
  // If a landscape image
@@ -5301,14 +5266,14 @@ class cn {
5301
5266
  if (A.length > 1)
5302
5267
  return;
5303
5268
  const r = A[0], s = (o = r.properties) == null ? void 0 : o.getOrientation();
5304
- i === 0 && (s === rt.landscape || s !== rt.portrait && ((r.width || 0) > (r.height || 0) || ((a = r.properties) == null ? void 0 : a.getSpread()) === Qt.both)) && (this.shift = !1), e && ((l = r.properties) == null ? void 0 : l.getPage()) === W.center && this.spreads[i - 1][0].addProperties({ addBlank: !0 }), s === rt.portrait && ((h = r.properties) == null ? void 0 : h.getPage()) !== "center" && ((c = r.properties) == null ? void 0 : c.otherProperties.number) > 1 ? e = !0 : e = !1;
5269
+ i === 0 && (s === it.landscape || s !== it.portrait && ((r.width || 0) > (r.height || 0) || ((a = r.properties) == null ? void 0 : a.getSpread()) === Ut.both)) && (this.shift = !1), e && ((l = r.properties) == null ? void 0 : l.getPage()) === J.center && this.spreads[i - 1][0].addProperties({ addBlank: !0 }), s === it.portrait && ((h = r.properties) == null ? void 0 : h.getPage()) !== "center" && ((c = r.properties) == null ? void 0 : c.otherProperties.number) > 1 ? e = !0 : e = !1;
5305
5270
  }), this.shift || this.index(t, !0);
5306
5271
  }
5307
5272
  buildSpreads(t) {
5308
5273
  let e = [];
5309
5274
  t.items.forEach((A, i) => {
5310
5275
  var r;
5311
- !i && this.shift ? this.spreads.push([A]) : ((r = A.properties) == null ? void 0 : r.getPage()) === W.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([A]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [A]) : e.push(A);
5276
+ !i && this.shift ? this.spreads.push([A]) : ((r = A.properties) == null ? void 0 : r.getPage()) === J.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([A]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [A]) : e.push(A);
5312
5277
  }), e.length > 0 && this.spreads.push(e);
5313
5278
  }
5314
5279
  currentSpread(t, e) {
@@ -5318,16 +5283,16 @@ class cn {
5318
5283
  return this.spreads.find((e) => e.includes(t)) || void 0;
5319
5284
  }
5320
5285
  }
5321
- const Le = 8, Oe = 5, gn = 300, dn = 15e3, un = 250, mn = 150, Mn = 500;
5322
- class fn {
5286
+ const Je = 8, We = 5, an = 300, ln = 15e3, hn = 250, cn = 150, gn = 500;
5287
+ class dn {
5323
5288
  constructor(t, e, A) {
5324
5289
  var i;
5325
- if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = A, this.spreadPresentation = ((i = A.metadata.getPresentation()) == null ? void 0 : i.spread) || Qt.auto, this.pub.metadata.effectiveReadingProgression !== w.rtl && this.pub.metadata.effectiveReadingProgression !== w.ltr)
5290
+ if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = A, this.spreadPresentation = ((i = A.metadata.getPresentation()) == null ? void 0 : i.spread) || Ut.auto, this.pub.metadata.effectiveReadingProgression !== w.rtl && this.pub.metadata.effectiveReadingProgression !== w.ltr)
5326
5291
  throw Error("Unsupported reading progression for EPUB");
5327
- this.spreader = new cn(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new hn(this), this.pub.readingOrder.items.forEach((r) => {
5292
+ this.spreader = new on(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new sn(this), this.pub.readingOrder.items.forEach((r) => {
5328
5293
  var o, a;
5329
- const s = new rn(this.peripherals, this.pub.metadata.effectiveReadingProgression, r.href);
5330
- this.spineElement.appendChild(s.element), this.pool.set(r.href, s), s.width = 100 / this.length * (((o = r.properties) == null ? void 0 : o.getOrientation()) === rt.landscape || (a = r.properties) != null && a.otherProperties.addBlank ? this.perPage : 1), s.height = this.height;
5294
+ const s = new tn(this.peripherals, this.pub.metadata.effectiveReadingProgression, r.href);
5295
+ this.spineElement.appendChild(s.element), this.pool.set(r.href, s), s.width = 100 / this.length * (((o = r.properties) == null ? void 0 : o.getOrientation()) === it.landscape || (a = r.properties) != null && a.otherProperties.addBlank ? this.perPage : 1), s.height = this.height;
5331
5296
  });
5332
5297
  }
5333
5298
  set listener(t) {
@@ -5348,12 +5313,12 @@ class fn {
5348
5313
  var a, l;
5349
5314
  let r = this.pub.readingOrder.items.findIndex((h) => h.href === i);
5350
5315
  const s = this.pub.readingOrder.items[r];
5351
- if (A.width = 100 / this.length * (((a = s.properties) == null ? void 0 : a.getOrientation()) === rt.landscape || (l = s.properties) != null && l.otherProperties.addBlank ? this.perPage : 1), A.height = this.height, !A.loaded)
5316
+ if (A.width = 100 / this.length * (((a = s.properties) == null ? void 0 : a.getOrientation()) === it.landscape || (l = s.properties) != null && l.otherProperties.addBlank ? this.perPage : 1), A.height = this.height, !A.loaded)
5352
5317
  return;
5353
5318
  const o = this.spreader.findByLink(s);
5354
5319
  A.update(this.spreadPosition(o, s));
5355
5320
  });
5356
- }, un);
5321
+ }, hn);
5357
5322
  }
5358
5323
  /**
5359
5324
  * It is important that these values be cached to avoid spamming them on redraws, they are expensive.
@@ -5374,13 +5339,13 @@ class fn {
5374
5339
  return 50;
5375
5340
  }
5376
5341
  get portrait() {
5377
- return this.spreadPresentation === Qt.none ? !0 : (this.orientationInternal === -1 && (this.orientationInternal = this.containerHeightCached > this.container.clientWidth ? 1 : 0), this.orientationInternal === 1);
5342
+ return this.spreadPresentation === Ut.none ? !0 : (this.orientationInternal === -1 && (this.orientationInternal = this.containerHeightCached > this.container.clientWidth ? 1 : 0), this.orientationInternal === 1);
5378
5343
  }
5379
5344
  updateSpineStyle(t, e = !0) {
5380
5345
  let A = "0";
5381
5346
  this.updateDimensions(), this.perPage > 1 && (A = `${this.width / 2}px`);
5382
5347
  const i = {
5383
- transition: t ? `all ${e ? mn : Mn}ms ease-out` : "all 0ms ease-out",
5348
+ transition: t ? `all ${e ? cn : gn}ms ease-out` : "all 0ms ease-out",
5384
5349
  marginRight: this.rtl ? A : "0",
5385
5350
  marginLeft: this.rtl ? "0" : A,
5386
5351
  width: `${this.width / this.perPage * this.length}px`,
@@ -5517,7 +5482,7 @@ class fn {
5517
5482
  return t % 2 && !this.single && t++, t;
5518
5483
  }
5519
5484
  spreadPosition(t, e) {
5520
- return this.perPage < 2 || t.length < 2 ? W.center : e.href === t[0].href ? this.rtl ? W.right : W.left : this.rtl ? W.left : W.right;
5485
+ return this.perPage < 2 || t.length < 2 ? J.center : e.href === t[0].href ? this.rtl ? J.right : J.left : this.rtl ? J.left : J.right;
5521
5486
  }
5522
5487
  async waitForItem(t) {
5523
5488
  if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
@@ -5543,7 +5508,7 @@ class fn {
5543
5508
  const o = new Promise(async (a, l) => {
5544
5509
  const h = [], c = [];
5545
5510
  this.positions.forEach((M, B) => {
5546
- (B > r + Le || B < r - Le) && (h.includes(M.href) || h.push(M.href)), B < r + Oe && B > r - Oe && (c.includes(M.href) || c.push(M.href));
5511
+ (B > r + Je || B < r - Je) && (h.includes(M.href) || h.push(M.href)), B < r + We && B > r - We && (c.includes(M.href) || c.push(M.href));
5547
5512
  }), h.forEach(async (M) => {
5548
5513
  var B;
5549
5514
  c.includes(M) || this.pool.has(M) && (this.cancelShowing(M), await ((B = this.pool.get(M)) == null ? void 0 : B.unload()));
@@ -5552,19 +5517,19 @@ class fn {
5552
5517
  const B = t.readingOrder.findIndexWithHref(M), f = t.readingOrder.items[B];
5553
5518
  if (f) {
5554
5519
  if (!this.blobs.has(M)) {
5555
- const C = await new lA(t, this.currentBaseURL || "", f).build(!0);
5520
+ const C = await new sA(t, this.currentBaseURL || "", f).build(!0);
5556
5521
  this.blobs.set(M, C);
5557
5522
  }
5558
5523
  this.delayedShow.has(M) || this.delayedShow.set(M, new Promise((I, C) => {
5559
5524
  let E = !1;
5560
5525
  const F = window.setTimeout(async () => {
5561
5526
  this.delayedTimeout.set(M, 0);
5562
- const j = this.makeSpread(this.reAlign(B)), It = this.spreadPosition(j, f), Mt = this.pool.get(M);
5563
- await Mt.load(A, this.blobs.get(M)), this.peripherals.isScaled || await Mt.show(It), this.delayedShow.delete(M), E = !0, I();
5564
- }, gn);
5527
+ const T = this.makeSpread(this.reAlign(B)), ft = this.spreadPosition(T, f), gt = this.pool.get(M);
5528
+ await gt.load(A, this.blobs.get(M)), this.peripherals.isScaled || await gt.show(ft), this.delayedShow.delete(M), E = !0, I();
5529
+ }, an);
5565
5530
  setTimeout(() => {
5566
5531
  !E && this.delayedShow.has(M) && C(`Offscreen load timeout: ${M}`);
5567
- }, dn), this.delayedTimeout.set(M, F);
5532
+ }, ln), this.delayedTimeout.set(M, F);
5568
5533
  }));
5569
5534
  }
5570
5535
  };
@@ -5643,11 +5608,11 @@ class fn {
5643
5608
  (t = this.currentFrames) == null || t.forEach((e) => e == null ? void 0 : e.deselect());
5644
5609
  }
5645
5610
  }
5646
- function L(n) {
5611
+ function W(n) {
5647
5612
  if (typeof n != "string")
5648
5613
  throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
5649
5614
  }
5650
- function Xe(n, t) {
5615
+ function Le(n, t) {
5651
5616
  for (var e = "", A = 0, i = -1, r = 0, s, o = 0; o <= n.length; ++o) {
5652
5617
  if (o < n.length)
5653
5618
  s = n.charCodeAt(o);
@@ -5680,39 +5645,39 @@ function Xe(n, t) {
5680
5645
  }
5681
5646
  return e;
5682
5647
  }
5683
- function pn(n, t) {
5648
+ function un(n, t) {
5684
5649
  var e = t.dir || t.root, A = t.base || (t.name || "") + (t.ext || "");
5685
5650
  return e ? e === t.root ? e + A : e + n + A : A;
5686
5651
  }
5687
- var ct = {
5652
+ var at = {
5688
5653
  // path.resolve([from ...], to)
5689
5654
  resolve: function() {
5690
5655
  for (var t = "", e = !1, A, i = arguments.length - 1; i >= -1 && !e; i--) {
5691
5656
  var r;
5692
- i >= 0 ? r = arguments[i] : (A === void 0 && (A = process.cwd()), r = A), L(r), r.length !== 0 && (t = r + "/" + t, e = r.charCodeAt(0) === 47);
5657
+ i >= 0 ? r = arguments[i] : (A === void 0 && (A = process.cwd()), r = A), W(r), r.length !== 0 && (t = r + "/" + t, e = r.charCodeAt(0) === 47);
5693
5658
  }
5694
- return t = Xe(t, !e), e ? t.length > 0 ? "/" + t : "/" : t.length > 0 ? t : ".";
5659
+ return t = Le(t, !e), e ? t.length > 0 ? "/" + t : "/" : t.length > 0 ? t : ".";
5695
5660
  },
5696
5661
  normalize: function(t) {
5697
- if (L(t), t.length === 0)
5662
+ if (W(t), t.length === 0)
5698
5663
  return ".";
5699
5664
  var e = t.charCodeAt(0) === 47, A = t.charCodeAt(t.length - 1) === 47;
5700
- return t = Xe(t, !e), t.length === 0 && !e && (t = "."), t.length > 0 && A && (t += "/"), e ? "/" + t : t;
5665
+ return t = Le(t, !e), t.length === 0 && !e && (t = "."), t.length > 0 && A && (t += "/"), e ? "/" + t : t;
5701
5666
  },
5702
5667
  isAbsolute: function(t) {
5703
- return L(t), t.length > 0 && t.charCodeAt(0) === 47;
5668
+ return W(t), t.length > 0 && t.charCodeAt(0) === 47;
5704
5669
  },
5705
5670
  join: function() {
5706
5671
  if (arguments.length === 0)
5707
5672
  return ".";
5708
5673
  for (var t, e = 0; e < arguments.length; ++e) {
5709
5674
  var A = arguments[e];
5710
- L(A), A.length > 0 && (t === void 0 ? t = A : t += "/" + A);
5675
+ W(A), A.length > 0 && (t === void 0 ? t = A : t += "/" + A);
5711
5676
  }
5712
- return t === void 0 ? "." : ct.normalize(t);
5677
+ return t === void 0 ? "." : at.normalize(t);
5713
5678
  },
5714
5679
  relative: function(t, e) {
5715
- if (L(t), L(e), t === e || (t = ct.resolve(t), e = ct.resolve(e), t === e))
5680
+ if (W(t), W(e), t === e || (t = at.resolve(t), e = at.resolve(e), t === e))
5716
5681
  return "";
5717
5682
  for (var A = 1; A < t.length && t.charCodeAt(A) === 47; ++A)
5718
5683
  ;
@@ -5743,7 +5708,7 @@ var ct = {
5743
5708
  return t;
5744
5709
  },
5745
5710
  dirname: function(t) {
5746
- if (L(t), t.length === 0)
5711
+ if (W(t), t.length === 0)
5747
5712
  return ".";
5748
5713
  for (var e = t.charCodeAt(0), A = e === 47, i = -1, r = !0, s = t.length - 1; s >= 1; --s)
5749
5714
  if (e = t.charCodeAt(s), e === 47) {
@@ -5758,7 +5723,7 @@ var ct = {
5758
5723
  basename: function(t, e) {
5759
5724
  if (e !== void 0 && typeof e != "string")
5760
5725
  throw new TypeError('"ext" argument must be a string');
5761
- L(t);
5726
+ W(t);
5762
5727
  var A = 0, i = -1, r = !0, s;
5763
5728
  if (e !== void 0 && e.length > 0 && e.length <= t.length) {
5764
5729
  if (e.length === t.length && e === t)
@@ -5788,7 +5753,7 @@ var ct = {
5788
5753
  }
5789
5754
  },
5790
5755
  extname: function(t) {
5791
- L(t);
5756
+ W(t);
5792
5757
  for (var e = -1, A = 0, i = -1, r = !0, s = 0, o = t.length - 1; o >= 0; --o) {
5793
5758
  var a = t.charCodeAt(o);
5794
5759
  if (a === 47) {
@@ -5807,10 +5772,10 @@ var ct = {
5807
5772
  format: function(t) {
5808
5773
  if (t === null || typeof t != "object")
5809
5774
  throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
5810
- return pn("/", t);
5775
+ return un("/", t);
5811
5776
  },
5812
5777
  parse: function(t) {
5813
- L(t);
5778
+ W(t);
5814
5779
  var e = { root: "", dir: "", base: "", ext: "", name: "" };
5815
5780
  if (t.length === 0)
5816
5781
  return e;
@@ -5835,42 +5800,42 @@ var ct = {
5835
5800
  win32: null,
5836
5801
  posix: null
5837
5802
  };
5838
- ct.posix = ct;
5839
- var Ze = ct, Et = /* @__PURE__ */ ((n) => (n.start = "start", n.left = "left", n.right = "right", n.justify = "justify", n))(Et || {}), bt = /* @__PURE__ */ ((n) => (n.sepia = "sepia", n.night = "night", n.custom = "custom", n))(bt || {}), y = /* @__PURE__ */ ((n) => (n.margin = "margin", n.lineLength = "lineLength", n.columns = "columns", n))(y || {});
5840
- const Vt = {
5803
+ at.posix = at;
5804
+ var Oe = at, mt = /* @__PURE__ */ ((n) => (n.start = "start", n.left = "left", n.right = "right", n.justify = "justify", n))(mt || {}), Pt = /* @__PURE__ */ ((n) => (n.sepia = "sepia", n.night = "night", n.custom = "custom", n))(Pt || {});
5805
+ const St = {
5841
5806
  range: [0.7, 4],
5842
5807
  step: 0.05
5843
- }, Pt = {
5808
+ }, xt = {
5844
5809
  range: [100, 1e3],
5845
5810
  step: 100
5846
- }, Dt = {
5811
+ }, Tt = {
5847
5812
  range: [50, 250],
5848
5813
  step: 10
5849
5814
  };
5850
- function Bn(n, t) {
5815
+ function mn(n, t) {
5851
5816
  return n == null || t == null || n <= t ? n : void 0;
5852
5817
  }
5853
- function En(n, t) {
5818
+ function Mn(n, t) {
5854
5819
  return n == null || t == null || n >= t ? n : void 0;
5855
5820
  }
5856
- function T(n) {
5821
+ function x(n) {
5857
5822
  return typeof n == "string" ? n : n === null ? null : void 0;
5858
5823
  }
5859
- function z(n) {
5824
+ function Q(n) {
5860
5825
  return typeof n == "boolean" || n == null ? n : void 0;
5861
5826
  }
5862
- function gt(n, t) {
5827
+ function jt(n, t) {
5863
5828
  if (n !== void 0)
5864
5829
  return n === null ? null : t[n] !== void 0 ? n : void 0;
5865
5830
  }
5866
- function dt(n) {
5831
+ function lt(n) {
5867
5832
  return typeof n == "boolean" || typeof n == "number" && n >= 0 ? n : n === null ? null : void 0;
5868
5833
  }
5869
5834
  function U(n) {
5870
5835
  if (n !== void 0)
5871
5836
  return n === null ? null : n < 0 ? void 0 : n;
5872
5837
  }
5873
- function ut(n, t) {
5838
+ function ht(n, t) {
5874
5839
  if (n === void 0)
5875
5840
  return;
5876
5841
  if (n === null)
@@ -5878,12 +5843,12 @@ function ut(n, t) {
5878
5843
  const e = Math.min(...t), A = Math.max(...t);
5879
5844
  return n >= e && n <= A ? n : void 0;
5880
5845
  }
5881
- function Ot(n, t) {
5846
+ function Jt(n, t) {
5882
5847
  return n === void 0 ? t : n;
5883
5848
  }
5884
- class wt {
5849
+ class Mt {
5885
5850
  constructor(t = {}) {
5886
- this.backgroundColor = T(t.backgroundColor), this.blendFilter = z(t.blendFilter), this.constraint = U(t.constraint), this.columnCount = U(t.columnCount), this.darkenFilter = dt(t.darkenFilter), this.deprecatedFontSize = z(t.deprecatedFontSize), this.fontFamily = T(t.fontFamily), this.fontSize = ut(t.fontSize, Vt.range), this.fontSizeNormalize = z(t.fontSizeNormalize), this.fontOpticalSizing = z(t.fontOpticalSizing), this.fontWeight = ut(t.fontWeight, Pt.range), this.fontWidth = ut(t.fontWidth, Dt.range), this.hyphens = z(t.hyphens), this.invertFilter = dt(t.invertFilter), this.invertGaijiFilter = dt(t.invertGaijiFilter), this.iOSPatch = z(t.iOSPatch), this.iPadOSPatch = z(t.iPadOSPatch), this.layoutStrategy = gt(t.layoutStrategy, y), this.letterSpacing = U(t.letterSpacing), this.ligatures = z(t.ligatures), this.lineHeight = U(t.lineHeight), this.linkColor = T(t.linkColor), this.noRuby = z(t.noRuby), this.pageGutter = U(t.pageGutter), this.paragraphIndent = U(t.paragraphIndent), this.paragraphSpacing = U(t.paragraphSpacing), this.scroll = z(t.scroll), this.scrollPaddingTop = U(t.scrollPaddingTop), this.scrollPaddingBottom = U(t.scrollPaddingBottom), this.selectionBackgroundColor = T(t.selectionBackgroundColor), this.selectionTextColor = T(t.selectionTextColor), this.textAlign = gt(t.textAlign, Et), this.textColor = T(t.textColor), this.textNormalization = z(t.textNormalization), this.theme = gt(t.theme, bt), this.visitedColor = T(t.visitedColor), this.wordSpacing = U(t.wordSpacing), this.optimalLineLength = U(t.optimalLineLength), this.maximalLineLength = U(t.maximalLineLength), this.minimalLineLength = U(t.minimalLineLength);
5851
+ this.backgroundColor = x(t.backgroundColor), this.blendFilter = Q(t.blendFilter), this.constraint = U(t.constraint), this.columnCount = U(t.columnCount), this.darkenFilter = lt(t.darkenFilter), this.deprecatedFontSize = Q(t.deprecatedFontSize), this.fontFamily = x(t.fontFamily), this.fontSize = ht(t.fontSize, St.range), this.fontSizeNormalize = Q(t.fontSizeNormalize), this.fontOpticalSizing = Q(t.fontOpticalSizing), this.fontWeight = ht(t.fontWeight, xt.range), this.fontWidth = ht(t.fontWidth, Tt.range), this.hyphens = Q(t.hyphens), this.invertFilter = lt(t.invertFilter), this.invertGaijiFilter = lt(t.invertGaijiFilter), this.iOSPatch = Q(t.iOSPatch), this.iPadOSPatch = Q(t.iPadOSPatch), this.letterSpacing = U(t.letterSpacing), this.ligatures = Q(t.ligatures), this.lineHeight = U(t.lineHeight), this.linkColor = x(t.linkColor), this.noRuby = Q(t.noRuby), this.pageGutter = U(t.pageGutter), this.paragraphIndent = U(t.paragraphIndent), this.paragraphSpacing = U(t.paragraphSpacing), this.scroll = Q(t.scroll), this.scrollPaddingTop = U(t.scrollPaddingTop), this.scrollPaddingBottom = U(t.scrollPaddingBottom), this.selectionBackgroundColor = x(t.selectionBackgroundColor), this.selectionTextColor = x(t.selectionTextColor), this.textAlign = jt(t.textAlign, mt), this.textColor = x(t.textColor), this.textNormalization = Q(t.textNormalization), this.theme = jt(t.theme, Pt), this.visitedColor = x(t.visitedColor), this.wordSpacing = U(t.wordSpacing), this.optimalLineLength = U(t.optimalLineLength), this.maximalLineLength = U(t.maximalLineLength), this.minimalLineLength = U(t.minimalLineLength);
5887
5852
  }
5888
5853
  static serialize(t) {
5889
5854
  const { ...e } = t;
@@ -5892,7 +5857,7 @@ class wt {
5892
5857
  static deserialize(t) {
5893
5858
  try {
5894
5859
  const e = JSON.parse(t);
5895
- return new wt(e);
5860
+ return new Mt(e);
5896
5861
  } catch (e) {
5897
5862
  return console.error("Failed to deserialize preferences:", e), null;
5898
5863
  }
@@ -5901,15 +5866,15 @@ class wt {
5901
5866
  const e = { ...this };
5902
5867
  for (const A of Object.keys(t))
5903
5868
  t[A] !== void 0 && (A !== "maximalLineLength" || t[A] === null || t[A] >= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (A !== "minimalLineLength" || t[A] === null || t[A] <= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (e[A] = t[A]);
5904
- return new wt(e);
5869
+ return new Mt(e);
5905
5870
  }
5906
5871
  }
5907
- class wn {
5872
+ class fn {
5908
5873
  constructor(t) {
5909
- this.backgroundColor = T(t.backgroundColor) || null, this.blendFilter = z(t.blendFilter) ?? !1, this.constraint = U(t.constraint) || 0, this.columnCount = U(t.columnCount) || null, this.darkenFilter = dt(t.darkenFilter) ?? !1, this.deprecatedFontSize = z(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = T(t.fontFamily) || null, this.fontSize = ut(t.fontSize, Vt.range) || 1, this.fontSizeNormalize = z(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = z(t.fontOpticalSizing) ?? null, this.fontWeight = ut(t.fontWeight, Pt.range) || null, this.fontWidth = ut(t.fontWidth, Dt.range) || null, this.hyphens = z(t.hyphens) ?? null, this.invertFilter = dt(t.invertFilter) ?? !1, this.invertGaijiFilter = dt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (X.OS.iOS || X.OS.iPadOS) && X.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : X.OS.iPadOS && X.iOSRequest === "desktop", this.layoutStrategy = gt(t.layoutStrategy, y) || y.lineLength, this.letterSpacing = U(t.letterSpacing) || null, this.ligatures = z(t.ligatures) ?? null, this.lineHeight = U(t.lineHeight) || null, this.linkColor = T(t.linkColor) || null, this.noRuby = z(t.noRuby) ?? !1, this.pageGutter = Ot(U(t.pageGutter), 20), this.paragraphIndent = U(t.paragraphIndent) ?? null, this.paragraphSpacing = U(t.paragraphSpacing) ?? null, this.scroll = z(t.scroll) ?? !1, this.scrollPaddingTop = U(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = U(t.scrollPaddingBottom) ?? null, this.selectionBackgroundColor = T(t.selectionBackgroundColor) || null, this.selectionTextColor = T(t.selectionTextColor) || null, this.textAlign = gt(t.textAlign, Et) || null, this.textColor = T(t.textColor) || null, this.textNormalization = z(t.textNormalization) ?? !1, this.theme = gt(t.theme, bt) || null, this.visitedColor = T(t.visitedColor) || null, this.wordSpacing = U(t.wordSpacing) || null, this.optimalLineLength = U(t.optimalLineLength) || 65, this.maximalLineLength = Ot(En(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = Ot(Bn(t.minimalLineLength, this.optimalLineLength), 40);
5874
+ this.backgroundColor = x(t.backgroundColor) || null, this.blendFilter = Q(t.blendFilter) ?? !1, this.constraint = U(t.constraint) || 0, this.columnCount = U(t.columnCount) || null, this.darkenFilter = lt(t.darkenFilter) ?? !1, this.deprecatedFontSize = Q(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = x(t.fontFamily) || null, this.fontSize = ht(t.fontSize, St.range) || 1, this.fontSizeNormalize = Q(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = Q(t.fontOpticalSizing) ?? null, this.fontWeight = ht(t.fontWeight, xt.range) || null, this.fontWidth = ht(t.fontWidth, Tt.range) || null, this.hyphens = Q(t.hyphens) ?? null, this.invertFilter = lt(t.invertFilter) ?? !1, this.invertGaijiFilter = lt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : O.OS.iPadOS && O.iOSRequest === "desktop", this.letterSpacing = U(t.letterSpacing) || null, this.ligatures = Q(t.ligatures) ?? null, this.lineHeight = U(t.lineHeight) || null, this.linkColor = x(t.linkColor) || null, this.noRuby = Q(t.noRuby) ?? !1, this.pageGutter = Jt(U(t.pageGutter), 20), this.paragraphIndent = U(t.paragraphIndent) ?? null, this.paragraphSpacing = U(t.paragraphSpacing) ?? null, this.scroll = Q(t.scroll) ?? !1, this.scrollPaddingTop = U(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = U(t.scrollPaddingBottom) ?? null, this.selectionBackgroundColor = x(t.selectionBackgroundColor) || null, this.selectionTextColor = x(t.selectionTextColor) || null, this.textAlign = jt(t.textAlign, mt) || null, this.textColor = x(t.textColor) || null, this.textNormalization = Q(t.textNormalization) ?? !1, this.theme = jt(t.theme, Pt) || null, this.visitedColor = x(t.visitedColor) || null, this.wordSpacing = U(t.wordSpacing) || null, this.optimalLineLength = U(t.optimalLineLength) || 65, this.maximalLineLength = Jt(Mn(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = Jt(mn(t.minimalLineLength, this.optimalLineLength), 40);
5910
5875
  }
5911
5876
  }
5912
- class S {
5877
+ class Y {
5913
5878
  constructor({
5914
5879
  initialValue: t = null,
5915
5880
  effectiveValue: e,
@@ -5934,7 +5899,7 @@ class S {
5934
5899
  this._value = null;
5935
5900
  }
5936
5901
  }
5937
- class J extends S {
5902
+ class k extends Y {
5938
5903
  set value(t) {
5939
5904
  this._value = t, this._onChange(this._value);
5940
5905
  }
@@ -5954,7 +5919,7 @@ class J extends S {
5954
5919
  this._value = !this._value, this._onChange(this._value);
5955
5920
  }
5956
5921
  }
5957
- class Xt extends S {
5922
+ class Xe extends Y {
5958
5923
  constructor({
5959
5924
  initialValue: t = null,
5960
5925
  effectiveValue: e,
@@ -5985,7 +5950,7 @@ class Xt extends S {
5985
5950
  this._value = null;
5986
5951
  }
5987
5952
  }
5988
- class N extends S {
5953
+ class N extends Y {
5989
5954
  constructor({
5990
5955
  initialValue: t = null,
5991
5956
  effectiveValue: e,
@@ -6035,29 +6000,29 @@ class N extends S {
6035
6000
  this._value = null;
6036
6001
  }
6037
6002
  }
6038
- const In = "#FFFFFF", Fn = "#121212", Un = "#0000EE", yn = "#551A8B", Cn = "#b4d8fe", Rn = "inherit", st = {
6039
- RS__backgroundColor: In,
6040
- RS__textColor: Fn,
6041
- RS__linkColor: Un,
6042
- RS__visitedColor: yn,
6043
- RS__selectionBackgroundColor: Cn,
6044
- RS__selectionTextColor: Rn
6003
+ const pn = "#FFFFFF", Bn = "#121212", En = "#0000EE", wn = "#551A8B", In = "#b4d8fe", Fn = "inherit", nt = {
6004
+ RS__backgroundColor: pn,
6005
+ RS__textColor: Bn,
6006
+ RS__linkColor: En,
6007
+ RS__visitedColor: wn,
6008
+ RS__selectionBackgroundColor: In,
6009
+ RS__selectionTextColor: Fn
6045
6010
  };
6046
- class Ke {
6011
+ class Ze {
6047
6012
  constructor(t, e, A) {
6048
6013
  var i, r;
6049
6014
  this.preferences = t, this.settings = e, this.metadata = A, this.layout = ((r = (i = this.metadata) == null ? void 0 : i.getPresentation()) == null ? void 0 : r.layout) || p.reflowable;
6050
6015
  }
6051
6016
  clear() {
6052
- this.preferences = new wt({ optimalLineLength: 65 });
6017
+ this.preferences = new Mt({ optimalLineLength: 65 });
6053
6018
  }
6054
6019
  updatePreference(t, e) {
6055
6020
  this.preferences[t] = e;
6056
6021
  }
6057
6022
  get backgroundColor() {
6058
- return new S({
6023
+ return new Y({
6059
6024
  initialValue: this.preferences.backgroundColor,
6060
- effectiveValue: this.settings.backgroundColor || st.RS__backgroundColor,
6025
+ effectiveValue: this.settings.backgroundColor || nt.RS__backgroundColor,
6061
6026
  isEffective: this.preferences.backgroundColor !== null,
6062
6027
  onChange: (t) => {
6063
6028
  this.updatePreference("backgroundColor", t || null);
@@ -6065,7 +6030,7 @@ class Ke {
6065
6030
  });
6066
6031
  }
6067
6032
  get blendFilter() {
6068
- return new J({
6033
+ return new k({
6069
6034
  initialValue: this.preferences.blendFilter,
6070
6035
  effectiveValue: this.settings.blendFilter || !1,
6071
6036
  isEffective: this.preferences.blendFilter !== null,
@@ -6075,7 +6040,7 @@ class Ke {
6075
6040
  });
6076
6041
  }
6077
6042
  get columnCount() {
6078
- return new S({
6043
+ return new Y({
6079
6044
  initialValue: this.preferences.columnCount,
6080
6045
  effectiveValue: this.settings.columnCount || null,
6081
6046
  isEffective: this.layout === p.reflowable && !this.settings.scroll,
@@ -6085,7 +6050,7 @@ class Ke {
6085
6050
  });
6086
6051
  }
6087
6052
  get constraint() {
6088
- return new S({
6053
+ return new Y({
6089
6054
  initialValue: this.preferences.constraint,
6090
6055
  effectiveValue: this.preferences.constraint || 0,
6091
6056
  isEffective: !0,
@@ -6107,7 +6072,7 @@ class Ke {
6107
6072
  });
6108
6073
  }
6109
6074
  get deprecatedFontSize() {
6110
- return new J({
6075
+ return new k({
6111
6076
  initialValue: this.preferences.deprecatedFontSize,
6112
6077
  effectiveValue: CSS.supports("zoom", "1") ? this.settings.deprecatedFontSize || !1 : !0,
6113
6078
  isEffective: this.layout === p.reflowable,
@@ -6117,7 +6082,7 @@ class Ke {
6117
6082
  });
6118
6083
  }
6119
6084
  get fontFamily() {
6120
- return new S({
6085
+ return new Y({
6121
6086
  initialValue: this.preferences.fontFamily,
6122
6087
  effectiveValue: this.settings.fontFamily || null,
6123
6088
  isEffective: this.layout === p.reflowable,
@@ -6134,12 +6099,12 @@ class Ke {
6134
6099
  onChange: (t) => {
6135
6100
  this.updatePreference("fontSize", t || null);
6136
6101
  },
6137
- supportedRange: Vt.range,
6138
- step: Vt.step
6102
+ supportedRange: St.range,
6103
+ step: St.step
6139
6104
  });
6140
6105
  }
6141
6106
  get fontSizeNormalize() {
6142
- return new J({
6107
+ return new k({
6143
6108
  initialValue: this.preferences.fontSizeNormalize,
6144
6109
  effectiveValue: this.settings.fontSizeNormalize || !1,
6145
6110
  isEffective: this.layout === p.reflowable && this.preferences.fontSizeNormalize !== null,
@@ -6149,7 +6114,7 @@ class Ke {
6149
6114
  });
6150
6115
  }
6151
6116
  get fontOpticalSizing() {
6152
- return new J({
6117
+ return new k({
6153
6118
  initialValue: this.preferences.fontOpticalSizing,
6154
6119
  effectiveValue: this.settings.fontOpticalSizing || !0,
6155
6120
  isEffective: this.layout === p.reflowable && this.preferences.fontOpticalSizing !== null,
@@ -6166,8 +6131,8 @@ class Ke {
6166
6131
  onChange: (t) => {
6167
6132
  this.updatePreference("fontWeight", t || null);
6168
6133
  },
6169
- supportedRange: Pt.range,
6170
- step: Pt.step
6134
+ supportedRange: xt.range,
6135
+ step: xt.step
6171
6136
  });
6172
6137
  }
6173
6138
  get fontWidth() {
@@ -6178,13 +6143,13 @@ class Ke {
6178
6143
  onChange: (t) => {
6179
6144
  this.updatePreference("fontWidth", t || null);
6180
6145
  },
6181
- supportedRange: Dt.range,
6182
- step: Dt.step
6146
+ supportedRange: Tt.range,
6147
+ step: Tt.step
6183
6148
  });
6184
6149
  }
6185
6150
  get hyphens() {
6186
6151
  var t;
6187
- return new J({
6152
+ return new k({
6188
6153
  initialValue: this.preferences.hyphens,
6189
6154
  effectiveValue: this.settings.hyphens || !1,
6190
6155
  isEffective: this.layout === p.reflowable && ((t = this.metadata) == null ? void 0 : t.effectiveReadingProgression) === w.ltr && this.preferences.hyphens !== null,
@@ -6218,7 +6183,7 @@ class Ke {
6218
6183
  });
6219
6184
  }
6220
6185
  get iOSPatch() {
6221
- return new J({
6186
+ return new k({
6222
6187
  initialValue: this.preferences.iOSPatch,
6223
6188
  effectiveValue: this.settings.iOSPatch || !1,
6224
6189
  isEffective: this.layout === p.reflowable,
@@ -6228,7 +6193,7 @@ class Ke {
6228
6193
  });
6229
6194
  }
6230
6195
  get iPadOSPatch() {
6231
- return new J({
6196
+ return new k({
6232
6197
  initialValue: this.preferences.iPadOSPatch,
6233
6198
  effectiveValue: this.settings.iPadOSPatch || !1,
6234
6199
  isEffective: this.layout === p.reflowable,
@@ -6237,17 +6202,6 @@ class Ke {
6237
6202
  }
6238
6203
  });
6239
6204
  }
6240
- get layoutStrategy() {
6241
- return new Xt({
6242
- initialValue: this.preferences.layoutStrategy,
6243
- effectiveValue: this.settings.layoutStrategy,
6244
- isEffective: this.layout === p.reflowable,
6245
- onChange: (t) => {
6246
- this.updatePreference("layoutStrategy", t || null);
6247
- },
6248
- supportedValues: Object.values(y)
6249
- });
6250
- }
6251
6205
  get letterSpacing() {
6252
6206
  return new N({
6253
6207
  initialValue: this.preferences.letterSpacing,
@@ -6262,7 +6216,7 @@ class Ke {
6262
6216
  }
6263
6217
  get ligatures() {
6264
6218
  var t, e;
6265
- return new J({
6219
+ return new k({
6266
6220
  initialValue: this.preferences.ligatures,
6267
6221
  effectiveValue: this.settings.ligatures || !0,
6268
6222
  isEffective: this.layout === p.reflowable && ((e = (t = this.metadata) == null ? void 0 : t.languages) == null ? void 0 : e.some((A) => A === "ar" || A === "fa")) && this.preferences.ligatures !== null || !1,
@@ -6284,9 +6238,9 @@ class Ke {
6284
6238
  });
6285
6239
  }
6286
6240
  get linkColor() {
6287
- return new S({
6241
+ return new Y({
6288
6242
  initialValue: this.preferences.linkColor,
6289
- effectiveValue: this.settings.linkColor || st.RS__linkColor,
6243
+ effectiveValue: this.settings.linkColor || nt.RS__linkColor,
6290
6244
  isEffective: this.layout === p.reflowable && this.preferences.linkColor !== null,
6291
6245
  onChange: (t) => {
6292
6246
  this.updatePreference("linkColor", t || null);
@@ -6319,7 +6273,7 @@ class Ke {
6319
6273
  }
6320
6274
  get noRuby() {
6321
6275
  var t, e;
6322
- return new J({
6276
+ return new k({
6323
6277
  initialValue: this.preferences.noRuby,
6324
6278
  effectiveValue: this.settings.noRuby || !1,
6325
6279
  isEffective: this.layout === p.reflowable && ((e = (t = this.metadata) == null ? void 0 : t.languages) == null ? void 0 : e.includes("ja")) || !1,
@@ -6341,7 +6295,7 @@ class Ke {
6341
6295
  });
6342
6296
  }
6343
6297
  get pageGutter() {
6344
- return new S({
6298
+ return new Y({
6345
6299
  initialValue: this.preferences.pageGutter,
6346
6300
  effectiveValue: this.settings.pageGutter,
6347
6301
  isEffective: this.layout === p.reflowable,
@@ -6375,7 +6329,7 @@ class Ke {
6375
6329
  });
6376
6330
  }
6377
6331
  get scroll() {
6378
- return new J({
6332
+ return new k({
6379
6333
  initialValue: this.preferences.scroll,
6380
6334
  effectiveValue: this.settings.scroll || !1,
6381
6335
  isEffective: this.layout === p.reflowable,
@@ -6385,7 +6339,7 @@ class Ke {
6385
6339
  });
6386
6340
  }
6387
6341
  get scrollPaddingTop() {
6388
- return new S({
6342
+ return new Y({
6389
6343
  initialValue: this.preferences.scrollPaddingTop,
6390
6344
  effectiveValue: this.settings.scrollPaddingTop || 0,
6391
6345
  isEffective: this.layout === p.reflowable && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
@@ -6395,7 +6349,7 @@ class Ke {
6395
6349
  });
6396
6350
  }
6397
6351
  get scrollPaddingBottom() {
6398
- return new S({
6352
+ return new Y({
6399
6353
  initialValue: this.preferences.scrollPaddingBottom,
6400
6354
  effectiveValue: this.settings.scrollPaddingBottom || 0,
6401
6355
  isEffective: this.layout === p.reflowable && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
@@ -6428,9 +6382,9 @@ class Ke {
6428
6382
  }
6429
6383
  */
6430
6384
  get selectionBackgroundColor() {
6431
- return new S({
6385
+ return new Y({
6432
6386
  initialValue: this.preferences.selectionBackgroundColor,
6433
- effectiveValue: this.settings.selectionBackgroundColor || st.RS__selectionBackgroundColor,
6387
+ effectiveValue: this.settings.selectionBackgroundColor || nt.RS__selectionBackgroundColor,
6434
6388
  isEffective: this.layout === p.reflowable && this.preferences.selectionBackgroundColor !== null,
6435
6389
  onChange: (t) => {
6436
6390
  this.updatePreference("selectionBackgroundColor", t || null);
@@ -6438,9 +6392,9 @@ class Ke {
6438
6392
  });
6439
6393
  }
6440
6394
  get selectionTextColor() {
6441
- return new S({
6395
+ return new Y({
6442
6396
  initialValue: this.preferences.selectionTextColor,
6443
- effectiveValue: this.settings.selectionTextColor || st.RS__selectionTextColor,
6397
+ effectiveValue: this.settings.selectionTextColor || nt.RS__selectionTextColor,
6444
6398
  isEffective: this.layout === p.reflowable && this.preferences.selectionTextColor !== null,
6445
6399
  onChange: (t) => {
6446
6400
  this.updatePreference("selectionTextColor", t || null);
@@ -6448,20 +6402,20 @@ class Ke {
6448
6402
  });
6449
6403
  }
6450
6404
  get textAlign() {
6451
- return new Xt({
6405
+ return new Xe({
6452
6406
  initialValue: this.preferences.textAlign,
6453
- effectiveValue: this.settings.textAlign || Et.start,
6407
+ effectiveValue: this.settings.textAlign || mt.start,
6454
6408
  isEffective: this.layout === p.reflowable && this.preferences.textAlign !== null,
6455
6409
  onChange: (t) => {
6456
6410
  this.updatePreference("textAlign", t || null);
6457
6411
  },
6458
- supportedValues: Object.values(Et)
6412
+ supportedValues: Object.values(mt)
6459
6413
  });
6460
6414
  }
6461
6415
  get textColor() {
6462
- return new S({
6416
+ return new Y({
6463
6417
  initialValue: this.preferences.textColor,
6464
- effectiveValue: this.settings.textColor || st.RS__textColor,
6418
+ effectiveValue: this.settings.textColor || nt.RS__textColor,
6465
6419
  isEffective: this.layout === p.reflowable && this.preferences.textColor !== null,
6466
6420
  onChange: (t) => {
6467
6421
  this.updatePreference("textColor", t || null);
@@ -6469,7 +6423,7 @@ class Ke {
6469
6423
  });
6470
6424
  }
6471
6425
  get textNormalization() {
6472
- return new J({
6426
+ return new k({
6473
6427
  initialValue: this.preferences.textNormalization,
6474
6428
  effectiveValue: this.settings.textNormalization || !1,
6475
6429
  isEffective: this.layout === p.reflowable,
@@ -6479,20 +6433,20 @@ class Ke {
6479
6433
  });
6480
6434
  }
6481
6435
  get theme() {
6482
- return new Xt({
6436
+ return new Xe({
6483
6437
  initialValue: this.preferences.theme,
6484
6438
  effectiveValue: this.settings.theme || null,
6485
6439
  isEffective: this.layout === p.reflowable,
6486
6440
  onChange: (t) => {
6487
6441
  this.updatePreference("theme", t || null);
6488
6442
  },
6489
- supportedValues: Object.values(bt)
6443
+ supportedValues: Object.values(Pt)
6490
6444
  });
6491
6445
  }
6492
6446
  get visitedColor() {
6493
- return new S({
6447
+ return new Y({
6494
6448
  initialValue: this.preferences.visitedColor,
6495
- effectiveValue: this.settings.visitedColor || st.RS__visitedColor,
6449
+ effectiveValue: this.settings.visitedColor || nt.RS__visitedColor,
6496
6450
  isEffective: this.layout === p.reflowable && this.preferences.visitedColor !== null,
6497
6451
  onChange: (t) => {
6498
6452
  this.updatePreference("visitedColor", t || null);
@@ -6512,16 +6466,16 @@ class Ke {
6512
6466
  });
6513
6467
  }
6514
6468
  }
6515
- class qe {
6469
+ class Ke {
6516
6470
  constructor(t, e) {
6517
- this.backgroundColor = t.backgroundColor || e.backgroundColor || null, this.blendFilter = typeof t.blendFilter == "boolean" ? t.blendFilter : e.blendFilter ?? null, this.columnCount = t.columnCount !== void 0 ? t.columnCount : e.columnCount !== void 0 ? e.columnCount : null, this.constraint = t.constraint || e.constraint, this.darkenFilter = typeof t.darkenFilter == "boolean" ? t.darkenFilter : e.darkenFilter ?? null, this.deprecatedFontSize = typeof t.deprecatedFontSize == "boolean" ? t.deprecatedFontSize : e.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontSize = t.fontSize !== void 0 ? t.fontSize : e.fontSize !== void 0 ? e.fontSize : null, this.fontSizeNormalize = typeof t.fontSizeNormalize == "boolean" ? t.fontSizeNormalize : e.fontSizeNormalize ?? null, this.fontOpticalSizing = typeof t.fontOpticalSizing == "boolean" ? t.fontOpticalSizing : e.fontOpticalSizing ?? null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.fontWidth = t.fontWidth !== void 0 ? t.fontWidth : e.fontWidth !== void 0 ? e.fontWidth : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.invertFilter = typeof t.invertFilter == "boolean" ? t.invertFilter : e.invertFilter ?? null, this.invertGaijiFilter = typeof t.invertGaijiFilter == "boolean" ? t.invertGaijiFilter : e.invertGaijiFilter ?? null, this.iOSPatch = this.deprecatedFontSize || t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (X.OS.iOS || X.OS.iPadOS) && X.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? X.OS.iPadOS && X.iOSRequest === "desktop" : e.iPadOSPatch, this.layoutStrategy = t.layoutStrategy || e.layoutStrategy || null, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.linkColor = t.linkColor || e.linkColor || null, this.maximalLineLength = t.maximalLineLength === null ? null : t.maximalLineLength || e.maximalLineLength || null, this.minimalLineLength = t.minimalLineLength === null ? null : t.minimalLineLength || e.minimalLineLength || null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.optimalLineLength = t.optimalLineLength || e.optimalLineLength, this.pageGutter = t.pageGutter !== void 0 ? t.pageGutter : e.pageGutter !== void 0 ? e.pageGutter : null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.scroll = typeof t.scroll == "boolean" ? t.scroll : e.scroll ?? null, this.scrollPaddingTop = t.scrollPaddingTop !== void 0 ? t.scrollPaddingTop : e.scrollPaddingTop !== void 0 ? e.scrollPaddingTop : null, this.scrollPaddingBottom = t.scrollPaddingBottom !== void 0 ? t.scrollPaddingBottom : e.scrollPaddingBottom !== void 0 ? e.scrollPaddingBottom : null, this.selectionBackgroundColor = t.selectionBackgroundColor || e.selectionBackgroundColor || null, this.selectionTextColor = t.selectionTextColor || e.selectionTextColor || null, this.textAlign = t.textAlign || e.textAlign || null, this.textColor = t.textColor || e.textColor || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.theme = t.theme || e.theme || null, this.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null;
6471
+ this.backgroundColor = t.backgroundColor || e.backgroundColor || null, this.blendFilter = typeof t.blendFilter == "boolean" ? t.blendFilter : e.blendFilter ?? null, this.columnCount = t.columnCount !== void 0 ? t.columnCount : e.columnCount !== void 0 ? e.columnCount : null, this.constraint = t.constraint || e.constraint, this.darkenFilter = typeof t.darkenFilter == "boolean" ? t.darkenFilter : e.darkenFilter ?? null, this.deprecatedFontSize = typeof t.deprecatedFontSize == "boolean" ? t.deprecatedFontSize : e.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontSize = t.fontSize !== void 0 ? t.fontSize : e.fontSize !== void 0 ? e.fontSize : null, this.fontSizeNormalize = typeof t.fontSizeNormalize == "boolean" ? t.fontSizeNormalize : e.fontSizeNormalize ?? null, this.fontOpticalSizing = typeof t.fontOpticalSizing == "boolean" ? t.fontOpticalSizing : e.fontOpticalSizing ?? null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.fontWidth = t.fontWidth !== void 0 ? t.fontWidth : e.fontWidth !== void 0 ? e.fontWidth : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.invertFilter = typeof t.invertFilter == "boolean" ? t.invertFilter : e.invertFilter ?? null, this.invertGaijiFilter = typeof t.invertGaijiFilter == "boolean" ? t.invertGaijiFilter : e.invertGaijiFilter ?? null, this.iOSPatch = this.deprecatedFontSize || t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? O.OS.iPadOS && O.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.linkColor = t.linkColor || e.linkColor || null, this.maximalLineLength = t.maximalLineLength === null ? null : t.maximalLineLength || e.maximalLineLength || null, this.minimalLineLength = t.minimalLineLength === null ? null : t.minimalLineLength || e.minimalLineLength || null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.optimalLineLength = t.optimalLineLength || e.optimalLineLength, this.pageGutter = t.pageGutter !== void 0 ? t.pageGutter : e.pageGutter !== void 0 ? e.pageGutter : null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.scroll = typeof t.scroll == "boolean" ? t.scroll : e.scroll ?? null, this.scrollPaddingTop = t.scrollPaddingTop !== void 0 ? t.scrollPaddingTop : e.scrollPaddingTop !== void 0 ? e.scrollPaddingTop : null, this.scrollPaddingBottom = t.scrollPaddingBottom !== void 0 ? t.scrollPaddingBottom : e.scrollPaddingBottom !== void 0 ? e.scrollPaddingBottom : null, this.selectionBackgroundColor = t.selectionBackgroundColor || e.selectionBackgroundColor || null, this.selectionTextColor = t.selectionTextColor || e.selectionTextColor || null, this.textAlign = t.textAlign || e.textAlign || null, this.textColor = t.textColor || e.textColor || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.theme = t.theme || e.theme || null, this.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null;
6518
6472
  }
6519
6473
  }
6520
- function Rt(n) {
6474
+ function Ft(n) {
6521
6475
  const t = getComputedStyle(n), e = parseFloat(t.paddingLeft || "0"), A = parseFloat(t.paddingRight || "0");
6522
6476
  return n.clientWidth - e - A;
6523
6477
  }
6524
- class VA {
6478
+ class xA {
6525
6479
  constructor() {
6526
6480
  }
6527
6481
  toFlag(t) {
@@ -6548,7 +6502,7 @@ class VA {
6548
6502
  return `${t}rem`;
6549
6503
  }
6550
6504
  }
6551
- class PA extends VA {
6505
+ class TA extends xA {
6552
6506
  constructor(t) {
6553
6507
  super(), this.a11yNormalize = t.a11yNormalize ?? null, this.appearance = t.appearance ?? null, this.backgroundColor = t.backgroundColor ?? null, this.blendFilter = t.blendFilter ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.colCount = t.colCount ?? null, this.darkenFilter = t.darkenFilter ?? null, this.deprecatedFontSize = t.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily ?? null, this.fontOpticalSizing = t.fontOpticalSizing ?? null, this.fontSize = t.fontSize ?? null, this.fontSizeNormalize = t.fontSizeNormalize ?? null, this.fontWeight = t.fontWeight ?? null, this.fontWidth = t.fontWidth ?? null, this.invertFilter = t.invertFilter ?? null, this.invertGaijiFilter = t.invertGaijiFilter ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.lineLength = t.lineLength ?? null, this.linkColor = t.linkColor ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.textAlign = t.textAlign ?? null, this.textColor = t.textColor ?? null, this.view = t.view ?? null, this.visitedColor = t.visitedColor ?? null, this.wordSpacing = t.wordSpacing ?? null;
6554
6508
  }
@@ -6557,7 +6511,7 @@ class PA extends VA {
6557
6511
  return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.appearance && (t["--USER__appearance"] = this.toFlag(this.appearance)), this.backgroundColor && (t["--USER__backgroundColor"] = this.backgroundColor), this.blendFilter && (t["--USER__blendFilter"] = this.toFlag("blend")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.colCount && (t["--USER__colCount"] = this.toUnitless(this.colCount)), this.darkenFilter === !0 ? t["--USER__darkenFilter"] = this.toFlag("darken") : typeof this.darkenFilter == "number" && (t["--USER__darkenFilter"] = this.toPercentage(this.darkenFilter)), this.deprecatedFontSize && (t["--USER__fontSizeImplementation"] = this.toFlag("deprecatedFontSize")), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontOpticalSizing != null && (t["--USER__fontOpticalSizing"] = this.fontOpticalSizing), this.fontSize != null && (t["--USER__fontSize"] = this.toPercentage(this.fontSize, !0)), this.fontSizeNormalize && (t["--USER__fontSizeNormalize"] = this.toFlag("normalize")), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.fontWidth != null && (t["--USER__fontWidth"] = typeof this.fontWidth == "string" ? this.fontWidth : this.toUnitless(this.fontWidth)), this.invertFilter === !0 ? t["--USER__invertFilter"] = this.toFlag("invert") : typeof this.invertFilter == "number" && (t["--USER__invertFilter"] = this.toPercentage(this.invertFilter)), this.invertGaijiFilter === !0 ? t["--USER__invertGaiji"] = this.toFlag("invertGaiji") : typeof this.invertGaijiFilter == "number" && (t["--USER__invertGaiji"] = this.toPercentage(this.invertGaijiFilter)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.lineLength != null && (t["--USER__lineLength"] = this.toPx(this.lineLength)), this.linkColor && (t["--USER__linkColor"] = this.linkColor), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.selectionBackgroundColor && (t["--USER__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--USER__selectionTextColor"] = this.selectionTextColor), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.textColor && (t["--USER__textColor"] = this.textColor), this.view && (t["--USER__view"] = this.toFlag(this.view)), this.visitedColor && (t["--USER__visitedColor"] = this.visitedColor), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), t;
6558
6512
  }
6559
6513
  }
6560
- class Qn extends VA {
6514
+ class Un extends xA {
6561
6515
  constructor(t) {
6562
6516
  super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null;
6563
6517
  }
@@ -6566,12 +6520,12 @@ class Qn extends VA {
6566
6520
  return this.backgroundColor && (t["--RS__backgroundColor"] = this.backgroundColor), this.baseFontFamily && (t["--RS__baseFontFamily"] = this.baseFontFamily), this.baseFontSize != null && (t["--RS__baseFontSize"] = this.toRem(this.baseFontSize)), this.baseLineHeight != null && (t["--RS__baseLineHeight"] = this.toUnitless(this.baseLineHeight)), this.boxSizingMedia && (t["--RS__boxSizingMedia"] = this.boxSizingMedia), this.boxSizingTable && (t["--RS__boxSizingTable"] = this.boxSizingTable), this.colWidth != null && (t["--RS__colWidth"] = this.colWidth), this.colCount != null && (t["--RS__colCount"] = this.toUnitless(this.colCount)), this.colGap != null && (t["--RS__colGap"] = this.toPx(this.colGap)), this.codeFontFamily && (t["--RS__codeFontFamily"] = this.codeFontFamily), this.compFontFamily && (t["--RS__compFontFamily"] = this.compFontFamily), this.defaultLineLength != null && (t["--RS__defaultLineLength"] = this.toPx(this.defaultLineLength)), this.flowSpacing != null && (t["--RS__flowSpacing"] = this.toRem(this.flowSpacing)), this.humanistTf && (t["--RS__humanistTf"] = this.humanistTf), this.linkColor && (t["--RS__linkColor"] = this.linkColor), this.maxMediaWidth && (t["--RS__maxMediaWidth"] = this.toVw(this.maxMediaWidth)), this.maxMediaHeight && (t["--RS__maxMediaHeight"] = this.toVh(this.maxMediaHeight)), this.modernTf && (t["--RS__modernTf"] = this.modernTf), this.monospaceTf && (t["--RS__monospaceTf"] = this.monospaceTf), this.noOverflow && (t["--RS__disableOverflow"] = this.toFlag("noOverflow")), this.noVerticalPagination && (t["--RS__disablePagination"] = this.toFlag("noVerticalPagination")), this.oldStyleTf && (t["--RS__oldStyleTf"] = this.oldStyleTf), this.pageGutter != null && (t["--RS__pageGutter"] = this.toPx(this.pageGutter)), this.paraIndent != null && (t["--RS__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--RS__paraSpacing"] = this.toRem(this.paraSpacing)), this.primaryColor && (t["--RS__primaryColor"] = this.primaryColor), this.sansSerifJa && (t["--RS__sans-serif-ja"] = this.sansSerifJa), this.sansSerifJaV && (t["--RS__sans-serif-ja-v"] = this.sansSerifJaV), this.sansTf && (t["--RS__sansTf"] = this.sansTf), this.scrollPaddingBottom != null && (t["--RS__scrollPaddingBottom"] = this.toPx(this.scrollPaddingBottom)), this.scrollPaddingTop != null && (t["--RS__scrollPaddingTop"] = this.toPx(this.scrollPaddingTop)), this.secondaryColor && (t["--RS__secondaryColor"] = this.secondaryColor), this.selectionBackgroundColor && (t["--RS__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--RS__selectionTextColor"] = this.selectionTextColor), this.serifJa && (t["--RS__serif-ja"] = this.serifJa), this.serifJaV && (t["--RS__serif-ja-v"] = this.serifJaV), this.textColor && (t["--RS__textColor"] = this.textColor), this.typeScale && (t["--RS__typeScale"] = this.toUnitless(this.typeScale)), this.visitedColor && (t["--RS__visitedColor"] = this.visitedColor), t;
6567
6521
  }
6568
6522
  }
6569
- class zn {
6523
+ class Cn {
6570
6524
  constructor(t) {
6571
- this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.layoutStrategy = t.layoutStrategy || y.lineLength, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Rt(this.containerParent);
6525
+ this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Ft(this.containerParent);
6572
6526
  }
6573
6527
  update(t) {
6574
- this.cachedColCount = t.columnCount, t.constraint !== this.constraint && (this.constraint = t.constraint), t.layoutStrategy && t.layoutStrategy !== this.layoutStrategy && (this.layoutStrategy = t.layoutStrategy), t.pageGutter !== this.rsProperties.pageGutter && (this.rsProperties.pageGutter = t.pageGutter), t.scrollPaddingBottom !== this.rsProperties.scrollPaddingBottom && (this.rsProperties.scrollPaddingBottom = t.scrollPaddingBottom), t.scrollPaddingTop !== this.rsProperties.scrollPaddingTop && (this.rsProperties.scrollPaddingTop = t.scrollPaddingTop), this.lineLengths.update({
6528
+ this.cachedColCount = t.columnCount, t.constraint !== this.constraint && (this.constraint = t.constraint), t.pageGutter !== this.rsProperties.pageGutter && (this.rsProperties.pageGutter = t.pageGutter), t.scrollPaddingBottom !== this.rsProperties.scrollPaddingBottom && (this.rsProperties.scrollPaddingBottom = t.scrollPaddingBottom), t.scrollPaddingTop !== this.rsProperties.scrollPaddingTop && (this.rsProperties.scrollPaddingTop = t.scrollPaddingTop), this.lineLengths.update({
6575
6529
  fontFace: t.fontFamily,
6576
6530
  letterSpacing: t.letterSpacing,
6577
6531
  pageGutter: t.pageGutter,
@@ -6617,13 +6571,13 @@ class zn {
6617
6571
  visitedColor: t.visitedColor,
6618
6572
  wordSpacing: t.wordSpacing
6619
6573
  };
6620
- this.userProperties = new PA(A);
6574
+ this.userProperties = new TA(A);
6621
6575
  }
6622
6576
  updateLayout(t, e, A, i) {
6623
6577
  return A ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, i);
6624
6578
  }
6625
6579
  getCompensatedMetrics(t, e) {
6626
- const A = t || this.userProperties.fontSize || 1, i = A < 1 ? this.layoutStrategy === y.margin ? 1 / (A + 3e-3) : 1 / A : e ? A : 1;
6580
+ const A = t || this.userProperties.fontSize || 1, i = A < 1 ? 1 / A : e ? A : 1;
6627
6581
  return {
6628
6582
  zoomFactor: A,
6629
6583
  zoomCompensation: i,
@@ -6636,7 +6590,7 @@ class zn {
6636
6590
  // TODO: As scroll shows, the effective line-length
6637
6591
  // should be the same as uncompensated when scale >= 1
6638
6592
  paginate(t, e, A) {
6639
- const i = Math.round(Rt(this.containerParent) - this.constraint), r = this.getCompensatedMetrics(t, e), s = r.zoomCompensation, o = r.optimal, a = r.minimal, l = r.maximal;
6593
+ const i = Math.round(Ft(this.containerParent) - this.constraint), r = this.getCompensatedMetrics(t, e), s = r.zoomCompensation, o = r.optimal, a = r.minimal, l = r.maximal;
6640
6594
  let h = 1, c = i;
6641
6595
  if (A === void 0)
6642
6596
  return {
@@ -6644,67 +6598,36 @@ class zn {
6644
6598
  effectiveContainerWidth: c,
6645
6599
  effectiveLineLength: Math.round(c / h * s)
6646
6600
  };
6647
- if (A === null) {
6648
- if (this.layoutStrategy === y.margin)
6649
- if (i >= o) {
6650
- h = Math.floor(i / o);
6651
- const g = Math.round(h * (o * s));
6652
- c = Math.min(g, i);
6653
- } else
6654
- h = 1, c = i;
6655
- else if (this.layoutStrategy === y.lineLength)
6656
- if (i < o || l === null)
6657
- h = 1, c = i;
6658
- else {
6659
- h = Math.floor(i / o);
6660
- const g = Math.round(h * (l * s));
6661
- c = Math.min(g, i);
6662
- }
6663
- else if (this.layoutStrategy === y.columns)
6664
- if (i >= o)
6665
- if (l === null)
6666
- h = Math.floor(i / o), c = i;
6667
- else {
6668
- h = Math.floor(i / (a || o));
6669
- const g = Math.round(h * (o * s));
6670
- c = Math.min(g, i);
6671
- }
6672
- else
6673
- h = 1, c = i;
6674
- } else if (A > 1) {
6601
+ if (A === null)
6602
+ if (i < o || l === null)
6603
+ h = 1, c = i;
6604
+ else {
6605
+ h = Math.floor(i / o);
6606
+ const g = Math.round(h * (l * s));
6607
+ c = Math.min(g, i);
6608
+ }
6609
+ else if (A > 1) {
6675
6610
  const g = Math.round(A * (a !== null ? a : o));
6676
- if (i >= g) {
6677
- if (h = A, this.layoutStrategy === y.margin) {
6678
- const m = Math.round(h * (o * s));
6611
+ if (i >= g)
6612
+ if (h = A, l === null)
6613
+ c = i;
6614
+ else {
6615
+ const m = Math.round(h * (l * s));
6679
6616
  c = Math.min(m, i);
6680
- } else if (this.layoutStrategy === y.lineLength || this.layoutStrategy === y.columns) {
6681
- if (l === null)
6682
- c = i;
6683
- else {
6684
- const m = Math.round(h * (l * s));
6685
- c = Math.min(m, i);
6686
- }
6687
- this.layoutStrategy === y.columns && console.error("Columns strategy is not compatible with a column count whose value is a number. Falling back to lineLength strategy.");
6688
6617
  }
6689
- } else {
6618
+ else {
6690
6619
  a !== null && i < Math.round(A * a) ? h = Math.floor(i / a) : h = A;
6691
6620
  const m = Math.round(h * (o * s));
6692
6621
  c = Math.min(m, i);
6693
6622
  }
6694
- } else if (h = 1, i >= o) {
6695
- if (this.layoutStrategy === y.margin) {
6696
- const g = Math.round(o * s);
6623
+ } else if (h = 1, i >= o)
6624
+ if (l === null)
6625
+ c = i;
6626
+ else {
6627
+ const g = Math.round(l * s);
6697
6628
  c = Math.min(g, i);
6698
- } else if (this.layoutStrategy === y.lineLength || this.layoutStrategy === y.columns) {
6699
- if (l === null)
6700
- c = i;
6701
- else {
6702
- const g = Math.round(l * s);
6703
- c = Math.min(g, i);
6704
- }
6705
- this.layoutStrategy === y.columns && console.error("Columns strategy is not compatible with a column count whose value is a number. Falling back to lineLength strategy.");
6706
6629
  }
6707
- } else
6630
+ else
6708
6631
  c = i;
6709
6632
  return {
6710
6633
  colCount: h,
@@ -6714,18 +6637,14 @@ class zn {
6714
6637
  }
6715
6638
  // This behaves as paginate where colCount = 1
6716
6639
  computeScrollLength(t, e) {
6717
- const A = Math.round(Rt(this.containerParent) - this.constraint), i = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), r = i.zoomCompensation, s = i.optimal, o = i.maximal;
6640
+ const A = Math.round(Ft(this.containerParent) - this.constraint), i = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), r = i.zoomCompensation, s = i.optimal, o = i.maximal;
6718
6641
  let a, l = A, h = Math.round(s * r);
6719
- if (this.layoutStrategy === y.margin) {
6720
- const c = Math.min(Math.round(s * r), A);
6642
+ if (o === null)
6643
+ h = A;
6644
+ else {
6645
+ const c = Math.min(Math.round(o * r), A);
6721
6646
  h = e ? c : Math.round(c * r);
6722
- } else if (this.layoutStrategy === y.lineLength || this.layoutStrategy === y.columns)
6723
- if (this.layoutStrategy === y.columns && console.error("Columns strategy is not compatible with scroll. Falling back to lineLength strategy."), o === null)
6724
- h = A;
6725
- else {
6726
- const c = Math.min(Math.round(o * r), A);
6727
- h = e ? c : Math.round(c * r);
6728
- }
6647
+ }
6729
6648
  return {
6730
6649
  colCount: a,
6731
6650
  effectiveContainerWidth: l,
@@ -6740,7 +6659,7 @@ class zn {
6740
6659
  this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
6741
6660
  }
6742
6661
  }
6743
- const Yn = (n) => ({
6662
+ const yn = (n) => ({
6744
6663
  frameLoaded: n.frameLoaded || (() => {
6745
6664
  }),
6746
6665
  positionChanged: n.positionChanged || (() => {
@@ -6757,16 +6676,16 @@ const Yn = (n) => ({
6757
6676
  textSelected: n.textSelected || (() => {
6758
6677
  })
6759
6678
  });
6760
- class DA extends ei {
6679
+ class jA extends qA {
6761
6680
  constructor(t, e, A, i = [], r = void 0, s = { preferences: {}, defaults: {} }) {
6762
6681
  super(), this._preferencesEditor = null, this.reflowViewport = {
6763
6682
  readingOrder: [],
6764
6683
  progressions: /* @__PURE__ */ new Map(),
6765
6684
  positions: null
6766
- }, this.pub = e, this.layout = DA.determineLayout(e), this.container = t, this.listeners = Yn(A), this.currentLocation = r, i.length && (this.positions = i), this._preferences = new wt(s.preferences), this._defaults = new wn(s.defaults), this._settings = new qe(this._preferences, this._defaults), this._css = new zn({
6767
- rsProperties: new Qn({}),
6768
- userProperties: new PA({}),
6769
- lineLengths: new Bt({
6685
+ }, this.pub = e, this.layout = jA.determineLayout(e), this.container = t, this.listeners = yn(A), this.currentLocation = r, i.length && (this.positions = i), this._preferences = new Mt(s.preferences), this._defaults = new fn(s.defaults), this._settings = new Ke(this._preferences, this._defaults), this._css = new Cn({
6686
+ rsProperties: new Un({}),
6687
+ userProperties: new TA({}),
6688
+ lineLengths: new ut({
6770
6689
  optimalChars: this._settings.optimalLineLength,
6771
6690
  minChars: this._settings.minimalLineLength,
6772
6691
  maxChars: this._settings.maximalLineLength,
@@ -6788,13 +6707,13 @@ class DA extends ei {
6788
6707
  async load() {
6789
6708
  var t;
6790
6709
  if ((t = this.positions) != null && t.length || (this.positions = await this.pub.positionsFromManifest()), this.layout === p.fixed)
6791
- this.framePool = new fn(this.container, this.positions, this.pub), this.framePool.listener = (e, A) => {
6710
+ this.framePool = new dn(this.container, this.positions, this.pub), this.framePool.listener = (e, A) => {
6792
6711
  this.eventListener(e, A);
6793
6712
  };
6794
6713
  else {
6795
6714
  await this.updateCSS(!1);
6796
6715
  const e = this.compileCSSProperties(this._css);
6797
- this.framePool = new nn(this.container, this.positions, e);
6716
+ this.framePool = new $i(this.container, this.positions, e);
6798
6717
  }
6799
6718
  this.currentLocation === void 0 && (this.currentLocation = this.positions[0]), await this.resizeHandler(), await this.apply();
6800
6719
  }
@@ -6807,14 +6726,14 @@ class DA extends ei {
6807
6726
  }
6808
6727
  }
6809
6728
  get preferencesEditor() {
6810
- return this._preferencesEditor === null && (this._preferencesEditor = new Ke(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
6729
+ return this._preferencesEditor === null && (this._preferencesEditor = new Ze(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
6811
6730
  }
6812
6731
  async submitPreferences(t) {
6813
6732
  this._preferences = this._preferences.merging(t), await this.applyPreferences();
6814
6733
  }
6815
6734
  async applyPreferences() {
6816
6735
  const t = this._settings;
6817
- this._settings = new qe(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Ke(this._preferences, this.settings, this.pub.metadata)), this.layout === p.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
6736
+ this._settings = new Ke(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Ze(this._preferences, this.settings, this.pub.metadata)), this.layout === p.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
6818
6737
  }
6819
6738
  // TODO: fit, etc.
6820
6739
  handleFXLPrefs(t, e) {
@@ -6838,7 +6757,7 @@ class DA extends ei {
6838
6757
  async resizeHandler() {
6839
6758
  const t = this.container.parentElement || document.documentElement;
6840
6759
  if (this.layout === p.fixed)
6841
- this.container.style.width = `${Rt(t) - this._settings.constraint}px`, this.framePool.resizeHandler();
6760
+ this.container.style.width = `${Ft(t) - this._settings.constraint}px`, this.framePool.resizeHandler();
6842
6761
  else {
6843
6762
  const e = this._css.userProperties.colCount, A = this._css.userProperties.lineLength;
6844
6763
  this._css.resizeHandler(), (this._css.userProperties.view !== "scroll" && e !== this._css.userProperties.colCount || A !== this._css.userProperties.lineLength) && await this.commitCSS(this._css);
@@ -6873,10 +6792,10 @@ class DA extends ei {
6873
6792
  this.listeners.frameLoaded(this._cframes[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
6874
6793
  break;
6875
6794
  case "first_visible_locator":
6876
- const l = Zt.deserialize(e);
6795
+ const l = Wt.deserialize(e);
6877
6796
  if (!l)
6878
6797
  break;
6879
- this.currentLocation = new Zt({
6798
+ this.currentLocation = new Wt({
6880
6799
  href: this.currentLocation.href,
6881
6800
  type: this.currentLocation.type,
6882
6801
  title: this.currentLocation.title,
@@ -6903,17 +6822,17 @@ class DA extends ei {
6903
6822
  }), !1, () => {
6904
6823
  });
6905
6824
  else if (g.startsWith("http://") || g.startsWith("https://") || g.startsWith("mailto:") || g.startsWith("tel:"))
6906
- this.listeners.handleLocator(new Z({
6825
+ this.listeners.handleLocator(new X({
6907
6826
  href: g
6908
6827
  }).locator);
6909
6828
  else
6910
6829
  try {
6911
- this.goLink(new Z({
6912
- href: Ze.join(Ze.dirname(this.currentLocation.href), g)
6830
+ this.goLink(new X({
6831
+ href: Oe.join(Oe.dirname(this.currentLocation.href), g)
6913
6832
  }), !1, () => {
6914
6833
  });
6915
6834
  } catch (m) {
6916
- console.warn(`Couldn't go to link for ${g}: ${m}`), this.listeners.handleLocator(new Z({
6835
+ console.warn(`Couldn't go to link for ${g}: ${m}`), this.listeners.handleLocator(new X({
6917
6836
  href: g
6918
6837
  }).locator);
6919
6838
  }
@@ -6960,8 +6879,8 @@ class DA extends ei {
6960
6879
  }
6961
6880
  }
6962
6881
  determineModules() {
6963
- let t = Array.from(Ae.keys());
6964
- return this.layout === p.fixed ? t.filter((e) => Wi.includes(e)) : (t = t.filter((e) => Li.includes(e)), this.readingProgression === w.ttb || this.readingProgression === w.btt ? t = t.filter((e) => e !== "column_snapper") : t = t.filter((e) => e !== "scroll_snapper"), t);
6882
+ let t = Array.from(_t.keys());
6883
+ return this.layout === p.fixed ? t.filter((e) => Gi.includes(e)) : (t = t.filter((e) => Hi.includes(e)), this.readingProgression === w.ttb || this.readingProgression === w.btt ? t = t.filter((e) => e !== "column_snapper") : t = t.filter((e) => e !== "scroll_snapper"), t);
6965
6884
  }
6966
6885
  // Start listening to messages from the current iframe
6967
6886
  attachListener() {
@@ -7170,7 +7089,7 @@ class DA extends ei {
7170
7089
  return this.go(t.locator, e, A);
7171
7090
  }
7172
7091
  }
7173
- class Sn {
7092
+ class Qn {
7174
7093
  constructor(t) {
7175
7094
  var e;
7176
7095
  this.sourceNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.playback = t.playback, this.audioContext = t.audioContext, this.gainNode = (e = this.audioContext) == null ? void 0 : e.createGain(), this.setVolume(this.playback.state.volume), this.mediaElement = document.createElement("audio"), this.mediaElement.crossOrigin = "use-credentials", this.mediaElement.addEventListener(
@@ -7345,38 +7264,37 @@ class Sn {
7345
7264
  }
7346
7265
  }
7347
7266
  export {
7348
- J as BooleanPreference,
7349
- Xt as EnumPreference,
7350
- wn as EpubDefaults,
7351
- DA as EpubNavigator,
7352
- wt as EpubPreferences,
7353
- Ke as EpubPreferencesEditor,
7354
- qe as EpubSettings,
7355
- an as FXLCoordinator,
7356
- rn as FXLFrameManager,
7357
- fn as FXLFramePoolManager,
7358
- hn as FXLPeripherals,
7359
- cn as FXLSpreader,
7360
- ie as FrameComms,
7361
- An as FrameManager,
7362
- nn as FramePoolManager,
7363
- sn as HorizontalThird,
7364
- y as LayoutStrategy,
7365
- Bt as LineLengths,
7366
- ti as Navigator,
7367
- S as Preference,
7368
- Qn as RSProperties,
7267
+ k as BooleanPreference,
7268
+ Xe as EnumPreference,
7269
+ fn as EpubDefaults,
7270
+ jA as EpubNavigator,
7271
+ Mt as EpubPreferences,
7272
+ Ze as EpubPreferencesEditor,
7273
+ Ke as EpubSettings,
7274
+ nn as FXLCoordinator,
7275
+ tn as FXLFrameManager,
7276
+ dn as FXLFramePoolManager,
7277
+ sn as FXLPeripherals,
7278
+ on as FXLSpreader,
7279
+ $t as FrameComms,
7280
+ _i as FrameManager,
7281
+ $i as FramePoolManager,
7282
+ en as HorizontalThird,
7283
+ ut as LineLengths,
7284
+ KA as Navigator,
7285
+ Y as Preference,
7286
+ Un as RSProperties,
7369
7287
  N as RangePreference,
7370
- zn as ReadiumCSS,
7371
- Et as TextAlignment,
7372
- bt as Theme,
7373
- PA as UserProperties,
7374
- on as VerticalThird,
7375
- ei as VisualNavigator,
7376
- Sn as WebAudioEngine,
7377
- Vt as fontSizeRangeConfig,
7378
- Pt as fontWeightRangeConfig,
7379
- Dt as fontWidthRangeConfig,
7380
- Ct as sML,
7381
- X as sMLWithRequest
7288
+ Cn as ReadiumCSS,
7289
+ mt as TextAlignment,
7290
+ Pt as Theme,
7291
+ TA as UserProperties,
7292
+ An as VerticalThird,
7293
+ qA as VisualNavigator,
7294
+ Qn as WebAudioEngine,
7295
+ St as fontSizeRangeConfig,
7296
+ xt as fontWeightRangeConfig,
7297
+ Tt as fontWidthRangeConfig,
7298
+ It as sML,
7299
+ O as sMLWithRequest
7382
7300
  };