@readium/navigator 2.2.1 → 2.2.3

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,12 +1,12 @@
1
- const L = class at {
1
+ const W = class ot {
2
2
  constructor(t) {
3
3
  if (typeof t == "string") {
4
- if (!at.VALID_MODES.has(t.toLowerCase()))
4
+ if (!ot.VALID_MODES.has(t.toLowerCase()))
5
5
  return;
6
6
  this.value = t.toLowerCase();
7
7
  } else {
8
8
  const e = t.filter(
9
- (i) => at.VALID_MODES.has(i.toLowerCase())
9
+ (i) => ot.VALID_MODES.has(i.toLowerCase())
10
10
  );
11
11
  if (e.length === 0)
12
12
  return;
@@ -19,11 +19,11 @@ const L = class at {
19
19
  static deserialize(t) {
20
20
  if (!t) return;
21
21
  if (typeof t == "string")
22
- return new at(t);
22
+ return new ot(t);
23
23
  if (!Array.isArray(t)) return;
24
- const e = t.filter((i) => i ? at.VALID_MODES.has(i.toLowerCase()) : !1);
24
+ const e = t.filter((i) => i ? ot.VALID_MODES.has(i.toLowerCase()) : !1);
25
25
  if (e.length !== 0)
26
- return new at(e);
26
+ return new ot(e);
27
27
  }
28
28
  /**
29
29
  * Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
@@ -32,8 +32,8 @@ const L = class at {
32
32
  return this.value;
33
33
  }
34
34
  };
35
- L.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), L.AUDITORY = new L("auditory"), L.TACTILE = new L("tactile"), L.TEXTUAL = new L("textual"), L.VISUAL = new L("visual");
36
- const p = class di {
35
+ W.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), W.AUDITORY = new W("auditory"), W.TACTILE = new W("tactile"), W.TEXTUAL = new W("textual"), W.VISUAL = new W("visual");
36
+ const f = class gi {
37
37
  constructor(t) {
38
38
  this.value = t;
39
39
  }
@@ -42,7 +42,7 @@ const p = class di {
42
42
  */
43
43
  static deserialize(t) {
44
44
  if (!(!t || typeof t != "string"))
45
- return new di(t);
45
+ return new gi(t);
46
46
  }
47
47
  /**
48
48
  * Serializes a [Feature] to its RWPM JSON representation.
@@ -51,10 +51,10 @@ const p = class di {
51
51
  return this.value;
52
52
  }
53
53
  };
54
- p.NONE = new p("none"), p.ANNOTATIONS = new p("annotations"), p.ARIA = new p("ARIA"), p.INDEX = new p("index"), p.PAGE_BREAK_MARKERS = new p("pageBreakMarkers"), p.PAGE_NAVIGATION = new p("pageNavigation"), p.PRINT_PAGE_NUMBERS = new p("printPageNumbers"), p.READING_ORDER = new p("readingOrder"), p.STRUCTURAL_NAVIGATION = new p("structuralNavigation"), p.TABLE_OF_CONTENTS = new p("tableOfContents"), p.TAGGED_PDF = new p("taggedPDF"), p.ALTERNATIVE_TEXT = new p("alternativeText"), p.AUDIO_DESCRIPTION = new p("audioDescription"), p.CAPTIONS = new p("captions"), p.CLOSED_CAPTIONS = new p("closedCaptions"), p.DESCRIBED_MATH = new p("describedMath"), p.LONG_DESCRIPTION = new p("longDescription"), p.OPEN_CAPTIONS = new p("openCaptions"), p.SIGN_LANGUAGE = new p("signLanguage"), p.TRANSCRIPT = new p("transcript"), p.DISPLAY_TRANSFORMABILITY = new p("displayTransformability"), p.SYNCHRONIZED_AUDIO_TEXT = new p("synchronizedAudioText"), p.TIMING_CONTROL = new p("timingControl"), p.UNLOCKED = new p("unlocked"), p.CHEM_ML = new p("ChemML"), p.LATEX = new p("latex"), p.LATEX_CHEMISTRY = new p("latex-chemistry"), p.MATH_ML = new p("MathML"), p.MATH_ML_CHEMISTRY = new p("MathML-chemistry"), p.TTS_MARKUP = new p("ttsMarkup"), p.HIGH_CONTRAST_AUDIO = new p("highContrastAudio"), p.HIGH_CONTRAST_DISPLAY = new p("highContrastDisplay"), p.LARGE_PRINT = new p("largePrint"), p.BRAILLE = new p("braille"), p.TACTILE_GRAPHIC = new p("tactileGraphic"), p.TACTILE_OBJECT = new p("tactileObject"), p.FULL_RUBY_ANNOTATIONS = new p("fullRubyAnnotations"), p.HORIZONTAL_WRITING = new p("horizontalWriting"), p.RUBY_ANNOTATIONS = new p("rubyAnnotations"), p.VERTICAL_WRITING = new p("verticalWriting"), p.WITH_ADDITIONAL_WORD_SEGMENTATION = new p("withAdditionalWordSegmentation"), p.WITHOUT_ADDITIONAL_WORD_SEGMENTATION = new p("withoutAdditionalWordSegmentation");
55
- let V = p;
54
+ f.NONE = new f("none"), f.ANNOTATIONS = new f("annotations"), f.ARIA = new f("ARIA"), f.INDEX = new f("index"), f.PAGE_BREAK_MARKERS = new f("pageBreakMarkers"), f.PAGE_NAVIGATION = new f("pageNavigation"), f.PRINT_PAGE_NUMBERS = new f("printPageNumbers"), f.READING_ORDER = new f("readingOrder"), f.STRUCTURAL_NAVIGATION = new f("structuralNavigation"), f.TABLE_OF_CONTENTS = new f("tableOfContents"), f.TAGGED_PDF = new f("taggedPDF"), f.ALTERNATIVE_TEXT = new f("alternativeText"), f.AUDIO_DESCRIPTION = new f("audioDescription"), f.CAPTIONS = new f("captions"), f.CLOSED_CAPTIONS = new f("closedCaptions"), f.DESCRIBED_MATH = new f("describedMath"), f.LONG_DESCRIPTION = new f("longDescription"), f.OPEN_CAPTIONS = new f("openCaptions"), f.SIGN_LANGUAGE = new f("signLanguage"), f.TRANSCRIPT = new f("transcript"), f.DISPLAY_TRANSFORMABILITY = new f("displayTransformability"), f.SYNCHRONIZED_AUDIO_TEXT = new f("synchronizedAudioText"), f.TIMING_CONTROL = new f("timingControl"), f.UNLOCKED = new f("unlocked"), f.CHEM_ML = new f("ChemML"), f.LATEX = new f("latex"), f.LATEX_CHEMISTRY = new f("latex-chemistry"), f.MATH_ML = new f("MathML"), f.MATH_ML_CHEMISTRY = new f("MathML-chemistry"), f.TTS_MARKUP = new f("ttsMarkup"), f.HIGH_CONTRAST_AUDIO = new f("highContrastAudio"), f.HIGH_CONTRAST_DISPLAY = new f("highContrastDisplay"), f.LARGE_PRINT = new f("largePrint"), f.BRAILLE = new f("braille"), f.TACTILE_GRAPHIC = new f("tactileGraphic"), f.TACTILE_OBJECT = new f("tactileObject"), f.FULL_RUBY_ANNOTATIONS = new f("fullRubyAnnotations"), f.HORIZONTAL_WRITING = new f("horizontalWriting"), f.RUBY_ANNOTATIONS = new f("rubyAnnotations"), f.VERTICAL_WRITING = new f("verticalWriting"), f.WITH_ADDITIONAL_WORD_SEGMENTATION = new f("withAdditionalWordSegmentation"), f.WITHOUT_ADDITIONAL_WORD_SEGMENTATION = new f("withoutAdditionalWordSegmentation");
55
+ let di = f;
56
56
  var B = /* @__PURE__ */ ((r) => (r.reflowable = "reflowable", r.fixed = "fixed", r.scrolled = "scrolled", r))(B || {});
57
- class ce {
57
+ class he {
58
58
  /**
59
59
  * Creates a [Encryption].
60
60
  */
@@ -66,7 +66,7 @@ class ce {
66
66
  */
67
67
  static deserialize(t) {
68
68
  if (t && t.algorithm)
69
- return new ce({
69
+ return new he({
70
70
  algorithm: t.algorithm,
71
71
  compression: t.compression,
72
72
  originalLength: t.originalLength,
@@ -82,8 +82,8 @@ class ce {
82
82
  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;
83
83
  }
84
84
  }
85
- var H = /* @__PURE__ */ ((r) => (r.left = "left", r.right = "right", r.center = "center", r))(H || {});
86
- let G = class ie {
85
+ var D = /* @__PURE__ */ ((r) => (r.left = "left", r.right = "right", r.center = "center", r))(D || {});
86
+ let H = class ee {
87
87
  constructor(t) {
88
88
  this.otherProperties = t;
89
89
  }
@@ -95,7 +95,7 @@ let G = class ie {
95
95
  */
96
96
  static deserialize(t) {
97
97
  if (t)
98
- return new ie(t);
98
+ return new ee(t);
99
99
  }
100
100
  /**
101
101
  * Serializes a [Properties] to its RWPM JSON representation.
@@ -110,12 +110,12 @@ let G = class ie {
110
110
  const e = Object.assign({}, this.otherProperties);
111
111
  for (const i in t)
112
112
  e[i] = t[i];
113
- return new ie(e);
113
+ return new ee(e);
114
114
  }
115
115
  };
116
- Object.defineProperty(G.prototype, "encryption", {
116
+ Object.defineProperty(H.prototype, "encryption", {
117
117
  get: function() {
118
- return ce.deserialize(this.otherProperties.encrypted);
118
+ return he.deserialize(this.otherProperties.encrypted);
119
119
  }
120
120
  });
121
121
  function nA(r) {
@@ -124,7 +124,7 @@ function nA(r) {
124
124
  function ui(r) {
125
125
  return r && typeof r == "string" ? [r] : nA(r);
126
126
  }
127
- function Ne(r) {
127
+ function Ye(r) {
128
128
  return typeof r == "string" ? new Date(r) : void 0;
129
129
  }
130
130
  function yt(r) {
@@ -151,8 +151,8 @@ class u {
151
151
  for (let d = 1; d < A.length; d++) {
152
152
  const M = A[d].split("=");
153
153
  if (M.length === 2) {
154
- const l = M[0].toLocaleLowerCase(), f = l === "charset" ? M[1].toUpperCase() : M[1];
155
- s[l] = f;
154
+ const l = M[0].toLocaleLowerCase(), p = l === "charset" ? M[1].toUpperCase() : M[1];
155
+ s[l] = p;
156
156
  }
157
157
  }
158
158
  const o = {}, a = Object.keys(s);
@@ -592,7 +592,7 @@ class u {
592
592
  });
593
593
  }
594
594
  }
595
- let xe = class {
595
+ let Ne = class {
596
596
  constructor(t) {
597
597
  this.uri = t, this.parameters = this.getParameters(t);
598
598
  }
@@ -655,7 +655,7 @@ let xe = class {
655
655
  const t = {};
656
656
  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, i) => t[i] = e), t;
657
657
  }
658
- }, sA = class fi {
658
+ }, sA = class pi {
659
659
  /**
660
660
  * Creates a [Text].
661
661
  */
@@ -667,7 +667,7 @@ let xe = class {
667
667
  */
668
668
  static deserialize(t) {
669
669
  if (t)
670
- return new fi({
670
+ return new pi({
671
671
  after: t.after,
672
672
  before: t.before,
673
673
  highlight: t.highlight
@@ -680,7 +680,7 @@ let xe = class {
680
680
  const t = {};
681
681
  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;
682
682
  }
683
- }, ct = class Ae {
683
+ }, ht = class ie {
684
684
  /**
685
685
  * Creates a [Locator].
686
686
  */
@@ -692,7 +692,7 @@ let xe = class {
692
692
  */
693
693
  static deserialize(t) {
694
694
  if (t && t.href && t.type)
695
- return new Ae({
695
+ return new ie({
696
696
  href: t.href,
697
697
  type: t.type,
698
698
  title: t.title,
@@ -711,7 +711,7 @@ let xe = class {
711
711
  * Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
712
712
  */
713
713
  copyWithLocations(t) {
714
- return new Ae({
714
+ return new ie({
715
715
  href: this.href,
716
716
  type: this.type,
717
717
  title: this.title,
@@ -719,7 +719,7 @@ let xe = class {
719
719
  locations: new b({ ...this.locations, ...t })
720
720
  });
721
721
  }
722
- }, _ = class Rt {
722
+ }, q = class Ut {
723
723
  /**
724
724
  * Creates a [Link].
725
725
  */
@@ -731,21 +731,21 @@ let xe = class {
731
731
  */
732
732
  static deserialize(t) {
733
733
  if (!(!t || typeof t.href != "string"))
734
- return new Rt({
734
+ return new Ut({
735
735
  href: t.href,
736
736
  templated: t.templated,
737
737
  type: t.type,
738
738
  title: t.title,
739
739
  rels: t.rel ? Array.isArray(t.rel) ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
740
- properties: G.deserialize(t.properties),
740
+ properties: H.deserialize(t.properties),
741
741
  height: N(t.height),
742
742
  width: N(t.width),
743
743
  size: N(t.size),
744
744
  duration: N(t.duration),
745
745
  bitrate: N(t.bitrate),
746
746
  languages: ui(t.language),
747
- alternates: Te.deserialize(t.alternate),
748
- children: Te.deserialize(t.children)
747
+ alternates: xe.deserialize(t.alternate),
748
+ children: xe.deserialize(t.children)
749
749
  });
750
750
  }
751
751
  /**
@@ -770,14 +770,14 @@ let xe = class {
770
770
  }
771
771
  /** List of URI template parameter keys, if the `Link` is templated. */
772
772
  get templateParameters() {
773
- return this.templated ? new xe(this.href).parameters : /* @__PURE__ */ new Set();
773
+ return this.templated ? new Ne(this.href).parameters : /* @__PURE__ */ new Set();
774
774
  }
775
775
  /** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
776
776
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
777
777
  */
778
778
  expandTemplate(t) {
779
- return new Rt({
780
- href: new xe(this.href).expand(t),
779
+ return new Ut({
780
+ href: new Ne(this.href).expand(t),
781
781
  templated: !1
782
782
  });
783
783
  }
@@ -785,15 +785,15 @@ let xe = class {
785
785
  * Makes a copy of this [Link] after merging in the given additional other [properties].
786
786
  */
787
787
  addProperties(t) {
788
- const e = Rt.deserialize(this.serialize());
789
- return e.properties = e.properties ? e.properties?.add(t) : new G(t), e;
788
+ const e = Ut.deserialize(this.serialize());
789
+ return e.properties = e.properties ? e.properties?.add(t) : new H(t), e;
790
790
  }
791
791
  /**
792
792
  * Creates a [Locator] from a reading order [Link].
793
793
  */
794
794
  get locator() {
795
795
  let t = this.href.split("#");
796
- return new ct({
796
+ return new ht({
797
797
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
798
798
  type: this.type ?? "",
799
799
  title: this.title,
@@ -802,7 +802,7 @@ let xe = class {
802
802
  })
803
803
  });
804
804
  }
805
- }, Te = class pi {
805
+ }, xe = class fi {
806
806
  /**
807
807
  * Creates a [Links].
808
808
  */
@@ -814,8 +814,8 @@ let xe = class {
814
814
  */
815
815
  static deserialize(t) {
816
816
  if (t && Array.isArray(t))
817
- return new pi(
818
- t.map((e) => _.deserialize(e)).filter((e) => e !== void 0)
817
+ return new fi(
818
+ t.map((e) => q.deserialize(e)).filter((e) => e !== void 0)
819
819
  );
820
820
  }
821
821
  /**
@@ -897,10 +897,10 @@ let xe = class {
897
897
  }
898
898
  };
899
899
  var Mi = /* @__PURE__ */ ((r) => (r.EPUB = "https://readium.org/webpub-manifest/profiles/epub", r.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", r.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", r.PDF = "https://readium.org/webpub-manifest/profiles/pdf", r))(Mi || {}), z = /* @__PURE__ */ ((r) => (r.ltr = "ltr", r.rtl = "rtl", r))(z || {});
900
- G.prototype.getContains = function() {
900
+ H.prototype.getContains = function() {
901
901
  return new Set(this.otherProperties.contains || []);
902
902
  };
903
- let je = class Bi {
903
+ let Te = class Bi {
904
904
  /**
905
905
  * Creates a [DomRange].
906
906
  */
@@ -932,7 +932,7 @@ let je = class Bi {
932
932
  return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
933
933
  }
934
934
  };
935
- class ge {
935
+ class ce {
936
936
  /**
937
937
  * Creates a [DomRange].
938
938
  */
@@ -944,11 +944,11 @@ class ge {
944
944
  */
945
945
  static deserialize(t) {
946
946
  if (!t) return;
947
- let e = je.deserialize(t.start);
947
+ let e = Te.deserialize(t.start);
948
948
  if (e)
949
- return new ge({
949
+ return new ce({
950
950
  start: e,
951
- end: je.deserialize(t.end)
951
+ end: Te.deserialize(t.end)
952
952
  });
953
953
  }
954
954
  /**
@@ -966,7 +966,7 @@ b.prototype.getPartialCfi = function() {
966
966
  return this.otherLocations?.get("partialCfi");
967
967
  };
968
968
  b.prototype.getDomRange = function() {
969
- return ge.deserialize(this.otherLocations?.get("domRange"));
969
+ return ce.deserialize(this.otherLocations?.get("domRange"));
970
970
  };
971
971
  b.prototype.fragmentParameters = function() {
972
972
  return new Map(
@@ -1000,7 +1000,7 @@ b.prototype.space = function() {
1000
1000
  if (t.length === 4 && !t.some(isNaN))
1001
1001
  return t;
1002
1002
  };
1003
- class de {
1003
+ class ge {
1004
1004
  /** Creates a [Price]. */
1005
1005
  constructor(t) {
1006
1006
  this.currency = t.currency, this.value = t.value;
@@ -1015,7 +1015,7 @@ class de {
1015
1015
  return;
1016
1016
  let i = N(t.value);
1017
1017
  if (i !== void 0)
1018
- return new de({ currency: e, value: i });
1018
+ return new ge({ currency: e, value: i });
1019
1019
  }
1020
1020
  /**
1021
1021
  * Serializes a [Price] to its RWPM JSON representation.
@@ -1024,7 +1024,7 @@ class de {
1024
1024
  return { currency: this.currency, value: this.value };
1025
1025
  }
1026
1026
  }
1027
- let oA = class Ct {
1027
+ let oA = class Rt {
1028
1028
  /** Creates a [Acquisition]. */
1029
1029
  constructor(t) {
1030
1030
  this.type = t.type, this.children = t.children;
@@ -1034,14 +1034,14 @@ let oA = class Ct {
1034
1034
  */
1035
1035
  static deserialize(t) {
1036
1036
  if (t && t.type)
1037
- return new Ct({
1037
+ return new Rt({
1038
1038
  type: t.type,
1039
- children: Ct.deserializeArray(t.children)
1039
+ children: Rt.deserializeArray(t.children)
1040
1040
  });
1041
1041
  }
1042
1042
  static deserializeArray(t) {
1043
1043
  if (Array.isArray(t))
1044
- return t.map((e) => Ct.deserialize(e)).filter((e) => e !== void 0);
1044
+ return t.map((e) => Rt.deserialize(e)).filter((e) => e !== void 0);
1045
1045
  }
1046
1046
  /**
1047
1047
  * Serializes a [Acquisition] to its RWPM JSON representation.
@@ -1051,7 +1051,7 @@ let oA = class Ct {
1051
1051
  return this.children && (t.children = this.children.map((e) => e.serialize())), t;
1052
1052
  }
1053
1053
  };
1054
- class ue {
1054
+ class de {
1055
1055
  /** Creates a [Price]. */
1056
1056
  constructor(t) {
1057
1057
  this.total = t.total, this.position = t.position;
@@ -1061,7 +1061,7 @@ class ue {
1061
1061
  */
1062
1062
  static deserialize(t) {
1063
1063
  if (t)
1064
- return new ue({
1064
+ return new de({
1065
1065
  total: N(t.total),
1066
1066
  position: N(t.position)
1067
1067
  });
@@ -1074,7 +1074,7 @@ class ue {
1074
1074
  return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
1075
1075
  }
1076
1076
  }
1077
- class me {
1077
+ class ue {
1078
1078
  /** Creates a [Copies]. */
1079
1079
  constructor(t) {
1080
1080
  this.total = t.total, this.available = t.available;
@@ -1084,7 +1084,7 @@ class me {
1084
1084
  */
1085
1085
  static deserialize(t) {
1086
1086
  if (t)
1087
- return new me({
1087
+ return new ue({
1088
1088
  total: N(t.total),
1089
1089
  available: N(t.available)
1090
1090
  });
@@ -1097,7 +1097,7 @@ class me {
1097
1097
  return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
1098
1098
  }
1099
1099
  }
1100
- class fe {
1100
+ class me {
1101
1101
  /** Creates a [Availability]. */
1102
1102
  constructor(t) {
1103
1103
  this.state = t.state, this.since = t.since, this.until = t.until;
@@ -1107,10 +1107,10 @@ class fe {
1107
1107
  */
1108
1108
  static deserialize(t) {
1109
1109
  if (t && t.state)
1110
- return new fe({
1110
+ return new me({
1111
1111
  state: t.state,
1112
- since: Ne(t.since),
1113
- until: Ne(t.until)
1112
+ since: Ye(t.since),
1113
+ until: Ye(t.until)
1114
1114
  });
1115
1115
  }
1116
1116
  /**
@@ -1121,31 +1121,31 @@ class fe {
1121
1121
  return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
1122
1122
  }
1123
1123
  }
1124
- G.prototype.getNumberOfItems = function() {
1124
+ H.prototype.getNumberOfItems = function() {
1125
1125
  return N(this.otherProperties.numberOfItems);
1126
1126
  };
1127
- G.prototype.getPrice = function() {
1128
- return de.deserialize(this.otherProperties.price);
1127
+ H.prototype.getPrice = function() {
1128
+ return ge.deserialize(this.otherProperties.price);
1129
1129
  };
1130
- G.prototype.getIndirectAcquisitions = function() {
1130
+ H.prototype.getIndirectAcquisitions = function() {
1131
1131
  const r = this.otherProperties.indirectAcquisition;
1132
1132
  if (r && Array.isArray(r))
1133
1133
  return r.map((t) => oA.deserialize(t)).filter((t) => t !== void 0);
1134
1134
  };
1135
- G.prototype.getHolds = function() {
1136
- return ue.deserialize(this.otherProperties.holds);
1135
+ H.prototype.getHolds = function() {
1136
+ return de.deserialize(this.otherProperties.holds);
1137
1137
  };
1138
- G.prototype.getCopies = function() {
1139
- return me.deserialize(this.otherProperties.copies);
1138
+ H.prototype.getCopies = function() {
1139
+ return ue.deserialize(this.otherProperties.copies);
1140
1140
  };
1141
- G.prototype.getAvailability = function() {
1142
- return fe.deserialize(this.otherProperties.availability);
1141
+ H.prototype.getAvailability = function() {
1142
+ return me.deserialize(this.otherProperties.availability);
1143
1143
  };
1144
- G.prototype.getAuthenticate = function() {
1145
- return _.deserialize(this.otherProperties.authenticate);
1144
+ H.prototype.getAuthenticate = function() {
1145
+ return q.deserialize(this.otherProperties.authenticate);
1146
1146
  };
1147
1147
  const aA = "CssSelectorGenerator";
1148
- function be(r = "unknown problem", ...t) {
1148
+ function je(r = "unknown problem", ...t) {
1149
1149
  console.warn(`${aA}: ${r}`, ...t);
1150
1150
  }
1151
1151
  function lA(r) {
@@ -1161,13 +1161,13 @@ function cA(r) {
1161
1161
  if (typeof e == "function")
1162
1162
  return (i) => {
1163
1163
  const A = e(i);
1164
- return typeof A != "boolean" ? (be("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : A;
1164
+ return typeof A != "boolean" ? (je("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : A;
1165
1165
  };
1166
1166
  if (typeof e == "string") {
1167
1167
  const i = new RegExp("^" + hA(e) + "$");
1168
1168
  return (A) => i.test(A);
1169
1169
  }
1170
- return be("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
1170
+ return je("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
1171
1171
  });
1172
1172
  return (e) => t.some((i) => i(e));
1173
1173
  }
@@ -1194,26 +1194,20 @@ class wi extends gA {
1194
1194
  }
1195
1195
  }
1196
1196
  const dA = `
1197
- /* FontFamily */
1198
-
1199
- :root[style*="--USER__fontFamily"] {
1200
- font-family: var(--USER__fontFamily) !important;
1201
- }
1202
-
1203
- :root[style*="--USER__fontFamily"] * {
1204
- font-family: revert !important;
1205
- }
1206
-
1207
- /* FontWeight */
1197
+ /* TextAlign */
1208
1198
 
1209
- :root[style*="--USER__fontWeight"] body {
1210
- font-weight: var(--USER__fontWeight) !important;
1199
+ :root[style*="--USER__textAlign"] {
1200
+ text-align: var(--USER__textAlign);
1211
1201
  }
1212
1202
 
1213
- /* Attempt to handle known bolds */
1214
- :root[style*="--USER__fontWeight"] b,
1215
- :root[style*="--USER__fontWeight"] strong {
1216
- font-weight: bolder;
1203
+ :root[style*="--USER__textAlign"] body,
1204
+ :root[style*="--USER__textAlign"] p:not([class*="title"]):not(blockquote p):not(figcaption p):not(header p):not(hgroup p):not(div:has(+ *) > h1 + p):not(div:has(+ *) > p:has(+ h1)),
1205
+ :root[style*="--USER__textAlign"] li,
1206
+ :root[style*="--USER__textAlign"] dd {
1207
+ text-align: var(--USER__textAlign) !important;
1208
+ -moz-text-align-last: auto !important;
1209
+ -epub-text-align-last: auto !important;
1210
+ text-align-last: auto !important;
1217
1211
  }
1218
1212
 
1219
1213
  /* Hyphens */
@@ -1238,84 +1232,14 @@ const dA = `
1238
1232
  hyphens: inherit;
1239
1233
  }
1240
1234
 
1241
- /* LetterSpacing */
1242
-
1243
- :root[style*="--USER__letterSpacing"] h1,
1244
- :root[style*="--USER__letterSpacing"] h2,
1245
- :root[style*="--USER__letterSpacing"] h3,
1246
- :root[style*="--USER__letterSpacing"] h4,
1247
- :root[style*="--USER__letterSpacing"] h5,
1248
- :root[style*="--USER__letterSpacing"] h6,
1249
- :root[style*="--USER__letterSpacing"] p,
1250
- :root[style*="--USER__letterSpacing"] li,
1251
- :root[style*="--USER__letterSpacing"] div,
1252
- :root[style*="--USER__letterSpacing"] dt,
1253
- :root[style*="--USER__letterSpacing"] dd {
1254
- letter-spacing: var(--USER__letterSpacing);
1255
- font-variant: none;
1256
- }
1257
-
1258
- /* Ligatures */
1259
-
1260
- :root[style*="--USER__ligatures"] {
1261
- font-variant-ligatures: var(--USER__ligatures) !important;
1262
- }
1263
-
1264
- :root[style*="--USER__ligatures"] * {
1265
- font-variant-ligatures: inherit !important;
1266
- }
1267
-
1268
- /* LineHeight */
1269
-
1270
- :root[style*="--USER__lineHeight"] {
1271
- line-height: var(--USER__lineHeight) !important;
1272
- }
1273
-
1274
- :root[style*="--USER__lineHeight"] body,
1275
- :root[style*="--USER__lineHeight"] p,
1276
- :root[style*="--USER__lineHeight"] li,
1277
- :root[style*="--USER__lineHeight"] div {
1278
- line-height: inherit;
1279
- }
1280
-
1281
- /* ParagraphIndent */
1282
-
1283
- :root[style*="--USER__paraIndent"] p {
1284
- text-indent: var(--USER__paraIndent) !important;
1285
- }
1286
-
1287
- :root[style*="--USER__paraIndent"] p *,
1288
- :root[style*="--USER__paraIndent"] p:first-letter {
1289
- text-indent: 0 !important;
1290
- }
1291
-
1292
- /* ParagraphSpacing */
1293
-
1294
- :root[style*="--USER__paraSpacing"] p {
1295
- margin-block: var(--USER__paraSpacing) !important;
1296
- }
1297
-
1298
- /* Ruby */
1299
-
1300
- :root[style*="readium-noRuby-on"] body rt,
1301
- :root[style*="readium-noRuby-on"] body rp {
1302
- display: none;
1303
- }
1304
-
1305
- /* TextAlign */
1235
+ /* FontFamily */
1306
1236
 
1307
- :root[style*="--USER__textAlign"] {
1308
- text-align: var(--USER__textAlign);
1237
+ :root[style*="--USER__fontFamily"] {
1238
+ font-family: var(--USER__fontFamily) !important;
1309
1239
  }
1310
1240
 
1311
- :root[style*="--USER__textAlign"] body,
1312
- :root[style*="--USER__textAlign"] p:not(blockquote p):not(figcaption p):not(hgroup p),
1313
- :root[style*="--USER__textAlign"] li,
1314
- :root[style*="--USER__textAlign"] dd {
1315
- text-align: var(--USER__textAlign) !important;
1316
- -moz-text-align-last: auto !important;
1317
- -epub-text-align-last: auto !important;
1318
- text-align-last: auto !important;
1241
+ :root[style*="--USER__fontFamily"] * {
1242
+ font-family: revert !important;
1319
1243
  }
1320
1244
 
1321
1245
  /* TextNormalize */
@@ -1325,13 +1249,13 @@ const dA = `
1325
1249
  font-style: normal !important;
1326
1250
  }
1327
1251
 
1328
- :root[style*="readium-a11y-on"] *:not(code):not(var):not(kbd):not(samp) {
1252
+ :root[style*="readium-a11y-on"] body *:not(code):not(var):not(kbd):not(samp) {
1329
1253
  font-family: inherit !important;
1330
1254
  font-weight: inherit !important;
1331
1255
  font-style: inherit !important;
1332
1256
  }
1333
1257
 
1334
- :root[style*="readium-a11y-on"] * {
1258
+ :root[style*="readium-a11y-on"] body * {
1335
1259
  text-decoration: none !important;
1336
1260
  font-variant-caps: normal !important;
1337
1261
  font-variant-position: normal !important;
@@ -1344,22 +1268,6 @@ const dA = `
1344
1268
  vertical-align: baseline !important;
1345
1269
  }
1346
1270
 
1347
- /* Word Spacing */
1348
-
1349
- :root[style*="--USER__wordSpacing"] h1,
1350
- :root[style*="--USER__wordSpacing"] h2,
1351
- :root[style*="--USER__wordSpacing"] h3,
1352
- :root[style*="--USER__wordSpacing"] h4,
1353
- :root[style*="--USER__wordSpacing"] h5,
1354
- :root[style*="--USER__wordSpacing"] h6,
1355
- :root[style*="--USER__wordSpacing"] p,
1356
- :root[style*="--USER__wordSpacing"] li,
1357
- :root[style*="--USER__wordSpacing"] div,
1358
- :root[style*="--USER__wordSpacing"] dt,
1359
- :root[style*="--USER__wordSpacing"] dd {
1360
- word-spacing: var(--USER__wordSpacing);
1361
- }
1362
-
1363
1271
  /* Zoom */
1364
1272
 
1365
1273
  :root {
@@ -1394,24 +1302,116 @@ const dA = `
1394
1302
  zoom: var(--USER__zoom) !important;
1395
1303
  }
1396
1304
  }
1397
- `, Jt = (r, t) => URL.createObjectURL(new Blob([r], { type: t })), Ei = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), pe = (r, t) => {
1305
+
1306
+ /* LineHeight */
1307
+
1308
+ :root[style*="--USER__lineHeight"] {
1309
+ line-height: var(--USER__lineHeight) !important;
1310
+ }
1311
+
1312
+ :root[style*="--USER__lineHeight"] body,
1313
+ :root[style*="--USER__lineHeight"] p,
1314
+ :root[style*="--USER__lineHeight"] li,
1315
+ :root[style*="--USER__lineHeight"] div {
1316
+ line-height: inherit;
1317
+ }
1318
+
1319
+ /* ParagraphSpacing */
1320
+
1321
+ :root[style*="--USER__paraSpacing"] p {
1322
+ margin-block: var(--USER__paraSpacing) !important;
1323
+ }
1324
+
1325
+ /* ParagraphIndent */
1326
+
1327
+ :root[style*="--USER__paraIndent"] p {
1328
+ text-indent: var(--USER__paraIndent) !important;
1329
+ }
1330
+
1331
+ :root[style*="--USER__paraIndent"] p *,
1332
+ :root[style*="--USER__paraIndent"] p:first-letter {
1333
+ text-indent: 0 !important;
1334
+ }
1335
+
1336
+ /* WordSpacing */
1337
+
1338
+ :root[style*="--USER__wordSpacing"] h1,
1339
+ :root[style*="--USER__wordSpacing"] h2,
1340
+ :root[style*="--USER__wordSpacing"] h3,
1341
+ :root[style*="--USER__wordSpacing"] h4,
1342
+ :root[style*="--USER__wordSpacing"] h5,
1343
+ :root[style*="--USER__wordSpacing"] h6,
1344
+ :root[style*="--USER__wordSpacing"] p,
1345
+ :root[style*="--USER__wordSpacing"] li,
1346
+ :root[style*="--USER__wordSpacing"] div,
1347
+ :root[style*="--USER__wordSpacing"] dt,
1348
+ :root[style*="--USER__wordSpacing"] dd {
1349
+ word-spacing: var(--USER__wordSpacing);
1350
+ }
1351
+
1352
+ /* LetterSpacing */
1353
+
1354
+ :root[style*="--USER__letterSpacing"] h1,
1355
+ :root[style*="--USER__letterSpacing"] h2,
1356
+ :root[style*="--USER__letterSpacing"] h3,
1357
+ :root[style*="--USER__letterSpacing"] h4,
1358
+ :root[style*="--USER__letterSpacing"] h5,
1359
+ :root[style*="--USER__letterSpacing"] h6,
1360
+ :root[style*="--USER__letterSpacing"] p,
1361
+ :root[style*="--USER__letterSpacing"] li,
1362
+ :root[style*="--USER__letterSpacing"] div,
1363
+ :root[style*="--USER__letterSpacing"] dt,
1364
+ :root[style*="--USER__letterSpacing"] dd {
1365
+ letter-spacing: var(--USER__letterSpacing);
1366
+ font-variant: none;
1367
+ }
1368
+
1369
+ /* FontWeight */
1370
+
1371
+ :root[style*="--USER__fontWeight"] body {
1372
+ font-weight: var(--USER__fontWeight) !important;
1373
+ }
1374
+
1375
+ /* Attempt to handle known bolds */
1376
+ :root[style*="--USER__fontWeight"] b,
1377
+ :root[style*="--USER__fontWeight"] strong {
1378
+ font-weight: bolder;
1379
+ }
1380
+
1381
+ /* Ruby */
1382
+
1383
+ :root[style*="readium-noRuby-on"] body rt,
1384
+ :root[style*="readium-noRuby-on"] body rp {
1385
+ display: none;
1386
+ }
1387
+
1388
+ /* Ligatures */
1389
+
1390
+ :root[style*="--USER__ligatures"] {
1391
+ font-variant-ligatures: var(--USER__ligatures) !important;
1392
+ }
1393
+
1394
+ :root[style*="--USER__ligatures"] * {
1395
+ font-variant-ligatures: inherit !important;
1396
+ }
1397
+ `, kt = (r, t) => URL.createObjectURL(new Blob([r], { type: t })), Ei = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), pe = (r, t) => {
1398
1398
  const e = r.createElement("script");
1399
- return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t : Jt(t, "text/javascript"), e;
1399
+ return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t : kt(t, "text/javascript"), e;
1400
1400
  }, uA = (r, t) => {
1401
1401
  const e = r.createElement("style");
1402
1402
  return e.dataset.readium = "true", e.textContent = t, e;
1403
- }, Xt = /* @__PURE__ */ new Map(), Me = (r, t) => {
1404
- if (Xt.has(r)) return Xt.get(r);
1403
+ }, Ot = /* @__PURE__ */ new Map(), fe = (r, t) => {
1404
+ if (Ot.has(r)) return Ot.get(r);
1405
1405
  const e = t();
1406
- return Xt.set(r, e), e;
1407
- }, mA = (r) => pe(r, Me("css-selector-generator", () => Jt(
1406
+ return Ot.set(r, e), e;
1407
+ }, mA = (r) => pe(r, fe("css-selector-generator", () => kt(
1408
1408
  '!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})()));',
1409
1409
  "text/javascript"
1410
- ))), fA = `
1410
+ ))), pA = `
1411
1411
  window._readium_blockedEvents = [];
1412
1412
  window._readium_blockEvents = false; // WebPub doesn't need event blocking
1413
1413
  window._readium_eventBlocker = null;
1414
- `, pA = (r) => pe(r, Me("webpub-js-before", () => Jt(Ei(fA), "text/javascript"))), MA = (r) => pe(r, Me("webpub-js-after", () => Jt(Ei(`
1414
+ `, fA = (r) => pe(r, fe("webpub-js-before", () => kt(Ei(pA), "text/javascript"))), MA = (r) => pe(r, fe("webpub-js-after", () => kt(Ei(`
1415
1415
  if(window.onload) window.onload = new Proxy(window.onload, {
1416
1416
  apply: function(target, receiver, args) {
1417
1417
  if(!window._readium_blockEvents) {
@@ -1462,7 +1462,7 @@ class BA {
1462
1462
  h.href = e, h.dataset.readium = "true", t.head.firstChild.before(h);
1463
1463
  }
1464
1464
  const o = this.hasExecutable(t);
1465
- o && t.head.firstChild.before(pA(t)), t.head.firstChild.before(mA(t)), o && t.head.appendChild(MA(t));
1465
+ o && t.head.firstChild.before(fA(t)), t.head.firstChild.before(mA(t)), o && t.head.appendChild(MA(t));
1466
1466
  let a;
1467
1467
  return i.string === "application/xhtml+xml" ? a = new XMLSerializer().serializeToString(t) : a = this.serializeAsHTML(t, A || ""), URL.createObjectURL(
1468
1468
  new Blob([a], {
@@ -1477,7 +1477,7 @@ class BA {
1477
1477
  return A + s;
1478
1478
  }
1479
1479
  }
1480
- const wA = Math.pow(2, 32), Ve = () => Math.round(Math.random() * wA).toString(36), ne = () => `${Math.round(performance.now())}-${Ve()}-${Ve()}`, lt = 1;
1480
+ const wA = Math.pow(2, 32), be = () => Math.round(Math.random() * wA).toString(36), Ae = () => `${Math.round(performance.now())}-${be()}-${be()}`, at = 1;
1481
1481
  class EA {
1482
1482
  constructor(t) {
1483
1483
  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);
@@ -1489,8 +1489,8 @@ class EA {
1489
1489
  if (!(!("_readium" in e) || !e._readium || e._readium <= 0)) {
1490
1490
  if (e.key === "_ping") {
1491
1491
  if (!this.destination) {
1492
- if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !== lt) {
1493
- e._readium > lt ? this.send("error", `received comms version ${e._readium} higher than ${lt}`) : this.send("error", `received comms version ${e._readium} lower than ${lt}`), this.destination = null, this.origin = "", this.channelId = "";
1492
+ if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !== at) {
1493
+ e._readium > at ? this.send("error", `received comms version ${e._readium} higher than ${at}`) : this.send("error", `received comms version ${e._readium} lower than ${at}`), this.destination = null, this.origin = "", this.channelId = "";
1494
1494
  return;
1495
1495
  }
1496
1496
  this.send("_pong", void 0), this.preLog.forEach((i) => this.send("log", i)), this.preLog = [];
@@ -1550,9 +1550,9 @@ class EA {
1550
1550
  send(t, e, i = void 0, A = []) {
1551
1551
  if (!this.destination) throw Error("Attempted to send comms message before destination has been initialized");
1552
1552
  const n = {
1553
- _readium: lt,
1553
+ _readium: at,
1554
1554
  _channel: this.channelId,
1555
- id: i ?? ne(),
1555
+ id: i ?? Ae(),
1556
1556
  // scrict,
1557
1557
  key: t,
1558
1558
  data: e
@@ -1568,15 +1568,15 @@ class EA {
1568
1568
  }
1569
1569
  }
1570
1570
  }
1571
- const O = class ht {
1571
+ const L = class lt {
1572
1572
  constructor(t) {
1573
1573
  if (typeof t == "string") {
1574
- if (!ht.VALID_MODES.has(t.toLowerCase()))
1574
+ if (!lt.VALID_MODES.has(t.toLowerCase()))
1575
1575
  return;
1576
1576
  this.value = t.toLowerCase();
1577
1577
  } else {
1578
1578
  const e = t.filter(
1579
- (i) => ht.VALID_MODES.has(i.toLowerCase())
1579
+ (i) => lt.VALID_MODES.has(i.toLowerCase())
1580
1580
  );
1581
1581
  if (e.length === 0)
1582
1582
  return;
@@ -1589,11 +1589,11 @@ const O = class ht {
1589
1589
  static deserialize(t) {
1590
1590
  if (!t) return;
1591
1591
  if (typeof t == "string")
1592
- return new ht(t);
1592
+ return new lt(t);
1593
1593
  if (!Array.isArray(t)) return;
1594
- const e = t.filter((i) => i ? ht.VALID_MODES.has(i.toLowerCase()) : !1);
1594
+ const e = t.filter((i) => i ? lt.VALID_MODES.has(i.toLowerCase()) : !1);
1595
1595
  if (e.length !== 0)
1596
- return new ht(e);
1596
+ return new lt(e);
1597
1597
  }
1598
1598
  /**
1599
1599
  * Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
@@ -1602,8 +1602,8 @@ const O = class ht {
1602
1602
  return this.value;
1603
1603
  }
1604
1604
  };
1605
- O.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), O.AUDITORY = new O("auditory"), O.TACTILE = new O("tactile"), O.TEXTUAL = new O("textual"), O.VISUAL = new O("visual");
1606
- class Be {
1605
+ L.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), L.AUDITORY = new L("auditory"), L.TACTILE = new L("tactile"), L.TEXTUAL = new L("textual"), L.VISUAL = new L("visual");
1606
+ class Me {
1607
1607
  /**
1608
1608
  * Creates a [Encryption].
1609
1609
  */
@@ -1615,7 +1615,7 @@ class Be {
1615
1615
  */
1616
1616
  static deserialize(t) {
1617
1617
  if (t && t.algorithm)
1618
- return new Be({
1618
+ return new Me({
1619
1619
  algorithm: t.algorithm,
1620
1620
  compression: t.compression,
1621
1621
  originalLength: t.originalLength,
@@ -1663,7 +1663,7 @@ class T {
1663
1663
  }
1664
1664
  Object.defineProperty(T.prototype, "encryption", {
1665
1665
  get: function() {
1666
- return Be.deserialize(this.otherProperties.encrypted);
1666
+ return Me.deserialize(this.otherProperties.encrypted);
1667
1667
  }
1668
1668
  });
1669
1669
  function IA(r) {
@@ -1672,14 +1672,14 @@ function IA(r) {
1672
1672
  function Ii(r) {
1673
1673
  return r && typeof r == "string" ? [r] : IA(r);
1674
1674
  }
1675
- function Pe(r) {
1675
+ function Ve(r) {
1676
1676
  return typeof r == "string" ? new Date(r) : void 0;
1677
1677
  }
1678
- function St(r) {
1678
+ function Ct(r) {
1679
1679
  return isNaN(r) ? void 0 : r;
1680
1680
  }
1681
1681
  function x(r) {
1682
- return St(r) !== void 0 && Math.sign(r) >= 0 ? r : void 0;
1682
+ return Ct(r) !== void 0 && Math.sign(r) >= 0 ? r : void 0;
1683
1683
  }
1684
1684
  function FA(r) {
1685
1685
  const t = new Array();
@@ -1699,8 +1699,8 @@ class m {
1699
1699
  for (let d = 1; d < A.length; d++) {
1700
1700
  const M = A[d].split("=");
1701
1701
  if (M.length === 2) {
1702
- const l = M[0].toLocaleLowerCase(), f = l === "charset" ? M[1].toUpperCase() : M[1];
1703
- s[l] = f;
1702
+ const l = M[0].toLocaleLowerCase(), p = l === "charset" ? M[1].toUpperCase() : M[1];
1703
+ s[l] = p;
1704
1704
  }
1705
1705
  }
1706
1706
  const o = {}, a = Object.keys(s);
@@ -2140,7 +2140,7 @@ class m {
2140
2140
  });
2141
2141
  }
2142
2142
  }
2143
- class ve {
2143
+ class Pe {
2144
2144
  constructor(t) {
2145
2145
  this.uri = t, this.parameters = this.getParameters(t);
2146
2146
  }
@@ -2180,7 +2180,7 @@ class C {
2180
2180
  */
2181
2181
  static deserialize(t) {
2182
2182
  if (!t) return;
2183
- const e = St(t.progression), i = St(t.totalProgression), A = St(t.position), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
2183
+ const e = Ct(t.progression), i = Ct(t.totalProgression), A = Ct(t.position), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
2184
2184
  "fragment",
2185
2185
  "fragments",
2186
2186
  "progression",
@@ -2205,7 +2205,7 @@ class C {
2205
2205
  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, i) => t[i] = e), t;
2206
2206
  }
2207
2207
  }
2208
- class nt {
2208
+ class At {
2209
2209
  /**
2210
2210
  * Creates a [Text].
2211
2211
  */
@@ -2217,7 +2217,7 @@ class nt {
2217
2217
  */
2218
2218
  static deserialize(t) {
2219
2219
  if (t)
2220
- return new nt({
2220
+ return new At({
2221
2221
  after: t.after,
2222
2222
  before: t.before,
2223
2223
  highlight: t.highlight
@@ -2231,7 +2231,7 @@ class nt {
2231
2231
  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;
2232
2232
  }
2233
2233
  }
2234
- class X {
2234
+ class O {
2235
2235
  /**
2236
2236
  * Creates a [Locator].
2237
2237
  */
@@ -2243,12 +2243,12 @@ class X {
2243
2243
  */
2244
2244
  static deserialize(t) {
2245
2245
  if (t && t.href && t.type)
2246
- return new X({
2246
+ return new O({
2247
2247
  href: t.href,
2248
2248
  type: t.type,
2249
2249
  title: t.title,
2250
2250
  locations: C.deserialize(t.locations),
2251
- text: nt.deserialize(t.text)
2251
+ text: At.deserialize(t.text)
2252
2252
  });
2253
2253
  }
2254
2254
  /**
@@ -2262,7 +2262,7 @@ class X {
2262
2262
  * Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
2263
2263
  */
2264
2264
  copyWithLocations(t) {
2265
- return new X({
2265
+ return new O({
2266
2266
  href: this.href,
2267
2267
  type: this.type,
2268
2268
  title: this.title,
@@ -2271,7 +2271,7 @@ class X {
2271
2271
  });
2272
2272
  }
2273
2273
  }
2274
- class gt {
2274
+ class ct {
2275
2275
  /**
2276
2276
  * Creates a [Link].
2277
2277
  */
@@ -2283,7 +2283,7 @@ class gt {
2283
2283
  */
2284
2284
  static deserialize(t) {
2285
2285
  if (!(!t || typeof t.href != "string"))
2286
- return new gt({
2286
+ return new ct({
2287
2287
  href: t.href,
2288
2288
  templated: t.templated,
2289
2289
  type: t.type,
@@ -2296,8 +2296,8 @@ class gt {
2296
2296
  duration: x(t.duration),
2297
2297
  bitrate: x(t.bitrate),
2298
2298
  languages: Ii(t.language),
2299
- alternates: zt.deserialize(t.alternate),
2300
- children: zt.deserialize(t.children)
2299
+ alternates: Qt.deserialize(t.alternate),
2300
+ children: Qt.deserialize(t.children)
2301
2301
  });
2302
2302
  }
2303
2303
  /**
@@ -2322,14 +2322,14 @@ class gt {
2322
2322
  }
2323
2323
  /** List of URI template parameter keys, if the `Link` is templated. */
2324
2324
  get templateParameters() {
2325
- return this.templated ? new ve(this.href).parameters : /* @__PURE__ */ new Set();
2325
+ return this.templated ? new Pe(this.href).parameters : /* @__PURE__ */ new Set();
2326
2326
  }
2327
2327
  /** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
2328
2328
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
2329
2329
  */
2330
2330
  expandTemplate(t) {
2331
- return new gt({
2332
- href: new ve(this.href).expand(t),
2331
+ return new ct({
2332
+ href: new Pe(this.href).expand(t),
2333
2333
  templated: !1
2334
2334
  });
2335
2335
  }
@@ -2337,7 +2337,7 @@ class gt {
2337
2337
  * Makes a copy of this [Link] after merging in the given additional other [properties].
2338
2338
  */
2339
2339
  addProperties(t) {
2340
- const e = gt.deserialize(this.serialize());
2340
+ const e = ct.deserialize(this.serialize());
2341
2341
  return e.properties = e.properties ? e.properties?.add(t) : new T(t), e;
2342
2342
  }
2343
2343
  /**
@@ -2345,7 +2345,7 @@ class gt {
2345
2345
  */
2346
2346
  get locator() {
2347
2347
  let t = this.href.split("#");
2348
- return new X({
2348
+ return new O({
2349
2349
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
2350
2350
  type: this.type ?? "",
2351
2351
  title: this.title,
@@ -2355,7 +2355,7 @@ class gt {
2355
2355
  });
2356
2356
  }
2357
2357
  }
2358
- class zt {
2358
+ class Qt {
2359
2359
  /**
2360
2360
  * Creates a [Links].
2361
2361
  */
@@ -2367,8 +2367,8 @@ class zt {
2367
2367
  */
2368
2368
  static deserialize(t) {
2369
2369
  if (t && Array.isArray(t))
2370
- return new zt(
2371
- t.map((e) => gt.deserialize(e)).filter((e) => e !== void 0)
2370
+ return new Qt(
2371
+ t.map((e) => ct.deserialize(e)).filter((e) => e !== void 0)
2372
2372
  );
2373
2373
  }
2374
2374
  /**
@@ -2452,7 +2452,7 @@ class zt {
2452
2452
  T.prototype.getContains = function() {
2453
2453
  return new Set(this.otherProperties.contains || []);
2454
2454
  };
2455
- class Yt {
2455
+ class zt {
2456
2456
  /**
2457
2457
  * Creates a [DomRange].
2458
2458
  */
@@ -2467,7 +2467,7 @@ class Yt {
2467
2467
  let e = x(t.textNodeIndex);
2468
2468
  if (e === void 0) return;
2469
2469
  let i = x(t.charOffset);
2470
- return i === void 0 && (i = x(t.offset)), new Yt({
2470
+ return i === void 0 && (i = x(t.offset)), new zt({
2471
2471
  cssSelector: t.cssSelector,
2472
2472
  textNodeIndex: e,
2473
2473
  charOffset: i
@@ -2484,7 +2484,7 @@ class Yt {
2484
2484
  return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
2485
2485
  }
2486
2486
  }
2487
- class we {
2487
+ class Be {
2488
2488
  /**
2489
2489
  * Creates a [DomRange].
2490
2490
  */
@@ -2496,11 +2496,11 @@ class we {
2496
2496
  */
2497
2497
  static deserialize(t) {
2498
2498
  if (!t) return;
2499
- let e = Yt.deserialize(t.start);
2499
+ let e = zt.deserialize(t.start);
2500
2500
  if (e)
2501
- return new we({
2501
+ return new Be({
2502
2502
  start: e,
2503
- end: Yt.deserialize(t.end)
2503
+ end: zt.deserialize(t.end)
2504
2504
  });
2505
2505
  }
2506
2506
  /**
@@ -2518,7 +2518,7 @@ C.prototype.getPartialCfi = function() {
2518
2518
  return this.otherLocations?.get("partialCfi");
2519
2519
  };
2520
2520
  C.prototype.getDomRange = function() {
2521
- return we.deserialize(this.otherLocations?.get("domRange"));
2521
+ return Be.deserialize(this.otherLocations?.get("domRange"));
2522
2522
  };
2523
2523
  C.prototype.fragmentParameters = function() {
2524
2524
  return new Map(
@@ -2552,7 +2552,7 @@ C.prototype.space = function() {
2552
2552
  if (t.length === 4 && !t.some(isNaN))
2553
2553
  return t;
2554
2554
  };
2555
- class Ee {
2555
+ class we {
2556
2556
  /** Creates a [Price]. */
2557
2557
  constructor(t) {
2558
2558
  this.currency = t.currency, this.value = t.value;
@@ -2567,7 +2567,7 @@ class Ee {
2567
2567
  return;
2568
2568
  let i = x(t.value);
2569
2569
  if (i !== void 0)
2570
- return new Ee({ currency: e, value: i });
2570
+ return new we({ currency: e, value: i });
2571
2571
  }
2572
2572
  /**
2573
2573
  * Serializes a [Price] to its RWPM JSON representation.
@@ -2576,7 +2576,7 @@ class Ee {
2576
2576
  return { currency: this.currency, value: this.value };
2577
2577
  }
2578
2578
  }
2579
- class ft {
2579
+ class mt {
2580
2580
  /** Creates a [Acquisition]. */
2581
2581
  constructor(t) {
2582
2582
  this.type = t.type, this.children = t.children;
@@ -2586,14 +2586,14 @@ class ft {
2586
2586
  */
2587
2587
  static deserialize(t) {
2588
2588
  if (t && t.type)
2589
- return new ft({
2589
+ return new mt({
2590
2590
  type: t.type,
2591
- children: ft.deserializeArray(t.children)
2591
+ children: mt.deserializeArray(t.children)
2592
2592
  });
2593
2593
  }
2594
2594
  static deserializeArray(t) {
2595
2595
  if (Array.isArray(t))
2596
- return t.map((e) => ft.deserialize(e)).filter((e) => e !== void 0);
2596
+ return t.map((e) => mt.deserialize(e)).filter((e) => e !== void 0);
2597
2597
  }
2598
2598
  /**
2599
2599
  * Serializes a [Acquisition] to its RWPM JSON representation.
@@ -2603,7 +2603,7 @@ class ft {
2603
2603
  return this.children && (t.children = this.children.map((e) => e.serialize())), t;
2604
2604
  }
2605
2605
  }
2606
- class Ie {
2606
+ class Ee {
2607
2607
  /** Creates a [Price]. */
2608
2608
  constructor(t) {
2609
2609
  this.total = t.total, this.position = t.position;
@@ -2613,7 +2613,7 @@ class Ie {
2613
2613
  */
2614
2614
  static deserialize(t) {
2615
2615
  if (t)
2616
- return new Ie({
2616
+ return new Ee({
2617
2617
  total: x(t.total),
2618
2618
  position: x(t.position)
2619
2619
  });
@@ -2626,7 +2626,7 @@ class Ie {
2626
2626
  return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
2627
2627
  }
2628
2628
  }
2629
- class Fe {
2629
+ class Ie {
2630
2630
  /** Creates a [Copies]. */
2631
2631
  constructor(t) {
2632
2632
  this.total = t.total, this.available = t.available;
@@ -2636,7 +2636,7 @@ class Fe {
2636
2636
  */
2637
2637
  static deserialize(t) {
2638
2638
  if (t)
2639
- return new Fe({
2639
+ return new Ie({
2640
2640
  total: x(t.total),
2641
2641
  available: x(t.available)
2642
2642
  });
@@ -2649,7 +2649,7 @@ class Fe {
2649
2649
  return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
2650
2650
  }
2651
2651
  }
2652
- class Ue {
2652
+ class Fe {
2653
2653
  /** Creates a [Availability]. */
2654
2654
  constructor(t) {
2655
2655
  this.state = t.state, this.since = t.since, this.until = t.until;
@@ -2659,10 +2659,10 @@ class Ue {
2659
2659
  */
2660
2660
  static deserialize(t) {
2661
2661
  if (t && t.state)
2662
- return new Ue({
2662
+ return new Fe({
2663
2663
  state: t.state,
2664
- since: Pe(t.since),
2665
- until: Pe(t.until)
2664
+ since: Ve(t.since),
2665
+ until: Ve(t.until)
2666
2666
  });
2667
2667
  }
2668
2668
  /**
@@ -2677,30 +2677,30 @@ T.prototype.getNumberOfItems = function() {
2677
2677
  return x(this.otherProperties.numberOfItems);
2678
2678
  };
2679
2679
  T.prototype.getPrice = function() {
2680
- return Ee.deserialize(this.otherProperties.price);
2680
+ return we.deserialize(this.otherProperties.price);
2681
2681
  };
2682
2682
  T.prototype.getIndirectAcquisitions = function() {
2683
2683
  const r = this.otherProperties.indirectAcquisition;
2684
2684
  if (r && Array.isArray(r))
2685
- return r.map((t) => ft.deserialize(t)).filter((t) => t !== void 0);
2685
+ return r.map((t) => mt.deserialize(t)).filter((t) => t !== void 0);
2686
2686
  };
2687
2687
  T.prototype.getHolds = function() {
2688
- return Ie.deserialize(this.otherProperties.holds);
2688
+ return Ee.deserialize(this.otherProperties.holds);
2689
2689
  };
2690
2690
  T.prototype.getCopies = function() {
2691
- return Fe.deserialize(this.otherProperties.copies);
2691
+ return Ie.deserialize(this.otherProperties.copies);
2692
2692
  };
2693
2693
  T.prototype.getAvailability = function() {
2694
- return Ue.deserialize(this.otherProperties.availability);
2694
+ return Fe.deserialize(this.otherProperties.availability);
2695
2695
  };
2696
2696
  T.prototype.getAuthenticate = function() {
2697
- return gt.deserialize(this.otherProperties.authenticate);
2697
+ return ct.deserialize(this.otherProperties.authenticate);
2698
2698
  };
2699
- const UA = "CssSelectorGenerator";
2700
- function De(r = "unknown problem", ...t) {
2701
- console.warn(`${UA}: ${r}`, ...t);
2699
+ const yA = "CssSelectorGenerator";
2700
+ function ve(r = "unknown problem", ...t) {
2701
+ console.warn(`${yA}: ${r}`, ...t);
2702
2702
  }
2703
- function yA(r) {
2703
+ function UA(r) {
2704
2704
  return r instanceof RegExp;
2705
2705
  }
2706
2706
  function RA(r) {
@@ -2708,18 +2708,18 @@ function RA(r) {
2708
2708
  }
2709
2709
  function CA(r) {
2710
2710
  const t = r.map((e) => {
2711
- if (yA(e))
2711
+ if (UA(e))
2712
2712
  return (i) => e.test(i);
2713
2713
  if (typeof e == "function")
2714
2714
  return (i) => {
2715
2715
  const A = e(i);
2716
- return typeof A != "boolean" ? (De("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : A;
2716
+ return typeof A != "boolean" ? (ve("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : A;
2717
2717
  };
2718
2718
  if (typeof e == "string") {
2719
2719
  const i = new RegExp("^" + RA(e) + "$");
2720
2720
  return (A) => i.test(A);
2721
2721
  }
2722
- return De("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
2722
+ return ve("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
2723
2723
  });
2724
2724
  return (e) => t.some((i) => i(e));
2725
2725
  }
@@ -2729,15 +2729,15 @@ CA([
2729
2729
  // Angular attributes
2730
2730
  "ng-*"
2731
2731
  ]);
2732
- class Ft {
2732
+ class It {
2733
2733
  }
2734
- function He(r) {
2734
+ function De(r) {
2735
2735
  return r.split("").reverse().join("");
2736
2736
  }
2737
2737
  function SA(r, t, e) {
2738
- const i = He(t);
2738
+ const i = De(t);
2739
2739
  return e.map((A) => {
2740
- const n = Math.max(0, A.end - t.length - A.errors), s = He(r.slice(n, A.end));
2740
+ const n = Math.max(0, A.end - t.length - A.errors), s = De(r.slice(n, A.end));
2741
2741
  return {
2742
2742
  start: Fi(s, i, A.errors).reduce((o, a) => A.end - a.end < o ? A.end - a.end : o, A.end),
2743
2743
  end: A.end,
@@ -2745,15 +2745,15 @@ function SA(r, t, e) {
2745
2745
  };
2746
2746
  });
2747
2747
  }
2748
- function Zt(r) {
2748
+ function Xt(r) {
2749
2749
  return (r | -r) >> 31 & 1;
2750
2750
  }
2751
- function Ge(r, t, e, i) {
2751
+ function He(r, t, e, i) {
2752
2752
  let A = r.P[e], n = r.M[e];
2753
2753
  const s = i >>> 31, o = t[e] | s, a = o | n, h = (o & A) + A ^ A | o;
2754
2754
  let c = n | ~(h | A), g = A & h;
2755
- const d = Zt(c & r.lastRowMask[e]) - Zt(g & r.lastRowMask[e]);
2756
- return c <<= 1, g <<= 1, g |= s, c |= Zt(i) - s, A = g | ~(a | c), n = c & a, r.P[e] = A, r.M[e] = n, d;
2755
+ const d = Xt(c & r.lastRowMask[e]) - Xt(g & r.lastRowMask[e]);
2756
+ return c <<= 1, g <<= 1, g |= s, c |= Xt(i) - s, A = g | ~(a | c), n = c & a, r.P[e] = A, r.M[e] = n, d;
2757
2757
  }
2758
2758
  function Fi(r, t, e) {
2759
2759
  if (t.length === 0)
@@ -2774,11 +2774,11 @@ function Fi(r, t, e) {
2774
2774
  continue;
2775
2775
  const l = new Uint32Array(n + 1);
2776
2776
  a.set(M, l), M < h.length && (h[M] = l);
2777
- for (let f = 0; f <= n; f += 1) {
2778
- l[f] = 0;
2777
+ for (let p = 0; p <= n; p += 1) {
2778
+ l[p] = 0;
2779
2779
  for (let w = 0; w < A; w += 1) {
2780
- const E = f * A + w;
2781
- E >= t.length || t.charCodeAt(E) === M && (l[f] |= 1 << w);
2780
+ const E = p * A + w;
2781
+ E >= t.length || t.charCodeAt(E) === M && (l[p] |= 1 << w);
2782
2782
  }
2783
2783
  }
2784
2784
  }
@@ -2793,10 +2793,10 @@ function Fi(r, t, e) {
2793
2793
  const M = r.charCodeAt(d);
2794
2794
  let l;
2795
2795
  M < h.length ? l = h[M] : (l = a.get(M), typeof l > "u" && (l = o));
2796
- let f = 0;
2796
+ let p = 0;
2797
2797
  for (let w = 0; w <= c; w += 1)
2798
- f = Ge(s, l, w, f), g[w] += f;
2799
- if (g[c] - f <= e && c < n && (l[c + 1] & 1 || f < 0)) {
2798
+ p = He(s, l, w, p), g[w] += p;
2799
+ if (g[c] - p <= e && c < n && (l[c + 1] & 1 || p < 0)) {
2800
2800
  c += 1, s.P[c] = -1, s.M[c] = 0;
2801
2801
  let w;
2802
2802
  if (c === n) {
@@ -2804,7 +2804,7 @@ function Fi(r, t, e) {
2804
2804
  w = E === 0 ? A : E;
2805
2805
  } else
2806
2806
  w = A;
2807
- g[c] = g[c - 1] + w - f + Ge(s, l, c, f);
2807
+ g[c] = g[c - 1] + w - p + He(s, l, c, p);
2808
2808
  } else
2809
2809
  for (; c > 0 && g[c] >= e + A; )
2810
2810
  c -= 1;
@@ -2820,7 +2820,7 @@ function QA(r, t, e) {
2820
2820
  const i = Fi(r, t, e);
2821
2821
  return SA(r, t, i);
2822
2822
  }
2823
- function Ui(r, t, e) {
2823
+ function yi(r, t, e) {
2824
2824
  let i = 0;
2825
2825
  const A = [];
2826
2826
  for (; i !== -1; )
@@ -2831,23 +2831,23 @@ function Ui(r, t, e) {
2831
2831
  }), i += 1);
2832
2832
  return A.length > 0 ? A : QA(r, t, e);
2833
2833
  }
2834
- function ke(r, t) {
2835
- return t.length === 0 || r.length === 0 ? 0 : 1 - Ui(r, t, t.length)[0].errors / t.length;
2834
+ function Ge(r, t) {
2835
+ return t.length === 0 || r.length === 0 ? 0 : 1 - yi(r, t, t.length)[0].errors / t.length;
2836
2836
  }
2837
2837
  function zA(r, t, e = {}) {
2838
2838
  if (t.length === 0)
2839
2839
  return null;
2840
- const i = Math.min(256, t.length / 2), A = Ui(r, t, i);
2840
+ const i = Math.min(256, t.length / 2), A = yi(r, t, i);
2841
2841
  if (A.length === 0)
2842
2842
  return null;
2843
2843
  const n = (o) => {
2844
- const a = 1 - o.errors / t.length, h = e.prefix ? ke(
2844
+ const a = 1 - o.errors / t.length, h = e.prefix ? Ge(
2845
2845
  r.slice(
2846
2846
  Math.max(0, o.start - e.prefix.length),
2847
2847
  o.start
2848
2848
  ),
2849
2849
  e.prefix
2850
- ) : 1, c = e.suffix ? ke(
2850
+ ) : 1, c = e.suffix ? Ge(
2851
2851
  r.slice(o.end, o.end + e.suffix.length),
2852
2852
  e.suffix
2853
2853
  ) : 1;
@@ -2860,7 +2860,7 @@ function zA(r, t, e = {}) {
2860
2860
  }));
2861
2861
  return s.sort((o, a) => a.score - o.score), s[0];
2862
2862
  }
2863
- function re(r, t, e) {
2863
+ function ne(r, t, e) {
2864
2864
  const i = e === 1 ? t : t - 1;
2865
2865
  if (r.charAt(i).trim() !== "")
2866
2866
  return t;
@@ -2870,7 +2870,7 @@ function re(r, t, e) {
2870
2870
  const s = A.length - n.length;
2871
2871
  return e === 2 ? t - s : t + s;
2872
2872
  }
2873
- function Je(r, t) {
2873
+ function ke(r, t) {
2874
2874
  const e = r.commonAncestorContainer.ownerDocument.createNodeIterator(
2875
2875
  r.commonAncestorContainer,
2876
2876
  NodeFilter.SHOW_TEXT
@@ -2883,7 +2883,7 @@ function Je(r, t) {
2883
2883
  const o = () => {
2884
2884
  if (n = t === 1 ? e.nextNode() : e.previousNode(), n) {
2885
2885
  const a = n.textContent, h = t === 1 ? 0 : a.length;
2886
- s = re(a, h, t);
2886
+ s = ne(a, h, t);
2887
2887
  }
2888
2888
  };
2889
2889
  for (; n && s === -1 && n !== A; )
@@ -2902,13 +2902,13 @@ function YA(r) {
2902
2902
  const t = r.cloneRange();
2903
2903
  let e = !1, i = !1;
2904
2904
  const A = {
2905
- start: re(
2905
+ start: ne(
2906
2906
  r.startContainer.textContent,
2907
2907
  r.startOffset,
2908
2908
  1
2909
2909
  /* Forwards */
2910
2910
  ),
2911
- end: re(
2911
+ end: ne(
2912
2912
  r.endContainer.textContent,
2913
2913
  r.endOffset,
2914
2914
  2
@@ -2918,7 +2918,7 @@ function YA(r) {
2918
2918
  if (A.start >= 0 && (t.setStart(r.startContainer, A.start), e = !0), A.end > 0 && (t.setEnd(r.endContainer, A.end), i = !0), e && i)
2919
2919
  return t;
2920
2920
  if (!e) {
2921
- const { node: n, offset: s } = Je(
2921
+ const { node: n, offset: s } = ke(
2922
2922
  t,
2923
2923
  1
2924
2924
  /* Forwards */
@@ -2926,7 +2926,7 @@ function YA(r) {
2926
2926
  n && s >= 0 && t.setStart(n, s);
2927
2927
  }
2928
2928
  if (!i) {
2929
- const { node: n, offset: s } = Je(
2929
+ const { node: n, offset: s } = ke(
2930
2930
  t,
2931
2931
  2
2932
2932
  /* Backwards */
@@ -2935,7 +2935,7 @@ function YA(r) {
2935
2935
  }
2936
2936
  return t;
2937
2937
  }
2938
- function yi(r) {
2938
+ function Ui(r) {
2939
2939
  switch (r.nodeType) {
2940
2940
  case Node.ELEMENT_NODE:
2941
2941
  case Node.TEXT_NODE:
@@ -2944,10 +2944,10 @@ function yi(r) {
2944
2944
  return 0;
2945
2945
  }
2946
2946
  }
2947
- function We(r) {
2947
+ function Je(r) {
2948
2948
  let t = r.previousSibling, e = 0;
2949
2949
  for (; t; )
2950
- e += yi(t), t = t.previousSibling;
2950
+ e += Ui(t), t = t.previousSibling;
2951
2951
  return e;
2952
2952
  }
2953
2953
  function Ri(r, ...t) {
@@ -2965,7 +2965,7 @@ function Ri(r, ...t) {
2965
2965
  throw new RangeError("Offset exceeds text length");
2966
2966
  return A;
2967
2967
  }
2968
- class k {
2968
+ class G {
2969
2969
  constructor(t, e) {
2970
2970
  if (e < 0)
2971
2971
  throw new Error("Offset is invalid");
@@ -2982,8 +2982,8 @@ class k {
2982
2982
  throw new Error("Parent is not an ancestor of current element");
2983
2983
  let e = this.element, i = this.offset;
2984
2984
  for (; e !== t; )
2985
- i += We(e), e = e.parentElement;
2986
- return new k(e, i);
2985
+ i += Je(e), e = e.parentElement;
2986
+ return new G(e, i);
2987
2987
  }
2988
2988
  /**
2989
2989
  * Resolve the position to a specific text node and offset within that node.
@@ -3027,9 +3027,9 @@ class k {
3027
3027
  static fromCharOffset(t, e) {
3028
3028
  switch (t.nodeType) {
3029
3029
  case Node.TEXT_NODE:
3030
- return k.fromPoint(t, e);
3030
+ return G.fromPoint(t, e);
3031
3031
  case Node.ELEMENT_NODE:
3032
- return new k(t, e);
3032
+ return new G(t, e);
3033
3033
  default:
3034
3034
  throw new Error("Node is not an element or text node");
3035
3035
  }
@@ -3047,23 +3047,23 @@ class k {
3047
3047
  throw new Error("Text node offset is out of range");
3048
3048
  if (!t.parentElement)
3049
3049
  throw new Error("Text node has no parent");
3050
- const i = We(t) + e;
3051
- return new k(t.parentElement, i);
3050
+ const i = Je(t) + e;
3051
+ return new G(t.parentElement, i);
3052
3052
  }
3053
3053
  case Node.ELEMENT_NODE: {
3054
3054
  if (e < 0 || e > t.childNodes.length)
3055
3055
  throw new Error("Child node offset is out of range");
3056
3056
  let i = 0;
3057
3057
  for (let A = 0; A < e; A++)
3058
- i += yi(t.childNodes[A]);
3059
- return new k(t, i);
3058
+ i += Ui(t.childNodes[A]);
3059
+ return new G(t, i);
3060
3060
  }
3061
3061
  default:
3062
3062
  throw new Error("Point is not in an element or text node");
3063
3063
  }
3064
3064
  }
3065
3065
  }
3066
- class q {
3066
+ class K {
3067
3067
  constructor(t, e) {
3068
3068
  this.start = t, this.end = e;
3069
3069
  }
@@ -3073,7 +3073,7 @@ class q {
3073
3073
  * `end.element`.
3074
3074
  */
3075
3075
  relativeTo(t) {
3076
- return new q(
3076
+ return new K(
3077
3077
  this.start.relativeTo(t),
3078
3078
  this.end.relativeTo(t)
3079
3079
  );
@@ -3107,20 +3107,20 @@ class q {
3107
3107
  * Create a TextRange from a (DOM) Range
3108
3108
  */
3109
3109
  static fromRange(t) {
3110
- const e = k.fromPoint(
3110
+ const e = G.fromPoint(
3111
3111
  t.startContainer,
3112
3112
  t.startOffset
3113
- ), i = k.fromPoint(t.endContainer, t.endOffset);
3114
- return new q(e, i);
3113
+ ), i = G.fromPoint(t.endContainer, t.endOffset);
3114
+ return new K(e, i);
3115
3115
  }
3116
3116
  /**
3117
3117
  * Create a TextRange representing the `start`th to `end`th characters in
3118
3118
  * `root`
3119
3119
  */
3120
3120
  static fromOffsets(t, e, i) {
3121
- return new q(
3122
- new k(t, e),
3123
- new k(t, i)
3121
+ return new K(
3122
+ new G(t, e),
3123
+ new G(t, i)
3124
3124
  );
3125
3125
  }
3126
3126
  /**
@@ -3128,23 +3128,23 @@ class q {
3128
3128
  * whitespace
3129
3129
  */
3130
3130
  static trimmedRange(t) {
3131
- return YA(q.fromRange(t).toRange());
3131
+ return YA(K.fromRange(t).toRange());
3132
3132
  }
3133
3133
  }
3134
- class Nt {
3134
+ class Yt {
3135
3135
  constructor(t, e, i) {
3136
3136
  this.root = t, this.start = e, this.end = i;
3137
3137
  }
3138
3138
  static fromRange(t, e) {
3139
- const i = q.fromRange(e).relativeTo(t);
3140
- return new Nt(
3139
+ const i = K.fromRange(e).relativeTo(t);
3140
+ return new Yt(
3141
3141
  t,
3142
3142
  i.start.offset,
3143
3143
  i.end.offset
3144
3144
  );
3145
3145
  }
3146
3146
  static fromSelector(t, e) {
3147
- return new Nt(t, e.start, e.end);
3147
+ return new Yt(t, e.start, e.end);
3148
3148
  }
3149
3149
  toSelector() {
3150
3150
  return {
@@ -3154,10 +3154,10 @@ class Nt {
3154
3154
  };
3155
3155
  }
3156
3156
  toRange() {
3157
- return q.fromOffsets(this.root, this.start, this.end).toRange();
3157
+ return K.fromOffsets(this.root, this.start, this.end).toRange();
3158
3158
  }
3159
3159
  }
3160
- class xt {
3160
+ class Nt {
3161
3161
  /**
3162
3162
  * @param root - A root element from which to anchor.
3163
3163
  */
@@ -3170,15 +3170,15 @@ class xt {
3170
3170
  * Will throw if `range` does not contain any text nodes.
3171
3171
  */
3172
3172
  static fromRange(t, e) {
3173
- const i = t.textContent, A = q.fromRange(e).relativeTo(t), n = A.start.offset, s = A.end.offset, o = 32;
3174
- return new xt(t, i.slice(n, s), {
3173
+ const i = t.textContent, A = K.fromRange(e).relativeTo(t), n = A.start.offset, s = A.end.offset, o = 32;
3174
+ return new Nt(t, i.slice(n, s), {
3175
3175
  prefix: i.slice(Math.max(0, n - o), n),
3176
3176
  suffix: i.slice(s, Math.min(i.length, s + o))
3177
3177
  });
3178
3178
  }
3179
3179
  static fromSelector(t, e) {
3180
3180
  const { prefix: i, suffix: A } = e;
3181
- return new xt(t, e.exact, { prefix: i, suffix: A });
3181
+ return new Nt(t, e.exact, { prefix: i, suffix: A });
3182
3182
  }
3183
3183
  toSelector() {
3184
3184
  return {
@@ -3198,20 +3198,20 @@ class xt {
3198
3198
  });
3199
3199
  if (!i)
3200
3200
  throw new Error("Quote not found");
3201
- return new Nt(this.root, i.start, i.end);
3201
+ return new Yt(this.root, i.start, i.end);
3202
3202
  }
3203
3203
  }
3204
3204
  function NA(r) {
3205
3205
  const t = r.tagName.toUpperCase();
3206
3206
  return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
3207
3207
  }
3208
- function Wt(r, t) {
3208
+ function Jt(r, t) {
3209
3209
  try {
3210
3210
  const e = t.locations, i = t.text;
3211
3211
  if (i && i.highlight) {
3212
3212
  let A;
3213
3213
  e && e.getCssSelector() && (A = r.querySelector(e.getCssSelector())), A || (A = r.body);
3214
- const n = new xt(A, i.highlight, {
3214
+ const n = new Nt(A, i.highlight, {
3215
3215
  prefix: i.before,
3216
3216
  suffix: i.after
3217
3217
  });
@@ -3271,7 +3271,7 @@ function Ci(r, t, e) {
3271
3271
  const n = r[i], s = r[A];
3272
3272
  if (n === s)
3273
3273
  continue;
3274
- const o = D(n.top, s.top, t) && D(n.bottom, s.bottom, t), a = D(n.left, s.left, t) && D(n.right, s.right, t);
3274
+ const o = v(n.top, s.top, t) && v(n.bottom, s.bottom, t), a = v(n.left, s.left, t) && v(n.right, s.right, t);
3275
3275
  if (o && !a && Qi(n, s, t)) {
3276
3276
  const h = r.filter((g) => g !== n && g !== s), c = TA(n, s);
3277
3277
  return h.push(c), Ci(
@@ -3309,10 +3309,10 @@ function jA(r, t) {
3309
3309
  return Array.from(e);
3310
3310
  }
3311
3311
  function bA(r, t, e) {
3312
- return Ut(r, t.left, t.top, e) && Ut(r, t.right, t.top, e) && Ut(r, t.left, t.bottom, e) && Ut(r, t.right, t.bottom, e);
3312
+ return Ft(r, t.left, t.top, e) && Ft(r, t.right, t.top, e) && Ft(r, t.left, t.bottom, e) && Ft(r, t.right, t.bottom, e);
3313
3313
  }
3314
- function Ut(r, t, e, i) {
3315
- return (r.left < t || D(r.left, t, i)) && (r.right > t || D(r.right, t, i)) && (r.top < e || D(r.top, e, i)) && (r.bottom > e || D(r.bottom, e, i));
3314
+ function Ft(r, t, e, i) {
3315
+ return (r.left < t || v(r.left, t, i)) && (r.right > t || v(r.right, t, i)) && (r.top < e || v(r.top, e, i)) && (r.bottom > e || v(r.bottom, e, i));
3316
3316
  }
3317
3317
  function Si(r) {
3318
3318
  for (let t = 0; t < r.length; t++)
@@ -3320,11 +3320,11 @@ function Si(r) {
3320
3320
  const i = r[t], A = r[e];
3321
3321
  if (i !== A && Qi(i, A, -1)) {
3322
3322
  let n = [], s;
3323
- const o = Le(i, A);
3323
+ const o = We(i, A);
3324
3324
  if (o.length === 1)
3325
3325
  n = o, s = i;
3326
3326
  else {
3327
- const h = Le(A, i);
3327
+ const h = We(A, i);
3328
3328
  o.length < h.length ? (n = o, s = i) : (n = h, s = A);
3329
3329
  }
3330
3330
  const a = r.filter((h) => h !== s);
@@ -3333,7 +3333,7 @@ function Si(r) {
3333
3333
  }
3334
3334
  return r;
3335
3335
  }
3336
- function Le(r, t) {
3336
+ function We(r, t) {
3337
3337
  const e = VA(t, r);
3338
3338
  if (e.height === 0 || e.width === 0)
3339
3339
  return [r];
@@ -3396,9 +3396,9 @@ function VA(r, t) {
3396
3396
  };
3397
3397
  }
3398
3398
  function Qi(r, t, e) {
3399
- return (r.left < t.right || e >= 0 && D(r.left, t.right, e)) && (t.left < r.right || e >= 0 && D(t.left, r.right, e)) && (r.top < t.bottom || e >= 0 && D(r.top, t.bottom, e)) && (t.top < r.bottom || e >= 0 && D(t.top, r.bottom, e));
3399
+ return (r.left < t.right || e >= 0 && v(r.left, t.right, e)) && (t.left < r.right || e >= 0 && v(t.left, r.right, e)) && (r.top < t.bottom || e >= 0 && v(r.top, t.bottom, e)) && (t.top < r.bottom || e >= 0 && v(t.top, r.bottom, e));
3400
3400
  }
3401
- function D(r, t, e) {
3401
+ function v(r, t, e) {
3402
3402
  return Math.abs(r - t) <= e;
3403
3403
  }
3404
3404
  function ye(r) {
@@ -3410,18 +3410,18 @@ function ye(r) {
3410
3410
  function zi(r, t) {
3411
3411
  const e = ye(r);
3412
3412
  Object.keys(e).forEach((i) => {
3413
- t.hasOwnProperty(i) || Lt(r, i);
3413
+ t.hasOwnProperty(i) || Wt(r, i);
3414
3414
  }), Object.entries(t).forEach(([i, A]) => {
3415
- e[i] !== A && Bt(r, i, A);
3415
+ e[i] !== A && Mt(r, i, A);
3416
3416
  });
3417
3417
  }
3418
- function Oe(r, t) {
3418
+ function Le(r, t) {
3419
3419
  return r.document.documentElement.style.getPropertyValue(t);
3420
3420
  }
3421
- function Bt(r, t, e) {
3421
+ function Mt(r, t, e) {
3422
3422
  r.document.documentElement.style.setProperty(t, e);
3423
3423
  }
3424
- function Lt(r, t) {
3424
+ function Wt(r, t) {
3425
3425
  r.document.documentElement.style.removeProperty(t);
3426
3426
  }
3427
3427
  const PA = (r) => {
@@ -3455,7 +3455,7 @@ const PA = (r) => {
3455
3455
  }, vA = (r) => 0.2126 * r.r * r.a + 0.7152 * r.g * r.a + 0.0722 * r.b * r.a, DA = (r) => {
3456
3456
  const t = PA(r);
3457
3457
  return vA(t) < 128;
3458
- }, HA = () => "Highlight" in window, Xe = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
3458
+ }, HA = () => "Highlight" in window, Oe = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
3459
3459
  class GA {
3460
3460
  /**
3461
3461
  * Creates a DecorationGroup object
@@ -3476,13 +3476,13 @@ class GA {
3476
3476
  * @param decoration Decoration to add
3477
3477
  */
3478
3478
  add(t) {
3479
- const e = `${this.id}-${this.lastItemId++}`, i = Wt(this.wnd.document, t.locator);
3479
+ const e = `${this.id}-${this.lastItemId++}`, i = Jt(this.wnd.document, t.locator);
3480
3480
  if (!i) {
3481
3481
  this.comms.log("Can't locate DOM range for decoration", t);
3482
3482
  return;
3483
3483
  }
3484
3484
  const A = i.commonAncestorContainer;
3485
- A.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Xe.includes(A.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), A.querySelector(Xe.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (A.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0));
3485
+ A.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Oe.includes(A.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), A.querySelector(Oe.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (A.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0));
3486
3486
  const n = {
3487
3487
  decoration: t,
3488
3488
  id: e,
@@ -3541,22 +3541,22 @@ class GA {
3541
3541
  getComputedStyle(this.wnd.document.documentElement).getPropertyValue(
3542
3542
  "column-count"
3543
3543
  )
3544
- ), n = i / (A || 1), s = this.wnd.document.scrollingElement, o = s.scrollLeft, a = s.scrollTop, h = (l, f, w) => {
3544
+ ), n = i / (A || 1), s = this.wnd.document.scrollingElement, o = s.scrollLeft, a = s.scrollTop, h = (l, p, w) => {
3545
3545
  if (l.style.position = "absolute", t.decoration?.style?.width === "viewport") {
3546
- l.style.width = `${i}px`, l.style.height = `${f.height}px`;
3547
- let E = Math.floor(f.left / i) * i;
3548
- l.style.left = `${E + o}px`, l.style.top = `${f.top + a}px`;
3546
+ l.style.width = `${i}px`, l.style.height = `${p.height}px`;
3547
+ let E = Math.floor(p.left / i) * i;
3548
+ l.style.left = `${E + o}px`, l.style.top = `${p.top + a}px`;
3549
3549
  } else if (t.decoration?.style?.width === "bounds")
3550
- l.style.width = `${w.width}px`, l.style.height = `${f.height}px`, l.style.left = `${w.left + o}px`, l.style.top = `${f.top + a}px`;
3550
+ l.style.width = `${w.width}px`, l.style.height = `${p.height}px`, l.style.left = `${w.left + o}px`, l.style.top = `${p.top + a}px`;
3551
3551
  else if (t.decoration?.style?.width === "page") {
3552
- l.style.width = `${n}px`, l.style.height = `${f.height}px`;
3553
- let E = Math.floor(f.left / n) * n;
3554
- l.style.left = `${E + o}px`, l.style.top = `${f.top + a}px`;
3552
+ l.style.width = `${n}px`, l.style.height = `${p.height}px`;
3553
+ let E = Math.floor(p.left / n) * n;
3554
+ l.style.left = `${E + o}px`, l.style.top = `${p.top + a}px`;
3555
3555
  } else
3556
- l.style.width = `${f.width}px`, l.style.height = `${f.height}px`, l.style.left = `${f.left + o}px`, l.style.top = `${f.top + a}px`;
3556
+ l.style.width = `${p.width}px`, l.style.height = `${p.height}px`, l.style.left = `${p.left + o}px`, l.style.top = `${p.top + a}px`;
3557
3557
  }, c = t.range.getBoundingClientRect();
3558
3558
  let g = this.wnd.document.createElement("template");
3559
- const d = Oe(this.wnd, "--USER__appearance") === "readium-night-on" || DA(Oe(this.wnd, "--USER__backgroundColor"));
3559
+ const d = Le(this.wnd, "--USER__appearance") === "readium-night-on" || DA(Le(this.wnd, "--USER__backgroundColor"));
3560
3560
  g.innerHTML = `
3561
3561
  <div
3562
3562
  class="r2-highlight-0"
@@ -3578,10 +3578,10 @@ class GA {
3578
3578
  let l = xA(
3579
3579
  t.range
3580
3580
  );
3581
- l = l.sort((f, w) => f.top < w.top ? -1 : f.top > w.top ? 1 : 0);
3582
- for (let f of l) {
3581
+ l = l.sort((p, w) => p.top < w.top ? -1 : p.top > w.top ? 1 : 0);
3582
+ for (let p of l) {
3583
3583
  const w = M.cloneNode(!0);
3584
- w.style.setProperty("pointer-events", "none"), h(w, f, c), e.append(w);
3584
+ w.style.setProperty("pointer-events", "none"), h(w, p, c), e.append(w);
3585
3585
  }
3586
3586
  }
3587
3587
  t.container = e, t.clickableElements = Array.from(
@@ -3613,7 +3613,7 @@ class GA {
3613
3613
  this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
3614
3614
  }
3615
3615
  }
3616
- const Yi = class se extends Ft {
3616
+ const Yi = class re extends It {
3617
3617
  constructor() {
3618
3618
  super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
3619
3619
  }
@@ -3628,9 +3628,9 @@ const Yi = class se extends Ft {
3628
3628
  }, 50);
3629
3629
  }
3630
3630
  mount(t, e) {
3631
- return this.wnd = t, e.register("decorate", se.moduleName, (i, A) => {
3631
+ return this.wnd = t, e.register("decorate", re.moduleName, (i, A) => {
3632
3632
  const n = i;
3633
- n.decoration && n.decoration.locator && (n.decoration.locator = X.deserialize(n.decoration.locator)), this.groups.has(n.group) || this.groups.set(n.group, new GA(
3633
+ n.decoration && n.decoration.locator && (n.decoration.locator = O.deserialize(n.decoration.locator)), this.groups.has(n.group) || this.groups.set(n.group, new GA(
3634
3634
  t,
3635
3635
  e,
3636
3636
  `readium-decoration-${this.lastGroupId++}`,
@@ -3655,12 +3655,12 @@ const Yi = class se extends Ft {
3655
3655
  }), 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;
3656
3656
  }
3657
3657
  unmount(t, e) {
3658
- return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(se.moduleName), this.resizeObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
3658
+ return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(re.moduleName), this.resizeObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
3659
3659
  }
3660
3660
  };
3661
3661
  Yi.moduleName = "decorator";
3662
3662
  let kA = Yi;
3663
- const Ze = "readium-snapper-style", Ni = class oe extends Ft {
3663
+ const Xe = "readium-snapper-style", Ni = class se extends It {
3664
3664
  constructor() {
3665
3665
  super(...arguments), this.protected = !1;
3666
3666
  }
@@ -3673,19 +3673,19 @@ const Ze = "readium-snapper-style", Ni = class oe extends Ft {
3673
3673
  }
3674
3674
  mount(t, e) {
3675
3675
  const i = t.document.createElement("style");
3676
- return i.dataset.readium = "true", i.id = Ze, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", oe.moduleName, (A, n) => {
3676
+ return i.dataset.readium = "true", i.id = Xe, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", se.moduleName, (A, n) => {
3677
3677
  this.protected = !0, i.textContent = this.buildStyles(), n(!0);
3678
- }), e.register("unprotect", oe.moduleName, (A, n) => {
3678
+ }), e.register("unprotect", se.moduleName, (A, n) => {
3679
3679
  this.protected = !1, i.textContent = this.buildStyles(), n(!0);
3680
3680
  }), e.log("Snapper Mounted"), !0;
3681
3681
  }
3682
3682
  unmount(t, e) {
3683
- return t.document.getElementById(Ze)?.remove(), e.log("Snapper Unmounted"), !0;
3683
+ return t.document.getElementById(Xe)?.remove(), e.log("Snapper Unmounted"), !0;
3684
3684
  }
3685
3685
  };
3686
3686
  Ni.moduleName = "snapper";
3687
- let Re = Ni;
3688
- function et(r) {
3687
+ let Ue = Ni;
3688
+ function tt(r) {
3689
3689
  return r.document.body.dir.toLowerCase() === "rtl";
3690
3690
  }
3691
3691
  function xi(r) {
@@ -3699,7 +3699,7 @@ function JA(r) {
3699
3699
  const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
3700
3700
  return r.clientHeight - e - i;
3701
3701
  }
3702
- function Ke(r) {
3702
+ function Ze(r) {
3703
3703
  const t = xi(r);
3704
3704
  if (!t)
3705
3705
  return !1;
@@ -3742,11 +3742,11 @@ const LA = [
3742
3742
  function ji(r) {
3743
3743
  return LA.indexOf(r.nodeName.toLowerCase()) !== -1 || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" ? r : r.parentElement ? ji(r.parentElement) : null;
3744
3744
  }
3745
- function Ce(r, t) {
3745
+ function Re(r, t) {
3746
3746
  const e = bi(r, r.document.body, t), i = r._readium_cssSelectorGenerator.getCssSelector(e, {
3747
3747
  selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
3748
3748
  });
3749
- return new X({
3749
+ return new O({
3750
3750
  href: "#",
3751
3751
  type: "application/xhtml+xml",
3752
3752
  locations: new C({
@@ -3754,7 +3754,7 @@ function Ce(r, t) {
3754
3754
  ["cssSelector", i]
3755
3755
  ])
3756
3756
  }),
3757
- text: new nt({
3757
+ text: new At({
3758
3758
  highlight: e.textContent || void 0
3759
3759
  })
3760
3760
  });
@@ -3788,7 +3788,7 @@ function ZA(r) {
3788
3788
  }
3789
3789
  return !1;
3790
3790
  }
3791
- const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3791
+ const Ke = "readium-column-snapper-style", KA = 200, Vi = class j extends Ue {
3792
3792
  constructor() {
3793
3793
  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);
3794
3794
  }
@@ -3799,7 +3799,7 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3799
3799
  return this.doc().scrollLeft > 0 ? this.doc().scrollLeft : this.alreadyScrollLeft;
3800
3800
  }
3801
3801
  snapOffset(t) {
3802
- const e = t + (et(this.wnd) ? -1 : 1);
3802
+ const e = t + (tt(this.wnd) ? -1 : 1);
3803
3803
  return e - e % this.wnd.innerWidth;
3804
3804
  }
3805
3805
  reportProgress() {
@@ -3812,7 +3812,7 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3812
3812
  shake() {
3813
3813
  if (this.overscroll !== 0 || this.shakeTimeout !== 0) return;
3814
3814
  const t = this.doc();
3815
- t.classList.add(et(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
3815
+ t.classList.add(tt(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
3816
3816
  const e = this.scrollOffset();
3817
3817
  this.shakeTimeout = this.wnd.setTimeout(() => {
3818
3818
  t.classList.remove("readium-bounce-l"), t.classList.remove("readium-bounce-r"), this.shakeTimeout = 0, this.doc().scrollLeft = e;
@@ -3826,22 +3826,22 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3826
3826
  }
3827
3827
  // Snaps the current offset to the page width.
3828
3828
  snapCurrentOffset(t = !1, e = !1) {
3829
- const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, A = this.doc(), n = this.dragOffset(), s = xi(this.wnd), o = Math.min(Math.max(0, i), this.cachedScrollWidth), a = et(this.wnd) ? -1 : 1, h = (
3829
+ const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, A = this.doc(), n = this.dragOffset(), s = xi(this.wnd), o = Math.min(Math.max(0, i), this.cachedScrollWidth), a = tt(this.wnd) ? -1 : 1, h = (
3830
3830
  // The hurdle to overcome in order to change pages
3831
3831
  a * (this.wnd.innerWidth / 3) * (a * n > 0 ? 2 : 1)
3832
3832
  ), c = this.snapOffset(o + h);
3833
3833
  if (t && c !== this.scrollOffset()) {
3834
3834
  this.snappingCancelled = !1;
3835
- const g = (f, w, E, y) => E > y ? w : f + (w - f) * WA(E / y), d = (
3835
+ const g = (p, w, E, U) => E > U ? w : p + (w - p) * WA(E / U), d = (
3836
3836
  /*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
3837
3837
  KA * s
3838
3838
  );
3839
3839
  let M;
3840
- const l = (f) => {
3840
+ const l = (p) => {
3841
3841
  if (this.snappingCancelled) return;
3842
- M || (M = f);
3843
- const w = f - M, E = g(this.overscroll, 0, w, d), y = g(i, c, w, d);
3844
- A.scrollLeft = y, this.overscroll !== 0 && (A.style.transform = `translate3d(${-E}px, 0px, 0px)`), w < d ? this.wnd.requestAnimationFrame(l) : (this.clearTouches(), A.style.removeProperty("transform"), A.scrollLeft = c, e || this.reportProgress());
3842
+ M || (M = p);
3843
+ const w = p - M, E = g(this.overscroll, 0, w, d), U = g(i, c, w, d);
3844
+ A.scrollLeft = U, this.overscroll !== 0 && (A.style.transform = `translate3d(${-E}px, 0px, 0px)`), w < d ? this.wnd.requestAnimationFrame(l) : (this.clearTouches(), A.style.removeProperty("transform"), A.scrollLeft = c, e || this.reportProgress());
3845
3845
  };
3846
3846
  this.wnd.requestAnimationFrame(l);
3847
3847
  } else
@@ -3889,7 +3889,7 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3889
3889
  if (this.wnd = t, this.comms = e, !super.mount(t, e)) return !1;
3890
3890
  t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
3891
3891
  const i = t.document.createElement("style");
3892
- i.dataset.readium = "true", i.id = qe, i.textContent = `
3892
+ i.dataset.readium = "true", i.id = Ke, i.textContent = `
3893
3893
  @keyframes readium-bounce-l-animation {
3894
3894
  0%, 100% {transform: translate3d(0, 0, 0);}
3895
3895
  50% {transform: translate3d(-50px, 0, 0);}
@@ -3925,14 +3925,14 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3925
3925
  }
3926
3926
  `, t.document.head.appendChild(i), this.resizeObserver = new ResizeObserver(() => {
3927
3927
  t.requestAnimationFrame(() => {
3928
- t && Ke(t);
3928
+ t && Ze(t);
3929
3929
  }), this.onWidthChange();
3930
3930
  }), this.resizeObserver.observe(t.document.body), this.mutationObserver = new MutationObserver((n) => {
3931
3931
  for (const s of n)
3932
3932
  if (s.target === this.wnd.document.documentElement) {
3933
3933
  const o = s.oldValue, a = s.target.getAttribute("style"), h = /transform\s*:\s*([^;]+)/, c = o?.match(h), g = a?.match(h);
3934
3934
  (!c && !g || c && !g || c && g && c[1] !== g[1]) && (t.requestAnimationFrame(() => {
3935
- t && Ke(t);
3935
+ t && Ze(t);
3936
3936
  }), this.onWidthChange());
3937
3937
  } else
3938
3938
  t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
@@ -3951,7 +3951,7 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3951
3951
  }
3952
3952
  this.wnd.requestAnimationFrame(() => {
3953
3953
  this.cachedScrollWidth = this.doc().scrollWidth;
3954
- const a = this.cachedScrollWidth, h = et(t) ? -1 : 1, c = a * o * h;
3954
+ const a = this.cachedScrollWidth, h = tt(t) ? -1 : 1, c = a * o * h;
3955
3955
  this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(), R(this.wnd), s(!0);
3956
3956
  });
3957
3957
  }), e.register("go_id", j.moduleName, (n, s) => {
@@ -3966,7 +3966,7 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3966
3966
  }), e.register("go_text", j.moduleName, (n, s) => {
3967
3967
  let o;
3968
3968
  Array.isArray(n) && (n.length > 1 && (o = n[1]), n = n[0]);
3969
- const a = nt.deserialize(n), h = Wt(this.wnd.document, new X({
3969
+ const a = At.deserialize(n), h = Jt(this.wnd.document, new O({
3970
3970
  href: t.location.href,
3971
3971
  type: "text/html",
3972
3972
  text: a,
@@ -3984,7 +3984,7 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3984
3984
  this.doc().scrollLeft = this.snapOffset(h.getBoundingClientRect().left + t.scrollX), this.reportProgress(), R(this.wnd), s(!0);
3985
3985
  });
3986
3986
  }), e.register("go_end", j.moduleName, (n, s) => {
3987
- const o = et(t) ? -1 : 1;
3987
+ const o = tt(t) ? -1 : 1;
3988
3988
  this.wnd.requestAnimationFrame(() => {
3989
3989
  this.cachedScrollWidth = this.doc().scrollWidth;
3990
3990
  const a = this.cachedScrollWidth * o;
@@ -3999,13 +3999,13 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
3999
3999
  }), e.register("go_prev", j.moduleName, (n, s) => {
4000
4000
  this.wnd.requestAnimationFrame(() => {
4001
4001
  this.cachedScrollWidth = this.doc().scrollWidth;
4002
- const o = t.scrollX - t.innerWidth, a = et(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, h = A(Math.max(o, a));
4002
+ const o = t.scrollX - t.innerWidth, a = tt(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, h = A(Math.max(o, a));
4003
4003
  h && (this.reportProgress(), R(this.wnd)), s(h);
4004
4004
  });
4005
4005
  }), e.register("go_next", j.moduleName, (n, s) => {
4006
4006
  this.wnd.requestAnimationFrame(() => {
4007
4007
  this.cachedScrollWidth = this.doc().scrollWidth;
4008
- const o = t.scrollX + t.innerWidth, a = et(t) ? 0 : this.cachedScrollWidth - t.innerWidth, h = A(Math.min(o, a));
4008
+ const o = t.scrollX + t.innerWidth, a = tt(t) ? 0 : this.cachedScrollWidth - t.innerWidth, h = A(Math.min(o, a));
4009
4009
  h && (this.reportProgress(), R(this.wnd)), s(h);
4010
4010
  });
4011
4011
  }), e.register("unfocus", j.moduleName, (n, s) => {
@@ -4017,18 +4017,18 @@ const qe = "readium-column-snapper-style", KA = 200, Vi = class j extends Re {
4017
4017
  this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), s(!0);
4018
4018
  });
4019
4019
  }), e.register("first_visible_locator", j.moduleName, (n, s) => {
4020
- const o = Ce(t, !1);
4020
+ const o = Re(t, !1);
4021
4021
  this.comms.send("first_visible_locator", o.serialize()), s(!0);
4022
4022
  }), 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", () => {
4023
4023
  }), e.log("ColumnSnapper Mounted"), !0;
4024
4024
  }
4025
4025
  unmount(t, e) {
4026
- 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), t.document.getElementById(qe)?.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
4026
+ 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), t.document.getElementById(Ke)?.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
4027
4027
  }
4028
4028
  };
4029
4029
  Vi.moduleName = "column_snapper";
4030
4030
  let qA = Vi;
4031
- const _e = "readium-scroll-snapper-style", Pi = class P extends Re {
4031
+ const qe = "readium-scroll-snapper-style", Pi = class V extends Ue {
4032
4032
  constructor() {
4033
4033
  super(...arguments), this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = () => {
4034
4034
  if (this.comms.ready && !this.isResizing) {
@@ -4058,7 +4058,7 @@ const _e = "readium-scroll-snapper-style", Pi = class P extends Re {
4058
4058
  mount(t, e) {
4059
4059
  this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
4060
4060
  const i = t.document.createElement("style");
4061
- return i.dataset.readium = "true", i.id = _e, i.textContent = `
4061
+ return i.dataset.readium = "true", i.id = qe, i.textContent = `
4062
4062
  * {
4063
4063
  scrollbar-width: none; /* for Firefox */
4064
4064
  }
@@ -4070,11 +4070,11 @@ const _e = "readium-scroll-snapper-style", Pi = class P extends Re {
4070
4070
  this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
4071
4071
  this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
4072
4072
  }, 50);
4073
- }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", P.moduleName, () => {
4073
+ }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", V.moduleName, () => {
4074
4074
  Ti(this.wnd);
4075
4075
  const A = this.doc().scrollTop;
4076
4076
  A > 1 ? this.doc().scrollTop = A - 1 : this.doc().scrollTop = A + 1, this.doc().scrollTop = A;
4077
- }), e.register("go_progression", P.moduleName, (A, n) => {
4077
+ }), e.register("go_progression", V.moduleName, (A, n) => {
4078
4078
  const s = A;
4079
4079
  if (s < 0 || s > 1) {
4080
4080
  e.send("error", {
@@ -4085,7 +4085,7 @@ const _e = "readium-scroll-snapper-style", Pi = class P extends Re {
4085
4085
  this.wnd.requestAnimationFrame(() => {
4086
4086
  this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), R(this.wnd), n(!0);
4087
4087
  });
4088
- }), e.register("go_id", P.moduleName, (A, n) => {
4088
+ }), e.register("go_id", V.moduleName, (A, n) => {
4089
4089
  const s = t.document.getElementById(A);
4090
4090
  if (!s) {
4091
4091
  n(!1);
@@ -4094,10 +4094,10 @@ const _e = "readium-scroll-snapper-style", Pi = class P extends Re {
4094
4094
  this.wnd.requestAnimationFrame(() => {
4095
4095
  this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), R(this.wnd), n(!0);
4096
4096
  });
4097
- }), e.register("go_text", P.moduleName, (A, n) => {
4097
+ }), e.register("go_text", V.moduleName, (A, n) => {
4098
4098
  let s;
4099
4099
  Array.isArray(A) && (A.length > 1 && (s = A[1]), A = A[0]);
4100
- const o = nt.deserialize(A), a = Wt(this.wnd.document, new X({
4100
+ const o = At.deserialize(A), a = Jt(this.wnd.document, new O({
4101
4101
  href: t.location.href,
4102
4102
  type: "text/html",
4103
4103
  text: o,
@@ -4114,31 +4114,31 @@ const _e = "readium-scroll-snapper-style", Pi = class P extends Re {
4114
4114
  this.wnd.requestAnimationFrame(() => {
4115
4115
  this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), R(this.wnd), n(!0);
4116
4116
  });
4117
- }), e.register("go_start", P.moduleName, (A, n) => {
4117
+ }), e.register("go_start", V.moduleName, (A, n) => {
4118
4118
  if (this.doc().scrollTop === 0) return n(!1);
4119
4119
  this.doc().scrollTop = 0, this.reportProgress(), n(!0);
4120
- }), e.register("go_end", P.moduleName, (A, n) => {
4120
+ }), e.register("go_end", V.moduleName, (A, n) => {
4121
4121
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return n(!1);
4122
4122
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), n(!0);
4123
- }), e.register("unfocus", P.moduleName, (A, n) => {
4123
+ }), e.register("unfocus", V.moduleName, (A, n) => {
4124
4124
  R(this.wnd), n(!0);
4125
4125
  }), e.register([
4126
4126
  "go_next",
4127
4127
  "go_prev"
4128
- ], P.moduleName, (A, n) => n(!1)), e.register("focus", P.moduleName, (A, n) => {
4128
+ ], V.moduleName, (A, n) => n(!1)), e.register("focus", V.moduleName, (A, n) => {
4129
4129
  this.reportProgress(), n(!0);
4130
- }), e.register("first_visible_locator", P.moduleName, (A, n) => {
4131
- const s = Ce(t, !0);
4130
+ }), e.register("first_visible_locator", V.moduleName, (A, n) => {
4131
+ const s = Re(t, !0);
4132
4132
  this.comms.send("first_visible_locator", s.serialize()), n(!0);
4133
4133
  }), e.log("ScrollSnapper Mounted"), !0;
4134
4134
  }
4135
4135
  unmount(t, e) {
4136
- return e.unregisterAll(P.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(_e)?.remove(), e.log("ScrollSnapper Unmounted"), !0;
4136
+ return e.unregisterAll(V.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(qe)?.remove(), e.log("ScrollSnapper Unmounted"), !0;
4137
4137
  }
4138
4138
  };
4139
4139
  Pi.moduleName = "scroll_snapper";
4140
4140
  let _A = Pi;
4141
- const vi = class v extends Re {
4141
+ const vi = class P extends Ue {
4142
4142
  constructor() {
4143
4143
  super(...arguments), this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = () => {
4144
4144
  if (this.comms.ready && !this.isResizing) {
@@ -4170,11 +4170,11 @@ const vi = class v extends Re {
4170
4170
  this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
4171
4171
  this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
4172
4172
  }, 50);
4173
- }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", v.moduleName, () => {
4173
+ }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", P.moduleName, () => {
4174
4174
  Ti(this.wnd);
4175
4175
  const i = this.doc().scrollTop;
4176
4176
  i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
4177
- }), e.register("go_progression", v.moduleName, (i, A) => {
4177
+ }), e.register("go_progression", P.moduleName, (i, A) => {
4178
4178
  const n = i;
4179
4179
  if (n < 0 || n > 1) {
4180
4180
  e.send("error", {
@@ -4185,7 +4185,7 @@ const vi = class v extends Re {
4185
4185
  this.wnd.requestAnimationFrame(() => {
4186
4186
  this.doc().scrollTop = this.doc().offsetHeight * n, this.reportProgress(), R(this.wnd), A(!0);
4187
4187
  });
4188
- }), this.comms.register("go_id", v.moduleName, (i, A) => {
4188
+ }), this.comms.register("go_id", P.moduleName, (i, A) => {
4189
4189
  const n = t.document.getElementById(i);
4190
4190
  if (!n) {
4191
4191
  A(!1);
@@ -4194,10 +4194,10 @@ const vi = class v extends Re {
4194
4194
  this.wnd.requestAnimationFrame(() => {
4195
4195
  this.doc().scrollTop = n.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), R(this.wnd), A(!0);
4196
4196
  });
4197
- }), e.register("go_text", v.moduleName, (i, A) => {
4197
+ }), e.register("go_text", P.moduleName, (i, A) => {
4198
4198
  let n;
4199
4199
  Array.isArray(i) && (i.length > 1 && (n = i[1]), i = i[0]);
4200
- const s = nt.deserialize(i), o = Wt(this.wnd.document, new X({
4200
+ const s = At.deserialize(i), o = Jt(this.wnd.document, new O({
4201
4201
  href: t.location.href,
4202
4202
  type: "text/html",
4203
4203
  text: s,
@@ -4214,31 +4214,31 @@ const vi = class v extends Re {
4214
4214
  this.wnd.requestAnimationFrame(() => {
4215
4215
  this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), R(this.wnd), A(!0);
4216
4216
  });
4217
- }), e.register("go_start", v.moduleName, (i, A) => {
4217
+ }), e.register("go_start", P.moduleName, (i, A) => {
4218
4218
  if (this.doc().scrollTop === 0) return A(!1);
4219
4219
  this.doc().scrollTop = 0, this.reportProgress(), A(!0);
4220
- }), e.register("go_end", v.moduleName, (i, A) => {
4220
+ }), e.register("go_end", P.moduleName, (i, A) => {
4221
4221
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return A(!1);
4222
4222
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), A(!0);
4223
- }), e.register("unfocus", v.moduleName, (i, A) => {
4223
+ }), e.register("unfocus", P.moduleName, (i, A) => {
4224
4224
  R(this.wnd), A(!0);
4225
4225
  }), e.register([
4226
4226
  "go_next",
4227
4227
  "go_prev"
4228
- ], v.moduleName, (i, A) => A(!1)), e.register("focus", v.moduleName, (i, A) => {
4228
+ ], P.moduleName, (i, A) => A(!1)), e.register("focus", P.moduleName, (i, A) => {
4229
4229
  this.reportProgress(), A(!0);
4230
- }), e.register("first_visible_locator", v.moduleName, (i, A) => {
4231
- const n = Ce(t, !0);
4230
+ }), e.register("first_visible_locator", P.moduleName, (i, A) => {
4231
+ const n = Re(t, !0);
4232
4232
  e.send("first_visible_locator", n.serialize()), A(!0);
4233
4233
  }), e.log("WebPubSnapper Mounted"), !0;
4234
4234
  }
4235
4235
  unmount(t, e) {
4236
- return e.unregisterAll(v.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), e.log("WebPubSnapper Unmounted"), !0;
4236
+ return e.unregisterAll(P.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), e.log("WebPubSnapper Unmounted"), !0;
4237
4237
  }
4238
4238
  };
4239
4239
  vi.moduleName = "webpub_snapper";
4240
4240
  let $A = vi;
4241
- const Di = class extends Ft {
4241
+ const Di = class extends It {
4242
4242
  constructor() {
4243
4243
  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);
4244
4244
  }
@@ -4308,7 +4308,7 @@ const Di = class extends Ft {
4308
4308
  };
4309
4309
  Di.moduleName = "peripherals";
4310
4310
  let tn = Di;
4311
- const Hi = class ae extends Ft {
4311
+ const Hi = class oe extends It {
4312
4312
  constructor() {
4313
4313
  super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
4314
4314
  }
@@ -4383,11 +4383,11 @@ const Hi = class ae extends Ft {
4383
4383
  writable: !1
4384
4384
  }), "getAnimations" in t.document && t.document.getAnimations().forEach((A) => {
4385
4385
  A.cancel(), this.allAnimations.add(A);
4386
- }), e.register("activate", ae.moduleName, (A, n) => {
4386
+ }), e.register("activate", oe.moduleName, (A, n) => {
4387
4387
  this.allAnimations.forEach((s) => {
4388
4388
  s.cancel(), s.play();
4389
4389
  }), n(!0);
4390
- }), e.register("unfocus", ae.moduleName, (A, n) => {
4390
+ }), e.register("unfocus", oe.moduleName, (A, n) => {
4391
4391
  this.pauseAllMedia(t), this.allAnimations.forEach((s) => s.pause()), n(!0);
4392
4392
  });
4393
4393
  const i = t.document.querySelectorAll("audio,video");
@@ -4407,44 +4407,44 @@ const Hi = class ae extends Ft {
4407
4407
  };
4408
4408
  Hi.moduleName = "setup";
4409
4409
  let Gi = Hi;
4410
- const $e = "readium-viewport", ki = class it extends Gi {
4410
+ const _e = "readium-viewport", ki = class et extends Gi {
4411
4411
  onViewportWidthChanged(t) {
4412
4412
  const e = t.target;
4413
- Bt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
4413
+ Mt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
4414
4414
  }
4415
4415
  mount(t, e) {
4416
4416
  if (!super.mount(t, e)) return !1;
4417
4417
  const i = t.document.createElement("meta");
4418
- return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", $e), i.setAttribute(
4418
+ return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", _e), i.setAttribute(
4419
4419
  "content",
4420
4420
  "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
4421
4421
  ), t.document.head.appendChild(i), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
4422
4422
  target: t
4423
- }), e.register("get_properties", it.moduleName, (A, n) => {
4423
+ }), e.register("get_properties", et.moduleName, (A, n) => {
4424
4424
  ye(t), n(!0);
4425
- }), e.register("update_properties", it.moduleName, (A, n) => {
4425
+ }), e.register("update_properties", et.moduleName, (A, n) => {
4426
4426
  A["--RS__viewportWidth"] = `${t.innerWidth}px`, zi(t, A), n(!0);
4427
- }), e.register("set_property", it.moduleName, (A, n) => {
4427
+ }), e.register("set_property", et.moduleName, (A, n) => {
4428
4428
  const s = A;
4429
- Bt(t, s[0], s[1]), n(!0);
4430
- }), e.register("remove_property", it.moduleName, (A, n) => {
4431
- Lt(t, A), n(!0);
4432
- }), e.register("activate", it.moduleName, (A, n) => {
4429
+ Mt(t, s[0], s[1]), n(!0);
4430
+ }), e.register("remove_property", et.moduleName, (A, n) => {
4431
+ Wt(t, A), n(!0);
4432
+ }), e.register("activate", et.moduleName, (A, n) => {
4433
4433
  this.unblock(t), n(!0);
4434
4434
  }), e.log("ReflowableSetup Mounted"), !0;
4435
4435
  }
4436
4436
  unmount(t, e) {
4437
- return e.unregisterAll(it.moduleName), t.document.head.querySelector(`#${$e}`)?.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
4437
+ return e.unregisterAll(et.moduleName), t.document.head.querySelector(`#${_e}`)?.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
4438
4438
  }
4439
4439
  };
4440
4440
  ki.moduleName = "reflowable_setup";
4441
4441
  let en = ki;
4442
- const ti = "readium-fixed-style", Ji = class K extends Gi {
4442
+ const $e = "readium-fixed-style", Ji = class Z extends Gi {
4443
4443
  mount(t, e) {
4444
4444
  if (!super.mount(t, e)) return !1;
4445
4445
  t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
4446
4446
  const i = t.document.createElement("style");
4447
- return i.id = ti, i.dataset.readium = "true", i.textContent = `
4447
+ return i.id = $e, i.dataset.readium = "true", i.textContent = `
4448
4448
  html, body {
4449
4449
  text-size-adjust: none;
4450
4450
  -ms-text-size-adjust: none;
@@ -4456,12 +4456,12 @@ const ti = "readium-fixed-style", Ji = class K extends Gi {
4456
4456
  min-height: 100%;
4457
4457
 
4458
4458
  /*cursor: var() TODO*/
4459
- }`, t.document.head.appendChild(i), e.register("set_property", K.moduleName, (A, n) => {
4459
+ }`, t.document.head.appendChild(i), e.register("set_property", Z.moduleName, (A, n) => {
4460
4460
  const s = A;
4461
- Bt(t, s[0], s[1]), n(!0);
4462
- }), e.register("remove_property", K.moduleName, (A, n) => {
4463
- Lt(t, A), n(!0);
4464
- }), e.register("first_visible_locator", K.moduleName, (A, n) => n(!1)), e.register("unfocus", K.moduleName, (A, n) => {
4461
+ Mt(t, s[0], s[1]), n(!0);
4462
+ }), e.register("remove_property", Z.moduleName, (A, n) => {
4463
+ Wt(t, A), n(!0);
4464
+ }), e.register("first_visible_locator", Z.moduleName, (A, n) => n(!1)), e.register("unfocus", Z.moduleName, (A, n) => {
4465
4465
  R(t), n(!0);
4466
4466
  }), e.register([
4467
4467
  "focus",
@@ -4472,17 +4472,17 @@ const ti = "readium-fixed-style", Ji = class K extends Gi {
4472
4472
  "go_start",
4473
4473
  "go_text",
4474
4474
  "go_progression"
4475
- ], K.moduleName, (A, n) => n(!0)), e.register("activate", K.moduleName, (A, n) => {
4475
+ ], Z.moduleName, (A, n) => n(!0)), e.register("activate", Z.moduleName, (A, n) => {
4476
4476
  this.unblock(t), n(!0);
4477
4477
  }), e.log("FixedSetup Mounted"), !0;
4478
4478
  }
4479
4479
  unmount(t, e) {
4480
- return e.unregisterAll(K.moduleName), t.document.getElementById(ti)?.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
4480
+ return e.unregisterAll(Z.moduleName), t.document.getElementById($e)?.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
4481
4481
  }
4482
4482
  };
4483
4483
  Ji.moduleName = "fixed_setup";
4484
4484
  let An = Ji;
4485
- const Wi = class At extends Ft {
4485
+ const Wi = class it extends It {
4486
4486
  wndOnErr(t) {
4487
4487
  this.comms?.send("error", {
4488
4488
  message: t.message,
@@ -4496,21 +4496,21 @@ const Wi = class At extends Ft {
4496
4496
  "error",
4497
4497
  this.wndOnErr,
4498
4498
  !1
4499
- ), e.register("get_properties", At.moduleName, (i, A) => {
4499
+ ), e.register("get_properties", it.moduleName, (i, A) => {
4500
4500
  ye(t), A(!0);
4501
- }), e.register("update_properties", At.moduleName, (i, A) => {
4501
+ }), e.register("update_properties", it.moduleName, (i, A) => {
4502
4502
  zi(t, i), A(!0);
4503
- }), e.register("set_property", At.moduleName, (i, A) => {
4503
+ }), e.register("set_property", it.moduleName, (i, A) => {
4504
4504
  const n = i;
4505
- Bt(t, n[0], n[1]), A(!0);
4506
- }), e.register("remove_property", At.moduleName, (i, A) => {
4507
- Lt(t, i), A(!0);
4508
- }), e.register("activate", At.moduleName, (i, A) => {
4505
+ Mt(t, n[0], n[1]), A(!0);
4506
+ }), e.register("remove_property", it.moduleName, (i, A) => {
4507
+ Wt(t, i), A(!0);
4508
+ }), e.register("activate", it.moduleName, (i, A) => {
4509
4509
  A(!0);
4510
4510
  }), e.log("WebPubSetup Mounted"), !0;
4511
4511
  }
4512
4512
  unmount(t, e) {
4513
- return e.unregisterAll(At.moduleName), t.removeEventListener("error", this.wndOnErr), e.log("WebPubSetup Unmounted"), !0;
4513
+ return e.unregisterAll(it.moduleName), t.removeEventListener("error", this.wndOnErr), e.log("WebPubSetup Unmounted"), !0;
4514
4514
  }
4515
4515
  };
4516
4516
  Wi.moduleName = "webpub_setup";
@@ -4530,7 +4530,7 @@ const rn = [
4530
4530
  "webpub_snapper",
4531
4531
  "decorator",
4532
4532
  "peripherals"
4533
- ], Tt = new Map([
4533
+ ], xt = new Map([
4534
4534
  // All modules go here
4535
4535
  An,
4536
4536
  en,
@@ -4541,7 +4541,7 @@ const rn = [
4541
4541
  qA,
4542
4542
  _A
4543
4543
  ].map((r) => [r.moduleName, r]));
4544
- class mt {
4544
+ class ut {
4545
4545
  /**
4546
4546
  * @param wnd Window instance to operate on
4547
4547
  * @param initialModules List of initial modules to load
@@ -4560,7 +4560,7 @@ class mt {
4560
4560
  }
4561
4561
  }
4562
4562
  loadModule(t) {
4563
- const e = Tt.get(t);
4563
+ const e = xt.get(t);
4564
4564
  return e === void 0 ? (this.comms.log(`Module "${name}" does not exist in the library`), e) : new e();
4565
4565
  }
4566
4566
  /**
@@ -4578,7 +4578,7 @@ class mt {
4578
4578
  * @returns Success
4579
4579
  */
4580
4580
  removeModule(t) {
4581
- const e = Tt.get(t);
4581
+ const e = xt.get(t);
4582
4582
  if (e === void 0)
4583
4583
  return this.comms.log(`Module "${t}" does not exist in the library`), !1;
4584
4584
  const i = this.loadedModules.findIndex((A) => A instanceof e);
@@ -4592,13 +4592,13 @@ class mt {
4592
4592
  }
4593
4593
  }
4594
4594
  const an = 1e4;
4595
- class wt {
4595
+ class Bt {
4596
4596
  constructor(t, e) {
4597
4597
  this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
4598
4598
  try {
4599
4599
  this.channelId = window.crypto.randomUUID();
4600
4600
  } catch {
4601
- this.channelId = ne();
4601
+ this.channelId = Ae();
4602
4602
  }
4603
4603
  this.gc = setInterval(() => {
4604
4604
  this.registry.forEach((i, A) => {
@@ -4650,7 +4650,7 @@ class wt {
4650
4650
  * @returns Identifier associated with the message
4651
4651
  */
4652
4652
  send(t, e, i, A = !1, n = []) {
4653
- const s = ne();
4653
+ const s = Ae();
4654
4654
  return i && this.registry.set(s, {
4655
4655
  // Add callback to the registry
4656
4656
  cb: i,
@@ -4658,7 +4658,7 @@ class wt {
4658
4658
  key: t
4659
4659
  }), this.wnd.postMessage(
4660
4660
  {
4661
- _readium: lt,
4661
+ _readium: at,
4662
4662
  _channel: this.channelId,
4663
4663
  id: s,
4664
4664
  data: e,
@@ -4673,10 +4673,10 @@ class wt {
4673
4673
  }
4674
4674
  const ln = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", hn = {
4675
4675
  RS__oldStyleTf: ln
4676
- }, cn = 16, ei = hn.RS__oldStyleTf;
4676
+ }, cn = 16, ti = hn.RS__oldStyleTf;
4677
4677
  class pt {
4678
4678
  constructor(t) {
4679
- this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || cn, this._fontFace = t.fontFace || ei, 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 = pt.approximateWordSpaces(this._optimalChars, this._sample);
4679
+ this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || cn, this._fontFace = t.fontFace || ti, 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 = pt.approximateWordSpaces(this._optimalChars, this._sample);
4680
4680
  }
4681
4681
  updateMultipliers() {
4682
4682
  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;
@@ -4685,7 +4685,7 @@ class pt {
4685
4685
  // Not filtering because pretty much everything can
4686
4686
  // trigger a recomputation anyway.
4687
4687
  update(t) {
4688
- 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 || ei), 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 = pt.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
4688
+ 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 || ti), 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 = pt.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
4689
4689
  }
4690
4690
  get baseFontSize() {
4691
4691
  return this._baseFontSize;
@@ -4801,7 +4801,7 @@ class gn extends Xi {
4801
4801
  return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
4802
4802
  }
4803
4803
  }
4804
- const Mt = new Xi(), J = new gn();
4804
+ const ft = new Xi(), k = new gn();
4805
4805
  class dn {
4806
4806
  constructor(t) {
4807
4807
  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.frame.style.backgroundColor = "#FFFFFF", this.source = t;
@@ -4817,7 +4817,7 @@ class dn {
4817
4817
  }
4818
4818
  return;
4819
4819
  }
4820
- this.comms?.halt(), this.loader.destroy(), this.loader = new mt(A, t), this.currModules = t, this.comms = void 0;
4820
+ this.comms?.halt(), this.loader.destroy(), this.loader = new ut(A, t), this.currModules = t, this.comms = void 0;
4821
4821
  try {
4822
4822
  e(A);
4823
4823
  } catch {
@@ -4826,7 +4826,7 @@ class dn {
4826
4826
  }
4827
4827
  this.frame.onload = () => {
4828
4828
  const A = this.frame.contentWindow;
4829
- this.loader = new mt(A, t), this.currModules = t;
4829
+ this.loader = new ut(A, t), this.currModules = t;
4830
4830
  try {
4831
4831
  e(A);
4832
4832
  } catch {
@@ -4856,11 +4856,11 @@ class dn {
4856
4856
  async show(t) {
4857
4857
  if (this.destroyed) throw Error("Trying to show frame when it doesn't exist");
4858
4858
  if (!this.frame.parentElement) throw Error("Trying to show frame that is not attached to the DOM");
4859
- return this.comms ? this.comms.resume() : this.comms = new wt(this.frame.contentWindow, this.source), new Promise((e, i) => {
4859
+ return this.comms ? this.comms.resume() : this.comms = new Bt(this.frame.contentWindow, this.source), new Promise((e, i) => {
4860
4860
  this.comms?.send("activate", void 0, () => {
4861
4861
  this.comms?.send("focus", void 0, () => {
4862
4862
  const A = () => {
4863
- 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, Mt.UA.WebKit && this.comms?.send("force_webkit_recalc", void 0), e();
4863
+ 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, ft.UA.WebKit && this.comms?.send("force_webkit_recalc", void 0), e();
4864
4864
  };
4865
4865
  t !== void 0 ? this.comms?.send("go_progression", t, A) : A();
4866
4866
  });
@@ -4868,7 +4868,7 @@ class dn {
4868
4868
  });
4869
4869
  }
4870
4870
  setCSSProperties(t) {
4871
- this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new wt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
4871
+ this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Bt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
4872
4872
  }
4873
4873
  get iframe() {
4874
4874
  if (this.destroyed) throw Error("Trying to use frame when it doesn't exist");
@@ -4914,8 +4914,8 @@ class un {
4914
4914
  this.inprogress.has(s) && await this.inprogress.get(s);
4915
4915
  const o = new Promise(async (a, h) => {
4916
4916
  const c = [], g = [];
4917
- t.readingOrder.items.forEach((l, f) => {
4918
- f !== n && f !== n - 1 && f !== n + 1 && (c.includes(l.href) || c.push(l.href)), f === n && (g.includes(l.href) || g.push(l.href));
4917
+ t.readingOrder.items.forEach((l, p) => {
4918
+ p !== n && p !== n - 1 && p !== n + 1 && (c.includes(l.href) || c.push(l.href)), p === n && (g.includes(l.href) || g.push(l.href));
4919
4919
  }), c.forEach(async (l) => {
4920
4920
  g.includes(l) || this.pool.has(l) && (await this.pool.get(l)?.destroy(), this.pool.delete(l));
4921
4921
  }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((l) => URL.revokeObjectURL(l)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
@@ -4933,11 +4933,11 @@ class un {
4933
4933
  return;
4934
4934
  }
4935
4935
  }
4936
- const f = t.readingOrder.findWithHref(l);
4937
- if (!f) return;
4936
+ const p = t.readingOrder.findWithHref(l);
4937
+ if (!p) return;
4938
4938
  if (!this.blobs.has(l)) {
4939
- const y = await new BA(t, this.currentBaseURL || "", f, this.currentCssProperties).build();
4940
- this.blobs.set(l, y);
4939
+ const U = await new BA(t, this.currentBaseURL || "", p, this.currentCssProperties).build();
4940
+ this.blobs.set(l, U);
4941
4941
  }
4942
4942
  const w = new dn(this.blobs.get(l));
4943
4943
  l !== s && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(l, w);
@@ -4993,10 +4993,10 @@ class un {
4993
4993
  }), t;
4994
4994
  }
4995
4995
  }
4996
- var Kt, ii;
4996
+ var Zt, ei;
4997
4997
  function mn() {
4998
- if (ii) return Kt;
4999
- ii = 1;
4998
+ if (ei) return Zt;
4999
+ ei = 1;
5000
5000
  function r(A) {
5001
5001
  if (typeof A != "string")
5002
5002
  throw new TypeError("Path must be a string. Received " + JSON.stringify(A));
@@ -5068,25 +5068,25 @@ function mn() {
5068
5068
  ;
5069
5069
  for (var a = n.length, h = a - o, c = 1; c < s.length && s.charCodeAt(c) === 47; ++c)
5070
5070
  ;
5071
- for (var g = s.length, d = g - c, M = h < d ? h : d, l = -1, f = 0; f <= M; ++f) {
5072
- if (f === M) {
5071
+ for (var g = s.length, d = g - c, M = h < d ? h : d, l = -1, p = 0; p <= M; ++p) {
5072
+ if (p === M) {
5073
5073
  if (d > M) {
5074
- if (s.charCodeAt(c + f) === 47)
5075
- return s.slice(c + f + 1);
5076
- if (f === 0)
5077
- return s.slice(c + f);
5078
- } else h > M && (n.charCodeAt(o + f) === 47 ? l = f : f === 0 && (l = 0));
5074
+ if (s.charCodeAt(c + p) === 47)
5075
+ return s.slice(c + p + 1);
5076
+ if (p === 0)
5077
+ return s.slice(c + p);
5078
+ } else h > M && (n.charCodeAt(o + p) === 47 ? l = p : p === 0 && (l = 0));
5079
5079
  break;
5080
5080
  }
5081
- var w = n.charCodeAt(o + f), E = s.charCodeAt(c + f);
5081
+ var w = n.charCodeAt(o + p), E = s.charCodeAt(c + p);
5082
5082
  if (w !== E)
5083
5083
  break;
5084
- w === 47 && (l = f);
5084
+ w === 47 && (l = p);
5085
5085
  }
5086
- var y = "";
5087
- for (f = o + l + 1; f <= a; ++f)
5088
- (f === a || n.charCodeAt(f) === 47) && (y.length === 0 ? y += ".." : y += "/..");
5089
- return y.length > 0 ? y + s.slice(c + l) : (c += l, s.charCodeAt(c) === 47 && ++c, s.slice(c));
5086
+ var U = "";
5087
+ for (p = o + l + 1; p <= a; ++p)
5088
+ (p === a || n.charCodeAt(p) === 47) && (U.length === 0 ? U += ".." : U += "/..");
5089
+ return U.length > 0 ? U + s.slice(c + l) : (c += l, s.charCodeAt(c) === 47 && ++c, s.slice(c));
5090
5090
  },
5091
5091
  _makeLong: function(n) {
5092
5092
  return n;
@@ -5160,7 +5160,7 @@ function mn() {
5160
5160
  if (n.length === 0) return s;
5161
5161
  var o = n.charCodeAt(0), a = o === 47, h;
5162
5162
  a ? (s.root = "/", h = 1) : h = 0;
5163
- for (var c = -1, g = 0, d = -1, M = !0, l = n.length - 1, f = 0; l >= h; --l) {
5163
+ for (var c = -1, g = 0, d = -1, M = !0, l = n.length - 1, p = 0; l >= h; --l) {
5164
5164
  if (o = n.charCodeAt(l), o === 47) {
5165
5165
  if (!M) {
5166
5166
  g = l + 1;
@@ -5168,21 +5168,21 @@ function mn() {
5168
5168
  }
5169
5169
  continue;
5170
5170
  }
5171
- d === -1 && (M = !1, d = l + 1), o === 46 ? c === -1 ? c = l : f !== 1 && (f = 1) : c !== -1 && (f = -1);
5171
+ d === -1 && (M = !1, d = l + 1), o === 46 ? c === -1 ? c = l : p !== 1 && (p = 1) : c !== -1 && (p = -1);
5172
5172
  }
5173
5173
  return c === -1 || d === -1 || // We saw a non-dot character immediately before the dot
5174
- f === 0 || // The (right-most) trimmed path component is exactly '..'
5175
- f === 1 && c === d - 1 && c === g + 1 ? d !== -1 && (g === 0 && a ? s.base = s.name = n.slice(1, d) : s.base = s.name = n.slice(g, d)) : (g === 0 && a ? (s.name = n.slice(1, c), s.base = n.slice(1, d)) : (s.name = n.slice(g, c), s.base = n.slice(g, d)), s.ext = n.slice(c, d)), g > 0 ? s.dir = n.slice(0, g - 1) : a && (s.dir = "/"), s;
5174
+ p === 0 || // The (right-most) trimmed path component is exactly '..'
5175
+ p === 1 && c === d - 1 && c === g + 1 ? d !== -1 && (g === 0 && a ? s.base = s.name = n.slice(1, d) : s.base = s.name = n.slice(g, d)) : (g === 0 && a ? (s.name = n.slice(1, c), s.base = n.slice(1, d)) : (s.name = n.slice(g, c), s.base = n.slice(g, d)), s.ext = n.slice(c, d)), g > 0 ? s.dir = n.slice(0, g - 1) : a && (s.dir = "/"), s;
5176
5176
  },
5177
5177
  sep: "/",
5178
5178
  delimiter: ":",
5179
5179
  win32: null,
5180
5180
  posix: null
5181
5181
  };
5182
- return i.posix = i, Kt = i, Kt;
5182
+ return i.posix = i, Zt = i, Zt;
5183
5183
  }
5184
- var jt = mn();
5185
- class Se {
5184
+ var Tt = mn();
5185
+ class Ce {
5186
5186
  constructor() {
5187
5187
  }
5188
5188
  toFlag(t) {
@@ -5209,7 +5209,7 @@ class Se {
5209
5209
  return `${t}rem`;
5210
5210
  }
5211
5211
  }
5212
- class Zi extends Se {
5212
+ class Zi extends Ce {
5213
5213
  constructor(t) {
5214
5214
  super(), this.a11yNormalize = t.a11yNormalize ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.fontFamily = t.fontFamily ?? null, this.fontWeight = t.fontWeight ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.textAlign = t.textAlign ?? null, this.wordSpacing = t.wordSpacing ?? null, this.zoom = t.zoom ?? null;
5215
5215
  }
@@ -5218,7 +5218,7 @@ class Zi extends Se {
5218
5218
  return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), 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.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.textAlign && (t["--USER__textAlign"] = this.textAlign), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), this.zoom !== null && (t["--USER__zoom"] = this.toPercentage(this.zoom, !0)), t;
5219
5219
  }
5220
5220
  }
5221
- class fn {
5221
+ class pn {
5222
5222
  constructor(t) {
5223
5223
  this.userProperties = t.userProperties;
5224
5224
  }
@@ -5241,42 +5241,42 @@ class fn {
5241
5241
  this.userProperties = new Zi(e);
5242
5242
  }
5243
5243
  }
5244
- var Z = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(Z || {});
5245
- const rt = {
5244
+ var X = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(X || {});
5245
+ const nt = {
5246
5246
  range: [0, 100],
5247
5247
  step: 1
5248
- }, bt = {
5248
+ }, jt = {
5249
5249
  range: [0.7, 4],
5250
5250
  step: 0.05
5251
- }, tt = {
5251
+ }, $ = {
5252
5252
  range: [100, 1e3],
5253
5253
  step: 100
5254
- }, Vt = {
5254
+ }, bt = {
5255
5255
  range: [50, 250],
5256
5256
  step: 10
5257
- }, Pt = {
5257
+ }, Vt = {
5258
5258
  range: [0, 1],
5259
5259
  step: 0.125
5260
- }, vt = {
5260
+ }, Pt = {
5261
5261
  range: [1, 2],
5262
5262
  step: 0.1
5263
- }, st = {
5263
+ }, rt = {
5264
5264
  range: [20, 100],
5265
5265
  step: 1
5266
- }, Dt = {
5266
+ }, vt = {
5267
5267
  range: [0, 3],
5268
5268
  step: 0.25
5269
- }, Ht = {
5269
+ }, Dt = {
5270
5270
  range: [0, 3],
5271
5271
  step: 0.25
5272
- }, Gt = {
5272
+ }, Ht = {
5273
5273
  range: [0, 2],
5274
5274
  step: 0.125
5275
- }, kt = {
5275
+ }, Gt = {
5276
5276
  range: [0.7, 4],
5277
5277
  step: 0.05
5278
5278
  };
5279
- function pn(r, t) {
5279
+ function fn(r, t) {
5280
5280
  return r == null || t == null || r <= t ? r : void 0;
5281
5281
  }
5282
5282
  function Mn(r, t) {
@@ -5288,18 +5288,18 @@ function Q(r) {
5288
5288
  function F(r) {
5289
5289
  return typeof r == "boolean" || r == null ? r : void 0;
5290
5290
  }
5291
- function Ot(r, t) {
5291
+ function Lt(r, t) {
5292
5292
  if (r !== void 0)
5293
5293
  return r === null ? null : t[r] !== void 0 ? r : void 0;
5294
5294
  }
5295
- function dt(r) {
5295
+ function gt(r) {
5296
5296
  return typeof r == "boolean" || typeof r == "number" && r >= 0 ? r : r === null ? null : void 0;
5297
5297
  }
5298
5298
  function I(r) {
5299
5299
  if (r !== void 0)
5300
5300
  return r === null ? null : r < 0 ? void 0 : r;
5301
5301
  }
5302
- function W(r, t) {
5302
+ function J(r, t) {
5303
5303
  if (r === void 0)
5304
5304
  return;
5305
5305
  if (r === null)
@@ -5307,12 +5307,12 @@ function W(r, t) {
5307
5307
  const e = Math.min(...t), i = Math.max(...t);
5308
5308
  return r >= e && r <= i ? r : void 0;
5309
5309
  }
5310
- function qt(r, t) {
5310
+ function Kt(r, t) {
5311
5311
  return r === void 0 ? t : r;
5312
5312
  }
5313
- class Et {
5313
+ class wt {
5314
5314
  constructor(t = {}) {
5315
- this.fontFamily = Q(t.fontFamily), this.fontWeight = W(t.fontWeight, tt.range), this.hyphens = F(t.hyphens), this.letterSpacing = I(t.letterSpacing), this.ligatures = F(t.ligatures), this.lineHeight = I(t.lineHeight), this.noRuby = F(t.noRuby), this.paragraphIndent = I(t.paragraphIndent), this.paragraphSpacing = I(t.paragraphSpacing), this.textAlign = Ot(t.textAlign, Z), this.textNormalization = F(t.textNormalization), this.wordSpacing = I(t.wordSpacing), this.zoom = W(t.zoom, kt.range);
5315
+ this.fontFamily = Q(t.fontFamily), this.fontWeight = J(t.fontWeight, $.range), this.hyphens = F(t.hyphens), this.letterSpacing = I(t.letterSpacing), this.ligatures = F(t.ligatures), this.lineHeight = I(t.lineHeight), this.noRuby = F(t.noRuby), this.paragraphIndent = I(t.paragraphIndent), this.paragraphSpacing = I(t.paragraphSpacing), this.textAlign = Lt(t.textAlign, X), this.textNormalization = F(t.textNormalization), this.wordSpacing = I(t.wordSpacing), this.zoom = J(t.zoom, Gt.range);
5316
5316
  }
5317
5317
  static serialize(t) {
5318
5318
  const { ...e } = t;
@@ -5321,7 +5321,7 @@ class Et {
5321
5321
  static deserialize(t) {
5322
5322
  try {
5323
5323
  const e = JSON.parse(t);
5324
- return new Et(e);
5324
+ return new wt(e);
5325
5325
  } catch (e) {
5326
5326
  return console.error("Failed to deserialize preferences:", e), null;
5327
5327
  }
@@ -5330,17 +5330,17 @@ class Et {
5330
5330
  const e = { ...this };
5331
5331
  for (const i of Object.keys(t))
5332
5332
  t[i] !== void 0 && (e[i] = t[i]);
5333
- return new Et(e);
5333
+ return new wt(e);
5334
5334
  }
5335
5335
  }
5336
5336
  class Bn {
5337
5337
  constructor(t) {
5338
- this.fontFamily = Q(t.fontFamily) || null, this.fontWeight = W(t.fontWeight, tt.range) || null, this.hyphens = F(t.hyphens) ?? null, this.letterSpacing = I(t.letterSpacing) || null, this.ligatures = F(t.ligatures) ?? null, this.lineHeight = I(t.lineHeight) || null, this.noRuby = F(t.noRuby) ?? !1, this.paragraphIndent = I(t.paragraphIndent) ?? null, this.paragraphSpacing = I(t.paragraphSpacing) ?? null, this.textAlign = Ot(t.textAlign, Z) || null, this.textNormalization = F(t.textNormalization) ?? !1, this.wordSpacing = I(t.wordSpacing) || null, this.zoom = W(t.zoom, kt.range) || 1;
5338
+ this.fontFamily = Q(t.fontFamily) || null, this.fontWeight = J(t.fontWeight, $.range) || null, this.hyphens = F(t.hyphens) ?? null, this.letterSpacing = I(t.letterSpacing) || null, this.ligatures = F(t.ligatures) ?? null, this.lineHeight = I(t.lineHeight) || null, this.noRuby = F(t.noRuby) ?? !1, this.paragraphIndent = I(t.paragraphIndent) ?? null, this.paragraphSpacing = I(t.paragraphSpacing) ?? null, this.textAlign = Lt(t.textAlign, X) || null, this.textNormalization = F(t.textNormalization) ?? !1, this.wordSpacing = I(t.wordSpacing) || null, this.zoom = J(t.zoom, Gt.range) || 1;
5339
5339
  }
5340
5340
  }
5341
- class Ai {
5342
- constructor(t, e) {
5343
- this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? 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.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? 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.textAlign = t.textAlign || e.textAlign || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null, this.zoom = t.zoom !== void 0 ? t.zoom : e.zoom !== void 0 ? e.zoom : null;
5341
+ class ii {
5342
+ constructor(t, e, i) {
5343
+ this.fontFamily = null, this.fontWeight = null, this.hyphens = null, this.letterSpacing = null, this.ligatures = null, this.lineHeight = null, this.noRuby = null, this.paragraphIndent = null, this.paragraphSpacing = null, this.textAlign = null, this.textNormalization = null, this.wordSpacing = null, i && (this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? 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.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? 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.textAlign = t.textAlign || e.textAlign || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null), this.zoom = t.zoom !== void 0 ? t.zoom : e.zoom !== void 0 ? e.zoom : null;
5344
5344
  }
5345
5345
  }
5346
5346
  class S {
@@ -5419,7 +5419,7 @@ class Ki extends S {
5419
5419
  this._value = null;
5420
5420
  }
5421
5421
  }
5422
- class U extends S {
5422
+ class y extends S {
5423
5423
  constructor({
5424
5424
  initialValue: t = null,
5425
5425
  effectiveValue: e,
@@ -5469,159 +5469,164 @@ class U extends S {
5469
5469
  this._value = null;
5470
5470
  }
5471
5471
  }
5472
- class ni {
5472
+ class Ai {
5473
5473
  constructor(t, e, i) {
5474
5474
  this.preferences = t, this.settings = e, this.metadata = i;
5475
5475
  }
5476
5476
  clear() {
5477
- this.preferences = new Et({});
5477
+ this.preferences = new wt({});
5478
5478
  }
5479
5479
  updatePreference(t, e) {
5480
5480
  this.preferences[t] = e;
5481
5481
  }
5482
+ get isDisplayTransformable() {
5483
+ return this.metadata?.accessibility?.feature?.some(
5484
+ (t) => t.value === di.DISPLAY_TRANSFORMABILITY.value
5485
+ ) ?? !1;
5486
+ }
5482
5487
  get fontFamily() {
5483
5488
  return new S({
5484
5489
  initialValue: this.preferences.fontFamily,
5485
5490
  effectiveValue: this.settings.fontFamily || null,
5486
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5491
+ isEffective: this.isDisplayTransformable,
5487
5492
  onChange: (t) => {
5488
5493
  this.updatePreference("fontFamily", t || null);
5489
5494
  }
5490
5495
  });
5491
5496
  }
5492
5497
  get fontWeight() {
5493
- return new U({
5498
+ return new y({
5494
5499
  initialValue: this.preferences.fontWeight,
5495
5500
  effectiveValue: this.settings.fontWeight || 400,
5496
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5501
+ isEffective: this.isDisplayTransformable,
5497
5502
  onChange: (t) => {
5498
5503
  this.updatePreference("fontWeight", t || null);
5499
5504
  },
5500
- supportedRange: tt.range,
5501
- step: tt.step
5505
+ supportedRange: $.range,
5506
+ step: $.step
5502
5507
  });
5503
5508
  }
5504
5509
  get hyphens() {
5505
5510
  return new Y({
5506
5511
  initialValue: this.preferences.hyphens,
5507
5512
  effectiveValue: this.settings.hyphens || !1,
5508
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5513
+ isEffective: this.isDisplayTransformable,
5509
5514
  onChange: (t) => {
5510
5515
  this.updatePreference("hyphens", t || null);
5511
5516
  }
5512
5517
  });
5513
5518
  }
5514
5519
  get letterSpacing() {
5515
- return new U({
5520
+ return new y({
5516
5521
  initialValue: this.preferences.letterSpacing,
5517
5522
  effectiveValue: this.settings.letterSpacing || 0,
5518
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5523
+ isEffective: this.isDisplayTransformable,
5519
5524
  onChange: (t) => {
5520
5525
  this.updatePreference("letterSpacing", t || null);
5521
5526
  },
5522
- supportedRange: Pt.range,
5523
- step: Pt.step
5527
+ supportedRange: Vt.range,
5528
+ step: Vt.step
5524
5529
  });
5525
5530
  }
5526
5531
  get ligatures() {
5527
5532
  return new Y({
5528
5533
  initialValue: this.preferences.ligatures,
5529
5534
  effectiveValue: this.settings.ligatures || !0,
5530
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5535
+ isEffective: this.isDisplayTransformable,
5531
5536
  onChange: (t) => {
5532
5537
  this.updatePreference("ligatures", t || null);
5533
5538
  }
5534
5539
  });
5535
5540
  }
5536
5541
  get lineHeight() {
5537
- return new U({
5542
+ return new y({
5538
5543
  initialValue: this.preferences.lineHeight,
5539
5544
  effectiveValue: this.settings.lineHeight,
5540
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5545
+ isEffective: this.isDisplayTransformable,
5541
5546
  onChange: (t) => {
5542
5547
  this.updatePreference("lineHeight", t || null);
5543
5548
  },
5544
- supportedRange: vt.range,
5545
- step: vt.step
5549
+ supportedRange: Pt.range,
5550
+ step: Pt.step
5546
5551
  });
5547
5552
  }
5548
5553
  get noRuby() {
5549
5554
  return new Y({
5550
5555
  initialValue: this.preferences.noRuby,
5551
5556
  effectiveValue: this.settings.noRuby || !1,
5552
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5557
+ isEffective: this.isDisplayTransformable,
5553
5558
  onChange: (t) => {
5554
5559
  this.updatePreference("noRuby", t || null);
5555
5560
  }
5556
5561
  });
5557
5562
  }
5558
5563
  get paragraphIndent() {
5559
- return new U({
5564
+ return new y({
5560
5565
  initialValue: this.preferences.paragraphIndent,
5561
5566
  effectiveValue: this.settings.paragraphIndent || 0,
5562
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5567
+ isEffective: this.isDisplayTransformable,
5563
5568
  onChange: (t) => {
5564
5569
  this.updatePreference("paragraphIndent", t || null);
5565
5570
  },
5566
- supportedRange: Dt.range,
5567
- step: Dt.step
5571
+ supportedRange: vt.range,
5572
+ step: vt.step
5568
5573
  });
5569
5574
  }
5570
5575
  get paragraphSpacing() {
5571
- return new U({
5576
+ return new y({
5572
5577
  initialValue: this.preferences.paragraphSpacing,
5573
5578
  effectiveValue: this.settings.paragraphSpacing || 0,
5574
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5579
+ isEffective: this.isDisplayTransformable,
5575
5580
  onChange: (t) => {
5576
5581
  this.updatePreference("paragraphSpacing", t || null);
5577
5582
  },
5578
- supportedRange: Ht.range,
5579
- step: Ht.step
5583
+ supportedRange: Dt.range,
5584
+ step: Dt.step
5580
5585
  });
5581
5586
  }
5582
5587
  get textAlign() {
5583
5588
  return new Ki({
5584
5589
  initialValue: this.preferences.textAlign,
5585
- effectiveValue: this.settings.textAlign || Z.start,
5586
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5590
+ effectiveValue: this.settings.textAlign || X.start,
5591
+ isEffective: this.isDisplayTransformable,
5587
5592
  onChange: (t) => {
5588
5593
  this.updatePreference("textAlign", t || null);
5589
5594
  },
5590
- supportedValues: Object.values(Z)
5595
+ supportedValues: Object.values(X)
5591
5596
  });
5592
5597
  }
5593
5598
  get textNormalization() {
5594
5599
  return new Y({
5595
5600
  initialValue: this.preferences.textNormalization,
5596
5601
  effectiveValue: this.settings.textNormalization || !1,
5597
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5602
+ isEffective: this.isDisplayTransformable,
5598
5603
  onChange: (t) => {
5599
5604
  this.updatePreference("textNormalization", t || null);
5600
5605
  }
5601
5606
  });
5602
5607
  }
5603
5608
  get wordSpacing() {
5604
- return new U({
5609
+ return new y({
5605
5610
  initialValue: this.preferences.wordSpacing,
5606
5611
  effectiveValue: this.settings.wordSpacing || 0,
5607
- isEffective: this.metadata?.accessibility?.feature?.includes(V.DISPLAY_TRANSFORMABILITY) ?? !1,
5612
+ isEffective: this.isDisplayTransformable,
5608
5613
  onChange: (t) => {
5609
5614
  this.updatePreference("wordSpacing", t || null);
5610
5615
  },
5611
- supportedRange: Gt.range,
5612
- step: Gt.step
5616
+ supportedRange: Ht.range,
5617
+ step: Ht.step
5613
5618
  });
5614
5619
  }
5615
5620
  get zoom() {
5616
- return new U({
5621
+ return new y({
5617
5622
  initialValue: this.preferences.zoom,
5618
5623
  effectiveValue: this.settings.zoom || 1,
5619
5624
  isEffective: CSS.supports("zoom", "1") ?? !1,
5620
5625
  onChange: (t) => {
5621
5626
  this.updatePreference("zoom", t || null);
5622
5627
  },
5623
- supportedRange: kt.range,
5624
- step: kt.step
5628
+ supportedRange: Gt.range,
5629
+ step: Gt.step
5625
5630
  });
5626
5631
  }
5627
5632
  }
@@ -5648,7 +5653,7 @@ class En extends wi {
5648
5653
  readingOrder: [],
5649
5654
  progressions: /* @__PURE__ */ new Map(),
5650
5655
  positions: null
5651
- }, this.pub = e, this.container = t, this.listeners = wn(i), this._preferences = new Et(n.preferences), this._defaults = new Bn(n.defaults), this._settings = new Ai(this._preferences, this._defaults), this._css = new fn({
5656
+ }, this.pub = e, this.container = t, this.listeners = wn(i), this._preferences = new wt(n.preferences), this._defaults = new Bn(n.defaults), this._settings = new ii(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new pn({
5652
5657
  userProperties: new Zi({ zoom: this._settings.zoom })
5653
5658
  }), A && typeof A.copyWithLocations == "function") {
5654
5659
  this.currentLocation = A;
@@ -5667,13 +5672,13 @@ class En extends wi {
5667
5672
  return Object.freeze({ ...this._settings });
5668
5673
  }
5669
5674
  get preferencesEditor() {
5670
- return this._preferencesEditor === null && (this._preferencesEditor = new ni(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
5675
+ return this._preferencesEditor === null && (this._preferencesEditor = new Ai(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
5671
5676
  }
5672
5677
  async submitPreferences(t) {
5673
5678
  this._preferences = this._preferences.merging(t), await this.applyPreferences();
5674
5679
  }
5675
5680
  async applyPreferences() {
5676
- this._settings = new Ai(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new ni(this._preferences, this.settings, this.pub.metadata)), await this.updateCSS(!0);
5681
+ this._settings = new ii(this._preferences, this._defaults, this.hasDisplayTransformability), this._preferencesEditor !== null && (this._preferencesEditor = new Ai(this._preferences, this.settings, this.pub.metadata)), await this.updateCSS(!0);
5677
5682
  }
5678
5683
  async updateCSS(t) {
5679
5684
  this._css.update(this._settings), t && await this.commitCSS(this._css);
@@ -5688,15 +5693,27 @@ class En extends wi {
5688
5693
  const e = this.compileCSSProperties(t);
5689
5694
  this.framePool.setCSSProperties(e);
5690
5695
  }
5696
+ /**
5697
+ * Exposed to the public to compensate for lack of implemented readium conveniences
5698
+ * TODO remove when settings management is incorporated
5699
+ */
5700
+ get _cframes() {
5701
+ return this.framePool.currentFrames;
5702
+ }
5703
+ get hasDisplayTransformability() {
5704
+ return this.pub.metadata?.accessibility?.feature?.some(
5705
+ (t) => t.value === di.DISPLAY_TRANSFORMABILITY.value
5706
+ ) ?? !1;
5707
+ }
5691
5708
  eventListener(t, e) {
5692
5709
  switch (t) {
5693
5710
  case "_pong":
5694
5711
  this.listeners.frameLoaded(this.framePool.currentFrames[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
5695
5712
  break;
5696
5713
  case "first_visible_locator":
5697
- const i = ct.deserialize(e);
5714
+ const i = ht.deserialize(e);
5698
5715
  if (!i) break;
5699
- this.currentLocation = new ct({
5716
+ this.currentLocation = new ht({
5700
5717
  href: this.currentLocation.href,
5701
5718
  type: this.currentLocation.type,
5702
5719
  title: this.currentLocation.title,
@@ -5723,7 +5740,7 @@ class En extends wi {
5723
5740
  }), !1, () => {
5724
5741
  });
5725
5742
  else if (s.startsWith("mailto:") || s.startsWith("tel:"))
5726
- this.listeners.handleLocator(new _({
5743
+ this.listeners.handleLocator(new q({
5727
5744
  href: s
5728
5745
  }).locator);
5729
5746
  else
@@ -5735,14 +5752,14 @@ class En extends wi {
5735
5752
  const h = new URL(this.currentLocation.href);
5736
5753
  o = new URL(s, h).href;
5737
5754
  } else
5738
- o = jt.join(jt.dirname(this.currentLocation.href), s);
5755
+ o = Tt.join(Tt.dirname(this.currentLocation.href), s);
5739
5756
  const a = this.pub.readingOrder.findWithHref(o);
5740
5757
  a ? this.goLink(a, !1, () => {
5741
- }) : (console.warn(`Internal link not found in readingOrder: ${o}`), this.listeners.handleLocator(new _({
5758
+ }) : (console.warn(`Internal link not found in readingOrder: ${o}`), this.listeners.handleLocator(new q({
5742
5759
  href: s
5743
5760
  }).locator));
5744
5761
  } catch (o) {
5745
- console.warn(`Couldn't resolve internal link for ${s}: ${o}`), this.listeners.handleLocator(new _({
5762
+ console.warn(`Couldn't resolve internal link for ${s}: ${o}`), this.listeners.handleLocator(new q({
5746
5763
  href: s
5747
5764
  }).locator);
5748
5765
  }
@@ -5767,7 +5784,7 @@ class En extends wi {
5767
5784
  }
5768
5785
  }
5769
5786
  determineModules() {
5770
- return Array.from(Tt.keys()).filter((e) => on.includes(e));
5787
+ return Array.from(xt.keys()).filter((e) => on.includes(e));
5771
5788
  }
5772
5789
  attachListener() {
5773
5790
  this.framePool.currentFrames[0]?.msg && (this.framePool.currentFrames[0].msg.listener = (t, e) => {
@@ -5894,7 +5911,7 @@ class En extends wi {
5894
5911
  if (!e)
5895
5912
  throw new Error("No current resource available");
5896
5913
  const A = this.currentLocation && this.currentLocation.href === e.href && this.currentLocation.locations.progression ? this.currentLocation.locations.progression : 0;
5897
- return this.pub.manifest.locatorFromLink(e) || new ct({
5914
+ return this.pub.manifest.locatorFromLink(e) || new ht({
5898
5915
  href: e.href,
5899
5916
  type: e.type || "text/html",
5900
5917
  locations: new b({
@@ -5906,7 +5923,7 @@ class En extends wi {
5906
5923
  }
5907
5924
  }
5908
5925
  const er = En, In = `/*!
5909
- * Readium CSS v.2.0.0-beta.19
5926
+ * Readium CSS v.2.0.0-beta.20
5910
5927
  * Copyright (c) 2017–2025. Readium Foundation. All rights reserved.
5911
5928
  * Use of this source code is governed by a BSD-style license which is detailed in the
5912
5929
  * LICENSE file present in the project repository where this source code is maintained.
@@ -5918,8 +5935,8 @@ const er = En, In = `/*!
5918
5935
  * L. Le Meur
5919
5936
  * Mickaël Menu
5920
5937
  * k_taka
5921
- */@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*=--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}`, Fn = `/*!
5922
- * Readium CSS v.2.0.0-beta.19
5938
+ */@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*=--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([class*=title]):not(blockquote p):not(figcaption p):not(header p):not(hgroup p):not(div:has(+*)>h1+p):not(div:has(+*)>p:has(+h1)),: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] body *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] body *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-a11y-on] body *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=AccessibleDfA] body *,:root[style*="IA Writer Duospace"] body *,:root[style*=readium-a11y-on] body *{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}`, Fn = `/*!
5939
+ * Readium CSS v.2.0.0-beta.20
5923
5940
  * Copyright (c) 2017–2025. Readium Foundation. All rights reserved.
5924
5941
  * Use of this source code is governed by a BSD-style license which is detailed in the
5925
5942
  * LICENSE file present in the project repository where this source code is maintained.
@@ -5931,8 +5948,8 @@ const er = En, In = `/*!
5931
5948
  * L. Le Meur
5932
5949
  * Mickaël Menu
5933
5950
  * k_taka
5934
- */@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)}`, Un = `/*!
5935
- * Readium CSS v.2.0.0-beta.19
5951
+ */@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)}`, yn = `/*!
5952
+ * Readium CSS v.2.0.0-beta.20
5936
5953
  * Copyright (c) 2017–2025. Readium Foundation. All rights reserved.
5937
5954
  * Use of this source code is governed by a BSD-style license which is detailed in the
5938
5955
  * LICENSE file present in the project repository where this source code is maintained.
@@ -5944,20 +5961,20 @@ const er = En, In = `/*!
5944
5961
  * L. Le Meur
5945
5962
  * Mickaël Menu
5946
5963
  * k_taka
5947
- */@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}`, $ = (r, t) => URL.createObjectURL(new Blob([r], { type: t })), qi = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), _t = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/url\((?!(https?:)?\/\/)("?)\/([^\)]+)/g, `url($2${window.location.origin}/$3`), Qe = (r, t) => {
5964
+ */@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}`, _ = (r, t) => URL.createObjectURL(new Blob([r], { type: t })), qi = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), qt = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/url\((?!(https?:)?\/\/)("?)\/([^\)]+)/g, `url($2${window.location.origin}/$3`), Se = (r, t) => {
5948
5965
  const e = r.createElement("script");
5949
- return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t : $(t, "text/javascript"), e;
5950
- }, $t = (r, t) => {
5966
+ return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t : _(t, "text/javascript"), e;
5967
+ }, _t = (r, t) => {
5951
5968
  const e = r.createElement("link");
5952
- return e.dataset.readium = "true", e.rel = "stylesheet", e.type = "text/css", e.href = t.startsWith("blob:") ? t : $(t, "text/css"), e;
5953
- }, te = /* @__PURE__ */ new Map(), ut = (r, t) => {
5954
- if (te.has(r)) return te.get(r);
5969
+ return e.dataset.readium = "true", e.rel = "stylesheet", e.type = "text/css", e.href = t.startsWith("blob:") ? t : _(t, "text/css"), e;
5970
+ }, $t = /* @__PURE__ */ new Map(), dt = (r, t) => {
5971
+ if ($t.has(r)) return $t.get(r);
5955
5972
  const e = t();
5956
- return te.set(r, e), e;
5957
- }, yn = (r) => Qe(r, ut("css-selector-generator", () => $(
5973
+ return $t.set(r, e), e;
5974
+ }, Un = (r) => Se(r, dt("css-selector-generator", () => _(
5958
5975
  '!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})()));',
5959
5976
  "text/javascript"
5960
- ))), Rn = (r) => Qe(r, ut("JS-Before", () => $(qi(
5977
+ ))), Rn = (r) => Se(r, dt("JS-Before", () => _(qi(
5961
5978
  `
5962
5979
  window._readium_blockedEvents = [];
5963
5980
  window._readium_blockEvents = true;
@@ -5971,7 +5988,7 @@ const er = En, In = `/*!
5971
5988
  };
5972
5989
  window.addEventListener("DOMContentLoaded", window._readium_eventBlocker, true);
5973
5990
  window.addEventListener("load", window._readium_eventBlocker, true);`
5974
- ), "text/javascript"))), Cn = (r) => Qe(r, ut("JS-After", () => $(qi(
5991
+ ), "text/javascript"))), Cn = (r) => Se(r, dt("JS-After", () => _(qi(
5975
5992
  `
5976
5993
  if(window.onload) window.onload = new Proxy(window.onload, {
5977
5994
  apply: function(target, receiver, args) {
@@ -6032,8 +6049,8 @@ class _i {
6032
6049
  finalizeDOM(t, e, i, A = !1, n) {
6033
6050
  if (!t) return "";
6034
6051
  if (!A) {
6035
- const o = $t(t, ut("ReadiumCSS-before", () => $(_t(Fn), "text/css")));
6036
- t.head.firstChild ? t.head.firstChild.before(o) : t.head.appendChild(o), this.hasStyle(t) || o.after($t(t, ut("ReadiumCSS-default", () => $(_t(Un), "text/css")))), t.head.appendChild($t(t, ut("ReadiumCSS-after", () => $(_t(In), "text/css")))), n && this.setProperties(n, t);
6052
+ const o = _t(t, dt("ReadiumCSS-before", () => _(qt(Fn), "text/css")));
6053
+ t.head.firstChild ? t.head.firstChild.before(o) : t.head.appendChild(o), this.hasStyle(t) || o.after(_t(t, dt("ReadiumCSS-default", () => _(qt(yn), "text/css")))), t.head.appendChild(_t(t, dt("ReadiumCSS-after", () => _(qt(In), "text/css")))), n && this.setProperties(n, t);
6037
6054
  }
6038
6055
  if (t.body.querySelectorAll("img").forEach((o) => {
6039
6056
  o.setAttribute("fetchpriority", "high");
@@ -6049,7 +6066,7 @@ class _i {
6049
6066
  o.href = e, o.dataset.readium = "true", t.head.firstChild.before(o);
6050
6067
  }
6051
6068
  const s = this.hasExecutable(t);
6052
- return s && t.head.firstChild.before(Rn(t)), t.head.firstChild.before(yn(t)), s && t.head.appendChild(Cn(t)), URL.createObjectURL(
6069
+ return s && t.head.firstChild.before(Rn(t)), t.head.firstChild.before(Un(t)), s && t.head.appendChild(Cn(t)), URL.createObjectURL(
6053
6070
  new Blob([new XMLSerializer().serializeToString(t)], {
6054
6071
  type: i.isHTML ? i.string : "application/xhtml+xml"
6055
6072
  // Fallback to XHTML
@@ -6072,7 +6089,7 @@ class Sn {
6072
6089
  }
6073
6090
  return;
6074
6091
  }
6075
- this.comms?.halt(), this.loader.destroy(), this.loader = new mt(A, t), this.currModules = t, this.comms = void 0;
6092
+ this.comms?.halt(), this.loader.destroy(), this.loader = new ut(A, t), this.currModules = t, this.comms = void 0;
6076
6093
  try {
6077
6094
  e(A);
6078
6095
  } catch {
@@ -6081,7 +6098,7 @@ class Sn {
6081
6098
  }
6082
6099
  this.frame.onload = () => {
6083
6100
  const A = this.frame.contentWindow;
6084
- this.loader = new mt(A, t), this.currModules = t;
6101
+ this.loader = new ut(A, t), this.currModules = t;
6085
6102
  try {
6086
6103
  e(A);
6087
6104
  } catch {
@@ -6111,11 +6128,11 @@ class Sn {
6111
6128
  async show(t) {
6112
6129
  if (this.destroyed) throw Error("Trying to show frame when it doesn't exist");
6113
6130
  if (!this.frame.parentElement) throw Error("Trying to show frame that is not attached to the DOM");
6114
- return this.comms ? this.comms.resume() : this.comms = new wt(this.frame.contentWindow, this.source), new Promise((e, i) => {
6131
+ return this.comms ? this.comms.resume() : this.comms = new Bt(this.frame.contentWindow, this.source), new Promise((e, i) => {
6115
6132
  this.comms?.send("activate", void 0, () => {
6116
6133
  this.comms?.send("focus", void 0, () => {
6117
6134
  const A = () => {
6118
- 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, Mt.UA.WebKit && this.comms?.send("force_webkit_recalc", void 0), e();
6135
+ 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, ft.UA.WebKit && this.comms?.send("force_webkit_recalc", void 0), e();
6119
6136
  };
6120
6137
  t !== void 0 ? this.comms?.send("go_progression", t, A) : A();
6121
6138
  });
@@ -6123,7 +6140,7 @@ class Sn {
6123
6140
  });
6124
6141
  }
6125
6142
  setCSSProperties(t) {
6126
- this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new wt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
6143
+ this.destroyed || !this.frame.contentWindow || (this.hidden && (this.comms ? this.comms?.resume() : this.comms = new Bt(this.frame.contentWindow, this.source)), this.comms?.send("update_properties", t), this.hidden && this.comms?.halt());
6127
6144
  }
6128
6145
  get iframe() {
6129
6146
  if (this.destroyed) throw Error("Trying to use frame when it doesn't exist");
@@ -6150,7 +6167,7 @@ class Sn {
6150
6167
  return this.loader;
6151
6168
  }
6152
6169
  }
6153
- const ri = 5, si = 3;
6170
+ const ni = 5, ri = 3;
6154
6171
  class Qn {
6155
6172
  constructor(t, e, i) {
6156
6173
  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 = i;
@@ -6175,8 +6192,8 @@ class Qn {
6175
6192
  this.inprogress.has(s) && await this.inprogress.get(s);
6176
6193
  const o = new Promise(async (a, h) => {
6177
6194
  const c = [], g = [];
6178
- this.positions.forEach((l, f) => {
6179
- (f > n + ri || f < n - ri) && (c.includes(l.href) || c.push(l.href)), f < n + si && f > n - si && (g.includes(l.href) || g.push(l.href));
6195
+ this.positions.forEach((l, p) => {
6196
+ (p > n + ni || p < n - ni) && (c.includes(l.href) || c.push(l.href)), p < n + ri && p > n - ri && (g.includes(l.href) || g.push(l.href));
6180
6197
  }), c.forEach(async (l) => {
6181
6198
  g.includes(l) || this.pool.has(l) && (await this.pool.get(l)?.destroy(), this.pool.delete(l), this.pendingUpdates.has(l) && this.pendingUpdates.set(l, { inPool: !1 }));
6182
6199
  }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((l) => URL.revokeObjectURL(l)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
@@ -6194,11 +6211,11 @@ class Qn {
6194
6211
  return;
6195
6212
  }
6196
6213
  }
6197
- const f = t.readingOrder.findWithHref(l);
6198
- if (!f) return;
6214
+ const p = t.readingOrder.findWithHref(l);
6215
+ if (!p) return;
6199
6216
  if (!this.blobs.has(l)) {
6200
- const y = await new _i(t, this.currentBaseURL || "", f, this.currentCssProperties).build();
6201
- this.blobs.set(l, y);
6217
+ const U = await new _i(t, this.currentBaseURL || "", p, this.currentCssProperties).build();
6218
+ this.blobs.set(l, U);
6202
6219
  }
6203
6220
  const w = new Sn(this.blobs.get(l));
6204
6221
  l !== s && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(l, w);
@@ -6269,7 +6286,7 @@ class zn {
6269
6286
  }
6270
6287
  return;
6271
6288
  }
6272
- this.comms?.halt(), this.loader.destroy(), this.loader = new mt(n, t), this.currModules = t, this.comms = void 0;
6289
+ this.comms?.halt(), this.loader.destroy(), this.loader = new ut(n, t), this.currModules = t, this.comms = void 0;
6273
6290
  try {
6274
6291
  i(n), this.loadPromise = void 0;
6275
6292
  } catch {
@@ -6278,7 +6295,7 @@ class zn {
6278
6295
  }
6279
6296
  this.frame.addEventListener("load", () => {
6280
6297
  const n = this.frame.contentWindow;
6281
- this.loader = new mt(n, t), this.currModules = t, this.peripherals.observe(this.wrapper), this.peripherals.observe(n);
6298
+ this.loader = new ut(n, t), this.currModules = t, this.peripherals.observe(this.wrapper), this.peripherals.observe(n);
6282
6299
  try {
6283
6300
  i(n);
6284
6301
  } catch {
@@ -6316,10 +6333,10 @@ class zn {
6316
6333
  const i = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
6317
6334
  this.frame.style.transform = `scale(${i})`;
6318
6335
  const A = this.frame.getBoundingClientRect(), n = this.wrapper.clientHeight - A.height;
6319
- if (this.frame.style.top = `${n / 2}px`, t === H.left) {
6336
+ if (this.frame.style.top = `${n / 2}px`, t === D.left) {
6320
6337
  const s = this.wrapper.clientWidth - A.width;
6321
6338
  this.frame.style.left = `${s}px`;
6322
- } else if (t === H.center) {
6339
+ } else if (t === D.center) {
6323
6340
  const s = this.wrapper.clientWidth - A.width;
6324
6341
  this.frame.style.left = `${s / 2}px`;
6325
6342
  } else
@@ -6366,7 +6383,7 @@ class zn {
6366
6383
  this.showPromise = void 0;
6367
6384
  return;
6368
6385
  }
6369
- 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 wt(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, i) => {
6386
+ 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 Bt(this.frame.contentWindow, this.source), this.showPromise = new Promise((e, i) => {
6370
6387
  this.comms.send("focus", void 0, (A) => {
6371
6388
  this.update(this.cachedPage), e();
6372
6389
  });
@@ -6423,7 +6440,7 @@ class xn {
6423
6440
  this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
6424
6441
  }
6425
6442
  refreshOuterPixels(t) {
6426
- Mt.OS.iOS || (this.outerHeight = window.outerHeight - window.innerHeight, Mt.OS.Android && Mt.UA.Chrome && window.screen.height > window.innerHeight && (this.outerHeight = (window.screen.height - window.innerHeight) / 1.5), this.outerWidth = window.outerWidth - window.innerWidth);
6443
+ ft.OS.iOS || (this.outerHeight = window.outerHeight - window.innerHeight, ft.OS.Android && ft.UA.Chrome && window.screen.height > window.innerHeight && (this.outerHeight = (window.screen.height - window.innerHeight) / 1.5), this.outerWidth = window.outerWidth - window.innerWidth);
6427
6444
  }
6428
6445
  getBibiEventCoord(t, e = 0) {
6429
6446
  const i = { X: 0, Y: 0 };
@@ -6484,7 +6501,7 @@ class Tn {
6484
6501
  return this._DOM;
6485
6502
  }
6486
6503
  }
6487
- const oi = 6, ee = 1.02, ai = 50;
6504
+ const si = 6, te = 1.02, oi = 50;
6488
6505
  class jn {
6489
6506
  constructor(t, e = !1) {
6490
6507
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
@@ -6511,7 +6528,7 @@ class jn {
6511
6528
  }
6512
6529
  set scale(t) {
6513
6530
  isNaN(t) && (t = 1), window.clearTimeout(this.scaleDebouncer), this.scaleDebouncer = window.setTimeout(() => {
6514
- this.dragState === 0 && this.scale < ee && (this.pan.translateX = 0, this.pan.translateY = 0, this.clearPan(), this.manager.updateBookStyle()), this.manager.listener("zoom", t);
6531
+ this.dragState === 0 && this.scale < te && (this.pan.translateX = 0, this.pan.translateY = 0, this.clearPan(), this.manager.updateBookStyle()), this.manager.listener("zoom", t);
6515
6532
  }, 100), this._scale = t;
6516
6533
  }
6517
6534
  /**
@@ -6600,14 +6617,14 @@ class jn {
6600
6617
  */
6601
6618
  touchendHandler(t) {
6602
6619
  if (t.stopPropagation(), !t.touches || t.touches.length === 0)
6603
- this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > ai && Math.abs(this.pan.overscrollY) < ai / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), this.debugger?.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
6620
+ this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > oi && Math.abs(this.pan.overscrollY) < oi / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), this.debugger?.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
6604
6621
  else if (t.touches.length === 1) {
6605
6622
  this.dragState = 1, t.touches[0].identifier !== this.pan.touchID && (this.pan.touchID = t.touches[0].identifier), this.debugger?.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch2.style.display = "none", this.debugger.DOM.pinchTarget.style.display = "none");
6606
6623
  const e = this.startTouch(t);
6607
6624
  this.pan.startX = e.X, this.pan.startY = e.Y;
6608
6625
  }
6609
6626
  window.setTimeout(() => {
6610
- this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale < ee && (this.pan.translateX = 0, this.pan.translateY = 0), this.clearPan()), this.manager.updateBookStyle(!0);
6627
+ this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale < te && (this.pan.translateX = 0, this.pan.translateY = 0), this.clearPan()), this.manager.updateBookStyle(!0);
6611
6628
  }, 50);
6612
6629
  }
6613
6630
  /**
@@ -6623,7 +6640,7 @@ class jn {
6623
6640
  if (this.dragState === 2 && i) {
6624
6641
  if (this.pinch.touchN++, this.pinch.touchN < 4) return;
6625
6642
  let s = i / this.pinch.startDistance * this.scale;
6626
- s >= oi && (s = oi), s <= ee && (s = 1), this.scale = s, this.pinch.startDistance = i, A = !0;
6643
+ s >= si && (s = si), s <= te && (s = 1), this.scale = s, this.pinch.startDistance = i, A = !0;
6627
6644
  }
6628
6645
  if (this.pan.letItGo === !1 && (this.pan.letItGo = Math.abs(this.pan.startY - e.Y) < Math.abs(this.pan.startX - e.X)), this.debugger?.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) {
6629
6646
  if (this.dragState === 1) {
@@ -6705,7 +6722,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
6705
6722
  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);
6706
6723
  }
6707
6724
  }
6708
- var le = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(le || {}), he = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(he || {});
6725
+ var ae = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(ae || {}), le = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(le || {});
6709
6726
  class bn {
6710
6727
  // TODO getter
6711
6728
  constructor(t) {
@@ -6735,13 +6752,13 @@ class bn {
6735
6752
  if (i.length > 1)
6736
6753
  return;
6737
6754
  const n = i[0], s = n.properties?.otherProperties.orientation;
6738
- A === 0 && (s === "landscape" || s !== "portrait" && ((n.width || 0) > (n.height || 0) || n.properties?.otherProperties.spread === "both")) && (this.shift = !1), e && n.properties?.page === H.center && this.spreads[A - 1][0].addProperties({ addBlank: !0 }), s === "portrait" && n.properties?.page !== "center" && n.properties?.otherProperties.number > 1 ? e = !0 : e = !1;
6755
+ A === 0 && (s === "landscape" || s !== "portrait" && ((n.width || 0) > (n.height || 0) || n.properties?.otherProperties.spread === "both")) && (this.shift = !1), e && n.properties?.page === D.center && this.spreads[A - 1][0].addProperties({ addBlank: !0 }), s === "portrait" && n.properties?.page !== "center" && n.properties?.otherProperties.number > 1 ? e = !0 : e = !1;
6739
6756
  }), this.shift || this.index(t, !0);
6740
6757
  }
6741
6758
  buildSpreads(t) {
6742
6759
  let e = [];
6743
6760
  t.items.forEach((i, A) => {
6744
- !A && this.shift ? this.spreads.push([i]) : i.properties?.page === H.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([i]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [i]) : e.push(i);
6761
+ !A && this.shift ? this.spreads.push([i]) : i.properties?.page === D.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([i]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [i]) : e.push(i);
6745
6762
  }), e.length > 0 && this.spreads.push(e);
6746
6763
  }
6747
6764
  currentSpread(t, e) {
@@ -6751,14 +6768,14 @@ class bn {
6751
6768
  return this.spreads.find((e) => e.includes(t)) || void 0;
6752
6769
  }
6753
6770
  }
6754
- const li = 8, hi = 5, Vn = 300, Pn = 15e3, vn = 250, Dn = 150, Hn = 500;
6771
+ const ai = 8, li = 5, Vn = 300, Pn = 15e3, vn = 250, Dn = 150, Hn = 500;
6755
6772
  class Gn {
6756
6773
  constructor(t, e, i) {
6757
- 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 = i, this.spreadPresentation = i.metadata.otherMetadata?.spread || he.auto, this.pub.metadata.effectiveReadingProgression !== z.rtl && this.pub.metadata.effectiveReadingProgression !== z.ltr)
6774
+ 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 = i, this.spreadPresentation = i.metadata.otherMetadata?.spread || le.auto, this.pub.metadata.effectiveReadingProgression !== z.rtl && this.pub.metadata.effectiveReadingProgression !== z.ltr)
6758
6775
  throw Error("Unsupported reading progression for EPUB");
6759
6776
  this.spreader = new bn(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 jn(this), this.pub.readingOrder.items.forEach((A) => {
6760
6777
  const n = new zn(this.peripherals, this.pub.metadata.effectiveReadingProgression, A.href);
6761
- this.spineElement.appendChild(n.element), this.pool.set(A.href, n), n.width = 100 / this.length * (A.properties?.otherProperties.orientation === le.landscape || A.properties?.otherProperties.addBlank ? this.perPage : 1), n.height = this.height;
6778
+ this.spineElement.appendChild(n.element), this.pool.set(A.href, n), n.width = 100 / this.length * (A.properties?.otherProperties.orientation === ae.landscape || A.properties?.otherProperties.addBlank ? this.perPage : 1), n.height = this.height;
6762
6779
  });
6763
6780
  }
6764
6781
  set listener(t) {
@@ -6778,7 +6795,7 @@ class Gn {
6778
6795
  this.pool.forEach((i, A) => {
6779
6796
  let n = this.pub.readingOrder.items.findIndex((a) => a.href === A);
6780
6797
  const s = this.pub.readingOrder.items[n];
6781
- if (i.width = 100 / this.length * (s.properties?.otherProperties.orientation === le.landscape || s.properties?.otherProperties.addBlank ? this.perPage : 1), i.height = this.height, !i.loaded) return;
6798
+ if (i.width = 100 / this.length * (s.properties?.otherProperties.orientation === ae.landscape || s.properties?.otherProperties.addBlank ? this.perPage : 1), i.height = this.height, !i.loaded) return;
6782
6799
  const o = this.spreader.findByLink(s);
6783
6800
  i.update(this.spreadPosition(o, s));
6784
6801
  });
@@ -6803,7 +6820,7 @@ class Gn {
6803
6820
  return 50;
6804
6821
  }
6805
6822
  get portrait() {
6806
- return this.spreadPresentation === he.none ? !0 : (this.orientationInternal === -1 && (this.orientationInternal = this.containerHeightCached > this.container.clientWidth ? 1 : 0), this.orientationInternal === 1);
6823
+ return this.spreadPresentation === le.none ? !0 : (this.orientationInternal === -1 && (this.orientationInternal = this.containerHeightCached > this.container.clientWidth ? 1 : 0), this.orientationInternal === 1);
6807
6824
  }
6808
6825
  updateSpineStyle(t, e = !0) {
6809
6826
  let i = "0";
@@ -6944,7 +6961,7 @@ class Gn {
6944
6961
  return t % 2 && !this.single && t++, t;
6945
6962
  }
6946
6963
  spreadPosition(t, e) {
6947
- return this.perPage < 2 || t.length < 2 ? H.center : e.href === t[0].href ? this.rtl ? H.right : H.left : this.rtl ? H.left : H.right;
6964
+ return this.perPage < 2 || t.length < 2 ? D.center : e.href === t[0].href ? this.rtl ? D.right : D.left : this.rtl ? D.left : D.right;
6948
6965
  }
6949
6966
  async waitForItem(t) {
6950
6967
  if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
@@ -6968,27 +6985,27 @@ class Gn {
6968
6985
  await this.waitForItem(a.href);
6969
6986
  const o = new Promise(async (a, h) => {
6970
6987
  const c = [], g = [];
6971
- this.positions.forEach((l, f) => {
6972
- (f > n + li || f < n - li) && (c.includes(l.href) || c.push(l.href)), f < n + hi && f > n - hi && (g.includes(l.href) || g.push(l.href));
6988
+ this.positions.forEach((l, p) => {
6989
+ (p > n + ai || p < n - ai) && (c.includes(l.href) || c.push(l.href)), p < n + li && p > n - li && (g.includes(l.href) || g.push(l.href));
6973
6990
  }), c.forEach(async (l) => {
6974
6991
  g.includes(l) || this.pool.has(l) && (this.cancelShowing(l), await this.pool.get(l)?.unload());
6975
6992
  }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((l) => URL.revokeObjectURL(l)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
6976
6993
  const d = async (l) => {
6977
- const f = t.readingOrder.findIndexWithHref(l), w = t.readingOrder.items[f];
6994
+ const p = t.readingOrder.findIndexWithHref(l), w = t.readingOrder.items[p];
6978
6995
  if (w) {
6979
6996
  if (!this.blobs.has(l)) {
6980
- const y = await new _i(t, this.currentBaseURL || "", w).build(!0);
6981
- this.blobs.set(l, y);
6997
+ const U = await new _i(t, this.currentBaseURL || "", w).build(!0);
6998
+ this.blobs.set(l, U);
6982
6999
  }
6983
- this.delayedShow.has(l) || this.delayedShow.set(l, new Promise((E, y) => {
6984
- let ze = !1;
7000
+ this.delayedShow.has(l) || this.delayedShow.set(l, new Promise((E, U) => {
7001
+ let Qe = !1;
6985
7002
  const eA = window.setTimeout(async () => {
6986
7003
  this.delayedTimeout.set(l, 0);
6987
- const iA = this.makeSpread(this.reAlign(f)), AA = this.spreadPosition(iA, w), Ye = this.pool.get(l);
6988
- await Ye.load(i, this.blobs.get(l)), this.peripherals.isScaled || await Ye.show(AA), this.delayedShow.delete(l), ze = !0, E();
7004
+ const iA = this.makeSpread(this.reAlign(p)), AA = this.spreadPosition(iA, w), ze = this.pool.get(l);
7005
+ await ze.load(i, this.blobs.get(l)), this.peripherals.isScaled || await ze.show(AA), this.delayedShow.delete(l), Qe = !0, E();
6989
7006
  }, Vn);
6990
7007
  setTimeout(() => {
6991
- !ze && this.delayedShow.has(l) && y(`Offscreen load timeout: ${l}`);
7008
+ !Qe && this.delayedShow.has(l) && U(`Offscreen load timeout: ${l}`);
6992
7009
  }, Pn), this.delayedTimeout.set(l, eA);
6993
7010
  }));
6994
7011
  }
@@ -7000,8 +7017,8 @@ class Gn {
7000
7017
  }
7001
7018
  const M = [];
7002
7019
  for (const l of s) {
7003
- const f = this.pool.get(l.href), w = this.blobs.get(l.href);
7004
- w && (this.cancelShowing(l.href), await f.load(i, w), await f.show(this.spreadPosition(s, l)), this.previousFrames.push(f), await f.activate(), M.push(f));
7020
+ const p = this.pool.get(l.href), w = this.blobs.get(l.href);
7021
+ w && (this.cancelShowing(l.href), await p.load(i, w), await p.show(this.spreadPosition(s, l)), this.previousFrames.push(p), await p.activate(), M.push(p));
7005
7022
  }
7006
7023
  for (; this.previousFrames.length > 0; ) {
7007
7024
  const l = this.previousFrames.shift();
@@ -7065,9 +7082,9 @@ class Gn {
7065
7082
  this.currentFrames?.forEach((t) => t?.deselect());
7066
7083
  }
7067
7084
  }
7068
- class It {
7085
+ class Et {
7069
7086
  constructor(t = {}) {
7070
- this.backgroundColor = Q(t.backgroundColor), this.blendFilter = F(t.blendFilter), this.constraint = I(t.constraint), this.columnCount = I(t.columnCount), this.darkenFilter = dt(t.darkenFilter), this.deprecatedFontSize = F(t.deprecatedFontSize), this.fontFamily = Q(t.fontFamily), this.fontSize = W(t.fontSize, bt.range), this.fontSizeNormalize = F(t.fontSizeNormalize), this.fontOpticalSizing = F(t.fontOpticalSizing), this.fontWeight = W(t.fontWeight, tt.range), this.fontWidth = W(t.fontWidth, Vt.range), this.hyphens = F(t.hyphens), this.invertFilter = dt(t.invertFilter), this.invertGaijiFilter = dt(t.invertGaijiFilter), this.iOSPatch = F(t.iOSPatch), this.iPadOSPatch = F(t.iPadOSPatch), this.letterSpacing = I(t.letterSpacing), this.ligatures = F(t.ligatures), this.lineHeight = I(t.lineHeight), this.linkColor = Q(t.linkColor), this.noRuby = F(t.noRuby), this.pageGutter = I(t.pageGutter), this.paragraphIndent = I(t.paragraphIndent), this.paragraphSpacing = I(t.paragraphSpacing), this.scroll = F(t.scroll), this.scrollPaddingTop = I(t.scrollPaddingTop), this.scrollPaddingBottom = I(t.scrollPaddingBottom), this.selectionBackgroundColor = Q(t.selectionBackgroundColor), this.selectionTextColor = Q(t.selectionTextColor), this.textAlign = Ot(t.textAlign, Z), this.textColor = Q(t.textColor), this.textNormalization = F(t.textNormalization), this.visitedColor = Q(t.visitedColor), this.wordSpacing = I(t.wordSpacing), this.optimalLineLength = I(t.optimalLineLength), this.maximalLineLength = I(t.maximalLineLength), this.minimalLineLength = I(t.minimalLineLength);
7087
+ this.backgroundColor = Q(t.backgroundColor), this.blendFilter = F(t.blendFilter), this.constraint = I(t.constraint), this.columnCount = I(t.columnCount), this.darkenFilter = gt(t.darkenFilter), this.deprecatedFontSize = F(t.deprecatedFontSize), this.fontFamily = Q(t.fontFamily), this.fontSize = J(t.fontSize, jt.range), this.fontSizeNormalize = F(t.fontSizeNormalize), this.fontOpticalSizing = F(t.fontOpticalSizing), this.fontWeight = J(t.fontWeight, $.range), this.fontWidth = J(t.fontWidth, bt.range), this.hyphens = F(t.hyphens), this.invertFilter = gt(t.invertFilter), this.invertGaijiFilter = gt(t.invertGaijiFilter), this.iOSPatch = F(t.iOSPatch), this.iPadOSPatch = F(t.iPadOSPatch), this.letterSpacing = I(t.letterSpacing), this.ligatures = F(t.ligatures), this.lineHeight = I(t.lineHeight), this.linkColor = Q(t.linkColor), this.noRuby = F(t.noRuby), this.pageGutter = I(t.pageGutter), this.paragraphIndent = I(t.paragraphIndent), this.paragraphSpacing = I(t.paragraphSpacing), this.scroll = F(t.scroll), this.scrollPaddingTop = I(t.scrollPaddingTop), this.scrollPaddingBottom = I(t.scrollPaddingBottom), this.selectionBackgroundColor = Q(t.selectionBackgroundColor), this.selectionTextColor = Q(t.selectionTextColor), this.textAlign = Lt(t.textAlign, X), this.textColor = Q(t.textColor), this.textNormalization = F(t.textNormalization), this.visitedColor = Q(t.visitedColor), this.wordSpacing = I(t.wordSpacing), this.optimalLineLength = I(t.optimalLineLength), this.maximalLineLength = I(t.maximalLineLength), this.minimalLineLength = I(t.minimalLineLength);
7071
7088
  }
7072
7089
  static serialize(t) {
7073
7090
  const { ...e } = t;
@@ -7076,7 +7093,7 @@ class It {
7076
7093
  static deserialize(t) {
7077
7094
  try {
7078
7095
  const e = JSON.parse(t);
7079
- return new It(e);
7096
+ return new Et(e);
7080
7097
  } catch (e) {
7081
7098
  return console.error("Failed to deserialize preferences:", e), null;
7082
7099
  }
@@ -7085,15 +7102,15 @@ class It {
7085
7102
  const e = { ...this };
7086
7103
  for (const i of Object.keys(t))
7087
7104
  t[i] !== void 0 && (i !== "maximalLineLength" || t[i] === null || t[i] >= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (i !== "minimalLineLength" || t[i] === null || t[i] <= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (e[i] = t[i]);
7088
- return new It(e);
7105
+ return new Et(e);
7089
7106
  }
7090
7107
  }
7091
7108
  class kn {
7092
7109
  constructor(t) {
7093
- this.backgroundColor = Q(t.backgroundColor) || null, this.blendFilter = F(t.blendFilter) ?? !1, this.constraint = I(t.constraint) || 0, this.columnCount = I(t.columnCount) || null, this.darkenFilter = dt(t.darkenFilter) ?? !1, this.deprecatedFontSize = F(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = Q(t.fontFamily) || null, this.fontSize = W(t.fontSize, bt.range) || 1, this.fontSizeNormalize = F(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = F(t.fontOpticalSizing) ?? null, this.fontWeight = W(t.fontWeight, tt.range) || null, this.fontWidth = W(t.fontWidth, Vt.range) || null, this.hyphens = F(t.hyphens) ?? null, this.invertFilter = dt(t.invertFilter) ?? !1, this.invertGaijiFilter = dt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (J.OS.iOS || J.OS.iPadOS) && J.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : J.OS.iPadOS && J.iOSRequest === "desktop", this.letterSpacing = I(t.letterSpacing) || null, this.ligatures = F(t.ligatures) ?? null, this.lineHeight = I(t.lineHeight) || null, this.linkColor = Q(t.linkColor) || null, this.noRuby = F(t.noRuby) ?? !1, this.pageGutter = qt(I(t.pageGutter), 20), this.paragraphIndent = I(t.paragraphIndent) ?? null, this.paragraphSpacing = I(t.paragraphSpacing) ?? null, this.scroll = F(t.scroll) ?? !1, this.scrollPaddingTop = I(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = I(t.scrollPaddingBottom) ?? null, this.selectionBackgroundColor = Q(t.selectionBackgroundColor) || null, this.selectionTextColor = Q(t.selectionTextColor) || null, this.textAlign = Ot(t.textAlign, Z) || null, this.textColor = Q(t.textColor) || null, this.textNormalization = F(t.textNormalization) ?? !1, this.visitedColor = Q(t.visitedColor) || null, this.wordSpacing = I(t.wordSpacing) || null, this.optimalLineLength = I(t.optimalLineLength) || 65, this.maximalLineLength = qt(Mn(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = qt(pn(t.minimalLineLength, this.optimalLineLength), 40);
7110
+ this.backgroundColor = Q(t.backgroundColor) || null, this.blendFilter = F(t.blendFilter) ?? !1, this.constraint = I(t.constraint) || 0, this.columnCount = I(t.columnCount) || null, this.darkenFilter = gt(t.darkenFilter) ?? !1, this.deprecatedFontSize = F(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = Q(t.fontFamily) || null, this.fontSize = J(t.fontSize, jt.range) || 1, this.fontSizeNormalize = F(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = F(t.fontOpticalSizing) ?? null, this.fontWeight = J(t.fontWeight, $.range) || null, this.fontWidth = J(t.fontWidth, bt.range) || null, this.hyphens = F(t.hyphens) ?? null, this.invertFilter = gt(t.invertFilter) ?? !1, this.invertGaijiFilter = gt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (k.OS.iOS || k.OS.iPadOS) && k.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : k.OS.iPadOS && k.iOSRequest === "desktop", this.letterSpacing = I(t.letterSpacing) || null, this.ligatures = F(t.ligatures) ?? null, this.lineHeight = I(t.lineHeight) || null, this.linkColor = Q(t.linkColor) || null, this.noRuby = F(t.noRuby) ?? !1, this.pageGutter = Kt(I(t.pageGutter), 20), this.paragraphIndent = I(t.paragraphIndent) ?? null, this.paragraphSpacing = I(t.paragraphSpacing) ?? null, this.scroll = F(t.scroll) ?? !1, this.scrollPaddingTop = I(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = I(t.scrollPaddingBottom) ?? null, this.selectionBackgroundColor = Q(t.selectionBackgroundColor) || null, this.selectionTextColor = Q(t.selectionTextColor) || null, this.textAlign = Lt(t.textAlign, X) || null, this.textColor = Q(t.textColor) || null, this.textNormalization = F(t.textNormalization) ?? !1, this.visitedColor = Q(t.visitedColor) || null, this.wordSpacing = I(t.wordSpacing) || null, this.optimalLineLength = I(t.optimalLineLength) || 65, this.maximalLineLength = Kt(Mn(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = Kt(fn(t.minimalLineLength, this.optimalLineLength), 40);
7094
7111
  }
7095
7112
  }
7096
- const Jn = "#FFFFFF", Wn = "#121212", Ln = "#0000EE", On = "#551A8B", Xn = "#b4d8fe", Zn = "inherit", ot = {
7113
+ const Jn = "#FFFFFF", Wn = "#121212", Ln = "#0000EE", On = "#551A8B", Xn = "#b4d8fe", Zn = "inherit", st = {
7097
7114
  RS__backgroundColor: Jn,
7098
7115
  RS__textColor: Wn,
7099
7116
  RS__linkColor: Ln,
@@ -7101,12 +7118,12 @@ const Jn = "#FFFFFF", Wn = "#121212", Ln = "#0000EE", On = "#551A8B", Xn = "#b4d
7101
7118
  RS__selectionBackgroundColor: Xn,
7102
7119
  RS__selectionTextColor: Zn
7103
7120
  };
7104
- class ci {
7121
+ class hi {
7105
7122
  constructor(t, e, i) {
7106
7123
  this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || B.reflowable;
7107
7124
  }
7108
7125
  clear() {
7109
- this.preferences = new It({ optimalLineLength: 65 });
7126
+ this.preferences = new Et({ optimalLineLength: 65 });
7110
7127
  }
7111
7128
  updatePreference(t, e) {
7112
7129
  this.preferences[t] = e;
@@ -7114,7 +7131,7 @@ class ci {
7114
7131
  get backgroundColor() {
7115
7132
  return new S({
7116
7133
  initialValue: this.preferences.backgroundColor,
7117
- effectiveValue: this.settings.backgroundColor || ot.RS__backgroundColor,
7134
+ effectiveValue: this.settings.backgroundColor || st.RS__backgroundColor,
7118
7135
  isEffective: this.preferences.backgroundColor !== null,
7119
7136
  onChange: (t) => {
7120
7137
  this.updatePreference("backgroundColor", t || null);
@@ -7152,15 +7169,15 @@ class ci {
7152
7169
  });
7153
7170
  }
7154
7171
  get darkenFilter() {
7155
- return new U({
7172
+ return new y({
7156
7173
  initialValue: typeof this.preferences.darkenFilter == "boolean" ? 100 : this.preferences.darkenFilter,
7157
7174
  effectiveValue: typeof this.settings.darkenFilter == "boolean" ? 100 : this.settings.darkenFilter || 0,
7158
7175
  isEffective: this.settings.darkenFilter !== null,
7159
7176
  onChange: (t) => {
7160
7177
  this.updatePreference("darkenFilter", t || null);
7161
7178
  },
7162
- supportedRange: rt.range,
7163
- step: rt.step
7179
+ supportedRange: nt.range,
7180
+ step: nt.step
7164
7181
  });
7165
7182
  }
7166
7183
  get deprecatedFontSize() {
@@ -7184,15 +7201,15 @@ class ci {
7184
7201
  });
7185
7202
  }
7186
7203
  get fontSize() {
7187
- return new U({
7204
+ return new y({
7188
7205
  initialValue: this.preferences.fontSize,
7189
7206
  effectiveValue: this.settings.fontSize || 1,
7190
7207
  isEffective: this.layout !== B.fixed,
7191
7208
  onChange: (t) => {
7192
7209
  this.updatePreference("fontSize", t || null);
7193
7210
  },
7194
- supportedRange: bt.range,
7195
- step: bt.step
7211
+ supportedRange: jt.range,
7212
+ step: jt.step
7196
7213
  });
7197
7214
  }
7198
7215
  get fontSizeNormalize() {
@@ -7216,27 +7233,27 @@ class ci {
7216
7233
  });
7217
7234
  }
7218
7235
  get fontWeight() {
7219
- return new U({
7236
+ return new y({
7220
7237
  initialValue: this.preferences.fontWeight,
7221
7238
  effectiveValue: this.settings.fontWeight || 400,
7222
7239
  isEffective: this.layout !== B.fixed && this.preferences.fontWeight !== null,
7223
7240
  onChange: (t) => {
7224
7241
  this.updatePreference("fontWeight", t || null);
7225
7242
  },
7226
- supportedRange: tt.range,
7227
- step: tt.step
7243
+ supportedRange: $.range,
7244
+ step: $.step
7228
7245
  });
7229
7246
  }
7230
7247
  get fontWidth() {
7231
- return new U({
7248
+ return new y({
7232
7249
  initialValue: this.preferences.fontWidth,
7233
7250
  effectiveValue: this.settings.fontWidth || 100,
7234
7251
  isEffective: this.layout !== B.fixed && this.preferences.fontWidth !== null,
7235
7252
  onChange: (t) => {
7236
7253
  this.updatePreference("fontWidth", t || null);
7237
7254
  },
7238
- supportedRange: Vt.range,
7239
- step: Vt.step
7255
+ supportedRange: bt.range,
7256
+ step: bt.step
7240
7257
  });
7241
7258
  }
7242
7259
  get hyphens() {
@@ -7250,27 +7267,27 @@ class ci {
7250
7267
  });
7251
7268
  }
7252
7269
  get invertFilter() {
7253
- return new U({
7270
+ return new y({
7254
7271
  initialValue: typeof this.preferences.invertFilter == "boolean" ? 100 : this.preferences.invertFilter,
7255
7272
  effectiveValue: typeof this.settings.invertFilter == "boolean" ? 100 : this.settings.invertFilter || 0,
7256
7273
  isEffective: this.settings.invertFilter !== null,
7257
7274
  onChange: (t) => {
7258
7275
  this.updatePreference("invertFilter", t || null);
7259
7276
  },
7260
- supportedRange: rt.range,
7261
- step: rt.step
7277
+ supportedRange: nt.range,
7278
+ step: nt.step
7262
7279
  });
7263
7280
  }
7264
7281
  get invertGaijiFilter() {
7265
- return new U({
7282
+ return new y({
7266
7283
  initialValue: typeof this.preferences.invertGaijiFilter == "boolean" ? 100 : this.preferences.invertGaijiFilter,
7267
7284
  effectiveValue: typeof this.settings.invertGaijiFilter == "boolean" ? 100 : this.settings.invertGaijiFilter || 0,
7268
7285
  isEffective: this.preferences.invertGaijiFilter !== null,
7269
7286
  onChange: (t) => {
7270
7287
  this.updatePreference("invertGaijiFilter", t || null);
7271
7288
  },
7272
- supportedRange: rt.range,
7273
- step: rt.step
7289
+ supportedRange: nt.range,
7290
+ step: nt.step
7274
7291
  });
7275
7292
  }
7276
7293
  get iOSPatch() {
@@ -7294,15 +7311,15 @@ class ci {
7294
7311
  });
7295
7312
  }
7296
7313
  get letterSpacing() {
7297
- return new U({
7314
+ return new y({
7298
7315
  initialValue: this.preferences.letterSpacing,
7299
7316
  effectiveValue: this.settings.letterSpacing || 0,
7300
7317
  isEffective: this.layout !== B.fixed && this.preferences.letterSpacing !== null,
7301
7318
  onChange: (t) => {
7302
7319
  this.updatePreference("letterSpacing", t || null);
7303
7320
  },
7304
- supportedRange: Pt.range,
7305
- step: Pt.step
7321
+ supportedRange: Vt.range,
7322
+ step: Vt.step
7306
7323
  });
7307
7324
  }
7308
7325
  get ligatures() {
@@ -7316,21 +7333,21 @@ class ci {
7316
7333
  });
7317
7334
  }
7318
7335
  get lineHeight() {
7319
- return new U({
7336
+ return new y({
7320
7337
  initialValue: this.preferences.lineHeight,
7321
7338
  effectiveValue: this.settings.lineHeight,
7322
7339
  isEffective: this.layout !== B.fixed && this.preferences.lineHeight !== null,
7323
7340
  onChange: (t) => {
7324
7341
  this.updatePreference("lineHeight", t || null);
7325
7342
  },
7326
- supportedRange: vt.range,
7327
- step: vt.step
7343
+ supportedRange: Pt.range,
7344
+ step: Pt.step
7328
7345
  });
7329
7346
  }
7330
7347
  get linkColor() {
7331
7348
  return new S({
7332
7349
  initialValue: this.preferences.linkColor,
7333
- effectiveValue: this.settings.linkColor || ot.RS__linkColor,
7350
+ effectiveValue: this.settings.linkColor || st.RS__linkColor,
7334
7351
  isEffective: this.layout !== B.fixed && this.preferences.linkColor !== null,
7335
7352
  onChange: (t) => {
7336
7353
  this.updatePreference("linkColor", t || null);
@@ -7338,27 +7355,27 @@ class ci {
7338
7355
  });
7339
7356
  }
7340
7357
  get maximalLineLength() {
7341
- return new U({
7358
+ return new y({
7342
7359
  initialValue: this.preferences.maximalLineLength,
7343
7360
  effectiveValue: this.settings.maximalLineLength,
7344
7361
  isEffective: this.layout !== B.fixed,
7345
7362
  onChange: (t) => {
7346
7363
  this.updatePreference("maximalLineLength", t);
7347
7364
  },
7348
- supportedRange: st.range,
7349
- step: st.step
7365
+ supportedRange: rt.range,
7366
+ step: rt.step
7350
7367
  });
7351
7368
  }
7352
7369
  get minimalLineLength() {
7353
- return new U({
7370
+ return new y({
7354
7371
  initialValue: this.preferences.minimalLineLength,
7355
7372
  effectiveValue: this.settings.minimalLineLength,
7356
7373
  isEffective: this.layout !== B.fixed,
7357
7374
  onChange: (t) => {
7358
7375
  this.updatePreference("minimalLineLength", t);
7359
7376
  },
7360
- supportedRange: st.range,
7361
- step: st.step
7377
+ supportedRange: rt.range,
7378
+ step: rt.step
7362
7379
  });
7363
7380
  }
7364
7381
  get noRuby() {
@@ -7372,15 +7389,15 @@ class ci {
7372
7389
  });
7373
7390
  }
7374
7391
  get optimalLineLength() {
7375
- return new U({
7392
+ return new y({
7376
7393
  initialValue: this.preferences.optimalLineLength,
7377
7394
  effectiveValue: this.settings.optimalLineLength,
7378
7395
  isEffective: this.layout !== B.fixed,
7379
7396
  onChange: (t) => {
7380
7397
  this.updatePreference("optimalLineLength", t);
7381
7398
  },
7382
- supportedRange: st.range,
7383
- step: st.step
7399
+ supportedRange: rt.range,
7400
+ step: rt.step
7384
7401
  });
7385
7402
  }
7386
7403
  get pageGutter() {
@@ -7394,27 +7411,27 @@ class ci {
7394
7411
  });
7395
7412
  }
7396
7413
  get paragraphIndent() {
7397
- return new U({
7414
+ return new y({
7398
7415
  initialValue: this.preferences.paragraphIndent,
7399
7416
  effectiveValue: this.settings.paragraphIndent || 0,
7400
7417
  isEffective: this.layout !== B.fixed && this.preferences.paragraphIndent !== null,
7401
7418
  onChange: (t) => {
7402
7419
  this.updatePreference("paragraphIndent", t || null);
7403
7420
  },
7404
- supportedRange: Dt.range,
7405
- step: Dt.step
7421
+ supportedRange: vt.range,
7422
+ step: vt.step
7406
7423
  });
7407
7424
  }
7408
7425
  get paragraphSpacing() {
7409
- return new U({
7426
+ return new y({
7410
7427
  initialValue: this.preferences.paragraphSpacing,
7411
7428
  effectiveValue: this.settings.paragraphSpacing || 0,
7412
7429
  isEffective: this.layout !== B.fixed && this.preferences.paragraphSpacing !== null,
7413
7430
  onChange: (t) => {
7414
7431
  this.updatePreference("paragraphSpacing", t || null);
7415
7432
  },
7416
- supportedRange: Ht.range,
7417
- step: Ht.step
7433
+ supportedRange: Dt.range,
7434
+ step: Dt.step
7418
7435
  });
7419
7436
  }
7420
7437
  get scroll() {
@@ -7473,7 +7490,7 @@ class ci {
7473
7490
  get selectionBackgroundColor() {
7474
7491
  return new S({
7475
7492
  initialValue: this.preferences.selectionBackgroundColor,
7476
- effectiveValue: this.settings.selectionBackgroundColor || ot.RS__selectionBackgroundColor,
7493
+ effectiveValue: this.settings.selectionBackgroundColor || st.RS__selectionBackgroundColor,
7477
7494
  isEffective: this.layout !== B.fixed && this.preferences.selectionBackgroundColor !== null,
7478
7495
  onChange: (t) => {
7479
7496
  this.updatePreference("selectionBackgroundColor", t || null);
@@ -7483,7 +7500,7 @@ class ci {
7483
7500
  get selectionTextColor() {
7484
7501
  return new S({
7485
7502
  initialValue: this.preferences.selectionTextColor,
7486
- effectiveValue: this.settings.selectionTextColor || ot.RS__selectionTextColor,
7503
+ effectiveValue: this.settings.selectionTextColor || st.RS__selectionTextColor,
7487
7504
  isEffective: this.layout !== B.fixed && this.preferences.selectionTextColor !== null,
7488
7505
  onChange: (t) => {
7489
7506
  this.updatePreference("selectionTextColor", t || null);
@@ -7493,18 +7510,18 @@ class ci {
7493
7510
  get textAlign() {
7494
7511
  return new Ki({
7495
7512
  initialValue: this.preferences.textAlign,
7496
- effectiveValue: this.settings.textAlign || Z.start,
7513
+ effectiveValue: this.settings.textAlign || X.start,
7497
7514
  isEffective: this.layout !== B.fixed && this.preferences.textAlign !== null,
7498
7515
  onChange: (t) => {
7499
7516
  this.updatePreference("textAlign", t || null);
7500
7517
  },
7501
- supportedValues: Object.values(Z)
7518
+ supportedValues: Object.values(X)
7502
7519
  });
7503
7520
  }
7504
7521
  get textColor() {
7505
7522
  return new S({
7506
7523
  initialValue: this.preferences.textColor,
7507
- effectiveValue: this.settings.textColor || ot.RS__textColor,
7524
+ effectiveValue: this.settings.textColor || st.RS__textColor,
7508
7525
  isEffective: this.layout !== B.fixed && this.preferences.textColor !== null,
7509
7526
  onChange: (t) => {
7510
7527
  this.updatePreference("textColor", t || null);
@@ -7524,7 +7541,7 @@ class ci {
7524
7541
  get visitedColor() {
7525
7542
  return new S({
7526
7543
  initialValue: this.preferences.visitedColor,
7527
- effectiveValue: this.settings.visitedColor || ot.RS__visitedColor,
7544
+ effectiveValue: this.settings.visitedColor || st.RS__visitedColor,
7528
7545
  isEffective: this.layout !== B.fixed && this.preferences.visitedColor !== null,
7529
7546
  onChange: (t) => {
7530
7547
  this.updatePreference("visitedColor", t || null);
@@ -7532,28 +7549,28 @@ class ci {
7532
7549
  });
7533
7550
  }
7534
7551
  get wordSpacing() {
7535
- return new U({
7552
+ return new y({
7536
7553
  initialValue: this.preferences.wordSpacing,
7537
7554
  effectiveValue: this.settings.wordSpacing || 0,
7538
7555
  isEffective: this.layout !== B.fixed && this.preferences.wordSpacing !== null,
7539
7556
  onChange: (t) => {
7540
7557
  this.updatePreference("wordSpacing", t || null);
7541
7558
  },
7542
- supportedRange: Gt.range,
7543
- step: Gt.step
7559
+ supportedRange: Ht.range,
7560
+ step: Ht.step
7544
7561
  });
7545
7562
  }
7546
7563
  }
7547
- class gi {
7564
+ class ci {
7548
7565
  constructor(t, e) {
7549
- 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 ? (J.OS.iOS || J.OS.iPadOS) && J.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? J.OS.iPadOS && J.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.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null;
7566
+ 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 ? (k.OS.iOS || k.OS.iPadOS) && k.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? k.OS.iPadOS && k.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.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null;
7550
7567
  }
7551
7568
  }
7552
- function Qt(r) {
7569
+ function St(r) {
7553
7570
  const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
7554
7571
  return r.clientWidth - e - i;
7555
7572
  }
7556
- class $i extends Se {
7573
+ class $i extends Ce {
7557
7574
  constructor(t) {
7558
7575
  super(), this.a11yNormalize = t.a11yNormalize ?? 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;
7559
7576
  }
@@ -7562,7 +7579,7 @@ class $i extends Se {
7562
7579
  return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), 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;
7563
7580
  }
7564
7581
  }
7565
- class Kn extends Se {
7582
+ class Kn extends Ce {
7566
7583
  constructor(t) {
7567
7584
  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;
7568
7585
  }
@@ -7573,7 +7590,7 @@ class Kn extends Se {
7573
7590
  }
7574
7591
  class qn {
7575
7592
  constructor(t) {
7576
- 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 = Qt(this.containerParent);
7593
+ 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 = St(this.containerParent);
7577
7594
  }
7578
7595
  update(t) {
7579
7596
  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({
@@ -7640,7 +7657,7 @@ class qn {
7640
7657
  // TODO: As scroll shows, the effective line-length
7641
7658
  // should be the same as uncompensated when scale >= 1
7642
7659
  paginate(t, e, i) {
7643
- const A = Math.round(Qt(this.containerParent) - this.constraint), n = this.getCompensatedMetrics(t, e), { zoomCompensation: s, optimal: o, minimal: a, maximal: h } = n, c = () => A >= o && h !== null ? Math.min(Math.round(h * s), A) : A;
7660
+ const A = Math.round(St(this.containerParent) - this.constraint), n = this.getCompensatedMetrics(t, e), { zoomCompensation: s, optimal: o, minimal: a, maximal: h } = n, c = () => A >= o && h !== null ? Math.min(Math.round(h * s), A) : A;
7644
7661
  let g = 1, d = A;
7645
7662
  if (i === void 0)
7646
7663
  return {
@@ -7686,7 +7703,7 @@ class qn {
7686
7703
  }
7687
7704
  // This behaves as paginate where colCount = 1
7688
7705
  computeScrollLength(t, e) {
7689
- const i = Math.round(Qt(this.containerParent) - this.constraint), A = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), n = A.zoomCompensation, s = A.optimal, o = A.maximal;
7706
+ const i = Math.round(St(this.containerParent) - this.constraint), A = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), n = A.zoomCompensation, s = A.optimal, o = A.maximal;
7690
7707
  let a, h = i, c = Math.round(s * n);
7691
7708
  if (o === null)
7692
7709
  c = i;
@@ -7733,7 +7750,7 @@ class tA extends wi {
7733
7750
  readingOrder: [],
7734
7751
  progressions: /* @__PURE__ */ new Map(),
7735
7752
  positions: null
7736
- }, this.pub = e, this.container = t, this.listeners = _n(i), this.currentLocation = n, A.length && (this.positions = A), this._preferences = new It(s.preferences), this._defaults = new kn(s.defaults), this._settings = new gi(this._preferences, this._defaults), this._css = new qn({
7753
+ }, this.pub = e, this.container = t, this.listeners = _n(i), this.currentLocation = n, A.length && (this.positions = A), this._preferences = new Et(s.preferences), this._defaults = new kn(s.defaults), this._settings = new ci(this._preferences, this._defaults), this._css = new qn({
7737
7754
  rsProperties: new Kn({}),
7738
7755
  userProperties: new $i({}),
7739
7756
  lineLengths: new pt({
@@ -7775,14 +7792,14 @@ class tA extends wi {
7775
7792
  }
7776
7793
  }
7777
7794
  get preferencesEditor() {
7778
- return this._preferencesEditor === null && (this._preferencesEditor = new ci(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
7795
+ return this._preferencesEditor === null && (this._preferencesEditor = new hi(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
7779
7796
  }
7780
7797
  async submitPreferences(t) {
7781
7798
  this._preferences = this._preferences.merging(t), await this.applyPreferences();
7782
7799
  }
7783
7800
  async applyPreferences() {
7784
7801
  const t = this._settings;
7785
- this._settings = new gi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new ci(this._preferences, this.settings, this.pub.metadata)), this._layout === B.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
7802
+ this._settings = new ci(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new hi(this._preferences, this.settings, this.pub.metadata)), this._layout === B.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
7786
7803
  }
7787
7804
  // TODO: fit, etc.
7788
7805
  handleFXLPrefs(t, e) {
@@ -7806,7 +7823,7 @@ class tA extends wi {
7806
7823
  async resizeHandler() {
7807
7824
  const t = this.container.parentElement || document.documentElement;
7808
7825
  if (this._layout === B.fixed)
7809
- this.container.style.width = `${Qt(t) - this._settings.constraint}px`, this.framePool.resizeHandler();
7826
+ this.container.style.width = `${St(t) - this._settings.constraint}px`, this.framePool.resizeHandler();
7810
7827
  else {
7811
7828
  const e = this._css.userProperties.colCount, i = this._css.userProperties.lineLength;
7812
7829
  this._css.resizeHandler(), (this._css.userProperties.view !== "scroll" && e !== this._css.userProperties.colCount || i !== this._css.userProperties.lineLength) && await this.commitCSS(this._css);
@@ -7843,9 +7860,9 @@ class tA extends wi {
7843
7860
  this.listeners.frameLoaded(this._cframes[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
7844
7861
  break;
7845
7862
  case "first_visible_locator":
7846
- const i = ct.deserialize(e);
7863
+ const i = ht.deserialize(e);
7847
7864
  if (!i) break;
7848
- this.currentLocation = new ct({
7865
+ this.currentLocation = new ht({
7849
7866
  href: this.currentLocation.href,
7850
7867
  type: this.currentLocation.type,
7851
7868
  title: this.currentLocation.title,
@@ -7872,17 +7889,17 @@ class tA extends wi {
7872
7889
  }), !1, () => {
7873
7890
  });
7874
7891
  else if (s.startsWith("http://") || s.startsWith("https://") || s.startsWith("mailto:") || s.startsWith("tel:"))
7875
- this.listeners.handleLocator(new _({
7892
+ this.listeners.handleLocator(new q({
7876
7893
  href: s
7877
7894
  }).locator);
7878
7895
  else
7879
7896
  try {
7880
- this.goLink(new _({
7881
- href: jt.join(jt.dirname(this.currentLocation.href), s)
7897
+ this.goLink(new q({
7898
+ href: Tt.join(Tt.dirname(this.currentLocation.href), s)
7882
7899
  }), !1, () => {
7883
7900
  });
7884
7901
  } catch (o) {
7885
- console.warn(`Couldn't go to link for ${s}: ${o}`), this.listeners.handleLocator(new _({
7902
+ console.warn(`Couldn't go to link for ${s}: ${o}`), this.listeners.handleLocator(new q({
7886
7903
  href: s
7887
7904
  }).locator);
7888
7905
  }
@@ -7928,7 +7945,7 @@ class tA extends wi {
7928
7945
  }
7929
7946
  }
7930
7947
  determineModules() {
7931
- let t = Array.from(Tt.keys());
7948
+ let t = Array.from(xt.keys());
7932
7949
  return this._layout === B.fixed ? t.filter((e) => rn.includes(e)) : (t = t.filter((e) => sn.includes(e)), this._layout === B.scrolled ? t = t.filter((e) => e !== "column_snapper") : t = t.filter((e) => e !== "scroll_snapper"), t);
7933
7950
  }
7934
7951
  // Start listening to messages from the current iframe
@@ -8301,64 +8318,64 @@ export {
8301
8318
  Ki as EnumPreference,
8302
8319
  kn as EpubDefaults,
8303
8320
  tA as EpubNavigator,
8304
- It as EpubPreferences,
8305
- ci as EpubPreferencesEditor,
8306
- gi as EpubSettings,
8321
+ Et as EpubPreferences,
8322
+ hi as EpubPreferencesEditor,
8323
+ ci as EpubSettings,
8307
8324
  er as ExperimentalWebPubNavigator,
8308
8325
  xn as FXLCoordinator,
8309
8326
  zn as FXLFrameManager,
8310
8327
  Gn as FXLFramePoolManager,
8311
8328
  jn as FXLPeripherals,
8312
8329
  bn as FXLSpreader,
8313
- wt as FrameComms,
8330
+ Bt as FrameComms,
8314
8331
  Sn as FrameManager,
8315
8332
  Qn as FramePoolManager,
8316
8333
  Yn as HorizontalThird,
8317
8334
  pt as LineLengths,
8318
8335
  gA as Navigator,
8319
- le as Orientation,
8336
+ ae as Orientation,
8320
8337
  S as Preference,
8321
- Se as Properties,
8338
+ Ce as Properties,
8322
8339
  Kn as RSProperties,
8323
- U as RangePreference,
8340
+ y as RangePreference,
8324
8341
  qn as ReadiumCSS,
8325
- he as Spread,
8326
- Z as TextAlignment,
8342
+ le as Spread,
8343
+ X as TextAlignment,
8327
8344
  $i as UserProperties,
8328
8345
  Nn as VerticalThird,
8329
8346
  wi as VisualNavigator,
8330
8347
  ir as WebAudioEngine,
8331
8348
  BA as WebPubBlobBuilder,
8332
- fn as WebPubCSS,
8349
+ pn as WebPubCSS,
8333
8350
  Bn as WebPubDefaults,
8334
8351
  dn as WebPubFrameManager,
8335
8352
  un as WebPubFramePoolManager,
8336
8353
  En as WebPubNavigator,
8337
- Et as WebPubPreferences,
8338
- ni as WebPubPreferencesEditor,
8339
- Ai as WebPubSettings,
8354
+ wt as WebPubPreferences,
8355
+ Ai as WebPubPreferencesEditor,
8356
+ ii as WebPubSettings,
8340
8357
  Zi as WebUserProperties,
8341
8358
  F as ensureBoolean,
8342
- Ot as ensureEnumValue,
8343
- dt as ensureFilter,
8344
- pn as ensureLessThanOrEqual,
8359
+ Lt as ensureEnumValue,
8360
+ gt as ensureFilter,
8361
+ fn as ensureLessThanOrEqual,
8345
8362
  Mn as ensureMoreThanOrEqual,
8346
8363
  I as ensureNonNegative,
8347
8364
  Q as ensureString,
8348
- W as ensureValueInRange,
8349
- rt as filterRangeConfig,
8350
- bt as fontSizeRangeConfig,
8351
- tt as fontWeightRangeConfig,
8352
- Vt as fontWidthRangeConfig,
8353
- Pt as letterSpacingRangeConfig,
8354
- vt as lineHeightRangeConfig,
8355
- st as lineLengthRangeConfig,
8356
- Dt as paragraphIndentRangeConfig,
8357
- Ht as paragraphSpacingRangeConfig,
8358
- Mt as sML,
8359
- J as sMLWithRequest,
8365
+ J as ensureValueInRange,
8366
+ nt as filterRangeConfig,
8367
+ jt as fontSizeRangeConfig,
8368
+ $ as fontWeightRangeConfig,
8369
+ bt as fontWidthRangeConfig,
8370
+ Vt as letterSpacingRangeConfig,
8371
+ Pt as lineHeightRangeConfig,
8372
+ rt as lineLengthRangeConfig,
8373
+ vt as paragraphIndentRangeConfig,
8374
+ Dt as paragraphSpacingRangeConfig,
8375
+ ft as sML,
8376
+ k as sMLWithRequest,
8360
8377
  dA as webPubStylesheet,
8361
- qt as withFallback,
8362
- Gt as wordSpacingRangeConfig,
8363
- kt as zoomRangeConfig
8378
+ Kt as withFallback,
8379
+ Ht as wordSpacingRangeConfig,
8380
+ Gt as zoomRangeConfig
8364
8381
  };