@readium/shared 2.2.0-beta.2 → 2.2.0-beta.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
@@ -116,12 +116,12 @@ class V {
116
116
  const e = t;
117
117
  return new V({
118
118
  conformsTo: e.conformsTo ? e.conformsTo.map((i) => It.deserialize(i)).filter((i) => i !== void 0) : void 0,
119
- certification: e.certification ? Pt.deserialize(e.certification) : void 0,
119
+ certification: e.certification ? kt.deserialize(e.certification) : void 0,
120
120
  summary: e.summary,
121
- accessMode: e.accessMode ? e.accessMode.map((i) => k.deserialize(i)).filter((i) => i !== void 0) : void 0,
121
+ accessMode: e.accessMode ? e.accessMode.map((i) => R.deserialize(i)).filter((i) => i !== void 0) : void 0,
122
122
  accessModeSufficient: e.accessModeSufficient ? e.accessModeSufficient.map((i) => xt.deserialize(i)).filter((i) => i !== void 0) : void 0,
123
123
  feature: e.feature ? e.feature.map((i) => v.deserialize(i)).filter((i) => i !== void 0) : void 0,
124
- hazard: e.hazard ? e.hazard.map((i) => P.deserialize(i)).filter((i) => i !== void 0) : void 0,
124
+ hazard: e.hazard ? e.hazard.map((i) => k.deserialize(i)).filter((i) => i !== void 0) : void 0,
125
125
  exemption: e.exemption ? e.exemption.map((i) => Nt.deserialize(i)).filter((i) => i !== void 0) : void 0
126
126
  });
127
127
  }
@@ -171,7 +171,7 @@ const b = class b {
171
171
  };
172
172
  b.EPUB_A11Y_10_WCAG_20_A = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), b.EPUB_A11Y_10_WCAG_20_AA = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), b.EPUB_A11Y_10_WCAG_20_AAA = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), b.EPUB_A11Y_11_WCAG_20_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), b.EPUB_A11Y_11_WCAG_20_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), b.EPUB_A11Y_11_WCAG_20_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), b.EPUB_A11Y_11_WCAG_21_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), b.EPUB_A11Y_11_WCAG_21_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), b.EPUB_A11Y_11_WCAG_21_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), b.EPUB_A11Y_11_WCAG_22_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), b.EPUB_A11Y_11_WCAG_22_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), b.EPUB_A11Y_11_WCAG_22_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
173
173
  let It = b;
174
- class Pt {
174
+ class kt {
175
175
  constructor(t = null, e = null, i = null) {
176
176
  this.certifiedBy = t, this.credential = e, this.report = i;
177
177
  }
@@ -180,7 +180,7 @@ class Pt {
180
180
  */
181
181
  static deserialize(t) {
182
182
  if (!(!t || typeof t != "object"))
183
- return new Pt(
183
+ return new kt(
184
184
  t.certifiedBy,
185
185
  t.credential,
186
186
  t.report
@@ -213,16 +213,16 @@ const y = class y {
213
213
  }
214
214
  };
215
215
  y.AUDITORY = new y("auditory"), y.CHART_ON_VISUAL = new y("chartOnVisual"), y.CHEM_ON_VISUAL = new y("chemOnVisual"), y.COLOR_DEPENDENT = new y("colorDependent"), y.DIAGRAM_ON_VISUAL = new y("diagramOnVisual"), y.MATH_ON_VISUAL = new y("mathOnVisual"), y.MUSIC_ON_VISUAL = new y("musicOnVisual"), y.TACTILE = new y("tactile"), y.TEXT_ON_VISUAL = new y("textOnVisual"), y.TEXTUAL = new y("textual"), y.VISUAL = new y("visual");
216
- let k = y;
217
- const L = class L {
216
+ let R = y;
217
+ const N = class N {
218
218
  constructor(t) {
219
219
  if (typeof t == "string") {
220
- if (!L.VALID_MODES.has(t.toLowerCase()))
220
+ if (!N.VALID_MODES.has(t.toLowerCase()))
221
221
  return;
222
222
  this.value = t.toLowerCase();
223
223
  } else {
224
224
  const e = t.filter(
225
- (i) => L.VALID_MODES.has(i.toLowerCase())
225
+ (i) => N.VALID_MODES.has(i.toLowerCase())
226
226
  );
227
227
  if (e.length === 0)
228
228
  return;
@@ -235,11 +235,11 @@ const L = class L {
235
235
  static deserialize(t) {
236
236
  if (!t) return;
237
237
  if (typeof t == "string")
238
- return new L(t);
238
+ return new N(t);
239
239
  if (!Array.isArray(t)) return;
240
- const e = t.filter((i) => i ? L.VALID_MODES.has(i.toLowerCase()) : !1);
240
+ const e = t.filter((i) => i ? N.VALID_MODES.has(i.toLowerCase()) : !1);
241
241
  if (e.length !== 0)
242
- return new L(e);
242
+ return new N(e);
243
243
  }
244
244
  /**
245
245
  * Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
@@ -248,8 +248,8 @@ const L = class L {
248
248
  return this.value;
249
249
  }
250
250
  };
251
- 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");
252
- let xt = L;
251
+ N.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), N.AUDITORY = new N("auditory"), N.TACTILE = new N("tactile"), N.TEXTUAL = new N("textual"), N.VISUAL = new N("visual");
252
+ let xt = N;
253
253
  const l = class l {
254
254
  constructor(t) {
255
255
  this.value = t;
@@ -289,7 +289,7 @@ const w = class w {
289
289
  }
290
290
  };
291
291
  w.FLASHING = new w("flashing"), w.NO_FLASHING_HAZARD = new w("noFlashingHazard"), w.UNKNOWN_FLASHING_HAZARD = new w("unknownFlashingHazard"), w.MOTION_SIMULATION = new w("motionSimulation"), w.NO_MOTION_SIMULATION_HAZARD = new w("noMotionSimulationHazard"), w.UNKNOWN_MOTION_SIMULATION_HAZARD = new w("unknownMotionSimulationHazard"), w.SOUND = new w("sound"), w.NO_SOUND_HAZARD = new w("noSoundHazard"), w.UNKNOWN_SOUND_HAZARD = new w("unknownSoundHazard"), w.UNKNOWN = new w("unknown"), w.NONE = new w("none");
292
- let P = w;
292
+ let k = w;
293
293
  const S = class S {
294
294
  constructor(t) {
295
295
  this.value = t;
@@ -415,11 +415,11 @@ class Dt {
415
415
  });
416
416
  let h = "";
417
417
  e === "readable" ? h = "ways-of-reading.nonvisual-reading.readable" : e === "notFully" ? h = "ways-of-reading.nonvisual-reading.not-fully" : e === "unreadable" ? h = "ways-of-reading.nonvisual-reading.none" : e === "noMetadata" && (h = "ways-of-reading.nonvisual-reading.no-metadata");
418
- const m = f.getString(h);
418
+ const p = f.getString(h);
419
419
  if (this.statements.push({
420
420
  id: h,
421
- compactString: m.compact,
422
- descriptiveString: m.descriptive
421
+ compactString: p.compact,
422
+ descriptiveString: p.descriptive
423
423
  }), i) {
424
424
  const g = f.getString("ways-of-reading.nonvisual-reading.alt-text");
425
425
  this.statements.push({
@@ -428,39 +428,39 @@ class Dt {
428
428
  descriptiveString: g.descriptive
429
429
  });
430
430
  }
431
- let p = "";
432
- r === "synchronized" ? p = "ways-of-reading.prerecorded-audio.synchronized" : r === "audioOnly" ? p = "ways-of-reading.prerecorded-audio.only" : r === "audioComplementary" ? p = "ways-of-reading.prerecorded-audio.complementary" : r === "noMetadata" && (p = "ways-of-reading.prerecorded-audio.no-metadata");
433
- const u = f.getString(p);
431
+ let m = "";
432
+ r === "synchronized" ? m = "ways-of-reading.prerecorded-audio.synchronized" : r === "audioOnly" ? m = "ways-of-reading.prerecorded-audio.only" : r === "audioComplementary" ? m = "ways-of-reading.prerecorded-audio.complementary" : r === "noMetadata" && (m = "ways-of-reading.prerecorded-audio.no-metadata");
433
+ const u = f.getString(m);
434
434
  this.statements.push({
435
- id: p,
435
+ id: m,
436
436
  compactString: u.compact,
437
437
  descriptiveString: u.descriptive
438
438
  });
439
439
  }
440
440
  static fromPublication(t) {
441
- const e = t.metadata.accessibility ?? new V(), i = e.feature ?? [], r = t.metadata.layout === X.fixed, n = i.some((d) => d.value === v.DISPLAY_TRANSFORMABILITY.value) ? "modifiable" : r ? "unmodifiable" : "unknown", a = e.accessMode ?? [], o = e.accessModeSufficient ?? [], h = a.length > 0 && a.every((d) => d.value === k.TEXTUAL.value) || o.some((d) => {
442
- const x = d.value;
443
- return Array.isArray(x) ? x.every((G) => G === k.TEXTUAL.value) : x === k.TEXTUAL.value;
444
- }), m = a.some((d) => d.value === k.TEXTUAL.value) || o.some((d) => {
445
- const x = d.value;
446
- return Array.isArray(x) ? x.some((G) => G === k.TEXTUAL.value) : x === k.TEXTUAL.value;
447
- }), p = !(a.length === 0 && o.length === 0) && !a.some((d) => d.value === k.TEXTUAL.value) && !o.some((d) => {
448
- const x = d.value;
449
- return Array.isArray(x) ? x.some((G) => G === k.TEXTUAL.value) : x === k.TEXTUAL.value;
441
+ const e = t.metadata.accessibility ?? new V(), i = e.feature ?? [], r = t.metadata.layout === X.fixed, n = i.some((d) => d.value === v.DISPLAY_TRANSFORMABILITY.value) ? "modifiable" : r ? "unmodifiable" : "unknown", a = e.accessMode ?? [], o = e.accessModeSufficient ?? [], h = a.length > 0 && a.every((d) => d.value === R.TEXTUAL.value) || o.some((d) => {
442
+ const I = d.value;
443
+ return Array.isArray(I) ? I.every((G) => G === R.TEXTUAL.value) : I === R.TEXTUAL.value;
444
+ }), p = a.some((d) => d.value === R.TEXTUAL.value) || o.some((d) => {
445
+ const I = d.value;
446
+ return Array.isArray(I) ? I.some((G) => G === R.TEXTUAL.value) : I === R.TEXTUAL.value;
447
+ }), m = !(a.length === 0 && o.length === 0) && !a.some((d) => d.value === R.TEXTUAL.value) && !o.some((d) => {
448
+ const I = d.value;
449
+ return Array.isArray(I) ? I.some((G) => G === R.TEXTUAL.value) : I === R.TEXTUAL.value;
450
450
  }), u = i.some((d) => [
451
451
  v.LONG_DESCRIPTION.value,
452
452
  v.ALTERNATIVE_TEXT.value,
453
453
  v.DESCRIBED_MATH.value,
454
454
  v.TRANSCRIPT.value
455
- ].includes(d.value)), g = h ? "readable" : m || u ? "notFully" : p ? "unreadable" : "noMetadata", A = u, N = i.some((d) => d.value === v.SYNCHRONIZED_AUDIO_TEXT.value) ? "synchronized" : o.some((d) => {
456
- const x = d.value;
457
- return Array.isArray(x) ? x.some((G) => G === k.AUDITORY.value) : x === k.AUDITORY.value;
458
- }) ? "audioOnly" : a.some((d) => d.value === k.AUDITORY.value) ? "audioComplementary" : "noMetadata";
455
+ ].includes(d.value)), g = h ? "readable" : p || u ? "notFully" : m ? "unreadable" : "noMetadata", A = u, P = i.some((d) => d.value === v.SYNCHRONIZED_AUDIO_TEXT.value) ? "synchronized" : o.some((d) => {
456
+ const I = d.value;
457
+ return Array.isArray(I) ? I.some((G) => G === R.AUDITORY.value) : I === R.AUDITORY.value;
458
+ }) ? "audioOnly" : a.some((d) => d.value === R.AUDITORY.value) ? "audioComplementary" : "noMetadata";
459
459
  return new Dt(
460
460
  n,
461
461
  g,
462
462
  A,
463
- N
463
+ P
464
464
  );
465
465
  }
466
466
  }
@@ -521,10 +521,10 @@ class Ut {
521
521
  }
522
522
  var ci = /* @__PURE__ */ ((s) => (s.Math = "math", s.Chemistry = "chemistry", s.Music = "music", s.Diagram = "diagram", s.Chart = "chart", s.Graph = "graph", s.Table = "table", s.Image = "image", s))(ci || {});
523
523
  class Mt {
524
- constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, h = !1, m = !1) {
525
- this.id = "rich-content.title", this.extendedAltTextDescriptions = t, this.mathFormula = e, this.mathFormulaAsMathML = i, this.mathFormulaAsLaTeX = r, this.chemicalFormulaAsMathML = n, this.chemicalFormulaAsLaTeX = a, this.closedCaptions = o, this.openCaptions = h, this.transcript = m, this.noMetadata = !t && !e && !i && !r && !n && !a && !o && !h && !m, this.shouldDisplay = !this.noMetadata;
526
- const p = f.getString(this.id);
527
- if (this.title = p.compact, this.statements = [], t) {
524
+ constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, h = !1, p = !1) {
525
+ this.id = "rich-content.title", this.extendedAltTextDescriptions = t, this.mathFormula = e, this.mathFormulaAsMathML = i, this.mathFormulaAsLaTeX = r, this.chemicalFormulaAsMathML = n, this.chemicalFormulaAsLaTeX = a, this.closedCaptions = o, this.openCaptions = h, this.transcript = p, this.noMetadata = !t && !e && !i && !r && !n && !a && !o && !h && !p, this.shouldDisplay = !this.noMetadata;
526
+ const m = f.getString(this.id);
527
+ if (this.title = m.compact, this.statements = [], t) {
528
528
  const u = f.getString("rich-content.extended-descriptions");
529
529
  this.statements.push({
530
530
  id: "rich-content.extended-descriptions",
@@ -588,7 +588,7 @@ class Mt {
588
588
  descriptiveString: u.descriptive
589
589
  });
590
590
  }
591
- if (m) {
591
+ if (p) {
592
592
  const u = f.getString("rich-content.transcript");
593
593
  this.statements.push({
594
594
  id: "rich-content.transcript",
@@ -621,10 +621,10 @@ class Mt {
621
621
  }
622
622
  }
623
623
  class Bt {
624
- constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, h = !1, m = !1, p = !1, u = !1, g = !1, A = !1) {
625
- this.id = "additional-accessibility-information.title", this.pageBreakMarkers = t, this.aria = e, this.audioDescriptions = i, this.braille = r, this.rubyAnnotations = n, this.fullRubyAnnotations = a, this.highAudioContrast = o, this.highDisplayContrast = h, this.largePrint = m, this.signLanguage = p, this.tactileGraphics = u, this.tactileObjects = g, this.textToSpeechHinting = A, this.noMetadata = !t && !e && !i && !r && !n && !a && !o && !h && !m && !p && !u && !g && !A, this.shouldDisplay = !this.noMetadata;
626
- const N = f.getString(this.id);
627
- if (this.title = N.compact, this.statements = [], t) {
624
+ constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, h = !1, p = !1, m = !1, u = !1, g = !1, A = !1) {
625
+ this.id = "additional-accessibility-information.title", this.pageBreakMarkers = t, this.aria = e, this.audioDescriptions = i, this.braille = r, this.rubyAnnotations = n, this.fullRubyAnnotations = a, this.highAudioContrast = o, this.highDisplayContrast = h, this.largePrint = p, this.signLanguage = m, this.tactileGraphics = u, this.tactileObjects = g, this.textToSpeechHinting = A, this.noMetadata = !t && !e && !i && !r && !n && !a && !o && !h && !p && !m && !u && !g && !A, this.shouldDisplay = !this.noMetadata;
626
+ const P = f.getString(this.id);
627
+ if (this.title = P.compact, this.statements = [], t) {
628
628
  const d = f.getString("additional-accessibility-information.page-breaks");
629
629
  this.statements.push({
630
630
  id: "additional-accessibility-information.page-breaks",
@@ -688,7 +688,7 @@ class Bt {
688
688
  descriptiveString: d.descriptive
689
689
  });
690
690
  }
691
- if (m) {
691
+ if (p) {
692
692
  const d = f.getString("additional-accessibility-information.large-print");
693
693
  this.statements.push({
694
694
  id: "additional-accessibility-information.large-print",
@@ -696,7 +696,7 @@ class Bt {
696
696
  descriptiveString: d.descriptive
697
697
  });
698
698
  }
699
- if (p) {
699
+ if (m) {
700
700
  const d = f.getString("additional-accessibility-information.sign-language");
701
701
  this.statements.push({
702
702
  id: "additional-accessibility-information.sign-language",
@@ -846,13 +846,13 @@ class Gt {
846
846
  static fromPublication(t) {
847
847
  const e = t.metadata.accessibility?.hazard ?? [];
848
848
  let i;
849
- e.some((o) => o.value === P.NONE.value) ? i = "no" : e.some((o) => o.value === P.UNKNOWN.value) ? i = "unknown" : i = "noMetadata";
849
+ e.some((o) => o.value === k.NONE.value) ? i = "no" : e.some((o) => o.value === k.UNKNOWN.value) ? i = "unknown" : i = "noMetadata";
850
850
  let r;
851
- e.some((o) => o.value === P.FLASHING.value) ? r = "yes" : e.some((o) => o.value === P.NO_FLASHING_HAZARD.value) ? r = "no" : e.some((o) => o.value === P.UNKNOWN_FLASHING_HAZARD.value) ? r = "unknown" : r = i;
851
+ e.some((o) => o.value === k.FLASHING.value) ? r = "yes" : e.some((o) => o.value === k.NO_FLASHING_HAZARD.value) ? r = "no" : e.some((o) => o.value === k.UNKNOWN_FLASHING_HAZARD.value) ? r = "unknown" : r = i;
852
852
  let n;
853
- e.some((o) => o.value === P.MOTION_SIMULATION.value) ? n = "yes" : e.some((o) => o.value === P.NO_MOTION_SIMULATION_HAZARD.value) ? n = "no" : e.some((o) => o.value === P.UNKNOWN_MOTION_SIMULATION_HAZARD.value) ? n = "unknown" : n = i;
853
+ e.some((o) => o.value === k.MOTION_SIMULATION.value) ? n = "yes" : e.some((o) => o.value === k.NO_MOTION_SIMULATION_HAZARD.value) ? n = "no" : e.some((o) => o.value === k.UNKNOWN_MOTION_SIMULATION_HAZARD.value) ? n = "unknown" : n = i;
854
854
  let a;
855
- return e.some((o) => o.value === P.SOUND.value) ? a = "yes" : e.some((o) => o.value === P.NO_SOUND_HAZARD.value) ? a = "no" : e.some((o) => o.value === P.UNKNOWN_SOUND_HAZARD.value) ? a = "unknown" : a = i, new Gt(r, n, a);
855
+ return e.some((o) => o.value === k.SOUND.value) ? a = "yes" : e.some((o) => o.value === k.NO_SOUND_HAZARD.value) ? a = "no" : e.some((o) => o.value === k.UNKNOWN_SOUND_HAZARD.value) ? a = "unknown" : a = i, new Gt(r, n, a);
856
856
  }
857
857
  }
858
858
  class Wt {
@@ -995,7 +995,7 @@ class _t {
995
995
  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;
996
996
  }
997
997
  }
998
- var Lt = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.center = "center", s))(Lt || {});
998
+ var Ot = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.center = "center", s))(Ot || {});
999
999
  class U {
1000
1000
  constructor(t) {
1001
1001
  this.otherProperties = t;
@@ -1066,7 +1066,7 @@ function lt(s) {
1066
1066
  function Z(s) {
1067
1067
  return isNaN(s) ? void 0 : s;
1068
1068
  }
1069
- function z(s) {
1069
+ function L(s) {
1070
1070
  return Z(s) !== void 0 && Math.sign(s) >= 0 ? s : void 0;
1071
1071
  }
1072
1072
  function ht(s) {
@@ -1116,19 +1116,19 @@ class c {
1116
1116
  for (let g = 1; g < r.length; g++) {
1117
1117
  const A = r[g].split("=");
1118
1118
  if (A.length === 2) {
1119
- const N = A[0].toLocaleLowerCase(), d = N === "charset" ? A[1].toUpperCase() : A[1];
1120
- a[N] = d;
1119
+ const P = A[0].toLocaleLowerCase(), d = P === "charset" ? A[1].toUpperCase() : A[1];
1120
+ a[P] = d;
1121
1121
  }
1122
1122
  }
1123
1123
  const o = {}, h = Object.keys(a);
1124
1124
  h.sort((g, A) => g.localeCompare(A)), h.forEach((g) => o[g] = a[g]);
1125
- let m = "";
1125
+ let p = "";
1126
1126
  for (const g in o) {
1127
1127
  const A = o[g];
1128
- m += `;${g}=${A}`;
1128
+ p += `;${g}=${A}`;
1129
1129
  }
1130
- const p = `${e}/${i}${m}`, u = o.encoding;
1131
- this.string = p, this.type = e, this.subtype = i, this.parameters = o, this.encoding = u, this.name = t.name, this.fileExtension = t.fileExtension;
1130
+ const m = `${e}/${i}${p}`, u = o.encoding;
1131
+ this.string = m, this.type = e, this.subtype = i, this.parameters = o, this.encoding = u, this.name = t.name, this.fileExtension = t.fileExtension;
1132
1132
  }
1133
1133
  static parse(t) {
1134
1134
  return new c(t);
@@ -1711,14 +1711,14 @@ class M {
1711
1711
  title: t.title,
1712
1712
  rels: t.rel ? Array.isArray(t.rel) ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
1713
1713
  properties: U.deserialize(t.properties),
1714
- height: z(t.height),
1715
- width: z(t.width),
1716
- size: z(t.size),
1717
- duration: z(t.duration),
1718
- bitrate: z(t.bitrate),
1714
+ height: L(t.height),
1715
+ width: L(t.width),
1716
+ size: L(t.size),
1717
+ duration: L(t.duration),
1718
+ bitrate: L(t.bitrate),
1719
1719
  languages: _(t.language),
1720
- alternates: C.deserialize(t.alternate),
1721
- children: C.deserialize(t.children)
1720
+ alternates: z.deserialize(t.alternate),
1721
+ children: z.deserialize(t.children)
1722
1722
  });
1723
1723
  }
1724
1724
  /**
@@ -1776,7 +1776,7 @@ class M {
1776
1776
  });
1777
1777
  }
1778
1778
  }
1779
- class C {
1779
+ class z {
1780
1780
  /**
1781
1781
  * Creates a [Links].
1782
1782
  */
@@ -1788,7 +1788,7 @@ class C {
1788
1788
  */
1789
1789
  static deserialize(t) {
1790
1790
  if (t && Array.isArray(t))
1791
- return new C(
1791
+ return new z(
1792
1792
  t.map((e) => M.deserialize(e)).filter((e) => e !== void 0)
1793
1793
  );
1794
1794
  }
@@ -1941,7 +1941,7 @@ class dt {
1941
1941
  identifier: t.identifier,
1942
1942
  altIdentifiers: t.altIdentifier ? Array.isArray(t.altIdentifier) ? new Set(t.altIdentifier.map((e) => J.deserialize(e)).filter((e) => e !== void 0)) : new Set([J.deserialize(t.altIdentifier)].filter((e) => e !== void 0)) : void 0,
1943
1943
  roles: t.role ? new Set(_(t.role)) : void 0,
1944
- links: C.deserialize(t.links),
1944
+ links: z.deserialize(t.links),
1945
1945
  position: Z(t.position)
1946
1946
  }) : void 0;
1947
1947
  }
@@ -2006,7 +2006,7 @@ class Q {
2006
2006
  }
2007
2007
  var q = /* @__PURE__ */ ((s) => (s.EPUB = "https://readium.org/webpub-manifest/profiles/epub", s.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", s.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", s.PDF = "https://readium.org/webpub-manifest/profiles/pdf", s))(q || {}), F = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(F || {});
2008
2008
  function nr(s) {
2009
- return s === "rtl" ? Lt.right : Lt.left;
2009
+ return s === "rtl" ? Ot.right : Ot.left;
2010
2010
  }
2011
2011
  class ft {
2012
2012
  /** Creates a [Subject]. */
@@ -2027,7 +2027,7 @@ class ft {
2027
2027
  sortAs: t.sortAs ? B.deserialize(t.sortAs) : void 0,
2028
2028
  code: t.code,
2029
2029
  scheme: t.scheme,
2030
- links: C.deserialize(t.links)
2030
+ links: z.deserialize(t.links)
2031
2031
  }) : void 0;
2032
2032
  }
2033
2033
  /**
@@ -2096,7 +2096,7 @@ const et = class et {
2096
2096
  */
2097
2097
  static deserialize(t) {
2098
2098
  if (!(t && t.title)) return;
2099
- const e = B.deserialize(t.title), i = t["@type"], r = _(t.conformsTo), n = t.identifier, a = J.deserialize(t.altIdentifier), o = B.deserialize(t.subtitle), h = B.deserialize(t.sortAs), m = O.deserialize(t.artist), p = O.deserialize(t.author), u = O.deserialize(t.colorist), g = O.deserialize(t.contributor), A = O.deserialize(t.editor), N = O.deserialize(t.illustrator), d = O.deserialize(t.inker), x = O.deserialize(t.letterer), G = O.deserialize(t.narrator), Be = O.deserialize(t.penciler), Ge = O.deserialize(t.translator), We = _(t.language), He = t.description, Fe = O.deserialize(t.publisher), _e = O.deserialize(t.imprint), Ve = lt(t.published), Ye = lt(t.modified), $e = Yt.deserialize(t.subject), Xe = Q.deserialize(t.belongsTo), Ke = V.deserialize(t.accessibility), Ze = t.layout, Je = t.readingProgression, qe = z(t.duration), Qe = z(t.numberOfPages), je = $t.deserialize(t.tdm);
2099
+ const e = B.deserialize(t.title), i = t["@type"], r = _(t.conformsTo), n = t.identifier, a = J.deserialize(t.altIdentifier), o = B.deserialize(t.subtitle), h = B.deserialize(t.sortAs), p = O.deserialize(t.artist), m = O.deserialize(t.author), u = O.deserialize(t.colorist), g = O.deserialize(t.contributor), A = O.deserialize(t.editor), P = O.deserialize(t.illustrator), d = O.deserialize(t.inker), I = O.deserialize(t.letterer), G = O.deserialize(t.narrator), Be = O.deserialize(t.penciler), Ge = O.deserialize(t.translator), We = _(t.language), He = t.description, Fe = O.deserialize(t.publisher), _e = O.deserialize(t.imprint), Ve = lt(t.published), Ye = lt(t.modified), $e = Yt.deserialize(t.subject), Xe = Q.deserialize(t.belongsTo), Ke = V.deserialize(t.accessibility), Ze = t.layout, Je = t.readingProgression, qe = L(t.duration), Qe = L(t.numberOfPages), je = $t.deserialize(t.tdm);
2100
2100
  let ot = Object.assign({}, t);
2101
2101
  return et.mappedProperties.forEach((ti) => delete ot[ti]), Object.keys(ot).length === 0 && (ot = void 0), new et({
2102
2102
  title: e,
@@ -2106,14 +2106,14 @@ const et = class et {
2106
2106
  altIdentifier: a,
2107
2107
  subtitle: o,
2108
2108
  sortAs: h,
2109
- artists: m,
2110
- authors: p,
2109
+ artists: p,
2110
+ authors: m,
2111
2111
  colorists: u,
2112
2112
  contributors: g,
2113
2113
  editors: A,
2114
- illustrators: N,
2114
+ illustrators: P,
2115
2115
  inkers: d,
2116
- letterers: x,
2116
+ letterers: I,
2117
2117
  narrators: G,
2118
2118
  pencilers: Be,
2119
2119
  translators: Ge,
@@ -2246,7 +2246,7 @@ class Xt {
2246
2246
  static deserialize(t) {
2247
2247
  if (t)
2248
2248
  return new Xt({
2249
- links: C.deserialize(t.links),
2249
+ links: z.deserialize(t.links),
2250
2250
  guided: K.deserializeArray(t.guided)
2251
2251
  });
2252
2252
  }
@@ -2475,7 +2475,7 @@ const wt = {
2475
2475
  "Sat"
2476
2476
  ];
2477
2477
  function fe(s) {
2478
- return /^[A-Z][a-z].*/.test(s) || Ot(s);
2478
+ return /^[A-Z][a-z].*/.test(s) || Lt(s);
2479
2479
  }
2480
2480
  function mi(s) {
2481
2481
  return fe(s) || /``|"|'/.test(s.substring(0, 2));
@@ -2498,7 +2498,7 @@ function ne(s) {
2498
2498
  function ae(s) {
2499
2499
  return s.length <= 3 ? !0 : fe(s);
2500
2500
  }
2501
- function Ot(s, t) {
2501
+ function Lt(s, t) {
2502
2502
  return t && (s = s.slice(t - 1, t + 2)), !isNaN(Number(s));
2503
2503
  }
2504
2504
  function vi(s) {
@@ -2529,29 +2529,29 @@ function Si(s, t) {
2529
2529
  s.re(e, { split: !0 }),
2530
2530
  // Merge words as sentences
2531
2531
  s.splitAndMerge(function(i, r, n, a, o, h) {
2532
- var m, p = [i, null], u = i, g = h.slice(o + 1).find(function(N) {
2533
- return !e.test(N.value);
2532
+ var p, m = [i, null], u = i, g = h.slice(o + 1).find(function(P) {
2533
+ return !e.test(P.value);
2534
2534
  });
2535
2535
  if (i === `
2536
2536
  ` && t.newlineBoundary || wi(i) || wt.endsWithChar(i, "?!"))
2537
- return p;
2537
+ return m;
2538
2538
  if (wt.endsWithChar(i, ".")) {
2539
2539
  if (g) {
2540
2540
  if (i.length === 2 && isNaN(i.charAt(0)) && i.match(/[a-zA-Z]/) || gi(i))
2541
2541
  return u;
2542
2542
  if (mi(g.value)) {
2543
- if (bi(i, g.value) || Ot(g.value) && ae(i))
2543
+ if (bi(i, g.value) || Lt(g.value) && ae(i))
2544
2544
  return u;
2545
2545
  } else if (wt.endsWith(i, "..") || ne(i) || ae(i))
2546
2546
  return u;
2547
2547
  }
2548
- return p;
2548
+ return m;
2549
2549
  }
2550
2550
  let A;
2551
- return (A = i.indexOf(".")) > -1 && (Ot(i, A) || ne(i) || Ai(i) || vi(i)) ? u : (m = yi(i)) ? [
2552
- m[0] + m[1],
2551
+ return (A = i.indexOf(".")) > -1 && (Lt(i, A) || ne(i) || Ai(i) || vi(i)) ? u : (p = yi(i)) ? [
2552
+ p[0] + p[1],
2553
2553
  null,
2554
- m[2]
2554
+ p[2]
2555
2555
  ] : u;
2556
2556
  }),
2557
2557
  // Filter empty sentences
@@ -2590,7 +2590,7 @@ function Ni(s, t) {
2590
2590
  }), typeof i == "object" && (i.index = i.index || 0, e = e + i.index + i.offset, i.index = s.index + i.index, i.offset = i.offset || i.value.length), i);
2591
2591
  });
2592
2592
  }
2593
- function Li(s, t) {
2593
+ function Oi(s, t) {
2594
2594
  if (s.length == 0) return null;
2595
2595
  var e = "", i = 0, r = s[0]?.index;
2596
2596
  return s.forEach(function(n, a) {
@@ -2598,8 +2598,8 @@ function Li(s, t) {
2598
2598
  s[a + 1];
2599
2599
  var h = o ? n.index + 1 - (o.index + o.offset) : 0;
2600
2600
  e = e + new Array(h).join(t) + n.value;
2601
- var m = n.index - r + n.offset;
2602
- m > i && (i = m);
2601
+ var p = n.index - r + n.offset;
2602
+ p > i && (i = p);
2603
2603
  }), {
2604
2604
  // Index equal is the one from the first token
2605
2605
  index: r,
@@ -2611,13 +2611,13 @@ const j = {
2611
2611
  tokensId: Ii,
2612
2612
  normalize: Ni,
2613
2613
  properties: xi,
2614
- merge: Li
2614
+ merge: Oi
2615
2615
  };
2616
- var Oi = ' \r\n  !"#$%&()*+,-.\\/:;<=>?@[\\]^_`{|}~', zi = new RegExp(
2617
- "([^" + Oi + "]+)"
2616
+ var Li = ' \r\n  !"#$%&()*+,-.\\/:;<=>?@[\\]^_`{|}~', zi = new RegExp(
2617
+ "([^" + Li + "]+)"
2618
2618
  );
2619
- function R(s) {
2620
- if (!(this instanceof R)) return new R(s);
2619
+ function C(s) {
2620
+ if (!(this instanceof C)) return new C(s);
2621
2621
  this.opts = Object.assign({
2622
2622
  cacheGet: function(t) {
2623
2623
  return null;
@@ -2626,7 +2626,7 @@ function R(s) {
2626
2626
  }
2627
2627
  }, s);
2628
2628
  }
2629
- R.prototype.split = function(t, e = {}) {
2629
+ C.prototype.split = function(t, e = {}) {
2630
2630
  var i = this;
2631
2631
  return e = Object.assign({ preserveProperties: !0, cache: () => null }, e), function(r, n) {
2632
2632
  if (arguments.length === 6) return t.apply(null, arguments);
@@ -2638,32 +2638,32 @@ R.prototype.split = function(t, e = {}) {
2638
2638
  offset: r.length
2639
2639
  }] : Array.isArray(r) || (r = [r]), o = j.tokensId(r, e.cache()), o && (h = i.opts.cacheGet(o), h))
2640
2640
  return h;
2641
- var m = r.map(function(p, u) {
2641
+ var p = r.map(function(m, u) {
2642
2642
  var g = r[u + 1], A = t(
2643
- p.value,
2644
- Object.assign({}, p),
2643
+ m.value,
2644
+ Object.assign({}, m),
2645
2645
  a ? Object.assign({}, a) : null,
2646
2646
  g ? Object.assign({}, g) : null,
2647
2647
  u,
2648
2648
  r
2649
2649
  ) || [];
2650
- if (A = j.normalize(p, A), e.preserveProperties) {
2651
- var N = j.properties(p);
2650
+ if (A = j.normalize(m, A), e.preserveProperties) {
2651
+ var P = j.properties(m);
2652
2652
  A = A.map(function(d) {
2653
- return Object.assign({}, d, N);
2653
+ return Object.assign({}, d, P);
2654
2654
  });
2655
2655
  }
2656
- return a = p, A;
2656
+ return a = m, A;
2657
2657
  }).filter(Boolean).flat();
2658
- return o && i.opts.cacheSet(o, m), m;
2658
+ return o && i.opts.cacheSet(o, p), p;
2659
2659
  };
2660
2660
  };
2661
- R.prototype.re = function(t, e = {}) {
2661
+ C.prototype.re = function(t, e = {}) {
2662
2662
  return e = Object.assign({ split: !1 }, e), this.split(function(i, r) {
2663
2663
  for (var n = i, a = [], o, h = 0; o = t.exec(i); ) {
2664
- var m = o.index, p = h + m, u = o[0] || "", g = u.length;
2665
- if (e.split && h < p) {
2666
- var A = n.slice(h, p);
2664
+ var p = o.index, m = h + p, u = o[0] || "", g = u.length;
2665
+ if (e.split && h < m) {
2666
+ var A = n.slice(h, m);
2667
2667
  a.push({
2668
2668
  value: A,
2669
2669
  index: h,
@@ -2672,10 +2672,10 @@ R.prototype.re = function(t, e = {}) {
2672
2672
  }
2673
2673
  a.push({
2674
2674
  value: u,
2675
- index: p,
2675
+ index: m,
2676
2676
  offset: g,
2677
2677
  match: o
2678
- }), i = i.slice(m + g), h = p + g;
2678
+ }), i = i.slice(p + g), h = m + g;
2679
2679
  }
2680
2680
  return e.split && i && a.push({
2681
2681
  value: i,
@@ -2688,7 +2688,7 @@ R.prototype.re = function(t, e = {}) {
2688
2688
  }
2689
2689
  });
2690
2690
  };
2691
- R.prototype.splitAndMerge = function(t, e = {}) {
2691
+ C.prototype.splitAndMerge = function(t, e = {}) {
2692
2692
  var i = this;
2693
2693
  return e = Object.assign({ mergeWith: "" }, e), function(r) {
2694
2694
  var n = [], a = [];
@@ -2698,15 +2698,15 @@ R.prototype.splitAndMerge = function(t, e = {}) {
2698
2698
  n.push(h), a = [];
2699
2699
  }
2700
2700
  }
2701
- return i.split(function(h, m) {
2702
- var p = t.apply(null, arguments);
2703
- p = j.normalize(m, p), p.forEach(function(u) {
2701
+ return i.split(function(h, p) {
2702
+ var m = t.apply(null, arguments);
2703
+ m = j.normalize(p, m), m.forEach(function(u) {
2704
2704
  u === null ? o() : a.push(u);
2705
2705
  });
2706
2706
  })(r), o(), n;
2707
2707
  };
2708
2708
  };
2709
- R.prototype.filter = function(t) {
2709
+ C.prototype.filter = function(t) {
2710
2710
  return this.split(function(e, i) {
2711
2711
  if (t.apply(null, arguments))
2712
2712
  return {
@@ -2716,7 +2716,7 @@ R.prototype.filter = function(t) {
2716
2716
  };
2717
2717
  });
2718
2718
  };
2719
- R.prototype.extend = function(t) {
2719
+ C.prototype.extend = function(t) {
2720
2720
  return this.split(function(e, i) {
2721
2721
  var r = typeof t == "function" ? t.apply(null, arguments) : t;
2722
2722
  return Object.assign({
@@ -2726,7 +2726,7 @@ R.prototype.extend = function(t) {
2726
2726
  }, r);
2727
2727
  });
2728
2728
  };
2729
- R.prototype.ifthen = function(s, t) {
2729
+ C.prototype.ifthen = function(s, t) {
2730
2730
  return this.split(function(e, i) {
2731
2731
  if (s.apply(null, arguments))
2732
2732
  return t.apply(null, arguments);
@@ -2734,35 +2734,35 @@ R.prototype.ifthen = function(s, t) {
2734
2734
  return n;
2735
2735
  });
2736
2736
  };
2737
- R.prototype.test = function(t) {
2737
+ C.prototype.test = function(t) {
2738
2738
  return this.filter(function(e, i) {
2739
2739
  return t.test(e);
2740
2740
  }, {
2741
2741
  cache: t.toString()
2742
2742
  });
2743
2743
  };
2744
- R.prototype.flow = function(...t) {
2744
+ C.prototype.flow = function(...t) {
2745
2745
  const e = t.reduce((i, r) => (...n) => r(i(...n)));
2746
2746
  return this.split(e);
2747
2747
  };
2748
- R.prototype.serie = function(...t) {
2748
+ C.prototype.serie = function(...t) {
2749
2749
  return t.reduce((e, i) => (...r) => i(e(...r)));
2750
2750
  };
2751
- R.prototype.merge = function() {
2751
+ C.prototype.merge = function() {
2752
2752
  return this.splitAndMerge((s) => [s]);
2753
2753
  };
2754
- R.prototype.sections = function() {
2754
+ C.prototype.sections = function() {
2755
2755
  return this.re(/([^\n\.,;!?]+)/i, { split: !1 });
2756
2756
  };
2757
- R.prototype.words = function() {
2757
+ C.prototype.words = function() {
2758
2758
  return this.re(zi);
2759
2759
  };
2760
- R.prototype.characters = function() {
2760
+ C.prototype.characters = function() {
2761
2761
  return this.re(/[^\s]/);
2762
2762
  };
2763
2763
  var Ci = /* @__PURE__ */ ((s) => (s.Word = "word", s.Sentence = "sentence", s.Paragraph = "paragraph", s))(Ci || {});
2764
- const Ri = (s, t) => "Segmenter" in Intl ? new ki(s, t) : new Pi(s, t);
2765
- class ki {
2764
+ const Ri = (s, t) => "Segmenter" in Intl ? new Pi(s, t) : new ki(s, t);
2765
+ class Pi {
2766
2766
  constructor(t, e) {
2767
2767
  if (this.unit = e, t = t ?? navigator?.language, !("Segmenter" in Intl)) throw new Error("Intl.Segmenter is not supported in this environment");
2768
2768
  if (e === "paragraph") throw new Error("IntlTextTokenizer does not handle TextUnit.Paragraph");
@@ -2780,10 +2780,10 @@ class ki {
2780
2780
  return i;
2781
2781
  }
2782
2782
  }
2783
- class Pi {
2783
+ class ki {
2784
2784
  constructor(t, e) {
2785
2785
  if (this.unit = e, t = t ?? navigator?.language, this.isEnglish = t.toLowerCase().split("-")[0] === "en", e === "paragraph") throw new Error("NaiveTextTokenizer does not handle TextUnit.Paragraph");
2786
- this.tokenizer = new R();
2786
+ this.tokenizer = new C();
2787
2787
  }
2788
2788
  tokenize(t) {
2789
2789
  let e = [];
@@ -2810,21 +2810,21 @@ const Di = new RegExp("[\\p{L}\\p{N}]+", "u"), pe = (s) => {
2810
2810
  const t = s.trimEnd();
2811
2811
  return t.length === 0 || t.match(Di) === null ? null : t;
2812
2812
  };
2813
- class I {
2813
+ class x {
2814
2814
  constructor(t, e) {
2815
2815
  this._allItems = t, this.linkMap = e;
2816
2816
  }
2817
2817
  static build(t, e = {}) {
2818
2818
  const i = t.toc?.items ?? [], r = t.readingOrder.items, { depth: n } = e, a = /* @__PURE__ */ new Map(), o = [];
2819
2819
  for (let h = 0; h < r.length; h++) {
2820
- const m = r[h], p = I.bareHref(m.href), u = m.title ?? I.findTitleInToc(i, p, n) ?? `Resource ${h + 1}`, g = I.collectChildrenFromToc(i, p, n, 1, a), A = {
2820
+ const p = r[h], m = x.bareHref(p.href), u = p.title ?? x.findTitleInToc(i, m, n) ?? `Resource ${h + 1}`, g = x.collectChildrenFromToc(i, m, n, 1, a), A = {
2821
2821
  title: u,
2822
- references: [m.href],
2822
+ references: [p.href],
2823
2823
  children: g.length > 0 ? g : void 0
2824
- }, N = I.findTocLink(i, p, n);
2825
- a.set(A, N ?? m), o.push(A);
2824
+ };
2825
+ a.set(A, p), o.push(A);
2826
2826
  }
2827
- return new I(o, a);
2827
+ return new x(o, a);
2828
2828
  }
2829
2829
  /**
2830
2830
  * The active depth limit for TOC traversal (title resolution and child
@@ -2839,7 +2839,7 @@ class I {
2839
2839
  }
2840
2840
  /** Top-level timeline items. Cached; invalidated when `depth` changes. */
2841
2841
  get items() {
2842
- return this._items || (this._items = this._depth !== void 0 ? I.trimToDepth(this._allItems, this._depth) : this._allItems), this._items;
2842
+ return this._items || (this._items = this._depth !== void 0 ? x.trimToDepth(this._allItems, this._depth) : this._allItems), this._items;
2843
2843
  }
2844
2844
  locate(t) {
2845
2845
  const e = t.href.split("#")[0], i = t.locations?.time();
@@ -2867,10 +2867,10 @@ class I {
2867
2867
  if (i !== void 0) {
2868
2868
  const o = e * i;
2869
2869
  let h = n;
2870
- for (const m of n.children) {
2871
- const p = this.timeFromItem(m);
2872
- if (p === void 0 || p > o) break;
2873
- h = m;
2870
+ for (const p of n.children) {
2871
+ const m = this.timeFromItem(p);
2872
+ if (m === void 0 || m > o) break;
2873
+ h = p;
2874
2874
  }
2875
2875
  return h;
2876
2876
  }
@@ -2897,18 +2897,10 @@ class I {
2897
2897
  * 3. Multiple fragment entries — ambiguous, returns `undefined`.
2898
2898
  */
2899
2899
  static findTitleInToc(t, e, i) {
2900
- const { atStart: r, fragments: n } = I.collectTocCandidates(t, e, i, 1);
2900
+ const { atStart: r, fragments: n } = x.collectTocCandidates(t, e, i, 1);
2901
2901
  if (r.length > 0) return r[0].title;
2902
2902
  if (n.length === 1) return n[0].title;
2903
2903
  }
2904
- /**
2905
- * Return the most relevant TOC Link for `bare` (used for `linkFor`).
2906
- * Prefers a start-of-resource entry; falls back to the first fragment entry.
2907
- */
2908
- static findTocLink(t, e, i) {
2909
- const { atStart: r, fragments: n } = I.collectTocCandidates(t, e, i, 1);
2910
- return r[0] ?? n[0];
2911
- }
2912
2904
  /**
2913
2905
  * Collect all TOC entries that reference `bare` as flat children, walking
2914
2906
  * up to `maxDepth` levels deep. Start-of-resource entries (#t=0 or no
@@ -2919,11 +2911,11 @@ class I {
2919
2911
  if (i !== void 0 && r > i) return [];
2920
2912
  const a = [];
2921
2913
  for (const o of t) {
2922
- if (I.bareHref(o.href) === e && o.title && !I.isStartOfResource(o.href)) {
2914
+ if (x.bareHref(o.href) === e && o.title && !x.isStartOfResource(o.href)) {
2923
2915
  const h = { title: o.title, references: [o.href] };
2924
2916
  n.set(h, o), a.push(h);
2925
2917
  }
2926
- o.children?.items?.length && a.push(...I.collectChildrenFromToc(
2918
+ o.children?.items?.length && a.push(...x.collectChildrenFromToc(
2927
2919
  o.children.items,
2928
2920
  e,
2929
2921
  i,
@@ -2943,8 +2935,8 @@ class I {
2943
2935
  return { atStart: [], fragments: [] };
2944
2936
  const n = [], a = [];
2945
2937
  for (const o of t)
2946
- if (I.bareHref(o.href) === e && o.title && (I.isStartOfResource(o.href) ? n.push(o) : a.push(o)), o.children?.items?.length) {
2947
- const h = I.collectTocCandidates(
2938
+ if (x.bareHref(o.href) === e && o.title && (x.isStartOfResource(o.href) ? n.push(o) : a.push(o)), o.children?.items?.length) {
2939
+ const h = x.collectTocCandidates(
2948
2940
  o.children.items,
2949
2941
  e,
2950
2942
  i,
@@ -2968,7 +2960,7 @@ class I {
2968
2960
  static trimToDepth(t, e) {
2969
2961
  return t.map((i) => ({
2970
2962
  ...i,
2971
- children: e > 1 && i.children?.length ? I.trimToDepth(i.children, e - 1) : void 0
2963
+ children: e > 1 && i.children?.length ? x.trimToDepth(i.children, e - 1) : void 0
2972
2964
  }));
2973
2965
  }
2974
2966
  flattenItems(t) {
@@ -2980,7 +2972,7 @@ class I {
2980
2972
  itemMatchesTime(t, e, i) {
2981
2973
  for (const r of t.references) {
2982
2974
  const n = r.indexOf("#"), a = n >= 0 ? r.slice(0, n) : r, o = n >= 0 ? r.slice(n + 1) : void 0;
2983
- if ((a || e) === e && i >= I.parseTimeFragment(o))
2975
+ if ((a || e) === e && i >= x.parseTimeFragment(o))
2984
2976
  return !0;
2985
2977
  }
2986
2978
  return !1;
@@ -3025,7 +3017,7 @@ class Y {
3025
3017
  * with a specific configuration (e.g. a depth limit).
3026
3018
  */
3027
3019
  get timeline() {
3028
- return this._timeline || (this._timeline = I.build(this)), this._timeline;
3020
+ return this._timeline || (this._timeline = x.build(this)), this._timeline;
3029
3021
  }
3030
3022
  /** The URL where this publication is served, computed from the `Link` with `self` relation.
3031
3023
  * e.g. https://provider.com/pub1293/manifest.json gives https://provider.com/pub1293/
@@ -3146,10 +3138,10 @@ class gt {
3146
3138
  */
3147
3139
  static deserialize(t) {
3148
3140
  if (!(t && t.cssSelector)) return;
3149
- let e = z(t.textNodeIndex);
3141
+ let e = L(t.textNodeIndex);
3150
3142
  if (e === void 0) return;
3151
- let i = z(t.charOffset);
3152
- return i === void 0 && (i = z(t.offset)), new gt({
3143
+ let i = L(t.charOffset);
3144
+ return i === void 0 && (i = L(t.offset)), new gt({
3153
3145
  cssSelector: t.cssSelector,
3154
3146
  textNodeIndex: e,
3155
3147
  charOffset: i
@@ -3247,7 +3239,7 @@ class Zt {
3247
3239
  let e = t.currency;
3248
3240
  if (!(e && typeof e == "string" && e.length > 0))
3249
3241
  return;
3250
- let i = z(t.value);
3242
+ let i = L(t.value);
3251
3243
  if (i !== void 0)
3252
3244
  return new Zt({ currency: e, value: i });
3253
3245
  }
@@ -3296,8 +3288,8 @@ class Jt {
3296
3288
  static deserialize(t) {
3297
3289
  if (t)
3298
3290
  return new Jt({
3299
- total: z(t.total),
3300
- position: z(t.position)
3291
+ total: L(t.total),
3292
+ position: L(t.position)
3301
3293
  });
3302
3294
  }
3303
3295
  /**
@@ -3319,8 +3311,8 @@ class qt {
3319
3311
  static deserialize(t) {
3320
3312
  if (t)
3321
3313
  return new qt({
3322
- total: z(t.total),
3323
- available: z(t.available)
3314
+ total: L(t.total),
3315
+ available: L(t.available)
3324
3316
  });
3325
3317
  }
3326
3318
  /**
@@ -3357,7 +3349,7 @@ class Qt {
3357
3349
  }
3358
3350
  }
3359
3351
  U.prototype.getNumberOfItems = function() {
3360
- return z(this.otherProperties.numberOfItems);
3352
+ return L(this.otherProperties.numberOfItems);
3361
3353
  };
3362
3354
  U.prototype.getPrice = function() {
3363
3355
  return Zt.deserialize(this.otherProperties.price);
@@ -4012,21 +4004,21 @@ function ms(s) {
4012
4004
  const t = s.map(Ne);
4013
4005
  return at(t);
4014
4006
  }
4015
- function Le(s) {
4007
+ function Oe(s) {
4016
4008
  var t;
4017
4009
  return ((t = s.getAttribute("class")) !== null && t !== void 0 ? t : "").trim().split(/\s+/).filter((e) => !ls.test(e)).map((e) => `.${rt(e)}`);
4018
4010
  }
4019
4011
  function gs(s) {
4020
- const t = s.map(Le);
4012
+ const t = s.map(Oe);
4021
4013
  return at(t);
4022
4014
  }
4023
- function Oe(s) {
4015
+ function Le(s) {
4024
4016
  var t;
4025
4017
  const e = (t = s.getAttribute("id")) !== null && t !== void 0 ? t : "", i = `#${rt(e)}`, r = s.getRootNode({ composed: !1 });
4026
4018
  return !cs.test(e) && te([s], i, r) ? [i] : [];
4027
4019
  }
4028
4020
  function bs(s) {
4029
- return s.length === 0 || s.length > 1 ? [] : Oe(s[0]);
4021
+ return s.length === 0 || s.length > 1 ? [] : Le(s[0]);
4030
4022
  }
4031
4023
  function ze(s) {
4032
4024
  var t;
@@ -4052,7 +4044,7 @@ function Re(s) {
4052
4044
  ];
4053
4045
  return t.length === 0 || t.length > 1 ? [] : [t[0]];
4054
4046
  }
4055
- function ke(s) {
4047
+ function Pe(s) {
4056
4048
  const t = Re([s])[0], e = s.parentElement;
4057
4049
  if (e) {
4058
4050
  const r = Array.from(e.children).filter((n) => n.tagName.toLowerCase() === t).indexOf(s);
@@ -4064,15 +4056,15 @@ function ke(s) {
4064
4056
  return [];
4065
4057
  }
4066
4058
  function As(s) {
4067
- return at(s.map(ke));
4059
+ return at(s.map(Pe));
4068
4060
  }
4069
- function* Pe(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
4070
- let e = 0, i = kt(1);
4061
+ function* ke(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
4062
+ let e = 0, i = Pt(1);
4071
4063
  for (; i.length <= s.length && e < t; )
4072
4064
  e += 1, yield i.map((n) => s[n]), i = ws(i, s.length - 1);
4073
4065
  }
4074
4066
  function ys(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
4075
- return Array.from(Pe(s, { maxResults: t }));
4067
+ return Array.from(ke(s, { maxResults: t }));
4076
4068
  }
4077
4069
  function ws(s = [], t = 0) {
4078
4070
  const e = s.length;
@@ -4083,12 +4075,12 @@ function ws(s = [], t = 0) {
4083
4075
  for (let r = e - 1; r >= 0; r--)
4084
4076
  if (i[r] > t) {
4085
4077
  if (r === 0)
4086
- return kt(e + 1);
4078
+ return Pt(e + 1);
4087
4079
  i[r - 1]++, i[r] = i[r - 1] + 1;
4088
4080
  }
4089
- return i[e - 1] > t ? kt(e + 1) : i;
4081
+ return i[e - 1] > t ? Pt(e + 1) : i;
4090
4082
  }
4091
- function kt(s = 1) {
4083
+ function Pt(s = 1) {
4092
4084
  return Array.from(Array(s).keys());
4093
4085
  }
4094
4086
  function* Ss(s = {}) {
@@ -4131,16 +4123,16 @@ const xs = {
4131
4123
  nthoftype: As
4132
4124
  }, Ns = {
4133
4125
  tag: Ce,
4134
- id: Oe,
4135
- class: Le,
4126
+ id: Le,
4127
+ class: Oe,
4136
4128
  attribute: Ne,
4137
4129
  nthchild: ze,
4138
- nthoftype: ke
4130
+ nthoftype: Pe
4139
4131
  };
4140
- function Ls(s, t) {
4132
+ function Os(s, t) {
4141
4133
  return Ns[t](s);
4142
4134
  }
4143
- function Os(s, t) {
4135
+ function Ls(s, t) {
4144
4136
  const e = xs[t];
4145
4137
  return e(s);
4146
4138
  }
@@ -4154,18 +4146,18 @@ function Cs(s = [], t) {
4154
4146
  });
4155
4147
  }
4156
4148
  function* Rs(s, t) {
4157
- const e = /* @__PURE__ */ new Set(), i = ks(s, t);
4149
+ const e = /* @__PURE__ */ new Set(), i = Ps(s, t);
4158
4150
  for (const r of Ms(i, t))
4159
4151
  e.has(r) || (e.add(r), yield r);
4160
4152
  }
4161
- function ks(s, t) {
4162
- const { blacklist: e, whitelist: i, combineWithinSelector: r, maxCombinations: n } = t, a = Rt(e), o = Rt(i), h = (m, p) => {
4163
- const u = Os(s, p), g = zs(u, a, o), A = Cs(g, o);
4164
- return m[p] = r ? Array.from(Pe(A, { maxResults: n })) : A.map((N) => [N]), m;
4153
+ function Ps(s, t) {
4154
+ const { blacklist: e, whitelist: i, combineWithinSelector: r, maxCombinations: n } = t, a = Rt(e), o = Rt(i), h = (p, m) => {
4155
+ const u = Ls(s, m), g = zs(u, a, o), A = Cs(g, o);
4156
+ return p[m] = r ? Array.from(ke(A, { maxResults: n })) : A.map((P) => [P]), p;
4165
4157
  };
4166
- return Ps(t).reduce(h, {});
4158
+ return ks(t).reduce(h, {});
4167
4159
  }
4168
- function Ps(s) {
4160
+ function ks(s) {
4169
4161
  const { selectors: t, includeTag: e } = s, i = [...t];
4170
4162
  return e && !i.includes("tag") && i.push("tag"), i;
4171
4163
  }
@@ -4233,11 +4225,11 @@ function* Ys({ elements: s, root: t, rootSelector: e = "", options: i }) {
4233
4225
  for (; a; ) {
4234
4226
  let o = !1;
4235
4227
  for (const h of Vs(s, r, n, i)) {
4236
- const { foundElements: m, selector: p } = h;
4237
- if (o = !0, te(s, p, t))
4238
- yield p;
4228
+ const { foundElements: p, selector: m } = h;
4229
+ if (o = !0, te(s, m, t))
4230
+ yield m;
4239
4231
  else {
4240
- r = m[0], n = p;
4232
+ r = p[0], n = m;
4241
4233
  break;
4242
4234
  }
4243
4235
  }
@@ -4258,7 +4250,7 @@ function Xs(s) {
4258
4250
  function Ks(s, t, e = bt.NONE) {
4259
4251
  const i = {};
4260
4252
  return t.forEach((r) => {
4261
- Reflect.set(i, r, Ls(s, r).map(Xs));
4253
+ Reflect.set(i, r, Os(s, r).map(Xs));
4262
4254
  }), {
4263
4255
  element: s,
4264
4256
  operator: e,
@@ -4467,7 +4459,7 @@ class tr {
4467
4459
  const a = De(e, {
4468
4460
  root: this.doc
4469
4461
  });
4470
- return r.forEach((o, h) => o.forEach((m) => h.attributes.setNamedItem(m))), this.recipeCssSelectorCache.set(e, a), a;
4462
+ return r.forEach((o, h) => o.forEach((p) => h.attributes.setNamedItem(p))), this.recipeCssSelectorCache.set(e, a), a;
4471
4463
  }
4472
4464
  // Implements NodeTraversor
4473
4465
  head(t, e) {
@@ -4502,17 +4494,17 @@ class tr {
4502
4494
  href: a
4503
4495
  });
4504
4496
  else {
4505
- const h = [...n.getElementsByTagName("source")].map((m) => {
4506
- const p = Et(m, this.baseLocator.href);
4507
- return p ? new M({
4508
- href: p,
4509
- type: m.getAttribute("type") || void 0
4497
+ const h = [...n.getElementsByTagName("source")].map((p) => {
4498
+ const m = Et(p, this.baseLocator.href);
4499
+ return m ? new M({
4500
+ href: m,
4501
+ type: p.getAttribute("type") || void 0
4510
4502
  }) : null;
4511
- }).filter((m) => !!m);
4503
+ }).filter((p) => !!p);
4512
4504
  h.length > 0 && (o = new M({
4513
4505
  href: h[0].href,
4514
4506
  type: h[0].type,
4515
- alternates: h.length > 1 ? new C(h.slice(1)) : void 0
4507
+ alternates: h.length > 1 ? new z(h.slice(1)) : void 0
4516
4508
  }));
4517
4509
  }
4518
4510
  o && (r === "AUDIO" ? this.elementRecipes.push({
@@ -4637,7 +4629,7 @@ class Ue {
4637
4629
  * Creates a [LocatorCollection].
4638
4630
  */
4639
4631
  constructor(t) {
4640
- this.metadata = t.metadata ?? new At({}), this.links = t.links ?? new C([]), this.locators = t.locators ?? [];
4632
+ this.metadata = t.metadata ?? new At({}), this.links = t.links ?? new z([]), this.locators = t.locators ?? [];
4641
4633
  }
4642
4634
  /**
4643
4635
  * Parses a [LocatorCollection] from its RWPM JSON representation.
@@ -4647,7 +4639,7 @@ class Ue {
4647
4639
  let e, i = t.locators;
4648
4640
  return i && Array.isArray(i) && (e = i.map((r) => D.deserialize(r)).filter((r) => r !== void 0)), new Ue({
4649
4641
  metadata: At.deserialize(t.metadata),
4650
- links: C.deserialize(t.links),
4642
+ links: z.deserialize(t.links),
4651
4643
  locators: e
4652
4644
  });
4653
4645
  }
@@ -4677,9 +4669,9 @@ class H {
4677
4669
  if (!t) return;
4678
4670
  let e, i, r;
4679
4671
  if (Array.isArray(t))
4680
- e = C.deserialize(t);
4672
+ e = z.deserialize(t);
4681
4673
  else if (typeof t == "object")
4682
- e = C.deserialize(t.links), i = /* @__PURE__ */ new Map(), t.metadata && Object.entries(t.metadata).forEach(([n, a]) => {
4674
+ e = z.deserialize(t.links), i = /* @__PURE__ */ new Map(), t.metadata && Object.entries(t.metadata).forEach(([n, a]) => {
4683
4675
  i?.set(n, a);
4684
4676
  }), r = H.deserializeCollections(t);
4685
4677
  else
@@ -4744,9 +4736,9 @@ class Me {
4744
4736
  if (!t) return;
4745
4737
  const e = pt.deserialize(t.metadata);
4746
4738
  if (!e) return;
4747
- const i = C.deserialize(t.links);
4739
+ const i = z.deserialize(t.links);
4748
4740
  if (!i) return;
4749
- const r = C.deserialize(
4741
+ const r = z.deserialize(
4750
4742
  t.readingOrder ? t.readingOrder : t.spine
4751
4743
  );
4752
4744
  if (r)
@@ -4755,8 +4747,8 @@ class Me {
4755
4747
  metadata: e,
4756
4748
  links: i,
4757
4749
  readingOrder: r,
4758
- resources: C.deserialize(t.resources),
4759
- toc: C.deserialize(t.toc),
4750
+ resources: z.deserialize(t.resources),
4751
+ toc: z.deserialize(t.toc),
4760
4752
  subcollections: H.deserializeCollections({
4761
4753
  sub: t.sub
4762
4754
  })
@@ -4808,16 +4800,16 @@ class Me {
4808
4800
  linkWithHref(t) {
4809
4801
  const e = (o) => {
4810
4802
  let h;
4811
- for (const p of o)
4812
- if (h = p.findWithHref(t), h !== void 0)
4803
+ for (const m of o)
4804
+ if (h = m.findWithHref(t), h !== void 0)
4813
4805
  return h;
4814
- const m = new Array();
4815
- return o.forEach((p) => {
4806
+ const p = new Array();
4807
+ return o.forEach((m) => {
4816
4808
  const u = [];
4817
- for (const g of p.items)
4809
+ for (const g of m.items)
4818
4810
  g.alternates && u.push(g.alternates), g.children && u.push(g.children);
4819
- m.push(...u);
4820
- }), m.length > 0 && (h = e(m)), h;
4811
+ p.push(...u);
4812
+ }), p.length > 0 && (h = e(p)), h;
4821
4813
  }, i = [];
4822
4814
  i.push(this.readingOrder), this.resources && i.push(this.resources), i.push(this.links);
4823
4815
  const r = e(i);
@@ -4860,7 +4852,7 @@ class Me {
4860
4852
  }
4861
4853
  }
4862
4854
  export {
4863
- k as AccessMode,
4855
+ R as AccessMode,
4864
4856
  V as Accessibility,
4865
4857
  rr as AccessibilityMetadataDisplayGuide,
4866
4858
  It as AccessibilityProfile,
@@ -4876,7 +4868,7 @@ export {
4876
4868
  Ui as AvailabilityStatus,
4877
4869
  Q as BelongsTo,
4878
4870
  Hi as Body,
4879
- Pt as Certification,
4871
+ kt as Certification,
4880
4872
  Wt as Conformance,
4881
4873
  ar as Content,
4882
4874
  ge as ContentElement,
@@ -4895,7 +4887,7 @@ export {
4895
4887
  K as GuidedNavigationObject,
4896
4888
  mt as GuidedNavigationText,
4897
4889
  ur as HTMLResourceContentIterator,
4898
- P as Hazard,
4890
+ k as Hazard,
4899
4891
  li as HazardType,
4900
4892
  Gt as Hazards,
4901
4893
  Wi as Heading,
@@ -4904,12 +4896,12 @@ export {
4904
4896
  ii as HttpResource,
4905
4897
  it as IllegalStateError,
4906
4898
  Gi as ImageElement,
4907
- ki as IntlTextTokenizer,
4899
+ Pi as IntlTextTokenizer,
4908
4900
  jt as Iterator,
4909
4901
  X as Layout,
4910
4902
  Ht as Legal,
4911
4903
  M as Link,
4912
- C as Links,
4904
+ z as Links,
4913
4905
  f as Localization,
4914
4906
  B as LocalizedString,
4915
4907
  D as Locator,
@@ -4921,12 +4913,12 @@ export {
4921
4913
  Vt as MediaOverlay,
4922
4914
  c as MediaType,
4923
4915
  pt as Metadata,
4924
- Pi as NaiveTextTokenizer,
4916
+ ki as NaiveTextTokenizer,
4925
4917
  Ut as Navigation,
4926
4918
  ai as NonvisualReading,
4927
4919
  ir as NumberRange,
4928
4920
  St as PDFContentElement,
4929
- Lt as Page,
4921
+ Ot as Page,
4930
4922
  hr as PageContentIteratorPDF,
4931
4923
  oi as PrerecordedAudio,
4932
4924
  Zt as Price,
@@ -4950,7 +4942,7 @@ export {
4950
4942
  be as TextSegment,
4951
4943
  Ci as TextUnit,
4952
4944
  yt as TextualElement,
4953
- I as Timeline,
4945
+ x as Timeline,
4954
4946
  ut as URITemplate,
4955
4947
  Bi as VideoElement,
4956
4948
  ni as VisualAdjustments,
@@ -4960,7 +4952,7 @@ export {
4960
4952
  lt as datefromJSON,
4961
4953
  nr as leadingPage,
4962
4954
  Z as numberfromJSON,
4963
- z as positiveNumberfromJSON,
4955
+ L as positiveNumberfromJSON,
4964
4956
  ht as setToArray,
4965
4957
  pe as speakableToken
4966
4958
  };